@vouchfor/embeds 0.0.0-experiment.4ea86a2 → 0.0.0-experiment.4eb5f06

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,6 @@ declare class TrackingController implements ReactiveController {
11
11
  private _answersViewed;
12
12
  private _streamedTime;
13
13
  private _streamLatestTime;
14
- private _streamedPrevTimestamp;
15
14
  constructor(host: EmbedHost);
16
15
  private _findVouchId;
17
16
  private _createVisitor;
@@ -21,7 +20,6 @@ declare class TrackingController implements ReactiveController {
21
20
  private _handleVouchLoaded;
22
21
  private _handlePlay;
23
22
  private _handleVideoPlay;
24
- private _handleVideoSeeking;
25
23
  private _handleVideoTimeUpdate;
26
24
  private _handleVideoPause;
27
25
  hostConnected(): void;
package/dist/es/embeds.js CHANGED
@@ -48,7 +48,7 @@ const ce = (r) => new le(typeof r == "string" ? r : r + "", void 0, Wt), de = (r
48
48
  * Copyright 2017 Google LLC
49
49
  * SPDX-License-Identifier: BSD-3-Clause
50
50
  */
51
- const { is: pe, defineProperty: ue, getOwnPropertyDescriptor: _e, getOwnPropertyNames: $e, getOwnPropertySymbols: me, getPrototypeOf: fe } = Object, E = globalThis, yt = E.trustedTypes, ge = yt ? yt.emptyScript : "", rt = E.reactiveElementPolyfillSupport, k = (r, t) => r, dt = { toAttribute(r, t) {
51
+ const { is: pe, defineProperty: ue, getOwnPropertyDescriptor: _e, getOwnPropertyNames: $e, getOwnPropertySymbols: me, getPrototypeOf: fe } = Object, E = globalThis, yt = E.trustedTypes, ge = yt ? yt.emptyScript : "", rt = E.reactiveElementPolyfillSupport, I = (r, t) => r, dt = { toAttribute(r, t) {
52
52
  switch (t) {
53
53
  case Boolean:
54
54
  r = r ? ge : null;
@@ -108,15 +108,15 @@ let M = class extends HTMLElement {
108
108
  return this.elementProperties.get(t) ?? At;
109
109
  }
110
110
  static _$Ei() {
111
- if (this.hasOwnProperty(k("elementProperties")))
111
+ if (this.hasOwnProperty(I("elementProperties")))
112
112
  return;
113
113
  const t = fe(this);
114
114
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
115
115
  }
116
116
  static finalize() {
117
- if (this.hasOwnProperty(k("finalized")))
117
+ if (this.hasOwnProperty(I("finalized")))
118
118
  return;
119
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(k("properties"))) {
119
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(I("properties"))) {
120
120
  const e = this.properties, i = [...$e(e), ...me(e)];
121
121
  for (const s of i)
122
122
  this.createProperty(s, e[s]);
@@ -289,14 +289,14 @@ let M = class extends HTMLElement {
289
289
  firstUpdated(t) {
290
290
  }
291
291
  };
292
- M.elementStyles = [], M.shadowRootOptions = { mode: "open" }, M[k("elementProperties")] = /* @__PURE__ */ new Map(), M[k("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: M }), (E.reactiveElementVersions ?? (E.reactiveElementVersions = [])).push("2.0.2");
292
+ M.elementStyles = [], M.shadowRootOptions = { mode: "open" }, M[I("elementProperties")] = /* @__PURE__ */ new Map(), M[I("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: M }), (E.reactiveElementVersions ?? (E.reactiveElementVersions = [])).push("2.0.2");
293
293
  /**
294
294
  * @license
295
295
  * Copyright 2017 Google LLC
296
296
  * SPDX-License-Identifier: BSD-3-Clause
297
297
  */
298
298
  const V = globalThis, Y = V.trustedTypes, Et = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Xt = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, Kt = "?" + y, ve = `<${Kt}>`, U = document, Q = () => U.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", Jt = Array.isArray, ye = (r) => Jt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", nt = `[
299
- \f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, St = /-->/g, bt = />/g, b = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
299
+ \f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, St = />/g, S = RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
300
300
  \f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, Pt = /"/g, Ft = /^(?:script|style|textarea|title)$/i, W = Symbol.for("lit-noChange"), _ = Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), C = U.createTreeWalker(U, 129);
301
301
  function Gt(r, t) {
302
302
  if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
@@ -310,8 +310,8 @@ const Ae = (r, t) => {
310
310
  const h = r[a];
311
311
  let c, d, l = -1, p = 0;
312
312
  for (; p < h.length && (o.lastIndex = p, d = o.exec(h), d !== null); )
313
- p = o.lastIndex, o === L ? d[1] === "!--" ? o = St : d[1] !== void 0 ? o = bt : d[2] !== void 0 ? (Ft.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = b) : d[3] !== void 0 && (o = b) : o === b ? d[0] === ">" ? (o = s ?? L, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? b : d[3] === '"' ? Pt : wt) : o === Pt || o === wt ? o = b : o === St || o === bt ? o = L : (o = b, s = void 0);
314
- const u = o === b && r[a + 1].startsWith("/>") ? " " : "";
313
+ p = o.lastIndex, o === L ? d[1] === "!--" ? o = bt : d[1] !== void 0 ? o = St : d[2] !== void 0 ? (Ft.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = S) : d[3] !== void 0 && (o = S) : o === S ? d[0] === ">" ? (o = s ?? L, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? S : d[3] === '"' ? Pt : wt) : o === Pt || o === wt ? o = S : o === bt || o === St ? o = L : (o = S, s = void 0);
314
+ const u = o === S && r[a + 1].startsWith("/>") ? " " : "";
315
315
  n += o === L ? h + ve : l >= 0 ? (i.push(c), h.slice(0, l) + Xt + h.slice(l) + y + u) : h + y + (l === -2 ? a : u);
316
316
  }
317
317
  return [Gt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
@@ -332,7 +332,7 @@ let pt = class Zt {
332
332
  for (const l of s.getAttributeNames())
333
333
  if (l.endsWith(Xt)) {
334
334
  const p = d[o++], u = s.getAttribute(l).split(y), g = /([.?@])?(.*)/.exec(p);
335
- h.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? Se : g[1] === "?" ? be : g[1] === "@" ? we : it }), s.removeAttribute(l);
335
+ h.push({ type: 1, index: n, name: g[2], strings: u, ctor: g[1] === "." ? be : g[1] === "?" ? Se : g[1] === "@" ? we : it }), s.removeAttribute(l);
336
336
  } else
337
337
  l.startsWith(y) && (h.push({ type: 6, index: n }), s.removeAttribute(l));
338
338
  if (Ft.test(s.tagName)) {
@@ -486,14 +486,14 @@ let Ee = class {
486
486
  O(t) {
487
487
  t === _ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
488
488
  }
489
- }, Se = class extends it {
489
+ }, be = class extends it {
490
490
  constructor() {
491
491
  super(...arguments), this.type = 3;
492
492
  }
493
493
  O(t) {
494
494
  this.element[this.name] = t === _ ? void 0 : t;
495
495
  }
496
- }, be = class extends it {
496
+ }, Se = class extends it {
497
497
  constructor() {
498
498
  super(...arguments), this.type = 4;
499
499
  }
@@ -571,7 +571,7 @@ const Te = (r) => new Ce(typeof r == "string" ? r : r + "", void 0, te), Ue = (r
571
571
  * Copyright 2017 Google LLC
572
572
  * SPDX-License-Identifier: BSD-3-Clause
573
573
  */
574
- const { is: Re, defineProperty: xe, getOwnPropertyDescriptor: He, getOwnPropertyNames: Oe, getOwnPropertySymbols: Ne, getPrototypeOf: Me } = Object, S = globalThis, Rt = S.trustedTypes, Le = Rt ? Rt.emptyScript : "", ht = S.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
574
+ const { is: Re, defineProperty: xe, getOwnPropertyDescriptor: He, getOwnPropertyNames: Oe, getOwnPropertySymbols: Ne, getPrototypeOf: Me } = Object, b = globalThis, Rt = b.trustedTypes, Le = Rt ? Rt.emptyScript : "", ht = b.reactiveElementPolyfillSupport, D = (r, t) => r, ut = { toAttribute(r, t) {
575
575
  switch (t) {
576
576
  case Boolean:
577
577
  r = r ? Le : null;
@@ -600,7 +600,7 @@ const { is: Re, defineProperty: xe, getOwnPropertyDescriptor: He, getOwnProperty
600
600
  }
601
601
  return e;
602
602
  } }, ee = (r, t) => !Re(r, t), xt = { attribute: !0, type: String, converter: ut, reflect: !1, hasChanged: ee };
603
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), S.litPropertyMetadata ?? (S.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
603
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
604
604
  class x extends HTMLElement {
605
605
  static addInitializer(t) {
606
606
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
@@ -812,15 +812,15 @@ class x extends HTMLElement {
812
812
  firstUpdated(t) {
813
813
  }
814
814
  }
815
- x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[D("elementProperties")] = /* @__PURE__ */ new Map(), x[D("finalized")] = /* @__PURE__ */ new Map(), ht == null || ht({ ReactiveElement: x }), (S.reactiveElementVersions ?? (S.reactiveElementVersions = [])).push("2.0.2");
815
+ x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[D("elementProperties")] = /* @__PURE__ */ new Map(), x[D("finalized")] = /* @__PURE__ */ new Map(), ht == null || ht({ ReactiveElement: x }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.0.2");
816
816
  /**
817
817
  * @license
818
818
  * Copyright 2017 Google LLC
819
819
  * SPDX-License-Identifier: BSD-3-Clause
820
820
  */
821
- const z = globalThis, tt = z.trustedTypes, Ht = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ie = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, se = "?" + A, Ie = `<${se}>`, R = document, q = () => R.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", re = Array.isArray, ke = (r) => re(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", at = `[
822
- \f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ot = /-->/g, Nt = />/g, w = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
823
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Mt = /'/g, Lt = /"/g, ne = /^(?:script|style|textarea|title)$/i, Ve = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), De = Ve(1), O = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), It = /* @__PURE__ */ new WeakMap(), T = R.createTreeWalker(R, 129);
821
+ const z = globalThis, tt = z.trustedTypes, Ht = tt ? tt.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ie = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, se = "?" + A, ke = `<${se}>`, R = document, q = () => R.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", re = Array.isArray, Ie = (r) => re(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", at = `[
822
+ \f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ot = /-->/g, Nt = />/g, w = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
823
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Mt = /'/g, Lt = /"/g, ne = /^(?:script|style|textarea|title)$/i, Ve = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), De = Ve(1), O = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), kt = /* @__PURE__ */ new WeakMap(), T = R.createTreeWalker(R, 129);
824
824
  function oe(r, t) {
825
825
  if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
826
826
  throw Error("invalid template strings array");
@@ -828,14 +828,14 @@ function oe(r, t) {
828
828
  }
829
829
  const ze = (r, t) => {
830
830
  const e = r.length - 1, i = [];
831
- let s, n = t === 2 ? "<svg>" : "", o = I;
831
+ let s, n = t === 2 ? "<svg>" : "", o = k;
832
832
  for (let a = 0; a < e; a++) {
833
833
  const h = r[a];
834
834
  let c, d, l = -1, p = 0;
835
835
  for (; p < h.length && (o.lastIndex = p, d = o.exec(h), d !== null); )
836
- p = o.lastIndex, o === I ? d[1] === "!--" ? o = Ot : d[1] !== void 0 ? o = Nt : d[2] !== void 0 ? (ne.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = w) : d[3] !== void 0 && (o = w) : o === w ? d[0] === ">" ? (o = s ?? I, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? w : d[3] === '"' ? Lt : Mt) : o === Lt || o === Mt ? o = w : o === Ot || o === Nt ? o = I : (o = w, s = void 0);
836
+ p = o.lastIndex, o === k ? d[1] === "!--" ? o = Ot : d[1] !== void 0 ? o = Nt : d[2] !== void 0 ? (ne.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = w) : d[3] !== void 0 && (o = w) : o === w ? d[0] === ">" ? (o = s ?? k, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? w : d[3] === '"' ? Lt : Mt) : o === Lt || o === Mt ? o = w : o === Ot || o === Nt ? o = k : (o = w, s = void 0);
837
837
  const u = o === w && r[a + 1].startsWith("/>") ? " " : "";
838
- n += o === I ? h + Ie : l >= 0 ? (i.push(c), h.slice(0, l) + ie + h.slice(l) + A + u) : h + A + (l === -2 ? a : u);
838
+ n += o === k ? h + ke : l >= 0 ? (i.push(c), h.slice(0, l) + ie + h.slice(l) + A + u) : h + A + (l === -2 ? a : u);
839
839
  }
840
840
  return [oe(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
841
841
  };
@@ -940,7 +940,7 @@ class J {
940
940
  return this._$AB;
941
941
  }
942
942
  _$AI(t, e = this) {
943
- t = N(this, t, e), X(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : ke(t) ? this.T(t) : this._(t);
943
+ t = N(this, t, e), X(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ie(t) ? this.T(t) : this._(t);
944
944
  }
945
945
  k(t) {
946
946
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -962,8 +962,8 @@ class J {
962
962
  }
963
963
  }
964
964
  _$AC(t) {
965
- let e = It.get(t.strings);
966
- return e === void 0 && It.set(t.strings, e = new K(t)), e;
965
+ let e = kt.get(t.strings);
966
+ return e === void 0 && kt.set(t.strings, e = new K(t)), e;
967
967
  }
968
968
  T(t) {
969
969
  re(this._$AH) || (this._$AH = [], this._$AR());
@@ -1128,19 +1128,19 @@ class Fe {
1128
1128
  }), this._cleanup = [];
1129
1129
  }
1130
1130
  }
1131
- const kt = "https://d2rxhdlm2q91uk.cloudfront.net", Ge = "https://d1ix11aj5kfygl.cloudfront.net", Ze = "https://d157jlwnudd93d.cloudfront.net", Vt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", Ye = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", Qe = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ti = "http://localhost:6060/v2", ei = "https://embed-dev.vouchfor.com/v2", ii = "https://embed-staging.vouchfor.com/v2", si = "https://embed.vouchfor.com/v2";
1131
+ const It = "https://d2rxhdlm2q91uk.cloudfront.net", Ge = "https://d1ix11aj5kfygl.cloudfront.net", Ze = "https://d157jlwnudd93d.cloudfront.net", Vt = "https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev", Ye = "https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging", Qe = "https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod", ti = "http://localhost:6060/v2", ei = "https://embed-dev.vouchfor.com/v2", ii = "https://embed-staging.vouchfor.com/v2", si = "https://embed.vouchfor.com/v2";
1132
1132
  function et(r) {
1133
1133
  if (!["local", "dev", "staging", "prod"].includes(r))
1134
1134
  throw new Error(`Unknown environment: ${r}`);
1135
1135
  if (r === "local")
1136
1136
  return {
1137
- videoUrl: kt,
1137
+ videoUrl: It,
1138
1138
  publicApiUrl: Vt,
1139
1139
  embedApiUrl: ti
1140
1140
  };
1141
1141
  if (r === "dev")
1142
1142
  return {
1143
- videoUrl: kt,
1143
+ videoUrl: It,
1144
1144
  publicApiUrl: Vt,
1145
1145
  embedApiUrl: ei
1146
1146
  };
@@ -1223,10 +1223,10 @@ class ri {
1223
1223
  return this._fetching;
1224
1224
  }
1225
1225
  }
1226
- const ni = 1e4;
1226
+ const ni = 10;
1227
1227
  class oi {
1228
1228
  constructor(t) {
1229
- this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamedTime = {}, this._streamLatestTime = {}, this._streamedPrevTimestamp = {}, this._createVisitor = (e) => {
1229
+ this._tabId = void 0, this._clientId = void 0, this._visitorId = void 0, this._hasPlayed = !1, this._hasLoaded = {}, this._answersViewed = {}, this._streamedTime = {}, this._streamLatestTime = {}, this._createVisitor = (e) => {
1230
1230
  var s, n;
1231
1231
  const { publicApiUrl: i } = et(this.host.env);
1232
1232
  return (n = (s = window.localStorage) == null ? void 0 : s.setItem) == null || n.call(s, "vouch-uid-visitor", e), navigator.sendBeacon(`${i}/api/visitor`, JSON.stringify({ visitorId: e })), e;
@@ -1280,37 +1280,26 @@ class oi {
1280
1280
  n && (this._answersViewed[i] || (this._sendTrackingEvent("VOUCH_RESPONSE_VIEWED", {
1281
1281
  vouchId: n,
1282
1282
  answerId: e
1283
- }), this._answersViewed[i] = !0), this._streamedTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime, this._streamedPrevTimestamp[i] = Date.now());
1284
- }, this._handleVideoSeeking = ({ detail: { id: e, key: i } }) => {
1285
- const s = this._findVouchId();
1286
- s && (this._streamLatestTime[i] && this._sendTrackingEvent("VIDEO_STREAMED", {
1287
- vouchId: s,
1288
- answerId: e,
1289
- streamStart: this._streamedTime[i],
1290
- streamEnd: this._streamLatestTime[i]
1291
- }), delete this._streamedTime[i], delete this._streamLatestTime[i], delete this._streamedPrevTimestamp[i]);
1283
+ }), this._answersViewed[i] = !0), this._streamedTime[i] = s.currentTime, this._streamLatestTime[i] = s.currentTime);
1292
1284
  }, this._handleVideoTimeUpdate = ({ detail: { id: e, key: i, node: s } }) => {
1293
- var a, h;
1285
+ var o, a;
1294
1286
  const n = this._findVouchId();
1295
- if (!n)
1296
- return;
1297
- const o = Date.now();
1298
- s.currentTime && !s.paused && !this.host.paused && // Only fire the video seeked event when this video is the active one
1299
- e === ((h = (a = this.host.scene) == null ? void 0 : a.video) == null ? void 0 : h.id) && // Throttle the frequency that we send streamed events while playing
1300
- o - this._streamedPrevTimestamp[i] > ni && (this._sendTrackingEvent("VIDEO_STREAMED", {
1287
+ n && (s.currentTime && !s.paused && !this.host.paused && // Only fire the video seeked event when this video is the active one
1288
+ e === ((a = (o = this.host.scene) == null ? void 0 : o.video) == null ? void 0 : a.id) && // Throttle the frequency that we send streamed events while playing
1289
+ s.currentTime - this._streamedTime[i] > ni && (this._sendTrackingEvent("VIDEO_STREAMED", {
1301
1290
  vouchId: n,
1302
1291
  answerId: e,
1303
1292
  streamStart: this._streamedTime[i],
1304
1293
  streamEnd: s.currentTime
1305
- }), this._streamedTime[i] = s.currentTime, this._streamedPrevTimestamp[i] = o), this._streamLatestTime[i] = s.currentTime;
1306
- }, this._handleVideoPause = ({ detail: { id: e, key: i, node: s } }) => {
1307
- const n = this._findVouchId();
1308
- n && (s.currentTime > this._streamedTime[i] && this._sendTrackingEvent("VIDEO_STREAMED", {
1309
- vouchId: n,
1294
+ }), this._streamedTime[i] = s.currentTime), this.host.paused || (this._streamLatestTime[i] = s.currentTime));
1295
+ }, this._handleVideoPause = ({ detail: { id: e, key: i } }) => {
1296
+ const s = this._findVouchId();
1297
+ s && (this._streamLatestTime[i] > this._streamedTime[i] + 0.5 && this._sendTrackingEvent("VIDEO_STREAMED", {
1298
+ vouchId: s,
1310
1299
  answerId: e,
1311
1300
  streamStart: this._streamedTime[i],
1312
- streamEnd: s.currentTime
1313
- }), delete this._streamedTime[i], delete this._streamLatestTime[i], delete this._streamedPrevTimestamp[i]);
1301
+ streamEnd: this._streamLatestTime[i]
1302
+ }), delete this._streamedTime[i], delete this._streamLatestTime[i]);
1314
1303
  }, this.host = t, t.addController(this);
1315
1304
  }
1316
1305
  _findVouchId() {
@@ -1335,13 +1324,13 @@ class oi {
1335
1324
  }
1336
1325
  hostConnected() {
1337
1326
  requestAnimationFrame(() => {
1338
- var t, e, i, s, n;
1339
- this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:seeking", this._handleVideoSeeking), (s = this.host.mediaPlayer) == null || s.addEventListener("video:pause", this._handleVideoPause), (n = this.host.mediaPlayer) == null || n.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
1327
+ var t, e, i, s;
1328
+ this.host.addEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.addEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.addEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.addEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.addEventListener("video:timeupdate", this._handleVideoTimeUpdate);
1340
1329
  });
1341
1330
  }
1342
1331
  hostDisconnected() {
1343
- var t, e, i, s, n;
1344
- this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:seeking", this._handleVideoSeeking), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:pause", this._handleVideoPause), (n = this.host.mediaPlayer) == null || n.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
1332
+ var t, e, i, s;
1333
+ this.host.removeEventListener("vouch:loaded", this._handleVouchLoaded), (t = this.host.mediaPlayer) == null || t.removeEventListener("play", this._handlePlay), (e = this.host.mediaPlayer) == null || e.removeEventListener("video:play", this._handleVideoPlay), (i = this.host.mediaPlayer) == null || i.removeEventListener("video:pause", this._handleVideoPause), (s = this.host.mediaPlayer) == null || s.removeEventListener("video:timeupdate", this._handleVideoTimeUpdate);
1345
1334
  }
1346
1335
  }
1347
1336
  var hi = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, f = (r, t, e, i) => {