@microsoft/applicationinsights-react-js 19.4.2 → 19.4.3-nightly.2609-06
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-react-js.js +2 -2
- 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.api.json +1 -1
- package/dist/applicationinsights-react-js.d.ts +1 -1
- package/dist/applicationinsights-react-js.js +2 -2
- 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 +84 -81
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 19.4.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 19.4.3-nightly.2609-06
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
var t=this,n=function(t,p,a){"use strict";function D(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function $(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){var n;"default"!==t&&Object.defineProperty(r,t,(n=Object.getOwnPropertyDescriptor(e,t)).get?n:{enumerable:!0,get:function(){return e[t]}})}),r["default"]=e,r}var z=$(a),F=D(a),B="prototype",L=Object,U=L[B];function n(t,n){return t||n}function e(t,n){return null!==t&&t!==undefined?t[n]:undefined}var s=undefined,c=null,f="",V="function",W="object",i="prototype",o="__proto__",r="undefined",q="Symbol",u="length",l="call",G="toString",v="getOwnPropertyDescriptor",J="getOwnPropertyNames",H="getOwnPropertySymbols",m=n(Object),K=e(m,i),Q=n(String),d=e(Q,i),g=n(Math),y=n(Array),h=e(y,i),X=e(h,"slice"),Y=n(Number),_=(e(Y,i),n(Function)),_=(e(_,i),n(Date)),_=(e(_,i),n(RegExp)),_=(e(_,i),n(Boolean)),_=(e(_,i),n(Error)),Z=(e(_,i),"_polyfill"),tt="__nw21$polytype__";function T(t,n){try{return{v:t.apply(this,n)}}catch(e){return{e:e}}}function nt(n){return function(t){return typeof t===n}}function et(t){return typeof t===r||t===r}function rt(t){return t===c||et(t)}function b(t){return t===c||t===s}var w=nt("string"),A=nt(V);function it(t){return(t||!rt(t))&&t&&typeof t===W}var ot=e(y,"isArray");function ut(t){return!b(t)&&!A(t)&&at(t[u])&&0<=t[u]}var at=nt("number"),ct=function(t){return!(!t||"[object RegExp]"!==K[G].call(t))};function st(){}function ft(){return[]}function lt(){return!1}var I=n(Q),pt="[object Error]";function x(t,n){var e=f,r=K[G][l](t);r===pt&&(t={stack:I(t.stack),message:I(t.message),name:I(t.name)});try{e=((e=JSON.stringify(t,c,n?"number"==typeof n?n:4:s))?e.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):c)||I(t)}catch(i){e=" - "+x(i,n)}return r+": "+e}function k(t){throw new TypeError(t)}function vt(t){throw new RangeError(t)}function C(t){b(t)&&k("Cannot convert undefined or null to object")}function mt(t){w(t)||k("'"+x(t)+"' is not a string")}function E(t,n){return!!t&&K.hasOwnProperty[l](t,n)}var dt=n(e(m,v),st),gt=n(e(m,"hasOwn"),yt);function yt(t,n){return C(t),E(t,n)||!!dt(t,n)}function ht(t,n,e){if(t&&(it(t)||A(t)))for(var r in t)if(gt(t,r)&&-1===n[l](b(e)?t:e,r,t[r]))break}function P(t,n,e){if(t)for(var r=t[u]>>>0,i=0;i<r&&!(i in t&&-1===n[l](b(e)?t:e,t[i],i,t));i++);}_=S;function S(r,t,i){var o=t?t[r]:c;return function(t){var n,e=(t?t[r]:c)||o;if(e||i)return n=arguments,(e||i).apply(t,e?X[l](n,1):n);k('"'+I(r)+'" not defined for '+x(t))}}S("propertyIsEnumerable",c,function(n,e){var t,r=m.getOwnPropertyDescriptor;return(t=(t=!b(n)&&r?T(r,[n,e]).v||c:t)||b(n)?t:T(function(){for(var t in n)if(t==e)return{enumerable:E(n,t)}}).v)&&t.enumerable||!1}),K&&K.propertyIsEnumerable;var _t=n(e(m,v),st),Tt=(n(e(m,H),ft),{e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"}),bt=e(m,"defineProperty"),wt=e(m,"defineProperties");function At(t,n,e){return bt(t,n,(r=e,(i={})[Tt.c]=!0,i[Tt.e]=!0,r.l&&(i.get=function(){return r.l.v},(t=_t(r.l,"v"))&&t.set&&(i.set=function(t){r.l.v=t})),ht(r,function(t,n){i[Tt[t]]=n===s?i[Tt[t]]:n}),i));var r,i}function It(t,n,e){bt(t,n,{value:e,enumerable:!0,writable:!1})}function xt(t,e){var r=[];return ht(t,function(t,n){r.push(e(t,n))}),r}var kt=n(e(m,"isFrozen"),lt),Q=(n(e(m,"isSealed"),lt),e(m,"freeze"));function Ct(t){return t}var Et=e(m,"assign"),Pt=(e(m,"keys"),Q||Ct);n(e(m,"seal"),Ct),n(e(m,"getPrototypeOf"),function(t){return C(t),t[o]||c}),n(e(m,"entries"),function(t){return xt(t,function(t,n){return[t,n]})}),n(e(m,"values"),function(t){return xt(t,function(t,n){return n})}),n(e(m,"is"),function(t,n){return t!=t?n!=n:0===t&&0===n?1/t==1/n:t===n}),_n=Pt,St={},ht({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12},function(t,n){It(St,t,t),It(St,n,t)});var St,Ot,Nt=_n?_n(St):St,Mt="__tsUtils$gblCfg";function jt(){var t;return(t=(t=(t=typeof globalThis!==r?globalThis:t)||typeof self===r?t:self)||typeof window===r?t:window)||typeof global===r?t:global}var Rt=e(g,"min"),Dt=e(g,"max"),$t=_("slice",d),zt=_("substring",d);S("substr",d,function(t,n,e){return C(t),e<0?f:((n=n||0)<0&&(n=Dt(n+t[u],0)),et(e)?$t(t,n):$t(t,n,n+e))});var O,N=n(e(m,"create"),function(t,n){function e(){}var r=b(t)?{}:((r=typeof t)!==W&&r!=V&&k("Prototype must be an Object or function: "+x(t)),e[i]=t,T(function(){e[o]=t}),new e);return n&&T(wt,[r,n]),r});function Ft(){var t;Ot||(t=T(jt).v||{},Ot=t[Mt]=t[Mt]||{}),O=Ot}var Bt,Lt,Ut,Vt,Wt,qt,Gt=e(g,"random"),Jt=(Bt=function(){for(var t=(Date.now||function(){return(new Date).getTime()})().toString(36).slice(2);t.length<16;)t+=Gt().toString(36).slice(2);return t.substring(0,16)},Lt={},O||Ft(),Lt.b=O.lzy,bt(Lt,"v",{configurable:!0,get:function(){var t=Bt.apply(null,void 0);return O.lzy||bt(Lt,"v",{value:t}),Lt.b=O.lzy,t}}),Lt),Ht=0;function Kt(t){return bt({toJSON:function(){return t}},"v",{value:t})}function Qt(t){return O||Ft(),(Vt=Vt&&!1!==t&&!O.lzy?Vt:Kt(T(jt).v||c)).v}function Xt(t,n){n=Vt&&!1!==n?Vt.v:Qt(n);if(n&&n[t])return n[t];if("window"===t)try{return window}catch(e){}return c}function M(t,n){var e,r,i,o,u=Nt[t],a=(O||Ft(),(O.lzy?0:Wt)||(Wt=Kt(T(Xt,[q]).v)));return a.v?a.v[u||t]:n?s:(Ut=Ut||{},(u=Nt[t])?Ut[u]=Ut[u]||(e="_"+Ht+++"_"+Jt.v,r=q+"("+(a=q+"."+u)+")",o=N(null),c("description",I(a)),c(G,function(){return r+"$nw21sym"+e}),c("valueOf",function(){return o}),c("v",r),c("_uid",e),(i=o)&&(T(function(){i[Z]=!0,i[tt]="symbol"}),T(At,[i,Z,{v:!0,w:!1,e:!1}]),T(At,[i,tt,{v:"symbol",w:!1,e:!1}])),i):void 0);function c(t,n){At(o,t,{v:n,e:!1,w:!1})}}function Yt(t){return t&&A(t.next)}function Zt(t,n,e){if(t&&(Yt(t)||(t=t[(qt=qt||Kt(M(3))).v]?t[qt.v]():c),Yt(t))){var r=s,i=s;try{for(var o=0;!(i=t.next()).done&&-1!==n[l](b(e)?t:e,i.value,o,t);)o++}catch(u){r={e:u},t["throw"]&&(i=c,t["throw"](r))}finally{try{i&&!i.done&&t["return"]&&t["return"](i)}finally{if(r)throw r.e}}}}function tn(t,n){var e,r;return ut(t)&&(r=t.length,0<=(n=(n=n)<0?r+n:n)&&n<r&&(e=t[n])),e}_("concat",h),S("at",h,tn);var nn=_("indexOf",h),en=(_("lastIndexOf",h),_("map",h));function rn(t){return((t?t.slice:c)||X).apply(t,X[l](arguments,1))}function on(e,r,i){var o=-1;return P(e,function(t,n){if(r[l](b(i)?e:i,t,n,e))return o=n,-1}),o}function un(t,n,e){for(var r=-1,i=(t[u]>>>0)-1;0<=i;i--)if(i in t&&n[l](b(e)?t:e,t[i],i,t)){r=i;break}return r}S("includes",h,function(t,n,e){return-1!==nn(t,n,e)}),_("every",h),_("filter",h);var an=u,cn=function(t){return t[an]};S("fill",h,function(t,n,e,r){if(ut(t))for(var i=cn(t),o=r===s?i:r,r=(r=e===s?0:e)<0?Dt(i+r,0):Rt(r,i),o=o<0?Dt(i+o,0):Rt(o,i),u=r;u<o;u++)t[u]=n;return t}),S("find",h,function(t,n,e){n=on(t,n,e);return-1!==n?t[n]:void 0}),S("findIndex",h,on),S("findLast",h,function(t,n,e){n=un(t,n,e);return-1!==n?t[n]:void 0}),S("findLastIndex",h,un),S("flatMap",h,function(e,r,t){C(e),A(r)||k("callbackFn must be a function");var i=[],o=2<arguments.length?t:undefined;return P(e,function(t,n){t=function(t,n){return t.apply(n,X[l](arguments,2))}(r,o,t,n,e);ot(t)?P(t,function(t){i.push(t)}):i.push(t)}),i}),n(e(y,"from"),function(t,e,r){var n;if(ot(t))return n=rn(t),e?en(n,e,r):n;var i=[];return Zt(t,function(t,n){return i.push(e?e[l](r,t,n):t)}),i});var sn,fn=e(g,"floor"),ln=e(g,"ceil"),pn=n(e(g,"trunc"),function(t){t=+t;return(0<t?fn:ln)(t)});function vn(t,n){var e=+t;return!n||e!==Infinity&&e!=Infinity||vt("invalid value ["+x(t)+"]"),e!=e||0==e?0:pn(e)}function mn(t){e=!1,r={next:function(){var t={done:e=e||!n.n||n.n(arguments)};return e||At(t,"value",{g:o}),t}},(n=t).r&&(r["return"]=function(t){return{done:e=!0,value:n.r&&n.r(t)}}),n.t&&(r["throw"]=function(t){return{done:e=!0,value:n.t&&n.t(t)}});var n,e,r,i=r,t=M(3);function o(){return n.v}return i[t]=function(){return i},i}S("keys",h,function(t){C(t);var n=-1,e=vn(t.length);return e<0&&(e=0),mn({n:function(){var t=e<=++n;return t||(this.v=n),t}})}),_("reduce",h),_("reverse",h),_("some",h),S("with",h,function(t,n,e){ut(t)||vt("Invalid array");var r=cn(t);return((n=n<0?r+n:n)<0||r<=n)&&vt("Index out of bounds"),(r=rn(t))[n]=e,r}),n(e(m,"setPrototypeOf"),function(e,t){var n;return(sn=sn||Kt(((n={})[o]=[],n instanceof Array))).v?e[o]=t:ht(t,function(t,n){return e[t]=n}),e});var dn=_("replace",d);function gn(n){return function(t){return C(t),(t=I(t))&&dn(t,n,f)}}var yn,hn,_n=gn(/^\s+|(?=\s)\s+$/g),y=gn(/^\s+/g),h=gn(/(?=\s)\s+$/g),Tn=(S("trim",d,_n),S("trimStart",d,y),S("trimEnd",d,h),_("toUpperCase",d),_("toLowerCase",d),S("repeat",d,function(t,n){C(t),(n=vn(n,!0))<0&&vt("invalid count must be >= 0 && < Infinity");for(var e=w(t)?t:I(t),r=f;0<n;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r}));function bn(t,n,e){var r=f,t=(n=vn(n,!0),t[u]);return t<(n>>=0)&&(r=(n-=t)>(r=rt(e)?" ":I(e))[u]?Tn(r,ln(n/r[u])):r)[u]>n?zt(r,0,n):r}S("padStart",d,function(t,n,e){return bn(t,n,e)+t}),S("padEnd",d,function(t,n,e){return t+bn(t,n,e)});var wn=n(e(m,J),ft),An=n(e(m,v),st),In=(n(e(m,v),st),n(e(m,"getOwnPropertyDescriptors"),function(e){var r={};if(C(e),!yn)try{yn=!0,P(wn(e),function(t){var n=An(e,t);n!==undefined&&(r[t]=n)}),P(function(t){var n=[],e=m.hasOwn||yt;if(!hn)try{hn=!0;for(var r=0;r<=12;){var i=M(r);i&&e(t,i)&&n.push(i),r++}}finally{hn=!1}return n}(e),function(t){var n=An(e,t);n!==undefined&&(r[t]=n)})}finally{yn=!1}return r}),n(e(m,J),ft),n(e(m,H),ft),_("split",d),S("split",d,function(t,n,e){n=n?n[M(9)]:s;return n?n(t,e):[t]}),n(e(Y,"isInteger"),function(t){return at(t)&&!isNaN(t)&&isFinite(t)&&fn(t)===t}),e(g,"abs"),e(g,"exp"),e(g,"log"),e(g,"asin"),e(g,"acos"),e(g,"atan"),e(g,"atan2"),e(g,"pow"),e(g,"sqrt"),e(g,"round"),e(g,"sin"),e(g,"cos"),e(g,"tan"),n(e(m,"fromEntries"),function(t){var n,e={};function r(t){var n;ot(t)&&2<=t.length&&(t[0]===o?(n=t[1],Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0})):e[t[0]]=t[1])}return ot(t)?P(t,r):!b(n=t)&&A(n[M(3)])&&Zt(t,r),e}),n(e(m,"preventExtensions"),Ct),n(e(m,"isExtensible"),lt),_("indexOf",d));_("lastIndexOf",d),S("at",d,function(t,n){return C(t),tn(I(t),vn(n))}),S("endsWith",d,function(t,n,e){mt(t);n=w(n)?n:I(n),e=!et(e)&&e<t[u]?e:t[u];return zt(t,e-n[u],e)===n}),S("includes",d,function(t,n,e){return ct(n)&&k("'searchString' must not be a regular expression"+x(n)),-1!==In(t,I(n),e)}),S("matchAll",d,function(t,n){C(t);var o,u,e=M(4),e=ct(n)&&(!n||b(n[e])||!1!==n[e]),a=(e&&!n.global&&k("matcher must be a global regular expression"),I(t)),t=n&&n[M(5)];return A(t)?t.call(n,a):(o=e?((e=(t=n).flags)===undefined&&(e=f,t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y")),(e=RegExp(t.source,e)).lastIndex=Dt(0,t.lastIndex),e):RegExp(n,"g"),mn(u={n:function(){var t,n,e,r,i=o.exec(a);return!i||(i[0]===f&&(o.lastIndex=(t=a,r=(n=o.lastIndex)+1,o.unicode&&n<t.length&&55296<=(e=t.charCodeAt(n))&&e<=56319&&56320<=(e=t.charCodeAt(n+1))&&e<=57343&&r++,r)),u.v=i,!1)},v:undefined}))}),S("replaceAll",d,function(t,n,e){C(t);var r=M(4),i=M(6),o=ct(n),t=w(t)?t:I(t),u=n||!b(n);if(o=o&&u?!1!==n[r]:o)n.global||k("searchValue must be a global regular expression"),a=n;else{if(r=u?n[i]:null,A(r))return r.call(n,t,e);var o=w(n)?n:I(n),a=RegExp(dn(I(o),/[.*+?^${}()|[\]\\]/g,"\\$&")||"(?:)","g")}return dn(t,a,e)}),S("startsWith",d,function(t,n,e){mt(t);n=w(n)?n:I(n),e=0<e?e:0;return zt(t,e,e+n[u])===n}),(Qt()||{}).Symbol,(Qt()||{}).Reflect;var xn="hasOwnProperty",kn=Et||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])U[xn].call(n,i)&&(t[i]=n[i]);return t},Cn=function(t,n){return(Cn=L.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[xn](e)&&(t[e]=n[e])})(t,n)};function En(t,n){function e(){this.constructor=t}"function"!=typeof n&&null!==n&&k("Class extends value "+n+" is not a constructor or null"),Cn(t,n),t[B]=null===n?N(n):(e[B]=n[B],new e)}var Pn="constructor",j="prototype",Sn="function",On="_dynInstFuncs",Nn="_isDynProxy",Mn="_dynClass",jn="_dynBaseFuncs",Rn="_dynInstChk",Dn=Rn,$n="_dyn_r$",zn="_dfOpts",Fn="_unknown_",Bn="__proto__",Ln="_dyn"+Bn,_n="__dynProto$Gbl",Un="_dynInstProto",Vn="useBaseInst",Wn="setInstFuncs",qn=Object,Gn=qn.getPrototypeOf,Jn=qn.getOwnPropertyNames,y=Qt(),Hn=y[_n]||(y[_n]={o:((h={})[Wn]=!0,h[Vn]=!0,h),n:1e3});function Kn(t){return t&&(t===qn[j]||t===Array[j])}function Qn(t){return Kn(t)||t===Function[j]}function R(t){if(t){if(Gn)return Gn(t);var n=t[Bn]||t[j]||(t[Pn]?t[Pn][j]:null),e=t[Ln]||n;E(t,Ln)||(delete t[Un],e=t[Ln]=t[Un]||t[Ln],t[Un]=n)}return e}function Xn(t,n){var e=[];if(Jn)e=Jn(t);else for(var r in t)"string"==typeof r&&E(t,r)&&e.push(r);if(e&&0<e.length)for(var i=0;i<e.length;i++)n(e[i])}function Yn(t,n,e){return n!==Pn&&typeof t[n]===Sn&&(e||E(t,n))&&n!==Bn&&n!==j}function Zn(t){k("DynamicProto: "+t)}function te(t,n){for(var e=t.length-1;0<=e;e--)if(t[e]===n)return 1}function ne(t,n){return E(t,j)?t.name||n||Fn:((t||{})[Pn]||{}).name||n||Fn}function ee(t,r,n,e){E(t,j)||Zn("theClass is an invalid class definition.");var i,o,c,s,f,l,p,v,u=t[j],a=(function(t){if(!Gn)return 1;for(var n=[],e=R(r);e&&!Qn(e)&&!te(n,e);){if(e===t)return 1;n.push(e),e=R(e)}}(u)||Zn("["+ne(t)+"] not in hierarchy of ["+ne(r)+"]"),null),t=(E(u,Mn)?a=u[Mn]:(a="_dynCls$"+ne(t,"_")+"$"+Hn.n,Hn.n++,u[Mn]=a),ee[zn]),m=!!t[Vn],d=(m&&e&&e[Vn]!==undefined&&(m=!!e[Vn]),i=r,o=N(null),Xn(i,function(t){!o[t]&&Yn(i,t,!1)&&(o[t]=i[t])}),o),m=(n(r,function(t,n,e,o){function r(t,n,e){var r,i=n[e];return i[Nn]&&o&&!1!==(r=t[On]||{})[Dn]&&(i=(r[n[Mn]]||{})[e]||i),function(){return i.apply(t,arguments)}}var i,u=N(null),a=(Xn(e,function(t){u[t]=r(n,e,t)}),function(t){if(E(t,jn))return t[jn];for(var n=N(null),e=R(t),r=[];e&&!Qn(e)&&!te(r,e);)Xn(e,function(t){!n[t]&&Yn(e,t,!Gn)&&(n[t]=e)}),r.push(e),e=R(e);return t[jn]=n}(t));for(i in a)u[i]||(u[i]=r(n,a[i],i));return u}(u,r,d,m)),!!Gn&&!!t[Wn]);c=u,s=a,f=r,l=d,n=!1!==(m=m&&e?!!e[Wn]:m),Kn(c)||Kn(p=f[On]=f[On]||N(null))||(v=p[s]=p[s]||N(null),!1!==p[Dn]&&(p[Dn]=!!n),Kn(v)||Xn(f,function(t){var i,o,u,a;Yn(f,t,!1)&&f[t]!==l[t]&&(v[t]=f[t],delete f[t],delete p[$n+s+"."+t],E(c,t)&&(!c[t]||c[t][Nn])||(c[t]=(i=c,u=$n+s+"."+(o=t),(a=function(){var t,n,e=this[On],r=e?e[u]:undefined;return r||(r=function(t,n,e,r){var i=null;if(t&&E(e,Mn)){var o=t[On]||N(null);if((i=(o[e[Mn]]||N(null))[n])||Zn("Missing ["+n+"] "+Sn),!i[Rn]&&!1!==o[Dn]){var u=!E(t,n);if(u)for(var a=R(t),c=[];a&&!Qn(a)&&!te(c,a);){var s=a[n];if(s){u=s===r;break}c.push(a),a=R(a)}try{u&&(t[n]=i),i[Rn]=1}catch(f){o[Dn]=!1}}}return i}(this,o,i,a)||(typeof(n=(n=i[t=o])===a?R(i)[t]:n)!==Sn&&Zn("["+t+"] is not a "+Sn),n),e&&(e[u]=r)),r.apply(this,arguments)})[Nn]=1,a)))}))}ee[zn]=Hn.o;var re,v={history:{blkVal:!0,v:undefined}},ie=Q?function pe(t,e){if((ot(t)||it(t)||A(t))&&!kt(t)){for(var n=0;n<e.length;n++)if(e[n]===t)return t;e.push(t),ht(t,function(t,n){pe(n,e)}),Pt(t)}return t}(v,[]):v;function oe(){var o,u,a,c,s,f,l=re.call(this)||this;return l.priority=185,l.identifier="ReactPlugin",ee(oe,l,function(i,t){function r(){s=!1,f=c=a=u=o=null}function n(){return o||p._throwInternal(i.diagLog(),1,64,"Analytics plugin is not available, React plugin telemetry will not be sent: "),o}r(),i.initialize=function(t,e,n,r){re.prototype.initialize.call(l,t,e,n,r);n=e.getPlugin(p.PropertiesPluginIdentifier);n&&(f=n.plugin),At(i,"context",{g:function(){return f?f.context:null}}),i._addHook(p.onConfigChange(t,function(t){var n=i._getTelCtx();u=n.getExtCfg(l.identifier,ie),o=null==(n=e.getPlugin(p.AnalyticsPluginIdentifier))?void 0:n.plugin,p.isFunction(a)&&(a(),a=null),u.history&&(n=u.history,a=n.listen(function(t){var n="location"in t?t.location:t;c=setTimeout(function(){c=null;var t={uri:n.pathname};i.trackPageView(t)},500)}),s||(n={uri:u.history.location.pathname},i.trackPageView(n),s=!0))}))},i.getCookieMgr=function(){return p.safeGetCookieMgr(i.core)},i.getAppInsights=n,i.processTelemetry=function(t,n){i.processNext(t,n)},i._doTeardown=function(t,n,e){p.isFunction(a)&&a(),c&&clearTimeout(c),r()},p.proxyFunctions(i,n,["trackMetric","trackPageView","trackEvent","trackException","trackTrace"]),At(i,"_extensionConfig",{g:function(){return u}})}),l}En(oe,re=p.BaseTelemetryPlugin),oe.__ieDyn=1;var ue,ae,J=oe,ce=(En(se,ue=z.Component),se.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=p.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&&p.dateNow()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=p.dateNow(),t._idleCount++)},100)},se.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,n;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),n={"Component Name":this._componentName},this._reactPlugin.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},n))},se.prototype.getEngagementTimeSeconds=function(){return(p.dateNow()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},se);function se(t,n,e){var r=ue.call(this,t)||this;return r._mountTimestamp=0,r._firstActiveTimestamp=0,r._idleStartTimestamp=0,r._lastActiveTimestamp=0,r._totalIdleTime=0,r._idleCount=0,r._idleTimeout=5e3,r.trackActivity=function(t){var n;0===r._firstActiveTimestamp?(r._firstActiveTimestamp=p.dateNow(),r._lastActiveTimestamp=r._firstActiveTimestamp):r._lastActiveTimestamp=p.dateNow(),0<r._idleStartTimestamp&&(n=r._lastActiveTimestamp-r._idleStartTimestamp,r._totalIdleTime+=n,r._idleStartTimestamp=0)},r._reactPlugin=n,r._componentName=e,r}function fe(){var t=null!==ae&&ae.apply(this,arguments)||this;return t.state={hasError:!1,error:null,errorInfo:null},t}En(fe,ae=F["default"].Component),fe.prototype.componentDidCatch=function(t,n){this.setState({hasError:!0,error:t,errorInfo:n}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:p.SeverityLevel.Error,properties:n})},fe.prototype.render=function(){var t=this.state,n=t.hasError,e=t.error,t=t.errorInfo,r=this.props,i=r.onError,r=r.children;return n?F["default"].createElement(i,{error:e,errorInfo:t}):r};var H=fe,le=a.createContext(undefined);t.AITrackedComponentBase=ce,t.AppInsightsContext=le,t.AppInsightsErrorBoundary=H,t.ReactPlugin=J,t.useAppInsightsContext=function(){return a.useContext(le)},t.useTrackEvent=function(t,n,e,r){void 0===r&&(r=!0);var e=a.useState(e),i=e[0],e=e[1],o=a.useRef(r),u=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:n},i)},[t,i,n]),a.useEffect(function(){return function(){o.current=u.current}},[]),e},t.useTrackMetric=function(r,i,o){var u=a.useRef({hookTimestamp:p.dateNow(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef(null);return t.current=function(){var t=u.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&p.dateNow()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=p.dateNow(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t,n=u.current;if(0===n.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==n.firstActiveTimestamp&&(n=n,n={average:(p.dateNow()-n.firstActiveTimestamp-n.totalIdleTime-n.idleCount*n.idleTimeout)/1e3,name:"React Component Engaged Time (seconds)",sampleCount:1},t=kn({"Component Name":i},o),r.trackMetric(n,t))}},[]),function(){var t,n=u.current;0===n.firstActiveTimestamp?(n.firstActiveTimestamp=p.dateNow(),n.lastActiveTimestamp=n.firstActiveTimestamp):n.lastActiveTimestamp=p.dateNow(),0<n.idleStartTimestamp&&(t=n.lastActiveTimestamp-n.idleStartTimestamp,n.totalIdleTime+=t,n.idleStartTimestamp=0)}},t.withAITracking=function(n,t,e,r){return e!==undefined&&null!==e&&"string"==typeof e||(e=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),r!==undefined&&null!==r&&"string"==typeof r||(r=""),En(i,o=ce),i.prototype.render=function(){return z.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:r},z.createElement(t,kn({},this.props)))},i;function i(t){return o.call(this,t,n,e)||this}var o},Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@microsoft/applicationinsights-core-js"),require("react")):"function"==typeof define&&define.amd?define(["exports","@microsoft/applicationinsights-core-js","react"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.Microsoft.ApplicationInsights,t.React);
|