@microsoft/applicationinsights-react-native 2.4.3-nightly.2112-07 → 2.4.3

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.3-nightly.2112-07
2
+ * Application Insights JavaScript SDK - React Native Plugin, 2.4.3
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],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);
5
+ var e=this,n=function(t,e){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var l=r(e),i="function",h="object",o="undefined",u="prototype",a="hasOwnProperty",c=Object,d=c[u],e=(c.create,c.defineProperty),x=d[a],n=null;function m(e){return void 0===e&&(e=!0),n&&e||(typeof globalThis!==o&&globalThis&&(n=globalThis),typeof self!==o&&self&&(n=self),typeof window!==o&&window&&(n=window),typeof global!==o&&global&&(n=global)),n}function I(e){throw new TypeError(e)}(m()||{}).Symbol,(m()||{}).Reflect;var b=function(e,n){return(b=c.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)},w="constructor",v="prototype",T="function",_="_dynInstFuncs",L="_isDynProxy",p="_dynClass",N="_dynInstChk",P=N,E="_dfOpts",A="_unknown_",D="__proto__",R="useBaseInst",M="setInstFuncs",O=Object,j=O.getPrototypeOf,K=0;function y(e,n){return e&&O[v].hasOwnProperty.call(e,n)}function S(e){return e&&(e===O[v]||e===Array[v])}function U(e){return S(e)||e===Function[v]}function C(e){if(e){if(j)return j(e);e=e[D]||e[v]||(e[w]?e[w][v]:null);if(e)return e}return null}function k(e,n){var t=[],r=O.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&y(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function z(e,n,t){return n!==w&&typeof e[n]===T&&(t||y(e,n))}function H(e){throw new TypeError("DynamicProto: "+e)}function q(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function F(e,n){return y(e,v)?e.name||n||A:((e||{})[w]||{}).name||n||A}function G(e,r,n,t){y(e,v)||H("theClass is an invalid class definition.");var c,i,o,l,f,g,s=e[v],u=(function(e){if(j)for(var n=[],t=C(r);t&&!U(t)&&!q(n,t);){if(t===e)return 1;n.push(t),t=C(t)}}(s)||H("["+F(e)+"] is not in class hierarchy of ["+F(r)+"]"),null),e=(y(s,p)?u=s[p]:(u="_dynCls$"+F(e,"_")+"$"+K,K++,s[p]=u),G[E]),a=!!e[R],d=(a&&t&&t[R]!==undefined&&(a=!!t[R]),i={},k(c=r,function(e){!i[e]&&z(c,e,!1)&&(i[e]=c[e])}),i),a=(n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[L]&&o&&!1!==(r=e[_]||{})[P]&&(i=(r[n[p]]||{})[t]||i),function(){return i.apply(e,arguments)}}for(var i={},l=(k(t,function(e){i[e]=r(n,t,e)}),C(e)),s=[];l&&!U(l)&&!q(s,l);)k(l,function(e){!i[e]&&z(l,e,!j)&&(i[e]=r(n,l,e))}),s.push(l),l=C(l);return i}(s,r,d,a)),!!j&&!!e[M]);o=s,n=u,l=r,f=d,e=!1!==(a=a&&t?!!t[M]:a),S(o)||(s=l[_]=l[_]||{},g=s[n]=s[n]||{},!1!==s[P]&&(s[P]=!!e),k(l,function(e){var t,r,i;z(l,e,!1)&&l[e]!==f[e]&&(g[e]=l[e],delete l[e],y(o,e)&&(!o[e]||o[e][L])||(o[e]=(t=o,r=e,(i=function(){var e,n;return(function(e,n,t,c){var r=null;if(e&&y(t,p)){var i=e[_]||{};if((r=(i[t[p]]||{})[n])||H("Missing ["+n+"] "+T),!r[N]&&!1!==i[P]){for(var o=!y(e,n),l=C(e),s=[];o&&l&&!U(l)&&!q(s,l);){var u=l[n];if(u){o=u===c;break}s.push(l),l=C(l)}try{o&&(e[n]=r),r[N]=1}catch(a){i[P]=!1}}}return r}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?C(t)[e]:n)!==T&&H("["+e+"] is not a "+T),n)).apply(this,arguments)})[L]=1,i)))}))}G[E]={setInstFuncs:!0,useBaseInst:!0};var W={CRITICAL:1,1:"CRITICAL",WARNING:2,2:"WARNING"},J=73,V=e;function B(e){return d.toString.call(e)}function $(e){return e===undefined||typeof e===o}function f(e){return null===e||$(e)}function g(e){return typeof e===i}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=m();return n&&n[e]?n[e]:e===Y&&typeof window===h&&window?window:null}function ne(){return typeof JSON===h&&JSON||null!==ee(Z)}function te(){return ne()?JSON||ee(Z):null}function re(e){var n=Object[u].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!==o?console:ee("console");r&&(t="log",g(r[t=r[e]?e:t])&&r[t](n))}ue.dataType="MessageData";var se=ue;function ue(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e;t="",ne()&&(t=te().stringify(r)),e=(n?" message:"+oe(n):"")+(r?" props:"+oe(t):"");this.message+=e}var ae=function _e(i){this.identifier="DiagnosticLogger",this.queue=[];var s=0,u={};G(_e,this,function(o){function e(e,n){e=i[e];return f(e)?n:e}function l(e,n){var t,r=(t=(t=ie)||!0===i.disableDbgExt?t:ie||(r=ee("Microsoft"),ie=r?r.ApplicationInsights:ie))?t.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(e,n)}f(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 se(n,t,i=void 0!==i&&i,r);if(o.enableDebugExceptions())throw n;t=e===W.CRITICAL?"errorToConsole":"warnToConsole";$(n.message)?l("throw"+(e===W.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(){s=0,u={}},o.logInternalMessage=function(e,n){var t,r;s>=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,u[t]?r=!1:u[t]=!0,r&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),s++,l(e===W.CRITICAL?"error":"warn",n)),s===o.maxInternalMessageLimit()&&(r=new se(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),e===W.CRITICAL?o.errorToConsole(t):o.warnToConsole(t))))}})},ce=(s.ParentContextKey="parent",s.ChildrenContextKey="childEvts",s);function s(e,i,n){var r,o=this,l=!1;o.start=X(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},g(i)&&(l=function(e){if(V)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&g(i)&&(r=i(),i=null),r}};return V(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===s.ParentContextKey||e===s.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===s.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===s.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(s.ChildrenContextKey);if("[object Array]"===B(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&&g(i)&&(o.payload=i())}}var fe="CoreUtils.doPerf";function ge(e,n,t,r,i){if(e)if(e=g(e.getPerfMgr)?e.getPerfMgr():e){var o,l=void 0,s=e.getCtx(fe);try{if(l=e.create(n(),r,i))return s&&l.setCtx&&(l.setCtx(ce.ParentContextKey,s),s.getCtx&&s.setCtx&&((o=s.getCtx(ce.ChildrenContextKey))||(o=[],s.setCtx(ce.ChildrenContextKey,o)),o.push(l))),e.setCtx(fe,l),t(l)}catch(u){l&&l.setCtx&&l.setCtx("exception",u)}finally{l&&e.fire(l),e.setCtx(fe,s)}}return t()}var de=function(i,n){var o=this,l=null,s=g(i.processTelemetry),u=g(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";ge(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&s){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(W.CRITICAL,J,"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 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&&g(o.processTelemetry)&&(o=new de(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var pe,ye=function Le(e,i,t,n){var r,o,l,s,u=this,a=null;null!==n&&(e&&g(e.getPlugin)?a=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,u,n||e.getPlugin()):n?(r=u,l=e,s=!1,(o=n)&&e&&(l=[],Q(e,function(e){!s&&e!==o||(s=!0,l.push(e))})),o&&!s&&(l=l||[]).push(o),a=ve(l,r)):$(n)&&(a=ve(e,u))),u.core=function(){return t},u.diagLog=function(){return(t||{}).logger||new ae(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){void 0===t&&(t=!1);var r,e=u.getExtCfg(e,null);return e&&!f(e[n])?r=e[n]:i&&!f(i[n])&&(r=i[n]),f(r)?t:r},u.hasNext=function(){return null!=a},u.getNext=function(){return a},u.setNext=function(e){a=e},u.processNext=function(e){var n=a;n&&(a=n.getNext(),n.processTelemetry(e,u))},u.createNew=function(e,n){return new Le((e=void 0===e?null:e)||a,i,t,n)}},Ce="getPlugin",e=(he.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},he);function he(){var s=this,u=!1,a=null,c=null;s.core=null,s.diagLog=function(e){return s._getTelCtx(e).diagLog()},s.isInitialized=function(){return u},s.setInitialized=function(e){u=e},s.setNextPlugin=function(e){c=e},s.processNext=function(e,n){n?n.processNext(e):c&&g(c.processTelemetry)&&c.processTelemetry(e,null)},s._getTelCtx=function(e){var n,e=e=void 0===e?null:e;return e||(n=a||new ye(null,{},s.core),e=c&&c[Ce]?n.createNew(null,c[Ce]):n.createNew(null,c)),e},s._baseTelInit=function(e,n,t,r){e&&(l="extensionConfig",o=i=[],!e||(o=e[l])!==i&&f(o)&&(e[l]=o=i)),!r&&n&&(r=n.getProcessTelContext().getNext());var i,o,l=c;c&&c[Ce]&&(l=c[Ce]()),s.core=n,a=new ye(r,e,n,l),u=!0}}pe={Verbose:0,0:"Verbose",Information:1,1:"Information",Warning:2,2:"Warning",Error:3,3:"Error",Critical:4,4:"Critical"},be.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),t=(t&&e.extensionConfig&&e.extensionConfig[t]&&!f(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],f(t)?r:t};var xe,me,Ie=be;function be(){}function we(e){var f,r,n=xe.call(this)||this,i=(n.identifier="AppInsightsReactNativePlugin",n.priority=140,{}),g=e||d();function d(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return G(we,n,function(a,c){a.initialize=function(e,n,t){var r,i;if(!a.isInitialized()){c.initialize(e,n,t);var o=e||{},l=d(),s=function(e,n){g[e]=Ie.getConfig(o,e,a.identifier,$(g[e])?n:g[e])};if("object"===h)for(var u in l)i=u,(r=l)&&x.call(r,i)&&s(u,l[u]);g.disableDeviceCollection||a._collectDeviceInfo(),t&&Q(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(f=e)}),g.disableExceptionCollection||a._setExceptionHandler()}},a.processTelemetry=function(e,n){var t=e;i&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof i.id&&(t.ext.device.localId=i.id),"string"==typeof i.model&&(t.ext.device.model=i.model),"string"==typeof i.deviceClass&&(t.ext.device.deviceClass=i.deviceClass)),a.processNext(e,n)},a.setDeviceId=function(e){i.id=e},a.setDeviceModel=function(e){i.model=e},a.setDeviceType=function(e){i.deviceClass=e},a._collectDeviceInfo=function(){try{i.deviceClass=l["default"].getDeviceType(),i.id=l["default"].getUniqueId(),i.model=l["default"].getModel()}catch(n){a.diagLog().warnToConsole("Failed to get DeviceInfo: "+("[object Error]"===B(e=n)?e.name:"")+" - "+re(n))}var e},a._setExceptionHandler=function(){var e=typeof global!==o&&global?global:m();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:pe.Error};f?f.trackException(t):a.diagLog().throwInternal(W.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},a._config=g,a._getDbgPlgTargets=function(){return[i]}}),n}function Te(){this.constructor=me}me=we,typeof(e=xe=e)!==i&&null!==e&&I("Class extends value "+e+" is not a constructor or null"),b(me,e),me[u]=(Te[u]=e[u],new Te),t.ReactNativePlugin=we,Object.defineProperty(t,"__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