@microsoft/applicationinsights-react-native 2.4.2 → 2.4.3-nightly.2201-02

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,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Native Plugin, 2.4.2
2
+ * Application Insights JavaScript SDK - React Native Plugin, 2.4.3-nightly.2201-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
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);