@arabold/docs-mcp-server 1.28.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/assets/main.css +1 -1
- package/dist/assets/main.js +1130 -477
- package/dist/assets/main.js.map +1 -1
- package/dist/index.js +1874 -1258
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/public/assets/main.css +1 -1
- package/public/assets/main.js +1130 -477
- package/public/assets/main.js.map +1 -1
package/public/assets/main.js
CHANGED
|
@@ -1,4 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
function src_default$1(e) {
|
|
2
|
+
e.directive("collapse", t), t.inline = (n, { modifiers: i }) => {
|
|
3
|
+
i.includes("min") && (n._x_doShow = () => {
|
|
4
|
+
}, n._x_doHide = () => {
|
|
5
|
+
});
|
|
6
|
+
};
|
|
7
|
+
function t(n, { modifiers: i }) {
|
|
8
|
+
let r = modifierValue$1(i, "duration", 250) / 1e3, a = modifierValue$1(i, "min", 0), s = !i.includes("min");
|
|
9
|
+
n._x_isShown || (n.style.height = `${a}px`), !n._x_isShown && s && (n.hidden = !0), n._x_isShown || (n.style.overflow = "hidden");
|
|
10
|
+
let o = (c, u) => {
|
|
11
|
+
let d = e.setStyles(c, u);
|
|
12
|
+
return u.height ? () => {
|
|
13
|
+
} : d;
|
|
14
|
+
}, l = {
|
|
15
|
+
transitionProperty: "height",
|
|
16
|
+
transitionDuration: `${r}s`,
|
|
17
|
+
transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
|
|
18
|
+
};
|
|
19
|
+
n._x_transition = {
|
|
20
|
+
in(c = () => {
|
|
21
|
+
}, u = () => {
|
|
22
|
+
}) {
|
|
23
|
+
s && (n.hidden = !1), s && (n.style.display = null);
|
|
24
|
+
let d = n.getBoundingClientRect().height;
|
|
25
|
+
n.style.height = "auto";
|
|
26
|
+
let h = n.getBoundingClientRect().height;
|
|
27
|
+
d === h && (d = a), e.transition(n, e.setStyles, {
|
|
28
|
+
during: l,
|
|
29
|
+
start: { height: d + "px" },
|
|
30
|
+
end: { height: h + "px" }
|
|
31
|
+
}, () => n._x_isShown = !0, () => {
|
|
32
|
+
Math.abs(n.getBoundingClientRect().height - h) < 1 && (n.style.overflow = null);
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
out(c = () => {
|
|
36
|
+
}, u = () => {
|
|
37
|
+
}) {
|
|
38
|
+
let d = n.getBoundingClientRect().height;
|
|
39
|
+
e.transition(n, o, {
|
|
40
|
+
during: l,
|
|
41
|
+
start: { height: d + "px" },
|
|
42
|
+
end: { height: a + "px" }
|
|
43
|
+
}, () => n.style.overflow = "hidden", () => {
|
|
44
|
+
n._x_isShown = !1, n.style.height == `${a}px` && s && (n.style.display = "none", n.hidden = !0);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function modifierValue$1(e, t, n) {
|
|
51
|
+
if (e.indexOf(t) === -1)
|
|
52
|
+
return n;
|
|
53
|
+
const i = e[e.indexOf(t) + 1];
|
|
54
|
+
if (!i)
|
|
55
|
+
return n;
|
|
56
|
+
if (t === "duration") {
|
|
57
|
+
let r = i.match(/([0-9]+)ms/);
|
|
58
|
+
if (r)
|
|
59
|
+
return r[1];
|
|
60
|
+
}
|
|
61
|
+
if (t === "min") {
|
|
62
|
+
let r = i.match(/([0-9]+)px/);
|
|
63
|
+
if (r)
|
|
64
|
+
return r[1];
|
|
65
|
+
}
|
|
66
|
+
return i;
|
|
67
|
+
}
|
|
68
|
+
var module_default$1 = src_default$1, flushPending = !1, flushing = !1, queue = [], lastFlushedIndex = -1;
|
|
2
69
|
function scheduler(e) {
|
|
3
70
|
queueJob(e);
|
|
4
71
|
}
|
|
@@ -660,14 +727,14 @@ function registerTransitionsFromClassString(e, t, n) {
|
|
|
660
727
|
function registerTransitionsFromHelper(e, t, n) {
|
|
661
728
|
registerTransitionObject(e, setStyles);
|
|
662
729
|
let i = !t.includes("in") && !t.includes("out") && !n, r = i || t.includes("in") || ["enter"].includes(n), a = i || t.includes("out") || ["leave"].includes(n);
|
|
663
|
-
t.includes("in") && !i && (t = t.filter((
|
|
664
|
-
let s = !t.includes("opacity") && !t.includes("scale"), o = s || t.includes("opacity"), l = s || t.includes("scale"), c = o ? 0 : 1, u = l ? modifierValue(t, "scale", 95) / 100 : 1, d = modifierValue(t, "delay", 0) / 1e3,
|
|
730
|
+
t.includes("in") && !i && (t = t.filter((E, g) => g < t.indexOf("out"))), t.includes("out") && !i && (t = t.filter((E, g) => g > t.indexOf("out")));
|
|
731
|
+
let s = !t.includes("opacity") && !t.includes("scale"), o = s || t.includes("opacity"), l = s || t.includes("scale"), c = o ? 0 : 1, u = l ? modifierValue(t, "scale", 95) / 100 : 1, d = modifierValue(t, "delay", 0) / 1e3, h = modifierValue(t, "origin", "center"), b = "opacity, transform", v = modifierValue(t, "duration", 150) / 1e3, x = modifierValue(t, "duration", 75) / 1e3, m = "cubic-bezier(0.4, 0.0, 0.2, 1)";
|
|
665
732
|
r && (e._x_transition.enter.during = {
|
|
666
|
-
transformOrigin:
|
|
733
|
+
transformOrigin: h,
|
|
667
734
|
transitionDelay: `${d}s`,
|
|
668
|
-
transitionProperty:
|
|
669
|
-
transitionDuration: `${
|
|
670
|
-
transitionTimingFunction:
|
|
735
|
+
transitionProperty: b,
|
|
736
|
+
transitionDuration: `${v}s`,
|
|
737
|
+
transitionTimingFunction: m
|
|
671
738
|
}, e._x_transition.enter.start = {
|
|
672
739
|
opacity: c,
|
|
673
740
|
transform: `scale(${u})`
|
|
@@ -675,11 +742,11 @@ function registerTransitionsFromHelper(e, t, n) {
|
|
|
675
742
|
opacity: 1,
|
|
676
743
|
transform: "scale(1)"
|
|
677
744
|
}), a && (e._x_transition.leave.during = {
|
|
678
|
-
transformOrigin:
|
|
745
|
+
transformOrigin: h,
|
|
679
746
|
transitionDelay: `${d}s`,
|
|
680
|
-
transitionProperty:
|
|
681
|
-
transitionDuration: `${
|
|
682
|
-
transitionTimingFunction:
|
|
747
|
+
transitionProperty: b,
|
|
748
|
+
transitionDuration: `${x}s`,
|
|
749
|
+
transitionTimingFunction: m
|
|
683
750
|
}, e._x_transition.leave.start = {
|
|
684
751
|
opacity: 1,
|
|
685
752
|
transform: "scale(1)"
|
|
@@ -1376,10 +1443,10 @@ function createIterableMethod(e, t, n) {
|
|
|
1376
1443
|
return !t && track(a, "iterate", l ? MAP_KEY_ITERATE_KEY : ITERATE_KEY), {
|
|
1377
1444
|
// iterator protocol
|
|
1378
1445
|
next() {
|
|
1379
|
-
const { value: d, done:
|
|
1380
|
-
return
|
|
1446
|
+
const { value: d, done: h } = c.next();
|
|
1447
|
+
return h ? { value: d, done: h } : {
|
|
1381
1448
|
value: o ? [u(d[0]), u(d[1])] : u(d),
|
|
1382
|
-
done:
|
|
1449
|
+
done: h
|
|
1383
1450
|
};
|
|
1384
1451
|
},
|
|
1385
1452
|
// iterable protocol
|
|
@@ -1616,25 +1683,25 @@ directive("modelable", (e, { expression: t }, { effect: n, evaluateLater: i, cle
|
|
|
1616
1683
|
if (!e._x_model)
|
|
1617
1684
|
return;
|
|
1618
1685
|
e._x_removeModelListeners.default();
|
|
1619
|
-
let u = e._x_model.get, d = e._x_model.set,
|
|
1686
|
+
let u = e._x_model.get, d = e._x_model.set, h = entangle(
|
|
1620
1687
|
{
|
|
1621
1688
|
get() {
|
|
1622
1689
|
return u();
|
|
1623
1690
|
},
|
|
1624
|
-
set(
|
|
1625
|
-
d(
|
|
1691
|
+
set(b) {
|
|
1692
|
+
d(b);
|
|
1626
1693
|
}
|
|
1627
1694
|
},
|
|
1628
1695
|
{
|
|
1629
1696
|
get() {
|
|
1630
1697
|
return s();
|
|
1631
1698
|
},
|
|
1632
|
-
set(
|
|
1633
|
-
l(
|
|
1699
|
+
set(b) {
|
|
1700
|
+
l(b);
|
|
1634
1701
|
}
|
|
1635
1702
|
}
|
|
1636
1703
|
);
|
|
1637
|
-
r(
|
|
1704
|
+
r(h);
|
|
1638
1705
|
});
|
|
1639
1706
|
});
|
|
1640
1707
|
directive("teleport", (e, { modifiers: t, expression: n }, { cleanup: i }) => {
|
|
@@ -1773,42 +1840,42 @@ directive("model", (e, { modifiers: t, expression: n }, { effect: i, cleanup: r
|
|
|
1773
1840
|
typeof n == "string" ? o = evaluateLater(a, `${n} = __placeholder`) : typeof n == "function" && typeof n() == "string" ? o = evaluateLater(a, `${n()} = __placeholder`) : o = () => {
|
|
1774
1841
|
};
|
|
1775
1842
|
let l = () => {
|
|
1776
|
-
let
|
|
1777
|
-
return s((
|
|
1778
|
-
}, c = (
|
|
1779
|
-
let
|
|
1780
|
-
s((
|
|
1843
|
+
let h;
|
|
1844
|
+
return s((b) => h = b), isGetterSetter(h) ? h.get() : h;
|
|
1845
|
+
}, c = (h) => {
|
|
1846
|
+
let b;
|
|
1847
|
+
s((v) => b = v), isGetterSetter(b) ? b.set(h) : o(() => {
|
|
1781
1848
|
}, {
|
|
1782
|
-
scope: { __placeholder:
|
|
1849
|
+
scope: { __placeholder: h }
|
|
1783
1850
|
});
|
|
1784
1851
|
};
|
|
1785
1852
|
typeof n == "string" && e.type === "radio" && mutateDom(() => {
|
|
1786
1853
|
e.hasAttribute("name") || e.setAttribute("name", n);
|
|
1787
1854
|
});
|
|
1788
1855
|
let u = e.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(e.type) || t.includes("lazy") ? "change" : "input", d = isCloning ? () => {
|
|
1789
|
-
} : on(e, u, t, (
|
|
1790
|
-
c(getInputValue(e, t,
|
|
1856
|
+
} : on(e, u, t, (h) => {
|
|
1857
|
+
c(getInputValue(e, t, h, l()));
|
|
1791
1858
|
});
|
|
1792
1859
|
if (t.includes("fill") && ([void 0, null, ""].includes(l()) || isCheckbox(e) && Array.isArray(l()) || e.tagName.toLowerCase() === "select" && e.multiple) && c(
|
|
1793
1860
|
getInputValue(e, t, { target: e }, l())
|
|
1794
1861
|
), e._x_removeModelListeners || (e._x_removeModelListeners = {}), e._x_removeModelListeners.default = d, r(() => e._x_removeModelListeners.default()), e.form) {
|
|
1795
|
-
let
|
|
1862
|
+
let h = on(e.form, "reset", [], (b) => {
|
|
1796
1863
|
nextTick(() => e._x_model && e._x_model.set(getInputValue(e, t, { target: e }, l())));
|
|
1797
1864
|
});
|
|
1798
|
-
r(() =>
|
|
1865
|
+
r(() => h());
|
|
1799
1866
|
}
|
|
1800
1867
|
e._x_model = {
|
|
1801
1868
|
get() {
|
|
1802
1869
|
return l();
|
|
1803
1870
|
},
|
|
1804
|
-
set(
|
|
1805
|
-
c(
|
|
1871
|
+
set(h) {
|
|
1872
|
+
c(h);
|
|
1806
1873
|
}
|
|
1807
|
-
}, e._x_forceModelUpdate = (
|
|
1808
|
-
|
|
1874
|
+
}, e._x_forceModelUpdate = (h) => {
|
|
1875
|
+
h === void 0 && typeof n == "string" && n.match(/\./) && (h = ""), window.fromModel = !0, mutateDom(() => bind(e, "value", h)), delete window.fromModel;
|
|
1809
1876
|
}, i(() => {
|
|
1810
|
-
let
|
|
1811
|
-
t.includes("unintrusive") && document.activeElement.isSameNode(e) || e._x_forceModelUpdate(
|
|
1877
|
+
let h = l();
|
|
1878
|
+
t.includes("unintrusive") && document.activeElement.isSameNode(e) || e._x_forceModelUpdate(h);
|
|
1812
1879
|
});
|
|
1813
1880
|
});
|
|
1814
1881
|
function getInputValue(e, t, n, i) {
|
|
@@ -1966,66 +2033,66 @@ directive("for", (e, { expression: t }, { effect: n, cleanup: i }) => {
|
|
|
1966
2033
|
function loop(e, t, n, i) {
|
|
1967
2034
|
let r = (s) => typeof s == "object" && !Array.isArray(s), a = e;
|
|
1968
2035
|
n((s) => {
|
|
1969
|
-
isNumeric3(s) && s >= 0 && (s = Array.from(Array(s).keys(), (
|
|
2036
|
+
isNumeric3(s) && s >= 0 && (s = Array.from(Array(s).keys(), (m) => m + 1)), s === void 0 && (s = []);
|
|
1970
2037
|
let o = e._x_lookup, l = e._x_prevKeys, c = [], u = [];
|
|
1971
2038
|
if (r(s))
|
|
1972
|
-
s = Object.entries(s).map(([
|
|
1973
|
-
let
|
|
1974
|
-
i((
|
|
1975
|
-
u.includes(
|
|
1976
|
-
}, { scope: { index:
|
|
2039
|
+
s = Object.entries(s).map(([m, E]) => {
|
|
2040
|
+
let g = getIterationScopeVariables(t, E, m, s);
|
|
2041
|
+
i((y) => {
|
|
2042
|
+
u.includes(y) && warn("Duplicate key on x-for", e), u.push(y);
|
|
2043
|
+
}, { scope: { index: m, ...g } }), c.push(g);
|
|
1977
2044
|
});
|
|
1978
2045
|
else
|
|
1979
|
-
for (let
|
|
1980
|
-
let
|
|
1981
|
-
i((
|
|
1982
|
-
u.includes(
|
|
1983
|
-
}, { scope: { index:
|
|
2046
|
+
for (let m = 0; m < s.length; m++) {
|
|
2047
|
+
let E = getIterationScopeVariables(t, s[m], m, s);
|
|
2048
|
+
i((g) => {
|
|
2049
|
+
u.includes(g) && warn("Duplicate key on x-for", e), u.push(g);
|
|
2050
|
+
}, { scope: { index: m, ...E } }), c.push(E);
|
|
1984
2051
|
}
|
|
1985
|
-
let d = [],
|
|
1986
|
-
for (let
|
|
1987
|
-
let
|
|
1988
|
-
u.indexOf(
|
|
1989
|
-
}
|
|
1990
|
-
l = l.filter((
|
|
1991
|
-
let
|
|
1992
|
-
for (let
|
|
1993
|
-
let
|
|
1994
|
-
if (
|
|
1995
|
-
l.splice(
|
|
1996
|
-
else if (
|
|
1997
|
-
let
|
|
1998
|
-
l.splice(
|
|
2052
|
+
let d = [], h = [], b = [], v = [];
|
|
2053
|
+
for (let m = 0; m < l.length; m++) {
|
|
2054
|
+
let E = l[m];
|
|
2055
|
+
u.indexOf(E) === -1 && b.push(E);
|
|
2056
|
+
}
|
|
2057
|
+
l = l.filter((m) => !b.includes(m));
|
|
2058
|
+
let x = "template";
|
|
2059
|
+
for (let m = 0; m < u.length; m++) {
|
|
2060
|
+
let E = u[m], g = l.indexOf(E);
|
|
2061
|
+
if (g === -1)
|
|
2062
|
+
l.splice(m, 0, E), d.push([x, m]);
|
|
2063
|
+
else if (g !== m) {
|
|
2064
|
+
let y = l.splice(m, 1)[0], f = l.splice(g - 1, 1)[0];
|
|
2065
|
+
l.splice(m, 0, f), l.splice(g, 0, y), h.push([y, f]);
|
|
1999
2066
|
} else
|
|
2000
|
-
|
|
2001
|
-
|
|
2067
|
+
v.push(E);
|
|
2068
|
+
x = E;
|
|
2002
2069
|
}
|
|
2003
|
-
for (let
|
|
2004
|
-
let
|
|
2005
|
-
|
|
2006
|
-
destroyTree(o[
|
|
2007
|
-
}), delete o[
|
|
2070
|
+
for (let m = 0; m < b.length; m++) {
|
|
2071
|
+
let E = b[m];
|
|
2072
|
+
E in o && (mutateDom(() => {
|
|
2073
|
+
destroyTree(o[E]), o[E].remove();
|
|
2074
|
+
}), delete o[E]);
|
|
2008
2075
|
}
|
|
2009
|
-
for (let
|
|
2010
|
-
let [
|
|
2076
|
+
for (let m = 0; m < h.length; m++) {
|
|
2077
|
+
let [E, g] = h[m], y = o[E], f = o[g], p = document.createElement("div");
|
|
2011
2078
|
mutateDom(() => {
|
|
2012
|
-
|
|
2013
|
-
}),
|
|
2014
|
-
}
|
|
2015
|
-
for (let
|
|
2016
|
-
let [
|
|
2017
|
-
|
|
2018
|
-
let
|
|
2019
|
-
addScopeToNode(
|
|
2020
|
-
Object.entries(
|
|
2021
|
-
|
|
2079
|
+
f || warn('x-for ":key" is undefined or invalid', a, g, o), f.after(p), y.after(f), f._x_currentIfEl && f.after(f._x_currentIfEl), p.before(y), y._x_currentIfEl && y.after(y._x_currentIfEl), p.remove();
|
|
2080
|
+
}), f._x_refreshXForScope(c[u.indexOf(g)]);
|
|
2081
|
+
}
|
|
2082
|
+
for (let m = 0; m < d.length; m++) {
|
|
2083
|
+
let [E, g] = d[m], y = E === "template" ? a : o[E];
|
|
2084
|
+
y._x_currentIfEl && (y = y._x_currentIfEl);
|
|
2085
|
+
let f = c[g], p = u[g], _ = document.importNode(a.content, !0).firstElementChild, w = reactive(f);
|
|
2086
|
+
addScopeToNode(_, w, a), _._x_refreshXForScope = (D) => {
|
|
2087
|
+
Object.entries(D).forEach(([A, C]) => {
|
|
2088
|
+
w[A] = C;
|
|
2022
2089
|
});
|
|
2023
2090
|
}, mutateDom(() => {
|
|
2024
|
-
|
|
2025
|
-
}), typeof
|
|
2091
|
+
y.after(_), skipDuringClone(() => initTree(_))();
|
|
2092
|
+
}), typeof p == "object" && warn("x-for key cannot be an object, it must be a string or an integer", a), o[p] = _;
|
|
2026
2093
|
}
|
|
2027
|
-
for (let
|
|
2028
|
-
o[
|
|
2094
|
+
for (let m = 0; m < v.length; m++)
|
|
2095
|
+
o[v[m]]._x_refreshXForScope(c[u.indexOf(v[m])]);
|
|
2029
2096
|
a._x_prevKeys = u;
|
|
2030
2097
|
});
|
|
2031
2098
|
}
|
|
@@ -2591,13 +2658,13 @@ function getBoundingClientRect(e, t, n) {
|
|
|
2591
2658
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2592
2659
|
var i = e.getBoundingClientRect(), r = 1, a = 1;
|
|
2593
2660
|
t && isHTMLElement(e) && (r = e.offsetWidth > 0 && round(i.width) / e.offsetWidth || 1, a = e.offsetHeight > 0 && round(i.height) / e.offsetHeight || 1);
|
|
2594
|
-
var s = isElement(e) ? getWindow(e) : window, o = s.visualViewport, l = !isLayoutViewport() && n, c = (i.left + (l && o ? o.offsetLeft : 0)) / r, u = (i.top + (l && o ? o.offsetTop : 0)) / a, d = i.width / r,
|
|
2661
|
+
var s = isElement(e) ? getWindow(e) : window, o = s.visualViewport, l = !isLayoutViewport() && n, c = (i.left + (l && o ? o.offsetLeft : 0)) / r, u = (i.top + (l && o ? o.offsetTop : 0)) / a, d = i.width / r, h = i.height / a;
|
|
2595
2662
|
return {
|
|
2596
2663
|
width: d,
|
|
2597
|
-
height:
|
|
2664
|
+
height: h,
|
|
2598
2665
|
top: u,
|
|
2599
2666
|
right: c + d,
|
|
2600
|
-
bottom: u +
|
|
2667
|
+
bottom: u + h,
|
|
2601
2668
|
left: c,
|
|
2602
2669
|
x: c,
|
|
2603
2670
|
y: u
|
|
@@ -2709,8 +2776,8 @@ var toPaddingObject = function(t, n) {
|
|
|
2709
2776
|
function arrow(e) {
|
|
2710
2777
|
var t, n = e.state, i = e.name, r = e.options, a = n.elements.arrow, s = n.modifiersData.popperOffsets, o = getBasePlacement(n.placement), l = getMainAxisFromPlacement(o), c = [left, right].indexOf(o) >= 0, u = c ? "height" : "width";
|
|
2711
2778
|
if (!(!a || !s)) {
|
|
2712
|
-
var d = toPaddingObject(r.padding, n),
|
|
2713
|
-
n.modifiersData[i] = (t = {}, t[
|
|
2779
|
+
var d = toPaddingObject(r.padding, n), h = getLayoutRect(a), b = l === "y" ? top : left, v = l === "y" ? bottom : right, x = n.rects.reference[u] + n.rects.reference[l] - s[l] - n.rects.popper[u], m = s[l] - n.rects.reference[l], E = getOffsetParent(a), g = E ? l === "y" ? E.clientHeight || 0 : E.clientWidth || 0 : 0, y = x / 2 - m / 2, f = d[b], p = g - h[u] - d[v], _ = g / 2 - h[u] / 2 + y, w = within(f, _, p), D = l;
|
|
2780
|
+
n.modifiersData[i] = (t = {}, t[D] = w, t.centerOffset = w - _, t);
|
|
2714
2781
|
}
|
|
2715
2782
|
}
|
|
2716
2783
|
function effect$1(e) {
|
|
@@ -2743,48 +2810,48 @@ function roundOffsetsByDPR(e, t) {
|
|
|
2743
2810
|
};
|
|
2744
2811
|
}
|
|
2745
2812
|
function mapToStyles(e) {
|
|
2746
|
-
var t, n = e.popper, i = e.popperRect, r = e.placement, a = e.variation, s = e.offsets, o = e.position, l = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, d = e.isFixed,
|
|
2747
|
-
x:
|
|
2748
|
-
y:
|
|
2813
|
+
var t, n = e.popper, i = e.popperRect, r = e.placement, a = e.variation, s = e.offsets, o = e.position, l = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, d = e.isFixed, h = s.x, b = h === void 0 ? 0 : h, v = s.y, x = v === void 0 ? 0 : v, m = typeof u == "function" ? u({
|
|
2814
|
+
x: b,
|
|
2815
|
+
y: x
|
|
2749
2816
|
}) : {
|
|
2750
|
-
x:
|
|
2751
|
-
y:
|
|
2817
|
+
x: b,
|
|
2818
|
+
y: x
|
|
2752
2819
|
};
|
|
2753
|
-
|
|
2754
|
-
var
|
|
2820
|
+
b = m.x, x = m.y;
|
|
2821
|
+
var E = s.hasOwnProperty("x"), g = s.hasOwnProperty("y"), y = left, f = top, p = window;
|
|
2755
2822
|
if (c) {
|
|
2756
|
-
var
|
|
2757
|
-
if (
|
|
2758
|
-
|
|
2759
|
-
var A = d &&
|
|
2823
|
+
var _ = getOffsetParent(n), w = "clientHeight", D = "clientWidth";
|
|
2824
|
+
if (_ === getWindow(n) && (_ = getDocumentElement(n), getComputedStyle$1(_).position !== "static" && o === "absolute" && (w = "scrollHeight", D = "scrollWidth")), _ = _, r === top || (r === left || r === right) && a === end) {
|
|
2825
|
+
f = bottom;
|
|
2826
|
+
var A = d && _ === p && p.visualViewport ? p.visualViewport.height : (
|
|
2760
2827
|
// $FlowFixMe[prop-missing]
|
|
2761
|
-
|
|
2828
|
+
_[w]
|
|
2762
2829
|
);
|
|
2763
|
-
|
|
2830
|
+
x -= A - i.height, x *= l ? 1 : -1;
|
|
2764
2831
|
}
|
|
2765
2832
|
if (r === left || (r === top || r === bottom) && a === end) {
|
|
2766
|
-
|
|
2767
|
-
var
|
|
2833
|
+
y = right;
|
|
2834
|
+
var C = d && _ === p && p.visualViewport ? p.visualViewport.width : (
|
|
2768
2835
|
// $FlowFixMe[prop-missing]
|
|
2769
|
-
|
|
2836
|
+
_[D]
|
|
2770
2837
|
);
|
|
2771
|
-
|
|
2838
|
+
b -= C - i.width, b *= l ? 1 : -1;
|
|
2772
2839
|
}
|
|
2773
2840
|
}
|
|
2774
|
-
var
|
|
2841
|
+
var S = Object.assign({
|
|
2775
2842
|
position: o
|
|
2776
|
-
}, c && unsetSides),
|
|
2777
|
-
x:
|
|
2778
|
-
y:
|
|
2843
|
+
}, c && unsetSides), O = u === !0 ? roundOffsetsByDPR({
|
|
2844
|
+
x: b,
|
|
2845
|
+
y: x
|
|
2779
2846
|
}, getWindow(n)) : {
|
|
2780
|
-
x:
|
|
2781
|
-
y:
|
|
2847
|
+
x: b,
|
|
2848
|
+
y: x
|
|
2782
2849
|
};
|
|
2783
|
-
if (
|
|
2850
|
+
if (b = O.x, x = O.y, l) {
|
|
2784
2851
|
var T;
|
|
2785
|
-
return Object.assign({},
|
|
2852
|
+
return Object.assign({}, S, (T = {}, T[f] = g ? "0" : "", T[y] = E ? "0" : "", T.transform = (p.devicePixelRatio || 1) <= 1 ? "translate(" + b + "px, " + x + "px)" : "translate3d(" + b + "px, " + x + "px, 0)", T));
|
|
2786
2853
|
}
|
|
2787
|
-
return Object.assign({},
|
|
2854
|
+
return Object.assign({}, S, (t = {}, t[f] = g ? x + "px" : "", t[y] = E ? b + "px" : "", t.transform = "", t));
|
|
2788
2855
|
}
|
|
2789
2856
|
function computeStyles(e) {
|
|
2790
2857
|
var t = e.state, n = e.options, i = n.gpuAcceleration, r = i === void 0 ? !0 : i, a = n.adaptive, s = a === void 0 ? !0 : a, o = n.roundOffsets, l = o === void 0 ? !0 : o, c = {
|
|
@@ -2984,43 +3051,43 @@ function computeOffsets(e) {
|
|
|
2984
3051
|
}
|
|
2985
3052
|
function detectOverflow(e, t) {
|
|
2986
3053
|
t === void 0 && (t = {});
|
|
2987
|
-
var n = t, i = n.placement, r = i === void 0 ? e.placement : i, a = n.strategy, s = a === void 0 ? e.strategy : a, o = n.boundary, l = o === void 0 ? clippingParents : o, c = n.rootBoundary, u = c === void 0 ? viewport : c, d = n.elementContext,
|
|
2988
|
-
reference:
|
|
2989
|
-
element:
|
|
3054
|
+
var n = t, i = n.placement, r = i === void 0 ? e.placement : i, a = n.strategy, s = a === void 0 ? e.strategy : a, o = n.boundary, l = o === void 0 ? clippingParents : o, c = n.rootBoundary, u = c === void 0 ? viewport : c, d = n.elementContext, h = d === void 0 ? popper : d, b = n.altBoundary, v = b === void 0 ? !1 : b, x = n.padding, m = x === void 0 ? 0 : x, E = mergePaddingObject(typeof m != "number" ? m : expandToHashMap(m, basePlacements)), g = h === popper ? reference : popper, y = e.rects.popper, f = e.elements[v ? g : h], p = getClippingRect(isElement(f) ? f : f.contextElement || getDocumentElement(e.elements.popper), l, u, s), _ = getBoundingClientRect(e.elements.reference), w = computeOffsets({
|
|
3055
|
+
reference: _,
|
|
3056
|
+
element: y,
|
|
2990
3057
|
placement: r
|
|
2991
|
-
}),
|
|
2992
|
-
top:
|
|
2993
|
-
bottom: A.bottom -
|
|
2994
|
-
left:
|
|
2995
|
-
right: A.right -
|
|
2996
|
-
},
|
|
2997
|
-
if (
|
|
2998
|
-
var
|
|
2999
|
-
Object.keys(
|
|
3000
|
-
var
|
|
3001
|
-
|
|
3058
|
+
}), D = rectToClientRect(Object.assign({}, y, w)), A = h === popper ? D : _, C = {
|
|
3059
|
+
top: p.top - A.top + E.top,
|
|
3060
|
+
bottom: A.bottom - p.bottom + E.bottom,
|
|
3061
|
+
left: p.left - A.left + E.left,
|
|
3062
|
+
right: A.right - p.right + E.right
|
|
3063
|
+
}, S = e.modifiersData.offset;
|
|
3064
|
+
if (h === popper && S) {
|
|
3065
|
+
var O = S[r];
|
|
3066
|
+
Object.keys(C).forEach(function(T) {
|
|
3067
|
+
var L = [right, bottom].indexOf(T) >= 0 ? 1 : -1, R = [top, bottom].indexOf(T) >= 0 ? "y" : "x";
|
|
3068
|
+
C[T] += O[R] * L;
|
|
3002
3069
|
});
|
|
3003
3070
|
}
|
|
3004
|
-
return
|
|
3071
|
+
return C;
|
|
3005
3072
|
}
|
|
3006
3073
|
function computeAutoPlacement(e, t) {
|
|
3007
3074
|
t === void 0 && (t = {});
|
|
3008
|
-
var n = t, i = n.placement, r = n.boundary, a = n.rootBoundary, s = n.padding, o = n.flipVariations, l = n.allowedAutoPlacements, c = l === void 0 ? placements : l, u = getVariation(i), d = u ? o ? variationPlacements : variationPlacements.filter(function(
|
|
3009
|
-
return getVariation(
|
|
3010
|
-
}) : basePlacements,
|
|
3011
|
-
return c.indexOf(
|
|
3075
|
+
var n = t, i = n.placement, r = n.boundary, a = n.rootBoundary, s = n.padding, o = n.flipVariations, l = n.allowedAutoPlacements, c = l === void 0 ? placements : l, u = getVariation(i), d = u ? o ? variationPlacements : variationPlacements.filter(function(v) {
|
|
3076
|
+
return getVariation(v) === u;
|
|
3077
|
+
}) : basePlacements, h = d.filter(function(v) {
|
|
3078
|
+
return c.indexOf(v) >= 0;
|
|
3012
3079
|
});
|
|
3013
|
-
|
|
3014
|
-
var
|
|
3015
|
-
return
|
|
3016
|
-
placement:
|
|
3080
|
+
h.length === 0 && (h = d);
|
|
3081
|
+
var b = h.reduce(function(v, x) {
|
|
3082
|
+
return v[x] = detectOverflow(e, {
|
|
3083
|
+
placement: x,
|
|
3017
3084
|
boundary: r,
|
|
3018
3085
|
rootBoundary: a,
|
|
3019
3086
|
padding: s
|
|
3020
|
-
})[getBasePlacement(
|
|
3087
|
+
})[getBasePlacement(x)], v;
|
|
3021
3088
|
}, {});
|
|
3022
|
-
return Object.keys(
|
|
3023
|
-
return
|
|
3089
|
+
return Object.keys(b).sort(function(v, x) {
|
|
3090
|
+
return b[v] - b[x];
|
|
3024
3091
|
});
|
|
3025
3092
|
}
|
|
3026
3093
|
function getExpandedFallbackPlacements(e) {
|
|
@@ -3032,44 +3099,44 @@ function getExpandedFallbackPlacements(e) {
|
|
|
3032
3099
|
function flip(e) {
|
|
3033
3100
|
var t = e.state, n = e.options, i = e.name;
|
|
3034
3101
|
if (!t.modifiersData[i]._skip) {
|
|
3035
|
-
for (var r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !0 : s, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary,
|
|
3102
|
+
for (var r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !0 : s, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary, h = n.altBoundary, b = n.flipVariations, v = b === void 0 ? !0 : b, x = n.allowedAutoPlacements, m = t.options.placement, E = getBasePlacement(m), g = E === m, y = l || (g || !v ? [getOppositePlacement(m)] : getExpandedFallbackPlacements(m)), f = [m].concat(y).reduce(function(V, B) {
|
|
3036
3103
|
return V.concat(getBasePlacement(B) === auto ? computeAutoPlacement(t, {
|
|
3037
3104
|
placement: B,
|
|
3038
3105
|
boundary: u,
|
|
3039
3106
|
rootBoundary: d,
|
|
3040
3107
|
padding: c,
|
|
3041
|
-
flipVariations:
|
|
3042
|
-
allowedAutoPlacements:
|
|
3108
|
+
flipVariations: v,
|
|
3109
|
+
allowedAutoPlacements: x
|
|
3043
3110
|
}) : B);
|
|
3044
|
-
}, []),
|
|
3045
|
-
var
|
|
3046
|
-
placement:
|
|
3111
|
+
}, []), p = t.rects.reference, _ = t.rects.popper, w = /* @__PURE__ */ new Map(), D = !0, A = f[0], C = 0; C < f.length; C++) {
|
|
3112
|
+
var S = f[C], O = getBasePlacement(S), T = getVariation(S) === start, L = [top, bottom].indexOf(O) >= 0, R = L ? "width" : "height", H = detectOverflow(t, {
|
|
3113
|
+
placement: S,
|
|
3047
3114
|
boundary: u,
|
|
3048
3115
|
rootBoundary: d,
|
|
3049
|
-
altBoundary:
|
|
3116
|
+
altBoundary: h,
|
|
3050
3117
|
padding: c
|
|
3051
|
-
}),
|
|
3052
|
-
|
|
3053
|
-
var W = getOppositePlacement(
|
|
3054
|
-
if (a && $.push(
|
|
3118
|
+
}), I = L ? T ? right : left : T ? bottom : top;
|
|
3119
|
+
p[R] > _[R] && (I = getOppositePlacement(I));
|
|
3120
|
+
var W = getOppositePlacement(I), $ = [];
|
|
3121
|
+
if (a && $.push(H[O] <= 0), o && $.push(H[I] <= 0, H[W] <= 0), $.every(function(V) {
|
|
3055
3122
|
return V;
|
|
3056
3123
|
})) {
|
|
3057
|
-
A =
|
|
3124
|
+
A = S, D = !1;
|
|
3058
3125
|
break;
|
|
3059
3126
|
}
|
|
3060
|
-
|
|
3061
|
-
}
|
|
3062
|
-
if (
|
|
3063
|
-
for (var q =
|
|
3064
|
-
var
|
|
3065
|
-
var
|
|
3066
|
-
if (
|
|
3067
|
-
return
|
|
3127
|
+
w.set(S, $);
|
|
3128
|
+
}
|
|
3129
|
+
if (D)
|
|
3130
|
+
for (var q = v ? 3 : 1, N = function(B) {
|
|
3131
|
+
var k = f.find(function(M) {
|
|
3132
|
+
var F = w.get(M);
|
|
3133
|
+
if (F)
|
|
3134
|
+
return F.slice(0, B).every(function(K) {
|
|
3068
3135
|
return K;
|
|
3069
3136
|
});
|
|
3070
3137
|
});
|
|
3071
|
-
if (
|
|
3072
|
-
return A =
|
|
3138
|
+
if (k)
|
|
3139
|
+
return A = k, "break";
|
|
3073
3140
|
}, P = q; P > 0; P--) {
|
|
3074
3141
|
var j = N(P);
|
|
3075
3142
|
if (j === "break") break;
|
|
@@ -3170,36 +3237,36 @@ function getAltAxis(e) {
|
|
|
3170
3237
|
return e === "x" ? "y" : "x";
|
|
3171
3238
|
}
|
|
3172
3239
|
function preventOverflow(e) {
|
|
3173
|
-
var t = e.state, n = e.options, i = e.name, r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !1 : s, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding,
|
|
3240
|
+
var t = e.state, n = e.options, i = e.name, r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !1 : s, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding, h = n.tether, b = h === void 0 ? !0 : h, v = n.tetherOffset, x = v === void 0 ? 0 : v, m = detectOverflow(t, {
|
|
3174
3241
|
boundary: l,
|
|
3175
3242
|
rootBoundary: c,
|
|
3176
3243
|
padding: d,
|
|
3177
3244
|
altBoundary: u
|
|
3178
|
-
}),
|
|
3245
|
+
}), E = getBasePlacement(t.placement), g = getVariation(t.placement), y = !g, f = getMainAxisFromPlacement(E), p = getAltAxis(f), _ = t.modifiersData.popperOffsets, w = t.rects.reference, D = t.rects.popper, A = typeof x == "function" ? x(Object.assign({}, t.rects, {
|
|
3179
3246
|
placement: t.placement
|
|
3180
|
-
})) :
|
|
3247
|
+
})) : x, C = typeof A == "number" ? {
|
|
3181
3248
|
mainAxis: A,
|
|
3182
3249
|
altAxis: A
|
|
3183
3250
|
} : Object.assign({
|
|
3184
3251
|
mainAxis: 0,
|
|
3185
3252
|
altAxis: 0
|
|
3186
|
-
}, A),
|
|
3253
|
+
}, A), S = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, O = {
|
|
3187
3254
|
x: 0,
|
|
3188
3255
|
y: 0
|
|
3189
3256
|
};
|
|
3190
|
-
if (
|
|
3257
|
+
if (_) {
|
|
3191
3258
|
if (a) {
|
|
3192
|
-
var T,
|
|
3259
|
+
var T, L = f === "y" ? top : left, R = f === "y" ? bottom : right, H = f === "y" ? "height" : "width", I = _[f], W = I + m[L], $ = I - m[R], q = b ? -D[H] / 2 : 0, N = g === start ? w[H] : D[H], P = g === start ? -D[H] : -w[H], j = t.elements.arrow, V = b && j ? getLayoutRect(j) : {
|
|
3193
3260
|
width: 0,
|
|
3194
3261
|
height: 0
|
|
3195
|
-
}, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(),
|
|
3196
|
-
|
|
3262
|
+
}, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(), k = B[L], M = B[R], F = within(0, w[H], V[H]), K = y ? w[H] / 2 - q - F - k - C.mainAxis : N - F - k - C.mainAxis, ae = y ? -w[H] / 2 + q + F + M + C.mainAxis : P + F + M + C.mainAxis, Y = t.elements.arrow && getOffsetParent(t.elements.arrow), se = Y ? f === "y" ? Y.clientTop || 0 : Y.clientLeft || 0 : 0, J = (T = S?.[f]) != null ? T : 0, oe = I + K - J - se, le = I + ae - J, G = within(b ? min(W, oe) : W, I, b ? max($, le) : $);
|
|
3263
|
+
_[f] = G, O[f] = G - I;
|
|
3197
3264
|
}
|
|
3198
3265
|
if (o) {
|
|
3199
|
-
var Z, ce =
|
|
3200
|
-
|
|
3266
|
+
var Z, ce = f === "x" ? top : left, ue = f === "x" ? bottom : right, z = _[p], U = p === "y" ? "height" : "width", Q = z + m[ce], ee = z - m[ue], X = [top, left].indexOf(E) !== -1, te = (Z = S?.[p]) != null ? Z : 0, ne = X ? Q : z - w[U] - D[U] - te + C.altAxis, ie = X ? z + w[U] + D[U] - te - C.altAxis : ee, re = b && X ? withinMaxClamp(ne, z, ie) : within(b ? ne : Q, z, b ? ie : ee);
|
|
3267
|
+
_[p] = re, O[p] = re - z;
|
|
3201
3268
|
}
|
|
3202
|
-
t.modifiersData[i] =
|
|
3269
|
+
t.modifiersData[i] = O;
|
|
3203
3270
|
}
|
|
3204
3271
|
}
|
|
3205
3272
|
const preventOverflow$1 = {
|
|
@@ -3316,18 +3383,18 @@ function popperGenerator(e) {
|
|
|
3316
3383
|
},
|
|
3317
3384
|
attributes: {},
|
|
3318
3385
|
styles: {}
|
|
3319
|
-
}, d = [],
|
|
3386
|
+
}, d = [], h = !1, b = {
|
|
3320
3387
|
state: u,
|
|
3321
|
-
setOptions: function(
|
|
3322
|
-
var
|
|
3323
|
-
|
|
3388
|
+
setOptions: function(E) {
|
|
3389
|
+
var g = typeof E == "function" ? E(u.options) : E;
|
|
3390
|
+
x(), u.options = Object.assign({}, a, u.options, g), u.scrollParents = {
|
|
3324
3391
|
reference: isElement(o) ? listScrollParents(o) : o.contextElement ? listScrollParents(o.contextElement) : [],
|
|
3325
3392
|
popper: listScrollParents(l)
|
|
3326
3393
|
};
|
|
3327
|
-
var
|
|
3328
|
-
return u.orderedModifiers =
|
|
3329
|
-
return
|
|
3330
|
-
}),
|
|
3394
|
+
var y = orderModifiers(mergeByName([].concat(i, u.options.modifiers)));
|
|
3395
|
+
return u.orderedModifiers = y.filter(function(f) {
|
|
3396
|
+
return f.enabled;
|
|
3397
|
+
}), v(), b.update();
|
|
3331
3398
|
},
|
|
3332
3399
|
// Sync update – it will always be executed, even if not necessary. This
|
|
3333
3400
|
// is useful for low frequency updates where sync behavior simplifies the
|
|
@@ -3335,26 +3402,26 @@ function popperGenerator(e) {
|
|
|
3335
3402
|
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
3336
3403
|
// prefer the async Popper#update method
|
|
3337
3404
|
forceUpdate: function() {
|
|
3338
|
-
if (!
|
|
3339
|
-
var
|
|
3340
|
-
if (areValidElements(
|
|
3405
|
+
if (!h) {
|
|
3406
|
+
var E = u.elements, g = E.reference, y = E.popper;
|
|
3407
|
+
if (areValidElements(g, y)) {
|
|
3341
3408
|
u.rects = {
|
|
3342
|
-
reference: getCompositeRect(
|
|
3343
|
-
popper: getLayoutRect(
|
|
3344
|
-
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(
|
|
3345
|
-
return u.modifiersData[
|
|
3409
|
+
reference: getCompositeRect(g, getOffsetParent(y), u.options.strategy === "fixed"),
|
|
3410
|
+
popper: getLayoutRect(y)
|
|
3411
|
+
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(C) {
|
|
3412
|
+
return u.modifiersData[C.name] = Object.assign({}, C.data);
|
|
3346
3413
|
});
|
|
3347
|
-
for (var
|
|
3414
|
+
for (var f = 0; f < u.orderedModifiers.length; f++) {
|
|
3348
3415
|
if (u.reset === !0) {
|
|
3349
|
-
u.reset = !1,
|
|
3416
|
+
u.reset = !1, f = -1;
|
|
3350
3417
|
continue;
|
|
3351
3418
|
}
|
|
3352
|
-
var
|
|
3353
|
-
typeof
|
|
3419
|
+
var p = u.orderedModifiers[f], _ = p.fn, w = p.options, D = w === void 0 ? {} : w, A = p.name;
|
|
3420
|
+
typeof _ == "function" && (u = _({
|
|
3354
3421
|
state: u,
|
|
3355
|
-
options:
|
|
3422
|
+
options: D,
|
|
3356
3423
|
name: A,
|
|
3357
|
-
instance:
|
|
3424
|
+
instance: b
|
|
3358
3425
|
}) || u);
|
|
3359
3426
|
}
|
|
3360
3427
|
}
|
|
@@ -3363,40 +3430,40 @@ function popperGenerator(e) {
|
|
|
3363
3430
|
// Async and optimistically optimized update – it will not be executed if
|
|
3364
3431
|
// not necessary (debounced to run at most once-per-tick)
|
|
3365
3432
|
update: debounce(function() {
|
|
3366
|
-
return new Promise(function(
|
|
3367
|
-
|
|
3433
|
+
return new Promise(function(m) {
|
|
3434
|
+
b.forceUpdate(), m(u);
|
|
3368
3435
|
});
|
|
3369
3436
|
}),
|
|
3370
3437
|
destroy: function() {
|
|
3371
|
-
|
|
3438
|
+
x(), h = !0;
|
|
3372
3439
|
}
|
|
3373
3440
|
};
|
|
3374
3441
|
if (!areValidElements(o, l))
|
|
3375
|
-
return
|
|
3376
|
-
|
|
3377
|
-
!
|
|
3442
|
+
return b;
|
|
3443
|
+
b.setOptions(c).then(function(m) {
|
|
3444
|
+
!h && c.onFirstUpdate && c.onFirstUpdate(m);
|
|
3378
3445
|
});
|
|
3379
|
-
function
|
|
3380
|
-
u.orderedModifiers.forEach(function(
|
|
3381
|
-
var
|
|
3382
|
-
if (typeof
|
|
3383
|
-
var
|
|
3446
|
+
function v() {
|
|
3447
|
+
u.orderedModifiers.forEach(function(m) {
|
|
3448
|
+
var E = m.name, g = m.options, y = g === void 0 ? {} : g, f = m.effect;
|
|
3449
|
+
if (typeof f == "function") {
|
|
3450
|
+
var p = f({
|
|
3384
3451
|
state: u,
|
|
3385
|
-
name:
|
|
3386
|
-
instance:
|
|
3387
|
-
options:
|
|
3388
|
-
}),
|
|
3452
|
+
name: E,
|
|
3453
|
+
instance: b,
|
|
3454
|
+
options: y
|
|
3455
|
+
}), _ = function() {
|
|
3389
3456
|
};
|
|
3390
|
-
d.push(
|
|
3457
|
+
d.push(p || _);
|
|
3391
3458
|
}
|
|
3392
3459
|
});
|
|
3393
3460
|
}
|
|
3394
|
-
function
|
|
3395
|
-
d.forEach(function(
|
|
3396
|
-
return
|
|
3461
|
+
function x() {
|
|
3462
|
+
d.forEach(function(m) {
|
|
3463
|
+
return m();
|
|
3397
3464
|
}), d = [];
|
|
3398
3465
|
}
|
|
3399
|
-
return
|
|
3466
|
+
return b;
|
|
3400
3467
|
};
|
|
3401
3468
|
}
|
|
3402
3469
|
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1], createPopper = /* @__PURE__ */ popperGenerator({
|
|
@@ -4864,8 +4931,8 @@ function parseFormatString(e) {
|
|
|
4864
4931
|
parser: function(s, o) {
|
|
4865
4932
|
var l = s.split(reNonDateParts).reduce(function(c, u, d) {
|
|
4866
4933
|
if (u.length > 0 && n[d]) {
|
|
4867
|
-
var
|
|
4868
|
-
|
|
4934
|
+
var h = n[d][0];
|
|
4935
|
+
h === "M" ? c.m = u : h !== "D" && (c[h] = u);
|
|
4869
4936
|
}
|
|
4870
4937
|
return c;
|
|
4871
4938
|
}, {});
|
|
@@ -5017,60 +5084,60 @@ function validateViewId(e, t) {
|
|
|
5017
5084
|
return i >= 0 && i <= n ? i : t;
|
|
5018
5085
|
}
|
|
5019
5086
|
function processOptions(e, t) {
|
|
5020
|
-
var n = Object.assign({}, e), i = {}, r = t.constructor.locales, a = t.config || {}, s = a.format, o = a.language, l = a.locale, c = a.maxDate, u = a.maxView, d = a.minDate,
|
|
5087
|
+
var n = Object.assign({}, e), i = {}, r = t.constructor.locales, a = t.config || {}, s = a.format, o = a.language, l = a.locale, c = a.maxDate, u = a.maxView, d = a.minDate, h = a.pickLevel, b = a.startView, v = a.weekStart;
|
|
5021
5088
|
if (n.language) {
|
|
5022
|
-
var
|
|
5023
|
-
if (n.language !== o && (r[n.language] ?
|
|
5024
|
-
o = i.language =
|
|
5025
|
-
var
|
|
5089
|
+
var x;
|
|
5090
|
+
if (n.language !== o && (r[n.language] ? x = n.language : (x = n.language.split("-")[0], r[x] === void 0 && (x = !1))), delete n.language, x) {
|
|
5091
|
+
o = i.language = x;
|
|
5092
|
+
var m = l || r[defaultLang];
|
|
5026
5093
|
l = Object.assign({
|
|
5027
5094
|
format: defaultFormat,
|
|
5028
5095
|
weekStart: defaultWeekStart
|
|
5029
|
-
}, r[defaultLang]), o !== defaultLang && Object.assign(l, r[o]), i.locale = l, s ===
|
|
5096
|
+
}, r[defaultLang]), o !== defaultLang && Object.assign(l, r[o]), i.locale = l, s === m.format && (s = i.format = l.format), v === m.weekStart && (v = i.weekStart = l.weekStart, i.weekEnd = calcEndOfWeek(l.weekStart));
|
|
5030
5097
|
}
|
|
5031
5098
|
}
|
|
5032
5099
|
if (n.format) {
|
|
5033
|
-
var
|
|
5034
|
-
(
|
|
5100
|
+
var E = typeof n.format.toDisplay == "function", g = typeof n.format.toValue == "function", y = reFormatTokens.test(n.format);
|
|
5101
|
+
(E && g || y) && (s = i.format = n.format), delete n.format;
|
|
5035
5102
|
}
|
|
5036
|
-
var
|
|
5037
|
-
if (n.minDate !== void 0 && (
|
|
5038
|
-
var
|
|
5039
|
-
return
|
|
5103
|
+
var f = d, p = c;
|
|
5104
|
+
if (n.minDate !== void 0 && (f = n.minDate === null ? dateValue(0, 0, 1) : validateDate(n.minDate, s, l, f), delete n.minDate), n.maxDate !== void 0 && (p = n.maxDate === null ? void 0 : validateDate(n.maxDate, s, l, p), delete n.maxDate), p < f ? (d = i.minDate = p, c = i.maxDate = f) : (d !== f && (d = i.minDate = f), c !== p && (c = i.maxDate = p)), n.datesDisabled && (i.datesDisabled = n.datesDisabled.reduce(function(R, H) {
|
|
5105
|
+
var I = parseDate(H, s, l);
|
|
5106
|
+
return I !== void 0 ? pushUnique(R, I) : R;
|
|
5040
5107
|
}, []), delete n.datesDisabled), n.defaultViewDate !== void 0) {
|
|
5041
|
-
var
|
|
5042
|
-
|
|
5108
|
+
var _ = parseDate(n.defaultViewDate, s, l);
|
|
5109
|
+
_ !== void 0 && (i.defaultViewDate = _), delete n.defaultViewDate;
|
|
5043
5110
|
}
|
|
5044
5111
|
if (n.weekStart !== void 0) {
|
|
5045
|
-
var
|
|
5046
|
-
isNaN(
|
|
5112
|
+
var w = Number(n.weekStart) % 7;
|
|
5113
|
+
isNaN(w) || (v = i.weekStart = w, i.weekEnd = calcEndOfWeek(w)), delete n.weekStart;
|
|
5047
5114
|
}
|
|
5048
5115
|
if (n.daysOfWeekDisabled && (i.daysOfWeekDisabled = n.daysOfWeekDisabled.reduce(sanitizeDOW, []), delete n.daysOfWeekDisabled), n.daysOfWeekHighlighted && (i.daysOfWeekHighlighted = n.daysOfWeekHighlighted.reduce(sanitizeDOW, []), delete n.daysOfWeekHighlighted), n.maxNumberOfDates !== void 0) {
|
|
5049
|
-
var
|
|
5050
|
-
|
|
5116
|
+
var D = parseInt(n.maxNumberOfDates, 10);
|
|
5117
|
+
D >= 0 && (i.maxNumberOfDates = D, i.multidate = D !== 1), delete n.maxNumberOfDates;
|
|
5051
5118
|
}
|
|
5052
5119
|
n.dateDelimiter && (i.dateDelimiter = String(n.dateDelimiter), delete n.dateDelimiter);
|
|
5053
|
-
var A =
|
|
5054
|
-
n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !==
|
|
5055
|
-
var
|
|
5056
|
-
n.maxView !== void 0 && (
|
|
5057
|
-
var
|
|
5058
|
-
if (n.startView !== void 0 && (
|
|
5059
|
-
var
|
|
5060
|
-
|
|
5120
|
+
var A = h;
|
|
5121
|
+
n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !== h && (h = i.pickLevel = A);
|
|
5122
|
+
var C = u;
|
|
5123
|
+
n.maxView !== void 0 && (C = validateViewId(n.maxView, u), delete n.maxView), C = h > C ? h : C, C !== u && (u = i.maxView = C);
|
|
5124
|
+
var S = b;
|
|
5125
|
+
if (n.startView !== void 0 && (S = validateViewId(n.startView, S), delete n.startView), S < h ? S = h : S > u && (S = u), S !== b && (i.startView = S), n.prevArrow) {
|
|
5126
|
+
var O = parseHTML(n.prevArrow);
|
|
5127
|
+
O.childNodes.length > 0 && (i.prevArrow = O.childNodes), delete n.prevArrow;
|
|
5061
5128
|
}
|
|
5062
5129
|
if (n.nextArrow) {
|
|
5063
5130
|
var T = parseHTML(n.nextArrow);
|
|
5064
5131
|
T.childNodes.length > 0 && (i.nextArrow = T.childNodes), delete n.nextArrow;
|
|
5065
5132
|
}
|
|
5066
5133
|
if (n.disableTouchKeyboard !== void 0 && (i.disableTouchKeyboard = "ontouchstart" in document && !!n.disableTouchKeyboard, delete n.disableTouchKeyboard), n.orientation) {
|
|
5067
|
-
var
|
|
5134
|
+
var L = n.orientation.toLowerCase().split(/\s+/g);
|
|
5068
5135
|
i.orientation = {
|
|
5069
|
-
x:
|
|
5070
|
-
return
|
|
5136
|
+
x: L.find(function(R) {
|
|
5137
|
+
return R === "left" || R === "right";
|
|
5071
5138
|
}) || "auto",
|
|
5072
|
-
y:
|
|
5073
|
-
return
|
|
5139
|
+
y: L.find(function(R) {
|
|
5140
|
+
return R === "top" || R === "bottom";
|
|
5074
5141
|
}) || "auto"
|
|
5075
5142
|
}, delete n.orientation;
|
|
5076
5143
|
}
|
|
@@ -5082,8 +5149,8 @@ function processOptions(e, t) {
|
|
|
5082
5149
|
}
|
|
5083
5150
|
delete n.todayBtnMode;
|
|
5084
5151
|
}
|
|
5085
|
-
return Object.keys(n).forEach(function(
|
|
5086
|
-
n[
|
|
5152
|
+
return Object.keys(n).forEach(function(R) {
|
|
5153
|
+
n[R] !== void 0 && hasProperty(defaultOptions, R) && (i[R] = n[R]);
|
|
5087
5154
|
}), i;
|
|
5088
5155
|
}
|
|
5089
5156
|
var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
@@ -5227,8 +5294,8 @@ var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
|
5227
5294
|
Array.from(this.grid.children).forEach(function(s, o) {
|
|
5228
5295
|
var l = s.classList, c = addDays(i.start, o), u = new Date(c), d = u.getDay();
|
|
5229
5296
|
if (s.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), s.dataset.date = c, s.textContent = u.getDate(), c < i.first ? l.add("prev", "text-fg-disabled") : c > i.last && l.add("next", "text-fg-disabled"), i.today === c && l.add("today", "bg-gray-100", "dark:bg-gray-600"), (c < i.minDate || c > i.maxDate || i.disabled.includes(c)) && (l.add("disabled", "cursor-not-allowed", "text-fg-disabled"), l.remove("hover:bg-neutral-tertiary-medium", "text-body", "cursor-pointer")), i.daysOfWeekDisabled.includes(d) && (l.add("disabled", "cursor-not-allowed", "text-fg-disabled"), l.remove("hover:bg-neutral-tertiary-medium", "text-body", "cursor-pointer"), pushUnique(i.disabled, c)), i.daysOfWeekHighlighted.includes(d) && l.add("highlighted"), i.range) {
|
|
5230
|
-
var
|
|
5231
|
-
c >
|
|
5297
|
+
var h = _slicedToArray(i.range, 2), b = h[0], v = h[1];
|
|
5298
|
+
c > b && c < v && (l.add("range", "bg-neutral-tertiary-medium"), l.remove("rounded-base", "rounded-s-base", "rounded-e-base")), c === b && (l.add("range-start", "bg-brand", "rounded-s-base"), l.remove("rounded-base", "rounded-e-base")), c === v && (l.add("range-end", "bg-neutral-tertiary-medium", "rounded-e-base"), l.remove("rounded-base", "rounded-s-base"));
|
|
5232
5299
|
}
|
|
5233
5300
|
i.selected.includes(c) && (l.add("selected", "bg-brand", "text-white"), l.remove("text-body", "hover:bg-neutral-tertiary-medium", "bg-neutral-tertiary-medium")), c === i.focused && l.add("focused"), i.beforeShow && i.performBeforeHook(s, c, c);
|
|
5234
5301
|
});
|
|
@@ -5328,12 +5395,12 @@ var MonthsView = /* @__PURE__ */ (function(e) {
|
|
|
5328
5395
|
this.disabled = [], this.picker.setViewSwitchLabel(this.year), this.picker.setPrevBtnDisabled(this.year <= this.minYear), this.picker.setNextBtnDisabled(this.year >= this.maxYear);
|
|
5329
5396
|
var r = this.selected[this.year] || [], a = this.year < this.minYear || this.year > this.maxYear, s = this.year === this.minYear, o = this.year === this.maxYear, l = computeMonthRange(this.range, this.year);
|
|
5330
5397
|
Array.from(this.grid.children).forEach(function(c, u) {
|
|
5331
|
-
var d = c.classList,
|
|
5332
|
-
if (c.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), i.isMinView && (c.dataset.date =
|
|
5333
|
-
var
|
|
5334
|
-
u >
|
|
5398
|
+
var d = c.classList, h = dateValue(i.year, u, 1);
|
|
5399
|
+
if (c.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), i.isMinView && (c.dataset.date = h), c.textContent = i.monthNames[u], (a || s && u < i.minMonth || o && u > i.maxMonth) && d.add("disabled"), l) {
|
|
5400
|
+
var b = _slicedToArray(l, 2), v = b[0], x = b[1];
|
|
5401
|
+
u > v && u < x && d.add("range"), u === v && d.add("range-start"), u === x && d.add("range-end");
|
|
5335
5402
|
}
|
|
5336
|
-
r.includes(u) && (d.add("selected", "bg-brand", "text-white", "dark:text-white"), d.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), u === i.focused && d.add("focused"), i.beforeShow && i.performBeforeHook(c, u,
|
|
5403
|
+
r.includes(u) && (d.add("selected", "bg-brand", "text-white", "dark:text-white"), d.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), u === i.focused && d.add("focused"), i.beforeShow && i.performBeforeHook(c, u, h);
|
|
5337
5404
|
});
|
|
5338
5405
|
}
|
|
5339
5406
|
// Update the view UI by applying the changes of selected and focused items
|
|
@@ -5552,19 +5619,19 @@ function getTextDirection(e) {
|
|
|
5552
5619
|
var Picker = /* @__PURE__ */ (function() {
|
|
5553
5620
|
function e(t) {
|
|
5554
5621
|
_classCallCheck(this, e), this.datepicker = t;
|
|
5555
|
-
var n = pickerTemplate.replace(/%buttonClass%/g, t.config.buttonClass), i = this.element = parseHTML(n).firstChild, r = _slicedToArray(i.firstChild.children, 3), a = r[0], s = r[1], o = r[2], l = a.firstElementChild, c = _slicedToArray(a.lastElementChild.children, 3), u = c[0], d = c[1],
|
|
5622
|
+
var n = pickerTemplate.replace(/%buttonClass%/g, t.config.buttonClass), i = this.element = parseHTML(n).firstChild, r = _slicedToArray(i.firstChild.children, 3), a = r[0], s = r[1], o = r[2], l = a.firstElementChild, c = _slicedToArray(a.lastElementChild.children, 3), u = c[0], d = c[1], h = c[2], b = _slicedToArray(o.firstChild.children, 2), v = b[0], x = b[1], m = {
|
|
5556
5623
|
title: l,
|
|
5557
5624
|
prevBtn: u,
|
|
5558
5625
|
viewSwitch: d,
|
|
5559
|
-
nextBtn:
|
|
5560
|
-
todayBtn:
|
|
5561
|
-
clearBtn:
|
|
5626
|
+
nextBtn: h,
|
|
5627
|
+
todayBtn: v,
|
|
5628
|
+
clearBtn: x
|
|
5562
5629
|
};
|
|
5563
|
-
this.main = s, this.controls =
|
|
5564
|
-
var
|
|
5565
|
-
i.classList.add("datepicker-".concat(
|
|
5630
|
+
this.main = s, this.controls = m;
|
|
5631
|
+
var E = t.inline ? "inline" : "dropdown";
|
|
5632
|
+
i.classList.add("datepicker-".concat(E)), E === "dropdown" && i.classList.add("dropdown", "absolute", "top-0", "left-0", "z-50", "pt-2"), processPickerOptions(this, t.config), this.viewDate = computeResetViewDate(t), registerListeners(t, [[i, "click", onClickPicker.bind(null, t), {
|
|
5566
5633
|
capture: !0
|
|
5567
|
-
}], [s, "click", onClickView.bind(null, t)], [
|
|
5634
|
+
}], [s, "click", onClickView.bind(null, t)], [m.viewSwitch, "click", onClickViewSwitch.bind(null, t)], [m.prevBtn, "click", onClickPrevBtn.bind(null, t)], [m.nextBtn, "click", onClickNextBtn.bind(null, t)], [m.todayBtn, "click", onClickTodayBtn.bind(null, t)], [m.clearBtn, "click", onClickClearBtn.bind(null, t)]]), this.views = [new DaysView(this), new MonthsView(this), new YearsView(this, {
|
|
5568
5635
|
id: 2,
|
|
5569
5636
|
name: "years",
|
|
5570
5637
|
cellClass: "year",
|
|
@@ -5609,8 +5676,8 @@ var Picker = /* @__PURE__ */ (function() {
|
|
|
5609
5676
|
}, {
|
|
5610
5677
|
key: "place",
|
|
5611
5678
|
value: function() {
|
|
5612
|
-
var n = this.element, i = n.classList, r = n.style, a = this.datepicker, s = a.config, o = a.inputField, l = s.container, c = this.element.getBoundingClientRect(), u = c.width, d = c.height,
|
|
5613
|
-
l === document.body ? (
|
|
5679
|
+
var n = this.element, i = n.classList, r = n.style, a = this.datepicker, s = a.config, o = a.inputField, l = s.container, c = this.element.getBoundingClientRect(), u = c.width, d = c.height, h = l.getBoundingClientRect(), b = h.left, v = h.top, x = h.width, m = o.getBoundingClientRect(), E = m.left, g = m.top, y = m.width, f = m.height, p = s.orientation, _ = p.x, w = p.y, D, A, C;
|
|
5680
|
+
l === document.body ? (D = window.scrollY, A = E + window.scrollX, C = g + D) : (D = l.scrollTop, A = E - b, C = g - v + D), _ === "auto" && (A < 0 ? (_ = "left", A = 10) : A + u > x ? _ = "right" : _ = getTextDirection(o) === "rtl" ? "right" : "left"), _ === "right" && (A -= u - y), w === "auto" && (w = C - d < D ? "bottom" : "top"), w === "top" ? C -= d : C += f, i.remove("datepicker-orient-top", "datepicker-orient-bottom", "datepicker-orient-right", "datepicker-orient-left"), i.add("datepicker-orient-".concat(w), "datepicker-orient-".concat(_)), r.top = C && "".concat(C, "px"), r.left = A && "".concat(A, "px");
|
|
5614
5681
|
}
|
|
5615
5682
|
}, {
|
|
5616
5683
|
key: "setViewSwitchLabel",
|
|
@@ -5678,8 +5745,8 @@ function moveByArrowKey(e, t, n, i) {
|
|
|
5678
5745
|
break;
|
|
5679
5746
|
case 1:
|
|
5680
5747
|
o = addMonths(o, i ? n * 4 : n), l = addMonths, c = function(d) {
|
|
5681
|
-
var
|
|
5682
|
-
return
|
|
5748
|
+
var h = new Date(d), b = a.year, v = a.disabled;
|
|
5749
|
+
return h.getFullYear() === b && v.includes(h.getMonth());
|
|
5683
5750
|
};
|
|
5684
5751
|
break;
|
|
5685
5752
|
default:
|
|
@@ -5870,12 +5937,12 @@ var Datepicker$1 = /* @__PURE__ */ (function() {
|
|
|
5870
5937
|
this.dates = [];
|
|
5871
5938
|
var d = processInputDates(this, o);
|
|
5872
5939
|
d && d.length > 0 && (this.dates = d), s && (s.value = stringifyDates(this.dates, r));
|
|
5873
|
-
var
|
|
5940
|
+
var h = this.picker = new Picker(this);
|
|
5874
5941
|
if (a)
|
|
5875
5942
|
this.show();
|
|
5876
5943
|
else {
|
|
5877
|
-
var
|
|
5878
|
-
registerListeners(this,
|
|
5944
|
+
var b = onClickOutside.bind(null, this), v = [[s, "keydown", onKeydown.bind(null, this)], [s, "focus", onFocus.bind(null, this)], [s, "mousedown", onMousedown.bind(null, this)], [s, "click", onClickInput.bind(null, this)], [s, "paste", onPaste.bind(null, this)], [document, "mousedown", b], [document, "touchstart", b], [window, "resize", h.place.bind(h)]];
|
|
5945
|
+
registerListeners(this, v);
|
|
5879
5946
|
}
|
|
5880
5947
|
}
|
|
5881
5948
|
return _createClass(e, [{
|
|
@@ -7263,68 +7330,68 @@ var htmx = (function() {
|
|
|
7263
7330
|
// @ts-ignore
|
|
7264
7331
|
end: u ? u.selectionEnd : null
|
|
7265
7332
|
};
|
|
7266
|
-
const
|
|
7333
|
+
const h = makeSettleInfo(e);
|
|
7267
7334
|
if (n.swapStyle === "textContent")
|
|
7268
7335
|
e.textContent = t;
|
|
7269
7336
|
else {
|
|
7270
|
-
let
|
|
7271
|
-
if (
|
|
7272
|
-
const
|
|
7273
|
-
for (let
|
|
7274
|
-
const
|
|
7275
|
-
let
|
|
7276
|
-
|
|
7277
|
-
const
|
|
7278
|
-
|
|
7337
|
+
let v = makeFragment(t);
|
|
7338
|
+
if (h.title = i.title || v.title, i.historyRequest && (v = v.querySelector("[hx-history-elt],[data-hx-history-elt]") || v), i.selectOOB) {
|
|
7339
|
+
const x = i.selectOOB.split(",");
|
|
7340
|
+
for (let m = 0; m < x.length; m++) {
|
|
7341
|
+
const E = x[m].split(":", 2);
|
|
7342
|
+
let g = E[0].trim();
|
|
7343
|
+
g.indexOf("#") === 0 && (g = g.substring(1));
|
|
7344
|
+
const y = E[1] || "true", f = v.querySelector("#" + g);
|
|
7345
|
+
f && oobSwap(y, f, h, c);
|
|
7279
7346
|
}
|
|
7280
7347
|
}
|
|
7281
|
-
if (findAndSwapOobElements(
|
|
7282
|
-
findAll(
|
|
7348
|
+
if (findAndSwapOobElements(v, h, c), forEach(
|
|
7349
|
+
findAll(v, "template"),
|
|
7283
7350
|
/** @param {HTMLTemplateElement} template */
|
|
7284
|
-
function(
|
|
7285
|
-
|
|
7351
|
+
function(x) {
|
|
7352
|
+
x.content && findAndSwapOobElements(x.content, h, c) && x.remove();
|
|
7286
7353
|
}
|
|
7287
7354
|
), i.select) {
|
|
7288
|
-
const
|
|
7289
|
-
forEach(
|
|
7290
|
-
|
|
7291
|
-
}),
|
|
7355
|
+
const x = getDocument().createDocumentFragment();
|
|
7356
|
+
forEach(v.querySelectorAll(i.select), function(m) {
|
|
7357
|
+
x.appendChild(m);
|
|
7358
|
+
}), v = x;
|
|
7292
7359
|
}
|
|
7293
|
-
handlePreservedElements(
|
|
7360
|
+
handlePreservedElements(v), swapWithStyle(n.swapStyle, i.contextElement, e, v, h), restorePreservedElements();
|
|
7294
7361
|
}
|
|
7295
7362
|
if (d.elt && !bodyContains(d.elt) && getRawAttribute(d.elt, "id")) {
|
|
7296
|
-
const
|
|
7297
|
-
if (
|
|
7298
|
-
if (d.start &&
|
|
7363
|
+
const v = document.getElementById(getRawAttribute(d.elt, "id")), x = { preventScroll: n.focusScroll !== void 0 ? !n.focusScroll : !htmx.config.defaultFocusScroll };
|
|
7364
|
+
if (v) {
|
|
7365
|
+
if (d.start && v.setSelectionRange)
|
|
7299
7366
|
try {
|
|
7300
|
-
|
|
7367
|
+
v.setSelectionRange(d.start, d.end);
|
|
7301
7368
|
} catch {
|
|
7302
7369
|
}
|
|
7303
|
-
|
|
7370
|
+
v.focus(x);
|
|
7304
7371
|
}
|
|
7305
7372
|
}
|
|
7306
|
-
e.classList.remove(htmx.config.swappingClass), forEach(
|
|
7307
|
-
|
|
7308
|
-
}), maybeCall(i.afterSwapCallback), n.ignoreTitle || handleTitle(
|
|
7309
|
-
const
|
|
7310
|
-
if (forEach(
|
|
7311
|
-
|
|
7312
|
-
}), forEach(
|
|
7313
|
-
|
|
7373
|
+
e.classList.remove(htmx.config.swappingClass), forEach(h.elts, function(v) {
|
|
7374
|
+
v.classList && v.classList.add(htmx.config.settlingClass), triggerEvent(v, "htmx:afterSwap", i.eventInfo);
|
|
7375
|
+
}), maybeCall(i.afterSwapCallback), n.ignoreTitle || handleTitle(h.title);
|
|
7376
|
+
const b = function() {
|
|
7377
|
+
if (forEach(h.tasks, function(v) {
|
|
7378
|
+
v.call();
|
|
7379
|
+
}), forEach(h.elts, function(v) {
|
|
7380
|
+
v.classList && v.classList.remove(htmx.config.settlingClass), triggerEvent(v, "htmx:afterSettle", i.eventInfo);
|
|
7314
7381
|
}), i.anchor) {
|
|
7315
|
-
const
|
|
7316
|
-
|
|
7382
|
+
const v = asElement(resolveTarget("#" + i.anchor));
|
|
7383
|
+
v && v.scrollIntoView({ block: "start", behavior: "auto" });
|
|
7317
7384
|
}
|
|
7318
|
-
updateScrollState(
|
|
7385
|
+
updateScrollState(h.elts, n), maybeCall(i.afterSettleCallback), maybeCall(r);
|
|
7319
7386
|
};
|
|
7320
|
-
n.settleDelay > 0 ? getWindow().setTimeout(
|
|
7387
|
+
n.settleDelay > 0 ? getWindow().setTimeout(b, n.settleDelay) : b();
|
|
7321
7388
|
}, o = htmx.config.globalViewTransitions;
|
|
7322
7389
|
n.hasOwnProperty("transition") && (o = n.transition);
|
|
7323
7390
|
const l = i.contextElement || getDocument();
|
|
7324
7391
|
if (o && triggerEvent(l, "htmx:beforeTransition", i.eventInfo) && typeof Promise < "u" && // @ts-ignore experimental feature atm
|
|
7325
7392
|
document.startViewTransition) {
|
|
7326
|
-
const c = new Promise(function(d,
|
|
7327
|
-
r = d, a =
|
|
7393
|
+
const c = new Promise(function(d, h) {
|
|
7394
|
+
r = d, a = h;
|
|
7328
7395
|
}), u = s;
|
|
7329
7396
|
s = function() {
|
|
7330
7397
|
document.startViewTransition(function() {
|
|
@@ -7450,8 +7517,8 @@ var htmx = (function() {
|
|
|
7450
7517
|
var s = consumeUntil(r, WHITESPACE_OR_COMMA);
|
|
7451
7518
|
if (s === "closest" || s === "find" || s === "next" || s === "previous") {
|
|
7452
7519
|
r.shift();
|
|
7453
|
-
const
|
|
7454
|
-
|
|
7520
|
+
const b = consumeCSSSelector(r);
|
|
7521
|
+
b.length > 0 && (s += " " + b);
|
|
7455
7522
|
}
|
|
7456
7523
|
}
|
|
7457
7524
|
c.from = s;
|
|
@@ -7569,10 +7636,10 @@ var htmx = (function() {
|
|
|
7569
7636
|
a.triggeredOnce = !0;
|
|
7570
7637
|
}
|
|
7571
7638
|
if (i.changed) {
|
|
7572
|
-
const d = c.target,
|
|
7573
|
-
if (
|
|
7639
|
+
const d = c.target, h = d.value, b = a.lastValue.get(i);
|
|
7640
|
+
if (b.has(d) && b.get(d) === h)
|
|
7574
7641
|
return;
|
|
7575
|
-
|
|
7642
|
+
b.set(d, h);
|
|
7576
7643
|
}
|
|
7577
7644
|
if (a.delayed && clearTimeout(a.delayed), a.throttle)
|
|
7578
7645
|
return;
|
|
@@ -8280,8 +8347,8 @@ var htmx = (function() {
|
|
|
8280
8347
|
function issueAjaxRequest(e, t, n, i, r, a) {
|
|
8281
8348
|
let s = null, o = null;
|
|
8282
8349
|
if (r = r ?? {}, r.returnPromise && typeof Promise < "u")
|
|
8283
|
-
var l = new Promise(function(
|
|
8284
|
-
s =
|
|
8350
|
+
var l = new Promise(function(k, M) {
|
|
8351
|
+
s = k, o = M;
|
|
8285
8352
|
});
|
|
8286
8353
|
n == null && (n = getDocument().body);
|
|
8287
8354
|
const c = r.handler || handleAjaxResponse, u = r.select || null;
|
|
@@ -8290,115 +8357,115 @@ var htmx = (function() {
|
|
|
8290
8357
|
const d = r.targetOverride || asElement(getTarget(n));
|
|
8291
8358
|
if (d == null || d == DUMMY_ELT)
|
|
8292
8359
|
return triggerErrorEvent(n, "htmx:targetError", { target: getClosestAttributeValue(n, "hx-target") }), maybeCall(o), l;
|
|
8293
|
-
let
|
|
8294
|
-
const
|
|
8295
|
-
if (
|
|
8296
|
-
const
|
|
8297
|
-
|
|
8298
|
-
const
|
|
8299
|
-
if (
|
|
8300
|
-
if (VERBS.includes(
|
|
8360
|
+
let h = getInternalData(n);
|
|
8361
|
+
const b = h.lastButtonClicked;
|
|
8362
|
+
if (b) {
|
|
8363
|
+
const k = getRawAttribute(b, "formaction");
|
|
8364
|
+
k != null && (t = k);
|
|
8365
|
+
const M = getRawAttribute(b, "formmethod");
|
|
8366
|
+
if (M != null)
|
|
8367
|
+
if (VERBS.includes(M.toLowerCase()))
|
|
8301
8368
|
e = /** @type HttpVerb */
|
|
8302
|
-
|
|
8369
|
+
M;
|
|
8303
8370
|
else
|
|
8304
8371
|
return maybeCall(s), l;
|
|
8305
8372
|
}
|
|
8306
|
-
const
|
|
8307
|
-
if (a === void 0 && triggerEvent(n, "htmx:confirm", { target: d, elt: n, path: t, verb: e, triggeringEvent: i, etc: r, issueRequest: function(
|
|
8308
|
-
return issueAjaxRequest(e, t, n, i, r, !!
|
|
8309
|
-
}, question:
|
|
8373
|
+
const v = getClosestAttributeValue(n, "hx-confirm");
|
|
8374
|
+
if (a === void 0 && triggerEvent(n, "htmx:confirm", { target: d, elt: n, path: t, verb: e, triggeringEvent: i, etc: r, issueRequest: function(F) {
|
|
8375
|
+
return issueAjaxRequest(e, t, n, i, r, !!F);
|
|
8376
|
+
}, question: v }) === !1)
|
|
8310
8377
|
return maybeCall(s), l;
|
|
8311
|
-
let
|
|
8312
|
-
if (
|
|
8313
|
-
const
|
|
8314
|
-
if (
|
|
8378
|
+
let x = n, m = getClosestAttributeValue(n, "hx-sync"), E = null, g = !1;
|
|
8379
|
+
if (m) {
|
|
8380
|
+
const k = m.split(":"), M = k[0].trim();
|
|
8381
|
+
if (M === "this" ? x = findThisElement(n, "hx-sync") : x = asElement(querySelectorExt(n, M)), m = (k[1] || "drop").trim(), h = getInternalData(x), m === "drop" && h.xhr && h.abortable !== !0)
|
|
8315
8382
|
return maybeCall(s), l;
|
|
8316
|
-
if (
|
|
8317
|
-
if (
|
|
8383
|
+
if (m === "abort") {
|
|
8384
|
+
if (h.xhr)
|
|
8318
8385
|
return maybeCall(s), l;
|
|
8319
|
-
|
|
8320
|
-
} else
|
|
8386
|
+
g = !0;
|
|
8387
|
+
} else m === "replace" ? triggerEvent(x, "htmx:abort") : m.indexOf("queue") === 0 && (E = (m.split(" ")[1] || "last").trim());
|
|
8321
8388
|
}
|
|
8322
|
-
if (
|
|
8323
|
-
if (
|
|
8324
|
-
triggerEvent(
|
|
8389
|
+
if (h.xhr)
|
|
8390
|
+
if (h.abortable)
|
|
8391
|
+
triggerEvent(x, "htmx:abort");
|
|
8325
8392
|
else {
|
|
8326
|
-
if (
|
|
8393
|
+
if (E == null) {
|
|
8327
8394
|
if (i) {
|
|
8328
|
-
const
|
|
8329
|
-
|
|
8395
|
+
const k = getInternalData(i);
|
|
8396
|
+
k && k.triggerSpec && k.triggerSpec.queue && (E = k.triggerSpec.queue);
|
|
8330
8397
|
}
|
|
8331
|
-
|
|
8398
|
+
E == null && (E = "last");
|
|
8332
8399
|
}
|
|
8333
|
-
return
|
|
8400
|
+
return h.queuedRequests == null && (h.queuedRequests = []), E === "first" && h.queuedRequests.length === 0 ? h.queuedRequests.push(function() {
|
|
8334
8401
|
issueAjaxRequest(e, t, n, i, r);
|
|
8335
|
-
}) :
|
|
8402
|
+
}) : E === "all" ? h.queuedRequests.push(function() {
|
|
8336
8403
|
issueAjaxRequest(e, t, n, i, r);
|
|
8337
|
-
}) :
|
|
8404
|
+
}) : E === "last" && (h.queuedRequests = [], h.queuedRequests.push(function() {
|
|
8338
8405
|
issueAjaxRequest(e, t, n, i, r);
|
|
8339
8406
|
})), maybeCall(s), l;
|
|
8340
8407
|
}
|
|
8341
|
-
const
|
|
8342
|
-
|
|
8343
|
-
const
|
|
8344
|
-
|
|
8345
|
-
},
|
|
8346
|
-
if (
|
|
8347
|
-
var
|
|
8348
|
-
if (
|
|
8349
|
-
return maybeCall(s),
|
|
8350
|
-
}
|
|
8351
|
-
if (
|
|
8352
|
-
return maybeCall(s),
|
|
8353
|
-
let
|
|
8354
|
-
e !== "get" && !usesFormData(n) && (
|
|
8355
|
-
const
|
|
8356
|
-
let A =
|
|
8357
|
-
const
|
|
8358
|
-
r.values && overrideFormData(
|
|
8359
|
-
const
|
|
8360
|
-
let T = filterValues(
|
|
8408
|
+
const y = new XMLHttpRequest();
|
|
8409
|
+
h.xhr = y, h.abortable = g;
|
|
8410
|
+
const f = function() {
|
|
8411
|
+
h.xhr = null, h.abortable = !1, h.queuedRequests != null && h.queuedRequests.length > 0 && h.queuedRequests.shift()();
|
|
8412
|
+
}, p = getClosestAttributeValue(n, "hx-prompt");
|
|
8413
|
+
if (p) {
|
|
8414
|
+
var _ = prompt(p);
|
|
8415
|
+
if (_ === null || !triggerEvent(n, "htmx:prompt", { prompt: _, target: d }))
|
|
8416
|
+
return maybeCall(s), f(), l;
|
|
8417
|
+
}
|
|
8418
|
+
if (v && !a && !confirm(v))
|
|
8419
|
+
return maybeCall(s), f(), l;
|
|
8420
|
+
let w = getHeaders(n, d, _);
|
|
8421
|
+
e !== "get" && !usesFormData(n) && (w["Content-Type"] = "application/x-www-form-urlencoded"), r.headers && (w = mergeObjects(w, r.headers));
|
|
8422
|
+
const D = getInputValues(n, e);
|
|
8423
|
+
let A = D.errors;
|
|
8424
|
+
const C = D.formData;
|
|
8425
|
+
r.values && overrideFormData(C, formDataFromObject(r.values));
|
|
8426
|
+
const S = formDataFromObject(getExpressionVars(n, i)), O = overrideFormData(C, S);
|
|
8427
|
+
let T = filterValues(O, n);
|
|
8361
8428
|
htmx.config.getCacheBusterParam && e === "get" && T.set("org.htmx.cache-buster", getRawAttribute(d, "id") || "true"), (t == null || t === "") && (t = location.href);
|
|
8362
|
-
const
|
|
8363
|
-
let
|
|
8364
|
-
const
|
|
8365
|
-
boosted:
|
|
8366
|
-
useUrlParams:
|
|
8429
|
+
const L = getValuesForElement(n, "hx-request"), R = getInternalData(n).boosted;
|
|
8430
|
+
let H = htmx.config.methodsThatUseUrlParams.indexOf(e) >= 0;
|
|
8431
|
+
const I = {
|
|
8432
|
+
boosted: R,
|
|
8433
|
+
useUrlParams: H,
|
|
8367
8434
|
formData: T,
|
|
8368
8435
|
parameters: formDataProxy(T),
|
|
8369
|
-
unfilteredFormData:
|
|
8370
|
-
unfilteredParameters: formDataProxy(
|
|
8371
|
-
headers:
|
|
8436
|
+
unfilteredFormData: O,
|
|
8437
|
+
unfilteredParameters: formDataProxy(O),
|
|
8438
|
+
headers: w,
|
|
8372
8439
|
elt: n,
|
|
8373
8440
|
target: d,
|
|
8374
8441
|
verb: e,
|
|
8375
8442
|
errors: A,
|
|
8376
|
-
withCredentials: r.credentials ||
|
|
8377
|
-
timeout: r.timeout ||
|
|
8443
|
+
withCredentials: r.credentials || L.credentials || htmx.config.withCredentials,
|
|
8444
|
+
timeout: r.timeout || L.timeout || htmx.config.timeout,
|
|
8378
8445
|
path: t,
|
|
8379
8446
|
triggeringEvent: i
|
|
8380
8447
|
};
|
|
8381
|
-
if (!triggerEvent(n, "htmx:configRequest",
|
|
8382
|
-
return maybeCall(s),
|
|
8383
|
-
if (t =
|
|
8384
|
-
return triggerEvent(n, "htmx:validation:halted",
|
|
8448
|
+
if (!triggerEvent(n, "htmx:configRequest", I))
|
|
8449
|
+
return maybeCall(s), f(), l;
|
|
8450
|
+
if (t = I.path, e = I.verb, w = I.headers, T = formDataFromObject(I.parameters), A = I.errors, H = I.useUrlParams, A && A.length > 0)
|
|
8451
|
+
return triggerEvent(n, "htmx:validation:halted", I), maybeCall(s), f(), l;
|
|
8385
8452
|
const W = t.split("#"), $ = W[0], q = W[1];
|
|
8386
8453
|
let N = t;
|
|
8387
|
-
if (
|
|
8388
|
-
return triggerErrorEvent(n, "htmx:invalidPath",
|
|
8389
|
-
if (
|
|
8390
|
-
for (const
|
|
8391
|
-
if (
|
|
8392
|
-
const
|
|
8393
|
-
safelySetHeaderValue(
|
|
8454
|
+
if (H && (N = $, !T.keys().next().done && (N.indexOf("?") < 0 ? N += "?" : N += "&", N += urlEncode(T), q && (N += "#" + q))), !verifyPath(n, N, I))
|
|
8455
|
+
return triggerErrorEvent(n, "htmx:invalidPath", I), maybeCall(o), f(), l;
|
|
8456
|
+
if (y.open(e.toUpperCase(), N, !0), y.overrideMimeType("text/html"), y.withCredentials = I.withCredentials, y.timeout = I.timeout, !L.noHeaders) {
|
|
8457
|
+
for (const k in w)
|
|
8458
|
+
if (w.hasOwnProperty(k)) {
|
|
8459
|
+
const M = w[k];
|
|
8460
|
+
safelySetHeaderValue(y, k, M);
|
|
8394
8461
|
}
|
|
8395
8462
|
}
|
|
8396
8463
|
const P = {
|
|
8397
|
-
xhr:
|
|
8464
|
+
xhr: y,
|
|
8398
8465
|
target: d,
|
|
8399
|
-
requestConfig:
|
|
8466
|
+
requestConfig: I,
|
|
8400
8467
|
etc: r,
|
|
8401
|
-
boosted:
|
|
8468
|
+
boosted: R,
|
|
8402
8469
|
select: u,
|
|
8403
8470
|
pathInfo: {
|
|
8404
8471
|
requestPath: t,
|
|
@@ -8407,45 +8474,45 @@ var htmx = (function() {
|
|
|
8407
8474
|
anchor: q
|
|
8408
8475
|
}
|
|
8409
8476
|
};
|
|
8410
|
-
if (
|
|
8477
|
+
if (y.onload = function() {
|
|
8411
8478
|
try {
|
|
8412
|
-
const
|
|
8413
|
-
if (P.pathInfo.responsePath = getPathFromResponse(
|
|
8414
|
-
let
|
|
8415
|
-
for (;
|
|
8416
|
-
const
|
|
8417
|
-
bodyContains(
|
|
8479
|
+
const k = hierarchyForElt(n);
|
|
8480
|
+
if (P.pathInfo.responsePath = getPathFromResponse(y), c(n, P), P.keepIndicators !== !0 && removeRequestIndicators(j, V), triggerEvent(n, "htmx:afterRequest", P), triggerEvent(n, "htmx:afterOnLoad", P), !bodyContains(n)) {
|
|
8481
|
+
let M = null;
|
|
8482
|
+
for (; k.length > 0 && M == null; ) {
|
|
8483
|
+
const F = k.shift();
|
|
8484
|
+
bodyContains(F) && (M = F);
|
|
8418
8485
|
}
|
|
8419
|
-
|
|
8486
|
+
M && (triggerEvent(M, "htmx:afterRequest", P), triggerEvent(M, "htmx:afterOnLoad", P));
|
|
8420
8487
|
}
|
|
8421
8488
|
maybeCall(s);
|
|
8422
|
-
} catch (
|
|
8423
|
-
throw triggerErrorEvent(n, "htmx:onLoadError", mergeObjects({ error:
|
|
8489
|
+
} catch (k) {
|
|
8490
|
+
throw triggerErrorEvent(n, "htmx:onLoadError", mergeObjects({ error: k }, P)), k;
|
|
8424
8491
|
} finally {
|
|
8425
|
-
|
|
8492
|
+
f();
|
|
8426
8493
|
}
|
|
8427
|
-
},
|
|
8428
|
-
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendError", P), maybeCall(o),
|
|
8429
|
-
},
|
|
8430
|
-
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendAbort", P), maybeCall(o),
|
|
8431
|
-
},
|
|
8432
|
-
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:timeout", P), maybeCall(o),
|
|
8494
|
+
}, y.onerror = function() {
|
|
8495
|
+
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendError", P), maybeCall(o), f();
|
|
8496
|
+
}, y.onabort = function() {
|
|
8497
|
+
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendAbort", P), maybeCall(o), f();
|
|
8498
|
+
}, y.ontimeout = function() {
|
|
8499
|
+
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:timeout", P), maybeCall(o), f();
|
|
8433
8500
|
}, !triggerEvent(n, "htmx:beforeRequest", P))
|
|
8434
|
-
return maybeCall(s),
|
|
8501
|
+
return maybeCall(s), f(), l;
|
|
8435
8502
|
var j = addRequestIndicatorClasses(n), V = disableElements(n);
|
|
8436
|
-
forEach(["loadstart", "loadend", "progress", "abort"], function(
|
|
8437
|
-
forEach([
|
|
8438
|
-
|
|
8439
|
-
triggerEvent(n, "htmx:xhr:" +
|
|
8440
|
-
lengthComputable:
|
|
8441
|
-
loaded:
|
|
8442
|
-
total:
|
|
8503
|
+
forEach(["loadstart", "loadend", "progress", "abort"], function(k) {
|
|
8504
|
+
forEach([y, y.upload], function(M) {
|
|
8505
|
+
M.addEventListener(k, function(F) {
|
|
8506
|
+
triggerEvent(n, "htmx:xhr:" + k, {
|
|
8507
|
+
lengthComputable: F.lengthComputable,
|
|
8508
|
+
loaded: F.loaded,
|
|
8509
|
+
total: F.total
|
|
8443
8510
|
});
|
|
8444
8511
|
});
|
|
8445
8512
|
});
|
|
8446
8513
|
}), triggerEvent(n, "htmx:beforeSend", P);
|
|
8447
|
-
const B =
|
|
8448
|
-
return
|
|
8514
|
+
const B = H ? null : encodeParamsForBody(y, n, T);
|
|
8515
|
+
return y.send(B), l;
|
|
8449
8516
|
}
|
|
8450
8517
|
function determineHistoryUpdates(e, t) {
|
|
8451
8518
|
const n = t.xhr;
|
|
@@ -8496,9 +8563,9 @@ var htmx = (function() {
|
|
|
8496
8563
|
const r = t.etc, a = t.select;
|
|
8497
8564
|
if (!triggerEvent(e, "htmx:beforeOnLoad", t)) return;
|
|
8498
8565
|
if (hasHeader(n, /HX-Trigger:/i) && handleTriggerHeader(n, "HX-Trigger", e), hasHeader(n, /HX-Location:/i)) {
|
|
8499
|
-
let
|
|
8566
|
+
let g = n.getResponseHeader("HX-Location");
|
|
8500
8567
|
var s = {};
|
|
8501
|
-
|
|
8568
|
+
g.indexOf("{") === 0 && (s = parseJSON(g), g = s.path, delete s.path), s.push = s.push || "true", ajaxHelper("get", g, s);
|
|
8502
8569
|
return;
|
|
8503
8570
|
}
|
|
8504
8571
|
const o = hasHeader(n, /HX-Refresh:/i) && n.getResponseHeader("HX-Refresh") === "true";
|
|
@@ -8511,42 +8578,42 @@ var htmx = (function() {
|
|
|
8511
8578
|
return;
|
|
8512
8579
|
}
|
|
8513
8580
|
const l = determineHistoryUpdates(e, t), c = resolveResponseHandling(n), u = c.swap;
|
|
8514
|
-
let d = !!c.error,
|
|
8581
|
+
let d = !!c.error, h = htmx.config.ignoreTitle || c.ignoreTitle, b = c.select;
|
|
8515
8582
|
c.target && (t.target = resolveRetarget(e, c.target));
|
|
8516
|
-
var
|
|
8517
|
-
|
|
8518
|
-
var
|
|
8583
|
+
var v = r.swapOverride;
|
|
8584
|
+
v == null && c.swapOverride && (v = c.swapOverride), hasHeader(n, /HX-Retarget:/i) && (t.target = resolveRetarget(e, n.getResponseHeader("HX-Retarget"))), hasHeader(n, /HX-Reswap:/i) && (v = n.getResponseHeader("HX-Reswap"));
|
|
8585
|
+
var x = n.response, m = mergeObjects({
|
|
8519
8586
|
shouldSwap: u,
|
|
8520
|
-
serverResponse:
|
|
8587
|
+
serverResponse: x,
|
|
8521
8588
|
isError: d,
|
|
8522
|
-
ignoreTitle:
|
|
8523
|
-
selectOverride:
|
|
8524
|
-
swapOverride:
|
|
8589
|
+
ignoreTitle: h,
|
|
8590
|
+
selectOverride: b,
|
|
8591
|
+
swapOverride: v
|
|
8525
8592
|
}, t);
|
|
8526
|
-
if (!(c.event && !triggerEvent(i, c.event,
|
|
8527
|
-
if (i =
|
|
8528
|
-
n.status === 286 && cancelPolling(e), withExtensions(e, function(
|
|
8529
|
-
|
|
8593
|
+
if (!(c.event && !triggerEvent(i, c.event, m)) && triggerEvent(i, "htmx:beforeSwap", m)) {
|
|
8594
|
+
if (i = m.target, x = m.serverResponse, d = m.isError, h = m.ignoreTitle, b = m.selectOverride, v = m.swapOverride, t.target = i, t.failed = d, t.successful = !d, m.shouldSwap) {
|
|
8595
|
+
n.status === 286 && cancelPolling(e), withExtensions(e, function(f) {
|
|
8596
|
+
x = f.transformResponse(x, n, e);
|
|
8530
8597
|
}), l.type && saveCurrentPageToHistory();
|
|
8531
|
-
var
|
|
8532
|
-
|
|
8533
|
-
const
|
|
8534
|
-
swap(i,
|
|
8535
|
-
select:
|
|
8536
|
-
selectOOB:
|
|
8598
|
+
var E = getSwapSpecification(e, v);
|
|
8599
|
+
E.hasOwnProperty("ignoreTitle") || (E.ignoreTitle = h), i.classList.add(htmx.config.swappingClass), a && (b = a), hasHeader(n, /HX-Reselect:/i) && (b = n.getResponseHeader("HX-Reselect"));
|
|
8600
|
+
const g = r.selectOOB || getClosestAttributeValue(e, "hx-select-oob"), y = getClosestAttributeValue(e, "hx-select");
|
|
8601
|
+
swap(i, x, E, {
|
|
8602
|
+
select: b === "unset" ? null : b || y,
|
|
8603
|
+
selectOOB: g,
|
|
8537
8604
|
eventInfo: t,
|
|
8538
8605
|
anchor: t.pathInfo.anchor,
|
|
8539
8606
|
contextElement: e,
|
|
8540
8607
|
afterSwapCallback: function() {
|
|
8541
8608
|
if (hasHeader(n, /HX-Trigger-After-Swap:/i)) {
|
|
8542
|
-
let
|
|
8543
|
-
bodyContains(e) || (
|
|
8609
|
+
let f = e;
|
|
8610
|
+
bodyContains(e) || (f = getDocument().body), handleTriggerHeader(n, "HX-Trigger-After-Swap", f);
|
|
8544
8611
|
}
|
|
8545
8612
|
},
|
|
8546
8613
|
afterSettleCallback: function() {
|
|
8547
8614
|
if (hasHeader(n, /HX-Trigger-After-Settle:/i)) {
|
|
8548
|
-
let
|
|
8549
|
-
bodyContains(e) || (
|
|
8615
|
+
let f = e;
|
|
8616
|
+
bodyContains(e) || (f = getDocument().body), handleTriggerHeader(n, "HX-Trigger-After-Settle", f);
|
|
8550
8617
|
}
|
|
8551
8618
|
},
|
|
8552
8619
|
beforeSwapCallback: function() {
|
|
@@ -8655,6 +8722,549 @@ var htmx = (function() {
|
|
|
8655
8722
|
triggerEvent(e, "htmx:load", {}), e = null;
|
|
8656
8723
|
}, 0);
|
|
8657
8724
|
}), htmx;
|
|
8725
|
+
})(), Idiomorph = (function() {
|
|
8726
|
+
const e = () => {
|
|
8727
|
+
}, t = {
|
|
8728
|
+
morphStyle: "outerHTML",
|
|
8729
|
+
callbacks: {
|
|
8730
|
+
beforeNodeAdded: e,
|
|
8731
|
+
afterNodeAdded: e,
|
|
8732
|
+
beforeNodeMorphed: e,
|
|
8733
|
+
afterNodeMorphed: e,
|
|
8734
|
+
beforeNodeRemoved: e,
|
|
8735
|
+
afterNodeRemoved: e,
|
|
8736
|
+
beforeAttributeUpdated: e
|
|
8737
|
+
},
|
|
8738
|
+
head: {
|
|
8739
|
+
style: "merge",
|
|
8740
|
+
shouldPreserve: (h) => h.getAttribute("im-preserve") === "true",
|
|
8741
|
+
shouldReAppend: (h) => h.getAttribute("im-re-append") === "true",
|
|
8742
|
+
shouldRemove: e,
|
|
8743
|
+
afterHeadMorphed: e
|
|
8744
|
+
},
|
|
8745
|
+
restoreFocus: !0
|
|
8746
|
+
};
|
|
8747
|
+
function n(h, b, v = {}) {
|
|
8748
|
+
h = u(h);
|
|
8749
|
+
const x = d(b), m = c(h, x, v), E = r(m, () => o(
|
|
8750
|
+
m,
|
|
8751
|
+
h,
|
|
8752
|
+
x,
|
|
8753
|
+
/** @param {MorphContext} ctx */
|
|
8754
|
+
(g) => g.morphStyle === "innerHTML" ? (a(g, h, x), Array.from(h.childNodes)) : i(g, h, x)
|
|
8755
|
+
));
|
|
8756
|
+
return m.pantry.remove(), E;
|
|
8757
|
+
}
|
|
8758
|
+
function i(h, b, v) {
|
|
8759
|
+
const x = d(b);
|
|
8760
|
+
return a(
|
|
8761
|
+
h,
|
|
8762
|
+
x,
|
|
8763
|
+
v,
|
|
8764
|
+
// these two optional params are the secret sauce
|
|
8765
|
+
b,
|
|
8766
|
+
// start point for iteration
|
|
8767
|
+
b.nextSibling
|
|
8768
|
+
// end point for iteration
|
|
8769
|
+
), Array.from(x.childNodes);
|
|
8770
|
+
}
|
|
8771
|
+
function r(h, b) {
|
|
8772
|
+
if (!h.config.restoreFocus) return b();
|
|
8773
|
+
let v = (
|
|
8774
|
+
/** @type {HTMLInputElement|HTMLTextAreaElement|null} */
|
|
8775
|
+
document.activeElement
|
|
8776
|
+
);
|
|
8777
|
+
if (!(v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement))
|
|
8778
|
+
return b();
|
|
8779
|
+
const { id: x, selectionStart: m, selectionEnd: E } = v, g = b();
|
|
8780
|
+
return x && x !== document.activeElement?.getAttribute("id") && (v = h.target.querySelector(`[id="${x}"]`), v?.focus()), v && !v.selectionEnd && E && v.setSelectionRange(m, E), g;
|
|
8781
|
+
}
|
|
8782
|
+
const a = /* @__PURE__ */ (function() {
|
|
8783
|
+
function h(f, p, _, w = null, D = null) {
|
|
8784
|
+
p instanceof HTMLTemplateElement && _ instanceof HTMLTemplateElement && (p = p.content, _ = _.content), w ||= p.firstChild;
|
|
8785
|
+
for (const A of _.childNodes) {
|
|
8786
|
+
if (w && w != D) {
|
|
8787
|
+
const S = v(
|
|
8788
|
+
f,
|
|
8789
|
+
A,
|
|
8790
|
+
w,
|
|
8791
|
+
D
|
|
8792
|
+
);
|
|
8793
|
+
if (S) {
|
|
8794
|
+
S !== w && m(f, w, S), s(S, A, f), w = S.nextSibling;
|
|
8795
|
+
continue;
|
|
8796
|
+
}
|
|
8797
|
+
}
|
|
8798
|
+
if (A instanceof Element) {
|
|
8799
|
+
const S = (
|
|
8800
|
+
/** @type {String} */
|
|
8801
|
+
A.getAttribute("id")
|
|
8802
|
+
);
|
|
8803
|
+
if (f.persistentIds.has(S)) {
|
|
8804
|
+
const O = E(
|
|
8805
|
+
p,
|
|
8806
|
+
S,
|
|
8807
|
+
w,
|
|
8808
|
+
f
|
|
8809
|
+
);
|
|
8810
|
+
s(O, A, f), w = O.nextSibling;
|
|
8811
|
+
continue;
|
|
8812
|
+
}
|
|
8813
|
+
}
|
|
8814
|
+
const C = b(
|
|
8815
|
+
p,
|
|
8816
|
+
A,
|
|
8817
|
+
w,
|
|
8818
|
+
f
|
|
8819
|
+
);
|
|
8820
|
+
C && (w = C.nextSibling);
|
|
8821
|
+
}
|
|
8822
|
+
for (; w && w != D; ) {
|
|
8823
|
+
const A = w;
|
|
8824
|
+
w = w.nextSibling, x(f, A);
|
|
8825
|
+
}
|
|
8826
|
+
}
|
|
8827
|
+
function b(f, p, _, w) {
|
|
8828
|
+
if (w.callbacks.beforeNodeAdded(p) === !1) return null;
|
|
8829
|
+
if (w.idMap.has(p)) {
|
|
8830
|
+
const D = document.createElement(
|
|
8831
|
+
/** @type {Element} */
|
|
8832
|
+
p.tagName
|
|
8833
|
+
);
|
|
8834
|
+
return f.insertBefore(D, _), s(D, p, w), w.callbacks.afterNodeAdded(D), D;
|
|
8835
|
+
} else {
|
|
8836
|
+
const D = document.importNode(p, !0);
|
|
8837
|
+
return f.insertBefore(D, _), w.callbacks.afterNodeAdded(D), D;
|
|
8838
|
+
}
|
|
8839
|
+
}
|
|
8840
|
+
const v = /* @__PURE__ */ (function() {
|
|
8841
|
+
function f(w, D, A, C) {
|
|
8842
|
+
let S = null, O = D.nextSibling, T = 0, L = A;
|
|
8843
|
+
for (; L && L != C; ) {
|
|
8844
|
+
if (_(L, D)) {
|
|
8845
|
+
if (p(w, L, D))
|
|
8846
|
+
return L;
|
|
8847
|
+
S === null && (w.idMap.has(L) || (S = L));
|
|
8848
|
+
}
|
|
8849
|
+
if (S === null && O && _(L, O) && (T++, O = O.nextSibling, T >= 2 && (S = void 0)), w.activeElementAndParents.includes(L)) break;
|
|
8850
|
+
L = L.nextSibling;
|
|
8851
|
+
}
|
|
8852
|
+
return S || null;
|
|
8853
|
+
}
|
|
8854
|
+
function p(w, D, A) {
|
|
8855
|
+
let C = w.idMap.get(D), S = w.idMap.get(A);
|
|
8856
|
+
if (!S || !C) return !1;
|
|
8857
|
+
for (const O of C)
|
|
8858
|
+
if (S.has(O))
|
|
8859
|
+
return !0;
|
|
8860
|
+
return !1;
|
|
8861
|
+
}
|
|
8862
|
+
function _(w, D) {
|
|
8863
|
+
const A = (
|
|
8864
|
+
/** @type {Element} */
|
|
8865
|
+
w
|
|
8866
|
+
), C = (
|
|
8867
|
+
/** @type {Element} */
|
|
8868
|
+
D
|
|
8869
|
+
);
|
|
8870
|
+
return A.nodeType === C.nodeType && A.tagName === C.tagName && // If oldElt has an `id` with possible state and it doesn't match newElt.id then avoid morphing.
|
|
8871
|
+
// We'll still match an anonymous node with an IDed newElt, though, because if it got this far,
|
|
8872
|
+
// its not persistent, and new nodes can't have any hidden state.
|
|
8873
|
+
// We can't use .id because of form input shadowing, and we can't count on .getAttribute's presence because it could be a document-fragment
|
|
8874
|
+
(!A.getAttribute?.("id") || A.getAttribute?.("id") === C.getAttribute?.("id"));
|
|
8875
|
+
}
|
|
8876
|
+
return f;
|
|
8877
|
+
})();
|
|
8878
|
+
function x(f, p) {
|
|
8879
|
+
if (f.idMap.has(p))
|
|
8880
|
+
y(f.pantry, p, null);
|
|
8881
|
+
else {
|
|
8882
|
+
if (f.callbacks.beforeNodeRemoved(p) === !1) return;
|
|
8883
|
+
p.parentNode?.removeChild(p), f.callbacks.afterNodeRemoved(p);
|
|
8884
|
+
}
|
|
8885
|
+
}
|
|
8886
|
+
function m(f, p, _) {
|
|
8887
|
+
let w = p;
|
|
8888
|
+
for (; w && w !== _; ) {
|
|
8889
|
+
let D = (
|
|
8890
|
+
/** @type {Node} */
|
|
8891
|
+
w
|
|
8892
|
+
);
|
|
8893
|
+
w = w.nextSibling, x(f, D);
|
|
8894
|
+
}
|
|
8895
|
+
return w;
|
|
8896
|
+
}
|
|
8897
|
+
function E(f, p, _, w) {
|
|
8898
|
+
const D = (
|
|
8899
|
+
/** @type {Element} - will always be found */
|
|
8900
|
+
// ctx.target.id unsafe because of form input shadowing
|
|
8901
|
+
// ctx.target could be a document fragment which doesn't have `getAttribute`
|
|
8902
|
+
w.target.getAttribute?.("id") === p && w.target || w.target.querySelector(`[id="${p}"]`) || w.pantry.querySelector(`[id="${p}"]`)
|
|
8903
|
+
);
|
|
8904
|
+
return g(D, w), y(f, D, _), D;
|
|
8905
|
+
}
|
|
8906
|
+
function g(f, p) {
|
|
8907
|
+
const _ = (
|
|
8908
|
+
/** @type {String} */
|
|
8909
|
+
f.getAttribute("id")
|
|
8910
|
+
);
|
|
8911
|
+
for (; f = f.parentNode; ) {
|
|
8912
|
+
let w = p.idMap.get(f);
|
|
8913
|
+
w && (w.delete(_), w.size || p.idMap.delete(f));
|
|
8914
|
+
}
|
|
8915
|
+
}
|
|
8916
|
+
function y(f, p, _) {
|
|
8917
|
+
if (f.moveBefore)
|
|
8918
|
+
try {
|
|
8919
|
+
f.moveBefore(p, _);
|
|
8920
|
+
} catch {
|
|
8921
|
+
f.insertBefore(p, _);
|
|
8922
|
+
}
|
|
8923
|
+
else
|
|
8924
|
+
f.insertBefore(p, _);
|
|
8925
|
+
}
|
|
8926
|
+
return h;
|
|
8927
|
+
})(), s = /* @__PURE__ */ (function() {
|
|
8928
|
+
function h(g, y, f) {
|
|
8929
|
+
return f.ignoreActive && g === document.activeElement ? null : (f.callbacks.beforeNodeMorphed(g, y) === !1 || (g instanceof HTMLHeadElement && f.head.ignore || (g instanceof HTMLHeadElement && f.head.style !== "morph" ? l(
|
|
8930
|
+
g,
|
|
8931
|
+
/** @type {HTMLHeadElement} */
|
|
8932
|
+
y,
|
|
8933
|
+
f
|
|
8934
|
+
) : (b(g, y, f), E(g, f) || a(f, g, y))), f.callbacks.afterNodeMorphed(g, y)), g);
|
|
8935
|
+
}
|
|
8936
|
+
function b(g, y, f) {
|
|
8937
|
+
let p = y.nodeType;
|
|
8938
|
+
if (p === 1) {
|
|
8939
|
+
const _ = (
|
|
8940
|
+
/** @type {Element} */
|
|
8941
|
+
g
|
|
8942
|
+
), w = (
|
|
8943
|
+
/** @type {Element} */
|
|
8944
|
+
y
|
|
8945
|
+
), D = _.attributes, A = w.attributes;
|
|
8946
|
+
for (const C of A)
|
|
8947
|
+
m(C.name, _, "update", f) || _.getAttribute(C.name) !== C.value && _.setAttribute(C.name, C.value);
|
|
8948
|
+
for (let C = D.length - 1; 0 <= C; C--) {
|
|
8949
|
+
const S = D[C];
|
|
8950
|
+
if (S && !w.hasAttribute(S.name)) {
|
|
8951
|
+
if (m(S.name, _, "remove", f))
|
|
8952
|
+
continue;
|
|
8953
|
+
_.removeAttribute(S.name);
|
|
8954
|
+
}
|
|
8955
|
+
}
|
|
8956
|
+
E(_, f) || v(_, w, f);
|
|
8957
|
+
}
|
|
8958
|
+
(p === 8 || p === 3) && g.nodeValue !== y.nodeValue && (g.nodeValue = y.nodeValue);
|
|
8959
|
+
}
|
|
8960
|
+
function v(g, y, f) {
|
|
8961
|
+
if (g instanceof HTMLInputElement && y instanceof HTMLInputElement && y.type !== "file") {
|
|
8962
|
+
let p = y.value, _ = g.value;
|
|
8963
|
+
x(g, y, "checked", f), x(g, y, "disabled", f), y.hasAttribute("value") ? _ !== p && (m("value", g, "update", f) || (g.setAttribute("value", p), g.value = p)) : m("value", g, "remove", f) || (g.value = "", g.removeAttribute("value"));
|
|
8964
|
+
} else if (g instanceof HTMLOptionElement && y instanceof HTMLOptionElement)
|
|
8965
|
+
x(g, y, "selected", f);
|
|
8966
|
+
else if (g instanceof HTMLTextAreaElement && y instanceof HTMLTextAreaElement) {
|
|
8967
|
+
let p = y.value, _ = g.value;
|
|
8968
|
+
if (m("value", g, "update", f))
|
|
8969
|
+
return;
|
|
8970
|
+
p !== _ && (g.value = p), g.firstChild && g.firstChild.nodeValue !== p && (g.firstChild.nodeValue = p);
|
|
8971
|
+
}
|
|
8972
|
+
}
|
|
8973
|
+
function x(g, y, f, p) {
|
|
8974
|
+
const _ = y[f], w = g[f];
|
|
8975
|
+
if (_ !== w) {
|
|
8976
|
+
const D = m(
|
|
8977
|
+
f,
|
|
8978
|
+
g,
|
|
8979
|
+
"update",
|
|
8980
|
+
p
|
|
8981
|
+
);
|
|
8982
|
+
D || (g[f] = y[f]), _ ? D || g.setAttribute(f, "") : m(f, g, "remove", p) || g.removeAttribute(f);
|
|
8983
|
+
}
|
|
8984
|
+
}
|
|
8985
|
+
function m(g, y, f, p) {
|
|
8986
|
+
return g === "value" && p.ignoreActiveValue && y === document.activeElement ? !0 : p.callbacks.beforeAttributeUpdated(g, y, f) === !1;
|
|
8987
|
+
}
|
|
8988
|
+
function E(g, y) {
|
|
8989
|
+
return !!y.ignoreActiveValue && g === document.activeElement && g !== document.body;
|
|
8990
|
+
}
|
|
8991
|
+
return h;
|
|
8992
|
+
})();
|
|
8993
|
+
function o(h, b, v, x) {
|
|
8994
|
+
if (h.head.block) {
|
|
8995
|
+
const m = b.querySelector("head"), E = v.querySelector("head");
|
|
8996
|
+
if (m && E) {
|
|
8997
|
+
const g = l(m, E, h);
|
|
8998
|
+
return Promise.all(g).then(() => {
|
|
8999
|
+
const y = Object.assign(h, {
|
|
9000
|
+
head: {
|
|
9001
|
+
block: !1,
|
|
9002
|
+
ignore: !0
|
|
9003
|
+
}
|
|
9004
|
+
});
|
|
9005
|
+
return x(y);
|
|
9006
|
+
});
|
|
9007
|
+
}
|
|
9008
|
+
}
|
|
9009
|
+
return x(h);
|
|
9010
|
+
}
|
|
9011
|
+
function l(h, b, v) {
|
|
9012
|
+
let x = [], m = [], E = [], g = [], y = /* @__PURE__ */ new Map();
|
|
9013
|
+
for (const p of b.children)
|
|
9014
|
+
y.set(p.outerHTML, p);
|
|
9015
|
+
for (const p of h.children) {
|
|
9016
|
+
let _ = y.has(p.outerHTML), w = v.head.shouldReAppend(p), D = v.head.shouldPreserve(p);
|
|
9017
|
+
_ || D ? w ? m.push(p) : (y.delete(p.outerHTML), E.push(p)) : v.head.style === "append" ? w && (m.push(p), g.push(p)) : v.head.shouldRemove(p) !== !1 && m.push(p);
|
|
9018
|
+
}
|
|
9019
|
+
g.push(...y.values());
|
|
9020
|
+
let f = [];
|
|
9021
|
+
for (const p of g) {
|
|
9022
|
+
let _ = (
|
|
9023
|
+
/** @type {ChildNode} */
|
|
9024
|
+
document.createRange().createContextualFragment(p.outerHTML).firstChild
|
|
9025
|
+
);
|
|
9026
|
+
if (v.callbacks.beforeNodeAdded(_) !== !1) {
|
|
9027
|
+
if ("href" in _ && _.href || "src" in _ && _.src) {
|
|
9028
|
+
let w, D = new Promise(function(A) {
|
|
9029
|
+
w = A;
|
|
9030
|
+
});
|
|
9031
|
+
_.addEventListener("load", function() {
|
|
9032
|
+
w();
|
|
9033
|
+
}), f.push(D);
|
|
9034
|
+
}
|
|
9035
|
+
h.appendChild(_), v.callbacks.afterNodeAdded(_), x.push(_);
|
|
9036
|
+
}
|
|
9037
|
+
}
|
|
9038
|
+
for (const p of m)
|
|
9039
|
+
v.callbacks.beforeNodeRemoved(p) !== !1 && (h.removeChild(p), v.callbacks.afterNodeRemoved(p));
|
|
9040
|
+
return v.head.afterHeadMorphed(h, {
|
|
9041
|
+
added: x,
|
|
9042
|
+
kept: E,
|
|
9043
|
+
removed: m
|
|
9044
|
+
}), f;
|
|
9045
|
+
}
|
|
9046
|
+
const c = /* @__PURE__ */ (function() {
|
|
9047
|
+
function h(f, p, _) {
|
|
9048
|
+
const { persistentIds: w, idMap: D } = g(f, p), A = b(_), C = A.morphStyle || "outerHTML";
|
|
9049
|
+
if (!["innerHTML", "outerHTML"].includes(C))
|
|
9050
|
+
throw `Do not understand how to morph style ${C}`;
|
|
9051
|
+
return {
|
|
9052
|
+
target: f,
|
|
9053
|
+
newContent: p,
|
|
9054
|
+
config: A,
|
|
9055
|
+
morphStyle: C,
|
|
9056
|
+
ignoreActive: A.ignoreActive,
|
|
9057
|
+
ignoreActiveValue: A.ignoreActiveValue,
|
|
9058
|
+
restoreFocus: A.restoreFocus,
|
|
9059
|
+
idMap: D,
|
|
9060
|
+
persistentIds: w,
|
|
9061
|
+
pantry: v(),
|
|
9062
|
+
activeElementAndParents: x(f),
|
|
9063
|
+
callbacks: A.callbacks,
|
|
9064
|
+
head: A.head
|
|
9065
|
+
};
|
|
9066
|
+
}
|
|
9067
|
+
function b(f) {
|
|
9068
|
+
let p = Object.assign({}, t);
|
|
9069
|
+
return Object.assign(p, f), p.callbacks = Object.assign(
|
|
9070
|
+
{},
|
|
9071
|
+
t.callbacks,
|
|
9072
|
+
f.callbacks
|
|
9073
|
+
), p.head = Object.assign({}, t.head, f.head), p;
|
|
9074
|
+
}
|
|
9075
|
+
function v() {
|
|
9076
|
+
const f = document.createElement("div");
|
|
9077
|
+
return f.hidden = !0, document.body.insertAdjacentElement("afterend", f), f;
|
|
9078
|
+
}
|
|
9079
|
+
function x(f) {
|
|
9080
|
+
let p = [], _ = document.activeElement;
|
|
9081
|
+
if (_?.tagName !== "BODY" && f.contains(_))
|
|
9082
|
+
for (; _ && (p.push(_), _ !== f); )
|
|
9083
|
+
_ = _.parentElement;
|
|
9084
|
+
return p;
|
|
9085
|
+
}
|
|
9086
|
+
function m(f) {
|
|
9087
|
+
let p = Array.from(f.querySelectorAll("[id]"));
|
|
9088
|
+
return f.getAttribute?.("id") && p.push(f), p;
|
|
9089
|
+
}
|
|
9090
|
+
function E(f, p, _, w) {
|
|
9091
|
+
for (const D of w) {
|
|
9092
|
+
const A = (
|
|
9093
|
+
/** @type {String} */
|
|
9094
|
+
D.getAttribute("id")
|
|
9095
|
+
);
|
|
9096
|
+
if (p.has(A)) {
|
|
9097
|
+
let C = D;
|
|
9098
|
+
for (; C; ) {
|
|
9099
|
+
let S = f.get(C);
|
|
9100
|
+
if (S == null && (S = /* @__PURE__ */ new Set(), f.set(C, S)), S.add(A), C === _) break;
|
|
9101
|
+
C = C.parentElement;
|
|
9102
|
+
}
|
|
9103
|
+
}
|
|
9104
|
+
}
|
|
9105
|
+
}
|
|
9106
|
+
function g(f, p) {
|
|
9107
|
+
const _ = m(f), w = m(p), D = y(_, w);
|
|
9108
|
+
let A = /* @__PURE__ */ new Map();
|
|
9109
|
+
E(A, D, f, _);
|
|
9110
|
+
const C = p.__idiomorphRoot || p;
|
|
9111
|
+
return E(A, D, C, w), { persistentIds: D, idMap: A };
|
|
9112
|
+
}
|
|
9113
|
+
function y(f, p) {
|
|
9114
|
+
let _ = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
|
|
9115
|
+
for (const { id: A, tagName: C } of f)
|
|
9116
|
+
w.has(A) ? _.add(A) : w.set(A, C);
|
|
9117
|
+
let D = /* @__PURE__ */ new Set();
|
|
9118
|
+
for (const { id: A, tagName: C } of p)
|
|
9119
|
+
D.has(A) ? _.add(A) : w.get(A) === C && D.add(A);
|
|
9120
|
+
for (const A of _)
|
|
9121
|
+
D.delete(A);
|
|
9122
|
+
return D;
|
|
9123
|
+
}
|
|
9124
|
+
return h;
|
|
9125
|
+
})(), { normalizeElement: u, normalizeParent: d } = /* @__PURE__ */ (function() {
|
|
9126
|
+
const h = /* @__PURE__ */ new WeakSet();
|
|
9127
|
+
function b(E) {
|
|
9128
|
+
return E instanceof Document ? E.documentElement : E;
|
|
9129
|
+
}
|
|
9130
|
+
function v(E) {
|
|
9131
|
+
if (E == null)
|
|
9132
|
+
return document.createElement("div");
|
|
9133
|
+
if (typeof E == "string")
|
|
9134
|
+
return v(m(E));
|
|
9135
|
+
if (h.has(
|
|
9136
|
+
/** @type {Element} */
|
|
9137
|
+
E
|
|
9138
|
+
))
|
|
9139
|
+
return (
|
|
9140
|
+
/** @type {Element} */
|
|
9141
|
+
E
|
|
9142
|
+
);
|
|
9143
|
+
if (E instanceof Node) {
|
|
9144
|
+
if (E.parentNode)
|
|
9145
|
+
return (
|
|
9146
|
+
/** @type {any} */
|
|
9147
|
+
new x(E)
|
|
9148
|
+
);
|
|
9149
|
+
{
|
|
9150
|
+
const g = document.createElement("div");
|
|
9151
|
+
return g.append(E), g;
|
|
9152
|
+
}
|
|
9153
|
+
} else {
|
|
9154
|
+
const g = document.createElement("div");
|
|
9155
|
+
for (const y of [...E])
|
|
9156
|
+
g.append(y);
|
|
9157
|
+
return g;
|
|
9158
|
+
}
|
|
9159
|
+
}
|
|
9160
|
+
class x {
|
|
9161
|
+
/** @param {Node} node */
|
|
9162
|
+
constructor(g) {
|
|
9163
|
+
this.originalNode = g, this.realParentNode = /** @type {Element} */
|
|
9164
|
+
g.parentNode, this.previousSibling = g.previousSibling, this.nextSibling = g.nextSibling;
|
|
9165
|
+
}
|
|
9166
|
+
/** @returns {Node[]} */
|
|
9167
|
+
get childNodes() {
|
|
9168
|
+
const g = [];
|
|
9169
|
+
let y = this.previousSibling ? this.previousSibling.nextSibling : this.realParentNode.firstChild;
|
|
9170
|
+
for (; y && y != this.nextSibling; )
|
|
9171
|
+
g.push(y), y = y.nextSibling;
|
|
9172
|
+
return g;
|
|
9173
|
+
}
|
|
9174
|
+
/**
|
|
9175
|
+
* @param {string} selector
|
|
9176
|
+
* @returns {Element[]}
|
|
9177
|
+
*/
|
|
9178
|
+
querySelectorAll(g) {
|
|
9179
|
+
return this.childNodes.reduce(
|
|
9180
|
+
(y, f) => {
|
|
9181
|
+
if (f instanceof Element) {
|
|
9182
|
+
f.matches(g) && y.push(f);
|
|
9183
|
+
const p = f.querySelectorAll(g);
|
|
9184
|
+
for (let _ = 0; _ < p.length; _++)
|
|
9185
|
+
y.push(p[_]);
|
|
9186
|
+
}
|
|
9187
|
+
return y;
|
|
9188
|
+
},
|
|
9189
|
+
/** @type {Element[]} */
|
|
9190
|
+
[]
|
|
9191
|
+
);
|
|
9192
|
+
}
|
|
9193
|
+
/**
|
|
9194
|
+
* @param {Node} node
|
|
9195
|
+
* @param {Node} referenceNode
|
|
9196
|
+
* @returns {Node}
|
|
9197
|
+
*/
|
|
9198
|
+
insertBefore(g, y) {
|
|
9199
|
+
return this.realParentNode.insertBefore(g, y);
|
|
9200
|
+
}
|
|
9201
|
+
/**
|
|
9202
|
+
* @param {Node} node
|
|
9203
|
+
* @param {Node} referenceNode
|
|
9204
|
+
* @returns {Node}
|
|
9205
|
+
*/
|
|
9206
|
+
moveBefore(g, y) {
|
|
9207
|
+
return this.realParentNode.moveBefore(g, y);
|
|
9208
|
+
}
|
|
9209
|
+
/**
|
|
9210
|
+
* for later use with populateIdMapWithTree to halt upwards iteration
|
|
9211
|
+
* @returns {Node}
|
|
9212
|
+
*/
|
|
9213
|
+
get __idiomorphRoot() {
|
|
9214
|
+
return this.originalNode;
|
|
9215
|
+
}
|
|
9216
|
+
}
|
|
9217
|
+
function m(E) {
|
|
9218
|
+
let g = new DOMParser(), y = E.replace(
|
|
9219
|
+
/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,
|
|
9220
|
+
""
|
|
9221
|
+
);
|
|
9222
|
+
if (y.match(/<\/html>/) || y.match(/<\/head>/) || y.match(/<\/body>/)) {
|
|
9223
|
+
let f = g.parseFromString(E, "text/html");
|
|
9224
|
+
if (y.match(/<\/html>/))
|
|
9225
|
+
return h.add(f), f;
|
|
9226
|
+
{
|
|
9227
|
+
let p = f.firstChild;
|
|
9228
|
+
return p && h.add(p), p;
|
|
9229
|
+
}
|
|
9230
|
+
} else {
|
|
9231
|
+
let p = (
|
|
9232
|
+
/** @type {HTMLTemplateElement} */
|
|
9233
|
+
g.parseFromString(
|
|
9234
|
+
"<body><template>" + E + "</template></body>",
|
|
9235
|
+
"text/html"
|
|
9236
|
+
).body.querySelector("template").content
|
|
9237
|
+
);
|
|
9238
|
+
return h.add(p), p;
|
|
9239
|
+
}
|
|
9240
|
+
}
|
|
9241
|
+
return { normalizeElement: b, normalizeParent: v };
|
|
9242
|
+
})();
|
|
9243
|
+
return {
|
|
9244
|
+
morph: n,
|
|
9245
|
+
defaults: t
|
|
9246
|
+
};
|
|
9247
|
+
})();
|
|
9248
|
+
(function() {
|
|
9249
|
+
function e(t) {
|
|
9250
|
+
if (t === "morph" || t === "morph:outerHTML")
|
|
9251
|
+
return { morphStyle: "outerHTML" };
|
|
9252
|
+
if (t === "morph:innerHTML")
|
|
9253
|
+
return { morphStyle: "innerHTML" };
|
|
9254
|
+
if (t.startsWith("morph:"))
|
|
9255
|
+
return Function("return (" + t.slice(6) + ")")();
|
|
9256
|
+
}
|
|
9257
|
+
htmx.defineExtension("morph", {
|
|
9258
|
+
isInlineSwap: function(t) {
|
|
9259
|
+
let n = e(t);
|
|
9260
|
+
return n?.morphStyle === "outerHTML" || n?.morphStyle == null;
|
|
9261
|
+
},
|
|
9262
|
+
handleSwap: function(t, n, i) {
|
|
9263
|
+
let r = e(t);
|
|
9264
|
+
if (r)
|
|
9265
|
+
return Idiomorph.morph(n, i.children, r);
|
|
9266
|
+
}
|
|
9267
|
+
});
|
|
8658
9268
|
})();
|
|
8659
9269
|
const ServerEventName = {
|
|
8660
9270
|
JOB_STATUS_CHANGE: "job-status-change",
|
|
@@ -8779,7 +9389,10 @@ const VERSION_PREFIX_PATTERN = /^v/i, normalizeVersionTag = (e) => {
|
|
|
8779
9389
|
}, fallbackReleaseLabel = (e) => {
|
|
8780
9390
|
const t = getComparableVersion(e);
|
|
8781
9391
|
return t ? `v${t}` : null;
|
|
8782
|
-
}
|
|
9392
|
+
};
|
|
9393
|
+
module_default.plugin(module_default$1);
|
|
9394
|
+
window.Alpine = module_default;
|
|
9395
|
+
const LATEST_RELEASE_ENDPOINT = "https://api.github.com/repos/arabold/docs-mcp-server/releases/latest", LATEST_RELEASE_FALLBACK_URL = "https://github.com/arabold/docs-mcp-server/releases/latest";
|
|
8783
9396
|
document.addEventListener("alpine:init", () => {
|
|
8784
9397
|
module_default.data("versionUpdate", (e) => ({
|
|
8785
9398
|
currentVersion: typeof e?.currentVersion == "string" ? e.currentVersion : null,
|
|
@@ -8818,29 +9431,24 @@ document.addEventListener("alpine:init", () => {
|
|
|
8818
9431
|
}
|
|
8819
9432
|
}));
|
|
8820
9433
|
});
|
|
8821
|
-
module_default.store("
|
|
8822
|
-
|
|
8823
|
-
|
|
9434
|
+
module_default.store("toast", {
|
|
9435
|
+
visible: !1,
|
|
9436
|
+
message: "",
|
|
9437
|
+
type: "info",
|
|
8824
9438
|
timeoutId: null,
|
|
8825
|
-
|
|
9439
|
+
show(e, t = "info", n = 5e3) {
|
|
9440
|
+
const i = module_default.store("toast");
|
|
9441
|
+
i.timeoutId !== null && (clearTimeout(i.timeoutId), i.timeoutId = null), i.message = e, i.type = t, i.visible = !0, i.timeoutId = window.setTimeout(() => {
|
|
9442
|
+
i.hide();
|
|
9443
|
+
}, n);
|
|
9444
|
+
},
|
|
9445
|
+
hide() {
|
|
9446
|
+
const e = module_default.store("toast");
|
|
9447
|
+
e.visible = !1, e.timeoutId !== null && (clearTimeout(e.timeoutId), e.timeoutId = null);
|
|
9448
|
+
}
|
|
8826
9449
|
});
|
|
8827
9450
|
module_default.start();
|
|
8828
9451
|
initFlowbite();
|
|
8829
|
-
document.addEventListener("job-list-refresh", () => {
|
|
8830
|
-
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8831
|
-
});
|
|
8832
|
-
document.addEventListener("job-status-change", () => {
|
|
8833
|
-
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8834
|
-
});
|
|
8835
|
-
document.addEventListener("job-progress", () => {
|
|
8836
|
-
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8837
|
-
});
|
|
8838
|
-
document.addEventListener("job-list-change", () => {
|
|
8839
|
-
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8840
|
-
});
|
|
8841
|
-
document.addEventListener("library-change", () => {
|
|
8842
|
-
htmx.ajax("get", "/web/libraries", "#library-list");
|
|
8843
|
-
});
|
|
8844
9452
|
const eventClient = new EventClient();
|
|
8845
9453
|
eventClient.subscribe((e) => {
|
|
8846
9454
|
console.log(`📋 Received event: ${e.type}`, e.payload), document.body.dispatchEvent(
|
|
@@ -8853,22 +9461,67 @@ eventClient.connect();
|
|
|
8853
9461
|
window.addEventListener("beforeunload", () => {
|
|
8854
9462
|
eventClient.disconnect();
|
|
8855
9463
|
});
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
9464
|
+
const confirmationTimeouts = /* @__PURE__ */ new Map();
|
|
9465
|
+
function startConfirmationTimeout(e, t = 3e3) {
|
|
9466
|
+
clearConfirmationTimeout(e);
|
|
9467
|
+
const n = Date.now() + t, i = window.setTimeout(() => {
|
|
9468
|
+
confirmationTimeouts.delete(e);
|
|
9469
|
+
const r = document.getElementById(e);
|
|
9470
|
+
if (r) {
|
|
9471
|
+
const a = module_default.$data(r);
|
|
9472
|
+
a && (a.confirming = !1);
|
|
9473
|
+
}
|
|
9474
|
+
}, t);
|
|
9475
|
+
confirmationTimeouts.set(e, { timeoutId: i, expiresAt: n });
|
|
9476
|
+
}
|
|
9477
|
+
function clearConfirmationTimeout(e) {
|
|
9478
|
+
const t = confirmationTimeouts.get(e);
|
|
9479
|
+
t && (clearTimeout(t.timeoutId), confirmationTimeouts.delete(e));
|
|
9480
|
+
}
|
|
9481
|
+
function hasActiveConfirmation(e) {
|
|
9482
|
+
const t = confirmationTimeouts.get(e);
|
|
9483
|
+
return t !== void 0 && t.expiresAt > Date.now();
|
|
9484
|
+
}
|
|
9485
|
+
const confirmationManager = {
|
|
9486
|
+
start: startConfirmationTimeout,
|
|
9487
|
+
clear: clearConfirmationTimeout,
|
|
9488
|
+
isActive: hasActiveConfirmation
|
|
9489
|
+
};
|
|
9490
|
+
window.confirmationManager = confirmationManager;
|
|
9491
|
+
document.body.addEventListener("htmx:beforeSwap", (e) => {
|
|
9492
|
+
const n = e.detail?.target;
|
|
9493
|
+
n && module_default.destroyTree(n);
|
|
8863
9494
|
});
|
|
8864
9495
|
document.body.addEventListener("htmx:afterSwap", (e) => {
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
9496
|
+
const n = e.detail?.target;
|
|
9497
|
+
n && (n.querySelectorAll("[x-data][id]").forEach((i) => {
|
|
9498
|
+
i.id && hasActiveConfirmation(i.id) && (i.dataset.confirming = "true");
|
|
9499
|
+
}), module_default.initTree(n));
|
|
9500
|
+
});
|
|
9501
|
+
document.body.addEventListener("htmx:responseError", (e) => {
|
|
9502
|
+
const n = e.detail?.xhr;
|
|
9503
|
+
if (!n) return;
|
|
9504
|
+
let i = "An error occurred";
|
|
9505
|
+
try {
|
|
9506
|
+
if (n.getResponseHeader("content-type")?.includes("application/json")) {
|
|
9507
|
+
const s = JSON.parse(n.response);
|
|
9508
|
+
i = s.message || s.error || i;
|
|
9509
|
+
} else n.response && typeof n.response == "string" && (i = n.response);
|
|
9510
|
+
} catch {
|
|
9511
|
+
i = n.statusText || i;
|
|
8872
9512
|
}
|
|
9513
|
+
module_default.store("toast").show(i, "error"), e.preventDefault();
|
|
9514
|
+
});
|
|
9515
|
+
document.body.addEventListener("htmx:afterRequest", (e) => {
|
|
9516
|
+
const n = e.detail?.xhr;
|
|
9517
|
+
if (!n || !n.getResponseHeader) return;
|
|
9518
|
+
const i = n.getResponseHeader("HX-Trigger");
|
|
9519
|
+
if (i)
|
|
9520
|
+
try {
|
|
9521
|
+
const r = JSON.parse(i);
|
|
9522
|
+
r.toast && module_default.store("toast").show(r.toast.message, r.toast.type || "info");
|
|
9523
|
+
} catch (r) {
|
|
9524
|
+
console.debug("Failed to parse HX-Trigger header", r);
|
|
9525
|
+
}
|
|
8873
9526
|
});
|
|
8874
9527
|
//# sourceMappingURL=main.js.map
|