gather-vue 8.6.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.
Files changed (178) hide show
  1. package/README.md +64 -0
  2. package/dist/.htaccess +1 -0
  3. package/dist/App-B7KWoHRH.js +160 -0
  4. package/dist/App-B7KWoHRH.js.gz +0 -0
  5. package/dist/App-C03tW0-W.js +405 -0
  6. package/dist/App-C03tW0-W.js.gz +0 -0
  7. package/dist/BannerExample-CRj1iMwh.js +77 -0
  8. package/dist/BannerExample-CRj1iMwh.js.gz +0 -0
  9. package/dist/BannerExample-DLN6d9M0.js +84 -0
  10. package/dist/BannerExample-DLN6d9M0.js.gz +0 -0
  11. package/dist/CallToAction-BbJ-zDFa.js +3493 -0
  12. package/dist/CallToAction-BbJ-zDFa.js.gz +0 -0
  13. package/dist/CallToAction-jAi8aaI-.js +35 -0
  14. package/dist/CallToAction-jAi8aaI-.js.gz +0 -0
  15. package/dist/Card-B1Pdd5BL.js +202 -0
  16. package/dist/Card-B1Pdd5BL.js.gz +0 -0
  17. package/dist/Card-qMo1jrfb.js +699 -0
  18. package/dist/Card-qMo1jrfb.js.gz +0 -0
  19. package/dist/CloseCardButton-CL_3xkAF.js +71 -0
  20. package/dist/CloseCardButton-CL_3xkAF.js.gz +0 -0
  21. package/dist/Editor-DXSZFkEM.js +149 -0
  22. package/dist/Editor-DXSZFkEM.js.gz +0 -0
  23. package/dist/EmailExistsView-CX1ijN0R.js +72 -0
  24. package/dist/EmailExistsView-CX1ijN0R.js.gz +0 -0
  25. package/dist/EmailInvitation-BVFicmrK.js +22 -0
  26. package/dist/EmailView-DdaSnKFq.js +84 -0
  27. package/dist/EmailView-DdaSnKFq.js.gz +0 -0
  28. package/dist/FriendBannerExample-C8QmPZyP.js +76 -0
  29. package/dist/FriendBannerExample-C8QmPZyP.js.gz +0 -0
  30. package/dist/FriendConfirmation-B-RemAoP.js +22 -0
  31. package/dist/FriendForm-CunLFX_H.js +255 -0
  32. package/dist/FriendForm-CunLFX_H.js.gz +0 -0
  33. package/dist/FriendOptIn-bp4udUYv.js +27 -0
  34. package/dist/FriendPending-cFjgyL8g.js +22 -0
  35. package/dist/FriendPitch-BhSs2eLR.js +19 -0
  36. package/dist/FriendPitch-CAS1c3Co.js +33 -0
  37. package/dist/FriendSuccess-uxEdomAY.js +22 -0
  38. package/dist/Invitations-hprUCIvW.js +27 -0
  39. package/dist/InviteRoot-Dima8d2G.js +252 -0
  40. package/dist/InviteRoot-Dima8d2G.js.gz +0 -0
  41. package/dist/LaunchButton-BQw42WVn.js +18 -0
  42. package/dist/MazBtn.1qp5aQ4N-DU0ii1Xr.js +103 -0
  43. package/dist/MazBtn.1qp5aQ4N-DU0ii1Xr.js.gz +0 -0
  44. package/dist/MazCheckbox.UAnkvAoS-pse3PCQf.js +149 -0
  45. package/dist/MazCheckbox.UAnkvAoS-pse3PCQf.js.gz +0 -0
  46. package/dist/MazIcon.B5hPzeLk-C20gse35.js +103 -0
  47. package/dist/MazIcon.B5hPzeLk-C20gse35.js.gz +0 -0
  48. package/dist/MazPhoneNumberInput-Cz50Ts4U.js +4751 -0
  49. package/dist/MazPhoneNumberInput-Cz50Ts4U.js.gz +0 -0
  50. package/dist/MazSpinner.DZT5jj-c-y1IYJMcd.js +34 -0
  51. package/dist/MazSpinner.DZT5jj-c-y1IYJMcd.js.gz +0 -0
  52. package/dist/Menu-BsKr40BO.js +21377 -0
  53. package/dist/Menu-BsKr40BO.js.gz +0 -0
  54. package/dist/Message-D4PAgcHO.js +22 -0
  55. package/dist/MessageCard-CC74qCir.js +74 -0
  56. package/dist/MessageCard-CC74qCir.js.gz +0 -0
  57. package/dist/MessageView-BKAIrwj7.js +88 -0
  58. package/dist/MessageView-BKAIrwj7.js.gz +0 -0
  59. package/dist/PendingApprovalCard-Dzs0UxBO.js +48 -0
  60. package/dist/PendingApprovalCard-Dzs0UxBO.js.gz +0 -0
  61. package/dist/PendingApprovalView-V-OUYSnK.js +33 -0
  62. package/dist/ReferralButton-CEue5qud.js +18 -0
  63. package/dist/ReferralFailedView-3Ua13t4V.js +74 -0
  64. package/dist/ReferralFailedView-3Ua13t4V.js.gz +0 -0
  65. package/dist/ReferredConfirmCard-iwgkcZCm.js +48 -0
  66. package/dist/ReferredConfirmCard-iwgkcZCm.js.gz +0 -0
  67. package/dist/ReferredConfirmView-DS1RNBwP.js +33 -0
  68. package/dist/ReferredSuccessCard-Dg-a4FYr.js +209 -0
  69. package/dist/ReferredSuccessCard-Dg-a4FYr.js.gz +0 -0
  70. package/dist/ReferredSuccessView-ChVztlUr.js +33 -0
  71. package/dist/ReferredView-7HezoVIA.js +98 -0
  72. package/dist/ReferredView-7HezoVIA.js.gz +0 -0
  73. package/dist/RewardCard-CwU2X2Yo.js +197 -0
  74. package/dist/RewardCard-CwU2X2Yo.js.gz +0 -0
  75. package/dist/Rewards-DdyEwCyy.js +27 -0
  76. package/dist/RewardsRoot-CnQfyjC6.js +198 -0
  77. package/dist/RewardsRoot-CnQfyjC6.js.gz +0 -0
  78. package/dist/Root-bUfnZpPP.js +17 -0
  79. package/dist/ShareInvitation-SAgC-8YA.js +22 -0
  80. package/dist/SignIn-CroW3mY6.js +36 -0
  81. package/dist/SignIn-CroW3mY6.js.gz +0 -0
  82. package/dist/SignIn-g32Hg2or.js +17 -0
  83. package/dist/SignInTextArea-DBRk6x09.js +17 -0
  84. package/dist/SignUpFormCard-Cail4V4M.js +287 -0
  85. package/dist/SignUpFormCard-Cail4V4M.js.gz +0 -0
  86. package/dist/SignUpView-a7LPgEeX.js +368 -0
  87. package/dist/SignUpView-a7LPgEeX.js.gz +0 -0
  88. package/dist/SignUpView-uujOX5hN.js +103 -0
  89. package/dist/SignUpView-uujOX5hN.js.gz +0 -0
  90. package/dist/SocialView-CbBZTB7Z.js +87 -0
  91. package/dist/SocialView-CbBZTB7Z.js.gz +0 -0
  92. package/dist/Stats-DtS-GXsI.js +22 -0
  93. package/dist/StatsView-fX-VznRc.js +90 -0
  94. package/dist/StatsView-fX-VznRc.js.gz +0 -0
  95. package/dist/Success-k06CZz0K.js +40 -0
  96. package/dist/Success-k06CZz0K.js.gz +0 -0
  97. package/dist/SuccessCard-C1iF1j2W.js +219 -0
  98. package/dist/SuccessCard-C1iF1j2W.js.gz +0 -0
  99. package/dist/SuccessView-CDUVkpSQ.js +77 -0
  100. package/dist/SuccessView-CDUVkpSQ.js.gz +0 -0
  101. package/dist/TextArea-DFfa9A93.js +17 -0
  102. package/dist/TextAreaCard-D_VfEHME.js +34 -0
  103. package/dist/TextAreaCard-D_VfEHME.js.gz +0 -0
  104. package/dist/UserView-DnD929IT.js +96 -0
  105. package/dist/UserView-DnD929IT.js.gz +0 -0
  106. package/dist/WhatsAppShare-B40Ouvds.js +59 -0
  107. package/dist/WhatsAppShare-B40Ouvds.js.gz +0 -0
  108. package/dist/agent-session-Xh6dZlhc.js +298 -0
  109. package/dist/agent-session-Xh6dZlhc.js.gz +0 -0
  110. package/dist/aggregate-base-C6N8Ymd5.js +830 -0
  111. package/dist/aggregate-base-C6N8Ymd5.js.gz +0 -0
  112. package/dist/bel-serializer-DMbFBZ6U.js +51 -0
  113. package/dist/bel-serializer-DMbFBZ6U.js.gz +0 -0
  114. package/dist/browser-q7cvfJ-2.js +366 -0
  115. package/dist/browser-q7cvfJ-2.js.gz +0 -0
  116. package/dist/cart.js +5 -0
  117. package/dist/cart.js.gz +0 -0
  118. package/dist/check.C9Q_W85g-DmgtOx7Q.js +30 -0
  119. package/dist/chevron-down.BkvtON3b-RNrTKYcy.js +30 -0
  120. package/dist/content-5VAQ1vQ0.js +4 -0
  121. package/dist/event-origin-BSW5uum9.js +13 -0
  122. package/dist/examples.mobile.json.tW3aL0qI-tW3aL0qI.js +4 -0
  123. package/dist/examples.mobile.json.tW3aL0qI-tW3aL0qI.js.gz +0 -0
  124. package/dist/eye-slash.BoO00xzs-CULY_lvM.js +30 -0
  125. package/dist/eye.f8zAUc30-Yr89kafZ.js +43 -0
  126. package/dist/eye.f8zAUc30-Yr89kafZ.js.gz +0 -0
  127. package/dist/favicon.ico +0 -0
  128. package/dist/first-paint-B61SrVKm.js +453 -0
  129. package/dist/first-paint-B61SrVKm.js.gz +0 -0
  130. package/dist/gather-vue.css +5 -0
  131. package/dist/gather-vue.css.gz +0 -0
  132. package/dist/gather-widget.es.js +5 -0
  133. package/dist/gather-widget.umd.js +263 -0
  134. package/dist/gather-widget.umd.js.gz +0 -0
  135. package/dist/gather_widget.css +58 -0
  136. package/dist/gather_widget.css.gz +0 -0
  137. package/dist/gather_widget.js +72 -0
  138. package/dist/gather_widget.js.gz +0 -0
  139. package/dist/iframe-BELrOJ1p.js +6 -0
  140. package/dist/index-3lvNtPTE.js +327 -0
  141. package/dist/index-3lvNtPTE.js.gz +0 -0
  142. package/dist/index-BDyGxL1x.js +255 -0
  143. package/dist/index-BDyGxL1x.js.gz +0 -0
  144. package/dist/index-BF9haAFD.js +343 -0
  145. package/dist/index-BF9haAFD.js.gz +0 -0
  146. package/dist/index-BMIST_QA.js +128 -0
  147. package/dist/index-BMIST_QA.js.gz +0 -0
  148. package/dist/index-BdWnMhAc.js +235 -0
  149. package/dist/index-BdWnMhAc.js.gz +0 -0
  150. package/dist/index-BioZsJbf.js +190 -0
  151. package/dist/index-BioZsJbf.js.gz +0 -0
  152. package/dist/index-BzOcD8v-.js +166 -0
  153. package/dist/index-BzOcD8v-.js.gz +0 -0
  154. package/dist/index-C8pB9mUQ.js +147 -0
  155. package/dist/index-C8pB9mUQ.js.gz +0 -0
  156. package/dist/index-C_ougoWd.js +426 -0
  157. package/dist/index-C_ougoWd.js.gz +0 -0
  158. package/dist/index-CoRlIGDo.js +513 -0
  159. package/dist/index-CoRlIGDo.js.gz +0 -0
  160. package/dist/index-CyWBxUBS.js +291 -0
  161. package/dist/index-CyWBxUBS.js.gz +0 -0
  162. package/dist/index-DijQHge7.js +325 -0
  163. package/dist/index-DijQHge7.js.gz +0 -0
  164. package/dist/magnifying-glass.-nBiyXot-CuA_mltt.js +30 -0
  165. package/dist/main-DPldah1M.js +40243 -0
  166. package/dist/main-DPldah1M.js.gz +0 -0
  167. package/dist/nav-timing-B-TNQpyK.js +31 -0
  168. package/dist/nav-timing-B-TNQpyK.js.gz +0 -0
  169. package/dist/no-photography.BJX8HSus-BJX8HSus.js +4 -0
  170. package/dist/no-symbol.CIgKzsrB-3PuxVsDY.js +30 -0
  171. package/dist/recorder-PHZWRV-S.js +8271 -0
  172. package/dist/recorder-PHZWRV-S.js.gz +0 -0
  173. package/dist/stylesheet-evaluator-B4P289vW.js +86 -0
  174. package/dist/stylesheet-evaluator-B4P289vW.js.gz +0 -0
  175. package/dist/time-to-first-byte-kiwh1xjs.js +29 -0
  176. package/dist/traverse-Bw4y1x4D.js +8 -0
  177. package/dist/type-check-Bp684oBR.js +6 -0
  178. package/package.json +89 -0
Binary file
@@ -0,0 +1,58 @@
1
+ .gather-panel-frame-container {
2
+ position: fixed;
3
+ border: 0;
4
+ outline: 0;
5
+ overflow: hidden;
6
+ z-index: 1;
7
+ /* box-shadow: 0 0 80px 0 rgba(0,0,0,.12); */
8
+ -webkit-animation: smileFadeSlideUp .2s ease-in!important;
9
+ animation: smileFadeSlideUp .2s ease-in!important;
10
+ }
11
+ .gather-panel-frame-container.gather-minimized {
12
+ width: 195px;
13
+ height: 50px;
14
+ background: transparent;
15
+ overflow: hidden;
16
+ border-radius: 4px;
17
+ }
18
+ .gather-panel-frame-container.gather-minimized.gather-sticky-left {
19
+ transform: rotate(-90deg);
20
+ transform-origin: bottom left;
21
+ }
22
+ .gather-panel-frame-container.gather-minimized.gather-sticky-right {
23
+ transform: rotate(90deg);
24
+ transform-origin: bottom right;
25
+ }
26
+ .gather-panel-frame-container.gather-minimized.gather-center-full {
27
+ width: auto;
28
+ border-radius: 0px;
29
+ }
30
+ .gather-panel-frame-container.gather-maximized {
31
+ height: 100%;
32
+ width: 600px;
33
+ }
34
+ .gather-panel-frame-container.gather-hidden {
35
+ display: none;
36
+ }
37
+ .gather-panel-frame-container.gather-inline {
38
+ width: 100% !important;
39
+ height: 100% !important;
40
+ position: relative;
41
+ }
42
+ .gather-panel-frame-container.gather-inline .gather-panel-ui-container {
43
+ width: 100%;
44
+ height: 100%;
45
+ }
46
+
47
+ @media only screen and (max-height: 450px), only screen and (max-width: 600px) {
48
+ .gather-panel-frame-container.gather-maximized {
49
+ border-radius: 0!important;
50
+ height: 100%!important;
51
+ max-height: 100vh!important;
52
+ top: 0!important;
53
+ right: 0!important;
54
+ left: 0!important;
55
+ width: 100% !important;
56
+ max-width: 100vw !important;
57
+ }
58
+ }
Binary file
@@ -0,0 +1,72 @@
1
+ function loadGather() {
2
+ console.log('Loading gather.......1');
3
+ if (document.createStyleSheet) {
4
+ document.createStyleSheet('https://d1zrcjopr6e3i9.cloudfront.net/gather_widget.css');
5
+ } else {
6
+ var styles = "@import url(' https://d1zrcjopr6e3i9.cloudfront.net/gather_widget.css ');";
7
+ var newSS = document.createElement('link');
8
+ newSS.rel = 'stylesheet';
9
+ newSS.href = 'data:text/css,' + escape(styles);
10
+ document.getElementsByTagName('head')[0].appendChild(newSS);
11
+ }
12
+
13
+ window.addEventListener(
14
+ 'message',
15
+ function (event) {
16
+ if (event.data.gatherMessage === 'toggleVisible') {
17
+ var container = this.document.getElementsByClassName('gather-panel-frame-container')[0];
18
+ console.log('Going to toggle!');
19
+ container.classList.toggle('gather-minimized');
20
+ container.classList.toggle('gather-maximized');
21
+
22
+ if (container.classList.contains('gather-maximized')) {
23
+ container.style.bottom = 'calc(0px)';
24
+ container.style.left = '0px';
25
+ } else if (container.classList.contains('gather-minimized')) {
26
+ container.style.bottom = '20px';
27
+ container.style.left = '20px';
28
+ }
29
+ }
30
+ if (event.data === 'toggle-gather-app') {
31
+ var launcher = this.document.getElementById('gather-launcher');
32
+ if (launcher && launcher.contentWindow) {
33
+ launcher.contentWindow.postMessage('toggle-gather-app', '*');
34
+ }
35
+ }
36
+ },
37
+ false
38
+ );
39
+
40
+ var div = document.createElement('div');
41
+ div.insertAdjacentHTML(
42
+ 'beforeend',
43
+ `<div id="gather-panel-container" class="gather-panel-ui-container" style="position: fixed; width: 0px; height: 0px; bottom: 0px; right: 0px; z-index: 2147483647;">
44
+ <div class="gather-panel-frame-container gather-minimized" style="bottom: 20px; left: 20px;">
45
+ <iframe
46
+ id="gather-launcher"
47
+ src="https://d1zrcjopr6e3i9.cloudfront.net/index.html?campaignid=${window.gather_campaignid}&accountid=${window.gather_accountid}&referralcode=${window.gather_referralcode}"
48
+ class="gather-launcher-frame"
49
+ allowTransparency="true"
50
+ style="
51
+ position: absolute;
52
+ width: 100%;
53
+ height: 100%;
54
+ border: 0;
55
+ outline: 0;
56
+ top: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ left: 0;
60
+ background: transparent;"
61
+ ></iframe>
62
+ </div>
63
+ </div>`
64
+ );
65
+ document.body.appendChild(div);
66
+ }
67
+
68
+ window.onload = function () {
69
+ setTimeout(function () {
70
+ loadGather();
71
+ }, 1000);
72
+ };
Binary file
@@ -0,0 +1,6 @@
1
+ function e(r) {
2
+ return r ? r.self !== r.top : !1;
3
+ }
4
+ export {
5
+ e as i
6
+ };
@@ -0,0 +1,327 @@
1
+ var U = Object.defineProperty;
2
+ var N = (h) => {
3
+ throw TypeError(h);
4
+ };
5
+ var x = (h, e, t) => e in h ? U(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t;
6
+ var g = (h, e, t) => x(h, typeof e != "symbol" ? e + "" : e, t), A = (h, e, t) => e.has(h) || N("Cannot " + t);
7
+ var M = (h, e, t) => (A(h, e, "read from private field"), t ? t.call(h) : e.get(h)), b = (h, e, t) => e.has(h) ? N("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(h) : e.set(h, t), y = (h, e, t, s) => (A(h, e, "write to private field"), s ? s.call(h, t) : e.set(h, t), t), u = (h, e, t) => (A(h, e, "access private method"), t);
8
+ import { aE as D, aF as m, z as H, B as E, M as C, aG as _, m as L, d, r as K } from "./main-DPldah1M.js";
9
+ import { A as P, o as B, c as j } from "./aggregate-base-C6N8Ymd5.js";
10
+ import { e as F } from "./event-origin-BSW5uum9.js";
11
+ import { a as z } from "./traverse-Bw4y1x4D.js";
12
+ class R {
13
+ constructor(e, t, s, i, n) {
14
+ this.n = e, this.s = t, this.e = s, this.o = i, this.t = n;
15
+ }
16
+ }
17
+ const V = 30 * 1e3, G = typeof E.PerformanceObserver == "function", T = {
18
+ // we find that certain events make the data too noisy to be useful
19
+ global: {
20
+ mouseup: !0,
21
+ mousedown: !0,
22
+ mousemove: !0
23
+ },
24
+ // certain events are present both in the window and in PVT metrics. PVT metrics are prefered so the window events should be ignored
25
+ window: {
26
+ load: !0,
27
+ pagehide: !0
28
+ },
29
+ // when ajax instrumentation is disabled, all XMLHttpRequest events will return with origin = xhrOriginMissing and should be ignored
30
+ xhrOriginMissing: {
31
+ ignoreAll: !0
32
+ }
33
+ }, k = {
34
+ typing: [1e3, 2e3],
35
+ scrolling: [100, 1e3],
36
+ mousing: [1e3, 2e3],
37
+ touching: [1e3, 2e3]
38
+ };
39
+ var v, c, l, p, S;
40
+ class W {
41
+ constructor(e) {
42
+ b(this, c);
43
+ g(this, "nodeCount", 0);
44
+ g(this, "trace", {});
45
+ g(this, "earliestTimeStamp", 1 / 0);
46
+ g(this, "latestTimeStamp", 0);
47
+ g(this, "prevStoredEvents", /* @__PURE__ */ new Set());
48
+ b(this, v);
49
+ b(this, S, 0);
50
+ this.parent = e;
51
+ }
52
+ /**
53
+ * Trim the collection of nodes awaiting harvest such that those seen outside a certain span of time are discarded.
54
+ * @param {number} lookbackDuration Past length of time until now for which we care about nodes, in milliseconds
55
+ * @returns {number} However many nodes were discarded after trimming.
56
+ */
57
+ trimSTNs(e) {
58
+ let t = 0;
59
+ const s = Math.max(H() - e, 0);
60
+ return Object.keys(this.trace).forEach((i) => {
61
+ const n = this.trace[i];
62
+ let r = n.findIndex((a) => s <= a.e);
63
+ r !== 0 && (r < 0 ? (r = n.length, delete this.trace[i]) : n.splice(0, r), this.nodeCount -= r, t += r);
64
+ }), t;
65
+ }
66
+ /** Used by session trace's harvester to create the payload body. */
67
+ takeSTNs() {
68
+ var i, n;
69
+ G || this.storeResources((n = (i = E.performance) == null ? void 0 : i.getEntriesByType) == null ? void 0 : n.call(i, "resource"));
70
+ const e = Object.entries(this.trace).flatMap(([r, a]) => {
71
+ if (!(r in k)) return a;
72
+ const o = this.smearEvtsByOrigin(r), f = a.sort((O, w) => O.s - w.s).reduce(o, {});
73
+ return Object.values(f).flat();
74
+ }, this), t = this.earliestTimeStamp, s = this.latestTimeStamp;
75
+ return {
76
+ stns: e,
77
+ earliestTimeStamp: t,
78
+ latestTimeStamp: s
79
+ };
80
+ }
81
+ smearEvtsByOrigin(e) {
82
+ const t = k[e][0], s = k[e][1], i = {};
83
+ return (r, a) => {
84
+ let o = r[a.o];
85
+ o || (o = r[a.o] = []);
86
+ const f = i[a.o];
87
+ return e === "scrolling" && !n(a) ? (i[a.o] = null, a.n = "scroll", o.push(a)) : f && a.s - f.s < s && f.e > a.s - t ? f.e = a.e : (i[a.o] = a, o.push(a)), r;
88
+ };
89
+ function n(r) {
90
+ return !!(r && typeof r.e == "number" && typeof r.s == "number" && r.e - r.s < 4);
91
+ }
92
+ }
93
+ storeNode(e) {
94
+ u(this, c, l).call(this) && u(this, c, p).call(this, e);
95
+ }
96
+ processPVT(e, t, s) {
97
+ this.storeTiming({
98
+ [e]: t
99
+ });
100
+ }
101
+ storeTiming(e, t = !1) {
102
+ if (e)
103
+ for (let s in e) {
104
+ let i = e[s];
105
+ const n = s.toLowerCase();
106
+ if (!(n.indexOf("size") >= 0 || n.indexOf("status") >= 0) && typeof i == "number" && i >= 0) {
107
+ if (i = Math.round(i), this.parent.timeKeeper && this.parent.timeKeeper.ready && t && (i = this.parent.timeKeeper.convertAbsoluteTimestamp(Math.floor(this.parent.timeKeeper.correctAbsoluteTimestamp(i)))), !u(this, c, l).call(this)) return;
108
+ u(this, c, p).call(this, new R(s, i, i, "document", "timing"));
109
+ }
110
+ }
111
+ }
112
+ // Tracks the events and their listener's duration on objects wrapped by wrap-events.
113
+ storeEvent(e, t, s, i) {
114
+ if (this.shouldIgnoreEvent(e, t) || !u(this, c, l).call(this) || this.prevStoredEvents.has(e)) return;
115
+ this.prevStoredEvents.add(e);
116
+ const n = new R(this.evtName(e.type), s, i, void 0, "event");
117
+ try {
118
+ n.o = F(e.target, t, this.parent.ee);
119
+ } catch {
120
+ n.o = F(null, t, this.parent.ee);
121
+ }
122
+ u(this, c, p).call(this, n);
123
+ }
124
+ shouldIgnoreEvent(e, t) {
125
+ if (e.type in T.global) return !0;
126
+ const s = F(e.target, t, this.parent.ee);
127
+ return T[s] && T[s].ignoreAll ? !0 : !!(T[s] && e.type in T[s]);
128
+ }
129
+ evtName(e) {
130
+ switch (e) {
131
+ case "keydown":
132
+ case "keyup":
133
+ case "keypress":
134
+ return "typing";
135
+ case "mousemove":
136
+ case "mouseenter":
137
+ case "mouseleave":
138
+ case "mouseover":
139
+ case "mouseout":
140
+ return "mousing";
141
+ case "scroll":
142
+ return "scrolling";
143
+ case "touchstart":
144
+ case "touchmove":
145
+ case "touchend":
146
+ case "touchcancel":
147
+ case "touchenter":
148
+ case "touchleave":
149
+ return "touching";
150
+ default:
151
+ return e;
152
+ }
153
+ }
154
+ // Tracks when the window history API specified by wrap-history is used.
155
+ storeHist(e, t, s) {
156
+ u(this, c, l).call(this) && u(this, c, p).call(this, new R("history.pushState", s, s, e, t));
157
+ }
158
+ // Processes all the PerformanceResourceTiming entries captured (by observer).
159
+ storeResources(e) {
160
+ if (!(!e || e.length === 0)) {
161
+ for (let t = 0; t < e.length; t++) {
162
+ const s = e[t];
163
+ if ((s.fetchStart | 0) <= M(this, S)) continue;
164
+ if (!u(this, c, l).call(this)) break;
165
+ const {
166
+ initiatorType: i,
167
+ fetchStart: n,
168
+ responseEnd: r,
169
+ entryType: a
170
+ } = s, {
171
+ protocol: o,
172
+ hostname: f,
173
+ port: O,
174
+ pathname: w
175
+ } = C(s.name), I = new R(i, n | 0, r | 0, "".concat(o, "://").concat(f, ":").concat(O).concat(w), a);
176
+ u(this, c, p).call(this, I);
177
+ }
178
+ y(this, S, e[e.length - 1].fetchStart | 0);
179
+ }
180
+ }
181
+ // JavascriptError (FEATURE) events pipes into ST here.
182
+ storeErrorAgg(e, t, s, i) {
183
+ e === "err" && u(this, c, l).call(this) && u(this, c, p).call(this, new R("error", i.time, i.time, s.message, s.stackHash));
184
+ }
185
+ // Ajax (FEATURE) events--XML & fetches--pipes into ST here.
186
+ storeXhrAgg(e, t, s, i) {
187
+ e === "xhr" && u(this, c, l).call(this) && u(this, c, p).call(this, new R("Ajax", i.time, i.time + i.duration, "".concat(s.status, " ").concat(s.method, ": ").concat(s.host).concat(s.pathname), "ajax"));
188
+ }
189
+ /* Below are the interface expected & required of whatever storage is used across all features on an individual basis. This allows a common `.events` property on Trace shared with AggregateBase.
190
+ Note that the usage must be in sync with the EventStoreManager class such that AggregateBase.makeHarvestPayload can run the same regardless of which storage class a feature is using. */
191
+ isEmpty() {
192
+ return this.nodeCount === 0;
193
+ }
194
+ save() {
195
+ y(this, v, this.trace);
196
+ }
197
+ get() {
198
+ return [{
199
+ targetApp: this.parent.agentRef.runtime.entityManager.get(),
200
+ data: this.takeSTNs()
201
+ }];
202
+ }
203
+ clear() {
204
+ this.trace = {}, this.nodeCount = 0, this.prevStoredEvents.clear(), this.earliestTimeStamp = 1 / 0, this.latestTimeStamp = 0;
205
+ }
206
+ reloadSave() {
207
+ for (const e of Object.values(M(this, v)))
208
+ for (const t of e) {
209
+ if (!u(this, c, l).call(this)) return;
210
+ u(this, c, p).call(this, t);
211
+ }
212
+ }
213
+ clearSave() {
214
+ y(this, v, void 0);
215
+ }
216
+ }
217
+ v = new WeakMap(), c = new WeakSet(), l = function() {
218
+ return !(this.parent.blocked || this.nodeCount >= D && (this.parent.mode !== m.ERROR || this.trimSTNs(V) === 0));
219
+ }, /** Central internal function called by all the other store__ & addToTrace API to append a trace node. They MUST all have checked #canStoreNewNode before calling this func!! */
220
+ p = function(e) {
221
+ this.trace[e.n] ? this.trace[e.n].push(e) : this.trace[e.n] = [e], e.s < this.earliestTimeStamp && (this.earliestTimeStamp = e.s), e.s > this.latestTimeStamp && (this.latestTimeStamp = e.s), this.nodeCount++;
222
+ }, S = new WeakMap();
223
+ const X = 30 * 1e3, q = 5e3;
224
+ class Q extends P {
225
+ constructor(e) {
226
+ super(e, _), this.harvestOpts.raw = !0, this.entitled = void 0, this.everHarvested = !1, this.harvesting = !1, this.events = new W(this), this.waitForFlags(["sts", "st"]).then(([t, s]) => this.initialize(t, s));
227
+ }
228
+ /** Sets up event listeners, and initializes this module to run in the correct "mode". Can be triggered from a few places, but makes an effort to only set up listeners once */
229
+ initialize(e, t, s) {
230
+ var i, n, r, a;
231
+ if (this.entitled ?? (this.entitled = t), this.entitled || (this.blocked = !0), this.blocked) return this.deregisterDrain();
232
+ if (this.initialized || (this.initialized = !0, this.ptid = this.agentRef.runtime.ptid, this.sessionId = (i = this.agentRef.runtime.session) == null ? void 0 : i.state.value, this.ee.on(L.RESET, () => {
233
+ this.blocked || this.abort(1);
234
+ }), this.ee.on(L.UPDATE, (o, f) => {
235
+ this.blocked || (this.mode !== m.FULL && (f.sessionReplayMode === m.FULL || f.sessionTraceMode === m.FULL) && this.switchToFull(), (this.sessionId !== f.value || o === "cross-tab" && f.sessionTraceMode === m.OFF) && this.abort(2));
236
+ }), typeof PerformanceNavigationTiming < "u" ? this.events.storeTiming((r = (n = E.performance) == null ? void 0 : n.getEntriesByType) == null ? void 0 : r.call(n, "navigation")[0]) : this.events.storeTiming((a = E.performance) == null ? void 0 : a.timing, !0)), !this.agentRef.runtime.session.isNew && !s ? this.mode = this.agentRef.runtime.session.state.sessionTraceMode : this.mode = e, this.mode === m.OFF) return this.deregisterDrain();
237
+ this.timeKeeper ?? (this.timeKeeper = this.agentRef.runtime.timeKeeper), d("bst", (...o) => this.events.storeEvent(...o), this.featureName, this.ee), d("bstResource", (...o) => this.events.storeResources(...o), this.featureName, this.ee), d("bstHist", (...o) => this.events.storeHist(...o), this.featureName, this.ee), d("bstXhrAgg", (...o) => this.events.storeXhrAgg(...o), this.featureName, this.ee), d("bstApi", (...o) => this.events.storeNode(...o), this.featureName, this.ee), d("trace-jserror", (...o) => this.events.storeErrorAgg(...o), this.featureName, this.ee), d("pvtAdded", (...o) => this.events.processPVT(...o), this.featureName, this.ee), this.mode !== m.FULL && d("trace-jserror", () => {
238
+ this.mode === m.ERROR && this.switchToFull();
239
+ }, this.featureName, this.ee), this.agentRef.runtime.session.write({
240
+ sessionTraceMode: this.mode
241
+ }), this.drain(), this.agentRef.runtime.harvester.triggerHarvestFor(this);
242
+ }
243
+ preHarvestChecks() {
244
+ var e;
245
+ if (!(this.blocked || this.mode !== m.FULL) && (e = this.timeKeeper) != null && e.ready && this.agentRef.runtime.session) {
246
+ if (this.sessionId !== this.agentRef.runtime.session.state.value || this.ptid !== this.agentRef.runtime.ptid) {
247
+ this.abort(3);
248
+ return;
249
+ }
250
+ return !0;
251
+ }
252
+ }
253
+ serializer({
254
+ stns: e
255
+ }) {
256
+ if (e.length)
257
+ return this.everHarvested = !0, z(e, this.obfuscator.obfuscateString.bind(this.obfuscator), "string");
258
+ }
259
+ queryStringsBuilder({
260
+ stns: e,
261
+ earliestTimeStamp: t,
262
+ latestTimeStamp: s
263
+ }) {
264
+ var o, f;
265
+ const i = !this.agentRef.runtime.session.state.traceHarvestStarted;
266
+ i && this.agentRef.runtime.session.write({
267
+ traceHarvestStarted: !0
268
+ });
269
+ const n = this.agentRef.runtime.session.state.sessionReplayMode === 1, r = this.agentRef.info.jsAttributes["enduser.id"], a = (f = (o = this.agentRef.runtime.appMetadata.agents) == null ? void 0 : o[0]) == null ? void 0 : f.entityGuid;
270
+ return {
271
+ browser_monitoring_key: this.agentRef.info.licenseKey,
272
+ type: "BrowserSessionChunk",
273
+ app_id: this.agentRef.info.applicationID,
274
+ protocol_version: "0",
275
+ timestamp: Math.floor(this.timeKeeper.correctRelativeTimestamp(t)),
276
+ attributes: B({
277
+ ...a && {
278
+ entityGuid: a
279
+ },
280
+ harvestId: "".concat(this.agentRef.runtime.session.state.value, "_").concat(this.agentRef.runtime.ptid, "_").concat(this.agentRef.runtime.harvestCount),
281
+ // this section of attributes must be controllable and stay below the query param padding limit -- see QUERY_PARAM_PADDING
282
+ // if not, data could be lost to truncation at time of sending, potentially breaking parsing / API behavior in NR1
283
+ // trace payload metadata
284
+ "trace.firstTimestamp": Math.floor(this.timeKeeper.correctRelativeTimestamp(t)),
285
+ "trace.lastTimestamp": Math.floor(this.timeKeeper.correctRelativeTimestamp(s)),
286
+ "trace.nodes": e.length,
287
+ "trace.originTimestamp": this.timeKeeper.correctedOriginTime,
288
+ // other payload metadata
289
+ agentVersion: this.agentRef.runtime.version,
290
+ ...i && {
291
+ firstSessionHarvest: i
292
+ },
293
+ ...n && {
294
+ hasReplay: n
295
+ },
296
+ ptid: "".concat(this.ptid),
297
+ session: "".concat(this.sessionId),
298
+ // customer-defined data should go last so that if it exceeds the query param padding limit it will be truncated instead of important attrs
299
+ ...r && {
300
+ "enduser.id": this.obfuscator.obfuscateString(r)
301
+ },
302
+ currentUrl: this.obfuscator.obfuscateString(j("" + location))
303
+ // The Query Param is being arbitrarily limited in length here. It is also applied when estimating the size of the payload in getPayloadSize()
304
+ }, q).substring(1)
305
+ // remove the leading '&'
306
+ };
307
+ }
308
+ /** Switch from "off" or "error" to full mode (if entitled) */
309
+ switchToFull() {
310
+ if (this.mode === m.FULL || !this.entitled || this.blocked) return;
311
+ const e = this.mode;
312
+ if (this.mode = m.FULL, this.agentRef.runtime.session.write({
313
+ sessionTraceMode: this.mode
314
+ }), e === m.OFF || !this.initialized) return this.initialize(this.mode, this.entitled);
315
+ this.initialized && (this.events.trimSTNs(X), this.agentRef.runtime.harvester.triggerHarvestFor(this));
316
+ }
317
+ /** Stop running for the remainder of the page lifecycle */
318
+ abort(e) {
319
+ K(60, e), this.blocked = !0, this.mode = m.OFF, this.agentRef.runtime.session.write({
320
+ sessionTraceMode: this.mode
321
+ }), this.events.clear();
322
+ }
323
+ }
324
+ g(Q, "featureName", _);
325
+ export {
326
+ Q as Aggregate
327
+ };
Binary file