UNPKG

@devkitvue/datalist

Version:

Devkit Base Components is a Vue plugin offering a collection of reusable, headless components designed to streamline your Vue.js development workflow. Built for flexibility and maintainability, this library gives you complete control over styling and beha

1,365 lines 1.29 MB
var yb = Object.defineProperty; var vb = (t, e, n) => e in t ? yb(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; var pt = (t, e, n) => vb(t, typeof e != "symbol" ? e + "" : e, n); import { ref as se, readonly as Gh, getCurrentInstance as ka, onMounted as Qt, nextTick as Wh, watch as Qe, useId as wb, mergeProps as P, createElementBlock as T, openBlock as y, createElementVNode as X, renderSlot as G, createBlock as M, createCommentVNode as j, Teleport as kb, resolveComponent as Y, Fragment as ie, renderList as Fe, createVNode as ke, resolveDirective as Jt, createTextVNode as Rn, toDisplayString as Re, normalizeClass as de, resolveDynamicComponent as re, withCtx as ne, Transition as fu, normalizeProps as Ti, createSlots as Tr, withDirectives as en, withModifiers as mu, normalizeStyle as Sb, toHandlers as zi, withKeys as rs, h as te, defineComponent as Ve, reactive as Cb, provide as xb, onBeforeUnmount as Ei, inject as Er, Suspense as Pb, computed as qe, withAsyncContext as qh, unref as ee, useSlots as Xh, guardReactiveProps as Ob } from "vue"; import { useToast as gu, useDialog as Rb, Panel as Ib, Dialog as _b, Column as Bi, ToggleSwitch as Tb, IconField as Eb, InputIcon as Fb, InputText as Db } from "primevue"; import { defineStore as Yh, getActivePinia as Lb } from "pinia"; import { ObjectKeys as Xn, ObjectEntries as Fr, resolveApiEndpoint as Sa } from "@devkitvue/apiclient"; import { useQueryClient as Zh, useMutation as Qh, useQuery as Mb, keepPreviousData as Ab } from "@tanstack/vue-query"; import { useFormKitContextById as Jh, useFormKitNodeById as bu } from "@formkit/vue"; import { AppBtn as Mt, makeGridWrapperClassName as ef, AppDialog as zb, AppImage as Bb, AppIcon as $b } from "@devkitvue/base-components"; import { useRoute as jb, useRouter as tf } from "vue-router"; import Nb from "dexie"; import { useI18n as nf } from "vue-i18n"; function Xe(...t) { if (t) { let e = []; for (let n = 0; n < t.length; n++) { const r = t[n]; if (!r) continue; const i = typeof r; if (i === "string" || i === "number") e.push(r); else if (i === "object") { const o = Array.isArray(r) ? [Xe(...r)] : Object.entries(r).map(([a, s]) => s ? a : void 0); e = o.length ? e.concat(o.filter((a) => !!a)) : e; } } return e.join(" ").trim(); } } function Ub(t, e) { return t ? t.classList ? t.classList.contains(e) : new RegExp("(^| )" + e + "( |$)", "gi").test(t.className) : !1; } function bo(t, e) { if (t && e) { const n = (r) => { Ub(t, r) || (t.classList ? t.classList.add(r) : t.className += " " + r); }; [e].flat().filter(Boolean).forEach((r) => r.split(" ").forEach(n)); } } function Hb(t) { if (t) { const e = document.createElement("a"); if (e.download !== void 0) { const { name: n, src: r } = t; return e.setAttribute("href", r), e.setAttribute("download", n), e.style.display = "none", document.body.appendChild(e), e.click(), document.body.removeChild(e), !0; } } return !1; } function Vb(t, e) { const n = new Blob([t], { type: "application/csv;charset=utf-8;" }); window.navigator.msSaveOrOpenBlob ? navigator.msSaveOrOpenBlob(n, e + ".csv") : Hb({ name: e + ".csv", src: URL.createObjectURL(n) }) || (t = "data:text/csv;charset=utf-8," + t, window.open(encodeURI(t))); } function Sn(t, e) { if (t && e) { const n = (r) => { t.classList ? t.classList.remove(r) : t.className = t.className.replace(new RegExp("(^|\\b)" + r.split(" ").join("|") + "(\\b|$)", "gi"), " "); }; [e].flat().filter(Boolean).forEach((r) => r.split(" ").forEach(n)); } } function Ca(t) { for (const e of document == null ? void 0 : document.styleSheets) try { for (const n of e == null ? void 0 : e.cssRules) for (const r of n == null ? void 0 : n.style) if (t.test(r)) return { name: r, value: n.style.getPropertyValue(r).trim() }; } catch { } return null; } function rf(t) { const e = { width: 0, height: 0 }; return t && (t.style.visibility = "hidden", t.style.display = "block", e.width = t.offsetWidth, e.height = t.offsetHeight, t.style.display = "none", t.style.visibility = "visible"), e; } function of() { const t = window, e = document, n = e.documentElement, r = e.getElementsByTagName("body")[0], i = t.innerWidth || n.clientWidth || r.clientWidth, o = t.innerHeight || n.clientHeight || r.clientHeight; return { width: i, height: o }; } function ul(t) { return t ? Math.abs(t.scrollLeft) : 0; } function Kb() { const t = document.documentElement; return (window.pageXOffset || ul(t)) - (t.clientLeft || 0); } function Gb() { const t = document.documentElement; return (window.pageYOffset || t.scrollTop) - (t.clientTop || 0); } function af(t) { return t ? getComputedStyle(t).direction === "rtl" : !1; } function yu(t, e, n = !0) { var r, i, o, a; if (t) { const s = t.offsetParent ? { width: t.offsetWidth, height: t.offsetHeight } : rf(t), l = s.height, u = s.width, d = e.offsetHeight, c = e.offsetWidth, h = e.getBoundingClientRect(), p = Gb(), b = Kb(), v = of(); let g, k, m = "top"; h.top + d + l > v.height ? (g = h.top + p - l, m = "bottom", g < 0 && (g = p)) : g = d + h.top + p, h.left + u > v.width ? k = Math.max(0, h.left + b + c - u) : k = h.left + b, af(t) ? t.style.insetInlineEnd = k + "px" : t.style.insetInlineStart = k + "px", t.style.top = g + "px", t.style.transformOrigin = m, n && (t.style.marginTop = m === "bottom" ? `calc(${(i = (r = Ca(/-anchor-gutter$/)) == null ? void 0 : r.value) != null ? i : "2px"} * -1)` : (a = (o = Ca(/-anchor-gutter$/)) == null ? void 0 : o.value) != null ? a : ""); } } function Lo(t, e) { t && (typeof e == "string" ? t.style.cssText = e : Object.entries(e || {}).forEach(([n, r]) => t.style[n] = r)); } function Ye(t, e) { return t instanceof HTMLElement ? t.offsetWidth : 0; } function Wb(t, e, n = !0) { var r, i, o, a; if (t) { const s = t.offsetParent ? { width: t.offsetWidth, height: t.offsetHeight } : rf(t), l = e.offsetHeight, u = e.getBoundingClientRect(), d = of(); let c, h, p = "top"; u.top + l + s.height > d.height ? (c = -1 * s.height, p = "bottom", u.top + c < 0 && (c = -1 * u.top)) : c = l, s.width > d.width ? h = u.left * -1 : u.left + s.width > d.width ? h = (u.left + s.width - d.width) * -1 : h = 0, t.style.top = c + "px", t.style.insetInlineStart = h + "px", t.style.transformOrigin = p, n && (t.style.marginTop = p === "bottom" ? `calc(${(i = (r = Ca(/-anchor-gutter$/)) == null ? void 0 : r.value) != null ? i : "2px"} * -1)` : (a = (o = Ca(/-anchor-gutter$/)) == null ? void 0 : o.value) != null ? a : ""); } } function vu(t) { if (t) { let e = t.parentNode; return e && e instanceof ShadowRoot && e.host && (e = e.host), e; } return null; } function qb(t) { return !!(t !== null && typeof t < "u" && t.nodeName && vu(t)); } function sr(t) { return typeof Element < "u" ? t instanceof Element : t !== null && typeof t == "object" && t.nodeType === 1 && typeof t.nodeName == "string"; } function ha() { if (window.getSelection) { const t = window.getSelection() || {}; t.empty ? t.empty() : t.removeAllRanges && t.rangeCount > 0 && t.getRangeAt(0).getClientRects().length > 0 && t.removeAllRanges(); } } function xa(t, e = {}) { if (sr(t)) { const n = (r, i) => { var o, a; const s = (o = t == null ? void 0 : t.$attrs) != null && o[r] ? [(a = t == null ? void 0 : t.$attrs) == null ? void 0 : a[r]] : []; return [i].flat().reduce((l, u) => { if (u != null) { const d = typeof u; if (d === "string" || d === "number") l.push(u); else if (d === "object") { const c = Array.isArray(u) ? n(r, u) : Object.entries(u).map(([h, p]) => r === "style" && (p || p === 0) ? `${h.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${p}` : p ? h : void 0); l = c.length ? l.concat(c.filter((h) => !!h)) : l; } } return l; }, s); }; Object.entries(e).forEach(([r, i]) => { if (i != null) { const o = r.match(/^on(.+)/); o ? t.addEventListener(o[1].toLowerCase(), i) : r === "p-bind" || r === "pBind" ? xa(t, i) : (i = r === "class" ? [...new Set(n("class", i))].join(" ").trim() : r === "style" ? n("style", i).join(";").trim() : i, (t.$attrs = t.$attrs || {}) && (t.$attrs[r] = i), t.setAttribute(r, i)); } }); } } function sf(t, e = {}, ...n) { { const r = document.createElement(t); return xa(r, e), r.append(...n), r; } } function Vt(t, e) { return sr(t) ? Array.from(t.querySelectorAll(e)) : []; } function Wt(t, e) { return sr(t) ? t.matches(e) ? t : t.querySelector(e) : null; } function Ne(t, e) { t && document.activeElement !== t && t.focus(e); } function $e(t, e) { if (sr(t)) { const n = t.getAttribute(e); return isNaN(n) ? n === "true" || n === "false" ? n === "true" : n : +n; } } function wu(t, e = "") { const n = Vt( t, `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}` ), r = []; for (const i of n) getComputedStyle(i).display != "none" && getComputedStyle(i).visibility != "hidden" && r.push(i); return r; } function Un(t, e) { const n = wu(t, e); return n.length > 0 ? n[0] : null; } function Hn(t) { if (t) { let e = t.offsetHeight; const n = getComputedStyle(t); return e -= parseFloat(n.paddingTop) + parseFloat(n.paddingBottom) + parseFloat(n.borderTopWidth) + parseFloat(n.borderBottomWidth), e; } return 0; } function Xb(t) { if (t) { t.style.visibility = "hidden", t.style.display = "block"; const e = t.offsetHeight; return t.style.display = "none", t.style.visibility = "visible", e; } return 0; } function Yb(t) { if (t) { t.style.visibility = "hidden", t.style.display = "block"; const e = t.offsetWidth; return t.style.display = "none", t.style.visibility = "visible", e; } return 0; } function fa(t) { var e; if (t) { const n = (e = vu(t)) == null ? void 0 : e.childNodes; let r = 0; if (n) for (let i = 0; i < n.length; i++) { if (n[i] === t) return r; n[i].nodeType === 1 && r++; } } return -1; } function lf(t, e) { const n = wu(t, e); return n.length > 0 ? n[n.length - 1] : null; } function Aa(t, e) { let n = t.nextElementSibling; for (; n; ) { if (n.matches(e)) return n; n = n.nextElementSibling; } return null; } function fr(t) { if (t) { const e = t.getBoundingClientRect(); return { top: e.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0), left: e.left + (window.pageXOffset || ul(document.documentElement) || ul(document.body) || 0) }; } return { top: "auto", left: "auto" }; } function Pa(t, e) { return t ? t.offsetHeight : 0; } function uf(t, e = []) { const n = vu(t); return n === null ? e : uf(n, e.concat([n])); } function za(t, e) { let n = t.previousElementSibling; for (; n; ) { if (n.matches(e)) return n; n = n.previousElementSibling; } return null; } function Zb(t) { const e = []; if (t) { const n = uf(t), r = /(auto|scroll)/, i = (o) => { try { const a = window.getComputedStyle(o, null); return r.test(a.getPropertyValue("overflow")) || r.test(a.getPropertyValue("overflowX")) || r.test(a.getPropertyValue("overflowY")); } catch { return !1; } }; for (const o of n) { const a = o.nodeType === 1 && o.dataset.scrollselectors; if (a) { const s = a.split(","); for (const l of s) { const u = Wt(o, l); u && i(u) && e.push(u); } } o.nodeType !== 9 && i(o) && e.push(o); } } return e; } function dd() { if (window.getSelection) return window.getSelection().toString(); if (document.getSelection) return document.getSelection().toString(); } function Vn(t) { if (t) { let e = t.offsetWidth; const n = getComputedStyle(t); return e -= parseFloat(n.paddingLeft) + parseFloat(n.paddingRight) + parseFloat(n.borderLeftWidth) + parseFloat(n.borderRightWidth), e; } return 0; } function cd(t, e, n) { const r = t[e]; typeof r == "function" && r.apply(t, []); } function Qb() { return /(android)/i.test(navigator.userAgent); } function os(t) { if (t) { const e = t.nodeName, n = t.parentElement && t.parentElement.nodeName; return e === "INPUT" || e === "TEXTAREA" || e === "BUTTON" || e === "A" || n === "INPUT" || n === "TEXTAREA" || n === "BUTTON" || n === "A" || !!t.closest(".p-button, .p-checkbox, .p-radiobutton"); } return !1; } function df() { return !!(typeof window < "u" && window.document && window.document.createElement); } function pd(t, e = "") { return sr(t) ? t.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`) : !1; } function Oa(t) { return !!(t && t.offsetParent != null); } function ku() { return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; } function Su(t, e = "", n) { sr(t) && n !== null && n !== void 0 && t.setAttribute(e, n); } function Cu() { const t = /* @__PURE__ */ new Map(); return { on(e, n) { let r = t.get(e); return r ? r.push(n) : r = [n], t.set(e, r), this; }, off(e, n) { const r = t.get(e); return r && r.splice(r.indexOf(n) >>> 0, 1), this; }, emit(e, n) { const r = t.get(e); r && r.forEach((i) => { i(n); }); }, clear() { t.clear(); } }; } function zt(t) { return t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0; } function Jb(t, e, n, r = 1) { let i = -1; const o = zt(t), a = zt(e); return o && a ? i = 0 : o ? i = r : a ? i = -r : typeof t == "string" && typeof e == "string" ? i = n(t, e) : i = t < e ? -1 : t > e ? 1 : 0, i; } function dl(t, e, n = /* @__PURE__ */ new WeakSet()) { if (t === e) return !0; if (!t || !e || typeof t != "object" || typeof e != "object" || n.has(t) || n.has(e)) return !1; n.add(t).add(e); const r = Array.isArray(t), i = Array.isArray(e); let o, a, s; if (r && i) { if (a = t.length, a != e.length) return !1; for (o = a; o-- !== 0; ) if (!dl(t[o], e[o], n)) return !1; return !0; } if (r != i) return !1; const l = t instanceof Date, u = e instanceof Date; if (l != u) return !1; if (l && u) return t.getTime() == e.getTime(); const d = t instanceof RegExp, c = e instanceof RegExp; if (d != c) return !1; if (d && c) return t.toString() == e.toString(); const h = Object.keys(t); if (a = h.length, a !== Object.keys(e).length) return !1; for (o = a; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, h[o])) return !1; for (o = a; o-- !== 0; ) if (s = h[o], !dl(t[s], e[s], n)) return !1; return !0; } function ey(t, e) { return dl(t, e); } function Ba(t) { return typeof t == "function" && "call" in t && "apply" in t; } function ae(t) { return !zt(t); } function fe(t, e) { if (!t || !e) return null; try { const n = t[e]; if (ae(n)) return n; } catch { } if (Object.keys(t).length) { if (Ba(e)) return e(t); if (e.indexOf(".") === -1) return t[e]; { const n = e.split("."); let r = t; for (let i = 0, o = n.length; i < o; ++i) { if (r == null) return null; r = r[n[i]]; } return r; } } return null; } function lr(t, e, n) { return n ? fe(t, n) === fe(e, n) : ey(t, e); } function ty(t, e) { if (t != null && e && e.length) { for (const n of e) if (lr(t, n)) return !0; } return !1; } function tr(t, e = !0) { return t instanceof Object && t.constructor === Object && (e || Object.keys(t).length !== 0); } function is(t, e) { let n = -1; if (e) { for (let r = 0; r < e.length; r++) if (e[r] === t) { n = r; break; } } return n; } function hd(t, e) { let n = -1; if (ae(t)) try { n = t.findLastIndex(e); } catch { n = t.lastIndexOf([...t].reverse().find(e)); } return n; } function ut(t, ...e) { return Ba(t) ? t(...e) : t; } function wt(t, e = !0) { return typeof t == "string" && (e || t !== ""); } function Kt(t) { return wt(t) ? t.replace(/(-|_)/g, "").toLowerCase() : t; } function xu(t, e = "", n = {}) { const r = Kt(e).split("."), i = r.shift(); if (i) { if (tr(t)) { const o = Object.keys(t).find((a) => Kt(a) === i) || ""; return xu(ut(t[o], n), r.join("."), n); } return; } return ut(t, n); } function cf(t, e = !0) { return Array.isArray(t) && (e || t.length !== 0); } function ny(t) { return ae(t) && !isNaN(t); } function ry(t = "") { return ae(t) && t.length === 1 && !!t.match(/\S| /); } function fd() { return new Intl.Collator(void 0, { numeric: !0 }).compare; } function xr(t, e) { if (e) { const n = e.test(t); return e.lastIndex = 0, n; } return !1; } function xo(t) { return t && t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":").trim(); } function kt(t) { if (t && /[\xC0-\xFF\u0100-\u017E]/.test(t)) { const n = { A: /[\xC0-\xC5\u0100\u0102\u0104]/g, AE: /[\xC6]/g, C: /[\xC7\u0106\u0108\u010A\u010C]/g, D: /[\xD0\u010E\u0110]/g, E: /[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g, G: /[\u011C\u011E\u0120\u0122]/g, H: /[\u0124\u0126]/g, I: /[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g, IJ: /[\u0132]/g, J: /[\u0134]/g, K: /[\u0136]/g, L: /[\u0139\u013B\u013D\u013F\u0141]/g, N: /[\xD1\u0143\u0145\u0147\u014A]/g, O: /[\xD2-\xD6\xD8\u014C\u014E\u0150]/g, OE: /[\u0152]/g, R: /[\u0154\u0156\u0158]/g, S: /[\u015A\u015C\u015E\u0160]/g, T: /[\u0162\u0164\u0166]/g, U: /[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g, W: /[\u0174]/g, Y: /[\xDD\u0176\u0178]/g, Z: /[\u0179\u017B\u017D]/g, a: /[\xE0-\xE5\u0101\u0103\u0105]/g, ae: /[\xE6]/g, c: /[\xE7\u0107\u0109\u010B\u010D]/g, d: /[\u010F\u0111]/g, e: /[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g, g: /[\u011D\u011F\u0121\u0123]/g, i: /[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g, ij: /[\u0133]/g, j: /[\u0135]/g, k: /[\u0137,\u0138]/g, l: /[\u013A\u013C\u013E\u0140\u0142]/g, n: /[\xF1\u0144\u0146\u0148\u014B]/g, p: /[\xFE]/g, o: /[\xF2-\xF6\xF8\u014D\u014F\u0151]/g, oe: /[\u0153]/g, r: /[\u0155\u0157\u0159]/g, s: /[\u015B\u015D\u015F\u0161]/g, t: /[\u0163\u0165\u0167]/g, u: /[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g, w: /[\u0175]/g, y: /[\xFD\xFF\u0177]/g, z: /[\u017A\u017C\u017E]/g }; for (const r in n) t = t.replace(n[r], r); } return t; } function md(t, e, n) { t && e !== n && (n >= t.length && (n %= t.length, e %= t.length), t.splice(n, 0, t.splice(e, 1)[0])); } function gd(t, e, n = 1, r, i = 1) { const o = Jb(t, e, r, n); let a = n; return (zt(t) || zt(e)) && (a = i === 1 ? n : i), a * o; } function oy(t) { return wt(t, !1) ? t[0].toUpperCase() + t.slice(1) : t; } function pf(t) { return wt(t) ? t.replace(/(_)/g, "-").replace(/[A-Z]/g, (e, n) => n === 0 ? e : "-" + e.toLowerCase()).toLowerCase() : t; } var $i = {}; function iy(t = "pui_id_") { return Object.hasOwn($i, t) || ($i[t] = 0), $i[t]++, `${t}${$i[t]}`; } function ay() { let t = []; const e = (a, s, l = 999) => { const u = i(a, s, l), d = u.value + (u.key === a ? 0 : l) + 1; return t.push({ key: a, value: d }), d; }, n = (a) => { t = t.filter((s) => s.value !== a); }, r = (a, s) => i(a).value, i = (a, s, l = 0) => [...t].reverse().find((u) => !0) || { key: a, value: l }, o = (a) => a && parseInt(a.style.zIndex, 10) || 0; return { get: o, set: (a, s, l) => { s && (s.style.zIndex = String(e(a, !0, l))); }, clear: (a) => { a && (n(o(a)), a.style.zIndex = ""); }, getCurrent: (a) => r(a) }; } var bn = ay(), bd = { STARTS_WITH: "startsWith", CONTAINS: "contains" }, Ra = { AND: "and", OR: "or" }; function yd(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (!n) { if (Array.isArray(t) || (n = sy(t)) || e) { n && (t = n); var r = 0, i = function() { }; return { s: i, n: function() { return r >= t.length ? { done: !0 } : { done: !1, value: t[r++] }; }, e: function(u) { throw u; }, f: i }; } throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var o, a = !0, s = !1; return { s: function() { n = n.call(t); }, n: function() { var u = n.next(); return a = u.done, u; }, e: function(u) { s = !0, o = u; }, f: function() { try { a || n.return == null || n.return(); } finally { if (s) throw o; } } }; } function sy(t, e) { if (t) { if (typeof t == "string") return vd(t, e); var n = {}.toString.call(t).slice(8, -1); return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? vd(t, e) : void 0; } } function vd(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n]; return r; } var cl = { filter: function(e, n, r, i, o) { var a = []; if (!e) return a; var s = yd(e), l; try { for (s.s(); !(l = s.n()).done; ) { var u = l.value; if (typeof u == "string") { if (this.filters[i](u, r, o)) { a.push(u); continue; } } else { var d = yd(n), c; try { for (d.s(); !(c = d.n()).done; ) { var h = c.value, p = fe(u, h); if (this.filters[i](p, r, o)) { a.push(u); break; } } } catch (b) { d.e(b); } finally { d.f(); } } } } catch (b) { s.e(b); } finally { s.f(); } return a; }, filters: { startsWith: function(e, n, r) { if (n == null || n === "") return !0; if (e == null) return !1; var i = kt(n.toString()).toLocaleLowerCase(r), o = kt(e.toString()).toLocaleLowerCase(r); return o.slice(0, i.length) === i; }, contains: function(e, n, r) { if (n == null || n === "") return !0; if (e == null) return !1; var i = kt(n.toString()).toLocaleLowerCase(r), o = kt(e.toString()).toLocaleLowerCase(r); return o.indexOf(i) !== -1; }, notContains: function(e, n, r) { if (n == null || n === "") return !0; if (e == null) return !1; var i = kt(n.toString()).toLocaleLowerCase(r), o = kt(e.toString()).toLocaleLowerCase(r); return o.indexOf(i) === -1; }, endsWith: function(e, n, r) { if (n == null || n === "") return !0; if (e == null) return !1; var i = kt(n.toString()).toLocaleLowerCase(r), o = kt(e.toString()).toLocaleLowerCase(r); return o.indexOf(i, o.length - i.length) !== -1; }, equals: function(e, n, r) { return n == null || n === "" ? !0 : e == null ? !1 : e.getTime && n.getTime ? e.getTime() === n.getTime() : kt(e.toString()).toLocaleLowerCase(r) == kt(n.toString()).toLocaleLowerCase(r); }, notEquals: function(e, n, r) { return n == null || n === "" ? !1 : e == null ? !0 : e.getTime && n.getTime ? e.getTime() !== n.getTime() : kt(e.toString()).toLocaleLowerCase(r) != kt(n.toString()).toLocaleLowerCase(r); }, in: function(e, n) { if (n == null || n.length === 0) return !0; for (var r = 0; r < n.length; r++) if (lr(e, n[r])) return !0; return !1; }, between: function(e, n) { return n == null || n[0] == null || n[1] == null ? !0 : e == null ? !1 : e.getTime ? n[0].getTime() <= e.getTime() && e.getTime() <= n[1].getTime() : n[0] <= e && e <= n[1]; }, lt: function(e, n) { return n == null ? !0 : e == null ? !1 : e.getTime && n.getTime ? e.getTime() < n.getTime() : e < n; }, lte: function(e, n) { return n == null ? !0 : e == null ? !1 : e.getTime && n.getTime ? e.getTime() <= n.getTime() : e <= n; }, gt: function(e, n) { return n == null ? !0 : e == null ? !1 : e.getTime && n.getTime ? e.getTime() > n.getTime() : e > n; }, gte: function(e, n) { return n == null ? !0 : e == null ? !1 : e.getTime && n.getTime ? e.getTime() >= n.getTime() : e >= n; }, dateIs: function(e, n) { return n == null ? !0 : e == null ? !1 : e.toDateString() === n.toDateString(); }, dateIsNot: function(e, n) { return n == null ? !0 : e == null ? !1 : e.toDateString() !== n.toDateString(); }, dateBefore: function(e, n) { return n == null ? !0 : e == null ? !1 : e.getTime() < n.getTime(); }, dateAfter: function(e, n) { return n == null ? !0 : e == null ? !1 : e.getTime() > n.getTime(); } }, register: function(e, n) { this.filters[e] = n; } }; function Mo(t) { "@babel/helpers - typeof"; return Mo = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { return typeof e; } : function(e) { return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }, Mo(t); } function ly(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function uy(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, cy(r.key), r); } } function dy(t, e, n) { return e && uy(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function cy(t) { var e = py(t, "string"); return Mo(e) == "symbol" ? e : e + ""; } function py(t, e) { if (Mo(t) != "object" || !t) return t; var n = t[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(t, e); if (Mo(r) != "object") return r; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(t); } var Pu = /* @__PURE__ */ function() { function t(e) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { }; ly(this, t), this.element = e, this.listener = n; } return dy(t, [{ key: "bindScrollListener", value: function() { this.scrollableParents = Zb(this.element); for (var n = 0; n < this.scrollableParents.length; n++) this.scrollableParents[n].addEventListener("scroll", this.listener); } }, { key: "unbindScrollListener", value: function() { if (this.scrollableParents) for (var n = 0; n < this.scrollableParents.length; n++) this.scrollableParents[n].removeEventListener("scroll", this.listener); } }, { key: "destroy", value: function() { this.unbindScrollListener(), this.element = null, this.listener = null, this.scrollableParents = null; } }]); }(); function Ao(t) { "@babel/helpers - typeof"; return Ao = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { return typeof e; } : function(e) { return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }, Ao(t); } function hy(t) { return by(t) || gy(t) || my(t) || fy(); } function fy() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function my(t, e) { if (t) { if (typeof t == "string") return pl(t, e); var n = {}.toString.call(t).slice(8, -1); return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? pl(t, e) : void 0; } } function gy(t) { if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); } function by(t) { if (Array.isArray(t)) return pl(t); } function pl(t, e) { (e == null || e > t.length) && (e = t.length); for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n]; return r; } function yy(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function vy(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, hf(r.key), r); } } function wy(t, e, n) { return e && vy(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function wd(t, e, n) { return (e = hf(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function hf(t) { var e = ky(t, "string"); return Ao(e) == "symbol" ? e : e + ""; } function ky(t, e) { if (Ao(t) != "object" || !t) return t; var n = t[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(t, e); if (Ao(r) != "object") return r; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(t); } var Dr = /* @__PURE__ */ function() { function t(e) { var n = e.init, r = e.type; yy(this, t), wd(this, "helpers", void 0), wd(this, "type", void 0), this.helpers = new Set(n), this.type = r; } return wy(t, [{ key: "add", value: function(n) { this.helpers.add(n); } }, { key: "update", value: function() { } }, { key: "delete", value: function(n) { this.helpers.delete(n); } }, { key: "clear", value: function() { this.helpers.clear(); } }, { key: "get", value: function(n, r) { var i = this._get(n, r), o = i ? this._recursive(hy(this.helpers), i) : null; return ae(o) ? o : null; } }, { key: "_isMatched", value: function(n, r) { var i, o = n == null ? void 0 : n.parent; return (o == null || (i = o.vnode) === null || i === void 0 ? void 0 : i.key) === r || o && this._isMatched(o, r) || !1; } }, { key: "_get", value: function(n, r) { var i, o; return ((i = r || (n == null ? void 0 : n.$slots)) === null || i === void 0 || (o = i.default) === null || o === void 0 ? void 0 : o.call(i)) || null; } }, { key: "_recursive", value: function() { var n = this, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], o = []; return i.forEach(function(a) { a.children instanceof Array ? o = o.concat(n._recursive(o, a.children)) : a.type.name === n.type ? o.push(a) : ae(a.key) && (o = o.concat(r.filter(function(s) { return n._isMatched(s, a.key); }).map(function(s) { return s.vnode; }))); }), o; } }]); }(); function _n(t, e) { if (t) { var n = t.props; if (n) { var r = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), i = Object.prototype.hasOwnProperty.call(n, r) ? r : e; return t.type.extends.props[e].type === Boolean && n[i] === "" ? !0 : n[i]; } } return null; } var Sy = Object.defineProperty, Cy = Object.defineProperties, xy = Object.getOwnPropertyDescriptors, Ia = Object.getOwnPropertySymbols, ff = Object.prototype.hasOwnProperty, mf = Object.prototype.propertyIsEnumerable, kd = (t, e, n) => e in t ? Sy(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Tt = (t, e) => { for (var n in e || (e = {})) ff.call(e, n) && kd(t, n, e[n]); if (Ia) for (var n of Ia(e)) mf.call(e, n) && kd(t, n, e[n]); return t; }, as = (t, e) => Cy(t, xy(e)), tn = (t, e) => { var n = {}; for (var r in t) ff.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (t != null && Ia) for (var r of Ia(t)) e.indexOf(r) < 0 && mf.call(t, r) && (n[r] = t[r]); return n; }, Py = Cu(), rt = Py, hl = /{([^}]*)}/g, Oy = /(\d+\s+[\+\-\*\/]\s+\d+)/g, Ry = /var\([^)]+\)/g; function Iy(t) { return tr(t) && t.hasOwnProperty("$value") && t.hasOwnProperty("$type") ? t.$value : t; } function _y(t) { return t.replaceAll(/ /g, "").replace(/[^\w]/g, "-"); } function fl(t = "", e = "") { return _y(`${wt(t, !1) && wt(e, !1) ? `${t}-` : t}${e}`); } function gf(t = "", e = "") { return `--${fl(t, e)}`; } function Ty(t = "") { const e = (t.match(/{/g) || []).length, n = (t.match(/}/g) || []).length; return (e + n) % 2 !== 0; } function bf(t, e = "", n = "", r = [], i) { if (wt(t)) { const o = t.trim(); if (Ty(o)) return; if (xr(o, hl)) { const a = o.replaceAll(hl, (s) => { const u = s.replace(/{|}/g, "").split(".").filter((d) => !r.some((c) => xr(d, c))); return `var(${gf(n, pf(u.join("-")))}${ae(i) ? `, ${i}` : ""})`; }); return xr(a.replace(Ry, "0"), Oy) ? `calc(${a})` : a; } return o; } else if (ny(t)) return t; } function Ey(t, e, n) { wt(e, !1) && t.push(`${e}:${n};`); } function mr(t, e) { return t ? `${t}{${e}}` : ""; } function yf(t, e) { if (t.indexOf("dt(") === -1) return t; function n(a, s) { const l = []; let u = 0, d = "", c = null, h = 0; for (; u <= a.length; ) { const p = a[u]; if ((p === '"' || p === "'" || p === "`") && a[u - 1] !== "\\" && (c = c === p ? null : p), !c && (p === "(" && h++, p === ")" && h--, (p === "," || u === a.length) && h === 0)) { const b = d.trim(); b.startsWith("dt(") ? l.push(yf(b, s)) : l.push(r(b)), d = "", u++; continue; } p !== void 0 && (d += p), u++; } return l; } function r(a) { const s = a[0]; if ((s === '"' || s === "'" || s === "`") && a[a.length - 1] === s) return a.slice(1, -1); const l = Number(a); return isNaN(l) ? a : l; } const i = [], o = []; for (let a = 0; a < t.length; a++) if (t[a] === "d" && t.slice(a, a + 3) === "dt(") o.push(a), a += 2; else if (t[a] === ")" && o.length > 0) { const s = o.pop(); o.length === 0 && i.push([s, a]); } if (!i.length) return t; for (let a = i.length - 1; a >= 0; a--) { const [s, l] = i[a], u = t.slice(s + 3, l), d = n(u, e), c = e(...d); t = t.slice(0, s) + c + t.slice(l + 1); } return t; } var Jn = (...t) => Fy(xe.getTheme(), ...t), Fy = (t = {}, e, n, r) => { if (e) { const { variable: i, options: o } = xe.defaults || {}, { prefix: a, transform: s } = (t == null ? void 0 : t.options) || o || {}, l = xr(e, hl) ? e : `{${e}}`; return r === "value" || zt(r) && s === "strict" ? xe.getTokenValue(e) : bf(l, void 0, a, [i.excludedKeyRegex], n); } return ""; }; function ji(t, ...e) { if (t instanceof Array) { const n = t.reduce((r, i, o) => { var a; return r + i + ((a = ut(e[o], { dt: Jn })) != null ? a : ""); }, ""); return yf(n, Jn); } return ut(t, { dt: Jn }); } function Dy(t, e = {}) { const n = xe.defaults.variable, { prefix: r = n.prefix, selector: i = n.selector, excludedKeyRegex: o = n.excludedKeyRegex } = e, a = [], s = [], l = [{ node: t, path: r }]; for (; l.length; ) { const { node: d, path: c } = l.pop(); for (const h in d) { const p = d[h], b = Iy(p), g = xr(h, o) ? fl(c) : fl(c, pf(h)); if (tr(b)) l.push({ node: b, path: g }); else { const k = gf(g), m = bf(b, g, r, [o]); Ey(s, k, m); let O = g; r && O.startsWith(r + "-") && (O = O.slice(r.length + 1)), a.push(O.replace(/-/g, ".")); } } } const u = s.join(""); return { value: s, tokens: a, declarations: u, css: mr(i, u) }; } var xt = { regex: { rules: { class: { pattern: /^\.([a-zA-Z][\w-]*)$/, resolve(t) { return { type: "class", selector: t, matched: this.pattern.test(t.trim()) }; } }, attr: { pattern: /^\[(.*)\]$/, resolve(t) { return { type: "attr", selector: `:root${t}`, matched: this.pattern.test(t.trim()) }; } }, media: { pattern: /^@media (.*)$/, resolve(t) { return { type: "media", selector: `${t}{:root{[CSS]}}`, matched: this.pattern.test(t.trim()) }; } }, system: { pattern: /^system$/, resolve(t) { return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(t.trim()) }; } }, custom: { resolve(t) { return { type: "custom", selector: t, matched: !0 }; } } }, resolve(t) { const e = Object.keys(this.rules).filter((n) => n !== "custom").map((n) => this.rules[n]); return [t].flat().map((n) => { var r; return (r = e.map((i) => i.resolve(n)).find((i) => i.matched)) != null ? r : this.rules.custom.resolve(n); }); } }, _toVariables(t, e) { return Dy(t, { prefix: e == null ? void 0 : e.prefix }); }, getCommon({ name: t = "", theme: e = {}, params: n, set: r, defaults: i }) { var o, a, s, l, u, d, c; const { preset: h, options: p } = e; let b, v, g, k, m, O, w; if (ae(h) && p.transform !== "strict") { const { primitive: S, semantic: _, extend: R } = h, F = _ || {}, { colorScheme: E } = F, V = tn(F, ["colorScheme"]), $ = R || {}, { colorScheme: B } = $, D = tn($, ["colorScheme"]), W = E || {}, { dark: q } = W, x = tn(W, ["dark"]), C = B || {}, { dark: I } = C, z = tn(C, ["dark"]), L = ae(S) ? this._toVariables({ primitive: S }, p) : {}, N = ae(V) ? this._toVariables({ semantic: V }, p) : {}, Z = ae(x) ? this._toVariables({ light: x }, p) : {}, U = ae(q) ? this._toVariables({ dark: q }, p) : {}, A = ae(D) ? this._toVariables({ semantic: D }, p) : {}, H = ae(z) ? this._toVariables({ light: z }, p) : {}, Q = ae(I) ? this._toVariables({ dark: I }, p) : {}, [J, _e] = [(o = L.declarations) != null ? o : "", L.tokens], [De, Je] = [(a = N.declarations) != null ? a : "", N.tokens || []], [ct, $t] = [(s = Z.declarations) != null ? s : "", Z.tokens || []], [Ur, Ga] = [(l = U.declarations) != null ? l : "", U.tokens || []], [Wa, qa] = [(u = A.declarations) != null ? u : "", A.tokens || []], [Xa, Ya] = [(d = H.declarations) != null ? d : "", H.tokens || []], [Za, Qa] = [(c = Q.declarations) != null ? c : "", Q.tokens || []]; b = this.transformCSS(t, J, "light", "variable", p, r, i), v = _e; const Ja = this.transformCSS(t, `${De}${ct}`, "light", "variable", p, r, i), es = this.transformCSS(t, `${Ur}`, "dark", "variable", p, r, i); g = `${Ja}${es}`, k = [.../* @__PURE__ */ new Set([...Je, ...$t, ...Ga])]; const ts = this.transformCSS(t, `${Wa}${Xa}color-scheme:light`, "light", "variable", p, r, i), ns = this.transformCSS(t, `${Za}color-scheme:dark`, "dark", "variable", p, r, i); m = `${ts}${ns}`, O = [.../* @__PURE__ */ new Set([...qa, ...Ya, ...Qa])], w = ut(h.css, { dt: Jn }); } return { primitive: { css: b, tokens: v }, semantic: { css: g, tokens: k }, global: { css: m, tokens: O }, style: w }; }, getPreset({ name: t = "", preset: e = {}, options: n, params: r, set: i, defaults: o, selector: a }) { var s, l, u; let d, c, h; if (ae(e) && n.transform !== "strict") { const p = t.replace("-directive", ""), b = e, { colorScheme: v, extend: g, css: k } = b, m = tn(b, ["colorScheme", "extend", "css"]), O = g || {}, { colorScheme: w } = O, S = tn(O, ["colorScheme"]), _ = v || {}, { dark: R } = _, F = tn(_, ["dark"]), E = w || {}, { dark: V } = E, $ = tn(E, ["dark"]), B = ae(m) ? this._toVariables({ [p]: Tt(Tt({}, m), S) }, n) : {}, D = ae(F) ? this._toVariables({ [p]: Tt(Tt({}, F), $) }, n) : {}, W = ae(R) ? this._toVariables({ [p]: Tt(Tt({}, R), V) }, n) : {}, [q, x] = [(s = B.declarations) != null ? s : "", B.tokens || []], [C, I] = [(l = D.declarations) != null ? l : "", D.tokens || []], [z, L] = [(u = W.declarations) != null ? u : "", W.tokens || []], N = this.transformCSS(p, `${q}${C}`, "light", "variable", n, i, o, a), Z = this.transformCSS(p, z, "dark", "variable", n, i, o, a); d = `${N}${Z}`, c = [.../* @__PURE__ */ new Set([...x, ...I, ...L])], h = ut(k, { dt: Jn }); } return { css: d, tokens: c, style: h }; }, getPresetC({ name: t = "", theme: e = {}, params: n, set: r, defaults: i }) { var o; const { preset: a, options: s } = e, l = (o = a == null ? void 0 : a.components) == null ? void 0 : o[t]; return this.getPreset({ name: t, preset: l, options: s, params: n, set: r, defaults: i }); }, // @deprecated - use getPresetC instead getPresetD({ name: t = "", theme: e = {}, params: n, set: r, defaults: i }) { var o, a; const s = t.replace("-directive", ""), { preset: l, options: u } = e, d = ((o = l == null ? void 0 : l.components) == null ? void 0 : o[s]) || ((a = l == null ? void 0 : l.directives) == null ? void 0 : a[s]); return this.getPreset({ name: s, preset: d, options: u, params: n, set: r, defaults: i }); }, applyDarkColorScheme(t) { return !(t.darkModeSelector === "none" || t.darkModeSelector === !1); }, getColorSchemeOption(t, e) { var n; return this.applyDarkColorScheme(t) ? this.regex.resolve(t.darkModeSelector === !0 ? e.options.darkModeSelector : (n = t.darkModeSelector) != null ? n : e.options.darkModeSelector) : []; }, getLayerOrder(t, e = {}, n, r) { const { cssLayer: i } = e; return i ? `@layer ${ut(i.order || "primeui", n)}` : ""; }, getCommonStyleSheet({ name: t = "", theme: e = {}, params: n, props: r = {}, set: i, defaults: o }) { const a = this.getCommon({ name: t, theme: e, params: n, set: i, defaults: o }), s = Object.entries(r).reduce((l, [u, d]) => l.push(`${u}="${d}"`) && l, []).join(" "); return Object.entries(a || {}).reduce((l, [u, d]) => { if (tr(d) && Object.hasOwn(d, "css")) { const c = xo(d.css), h = `${u}-variables`; l.push(`<style type="text/css" data-primevue-style-id="${h}" ${s}>${c}</style>`); } return l; }, []).join(""); }, getStyleSheet({ name: t = "", theme: e = {}, params: n, props: r = {}, set: i, defaults: o }) { var a; const s = { name: t, theme: e, params: n, set: i, defaults: o }, l = (a = t.includes("-directive") ? this.getPresetD(s) : this.getPresetC(s)) == null ? void 0 : a.css, u = Object.entries(r).reduce((d, [c, h]) => d.push(`${c}="${h}"`) && d, []).join(" "); return l ? `<style type="text/css" data-primevue-style-id="${t}-variables" ${u}>${xo(l)}</style>` : ""; }, createTokens(t = {}, e, n = "", r = "", i = {}) { return {}; }, getTokenValue(t, e, n) { var r; const o = ((l) => l.split(".").filter((d) => !xr(d.toLowerCase(), n.variable.excludedKeyRegex)).join("."))(e), a = e.includes("colorScheme.light") ? "light" : e.includes("colorScheme.dark") ? "dark" : void 0, s = [(r = t[o]) == null ? void 0 : r.computed(a)].flat().filter((l) => l); return s.length === 1 ? s[0].value : s.reduce((l = {}, u) => { const d = u, { colorScheme: c } = d, h = tn(d, ["colorScheme"]); return l[c] = h, l; }, void 0); }, getSelectorRule(t, e, n, r) { return n === "class" || n === "attr" ? mr(ae(e) ? `${t}${e},${t} ${e}` : t, r) : mr(t, ae(e) ? mr(e, r) : r); }, transformCSS(t, e, n, r, i = {}, o, a, s) { if (ae(e)) { const { cssLayer: l } = i; if (r !== "style") { const u = this.getColorSchemeOption(i, a); e = n === "dark" ? u.reduce((d, { type: c, selector: h }) => (ae(h) && (d += h.includes("[CSS]") ? h.replace("[CSS]", e) : this.getSelectorRule(h, s, c, e)), d), "") : mr(s ?? ":root", e); } if (l) { const u = { name: "primeui" }; tr(l) && (u.name = ut(l.name, { name: t, type: r })), ae(u.name) && (e = mr(`@layer ${u.name}`, e), o == null || o.layerNames(u.name)); } return e; } return ""; } }, xe = { defaults: { variable: { prefix: "p", selector: ":root", excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi }, options: { prefix: "p", darkModeSelector: "system", cssLayer: !1 } }, _theme: void 0, _layerNames: /* @__PURE__ */ new Set(), _loadedStyleNames: /* @__PURE__ */ new Set(), _loadingStyles: /* @__PURE__ */ new Set(), _tokens: {}, update(t = {}) { const { theme: e } = t; e && (this._theme = as(Tt({}, e), { options: Tt(Tt({}, this.defaults.options), e.options) }), this._tokens = xt.createTokens(this.preset, this.defaults), this.clearLoadedStyleNames()); }, get theme() { return this._theme; }, get preset() { var t; return ((t = this.theme) == null ? void 0 : t.preset) || {}; }, get options() { var t; return ((t = this.theme) == null ? void 0 : t.options) || {}; }, get tokens() { return this._tokens; }, getTheme() { return this.theme; }, setTheme(t) { this.update({ theme: t }), rt.emit("theme:change", t); }, getPreset() { return this.preset; }, setPreset(t) { this._theme = as(Tt({}, this.theme), { preset: t }), this._tokens = xt.createTokens(t, this.defaults), this.clearLoadedStyleNames(), rt.emit("preset:change", t), rt.emit("theme:change", this.theme); }, getOptions() { return this.options; }, setOptions(t) { this._theme = as(Tt({}, this.theme), { options: t }), this.clearLoadedStyleNames(), rt.emit("options:change", t), rt.emit("theme:change", this.theme); }, getLayerNames() { return [...this._layerNames]; }, setLayerNames(t) { this._layerNames.add(t); }, getLoadedStyleNames() { return this._loadedStyleNames; }, isStyleNameLoaded(t) { return this._loadedStyleNames.has(t); }, setLoadedStyleName(t) { this._loadedStyleNames.add(t); }, deleteLoadedStyleName(t) { this._loadedStyleNames.delete(t); }, clearLoadedStyleNames() { this._loadedStyleNames.clear(); }, getTokenValue(t) { return xt.getTokenValue(this.tokens, t, this.defaults); }, getCommon(t = "", e) { return xt.getCommon({ name: t, theme: this.theme, params: e, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, getComponent(t = "", e) { const n = { name: t, theme: this.theme, params: e, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return xt.getPresetC(n); }, // @deprecated - use getComponent instead getDirective(t = "", e) { const n = { name: t, theme: this.theme, params: e, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return xt.getPresetD(n); }, getCustomPreset(t = "", e, n, r) { const i = { name: t, preset: e, options: this.options, selector: n, params: r, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return xt.getPreset(i); }, getLayerOrderCSS(t = "") { return xt.getLayerOrder(t, this.options, { names: this.getLayerNames() }, this.defaults); }, transformCSS(t = "", e, n = "style", r) { return xt.transformCSS(t, e, r, n, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults); }, getCommonStyleSheet(t = "", e, n = {}) { return xt.getCommonStyleSheet({ name: t, theme: this.theme, params: e, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, getStyleSheet(t, e, n = {}) { return xt.getStyleSheet({ name: t, theme: this.theme, params: e, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, onSt