{"version":3,"sources":["applicationInsightsModule.js"],"names":["applicationInsightsModule","Init","connectionString","caseName","participantId","userId","emailAddress","init","Microsoft","ApplicationInsights","config","extensionConfig","AppInsightsCfgSyncPlugin","cfgUrl","snippet","appInsights","loadAppInsights","addTelemetryInitializer","envelope","data","Case_CF","PartId_CF","toString","UserId_CF","Email_CF","setAuthenticatedUserContext","trackPageView","InitEventTracking","$","document","on","trackEvent","name","this","properties","Label_CF","URL_CF","attr"],"mappings":"AAAAA,0BACW,CACHC,KAAM,SAAUC,EAAkBC,EAAUC,EAAeC,EAAQC,GAC1DJ,IAcDK,EAAO,IAAIC,UAAUC,oBAAoBA,oBAV/B,CACVC,OAAQ,CACJR,iBAAkBA,EAClBS,gBAAiB,CACbC,yBAA0B,CACtBC,OAAQ,E,IAKyCC,EACjEC,YAAcR,EAAKS,gBAAAA,EAEfb,GAEAY,YAAYE,wBAAwB,SAAAC,GAChCA,EAASC,KAAOD,EAASC,MAAQ,GACjCD,EAASC,KAAKC,QAAUjB,EACxBe,EAASC,KAAKE,UAAYjB,EAAgBA,EAAckB,SAAAA,EAAa,GACrEJ,EAASC,KAAKI,UAAYlB,EAASA,EAAOiB,SAAAA,EAAa,GACvDJ,EAASC,KAAKK,SAAWlB,GAAgB,E,GAI7CD,GACAU,YAAYU,4BAA4BpB,CAAAA,EAG5CU,YAAYW,cAAAA,E,EAGhBC,kBAAmB,WACVZ,aAKLa,EAAEC,QAAAA,EAAUC,GAAG,QAAS,wCAAyC,WAC7Df,YAAYgB,WAAW,CACnBC,KAAMJ,EAAEK,IAAA,EAAMd,KAAK,eAAA,GAAoB,sBACvCe,WAAY,CACRC,SAAUP,EAAEK,IAAA,EAAMd,KAAK,gBAAA,GAAqB,GAC5CiB,OAAQR,EAAEK,IAAA,EAAMI,KAAK,MAAA,GAAW,E","file":"analytics.js","sourcesContent":["applicationInsightsModule = (function () {\r\n return {\r\n Init: function (connectionString, caseName, participantId, userId, emailAddress) {\r\n if (!connectionString) {\r\n return;\r\n }\r\n\r\n var snippet = {\r\n config: {\r\n connectionString: connectionString,\r\n extensionConfig: {\r\n AppInsightsCfgSyncPlugin: {\r\n cfgUrl: '' //Prevent loading a file from MS CDN - https://github.com/microsoft/ApplicationInsights-JS/blob/main/docs/WebConfig.md#disable-fetching-from-cdn\r\n }\r\n }\r\n }\r\n };\r\n var init = new Microsoft.ApplicationInsights.ApplicationInsights(snippet);\r\n appInsights = init.loadAppInsights();\r\n\r\n if (caseName) {\r\n //Add custom properties to all telemetry - https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling?tabs=dotnet%2Cjavascriptwebsdkloaderscript#javascript-telemetry-initializers\r\n appInsights.addTelemetryInitializer(envelope => {\r\n envelope.data = envelope.data || {};\r\n envelope.data.Case_CF = caseName;\r\n envelope.data.PartId_CF = participantId ? participantId.toString() : '';\r\n envelope.data.UserId_CF = userId ? userId.toString() : '';\r\n envelope.data.Email_CF = emailAddress || '';\r\n });\r\n }\r\n\r\n if (userId) {\r\n appInsights.setAuthenticatedUserContext(userId);\r\n }\r\n\r\n appInsights.trackPageView();\r\n },\r\n\r\n InitEventTracking: function () {\r\n if (!appInsights) {\r\n return;\r\n }\r\n\r\n //Track clicking on external links or html elements tagged for tracking as app insight events\r\n $(document).on('click', \"a[href^='http'], [data-ai-event-name]\", function () {\r\n appInsights.trackEvent({\r\n name: $(this).data('ai-event-name') || 'outbound-link-click',\r\n properties: {\r\n Label_CF: $(this).data('ai-event-label') || '',\r\n URL_CF: $(this).attr('href') || ''\r\n }\r\n });\r\n });\r\n }\r\n };\r\n})();\r\n"]}