@snokam/application-insights 1.2.6 → 1.2.7-alpha.0

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/lib/Provider.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Provider:()=>c,default:()=>a});const r=require("react/jsx-runtime"),n=require("next/router"),o=require("react"),i=require("history"),s=require("@microsoft/applicationinsights-react-js"),u=require("@microsoft/applicationinsights-web"),c=({children:e,config:t})=>{const c=(0,n.useRouter)(),a=(0,o.useRef)(!1),f=(0,o.useRef)(new s.ReactPlugin),l=(0,o.useRef)(null),p="undefined"!=typeof window?(0,i.createBrowserHistory)():void 0;return(0,o.useEffect)((()=>{l.current||(l.current=new u.ApplicationInsights({config:Object.assign({maxBatchSizeInBytes:1e4,maxBatchInterval:15e3,enableAutoRouteTracking:!0,extensions:[f.current],extensionConfig:{[f.current.identifier]:{history:p}}},t)}),l.current.loadAppInsights(),a.current=!0)}),[t]),(0,o.useEffect)((()=>{const e=e=>{var t;null===(t=l.current)||void 0===t||t.trackPageView({name:e})};return c.events.on("routeChangeComplete",e),()=>{c.events.off("routeChangeComplete",e)}}),[c.events]),(0,r.jsx)(s.AppInsightsContext.Provider,{value:f.current,children:e})},a=c;return t})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Provider:()=>c,default:()=>a});const r=require("react/jsx-runtime"),n=require("next/router"),o=require("react"),i=require("history"),s=require("@microsoft/applicationinsights-react-js"),u=require("@microsoft/applicationinsights-web"),c=({children:e,config:t})=>{const c=(0,n.useRouter)(),a=(0,o.useRef)(!1),f=(0,o.useRef)(new s.ReactPlugin),l=(0,o.useRef)(null),d="undefined"!=typeof window?(0,i.createBrowserHistory)():void 0;return(0,o.useEffect)((()=>{l.current||(l.current=new u.ApplicationInsights({config:Object.assign({maxBatchSizeInBytes:1e4,maxBatchInterval:15e3,enableAutoRouteTracking:!0,extensions:[f.current],extensionConfig:{[f.current.identifier]:{history:d}}},t)}),l.current.loadAppInsights(),l.current.addTelemetryInitializer((e=>{const t=e.baseType||"",r=(e.baseData||{}).target||"",n="RemoteDependencyData"===t,o=r.includes("cfcdn.mux.com")||r.includes("litix.io");if(n&&o)return!1})),a.current=!0)}),[t]),(0,o.useEffect)((()=>{const e=e=>{var t;null===(t=l.current)||void 0===t||t.trackPageView({name:e})};return c.events.on("routeChangeComplete",e),()=>{c.events.off("routeChangeComplete",e)}}),[c.events]),(0,r.jsx)(s.AppInsightsContext.Provider,{value:f.current,children:e})},a=c;return t})()));
2
2
  //# sourceMappingURL=Provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,kDCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,eCAvC,EAA+BA,QAAQ,SCAvC,EAA+BA,QAAQ,WCAvC,EAA+BA,QAAQ,2CCAvC,EAA+BA,QAAQ,sCCMhCC,EAAW,EAAGC,WAAUC,aACjC,MAAMC,GAAS,IAAAC,aACTC,GAAsB,IAAAC,SAAO,GAC7BC,GAAiB,IAAAD,QAAO,IAAI,EAAAE,aAC5BC,GAAiB,IAAAH,QAAO,MAExBI,EAD8B,oBAAXC,QACU,IAAAC,6BAAyBC,EAsB5D,OArBA,IAAAC,YAAU,KACDL,EAAeM,UAChBN,EAAeM,QAAU,IAAI,EAAAC,oBAAoB,CAC7Cd,OAAQf,OAAO8B,OAAO,CAAEC,oBAAqB,IAAOC,iBAAkB,KAAOC,yBAAyB,EAAMC,WAAY,CAACd,EAAeQ,SAAUO,gBAAiB,CAC3J,CAACf,EAAeQ,QAAQQ,YAAa,CAAEC,QAASd,KAC/CR,KAEbO,EAAeM,QAAQU,kBACvBpB,EAAoBU,SAAU,EAClC,GACD,CAACb,KACJ,IAAAY,YAAU,KACN,MAAMY,EAAqBC,IACvB,IAAIC,EAC8B,QAAjCA,EAAKnB,EAAeM,eAA4B,IAAPa,GAAyBA,EAAGC,cAAc,CAAEC,KAAMH,GAAM,EAGtG,OADAxB,EAAO4B,OAAOC,GAAG,sBAAuBN,GACjC,KACHvB,EAAO4B,OAAOE,IAAI,sBAAuBP,EAAkB,CAC9D,GACF,CAACvB,EAAO4B,UACH,SAAK,EAAAG,mBAAmBlC,SAAU,CAAEF,MAAOS,EAAeQ,QAASd,SAAUA,GAAY,EAErG,I","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"next/router\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/external commonjs \"history\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-react-js\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-web\"","webpack://snokam/./src/Provider.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/router\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"history\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-react-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-web\");","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, useRef } from \"react\";\nimport { createBrowserHistory } from \"history\";\nimport { AppInsightsContext, ReactPlugin, } from \"@microsoft/applicationinsights-react-js\";\nimport { ApplicationInsights, } from \"@microsoft/applicationinsights-web\";\nexport const Provider = ({ children, config }) => {\n const router = useRouter();\n const isAppInsightsLoaded = useRef(false);\n const reactPluginRef = useRef(new ReactPlugin());\n const appInsightsRef = useRef(null);\n const isBrowser = typeof window !== \"undefined\";\n const browserHistory = isBrowser ? createBrowserHistory() : undefined;\n useEffect(() => {\n if (!appInsightsRef.current) {\n appInsightsRef.current = new ApplicationInsights({\n config: Object.assign({ maxBatchSizeInBytes: 10000, maxBatchInterval: 15000, enableAutoRouteTracking: true, extensions: [reactPluginRef.current], extensionConfig: {\n [reactPluginRef.current.identifier]: { history: browserHistory },\n } }, config),\n });\n appInsightsRef.current.loadAppInsights();\n isAppInsightsLoaded.current = true;\n }\n }, [config]);\n useEffect(() => {\n const handleRouteChange = (url) => {\n var _a;\n (_a = appInsightsRef.current) === null || _a === void 0 ? void 0 : _a.trackPageView({ name: url });\n };\n router.events.on(\"routeChangeComplete\", handleRouteChange);\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChange);\n };\n }, [router.events]);\n return (_jsx(AppInsightsContext.Provider, { value: reactPluginRef.current, children: children }));\n};\nexport default Provider;\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","Provider","children","config","router","useRouter","isAppInsightsLoaded","useRef","reactPluginRef","ReactPlugin","appInsightsRef","browserHistory","window","createBrowserHistory","undefined","useEffect","current","ApplicationInsights","assign","maxBatchSizeInBytes","maxBatchInterval","enableAutoRouteTracking","extensions","extensionConfig","identifier","history","loadAppInsights","handleRouteChange","url","_a","trackPageView","name","events","on","off","AppInsightsContext"],"sourceRoot":""}
1
+ {"version":3,"file":"Provider.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,kDCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,eCAvC,EAA+BA,QAAQ,SCAvC,EAA+BA,QAAQ,WCAvC,EAA+BA,QAAQ,2CCAvC,EAA+BA,QAAQ,sCCMhCC,EAAW,EAAGC,WAAUC,aACjC,MAAMC,GAAS,IAAAC,aACTC,GAAsB,IAAAC,SAAO,GAC7BC,GAAiB,IAAAD,QAAO,IAAI,EAAAE,aAC5BC,GAAiB,IAAAH,QAAO,MAExBI,EAD8B,oBAAXC,QACU,IAAAC,6BAAyBC,EAmC5D,OAlCA,IAAAC,YAAU,KACDL,EAAeM,UAChBN,EAAeM,QAAU,IAAI,EAAAC,oBAAoB,CAC7Cd,OAAQf,OAAO8B,OAAO,CAAEC,oBAAqB,IAAOC,iBAAkB,KAAOC,yBAAyB,EAAMC,WAAY,CAACd,EAAeQ,SAAUO,gBAAiB,CAC3J,CAACf,EAAeQ,QAAQQ,YAAa,CAAEC,QAASd,KAC/CR,KAGbO,EAAeM,QAAQU,kBAEvBhB,EAAeM,QAAQW,yBAAyBC,IAC5C,MAAMC,EAAWD,EAASC,UAAY,GAEhCC,GADgBF,EAASG,UAAY,CAAC,GACfD,QAAU,GACjCE,EAAgC,yBAAbH,EAEnBI,EAAUH,EAAOI,SAAS,kBAAoBJ,EAAOI,SAAS,YACpE,GAAIF,GAAoBC,EACpB,OAAO,CACX,IAEJ3B,EAAoBU,SAAU,EAClC,GACD,CAACb,KACJ,IAAAY,YAAU,KACN,MAAMoB,EAAqBC,IACvB,IAAIC,EAC8B,QAAjCA,EAAK3B,EAAeM,eAA4B,IAAPqB,GAAyBA,EAAGC,cAAc,CAAEC,KAAMH,GAAM,EAGtG,OADAhC,EAAOoC,OAAOC,GAAG,sBAAuBN,GACjC,KACH/B,EAAOoC,OAAOE,IAAI,sBAAuBP,EAAkB,CAC9D,GACF,CAAC/B,EAAOoC,UACH,SAAK,EAAAG,mBAAmB1C,SAAU,CAAEF,MAAOS,EAAeQ,QAASd,SAAUA,GAAY,EAErG,I","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"next/router\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/external commonjs \"history\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-react-js\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-web\"","webpack://snokam/./src/Provider.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/router\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"history\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-react-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-web\");","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, useRef } from \"react\";\nimport { createBrowserHistory } from \"history\";\nimport { AppInsightsContext, ReactPlugin, } from \"@microsoft/applicationinsights-react-js\";\nimport { ApplicationInsights, } from \"@microsoft/applicationinsights-web\";\nexport const Provider = ({ children, config }) => {\n const router = useRouter();\n const isAppInsightsLoaded = useRef(false);\n const reactPluginRef = useRef(new ReactPlugin());\n const appInsightsRef = useRef(null);\n const isBrowser = typeof window !== \"undefined\";\n const browserHistory = isBrowser ? createBrowserHistory() : undefined;\n useEffect(() => {\n if (!appInsightsRef.current) {\n appInsightsRef.current = new ApplicationInsights({\n config: Object.assign({ maxBatchSizeInBytes: 10000, maxBatchInterval: 15000, enableAutoRouteTracking: true, extensions: [reactPluginRef.current], extensionConfig: {\n [reactPluginRef.current.identifier]: { history: browserHistory },\n } }, config),\n });\n // Load Application Insights\n appInsightsRef.current.loadAppInsights();\n // Filter out telemetry from specific domains\n appInsightsRef.current.addTelemetryInitializer((envelope) => {\n const baseType = envelope.baseType || \"\";\n const telemetryItem = envelope.baseData || {};\n const target = telemetryItem.target || \"\";\n const isDependencyData = baseType === \"RemoteDependencyData\";\n // Video chunk telemetry\n const isVideo = target.includes(\"cfcdn.mux.com\") || target.includes(\"litix.io\");\n if (isDependencyData && isVideo) {\n return false;\n }\n });\n isAppInsightsLoaded.current = true;\n }\n }, [config]);\n useEffect(() => {\n const handleRouteChange = (url) => {\n var _a;\n (_a = appInsightsRef.current) === null || _a === void 0 ? void 0 : _a.trackPageView({ name: url });\n };\n router.events.on(\"routeChangeComplete\", handleRouteChange);\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChange);\n };\n }, [router.events]);\n return (_jsx(AppInsightsContext.Provider, { value: reactPluginRef.current, children: children }));\n};\nexport default Provider;\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","Provider","children","config","router","useRouter","isAppInsightsLoaded","useRef","reactPluginRef","ReactPlugin","appInsightsRef","browserHistory","window","createBrowserHistory","undefined","useEffect","current","ApplicationInsights","assign","maxBatchSizeInBytes","maxBatchInterval","enableAutoRouteTracking","extensions","extensionConfig","identifier","history","loadAppInsights","addTelemetryInitializer","envelope","baseType","target","baseData","isDependencyData","isVideo","includes","handleRouteChange","url","_a","trackPageView","name","events","on","off","AppInsightsContext"],"sourceRoot":""}
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={282:(e,t,r)=>{r.d(t,{Provider:()=>a});const o=require("react/jsx-runtime"),n=require("next/router"),i=require("react"),s=require("history"),u=require("@microsoft/applicationinsights-react-js"),c=require("@microsoft/applicationinsights-web"),a=({children:e,config:t})=>{const r=(0,n.useRouter)(),a=(0,i.useRef)(!1),f=(0,i.useRef)(new u.ReactPlugin),p=(0,i.useRef)(null),d="undefined"!=typeof window?(0,s.createBrowserHistory)():void 0;return(0,i.useEffect)((()=>{p.current||(p.current=new c.ApplicationInsights({config:Object.assign({maxBatchSizeInBytes:1e4,maxBatchInterval:15e3,enableAutoRouteTracking:!0,extensions:[f.current],extensionConfig:{[f.current.identifier]:{history:d}}},t)}),p.current.loadAppInsights(),a.current=!0)}),[t]),(0,i.useEffect)((()=>{const e=e=>{var t;null===(t=p.current)||void 0===t||t.trackPageView({name:e})};return r.events.on("routeChangeComplete",e),()=>{r.events.off("routeChangeComplete",e)}}),[r.events]),(0,o.jsx)(u.AppInsightsContext.Provider,{value:f.current,children:e})}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.r(o),r.d(o,{default:()=>n});const n={Provider:r(282).Provider};return o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={282:(e,t,r)=>{r.d(t,{Provider:()=>a});const n=require("react/jsx-runtime"),o=require("next/router"),i=require("react"),s=require("history"),u=require("@microsoft/applicationinsights-react-js"),c=require("@microsoft/applicationinsights-web"),a=({children:e,config:t})=>{const r=(0,o.useRouter)(),a=(0,i.useRef)(!1),d=(0,i.useRef)(new u.ReactPlugin),f=(0,i.useRef)(null),l="undefined"!=typeof window?(0,s.createBrowserHistory)():void 0;return(0,i.useEffect)((()=>{f.current||(f.current=new c.ApplicationInsights({config:Object.assign({maxBatchSizeInBytes:1e4,maxBatchInterval:15e3,enableAutoRouteTracking:!0,extensions:[d.current],extensionConfig:{[d.current.identifier]:{history:l}}},t)}),f.current.loadAppInsights(),f.current.addTelemetryInitializer((e=>{const t=e.baseType||"",r=(e.baseData||{}).target||"",n="RemoteDependencyData"===t,o=r.includes("cfcdn.mux.com")||r.includes("litix.io");if(n&&o)return!1})),a.current=!0)}),[t]),(0,i.useEffect)((()=>{const e=e=>{var t;null===(t=f.current)||void 0===t||t.trackPageView({name:e})};return r.events.on("routeChangeComplete",e),()=>{r.events.off("routeChangeComplete",e)}}),[r.events]),(0,n.jsx)(u.AppInsightsContext.Provider,{value:d.current,children:e})}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>o});const o={Provider:r(282).Provider};return n})()));
2
2
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,gECTT,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,eCAvC,EAA+BA,QAAQ,SCAvC,EAA+BA,QAAQ,WCAvC,EAA+BA,QAAQ,2CCAvC,EAA+BA,QAAQ,sCCMhCC,EAAW,EAAGC,WAAUC,aACjC,MAAMC,GAAS,IAAAC,aACTC,GAAsB,IAAAC,SAAO,GAC7BC,GAAiB,IAAAD,QAAO,IAAI,EAAAE,aAC5BC,GAAiB,IAAAH,QAAO,MAExBI,EAD8B,oBAAXC,QACU,IAAAC,6BAAyBC,EAsB5D,OArBA,IAAAC,YAAU,KACDL,EAAeM,UAChBN,EAAeM,QAAU,IAAI,EAAAC,oBAAoB,CAC7Cd,OAAQe,OAAOC,OAAO,CAAEC,oBAAqB,IAAOC,iBAAkB,KAAOC,yBAAyB,EAAMC,WAAY,CAACf,EAAeQ,SAAUQ,gBAAiB,CAC3J,CAAChB,EAAeQ,QAAQS,YAAa,CAAEC,QAASf,KAC/CR,KAEbO,EAAeM,QAAQW,kBACvBrB,EAAoBU,SAAU,EAClC,GACD,CAACb,KACJ,IAAAY,YAAU,KACN,MAAMa,EAAqBC,IACvB,IAAIC,EAC8B,QAAjCA,EAAKpB,EAAeM,eAA4B,IAAPc,GAAyBA,EAAGC,cAAc,CAAEC,KAAMH,GAAM,EAGtG,OADAzB,EAAO6B,OAAOC,GAAG,sBAAuBN,GACjC,KACHxB,EAAO6B,OAAOE,IAAI,sBAAuBP,EAAkB,CAC9D,GACF,CAACxB,EAAO6B,UACH,SAAK,EAAAG,mBAAmBnC,SAAU,CAAEoC,MAAO7B,EAAeQ,QAASd,SAAUA,GAAY,C,GCjCjGoC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB1B,IAAjB2B,EACH,OAAOA,EAAa9C,QAGrB,IAAIC,EAAS0C,EAAyBE,GAAY,CAGjD7C,QAAS,CAAC,GAOX,OAHA+C,EAAoBF,GAAU5C,EAAQA,EAAOD,QAAS4C,GAG/C3C,EAAOD,OACf,CCrBA4C,EAAoBI,EAAI,CAAChD,EAASiD,KACjC,IAAI,IAAIC,KAAOD,EACXL,EAAoBO,EAAEF,EAAYC,KAASN,EAAoBO,EAAEnD,EAASkD,IAC5E3B,OAAO6B,eAAepD,EAASkD,EAAK,CAAEG,YAAY,EAAMC,IAAKL,EAAWC,IAE1E,ECNDN,EAAoBO,EAAI,CAACI,EAAKC,IAAUjC,OAAOkC,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFZ,EAAoBgB,EAAK5D,IACH,oBAAX6D,QAA0BA,OAAOC,aAC1CvC,OAAO6B,eAAepD,EAAS6D,OAAOC,YAAa,CAAEpB,MAAO,WAE7DnB,OAAO6B,eAAepD,EAAS,aAAc,CAAE0C,OAAO,GAAO,E,uCCJ9D,SAAiBpC,S,OAAQ,U","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"next/router\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/external commonjs \"history\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-react-js\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-web\"","webpack://snokam/./src/Provider.tsx","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/./src/index.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/router\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"history\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-react-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-web\");","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, useRef } from \"react\";\nimport { createBrowserHistory } from \"history\";\nimport { AppInsightsContext, ReactPlugin, } from \"@microsoft/applicationinsights-react-js\";\nimport { ApplicationInsights, } from \"@microsoft/applicationinsights-web\";\nexport const Provider = ({ children, config }) => {\n const router = useRouter();\n const isAppInsightsLoaded = useRef(false);\n const reactPluginRef = useRef(new ReactPlugin());\n const appInsightsRef = useRef(null);\n const isBrowser = typeof window !== \"undefined\";\n const browserHistory = isBrowser ? createBrowserHistory() : undefined;\n useEffect(() => {\n if (!appInsightsRef.current) {\n appInsightsRef.current = new ApplicationInsights({\n config: Object.assign({ maxBatchSizeInBytes: 10000, maxBatchInterval: 15000, enableAutoRouteTracking: true, extensions: [reactPluginRef.current], extensionConfig: {\n [reactPluginRef.current.identifier]: { history: browserHistory },\n } }, config),\n });\n appInsightsRef.current.loadAppInsights();\n isAppInsightsLoaded.current = true;\n }\n }, [config]);\n useEffect(() => {\n const handleRouteChange = (url) => {\n var _a;\n (_a = appInsightsRef.current) === null || _a === void 0 ? void 0 : _a.trackPageView({ name: url });\n };\n router.events.on(\"routeChangeComplete\", handleRouteChange);\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChange);\n };\n }, [router.events]);\n return (_jsx(AppInsightsContext.Provider, { value: reactPluginRef.current, children: children }));\n};\nexport default Provider;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { Provider } from \"./Provider\";\nexport default { Provider };\n"],"names":["root","factory","exports","module","define","amd","this","require","Provider","children","config","router","useRouter","isAppInsightsLoaded","useRef","reactPluginRef","ReactPlugin","appInsightsRef","browserHistory","window","createBrowserHistory","undefined","useEffect","current","ApplicationInsights","Object","assign","maxBatchSizeInBytes","maxBatchInterval","enableAutoRouteTracking","extensions","extensionConfig","identifier","history","loadAppInsights","handleRouteChange","url","_a","trackPageView","name","events","on","off","AppInsightsContext","value","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","key","o","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,gECTT,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,eCAvC,EAA+BA,QAAQ,SCAvC,EAA+BA,QAAQ,WCAvC,EAA+BA,QAAQ,2CCAvC,EAA+BA,QAAQ,sCCMhCC,EAAW,EAAGC,WAAUC,aACjC,MAAMC,GAAS,IAAAC,aACTC,GAAsB,IAAAC,SAAO,GAC7BC,GAAiB,IAAAD,QAAO,IAAI,EAAAE,aAC5BC,GAAiB,IAAAH,QAAO,MAExBI,EAD8B,oBAAXC,QACU,IAAAC,6BAAyBC,EAmC5D,OAlCA,IAAAC,YAAU,KACDL,EAAeM,UAChBN,EAAeM,QAAU,IAAI,EAAAC,oBAAoB,CAC7Cd,OAAQe,OAAOC,OAAO,CAAEC,oBAAqB,IAAOC,iBAAkB,KAAOC,yBAAyB,EAAMC,WAAY,CAACf,EAAeQ,SAAUQ,gBAAiB,CAC3J,CAAChB,EAAeQ,QAAQS,YAAa,CAAEC,QAASf,KAC/CR,KAGbO,EAAeM,QAAQW,kBAEvBjB,EAAeM,QAAQY,yBAAyBC,IAC5C,MAAMC,EAAWD,EAASC,UAAY,GAEhCC,GADgBF,EAASG,UAAY,CAAC,GACfD,QAAU,GACjCE,EAAgC,yBAAbH,EAEnBI,EAAUH,EAAOI,SAAS,kBAAoBJ,EAAOI,SAAS,YACpE,GAAIF,GAAoBC,EACpB,OAAO,CACX,IAEJ5B,EAAoBU,SAAU,EAClC,GACD,CAACb,KACJ,IAAAY,YAAU,KACN,MAAMqB,EAAqBC,IACvB,IAAIC,EAC8B,QAAjCA,EAAK5B,EAAeM,eAA4B,IAAPsB,GAAyBA,EAAGC,cAAc,CAAEC,KAAMH,GAAM,EAGtG,OADAjC,EAAOqC,OAAOC,GAAG,sBAAuBN,GACjC,KACHhC,EAAOqC,OAAOE,IAAI,sBAAuBP,EAAkB,CAC9D,GACF,CAAChC,EAAOqC,UACH,SAAK,EAAAG,mBAAmB3C,SAAU,CAAE4C,MAAOrC,EAAeQ,QAASd,SAAUA,GAAY,C,GC9CjG4C,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBlC,IAAjBmC,EACH,OAAOA,EAAatD,QAGrB,IAAIC,EAASkD,EAAyBE,GAAY,CAGjDrD,QAAS,CAAC,GAOX,OAHAuD,EAAoBF,GAAUpD,EAAQA,EAAOD,QAASoD,GAG/CnD,EAAOD,OACf,CCrBAoD,EAAoBI,EAAI,CAACxD,EAASyD,KACjC,IAAI,IAAIC,KAAOD,EACXL,EAAoBO,EAAEF,EAAYC,KAASN,EAAoBO,EAAE3D,EAAS0D,IAC5EnC,OAAOqC,eAAe5D,EAAS0D,EAAK,CAAEG,YAAY,EAAMC,IAAKL,EAAWC,IAE1E,ECNDN,EAAoBO,EAAI,CAACI,EAAKC,IAAUzC,OAAO0C,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFZ,EAAoBgB,EAAKpE,IACH,oBAAXqE,QAA0BA,OAAOC,aAC1C/C,OAAOqC,eAAe5D,EAASqE,OAAOC,YAAa,CAAEpB,MAAO,WAE7D3B,OAAOqC,eAAe5D,EAAS,aAAc,CAAEkD,OAAO,GAAO,E,uCCJ9D,SAAiB5C,S,OAAQ,U","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"next/router\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/external commonjs \"history\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-react-js\"","webpack://snokam/external commonjs \"@microsoft/applicationinsights-web\"","webpack://snokam/./src/Provider.tsx","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/./src/index.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/router\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"history\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-react-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@microsoft/applicationinsights-web\");","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, useRef } from \"react\";\nimport { createBrowserHistory } from \"history\";\nimport { AppInsightsContext, ReactPlugin, } from \"@microsoft/applicationinsights-react-js\";\nimport { ApplicationInsights, } from \"@microsoft/applicationinsights-web\";\nexport const Provider = ({ children, config }) => {\n const router = useRouter();\n const isAppInsightsLoaded = useRef(false);\n const reactPluginRef = useRef(new ReactPlugin());\n const appInsightsRef = useRef(null);\n const isBrowser = typeof window !== \"undefined\";\n const browserHistory = isBrowser ? createBrowserHistory() : undefined;\n useEffect(() => {\n if (!appInsightsRef.current) {\n appInsightsRef.current = new ApplicationInsights({\n config: Object.assign({ maxBatchSizeInBytes: 10000, maxBatchInterval: 15000, enableAutoRouteTracking: true, extensions: [reactPluginRef.current], extensionConfig: {\n [reactPluginRef.current.identifier]: { history: browserHistory },\n } }, config),\n });\n // Load Application Insights\n appInsightsRef.current.loadAppInsights();\n // Filter out telemetry from specific domains\n appInsightsRef.current.addTelemetryInitializer((envelope) => {\n const baseType = envelope.baseType || \"\";\n const telemetryItem = envelope.baseData || {};\n const target = telemetryItem.target || \"\";\n const isDependencyData = baseType === \"RemoteDependencyData\";\n // Video chunk telemetry\n const isVideo = target.includes(\"cfcdn.mux.com\") || target.includes(\"litix.io\");\n if (isDependencyData && isVideo) {\n return false;\n }\n });\n isAppInsightsLoaded.current = true;\n }\n }, [config]);\n useEffect(() => {\n const handleRouteChange = (url) => {\n var _a;\n (_a = appInsightsRef.current) === null || _a === void 0 ? void 0 : _a.trackPageView({ name: url });\n };\n router.events.on(\"routeChangeComplete\", handleRouteChange);\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChange);\n };\n }, [router.events]);\n return (_jsx(AppInsightsContext.Provider, { value: reactPluginRef.current, children: children }));\n};\nexport default Provider;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { Provider } from \"./Provider\";\nexport default { Provider };\n"],"names":["root","factory","exports","module","define","amd","this","require","Provider","children","config","router","useRouter","isAppInsightsLoaded","useRef","reactPluginRef","ReactPlugin","appInsightsRef","browserHistory","window","createBrowserHistory","undefined","useEffect","current","ApplicationInsights","Object","assign","maxBatchSizeInBytes","maxBatchInterval","enableAutoRouteTracking","extensions","extensionConfig","identifier","history","loadAppInsights","addTelemetryInitializer","envelope","baseType","target","baseData","isDependencyData","isVideo","includes","handleRouteChange","url","_a","trackPageView","name","events","on","off","AppInsightsContext","value","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","key","o","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@snokam/application-insights",
3
3
  "description": "Snøkam core components",
4
- "version": "1.2.6",
4
+ "version": "1.2.7-alpha.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -33,5 +33,5 @@
33
33
  "react": "^18.0.0",
34
34
  "react-dom": "^18.0.0"
35
35
  },
36
- "gitHead": "33dc8136c2546e35646a92df7df3ff69f6504b66"
36
+ "gitHead": "a89db1db73984adcef40c41daf406da4aa03804e"
37
37
  }