@microsoft/applicationinsights-react-js 3.2.3 → 3.2.4-nightly.2201-03
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.
- package/browser/applicationinsights-react-js.js +1 -1
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +1 -1
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.d.ts +1 -1
- package/dist/applicationinsights-react-js.js +1 -1
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +1 -1
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +1 -1
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +1 -1
- package/package.json +74 -71
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 3.2.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 3.2.4-nightly.2201-03
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
var t=this,e=function(t,a){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function r(o){if(o&&o.__esModule)return o;var t,a=(t=Object.create)?t(null):{};return o&&Object.keys(o).forEach(function(t){if("default"!==t){var e=(e=Object.getOwnPropertyDescriptor)?e(o,t):undefined,n=a,r=t,e=e.get?e:{enumerable:!0,get:function(){return o[t]}},i=Object.defineProperty;if(i)try{return void i(n,r,e)}catch(o){}e&&typeof e.value!==undefined&&(n[r]=e.value)}var e}),a["default"]=o,a}var l=r(a),i=n(a),s="function",T="object",o="undefined",f="prototype",d="hasOwnProperty",C=Object,x=C[f],I=C.assign,A=C.create,w=C.defineProperty,S=x[d],_=null;function b(t){return void 0===t&&(t=!0),_&&t||(typeof globalThis!==o&&globalThis&&(_=globalThis),typeof self!==o&&self&&(_=self),typeof window!==o&&window&&(_=window),typeof global!==o&&global&&(_=global)),_}function E(t){throw new TypeError(t)}function k(t){if(A)return A(t);if(null==t)return{};var e=typeof t;function n(){}return e!==T&&e!==s&&E("Object prototype may only be an Object:"+t),n[f]=t,new n}(b()||{}).Symbol,(b()||{}).Reflect;var P=I||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])x[d].call(e,i)&&(t[i]=e[i]);return t},M=function(t,e){return(M=C.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e[d](n)&&(t[n]=e[n])})(t,e)};function L(t,e){function n(){this.constructor=t}typeof e!==s&&null!==e&&E("Class extends value "+e+" is not a constructor or null"),M(t,e),t[f]=null===e?k(e):(n[f]=e[f],new n)}var N="constructor",F="prototype",R="function",O="_dynInstFuncs",j="_isDynProxy",D="_dynClass",U="_dynInstChk",B=U,V="_dfOpts",z="_unknown_",K="__proto__",W="useBaseInst",G="setInstFuncs",H=Object,q=H.getPrototypeOf,J=0;function X(t,e){return t&&H[F].hasOwnProperty.call(t,e)}function Z(t){return t&&(t===H[F]||t===Array[F])}function $(t){return Z(t)||t===Function[F]}function Q(t){if(t){if(q)return q(t);t=t[K]||t[F]||(t[N]?t[N][F]:null);if(t)return t}return null}function Y(t,e){var n=[],r=H.getOwnPropertyNames;if(r)n=r(t);else for(var i in t)"string"==typeof i&&X(t,i)&&n.push(i);if(n&&0<n.length)for(var o=0;o<n.length;o++)e(n[o])}function tt(t,e,n){return e!==N&&typeof t[e]===R&&(n||X(t,e))}function et(t){throw new TypeError("DynamicProto: "+t)}function nt(t,e){for(var n=t.length-1;0<=n;n--)if(t[n]===e)return 1}function rt(t,e){return X(t,F)?t.name||e||z:((t||{})[N]||{}).name||e||z}function it(t,r,e,n){X(t,F)||et("theClass is an invalid class definition.");var c,i,o,a,f,d,l=t[F],s=(function(t){if(q)for(var e=[],n=Q(r);n&&!$(n)&&!nt(e,n);){if(n===t)return 1;e.push(n),n=Q(n)}}(l)||et("["+rt(t)+"] is not in class hierarchy of ["+rt(r)+"]"),null),t=(X(l,D)?s=l[D]:(s="_dynCls$"+rt(t,"_")+"$"+J,J++,l[D]=s),it[V]),u=!!t[W],p=(u&&n&&n[W]!==undefined&&(u=!!n[W]),i={},Y(c=r,function(t){!i[t]&&tt(c,t,!1)&&(i[t]=c[t])}),i),u=(e(r,function(t,e,n,o){function r(t,e,n){var r,i=e[n];return i[j]&&o&&!1!==(r=t[O]||{})[B]&&(i=(r[e[D]]||{})[n]||i),function(){return i.apply(t,arguments)}}for(var i={},a=(Y(n,function(t){i[t]=r(e,n,t)}),Q(t)),l=[];a&&!$(a)&&!nt(l,a);)Y(a,function(t){!i[t]&&tt(a,t,!q)&&(i[t]=r(e,a,t))}),l.push(a),a=Q(a);return i}(l,r,p,u)),!!q&&!!t[G]);o=l,e=s,a=r,f=p,t=!1!==(u=u&&n?!!n[G]:u),Z(o)||(l=a[O]=a[O]||{},d=l[e]=l[e]||{},!1!==l[B]&&(l[B]=!!t),Y(a,function(t){var n,r,i;tt(a,t,!1)&&a[t]!==f[t]&&(d[t]=a[t],delete a[t],X(o,t)&&(!o[t]||o[t][j])||(o[t]=(n=o,r=t,(i=function(){var t,e;return(function(t,e,n,c){var r=null;if(t&&X(n,D)){var i=t[O]||{};if((r=(i[n[D]]||{})[e])||et("Missing ["+e+"] "+R),!r[U]&&!1!==i[B]){for(var o=!X(t,e),a=Q(t),l=[];o&&a&&!$(a)&&!nt(l,a);){var s=a[e];if(s){o=s===c;break}l.push(a),a=Q(a)}try{o&&(t[e]=r),r[U]=1}catch(u){i[B]=!1}}}return r}(this,r,n,i)||(typeof(e=(e=n[t=r])===i?Q(n)[t]:e)!==R&&et("["+t+"] is not a "+R),e)).apply(this,arguments)})[j]=1,i)))}))}it[V]={setInstFuncs:!0,useBaseInst:!0},(I=u=u||{})[I.CRITICAL=1]="CRITICAL",I[I.WARNING=2]="WARNING";var u,ot={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},at="attachEvent",lt="addEventListener",st="toISOString",ut=w;function ct(t){return x.toString.call(t)}function p(t){return t===undefined||typeof t===o}function g(t){return null===t||p(t)}function ft(t){return!g(t)}function c(t){return typeof t===s}function dt(t,e,n,r){void 0===r&&(r=!1);var i=!1;if(!g(t))try{g(t[lt])?g(t[at])||(t[at]("on"+e,n),i=!0):(t[lt](e,n,r),i=!0)}catch(o){}return i}function m(t,e){return!(!t||!e||!~t.indexOf(e))}function pt(t){return"[object Date]"===ct(t)}function gt(t){return"[object Array]"===ct(t)}function mt(t){return"[object Error]"===ct(t)}function vt(t){return"string"==typeof t}function ht(t){return"boolean"==typeof t}function yt(t,e,n){var r=t.length;try{for(var i=0;i<r&&!(i in t&&-1===e.call(n||t,t[i],i,t));i++);}catch(o){}}function Tt(t,e,n){var r=t.length,n=n||0;try{for(var i=Math.max(0<=n?n:r-Math.abs(n),0);i<r;i++)if(i in t&&t[i]===e)return i}catch(o){}return-1}function Ct(t){return"string"!=typeof t?t:t.replace(/^\s+|\s+$/g,"")}var xt=!{toString:null}.propertyIsEnumerable("toString"),It=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function At(t,e,n,r){if(ut)try{var i={enumerable:!0,configurable:!0};return n&&(i.get=n),r&&(i.set=r),ut(t,e,i),!0}catch(o){}return!1}function v(){var t=Date;return t.now?t.now():(new t).getTime()}function wt(t,e,n,r,i){var o=n;return t&&((o=t[e])===n||i&&!i(o)||r&&!r(n)||(t[e]=o=n)),o}function St(t){return!!t}var _t="window",bt="navigator",Et="location",kt="JSON",Pt="crypto",Mt="msCrypto",Lt="msie",Nt="trident/",Ft=null,Rt=null;function h(t){var e=b();return e&&e[t]?e[t]:t===_t&&Ot()?window:null}function Ot(){return typeof window===T&&window}function jt(){return typeof document===T&&document?document:h("document")}function Dt(){return typeof navigator===T&&navigator?navigator:h(bt)}function Ut(){return typeof JSON===T&&JSON||null!==h(kt)}function Bt(){return Ut()?JSON||h(kt):null}function Vt(){var t=Dt();return!t||t.userAgent===Rt&&null!==Ft||(t=((Rt=t.userAgent)||"").toLowerCase(),Ft=m(t,Lt)||m(t,Nt)),Ft}function zt(t){var e=Object[f].toString.call(t),n="";return"[object Error]"===e?n="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":Ut()&&(n=Bt().stringify(t)),e+n}var Kt=null;function Wt(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function Gt(t,e){var n,r=typeof console!==o?console:h("console");r&&(n="log",c(r[n=r[t]?t:n])&&r[n](e))}qt.dataType="MessageData";var Ht=qt;function qt(t,e,n,r){void 0===n&&(n=!1),this.messageId=t,this.message=(n?"AI: ":"AI (Internal): ")+t;n="",Ut()&&(n=Bt().stringify(r)),t=(e?" message:"+Wt(e):"")+(r?" props:"+Wt(n):"");this.message+=t}var Jt=function He(i){this.identifier="DiagnosticLogger",this.queue=[];var l=0,s={};it(He,this,function(o){function t(t,e){t=i[t];return g(t)?e:t}function a(t,e){var n,r=(n=(n=Kt)||!0===i.disableDbgExt?n:Kt||(r=h("Microsoft"),Kt=r?r.ApplicationInsights:Kt))?n.ChromeDbgExt:null;r&&r.diagLog&&r.diagLog(t,e)}g(i)&&(i={}),o.consoleLoggingLevel=function(){return t("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return t("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return t("maxMessageLimit",25)},o.enableDebugExceptions=function(){return t("enableDebugExceptions",!1)},o.throwInternal=function(t,e,n,r,i){e=new Ht(e,n,i=void 0!==i&&i,r);if(o.enableDebugExceptions())throw e;n=t===u.CRITICAL?"errorToConsole":"warnToConsole";p(e.message)?a("throw"+(t===u.CRITICAL?"Critical":"Warning"),e):(r=o.consoleLoggingLevel(),i?(i=+e.messageId,!s[i]&&t<=r&&(o[n](e.message),s[i]=!0)):t<=r&&o[n](e.message),o.logInternalMessage(t,e))},o.warnToConsole=function(t){Gt("warn",t),a("warning",t)},o.errorToConsole=function(t){Gt("error",t),a("error",t)},o.resetInternalMessageCount=function(){l=0,s={}},o.logInternalMessage=function(t,e){var n,r;l>=o.maxInternalMessageLimit()||(r=!0,n="AITR_"+e.messageId,s[n]?r=!1:s[n]=!0,r&&(t<=o.telemetryLoggingLevel()&&(o.queue.push(e),l++,a(t===u.CRITICAL?"error":"warn",e)),l===o.maxInternalMessageLimit()&&(r=new Ht(ot.MessageLimitPerPVExceeded,n="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),t===u.CRITICAL?o.errorToConsole(n):o.warnToConsole(n))))}})},Xt=(Zt.ParentContextKey="parent",Zt.ChildrenContextKey="childEvts",Zt);function Zt(t,i,e){var n,o=this,a=!1;o.start=v(),o.name=t,o.isAsync=e,o.isChildEvt=function(){return!1},c(i)&&(a=At(o,"payload",function(){return!n&&c(i)&&(n=i(),i=null),n})),o.getCtx=function(t){return t?(t===Zt.ParentContextKey||t===Zt.ChildrenContextKey?o:o.ctx||{})[t]:null},o.setCtx=function(t,e){t&&(t===Zt.ParentContextKey?(o[t]||(o.isChildEvt=function(){return!0}),o[t]=e):t===Zt.ChildrenContextKey?o[t]=e:(o.ctx=o.ctx||{})[t]=e)},o.complete=function(){var t=0,e=o.getCtx(Zt.ChildrenContextKey);if(gt(e))for(var n=0;n<e.length;n++){var r=e[n];r&&(t+=r.time)}o.time=v()-o.start,o.exTime=o.time-t,o.complete=function(){},!a&&c(i)&&(o.payload=i())}}var $t="CoreUtils.doPerf";function Qt(t,e,n,r,i){if(t)if(t=c(t.getPerfMgr)?t.getPerfMgr():t){var o,a=void 0,l=t.getCtx($t);try{if(a=t.create(e(),r,i))return l&&a.setCtx&&(a.setCtx(Xt.ParentContextKey,l),l.getCtx&&l.setCtx&&((o=l.getCtx(Xt.ChildrenContextKey))||(o=[],l.setCtx(Xt.ChildrenContextKey,o)),o.push(a))),t.setCtx($t,a),n(a)}catch(s){a&&a.setCtx&&a.setCtx("exception",s)}finally{a&&t.fire(a),t.setCtx($t,l)}}return n()}var Yt=function(i,e){var o=this,a=null,l=c(i.processTelemetry),s=c(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return a},o.setNext=function(t){a=t},o.processTelemetry=function(n,r){r=r||e;var t=i?i.identifier:"TelemetryPluginChain";Qt(r?r.core():null,function(){return t+":processTelemetry"},function(){if(i&&l){o._hasRun=!0;try{r.setNext(a),s&&i.setNextPlugin(a),a&&(a._hasRun=!1),i.processTelemetry(n,r)}catch(e){var t=a&&a._hasRun;a&&t||r.diagLog().throwInternal(u.CRITICAL,ot.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+zt(e)),a&&!t&&a.processTelemetry(n,r)}}else a&&(o._hasRun=!0,a.processTelemetry(n,r))},function(){return{item:n}},!n.sync)}};function te(t,e){var n=[];if(t&&0<t.length)for(var r=null,i=0;i<t.length;i++){var o=t[i];o&&c(o.processTelemetry)&&(o=new Yt(o,e),n.push(o),r&&r.setNext(o),r=o)}return 0<n.length?n[0]:null}var ee=function qe(t,i,n,e){var r,o,a,l,s=this,u=null;null!==e&&(t&&c(t.getPlugin)?u=function(t,e,n){var r=[],i=!n;if(t)for(;t;){var o=t.getPlugin();!i&&o!==n||(i=!0,r.push(o)),t=t.getNext()}return i||r.push(n),te(r,e)}(t,s,e||t.getPlugin()):e?(r=s,a=t,l=!1,(o=e)&&t&&(a=[],yt(t,function(t){!l&&t!==o||(l=!0,a.push(t))})),o&&!l&&(a=a||[]).push(o),u=te(a,r)):p(e)&&(u=te(t,s))),s.core=function(){return n},s.diagLog=function(){return(n||{}).logger||new Jt(i)},s.getCfg=function(){return i},s.getExtCfg=function(t,e){var n,r;return void 0===e&&(e={}),!i||(r=i.extensionConfig)&&t&&(n=r[t]),n||e},s.getConfig=function(t,e,n){void 0===n&&(n=!1);var r,t=s.getExtCfg(t,null);return t&&!g(t[e])?r=t[e]:i&&!g(i[e])&&(r=i[e]),g(r)?n:r},s.hasNext=function(){return null!=u},s.getNext=function(){return u},s.setNext=function(t){u=t},s.processNext=function(t){var e=u;e&&(u=e.getNext(),e.processTelemetry(t,s))},s.createNew=function(t,e){return new qe((t=void 0===t?null:t)||u,i,n,e)}},ne="getPlugin";function re(){var o=this,a=!1,l=null,s=null;o.core=null,o.diagLog=function(t){return o._getTelCtx(t).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(t){a=t},o.setNextPlugin=function(t){s=t},o.processNext=function(t,e){e?e.processNext(t):s&&c(s.processTelemetry)&&s.processTelemetry(t,null)},o._getTelCtx=function(t){var e,t=t=void 0===t?null:t;return t||(e=l||new ee(null,{},o.core),t=s&&s[ne]?e.createNew(null,s[ne]):e.createNew(null,s)),t},o._baseTelInit=function(t,e,n,r){t&&wt(t,"extensionConfig",[],null,g),!r&&e&&(r=e.getProcessTelContext().getNext());var i=s;s&&s[ne]&&(i=s[ne]()),o.core=e,l=new ee(r,t,e,i),a=!0}}re.prototype.initialize=function(t,e,n,r){this._baseTelInit(t,e,n,r)};var ie="toGMTString",oe="toUTCString",ae="cookie",le="expires",se="enabled",ue="isCookieUseDisabled",ce="disableCookiesUsage",fe="_ckMgr",y="",de=null,pe=null,ge=null,me=jt(),ve={},he={};function ye(t,e){var n=Ce[fe]||he[fe];return n||(n=Ce[fe]=Ce(t,e),he[fe]=n),n}function Te(t){return!t||t.isEnabled()}function Ce(t,i){wt(n=(t=t||he).cookieCfg=t.cookieCfg||{},"domain",t.cookieDomain,ft,g),wt(n,"path",t.cookiePath||"/",null,g),g(n[se])&&(e=void 0,p(t[ue])||(e=!t[ue]),p(t[ce])||(e=!t[ce]),n[se]=e);var e,n,u=n,c=u.path||"/",f=u.domain,r=!1!==u[se],d={isEnabled:function(){var t=r&&xe(i),e=he[fe];return t&&e&&d!==e?Te(e):t},setEnabled:function(t){r=!1!==t},set:function(t,e,n,r,i){var o,a,l,s=!1;return Te(d)&&(o={},-1!=(l=(a=Ct(e||y)).indexOf(";"))&&(a=Ct(e.substring(0,l)),o=Ie(e.substring(1+l))),wt(o,"domain",r||f,St,p),g(n)||(l=Vt(),!p(o[le])||0<(e=v()+1e3*n)&&((r=new Date).setTime(e),wt(o,le,Ae(r,l?ie:oe)||Ae(r,l?ie:oe)||y,St)),l||wt(o,"max-age",y+n,null,p)),(e=typeof location===T&&location?location:h(Et))&&"https:"===e.protocol&&(wt(o,"secure",null,null,p),(pe=null===pe?!(vt(r=(Dt()||{}).userAgent)&&(m(r,"CPU iPhone OS 12")||m(r,"iPad; CPU OS 12")||m(r,"Macintosh; Intel Mac OS X 10_14")&&m(r,"Version/")&&m(r,"Safari")||m(r,"Macintosh; Intel Mac OS X 10_14")&&function(t,e){if(t){var n=t.length;if(t===e)return 1;if(40<=n){for(var r=n-1,i=39;0<=i;i--){if(t[r]!=e[i])return;r--}return 1}}}(r,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||m(r,"Chrome/5")||m(r,"Chrome/6")||m(r,"UnrealEngine")&&!m(r,"Chrome")||m(r,"UCBrowser/12")||m(r,"UCBrowser/11"))):pe)&&wt(o,"SameSite","None",null,p)),wt(o,"path",i||c,null,p),(u.setCookie||Se)(t,we(a,o)),s=!0),s},get:function(t){var e=y;return Te(d)?(u.getCookie||function(t){var e,n=y;return me&&(e=me[ae]||y,ge!==e&&(ve=Ie(e),ge=e),n=Ct(ve[t]||y)),n})(t):e},del:function(t,e){return!!Te(d)&&d.purge(t,e)},purge:function(t,e){var n,r=!1;return xe(i)&&((n={}).path=e||"/",n[le]="Thu, 01 Jan 1970 00:00:01 GMT",e=n,Vt()||(e["max-age"]="0"),(u.delCookie||Se)(t,we(y,e)),r=!0),r}};return d[fe]=d}function xe(t){if(null===de){de=!1;try{de=(me||{})[ae]!==undefined}catch(n){t&&t.throwInternal(u.WARNING,ot.CannotAccessCookie,"Cannot access document.cookie - "+(mt(e=n)?e.name:""),{exception:zt(n)})}}var e;return de}function Ie(t){var n={};return t&&t.length&&yt(Ct(t).split(";"),function(t){var e;(t=Ct(t||y))&&(-1==(e=t.indexOf("="))?n[t]=null:n[Ct(t.substring(0,e))]=Ct(t.substring(1+e)))}),n}function Ae(t,e){return c(t[e])?t[e]():null}function we(t,e){var n,r=t||y,i=e;if(i)for(var o in i)S.call(i,o)&&(n=o,o=i[o],r+="; "+n+(g(o)?y:"="+o));return r}function Se(t,e){me&&(me[ae]=t+"="+e)}var _e=4294967296,be=4294967295,Ee=!1,ke=123456789,Pe=987654321;function Me(t){t<0&&(t>>>=0),ke=123456789+t&be,Pe=987654321-t&be,Ee=!0}function Le(){try{var t=2147483647&v();Me((Math.random()*_e^t)+t)}catch(e){}}function Ne(t){return 0<t?Math.floor(Fe()/be*(t+1))>>>0:0}function Fe(t){var e=h(Pt)||h(Mt),e=e&&e.getRandomValues?e.getRandomValues(new Uint32Array(1))[0]&be:Vt()?(Ee||Le(),Re()&be):Math.floor(_e*Math.random()|0);return t||(e>>>=0),e}function Re(t){var e=((Pe=36969*(65535&Pe)+(Pe>>16)&be)<<16)+(65535&(ke=18e3*(65535&ke)+(ke>>16)&be))>>>0&be|0;return t||(e>>>=0),e}var Oe,je,De=null,Ue={_canUseCookies:undefined,isTypeof:function(t,e){return typeof t===e},isUndefined:p,isNullOrUndefined:g,hasOwnProperty:function(t,e){return t&&S.call(t,e)},isFunction:c,isObject:function(t){return typeof t===T},isDate:pt,isArray:gt,isError:mt,isString:vt,isNumber:function(t){return"number"==typeof t},isBoolean:ht,toISOString:function(t){var e;if(t)return t[st]?t[st]():pt(t)?(e=function(t){t=""+t;return 1===t.length?"0"+t:t},t.getUTCFullYear()+"-"+e(1+t.getUTCMonth())+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+(""+(t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"):void 0},arrForEach:yt,arrIndexOf:Tt,arrMap:function(t,e,n){var r=t.length,i=n||t,o=Array(r);try{for(var a=0;a<r;a++)a in t&&(o[a]=e.call(i,t[a],t))}catch(l){}return o},arrReduce:function(t,e,n){var r,i=t.length,o=0;if(3<=arguments.length)r=n;else{for(;o<i&&!(o in t);)o++;r=t[o++]}for(;o<i;)o in t&&(r=e(r,t[o],o,t)),o++;return r},strTrim:Ct,objCreate:k,objKeys:function(t){var e,n=typeof t,r=(n===s||n===T&&null!==t||E("objKeys called on non-object"),[]);for(e in t)t&&S.call(t,e)&&r.push(e);if(xt)for(var i=It.length,o=0;o<i;o++)t&&S.call(t,It[o])&&r.push(It[o]);return r},objDefineAccessors:At,addEventHandler:function(t,e){var n=!1,r=Ot()?window:h(_t),r=(r&&(n=dt(r,t,e),n=dt(r.body,t,e)||n),jt());return r&&dt(r,t,e)||n},dateNow:v,isIE:Vt,disableCookies:function(){var t=ye(void 0,void 0),e=Ue._canUseCookies;null===De&&(De=[],Oe=e,At(Ue,"_canUseCookies",function(){return Oe},function(e){Oe=e,yt(De,function(t){t.setEnabled(e)})})),-1===Tt(De,t)&&De.push(t),ht(e)&&t.setEnabled(e),ht(Oe)&&t.setEnabled(Oe),t.setEnabled(!1)},newGuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Be,function(t){var e=0|Ne(15);return("x"===t?e:3&e|8).toString(16)})},perfNow:function(){var t=h("performance");return t&&t.now?t.now():v()},newId:function(t){void 0===t&&(t=22);for(var e=Fe()>>>0,n=0,r="";r.length<t;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&e]||"",e>>>=6,5==++n&&(e=(Fe()<<2&4294967295|3&e)>>>0,n=0);return r},randomValue:Ne,random32:Fe,mwcRandomSeed:function(t){t?Me(t):Le()},mwcRandom32:Re,generateW3CId:function(){for(var t,e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=e[15&(t=Fe())]+e[t>>4&15]+e[t>>8&15]+e[t>>12&15]+e[t>>16&15]+e[t>>20&15]+e[t>>24&15]+e[t>>28&15];var i=e[8+(3&Fe())|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)}},Be=/[xy]/g;function e(){var t=null!==je&&je.apply(this,arguments)||this;return t.priority=185,t.identifier="ReactPlugin",t}L(e,je=re),e.prototype.initialize=function(t,e,n,r){var i=this;je.prototype.initialize.call(this,t,e,n,r),this._extensionConfig=t.extensionConfig&&t.extensionConfig[this.identifier]?t.extensionConfig[this.identifier]:{history:null},yt(n,function(t){"ApplicationInsightsAnalytics"===t.identifier&&(i._analyticsPlugin=t)}),this._extensionConfig.history&&(this.addHistoryListener(this._extensionConfig.history),e={uri:this._extensionConfig.history.location.pathname},this.trackPageView(e))},e.prototype.getCookieMgr=function(){return(e=(t=this.core)?t.getCookieMgr():e)||ye(void 0,(t||{}).logger);var t,e},e.prototype.getAppInsights=function(){return this._analyticsPlugin},e.prototype.processTelemetry=function(t,e){this.processNext(t,e)},e.prototype.trackMetric=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackMetric(t,e):this.diagLog().throwInternal(u.CRITICAL,ot.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},e.prototype.trackPageView=function(t){this._analyticsPlugin?this._analyticsPlugin.trackPageView(t):this.diagLog().throwInternal(u.CRITICAL,ot.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},e.prototype.trackEvent=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackEvent(t,e):this.diagLog().throwInternal(u.CRITICAL,ot.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},e.prototype.trackException=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackException(t,e):this.diagLog().throwInternal(u.CRITICAL,ot.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},e.prototype.trackTrace=function(t,e){this._analyticsPlugin?this._analyticsPlugin.trackTrace(t,e):this.diagLog().throwInternal(u.CRITICAL,ot.TelemetryInitializerFailed,"Analytics plugin is not available, React plugin telemetry will not be sent: ")},e.prototype.addHistoryListener=function(t){var n=this;t.listen(function(t){var e="location"in t?t.location:t;setTimeout(function(){var t={uri:e.pathname};n.trackPageView(t)},500)})};var Ve,ze,I=e;function Ke(){var t=null!==Ve&&Ve.apply(this,arguments)||this;return t.state={hasError:!1},t}ze=3,L(Ke,Ve=i["default"].Component),Ke.prototype.componentDidCatch=function(t,e){this.setState({hasError:!0}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:ze,properties:e})},Ke.prototype.render=function(){var t;return this.state.hasError?(t=this.props.onError,i["default"].createElement(t)):this.props.children};var w=Ke,We=a.createContext(undefined),w=(t.AppInsightsContext=We,t.AppInsightsErrorBoundary=w,t.ReactPlugin=I,t.useAppInsightsContext=function(){return a.useContext(We)},t.useTrackEvent=function(t,e,n,r){void 0===r&&(r=!0);var n=a.useState(n),i=n[0],n=n[1],o=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:e},i)},[t,i,e]),n},t.useTrackMetric=function(n,r){var i=a.useRef({hookTimestamp:v(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef();return t.current=function(){var t=i.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&v()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=v(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t=i.current;if(0===t.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==t.firstActiveTimestamp&&(t=t,t=(v()-t.firstActiveTimestamp-t.totalIdleTime-t.idleCount*t.idleTimeout)/1e3,n.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},{"Component Name":r}))}},[]),function(){var t,e=i.current;0===e.firstActiveTimestamp?(e.firstActiveTimestamp=v(),e.lastActiveTimestamp=e.firstActiveTimestamp):e.lastActiveTimestamp=v(),0<e.idleStartTimestamp&&(t=e.lastActiveTimestamp-e.idleStartTimestamp,e.totalIdleTime+=t,e.idleStartTimestamp=0)}},t.withAITracking=function(n,t,r,e){return r!==undefined&&null!==r&&"string"==typeof r||(r=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),e!==undefined&&null!==e&&"string"==typeof e||(e=""),L(i,o=l.Component),i.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=Ue.dateNow(),this._firstActiveTimestamp=0,this._totalIdleTime=0,this._lastActiveTimestamp=0,this._idleStartTimestamp=0,this._idleCount=0,this._intervalId=setInterval(function(){0<t._lastActiveTimestamp&&0===t._idleStartTimestamp&&Ue.dateNow()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=Ue.dateNow(),t._idleCount++)},100)},i.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,e;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),e={"Component Name":r},n.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},e))},i.prototype.render=function(){return l.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:e},l.createElement(t,P({},this.props)))},i.prototype.getEngagementTimeSeconds=function(){return(Ue.dateNow()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},i;function i(){var n=null!==o&&o.apply(this,arguments)||this;return n._mountTimestamp=0,n._firstActiveTimestamp=0,n._idleStartTimestamp=0,n._lastActiveTimestamp=0,n._totalIdleTime=0,n._idleCount=0,n._idleTimeout=5e3,n.trackActivity=function(t){var e;0===n._firstActiveTimestamp?(n._firstActiveTimestamp=Ue.dateNow(),n._lastActiveTimestamp=n._firstActiveTimestamp):n._lastActiveTimestamp=Ue.dateNow(),0<n._idleStartTimestamp&&(e=n._lastActiveTimestamp-n._idleStartTimestamp,n._totalIdleTime+=e,n._idleStartTimestamp=0)},n}var o},t),I="__esModule",t={value:!0},Ge=Object.defineProperty;if(Ge)try{return void Ge(w,I,t)}catch(Je){}typeof t.value!==undefined&&(w[I]=t.value)};"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.React);
|