PageSourceSearch

https://static.studyladder.co.uk/js/Driver/driver_1_3_1.js

js studyladder.co.uk collected 2026-10-01 14:53:15 UTC 29,134 bytes, 574 lines download raw bytes

1window.driver = window.driver || {};
2window.driver.js = function (D) {
3    "use strict";
4    let F = {};
5
6    function z(e = {}) {
7        F = {
8            animate: !0,
9            allowClose: !0,
10            overlayOpacity: .7,
11            smoothScroll: !1,
12            disableActiveInteraction: !1,
13            showProgress: !1,
14            stagePadding: 10,
15            stageRadius: 5,
16            popoverOffset: 10,
17            showButtons: ["next", "previous", "close"],
18            disableButtons: [],
19            overlayColor: "#000",
20            addSlFooter: e.addSlFooter ? e.addSlFooter : !1, ...e
21        }
22    }
23
24    function a(e) {
25        return e ? F[e] : F
26    }
27
28    function W(e, o, t, i) {
29        return (e /= i / 2) < 1 ? t / 2 * e * e + o : -t / 2 * (--e * (e - 2) - 1) + o
30    }
31
32    function q(e) {
33        const o = 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';
34        return e.flatMap(t => {
35            const i = t.matches(o), p = Array.from(t.querySelectorAll(o));
36            return [...i ? [t] : [], ...p]
37        }).filter(t => getComputedStyle(t).pointerEvents !== "none" && ae(t))
38    }
39
40    function V(e) {
41        if (!e || se(e)) return;
42        const o = a("smoothScroll");
43        e.scrollIntoView({behavior: !o || re(e) ? "auto" : "smooth", inline: "center", block: "center"})
44    }
45
46    function re(e) {
47        if (!e || !e.parentElement) return;
48        const o = e.parentElement;
49        return o.scrollHeight > o.clientHeight
50    }
51
52    function se(e) {
53        const o = e.getBoundingClientRect();
54        return o.top >= 0 && o.left >= 0 && o.bottom <= (window.innerHeight || document.documentElement.clientHeight) && o.right <= (window.innerWidth || document.documentElement.clientWidth)
55    }
56
57    function ae(e) {
58        return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length)
59    }
60
61    let N = {};
62
63    function b(e, o) {
64        N[e] = o
65    }
66
67    function l(e) {
68        return e ? N[e] : N
69    }
70
71    function K() {
72        N = {}
73    }
74
75    let E = {};
76
77    function O(e, o) {
78        E[e] = o
79    }
80
81    function _(e) {
82        var o;
83        (o = E[e]) == null || o.call(E)
84    }
85
86    function ce() {
87        E = {}
88    }
89
90    function le(e, o, t, i) {
91        let p = l("__activeStagePosition");
92        const n = p || t.getBoundingClientRect(), f = i.getBoundingClientRect(), w = W(e, n.x, f.x - n.x, o),
93            r = W(e, n.y, f.y - n.y, o), v = W(e, n.width, f.width - n.width, o),
94            s = W(e, n.height, f.height - n.height, o);
95        p = {x: w, y: r, width: v, height: s}, Y(p), b("__activeStagePosition", p)
96    }
97
98    function X(e) {
99        if (!e) return;
100        const o = e.getBoundingClientRect(), t = {x: o.x, y: o.y, width: o.width, height: o.height};
101        b("__activeStagePosition", t), Y(t)
102    }
103
104    function de() {
105        const e = l("__activeStagePosition"), o = l("__overlaySvg");
106        if (!e) return;
107        if (!o) {
108            console.warn("No stage svg found.");
109            return
110        }
111        const t = window.innerWidth, i = window.innerHeight;
112        o.setAttribute("viewBox", `0 0 ${t} ${i}`)
113    }
114
115    function pe(e) {
116        const o = ue(e);
117        document.body.appendChild(o), G(o, t => {
118            t.target.tagName === "path" && _("overlayClick")
119        }), b("__overlaySvg", o)
120    }
121
122    function Y(e) {
123        const o = l("__overlaySvg");
124        if (!o) {
125            pe(e);
126            return
127        }
128        const t = o.firstElementChild;
129        if ((t == null ? void 0 : t.tagName) !== "path") throw new Error("no path element found in stage svg");
130        t.setAttribute("d", j(e))
131    }
132
133    function ue(e) {
134        const o = window.innerWidth, t = window.innerHeight,
135            i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
136        i.classList.add("driver-overlay", "driver-overlay-animated"), i.setAttribute("viewBox", `0 0 ${o} ${t}`), i.setAttribute("xmlSpace", "preserve"), i.setAttribute("xmlnsXlink", "http://www.w3.org/1999/xlink"), i.setAttribute("version", "1.1"), i.setAttribute("preserveAspectRatio", "xMinYMin slice"), i.style.fillRule = "evenodd", i.style.clipRule = "evenodd", i.style.strokeLinejoin = "round", i.style.strokeMiterlimit = "2", i.style.zIndex = "10000", i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.width = "100%", i.style.height = "100%";
137        const p = document.createElementNS("http://www.w3.org/2000/svg", "path");
138        return p.setAttribute("d", j(e)), p.style.fill = a("overlayColor") || "rgb(0,0,0)", p.style.opacity = `${a("overlayOpacity")}`, p.style.pointerEvents = "auto", p.style.cursor = "auto", i.appendChild(p), i
139    }
140
141    function j(e) {
142        const o = window.innerWidth, t = window.innerHeight, i = a("stagePadding") || 0, p = a("stageRadius") || 0,
143            n = e.width + i * 2, f = e.height + i * 2, w = Math.min(p, n / 2, f / 2), r = Math.floor(Math.max(w, 0)),
144            v = e.x - i + r, s = e.y - i, c = n - r * 2, d = f - r * 2;
145        return `M${o},0L0,0L0,${t}L${o}
145,${t}L${o},0Z
146    M${v},${s} h${c} a${r},${r} 0 0 1 ${r},${r} v${d} a${r},${r} 0 0 1 -${r},${r} h-${c} a${r},${r} 0 0 1 -${r},-${r} v-${d} a${r},${r} 0 0 1 ${r},-${r} z`
147    }
148
149    function ve() {
150        const e = l("__overlaySvg");
151        e && e.remove()
152    }
153
154    function fe() {
155        const e = document.getElementById("driver-dummy-element");
156        if (e) return e;
157        let o = document.createElement("div");
158        return o.id = "driver-dummy-element", o.style.width = "0", o.style.height = "0", o.style.pointerEvents = "none", o.style.opacity = "0", o.style.position = "fixed", o.style.top = "50%", o.style.left = "50%", document.body.appendChild(o), o
159    }
160
161    function Q(e) {
162        const {element: o} = e;
163        let t = typeof o == "string" ? document.querySelector(o) : o;
164        t || (t = fe()), ge(t, e)
165    }
166
167    function he() {
168        const e = l("__activeElement"), o = l("__activeStep");
169        e && (X(e), de(), oe(e, o))
170    }
171
172    function ge(e, o) {
173        const i = Date.now(), p = l("__activeStep"), n = l("__activeElement") || e, f = !n || n === e,
174            w = e.id === "driver-dummy-element", r = n.id === "driver-dummy-element", v = a("animate"),
175            s = o.onHighlightStarted || a("onHighlightStarted"),
176            c = (o == null ? void 0 : o.onHighlighted) || a("onHighlighted"),
177            d = (p == null ? void 0 : p.onDeselected) || a("onDeselected"), m = a(), g = l();
178        !f && d && d(r ? void 0 : n, p, {config: m, state: g}), s && s(w ? void 0 : e, o, {config: m, state: g});
179        const u = !f && v;
180        let h = !1;
181        xe(), b("previousStep", p), b("previousElement", n), b("activeStep", o), b("activeElement", e);
182        const P = () => {
183            if (l("__transitionCallback") !== P) return;
184            const x = Date.now() - i, y = 400 - x <= 400 / 2;
185            o.popover && y && !h && u && (J(e, o), h = !0), a("animate") && x < 400 ? le(x, 400, n, e) : (X(e), c && c(w ? void 0 : e, o, {
186                config: a(),
187                state: l()
188            }), b("__transitionCallback", void 0), b("__previousStep", p), b("__previousElement", n), b("__activeStep", o), b("__activeElement", e)), window.requestAnimationFrame(P)
189        };
190        b("__transitionCallback", P), window.requestAnimationFrame(P), V(e), !u && o.popover && J(e, o), n.classList.remove("driver-active-element", "driver-no-interaction"), n.removeAttribute("aria-haspopup"), n.removeAttribute("aria-expanded"), n.removeAttribute("aria-controls"), a("disableActiveInteraction") && e.classList.add("driver-no-interaction"), e.classList.add("driver-active-element"), e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", "driver-popover-content")
191    }
192
193    function we() {
194        var e;
195        (e = document.getElementById("driver-dummy-element")) == null || e.remove(), document.querySelectorAll(".driver-active-element").forEach(o => {
196            o.classList.remove("driver-active-element", "driver-no-interaction"), o.removeAttribute("aria-haspopup"), o.removeAttribute("aria-expanded"), o.removeAttribute("aria-controls")
197        })
198    }
199
200    function A() {
201        const e = l("__resizeTimeout");
202        e && window.cancelAnimationFrame(e), b("__resizeTimeout", window.requestAnimationFrame(he))
203    }
204
205    function me(e) {
206        var r;
207        if (!l("isInitialized") || !(e.key === "Tab" || e.keyCode === 9)) return;
208        const i = l("__activeElement"), p = (r = l("popover")) == null ? void 0 : r.wrapper,
209            n = q([...p ? [p] : [], ...i ? [i] : []]), f = n[0], w = n[n.length - 1];
210        if (e.preventDefault(), e.shiftKey) {
211            const v = n[n.indexOf(document.activeElement) - 1] || w;
212            v == null || v.focus()
213        } else {
214            const v = n[n.indexOf(document.activeElement) + 1] || f;
215            v == null || v.focus()
216        }
217    }
218
219    function Z(e) {
220        var t;
221        ((t = a("allowKeyboardControl")) == null || t) && (e.key === "Escape" ? _("escapePress") : e.key === "ArrowRight" ? _("arrowRightPress") : e.key === "ArrowLeft" && _("arrowLeftPress"))
222    }
223
224    function G(e, o, t) {
225        const i = (n, f) => {
226            const w = n.target;
227            e.contains(w) && ((!t || t(w)) && (n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation()), f == null || f(n))
228        };
229        document.addEventListener("pointerdown", i, !0), document.addEventListener("mousedown", i, !0), document.addEventListener("pointerup", i, !0), document.addEventListener("mouseup", i, !0), document.addEventListener("click", n => {
230            i(n, o)
231        }, !0)
232    }
233
234    function ye() {
235        window.addEventListener("keyup", Z, !1), window.addEventListener("keydown", me, !1), window.addEventListener("resize", A), window.addEventListener("scroll", A)
236    }
237
238    function be() {
239        window.removeEventListener("keyup", Z), window.removeEventListener("resize", A), window.removeEventListener("scroll", A)
240    }
241
242    function xe() {
243        const e = l("popover");
244        e && (e.wrapper.style.display = "none")
245    }
246
247    function J(e, o) {
248        var C, y;
249        let t = l("popover");
250        t && document.body.removeChild(t.wrapper), t = Pe(), document.body.appendChild(t.
250wrapper);
251        const {
252            title: i,
253            description: p,
254            showButtons: n,
255            disableButtons: f,
256            showProgress: w,
257            nextBtnText: r = a("nextBtnText") || "Next &rarr;",
258            prevBtnText: v = a("prevBtnText") || "&larr; Previous",
259            progressText: s = a("progressText") || "{current} of {total}"
260        } = o.popover || {};
261        t.nextButton.innerHTML = r, t.previousButton.innerHTML = v, t.progress.innerHTML = s, i ? (t.title.innerHTML = i, t.title.style.display = "block") : t.title.style.display = "none", p ? (t.description.innerHTML = p, t.description.style.display = "block") : t.description.style.display = "none";
262        const c = n || a("showButtons"), d = w || a("showProgress") || !1,
263            m = (c == null ? void 0 : c.includes("next")) || (c == null ? void 0 : c.includes("previous")) || d;
264        t.closeButton.style.display = c.includes("close") ? "block" : "none", m ? (t.footer.style.display = "flex", t.progress.style.display = d ? "block" : "none", t.nextButton.style.display = c.includes("next") ? "block" : "none", t.previousButton.style.display = c.includes("previous") ? "block" : "none") : t.footer.style.display = "none";
265        const g = f || a("disableButtons") || [];
266        g != null && g.includes("next") && (t.nextButton.disabled = !0, t.nextButton.classList.add("driver-popover-btn-disabled")), g != null && g.includes("previous") && (t.previousButton.disabled = !0, t.previousButton.classList.add("driver-popover-btn-disabled")), g != null && g.includes("close") && (t.closeButton.disabled = !0, t.closeButton.classList.add("driver-popover-btn-disabled"));
267        const u = t.wrapper;
268        u.style.display = "block", u.style.left = "", u.style.top = "", u.style.bottom = "", u.style.right = "", u.id = "driver-popover-content", u.setAttribute("role", "dialog"), u.setAttribute("aria-labelledby", "driver-popover-title"), u.setAttribute("aria-describedby", "driver-popover-description");
269        const h = t.arrow;
270        h.className = "driver-popover-arrow";
271        const P = ((C = o.popover) == null ? void 0 : C.popoverClass) || a("popoverClass") || "";
272        u.className = `driver-popover ${P}`.trim(), G(t.wrapper, k => {
273            var M, R, I;
274            const T = k.target, H = ((M = o.popover) == null ? void 0 : M.onNextClick) || a("onNextClick"),
275                $ = ((R = o.popover) == null ? void 0 : R.onPrevClick) || a("onPrevClick"),
276                B = ((I = o.popover) == null ? void 0 : I.onCloseClick) || a("onCloseClick");
277            if (T.classList.contains("driver-popover-next-btn")) return H ? H(e, o, {
278                config: a(),
279                state: l()
280            }) : _("nextClick");
281            if (T.classList.contains("driver-popover-prev-btn")) return $ ? $(e, o, {
282                config: a(),
283                state: l()
284            }) : _("prevClick");
285            if (T.classList.contains("driver-popover-close-btn")) return B ? B(e, o, {
286                config: a(),
287                state: l()
288            }) : _("closeClick")
289        }, k => !(t != null && t.description.contains(k)) && !(t != null && t.title.contains(k)) && typeof k.className == "string" && k.className.includes("driver-popover")), b("popover", t);
290        const S = ((y = o.popover) == null ? void 0 : y.onPopoverRender) || a("onPopoverRender");
291        S && S(t, {config: a(), state: l()}), oe(e, o), V(u);
292        const L = e.classList.contains("driver-dummy-element"), x = q([u, ...L ? [] : [e]]);
293        x.length > 0 && x[0].focus()
294        if (F.addSlFooter){
295            const slf = document.createElement('div');
296            slf.innerHTML = `
297            <div class="extra-footer pt-1 mt-2" style="display: flex;border-top:solid 1px lightgrey;">
298                <div style="background: url(https://www.studyladder.com/images/Studyladder-Logo.png);background-repeat: no-repeat;background-size: contain;background-position: right; height:20px; width:100%;"></div>
299            </div>
300            `
301            t.wrapper.appendChild(slf);
302            t.wrapper.classList.add("pb-1")
303            t.wrapper.classList.add("mb-5")
304        }
305    }
306
307    function U() {
308        const e = l("popover");
309        if (!(e != null && e.wrapper)) return;
310        const o = e.wrapper.getBoundingClientRect(), t = a("stagePadding") || 0, i = a("popoverOffset") || 0;
311        return {width: o.width + t + i, height: o.height + t + i, realWidth: o.width, realHeight: o.height}
312    }
313
314    function ee(e, o) {
315        const {elementDimensions: t, popoverDimensions: i, popoverPadding: p, popoverArrowDimensions: n} = o;
316        return e === "start" ? Math.max(Math.min(t.top - p, window.innerHeight - i.realHeight - n.width), n.width) : e === "end" ? Math.max(Math.min(t.top - (i == null ? void 0 : i.realHeight) + t.height + p, window.innerHeight - (i == null ? void 0 : i.realHeight) - n.width), n.width) : e === "center" ? Math.max(Math.min(t.top + t.height / 2 - (i == null ? void 0 : i.realHeight) / 2, window.innerHeight - (i == null ? void 0 : i.realHeight) - n.width), n.width) : 0
317    }
318
319    function te(e, o) {
320        const {elementDimensions: t, popoverDimensions: i, popoverPadding: p, popoverArrowDimensions: n} = o;
321        return e === "start" ? Math.max(Math.min(t.left - p, window.innerWidth - i.realWidth - n.width), n.width) : e === "end" ? Math.max(Math.min(t.left - (i == null ? void 0 : i.realWidth) + t.width + p, window.innerWidth - (i == null ? void 0 : i.realWidth) - n.width), n.width) : e === "center" ? Math.max(Math.min(t.left + t.width / 2 - (i == null ? void 0 : i.realWidth) / 2, window.innerWidth - (i == null ? void 0 : i.realWidth) - n.width), n.width) : 0
322    }
323
324    function oe(e, o) {
325        const t = l("popover");
326        if (!t) return;
327        const {align: i = "start", side: p = "left"} = (o == null ? void 0 : o.popover) || {}, n = i,
328            f = e.id === "driver-dummy-element" ? "over" : p, w = a("stagePadding") || 0, r = U(),
329            v = t.arrow.getBoundingClientRect(), s = e.getBoundingClientRect(), c = s.top - r.height;
330        let d = c >= 0;
331        const m = window.innerHeight - (s.bottom + r.height);
332        let g = m >= 0;
333        const u = s.left - r.width;
334        let h = u >= 0;
335        const P = window.innerWidth - (s.right + r.width);
336        let S = P >= 0;
337        const L = !d && !g && !h && !S;
338        let x = f;
339        if (f === "top" && d ? S = h = g = !1 : f === "bottom" && g ? S = h = d = !1 : f === "left" && h ? S = d = g = !1 : f === "right" && S && (h = d = g = !1), f === "over") {
340            const C = window.innerWidth / 2 - r.realWidth / 2, y = window.innerHeight / 2 - r.realHeight / 2;
341            t.wrapper.style.left = `${C}px`, t.wrapper.style.right = "auto", t.wrapper.style.top = `${y}px`, t.wrapper.style.bottom = "auto"
342        } else if (L) {
343            const C = window.innerWidth / 2 - (r == null ? void 0 : r.realWidth) / 2, y = 10;
344            t.wrapper.style.left = `${C}px`, t.wrapper.style.right = "auto", t.wrapper.style.bottom = `${y}px`, t.wrapper.style.top = "auto"
345        } else if (h) {
346            const C = Math.min(u, window.innerWidth - (r == null ? void 0 : r.realWidth) - v.width),
347                y = ee(n, {elementDimensions: s, popoverDimensions: r, popoverPadding: w, popoverArrowDimensions: v});
348            t.wrapper.style.left = `${C}px`, t.wrapper.style.top = `${y}px`, t.wrapper.style.bottom = "auto", t.wrapper.style.right = "auto", x = "left"
349        } else if (S) {
350            const C = Math.min(P, window.innerWidth - (r == null ? void 0 : r.realWidth) - v.width),
351                y = ee(n, {elementDimensions: s, popoverDimensions: r, popoverPadding: w, popoverArrowDimensions: v});
352            t.wrapper.style.right = `${C}px`, t.wrapper.style.top = `${y}px`, t.wrapper.style.bottom = "auto", t.wrapper.style.left = "auto", x = "right"
353        } else if (d) {
354            const C = Math.min(c, window.innerHeight - r.realHeight - v.width);
355            let y = te(n, {elementDimensions: s, popoverDimensions: r, popoverPadding: w, popoverArrowDimensions: v});
356            t.wrapper.style.top = `${C}px`, t.wrapper.style.left = `${y}px`, t.wrapper.style.bottom = "auto", t.wrapper.style.right = "auto", x = "top"
357        } else if (g) {
358            const C = Math.min(m, window.innerHeight - (r == null ? void 0 : r.realHeight) - v.width);
359            let y = te(n, {elementDimensions: s, popoverDimensions: r, popoverPadding: w, popoverArrowDimensions: v});
360            t.wrapper.style.left = `${y}px`, t.wrapper.style.bottom = `${C}px`, t.wrapper.style.top = "auto", t.wrapper.style.right = "auto", x = "bottom"
361        }
362        L ? t.arrow.classList.add("driver-popover-arrow-none") : Ce(n, x, e)
363    }
364
365    function Ce(e, o, t) {
366        const i = l("popover");
367        if (!i) return;
368        const p = t.getBoundingClientRect(), n = U(), f = i.arrow, w = n.width, r = window.innerWidth, v = p.width,
369            s = p.left, c = n.height, d = window.innerHeight, m = p.top, g = p.height;
370        f.className = "driver-popover-arrow";
371        let u = o, h = e;
372        o === "top" ? (s + v <= 0 ? (u = "right", h = "end") : s + v - w <= 0 && (u = "top", h = "start"), s >= r ? (u = "left", h = "end") : s + w >= r && (u = "top", h = "end")) : o === "bottom" ? (s + v <= 0 ? (u = "right", h = "start") : s + v - w <= 0 && (u = "bottom", h = "start"), s >= r ? (u = "left", h = "start") : s + w >= r && (u = "bottom", h = "end")) : o === "left" ? (m + g <= 0 ? (u = "bottom", h = "end") : m + g - c <= 0 && (u = "left", h = "start"), m >= d ? (u = "top", h = "end") : m + c >= d && (u = "left", h = "end")) : o === "right" && (m + g <= 0 ? (u = "bottom", h = "start") : m + g - c <= 0 && (u = "right", h = "start"), m >= d ? (u = "top", h = "start") : m + c >= d && (u = "right", h = "end")), u ? (f.classList.add(`driver-popover-arrow-side-${u}`), f.classList.add(`driver-popover-arrow-align-${h}`)) : f.classList.add("driver-popover-arrow-none")
373    }
374
375    function Pe() {
376        const e = document.createElement("div");
377        e.classList.add("driver-popover");
378        const o = document.createElement("div");
379        o.classList.add("driver-popover-arrow");
380        const t = document.createElement("header");
381        t.id = "driver-popover-title", t.classList.add("driver-popover-title"), t.style.display = "none", t.innerText = "Popover Title";
382        const i = document.createElement("div");
383        i.id = "driver-popover-description", i.classList.add("driver-popover-description"), i.style.display = "none", i.innerText = "Popover description is here";
384        const p = document.createElement("button");
385        p.type = "button", p.classList.add("driver-popover-close-btn"), p.setAttribute("aria-label", "Close"), p.innerHTML = "&times;";
386        const n = document.createElement("footer");
387        n.classList.add("driver-popover-footer");
388        const f = document.createElement("span");
389        f.classList.add("driver-popover-progress-text"), f.innerText = "";
390        const w = document.createElement("span");
391        w.classList.add("driver-popover-navigation-btns");
392        const r = document.createElement("button");
393        r.type = "button", r.classList.add("driver-popover-prev-btn"), r.innerHTML = "&larr; Previous";
394        const v = document.createElement("button");
395        return v.type = "button", v.classList.add("driver-popover-next-btn"), v.innerHTML = "Next &rarr;", w.appendChild(r), w.appendChild(v), n.appendChild(f), n.appendChild(w), e.appendChild(p), e.appendChild(o), e.appendChild(t), e.appendChild(i), e.appendChild(n), {
396            wrapper: e,
397            arrow: o,
398            title: t,
399            description: i,
400            footer: n,
401            previousButton: r,
402            nextButton: v,
403            closeButton: p,
404            footerButtons: w,
405            progress: f
406        }
407    }
408
409    function Se() {
410        var o;
411        const e = l("popover");
412        e && ((o = e.wrapper.parentElement) == null || o.removeChild(e.wrapper))
413    }
414
415    const Le = "";
416
417    function ke(e = {}) {
418        z(e);
419
420        function o() {
421            a("allowClose") && v()
422        }
423
424        function t() {
425            const s = l("activeIndex"), c = a("steps") || [];
426            if (typeof s == "undefined") return;
427            const d = s + 1;
428            c[d] ? r(d) : v()
429        }
430
431        function i() {
432            const s = l("activeIndex"), c = a("steps") || [];
433            if (typeof s == "undefined") return;
434            const d = s - 1;
435            c[d] ? r(d) : v()
436        }
437
438        function p(s) {
439            (a("steps") || [])[s] ? r(s) : v()
440        }
441
442        function n() {
443            var h;
444            if (l("__transitionCallback")) return;
445            const c = l("activeIndex"), d = l("__activeStep"), m = l("__activeElement");
446            if (typeof c == "undefined" || typeof d == "undefined" || typeof l("activeIndex") == "undefined") return;
447            const u = ((h = d.popover) == null ? void 0 : h.onPrevClick) || a("onPrevClick");
448            if (u) return u(m, d, {config: a(), state: l()});
449            i()
450        }
451
452        function f() {
453            var u;
454            if (l("__transitionCallback")) return;
455            const c = l("activeIndex"), d = l("__activeStep"), m = l("__activeElement");
456            if (typeof c == "undefined" || typeof d == "undefined") return;
457            const g = ((u = d.popover) == null ? void 0 : u.onNextClick) || a("onNextClick");
458            if (g) return g(m, d, {config: a(), state: l()});
459            t()
460        }
461
462        function w() {
463            l("isInitialized") || (b("isInitialized", !0), document.body.classList.add("driver-active", a("animate") ? "driver-fade" : "driver-simple"), ye(), O("overlayClick", o), O("escapePress", o), O("arrowLeftPress", n), O("arrowRightPress", f))
464        }
465
466        function r(s = 0) {
467            var H, $, B, M, R, I, ie, ne;
468            const c = a("steps");
469            if (!c) {
470                console.error("No steps to drive through"), v();
471                return
472            }
473            if (!c[s]) {
474                v();
475                return
476            }
477            b("__activeOnDestroyed", document.activeElement), b("activeIndex", s);
478            const d = c[s], m = c[s + 1], g = c[s - 1],
479                u = ((H = d.popover) == null ? void 0 : H.doneBtnText) || a("doneBtnText") || "Done",
480                h = a("allowClose"),
481                P = typeof (($ = d.popover) == null ? void 0 : $.showProgress) != "undefined" ? (B = d.popover) == null ? void 0 : B.showProgress : a("showProgress"),
482                L = (((M = d.popover) == null ? void 0 : M.progressText) || a("progressText") || "{{current}} of {{total}}").replace("{{current}}", `${s + 1}`).replace("{{total}}", `${c.length}`),
483                x = ((R = d.popover) == null ? void 0 : R.showButtons) || a("showButtons"),
484                C = ["next", "previous", ...h ? ["close"] : []].filter(_e => !(x != null && x.length) || x.includes(_e)),
485                y = ((I = d.popover) == null ? void 0 : I.onNextClick) || a("onNextClick"),
486                k = ((ie = d.popover) == null ? void 0 : ie.onPrevClick) || a("onPrevClick"),
487                T = ((ne = d.popover) == null ? void 0 : ne.onCloseClick) || a("onCloseClick");
488            Q({
489                ...d,
490                popover: {
491                    showButtons: C,
492                    nextBtnText: m ? void 0 : u,
493                    disableButtons: [...g ? [] : ["previous"]],
494                    showProgress: P,
495                    progressText: L,
496                    onNextClick: y || (() => {
497                        m ? r(s + 1) : v()
498                    }),
499                    onPrevClick: k || (() => {
500                        r(s - 1)
501                    }),
502                    onCloseClick: T || (() => {
503                        v()
504                    }), ...(d == null ? void 0 : d.popover) || {}
505                }
506            })
507        }
508
509        function v(s = !0) {
510            const c = l("__activeElement"), d = l("__activeStep"), m = l("__activeOnDestroyed"),
511                g = a("onDestroyStarted");
512            if (s && g) {
513                const P = !c || (c == null ? void 0 : c.id) === "driver-dummy-element";
514                g(P ? void 0 : c, d, {config: a(), state: l()});
515                return
516            }
517            const u = (d == null ? void 0 : d.onDeselected) || a("onDeselected"), h = a("onDestroyed");
518            if (document.body.classList.remove("driver-active", "driver-fade", "driver-simple"), be(), Se(), we(), ve(), ce(), K(), c && d) {
519                const P = c.id === "driver-dummy-element";
520                u && u(P ? void 0 : c, d, {config: a(), state: l()}), h && h(P ? void 0 : c, d, {
521                    config: a(),
522                    state: l()
523                })
524            }
525            m && m.focus()
526        }
527
528        return {
529            isActive: () => l("isInitialized") || !1,
530            refresh: A,
531            drive: (s = 0) => {
532                w(), r(s)
533            },
534            setConfig: z,
535            setSteps: s => {
536                K(), z({...a(), steps: s})
537            },
538            getConfig: a,
539            getState: l,
540            getActiveIndex: () => l("activeIndex"),
541            isFirstStep: () => l("activeIndex") === 0,
542            isLastStep: () => {
543                const s = a("steps") || [], c = l("activeIndex");
544                return c !== void 0 && c === s.length - 1
545            },
546            getActiveStep: () => l("activeStep"),
547            getActiveElement: () => l("activeElement"),
548            getPreviousElement: () => l("previousElement"),
549            getPreviousStep: () => l("previousStep"),
550            moveNext: t,
551            movePrevious: i,
552            moveTo: p,
553            hasNextStep: () => {
554                const s = a("steps") || [], c = l("activeIndex");
555                return c !== void 0 && s[c + 1]
556            },
557            hasPreviousStep: () => {
558                const s = a("steps") || [], c = l("activeIndex");
559                return c !== void 0 && s[c - 1]
560            },
561            highlight: s => {
562                w(), Q({
563                    ...s,
564                    popover: s.popover ? {showButtons: [], showProgress: !1, progressText: "", ...s.popover} : void 0
565                })
566            },
567            destroy: () => {
568                v(!1)
569            }
570        }
571    }
572
573    return D.driver = ke, Object.defineProperty(D, Symbol.toStringTag, {value: "Module"}), D
574}({});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.