@microsoft/applicationinsights-react-native 2.4.5-nightly.2203-01 → 2.5.0-beta.2203-01

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