@microsoft/applicationinsights-react-native 2.4.2-nightly.2112-01 → 2.4.2-nightly.2112-06

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2112-01
2
+ * Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2112-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
- var e=this,n=function(e,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var c=t(n),r="function",f="object",g="undefined",i="prototype",o="hasOwnProperty",l=Object,a=l[i],u=l.create,s=l.defineProperty,v=a[o];function d(){return typeof globalThis!==g&&globalThis?globalThis:typeof self!==g&&self?self:typeof window!==g&&window?window:typeof global!==g&&global?global:null}function p(e){throw new TypeError(e)}(d()||{}).Symbol,(d()||{}).Reflect;var y,C=function(e,n){return(C=l.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[o](t)&&(e[t]=n[t])})(e,n)},h="constructor",x="prototype",m="function",I="_dynInstFuncs",b="_isDynProxy",w="_dynClass",T="_dynInstChk",_=T,L="_dfOpts",N="_unknown_",P="__proto__",E="useBaseInst",A="setInstFuncs",D=Object,R=D.getPrototypeOf,M=0;function O(e,n){return e&&D[x].hasOwnProperty.call(e,n)}function j(e){return e&&(e===D[x]||e===Array[x])}function K(e){return j(e)||e===Function[x]}function S(e){if(e){if(R)return R(e);if(e=e[P]||e[x]||(e[h]?e[h][x]:null))return e}return null}function U(e,n){var t=[],r=D.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&O(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function k(e,n,t){return n!==h&&typeof e[n]===m&&(t||O(e,n))}function z(e){throw new TypeError("DynamicProto: "+e)}function H(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function q(e,n){return O(e,x)?e.name||n||N:((e||{})[h]||{}).name||n||N}function F(e,r,n,t){O(e,x)||z("theClass is an invalid class definition.");var i=e[x];!function(e){if(R)for(var n=[],t=S(r);t&&!K(t)&&!H(n,t);){if(t===e)return 1;n.push(t),t=S(t)}}(i)&&z("["+q(e)+"] is not in class hierarchy of ["+q(r)+"]");var o=null;O(i,w)?o=i[w]:(o="_dynCls$"+q(e,"_")+"$"+M,M++,i[w]=o);var l=F[L],a=!!l[E];a&&t&&t[E]!==undefined&&(a=!!t[E]);var u,s,c,f,g,v,e=(s={},U(u=r,function(e){!s[e]&&k(u,e,!1)&&(s[e]=u[e])}),s);n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[b]&&o&&!1!==(r=e[I]||{})[_]&&(i=(r[n[w]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};U(t,function(e){i[e]=r(n,t,e)});for(var l=S(e),a=[];l&&!K(l)&&!H(a,l);)U(l,function(e){!i[e]&&k(l,e,!R)&&(i[e]=r(n,l,e))}),a.push(l),l=S(l);return i}(i,r,e,a)),l=!!R&&!!l[A],c=i,o=o,f=r,g=e,t=!1!==(l=l&&t?!!t[A]:l),j(c)||(l=f[I]=f[I]||{},v=l[o]=l[o]||{},!1!==l[_]&&(l[_]=!!t),U(f,function(e){var t,r,i;k(f,e,!1)&&f[e]!==g[e]&&(v[e]=f[e],delete f[e],O(c,e)&&(!c[e]||c[e][b])||(c[e]=(t=c,r=e,(i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&O(t,w)){var o=e[I]||{};if((i=(o[t[w]]||{})[n])||z("Missing ["+n+"] "+m),!i[T]&&!1!==o[_]){for(var l=!O(e,n),a=S(e),u=[];l&&a&&!K(a)&&!H(u,a);){var s=a[n];if(s){l=s===r;break}u.push(a),a=S(a)}try{l&&(e[n]=i),i[T]=1}catch(c){o[_]=!1}}}return i}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?S(t)[e]:n)!==m&&z("["+e+"] is not a "+m),n)).apply(this,arguments)})[b]=1,i)))}))}F[L]={setInstFuncs:!0,useBaseInst:!0},(n=y=y||{})[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var G=73,W=s;function J(e){return a.toString.call(e)}function V(e){return e===undefined||typeof e===g}function B(e){return null===e||V(e)}function $(e){return typeof e===r}function Q(e,n,t){var r=e.length;try{for(var i=0;i<r&&!(i in e&&-1===n.call(t||e,e[i],i,e));i++);}catch(o){}}function X(){var e=Date;return e.now?e.now():(new e).getTime()}var Y="window",Z="JSON";function ee(e){var n=d();return n&&n[e]?n[e]:e===Y&&typeof window===f&&window?window:null}function ne(){return typeof JSON===f&&JSON||null!==ee(Z)}function te(){return ne()?JSON||ee(Z):null}function re(e){var n=Object[i].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":ne()&&(t=te().stringify(e)),n+t}var ie=null;function oe(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function le(e,n){var t,r=typeof console!==g?console:ee("console");r&&(t="log",$(r[t=r[e]?e:t])&&r[t](n))}var ae=(ue.dataType="MessageData",ue);function ue(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",ne()&&(e=te().stringify(r)),e=(n?" message:"+oe(n):"")+(r?" props:"+oe(e):""),this.message+=e}var se=function Le(i){this.identifier="DiagnosticLogger",this.queue=[];var a=0,u={};F(Le,this,function(o){function e(e,n){return B(e=i[e])?n:e}function l(e,n){var t,r=(t=i,(r=(r=ie)||!0===t.disableDbgExt?r:ie||(t=ee("Microsoft"),ie=t?t.ApplicationInsights:ie))?r.ChromeDbgExt:null);r&&r.diagLog&&r.diagLog(e,n)}B(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(n=new ae(n,t,i=void 0!==i&&i,r),o.enableDebugExceptions())throw n;t=e===y.CRITICAL?"errorToConsole":"warnToConsole",V(n.message)?l("throw"+(e===y.CRITICAL?"Critical":"Warning"),n):(r=o.consoleLoggingLevel(),i?(i=+n.messageId,!u[i]&&e<=r&&(o[t](n.message),u[i]=!0)):e<=r&&o[t](n.message),o.logInternalMessage(e,n))},o.warnToConsole=function(e){le("warn",e),l("warning",e)},o.errorToConsole=function(e){le("error",e),l("error",e)},o.resetInternalMessageCount=function(){a=0,u={}},o.logInternalMessage=function(e,n){var t,r;a>=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,u[t]?r=!1:u[t]=!0,r&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),a++,l(e===y.CRITICAL?"error":"warn",n)),a===o.maxInternalMessageLimit()&&(n=new ae(23,r="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),e===y.CRITICAL?o.errorToConsole(r):o.warnToConsole(r))))}})},ce=(fe.ParentContextKey="parent",fe.ChildrenContextKey="childEvts",fe);function fe(e,i,n){var r,o=this,l=!1;o.start=X(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},$(i)&&(l=function(e){if(W)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&$(i)&&(r=i(),i=null),r}};return W(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===fe.ParentContextKey||e===fe.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===fe.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===fe.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(fe.ChildrenContextKey);if("[object Array]"===J(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X()-o.start,o.exTime=o.time-e,o.complete=function(){},!l&&$(i)&&(o.payload=i())}}var ge="CoreUtils.doPerf";function ve(e,n,t,r,i){if(e){var o=e;if(o=$(o.getPerfMgr)?o.getPerfMgr():o){var l,a=void 0,e=o.getCtx(ge);try{if(a=o.create(n(),r,i))return e&&a.setCtx&&(a.setCtx(ce.ParentContextKey,e),e.getCtx&&e.setCtx&&((l=e.getCtx(ce.ChildrenContextKey))||(l=[],e.setCtx(ce.ChildrenContextKey,l)),l.push(a))),o.setCtx(ge,a),t(a)}catch(u){a&&a.setCtx&&a.setCtx("exception",u)}finally{a&&o.fire(a),o.setCtx(ge,e)}}}return t()}var de=function(i,n){var o=this,l=null,a=$(i.processTelemetry),u=$(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return l},o.setNext=function(e){l=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ve(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&a){o._hasRun=!0;try{r.setNext(l),u&&i.setNextPlugin(l),l&&(l._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=l&&l._hasRun;l&&e||r.diagLog().throwInternal(y.CRITICAL,G,"Plugin ["+i.identifier+"] failed during processTelemetry - "+re(n)),l&&!e&&l.processTelemetry(t,r)}}else l&&(o._hasRun=!0,l.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}};function pe(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&$(o.processTelemetry)&&(o=new de(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var ye,Ce=function Ne(e,i,t,n){var r,o,l,a,u=this,s=null;null!==n&&(e&&$(e.getPlugin)?s=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),pe(r,n)}(e,u,n||e.getPlugin()):n?(r=u,l=e,a=!1,(o=n)&&e&&(l=[],Q(e,function(e){!a&&e!==o||(a=!0,l.push(e))})),o&&!a&&(l=l||[]).push(o),s=pe(l,r)):V(n)&&(s=pe(e,u))),u.core=function(){return t},u.diagLog=function(){return(t||{}).logger||new se(i)},u.getCfg=function(){return i},u.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},u.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=u.getExtCfg(e,null))&&!B(e[n])?r=e[n]:i&&!B(i[n])&&(r=i[n]),B(r)?t:r},u.hasNext=function(){return null!=s},u.getNext=function(){return s},u.setNext=function(e){s=e},u.processNext=function(e){var n=s;n&&(s=n.getNext(),n.processTelemetry(e,u))},u.createNew=function(e,n){return new Ne((e=void 0===e?null:e)||s,i,t,n)}},he="getPlugin",n=(xe.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},xe);function xe(){var a=this,u=!1,s=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return u},a.setInitialized=function(e){u=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,n){n?n.processNext(e):c&&$(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){var n=e=void 0===e?null:e;return n||(e=s||new Ce(null,{},a.core),n=c&&c[he]?e.createNew(null,c[he]):e.createNew(null,c)),n},a._baseTelInit=function(e,n,t,r){var i,o;e&&(i="extensionConfig",l=o=[],!e||(l=e[i])!==o&&B(l)&&(e[i]=l=o)),!r&&n&&(r=n.getProcessTelContext().getNext());var l=c;c&&c[he]&&(l=c[he]()),a.core=n,s=new Ce(r,e,n,l),u=!0}}(s=ye=ye||{})[s.Verbose=0]="Verbose",s[s.Information=1]="Information",s[s.Warning=2]="Warning",s[s.Error=3]="Error",s[s.Critical=4]="Critical";var me=(Ie.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),n=(t&&e.extensionConfig&&e.extensionConfig[t]&&!B(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],B(n)?r:n},Ie);function Ie(){}var be,we,n=(we=_e,typeof(s=be=n)!==r&&null!==s&&p("Class extends value "+s+" is not a constructor or null"),C(we,s),we[i]=null===s?function(e){if(u)return u(e);if(null==e)return{};var n=typeof e;function t(){}return n!==f&&n!==r&&p("Object prototype may only be an Object:"+e),t[i]=e,new t}(s):(Te[i]=s[i],new Te),_e);function Te(){this.constructor=we}function _e(e){var n=be.call(this)||this;n.identifier="AppInsightsReactNativePlugin",n.priority=140;var l,r,a={},u=e||s();function s(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return F(_e,n,function(i,o){i.initialize=function(e,n,t){var r;i.isInitialized()||(o.initialize(e,n,t),r=e||{},function(e,n){if("object"===f)for(var t in e)i=t,(r=e)&&v.call(r,i)&&n(t,e[t]);var r,i}(s(),function(e,n){u[e]=me.getConfig(r,e,i.identifier,V(u[e])?n:u[e])}),u.disableDeviceCollection||i._collectDeviceInfo(),t&&Q(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(l=e)}),u.disableExceptionCollection||i._setExceptionHandler())},i.processTelemetry=function(e,n){var t=e;a&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof a.id&&(t.ext.device.localId=a.id),"string"==typeof a.model&&(t.ext.device.model=a.model),"string"==typeof a.deviceClass&&(t.ext.device.deviceClass=a.deviceClass)),i.processNext(e,n)},i.setDeviceId=function(e){a.id=e},i.setDeviceModel=function(e){a.model=e},i.setDeviceType=function(e){a.deviceClass=e},i._collectDeviceInfo=function(){try{a.deviceClass=c["default"].getDeviceType(),a.id=c["default"].getUniqueId(),a.model=c["default"].getModel()}catch(n){i.diagLog().warnToConsole("Failed to get DeviceInfo: "+("[object Error]"===J(e=n)?e.name:"")+" - "+re(n))}var e},i._setExceptionHandler=function(){var e=typeof global!==g&&global?global:d();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:ye.Error};l?l.trackException(t):i.diagLog().throwInternal(y.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},i._config=u,i._getDbgPlgTargets=function(){return[a]}}),n}e.ReactNativePlugin=n,Object.defineProperty(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
5
+ var e=this,n=function(e,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var c=t(n),r="function",f="object",g="undefined",i="prototype",o="hasOwnProperty",l=Object,a=l[i],n=(l.create,l.defineProperty),v=a[o];function d(){return typeof globalThis!==g&&globalThis?globalThis:typeof self!==g&&self?self:typeof window!==g&&window?window:typeof global!==g&&global?global:null}function s(e){throw new TypeError(e)}(d()||{}).Symbol,(d()||{}).Reflect;var u=function(e,n){return(u=l.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[o](t)&&(e[t]=n[t])})(e,n)},p="constructor",y="prototype",C="function",h="_dynInstFuncs",x="_isDynProxy",m="_dynClass",I="_dynInstChk",b=I,w="_dfOpts",T="_unknown_",_="__proto__",L="useBaseInst",N="setInstFuncs",P=Object,E=P.getPrototypeOf,A=0;function D(e,n){return e&&P[y].hasOwnProperty.call(e,n)}function R(e){return e&&(e===P[y]||e===Array[y])}function M(e){return R(e)||e===Function[y]}function O(e){if(e){if(E)return E(e);e=e[_]||e[y]||(e[p]?e[p][y]:null);if(e)return e}return null}function j(e,n){var t=[],r=P.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&D(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function K(e,n,t){return n!==p&&typeof e[n]===C&&(t||D(e,n))}function S(e){throw new TypeError("DynamicProto: "+e)}function U(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function k(e,n){return D(e,y)?e.name||n||T:((e||{})[p]||{}).name||n||T}function z(e,r,n,t){D(e,y)||S("theClass is an invalid class definition.");var i=e[y];!function(e){if(E)for(var n=[],t=O(r);t&&!M(t)&&!U(n,t);){if(t===e)return 1;n.push(t),t=O(t)}}(i)&&S("["+k(e)+"] is not in class hierarchy of ["+k(r)+"]");var o=null;D(i,m)?o=i[m]:(o="_dynCls$"+k(e,"_")+"$"+A,A++,i[m]=o);var l=z[w],a=!!l[L];a&&t&&t[L]!==undefined&&(a=!!t[L]);var s,u,e=(u={},j(s=r,function(e){!u[e]&&K(s,e,!1)&&(u[e]=s[e])}),u);n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[x]&&o&&!1!==(r=e[h]||{})[b]&&(i=(r[n[m]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};j(t,function(e){i[e]=r(n,t,e)});for(var l=O(e),a=[];l&&!M(l)&&!U(a,l);)j(l,function(e){!i[e]&&K(l,e,!E)&&(i[e]=r(n,l,e))}),a.push(l),l=O(l);return i}(i,r,e,a));var c,f,g,v,l=!!E&&!!l[N];c=i,o=o,f=r,g=e,t=!1!==(l=l&&t?!!t[N]:l),R(c)||(l=f[h]=f[h]||{},v=l[o]=l[o]||{},!1!==l[b]&&(l[b]=!!t),j(f,function(e){var t,r,i;K(f,e,!1)&&f[e]!==g[e]&&(v[e]=f[e],delete f[e],D(c,e)&&(!c[e]||c[e][x])||(c[e]=(t=c,r=e,(i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&D(t,m)){var o=e[h]||{};if((i=(o[t[m]]||{})[n])||S("Missing ["+n+"] "+C),!i[I]&&!1!==o[b]){for(var l=!D(e,n),a=O(e),s=[];l&&a&&!M(a)&&!U(s,a);){var u=a[n];if(u){l=u===r;break}s.push(a),a=O(a)}try{l&&(e[n]=i),i[I]=1}catch(c){o[b]=!1}}}return i}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?O(t)[e]:n)!==C&&S("["+e+"] is not a "+C),n)).apply(this,arguments)})[x]=1,i)))}))}z[w]={setInstFuncs:!0,useBaseInst:!0};var H={CRITICAL:1,1:"CRITICAL",WARNING:2,2:"WARNING"},q=73,F=n;function G(e){return a.toString.call(e)}function W(e){return e===undefined||typeof e===g}function J(e){return null===e||W(e)}function V(e){return typeof e===r}function B(e,n,t){var r=e.length;try{for(var i=0;i<r&&!(i in e&&-1===n.call(t||e,e[i],i,e));i++);}catch(o){}}function $(){var e=Date;return e.now?e.now():(new e).getTime()}var Q="window",X="JSON";function Y(e){var n=d();return n&&n[e]?n[e]:e===Q&&typeof window===f&&window?window:null}function Z(){return typeof JSON===f&&JSON||null!==Y(X)}function ee(){return Z()?JSON||Y(X):null}function ne(e){var n=Object[i].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":Z()&&(t=ee().stringify(e)),n+t}var te=null;function re(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function ie(e,n){var t,r=typeof console!==g?console:Y("console");r&&(t="log",V(r[t=r[e]?e:t])&&r[t](n))}var oe=(le.dataType="MessageData",le);function le(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;e="";Z()&&(e=ee().stringify(r));e=(n?" message:"+re(n):"")+(r?" props:"+re(e):"");this.message+=e}var ae=function Te(i){this.identifier="DiagnosticLogger",this.queue=[];var a=0,s={};z(Te,this,function(o){function e(e,n){e=i[e];return J(e)?n:e}function l(e,n){var t,r=(r=(r=te)||!0===i.disableDbgExt?r:te||(t=Y("Microsoft"),te=t?t.ApplicationInsights:te))?r.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(e,n)}J(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){n=new oe(n,t,i=void 0!==i&&i,r);if(o.enableDebugExceptions())throw n;t=e===H.CRITICAL?"errorToConsole":"warnToConsole";W(n.message)?l("throw"+(e===H.CRITICAL?"Critical":"Warning"),n):(r=o.consoleLoggingLevel(),i?(i=+n.messageId,!s[i]&&e<=r&&(o[t](n.message),s[i]=!0)):e<=r&&o[t](n.message),o.logInternalMessage(e,n))},o.warnToConsole=function(e){ie("warn",e),l("warning",e)},o.errorToConsole=function(e){ie("error",e),l("error",e)},o.resetInternalMessageCount=function(){a=0,s={}},o.logInternalMessage=function(e,n){var t,r;a>=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,s[t]?r=!1:s[t]=!0,r&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),a++,l(e===H.CRITICAL?"error":"warn",n)),a===o.maxInternalMessageLimit()&&(n=new oe(23,r="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),e===H.CRITICAL?o.errorToConsole(r):o.warnToConsole(r))))}})},se=(ue.ParentContextKey="parent",ue.ChildrenContextKey="childEvts",ue);function ue(e,i,n){var r,o=this,l=!1;o.start=$(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},V(i)&&(l=function(e){if(F)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&V(i)&&(r=i(),i=null),r}};return F(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===ue.ParentContextKey||e===ue.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===ue.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===ue.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(ue.ChildrenContextKey);if("[object Array]"===G(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=$()-o.start,o.exTime=o.time-e,o.complete=function(){},!l&&V(i)&&(o.payload=i())}}var ce="CoreUtils.doPerf";function fe(e,n,t,r,i){if(e){var o=e;if(o=V(o.getPerfMgr)?o.getPerfMgr():o){var l,a=void 0,e=o.getCtx(ce);try{if(a=o.create(n(),r,i))return e&&a.setCtx&&(a.setCtx(se.ParentContextKey,e),e.getCtx&&e.setCtx&&((l=e.getCtx(se.ChildrenContextKey))||(l=[],e.setCtx(se.ChildrenContextKey,l)),l.push(a))),o.setCtx(ce,a),t(a)}catch(s){a&&a.setCtx&&a.setCtx("exception",s)}finally{a&&o.fire(a),o.setCtx(ce,e)}}}return t()}var ge=function(i,n){var o=this,l=null,a=V(i.processTelemetry),s=V(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return l},o.setNext=function(e){l=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";fe(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&a){o._hasRun=!0;try{r.setNext(l),s&&i.setNextPlugin(l),l&&(l._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=l&&l._hasRun;l&&e||r.diagLog().throwInternal(H.CRITICAL,q,"Plugin ["+i.identifier+"] failed during processTelemetry - "+ne(n)),l&&!e&&l.processTelemetry(t,r)}}else l&&(o._hasRun=!0,l.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}};function ve(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&V(o.processTelemetry)&&(o=new ge(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var de=function _e(e,i,t,n){var r,o,l,a,s=this,u=null;null!==n&&(e&&V(e.getPlugin)?u=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),ve(r,n)}(e,s,n||e.getPlugin()):n?(r=s,l=e,a=!1,(o=n)&&e&&(l=[],B(e,function(e){!a&&e!==o||(a=!0,l.push(e))})),o&&!a&&(l=l||[]).push(o),u=ve(l,r)):W(n)&&(u=ve(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;void 0===t&&(t=!1);e=s.getExtCfg(e,null);return e&&!J(e[n])?r=e[n]:i&&!J(i[n])&&(r=i[n]),J(r)?t:r},s.hasNext=function(){return null!=u},s.getNext=function(){return u},s.setNext=function(e){u=e},s.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,s))},s.createNew=function(e,n){return new _e((e=void 0===e?null:e)||u,i,t,n)}},pe="getPlugin",n=(ye.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},ye);function ye(){var a=this,s=!1,u=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return s},a.setInitialized=function(e){s=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,n){n?n.processNext(e):c&&V(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){var n=e=void 0===e?null:e;return n||(e=u||new de(null,{},a.core),n=c&&c[pe]?e.createNew(null,c[pe]):e.createNew(null,c)),n},a._baseTelInit=function(e,n,t,r){var i,o;e&&(i="extensionConfig",l=o=[],!e||(l=e[i])!==o&&J(l)&&(e[i]=l=o)),!r&&n&&(r=n.getProcessTelContext().getNext());var l=c;c&&c[pe]&&(l=c[pe]()),a.core=n,u=new de(r,e,n,l),s=!0}}var Ce={Verbose:0,0:"Verbose",Information:1,1:"Information",Warning:2,2:"Warning",Error:3,3:"Error",Critical:4,4:"Critical"},he=(xe.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),n=(t&&e.extensionConfig&&e.extensionConfig[t]&&!J(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],J(n)?r:n},xe);function xe(){}var me,Ie,n=(Ie=we,typeof(n=me=n)!==r&&null!==n&&s("Class extends value "+n+" is not a constructor or null"),u(Ie,n),Ie[i]=(be[i]=n[i],new be),we);function be(){this.constructor=Ie}function we(e){var n=me.call(this)||this;n.identifier="AppInsightsReactNativePlugin",n.priority=140;var l,r,a={},s=e||u();function u(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return z(we,n,function(i,o){i.initialize=function(e,n,t){var r;i.isInitialized()||(o.initialize(e,n,t),r=e||{},function(e,n){if("object"===f)for(var t in e)i=t,(r=e)&&v.call(r,i)&&n(t,e[t]);var r,i}(u(),function(e,n){s[e]=he.getConfig(r,e,i.identifier,W(s[e])?n:s[e])}),s.disableDeviceCollection||i._collectDeviceInfo(),t&&B(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(l=e)}),s.disableExceptionCollection||i._setExceptionHandler())},i.processTelemetry=function(e,n){var t=e;a&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof a.id&&(t.ext.device.localId=a.id),"string"==typeof a.model&&(t.ext.device.model=a.model),"string"==typeof a.deviceClass&&(t.ext.device.deviceClass=a.deviceClass)),i.processNext(e,n)},i.setDeviceId=function(e){a.id=e},i.setDeviceModel=function(e){a.model=e},i.setDeviceType=function(e){a.deviceClass=e},i._collectDeviceInfo=function(){try{a.deviceClass=c["default"].getDeviceType(),a.id=c["default"].getUniqueId(),a.model=c["default"].getModel()}catch(n){i.diagLog().warnToConsole("Failed to get DeviceInfo: "+("[object Error]"===G(e=n)?e.name:"")+" - "+ne(n))}var e},i._setExceptionHandler=function(){var e=typeof global!==g&&global?global:d();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:Ce.Error};l?l.trackException(t):i.diagLog().throwInternal(H.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},i._config=s,i._getDbgPlgTargets=function(){return[a]}}),n}e.ReactNativePlugin=n,Object.defineProperty(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
6
6
  //# sourceMappingURL=applicationinsights-react-native.min.js.map