@steppy/player 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/steppy-player.js +42 -31
- package/dist/steppy-player.js.map +1 -1
- package/dist/steppy-tour.js +604 -518
- package/dist/steppy-tour.js.map +1 -1
- package/dist/steppy-video.js.map +1 -1
- package/dist/types/templates/controls.d.ts +6 -0
- package/dist/types/tour/api.d.ts +6 -0
- package/dist/types/tour/host.d.ts +14 -0
- package/dist/types/tour/index.d.ts +1 -0
- package/dist/types/tour/styles.d.ts +14 -10
- package/dist/types/tour/theme.d.ts +23 -0
- package/dist/types/ui/tokens.d.ts +37 -0
- package/package.json +1 -1
package/dist/steppy-tour.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
7
|
-
let
|
|
6
|
+
const ce = globalThis, Ce = ce.ShadowRoot && (ce.ShadyCSS === void 0 || ce.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ue = Symbol(), Ke = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let Tt = class {
|
|
8
8
|
constructor(e, n, s) {
|
|
9
|
-
if (this._$cssResult$ = !0, s !==
|
|
9
|
+
if (this._$cssResult$ = !0, s !== Ue) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
10
|
this.cssText = e, this.t = n;
|
|
11
11
|
}
|
|
12
12
|
get styleSheet() {
|
|
13
13
|
let e = this.o;
|
|
14
14
|
const n = this.t;
|
|
15
|
-
if (
|
|
15
|
+
if (Ce && e === void 0) {
|
|
16
16
|
const s = n !== void 0 && n.length === 1;
|
|
17
|
-
s && (e =
|
|
17
|
+
s && (e = Ke.get(n)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Ke.set(n, e));
|
|
18
18
|
}
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
@@ -22,33 +22,33 @@ let kt = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const It = (t) => new Tt(typeof t == "string" ? t : t + "", void 0, Ue), Wt = (t, ...e) => {
|
|
26
26
|
const n = t.length === 1 ? t[0] : e.reduce((s, i, r) => s + ((o) => {
|
|
27
27
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
28
28
|
if (typeof o == "number") return o;
|
|
29
29
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
30
|
})(i) + t[r + 1], t[0]);
|
|
31
|
-
return new
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
31
|
+
return new Tt(n, t, Ue);
|
|
32
|
+
}, Gt = (t, e) => {
|
|
33
|
+
if (Ce) t.adoptedStyleSheets = e.map((n) => n instanceof CSSStyleSheet ? n : n.styleSheet);
|
|
34
34
|
else for (const n of e) {
|
|
35
|
-
const s = document.createElement("style"), i =
|
|
35
|
+
const s = document.createElement("style"), i = ce.litNonce;
|
|
36
36
|
i !== void 0 && s.setAttribute("nonce", i), s.textContent = n.cssText, t.appendChild(s);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, We = Ce ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
39
39
|
let n = "";
|
|
40
40
|
for (const s of e.cssRules) n += s.cssText;
|
|
41
|
-
return
|
|
41
|
+
return It(n);
|
|
42
42
|
})(t) : t;
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is:
|
|
48
|
+
const { is: qt, defineProperty: Zt, getOwnPropertyDescriptor: Xt, getOwnPropertyNames: Yt, getOwnPropertySymbols: Jt, getPrototypeOf: Qt } = Object, ge = globalThis, Ge = ge.trustedTypes, en = Ge ? Ge.emptyScript : "", tn = ge.reactiveElementPolyfillSupport, Q = (t, e) => t, ke = { toAttribute(t, e) {
|
|
49
49
|
switch (e) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
t = t ?
|
|
51
|
+
t = t ? en : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
@@ -73,23 +73,23 @@ const { is: Ft, defineProperty: jt, getOwnPropertyDescriptor: Bt, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return n;
|
|
76
|
-
} },
|
|
77
|
-
Symbol.metadata ??= Symbol("metadata"),
|
|
78
|
-
let
|
|
76
|
+
} }, Rt = (t, e) => !qt(t, e), qe = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Rt };
|
|
77
|
+
Symbol.metadata ??= Symbol("metadata"), ge.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
|
+
let D = class extends HTMLElement {
|
|
79
79
|
static addInitializer(e) {
|
|
80
80
|
this._$Ei(), (this.l ??= []).push(e);
|
|
81
81
|
}
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(e, n =
|
|
85
|
+
static createProperty(e, n = qe) {
|
|
86
86
|
if (n.state && (n.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((n = Object.create(n)).wrapped = !0), this.elementProperties.set(e, n), !n.noAccessor) {
|
|
87
87
|
const s = Symbol(), i = this.getPropertyDescriptor(e, s, n);
|
|
88
|
-
i !== void 0 &&
|
|
88
|
+
i !== void 0 && Zt(this.prototype, e, i);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
static getPropertyDescriptor(e, n, s) {
|
|
92
|
-
const { get: i, set: r } =
|
|
92
|
+
const { get: i, set: r } = Xt(this.prototype, e) ?? { get() {
|
|
93
93
|
return this[n];
|
|
94
94
|
}, set(o) {
|
|
95
95
|
this[n] = o;
|
|
@@ -100,17 +100,17 @@ let F = class extends HTMLElement {
|
|
|
100
100
|
}, configurable: !0, enumerable: !0 };
|
|
101
101
|
}
|
|
102
102
|
static getPropertyOptions(e) {
|
|
103
|
-
return this.elementProperties.get(e) ??
|
|
103
|
+
return this.elementProperties.get(e) ?? qe;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(
|
|
107
|
-
const e =
|
|
106
|
+
if (this.hasOwnProperty(Q("elementProperties"))) return;
|
|
107
|
+
const e = Qt(this);
|
|
108
108
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
113
|
-
const n = this.properties, s = [...
|
|
111
|
+
if (this.hasOwnProperty(Q("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(Q("properties"))) {
|
|
113
|
+
const n = this.properties, s = [...Yt(n), ...Jt(n)];
|
|
114
114
|
for (const i of s) this.createProperty(i, n[i]);
|
|
115
115
|
}
|
|
116
116
|
const e = this[Symbol.metadata];
|
|
@@ -129,8 +129,8 @@ let F = class extends HTMLElement {
|
|
|
129
129
|
const n = [];
|
|
130
130
|
if (Array.isArray(e)) {
|
|
131
131
|
const s = new Set(e.flat(1 / 0).reverse());
|
|
132
|
-
for (const i of s) n.unshift(
|
|
133
|
-
} else e !== void 0 && n.push(
|
|
132
|
+
for (const i of s) n.unshift(We(i));
|
|
133
|
+
} else e !== void 0 && n.push(We(e));
|
|
134
134
|
return n;
|
|
135
135
|
}
|
|
136
136
|
static _$Eu(e, n) {
|
|
@@ -156,7 +156,7 @@ let F = class extends HTMLElement {
|
|
|
156
156
|
}
|
|
157
157
|
createRenderRoot() {
|
|
158
158
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
159
|
-
return
|
|
159
|
+
return Gt(e, this.constructor.elementStyles), e;
|
|
160
160
|
}
|
|
161
161
|
connectedCallback() {
|
|
162
162
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
@@ -188,7 +188,7 @@ let F = class extends HTMLElement {
|
|
|
188
188
|
requestUpdate(e, n, s, i = !1, r) {
|
|
189
189
|
if (e !== void 0) {
|
|
190
190
|
const o = this.constructor;
|
|
191
|
-
if (i === !1 && (r = this[e]), s ??= o.getPropertyOptions(e), !((s.hasChanged ??
|
|
191
|
+
if (i === !1 && (r = this[e]), s ??= o.getPropertyOptions(e), !((s.hasChanged ?? Rt)(r, n) || s.useDefault && s.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, s)))) return;
|
|
192
192
|
this.C(e, n, s);
|
|
193
193
|
}
|
|
194
194
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -256,75 +256,75 @@ let F = class extends HTMLElement {
|
|
|
256
256
|
firstUpdated(e) {
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
|
|
259
|
+
D.elementStyles = [], D.shadowRootOptions = { mode: "open" }, D[Q("elementProperties")] = /* @__PURE__ */ new Map(), D[Q("finalized")] = /* @__PURE__ */ new Map(), tn?.({ ReactiveElement: D }), (ge.reactiveElementVersions ??= []).push("2.1.2");
|
|
260
260
|
/**
|
|
261
261
|
* @license
|
|
262
262
|
* Copyright 2017 Google LLC
|
|
263
263
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
264
264
|
*/
|
|
265
|
-
const
|
|
266
|
-
\f\r]`,
|
|
267
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
268
|
-
function
|
|
269
|
-
if (!
|
|
270
|
-
return
|
|
271
|
-
}
|
|
272
|
-
const
|
|
265
|
+
const Ne = globalThis, Ze = (t) => t, de = Ne.trustedTypes, Xe = de ? de.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Ot = "$lit$", L = `lit$${Math.random().toFixed(9).slice(2)}$`, Lt = "?" + L, nn = `<${Lt}>`, N = document, te = () => N.createComment(""), ne = (t) => t === null || typeof t != "object" && typeof t != "function", De = Array.isArray, sn = (t) => De(t) || typeof t?.[Symbol.iterator] == "function", be = `[
|
|
266
|
+
\f\r]`, V = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ye = /-->/g, Je = />/g, P = RegExp(`>|${be}(?:([^\\s"'>=/]+)(${be}*=${be}*(?:[^
|
|
267
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Qe = /'/g, et = /"/g, Mt = /^(?:script|style|textarea|title)$/i, rn = (t) => (e, ...n) => ({ _$litType$: t, strings: e, values: n }), T = rn(1), H = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), tt = /* @__PURE__ */ new WeakMap(), C = N.createTreeWalker(N, 129);
|
|
268
|
+
function Pt(t, e) {
|
|
269
|
+
if (!De(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
270
|
+
return Xe !== void 0 ? Xe.createHTML(e) : e;
|
|
271
|
+
}
|
|
272
|
+
const on = (t, e) => {
|
|
273
273
|
const n = t.length - 1, s = [];
|
|
274
|
-
let i, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o =
|
|
274
|
+
let i, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = V;
|
|
275
275
|
for (let l = 0; l < n; l++) {
|
|
276
276
|
const a = t[l];
|
|
277
|
-
let f, h, c = -1,
|
|
278
|
-
for (;
|
|
279
|
-
const _ = o ===
|
|
280
|
-
r += o ===
|
|
277
|
+
let f, h, c = -1, y = 0;
|
|
278
|
+
for (; y < a.length && (o.lastIndex = y, h = o.exec(a), h !== null); ) y = o.lastIndex, o === V ? h[1] === "!--" ? o = Ye : h[1] !== void 0 ? o = Je : h[2] !== void 0 ? (Mt.test(h[2]) && (i = RegExp("</" + h[2], "g")), o = P) : h[3] !== void 0 && (o = P) : o === P ? h[0] === ">" ? (o = i ?? V, c = -1) : h[1] === void 0 ? c = -2 : (c = o.lastIndex - h[2].length, f = h[1], o = h[3] === void 0 ? P : h[3] === '"' ? et : Qe) : o === et || o === Qe ? o = P : o === Ye || o === Je ? o = V : (o = P, i = void 0);
|
|
279
|
+
const _ = o === P && t[l + 1].startsWith("/>") ? " " : "";
|
|
280
|
+
r += o === V ? a + nn : c >= 0 ? (s.push(f), a.slice(0, c) + Ot + a.slice(c) + L + _) : a + L + (c === -2 ? l : _);
|
|
281
281
|
}
|
|
282
|
-
return [
|
|
282
|
+
return [Pt(t, r + (t[n] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
283
283
|
};
|
|
284
|
-
class
|
|
284
|
+
class se {
|
|
285
285
|
constructor({ strings: e, _$litType$: n }, s) {
|
|
286
286
|
let i;
|
|
287
287
|
this.parts = [];
|
|
288
288
|
let r = 0, o = 0;
|
|
289
|
-
const l = e.length - 1, a = this.parts, [f, h] =
|
|
290
|
-
if (this.el =
|
|
289
|
+
const l = e.length - 1, a = this.parts, [f, h] = on(e, n);
|
|
290
|
+
if (this.el = se.createElement(f, s), C.currentNode = this.el.content, n === 2 || n === 3) {
|
|
291
291
|
const c = this.el.content.firstChild;
|
|
292
292
|
c.replaceWith(...c.childNodes);
|
|
293
293
|
}
|
|
294
|
-
for (; (i =
|
|
294
|
+
for (; (i = C.nextNode()) !== null && a.length < l; ) {
|
|
295
295
|
if (i.nodeType === 1) {
|
|
296
|
-
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(
|
|
297
|
-
const
|
|
298
|
-
a.push({ type: 1, index: r, name: m[2], strings: _, ctor: m[1] === "." ?
|
|
299
|
-
} else c.startsWith(
|
|
300
|
-
if (
|
|
301
|
-
const c = i.textContent.split(
|
|
302
|
-
if (
|
|
303
|
-
i.textContent =
|
|
304
|
-
for (let _ = 0; _ <
|
|
305
|
-
i.append(c[
|
|
296
|
+
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(Ot)) {
|
|
297
|
+
const y = h[o++], _ = i.getAttribute(c).split(L), m = /([.?@])?(.*)/.exec(y);
|
|
298
|
+
a.push({ type: 1, index: r, name: m[2], strings: _, ctor: m[1] === "." ? ln : m[1] === "?" ? cn : m[1] === "@" ? un : me }), i.removeAttribute(c);
|
|
299
|
+
} else c.startsWith(L) && (a.push({ type: 6, index: r }), i.removeAttribute(c));
|
|
300
|
+
if (Mt.test(i.tagName)) {
|
|
301
|
+
const c = i.textContent.split(L), y = c.length - 1;
|
|
302
|
+
if (y > 0) {
|
|
303
|
+
i.textContent = de ? de.emptyScript : "";
|
|
304
|
+
for (let _ = 0; _ < y; _++) i.append(c[_], te()), C.nextNode(), a.push({ type: 2, index: ++r });
|
|
305
|
+
i.append(c[y], te());
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
} else if (i.nodeType === 8) if (i.data ===
|
|
308
|
+
} else if (i.nodeType === 8) if (i.data === Lt) a.push({ type: 2, index: r });
|
|
309
309
|
else {
|
|
310
310
|
let c = -1;
|
|
311
|
-
for (; (c = i.data.indexOf(
|
|
311
|
+
for (; (c = i.data.indexOf(L, c + 1)) !== -1; ) a.push({ type: 7, index: r }), c += L.length - 1;
|
|
312
312
|
}
|
|
313
313
|
r++;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
static createElement(e, n) {
|
|
317
|
-
const s =
|
|
317
|
+
const s = N.createElement("template");
|
|
318
318
|
return s.innerHTML = e, s;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
if (e ===
|
|
321
|
+
function j(t, e, n = t, s) {
|
|
322
|
+
if (e === H) return e;
|
|
323
323
|
let i = s !== void 0 ? n._$Co?.[s] : n._$Cl;
|
|
324
|
-
const r =
|
|
325
|
-
return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(t), i._$AT(t, n, s)), s !== void 0 ? (n._$Co ??= [])[s] = i : n._$Cl = i), i !== void 0 && (e =
|
|
324
|
+
const r = ne(e) ? void 0 : e._$litDirective$;
|
|
325
|
+
return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(t), i._$AT(t, n, s)), s !== void 0 ? (n._$Co ??= [])[s] = i : n._$Cl = i), i !== void 0 && (e = j(t, i._$AS(t, e.values), i, s)), e;
|
|
326
326
|
}
|
|
327
|
-
class
|
|
327
|
+
class an {
|
|
328
328
|
constructor(e, n) {
|
|
329
329
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = n;
|
|
330
330
|
}
|
|
@@ -335,24 +335,24 @@ class Qt {
|
|
|
335
335
|
return this._$AM._$AU;
|
|
336
336
|
}
|
|
337
337
|
u(e) {
|
|
338
|
-
const { el: { content: n }, parts: s } = this._$AD, i = (e?.creationScope ??
|
|
339
|
-
|
|
340
|
-
let r =
|
|
338
|
+
const { el: { content: n }, parts: s } = this._$AD, i = (e?.creationScope ?? N).importNode(n, !0);
|
|
339
|
+
C.currentNode = i;
|
|
340
|
+
let r = C.nextNode(), o = 0, l = 0, a = s[0];
|
|
341
341
|
for (; a !== void 0; ) {
|
|
342
342
|
if (o === a.index) {
|
|
343
343
|
let f;
|
|
344
|
-
a.type === 2 ? f = new
|
|
344
|
+
a.type === 2 ? f = new re(r, r.nextSibling, this, e) : a.type === 1 ? f = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (f = new dn(r, this, e)), this._$AV.push(f), a = s[++l];
|
|
345
345
|
}
|
|
346
|
-
o !== a?.index && (r =
|
|
346
|
+
o !== a?.index && (r = C.nextNode(), o++);
|
|
347
347
|
}
|
|
348
|
-
return
|
|
348
|
+
return C.currentNode = N, i;
|
|
349
349
|
}
|
|
350
350
|
p(e) {
|
|
351
351
|
let n = 0;
|
|
352
352
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, n), n += s.strings.length - 2) : s._$AI(e[n])), n++;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
class
|
|
355
|
+
class re {
|
|
356
356
|
get _$AU() {
|
|
357
357
|
return this._$AM?._$AU ?? this._$Cv;
|
|
358
358
|
}
|
|
@@ -371,7 +371,7 @@ class ae {
|
|
|
371
371
|
return this._$AB;
|
|
372
372
|
}
|
|
373
373
|
_$AI(e, n = this) {
|
|
374
|
-
e =
|
|
374
|
+
e = j(this, e, n), ne(e) ? e === A || e == null || e === "" ? (this._$AH !== A && this._$AR(), this._$AH = A) : e !== this._$AH && e !== H && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : sn(e) ? this.k(e) : this._(e);
|
|
375
375
|
}
|
|
376
376
|
O(e) {
|
|
377
377
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -380,38 +380,38 @@ class ae {
|
|
|
380
380
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
381
381
|
}
|
|
382
382
|
_(e) {
|
|
383
|
-
this._$AH !== A &&
|
|
383
|
+
this._$AH !== A && ne(this._$AH) ? this._$AA.nextSibling.data = e : this.T(N.createTextNode(e)), this._$AH = e;
|
|
384
384
|
}
|
|
385
385
|
$(e) {
|
|
386
|
-
const { values: n, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el =
|
|
386
|
+
const { values: n, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = se.createElement(Pt(s.h, s.h[0]), this.options)), s);
|
|
387
387
|
if (this._$AH?._$AD === i) this._$AH.p(n);
|
|
388
388
|
else {
|
|
389
|
-
const r = new
|
|
389
|
+
const r = new an(i, this), o = r.u(this.options);
|
|
390
390
|
r.p(n), this.T(o), this._$AH = r;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
_$AC(e) {
|
|
394
|
-
let n =
|
|
395
|
-
return n === void 0 &&
|
|
394
|
+
let n = tt.get(e.strings);
|
|
395
|
+
return n === void 0 && tt.set(e.strings, n = new se(e)), n;
|
|
396
396
|
}
|
|
397
397
|
k(e) {
|
|
398
|
-
|
|
398
|
+
De(this._$AH) || (this._$AH = [], this._$AR());
|
|
399
399
|
const n = this._$AH;
|
|
400
400
|
let s, i = 0;
|
|
401
|
-
for (const r of e) i === n.length ? n.push(s = new
|
|
401
|
+
for (const r of e) i === n.length ? n.push(s = new re(this.O(te()), this.O(te()), this, this.options)) : s = n[i], s._$AI(r), i++;
|
|
402
402
|
i < n.length && (this._$AR(s && s._$AB.nextSibling, i), n.length = i);
|
|
403
403
|
}
|
|
404
404
|
_$AR(e = this._$AA.nextSibling, n) {
|
|
405
405
|
for (this._$AP?.(!1, !0, n); e !== this._$AB; ) {
|
|
406
|
-
const s =
|
|
407
|
-
|
|
406
|
+
const s = Ze(e).nextSibling;
|
|
407
|
+
Ze(e).remove(), e = s;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
setConnected(e) {
|
|
411
411
|
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
class
|
|
414
|
+
class me {
|
|
415
415
|
get tagName() {
|
|
416
416
|
return this.element.tagName;
|
|
417
417
|
}
|
|
@@ -424,11 +424,11 @@ class ye {
|
|
|
424
424
|
_$AI(e, n = this, s, i) {
|
|
425
425
|
const r = this.strings;
|
|
426
426
|
let o = !1;
|
|
427
|
-
if (r === void 0) e =
|
|
427
|
+
if (r === void 0) e = j(this, e, n, 0), o = !ne(e) || e !== this._$AH && e !== H, o && (this._$AH = e);
|
|
428
428
|
else {
|
|
429
429
|
const l = e;
|
|
430
430
|
let a, f;
|
|
431
|
-
for (e = r[0], a = 0; a < r.length - 1; a++) f =
|
|
431
|
+
for (e = r[0], a = 0; a < r.length - 1; a++) f = j(this, l[s + a], n, a), f === H && (f = this._$AH[a]), o ||= !ne(f) || f !== this._$AH[a], f === A ? e = A : e !== A && (e += (f ?? "") + r[a + 1]), this._$AH[a] = f;
|
|
432
432
|
}
|
|
433
433
|
o && !i && this.j(e);
|
|
434
434
|
}
|
|
@@ -436,7 +436,7 @@ class ye {
|
|
|
436
436
|
e === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
class
|
|
439
|
+
class ln extends me {
|
|
440
440
|
constructor() {
|
|
441
441
|
super(...arguments), this.type = 3;
|
|
442
442
|
}
|
|
@@ -444,7 +444,7 @@ class en extends ye {
|
|
|
444
444
|
this.element[this.name] = e === A ? void 0 : e;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
class
|
|
447
|
+
class cn extends me {
|
|
448
448
|
constructor() {
|
|
449
449
|
super(...arguments), this.type = 4;
|
|
450
450
|
}
|
|
@@ -452,12 +452,12 @@ class tn extends ye {
|
|
|
452
452
|
this.element.toggleAttribute(this.name, !!e && e !== A);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
class
|
|
455
|
+
class un extends me {
|
|
456
456
|
constructor(e, n, s, i, r) {
|
|
457
457
|
super(e, n, s, i, r), this.type = 5;
|
|
458
458
|
}
|
|
459
459
|
_$AI(e, n = this) {
|
|
460
|
-
if ((e =
|
|
460
|
+
if ((e = j(this, e, n, 0) ?? A) === H) return;
|
|
461
461
|
const s = this._$AH, i = e === A && s !== A || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== A && (s === A || i);
|
|
462
462
|
i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
463
463
|
}
|
|
@@ -465,7 +465,7 @@ class nn extends ye {
|
|
|
465
465
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
class
|
|
468
|
+
class dn {
|
|
469
469
|
constructor(e, n, s) {
|
|
470
470
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = n, this.options = s;
|
|
471
471
|
}
|
|
@@ -473,17 +473,17 @@ class sn {
|
|
|
473
473
|
return this._$AM._$AU;
|
|
474
474
|
}
|
|
475
475
|
_$AI(e) {
|
|
476
|
-
|
|
476
|
+
j(this, e);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
const
|
|
479
|
+
const hn = Ne.litHtmlPolyfillSupport;
|
|
480
|
+
hn?.(se, re), (Ne.litHtmlVersions ??= []).push("3.3.3");
|
|
481
|
+
const pn = (t, e, n) => {
|
|
482
482
|
const s = n?.renderBefore ?? e;
|
|
483
483
|
let i = s._$litPart$;
|
|
484
484
|
if (i === void 0) {
|
|
485
485
|
const r = n?.renderBefore ?? null;
|
|
486
|
-
s._$litPart$ = i = new
|
|
486
|
+
s._$litPart$ = i = new re(e.insertBefore(te(), r), r, void 0, n ?? {});
|
|
487
487
|
}
|
|
488
488
|
return i._$AI(t), i;
|
|
489
489
|
};
|
|
@@ -492,8 +492,8 @@ const on = (t, e, n) => {
|
|
|
492
492
|
* Copyright 2017 Google LLC
|
|
493
493
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
494
494
|
*/
|
|
495
|
-
const
|
|
496
|
-
class
|
|
495
|
+
const ze = globalThis;
|
|
496
|
+
class ee extends D {
|
|
497
497
|
constructor() {
|
|
498
498
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
499
499
|
}
|
|
@@ -503,7 +503,7 @@ class ne extends F {
|
|
|
503
503
|
}
|
|
504
504
|
update(e) {
|
|
505
505
|
const n = this.render();
|
|
506
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
506
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = pn(n, this.renderRoot, this.renderOptions);
|
|
507
507
|
}
|
|
508
508
|
connectedCallback() {
|
|
509
509
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -512,18 +512,18 @@ class ne extends F {
|
|
|
512
512
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
513
513
|
}
|
|
514
514
|
render() {
|
|
515
|
-
return
|
|
515
|
+
return H;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
(
|
|
522
|
-
const
|
|
523
|
-
function
|
|
524
|
-
return i === void 0 ?
|
|
518
|
+
ee._$litElement$ = !0, ee.finalized = !0, ze.litElementHydrateSupport?.({ LitElement: ee });
|
|
519
|
+
const fn = ze.litElementPolyfillSupport;
|
|
520
|
+
fn?.({ LitElement: ee });
|
|
521
|
+
(ze.litElementVersions ??= []).push("4.2.2");
|
|
522
|
+
const ye = "steppy-tour-host", gn = "steppy-tours-manifest", mn = "steppy-tour", _n = "__STEPPY_TOURS_DISABLED__", Fe = "steppy:tour", bn = "steppy.tour.active", nt = 1, yn = ["click", "input", "change", "visible", "manual"], wn = ["click", "input", "change", "visible"], vn = ["top", "bottom", "left", "right", "auto"], Ys = ["tour-start", "tour-step", "tour-complete", "tour-dismiss", "tour-offpath", "tour-error"], Js = ["target-timeout", "entry-params", "load-failed", "schema-unsupported", "invalid-data"], Qs = ["layer", "spotlight", "bubble", "title", "body", "progress", "button", "primary", "secondary", "next", "close", "skip", "end", "resume", "pill", "guide-link"], $n = "^[A-Za-z0-9_.:/-]{1,128}$", En = "^[A-Za-z0-9_.:/-]{1,128}$", An = "^data-[a-z0-9-]+$", kn = "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$", Sn = "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$", xn = "^[A-Za-z0-9_-]{1,64}$", Tn = "^[A-Za-z]{2,3}(?:[-_][A-Za-z0-9]{1,8}){0,5}$", In = "^sha384-[A-Za-z0-9+/]{64}$", Rn = "^/$|^(?:/(?::[A-Za-z_][A-Za-z0-9_]{0,63}|[A-Za-z0-9._~%!$&()*+,;=@-]{1,128})){1,32}$", On = "^[A-Za-z0-9 :().,<>=/_-]{1,256}$", Ln = "^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$", st = 500, Ct = 100, it = 32, he = 16, Se = 200, Mn = 2e3, Pn = 512, Cn = 2048, Un = 256, we = 262144, Nn = 1048576, rt = 8e3, Dn = 2147483e3, ot = { top: "bottom", bottom: "top", left: "right", right: "left" };
|
|
523
|
+
function zn(t, e, n, s = 8, i) {
|
|
524
|
+
return i === void 0 ? Fn(t, e, n, s) : Hn(t, e, n, s, i);
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function Fn(t, e, n, s) {
|
|
527
527
|
const i = t.y, r = n.height - (t.y + t.height), o = t.x, l = n.width - (t.x + t.width), a = e.height + s, f = e.width + s, h = r >= i ? { side: "bottom", room: r } : { side: "top", room: i };
|
|
528
528
|
let c;
|
|
529
529
|
if (h.room >= a)
|
|
@@ -532,46 +532,46 @@ function Mn(t, e, n, s) {
|
|
|
532
532
|
const p = l >= o ? { side: "right", room: l } : { side: "left", room: o };
|
|
533
533
|
c = p.room >= f ? p.side : h.side;
|
|
534
534
|
}
|
|
535
|
-
const
|
|
535
|
+
const y = t.x + t.width / 2, _ = t.y + t.height / 2;
|
|
536
536
|
let m = 0, u = 0;
|
|
537
|
-
return c === "bottom" ? (m =
|
|
537
|
+
return c === "bottom" ? (m = M(y - e.width / 2, 0, n.width - e.width), u = Math.min(t.y + t.height + s, n.height - e.height)) : c === "top" ? (m = M(y - e.width / 2, 0, n.width - e.width), u = Math.max(0, t.y - e.height - s)) : c === "right" ? (m = Math.min(t.x + t.width + s, n.width - e.width), u = M(_ - e.height / 2, 0, n.height - e.height)) : (m = Math.max(0, t.x - e.width - s), u = M(_ - e.height / 2, 0, n.height - e.height)), { side: c, x: m, y: u };
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Hn(t, e, n, s, i) {
|
|
540
540
|
const r = i.margin, o = {
|
|
541
541
|
top: t.y - r,
|
|
542
542
|
bottom: n.height - (t.y + t.height) - r,
|
|
543
543
|
left: t.x - r,
|
|
544
544
|
right: n.width - (t.x + t.width) - r
|
|
545
|
-
}, l =
|
|
546
|
-
const w = d === "top" || d === "bottom",
|
|
547
|
-
return o[d] >=
|
|
545
|
+
}, l = jn(o, i.preferred ?? "auto"), a = (d) => {
|
|
546
|
+
const w = d === "top" || d === "bottom", b = w ? e.height : e.width, $ = w ? e.width : e.height, E = w ? n.width : n.height;
|
|
547
|
+
return o[d] >= b + s && $ <= E - 2 * r;
|
|
548
548
|
}, f = (d) => {
|
|
549
|
-
const w = t.x + t.width / 2,
|
|
549
|
+
const w = t.x + t.width / 2, b = t.y + t.height / 2, $ = M(w - e.width / 2, r, n.width - e.width - r), E = M(b - e.height / 2, r, n.height - e.height - r);
|
|
550
550
|
return d === "bottom" ? { side: d, x: $, y: t.y + t.height + s } : d === "top" ? { side: d, x: $, y: t.y - s - e.height } : d === "right" ? { side: d, x: t.x + t.width + s, y: E } : { side: d, x: t.x - s - e.width, y: E };
|
|
551
|
-
}, h = i.avoid ?? [], c = (d) => h.some((w) => xe({ x: d.x, y: d.y, width: e.width, height: e.height }, w)),
|
|
551
|
+
}, h = i.avoid ?? [], c = (d) => h.some((w) => xe({ x: d.x, y: d.y, width: e.width, height: e.height }, w)), y = l.filter(a).map(f), m = y.filter((d) => !c(d))[0] ?? y[0];
|
|
552
552
|
if (m) return { ...m, overlaps: !1 };
|
|
553
|
-
const u = f(l[0]), p =
|
|
553
|
+
const u = f(l[0]), p = M(u.x, r, n.width - e.width - r), v = M(u.y, r, n.height - e.height - r), g = xe({ x: p, y: v, width: e.width, height: e.height }, t);
|
|
554
554
|
return { side: u.side, x: p, y: v, overlaps: g };
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function jn(t, e) {
|
|
557
557
|
if (e === "auto") {
|
|
558
558
|
const s = t.bottom >= t.top ? ["bottom", "top"] : ["top", "bottom"], i = t.right >= t.left ? ["right", "left"] : ["left", "right"];
|
|
559
559
|
return [...s, ...i];
|
|
560
560
|
}
|
|
561
|
-
const n = ["top", "bottom", "left", "right"].filter((s) => s !== e && s !==
|
|
562
|
-
return [e,
|
|
561
|
+
const n = ["top", "bottom", "left", "right"].filter((s) => s !== e && s !== ot[e]).sort((s, i) => t[i] - t[s]);
|
|
562
|
+
return [e, ot[e], ...n];
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function M(t, e, n) {
|
|
565
565
|
return Math.max(e, Math.min(n, t));
|
|
566
566
|
}
|
|
567
567
|
function xe(t, e) {
|
|
568
568
|
return t.x < e.x + e.width && e.x < t.x + t.width && t.y < e.y + e.height && e.y < t.y + t.height;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function at(t, e) {
|
|
571
571
|
const n = Math.max(t.x, e.x), s = Math.max(t.y, e.y), i = Math.min(t.x + t.width, e.x + e.width), r = Math.min(t.y + t.height, e.y + e.height);
|
|
572
572
|
return i > n && r > s ? { x: n, y: s, width: i - n, height: r - s } : null;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Bn(t, e) {
|
|
575
575
|
const n = Math.min(t.x, e.x), s = Math.min(t.y, e.y);
|
|
576
576
|
return {
|
|
577
577
|
x: n,
|
|
@@ -580,11 +580,11 @@ function Un(t, e) {
|
|
|
580
580
|
height: Math.max(t.y + t.height, e.y + e.height) - s
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function lt(t, e) {
|
|
584
584
|
return { x: t.x - e, y: t.y - e, width: t.width + 2 * e, height: t.height + 2 * e };
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
function
|
|
586
|
+
const Vn = 'button,input,select,textarea,a[href],[role=button],[role=combobox],[tabindex]:not([tabindex="-1"])';
|
|
587
|
+
function ct(t) {
|
|
588
588
|
const e = t.getBoundingClientRect();
|
|
589
589
|
return e.width > 0 && e.height > 0 ? { x: e.left, y: e.top, width: e.width, height: e.height } : null;
|
|
590
590
|
}
|
|
@@ -595,19 +595,19 @@ function Te(t, e = 0) {
|
|
|
595
595
|
let i = null;
|
|
596
596
|
for (const r of t.children) {
|
|
597
597
|
const o = Te(r, e + 1);
|
|
598
|
-
o && (i = i ?
|
|
598
|
+
o && (i = i ? Bn(i, o) : o);
|
|
599
599
|
}
|
|
600
600
|
return i;
|
|
601
601
|
}
|
|
602
|
-
const s =
|
|
602
|
+
const s = ct(t);
|
|
603
603
|
if (s || e >= 3) return s;
|
|
604
|
-
for (const i of t.querySelectorAll(
|
|
605
|
-
const r =
|
|
604
|
+
for (const i of t.querySelectorAll(Vn)) {
|
|
605
|
+
const r = ct(i);
|
|
606
606
|
if (r && getComputedStyle(i).visibility !== "hidden") return r;
|
|
607
607
|
}
|
|
608
608
|
return null;
|
|
609
609
|
}
|
|
610
|
-
const
|
|
610
|
+
const Kn = {
|
|
611
611
|
now: () => performance.now(),
|
|
612
612
|
raf: (t) => requestAnimationFrame(t),
|
|
613
613
|
cancelRaf: (t) => cancelAnimationFrame(t),
|
|
@@ -615,8 +615,8 @@ const Dn = {
|
|
|
615
615
|
clearTimeout: (t) => window.clearTimeout(t),
|
|
616
616
|
setInterval: (t, e) => window.setInterval(t, e),
|
|
617
617
|
clearInterval: (t) => window.clearInterval(t)
|
|
618
|
-
},
|
|
619
|
-
scheduler:
|
|
618
|
+
}, Ut = {
|
|
619
|
+
scheduler: Kn,
|
|
620
620
|
rect: (t) => Te(t),
|
|
621
621
|
isVisible: (t) => Te(t) !== null,
|
|
622
622
|
viewport: () => {
|
|
@@ -630,63 +630,63 @@ const Dn = {
|
|
|
630
630
|
return !1;
|
|
631
631
|
}
|
|
632
632
|
},
|
|
633
|
-
reducedMotion: () =>
|
|
633
|
+
reducedMotion: () => Ut.matchMedia("(prefers-reduced-motion: reduce)"),
|
|
634
634
|
scrollIntoView: (t, e) => t.scrollIntoView({ block: "center", inline: "nearest", behavior: e ? "instant" : "smooth" }),
|
|
635
635
|
supportsPopover: () => typeof HTMLElement.prototype.showPopover == "function"
|
|
636
636
|
};
|
|
637
|
-
function
|
|
637
|
+
function U() {
|
|
638
638
|
return { phase: "idle", token: 0, loaded: null, index: 0, reason: "start", fieldNonEmpty: !1 };
|
|
639
639
|
}
|
|
640
|
-
const
|
|
641
|
-
function
|
|
640
|
+
const X = (t) => t.phase !== "idle" && t.phase !== "loading";
|
|
641
|
+
function ie(t, e = t.index) {
|
|
642
642
|
const n = t.loaded?.applicable ?? [];
|
|
643
643
|
return { index: n.slice(0, e).filter(Boolean).length, total: n.filter(Boolean).length };
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function pe(t) {
|
|
646
646
|
const e = t.loaded.tour;
|
|
647
647
|
return { tourId: e.id, buildId: e.buildId, locale: e.locale };
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function K(t) {
|
|
650
650
|
const e = t.loaded.tour.steps[t.index];
|
|
651
|
-
return { ...
|
|
651
|
+
return { ...pe(t), stepId: e.id, ...ie(t) };
|
|
652
652
|
}
|
|
653
|
-
const
|
|
654
|
-
function
|
|
653
|
+
const O = (t, e) => ({ type: "emit", name: t, detail: e });
|
|
654
|
+
function Y(t, e, n) {
|
|
655
655
|
const s = { ...t, phase: "resolving", index: e, reason: n, token: t.token + 1, fieldNonEmpty: !1 };
|
|
656
656
|
return { state: s, effects: [{ type: "persist", index: e }, { type: "wait", mode: "resolve", index: e, token: s.token }] };
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function W(t, e, n) {
|
|
659
659
|
const i = t.loaded.applicable.findIndex((r, o) => r && o > e);
|
|
660
660
|
return i === -1 ? {
|
|
661
|
-
state: { ...
|
|
662
|
-
effects: [
|
|
663
|
-
} :
|
|
661
|
+
state: { ...U(), token: t.token + 1 },
|
|
662
|
+
effects: [O("tour-complete", { ...pe(t), total: ie(t).total }), { type: "clearPersist" }, { type: "teardown" }]
|
|
663
|
+
} : Y(t, i, n);
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function G(t) {
|
|
666
666
|
return t.loaded.tour.steps[t.index];
|
|
667
667
|
}
|
|
668
|
-
const
|
|
668
|
+
const Wn = {
|
|
669
669
|
click: "click",
|
|
670
670
|
"input-commit": "input",
|
|
671
671
|
change: "change",
|
|
672
672
|
visible: "visible"
|
|
673
673
|
};
|
|
674
|
-
function
|
|
674
|
+
function Gn(t, e) {
|
|
675
675
|
const n = { state: t, effects: [] };
|
|
676
676
|
if ("token" in e && e.token !== void 0 && e.token !== t.token) return n;
|
|
677
677
|
switch (e.type) {
|
|
678
678
|
case "REQUEST":
|
|
679
|
-
return { state: { ...
|
|
679
|
+
return { state: { ...U(), phase: "loading", token: t.token + 1 }, effects: [{ type: "load" }] };
|
|
680
680
|
case "LOAD_FAILED":
|
|
681
681
|
return t.phase !== "loading" ? n : {
|
|
682
|
-
state: { ...
|
|
683
|
-
effects: [
|
|
682
|
+
state: { ...U(), token: t.token + 1 },
|
|
683
|
+
effects: [O("tour-error", e.error), { type: "clearPersist" }, { type: "teardown" }]
|
|
684
684
|
};
|
|
685
685
|
case "LOADED": {
|
|
686
686
|
if (t.phase !== "loading") return n;
|
|
687
|
-
const s = e.loaded, i = { ...t, loaded: s, index: s.start }, r =
|
|
688
|
-
...
|
|
689
|
-
total:
|
|
687
|
+
const s = e.loaded, i = { ...t, loaded: s, index: s.start }, r = O("tour-start", {
|
|
688
|
+
...pe(i),
|
|
689
|
+
total: ie(i).total,
|
|
690
690
|
source: s.source,
|
|
691
691
|
resumed: s.resumed,
|
|
692
692
|
entryNavigated: s.navigate
|
|
@@ -695,58 +695,58 @@ function Hn(t, e) {
|
|
|
695
695
|
const a = { ...i, phase: "entering", reason: o, token: t.token + 1 };
|
|
696
696
|
return { state: a, effects: [r, { type: "persist", index: s.start }, { type: "navigate", token: a.token }] };
|
|
697
697
|
}
|
|
698
|
-
const l =
|
|
698
|
+
const l = Y(i, s.start, o);
|
|
699
699
|
return { state: l.state, effects: [r, ...l.effects] };
|
|
700
700
|
}
|
|
701
701
|
case "ENTER_DONE":
|
|
702
|
-
return t.phase === "entering" ?
|
|
702
|
+
return t.phase === "entering" ? Y(t, t.index, t.reason) : n;
|
|
703
703
|
case "ENTER_FAILED":
|
|
704
704
|
return t.phase !== "entering" ? n : {
|
|
705
|
-
state: { ...
|
|
705
|
+
state: { ...U(), token: t.token + 1 },
|
|
706
706
|
effects: [
|
|
707
|
-
|
|
707
|
+
O("tour-error", { reason: "entry-params", fatal: !0, message: e.message, ...pe(t) }),
|
|
708
708
|
{ type: "clearPersist" },
|
|
709
709
|
{ type: "teardown" }
|
|
710
710
|
]
|
|
711
711
|
};
|
|
712
712
|
case "RESOLVED": {
|
|
713
713
|
if (t.phase !== "resolving" && t.phase !== "fallback") return n;
|
|
714
|
-
const s = t.phase === "fallback" ? "recovered" : t.reason, i = { ...t, phase: "showing", reason: s, token: t.token + 1, fieldNonEmpty: e.fieldNonEmpty ?? !1 }, r =
|
|
714
|
+
const s = t.phase === "fallback" ? "recovered" : t.reason, i = { ...t, phase: "showing", reason: s, token: t.token + 1, fieldNonEmpty: e.fieldNonEmpty ?? !1 }, r = G(i), o = [O("tour-step", { ...K(i), advance: r.advance, reason: s })];
|
|
715
715
|
return r.advance === "manual" && o.push({ type: "focus" }), r.advance === "visible" && o.push({ type: "wait", mode: "visible", index: t.index, token: i.token }), { state: i, effects: o };
|
|
716
716
|
}
|
|
717
717
|
case "RESOLVE_TIMEOUT": {
|
|
718
|
-
const s = t.phase === "showing" &&
|
|
718
|
+
const s = t.phase === "showing" && G(t).advance === "visible";
|
|
719
719
|
if (t.phase !== "resolving" && !s) return n;
|
|
720
|
-
const i = { ...t, phase: "fallback", token: t.token + 1 }, r = { ...
|
|
720
|
+
const i = { ...t, phase: "fallback", token: t.token + 1 }, r = { ...K(i), reason: "target-timeout", fatal: !1, message: "the target did not appear in time" };
|
|
721
721
|
return {
|
|
722
722
|
state: i,
|
|
723
723
|
effects: [
|
|
724
|
-
|
|
724
|
+
O("tour-error", { ...r, ...e.testId ? { testId: e.testId } : {}, kind: e.kind }),
|
|
725
725
|
{ type: "wait", mode: "fallback", index: t.index, token: i.token },
|
|
726
726
|
{ type: "focus" }
|
|
727
727
|
]
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
730
|
case "TRIGGER":
|
|
731
|
-
return t.phase !== "showing" ||
|
|
731
|
+
return t.phase !== "showing" || G(t).advance !== Wn[e.kind] ? n : W(t, t.index, "advance");
|
|
732
732
|
case "NEXT": {
|
|
733
733
|
const s = e.token === void 0;
|
|
734
|
-
return t.phase === "fallback" && s ?
|
|
734
|
+
return t.phase === "fallback" && s ? W(t, t.index, "skip") : t.phase !== "showing" || !s && G(t).advance === "input" && !t.fieldNonEmpty ? n : W(t, t.index, "advance");
|
|
735
735
|
}
|
|
736
736
|
case "SKIP":
|
|
737
|
-
return t.phase === "fallback" ?
|
|
737
|
+
return t.phase === "fallback" ? W(t, t.index, "skip") : n;
|
|
738
738
|
case "FIELD":
|
|
739
739
|
return t.phase === "showing" && t.fieldNonEmpty !== e.nonEmpty ? { state: { ...t, fieldNonEmpty: e.nonEmpty }, effects: [] } : n;
|
|
740
740
|
case "JUMP":
|
|
741
|
-
return !(t.phase === "showing" || t.phase === "lost" || t.phase === "paused" || t.phase === "fallback") || e.to <= t.index || !t.loaded.applicable[e.to] ? n : e.performed ?
|
|
741
|
+
return !(t.phase === "showing" || t.phase === "lost" || t.phase === "paused" || t.phase === "fallback") || e.to <= t.index || !t.loaded.applicable[e.to] ? n : e.performed ? W(t, e.to, "jump") : Y(t, e.to, "jump");
|
|
742
742
|
case "TARGET_LOST":
|
|
743
|
-
return t.phase !== "showing" ? n :
|
|
743
|
+
return t.phase !== "showing" ? n : qn(t);
|
|
744
744
|
case "TARGET_BACK": {
|
|
745
745
|
if (t.phase !== "lost" && t.phase !== "paused") return n;
|
|
746
746
|
const s = { ...t, phase: "showing", token: t.token + 1 };
|
|
747
747
|
return t.phase === "lost" ? { state: s, effects: [] } : {
|
|
748
748
|
state: { ...s, reason: "resume" },
|
|
749
|
-
effects: [
|
|
749
|
+
effects: [O("tour-step", { ...K(s), advance: G(s).advance, reason: "resume" })]
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
752
|
case "LOST_TIMEOUT": {
|
|
@@ -755,103 +755,103 @@ function Hn(t, e) {
|
|
|
755
755
|
return {
|
|
756
756
|
state: s,
|
|
757
757
|
effects: [
|
|
758
|
-
|
|
758
|
+
O("tour-offpath", { ...K(s), reason: "target-lost" }),
|
|
759
759
|
{ type: "wait", mode: "paused", index: t.index, token: s.token }
|
|
760
760
|
]
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
763
|
case "RESUME":
|
|
764
|
-
return t.phase === "paused" ?
|
|
764
|
+
return t.phase === "paused" ? Y(t, t.index, "resume") : n;
|
|
765
765
|
case "DISMISS": {
|
|
766
766
|
if (t.phase === "idle") return n;
|
|
767
767
|
const s = [];
|
|
768
|
-
return t.loaded && t.phase !== "loading" && s.push(
|
|
768
|
+
return t.loaded && t.phase !== "loading" && s.push(O("tour-dismiss", { ...K(t), via: e.via, ...e.reason ? { reason: e.reason } : {} })), s.push({ type: "clearPersist" }, { type: "teardown" }), { state: { ...U(), token: t.token + 1 }, effects: s };
|
|
769
769
|
}
|
|
770
770
|
case "LOCALE": {
|
|
771
|
-
if (!
|
|
771
|
+
if (!X(t)) return n;
|
|
772
772
|
const s = t.loaded.tour.steps;
|
|
773
773
|
return e.tour.steps.length === s.length && e.tour.steps.every((r, o) => r.id === s[o].id && r.target === s[o].target && r.advance === s[o].advance) ? { state: { ...t, loaded: { ...t.loaded, tour: e.tour } }, effects: [] } : n;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function qn(t) {
|
|
778
778
|
const e = { ...t, phase: "lost", token: t.token + 1 };
|
|
779
779
|
return { state: e, effects: [{ type: "wait", mode: "lost", index: t.index, token: e.token }] };
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function Zn(t, e, n) {
|
|
782
782
|
t.dispatchEvent(new CustomEvent(e, { detail: n, bubbles: !0, composed: !0 }));
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function ut() {
|
|
785
785
|
let t = document.activeElement;
|
|
786
786
|
for (; t?.shadowRoot?.activeElement; ) t = t.shadowRoot.activeElement;
|
|
787
787
|
return t;
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function Nt(t) {
|
|
790
790
|
try {
|
|
791
791
|
return t.matches(":popover-open");
|
|
792
792
|
} catch {
|
|
793
793
|
return !1;
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
if (!(!e.supportsPopover() ||
|
|
796
|
+
function Xn(t, e) {
|
|
797
|
+
if (!(!e.supportsPopover() || Nt(t)))
|
|
798
798
|
try {
|
|
799
799
|
t.showPopover();
|
|
800
800
|
} catch {
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function Yn(t, e) {
|
|
804
804
|
if (!e.supportsPopover()) return;
|
|
805
|
-
const n =
|
|
805
|
+
const n = ut();
|
|
806
806
|
try {
|
|
807
|
-
|
|
807
|
+
Nt(t) && t.hidePopover(), t.showPopover();
|
|
808
808
|
} catch {
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
|
-
n instanceof HTMLElement && n.isConnected &&
|
|
811
|
+
n instanceof HTMLElement && n.isConnected && ut() !== n && n.focus({ preventScroll: !0 });
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function Jn(t, e) {
|
|
814
814
|
return t.replace(/\{(\w+)\}/g, (n, s) => s in e ? String(e[s]) : `{${s}}`);
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function Qn(t) {
|
|
817
817
|
return t.replace(/_/g, "-").split("-", 1)[0].toLowerCase();
|
|
818
818
|
}
|
|
819
819
|
function Ie(t, e) {
|
|
820
820
|
if (!e) return null;
|
|
821
821
|
const n = (l) => l.replace(/_/g, "-").toLowerCase(), s = [...t], i = n(e), r = s.find((l) => n(l) === i);
|
|
822
822
|
if (r !== void 0) return r;
|
|
823
|
-
const o =
|
|
823
|
+
const o = Qn(e);
|
|
824
824
|
return s.find((l) => n(l) === o) ?? null;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function es(t, e, n, s = "en") {
|
|
827
827
|
const i = Ie(Object.keys(t), e), r = (i !== null ? t[i] : void 0) ?? t[s], o = n ? Ie(Object.keys(n), e) : null, l = o !== null ? n[o] : void 0;
|
|
828
828
|
return l ? { ...r, ...l } : r;
|
|
829
829
|
}
|
|
830
|
-
const
|
|
830
|
+
const ae = {
|
|
831
831
|
en: { next: "Next", progress: "Step {current} of {total}" },
|
|
832
832
|
fr: { next: "Suivant", progress: "Étape {current} sur {total}" },
|
|
833
833
|
nl: { next: "Volgende", progress: "Stap {current} van {total}" },
|
|
834
834
|
de: { next: "Weiter", progress: "Schritt {current} von {total}" }
|
|
835
|
-
},
|
|
836
|
-
testId: new RegExp(
|
|
837
|
-
stepId: new RegExp(
|
|
838
|
-
tourId: new RegExp(
|
|
839
|
-
attr: new RegExp(
|
|
840
|
-
locale: new RegExp(
|
|
841
|
-
layout: new RegExp(
|
|
842
|
-
role: new RegExp(
|
|
843
|
-
route: new RegExp(
|
|
844
|
-
media: new RegExp(
|
|
845
|
-
sri: new RegExp(
|
|
846
|
-
buildId: new RegExp(
|
|
847
|
-
},
|
|
848
|
-
function
|
|
849
|
-
return typeof t == "string" && t.length <=
|
|
850
|
-
}
|
|
851
|
-
function
|
|
852
|
-
return typeof t == "string" &&
|
|
853
|
-
}
|
|
854
|
-
function
|
|
835
|
+
}, ts = 20, I = {
|
|
836
|
+
testId: new RegExp($n),
|
|
837
|
+
stepId: new RegExp(En),
|
|
838
|
+
tourId: new RegExp(kn),
|
|
839
|
+
attr: new RegExp(An),
|
|
840
|
+
locale: new RegExp(Tn),
|
|
841
|
+
layout: new RegExp(Sn),
|
|
842
|
+
role: new RegExp(xn),
|
|
843
|
+
route: new RegExp(Rn),
|
|
844
|
+
media: new RegExp(On),
|
|
845
|
+
sri: new RegExp(In),
|
|
846
|
+
buildId: new RegExp(Ln)
|
|
847
|
+
}, ns = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])$/i, ss = /%(?![0-9A-Fa-f]{2})/;
|
|
848
|
+
function is(t) {
|
|
849
|
+
return typeof t == "string" && t.length <= Pn && I.route.test(t) && !ss.test(t) && t.split("/").slice(1).every((e) => !/^\.\.?$/.test(e.replace(/%2e/gi, ".")));
|
|
850
|
+
}
|
|
851
|
+
function Dt(t) {
|
|
852
|
+
return typeof t == "string" && I.buildId.test(t) && !ns.test(t.split(".")[0]);
|
|
853
|
+
}
|
|
854
|
+
function _e(t) {
|
|
855
855
|
let e;
|
|
856
856
|
try {
|
|
857
857
|
e = new URL(t);
|
|
@@ -860,12 +860,12 @@ function be(t) {
|
|
|
860
860
|
}
|
|
861
861
|
return e.protocol !== "https:" && e.protocol !== "http:" || e.username || e.password ? null : e.origin;
|
|
862
862
|
}
|
|
863
|
-
class
|
|
863
|
+
class He {
|
|
864
864
|
constructor() {
|
|
865
865
|
this.issues = [];
|
|
866
866
|
}
|
|
867
867
|
fail(e, n) {
|
|
868
|
-
this.issues.length <
|
|
868
|
+
this.issues.length < ts && this.issues.push({ path: e, message: n });
|
|
869
869
|
}
|
|
870
870
|
get ok() {
|
|
871
871
|
return this.issues.length === 0;
|
|
@@ -893,7 +893,7 @@ class ze {
|
|
|
893
893
|
entry(e, n) {
|
|
894
894
|
if (e === null) return null;
|
|
895
895
|
const s = this.obj(e, n);
|
|
896
|
-
return s ?
|
|
896
|
+
return s ? is(s.route) ? Object.freeze({ route: s.route }) : (this.fail(`${n}.route`, "is not a same-origin, base-relative route pattern"), null) : null;
|
|
897
897
|
}
|
|
898
898
|
stringMap(e, n, s) {
|
|
899
899
|
const i = {}, r = this.obj(e, n);
|
|
@@ -905,10 +905,10 @@ class ze {
|
|
|
905
905
|
return Object.freeze(i);
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function zt(t, e, n) {
|
|
909
909
|
return e.kind !== n && t.fail("kind", `must be "${n}"`), t.ok;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function ve(t) {
|
|
912
912
|
if (/^\s*</.test(t))
|
|
913
913
|
return { ok: !1, reason: "load-failed", issues: [{ path: "", message: "received HTML (missing file or SPA fallback?)" }] };
|
|
914
914
|
try {
|
|
@@ -917,65 +917,65 @@ function Ee(t) {
|
|
|
917
917
|
return { ok: !1, reason: "invalid-data", issues: [{ path: "", message: `not JSON: ${String(e)}` }] };
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
const e = new
|
|
920
|
+
function Ft(t) {
|
|
921
|
+
const e = new He(), n = e.obj(t, "");
|
|
922
922
|
if (!n) return { ok: !1, reason: "invalid-data", issues: e.issues };
|
|
923
923
|
const s = n.schema;
|
|
924
|
-
return typeof s != "number" || !Number.isInteger(s) ? { ok: !1, reason: "invalid-data", issues: [{ path: "schema", message: "must be an integer" }] } : s !==
|
|
924
|
+
return typeof s != "number" || !Number.isInteger(s) ? { ok: !1, reason: "invalid-data", issues: [{ path: "schema", message: "must be an integer" }] } : s !== nt ? {
|
|
925
925
|
ok: !1,
|
|
926
926
|
reason: "schema-unsupported",
|
|
927
|
-
issues: [{ path: "schema", message: `schema ${s} is not supported (this overlay reads ${
|
|
927
|
+
issues: [{ path: "schema", message: `schema ${s} is not supported (this overlay reads ${nt})` }]
|
|
928
928
|
} : { ok: !0, value: n };
|
|
929
929
|
}
|
|
930
|
-
function
|
|
931
|
-
const e =
|
|
930
|
+
function rs(t) {
|
|
931
|
+
const e = Ft(t);
|
|
932
932
|
if (!e.ok) return e;
|
|
933
|
-
const n = e.value, s = new
|
|
934
|
-
if (!
|
|
935
|
-
const i =
|
|
936
|
-
!Array.isArray(n.locales) || n.locales.length < 1 || n.locales.length >
|
|
937
|
-
const u = s.str(_, `locales.${m}`,
|
|
933
|
+
const n = e.value, s = new He();
|
|
934
|
+
if (!zt(s, n, gn)) return { ok: !1, reason: "invalid-data", issues: s.issues };
|
|
935
|
+
const i = Dt(n.buildId) ? n.buildId : (s.fail("buildId", "is not a build id"), ""), r = s.str(n.testIdAttribute, "testIdAttribute", I.attr) ?? "", o = [], l = (_) => _.replace(/_/g, "-").toLowerCase();
|
|
936
|
+
!Array.isArray(n.locales) || n.locales.length < 1 || n.locales.length > it ? s.fail("locales", `must list 1..${it} locales`) : n.locales.forEach((_, m) => {
|
|
937
|
+
const u = s.str(_, `locales.${m}`, I.locale);
|
|
938
938
|
u !== null && (o.some((p) => l(p) === l(u)) ? s.fail(`locales.${m}`, "is listed twice") : o.push(u));
|
|
939
939
|
});
|
|
940
|
-
const a = s.str(n.defaultLocale, "defaultLocale",
|
|
940
|
+
const a = s.str(n.defaultLocale, "defaultLocale", I.locale) ?? "";
|
|
941
941
|
a && !o.includes(a) && s.fail("defaultLocale", "must be one of locales");
|
|
942
942
|
let f = null;
|
|
943
943
|
if (n.guideOrigin !== void 0 && n.guideOrigin !== null) {
|
|
944
944
|
const _ = s.str(n.guideOrigin, "guideOrigin");
|
|
945
|
-
_ !== null &&
|
|
945
|
+
_ !== null && _e(_) !== _ ? s.fail("guideOrigin", "must be an origin only (scheme://host[:port])") : f = _;
|
|
946
946
|
}
|
|
947
947
|
let h = null;
|
|
948
948
|
if (n.layouts !== void 0 && n.layouts !== null) {
|
|
949
|
-
h = s.stringMap(n.layouts, "layouts", (m, u, p) =>
|
|
949
|
+
h = s.stringMap(n.layouts, "layouts", (m, u, p) => I.layout.test(m) ? typeof u != "string" || u.length > Un || !I.media.test(u) ? (s.fail(p, "is not a media query"), null) : u : (s.fail(p, "is not a layout name"), null));
|
|
950
950
|
const _ = Object.keys(h).length;
|
|
951
|
-
(_ < 1 || _ >
|
|
951
|
+
(_ < 1 || _ > he) && s.fail("layouts", `must map 1..${he} layouts`);
|
|
952
952
|
}
|
|
953
|
-
const c = [],
|
|
954
|
-
return !Array.isArray(n.tours) || n.tours.length >
|
|
953
|
+
const c = [], y = /* @__PURE__ */ new Set();
|
|
954
|
+
return !Array.isArray(n.tours) || n.tours.length > st ? s.fail("tours", `must be a list of at most ${st} tours`) : n.tours.forEach((_, m) => {
|
|
955
955
|
const u = `tours.${m}`, p = s.obj(_, u);
|
|
956
956
|
if (!p) return;
|
|
957
|
-
const v = s.str(p.id, `${u}.id`,
|
|
958
|
-
v !== null && (
|
|
957
|
+
const v = s.str(p.id, `${u}.id`, I.tourId);
|
|
958
|
+
v !== null && (y.has(v.toLowerCase()) && s.fail(`${u}.id`, "is not unique"), y.add(v.toLowerCase()));
|
|
959
959
|
const g = (E, k) => o.includes(E) || (s.fail(k, "is not one of locales"), !1), d = s.stringMap(
|
|
960
960
|
p.files,
|
|
961
961
|
`${u}.files`,
|
|
962
962
|
(E, k, S) => g(E, S) ? k !== `${v}.${E}.json` ? (s.fail(S, `must be "${v}.${E}.json"`), null) : k : null
|
|
963
963
|
);
|
|
964
964
|
a && !Object.hasOwn(d, a) && s.fail(`${u}.files`, "has no file for the default locale");
|
|
965
|
-
const w = s.stringMap(p.title, `${u}.title`, (E, k, S) => g(E, S) ? s.text(k, S, Se, !1) : null),
|
|
965
|
+
const w = s.stringMap(p.title, `${u}.title`, (E, k, S) => g(E, S) ? s.text(k, S, Se, !1) : null), b = s.stringMap(
|
|
966
966
|
p.integrity,
|
|
967
967
|
`${u}.integrity`,
|
|
968
|
-
(E, k, S) => Object.hasOwn(d, E) ? s.str(k, S,
|
|
968
|
+
(E, k, S) => Object.hasOwn(d, E) ? s.str(k, S, I.sri) : (s.fail(S, "has no matching file"), null)
|
|
969
969
|
);
|
|
970
|
-
for (const E in d) Object.hasOwn(
|
|
970
|
+
for (const E in d) Object.hasOwn(b, E) || s.fail(`${u}.integrity`, `has no hash for "${E}"`);
|
|
971
971
|
const $ = Object.freeze({
|
|
972
972
|
id: v ?? "",
|
|
973
|
-
role: s.str(p.role, `${u}.role`,
|
|
973
|
+
role: s.str(p.role, `${u}.role`, I.role) ?? "",
|
|
974
974
|
title: w,
|
|
975
975
|
entry: s.entry(p.entry, `${u}.entry`),
|
|
976
|
-
steps: s.int(p.steps, `${u}.steps`, 1,
|
|
976
|
+
steps: s.int(p.steps, `${u}.steps`, 1, Ct) ?? 0,
|
|
977
977
|
files: d,
|
|
978
|
-
integrity:
|
|
978
|
+
integrity: b
|
|
979
979
|
});
|
|
980
980
|
c.push($);
|
|
981
981
|
}), s.ok ? {
|
|
@@ -991,43 +991,43 @@ function Jn(t) {
|
|
|
991
991
|
})
|
|
992
992
|
} : { ok: !1, reason: "invalid-data", issues: s.issues };
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
const n =
|
|
994
|
+
function os(t, e) {
|
|
995
|
+
const n = Ft(t);
|
|
996
996
|
if (!n.ok) return n;
|
|
997
|
-
const s = n.value, i = new
|
|
998
|
-
if (!
|
|
997
|
+
const s = n.value, i = new He();
|
|
998
|
+
if (!zt(i, s, mn)) return { ok: !1, reason: "invalid-data", issues: i.issues };
|
|
999
999
|
const { manifest: r, entry: o } = e;
|
|
1000
|
-
s.id !== o.id && i.fail("id", `must be "${o.id}"`), (!
|
|
1000
|
+
s.id !== o.id && i.fail("id", `must be "${o.id}"`), (!Dt(s.buildId) || s.buildId !== r.buildId) && i.fail("buildId", `must be the manifest's "${r.buildId}"`), s.locale !== e.locale && i.fail("locale", `must be "${e.locale}"`);
|
|
1001
1001
|
const l = i.text(s.title, "title", Se, !1) ?? "";
|
|
1002
1002
|
let a = null;
|
|
1003
1003
|
if (s.guideUrl !== void 0 && s.guideUrl !== null) {
|
|
1004
1004
|
const _ = i.str(s.guideUrl, "guideUrl");
|
|
1005
1005
|
if (_ !== null) {
|
|
1006
|
-
const m = _.length <=
|
|
1006
|
+
const m = _.length <= Cn ? _e(_) : null;
|
|
1007
1007
|
m === null || e.guideOrigin === null || m !== e.guideOrigin ? i.fail("guideUrl", "must be an http(s) URL on the trusted guide origin") : a = _;
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
const f = s.entry === void 0 ? (i.fail("entry", "is required (null for none)"), null) : i.entry(s.entry, "entry");
|
|
1011
1011
|
(f?.route ?? null) !== (o.entry?.route ?? null) && i.fail("entry", "must equal the manifest's entry");
|
|
1012
|
-
const h = [], c = /* @__PURE__ */ new Set(),
|
|
1013
|
-
return !Array.isArray(s.steps) || s.steps.length !== o.steps || s.steps.length >
|
|
1012
|
+
const h = [], c = /* @__PURE__ */ new Set(), y = Object.keys(r.layouts ?? {});
|
|
1013
|
+
return !Array.isArray(s.steps) || s.steps.length !== o.steps || s.steps.length > Ct ? i.fail("steps", `must be a list of exactly ${o.steps} steps`) : s.steps.forEach((_, m) => {
|
|
1014
1014
|
const u = `steps.${m}`, p = i.obj(_, u);
|
|
1015
1015
|
if (!p) return;
|
|
1016
|
-
const v = i.str(p.id, `${u}.id`,
|
|
1016
|
+
const v = i.str(p.id, `${u}.id`, I.stepId) ?? "";
|
|
1017
1017
|
c.has(v) && i.fail(`${u}.id`, "is not unique"), c.add(v);
|
|
1018
|
-
const g = p.target === null ? null : i.str(p.target, `${u}.target`,
|
|
1019
|
-
w &&
|
|
1020
|
-
let
|
|
1021
|
-
p.layouts !== void 0 && p.layouts !== null && (!Array.isArray(p.layouts) || p.layouts.length < 1 || p.layouts.length >
|
|
1018
|
+
const g = p.target === null ? null : i.str(p.target, `${u}.target`, I.testId), d = i.obj(p.advance, `${u}.advance`), w = d ? i.oneOf(d.on, `${u}.advance.on`, yn) : null;
|
|
1019
|
+
w && wn.includes(w) && g === null && i.fail(`${u}.target`, `is required for advance "${w}"`);
|
|
1020
|
+
let b = null;
|
|
1021
|
+
p.layouts !== void 0 && p.layouts !== null && (!Array.isArray(p.layouts) || p.layouts.length < 1 || p.layouts.length > he ? i.fail(`${u}.layouts`, `must list 1..${he} layouts`) : (b = p.layouts.filter(($) => typeof $ == "string" && y.includes($)), b.length !== p.layouts.length && i.fail(`${u}.layouts`, "must name the manifest's layouts"))), h.push(
|
|
1022
1022
|
Object.freeze({
|
|
1023
1023
|
id: v,
|
|
1024
1024
|
target: g,
|
|
1025
1025
|
advance: w ?? "manual",
|
|
1026
|
-
waitFor: i.optStr(p.waitFor, `${u}.waitFor`,
|
|
1026
|
+
waitFor: i.optStr(p.waitFor, `${u}.waitFor`, I.testId),
|
|
1027
1027
|
title: i.text(p.title, `${u}.title`, Se, !0),
|
|
1028
|
-
text: i.text(p.text, `${u}.text`,
|
|
1029
|
-
placement: p.placement === void 0 || p.placement === null ? null : i.oneOf(p.placement, `${u}.placement`,
|
|
1030
|
-
layouts:
|
|
1028
|
+
text: i.text(p.text, `${u}.text`, Mn, !0),
|
|
1029
|
+
placement: p.placement === void 0 || p.placement === null ? null : i.oneOf(p.placement, `${u}.placement`, vn),
|
|
1030
|
+
layouts: b && Object.freeze(b)
|
|
1031
1031
|
})
|
|
1032
1032
|
);
|
|
1033
1033
|
}), i.ok ? {
|
|
@@ -1043,28 +1043,28 @@ function Qn(t, e) {
|
|
|
1043
1043
|
})
|
|
1044
1044
|
} : { ok: !1, reason: "invalid-data", issues: i.issues };
|
|
1045
1045
|
}
|
|
1046
|
-
const
|
|
1047
|
-
class
|
|
1046
|
+
const dt = { "load-failed": 0, "invalid-data": 1, "schema-unsupported": 2 };
|
|
1047
|
+
class R extends Error {
|
|
1048
1048
|
constructor(e, n) {
|
|
1049
1049
|
super(n), this.reason = e;
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function as(t, e, n) {
|
|
1053
1053
|
return Ie(t, e) ?? (t.includes(n) ? n : t[0]);
|
|
1054
1054
|
}
|
|
1055
|
-
async function
|
|
1056
|
-
if (!t.ok) throw new
|
|
1057
|
-
if (Number(t.headers.get("content-length") ?? NaN) > e) throw new
|
|
1055
|
+
async function ht(t, e) {
|
|
1056
|
+
if (!t.ok) throw new R("load-failed", `HTTP ${t.status}`);
|
|
1057
|
+
if (Number(t.headers.get("content-length") ?? NaN) > e) throw new R("invalid-data", `the file is larger than ${e} bytes`);
|
|
1058
1058
|
const s = new TextDecoder("utf-8", { fatal: !0 }), i = (h) => {
|
|
1059
1059
|
try {
|
|
1060
1060
|
return s.decode(h);
|
|
1061
1061
|
} catch {
|
|
1062
|
-
throw new
|
|
1062
|
+
throw new R("invalid-data", "the file is not valid UTF-8");
|
|
1063
1063
|
}
|
|
1064
1064
|
};
|
|
1065
1065
|
if (!t.body) {
|
|
1066
1066
|
const h = new Uint8Array(await t.arrayBuffer());
|
|
1067
|
-
if (h.byteLength > e) throw new
|
|
1067
|
+
if (h.byteLength > e) throw new R("invalid-data", `the file is larger than ${e} bytes`);
|
|
1068
1068
|
return i(h);
|
|
1069
1069
|
}
|
|
1070
1070
|
const r = t.body.getReader(), o = [];
|
|
@@ -1073,7 +1073,7 @@ async function ut(t, e) {
|
|
|
1073
1073
|
const { done: h, value: c } = await r.read();
|
|
1074
1074
|
if (h) break;
|
|
1075
1075
|
if (l += c.byteLength, l > e)
|
|
1076
|
-
throw r.cancel(), new
|
|
1076
|
+
throw r.cancel(), new R("invalid-data", `the file is larger than ${e} bytes`);
|
|
1077
1077
|
o.push(c);
|
|
1078
1078
|
}
|
|
1079
1079
|
const a = new Uint8Array(l);
|
|
@@ -1082,16 +1082,16 @@ async function ut(t, e) {
|
|
|
1082
1082
|
a.set(h, f), f += h.byteLength;
|
|
1083
1083
|
return i(a);
|
|
1084
1084
|
}
|
|
1085
|
-
async function
|
|
1085
|
+
async function pt(t, e) {
|
|
1086
1086
|
const n = t.origin ?? location.origin, s = t.baseURI ?? document.baseURI, i = t.fetch ?? globalThis.fetch.bind(globalThis), r = t.cache ?? /* @__PURE__ */ new Map(), o = (g) => new URL(g, s), l = (g) => o(g).origin !== n, a = t.timeoutMs ?? 1e4;
|
|
1087
1087
|
async function f(g, d, w) {
|
|
1088
|
-
const
|
|
1088
|
+
const b = l(g), $ = new AbortController(), E = setTimeout(() => $.abort(), a);
|
|
1089
1089
|
try {
|
|
1090
1090
|
const k = {
|
|
1091
|
-
credentials:
|
|
1092
|
-
mode:
|
|
1093
|
-
redirect:
|
|
1094
|
-
cache: d === "manifest" || !
|
|
1091
|
+
credentials: b ? "omit" : "same-origin",
|
|
1092
|
+
mode: b ? "cors" : "same-origin",
|
|
1093
|
+
redirect: b ? "error" : "follow",
|
|
1094
|
+
cache: d === "manifest" || !b ? "no-cache" : "default",
|
|
1095
1095
|
signal: $.signal
|
|
1096
1096
|
};
|
|
1097
1097
|
w && (k.integrity = w);
|
|
@@ -1099,9 +1099,9 @@ async function dt(t, e) {
|
|
|
1099
1099
|
try {
|
|
1100
1100
|
S = await i(o(g).href, k);
|
|
1101
1101
|
} catch (x) {
|
|
1102
|
-
throw new
|
|
1102
|
+
throw new R("load-failed", `could not fetch ${g}: ${String(x)}`);
|
|
1103
1103
|
}
|
|
1104
|
-
return await
|
|
1104
|
+
return await ht(S, d === "manifest" ? Nn : we);
|
|
1105
1105
|
} finally {
|
|
1106
1106
|
clearTimeout(E);
|
|
1107
1107
|
}
|
|
@@ -1111,22 +1111,22 @@ async function dt(t, e) {
|
|
|
1111
1111
|
let w = r.get(d);
|
|
1112
1112
|
return w || (w = (async () => {
|
|
1113
1113
|
try {
|
|
1114
|
-
const
|
|
1115
|
-
return { ...
|
|
1116
|
-
} catch (
|
|
1117
|
-
const $ =
|
|
1114
|
+
const b = ve(await f(g, "manifest"));
|
|
1115
|
+
return { ...b.ok ? rs(b.value) : b, url: d };
|
|
1116
|
+
} catch (b) {
|
|
1117
|
+
const $ = b instanceof R ? b : new R("load-failed", String(b));
|
|
1118
1118
|
return $.reason === "load-failed" && r.delete(d), { ok: !1, reason: $.reason, message: $.message, url: d };
|
|
1119
1119
|
}
|
|
1120
1120
|
})(), r.set(d, w)), w;
|
|
1121
1121
|
}
|
|
1122
|
-
const c = [],
|
|
1122
|
+
const c = [], y = (g, d) => c.push({ ok: !1, reason: g.reason, message: g.message ?? `${d}: ${g.issues?.[0]?.path ?? ""} ${g.issues?.[0]?.message ?? ""}`.trim(), issues: g.issues });
|
|
1123
1123
|
let _ = null;
|
|
1124
1124
|
if (t.fallbackManifest)
|
|
1125
1125
|
if (l(t.fallbackManifest))
|
|
1126
1126
|
c.push({ ok: !1, reason: "load-failed", message: "fallbackManifest must be same-origin" });
|
|
1127
1127
|
else {
|
|
1128
1128
|
const g = await h(t.fallbackManifest);
|
|
1129
|
-
g.ok ? _ = { ...g.value, url: g.url } :
|
|
1129
|
+
g.ok ? _ = { ...g.value, url: g.url } : y(g, "bundled manifest");
|
|
1130
1130
|
}
|
|
1131
1131
|
const m = t.buildId || _?.buildId || "";
|
|
1132
1132
|
let u = null;
|
|
@@ -1135,66 +1135,66 @@ async function dt(t, e) {
|
|
|
1135
1135
|
c.push({ ok: !1, reason: "load-failed", message: "the manifest URL needs a build id ({buildId}) and none is known" });
|
|
1136
1136
|
else {
|
|
1137
1137
|
const g = await h(t.manifest.split("{buildId}").join(encodeURIComponent(m)));
|
|
1138
|
-
g.ok ? m && g.value.buildId !== m ? c.push({ ok: !1, reason: "invalid-data", message: `the manifest is for build "${g.value.buildId}", expected "${m}"` }) : u = { ...g.value, url: g.url } :
|
|
1138
|
+
g.ok ? m && g.value.buildId !== m ? c.push({ ok: !1, reason: "invalid-data", message: `the manifest is for build "${g.value.buildId}", expected "${m}"` }) : u = { ...g.value, url: g.url } : y(g, "manifest"), !g.ok && _ && console.warn(`[steppy-tour] remote manifest unavailable, using the bundled copy: ${c.at(-1)?.message}`);
|
|
1139
1139
|
}
|
|
1140
1140
|
if (!t.manifest && !t.fallbackManifest)
|
|
1141
1141
|
return { ok: !1, reason: "load-failed", message: "no manifest is configured (set manifest or fallback-manifest)" };
|
|
1142
|
-
const p = u ? new URL(u.url).origin : null, v = t.guideOrigin && (
|
|
1142
|
+
const p = u ? new URL(u.url).origin : null, v = t.guideOrigin && (_e(t.guideOrigin) ?? t.guideOrigin) || _?.guideOrigin || (u && (!l(u.url) || u.guideOrigin === p) ? u.guideOrigin : null);
|
|
1143
1143
|
for (const g of [u, _]) {
|
|
1144
1144
|
if (!g) continue;
|
|
1145
|
-
const d = g !== _ && _?.buildId === g.buildId ? _ : g, w = d.tours.find((
|
|
1145
|
+
const d = g !== _ && _?.buildId === g.buildId ? _ : g, w = d.tours.find((b) => b.id === e);
|
|
1146
1146
|
if (!w)
|
|
1147
1147
|
c.push({ ok: !1, reason: "load-failed", message: `no tour "${e}" in ${d.url}` });
|
|
1148
1148
|
else {
|
|
1149
|
-
const
|
|
1149
|
+
const b = as(Object.keys(w.files), t.locale, d.defaultLocale), $ = l(g.url), E = d !== g || $ ? w.integrity[b] : void 0;
|
|
1150
1150
|
try {
|
|
1151
1151
|
let k;
|
|
1152
1152
|
if (t.source) {
|
|
1153
|
-
const x = await t.source(e,
|
|
1153
|
+
const x = await t.source(e, b, { buildId: g.buildId, manifestUrl: g.url });
|
|
1154
1154
|
if (typeof x == "string" || x instanceof Response) {
|
|
1155
|
-
const
|
|
1156
|
-
if (new TextEncoder().encode(
|
|
1157
|
-
const
|
|
1158
|
-
if (!
|
|
1159
|
-
k =
|
|
1155
|
+
const B = typeof x == "string" ? x : await ht(x, we);
|
|
1156
|
+
if (new TextEncoder().encode(B).byteLength > we) throw new R("invalid-data", "the tour file is too large");
|
|
1157
|
+
const oe = ve(B);
|
|
1158
|
+
if (!oe.ok) throw new R(oe.reason, oe.issues[0]?.message ?? "");
|
|
1159
|
+
k = oe.value;
|
|
1160
1160
|
} else k = x;
|
|
1161
1161
|
} else {
|
|
1162
|
-
const x =
|
|
1163
|
-
if (!x.ok) throw new
|
|
1162
|
+
const x = ve(await f(new URL(w.files[b], g.url).href, "tour", E));
|
|
1163
|
+
if (!x.ok) throw new R(x.reason, x.issues[0]?.message ?? "");
|
|
1164
1164
|
k = x.value;
|
|
1165
1165
|
}
|
|
1166
|
-
const S =
|
|
1166
|
+
const S = os(k, { manifest: d, entry: w, locale: b, guideOrigin: v });
|
|
1167
1167
|
if (S.ok)
|
|
1168
1168
|
return {
|
|
1169
1169
|
ok: !0,
|
|
1170
1170
|
manifest: d,
|
|
1171
1171
|
manifestUrl: g.url,
|
|
1172
1172
|
tour: S.value,
|
|
1173
|
-
locale:
|
|
1173
|
+
locale: b,
|
|
1174
1174
|
source: t.source ? "custom" : g === u && $ ? "remote" : "bundled",
|
|
1175
1175
|
testIdAttribute: _?.testIdAttribute ?? g.testIdAttribute,
|
|
1176
1176
|
guideOrigin: v
|
|
1177
1177
|
};
|
|
1178
|
-
|
|
1178
|
+
y(S, `tour ${e} (${b})`);
|
|
1179
1179
|
} catch (k) {
|
|
1180
|
-
const S = k instanceof
|
|
1180
|
+
const S = k instanceof R ? k : new R("load-failed", String(k));
|
|
1181
1181
|
c.push({ ok: !1, reason: S.reason, message: S.message });
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
g === u && _ && console.warn(`[steppy-tour] remote tour rejected, trying the bundled copy: ${c.at(-1)?.message}`);
|
|
1185
1185
|
}
|
|
1186
|
-
return c.reduce((g, d) =>
|
|
1186
|
+
return c.reduce((g, d) => dt[d.reason] > dt[g.reason] ? d : g, c[0] ?? {
|
|
1187
1187
|
ok: !1,
|
|
1188
1188
|
reason: "load-failed",
|
|
1189
1189
|
message: `tour "${e}" could not be loaded`
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
|
-
const
|
|
1193
|
-
function
|
|
1192
|
+
const ls = 250, cs = 500;
|
|
1193
|
+
function us(t) {
|
|
1194
1194
|
const { attr: e, host: n, dom: s } = t, i = s.scheduler;
|
|
1195
1195
|
function r(l) {
|
|
1196
1196
|
const a = `[${e}="${CSS.escape(l)}"]`, f = document.querySelectorAll(a);
|
|
1197
|
-
for (let h = 0; h < f.length && h <
|
|
1197
|
+
for (let h = 0; h < f.length && h < cs; h++) {
|
|
1198
1198
|
const c = f[h];
|
|
1199
1199
|
if (!(c === n || n.contains(c)) && s.isVisible(c))
|
|
1200
1200
|
return c;
|
|
@@ -1203,27 +1203,27 @@ function ss(t) {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
function o(l) {
|
|
1205
1205
|
let a = !1, f = 0, h = document.hidden ? i.now() : null, c = 0;
|
|
1206
|
-
const
|
|
1206
|
+
const y = i.now(), _ = [e, "class", "style", "hidden", "open", "aria-hidden", "aria-expanded"], m = () => {
|
|
1207
1207
|
if (f = 0, a) return !0;
|
|
1208
1208
|
const w = /* @__PURE__ */ new Map();
|
|
1209
|
-
let
|
|
1209
|
+
let b = null;
|
|
1210
1210
|
for (const $ of l.ids) {
|
|
1211
1211
|
const E = r($);
|
|
1212
|
-
E ? w.set($, E) :
|
|
1212
|
+
E ? w.set($, E) : b === null && (b = $);
|
|
1213
1213
|
}
|
|
1214
|
-
if (
|
|
1214
|
+
if (b === null)
|
|
1215
1215
|
return d(), l.onFound(w), !0;
|
|
1216
1216
|
if (l.timeoutMs !== null) {
|
|
1217
1217
|
const $ = h !== null ? i.now() - h : 0;
|
|
1218
|
-
if (h === null && i.now() -
|
|
1219
|
-
return d(), l.onTimeout(
|
|
1218
|
+
if (h === null && i.now() - y - c - $ >= l.timeoutMs)
|
|
1219
|
+
return d(), l.onTimeout(b), !0;
|
|
1220
1220
|
}
|
|
1221
1221
|
return !1;
|
|
1222
1222
|
}, u = () => {
|
|
1223
1223
|
!f && !a && (f = i.raf(m));
|
|
1224
1224
|
}, p = () => {
|
|
1225
1225
|
document.hidden ? h ??= i.now() : h !== null && (c += i.now() - h, h = null);
|
|
1226
|
-
}, v = new MutationObserver(u), g = i.setInterval(() => m(),
|
|
1226
|
+
}, v = new MutationObserver(u), g = i.setInterval(() => m(), ls);
|
|
1227
1227
|
function d() {
|
|
1228
1228
|
a = !0, v.disconnect(), i.clearInterval(g), f && i.cancelRaf(f), document.removeEventListener("visibilitychange", p);
|
|
1229
1229
|
}
|
|
@@ -1231,17 +1231,17 @@ function ss(t) {
|
|
|
1231
1231
|
}
|
|
1232
1232
|
return { find: r, wait: o };
|
|
1233
1233
|
}
|
|
1234
|
-
const
|
|
1235
|
-
function
|
|
1234
|
+
const je = /^:([A-Za-z_][A-Za-z0-9_]{0,63})$/;
|
|
1235
|
+
function fe(t) {
|
|
1236
1236
|
const e = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
1237
1237
|
return e === "/" ? [] : e.split("/").slice(1);
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1240
|
-
const n =
|
|
1239
|
+
function ft(t, e) {
|
|
1240
|
+
const n = fe(t), s = fe(e);
|
|
1241
1241
|
if (n.length !== s.length) return null;
|
|
1242
1242
|
const i = {};
|
|
1243
1243
|
for (let r = 0; r < n.length; r++) {
|
|
1244
|
-
const o =
|
|
1244
|
+
const o = je.exec(n[r]);
|
|
1245
1245
|
if (!o) {
|
|
1246
1246
|
if (n[r] !== s[r]) return null;
|
|
1247
1247
|
continue;
|
|
@@ -1255,20 +1255,20 @@ function ht(t, e) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
return i;
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return
|
|
1260
|
-
const n =
|
|
1258
|
+
function ds(t) {
|
|
1259
|
+
return fe(t).flatMap((e) => {
|
|
1260
|
+
const n = je.exec(e);
|
|
1261
1261
|
return n ? [n[1]] : [];
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const n =
|
|
1266
|
-
return n.length ? { missing: n } : { path: `/${
|
|
1267
|
-
const r =
|
|
1264
|
+
function hs(t, e) {
|
|
1265
|
+
const n = ds(t).filter((i) => e[i] === void 0 || e[i] === null || String(e[i]) === "");
|
|
1266
|
+
return n.length ? { missing: n } : { path: `/${fe(t).map((i) => {
|
|
1267
|
+
const r = je.exec(i);
|
|
1268
1268
|
return r ? encodeURIComponent(String(e[r[1]])) : i;
|
|
1269
1269
|
}).join("/")}` };
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1271
|
+
function gt(t, e) {
|
|
1272
1272
|
try {
|
|
1273
1273
|
const n = new URL(t);
|
|
1274
1274
|
return n.origin !== e ? "/" : (n.pathname.endsWith("/") ? n.pathname : n.pathname.replace(/[^/]*$/, "")) || "/";
|
|
@@ -1276,78 +1276,78 @@ function pt(t, e) {
|
|
|
1276
1276
|
return "/";
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function $e(t, e) {
|
|
1280
1280
|
if (e === "/" || !t.startsWith(e.slice(0, -1))) return t;
|
|
1281
1281
|
const n = t.slice(e.length - 1);
|
|
1282
1282
|
return n !== "" && !n.startsWith("/") ? t : n || "/";
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function Ht(t, e) {
|
|
1285
1285
|
return e === "/" ? t : e.slice(0, -1) + t;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function mt(t) {
|
|
1288
1288
|
return /^\/(?![/\\])/.test(t) && !/[\\\s\u0000-\u001f\u007f]/.test(t);
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1291
|
-
if (!
|
|
1290
|
+
function ps(t, e, n) {
|
|
1291
|
+
if (!mt(t)) return null;
|
|
1292
1292
|
try {
|
|
1293
|
-
const s = new URL(t, n), i =
|
|
1294
|
-
return
|
|
1293
|
+
const s = new URL(t, n), i = Ht(s.pathname, e) + s.search + s.hash;
|
|
1294
|
+
return mt(i) && new URL(i, n).origin === n ? i : null;
|
|
1295
1295
|
} catch {
|
|
1296
1296
|
return null;
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
|
-
const Re = "input,select,textarea",
|
|
1300
|
-
function
|
|
1299
|
+
const Re = "input,select,textarea", _t = "[aria-checked],[aria-pressed],[aria-selected]", bt = 50;
|
|
1300
|
+
function fs(t) {
|
|
1301
1301
|
return t instanceof HTMLInputElement ? t.type === "checkbox" || t.type === "radio" ? `c:${t.checked}` : t.type === "file" ? `f:${t.files?.length ?? 0}` : `v:${t.value}` : t instanceof HTMLSelectElement ? `s:${t.multiple ? [...t.options].filter((e) => e.selected).map((e) => e.value).join("|") : t.value}` : t instanceof HTMLTextAreaElement ? `v:${t.value}` : "";
|
|
1302
1302
|
}
|
|
1303
|
-
function
|
|
1304
|
-
const e = [...t.matches(Re) ? [t] : [], ...[...t.querySelectorAll(Re)].slice(0,
|
|
1303
|
+
function gs(t) {
|
|
1304
|
+
const e = [...t.matches(Re) ? [t] : [], ...[...t.querySelectorAll(Re)].slice(0, bt)], n = [...t.matches(_t) ? [t] : [], ...[...t.querySelectorAll(_t)].slice(0, bt)].map(
|
|
1305
1305
|
(i) => `a:${i.getAttribute("aria-checked") ?? ""}${i.getAttribute("aria-pressed") ?? ""}${i.getAttribute("aria-selected") ?? ""}`
|
|
1306
1306
|
), s = `t:${(t.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 500)}`;
|
|
1307
|
-
return [...e.map(
|
|
1307
|
+
return [...e.map(fs), ...n, s].join("");
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function Be(t) {
|
|
1310
1310
|
return t.matches('[aria-expanded="true"]') || t.querySelector('[aria-expanded="true"]') !== null;
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function yt(t) {
|
|
1313
1313
|
if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) return t.value;
|
|
1314
1314
|
const e = t.getAttribute("contenteditable");
|
|
1315
1315
|
return t instanceof HTMLElement && (t.isContentEditable || e !== null && e !== "false") ? t.textContent ?? "" : null;
|
|
1316
1316
|
}
|
|
1317
1317
|
function Oe(t) {
|
|
1318
|
-
const e =
|
|
1318
|
+
const e = yt(t);
|
|
1319
1319
|
if (e !== null) return e;
|
|
1320
1320
|
const n = t.querySelector(`${Re},[contenteditable]:not([contenteditable="false"])`);
|
|
1321
|
-
return (n &&
|
|
1321
|
+
return (n && yt(n)) ?? "";
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function ms(t) {
|
|
1324
1324
|
const e = 'select,[role=combobox],[aria-haspopup]:not([aria-haspopup="false"])';
|
|
1325
1325
|
return t.matches(e) || t.querySelector(e) !== null;
|
|
1326
1326
|
}
|
|
1327
|
-
const
|
|
1328
|
-
function
|
|
1327
|
+
const _s = 30 * 60 * 1e3;
|
|
1328
|
+
function Ve() {
|
|
1329
1329
|
try {
|
|
1330
1330
|
return globalThis.sessionStorage ?? null;
|
|
1331
1331
|
} catch {
|
|
1332
1332
|
return null;
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function bs(t) {
|
|
1336
1336
|
try {
|
|
1337
|
-
|
|
1337
|
+
Ve()?.setItem(Fe, JSON.stringify(t));
|
|
1338
1338
|
} catch {
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function ue() {
|
|
1342
1342
|
try {
|
|
1343
|
-
|
|
1343
|
+
Ve()?.removeItem(Fe);
|
|
1344
1344
|
} catch {
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function ys(t, e) {
|
|
1348
1348
|
let n = null;
|
|
1349
1349
|
try {
|
|
1350
|
-
n =
|
|
1350
|
+
n = Ve()?.getItem(Fe) ?? null;
|
|
1351
1351
|
} catch {
|
|
1352
1352
|
return null;
|
|
1353
1353
|
}
|
|
@@ -1357,12 +1357,12 @@ function hs(t, e) {
|
|
|
1357
1357
|
s = JSON.parse(n);
|
|
1358
1358
|
} catch {
|
|
1359
1359
|
}
|
|
1360
|
-
const i = typeof s?.savedAt == "number" && e - s.savedAt >= 0 && e - s.savedAt <
|
|
1361
|
-
return !(s !== null && typeof s == "object" && s.v === 1 && typeof s.tourId == "string" && typeof s.stepId == "string" && typeof s.locale == "string" && typeof s.buildId == "string" && s.params !== null && typeof s.params == "object" && Object.values(s.params).every((o) => typeof o == "string")) || !i ? (
|
|
1360
|
+
const i = typeof s?.savedAt == "number" && e - s.savedAt >= 0 && e - s.savedAt < _s;
|
|
1361
|
+
return !(s !== null && typeof s == "object" && s.v === 1 && typeof s.tourId == "string" && typeof s.stepId == "string" && typeof s.locale == "string" && typeof s.buildId == "string" && s.params !== null && typeof s.params == "object" && Object.values(s.params).every((o) => typeof o == "string")) || !i ? (ue(), null) : s.manifestKey === t ? s : null;
|
|
1362
1362
|
}
|
|
1363
|
-
const
|
|
1363
|
+
const ws = {
|
|
1364
1364
|
en: {
|
|
1365
|
-
...
|
|
1365
|
+
...ae.en,
|
|
1366
1366
|
done: "Done",
|
|
1367
1367
|
close: "Close the tour",
|
|
1368
1368
|
skipStep: "Skip this step",
|
|
@@ -1380,7 +1380,7 @@ const ps = {
|
|
|
1380
1380
|
instructionManual: "Select Next to continue."
|
|
1381
1381
|
},
|
|
1382
1382
|
fr: {
|
|
1383
|
-
...
|
|
1383
|
+
...ae.fr,
|
|
1384
1384
|
done: "Terminer",
|
|
1385
1385
|
close: "Fermer la visite",
|
|
1386
1386
|
skipStep: "Passer cette étape",
|
|
@@ -1398,7 +1398,7 @@ const ps = {
|
|
|
1398
1398
|
instructionManual: "Sélectionnez Suivant pour continuer."
|
|
1399
1399
|
},
|
|
1400
1400
|
nl: {
|
|
1401
|
-
...
|
|
1401
|
+
...ae.nl,
|
|
1402
1402
|
done: "Klaar",
|
|
1403
1403
|
close: "Rondleiding sluiten",
|
|
1404
1404
|
skipStep: "Deze stap overslaan",
|
|
@@ -1416,7 +1416,7 @@ const ps = {
|
|
|
1416
1416
|
instructionManual: "Kies Volgende om verder te gaan."
|
|
1417
1417
|
},
|
|
1418
1418
|
de: {
|
|
1419
|
-
...
|
|
1419
|
+
...ae.de,
|
|
1420
1420
|
done: "Fertig",
|
|
1421
1421
|
close: "Tour schließen",
|
|
1422
1422
|
skipStep: "Diesen Schritt überspringen",
|
|
@@ -1434,53 +1434,127 @@ const ps = {
|
|
|
1434
1434
|
instructionManual: "Wählen Sie Weiter, um fortzufahren."
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
|
-
function
|
|
1438
|
-
return
|
|
1437
|
+
function wt(t, e) {
|
|
1438
|
+
return es(ws, t, e, "en");
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function vs(t) {
|
|
1441
1441
|
const [e, n = ""] = t.toLowerCase().split(/[-_]/);
|
|
1442
1442
|
return (/^[a-z]{4}$/.test(n) ? /^(arab|hebr|thaa|syrc|nkoo|adlm|rohg)$/.test(n) : /^(ar|he|iw|fa|ur|ps|sd|ug|yi|ckb|dv)$/.test(e)) ? "rtl" : "ltr";
|
|
1443
1443
|
}
|
|
1444
|
-
const
|
|
1444
|
+
const $s = {
|
|
1445
1445
|
click: "instructionClick",
|
|
1446
1446
|
input: "instructionInput",
|
|
1447
1447
|
change: "instructionChange",
|
|
1448
1448
|
visible: "instructionVisible",
|
|
1449
1449
|
manual: "instructionManual"
|
|
1450
1450
|
};
|
|
1451
|
-
function
|
|
1452
|
-
return e[
|
|
1451
|
+
function Es(t, e) {
|
|
1452
|
+
return e[$s[t]];
|
|
1453
1453
|
}
|
|
1454
|
-
const
|
|
1454
|
+
const Le = {
|
|
1455
1455
|
surface: "#fbf9f4",
|
|
1456
1456
|
fg: "#1f1d1a"
|
|
1457
|
-
},
|
|
1457
|
+
}, q = {
|
|
1458
1458
|
padding: "8px 12px",
|
|
1459
1459
|
radius: "6px",
|
|
1460
1460
|
fontSize: "14px",
|
|
1461
1461
|
lineHeight: "1.4",
|
|
1462
1462
|
shadow: "0 4px 12px rgba(0, 0, 0, 0.2)"
|
|
1463
|
-
},
|
|
1463
|
+
}, vt = {
|
|
1464
1464
|
radius: "4px",
|
|
1465
1465
|
padding: "4px 10px"
|
|
1466
|
-
},
|
|
1467
|
-
bubbleBg:
|
|
1468
|
-
bubbleFg:
|
|
1466
|
+
}, jt = {
|
|
1467
|
+
bubbleBg: Le.fg,
|
|
1468
|
+
bubbleFg: Le.surface,
|
|
1469
1469
|
muted: "#c9c5bd",
|
|
1470
1470
|
accent: "#a8410e",
|
|
1471
1471
|
accentFg: "#ffffff",
|
|
1472
1472
|
focus: "#f09a6a",
|
|
1473
1473
|
scrim: "rgba(31, 29, 26, 0.45)",
|
|
1474
|
-
|
|
1475
|
-
|
|
1474
|
+
border: "none",
|
|
1475
|
+
radius: q.radius,
|
|
1476
|
+
width: "320px",
|
|
1477
|
+
padding: q.padding,
|
|
1478
|
+
shadow: q.shadow,
|
|
1479
|
+
fontFamily: "inherit",
|
|
1480
|
+
fontSize: q.fontSize,
|
|
1481
|
+
lineHeight: q.lineHeight,
|
|
1482
|
+
titleSize: "1em",
|
|
1483
|
+
titleWeight: "600",
|
|
1484
|
+
buttonRadius: vt.radius,
|
|
1485
|
+
buttonPadding: vt.padding,
|
|
1486
|
+
buttonWeight: "inherit",
|
|
1487
|
+
ringWidth: "2px"
|
|
1488
|
+
}, As = {
|
|
1489
|
+
...jt,
|
|
1490
|
+
bubbleBg: "#ffffff",
|
|
1491
|
+
bubbleFg: Le.fg,
|
|
1492
|
+
muted: "#5b6b64",
|
|
1493
|
+
focus: "#a8410e",
|
|
1494
|
+
border: "1px solid #e1ddd1"
|
|
1495
|
+
}, ks = (t) => It(t), Bt = [
|
|
1496
|
+
// Colour
|
|
1497
|
+
"bubbleBg",
|
|
1498
|
+
"bubbleFg",
|
|
1499
|
+
"muted",
|
|
1500
|
+
"accent",
|
|
1501
|
+
"accentFg",
|
|
1502
|
+
"focus",
|
|
1503
|
+
"scrim",
|
|
1504
|
+
"link",
|
|
1505
|
+
"border",
|
|
1506
|
+
// Shape and type
|
|
1507
|
+
"radius",
|
|
1508
|
+
"width",
|
|
1509
|
+
"padding",
|
|
1510
|
+
"shadow",
|
|
1511
|
+
"fontFamily",
|
|
1512
|
+
"fontSize",
|
|
1513
|
+
"lineHeight",
|
|
1514
|
+
"titleSize",
|
|
1515
|
+
"titleWeight",
|
|
1516
|
+
"buttonRadius",
|
|
1517
|
+
"buttonPadding",
|
|
1518
|
+
"buttonWeight",
|
|
1519
|
+
// Spotlight
|
|
1520
|
+
"ringWidth",
|
|
1521
|
+
"spotlightRadius"
|
|
1522
|
+
], ei = ["dark", "light", "auto"], Ss = new Set(Bt), Vt = (t) => t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Kt = (t) => `--steppy-tour-${Vt(t)}`, Me = (t) => `--_pw-${Vt(t)}`;
|
|
1523
|
+
function xs(t) {
|
|
1524
|
+
const e = /* @__PURE__ */ new Map();
|
|
1525
|
+
if (!t || typeof t != "object") return e;
|
|
1526
|
+
for (const [n, s] of Object.entries(t))
|
|
1527
|
+
!Ss.has(n) || typeof s != "string" || s.trim() === "" || e.set(Kt(n), s.trim());
|
|
1528
|
+
return e;
|
|
1529
|
+
}
|
|
1530
|
+
const $t = {
|
|
1531
|
+
link: `var(${Me("bubbleFg")})`,
|
|
1532
|
+
spotlightRadius: `var(${Me("radius")})`
|
|
1533
|
+
}, Ts = {
|
|
1534
|
+
bubbleBg: "--steppy-tooltip-bg",
|
|
1535
|
+
bubbleFg: "--steppy-tooltip-fg",
|
|
1536
|
+
fontFamily: "--steppy-font-family"
|
|
1537
|
+
}, Ee = jt, Et = As;
|
|
1538
|
+
function Ae(t, e) {
|
|
1539
|
+
const n = [];
|
|
1540
|
+
for (const s of Bt) {
|
|
1541
|
+
const i = s in $t;
|
|
1542
|
+
if (e && (i || e[s] === t[s])) continue;
|
|
1543
|
+
const r = i ? $t[s] : t[s], o = Ts[s], l = o ? `var(${o}, ${r})` : r;
|
|
1544
|
+
n.push(`${Me(s)}: var(${Kt(s)}, ${l});`);
|
|
1545
|
+
}
|
|
1546
|
+
return ks(n.join(`
|
|
1547
|
+
`));
|
|
1548
|
+
}
|
|
1549
|
+
const Is = Wt` :host{display:contents;${Ae(Ee)}}:host([appearance='light']){${Ae(Et, Ee)}}@media (prefers-color-scheme:light){:host([appearance='auto']){${Ae(Et, Ee)}}}.layer{position:fixed;inset:0;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;overflow:visible;pointer-events:none;z-index:var(--_pw-z,2147483000)}.layer::backdrop{pointer-events:none;background:transparent}.spotlight{position:absolute;left:var(--_pw-sx,0);top:var(--_pw-sy,0);width:var(--_pw-sw,0);height:var(--_pw-sh,0);border-radius:var(--_pw-spotlight-radius);box-shadow:0 0 0 var(--_pw-ring-width) var(--_pw-accent),0 0 0 max(100vw,100vh) var(--_pw-scrim);pointer-events:none;transition:left 0.15s ease,top 0.15s ease,width 0.15s ease,height 0.15s ease}.bubble{position:absolute;box-sizing:border-box;width:min(var(--_pw-width),calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;padding:var(--_pw-padding);border:var(--_pw-border);border-radius:var(--_pw-radius);background:var(--_pw-bubble-bg);color:var(--_pw-bubble-fg);box-shadow:var(--_pw-shadow);font-family:var(--_pw-font-family);font-size:var(--_pw-font-size);line-height:var(--_pw-line-height);pointer-events:auto;visibility:hidden;outline:none}.bubble[data-placed]{visibility:visible}.bubble[data-mode='anchored']{left:var(--_pw-x,0);top:var(--_pw-y,0)}.bubble[data-mode='centered']{left:50%;top:50%;transform:translate(-50%,-50%)}.bubble[data-mode='sheet-bottom'],.bubble[data-mode='sheet-top']{left:50%;transform:translateX(-50%)}.bubble[data-mode='sheet-bottom']{bottom:calc(8px + var(--_pw-kb,0px))}.bubble[data-mode='sheet-top']{top:8px}.bubble[data-yield]{pointer-events:none;opacity:0.15}.layer[data-offscreen] .spotlight{display:none}header{display:flex;align-items:flex-start;gap:8px}h2{flex:1;margin:0 0 4px;font-size:var(--_pw-title-size);font-weight:var(--_pw-title-weight)}.body{margin:0;overflow-wrap:anywhere}.body a,.guide{color:var(--_pw-link);text-decoration:underline}.guide{display:inline-block;margin-top:6px}code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.92em}footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.progress{margin-inline-end:auto;color:var(--_pw-muted);font-variant-numeric:tabular-nums}button{font:inherit;font-weight:var(--_pw-button-weight);cursor:pointer;border-radius:var(--_pw-button-radius);padding:var(--_pw-button-padding);border:1px solid transparent}button:focus-visible,a:focus-visible{outline:2px solid var(--_pw-focus);outline-offset:2px}button:disabled{opacity:0.5;cursor:not-allowed}.primary{background:var(--_pw-accent);color:var(--_pw-accent-fg)}.secondary{background:transparent;color:var(--_pw-bubble-fg);border-color:var(--_pw-muted)}.close{margin-inline-start:auto;padding:0 6px;background:transparent;color:var(--_pw-bubble-fg);font-size:1.25em;line-height:1}.pill{position:absolute;inset-inline-end:16px;bottom:16px;display:flex;gap:4px;padding:4px;border-radius:999px;border:var(--_pw-border);background:var(--_pw-bubble-bg);color:var(--_pw-bubble-fg);box-shadow:var(--_pw-shadow);font-family:var(--_pw-font-family);font-size:var(--_pw-font-size);pointer-events:auto}.pill .primary{border-radius:999px}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@media (prefers-reduced-motion:reduce){.spotlight{transition:none}}@media (forced-colors:active){.spotlight{outline:3px solid Highlight;box-shadow:none}.bubble,.pill{border:1px solid CanvasText}}@media print{.layer{display:none}}`, Rs = /^(?:https?:\/\/[^\s)]+|mailto:[^\s)]+|\/(?![/\\])[^\s)]*|#[^\s)]*)$/, Os = {
|
|
1476
1550
|
autolink: !0,
|
|
1477
|
-
link: (t) =>
|
|
1478
|
-
},
|
|
1479
|
-
function
|
|
1551
|
+
link: (t) => Rs.test(t) ? { kind: "external", href: t } : null
|
|
1552
|
+
}, Ls = "`([^`]+)`|\\[([^\\]]+)\\]\\(([^\\s)]+)\\)|(\\*\\*|__)(\\S(?:.*?\\S)?)\\4|(\\*|_)([^*_\\s](?:[^*_]*?[^*_\\s])?)\\6|(https?:\\/\\/[^\\s<>()]+|www\\.[^\\s<>()]+)|([\\w.+-]+@[\\w-]+\\.[\\w.-]+\\w)";
|
|
1553
|
+
function J(t, e = Os) {
|
|
1480
1554
|
const n = [], s = (l) => l.split(`
|
|
1481
1555
|
`).forEach((a, f) => {
|
|
1482
|
-
f > 0 && n.push(
|
|
1483
|
-
}), i = new RegExp(
|
|
1556
|
+
f > 0 && n.push(T`<br />`), a && n.push(a);
|
|
1557
|
+
}), i = new RegExp(Ls, "g");
|
|
1484
1558
|
let r = 0, o;
|
|
1485
1559
|
for (; o = i.exec(t); ) {
|
|
1486
1560
|
if (o[2] != null) {
|
|
@@ -1490,34 +1564,34 @@ function ee(t, e = bs) {
|
|
|
1490
1564
|
continue;
|
|
1491
1565
|
}
|
|
1492
1566
|
o.index > r && s(t.slice(r, o.index)), n.push(
|
|
1493
|
-
l.kind === "external" ?
|
|
1494
|
-
>${
|
|
1495
|
-
>` :
|
|
1567
|
+
l.kind === "external" ? T`<a href=${l.href} target="_blank" rel="noopener noreferrer"
|
|
1568
|
+
>${J(o[2], e)}</a
|
|
1569
|
+
>` : T`<a href=${l.href} @click=${l.onActivate}>${J(o[2], e)}</a>`
|
|
1496
1570
|
), r = o.index + o[0].length;
|
|
1497
1571
|
continue;
|
|
1498
1572
|
}
|
|
1499
1573
|
if (!((o[8] != null || o[9] != null) && !e.autolink)) {
|
|
1500
1574
|
if (o.index > r && s(t.slice(r, o.index)), o[1] != null)
|
|
1501
|
-
n.push(
|
|
1575
|
+
n.push(T`<code>${o[1]}</code>`);
|
|
1502
1576
|
else if (o[4] != null)
|
|
1503
|
-
n.push(
|
|
1577
|
+
n.push(T`<strong>${J(o[5], e)}</strong>`);
|
|
1504
1578
|
else if (o[6] != null)
|
|
1505
|
-
n.push(
|
|
1579
|
+
n.push(T`<em>${J(o[7], e)}</em>`);
|
|
1506
1580
|
else if (o[8] != null) {
|
|
1507
1581
|
const l = o[8], a = (l.match(/[.,;:!?]+$/) ?? [""])[0], f = a ? l.slice(0, -a.length) : l, h = f.startsWith("www.") ? `https://${f}` : f;
|
|
1508
|
-
n.push(
|
|
1509
|
-
} else o[9] != null && n.push(
|
|
1582
|
+
n.push(T`<a href=${h} target="_blank" rel="noopener noreferrer">${f}</a>`), a && s(a);
|
|
1583
|
+
} else o[9] != null && n.push(T`<a href=${`mailto:${o[9]}`}>${o[9]}</a>`);
|
|
1510
1584
|
r = o.index + o[0].length;
|
|
1511
1585
|
}
|
|
1512
1586
|
}
|
|
1513
1587
|
return r < t.length && s(t.slice(r)), n;
|
|
1514
1588
|
}
|
|
1515
|
-
const
|
|
1516
|
-
function
|
|
1589
|
+
const F = (t) => t.stopPropagation();
|
|
1590
|
+
function Ms(t, e) {
|
|
1517
1591
|
const n = t.step.advance;
|
|
1518
1592
|
if (n === "click" || n === "visible") return A;
|
|
1519
1593
|
const s = t.last && n === "manual" ? t.strings.done : t.strings.next, i = n === "change" ? "secondary" : "primary";
|
|
1520
|
-
return
|
|
1594
|
+
return T`<button
|
|
1521
1595
|
part="button next ${i}"
|
|
1522
1596
|
class=${i}
|
|
1523
1597
|
?disabled=${!t.nextEnabled}
|
|
@@ -1528,9 +1602,9 @@ function vs(t, e) {
|
|
|
1528
1602
|
${s}
|
|
1529
1603
|
</button>`;
|
|
1530
1604
|
}
|
|
1531
|
-
function
|
|
1532
|
-
const n = t.strings, s = t.state === "fallback", i = s ? n.notFoundTitle : t.step.title, r = s ? n.notFoundBody : t.step.text ??
|
|
1533
|
-
return
|
|
1605
|
+
function Ps(t, e) {
|
|
1606
|
+
const n = t.strings, s = t.state === "fallback", i = s ? n.notFoundTitle : t.step.title, r = s ? n.notFoundBody : t.step.text ?? Es(t.step.advance, n), o = t.guideUrl !== null && (s || t.last);
|
|
1607
|
+
return T`<section
|
|
1534
1608
|
part="bubble"
|
|
1535
1609
|
class="bubble"
|
|
1536
1610
|
role="dialog"
|
|
@@ -1543,32 +1617,32 @@ function $s(t, e) {
|
|
|
1543
1617
|
data-step-id=${t.step.id}
|
|
1544
1618
|
data-state=${t.state}
|
|
1545
1619
|
data-advance=${t.step.advance}
|
|
1546
|
-
@pointerdown=${
|
|
1547
|
-
@mousedown=${
|
|
1548
|
-
@click=${
|
|
1620
|
+
@pointerdown=${F}
|
|
1621
|
+
@mousedown=${F}
|
|
1622
|
+
@click=${F}
|
|
1549
1623
|
>
|
|
1550
1624
|
<header>
|
|
1551
|
-
${i ?
|
|
1625
|
+
${i ? T`<h2 part="title" id="pw-title">${i}</h2>` : A}
|
|
1552
1626
|
<button part="button close" class="close" aria-label=${n.close} @pointerdown=${e.press} @mousedown=${e.press} @click=${e.close}>
|
|
1553
1627
|
×
|
|
1554
1628
|
</button>
|
|
1555
1629
|
</header>
|
|
1556
|
-
<p part="body" class="body" id="pw-body">${s ? r :
|
|
1557
|
-
${o ?
|
|
1630
|
+
<p part="body" class="body" id="pw-body">${s ? r : J(r, t.policy)}</p>
|
|
1631
|
+
${o ? T`<a part="guide-link" class="guide" href=${t.guideUrl} target="_blank" rel="noopener noreferrer">${n.openGuide}</a>` : A}
|
|
1558
1632
|
<footer>
|
|
1559
|
-
<span part="progress" class="progress">${
|
|
1560
|
-
${s ?
|
|
1633
|
+
<span part="progress" class="progress">${Jn(n.progress, { current: t.position.index + 1, total: t.position.total })}</span>
|
|
1634
|
+
${s ? T`<button part="button skip" class="secondary" @pointerdown=${e.press} @mousedown=${e.press} @click=${e.skip}>
|
|
1561
1635
|
${n.skipStep}
|
|
1562
1636
|
</button>
|
|
1563
1637
|
<button part="button end primary" class="primary" @pointerdown=${e.press} @mousedown=${e.press} @click=${e.end}>
|
|
1564
1638
|
${n.endTour}
|
|
1565
|
-
</button>` :
|
|
1639
|
+
</button>` : Ms(t, e)}
|
|
1566
1640
|
</footer>
|
|
1567
1641
|
</section>`;
|
|
1568
1642
|
}
|
|
1569
|
-
function
|
|
1643
|
+
function Cs(t, e) {
|
|
1570
1644
|
const n = t.strings;
|
|
1571
|
-
return
|
|
1645
|
+
return T`<div part="pill" class="pill" role="group" aria-label=${n.paused} @pointerdown=${F} @mousedown=${F} @click=${F}>
|
|
1572
1646
|
<button part="button resume primary" class="primary" @pointerdown=${e.press} @mousedown=${e.press} @click=${e.resume}>
|
|
1573
1647
|
${n.resume}
|
|
1574
1648
|
</button>
|
|
@@ -1577,23 +1651,23 @@ function Es(t, e) {
|
|
|
1577
1651
|
</button>
|
|
1578
1652
|
</div>`;
|
|
1579
1653
|
}
|
|
1580
|
-
function
|
|
1581
|
-
return
|
|
1582
|
-
${t.mode === "bubble" && t.anchored && t.state === "shown" ?
|
|
1583
|
-
${t.mode === "bubble" ?
|
|
1654
|
+
function Us(t, e) {
|
|
1655
|
+
return T`<div part="layer" class="layer" lang=${t.lang} dir=${t.dir} popover=${t.popover ? "manual" : A}>
|
|
1656
|
+
${t.mode === "bubble" && t.anchored && t.state === "shown" ? T`<div part="spotlight" class="spotlight"></div>` : A}
|
|
1657
|
+
${t.mode === "bubble" ? Ps(t, e) : t.mode === "pill" ? Cs(t, e) : A}
|
|
1584
1658
|
<div class="sr-only" role="status" aria-live="polite" aria-atomic="true"></div>
|
|
1585
1659
|
</div>`;
|
|
1586
1660
|
}
|
|
1587
|
-
const
|
|
1588
|
-
function
|
|
1661
|
+
const At = 6, Ns = 10, Ds = 8, zs = 640, Fs = 250, kt = /^(?:hidden|auto|scroll|clip)$/;
|
|
1662
|
+
function Hs(t) {
|
|
1589
1663
|
const e = [];
|
|
1590
1664
|
for (let n = t.parentElement; n && n !== document.body && n !== document.documentElement; n = n.parentElement) {
|
|
1591
1665
|
const s = getComputedStyle(n);
|
|
1592
|
-
(
|
|
1666
|
+
(kt.test(s.overflowX) || kt.test(s.overflowY)) && e.push(n);
|
|
1593
1667
|
}
|
|
1594
1668
|
return e;
|
|
1595
1669
|
}
|
|
1596
|
-
function
|
|
1670
|
+
function js(t) {
|
|
1597
1671
|
const e = t.dom.scheduler;
|
|
1598
1672
|
let n = !1, s = 0, i = 0, r = [], o = null, l = null;
|
|
1599
1673
|
const a = (m) => `${Math.round(m * 100) / 100}px`;
|
|
@@ -1609,23 +1683,23 @@ function Rs(t) {
|
|
|
1609
1683
|
return;
|
|
1610
1684
|
}
|
|
1611
1685
|
if (u.removeAttribute("data-offscreen"), m.removeAttribute("data-offscreen"), m.style.setProperty("--_pw-kb", a(Math.max(0, window.innerHeight - (p.y + p.height)))), !v) return h(u, p);
|
|
1612
|
-
o !== v && (r =
|
|
1613
|
-
let d =
|
|
1686
|
+
o !== v && (r = Hs(v), o = v, l?.disconnect(), l?.observe(v), l?.observe(u));
|
|
1687
|
+
let d = lt(t.dom.rect(v) ?? { x: 0, y: 0, width: 0, height: 0 }, At);
|
|
1614
1688
|
for (const x of r) {
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1689
|
+
const B = t.dom.rect(x);
|
|
1690
|
+
B && d && (d = at(d, lt(B, At)));
|
|
1617
1691
|
}
|
|
1618
|
-
if (d = d &&
|
|
1692
|
+
if (d = d && at(d, { x: p.x, y: p.y, width: p.width, height: p.height }), !d)
|
|
1619
1693
|
return u.setAttribute("data-offscreen", ""), m.setAttribute("data-offscreen", ""), h(u, p);
|
|
1620
|
-
m.style.setProperty("--_pw-sx", a(d.x)), m.style.setProperty("--_pw-sy", a(d.y)), m.style.setProperty("--_pw-sw", a(d.width)), m.style.setProperty("--_pw-sh", a(d.height)), u.toggleAttribute("data-yield",
|
|
1621
|
-
const w = d.y + d.height / 2,
|
|
1622
|
-
if (p.width <=
|
|
1623
|
-
const $ = t.dom.rect(u) ?? { width: 320, height: 120 }, E = t.avoid(), k = (x) => ({ x: x.x - p.x, y: x.y - p.y, width: x.width, height: x.height }), S =
|
|
1694
|
+
m.style.setProperty("--_pw-sx", a(d.x)), m.style.setProperty("--_pw-sy", a(d.y)), m.style.setProperty("--_pw-sw", a(d.width)), m.style.setProperty("--_pw-sh", a(d.height)), u.toggleAttribute("data-yield", Be(v));
|
|
1695
|
+
const w = d.y + d.height / 2, b = () => c(u, w > p.y + p.height / 2 ? "sheet-top" : "sheet-bottom", null);
|
|
1696
|
+
if (p.width <= zs) return b();
|
|
1697
|
+
const $ = t.dom.rect(u) ?? { width: 320, height: 120 }, E = t.avoid(), k = (x) => ({ x: x.x - p.x, y: x.y - p.y, width: x.width, height: x.height }), S = zn(k(d), $, p, Ns, {
|
|
1624
1698
|
preferred: t.preferred(),
|
|
1625
|
-
margin:
|
|
1699
|
+
margin: Ds,
|
|
1626
1700
|
avoid: E ? [k(E)] : []
|
|
1627
1701
|
});
|
|
1628
|
-
if (S.overlaps) return
|
|
1702
|
+
if (S.overlaps) return b();
|
|
1629
1703
|
m.style.setProperty("--_pw-x", a(S.x + p.x)), m.style.setProperty("--_pw-y", a(S.y + p.y)), c(u, "anchored", S.side);
|
|
1630
1704
|
}
|
|
1631
1705
|
function h(m, u) {
|
|
@@ -1634,98 +1708,98 @@ function Rs(t) {
|
|
|
1634
1708
|
y: u.y + (u.height - p.height) / 2,
|
|
1635
1709
|
width: p.width,
|
|
1636
1710
|
height: p.height
|
|
1637
|
-
}, g = (t.dialogs?.() ?? []).filter((
|
|
1711
|
+
}, g = (t.dialogs?.() ?? []).filter((b) => xe(b, v));
|
|
1638
1712
|
if (!g.length) return c(m, "centered", null);
|
|
1639
|
-
const d = Math.min(...g.map((
|
|
1713
|
+
const d = Math.min(...g.map((b) => b.y)) - u.y, w = u.y + u.height - Math.max(...g.map((b) => b.y + b.height));
|
|
1640
1714
|
c(m, d >= w ? "sheet-top" : "sheet-bottom", null);
|
|
1641
1715
|
}
|
|
1642
1716
|
function c(m, u, p) {
|
|
1643
1717
|
m.setAttribute("data-mode", u), p ? m.setAttribute("data-side", p) : m.removeAttribute("data-side"), m.setAttribute("data-placed", ""), t.onPlaced?.();
|
|
1644
1718
|
}
|
|
1645
|
-
function
|
|
1719
|
+
function y() {
|
|
1646
1720
|
n && !s && (s = e.raf(f));
|
|
1647
1721
|
}
|
|
1648
|
-
const _ = () =>
|
|
1722
|
+
const _ = () => y();
|
|
1649
1723
|
return {
|
|
1650
1724
|
start() {
|
|
1651
|
-
if (n) return
|
|
1652
|
-
n = !0, o = null, document.addEventListener("scroll", _, { capture: !0, passive: !0 }), window.addEventListener("resize", _, { passive: !0 }), window.visualViewport?.addEventListener("resize", _, { passive: !0 }), window.visualViewport?.addEventListener("scroll", _, { passive: !0 }), l = typeof ResizeObserver == "function" ? new ResizeObserver(_) : null, i = e.setInterval(
|
|
1725
|
+
if (n) return y();
|
|
1726
|
+
n = !0, o = null, document.addEventListener("scroll", _, { capture: !0, passive: !0 }), window.addEventListener("resize", _, { passive: !0 }), window.visualViewport?.addEventListener("resize", _, { passive: !0 }), window.visualViewport?.addEventListener("scroll", _, { passive: !0 }), l = typeof ResizeObserver == "function" ? new ResizeObserver(_) : null, i = e.setInterval(y, Fs), y();
|
|
1653
1727
|
},
|
|
1654
1728
|
stop() {
|
|
1655
1729
|
n = !1, s && e.cancelRaf(s), s = 0, e.clearInterval(i), l?.disconnect(), l = null, o = null, document.removeEventListener("scroll", _, { capture: !0 }), window.removeEventListener("resize", _), window.visualViewport?.removeEventListener("resize", _), window.visualViewport?.removeEventListener("scroll", _);
|
|
1656
1730
|
},
|
|
1657
|
-
notify:
|
|
1731
|
+
notify: y
|
|
1658
1732
|
};
|
|
1659
1733
|
}
|
|
1660
|
-
const
|
|
1661
|
-
function
|
|
1734
|
+
const Pe = 'dialog,[role=dialog],[role=alertdialog],[aria-modal="true"]';
|
|
1735
|
+
function le(t, e) {
|
|
1662
1736
|
const n = t.composedPath().slice(0, 64);
|
|
1663
1737
|
return n.includes(e) ? null : n.filter((s) => s instanceof Element);
|
|
1664
1738
|
}
|
|
1665
|
-
function
|
|
1739
|
+
function Bs(t) {
|
|
1666
1740
|
const { host: e, attr: n } = t, s = () => {
|
|
1667
1741
|
const c = t.state();
|
|
1668
1742
|
return !c.loaded || c.phase === "idle" || c.phase === "loading" || c.phase === "entering" ? null : { s: c, step: c.loaded.tour.steps[c.index] };
|
|
1669
1743
|
}, i = (c) => {
|
|
1670
|
-
const
|
|
1671
|
-
if (!
|
|
1744
|
+
const y = le(c, e);
|
|
1745
|
+
if (!y) return;
|
|
1672
1746
|
t.interacted(), t.tick();
|
|
1673
1747
|
const _ = s();
|
|
1674
1748
|
if (!_) return;
|
|
1675
|
-
const { s: m, step: u } = _, p = new Set(
|
|
1749
|
+
const { s: m, step: u } = _, p = new Set(y.map((b) => b.getAttribute(n)).filter((b) => b !== null)), v = m.token;
|
|
1676
1750
|
if (m.phase === "showing" && u.advance === "click" && u.target !== null && p.has(u.target)) {
|
|
1677
1751
|
t.persistAhead(m.index), t.defer(() => t.dispatch({ type: "TRIGGER", token: v, kind: "click" }));
|
|
1678
1752
|
return;
|
|
1679
1753
|
}
|
|
1680
|
-
const g = m.loaded.tour.steps, d = g.findIndex((
|
|
1754
|
+
const g = m.loaded.tour.steps, d = g.findIndex((b, $) => $ > m.index && m.loaded.applicable[$] && b.target !== null && p.has(b.target));
|
|
1681
1755
|
if (d === -1) return;
|
|
1682
1756
|
const w = g[d].advance === "click";
|
|
1683
1757
|
w && t.persistAhead(d), t.defer(() => t.dispatch({ type: "JUMP", token: v, to: d, performed: w }));
|
|
1684
1758
|
}, r = (c) => {
|
|
1685
|
-
const
|
|
1686
|
-
return
|
|
1759
|
+
const y = t.target();
|
|
1760
|
+
return y !== null && c.composedPath().includes(y);
|
|
1687
1761
|
}, o = (c) => {
|
|
1688
|
-
if (!
|
|
1762
|
+
if (!le(c, e)) return;
|
|
1689
1763
|
t.interacted();
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1764
|
+
const y = s();
|
|
1765
|
+
y?.s.phase === "showing" && y.step.advance === "input" && r(c) && t.dispatch({ type: "FIELD", token: y.s.token, nonEmpty: Oe(t.target()).trim() !== "" });
|
|
1692
1766
|
}, l = (c) => {
|
|
1693
|
-
if (!
|
|
1767
|
+
if (!le(c, e)) return;
|
|
1694
1768
|
t.interacted(), t.tick();
|
|
1695
|
-
const
|
|
1696
|
-
if (
|
|
1697
|
-
const _ =
|
|
1769
|
+
const y = s();
|
|
1770
|
+
if (y?.s.phase === "showing" && y.step.advance === "input" && r(c)) {
|
|
1771
|
+
const _ = y.s.token;
|
|
1698
1772
|
Oe(t.target()).trim() !== "" && t.defer(() => t.dispatch({ type: "TRIGGER", token: _, kind: "input-commit" }));
|
|
1699
1773
|
}
|
|
1700
1774
|
}, a = (c) => {
|
|
1701
|
-
|
|
1775
|
+
le(c, e) && t.interacted();
|
|
1702
1776
|
}, f = (c) => {
|
|
1703
|
-
const
|
|
1704
|
-
if (
|
|
1705
|
-
const m =
|
|
1706
|
-
if ((u === -1 ? m : m.slice(u + 1)).filter((g) => g instanceof Element).some((g) => g.matches(`${
|
|
1777
|
+
const y = c;
|
|
1778
|
+
if (y.key !== "Escape" || y.defaultPrevented || y.isComposing || !s()) return;
|
|
1779
|
+
const m = y.composedPath(), u = m.indexOf(e);
|
|
1780
|
+
if ((u === -1 ? m : m.slice(u + 1)).filter((g) => g instanceof Element).some((g) => g.matches(`${Pe},[aria-expanded="true"]`))) return;
|
|
1707
1781
|
const v = t.target();
|
|
1708
|
-
v?.isConnected && (v.closest(
|
|
1782
|
+
v?.isConnected && (v.closest(Pe) || Be(v)) || t.dispatch({ type: "DISMISS", via: "escape" });
|
|
1709
1783
|
}, h = { capture: !0 };
|
|
1710
1784
|
return document.addEventListener("click", i, h), document.addEventListener("input", o, h), document.addEventListener("change", l, h), document.addEventListener("pointerdown", a, h), document.addEventListener("mousedown", a, h), document.addEventListener("keydown", a, h), window.addEventListener("keydown", f), () => {
|
|
1711
1785
|
document.removeEventListener("click", i, h), document.removeEventListener("input", o, h), document.removeEventListener("change", l, h), document.removeEventListener("pointerdown", a, h), document.removeEventListener("mousedown", a, h), document.removeEventListener("keydown", a, h), window.removeEventListener("keydown", f);
|
|
1712
1786
|
};
|
|
1713
1787
|
}
|
|
1714
|
-
function
|
|
1788
|
+
function Vs(t, e, n, s) {
|
|
1715
1789
|
let i = e(t), r = !1, o = !1, l = !1;
|
|
1716
1790
|
const a = () => {
|
|
1717
|
-
if (l = !1, o ||
|
|
1791
|
+
if (l = !1, o || Be(t)) return;
|
|
1718
1792
|
const _ = e(t);
|
|
1719
1793
|
if (!r) {
|
|
1720
1794
|
i = _;
|
|
1721
1795
|
return;
|
|
1722
1796
|
}
|
|
1723
|
-
_ !== i && (o = !0,
|
|
1797
|
+
_ !== i && (o = !0, y(), n());
|
|
1724
1798
|
}, f = () => {
|
|
1725
1799
|
!l && !o && (l = !0, s.raf(a));
|
|
1726
1800
|
}, h = new MutationObserver(f);
|
|
1727
1801
|
h.observe(t, { attributes: !0, characterData: !0, childList: !0, subtree: !0 });
|
|
1728
|
-
const c = s.setInterval(a, 300),
|
|
1802
|
+
const c = s.setInterval(a, 300), y = () => {
|
|
1729
1803
|
h.disconnect(), s.clearInterval(c);
|
|
1730
1804
|
};
|
|
1731
1805
|
return {
|
|
@@ -1734,14 +1808,14 @@ function Ls(t, e, n, s) {
|
|
|
1734
1808
|
},
|
|
1735
1809
|
tick: f,
|
|
1736
1810
|
stop() {
|
|
1737
|
-
o = !0,
|
|
1811
|
+
o = !0, y();
|
|
1738
1812
|
}
|
|
1739
1813
|
};
|
|
1740
1814
|
}
|
|
1741
|
-
const
|
|
1742
|
-
class
|
|
1815
|
+
const Z = Symbol.for(bn), Ks = 300, Ws = 500, Gs = 12e4, z = globalThis, St = () => z[_n] === !0;
|
|
1816
|
+
class xt extends ee {
|
|
1743
1817
|
constructor() {
|
|
1744
|
-
super(...arguments), this.manifest = "", this.fallbackManifest = "", this.buildId = "", this.locale = "", this.guideOrigin = "", this.baseZIndex =
|
|
1818
|
+
super(...arguments), this.manifest = "", this.fallbackManifest = "", this.buildId = "", this.locale = "", this.guideOrigin = "", this.baseZIndex = Dn, this.targetTimeout = rt, this.disabled = !1, this.source = null, this.navigate = null, this.strings = void 0, this.theme = void 0, this.appearance = "dark", this._s = U(), this._queue = [], this._dispatching = !1, this._run = null, this._cache = /* @__PURE__ */ new Map(), this._resolver = null, this._cancelWait = null, this._target = null, this._tracker = null, this._detach = null, this._change = null, this._shownKey = "", this._shownAt = 0, this._pressToken = -1, this._focusPending = !1, this._appFocus = null, this._swapSeq = 0, this._themed = /* @__PURE__ */ new Set(), this._lang = new MutationObserver(() => {
|
|
1745
1819
|
this.locale || this._swapLocale();
|
|
1746
1820
|
}), this._policy = { autolink: !1, link: (e) => this._link(e) }, this._handlers = {
|
|
1747
1821
|
press: () => {
|
|
@@ -1757,7 +1831,7 @@ class At extends ne {
|
|
|
1757
1831
|
};
|
|
1758
1832
|
}
|
|
1759
1833
|
static {
|
|
1760
|
-
this.styles =
|
|
1834
|
+
this.styles = Is;
|
|
1761
1835
|
}
|
|
1762
1836
|
static {
|
|
1763
1837
|
this.properties = {
|
|
@@ -1771,23 +1845,25 @@ class At extends ne {
|
|
|
1771
1845
|
disabled: { type: Boolean, reflect: !0 },
|
|
1772
1846
|
source: { attribute: !1 },
|
|
1773
1847
|
navigate: { attribute: !1 },
|
|
1774
|
-
strings: { attribute: !1 }
|
|
1848
|
+
strings: { attribute: !1 },
|
|
1849
|
+
theme: { attribute: !1 },
|
|
1850
|
+
appearance: { type: String, reflect: !0 }
|
|
1775
1851
|
};
|
|
1776
1852
|
}
|
|
1777
1853
|
static {
|
|
1778
|
-
this.dom =
|
|
1854
|
+
this.dom = Ut;
|
|
1779
1855
|
}
|
|
1780
1856
|
get _dom() {
|
|
1781
1857
|
return this.constructor.dom;
|
|
1782
1858
|
}
|
|
1783
1859
|
// ── Public API ──────────────────────────────────────────────────────────
|
|
1784
1860
|
get isActive() {
|
|
1785
|
-
return
|
|
1861
|
+
return X(this._s);
|
|
1786
1862
|
}
|
|
1787
1863
|
get current() {
|
|
1788
|
-
if (!
|
|
1864
|
+
if (!X(this._s) || !this._s.loaded) return null;
|
|
1789
1865
|
const e = this._s.loaded.tour.steps[this._s.index];
|
|
1790
|
-
return { tourId: this._s.loaded.tour.id, stepId: e.id, ...
|
|
1866
|
+
return { tourId: this._s.loaded.tour.id, stepId: e.id, ...ie(this._s) };
|
|
1791
1867
|
}
|
|
1792
1868
|
async start(e, n = {}) {
|
|
1793
1869
|
return this._start(e, n, !1);
|
|
@@ -1808,7 +1884,7 @@ class At extends ne {
|
|
|
1808
1884
|
});
|
|
1809
1885
|
}
|
|
1810
1886
|
willUpdate(e) {
|
|
1811
|
-
(e.has("manifest") || e.has("fallbackManifest") || e.has("buildId")) && this._cache.clear(), e.has("baseZIndex") && this.style.setProperty("--_pw-z", String(this.baseZIndex)), e.has("disabled") && this.disabled && this._s.phase !== "idle" && this._dispatch({ type: "DISMISS", via: "disabled" });
|
|
1887
|
+
(e.has("manifest") || e.has("fallbackManifest") || e.has("buildId")) && this._cache.clear(), e.has("baseZIndex") && this.style.setProperty("--_pw-z", String(this.baseZIndex)), e.has("theme") && this._applyTheme(), e.has("disabled") && this.disabled && this._s.phase !== "idle" && this._dispatch({ type: "DISMISS", via: "disabled" });
|
|
1812
1888
|
}
|
|
1813
1889
|
updated(e) {
|
|
1814
1890
|
e.has("locale") && this.isActive && this._swapLocale(), (e.has("manifest") || e.has("fallbackManifest")) && this.hasUpdated && this._tryResume(), this._afterRender();
|
|
@@ -1818,13 +1894,13 @@ class At extends ne {
|
|
|
1818
1894
|
}
|
|
1819
1895
|
render() {
|
|
1820
1896
|
const e = this._s;
|
|
1821
|
-
if (!this._run || !e.loaded || !
|
|
1822
|
-
const n = e.loaded.tour.steps[e.index], s = e.phase === "showing" || e.phase === "fallback" ? "bubble" : e.phase === "paused" ? "pill" : "none", i =
|
|
1823
|
-
return
|
|
1897
|
+
if (!this._run || !e.loaded || !X(e)) return A;
|
|
1898
|
+
const n = e.loaded.tour.steps[e.index], s = e.phase === "showing" || e.phase === "fallback" ? "bubble" : e.phase === "paused" ? "pill" : "none", i = ie(e);
|
|
1899
|
+
return Us(
|
|
1824
1900
|
{
|
|
1825
1901
|
mode: s,
|
|
1826
1902
|
lang: e.loaded.tour.locale.replace(/_/g, "-"),
|
|
1827
|
-
dir:
|
|
1903
|
+
dir: vs(e.loaded.tour.locale),
|
|
1828
1904
|
tourId: e.loaded.tour.id,
|
|
1829
1905
|
step: n,
|
|
1830
1906
|
state: e.phase === "fallback" ? "fallback" : "shown",
|
|
@@ -1833,50 +1909,57 @@ class At extends ne {
|
|
|
1833
1909
|
last: i.index === i.total - 1,
|
|
1834
1910
|
nextEnabled: n.advance !== "input" || e.fieldNonEmpty,
|
|
1835
1911
|
guideUrl: e.loaded.tour.guideUrl,
|
|
1836
|
-
strings:
|
|
1912
|
+
strings: wt(e.loaded.tour.locale, this.strings),
|
|
1837
1913
|
policy: this._policy,
|
|
1838
1914
|
popover: this._dom.supportsPopover()
|
|
1839
1915
|
},
|
|
1840
1916
|
this._handlers
|
|
1841
1917
|
);
|
|
1842
1918
|
}
|
|
1919
|
+
/** Inline custom properties win over the page's ``:root`` and element rules. */
|
|
1920
|
+
_applyTheme() {
|
|
1921
|
+
const e = xs(this.theme);
|
|
1922
|
+
for (const n of this._themed) e.has(n) || this.style.removeProperty(n);
|
|
1923
|
+
for (const [n, s] of e) this.style.setProperty(n, s);
|
|
1924
|
+
this._themed = new Set(e.keys());
|
|
1925
|
+
}
|
|
1843
1926
|
// ── Starting ────────────────────────────────────────────────────────────
|
|
1844
1927
|
async _start(e, n, s) {
|
|
1845
1928
|
try {
|
|
1846
|
-
if (
|
|
1929
|
+
if (St() || this.disabled)
|
|
1847
1930
|
return console.info(`[steppy-tour] "${e}" not started: tours are disabled on this page`), !1;
|
|
1848
|
-
const i =
|
|
1931
|
+
const i = z[Z];
|
|
1849
1932
|
i && i !== this && i._dispatch({ type: "DISMISS", via: "replaced" }), this._s.phase !== "idle" && this._dispatch({ type: "DISMISS", via: "replaced" }), this._dispatch({ type: "REQUEST" });
|
|
1850
|
-
const r = this._s.token, o = Object.fromEntries(Object.entries(n.params ?? {}).map(([d, w]) => [d, String(w)])), l = this._preferredLocale(), a = await
|
|
1933
|
+
const r = this._s.token, o = Object.fromEntries(Object.entries(n.params ?? {}).map(([d, w]) => [d, String(w)])), l = this._preferredLocale(), a = await pt(this._cfg(l), e);
|
|
1851
1934
|
if (this._s.token !== r) return !1;
|
|
1852
1935
|
if (!a.ok) return this._fail({ reason: a.reason, fatal: !0, message: a.message, tourId: e, issues: a.issues });
|
|
1853
|
-
const { tour: f, manifest: h } = a, c = this._dom,
|
|
1936
|
+
const { tour: f, manifest: h } = a, c = this._dom, y = h.layouts ?? {}, _ = f.steps.map((d) => !d.layouts || d.layouts.some((w) => c.matchMedia(y[w]))), m = { tourId: e, buildId: f.buildId, locale: f.locale };
|
|
1854
1937
|
if (!_.some(Boolean)) return this._fail({ reason: "load-failed", fatal: !0, message: "no steps apply to this layout", ...m });
|
|
1855
1938
|
let u = _.indexOf(!0);
|
|
1856
1939
|
if (n.step !== void 0) {
|
|
1857
1940
|
const d = f.steps.findIndex((w) => w.id === n.step);
|
|
1858
1941
|
if (d >= 0 && _[d]) u = d;
|
|
1859
1942
|
else if (s)
|
|
1860
|
-
return
|
|
1943
|
+
return ue(), this._fail(null);
|
|
1861
1944
|
}
|
|
1862
|
-
const p =
|
|
1945
|
+
const p = gt(document.baseURI, location.origin);
|
|
1863
1946
|
let v = null, g = o;
|
|
1864
1947
|
if (f.entry && !s) {
|
|
1865
|
-
const d = f.entry.route, w =
|
|
1866
|
-
if (g = { ...w ?? {}, ...o }, !w || Object.entries(o).some(([
|
|
1867
|
-
const
|
|
1868
|
-
if ("missing" in
|
|
1948
|
+
const d = f.entry.route, w = ft(d, $e(location.pathname, p)) ?? ft(d, location.pathname);
|
|
1949
|
+
if (g = { ...w ?? {}, ...o }, !w || Object.entries(o).some(([b, $]) => w[b] !== $)) {
|
|
1950
|
+
const b = hs(d, g);
|
|
1951
|
+
if ("missing" in b)
|
|
1869
1952
|
return this._fail({
|
|
1870
1953
|
reason: "entry-params",
|
|
1871
1954
|
fatal: !0,
|
|
1872
|
-
message: `route ${d} needs ${
|
|
1873
|
-
missing:
|
|
1955
|
+
message: `route ${d} needs ${b.missing.join(", ")}`,
|
|
1956
|
+
missing: b.missing,
|
|
1874
1957
|
...m
|
|
1875
1958
|
});
|
|
1876
|
-
v =
|
|
1959
|
+
v = Ht(b.path, p);
|
|
1877
1960
|
}
|
|
1878
1961
|
}
|
|
1879
|
-
return this._run = { tourId: e, params: g, load: a, entryPath: v, base: p }, this._resolver =
|
|
1962
|
+
return this._run = { tourId: e, params: g, load: a, entryPath: v, base: p }, this._resolver = us({ attr: a.testIdAttribute, host: this, dom: c }), z[Z] = this, this._dispatch({
|
|
1880
1963
|
type: "LOADED",
|
|
1881
1964
|
loaded: { tour: f, source: a.source, applicable: _, start: u, resumed: s, navigate: v !== null }
|
|
1882
1965
|
}), this._lang.observe(document.documentElement, { attributeFilter: ["lang"] }), this._preferredLocale() !== l && this._swapLocale(), !0;
|
|
@@ -1888,8 +1971,8 @@ class At extends ne {
|
|
|
1888
1971
|
return e ? this._dispatch({ type: "LOAD_FAILED", error: e }) : this._dispatch({ type: "DISMISS", via: "api" }), !1;
|
|
1889
1972
|
}
|
|
1890
1973
|
_tryResume() {
|
|
1891
|
-
if (this.disabled ||
|
|
1892
|
-
const e = this._manifestKey(), n = e ?
|
|
1974
|
+
if (this.disabled || St() || this._s.phase !== "idle" || z[Z]) return;
|
|
1975
|
+
const e = this._manifestKey(), n = e ? ys(e, Date.now()) : null;
|
|
1893
1976
|
n && this._start(n.tourId, { params: n.params, step: n.stepId }, !0);
|
|
1894
1977
|
}
|
|
1895
1978
|
_manifestKey() {
|
|
@@ -1907,7 +1990,7 @@ class At extends ne {
|
|
|
1907
1990
|
async _swapLocale() {
|
|
1908
1991
|
const e = this._run;
|
|
1909
1992
|
if (!e) return;
|
|
1910
|
-
const n = ++this._swapSeq, s = this._preferredLocale(), i = await
|
|
1993
|
+
const n = ++this._swapSeq, s = this._preferredLocale(), i = await pt(this._cfg(s), e.tourId);
|
|
1911
1994
|
if (!(n !== this._swapSeq || this._run !== e)) {
|
|
1912
1995
|
if (i.ok && i.tour.buildId === e.load.tour.buildId) {
|
|
1913
1996
|
if (i.tour.locale === e.load.tour.locale) return;
|
|
@@ -1926,7 +2009,7 @@ class At extends ne {
|
|
|
1926
2009
|
const n = this._s;
|
|
1927
2010
|
try {
|
|
1928
2011
|
for (; this._queue.length; ) {
|
|
1929
|
-
const s =
|
|
2012
|
+
const s = Gn(this._s, this._queue.shift());
|
|
1930
2013
|
this._s = s.state;
|
|
1931
2014
|
for (const i of s.effects) this._effect(i);
|
|
1932
2015
|
}
|
|
@@ -1939,13 +2022,13 @@ class At extends ne {
|
|
|
1939
2022
|
const n = this._run;
|
|
1940
2023
|
switch (e.type) {
|
|
1941
2024
|
case "emit":
|
|
1942
|
-
|
|
2025
|
+
Zn(this, e.name, e.detail);
|
|
1943
2026
|
break;
|
|
1944
2027
|
case "persist":
|
|
1945
2028
|
n && this._persist(e.index);
|
|
1946
2029
|
break;
|
|
1947
2030
|
case "clearPersist":
|
|
1948
|
-
|
|
2031
|
+
ue();
|
|
1949
2032
|
break;
|
|
1950
2033
|
case "navigate":
|
|
1951
2034
|
this._enter(e.token);
|
|
@@ -1963,7 +2046,7 @@ class At extends ne {
|
|
|
1963
2046
|
}
|
|
1964
2047
|
_persist(e) {
|
|
1965
2048
|
const n = this._run, s = n.load.tour;
|
|
1966
|
-
|
|
2049
|
+
bs({
|
|
1967
2050
|
v: 1,
|
|
1968
2051
|
tourId: s.id,
|
|
1969
2052
|
stepId: s.steps[e].id,
|
|
@@ -1975,7 +2058,7 @@ class At extends ne {
|
|
|
1975
2058
|
});
|
|
1976
2059
|
}
|
|
1977
2060
|
async _enter(e) {
|
|
1978
|
-
const n = this._run, s = n.entryPath, i = { appPath:
|
|
2061
|
+
const n = this._run, s = n.entryPath, i = { appPath: $e(s, n.base), tourId: n.tourId };
|
|
1979
2062
|
try {
|
|
1980
2063
|
const r = this.navigate ?? ((o) => location.assign(o));
|
|
1981
2064
|
await Promise.race([
|
|
@@ -1988,7 +2071,7 @@ class At extends ne {
|
|
|
1988
2071
|
}
|
|
1989
2072
|
_timeout() {
|
|
1990
2073
|
const e = Number(this.targetTimeout);
|
|
1991
|
-
return Number.isFinite(e) ? Math.min(
|
|
2074
|
+
return Number.isFinite(e) ? Math.min(Gs, Math.max(Ws, e)) : rt;
|
|
1992
2075
|
}
|
|
1993
2076
|
_wait(e, n, s) {
|
|
1994
2077
|
this._cancelWait?.();
|
|
@@ -2018,12 +2101,12 @@ class At extends ne {
|
|
|
2018
2101
|
_afterRender() {
|
|
2019
2102
|
const e = this._s, n = this._layer(), s = e.phase === "showing" || e.phase === "fallback" || e.phase === "paused";
|
|
2020
2103
|
if (!n || !s || !e.loaded) {
|
|
2021
|
-
this._tracker?.stop(), this._change?.stop(), this._change = null,
|
|
2104
|
+
this._tracker?.stop(), this._change?.stop(), this._change = null, X(e) || (this._shownKey = "");
|
|
2022
2105
|
return;
|
|
2023
2106
|
}
|
|
2024
|
-
|
|
2107
|
+
Xn(n, this._dom), this._ensureTriggers();
|
|
2025
2108
|
const i = e.loaded.tour.steps[e.index], r = `${e.loaded.tour.id}/${e.index}/${e.phase}`;
|
|
2026
|
-
r !== this._shownKey && (this._shownKey = r, this._shownAt = this._dom.scheduler.now(),
|
|
2109
|
+
r !== this._shownKey && (this._shownKey = r, this._shownAt = this._dom.scheduler.now(), Yn(n, this._dom), e.phase === "showing" && this._onStepShown(i), this._announce()), e.phase === "showing" || e.phase === "fallback" ? (this._tracker || (this._tracker = this._makeTracker()), this._tracker.start(), this._tracker.notify()) : this._tracker?.stop();
|
|
2027
2110
|
}
|
|
2028
2111
|
/** Manual and fallback steps take focus — once placed: a hidden bubble cannot be focused. */
|
|
2029
2112
|
_applyPendingFocus() {
|
|
@@ -2034,7 +2117,7 @@ class At extends ne {
|
|
|
2034
2117
|
const n = this._target;
|
|
2035
2118
|
if (this._change?.stop(), this._change = null, n && e.advance === "change") {
|
|
2036
2119
|
const i = this._s.token;
|
|
2037
|
-
this._change =
|
|
2120
|
+
this._change = Vs(n, gs, () => this._dispatch({ type: "TRIGGER", token: i, kind: "change" }), this._dom.scheduler);
|
|
2038
2121
|
}
|
|
2039
2122
|
if (n) {
|
|
2040
2123
|
const i = this._dom.rect(n), r = this._dom.viewport();
|
|
@@ -2047,7 +2130,7 @@ class At extends ne {
|
|
|
2047
2130
|
this._dom.scheduler.raf(() => {
|
|
2048
2131
|
const e = this.renderRoot.querySelector('[role="status"]'), n = this._bubble();
|
|
2049
2132
|
if (e) {
|
|
2050
|
-
if (e.textContent = "", this._s.phase === "paused") e.textContent =
|
|
2133
|
+
if (e.textContent = "", this._s.phase === "paused") e.textContent = wt(this._s.loaded?.tour.locale ?? "en", this.strings).paused;
|
|
2051
2134
|
else if (n) {
|
|
2052
2135
|
const s = (i) => n.querySelector(`[part~="${i}"]`)?.textContent?.trim() ?? "";
|
|
2053
2136
|
e.textContent = [s("title"), s("body"), s("progress")].filter(Boolean).join(" ");
|
|
@@ -2056,7 +2139,7 @@ class At extends ne {
|
|
|
2056
2139
|
});
|
|
2057
2140
|
}
|
|
2058
2141
|
_makeTracker() {
|
|
2059
|
-
return
|
|
2142
|
+
return js({
|
|
2060
2143
|
dom: this._dom,
|
|
2061
2144
|
layer: () => this._layer(),
|
|
2062
2145
|
bubble: () => this._bubble(),
|
|
@@ -2077,7 +2160,7 @@ class At extends ne {
|
|
|
2077
2160
|
}
|
|
2078
2161
|
_preferredSide() {
|
|
2079
2162
|
const e = this._s.loaded?.tour.steps[this._s.index];
|
|
2080
|
-
return e?.placement && e.placement !== "auto" ? e.placement : e?.advance === "change" && this._target &&
|
|
2163
|
+
return e?.placement && e.placement !== "auto" ? e.placement : e?.advance === "change" && this._target && ms(this._target) ? "top" : "auto";
|
|
2081
2164
|
}
|
|
2082
2165
|
_nextTargetRect() {
|
|
2083
2166
|
const e = this._s, s = (e.loaded?.tour.steps ?? []).find((r, o) => o > e.index && e.loaded.applicable[o]), i = s?.target && this._resolver ? this._resolver.find(s.target) : null;
|
|
@@ -2086,14 +2169,14 @@ class At extends ne {
|
|
|
2086
2169
|
/** The app's open dialogs (the overlay's own bubble is in the shadow root, so never one of them). */
|
|
2087
2170
|
_openDialogs() {
|
|
2088
2171
|
const e = [];
|
|
2089
|
-
for (const n of document.querySelectorAll(
|
|
2172
|
+
for (const n of document.querySelectorAll(Pe)) {
|
|
2090
2173
|
const s = this._dom.rect(n);
|
|
2091
2174
|
s && e.push(s);
|
|
2092
2175
|
}
|
|
2093
2176
|
return e;
|
|
2094
2177
|
}
|
|
2095
2178
|
_ensureTriggers() {
|
|
2096
|
-
this._detach || !this._run || (this._detach =
|
|
2179
|
+
this._detach || !this._run || (this._detach = Bs({
|
|
2097
2180
|
host: this,
|
|
2098
2181
|
attr: this._run.load.testIdAttribute,
|
|
2099
2182
|
state: () => this._s,
|
|
@@ -2101,7 +2184,7 @@ class At extends ne {
|
|
|
2101
2184
|
target: () => this._target,
|
|
2102
2185
|
persistAhead: (e) => {
|
|
2103
2186
|
const s = this._s.loaded.applicable.findIndex((i, r) => i && r > e);
|
|
2104
|
-
s === -1 ?
|
|
2187
|
+
s === -1 ? ue() : this._persist(s);
|
|
2105
2188
|
},
|
|
2106
2189
|
interacted: () => this._change?.arm(),
|
|
2107
2190
|
tick: () => this._change?.tick(),
|
|
@@ -2110,7 +2193,7 @@ class At extends ne {
|
|
|
2110
2193
|
}
|
|
2111
2194
|
/** Our buttons: a click counts only if it was pressed on this step (or, by keyboard, after a short grace). */
|
|
2112
2195
|
_guarded(e, n) {
|
|
2113
|
-
e.stopPropagation(), !(e.detail === 0 ? this._dom.scheduler.now() - this._shownAt <
|
|
2196
|
+
e.stopPropagation(), !(e.detail === 0 ? this._dom.scheduler.now() - this._shownAt < Ks : this._pressToken !== this._s.token) && n();
|
|
2114
2197
|
}
|
|
2115
2198
|
_deepActive() {
|
|
2116
2199
|
let e = document.activeElement;
|
|
@@ -2120,11 +2203,11 @@ class At extends ne {
|
|
|
2120
2203
|
_teardown(e) {
|
|
2121
2204
|
this._cancelWait?.(), this._cancelWait = null, this._tracker?.stop(), this._tracker = null, this._change?.stop(), this._change = null, this._detach?.(), this._detach = null, document.removeEventListener("focusin", this._onFocusIn, !0), this._lang.disconnect();
|
|
2122
2205
|
const n = this._deepActive();
|
|
2123
|
-
e && n && this.renderRoot.contains(n) && this._appFocus instanceof HTMLElement && this._appFocus.focus({ preventScroll: !0 }), this._target = null, this._run = null, this._resolver = null, this._shownKey = "",
|
|
2206
|
+
e && n && this.renderRoot.contains(n) && this._appFocus instanceof HTMLElement && this._appFocus.focus({ preventScroll: !0 }), this._target = null, this._run = null, this._resolver = null, this._shownKey = "", z[Z] === this && (z[Z] = null), !e && this._s.phase !== "idle" && (this._s = { ...U(), token: this._s.token + 1 });
|
|
2124
2207
|
}
|
|
2125
2208
|
// ── Links in step text ──────────────────────────────────────────────────
|
|
2126
2209
|
_link(e) {
|
|
2127
|
-
const n = this._run, s = n?.base ??
|
|
2210
|
+
const n = this._run, s = n?.base ?? gt(document.baseURI, location.origin), i = ps(e, s, location.origin);
|
|
2128
2211
|
if (i !== null)
|
|
2129
2212
|
return {
|
|
2130
2213
|
kind: "internal",
|
|
@@ -2133,32 +2216,35 @@ class At extends ne {
|
|
|
2133
2216
|
if (l.defaultPrevented || l.button !== 0 || l.metaKey || l.ctrlKey || l.shiftKey || l.altKey) return;
|
|
2134
2217
|
l.preventDefault();
|
|
2135
2218
|
const a = this.navigate ?? ((f) => location.assign(f));
|
|
2136
|
-
Promise.resolve(a(i, { appPath:
|
|
2219
|
+
Promise.resolve(a(i, { appPath: $e(i, s), tourId: n?.tourId ?? "" })).catch(() => {
|
|
2137
2220
|
});
|
|
2138
2221
|
}
|
|
2139
2222
|
};
|
|
2140
|
-
const r =
|
|
2223
|
+
const r = _e(e), o = n?.load.guideOrigin ?? null;
|
|
2141
2224
|
return r && o && r === o ? { kind: "external", href: e } : null;
|
|
2142
2225
|
}
|
|
2143
2226
|
}
|
|
2144
|
-
function
|
|
2145
|
-
const t = customElements.get(
|
|
2146
|
-
t ? t !==
|
|
2227
|
+
function qs() {
|
|
2228
|
+
const t = customElements.get(ye);
|
|
2229
|
+
t ? t !== xt && console.warn(`[steppy-tour] <${ye}> is already defined by another copy of the overlay; keeping that one`) : customElements.define(ye, xt);
|
|
2147
2230
|
}
|
|
2148
|
-
|
|
2231
|
+
qs();
|
|
2149
2232
|
export {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2233
|
+
yn as ADVANCE_KINDS,
|
|
2234
|
+
ws as DEFAULT_TOUR_STRINGS,
|
|
2235
|
+
vn as PLACEMENTS,
|
|
2236
|
+
xt as SteppyTourHost,
|
|
2237
|
+
_n as TOURS_KILL_SWITCH_GLOBAL,
|
|
2238
|
+
ei as TOUR_APPEARANCES,
|
|
2239
|
+
Js as TOUR_ERROR_REASONS,
|
|
2240
|
+
Ys as TOUR_EVENTS,
|
|
2241
|
+
ye as TOUR_HOST_TAG,
|
|
2242
|
+
Qs as TOUR_PARTS,
|
|
2243
|
+
nt as TOUR_SCHEMA_VERSION,
|
|
2244
|
+
Bt as TOUR_THEME_KEYS,
|
|
2245
|
+
qs as defineTourHost,
|
|
2246
|
+
Kt as themeProperty,
|
|
2247
|
+
rs as validateManifest,
|
|
2248
|
+
os as validateTour
|
|
2163
2249
|
};
|
|
2164
2250
|
//# sourceMappingURL=steppy-tour.js.map
|