@sprig-technologies/sprig-browser 2.26.4 → 2.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-rCLyJyii.cjs → index-1NW718SB.cjs} +7 -7
- package/dist/{index-GurVf9fu.js → index-IMQ1RWe8.js} +644 -627
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.js +1 -1
- package/dist/{view-KfdScd8f.js → view-8NEFT9sC.js} +4 -3
- package/dist/{view-TTq-V8ms.cjs → view-kCdkKjUT.cjs} +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var K = (e, t, n) => (
|
|
4
|
-
var Re = /* @__PURE__ */ ((e) => (e.Closed = "close.click", e.Complete = "survey.completed", e.PageChange = "page.change", e.API = "api", e.Override = "override", e))(Re || {}),
|
|
1
|
+
var _s = Object.defineProperty;
|
|
2
|
+
var Ss = (e, t, n) => t in e ? _s(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var K = (e, t, n) => (Ss(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
var Re = /* @__PURE__ */ ((e) => (e.Closed = "close.click", e.Complete = "survey.completed", e.PageChange = "page.change", e.API = "api", e.Override = "override", e))(Re || {}), O = /* @__PURE__ */ ((e) => (e.ReplayCapture = "replay.capture", e.SDKReady = "sdk.ready", e.SurveyAppeared = "survey.appeared", e.SurveyClosed = "survey.closed", e.SurveyDimensions = "survey.dimensions", e.SurveyFadingOut = "survey.fadingOut", e.SurveyHeight = "survey.height", e.SurveyPresented = "survey.presented", e.SurveyLifeCycle = "survey.lifeCycle", e.SurveyWidth = "survey.width", e.SurveyWillClose = "survey.willClose", e.SurveyWillPresent = "survey.will.present", e.CloseSurveyOnOverlayClick = "close.survey.overlayClick", e.VisitorIDUpdated = "visitor.id.updated", e.QuestionAnswered = "question.answered", e))(O || {}), Xt = /* @__PURE__ */ ((e) => (e.SurveyId = "survey.id", e))(Xt || {});
|
|
5
5
|
const mr = {
|
|
6
6
|
// for controller
|
|
7
7
|
SDK_READY: "sdk.ready",
|
|
@@ -39,48 +39,48 @@ const mr = {
|
|
|
39
39
|
/* SurveyId */
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
var xn = /* @__PURE__ */ ((e) => (e.VerifyViewVersion = "verify.view.version", e.CurrentQuestion = "survey.question", e.ViewPrototypeClick = "question.prototype.click", e.ViewAgreementClick = "question.agreement.click", e.RecordedTaskStart = "recorded.task.start", e.RecordedTaskPermissionScreen = "recorded.task.permission.screen", e.SurveyComplete = "survey.complete", e))(xn || {}),
|
|
42
|
+
var xn = /* @__PURE__ */ ((e) => (e.VerifyViewVersion = "verify.view.version", e.CurrentQuestion = "survey.question", e.ViewPrototypeClick = "question.prototype.click", e.ViewAgreementClick = "question.agreement.click", e.RecordedTaskStart = "recorded.task.start", e.RecordedTaskPermissionScreen = "recorded.task.permission.screen", e.SurveyComplete = "survey.complete", e))(xn || {}), ci = /* @__PURE__ */ ((e) => (e.ViewVersion = "view.version", e.QuestionId = "qid", e.Props = "props", e))(ci || {});
|
|
43
43
|
let Rt;
|
|
44
|
-
const
|
|
45
|
-
function
|
|
44
|
+
const Es = new Uint8Array(16);
|
|
45
|
+
function ks() {
|
|
46
46
|
if (!Rt && (Rt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Rt))
|
|
47
47
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
48
|
-
return Rt(
|
|
48
|
+
return Rt(Es);
|
|
49
49
|
}
|
|
50
50
|
const q = [];
|
|
51
51
|
for (let e = 0; e < 256; ++e)
|
|
52
52
|
q.push((e + 256).toString(16).slice(1));
|
|
53
|
-
function
|
|
53
|
+
function Ls(e, t = 0) {
|
|
54
54
|
return q[e[t + 0]] + q[e[t + 1]] + q[e[t + 2]] + q[e[t + 3]] + "-" + q[e[t + 4]] + q[e[t + 5]] + "-" + q[e[t + 6]] + q[e[t + 7]] + "-" + q[e[t + 8]] + q[e[t + 9]] + "-" + q[e[t + 10]] + q[e[t + 11]] + q[e[t + 12]] + q[e[t + 13]] + q[e[t + 14]] + q[e[t + 15]];
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
randomUUID:
|
|
56
|
+
const Is = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Tr = {
|
|
57
|
+
randomUUID: Is
|
|
58
58
|
};
|
|
59
59
|
function nt(e, t, n) {
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
60
|
+
if (Tr.randomUUID && !t && !e)
|
|
61
|
+
return Tr.randomUUID();
|
|
62
62
|
e = e || {};
|
|
63
|
-
const r = e.random || (e.rng ||
|
|
63
|
+
const r = e.random || (e.rng || ks)();
|
|
64
64
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
|
|
65
65
|
n = n || 0;
|
|
66
66
|
for (let i = 0; i < 16; ++i)
|
|
67
67
|
t[n + i] = r[i];
|
|
68
68
|
return t;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return Ls(r);
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var Us = class extends Error {
|
|
73
73
|
constructor(e, t, n) {
|
|
74
74
|
super(
|
|
75
75
|
`Possible EventEmitter memory leak detected. ${n} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`
|
|
76
76
|
), this.emitter = e, this.type = t, this.count = n, this.name = "MaxListenersExceededWarning";
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, ui = class {
|
|
79
79
|
static listenerCount(e, t) {
|
|
80
80
|
return e.listenerCount(t);
|
|
81
81
|
}
|
|
82
82
|
constructor() {
|
|
83
|
-
this.events = /* @__PURE__ */ new Map(), this.maxListeners =
|
|
83
|
+
this.events = /* @__PURE__ */ new Map(), this.maxListeners = ui.defaultMaxListeners, this.hasWarnedAboutPotentialMemoryLeak = !1;
|
|
84
84
|
}
|
|
85
85
|
_emitInternalEvent(e, t, n) {
|
|
86
86
|
this.emit(
|
|
@@ -138,7 +138,7 @@ var Is = class extends Error {
|
|
|
138
138
|
const n = this._getListeners(e).concat(t);
|
|
139
139
|
if (this.events.set(e, n), this.maxListeners > 0 && this.listenerCount(e) > this.maxListeners && !this.hasWarnedAboutPotentialMemoryLeak) {
|
|
140
140
|
this.hasWarnedAboutPotentialMemoryLeak = !0;
|
|
141
|
-
const r = new
|
|
141
|
+
const r = new Us(
|
|
142
142
|
this,
|
|
143
143
|
e,
|
|
144
144
|
this.listenerCount(e)
|
|
@@ -202,34 +202,34 @@ var Is = class extends Error {
|
|
|
202
202
|
rawListeners(e) {
|
|
203
203
|
return this.listeners(e);
|
|
204
204
|
}
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
const R = new
|
|
205
|
+
}, di = ui;
|
|
206
|
+
di.defaultMaxListeners = 10;
|
|
207
|
+
const R = new di();
|
|
208
208
|
var ut = /* @__PURE__ */ ((e) => (e.BottomLeft = "bottomLeft", e.BottomRight = "bottomRight", e.Center = "center", e.TopLeft = "topLeft", e.TopRight = "topRight", e))(ut || {}), oe = /* @__PURE__ */ ((e) => (e.Error = "x-ul-error", e.EnvironmentID = "x-ul-environment-id", e.InstallationMethod = "x-ul-installation-method", e.PartnerAnonymousId = "x-ul-anonymous-id", e.Platform = "userleap-platform", e.PreviewMode = "x-ul-preview-mode", e.UserID = "x-ul-user-id", e.VisitorID = "x-ul-visitor-id", e))(oe || {}), dn = /* @__PURE__ */ ((e) => (e.Email = "email", e.Link = "link", e.Web = "web", e))(dn || {}), He = /* @__PURE__ */ ((e) => (e.Npm = "web-npm", e.NpmBundled = "web-npm-bundled", e.Gtm = "web-gtm", e.Segment = "web-segment", e.SegmentAndroid = "android-segment", e.SegmentReactNative = "react-native-segment", e.SegmentIOS = "ios-segment", e.Snippet = "web-snippet", e))(He || {});
|
|
209
209
|
window.UserLeap && window.Sprig && (window.Sprig._gtm ? window.Sprig = window.UserLeap : window.UserLeap = window.Sprig);
|
|
210
210
|
window.UserLeap || (window.UserLeap = window.Sprig);
|
|
211
211
|
window.Sprig || (window.Sprig = window.UserLeap);
|
|
212
|
-
const
|
|
212
|
+
const As = "rgba(255,255,255, 0.95)", xs = "rgba(0,0,0,0.9)", Ps = "360px", gn = "0px", pi = () => {
|
|
213
213
|
window.UserLeap.container = document.createElement("div"), window.UserLeap.container.className = "ul-container", document.body.appendChild(window.UserLeap.container);
|
|
214
|
-
},
|
|
215
|
-
|
|
214
|
+
}, hi = (e) => {
|
|
215
|
+
Cs();
|
|
216
216
|
const t = window.UserLeap.container;
|
|
217
217
|
if (!(!t || !t.parentNode))
|
|
218
218
|
try {
|
|
219
|
-
t.parentNode.removeChild(t), window.UserLeap.container = null, X("trackStartUrl", null), R.emit(
|
|
219
|
+
t.parentNode.removeChild(t), window.UserLeap.container = null, X("trackStartUrl", null), R.emit(O.SurveyLifeCycle, {
|
|
220
220
|
state: "dismissed"
|
|
221
|
-
}), R.emit(
|
|
222
|
-
name:
|
|
221
|
+
}), R.emit(O.SurveyClosed, {
|
|
222
|
+
name: O.SurveyClosed,
|
|
223
223
|
initiator: e
|
|
224
224
|
});
|
|
225
225
|
} catch (n) {
|
|
226
226
|
console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} ` + t), n instanceof Error && window.UserLeap.reportError("dismissActiveSurvey", n);
|
|
227
227
|
}
|
|
228
|
-
},
|
|
229
|
-
R.on(
|
|
228
|
+
}, fi = () => {
|
|
229
|
+
R.on(O.SurveyWillClose, ({
|
|
230
230
|
initiator: e
|
|
231
231
|
}) => {
|
|
232
|
-
|
|
232
|
+
hi(e);
|
|
233
233
|
});
|
|
234
234
|
}, Os = (e, t) => {
|
|
235
235
|
const r = {
|
|
@@ -246,8 +246,8 @@ const Us = "rgba(255,255,255, 0.95)", As = "rgba(0,0,0,0.9)", xs = "360px", gn =
|
|
|
246
246
|
zIndex: 2147483646
|
|
247
247
|
}
|
|
248
248
|
}, i = t ? e.overlayStyleMobile : e.overlayStyle;
|
|
249
|
-
r["background-color"] = i === "light" ?
|
|
250
|
-
},
|
|
249
|
+
r["background-color"] = i === "light" ? As : xs, t || (r.margin = "auto"), window.UserLeap.container && Object.assign(window.UserLeap.container.style, r);
|
|
250
|
+
}, Rs = (e, t, n) => {
|
|
251
251
|
var a, l;
|
|
252
252
|
const r = {
|
|
253
253
|
position: "fixed",
|
|
@@ -260,7 +260,7 @@ const Us = "rgba(255,255,255, 0.95)", As = "rgba(0,0,0,0.9)", xs = "360px", gn =
|
|
|
260
260
|
maxWidth: "100%"
|
|
261
261
|
}, i = Object.assign({}, t, window.UserLeap);
|
|
262
262
|
let s, o = !1;
|
|
263
|
-
return n ? ((a = window.UserLeap.windowDimensions) != null && a.width ? r.width = `${window.UserLeap.windowDimensions.width}px` : r.width = "100%", (l = window.UserLeap.windowDimensions) != null && l.height ? r.maxHeight = `${window.UserLeap.windowDimensions.height - 20}px` : window.UserLeap.maxHeight ? r.maxHeight = window.UserLeap.maxHeight : r.maxHeight = `${document.body.clientHeight - 20}px`, ["light", "dark"].includes(i.overlayStyleMobile) && (o = !0)) : (r.width =
|
|
263
|
+
return n ? ((a = window.UserLeap.windowDimensions) != null && a.width ? r.width = `${window.UserLeap.windowDimensions.width}px` : r.width = "100%", (l = window.UserLeap.windowDimensions) != null && l.height ? r.maxHeight = `${window.UserLeap.windowDimensions.height - 20}px` : window.UserLeap.maxHeight ? r.maxHeight = window.UserLeap.maxHeight : r.maxHeight = `${document.body.clientHeight - 20}px`, ["light", "dark"].includes(i.overlayStyleMobile) && (o = !0)) : (r.width = Ps, r.maxHeight = window.UserLeap.maxHeight || "66vh", i.framePosition === ut.BottomLeft ? s = {
|
|
264
264
|
left: gn
|
|
265
265
|
} : i.framePosition === ut.TopLeft ? s = {
|
|
266
266
|
left: gn,
|
|
@@ -271,31 +271,31 @@ const Us = "rgba(255,255,255, 0.95)", As = "rgba(0,0,0,0.9)", xs = "360px", gn =
|
|
|
271
271
|
margin: "auto",
|
|
272
272
|
position: "static"
|
|
273
273
|
}, r.maxHeight = null)), o && Os(i, n), Object.assign(e.style, r, s), o;
|
|
274
|
-
},
|
|
274
|
+
}, Ds = (e, t, n) => {
|
|
275
275
|
var u, c;
|
|
276
276
|
const r = "ul-frame";
|
|
277
|
-
|
|
277
|
+
pi(), Ts();
|
|
278
278
|
const i = document.createElement("iframe");
|
|
279
279
|
i.id = r, i.setAttribute("title", "Sprig User Feedback Dialog");
|
|
280
|
-
const s =
|
|
281
|
-
|
|
282
|
-
parseInt(i.style.height) != p && (i.style.height = `${p}px`, R.emit(
|
|
283
|
-
name:
|
|
280
|
+
const s = Rs(i, e, t);
|
|
281
|
+
fi(), i.setHeight = (p) => {
|
|
282
|
+
parseInt(i.style.height) != p && (i.style.height = `${p}px`, R.emit(O.SurveyHeight, {
|
|
283
|
+
name: O.SurveyHeight,
|
|
284
284
|
contentFrameHeight: p
|
|
285
285
|
}));
|
|
286
286
|
};
|
|
287
287
|
let o = !1;
|
|
288
288
|
i.setWidth = (p) => {
|
|
289
|
-
(parseInt(i.style.width) != p || !o) && (o = !0, i.style.width = `${p}px`, R.emit(
|
|
290
|
-
name:
|
|
289
|
+
(parseInt(i.style.width) != p || !o) && (o = !0, i.style.width = `${p}px`, R.emit(O.SurveyWidth, {
|
|
290
|
+
name: O.SurveyWidth,
|
|
291
291
|
contentFrameWidth: p
|
|
292
292
|
}));
|
|
293
293
|
}, (u = window.UserLeap.container) == null || u.appendChild(i), e && (t ? e.exitOnOverlayClickMobile : e.exitOnOverlayClick) && window.UserLeap.container && (window.UserLeap.container.onclick = () => {
|
|
294
|
-
R.emit(
|
|
295
|
-
}), R.emit(
|
|
294
|
+
R.emit(O.CloseSurveyOnOverlayClick);
|
|
295
|
+
}), R.emit(O.SurveyLifeCycle, {
|
|
296
296
|
state: "presented"
|
|
297
|
-
}), R.emit(
|
|
298
|
-
name:
|
|
297
|
+
}), R.emit(O.SurveyPresented, {
|
|
298
|
+
name: O.SurveyPresented,
|
|
299
299
|
[Xt.SurveyId]: n
|
|
300
300
|
});
|
|
301
301
|
const a = (c = i.contentWindow) == null ? void 0 : c.document;
|
|
@@ -308,22 +308,22 @@ const Us = "rgba(255,255,255, 0.95)", As = "rgba(0,0,0,0.9)", xs = "360px", gn =
|
|
|
308
308
|
hasOverlay: s,
|
|
309
309
|
iframe: i
|
|
310
310
|
};
|
|
311
|
-
},
|
|
312
|
-
[
|
|
311
|
+
}, mi = {
|
|
312
|
+
[O.SurveyFadingOut]: () => {
|
|
313
313
|
window.UserLeap.container && Object.assign(window.UserLeap.container.style, {
|
|
314
314
|
"background-color": "rgba(0,0,0,0)"
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
-
},
|
|
318
|
-
Object.entries(
|
|
317
|
+
}, Ts = () => {
|
|
318
|
+
Object.entries(mi).forEach(([e, t]) => {
|
|
319
319
|
R.on(e, t);
|
|
320
320
|
});
|
|
321
|
-
},
|
|
322
|
-
Object.entries(
|
|
321
|
+
}, Cs = () => {
|
|
322
|
+
Object.entries(mi).forEach(([e, t]) => {
|
|
323
323
|
R.off(e, t);
|
|
324
324
|
});
|
|
325
|
-
},
|
|
326
|
-
class
|
|
325
|
+
}, Bs = "!launch_darkly_";
|
|
326
|
+
class js {
|
|
327
327
|
constructor() {
|
|
328
328
|
K(this, "_ldData", {});
|
|
329
329
|
}
|
|
@@ -346,16 +346,16 @@ class Bs {
|
|
|
346
346
|
try {
|
|
347
347
|
return !t || typeof t != "object" || Array.isArray(t) ? !1 : (Object.keys(this._ldData).forEach((n) => {
|
|
348
348
|
delete this._ldData[n];
|
|
349
|
-
}), Object.keys(t).forEach((n) => this._ldData[`${
|
|
349
|
+
}), Object.keys(t).forEach((n) => this._ldData[`${Bs}${n}`] = (t[n] ?? 0) + 1), !0);
|
|
350
350
|
} catch (n) {
|
|
351
351
|
return n instanceof Error && window.UserLeap.reportError("setAllLDFlagsVariations", n), console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."), !1;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
const
|
|
356
|
-
Object.freeze(
|
|
357
|
-
const
|
|
358
|
-
class
|
|
355
|
+
const Pn = new js();
|
|
356
|
+
Object.freeze(Pn);
|
|
357
|
+
const Ns = "!optimizely_experiments_";
|
|
358
|
+
class Ks {
|
|
359
359
|
constructor() {
|
|
360
360
|
K(this, "_optimizelyData", {});
|
|
361
361
|
}
|
|
@@ -398,7 +398,7 @@ class Ns {
|
|
|
398
398
|
return this._optimizelyData[this.transformExperimentId(t)];
|
|
399
399
|
}
|
|
400
400
|
transformExperimentId(t) {
|
|
401
|
-
return
|
|
401
|
+
return Ns + t;
|
|
402
402
|
}
|
|
403
403
|
getAndSetWebOptimizelyExperiments() {
|
|
404
404
|
var t;
|
|
@@ -430,9 +430,9 @@ class Ns {
|
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
const Mt = new
|
|
433
|
+
const Mt = new Ks();
|
|
434
434
|
Object.freeze(Mt);
|
|
435
|
-
class
|
|
435
|
+
class Fs {
|
|
436
436
|
constructor(t, n) {
|
|
437
437
|
K(this, "paused");
|
|
438
438
|
K(this, "queue");
|
|
@@ -490,44 +490,44 @@ class Ks {
|
|
|
490
490
|
this.queue.length = 0;
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
var re = /* @__PURE__ */ ((e) => (e.Ready = "ready", e.NoSurvey = "no survey", e))(re || {}),
|
|
494
|
-
const
|
|
493
|
+
var re = /* @__PURE__ */ ((e) => (e.Ready = "ready", e.NoSurvey = "no survey", e))(re || {}), yi = /* @__PURE__ */ ((e) => (e.Preview = "sprigPreviewKey", e))(yi || {});
|
|
494
|
+
const Kl = "ul-app";
|
|
495
495
|
var Ne = /* @__PURE__ */ ((e) => (e.Caption = "ul-caption", e.CardContainer = "ul-card__container", e.CardMainContent = "ul-card-main-content", e.Choice = "choice", e.ChoiceCheckbox = "select-checkbox", e.ChoiceGroup = "ul-card__choices", e.ChoiceLabel = "select-label", e.ChoiceLabelContainer = "choice-label-container", e.ChoiceRadio = "select-radio", e.ChoiceTextEntryContainer = "choice-text-entry-container", e.ChoiceTextInput = "choice-text-input", e.CloseButton = "close-btn", e.CloseContainer = "close-container", e.ConsentLegalNameInput = "ul-consent-legal__name-input", e.CustomStyle = "ul-custom-style", e.DesktopSuffix = "--desktop", e.FadeInTransition = "fade-in-transition", e.LikertNumber = "likert-number", e.LikertSmiley = "likert-smiley", e.LikertStar = "likert-star", e.LoadingSpinner = "ul-loading-spinner", e.LoadingSpinnerContainer = "ul-loading-spinner-container", e.LoadingSpinnerFirst = "first", e.LoadingSpinnerFourth = "fourth", e.LoadingSpinnerSecond = "second", e.LoadingSpinnerThird = "third", e.MobileSuffix = "--mobile", e.NPSNumber = "nps-number", e.OpenTextInput = "ul-card-text__input", e.QuestionHeader = "ul-question", e.VideoCard = "ul-card--video", e.CheckmarkButton = "ul-button-checkmark", e.InactiveButton = "ul-button-inactive", e.LeftAlignButton = "ul-button-left-align", e.ButtonDisabled = "sprig-button-disabled", e.SkipButton = "ul-card-skip__button", e))(Ne || {});
|
|
496
|
-
const
|
|
497
|
-
var
|
|
498
|
-
const
|
|
496
|
+
const Fl = "#e6e6e6", Ml = "#bd282a", Ms = 500, $l = 1030;
|
|
497
|
+
var wi = /* @__PURE__ */ ((e) => (e.Video = "video", e.Audio = "audio", e.Screen = "screen", e))(wi || {}), $s = /* @__PURE__ */ ((e) => (e.PermissionStatus = "permission.status", e.AvPermission = "av.permission", e.ScreenPermission = "screen.permission", e.BeginRecording = "begin.recording", e.StartTask = "start.task", e.FinishTask = "finish.task", e))($s || {}), Vs = /* @__PURE__ */ ((e) => (e.Abandoned = "abandoned", e.GivenUp = "given.up", e.Completed = "completed", e))(Vs || {}), qs = /* @__PURE__ */ ((e) => (e.ScreenPermissionRequested = "screen.permission.requested", e.PermissionDescriptors = "permission.descriptors", e.PermissionStatusCallback = "permission.status.callback", e.StreamReadyCallback = "stream.ready.callback", e.StreamCanceledCallback = "stream.canceled.callback", e.TaskCompleteCallback = "task.complete.callback", e.TaskResponse = "task.response", e.TaskStatus = "task.status", e.RecordingMediaTypes = "recording.media.types", e.StartRecordingCallback = "start.recording.callback", e.PassthroughData = "passthrough.data", e.CurrentIndex = "current.index", e.UploadCallback = "upload.callback", e.ProgressCallback = "progress.callback", e.BeginCallback = "begin.callback", e))(qs || {}), ee = /* @__PURE__ */ ((e) => (e.Preview = "sprig.previewKey", e.Credentials = "userleap.ids", e.PageViews = "userleap.pageviews", e))(ee || {});
|
|
498
|
+
const gi = () => {
|
|
499
499
|
try {
|
|
500
500
|
return window.parent.Intercom;
|
|
501
501
|
} catch (e) {
|
|
502
502
|
return console.error(e), null;
|
|
503
503
|
}
|
|
504
|
-
},
|
|
505
|
-
const e =
|
|
504
|
+
}, Ws = () => {
|
|
505
|
+
const e = gi();
|
|
506
506
|
e && (e.ul_wasVisible && e("update", {
|
|
507
507
|
hide_default_launcher: !1
|
|
508
508
|
}), delete e.ul_wasVisible);
|
|
509
|
-
},
|
|
510
|
-
const e =
|
|
509
|
+
}, zs = () => {
|
|
510
|
+
const e = gi();
|
|
511
511
|
e && (e.ul_wasVisible = !!document.querySelector("iframe.intercom-launcher-frame"), e.ul_wasVisible && e("update", {
|
|
512
512
|
hide_default_launcher: !0
|
|
513
513
|
}));
|
|
514
|
-
},
|
|
514
|
+
}, Gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
515
515
|
__proto__: null,
|
|
516
|
-
disable:
|
|
517
|
-
enable:
|
|
518
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
519
|
-
class
|
|
516
|
+
disable: zs,
|
|
517
|
+
enable: Ws
|
|
518
|
+
}, Symbol.toStringTag, { value: "Module" })), Cr = [Gs];
|
|
519
|
+
class Hs {
|
|
520
520
|
static disable() {
|
|
521
|
-
|
|
521
|
+
Cr.forEach((t) => t.disable());
|
|
522
522
|
}
|
|
523
523
|
static enable() {
|
|
524
|
-
|
|
524
|
+
Cr.forEach((t) => t.enable());
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
const
|
|
527
|
+
const Ys = 1, Br = (e) => e instanceof HTMLElement || e instanceof SVGElement, Js = (e, t, n) => {
|
|
528
528
|
const r = e.createElement("style");
|
|
529
529
|
n && (r.nonce = n), r.textContent = t, r.id = Ne.CustomStyle, e.head.appendChild(r);
|
|
530
|
-
},
|
|
530
|
+
}, Qs = (e) => {
|
|
531
531
|
const t = e.querySelector(`.${Ne.CardContainer}`);
|
|
532
532
|
let n = 600, r = 360;
|
|
533
533
|
if (t) {
|
|
@@ -539,21 +539,21 @@ const Hs = 1, Cr = (e) => e instanceof HTMLElement || e instanceof SVGElement, Y
|
|
|
539
539
|
const l = parseFloat(i.paddingLeft) + parseFloat(i.paddingRight), u = parseFloat(i.marginLeft) + parseFloat(i.marginRight), c = parseFloat(i.borderLeftWidth) + parseFloat(i.borderRightWidth);
|
|
540
540
|
r += u + c + l;
|
|
541
541
|
}
|
|
542
|
-
return [n +
|
|
543
|
-
},
|
|
542
|
+
return [n + Ys, r];
|
|
543
|
+
}, Vl = (e) => {
|
|
544
544
|
const t = e.querySelector(`.${Ne.CardContainer}`);
|
|
545
545
|
t && (t.scrollTop = 0);
|
|
546
546
|
}, Zt = (e) => new Promise((t) => {
|
|
547
547
|
setTimeout(() => {
|
|
548
548
|
t();
|
|
549
549
|
}, e);
|
|
550
|
-
}),
|
|
550
|
+
}), Xs = ({
|
|
551
551
|
"userleap-platform": e
|
|
552
|
-
}) => e !== dn.Web,
|
|
552
|
+
}) => e !== dn.Web, ql = (e, t) => {
|
|
553
553
|
const n = t ? Ne.MobileSuffix : Ne.DesktopSuffix;
|
|
554
554
|
return [e + n, e];
|
|
555
|
-
},
|
|
556
|
-
class
|
|
555
|
+
}, Wl = (e, t) => [e, `${e}__${t}`];
|
|
556
|
+
class vi {
|
|
557
557
|
constructor(t) {
|
|
558
558
|
K(this, "storage");
|
|
559
559
|
K(this, "tempStorage", {});
|
|
@@ -581,12 +581,12 @@ class gi {
|
|
|
581
581
|
this.isStorageAvailable ? this.storage.clear() : this.tempStorage = {};
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
const ke = new
|
|
585
|
-
var
|
|
586
|
-
function
|
|
584
|
+
const ke = new vi("sessionStorage"), Z = new vi("localStorage");
|
|
585
|
+
var Zs = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
586
|
+
function eo(e) {
|
|
587
587
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function zl(e) {
|
|
590
590
|
if (e.__esModule)
|
|
591
591
|
return e;
|
|
592
592
|
var t = e.default;
|
|
@@ -607,11 +607,11 @@ function Wl(e) {
|
|
|
607
607
|
});
|
|
608
608
|
}), n;
|
|
609
609
|
}
|
|
610
|
-
var
|
|
610
|
+
var bi = { exports: {} };
|
|
611
611
|
(function(e, t) {
|
|
612
612
|
(function(n, r) {
|
|
613
613
|
e.exports = r();
|
|
614
|
-
})(
|
|
614
|
+
})(Zs, function() {
|
|
615
615
|
var n = function(s, o) {
|
|
616
616
|
if (o = o || {}, typeof s != "function")
|
|
617
617
|
throw new i("fetch must be a function");
|
|
@@ -694,65 +694,65 @@ var vi = { exports: {} };
|
|
|
694
694
|
}
|
|
695
695
|
return n;
|
|
696
696
|
});
|
|
697
|
-
})(
|
|
698
|
-
var
|
|
699
|
-
const
|
|
697
|
+
})(bi);
|
|
698
|
+
var to = bi.exports;
|
|
699
|
+
const _i = /* @__PURE__ */ eo(to), no = _i(fetch), rt = {
|
|
700
700
|
Error: 1,
|
|
701
701
|
Warn: 2,
|
|
702
702
|
Info: 3,
|
|
703
703
|
Debug: 4
|
|
704
704
|
};
|
|
705
|
-
let
|
|
706
|
-
const
|
|
705
|
+
let On = 1e3, en = rt.Debug, Ze = [];
|
|
706
|
+
const ro = (e) => {
|
|
707
707
|
const t = Object.entries(rt).find((n) => n[1] === e);
|
|
708
708
|
return (t == null ? void 0 : t[0]) ?? "";
|
|
709
|
-
},
|
|
709
|
+
}, io = (e) => e.toLocaleTimeString([], {
|
|
710
710
|
hour: "2-digit",
|
|
711
711
|
minute: "2-digit",
|
|
712
712
|
second: "2-digit",
|
|
713
713
|
fractionalSecondDigits: 3
|
|
714
|
-
}),
|
|
714
|
+
}), so = (e, t) => `${io(t)}:${e}`, oo = () => {
|
|
715
715
|
Ze = Ze.filter((e) => e.level <= en);
|
|
716
|
-
},
|
|
717
|
-
Ze.length >
|
|
716
|
+
}, ao = () => {
|
|
717
|
+
Ze.length > On && Ze.shift();
|
|
718
718
|
}, pn = (e, t) => {
|
|
719
719
|
e > en || (Ze.push({
|
|
720
720
|
level: e,
|
|
721
|
-
line:
|
|
722
|
-
}),
|
|
721
|
+
line: so(t, /* @__PURE__ */ new Date())
|
|
722
|
+
}), ao());
|
|
723
723
|
}, vt = (e) => {
|
|
724
724
|
pn(rt.Debug, e);
|
|
725
725
|
}, I = (e) => {
|
|
726
726
|
pn(rt.Info, e);
|
|
727
727
|
}, Rn = (e) => {
|
|
728
728
|
pn(rt.Warn, e);
|
|
729
|
-
},
|
|
729
|
+
}, Si = (e) => {
|
|
730
730
|
pn(rt.Error, e);
|
|
731
|
-
},
|
|
732
|
-
`)),
|
|
731
|
+
}, lo = () => Ze.map((e) => e.line), co = () => new TextEncoder().encode(lo().join(`
|
|
732
|
+
`)), uo = async (e) => {
|
|
733
733
|
if (!e)
|
|
734
734
|
return;
|
|
735
|
-
const t =
|
|
736
|
-
return
|
|
735
|
+
const t = co();
|
|
736
|
+
return no(e, {
|
|
737
737
|
body: t,
|
|
738
738
|
method: "PUT",
|
|
739
739
|
retries: 3,
|
|
740
740
|
retryDelay: (n) => Math.pow(2, n) * 1e3
|
|
741
741
|
});
|
|
742
|
-
},
|
|
743
|
-
e !== void 0 && (
|
|
742
|
+
}, po = (e, t) => {
|
|
743
|
+
e !== void 0 && (On = e), t !== void 0 && (en = t), vt(`Initializing logger with limit of ${On} lines and ${ro(en)} level`), oo();
|
|
744
744
|
};
|
|
745
|
-
let
|
|
746
|
-
const
|
|
745
|
+
let Ei = !0, yr = !1;
|
|
746
|
+
const ho = () => Ei = !1, fo = () => yr = !0;
|
|
747
747
|
var $e = /* @__PURE__ */ ((e) => (e.EventQueueLatency = "sdk_event_queue_latency_seconds", e.ReplayAddEventBatch = "sdk_replay_add_event_batch_seconds", e.ReplayCleanup = "sdk_replay_cleanup_seconds", e.ReplayCompression = "sdk_replay_compression_seconds", e.ReplayGetEventsBetween = "sdk_replay_get_events_between_seconds", e.ReplayFullSnapshot = "sdk_replay_snapshot_seconds", e))($e || {});
|
|
748
748
|
let dt = {}, Dn;
|
|
749
|
-
class
|
|
749
|
+
class mo {
|
|
750
750
|
constructor(t) {
|
|
751
751
|
K(this, "_values", []);
|
|
752
752
|
this.name = t;
|
|
753
753
|
}
|
|
754
754
|
report(t) {
|
|
755
|
-
if (
|
|
755
|
+
if (Ei && this._values.push({
|
|
756
756
|
time: Date.now(),
|
|
757
757
|
value: t
|
|
758
758
|
}), yr)
|
|
@@ -773,18 +773,18 @@ class fo {
|
|
|
773
773
|
return n.type === "max" ? t > n.value : n.type === "min" ? t < n.value : !1;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const yo = (e, t) => {
|
|
777
777
|
dt = {}, yr = !1, e == null || e.forEach((n) => {
|
|
778
778
|
var r;
|
|
779
779
|
n.metric in dt || (dt[n.metric] = []), (r = dt[n.metric]) == null || r.push(n);
|
|
780
780
|
}), Dn = t;
|
|
781
781
|
}, At = {}, hn = (e) => {
|
|
782
|
-
const t = new
|
|
782
|
+
const t = new mo(e);
|
|
783
783
|
return At[e] = t, t;
|
|
784
|
-
},
|
|
784
|
+
}, wo = async (e, t) => {
|
|
785
785
|
let n = At[e];
|
|
786
786
|
n || (n = hn(e)), n.report(t);
|
|
787
|
-
},
|
|
787
|
+
}, go = async (e) => {
|
|
788
788
|
const t = Object.values(At).map((n) => ({
|
|
789
789
|
name: n.name,
|
|
790
790
|
values: n.collect()
|
|
@@ -794,24 +794,24 @@ const mo = (e, t) => {
|
|
|
794
794
|
} catch (n) {
|
|
795
795
|
Rn(`Error posting metrics: ${n}`);
|
|
796
796
|
}
|
|
797
|
-
},
|
|
797
|
+
}, vo = ({
|
|
798
798
|
reportingIntervalSeconds: e,
|
|
799
799
|
postMetrics: t
|
|
800
800
|
}) => {
|
|
801
801
|
e ? setInterval(() => {
|
|
802
|
-
|
|
803
|
-
}, e * 1e3) :
|
|
802
|
+
go(t);
|
|
803
|
+
}, e * 1e3) : ho();
|
|
804
804
|
}, Tn = (e, t) => {
|
|
805
805
|
const n = performance.now();
|
|
806
806
|
document.hidden ? setTimeout(() => Tn(e, t), e) : setTimeout(() => {
|
|
807
807
|
const r = performance.now() - n;
|
|
808
808
|
t.report(r / 1e3), setTimeout(() => Tn(e, t), e);
|
|
809
809
|
}, 0);
|
|
810
|
-
},
|
|
810
|
+
}, bo = (e = 1e3) => {
|
|
811
811
|
const t = hn($e.EventQueueLatency);
|
|
812
812
|
Tn(e, t);
|
|
813
813
|
};
|
|
814
|
-
class
|
|
814
|
+
class _o {
|
|
815
815
|
constructor(t) {
|
|
816
816
|
K(this, "payload");
|
|
817
817
|
K(this, "promise");
|
|
@@ -827,23 +827,23 @@ class bo {
|
|
|
827
827
|
this.resolve(t);
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
const
|
|
830
|
+
const So = {
|
|
831
831
|
RATELIMIT_RESET_DEFAULT: 10
|
|
832
832
|
// 10s to restart rate limit retry
|
|
833
833
|
};
|
|
834
|
-
let
|
|
835
|
-
const
|
|
834
|
+
let ki = !1, Li = "", Dt = !1, Ii = !1, $t = [];
|
|
835
|
+
const Eo = (e) => e._config && e._config.installationMethod ? e._config.installationMethod : e._gtm ? He.Gtm : e._segment ? He.Segment : He.Snippet, Cn = (e) => {
|
|
836
836
|
var t;
|
|
837
|
-
(t = e == null ? void 0 : e.blockedURI) != null && t.includes(window.UserLeap._API_URL) && (
|
|
837
|
+
(t = e == null ? void 0 : e.blockedURI) != null && t.includes(window.UserLeap._API_URL) && (Ii = !0, console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`), document.removeEventListener("securitypolicyviolation", Cn));
|
|
838
838
|
}, Bn = (e = "") => {
|
|
839
|
-
|
|
839
|
+
ki = !0, Li = e;
|
|
840
840
|
};
|
|
841
841
|
function et(e = {}) {
|
|
842
842
|
const t = {
|
|
843
843
|
"Content-Type": "application/json",
|
|
844
844
|
"userleap-platform": dn.Web,
|
|
845
|
-
"x-ul-sdk-version": "2.26.
|
|
846
|
-
[oe.InstallationMethod]:
|
|
845
|
+
"x-ul-sdk-version": "2.26.5",
|
|
846
|
+
[oe.InstallationMethod]: Eo(e)
|
|
847
847
|
};
|
|
848
848
|
if (e.envId && (t[oe.EnvironmentID] = e.envId), e.token && (t.Authorization = "Bearer " + e.token), e.userId && (t[oe.UserID] = e.userId), e.visitorId && (t[oe.VisitorID] = e.visitorId), e.partnerAnonymousId && (t[oe.PartnerAnonymousId] = e.partnerAnonymousId), e.mobileHeadersJSON) {
|
|
849
849
|
const n = JSON.parse(e.mobileHeadersJSON);
|
|
@@ -851,13 +851,13 @@ function et(e = {}) {
|
|
|
851
851
|
}
|
|
852
852
|
return e.locale && (t["accept-language"] = e.locale), window.previewMode && (t[oe.PreviewMode] = "1"), t;
|
|
853
853
|
}
|
|
854
|
-
const
|
|
854
|
+
const jr = async (e, t, n) => {
|
|
855
855
|
if (e)
|
|
856
856
|
return {
|
|
857
857
|
status: 429
|
|
858
858
|
};
|
|
859
859
|
{
|
|
860
|
-
const r = new
|
|
860
|
+
const r = new _o(n);
|
|
861
861
|
return $t.push(r), r.promise;
|
|
862
862
|
}
|
|
863
863
|
}, Ye = async (e, t, n = 0, r = !1, i = !1) => {
|
|
@@ -868,23 +868,23 @@ const Br = async (e, t, n) => {
|
|
|
868
868
|
shouldDropOnRateLimit: r
|
|
869
869
|
};
|
|
870
870
|
if (Dt && !i)
|
|
871
|
-
return
|
|
871
|
+
return jr(r, i, s);
|
|
872
872
|
const o = {
|
|
873
873
|
ok: !1,
|
|
874
874
|
reportError: !1
|
|
875
875
|
};
|
|
876
|
-
if (
|
|
877
|
-
return console.info(`UserLeap - ${
|
|
876
|
+
if (ki)
|
|
877
|
+
return console.info(`UserLeap - ${Li}`), o;
|
|
878
878
|
try {
|
|
879
879
|
t.headers = Object.assign(et(), t.headers);
|
|
880
880
|
const a = await fetch(e, t);
|
|
881
881
|
if (a.status === 429)
|
|
882
882
|
if (!Dt && !r || i) {
|
|
883
883
|
Dt = !0;
|
|
884
|
-
const u = a.headers.has("ratelimit-reset") ? Number(a.headers.get("ratelimit-reset")) :
|
|
884
|
+
const u = a.headers.has("ratelimit-reset") ? Number(a.headers.get("ratelimit-reset")) : So.RATELIMIT_RESET_DEFAULT;
|
|
885
885
|
return await Zt(u * 1e3), Ye(e, t, 0, r, !0);
|
|
886
886
|
} else
|
|
887
|
-
return
|
|
887
|
+
return jr(r, !1, s);
|
|
888
888
|
if (Dt = !1, $t.length && ($t.map((l) => {
|
|
889
889
|
const {
|
|
890
890
|
url: u,
|
|
@@ -912,14 +912,14 @@ const Br = async (e, t, n) => {
|
|
|
912
912
|
return a;
|
|
913
913
|
} catch (a) {
|
|
914
914
|
const l = n + 1;
|
|
915
|
-
return l > 5 ||
|
|
915
|
+
return l > 5 || Ii ? {
|
|
916
916
|
ok: !1,
|
|
917
917
|
reportError: !1,
|
|
918
918
|
error: a
|
|
919
919
|
} : (await Zt(Math.pow(2, n) * 1e3), Ye(e, t, l));
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
|
-
class
|
|
922
|
+
class ko {
|
|
923
923
|
constructor(t) {
|
|
924
924
|
K(this, "awaitingResolvers", []);
|
|
925
925
|
K(this, "activeCount", 0);
|
|
@@ -949,9 +949,9 @@ class Eo {
|
|
|
949
949
|
this.capacity = t;
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
const
|
|
952
|
+
const Ui = new ko(2), Lo = (e) => Ui.setLimit(e), Io = _i(fetch), Uo = async (e, t = 3) => Ui.execute(async () => {
|
|
953
953
|
I(`Beginning upload of chunk ${e.chunkIndex} for survey: ${e.surveyId}`);
|
|
954
|
-
const n = await
|
|
954
|
+
const n = await Io(e.uploadUrl, {
|
|
955
955
|
body: e.data,
|
|
956
956
|
method: "PUT",
|
|
957
957
|
retries: t,
|
|
@@ -962,7 +962,7 @@ const Ii = new Eo(2), ko = (e) => Ii.setLimit(e), Lo = bi(fetch), Io = async (e,
|
|
|
962
962
|
if (!r)
|
|
963
963
|
throw new Error(`Upload response did not include etag for upload ${e.uploadId}, part ${e.chunkIndex}`);
|
|
964
964
|
return r;
|
|
965
|
-
}),
|
|
965
|
+
}), Ai = async ({
|
|
966
966
|
apiUrl: e,
|
|
967
967
|
surveyId: t,
|
|
968
968
|
uploadId: n,
|
|
@@ -997,34 +997,34 @@ function H(e, t) {
|
|
|
997
997
|
}), e;
|
|
998
998
|
}
|
|
999
999
|
typeof Promise > "u" || j.Promise || (j.Promise = Promise);
|
|
1000
|
-
const bt = Object.getPrototypeOf,
|
|
1000
|
+
const bt = Object.getPrototypeOf, Ao = {}.hasOwnProperty;
|
|
1001
1001
|
function te(e, t) {
|
|
1002
|
-
return
|
|
1002
|
+
return Ao.call(e, t);
|
|
1003
1003
|
}
|
|
1004
1004
|
function tt(e, t) {
|
|
1005
1005
|
typeof t == "function" && (t = t(bt(e))), (typeof Reflect > "u" ? F : Reflect.ownKeys)(t).forEach((n) => {
|
|
1006
1006
|
me(e, n, t[n]);
|
|
1007
1007
|
});
|
|
1008
1008
|
}
|
|
1009
|
-
const
|
|
1009
|
+
const xi = Object.defineProperty;
|
|
1010
1010
|
function me(e, t, n, r) {
|
|
1011
|
-
|
|
1011
|
+
xi(e, t, H(n && te(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
1012
1012
|
}
|
|
1013
1013
|
function Je(e) {
|
|
1014
1014
|
return { from: function(t) {
|
|
1015
1015
|
return e.prototype = Object.create(t.prototype), me(e.prototype, "constructor", e), { extend: tt.bind(null, e.prototype) };
|
|
1016
1016
|
} };
|
|
1017
1017
|
}
|
|
1018
|
-
const
|
|
1018
|
+
const xo = Object.getOwnPropertyDescriptor;
|
|
1019
1019
|
function wr(e, t) {
|
|
1020
1020
|
let n;
|
|
1021
|
-
return
|
|
1021
|
+
return xo(e, t) || (n = bt(e)) && wr(n, t);
|
|
1022
1022
|
}
|
|
1023
|
-
const
|
|
1023
|
+
const Po = [].slice;
|
|
1024
1024
|
function tn(e, t, n) {
|
|
1025
|
-
return
|
|
1025
|
+
return Po.call(e, t, n);
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function Pi(e, t) {
|
|
1028
1028
|
return t(e);
|
|
1029
1029
|
}
|
|
1030
1030
|
function pt(e) {
|
|
@@ -1034,7 +1034,7 @@ function pt(e) {
|
|
|
1034
1034
|
function Oi(e) {
|
|
1035
1035
|
j.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
1036
1036
|
}
|
|
1037
|
-
function
|
|
1037
|
+
function Ri(e, t) {
|
|
1038
1038
|
return e.reduce((n, r, i) => {
|
|
1039
1039
|
var s = t(r, i);
|
|
1040
1040
|
return s && (n[s[0]] = s[1]), n;
|
|
@@ -1078,18 +1078,18 @@ function ie(e, t, n) {
|
|
|
1078
1078
|
n === void 0 ? z(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function Di(e) {
|
|
1082
1082
|
var t = {};
|
|
1083
1083
|
for (var n in e)
|
|
1084
1084
|
te(e, n) && (t[n] = e[n]);
|
|
1085
1085
|
return t;
|
|
1086
1086
|
}
|
|
1087
1087
|
const Oo = [].concat;
|
|
1088
|
-
function
|
|
1088
|
+
function Ti(e) {
|
|
1089
1089
|
return Oo.apply([], e);
|
|
1090
1090
|
}
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1091
|
+
const Ci = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ti([8, 16, 32, 64].map((e) => ["Int", "Uint", "Float"].map((t) => t + e + "Array")))).filter((e) => j[e]), Ro = Ci.map((e) => j[e]);
|
|
1092
|
+
Ri(Ci, (e) => [e, !0]);
|
|
1093
1093
|
let _e = null;
|
|
1094
1094
|
function xt(e) {
|
|
1095
1095
|
_e = typeof WeakMap < "u" && /* @__PURE__ */ new WeakMap();
|
|
@@ -1106,7 +1106,7 @@ function jn(e) {
|
|
|
1106
1106
|
t = [], _e && _e.set(e, t);
|
|
1107
1107
|
for (var n = 0, r = e.length; n < r; ++n)
|
|
1108
1108
|
t.push(jn(e[n]));
|
|
1109
|
-
} else if (
|
|
1109
|
+
} else if (Ro.indexOf(e.constructor) >= 0)
|
|
1110
1110
|
t = e;
|
|
1111
1111
|
else {
|
|
1112
1112
|
const s = bt(e);
|
|
@@ -1115,11 +1115,11 @@ function jn(e) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
return t;
|
|
1117
1117
|
}
|
|
1118
|
-
const { toString:
|
|
1118
|
+
const { toString: Do } = {};
|
|
1119
1119
|
function Nn(e) {
|
|
1120
|
-
return
|
|
1120
|
+
return Do.call(e).slice(8, -1);
|
|
1121
1121
|
}
|
|
1122
|
-
const Kn = typeof Symbol < "u" ? Symbol.iterator : "@@iterator",
|
|
1122
|
+
const Kn = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", To = typeof Kn == "symbol" ? function(e) {
|
|
1123
1123
|
var t;
|
|
1124
1124
|
return e != null && (t = e[Kn]) && t.apply(e);
|
|
1125
1125
|
} : function() {
|
|
@@ -1132,7 +1132,7 @@ function pe(e) {
|
|
|
1132
1132
|
return e.slice();
|
|
1133
1133
|
if (this === Ge && typeof e == "string")
|
|
1134
1134
|
return [e];
|
|
1135
|
-
if (i =
|
|
1135
|
+
if (i = To(e)) {
|
|
1136
1136
|
for (n = []; !(r = i.next()).done; )
|
|
1137
1137
|
n.push(r.value);
|
|
1138
1138
|
return n;
|
|
@@ -1152,13 +1152,13 @@ function pe(e) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
const gr = typeof Symbol < "u" ? (e) => e[Symbol.toStringTag] === "AsyncFunction" : () => !1;
|
|
1154
1154
|
var le = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
1155
|
-
function
|
|
1156
|
-
le = e,
|
|
1155
|
+
function Bi(e, t) {
|
|
1156
|
+
le = e, ji = t;
|
|
1157
1157
|
}
|
|
1158
|
-
var
|
|
1159
|
-
const
|
|
1158
|
+
var ji = () => !0;
|
|
1159
|
+
const Co = !new Error("").stack;
|
|
1160
1160
|
function Ve() {
|
|
1161
|
-
if (
|
|
1161
|
+
if (Co)
|
|
1162
1162
|
try {
|
|
1163
1163
|
throw Ve.arguments, new Error();
|
|
1164
1164
|
} catch (e) {
|
|
@@ -1170,22 +1170,22 @@ function Fn(e, t) {
|
|
|
1170
1170
|
var n = e.stack;
|
|
1171
1171
|
return n ? (t = t || 0, n.indexOf(e.name) === 0 && (t += (e.name + e.message).split(`
|
|
1172
1172
|
`).length), n.split(`
|
|
1173
|
-
`).slice(t).filter(
|
|
1173
|
+
`).slice(t).filter(ji).map((r) => `
|
|
1174
1174
|
` + r).join("")) : "";
|
|
1175
1175
|
}
|
|
1176
|
-
var
|
|
1176
|
+
var Ni = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], vr = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Ni), Bo = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
1177
1177
|
function Qe(e, t) {
|
|
1178
1178
|
this._e = Ve(), this.name = e, this.message = t;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Ki(e, t) {
|
|
1181
1181
|
return e + ". Errors: " + Object.keys(t).map((n) => t[n].toString()).filter((n, r, i) => i.indexOf(n) === r).join(`
|
|
1182
1182
|
`);
|
|
1183
1183
|
}
|
|
1184
1184
|
function nn(e, t, n, r) {
|
|
1185
|
-
this._e = Ve(), this.failures = t, this.failedKeys = r, this.successCount = n, this.message =
|
|
1185
|
+
this._e = Ve(), this.failures = t, this.failedKeys = r, this.successCount = n, this.message = Ki(e, t);
|
|
1186
1186
|
}
|
|
1187
1187
|
function ft(e, t) {
|
|
1188
|
-
this._e = Ve(), this.name = "BulkError", this.failures = Object.keys(t).map((n) => t[n]), this.failuresByPos = t, this.message =
|
|
1188
|
+
this._e = Ve(), this.name = "BulkError", this.failures = Object.keys(t).map((n) => t[n]), this.failuresByPos = t, this.message = Ki(e, t);
|
|
1189
1189
|
}
|
|
1190
1190
|
Je(Qe).from(Error).extend({ stack: { get: function() {
|
|
1191
1191
|
return this._stack || (this._stack = this.name + ": " + this.message + Fn(this._e, 2));
|
|
@@ -1193,23 +1193,23 @@ Je(Qe).from(Error).extend({ stack: { get: function() {
|
|
|
1193
1193
|
return this.name + ": " + this.message;
|
|
1194
1194
|
} }), Je(nn).from(Qe), Je(ft).from(Qe);
|
|
1195
1195
|
var br = vr.reduce((e, t) => (e[t] = t + "Error", e), {});
|
|
1196
|
-
const
|
|
1196
|
+
const jo = Qe;
|
|
1197
1197
|
var A = vr.reduce((e, t) => {
|
|
1198
1198
|
var n = t + "Error";
|
|
1199
1199
|
function r(i, s) {
|
|
1200
1200
|
this._e = Ve(), this.name = n, i ? typeof i == "string" ? (this.message = `${i}${s ? `
|
|
1201
|
-
` + s : ""}`, this.inner = s || null) : typeof i == "object" && (this.message = `${i.name} ${i.message}`, this.inner = i) : (this.message =
|
|
1201
|
+
` + s : ""}`, this.inner = s || null) : typeof i == "object" && (this.message = `${i.name} ${i.message}`, this.inner = i) : (this.message = Bo[t] || n, this.inner = null);
|
|
1202
1202
|
}
|
|
1203
|
-
return Je(r).from(
|
|
1203
|
+
return Je(r).from(jo), e[t] = r, e;
|
|
1204
1204
|
}, {});
|
|
1205
1205
|
A.Syntax = SyntaxError, A.Type = TypeError, A.Range = RangeError;
|
|
1206
|
-
var
|
|
1206
|
+
var Nr = Ni.reduce((e, t) => (e[t + "Error"] = A[t], e), {}), Vt = vr.reduce((e, t) => (["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = A[t]), e), {});
|
|
1207
1207
|
function C() {
|
|
1208
1208
|
}
|
|
1209
1209
|
function _t(e) {
|
|
1210
1210
|
return e;
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function No(e, t) {
|
|
1213
1213
|
return e == null || e === _t ? t : function(n) {
|
|
1214
1214
|
return t(e(n));
|
|
1215
1215
|
};
|
|
@@ -1219,7 +1219,7 @@ function Ke(e, t) {
|
|
|
1219
1219
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
1220
1220
|
};
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function Ko(e, t) {
|
|
1223
1223
|
return e === C ? t : function() {
|
|
1224
1224
|
var n = e.apply(this, arguments);
|
|
1225
1225
|
n !== void 0 && (arguments[0] = n);
|
|
@@ -1229,14 +1229,14 @@ function No(e, t) {
|
|
|
1229
1229
|
return r && (this.onsuccess = this.onsuccess ? Ke(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? Ke(i, this.onerror) : i), s !== void 0 ? s : n;
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function Fo(e, t) {
|
|
1233
1233
|
return e === C ? t : function() {
|
|
1234
1234
|
e.apply(this, arguments);
|
|
1235
1235
|
var n = this.onsuccess, r = this.onerror;
|
|
1236
1236
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? Ke(r, this.onerror) : r);
|
|
1237
1237
|
};
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function Mo(e, t) {
|
|
1240
1240
|
return e === C ? t : function(n) {
|
|
1241
1241
|
var r = e.apply(this, arguments);
|
|
1242
1242
|
H(n, r);
|
|
@@ -1246,7 +1246,7 @@ function Fo(e, t) {
|
|
|
1246
1246
|
return i && (this.onsuccess = this.onsuccess ? Ke(i, this.onsuccess) : i), s && (this.onerror = this.onerror ? Ke(s, this.onerror) : s), r === void 0 ? o === void 0 ? void 0 : o : H(r, o);
|
|
1247
1247
|
};
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function $o(e, t) {
|
|
1250
1250
|
return e === C ? t : function() {
|
|
1251
1251
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
1252
1252
|
};
|
|
@@ -1266,14 +1266,14 @@ function _r(e, t) {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
Vt.ModifyError = nn, Vt.DexieError = Qe, Vt.BulkError = ft;
|
|
1268
1268
|
var St = {};
|
|
1269
|
-
const
|
|
1269
|
+
const Fi = 100, [Mn, rn, $n] = typeof Promise > "u" ? [] : (() => {
|
|
1270
1270
|
let e = Promise.resolve();
|
|
1271
1271
|
if (typeof crypto > "u" || !crypto.subtle)
|
|
1272
1272
|
return [e, bt(e), e];
|
|
1273
1273
|
const t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
1274
1274
|
return [t, bt(t), e];
|
|
1275
|
-
})(),
|
|
1276
|
-
var Vn = !1,
|
|
1275
|
+
})(), Mi = rn && rn.then, qt = Mn && Mn.constructor, Sr = !!$n;
|
|
1276
|
+
var Vn = !1, Vo = $n ? () => {
|
|
1277
1277
|
$n.then(Tt);
|
|
1278
1278
|
} : j.setImmediate ? setImmediate.bind(null, Tt) : j.MutationObserver ? () => {
|
|
1279
1279
|
var e = document.createElement("div");
|
|
@@ -1283,11 +1283,11 @@ var Vn = !1, $o = $n ? () => {
|
|
|
1283
1283
|
} : () => {
|
|
1284
1284
|
setTimeout(Tt, 0);
|
|
1285
1285
|
}, mt = function(e, t) {
|
|
1286
|
-
ht.push([e, t]), sn && (
|
|
1287
|
-
}, qn = !0, sn = !0, Te = [], Wt = [], Wn = null, zn = _t, Xe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled:
|
|
1286
|
+
ht.push([e, t]), sn && (Vo(), sn = !1);
|
|
1287
|
+
}, qn = !0, sn = !0, Te = [], Wt = [], Wn = null, zn = _t, Xe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Mr, pgp: !1, env: {}, finalize: function() {
|
|
1288
1288
|
this.unhandleds.forEach((e) => {
|
|
1289
1289
|
try {
|
|
1290
|
-
|
|
1290
|
+
Mr(e[0], e[1]);
|
|
1291
1291
|
} catch {
|
|
1292
1292
|
}
|
|
1293
1293
|
});
|
|
@@ -1302,7 +1302,7 @@ function L(e) {
|
|
|
1302
1302
|
throw new TypeError("Not a function");
|
|
1303
1303
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Hn(this, this._value));
|
|
1304
1304
|
}
|
|
1305
|
-
this._state = null, this._value = null, ++t.ref,
|
|
1305
|
+
this._state = null, this._value = null, ++t.ref, Vi(this, e);
|
|
1306
1306
|
}
|
|
1307
1307
|
const Gn = { get: function() {
|
|
1308
1308
|
var e = U, t = on;
|
|
@@ -1310,9 +1310,9 @@ const Gn = { get: function() {
|
|
|
1310
1310
|
var s = !e.global && (e !== U || t !== on);
|
|
1311
1311
|
const o = s && !we();
|
|
1312
1312
|
var a = new L((l, u) => {
|
|
1313
|
-
Er(this, new
|
|
1313
|
+
Er(this, new $i(an(r, e, s, o), an(i, e, s, o), l, u, e));
|
|
1314
1314
|
});
|
|
1315
|
-
return le &&
|
|
1315
|
+
return le && zi(a, this), a;
|
|
1316
1316
|
}
|
|
1317
1317
|
return n.prototype = St, n;
|
|
1318
1318
|
}, set: function(e) {
|
|
@@ -1320,19 +1320,19 @@ const Gn = { get: function() {
|
|
|
1320
1320
|
return e;
|
|
1321
1321
|
}, set: Gn.set });
|
|
1322
1322
|
} };
|
|
1323
|
-
function
|
|
1323
|
+
function $i(e, t, n, r, i) {
|
|
1324
1324
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = i;
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1326
|
+
function Vi(e, t) {
|
|
1327
1327
|
try {
|
|
1328
1328
|
t((n) => {
|
|
1329
1329
|
if (e._state === null) {
|
|
1330
1330
|
if (n === e)
|
|
1331
1331
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
1332
|
-
var r = e._lib &&
|
|
1333
|
-
n && typeof n.then == "function" ?
|
|
1332
|
+
var r = e._lib && Pt();
|
|
1333
|
+
n && typeof n.then == "function" ? Vi(e, (i, s) => {
|
|
1334
1334
|
n instanceof L ? n._then(i, s) : n.then(i, s);
|
|
1335
|
-
}) : (e._state = !0, e._value = n,
|
|
1335
|
+
}) : (e._state = !0, e._value = n, qi(e)), r && Ot();
|
|
1336
1336
|
}
|
|
1337
1337
|
}, Hn.bind(null, e));
|
|
1338
1338
|
} catch (n) {
|
|
@@ -1341,7 +1341,7 @@ function $i(e, t) {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
function Hn(e, t) {
|
|
1343
1343
|
if (Wt.push(t), e._state === null) {
|
|
1344
|
-
var n = e._lib &&
|
|
1344
|
+
var n = e._lib && Pt();
|
|
1345
1345
|
t = zn(t), e._state = !1, e._value = t, le && t !== null && typeof t == "object" && !t._promise && function(r, i, s) {
|
|
1346
1346
|
try {
|
|
1347
1347
|
r.apply(null, s);
|
|
@@ -1353,10 +1353,10 @@ function Hn(e, t) {
|
|
|
1353
1353
|
t._promise = e, me(t, "stack", { get: () => Vn ? r && (r.get ? r.get.apply(t) : r.value) : e.stack });
|
|
1354
1354
|
}), function(r) {
|
|
1355
1355
|
Te.some((i) => i._value === r._value) || Te.push(r);
|
|
1356
|
-
}(e),
|
|
1356
|
+
}(e), qi(e), n && Ot();
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1359
|
+
function qi(e) {
|
|
1360
1360
|
var t = e._listeners;
|
|
1361
1361
|
e._listeners = [];
|
|
1362
1362
|
for (var n = 0, r = t.length; n < r; ++n)
|
|
@@ -1371,11 +1371,11 @@ function Er(e, t) {
|
|
|
1371
1371
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
1372
1372
|
if (n === null)
|
|
1373
1373
|
return (e._state ? t.resolve : t.reject)(e._value);
|
|
1374
|
-
++t.psd.ref, ++Ce, mt(
|
|
1374
|
+
++t.psd.ref, ++Ce, mt(qo, [n, e, t]);
|
|
1375
1375
|
} else
|
|
1376
1376
|
e._listeners.push(t);
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function qo(e, t, n) {
|
|
1379
1379
|
try {
|
|
1380
1380
|
Wn = t;
|
|
1381
1381
|
var r, i = t._value;
|
|
@@ -1390,7 +1390,7 @@ function Vo(e, t, n) {
|
|
|
1390
1390
|
Wn = null, --Ce == 0 && kr(), --n.psd.ref || n.psd.finalize();
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function Wi(e, t, n) {
|
|
1394
1394
|
if (t.length === n)
|
|
1395
1395
|
return t;
|
|
1396
1396
|
var r = "";
|
|
@@ -1398,20 +1398,20 @@ function qi(e, t, n) {
|
|
|
1398
1398
|
var i, s, o = e._value;
|
|
1399
1399
|
o != null ? (i = o.name || "Error", s = o.message || o, r = Fn(o, 0)) : (i = o, s = ""), t.push(i + (s ? ": " + s : "") + r);
|
|
1400
1400
|
}
|
|
1401
|
-
return le && ((r = Fn(e._stackHolder, 2)) && t.indexOf(r) === -1 && t.push(r), e._prev &&
|
|
1401
|
+
return le && ((r = Fn(e._stackHolder, 2)) && t.indexOf(r) === -1 && t.push(r), e._prev && Wi(e._prev, t, n)), t;
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function zi(e, t) {
|
|
1404
1404
|
var n = t ? t._numPrev + 1 : 0;
|
|
1405
1405
|
n < 100 && (e._prev = t, e._numPrev = n);
|
|
1406
1406
|
}
|
|
1407
1407
|
function Tt() {
|
|
1408
|
-
|
|
1408
|
+
Pt() && Ot();
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1410
|
+
function Pt() {
|
|
1411
1411
|
var e = qn;
|
|
1412
1412
|
return qn = !1, sn = !1, e;
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function Ot() {
|
|
1415
1415
|
var e, t, n;
|
|
1416
1416
|
do
|
|
1417
1417
|
for (; ht.length > 0; )
|
|
@@ -1436,18 +1436,18 @@ function Ct(e) {
|
|
|
1436
1436
|
function N(e, t) {
|
|
1437
1437
|
var n = U;
|
|
1438
1438
|
return function() {
|
|
1439
|
-
var r =
|
|
1439
|
+
var r = Pt(), i = U;
|
|
1440
1440
|
try {
|
|
1441
1441
|
return Ie(n, !0), e.apply(this, arguments);
|
|
1442
1442
|
} catch (s) {
|
|
1443
1443
|
t && t(s);
|
|
1444
1444
|
} finally {
|
|
1445
|
-
Ie(i, !1), r &&
|
|
1445
|
+
Ie(i, !1), r && Ot();
|
|
1446
1446
|
}
|
|
1447
1447
|
};
|
|
1448
1448
|
}
|
|
1449
1449
|
tt(L.prototype, { then: Gn, _then: function(e, t) {
|
|
1450
|
-
Er(this, new
|
|
1450
|
+
Er(this, new $i(null, null, e, t, U));
|
|
1451
1451
|
}, catch: function(e) {
|
|
1452
1452
|
if (arguments.length === 1)
|
|
1453
1453
|
return this.then(null, e);
|
|
@@ -1460,7 +1460,7 @@ tt(L.prototype, { then: Gn, _then: function(e, t) {
|
|
|
1460
1460
|
return this._stack;
|
|
1461
1461
|
try {
|
|
1462
1462
|
Vn = !0;
|
|
1463
|
-
var e =
|
|
1463
|
+
var e = Wi(this, [], 20).join(`
|
|
1464
1464
|
From previous: `);
|
|
1465
1465
|
return this._state !== null && (this._stack = e), e;
|
|
1466
1466
|
} finally {
|
|
@@ -1471,7 +1471,7 @@ From previous: `);
|
|
|
1471
1471
|
var i = setTimeout(() => r(new A.Timeout(t)), e);
|
|
1472
1472
|
this.then(n, r).finally(clearTimeout.bind(null, i));
|
|
1473
1473
|
}) : this;
|
|
1474
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && me(L.prototype, Symbol.toStringTag, "Dexie.Promise"), Xe.env =
|
|
1474
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && me(L.prototype, Symbol.toStringTag, "Dexie.Promise"), Xe.env = Gi(), tt(L, { all: function() {
|
|
1475
1475
|
var e = pe.apply(null, arguments).map(Bt);
|
|
1476
1476
|
return new L(function(t, n) {
|
|
1477
1477
|
e.length === 0 && t([]);
|
|
@@ -1488,7 +1488,7 @@ From previous: `);
|
|
|
1488
1488
|
e.then(n, r);
|
|
1489
1489
|
});
|
|
1490
1490
|
var t = new L(St, !0, e);
|
|
1491
|
-
return
|
|
1491
|
+
return zi(t, Wn), t;
|
|
1492
1492
|
}, reject: Ct, race: function() {
|
|
1493
1493
|
var e = pe.apply(null, arguments).map(Bt);
|
|
1494
1494
|
return new L((t, n) => {
|
|
@@ -1532,41 +1532,41 @@ From previous: `);
|
|
|
1532
1532
|
});
|
|
1533
1533
|
}));
|
|
1534
1534
|
const W = { awaits: 0, echoes: 0, id: 0 };
|
|
1535
|
-
var
|
|
1535
|
+
var Wo = 0, Gt = [], vn = 0, on = 0, zo = 0;
|
|
1536
1536
|
function Le(e, t, n, r) {
|
|
1537
1537
|
var i = U, s = Object.create(i);
|
|
1538
|
-
s.parent = i, s.ref = 0, s.global = !1, s.id = ++
|
|
1538
|
+
s.parent = i, s.ref = 0, s.global = !1, s.id = ++zo;
|
|
1539
1539
|
var o = Xe.env;
|
|
1540
|
-
s.env = Sr ? { Promise: L, PromiseProp: { value: L, configurable: !0, writable: !0 }, all: L.all, race: L.race, allSettled: L.allSettled, any: L.any, resolve: L.resolve, reject: L.reject, nthen:
|
|
1540
|
+
s.env = Sr ? { Promise: L, PromiseProp: { value: L, configurable: !0, writable: !0 }, all: L.all, race: L.race, allSettled: L.allSettled, any: L.any, resolve: L.resolve, reject: L.reject, nthen: Kr(o.nthen, s), gthen: Kr(o.gthen, s) } : {}, t && H(s, t), ++i.ref, s.finalize = function() {
|
|
1541
1541
|
--this.parent.ref || this.parent.finalize();
|
|
1542
1542
|
};
|
|
1543
1543
|
var a = st(s, e, n, r);
|
|
1544
1544
|
return s.ref === 0 && s.finalize(), a;
|
|
1545
1545
|
}
|
|
1546
1546
|
function it() {
|
|
1547
|
-
return W.id || (W.id = ++
|
|
1547
|
+
return W.id || (W.id = ++Wo), ++W.awaits, W.echoes += Fi, W.id;
|
|
1548
1548
|
}
|
|
1549
1549
|
function we() {
|
|
1550
|
-
return !!W.awaits && (--W.awaits == 0 && (W.id = 0), W.echoes = W.awaits *
|
|
1550
|
+
return !!W.awaits && (--W.awaits == 0 && (W.id = 0), W.echoes = W.awaits * Fi, !0);
|
|
1551
1551
|
}
|
|
1552
1552
|
function Bt(e) {
|
|
1553
1553
|
return W.echoes && e && e.constructor === qt ? (it(), e.then((t) => (we(), t), (t) => (we(), $(t)))) : e;
|
|
1554
1554
|
}
|
|
1555
|
-
function
|
|
1555
|
+
function Go(e) {
|
|
1556
1556
|
++on, W.echoes && --W.echoes != 0 || (W.echoes = W.id = 0), Gt.push(U), Ie(e, !0);
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function Ho() {
|
|
1559
1559
|
var e = Gt[Gt.length - 1];
|
|
1560
1560
|
Gt.pop(), Ie(e, !1);
|
|
1561
1561
|
}
|
|
1562
1562
|
function Ie(e, t) {
|
|
1563
1563
|
var n = U;
|
|
1564
|
-
if ((t ? !W.echoes || vn++ && e === U : !vn || --vn && e === U) ||
|
|
1564
|
+
if ((t ? !W.echoes || vn++ && e === U : !vn || --vn && e === U) || Hi(t ? Go.bind(null, e) : Ho), e !== U && (U = e, n === Xe && (Xe.env = Gi()), Sr)) {
|
|
1565
1565
|
var r = Xe.env.Promise, i = e.env;
|
|
1566
1566
|
rn.then = i.nthen, r.prototype.then = i.gthen, (n.global || e.global) && (Object.defineProperty(j, "Promise", i.PromiseProp), r.all = i.all, r.race = i.race, r.resolve = i.resolve, r.reject = i.reject, i.allSettled && (r.allSettled = i.allSettled), i.any && (r.any = i.any));
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1569
|
+
function Gi() {
|
|
1570
1570
|
var e = j.Promise;
|
|
1571
1571
|
return Sr ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(j, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject, nthen: rn.then, gthen: e.prototype.then } : {};
|
|
1572
1572
|
}
|
|
@@ -1578,8 +1578,8 @@ function st(e, t, n, r, i) {
|
|
|
1578
1578
|
Ie(s, !1);
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1582
|
-
|
|
1581
|
+
function Hi(e) {
|
|
1582
|
+
Mi.call(Mn, e);
|
|
1583
1583
|
}
|
|
1584
1584
|
function an(e, t, n, r) {
|
|
1585
1585
|
return typeof e != "function" ? e : function() {
|
|
@@ -1588,18 +1588,18 @@ function an(e, t, n, r) {
|
|
|
1588
1588
|
try {
|
|
1589
1589
|
return e.apply(this, arguments);
|
|
1590
1590
|
} finally {
|
|
1591
|
-
Ie(i, !1), r &&
|
|
1591
|
+
Ie(i, !1), r && Hi(we);
|
|
1592
1592
|
}
|
|
1593
1593
|
};
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1595
|
+
function Kr(e, t) {
|
|
1596
1596
|
return function(n, r) {
|
|
1597
1597
|
return e.call(this, an(n, t), an(r, t));
|
|
1598
1598
|
};
|
|
1599
1599
|
}
|
|
1600
|
-
("" +
|
|
1601
|
-
const
|
|
1602
|
-
function
|
|
1600
|
+
("" + Mi).indexOf("[native code]") === -1 && (it = we = C);
|
|
1601
|
+
const Fr = "unhandledrejection";
|
|
1602
|
+
function Mr(e, t) {
|
|
1603
1603
|
var n;
|
|
1604
1604
|
try {
|
|
1605
1605
|
n = t.onuncatched(e);
|
|
@@ -1608,7 +1608,7 @@ function Fr(e, t) {
|
|
|
1608
1608
|
if (n !== !1)
|
|
1609
1609
|
try {
|
|
1610
1610
|
var r, i = { promise: t, reason: e };
|
|
1611
|
-
if (j.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(
|
|
1611
|
+
if (j.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(Fr, !0, !0), H(r, i)) : j.CustomEvent && H(r = new CustomEvent(Fr, { detail: i }), i), r && j.dispatchEvent && (dispatchEvent(r), !j.PromiseRejectionEvent && j.onunhandledrejection))
|
|
1612
1612
|
try {
|
|
1613
1613
|
j.onunhandledrejection(r);
|
|
1614
1614
|
} catch {
|
|
@@ -1637,17 +1637,17 @@ function Yn(e, t, n, r) {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
return e._state.dbReadyPromise.then(() => Yn(e, t, n, r));
|
|
1639
1639
|
}
|
|
1640
|
-
const
|
|
1640
|
+
const $r = "3.2.4", De = "", Jn = -1 / 0, ce = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Yi = "String expected.", yt = [], fn = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Yo = fn, Jo = fn, Ji = (e) => !/(dexie\.js|dexie\.min\.js)/.test(e), mn = "__dbnames", bn = "readonly", _n = "readwrite";
|
|
1641
1641
|
function Fe(e, t) {
|
|
1642
1642
|
return e ? t ? function() {
|
|
1643
1643
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
1644
1644
|
} : e : t;
|
|
1645
1645
|
}
|
|
1646
|
-
const
|
|
1646
|
+
const Qi = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
1647
1647
|
function jt(e) {
|
|
1648
1648
|
return typeof e != "string" || /\./.test(e) ? (t) => t : (t) => (t[e] === void 0 && e in t && delete (t = xt(t))[e], t);
|
|
1649
1649
|
}
|
|
1650
|
-
class
|
|
1650
|
+
class Qo {
|
|
1651
1651
|
_trans(t, n, r) {
|
|
1652
1652
|
const i = this._tx || U.trans, s = this.name;
|
|
1653
1653
|
function o(l, u, c) {
|
|
@@ -1655,11 +1655,11 @@ class Jo {
|
|
|
1655
1655
|
throw new A.NotFound("Table " + s + " not part of transaction");
|
|
1656
1656
|
return n(c.idbtrans, c);
|
|
1657
1657
|
}
|
|
1658
|
-
const a =
|
|
1658
|
+
const a = Pt();
|
|
1659
1659
|
try {
|
|
1660
1660
|
return i && i.db === this.db ? i === U.trans ? i._promise(t, o, r) : Le(() => i._promise(t, o, r), { trans: i, transless: U.transless || U }) : Yn(this.db, t, [this.name], o);
|
|
1661
1661
|
} finally {
|
|
1662
|
-
a &&
|
|
1662
|
+
a && Ot();
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
get(t, n) {
|
|
@@ -1786,7 +1786,7 @@ class Jo {
|
|
|
1786
1786
|
return this._trans("readwrite", (n) => this.core.mutate({ trans: n, type: "delete", keys: [t] })).then((n) => n.numFailures ? L.reject(n.failures[0]) : void 0);
|
|
1787
1787
|
}
|
|
1788
1788
|
clear() {
|
|
1789
|
-
return this._trans("readwrite", (t) => this.core.mutate({ trans: t, type: "deleteRange", range:
|
|
1789
|
+
return this._trans("readwrite", (t) => this.core.mutate({ trans: t, type: "deleteRange", range: Qi })).then((t) => t.numFailures ? L.reject(t.failures[0]) : void 0);
|
|
1790
1790
|
}
|
|
1791
1791
|
bulkGet(t) {
|
|
1792
1792
|
return this._trans("readonly", (n) => this.core.getMany({ keys: t, trans: n }).then((r) => r.map((i) => this.hook.reading.fire(i))));
|
|
@@ -1851,7 +1851,7 @@ function wt(e) {
|
|
|
1851
1851
|
function s(o, a, l) {
|
|
1852
1852
|
if (typeof o != "object") {
|
|
1853
1853
|
var u;
|
|
1854
|
-
a || (a =
|
|
1854
|
+
a || (a = $o), l || (l = C);
|
|
1855
1855
|
var c = { subscribers: [], fire: l, subscribe: function(p) {
|
|
1856
1856
|
c.subscribers.indexOf(p) === -1 && (c.subscribers.push(p), c.fire = a(c.fire, p));
|
|
1857
1857
|
}, unsubscribe: function(p) {
|
|
@@ -1902,7 +1902,7 @@ function Ht(e, t) {
|
|
|
1902
1902
|
throw new A.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1903
1903
|
return n;
|
|
1904
1904
|
}
|
|
1905
|
-
function
|
|
1905
|
+
function Vr(e, t, n) {
|
|
1906
1906
|
const r = Ht(e, t.schema);
|
|
1907
1907
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
1908
1908
|
}
|
|
@@ -1915,11 +1915,11 @@ function Nt(e, t, n, r) {
|
|
|
1915
1915
|
p === "[object ArrayBuffer]" && (p = "" + new Uint8Array(c)), te(s, p) || (s[p] = !0, t(a, l, u));
|
|
1916
1916
|
}
|
|
1917
1917
|
};
|
|
1918
|
-
return Promise.all([e.or._iterate(o, n), Vr(
|
|
1918
|
+
return Promise.all([e.or._iterate(o, n), qr(Vr(e, r, n), e.algorithm, o, !e.keysOnly && e.valueMapper)]);
|
|
1919
1919
|
}
|
|
1920
|
-
return Vr(
|
|
1920
|
+
return qr(Vr(e, r, n), Fe(e.algorithm, i), t, !e.keysOnly && e.valueMapper);
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function qr(e, t, n, r) {
|
|
1923
1923
|
var i = N(r ? (s, o, a) => n(r(s), o, a) : n);
|
|
1924
1924
|
return e.then((s) => {
|
|
1925
1925
|
if (s)
|
|
@@ -1935,7 +1935,7 @@ function Vr(e, t, n, r) {
|
|
|
1935
1935
|
}
|
|
1936
1936
|
function G(e, t) {
|
|
1937
1937
|
try {
|
|
1938
|
-
const n =
|
|
1938
|
+
const n = Wr(e), r = Wr(t);
|
|
1939
1939
|
if (n !== r)
|
|
1940
1940
|
return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
|
|
1941
1941
|
switch (n) {
|
|
@@ -1950,7 +1950,7 @@ function G(e, t) {
|
|
|
1950
1950
|
if (i[u] !== s[u])
|
|
1951
1951
|
return i[u] < s[u] ? -1 : 1;
|
|
1952
1952
|
return o === a ? 0 : o < a ? -1 : 1;
|
|
1953
|
-
}(
|
|
1953
|
+
}(zr(e), zr(t));
|
|
1954
1954
|
case "Array":
|
|
1955
1955
|
return function(i, s) {
|
|
1956
1956
|
const o = i.length, a = s.length, l = o < a ? o : a;
|
|
@@ -1966,7 +1966,7 @@ function G(e, t) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
return NaN;
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1969
|
+
function Wr(e) {
|
|
1970
1970
|
const t = typeof e;
|
|
1971
1971
|
if (t !== "object")
|
|
1972
1972
|
return t;
|
|
@@ -1975,10 +1975,10 @@ function qr(e) {
|
|
|
1975
1975
|
const n = Nn(e);
|
|
1976
1976
|
return n === "ArrayBuffer" ? "binary" : n;
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function zr(e) {
|
|
1979
1979
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
1980
1980
|
}
|
|
1981
|
-
class
|
|
1981
|
+
class Xo {
|
|
1982
1982
|
_read(t, n) {
|
|
1983
1983
|
var r = this._ctx;
|
|
1984
1984
|
return r.error ? r.table._trans(null, $.bind(null, r.error)) : r.table._trans("readonly", t).then(n);
|
|
@@ -2186,12 +2186,12 @@ class Qo {
|
|
|
2186
2186
|
const B = v[k], D = { value: xt(B), primKey: m[y + k] };
|
|
2187
2187
|
i.call(D, D.value, D) !== !1 && (D.value == null ? S.push(m[y + k]) : l || G(u(B), u(D.value)) === 0 ? (_.push(D.value), l && E.push(m[y + k])) : (S.push(m[y + k]), b.push(D.value)));
|
|
2188
2188
|
}
|
|
2189
|
-
const
|
|
2189
|
+
const P = We(n) && n.limit === 1 / 0 && (typeof t != "function" || t === kn) && { index: n.index, range: n.range };
|
|
2190
2190
|
return Promise.resolve(b.length > 0 && a.mutate({ trans: r, type: "add", values: b }).then((k) => {
|
|
2191
2191
|
for (let B in k.failures)
|
|
2192
2192
|
S.splice(parseInt(B), 1);
|
|
2193
2193
|
w(b.length, k);
|
|
2194
|
-
})).then(() => (_.length > 0 ||
|
|
2194
|
+
})).then(() => (_.length > 0 || P && typeof t == "object") && a.mutate({ trans: r, type: "put", keys: E, values: _, criteria: P, changeSpec: typeof t != "function" && t }).then((k) => w(_.length, k))).then(() => (S.length > 0 || P && t === kn) && a.mutate({ trans: r, type: "delete", keys: S, criteria: P }).then((k) => w(S.length, k))).then(() => m.length > y + f && g(y + c));
|
|
2195
2195
|
});
|
|
2196
2196
|
};
|
|
2197
2197
|
return g(0).then(() => {
|
|
@@ -2204,7 +2204,7 @@ class Qo {
|
|
|
2204
2204
|
}
|
|
2205
2205
|
delete() {
|
|
2206
2206
|
var t = this._ctx, n = t.range;
|
|
2207
|
-
return We(t) && (t.isPrimKey && !
|
|
2207
|
+
return We(t) && (t.isPrimKey && !Jo || n.type === 3) ? this._write((r) => {
|
|
2208
2208
|
const { primaryKey: i } = t.table.core.schema, s = n;
|
|
2209
2209
|
return t.table.core.count({ trans: r, query: { index: i, range: s } }).then((o) => t.table.core.mutate({ trans: r, type: "deleteRange", range: s }).then(({ failures: a, lastResult: l, results: u, numFailures: c }) => {
|
|
2210
2210
|
if (c)
|
|
@@ -2215,20 +2215,20 @@ class Qo {
|
|
|
2215
2215
|
}
|
|
2216
2216
|
}
|
|
2217
2217
|
const kn = (e, t) => t.value = null;
|
|
2218
|
-
function
|
|
2218
|
+
function Zo(e, t) {
|
|
2219
2219
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
2220
2220
|
}
|
|
2221
|
-
function
|
|
2221
|
+
function ea(e, t) {
|
|
2222
2222
|
return e > t ? -1 : e === t ? 0 : 1;
|
|
2223
2223
|
}
|
|
2224
2224
|
function Q(e, t, n) {
|
|
2225
|
-
var r = e instanceof
|
|
2225
|
+
var r = e instanceof Zi ? new e.Collection(e) : e;
|
|
2226
2226
|
return r._ctx.error = n ? new n(t) : new TypeError(t), r;
|
|
2227
2227
|
}
|
|
2228
2228
|
function ze(e) {
|
|
2229
|
-
return new e.Collection(e, () =>
|
|
2229
|
+
return new e.Collection(e, () => Xi("")).limit(0);
|
|
2230
2230
|
}
|
|
2231
|
-
function
|
|
2231
|
+
function ta(e, t, n, r, i, s) {
|
|
2232
2232
|
for (var o = Math.min(e.length, r.length), a = -1, l = 0; l < o; ++l) {
|
|
2233
2233
|
var u = t[l];
|
|
2234
2234
|
if (u !== r[l])
|
|
@@ -2240,13 +2240,13 @@ function ea(e, t, n, r, i, s) {
|
|
|
2240
2240
|
function Kt(e, t, n, r) {
|
|
2241
2241
|
var i, s, o, a, l, u, c, p = n.length;
|
|
2242
2242
|
if (!n.every((m) => typeof m == "string"))
|
|
2243
|
-
return Q(e,
|
|
2243
|
+
return Q(e, Yi);
|
|
2244
2244
|
function d(m) {
|
|
2245
2245
|
i = /* @__PURE__ */ function(y) {
|
|
2246
2246
|
return y === "next" ? (f) => f.toUpperCase() : (f) => f.toLowerCase();
|
|
2247
2247
|
}(m), s = /* @__PURE__ */ function(y) {
|
|
2248
2248
|
return y === "next" ? (f) => f.toLowerCase() : (f) => f.toUpperCase();
|
|
2249
|
-
}(m), o = m === "next" ?
|
|
2249
|
+
}(m), o = m === "next" ? Zo : ea;
|
|
2250
2250
|
var g = n.map(function(y) {
|
|
2251
2251
|
return { lower: s(y), upper: i(y) };
|
|
2252
2252
|
}).sort(function(y, f) {
|
|
@@ -2272,7 +2272,7 @@ function Kt(e, t, n, r) {
|
|
|
2272
2272
|
if (t(v, l, w))
|
|
2273
2273
|
return !0;
|
|
2274
2274
|
for (var b = null, _ = w; _ < p; ++_) {
|
|
2275
|
-
var E =
|
|
2275
|
+
var E = ta(f, v, a[_], l[_], o, u);
|
|
2276
2276
|
E === null && b === null ? w = _ + 1 : (b === null || o(b, E) > 0) && (b = E);
|
|
2277
2277
|
}
|
|
2278
2278
|
return g(b !== null ? function() {
|
|
@@ -2283,10 +2283,10 @@ function Kt(e, t, n, r) {
|
|
|
2283
2283
|
function be(e, t, n, r) {
|
|
2284
2284
|
return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: r };
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function Xi(e) {
|
|
2287
2287
|
return { type: 1, lower: e, upper: e };
|
|
2288
2288
|
}
|
|
2289
|
-
class
|
|
2289
|
+
class Zi {
|
|
2290
2290
|
get Collection() {
|
|
2291
2291
|
return this._ctx.table.db.Collection;
|
|
2292
2292
|
}
|
|
@@ -2299,7 +2299,7 @@ class Xi {
|
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
2301
|
equals(t) {
|
|
2302
|
-
return t == null ? Q(this, ce) : new this.Collection(this, () =>
|
|
2302
|
+
return t == null ? Q(this, ce) : new this.Collection(this, () => Xi(t));
|
|
2303
2303
|
}
|
|
2304
2304
|
above(t) {
|
|
2305
2305
|
return t == null ? Q(this, ce) : new this.Collection(this, () => be(t, void 0, !0));
|
|
@@ -2314,7 +2314,7 @@ class Xi {
|
|
|
2314
2314
|
return t == null ? Q(this, ce) : new this.Collection(this, () => be(void 0, t));
|
|
2315
2315
|
}
|
|
2316
2316
|
startsWith(t) {
|
|
2317
|
-
return typeof t != "string" ? Q(this,
|
|
2317
|
+
return typeof t != "string" ? Q(this, Yi) : this.between(t, t + De, !0, !0);
|
|
2318
2318
|
}
|
|
2319
2319
|
startsWithIgnoreCase(t) {
|
|
2320
2320
|
return t === "" ? this.startsWith(t) : Kt(this, (n, r) => n.indexOf(r[0]) === 0, [t], De);
|
|
@@ -2427,7 +2427,7 @@ function Et(e) {
|
|
|
2427
2427
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
2428
2428
|
}
|
|
2429
2429
|
const kt = "storagemutated", Se = "x-storagemutated-1", Ue = wt(null, kt);
|
|
2430
|
-
class
|
|
2430
|
+
class na {
|
|
2431
2431
|
_lock() {
|
|
2432
2432
|
return pt(!U.global), ++this._reculock, this._reculock !== 1 || U.global || (U.lockOwnerFor = this), this;
|
|
2433
2433
|
}
|
|
@@ -2533,13 +2533,13 @@ class ta {
|
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
2535
|
function Qn(e, t, n, r, i, s, o) {
|
|
2536
|
-
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: s, src: (n && !o ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") +
|
|
2536
|
+
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: s, src: (n && !o ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") + es(t) };
|
|
2537
2537
|
}
|
|
2538
|
-
function
|
|
2538
|
+
function es(e) {
|
|
2539
2539
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2540
2540
|
}
|
|
2541
|
-
function
|
|
2542
|
-
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName:
|
|
2541
|
+
function ts(e, t, n) {
|
|
2542
|
+
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: Ri(n, (r) => [r.name, r]) };
|
|
2543
2543
|
}
|
|
2544
2544
|
let Lt = (e) => {
|
|
2545
2545
|
try {
|
|
@@ -2554,14 +2554,14 @@ function Xn(e) {
|
|
|
2554
2554
|
return t.split(".").length === 1 ? (r) => r[t] : (r) => ye(r, t);
|
|
2555
2555
|
}(e) : (t) => ye(t, e);
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2557
|
+
function Gr(e) {
|
|
2558
2558
|
return [].slice.call(e);
|
|
2559
2559
|
}
|
|
2560
|
-
let
|
|
2560
|
+
let ra = 0;
|
|
2561
2561
|
function gt(e) {
|
|
2562
2562
|
return e == null ? ":id" : typeof e == "string" ? e : `[${e.join("+")}]`;
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function ia(e, t, n) {
|
|
2565
2565
|
function r(l) {
|
|
2566
2566
|
if (l.type === 3)
|
|
2567
2567
|
return null;
|
|
@@ -2571,9 +2571,9 @@ function ra(e, t, n) {
|
|
|
2571
2571
|
return u === void 0 ? c === void 0 ? null : t.upperBound(c, !!d) : c === void 0 ? t.lowerBound(u, !!p) : t.bound(u, c, !!p, !!d);
|
|
2572
2572
|
}
|
|
2573
2573
|
const { schema: i, hasGetAll: s } = function(l, u) {
|
|
2574
|
-
const c =
|
|
2574
|
+
const c = Gr(l.objectStoreNames);
|
|
2575
2575
|
return { schema: { name: l.name, tables: c.map((p) => u.objectStore(p)).map((p) => {
|
|
2576
|
-
const { keyPath: d, autoIncrement: h } = p, w = z(d), m = d == null, g = {}, y = { name: p.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m, compound: w, keyPath: d, autoIncrement: h, unique: !0, extractKey: Xn(d) }, indexes:
|
|
2576
|
+
const { keyPath: d, autoIncrement: h } = p, w = z(d), m = d == null, g = {}, y = { name: p.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m, compound: w, keyPath: d, autoIncrement: h, unique: !0, extractKey: Xn(d) }, indexes: Gr(p.indexNames).map((f) => p.index(f)).map((f) => {
|
|
2577
2577
|
const { name: v, unique: b, multiEntry: _, keyPath: E } = f, S = { name: v, compound: z(E), keyPath: E, unique: b, multiEntry: _, extractKey: Xn(E) };
|
|
2578
2578
|
return g[gt(E)] = S, S;
|
|
2579
2579
|
}), getIndexByKeyPath: (f) => g[gt(f)] };
|
|
@@ -2593,14 +2593,14 @@ function ra(e, t, n) {
|
|
|
2593
2593
|
if (_ === 0)
|
|
2594
2594
|
return g({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2595
2595
|
let E;
|
|
2596
|
-
const S = [],
|
|
2596
|
+
const S = [], P = [];
|
|
2597
2597
|
let k = 0;
|
|
2598
2598
|
const B = (V) => {
|
|
2599
2599
|
++k, Et(V);
|
|
2600
2600
|
};
|
|
2601
2601
|
if (d === "deleteRange") {
|
|
2602
2602
|
if (m.type === 4)
|
|
2603
|
-
return g({ numFailures: k, failures:
|
|
2603
|
+
return g({ numFailures: k, failures: P, results: [], lastResult: void 0 });
|
|
2604
2604
|
m.type === 3 ? S.push(E = f.clear()) : S.push(E = f.delete(r(m)));
|
|
2605
2605
|
} else {
|
|
2606
2606
|
const [V, M] = b ? v ? [w, h] : [w, null] : [h, null];
|
|
@@ -2613,7 +2613,7 @@ function ra(e, t, n) {
|
|
|
2613
2613
|
}
|
|
2614
2614
|
const D = (V) => {
|
|
2615
2615
|
const M = V.target.result;
|
|
2616
|
-
S.forEach((x, ve) => x.error != null && (
|
|
2616
|
+
S.forEach((x, ve) => x.error != null && (P[ve] = x.error)), g({ numFailures: k, failures: P, results: d === "delete" ? h : S.map((x) => x.result), lastResult: M });
|
|
2617
2617
|
};
|
|
2618
2618
|
E.onerror = (V) => {
|
|
2619
2619
|
B(V), D(V);
|
|
@@ -2624,8 +2624,8 @@ function ra(e, t, n) {
|
|
|
2624
2624
|
const m = p.objectStore(c), g = d.length, y = new Array(g);
|
|
2625
2625
|
let f, v = 0, b = 0;
|
|
2626
2626
|
const _ = (S) => {
|
|
2627
|
-
const
|
|
2628
|
-
y[
|
|
2627
|
+
const P = S.target;
|
|
2628
|
+
y[P._pos] = P.result, ++b === v && h(y);
|
|
2629
2629
|
}, E = se(w);
|
|
2630
2630
|
for (let S = 0; S < g; ++S)
|
|
2631
2631
|
d[S] != null && (f = m.get(d[S]), f._pos = S, f.onsuccess = _, f.onerror = E, ++v);
|
|
@@ -2637,15 +2637,15 @@ function ra(e, t, n) {
|
|
|
2637
2637
|
}), query: /* @__PURE__ */ function(p) {
|
|
2638
2638
|
return (d) => new Promise((h, w) => {
|
|
2639
2639
|
h = N(h);
|
|
2640
|
-
const { trans: m, values: g, limit: y, query: f } = d, v = y === 1 / 0 ? void 0 : y, { index: b, range: _ } = f, E = m.objectStore(c), S = b.isPrimaryKey ? E : E.index(b.name),
|
|
2640
|
+
const { trans: m, values: g, limit: y, query: f } = d, v = y === 1 / 0 ? void 0 : y, { index: b, range: _ } = f, E = m.objectStore(c), S = b.isPrimaryKey ? E : E.index(b.name), P = r(_);
|
|
2641
2641
|
if (y === 0)
|
|
2642
2642
|
return h({ result: [] });
|
|
2643
2643
|
if (p) {
|
|
2644
|
-
const k = g ? S.getAll(
|
|
2644
|
+
const k = g ? S.getAll(P, v) : S.getAllKeys(P, v);
|
|
2645
2645
|
k.onsuccess = (B) => h({ result: B.target.result }), k.onerror = se(w);
|
|
2646
2646
|
} else {
|
|
2647
2647
|
let k = 0;
|
|
2648
|
-
const B = g || !("openKeyCursor" in S) ? S.openCursor(
|
|
2648
|
+
const B = g || !("openKeyCursor" in S) ? S.openCursor(P) : S.openKeyCursor(P), D = [];
|
|
2649
2649
|
B.onsuccess = (V) => {
|
|
2650
2650
|
const M = B.result;
|
|
2651
2651
|
return M ? (D.push(g ? M.value : M.primaryKey), ++k === y ? h({ result: D }) : void M.continue()) : h({ result: D });
|
|
@@ -2656,11 +2656,11 @@ function ra(e, t, n) {
|
|
|
2656
2656
|
return new Promise((g, y) => {
|
|
2657
2657
|
g = N(g);
|
|
2658
2658
|
const { index: f, range: v } = h, b = p.objectStore(c), _ = f.isPrimaryKey ? b : b.index(f.name), E = w ? m ? "prevunique" : "prev" : m ? "nextunique" : "next", S = d || !("openKeyCursor" in _) ? _.openCursor(r(v), E) : _.openKeyCursor(r(v), E);
|
|
2659
|
-
S.onerror = se(y), S.onsuccess = N((
|
|
2659
|
+
S.onerror = se(y), S.onsuccess = N((P) => {
|
|
2660
2660
|
const k = S.result;
|
|
2661
2661
|
if (!k)
|
|
2662
2662
|
return void g(null);
|
|
2663
|
-
k.___id = ++
|
|
2663
|
+
k.___id = ++ra, k.done = !1;
|
|
2664
2664
|
const B = k.continue.bind(k);
|
|
2665
2665
|
let D = k.continuePrimaryKey;
|
|
2666
2666
|
D && (D = D.bind(k));
|
|
@@ -2713,7 +2713,7 @@ function Zn({ _novip: e }, t) {
|
|
|
2713
2713
|
const n = t.db, r = function(i, s, { IDBKeyRange: o, indexedDB: a }, l) {
|
|
2714
2714
|
return { dbcore: function(c, p) {
|
|
2715
2715
|
return p.reduce((d, { create: h }) => ({ ...d, ...h(d) }), c);
|
|
2716
|
-
}(
|
|
2716
|
+
}(ia(s, o, l), i.dbcore) };
|
|
2717
2717
|
}(e._middlewares, n, e._deps, t);
|
|
2718
2718
|
e.core = r.dbcore, e.tables.forEach((i) => {
|
|
2719
2719
|
const s = i.name;
|
|
@@ -2728,7 +2728,7 @@ function ln({ _novip: e }, t, n, r) {
|
|
|
2728
2728
|
(!a || "value" in a && a.value === void 0) && (o === e.Transaction.prototype || o instanceof e.Transaction ? me(o, i, { get() {
|
|
2729
2729
|
return this.table(i);
|
|
2730
2730
|
}, set(l) {
|
|
2731
|
-
|
|
2731
|
+
xi(this, i, { value: l, writable: !0, configurable: !0, enumerable: !0 });
|
|
2732
2732
|
} }) : o[i] = new e.Table(i, s));
|
|
2733
2733
|
});
|
|
2734
2734
|
});
|
|
@@ -2739,10 +2739,10 @@ function er({ _novip: e }, t) {
|
|
|
2739
2739
|
n[r] instanceof e.Table && delete n[r];
|
|
2740
2740
|
});
|
|
2741
2741
|
}
|
|
2742
|
-
function
|
|
2742
|
+
function sa(e, t) {
|
|
2743
2743
|
return e._cfg.version - t._cfg.version;
|
|
2744
2744
|
}
|
|
2745
|
-
function
|
|
2745
|
+
function oa(e, t, n, r) {
|
|
2746
2746
|
const i = e._dbSchema, s = e._createTransaction("readwrite", e._storeNames, i);
|
|
2747
2747
|
s.create(n), s._completion.catch(r);
|
|
2748
2748
|
const o = s._reject.bind(s), a = U.transless || U;
|
|
@@ -2760,31 +2760,31 @@ function sa(e, t, n, r) {
|
|
|
2760
2760
|
d.push(() => {
|
|
2761
2761
|
const v = w, b = f._cfg.dbschema;
|
|
2762
2762
|
rr(l, v, p), rr(l, b, p), w = l._dbSchema = b;
|
|
2763
|
-
const _ =
|
|
2763
|
+
const _ = ns(v, b);
|
|
2764
2764
|
_.add.forEach((S) => {
|
|
2765
2765
|
Ln(p, S[0], S[1].primKey, S[1].indexes);
|
|
2766
2766
|
}), _.change.forEach((S) => {
|
|
2767
2767
|
if (S.recreate)
|
|
2768
2768
|
throw new A.Upgrade("Not yet support for changing primary key");
|
|
2769
2769
|
{
|
|
2770
|
-
const
|
|
2771
|
-
S.add.forEach((k) => tr(
|
|
2772
|
-
|
|
2773
|
-
}), S.del.forEach((k) =>
|
|
2770
|
+
const P = p.objectStore(S.name);
|
|
2771
|
+
S.add.forEach((k) => tr(P, k)), S.change.forEach((k) => {
|
|
2772
|
+
P.deleteIndex(k.name), tr(P, k);
|
|
2773
|
+
}), S.del.forEach((k) => P.deleteIndex(k));
|
|
2774
2774
|
}
|
|
2775
2775
|
});
|
|
2776
2776
|
const E = f._cfg.contentUpgrade;
|
|
2777
2777
|
if (E && f._cfg.version > u) {
|
|
2778
2778
|
Zn(l, p), c._memoizedTables = {}, m = !0;
|
|
2779
|
-
let S =
|
|
2779
|
+
let S = Di(b);
|
|
2780
2780
|
_.del.forEach((D) => {
|
|
2781
2781
|
S[D] = v[D];
|
|
2782
2782
|
}), er(l, [l.Transaction.prototype]), ln(l, [l.Transaction.prototype], F(S), S), c.schema = S;
|
|
2783
|
-
const
|
|
2783
|
+
const P = gr(E);
|
|
2784
2784
|
let k;
|
|
2785
|
-
|
|
2785
|
+
P && it();
|
|
2786
2786
|
const B = L.follow(() => {
|
|
2787
|
-
if (k = E(c), k &&
|
|
2787
|
+
if (k = E(c), k && P) {
|
|
2788
2788
|
var D = we.bind(null, null);
|
|
2789
2789
|
k.then(D, D);
|
|
2790
2790
|
}
|
|
@@ -2792,7 +2792,7 @@ function sa(e, t, n, r) {
|
|
|
2792
2792
|
return k && typeof k.then == "function" ? L.resolve(k) : B.then(() => k);
|
|
2793
2793
|
}
|
|
2794
2794
|
}), d.push((v) => {
|
|
2795
|
-
(!m || !
|
|
2795
|
+
(!m || !Yo) && function(b, _) {
|
|
2796
2796
|
[].slice.call(_.db.objectStoreNames).forEach((E) => b[E] == null && _.db.deleteObjectStore(E));
|
|
2797
2797
|
}(f._cfg.dbschema, v), er(l, [l.Transaction.prototype]), ln(l, [l.Transaction.prototype], l._storeNames, l._dbSchema), c.schema = l._dbSchema;
|
|
2798
2798
|
});
|
|
@@ -2805,7 +2805,7 @@ function sa(e, t, n, r) {
|
|
|
2805
2805
|
}(e, t, s, n).catch(o);
|
|
2806
2806
|
});
|
|
2807
2807
|
}
|
|
2808
|
-
function
|
|
2808
|
+
function ns(e, t) {
|
|
2809
2809
|
const n = { del: [], add: [], change: [] };
|
|
2810
2810
|
let r;
|
|
2811
2811
|
for (r in e)
|
|
@@ -2844,14 +2844,14 @@ function nr(e, t, n) {
|
|
|
2844
2844
|
return tn(t.objectStoreNames, 0).forEach((i) => {
|
|
2845
2845
|
const s = n.objectStore(i);
|
|
2846
2846
|
let o = s.keyPath;
|
|
2847
|
-
const a = Qn(
|
|
2847
|
+
const a = Qn(es(o), o || "", !1, !1, !!s.autoIncrement, o && typeof o != "string", !0), l = [];
|
|
2848
2848
|
for (let c = 0; c < s.indexNames.length; ++c) {
|
|
2849
2849
|
const p = s.index(s.indexNames[c]);
|
|
2850
2850
|
o = p.keyPath;
|
|
2851
2851
|
var u = Qn(p.name, o, !!p.unique, !!p.multiEntry, !1, o && typeof o != "string", !1);
|
|
2852
2852
|
l.push(u);
|
|
2853
2853
|
}
|
|
2854
|
-
r[i] =
|
|
2854
|
+
r[i] = ts(i, a, l);
|
|
2855
2855
|
}), r;
|
|
2856
2856
|
}
|
|
2857
2857
|
function rr({ _novip: e }, t, n) {
|
|
@@ -2869,7 +2869,7 @@ function rr({ _novip: e }, t, n) {
|
|
|
2869
2869
|
}
|
|
2870
2870
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && j.WorkerGlobalScope && j instanceof j.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2871
2871
|
}
|
|
2872
|
-
class
|
|
2872
|
+
class aa {
|
|
2873
2873
|
_parseStoresSpec(t, n) {
|
|
2874
2874
|
F(t).forEach((r) => {
|
|
2875
2875
|
if (t[r] !== null) {
|
|
@@ -2884,7 +2884,7 @@ class oa {
|
|
|
2884
2884
|
throw new A.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2885
2885
|
if (!o.keyPath)
|
|
2886
2886
|
throw new A.Schema("Index must have a name and cannot be an empty string");
|
|
2887
|
-
}), n[r] =
|
|
2887
|
+
}), n[r] = ts(r, s, i);
|
|
2888
2888
|
}
|
|
2889
2889
|
});
|
|
2890
2890
|
}
|
|
@@ -2913,7 +2913,7 @@ function ir(e) {
|
|
|
2913
2913
|
return U.letThrough = !0, e();
|
|
2914
2914
|
});
|
|
2915
2915
|
}
|
|
2916
|
-
function
|
|
2916
|
+
function la() {
|
|
2917
2917
|
var e;
|
|
2918
2918
|
return !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(t) {
|
|
2919
2919
|
var n = function() {
|
|
@@ -2924,7 +2924,7 @@ function aa() {
|
|
|
2924
2924
|
return clearInterval(e);
|
|
2925
2925
|
}) : Promise.resolve();
|
|
2926
2926
|
}
|
|
2927
|
-
function
|
|
2927
|
+
function ca(e) {
|
|
2928
2928
|
const t = e._state, { indexedDB: n } = e._deps;
|
|
2929
2929
|
if (t.isBeingOpened || e.idbdb)
|
|
2930
2930
|
return t.dbReadyPromise.then(() => t.dbOpenError ? $(t.dbOpenError) : e);
|
|
@@ -2935,7 +2935,7 @@ function la(e) {
|
|
|
2935
2935
|
throw new A.DatabaseClosed("db.open() was cancelled");
|
|
2936
2936
|
}
|
|
2937
2937
|
let s = t.dbReadyResolve, o = null, a = !1;
|
|
2938
|
-
return L.race([r, (typeof navigator > "u" ? L.resolve() :
|
|
2938
|
+
return L.race([r, (typeof navigator > "u" ? L.resolve() : la()).then(() => new L((l, u) => {
|
|
2939
2939
|
if (i(), !n)
|
|
2940
2940
|
throw new A.MissingAPI();
|
|
2941
2941
|
const c = e.name, p = t.autoSchema ? n.open(c) : n.open(c, Math.round(10 * e.verno));
|
|
@@ -2951,7 +2951,7 @@ function la(e) {
|
|
|
2951
2951
|
} else {
|
|
2952
2952
|
o.onerror = se(u);
|
|
2953
2953
|
var h = d.oldVersion > Math.pow(2, 62) ? 0 : d.oldVersion;
|
|
2954
|
-
a = h < 1, e._novip.idbdb = p.result,
|
|
2954
|
+
a = h < 1, e._novip.idbdb = p.result, oa(e, h / 10, o, u);
|
|
2955
2955
|
}
|
|
2956
2956
|
}, u), p.onsuccess = N(() => {
|
|
2957
2957
|
o = null;
|
|
@@ -2964,7 +2964,7 @@ function la(e) {
|
|
|
2964
2964
|
const v = g._dbSchema = nr(0, y, f);
|
|
2965
2965
|
g._storeNames = tn(y.objectStoreNames, 0), ln(g, [g._allTables], F(v), v);
|
|
2966
2966
|
}(e, d, m) : (rr(e, e._dbSchema, m), function(g, y) {
|
|
2967
|
-
const f =
|
|
2967
|
+
const f = ns(nr(0, g.idbdb, y), g._dbSchema);
|
|
2968
2968
|
return !(f.add.length || f.change.some((v) => v.add.length || v.change.length));
|
|
2969
2969
|
}(e, m) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Zn(e, m);
|
|
2970
2970
|
} catch {
|
|
@@ -3006,15 +3006,15 @@ function sr(e) {
|
|
|
3006
3006
|
}
|
|
3007
3007
|
return i(t)();
|
|
3008
3008
|
}
|
|
3009
|
-
function
|
|
3009
|
+
function ua(e, t, n) {
|
|
3010
3010
|
var r = arguments.length;
|
|
3011
3011
|
if (r < 2)
|
|
3012
3012
|
throw new A.InvalidArgument("Too few arguments");
|
|
3013
3013
|
for (var i = new Array(r - 1); --r; )
|
|
3014
3014
|
i[r - 1] = arguments[r];
|
|
3015
|
-
return n = i.pop(), [e,
|
|
3015
|
+
return n = i.pop(), [e, Ti(i), n];
|
|
3016
3016
|
}
|
|
3017
|
-
function
|
|
3017
|
+
function rs(e, t, n, r, i) {
|
|
3018
3018
|
return L.resolve().then(() => {
|
|
3019
3019
|
const s = U.transless || U, o = e._createTransaction(t, n, e._dbSchema, r), a = { trans: o, transless: s };
|
|
3020
3020
|
if (r)
|
|
@@ -3023,7 +3023,7 @@ function ns(e, t, n, r, i) {
|
|
|
3023
3023
|
try {
|
|
3024
3024
|
o.create(), e._state.PR1398_maxLoop = 3;
|
|
3025
3025
|
} catch (p) {
|
|
3026
|
-
return p.name === br.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), e._close(), e.open().then(() =>
|
|
3026
|
+
return p.name === br.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), e._close(), e.open().then(() => rs(e, t, n, null, i))) : $(p);
|
|
3027
3027
|
}
|
|
3028
3028
|
const l = gr(i);
|
|
3029
3029
|
let u;
|
|
@@ -3045,7 +3045,7 @@ function Ft(e, t, n) {
|
|
|
3045
3045
|
r.push(t);
|
|
3046
3046
|
return r;
|
|
3047
3047
|
}
|
|
3048
|
-
const
|
|
3048
|
+
const da = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
3049
3049
|
return { ...e, table(t) {
|
|
3050
3050
|
const n = e.table(t), { schema: r } = n, i = {}, s = [];
|
|
3051
3051
|
function o(c, p, d) {
|
|
@@ -3094,7 +3094,7 @@ function Ur(e, t, n, r) {
|
|
|
3094
3094
|
te(e, i) || (n[r + i] = t[i]);
|
|
3095
3095
|
}), n;
|
|
3096
3096
|
}
|
|
3097
|
-
const
|
|
3097
|
+
const pa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (e) => ({ ...e, table(t) {
|
|
3098
3098
|
const n = e.table(t), { primaryKey: r } = n.schema;
|
|
3099
3099
|
return { ...n, mutate(s) {
|
|
3100
3100
|
const o = U.trans, { deleting: a, creating: l, updating: u } = o.table(t).hook;
|
|
@@ -3139,8 +3139,8 @@ const da = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (e) =>
|
|
|
3139
3139
|
const _ = Ur(v, d.values[f]), E = u.fire.call(b, _, y, v, h);
|
|
3140
3140
|
if (E) {
|
|
3141
3141
|
const S = d.values[f];
|
|
3142
|
-
Object.keys(E).forEach((
|
|
3143
|
-
te(S,
|
|
3142
|
+
Object.keys(E).forEach((P) => {
|
|
3143
|
+
te(S, P) ? S[P] = E[P] : ie(S, P, E[P]);
|
|
3144
3144
|
});
|
|
3145
3145
|
}
|
|
3146
3146
|
}
|
|
@@ -3160,7 +3160,7 @@ const da = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (e) =>
|
|
|
3160
3160
|
}
|
|
3161
3161
|
} };
|
|
3162
3162
|
} }) };
|
|
3163
|
-
function
|
|
3163
|
+
function is(e, t, n) {
|
|
3164
3164
|
try {
|
|
3165
3165
|
if (!t || t.keys.length < e.length)
|
|
3166
3166
|
return null;
|
|
@@ -3172,12 +3172,12 @@ function rs(e, t, n) {
|
|
|
3172
3172
|
return null;
|
|
3173
3173
|
}
|
|
3174
3174
|
}
|
|
3175
|
-
const
|
|
3175
|
+
const ha = { stack: "dbcore", level: -1, create: (e) => ({ table: (t) => {
|
|
3176
3176
|
const n = e.table(t);
|
|
3177
3177
|
return { ...n, getMany: (r) => {
|
|
3178
3178
|
if (!r.cache)
|
|
3179
3179
|
return n.getMany(r);
|
|
3180
|
-
const i =
|
|
3180
|
+
const i = is(r.keys, r.trans._cache, r.cache === "clone");
|
|
3181
3181
|
return i ? L.resolve(i) : n.getMany(r).then((s) => (r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? xt(s) : s }, s));
|
|
3182
3182
|
}, mutate: (r) => (r.type !== "add" && (r.trans._cache = null), n.mutate(r)) };
|
|
3183
3183
|
} }) };
|
|
@@ -3201,9 +3201,9 @@ function It(e, t, n) {
|
|
|
3201
3201
|
return H(e, { from: t, to: n, d: 1 });
|
|
3202
3202
|
const i = e.l, s = e.r;
|
|
3203
3203
|
if (G(n, e.from) < 0)
|
|
3204
|
-
return i ? It(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null },
|
|
3204
|
+
return i ? It(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, Hr(e);
|
|
3205
3205
|
if (G(t, e.to) > 0)
|
|
3206
|
-
return s ? It(s, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null },
|
|
3206
|
+
return s ? It(s, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, Hr(e);
|
|
3207
3207
|
G(t, e.from) < 0 && (e.from = t, e.l = null, e.d = s ? s.d + 1 : 1), G(n, e.to) > 0 && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1);
|
|
3208
3208
|
const o = !e.r;
|
|
3209
3209
|
i && !e.l && cn(e, i), s && o && cn(e, s);
|
|
@@ -3213,7 +3213,7 @@ function cn(e, t) {
|
|
|
3213
3213
|
It(r, i, s), o && n(r, o), a && n(r, a);
|
|
3214
3214
|
}(e, t);
|
|
3215
3215
|
}
|
|
3216
|
-
function
|
|
3216
|
+
function fa(e, t) {
|
|
3217
3217
|
const n = or(t);
|
|
3218
3218
|
let r = n.next();
|
|
3219
3219
|
if (r.done)
|
|
@@ -3255,16 +3255,16 @@ function or(e) {
|
|
|
3255
3255
|
return { done: !0 };
|
|
3256
3256
|
} };
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function Hr(e) {
|
|
3259
3259
|
var t, n;
|
|
3260
3260
|
const r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = r > 1 ? "r" : r < -1 ? "l" : "";
|
|
3261
3261
|
if (i) {
|
|
3262
3262
|
const s = i === "r" ? "l" : "r", o = { ...e }, a = e[i];
|
|
3263
|
-
e.from = a.from, e.to = a.to, e[i] = a[i], o[i] = a[s], e[s] = o, o.d =
|
|
3263
|
+
e.from = a.from, e.to = a.to, e[i] = a[i], o[i] = a[s], e[s] = o, o.d = Yr(o);
|
|
3264
3264
|
}
|
|
3265
|
-
e.d =
|
|
3265
|
+
e.d = Yr(e);
|
|
3266
3266
|
}
|
|
3267
|
-
function
|
|
3267
|
+
function Yr({ r: e, l: t }) {
|
|
3268
3268
|
return (e ? t ? Math.max(e.d, t.d) : e.d : t ? t.d : 0) + 1;
|
|
3269
3269
|
}
|
|
3270
3270
|
tt(ue.prototype, { add(e) {
|
|
@@ -3276,7 +3276,7 @@ tt(ue.prototype, { add(e) {
|
|
|
3276
3276
|
}, [Kn]() {
|
|
3277
3277
|
return or(this);
|
|
3278
3278
|
} });
|
|
3279
|
-
const
|
|
3279
|
+
const ma = { stack: "dbcore", level: 0, create: (e) => {
|
|
3280
3280
|
const t = e.schema.name, n = new ue(e.MIN_KEY, e.MAX_KEY);
|
|
3281
3281
|
return { ...e, table: (r) => {
|
|
3282
3282
|
const i = e.table(r), { schema: s } = i, { primaryKey: o } = s, { extractKey: a, outbound: l } = o, u = { ...i, mutate: (d) => {
|
|
@@ -3289,10 +3289,10 @@ const fa = { stack: "dbcore", level: 0, create: (e) => {
|
|
|
3289
3289
|
return i.mutate(d).then((E) => {
|
|
3290
3290
|
if (z(v)) {
|
|
3291
3291
|
f !== "delete" && (v = E.results), g.addKeys(v);
|
|
3292
|
-
const S =
|
|
3293
|
-
S || f === "add" || y.addKeys(v), (S || b) && function(
|
|
3292
|
+
const S = is(v, _);
|
|
3293
|
+
S || f === "add" || y.addKeys(v), (S || b) && function(P, k, B, D) {
|
|
3294
3294
|
function V(M) {
|
|
3295
|
-
const x =
|
|
3295
|
+
const x = P(M.name || "");
|
|
3296
3296
|
function ve(J) {
|
|
3297
3297
|
return J != null ? M.extractKey(J) : null;
|
|
3298
3298
|
}
|
|
@@ -3335,8 +3335,8 @@ const fa = { stack: "dbcore", level: 0, create: (e) => {
|
|
|
3335
3335
|
} else if (d === "openCursor") {
|
|
3336
3336
|
const E = _, S = h.values;
|
|
3337
3337
|
return E && Object.create(E, { key: { get: () => (y.addKey(E.primaryKey), E.key) }, primaryKey: { get() {
|
|
3338
|
-
const
|
|
3339
|
-
return y.addKey(
|
|
3338
|
+
const P = E.primaryKey;
|
|
3339
|
+
return y.addKey(P), P;
|
|
3340
3340
|
} }, value: { get: () => (S && g.addKey(E.primaryKey), E.value) } });
|
|
3341
3341
|
}
|
|
3342
3342
|
return _;
|
|
@@ -3363,7 +3363,7 @@ class Be {
|
|
|
3363
3363
|
s.dbReadyResolve = a;
|
|
3364
3364
|
}), s.openCanceller = new L((a, l) => {
|
|
3365
3365
|
s.cancelOpen = l;
|
|
3366
|
-
}), this._state = s, this.name = t, this.on = wt(this, "populate", "blocked", "versionchange", "close", { ready: [_r, C] }), this.on.ready.subscribe =
|
|
3366
|
+
}), this._state = s, this.name = t, this.on = wt(this, "populate", "blocked", "versionchange", "close", { ready: [_r, C] }), this.on.ready.subscribe = Pi(this.on.ready.subscribe, (a) => (l, u) => {
|
|
3367
3367
|
Be.vip(() => {
|
|
3368
3368
|
const c = this._state;
|
|
3369
3369
|
if (c.openComplete)
|
|
@@ -3378,9 +3378,9 @@ class Be {
|
|
|
3378
3378
|
});
|
|
3379
3379
|
}
|
|
3380
3380
|
});
|
|
3381
|
-
}), this.Collection = (o = this, lt(
|
|
3381
|
+
}), this.Collection = (o = this, lt(Xo.prototype, function(a, l) {
|
|
3382
3382
|
this.db = o;
|
|
3383
|
-
let u =
|
|
3383
|
+
let u = Qi, c = null;
|
|
3384
3384
|
if (l)
|
|
3385
3385
|
try {
|
|
3386
3386
|
u = l();
|
|
@@ -3390,11 +3390,11 @@ class Be {
|
|
|
3390
3390
|
const p = a._ctx, d = p.table, h = d.hook.reading.fire;
|
|
3391
3391
|
this._ctx = { table: d, index: p.index, isPrimKey: !p.index || d.schema.primKey.keyPath && p.index === d.schema.primKey.name, range: u, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: c, or: p.or, valueMapper: h !== _t ? h : null };
|
|
3392
3392
|
})), this.Table = function(a) {
|
|
3393
|
-
return lt(
|
|
3394
|
-
this.db = a, this._tx = c, this.name = l, this.schema = u, this.hook = a._allTables[l] ? a._allTables[l].hook : wt(null, { creating: [
|
|
3393
|
+
return lt(Qo.prototype, function(l, u, c) {
|
|
3394
|
+
this.db = a, this._tx = c, this.name = l, this.schema = u, this.hook = a._allTables[l] ? a._allTables[l].hook : wt(null, { creating: [Ko, C], reading: [No, _t], updating: [Mo, C], deleting: [Fo, C] });
|
|
3395
3395
|
});
|
|
3396
3396
|
}(this), this.Transaction = function(a) {
|
|
3397
|
-
return lt(
|
|
3397
|
+
return lt(na.prototype, function(l, u, c, p, d) {
|
|
3398
3398
|
this.db = a, this.mode = l, this.storeNames = u, this.schema = c, this.chromeTransactionDurability = p, this.idbtrans = null, this.on = wt(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new L((h, w) => {
|
|
3399
3399
|
this._resolve = h, this._reject = w;
|
|
3400
3400
|
}), this._completion.then(() => {
|
|
@@ -3405,11 +3405,11 @@ class Be {
|
|
|
3405
3405
|
});
|
|
3406
3406
|
});
|
|
3407
3407
|
}(this), this.Version = function(a) {
|
|
3408
|
-
return lt(
|
|
3408
|
+
return lt(aa.prototype, function(l) {
|
|
3409
3409
|
this.db = a, this._cfg = { version: l, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3410
3410
|
});
|
|
3411
3411
|
}(this), this.WhereClause = function(a) {
|
|
3412
|
-
return lt(
|
|
3412
|
+
return lt(Zi.prototype, function(l, u, c) {
|
|
3413
3413
|
this.db = a, this._ctx = { table: l, index: u === ":id" ? null : u, or: c };
|
|
3414
3414
|
const p = a._deps.indexedDB;
|
|
3415
3415
|
if (!p)
|
|
@@ -3422,7 +3422,7 @@ class Be {
|
|
|
3422
3422
|
!a.newVersion || a.newVersion < a.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${a.oldVersion / 10}`);
|
|
3423
3423
|
}), this._maxKey = Lt(n.IDBKeyRange), this._createTransaction = (a, l, u, c) => new this.Transaction(a, l, u, this._options.chromeTransactionDurability, c), this._fireOnBlocked = (a) => {
|
|
3424
3424
|
this.on("blocked").fire(a), yt.filter((l) => l.name === this.name && l !== this && !l._state.vcFired).map((l) => l.on("versionchange").fire(a));
|
|
3425
|
-
}, this.use(
|
|
3425
|
+
}, this.use(da), this.use(pa), this.use(ma), this.use(ha), this.vip = Object.create(this, { _vip: { value: !0 } }), i.forEach((a) => a(this));
|
|
3426
3426
|
}
|
|
3427
3427
|
version(t) {
|
|
3428
3428
|
if (isNaN(t) || t < 0.1)
|
|
@@ -3432,7 +3432,7 @@ class Be {
|
|
|
3432
3432
|
this.verno = Math.max(this.verno, t);
|
|
3433
3433
|
const n = this._versions;
|
|
3434
3434
|
var r = n.filter((i) => i._cfg.version === t)[0];
|
|
3435
|
-
return r || (r = new this.Version(t), n.push(r), n.sort(
|
|
3435
|
+
return r || (r = new this.Version(t), n.push(r), n.sort(sa), r.stores({}), this._state.autoSchema = !1, r);
|
|
3436
3436
|
}
|
|
3437
3437
|
_whenReady(t) {
|
|
3438
3438
|
return this.idbdb && (this._state.openComplete || U.letThrough || this._vip) ? t() : new L((n, r) => {
|
|
@@ -3455,7 +3455,7 @@ class Be {
|
|
|
3455
3455
|
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter((i) => r ? i.create !== r : !!n && i.name !== n)), this;
|
|
3456
3456
|
}
|
|
3457
3457
|
open() {
|
|
3458
|
-
return
|
|
3458
|
+
return ca(this);
|
|
3459
3459
|
}
|
|
3460
3460
|
_close() {
|
|
3461
3461
|
const t = this._state, n = yt.indexOf(this);
|
|
@@ -3514,7 +3514,7 @@ class Be {
|
|
|
3514
3514
|
return F(this._allTables).map((t) => this._allTables[t]);
|
|
3515
3515
|
}
|
|
3516
3516
|
transaction() {
|
|
3517
|
-
const t =
|
|
3517
|
+
const t = ua.apply(this, arguments);
|
|
3518
3518
|
return this._transaction.apply(this, t);
|
|
3519
3519
|
}
|
|
3520
3520
|
_transaction(t, n, r) {
|
|
@@ -3555,7 +3555,7 @@ class Be {
|
|
|
3555
3555
|
p(u);
|
|
3556
3556
|
}) : $(u);
|
|
3557
3557
|
}
|
|
3558
|
-
const l =
|
|
3558
|
+
const l = rs.bind(null, this, o, a, i, r);
|
|
3559
3559
|
return i ? i._promise(o, l, "lock") : U.trans ? st(U.transless, () => this._whenReady(l)) : this._whenReady(l);
|
|
3560
3560
|
}
|
|
3561
3561
|
table(t) {
|
|
@@ -3564,26 +3564,26 @@ class Be {
|
|
|
3564
3564
|
return this._allTables[t];
|
|
3565
3565
|
}
|
|
3566
3566
|
}
|
|
3567
|
-
const
|
|
3568
|
-
class
|
|
3567
|
+
const ya = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable";
|
|
3568
|
+
class wa {
|
|
3569
3569
|
constructor(t) {
|
|
3570
3570
|
this._subscribe = t;
|
|
3571
3571
|
}
|
|
3572
3572
|
subscribe(t, n, r) {
|
|
3573
3573
|
return this._subscribe(t && typeof t != "function" ? t : { next: t, error: n, complete: r });
|
|
3574
3574
|
}
|
|
3575
|
-
[
|
|
3575
|
+
[ya]() {
|
|
3576
3576
|
return this;
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
|
-
function
|
|
3579
|
+
function ss(e, t) {
|
|
3580
3580
|
return F(t).forEach((n) => {
|
|
3581
3581
|
cn(e[n] || (e[n] = new ue()), t[n]);
|
|
3582
3582
|
}), e;
|
|
3583
3583
|
}
|
|
3584
|
-
function
|
|
3584
|
+
function ga(e) {
|
|
3585
3585
|
let t, n = !1;
|
|
3586
|
-
const r = new
|
|
3586
|
+
const r = new wa((i) => {
|
|
3587
3587
|
const s = gr(e);
|
|
3588
3588
|
let o = !1, a = {}, l = {};
|
|
3589
3589
|
const u = { get closed() {
|
|
@@ -3594,10 +3594,10 @@ function wa(e) {
|
|
|
3594
3594
|
i.start && i.start(u);
|
|
3595
3595
|
let c = !1, p = !1;
|
|
3596
3596
|
function d() {
|
|
3597
|
-
return F(l).some((m) => a[m] &&
|
|
3597
|
+
return F(l).some((m) => a[m] && fa(a[m], l[m]));
|
|
3598
3598
|
}
|
|
3599
3599
|
const h = (m) => {
|
|
3600
|
-
|
|
3600
|
+
ss(a, m), d() && w();
|
|
3601
3601
|
}, w = () => {
|
|
3602
3602
|
if (c || o)
|
|
3603
3603
|
return;
|
|
@@ -3662,12 +3662,12 @@ tt(xe, { ...Vt, delete: (e) => new xe(e, { addons: [] }).delete(), exists: (e) =
|
|
|
3662
3662
|
const n = L.resolve(typeof e == "function" ? xe.ignoreTransaction(e) : e).timeout(t || 6e4);
|
|
3663
3663
|
return U.trans ? U.trans.waitFor(n) : n;
|
|
3664
3664
|
}, Promise: L, debug: { get: () => le, set: (e) => {
|
|
3665
|
-
|
|
3666
|
-
} }, derive: Je, extend: H, props: tt, override:
|
|
3665
|
+
Bi(e, e === "dexie" ? () => !0 : Ji);
|
|
3666
|
+
} }, derive: Je, extend: H, props: tt, override: Pi, Events: wt, on: Ue, liveQuery: ga, extendObservabilitySet: ss, getByKeyPath: ye, setByKeyPath: ie, delByKeyPath: function(e, t) {
|
|
3667
3667
|
typeof t == "string" ? ie(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3668
3668
|
ie(e, n, void 0);
|
|
3669
3669
|
});
|
|
3670
|
-
}, shallowClone:
|
|
3670
|
+
}, shallowClone: Di, deepClone: xt, getObjectDiff: Ur, cmp: G, asap: Oi, minKey: Jn, addons: [], connections: yt, errnames: br, dependencies: ar, semVer: $r, version: $r.split(".").map((e) => parseInt(e)).reduce((e, t, n) => e + t / Math.pow(10, 2 * n)) }), xe.maxKey = Lt(xe.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Ue(kt, (e) => {
|
|
3671
3671
|
if (!fe) {
|
|
3672
3672
|
let t;
|
|
3673
3673
|
fn ? (t = document.createEvent("CustomEvent"), t.initCustomEvent(Se, !0, !0, e)) : t = new CustomEvent(Se, { detail: e }), fe = !0, dispatchEvent(t), fe = !1;
|
|
@@ -3701,15 +3701,15 @@ if (typeof BroadcastChannel < "u") {
|
|
|
3701
3701
|
});
|
|
3702
3702
|
}
|
|
3703
3703
|
L.rejectionMapper = function(e, t) {
|
|
3704
|
-
if (!e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !
|
|
3704
|
+
if (!e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Nr[e.name])
|
|
3705
3705
|
return e;
|
|
3706
|
-
var n = new
|
|
3706
|
+
var n = new Nr[e.name](t || e.message, e);
|
|
3707
3707
|
return "stack" in e && me(n, "stack", { get: function() {
|
|
3708
3708
|
return this.inner.stack;
|
|
3709
3709
|
} }), n;
|
|
3710
|
-
},
|
|
3710
|
+
}, Bi(le, Ji);
|
|
3711
3711
|
var ot = /* @__PURE__ */ ((e) => (e.ReadyForUpload = "ReadyForUpload", e.UploadComplete = "UploadComplete", e))(ot || {}), je = /* @__PURE__ */ ((e) => (e.After = "after", e.Before = "before", e.BeforeAndAfter = "beforeAndAfter", e))(je || {});
|
|
3712
|
-
const
|
|
3712
|
+
const os = async (e, t) => {
|
|
3713
3713
|
const n = performance.now();
|
|
3714
3714
|
try {
|
|
3715
3715
|
await e();
|
|
@@ -3718,7 +3718,7 @@ const ss = async (e, t) => {
|
|
|
3718
3718
|
let i = At[t];
|
|
3719
3719
|
i || (i = hn(t)), i.report(r / 1e3);
|
|
3720
3720
|
}
|
|
3721
|
-
},
|
|
3721
|
+
}, as = (e, t) => {
|
|
3722
3722
|
const n = performance.now();
|
|
3723
3723
|
try {
|
|
3724
3724
|
e();
|
|
@@ -3727,21 +3727,21 @@ const ss = async (e, t) => {
|
|
|
3727
3727
|
let i = At[t];
|
|
3728
3728
|
i || (i = hn(t)), i.report(r / 1e3);
|
|
3729
3729
|
}
|
|
3730
|
-
}, lr = "sprig.sessionId",
|
|
3731
|
-
ke.setItem(
|
|
3732
|
-
}, Me = () => !!ke.getItem(
|
|
3730
|
+
}, lr = "sprig.sessionId", ls = "sprig.disableReplayRecording", va = 30, cs = () => {
|
|
3731
|
+
ke.setItem(ls, "disabled");
|
|
3732
|
+
}, Me = () => !!ke.getItem(ls), ba = ["did not allow mutations", "called in an invalid security context"], _a = (e) => {
|
|
3733
3733
|
if (!e)
|
|
3734
3734
|
return !0;
|
|
3735
|
-
for (const t of
|
|
3735
|
+
for (const t of ba)
|
|
3736
3736
|
if (e.toLowerCase().includes(t))
|
|
3737
3737
|
return !1;
|
|
3738
3738
|
return !0;
|
|
3739
|
-
},
|
|
3739
|
+
}, Sa = (e, t, {
|
|
3740
3740
|
reportError: n = !0,
|
|
3741
3741
|
extraInfo: r
|
|
3742
3742
|
}) => {
|
|
3743
|
-
Me() || t instanceof Error && (
|
|
3744
|
-
},
|
|
3743
|
+
Me() || t instanceof Error && (cs(), _a(t == null ? void 0 : t.message) && (n && window.UserLeap.reportError(e, t, r), La()));
|
|
3744
|
+
}, Ea = async (e, t, {
|
|
3745
3745
|
reportError: n
|
|
3746
3746
|
} = {
|
|
3747
3747
|
reportError: !0
|
|
@@ -3763,51 +3763,51 @@ const ss = async (e, t) => {
|
|
|
3763
3763
|
} catch (s) {
|
|
3764
3764
|
window.UserLeap.reportError("Error getting storage estimate", s);
|
|
3765
3765
|
}
|
|
3766
|
-
|
|
3766
|
+
Sa(e, t, {
|
|
3767
3767
|
reportError: n,
|
|
3768
3768
|
extraInfo: r
|
|
3769
3769
|
});
|
|
3770
|
-
},
|
|
3770
|
+
}, ka = () => {
|
|
3771
3771
|
const e = ke.getItem(lr);
|
|
3772
3772
|
if (e)
|
|
3773
3773
|
return I(`Found saved session id: ${e}`), ke.removeItem(lr), e;
|
|
3774
3774
|
const t = nt();
|
|
3775
3775
|
return I(`Generating new uuid: ${t}`), t;
|
|
3776
|
-
}, Y =
|
|
3776
|
+
}, Y = ka();
|
|
3777
3777
|
window.addEventListener("beforeunload", () => {
|
|
3778
3778
|
I(`Before page unload saving session id: ${Y}`), ke.setItem(lr, Y);
|
|
3779
3779
|
});
|
|
3780
|
-
const
|
|
3780
|
+
const La = async () => {
|
|
3781
3781
|
try {
|
|
3782
3782
|
await Promise.allSettled([T.events.clear(), T.chunkUploads.clear(), T.pendingCaptures.clear()]);
|
|
3783
3783
|
} catch {
|
|
3784
3784
|
}
|
|
3785
|
-
}, In = (e, t, n = () => !0) => T.table(t).where("timestamp").below(e).and(n).delete(),
|
|
3785
|
+
}, In = (e, t, n = () => !0) => T.table(t).where("timestamp").below(e).and(n).delete(), Ia = () => {
|
|
3786
3786
|
T.events.where("sessionId").equals(Y).delete(), T.pendingCaptures.where("sessionId").equals(Y).delete();
|
|
3787
|
-
},
|
|
3787
|
+
}, Ua = (e) => {
|
|
3788
3788
|
const t = e.map((n) => ({
|
|
3789
3789
|
...n,
|
|
3790
3790
|
sessionId: n.sessionId ?? Y
|
|
3791
3791
|
}));
|
|
3792
3792
|
return T.events.bulkAdd(t);
|
|
3793
|
-
},
|
|
3793
|
+
}, Aa = async (e, t) => {
|
|
3794
3794
|
let n = [];
|
|
3795
|
-
return await
|
|
3795
|
+
return await os(async () => {
|
|
3796
3796
|
n = await T.events.where("[sessionId+timestamp]").between([Y, e], [Y, t]).toArray();
|
|
3797
3797
|
}, $e.ReplayGetEventsBetween), n;
|
|
3798
|
-
},
|
|
3799
|
-
const r = /* @__PURE__ */ new Date(), i = r.setMinutes(r.getMinutes() + (n ??
|
|
3798
|
+
}, xa = (e, t, n) => {
|
|
3799
|
+
const r = /* @__PURE__ */ new Date(), i = r.setMinutes(r.getMinutes() + (n ?? va));
|
|
3800
3800
|
return T.events.where("[sessionId+timestamp]").between([Y, e], [Y, t]).modify({
|
|
3801
3801
|
expiredAt: i
|
|
3802
3802
|
});
|
|
3803
|
-
},
|
|
3803
|
+
}, Pa = (e) => T.chunkUploads.add({
|
|
3804
3804
|
...e,
|
|
3805
3805
|
sessionId: e.sessionId ?? Y
|
|
3806
3806
|
}), Oa = (e, t) => T.chunkUploads.update(e, {
|
|
3807
3807
|
data: null,
|
|
3808
3808
|
etag: t,
|
|
3809
3809
|
status: ot.UploadComplete
|
|
3810
|
-
}),
|
|
3810
|
+
}), Ra = ({
|
|
3811
3811
|
status: e,
|
|
3812
3812
|
uploadId: t
|
|
3813
3813
|
}) => t ? T.chunkUploads.where({
|
|
@@ -3816,19 +3816,19 @@ const ka = async () => {
|
|
|
3816
3816
|
}).toArray() : T.chunkUploads.where({
|
|
3817
3817
|
sessionId: Y,
|
|
3818
3818
|
status: e
|
|
3819
|
-
}).toArray(),
|
|
3819
|
+
}).toArray(), Da = (e) => T.chunkUploads.where({
|
|
3820
3820
|
uploadId: e,
|
|
3821
3821
|
status: ot.UploadComplete
|
|
3822
|
-
}).toArray(),
|
|
3822
|
+
}).toArray(), Ta = (e) => T.chunkUploads.where({
|
|
3823
3823
|
uploadId: e,
|
|
3824
3824
|
status: ot.UploadComplete
|
|
3825
|
-
}).delete(),
|
|
3825
|
+
}).delete(), Ca = (e) => T.pendingCaptures.add({
|
|
3826
3826
|
...e,
|
|
3827
3827
|
sessionId: e.sessionId ?? Y,
|
|
3828
3828
|
canUpload: !1
|
|
3829
|
-
}),
|
|
3829
|
+
}), Ba = () => T.pendingCaptures.where("sessionId").equals(Y).and((e) => e.targetTimestamp < Date.now()).toArray(), ja = () => T.pendingCaptures.where("sessionId").equals(Y).toArray(), Na = (e) => T.pendingCaptures.where("sessionId").equals(Y).and((t) => t.captureParams.responseGroupId === e).modify({
|
|
3830
3830
|
canUpload: !0
|
|
3831
|
-
}),
|
|
3831
|
+
}), Ka = async (e) => {
|
|
3832
3832
|
var t;
|
|
3833
3833
|
if ((t = window.navigator.storage) != null && t.estimate) {
|
|
3834
3834
|
const {
|
|
@@ -3840,7 +3840,7 @@ const ka = async () => {
|
|
|
3840
3840
|
}
|
|
3841
3841
|
return !0;
|
|
3842
3842
|
};
|
|
3843
|
-
class
|
|
3843
|
+
class Fa extends Be {
|
|
3844
3844
|
constructor() {
|
|
3845
3845
|
super("replayStorage", {
|
|
3846
3846
|
autoOpen: !1
|
|
@@ -3850,24 +3850,24 @@ class Ka extends Be {
|
|
|
3850
3850
|
K(this, "pendingCaptures");
|
|
3851
3851
|
}
|
|
3852
3852
|
}
|
|
3853
|
-
const T = new
|
|
3853
|
+
const T = new Fa();
|
|
3854
3854
|
T.version(1).stores({
|
|
3855
3855
|
events: "uuid, timestamp, [sessionId+timestamp]",
|
|
3856
3856
|
chunkUploads: "uuid, timestamp, [sessionId+status], [uploadId+status], [sessionId+status+uploadId]",
|
|
3857
3857
|
pendingCaptures: "uuid, timestamp, [sessionId+targetTimestamp]"
|
|
3858
3858
|
});
|
|
3859
3859
|
T.open().catch((e) => {
|
|
3860
|
-
|
|
3860
|
+
Si(`Error opening replay storage: ${JSON.stringify(e)}`), cs();
|
|
3861
3861
|
});
|
|
3862
|
-
const
|
|
3862
|
+
const Ma = async (e, t, n) => new Promise((r, i) => {
|
|
3863
3863
|
const s = e.createElement("script");
|
|
3864
3864
|
s.src = t, s.onload = r, s.onerror = i, n && (s.nonce = n), e.head.appendChild(s);
|
|
3865
3865
|
});
|
|
3866
|
-
let
|
|
3867
|
-
const
|
|
3868
|
-
let
|
|
3866
|
+
let Jr = 1, cr = 5e3, Jt = 6e4;
|
|
3867
|
+
const $a = 5, Qr = 1e3, us = 30, un = us + $a, xr = "sprig.pendingCount";
|
|
3868
|
+
let Xr = 0, Zr = Date.now(), yn = !1, Qt;
|
|
3869
3869
|
var ur = /* @__PURE__ */ ((e) => (e.Left = "left_click", e.Right = "right_click", e))(ur || {});
|
|
3870
|
-
const
|
|
3870
|
+
const Va = async (e, t, n, r = 2, i) => {
|
|
3871
3871
|
try {
|
|
3872
3872
|
if (Me()) {
|
|
3873
3873
|
I("Not initializing replay because recording is disabled");
|
|
@@ -3877,11 +3877,11 @@ const $a = async (e, t, n, r = 2, i) => {
|
|
|
3877
3877
|
I("Not initializing replay because config didn't specify maxReplayDurationSeconds");
|
|
3878
3878
|
return;
|
|
3879
3879
|
}
|
|
3880
|
-
if (i != null && i.minAvailableGb && (
|
|
3880
|
+
if (i != null && i.minAvailableGb && (Jr = i.minAvailableGb), !await Ka(Jr)) {
|
|
3881
3881
|
Rn("Minimum storage not available");
|
|
3882
3882
|
return;
|
|
3883
3883
|
}
|
|
3884
|
-
I("Initializing replay"), i != null && i.minDuration && (cr = i.minDuration), i != null && i.batchDuration && (Jt = i.batchDuration),
|
|
3884
|
+
I("Initializing replay"), i != null && i.minDuration && (cr = i.minDuration), i != null && i.batchDuration && (Jt = i.batchDuration), Lo(r), Ja(), za(t + un, 30 * 60, t + un), Ga(), window.rrwebRecord || (I("Loading recording script"), await Ma(e, "https://cdn.sprig.com/dependencies/record-2.0.0-alpha.6.min.js", n), I("Recording script finished loading"));
|
|
3885
3885
|
const s = window.rrwebRecord;
|
|
3886
3886
|
if (!s) {
|
|
3887
3887
|
Rn("Record script failed to set global function");
|
|
@@ -3889,7 +3889,7 @@ const $a = async (e, t, n, r = 2, i) => {
|
|
|
3889
3889
|
}
|
|
3890
3890
|
let o = !0, a = 0;
|
|
3891
3891
|
Qt = s({
|
|
3892
|
-
checkoutEveryNms:
|
|
3892
|
+
checkoutEveryNms: us * 1e3,
|
|
3893
3893
|
sampling: {
|
|
3894
3894
|
input: "last",
|
|
3895
3895
|
scroll: 250,
|
|
@@ -3898,14 +3898,14 @@ const $a = async (e, t, n, r = 2, i) => {
|
|
|
3898
3898
|
emit: (l, u) => {
|
|
3899
3899
|
if (Me())
|
|
3900
3900
|
return;
|
|
3901
|
-
if (
|
|
3901
|
+
if (Zr = Date.now(), u && l.type === 4)
|
|
3902
3902
|
a = performance.now();
|
|
3903
3903
|
else if (u && a && l.type === 2) {
|
|
3904
3904
|
const p = performance.now() - a;
|
|
3905
|
-
|
|
3905
|
+
wo($e.ReplayFullSnapshot, p / 1e3);
|
|
3906
3906
|
}
|
|
3907
3907
|
const c = o || !!u;
|
|
3908
|
-
o = !1,
|
|
3908
|
+
o = !1, qa({
|
|
3909
3909
|
uuid: nt(),
|
|
3910
3910
|
event: JSON.stringify(l),
|
|
3911
3911
|
isValidStart: c,
|
|
@@ -3913,45 +3913,45 @@ const $a = async (e, t, n, r = 2, i) => {
|
|
|
3913
3913
|
});
|
|
3914
3914
|
},
|
|
3915
3915
|
...i
|
|
3916
|
-
}), yn = !0,
|
|
3917
|
-
Date.now() -
|
|
3918
|
-
},
|
|
3916
|
+
}), yn = !0, Xr || (Xr = window.setInterval(() => {
|
|
3917
|
+
Date.now() - Zr > Qr && ge("Sprig_Noop", {});
|
|
3918
|
+
}, Qr));
|
|
3919
3919
|
} catch (s) {
|
|
3920
3920
|
return ne("Error initializing replay", s);
|
|
3921
3921
|
}
|
|
3922
3922
|
};
|
|
3923
3923
|
let dr = !1, pr = [];
|
|
3924
|
-
const
|
|
3925
|
-
pr.push(e), dr ||
|
|
3926
|
-
},
|
|
3924
|
+
const qa = (e) => {
|
|
3925
|
+
pr.push(e), dr || Wa();
|
|
3926
|
+
}, Wa = () => {
|
|
3927
3927
|
dr = !0, setTimeout(async () => {
|
|
3928
3928
|
if (Me())
|
|
3929
3929
|
return;
|
|
3930
3930
|
const e = pr;
|
|
3931
|
-
pr = [], dr = !1,
|
|
3931
|
+
pr = [], dr = !1, as(async () => {
|
|
3932
3932
|
try {
|
|
3933
|
-
await
|
|
3933
|
+
await Ua(e);
|
|
3934
3934
|
} catch (t) {
|
|
3935
3935
|
ne("Error storing replay events", t);
|
|
3936
3936
|
}
|
|
3937
3937
|
}, $e.ReplayAddEventBatch);
|
|
3938
3938
|
}, 500);
|
|
3939
|
-
},
|
|
3939
|
+
}, za = (e = 6 * 60, t = 30 * 60, n = 4 * 60) => {
|
|
3940
3940
|
const r = setInterval(() => {
|
|
3941
3941
|
const i = Date.now();
|
|
3942
|
-
Me() || (vt(`Performing periodic replay data cleanup / Event Seconds ${e} / Chunk Seconds ${t} / Pending Capture Seconds ${n}`),
|
|
3942
|
+
Me() || (vt(`Performing periodic replay data cleanup / Event Seconds ${e} / Chunk Seconds ${t} / Pending Capture Seconds ${n}`), os(() => T.transaction("rw!", T.events, T.chunkUploads, T.pendingCaptures, () => {
|
|
3943
3943
|
In(i - e * 1e3, "events", (s) => s.expiredAt === void 0 || s.expiredAt < i - e * 1e3), In(i - t * 1e3, "chunkUploads"), In(i - n * 1e3, "pendingCaptures", (s) => s.canUpload === void 0 || s.canUpload === !1);
|
|
3944
3944
|
}).catch((s) => {
|
|
3945
3945
|
clearInterval(r), ne("Error deleting table rows", s);
|
|
3946
3946
|
}), $e.ReplayCleanup), I("Cleanup complete"));
|
|
3947
3947
|
}, 3e4);
|
|
3948
|
-
},
|
|
3949
|
-
setInterval(
|
|
3950
|
-
},
|
|
3948
|
+
}, Ga = (e = 5) => {
|
|
3949
|
+
setInterval(tl, e * 1e3);
|
|
3950
|
+
}, Ha = async (e, t, n, r, i) => {
|
|
3951
3951
|
try {
|
|
3952
3952
|
const s = Math.min(e + i, n), o = `from: ${new Date(e).toLocaleTimeString()} to ${new Date(s).toLocaleTimeString()}`;
|
|
3953
3953
|
I(`Getting event batch ${o}`);
|
|
3954
|
-
const a = await
|
|
3954
|
+
const a = await Aa(e, s);
|
|
3955
3955
|
if (!(a != null && a.length))
|
|
3956
3956
|
return I(`No events found ${o}`), [r, []];
|
|
3957
3957
|
if (!r) {
|
|
@@ -3971,7 +3971,7 @@ const Va = (e) => {
|
|
|
3971
3971
|
} catch (s) {
|
|
3972
3972
|
ne("Error getting events batch", s);
|
|
3973
3973
|
}
|
|
3974
|
-
},
|
|
3974
|
+
}, Ya = (e, t, n) => {
|
|
3975
3975
|
const r = e.length, i = t * 1024 * 1024, s = Math.ceil(r / n), o = Math.max(i, s);
|
|
3976
3976
|
I(`Total file bytes: ${r} / target chunk size: ${o}`);
|
|
3977
3977
|
const a = [];
|
|
@@ -3979,12 +3979,12 @@ const Va = (e) => {
|
|
|
3979
3979
|
for (; l < r; )
|
|
3980
3980
|
a.push(e.slice(l, l + o)), l += o;
|
|
3981
3981
|
return a;
|
|
3982
|
-
},
|
|
3983
|
-
const n = await
|
|
3982
|
+
}, ds = (e) => Promise.all(e.map(async (t) => {
|
|
3983
|
+
const n = await Uo(t);
|
|
3984
3984
|
return await Oa(t.uuid, n), t.uploadId;
|
|
3985
|
-
})),
|
|
3985
|
+
})), ps = async (e) => {
|
|
3986
3986
|
I(`Marking upload complete if finished: ${e}`);
|
|
3987
|
-
const t = await
|
|
3987
|
+
const t = await Da(e);
|
|
3988
3988
|
if (!(t != null && t.length)) {
|
|
3989
3989
|
I(`No finished chunks found for upload: ${e}`);
|
|
3990
3990
|
return;
|
|
@@ -3995,7 +3995,7 @@ const Va = (e) => {
|
|
|
3995
3995
|
ETag: s.etag,
|
|
3996
3996
|
PartNumber: s.chunkIndex
|
|
3997
3997
|
})).filter((s) => s.ETag !== null), i = n[0];
|
|
3998
|
-
await
|
|
3998
|
+
await Ai({
|
|
3999
3999
|
apiUrl: i.apiUrl,
|
|
4000
4000
|
surveyId: i.surveyId,
|
|
4001
4001
|
uploadId: e,
|
|
@@ -4003,28 +4003,28 @@ const Va = (e) => {
|
|
|
4003
4003
|
etags: r,
|
|
4004
4004
|
headers: i.completeUploadHeaders,
|
|
4005
4005
|
replayDuration: i.replayDuration
|
|
4006
|
-
}), I(`Cleaning up chunks for ${e}`), await
|
|
4007
|
-
},
|
|
4006
|
+
}), I(`Cleaning up chunks for ${e}`), await Ta(e), I(`Done cleaning up chunks for ${e}`);
|
|
4007
|
+
}, Ja = async () => {
|
|
4008
4008
|
try {
|
|
4009
4009
|
let e = [];
|
|
4010
4010
|
if (await T.transaction("rw", T.chunkUploads, async () => {
|
|
4011
|
-
e = await
|
|
4011
|
+
e = await Ra({
|
|
4012
4012
|
status: ot.ReadyForUpload
|
|
4013
4013
|
}).catch((n) => {
|
|
4014
4014
|
ne("chunkUploads transaction error", n);
|
|
4015
4015
|
});
|
|
4016
4016
|
}), !(e != null && e.length))
|
|
4017
4017
|
return;
|
|
4018
|
-
const t = await
|
|
4018
|
+
const t = await ds(e);
|
|
4019
4019
|
I(`Finished uploading unfinished chunks for ${t}`), t != null && t.length && await Promise.all(t.map(async (n) => {
|
|
4020
|
-
n && await
|
|
4020
|
+
n && await ps(n);
|
|
4021
4021
|
}));
|
|
4022
4022
|
} catch (e) {
|
|
4023
4023
|
ne("Error getting chunk upload uuids", e);
|
|
4024
4024
|
}
|
|
4025
|
-
},
|
|
4026
|
-
await
|
|
4027
|
-
},
|
|
4025
|
+
}, Qa = async (e, t) => {
|
|
4026
|
+
await ds(t), I(`Done uploading chunks for uploads: ${e.join(",")}`), await Promise.all(e.map((n) => ps(n)));
|
|
4027
|
+
}, Xa = (e) => {
|
|
4028
4028
|
let t = 0;
|
|
4029
4029
|
e.forEach((i) => {
|
|
4030
4030
|
t += i.length;
|
|
@@ -4034,43 +4034,43 @@ const Va = (e) => {
|
|
|
4034
4034
|
return e.forEach((i) => {
|
|
4035
4035
|
n.set(i, r), r += i.length;
|
|
4036
4036
|
}), n;
|
|
4037
|
-
},
|
|
4037
|
+
}, ei = async (e, t, n) => {
|
|
4038
4038
|
const r = new TextEncoder();
|
|
4039
4039
|
let i = null, s = null, o = null, a = !1, l = !1, [u, c] = [0, 0];
|
|
4040
4040
|
const p = e - un * 1e3, d = [];
|
|
4041
4041
|
let h = [];
|
|
4042
4042
|
I(`Getting events between ${new Date(e).toLocaleTimeString()} and ${new Date(t).toLocaleTimeString()}`), I(`Using batch duration: ${Jt}ms`);
|
|
4043
4043
|
for (let m = p; m < t; m += Jt) {
|
|
4044
|
-
if ([l, h] = await
|
|
4044
|
+
if ([l, h] = await Ha(m, e, t, l, Jt), !(h != null && h.length)) {
|
|
4045
4045
|
I("No events found");
|
|
4046
4046
|
continue;
|
|
4047
4047
|
}
|
|
4048
4048
|
u === 0 && (u = h[0].timestamp), c = h[h.length - 1].timestamp, I(`Last event time in batch: ${new Date(c).toLocaleTimeString()}`);
|
|
4049
4049
|
const g = `${a ? "," : "["}${h.map((f) => f.event).join(",")}`, y = r.encode(g);
|
|
4050
|
-
n && s === null && (vt("Attempting compression"), o = new window.CompressionStream("gzip"), s = o.writable.getWriter()),
|
|
4050
|
+
n && s === null && (vt("Attempting compression"), o = new window.CompressionStream("gzip"), s = o.writable.getWriter()), as(() => {
|
|
4051
4051
|
n && s ? s.write(y) : d.push(y);
|
|
4052
4052
|
}, $e.ReplayCompression), a = !0;
|
|
4053
4053
|
}
|
|
4054
4054
|
if (c - u < cr)
|
|
4055
4055
|
return I(`Replay duration is shorter than minimum of ${cr}ms / Start:${u} / End:${c}`), null;
|
|
4056
4056
|
const w = r.encode("]");
|
|
4057
|
-
return vt("Writing final close brace"), s && o ? (s.write(w), s.close(), i = new Uint8Array(await new Response(o.readable).arrayBuffer())) : (d.push(w), i =
|
|
4058
|
-
},
|
|
4057
|
+
return vt("Writing final close brace"), s && o ? (s.write(w), s.close(), i = new Uint8Array(await new Response(o.readable).arrayBuffer())) : (d.push(w), i = Xa(d)), I("Finished generating file data"), i;
|
|
4058
|
+
}, Za = async (e, t) => {
|
|
4059
4059
|
const n = window.CompressionStream !== void 0;
|
|
4060
4060
|
let r = null;
|
|
4061
4061
|
const i = t ?? Date.now(), s = i - e;
|
|
4062
4062
|
try {
|
|
4063
|
-
r = await
|
|
4063
|
+
r = await ei(s, i, n);
|
|
4064
4064
|
} catch (o) {
|
|
4065
4065
|
if (o instanceof Error && window.UserLeap.reportError("Error compressing replay", o), n)
|
|
4066
4066
|
try {
|
|
4067
|
-
r = await
|
|
4067
|
+
r = await ei(s, i, !1);
|
|
4068
4068
|
} catch (a) {
|
|
4069
4069
|
ne("fileData fallback failed", a);
|
|
4070
4070
|
}
|
|
4071
4071
|
}
|
|
4072
4072
|
return r;
|
|
4073
|
-
},
|
|
4073
|
+
}, ti = async (e) => {
|
|
4074
4074
|
const {
|
|
4075
4075
|
surveyId: t,
|
|
4076
4076
|
responseGroupId: n,
|
|
@@ -4079,14 +4079,14 @@ const Va = (e) => {
|
|
|
4079
4079
|
completeUploadHeaders: s,
|
|
4080
4080
|
replayParams: o,
|
|
4081
4081
|
triggerTimestamp: a
|
|
4082
|
-
} = e, l = await
|
|
4082
|
+
} = e, l = await Za(o.replayDurationSeconds * 1e3, a);
|
|
4083
4083
|
if (l != null && l.length)
|
|
4084
4084
|
I(`Found file data for survey: ${t}`);
|
|
4085
4085
|
else {
|
|
4086
4086
|
I(`File data is empty for survey: ${t}`);
|
|
4087
4087
|
return;
|
|
4088
4088
|
}
|
|
4089
|
-
const u =
|
|
4089
|
+
const u = Ya(l, o.minimumChunkSizeMb, o.signedUrls.length);
|
|
4090
4090
|
I(`Got ${u.length} chunks for survey: ${t}`);
|
|
4091
4091
|
const c = await Promise.all(u.map(async (p, d) => {
|
|
4092
4092
|
const h = nt(), w = {
|
|
@@ -4111,10 +4111,10 @@ const Va = (e) => {
|
|
|
4111
4111
|
uploadId: w.uploadId,
|
|
4112
4112
|
size: p.length,
|
|
4113
4113
|
id: h
|
|
4114
|
-
}, null, 2)}`), await
|
|
4114
|
+
}, null, 2)}`), await Pa(w), I(`Done creating chunk upload: ${h}`), w;
|
|
4115
4115
|
}));
|
|
4116
|
-
I(`All chunk records created. Beginning upload for survey: ${t}`), await
|
|
4117
|
-
},
|
|
4116
|
+
I(`All chunk records created. Beginning upload for survey: ${t}`), await Qa([o.uploadId], c);
|
|
4117
|
+
}, hs = async (e, t) => {
|
|
4118
4118
|
try {
|
|
4119
4119
|
if (I(`Attempting replay capture: ${JSON.stringify({
|
|
4120
4120
|
isStandalone: e.isStandalone,
|
|
@@ -4135,38 +4135,38 @@ const Va = (e) => {
|
|
|
4135
4135
|
triggerTimestamp: i,
|
|
4136
4136
|
responseGroupId: s
|
|
4137
4137
|
} = e, o = async () => {
|
|
4138
|
-
setTimeout(() => R.removeListener(
|
|
4138
|
+
setTimeout(() => R.removeListener(O.QuestionAnswered, o), 0), r.replayDurationType === je.Before ? await ti(e) : await Na(s);
|
|
4139
4139
|
};
|
|
4140
4140
|
if (r.replayDurationType === je.After || r.replayDurationType === je.BeforeAndAfter) {
|
|
4141
|
-
n || (I("Attaching QuestionAnswered listener for non-standalone replay"), R.on(
|
|
4141
|
+
n || (I("Attaching QuestionAnswered listener for non-standalone replay"), R.on(O.QuestionAnswered, o)), I(`Scheduling capture for replay of type: ${r.replayDurationType}`), await el(e);
|
|
4142
4142
|
return;
|
|
4143
4143
|
}
|
|
4144
4144
|
if (n || t)
|
|
4145
|
-
I(`Proceeding to capture replay for survey: ${e.surveyId} / standalone? ${n} / canUpload? ${t}`), await
|
|
4145
|
+
I(`Proceeding to capture replay for survey: ${e.surveyId} / standalone? ${n} / canUpload? ${t}`), await ti(e);
|
|
4146
4146
|
else {
|
|
4147
4147
|
const a = un + r.replayDurationSeconds, l = i - a * 1e3, u = i;
|
|
4148
|
-
I(`Setting expiry minutes to ${r.expirationTimeLimitMinutes} for events from ${new Date(l).toLocaleTimeString()} to ${new Date(u).toLocaleTimeString()}`), await
|
|
4148
|
+
I(`Setting expiry minutes to ${r.expirationTimeLimitMinutes} for events from ${new Date(l).toLocaleTimeString()} to ${new Date(u).toLocaleTimeString()}`), await xa(l, u, r.expirationTimeLimitMinutes), I("Attaching QuestionAnswered listener"), R.on(O.QuestionAnswered, o);
|
|
4149
4149
|
}
|
|
4150
4150
|
} catch (n) {
|
|
4151
4151
|
ne("Error scheduling or capturing replay", n);
|
|
4152
4152
|
}
|
|
4153
|
-
},
|
|
4153
|
+
}, ni = () => {
|
|
4154
4154
|
if (Me()) {
|
|
4155
4155
|
vt("Not clearing user data, replay is disabled");
|
|
4156
4156
|
return;
|
|
4157
4157
|
}
|
|
4158
4158
|
try {
|
|
4159
|
-
|
|
4159
|
+
Ia();
|
|
4160
4160
|
} catch (e) {
|
|
4161
4161
|
ne("Error clearing session event data", e);
|
|
4162
4162
|
}
|
|
4163
4163
|
};
|
|
4164
4164
|
let he = ke.getItem(xr);
|
|
4165
|
-
const
|
|
4165
|
+
const el = async (e) => {
|
|
4166
4166
|
I(`Scheduling replay capture: ${JSON.stringify(e)}`);
|
|
4167
4167
|
const {
|
|
4168
4168
|
surveyId: t
|
|
4169
|
-
} = e, n = await
|
|
4169
|
+
} = e, n = await ja(), r = n == null ? void 0 : n.filter((o) => o.captureParams.surveyId === t);
|
|
4170
4170
|
if (r != null && r.length) {
|
|
4171
4171
|
I(`Pending capture exists for survey: ${t}`);
|
|
4172
4172
|
return;
|
|
@@ -4179,18 +4179,18 @@ const Za = async (e) => {
|
|
|
4179
4179
|
};
|
|
4180
4180
|
e.replayParams.replayDurationType === je.BeforeAndAfter && (i.replayParams.replayDurationSeconds *= 2), i.replayParams.replayDurationType = je.Before;
|
|
4181
4181
|
const s = e.triggerTimestamp + e.replayParams.replayDurationSeconds * 1e3;
|
|
4182
|
-
return i.triggerTimestamp = s, he = he ? (parseInt(he) + 1).toString() : "1", ke.setItem(xr, he),
|
|
4182
|
+
return i.triggerTimestamp = s, he = he ? (parseInt(he) + 1).toString() : "1", ke.setItem(xr, he), Ca({
|
|
4183
4183
|
uuid: nt(),
|
|
4184
4184
|
targetTimestamp: s,
|
|
4185
4185
|
timestamp: Date.now(),
|
|
4186
4186
|
captureParams: i
|
|
4187
4187
|
});
|
|
4188
|
-
},
|
|
4188
|
+
}, tl = async () => {
|
|
4189
4189
|
try {
|
|
4190
4190
|
if (he && parseInt(he) > 0) {
|
|
4191
|
-
const e = await
|
|
4191
|
+
const e = await Ba();
|
|
4192
4192
|
e.length && await Promise.all(e.map(async (t) => {
|
|
4193
|
-
await T.pendingCaptures.delete(t.uuid), await
|
|
4193
|
+
await T.pendingCaptures.delete(t.uuid), await hs(t.captureParams, t.canUpload);
|
|
4194
4194
|
})), he = (parseInt(he) - e.length).toString(), ke.setItem(xr, he);
|
|
4195
4195
|
}
|
|
4196
4196
|
} catch (e) {
|
|
@@ -4204,52 +4204,53 @@ const Za = async (e) => {
|
|
|
4204
4204
|
} catch (i) {
|
|
4205
4205
|
ne("Error recording custom event", i);
|
|
4206
4206
|
}
|
|
4207
|
-
},
|
|
4208
|
-
ge("Sprig_PageView", e);
|
|
4209
|
-
}, tl = (e) => {
|
|
4210
|
-
ge("Sprig_TrackEvent", e);
|
|
4207
|
+
}, ri = (e) => {
|
|
4208
|
+
e.description && (e.description = Pr(e.description)), ge("Sprig_PageView", e);
|
|
4211
4209
|
}, nl = (e) => {
|
|
4210
|
+
ge("Sprig_TrackEvent", e);
|
|
4211
|
+
}, rl = (e) => {
|
|
4212
4212
|
ge("Sprig_ShowSurvey", e);
|
|
4213
|
-
},
|
|
4213
|
+
}, Gl = (e) => {
|
|
4214
4214
|
ge("Sprig_SubmitSurvey", e);
|
|
4215
|
-
},
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
ge("Sprig_BackForward", {});
|
|
4215
|
+
}, il = (e) => {
|
|
4216
|
+
var t;
|
|
4217
|
+
(t = e == null ? void 0 : e.elementAttributes) != null && t.text && (e.elementAttributes.text = Pr(e.elementAttributes.text)), ge("Sprig_Click", e);
|
|
4218
|
+
}, sl = (e) => {
|
|
4219
|
+
ge("Sprig_Refresh", e);
|
|
4221
4220
|
}, ol = (e) => {
|
|
4221
|
+
e.currentPageTitle && (e.currentPageTitle = Pr(e.currentPageTitle)), ge("Sprig_BackForward", e);
|
|
4222
|
+
}, al = (e) => {
|
|
4222
4223
|
ge("Sprig_Keystroke", e);
|
|
4223
4224
|
}, ne = (e, t, {
|
|
4224
4225
|
reportError: n
|
|
4225
4226
|
} = {
|
|
4226
4227
|
reportError: !0
|
|
4227
|
-
}) => (Qt && (Qt(), Qt = void 0), yn = !1,
|
|
4228
|
+
}) => (Qt && (Qt(), Qt = void 0), yn = !1, Si(`${e} - ${JSON.stringify(t)}`), Ea(e, t, {
|
|
4228
4229
|
reportError: n
|
|
4229
|
-
})),
|
|
4230
|
+
})), fs = () => yn, Pr = (e) => e && e.trim().substring(0, 500).replace(/\s\s+/g, " ").replace(/\r?\n|\r/g, " ").substring(0, 250), ll = ({
|
|
4230
4231
|
reportingIntervalSeconds: e,
|
|
4231
4232
|
thresholds: t,
|
|
4232
4233
|
postMetrics: n
|
|
4233
4234
|
}) => {
|
|
4234
|
-
|
|
4235
|
-
if (
|
|
4235
|
+
yo(t, (r, i) => {
|
|
4236
|
+
if (fs()) {
|
|
4236
4237
|
const s = `Value: ${r} on ${i.metric} violated threshold of ${i.type} ${i.value}`;
|
|
4237
4238
|
ne("Threshold violated", new Error(s), {
|
|
4238
4239
|
reportError: !1
|
|
4239
|
-
}),
|
|
4240
|
+
}), fo();
|
|
4240
4241
|
}
|
|
4241
|
-
}),
|
|
4242
|
+
}), vo({
|
|
4242
4243
|
reportingIntervalSeconds: e,
|
|
4243
4244
|
postMetrics: n
|
|
4244
|
-
}),
|
|
4245
|
+
}), bo();
|
|
4245
4246
|
}, Un = {
|
|
4246
4247
|
capture: !0
|
|
4247
|
-
},
|
|
4248
|
+
}, cl = ["a", "button", "input", "option", "li", "link"], ul = ["Escape", "Enter", "Backspace", "F5", "Tab"], dl = ["label", "type", "role", "title", "placeholder", "errormessage", "valuetext", "href"], ii = "aria-", pl = (e) => {
|
|
4248
4249
|
if (!e.tagName)
|
|
4249
4250
|
return "No tagName";
|
|
4250
4251
|
const t = e.getAttribute("type");
|
|
4251
4252
|
return t ? `${t} ${e.tagName.toLowerCase()}` : e.tagName.toLowerCase();
|
|
4252
|
-
},
|
|
4253
|
+
}, si = (e) => {
|
|
4253
4254
|
var r;
|
|
4254
4255
|
if (((r = e.tagName) == null ? void 0 : r.toLowerCase()) === "html")
|
|
4255
4256
|
return {
|
|
@@ -4258,47 +4259,54 @@ const Za = async (e) => {
|
|
|
4258
4259
|
const t = e.textContent, n = t ? {
|
|
4259
4260
|
text: t
|
|
4260
4261
|
} : {};
|
|
4261
|
-
n.element =
|
|
4262
|
+
n.element = pl(e);
|
|
4262
4263
|
for (const i of e.attributes) {
|
|
4263
4264
|
let s = i.name;
|
|
4264
4265
|
const o = i.value;
|
|
4265
|
-
s.startsWith(
|
|
4266
|
+
s.startsWith(ii) && (s = s.substring(ii.length)), dl.includes(s) && (n[s] = o);
|
|
4266
4267
|
}
|
|
4267
4268
|
return n;
|
|
4268
|
-
},
|
|
4269
|
+
}, hl = (e) => {
|
|
4269
4270
|
var i;
|
|
4270
4271
|
if (!e)
|
|
4271
4272
|
return {};
|
|
4272
4273
|
const n = {
|
|
4273
|
-
...
|
|
4274
|
+
...si(e)
|
|
4274
4275
|
}, r = e.parentElement;
|
|
4275
|
-
if (r &&
|
|
4276
|
-
const s =
|
|
4276
|
+
if (r && cl.includes((i = r.tagName) == null ? void 0 : i.toLowerCase())) {
|
|
4277
|
+
const s = si(r);
|
|
4277
4278
|
Object.assign(n, s);
|
|
4278
4279
|
}
|
|
4279
4280
|
return n;
|
|
4280
|
-
},
|
|
4281
|
-
|
|
4281
|
+
}, ms = (e, t) => {
|
|
4282
|
+
il({
|
|
4282
4283
|
x: t.x,
|
|
4283
4284
|
y: t.y,
|
|
4284
4285
|
type: e,
|
|
4285
|
-
elementAttributes:
|
|
4286
|
+
elementAttributes: hl(t.target)
|
|
4286
4287
|
});
|
|
4287
|
-
},
|
|
4288
|
-
|
|
4288
|
+
}, fl = (e) => (t) => ms(e, t), ml = (e) => {
|
|
4289
|
+
ul.includes(e.key) && al({
|
|
4289
4290
|
key: e.key
|
|
4290
4291
|
});
|
|
4291
|
-
}, ml = () => {
|
|
4292
|
-
window.performance.getEntriesByType("navigation").map((t) => t.type).includes("reload") && il();
|
|
4293
4292
|
}, yl = () => {
|
|
4294
|
-
window.performance.getEntriesByType("navigation").map((t) => t.type).includes("
|
|
4293
|
+
window.performance.getEntriesByType("navigation").map((t) => t.type).includes("reload") && sl({
|
|
4294
|
+
url: window.location.href,
|
|
4295
|
+
currentPageTitle: document.title
|
|
4296
|
+
});
|
|
4295
4297
|
}, wl = () => {
|
|
4296
|
-
window.
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4298
|
+
window.performance.getEntriesByType("navigation").map((t) => t.type).includes("back_forward") && ol({
|
|
4299
|
+
curUrl: window.location.href,
|
|
4300
|
+
fromUrl: document.referrer,
|
|
4301
|
+
currentPageTitle: document.title
|
|
4302
|
+
});
|
|
4303
|
+
}, gl = () => {
|
|
4304
|
+
window.addEventListener("click", fl(ur.Left), Un), window.addEventListener("mousedown", (e) => {
|
|
4305
|
+
e.button === 2 && ms(ur.Right, e);
|
|
4306
|
+
}, Un), window.addEventListener("keydown", ml, Un), yl(), wl();
|
|
4307
|
+
}, vl = ["popState", "pushState", "replaceState"], bl = {
|
|
4300
4308
|
test: "test"
|
|
4301
|
-
}, ct = "!email",
|
|
4309
|
+
}, ct = "!email", _l = ["ios", "android"], Ee = "environments", hr = "pageUrl", Pe = "visitors", oi = "ul-view-sdk-script", ai = Object.freeze({
|
|
4302
4310
|
contains: (e, t) => t.includes(e),
|
|
4303
4311
|
notContains: (e, t) => !t.includes(e),
|
|
4304
4312
|
exactly: (e, t) => t === e,
|
|
@@ -4312,7 +4320,7 @@ function Or(e, t) {
|
|
|
4312
4320
|
const {
|
|
4313
4321
|
matchType: n,
|
|
4314
4322
|
pattern: r
|
|
4315
|
-
} = e, i = n ?
|
|
4323
|
+
} = e, i = n ? ai[n] : ai.legacy;
|
|
4316
4324
|
let s = !1;
|
|
4317
4325
|
try {
|
|
4318
4326
|
s = i(r, t);
|
|
@@ -4322,7 +4330,7 @@ function Or(e, t) {
|
|
|
4322
4330
|
}
|
|
4323
4331
|
return s;
|
|
4324
4332
|
}
|
|
4325
|
-
function
|
|
4333
|
+
function Sl(e, t) {
|
|
4326
4334
|
const {
|
|
4327
4335
|
pageUrlEvents: n,
|
|
4328
4336
|
interactiveEvents: r,
|
|
@@ -4344,12 +4352,12 @@ function Ut(e) {
|
|
|
4344
4352
|
} = window.UserLeap._config;
|
|
4345
4353
|
if (i && i !== dn.Web)
|
|
4346
4354
|
return;
|
|
4347
|
-
const s =
|
|
4348
|
-
t &&
|
|
4355
|
+
const s = Oe("trackStartUrl"), o = s ? String(s) : null;
|
|
4356
|
+
t && vs(window.location.href), n && (ws(), El()), r && o && o !== window.location.href && e && vl.includes(e.type) && window.UserLeap("dismissActiveSurvey", Re.PageChange);
|
|
4349
4357
|
}
|
|
4350
|
-
const
|
|
4358
|
+
const ys = {
|
|
4351
4359
|
capture: !0
|
|
4352
|
-
},
|
|
4360
|
+
}, El = () => {
|
|
4353
4361
|
const t = window.UserLeap._config.interactiveEvents.filter((r) => Or(r, window.location.href)).map((r) => {
|
|
4354
4362
|
const {
|
|
4355
4363
|
name: i,
|
|
@@ -4359,35 +4367,35 @@ const ms = {
|
|
|
4359
4367
|
innerText: a
|
|
4360
4368
|
} = s;
|
|
4361
4369
|
return o ? (l) => {
|
|
4362
|
-
if (
|
|
4370
|
+
if (Br(l.target))
|
|
4363
4371
|
try {
|
|
4364
4372
|
l.target.closest(o) && window.UserLeap("track", i);
|
|
4365
4373
|
} catch {
|
|
4366
4374
|
}
|
|
4367
4375
|
return !1;
|
|
4368
|
-
} : (l) => (
|
|
4376
|
+
} : (l) => (Br(l.target) && l.target.innerText === a && window.UserLeap("track", i), !1);
|
|
4369
4377
|
}), n = (r) => t.forEach((i) => i(r));
|
|
4370
|
-
window.UserLeap._config.interactiveEventsHandler = n, window.addEventListener("click", n,
|
|
4371
|
-
},
|
|
4372
|
-
window.UserLeap._config.interactiveEventsHandler && window.removeEventListener("click", window.UserLeap._config.interactiveEventsHandler,
|
|
4378
|
+
window.UserLeap._config.interactiveEventsHandler = n, window.addEventListener("click", n, ys);
|
|
4379
|
+
}, ws = () => {
|
|
4380
|
+
window.UserLeap._config.interactiveEventsHandler && window.removeEventListener("click", window.UserLeap._config.interactiveEventsHandler, ys), delete window.UserLeap._config.interactiveEventsHandler;
|
|
4373
4381
|
};
|
|
4374
|
-
function
|
|
4382
|
+
function kl() {
|
|
4375
4383
|
["hashchange", "popstate"].forEach((e) => window.addEventListener(e, Ut, !0));
|
|
4376
4384
|
}
|
|
4377
|
-
function
|
|
4378
|
-
["hashchange", "popstate"].forEach((e) => window.removeEventListener(e, Ut, !0)), window.UserLeap._config.interactiveEvents &&
|
|
4385
|
+
function Ll() {
|
|
4386
|
+
["hashchange", "popstate"].forEach((e) => window.removeEventListener(e, Ut, !0)), window.UserLeap._config.interactiveEvents && ws();
|
|
4379
4387
|
}
|
|
4380
4388
|
function ae(e, t, n) {
|
|
4381
4389
|
const r = [window.UserLeap._API_URL, "sdk", e];
|
|
4382
4390
|
return t && t.forEach((i) => {
|
|
4383
|
-
r.push(i), i === Ee ? r.push(window.UserLeap.envId) : i ===
|
|
4391
|
+
r.push(i), i === Ee ? r.push(window.UserLeap.envId) : i === Pe && r.push(Rr());
|
|
4384
4392
|
}), n && r.push(n), r.join("/");
|
|
4385
4393
|
}
|
|
4386
|
-
function
|
|
4394
|
+
function Il(e, t) {
|
|
4387
4395
|
let n = ae("1", [Ee], "questions?");
|
|
4388
4396
|
return e != null && (n += `&vid=${e}`), t && (t.surveyId && (n += `&surveyid=${t.surveyId}`), t.surveyTemplateId && (n += `&surveytemplateid=${t.surveyTemplateId}`), t.previewLanguage && (n += `&previewLanguage=${encodeURIComponent(t.previewLanguage)}`)), n;
|
|
4389
4397
|
}
|
|
4390
|
-
function
|
|
4398
|
+
function Oe(e) {
|
|
4391
4399
|
const t = Z.getItem(ee.Credentials);
|
|
4392
4400
|
if (t)
|
|
4393
4401
|
try {
|
|
@@ -4417,22 +4425,23 @@ function X(e, t) {
|
|
|
4417
4425
|
s instanceof Error && console.warn(`[Sprig] (ERR-426) Unable to write to Local Storage:: ${s.message}`);
|
|
4418
4426
|
}
|
|
4419
4427
|
}
|
|
4420
|
-
function
|
|
4421
|
-
window.previewMode || (window.UserLeap.visitorId = nt(), I(`Generating new vid: ${window.UserLeap.visitorId}`), X("vid", window.UserLeap.visitorId), R.emit(
|
|
4428
|
+
function gs() {
|
|
4429
|
+
window.previewMode || (window.UserLeap.visitorId = nt(), I(`Generating new vid: ${window.UserLeap.visitorId}`), X("vid", window.UserLeap.visitorId), R.emit(O.VisitorIDUpdated, {
|
|
4422
4430
|
visitorId: window.UserLeap.visitorId
|
|
4423
4431
|
}));
|
|
4424
4432
|
}
|
|
4425
|
-
function
|
|
4433
|
+
function Rr() {
|
|
4426
4434
|
return window.previewMode ? "0" : window.UserLeap.visitorId || "";
|
|
4427
4435
|
}
|
|
4428
|
-
function
|
|
4436
|
+
function vs(e, t, n) {
|
|
4437
|
+
var c;
|
|
4429
4438
|
if (e.endsWith("mock_snippet.html"))
|
|
4430
4439
|
return;
|
|
4431
4440
|
I(`Tracking page view: ${e}`);
|
|
4432
4441
|
const r = window.UserLeap._config.pageUrlEvents;
|
|
4433
4442
|
let i = !1;
|
|
4434
4443
|
if (r && r.length)
|
|
4435
|
-
for (let
|
|
4444
|
+
for (let p = 0; p < r.length && (i = Or(r[p], e), !i); p++)
|
|
4436
4445
|
;
|
|
4437
4446
|
if (!i)
|
|
4438
4447
|
return;
|
|
@@ -4445,28 +4454,35 @@ function gs(e, t, n) {
|
|
|
4445
4454
|
}, u = Z.getItem(ee.PageViews);
|
|
4446
4455
|
try {
|
|
4447
4456
|
if (a = u ? JSON.parse(u) : [], Array.isArray(a) || (a = []), a.length > 0) {
|
|
4448
|
-
const
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4457
|
+
const p = a[a.length - 1], d = (Date.now() - p.viewedAt) / 1e3;
|
|
4458
|
+
if (p.location != e && d > o) {
|
|
4459
|
+
const h = (c = document == null ? void 0 : document.querySelector('meta[name="description"]')) == null ? void 0 : c.getAttribute("content");
|
|
4460
|
+
ri({
|
|
4461
|
+
...h && {
|
|
4462
|
+
description: h
|
|
4463
|
+
},
|
|
4464
|
+
url: e,
|
|
4465
|
+
referrer: document.referrer,
|
|
4466
|
+
pageTitle: document.title
|
|
4467
|
+
});
|
|
4468
|
+
}
|
|
4469
|
+
(p.location != e && d > o || d > s) && (window.UserLeap._queue.push(["track", hr, t, {
|
|
4454
4470
|
url: e
|
|
4455
4471
|
}, n]), a.push(l));
|
|
4456
4472
|
} else
|
|
4457
4473
|
window.UserLeap._queue.push(["track", hr, t, {
|
|
4458
4474
|
url: e
|
|
4459
|
-
}, n]), a.push(l),
|
|
4475
|
+
}, n]), a.push(l), ri({
|
|
4460
4476
|
url: e
|
|
4461
4477
|
});
|
|
4462
4478
|
a.length > 5 && a.splice(0, a.length - 5), Z.setItem(ee.PageViews, JSON.stringify(a));
|
|
4463
|
-
} catch (
|
|
4464
|
-
|
|
4479
|
+
} catch (p) {
|
|
4480
|
+
p instanceof Error && window.UserLeap.reportError("trackPageView", p, {
|
|
4465
4481
|
pageViewsStorage: u
|
|
4466
4482
|
}), console.warn("[Sprig] (ERR-425) Failed to update page views in local storage");
|
|
4467
4483
|
}
|
|
4468
4484
|
}
|
|
4469
|
-
function
|
|
4485
|
+
function Ul() {
|
|
4470
4486
|
const e = "Backbone" in window && window.Backbone && window.Backbone.history ? window.Backbone.history : window.history;
|
|
4471
4487
|
"pushState" in e && (e.pushState = /* @__PURE__ */ ((t) => function(...r) {
|
|
4472
4488
|
const i = t.apply(this, r), s = new Event("pushState");
|
|
@@ -4474,21 +4490,21 @@ function Il() {
|
|
|
4474
4490
|
})(e.pushState)), "replaceState" in e && (e.replaceState = /* @__PURE__ */ ((t) => function(...r) {
|
|
4475
4491
|
const i = t.apply(this, r), s = new Event("replaceState");
|
|
4476
4492
|
return window.dispatchEvent(s), Ut(s), i;
|
|
4477
|
-
})(e.replaceState)),
|
|
4493
|
+
})(e.replaceState)), kl();
|
|
4478
4494
|
}
|
|
4479
4495
|
async function An(e, t) {
|
|
4480
|
-
const n =
|
|
4481
|
-
e && !t && (window.UserLeap._config.mode =
|
|
4482
|
-
const r = await de(
|
|
4496
|
+
const n = Rr();
|
|
4497
|
+
e && !t && (window.UserLeap._config.mode = bl.test);
|
|
4498
|
+
const r = await de(Il(n, {
|
|
4483
4499
|
...e,
|
|
4484
4500
|
previewLanguage: window.UserLeap._config.previewLanguage
|
|
4485
4501
|
}), {}, 0, !0);
|
|
4486
|
-
return r.ok ? (r.json.delay && await Zt(r.json.delay),
|
|
4502
|
+
return r.ok ? (r.json.delay && await Zt(r.json.delay), bs(r.json)) : (r.reportError && r.error && (console.warn("[Sprig] (ERR-414) Failed to request questions from the server", r.error), window.UserLeap.reportError("getQuestions", r.error)), {
|
|
4487
4503
|
success: !1,
|
|
4488
4504
|
surveyState: re.NoSurvey
|
|
4489
4505
|
});
|
|
4490
4506
|
}
|
|
4491
|
-
const
|
|
4507
|
+
const bs = async (e) => {
|
|
4492
4508
|
var V, M;
|
|
4493
4509
|
const {
|
|
4494
4510
|
context: t,
|
|
@@ -4502,12 +4518,12 @@ const vs = async (e) => {
|
|
|
4502
4518
|
uuid: u,
|
|
4503
4519
|
vid: c,
|
|
4504
4520
|
sessionReplay: p
|
|
4505
|
-
} = e, d = et(window.UserLeap), h =
|
|
4521
|
+
} = e, d = et(window.UserLeap), h = Dr(d), w = Al(d);
|
|
4506
4522
|
if (I(`Attempting to display survey: ${l}`), p)
|
|
4507
4523
|
if (I("Survey has replay attached"), h) {
|
|
4508
4524
|
const x = {
|
|
4509
4525
|
mediaRecordingUid: nt(),
|
|
4510
|
-
mediaType:
|
|
4526
|
+
mediaType: wi.Screen,
|
|
4511
4527
|
questionId: 1,
|
|
4512
4528
|
responseGroupUid: a,
|
|
4513
4529
|
surveyId: l,
|
|
@@ -4515,7 +4531,7 @@ const vs = async (e) => {
|
|
|
4515
4531
|
visitorId: window.UserLeap.visitorId,
|
|
4516
4532
|
isReplay: !0
|
|
4517
4533
|
};
|
|
4518
|
-
R.emit(
|
|
4534
|
+
R.emit(O.ReplayCapture, {
|
|
4519
4535
|
responseGroupUid: a,
|
|
4520
4536
|
hasQuestions: !!(o != null && o.length),
|
|
4521
4537
|
surveyId: l,
|
|
@@ -4525,7 +4541,7 @@ const vs = async (e) => {
|
|
|
4525
4541
|
generateVideoUploadUrlPayload: x
|
|
4526
4542
|
});
|
|
4527
4543
|
} else
|
|
4528
|
-
|
|
4544
|
+
hs({
|
|
4529
4545
|
responseGroupId: a,
|
|
4530
4546
|
surveyId: l,
|
|
4531
4547
|
visitorId: c,
|
|
@@ -4558,23 +4574,24 @@ const vs = async (e) => {
|
|
|
4558
4574
|
surveyState: re.NoSurvey
|
|
4559
4575
|
};
|
|
4560
4576
|
}
|
|
4561
|
-
I(`Showing survey: ${l}`),
|
|
4562
|
-
id: l
|
|
4563
|
-
|
|
4564
|
-
|
|
4577
|
+
I(`Showing survey: ${l}`), rl({
|
|
4578
|
+
id: l,
|
|
4579
|
+
userAgent: window.navigator.userAgent
|
|
4580
|
+
}), Hs.disable(), R.emit(O.SurveyWillPresent, {
|
|
4581
|
+
name: O.SurveyWillPresent,
|
|
4565
4582
|
[Xt.SurveyId]: l
|
|
4566
4583
|
});
|
|
4567
4584
|
let m, g = document.createElement("div"), y, f, v;
|
|
4568
4585
|
const b = (x) => {
|
|
4569
4586
|
const {
|
|
4570
|
-
[
|
|
4587
|
+
[ci.ViewVersion]: ve
|
|
4571
4588
|
} = x;
|
|
4572
|
-
ve !== d["x-ul-sdk-version"] &&
|
|
4589
|
+
ve !== d["x-ul-sdk-version"] && hi(), R.removeListener(xn.VerifyViewVersion, b);
|
|
4573
4590
|
};
|
|
4574
|
-
R.on(xn.VerifyViewVersion, b),
|
|
4591
|
+
R.on(xn.VerifyViewVersion, b), Xs(d) ? (m = "ul-direct-embeded-frame", y = document.head, f = window, v = !1, h && (pi(), g.id = m, window.UserLeap.container.appendChild(g), fi(), R.emit(O.SurveyLifeCycle, {
|
|
4575
4592
|
state: "presented"
|
|
4576
|
-
}), R.emit(
|
|
4577
|
-
name:
|
|
4593
|
+
}), R.emit(O.SurveyPresented, {
|
|
4594
|
+
name: O.SurveyPresented,
|
|
4578
4595
|
[Xt.SurveyId]: l
|
|
4579
4596
|
}))) : {
|
|
4580
4597
|
frameId: m,
|
|
@@ -4582,9 +4599,9 @@ const vs = async (e) => {
|
|
|
4582
4599
|
contentWindow: f,
|
|
4583
4600
|
hasOverlay: v,
|
|
4584
4601
|
iframe: g
|
|
4585
|
-
} =
|
|
4602
|
+
} = Ds(s, w, l), window.UserLeap.frameId = m, window.UserLeap.useMobileStyling = w;
|
|
4586
4603
|
const _ = (x) => {
|
|
4587
|
-
R.on(
|
|
4604
|
+
R.on(O.CloseSurveyOnOverlayClick, x);
|
|
4588
4605
|
}, E = Object.assign({
|
|
4589
4606
|
frame: g,
|
|
4590
4607
|
envId: window.UserLeap.envId,
|
|
@@ -4622,9 +4639,9 @@ const vs = async (e) => {
|
|
|
4622
4639
|
}), window.UserLeap.customStyles && (E.customStyles = window.UserLeap.customStyles), f && (f.__cfg = E);
|
|
4623
4640
|
function S() {
|
|
4624
4641
|
const x = document.createElement("script");
|
|
4625
|
-
return window.UserLeap.nonce && x.setAttribute("nonce", window.UserLeap.nonce), x.id =
|
|
4642
|
+
return window.UserLeap.nonce && x.setAttribute("nonce", window.UserLeap.nonce), x.id = oi, x;
|
|
4626
4643
|
}
|
|
4627
|
-
const
|
|
4644
|
+
const P = window.UserLeap.viewSDKURL ? window.UserLeap.viewSDKURL : E.path, k = document.getElementById(oi);
|
|
4628
4645
|
k && k.remove();
|
|
4629
4646
|
const B = S(), D = () => {
|
|
4630
4647
|
window.UserLeap.container && Object.assign(window.UserLeap.container.style, {
|
|
@@ -4634,13 +4651,13 @@ const vs = async (e) => {
|
|
|
4634
4651
|
if (E.installationMethod === He.Npm || E.installationMethod === He.NpmBundled) {
|
|
4635
4652
|
const {
|
|
4636
4653
|
default: x
|
|
4637
|
-
} = await import("./view-
|
|
4654
|
+
} = await import("./view-8NEFT9sC.js");
|
|
4638
4655
|
x.configure(E), v && window.UserLeap.container && D();
|
|
4639
4656
|
} else
|
|
4640
|
-
|
|
4657
|
+
P && (B.src = P, v && B.addEventListener("load", () => {
|
|
4641
4658
|
window.UserLeap.container && D();
|
|
4642
4659
|
}), f == null || f.addEventListener("error", (x) => {
|
|
4643
|
-
x.target instanceof HTMLScriptElement && x.target.src ===
|
|
4660
|
+
x.target instanceof HTMLScriptElement && x.target.src === P && window.UserLeap.reportError("loadFrameScript", new Error("Frame script failed to load"));
|
|
4644
4661
|
}, {
|
|
4645
4662
|
capture: !0,
|
|
4646
4663
|
once: !0
|
|
@@ -4652,16 +4669,16 @@ const vs = async (e) => {
|
|
|
4652
4669
|
responseGroupUid: a
|
|
4653
4670
|
};
|
|
4654
4671
|
};
|
|
4655
|
-
function
|
|
4672
|
+
function Al(e) {
|
|
4656
4673
|
if (window.UserLeap.useMobileStyling !== void 0)
|
|
4657
4674
|
return window.UserLeap.useMobileStyling;
|
|
4658
4675
|
const t = window.UserLeap.windowDimensions && window.UserLeap.windowDimensions.width || document.body.clientWidth;
|
|
4659
|
-
return
|
|
4676
|
+
return Dr(e) || t > 10 && t < Ms;
|
|
4660
4677
|
}
|
|
4661
|
-
function
|
|
4662
|
-
return
|
|
4678
|
+
function Dr(e) {
|
|
4679
|
+
return _l.includes(e[oe.Platform]);
|
|
4663
4680
|
}
|
|
4664
|
-
function
|
|
4681
|
+
function xl(e) {
|
|
4665
4682
|
let t = e.length;
|
|
4666
4683
|
for (; t; ) {
|
|
4667
4684
|
const n = Math.floor(Math.random() * t);
|
|
@@ -4670,7 +4687,7 @@ function Al(e) {
|
|
|
4670
4687
|
e[t] = e[n], e[n] = r;
|
|
4671
4688
|
}
|
|
4672
4689
|
}
|
|
4673
|
-
function
|
|
4690
|
+
function Pl(e) {
|
|
4674
4691
|
if (!e)
|
|
4675
4692
|
return;
|
|
4676
4693
|
window.UserLeap._config = e, e.mute && window.UserLeap._queue.pause();
|
|
@@ -4679,7 +4696,7 @@ function xl(e) {
|
|
|
4679
4696
|
pageUrlEvents: n,
|
|
4680
4697
|
dismissOnPageChange: r
|
|
4681
4698
|
} = e;
|
|
4682
|
-
t &&
|
|
4699
|
+
t && xl(t), (t || n || r) && (Ul(), Ut());
|
|
4683
4700
|
}
|
|
4684
4701
|
async function de(e, t, n = 0, r = !1) {
|
|
4685
4702
|
var s, o;
|
|
@@ -4687,7 +4704,7 @@ async function de(e, t, n = 0, r = !1) {
|
|
|
4687
4704
|
const i = await Ye(e, t, n, r);
|
|
4688
4705
|
if (i.ok) {
|
|
4689
4706
|
const a = (s = i.headers) == null ? void 0 : s.get("Authorization"), l = a ? a.split(" ") : void 0, u = l && l.length === 2 ? l[1] : void 0, c = (o = i.headers) == null ? void 0 : o.get(oe.VisitorID);
|
|
4690
|
-
u && c && (c !== window.UserLeap.visitorId || window.UserLeap.token !== u) && (X("token", u), X("vid", c), R.emit(
|
|
4707
|
+
u && c && (c !== window.UserLeap.visitorId || window.UserLeap.token !== u) && (X("token", u), X("vid", c), R.emit(O.VisitorIDUpdated, {
|
|
4691
4708
|
visitorId: c
|
|
4692
4709
|
}), window.UserLeap.token = u, window.UserLeap.visitorId = c);
|
|
4693
4710
|
}
|
|
@@ -4698,7 +4715,7 @@ async function Ol(e, t) {
|
|
|
4698
4715
|
let n = !0;
|
|
4699
4716
|
return t && ((r = e == null ? void 0 : e.json) != null && r.surveyId) && (window.UserLeap.delayingSurvey = !0, n = await t(e.json.surveyId), window.UserLeap.delayingSurvey = !1, !n) ? !1 : ((i = e == null ? void 0 : e.json) != null && i.delay && (window.UserLeap.delayingSurvey = !0, await Zt(e.json.delay), window.UserLeap.delayingSurvey = !1), n);
|
|
4700
4717
|
}
|
|
4701
|
-
const
|
|
4718
|
+
const Rl = function(e) {
|
|
4702
4719
|
if (!window.UserLeap)
|
|
4703
4720
|
return;
|
|
4704
4721
|
const t = async (r = {}) => {
|
|
@@ -4736,13 +4753,13 @@ const Pl = function(e) {
|
|
|
4736
4753
|
const p = window.location.href;
|
|
4737
4754
|
if (o.url || (o.url = p), X("trackStartUrl", p), (g = (m = window.UserLeap) == null ? void 0 : m._config) != null && g.optimizelyEnabled) {
|
|
4738
4755
|
const v = et(window.UserLeap);
|
|
4739
|
-
|
|
4756
|
+
Dr(v) || Mt.getAndSetWebOptimizelyExperiments(), o.optimizelyExperiments = Object.assign({}, Mt.getAllOptimizelyExperiments());
|
|
4740
4757
|
}
|
|
4741
|
-
(f = (y = window.UserLeap) == null ? void 0 : y._config) != null && f.launchDarklyEnabled && (o.launchDarklyFlags =
|
|
4758
|
+
(f = (y = window.UserLeap) == null ? void 0 : y._config) != null && f.launchDarklyEnabled && (o.launchDarklyFlags = Pn.getAllLaunchDarklyVariations()), i && (window.UserLeap.userId = i), s && (window.UserLeap.partnerAnonymousId = s), a && (o.eventProperties = a), nl({
|
|
4742
4759
|
name: u,
|
|
4743
4760
|
url: o.url
|
|
4744
4761
|
}), I(`Tracking event: ${u}`);
|
|
4745
|
-
const d = window.UserLeap.delayingSurvey ? await de(ae("1", [
|
|
4762
|
+
const d = window.UserLeap.delayingSurvey ? await de(ae("1", [Pe], "events/batch"), {
|
|
4746
4763
|
body: JSON.stringify({
|
|
4747
4764
|
events: [{
|
|
4748
4765
|
event: u,
|
|
@@ -4751,7 +4768,7 @@ const Pl = function(e) {
|
|
|
4751
4768
|
previewKey: c
|
|
4752
4769
|
}),
|
|
4753
4770
|
method: "POST"
|
|
4754
|
-
}, 0, !0) : await de(ae("1", [
|
|
4771
|
+
}, 0, !0) : await de(ae("1", [Pe], "events"), {
|
|
4755
4772
|
body: JSON.stringify({
|
|
4756
4773
|
event: u,
|
|
4757
4774
|
metadata: o,
|
|
@@ -4770,7 +4787,7 @@ const Pl = function(e) {
|
|
|
4770
4787
|
}
|
|
4771
4788
|
i && X("uid", i), s && X("aid", s);
|
|
4772
4789
|
const h = d.json;
|
|
4773
|
-
return h.invalidPreviewKey && Z.removeItem(ee.Preview), await Ol(d, l) ?
|
|
4790
|
+
return h.invalidPreviewKey && Z.removeItem(ee.Preview), await Ol(d, l) ? Sl(h.eventId, p) ? bs(h) : {
|
|
4774
4791
|
success: !1,
|
|
4775
4792
|
message: "Study should not be displayed after page navigation",
|
|
4776
4793
|
surveyState: re.NoSurvey
|
|
@@ -4814,14 +4831,14 @@ const Pl = function(e) {
|
|
|
4814
4831
|
console.warn("[Sprig] setVisitorToken is deprecated.");
|
|
4815
4832
|
},
|
|
4816
4833
|
dismissActiveSurvey(r = Re.API) {
|
|
4817
|
-
R.emit(
|
|
4818
|
-
name:
|
|
4834
|
+
R.emit(O.SurveyWillClose, {
|
|
4835
|
+
name: O.SurveyWillClose,
|
|
4819
4836
|
initiator: r
|
|
4820
4837
|
});
|
|
4821
4838
|
},
|
|
4822
4839
|
// Set an arbitrary attribute on the visitor
|
|
4823
4840
|
async setAttribute(r, i) {
|
|
4824
|
-
if (!r || !i && i !== 0) {
|
|
4841
|
+
if (!r || !i && i !== 0 && i !== !1) {
|
|
4825
4842
|
const s = "[Sprig] - Disregarding empty attribute / value provided";
|
|
4826
4843
|
return console.warn(s), {
|
|
4827
4844
|
success: !1,
|
|
@@ -4877,10 +4894,10 @@ const Pl = function(e) {
|
|
|
4877
4894
|
const a = {};
|
|
4878
4895
|
i && (a.userId = window.UserLeap.userId = i), s && (a.partnerAnonymousId = window.UserLeap.partnerAnonymousId = s);
|
|
4879
4896
|
let l;
|
|
4880
|
-
return o ? (o.email && !Object.prototype.hasOwnProperty.call(o, ct) && (o[ct] = o.email, delete o.email), I(`Setting attributes: ${JSON.stringify(o)}`), l = await de(ae("1", [Ee,
|
|
4897
|
+
return o ? (o.email && !Object.prototype.hasOwnProperty.call(o, ct) && (o[ct] = o.email, delete o.email), I(`Setting attributes: ${JSON.stringify(o)}`), l = await de(ae("1", [Ee, Pe], "attributes"), {
|
|
4881
4898
|
body: JSON.stringify(o),
|
|
4882
4899
|
method: "PUT"
|
|
4883
|
-
}), !l.ok && l.reportError && (console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed", l.error), l.error && window.UserLeap.reportError("identifyAndSetAttributes", l.error))) : l = await de(ae("1", [Ee,
|
|
4900
|
+
}), !l.ok && l.reportError && (console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed", l.error), l.error && window.UserLeap.reportError("identifyAndSetAttributes", l.error))) : l = await de(ae("1", [Ee, Pe]), {
|
|
4884
4901
|
body: JSON.stringify(a),
|
|
4885
4902
|
method: "PUT"
|
|
4886
4903
|
}), o && o[ct] && (window.UserLeap.email = o[ct]), l.ok && (i && X("uid", i), s && X("aid", s)), {
|
|
@@ -4904,7 +4921,7 @@ const Pl = function(e) {
|
|
|
4904
4921
|
message: s
|
|
4905
4922
|
};
|
|
4906
4923
|
}
|
|
4907
|
-
const i = await de(ae("1", [Ee,
|
|
4924
|
+
const i = await de(ae("1", [Ee, Pe], "attributes"), {
|
|
4908
4925
|
body: JSON.stringify({
|
|
4909
4926
|
delete: r
|
|
4910
4927
|
}),
|
|
@@ -4915,10 +4932,10 @@ const Pl = function(e) {
|
|
|
4915
4932
|
};
|
|
4916
4933
|
},
|
|
4917
4934
|
async addSurveyListener(r) {
|
|
4918
|
-
R.on(
|
|
4935
|
+
R.on(O.SurveyLifeCycle, r);
|
|
4919
4936
|
},
|
|
4920
4937
|
async removeSurveyListener(r) {
|
|
4921
|
-
R.removeListener(
|
|
4938
|
+
R.removeListener(O.SurveyLifeCycle, r);
|
|
4922
4939
|
},
|
|
4923
4940
|
async addListener(r, i) {
|
|
4924
4941
|
R.on(r, i);
|
|
@@ -4946,7 +4963,7 @@ const Pl = function(e) {
|
|
|
4946
4963
|
if (e.mode === "test" || r === window.UserLeap.userId)
|
|
4947
4964
|
return;
|
|
4948
4965
|
window.UserLeap.userId = r;
|
|
4949
|
-
const i = window.UserLeap.visitorId, s = await de(ae("1", [Ee,
|
|
4966
|
+
const i = window.UserLeap.visitorId, s = await de(ae("1", [Ee, Pe]), {
|
|
4950
4967
|
body: JSON.stringify({
|
|
4951
4968
|
userId: r
|
|
4952
4969
|
}),
|
|
@@ -4956,7 +4973,7 @@ const Pl = function(e) {
|
|
|
4956
4973
|
s.reportError && (console.warn("[Sprig] (ERR-420) Failed to set user id", s.error), s.error && window.UserLeap.reportError("setUserId", s.error));
|
|
4957
4974
|
return;
|
|
4958
4975
|
}
|
|
4959
|
-
i !== window.UserLeap.visitorId &&
|
|
4976
|
+
i !== window.UserLeap.visitorId && ni(), X("uid", r);
|
|
4960
4977
|
},
|
|
4961
4978
|
/**
|
|
4962
4979
|
* Set a partner anonymous id for future requests -- to be deprecated, never documented.
|
|
@@ -4989,14 +5006,14 @@ const Pl = function(e) {
|
|
|
4989
5006
|
return await t(r);
|
|
4990
5007
|
},
|
|
4991
5008
|
trackPageView(r, i = void 0, s = void 0) {
|
|
4992
|
-
|
|
5009
|
+
vs(r, i, s);
|
|
4993
5010
|
},
|
|
4994
5011
|
applyStyles(r) {
|
|
4995
5012
|
if (window.UserLeap.customStyles = r, window.UserLeap.container) {
|
|
4996
5013
|
const i = window.UserLeap.container.children[0].contentDocument;
|
|
4997
5014
|
if (i) {
|
|
4998
5015
|
const s = i.getElementById(Ne.CustomStyle);
|
|
4999
|
-
s ? s.textContent = r :
|
|
5016
|
+
s ? s.textContent = r : Js(i, r, window.UserLeap.styleNonce);
|
|
5000
5017
|
}
|
|
5001
5018
|
}
|
|
5002
5019
|
},
|
|
@@ -5012,8 +5029,8 @@ const Pl = function(e) {
|
|
|
5012
5029
|
}), !window.UserLeap.frameId)
|
|
5013
5030
|
return;
|
|
5014
5031
|
const a = document.getElementById(window.UserLeap.frameId);
|
|
5015
|
-
a && (window.UserLeap.useMobileStyling && ((l = window.UserLeap.windowDimensions) != null && l.width && (a.style.width = `${window.UserLeap.windowDimensions.width}px`), (u = window.UserLeap.windowDimensions) != null && u.height && (a.style.maxHeight = `${window.UserLeap.windowDimensions.height - 20}px`), a.contentDocument && (a.style.height = String(
|
|
5016
|
-
name:
|
|
5032
|
+
a && (window.UserLeap.useMobileStyling && ((l = window.UserLeap.windowDimensions) != null && l.width && (a.style.width = `${window.UserLeap.windowDimensions.width}px`), (u = window.UserLeap.windowDimensions) != null && u.height && (a.style.maxHeight = `${window.UserLeap.windowDimensions.height - 20}px`), a.contentDocument && (a.style.height = String(Qs(a.contentDocument)[0]) + "px")), R.emit(O.SurveyDimensions, {
|
|
5033
|
+
name: O.SurveyDimensions,
|
|
5017
5034
|
contentFrameWidth: a.clientWidth,
|
|
5018
5035
|
contentFrameHeight: a.clientHeight
|
|
5019
5036
|
}));
|
|
@@ -5022,13 +5039,13 @@ const Pl = function(e) {
|
|
|
5022
5039
|
* logs out current visitor and associated ids
|
|
5023
5040
|
*/
|
|
5024
5041
|
logoutUser() {
|
|
5025
|
-
window.UserLeap.debugMode && console.info("[DEBUG] Sprig logout"), I(`Logging out user: ${window.UserLeap.userId} / vid: ${window.UserLeap.visitorId}`), window.UserLeap.visitorId = null, window.UserLeap.userId = null, window.UserLeap.partnerAnonymousId = null, window.UserLeap.token = null, window.UserLeap.email = null, Z.removeItem(ee.Credentials), Z.removeItem(ee.PageViews), window.UserLeap._queue.isPaused() && window.UserLeap._queue.empty(),
|
|
5042
|
+
window.UserLeap.debugMode && console.info("[DEBUG] Sprig logout"), I(`Logging out user: ${window.UserLeap.userId} / vid: ${window.UserLeap.visitorId}`), window.UserLeap.visitorId = null, window.UserLeap.userId = null, window.UserLeap.partnerAnonymousId = null, window.UserLeap.token = null, window.UserLeap.email = null, Z.removeItem(ee.Credentials), Z.removeItem(ee.PageViews), window.UserLeap._queue.isPaused() && window.UserLeap._queue.empty(), gs(), ni(), window.UserLeap._queue.unpause();
|
|
5026
5043
|
},
|
|
5027
5044
|
/**
|
|
5028
5045
|
* dismiss surveys and clean up sprig globals
|
|
5029
5046
|
*/
|
|
5030
5047
|
teardown() {
|
|
5031
|
-
|
|
5048
|
+
Ll(), window.UserLeap("dismissActiveSurvey", Re.API), delete window.UserLeap, delete window.Sprig, delete window._Sprig;
|
|
5032
5049
|
},
|
|
5033
5050
|
integrateOptimizely(r, i = !0) {
|
|
5034
5051
|
var s, o;
|
|
@@ -5073,7 +5090,7 @@ const Pl = function(e) {
|
|
|
5073
5090
|
console.warn("[SPRIG] LaunchDarkly integration is currently not enabled for your product.");
|
|
5074
5091
|
return;
|
|
5075
5092
|
}
|
|
5076
|
-
|
|
5093
|
+
Pn.setLDFlagsVariations(r);
|
|
5077
5094
|
},
|
|
5078
5095
|
/** @deprecated */
|
|
5079
5096
|
setVisitorAttribute(r, i) {
|
|
@@ -5089,7 +5106,7 @@ const Pl = function(e) {
|
|
|
5089
5106
|
return console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"), n.setEmail(r);
|
|
5090
5107
|
},
|
|
5091
5108
|
async _generateVideoUploadUrl(r) {
|
|
5092
|
-
return
|
|
5109
|
+
return Bl(r);
|
|
5093
5110
|
},
|
|
5094
5111
|
async _completeSessionReplay({
|
|
5095
5112
|
surveyId: r,
|
|
@@ -5100,7 +5117,7 @@ const Pl = function(e) {
|
|
|
5100
5117
|
return !1;
|
|
5101
5118
|
const o = window.UserLeap._API_URL;
|
|
5102
5119
|
try {
|
|
5103
|
-
const a = await
|
|
5120
|
+
const a = await Ai({
|
|
5104
5121
|
surveyId: r,
|
|
5105
5122
|
responseGroupUuid: i,
|
|
5106
5123
|
eventDigest: s,
|
|
@@ -5115,7 +5132,7 @@ const Pl = function(e) {
|
|
|
5115
5132
|
};
|
|
5116
5133
|
Object.assign(window.UserLeap, n);
|
|
5117
5134
|
};
|
|
5118
|
-
async function
|
|
5135
|
+
async function Dl(e) {
|
|
5119
5136
|
const t = et(window.UserLeap);
|
|
5120
5137
|
document.addEventListener("securitypolicyviolation", Cn);
|
|
5121
5138
|
const n = await Ye(ae("1", [Ee], "config"), {
|
|
@@ -5128,10 +5145,10 @@ async function Rl(e) {
|
|
|
5128
5145
|
disabled: i.disabled
|
|
5129
5146
|
}) : Object.assign({}, i, e);
|
|
5130
5147
|
}
|
|
5131
|
-
const
|
|
5132
|
-
async function
|
|
5148
|
+
const Tl = (e) => typeof e == "object" && e && "inner" in e && !!e.inner && typeof e.inner == "object";
|
|
5149
|
+
async function Cl(e, t, n = {}) {
|
|
5133
5150
|
var p, d;
|
|
5134
|
-
const r = window.__cfg && window.__cfg.mode, i =
|
|
5151
|
+
const r = window.__cfg && window.__cfg.mode, i = Rr(), s = window.UserLeap.envId, o = window.document.documentElement, a = Tl(t) ? {
|
|
5135
5152
|
inner: {
|
|
5136
5153
|
message: (p = t.inner) == null ? void 0 : p.message,
|
|
5137
5154
|
stack: (d = t.inner) == null ? void 0 : d.stack
|
|
@@ -5168,10 +5185,10 @@ async function Tl(e, t, n = {}) {
|
|
|
5168
5185
|
const {
|
|
5169
5186
|
presignedUrl: h
|
|
5170
5187
|
} = c.json;
|
|
5171
|
-
|
|
5188
|
+
uo(h);
|
|
5172
5189
|
}
|
|
5173
5190
|
}
|
|
5174
|
-
async function
|
|
5191
|
+
async function Bl(e) {
|
|
5175
5192
|
var n;
|
|
5176
5193
|
if (!e)
|
|
5177
5194
|
return;
|
|
@@ -5194,13 +5211,13 @@ async function Cl(e) {
|
|
|
5194
5211
|
console.warn("[Sprig] Error with generating video upload url"), r instanceof Error && window.UserLeap.reportError("generateVideoUploadUrl", r);
|
|
5195
5212
|
}
|
|
5196
5213
|
}
|
|
5197
|
-
function
|
|
5198
|
-
const t = new URLSearchParams(window.location.search).get(
|
|
5214
|
+
function jl(e = {}) {
|
|
5215
|
+
const t = new URLSearchParams(window.location.search).get(yi.Preview) ?? "";
|
|
5199
5216
|
window.UserLeap.UPDATES = mr, window.UserLeap("setPreviewKey", t);
|
|
5200
5217
|
async function n() {
|
|
5201
5218
|
if (window.UserLeap.loaded)
|
|
5202
5219
|
return;
|
|
5203
|
-
if (I("Loading sprig on page load"), window.UserLeap.reportError =
|
|
5220
|
+
if (I("Loading sprig on page load"), window.UserLeap.reportError = Cl, window.UserLeap.loaded = !0, window.UserLeap._config = Object.assign({}, e, window.UserLeap.config), window.UserLeap.delayingSurvey = !1, window.UserLeap._config && typeof window.UserLeap._config == "object")
|
|
5204
5221
|
for (const a in window.UserLeap._config)
|
|
5205
5222
|
window.UserLeap[a] = window.UserLeap._config[a];
|
|
5206
5223
|
if (!window.UserLeap.envId)
|
|
@@ -5211,20 +5228,20 @@ function Bl(e = {}) {
|
|
|
5211
5228
|
window.UserLeap.debugMode && console.info("[DEBUG] Sprig debug mode enabled");
|
|
5212
5229
|
const r = window.UserLeap.sampleRate;
|
|
5213
5230
|
if (r) {
|
|
5214
|
-
let a =
|
|
5231
|
+
let a = Oe("sampled");
|
|
5215
5232
|
if (a === null && (a = Math.random() < r, X("sampled", a)), !a)
|
|
5216
5233
|
return;
|
|
5217
5234
|
} else
|
|
5218
|
-
|
|
5235
|
+
Oe("sampled") !== null && X("sampled", null);
|
|
5219
5236
|
window.UserLeap._API_URL || (window.UserLeap._API_URL = "https://api.sprig.com");
|
|
5220
5237
|
const i = [...window.UserLeap._queue];
|
|
5221
|
-
window.UserLeap._queue = new
|
|
5238
|
+
window.UserLeap._queue = new Fs(window.UserLeap, []), window.UserLeap._queue.pause();
|
|
5222
5239
|
for (let a = 0; a < i.length; a++)
|
|
5223
5240
|
window.UserLeap._queue.push(i[a]);
|
|
5224
|
-
const s =
|
|
5225
|
-
s ? (window.UserLeap.token = s, window.UserLeap.visitorId =
|
|
5226
|
-
const o = await
|
|
5227
|
-
|
|
5241
|
+
const s = Oe("token");
|
|
5242
|
+
s ? (window.UserLeap.token = s, window.UserLeap.visitorId = Oe("vid"), window.UserLeap.userId = Oe("uid"), window.UserLeap.partnerAnonymousId = Oe("aid")) : (Z.removeItem(ee.Credentials), gs());
|
|
5243
|
+
const o = await Dl(e);
|
|
5244
|
+
ll({
|
|
5228
5245
|
reportingIntervalSeconds: o.metricsReportingEnabled ? o.metricsReportingIntervalSeconds : 0,
|
|
5229
5246
|
thresholds: o.metricThresholds,
|
|
5230
5247
|
postMetrics: async (a) => {
|
|
@@ -5232,16 +5249,16 @@ function Bl(e = {}) {
|
|
|
5232
5249
|
body: a,
|
|
5233
5250
|
method: "POST",
|
|
5234
5251
|
headers: {
|
|
5235
|
-
"x-ul-replay-enabled": `${
|
|
5252
|
+
"x-ul-replay-enabled": `${fs()}`
|
|
5236
5253
|
}
|
|
5237
5254
|
}, 0, !0);
|
|
5238
5255
|
}
|
|
5239
|
-
}),
|
|
5240
|
-
|
|
5241
|
-
}),
|
|
5256
|
+
}), Va(window.document, o.maxReplayDurationSeconds, window.UserLeap.replayNonce, window.UserLeap.maxInflightReplayRequests, o.replaySettings).then(() => {
|
|
5257
|
+
gl();
|
|
5258
|
+
}), po(o.logBufferLimit, o.logLevel), Rl(o), await Pl(o), window.UserLeap._queue.unpause(), R.emit(O.SDKReady, {
|
|
5242
5259
|
maxMobileReplayDurationSeconds: o.maxMobileReplayDurationSeconds,
|
|
5243
5260
|
mobileReplaySettings: o.mobileReplaySettings
|
|
5244
|
-
}), R.emit(
|
|
5261
|
+
}), R.emit(O.VisitorIDUpdated, {
|
|
5245
5262
|
visitorId: window.UserLeap.visitorId
|
|
5246
5263
|
});
|
|
5247
5264
|
}
|
|
@@ -5384,7 +5401,7 @@ class fr {
|
|
|
5384
5401
|
window.Sprig("teardown");
|
|
5385
5402
|
}
|
|
5386
5403
|
}
|
|
5387
|
-
const
|
|
5404
|
+
const li = {
|
|
5388
5405
|
/**
|
|
5389
5406
|
* Sets up the sprig api and load the sprig sdk on document load
|
|
5390
5407
|
* @param config
|
|
@@ -5401,47 +5418,47 @@ const ai = {
|
|
|
5401
5418
|
n !== "constructor" && (window.Sprig[n] = fr.prototype[n]);
|
|
5402
5419
|
});
|
|
5403
5420
|
const t = window.Sprig;
|
|
5404
|
-
return t.appId = e.envId, t._queue = [], window.UserLeap = t,
|
|
5421
|
+
return t.appId = e.envId, t._queue = [], window.UserLeap = t, jl(e), window.Sprig;
|
|
5405
5422
|
}
|
|
5406
|
-
},
|
|
5407
|
-
sprig:
|
|
5423
|
+
}, Hl = {
|
|
5424
|
+
sprig: li,
|
|
5408
5425
|
SprigAPI: fr,
|
|
5409
|
-
configure:
|
|
5426
|
+
configure: li.configure
|
|
5410
5427
|
};
|
|
5411
5428
|
export {
|
|
5412
|
-
|
|
5413
|
-
|
|
5429
|
+
Kl as A,
|
|
5430
|
+
Hs as C,
|
|
5414
5431
|
Re as D,
|
|
5415
|
-
|
|
5432
|
+
$l as E,
|
|
5416
5433
|
xn as I,
|
|
5417
|
-
|
|
5434
|
+
wi as M,
|
|
5418
5435
|
dn as P,
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5436
|
+
Gl as R,
|
|
5437
|
+
O as S,
|
|
5438
|
+
Vs as T,
|
|
5439
|
+
eo as a,
|
|
5440
|
+
ci as b,
|
|
5424
5441
|
He as c,
|
|
5425
|
-
|
|
5442
|
+
Qs as d,
|
|
5426
5443
|
R as e,
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5444
|
+
Ps as f,
|
|
5445
|
+
zl as g,
|
|
5446
|
+
uo as h,
|
|
5430
5447
|
I as i,
|
|
5431
5448
|
Ne as j,
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5449
|
+
ql as k,
|
|
5450
|
+
Ml as l,
|
|
5451
|
+
Fl as m,
|
|
5452
|
+
$s as n,
|
|
5453
|
+
qs as o,
|
|
5454
|
+
Wl as p,
|
|
5438
5455
|
Xt as q,
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5456
|
+
Vl as r,
|
|
5457
|
+
Xs as s,
|
|
5458
|
+
Js as t,
|
|
5442
5459
|
Ye as u,
|
|
5443
5460
|
nt as v,
|
|
5444
5461
|
fr as w,
|
|
5445
|
-
|
|
5446
|
-
|
|
5462
|
+
li as x,
|
|
5463
|
+
Hl as y
|
|
5447
5464
|
};
|