@microsoft/applicationinsights-analytics-js 3.3.12-nightly3.2602-18 → 3.4.0-beta

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.
Files changed (34) hide show
  1. package/browser/es5/applicationinsights-analytics-js.cjs.js +1328 -968
  2. package/browser/es5/applicationinsights-analytics-js.cjs.js.map +1 -1
  3. package/browser/es5/applicationinsights-analytics-js.cjs.min.js +2 -2
  4. package/browser/es5/applicationinsights-analytics-js.cjs.min.js.map +1 -1
  5. package/browser/es5/applicationinsights-analytics-js.gbl.js +1330 -970
  6. package/browser/es5/applicationinsights-analytics-js.gbl.js.map +1 -1
  7. package/browser/es5/applicationinsights-analytics-js.gbl.min.js +2 -2
  8. package/browser/es5/applicationinsights-analytics-js.gbl.min.js.map +1 -1
  9. package/browser/es5/applicationinsights-analytics-js.integrity.json +25 -25
  10. package/browser/es5/applicationinsights-analytics-js.js +1330 -970
  11. package/browser/es5/applicationinsights-analytics-js.js.map +1 -1
  12. package/browser/es5/applicationinsights-analytics-js.min.js +2 -2
  13. package/browser/es5/applicationinsights-analytics-js.min.js.map +1 -1
  14. package/dist/es5/applicationinsights-analytics-js.js +1328 -968
  15. package/dist/es5/applicationinsights-analytics-js.js.map +1 -1
  16. package/dist/es5/applicationinsights-analytics-js.min.js +2 -2
  17. package/dist/es5/applicationinsights-analytics-js.min.js.map +1 -1
  18. package/dist-es5/JavaScriptSDK/AnalyticsPlugin.js +45 -48
  19. package/dist-es5/JavaScriptSDK/AnalyticsPlugin.js.map +1 -1
  20. package/dist-es5/JavaScriptSDK/Interfaces/IAnalyticsConfig.js +1 -1
  21. package/dist-es5/JavaScriptSDK/Telemetry/PageViewManager.js +175 -181
  22. package/dist-es5/JavaScriptSDK/Telemetry/PageViewManager.js.map +1 -1
  23. package/dist-es5/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +87 -98
  24. package/dist-es5/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js.map +1 -1
  25. package/dist-es5/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +86 -94
  26. package/dist-es5/JavaScriptSDK/Telemetry/PageVisitTimeManager.js.map +1 -1
  27. package/dist-es5/JavaScriptSDK/Timing.js +19 -17
  28. package/dist-es5/JavaScriptSDK/Timing.js.map +1 -1
  29. package/dist-es5/__DynamicConstants.js +6 -6
  30. package/dist-es5/__DynamicConstants.js.map +1 -1
  31. package/dist-es5/applicationinsights-analytics-js.js +1 -1
  32. package/package.json +71 -72
  33. package/types/applicationinsights-analytics-js.d.ts +42 -12
  34. package/types/applicationinsights-analytics-js.namespaced.d.ts +2151 -34
@@ -1,210 +1,204 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Web Analytics, 3.3.12-nightly3.2602-18
2
+ * Application Insights JavaScript SDK - Web Analytics, 3.4.0-beta
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- import dynamicProto from "@microsoft/dynamicproto-js";
8
- import { dateTimeUtilsDuration } from "@microsoft/applicationinsights-common";
9
- import { _throwInternal, arrForEach, dumpObj, fieldRedaction, getDocument, getExceptionName, getLocation, isNullOrUndefined } from "@microsoft/applicationinsights-core-js";
7
+ import { _throwInternal, arrForEach, dateTimeUtilsDuration, dumpObj, fieldRedaction, getDocument, getExceptionName, getLocation, isNullOrUndefined } from "@microsoft/applicationinsights-core-js";
10
8
  import { getPerformance, isUndefined, isWebWorker, scheduleTimeout } from "@nevware21/ts-utils";
11
9
  import { _DYN_CONFIG, _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_HREF, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME, _DYN_TRACK_PAGE_VIEW } from "../../__DynamicConstants";
12
10
  /**
13
- * Class encapsulates sending page views and page view performance telemetry.
11
+ * Factory function to create a PageViewManager instance.
12
+ * @param appInsights - Internal interface to send telemetry
13
+ * @param overridePageViewDuration - Whether to override page view duration
14
+ * @param core - App Insights core instance
15
+ * @param pageViewPerformanceManager - Page view performance manager instance
16
+ * @returns A new IPageViewManager instance.
17
+ * @internal
14
18
  */
15
- var PageViewManager = /** @class */ (function () {
16
- function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {
17
- dynamicProto(PageViewManager, this, function (_self) {
18
- var queueTimer = null;
19
- var itemQueue = [];
20
- var pageViewPerformanceSent = false;
21
- var firstPageViewSent = false;
22
- var _logger;
23
- if (core) {
24
- _logger = core.logger;
25
- }
26
- function _flushChannels(isAsync) {
27
- if (core) {
28
- core.flush(isAsync, function () {
29
- // Event flushed, callback added to prevent promise creation
30
- });
19
+ export function createPageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {
20
+ var _a;
21
+ var queueTimer = null;
22
+ var itemQueue = [];
23
+ var pageViewPerformanceSent = false;
24
+ var firstPageViewSent = false;
25
+ var _logger;
26
+ if (core) {
27
+ _logger = core.logger;
28
+ }
29
+ function _flushChannels(isAsync) {
30
+ if (core) {
31
+ core.flush(isAsync, function () {
32
+ // Event flushed, callback added to prevent promise creation
33
+ });
34
+ }
35
+ }
36
+ function _startTimer() {
37
+ if (!queueTimer) {
38
+ queueTimer = scheduleTimeout((function () {
39
+ queueTimer = null;
40
+ var allItems = itemQueue.slice(0);
41
+ var doFlush = false;
42
+ itemQueue = [];
43
+ arrForEach(allItems, function (item) {
44
+ if (!item()) {
45
+ // Not processed so rescheduled
46
+ itemQueue.push(item);
47
+ }
48
+ else {
49
+ doFlush = true;
50
+ }
51
+ });
52
+ if (itemQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {
53
+ _startTimer();
31
54
  }
32
- }
33
- function _startTimer() {
34
- if (!queueTimer) {
35
- queueTimer = scheduleTimeout((function () {
36
- queueTimer = null;
37
- var allItems = itemQueue.slice(0);
38
- var doFlush = false;
39
- itemQueue = [];
40
- arrForEach(allItems, function (item) {
41
- if (!item()) {
42
- // Not processed so rescheduled
43
- itemQueue.push(item);
44
- }
45
- else {
46
- doFlush = true;
47
- }
48
- });
49
- if (itemQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {
50
- _startTimer();
51
- }
52
- if (doFlush) {
53
- // We process at least one item so flush the queue
54
- _flushChannels(true);
55
- }
56
- }), 100);
55
+ if (doFlush) {
56
+ // We process at least one item so flush the queue
57
+ _flushChannels(true);
57
58
  }
59
+ }), 100);
60
+ }
61
+ }
62
+ function _addQueue(cb) {
63
+ itemQueue.push(cb);
64
+ _startTimer();
65
+ }
66
+ return _a = {},
67
+ _a[_DYN_TRACK_PAGE_VIEW /* @min:trackPageView */] = function (pageView, customProperties) {
68
+ var name = pageView.name;
69
+ if (isNullOrUndefined(name) || typeof name !== "string") {
70
+ var doc = getDocument();
71
+ name = pageView.name = doc && doc.title || "";
58
72
  }
59
- function _addQueue(cb) {
60
- itemQueue.push(cb);
61
- _startTimer();
73
+ var uri = pageView.uri;
74
+ if (isNullOrUndefined(uri) || typeof uri !== "string") {
75
+ var location_1 = getLocation();
76
+ uri = pageView.uri = location_1 && location_1[_DYN_HREF /* @min:%2ehref */] || "";
62
77
  }
63
- _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */] = function (pageView, customProperties) {
64
- var name = pageView.name;
65
- if (isNullOrUndefined(name) || typeof name !== "string") {
66
- var doc = getDocument();
67
- name = pageView.name = doc && doc.title || "";
68
- }
69
- var uri = pageView.uri;
70
- if (isNullOrUndefined(uri) || typeof uri !== "string") {
71
- var location_1 = getLocation();
72
- uri = pageView.uri = location_1 && location_1[_DYN_HREF /* @min:%2ehref */] || "";
78
+ if (core && core[_DYN_CONFIG /* @min:%2econfig */]) {
79
+ uri = pageView.uri = fieldRedaction(pageView.uri, core[_DYN_CONFIG /* @min:%2econfig */]);
80
+ }
81
+ if (!firstPageViewSent) {
82
+ var perf = getPerformance();
83
+ // Access the performance timing object
84
+ var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */] && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */]("navigation"));
85
+ // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE
86
+ if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) {
87
+ // Get the value of loadEventStart
88
+ var loadEventStart = navigationEntries[0].loadEventStart;
89
+ pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(perf.timeOrigin + loadEventStart);
73
90
  }
74
- if (core && core[_DYN_CONFIG /* @min:%2econfig */]) {
75
- uri = pageView.uri = fieldRedaction(pageView.uri, core[_DYN_CONFIG /* @min:%2econfig */]);
91
+ else {
92
+ // calculate the start time manually
93
+ var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);
94
+ pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration_1);
76
95
  }
77
- if (!firstPageViewSent) {
78
- var perf = getPerformance();
79
- // Access the performance timing object
80
- var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */] && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */]("navigation"));
81
- // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE
82
- if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) {
83
- // Get the value of loadEventStart
84
- var loadEventStart = navigationEntries[0].loadEventStart;
85
- pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(perf.timeOrigin + loadEventStart);
86
- }
87
- else {
88
- // calculate the start time manually
89
- var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);
90
- pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration_1);
91
- }
92
- firstPageViewSent = true;
96
+ firstPageViewSent = true;
97
+ }
98
+ // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user
99
+ // do not provide the duration, set duration to undefined
100
+ // Also this is case 4
101
+ if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */]()) {
102
+ appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
103
+ _flushChannels(true);
104
+ if (!isWebWorker()) {
105
+ // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)
106
+ _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 25 /* _eInternalMessageId.NavigationTimingNotSupported */, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
93
107
  }
94
- // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user
95
- // do not provide the duration, set duration to undefined
96
- // Also this is case 4
97
- if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */]()) {
98
- appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
99
- _flushChannels(true);
100
- if (!isWebWorker()) {
101
- // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)
102
- _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 25 /* _eInternalMessageId.NavigationTimingNotSupported */, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
103
- }
104
- return;
108
+ return;
109
+ }
110
+ var pageViewSent = false;
111
+ var customDuration;
112
+ // if the performance timing is supported by the browser, calculate the custom duration
113
+ var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */]()[_DYN_NAVIGATION_START /* @min:%2enavigationStart */];
114
+ if (start > 0) {
115
+ customDuration = dateTimeUtilsDuration(start, +new Date);
116
+ if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](customDuration)) {
117
+ customDuration = undefined;
105
118
  }
106
- var pageViewSent = false;
107
- var customDuration;
108
- // if the performance timing is supported by the browser, calculate the custom duration
109
- var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */]()[_DYN_NAVIGATION_START /* @min:%2enavigationStart */];
110
- if (start > 0) {
111
- customDuration = dateTimeUtilsDuration(start, +new Date);
112
- if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](customDuration)) {
113
- customDuration = undefined;
119
+ }
120
+ // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if
121
+ // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier
122
+ var duration;
123
+ if (!isNullOrUndefined(customProperties) &&
124
+ !isNullOrUndefined(customProperties[_DYN_DURATION /* @min:%2eduration */])) {
125
+ duration = customProperties[_DYN_DURATION /* @min:%2eduration */];
126
+ }
127
+ if (overridePageViewDuration || !isNaN(duration)) {
128
+ if (isNaN(duration)) {
129
+ // case 3
130
+ if (!customProperties) {
131
+ customProperties = {};
114
132
  }
133
+ customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;
115
134
  }
116
- // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if
117
- // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier
118
- var duration;
119
- if (!isNullOrUndefined(customProperties) &&
120
- !isNullOrUndefined(customProperties[_DYN_DURATION /* @min:%2eduration */])) {
121
- duration = customProperties[_DYN_DURATION /* @min:%2eduration */];
122
- }
123
- if (overridePageViewDuration || !isNaN(duration)) {
124
- if (isNaN(duration)) {
125
- // case 3
126
- if (!customProperties) {
127
- customProperties = {};
135
+ // case 2
136
+ appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
137
+ _flushChannels(true);
138
+ pageViewSent = true;
139
+ }
140
+ // now try to send the page view performance telemetry
141
+ var maxDurationLimit = 60000;
142
+ if (!customProperties) {
143
+ customProperties = {};
144
+ }
145
+ // Queue the event for processing
146
+ _addQueue(function () {
147
+ var processed = false;
148
+ try {
149
+ if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */]()) {
150
+ processed = true;
151
+ var pageViewPerformance = {
152
+ name: name,
153
+ uri: uri
154
+ };
155
+ pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](pageViewPerformance);
156
+ if (!pageViewPerformance.isValid && !pageViewSent) {
157
+ // If navigation timing gives invalid numbers, then go back to "override page view duration" mode.
158
+ // That's the best value we can get that makes sense.
159
+ customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;
160
+ appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
128
161
  }
129
- customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;
130
- }
131
- // case 2
132
- appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
133
- _flushChannels(true);
134
- pageViewSent = true;
135
- }
136
- // now try to send the page view performance telemetry
137
- var maxDurationLimit = 60000;
138
- if (!customProperties) {
139
- customProperties = {};
140
- }
141
- // Queue the event for processing
142
- _addQueue(function () {
143
- var processed = false;
144
- try {
145
- if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */]()) {
146
- processed = true;
147
- var pageViewPerformance = {
148
- name: name,
149
- uri: uri
150
- };
151
- pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](pageViewPerformance);
152
- if (!pageViewPerformance.isValid && !pageViewSent) {
153
- // If navigation timing gives invalid numbers, then go back to "override page view duration" mode.
154
- // That's the best value we can get that makes sense.
155
- customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;
162
+ else {
163
+ if (!pageViewSent) {
164
+ customProperties[_DYN_DURATION /* @min:%2eduration */] = pageViewPerformance.durationMs;
156
165
  appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
157
166
  }
158
- else {
159
- if (!pageViewSent) {
160
- customProperties[_DYN_DURATION /* @min:%2eduration */] = pageViewPerformance.durationMs;
161
- appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
162
- }
163
- if (!pageViewPerformanceSent) {
164
- appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](pageViewPerformance, customProperties);
165
- pageViewPerformanceSent = true;
166
- }
167
+ if (!pageViewPerformanceSent) {
168
+ appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](pageViewPerformance, customProperties);
169
+ pageViewPerformanceSent = true;
167
170
  }
168
171
  }
169
- else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) {
170
- // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry
171
- // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready
172
- processed = true;
173
- if (!pageViewSent) {
174
- customProperties[_DYN_DURATION /* @min:%2eduration */] = maxDurationLimit;
175
- appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
176
- }
172
+ }
173
+ else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) {
174
+ // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry
175
+ // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready
176
+ processed = true;
177
+ if (!pageViewSent) {
178
+ customProperties[_DYN_DURATION /* @min:%2eduration */] = maxDurationLimit;
179
+ appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);
177
180
  }
178
181
  }
179
- catch (e) {
180
- _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 38 /* _eInternalMessageId.TrackPVFailedCalc */, "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) });
182
+ }
183
+ catch (e) {
184
+ _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 38 /* _eInternalMessageId.TrackPVFailedCalc */, "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) });
185
+ }
186
+ return processed;
187
+ });
188
+ },
189
+ _a.teardown = function (unloadCtx, unloadState) {
190
+ if (queueTimer) {
191
+ queueTimer.cancel();
192
+ queueTimer = null;
193
+ var allItems = itemQueue.slice(0);
194
+ itemQueue = [];
195
+ arrForEach(allItems, function (item) {
196
+ if (item()) {
197
+ // Item processed successfully
181
198
  }
182
- return processed;
183
199
  });
184
- };
185
- _self.teardown = function (unloadCtx, unloadState) {
186
- if (queueTimer) {
187
- queueTimer.cancel();
188
- queueTimer = null;
189
- var allItems = itemQueue.slice(0);
190
- var doFlush_1 = false;
191
- itemQueue = [];
192
- arrForEach(allItems, function (item) {
193
- if (item()) {
194
- doFlush_1 = true;
195
- }
196
- });
197
- }
198
- };
199
- });
200
- }
201
- // Removed Stub for PageViewManager.prototype.trackPageView.
202
- // Removed Stub for PageViewManager.prototype.teardown.
203
- // This is a workaround for an IE bug when using dynamicProto() with classes that don't have any
204
- // non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
205
- PageViewManager.__ieDyn=1;
206
-
207
- return PageViewManager;
208
- }());
209
- export { PageViewManager };
200
+ }
201
+ },
202
+ _a;
203
+ }
210
204
  //# sourceMappingURL=PageViewManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageViewManager.js.map","sources":["PageViewManager.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dateTimeUtilsDuration } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, arrForEach, dumpObj, fieldRedaction, getDocument, getExceptionName, getLocation, isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getPerformance, isUndefined, isWebWorker, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_CONFIG, _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_HREF, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME, _DYN_TRACK_PAGE_VIEW } from \"../../__DynamicConstants\";\r\n/**\r\n * Class encapsulates sending page views and page view performance telemetry.\r\n */\r\nvar PageViewManager = /** @class */ (function () {\r\n function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {\r\n dynamicProto(PageViewManager, this, function (_self) {\r\n var queueTimer = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var firstPageViewSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels(isAsync) {\r\n if (core) {\r\n core.flush(isAsync, function () {\r\n // Event flushed, callback added to prevent promise creation\r\n });\r\n }\r\n }\r\n function _startTimer() {\r\n if (!queueTimer) {\r\n queueTimer = scheduleTimeout((function () {\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (!item()) {\r\n // Not processed so rescheduled\r\n itemQueue.push(item);\r\n }\r\n else {\r\n doFlush = true;\r\n }\r\n });\r\n if (itemQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _startTimer();\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels(true);\r\n }\r\n }), 100);\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n _startTimer();\r\n }\r\n _self[_DYN_TRACK_PAGE_VIEW /* @min:%2etrackPageView */] = function (pageView, customProperties) {\r\n var name = pageView.name;\r\n if (isNullOrUndefined(name) || typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = pageView.name = doc && doc.title || \"\";\r\n }\r\n var uri = pageView.uri;\r\n if (isNullOrUndefined(uri) || typeof uri !== \"string\") {\r\n var location_1 = getLocation();\r\n uri = pageView.uri = location_1 && location_1[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n if (core && core[_DYN_CONFIG /* @min:%2econfig */]) {\r\n uri = pageView.uri = fieldRedaction(pageView.uri, core[_DYN_CONFIG /* @min:%2econfig */]);\r\n }\r\n if (!firstPageViewSent) {\r\n var perf = getPerformance();\r\n // Access the performance timing object\r\n var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */] && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */](\"navigation\"));\r\n // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE\r\n if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) {\r\n // Get the value of loadEventStart\r\n var loadEventStart = navigationEntries[0].loadEventStart;\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(perf.timeOrigin + loadEventStart);\r\n }\r\n else {\r\n // calculate the start time manually\r\n var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration_1);\r\n }\r\n firstPageViewSent = true;\r\n }\r\n // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user\r\n // do not provide the duration, set duration to undefined\r\n // Also this is case 4\r\n if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */]()) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n if (!isWebWorker()) {\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 25 /* _eInternalMessageId.NavigationTimingNotSupported */, \"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.\");\r\n }\r\n return;\r\n }\r\n var pageViewSent = false;\r\n var customDuration;\r\n // if the performance timing is supported by the browser, calculate the custom duration\r\n var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */]()[_DYN_NAVIGATION_START /* @min:%2enavigationStart */];\r\n if (start > 0) {\r\n customDuration = dateTimeUtilsDuration(start, +new Date);\r\n if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](customDuration)) {\r\n customDuration = undefined;\r\n }\r\n }\r\n // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if\r\n // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier\r\n var duration;\r\n if (!isNullOrUndefined(customProperties) &&\r\n !isNullOrUndefined(customProperties[_DYN_DURATION /* @min:%2eduration */])) {\r\n duration = customProperties[_DYN_DURATION /* @min:%2eduration */];\r\n }\r\n if (overridePageViewDuration || !isNaN(duration)) {\r\n if (isNaN(duration)) {\r\n // case 3\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n }\r\n // case 2\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n pageViewSent = true;\r\n }\r\n // now try to send the page view performance telemetry\r\n var maxDurationLimit = 60000;\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n // Queue the event for processing\r\n _addQueue(function () {\r\n var processed = false;\r\n try {\r\n if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */]()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](pageViewPerformance);\r\n if (!pageViewPerformance.isValid && !pageViewSent) {\r\n // If navigation timing gives invalid numbers, then go back to \"override page view duration\" mode.\r\n // That's the best value we can get that makes sense.\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = pageViewPerformance.durationMs;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) {\r\n // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry\r\n // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready\r\n processed = true;\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = maxDurationLimit;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 38 /* _eInternalMessageId.TrackPVFailedCalc */, \"trackPageView failed on page load calculation: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n return processed;\r\n });\r\n };\r\n _self.teardown = function (unloadCtx, unloadState) {\r\n if (queueTimer) {\r\n queueTimer.cancel();\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush_1 = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (item()) {\r\n doFlush_1 = true;\r\n }\r\n });\r\n }\r\n };\r\n });\r\n }\r\n /**\r\n * Currently supported cases:\r\n * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available.\r\n * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent.\r\n * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away.\r\n * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported).\r\n * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration.\r\n *\r\n * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported.\r\n */\r\n PageViewManager.prototype.trackPageView = function (pageView, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n PageViewManager.prototype.teardown = function (unloadCtx, unloadState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PageViewManager;\r\n}());\r\nexport { PageViewManager };\r\n//# sourceMappingURL=PageViewManager.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;uDAeM,CAAC;;;;;2BACoB;AAC3B;AACA;AACA"}
1
+ {"version":3,"file":"PageViewManager.js.map","sources":["PageViewManager.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _throwInternal, arrForEach, dateTimeUtilsDuration, dumpObj, fieldRedaction, getDocument, getExceptionName, getLocation, isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getPerformance, isUndefined, isWebWorker, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_CONFIG, _DYN_DURATION, _DYN_GET_ENTRIES_BY_TYPE, _DYN_GET_PERFORMANCE_TIMI16, _DYN_HREF, _DYN_IS_PERFORMANCE_TIMIN15, _DYN_IS_PERFORMANCE_TIMIN18, _DYN_LENGTH, _DYN_NAVIGATION_START, _DYN_POPULATE_PAGE_VIEW_P4, _DYN_PROPERTIES, _DYN_SEND_PAGE_VIEW_INTER2, _DYN_SEND_PAGE_VIEW_PERFO3, _DYN_SHOULD_COLLECT_DURAT17, _DYN_START_TIME, _DYN_TRACK_PAGE_VIEW } from \"../../__DynamicConstants\";\r\n/**\r\n * Factory function to create a PageViewManager instance.\r\n * @param appInsights - Internal interface to send telemetry\r\n * @param overridePageViewDuration - Whether to override page view duration\r\n * @param core - App Insights core instance\r\n * @param pageViewPerformanceManager - Page view performance manager instance\r\n * @returns A new IPageViewManager instance.\r\n * @internal\r\n */\r\nexport function createPageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {\r\n var _a;\r\n var queueTimer = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var firstPageViewSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels(isAsync) {\r\n if (core) {\r\n core.flush(isAsync, function () {\r\n // Event flushed, callback added to prevent promise creation\r\n });\r\n }\r\n }\r\n function _startTimer() {\r\n if (!queueTimer) {\r\n queueTimer = scheduleTimeout((function () {\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n var doFlush = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (!item()) {\r\n // Not processed so rescheduled\r\n itemQueue.push(item);\r\n }\r\n else {\r\n doFlush = true;\r\n }\r\n });\r\n if (itemQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n _startTimer();\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels(true);\r\n }\r\n }), 100);\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n _startTimer();\r\n }\r\n return _a = {},\r\n _a[_DYN_TRACK_PAGE_VIEW /* @min:trackPageView */] = function (pageView, customProperties) {\r\n var name = pageView.name;\r\n if (isNullOrUndefined(name) || typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = pageView.name = doc && doc.title || \"\";\r\n }\r\n var uri = pageView.uri;\r\n if (isNullOrUndefined(uri) || typeof uri !== \"string\") {\r\n var location_1 = getLocation();\r\n uri = pageView.uri = location_1 && location_1[_DYN_HREF /* @min:%2ehref */] || \"\";\r\n }\r\n if (core && core[_DYN_CONFIG /* @min:%2econfig */]) {\r\n uri = pageView.uri = fieldRedaction(pageView.uri, core[_DYN_CONFIG /* @min:%2econfig */]);\r\n }\r\n if (!firstPageViewSent) {\r\n var perf = getPerformance();\r\n // Access the performance timing object\r\n var navigationEntries = (perf && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */] && perf[_DYN_GET_ENTRIES_BY_TYPE /* @min:%2egetEntriesByType */](\"navigation\"));\r\n // Edge Case the navigation Entries may return an empty array and the timeOrigin is not supported on IE\r\n if (navigationEntries && navigationEntries[0] && !isUndefined(perf.timeOrigin)) {\r\n // Get the value of loadEventStart\r\n var loadEventStart = navigationEntries[0].loadEventStart;\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(perf.timeOrigin + loadEventStart);\r\n }\r\n else {\r\n // calculate the start time manually\r\n var duration_1 = ((customProperties || pageView[_DYN_PROPERTIES /* @min:%2eproperties */] || {})[_DYN_DURATION /* @min:%2eduration */] || 0);\r\n pageView[_DYN_START_TIME /* @min:%2estartTime */] = new Date(new Date().getTime() - duration_1);\r\n }\r\n firstPageViewSent = true;\r\n }\r\n // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user\r\n // do not provide the duration, set duration to undefined\r\n // Also this is case 4\r\n if (!pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN15 /* @min:%2eisPerformanceTimingSupported */]()) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n if (!isWebWorker()) {\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _throwInternal(_logger, 2 /* eLoggingSeverity.WARNING */, 25 /* _eInternalMessageId.NavigationTimingNotSupported */, \"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.\");\r\n }\r\n return;\r\n }\r\n var pageViewSent = false;\r\n var customDuration;\r\n // if the performance timing is supported by the browser, calculate the custom duration\r\n var start = pageViewPerformanceManager[_DYN_GET_PERFORMANCE_TIMI16 /* @min:%2egetPerformanceTiming */]()[_DYN_NAVIGATION_START /* @min:%2enavigationStart */];\r\n if (start > 0) {\r\n customDuration = dateTimeUtilsDuration(start, +new Date);\r\n if (!pageViewPerformanceManager[_DYN_SHOULD_COLLECT_DURAT17 /* @min:%2eshouldCollectDuration */](customDuration)) {\r\n customDuration = undefined;\r\n }\r\n }\r\n // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if\r\n // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier\r\n var duration;\r\n if (!isNullOrUndefined(customProperties) &&\r\n !isNullOrUndefined(customProperties[_DYN_DURATION /* @min:%2eduration */])) {\r\n duration = customProperties[_DYN_DURATION /* @min:%2eduration */];\r\n }\r\n if (overridePageViewDuration || !isNaN(duration)) {\r\n if (isNaN(duration)) {\r\n // case 3\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n }\r\n // case 2\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n _flushChannels(true);\r\n pageViewSent = true;\r\n }\r\n // now try to send the page view performance telemetry\r\n var maxDurationLimit = 60000;\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n // Queue the event for processing\r\n _addQueue(function () {\r\n var processed = false;\r\n try {\r\n if (pageViewPerformanceManager[_DYN_IS_PERFORMANCE_TIMIN18 /* @min:%2eisPerformanceTimingDataReady */]()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager[_DYN_POPULATE_PAGE_VIEW_P4 /* @min:%2epopulatePageViewPerformanceEvent */](pageViewPerformance);\r\n if (!pageViewPerformance.isValid && !pageViewSent) {\r\n // If navigation timing gives invalid numbers, then go back to \"override page view duration\" mode.\r\n // That's the best value we can get that makes sense.\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = customDuration;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = pageViewPerformance.durationMs;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights[_DYN_SEND_PAGE_VIEW_PERFO3 /* @min:%2esendPageViewPerformanceInternal */](pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (start > 0 && dateTimeUtilsDuration(start, +new Date) > maxDurationLimit) {\r\n // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry\r\n // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready\r\n processed = true;\r\n if (!pageViewSent) {\r\n customProperties[_DYN_DURATION /* @min:%2eduration */] = maxDurationLimit;\r\n appInsights[_DYN_SEND_PAGE_VIEW_INTER2 /* @min:%2esendPageViewInternal */](pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternal(_logger, 1 /* eLoggingSeverity.CRITICAL */, 38 /* _eInternalMessageId.TrackPVFailedCalc */, \"trackPageView failed on page load calculation: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n return processed;\r\n });\r\n },\r\n _a.teardown = function (unloadCtx, unloadState) {\r\n if (queueTimer) {\r\n queueTimer.cancel();\r\n queueTimer = null;\r\n var allItems = itemQueue.slice(0);\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (item()) {\r\n // Item processed successfully\r\n }\r\n });\r\n }\r\n },\r\n _a;\r\n}\r\n//# sourceMappingURL=PageViewManager.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}