@vireo-ai/trellis-ui 0.1.2 → 0.1.4

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.
@@ -6784,20 +6784,568 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
6784
6784
  }), e.compounds?.forEach((n) => {
6785
6785
  Uf(e, t, n) && r.push(n.class);
6786
6786
  }), r.push(n), Fl(r);
6787
- }, Wf = !1, Gf = !1, Kf = "__trellisUi", Z = (e, ...t) => {
6787
+ }, Wf = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, Gf = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, Kf = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
6788
+ function qf(e, t) {
6789
+ if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) {
6790
+ Jf(e);
6791
+ return;
6792
+ }
6793
+ return t;
6794
+ }
6795
+ function Jf(e) {
6796
+ console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
6797
+ }
6798
+ function Yf(e, t = {}) {
6799
+ if (typeof e != "string") return e;
6800
+ if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
6801
+ let n = e.trim();
6802
+ if (n.length <= 9) switch (n.toLowerCase()) {
6803
+ case "true": return !0;
6804
+ case "false": return !1;
6805
+ case "undefined": return;
6806
+ case "null": return null;
6807
+ case "nan": return NaN;
6808
+ case "infinity": return Infinity;
6809
+ case "-infinity": return -Infinity;
6810
+ }
6811
+ if (!Kf.test(e)) {
6812
+ if (t.strict) throw SyntaxError("[destr] Invalid JSON");
6813
+ return e;
6814
+ }
6815
+ try {
6816
+ if (Wf.test(e) || Gf.test(e)) {
6817
+ if (t.strict) throw Error("[destr] Possible prototype pollution");
6818
+ return JSON.parse(e, qf);
6819
+ }
6820
+ return JSON.parse(e);
6821
+ } catch (n) {
6822
+ if (t.strict) throw n;
6823
+ return e;
6824
+ }
6825
+ }
6826
+ String.fromCharCode;
6827
+ var Xf = /#/g, Zf = /&/g, Qf = /\//g, $f = /=/g, ep = /\+/g, tp = /%5e/gi, np = /%60/gi, rp = /%7c/gi, ip = /%20/gi;
6828
+ function ap(e) {
6829
+ return encodeURI("" + e).replace(rp, "|");
6830
+ }
6831
+ function op(e) {
6832
+ return ap(typeof e == "string" ? e : JSON.stringify(e)).replace(ep, "%2B").replace(ip, "+").replace(Xf, "%23").replace(Zf, "%26").replace(np, "`").replace(tp, "^").replace(Qf, "%2F");
6833
+ }
6834
+ function sp(e) {
6835
+ return op(e).replace($f, "%3D");
6836
+ }
6837
+ function cp(e = "") {
6838
+ try {
6839
+ return decodeURIComponent("" + e);
6840
+ } catch {
6841
+ return "" + e;
6842
+ }
6843
+ }
6844
+ function lp(e) {
6845
+ return cp(e.replace(ep, " "));
6846
+ }
6847
+ function up(e) {
6848
+ return cp(e.replace(ep, " "));
6849
+ }
6850
+ function dp(e = "") {
6851
+ let t = /* @__PURE__ */ Object.create(null);
6852
+ e[0] === "?" && (e = e.slice(1));
6853
+ for (let n of e.split("&")) {
6854
+ let e = n.match(/([^=]+)=?(.*)/) || [];
6855
+ if (e.length < 2) continue;
6856
+ let r = lp(e[1]);
6857
+ if (r === "__proto__" || r === "constructor") continue;
6858
+ let i = up(e[2] || "");
6859
+ t[r] === void 0 ? t[r] = i : Array.isArray(t[r]) ? t[r].push(i) : t[r] = [t[r], i];
6860
+ }
6861
+ return t;
6862
+ }
6863
+ function fp(e, t) {
6864
+ return (typeof t == "number" || typeof t == "boolean") && (t = String(t)), t ? Array.isArray(t) ? t.map((t) => `${sp(e)}=${op(t)}`).join("&") : `${sp(e)}=${op(t)}` : sp(e);
6865
+ }
6866
+ function pp(e) {
6867
+ return Object.keys(e).filter((t) => e[t] !== void 0).map((t) => fp(t, e[t])).filter(Boolean).join("&");
6868
+ }
6869
+ var mp = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/, hp = /^[\s\w\0+.-]{2,}:([/\\]{2})?/, gp = /^([/\\]\s*){2,}[^/\\]/, _p = /\/$|\/\?|\/#/, vp = /^\.?\//;
6870
+ function yp(e, t = {}) {
6871
+ return typeof t == "boolean" && (t = { acceptRelative: t }), t.strict ? mp.test(e) : hp.test(e) || (t.acceptRelative ? gp.test(e) : !1);
6872
+ }
6873
+ function bp(e = "", t) {
6874
+ return t ? _p.test(e) : e.endsWith("/");
6875
+ }
6876
+ function xp(e = "", t) {
6877
+ if (!t) return (bp(e) ? e.slice(0, -1) : e) || "/";
6878
+ if (!bp(e, !0)) return e || "/";
6879
+ let n = e, r = "", i = e.indexOf("#");
6880
+ i !== -1 && (n = e.slice(0, i), r = e.slice(i));
6881
+ let [a, ...o] = n.split("?");
6882
+ return ((a.endsWith("/") ? a.slice(0, -1) : a) || "/") + (o.length > 0 ? `?${o.join("?")}` : "") + r;
6883
+ }
6884
+ function Sp(e = "", t) {
6885
+ if (!t) return e.endsWith("/") ? e : e + "/";
6886
+ if (bp(e, !0)) return e || "/";
6887
+ let n = e, r = "", i = e.indexOf("#");
6888
+ if (i !== -1 && (n = e.slice(0, i), r = e.slice(i), !n)) return r;
6889
+ let [a, ...o] = n.split("?");
6890
+ return a + "/" + (o.length > 0 ? `?${o.join("?")}` : "") + r;
6891
+ }
6892
+ function Cp(e, t) {
6893
+ if (Tp(t) || yp(e)) return e;
6894
+ let n = xp(t);
6895
+ if (e.startsWith(n)) {
6896
+ let t = e[n.length];
6897
+ if (!t || t === "/" || t === "?") return e;
6898
+ }
6899
+ return Dp(n, e);
6900
+ }
6901
+ function wp(e, t) {
6902
+ let n = kp(e);
6903
+ return n.search = pp({
6904
+ ...dp(n.search),
6905
+ ...t
6906
+ }), jp(n);
6907
+ }
6908
+ function Tp(e) {
6909
+ return !e || e === "/";
6910
+ }
6911
+ function Ep(e) {
6912
+ return e && e !== "/";
6913
+ }
6914
+ function Dp(e, ...t) {
6915
+ let n = e || "";
6916
+ for (let e of t.filter((e) => Ep(e))) if (n) {
6917
+ let t = e.replace(vp, "");
6918
+ n = Sp(n) + t;
6919
+ } else n = e;
6920
+ return n;
6921
+ }
6922
+ var Op = Symbol.for("ufo:protocolRelative");
6923
+ function kp(e = "", t) {
6924
+ let n = e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);
6925
+ if (n) {
6926
+ let [, e, t = ""] = n;
6927
+ return {
6928
+ protocol: e.toLowerCase(),
6929
+ pathname: t,
6930
+ href: e + t,
6931
+ auth: "",
6932
+ host: "",
6933
+ search: "",
6934
+ hash: ""
6935
+ };
6936
+ }
6937
+ if (!yp(e, { acceptRelative: !0 })) return t ? kp(t + e) : Ap(e);
6938
+ let [, r = "", i, a = ""] = e.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [], [, o = "", s = ""] = a.match(/([^#/?]*)(.*)?/) || [];
6939
+ r === "file:" && (s = s.replace(/\/(?=[A-Za-z]:)/, ""));
6940
+ let { pathname: c, search: l, hash: u } = Ap(s);
6941
+ return {
6942
+ protocol: r.toLowerCase(),
6943
+ auth: i ? i.slice(0, Math.max(0, i.length - 1)) : "",
6944
+ host: o,
6945
+ pathname: c,
6946
+ search: l,
6947
+ hash: u,
6948
+ [Op]: !r
6949
+ };
6950
+ }
6951
+ function Ap(e = "") {
6952
+ let [t = "", n = "", r = ""] = (e.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
6953
+ return {
6954
+ pathname: t,
6955
+ search: n,
6956
+ hash: r
6957
+ };
6958
+ }
6959
+ function jp(e) {
6960
+ let t = e.pathname || "", n = e.search ? (e.search.startsWith("?") ? "" : "?") + e.search : "", r = e.hash || "", i = e.auth ? e.auth + "@" : "", a = e.host || "";
6961
+ return (e.protocol || e[Op] ? (e.protocol || "") + "//" : "") + i + a + t + n + r;
6962
+ }
6963
+ //#endregion
6964
+ //#region node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
6965
+ var Mp = class extends Error {
6966
+ constructor(e, t) {
6967
+ super(e, t), this.name = "FetchError", t?.cause && !this.cause && (this.cause = t.cause);
6968
+ }
6969
+ };
6970
+ function Np(e) {
6971
+ let t = e.error?.message || e.error?.toString() || "", n = e.request?.method || e.options?.method || "GET", r = e.request?.url || String(e.request) || "/", i = new Mp(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response ? `${e.response.status} ${e.response.statusText}` : "<no response>"}${t ? ` ${t}` : ""}`, e.error ? { cause: e.error } : void 0);
6972
+ for (let t of [
6973
+ "request",
6974
+ "options",
6975
+ "response"
6976
+ ]) Object.defineProperty(i, t, { get() {
6977
+ return e[t];
6978
+ } });
6979
+ for (let [t, n] of [
6980
+ ["data", "_data"],
6981
+ ["status", "status"],
6982
+ ["statusCode", "status"],
6983
+ ["statusText", "statusText"],
6984
+ ["statusMessage", "statusText"]
6985
+ ]) Object.defineProperty(i, t, { get() {
6986
+ return e.response && e.response[n];
6987
+ } });
6988
+ return i;
6989
+ }
6990
+ var Pp = new Set(Object.freeze([
6991
+ "PATCH",
6992
+ "POST",
6993
+ "PUT",
6994
+ "DELETE"
6995
+ ]));
6996
+ function Fp(e = "GET") {
6997
+ return Pp.has(e.toUpperCase());
6998
+ }
6999
+ function Ip(e) {
7000
+ if (e === void 0) return !1;
7001
+ let t = typeof e;
7002
+ return t === "string" || t === "number" || t === "boolean" || t === null ? !0 : t === "object" ? Array.isArray(e) ? !0 : e.buffer || e instanceof FormData || e instanceof URLSearchParams ? !1 : e.constructor && e.constructor.name === "Object" || typeof e.toJSON == "function" : !1;
7003
+ }
7004
+ var Lp = /* @__PURE__ */ new Set([
7005
+ "image/svg",
7006
+ "application/xml",
7007
+ "application/xhtml",
7008
+ "application/html"
7009
+ ]), Rp = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
7010
+ function zp(e = "") {
7011
+ if (!e) return "json";
7012
+ let t = e.split(";").shift() || "";
7013
+ return Rp.test(t) ? "json" : t === "text/event-stream" ? "stream" : Lp.has(t) || t.startsWith("text/") ? "text" : "blob";
7014
+ }
7015
+ function Bp(e, t, n, r) {
7016
+ let i = Vp(t?.headers ?? e?.headers, n?.headers, r), a;
7017
+ return (n?.query || n?.params || t?.params || t?.query) && (a = {
7018
+ ...n?.params,
7019
+ ...n?.query,
7020
+ ...t?.params,
7021
+ ...t?.query
7022
+ }), {
7023
+ ...n,
7024
+ ...t,
7025
+ query: a,
7026
+ params: a,
7027
+ headers: i
7028
+ };
7029
+ }
7030
+ function Vp(e, t, n) {
7031
+ if (!t) return new n(e);
7032
+ let r = new n(t);
7033
+ if (e) for (let [t, i] of Symbol.iterator in e || Array.isArray(e) ? e : new n(e)) r.set(t, i);
7034
+ return r;
7035
+ }
7036
+ async function Hp(e, t) {
7037
+ if (t) if (Array.isArray(t)) for (let n of t) await n(e);
7038
+ else await t(e);
7039
+ }
7040
+ var Up = /* @__PURE__ */ new Set([
7041
+ 408,
7042
+ 409,
7043
+ 425,
7044
+ 429,
7045
+ 500,
7046
+ 502,
7047
+ 503,
7048
+ 504
7049
+ ]), Wp = /* @__PURE__ */ new Set([
7050
+ 101,
7051
+ 204,
7052
+ 205,
7053
+ 304
7054
+ ]);
7055
+ function Gp(e = {}) {
7056
+ let { fetch: t = globalThis.fetch, Headers: n = globalThis.Headers, AbortController: r = globalThis.AbortController } = e;
7057
+ async function i(e) {
7058
+ let t = e.error && e.error.name === "AbortError" && !e.options.timeout || !1;
7059
+ if (e.options.retry !== !1 && !t) {
7060
+ let t;
7061
+ t = typeof e.options.retry == "number" ? e.options.retry : +!Fp(e.options.method);
7062
+ let n = e.response && e.response.status || 500;
7063
+ if (t > 0 && (Array.isArray(e.options.retryStatusCodes) ? e.options.retryStatusCodes.includes(n) : Up.has(n))) {
7064
+ let n = typeof e.options.retryDelay == "function" ? e.options.retryDelay(e) : e.options.retryDelay || 0;
7065
+ return n > 0 && await new Promise((e) => setTimeout(e, n)), a(e.request, {
7066
+ ...e.options,
7067
+ retry: t - 1
7068
+ });
7069
+ }
7070
+ }
7071
+ let n = Np(e);
7072
+ throw Error.captureStackTrace && Error.captureStackTrace(n, a), n;
7073
+ }
7074
+ let a = async function(a, o = {}) {
7075
+ let s = {
7076
+ request: a,
7077
+ options: Bp(a, o, e.defaults, n),
7078
+ response: void 0,
7079
+ error: void 0
7080
+ };
7081
+ if (s.options.method && (s.options.method = s.options.method.toUpperCase()), s.options.onRequest && (await Hp(s, s.options.onRequest), s.options.headers instanceof n || (s.options.headers = new n(s.options.headers || {}))), typeof s.request == "string" && (s.options.baseURL && (s.request = Cp(s.request, s.options.baseURL)), s.options.query && (s.request = wp(s.request, s.options.query), delete s.options.query), "query" in s.options && delete s.options.query, "params" in s.options && delete s.options.params), s.options.body && Fp(s.options.method)) if (Ip(s.options.body)) {
7082
+ let e = s.options.headers.get("content-type");
7083
+ typeof s.options.body != "string" && (s.options.body = e === "application/x-www-form-urlencoded" ? new URLSearchParams(s.options.body).toString() : JSON.stringify(s.options.body)), e || s.options.headers.set("content-type", "application/json"), s.options.headers.has("accept") || s.options.headers.set("accept", "application/json");
7084
+ } else ("pipeTo" in s.options.body && typeof s.options.body.pipeTo == "function" || typeof s.options.body.pipe == "function") && ("duplex" in s.options || (s.options.duplex = "half"));
7085
+ let c;
7086
+ if (!s.options.signal && s.options.timeout) {
7087
+ let e = new r();
7088
+ c = setTimeout(() => {
7089
+ let t = /* @__PURE__ */ Error("[TimeoutError]: The operation was aborted due to timeout");
7090
+ t.name = "TimeoutError", t.code = 23, e.abort(t);
7091
+ }, s.options.timeout), s.options.signal = e.signal;
7092
+ }
7093
+ try {
7094
+ s.response = await t(s.request, s.options);
7095
+ } catch (e) {
7096
+ return s.error = e, s.options.onRequestError && await Hp(s, s.options.onRequestError), await i(s);
7097
+ } finally {
7098
+ c && clearTimeout(c);
7099
+ }
7100
+ if ((s.response.body || s.response._bodyInit) && !Wp.has(s.response.status) && s.options.method !== "HEAD") {
7101
+ let e = (s.options.parseResponse ? "json" : s.options.responseType) || zp(s.response.headers.get("content-type") || "");
7102
+ switch (e) {
7103
+ case "json": {
7104
+ let e = await s.response.text(), t = s.options.parseResponse || Yf;
7105
+ s.response._data = t(e);
7106
+ break;
7107
+ }
7108
+ case "stream":
7109
+ s.response._data = s.response.body || s.response._bodyInit;
7110
+ break;
7111
+ default: s.response._data = await s.response[e]();
7112
+ }
7113
+ }
7114
+ return s.options.onResponse && await Hp(s, s.options.onResponse), !s.options.ignoreResponseError && s.response.status >= 400 && s.response.status < 600 ? (s.options.onResponseError && await Hp(s, s.options.onResponseError), await i(s)) : s.response;
7115
+ }, o = async function(e, t) {
7116
+ return (await a(e, t))._data;
7117
+ };
7118
+ return o.raw = a, o.native = (...e) => t(...e), o.create = (t = {}, n = {}) => Gp({
7119
+ ...e,
7120
+ ...n,
7121
+ defaults: {
7122
+ ...e.defaults,
7123
+ ...n.defaults,
7124
+ ...t
7125
+ }
7126
+ }), o;
7127
+ }
7128
+ //#endregion
7129
+ //#region node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/index.mjs
7130
+ var Kp = (function() {
7131
+ if (typeof globalThis < "u") return globalThis;
7132
+ if (typeof self < "u") return self;
7133
+ if (typeof window < "u") return window;
7134
+ if (typeof global < "u") return global;
7135
+ throw Error("unable to locate global object");
7136
+ })(), qp = Kp.fetch ? (...e) => Kp.fetch(...e) : () => Promise.reject(/* @__PURE__ */ Error("[ofetch] global.fetch is not supported!")), Jp = Kp.Headers, Yp = Kp.AbortController, Xp = Gp({
7137
+ fetch: qp,
7138
+ Headers: Jp,
7139
+ AbortController: Yp
7140
+ });
7141
+ //#endregion
7142
+ //#region node_modules/.pnpm/event-source-plus@0.1.15/node_modules/event-source-plus/dist/index.mjs
7143
+ async function Zp(e) {
7144
+ return new Promise((t) => {
7145
+ setTimeout(() => {
7146
+ t(!0);
7147
+ }, e);
7148
+ });
7149
+ }
7150
+ function Qp(e) {
7151
+ let t = [], n = "", r = !1, i, a, o, s, c, l = 0, u = !1;
7152
+ function d(e) {
7153
+ let r = $p(n);
7154
+ i = r.data ?? i, a = r.id ?? a, o = r.event ?? o, s = r.retry ?? s, u && (typeof i == "string" && t.push({
7155
+ id: a,
7156
+ data: i,
7157
+ event: o ?? "message",
7158
+ retry: s
7159
+ }), a = void 0, i = void 0, o = void 0, s = void 0, l = e), n = "";
7160
+ }
7161
+ for (let t = 0; t < e.length; t++) {
7162
+ let i = e[t];
7163
+ switch (i) {
7164
+ case "\r":
7165
+ u = c === "\n" || c === "\r", r = !0, d(e[t + 1] === "\n" ? t + 2 : t + 1);
7166
+ break;
7167
+ case "\n":
7168
+ if (r) {
7169
+ r = !1;
7170
+ break;
7171
+ }
7172
+ u = c === "\n", d(t + 1);
7173
+ break;
7174
+ default:
7175
+ n += i;
7176
+ break;
7177
+ }
7178
+ c = i;
7179
+ }
7180
+ return {
7181
+ messages: t,
7182
+ leftoverData: e.substring(l)
7183
+ };
7184
+ }
7185
+ function $p(e) {
7186
+ if (e.startsWith("data:")) return { data: e.substring(5).trim() };
7187
+ if (e.startsWith("id:")) return { id: e.substring(3).trim() };
7188
+ if (e.startsWith("event:")) return { event: e.substring(6).trim() };
7189
+ if (e.startsWith("retry:")) {
7190
+ let t = Number(e.substring(6).trim());
7191
+ if (!Number.isNaN(t)) return Number.isInteger(t) ? { retry: t } : { retry: Math.round(t) };
7192
+ }
7193
+ return {};
7194
+ }
7195
+ async function em(e, t, n) {
7196
+ let r = t.getReader(), i;
7197
+ for (; !e.signal.aborted && !(i = await r.read()).done;) n(i.value);
7198
+ }
7199
+ var tm = "text/event-stream", nm = "last-event-id", rm = class {
7200
+ url;
7201
+ lastEventId;
7202
+ options;
7203
+ retryCount = 0;
7204
+ retryInterval = 0;
7205
+ maxRetryCount;
7206
+ maxRetryInterval;
7207
+ fetch;
7208
+ timeoutDurationMs;
7209
+ timeout;
7210
+ constructor(e, t = {}) {
7211
+ this.url = e, this.options = t, this.maxRetryCount = t.maxRetryCount, this.maxRetryInterval = t.maxRetryInterval ?? 3e4, this.fetch = Gp({ fetch: t.fetch }) ?? Xp, this.timeoutDurationMs = t.timeout;
7212
+ }
7213
+ async _handleRetry(e, t) {
7214
+ if (this.retryCount++, typeof this.maxRetryCount == "number" && this.retryCount >= this.maxRetryCount) {
7215
+ e._emitEvent({
7216
+ type: "error",
7217
+ reason: "max retry count reached"
7218
+ });
7219
+ return;
7220
+ }
7221
+ this.retryInterval === 0 ? this.retryInterval = 2 : this.retryInterval > 0 && (this.retryInterval *= 2, this.retryInterval >= this.maxRetryInterval && (this.retryInterval = this.maxRetryInterval)), await Zp(this.retryInterval), e._abortController.abort(), e._abortController = new AbortController(), await this._handleConnection(e, t);
7222
+ }
7223
+ async _handleConnection(e, t) {
7224
+ let n, r = e._abortController.signal;
7225
+ if (typeof this.options.headers == "function") {
7226
+ let e = this.options.headers();
7227
+ n = "then" in e && typeof e.then == "function" ? new Headers(await e.then((e) => e)) : new Headers(e);
7228
+ } else n = new Headers(this.options.headers ?? {});
7229
+ typeof n.get("accept") != "string" && n.set("accept", tm), typeof this.lastEventId == "string" && n.set(nm, this.lastEventId);
7230
+ let i, a = {
7231
+ ...this.options,
7232
+ method: this.options.method ?? "get",
7233
+ responseType: "stream",
7234
+ headers: n,
7235
+ signal: r,
7236
+ retry: !1,
7237
+ onRequest: (n) => {
7238
+ if (!(e.signal.aborted || r.aborted) && !im(n.error)) return t.onRequest?.(n);
7239
+ },
7240
+ onRequestError: async (n) => {
7241
+ if (!(e.signal.aborted || r.aborted) && !im(n.error)) return t.onRequestError?.(n);
7242
+ },
7243
+ onResponse: async (e) => (i = e, om(e, t)),
7244
+ onResponseError: async (e) => {
7245
+ if (!r.aborted && !im(e.error)) throw e.error === void 0 && (e.error = new Mp(`${e.response.status} ${e.response.statusText}`)), await t.onResponseError?.(e), e.error;
7246
+ }
7247
+ };
7248
+ try {
7249
+ this.timeoutDurationMs && (this.timeout = setTimeout(() => {
7250
+ e._emitEvent({
7251
+ type: "error",
7252
+ reason: `Timeout of ${this.timeoutDurationMs}ms exceeded`
7253
+ });
7254
+ }, this.timeoutDurationMs));
7255
+ let n = await this.fetch.raw(this.url, a);
7256
+ clearTimeout(this.timeout), this.timeout = void 0, this.retryCount = 0, this.retryInterval = 0;
7257
+ let r = new TextDecoder(), o = "", s = n.body;
7258
+ if (!s) {
7259
+ let e = /* @__PURE__ */ Error("Expected response body to contain ReadableStream");
7260
+ throw i.response = n, i.error = e, await t.onResponseError?.(i), e;
7261
+ }
7262
+ await em(e, s, (e) => {
7263
+ let n = Qp(o + r.decode(e, { stream: !0 }));
7264
+ o = n.leftoverData ?? "";
7265
+ for (let e of n.messages) typeof e.id == "string" && e.id.length > 0 && (this.lastEventId = e.id), t.onMessage(e);
7266
+ });
7267
+ } catch (n) {
7268
+ return r.aborted || e.signal.aborted || im(n) ? void 0 : this._handleRetry(e, t);
7269
+ }
7270
+ if (!(e.signal.aborted || r.aborted)) {
7271
+ if (this.options.retryStrategy === "on-error") {
7272
+ e._emitEvent({
7273
+ type: "end-of-stream",
7274
+ reason: "Stream has ended"
7275
+ });
7276
+ return;
7277
+ }
7278
+ return this._handleRetry(e, t);
7279
+ }
7280
+ }
7281
+ listen(e) {
7282
+ let t = new am(new AbortController(), (n) => {
7283
+ if (n === void 0) {
7284
+ this._handleConnection(t, e);
7285
+ return;
7286
+ }
7287
+ this._handleConnection(t, {
7288
+ ...e,
7289
+ ...n
7290
+ });
7291
+ });
7292
+ return this._handleConnection(t, e), t;
7293
+ }
7294
+ };
7295
+ function im(e) {
7296
+ return e instanceof DOMException && e.name === "AbortError";
7297
+ }
7298
+ var am = class {
7299
+ didAbort = !1;
7300
+ _abortController;
7301
+ _connect;
7302
+ constructor(e, t) {
7303
+ this._abortController = e ?? new AbortController(), this._connect = t;
7304
+ }
7305
+ abort(e) {
7306
+ this._emitEvent({
7307
+ type: "manual",
7308
+ reason: e
7309
+ });
7310
+ }
7311
+ reconnect(e) {
7312
+ this.didAbort = !1, this._abortController.abort(), this._abortController = new AbortController(), this._connect?.(e);
7313
+ }
7314
+ _abortHook;
7315
+ _emitEvent(e) {
7316
+ this.didAbort || (this.didAbort = !0, this._abortHook?.(e), this._abortController.abort(e.reason));
7317
+ }
7318
+ onAbort(e) {
7319
+ this._abortHook = e;
7320
+ }
7321
+ get signal() {
7322
+ return this._abortController.signal;
7323
+ }
7324
+ };
7325
+ async function om(e, t) {
7326
+ if (typeof t.onResponse == "function" && await t.onResponse(e), !e.response.ok) return;
7327
+ let n = e.response.headers.get("Content-Type");
7328
+ if (typeof n != "string" || !n.includes("text/event-stream")) {
7329
+ let r = /* @__PURE__ */ Error(`Expected server to response with Content-Type: '${tm}'. Got '${n}'`);
7330
+ throw e.error = r, typeof t.onResponseError == "function" && await t.onResponseError(e), r;
7331
+ }
7332
+ }
7333
+ //#endregion
7334
+ //#region src/runtime/stream.ts
7335
+ var sm = !1, cm = !1, lm = "__trellisUi", Z = (e, ...t) => {
6788
7336
  typeof console < "u" && console.warn(e, ...t);
6789
- }, qf = (e) => {
7337
+ }, um = (e) => {
6790
7338
  let t = document.createElement("template");
6791
7339
  return t.innerHTML = e, t;
6792
- }, Jf = (e) => Array.from(qf(e).content.children).filter((e) => e instanceof HTMLElement), Yf = (e, t) => {
7340
+ }, dm = (e) => Array.from(um(e).content.children).filter((e) => e instanceof HTMLElement), fm = (e, t) => {
6793
7341
  t.forEach((t) => e.initTree(t));
6794
- }, Xf = (e, t) => t || e.getAttribute("x-merge") || "replace", Zf = (e) => {
7342
+ }, pm = (e, t) => t || e.getAttribute("x-merge") || "replace", mm = (e) => {
6795
7343
  if (e.selector) return document.querySelector(e.selector);
6796
7344
  if (!e.target) return null;
6797
7345
  let t = e.target.startsWith("#") ? e.target.slice(1) : e.target;
6798
7346
  return document.getElementById(t);
6799
- }, Qf = (e, t, n) => {
6800
- let r = Xf(t, n.mode);
7347
+ }, hm = (e, t, n) => {
7348
+ let r = pm(t, n.mode);
6801
7349
  if (r === "remove") {
6802
7350
  t.remove();
6803
7351
  return;
@@ -6816,7 +7364,7 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
6816
7364
  Z("x-ui-stream: morph mode requires @alpinejs/morph; falling back to replace");
6817
7365
  }
6818
7366
  if (r === "replace" || r === "morph" || r === "outer") {
6819
- let [r] = Jf(n.html);
7367
+ let [r] = dm(n.html);
6820
7368
  if (!r) {
6821
7369
  Z("x-ui-stream: replace mode produced no element");
6822
7370
  return;
@@ -6825,28 +7373,28 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
6825
7373
  return;
6826
7374
  }
6827
7375
  if (r === "update") {
6828
- let r = Jf(n.html);
6829
- t.innerHTML = n.html, Yf(e, Array.from(t.children).filter((e) => e instanceof HTMLElement)), r.length === 0 && n.html.trim() && e.initTree(t);
7376
+ let r = dm(n.html);
7377
+ t.innerHTML = n.html, fm(e, Array.from(t.children).filter((e) => e instanceof HTMLElement)), r.length === 0 && n.html.trim() && e.initTree(t);
6830
7378
  return;
6831
7379
  }
6832
- let i = qf(n.html), a = Array.from(i.content.children).filter((e) => e instanceof HTMLElement);
7380
+ let i = um(n.html), a = Array.from(i.content.children).filter((e) => e instanceof HTMLElement);
6833
7381
  if (r === "append") {
6834
- t.append(i.content), Yf(e, a);
7382
+ t.append(i.content), fm(e, a);
6835
7383
  return;
6836
7384
  }
6837
7385
  if (r === "prepend") {
6838
- t.prepend(i.content), Yf(e, a);
7386
+ t.prepend(i.content), fm(e, a);
6839
7387
  return;
6840
7388
  }
6841
7389
  if (r === "before") {
6842
- t.before(i.content), Yf(e, a);
7390
+ t.before(i.content), fm(e, a);
6843
7391
  return;
6844
7392
  }
6845
- r === "after" && (t.after(i.content), Yf(e, a));
6846
- }, $f = (e, t) => {
6847
- let n = Zf(t);
7393
+ r === "after" && (t.after(i.content), fm(e, a));
7394
+ }, gm = (e, t) => {
7395
+ let n = mm(t);
6848
7396
  if (n) {
6849
- Qf(e, n, t);
7397
+ hm(e, n, t);
6850
7398
  return;
6851
7399
  }
6852
7400
  if (t.selector || t.target) {
@@ -6857,80 +7405,80 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
6857
7405
  Z("x-ui-stream: received patch with no html");
6858
7406
  return;
6859
7407
  }
6860
- Jf(t.html).forEach((n) => {
7408
+ dm(t.html).forEach((n) => {
6861
7409
  if (!n.id) {
6862
7410
  Z("x-ui-stream: top-level element has no id, skipping", n);
6863
7411
  return;
6864
7412
  }
6865
7413
  let r = document.getElementById(n.id);
6866
- r && Qf(e, r, {
7414
+ r && hm(e, r, {
6867
7415
  ...t,
6868
7416
  html: n.outerHTML
6869
7417
  });
6870
7418
  });
6871
- }, ep = (e, t) => {
7419
+ }, _m = (e, t) => {
6872
7420
  let n = Array.isArray(t) ? t : [t];
6873
7421
  Us(e, n, {
6874
7422
  scope: "target",
6875
7423
  update: () => {
6876
- n.forEach((t) => $f(e, t));
7424
+ n.forEach((t) => gm(e, t));
6877
7425
  }
6878
7426
  });
6879
- }, tp = (e, t) => {
6880
- $f(e, t);
6881
- }, np = (e) => {
7427
+ }, vm = (e, t) => {
7428
+ gm(e, t);
7429
+ }, ym = (e) => {
6882
7430
  document.dispatchEvent(new CustomEvent(e.event, {
6883
7431
  detail: e.detail ?? {},
6884
7432
  bubbles: !0,
6885
7433
  composed: !0
6886
7434
  }));
6887
- }, rp = (e) => typeof e == "object" && !!e, ip = (e) => ({
6888
- ...rp(e) ? e : {},
6889
- [Kf]: !0
6890
- }), ap = (e) => rp(e) && e[Kf] === !0, op = () => {
6891
- ap(window.history.state) || window.history.replaceState(ip(window.history.state), "", window.location.href);
6892
- }, sp = (e) => {
6893
- ap(e.state) && window.location.reload();
6894
- }, cp = (e) => {
7435
+ }, bm = (e) => typeof e == "object" && !!e, xm = (e) => ({
7436
+ ...bm(e) ? e : {},
7437
+ [lm]: !0
7438
+ }), Sm = (e) => bm(e) && e[lm] === !0, Cm = () => {
7439
+ Sm(window.history.state) || window.history.replaceState(xm(window.history.state), "", window.location.href);
7440
+ }, wm = (e) => {
7441
+ Sm(e.state) && window.location.reload();
7442
+ }, Tm = (e) => {
6895
7443
  if (!(e instanceof Element)) return !1;
6896
7444
  let t = e._ajax_target;
6897
7445
  return !!(t && Object.values(t).some((e) => e?.history === "push"));
6898
- }, lp = (e) => {
6899
- cp(e.target) && op();
6900
- }, up = () => {
6901
- Gf ||= (window.addEventListener("popstate", sp), !0);
6902
- }, dp = (e) => {
7446
+ }, Em = (e) => {
7447
+ Tm(e.target) && Cm();
7448
+ }, Dm = () => {
7449
+ cm ||= (window.addEventListener("popstate", wm), !0);
7450
+ }, Om = (e) => {
6903
7451
  let t = e.mode ?? "push";
6904
7452
  if (t === "assign") {
6905
7453
  window.location.assign(e.url);
6906
7454
  return;
6907
7455
  }
6908
- up(), op();
6909
- let n = ip(window.history.state);
7456
+ Dm(), Cm();
7457
+ let n = xm(window.history.state);
6910
7458
  if (t === "replace") {
6911
7459
  window.history.replaceState(n, "", e.url);
6912
7460
  return;
6913
7461
  }
6914
7462
  window.history.pushState(n, "", e.url);
6915
- }, fp = (e, t) => {
7463
+ }, km = (e, t) => {
6916
7464
  if (t.type === "patch") {
6917
7465
  let { type: n, ...r } = t;
6918
- ep(e, r);
7466
+ _m(e, r);
6919
7467
  return;
6920
7468
  }
6921
7469
  if (t.type === "dispatch") {
6922
7470
  let { type: e, ...n } = t;
6923
- np(n);
7471
+ ym(n);
6924
7472
  return;
6925
7473
  }
6926
7474
  if (t.type === "location") {
6927
- dp(t);
7475
+ Om(t);
6928
7476
  return;
6929
7477
  }
6930
7478
  Z("x-ui-stream: unknown UI effect", t);
6931
- }, pp = (e, t) => {
6932
- (Array.isArray(t) ? t : [t]).forEach((t) => fp(e, t));
6933
- }, mp = (e) => typeof e == "object" && !!e && Array.isArray(e.events), hp = (e) => {
7479
+ }, Am = (e, t) => {
7480
+ (Array.isArray(t) ? t : [t]).forEach((t) => km(e, t));
7481
+ }, jm = (e) => typeof e == "object" && !!e && Array.isArray(e.events), Mm = (e) => {
6934
7482
  let t = e instanceof CustomEvent ? e.detail : null, n = t?.headers;
6935
7483
  if (!n) return null;
6936
7484
  let r = n.get("X-Trellis-UI-Events");
@@ -6943,68 +7491,59 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
6943
7491
  if (n.get("X-Trellis-UI-Response") !== "events") return null;
6944
7492
  try {
6945
7493
  let e = JSON.parse(t?.raw ?? "{}");
6946
- return mp(e) ? e.events ?? [] : null;
7494
+ return jm(e) ? e.events ?? [] : null;
6947
7495
  } catch {
6948
7496
  return Z("x-ui-stream: received invalid UI effect response", t?.raw), null;
6949
7497
  }
6950
- }, gp = (e) => {
7498
+ }, Nm = (e) => {
6951
7499
  try {
6952
7500
  return JSON.parse(e.data);
6953
7501
  } catch {
6954
7502
  return Z("x-ui-stream: received invalid JSON", e.data), null;
6955
7503
  }
6956
- }, _p = async (e, t) => {
6957
- let { EventSourcePlus: n } = await import("./chunks/dist-DMX3Q5Zu.js");
6958
- return new n(t).listen({ onMessage(t) {
6959
- if (t.event === "trellis-ui-patch") {
6960
- let n = gp(t);
6961
- n && ep(e, n);
6962
- return;
6963
- }
6964
- if (t.event === "trellis-ui-event") {
6965
- let e = gp(t);
6966
- e && np(e);
6967
- return;
6968
- }
6969
- if (t.event === "trellis-ui-effects") {
6970
- let n = gp(t);
6971
- n && pp(e, n);
6972
- }
6973
- } });
6974
- }, vp = (e) => {
6975
- typeof e.directive == "function" && (up(), e.directive("ui-stream", (t, { expression: n }, { cleanup: r }) => {
7504
+ }, Pm = (e, t) => new rm(t).listen({ onMessage(t) {
7505
+ if (t.event === "trellis-ui-patch") {
7506
+ let n = Nm(t);
7507
+ n && _m(e, n);
7508
+ return;
7509
+ }
7510
+ if (t.event === "trellis-ui-event") {
7511
+ let e = Nm(t);
7512
+ e && ym(e);
7513
+ return;
7514
+ }
7515
+ if (t.event === "trellis-ui-effects") {
7516
+ let n = Nm(t);
7517
+ n && Am(e, n);
7518
+ }
7519
+ } }), Fm = (e) => {
7520
+ typeof e.directive == "function" && (Dm(), e.directive("ui-stream", (t, { expression: n }, { cleanup: r }) => {
6976
7521
  if (!n) return;
6977
- let i = null, a = !1;
6978
- _p(e, n).then((e) => {
6979
- if (a) {
6980
- e.abort();
6981
- return;
6982
- }
6983
- i = e;
6984
- }), r(() => {
6985
- a = !0, i?.abort();
7522
+ let i = null;
7523
+ i = Pm(e, n), r(() => {
7524
+ i?.abort(), i = null;
6986
7525
  });
6987
- }), Wf ||= (document.addEventListener("ajax:success", (t) => {
6988
- lp(t);
6989
- let n = hp(t);
6990
- n && pp(e, n);
7526
+ }), sm ||= (document.addEventListener("ajax:success", (t) => {
7527
+ Em(t);
7528
+ let n = Mm(t);
7529
+ n && Am(e, n);
6991
7530
  }), !0));
6992
- }, yp = [
7531
+ }, Im = [
6993
7532
  "light",
6994
7533
  "dark",
6995
7534
  "system"
6996
- ], bp = (e) => typeof e == "string" && yp.includes(e), xp = (e) => bp(e) ? e : "system", Sp = () => document.documentElement.dataset.themeStorageKey || "trellis-ui-theme", Cp = () => xp(document.documentElement.dataset.theme), wp = () => {
7535
+ ], Lm = (e) => typeof e == "string" && Im.includes(e), Rm = (e) => Lm(e) ? e : "system", zm = () => document.documentElement.dataset.themeStorageKey || "trellis-ui-theme", Bm = () => Rm(document.documentElement.dataset.theme), Vm = () => {
6997
7536
  try {
6998
- return xp(window.localStorage.getItem(Sp()) || Cp());
7537
+ return Rm(window.localStorage.getItem(zm()) || Bm());
6999
7538
  } catch {
7000
- return Cp();
7539
+ return Bm();
7001
7540
  }
7002
- }, Tp = (e) => {
7541
+ }, Hm = (e) => {
7003
7542
  try {
7004
- window.localStorage.setItem(Sp(), e);
7543
+ window.localStorage.setItem(zm(), e);
7005
7544
  } catch {}
7006
- }, Ep = () => window.matchMedia("(prefers-color-scheme: dark)").matches, Dp = (e) => e === "dark" || e === "system" && Ep(), Op = (e) => {
7007
- let t = Dp(e), n = t ? "dark" : "light", r = document.documentElement;
7545
+ }, Um = () => window.matchMedia("(prefers-color-scheme: dark)").matches, Wm = (e) => e === "dark" || e === "system" && Um(), Gm = (e) => {
7546
+ let t = Wm(e), n = t ? "dark" : "light", r = document.documentElement;
7008
7547
  return r.classList.toggle("dark", t), r.dataset.theme = e, r.dataset.resolvedTheme = n, r.dispatchEvent(new CustomEvent("ui:theme-change", {
7009
7548
  detail: {
7010
7549
  mode: e,
@@ -7019,45 +7558,45 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
7019
7558
  dark: t,
7020
7559
  on: t
7021
7560
  };
7022
- }, kp = () => {
7023
- let e = Op(wp());
7561
+ }, Km = () => {
7562
+ let e = Gm(Vm());
7024
7563
  return {
7025
7564
  mode: e.mode,
7026
7565
  resolved: e.resolved,
7027
7566
  dark: e.dark,
7028
7567
  on: e.on,
7029
7568
  set(e) {
7030
- let t = xp(e);
7031
- Tp(t);
7032
- let n = Op(t);
7569
+ let t = Rm(e);
7570
+ Hm(t);
7571
+ let n = Gm(t);
7033
7572
  this.mode = n.mode, this.resolved = n.resolved, this.dark = n.dark, this.on = n.on;
7034
7573
  },
7035
7574
  toggle() {
7036
7575
  this.set(this.dark ? "light" : "dark");
7037
7576
  }
7038
7577
  };
7039
- }, Ap = (e) => {
7578
+ }, qm = (e) => {
7040
7579
  if (typeof e.store != "function") return;
7041
- let t = e.store("theme") ?? kp();
7580
+ let t = e.store("theme") ?? Km();
7042
7581
  e.store("theme", t), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
7043
7582
  if (t.mode !== "system") return;
7044
- let e = Op("system");
7583
+ let e = Gm("system");
7045
7584
  t.mode = e.mode, t.resolved = e.resolved, t.dark = e.dark, t.on = e.on;
7046
7585
  });
7047
- }, jp = 0, Mp = null, Np = () => {
7048
- if (jp === 0) {
7586
+ }, Jm = 0, Ym = null, Xm = () => {
7587
+ if (Jm === 0) {
7049
7588
  let e = document.documentElement, t = document.body, n = Math.max(0, window.innerWidth - e.clientWidth);
7050
- Mp = {
7589
+ Ym = {
7051
7590
  bodyOverflow: t.style.overflow,
7052
7591
  bodyPaddingRight: t.style.paddingRight,
7053
7592
  rootOverflow: e.style.overflow
7054
7593
  }, e.style.overflow = "hidden", t.style.overflow = "hidden", n > 0 && (t.style.paddingRight = `${n}px`), e.setAttribute("data-ui-scroll-locked", "");
7055
7594
  }
7056
- jp += 1;
7057
- }, Pp = () => {
7058
- if (jp === 0 || (--jp, jp > 0)) return;
7595
+ Jm += 1;
7596
+ }, Zm = () => {
7597
+ if (Jm === 0 || (--Jm, Jm > 0)) return;
7059
7598
  let e = document.documentElement, t = document.body;
7060
- t.style.overflow = Mp?.bodyOverflow ?? "", t.style.paddingRight = Mp?.bodyPaddingRight ?? "", e.style.overflow = Mp?.rootOverflow ?? "", e.removeAttribute("data-ui-scroll-locked"), Mp = null;
7599
+ t.style.overflow = Ym?.bodyOverflow ?? "", t.style.paddingRight = Ym?.bodyPaddingRight ?? "", e.style.overflow = Ym?.rootOverflow ?? "", e.removeAttribute("data-ui-scroll-locked"), Ym = null;
7061
7600
  }, Q = {
7062
7601
  createAnchoredPopover: Nl,
7063
7602
  createCollectionNavigation: Bl,
@@ -7085,51 +7624,51 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
7085
7624
  className: Il,
7086
7625
  cx: Ll,
7087
7626
  motion: Ws,
7088
- applyStreamPatch: tp,
7089
- applyStreamPatches: ep,
7090
- applyUiEffect: fp,
7091
- applyUiEffects: pp,
7092
- connectStream: _p,
7093
- dispatchStreamEvent: np,
7094
- applyThemeMode: Op,
7095
- createThemeStore: kp,
7096
- lockDocumentScroll: Np,
7627
+ applyStreamPatch: vm,
7628
+ applyStreamPatches: _m,
7629
+ applyUiEffect: km,
7630
+ applyUiEffects: Am,
7631
+ connectStream: Pm,
7632
+ dispatchStreamEvent: ym,
7633
+ applyThemeMode: Gm,
7634
+ createThemeStore: Km,
7635
+ lockDocumentScroll: Xm,
7097
7636
  registerConfirm: Jl,
7098
7637
  registerResizable: Lf,
7099
- registerStream: vp,
7100
- registerThemeStore: Ap,
7638
+ registerStream: Fm,
7639
+ registerThemeStore: qm,
7101
7640
  unregisterConfirm: Yl,
7102
- unlockDocumentScroll: Pp
7103
- }, Fp = [
7641
+ unlockDocumentScroll: Zm
7642
+ }, Qm = [
7104
7643
  "xs",
7105
7644
  "sm",
7106
7645
  "md",
7107
7646
  "lg",
7108
7647
  "xlg"
7109
- ], Ip = ["outline", "filled"], Lp = [
7648
+ ], $m = ["outline", "filled"], eh = [
7110
7649
  "outline",
7111
7650
  "solid",
7112
7651
  "mini",
7113
7652
  "micro"
7114
- ], Rp = [
7653
+ ], th = [
7115
7654
  "button",
7116
7655
  "submit",
7117
7656
  "reset"
7118
- ], zp = [
7657
+ ], nh = [
7119
7658
  "start",
7120
7659
  "center",
7121
7660
  "end"
7122
- ], Bp = [
7661
+ ], rh = [
7123
7662
  "bottom",
7124
7663
  "top",
7125
7664
  "left",
7126
7665
  "right"
7127
- ], Vp = [
7666
+ ], ih = [
7128
7667
  "top",
7129
7668
  "right",
7130
7669
  "bottom",
7131
7670
  "left"
7132
- ], Hp = ["vertical", "horizontal"], Up = [
7671
+ ], ah = ["vertical", "horizontal"], oh = [
7133
7672
  "leading",
7134
7673
  "trailing",
7135
7674
  "center",
@@ -7137,29 +7676,29 @@ var yf = 60, bf = 1, xf = 8, Sf = 24, Cf = "[x-ui-resizable\\:handle], [data-ui-
7137
7676
  "top-trailing",
7138
7677
  "bottom-leading",
7139
7678
  "bottom-trailing"
7140
- ], Wp = ["default"], Gp = [
7679
+ ], sh = ["default"], ch = [
7141
7680
  "h1",
7142
7681
  "h2",
7143
7682
  "h3",
7144
7683
  "h4",
7145
7684
  "h5",
7146
7685
  "h6"
7147
- ], Kp = {
7686
+ ], lh = {
7148
7687
  inherit: "text-inherit",
7149
7688
  muted: "text-foreground-muted",
7150
7689
  subtle: "text-foreground-subtle",
7151
7690
  accent: "text-accent-text",
7152
7691
  danger: "text-danger-text"
7153
7692
  };
7154
- Kp.muted, Kp.subtle, Kp.accent, Kp.danger;
7155
- var qp = [
7693
+ lh.muted, lh.subtle, lh.accent, lh.danger;
7694
+ var uh = [
7156
7695
  "none",
7157
7696
  "xs",
7158
7697
  "sm",
7159
7698
  "md",
7160
7699
  "lg",
7161
7700
  "full"
7162
- ], Jp = ["solid", "alpha"], Yp = {
7701
+ ], dh = ["solid", "alpha"], fh = {
7163
7702
  none: "bg-transparent text-inherit",
7164
7703
  app: "bg-app text-foreground",
7165
7704
  chrome: "bg-chrome text-foreground",
@@ -7169,10 +7708,10 @@ var qp = [
7169
7708
  overlay: "bg-surface-overlay text-foreground",
7170
7709
  accent: "bg-surface-accent text-surface-accent-fg",
7171
7710
  inverse: "bg-surface-inverse text-surface-inverse-fg"
7172
- }, Xp = {
7711
+ }, ph = {
7173
7712
  solid: "",
7174
7713
  alpha: ""
7175
- }, Zp = {
7714
+ }, mh = {
7176
7715
  xs: {
7177
7716
  none: "",
7178
7717
  xs: "rounded-1",
@@ -7213,53 +7752,53 @@ var qp = [
7213
7752
  lg: "rounded-5",
7214
7753
  full: "rounded-full"
7215
7754
  }
7216
- }, Qp = ((e) => Fp.flatMap((t) => qp.map((n) => ({
7755
+ }, hh = ((e) => Qm.flatMap((t) => uh.map((n) => ({
7217
7756
  when: {
7218
7757
  size: t,
7219
7758
  radius: n
7220
7759
  },
7221
7760
  class: e[t][n]
7222
- }))))(Zp), $p = ["flex w-full min-w-0 items-center gap-control text-control-fg outline-none", "data-disabled:cursor-not-allowed data-disabled:opacity-50"], em = ["data-invalid:focus-within:shadow-danger-focus data-invalid:data-[state=open]:shadow-danger-focus"], tm = {
7761
+ }))))(mh), gh = ["flex w-full min-w-0 items-center gap-control text-control-fg outline-none", "data-disabled:cursor-not-allowed data-disabled:opacity-50"], _h = ["data-invalid:focus-within:shadow-danger-focus data-invalid:data-[state=open]:shadow-danger-focus"], vh = {
7223
7762
  xs: "min-h-control-xs px-1.5 text-xs",
7224
7763
  sm: "min-h-control-sm px-2 text-xs",
7225
7764
  md: "min-h-control-md px-3 text-sm",
7226
7765
  lg: "min-h-control-lg px-3 text-sm",
7227
7766
  xlg: "min-h-control-xlg px-4 text-sm"
7228
- }, nm = {
7767
+ }, yh = {
7229
7768
  outline: "bg-control shadow-control",
7230
7769
  filled: "bg-control-hover shadow-none hover:bg-control-active"
7231
- }, rm = ["border-0 bg-transparent p-0 text-inherit text-control-fg outline-none", "placeholder:text-control-placeholder disabled:cursor-not-allowed"], im = [
7770
+ }, bh = ["border-0 bg-transparent p-0 text-inherit text-control-fg outline-none", "placeholder:text-control-placeholder disabled:cursor-not-allowed"], xh = [
7232
7771
  "inline-flex size-control-xs shrink-0 items-center justify-center rounded-2 border-0 bg-transparent",
7233
7772
  "text-icon outline-none hover:bg-control-hover hover:text-control-fg",
7234
7773
  "focus-visible:ring-2 focus-visible:ring-focus"
7235
- ], am = ["w-full bg-control text-control-fg shadow-control outline-none", "disabled:cursor-not-allowed disabled:opacity-50"], om = ["absolute left-0 top-0 z-popover m-0 grid", "rounded-3 bg-popover text-popover-fg shadow-popover outline-none"], sm = [
7774
+ ], Sh = ["w-full bg-control text-control-fg shadow-control outline-none", "disabled:cursor-not-allowed disabled:opacity-50"], Ch = ["absolute left-0 top-0 z-popover m-0 grid", "rounded-3 bg-popover text-popover-fg shadow-popover outline-none"], wh = [
7236
7775
  "ui-interactive:hover:bg-interactive-hover",
7237
7776
  "ui-interactive:ui-active:bg-interactive-active",
7238
7777
  "ui-interactive:ui-selected:bg-interactive-selected",
7239
7778
  "ui-interactive:ui-selected:hover:bg-interactive-selected-hover"
7240
7779
  ];
7241
- [...sm];
7242
- var cm = [
7780
+ [...wh];
7781
+ var Th = [
7243
7782
  "flex h-menu-item w-full cursor-default select-none items-center gap-2 rounded-2 px-menu-item-x",
7244
7783
  "text-left text-sm font-normal text-menu-item-fg outline-none",
7245
- sm,
7784
+ wh,
7246
7785
  "data-disabled:pointer-events-none data-disabled:opacity-50"
7247
- ], lm = "size-icon shrink-0 fill-current text-current opacity-70", um = "ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100", dm = ["single", "multiple"], fm = Hp, pm = ["trailing", "leading"];
7248
- [...pm];
7249
- var mm = Gp;
7250
- [...mm];
7251
- var hm = {
7252
- mode: J(dm, "single"),
7786
+ ], Eh = "size-icon shrink-0 fill-current text-current opacity-70", Dh = "ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100", Oh = ["single", "multiple"], kh = ah, Ah = ["trailing", "leading"];
7787
+ [...Ah];
7788
+ var jh = ch;
7789
+ [...jh];
7790
+ var Mh = {
7791
+ mode: J(Oh, "single"),
7253
7792
  collapsible: q,
7254
7793
  disabled: q,
7255
- orientation: J(fm, "vertical"),
7794
+ orientation: J(kh, "vertical"),
7256
7795
  defaultValue: G,
7257
7796
  defaultValues: G,
7258
7797
  loop: q.default(!0),
7259
- iconPosition: J(pm, "trailing"),
7260
- headingAs: J(mm, "h3"),
7798
+ iconPosition: J(Ah, "trailing"),
7799
+ headingAs: J(jh, "h3"),
7261
7800
  class: G
7262
- }, gm = Y({ definition: {
7801
+ }, Nh = Y({ definition: {
7263
7802
  component: "ui.accordion",
7264
7803
  parts: {
7265
7804
  root: {
@@ -7283,7 +7822,7 @@ var hm = {
7283
7822
  content: { base: "overflow-hidden text-sm text-foreground-muted" },
7284
7823
  contentInner: { base: "min-w-0 px-3 pb-3 pt-1" }
7285
7824
  }
7286
- } }), _m = (e) => e.split(",").map((e) => e.trim()).filter(Boolean), vm = (e) => e ? "open" : "closed", ym = (e) => e instanceof HTMLButtonElement, bm = () => ({
7825
+ } }), Ph = (e) => e.split(",").map((e) => e.trim()).filter(Boolean), Fh = (e) => e ? "open" : "closed", Ih = (e) => e instanceof HTMLButtonElement, Lh = () => ({
7287
7826
  props: null,
7288
7827
  openValues: /* @__PURE__ */ new Set(),
7289
7828
  collection: null,
@@ -7291,7 +7830,7 @@ var hm = {
7291
7830
  init() {
7292
7831
  this.props = W({
7293
7832
  el: this.$el,
7294
- schema: hm
7833
+ schema: Mh
7295
7834
  }), this.openValues = new Set(this.initialValues()), this.setupTriggers(), this.syncAll();
7296
7835
  },
7297
7836
  destroy() {
@@ -7299,7 +7838,7 @@ var hm = {
7299
7838
  },
7300
7839
  get root() {
7301
7840
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
7302
- part: gm.parts.root,
7841
+ part: Nh.parts.root,
7303
7842
  props: this.props,
7304
7843
  className: this.props.class
7305
7844
  }), {
@@ -7311,7 +7850,7 @@ var hm = {
7311
7850
  items() {
7312
7851
  return Array.from(this.$el.querySelectorAll("[data-ui-accordion-item]")).map((e, t) => {
7313
7852
  let n = e.querySelector("[data-ui-accordion-trigger]"), r = e.querySelector("[data-ui-accordion-content]");
7314
- return !ym(n) || !r ? null : (e.dataset.value || (e.dataset.value = `item-${t + 1}`), {
7853
+ return !Ih(n) || !r ? null : (e.dataset.value || (e.dataset.value = `item-${t + 1}`), {
7315
7854
  item: e,
7316
7855
  heading: e.querySelector("[data-ui-accordion-heading]"),
7317
7856
  trigger: n,
@@ -7325,7 +7864,7 @@ var hm = {
7325
7864
  return this.items().find((t) => t.trigger === e) ?? null;
7326
7865
  },
7327
7866
  initialValues() {
7328
- return this.props.mode === "multiple" && this.props.defaultValues ? this.normalizeValues(_m(this.props.defaultValues)) : this.props.mode === "single" && this.props.defaultValue ? this.normalizeValues([this.props.defaultValue]) : this.normalizeValues(this.items().filter((e) => Q.asBool({ value: e.item.dataset.open }) || e.item.dataset.state === "open").map((e) => e.value));
7867
+ return this.props.mode === "multiple" && this.props.defaultValues ? this.normalizeValues(Ph(this.props.defaultValues)) : this.props.mode === "single" && this.props.defaultValue ? this.normalizeValues([this.props.defaultValue]) : this.normalizeValues(this.items().filter((e) => Q.asBool({ value: e.item.dataset.open }) || e.item.dataset.state === "open").map((e) => e.value));
7329
7868
  },
7330
7869
  normalizeValues(e) {
7331
7870
  let t = Array.from(new Set(e.filter(Boolean)));
@@ -7359,13 +7898,13 @@ var hm = {
7359
7898
  this.$el.dataset.orientation = this.props.orientation, this.$el.dataset.iconPosition = this.props.iconPosition, this.$el.dataset.mode = this.props.mode, this.props.disabled ? this.$el.setAttribute("data-disabled", "") : this.$el.removeAttribute("data-disabled");
7360
7899
  },
7361
7900
  syncItem(e) {
7362
- let t = this.isItemOpen(e), n = vm(t), r = this.isItemDisabled(e), i = t && !this.canCollapseOpenItem(e);
7901
+ let t = this.isItemOpen(e), n = Fh(t), r = this.isItemDisabled(e), i = t && !this.canCollapseOpenItem(e);
7363
7902
  if (e.item.dataset.state = n, e.item.dataset.orientation = this.props.orientation, e.item.className = Q.resolveStyle({
7364
- part: gm.parts.item,
7903
+ part: Nh.parts.item,
7365
7904
  props: this.props,
7366
7905
  className: e.item.dataset.class ?? ""
7367
7906
  }), e.heading?.setAttribute("data-state", n), e.heading?.setAttribute("data-orientation", this.props.orientation), e.trigger.id ||= this.$id(`accordion-trigger-${e.value}`), e.content.id ||= this.$id(`accordion-content-${e.value}`), e.trigger.type = "button", e.trigger.dataset.state = n, e.trigger.dataset.orientation = this.props.orientation, e.trigger.className = Q.resolveStyle({
7368
- part: gm.parts.trigger,
7907
+ part: Nh.parts.trigger,
7369
7908
  props: this.props,
7370
7909
  className: e.trigger.dataset.class ?? ""
7371
7910
  }), e.trigger.setAttribute("aria-expanded", t ? "true" : "false"), e.trigger.setAttribute("aria-controls", e.content.id), e.content.dataset.state = n, e.content.dataset.orientation = this.props.orientation, e.content.setAttribute("aria-labelledby", e.trigger.id), this.syncContent(e.content, t), r) {
@@ -7463,8 +8002,8 @@ var hm = {
7463
8002
  detail: t
7464
8003
  });
7465
8004
  }
7466
- }), xm = (e) => {
7467
- e.data("UiAccordion", () => bm());
8005
+ }), Rh = (e) => {
8006
+ e.data("UiAccordion", () => Lh());
7468
8007
  };
7469
8008
  Y({ definition: {
7470
8009
  component: "ui.button",
@@ -7589,7 +8128,7 @@ Y({ definition: {
7589
8128
  },
7590
8129
  class: "w-control-xlg px-0"
7591
8130
  },
7592
- ...Qp,
8131
+ ...hh,
7593
8132
  {
7594
8133
  when: {
7595
8134
  insetLeft: !0,
@@ -7824,7 +8363,7 @@ Y({ definition: {
7824
8363
  } });
7825
8364
  //#endregion
7826
8365
  //#region src/components/button/index.ts
7827
- var Sm = "[data-ui-button]:not([data-ui-loading-mode=\"false\"])", Cm = [
8366
+ var zh = "[data-ui-button]:not([data-ui-loading-mode=\"false\"])", Bh = [
7828
8367
  "data-on",
7829
8368
  "data-bind",
7830
8369
  "data-ref",
@@ -7833,37 +8372,37 @@ var Sm = "[data-ui-button]:not([data-ui-loading-mode=\"false\"])", Cm = [
7833
8372
  "data-request",
7834
8373
  "data-ui-request",
7835
8374
  "wire:"
7836
- ], wm = ["ui:request-complete", "ui:loading-complete"], Tm = null, Em = (e) => e instanceof HTMLButtonElement || e instanceof HTMLAnchorElement, Dm = (e) => {
8375
+ ], Vh = ["ui:request-complete", "ui:loading-complete"], Hh = null, Uh = (e) => e instanceof HTMLButtonElement || e instanceof HTMLAnchorElement, Wh = (e) => {
7837
8376
  if (!(e instanceof Element)) return null;
7838
- let t = e.closest(Sm);
7839
- return Em(t) ? t : null;
7840
- }, Om = (e) => e.getAttributeNames().some((e) => Cm.some((t) => e.startsWith(t))), km = (e) => e instanceof HTMLButtonElement && e.type === "submit", Am = (e) => e instanceof HTMLButtonElement && (e.dataset.uiConfirm !== void 0 || e.form?.dataset.uiConfirm !== void 0), jm = (e, t) => t?.dataset.uiConfirm !== void 0 || e?.dataset.uiConfirm !== void 0, Mm = (e) => e.dataset.uiLoadingMode === "true" || km(e) || Om(e), Nm = (e) => e.dataset.uiSubmitting === "true" || e.getAttribute("aria-disabled") === "true" || e.hasAttribute("disabled"), Pm = (e) => e.dataset.uiSubmitting === "true" || e.hasAttribute("disabled"), Fm = (e) => {
8377
+ let t = e.closest(zh);
8378
+ return Uh(t) ? t : null;
8379
+ }, Gh = (e) => e.getAttributeNames().some((e) => Bh.some((t) => e.startsWith(t))), Kh = (e) => e instanceof HTMLButtonElement && e.type === "submit", qh = (e) => e instanceof HTMLButtonElement && (e.dataset.uiConfirm !== void 0 || e.form?.dataset.uiConfirm !== void 0), Jh = (e, t) => t?.dataset.uiConfirm !== void 0 || e?.dataset.uiConfirm !== void 0, Yh = (e) => e.dataset.uiLoadingMode === "true" || Kh(e) || Gh(e), Xh = (e) => e.dataset.uiSubmitting === "true" || e.getAttribute("aria-disabled") === "true" || e.hasAttribute("disabled"), Zh = (e) => e.dataset.uiSubmitting === "true" || e.hasAttribute("disabled"), Qh = (e) => {
7841
8380
  e.dataset.uiSubmitting = "true", e.setAttribute("data-ui-loading", ""), e.setAttribute("aria-disabled", "true"), e.setAttribute("aria-busy", "true"), e.dispatchEvent(new CustomEvent("ui:loading-start", { bubbles: !0 })), e instanceof HTMLButtonElement ? e.disabled = !0 : e.tabIndex = -1;
7842
- }, Im = (e) => {
8381
+ }, $h = (e) => {
7843
8382
  e.dataset.initialLoading !== "true" && (delete e.dataset.uiSubmitting, e.removeAttribute("data-ui-loading"), e.removeAttribute("aria-busy"), e.dataset.initialDisabled !== "true" && (e.removeAttribute("aria-disabled"), e instanceof HTMLButtonElement ? e.disabled = !1 : e.removeAttribute("tabindex"), e.dispatchEvent(new CustomEvent("ui:loading-end", { bubbles: !0 }))));
7844
- }, Lm = (e, t) => {
8383
+ }, eg = (e, t) => {
7845
8384
  window.setTimeout(() => {
7846
- !e.isConnected || Pm(e) || Fm(e);
8385
+ !e.isConnected || Zh(e) || Qh(e);
7847
8386
  }, 0);
7848
- }, Rm = (e) => {
7849
- let t = Dm(e.target);
7850
- if (!(!t || !Mm(t))) {
7851
- if (Nm(t)) {
8387
+ }, tg = (e) => {
8388
+ let t = Wh(e.target);
8389
+ if (!(!t || !Yh(t))) {
8390
+ if (Xh(t)) {
7852
8391
  e.preventDefault(), e.stopImmediatePropagation();
7853
8392
  return;
7854
8393
  }
7855
- t instanceof HTMLButtonElement && t.form && !t.form.checkValidity() || Am(t) || Lm(t, e);
8394
+ t instanceof HTMLButtonElement && t.form && !t.form.checkValidity() || qh(t) || eg(t, e);
7856
8395
  }
7857
- }, zm = (e) => {
7858
- let t = e, n = t.submitter instanceof HTMLElement ? t.submitter : null, r = Em(n) ? n : null, i = e.target instanceof HTMLFormElement ? e.target : null, a = r ? r.matches(Sm) ? r : null : i?.querySelector(Sm) ?? null;
7859
- e.defaultPrevented && jm(i, n) || !a || !km(a) || Lm(a, e);
7860
- }, Bm = () => {
7861
- document.querySelectorAll("[data-ui-button][data-ui-submitting=\"true\"]").forEach((e) => Im(e));
7862
- }, Vm = () => {
7863
- Tm ||= (document.addEventListener("click", Rm, !0), document.addEventListener("submit", zm, !0), wm.forEach((e) => document.addEventListener(e, Bm)), () => {
7864
- document.removeEventListener("click", Rm, !0), document.removeEventListener("submit", zm, !0), wm.forEach((e) => document.removeEventListener(e, Bm)), Tm = null;
8396
+ }, ng = (e) => {
8397
+ let t = e, n = t.submitter instanceof HTMLElement ? t.submitter : null, r = Uh(n) ? n : null, i = e.target instanceof HTMLFormElement ? e.target : null, a = r ? r.matches(zh) ? r : null : i?.querySelector(zh) ?? null;
8398
+ e.defaultPrevented && Jh(i, n) || !a || !Kh(a) || eg(a, e);
8399
+ }, rg = () => {
8400
+ document.querySelectorAll("[data-ui-button][data-ui-submitting=\"true\"]").forEach((e) => $h(e));
8401
+ }, ig = () => {
8402
+ Hh ||= (document.addEventListener("click", tg, !0), document.addEventListener("submit", ng, !0), Vh.forEach((e) => document.addEventListener(e, rg)), () => {
8403
+ document.removeEventListener("click", tg, !0), document.removeEventListener("submit", ng, !0), Vh.forEach((e) => document.removeEventListener(e, rg)), Hh = null;
7865
8404
  });
7866
- }, Hm = Hp, Um = Wp, Wm = Up, Gm = Fp, Km = Wp, qm = {
8405
+ }, ag = ah, og = sh, sg = oh, cg = Qm, lg = sh, ug = {
7867
8406
  value: G.default("on"),
7868
8407
  name: G,
7869
8408
  label: G,
@@ -7874,10 +8413,10 @@ var Sm = "[data-ui-button]:not([data-ui-loading-mode=\"false\"])", Cm = [
7874
8413
  required: q,
7875
8414
  invalid: q,
7876
8415
  indicator: q.default(!0),
7877
- placement: J(Wm, "leading"),
8416
+ placement: J(sg, "leading"),
7878
8417
  icon: G,
7879
- variant: J(Km, "default"),
7880
- size: J(Gm, "md"),
8418
+ variant: J(lg, "default"),
8419
+ size: J(cg, "md"),
7881
8420
  inputClass: G,
7882
8421
  indicatorClass: G,
7883
8422
  indicatorIconClass: G,
@@ -7887,22 +8426,22 @@ var Sm = "[data-ui-button]:not([data-ui-loading-mode=\"false\"])", Cm = [
7887
8426
  descriptionClass: G,
7888
8427
  class: G
7889
8428
  };
7890
- ({ ...qm });
7891
- var Jm = {
8429
+ ({ ...ug });
8430
+ var dg = {
7892
8431
  name: G,
7893
- orientation: J(Hm, "vertical"),
7894
- variant: J(Um, "default"),
8432
+ orientation: J(ag, "vertical"),
8433
+ variant: J(og, "default"),
7895
8434
  indicator: q.default(!0),
7896
- placement: J(Wm, "leading"),
8435
+ placement: J(sg, "leading"),
7897
8436
  disabled: q,
7898
8437
  required: q,
7899
8438
  invalid: q,
7900
8439
  class: G
7901
8440
  };
7902
- J(Gm, "md");
8441
+ J(cg, "md");
7903
8442
  //#endregion
7904
8443
  //#region src/components/checkbox/index.ts
7905
- var Ym = (e) => {
8444
+ var fg = (e) => {
7906
8445
  let t = e.querySelector("[data-ui-checkbox-input]");
7907
8446
  return t ? {
7908
8447
  root: e,
@@ -7915,7 +8454,7 @@ var Ym = (e) => {
7915
8454
  required: e.hasAttribute("data-required") || t.required,
7916
8455
  invalid: e.hasAttribute("data-invalid") || t.getAttribute("aria-invalid") === "true"
7917
8456
  } : null;
7918
- }, Xm = (e, t = {}) => {
8457
+ }, pg = (e, t = {}) => {
7919
8458
  let n = t.disabled ?? e.disabled, r = t.required ?? e.required, i = t.invalid ?? e.invalid, a = e.input.indeterminate || e.root.hasAttribute("data-indeterminate"), o = e.input.checked && !a, s = a ? "indeterminate" : o ? "checked" : "unchecked";
7920
8459
  e.input.indeterminate = a, Q.syncNativeControl({
7921
8460
  input: e.input,
@@ -7982,13 +8521,13 @@ var Ym = (e) => {
7982
8521
  el: e.indeterminateIcon,
7983
8522
  attr: "data-checked"
7984
8523
  }));
7985
- }, Zm = () => ({
8524
+ }, mg = () => ({
7986
8525
  props: null,
7987
8526
  listeners: [],
7988
8527
  init() {
7989
8528
  this.props = W({
7990
8529
  el: this.$el,
7991
- schema: qm
8530
+ schema: ug
7992
8531
  });
7993
8532
  let e = this.input();
7994
8533
  (this.props.indeterminate || this.$el.hasAttribute("data-indeterminate")) && (e.indeterminate = !0), Q.addListener({
@@ -8009,26 +8548,26 @@ var Ym = (e) => {
8009
8548
  return e;
8010
8549
  },
8011
8550
  item() {
8012
- let e = Ym(this.$el);
8551
+ let e = fg(this.$el);
8013
8552
  if (!e) throw Error("Checkbox requires a native checkbox input.");
8014
8553
  return e;
8015
8554
  },
8016
8555
  sync() {
8017
8556
  let e = this.item();
8018
- this.props.name && (e.input.name = this.props.name), this.props.value && (e.input.value = this.props.value), Xm(e, {
8557
+ this.props.name && (e.input.name = this.props.name), this.props.value && (e.input.value = this.props.value), pg(e, {
8019
8558
  disabled: this.props.disabled || e.disabled,
8020
8559
  required: this.props.required || e.required,
8021
8560
  invalid: this.props.invalid || e.invalid
8022
8561
  });
8023
8562
  }
8024
- }), Qm = () => ({
8563
+ }), hg = () => ({
8025
8564
  props: null,
8026
8565
  listeners: [],
8027
8566
  observer: null,
8028
8567
  init() {
8029
8568
  this.props = W({
8030
8569
  el: this.$el,
8031
- schema: Jm
8570
+ schema: dg
8032
8571
  }), Q.addListener({
8033
8572
  target: this.$el,
8034
8573
  event: "change",
@@ -8046,7 +8585,7 @@ var Ym = (e) => {
8046
8585
  this.props.disconnect(), this.listeners.forEach((e) => e()), this.listeners = [], this.observer?.disconnect();
8047
8586
  },
8048
8587
  items() {
8049
- return Array.from(this.$el.querySelectorAll("[data-ui-checkbox]")).map(Ym).filter((e) => e !== null);
8588
+ return Array.from(this.$el.querySelectorAll("[data-ui-checkbox]")).map(fg).filter((e) => e !== null);
8050
8589
  },
8051
8590
  sync() {
8052
8591
  let e = this.$el;
@@ -8064,15 +8603,15 @@ var Ym = (e) => {
8064
8603
  }), this.items().forEach((e) => this.syncItem(e));
8065
8604
  },
8066
8605
  syncItem(e) {
8067
- this.props.name && !e.name && (e.input.name = this.props.name), Xm(e, {
8606
+ this.props.name && !e.name && (e.input.name = this.props.name), pg(e, {
8068
8607
  disabled: this.props.disabled || e.disabled,
8069
8608
  required: this.props.required || e.required,
8070
8609
  invalid: this.props.invalid || e.invalid
8071
8610
  });
8072
8611
  }
8073
- }), $m = (e) => {
8074
- e.data("UiCheckbox", () => Zm()), e.data("UiCheckboxGroup", () => Qm());
8075
- }, eh = Fp, th = Ip, nh = qp, rh = Bp, ih = zp, ah = Lp, oh = {
8612
+ }), gg = (e) => {
8613
+ e.data("UiCheckbox", () => mg()), e.data("UiCheckboxGroup", () => hg());
8614
+ }, _g = Qm, vg = $m, yg = uh, bg = rh, xg = nh, Sg = eh, Cg = {
8076
8615
  name: G,
8077
8616
  value: G,
8078
8617
  values: G,
@@ -8088,40 +8627,40 @@ var Ym = (e) => {
8088
8627
  filter: q.default(!0),
8089
8628
  path: G,
8090
8629
  loop: q.default(!0),
8091
- size: J(eh, "lg"),
8092
- variant: J(th, "outline"),
8093
- radius: J(nh, "md"),
8094
- side: J(rh, "bottom"),
8095
- align: J(ih, "start"),
8630
+ size: J(_g, "lg"),
8631
+ variant: J(vg, "outline"),
8632
+ radius: J(yg, "md"),
8633
+ side: J(bg, "bottom"),
8634
+ align: J(xg, "start"),
8096
8635
  offset: K.clamp(-100, 100).default(0),
8097
8636
  gap: K.clamp(0, 50).default(4),
8098
8637
  icon: G,
8099
8638
  iconTrailing: G.default("chevron__down"),
8100
- iconVariant: J(ah, "outline"),
8639
+ iconVariant: J(Sg, "outline"),
8101
8640
  inputClass: G,
8102
8641
  listboxClass: G,
8103
8642
  chipClass: G,
8104
8643
  class: G
8105
8644
  };
8106
- J(ah, "outline");
8645
+ J(Sg, "outline");
8107
8646
  //#endregion
8108
8647
  //#region src/components/combobox/styles.ts
8109
- var sh = Y({ definition: {
8648
+ var wg = Y({ definition: {
8110
8649
  component: "ui.combobox",
8111
8650
  parts: {
8112
8651
  root: { base: "relative inline-grid w-full min-w-0" },
8113
8652
  control: {
8114
- base: $p,
8653
+ base: gh,
8115
8654
  variants: {
8116
- size: tm,
8117
- variant: nm
8655
+ size: vh,
8656
+ variant: yh
8118
8657
  },
8119
8658
  defaults: {
8120
8659
  size: "lg",
8121
8660
  variant: "outline",
8122
8661
  radius: "md"
8123
8662
  },
8124
- compounds: Qp
8663
+ compounds: hh
8125
8664
  },
8126
8665
  chips: { base: "-ml-1.5 flex min-w-0 flex-wrap items-center gap-1" },
8127
8666
  chip: { base: ["inline-flex h-control-sm max-w-48 min-w-0 items-center gap-1 rounded-2 border border-border bg-current/10 px-2", "text-sm font-normal text-foreground"] },
@@ -8131,7 +8670,7 @@ var sh = Y({ definition: {
8131
8670
  "text-icon outline-none hover:bg-base-a3 hover:text-foreground",
8132
8671
  "focus-visible:ring-2 focus-visible:ring-focus"
8133
8672
  ] },
8134
- input: { base: ["w-full min-w-16 flex-1", rm] },
8673
+ input: { base: ["w-full min-w-16 flex-1", bh] },
8135
8674
  icon: {
8136
8675
  base: "size-icon shrink-0 fill-current text-icon",
8137
8676
  variants: { position: {
@@ -8140,27 +8679,27 @@ var sh = Y({ definition: {
8140
8679
  } },
8141
8680
  defaults: { position: "leading" }
8142
8681
  },
8143
- clear: { base: im },
8144
- listbox: { base: [om, "auto-rows-min content-start max-h-combobox-listbox min-w-48 gap-1 overflow-auto p-popover"] },
8145
- option: { base: cm },
8682
+ clear: { base: xh },
8683
+ listbox: { base: [Ch, "auto-rows-min content-start max-h-combobox-listbox min-w-48 gap-1 overflow-auto p-popover"] },
8684
+ option: { base: Th },
8146
8685
  optionLabel: { base: "min-w-0 flex-1" },
8147
8686
  optionMeta: { base: "ml-auto text-menu-item-muted" },
8148
8687
  optionIcon: {
8149
- base: lm,
8688
+ base: Eh,
8150
8689
  variants: { position: {
8151
8690
  leading: "",
8152
8691
  trailing: "ml-auto"
8153
8692
  } },
8154
8693
  defaults: { position: "leading" }
8155
8694
  },
8156
- optionIndicator: { base: um },
8695
+ optionIndicator: { base: Dh },
8157
8696
  group: { base: "grid auto-rows-min content-start gap-1" },
8158
8697
  label: { base: "px-menu-item-x py-1 text-menu-heading-fg" },
8159
8698
  empty: { base: "px-menu-item-x py-2 text-sm text-foreground-muted" },
8160
8699
  separatorRoot: { base: "-mx-popover my-popover h-px" },
8161
8700
  separatorRule: { base: "h-px w-full border-0 bg-menu-separator" }
8162
8701
  }
8163
- } }), ch = () => ({
8702
+ } }), Tg = () => ({
8164
8703
  isOpen: !1,
8165
8704
  query: "",
8166
8705
  selectedValues: [],
@@ -8178,7 +8717,7 @@ var sh = Y({ definition: {
8178
8717
  init() {
8179
8718
  this.props = W({
8180
8719
  el: this.$el,
8181
- schema: oh
8720
+ schema: Cg
8182
8721
  }), this.inputId = this.$id("combobox-input"), this.listboxId = this.$id("combobox-listbox"), this.isOpen = this.props.open;
8183
8722
  let e = this.options(), t = this.props.multiple ? [...Q.splitControlValues(this.props.values), ...Q.splitControlValues(this.props.value)] : Q.splitControlValues(this.props.value).slice(0, 1), n = e.filter((e) => Q.asBool({ value: e.el.dataset.selected })).map((e) => e.value);
8184
8723
  this.selectedValues = t.length > 0 ? t : n, this.props.multiple || (this.selectedValues = this.selectedValues.slice(0, 1)), this.selectedLabels = this.selectedValues.map((t) => e.find((e) => e.value === t)?.label ?? t), this.query = this.props.multiple ? "" : this.selectedLabels[0] ?? "", this.popover = Q.createAnchoredPopover({
@@ -8199,7 +8738,7 @@ var sh = Y({ definition: {
8199
8738
  },
8200
8739
  get root() {
8201
8740
  return Q.mergeBindings({ inputs: [X({
8202
- part: sh.parts.root,
8741
+ part: wg.parts.root,
8203
8742
  props: this.props,
8204
8743
  className: this.props.class
8205
8744
  }), {
@@ -8268,18 +8807,7 @@ var sh = Y({ definition: {
8268
8807
  close(e) {
8269
8808
  e?.preventDefault();
8270
8809
  let t = this.isOpen;
8271
- this.isOpen = !1, this.activeValue = "", !this.props.multiple && this.hasSelection() && (this.query = this.selectedLabels[0] ?? ""), this.sync(), t && this.listboxMotion?.exit({
8272
- before: () => {
8273
- let e = this.listbox();
8274
- e.dataset.state = "closed", e.hidden = !1;
8275
- },
8276
- after: () => {
8277
- this.isOpen || (this.listbox().hidePopover?.(), this.unmount(), this.syncListbox(), Q.dispatch({
8278
- el: this.$el,
8279
- name: "ui:close"
8280
- }));
8281
- }
8282
- });
8810
+ this.isOpen = !1, this.activeValue = "", !this.props.multiple && this.hasSelection() && (this.query = this.selectedLabels[0] ?? ""), this.syncClosedState(), t && this.exitListbox();
8283
8811
  },
8284
8812
  toggle(e) {
8285
8813
  if (e?.preventDefault(), !(this.props.readonly || this.props.disabled)) {
@@ -8458,7 +8986,7 @@ var sh = Y({ definition: {
8458
8986
  },
8459
8987
  syncControl() {
8460
8988
  let e = this.control(), t = X({
8461
- part: sh.parts.control,
8989
+ part: wg.parts.control,
8462
8990
  props: this.props
8463
8991
  });
8464
8992
  e.setAttribute("class", t), e.setAttribute("data-ui-control", ""), e.setAttribute("data-ui-combobox-control", ""), e.dataset.state = this.isOpen ? "open" : "closed", e.dataset.variant = this.props.variant, Q.syncControlPresence({
@@ -8472,12 +9000,15 @@ var sh = Y({ definition: {
8472
9000
  },
8473
9001
  syncListbox() {
8474
9002
  let e = this.listbox(), t = X({
8475
- part: sh.parts.listbox,
9003
+ part: wg.parts.listbox,
8476
9004
  props: this.props,
8477
9005
  className: this.props.listboxClass
8478
9006
  });
8479
9007
  e.id = this.listboxId, e.setAttribute("class", t), e.setAttribute("role", "listbox"), e.setAttribute("tabindex", "-1"), e.setAttribute("popover", "manual"), e.setAttribute("data-ui-combobox-listbox", ""), e.dataset.state = this.isOpen ? "open" : "closed", e.hidden = !this.isOpen, this.props.multiple ? e.setAttribute("aria-multiselectable", "true") : e.removeAttribute("aria-multiselectable");
8480
9008
  },
9009
+ syncClosedState() {
9010
+ this.syncControl(), this.syncInput(), this.syncOptions(), this.syncHiddenInputs(), this.syncChips();
9011
+ },
8481
9012
  syncHiddenInputs() {
8482
9013
  let e = this.hiddenInputsEl();
8483
9014
  e && (this.renderedHiddenInputsKey = Q.syncRepeatedHiddenInputs({
@@ -8505,10 +9036,10 @@ var sh = Y({ definition: {
8505
9036
  });
8506
9037
  if (n === this.renderedChipsKey || (this.renderedChipsKey = n, e.replaceChildren(), e.hidden)) return;
8507
9038
  let r = X({
8508
- part: sh.parts.chip,
9039
+ part: wg.parts.chip,
8509
9040
  props: {},
8510
9041
  className: this.props.chipClass
8511
- }), i = X({ part: sh.parts.chipLabel }), a = X({ part: sh.parts.chipRemove });
9042
+ }), i = X({ part: wg.parts.chipLabel }), a = X({ part: wg.parts.chipRemove });
8512
9043
  this.selectedValues.forEach((t, n) => {
8513
9044
  let o = this.selectedLabels[n] ?? t, s = document.createElement("span");
8514
9045
  s.className = r, s.setAttribute("data-ui-combobox-chip", "");
@@ -8529,6 +9060,26 @@ var sh = Y({ definition: {
8529
9060
  unmount() {
8530
9061
  this.popover?.unmount();
8531
9062
  },
9063
+ exitListbox() {
9064
+ let e = () => {
9065
+ let e = this.listbox();
9066
+ e.dataset.state = "closed", e.hidden = !1;
9067
+ };
9068
+ if (!this.listboxMotion) {
9069
+ e(), this.finishClose();
9070
+ return;
9071
+ }
9072
+ this.listboxMotion.exit({
9073
+ before: e,
9074
+ after: () => this.finishClose()
9075
+ });
9076
+ },
9077
+ finishClose() {
9078
+ this.isOpen || (this.listbox().hidePopover?.(), this.unmount(), this.syncListbox(), Q.dispatch({
9079
+ el: this.$el,
9080
+ name: "ui:close"
9081
+ }));
9082
+ },
8532
9083
  setup() {
8533
9084
  let e = this.input(), t = this.control(), n = this.listbox();
8534
9085
  Q.addListener({
@@ -8624,23 +9175,23 @@ var sh = Y({ definition: {
8624
9175
  optionValue(e, t) {
8625
9176
  return e.dataset.value || t;
8626
9177
  }
8627
- }), lh = (e) => {
8628
- e.data("UiCombobox", () => ch());
8629
- }, uh = ["single", "range"], dh = ["enhanced", "native"], fh = [
9178
+ }), Eg = (e) => {
9179
+ e.data("UiCombobox", () => Tg());
9180
+ }, Dg = ["single", "range"], Og = ["enhanced", "native"], kg = [
8630
9181
  "popover",
8631
9182
  "modal",
8632
9183
  "native"
8633
- ], ph = ["select", "confirm"], mh = ["neutral", "accent"], hh = qp, gh = [
9184
+ ], Ag = ["select", "confirm"], jg = ["neutral", "accent"], Mg = uh, Ng = [
8634
9185
  "left",
8635
9186
  "right",
8636
9187
  "top",
8637
9188
  "bottom"
8638
- ], _h = {
9189
+ ], Pg = {
8639
9190
  name: G,
8640
9191
  value: G,
8641
9192
  startName: G,
8642
9193
  endName: G,
8643
- mode: J(uh, "single"),
9194
+ mode: J(Dg, "single"),
8644
9195
  placeholder: G,
8645
9196
  min: G,
8646
9197
  max: G,
@@ -8660,17 +9211,17 @@ var sh = Y({ definition: {
8660
9211
  readonly: q,
8661
9212
  required: q,
8662
9213
  invalid: q,
8663
- side: J(Bp, "bottom"),
8664
- align: J(zp, "start"),
9214
+ side: J(rh, "bottom"),
9215
+ align: J(nh, "start"),
8665
9216
  offset: K.clamp(-100, 100).default(0),
8666
9217
  gap: K.clamp(0, 50).default(4),
8667
- mobile: J(fh, "modal"),
8668
- variant: J(dh, "enhanced"),
8669
- color: J(mh, "neutral"),
8670
- radius: J(hh, "md"),
8671
- close: J(ph, "select"),
9218
+ mobile: J(kg, "modal"),
9219
+ variant: J(Og, "enhanced"),
9220
+ color: J(jg, "neutral"),
9221
+ radius: J(Mg, "md"),
9222
+ close: J(Ag, "select"),
8672
9223
  presets: vu.array([]),
8673
- presetsPosition: J(gh, "left"),
9224
+ presetsPosition: J(Ng, "left"),
8674
9225
  preset: G,
8675
9226
  presetName: G,
8676
9227
  triggerClass: G,
@@ -8682,22 +9233,22 @@ var sh = Y({ definition: {
8682
9233
  class: G,
8683
9234
  form: G
8684
9235
  };
8685
- J(gh, "left");
9236
+ J(Ng, "left");
8686
9237
  //#endregion
8687
9238
  //#region src/components/date-picker/styles.ts
8688
- var vh = Y({ definition: {
9239
+ var Fg = Y({ definition: {
8689
9240
  component: "ui.date-picker",
8690
9241
  parts: {
8691
9242
  root: { base: "relative inline-grid w-full min-w-0" },
8692
9243
  trigger: {
8693
9244
  base: [
8694
- $p,
8695
- em,
8696
- tm.lg,
8697
- nm.outline,
9245
+ gh,
9246
+ _h,
9247
+ vh.lg,
9248
+ yh.outline,
8698
9249
  "text-left"
8699
9250
  ],
8700
- variants: { radius: Zp.lg },
9251
+ variants: { radius: mh.lg },
8701
9252
  defaults: { radius: "md" }
8702
9253
  },
8703
9254
  customTrigger: {
@@ -8707,13 +9258,13 @@ var vh = Y({ definition: {
8707
9258
  "focus-visible:ring-2 focus-visible:ring-focus",
8708
9259
  "data-disabled:cursor-not-allowed data-disabled:opacity-50"
8709
9260
  ],
8710
- variants: { radius: Zp.lg },
9261
+ variants: { radius: mh.lg },
8711
9262
  defaults: { radius: "md" }
8712
9263
  },
8713
- input: { base: ["min-w-0 flex-1 text-sm", rm] },
9264
+ input: { base: ["min-w-0 flex-1 text-sm", bh] },
8714
9265
  icon: { base: "size-icon shrink-0 fill-current text-icon" },
8715
- action: { base: im },
8716
- popover: { base: [om, "max-h-lg overflow-hidden"] },
9266
+ action: { base: xh },
9267
+ popover: { base: [Ch, "max-h-lg overflow-hidden"] },
8717
9268
  panel: {
8718
9269
  base: "grid min-w-72 max-w-[calc(100vw-2rem)] gap-0 overflow-hidden",
8719
9270
  variants: {
@@ -8749,35 +9300,35 @@ var vh = Y({ definition: {
8749
9300
  calendarWrap: { base: "relative grid size-full place-items-center overflow-x-auto overflow-y-auto p-popover" },
8750
9301
  calendar: { base: "grid max-w-full gap-2 text-sm text-foreground" },
8751
9302
  presets: { base: ["grid content-start gap-1 border-popover-border p-popover", "sm:data-[position=left]:border-r sm:data-[position=right]:border-l data-[position=top]:border-b data-[position=bottom]:border-t"] },
8752
- preset: { base: cm },
9303
+ preset: { base: Th },
8753
9304
  footer: { base: "flex items-center justify-end gap-2 border-t border-popover-border p-popover" },
8754
9305
  nativeWrapper: { base: "relative w-full min-w-0" },
8755
9306
  native: {
8756
- base: [am, tm.lg],
8757
- variants: { radius: Zp.lg },
9307
+ base: [Sh, vh.lg],
9308
+ variants: { radius: mh.lg },
8758
9309
  defaults: { radius: "md" }
8759
9310
  }
8760
9311
  }
8761
- } }), yh = /^\d{4}-\d{2}-\d{2}$/, bh = /^\d{4}-\d{2}-\d{2}\/\d{4}-\d{2}-\d{2}$/, xh = 100, Sh = 10, Ch = null, wh = () => typeof customElements > "u" || customElements.get("calendar-ctx") ? Promise.resolve() : (Ch ??= import("./chunks/cally-TZl4LpyH.js").then(() => void 0).catch((e) => {
9312
+ } }), Ig = /^\d{4}-\d{2}-\d{2}$/, Lg = /^\d{4}-\d{2}-\d{2}\/\d{4}-\d{2}-\d{2}$/, Rg = 100, zg = 10, Bg = null, Vg = () => typeof customElements > "u" || customElements.get("calendar-ctx") ? Promise.resolve() : (Bg ??= import("./chunks/cally-TZl4LpyH.js").then(() => void 0).catch((e) => {
8762
9313
  if (!customElements.get("calendar-ctx")) throw e;
8763
- }), Ch), Th = (e) => {
9314
+ }), Bg), Hg = (e) => {
8764
9315
  let [t = "", n = ""] = e.split("/");
8765
9316
  return [t, n];
8766
- }, Eh = (e, t) => e === "" || (t ? bh.test(e) : yh.test(e)), Dh = () => (/* @__PURE__ */ new Date()).getFullYear(), Oh = () => `${Dh() - xh}-01-01`, kh = () => `${Dh() + Sh}-12-31`, Ah = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), jh = (e, t) => {
8767
- if (!e.match(yh)) return "";
9317
+ }, Ug = (e, t) => e === "" || (t ? Lg.test(e) : Ig.test(e)), Wg = () => (/* @__PURE__ */ new Date()).getFullYear(), Gg = () => `${Wg() - Rg}-01-01`, Kg = () => `${Wg() + zg}-12-31`, qg = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), Jg = (e, t) => {
9318
+ if (!e.match(Ig)) return "";
8768
9319
  let n = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
8769
9320
  return new Intl.DateTimeFormat(t || void 0, {
8770
9321
  month: "long",
8771
9322
  timeZone: "UTC",
8772
9323
  year: "numeric"
8773
9324
  }).format(n);
8774
- }, Mh = (e) => ({
9325
+ }, Yg = (e) => ({
8775
9326
  value: e.dataset.value ?? "",
8776
9327
  label: e.dataset.label ?? e.textContent?.trim() ?? "",
8777
9328
  start: e.dataset.start ?? "",
8778
9329
  end: e.dataset.end ?? "",
8779
9330
  disabled: Q.asBool({ value: e.dataset.disabled })
8780
- }), Nh = () => ({
9331
+ }), Xg = () => ({
8781
9332
  isOpen: !1,
8782
9333
  value: "",
8783
9334
  pendingValue: "",
@@ -8794,7 +9345,7 @@ var vh = Y({ definition: {
8794
9345
  init() {
8795
9346
  this.props = W({
8796
9347
  el: this.$el,
8797
- schema: _h
9348
+ schema: Pg
8798
9349
  }), this.value = this.props.value, this.pendingValue = this.value, this.presetValue = this.props.preset, this.triggerId = this.$id("date-picker-trigger"), this.popoverId = this.$id("date-picker-popover"), this.popover = Q.createAnchoredPopover({
8799
9350
  reference: () => this.trigger(),
8800
9351
  floating: () => this.popoverEl(),
@@ -8806,14 +9357,14 @@ var vh = Y({ definition: {
8806
9357
  }), this.popoverMotion = Q.motion.createPresenceLifecycle({
8807
9358
  element: () => this.popoverEl(),
8808
9359
  preset: "popover"
8809
- }), this.setup(), this.sync(), wh().then(() => this.sync());
9360
+ }), this.setup(), this.sync(), Vg().then(() => this.sync());
8810
9361
  },
8811
9362
  destroy() {
8812
9363
  this.props.disconnect(), this.popoverMotion?.destroy(), this.listeners.forEach((e) => e()), this.listeners = [], this.popover?.unmount();
8813
9364
  },
8814
9365
  get root() {
8815
9366
  return Q.mergeBindings({ inputs: [X({
8816
- part: vh.parts.root,
9367
+ part: Fg.parts.root,
8817
9368
  props: this.props,
8818
9369
  className: this.props.class
8819
9370
  }), {
@@ -8852,7 +9403,7 @@ var vh = Y({ definition: {
8852
9403
  return this.$el.querySelector("[data-ui-date-picker-preset-inputs]");
8853
9404
  },
8854
9405
  presetItems() {
8855
- let e = Array.from(this.$el.querySelectorAll("[data-ui-date-picker-preset]")).map(Mh).filter((e) => e.value && e.start && e.end);
9406
+ let e = Array.from(this.$el.querySelectorAll("[data-ui-date-picker-preset]")).map(Yg).filter((e) => e.value && e.start && e.end);
8856
9407
  return e.length ? e : this.props.presets;
8857
9408
  },
8858
9409
  isRange() {
@@ -8864,7 +9415,7 @@ var vh = Y({ definition: {
8864
9415
  displayValue() {
8865
9416
  if (!this.value) return "";
8866
9417
  if (!this.isRange()) return this.value;
8867
- let [e, t] = Th(this.value);
9418
+ let [e, t] = Hg(this.value);
8868
9419
  return e && t ? `${e} to ${t}` : this.value;
8869
9420
  },
8870
9421
  effectivePlaceholder() {
@@ -8879,7 +9430,7 @@ var vh = Y({ definition: {
8879
9430
  this.isOpen = !0, this.pendingValue = this.value, this.sync(), t || this.popoverMotion?.enter({ before: () => {
8880
9431
  let e = this.popoverEl();
8881
9432
  e.hidden = !1, e.showPopover?.(), this.popover?.mount();
8882
- } }), e instanceof KeyboardEvent && wh().then(() => {
9433
+ } }), e instanceof KeyboardEvent && Vg().then(() => {
8883
9434
  queueMicrotask(() => this.calendar()?.focus({ preventScroll: !0 }));
8884
9435
  }), Q.dispatch({
8885
9436
  el: this.$el,
@@ -8940,7 +9491,7 @@ var vh = Y({ definition: {
8940
9491
  },
8941
9492
  selectPreset(e, t) {
8942
9493
  t?.preventDefault();
8943
- let n = Mh(e);
9494
+ let n = Yg(e);
8944
9495
  if (n.disabled) return;
8945
9496
  let r = this.isRange() ? `${n.start}/${n.end}` : n.start;
8946
9497
  this.presetValue = n.value, this.commitValue(r), this.close();
@@ -8949,7 +9500,7 @@ var vh = Y({ definition: {
8949
9500
  let t = e.target;
8950
9501
  if (!(t instanceof HTMLInputElement)) return;
8951
9502
  let n = t.value.trim(), r = this.isRange() ? n.replace(/\s+to\s+/i, "/") : n;
8952
- Eh(r, this.isRange()) && r !== this.value && this.commitValue(r);
9503
+ Ug(r, this.isRange()) && r !== this.value && this.commitValue(r);
8953
9504
  },
8954
9505
  handleKeydown(e) {
8955
9506
  if ((e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && !this.isOpen) {
@@ -8960,7 +9511,7 @@ var vh = Y({ definition: {
8960
9511
  },
8961
9512
  handleCalendarChange(e) {
8962
9513
  let t = e.currentTarget;
8963
- this.pendingValue = t.value, this.isRange() && (this.liveMessage = this.pendingValue.includes("/") ? "Range selected" : "Start date selected"), this.closeMode() === "select" && (!this.isRange() || bh.test(this.pendingValue)) ? (this.commitValue(this.pendingValue), this.close()) : this.sync();
9514
+ this.pendingValue = t.value, this.isRange() && (this.liveMessage = this.pendingValue.includes("/") ? "Range selected" : "Start date selected"), this.closeMode() === "select" && (!this.isRange() || Lg.test(this.pendingValue)) ? (this.commitValue(this.pendingValue), this.close()) : this.sync();
8964
9515
  },
8965
9516
  handleCalendarFocus(e) {
8966
9517
  let t = e.detail;
@@ -8992,9 +9543,9 @@ var vh = Y({ definition: {
8992
9543
  syncCalendar() {
8993
9544
  let e = this.calendar();
8994
9545
  if (!e) return;
8995
- e.setAttribute("value", this.pendingValue), this.isRange() && !this.pendingValue && e.setAttribute("tentative", ""), e.setAttribute("months", String(this.effectiveMonths())), e.style.setProperty("--ui-date-picker-month-columns", String(this.effectiveMonths())), e.setAttribute("format-weekday", "short"), e.setAttribute("min", this.props.min || Oh()), e.setAttribute("max", this.props.max || kh()), this.props.today && e.setAttribute("today", this.props.today);
8996
- let t = this.props.forceOpenTo ? this.props.openTo : this.value || this.props.openTo || this.props.today || Ah();
8997
- e.setAttribute("focused-date", Th(t)[0]), this.props.locale && e.setAttribute("locale", this.props.locale), this.props.firstDayOfWeek >= 0 && e.setAttribute("first-day-of-week", String(this.props.firstDayOfWeek));
9546
+ e.setAttribute("value", this.pendingValue), this.isRange() && !this.pendingValue && e.setAttribute("tentative", ""), e.setAttribute("months", String(this.effectiveMonths())), e.style.setProperty("--ui-date-picker-month-columns", String(this.effectiveMonths())), e.setAttribute("format-weekday", "short"), e.setAttribute("min", this.props.min || Gg()), e.setAttribute("max", this.props.max || Kg()), this.props.today && e.setAttribute("today", this.props.today);
9547
+ let t = this.props.forceOpenTo ? this.props.openTo : this.value || this.props.openTo || this.props.today || qg();
9548
+ e.setAttribute("focused-date", Hg(t)[0]), this.props.locale && e.setAttribute("locale", this.props.locale), this.props.firstDayOfWeek >= 0 && e.setAttribute("first-day-of-week", String(this.props.firstDayOfWeek));
8998
9549
  let n = !this.props.selectableHeader && this.effectiveMonths() === 1;
8999
9550
  Q.setPresence({
9000
9551
  el: e,
@@ -9023,12 +9574,12 @@ var vh = Y({ definition: {
9023
9574
  },
9024
9575
  syncCalendarHeading(e) {
9025
9576
  let t = this.$el.querySelector("[data-ui-date-picker-calendar-heading]");
9026
- t && (t.textContent = jh(e || Th(this.value || this.props.openTo || this.props.today || Ah())[0], this.props.locale));
9577
+ t && (t.textContent = Jg(e || Hg(this.value || this.props.openTo || this.props.today || qg())[0], this.props.locale));
9027
9578
  },
9028
9579
  syncTodayButton() {
9029
9580
  let e = this.$el.querySelector("[data-ui-date-picker-calendar-today]"), t = this.$el.querySelector("[data-ui-date-picker-today-day]");
9030
9581
  if (!e || !t) return;
9031
- let n = this.props.today || Ah(), r = n.match(yh) ? String(Number(n.slice(-2))) : "";
9582
+ let n = this.props.today || qg(), r = n.match(Ig) ? String(Number(n.slice(-2))) : "";
9032
9583
  t.textContent = r, e.setAttribute("aria-label", r ? `Go to today, ${n}` : "Go to today");
9033
9584
  },
9034
9585
  syncHiddenInputs() {
@@ -9047,7 +9598,7 @@ var vh = Y({ definition: {
9047
9598
  });
9048
9599
  return;
9049
9600
  }
9050
- let [t, n] = Th(this.value);
9601
+ let [t, n] = Hg(this.value);
9051
9602
  if (this.props.startName || this.props.endName) {
9052
9603
  let r = JSON.stringify({
9053
9604
  startName: this.props.startName,
@@ -9094,7 +9645,7 @@ var vh = Y({ definition: {
9094
9645
  syncPresets() {
9095
9646
  let e = this.pendingValue || this.value;
9096
9647
  Array.from(this.$el.querySelectorAll("[data-ui-date-picker-preset]")).forEach((t) => {
9097
- let n = Mh(t), r = this.isRange() ? `${n.start}/${n.end}` : n.start;
9648
+ let n = Yg(t), r = this.isRange() ? `${n.start}/${n.end}` : n.start;
9098
9649
  Q.setPresence({
9099
9650
  el: t,
9100
9651
  attr: "data-selected",
@@ -9182,14 +9733,14 @@ var vh = Y({ definition: {
9182
9733
  onDismiss: () => this.close()
9183
9734
  }));
9184
9735
  }
9185
- }), Ph = (e) => {
9186
- e.data("UiDatePicker", () => Nh());
9187
- }, Fh = Y({ definition: {
9736
+ }), Zg = (e) => {
9737
+ e.data("UiDatePicker", () => Xg());
9738
+ }, Qg = Y({ definition: {
9188
9739
  component: "ui.menu",
9189
9740
  parts: {
9190
- menu: { base: [om, "auto-rows-min content-start min-w-48 gap-1 overflow-hidden p-popover"] },
9741
+ menu: { base: [Ch, "auto-rows-min content-start min-w-48 gap-1 overflow-hidden p-popover"] },
9191
9742
  item: {
9192
- base: [cm],
9743
+ base: [Th],
9193
9744
  variants: {
9194
9745
  variant: {
9195
9746
  default: "",
@@ -9213,7 +9764,7 @@ var vh = Y({ definition: {
9213
9764
  itemLabel: { base: "min-w-0 flex-1" },
9214
9765
  itemMeta: { base: "ml-auto text-menu-item-muted" },
9215
9766
  itemIcon: {
9216
- base: lm,
9767
+ base: Eh,
9217
9768
  variants: { position: {
9218
9769
  leading: "",
9219
9770
  trailing: "ml-auto"
@@ -9237,18 +9788,18 @@ var vh = Y({ definition: {
9237
9788
  defaults: { orientation: "horizontal" }
9238
9789
  }
9239
9790
  }
9240
- } }), Ih = Bp, Lh = zp, Rh = {
9241
- side: J(Ih, "bottom"),
9242
- align: J(Lh, "start"),
9791
+ } }), $g = rh, e_ = nh, t_ = {
9792
+ side: J($g, "bottom"),
9793
+ align: J(e_, "start"),
9243
9794
  offset: K.clamp(-100, 100).default(0),
9244
9795
  gap: K.clamp(0, 50).default(4),
9245
9796
  open: q,
9246
9797
  disabled: q,
9247
9798
  class: G
9248
- }, zh = Y({ definition: {
9799
+ }, n_ = Y({ definition: {
9249
9800
  component: "ui.dropdown",
9250
9801
  parts: { root: { base: "contents" } }
9251
- } }), Bh = () => ({
9802
+ } }), r_ = () => ({
9252
9803
  isOpen: !1,
9253
9804
  menuMotion: null,
9254
9805
  triggerId: "",
@@ -9261,7 +9812,7 @@ var vh = Y({ definition: {
9261
9812
  init() {
9262
9813
  this.props = W({
9263
9814
  el: this.$el,
9264
- schema: Rh
9815
+ schema: t_
9265
9816
  }), this.triggerId = this.$id("dropdown-trigger"), this.menuId = this.$id("dropdown-menu"), this.collection = Q.createCollectionNavigation({
9266
9817
  root: () => this.menuEl(),
9267
9818
  itemSelector: "[data-ui-menu-item]",
@@ -9301,7 +9852,7 @@ var vh = Y({ definition: {
9301
9852
  },
9302
9853
  get root() {
9303
9854
  return Q.mergeBindings({ inputs: [X({
9304
- part: zh.parts.root,
9855
+ part: n_.parts.root,
9305
9856
  props: this.props,
9306
9857
  className: this.props.class
9307
9858
  }), {
@@ -9312,7 +9863,7 @@ var vh = Y({ definition: {
9312
9863
  },
9313
9864
  menu(e) {
9314
9865
  return Q.mergeBindings({ inputs: [X({
9315
- part: Fh.parts.menu,
9866
+ part: Qg.parts.menu,
9316
9867
  props: {},
9317
9868
  className: e.dataset.class
9318
9869
  }), {
@@ -9328,7 +9879,7 @@ var vh = Y({ definition: {
9328
9879
  menuItem(e) {
9329
9880
  let t = e.dataset.variant || "default", n = e.dataset.color || "neutral", r = Q.asBool({ value: e.dataset.disabled }), i = e instanceof HTMLButtonElement ? e.getAttribute("type") || e.dataset.type || "button" : void 0;
9330
9881
  return Q.mergeBindings({ inputs: [X({
9331
- part: Fh.parts.item,
9882
+ part: Qg.parts.item,
9332
9883
  props: {
9333
9884
  variant: t,
9334
9885
  color: n
@@ -9506,12 +10057,12 @@ var vh = Y({ definition: {
9506
10057
  let n = Q.asBool({ value: this.menuEl().dataset.keepOpen });
9507
10058
  (e.dataset.keepOpen === void 0 || e.dataset.keepOpen === "" ? n : Q.asBool({ value: e.dataset.keepOpen })) || this.close();
9508
10059
  }
9509
- }), Vh = (e) => {
9510
- e.data("UiDropdown", () => Bh());
9511
- }, Hh = "input:not([type=\"hidden\"]), textarea, select, button, [data-ui-control-target]", Uh = (e, t) => {
10060
+ }), i_ = (e) => {
10061
+ e.data("UiDropdown", () => r_());
10062
+ }, a_ = "input:not([type=\"hidden\"]), textarea, select, button, [data-ui-control-target]", o_ = (e, t) => {
9512
10063
  let n = new Set((e ?? "").split(/\s+/).filter(Boolean));
9513
10064
  return n.add(t), Array.from(n).join(" ");
9514
- }, Wh = (e, t) => (e.id ||= `ui-${t}-${crypto.randomUUID()}`, e.id), Gh = () => ({
10065
+ }, s_ = (e, t) => (e.id ||= `ui-${t}-${crypto.randomUUID()}`, e.id), c_ = () => ({
9515
10066
  observer: null,
9516
10067
  listeners: [],
9517
10068
  init() {
@@ -9524,22 +10075,22 @@ var vh = Y({ definition: {
9524
10075
  this.observer?.disconnect(), this.listeners.forEach((e) => e()), this.listeners = [];
9525
10076
  },
9526
10077
  sync() {
9527
- let e = this.$el, t = Array.from(e.querySelectorAll(Hh)).filter((t) => !t.closest("[data-ui-field], [data-ui-fieldset]") || t.closest("[data-ui-field], [data-ui-fieldset]") === e)[0], n = e.querySelector(":scope > [data-ui-field-label]"), r = e.querySelector(":scope > [data-ui-fieldset-legend]"), i = Array.from(e.querySelectorAll(":scope > [data-ui-field-description]")), a = Array.from(e.querySelectorAll(":scope > [data-ui-field-error]")), o = [...i, ...a].filter((e) => !e.hasAttribute("hidden")).map((e) => Wh(e, e.hasAttribute("data-ui-field-error") ? "field-error" : "field-description"));
10078
+ let e = this.$el, t = Array.from(e.querySelectorAll(a_)).filter((t) => !t.closest("[data-ui-field], [data-ui-fieldset]") || t.closest("[data-ui-field], [data-ui-fieldset]") === e)[0], n = e.querySelector(":scope > [data-ui-field-label]"), r = e.querySelector(":scope > [data-ui-fieldset-legend]"), i = Array.from(e.querySelectorAll(":scope > [data-ui-field-description]")), a = Array.from(e.querySelectorAll(":scope > [data-ui-field-error]")), o = [...i, ...a].filter((e) => !e.hasAttribute("hidden")).map((e) => s_(e, e.hasAttribute("data-ui-field-error") ? "field-error" : "field-description"));
9528
10079
  if (t) {
9529
- let i = Wh(t, "control");
10080
+ let i = s_(t, "control");
9530
10081
  if (n && !n.htmlFor && (n.htmlFor = i), r) {
9531
- let e = Wh(r, "fieldset-legend");
10082
+ let e = s_(r, "fieldset-legend");
9532
10083
  Q.setAttribute({
9533
10084
  el: t,
9534
10085
  attr: "aria-labelledby",
9535
- value: Uh(t.getAttribute("aria-labelledby"), e)
10086
+ value: o_(t.getAttribute("aria-labelledby"), e)
9536
10087
  });
9537
10088
  }
9538
10089
  o.forEach((e) => {
9539
10090
  Q.setAttribute({
9540
10091
  el: t,
9541
10092
  attr: "aria-describedby",
9542
- value: Uh(t.getAttribute("aria-describedby"), e)
10093
+ value: o_(t.getAttribute("aria-describedby"), e)
9543
10094
  });
9544
10095
  }), e.hasAttribute("data-invalid") && !t.hasAttribute("aria-invalid") && t.setAttribute("aria-invalid", "true");
9545
10096
  }
@@ -9547,19 +10098,19 @@ var vh = Y({ definition: {
9547
10098
  Q.setAttribute({
9548
10099
  el: e,
9549
10100
  attr: "aria-describedby",
9550
- value: Uh(e.getAttribute("aria-describedby"), t)
10101
+ value: o_(e.getAttribute("aria-describedby"), t)
9551
10102
  });
9552
10103
  });
9553
10104
  }
9554
- }), Kh = (e) => {
9555
- e.data("UiField", Gh);
10105
+ }), l_ = (e) => {
10106
+ e.data("UiField", c_);
9556
10107
  };
9557
10108
  //#endregion
9558
10109
  //#region node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/external/file.js
9559
- function qh(e) {
10110
+ function u_(e) {
9560
10111
  return e.source.types.includes("Files");
9561
10112
  }
9562
- function Jh(e) {
10113
+ function d_(e) {
9563
10114
  return e.source.items.filter(function(e) {
9564
10115
  return e.kind === "file";
9565
10116
  }).map(function(e) {
@@ -9570,41 +10121,41 @@ function Jh(e) {
9570
10121
  }
9571
10122
  //#endregion
9572
10123
  //#region node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-entering-window.js
9573
- function Yh(e) {
10124
+ function f_(e) {
9574
10125
  var t = e.dragEnter, n = t.type, r = t.relatedTarget;
9575
10126
  return n === "dragenter" ? Sd() ? wd({ dragEnter: t }) : r == null ? !0 : xd() ? Dd(r) : r instanceof HTMLIFrameElement : !1;
9576
10127
  }
9577
10128
  //#endregion
9578
10129
  //#region node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/external-adapter.js
9579
- function Xh(e) {
10130
+ function p_(e) {
9580
10131
  var t = e.type, n = e.value;
9581
10132
  return !(t === "application/vnd.pdnd" || t === "text/plain" && n === "pdnd:android-fallback");
9582
10133
  }
9583
- function Zh(e) {
10134
+ function m_(e) {
9584
10135
  return Array.from(e.types).filter(function(t) {
9585
- return Xh({
10136
+ return p_({
9586
10137
  type: t,
9587
10138
  value: e.getData(t)
9588
10139
  });
9589
10140
  });
9590
10141
  }
9591
- function Qh(e) {
10142
+ function h_(e) {
9592
10143
  return Array.from(e.items).filter(function(t) {
9593
- return t.kind === "file" || Xh({
10144
+ return t.kind === "file" || p_({
9594
10145
  type: t.type,
9595
10146
  value: e.getData(t.type)
9596
10147
  });
9597
10148
  });
9598
10149
  }
9599
- var $h = !1, eg = sf({
10150
+ var g_ = !1, __ = sf({
9600
10151
  typeKey: "external",
9601
10152
  defaultDropEffect: "copy",
9602
10153
  mount: function(e) {
9603
10154
  return (0, Ku.bind)(window, {
9604
10155
  type: "dragenter",
9605
10156
  listener: function(t) {
9606
- if (!$h && t.dataTransfer && e.canStart(t) && Yh({ dragEnter: t })) {
9607
- var n = Zh(t.dataTransfer);
10157
+ if (!g_ && t.dataTransfer && e.canStart(t) && f_({ dragEnter: t })) {
10158
+ var n = m_(t.dataTransfer);
9608
10159
  if (n.length) {
9609
10160
  var r = {
9610
10161
  types: n,
@@ -9621,14 +10172,14 @@ var $h = !1, eg = sf({
9621
10172
  payload: r,
9622
10173
  getDropPayload: function(e) {
9623
10174
  if (!e.dataTransfer) return r;
9624
- var t = Qh(e.dataTransfer), i = e.dataTransfer.getData.bind(e.dataTransfer);
10175
+ var t = h_(e.dataTransfer), i = e.dataTransfer.getData.bind(e.dataTransfer);
9625
10176
  return {
9626
10177
  types: n,
9627
10178
  items: t,
9628
10179
  getStringData: function(e) {
9629
10180
  if (!n.includes(e)) return null;
9630
10181
  var t = i(e);
9631
- return Xh({
10182
+ return p_({
9632
10183
  type: e,
9633
10184
  value: t
9634
10185
  }) ? t : null;
@@ -9643,18 +10194,18 @@ var $h = !1, eg = sf({
9643
10194
  });
9644
10195
  }
9645
10196
  });
9646
- function tg(e) {
9647
- return eg.dropTarget(e);
10197
+ function v_(e) {
10198
+ return __.dropTarget(e);
9648
10199
  }
9649
- function ng(e) {
9650
- return eg.monitor(e);
10200
+ function y_(e) {
10201
+ return __.monitor(e);
9651
10202
  }
9652
10203
  (function() {
9653
10204
  if (typeof window > "u") return;
9654
- eg.registerUsage();
10205
+ __.registerUsage();
9655
10206
  var e = { type: "idle" }, t = e;
9656
10207
  function n() {
9657
- t.type === "dragging" && ($h = !1, t.cleanup(), t = e);
10208
+ t.type === "dragging" && (g_ = !1, t.cleanup(), t = e);
9658
10209
  }
9659
10210
  function r() {
9660
10211
  return (0, Ku.bindAll)(window, [{
@@ -9665,7 +10216,7 @@ function ng(e) {
9665
10216
  (0, Ku.bind)(window, {
9666
10217
  type: "dragstart",
9667
10218
  listener: function() {
9668
- t.type === "idle" && ($h = !0, t = {
10219
+ t.type === "idle" && (g_ = !0, t = {
9669
10220
  type: "dragging",
9670
10221
  cleanup: r()
9671
10222
  });
@@ -9675,15 +10226,15 @@ function ng(e) {
9675
10226
  })();
9676
10227
  //#endregion
9677
10228
  //#region src/components/file-upload/contract.ts
9678
- var rg = ["stack", "inline"], ig = [
10229
+ var b_ = ["stack", "inline"], x_ = [
9679
10230
  "auto",
9680
10231
  "image",
9681
10232
  "none"
9682
- ], ag = [
10233
+ ], S_ = [
9683
10234
  "sm",
9684
10235
  "md",
9685
10236
  "lg"
9686
- ], og = {
10237
+ ], C_ = {
9687
10238
  name: G,
9688
10239
  accept: G,
9689
10240
  capture: G,
@@ -9691,9 +10242,9 @@ var rg = ["stack", "inline"], ig = [
9691
10242
  required: q,
9692
10243
  disabled: q,
9693
10244
  invalid: q,
9694
- preview: J(ig, "auto"),
9695
- layout: J(rg, "stack"),
9696
- size: J(ag, "md"),
10245
+ preview: J(x_, "auto"),
10246
+ layout: J(b_, "stack"),
10247
+ size: J(S_, "md"),
9697
10248
  heading: G.default("Drop files here or browse"),
9698
10249
  text: G,
9699
10250
  browseLabel: G,
@@ -9706,10 +10257,10 @@ var rg = ["stack", "inline"], ig = [
9706
10257
  itemClass: G,
9707
10258
  class: G
9708
10259
  };
9709
- G.default("Drop files here or browse"), G.default("cloud__upload"), J(rg, "stack"), J(ag, "md"), G.default("document__blank"), G.default("Remove file");
10260
+ G.default("Drop files here or browse"), G.default("cloud__upload"), J(b_, "stack"), J(S_, "md"), G.default("document__blank"), G.default("Remove file");
9710
10261
  //#endregion
9711
10262
  //#region src/components/file-upload/styles.ts
9712
- var sg = Y({ definition: {
10263
+ var w_ = Y({ definition: {
9713
10264
  component: "ui.file-upload",
9714
10265
  parts: {
9715
10266
  root: { base: ["grid w-full min-w-0 gap-3", "data-disabled:cursor-not-allowed"] },
@@ -9764,7 +10315,7 @@ var sg = Y({ definition: {
9764
10315
  removeIcon: { base: "size-icon-xs fill-current leading-none" },
9765
10316
  clear: { base: "sr-only" }
9766
10317
  }
9767
- } }), cg = (e) => {
10318
+ } }), T_ = (e) => {
9768
10319
  if (e === 0) return "0 B";
9769
10320
  let t = [
9770
10321
  "B",
@@ -9773,34 +10324,34 @@ var sg = Y({ definition: {
9773
10324
  "GB"
9774
10325
  ], n = Math.min(Math.floor(Math.log(e) / Math.log(1024)), t.length - 1), r = e / 1024 ** n;
9775
10326
  return `${r >= 10 || n === 0 ? Math.round(r) : Number(r.toFixed(1))} ${t[n]}`;
9776
- }, lg = (e, t) => [
10327
+ }, E_ = (e, t) => [
9777
10328
  t,
9778
10329
  e.name,
9779
10330
  e.size,
9780
10331
  e.lastModified
9781
- ].join(":"), ug = (e) => e.type.startsWith("image/"), dg = (e, t) => t !== "none" && (t === "image" || ug(e)), fg = (e) => e ? Array.from(e) : [], pg = (e, t) => {
10332
+ ].join(":"), D_ = (e) => e.type.startsWith("image/"), O_ = (e, t) => t !== "none" && (t === "image" || D_(e)), k_ = (e) => e ? Array.from(e) : [], A_ = (e, t) => {
9782
10333
  let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
9783
10334
  if (n.length === 0) return !0;
9784
10335
  let r = e.name.toLowerCase(), i = e.type.toLowerCase();
9785
10336
  return n.some((e) => e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i.startsWith(`${e.slice(0, -1)}`) : e.includes("/") ? i === e : !1);
9786
- }, mg = (e, t) => e.filter((e) => pg(e, t)), hg = (e, t) => e.maxItems > 0 && t >= e.maxItems, gg = (e) => {
10337
+ }, j_ = (e, t) => e.filter((e) => A_(e, t)), M_ = (e, t) => e.maxItems > 0 && t >= e.maxItems, N_ = (e) => {
9787
10338
  if (typeof DataTransfer > "u") return null;
9788
10339
  let t = new DataTransfer();
9789
10340
  return e.forEach((e) => t.items.add(e)), t.files;
9790
- }, _g = (e, t) => {
9791
- let n = gg(t);
10341
+ }, P_ = (e, t) => {
10342
+ let n = N_(t);
9792
10343
  if (!n) return !1;
9793
10344
  try {
9794
10345
  return e.files = n, !0;
9795
10346
  } catch {
9796
10347
  return !1;
9797
10348
  }
9798
- }, vg = (e) => {
10349
+ }, F_ = (e) => {
9799
10350
  e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
9800
- }, yg = (e) => {
10351
+ }, I_ = (e) => {
9801
10352
  let t = "http://www.w3.org/2000/svg", n = document.createElementNS(t, "svg"), r = document.createElementNS(t, "polygon");
9802
10353
  return n.setAttribute("viewBox", "0 0 32 32"), n.setAttribute("aria-hidden", "true"), n.setAttribute("class", e), r.setAttribute("points", "17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16"), n.append(r), n;
9803
- }, bg = () => ({
10354
+ }, L_ = () => ({
9804
10355
  props: null,
9805
10356
  listeners: [],
9806
10357
  files: [],
@@ -9809,7 +10360,7 @@ var sg = Y({ definition: {
9809
10360
  init() {
9810
10361
  this.props = W({
9811
10362
  el: this.$el,
9812
- schema: og
10363
+ schema: C_
9813
10364
  });
9814
10365
  let e = this.input(), t = this.dropzone();
9815
10366
  Q.addListener({
@@ -9846,17 +10397,17 @@ var sg = Y({ definition: {
9846
10397
  r && (e.preventDefault(), this.clearExisting(r));
9847
10398
  },
9848
10399
  cleanup: this.listeners
9849
- }), t && (this.listeners.push(tg({
10400
+ }), t && (this.listeners.push(v_({
9850
10401
  element: t,
9851
- canDrop: ({ source: e }) => !this.isInputUnavailable() && qh({ source: e }),
10402
+ canDrop: ({ source: e }) => !this.isInputUnavailable() && u_({ source: e }),
9852
10403
  getDropEffect: () => "copy",
9853
10404
  onDragEnter: () => this.setDragging(!0),
9854
10405
  onDragLeave: () => this.setDragging(!1),
9855
10406
  onDrop: ({ source: e }) => {
9856
- this.setDragging(!1), !(this.isInputUnavailable() || !qh({ source: e })) && this.addFiles(Jh({ source: e }));
10407
+ this.setDragging(!1), !(this.isInputUnavailable() || !u_({ source: e })) && this.addFiles(d_({ source: e }));
9857
10408
  }
9858
- })), this.listeners.push(ng({
9859
- canMonitor: ({ source: e }) => qh({ source: e }),
10409
+ })), this.listeners.push(y_({
10410
+ canMonitor: ({ source: e }) => u_({ source: e }),
9860
10411
  onDrop: () => this.setDragging(!1)
9861
10412
  }))), this.syncFromInput(), this.sync();
9862
10413
  },
@@ -9880,7 +10431,7 @@ var sg = Y({ definition: {
9880
10431
  return this.$el.querySelector("[data-ui-file-upload-list]");
9881
10432
  },
9882
10433
  isInputUnavailable() {
9883
- return this.props.disabled || hg(this.props, fg(this.input().files).length);
10434
+ return this.props.disabled || M_(this.props, k_(this.input().files).length);
9884
10435
  },
9885
10436
  sync() {
9886
10437
  let e = this.root(), t = this.dropzone(), n = !!e.querySelector("[data-ui-file-upload-item][data-existing-file]:not([hidden])"), r = this.files.length > 0 || n, i = this.isInputUnavailable();
@@ -9954,25 +10505,25 @@ var sg = Y({ definition: {
9954
10505
  }), e.multiple = this.props.multiple, this.props.accept ? e.accept = this.props.accept : e.removeAttribute("accept"), this.props.capture ? e.setAttribute("capture", this.props.capture) : e.removeAttribute("capture"), this.isInputUnavailable() && !this.props.disabled ? (e.setAttribute("aria-disabled", "true"), e.tabIndex = -1) : this.props.disabled || (e.removeAttribute("aria-disabled"), e.removeAttribute("tabindex"));
9955
10506
  },
9956
10507
  syncFromInput() {
9957
- let e = this.input(), t = fg(e.files), n = this.emptyInputChangeClears;
10508
+ let e = this.input(), t = k_(e.files), n = this.emptyInputChangeClears;
9958
10509
  if (this.emptyInputChangeClears = !1, t.length === 0 && this.files.length > 0 && !n) {
9959
- _g(e, this.files.map(({ file: e }) => e)), this.sync();
10510
+ P_(e, this.files.map(({ file: e }) => e)), this.sync();
9960
10511
  return;
9961
10512
  }
9962
- let r = mg(t, this.props.accept), i = this.props.multiple ? this.props.maxItems : 1, a = i > 0 ? r.slice(0, i) : r, o = t.length - r.length, s = r.length - a.length, c = o + s;
9963
- this.limitReached = hg(this.props, a.length), c > 0 && (_g(e, a), s > 0 && Q.dispatch({
10513
+ let r = j_(t, this.props.accept), i = this.props.multiple ? this.props.maxItems : 1, a = i > 0 ? r.slice(0, i) : r, o = t.length - r.length, s = r.length - a.length, c = o + s;
10514
+ this.limitReached = M_(this.props, a.length), c > 0 && (P_(e, a), s > 0 && Q.dispatch({
9964
10515
  el: this.root(),
9965
10516
  name: "ui:file-upload-limit",
9966
10517
  detail: { rejectedCount: s }
9967
10518
  })), this.files.forEach((e) => {
9968
10519
  e.previewUrl && URL.revokeObjectURL(e.previewUrl);
9969
10520
  }), this.files = a.map((e, t) => ({
9970
- id: lg(e, t),
10521
+ id: E_(e, t),
9971
10522
  file: e,
9972
10523
  name: e.name,
9973
- size: cg(e.size),
10524
+ size: T_(e.size),
9974
10525
  type: e.type || "File",
9975
- previewUrl: dg(e, this.props.preview) ? URL.createObjectURL(e) : ""
10526
+ previewUrl: O_(e, this.props.preview) ? URL.createObjectURL(e) : ""
9976
10527
  })), this.renderFiles(), this.sync(), Q.dispatch({
9977
10528
  el: this.root(),
9978
10529
  name: "ui:file-upload-change",
@@ -9985,29 +10536,29 @@ var sg = Y({ definition: {
9985
10536
  },
9986
10537
  addFiles(e) {
9987
10538
  if (this.isInputUnavailable() || e.length === 0) return;
9988
- let t = this.input(), n = mg(e, this.props.accept), r = this.props.multiple ? fg(t.files) : [], i = this.props.maxItems > 0 ? Math.max(this.props.maxItems - r.length, 0) : n.length, a = this.props.multiple ? n.slice(0, i) : n.slice(0, 1), o = n.length - a.length, s = this.props.multiple ? [...r, ...a] : a;
10539
+ let t = this.input(), n = j_(e, this.props.accept), r = this.props.multiple ? k_(t.files) : [], i = this.props.maxItems > 0 ? Math.max(this.props.maxItems - r.length, 0) : n.length, a = this.props.multiple ? n.slice(0, i) : n.slice(0, 1), o = n.length - a.length, s = this.props.multiple ? [...r, ...a] : a;
9989
10540
  if (o > 0 && Q.dispatch({
9990
10541
  el: this.root(),
9991
10542
  name: "ui:file-upload-limit",
9992
10543
  detail: { rejectedCount: o }
9993
- }), this.props.maxItems > 0 ? this.limitReached = hg(this.props, s.length) : this.limitReached = !1, s.length === 0) {
10544
+ }), this.props.maxItems > 0 ? this.limitReached = M_(this.props, s.length) : this.limitReached = !1, s.length === 0) {
9994
10545
  this.sync();
9995
10546
  return;
9996
10547
  }
9997
- if (!_g(t, s)) {
10548
+ if (!P_(t, s)) {
9998
10549
  t.click();
9999
10550
  return;
10000
10551
  }
10001
- vg(t);
10552
+ F_(t);
10002
10553
  },
10003
10554
  removePending(e) {
10004
10555
  if (this.props.disabled || !Number.isInteger(e)) return;
10005
- let t = this.input(), n = fg(t.files).filter((t, n) => n !== e);
10556
+ let t = this.input(), n = k_(t.files).filter((t, n) => n !== e);
10006
10557
  if (n.length === 0) {
10007
- this.emptyInputChangeClears = !0, _g(t, []) || (t.value = ""), vg(t);
10558
+ this.emptyInputChangeClears = !0, P_(t, []) || (t.value = ""), F_(t);
10008
10559
  return;
10009
10560
  }
10010
- _g(t, n) || (t.value = ""), vg(t);
10561
+ P_(t, n) || (t.value = ""), F_(t);
10011
10562
  },
10012
10563
  clearExisting(e) {
10013
10564
  if (this.props.disabled || !this.props.clearable) return;
@@ -10023,10 +10574,10 @@ var sg = Y({ definition: {
10023
10574
  let t = e.querySelector("[data-ui-file-upload-empty]");
10024
10575
  t && (t.hidden = this.files.length > 0 || !!e.querySelector("[data-existing-file]:not([hidden])"));
10025
10576
  let n = X({
10026
- part: sg.parts.item,
10577
+ part: w_.parts.item,
10027
10578
  props: {},
10028
10579
  className: this.props.itemClass
10029
- }), r = X({ part: sg.parts.preview }), i = ["relative block overflow-hidden ui-image-outline", X({ part: sg.parts.previewImage })].filter(Boolean).join(" "), a = X({ part: sg.parts.itemBody }), o = X({ part: sg.parts.itemName }), s = X({ part: sg.parts.itemMeta }), c = X({ part: sg.parts.remove }), l = X({ part: sg.parts.removeIcon });
10580
+ }), r = X({ part: w_.parts.preview }), i = ["relative block overflow-hidden ui-image-outline", X({ part: w_.parts.previewImage })].filter(Boolean).join(" "), a = X({ part: w_.parts.itemBody }), o = X({ part: w_.parts.itemName }), s = X({ part: w_.parts.itemMeta }), c = X({ part: w_.parts.remove }), l = X({ part: w_.parts.removeIcon });
10030
10581
  this.files.forEach((t, u) => {
10031
10582
  let d = document.createElement("li");
10032
10583
  d.dataset.uiFileUploadItem = "", d.dataset.uiFileUploadPending = "", d.dataset.fileIndex = String(u), d.className = n;
@@ -10044,7 +10595,7 @@ var sg = Y({ definition: {
10044
10595
  let h = document.createElement("span");
10045
10596
  h.dataset.uiFileUploadItemMeta = "", h.className = s, h.textContent = [t.size, t.type].filter(Boolean).join(" · "), p.append(m, h);
10046
10597
  let g = document.createElement("button");
10047
- g.type = "button", g.dataset.uiFileUploadRemove = "", g.dataset.fileIndex = String(u), g.className = c, g.setAttribute("aria-label", `Remove ${t.name}`), g.append(yg(l)), d.append(f, p, g), e.append(d);
10598
+ g.type = "button", g.dataset.uiFileUploadRemove = "", g.dataset.fileIndex = String(u), g.className = c, g.setAttribute("aria-label", `Remove ${t.name}`), g.append(I_(l)), d.append(f, p, g), e.append(d);
10048
10599
  });
10049
10600
  },
10050
10601
  setDragging(e) {
@@ -10061,23 +10612,23 @@ var sg = Y({ definition: {
10061
10612
  value: "true"
10062
10613
  });
10063
10614
  }
10064
- }), xg = (e) => {
10065
- e.data("UiFileUpload", () => bg());
10066
- }, Sg = Fp, Cg = Ip, wg = qp, Tg = Lp, Eg = {
10615
+ }), R_ = (e) => {
10616
+ e.data("UiFileUpload", () => L_());
10617
+ }, z_ = Qm, B_ = $m, V_ = uh, H_ = eh, U_ = {
10067
10618
  type: G.default("text"),
10068
10619
  name: G,
10069
10620
  value: G,
10070
10621
  placeholder: G,
10071
- size: J(Sg, "lg"),
10072
- variant: J(Cg, "outline"),
10073
- radius: J(wg, "md"),
10622
+ size: J(z_, "lg"),
10623
+ variant: J(B_, "outline"),
10624
+ radius: J(V_, "md"),
10074
10625
  disabled: q,
10075
10626
  readonly: q,
10076
10627
  required: q,
10077
10628
  invalid: q,
10078
10629
  icon: G,
10079
10630
  iconTrailing: G,
10080
- iconVariant: J(Tg, "outline"),
10631
+ iconVariant: J(H_, "outline"),
10081
10632
  clearable: q,
10082
10633
  copyable: q,
10083
10634
  kbd: G,
@@ -10087,17 +10638,17 @@ var sg = Y({ definition: {
10087
10638
  controlClass: G,
10088
10639
  class: G
10089
10640
  };
10090
- J(Sg, "lg"), J(Cg, "outline"), J(wg, "md");
10641
+ J(z_, "lg"), J(B_, "outline"), J(V_, "md");
10091
10642
  //#endregion
10092
10643
  //#region src/components/input/index.ts
10093
- var Dg = () => ({
10644
+ var W_ = () => ({
10094
10645
  props: null,
10095
10646
  listeners: [],
10096
10647
  copiedTimer: null,
10097
10648
  init() {
10098
10649
  this.props = W({
10099
10650
  el: this.$el,
10100
- schema: Eg
10651
+ schema: U_
10101
10652
  });
10102
10653
  let e = this.input();
10103
10654
  Q.addListener({
@@ -10174,26 +10725,26 @@ var Dg = () => ({
10174
10725
  });
10175
10726
  }, 1200);
10176
10727
  }
10177
- }), Og = (e) => {
10178
- e.data("UiInput", () => Dg());
10179
- }, kg = ["modal", "sheet"], Ag = Vp, jg = [
10728
+ }), G_ = (e) => {
10729
+ e.data("UiInput", () => W_());
10730
+ }, K_ = ["modal", "sheet"], q_ = ih, J_ = [
10180
10731
  "sm",
10181
10732
  "md",
10182
10733
  "lg",
10183
10734
  "xl",
10184
10735
  "full"
10185
- ], Mg = [
10736
+ ], Y_ = [
10186
10737
  "overlay",
10187
10738
  "panel",
10188
10739
  "inverse"
10189
- ], Ng = Jp, Pg = Gp, Fg = {
10740
+ ], X_ = dh, Z_ = ch, Q_ = {
10190
10741
  name: G,
10191
10742
  open: q,
10192
- mode: J(kg, "modal"),
10193
- side: J(Ag, "right"),
10194
- size: J(jg, "md"),
10195
- surface: J(Mg, "overlay"),
10196
- tone: J(Ng, "solid"),
10743
+ mode: J(K_, "modal"),
10744
+ side: J(q_, "right"),
10745
+ size: J(J_, "md"),
10746
+ surface: J(Y_, "overlay"),
10747
+ tone: J(X_, "solid"),
10197
10748
  dismissible: q.default(!0),
10198
10749
  closable: q.default(!0),
10199
10750
  disabled: q,
@@ -10203,24 +10754,24 @@ var Dg = () => ({
10203
10754
  panelClass: G,
10204
10755
  overlayClass: G,
10205
10756
  class: G
10206
- }, Ig = {
10757
+ }, $_ = {
10207
10758
  name: G,
10208
10759
  disabled: q,
10209
10760
  class: G
10210
10761
  };
10211
- G.default("ui-modal-root"), J(Pg, "h2"), G.default("Close");
10762
+ G.default("ui-modal-root"), J(Z_, "h2"), G.default("Close");
10212
10763
  //#endregion
10213
10764
  //#region src/components/modal/styles.ts
10214
- var Lg = {
10215
- overlay: Yp.overlay,
10216
- panel: Yp.panel,
10217
- inverse: Yp.inverse
10218
- }, Rg = [
10765
+ var ev = {
10766
+ overlay: fh.overlay,
10767
+ panel: fh.panel,
10768
+ inverse: fh.inverse
10769
+ }, tv = [
10219
10770
  "grid-rows-[auto_auto_minmax(0,1fr)_auto]",
10220
10771
  "[&>[data-ui-modal-body]]:-mx-1 [&>[data-ui-modal-body]]:min-h-0 [&>[data-ui-modal-body]]:content-start",
10221
10772
  "[&>[data-ui-modal-body]]:overflow-x-hidden [&>[data-ui-modal-body]]:overflow-y-auto [&>[data-ui-modal-body]]:px-1",
10222
10773
  "[&>[data-ui-modal-footer]]:self-end"
10223
- ], zg = Y({ definition: {
10774
+ ], nv = Y({ definition: {
10224
10775
  component: "ui.modal",
10225
10776
  parts: {
10226
10777
  instance: { base: "contents" },
@@ -10278,8 +10829,8 @@ var Lg = {
10278
10829
  panel: {
10279
10830
  base: ["relative z-dialog grid w-full min-w-0 gap-4 overflow-auto p-5 shadow-modal outline-none", "max-h-full"],
10280
10831
  variants: {
10281
- surface: Lg,
10282
- tone: Xp,
10832
+ surface: ev,
10833
+ tone: ph,
10283
10834
  mode: {
10284
10835
  modal: "rounded-4",
10285
10836
  sheet: ""
@@ -10304,14 +10855,14 @@ var Lg = {
10304
10855
  mode: "sheet",
10305
10856
  side: "right"
10306
10857
  },
10307
- class: ["min-h-dvh max-w-lg", Rg]
10858
+ class: ["min-h-dvh max-w-lg", tv]
10308
10859
  },
10309
10860
  {
10310
10861
  when: {
10311
10862
  mode: "sheet",
10312
10863
  side: "left"
10313
10864
  },
10314
- class: ["min-h-dvh max-w-lg", Rg]
10865
+ class: ["min-h-dvh max-w-lg", tv]
10315
10866
  },
10316
10867
  {
10317
10868
  when: {
@@ -10359,7 +10910,7 @@ var Lg = {
10359
10910
  close: { base: ["absolute right-3 top-3 inline-flex size-control-md items-center justify-center rounded-2 border border-transparent text-icon outline-none", "hover:bg-base-a2 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app"] },
10360
10911
  closeIcon: { base: "size-icon fill-current" }
10361
10912
  }
10362
- } }), Bg = /* @__PURE__ */ new Set(), Vg = /* @__PURE__ */ new Set(), Hg = [
10913
+ } }), rv = /* @__PURE__ */ new Set(), iv = /* @__PURE__ */ new Set(), av = [
10363
10914
  "a[href]",
10364
10915
  "area[href]",
10365
10916
  "button:not([disabled])",
@@ -10368,13 +10919,13 @@ var Lg = {
10368
10919
  "textarea:not([disabled])",
10369
10920
  "[tabindex]:not([tabindex=\"-1\"])",
10370
10921
  "[contenteditable=\"true\"]"
10371
- ].join(","), Ug = (e) => e ? "open" : "closed", Wg = (e) => (e.side === "left" || e.side === "right") && e.mode === "sheet" ? "sheet" : "modal", Gg = (e) => Array.from(Bg).find((t) => t.name === e) ?? null, Kg = (e) => Array.from(Vg).filter((t) => t.name === e), qg = (e) => {
10922
+ ].join(","), ov = (e) => e ? "open" : "closed", sv = (e) => (e.side === "left" || e.side === "right") && e.mode === "sheet" ? "sheet" : "modal", cv = (e) => Array.from(rv).find((t) => t.name === e) ?? null, lv = (e) => Array.from(iv).filter((t) => t.name === e), uv = (e) => {
10372
10923
  let t = e.detail;
10373
- t?.name && Gg(t.name)?.close(e);
10374
- }, Jg = (e) => !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true" && !e.hidden && e.tabIndex !== -1, Yg = (e) => e.matches(Hg) && Jg(e) ? e : e.querySelector(Hg) ?? e, Xg = (e, t) => {
10375
- let n = Ug(t);
10924
+ t?.name && cv(t.name)?.close(e);
10925
+ }, dv = (e) => !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true" && !e.hidden && e.tabIndex !== -1, fv = (e) => e.matches(av) && dv(e) ? e : e.querySelector(av) ?? e, pv = (e, t) => {
10926
+ let n = ov(t);
10376
10927
  e.setAttribute("data-state", n), e.setAttribute("aria-expanded", t ? "true" : "false");
10377
- }, Zg = () => ({
10928
+ }, mv = () => ({
10378
10929
  props: null,
10379
10930
  isOpen: !1,
10380
10931
  dialogId: "",
@@ -10393,23 +10944,23 @@ var Lg = {
10393
10944
  init() {
10394
10945
  this.props = W({
10395
10946
  el: this.$el,
10396
- schema: Fg
10947
+ schema: Q_
10397
10948
  }), this.isOpen = this.props.open, this.dialogId = this.dialogEl().id || this.$id(`modal${this.props.name ? `-${this.props.name}` : ""}`), this.register(), this.mountLocalTrigger(), this.setupDialog(), this.overlayMotion = Q.motion.createPresenceLifecycle({
10398
10949
  element: () => this.overlayEl(),
10399
10950
  preset: "fade"
10400
10951
  }), this.panelMotion = Q.motion.createPresenceLifecycle({
10401
10952
  element: () => this.panelEl(),
10402
- preset: Wg(this.props)
10953
+ preset: sv(this.props)
10403
10954
  }), this.syncAll(), this.$watch("isOpen", (e) => {
10404
10955
  e ? this.applyOpenState() : this.applyClosedState();
10405
10956
  }), this.isOpen && queueMicrotask(() => this.applyOpenState());
10406
10957
  },
10407
10958
  destroy() {
10408
- this.props.disconnect(), this.overlayMotion?.destroy(), this.panelMotion?.destroy(), this.hasScrollLock &&= (Pp(), !1), this.unregister(), this.teardownLocalTrigger(), this.teardown();
10959
+ this.props.disconnect(), this.overlayMotion?.destroy(), this.panelMotion?.destroy(), this.hasScrollLock &&= (Zm(), !1), this.unregister(), this.teardownLocalTrigger(), this.teardown();
10409
10960
  },
10410
10961
  get root() {
10411
10962
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
10412
- part: zg.parts.instance,
10963
+ part: nv.parts.instance,
10413
10964
  props: {},
10414
10965
  className: ""
10415
10966
  }), { "data-ui-modal-instance": "" }] });
@@ -10447,10 +10998,10 @@ var Lg = {
10447
10998
  return Array.from(this.$el.children).find((e) => e instanceof HTMLElement && e.matches("[data-ui-modal-trigger]")) ?? null;
10448
10999
  },
10449
11000
  triggerTarget(e) {
10450
- return Yg(e);
11001
+ return fv(e);
10451
11002
  },
10452
11003
  focusableEls() {
10453
- return Array.from(this.panelEl().querySelectorAll(Hg)).filter(Jg);
11004
+ return Array.from(this.panelEl().querySelectorAll(av)).filter(dv);
10454
11005
  },
10455
11006
  firstAutofocusEl() {
10456
11007
  return this.panelEl().querySelector("[autofocus]");
@@ -10516,10 +11067,10 @@ var Lg = {
10516
11067
  }));
10517
11068
  },
10518
11069
  register() {
10519
- this.isRegistered ||= (Bg.add(this), !0);
11070
+ this.isRegistered ||= (rv.add(this), !0);
10520
11071
  },
10521
11072
  unregister() {
10522
- Bg.delete(this), this.isRegistered = !1;
11073
+ rv.delete(this), this.isRegistered = !1;
10523
11074
  },
10524
11075
  open(e) {
10525
11076
  if (e?.preventDefault(), this.props.disabled) return;
@@ -10544,30 +11095,30 @@ var Lg = {
10544
11095
  });
10545
11096
  },
10546
11097
  syncExternalTrigger(e, t) {
10547
- if (Xg(e, this.isOpen), e.setAttribute("aria-controls", this.dialogId), e.setAttribute("data-ui-modal-trigger-target", this.dialogId), e.setAttribute("data-state", Ug(this.isOpen)), t || this.props.disabled) {
10548
- e.setAttribute("aria-disabled", "true"), e.setAttribute("data-disabled", ""), e instanceof HTMLButtonElement && (e.disabled = !0), e.matches(Hg) || (e.tabIndex = -1);
11098
+ if (pv(e, this.isOpen), e.setAttribute("aria-controls", this.dialogId), e.setAttribute("data-ui-modal-trigger-target", this.dialogId), e.setAttribute("data-state", ov(this.isOpen)), t || this.props.disabled) {
11099
+ e.setAttribute("aria-disabled", "true"), e.setAttribute("data-disabled", ""), e instanceof HTMLButtonElement && (e.disabled = !0), e.matches(av) || (e.tabIndex = -1);
10549
11100
  return;
10550
11101
  }
10551
- e.removeAttribute("aria-disabled"), e.removeAttribute("data-disabled"), e instanceof HTMLButtonElement && (e.disabled = !1), e.matches(Hg) || (e.tabIndex = 0);
11102
+ e.removeAttribute("aria-disabled"), e.removeAttribute("data-disabled"), e instanceof HTMLButtonElement && (e.disabled = !1), e.matches(av) || (e.tabIndex = 0);
10552
11103
  },
10553
11104
  syncAll() {
10554
11105
  this.syncDialog(), this.syncLocalTrigger(), this.syncNamedTriggers();
10555
11106
  },
10556
11107
  syncDialog() {
10557
- let e = this.dialogEl(), t = this.viewportEl(), n = this.overlayEl(), r = this.panelEl(), i = this.titleEl(), a = this.descriptionEl(), o = Ug(this.isOpen);
11108
+ let e = this.dialogEl(), t = this.viewportEl(), n = this.overlayEl(), r = this.panelEl(), i = this.titleEl(), a = this.descriptionEl(), o = ov(this.isOpen);
10558
11109
  e.id = this.dialogId, e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("data-state", o), e.dataset.mode = this.props.mode, e.dataset.side = this.props.side, e.dataset.size = this.props.size, e.dataset.surface = this.props.surface, e.dataset.tone = this.props.tone, e.className = Q.resolveStyle({
10559
- part: zg.parts.root,
11110
+ part: nv.parts.root,
10560
11111
  props: this.props,
10561
11112
  className: this.props.class
10562
11113
  }), t.setAttribute("data-state", o), t.dataset.mode = this.props.mode, t.dataset.side = this.props.side, t.className = Q.resolveStyle({
10563
- part: zg.parts.viewport,
11114
+ part: nv.parts.viewport,
10564
11115
  props: this.props
10565
11116
  }), n.setAttribute("data-state", o), n.className = Q.resolveStyle({
10566
- part: zg.parts.overlay,
11117
+ part: nv.parts.overlay,
10567
11118
  props: this.props,
10568
11119
  className: this.props.overlayClass
10569
11120
  }), r.id ||= this.$id(`modal-panel${this.props.name ? `-${this.props.name}` : ""}`), r.setAttribute("data-state", o), r.dataset.mode = this.props.mode, r.dataset.side = this.props.side, r.dataset.size = this.props.size, r.dataset.surface = this.props.surface, r.dataset.tone = this.props.tone, r.tabIndex = -1, r.className = Q.resolveStyle({
10570
- part: zg.parts.panel,
11121
+ part: nv.parts.panel,
10571
11122
  props: this.props,
10572
11123
  className: this.props.panelClass
10573
11124
  }), i ? (i.id ||= this.$id(`modal-title${this.props.name ? `-${this.props.name}` : ""}`), e.setAttribute("aria-labelledby", i.id), e.removeAttribute("aria-label"), this.props.autofocusTitle && (i.tabIndex = -1)) : this.props.label && (e.setAttribute("aria-label", this.props.label), e.removeAttribute("aria-labelledby")), a && (a.id ||= this.$id(`modal-description${this.props.name ? `-${this.props.name}` : ""}`)), this.props.descriptionId === "none" ? e.removeAttribute("aria-describedby") : this.props.descriptionId ? e.setAttribute("aria-describedby", this.props.descriptionId) : a && e.setAttribute("aria-describedby", a.id);
@@ -10577,12 +11128,12 @@ var Lg = {
10577
11128
  e && this.syncExternalTrigger(this.triggerTarget(e), this.props.disabled);
10578
11129
  },
10579
11130
  syncNamedTriggers() {
10580
- this.props.name && Kg(this.props.name).forEach((e) => e.sync());
11131
+ this.props.name && lv(this.props.name).forEach((e) => e.sync());
10581
11132
  },
10582
11133
  applyOpenState() {
10583
11134
  this.modalMotionRun += 1;
10584
11135
  let e = this.dialogEl();
10585
- typeof e.showModal == "function" ? this.didShowModal ||= (e.open && e.removeAttribute("open"), e.showModal(), !0) : e.open || e.setAttribute("open", ""), this.hasScrollLock ||= (Np(), !0), this.syncAll(), this.overlayMotion?.enter(), this.panelMotion?.enter(), queueMicrotask(() => this.focusInitial()), Q.dispatch({
11136
+ typeof e.showModal == "function" ? this.didShowModal ||= (e.open && e.removeAttribute("open"), e.showModal(), !0) : e.open || e.setAttribute("open", ""), this.hasScrollLock ||= (Xm(), !0), this.syncAll(), this.overlayMotion?.enter(), this.panelMotion?.enter(), queueMicrotask(() => this.focusInitial()), Q.dispatch({
10586
11137
  el: e,
10587
11138
  name: "ui:open"
10588
11139
  });
@@ -10596,14 +11147,14 @@ var Lg = {
10596
11147
  finishClosedState(e) {
10597
11148
  if (e !== this.modalMotionRun || this.isOpen) return;
10598
11149
  let t = this.dialogEl();
10599
- t.open && t.close(), this.didShowModal = !1, this.hasScrollLock &&= (Pp(), !1), this.restoreFocus(), Q.dispatch({
11150
+ t.open && t.close(), this.didShowModal = !1, this.hasScrollLock &&= (Zm(), !1), this.restoreFocus(), Q.dispatch({
10600
11151
  el: t,
10601
11152
  name: "ui:close"
10602
11153
  });
10603
11154
  },
10604
11155
  focusInitial() {
10605
11156
  let e = this.firstAutofocusEl();
10606
- if (e && Jg(e)) {
11157
+ if (e && dv(e)) {
10607
11158
  e.focus({ preventScroll: !0 });
10608
11159
  return;
10609
11160
  }
@@ -10646,7 +11197,7 @@ var Lg = {
10646
11197
  teardown() {
10647
11198
  this.cleanup.forEach((e) => e()), this.cleanup = [];
10648
11199
  }
10649
- }), Qg = () => ({
11200
+ }), hv = () => ({
10650
11201
  props: null,
10651
11202
  target: null,
10652
11203
  cleanup: [],
@@ -10656,8 +11207,8 @@ var Lg = {
10656
11207
  init() {
10657
11208
  this.props = W({
10658
11209
  el: this.$el,
10659
- schema: Ig
10660
- }), this.target = this.targetEl(), Vg.add(this), this.sync(), Q.addListener({
11210
+ schema: $_
11211
+ }), this.target = this.targetEl(), iv.add(this), this.sync(), Q.addListener({
10661
11212
  target: this.target,
10662
11213
  event: "click",
10663
11214
  handler: (e) => this.open(e),
@@ -10672,11 +11223,11 @@ var Lg = {
10672
11223
  });
10673
11224
  },
10674
11225
  destroy() {
10675
- this.props.disconnect(), Vg.delete(this), this.cleanup.forEach((e) => e()), this.cleanup = [];
11226
+ this.props.disconnect(), iv.delete(this), this.cleanup.forEach((e) => e()), this.cleanup = [];
10676
11227
  },
10677
11228
  get root() {
10678
11229
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
10679
- part: zg.parts.trigger,
11230
+ part: nv.parts.trigger,
10680
11231
  props: {},
10681
11232
  className: this.props.class
10682
11233
  }), {
@@ -10691,44 +11242,44 @@ var Lg = {
10691
11242
  e.syncExternalTrigger(this.target, this.props.disabled);
10692
11243
  return;
10693
11244
  }
10694
- Xg(this.target, !1), this.props.disabled ? (this.target.setAttribute("aria-disabled", "true"), this.target.setAttribute("data-disabled", "")) : (this.target.removeAttribute("aria-disabled"), this.target.removeAttribute("data-disabled"));
11245
+ pv(this.target, !1), this.props.disabled ? (this.target.setAttribute("aria-disabled", "true"), this.target.setAttribute("data-disabled", "")) : (this.target.removeAttribute("aria-disabled"), this.target.removeAttribute("data-disabled"));
10695
11246
  },
10696
11247
  modal() {
10697
- return this.props.name ? Gg(this.props.name) : null;
11248
+ return this.props.name ? cv(this.props.name) : null;
10698
11249
  },
10699
11250
  open(e) {
10700
11251
  e?.preventDefault(), !this.props.disabled && this.modal()?.openFrom(this.target);
10701
11252
  },
10702
11253
  targetEl() {
10703
- return Yg(this.$el);
11254
+ return fv(this.$el);
10704
11255
  }
10705
- }), $g = (e) => {
10706
- e.data("UiModal", () => Zg()), e.data("UiModalTrigger", () => Qg()), document.addEventListener("ui:modal-close", qg);
10707
- }, e_ = Hp, t_ = [
11256
+ }), gv = (e) => {
11257
+ e.data("UiModal", () => mv()), e.data("UiModalTrigger", () => hv()), document.addEventListener("ui:modal-close", uv);
11258
+ }, _v = ah, vv = [
10708
11259
  "default",
10709
11260
  "cards",
10710
11261
  "pills"
10711
- ], n_ = Up, r_ = Fp, i_ = [
11262
+ ], yv = oh, bv = Qm, xv = [
10712
11263
  "default",
10713
11264
  "cards",
10714
11265
  "pills"
10715
- ], a_ = {
11266
+ ], Sv = {
10716
11267
  name: G,
10717
11268
  value: G,
10718
- orientation: J(e_, "vertical"),
10719
- variant: J(t_, "default"),
11269
+ orientation: J(_v, "vertical"),
11270
+ variant: J(vv, "default"),
10720
11271
  indicator: q.default(!0),
10721
- placement: J(n_, "leading"),
11272
+ placement: J(yv, "leading"),
10722
11273
  disabled: q,
10723
11274
  required: q,
10724
11275
  invalid: q,
10725
11276
  loop: q.default(!0),
10726
11277
  class: G
10727
11278
  };
10728
- q.default(!0), J(n_, "leading"), J(i_, "default"), J(r_, "md"), J(r_, "md");
11279
+ q.default(!0), J(yv, "leading"), J(xv, "default"), J(bv, "md"), J(bv, "md");
10729
11280
  //#endregion
10730
11281
  //#region src/components/radio/index.ts
10731
- var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_ = () => ({
11282
+ var Cv = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", wv = () => ({
10732
11283
  props: null,
10733
11284
  value: "",
10734
11285
  listeners: [],
@@ -10736,7 +11287,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
10736
11287
  init() {
10737
11288
  this.props = W({
10738
11289
  el: this.$el,
10739
- schema: a_
11290
+ schema: Sv
10740
11291
  });
10741
11292
  let e = this.items().find((e) => e.input.checked);
10742
11293
  this.value = this.props.value || e?.value || "", Q.addListener({
@@ -10777,7 +11328,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
10777
11328
  input: t,
10778
11329
  indicator: e.querySelector("[data-ui-radio-indicator]"),
10779
11330
  dot: e.querySelector("[data-ui-radio-indicator-dot]"),
10780
- value: o_(e, t),
11331
+ value: Cv(e, t),
10781
11332
  disabled: n
10782
11333
  };
10783
11334
  }).filter((e) => e !== null);
@@ -10881,9 +11432,9 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
10881
11432
  }
10882
11433
  ["ArrowUp", "ArrowLeft"].includes(t.key) && (t.preventDefault(), this.move(e, -1)), ["ArrowDown", "ArrowRight"].includes(t.key) && (t.preventDefault(), this.move(e, 1));
10883
11434
  }
10884
- }), c_ = (e) => {
10885
- e.data("UiRadioGroup", () => s_());
10886
- }, l_ = {
11435
+ }), Tv = (e) => {
11436
+ e.data("UiRadioGroup", () => wv());
11437
+ }, Ev = {
10887
11438
  orientation: J([
10888
11439
  "vertical",
10889
11440
  "horizontal",
@@ -10903,7 +11454,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
10903
11454
  scrollbarClass: G,
10904
11455
  thumbClass: G,
10905
11456
  cornerClass: G
10906
- }, u_ = Y({ definition: {
11457
+ }, Dv = Y({ definition: {
10907
11458
  component: "ui.scroll-area",
10908
11459
  parts: {
10909
11460
  root: {
@@ -10972,27 +11523,27 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
10972
11523
  "data-visible:opacity-100"
10973
11524
  ] }
10974
11525
  }
10975
- } }), d_ = 18, f_ = 1e3, p_ = null, m_ = (e, t, n) => Math.min(n, Math.max(t, e)), h_ = (e, t) => e === "both" || e === "horizontal" && t === "x" || e === "vertical" && t === "y", g_ = () => {
10976
- if (p_) return p_;
11526
+ } }), Ov = 18, kv = 1e3, Av = null, jv = (e, t, n) => Math.min(n, Math.max(t, e)), Mv = (e, t) => e === "both" || e === "horizontal" && t === "x" || e === "vertical" && t === "y", Nv = () => {
11527
+ if (Av) return Av;
10977
11528
  let e = document.createElement("div"), t = document.createElement("div");
10978
- return e.dir = "rtl", e.style.cssText = "position:absolute;left:-9999px;width:4px;height:1px;overflow:scroll;", t.style.cssText = "width:8px;height:1px;", e.append(t), document.body.append(e), e.scrollLeft = 1, e.scrollLeft === 0 ? p_ = "negative" : (e.scrollLeft = 0, p_ = e.scrollLeft === 0 ? "reverse" : "default"), e.remove(), p_;
10979
- }, __ = (e) => {
11529
+ return e.dir = "rtl", e.style.cssText = "position:absolute;left:-9999px;width:4px;height:1px;overflow:scroll;", t.style.cssText = "width:8px;height:1px;", e.append(t), document.body.append(e), e.scrollLeft = 1, e.scrollLeft === 0 ? Av = "negative" : (e.scrollLeft = 0, Av = e.scrollLeft === 0 ? "reverse" : "default"), e.remove(), Av;
11530
+ }, Pv = (e) => {
10980
11531
  let t = Math.max(0, e.scrollWidth - e.clientWidth);
10981
11532
  if (!Q.isRtl({ el: e })) return e.scrollLeft;
10982
- let n = g_();
11533
+ let n = Nv();
10983
11534
  return n === "negative" ? -e.scrollLeft : n === "reverse" ? t - e.scrollLeft : e.scrollLeft;
10984
- }, v_ = (e, t) => {
10985
- let n = Math.max(0, e.scrollWidth - e.clientWidth), r = m_(t, 0, n);
11535
+ }, Fv = (e, t) => {
11536
+ let n = Math.max(0, e.scrollWidth - e.clientWidth), r = jv(t, 0, n);
10986
11537
  if (!Q.isRtl({ el: e })) {
10987
11538
  e.scrollLeft = r;
10988
11539
  return;
10989
11540
  }
10990
- let i = g_();
11541
+ let i = Nv();
10991
11542
  i === "negative" ? e.scrollLeft = -r : i === "reverse" ? e.scrollLeft = n - r : e.scrollLeft = r;
10992
- }, y_ = (e) => e.dataset.orientation === "horizontal" ? "x" : "y", b_ = (e) => e instanceof HTMLElement, x_ = (e, t) => {
11543
+ }, Iv = (e) => e.dataset.orientation === "horizontal" ? "x" : "y", Lv = (e) => e instanceof HTMLElement, Rv = (e, t) => {
10993
11544
  let n = e.querySelector(`:scope > ${t}`);
10994
- return b_(n) ? n : null;
10995
- }, S_ = () => ({
11545
+ return Lv(n) ? n : null;
11546
+ }, zv = () => ({
10996
11547
  props: null,
10997
11548
  listeners: [],
10998
11549
  resizeObserver: null,
@@ -11011,7 +11562,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11011
11562
  init() {
11012
11563
  this.props = W({
11013
11564
  el: this.$el,
11014
- schema: l_
11565
+ schema: Ev
11015
11566
  });
11016
11567
  let e = this.elements();
11017
11568
  this.resizeObserver = new ResizeObserver(() => this.scheduleSync()), this.resizeObserver.observe(e.viewport), e.content && this.resizeObserver.observe(e.content), this.mutationObserver = new MutationObserver(() => this.scheduleSync()), e.content && this.mutationObserver.observe(e.content, {
@@ -11088,7 +11639,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11088
11639
  },
11089
11640
  get root() {
11090
11641
  return Q.mergeBindings({ inputs: [X({
11091
- part: u_.parts.root,
11642
+ part: Dv.parts.root,
11092
11643
  props: {
11093
11644
  fill: this.props.fill,
11094
11645
  size: this.props.size
@@ -11105,7 +11656,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11105
11656
  },
11106
11657
  viewport(e) {
11107
11658
  return Q.mergeBindings({ inputs: [X({
11108
- part: u_.parts.viewport,
11659
+ part: Dv.parts.viewport,
11109
11660
  props: {
11110
11661
  orientation: this.props.orientation,
11111
11662
  fill: this.props.fill
@@ -11119,9 +11670,9 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11119
11670
  }] });
11120
11671
  },
11121
11672
  scrollbar(e) {
11122
- let t = y_(e) === "x" ? "horizontal" : "vertical";
11673
+ let t = Iv(e) === "x" ? "horizontal" : "vertical";
11123
11674
  return Q.mergeBindings({ inputs: [X({
11124
- part: u_.parts.scrollbar,
11675
+ part: Dv.parts.scrollbar,
11125
11676
  props: { orientation: t },
11126
11677
  className: e.dataset.class
11127
11678
  }), {
@@ -11131,9 +11682,9 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11131
11682
  }] });
11132
11683
  },
11133
11684
  thumb(e) {
11134
- let t = y_(e), n = t === "x" ? "horizontal" : "vertical";
11685
+ let t = Iv(e), n = t === "x" ? "horizontal" : "vertical";
11135
11686
  return Q.mergeBindings({ inputs: [X({
11136
- part: u_.parts.thumb,
11687
+ part: Dv.parts.thumb,
11137
11688
  props: { orientation: n },
11138
11689
  className: e.dataset.class
11139
11690
  }), {
@@ -11145,7 +11696,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11145
11696
  },
11146
11697
  corner(e) {
11147
11698
  return Q.mergeBindings({ inputs: [X({
11148
- part: u_.parts.corner,
11699
+ part: Dv.parts.corner,
11149
11700
  className: e.dataset.class
11150
11701
  }), {
11151
11702
  "data-ui-scroll-area-corner": "",
@@ -11153,16 +11704,16 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11153
11704
  }] });
11154
11705
  },
11155
11706
  elements() {
11156
- let e = this.$el, t = x_(e, "[data-ui-scroll-area-viewport]") ?? e;
11707
+ let e = this.$el, t = Rv(e, "[data-ui-scroll-area-viewport]") ?? e;
11157
11708
  return {
11158
11709
  root: e,
11159
11710
  viewport: t,
11160
- content: x_(t, "[data-ui-scroll-area-content]"),
11161
- verticalScrollbar: x_(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"vertical\"]"),
11162
- horizontalScrollbar: x_(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"horizontal\"]"),
11163
- verticalThumb: x_(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"vertical\"] > [data-ui-scroll-area-thumb][data-orientation=\"vertical\"]"),
11164
- horizontalThumb: x_(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"horizontal\"] > [data-ui-scroll-area-thumb][data-orientation=\"horizontal\"]"),
11165
- corner: x_(e, "[data-ui-scroll-area-corner]")
11711
+ content: Rv(t, "[data-ui-scroll-area-content]"),
11712
+ verticalScrollbar: Rv(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"vertical\"]"),
11713
+ horizontalScrollbar: Rv(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"horizontal\"]"),
11714
+ verticalThumb: Rv(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"vertical\"] > [data-ui-scroll-area-thumb][data-orientation=\"vertical\"]"),
11715
+ horizontalThumb: Rv(e, "[data-ui-scroll-area-scrollbar][data-orientation=\"horizontal\"] > [data-ui-scroll-area-thumb][data-orientation=\"horizontal\"]"),
11716
+ corner: Rv(e, "[data-ui-scroll-area-corner]")
11166
11717
  };
11167
11718
  },
11168
11719
  scheduleSync() {
@@ -11177,7 +11728,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11177
11728
  },
11178
11729
  sync() {
11179
11730
  let e = this.elements(), { viewport: t } = e;
11180
- this.overflowX = h_(this.props.orientation, "x") && t.scrollWidth > t.clientWidth + 1, this.overflowY = h_(this.props.orientation, "y") && t.scrollHeight > t.clientHeight + 1, Q.setPresence({
11731
+ this.overflowX = Mv(this.props.orientation, "x") && t.scrollWidth > t.clientWidth + 1, this.overflowY = Mv(this.props.orientation, "y") && t.scrollHeight > t.clientHeight + 1, Q.setPresence({
11181
11732
  el: this.$el,
11182
11733
  attr: "data-overflow-x",
11183
11734
  present: this.overflowX
@@ -11210,7 +11761,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11210
11761
  updateGeometry(e) {
11211
11762
  let { viewport: t } = e, n = (e, n, r, i) => {
11212
11763
  if (!n || !r || !i) return r && (r.style.width = "", r.style.height = "", r.style.transform = ""), null;
11213
- let a = e === "y" ? n.clientHeight : n.clientWidth, o = e === "y" ? t.clientHeight : t.clientWidth, s = e === "y" ? t.scrollHeight : t.scrollWidth, c = Math.max(1, s - o), l = Math.min(a, Math.max(d_, o / s * a)), u = Math.max(0, a - l);
11764
+ let a = e === "y" ? n.clientHeight : n.clientWidth, o = e === "y" ? t.clientHeight : t.clientWidth, s = e === "y" ? t.scrollHeight : t.scrollWidth, c = Math.max(1, s - o), l = Math.min(a, Math.max(Ov, o / s * a)), u = Math.max(0, a - l);
11214
11765
  return e === "y" ? (r.style.height = `${l}px`, r.style.width = "") : (r.style.width = `${l}px`, r.style.height = ""), {
11215
11766
  trackLength: a,
11216
11767
  thumbLength: l,
@@ -11223,11 +11774,11 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11223
11774
  updateThumbPositions(e) {
11224
11775
  let { viewport: t } = e;
11225
11776
  if (e.verticalThumb && this.verticalGeometry) {
11226
- let { maxOffset: n, maxScroll: r } = this.verticalGeometry, i = n * m_(t.scrollTop / r, 0, 1);
11777
+ let { maxOffset: n, maxScroll: r } = this.verticalGeometry, i = n * jv(t.scrollTop / r, 0, 1);
11227
11778
  e.verticalThumb.style.transform = `translate3d(0, ${i}px, 0)`;
11228
11779
  }
11229
11780
  if (e.horizontalThumb && this.horizontalGeometry) {
11230
- let { maxOffset: n, maxScroll: r } = this.horizontalGeometry, i = n * m_(__(t) / r, 0, 1);
11781
+ let { maxOffset: n, maxScroll: r } = this.horizontalGeometry, i = n * jv(Pv(t) / r, 0, 1);
11231
11782
  e.horizontalThumb.style.transform = `translate3d(${i}px, 0, 0)`;
11232
11783
  }
11233
11784
  },
@@ -11255,7 +11806,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11255
11806
  e && Q.setPresence({
11256
11807
  el: e,
11257
11808
  attr: "data-dragging",
11258
- present: this.dragging?.axis === y_(e)
11809
+ present: this.dragging?.axis === Iv(e)
11259
11810
  });
11260
11811
  }), e.corner && Q.setPresence({
11261
11812
  el: e.corner,
@@ -11270,7 +11821,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11270
11821
  attr: "data-scrolling",
11271
11822
  present: !1
11272
11823
  }), this.updateVisibility(this.elements());
11273
- }, f_);
11824
+ }, kv);
11274
11825
  },
11275
11826
  clearFadeTimer() {
11276
11827
  this.fadeTimer &&= (window.clearTimeout(this.fadeTimer), 0);
@@ -11287,7 +11838,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11287
11838
  if (this.props.disabled) return;
11288
11839
  let n = this.elements(), r = n.viewport, i = t === "y" ? n.verticalScrollbar : n.horizontalScrollbar, a = t === "y" ? n.verticalThumb : n.horizontalThumb, o = t === "y" ? this.overflowY : this.overflowX;
11289
11840
  if (!i || !a || !o) return;
11290
- let s = t === "y" ? i.clientHeight : i.clientWidth, c = t === "y" ? a.offsetHeight : a.offsetWidth, l = t === "y" ? Math.max(0, r.scrollHeight - r.clientHeight) : Math.max(0, r.scrollWidth - r.clientWidth), u = t === "y" ? r.scrollTop : __(r);
11841
+ let s = t === "y" ? i.clientHeight : i.clientWidth, c = t === "y" ? a.offsetHeight : a.offsetWidth, l = t === "y" ? Math.max(0, r.scrollHeight - r.clientHeight) : Math.max(0, r.scrollWidth - r.clientWidth), u = t === "y" ? r.scrollTop : Pv(r);
11291
11842
  this.dragging = {
11292
11843
  axis: t,
11293
11844
  pointerId: e.pointerId,
@@ -11306,7 +11857,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11306
11857
  if (!this.dragging || this.dragging.pointerId !== e.pointerId) return;
11307
11858
  e.preventDefault();
11308
11859
  let t = this.elements().viewport, n = (this.dragging.axis === "y" ? e.clientY : e.clientX) - this.dragging.startPointer, r = Math.max(1, this.dragging.trackLength - this.dragging.thumbLength), i = this.dragging.startScroll + n / r * this.dragging.maxScroll;
11309
- this.dragging.axis === "y" ? t.scrollTop = m_(i, 0, this.dragging.maxScroll) : v_(t, i), this.schedulePositionSync();
11860
+ this.dragging.axis === "y" ? t.scrollTop = jv(i, 0, this.dragging.maxScroll) : Fv(t, i), this.schedulePositionSync();
11310
11861
  },
11311
11862
  onPointerUp(e) {
11312
11863
  if (!this.dragging || this.dragging.pointerId !== e.pointerId) return;
@@ -11316,9 +11867,9 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11316
11867
  } catch {}
11317
11868
  this.dragging = null, this.startFadeTimer(), this.sync();
11318
11869
  }
11319
- }), C_ = (e) => {
11320
- e.data("UiScrollArea", () => S_());
11321
- }, w_ = Y({ definition: {
11870
+ }), Bv = (e) => {
11871
+ e.data("UiScrollArea", () => zv());
11872
+ }, Vv = Y({ definition: {
11322
11873
  component: "ui.badge",
11323
11874
  parts: {
11324
11875
  root: {
@@ -11478,7 +12029,7 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11478
12029
  },
11479
12030
  class: "bg-danger-solid text-danger-contrast shadow-1"
11480
12031
  },
11481
- ...Qp,
12032
+ ...hh,
11482
12033
  {
11483
12034
  when: {
11484
12035
  insetLeft: !0,
@@ -11571,32 +12122,32 @@ var o_ = (e, t) => t.value || e.dataset.value || e.textContent?.trim() || "", s_
11571
12122
  },
11572
12123
  closeIcon: { base: "size-icon-xs shrink-0 fill-current text-current" }
11573
12124
  }
11574
- } }), T_ = [
12125
+ } }), Hv = [
11575
12126
  "soft",
11576
12127
  "surface",
11577
12128
  "outline",
11578
12129
  "solid"
11579
- ], E_ = [
12130
+ ], Uv = [
11580
12131
  "neutral",
11581
12132
  "accent",
11582
12133
  "success",
11583
12134
  "warning",
11584
12135
  "danger"
11585
- ], D_ = Fp, O_ = ["span", "button"], k_ = Rp, A_ = Lp, j_ = qp;
11586
- J(T_, "soft"), J(E_, "neutral"), J(D_, "sm"), J(j_, "sm"), J(O_, "span"), J(k_, "button"), J(A_, "mini"), J(k_, "button"), G.default("close"), J(A_, "mini"), J(D_, "sm"), G.default("Remove");
12136
+ ], Wv = Qm, Gv = ["span", "button"], Kv = th, qv = eh, Jv = uh;
12137
+ J(Hv, "soft"), J(Uv, "neutral"), J(Wv, "sm"), J(Jv, "sm"), J(Gv, "span"), J(Kv, "button"), J(qv, "mini"), J(Kv, "button"), G.default("close"), J(qv, "mini"), J(Wv, "sm"), G.default("Remove");
11587
12138
  //#endregion
11588
12139
  //#region src/components/select/contract.ts
11589
- var M_ = [
12140
+ var Yv = [
11590
12141
  "listbox",
11591
12142
  "combobox",
11592
12143
  "pillbox",
11593
12144
  "native"
11594
- ], N_ = Ip, P_ = Fp, F_ = qp, I_ = Bp, L_ = zp, R_ = Lp, z_ = {
12145
+ ], Xv = $m, Zv = Qm, Qv = uh, $v = rh, ey = nh, ty = eh, ny = {
11595
12146
  name: G,
11596
12147
  value: G,
11597
12148
  values: G,
11598
12149
  placeholder: G,
11599
- mode: J(M_, "listbox"),
12150
+ mode: J(Yv, "listbox"),
11600
12151
  multiple: q,
11601
12152
  searchable: q,
11602
12153
  filter: q.default(!0),
@@ -11616,11 +12167,11 @@ var M_ = [
11616
12167
  autoHighlight: q.default(!0),
11617
12168
  loop: q.default(!0),
11618
12169
  path: G,
11619
- size: J(P_, "lg"),
11620
- variant: J(N_, "outline"),
11621
- radius: J(F_, "md"),
11622
- side: J(I_, "bottom"),
11623
- align: J(L_, "start"),
12170
+ size: J(Zv, "lg"),
12171
+ variant: J(Xv, "outline"),
12172
+ radius: J(Qv, "md"),
12173
+ side: J($v, "bottom"),
12174
+ align: J(ey, "start"),
11624
12175
  offset: K.clamp(-100, 100).default(0),
11625
12176
  gap: K.clamp(0, 50).default(4),
11626
12177
  empty: G.default("No results found."),
@@ -11628,29 +12179,29 @@ var M_ = [
11628
12179
  searchIcon: G.default("search"),
11629
12180
  icon: G,
11630
12181
  iconTrailing: G.default("chevron__down"),
11631
- iconVariant: J(R_, "outline"),
12182
+ iconVariant: J(ty, "outline"),
11632
12183
  buttonClass: G,
11633
12184
  inputClass: G,
11634
12185
  searchClass: G,
11635
12186
  listboxClass: G,
11636
12187
  optionClass: G,
11637
- chipVariant: J(T_, "soft"),
11638
- chipColor: J(E_, "neutral"),
12188
+ chipVariant: J(Hv, "soft"),
12189
+ chipColor: J(Uv, "neutral"),
11639
12190
  chipClass: G,
11640
12191
  class: G
11641
12192
  };
11642
- J(R_, "outline"), K.clamp(0, 100).default(0);
12193
+ J(ty, "outline"), K.clamp(0, 100).default(0);
11643
12194
  //#endregion
11644
12195
  //#region src/components/select/styles.ts
11645
- var B_ = Y({ definition: {
12196
+ var ry = Y({ definition: {
11646
12197
  component: "ui.select",
11647
12198
  parts: {
11648
12199
  root: { base: "relative inline-grid w-full min-w-0" },
11649
12200
  control: {
11650
- base: [$p, em],
12201
+ base: [gh, _h],
11651
12202
  variants: {
11652
- size: tm,
11653
- variant: nm,
12203
+ size: vh,
12204
+ variant: yh,
11654
12205
  mode: {
11655
12206
  listbox: "",
11656
12207
  combobox: "",
@@ -11668,7 +12219,7 @@ var B_ = Y({ definition: {
11668
12219
  empty: !1
11669
12220
  },
11670
12221
  class: "!pl-1.5"
11671
- }, ...Qp],
12222
+ }, ...hh],
11672
12223
  defaults: {
11673
12224
  size: "lg",
11674
12225
  variant: "outline",
@@ -11680,9 +12231,9 @@ var B_ = Y({ definition: {
11680
12231
  button: { base: ["flex min-w-0 flex-1 items-center gap-2 border-0 bg-transparent p-0 text-left text-inherit outline-none", "disabled:cursor-not-allowed"] },
11681
12232
  value: { base: "min-w-0 flex-1" },
11682
12233
  placeholder: { base: "min-w-0 flex-1 text-foreground" },
11683
- input: { base: ["w-full min-w-16 flex-1", rm] },
12234
+ input: { base: ["w-full min-w-16 flex-1", bh] },
11684
12235
  search: { base: ["flex min-h-control-xlg shrink-0 items-center gap-2 border-b border-popover-border px-3", "text-sm text-foreground"] },
11685
- searchInput: { base: ["min-w-0 flex-1 text-sm", rm] },
12236
+ searchInput: { base: ["min-w-0 flex-1 text-sm", bh] },
11686
12237
  chips: { base: "flex min-w-0 flex-wrap items-center gap-1" },
11687
12238
  chip: { base: ["max-w-64"] },
11688
12239
  chipLabel: { base: "block min-w-0 flex-1 truncate" },
@@ -11695,11 +12246,11 @@ var B_ = Y({ definition: {
11695
12246
  } },
11696
12247
  defaults: { position: "leading" }
11697
12248
  },
11698
- action: { base: im },
11699
- popover: { base: [om, "overflow-hidden"] },
12249
+ action: { base: xh },
12250
+ popover: { base: [Ch, "overflow-hidden"] },
11700
12251
  viewport: { base: "grid auto-rows-min content-start max-h-combobox-listbox gap-1 overflow-x-hidden overflow-y-auto p-popover" },
11701
12252
  option: { base: [
11702
- cm,
12253
+ Th,
11703
12254
  "[&:has([data-ui-select-option-label]>*+*)]:h-auto",
11704
12255
  "[&:has([data-ui-select-option-label]>*+*)]:items-start",
11705
12256
  "[&:has([data-ui-select-option-label]>*+*)]:py-2"
@@ -11707,14 +12258,14 @@ var B_ = Y({ definition: {
11707
12258
  optionLabel: { base: "min-w-0 flex-1 truncate" },
11708
12259
  optionMeta: { base: "ml-auto text-menu-item-muted" },
11709
12260
  optionIcon: {
11710
- base: lm,
12261
+ base: Eh,
11711
12262
  variants: { position: {
11712
12263
  leading: "",
11713
12264
  trailing: "ml-auto"
11714
12265
  } },
11715
12266
  defaults: { position: "leading" }
11716
12267
  },
11717
- optionIndicator: { base: um },
12268
+ optionIndicator: { base: Dh },
11718
12269
  optionCheckbox: { base: ["ml-auto inline-flex size-icon-sm shrink-0 items-center justify-center rounded-1 border border-border bg-surface-panel text-accent-contrast", "data-selected:border-accent-solid data-selected:bg-accent-solid"] },
11719
12270
  group: { base: "grid auto-rows-min content-start gap-1" },
11720
12271
  label: { base: "px-menu-item-x py-1 text-menu-heading-fg" },
@@ -11723,9 +12274,9 @@ var B_ = Y({ definition: {
11723
12274
  separatorRule: { base: "h-px w-full border-0 bg-menu-separator" },
11724
12275
  nativeWrapper: { base: "relative w-full min-w-0" },
11725
12276
  native: {
11726
- base: [am, "appearance-none pe-10"],
11727
- variants: { size: tm },
11728
- compounds: Qp,
12277
+ base: [Sh, "appearance-none pe-10"],
12278
+ variants: { size: vh },
12279
+ compounds: hh,
11729
12280
  defaults: {
11730
12281
  size: "lg",
11731
12282
  radius: "md"
@@ -11733,23 +12284,23 @@ var B_ = Y({ definition: {
11733
12284
  },
11734
12285
  nativeIcon: { base: "pointer-events-none absolute right-3 top-1/2 size-icon -translate-y-1/2 fill-current text-icon" }
11735
12286
  }
11736
- } }), V_ = "[data-ui-select-option], [data-ui-select-option-create]", H_ = "template[data-ui-select-option-selected-template]", U_ = /* @__PURE__ */ new WeakSet(), W_ = (e, t) => e.composedPath().some((e) => e instanceof Element && e.matches(t)), G_ = (e) => {
12287
+ } }), iy = "[data-ui-select-option], [data-ui-select-option-create]", ay = "template[data-ui-select-option-selected-template]", oy = /* @__PURE__ */ new WeakSet(), sy = (e, t) => e.composedPath().some((e) => e instanceof Element && e.matches(t)), cy = (e) => {
11737
12288
  if (!(e instanceof Element)) {
11738
- e.childNodes.forEach((e) => G_(e));
12289
+ e.childNodes.forEach((e) => cy(e));
11739
12290
  return;
11740
12291
  }
11741
12292
  Array.from(e.attributes).forEach((t) => {
11742
12293
  let n = t.name;
11743
12294
  (n === "id" || n === "role" || n === "tabindex" || n.startsWith("aria-selected") || n.startsWith("aria-disabled") || n.startsWith("data-ui-select-option") || n.startsWith("data-selected") || n.startsWith("data-highlighted") || n.startsWith("data-disabled") || n.startsWith("x-") || n.startsWith("@") || n.startsWith(":") || n.startsWith("on")) && e.removeAttribute(n);
11744
- }), e.childNodes.forEach((e) => G_(e)), e.setAttribute("x-ignore", "true");
11745
- }, K_ = (e) => {
12295
+ }), e.childNodes.forEach((e) => cy(e)), e.setAttribute("x-ignore", "true");
12296
+ }, ly = (e) => {
11746
12297
  let t = document.createDocumentFragment();
11747
12298
  return Array.from(e).forEach((e) => {
11748
- if (e instanceof HTMLTemplateElement && e.matches(H_)) return;
12299
+ if (e instanceof HTMLTemplateElement && e.matches(ay)) return;
11749
12300
  let n = e.cloneNode(!0);
11750
- G_(n), t.append(n);
12301
+ cy(n), t.append(n);
11751
12302
  }), t;
11752
- }, q_ = () => ({
12303
+ }, uy = () => ({
11753
12304
  isOpen: !1,
11754
12305
  search: "",
11755
12306
  selectedValues: [],
@@ -11769,7 +12320,7 @@ var B_ = Y({ definition: {
11769
12320
  init() {
11770
12321
  this.props = W({
11771
12322
  el: this.$el,
11772
- schema: z_
12323
+ schema: ny
11773
12324
  }), this.buttonId = this.$id("select-button"), this.inputId = this.$id("select-input"), this.listboxId = this.$id("select-listbox"), this.isOpen = this.props.open && !this.props.disabled && !this.props.readonly;
11774
12325
  let e = this.options(), t = this.props.multiple ? [...Q.splitControlValues(this.props.values), ...Q.splitControlValues(this.props.value)] : Q.splitControlValues(this.props.value).slice(0, 1), n = e.filter((e) => Q.asBool({ value: e.el.dataset.selected })).map((e) => e.value);
11775
12326
  this.selectedValues = t.length > 0 ? t : n, this.props.multiple || (this.selectedValues = this.selectedValues.slice(0, 1)), this.selectedLabels = this.selectedValues.map((t) => e.find((e) => e.value === t)?.selectedLabel ?? t), this.popover = Q.createAnchoredPopover({
@@ -11790,7 +12341,7 @@ var B_ = Y({ definition: {
11790
12341
  },
11791
12342
  get root() {
11792
12343
  return Q.mergeBindings({ inputs: [X({
11793
- part: B_.parts.root,
12344
+ part: ry.parts.root,
11794
12345
  props: this.props,
11795
12346
  className: this.props.class
11796
12347
  }), {
@@ -11833,7 +12384,7 @@ var B_ = Y({ definition: {
11833
12384
  return this.$el.querySelector("[data-ui-select-hidden-inputs]");
11834
12385
  },
11835
12386
  options() {
11836
- let e = Q.normalizeOptionText(this.search), t = Array.from(this.$el.querySelectorAll(V_)).map((t, n) => {
12387
+ let e = Q.normalizeOptionText(this.search), t = Array.from(this.$el.querySelectorAll(iy)).map((t, n) => {
11837
12388
  let r = this.resolveOptionLabel(t), i = this.optionValue(t, r), a = this.resolveSelectedLabel(t, r), o = Q.asBool({ value: t.dataset.disabled }), s = this.selectedValues.includes(i), c = t.hasAttribute("data-ui-select-option-create"), l = !this.props.filter || e === "" || Q.normalizeOptionText(`${r} ${t.dataset.suffix ?? ""}`).includes(e), u = e !== "" && Q.normalizeOptionText(r) === e, d = Number(t.dataset.minLength ?? "0"), f = c ? e.length >= d && !u : l;
11838
12389
  return {
11839
12390
  el: t,
@@ -11886,18 +12437,7 @@ var B_ = Y({ definition: {
11886
12437
  closeSelect(e) {
11887
12438
  e?.preventDefault();
11888
12439
  let t = this.isOpen;
11889
- this.isOpen = !1, this.activeValue = "", this.search = "", this.inputSearching = !1, this.sync(), t && this.popoverMotion?.exit({
11890
- before: () => {
11891
- let e = this.popoverEl();
11892
- e.dataset.state = "closed", e.hidden = !1;
11893
- },
11894
- after: () => {
11895
- this.isOpen || (this.popoverEl().hidePopover?.(), this.unmount(), this.syncListbox(), Q.dispatch({
11896
- el: this.$el,
11897
- name: "ui:close"
11898
- }));
11899
- }
11900
- });
12440
+ this.isOpen = !1, this.activeValue = "", this.search = "", this.inputSearching = !1, this.syncClosedState(), t && this.exitPopover();
11901
12441
  },
11902
12442
  toggle(e) {
11903
12443
  if (e?.preventDefault(), this.isOpen) {
@@ -11979,18 +12519,7 @@ var B_ = Y({ definition: {
11979
12519
  let t = this.options();
11980
12520
  this.selectedLabels = this.selectedValues.map((e) => t.find((t) => t.value === e)?.selectedLabel ?? e), this.search = "", this.inputSearching = !1, this.isOpen = !0;
11981
12521
  } else this.selectedValues = [e.value], this.selectedLabels = [e.selectedLabel], this.search = "", this.inputSearching = !1, this.isOpen = !1;
11982
- this.sync(), n && !this.isOpen && this.popoverMotion?.exit({
11983
- before: () => {
11984
- let e = this.popoverEl();
11985
- e.dataset.state = "closed", e.hidden = !1;
11986
- },
11987
- after: () => {
11988
- this.isOpen || (this.popoverEl().hidePopover?.(), this.unmount(), this.syncListbox(), Q.dispatch({
11989
- el: this.$el,
11990
- name: "ui:close"
11991
- }));
11992
- }
11993
- }), Q.dispatchNativeControlChange({
12522
+ n && !this.isOpen ? this.syncClosedState() : this.sync(), n && !this.isOpen && this.exitPopover(), Q.dispatchNativeControlChange({
11994
12523
  container: this.hiddenInputsEl(),
11995
12524
  fallback: this.$el,
11996
12525
  marker: "data-ui-select-hidden-input"
@@ -12091,7 +12620,7 @@ var B_ = Y({ definition: {
12091
12620
  syncControl() {
12092
12621
  let e = this.control();
12093
12622
  e.setAttribute("class", X({
12094
- part: B_.parts.control,
12623
+ part: ry.parts.control,
12095
12624
  props: {
12096
12625
  ...this.props,
12097
12626
  mode: this.controlLayoutMode(),
@@ -12135,7 +12664,7 @@ var B_ = Y({ definition: {
12135
12664
  e.id ||= this.inputId;
12136
12665
  let t = this.selectedSummary();
12137
12666
  e.className = X({
12138
- part: B_.parts.input,
12667
+ part: ry.parts.input,
12139
12668
  className: this.props.inputClass
12140
12669
  }), this.isPillbox() ? (e.value = this.search, e.placeholder = this.hasSelection() ? "" : this.props.placeholder) : (e.value = this.isOpen && this.inputSearching ? this.search : t, e.placeholder = this.props.placeholder), e.setAttribute("role", "combobox"), e.setAttribute("autocomplete", "off"), e.setAttribute("aria-autocomplete", "list"), e.setAttribute("aria-expanded", this.isOpen ? "true" : "false"), e.setAttribute("aria-controls", this.listboxId), Q.syncNativeControl({
12141
12670
  input: e,
@@ -12159,11 +12688,14 @@ var B_ = Y({ definition: {
12159
12688
  syncListbox() {
12160
12689
  let e = this.popoverEl(), t = this.listbox();
12161
12690
  e.id = `${this.listboxId}-popover`, e.setAttribute("class", X({
12162
- part: B_.parts.popover,
12691
+ part: ry.parts.popover,
12163
12692
  props: this.props,
12164
12693
  className: this.props.listboxClass
12165
12694
  })), e.setAttribute("popover", "manual"), e.dataset.state = this.isOpen ? "open" : "closed", e.hidden = !this.isOpen, t.id = this.listboxId, t.setAttribute("role", "listbox"), t.setAttribute("tabindex", "-1"), t.setAttribute("aria-labelledby", this.trigger().id), this.props.multiple ? t.setAttribute("aria-multiselectable", "true") : t.removeAttribute("aria-multiselectable");
12166
12695
  },
12696
+ syncClosedState() {
12697
+ this.syncRoot(), this.syncControl(), this.syncTrigger(), this.syncInputs(), this.syncOptions(), this.syncChips(), this.syncHiddenInputs();
12698
+ },
12167
12699
  syncOptions() {
12168
12700
  let e = this.options(), t = this.$el.querySelector("[data-ui-select-option-empty]"), n = e.some((e) => e.visible && !e.create);
12169
12701
  e.forEach((e) => {
@@ -12215,7 +12747,7 @@ var B_ = Y({ definition: {
12215
12747
  });
12216
12748
  if (i === this.renderedChipsKey || (this.renderedChipsKey = i, e.replaceChildren(), e.hidden)) return;
12217
12749
  let a = X({
12218
- part: w_.parts.root,
12750
+ part: Vv.parts.root,
12219
12751
  props: {
12220
12752
  variant: this.props.chipVariant,
12221
12753
  color: this.props.chipColor,
@@ -12223,14 +12755,14 @@ var B_ = Y({ definition: {
12223
12755
  radius: "sm"
12224
12756
  },
12225
12757
  className: X({
12226
- part: B_.parts.chip,
12758
+ part: ry.parts.chip,
12227
12759
  props: {},
12228
12760
  className: this.props.chipClass
12229
12761
  })
12230
- }), o = X({ part: B_.parts.chipLabel }), s = X({
12231
- part: w_.parts.close,
12762
+ }), o = X({ part: ry.parts.chipLabel }), s = X({
12763
+ part: Vv.parts.close,
12232
12764
  props: { size: "sm" },
12233
- className: X({ part: B_.parts.chipRemove })
12765
+ className: X({ part: ry.parts.chipRemove })
12234
12766
  });
12235
12767
  r.forEach((t) => {
12236
12768
  let n = document.createElement("span");
@@ -12275,13 +12807,33 @@ var B_ = Y({ definition: {
12275
12807
  unmount() {
12276
12808
  this.popover?.unmount();
12277
12809
  },
12810
+ exitPopover() {
12811
+ let e = () => {
12812
+ let e = this.popoverEl();
12813
+ e.dataset.state = "closed", e.hidden = !1;
12814
+ };
12815
+ if (!this.popoverMotion) {
12816
+ e(), this.finishClose();
12817
+ return;
12818
+ }
12819
+ this.popoverMotion.exit({
12820
+ before: e,
12821
+ after: () => this.finishClose()
12822
+ });
12823
+ },
12824
+ finishClose() {
12825
+ this.isOpen || (this.popoverEl().hidePopover?.(), this.unmount(), this.syncListbox(), Q.dispatch({
12826
+ el: this.$el,
12827
+ name: "ui:close"
12828
+ }));
12829
+ },
12278
12830
  setup() {
12279
12831
  let e = this.control(), t = this.trigger(), n = this.popoverEl(), r = this.listbox(), i = this.input(), a = this.searchInput();
12280
12832
  Q.addListener({
12281
12833
  target: t,
12282
12834
  event: "click",
12283
12835
  handler: (e) => {
12284
- U_.add(e);
12836
+ oy.add(e);
12285
12837
  let n = e.target;
12286
12838
  if (n instanceof Element && n.closest("[data-ui-select-clear], [data-ui-select-button-clear]")) {
12287
12839
  this.clear(e);
@@ -12322,8 +12874,8 @@ var B_ = Y({ definition: {
12322
12874
  return;
12323
12875
  }
12324
12876
  if (n.closest("[data-ui-select-chip-remove]")) return;
12325
- if (W_(e, "[data-ui-select-trigger]")) {
12326
- if (U_.has(e)) return;
12877
+ if (sy(e, "[data-ui-select-trigger]")) {
12878
+ if (oy.has(e)) return;
12327
12879
  if (this.trigger().focus({ preventScroll: !0 }), t instanceof HTMLInputElement) {
12328
12880
  this.isOpen || this.openSelect(e);
12329
12881
  return;
@@ -12378,7 +12930,7 @@ var B_ = Y({ definition: {
12378
12930
  event: "pointerdown",
12379
12931
  handler: (e) => {
12380
12932
  let t = e.target;
12381
- t instanceof Element && t.closest(V_) && e.preventDefault();
12933
+ t instanceof Element && t.closest(iy) && e.preventDefault();
12382
12934
  },
12383
12935
  cleanup: this.listeners
12384
12936
  }), Q.addListener({
@@ -12391,7 +12943,7 @@ var B_ = Y({ definition: {
12391
12943
  this.setSearch("");
12392
12944
  return;
12393
12945
  }
12394
- let n = t.closest(V_), r = n ? this.options().find((e) => e.el === n) : void 0;
12946
+ let n = t.closest(iy), r = n ? this.options().find((e) => e.el === n) : void 0;
12395
12947
  r && this.selectOption(r, e);
12396
12948
  },
12397
12949
  cleanup: this.listeners
@@ -12401,7 +12953,7 @@ var B_ = Y({ definition: {
12401
12953
  handler: (e) => {
12402
12954
  let t = e.target;
12403
12955
  if (!(t instanceof Element)) return;
12404
- let n = t.closest(V_), r = n ? this.options().find((e) => e.el === n) : void 0;
12956
+ let n = t.closest(iy), r = n ? this.options().find((e) => e.el === n) : void 0;
12405
12957
  r && !r.disabled && this.setActive(r);
12406
12958
  },
12407
12959
  cleanup: this.listeners
@@ -12428,10 +12980,10 @@ var B_ = Y({ definition: {
12428
12980
  return e ? this.options().find((t) => t.value === e) ?? null : null;
12429
12981
  },
12430
12982
  selectedContent(e) {
12431
- let t = e.el.querySelector(H_);
12432
- if (t) return K_(t.content.childNodes);
12983
+ let t = e.el.querySelector(ay);
12984
+ if (t) return ly(t.content.childNodes);
12433
12985
  let n = e.el.querySelector("[data-ui-select-option-selected-content]") ?? e.el.querySelector("[data-ui-select-option-label]");
12434
- if (n) return K_(n.childNodes);
12986
+ if (n) return ly(n.childNodes);
12435
12987
  let r = document.createDocumentFragment();
12436
12988
  return r.append(document.createTextNode(e.selectedLabel)), r;
12437
12989
  },
@@ -12449,24 +13001,24 @@ var B_ = Y({ definition: {
12449
13001
  optionValue(e, t) {
12450
13002
  return e.dataset.value || t;
12451
13003
  }
12452
- }), J_ = (e) => {
12453
- e.data("UiSelect", () => q_());
12454
- }, Y_ = ["left", "right"], X_ = [
13004
+ }), dy = (e) => {
13005
+ e.data("UiSelect", () => uy());
13006
+ }, fy = ["left", "right"], py = [
12455
13007
  "none",
12456
13008
  "mobile",
12457
13009
  "desktop",
12458
13010
  "both"
12459
- ], Z_ = [
13011
+ ], my = [
12460
13012
  "toggle",
12461
13013
  "open",
12462
13014
  "close",
12463
13015
  "stash",
12464
13016
  "expand"
12465
- ], Q_ = ["a", "button"], $_ = ["ghost", "surface"], ev = ["neutral", "accent"], tv = {
13017
+ ], hy = ["a", "button"], gy = ["ghost", "surface"], _y = ["neutral", "accent"], vy = {
12466
13018
  id: G.default("ui-sidebar"),
12467
- side: J(Y_, "left"),
13019
+ side: J(fy, "left"),
12468
13020
  sticky: q.default(!0),
12469
- collapse: J(X_, "mobile"),
13021
+ collapse: J(py, "mobile"),
12470
13022
  open: q,
12471
13023
  stashed: q,
12472
13024
  persist: q.default(!0),
@@ -12479,14 +13031,14 @@ var B_ = Y({ definition: {
12479
13031
  resizable: q,
12480
13032
  class: G
12481
13033
  };
12482
- J(Q_, "a"), J($_, "ghost"), J(ev, "neutral"), q.default(!0);
12483
- var nv = {
13034
+ J(hy, "a"), J(gy, "ghost"), J(_y, "neutral"), q.default(!0);
13035
+ var yy = {
12484
13036
  target: G,
12485
13037
  icon: G.default("side_panel"),
12486
13038
  label: G.default("Toggle sidebar"),
12487
- action: J(Z_, "toggle"),
13039
+ action: J(my, "toggle"),
12488
13040
  class: G
12489
- }, rv = Y({ definition: {
13041
+ }, by = Y({ definition: {
12490
13042
  component: "ui.sidebar",
12491
13043
  parts: {
12492
13044
  root: {
@@ -12525,7 +13077,7 @@ var nv = {
12525
13077
  "group/sidebar-item flex h-control-md w-full min-w-0 select-none items-center gap-2 rounded-3 px-2",
12526
13078
  "border border-transparent text-left text-sm font-medium text-foreground outline-none",
12527
13079
  "cursor-default",
12528
- sm,
13080
+ wh,
12529
13081
  "focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app",
12530
13082
  "data-disabled:pointer-events-none data-disabled:opacity-50"
12531
13083
  ],
@@ -12609,35 +13161,35 @@ var nv = {
12609
13161
  defaults: { side: "left" }
12610
13162
  }
12611
13163
  }
12612
- } }), iv = {
12613
- target: nv.target,
12614
- action: nv.action,
12615
- class: nv.class
12616
- }, av = {
12617
- target: nv.target,
12618
- action: nv.action,
12619
- class: nv.class
12620
- }, ov = /* @__PURE__ */ new Set(), sv = {
13164
+ } }), xy = {
13165
+ target: yy.target,
13166
+ action: yy.action,
13167
+ class: yy.class
13168
+ }, Sy = {
13169
+ target: yy.target,
13170
+ action: yy.action,
13171
+ class: yy.class
13172
+ }, Cy = /* @__PURE__ */ new Set(), wy = {
12621
13173
  sm: 640,
12622
13174
  md: 768,
12623
13175
  lg: 1024,
12624
13176
  xl: 1280,
12625
13177
  "2xl": 1536
12626
- }, cv = (e, t) => !t?.id || t.id === e.id, lv = (e) => {
12627
- let t = sv[e];
12628
- return t ? `(min-width: ${t}px)` : /^\d+$/.test(e) ? `(min-width: ${e}px)` : /^\d+(\.\d+)?(px|rem|em)$/.test(e) ? `(min-width: ${e})` : `(min-width: ${sv.lg}px)`;
12629
- }, uv = (e) => e instanceof CustomEvent && typeof e.detail == "object" && e.detail !== null ? e.detail : {}, dv = (e) => e.target instanceof Element && e.target.hasAttribute("data-ui-sidebar"), fv = (e, t) => {
12630
- if (dv(e)) return;
12631
- let n = uv(e);
12632
- ov.forEach((e) => {
12633
- cv(e, n) && e.perform(n.action ?? t, n.trigger ?? null);
13178
+ }, Ty = (e, t) => !t?.id || t.id === e.id, Ey = (e) => {
13179
+ let t = wy[e];
13180
+ return t ? `(min-width: ${t}px)` : /^\d+$/.test(e) ? `(min-width: ${e}px)` : /^\d+(\.\d+)?(px|rem|em)$/.test(e) ? `(min-width: ${e})` : `(min-width: ${wy.lg}px)`;
13181
+ }, Dy = (e) => e instanceof CustomEvent && typeof e.detail == "object" && e.detail !== null ? e.detail : {}, Oy = (e) => e.target instanceof Element && e.target.hasAttribute("data-ui-sidebar"), ky = (e, t) => {
13182
+ if (Oy(e)) return;
13183
+ let n = Dy(e);
13184
+ Cy.forEach((e) => {
13185
+ Ty(e, n) && e.perform(n.action ?? t, n.trigger ?? null);
12634
13186
  });
12635
- }, pv = (() => {
13187
+ }, Ay = (() => {
12636
13188
  let e = !1;
12637
13189
  return () => {
12638
- e || typeof document > "u" || (document.addEventListener("ui:sidebar-open", (e) => fv(e, "open")), document.addEventListener("ui:sidebar-close", (e) => fv(e, "close")), document.addEventListener("ui:sidebar-toggle", (e) => fv(e, "toggle")), e = !0);
13190
+ e || typeof document > "u" || (document.addEventListener("ui:sidebar-open", (e) => ky(e, "open")), document.addEventListener("ui:sidebar-close", (e) => ky(e, "close")), document.addEventListener("ui:sidebar-toggle", (e) => ky(e, "toggle")), e = !0);
12639
13191
  };
12640
- })(), mv = () => ({
13192
+ })(), jy = () => ({
12641
13193
  props: null,
12642
13194
  mobileOpen: !1,
12643
13195
  desktopStashed: !1,
@@ -12662,18 +13214,18 @@ var nv = {
12662
13214
  return this.$el.id || this.props.id || "ui-sidebar";
12663
13215
  },
12664
13216
  init() {
12665
- pv(), this.props = W({
13217
+ Ay(), this.props = W({
12666
13218
  el: this.$el,
12667
- schema: tv
13219
+ schema: vy
12668
13220
  });
12669
13221
  let e = this.storedStashed();
12670
- this.currentWidth = this.props.width, this.mobileOpen = this.props.open, this.desktopStashed = e ?? this.props.stashed, this.mediaQuery = window.matchMedia(lv(this.props.breakpoint)), this.desktopMode = this.isDesktop(), this.drawerMotion = Q.motion.createPresenceLifecycle({
13222
+ this.currentWidth = this.props.width, this.mobileOpen = this.props.open, this.desktopStashed = e ?? this.props.stashed, this.mediaQuery = window.matchMedia(Ey(this.props.breakpoint)), this.desktopMode = this.isDesktop(), this.drawerMotion = Q.motion.createPresenceLifecycle({
12671
13223
  element: () => this.$el,
12672
13224
  preset: "sidebar"
12673
13225
  }), this.backdropMotion = Q.motion.createPresenceLifecycle({
12674
13226
  element: () => this.backdropEl(),
12675
13227
  preset: "fade"
12676
- }), ov.add(this), Q.addListener({
13228
+ }), Cy.add(this), Q.addListener({
12677
13229
  target: this.mediaQuery,
12678
13230
  event: "change",
12679
13231
  handler: () => this.handleBreakpointChange(),
@@ -12734,11 +13286,11 @@ var nv = {
12734
13286
  })), this.setupGroups(), this.syncAll();
12735
13287
  },
12736
13288
  destroy() {
12737
- this.props.disconnect(), this.drawerMotion?.destroy(), this.backdropMotion?.destroy(), this.clearSidebarExitFreeze(), ov.delete(this), this.cleanup.forEach((e) => e()), this.cleanup = [], this.hasScrollLock &&= (Pp(), !1);
13289
+ this.props.disconnect(), this.drawerMotion?.destroy(), this.backdropMotion?.destroy(), this.clearSidebarExitFreeze(), Cy.delete(this), this.cleanup.forEach((e) => e()), this.cleanup = [], this.hasScrollLock &&= (Zm(), !1);
12738
13290
  },
12739
13291
  get root() {
12740
13292
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
12741
- part: rv.parts.root,
13293
+ part: by.parts.root,
12742
13294
  props: this.props,
12743
13295
  className: this.props.class
12744
13296
  }), {
@@ -12878,7 +13430,7 @@ var nv = {
12878
13430
  attr: "data-resize-disabled",
12879
13431
  present: this.props.resizable && (!t || this.desktopStashed || this.desktopDrawerOpen),
12880
13432
  value: "true"
12881
- }), e ? (this.$el.removeAttribute("inert"), this.$el.removeAttribute("aria-hidden")) : (this.$el.setAttribute("inert", ""), this.$el.setAttribute("aria-hidden", "true")), o && !this.hasScrollLock ? (Np(), this.hasScrollLock = !0) : !o && this.hasScrollLock && (Pp(), this.hasScrollLock = !1), this.renderedExpanded = e, this.renderedDrawerOpen = this.hasOpenDrawer();
13433
+ }), e ? (this.$el.removeAttribute("inert"), this.$el.removeAttribute("aria-hidden")) : (this.$el.setAttribute("inert", ""), this.$el.setAttribute("aria-hidden", "true")), o && !this.hasScrollLock ? (Xm(), this.hasScrollLock = !0) : !o && this.hasScrollLock && (Zm(), this.hasScrollLock = !1), this.renderedExpanded = e, this.renderedDrawerOpen = this.hasOpenDrawer();
12882
13434
  },
12883
13435
  syncBackdrop() {
12884
13436
  let e = this.backdropEl();
@@ -13054,12 +13606,12 @@ var nv = {
13054
13606
  window.localStorage.setItem(this.storageKey(), this.desktopStashed ? "true" : "false");
13055
13607
  } catch {}
13056
13608
  }
13057
- }), hv = () => ({
13609
+ }), My = () => ({
13058
13610
  props: null,
13059
13611
  init() {
13060
13612
  this.props = W({
13061
13613
  el: this.$el,
13062
- schema: iv
13614
+ schema: xy
13063
13615
  });
13064
13616
  },
13065
13617
  destroy() {
@@ -13067,7 +13619,7 @@ var nv = {
13067
13619
  },
13068
13620
  get root() {
13069
13621
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
13070
- part: rv.parts.toggle,
13622
+ part: by.parts.toggle,
13071
13623
  props: {},
13072
13624
  className: this.props.class
13073
13625
  }), {
@@ -13090,12 +13642,12 @@ var nv = {
13090
13642
  }
13091
13643
  }));
13092
13644
  }
13093
- }), gv = () => ({
13645
+ }), Ny = () => ({
13094
13646
  props: null,
13095
13647
  init() {
13096
13648
  this.props = W({
13097
13649
  el: this.$el,
13098
- schema: av
13650
+ schema: Sy
13099
13651
  });
13100
13652
  },
13101
13653
  destroy() {
@@ -13103,7 +13655,7 @@ var nv = {
13103
13655
  },
13104
13656
  get root() {
13105
13657
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
13106
- part: rv.parts.edge,
13658
+ part: by.parts.edge,
13107
13659
  props: { side: this.$el.dataset.side || "left" },
13108
13660
  className: this.props.class
13109
13661
  }), {
@@ -13129,9 +13681,9 @@ var nv = {
13129
13681
  }
13130
13682
  }));
13131
13683
  }
13132
- }), _v = (e) => {
13133
- e.data("UiSidebar", () => mv()), e.data("UiSidebarEdge", () => gv()), e.data("UiSidebarToggle", () => hv());
13134
- }, vv = Fp, yv = Wp, bv = Hp, xv = {
13684
+ }), Py = (e) => {
13685
+ e.data("UiSidebar", () => jy()), e.data("UiSidebarEdge", () => Ny()), e.data("UiSidebarToggle", () => My());
13686
+ }, Fy = Qm, Iy = sh, Ly = ah, Ry = {
13135
13687
  name: G,
13136
13688
  value: G.default("0"),
13137
13689
  defaultValue: G,
@@ -13141,9 +13693,9 @@ var nv = {
13141
13693
  bigStep: K.default(10),
13142
13694
  minStepsBetween: K.default(0),
13143
13695
  range: q,
13144
- orientation: J(bv, "horizontal"),
13145
- size: J(vv, "md"),
13146
- variant: J(yv, "default"),
13696
+ orientation: J(Ly, "horizontal"),
13697
+ size: J(Fy, "md"),
13698
+ variant: J(Iy, "default"),
13147
13699
  disabled: q,
13148
13700
  required: q,
13149
13701
  invalid: q,
@@ -13171,11 +13723,11 @@ var nv = {
13171
13723
  K.default(0);
13172
13724
  //#endregion
13173
13725
  //#region src/components/slider/index.ts
13174
- var Sv = (e, t, n) => {
13726
+ var zy = (e, t, n) => {
13175
13727
  if (!Number.isFinite(n) || n <= 0) return e;
13176
13728
  let r = Math.round((e - t) / n) * n + t, i = Math.max(0, `${n}`.split(".")[1]?.length ?? 0);
13177
13729
  return Number(r.toFixed(i));
13178
- }, $ = (e, t, n) => Math.min(n, Math.max(t, e)), Cv = (e) => {
13730
+ }, $ = (e, t, n) => Math.min(n, Math.max(t, e)), By = (e) => {
13179
13731
  let t = Math.min(e.min, e.max), n = Math.max(e.min, e.max), r = e.step > 0 ? e.step : 1;
13180
13732
  return {
13181
13733
  min: t,
@@ -13183,28 +13735,28 @@ var Sv = (e, t, n) => {
13183
13735
  step: r,
13184
13736
  bigStep: e.bigStep > 0 ? e.bigStep : r * 10
13185
13737
  };
13186
- }, wv = (e, t) => {
13738
+ }, Vy = (e, t) => {
13187
13739
  let n = Number(e);
13188
13740
  return Number.isFinite(n) ? n : t;
13189
- }, Tv = (e, t) => {
13190
- let { min: n, max: r, step: i } = Cv(e), a = (e.value || e.defaultValue || "").split(",").map((e) => e.trim()), o = t.lowerInput ?? t.singleInput, s = t.upperInput, c = (e.range, o?.value || a[0] || `${n}`), l = e.range ? s?.value || a[1] || `${r}` : c, u = Sv($(wv(c, n), n, r), n, i), d = Sv($(wv(l, r), n, r), n, i);
13741
+ }, Hy = (e, t) => {
13742
+ let { min: n, max: r, step: i } = By(e), a = (e.value || e.defaultValue || "").split(",").map((e) => e.trim()), o = t.lowerInput ?? t.singleInput, s = t.upperInput, c = (e.range, o?.value || a[0] || `${n}`), l = e.range ? s?.value || a[1] || `${r}` : c, u = zy($(Vy(c, n), n, r), n, i), d = zy($(Vy(l, r), n, r), n, i);
13191
13743
  if (!e.range) return {
13192
13744
  lower: u,
13193
13745
  upper: u
13194
13746
  };
13195
13747
  u > d && ([u, d] = [d, u]);
13196
13748
  let f = Math.max(0, e.minStepsBetween) * i;
13197
- return d - u < f && (d = $(Sv(u + f, n, i), n, r), d - u < f && (u = $(Sv(d - f, n, i), n, r))), {
13749
+ return d - u < f && (d = $(zy(u + f, n, i), n, r), d - u < f && (u = $(zy(d - f, n, i), n, r))), {
13198
13750
  lower: u,
13199
13751
  upper: d
13200
13752
  };
13201
- }, Ev = (e, t, n) => n <= t ? 0 : $((e - t) / (n - t) * 100, 0, 100), Dv = (e, t) => {
13753
+ }, Uy = (e, t, n) => n <= t ? 0 : $((e - t) / (n - t) * 100, 0, 100), Wy = (e, t) => {
13202
13754
  let n = (t) => e.format === "percent" ? `${Math.round(t)}%` : String(t);
13203
13755
  return e.range ? `${n(t.lower)} - ${n(t.upper)}` : n(t.lower);
13204
- }, Ov = (e, t, n) => {
13205
- let { min: r, max: i, step: a } = Cv(n), o = e.getBoundingClientRect();
13206
- return Sv($(r + $(n.orientation === "vertical" ? 1 - (t.clientY - o.top) / Math.max(o.height, 1) : (t.clientX - o.left) / Math.max(o.width, 1), 0, 1) * (i - r), r, i), r, a);
13207
- }, kv = (e, t) => Math.abs(e - t.lower) <= Math.abs(e - t.upper) ? "lower" : "upper", Av = (e, t, n) => {
13756
+ }, Gy = (e, t, n) => {
13757
+ let { min: r, max: i, step: a } = By(n), o = e.getBoundingClientRect();
13758
+ return zy($(r + $(n.orientation === "vertical" ? 1 - (t.clientY - o.top) / Math.max(o.height, 1) : (t.clientX - o.left) / Math.max(o.width, 1), 0, 1) * (i - r), r, i), r, a);
13759
+ }, Ky = (e, t) => Math.abs(e - t.lower) <= Math.abs(e - t.upper) ? "lower" : "upper", qy = (e, t, n) => {
13208
13760
  e && (Q.setPresence({
13209
13761
  el: e,
13210
13762
  attr: "data-focus",
@@ -13214,7 +13766,7 @@ var Sv = (e, t, n) => {
13214
13766
  attr: "data-invalid",
13215
13767
  present: n
13216
13768
  }));
13217
- }, jv = ({ input: e, props: t, value: n, min: r, max: i, label: a, valueText: o, nativeRequired: s }) => {
13769
+ }, Jy = ({ input: e, props: t, value: n, min: r, max: i, label: a, valueText: o, nativeRequired: s }) => {
13218
13770
  e && (e.min = String(r), e.max = String(i), e.step = String(t.step > 0 ? t.step : 1), Q.syncNativeControl({
13219
13771
  input: e,
13220
13772
  state: {
@@ -13226,15 +13778,15 @@ var Sv = (e, t, n) => {
13226
13778
  invalid: t.invalid
13227
13779
  }
13228
13780
  }), e.setAttribute("aria-valuemin", String(r)), e.setAttribute("aria-valuemax", String(i)), e.setAttribute("aria-valuenow", String(n)), o ? e.setAttribute("aria-valuetext", o) : e.removeAttribute("aria-valuetext"), a && e.setAttribute("aria-label", a), t.orientation === "vertical" ? e.setAttribute("aria-orientation", "vertical") : e.removeAttribute("aria-orientation"));
13229
- }, Mv = (e, t, n) => {
13230
- let { min: r, max: i } = Cv(e), a = Ev(n.lower, r, i), o = Ev(n.upper, r, i), s = e.range ? a : 0, c = e.range ? o : a;
13781
+ }, Yy = (e, t, n) => {
13782
+ let { min: r, max: i } = By(e), a = Uy(n.lower, r, i), o = Uy(n.upper, r, i), s = e.range ? a : 0, c = e.range ? o : a;
13231
13783
  t.root.style.setProperty("--ui-slider-lower-percent", `${a}%`), t.root.style.setProperty("--ui-slider-upper-percent", `${o}%`), e.orientation === "vertical" ? (t.range && (t.range.style.bottom = `${s}%`, t.range.style.height = `${Math.max(0, c - s)}%`, t.range.style.left = "", t.range.style.width = ""), t.singleThumb && (t.singleThumb.style.bottom = `${a}%`), t.lowerThumb && (t.lowerThumb.style.bottom = `${a}%`), t.upperThumb && (t.upperThumb.style.bottom = `${o}%`)) : (t.range && (t.range.style.left = `${s}%`, t.range.style.width = `${Math.max(0, c - s)}%`, t.range.style.bottom = "", t.range.style.height = ""), t.singleThumb && (t.singleThumb.style.left = `${a}%`), t.lowerThumb && (t.lowerThumb.style.left = `${a}%`), t.upperThumb && (t.upperThumb.style.left = `${o}%`)), t.ticks.forEach((t) => {
13232
- let n = Ev(wv(t.dataset.value ?? "", r), r, i);
13784
+ let n = Uy(Vy(t.dataset.value ?? "", r), r, i);
13233
13785
  e.orientation === "vertical" ? (t.style.bottom = `${n}%`, t.style.left = "") : (t.style.left = `${n}%`, t.style.bottom = "");
13234
13786
  });
13235
- }, Nv = (e, t, n, r) => {
13236
- let { min: i, max: a, step: o } = Cv(e), s = e.range ? Math.max(0, e.minStepsBetween) * o : 0, c = Sv($(n.lower, i, a), i, o), l = Sv($(n.upper, i, a), i, o);
13237
- e.range ? (c > l && ([c, l] = [l, c]), l - c < s && (r?.dataset.thumb === "lower" ? c = $(Sv(l - s, i, o), i, a) : l = $(Sv(c + s, i, o), i, a))) : l = c, jv({
13787
+ }, Xy = (e, t, n, r) => {
13788
+ let { min: i, max: a, step: o } = By(e), s = e.range ? Math.max(0, e.minStepsBetween) * o : 0, c = zy($(n.lower, i, a), i, o), l = zy($(n.upper, i, a), i, o);
13789
+ e.range ? (c > l && ([c, l] = [l, c]), l - c < s && (r?.dataset.thumb === "lower" ? c = $(zy(l - s, i, o), i, a) : l = $(zy(c + s, i, o), i, a))) : l = c, Jy({
13238
13790
  input: t.singleInput,
13239
13791
  props: e,
13240
13792
  value: c,
@@ -13243,7 +13795,7 @@ var Sv = (e, t, n) => {
13243
13795
  label: e.label,
13244
13796
  valueText: e.valueText,
13245
13797
  nativeRequired: e.required
13246
- }), jv({
13798
+ }), Jy({
13247
13799
  input: t.lowerInput,
13248
13800
  props: e,
13249
13801
  value: c,
@@ -13252,7 +13804,7 @@ var Sv = (e, t, n) => {
13252
13804
  label: e.lowerLabel,
13253
13805
  valueText: e.lowerValueText,
13254
13806
  nativeRequired: !1
13255
- }), jv({
13807
+ }), Jy({
13256
13808
  input: t.upperInput,
13257
13809
  props: e,
13258
13810
  value: l,
@@ -13266,7 +13818,7 @@ var Sv = (e, t, n) => {
13266
13818
  lower: c,
13267
13819
  upper: l
13268
13820
  };
13269
- return Mv(e, t, u), t.value && (t.value.textContent = Dv(e, u)), Q.syncControlPresence({
13821
+ return Yy(e, t, u), t.value && (t.value.textContent = Wy(e, u)), Q.syncControlPresence({
13270
13822
  el: t.root,
13271
13823
  state: e
13272
13824
  }), t.track && Q.syncControlPresence({
@@ -13275,8 +13827,8 @@ var Sv = (e, t, n) => {
13275
13827
  disabled: e.disabled,
13276
13828
  invalid: e.invalid
13277
13829
  }
13278
- }), Av(t.singleThumb, t.singleInput === document.activeElement, e.invalid), Av(t.lowerThumb, t.lowerInput === document.activeElement, e.invalid), Av(t.upperThumb, t.upperInput === document.activeElement, e.invalid), u;
13279
- }, Pv = () => ({
13830
+ }), qy(t.singleThumb, t.singleInput === document.activeElement, e.invalid), qy(t.lowerThumb, t.lowerInput === document.activeElement, e.invalid), qy(t.upperThumb, t.upperInput === document.activeElement, e.invalid), u;
13831
+ }, Zy = () => ({
13280
13832
  props: null,
13281
13833
  listeners: [],
13282
13834
  hiddenInputsKey: "",
@@ -13284,7 +13836,7 @@ var Sv = (e, t, n) => {
13284
13836
  init() {
13285
13837
  this.props = W({
13286
13838
  el: this.$el,
13287
- schema: xv
13839
+ schema: Ry
13288
13840
  });
13289
13841
  let e = this.elements();
13290
13842
  [
@@ -13372,7 +13924,7 @@ var Sv = (e, t, n) => {
13372
13924
  };
13373
13925
  },
13374
13926
  sync() {
13375
- let e = this.elements(), t = Nv(this.props, e, Tv(this.props, e));
13927
+ let e = this.elements(), t = Xy(this.props, e, Hy(this.props, e));
13376
13928
  this.props.range && e.hiddenInputs ? this.hiddenInputsKey = Q.syncRepeatedHiddenInputs({
13377
13929
  container: e.hiddenInputs,
13378
13930
  currentKey: this.hiddenInputsKey,
@@ -13393,8 +13945,8 @@ var Sv = (e, t, n) => {
13393
13945
  }));
13394
13946
  },
13395
13947
  syncFromInput(e) {
13396
- let t = e.target instanceof HTMLInputElement ? e.target : null, n = this.elements(), r = Tv(this.props, n);
13397
- t?.dataset.thumb === "upper" ? r.upper = wv(t.value, r.upper) : r.lower = wv(t?.value ?? "", r.lower), Nv(this.props, n, r, t), this.sync();
13948
+ let t = e.target instanceof HTMLInputElement ? e.target : null, n = this.elements(), r = Hy(this.props, n);
13949
+ t?.dataset.thumb === "upper" ? r.upper = Vy(t.value, r.upper) : r.lower = Vy(t?.value ?? "", r.lower), Xy(this.props, n, r, t), this.sync();
13398
13950
  },
13399
13951
  commitFromInput(e) {
13400
13952
  this.syncFromInput(e);
@@ -13406,31 +13958,31 @@ var Sv = (e, t, n) => {
13406
13958
  "PageDown",
13407
13959
  "ArrowDown",
13408
13960
  "ArrowLeft"
13409
- ].includes(e.key) ? -1 : 1, { bigStep: r } = Cv(this.props);
13410
- t.value = String(wv(t.value, this.props.min) + n * r), t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 }));
13961
+ ].includes(e.key) ? -1 : 1, { bigStep: r } = By(this.props);
13962
+ t.value = String(Vy(t.value, this.props.min) + n * r), t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 }));
13411
13963
  },
13412
13964
  handlePointerDown(e) {
13413
13965
  if (this.props.disabled) return;
13414
- let t = this.elements(), n = Ov(t.root, e, this.props), r = Tv(this.props, t);
13415
- this.draggingThumb = this.props.range ? kv(n, r) : "single", this.draggingThumb === "upper" ? r.upper = n : r.lower = n;
13966
+ let t = this.elements(), n = Gy(t.root, e, this.props), r = Hy(this.props, t);
13967
+ this.draggingThumb = this.props.range ? Ky(n, r) : "single", this.draggingThumb === "upper" ? r.upper = n : r.lower = n;
13416
13968
  let i = this.draggingThumb === "upper" ? t.upperInput : this.props.range ? t.lowerInput : t.singleInput;
13417
- i?.focus(), Nv(this.props, t, r, i), this.sync(), t.root.setPointerCapture?.(e.pointerId), e.preventDefault();
13969
+ i?.focus(), Xy(this.props, t, r, i), this.sync(), t.root.setPointerCapture?.(e.pointerId), e.preventDefault();
13418
13970
  },
13419
13971
  handlePointerMove(e) {
13420
13972
  if (!this.draggingThumb || this.props.disabled) return;
13421
- let t = this.elements(), n = Tv(this.props, t), r = Ov(t.root, e, this.props);
13973
+ let t = this.elements(), n = Hy(this.props, t), r = Gy(t.root, e, this.props);
13422
13974
  this.draggingThumb === "upper" ? n.upper = r : n.lower = r;
13423
13975
  let i = this.draggingThumb === "upper" ? t.upperInput : this.props.range ? t.lowerInput : t.singleInput;
13424
- Nv(this.props, t, n, i), i?.dispatchEvent(new Event("input", { bubbles: !0 }));
13976
+ Xy(this.props, t, n, i), i?.dispatchEvent(new Event("input", { bubbles: !0 }));
13425
13977
  },
13426
13978
  handlePointerUp(e) {
13427
13979
  if (!this.draggingThumb) return;
13428
13980
  let t = this.elements();
13429
13981
  (this.draggingThumb === "upper" ? t.upperInput : this.props.range ? t.lowerInput : t.singleInput)?.dispatchEvent(new Event("change", { bubbles: !0 })), t.root.releasePointerCapture?.(e.pointerId), this.draggingThumb = null;
13430
13982
  }
13431
- }), Fv = (e) => {
13432
- e.data("UiSlider", () => Pv());
13433
- }, Iv = ["trailing", "leading"], Lv = Fp, Rv = Wp, zv = {
13983
+ }), Qy = (e) => {
13984
+ e.data("UiSlider", () => Zy());
13985
+ }, $y = ["trailing", "leading"], eb = Qm, tb = sh, nb = {
13434
13986
  value: G.default("on"),
13435
13987
  name: G,
13436
13988
  label: G,
@@ -13439,9 +13991,9 @@ var Sv = (e, t, n) => {
13439
13991
  disabled: q,
13440
13992
  required: q,
13441
13993
  invalid: q,
13442
- placement: J(Iv, "trailing"),
13443
- variant: J(Rv, "default"),
13444
- size: J(Lv, "md"),
13994
+ placement: J($y, "trailing"),
13995
+ variant: J(tb, "default"),
13996
+ size: J(eb, "md"),
13445
13997
  inputClass: G,
13446
13998
  trackClass: G,
13447
13999
  thumbClass: G,
@@ -13450,10 +14002,10 @@ var Sv = (e, t, n) => {
13450
14002
  descriptionClass: G,
13451
14003
  class: G
13452
14004
  };
13453
- ({ ...zv });
14005
+ ({ ...nb });
13454
14006
  //#endregion
13455
14007
  //#region src/components/switch/index.ts
13456
- var Bv = (e) => {
14008
+ var rb = (e) => {
13457
14009
  let t = e.querySelector("[data-ui-switch-input]");
13458
14010
  return t ? {
13459
14011
  root: e,
@@ -13464,7 +14016,7 @@ var Bv = (e) => {
13464
14016
  required: e.hasAttribute("data-required") || t.required,
13465
14017
  invalid: e.hasAttribute("data-invalid") || t.getAttribute("aria-invalid") === "true"
13466
14018
  } : null;
13467
- }, Vv = (e, t = {}) => {
14019
+ }, ib = (e, t = {}) => {
13468
14020
  let n = t.disabled ?? e.disabled, r = t.required ?? e.required, i = t.invalid ?? e.invalid, a = e.input.checked, o = a ? "checked" : "unchecked";
13469
14021
  Q.syncNativeControl({
13470
14022
  input: e.input,
@@ -13523,13 +14075,13 @@ var Bv = (e) => {
13523
14075
  attr: "data-disabled",
13524
14076
  present: n
13525
14077
  }));
13526
- }, Hv = () => ({
14078
+ }, ab = () => ({
13527
14079
  props: null,
13528
14080
  listeners: [],
13529
14081
  init() {
13530
14082
  this.props = W({
13531
14083
  el: this.$el,
13532
- schema: zv
14084
+ schema: nb
13533
14085
  });
13534
14086
  let e = this.input();
13535
14087
  Q.addListener({
@@ -13555,13 +14107,13 @@ var Bv = (e) => {
13555
14107
  return e;
13556
14108
  },
13557
14109
  item() {
13558
- let e = Bv(this.$el);
14110
+ let e = rb(this.$el);
13559
14111
  if (!e) throw Error("Switch requires a native checkbox input.");
13560
14112
  return e;
13561
14113
  },
13562
14114
  sync() {
13563
14115
  let e = this.item();
13564
- this.props.name && (e.input.name = this.props.name), this.props.value && (e.input.value = this.props.value), Vv(e, {
14116
+ this.props.name && (e.input.name = this.props.name), this.props.value && (e.input.value = this.props.value), ib(e, {
13565
14117
  disabled: this.props.disabled || e.disabled,
13566
14118
  required: this.props.required || e.required,
13567
14119
  invalid: this.props.invalid || e.invalid
@@ -13572,20 +14124,20 @@ var Bv = (e) => {
13572
14124
  let t = this.input();
13573
14125
  t.disabled || (e.preventDefault(), t.checked = !t.checked, t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })));
13574
14126
  }
13575
- }), Uv = (e) => {
13576
- e.data("UiSwitch", () => Hv());
13577
- }, Wv = ["manual", "automatic"], Gv = Hp;
13578
- [...Gv];
13579
- var Kv = {
14127
+ }), ob = (e) => {
14128
+ e.data("UiSwitch", () => ab());
14129
+ }, sb = ["manual", "automatic"], cb = ah;
14130
+ [...cb];
14131
+ var lb = {
13580
14132
  id: G.default("ui-tabs"),
13581
14133
  defaultValue: G,
13582
14134
  value: G,
13583
- activation: J(Wv, "manual"),
13584
- orientation: J(Gv, "horizontal"),
14135
+ activation: J(sb, "manual"),
14136
+ orientation: J(cb, "horizontal"),
13585
14137
  loop: q.default(!0),
13586
14138
  panels: G,
13587
14139
  class: G
13588
- }, qv = Y({ definition: {
14140
+ }, ub = Y({ definition: {
13589
14141
  component: "ui.tabs",
13590
14142
  parts: {
13591
14143
  root: {
@@ -13693,7 +14245,7 @@ var Kv = {
13693
14245
  panel: { base: "min-w-0 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:ring-offset-app" },
13694
14246
  panelInner: { base: "min-w-0" }
13695
14247
  }
13696
- } }), Jv = "ui-tabs", Yv = (e) => e ? "active" : "inactive", Xv = (e) => e instanceof HTMLButtonElement || e instanceof HTMLAnchorElement, Zv = (e) => Array.from(new Set(e)), Qv = (e) => e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || "tab", $v = (e, t) => `${e}-tab-${Qv(t)}`, ey = (e, t) => `${e}-panel-${Qv(t)}`, ty = (e) => Q.asBool({ value: e }), ny = () => ({
14248
+ } }), db = "ui-tabs", fb = (e) => e ? "active" : "inactive", pb = (e) => e instanceof HTMLButtonElement || e instanceof HTMLAnchorElement, mb = (e) => Array.from(new Set(e)), hb = (e) => e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || "tab", gb = (e, t) => `${e}-tab-${hb(t)}`, _b = (e, t) => `${e}-panel-${hb(t)}`, vb = (e) => Q.asBool({ value: e }), yb = () => ({
13697
14249
  props: null,
13698
14250
  activeValue: "",
13699
14251
  collection: null,
@@ -13701,7 +14253,7 @@ var Kv = {
13701
14253
  init() {
13702
14254
  this.props = W({
13703
14255
  el: this.$el,
13704
- schema: Kv
14256
+ schema: lb
13705
14257
  }), this.activeValue = this.initialValue(), this.setupEvents(), this.syncAll();
13706
14258
  },
13707
14259
  destroy() {
@@ -13709,7 +14261,7 @@ var Kv = {
13709
14261
  },
13710
14262
  get root() {
13711
14263
  return Q.mergeBindings({ inputs: [Q.resolveStyle({
13712
- part: qv.parts.root,
14264
+ part: ub.parts.root,
13713
14265
  props: this.props,
13714
14266
  className: this.props.class
13715
14267
  }), {
@@ -13719,7 +14271,7 @@ var Kv = {
13719
14271
  }] });
13720
14272
  },
13721
14273
  owner() {
13722
- return this.$el.id || this.props.id || this.$el.dataset.owner || Jv;
14274
+ return this.$el.id || this.props.id || this.$el.dataset.owner || db;
13723
14275
  },
13724
14276
  ownsElement(e) {
13725
14277
  return e.closest("[data-ui-tabs]") === this.$el;
@@ -13742,10 +14294,10 @@ var Kv = {
13742
14294
  return t === "vertical" || t === "horizontal" ? t : this.props.orientation;
13743
14295
  },
13744
14296
  tabs() {
13745
- return Array.from(this.$el.querySelectorAll("[data-ui-tabs-tab]")).filter((e) => this.ownsElement(e)).map((e, t) => Xv(e) ? (e.dataset.value || (e.dataset.value = `tab-${t + 1}`), {
14297
+ return Array.from(this.$el.querySelectorAll("[data-ui-tabs-tab]")).filter((e) => this.ownsElement(e)).map((e, t) => pb(e) ? (e.dataset.value || (e.dataset.value = `tab-${t + 1}`), {
13746
14298
  tab: e,
13747
14299
  value: e.dataset.value,
13748
- isDisabled: ty(e.dataset.disabled) || e.hasAttribute("disabled"),
14300
+ isDisabled: vb(e.dataset.disabled) || e.hasAttribute("disabled"),
13749
14301
  panel: this.panelForValue(e.dataset.value)
13750
14302
  }) : null).filter((e) => e !== null);
13751
14303
  },
@@ -13758,7 +14310,7 @@ var Kv = {
13758
14310
  let e = document.querySelector(this.props.panels);
13759
14311
  e && r.push(...Array.from(e.querySelectorAll("[data-ui-tabs-panel]")).filter(n));
13760
14312
  }
13761
- return r.push(...Array.from(document.querySelectorAll(t)).filter(n)), Zv(r);
14313
+ return r.push(...Array.from(document.querySelectorAll(t)).filter(n)), mb(r);
13762
14314
  },
13763
14315
  panelForValue(e) {
13764
14316
  return this.panels().find((t) => t.dataset.value === e) ?? null;
@@ -13766,8 +14318,8 @@ var Kv = {
13766
14318
  initialValue() {
13767
14319
  if (this.props.value) return this.props.value;
13768
14320
  if (this.props.defaultValue) return this.props.defaultValue;
13769
- let e = this.tabs().find((e) => ty(e.tab.dataset.selected) || e.tab.getAttribute("aria-selected") === "true");
13770
- return e ? e.value : this.panels().find((e) => ty(e.dataset.selected))?.dataset.value || this.fallbackValue();
14321
+ let e = this.tabs().find((e) => vb(e.tab.dataset.selected) || e.tab.getAttribute("aria-selected") === "true");
14322
+ return e ? e.value : this.panels().find((e) => vb(e.dataset.selected))?.dataset.value || this.fallbackValue();
13771
14323
  },
13772
14324
  fallbackValue() {
13773
14325
  return this.tabs().find((e) => !e.isDisabled)?.value ?? "";
@@ -13788,20 +14340,20 @@ var Kv = {
13788
14340
  syncList(e) {
13789
14341
  let t = this.listOrientation(e);
13790
14342
  e.setAttribute("role", "tablist"), e.dataset.orientation = t, e.className = Q.resolveStyle({
13791
- part: qv.parts.list,
14343
+ part: ub.parts.list,
13792
14344
  props: {
13793
14345
  variant: e.dataset.variant || "line",
13794
14346
  size: e.dataset.size || "md",
13795
14347
  orientation: t,
13796
- scrollable: ty(e.dataset.scrollable)
14348
+ scrollable: vb(e.dataset.scrollable)
13797
14349
  },
13798
14350
  className: e.dataset.class ?? ""
13799
14351
  }), t === "vertical" ? e.setAttribute("aria-orientation", "vertical") : e.removeAttribute("aria-orientation");
13800
14352
  },
13801
14353
  syncTab(e) {
13802
- let t = e.value === this.activeValue, n = e.tab.getAttribute("data-active") === "true" || document.activeElement === e.tab, r = Yv(t), i = e.tab.dataset.uiTabsOwner || e.tab.dataset.owner || this.owner(), a = e.panel?.id || ey(i, e.value), o = this.listOrientation(e.tab.closest("[data-ui-tabs-list]")), s = e.tab.closest("[data-ui-tabs-list]")?.dataset.variant || this.listVariant(), c = e.tab.closest("[data-ui-tabs-list]")?.dataset.size || this.listSize(), l = e.tab.querySelector("[data-ui-tabs-tab-selected-icon]");
13803
- if (e.tab.id ||= $v(i, e.value), e.tab.dataset.state = r, e.tab.dataset.orientation = o, e.tab.dataset.variant = s, e.tab.dataset.size = c, e.tab.setAttribute("role", "tab"), e.tab.setAttribute("aria-selected", t ? "true" : "false"), e.tab.setAttribute("aria-controls", a), e.tab.tabIndex = t || n ? 0 : -1, e.tab.className = Q.resolveStyle({
13804
- part: qv.parts.tab,
14354
+ let t = e.value === this.activeValue, n = e.tab.getAttribute("data-active") === "true" || document.activeElement === e.tab, r = fb(t), i = e.tab.dataset.uiTabsOwner || e.tab.dataset.owner || this.owner(), a = e.panel?.id || _b(i, e.value), o = this.listOrientation(e.tab.closest("[data-ui-tabs-list]")), s = e.tab.closest("[data-ui-tabs-list]")?.dataset.variant || this.listVariant(), c = e.tab.closest("[data-ui-tabs-list]")?.dataset.size || this.listSize(), l = e.tab.querySelector("[data-ui-tabs-tab-selected-icon]");
14355
+ if (e.tab.id ||= gb(i, e.value), e.tab.dataset.state = r, e.tab.dataset.orientation = o, e.tab.dataset.variant = s, e.tab.dataset.size = c, e.tab.setAttribute("role", "tab"), e.tab.setAttribute("aria-selected", t ? "true" : "false"), e.tab.setAttribute("aria-controls", a), e.tab.tabIndex = t || n ? 0 : -1, e.tab.className = Q.resolveStyle({
14356
+ part: ub.parts.tab,
13805
14357
  props: {
13806
14358
  variant: s,
13807
14359
  size: c,
@@ -13820,9 +14372,9 @@ var Kv = {
13820
14372
  e.tab.removeAttribute("data-disabled"), e.tab.removeAttribute("aria-disabled"), e.tab instanceof HTMLButtonElement && (e.tab.disabled = !1);
13821
14373
  },
13822
14374
  syncPanel(e) {
13823
- let t = e.dataset.value || "", n = t === this.activeValue, r = e.dataset.uiTabsOwner || e.dataset.owner || this.owner(), i = $v(r, t), a = ey(r, t);
13824
- t && !e.id && (e.id = a), !e.getAttribute("data-ui-key") && t && e.setAttribute("data-ui-key", e.id || a), e.dataset.state = Yv(n), e.dataset.orientation = this.props.orientation, e.setAttribute("role", "tabpanel"), e.setAttribute("aria-labelledby", i), e.hasAttribute("tabindex") || (e.tabIndex = 0), e.hidden = !n, e.className = Q.resolveStyle({
13825
- part: qv.parts.panel,
14375
+ let t = e.dataset.value || "", n = t === this.activeValue, r = e.dataset.uiTabsOwner || e.dataset.owner || this.owner(), i = gb(r, t), a = _b(r, t);
14376
+ t && !e.id && (e.id = a), !e.getAttribute("data-ui-key") && t && e.setAttribute("data-ui-key", e.id || a), e.dataset.state = fb(n), e.dataset.orientation = this.props.orientation, e.setAttribute("role", "tabpanel"), e.setAttribute("aria-labelledby", i), e.hasAttribute("tabindex") || (e.tabIndex = 0), e.hidden = !n, e.className = Q.resolveStyle({
14377
+ part: ub.parts.panel,
13826
14378
  props: this.props,
13827
14379
  className: e.dataset.class ?? ""
13828
14380
  }), Q.setPresence({
@@ -13856,7 +14408,7 @@ var Kv = {
13856
14408
  },
13857
14409
  tabFromEvent(e) {
13858
14410
  let t = (e.target instanceof Element ? e.target : null)?.closest("[data-ui-tabs-tab]") ?? null;
13859
- return !Xv(t) || !this.ownsElement(t) ? null : t;
14411
+ return !pb(t) || !this.ownsElement(t) ? null : t;
13860
14412
  },
13861
14413
  itemFromTab(e) {
13862
14414
  return this.tabs().find((t) => t.tab === e) ?? null;
@@ -13865,7 +14417,7 @@ var Kv = {
13865
14417
  return this.collection ||= Q.createCollectionNavigation({
13866
14418
  root: () => this.$el,
13867
14419
  itemSelector: "[data-ui-tabs-tab]",
13868
- isDisabled: (e) => !this.ownsElement(e) || ty(e.dataset.disabled) || e.hasAttribute("disabled"),
14420
+ isDisabled: (e) => !this.ownsElement(e) || vb(e.dataset.disabled) || e.hasAttribute("disabled"),
13869
14421
  loop: () => this.props.loop
13870
14422
  }), this.collection;
13871
14423
  },
@@ -13935,7 +14487,7 @@ var Kv = {
13935
14487
  activateFocused() {
13936
14488
  if (this.props.activation !== "automatic") return;
13937
14489
  let e = document.activeElement;
13938
- if (!Xv(e)) return;
14490
+ if (!pb(e)) return;
13939
14491
  let t = this.itemFromTab(e);
13940
14492
  t && !t.isDisabled && this.setActiveValue(t.value, e);
13941
14493
  },
@@ -13956,38 +14508,38 @@ var Kv = {
13956
14508
  }
13957
14509
  });
13958
14510
  }
13959
- }), ry = (e) => {
13960
- e.data("UiTabs", () => ny());
13961
- }, iy = [
14511
+ }), bb = (e) => {
14512
+ e.data("UiTabs", () => yb());
14513
+ }, xb = [
13962
14514
  "info",
13963
14515
  "success",
13964
14516
  "warning",
13965
14517
  "danger",
13966
14518
  "debug"
13967
- ], ay = [
14519
+ ], Sb = [
13968
14520
  "auto",
13969
14521
  "neutral",
13970
14522
  "accent",
13971
14523
  "success",
13972
14524
  "warning",
13973
14525
  "danger"
13974
- ], oy = [
14526
+ ], Cb = [
13975
14527
  "default",
13976
14528
  "soft",
13977
14529
  "surface",
13978
14530
  "solid",
13979
14531
  "outline"
13980
- ], sy = [
14532
+ ], wb = [
13981
14533
  "top-right",
13982
14534
  "top-left",
13983
14535
  "top-center",
13984
14536
  "bottom-right",
13985
14537
  "bottom-left",
13986
14538
  "bottom-center"
13987
- ], cy = {
13988
- level: J(iy, "info"),
13989
- color: J(ay, "auto"),
13990
- variant: J(oy, "default"),
14539
+ ], Tb = {
14540
+ level: J(xb, "info"),
14541
+ color: J(Sb, "auto"),
14542
+ variant: J(Cb, "default"),
13991
14543
  title: G,
13992
14544
  description: G,
13993
14545
  duration: K.default(5e3).min(0),
@@ -13995,13 +14547,13 @@ var Kv = {
13995
14547
  class: G,
13996
14548
  contentClass: G,
13997
14549
  closeClass: G
13998
- }, ly = {
14550
+ }, Eb = {
13999
14551
  id: G.default("ui-toast-root"),
14000
- position: J(sy, "top-right"),
14552
+ position: J(wb, "top-right"),
14001
14553
  duration: K.default(5e3).min(0),
14002
14554
  includeMessages: q.default(!0),
14003
14555
  class: G
14004
- }, uy = Y({ definition: {
14556
+ }, Db = Y({ definition: {
14005
14557
  component: "ui.toast",
14006
14558
  parts: {
14007
14559
  root: {
@@ -14222,52 +14774,52 @@ var Kv = {
14222
14774
  defaults: { position: "top-right" }
14223
14775
  }
14224
14776
  }
14225
- } }), dy = (e) => e === "info" || e === "success" || e === "warning" || e === "danger" || e === "debug", fy = (e) => e === "auto" || e === "neutral" || e === "accent" || e === "success" || e === "warning" || e === "danger", py = (e) => e === "default" || e === "soft" || e === "surface" || e === "solid" || e === "outline", my = (e) => e === "info" ? "accent" : e === "success" || e === "warning" || e === "danger" ? e : "neutral", hy = (e, t) => fy(e) && e !== "auto" ? e : my(t), gy = (e, t) => {
14777
+ } }), Ob = (e) => e === "info" || e === "success" || e === "warning" || e === "danger" || e === "debug", kb = (e) => e === "auto" || e === "neutral" || e === "accent" || e === "success" || e === "warning" || e === "danger", Ab = (e) => e === "default" || e === "soft" || e === "surface" || e === "solid" || e === "outline", jb = (e) => e === "info" ? "accent" : e === "success" || e === "warning" || e === "danger" ? e : "neutral", Mb = (e, t) => kb(e) && e !== "auto" ? e : jb(t), Nb = (e, t) => {
14226
14778
  let n = typeof e == "number" ? e : Number(e);
14227
14779
  return Number.isFinite(n) && n >= 0 ? n : t;
14228
- }, _y = (e) => Math.min(e, 3), vy = /* @__PURE__ */ new WeakMap(), yy = (e) => {
14780
+ }, Pb = (e) => Math.min(e, 3), Fb = /* @__PURE__ */ new WeakMap(), Ib = (e) => {
14229
14781
  let t = Array.from(e.querySelectorAll(":scope > [data-ui-toast]"));
14230
14782
  e.dataset.stack = t.length > 1 ? "collapsed" : "single";
14231
- let n = window.getComputedStyle(e), r = Number.parseFloat(n.rowGap || n.gap || "0") || 0, i = t.map((e) => Math.ceil(e.scrollHeight || e.getBoundingClientRect().height)), a = i[0] ?? 0, o = Number.parseFloat(n.getPropertyValue("--ui-toast-stack-peek")) || 8, s = e.dataset.position?.startsWith("bottom") ? -1 : 1, c = _y(Math.max(0, t.length - 1)), l = i.reduce((e, t) => e + t, 0) + Math.max(0, t.length - 1) * r, u = a + c * o;
14783
+ let n = window.getComputedStyle(e), r = Number.parseFloat(n.rowGap || n.gap || "0") || 0, i = t.map((e) => Math.ceil(e.scrollHeight || e.getBoundingClientRect().height)), a = i[0] ?? 0, o = Number.parseFloat(n.getPropertyValue("--ui-toast-stack-peek")) || 8, s = e.dataset.position?.startsWith("bottom") ? -1 : 1, c = Pb(Math.max(0, t.length - 1)), l = i.reduce((e, t) => e + t, 0) + Math.max(0, t.length - 1) * r, u = a + c * o;
14232
14784
  e.style.setProperty("--ui-toast-front-height", `${a}px`), e.style.setProperty("--ui-toast-stack-height", `${u}px`), e.style.setProperty("--ui-toast-stack-expanded-height", `${l}px`), t.forEach((e, n) => {
14233
- let r = _y(n), i = Math.max(.91, 1 - r * .03), a = Math.max(.72, 1 - r * .08);
14785
+ let r = Pb(n), i = Math.max(.91, 1 - r * .03), a = Math.max(.72, 1 - r * .08);
14234
14786
  e.dataset.state !== "closed" && (e.style.removeProperty("opacity"), e.style.removeProperty("transform")), e.dataset.stackIndex = String(n), e.style.setProperty("--ui-toast-stack-index", String(n)), e.style.setProperty("--ui-toast-stack-depth", String(r)), e.style.setProperty("--ui-toast-stack-direction", String(s)), e.style.setProperty("--ui-toast-stack-offset", `${r * o * s}px`), e.style.setProperty("--ui-toast-stack-scale", String(i)), e.style.setProperty("--ui-toast-stack-opacity", String(a)), e.style.zIndex = String(t.length - n);
14235
14787
  });
14236
- }, by = (e) => {
14788
+ }, Lb = (e) => {
14237
14789
  let t = e.parentElement instanceof HTMLElement ? e.parentElement : null;
14238
- e.dataset.state = "closed", e.remove(), t?.matches("[data-ui-toast-outlet]") && yy(t);
14239
- }, xy = (e) => {
14240
- vy.get(e)?.cancel();
14790
+ e.dataset.state = "closed", e.remove(), t?.matches("[data-ui-toast-outlet]") && Ib(t);
14791
+ }, Rb = (e) => {
14792
+ Fb.get(e)?.cancel();
14241
14793
  let t = Q.motion.animatePresence(e, "enter", "toast");
14242
- vy.set(e, t), t.finished.finally(() => {
14243
- if (vy.get(e) !== t) return;
14244
- vy.delete(e), e.style.removeProperty("opacity"), e.style.removeProperty("transform");
14794
+ Fb.set(e, t), t.finished.finally(() => {
14795
+ if (Fb.get(e) !== t) return;
14796
+ Fb.delete(e), e.style.removeProperty("opacity"), e.style.removeProperty("transform");
14245
14797
  let n = e.parentElement instanceof HTMLElement && e.parentElement.matches("[data-ui-toast-outlet]") ? e.parentElement : null;
14246
- n && yy(n);
14798
+ n && Ib(n);
14247
14799
  });
14248
- }, Sy = (e) => {
14800
+ }, zb = (e) => {
14249
14801
  if (!e.isConnected) return;
14250
- e.dataset.state = "closed", vy.get(e)?.cancel();
14802
+ e.dataset.state = "closed", Fb.get(e)?.cancel();
14251
14803
  let t = Q.motion.animatePresence(e, "exit", "toast");
14252
- vy.set(e, t), t.finished.finally(() => {
14253
- vy.get(e) === t && (vy.delete(e), by(e));
14804
+ Fb.set(e, t), t.finished.finally(() => {
14805
+ Fb.get(e) === t && (Fb.delete(e), Lb(e));
14254
14806
  });
14255
- }, Cy = (e) => {
14807
+ }, Bb = (e) => {
14256
14808
  let t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
14257
14809
  t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), t.setAttribute("data-ui-toast-close-icon", ""), t.setAttribute("class", e);
14258
14810
  let n = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
14259
14811
  return n.setAttribute("points", "17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16"), t.append(n), t;
14260
- }, wy = () => ({
14812
+ }, Vb = () => ({
14261
14813
  props: null,
14262
14814
  cleanup: [],
14263
14815
  timer: null,
14264
14816
  init() {
14265
14817
  this.props = W({
14266
14818
  el: this.$el,
14267
- schema: cy
14819
+ schema: Tb
14268
14820
  });
14269
14821
  let e = this.$el, t = e.parentElement instanceof HTMLElement && e.parentElement.matches("[data-ui-toast-outlet]") ? e.parentElement : null;
14270
- e.dataset.state = "open", e.setAttribute("data-ui-motion-owner", "component"), t && yy(t), xy(e), this.props.dismissible && Q.addListener({
14822
+ e.dataset.state = "open", e.setAttribute("data-ui-motion-owner", "component"), t && Ib(t), Rb(e), this.props.dismissible && Q.addListener({
14271
14823
  target: e,
14272
14824
  event: "click",
14273
14825
  handler: (e) => {
@@ -14278,19 +14830,19 @@ var Kv = {
14278
14830
  }), this.props.duration > 0 && (this.timer = window.setTimeout(() => this.dismiss(), this.props.duration));
14279
14831
  },
14280
14832
  destroy() {
14281
- this.props.disconnect(), this.cleanup.forEach((e) => e()), this.cleanup = [], this.timer !== null && window.clearTimeout(this.timer), vy.get(this.$el)?.cancel();
14833
+ this.props.disconnect(), this.cleanup.forEach((e) => e()), this.cleanup = [], this.timer !== null && window.clearTimeout(this.timer), Fb.get(this.$el)?.cancel();
14282
14834
  },
14283
14835
  dismiss() {
14284
14836
  let e = this.$el;
14285
14837
  this.timer !== null && window.clearTimeout(this.timer), Q.dispatch({
14286
14838
  el: e,
14287
14839
  name: "ui:dismiss"
14288
- }), Sy(e);
14840
+ }), zb(e);
14289
14841
  }
14290
- }), Ty = (e, t) => {
14291
- let n = dy(e.level) ? e.level : "info", r = hy(e.color, n), i = py(e.variant) ? e.variant : "default", a = typeof e.title == "string" ? e.title : "", o = typeof e.description == "string" ? e.description : "", s = o.trim().length > 0, c = r !== "neutral" && i !== "solid" && i !== "default", l = gy(e.duration, t), u = typeof e.dismissible == "boolean" ? e.dismissible : !0, d = n === "danger" || n === "warning", f = document.createElement("div");
14842
+ }), Hb = (e, t) => {
14843
+ let n = Ob(e.level) ? e.level : "info", r = Mb(e.color, n), i = Ab(e.variant) ? e.variant : "default", a = typeof e.title == "string" ? e.title : "", o = typeof e.description == "string" ? e.description : "", s = o.trim().length > 0, c = r !== "neutral" && i !== "solid" && i !== "default", l = Nb(e.duration, t), u = typeof e.dismissible == "boolean" ? e.dismissible : !0, d = n === "danger" || n === "warning", f = document.createElement("div");
14292
14844
  f.dataset.uiToast = "", f.dataset.level = n, f.dataset.color = r, f.dataset.variant = i, f.dataset.duration = String(l), f.dataset.dismissible = String(u), f.dataset.description = String(s), f.dataset.state = "open", f.setAttribute("role", d ? "alert" : "status"), f.setAttribute("aria-live", d ? "assertive" : "polite"), f.setAttribute("aria-atomic", "true"), f.className = Q.resolveStyle({
14293
- part: uy.parts.root,
14845
+ part: Db.parts.root,
14294
14846
  props: {
14295
14847
  variant: i,
14296
14848
  color: r,
@@ -14300,45 +14852,45 @@ var Kv = {
14300
14852
  });
14301
14853
  let p = document.createElement("span");
14302
14854
  p.dataset.uiToastMarker = "", p.setAttribute("aria-hidden", "true"), p.className = Q.resolveStyle({
14303
- part: uy.parts.marker,
14855
+ part: Db.parts.marker,
14304
14856
  props: {
14305
14857
  variant: i,
14306
14858
  color: r
14307
14859
  }
14308
14860
  }), f.append(p);
14309
14861
  let m = document.createElement("div");
14310
- if (m.dataset.uiToastContent = "", m.className = Q.resolveStyle({ part: uy.parts.content }), a) {
14862
+ if (m.dataset.uiToastContent = "", m.className = Q.resolveStyle({ part: Db.parts.content }), a) {
14311
14863
  let e = document.createElement("strong");
14312
14864
  e.dataset.uiToastTitle = "", e.className = `text-sm font-medium text-foreground ${Q.resolveStyle({
14313
- part: uy.parts.title,
14865
+ part: Db.parts.title,
14314
14866
  props: { variant: i }
14315
14867
  })}`, e.textContent = a, m.append(e);
14316
14868
  }
14317
14869
  if (s) {
14318
14870
  let e = document.createElement("div");
14319
14871
  e.dataset.uiToastDescription = "", e.className = `text-sm text-foreground-muted ${Q.resolveStyle({
14320
- part: uy.parts.description,
14872
+ part: Db.parts.description,
14321
14873
  props: { variant: i }
14322
14874
  })}`, e.textContent = o, m.append(e);
14323
14875
  }
14324
14876
  if (f.append(m), u) {
14325
14877
  let e = document.createElement("button");
14326
14878
  e.type = "button", e.dataset.uiToastClose = "", e.setAttribute("aria-label", "Dismiss notification"), e.className = Q.resolveStyle({
14327
- part: uy.parts.close,
14879
+ part: Db.parts.close,
14328
14880
  props: { variant: i }
14329
- }), e.append(Cy(Q.resolveStyle({ part: uy.parts.closeIcon }))), e.addEventListener("click", () => Sy(f)), f.append(e);
14881
+ }), e.append(Bb(Q.resolveStyle({ part: Db.parts.closeIcon }))), e.addEventListener("click", () => zb(f)), f.append(e);
14330
14882
  }
14331
- return l > 0 && window.setTimeout(() => Sy(f), l), f;
14332
- }, Ey = () => ({
14883
+ return l > 0 && window.setTimeout(() => zb(f), l), f;
14884
+ }, Ub = () => ({
14333
14885
  props: null,
14334
14886
  cleanup: [],
14335
14887
  init() {
14336
14888
  this.props = W({
14337
14889
  el: this.$el,
14338
- schema: ly
14890
+ schema: Eb
14339
14891
  });
14340
14892
  let e = this.$el;
14341
- yy(e), Q.addListener({
14893
+ Ib(e), Q.addListener({
14342
14894
  target: e,
14343
14895
  event: "pointerover",
14344
14896
  handler: () => {
@@ -14385,12 +14937,12 @@ var Kv = {
14385
14937
  add(e) {
14386
14938
  let t = typeof e.title == "string" ? e.title : "", n = typeof e.description == "string" ? e.description : "";
14387
14939
  if (!t.trim() && !n.trim()) return;
14388
- let r = this.$el, i = Ty(e, this.props.duration);
14389
- i.setAttribute("data-ui-motion-owner", "component"), r.append(i), yy(r), xy(i);
14940
+ let r = this.$el, i = Hb(e, this.props.duration);
14941
+ i.setAttribute("data-ui-motion-owner", "component"), r.append(i), Ib(r), Rb(i);
14390
14942
  }
14391
- }), Dy = (e) => {
14392
- e.data("UiToast", () => wy()), e.data("UiToastOutlet", () => Ey());
14393
- }, Oy = {
14943
+ }), Wb = (e) => {
14944
+ e.data("UiToast", () => Vb()), e.data("UiToastOutlet", () => Ub());
14945
+ }, Gb = {
14394
14946
  bool: q,
14395
14947
  className: Il,
14396
14948
  create: Zl,
@@ -14407,14 +14959,14 @@ var Kv = {
14407
14959
  propsFromSchema: Bf,
14408
14960
  resolveStyle: X,
14409
14961
  string: G
14410
- }, ky = (e) => {
14962
+ }, Kb = (e) => {
14411
14963
  if (e.ajax) return;
14412
14964
  let t = {}, n = document.querySelector("meta[name=\"csrf-token\"]");
14413
14965
  n && (t.headers = { "X-CSRFToken": n.content }), e.plugin(de), e.plugin(C.configure(t));
14414
- }, Ay = (e) => {
14415
- _u(e.reactive), ky(e), Ys(e), Ap(e), Jl(), Vm(), xm(e), $m(e), lh(e), Ph(e), Vh(e), Kh(e), xg(e), Og(e), $g(e), c_(e), C_(e), J_(e), _v(e), Fv(e), Lf(e), vp(e), Uv(e), ry(e), Dy(e);
14966
+ }, qb = (e) => {
14967
+ _u(e.reactive), Kb(e), Ys(e), qm(e), Jl(), ig(), Rh(e), gg(e), Eg(e), Zg(e), i_(e), l_(e), R_(e), G_(e), gv(e), Tv(e), Bv(e), dy(e), Py(e), Qy(e), Lf(e), Fm(e), ob(e), bb(e), Wb(e);
14416
14968
  };
14417
14969
  //#endregion
14418
- export { q as bool, Il as className, Zl as create, If as createResizable, Ll as cx, Ay as default, Ay as trellisUi, zf as defineManifest, W as defineProps, Y as defineStyles, vu as json, nu as mergeBindings, Ws as motion, K as number, J as oneOf, Bf as propsFromSchema, X as resolveStyle, G as string, Oy as ui };
14970
+ export { q as bool, Il as className, Zl as create, If as createResizable, Ll as cx, qb as default, qb as trellisUi, zf as defineManifest, W as defineProps, Y as defineStyles, vu as json, nu as mergeBindings, Ws as motion, K as number, J as oneOf, Bf as propsFromSchema, X as resolveStyle, G as string, Gb as ui };
14419
14971
 
14420
14972
  //# sourceMappingURL=index.js.map