@thisway/next
Advanced tools
Comparing version 0.3.2 to 0.3.3
1340
index.js
var Je = Object.defineProperty; | ||
var Qe = (e, t, o) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
var dt = (e, t, o) => (Qe(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
import * as Ee from "svelte"; | ||
import * as Le from "svelte"; | ||
import { onMount as to, onDestroy as Ae, createEventDispatcher as eo } from "svelte"; | ||
import { isValidNumber as zt, toPx as it, defaults as ae, pick$ as Y, clamp as At, noFinite as pe, getKeyByValue as oo, resizeObserver as We, EMPTY_SIZE as ro } from "@thisway/utils"; | ||
import { get as H, writable as kt, derived as L, readable as Wt } from "svelte/store"; | ||
import { PRIMARY_COLOR_WHITE as He, PRIMARY_COLOR_BLACK as Re, PRIMARY_COLOR_BLUE as so, EMPTY_POINT as no, POSITION_AUTO as Kt, ORIENTATIONS as ce, ALIGNMENTS as io, NO_ELEMENT as lt, ORIENTATIONS_TO_START_END as lo, ORIENTATIONS_Y as ao, popoverDefaultValues as po, highlightDefaultValues as co, LAYOUT_MODE_1 as yt, LAYOUT_MODE_3 as Ve } from "@thisway/base"; | ||
import { isValidNumber as qt, toPx as it, defaults as ae, pick$ as j, clamp as At, noFinite as ce, getKeyByValue as oo, animationFrameThrottle as ro, resizeObserver as We, EMPTY_SIZE as so } from "@thisway/utils"; | ||
import { get as H, writable as Tt, derived as E, readable as Wt } from "svelte/store"; | ||
import { PRIMARY_COLOR_WHITE as He, PRIMARY_COLOR_BLACK as Ve, PRIMARY_COLOR_BLUE as no, EMPTY_POINT as io, POSITION_AUTO as Xt, ORIENTATIONS as pe, ALIGNMENTS as lo, NO_ELEMENT as lt, ORIENTATIONS_TO_START_END as ao, ORIENTATIONS_Y as co, popoverDefaultValues as po, highlightDefaultValues as fo, LAYOUT_MODE_1 as yt, LAYOUT_MODE_3 as Re } from "@thisway/base"; | ||
export * from "@thisway/base"; | ||
import { SvelteComponent as Tt, init as xt, safe_not_equal as St, append_styles as Vt, space as et, empty as Ft, insert as B, noop as ut, detach as D, component_subscribe as E, svg_element as Rt, attr as M, set_style as G, append as U, listen as Ot, element as Z, action_destroyer as Fe, is_function as Be, construct_svelte_component as fe, create_component as bt, mount_component as $t, group_outros as st, transition_out as A, destroy_component as Ct, check_outros as nt, transition_in as x, run_all as fo, binding_callbacks as ho, text as Nt, set_data as Pt, compute_slots as uo, create_slot as wt, update_slot_base as _t, get_all_dirty_from_scope as mt, get_slot_changes as vt } from "svelte/internal"; | ||
import { SvelteComponent as kt, init as xt, safe_not_equal as St, append_styles as Rt, space as et, empty as Ft, insert as D, noop as ut, detach as Y, component_subscribe as L, svg_element as Vt, attr as P, set_style as G, append as U, listen as Ot, element as Z, action_destroyer as Fe, is_function as Be, construct_svelte_component as fe, create_component as bt, mount_component as $t, group_outros as st, transition_out as A, destroy_component as Ct, check_outros as nt, transition_in as S, run_all as ho, binding_callbacks as uo, text as Nt, set_data as It, compute_slots as wo, create_slot as wt, update_slot_base as _t, get_all_dirty_from_scope as mt, get_slot_changes as gt } from "svelte/internal"; | ||
import "svelte/internal/disclose-version"; | ||
import { getHighlightOptions as wo, NO_ELEMENT as _o, CLICK_MASK_ACTION_NEXT as mo, CLICK_MASK_ACTION_CLOSE as vo, getRenderIndex as go } from "@thisway/next"; | ||
import { getHighlightOptions as _o, NO_ELEMENT as mo, CLICK_MASK_ACTION_NEXT as go, CLICK_MASK_ACTION_CLOSE as vo, getRenderIndex as yo } from "@thisway/next"; | ||
import { tweened as Qt } from "svelte/motion"; | ||
import { cubicOut as te } from "svelte/easing"; | ||
const rt = (e) => Symbol(e), R = (e) => { | ||
const t = Ee.getContext(e); | ||
const rt = (e) => Symbol(e), F = (e) => { | ||
const t = Le.getContext(e); | ||
if (!t) | ||
throw new Error(`Context ${e.description} not exist`); | ||
return t; | ||
}, yo = (e, t) => { | ||
Ee.setContext(e, t); | ||
}, De = (e) => new Map(e), Mt = rt("Tour"), ee = rt("Options"), oe = rt("ElementBounding"), re = rt("PopoverContainer"), je = rt("PopoverSize"), se = rt("TotalStepCount"), Ye = rt("PopoverPosition"), Bt = rt("Delegate"), bo = rt("ForeignView"), Dt = rt("RenderState"), jt = rt("StepOptions"); | ||
class $o { | ||
}, bo = (e, t) => { | ||
Le.setContext(e, t); | ||
}, De = (e) => new Map(e), Pt = rt("Tour"), ee = rt("Options"), oe = rt("ElementBounding"), re = rt("PopoverContainer"), Ye = rt("PopoverSize"), se = rt("TotalStepCount"), je = rt("PopoverPosition"), Bt = rt("Delegate"), $o = rt("ForeignView"), Dt = rt("RenderState"), Yt = rt("StepOptions"); | ||
class Co { | ||
constructor(t) { | ||
@@ -61,3 +61,3 @@ dt(this, "store"); | ||
const { effectiveIndex$: t, effectiveSteps$: o } = this.store, r = H(t); | ||
if (!zt(r) || r < 1) | ||
if (!qt(r) || r < 1) | ||
return; | ||
@@ -87,7 +87,7 @@ const n = H(o)[r - 1]; | ||
const { effectiveIndex$: t, effectiveSteps$: o } = this.store, r = H(t), n = H(o); | ||
if (!(!zt(r) || r === n.length - 1)) | ||
if (!(!qt(r) || r === n.length - 1)) | ||
return n[r + 1].id; | ||
} | ||
} | ||
function qt([e, t]) { | ||
function zt([e, t]) { | ||
if (t == null || e.length === 0) | ||
@@ -99,4 +99,4 @@ return; | ||
} | ||
const Co = (e, t) => { | ||
const o = kt(e), r = kt(t), n = L(o, (a) => a.filter((p) => !p.isHidden)), s = L([o, r], qt), i = L([n, r], qt), l = L([o, s], ([a, p]) => p != null ? a[p] : void 0); | ||
const To = (e, t) => { | ||
const o = Tt(e), r = Tt(t), n = E(o, (a) => a.filter((c) => !c.isHidden)), s = E([o, r], zt), i = E([n, r], zt), l = E([o, s], ([a, c]) => c != null ? a[c] : void 0); | ||
return { | ||
@@ -122,15 +122,15 @@ steps$: o, | ||
top: it(t) | ||
}), To = (e, t, o, r, n) => { | ||
}), xo = (e, t, o, r, n) => { | ||
if (!e) | ||
return ""; | ||
const s = r ? o + t : o, i = t * 2, l = e.x - s + i, a = e.y - s, p = e.width + (s - i) * 2, h = e.height + (s - i) * 2, w = n.width, g = n.height; | ||
return `M${w},0L0,0L0,${g}L${w},${g}L${w},0ZM${l},${a}h${p}a${i},${i} 0 0 1 ${i},${i}v${h}a${i},${i} 0 0 1 -${i},${i}h-${p}a${i},${i} 0 0 1 -${i},-${i}v-${h}a${i},${i} 0 0 1 ${i},-${i}z`; | ||
}, Ge = (e, t = e) => e === He ? Re : t, xo = (e, t, o) => { | ||
const s = r ? o + t : o, i = t * 2, l = e.x - s + i, a = e.y - s, c = e.width + (s - i) * 2, f = e.height + (s - i) * 2, w = n.width, b = n.height; | ||
return `M${w},0L0,0L0,${b}L${w},${b}L${w},0ZM${l},${a}h${c}a${i},${i} 0 0 1 ${i},${i}v${f}a${i},${i} 0 0 1 -${i},${i}h-${c}a${i},${i} 0 0 1 -${i},-${i}v-${f}a${i},${i} 0 0 1 ${i},-${i}z`; | ||
}, Ge = (e, t = e) => e === He ? Ve : t, So = (e, t, o) => { | ||
const r = ae({ ...t }, e); | ||
return o ? ae({ ...o }, r) : r; | ||
}, Ke = () => { | ||
const { effectiveSteps$: e } = R(Mt).store, t = R(Dt); | ||
return L([e, t], ([o, { step: r }]) => qt([o, r == null ? void 0 : r.id])); | ||
}, Xe = () => R(jt).popover, So = () => R(jt).highlight, Oo = (e) => { | ||
const t = (e == null ? void 0 : e.primaryColor) || so, o = (e == null ? void 0 : e.textColor) || Ge(t, He), r = (e == null ? void 0 : e.descColor) || Re; | ||
}, Xe = () => { | ||
const { effectiveSteps$: e } = F(Pt).store, t = F(Dt); | ||
return E([e, t], ([o, { step: r }]) => zt([o, r == null ? void 0 : r.id])); | ||
}, Ke = () => F(Yt).popover, Oo = () => F(Yt).highlight, No = (e) => { | ||
const t = (e == null ? void 0 : e.primaryColor) || no, o = (e == null ? void 0 : e.textColor) || Ge(t, He), r = (e == null ? void 0 : e.descColor) || Ve; | ||
return { | ||
@@ -141,9 +141,9 @@ primaryColor: t, | ||
}; | ||
}, Ue = () => R(jt).theme, No = () => { | ||
const e = Ke(), { effectiveSteps$: t } = R(Mt).store; | ||
return L([e, t], ([o, r]) => zt(o) && o < r.length - 1 ? r[o + 1] : void 0); | ||
}, Ue = () => F(Yt).theme, Io = () => { | ||
const e = Xe(), { effectiveSteps$: t } = F(Pt).store; | ||
return E([e, t], ([o, r]) => qt(o) && o < r.length - 1 ? r[o + 1] : void 0); | ||
}, Po = () => { | ||
const e = R(Dt); | ||
return Y(e, "step"); | ||
}, { assign: he } = Object, ze = (e, t) => (he(e.style, t), { | ||
const e = F(Dt); | ||
return j(e, "step"); | ||
}, { assign: he } = Object, qe = (e, t) => (he(e.style, t), { | ||
update(o) { | ||
@@ -153,4 +153,4 @@ he(e.style, o); | ||
}); | ||
function Mo(e) { | ||
Vt(e, "svelte-1ge2xpm", ".thisway-mask{position:absolute;top:0;right:0;bottom:0;left:0;display:block}.thisway-mask path{pointer-events:auto}.thisway-highlight{position:absolute;overflow:visible;pointer-events:none;border-style:solid;border-color:var(--thisway-highlight-border-color);box-sizing:content-box;border-width:var(--thisway-highlight-border-width);border-radius:calc(var(--thisway-highlight-border-width) * 2)}.thisway-highlight-pulse{position:absolute;animation:hotspot-pulse 1.5s infinite;opacity:0.4;width:100%;height:100%;top:0;left:0;box-sizing:content-box;padding:var(--thisway-highlight-border-width);border-radius:calc(var(--thisway-highlight-border-width) * 2);transform:translate(calc(var(--thisway-highlight-border-width) * -1), calc(var(--thisway-highlight-border-width) * -1))}@keyframes hotspot-pulse{0%{box-shadow:0 0 0 0 var(--thisway-highlight-border-color, #3082ed)}50%{box-shadow:0 0 0 10px var(--thisway-highlight-border-color, #3082ed)}100%{box-shadow:0 0 0 0 var(--thisway-highlight-border-color, #3082ed)}}"); | ||
function Eo(e) { | ||
Rt(e, "svelte-1ge2xpm", ".thisway-mask{position:absolute;top:0;right:0;bottom:0;left:0;display:block}.thisway-mask path{pointer-events:auto}.thisway-highlight{position:absolute;overflow:visible;pointer-events:none;border-style:solid;border-color:var(--thisway-highlight-border-color);box-sizing:content-box;border-width:var(--thisway-highlight-border-width);border-radius:calc(var(--thisway-highlight-border-width) * 2)}.thisway-highlight-pulse{position:absolute;animation:hotspot-pulse 1.5s infinite;opacity:0.4;width:100%;height:100%;top:0;left:0;box-sizing:content-box;padding:var(--thisway-highlight-border-width);border-radius:calc(var(--thisway-highlight-border-width) * 2);transform:translate(calc(var(--thisway-highlight-border-width) * -1), calc(var(--thisway-highlight-border-width) * -1))}@keyframes hotspot-pulse{0%{box-shadow:0 0 0 0 var(--thisway-highlight-border-color, #3082ed)}50%{box-shadow:0 0 0 10px var(--thisway-highlight-border-color, #3082ed)}100%{box-shadow:0 0 0 0 var(--thisway-highlight-border-color, #3082ed)}}"); | ||
} | ||
@@ -161,3 +161,3 @@ function de(e) { | ||
c() { | ||
t = Rt("svg"), o = Rt("path"), M( | ||
t = Vt("svg"), o = Vt("path"), P( | ||
o, | ||
@@ -172,6 +172,6 @@ "d", | ||
e[2] | ||
), M(t, "class", "thisway-mask"), M(t, "role", "presentation"), M(t, "width", "100%"), M(t, "height", "100%"); | ||
), P(t, "class", "thisway-mask"), P(t, "role", "presentation"), P(t, "width", "100%"), P(t, "height", "100%"); | ||
}, | ||
m(s, i) { | ||
B(s, t, i), U(t, o), r || (n = Ot( | ||
D(s, t, i), U(t, o), r || (n = Ot( | ||
t, | ||
@@ -185,3 +185,3 @@ "click", | ||
i & /*$maskCommand$*/ | ||
2 && M( | ||
2 && P( | ||
o, | ||
@@ -200,3 +200,3 @@ "d", | ||
d(s) { | ||
s && D(t), r = !1, n(); | ||
s && Y(t), r = !1, n(); | ||
} | ||
@@ -212,3 +212,3 @@ }; | ||
c() { | ||
t = Z("div"), s && s.c(), M(t, "class", "thisway-highlight"), G( | ||
t = Z("div"), s && s.c(), P(t, "class", "thisway-highlight"), G( | ||
t, | ||
@@ -226,3 +226,3 @@ "--thisway-highlight-border-width", | ||
m(i, l) { | ||
B(i, t, l), s && s.m(t, null), r || (n = Fe(o = ze.call( | ||
D(i, t, l), s && s.m(t, null), r || (n = Fe(o = qe.call( | ||
null, | ||
@@ -256,3 +256,3 @@ t, | ||
d(i) { | ||
i && D(t), s && s.d(), r = !1, n(); | ||
i && Y(t), s && s.d(), r = !1, n(); | ||
} | ||
@@ -265,13 +265,13 @@ }; | ||
c() { | ||
t = Z("div"), M(t, "class", "thisway-highlight-pulse"); | ||
t = Z("div"), P(t, "class", "thisway-highlight-pulse"); | ||
}, | ||
m(o, r) { | ||
B(o, t, r); | ||
D(o, t, r); | ||
}, | ||
d(o) { | ||
o && D(t); | ||
o && Y(t); | ||
} | ||
}; | ||
} | ||
function Lo(e) { | ||
function Mo(e) { | ||
let t, o, r = ( | ||
@@ -289,3 +289,3 @@ /*$showMask$*/ | ||
m(s, i) { | ||
r && r.m(s, i), B(s, t, i), n && n.m(s, i), B(s, o, i); | ||
r && r.m(s, i), D(s, t, i), n && n.m(s, i), D(s, o, i); | ||
}, | ||
@@ -300,18 +300,18 @@ p(s, [i]) { | ||
d(s) { | ||
s && (D(t), D(o)), r && r.d(s), n && n.d(s); | ||
s && (Y(t), Y(o)), r && r.d(s), n && n.d(s); | ||
} | ||
}; | ||
} | ||
function Io(e, t, o) { | ||
let r, n, s, i, l, a, p, h; | ||
const w = R(Mt), g = R(oe), c = R(Bt), v = Ue(), k = wo(), y = Y(k, "showMask"); | ||
E(e, y, (u) => o(0, r = u)); | ||
const T = Y(k, "showBorder"); | ||
E(e, T, (u) => o(3, i = u)); | ||
const $ = Y(k, "showHeartbeat"), b = Y(k, "padding"), C = Y(k, "maskOpacity"); | ||
E(e, C, (u) => o(2, s = u)); | ||
const F = Y(k, "borderWidth"); | ||
let N; | ||
const j = L([g, F, b], ([u, d, V], X) => { | ||
const K = u ? H(u) : void 0, I = { | ||
function Lo(e, t, o) { | ||
let r, n, s, i, l, a, c, f; | ||
const w = F(Pt), b = F(oe), h = F(Bt), m = Ue(), u = _o(), $ = j(u, "showMask"); | ||
L(e, $, (_) => o(0, r = _)); | ||
const C = j(u, "showBorder"); | ||
L(e, C, (_) => o(3, i = _)); | ||
const v = j(u, "showHeartbeat"), T = j(u, "padding"), k = j(u, "maskOpacity"); | ||
L(e, k, (_) => o(2, s = _)); | ||
const V = j(u, "borderWidth"); | ||
let x; | ||
const R = E([b, V, T], ([_, d, B], K) => { | ||
const X = _ ? H(_) : void 0, M = { | ||
x: 0, | ||
@@ -322,6 +322,6 @@ y: 0, | ||
borderWidth: d, | ||
padding: V | ||
padding: B | ||
}; | ||
if (!K || K === _o) { | ||
const Q = Zt(c.window || window), ot = N ? H(N) : { | ||
if (!X || X === mo) { | ||
const Q = Zt(h.window || window), ot = x ? H(x) : { | ||
x: Q.width / 2, | ||
@@ -334,9 +334,9 @@ y: Q.height / 2, | ||
}; | ||
I.x = ot.x + ot.width / 2, I.y = ot.y + ot.height / 2, I.borderWidth = 0, I.padding = 0; | ||
M.x = ot.x + ot.width / 2, M.y = ot.y + ot.height / 2, M.borderWidth = 0, M.padding = 0; | ||
} else | ||
I.x = K.x, I.y = K.y, I.width = K.width, I.height = K.height; | ||
N || (N = Qt( | ||
M.x = X.x, M.y = X.y, M.width = X.width, M.height = X.height; | ||
x || (x = Qt( | ||
{ | ||
x: I.x + I.width / 2, | ||
y: I.y + I.height / 2, | ||
x: M.x + M.width / 2, | ||
y: M.y + M.height / 2, | ||
width: 0, | ||
@@ -349,36 +349,36 @@ height: 0, | ||
)); | ||
const W = N.subscribe((Q) => { | ||
X(Q); | ||
const W = x.subscribe((Q) => { | ||
K(Q); | ||
}); | ||
return N.set(I), () => { | ||
return x.set(M), () => { | ||
W(); | ||
}; | ||
}), S = L([j, T, y], ([u, d, V], X) => { | ||
if (!u || !V) | ||
}), O = E([R, C, $], ([_, d, B], K) => { | ||
if (!_ || !B) | ||
return; | ||
const K = To(u, u.borderWidth, u.padding, d, Zt(c.window || window)); | ||
X(K); | ||
const X = xo(_, _.borderWidth, _.padding, d, Zt(h.window || window)); | ||
K(X); | ||
}); | ||
E(e, S, (u) => o(1, n = u)); | ||
const P = L(j, (u, d) => { | ||
u && d({ | ||
left: it(u.x - u.borderWidth - u.padding), | ||
top: it(u.y - u.borderWidth - u.padding), | ||
width: it(u.width), | ||
height: it(u.height), | ||
padding: it(u.padding) | ||
L(e, O, (_) => o(1, n = _)); | ||
const I = E(R, (_, d) => { | ||
_ && d({ | ||
left: it(_.x - _.borderWidth - _.padding), | ||
top: it(_.y - _.borderWidth - _.padding), | ||
width: it(_.width), | ||
height: it(_.height), | ||
padding: it(_.padding) | ||
}); | ||
}); | ||
E(e, P, (u) => o(6, p = u)); | ||
const m = L(j, (u) => it(u == null ? void 0 : u.borderWidth)); | ||
E(e, m, (u) => o(4, l = u)); | ||
const f = L([k, v], ([u, d]) => { | ||
if (u != null && u.borderColor) | ||
return u.borderColor; | ||
const { primaryColor: V } = d; | ||
return Ge(V); | ||
L(e, I, (_) => o(6, c = _)); | ||
const y = E(R, (_) => it(_ == null ? void 0 : _.borderWidth)); | ||
L(e, y, (_) => o(4, l = _)); | ||
const p = E([u, m], ([_, d]) => { | ||
if (_ != null && _.borderColor) | ||
return _.borderColor; | ||
const { primaryColor: B } = d; | ||
return Ge(B); | ||
}); | ||
E(e, f, (u) => o(5, a = u)); | ||
const O = L([$, j], ([u, d]) => !!(u && (d != null && d.width) && (d != null && d.height))); | ||
return E(e, O, (u) => o(7, h = u)), [ | ||
L(e, p, (_) => o(5, a = _)); | ||
const N = E([v, R], ([_, d]) => !!(_ && (d != null && d.width) && (d != null && d.height))); | ||
return L(e, N, (_) => o(7, f = _)), [ | ||
r, | ||
@@ -390,15 +390,15 @@ n, | ||
a, | ||
p, | ||
h, | ||
y, | ||
T, | ||
c, | ||
f, | ||
$, | ||
C, | ||
S, | ||
P, | ||
m, | ||
f, | ||
k, | ||
O, | ||
I, | ||
y, | ||
p, | ||
N, | ||
() => { | ||
var d; | ||
switch ((d = H(k)) == null ? void 0 : d.clickMask) { | ||
switch ((d = H(u)) == null ? void 0 : d.clickMask) { | ||
case vo: { | ||
@@ -408,3 +408,3 @@ w.onClose(); | ||
} | ||
case mo: { | ||
case go: { | ||
w.goNextStep(); | ||
@@ -417,32 +417,32 @@ break; | ||
} | ||
class Eo extends Tt { | ||
class Ao extends kt { | ||
constructor(t) { | ||
super(), xt(this, t, Io, Lo, St, {}, Mo); | ||
super(), xt(this, t, Lo, Mo, St, {}, Eo); | ||
} | ||
} | ||
const _e = 0.05, qe = (e) => { | ||
if (!e || e === Kt) | ||
return [Kt, void 0]; | ||
const _e = 0.05, ze = (e) => { | ||
if (!e || e === Xt) | ||
return [Xt, void 0]; | ||
if (Array.isArray(e)) | ||
return e; | ||
const t = e.split("_"); | ||
return t.length === 1 && ce.includes(t[0]) ? [t[0], "CENTER"] : t.length === 2 && ce.includes(t[0]) && io.includes(t[1]) ? t : [Kt, void 0]; | ||
}, Ao = (e, t, o, r, n) => { | ||
return t.length === 1 && pe.includes(t[0]) ? [t[0], "CENTER"] : t.length === 2 && pe.includes(t[0]) && lo.includes(t[1]) ? t : [Xt, void 0]; | ||
}, Wo = (e, t, o, r, n) => { | ||
if (o === "OVER" || o === "SCREEN") | ||
return o; | ||
const i = e.top - t.height - r >= 0, a = n.height - (e.bottom + t.height) - r >= 0, h = e.left - t.width - r >= 0, g = n.width - (e.right + t.width) - r >= 0; | ||
if (o === "BOTTOM" && a) | ||
const s = e.x + e.width, i = e.y + e.height, a = e.y - t.height - r >= 0, f = n.height - (i + t.height) - r >= 0, b = e.x - t.width - r >= 0, m = n.width - (s + t.width) - r >= 0; | ||
if (o === "BOTTOM" && f) | ||
return "BOTTOM"; | ||
if (o === "LEFT" && h) | ||
if (o === "LEFT" && b) | ||
return "LEFT"; | ||
if (o === "TOP" && i) | ||
if (o === "TOP" && a) | ||
return "TOP"; | ||
if (o === "RIGHT" && g) | ||
if (o === "RIGHT" && m) | ||
return "RIGHT"; | ||
const c = n.width * _e, v = n.height * _e; | ||
return e.top < v && a ? "BOTTOM" : n.width - e.right < c && h ? "LEFT" : n.height - e.bottom < v && i ? "TOP" : e.left < c && g ? "RIGHT" : a ? "BOTTOM" : h ? "LEFT" : i ? "TOP" : g ? "RIGHT" : "SCREEN"; | ||
const u = n.width * _e, $ = n.height * _e; | ||
return e.y < $ && f ? "BOTTOM" : n.width - s < u && b ? "LEFT" : n.height - i < $ && a ? "TOP" : e.x < u && m ? "RIGHT" : f ? "BOTTOM" : b ? "LEFT" : a ? "TOP" : m ? "RIGHT" : "SCREEN"; | ||
}, Jt = { | ||
...no, | ||
...io, | ||
visibility: "hidden" | ||
}, Wo = (e, t, o, r) => e >= o && t <= r, me = (e = "CENTER", t, o, r, n, s) => { | ||
}, Ho = (e, t, o, r) => e >= o && t <= r, me = (e = "CENTER", t, o, r, n, s) => { | ||
if (!r) | ||
@@ -454,10 +454,10 @@ return { adjustAlignment: "CENTER", value: 0 }; | ||
END: o - r + s.borderWidth + s.padding | ||
}, l = (h, w, g, c) => { | ||
if (Wo(h, h + r, g, c)) | ||
return h; | ||
const v = w.shift(); | ||
return v ? l(v, w, g, c) : h; | ||
}, a = l(i[e], Object.values(i), 0, n), p = oo(i, a); | ||
return { adjustAlignment: p, value: i[p] }; | ||
}, Ho = (e, t, o, r, n, s, i) => { | ||
}, l = (f, w, b, h) => { | ||
if (Ho(f, f + r, b, h)) | ||
return f; | ||
const m = w.shift(); | ||
return m ? l(m, w, b, h) : f; | ||
}, a = l(i[e], Object.values(i), 0, n), c = oo(i, a); | ||
return { adjustAlignment: c, value: i[c] }; | ||
}, Vo = (e, t, o, r, n, s, i) => { | ||
const l = n + s.padding + s.borderWidth, a = { | ||
@@ -467,11 +467,11 @@ ...Jt, | ||
}; | ||
let p, h, w; | ||
let c, f, w; | ||
if (!o || o === lt || e == "SCREEN") | ||
h = (i.height - r.height) / 2, w = (i.width - r.width) / 2; | ||
f = (i.height - r.height) / 2, w = (i.width - r.width) / 2; | ||
else { | ||
const g = () => { | ||
const y = me( | ||
const b = o.x + o.width, h = o.y + o.height, m = () => { | ||
const v = me( | ||
t, | ||
o.left, | ||
o.right, | ||
o.x, | ||
b, | ||
r.width, | ||
@@ -481,8 +481,8 @@ i.width, | ||
); | ||
w = y.value, p = y.adjustAlignment; | ||
}, c = () => { | ||
const y = me( | ||
w = v.value, c = v.adjustAlignment; | ||
}, u = () => { | ||
const v = me( | ||
t, | ||
o.top, | ||
o.bottom, | ||
o.y, | ||
h, | ||
r.height, | ||
@@ -492,23 +492,23 @@ i.height, | ||
); | ||
h = y.value, p = y.adjustAlignment; | ||
}, v = i.height - r.height, k = i.width - r.width; | ||
f = v.value, c = v.adjustAlignment; | ||
}, $ = i.height - r.height, C = i.width - r.width; | ||
switch (e) { | ||
case "OVER": { | ||
h = o.top + (o.height - r.height) / 2, w = o.left + (o.width - r.width) / 2; | ||
f = o.y + (o.height - r.height) / 2, w = o.x + (o.width - r.width) / 2; | ||
break; | ||
} | ||
case "TOP": { | ||
h = At(o.top - r.height - l, 0, v), g(); | ||
f = At(o.y - r.height - l, 0, $), m(); | ||
break; | ||
} | ||
case "BOTTOM": { | ||
h = At(o.bottom + l, n, v), g(); | ||
f = At(h + l, n, $), m(); | ||
break; | ||
} | ||
case "LEFT": { | ||
w = At(o.left - r.width - l, 0, k), c(); | ||
w = At(o.x - r.width - l, 0, C), u(); | ||
break; | ||
} | ||
case "RIGHT": { | ||
w = At(o.right + l, n, k), c(); | ||
w = At(b + l, n, C), u(); | ||
break; | ||
@@ -518,41 +518,41 @@ } | ||
} | ||
return a.x = pe(w), a.y = pe(h), { style: a, alignment: p || "CENTER" }; | ||
return a.x = ce(w), a.y = ce(f), { style: a, alignment: c || "CENTER" }; | ||
}, Ro = () => { | ||
const e = R(oe), t = R(je), o = R(Bt), r = R(Dt), n = Xe(), s = H(So()); | ||
return L([e], ([i], l) => { | ||
const e = F(oe), t = F(Ye), o = F(Bt), r = F(Dt), n = Ke(), s = H(Oo()); | ||
return E([e], ([i], l) => { | ||
if (!i) | ||
return; | ||
const a = H(n), p = a.offset, h = qe(a.position), w = H(t), g = H(i), { step: c } = H(r), v = c == null ? void 0 : c.id; | ||
const a = H(n), c = a.offset, f = ze(a.position), w = H(t), b = H(i), { step: h } = H(r), m = h == null ? void 0 : h.id; | ||
if (w.width === 0 || w.height === 0) | ||
return; | ||
const k = h[0], y = Zt(o.window || window), T = g === lt ? "SCREEN" : Ao( | ||
g, | ||
const u = f[0], $ = Zt(o.window || window), C = b === lt ? "SCREEN" : Wo( | ||
b, | ||
w, | ||
k, | ||
p + s.padding + s.borderWidth, | ||
y | ||
), { style: $, alignment: b } = Ho( | ||
T, | ||
h[1], | ||
g, | ||
u, | ||
c + s.padding + s.borderWidth, | ||
$ | ||
), { style: v, alignment: T } = Vo( | ||
C, | ||
f[1], | ||
b, | ||
w, | ||
p, | ||
c, | ||
{ padding: s.padding, borderWidth: s.borderWidth }, | ||
y | ||
$ | ||
); | ||
l({ | ||
orientation: T, | ||
alignment: b, | ||
stepId: v, | ||
stepOrientation: k, | ||
style: $ | ||
orientation: C, | ||
alignment: T, | ||
stepId: m, | ||
stepOrientation: u, | ||
style: v | ||
}); | ||
}); | ||
}; | ||
function Vo(e) { | ||
Vt(e, "svelte-1cl9mhv", ".thisway{--thisway-default-shadow:0 1px 10px rgba(0, 0, 0, 0.4);width:100%;height:100%;top:0;right:0;bottom:0;left:0;max-width:100%;max-height:100%;pointer-events:none}.thisway-popover__container{position:absolute;pointer-events:auto}"); | ||
function Fo(e) { | ||
Rt(e, "svelte-1cl9mhv", ".thisway{--thisway-default-shadow:0 1px 10px rgba(0, 0, 0, 0.4);width:100%;height:100%;top:0;right:0;bottom:0;left:0;max-width:100%;max-height:100%;pointer-events:none}.thisway-popover__container{position:absolute;pointer-events:auto}"); | ||
} | ||
function Fo(e) { | ||
let t, o, r, n, s, i, l, a, p, h; | ||
o = new Eo({}); | ||
function Bo(e) { | ||
let t, o, r, n, s, i, l, a, c, f; | ||
o = new Ao({}); | ||
var w = ( | ||
@@ -562,6 +562,6 @@ /*$popoverComponent$*/ | ||
); | ||
function g(c, v) { | ||
function b(h, m) { | ||
return {}; | ||
} | ||
return w && (s = fe(w, g()), s.$on( | ||
return w && (s = fe(w, b()), s.$on( | ||
"close", | ||
@@ -584,4 +584,4 @@ /*onClose*/ | ||
c() { | ||
t = Z("div"), bt(o.$$.fragment), r = et(), n = Z("div"), s && bt(s.$$.fragment), M(n, "class", i = "thisway-popover__container " + /*$className*/ | ||
e[5]), M(t, "class", "thisway"), G( | ||
t = Z("div"), bt(o.$$.fragment), r = et(), n = Z("div"), s && bt(s.$$.fragment), P(n, "class", i = "thisway-popover__container " + /*$className*/ | ||
e[5]), P(t, "class", "thisway"), G( | ||
t, | ||
@@ -618,4 +618,4 @@ "position", | ||
}, | ||
m(c, v) { | ||
B(c, t, v), $t(o, t, null), U(t, r), U(t, n), s && $t(s, n, null), e[19](n), a = !0, p || (h = [ | ||
m(h, m) { | ||
D(h, t, m), $t(o, t, null), U(t, r), U(t, n), s && $t(s, n, null), e[19](n), a = !0, c || (f = [ | ||
Ot( | ||
@@ -627,3 +627,3 @@ window, | ||
), | ||
Fe(l = ze.call( | ||
Fe(l = qe.call( | ||
null, | ||
@@ -634,41 +634,41 @@ n, | ||
)) | ||
], p = !0); | ||
], c = !0); | ||
}, | ||
p(c, [v]) { | ||
if (v & /*$popoverComponent$*/ | ||
p(h, [m]) { | ||
if (m & /*$popoverComponent$*/ | ||
128 && w !== (w = /*$popoverComponent$*/ | ||
c[7])) { | ||
h[7])) { | ||
if (s) { | ||
st(); | ||
const k = s; | ||
A(k.$$.fragment, 1, 0, () => { | ||
Ct(k, 1); | ||
const u = s; | ||
A(u.$$.fragment, 1, 0, () => { | ||
Ct(u, 1); | ||
}), nt(); | ||
} | ||
w ? (s = fe(w, g()), s.$on( | ||
w ? (s = fe(w, b()), s.$on( | ||
"close", | ||
/*onClose*/ | ||
c[15] | ||
h[15] | ||
), s.$on( | ||
"previous", | ||
/*onPrevious*/ | ||
c[16] | ||
h[16] | ||
), s.$on( | ||
"done", | ||
/*onDone*/ | ||
c[17] | ||
h[17] | ||
), s.$on( | ||
"next", | ||
/*onNext*/ | ||
c[18] | ||
), bt(s.$$.fragment), x(s.$$.fragment, 1), $t(s, n, null)) : s = null; | ||
h[18] | ||
), bt(s.$$.fragment), S(s.$$.fragment, 1), $t(s, n, null)) : s = null; | ||
} | ||
(!a || v & /*$className*/ | ||
(!a || m & /*$className*/ | ||
32 && i !== (i = "thisway-popover__container " + /*$className*/ | ||
c[5])) && M(n, "class", i), l && Be(l.update) && v & /*$popoverStyle$*/ | ||
h[5])) && P(n, "class", i), l && Be(l.update) && m & /*$popoverStyle$*/ | ||
64 && l.update.call( | ||
null, | ||
/*$popoverStyle$*/ | ||
c[6] | ||
), v & /*position*/ | ||
h[6] | ||
), m & /*position*/ | ||
1 && G( | ||
@@ -678,4 +678,4 @@ t, | ||
/*position*/ | ||
c[0] | ||
), v & /*$step$*/ | ||
h[0] | ||
), m & /*$step$*/ | ||
4 && G( | ||
@@ -685,4 +685,4 @@ t, | ||
/*$step$*/ | ||
c[2] ? "block" : "none" | ||
), v & /*$zIndex$*/ | ||
h[2] ? "block" : "none" | ||
), m & /*$zIndex$*/ | ||
8 && G( | ||
@@ -692,4 +692,4 @@ t, | ||
/*$zIndex$*/ | ||
c[3] | ||
), v & /*$theme$*/ | ||
h[3] | ||
), m & /*$theme$*/ | ||
16 && G( | ||
@@ -699,4 +699,4 @@ t, | ||
/*$theme$*/ | ||
c[4].primaryColor | ||
), v & /*$theme$*/ | ||
h[4].primaryColor | ||
), m & /*$theme$*/ | ||
16 && G( | ||
@@ -706,4 +706,4 @@ t, | ||
/*$theme$*/ | ||
c[4].textColor | ||
), v & /*$theme$*/ | ||
h[4].textColor | ||
), m & /*$theme$*/ | ||
16 && G( | ||
@@ -713,87 +713,87 @@ t, | ||
/*$theme$*/ | ||
c[4].descColor | ||
h[4].descColor | ||
); | ||
}, | ||
i(c) { | ||
a || (x(o.$$.fragment, c), s && x(s.$$.fragment, c), a = !0); | ||
i(h) { | ||
a || (S(o.$$.fragment, h), s && S(s.$$.fragment, h), a = !0); | ||
}, | ||
o(c) { | ||
A(o.$$.fragment, c), s && A(s.$$.fragment, c), a = !1; | ||
o(h) { | ||
A(o.$$.fragment, h), s && A(s.$$.fragment, h), a = !1; | ||
}, | ||
d(c) { | ||
c && D(t), Ct(o), s && Ct(s), e[19](null), p = !1, fo(h); | ||
d(h) { | ||
h && Y(t), Ct(o), s && Ct(s), e[19](null), c = !1, ho(f); | ||
} | ||
}; | ||
} | ||
function Bo(e, t, o) { | ||
let r, n, s, i, l, a, p, { position: h = "fixed" } = t; | ||
function Do(e, t, o) { | ||
let r, n, s, i, l, a, c, { position: f = "fixed" } = t; | ||
const w = Po(); | ||
E(e, w, (d) => o(2, r = d)); | ||
const g = R(ee), c = R(re), v = R(Bt), k = L([w, g], ([d, V]) => { | ||
L(e, w, (d) => o(2, r = d)); | ||
const b = F(ee), h = F(re), m = F(Bt), u = E([w, b], ([d, B]) => { | ||
if (d) | ||
return v.getPopoverComponent(d, V); | ||
return m.getPopoverComponent(d, B); | ||
}); | ||
E(e, k, (d) => o(7, a = d)); | ||
const y = Y(g, "zIndex", 1e4); | ||
E(e, y, (d) => o(3, n = d)); | ||
const T = Y(g, "className", ""); | ||
E(e, T, (d) => o(5, i = d)); | ||
const $ = Ro(); | ||
yo(Ye, $); | ||
const b = Y($, "style"); | ||
let C; | ||
const F = L( | ||
b, | ||
(d, V) => { | ||
L(e, u, (d) => o(7, a = d)); | ||
const $ = j(b, "zIndex", 1e4); | ||
L(e, $, (d) => o(3, n = d)); | ||
const C = j(b, "className", ""); | ||
L(e, C, (d) => o(5, i = d)); | ||
const v = Ro(); | ||
bo(je, v); | ||
const T = j(v, "style"); | ||
let k; | ||
const V = E( | ||
T, | ||
(d, B) => { | ||
if (!d) { | ||
V(Jt); | ||
B(Jt); | ||
return; | ||
} | ||
const X = { x: d.x, y: d.y }; | ||
if (!C) { | ||
C = Qt(X, { duration: 300, easing: te }), V(d); | ||
const K = { x: d.x, y: d.y }; | ||
if (!k) { | ||
k = Qt(K, { duration: 300, easing: te }), B(d); | ||
return; | ||
} | ||
const K = C.subscribe(({ x: I, y: W }) => { | ||
V({ ...d, x: I, y: W }); | ||
const X = k.subscribe(({ x: M, y: W }) => { | ||
B({ ...d, x: M, y: W }); | ||
}); | ||
return C.set(X), K; | ||
return k.set(K), X; | ||
}, | ||
Jt | ||
), N = L(F, ko); | ||
E(e, N, (d) => o(6, l = d)); | ||
const j = Ue(); | ||
E(e, j, (d) => o(4, s = d)); | ||
const S = R(Mt), P = (d) => { | ||
!S.isActive() || H(g).keyboardControl === !1 || d.key !== "Escape" && (d.key === "ArrowRight" ? S.goNextStep() : d.key === "ArrowLeft" && S.goPrevStep()); | ||
}, m = () => S.onClose(), f = () => S.goPrevStep(), O = () => { | ||
v.onDone ? v.onDone() : S.onClose(); | ||
), x = E(V, ko); | ||
L(e, x, (d) => o(6, l = d)); | ||
const R = Ue(); | ||
L(e, R, (d) => o(4, s = d)); | ||
const O = F(Pt), I = (d) => { | ||
!O.isActive() || H(b).keyboardControl === !1 || d.key !== "Escape" && (d.key === "ArrowRight" ? O.goNextStep() : d.key === "ArrowLeft" && O.goPrevStep()); | ||
}, y = () => O.onClose(), p = () => O.goPrevStep(), N = () => { | ||
m.onDone ? m.onDone() : O.onClose(); | ||
}, J = async () => { | ||
var X, K; | ||
const d = S.getNextStepId(); | ||
var K, X; | ||
const d = O.getNextStepId(); | ||
if (d === void 0) | ||
return; | ||
const V = (X = S.getActiveStep().step) == null ? void 0 : X.id; | ||
if (v.beforeStepChange) { | ||
const I = new AbortController(); | ||
if (await v.beforeStepChange(d, V, I), I.signal.aborted || ((K = S.getActiveStep().step) == null ? void 0 : K.id) !== V) | ||
const B = (K = O.getActiveStep().step) == null ? void 0 : K.id; | ||
if (m.beforeStepChange) { | ||
const M = new AbortController(); | ||
if (await m.beforeStepChange(d, B, M), M.signal.aborted || ((X = O.getActiveStep().step) == null ? void 0 : X.id) !== B) | ||
return; | ||
} | ||
S.goNextStep(); | ||
O.goNextStep(); | ||
}; | ||
to(() => { | ||
c.set(p); | ||
h.set(c); | ||
}), Ae(() => { | ||
c.set(void 0); | ||
h.set(void 0); | ||
}); | ||
function u(d) { | ||
ho[d ? "unshift" : "push"](() => { | ||
p = d, o(1, p); | ||
function _(d) { | ||
uo[d ? "unshift" : "push"](() => { | ||
c = d, o(1, c); | ||
}); | ||
} | ||
return e.$$set = (d) => { | ||
"position" in d && o(0, h = d.position); | ||
"position" in d && o(0, f = d.position); | ||
}, [ | ||
h, | ||
p, | ||
f, | ||
c, | ||
r, | ||
@@ -806,21 +806,21 @@ n, | ||
w, | ||
k, | ||
u, | ||
$, | ||
C, | ||
x, | ||
R, | ||
I, | ||
y, | ||
T, | ||
p, | ||
N, | ||
j, | ||
P, | ||
m, | ||
f, | ||
O, | ||
J, | ||
u | ||
_ | ||
]; | ||
} | ||
class Do extends Tt { | ||
class Yo extends kt { | ||
constructor(t) { | ||
super(), xt(this, t, Bo, Fo, St, { position: 0 }, Vo); | ||
super(), xt(this, t, Do, Bo, St, { position: 0 }, Fo); | ||
} | ||
} | ||
const ve = (e) => typeof e == "object" && e != null && e.nodeType === 1, ge = (e, t) => t && e === "hidden" ? !1 : e !== "visible" && e !== "clip", jo = (e) => { | ||
const ge = (e) => typeof e == "object" && e != null && e.nodeType === 1, ve = (e, t) => t && e === "hidden" ? !1 : e !== "visible" && e !== "clip", jo = (e) => { | ||
if (!e.ownerDocument || !e.ownerDocument.defaultView) | ||
@@ -833,12 +833,12 @@ return null; | ||
} | ||
}, Yo = (e) => { | ||
}, Go = (e) => { | ||
const t = jo(e); | ||
return t ? t.clientHeight < e.scrollHeight || t.clientWidth < e.scrollWidth : !1; | ||
}, Xt = (e, t) => { | ||
}, Kt = (e, t) => { | ||
if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) { | ||
const o = getComputedStyle(e, null); | ||
return ge(o.overflowY, t) || ge(o.overflowX, t) || Yo(e); | ||
return ve(o.overflowY, t) || ve(o.overflowX, t) || Go(e); | ||
} | ||
return !1; | ||
}, Ht = (e, t, o, r, n, s, i, l) => s < e && i > t || s > e && i < t ? 0 : s <= e && l <= o || i >= t && l >= o ? s - e - r : i > t && l < o || s < e && l > o ? i - t + n : 0, Go = (e) => { | ||
}, Ht = (e, t, o, r, n, s, i, l) => s < e && i > t || s > e && i < t ? 0 : s <= e && l <= o || i >= t && l >= o ? s - e - r : i > t && l < o || s < e && l > o ? i - t + n : 0, Xo = (e) => { | ||
const t = e.parentElement; | ||
@@ -854,116 +854,116 @@ return t ?? (e.getRootNode().host || null); | ||
}; | ||
}, Xo = (e, t) => { | ||
var J, u, d, V, X, K; | ||
}, Uo = (e, t) => { | ||
var J, _, d, B, K, X; | ||
if (typeof document > "u") | ||
return []; | ||
const { scrollMode: o, block: r, inline: n, boundary: s, skipOverflowHiddenElements: i } = t, l = typeof s == "function" ? s : (I) => I !== s; | ||
if (!ve(e)) | ||
const { scrollMode: o, block: r, inline: n, boundary: s, skipOverflowHiddenElements: i } = t, l = typeof s == "function" ? s : (M) => M !== s; | ||
if (!ge(e)) | ||
throw new TypeError("Invalid target"); | ||
const a = document.scrollingElement || document.documentElement, p = []; | ||
let h = e; | ||
for (; ve(h) && l(h); ) { | ||
if (h = Go(h), h === a) { | ||
p.push(h); | ||
const a = document.scrollingElement || document.documentElement, c = []; | ||
let f = e; | ||
for (; ge(f) && l(f); ) { | ||
if (f = Xo(f), f === a) { | ||
c.push(f); | ||
break; | ||
} | ||
h != null && h === document.body && Xt(h) && !Xt(document.documentElement) || h != null && Xt(h, i) && p.push(h); | ||
f != null && f === document.body && Kt(f) && !Kt(document.documentElement) || f != null && Kt(f, i) && c.push(f); | ||
} | ||
const w = ((J = window.visualViewport) == null ? void 0 : J.width) ?? innerWidth, g = ((u = window.visualViewport) == null ? void 0 : u.height) ?? innerHeight, { scrollX: c, scrollY: v } = window, k = e.getBoundingClientRect(), y = k.top - (((d = t.offset) == null ? void 0 : d.top) ?? 0), T = k.bottom + (((V = t.offset) == null ? void 0 : V.bottom) ?? 0), $ = k.left - (((X = t.offset) == null ? void 0 : X.left) ?? 0), b = k.right + (((K = t.offset) == null ? void 0 : K.right) ?? 0), C = T - y, F = b - $, { top: N, right: j, bottom: S, left: P } = Ko(e); | ||
let m = r === "start" || r === "nearest" ? y - N : r === "end" ? T + S : y + C / 2 - N + S, f = n === "center" ? $ + F / 2 - P + j : n === "end" ? b + j : $ - P; | ||
const O = []; | ||
for (let I = 0; I < p.length; I++) { | ||
const W = p[I], { height: Q, width: ot, top: pt, right: gt, bottom: _, left: tt } = W.getBoundingClientRect(); | ||
if (o === "if-needed" && y >= 0 && $ >= 0 && T <= g && b <= w && y >= pt && T <= _ && $ >= tt && b <= gt) | ||
return O; | ||
const ct = getComputedStyle(W), ft = parseInt(ct.borderLeftWidth, 10), at = parseInt(ct.borderTopWidth, 10), ht = parseInt(ct.borderRightWidth, 10), Lt = parseInt(ct.borderBottomWidth, 10); | ||
let z = 0, q = 0; | ||
const It = "offsetWidth" in W ? W.offsetWidth - W.clientWidth - ft - ht : 0, Et = "offsetHeight" in W ? W.offsetHeight - W.clientHeight - at - Lt : 0, Yt = "offsetWidth" in W ? W.offsetWidth === 0 ? 0 : ot / W.offsetWidth : 0, Gt = "offsetHeight" in W ? W.offsetHeight === 0 ? 0 : Q / W.offsetHeight : 0; | ||
const w = ((J = window.visualViewport) == null ? void 0 : J.width) ?? innerWidth, b = ((_ = window.visualViewport) == null ? void 0 : _.height) ?? innerHeight, { scrollX: h, scrollY: m } = window, u = e.getBoundingClientRect(), $ = u.top - (((d = t.offset) == null ? void 0 : d.top) ?? 0), C = u.bottom + (((B = t.offset) == null ? void 0 : B.bottom) ?? 0), v = u.left - (((K = t.offset) == null ? void 0 : K.left) ?? 0), T = u.right + (((X = t.offset) == null ? void 0 : X.right) ?? 0), k = C - $, V = T - v, { top: x, right: R, bottom: O, left: I } = Ko(e); | ||
let y = r === "start" || r === "nearest" ? $ - x : r === "end" ? C + O : $ + k / 2 - x + O, p = n === "center" ? v + V / 2 - I + R : n === "end" ? T + R : v - I; | ||
const N = []; | ||
for (let M = 0; M < c.length; M++) { | ||
const W = c[M], { height: Q, width: ot, top: ct, right: vt, bottom: g, left: tt } = W.getBoundingClientRect(); | ||
if (o === "if-needed" && $ >= 0 && v >= 0 && C <= b && T <= w && $ >= ct && C <= g && v >= tt && T <= vt) | ||
return N; | ||
const pt = getComputedStyle(W), ft = parseInt(pt.borderLeftWidth, 10), at = parseInt(pt.borderTopWidth, 10), ht = parseInt(pt.borderRightWidth, 10), Et = parseInt(pt.borderBottomWidth, 10); | ||
let q = 0, z = 0; | ||
const Mt = "offsetWidth" in W ? W.offsetWidth - W.clientWidth - ft - ht : 0, Lt = "offsetHeight" in W ? W.offsetHeight - W.clientHeight - at - Et : 0, jt = "offsetWidth" in W ? W.offsetWidth === 0 ? 0 : ot / W.offsetWidth : 0, Gt = "offsetHeight" in W ? W.offsetHeight === 0 ? 0 : Q / W.offsetHeight : 0; | ||
if (a === W) | ||
r === "start" ? z = m : r === "end" ? z = m - g : r === "nearest" ? z = Ht( | ||
v, | ||
v + g, | ||
g, | ||
r === "start" ? q = y : r === "end" ? q = y - b : r === "nearest" ? q = Ht( | ||
m, | ||
m + b, | ||
b, | ||
at, | ||
Lt, | ||
v + m, | ||
v + m + C, | ||
C | ||
) : z = m - g / 2, n === "start" ? q = f : n === "center" ? q = f - w / 2 : n === "end" ? q = f - w : q = Ht( | ||
c, | ||
c + w, | ||
Et, | ||
m + y, | ||
m + y + k, | ||
k | ||
) : q = y - b / 2, n === "start" ? z = p : n === "center" ? z = p - w / 2 : n === "end" ? z = p - w : z = Ht( | ||
h, | ||
h + w, | ||
w, | ||
ft, | ||
ht, | ||
c + f, | ||
c + f + F, | ||
F | ||
), z = Math.max(0, z + v), q = Math.max(0, q + c); | ||
h + p, | ||
h + p + V, | ||
V | ||
), q = Math.max(0, q + m), z = Math.max(0, z + h); | ||
else { | ||
r === "start" ? z = m - pt - at : r === "end" ? z = m - _ + Lt + Et : r === "nearest" ? z = Ht( | ||
pt, | ||
_, | ||
r === "start" ? q = y - ct - at : r === "end" ? q = y - g + Et + Lt : r === "nearest" ? q = Ht( | ||
ct, | ||
g, | ||
Q, | ||
at, | ||
Lt + Et, | ||
m, | ||
m + C, | ||
C | ||
) : z = m - (pt + Q / 2) + Et / 2, n === "start" ? q = f - tt - ft : n === "center" ? q = f - (tt + ot / 2) + It / 2 : n === "end" ? q = f - gt + ht + It : q = Ht( | ||
Et + Lt, | ||
y, | ||
y + k, | ||
k | ||
) : q = y - (ct + Q / 2) + Lt / 2, n === "start" ? z = p - tt - ft : n === "center" ? z = p - (tt + ot / 2) + Mt / 2 : n === "end" ? z = p - vt + ht + Mt : z = Ht( | ||
tt, | ||
gt, | ||
vt, | ||
ot, | ||
ft, | ||
ht + It, | ||
f, | ||
f + F, | ||
F | ||
ht + Mt, | ||
p, | ||
p + V, | ||
V | ||
); | ||
const { scrollLeft: ie, scrollTop: le } = W; | ||
z = Gt === 0 ? 0 : Math.max( | ||
q = Gt === 0 ? 0 : Math.max( | ||
0, | ||
Math.min(le + z / Gt, W.scrollHeight - Q / Gt + Et) | ||
), q = Yt === 0 ? 0 : Math.max( | ||
Math.min(le + q / Gt, W.scrollHeight - Q / Gt + Lt) | ||
), z = jt === 0 ? 0 : Math.max( | ||
0, | ||
Math.min(ie + q / Yt, W.scrollWidth - ot / Yt + It) | ||
), m += le - z, f += ie - q; | ||
Math.min(ie + z / jt, W.scrollWidth - ot / jt + Mt) | ||
), y += le - q, p += ie - z; | ||
} | ||
O.push({ el: W, top: z, left: q }); | ||
N.push({ el: W, top: q, left: z }); | ||
} | ||
return O; | ||
}, Uo = (e, t, o) => { | ||
const r = o.popover, n = o.highlight, s = Y(r, "position"); | ||
return L([e, t, s], ([{ element: i, step: l }, a, p], h) => { | ||
return N; | ||
}, qo = (e, t, o) => { | ||
const r = o.popover, n = o.highlight, s = j(r, "position"); | ||
return E([e, t, s], ([{ element: i, step: l }, a, c], f) => { | ||
if (!i || i === lt) { | ||
h({ status: "STOP" }); | ||
f({ status: "STOP" }); | ||
return; | ||
} | ||
const w = H(r), g = qe(p), c = g[0], v = g[1], k = H(n), y = (w.offset < 10 ? 10 : w.offset) + k.padding + k.borderWidth, T = c ? lo[c] : "nearest", $ = v ? v.toLocaleLowerCase() : "nearest"; | ||
let b = "nearest", C = "nearest"; | ||
const F = (l == null ? void 0 : l.scrollOffset) || {}, N = { | ||
left: y + (F.left || 0), | ||
right: y + (F.right || 0), | ||
top: y + (F.top || 0), | ||
bottom: y + (F.bottom || 0) | ||
const w = H(r), b = ze(c), h = b[0], m = b[1], u = H(n), $ = (w.offset < 10 ? 10 : w.offset) + u.padding + u.borderWidth, C = h ? ao[h] : "nearest", v = m ? m.toLocaleLowerCase() : "nearest"; | ||
let T = "nearest", k = "nearest"; | ||
const V = (l == null ? void 0 : l.scrollOffset) || {}, x = { | ||
left: $ + (V.left || 0), | ||
right: $ + (V.right || 0), | ||
top: $ + (V.top || 0), | ||
bottom: $ + (V.bottom || 0) | ||
}; | ||
c && c !== "OVER" && (ao.includes(c) ? (b = T, C = $, N[c.toLocaleLowerCase()] += (a == null ? void 0 : a.height) || 0) : (b = $, C = T, N[c.toLocaleLowerCase()] += (a == null ? void 0 : a.width) || 0)); | ||
const j = Xo(i, { | ||
h && h !== "OVER" && (co.includes(h) ? (T = C, k = v, x[h.toLocaleLowerCase()] += (a == null ? void 0 : a.height) || 0) : (T = v, k = C, x[h.toLocaleLowerCase()] += (a == null ? void 0 : a.width) || 0)); | ||
const R = Uo(i, { | ||
scrollMode: "if-needed", | ||
block: b, | ||
inline: C, | ||
offset: N | ||
}), S = [], P = []; | ||
if (j.length > 0) { | ||
h({ status: "SCROLLING" }); | ||
let m = -1; | ||
for (const { el: f, top: O, left: J } of j) { | ||
if (m++, f.scrollTop == O && f.scrollLeft == J) | ||
block: T, | ||
inline: k, | ||
offset: x | ||
}), O = [], I = []; | ||
if (R.length > 0) { | ||
f({ status: "SCROLLING" }); | ||
let y = -1; | ||
for (const { el: p, top: N, left: J } of R) { | ||
if (y++, p.scrollTop == N && p.scrollLeft == J) | ||
continue; | ||
const u = Math.max(Math.abs(O - f.scrollTop), Math.abs(J - f.scrollLeft)); | ||
P[m] = Qt( | ||
const _ = Math.max(Math.abs(N - p.scrollTop), Math.abs(J - p.scrollLeft)); | ||
I[y] = Qt( | ||
{ | ||
top: f.scrollTop, | ||
left: f.scrollTop | ||
top: p.scrollTop, | ||
left: p.scrollTop | ||
}, | ||
{ | ||
duration: Math.min(u, 200), | ||
duration: Math.min(_, 200), | ||
// 300ms maximum | ||
@@ -973,13 +973,13 @@ easing: te | ||
); | ||
const d = P[m].subscribe(({ top: V, left: X }) => { | ||
f.scrollTop = V, f.scrollLeft = X, X == J && V === O && h({ status: "STOP" }); | ||
const d = I[y].subscribe(({ top: B, left: K }) => { | ||
p.scrollTop = B, p.scrollLeft = K, K == J && B === N && f({ status: "STOP" }); | ||
}); | ||
S.push(d), P[m].set({ top: O, left: J }); | ||
O.push(d), I[y].set({ top: N, left: J }); | ||
} | ||
P.length === 0 && h({ status: "STOP" }); | ||
I.length === 0 && f({ status: "STOP" }); | ||
} else | ||
h({ status: "STOP" }); | ||
f({ status: "STOP" }); | ||
return () => { | ||
for (const m of S) | ||
m(); | ||
for (const y of O) | ||
y(); | ||
}; | ||
@@ -989,3 +989,3 @@ }); | ||
let r; | ||
return L( | ||
return E( | ||
e.activeStep$, | ||
@@ -1021,28 +1021,42 @@ (n, s) => { | ||
}; | ||
function qo(e, t, o, r) { | ||
function Zo(e, t, o, r) { | ||
let n; | ||
return L(e, (s, i) => { | ||
const { element: l } = H(t); | ||
return E(e, (s, i) => { | ||
const { element: l, step: a } = H(t); | ||
if (!l) | ||
return i(l), ne; | ||
if (l === lt || H(o.popover).position === "SCREEN") { | ||
const c = Ut(n || window, "resize", () => { | ||
const u = Ut(n || window, "resize", () => { | ||
i(Wt(lt)); | ||
}); | ||
return i(Wt(lt)), c; | ||
return i(Wt(lt)), u; | ||
} | ||
const a = () => l.getBoundingClientRect(), p = () => { | ||
const c = a != null && a.onlyHighlightChildren ? Array.from(l.children) : [l], f = () => { | ||
let u = Number.POSITIVE_INFINITY, $ = Number.POSITIVE_INFINITY, C = Number.NEGATIVE_INFINITY, v = Number.NEGATIVE_INFINITY; | ||
for (const T of c) { | ||
const { x: k, y: V, right: x, bottom: R } = T.getBoundingClientRect(); | ||
k < u && (u = k), V < $ && ($ = V), x > C && (C = x), R > v && (v = R); | ||
} | ||
return { | ||
x: u, | ||
y: $, | ||
width: C - u, | ||
height: v - $ | ||
}; | ||
}, w = ro(() => { | ||
if (H(r) && s.status === "STOP") { | ||
const c = a(); | ||
c.width === 0 || c.height === 0 ? i(Wt(lt)) : i(Wt(c)); | ||
const u = f(); | ||
u.width === 0 || u.height === 0 ? i(Wt(lt)) : i(Wt(u)); | ||
} | ||
}; | ||
!n && l && (n = l.ownerDocument.defaultView); | ||
const h = Ut(n || window, "resize", p), w = Ut(n || window, "scroll", p), g = We(l, p); | ||
}); | ||
n || (n = l.ownerDocument.defaultView); | ||
const b = Ut(n || window, "resize", w), h = Ut(n || window, "scroll", w), m = c.map((u) => We(u, w)); | ||
return () => { | ||
h(), w(), g(); | ||
b(), h(); | ||
for (const u of m) | ||
u(); | ||
}; | ||
}); | ||
} | ||
const Zo = (e) => L(e, (t, o) => t ? We(t, () => { | ||
const Jo = (e) => E(e, (t, o) => t ? We(t, () => { | ||
const r = t.clientWidth, n = t.clientHeight; | ||
@@ -1053,4 +1067,4 @@ o({ | ||
}); | ||
}) : (o(ro), ne)); | ||
class Jo extends $o { | ||
}) : (o(so), ne)); | ||
class Qo extends Co { | ||
constructor(o, r, n, s) { | ||
@@ -1062,21 +1076,21 @@ super(o); | ||
this.delegate = r; | ||
const i = r.container ?? document.body, l = [], a = kt(!0), p = zo(o, r, a), h = Y(p, "step"), w = (b, C) => { | ||
const F = Y(s, b), N = Y(h, b); | ||
return L( | ||
[F, N], | ||
(j) => xo(C, ...j) | ||
const i = r.container ?? document.body, l = [], a = Tt(!0), c = zo(o, r, a), f = j(c, "step"), w = (T, k) => { | ||
const V = j(s, T), x = j(f, T); | ||
return E( | ||
[V, x], | ||
(R) => So(k, ...R) | ||
); | ||
}, g = { | ||
}, b = { | ||
popover: w("popover", po), | ||
highlight: w("highlight", co), | ||
theme: L(w("theme", {}), Oo) | ||
}, c = kt(void 0), v = Zo(c), k = Uo(p, v, g), y = qo( | ||
k, | ||
p, | ||
g, | ||
highlight: w("highlight", fo), | ||
theme: E(w("theme", {}), No) | ||
}, h = Tt(void 0), m = Jo(h), u = qo(c, m, b), $ = Zo( | ||
u, | ||
c, | ||
b, | ||
a | ||
), T = r.getTotalCount(o), $ = De(n); | ||
$.set(Mt, this).set(oe, y).set(ee, s).set(re, c).set(je, v).set(se, T).set(Bt, r).set(Dt, p).set(jt, g), this.subscriptions = l, this.view = new Do({ | ||
), C = r.getTotalCount(o), v = De(n); | ||
v.set(Pt, this).set(oe, $).set(ee, s).set(re, h).set(Ye, m).set(se, C).set(Bt, r).set(Dt, c).set(Yt, b), this.subscriptions = l, this.view = new Yo({ | ||
target: i, | ||
context: $, | ||
context: v, | ||
props: { | ||
@@ -1097,6 +1111,6 @@ position: i.tagName.toLowerCase() === "body" ? "fixed" : "absolute" | ||
} | ||
function Qo(e) { | ||
Vt(e, "svelte-1fc4ct7", ".thisway-progress{font-size:14px}"); | ||
function tr(e) { | ||
Rt(e, "svelte-1fc4ct7", ".thisway-progress{font-size:14px}"); | ||
} | ||
function tr(e) { | ||
function er(e) { | ||
let t, o; | ||
@@ -1108,10 +1122,10 @@ return { | ||
e[0] | ||
), M(t, "class", "thisway-progress"); | ||
), P(t, "class", "thisway-progress"); | ||
}, | ||
m(r, n) { | ||
B(r, t, n), U(t, o); | ||
D(r, t, n), U(t, o); | ||
}, | ||
p(r, [n]) { | ||
n & /*$progress$*/ | ||
1 && Pt( | ||
1 && It( | ||
o, | ||
@@ -1125,33 +1139,33 @@ /*$progress$*/ | ||
d(r) { | ||
r && D(t); | ||
r && Y(t); | ||
} | ||
}; | ||
} | ||
function er(e, t, o) { | ||
function or(e, t, o) { | ||
let r; | ||
const n = R(se), s = go(), i = L([s, n], ([l, a]) => a > 1 ? `${l + 1}/${a}` : ""); | ||
return E(e, i, (l) => o(0, r = l)), [r, i]; | ||
const n = F(se), s = yo(), i = E([s, n], ([l, a]) => a > 1 ? `${l + 1}/${a}` : ""); | ||
return L(e, i, (l) => o(0, r = l)), [r, i]; | ||
} | ||
class Ze extends Tt { | ||
class Ze extends kt { | ||
constructor(t) { | ||
super(), xt(this, t, er, tr, St, {}, Qo); | ||
super(), xt(this, t, or, er, St, {}, tr); | ||
} | ||
} | ||
function or(e) { | ||
Vt(e, "svelte-lwbrln", "@keyframes reduction{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}.thisway-stretch{margin:auto}.thisway-popover{animation:reduction 200ms linear;display:flex;flex-direction:column;padding:10px 16px;max-width:280px;min-width:280px;border-radius:10px;overflow:visible;background-color:var(--thisway-color-primary);color:var(--thisway-color-text);position:relative;box-shadow:var(--thisway-default-shadow)}.thisway-popover.thisway-popover__mode-1 .thisway-popover-description{background-color:var(--thisway-color-primary);color:var(--thisway-color-text)}.thisway-popover.thisway-popover__mode-1 .thisway-progress{margin-right:auto}.thisway-popover.thisway-popover__mode-2 .thisway-popover-title{order:2}.thisway-popover.thisway-popover__mode-2 .thisway-popover-description{background-color:var(--thisway-color-primary);color:var(--thisway-color-text);order:3}.thisway-popover.thisway-popover__mode-2 .thisway-popover-footer{order:4;justify-content:flex-end}.thisway-popover.thisway-popover__mode-2 .thisway-popover-close{top:14px;right:14px}.thisway-popover.thisway-popover__mode-2 .thisway-progress{font-size:20px;order:1}.thisway-popover.thisway-popover__mode-3{padding-top:0;background:linear-gradient(to bottom, var(--thisway-color-primary) 40px, var(--thisway-color-text) 40px)}.thisway-popover.thisway-popover__mode-3.thisway-popover-left .thisway-popover__arrow-center,.thisway-popover.thisway-popover__mode-3.thisway-popover-left .thisway-popover__arrow-end,.thisway-popover.thisway-popover__mode-3.thisway-popover-right .thisway-popover__arrow-center,.thisway-popover.thisway-popover__mode-3.thisway-popover-right .thisway-popover__arrow-end{background-color:white}.thisway-popover.thisway-popover__mode-3.thisway-popover-top .thisway-popover__arrow-start,.thisway-popover.thisway-popover__mode-3.thisway-popover-top .thisway-popover__arrow-center,.thisway-popover.thisway-popover__mode-3.thisway-popover-top .thisway-popover__arrow-end{background-color:white}.thisway-popover.thisway-popover__mode-3 .thisway-popover-title{line-height:40px;height:40px;font-size:18px;order:1;background-color:var(--thisway-color-primary)}.thisway-popover.thisway-popover__mode-3 .thisway-popover-description{color:#333333;order:3}.thisway-popover.thisway-popover__mode-3 .thisway-popover-footer{order:4}.thisway-popover.thisway-popover__mode-3 .thisway-popover-footer button{margin-left:0;margin-right:10px}.thisway-popover.thisway-popover__mode-3 .thisway-popover-prev{background-color:var(--thisway-color-text);color:var(--thisway-color-primary);border:1px solid var(--thisway-color-primary);flex:0 0 30px;height:30px;border-radius:50%;padding:0}.thisway-popover.thisway-popover__mode-3 .thisway-popover-prev svg{display:inline-block;margin:4px 0 0;padding:0}.thisway-popover.thisway-popover__mode-3 .thisway-popover-next{background-color:var(--thisway-color-primary);color:var(--thisway-color-text);border:1px solid var(--thisway-color-text);max-width:210px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.thisway-popover.thisway-popover__mode-3 .thisway-popover-close{top:8px;right:10px}.thisway-popover.thisway-popover__mode-3 .thisway-progress{color:#999;margin:10px 0 5px;order:2}.thisway-popover-title{font-size:20px;font-style:normal;font-weight:400;line-height:35px;height:35px;margin:0;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center}.thisway-popover-description{margin-top:5px;margin-bottom:0;white-space:pre-line;font-size:14px;line-height:20px;font-style:normal;word-wrap:break-word}.thisway-popover-description a{text-decoration:underline}.thisway-popover-footer{margin-top:10px;display:flex;align-items:center}.thisway-popover-footer button{text-decoration:none;margin-left:10px;cursor:pointer;outline:0;height:30px;border-radius:50px;padding:0 18px;font-size:13px;line-height:20px}.thisway-popover-top .thisway-popover__arrow{bottom:0;transform:translate(-50%, 50%) rotate(45deg)}.thisway-popover-bottom .thisway-popover__arrow{top:0;transform:translate(-50%, -50%) rotate(45deg)}.thisway-popover-left .thisway-popover__arrow{right:0;transform:translate(50%, -50%) rotate(45deg)}.thisway-popover-right .thisway-popover__arrow{left:0;transform:translate(-50%, -50%) rotate(45deg)}.thisway-popover__arrow{position:absolute;width:10px;height:10px;display:block;background-color:var(--thisway-color-primary)}.thisway-popover-right .thisway-popover__arrow-start,.thisway-popover-left .thisway-popover__arrow-start{top:20px}.thisway-popover-right .thisway-popover__arrow-center,.thisway-popover-left .thisway-popover__arrow-center{top:50%}.thisway-popover-right .thisway-popover__arrow-end,.thisway-popover-left .thisway-popover__arrow-end{bottom:10px}.thisway-popover-top .thisway-popover__arrow-start,.thisway-popover-bottom .thisway-popover__arrow-start{left:20px}.thisway-popover-top .thisway-popover__arrow-center,.thisway-popover-bottom .thisway-popover__arrow-center{left:50%}.thisway-popover-top .thisway-popover__arrow-end,.thisway-popover-bottom .thisway-popover__arrow-end{right:10px}.thisway-popover-screen .thisway-popover__arrow,.thisway-popover-over .thisway-popover__arrow{display:none}.thisway-popover-prev{background-color:var(--thisway-color-primary);color:var(--thisway-color-text);border:1px solid var(--thisway-color-text)}.thisway-popover-next{background-color:var(--thisway-color-text);color:var(--thisway-color-primary);border:1px solid var(--thisway-color-primary)}.thisway-popover-close{width:24px;height:24px;position:absolute;opacity:0.8;display:flex;align-items:center;justify-content:center;padding:0;border:none;color:var(--thisway-color-text);top:6px;right:6px;background-color:var(--thisway-color-primary);z-index:1}.thisway-popover-close:hover{opacity:1;border:none}"); | ||
function rr(e) { | ||
Rt(e, "svelte-lwbrln", "@keyframes reduction{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}.thisway-stretch{margin:auto}.thisway-popover{animation:reduction 200ms linear;display:flex;flex-direction:column;padding:10px 16px;max-width:280px;min-width:280px;border-radius:10px;overflow:visible;background-color:var(--thisway-color-primary);color:var(--thisway-color-text);position:relative;box-shadow:var(--thisway-default-shadow)}.thisway-popover.thisway-popover__mode-1 .thisway-popover-description{background-color:var(--thisway-color-primary);color:var(--thisway-color-text)}.thisway-popover.thisway-popover__mode-1 .thisway-progress{margin-right:auto}.thisway-popover.thisway-popover__mode-2 .thisway-popover-title{order:2}.thisway-popover.thisway-popover__mode-2 .thisway-popover-description{background-color:var(--thisway-color-primary);color:var(--thisway-color-text);order:3}.thisway-popover.thisway-popover__mode-2 .thisway-popover-footer{order:4;justify-content:flex-end}.thisway-popover.thisway-popover__mode-2 .thisway-popover-close{top:14px;right:14px}.thisway-popover.thisway-popover__mode-2 .thisway-progress{font-size:20px;order:1}.thisway-popover.thisway-popover__mode-3{padding-top:0;background:linear-gradient(to bottom, var(--thisway-color-primary) 40px, var(--thisway-color-text) 40px)}.thisway-popover.thisway-popover__mode-3.thisway-popover-left .thisway-popover__arrow-center,.thisway-popover.thisway-popover__mode-3.thisway-popover-left .thisway-popover__arrow-end,.thisway-popover.thisway-popover__mode-3.thisway-popover-right .thisway-popover__arrow-center,.thisway-popover.thisway-popover__mode-3.thisway-popover-right .thisway-popover__arrow-end{background-color:white}.thisway-popover.thisway-popover__mode-3.thisway-popover-top .thisway-popover__arrow-start,.thisway-popover.thisway-popover__mode-3.thisway-popover-top .thisway-popover__arrow-center,.thisway-popover.thisway-popover__mode-3.thisway-popover-top .thisway-popover__arrow-end{background-color:white}.thisway-popover.thisway-popover__mode-3 .thisway-popover-title{line-height:40px;height:40px;font-size:18px;order:1;background-color:var(--thisway-color-primary)}.thisway-popover.thisway-popover__mode-3 .thisway-popover-description{color:#333333;order:3}.thisway-popover.thisway-popover__mode-3 .thisway-popover-footer{order:4}.thisway-popover.thisway-popover__mode-3 .thisway-popover-footer button{margin-left:0;margin-right:10px}.thisway-popover.thisway-popover__mode-3 .thisway-popover-prev{background-color:var(--thisway-color-text);color:var(--thisway-color-primary);border:1px solid var(--thisway-color-primary);flex:0 0 30px;height:30px;border-radius:50%;padding:0}.thisway-popover.thisway-popover__mode-3 .thisway-popover-prev svg{display:inline-block;margin:4px 0 0;padding:0}.thisway-popover.thisway-popover__mode-3 .thisway-popover-next{background-color:var(--thisway-color-primary);color:var(--thisway-color-text);border:1px solid var(--thisway-color-text);max-width:210px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.thisway-popover.thisway-popover__mode-3 .thisway-popover-close{top:8px;right:10px}.thisway-popover.thisway-popover__mode-3 .thisway-progress{color:#999;margin:10px 0 5px;order:2}.thisway-popover-title{font-size:20px;font-style:normal;font-weight:400;line-height:35px;height:35px;margin:0;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center}.thisway-popover-description{margin-top:5px;margin-bottom:0;white-space:pre-line;font-size:14px;line-height:20px;font-style:normal;word-wrap:break-word}.thisway-popover-description a{text-decoration:underline}.thisway-popover-footer{margin-top:10px;display:flex;align-items:center}.thisway-popover-footer button{text-decoration:none;margin-left:10px;cursor:pointer;outline:0;height:30px;border-radius:50px;padding:0 18px;font-size:13px;line-height:20px}.thisway-popover-top .thisway-popover__arrow{bottom:0;transform:translate(-50%, 50%) rotate(45deg)}.thisway-popover-bottom .thisway-popover__arrow{top:0;transform:translate(-50%, -50%) rotate(45deg)}.thisway-popover-left .thisway-popover__arrow{right:0;transform:translate(50%, -50%) rotate(45deg)}.thisway-popover-right .thisway-popover__arrow{left:0;transform:translate(-50%, -50%) rotate(45deg)}.thisway-popover__arrow{position:absolute;width:10px;height:10px;display:block;background-color:var(--thisway-color-primary)}.thisway-popover-right .thisway-popover__arrow-start,.thisway-popover-left .thisway-popover__arrow-start{top:20px}.thisway-popover-right .thisway-popover__arrow-center,.thisway-popover-left .thisway-popover__arrow-center{top:50%}.thisway-popover-right .thisway-popover__arrow-end,.thisway-popover-left .thisway-popover__arrow-end{bottom:10px}.thisway-popover-top .thisway-popover__arrow-start,.thisway-popover-bottom .thisway-popover__arrow-start{left:20px}.thisway-popover-top .thisway-popover__arrow-center,.thisway-popover-bottom .thisway-popover__arrow-center{left:50%}.thisway-popover-top .thisway-popover__arrow-end,.thisway-popover-bottom .thisway-popover__arrow-end{right:10px}.thisway-popover-screen .thisway-popover__arrow,.thisway-popover-over .thisway-popover__arrow{display:none}.thisway-popover-prev{background-color:var(--thisway-color-primary);color:var(--thisway-color-text);border:1px solid var(--thisway-color-text)}.thisway-popover-next{background-color:var(--thisway-color-text);color:var(--thisway-color-primary);border:1px solid var(--thisway-color-primary)}.thisway-popover-close{width:24px;height:24px;position:absolute;opacity:0.8;display:flex;align-items:center;justify-content:center;padding:0;border:none;color:var(--thisway-color-text);top:6px;right:6px;background-color:var(--thisway-color-primary);z-index:1}.thisway-popover-close:hover{opacity:1;border:none}"); | ||
} | ||
const rr = (e) => ({}), ye = (e) => ({}), sr = (e) => ({}), be = (e) => ({}), nr = (e) => ({}), $e = (e) => ({}), ir = (e) => ({}), Ce = (e) => ({}), lr = (e) => ({}), ke = (e) => ({}); | ||
function Te(e) { | ||
let t, o, r, n, s, i, l, a, p, h, w, g, c, v, k, y, T = ( | ||
const sr = (e) => ({}), ye = (e) => ({}), nr = (e) => ({}), be = (e) => ({}), ir = (e) => ({}), $e = (e) => ({}), lr = (e) => ({}), Ce = (e) => ({}), ar = (e) => ({}), Te = (e) => ({}); | ||
function ke(e) { | ||
let t, o, r, n, s, i, l, a, c, f, w, b, h, m, u, $, C = ( | ||
/*$showCloseButton$*/ | ||
e[6] && xe(e) | ||
), $ = ( | ||
), v = ( | ||
/*$$slots*/ | ||
(e[28].title || /*$title$*/ | ||
e[1]) && Se(e) | ||
), b = ( | ||
), T = ( | ||
/*$$slots*/ | ||
(e[28].description || /*$description$*/ | ||
e[2]) && Oe(e) | ||
), C = ( | ||
), k = ( | ||
/*$layout$*/ | ||
@@ -1161,7 +1175,7 @@ e[4] !== yt && /*$showProgress$*/ | ||
); | ||
const F = ( | ||
const V = ( | ||
/*#slots*/ | ||
e[30].default | ||
), N = wt( | ||
F, | ||
), x = wt( | ||
V, | ||
e, | ||
@@ -1171,7 +1185,7 @@ /*$$scope*/ | ||
null | ||
), j = ( | ||
), R = ( | ||
/*#slots*/ | ||
e[30].footer | ||
), S = wt( | ||
j, | ||
), O = wt( | ||
R, | ||
e, | ||
@@ -1182,14 +1196,14 @@ /*$$scope*/ | ||
); | ||
let P = ( | ||
let I = ( | ||
/*$layout$*/ | ||
e[4] === yt && /*$showProgress$*/ | ||
e[7] && Pe() | ||
), m = ( | ||
e[7] && Ie() | ||
), y = ( | ||
/*$showCtrlBtns$*/ | ||
e[8] && Me(e) | ||
e[8] && Pe(e) | ||
); | ||
return { | ||
c() { | ||
t = Z("div"), o = Z("div"), n = et(), T && T.c(), s = et(), $ && $.c(), i = et(), b && b.c(), l = et(), C && C.c(), a = et(), N && N.c(), p = et(), h = Z("div"), S && S.c(), w = et(), P && P.c(), g = et(), c = Z("div"), v = et(), m && m.c(), M(o, "class", r = "thisway-popover__arrow " + /*$arrowClass$*/ | ||
e[5]), M(c, "class", "thisway-stretch"), M(h, "class", "thisway-popover-footer"), M(t, "class", k = "thisway-popover " + /*$popoverClass$*/ | ||
t = Z("div"), o = Z("div"), n = et(), C && C.c(), s = et(), v && v.c(), i = et(), T && T.c(), l = et(), k && k.c(), a = et(), x && x.c(), c = et(), f = Z("div"), O && O.c(), w = et(), I && I.c(), b = et(), h = Z("div"), m = et(), y && y.c(), P(o, "class", r = "thisway-popover__arrow " + /*$arrowClass$*/ | ||
e[5]), P(h, "class", "thisway-stretch"), P(f, "class", "thisway-popover-footer"), P(t, "class", u = "thisway-popover " + /*$popoverClass$*/ | ||
e[3] + " thisway-popover__" + /*$layout$*/ | ||
@@ -1199,83 +1213,83 @@ e[4] + " " + /*cssClassName*/ | ||
}, | ||
m(f, O) { | ||
B(f, t, O), U(t, o), U(t, n), T && T.m(t, null), U(t, s), $ && $.m(t, null), U(t, i), b && b.m(t, null), U(t, l), C && C.m(t, null), U(t, a), N && N.m(t, null), U(t, p), U(t, h), S && S.m(h, null), U(h, w), P && P.m(h, null), U(h, g), U(h, c), U(h, v), m && m.m(h, null), y = !0; | ||
m(p, N) { | ||
D(p, t, N), U(t, o), U(t, n), C && C.m(t, null), U(t, s), v && v.m(t, null), U(t, i), T && T.m(t, null), U(t, l), k && k.m(t, null), U(t, a), x && x.m(t, null), U(t, c), U(t, f), O && O.m(f, null), U(f, w), I && I.m(f, null), U(f, b), U(f, h), U(f, m), y && y.m(f, null), $ = !0; | ||
}, | ||
p(f, O) { | ||
(!y || O[0] & /*$arrowClass$*/ | ||
p(p, N) { | ||
(!$ || N[0] & /*$arrowClass$*/ | ||
32 && r !== (r = "thisway-popover__arrow " + /*$arrowClass$*/ | ||
f[5])) && M(o, "class", r), /*$showCloseButton$*/ | ||
f[6] ? T ? T.p(f, O) : (T = xe(f), T.c(), T.m(t, s)) : T && (T.d(1), T = null), /*$$slots*/ | ||
f[28].title || /*$title$*/ | ||
f[1] ? $ ? ($.p(f, O), O[0] & /*$$slots, $title$*/ | ||
268435458 && x($, 1)) : ($ = Se(f), $.c(), x($, 1), $.m(t, i)) : $ && (st(), A($, 1, 1, () => { | ||
$ = null; | ||
p[5])) && P(o, "class", r), /*$showCloseButton$*/ | ||
p[6] ? C ? C.p(p, N) : (C = xe(p), C.c(), C.m(t, s)) : C && (C.d(1), C = null), /*$$slots*/ | ||
p[28].title || /*$title$*/ | ||
p[1] ? v ? (v.p(p, N), N[0] & /*$$slots, $title$*/ | ||
268435458 && S(v, 1)) : (v = Se(p), v.c(), S(v, 1), v.m(t, i)) : v && (st(), A(v, 1, 1, () => { | ||
v = null; | ||
}), nt()), /*$$slots*/ | ||
f[28].description || /*$description$*/ | ||
f[2] ? b ? (b.p(f, O), O[0] & /*$$slots, $description$*/ | ||
268435460 && x(b, 1)) : (b = Oe(f), b.c(), x(b, 1), b.m(t, l)) : b && (st(), A(b, 1, 1, () => { | ||
b = null; | ||
p[28].description || /*$description$*/ | ||
p[2] ? T ? (T.p(p, N), N[0] & /*$$slots, $description$*/ | ||
268435460 && S(T, 1)) : (T = Oe(p), T.c(), S(T, 1), T.m(t, l)) : T && (st(), A(T, 1, 1, () => { | ||
T = null; | ||
}), nt()), /*$layout$*/ | ||
f[4] !== yt && /*$showProgress$*/ | ||
f[7] ? C ? O[0] & /*$layout$, $showProgress$*/ | ||
144 && x(C, 1) : (C = Ne(), C.c(), x(C, 1), C.m(t, a)) : C && (st(), A(C, 1, 1, () => { | ||
C = null; | ||
}), nt()), N && N.p && (!y || O[0] & /*$$scope*/ | ||
p[4] !== yt && /*$showProgress$*/ | ||
p[7] ? k ? N[0] & /*$layout$, $showProgress$*/ | ||
144 && S(k, 1) : (k = Ne(), k.c(), S(k, 1), k.m(t, a)) : k && (st(), A(k, 1, 1, () => { | ||
k = null; | ||
}), nt()), x && x.p && (!$ || N[0] & /*$$scope*/ | ||
536870912) && _t( | ||
N, | ||
F, | ||
f, | ||
x, | ||
V, | ||
p, | ||
/*$$scope*/ | ||
f[29], | ||
y ? vt( | ||
F, | ||
p[29], | ||
$ ? gt( | ||
V, | ||
/*$$scope*/ | ||
f[29], | ||
O, | ||
p[29], | ||
N, | ||
null | ||
) : mt( | ||
/*$$scope*/ | ||
f[29] | ||
p[29] | ||
), | ||
null | ||
), S && S.p && (!y || O[0] & /*$$scope*/ | ||
), O && O.p && (!$ || N[0] & /*$$scope*/ | ||
536870912) && _t( | ||
S, | ||
j, | ||
f, | ||
O, | ||
R, | ||
p, | ||
/*$$scope*/ | ||
f[29], | ||
y ? vt( | ||
j, | ||
p[29], | ||
$ ? gt( | ||
R, | ||
/*$$scope*/ | ||
f[29], | ||
O, | ||
nr | ||
p[29], | ||
N, | ||
ir | ||
) : mt( | ||
/*$$scope*/ | ||
f[29] | ||
p[29] | ||
), | ||
$e | ||
), /*$layout$*/ | ||
f[4] === yt && /*$showProgress$*/ | ||
f[7] ? P ? O[0] & /*$layout$, $showProgress$*/ | ||
144 && x(P, 1) : (P = Pe(), P.c(), x(P, 1), P.m(h, g)) : P && (st(), A(P, 1, 1, () => { | ||
P = null; | ||
p[4] === yt && /*$showProgress$*/ | ||
p[7] ? I ? N[0] & /*$layout$, $showProgress$*/ | ||
144 && S(I, 1) : (I = Ie(), I.c(), S(I, 1), I.m(f, b)) : I && (st(), A(I, 1, 1, () => { | ||
I = null; | ||
}), nt()), /*$showCtrlBtns$*/ | ||
f[8] ? m ? (m.p(f, O), O[0] & /*$showCtrlBtns$*/ | ||
256 && x(m, 1)) : (m = Me(f), m.c(), x(m, 1), m.m(h, null)) : m && (st(), A(m, 1, 1, () => { | ||
m = null; | ||
}), nt()), (!y || O[0] & /*$popoverClass$, $layout$, cssClassName*/ | ||
25 && k !== (k = "thisway-popover " + /*$popoverClass$*/ | ||
f[3] + " thisway-popover__" + /*$layout$*/ | ||
f[4] + " " + /*cssClassName*/ | ||
f[0])) && M(t, "class", k); | ||
p[8] ? y ? (y.p(p, N), N[0] & /*$showCtrlBtns$*/ | ||
256 && S(y, 1)) : (y = Pe(p), y.c(), S(y, 1), y.m(f, null)) : y && (st(), A(y, 1, 1, () => { | ||
y = null; | ||
}), nt()), (!$ || N[0] & /*$popoverClass$, $layout$, cssClassName*/ | ||
25 && u !== (u = "thisway-popover " + /*$popoverClass$*/ | ||
p[3] + " thisway-popover__" + /*$layout$*/ | ||
p[4] + " " + /*cssClassName*/ | ||
p[0])) && P(t, "class", u); | ||
}, | ||
i(f) { | ||
y || (x($), x(b), x(C), x(N, f), x(S, f), x(P), x(m), y = !0); | ||
i(p) { | ||
$ || (S(v), S(T), S(k), S(x, p), S(O, p), S(I), S(y), $ = !0); | ||
}, | ||
o(f) { | ||
A($), A(b), A(C), A(N, f), A(S, f), A(P), A(m), y = !1; | ||
o(p) { | ||
A(v), A(T), A(k), A(x, p), A(O, p), A(I), A(y), $ = !1; | ||
}, | ||
d(f) { | ||
f && D(t), T && T.d(), $ && $.d(), b && b.d(), C && C.d(), N && N.d(f), S && S.d(f), P && P.d(), m && m.d(); | ||
d(p) { | ||
p && Y(t), C && C.d(), v && v.d(), T && T.d(), k && k.d(), x && x.d(p), O && O.d(p), I && I.d(), y && y.d(); | ||
} | ||
@@ -1288,6 +1302,6 @@ }; | ||
c() { | ||
t = Z("button"), t.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 10.586l-4.293-4.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 1 0 1.414-1.414L13.414 12l4.293-4.293a1 1 0 0 0-1.414-1.414L12 10.586z"></path></svg>', M(t, "class", "thisway-popover-close"); | ||
t = Z("button"), t.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 10.586l-4.293-4.293a1 1 0 0 0-1.414 1.414L10.586 12l-4.293 4.293a1 1 0 1 0 1.414 1.414L12 13.414l4.293 4.293a1 1 0 1 0 1.414-1.414L13.414 12l4.293-4.293a1 1 0 0 0-1.414-1.414L12 10.586z"></path></svg>', P(t, "class", "thisway-popover-close"); | ||
}, | ||
m(n, s) { | ||
B(n, t, s), o || (r = Ot( | ||
D(n, t, s), o || (r = Ot( | ||
t, | ||
@@ -1301,3 +1315,3 @@ "click", | ||
d(n) { | ||
n && D(t), o = !1, r(); | ||
n && Y(t), o = !1, r(); | ||
} | ||
@@ -1316,10 +1330,10 @@ }; | ||
e[29], | ||
ke | ||
), s = n || ar(e); | ||
Te | ||
), s = n || cr(e); | ||
return { | ||
c() { | ||
t = Z("header"), s && s.c(), M(t, "class", "thisway-popover-title"); | ||
t = Z("header"), s && s.c(), P(t, "class", "thisway-popover-title"); | ||
}, | ||
m(i, l) { | ||
B(i, t, l), s && s.m(t, null), o = !0; | ||
D(i, t, l), s && s.m(t, null), o = !0; | ||
}, | ||
@@ -1334,3 +1348,3 @@ p(i, l) { | ||
i[29], | ||
o ? vt( | ||
o ? gt( | ||
r, | ||
@@ -1340,3 +1354,3 @@ /*$$scope*/ | ||
l, | ||
lr | ||
ar | ||
) : mt( | ||
@@ -1346,3 +1360,3 @@ /*$$scope*/ | ||
), | ||
ke | ||
Te | ||
) : s && s.p && (!o || l[0] & /*$title$*/ | ||
@@ -1352,3 +1366,3 @@ 2) && s.p(i, o ? l : [-1, -1]); | ||
i(i) { | ||
o || (x(s, i), o = !0); | ||
o || (S(s, i), o = !0); | ||
}, | ||
@@ -1359,7 +1373,7 @@ o(i) { | ||
d(i) { | ||
i && D(t), s && s.d(i); | ||
i && Y(t), s && s.d(i); | ||
} | ||
}; | ||
} | ||
function ar(e) { | ||
function cr(e) { | ||
let t; | ||
@@ -1374,7 +1388,7 @@ return { | ||
m(o, r) { | ||
B(o, t, r); | ||
D(o, t, r); | ||
}, | ||
p(o, r) { | ||
r[0] & /*$title$*/ | ||
2 && Pt( | ||
2 && It( | ||
t, | ||
@@ -1386,3 +1400,3 @@ /*$title$*/ | ||
d(o) { | ||
o && D(t); | ||
o && Y(t); | ||
} | ||
@@ -1405,6 +1419,6 @@ }; | ||
c() { | ||
t = Z("div"), s && s.c(), M(t, "class", "thisway-popover-description"); | ||
t = Z("div"), s && s.c(), P(t, "class", "thisway-popover-description"); | ||
}, | ||
m(i, l) { | ||
B(i, t, l), s && s.m(t, null), o = !0; | ||
D(i, t, l), s && s.m(t, null), o = !0; | ||
}, | ||
@@ -1419,3 +1433,3 @@ p(i, l) { | ||
i[29], | ||
o ? vt( | ||
o ? gt( | ||
r, | ||
@@ -1425,3 +1439,3 @@ /*$$scope*/ | ||
l, | ||
ir | ||
lr | ||
) : mt( | ||
@@ -1436,3 +1450,3 @@ /*$$scope*/ | ||
i(i) { | ||
o || (x(s, i), o = !0); | ||
o || (S(s, i), o = !0); | ||
}, | ||
@@ -1443,3 +1457,3 @@ o(i) { | ||
d(i) { | ||
i && D(t), s && s.d(i); | ||
i && Y(t), s && s.d(i); | ||
} | ||
@@ -1458,7 +1472,7 @@ }; | ||
m(o, r) { | ||
B(o, t, r); | ||
D(o, t, r); | ||
}, | ||
p(o, r) { | ||
r[0] & /*$description$*/ | ||
4 && Pt( | ||
4 && It( | ||
t, | ||
@@ -1470,3 +1484,3 @@ /*$description$*/ | ||
d(o) { | ||
o && D(t); | ||
o && Y(t); | ||
} | ||
@@ -1485,3 +1499,3 @@ }; | ||
i(r) { | ||
o || (x(t.$$.fragment, r), o = !0); | ||
o || (S(t.$$.fragment, r), o = !0); | ||
}, | ||
@@ -1496,3 +1510,3 @@ o(r) { | ||
} | ||
function Pe(e) { | ||
function Ie(e) { | ||
let t, o; | ||
@@ -1507,3 +1521,3 @@ return t = new Ze({}), { | ||
i(r) { | ||
o || (x(t.$$.fragment, r), o = !0); | ||
o || (S(t.$$.fragment, r), o = !0); | ||
}, | ||
@@ -1518,9 +1532,9 @@ o(r) { | ||
} | ||
function Me(e) { | ||
function Pe(e) { | ||
let t, o, r, n = ( | ||
/*$previousButtonVisible$*/ | ||
e[9] && Le(e) | ||
e[9] && Ee(e) | ||
), s = ( | ||
/*$hasSteps$*/ | ||
e[11] && Ie(e) | ||
e[11] && Me(e) | ||
); | ||
@@ -1532,3 +1546,3 @@ return { | ||
m(i, l) { | ||
n && n.m(i, l), B(i, t, l), s && s.m(i, l), B(i, o, l), r = !0; | ||
n && n.m(i, l), D(i, t, l), s && s.m(i, l), D(i, o, l), r = !0; | ||
}, | ||
@@ -1538,7 +1552,7 @@ p(i, l) { | ||
i[9] ? n ? (n.p(i, l), l[0] & /*$previousButtonVisible$*/ | ||
512 && x(n, 1)) : (n = Le(i), n.c(), x(n, 1), n.m(t.parentNode, t)) : n && (st(), A(n, 1, 1, () => { | ||
512 && S(n, 1)) : (n = Ee(i), n.c(), S(n, 1), n.m(t.parentNode, t)) : n && (st(), A(n, 1, 1, () => { | ||
n = null; | ||
}), nt()), /*$hasSteps$*/ | ||
i[11] ? s ? (s.p(i, l), l[0] & /*$hasSteps$*/ | ||
2048 && x(s, 1)) : (s = Ie(i), s.c(), x(s, 1), s.m(o.parentNode, o)) : s && (st(), A(s, 1, 1, () => { | ||
2048 && S(s, 1)) : (s = Me(i), s.c(), S(s, 1), s.m(o.parentNode, o)) : s && (st(), A(s, 1, 1, () => { | ||
s = null; | ||
@@ -1548,3 +1562,3 @@ }), nt()); | ||
i(i) { | ||
r || (x(n), x(s), r = !0); | ||
r || (S(n), S(s), r = !0); | ||
}, | ||
@@ -1555,7 +1569,7 @@ o(i) { | ||
d(i) { | ||
i && (D(t), D(o)), n && n.d(i), s && s.d(i); | ||
i && (Y(t), Y(o)), n && n.d(i), s && s.d(i); | ||
} | ||
}; | ||
} | ||
function Le(e) { | ||
function Ee(e) { | ||
let t, o, r, n; | ||
@@ -1571,9 +1585,9 @@ const s = ( | ||
be | ||
), l = i || hr(e); | ||
), l = i || dr(e); | ||
return { | ||
c() { | ||
t = Z("button"), l && l.c(), M(t, "class", "thisway-popover-prev"); | ||
t = Z("button"), l && l.c(), P(t, "class", "thisway-popover-prev"); | ||
}, | ||
m(a, p) { | ||
B(a, t, p), l && l.m(t, null), o = !0, r || (n = Ot( | ||
m(a, c) { | ||
D(a, t, c), l && l.m(t, null), o = !0, r || (n = Ot( | ||
t, | ||
@@ -1585,4 +1599,4 @@ "click", | ||
}, | ||
p(a, p) { | ||
i ? i.p && (!o || p[0] & /*$$scope*/ | ||
p(a, c) { | ||
i ? i.p && (!o || c[0] & /*$$scope*/ | ||
536870912) && _t( | ||
@@ -1594,8 +1608,8 @@ i, | ||
a[29], | ||
o ? vt( | ||
o ? gt( | ||
s, | ||
/*$$scope*/ | ||
a[29], | ||
p, | ||
sr | ||
c, | ||
nr | ||
) : mt( | ||
@@ -1606,7 +1620,7 @@ /*$$scope*/ | ||
be | ||
) : l && l.p && (!o || p[0] & /*$previousText$, $layout$*/ | ||
1040) && l.p(a, o ? p : [-1, -1]); | ||
) : l && l.p && (!o || c[0] & /*$previousText$, $layout$*/ | ||
1040) && l.p(a, o ? c : [-1, -1]); | ||
}, | ||
i(a) { | ||
o || (x(l, a), o = !0); | ||
o || (S(l, a), o = !0); | ||
}, | ||
@@ -1617,22 +1631,22 @@ o(a) { | ||
d(a) { | ||
a && D(t), l && l.d(a), r = !1, n(); | ||
a && Y(t), l && l.d(a), r = !1, n(); | ||
} | ||
}; | ||
} | ||
function cr(e) { | ||
function fr(e) { | ||
let t, o; | ||
return { | ||
c() { | ||
t = Rt("svg"), o = Rt("path"), M(o, "d", "M19 12H6M12 5l-7 7 7 7"), G(t, "pointer-events", "none"), M(t, "width", "20"), M(t, "height", "14"), M(t, "xmlns", "http://www.w3.org/2000/svg"), M(t, "viewBox", "0 0 24 24"), M(t, "fill", "none"), M(t, "stroke", "currentColor"), M(t, "stroke-width", "2"), M(t, "stroke-linecap", "round"), M(t, "stroke-linejoin", "round"); | ||
t = Vt("svg"), o = Vt("path"), P(o, "d", "M19 12H6M12 5l-7 7 7 7"), G(t, "pointer-events", "none"), P(t, "width", "20"), P(t, "height", "14"), P(t, "xmlns", "http://www.w3.org/2000/svg"), P(t, "viewBox", "0 0 24 24"), P(t, "fill", "none"), P(t, "stroke", "currentColor"), P(t, "stroke-width", "2"), P(t, "stroke-linecap", "round"), P(t, "stroke-linejoin", "round"); | ||
}, | ||
m(r, n) { | ||
B(r, t, n), U(t, o); | ||
D(r, t, n), U(t, o); | ||
}, | ||
p: ut, | ||
d(r) { | ||
r && D(t); | ||
r && Y(t); | ||
} | ||
}; | ||
} | ||
function fr(e) { | ||
function hr(e) { | ||
let t; | ||
@@ -1647,7 +1661,7 @@ return { | ||
m(o, r) { | ||
B(o, t, r); | ||
D(o, t, r); | ||
}, | ||
p(o, r) { | ||
r[0] & /*$previousText$*/ | ||
1024 && Pt( | ||
1024 && It( | ||
t, | ||
@@ -1659,7 +1673,7 @@ /*$previousText$*/ | ||
d(o) { | ||
o && D(t); | ||
o && Y(t); | ||
} | ||
}; | ||
} | ||
function hr(e) { | ||
function dr(e) { | ||
let t; | ||
@@ -1669,3 +1683,3 @@ function o(s, i) { | ||
/*$layout$*/ | ||
s[4] !== Ve ? fr : cr | ||
s[4] !== Re ? hr : fr | ||
); | ||
@@ -1679,3 +1693,3 @@ } | ||
m(s, i) { | ||
n.m(s, i), B(s, t, i); | ||
n.m(s, i), D(s, t, i); | ||
}, | ||
@@ -1686,7 +1700,7 @@ p(s, i) { | ||
d(s) { | ||
s && D(t), n.d(s); | ||
s && Y(t), n.d(s); | ||
} | ||
}; | ||
} | ||
function Ie(e) { | ||
function Me(e) { | ||
let t, o, r, n; | ||
@@ -1702,9 +1716,9 @@ const s = ( | ||
ye | ||
), l = i || dr(e); | ||
), l = i || ur(e); | ||
return { | ||
c() { | ||
t = Z("button"), l && l.c(), M(t, "class", "thisway-popover-next"); | ||
t = Z("button"), l && l.c(), P(t, "class", "thisway-popover-next"); | ||
}, | ||
m(a, p) { | ||
B(a, t, p), l && l.m(t, null), o = !0, r || (n = Ot( | ||
m(a, c) { | ||
D(a, t, c), l && l.m(t, null), o = !0, r || (n = Ot( | ||
t, | ||
@@ -1716,4 +1730,4 @@ "click", | ||
}, | ||
p(a, p) { | ||
i ? i.p && (!o || p[0] & /*$$scope*/ | ||
p(a, c) { | ||
i ? i.p && (!o || c[0] & /*$$scope*/ | ||
536870912) && _t( | ||
@@ -1725,8 +1739,8 @@ i, | ||
a[29], | ||
o ? vt( | ||
o ? gt( | ||
s, | ||
/*$$scope*/ | ||
a[29], | ||
p, | ||
rr | ||
c, | ||
sr | ||
) : mt( | ||
@@ -1737,7 +1751,7 @@ /*$$scope*/ | ||
ye | ||
) : l && l.p && (!o || p[0] & /*$nextButtonText$*/ | ||
4096) && l.p(a, o ? p : [-1, -1]); | ||
) : l && l.p && (!o || c[0] & /*$nextButtonText$*/ | ||
4096) && l.p(a, o ? c : [-1, -1]); | ||
}, | ||
i(a) { | ||
o || (x(l, a), o = !0); | ||
o || (S(l, a), o = !0); | ||
}, | ||
@@ -1748,7 +1762,7 @@ o(a) { | ||
d(a) { | ||
a && D(t), l && l.d(a), r = !1, n(); | ||
a && Y(t), l && l.d(a), r = !1, n(); | ||
} | ||
}; | ||
} | ||
function dr(e) { | ||
function ur(e) { | ||
let t; | ||
@@ -1763,7 +1777,7 @@ return { | ||
m(o, r) { | ||
B(o, t, r); | ||
D(o, t, r); | ||
}, | ||
p(o, r) { | ||
r[0] & /*$nextButtonText$*/ | ||
4096 && Pt( | ||
4096 && It( | ||
t, | ||
@@ -1775,7 +1789,7 @@ /*$nextButtonText$*/ | ||
d(o) { | ||
o && D(t); | ||
o && Y(t); | ||
} | ||
}; | ||
} | ||
function ur(e) { | ||
function wr(e) { | ||
let t, o, r = ( | ||
@@ -1786,3 +1800,3 @@ /*$title$*/ | ||
e[28].title || /*$$slots*/ | ||
e[28].description) && Te(e) | ||
e[28].description) && ke(e) | ||
); | ||
@@ -1794,3 +1808,3 @@ return { | ||
m(n, s) { | ||
r && r.m(n, s), B(n, t, s), o = !0; | ||
r && r.m(n, s), D(n, t, s), o = !0; | ||
}, | ||
@@ -1803,3 +1817,3 @@ p(n, s) { | ||
n[28].description ? r ? (r.p(n, s), s[0] & /*$title$, $description$, $$slots*/ | ||
268435462 && x(r, 1)) : (r = Te(n), r.c(), x(r, 1), r.m(t.parentNode, t)) : r && (st(), A(r, 1, 1, () => { | ||
268435462 && S(r, 1)) : (r = ke(n), r.c(), S(r, 1), r.m(t.parentNode, t)) : r && (st(), A(r, 1, 1, () => { | ||
r = null; | ||
@@ -1809,3 +1823,3 @@ }), nt()); | ||
i(n) { | ||
o || (x(r), o = !0); | ||
o || (S(r), o = !0); | ||
}, | ||
@@ -1816,57 +1830,57 @@ o(n) { | ||
d(n) { | ||
n && D(t), r && r.d(n); | ||
n && Y(t), r && r.d(n); | ||
} | ||
}; | ||
} | ||
function wr(e, t, o) { | ||
let r, n, s, i, l, a, p, h, w, g, c, v, { $$slots: k = {}, $$scope: y } = t; | ||
const T = uo(k); | ||
let { cssClassName: $ = "" } = t; | ||
const b = eo(), C = Ke(), F = R(se), N = R(Ye), j = R(ee), S = L(N, (_) => { | ||
function _r(e, t, o) { | ||
let r, n, s, i, l, a, c, f, w, b, h, m, { $$slots: u = {}, $$scope: $ } = t; | ||
const C = wo(u); | ||
let { cssClassName: v = "" } = t; | ||
const T = eo(), k = Xe(), V = F(se), x = F(je), R = F(ee), O = E(x, (g) => { | ||
var tt; | ||
return `thisway-popover-${(tt = _ == null ? void 0 : _.orientation) == null ? void 0 : tt.toLowerCase()}`; | ||
return `thisway-popover-${(tt = g == null ? void 0 : g.orientation) == null ? void 0 : tt.toLowerCase()}`; | ||
}); | ||
E(e, S, (_) => o(3, s = _)); | ||
const P = L(N, (_) => `thisway-popover__arrow-${_ == null ? void 0 : _.alignment.toLowerCase()}`); | ||
E(e, P, (_) => o(5, l = _)); | ||
const m = Xe(), f = L(F, (_) => _ > 1); | ||
E(e, f, (_) => o(11, c = _)); | ||
const O = L([f, C], ([_, tt]) => _ && (tt || 0) > 0); | ||
E(e, O, (_) => o(9, w = _)); | ||
const J = Y(m, "title"); | ||
E(e, J, (_) => o(1, r = _)); | ||
const u = Y(m, "description"); | ||
E(e, u, (_) => o(2, n = _)); | ||
const d = Y(m, "showCloseBtn"); | ||
E(e, d, (_) => o(6, a = _)); | ||
const V = Y(m, "showCtrlBtns"); | ||
E(e, V, (_) => o(8, h = _)); | ||
const X = Y(m, "showProgress", !0); | ||
E(e, X, (_) => o(7, p = _)); | ||
const K = Y(m, "prevBtnText"); | ||
E(e, K, (_) => o(10, g = _)); | ||
const I = Y(j, "layout", yt); | ||
E(e, I, (_) => o(4, i = _)); | ||
const W = No(), Q = L([m, W, C, I], ([_, tt, ct, ft]) => { | ||
L(e, O, (g) => o(3, s = g)); | ||
const I = E(x, (g) => `thisway-popover__arrow-${g == null ? void 0 : g.alignment.toLowerCase()}`); | ||
L(e, I, (g) => o(5, l = g)); | ||
const y = Ke(), p = E(V, (g) => g > 1); | ||
L(e, p, (g) => o(11, h = g)); | ||
const N = E([p, k], ([g, tt]) => g && (tt || 0) > 0); | ||
L(e, N, (g) => o(9, w = g)); | ||
const J = j(y, "title"); | ||
L(e, J, (g) => o(1, r = g)); | ||
const _ = j(y, "description"); | ||
L(e, _, (g) => o(2, n = g)); | ||
const d = j(y, "showCloseBtn"); | ||
L(e, d, (g) => o(6, a = g)); | ||
const B = j(y, "showCtrlBtns"); | ||
L(e, B, (g) => o(8, f = g)); | ||
const K = j(y, "showProgress", !0); | ||
L(e, K, (g) => o(7, c = g)); | ||
const X = j(y, "prevBtnText"); | ||
L(e, X, (g) => o(10, b = g)); | ||
const M = j(R, "layout", yt); | ||
L(e, M, (g) => o(4, i = g)); | ||
const W = Io(), Q = E([y, W, k, M], ([g, tt, pt, ft]) => { | ||
var at; | ||
if (ct === 0) | ||
return _.startBtnText; | ||
if (pt === 0) | ||
return g.startBtnText; | ||
if (tt) | ||
if (ft === Ve) { | ||
if (ft === Re) { | ||
const ht = ((at = tt.popover) == null ? void 0 : at.title) ?? ""; | ||
return `${_.nextBtnText} ${ht}`; | ||
return `${g.nextBtnText} ${ht}`; | ||
} else | ||
return _.nextBtnText; | ||
return g.nextBtnText; | ||
else | ||
return _.doneBtnText; | ||
return g.doneBtnText; | ||
}); | ||
E(e, Q, (_) => o(12, v = _)); | ||
const ot = () => b("close"), pt = () => b("previous"), gt = () => { | ||
const _ = H(W); | ||
b(_ ? "next" : "done"); | ||
L(e, Q, (g) => o(12, m = g)); | ||
const ot = () => T("close"), ct = () => T("previous"), vt = () => { | ||
const g = H(W); | ||
T(g ? "next" : "done"); | ||
}; | ||
return e.$$set = (_) => { | ||
"cssClassName" in _ && o(0, $ = _.cssClassName), "$$scope" in _ && o(29, y = _.$$scope); | ||
return e.$$set = (g) => { | ||
"cssClassName" in g && o(0, v = g.cssClassName), "$$scope" in g && o(29, $ = g.$$scope); | ||
}, [ | ||
$, | ||
v, | ||
r, | ||
@@ -1878,34 +1892,34 @@ n, | ||
a, | ||
p, | ||
h, | ||
w, | ||
g, | ||
c, | ||
v, | ||
S, | ||
P, | ||
f, | ||
w, | ||
b, | ||
h, | ||
m, | ||
O, | ||
I, | ||
p, | ||
N, | ||
J, | ||
u, | ||
_, | ||
d, | ||
V, | ||
B, | ||
K, | ||
X, | ||
K, | ||
I, | ||
M, | ||
Q, | ||
ot, | ||
pt, | ||
gt, | ||
T, | ||
y, | ||
k | ||
ct, | ||
vt, | ||
C, | ||
$, | ||
u | ||
]; | ||
} | ||
class _r extends Tt { | ||
class mr extends kt { | ||
constructor(t) { | ||
super(), xt(this, t, wr, ur, St, { cssClassName: 0 }, or, [-1, -1]); | ||
super(), xt(this, t, _r, wr, St, { cssClassName: 0 }, rr, [-1, -1]); | ||
} | ||
} | ||
class mr { | ||
class gr { | ||
constructor(t) { | ||
@@ -1916,3 +1930,3 @@ dt(this, "options$"); | ||
getTotalCount(t) { | ||
return L(t.effectiveSteps$, (o) => o.length); | ||
return E(t.effectiveSteps$, (o) => o.length); | ||
} | ||
@@ -1923,12 +1937,12 @@ async waitForElement(t) { | ||
getPopoverComponent() { | ||
return _r; | ||
return mr; | ||
} | ||
} | ||
class vr extends Jo { | ||
class vr extends Qo { | ||
constructor(t) { | ||
const { steps: o, beforeStepChange: r, waitForElement: n, afterStepChanged: s, onClose: i, onDone: l } = t, a = kt(t), p = new mr(a); | ||
r && (p.beforeStepChange = r), n && (p.waitForElement = n), s && (p.afterStepChanged = s), i && (p.onClose = i), l && (p.onDone = l), super(Co(gr(o), void 0), p, De(), a); | ||
const { steps: o, beforeStepChange: r, waitForElement: n, afterStepChanged: s, onClose: i, onDone: l } = t, a = Tt(t), c = new gr(a); | ||
r && (c.beforeStepChange = r), n && (c.waitForElement = n), s && (c.afterStepChanged = s), i && (c.onClose = i), l && (c.onDone = l), super(To(yr(o), void 0), c, De(), a); | ||
} | ||
} | ||
const gr = (e) => { | ||
const yr = (e) => { | ||
let t = e.length; | ||
@@ -1951,3 +1965,3 @@ const o = /* @__PURE__ */ new Set(), r = (s) => typeof s == "string" || Number.isFinite(s) && !o.has(s), n = (s) => { | ||
}); | ||
}, Mr = (e) => { | ||
}, Er = (e) => { | ||
const t = new vr({ | ||
@@ -1963,4 +1977,4 @@ steps: [ | ||
}; | ||
function yr(e) { | ||
const t = R(re), { onMount: o, onDestroy: r } = R(bo), n = t.subscribe((s) => { | ||
function br(e) { | ||
const t = F(re), { onMount: o, onDestroy: r } = F($o), n = t.subscribe((s) => { | ||
s ? o(s) : r(); | ||
@@ -1972,5 +1986,5 @@ }); | ||
} | ||
class Lr extends Tt { | ||
class Mr extends kt { | ||
constructor(t) { | ||
super(), xt(this, t, yr, null, St, {}); | ||
super(), xt(this, t, br, null, St, {}); | ||
} | ||
@@ -1981,34 +1995,34 @@ } | ||
oe as ElementBoundingContext, | ||
bo as ForeignViewContext, | ||
Lr as ForeignViewHost, | ||
$o as ForeignViewContext, | ||
Mr as ForeignViewHost, | ||
ee as OptionsContext, | ||
Ye as PlacementContext, | ||
_r as PopoverCard, | ||
je as PlacementContext, | ||
mr as PopoverCard, | ||
re as PopoverContainerContext, | ||
je as PopoverSizeContext, | ||
Ye as PopoverSizeContext, | ||
Dt as RenderStateContext, | ||
jt as StepOptionsContext, | ||
$o as StepsController, | ||
Yt as StepOptionsContext, | ||
Co as StepsController, | ||
vr as ThisWay, | ||
mr as ThisWayDefaultDelegate, | ||
gr as ThisWayDefaultDelegate, | ||
se as TotalStepCountContext, | ||
Jo as Tour, | ||
Mt as TourContext, | ||
Qo as Tour, | ||
Pt as TourContext, | ||
De as createContexts, | ||
Co as createStepsStore, | ||
To as createStepsStore, | ||
rt as defineContext, | ||
qt as findStepIndex, | ||
R as getContext, | ||
So as getHighlightOptions, | ||
No as getNextStep, | ||
Xe as getPopoverOptions, | ||
Ke as getRenderIndex, | ||
zt as findStepIndex, | ||
F as getContext, | ||
Oo as getHighlightOptions, | ||
Io as getNextStep, | ||
Ke as getPopoverOptions, | ||
Xe as getRenderIndex, | ||
Po as getRenderStep, | ||
Ue as getTheme, | ||
Mr as highlight, | ||
xo as mergeStepOption, | ||
Oo as normalizeTheme, | ||
qo as observeElementBounding, | ||
qe as parsePlacement, | ||
yo as setContext | ||
Er as highlight, | ||
So as mergeStepOption, | ||
No as normalizeTheme, | ||
Zo as observeElementBounding, | ||
ze as parsePlacement, | ||
bo as setContext | ||
}; |
@@ -1,2 +0,2 @@ | ||
import type { HighlightOptionsWithDefaultValues, IComputePlacementState, IForeignViewContext, ITourDelegate, NoElement, PopoverOptionsWithDefaultValues, Step, ThemeOptions, TourOptions } from '@thisway/base'; | ||
import type { HighlightOptionsWithDefaultValues, IComputePlacementState, IForeignViewContext, ITourDelegate, NoElement, PopoverOptionsWithDefaultValues, Rect, Step, ThemeOptions, TourOptions } from '@thisway/base'; | ||
import type { Size } from '@thisway/utils'; | ||
@@ -20,3 +20,3 @@ import type { Readable, Writable } from 'svelte/store'; | ||
export declare const OptionsContext: ContextType<Readable<TourOptions>>; | ||
export declare const ElementBoundingContext: ContextType<Readable<Readable<typeof import("@thisway/base").NO_ELEMENT | DOMRect> | undefined>>; | ||
export declare const ElementBoundingContext: ContextType<Readable<Readable<typeof import("@thisway/base").NO_ELEMENT | Rect> | undefined>>; | ||
export declare const PopoverContainerContext: ContextType<Writable<HTMLElement | undefined>>; | ||
@@ -23,0 +23,0 @@ export declare const PopoverSizeContext: ContextType<Readable<Size>>; |
@@ -1,6 +0,6 @@ | ||
import type { Alignment, IComputePlacementState, NoElement, Orientation, PopoverPlacement, PopoverPosition, PopoverPositionParsed } from '@thisway/base'; | ||
import type { Alignment, IComputePlacementState, NoElement, Orientation, PopoverPlacement, PopoverPosition, PopoverPositionParsed, Rect } from '@thisway/base'; | ||
import { type Size } from '@thisway/utils'; | ||
import type { Readable } from 'svelte/store'; | ||
export declare const parsePlacement: (position: PopoverPosition | PopoverPositionParsed | string | undefined) => PopoverPositionParsed; | ||
export declare const getOrientation: (elementRect: DOMRect, popoverRect: Size, preferredOrientation: Orientation | undefined, offset: number, viewport: Size) => Orientation; | ||
export declare const getOrientation: (elementRect: Rect, popoverRect: Size, preferredOrientation: Orientation | undefined, offset: number, viewport: Size) => Orientation; | ||
export declare const EMPTY_POPOVER_PLACEMENT: PopoverPlacement; | ||
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
export declare const getStyleFromOrientation: (orientation: Orientation, stepAlignment: Alignment | undefined, elementRect: DOMRect | NoElement | undefined, popoverSize: Size, popoverOffset: number, highlightOption: { | ||
export declare const getStyleFromOrientation: (orientation: Orientation, stepAlignment: Alignment | undefined, elementRect: Rect | NoElement | undefined, popoverSize: Size, popoverOffset: number, highlightOption: { | ||
padding: number; | ||
@@ -21,0 +21,0 @@ borderWidth: number; |
@@ -1,2 +0,2 @@ | ||
import type { IStepsStore, ITourDelegate, NoElement, Step, TourOptions } from '@thisway/base'; | ||
import type { IStepsStore, ITourDelegate, NoElement, Rect, Step, TourOptions } from '@thisway/base'; | ||
import type { SvelteComponent } from 'svelte'; | ||
@@ -7,3 +7,3 @@ import type { Readable, Unsubscriber } from 'svelte/store'; | ||
import { StepsController } from './steps.controller'; | ||
export declare function observeElementBounding(scroll$: Readable<Scroll>, renderState$: Readable<RenderState>, stepOptions: IStepOptionsContext, enabled$: Readable<boolean>): Readable<Readable<DOMRect | NoElement> | undefined>; | ||
export declare function observeElementBounding(scroll$: Readable<Scroll>, renderState$: Readable<RenderState>, stepOptions: IStepOptionsContext, enabled$: Readable<boolean>): Readable<Readable<Rect | NoElement> | undefined>; | ||
export declare class Tour<T extends Step = Step> extends StepsController<T> { | ||
@@ -10,0 +10,0 @@ protected readonly subscriptions: Unsubscriber[]; |
{ | ||
"name": "@thisway/next", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
111480
2380