diff --git a/cmd/template/advanced/files/htmx/htmx.min.js.tmpl b/cmd/template/advanced/files/htmx/htmx.min.js.tmpl index 1b3fe890..47d5fd44 100644 --- a/cmd/template/advanced/files/htmx/htmx.min.js.tmpl +++ b/cmd/template/advanced/files/htmx/htmx.min.js.tmpl @@ -67,13 +67,13 @@ var htmx = (function () { }, parseInterval: null, _: null, - version: "2.0.1", + version: "2.0.2", }; Q.onLoad = $; - Q.process = kt; + Q.process = Dt; Q.on = be; Q.off = we; - Q.trigger = he; + Q.trigger = de; Q.ajax = Hn; Q.find = r; Q.findAll = p; @@ -84,55 +84,55 @@ var htmx = (function () { Q.toggleClass = W; Q.takeClass = ge; Q.swap = ze; - Q.defineExtension = Un; - Q.removeExtension = Bn; + Q.defineExtension = Bn; + Q.removeExtension = Un; Q.logAll = z; Q.logNone = J; - Q.parseInterval = d; + Q.parseInterval = h; Q._ = _; const n = { addTriggerHandler: Et, bodyContains: le, canAccessLocalStorage: j, findThisElement: Ee, - filterValues: dn, + filterValues: hn, swap: ze, hasAttribute: s, getAttributeValue: te, getClosestAttributeValue: re, getClosestMatch: T, getExpressionVars: Cn, - getHeaders: hn, + getHeaders: dn, getInputValues: cn, getInternalData: ie, getSwapSpecification: pn, getTriggerSpecs: lt, getTarget: Ce, - makeFragment: k, + makeFragment: D, mergeObjects: ue, makeSettleInfo: xn, oobSwap: Te, - querySelectorExt: fe, + querySelectorExt: ae, settleImmediately: Gt, - shouldCancel: dt, - triggerEvent: he, - triggerErrorEvent: ae, - withExtensions: Ut, + shouldCancel: ht, + triggerEvent: de, + triggerErrorEvent: fe, + withExtensions: Bt, }; const v = ["get", "post", "put", "delete", "patch"]; - const R = v + const O = v .map(function (e) { return "[hx-" + e + "], [data-hx-" + e + "]"; }) .join(", "); - const O = e("head"); + const R = e("head"); function e(e, t = false) { return new RegExp( `<${e}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${e}>`, t ? "gim" : "im", ); } - function d(e) { + function h(e) { if (e == undefined) { return undefined; } @@ -203,7 +203,7 @@ var htmx = (function () { return r; } } - function a(e, t) { + function f(e, t) { const n = e instanceof Element && (e.matches || @@ -250,7 +250,7 @@ var htmx = (function () { (e.type === "text/javascript" || e.type === "module" || e.type === "") ); } - function D(e) { + function k(e) { Array.from(e.querySelectorAll("script")).forEach((e) => { if (P(e)) { const t = I(e); @@ -265,8 +265,8 @@ var htmx = (function () { } }); } - function k(e) { - const t = e.replace(O, ""); + function D(e) { + const t = e.replace(R, ""); const n = L(t); let r; if (n === "html") { @@ -295,7 +295,7 @@ var htmx = (function () { } if (r) { if (Q.config.allowScriptTags) { - D(r); + k(r); } else { r.querySelectorAll("script").forEach((e) => e.remove()); } @@ -340,7 +340,7 @@ var htmx = (function () { } } } - function U(e) { + function B(e) { const t = e.getBoundingClientRect(); const n = t.top; const r = t.bottom; @@ -354,7 +354,7 @@ var htmx = (function () { return ne().body.contains(e); } } - function B(e) { + function U(e) { return e.trim().split(/\s+/); } function ue(e, t) { @@ -455,7 +455,7 @@ var htmx = (function () { function Z(e) { return typeof e === "string" ? e : null; } - function h(e) { + function d(e) { return e instanceof Element || e instanceof Document || e instanceof DocumentFragment @@ -512,7 +512,7 @@ var htmx = (function () { return e.closest(t); } else { do { - if (e == null || a(e, t)) { + if (e == null || f(e, t)) { return e; } } while ((e = e && ce(u(e)))); @@ -538,7 +538,7 @@ var htmx = (function () { if (t.indexOf("closest ") === 0) { return [g(ce(e), i(t.substr(8)))]; } else if (t.indexOf("find ") === 0) { - return [r(h(e), i(t.substr(5)))]; + return [r(d(e), i(t.substr(5)))]; } else if (t === "next") { return [ce(e).nextElementSibling]; } else if (t.indexOf("next ") === 0) { @@ -558,11 +558,11 @@ var htmx = (function () { } else if (t.indexOf("global ") === 0) { return m(e, t.slice(7), true); } else { - return F(h(H(e, !!n)).querySelectorAll(i(t))); + return F(d(H(e, !!n)).querySelectorAll(i(t))); } } var me = function (t, e, n) { - const r = h(H(t, n)).querySelectorAll(e); + const r = d(H(t, n)).querySelectorAll(e); for (let e = 0; e < r.length; e++) { const o = r[e]; if (o.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_PRECEDING) { @@ -571,7 +571,7 @@ var htmx = (function () { } }; var ye = function (t, e, n) { - const r = h(H(t, n)).querySelectorAll(e); + const r = d(H(t, n)).querySelectorAll(e); for (let e = r.length - 1; e >= 0; e--) { const o = r[e]; if (o.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_FOLLOWING) { @@ -579,7 +579,7 @@ var htmx = (function () { } } }; - function fe(e, t) { + function ae(e, t) { if (typeof e !== "string") { return m(e, t)[0]; } else { @@ -588,7 +588,7 @@ var htmx = (function () { } function y(e, t) { if (typeof e === "string") { - return r(h(t) || document, e); + return r(d(t) || document, e); } else { return e; } @@ -645,7 +645,7 @@ var htmx = (function () { if (t === "this") { return Ee(e, "hx-target"); } else { - return fe(e, t); + return ae(e, t); } } else { const n = ie(e); @@ -656,7 +656,7 @@ var htmx = (function () { } } } - function Re(t) { + function Oe(t) { const n = Q.config.attributesToSettle; for (let e = 0; e < n.length; e++) { if (t === n[e]) { @@ -665,14 +665,14 @@ var htmx = (function () { } return false; } - function Oe(t, n) { + function Re(t, n) { se(t.attributes, function (e) { - if (!n.hasAttribute(e.name) && Re(e.name)) { + if (!n.hasAttribute(e.name) && Oe(e.name)) { t.removeAttribute(e.name); } }); se(n.attributes, function (e) { - if (Re(e.name)) { + if (Oe(e.name)) { t.setAttribute(e.name, e.value); } }); @@ -709,22 +709,22 @@ var htmx = (function () { t = ne().createDocumentFragment(); t.appendChild(n); if (!He(s, e)) { - t = h(n); + t = d(n); } const r = { shouldSwap: true, target: e, fragment: t }; - if (!he(e, "htmx:oobBeforeSwap", r)) return; + if (!de(e, "htmx:oobBeforeSwap", r)) return; e = r.target; if (r.shouldSwap) { _e(s, e, e, t, i); } se(i.elts, function (e) { - he(e, "htmx:oobAfterSwap", r); + de(e, "htmx:oobAfterSwap", r); }); }); o.parentNode.removeChild(o); } else { o.parentNode.removeChild(o); - ae(ne().body, "htmx:oobErrorNoTarget", { content: o }); + fe(ne().body, "htmx:oobErrorNoTarget", { content: o }); } return e; } @@ -743,13 +743,13 @@ var htmx = (function () { if (n && n.length > 0) { const r = n.replace("'", "\\'"); const o = t.tagName.replace(":", "\\:"); - const e = h(l); + const e = d(l); const i = e && e.querySelector(o + "[id='" + r + "']"); if (i && i !== e) { const s = t.cloneNode(); - Oe(t, i); + Re(t, i); u.tasks.push(function () { - Oe(t, s); + Re(t, s); }); } } @@ -758,14 +758,14 @@ var htmx = (function () { function Ne(e) { return function () { o(e, Q.config.addedClass); - kt(ce(e)); - Ae(h(e)); - he(e, "htmx:load"); + Dt(ce(e)); + Ae(d(e)); + de(e, "htmx:load"); }; } function Ae(e) { const t = "[autofocus]"; - const n = G(a(e, t) ? e : e.querySelector(t)); + const n = G(f(e, t) ? e : e.querySelector(t)); if (n != null) { n.focus(); } @@ -801,7 +801,7 @@ var htmx = (function () { } return n; } - function De(t) { + function ke(t) { const n = ie(t); if (n.onHandlers) { for (let e = 0; e < n.onHandlers.length; e++) { @@ -811,7 +811,7 @@ var htmx = (function () { delete n.onHandlers; } } - function ke(e) { + function De(e) { const t = ie(e); if (t.timeout) { clearTimeout(t.timeout); @@ -823,17 +823,17 @@ var htmx = (function () { } }); } - De(e); + ke(e); se(Object.keys(t), function (e) { delete t[e]; }); } - function f(e) { - he(e, "htmx:beforeCleanupElement"); - ke(e); + function a(e) { + de(e, "htmx:beforeCleanupElement"); + De(e); if (e.children) { se(e.children, function (e) { - f(e); + a(e); }); } } @@ -855,12 +855,10 @@ var htmx = (function () { while (r && r !== t) { if (r instanceof Element) { n.elts.push(r); - r = r.nextElementSibling; - } else { - r = null; } + r = r.nextSibling; } - f(t); + a(t); if (t instanceof Element) { t.remove(); } else { @@ -873,14 +871,14 @@ var htmx = (function () { function Fe(e, t, n) { return c(u(e), e, t, n); } - function Ue(e, t, n) { + function Be(e, t, n) { return c(e, null, t, n); } - function Be(e, t, n) { + function Ue(e, t, n) { return c(u(e), e.nextSibling, t, n); } function je(e) { - f(e); + a(e); return u(e).removeChild(e); } function Ve(e, t, n) { @@ -888,10 +886,10 @@ var htmx = (function () { c(e, r, t, n); if (r) { while (r.nextSibling) { - f(r.nextSibling); + a(r.nextSibling); e.removeChild(r.nextSibling); } - f(r); + a(r); e.removeChild(r); } } @@ -909,10 +907,10 @@ var htmx = (function () { Fe(n, r, o); return; case "beforeend": - Ue(n, r, o); + Be(n, r, o); return; case "afterend": - Be(n, r, o); + Ue(n, r, o); return; case "delete": je(n); @@ -924,7 +922,7 @@ var htmx = (function () { try { const l = s.handleSwap(t, n, r, o); if (l) { - if (typeof l.length !== "undefined") { + if (Array.isArray(l)) { for (let e = 0; e < l.length; e++) { const u = l[e]; if ( @@ -949,7 +947,8 @@ var htmx = (function () { } } function $e(e, n) { - se(p(e, "[hx-swap-oob], [data-hx-swap-oob]"), function (e) { + var t = p(e, "[hx-swap-oob], [data-hx-swap-oob]"); + se(t, function (e) { if (Q.config.allowNestedOobSwaps || e.parentElement === null) { const t = te(e, "hx-swap-oob"); if (t != null) { @@ -960,6 +959,7 @@ var htmx = (function () { e.removeAttribute("data-hx-swap-oob"); } }); + return t.length > 0; } function ze(e, t, r, o) { if (!o) { @@ -979,7 +979,7 @@ var htmx = (function () { if (r.swapStyle === "textContent") { e.textContent = t; } else { - let n = k(t); + let n = D(t); s.title = n.title; if (o.selectOOB) { const u = o.selectOOB.split(","); @@ -989,48 +989,44 @@ var htmx = (function () { if (e.indexOf("#") === 0) { e = e.substring(1); } - const f = c[1] || "true"; - const a = n.querySelector("#" + e); - if (a) { - Te(f, a, s); + const a = c[1] || "true"; + const f = n.querySelector("#" + e); + if (f) { + Te(a, f, s); } } } $e(n, s); se(p(n, "template"), function (e) { - $e(e.content, s); - if ( - e.content.childElementCount === 0 && - e.content.textContent.trim() === "" - ) { + if ($e(e.content, s)) { e.remove(); } }); if (o.select) { - const h = ne().createDocumentFragment(); + const d = ne().createDocumentFragment(); se(n.querySelectorAll(o.select), function (e) { - h.appendChild(e); + d.appendChild(e); }); - n = h; + n = d; } qe(n); _e(r.swapStyle, o.contextElement, e, n, s); } if (i.elt && !le(i.elt) && ee(i.elt, "id")) { - const d = document.getElementById(ee(i.elt, "id")); + const h = document.getElementById(ee(i.elt, "id")); const g = { preventScroll: r.focusScroll !== undefined ? !r.focusScroll : !Q.config.defaultFocusScroll, }; - if (d) { - if (i.start && d.setSelectionRange) { + if (h) { + if (i.start && h.setSelectionRange) { try { - d.setSelectionRange(i.start, i.end); + h.setSelectionRange(i.start, i.end); } catch (e) {} } - d.focus(g); + h.focus(g); } } e.classList.remove(Q.config.swappingClass); @@ -1038,13 +1034,13 @@ var htmx = (function () { if (e.classList) { e.classList.add(Q.config.settlingClass); } - he(e, "htmx:afterSwap", o.eventInfo); + de(e, "htmx:afterSwap", o.eventInfo); }); if (o.afterSwapCallback) { o.afterSwapCallback(); } if (!r.ignoreTitle) { - kn(s.title); + Dn(s.title); } const l = function () { se(s.tasks, function (e) { @@ -1054,7 +1050,7 @@ var htmx = (function () { if (e.classList) { e.classList.remove(Q.config.settlingClass); } - he(e, "htmx:afterSettle", o.eventInfo); + de(e, "htmx:afterSettle", o.eventInfo); }); if (o.anchor) { const e = ce(y("#" + o.anchor)); @@ -1080,16 +1076,18 @@ var htmx = (function () { for (const i in o) { if (o.hasOwnProperty(i)) { let e = o[i]; - if (!X(e)) { + if (X(e)) { + n = e.target !== undefined ? e.target : n; + } else { e = { value: e }; } - he(n, i, e); + de(n, i, e); } } } else { const s = r.split(","); for (let e = 0; e < s.length; e++) { - he(n, s[e].trim(), []); + de(n, s[e].trim(), []); } } } @@ -1169,7 +1167,7 @@ var htmx = (function () { l.source = t; return l; } catch (e) { - ae(ne().body, "htmx:syntax:error", { error: e, source: t }); + fe(ne().body, "htmx:syntax:error", { error: e, source: t }); return null; } } @@ -1226,7 +1224,7 @@ var htmx = (function () { if (u === "every") { const c = { trigger: "every" }; b(o, We); - c.pollInterval = d(b(o, /[,\[\s]/)); + c.pollInterval = h(b(o, /[,\[\s]/)); b(o, We); var i = rt(e, o, "event"); if (i) { @@ -1234,24 +1232,24 @@ var htmx = (function () { } r.push(c); } else { - const f = { trigger: u }; + const a = { trigger: u }; var i = rt(e, o, "event"); if (i) { - f.eventFilter = i; + a.eventFilter = i; } while (o.length > 0 && o[0] !== ",") { b(o, We); - const a = o.shift(); - if (a === "changed") { - f.changed = true; - } else if (a === "once") { - f.once = true; - } else if (a === "consume") { - f.consume = true; - } else if (a === "delay" && o[0] === ":") { + const f = o.shift(); + if (f === "changed") { + a.changed = true; + } else if (f === "once") { + a.once = true; + } else if (f === "consume") { + a.consume = true; + } else if (f === "delay" && o[0] === ":") { o.shift(); - f.delay = d(b(o, x)); - } else if (a === "from" && o[0] === ":") { + a.delay = h(b(o, x)); + } else if (f === "from" && o[0] === ":") { o.shift(); if (Qe.test(o[0])) { var s = ot(o); @@ -1264,37 +1262,37 @@ var htmx = (function () { s === "previous" ) { o.shift(); - const h = ot(o); - if (h.length > 0) { - s += " " + h; + const d = ot(o); + if (d.length > 0) { + s += " " + d; } } } - f.from = s; - } else if (a === "target" && o[0] === ":") { + a.from = s; + } else if (f === "target" && o[0] === ":") { o.shift(); - f.target = ot(o); - } else if (a === "throttle" && o[0] === ":") { + a.target = ot(o); + } else if (f === "throttle" && o[0] === ":") { o.shift(); - f.throttle = d(b(o, x)); - } else if (a === "queue" && o[0] === ":") { + a.throttle = h(b(o, x)); + } else if (f === "queue" && o[0] === ":") { o.shift(); - f.queue = b(o, x); - } else if (a === "root" && o[0] === ":") { + a.queue = b(o, x); + } else if (f === "root" && o[0] === ":") { o.shift(); - f[a] = ot(o); - } else if (a === "threshold" && o[0] === ":") { + a[f] = ot(o); + } else if (f === "threshold" && o[0] === ":") { o.shift(); - f[a] = b(o, x); + a[f] = b(o, x); } else { - ae(e, "htmx:syntax:error", { token: o.shift() }); + fe(e, "htmx:syntax:error", { token: o.shift() }); } } - r.push(f); + r.push(a); } } if (o.length === l) { - ae(e, "htmx:syntax:error", { token: o.shift() }); + fe(e, "htmx:syntax:error", { token: o.shift() }); } b(o, We); } while (o[0] === "," && o.shift()); @@ -1312,11 +1310,11 @@ var htmx = (function () { } if (n.length > 0) { return n; - } else if (a(e, "form")) { + } else if (f(e, "form")) { return [{ trigger: "submit" }]; - } else if (a(e, 'input[type="button"], input[type="submit"]')) { + } else if (f(e, 'input[type="button"], input[type="submit"]')) { return [{ trigger: "click" }]; - } else if (a(e, it)) { + } else if (f(e, it)) { return [{ trigger: "change" }]; } else { return [{ trigger: "click" }]; @@ -1336,22 +1334,23 @@ var htmx = (function () { } }, n.pollInterval); } - function ft(e) { + function at(e) { return ( location.hostname === e.hostname && ee(e, "href") && ee(e, "href").indexOf("#") !== 0 ); } - function at(e) { + function ft(e) { return g(e, Q.config.disableSelector); } - function ht(t, n, e) { + function dt(t, n, e) { if ( (t instanceof HTMLAnchorElement && - ft(t) && + at(t) && (t.target === "" || t.target === "_self")) || - t.tagName === "FORM" + (t.tagName === "FORM" && + String(ee(t, "method")).toLowerCase() !== "dialog") ) { n.boosted = true; let r, o; @@ -1370,11 +1369,11 @@ var htmx = (function () { t, function (e, t) { const n = ce(e); - if (at(n)) { - f(n); + if (ft(n)) { + a(n); return; } - de(r, o, n, t); + he(r, o, n, t); }, n, e, @@ -1383,7 +1382,7 @@ var htmx = (function () { }); } } - function dt(e, t) { + function ht(e, t) { const n = ce(t); if (!n) { return false; @@ -1392,7 +1391,7 @@ var htmx = (function () { if (n.tagName === "FORM") { return true; } - if (a(n, 'input[type="submit"], button') && g(n, "form") !== null) { + if (f(n, 'input[type="submit"], button') && g(n, "form") !== null) { return true; } if ( @@ -1421,14 +1420,14 @@ var htmx = (function () { return r.call(t, n) !== true; } catch (e) { const o = r.source; - ae(ne().body, "htmx:eventFilter:error", { error: e, source: o }); + fe(ne().body, "htmx:eventFilter:error", { error: e, source: o }); return true; } } return false; } function mt(s, l, e, u, c) { - const f = ie(s); + const a = ie(s); let t; if (u.from) { t = m(s, u.from); @@ -1450,7 +1449,7 @@ var htmx = (function () { if (gt(s, e)) { return; } - if (c || dt(e, s)) { + if (c || ht(e, s)) { e.preventDefault(); } if (pt(u, s, e)) { @@ -1467,15 +1466,15 @@ var htmx = (function () { e.stopPropagation(); } if (u.target && e.target) { - if (!a(ce(e.target), u.target)) { + if (!f(ce(e.target), u.target)) { return; } } if (u.once) { - if (f.triggeredOnce) { + if (a.triggeredOnce) { return; } else { - f.triggeredOnce = true; + a.triggeredOnce = true; } } if (u.changed) { @@ -1486,25 +1485,27 @@ var htmx = (function () { } n.lastValue = r; } - if (f.delayed) { - clearTimeout(f.delayed); + if (a.delayed) { + clearTimeout(a.delayed); } - if (f.throttle) { + if (a.throttle) { return; } if (u.throttle > 0) { - if (!f.throttle) { + if (!a.throttle) { + de(s, "htmx:trigger"); l(s, e); - f.throttle = E().setTimeout(function () { - f.throttle = null; + a.throttle = E().setTimeout(function () { + a.throttle = null; }, u.throttle); } } else if (u.delay > 0) { - f.delayed = E().setTimeout(function () { + a.delayed = E().setTimeout(function () { + de(s, "htmx:trigger"); l(s, e); }, u.delay); } else { - he(s, "htmx:trigger"); + de(s, "htmx:trigger"); l(s, e); } } @@ -1540,16 +1541,16 @@ var htmx = (function () { } } function wt(e) { - if (!s(e, "data-hx-revealed") && U(e)) { + if (!s(e, "data-hx-revealed") && B(e)) { e.setAttribute("data-hx-revealed", "true"); const t = ie(e); if (t.initHash) { - he(e, "revealed"); + de(e, "revealed"); } else { e.addEventListener( "htmx:afterProcessNode", function () { - he(e, "revealed"); + de(e, "revealed"); }, { once: true }, ); @@ -1581,10 +1582,10 @@ var htmx = (function () { Et(t, e, n, function (e, t) { const n = ce(e); if (g(n, Q.config.disableSelector)) { - f(n); + a(n); return; } - de(r, o, n, t); + he(r, o, n, t); }); }); } @@ -1599,7 +1600,7 @@ var htmx = (function () { } else if (e.trigger === "intersect") { const o = {}; if (e.root) { - o.root = fe(r, e.root); + o.root = ae(r, e.root); } if (e.threshold) { o.threshold = parseFloat(e.threshold); @@ -1608,7 +1609,7 @@ var htmx = (function () { for (let e = 0; e < t.length; e++) { const n = t[e]; if (n.isIntersecting) { - he(r, "intersect"); + de(r, "intersect"); break; } } @@ -1645,15 +1646,15 @@ var htmx = (function () { } return false; } - const Rt = new XPathEvaluator().createExpression( + const Ot = new XPathEvaluator().createExpression( './/*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' + ' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', ); - function Ot(e, t) { + function Rt(e, t) { if (Ct(e)) { t.push(ce(e)); } - const n = Rt.evaluate(e); + const n = Ot.evaluate(e); let r = null; while ((r = n.iterateNext())) t.push(ce(r)); } @@ -1661,10 +1662,10 @@ var htmx = (function () { const t = []; if (e instanceof DocumentFragment) { for (const n of e.childNodes) { - Ot(n, t); + Rt(n, t); } } else { - Ot(e, t); + Rt(e, t); } return t; } @@ -1683,7 +1684,7 @@ var htmx = (function () { } } const o = e.querySelectorAll( - R + + O + n + ", form, [type='submit']," + " [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]" + @@ -1734,7 +1735,7 @@ var htmx = (function () { let o; const i = function (e) { vn(t, function () { - if (at(t)) { + if (ft(t)) { return; } if (!o) { @@ -1747,7 +1748,7 @@ var htmx = (function () { r.onHandlers.push({ event: e, listener: i }); } function Pt(t) { - De(t); + ke(t); for (let e = 0; e < t.attributes.length; e++) { const n = t.attributes[e].name; const r = t.attributes[e].value; @@ -1768,16 +1769,16 @@ var htmx = (function () { } } } - function Dt(t) { + function kt(t) { if (g(t, Q.config.disableSelector)) { - f(t); + a(t); return; } const n = ie(t); if (n.initHash !== Pe(t)) { - ke(t); + De(t); n.initHash = Pe(t); - he(t, "htmx:beforeProcessNode"); + de(t, "htmx:beforeProcessNode"); if (t.value) { n.lastValue = t.value; } @@ -1785,7 +1786,7 @@ var htmx = (function () { const r = St(t, n, e); if (!r) { if (re(t, "hx-boost") === "true") { - ht(t, n, e); + dt(t, n, e); } else if (s(t, "hx-trigger")) { e.forEach(function (e) { Et(t, e, n, function () {}); @@ -1798,18 +1799,18 @@ var htmx = (function () { ) { At(t); } - he(t, "htmx:afterProcessNode"); + de(t, "htmx:afterProcessNode"); } } - function kt(e) { + function Dt(e) { e = y(e); if (g(e, Q.config.disableSelector)) { - f(e); + a(e); return; } - Dt(e); + kt(e); se(Tt(e), function (e) { - Dt(e); + kt(e); }); se(Ht(e), Pt); } @@ -1831,13 +1832,13 @@ var htmx = (function () { } return n; } - function ae(e, t, n) { - he(e, t, ue({ error: t }, n)); + function fe(e, t, n) { + de(e, t, ue({ error: t }, n)); } function Ft(e) { return e === "htmx:afterProcessNode"; } - function Ut(e, t) { + function Bt(e, t) { se(jn(e), function (e) { try { t(e); @@ -1853,7 +1854,7 @@ var htmx = (function () { console.log("ERROR: ", e); } } - function he(e, t, n) { + function de(e, t, n) { e = y(e); if (n == null) { n = {}; @@ -1865,7 +1866,7 @@ var htmx = (function () { } if (n.error) { w(n.error); - he(e, "htmx:error", { errorInfo: n }); + de(e, "htmx:error", { errorInfo: n }); } let o = e.dispatchEvent(r); const i = Mt(t); @@ -1873,12 +1874,12 @@ var htmx = (function () { const s = Xt(i, r.detail); o = o && e.dispatchEvent(s); } - Ut(ce(e), function (e) { + Bt(ce(e), function (e) { o = o && e.onEvent(t, r) !== false && !r.defaultPrevented; }); return o; } - let Bt = location.pathname + location.search; + let Ut = location.pathname + location.search; function jt() { const e = ne().querySelector("[hx-history-elt],[data-hx-history-elt]"); return e || ne().body; @@ -1903,7 +1904,7 @@ var htmx = (function () { } } const s = { url: t, content: n, title: r, scroll: o }; - he(ne().body, "htmx:historyItemCreated", { item: s, cache: i }); + de(ne().body, "htmx:historyItemCreated", { item: s, cache: i }); i.push(s); while (i.length > Q.config.historyCacheSize) { i.shift(); @@ -1913,7 +1914,7 @@ var htmx = (function () { localStorage.setItem("htmx-history-cache", JSON.stringify(i)); break; } catch (e) { - ae(ne().body, "htmx:historyCacheError", { cause: e, cache: i }); + fe(ne().body, "htmx:historyCacheError", { cause: e, cache: i }); i.shift(); } } @@ -1937,11 +1938,14 @@ var htmx = (function () { se(p(n, "." + t), function (e) { o(e, t); }); + se(p(n, "[data-disabled-by-htmx]"), function (e) { + e.removeAttribute("disabled"); + }); return n.innerHTML; } function zt() { const e = jt(); - const t = Bt || location.pathname + location.search; + const t = Ut || location.pathname + location.search; let n; try { n = ne().querySelector( @@ -1951,7 +1955,7 @@ var htmx = (function () { n = ne().querySelector('[hx-history="false"],[data-hx-history="false"]'); } if (!n) { - he(ne().body, "htmx:beforeHistorySave", { path: t, historyElt: e }); + de(ne().body, "htmx:beforeHistorySave", { path: t, historyElt: e }); Vt(t, e); } if (Q.config.historyEnabled) @@ -1967,11 +1971,11 @@ var htmx = (function () { if (Q.config.historyEnabled) { history.pushState({ htmx: true }, "", e); } - Bt = e; + Ut = e; } function Kt(e) { if (Q.config.historyEnabled) history.replaceState({ htmx: true }, "", e); - Bt = e; + Ut = e; } function Gt(e) { se(e, function (e) { @@ -1981,30 +1985,30 @@ var htmx = (function () { function Zt(o) { const e = new XMLHttpRequest(); const i = { path: o, xhr: e }; - he(ne().body, "htmx:historyCacheMiss", i); + de(ne().body, "htmx:historyCacheMiss", i); e.open("GET", o, true); e.setRequestHeader("HX-Request", "true"); e.setRequestHeader("HX-History-Restore-Request", "true"); e.setRequestHeader("HX-Current-URL", ne().location.href); e.onload = function () { if (this.status >= 200 && this.status < 400) { - he(ne().body, "htmx:historyCacheMissLoad", i); - const e = k(this.response); + de(ne().body, "htmx:historyCacheMissLoad", i); + const e = D(this.response); const t = e.querySelector("[hx-history-elt],[data-hx-history-elt]") || e; const n = jt(); const r = xn(n); - kn(e.title); + Dn(e.title); Ve(n, t, r); Gt(r.tasks); - Bt = o; - he(ne().body, "htmx:historyRestore", { + Ut = o; + de(ne().body, "htmx:historyRestore", { path: o, cacheMiss: true, serverResponse: this.response, }); } else { - ae(ne().body, "htmx:historyCacheMissLoadError", i); + fe(ne().body, "htmx:historyCacheMissLoadError", i); } }; e.send(); @@ -2014,17 +2018,17 @@ var htmx = (function () { e = e || location.pathname + location.search; const t = _t(e); if (t) { - const n = k(t.content); + const n = D(t.content); const r = jt(); const o = xn(r); - kn(n.title); + Dn(n.title); Ve(r, n, o); Gt(o.tasks); E().setTimeout(function () { window.scrollTo(0, t.scroll); }, 0); - Bt = e; - he(ne().body, "htmx:historyRestore", { path: e, item: t }); + Ut = e; + de(ne().body, "htmx:historyRestore", { path: e, item: t }); } else { if (Q.config.refreshOnHistoryMiss) { window.location.reload(true); @@ -2054,6 +2058,7 @@ var htmx = (function () { const t = ie(e); t.requestCount = (t.requestCount || 0) + 1; e.setAttribute("disabled", ""); + e.setAttribute("data-disabled-by-htmx", ""); }); return t; } @@ -2070,6 +2075,7 @@ var htmx = (function () { t.requestCount = (t.requestCount || 0) - 1; if (t.requestCount === 0) { e.removeAttribute("disabled"); + e.removeAttribute("data-disabled-by-htmx"); } }); } @@ -2173,24 +2179,24 @@ var htmx = (function () { function ln(e, t) { const n = e; if (n.willValidate) { - he(n, "htmx:validation:validate"); + de(n, "htmx:validation:validate"); if (!n.checkValidity()) { t.push({ elt: n, message: n.validationMessage, validity: n.validity }); - he(n, "htmx:validation:failed", { + de(n, "htmx:validation:failed", { message: n.validationMessage, validity: n.validity, }); } } } - function un(t, e) { - for (const n of e.keys()) { - t.delete(n); - e.getAll(n).forEach(function (e) { - t.append(n, e); - }); + function un(n, e) { + for (const t of e.keys()) { + n.delete(t); } - return t; + e.forEach(function (e, t) { + n.append(t, e); + }); + return n; } function cn(e, t) { const n = []; @@ -2217,14 +2223,14 @@ var htmx = (function () { (e.tagName === "INPUT" && ee(e, "type") === "submit") ) { const c = s.lastButtonClicked || e; - const f = ee(c, "name"); - rn(f, c.value, o); + const a = ee(c, "name"); + rn(a, c.value, o); } const u = Se(e, "hx-include"); se(u, function (e) { sn(n, r, i, ce(e), l); - if (!a(e, "form")) { - se(h(e).querySelectorAll(it), function (e) { + if (!f(e, "form")) { + se(d(e).querySelectorAll(it), function (e) { sn(n, r, i, e, l); }); } @@ -2232,7 +2238,7 @@ var htmx = (function () { un(r, o); return { errors: i, formData: r, values: An(r) }; } - function fn(e, t, n) { + function an(e, t, n) { if (e !== "") { e += "&"; } @@ -2243,15 +2249,15 @@ var htmx = (function () { e += encodeURIComponent(t) + "=" + r; return e; } - function an(e) { + function fn(e) { e = Ln(e); let n = ""; e.forEach(function (e, t) { - n = fn(n, t, e); + n = an(n, t, e); }); return n; } - function hn(e, t, n) { + function dn(e, t, n) { const r = { "HX-Request": "true", "HX-Trigger": ee(e, "id"), @@ -2268,7 +2274,7 @@ var htmx = (function () { } return r; } - function dn(n, e) { + function hn(n, e) { const t = re(e, "hx-params"); if (t) { if (t === "none") { @@ -2311,14 +2317,14 @@ var htmx = (function () { r.show = "top"; } if (n) { - const s = B(n); + const s = U(n); if (s.length > 0) { for (let e = 0; e < s.length; e++) { const l = s[e]; if (l.indexOf("swap:") === 0) { - r.swapDelay = d(l.substr(5)); + r.swapDelay = h(l.substr(5)); } else if (l.indexOf("settle:") === 0) { - r.settleDelay = d(l.substr(7)); + r.settleDelay = h(l.substr(7)); } else if (l.indexOf("transition:") === 0) { r.transition = l.substr(11) === "true"; } else if (l.indexOf("ignoreTitle:") === 0) { @@ -2331,15 +2337,15 @@ var htmx = (function () { r.scroll = c; r.scrollTarget = i; } else if (l.indexOf("show:") === 0) { - const f = l.substr(5); - var o = f.split(":"); - const a = o.pop(); + const a = l.substr(5); + var o = a.split(":"); + const f = o.pop(); var i = o.length > 0 ? o.join(":") : null; - r.show = a; + r.show = f; r.showTarget = i; } else if (l.indexOf("focus-scroll:") === 0) { - const h = l.substr("focus-scroll:".length); - r.focusScroll = h == "true"; + const d = l.substr("focus-scroll:".length); + r.focusScroll = d == "true"; } else if (e == 0) { r.swapStyle = l; } else { @@ -2353,12 +2359,12 @@ var htmx = (function () { function mn(e) { return ( re(e, "hx-encoding") === "multipart/form-data" || - (a(e, "form") && ee(e, "enctype") === "multipart/form-data") + (f(e, "form") && ee(e, "enctype") === "multipart/form-data") ); } function yn(t, n, r) { let o = null; - Ut(n, function (e) { + Bt(n, function (e) { if (o == null) { o = e.encodeParameters(t, r, n); } @@ -2369,7 +2375,7 @@ var htmx = (function () { if (mn(n)) { return un(new FormData(), Ln(r)); } else { - return an(r); + return fn(r); } } } @@ -2382,7 +2388,7 @@ var htmx = (function () { if (t.scroll) { var o = null; if (t.scrollTarget) { - o = ce(fe(n, t.scrollTarget)); + o = ce(ae(n, t.scrollTarget)); } if (t.scroll === "top" && (n || o)) { o = o || n; @@ -2400,7 +2406,7 @@ var htmx = (function () { if (t.showTarget === "window") { e = "body"; } - o = ce(fe(n, e)); + o = ce(ae(n, e)); } if (t.show === "top" && (n || o)) { o = o || n; @@ -2462,7 +2468,7 @@ var htmx = (function () { if (Q.config.allowEval) { return t(); } else { - ae(e, "htmx:evalDisallowedError"); + fe(e, "htmx:evalDisallowedError"); return n; } } @@ -2475,7 +2481,7 @@ var htmx = (function () { function Cn(e) { return ue(Sn(e), En(e)); } - function Rn(t, n, r) { + function On(t, n, r) { if (r !== null) { try { t.setRequestHeader(n, r); @@ -2485,13 +2491,13 @@ var htmx = (function () { } } } - function On(t) { + function Rn(t) { if (t.responseURL && typeof URL !== "undefined") { try { const e = new URL(t.responseURL); return e.pathname + e.search; } catch (e) { - ae(ne().body, "htmx:badResponseUrl", { url: t.responseURL }); + fe(ne().body, "htmx:badResponseUrl", { url: t.responseURL }); } } } @@ -2502,12 +2508,12 @@ var htmx = (function () { e = e.toLowerCase(); if (n) { if (n instanceof Element || typeof n === "string") { - return de(e, t, null, null, { + return he(e, t, null, null, { targetOverride: y(n), returnPromise: true, }); } else { - return de(e, t, y(n.source), n.event, { + return he(e, t, y(n.source), n.event, { handler: n.handler, headers: n.headers, values: n.values, @@ -2518,7 +2524,7 @@ var htmx = (function () { }); } } else { - return de(e, t, null, null, { returnPromise: true }); + return he(e, t, null, null, { returnPromise: true }); } } function Tn(e) { @@ -2545,7 +2551,7 @@ var htmx = (function () { return false; } } - return he(e, "htmx:validateUrl", ue({ url: o, sameHost: r }, n)); + return de(e, "htmx:validateUrl", ue({ url: o, sameHost: r }, n)); } function Ln(e) { if (e instanceof FormData) return e; @@ -2556,7 +2562,7 @@ var htmx = (function () { e[n].forEach(function (e) { t.append(n, e); }); - } else if (typeof e[n] === "object") { + } else if (typeof e[n] === "object" && !(e[n] instanceof Blob)) { t.append(n, JSON.stringify(e[n])); } else { t.append(n, e[n]); @@ -2637,6 +2643,8 @@ var htmx = (function () { e.forEach(function (e) { t.append(n, e); }); + } else if (typeof e === "object" && !(e instanceof Blob)) { + t.append(n, JSON.stringify(e)); } else { t.append(n, e); } @@ -2656,7 +2664,7 @@ var htmx = (function () { }, }); } - function de(t, n, r, o, i, k) { + function he(t, n, r, o, i, D) { let s = null; let l = null; i = i != null ? i : {}; @@ -2677,28 +2685,28 @@ var htmx = (function () { } const u = i.targetOverride || ce(Ce(r)); if (u == null || u == ve) { - ae(r, "htmx:targetError", { target: te(r, "hx-target") }); + fe(r, "htmx:targetError", { target: te(r, "hx-target") }); oe(l); return e; } let c = ie(r); - const f = c.lastButtonClicked; - if (f) { - const L = ee(f, "formaction"); + const a = c.lastButtonClicked; + if (a) { + const L = ee(a, "formaction"); if (L != null) { n = L; } - const N = ee(f, "formmethod"); + const N = ee(a, "formmethod"); if (N != null) { if (N.toLowerCase() !== "dialog") { t = N; } } } - const a = re(r, "hx-confirm"); - if (k === undefined) { + const f = re(r, "hx-confirm"); + if (D === undefined) { const K = function (e) { - return de(t, n, r, o, i, !!e); + return he(t, n, r, o, i, !!e); }; const G = { target: u, @@ -2708,47 +2716,47 @@ var htmx = (function () { triggeringEvent: o, etc: i, issueRequest: K, - question: a, + question: f, }; - if (he(r, "htmx:confirm", G) === false) { + if (de(r, "htmx:confirm", G) === false) { oe(s); return e; } } - let h = r; - let d = re(r, "hx-sync"); + let d = r; + let h = re(r, "hx-sync"); let g = null; let F = false; - if (d) { - const A = d.split(":"); + if (h) { + const A = h.split(":"); const I = A[0].trim(); if (I === "this") { - h = Ee(r, "hx-sync"); + d = Ee(r, "hx-sync"); } else { - h = ce(fe(r, I)); + d = ce(ae(r, I)); } - d = (A[1] || "drop").trim(); - c = ie(h); - if (d === "drop" && c.xhr && c.abortable !== true) { + h = (A[1] || "drop").trim(); + c = ie(d); + if (h === "drop" && c.xhr && c.abortable !== true) { oe(s); return e; - } else if (d === "abort") { + } else if (h === "abort") { if (c.xhr) { oe(s); return e; } else { F = true; } - } else if (d === "replace") { - he(h, "htmx:abort"); - } else if (d.indexOf("queue") === 0) { - const Z = d.split(" "); + } else if (h === "replace") { + de(d, "htmx:abort"); + } else if (h.indexOf("queue") === 0) { + const Z = h.split(" "); g = (Z[1] || "last").trim(); } } if (c.xhr) { if (c.abortable) { - he(h, "htmx:abort"); + de(d, "htmx:abort"); } else { if (g == null) { if (o) { @@ -2766,16 +2774,16 @@ var htmx = (function () { } if (g === "first" && c.queuedRequests.length === 0) { c.queuedRequests.push(function () { - de(t, n, r, o, i); + he(t, n, r, o, i); }); } else if (g === "all") { c.queuedRequests.push(function () { - de(t, n, r, o, i); + he(t, n, r, o, i); }); } else if (g === "last") { c.queuedRequests = []; c.queuedRequests.push(function () { - de(t, n, r, o, i); + he(t, n, r, o, i); }); } oe(s); @@ -2793,38 +2801,38 @@ var htmx = (function () { e(); } }; - const U = re(r, "hx-prompt"); - if (U) { - var y = prompt(U); - if (y === null || !he(r, "htmx:prompt", { prompt: y, target: u })) { + const B = re(r, "hx-prompt"); + if (B) { + var y = prompt(B); + if (y === null || !de(r, "htmx:prompt", { prompt: y, target: u })) { oe(s); m(); return e; } } - if (a && !k) { - if (!confirm(a)) { + if (f && !D) { + if (!confirm(f)) { oe(s); m(); return e; } } - let x = hn(r, u, y); + let x = dn(r, u, y); if (t !== "get" && !mn(r)) { x["Content-Type"] = "application/x-www-form-urlencoded"; } if (i.headers) { x = ue(x, i.headers); } - const B = cn(r, t); - let b = B.errors; - const j = B.formData; + const U = cn(r, t); + let b = U.errors; + const j = U.formData; if (i.values) { un(j, Ln(i.values)); } const V = Ln(Cn(r)); const w = un(j, V); - let v = dn(w, r); + let v = hn(w, r); if (Q.config.getCacheBusterParam && t === "get") { v.set("org.htmx.cache-buster", ee(u, "id") || "true"); } @@ -2851,7 +2859,7 @@ var htmx = (function () { path: n, triggeringEvent: o, }; - if (!he(r, "htmx:configRequest", C)) { + if (!de(r, "htmx:configRequest", C)) { oe(s); m(); return e; @@ -2863,45 +2871,45 @@ var htmx = (function () { b = C.errors; E = C.useUrlParams; if (b && b.length > 0) { - he(r, "htmx:validation:halted", C); + de(r, "htmx:validation:halted", C); oe(s); m(); return e; } const $ = n.split("#"); const z = $[0]; - const R = $[1]; - let O = n; + const O = $[1]; + let R = n; if (E) { - O = z; + R = z; const Y = !v.keys().next().done; if (Y) { - if (O.indexOf("?") < 0) { - O += "?"; + if (R.indexOf("?") < 0) { + R += "?"; } else { - O += "&"; + R += "&"; } - O += an(v); - if (R) { - O += "#" + R; + R += fn(v); + if (O) { + R += "#" + O; } } } - if (!qn(r, O, C)) { - ae(r, "htmx:invalidPath", C); + if (!qn(r, R, C)) { + fe(r, "htmx:invalidPath", C); oe(l); return e; } - p.open(t.toUpperCase(), O, true); + p.open(t.toUpperCase(), R, true); p.overrideMimeType("text/html"); p.withCredentials = C.withCredentials; p.timeout = C.timeout; if (S.noHeaders) { } else { - for (const D in x) { - if (x.hasOwnProperty(D)) { - const W = x[D]; - Rn(p, D, W); + for (const k in x) { + if (x.hasOwnProperty(k)) { + const W = x[k]; + On(p, k, W); } } } @@ -2914,19 +2922,21 @@ var htmx = (function () { select: X, pathInfo: { requestPath: n, - finalRequestPath: O, + finalRequestPath: R, responsePath: null, - anchor: R, + anchor: O, }, }; p.onload = function () { try { const t = Tn(r); - H.pathInfo.responsePath = On(p); + H.pathInfo.responsePath = Rn(p); M(r, H); - en(T, q); - he(r, "htmx:afterRequest", H); - he(r, "htmx:afterOnLoad", H); + if (H.keepIndicators !== true) { + en(T, q); + } + de(r, "htmx:afterRequest", H); + de(r, "htmx:afterOnLoad", H); if (!le(r)) { let e = null; while (t.length > 0 && e == null) { @@ -2936,39 +2946,39 @@ var htmx = (function () { } } if (e) { - he(e, "htmx:afterRequest", H); - he(e, "htmx:afterOnLoad", H); + de(e, "htmx:afterRequest", H); + de(e, "htmx:afterOnLoad", H); } } oe(s); m(); } catch (e) { - ae(r, "htmx:onLoadError", ue({ error: e }, H)); + fe(r, "htmx:onLoadError", ue({ error: e }, H)); throw e; } }; p.onerror = function () { en(T, q); - ae(r, "htmx:afterRequest", H); - ae(r, "htmx:sendError", H); + fe(r, "htmx:afterRequest", H); + fe(r, "htmx:sendError", H); oe(l); m(); }; p.onabort = function () { en(T, q); - ae(r, "htmx:afterRequest", H); - ae(r, "htmx:sendAbort", H); + fe(r, "htmx:afterRequest", H); + fe(r, "htmx:sendAbort", H); oe(l); m(); }; p.ontimeout = function () { en(T, q); - ae(r, "htmx:afterRequest", H); - ae(r, "htmx:timeout", H); + fe(r, "htmx:afterRequest", H); + fe(r, "htmx:timeout", H); oe(l); m(); }; - if (!he(r, "htmx:beforeRequest", H)) { + if (!de(r, "htmx:beforeRequest", H)) { oe(s); m(); return e; @@ -2978,7 +2988,7 @@ var htmx = (function () { se(["loadstart", "loadend", "progress", "abort"], function (t) { se([p, p.upload], function (e) { e.addEventListener(t, function (e) { - he(r, "htmx:xhr:" + t, { + de(r, "htmx:xhr:" + t, { lengthComputable: e.lengthComputable, loaded: e.loaded, total: e.total, @@ -2986,7 +2996,7 @@ var htmx = (function () { }); }); }); - he(r, "htmx:beforeSend", H); + de(r, "htmx:beforeSend", H); const J = E ? null : yn(p, r, v); p.send(J); return e; @@ -3017,29 +3027,29 @@ var htmx = (function () { const l = re(e, "hx-push-url"); const u = re(e, "hx-replace-url"); const c = ie(e).boosted; - let f = null; let a = null; + let f = null; if (l) { - f = "push"; - a = l; + a = "push"; + f = l; } else if (u) { - f = "replace"; - a = u; + a = "replace"; + f = u; } else if (c) { - f = "push"; - a = s || i; + a = "push"; + f = s || i; } - if (a) { - if (a === "false") { + if (f) { + if (f === "false") { return {}; } - if (a === "true") { - a = s || i; + if (f === "true") { + f = s || i; } - if (t.pathInfo.anchor && a.indexOf("#") === -1) { - a = a + "#" + t.pathInfo.anchor; + if (t.pathInfo.anchor && f.indexOf("#") === -1) { + f = f + "#" + t.pathInfo.anchor; } - return { type: f, path: a }; + return { type: a, path: f }; } else { return {}; } @@ -3048,7 +3058,7 @@ var htmx = (function () { var n = new RegExp(e.code); return n.test(t.toString(10)); } - function Dn(e) { + function kn(e) { for (var t = 0; t < Q.config.responseHandling.length; t++) { var n = Q.config.responseHandling[t]; if (Pn(n, e.status)) { @@ -3057,7 +3067,7 @@ var htmx = (function () { } return { swap: false }; } - function kn(e) { + function Dn(e) { if (e) { const t = r("title"); if (t) { @@ -3072,7 +3082,7 @@ var htmx = (function () { let l = i.target; const e = i.etc; const u = i.select; - if (!he(o, "htmx:beforeOnLoad", i)) return; + if (!de(o, "htmx:beforeOnLoad", i)) return; if (C(s, /HX-Trigger:/i)) { Je(s, "HX-Trigger", o); } @@ -3093,11 +3103,13 @@ var htmx = (function () { const n = C(s, /HX-Refresh:/i) && s.getResponseHeader("HX-Refresh") === "true"; if (C(s, /HX-Redirect:/i)) { + i.keepIndicators = true; location.href = s.getResponseHeader("HX-Redirect"); n && location.reload(); return; } if (n) { + i.keepIndicators = true; location.reload(); return; } @@ -3105,17 +3117,17 @@ var htmx = (function () { if (s.getResponseHeader("HX-Retarget") === "this") { i.target = o; } else { - i.target = ce(fe(o, s.getResponseHeader("HX-Retarget"))); + i.target = ce(ae(o, s.getResponseHeader("HX-Retarget"))); } } const c = In(o, i); - const r = Dn(s); - const f = r.swap; - let a = !!r.error; - let h = Q.config.ignoreTitle || r.ignoreTitle; - let d = r.select; + const r = kn(s); + const a = r.swap; + let f = !!r.error; + let d = Q.config.ignoreTitle || r.ignoreTitle; + let h = r.select; if (r.target) { - i.target = ce(fe(o, r.target)); + i.target = ce(ae(o, r.target)); } var g = e.swapOverride; if (g == null && r.swapOverride) { @@ -3125,7 +3137,7 @@ var htmx = (function () { if (s.getResponseHeader("HX-Retarget") === "this") { i.target = o; } else { - i.target = ce(fe(o, s.getResponseHeader("HX-Retarget"))); + i.target = ce(ae(o, s.getResponseHeader("HX-Retarget"))); } } if (C(s, /HX-Reswap:/i)) { @@ -3134,29 +3146,29 @@ var htmx = (function () { var p = s.response; var m = ue( { - shouldSwap: f, + shouldSwap: a, serverResponse: p, - isError: a, - ignoreTitle: h, - selectOverride: d, + isError: f, + ignoreTitle: d, + selectOverride: h, }, i, ); - if (r.event && !he(l, r.event, m)) return; - if (!he(l, "htmx:beforeSwap", m)) return; + if (r.event && !de(l, r.event, m)) return; + if (!de(l, "htmx:beforeSwap", m)) return; l = m.target; p = m.serverResponse; - a = m.isError; - h = m.ignoreTitle; - d = m.selectOverride; + f = m.isError; + d = m.ignoreTitle; + h = m.selectOverride; i.target = l; - i.failed = a; - i.successful = !a; + i.failed = f; + i.successful = !f; if (m.shouldSwap) { if (s.status === 286) { ut(o); } - Ut(o, function (e) { + Bt(o, function (e) { p = e.transformResponse(p, s, o); }); if (c.type) { @@ -3167,33 +3179,33 @@ var htmx = (function () { } var y = pn(o, g); if (!y.hasOwnProperty("ignoreTitle")) { - y.ignoreTitle = h; + y.ignoreTitle = d; } l.classList.add(Q.config.swappingClass); let n = null; let r = null; if (u) { - d = u; + h = u; } if (C(s, /HX-Reselect:/i)) { - d = s.getResponseHeader("HX-Reselect"); + h = s.getResponseHeader("HX-Reselect"); } const x = re(o, "hx-select-oob"); const b = re(o, "hx-select"); let e = function () { try { if (c.type) { - he(ne().body, "htmx:beforeHistoryUpdate", ue({ history: c }, i)); + de(ne().body, "htmx:beforeHistoryUpdate", ue({ history: c }, i)); if (c.type === "push") { Jt(c.path); - he(ne().body, "htmx:pushedIntoHistory", { path: c.path }); + de(ne().body, "htmx:pushedIntoHistory", { path: c.path }); } else { Kt(c.path); - he(ne().body, "htmx:replacedInHistory", { path: c.path }); + de(ne().body, "htmx:replacedInHistory", { path: c.path }); } } ze(l, p, y, { - select: d || b, + select: h || b, selectOOB: x, eventInfo: i, anchor: i.pathInfo.anchor, @@ -3219,7 +3231,7 @@ var htmx = (function () { }, }); } catch (e) { - ae(o, "htmx:swapError", i); + fe(o, "htmx:swapError", i); oe(r); throw e; } @@ -3230,7 +3242,7 @@ var htmx = (function () { } if ( t && - he(o, "htmx:beforeTransition", i) && + de(o, "htmx:beforeTransition", i) && typeof Promise !== "undefined" && document.startViewTransition ) { @@ -3252,8 +3264,8 @@ var htmx = (function () { e(); } } - if (a) { - ae( + if (f) { + fe( o, "htmx:responseError", ue( @@ -3295,13 +3307,13 @@ var htmx = (function () { }, }; } - function Un(e, t) { + function Bn(e, t) { if (t.init) { t.init(n); } Xn[e] = ue(Fn(), t); } - function Bn(e) { + function Un(e) { delete Xn[e]; } function jn(e, n, r) { @@ -3384,7 +3396,7 @@ var htmx = (function () { Jn(); $n(); let e = ne().body; - kt(e); + Dt(e); const t = ne().querySelectorAll( "[hx-trigger='restored'],[data-hx-trigger='restored']", ); @@ -3400,7 +3412,7 @@ var htmx = (function () { if (e.state && e.state.htmx) { Yt(); se(t, function (e) { - he(e, "htmx:restored", { document: ne(), triggerEvent: he }); + de(e, "htmx:restored", { document: ne(), triggerEvent: de }); }); } else { if (n) { @@ -3409,7 +3421,7 @@ var htmx = (function () { } }; E().setTimeout(function () { - he(e, "htmx:load", {}); + de(e, "htmx:load", {}); e = null; }, 0); });