Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-core-js

Package Overview
Dependencies
Maintainers
2
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.10 to 2.5.11

4

browser/applicationinsights-core-js.min.js
/*!
* Application Insights JavaScript SDK - Core, 2.5.10
* Application Insights JavaScript SDK - Core, 2.5.11
* 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=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",i="object",n="undefined",o="prototype",a="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 u(e){var n=Object.create;if(n)return n(e);if(null==e)return{};if((n=typeof e)!=i&&n!==r)throw new TypeError("Object prototype may only be an Object:"+e);function t(){}return t[o]=e,new t}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[a](t)&&(e[t]=n[t])})(e,n)},t=function(e,n){function t(){this.constructor=e}s(e,n),e[o]=null===n?u(n):(t[o]=n[o],new t)};(dn=an=e()||{}).__assign||(dn.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[o][a].call(n,i)&&(e[i]=n[i]);return e}),dn.__extends||(dn.__extends=t),__assign=__assign||an.__assign,__extends=__extends||an.__extends;var l={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=i,d=o,v=r,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function I(){return!(typeof navigator!==g||!navigator)}function S(){return I()?navigator:x("navigator")}function N(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function _(){return!!(typeof JSON===g&&JSON||null!==x(h))}function P(){return _()?JSON||x(h):null}function F(){return x("crypto")}function L(){return x("msCrypto")}var M=n,O="attachEvent",A="addEventListener",j="detachEvent",R="removeEventListener",D=4294967296,k=4294967295,U=null,z=!1,B=123456789,K=987654321;function V(e){e<0&&(e>>>=0),B=123456789+e&k,K=987654321-e&k,z=!0}function q(){V(Math.random()*D^(new Date).getTime())}function W(e,n){return typeof e===n}function H(e){return W(e,n)||e===undefined}function G(e){return H(e)||null===e}function J(e,n){return e&&Object[o].hasOwnProperty.call(e,n)}function Q(e){return W(e,i)}function $(e){return W(e,r)}function Z(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!G(e))try{G(e[A])?G(e[O])||(e[O]("on"+n,t),i=!0):(e[A](n,t,r),i=!0)}catch(o){}return i}function Y(e,n,t,r){if(void 0===r&&(r=!1),!G(e))try{G(e[R])?G(e[j])||e[j]("on"+n,t):e[R](n,t,r)}catch(i){}}var X=(ee.isDate=function(e){return"[object Date]"===Object[o].toString.call(e)},ee.isArray=function(e){return"[object Array]"===Object[o].toString.call(e)},ee.isError=function(e){return"[object Error]"===Object[o].toString.call(e)},ee.isString=function(e){return W(e,"string")},ee.isNumber=function(e){return W(e,"number")},ee.isBoolean=function(e){return W(e,"boolean")},ee.disableCookies=function(){ee._canUseCookies=!1},ee.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(ne,function(e){var n=0|ee.randomValue(15);return("x"===e?n:3&n|8).toString(16)})},ee.toISOString=function(e){if(ee.isDate(e)){var n=function(e){return 1===(e+="").length&&(e="0"+e),e};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"}},ee.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},ee.arrIndexOf=function(e,n,t){for(var r=e.length,i=Math.max(0<=(t=t||0)?t:r-Math.abs(t),0);i<r;i++)if(i in e&&e[i]===n)return i;return-1},ee.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},ee.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},ee.strTrim=function(e){return ee.isString(e)?e.replace(/^\s+|\s+$/g,""):e},ee.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!($(e)||Q(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t,r=[];for(t in e)J(e,t)&&r.push(t);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)J(e,i[a])&&r.push(i[a]);return r},ee.objDefineAccessors=function(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1},ee.addEventHandler=function(e,n){var t=!1,r=C();return r&&(t=Z(r,e,n),t=Z(r.body,e,n)||t),(r=T())&&(t=te.Attach(r,e,n)||t),t},ee.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},ee.perfNow=function(){var e=E();return e&&e.now?e.now():ee.dateNow()},ee.newId=function(e){void 0===e&&(e=22);for(var n=ee.random32()>>>0,t=0,r="";r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n],n>>>=6,5==++t&&(n=(ee.random32()<<2&4294967295|3&n)>>>0,t=0);return r},ee.isIE=function(){var e;return null===U&&(e=((S()||{}).userAgent||"").toLowerCase(),U=!!~e.indexOf("msie")||!!~e.indexOf("trident/")),U},ee.randomValue=function(e){return 0<e?Math.floor(ee.random32()/k*(e+1))>>>0:0},ee.random32=function(e){var n=(n=F()||L())&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&k:ee.isIE()?(z||q(),ee.mwcRandom32()&k):Math.floor(D*Math.random()|0);return e||(n>>>=0),n},ee.mwcRandomSeed=function(e){e?V(e):q()},ee.mwcRandom32=function(e){var n=((K=36969*(65535&K)+(K>>16)&k)<<16)+(65535&(B=18e3*(65535&B)+(B>>16)&k))>>>0&k|0;return e||(n>>>=0),n},ee.generateW3CId=function(){for(var e,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",r=0;r<4;r++)t+=n[15&(e=ee.random32())]+n[e>>4&15]+n[e>>8&15]+n[e>>12&15]+n[e>>16&15]+n[e>>20&15]+n[e>>24&15]+n[e>>28&15];var i=n[8+(3&ee.random32())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)},ee.isTypeof=W,ee.isUndefined=H,ee.isNullOrUndefined=G,ee.hasOwnProperty=J,ee.isFunction=$,ee.isObject=Q,ee.objCreate=u,ee);function ee(){}var ne=/[xy]/g,te=(re.Attach=Z,re.AttachEvent=Z,re.Detach=Y,re.DetachEvent=Y,re);function re(){}(dn=c.LoggingSeverity||(c.LoggingSeverity={}))[dn.CRITICAL=1]="CRITICAL",dn[dn.WARNING=2]="WARNING";var ie={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,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103},oe="constructor",ae="prototype",ue="function",se="_dynInstFuncs",ce="_isDynProxy",le="_dynClass",fe="_dynCls$",ge="_dynInstChk",de=ge,ve="_dfOpts",pe="_unknown_",he="__proto__",ye="useBaseInst",xe="setInstFuncs",me=Object.getPrototypeOf,Ce=0;function we(e,n){return e&&Object[ae].hasOwnProperty.call(e,n)}function Te(e){return typeof e===ue}function Ie(e){return e&&(e===Object[ae]||e===Array[ae])}function Se(e){return Ie(e)||e===Function[ae]}function Ne(e){if(e){if(me)return me(e);if(e=e[he]||e[ae]||e[oe])return e}return null}function be(e,n,t){return n!==oe&&Te(e[n])&&(t||we(e,n))}function Ee(e){throw new TypeError("DynamicProto: "+e)}function _e(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function Pe(e,n){return we(e,ae)?e.name||n||pe:((e||{})[oe]||{}).name||n||pe}function Fe(e,t,n,r){we(e,ae)||Ee("theClass is an invalid class definition.");var i=e[ae];!function(e){for(var n=Ne(t);n&&!Se(n);){if(n===e)return 1;n=Ne(n)}}(i)&&Ee("["+Pe(e)+"] is not in class hierarchy of ["+Pe(t)+"]");var o=null;we(i,le)?o=i[le]:(o=fe+Pe(e,"_")+"$"+Ce,Ce++,i[le]=o);var a=Fe[ve],u=!!a[ye];u&&r&&r[ye]!==undefined&&(u=!!r[ye]),n(t,function(e,n,t,o){function r(e,n,t){var r,i=n[s];return i[ce]&&o&&!1!==(r=e[se]||{})[de]&&(i=(r[n[le]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};for(s in t)i[s]=r(n,t,s);for(var a=Ne(e),u=[];a&&!Se(a)&&!_e(u,a);){for(var s in a)!i[s]&&be(a,s,!me)&&(i[s]=r(n,a,s));u.push(a),a=Ne(a)}return i}(i,t,e=function(e){var n,t={};for(n in e)!t[n]&&be(e,n,!1)&&(t[n]=e[n]);return t}(t),u)),(a=!!me&&!!a[xe])&&r&&(a=!!r[xe]),function(e,n,t,r,i){if(!Ie(e)){var o,a=t[se]=t[se]||{},u=a[n]=a[n]||{};for(o in!1!==a[de]&&(a[de]=!!i),t)be(t,o,!1)&&t[o]!==r[o]&&(u[o]=t[o],delete t[o],we(e,o)&&(!e[o]||e[o][ce])||(e[o]=function(t,r){var i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&we(t,le)){var o=e[se]||{};if((i=(o[t[le]]||{})[n])||Ee("Missing ["+n+"] "+ue),!i[ge]&&!1!==o[de]){for(var a=!we(e,n),u=Ne(e),s=[];a&&u&&!Se(u)&&!_e(s,u);){var c=u[n];if(c){a=c===r;break}s.push(u),u=Ne(u)}try{a&&(e[n]=i),i[ge]=1}catch(l){o[de]=!1}}}return i}(this,r,t,i)||((n=t[e=r])===i&&(n=Ne(t)[e]),Te(n)||Ee("["+e+"] is not a "+ue),n)).apply(this,arguments)};return i[ce]=1,i}(e,o)))}}(i,o,t,e,!1!==a)}function Le(e){return e?'"'+e.replace(/\"/g,"")+'"':""}Fe[ve]={setInstFuncs:!0,useBaseInst:!0};var Me=(Oe.dataType="MessageData",Oe);function Oe(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",_()&&(e=P().stringify(r)),e=(n?" message:"+Le(n):"")+(r?" props:"+Le(e):""),this.message+=e}var Ae=function bn(i){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};Fe(bn,this,function(o){var t=X.isNullOrUndefined,a=X.isUndefined,r=X.isFunction;function e(e,n){return e=i[e],t(e)?n:e}t(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(void 0===i&&(i=!1),r=new Me(n,t,i,r),o.enableDebugExceptions())throw r;!a(r)&&r&&(a(r.message)||(i?(i=+r.messageId,!s[i]&&o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(o.warnToConsole(r.message),s[i]=!0)):o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&o.warnToConsole(r.message),o.logInternalMessage(e,r)))},o.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),r(t[n])&&t[n](e))},o.resetInternalMessageCount=function(){u=0,s={}},o.logInternalMessage=function(e,n){var t,r;u>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,s[r]?t=!1:s[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),u++),u===o.maxInternalMessageLimit()&&(n=new Me(ie.MessageLimitPerPVExceeded,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},je="ctx",Re=(De.ParentContextKey="parent",De.ChildrenContextKey="childEvts",De);function De(e,i,n){var t,o=this,a=!1;o.start=X.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},X.isFunction(i)&&(a=X.objDefineAccessors(o,"payload",function(){return!t&&X.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?(e===De.ParentContextKey||e===De.ChildrenContextKey?o:o[je]||{})[e]:null},o.setCtx=function(e,n){e&&(e===De.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===De.ChildrenContextKey?o[e]=n:(o[je]=o[je]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(De.ChildrenContextKey);if(X.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&X.isFunction(i)&&(o.payload=i())}}var ke=function En(n){this.ctx={},Fe(En,this,function(t){t.create=function(e,n,t){return new Re(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[je]=t[je]||{})[e]=n)},t.getCtx=function(e){return(t[je]||{})[e]}})},Ue="CoreUtils.doPerf";function ze(e,n,t,r,i){if(e){var o=e;if(o&&X.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(Ue);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(Re.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(Re.ChildrenContextKey))||(a=[],s.setCtx(Re.ChildrenContextKey,a)),a.push(u))),o.setCtx(Ue,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(Ue,s)}}}return t()}var Be=X.isFunction,Ke=function(i,n){var o=this,a=null,u=Be(i.processTelemetry),s=Be(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ze(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,ie.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},Ve=X.isNullOrUndefined;function qe(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&X.isFunction(o.processTelemetry)&&(o=new Ke(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var We=function _n(e,i,t,n){var r,o,a,u,s=this,c=null;null!==n&&(e&&X.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),qe(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(o=n)&&e&&(a=[],X.arrForEach(e,function(e){!u&&e!==o||(u=!0,a.push(e))})),o&&!u&&(a=a||[]).push(o),c=qe(a,r)):X.isUndefined(n)&&(c=qe(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new Ae(i||{})},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=s.getExtCfg(e,null))&&!Ve(e[n])?r=e[n]:i&&!Ve(i[n])&&(r=i[n]),Ve(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new _n(e||c,i,t,n)}},He=X.isFunction,Ge="getPlugin",t=(Je.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Je);function Je(){var o=this,a=!1,u=null,s=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){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&He(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;return n||(e=u||new We(null,{},o.core),n=s&&s[Ge]?e.createNew(null,s[Ge]):e.createNew(null,s)),n},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Ge]&&(i=s[Ge]()),o.core=n,u=new We(r,e,n,i),a=!0}}var Qe=X.isFunction,$e="processTelemetry",Ze="priority",Ye="setNextPlugin",Xe="isInitialized";function en(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&Qe(r[Ye])&&Qe(o[$e])&&r[Ye](o),Qe(o[Xe])&&o[Xe]()||e.push(o),r=o,i=i.getNext())}X.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function nn(e){return e.sort(function(e,n){var t=0,r=Qe(n[$e]);return Qe(e[$e])?t=r?e[Ze]-n[Ze]:1:r&&(t=-1),t})}var tn,rn=500,on="Channel has invalid priority",an=X.objDefineAccessors,un=(tn=t,__extends(sn,tn),sn._staticInit=(an(sn.prototype,"ChannelControls",sn.prototype.getChannelControls),void an(sn.prototype,"channelQueue",sn.prototype.getChannelControls)),sn);function sn(){var r=tn.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=rn;var s,c=X.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<rn)throw Error(on+e.identifier)}),s.push(e))}return Fe(sn,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&X.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>rn&&o.push(e)}),l(o)),c(s,function(e){return en(new We(e,n,t),r)}))}}),r}var cn,ln=X.arrForEach,fn=X.isNullOrUndefined,gn="_notificationManager",dn=function Pn(){var n,u,s,t,c=!1;Fe(Pn,this,function(a){a._extensions=[],u=new un,a.logger=X.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),n=[],a.isInitialized=function(){return c},a.initialize=function(e,n,r,t){if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||fn(e.instrumentationKey))throw Error("Please provide instrumentation key");s=t,a[gn]=t,a.config=e||{},e.extensions=fn(e.extensions)?[]:e.extensions,(e.extensionConfig=fn(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r&&(a.logger=r),(t=[]).push.apply(t,n.concat(e.extensions)),t=nn(t);var i=[],o={};if(ln(t,function(e){if(fn(e)||fn(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(fn(o[n])?o[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+o[n]+", "+t)),(!n||n<u.priority)&&i.push(e)}),t.push(u),i.push(u),t=nn(t),a._extensions=t,en(new We([u],e,a),t),en(new We(i,e,a),t),a._extensions=i,0===a.getTransmissionControls().length)throw Error("No channels available");c=!0,a.releaseQueue()},a.getTransmissionControls=function(){return u.getChannelControls()},a.track=function(e){e.iKey||(e.iKey=a.config.instrumentationKey),e.time||(e.time=X.toISOString(new Date)),fn(e.ver)&&(e.ver="4.0"),a.isInitialized()?a.getProcessTelContext().processNext(e):n.push(e)},a.getProcessTelContext=function(){var e=a._extensions,n=e;return e&&0!==e.length||(n=[u]),new We(n,a.config,a)},a.getNotifyMgr=function(){return s||(s=X.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),a[gn]=s),s},a.getPerfMgr=function(){return t||a.config&&a.config.enablePerfMgr&&(t=new ke(a.getNotifyMgr())),t},a.setPerfMgr=function(e){t=e},a.eventCnt=function(){return n.length},a.releaseQueue=function(){0<n.length&&(ln(n,function(e){a.getProcessTelContext().processNext(e)}),n=[])}})},vn=function Fn(e){this.listeners=[];var o=X.arrForEach,n=!!(e||{}).perfEvtsSendAll;Fe(Fn,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=X.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=X.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},an=(cn=dn,__extends(pn,cn),pn);function pn(){var e=cn.call(this)||this;return Fe(pn,e,function(t,i){function n(e){var n=t.getNotifyMgr();n&&n.eventsDiscarded([e],l.InvalidEvent)}t.initialize=function(e,n,t,r){i.initialize(e,n,t||new Ae(e),r||new vn(e))},t.track=function(e){ze(t.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(X.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},t.addNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.addNotificationListener(e)},t.removeNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.removeNotificationListener(e)},t.pollInternalLogs=function(n){var e=t.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=t.logger?t.logger.queue:[];X.arrForEach(e,function(e){e={name:n||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:X.toISOString(new Date),baseType:Me.dataType,baseData:{message:e.message}},t.track(e)}),e.length=0},e)}}),e}var hn="_aiHooks",yn=["req","rsp","hkErr","fnErr"],xn="__proto__",mn="constructor";function Cn(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function wn(e,u,s,c,l){0<=l&&l<=2&&Cn(e,function(e,n){var t=e.cbks,r=t[yn[l]];if(r){u.ctx=function(){return c[n]=c[n]||{}};try{r.apply(u.inst,s)}catch(o){e=u.err;try{var i=t[yn[2]];i&&(u.err=o,i.apply(u.inst,s))}catch(a){}finally{u.err=e}}}})}function Tn(s){return function(){var t=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return Cn(e,function(e){n.push(e)}),n}wn(e,r,i,n,0);var a=s.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,wn(e,r,i,n,3),u}return wn(e,r,i,n,1),r.rslt}}var In=Object.getPrototypeOf;function Sn(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t&&((e=function o(e,n,t){var r=null;return e&&(X.hasOwnProperty(e,n)?r=e:t&&(r=o(function(e){if(e){if(In)return In(e);if(e=e[xn]||e[d]||e[mn])return e}return null}(e),n,!1))),r}(e,n,r))&&typeof(r=e[n])===v)){var i=r[hn];return i||((r=Tn(i={i:0,n:n,f:r,h:[]}))[hn]=i,e[n]=r),t={id:i.i,cbks:t,rm:function(){var t=this.id;Cn(i.h,function(e,n){return e.id===t&&(i.h.splice(n,1),1)})}},i.i++,i.h.push(t),t}return null}function Nn(n,e,t,r){void 0===r&&(r=!0);var i=null;return Cn(e,function(e){(e=Sn(n,e,t,r))&&(i=i||[]).push(e)}),i}c.MinChannelPriorty=100,c.EventsDiscardedReason=l,c.AppInsightsCore=an,c.BaseCore=dn,c.BaseTelemetryPlugin=t,c.CoreUtils=X,c.EventHelper=te,c.Undefined=M,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.objForEachKey=function(e,n){if(e&&Q(e))for(var t in e)J(e,t)&&n.call(e,t,e[t])},c.getGlobal=y,c.getGlobalInst=x,c.hasWindow=m,c.getWindow=C,c.hasDocument=w,c.getDocument=T,c.getCrypto=F,c.getMsCrypto=L,c.hasNavigator=I,c.getNavigator=S,c.hasHistory=N,c.getHistory=function(){return N()?history:x("history")},c.getLocation=function(){return typeof location===g&&location?location:x("location")},c.getPerformance=E,c.hasJSON=_,c.getJSON=P,c.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},c.getConsole=b,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=v,c.NotificationManager=vn,c.PerfEvent=Re,c.PerfManager=ke,c.doPerf=ze,c.DiagnosticLogger=Ae,c._InternalLogMessage=Me,c.ProcessTelemetryContext=We,c.initializePlugins=en,c.sortPlugins=nn,c._InternalMessageId=ie,c.InstrumentProto=function(e,n,t){return e?Sn(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?Nn(e[d],n,t,!1):null},c.InstrumentFunc=Sn,c.InstrumentFuncs=Nn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}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=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",i="object",n="undefined",o="prototype",a="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 u(e){var n=Object.create;if(n)return n(e);if(null==e)return{};if((n=typeof e)!=i&&n!==r)throw new TypeError("Object prototype may only be an Object:"+e);function t(){}return t[o]=e,new t}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[a](t)&&(e[t]=n[t])})(e,n)},t=function(e,n){function t(){this.constructor=e}s(e,n),e[o]=null===n?u(n):(t[o]=n[o],new t)};(vn=un=e()||{}).__assign||(vn.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[o][a].call(n,i)&&(e[i]=n[i]);return e}),vn.__extends||(vn.__extends=t),__assign=__assign||un.__assign,__extends=__extends||un.__extends;var l={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=i,d=o,v=r,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function I(){return!(typeof navigator!==g||!navigator)}function S(){return I()?navigator:x("navigator")}function N(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function _(){return!!(typeof JSON===g&&JSON||null!==x(h))}function P(){return _()?JSON||x(h):null}function F(){return x("crypto")}function L(){return x("msCrypto")}var M=n,O="attachEvent",A="addEventListener",j="detachEvent",R="removeEventListener",D=4294967296,k=4294967295,U=null,z=!1,B=123456789,K=987654321;function V(e){e<0&&(e>>>=0),B=123456789+e&k,K=987654321-e&k,z=!0}function q(){V(Math.random()*D^(new Date).getTime())}function W(e,n){return typeof e===n}function H(e){return W(e,n)||e===undefined}function G(e){return H(e)||null===e}function J(e,n){return e&&Object[o].hasOwnProperty.call(e,n)}function Q(e){return W(e,i)}function $(e){return W(e,r)}function Z(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!G(e))try{G(e[A])?G(e[O])||(e[O]("on"+n,t),i=!0):(e[A](n,t,r),i=!0)}catch(o){}return i}function Y(e,n,t,r){if(void 0===r&&(r=!1),!G(e))try{G(e[R])?G(e[j])||e[j]("on"+n,t):e[R](n,t,r)}catch(i){}}function X(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1}var ee=(ne.isDate=function(e){return"[object Date]"===Object[o].toString.call(e)},ne.isArray=function(e){return"[object Array]"===Object[o].toString.call(e)},ne.isError=function(e){return"[object Error]"===Object[o].toString.call(e)},ne.isString=function(e){return W(e,"string")},ne.isNumber=function(e){return W(e,"number")},ne.isBoolean=function(e){return W(e,"boolean")},ne.disableCookies=function(){ne._canUseCookies=!1},ne.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(te,function(e){var n=0|ne.randomValue(15);return("x"===e?n:3&n|8).toString(16)})},ne.toISOString=function(e){if(ne.isDate(e)){var n=function(e){return 1===(e+="").length&&(e="0"+e),e};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"}},ne.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},ne.arrIndexOf=function(e,n,t){for(var r=e.length,i=Math.max(0<=(t=t||0)?t:r-Math.abs(t),0);i<r;i++)if(i in e&&e[i]===n)return i;return-1},ne.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},ne.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},ne.strTrim=function(e){return ne.isString(e)?e.replace(/^\s+|\s+$/g,""):e},ne.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!($(e)||Q(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t,r=[];for(t in e)J(e,t)&&r.push(t);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)J(e,i[a])&&r.push(i[a]);return r},ne.addEventHandler=function(e,n){var t=!1,r=C();return r&&(t=Z(r,e,n),t=Z(r.body,e,n)||t),(r=T())&&(t=re.Attach(r,e,n)||t),t},ne.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},ne.perfNow=function(){var e=E();return e&&e.now?e.now():ne.dateNow()},ne.newId=function(e){void 0===e&&(e=22);for(var n=ne.random32()>>>0,t=0,r="";r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n],n>>>=6,5==++t&&(n=(ne.random32()<<2&4294967295|3&n)>>>0,t=0);return r},ne.isIE=function(){var e;return null===U&&(e=((S()||{}).userAgent||"").toLowerCase(),U=!!~e.indexOf("msie")||!!~e.indexOf("trident/")),U},ne.randomValue=function(e){return 0<e?Math.floor(ne.random32()/k*(e+1))>>>0:0},ne.random32=function(e){var n=(n=F()||L())&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&k:ne.isIE()?(z||q(),ne.mwcRandom32()&k):Math.floor(D*Math.random()|0);return e||(n>>>=0),n},ne.mwcRandomSeed=function(e){e?V(e):q()},ne.mwcRandom32=function(e){var n=((K=36969*(65535&K)+(K>>16)&k)<<16)+(65535&(B=18e3*(65535&B)+(B>>16)&k))>>>0&k|0;return e||(n>>>=0),n},ne.generateW3CId=function(){for(var e,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",r=0;r<4;r++)t+=n[15&(e=ne.random32())]+n[e>>4&15]+n[e>>8&15]+n[e>>12&15]+n[e>>16&15]+n[e>>20&15]+n[e>>24&15]+n[e>>28&15];var i=n[8+(3&ne.random32())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)},ne.isTypeof=W,ne.isUndefined=H,ne.isNullOrUndefined=G,ne.hasOwnProperty=J,ne.isFunction=$,ne.isObject=Q,ne.objCreate=u,ne.objDefineAccessors=X,ne);function ne(){}var te=/[xy]/g,re=(ie.Attach=Z,ie.AttachEvent=Z,ie.Detach=Y,ie.DetachEvent=Y,ie);function ie(){}(vn=c.LoggingSeverity||(c.LoggingSeverity={}))[vn.CRITICAL=1]="CRITICAL",vn[vn.WARNING=2]="WARNING";var oe={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,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103},ae="constructor",ue="prototype",se="function",ce="_dynInstFuncs",le="_isDynProxy",fe="_dynClass",ge="_dynCls$",de="_dynInstChk",ve=de,pe="_dfOpts",he="_unknown_",ye="__proto__",xe="useBaseInst",me="setInstFuncs",Ce=Object.getPrototypeOf,we=0;function Te(e,n){return e&&Object[ue].hasOwnProperty.call(e,n)}function Ie(e){return typeof e===se}function Se(e){return e&&(e===Object[ue]||e===Array[ue])}function Ne(e){return Se(e)||e===Function[ue]}function be(e){if(e){if(Ce)return Ce(e);if(e=e[ye]||e[ue]||e[ae])return e}return null}function Ee(e,n,t){return n!==ae&&Ie(e[n])&&(t||Te(e,n))}function _e(e){throw new TypeError("DynamicProto: "+e)}function Pe(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function Fe(e,n){return Te(e,ue)?e.name||n||he:((e||{})[ae]||{}).name||n||he}function Le(e,t,n,r){Te(e,ue)||_e("theClass is an invalid class definition.");var i=e[ue];!function(e){for(var n=be(t);n&&!Ne(n);){if(n===e)return 1;n=be(n)}}(i)&&_e("["+Fe(e)+"] is not in class hierarchy of ["+Fe(t)+"]");var o=null;Te(i,fe)?o=i[fe]:(o=ge+Fe(e,"_")+"$"+we,we++,i[fe]=o);var a=Le[pe],u=!!a[xe];u&&r&&r[xe]!==undefined&&(u=!!r[xe]),n(t,function(e,n,t,o){function r(e,n,t){var r,i=n[s];return i[le]&&o&&!1!==(r=e[ce]||{})[ve]&&(i=(r[n[fe]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};for(s in t)i[s]=r(n,t,s);for(var a=be(e),u=[];a&&!Ne(a)&&!Pe(u,a);){for(var s in a)!i[s]&&Ee(a,s,!Ce)&&(i[s]=r(n,a,s));u.push(a),a=be(a)}return i}(i,t,e=function(e){var n,t={};for(n in e)!t[n]&&Ee(e,n,!1)&&(t[n]=e[n]);return t}(t),u)),(a=!!Ce&&!!a[me])&&r&&(a=!!r[me]),function(e,n,t,r,i){if(!Se(e)){var o,a=t[ce]=t[ce]||{},u=a[n]=a[n]||{};for(o in!1!==a[ve]&&(a[ve]=!!i),t)Ee(t,o,!1)&&t[o]!==r[o]&&(u[o]=t[o],delete t[o],Te(e,o)&&(!e[o]||e[o][le])||(e[o]=function(t,r){var i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&Te(t,fe)){var o=e[ce]||{};if((i=(o[t[fe]]||{})[n])||_e("Missing ["+n+"] "+se),!i[de]&&!1!==o[ve]){for(var a=!Te(e,n),u=be(e),s=[];a&&u&&!Ne(u)&&!Pe(s,u);){var c=u[n];if(c){a=c===r;break}s.push(u),u=be(u)}try{a&&(e[n]=i),i[de]=1}catch(l){o[ve]=!1}}}return i}(this,r,t,i)||((n=t[e=r])===i&&(n=be(t)[e]),Ie(n)||_e("["+e+"] is not a "+se),n)).apply(this,arguments)};return i[le]=1,i}(e,o)))}}(i,o,t,e,!1!==a)}function Me(e){return e?'"'+e.replace(/\"/g,"")+'"':""}Le[pe]={setInstFuncs:!0,useBaseInst:!0};var Oe=(Ae.dataType="MessageData",Ae);function Ae(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",_()&&(e=P().stringify(r)),e=(n?" message:"+Me(n):"")+(r?" props:"+Me(e):""),this.message+=e}var je=function En(i){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};Le(En,this,function(o){var t=ee.isNullOrUndefined,a=ee.isUndefined,r=ee.isFunction;function e(e,n){return e=i[e],t(e)?n:e}t(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(void 0===i&&(i=!1),r=new Oe(n,t,i,r),o.enableDebugExceptions())throw r;!a(r)&&r&&(a(r.message)||(i?(i=+r.messageId,!s[i]&&o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(o.warnToConsole(r.message),s[i]=!0)):o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&o.warnToConsole(r.message),o.logInternalMessage(e,r)))},o.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),r(t[n])&&t[n](e))},o.resetInternalMessageCount=function(){u=0,s={}},o.logInternalMessage=function(e,n){var t,r;u>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,s[r]?t=!1:s[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),u++),u===o.maxInternalMessageLimit()&&(n=new Oe(oe.MessageLimitPerPVExceeded,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},Re="ctx",De=(ke.ParentContextKey="parent",ke.ChildrenContextKey="childEvts",ke);function ke(e,i,n){var t,o=this,a=!1;o.start=ee.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},ee.isFunction(i)&&(a=ee.objDefineAccessors(o,"payload",function(){return!t&&ee.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?(e===ke.ParentContextKey||e===ke.ChildrenContextKey?o:o[Re]||{})[e]:null},o.setCtx=function(e,n){e&&(e===ke.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===ke.ChildrenContextKey?o[e]=n:(o[Re]=o[Re]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(ke.ChildrenContextKey);if(ee.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=ee.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&ee.isFunction(i)&&(o.payload=i())}}var Ue=function _n(n){this.ctx={},Le(_n,this,function(t){t.create=function(e,n,t){return new De(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[Re]=t[Re]||{})[e]=n)},t.getCtx=function(e){return(t[Re]||{})[e]}})},ze="CoreUtils.doPerf";function Be(e,n,t,r,i){if(e){var o=e;if(o&&ee.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(ze);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(De.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(De.ChildrenContextKey))||(a=[],s.setCtx(De.ChildrenContextKey,a)),a.push(u))),o.setCtx(ze,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(ze,s)}}}return t()}var Ke=ee.isFunction,Ve=function(i,n){var o=this,a=null,u=Ke(i.processTelemetry),s=Ke(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";Be(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,oe.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},qe=ee.isNullOrUndefined;function We(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&ee.isFunction(o.processTelemetry)&&(o=new Ve(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var He=function Pn(e,i,t,n){var r,o,a,u,s=this,c=null;null!==n&&(e&&ee.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),We(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(o=n)&&e&&(a=[],ee.arrForEach(e,function(e){!u&&e!==o||(u=!0,a.push(e))})),o&&!u&&(a=a||[]).push(o),c=We(a,r)):ee.isUndefined(n)&&(c=We(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new je(i||{})},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=s.getExtCfg(e,null))&&!qe(e[n])?r=e[n]:i&&!qe(i[n])&&(r=i[n]),qe(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new Pn(e||c,i,t,n)}},Ge=ee.isFunction,Je="getPlugin",t=(Qe.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Qe);function Qe(){var o=this,a=!1,u=null,s=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){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&Ge(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;return n||(e=u||new He(null,{},o.core),n=s&&s[Je]?e.createNew(null,s[Je]):e.createNew(null,s)),n},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Je]&&(i=s[Je]()),o.core=n,u=new He(r,e,n,i),a=!0}}var $e=ee.isFunction,Ze="processTelemetry",Ye="priority",Xe="setNextPlugin",en="isInitialized";function nn(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&$e(r[Xe])&&$e(o[Ze])&&r[Xe](o),$e(o[en])&&o[en]()||e.push(o),r=o,i=i.getNext())}ee.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function tn(e){return e.sort(function(e,n){var t=0,r=$e(n[Ze]);return $e(e[Ze])?t=r?e[Ye]-n[Ye]:1:r&&(t=-1),t})}var rn,on=500,an="Channel has invalid priority",un=ee.objDefineAccessors,sn=(rn=t,__extends(cn,rn),cn._staticInit=(un(cn.prototype,"ChannelControls",cn.prototype.getChannelControls),void un(cn.prototype,"channelQueue",cn.prototype.getChannelControls)),cn);function cn(){var r=rn.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=on;var s,c=ee.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<on)throw Error(an+e.identifier)}),s.push(e))}return Le(cn,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&ee.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>on&&o.push(e)}),l(o)),c(s,function(e){return nn(new He(e,n,t),r)}))}}),r}var ln,fn=ee.arrForEach,gn=ee.isNullOrUndefined,dn="_notificationManager",vn=function Fn(){var n,u,s,t,c=!1;Le(Fn,this,function(a){a._extensions=[],u=new sn,a.logger=ee.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),n=[],a.isInitialized=function(){return c},a.initialize=function(e,n,r,t){if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||gn(e.instrumentationKey))throw Error("Please provide instrumentation key");s=t,a[dn]=t,a.config=e||{},e.extensions=gn(e.extensions)?[]:e.extensions,(e.extensionConfig=gn(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r&&(a.logger=r),(t=[]).push.apply(t,n.concat(e.extensions)),t=tn(t);var i=[],o={};if(fn(t,function(e){if(gn(e)||gn(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(gn(o[n])?o[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+o[n]+", "+t)),(!n||n<u.priority)&&i.push(e)}),t.push(u),i.push(u),t=tn(t),a._extensions=t,nn(new He([u],e,a),t),nn(new He(i,e,a),t),a._extensions=i,0===a.getTransmissionControls().length)throw Error("No channels available");c=!0,a.releaseQueue()},a.getTransmissionControls=function(){return u.getChannelControls()},a.track=function(e){e.iKey||(e.iKey=a.config.instrumentationKey),e.time||(e.time=ee.toISOString(new Date)),gn(e.ver)&&(e.ver="4.0"),a.isInitialized()?a.getProcessTelContext().processNext(e):n.push(e)},a.getProcessTelContext=function(){var e=a._extensions,n=e;return e&&0!==e.length||(n=[u]),new He(n,a.config,a)},a.getNotifyMgr=function(){return s||(s=ee.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),a[dn]=s),s},a.getPerfMgr=function(){return t||a.config&&a.config.enablePerfMgr&&(t=new Ue(a.getNotifyMgr())),t},a.setPerfMgr=function(e){t=e},a.eventCnt=function(){return n.length},a.releaseQueue=function(){0<n.length&&(fn(n,function(e){a.getProcessTelContext().processNext(e)}),n=[])}})},pn=function Ln(e){this.listeners=[];var o=ee.arrForEach,n=!!(e||{}).perfEvtsSendAll;Le(Ln,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=ee.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=ee.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},un=(ln=vn,__extends(hn,ln),hn);function hn(){var e=ln.call(this)||this;return Le(hn,e,function(t,i){function n(e){var n=t.getNotifyMgr();n&&n.eventsDiscarded([e],l.InvalidEvent)}t.initialize=function(e,n,t,r){i.initialize(e,n,t||new je(e),r||new pn(e))},t.track=function(e){Be(t.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(ee.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},t.addNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.addNotificationListener(e)},t.removeNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.removeNotificationListener(e)},t.pollInternalLogs=function(n){var e=t.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=t.logger?t.logger.queue:[];ee.arrForEach(e,function(e){e={name:n||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:ee.toISOString(new Date),baseType:Oe.dataType,baseData:{message:e.message}},t.track(e)}),e.length=0},e)}}),e}var yn="_aiHooks",xn=["req","rsp","hkErr","fnErr"],mn="__proto__",Cn="constructor";function wn(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Tn(e,u,s,c,l){0<=l&&l<=2&&wn(e,function(e,n){var t=e.cbks,r=t[xn[l]];if(r){u.ctx=function(){return c[n]=c[n]||{}};try{r.apply(u.inst,s)}catch(o){e=u.err;try{var i=t[xn[2]];i&&(u.err=o,i.apply(u.inst,s))}catch(a){}finally{u.err=e}}}})}function In(s){return function(){var t=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return wn(e,function(e){n.push(e)}),n}Tn(e,r,i,n,0);var a=s.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,Tn(e,r,i,n,3),u}return Tn(e,r,i,n,1),r.rslt}}var Sn=Object.getPrototypeOf;function Nn(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t&&((e=function o(e,n,t){var r=null;return e&&(ee.hasOwnProperty(e,n)?r=e:t&&(r=o(function(e){if(e){if(Sn)return Sn(e);if(e=e[mn]||e[d]||e[Cn])return e}return null}(e),n,!1))),r}(e,n,r))&&typeof(r=e[n])===v)){var i=r[yn];return i||((r=In(i={i:0,n:n,f:r,h:[]}))[yn]=i,e[n]=r),t={id:i.i,cbks:t,rm:function(){var t=this.id;wn(i.h,function(e,n){return e.id===t&&(i.h.splice(n,1),1)})}},i.i++,i.h.push(t),t}return null}function bn(n,e,t,r){void 0===r&&(r=!0);var i=null;return wn(e,function(e){(e=Nn(n,e,t,r))&&(i=i||[]).push(e)}),i}c.MinChannelPriorty=100,c.EventsDiscardedReason=l,c.AppInsightsCore=un,c.BaseCore=vn,c.BaseTelemetryPlugin=t,c.CoreUtils=ee,c.EventHelper=re,c.Undefined=M,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.objForEachKey=function(e,n){if(e&&Q(e))for(var t in e)J(e,t)&&n.call(e,t,e[t])},c.proxyAssign=function(r,i,o){if(r&&i&&r!==i&&Q(r)&&Q(i))for(var e in i)!function(n){var e,t;ee.isString(n)&&($(e=i[n])?o&&!o(n,!0,i,r)||(r[n]=(t=n,function(){var e=arguments;return i[t].apply(i,e)})):o&&!o(n,!1,i,r)||(J(r,n)&&delete r[n],X(r,n,function(){return i[n]},function(e){i[n]=e})||(r[n]=e)))}(e);return r},c.getGlobal=y,c.getGlobalInst=x,c.hasWindow=m,c.getWindow=C,c.hasDocument=w,c.getDocument=T,c.getCrypto=F,c.getMsCrypto=L,c.hasNavigator=I,c.getNavigator=S,c.hasHistory=N,c.getHistory=function(){return N()?history:x("history")},c.getLocation=function(){return typeof location===g&&location?location:x("location")},c.getPerformance=E,c.hasJSON=_,c.getJSON=P,c.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},c.getConsole=b,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=v,c.NotificationManager=pn,c.PerfEvent=De,c.PerfManager=Ue,c.doPerf=Be,c.DiagnosticLogger=je,c._InternalLogMessage=Oe,c.ProcessTelemetryContext=He,c.initializePlugins=nn,c.sortPlugins=tn,c._InternalMessageId=oe,c.InstrumentProto=function(e,n,t){return e?Nn(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?bn(e[d],n,t,!1):null},c.InstrumentFunc=Nn,c.InstrumentFuncs=bn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map

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

export { BaseTelemetryPlugin } from './JavaScriptSDK/BaseTelemetryPlugin';
export { CoreUtils, EventHelper, Undefined, normalizeJsName, objForEachKey } from "./JavaScriptSDK/CoreUtils";
export { CoreUtils, EventHelper, Undefined, normalizeJsName, objForEachKey, proxyAssign } from "./JavaScriptSDK/CoreUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";

@@ -12,0 +12,0 @@ export { NotificationManager } from "./JavaScriptSDK/NotificationManager";

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

/**
* Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with
* existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded
* and executed in an ES3 container, providing basic IE8 compatibility.
* @param target The object on which to define the property.
* @param prop The name of the property to be defined or modified.
* @param getProp The getter function to wire against the getter.
* @param setProp The setter function to wire against the setter.
* @returns True if it was able to create the accessors otherwise false
*/
export function objDefineAccessors(target, prop, getProp, setProp) {
var defineProp = Object["defineProperty"];
if (defineProp) {
try {
var descriptor = {
enumerable: true,
configurable: true
};
if (getProp) {
descriptor.get = getProp;
}
if (setProp) {
descriptor.set = setProp;
}
defineProp(target, prop, descriptor);
return true;
}
catch (e) {
// IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw
// We will just ignore this here.
}
}
return false;
}
/**
* Validates that the string name conforms to the JS IdentifierName specification and if not

@@ -142,2 +176,60 @@ * normalizes the name so that it would. This method does not identify or change any keywords

}
/**
* Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from
* the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential
* implementation issues by assigning prototype functions as instance ones
*
* This method is the primary method used to "update" the snippet proxy with the ultimate implementations.
*
* Special ES3 Notes:
* Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the
* properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the
* same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.
* @param target - The target object to be assigned with the source properties and functions
* @param source - The source object which will be assigned / called by setting / calling the targets proxies
* @param chkSet - An optional callback to determine whether a specific property/function should be proxied
* @memberof Initialization
*/
export function proxyAssign(target, source, chkSet) {
if (target && source && target !== source && _isObject(target) && _isObject(source)) {
var _loop_1 = function (field) {
if (CoreUtils.isString(field)) {
var value = source[field];
if (_isFunction(value)) {
if (!chkSet || chkSet(field, true, source, target)) {
// Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function
target[field] = (function (funcName) {
return function () {
// Capture the original arguments passed to the method
var originalArguments = arguments;
return source[funcName].apply(source, originalArguments);
};
})(field);
}
}
else if (!chkSet || chkSet(field, false, source, target)) {
if (_hasOwnProperty(target, field)) {
// Remove any previous instance property
delete target[field];
}
if (!objDefineAccessors(target, field, function () {
return source[field];
}, function (theValue) {
source[field] = theValue;
})) {
// Unable to create an accessor, so just assign the values as a fallback
// -- this will (mostly) work for objects
// -- but will fail for accessing primitives (if the source changes it) and all types of "setters" as the source won't be modified
target[field] = value;
}
}
}
};
// effectively apply/proxy full source to the target instance
for (var field in source) {
_loop_1(field);
}
}
return target;
}
var CoreUtils = /** @class */ (function () {

@@ -355,36 +447,2 @@ function CoreUtils() {

/**
* Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with
* existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded
* and executed in an ES3 container, providing basic IE8 compatibility.
* @param target The object on which to define the property.
* @param prop The name of the property to be defined or modified.
* @param getProp The getter function to wire against the getter.
* @param setProp The setter function to wire against the setter.
* @returns True if it was able to create the accessors otherwise false
*/
CoreUtils.objDefineAccessors = function (target, prop, getProp, setProp) {
var defineProp = Object["defineProperty"];
if (defineProp) {
try {
var descriptor = {
enumerable: true,
configurable: true
};
if (getProp) {
descriptor.get = getProp;
}
if (setProp) {
descriptor.set = setProp;
}
defineProp(target, prop, descriptor);
return true;
}
catch (e) {
// IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw
// We will just ignore this here.
}
}
return false;
};
/**
* Trys to add an event handler for the specified event to the window, body and document

@@ -583,2 +641,13 @@ * @param eventName {string} - The name of the event

CoreUtils.objCreate = objCreateFn;
/**
* Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with
* existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded
* and executed in an ES3 container, providing basic IE8 compatibility.
* @param target The object on which to define the property.
* @param prop The name of the property to be defined or modified.
* @param getProp The getter function to wire against the getter.
* @param setProp The setter function to wire against the setter.
* @returns True if it was able to create the accessors otherwise false
*/
CoreUtils.objDefineAccessors = objDefineAccessors;
return CoreUtils;

@@ -585,0 +654,0 @@ }());

/*!
* Application Insights JavaScript SDK - Core, 2.5.10
* Application Insights JavaScript SDK - Core, 2.5.11
* 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=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",i="object",n="undefined",o="prototype",a="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 u(e){var n=Object.create;if(n)return n(e);if(null==e)return{};if((n=typeof e)!=i&&n!==r)throw new TypeError("Object prototype may only be an Object:"+e);function t(){}return t[o]=e,new t}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[a](t)&&(e[t]=n[t])})(e,n)},t=function(e,n){function t(){this.constructor=e}s(e,n),e[o]=null===n?u(n):(t[o]=n[o],new t)};(dn=an=e()||{}).__assign||(dn.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[o][a].call(n,i)&&(e[i]=n[i]);return e}),dn.__extends||(dn.__extends=t),__assign=__assign||an.__assign,__extends=__extends||an.__extends;var l={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=i,d=o,v=r,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function I(){return!(typeof navigator!==g||!navigator)}function S(){return I()?navigator:x("navigator")}function N(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function _(){return!!(typeof JSON===g&&JSON||null!==x(h))}function P(){return _()?JSON||x(h):null}function F(){return x("crypto")}function L(){return x("msCrypto")}var M=n,O="attachEvent",A="addEventListener",j="detachEvent",R="removeEventListener",D=4294967296,k=4294967295,U=null,z=!1,B=123456789,K=987654321;function V(e){e<0&&(e>>>=0),B=123456789+e&k,K=987654321-e&k,z=!0}function q(){V(Math.random()*D^(new Date).getTime())}function W(e,n){return typeof e===n}function H(e){return W(e,n)||e===undefined}function G(e){return H(e)||null===e}function J(e,n){return e&&Object[o].hasOwnProperty.call(e,n)}function Q(e){return W(e,i)}function $(e){return W(e,r)}function Z(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!G(e))try{G(e[A])?G(e[O])||(e[O]("on"+n,t),i=!0):(e[A](n,t,r),i=!0)}catch(o){}return i}function Y(e,n,t,r){if(void 0===r&&(r=!1),!G(e))try{G(e[R])?G(e[j])||e[j]("on"+n,t):e[R](n,t,r)}catch(i){}}var X=(ee.isDate=function(e){return"[object Date]"===Object[o].toString.call(e)},ee.isArray=function(e){return"[object Array]"===Object[o].toString.call(e)},ee.isError=function(e){return"[object Error]"===Object[o].toString.call(e)},ee.isString=function(e){return W(e,"string")},ee.isNumber=function(e){return W(e,"number")},ee.isBoolean=function(e){return W(e,"boolean")},ee.disableCookies=function(){ee._canUseCookies=!1},ee.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(ne,function(e){var n=0|ee.randomValue(15);return("x"===e?n:3&n|8).toString(16)})},ee.toISOString=function(e){if(ee.isDate(e)){var n=function(e){return 1===(e+="").length&&(e="0"+e),e};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"}},ee.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},ee.arrIndexOf=function(e,n,t){for(var r=e.length,i=Math.max(0<=(t=t||0)?t:r-Math.abs(t),0);i<r;i++)if(i in e&&e[i]===n)return i;return-1},ee.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},ee.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},ee.strTrim=function(e){return ee.isString(e)?e.replace(/^\s+|\s+$/g,""):e},ee.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!($(e)||Q(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t,r=[];for(t in e)J(e,t)&&r.push(t);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)J(e,i[a])&&r.push(i[a]);return r},ee.objDefineAccessors=function(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1},ee.addEventHandler=function(e,n){var t=!1,r=C();return r&&(t=Z(r,e,n),t=Z(r.body,e,n)||t),(r=T())&&(t=te.Attach(r,e,n)||t),t},ee.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},ee.perfNow=function(){var e=E();return e&&e.now?e.now():ee.dateNow()},ee.newId=function(e){void 0===e&&(e=22);for(var n=ee.random32()>>>0,t=0,r="";r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n],n>>>=6,5==++t&&(n=(ee.random32()<<2&4294967295|3&n)>>>0,t=0);return r},ee.isIE=function(){var e;return null===U&&(e=((S()||{}).userAgent||"").toLowerCase(),U=!!~e.indexOf("msie")||!!~e.indexOf("trident/")),U},ee.randomValue=function(e){return 0<e?Math.floor(ee.random32()/k*(e+1))>>>0:0},ee.random32=function(e){var n=(n=F()||L())&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&k:ee.isIE()?(z||q(),ee.mwcRandom32()&k):Math.floor(D*Math.random()|0);return e||(n>>>=0),n},ee.mwcRandomSeed=function(e){e?V(e):q()},ee.mwcRandom32=function(e){var n=((K=36969*(65535&K)+(K>>16)&k)<<16)+(65535&(B=18e3*(65535&B)+(B>>16)&k))>>>0&k|0;return e||(n>>>=0),n},ee.generateW3CId=function(){for(var e,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",r=0;r<4;r++)t+=n[15&(e=ee.random32())]+n[e>>4&15]+n[e>>8&15]+n[e>>12&15]+n[e>>16&15]+n[e>>20&15]+n[e>>24&15]+n[e>>28&15];var i=n[8+(3&ee.random32())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)},ee.isTypeof=W,ee.isUndefined=H,ee.isNullOrUndefined=G,ee.hasOwnProperty=J,ee.isFunction=$,ee.isObject=Q,ee.objCreate=u,ee);function ee(){}var ne=/[xy]/g,te=(re.Attach=Z,re.AttachEvent=Z,re.Detach=Y,re.DetachEvent=Y,re);function re(){}(dn=c.LoggingSeverity||(c.LoggingSeverity={}))[dn.CRITICAL=1]="CRITICAL",dn[dn.WARNING=2]="WARNING";var ie={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,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103},oe="constructor",ae="prototype",ue="function",se="_dynInstFuncs",ce="_isDynProxy",le="_dynClass",fe="_dynCls$",ge="_dynInstChk",de=ge,ve="_dfOpts",pe="_unknown_",he="__proto__",ye="useBaseInst",xe="setInstFuncs",me=Object.getPrototypeOf,Ce=0;function we(e,n){return e&&Object[ae].hasOwnProperty.call(e,n)}function Te(e){return typeof e===ue}function Ie(e){return e&&(e===Object[ae]||e===Array[ae])}function Se(e){return Ie(e)||e===Function[ae]}function Ne(e){if(e){if(me)return me(e);if(e=e[he]||e[ae]||e[oe])return e}return null}function be(e,n,t){return n!==oe&&Te(e[n])&&(t||we(e,n))}function Ee(e){throw new TypeError("DynamicProto: "+e)}function _e(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function Pe(e,n){return we(e,ae)?e.name||n||pe:((e||{})[oe]||{}).name||n||pe}function Fe(e,t,n,r){we(e,ae)||Ee("theClass is an invalid class definition.");var i=e[ae];!function(e){for(var n=Ne(t);n&&!Se(n);){if(n===e)return 1;n=Ne(n)}}(i)&&Ee("["+Pe(e)+"] is not in class hierarchy of ["+Pe(t)+"]");var o=null;we(i,le)?o=i[le]:(o=fe+Pe(e,"_")+"$"+Ce,Ce++,i[le]=o);var a=Fe[ve],u=!!a[ye];u&&r&&r[ye]!==undefined&&(u=!!r[ye]),n(t,function(e,n,t,o){function r(e,n,t){var r,i=n[s];return i[ce]&&o&&!1!==(r=e[se]||{})[de]&&(i=(r[n[le]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};for(s in t)i[s]=r(n,t,s);for(var a=Ne(e),u=[];a&&!Se(a)&&!_e(u,a);){for(var s in a)!i[s]&&be(a,s,!me)&&(i[s]=r(n,a,s));u.push(a),a=Ne(a)}return i}(i,t,e=function(e){var n,t={};for(n in e)!t[n]&&be(e,n,!1)&&(t[n]=e[n]);return t}(t),u)),(a=!!me&&!!a[xe])&&r&&(a=!!r[xe]),function(e,n,t,r,i){if(!Ie(e)){var o,a=t[se]=t[se]||{},u=a[n]=a[n]||{};for(o in!1!==a[de]&&(a[de]=!!i),t)be(t,o,!1)&&t[o]!==r[o]&&(u[o]=t[o],delete t[o],we(e,o)&&(!e[o]||e[o][ce])||(e[o]=function(t,r){var i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&we(t,le)){var o=e[se]||{};if((i=(o[t[le]]||{})[n])||Ee("Missing ["+n+"] "+ue),!i[ge]&&!1!==o[de]){for(var a=!we(e,n),u=Ne(e),s=[];a&&u&&!Se(u)&&!_e(s,u);){var c=u[n];if(c){a=c===r;break}s.push(u),u=Ne(u)}try{a&&(e[n]=i),i[ge]=1}catch(l){o[de]=!1}}}return i}(this,r,t,i)||((n=t[e=r])===i&&(n=Ne(t)[e]),Te(n)||Ee("["+e+"] is not a "+ue),n)).apply(this,arguments)};return i[ce]=1,i}(e,o)))}}(i,o,t,e,!1!==a)}function Le(e){return e?'"'+e.replace(/\"/g,"")+'"':""}Fe[ve]={setInstFuncs:!0,useBaseInst:!0};var Me=(Oe.dataType="MessageData",Oe);function Oe(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",_()&&(e=P().stringify(r)),e=(n?" message:"+Le(n):"")+(r?" props:"+Le(e):""),this.message+=e}var Ae=function bn(i){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};Fe(bn,this,function(o){var t=X.isNullOrUndefined,a=X.isUndefined,r=X.isFunction;function e(e,n){return e=i[e],t(e)?n:e}t(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(void 0===i&&(i=!1),r=new Me(n,t,i,r),o.enableDebugExceptions())throw r;!a(r)&&r&&(a(r.message)||(i?(i=+r.messageId,!s[i]&&o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(o.warnToConsole(r.message),s[i]=!0)):o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&o.warnToConsole(r.message),o.logInternalMessage(e,r)))},o.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),r(t[n])&&t[n](e))},o.resetInternalMessageCount=function(){u=0,s={}},o.logInternalMessage=function(e,n){var t,r;u>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,s[r]?t=!1:s[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),u++),u===o.maxInternalMessageLimit()&&(n=new Me(ie.MessageLimitPerPVExceeded,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},je="ctx",Re=(De.ParentContextKey="parent",De.ChildrenContextKey="childEvts",De);function De(e,i,n){var t,o=this,a=!1;o.start=X.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},X.isFunction(i)&&(a=X.objDefineAccessors(o,"payload",function(){return!t&&X.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?(e===De.ParentContextKey||e===De.ChildrenContextKey?o:o[je]||{})[e]:null},o.setCtx=function(e,n){e&&(e===De.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===De.ChildrenContextKey?o[e]=n:(o[je]=o[je]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(De.ChildrenContextKey);if(X.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&X.isFunction(i)&&(o.payload=i())}}var ke=function En(n){this.ctx={},Fe(En,this,function(t){t.create=function(e,n,t){return new Re(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[je]=t[je]||{})[e]=n)},t.getCtx=function(e){return(t[je]||{})[e]}})},Ue="CoreUtils.doPerf";function ze(e,n,t,r,i){if(e){var o=e;if(o&&X.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(Ue);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(Re.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(Re.ChildrenContextKey))||(a=[],s.setCtx(Re.ChildrenContextKey,a)),a.push(u))),o.setCtx(Ue,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(Ue,s)}}}return t()}var Be=X.isFunction,Ke=function(i,n){var o=this,a=null,u=Be(i.processTelemetry),s=Be(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ze(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,ie.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},Ve=X.isNullOrUndefined;function qe(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&X.isFunction(o.processTelemetry)&&(o=new Ke(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var We=function _n(e,i,t,n){var r,o,a,u,s=this,c=null;null!==n&&(e&&X.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),qe(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(o=n)&&e&&(a=[],X.arrForEach(e,function(e){!u&&e!==o||(u=!0,a.push(e))})),o&&!u&&(a=a||[]).push(o),c=qe(a,r)):X.isUndefined(n)&&(c=qe(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new Ae(i||{})},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=s.getExtCfg(e,null))&&!Ve(e[n])?r=e[n]:i&&!Ve(i[n])&&(r=i[n]),Ve(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new _n(e||c,i,t,n)}},He=X.isFunction,Ge="getPlugin",t=(Je.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Je);function Je(){var o=this,a=!1,u=null,s=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){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&He(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;return n||(e=u||new We(null,{},o.core),n=s&&s[Ge]?e.createNew(null,s[Ge]):e.createNew(null,s)),n},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Ge]&&(i=s[Ge]()),o.core=n,u=new We(r,e,n,i),a=!0}}var Qe=X.isFunction,$e="processTelemetry",Ze="priority",Ye="setNextPlugin",Xe="isInitialized";function en(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&Qe(r[Ye])&&Qe(o[$e])&&r[Ye](o),Qe(o[Xe])&&o[Xe]()||e.push(o),r=o,i=i.getNext())}X.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function nn(e){return e.sort(function(e,n){var t=0,r=Qe(n[$e]);return Qe(e[$e])?t=r?e[Ze]-n[Ze]:1:r&&(t=-1),t})}var tn,rn=500,on="Channel has invalid priority",an=X.objDefineAccessors,un=(tn=t,__extends(sn,tn),sn._staticInit=(an(sn.prototype,"ChannelControls",sn.prototype.getChannelControls),void an(sn.prototype,"channelQueue",sn.prototype.getChannelControls)),sn);function sn(){var r=tn.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=rn;var s,c=X.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<rn)throw Error(on+e.identifier)}),s.push(e))}return Fe(sn,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&X.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>rn&&o.push(e)}),l(o)),c(s,function(e){return en(new We(e,n,t),r)}))}}),r}var cn,ln=X.arrForEach,fn=X.isNullOrUndefined,gn="_notificationManager",dn=function Pn(){var n,u,s,t,c=!1;Fe(Pn,this,function(a){a._extensions=[],u=new un,a.logger=X.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),n=[],a.isInitialized=function(){return c},a.initialize=function(e,n,r,t){if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||fn(e.instrumentationKey))throw Error("Please provide instrumentation key");s=t,a[gn]=t,a.config=e||{},e.extensions=fn(e.extensions)?[]:e.extensions,(e.extensionConfig=fn(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r&&(a.logger=r),(t=[]).push.apply(t,n.concat(e.extensions)),t=nn(t);var i=[],o={};if(ln(t,function(e){if(fn(e)||fn(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(fn(o[n])?o[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+o[n]+", "+t)),(!n||n<u.priority)&&i.push(e)}),t.push(u),i.push(u),t=nn(t),a._extensions=t,en(new We([u],e,a),t),en(new We(i,e,a),t),a._extensions=i,0===a.getTransmissionControls().length)throw Error("No channels available");c=!0,a.releaseQueue()},a.getTransmissionControls=function(){return u.getChannelControls()},a.track=function(e){e.iKey||(e.iKey=a.config.instrumentationKey),e.time||(e.time=X.toISOString(new Date)),fn(e.ver)&&(e.ver="4.0"),a.isInitialized()?a.getProcessTelContext().processNext(e):n.push(e)},a.getProcessTelContext=function(){var e=a._extensions,n=e;return e&&0!==e.length||(n=[u]),new We(n,a.config,a)},a.getNotifyMgr=function(){return s||(s=X.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),a[gn]=s),s},a.getPerfMgr=function(){return t||a.config&&a.config.enablePerfMgr&&(t=new ke(a.getNotifyMgr())),t},a.setPerfMgr=function(e){t=e},a.eventCnt=function(){return n.length},a.releaseQueue=function(){0<n.length&&(ln(n,function(e){a.getProcessTelContext().processNext(e)}),n=[])}})},vn=function Fn(e){this.listeners=[];var o=X.arrForEach,n=!!(e||{}).perfEvtsSendAll;Fe(Fn,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=X.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=X.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},an=(cn=dn,__extends(pn,cn),pn);function pn(){var e=cn.call(this)||this;return Fe(pn,e,function(t,i){function n(e){var n=t.getNotifyMgr();n&&n.eventsDiscarded([e],l.InvalidEvent)}t.initialize=function(e,n,t,r){i.initialize(e,n,t||new Ae(e),r||new vn(e))},t.track=function(e){ze(t.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(X.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},t.addNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.addNotificationListener(e)},t.removeNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.removeNotificationListener(e)},t.pollInternalLogs=function(n){var e=t.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=t.logger?t.logger.queue:[];X.arrForEach(e,function(e){e={name:n||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:X.toISOString(new Date),baseType:Me.dataType,baseData:{message:e.message}},t.track(e)}),e.length=0},e)}}),e}var hn="_aiHooks",yn=["req","rsp","hkErr","fnErr"],xn="__proto__",mn="constructor";function Cn(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function wn(e,u,s,c,l){0<=l&&l<=2&&Cn(e,function(e,n){var t=e.cbks,r=t[yn[l]];if(r){u.ctx=function(){return c[n]=c[n]||{}};try{r.apply(u.inst,s)}catch(o){e=u.err;try{var i=t[yn[2]];i&&(u.err=o,i.apply(u.inst,s))}catch(a){}finally{u.err=e}}}})}function Tn(s){return function(){var t=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return Cn(e,function(e){n.push(e)}),n}wn(e,r,i,n,0);var a=s.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,wn(e,r,i,n,3),u}return wn(e,r,i,n,1),r.rslt}}var In=Object.getPrototypeOf;function Sn(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t&&((e=function o(e,n,t){var r=null;return e&&(X.hasOwnProperty(e,n)?r=e:t&&(r=o(function(e){if(e){if(In)return In(e);if(e=e[xn]||e[d]||e[mn])return e}return null}(e),n,!1))),r}(e,n,r))&&typeof(r=e[n])===v)){var i=r[hn];return i||((r=Tn(i={i:0,n:n,f:r,h:[]}))[hn]=i,e[n]=r),t={id:i.i,cbks:t,rm:function(){var t=this.id;Cn(i.h,function(e,n){return e.id===t&&(i.h.splice(n,1),1)})}},i.i++,i.h.push(t),t}return null}function Nn(n,e,t,r){void 0===r&&(r=!0);var i=null;return Cn(e,function(e){(e=Sn(n,e,t,r))&&(i=i||[]).push(e)}),i}c.MinChannelPriorty=100,c.EventsDiscardedReason=l,c.AppInsightsCore=an,c.BaseCore=dn,c.BaseTelemetryPlugin=t,c.CoreUtils=X,c.EventHelper=te,c.Undefined=M,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.objForEachKey=function(e,n){if(e&&Q(e))for(var t in e)J(e,t)&&n.call(e,t,e[t])},c.getGlobal=y,c.getGlobalInst=x,c.hasWindow=m,c.getWindow=C,c.hasDocument=w,c.getDocument=T,c.getCrypto=F,c.getMsCrypto=L,c.hasNavigator=I,c.getNavigator=S,c.hasHistory=N,c.getHistory=function(){return N()?history:x("history")},c.getLocation=function(){return typeof location===g&&location?location:x("location")},c.getPerformance=E,c.hasJSON=_,c.getJSON=P,c.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},c.getConsole=b,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=v,c.NotificationManager=vn,c.PerfEvent=Re,c.PerfManager=ke,c.doPerf=ze,c.DiagnosticLogger=Ae,c._InternalLogMessage=Me,c.ProcessTelemetryContext=We,c.initializePlugins=en,c.sortPlugins=nn,c._InternalMessageId=ie,c.InstrumentProto=function(e,n,t){return e?Sn(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?Nn(e[d],n,t,!1):null},c.InstrumentFunc=Sn,c.InstrumentFuncs=Nn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}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=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",i="object",n="undefined",o="prototype",a="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 u(e){var n=Object.create;if(n)return n(e);if(null==e)return{};if((n=typeof e)!=i&&n!==r)throw new TypeError("Object prototype may only be an Object:"+e);function t(){}return t[o]=e,new t}var s=function(e,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[a](t)&&(e[t]=n[t])})(e,n)},t=function(e,n){function t(){this.constructor=e}s(e,n),e[o]=null===n?u(n):(t[o]=n[o],new t)};(vn=un=e()||{}).__assign||(vn.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object[o][a].call(n,i)&&(e[i]=n[i]);return e}),vn.__extends||(vn.__extends=t),__assign=__assign||un.__assign,__extends=__extends||un.__extends;var l={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=i,d=o,v=r,p="window",h="JSON",y=e;function x(e){var n=y();return n&&n[e]?n[e]:e===p&&m()?window:null}function m(){return!(typeof window!==g||!window)}function C(){return m()?window:x(p)}function w(){return!(typeof document!==g||!document)}function T(){return w()?document:x("document")}function I(){return!(typeof navigator!==g||!navigator)}function S(){return I()?navigator:x("navigator")}function N(){return!(typeof history!==g||!history)}function b(){return typeof console!==f?console:x("console")}function E(){return x("performance")}function _(){return!!(typeof JSON===g&&JSON||null!==x(h))}function P(){return _()?JSON||x(h):null}function F(){return x("crypto")}function L(){return x("msCrypto")}var M=n,O="attachEvent",A="addEventListener",j="detachEvent",R="removeEventListener",D=4294967296,k=4294967295,U=null,z=!1,B=123456789,K=987654321;function V(e){e<0&&(e>>>=0),B=123456789+e&k,K=987654321-e&k,z=!0}function q(){V(Math.random()*D^(new Date).getTime())}function W(e,n){return typeof e===n}function H(e){return W(e,n)||e===undefined}function G(e){return H(e)||null===e}function J(e,n){return e&&Object[o].hasOwnProperty.call(e,n)}function Q(e){return W(e,i)}function $(e){return W(e,r)}function Z(e,n,t,r){void 0===r&&(r=!1);var i=!1;if(!G(e))try{G(e[A])?G(e[O])||(e[O]("on"+n,t),i=!0):(e[A](n,t,r),i=!0)}catch(o){}return i}function Y(e,n,t,r){if(void 0===r&&(r=!1),!G(e))try{G(e[R])?G(e[j])||e[j]("on"+n,t):e[R](n,t,r)}catch(i){}}function X(e,n,t,r){var i=Object.defineProperty;if(i)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),r&&(o.set=r),i(e,n,o),!0}catch(a){}return!1}var ee=(ne.isDate=function(e){return"[object Date]"===Object[o].toString.call(e)},ne.isArray=function(e){return"[object Array]"===Object[o].toString.call(e)},ne.isError=function(e){return"[object Error]"===Object[o].toString.call(e)},ne.isString=function(e){return W(e,"string")},ne.isNumber=function(e){return W(e,"number")},ne.isBoolean=function(e){return W(e,"boolean")},ne.disableCookies=function(){ne._canUseCookies=!1},ne.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(te,function(e){var n=0|ne.randomValue(15);return("x"===e?n:3&n|8).toString(16)})},ne.toISOString=function(e){if(ne.isDate(e)){var n=function(e){return 1===(e+="").length&&(e="0"+e),e};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"}},ne.arrForEach=function(e,n,t){for(var r=e.length,i=0;i<r;i++)i in e&&n.call(t||e,e[i],i,e)},ne.arrIndexOf=function(e,n,t){for(var r=e.length,i=Math.max(0<=(t=t||0)?t:r-Math.abs(t),0);i<r;i++)if(i in e&&e[i]===n)return i;return-1},ne.arrMap=function(e,n,t){for(var r=e.length,i=t||e,o=Array(r),a=0;a<r;a++)a in e&&(o[a]=n.call(i,e[a],e));return o},ne.arrReduce=function(e,n,t){var r,i=e.length,o=0;if(3<=arguments.length)r=t;else{for(;o<i&&!(o in e);)o++;r=e[o++]}for(;o<i;)o in e&&(r=n(r,e[o],o,e)),o++;return r},ne.strTrim=function(e){return ne.isString(e)?e.replace(/^\s+|\s+$/g,""):e},ne.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!($(e)||Q(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t,r=[];for(t in e)J(e,t)&&r.push(t);if(n)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=i.length,a=0;a<o;a++)J(e,i[a])&&r.push(i[a]);return r},ne.addEventHandler=function(e,n){var t=!1,r=C();return r&&(t=Z(r,e,n),t=Z(r.body,e,n)||t),(r=T())&&(t=re.Attach(r,e,n)||t),t},ne.dateNow=function(){var e=Date;return e.now?e.now():(new e).getTime()},ne.perfNow=function(){var e=E();return e&&e.now?e.now():ne.dateNow()},ne.newId=function(e){void 0===e&&(e=22);for(var n=ne.random32()>>>0,t=0,r="";r.length<e;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n],n>>>=6,5==++t&&(n=(ne.random32()<<2&4294967295|3&n)>>>0,t=0);return r},ne.isIE=function(){var e;return null===U&&(e=((S()||{}).userAgent||"").toLowerCase(),U=!!~e.indexOf("msie")||!!~e.indexOf("trident/")),U},ne.randomValue=function(e){return 0<e?Math.floor(ne.random32()/k*(e+1))>>>0:0},ne.random32=function(e){var n=(n=F()||L())&&n.getRandomValues?n.getRandomValues(new Uint32Array(1))[0]&k:ne.isIE()?(z||q(),ne.mwcRandom32()&k):Math.floor(D*Math.random()|0);return e||(n>>>=0),n},ne.mwcRandomSeed=function(e){e?V(e):q()},ne.mwcRandom32=function(e){var n=((K=36969*(65535&K)+(K>>16)&k)<<16)+(65535&(B=18e3*(65535&B)+(B>>16)&k))>>>0&k|0;return e||(n>>>=0),n},ne.generateW3CId=function(){for(var e,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",r=0;r<4;r++)t+=n[15&(e=ne.random32())]+n[e>>4&15]+n[e>>8&15]+n[e>>12&15]+n[e>>16&15]+n[e>>20&15]+n[e>>24&15]+n[e>>28&15];var i=n[8+(3&ne.random32())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)},ne.isTypeof=W,ne.isUndefined=H,ne.isNullOrUndefined=G,ne.hasOwnProperty=J,ne.isFunction=$,ne.isObject=Q,ne.objCreate=u,ne.objDefineAccessors=X,ne);function ne(){}var te=/[xy]/g,re=(ie.Attach=Z,ie.AttachEvent=Z,ie.Detach=Y,ie.DetachEvent=Y,ie);function ie(){}(vn=c.LoggingSeverity||(c.LoggingSeverity={}))[vn.CRITICAL=1]="CRITICAL",vn[vn.WARNING=2]="WARNING";var oe={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,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103},ae="constructor",ue="prototype",se="function",ce="_dynInstFuncs",le="_isDynProxy",fe="_dynClass",ge="_dynCls$",de="_dynInstChk",ve=de,pe="_dfOpts",he="_unknown_",ye="__proto__",xe="useBaseInst",me="setInstFuncs",Ce=Object.getPrototypeOf,we=0;function Te(e,n){return e&&Object[ue].hasOwnProperty.call(e,n)}function Ie(e){return typeof e===se}function Se(e){return e&&(e===Object[ue]||e===Array[ue])}function Ne(e){return Se(e)||e===Function[ue]}function be(e){if(e){if(Ce)return Ce(e);if(e=e[ye]||e[ue]||e[ae])return e}return null}function Ee(e,n,t){return n!==ae&&Ie(e[n])&&(t||Te(e,n))}function _e(e){throw new TypeError("DynamicProto: "+e)}function Pe(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function Fe(e,n){return Te(e,ue)?e.name||n||he:((e||{})[ae]||{}).name||n||he}function Le(e,t,n,r){Te(e,ue)||_e("theClass is an invalid class definition.");var i=e[ue];!function(e){for(var n=be(t);n&&!Ne(n);){if(n===e)return 1;n=be(n)}}(i)&&_e("["+Fe(e)+"] is not in class hierarchy of ["+Fe(t)+"]");var o=null;Te(i,fe)?o=i[fe]:(o=ge+Fe(e,"_")+"$"+we,we++,i[fe]=o);var a=Le[pe],u=!!a[xe];u&&r&&r[xe]!==undefined&&(u=!!r[xe]),n(t,function(e,n,t,o){function r(e,n,t){var r,i=n[s];return i[le]&&o&&!1!==(r=e[ce]||{})[ve]&&(i=(r[n[fe]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};for(s in t)i[s]=r(n,t,s);for(var a=be(e),u=[];a&&!Ne(a)&&!Pe(u,a);){for(var s in a)!i[s]&&Ee(a,s,!Ce)&&(i[s]=r(n,a,s));u.push(a),a=be(a)}return i}(i,t,e=function(e){var n,t={};for(n in e)!t[n]&&Ee(e,n,!1)&&(t[n]=e[n]);return t}(t),u)),(a=!!Ce&&!!a[me])&&r&&(a=!!r[me]),function(e,n,t,r,i){if(!Se(e)){var o,a=t[ce]=t[ce]||{},u=a[n]=a[n]||{};for(o in!1!==a[ve]&&(a[ve]=!!i),t)Ee(t,o,!1)&&t[o]!==r[o]&&(u[o]=t[o],delete t[o],Te(e,o)&&(!e[o]||e[o][le])||(e[o]=function(t,r){var i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&Te(t,fe)){var o=e[ce]||{};if((i=(o[t[fe]]||{})[n])||_e("Missing ["+n+"] "+se),!i[de]&&!1!==o[ve]){for(var a=!Te(e,n),u=be(e),s=[];a&&u&&!Ne(u)&&!Pe(s,u);){var c=u[n];if(c){a=c===r;break}s.push(u),u=be(u)}try{a&&(e[n]=i),i[de]=1}catch(l){o[ve]=!1}}}return i}(this,r,t,i)||((n=t[e=r])===i&&(n=be(t)[e]),Ie(n)||_e("["+e+"] is not a "+se),n)).apply(this,arguments)};return i[le]=1,i}(e,o)))}}(i,o,t,e,!1!==a)}function Me(e){return e?'"'+e.replace(/\"/g,"")+'"':""}Le[pe]={setInstFuncs:!0,useBaseInst:!0};var Oe=(Ae.dataType="MessageData",Ae);function Ae(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",_()&&(e=P().stringify(r)),e=(n?" message:"+Me(n):"")+(r?" props:"+Me(e):""),this.message+=e}var je=function En(i){this.identifier="DiagnosticLogger",this.queue=[];var u=0,s={};Le(En,this,function(o){var t=ee.isNullOrUndefined,a=ee.isUndefined,r=ee.isFunction;function e(e,n){return e=i[e],t(e)?n:e}t(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(void 0===i&&(i=!1),r=new Oe(n,t,i,r),o.enableDebugExceptions())throw r;!a(r)&&r&&(a(r.message)||(i?(i=+r.messageId,!s[i]&&o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(o.warnToConsole(r.message),s[i]=!0)):o.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&o.warnToConsole(r.message),o.logInternalMessage(e,r)))},o.warnToConsole=function(e){var n,t=b();t&&(n="log",t.warn&&(n="warn"),r(t[n])&&t[n](e))},o.resetInternalMessageCount=function(){u=0,s={}},o.logInternalMessage=function(e,n){var t,r;u>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,s[r]?t=!1:s[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),u++),u===o.maxInternalMessageLimit()&&(n=new Oe(oe.MessageLimitPerPVExceeded,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},Re="ctx",De=(ke.ParentContextKey="parent",ke.ChildrenContextKey="childEvts",ke);function ke(e,i,n){var t,o=this,a=!1;o.start=ee.dateNow(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},ee.isFunction(i)&&(a=ee.objDefineAccessors(o,"payload",function(){return!t&&ee.isFunction(i)&&(t=i(),i=null),t})),o.getCtx=function(e){return e?(e===ke.ParentContextKey||e===ke.ChildrenContextKey?o:o[Re]||{})[e]:null},o.setCtx=function(e,n){e&&(e===ke.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===ke.ChildrenContextKey?o[e]=n:(o[Re]=o[Re]||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(ke.ChildrenContextKey);if(ee.isArray(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=ee.dateNow()-o.start,o.exTime=o.time-e,o.complete=function(){},!a&&ee.isFunction(i)&&(o.payload=i())}}var Ue=function _n(n){this.ctx={},Le(_n,this,function(t){t.create=function(e,n,t){return new De(e,n,t)},t.fire=function(e){e&&(e.complete(),n&&n.perfEvent(e))},t.setCtx=function(e,n){e&&((t[Re]=t[Re]||{})[e]=n)},t.getCtx=function(e){return(t[Re]||{})[e]}})},ze="CoreUtils.doPerf";function Be(e,n,t,r,i){if(e){var o=e;if(o&&ee.isFunction(o.getPerfMgr)&&(o=o.getPerfMgr()),o){var a,u=void 0,s=o.getCtx(ze);try{if(u=o.create(n(),r,i))return s&&u.setCtx&&(u.setCtx(De.ParentContextKey,s),s.getCtx&&s.setCtx&&((a=s.getCtx(De.ChildrenContextKey))||(a=[],s.setCtx(De.ChildrenContextKey,a)),a.push(u))),o.setCtx(ze,u),t(u)}catch(c){u&&u.setCtx&&u.setCtx("exception",c)}finally{u&&o.fire(u),o.setCtx(ze,s)}}}return t()}var Ke=ee.isFunction,Ve=function(i,n){var o=this,a=null,u=Ke(i.processTelemetry),s=Ke(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(e){a=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";Be(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=a&&a._hasRun;a&&e||r.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,oe.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+n),a&&!e&&a.processTelemetry(t,r)}}else a&&(o._hasRun=!0,a.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}},qe=ee.isNullOrUndefined;function We(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&ee.isFunction(o.processTelemetry)&&(o=new Ve(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var He=function Pn(e,i,t,n){var r,o,a,u,s=this,c=null;null!==n&&(e&&ee.isFunction(e.getPlugin)?c=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),We(r,n)}(e,s,n||e.getPlugin()):n?(r=s,a=e,u=!1,(o=n)&&e&&(a=[],ee.arrForEach(e,function(e){!u&&e!==o||(u=!0,a.push(e))})),o&&!u&&(a=a||[]).push(o),c=We(a,r)):ee.isUndefined(n)&&(c=We(e,s))),s.core=function(){return t},s.diagLog=function(){return(t||{}).logger||new je(i||{})},s.getCfg=function(){return i},s.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},s.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=s.getExtCfg(e,null))&&!qe(e[n])?r=e[n]:i&&!qe(i[n])&&(r=i[n]),qe(r)?t:r},s.hasNext=function(){return null!=c},s.getNext=function(){return c},s.setNext=function(e){c=e},s.processNext=function(e){var n=c;n&&(c=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return void 0===e&&(e=null),new Pn(e||c,i,t,n)}},Ge=ee.isFunction,Je="getPlugin",t=(Qe.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Qe);function Qe(){var o=this,a=!1,u=null,s=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){s=e},o.processNext=function(e,n){n?n.processNext(e):s&&Ge(s.processTelemetry)&&s.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;return n||(e=u||new He(null,{},o.core),n=s&&s[Je]?e.createNew(null,s[Je]):e.createNew(null,s)),n},o._baseTelInit=function(e,n,t,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&n&&(r=n.getProcessTelContext().getNext());var i=s;s&&s[Je]&&(i=s[Je]()),o.core=n,u=new He(r,e,n,i),a=!0}}var $e=ee.isFunction,Ze="processTelemetry",Ye="priority",Xe="setNextPlugin",en="isInitialized";function nn(n,t){for(var e=[],r=null,i=n.getNext();i;){var o=i.getPlugin();o&&(r&&$e(r[Xe])&&$e(o[Ze])&&r[Xe](o),$e(o[en])&&o[en]()||e.push(o),r=o,i=i.getNext())}ee.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function tn(e){return e.sort(function(e,n){var t=0,r=$e(n[Ze]);return $e(e[Ze])?t=r?e[Ye]-n[Ye]:1:r&&(t=-1),t})}var rn,on=500,an="Channel has invalid priority",un=ee.objDefineAccessors,sn=(rn=t,__extends(cn,rn),cn._staticInit=(un(cn.prototype,"ChannelControls",cn.prototype.getChannelControls),void un(cn.prototype,"channelQueue",cn.prototype.getChannelControls)),cn);function cn(){var r=rn.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=on;var s,c=ee.arrForEach;function l(e){e&&0<e.length&&(e=e.sort(function(e,n){return e.priority-n.priority}),c(e,function(e){if(e.priority<on)throw Error(an+e.identifier)}),s.push(e))}return Le(cn,r,function(a,u){a.setNextPlugin=function(e){},a.processTelemetry=function(n,t){s&&c(s,function(e){0<e.length&&r._getTelCtx(t).createNew(e).processNext(n)})},a.getChannelControls=function(){return s},a.initialize=function(n,t,r){var e,i,o;a.isInitialized()||(u.initialize(n,t,r),n.isCookieUseDisabled&&ee.disableCookies(),i=r,s=[],(e=(n||{}).channels)&&c(e,l),i&&(o=[],c(i,function(e){e.priority>on&&o.push(e)}),l(o)),c(s,function(e){return nn(new He(e,n,t),r)}))}}),r}var ln,fn=ee.arrForEach,gn=ee.isNullOrUndefined,dn="_notificationManager",vn=function Fn(){var n,u,s,t,c=!1;Le(Fn,this,function(a){a._extensions=[],u=new sn,a.logger=ee.objCreate({throwInternal:function(e,n,t,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),n=[],a.isInitialized=function(){return c},a.initialize=function(e,n,r,t){if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||gn(e.instrumentationKey))throw Error("Please provide instrumentation key");s=t,a[dn]=t,a.config=e||{},e.extensions=gn(e.extensions)?[]:e.extensions,(e.extensionConfig=gn(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,r&&(a.logger=r),(t=[]).push.apply(t,n.concat(e.extensions)),t=tn(t);var i=[],o={};if(fn(t,function(e){if(gn(e)||gn(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(gn(o[n])?o[n]=t:r.warnToConsole("Two extensions have same priority #"+n+" - "+o[n]+", "+t)),(!n||n<u.priority)&&i.push(e)}),t.push(u),i.push(u),t=tn(t),a._extensions=t,nn(new He([u],e,a),t),nn(new He(i,e,a),t),a._extensions=i,0===a.getTransmissionControls().length)throw Error("No channels available");c=!0,a.releaseQueue()},a.getTransmissionControls=function(){return u.getChannelControls()},a.track=function(e){e.iKey||(e.iKey=a.config.instrumentationKey),e.time||(e.time=ee.toISOString(new Date)),gn(e.ver)&&(e.ver="4.0"),a.isInitialized()?a.getProcessTelContext().processNext(e):n.push(e)},a.getProcessTelContext=function(){var e=a._extensions,n=e;return e&&0!==e.length||(n=[u]),new He(n,a.config,a)},a.getNotifyMgr=function(){return s||(s=ee.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),a[dn]=s),s},a.getPerfMgr=function(){return t||a.config&&a.config.enablePerfMgr&&(t=new Ue(a.getNotifyMgr())),t},a.setPerfMgr=function(e){t=e},a.eventCnt=function(){return n.length},a.releaseQueue=function(){0<n.length&&(fn(n,function(e){a.getProcessTelContext().processNext(e)}),n=[])}})},pn=function Ln(e){this.listeners=[];var o=ee.arrForEach,n=!!(e||{}).perfEvtsSendAll;Le(Ln,this,function(i){i.addNotificationListener=function(e){i.listeners.push(e)},i.removeNotificationListener=function(e){for(var n=ee.arrIndexOf(i.listeners,e);-1<n;)i.listeners.splice(n,1),n=ee.arrIndexOf(i.listeners,e)},i.eventsSent=function(n){o(i.listeners,function(e){e&&e.eventsSent&&setTimeout(function(){return e.eventsSent(n)},0)})},i.eventsDiscarded=function(n,t){o(i.listeners,function(e){e&&e.eventsDiscarded&&setTimeout(function(){return e.eventsDiscarded(n,t)},0)})},i.eventsSendRequest=function(t,r){o(i.listeners,function(e){if(e&&e.eventsSendRequest)if(r)setTimeout(function(){return e.eventsSendRequest(t,r)},0);else try{e.eventsSendRequest(t,r)}catch(n){}})},i.perfEvent=function(t){t&&(!n&&t.isChildEvt()||o(i.listeners,function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout(function(){return e.perfEvent(t)},0);else try{e.perfEvent(t)}catch(n){}}))}})},un=(ln=vn,__extends(hn,ln),hn);function hn(){var e=ln.call(this)||this;return Le(hn,e,function(t,i){function n(e){var n=t.getNotifyMgr();n&&n.eventsDiscarded([e],l.InvalidEvent)}t.initialize=function(e,n,t,r){i.initialize(e,n,t||new je(e),r||new pn(e))},t.track=function(e){Be(t.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){if(null===e)throw n(e),Error("Invalid telemetry item");!function(e){if(ee.isNullOrUndefined(e.name))throw n(e),Error("telemetry name required")}(e),i.track(e)},function(){return{item:e}},!e.sync)},t.addNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.addNotificationListener(e)},t.removeNotificationListener=function(e){var n=t.getNotifyMgr();n&&n.removeNotificationListener(e)},t.pollInternalLogs=function(n){var e=t.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var e=t.logger?t.logger.queue:[];ee.arrForEach(e,function(e){e={name:n||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:ee.toISOString(new Date),baseType:Oe.dataType,baseData:{message:e.message}},t.track(e)}),e.length=0},e)}}),e}var yn="_aiHooks",xn=["req","rsp","hkErr","fnErr"],mn="__proto__",Cn="constructor";function wn(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Tn(e,u,s,c,l){0<=l&&l<=2&&wn(e,function(e,n){var t=e.cbks,r=t[xn[l]];if(r){u.ctx=function(){return c[n]=c[n]||{}};try{r.apply(u.inst,s)}catch(o){e=u.err;try{var i=t[xn[2]];i&&(u.err=o,i.apply(u.inst,s))}catch(a){}finally{u.err=e}}}})}function In(s){return function(){var t=arguments,e=s.h,r={name:s.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,i=o([r],t)}},n=[],i=o([r],t);function o(n,e){return wn(e,function(e){n.push(e)}),n}Tn(e,r,i,n,0);var a=s.f;try{r.rslt=a.apply(this,t)}catch(u){throw r.err=u,Tn(e,r,i,n,3),u}return Tn(e,r,i,n,1),r.rslt}}var Sn=Object.getPrototypeOf;function Nn(e,n,t,r){if(void 0===r&&(r=!0),e&&n&&t&&((e=function o(e,n,t){var r=null;return e&&(ee.hasOwnProperty(e,n)?r=e:t&&(r=o(function(e){if(e){if(Sn)return Sn(e);if(e=e[mn]||e[d]||e[Cn])return e}return null}(e),n,!1))),r}(e,n,r))&&typeof(r=e[n])===v)){var i=r[yn];return i||((r=In(i={i:0,n:n,f:r,h:[]}))[yn]=i,e[n]=r),t={id:i.i,cbks:t,rm:function(){var t=this.id;wn(i.h,function(e,n){return e.id===t&&(i.h.splice(n,1),1)})}},i.i++,i.h.push(t),t}return null}function bn(n,e,t,r){void 0===r&&(r=!0);var i=null;return wn(e,function(e){(e=Nn(n,e,t,r))&&(i=i||[]).push(e)}),i}c.MinChannelPriorty=100,c.EventsDiscardedReason=l,c.AppInsightsCore=un,c.BaseCore=vn,c.BaseTelemetryPlugin=t,c.CoreUtils=ee,c.EventHelper=re,c.Undefined=M,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.objForEachKey=function(e,n){if(e&&Q(e))for(var t in e)J(e,t)&&n.call(e,t,e[t])},c.proxyAssign=function(r,i,o){if(r&&i&&r!==i&&Q(r)&&Q(i))for(var e in i)!function(n){var e,t;ee.isString(n)&&($(e=i[n])?o&&!o(n,!0,i,r)||(r[n]=(t=n,function(){var e=arguments;return i[t].apply(i,e)})):o&&!o(n,!1,i,r)||(J(r,n)&&delete r[n],X(r,n,function(){return i[n]},function(e){i[n]=e})||(r[n]=e)))}(e);return r},c.getGlobal=y,c.getGlobalInst=x,c.hasWindow=m,c.getWindow=C,c.hasDocument=w,c.getDocument=T,c.getCrypto=F,c.getMsCrypto=L,c.hasNavigator=I,c.getNavigator=S,c.hasHistory=N,c.getHistory=function(){return N()?history:x("history")},c.getLocation=function(){return typeof location===g&&location?location:x("location")},c.getPerformance=E,c.hasJSON=_,c.getJSON=P,c.isReactNative=function(){var e=S();return!(!e||!e.product)&&"ReactNative"===e.product},c.getConsole=b,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=v,c.NotificationManager=pn,c.PerfEvent=De,c.PerfManager=Ue,c.doPerf=Be,c.DiagnosticLogger=je,c._InternalLogMessage=Oe,c.ProcessTelemetryContext=He,c.initializePlugins=nn,c.sortPlugins=tn,c._InternalMessageId=oe,c.InstrumentProto=function(e,n,t){return e?Nn(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?bn(e[d],n,t,!1):null},c.InstrumentFunc=Nn,c.InstrumentFuncs=bn,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}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.10",
"version": "2.5.11",
"description": "Microsoft Application Insights Core Javascript SDK",

@@ -6,0 +6,0 @@ "keywords": [

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

*/
disableInstrumentaionKeyValidation?: boolean;
disableInstrumentationKeyValidation?: boolean;

@@ -91,0 +91,0 @@ /**

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

/**
* Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with
* existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded
* and executed in an ES3 container, providing basic IE8 compatibility.
* @param target The object on which to define the property.
* @param prop The name of the property to be defined or modified.
* @param getProp The getter function to wire against the getter.
* @param setProp The setter function to wire against the setter.
* @returns True if it was able to create the accessors otherwise false
*/
export function objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean {
let defineProp = Object["defineProperty"];
if (defineProp) {
try {
let descriptor: PropertyDescriptor = {
enumerable: true,
configurable: true
}
if (getProp) {
descriptor.get = getProp;
}
if (setProp) {
descriptor.set = setProp;
}
defineProp(target, prop, descriptor);
return true;
} catch (e) {
// IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw
// We will just ignore this here.
}
}
return false;
}
/**
* Validates that the string name conforms to the JS IdentifierName specification and if not

@@ -150,2 +187,59 @@ * normalizes the name so that it would. This method does not identify or change any keywords

/**
* Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from
* the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential
* implementation issues by assigning prototype functions as instance ones
*
* This method is the primary method used to "update" the snippet proxy with the ultimate implementations.
*
* Special ES3 Notes:
* Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the
* properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the
* same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.
* @param target - The target object to be assigned with the source properties and functions
* @param source - The source object which will be assigned / called by setting / calling the targets proxies
* @param chkSet - An optional callback to determine whether a specific property/function should be proxied
* @memberof Initialization
*/
export function proxyAssign(target: any, source: any, chkSet?: (name: string, isFunc?: boolean, source?: any, target?: any) => boolean) {
if (target && source && target !== source && _isObject(target) && _isObject(source)) {
// effectively apply/proxy full source to the target instance
for (const field in source) {
if (CoreUtils.isString(field)) {
let value = source[field] as any;
if (_isFunction(value)) {
if (!chkSet || chkSet(field, true, source, target)) {
// Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function
target[field as string] = (function(funcName: string) {
return function() {
// Capture the original arguments passed to the method
var originalArguments = arguments;
return source[funcName].apply(source, originalArguments);
}
})(field);
}
} else if (!chkSet || chkSet(field, false, source, target)) {
if (_hasOwnProperty(target, field)) {
// Remove any previous instance property
delete target[field];
}
if (!objDefineAccessors(target, field, () => {
return source[field];
}, (theValue) => {
source[field] = theValue;
})) {
// Unable to create an accessor, so just assign the values as a fallback
// -- this will (mostly) work for objects
// -- but will fail for accessing primitives (if the source changes it) and all types of "setters" as the source won't be modified
target[field as string] = value;
}
}
}
}
}
return target;
}
export class CoreUtils {

@@ -435,29 +529,4 @@ public static _canUseCookies: 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 = {
enumerable: true,
configurable: true
}
public static objDefineAccessors = objDefineAccessors;
if (getProp) {
descriptor.get = getProp;
}
if (setProp) {
descriptor.set = setProp;
}
defineProp(target, prop, descriptor);
return true;
} catch (e) {
// IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw
// We will just ignore this here.
}
}
return false;
}
/**

@@ -464,0 +533,0 @@ * Trys to add an event handler for the specified event to the window, body and document

@@ -17,3 +17,3 @@ import '@microsoft/applicationinsights-shims';

export { BaseTelemetryPlugin } from './JavaScriptSDK/BaseTelemetryPlugin';
export { CoreUtils, EventHelper, Undefined, normalizeJsName, objForEachKey } from "./JavaScriptSDK/CoreUtils";
export { CoreUtils, EventHelper, Undefined, normalizeJsName, objForEachKey, proxyAssign } from "./JavaScriptSDK/CoreUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";

@@ -20,0 +20,0 @@ export { NotificationManager } from "./JavaScriptSDK/NotificationManager";

@@ -75,3 +75,3 @@ import { ITelemetryPlugin } from "./ITelemetryPlugin";

*/
disableInstrumentaionKeyValidation?: boolean;
disableInstrumentationKeyValidation?: boolean;
/**

@@ -78,0 +78,0 @@ * [Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented

export declare const Undefined = "undefined";
/**
* Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with
* existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded
* and executed in an ES3 container, providing basic IE8 compatibility.
* @param target The object on which to define the property.
* @param prop The name of the property to be defined or modified.
* @param getProp The getter function to wire against the getter.
* @param setProp The setter function to wire against the setter.
* @returns True if it was able to create the accessors otherwise false
*/
export declare function objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean;
/**
* Validates that the string name conforms to the JS IdentifierName specification and if not

@@ -17,2 +28,19 @@ * normalizes the name so that it would. This method does not identify or change any keywords

export declare function objForEachKey(target: any, callbackfn: (name: string, value: any) => void): void;
/**
* Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from
* the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential
* implementation issues by assigning prototype functions as instance ones
*
* This method is the primary method used to "update" the snippet proxy with the ultimate implementations.
*
* Special ES3 Notes:
* Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the
* properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the
* same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.
* @param target - The target object to be assigned with the source properties and functions
* @param source - The source object which will be assigned / called by setting / calling the targets proxies
* @param chkSet - An optional callback to determine whether a specific property/function should be proxied
* @memberof Initialization
*/
export declare function proxyAssign(target: any, source: any, chkSet?: (name: string, isFunc?: boolean, source?: any, target?: any) => boolean): any;
export declare class CoreUtils {

@@ -140,3 +168,3 @@ static _canUseCookies: boolean;

*/
static objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean;
static objDefineAccessors: typeof objDefineAccessors;
/**

@@ -143,0 +171,0 @@ * Trys to add an event handler for the specified event to the window, body and document

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 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