@skillbill/vuelace-3
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/@skillbill%2Fvuelace-3)
1,471 lines (1,452 loc) • 1.32 MB
JavaScript
import { defineComponent as Pe, openBlock as m, createElementBlock as w, renderSlot as A, mergeModels as me, useModel as Ue, ref as oe, computed as ze, watch as Fe, createElementVNode as E, normalizeClass as j, toDisplayString as z, createCommentVNode as M, createBlock as P, withCtx as K, createTextVNode as ae, withModifiers as Ie, withDirectives as be, vShow as an, unref as re, createVNode as ie, readonly as Du, getCurrentInstance as Ru, onMounted as Ei, nextTick as Ns, mergeProps as y, Teleport as Bu, resolveComponent as X, Fragment as G, renderList as de, resolveDirective as St, resolveDynamicComponent as Y, Transition as Pr, createSlots as ci, toHandlers as er, normalizeProps as Lt, guardReactiveProps as Xt, withKeys as ue, pushScopeId as Ks, popScopeId as Us, normalizeStyle as sa, vModelText as zu, reactive as Gs, toRaw as la } from "vue";
var Ws = Object.defineProperty, Fu = Object.defineProperties, Vu = Object.getOwnPropertyDescriptor, Hu = Object.getOwnPropertyDescriptors, ua = Object.getOwnPropertySymbols, ju = Object.prototype.hasOwnProperty, Nu = Object.prototype.propertyIsEnumerable, zr = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), da = (t, e, i) => e in t ? Ws(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Nt = (t, e) => {
for (var i in e || (e = {}))
ju.call(e, i) && da(t, i, e[i]);
if (ua)
for (var i of ua(e))
Nu.call(e, i) && da(t, i, e[i]);
return t;
}, Vn = (t, e) => Fu(t, Hu(e)), c = (t, e, i, n) => {
for (var o = n > 1 ? void 0 : n ? Vu(e, i) : e, r = t.length - 1, a; r >= 0; r--)
(a = t[r]) && (o = (n ? a(e, i, o) : a(o)) || o);
return n && o && Ws(e, i, o), o;
}, qs = (t, e, i) => {
if (!e.has(t))
throw TypeError("Cannot " + i);
}, Ku = (t, e, i) => (qs(t, e, "read from private field"), e.get(t)), Uu = (t, e, i) => {
if (e.has(t))
throw TypeError("Cannot add the same private member more than once");
e instanceof WeakSet ? e.add(t) : e.set(t, i);
}, Gu = (t, e, i, n) => (qs(t, e, "write to private field"), e.set(t, i), i), Wu = function(t, e) {
this[0] = t, this[1] = e;
}, qu = (t) => {
var e = t[zr("asyncIterator")], i = !1, n, o = {};
return e == null ? (e = t[zr("iterator")](), n = (r) => o[r] = (a) => e[r](a)) : (e = e.call(t), n = (r) => o[r] = (a) => {
if (i) {
if (i = !1, r === "throw")
throw a;
return a;
}
return i = !0, {
done: !1,
value: new Wu(new Promise((l) => {
var u = e[r](a);
if (!(u instanceof Object))
throw TypeError("Object expected");
l(u);
}), 1)
};
}), o[zr("iterator")] = () => o, n("next"), "throw" in e ? n("throw") : o.throw = (r) => {
throw r;
}, "return" in e && n("return"), o;
}, Fi = /* @__PURE__ */ new WeakMap(), Vi = /* @__PURE__ */ new WeakMap(), Hi = /* @__PURE__ */ new WeakMap(), Fr = /* @__PURE__ */ new WeakSet(), tr = /* @__PURE__ */ new WeakMap(), Kt = class {
constructor(t, e) {
this.handleFormData = (i) => {
const n = this.options.disabled(this.host), o = this.options.name(this.host), r = this.options.value(this.host), a = this.host.tagName.toLowerCase() === "sl-button";
this.host.isConnected && !n && !a && typeof o == "string" && o.length > 0 && typeof r < "u" && (Array.isArray(r) ? r.forEach((l) => {
i.formData.append(o, l.toString());
}) : i.formData.append(o, r.toString()));
}, this.handleFormSubmit = (i) => {
var n;
const o = this.options.disabled(this.host), r = this.options.reportValidity;
this.form && !this.form.noValidate && ((n = Fi.get(this.form)) == null || n.forEach((a) => {
this.setUserInteracted(a, !0);
})), this.form && !this.form.noValidate && !o && !r(this.host) && (i.preventDefault(), i.stopImmediatePropagation());
}, this.handleFormReset = () => {
this.options.setValue(this.host, this.options.defaultValue(this.host)), this.setUserInteracted(this.host, !1), tr.set(this.host, []);
}, this.handleInteraction = (i) => {
const n = tr.get(this.host);
n.includes(i.type) || n.push(i.type), n.length === this.options.assumeInteractionOn.length && this.setUserInteracted(this.host, !0);
}, this.checkFormValidity = () => {
if (this.form && !this.form.noValidate) {
const i = this.form.querySelectorAll("*");
for (const n of i)
if (typeof n.checkValidity == "function" && !n.checkValidity())
return !1;
}
return !0;
}, this.reportFormValidity = () => {
if (this.form && !this.form.noValidate) {
const i = this.form.querySelectorAll("*");
for (const n of i)
if (typeof n.reportValidity == "function" && !n.reportValidity())
return !1;
}
return !0;
}, (this.host = t).addController(this), this.options = Nt({
form: (i) => {
const n = i.form;
if (n) {
const r = i.getRootNode().querySelector(`#${n}`);
if (r)
return r;
}
return i.closest("form");
},
name: (i) => i.name,
value: (i) => i.value,
defaultValue: (i) => i.defaultValue,
disabled: (i) => {
var n;
return (n = i.disabled) != null ? n : !1;
},
reportValidity: (i) => typeof i.reportValidity == "function" ? i.reportValidity() : !0,
checkValidity: (i) => typeof i.checkValidity == "function" ? i.checkValidity() : !0,
setValue: (i, n) => i.value = n,
assumeInteractionOn: ["sl-input"]
}, e);
}
hostConnected() {
const t = this.options.form(this.host);
t && this.attachForm(t), tr.set(this.host, []), this.options.assumeInteractionOn.forEach((e) => {
this.host.addEventListener(e, this.handleInteraction);
});
}
hostDisconnected() {
this.detachForm(), tr.delete(this.host), this.options.assumeInteractionOn.forEach((t) => {
this.host.removeEventListener(t, this.handleInteraction);
});
}
hostUpdated() {
const t = this.options.form(this.host);
t || this.detachForm(), t && this.form !== t && (this.detachForm(), this.attachForm(t)), this.host.hasUpdated && this.setValidity(this.host.validity.valid);
}
attachForm(t) {
t ? (this.form = t, Fi.has(this.form) ? Fi.get(this.form).add(this.host) : Fi.set(this.form, /* @__PURE__ */ new Set([this.host])), this.form.addEventListener("formdata", this.handleFormData), this.form.addEventListener("submit", this.handleFormSubmit), this.form.addEventListener("reset", this.handleFormReset), Vi.has(this.form) || (Vi.set(this.form, this.form.reportValidity), this.form.reportValidity = () => this.reportFormValidity()), Hi.has(this.form) || (Hi.set(this.form, this.form.checkValidity), this.form.checkValidity = () => this.checkFormValidity())) : this.form = void 0;
}
detachForm() {
if (!this.form)
return;
const t = Fi.get(this.form);
t && (t.delete(this.host), t.size <= 0 && (this.form.removeEventListener("formdata", this.handleFormData), this.form.removeEventListener("submit", this.handleFormSubmit), this.form.removeEventListener("reset", this.handleFormReset), Vi.has(this.form) && (this.form.reportValidity = Vi.get(this.form), Vi.delete(this.form)), Hi.has(this.form) && (this.form.checkValidity = Hi.get(this.form), Hi.delete(this.form)), this.form = void 0));
}
setUserInteracted(t, e) {
e ? Fr.add(t) : Fr.delete(t), t.requestUpdate();
}
doAction(t, e) {
if (this.form) {
const i = document.createElement("button");
i.type = t, i.style.position = "absolute", i.style.width = "0", i.style.height = "0", i.style.clipPath = "inset(50%)", i.style.overflow = "hidden", i.style.whiteSpace = "nowrap", e && (i.name = e.name, i.value = e.value, ["formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"].forEach((n) => {
e.hasAttribute(n) && i.setAttribute(n, e.getAttribute(n));
})), this.form.append(i), i.click(), i.remove();
}
}
/** Returns the associated `<form>` element, if one exists. */
getForm() {
var t;
return (t = this.form) != null ? t : null;
}
/** Resets the form, restoring all the control to their default value */
reset(t) {
this.doAction("reset", t);
}
/** Submits the form, triggering validation and form data injection. */
submit(t) {
this.doAction("submit", t);
}
/**
* Synchronously sets the form control's validity. Call this when you know the future validity but need to update
* the host element immediately, i.e. before Lit updates the component in the next update.
*/
setValidity(t) {
const e = this.host, i = !!Fr.has(e), n = !!e.required;
e.toggleAttribute("data-required", n), e.toggleAttribute("data-optional", !n), e.toggleAttribute("data-invalid", !t), e.toggleAttribute("data-valid", t), e.toggleAttribute("data-user-invalid", !t && i), e.toggleAttribute("data-user-valid", t && i);
}
/**
* Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
* that affects constraint validation changes so the component receives the correct validity states.
*/
updateValidity() {
const t = this.host;
this.setValidity(t.validity.valid);
}
/**
* Dispatches a non-bubbling, cancelable custom event of type `sl-invalid`.
* If the `sl-invalid` event will be cancelled then the original `invalid`
* event (which may have been passed as argument) will also be cancelled.
* If no original `invalid` event has been passed then the `sl-invalid`
* event will be cancelled before being dispatched.
*/
emitInvalidEvent(t) {
const e = new CustomEvent("sl-invalid", {
bubbles: !1,
composed: !1,
cancelable: !0,
detail: {}
});
t || e.preventDefault(), this.host.dispatchEvent(e) || t == null || t.preventDefault();
}
}, _r = Object.freeze({
badInput: !1,
customError: !1,
patternMismatch: !1,
rangeOverflow: !1,
rangeUnderflow: !1,
stepMismatch: !1,
tooLong: !1,
tooShort: !1,
typeMismatch: !1,
valid: !0,
valueMissing: !1
}), Yu = Object.freeze(Vn(Nt({}, _r), {
valid: !1,
valueMissing: !0
})), Zu = Object.freeze(Vn(Nt({}, _r), {
valid: !1,
customError: !0
}));
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const hr = globalThis, Fo = hr.ShadowRoot && (hr.ShadyCSS === void 0 || hr.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Vo = Symbol(), ca = /* @__PURE__ */ new WeakMap();
let Ys = class {
constructor(e, i, n) {
if (this._$cssResult$ = !0, n !== Vo) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = e, this.t = i;
}
get styleSheet() {
let e = this.o;
const i = this.t;
if (Fo && e === void 0) {
const n = i !== void 0 && i.length === 1;
n && (e = ca.get(i)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), n && ca.set(i, e));
}
return e;
}
toString() {
return this.cssText;
}
};
const Xu = (t) => new Ys(typeof t == "string" ? t : t + "", void 0, Vo), J = (t, ...e) => {
const i = t.length === 1 ? t[0] : e.reduce((n, o, r) => n + ((a) => {
if (a._$cssResult$ === !0) return a.cssText;
if (typeof a == "number") return a;
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
})(o) + t[r + 1], t[0]);
return new Ys(i, t, Vo);
}, Ju = (t, e) => {
if (Fo) t.adoptedStyleSheets = e.map((i) => i instanceof CSSStyleSheet ? i : i.styleSheet);
else for (const i of e) {
const n = document.createElement("style"), o = hr.litNonce;
o !== void 0 && n.setAttribute("nonce", o), n.textContent = i.cssText, t.appendChild(n);
}
}, ha = Fo ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
let i = "";
for (const n of e.cssRules) i += n.cssText;
return Xu(i);
})(t) : t;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const { is: Qu, defineProperty: ed, getOwnPropertyDescriptor: td, getOwnPropertyNames: id, getOwnPropertySymbols: nd, getPrototypeOf: rd } = Object, Jt = globalThis, pa = Jt.trustedTypes, od = pa ? pa.emptyScript : "", Vr = Jt.reactiveElementPolyfillSupport, qi = (t, e) => t, Oi = { toAttribute(t, e) {
switch (e) {
case Boolean:
t = t ? od : null;
break;
case Object:
case Array:
t = t == null ? t : JSON.stringify(t);
}
return t;
}, fromAttribute(t, e) {
let i = t;
switch (e) {
case Boolean:
i = t !== null;
break;
case Number:
i = t === null ? null : Number(t);
break;
case Object:
case Array:
try {
i = JSON.parse(t);
} catch {
i = null;
}
}
return i;
} }, Ho = (t, e) => !Qu(t, e), fa = { attribute: !0, type: String, converter: Oi, reflect: !1, hasChanged: Ho };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), Jt.litPropertyMetadata ?? (Jt.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
class ki extends HTMLElement {
static addInitializer(e) {
this._$Ei(), (this.l ?? (this.l = [])).push(e);
}
static get observedAttributes() {
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
}
static createProperty(e, i = fa) {
if (i.state && (i.attribute = !1), this._$Ei(), this.elementProperties.set(e, i), !i.noAccessor) {
const n = Symbol(), o = this.getPropertyDescriptor(e, n, i);
o !== void 0 && ed(this.prototype, e, o);
}
}
static getPropertyDescriptor(e, i, n) {
const { get: o, set: r } = td(this.prototype, e) ?? { get() {
return this[i];
}, set(a) {
this[i] = a;
} };
return { get() {
return o == null ? void 0 : o.call(this);
}, set(a) {
const l = o == null ? void 0 : o.call(this);
r.call(this, a), this.requestUpdate(e, l, n);
}, configurable: !0, enumerable: !0 };
}
static getPropertyOptions(e) {
return this.elementProperties.get(e) ?? fa;
}
static _$Ei() {
if (this.hasOwnProperty(qi("elementProperties"))) return;
const e = rd(this);
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
}
static finalize() {
if (this.hasOwnProperty(qi("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(qi("properties"))) {
const i = this.properties, n = [...id(i), ...nd(i)];
for (const o of n) this.createProperty(o, i[o]);
}
const e = this[Symbol.metadata];
if (e !== null) {
const i = litPropertyMetadata.get(e);
if (i !== void 0) for (const [n, o] of i) this.elementProperties.set(n, o);
}
this._$Eh = /* @__PURE__ */ new Map();
for (const [i, n] of this.elementProperties) {
const o = this._$Eu(i, n);
o !== void 0 && this._$Eh.set(o, i);
}
this.elementStyles = this.finalizeStyles(this.styles);
}
static finalizeStyles(e) {
const i = [];
if (Array.isArray(e)) {
const n = new Set(e.flat(1 / 0).reverse());
for (const o of n) i.unshift(ha(o));
} else e !== void 0 && i.push(ha(e));
return i;
}
static _$Eu(e, i) {
const n = i.attribute;
return n === !1 ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0;
}
constructor() {
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
}
_$Ev() {
var e;
this._$ES = new Promise((i) => this.enableUpdating = i), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((i) => i(this));
}
addController(e) {
var i;
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((i = e.hostConnected) == null || i.call(e));
}
removeController(e) {
var i;
(i = this._$EO) == null || i.delete(e);
}
_$E_() {
const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
for (const n of i.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]);
e.size > 0 && (this._$Ep = e);
}
createRenderRoot() {
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return Ju(e, this.constructor.elementStyles), e;
}
connectedCallback() {
var e;
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((i) => {
var n;
return (n = i.hostConnected) == null ? void 0 : n.call(i);
});
}
enableUpdating(e) {
}
disconnectedCallback() {
var e;
(e = this._$EO) == null || e.forEach((i) => {
var n;
return (n = i.hostDisconnected) == null ? void 0 : n.call(i);
});
}
attributeChangedCallback(e, i, n) {
this._$AK(e, n);
}
_$EC(e, i) {
var r;
const n = this.constructor.elementProperties.get(e), o = this.constructor._$Eu(e, n);
if (o !== void 0 && n.reflect === !0) {
const a = (((r = n.converter) == null ? void 0 : r.toAttribute) !== void 0 ? n.converter : Oi).toAttribute(i, n.type);
this._$Em = e, a == null ? this.removeAttribute(o) : this.setAttribute(o, a), this._$Em = null;
}
}
_$AK(e, i) {
var r;
const n = this.constructor, o = n._$Eh.get(e);
if (o !== void 0 && this._$Em !== o) {
const a = n.getPropertyOptions(o), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter : Oi;
this._$Em = o, this[o] = l.fromAttribute(i, a.type), this._$Em = null;
}
}
requestUpdate(e, i, n) {
if (e !== void 0) {
if (n ?? (n = this.constructor.getPropertyOptions(e)), !(n.hasChanged ?? Ho)(this[e], i)) return;
this.P(e, i, n);
}
this.isUpdatePending === !1 && (this._$ES = this._$ET());
}
P(e, i, n) {
this._$AL.has(e) || this._$AL.set(e, i), n.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(e);
}
async _$ET() {
this.isUpdatePending = !0;
try {
await this._$ES;
} catch (i) {
Promise.reject(i);
}
const e = this.scheduleUpdate();
return e != null && await e, !this.isUpdatePending;
}
scheduleUpdate() {
return this.performUpdate();
}
performUpdate() {
var n;
if (!this.isUpdatePending) return;
if (!this.hasUpdated) {
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
for (const [r, a] of this._$Ep) this[r] = a;
this._$Ep = void 0;
}
const o = this.constructor.elementProperties;
if (o.size > 0) for (const [r, a] of o) a.wrapped !== !0 || this._$AL.has(r) || this[r] === void 0 || this.P(r, this[r], a);
}
let e = !1;
const i = this._$AL;
try {
e = this.shouldUpdate(i), e ? (this.willUpdate(i), (n = this._$EO) == null || n.forEach((o) => {
var r;
return (r = o.hostUpdate) == null ? void 0 : r.call(o);
}), this.update(i)) : this._$EU();
} catch (o) {
throw e = !1, this._$EU(), o;
}
e && this._$AE(i);
}
willUpdate(e) {
}
_$AE(e) {
var i;
(i = this._$EO) == null || i.forEach((n) => {
var o;
return (o = n.hostUpdated) == null ? void 0 : o.call(n);
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
}
_$EU() {
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
}
get updateComplete() {
return this.getUpdateComplete();
}
getUpdateComplete() {
return this._$ES;
}
shouldUpdate(e) {
return !0;
}
update(e) {
this._$Ej && (this._$Ej = this._$Ej.forEach((i) => this._$EC(i, this[i]))), this._$EU();
}
updated(e) {
}
firstUpdated(e) {
}
}
ki.elementStyles = [], ki.shadowRootOptions = { mode: "open" }, ki[qi("elementProperties")] = /* @__PURE__ */ new Map(), ki[qi("finalized")] = /* @__PURE__ */ new Map(), Vr == null || Vr({ ReactiveElement: ki }), (Jt.reactiveElementVersions ?? (Jt.reactiveElementVersions = [])).push("2.0.4");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Yi = globalThis, br = Yi.trustedTypes, ma = br ? br.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Zs = "$lit$", Yt = `lit$${Math.random().toFixed(9).slice(2)}$`, Xs = "?" + Yt, ad = `<${Xs}>`, hi = document, sn = () => hi.createComment(""), ln = (t) => t === null || typeof t != "object" && typeof t != "function", Js = Array.isArray, sd = (t) => Js(t) || typeof (t == null ? void 0 : t[Symbol.iterator]) == "function", Hr = `[
\f\r]`, ji = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ga = /-->/g, ba = />/g, oi = RegExp(`>|${Hr}(?:([^\\s"'>=/]+)(${Hr}*=${Hr}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), va = /'/g, ya = /"/g, Qs = /^(?:script|style|textarea|title)$/i, ld = (t) => (e, ...i) => ({ _$litType$: t, strings: e, values: i }), D = ld(1), dt = Symbol.for("lit-noChange"), Te = Symbol.for("lit-nothing"), wa = /* @__PURE__ */ new WeakMap(), ui = hi.createTreeWalker(hi, 129);
function el(t, e) {
if (!Array.isArray(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
return ma !== void 0 ? ma.createHTML(e) : e;
}
const ud = (t, e) => {
const i = t.length - 1, n = [];
let o, r = e === 2 ? "<svg>" : "", a = ji;
for (let l = 0; l < i; l++) {
const u = t[l];
let s, f, d = -1, p = 0;
for (; p < u.length && (a.lastIndex = p, f = a.exec(u), f !== null); ) p = a.lastIndex, a === ji ? f[1] === "!--" ? a = ga : f[1] !== void 0 ? a = ba : f[2] !== void 0 ? (Qs.test(f[2]) && (o = RegExp("</" + f[2], "g")), a = oi) : f[3] !== void 0 && (a = oi) : a === oi ? f[0] === ">" ? (a = o ?? ji, d = -1) : f[1] === void 0 ? d = -2 : (d = a.lastIndex - f[2].length, s = f[1], a = f[3] === void 0 ? oi : f[3] === '"' ? ya : va) : a === ya || a === va ? a = oi : a === ga || a === ba ? a = ji : (a = oi, o = void 0);
const h = a === oi && t[l + 1].startsWith("/>") ? " " : "";
r += a === ji ? u + ad : d >= 0 ? (n.push(s), u.slice(0, d) + Zs + u.slice(d) + Yt + h) : u + Yt + (d === -2 ? l : h);
}
return [el(t, r + (t[i] || "<?>") + (e === 2 ? "</svg>" : "")), n];
};
class un {
constructor({ strings: e, _$litType$: i }, n) {
let o;
this.parts = [];
let r = 0, a = 0;
const l = e.length - 1, u = this.parts, [s, f] = ud(e, i);
if (this.el = un.createElement(s, n), ui.currentNode = this.el.content, i === 2) {
const d = this.el.content.firstChild;
d.replaceWith(...d.childNodes);
}
for (; (o = ui.nextNode()) !== null && u.length < l; ) {
if (o.nodeType === 1) {
if (o.hasAttributes()) for (const d of o.getAttributeNames()) if (d.endsWith(Zs)) {
const p = f[a++], h = o.getAttribute(d).split(Yt), g = /([.?@])?(.*)/.exec(p);
u.push({ type: 1, index: r, name: g[2], strings: h, ctor: g[1] === "." ? cd : g[1] === "?" ? hd : g[1] === "@" ? pd : Tr }), o.removeAttribute(d);
} else d.startsWith(Yt) && (u.push({ type: 6, index: r }), o.removeAttribute(d));
if (Qs.test(o.tagName)) {
const d = o.textContent.split(Yt), p = d.length - 1;
if (p > 0) {
o.textContent = br ? br.emptyScript : "";
for (let h = 0; h < p; h++) o.append(d[h], sn()), ui.nextNode(), u.push({ type: 2, index: ++r });
o.append(d[p], sn());
}
}
} else if (o.nodeType === 8) if (o.data === Xs) u.push({ type: 2, index: r });
else {
let d = -1;
for (; (d = o.data.indexOf(Yt, d + 1)) !== -1; ) u.push({ type: 7, index: r }), d += Yt.length - 1;
}
r++;
}
}
static createElement(e, i) {
const n = hi.createElement("template");
return n.innerHTML = e, n;
}
}
function Pi(t, e, i = t, n) {
var a, l;
if (e === dt) return e;
let o = n !== void 0 ? (a = i._$Co) == null ? void 0 : a[n] : i._$Cl;
const r = ln(e) ? void 0 : e._$litDirective$;
return (o == null ? void 0 : o.constructor) !== r && ((l = o == null ? void 0 : o._$AO) == null || l.call(o, !1), r === void 0 ? o = void 0 : (o = new r(t), o._$AT(t, i, n)), n !== void 0 ? (i._$Co ?? (i._$Co = []))[n] = o : i._$Cl = o), o !== void 0 && (e = Pi(t, o._$AS(t, e.values), o, n)), e;
}
class dd {
constructor(e, i) {
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
}
get parentNode() {
return this._$AM.parentNode;
}
get _$AU() {
return this._$AM._$AU;
}
u(e) {
const { el: { content: i }, parts: n } = this._$AD, o = ((e == null ? void 0 : e.creationScope) ?? hi).importNode(i, !0);
ui.currentNode = o;
let r = ui.nextNode(), a = 0, l = 0, u = n[0];
for (; u !== void 0; ) {
if (a === u.index) {
let s;
u.type === 2 ? s = new Hn(r, r.nextSibling, this, e) : u.type === 1 ? s = new u.ctor(r, u.name, u.strings, this, e) : u.type === 6 && (s = new fd(r, this, e)), this._$AV.push(s), u = n[++l];
}
a !== (u == null ? void 0 : u.index) && (r = ui.nextNode(), a++);
}
return ui.currentNode = hi, o;
}
p(e) {
let i = 0;
for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, i), i += n.strings.length - 2) : n._$AI(e[i])), i++;
}
}
class Hn {
get _$AU() {
var e;
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
}
constructor(e, i, n, o) {
this.type = 2, this._$AH = Te, this._$AN = void 0, this._$AA = e, this._$AB = i, this._$AM = n, this.options = o, this._$Cv = (o == null ? void 0 : o.isConnected) ?? !0;
}
get parentNode() {
let e = this._$AA.parentNode;
const i = this._$AM;
return i !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = i.parentNode), e;
}
get startNode() {
return this._$AA;
}
get endNode() {
return this._$AB;
}
_$AI(e, i = this) {
e = Pi(this, e, i), ln(e) ? e === Te || e == null || e === "" ? (this._$AH !== Te && this._$AR(), this._$AH = Te) : e !== this._$AH && e !== dt && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : sd(e) ? this.k(e) : this._(e);
}
S(e) {
return this._$AA.parentNode.insertBefore(e, this._$AB);
}
T(e) {
this._$AH !== e && (this._$AR(), this._$AH = this.S(e));
}
_(e) {
this._$AH !== Te && ln(this._$AH) ? this._$AA.nextSibling.data = e : this.T(hi.createTextNode(e)), this._$AH = e;
}
$(e) {
var r;
const { values: i, _$litType$: n } = e, o = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = un.createElement(el(n.h, n.h[0]), this.options)), n);
if (((r = this._$AH) == null ? void 0 : r._$AD) === o) this._$AH.p(i);
else {
const a = new dd(o, this), l = a.u(this.options);
a.p(i), this.T(l), this._$AH = a;
}
}
_$AC(e) {
let i = wa.get(e.strings);
return i === void 0 && wa.set(e.strings, i = new un(e)), i;
}
k(e) {
Js(this._$AH) || (this._$AH = [], this._$AR());
const i = this._$AH;
let n, o = 0;
for (const r of e) o === i.length ? i.push(n = new Hn(this.S(sn()), this.S(sn()), this, this.options)) : n = i[o], n._$AI(r), o++;
o < i.length && (this._$AR(n && n._$AB.nextSibling, o), i.length = o);
}
_$AR(e = this._$AA.nextSibling, i) {
var n;
for ((n = this._$AP) == null ? void 0 : n.call(this, !1, !0, i); e && e !== this._$AB; ) {
const o = e.nextSibling;
e.remove(), e = o;
}
}
setConnected(e) {
var i;
this._$AM === void 0 && (this._$Cv = e, (i = this._$AP) == null || i.call(this, e));
}
}
class Tr {
get tagName() {
return this.element.tagName;
}
get _$AU() {
return this._$AM._$AU;
}
constructor(e, i, n, o, r) {
this.type = 1, this._$AH = Te, this._$AN = void 0, this.element = e, this.name = i, this._$AM = o, this.options = r, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = Te;
}
_$AI(e, i = this, n, o) {
const r = this.strings;
let a = !1;
if (r === void 0) e = Pi(this, e, i, 0), a = !ln(e) || e !== this._$AH && e !== dt, a && (this._$AH = e);
else {
const l = e;
let u, s;
for (e = r[0], u = 0; u < r.length - 1; u++) s = Pi(this, l[n + u], i, u), s === dt && (s = this._$AH[u]), a || (a = !ln(s) || s !== this._$AH[u]), s === Te ? e = Te : e !== Te && (e += (s ?? "") + r[u + 1]), this._$AH[u] = s;
}
a && !o && this.j(e);
}
j(e) {
e === Te ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
}
}
class cd extends Tr {
constructor() {
super(...arguments), this.type = 3;
}
j(e) {
this.element[this.name] = e === Te ? void 0 : e;
}
}
let hd = class extends Tr {
constructor() {
super(...arguments), this.type = 4;
}
j(e) {
this.element.toggleAttribute(this.name, !!e && e !== Te);
}
};
class pd extends Tr {
constructor(e, i, n, o, r) {
super(e, i, n, o, r), this.type = 5;
}
_$AI(e, i = this) {
if ((e = Pi(this, e, i, 0) ?? Te) === dt) return;
const n = this._$AH, o = e === Te && n !== Te || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, r = e !== Te && (n === Te || o);
o && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
}
handleEvent(e) {
var i;
typeof this._$AH == "function" ? this._$AH.call(((i = this.options) == null ? void 0 : i.host) ?? this.element, e) : this._$AH.handleEvent(e);
}
}
class fd {
constructor(e, i, n) {
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = n;
}
get _$AU() {
return this._$AM._$AU;
}
_$AI(e) {
Pi(this, e);
}
}
const jr = Yi.litHtmlPolyfillSupport;
jr == null || jr(un, Hn), (Yi.litHtmlVersions ?? (Yi.litHtmlVersions = [])).push("3.1.3");
const md = (t, e, i) => {
const n = (i == null ? void 0 : i.renderBefore) ?? e;
let o = n._$litPart$;
if (o === void 0) {
const r = (i == null ? void 0 : i.renderBefore) ?? null;
n._$litPart$ = o = new Hn(e.insertBefore(sn(), r), r, void 0, i ?? {});
}
return o._$AI(t), o;
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
let Zi = class extends ki {
constructor() {
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
}
createRenderRoot() {
var i;
const e = super.createRenderRoot();
return (i = this.renderOptions).renderBefore ?? (i.renderBefore = e.firstChild), e;
}
update(e) {
const i = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = md(i, this.renderRoot, this.renderOptions);
}
connectedCallback() {
var e;
super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
}
disconnectedCallback() {
var e;
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
}
render() {
return dt;
}
};
var js;
Zi._$litElement$ = !0, Zi.finalized = !0, (js = globalThis.litElementHydrateSupport) == null || js.call(globalThis, { LitElement: Zi });
const Nr = globalThis.litElementPolyfillSupport;
Nr == null || Nr({ LitElement: Zi });
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5");
var gd = J`
:host(:not(:focus-within)) {
position: absolute !important;
width: 1px !important;
height: 1px !important;
clip: rect(0 0 0 0) !important;
clip-path: inset(50%) !important;
border: none !important;
overflow: hidden !important;
white-space: nowrap !important;
padding: 0 !important;
}
`, ee = J`
:host {
box-sizing: border-box;
}
:host *,
:host *::before,
:host *::after {
box-sizing: inherit;
}
[hidden] {
display: none !important;
}
`;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const bd = { attribute: !0, type: String, converter: Oi, reflect: !1, hasChanged: Ho }, vd = (t = bd, e, i) => {
const { kind: n, metadata: o } = i;
let r = globalThis.litPropertyMetadata.get(o);
if (r === void 0 && globalThis.litPropertyMetadata.set(o, r = /* @__PURE__ */ new Map()), r.set(i.name, t), n === "accessor") {
const { name: a } = i;
return { set(l) {
const u = e.get.call(this);
e.set.call(this, l), this.requestUpdate(a, u, t);
}, init(l) {
return l !== void 0 && this.P(a, void 0, t), l;
} };
}
if (n === "setter") {
const { name: a } = i;
return function(l) {
const u = this[a];
e.call(this, l), this.requestUpdate(a, u, t);
};
}
throw Error("Unsupported decorator location: " + n);
};
function b(t) {
return (e, i) => typeof i == "object" ? vd(t, e, i) : ((n, o, r) => {
const a = o.hasOwnProperty(r);
return o.constructor.createProperty(r, a ? { ...n, wrapped: !0 } : n), a ? Object.getOwnPropertyDescriptor(o, r) : void 0;
})(t, e, i);
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function te(t) {
return b({ ...t, state: !0, attribute: !1 });
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function jn(t) {
return (e, i) => {
const n = typeof e == "function" ? e : e[i];
Object.assign(n, t);
};
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const tl = (t, e, i) => (i.configurable = !0, i.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, i), i);
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function U(t, e) {
return (i, n, o) => {
const r = (a) => {
var l;
return ((l = a.renderRoot) == null ? void 0 : l.querySelector(t)) ?? null;
};
return tl(i, n, { get() {
return r(this);
} });
};
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function yd(t) {
return (e, i) => tl(e, i, { async get() {
var n;
return await this.updateComplete, ((n = this.renderRoot) == null ? void 0 : n.querySelector(t)) ?? null;
} });
}
var pr, Z = class extends Zi {
constructor() {
super(), Uu(this, pr, !1), this.initialReflectedProperties = /* @__PURE__ */ new Map(), Object.entries(this.constructor.dependencies).forEach(([t, e]) => {
this.constructor.define(t, e);
});
}
emit(t, e) {
const i = new CustomEvent(t, Nt({
bubbles: !0,
cancelable: !1,
composed: !0,
detail: {}
}, e));
return this.dispatchEvent(i), i;
}
/* eslint-enable */
static define(t, e = this, i = {}) {
const n = customElements.get(t);
if (!n) {
try {
customElements.define(t, e, i);
} catch {
customElements.define(t, class extends e {
}, i);
}
return;
}
let o = " (unknown version)", r = o;
"version" in e && e.version && (o = " v" + e.version), "version" in n && n.version && (r = " v" + n.version), !(o && r && o === r) && console.warn(
`Attempted to register <${t}>${o}, but <${t}>${r} has already been registered.`
);
}
attributeChangedCallback(t, e, i) {
Ku(this, pr) || (this.constructor.elementProperties.forEach(
(n, o) => {
n.reflect && this[o] != null && this.initialReflectedProperties.set(o, this[o]);
}
), Gu(this, pr, !0)), super.attributeChangedCallback(t, e, i);
}
willUpdate(t) {
super.willUpdate(t), this.initialReflectedProperties.forEach((e, i) => {
t.has(i) && this[i] == null && (this[i] = e);
});
}
};
pr = /* @__PURE__ */ new WeakMap();
Z.version = "2.17.1";
Z.dependencies = {};
c([
b()
], Z.prototype, "dir", 2);
c([
b()
], Z.prototype, "lang", 2);
var jo = class extends Z {
render() {
return D` <slot></slot> `;
}
};
jo.styles = [ee, gd];
jo.define("sl-visually-hidden");
var wd = J`
:host {
--max-width: 20rem;
--hide-delay: 0ms;
--show-delay: 150ms;
display: contents;
}
.tooltip {
--arrow-size: var(--sl-tooltip-arrow-size);
--arrow-color: var(--sl-tooltip-background-color);
}
.tooltip::part(popup) {
z-index: var(--sl-z-index-tooltip);
}
.tooltip[placement^='top']::part(popup) {
transform-origin: bottom;
}
.tooltip[placement^='bottom']::part(popup) {
transform-origin: top;
}
.tooltip[placement^='left']::part(popup) {
transform-origin: right;
}
.tooltip[placement^='right']::part(popup) {
transform-origin: left;
}
.tooltip__body {
display: block;
width: max-content;
max-width: var(--max-width);
border-radius: var(--sl-tooltip-border-radius);
background-color: var(--sl-tooltip-background-color);
font-family: var(--sl-tooltip-font-family);
font-size: var(--sl-tooltip-font-size);
font-weight: var(--sl-tooltip-font-weight);
line-height: var(--sl-tooltip-line-height);
text-align: start;
white-space: normal;
color: var(--sl-tooltip-color);
padding: var(--sl-tooltip-padding);
pointer-events: none;
user-select: none;
-webkit-user-select: none;
}
`, Cd = J`
:host {
--arrow-color: var(--sl-color-neutral-1000);
--arrow-size: 6px;
/*
* These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant
* 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating.
*/
--arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
--arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));
display: contents;
}
.popup {
position: absolute;
isolation: isolate;
max-width: var(--auto-size-available-width, none);
max-height: var(--auto-size-available-height, none);
}
.popup--fixed {
position: fixed;
}
.popup:not(.popup--active) {
display: none;
}
.popup__arrow {
position: absolute;
width: calc(var(--arrow-size-diagonal) * 2);
height: calc(var(--arrow-size-diagonal) * 2);
rotate: 45deg;
background: var(--arrow-color);
z-index: -1;
}
/* Hover bridge */
.popup-hover-bridge:not(.popup-hover-bridge--visible) {
display: none;
}
.popup-hover-bridge {
position: fixed;
z-index: calc(var(--sl-z-index-dropdown) - 1);
top: 0;
right: 0;
bottom: 0;
left: 0;
clip-path: polygon(
var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0),
var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0),
var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0),
var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
);
}
`;
const Qt = Math.min, ut = Math.max, vr = Math.round, ir = Math.floor, ei = (t) => ({
x: t,
y: t
}), Sd = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
}, kd = {
start: "end",
end: "start"
};
function ao(t, e, i) {
return ut(t, Qt(e, i));
}
function Mi(t, e) {
return typeof t == "function" ? t(e) : t;
}
function ti(t) {
return t.split("-")[0];
}
function $i(t) {
return t.split("-")[1];
}
function il(t) {
return t === "x" ? "y" : "x";
}
function No(t) {
return t === "y" ? "height" : "width";
}
function Nn(t) {
return ["top", "bottom"].includes(ti(t)) ? "y" : "x";
}
function Ko(t) {
return il(Nn(t));
}
function xd(t, e, i) {
i === void 0 && (i = !1);
const n = $i(t), o = Ko(t), r = No(o);
let a = o === "x" ? n === (i ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
return e.reference[r] > e.floating[r] && (a = yr(a)), [a, yr(a)];
}
function Id(t) {
const e = yr(t);
return [so(t), e, so(e)];
}
function so(t) {
return t.replace(/start|end/g, (e) => kd[e]);
}
function Od(t, e, i) {
const n = ["left", "right"], o = ["right", "left"], r = ["top", "bottom"], a = ["bottom", "top"];
switch (t) {
case "top":
case "bottom":
return i ? e ? o : n : e ? n : o;
case "left":
case "right":
return e ? r : a;
default:
return [];
}
}
function Pd(t, e, i, n) {
const o = $i(t);
let r = Od(ti(t), i === "start", n);
return o && (r = r.map((a) => a + "-" + o), e && (r = r.concat(r.map(so)))), r;
}
function yr(t) {
return t.replace(/left|right|bottom|top/g, (e) => Sd[e]);
}
function _d(t) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...t
};
}
function nl(t) {
return typeof t != "number" ? _d(t) : {
top: t,
right: t,
bottom: t,
left: t
};
}
function wr(t) {
return {
...t,
top: t.y,
left: t.x,
right: t.x + t.width,
bottom: t.y + t.height
};
}
function Ca(t, e, i) {
let {
reference: n,
floating: o
} = t;
const r = Nn(e), a = Ko(e), l = No(a), u = ti(e), s = r === "y", f = n.x + n.width / 2 - o.width / 2, d = n.y + n.height / 2 - o.height / 2, p = n[l] / 2 - o[l] / 2;
let h;
switch (u) {
case "top":
h = {
x: f,
y: n.y - o.height
};
break;
case "bottom":
h = {
x: f,
y: n.y + n.height
};
break;
case "right":
h = {
x: n.x + n.width,
y: d
};
break;
case "left":
h = {
x: n.x - o.width,
y: d
};
break;
default:
h = {
x: n.x,
y: n.y
};
}
switch ($i(e)) {
case "start":
h[a] -= p * (i && s ? -1 : 1);
break;
case "end":
h[a] += p * (i && s ? -1 : 1);
break;
}
return h;
}
const Td = async (t, e, i) => {
const {
placement: n = "bottom",
strategy: o = "absolute",
middleware: r = [],
platform: a
} = i, l = r.filter(Boolean), u = await (a.isRTL == null ? void 0 : a.isRTL(e));
let s = await a.getElementRects({
reference: t,
floating: e,
strategy: o
}), {
x: f,
y: d
} = Ca(s, n, u), p = n, h = {}, g = 0;
for (let v = 0; v < l.length; v++) {
const {
name: C,
fn: I
} = l[v], {
x: S,
y: O,
data: x,
reset: T
} = await I({
x: f,
y: d,
initialPlacement: n,
placement: p,
strategy: o,
middlewareData: h,
rects: s,
platform: a,
elements: {
reference: t,
floating: e
}
});
f = S ?? f, d = O ?? d, h = {
...h,
[C]: {
...h[C],
...x
}
}, T && g <= 50 && (g++, typeof T == "object" && (T.placement && (p = T.placement), T.rects && (s = T.rects === !0 ? await a.getElementRects({
reference: t,
floating: e,
strategy: o
}) : T.rects), {
x: f,
y: d
} = Ca(s, p, u)), v = -1);
}
return {
x: f,
y: d,
placement: p,
strategy: o,
middlewareData: h
};
};
async function Uo(t, e) {
var i;
e === void 0 && (e = {});
const {
x: n,
y: o,
platform: r,
rects: a,
elements: l,
strategy: u
} = t, {
boundary: s = "clippingAncestors",
rootBoundary: f = "viewport",
elementContext: d = "floating",
altBoundary: p = !1,
padding: h = 0
} = Mi(e, t), g = nl(h), C = l[p ? d === "floating" ? "reference" : "floating" : d], I = wr(await r.getClippingRect({
element: (i = await (r.isElement == null ? void 0 : r.isElement(C))) == null || i ? C : C.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
boundary: s,
rootBoundary: f,
strategy: u
})), S = d === "floating" ? {
...a.floating,
x: n,
y: o
} : a.reference, O = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), x = await (r.isElement == null ? void 0 : r.isElement(O)) ? await (r.getScale == null ? void 0 : r.getScale(O)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
}, T = wr(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
elements: l,
rect: S,
offsetParent: O,
strategy: u
}) : S);
return {
top: (I.top - T.top + g.top) / x.y,
bottom: (T.bottom - I.bottom + g.bottom) / x.y,
left: (I.left - T.left + g.left) / x.x,
right: (T.right - I.right + g.right) / x.x
};
}
const Ed = (t) => ({
name: "arrow",
options: t,
async fn(e) {
const {
x: i,
y: n,
placement: o,
rects: r,
platform: a,
elements: l,
middlewareData: u
} = e, {
element: s,
padding: f = 0
} = Mi(t, e) || {};
if (s == null)
return {};
const d = nl(f), p = {
x: i,
y: n
}, h = Ko(o), g = No(h), v = await a.getDimensions(s), C = h === "y", I = C ? "top" : "left", S = C ? "bottom" : "right", O = C ? "clientHeight" : "clientWidth", x = r.reference[g] + r.reference[h] - p[h] - r.floating[g], T = p[h] - r.reference[h], $ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(s));
let B = $ ? $[O] : 0;
(!B || !await (a.isElement == null ? void 0 : a.isElement($))) && (B = l.floating[O] || r.floating[g]);
const V = x / 2 - T / 2, N = B / 2 - v[g] / 2 - 1, H = Qt(d[I], N), L = Qt(d[S], N), R = H, W = B - v[g] - L, ne = B / 2 - v[g] / 2 + V, le = ao(R, ne, W), Ce = !u.arrow && $i(o) != null && ne !== le && r.reference[g] / 2 - (ne < R ? H : L) - v[g] / 2 < 0, Le = Ce ? ne < R ? ne - R : ne - W : 0;
return {
[h]: p[h] + Le,
data: {
[h]: le,
centerOffset: ne - le - Le,
...Ce && {
alignmentOffset: Le
}
},
reset: Ce
};
}
}), Md = function(t) {
return t === void 0 && (t = {}), {
name: "flip",
options: t,
async fn(e) {
var i, n;
const {
placement: o,
middlewareData: r,
rects: a,
initialPlacement: l,
platform: u,
elements: s
} = e, {
mainAxis: f = !0,
crossAxis: d = !0,
fallbackPlacements: p,
fallbackStrategy: h = "bestFit",
fallbackAxisSideDirection: g = "none",
flipAlignment: v = !0,
...C
} = Mi(t, e);
if ((i = r.arrow) != null && i.alignmentOffset)
return {};
const I = ti(o), S = ti(l) === l, O = await (u.isRTL == null ? void 0 : u.isRTL(s.floating)), x = p || (S || !v ? [yr(l)] : Id(l));
!p && g !== "none" && x.push(...Pd(l, v, g, O));
const T = [l, ...x], $ = await Uo(e, C), B = [];
let V = ((n = r.flip) == null ? void 0 : n.overflows) || [];
if (f && B.push($[I]), d) {
const R = xd(o, a, O);
B.push($[R[0]], $[R[1]]);
}
if (V = [...V, {
placement: o,
overflows: B
}], !B.every((R) => R <= 0)) {
var N, H;
const R = (((N = r.flip) == null ? void 0 : N.index) || 0) + 1, W = T[R];
if (W)
return {
data: {
index: R,
overflows: V
},
reset: {
placement: W
}
};
let ne = (H = V.filter((le) => le.overflows[0] <= 0).sort((le, Ce) => le.overflows[1] - Ce.overflows[1])[0]) == null ? void 0 : H.placement;
if (!ne)
switch (h) {
case "bestFit": {
var L;
const le = (L = V.map((Ce) => [Ce.placement, Ce.overflows.filter((Le) => Le > 0).reduce((Le, Vt) => Le + Vt, 0)]).sort((Ce, Le) => Ce[1] - Le[1])[0]) == null ? void 0 : L[0];
le && (ne = le);
break;
}
case "initialPlacement":
ne = l;
break;
}
if (o !== ne)
return {
reset: {
placement: ne
}
};
}
return {};
}
};
};
async function $d(t, e) {
const {
placement: i,
platform: n,
elements: o
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(o.floating)), a = ti(i), l = $i(i), u = Nn(i) === "y", s = ["left", "top"].includes(a) ? -1 : 1, f = r && u ? -1 : 1, d = Mi(e, t);
let {
mainAxis: p,
crossAxis: h,
alignmentAxis: g
} = typeof d == "number" ? {
mainAxis: d,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: 0,
crossAxis: 0,
alignmentAxis: null,
...d
};
return l && typeof g == "number" && (h = l === "end" ? g * -1 : g), u ? {
x: h * f,
y: p * s
} : {
x: p * s,
y: h * f
};
}
const Ld = function(t) {
return t === void 0 && (t = 0), {
name: "offset",
options: t,
async fn(e) {
var i, n;
const {
x: o,
y: r,
placement: a,
middlewareData: l
} = e, u = await $d(e, t);
return a === ((i = l.offset) == null ? void 0 : i.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
x: o + u.x,
y: r + u.y,
data: {
...u,
placement: a
}
};
}
};
}, Ad = function(t) {
return t === void 0 && (t = {}), {
name: "shift",
options: t,
async fn(e) {
const {
x: i,
y: n,
placement: o
} = e, {
mainAxis: r = !0,
crossAxis: a = !1,
limiter: l = {
fn: (C) => {
let {
x: I,
y: S
} = C;
return {
x: I,
y: S
};
}
},
...u
} = Mi(t, e), s = {
x: i,
y: n
}, f = await Uo(e, u), d = Nn(ti(o)), p = il(d);
let h = s[p], g = s[d];
if (r) {
const C = p === "y" ? "top" : "left", I = p === "y" ? "bottom" : "right", S = h + f[C], O = h - f[I];
h = ao(S, h, O);
}
if (a) {