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,364 lines 689 kB
var ba = Object.defineProperty; var ga = (t, e, n) => e in t ? ba(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; var Se = (t, e, n) => ga(t, typeof e != "symbol" ? e + "" : e, n); import { ref as $e, readonly as ya, getCurrentInstance as xr, onMounted as va, nextTick as wa, watch as jo, useId as Ca, mergeProps as m, createElementBlock as b, openBlock as p, createElementVNode as $, renderSlot as S, createBlock as v, createCommentVNode as k, Teleport as Sa, resolveComponent as M, Fragment as K, renderList as pe, createVNode as oe, resolveDirective as Me, createTextVNode as De, toDisplayString as ne, normalizeClass as A, resolveDynamicComponent as z, withCtx as E, Transition as ir, normalizeProps as $n, createSlots as bt, withDirectives as Ce, withModifiers as ar, normalizeStyle as ka, toHandlers as cn, withKeys as wn, h as H, inject as Vn, computed as ce, defineComponent as on, unref as R, useSlots as lr, withAsyncContext as Pa, onBeforeUnmount as Oa } from "vue"; import { useToast as Vo, useDialog as xa, Panel as Ia, Chip as Ra, Dialog as $a, Column as pn, ToggleSwitch as Ta, IconField as La, InputIcon as Ea, InputText as Da } from "primevue"; import { defineStore as Ma, getActivePinia as Fa } from "pinia"; import { ObjectKeys as Ko, ObjectEntries as xt, resolveApiEndpoint as Ho } from "@devkitvue/apiclient"; import { NumberToDate as Aa, DateStringDigitToDate as Ba, AppDialog as za, AppIcon as No, AppBtn as at, makeGridWrapperClassName as Go, dateHumanFormat as Ir, AppImage as _o } from "@devkitvue/base-components"; import { useQueryClient as ja, useMutation as Va, useQuery as Ka, keepPreviousData as Ha } from "@tanstack/vue-query"; import { useDebounceFn as Na } from "@vueuse/core"; import { useFormKitNodeById as Uo, useFormKitContextById as Ga } from "@formkit/vue"; import { useRouter as _a } from "vue-router"; import { AppForm as Wo } from "@devkitvue/form"; import { useI18n as sr } from "vue-i18n"; function ge(...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) ? [ge(...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 Ua(t, e) { return t ? t.classList ? t.classList.contains(e) : new RegExp("(^| )" + e + "( |$)", "gi").test(t.className) : !1; } function St(t, e) { if (t && e) { const n = (r) => { Ua(t, r) || (t.classList ? t.classList.add(r) : t.className += " " + r); }; [e].flat().filter(Boolean).forEach((r) => r.split(" ").forEach(n)); } } function Wa(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 Za(t, e) { const n = new Blob([t], { type: "application/csv;charset=utf-8;" }); window.navigator.msSaveOrOpenBlob ? navigator.msSaveOrOpenBlob(n, e + ".csv") : Wa({ name: e + ".csv", src: URL.createObjectURL(n) }) || (t = "data:text/csv;charset=utf-8," + t, window.open(encodeURI(t))); } function Xe(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 kn(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 Zo(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 qo() { 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 Kn(t) { return t ? Math.abs(t.scrollLeft) : 0; } function qa() { const t = document.documentElement; return (window.pageXOffset || Kn(t)) - (t.clientLeft || 0); } function Ja() { const t = document.documentElement; return (window.pageYOffset || t.scrollTop) - (t.clientTop || 0); } function Jo(t) { return t ? getComputedStyle(t).direction === "rtl" : !1; } function ur(t, e, n = !0) { var r, i, o, a; if (t) { const s = t.offsetParent ? { width: t.offsetWidth, height: t.offsetHeight } : Zo(t), l = s.height, u = s.width, c = e.offsetHeight, d = e.offsetWidth, h = e.getBoundingClientRect(), f = Ja(), y = qa(), O = qo(); let C, g, x = "top"; h.top + c + l > O.height ? (C = h.top + f - l, x = "bottom", C < 0 && (C = f)) : C = c + h.top + f, h.left + u > O.width ? g = Math.max(0, h.left + y + d - u) : g = h.left + y, Jo(t) ? t.style.insetInlineEnd = g + "px" : t.style.insetInlineStart = g + "px", t.style.top = C + "px", t.style.transformOrigin = x, n && (t.style.marginTop = x === "bottom" ? `calc(${(i = (r = kn(/-anchor-gutter$/)) == null ? void 0 : r.value) != null ? i : "2px"} * -1)` : (a = (o = kn(/-anchor-gutter$/)) == null ? void 0 : o.value) != null ? a : ""); } } function It(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 Xa(t, e, n = !0) { var r, i, o, a; if (t) { const s = t.offsetParent ? { width: t.offsetWidth, height: t.offsetHeight } : Zo(t), l = e.offsetHeight, u = e.getBoundingClientRect(), c = qo(); let d, h, f = "top"; u.top + l + s.height > c.height ? (d = -1 * s.height, f = "bottom", u.top + d < 0 && (d = -1 * u.top)) : d = l, s.width > c.width ? h = u.left * -1 : u.left + s.width > c.width ? h = (u.left + s.width - c.width) * -1 : h = 0, t.style.top = d + "px", t.style.insetInlineStart = h + "px", t.style.transformOrigin = f, n && (t.style.marginTop = f === "bottom" ? `calc(${(i = (r = kn(/-anchor-gutter$/)) == null ? void 0 : r.value) != null ? i : "2px"} * -1)` : (a = (o = kn(/-anchor-gutter$/)) == null ? void 0 : o.value) != null ? a : ""); } } function dr(t) { if (t) { let e = t.parentNode; return e && e instanceof ShadowRoot && e.host && (e = e.host), e; } return null; } function Ya(t) { return !!(t !== null && typeof t < "u" && t.nodeName && dr(t)); } function ut(t) { return typeof Element < "u" ? t instanceof Element : t !== null && typeof t == "object" && t.nodeType === 1 && typeof t.nodeName == "string"; } function Cn() { 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 Pn(t, e = {}) { if (ut(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 c = typeof u; if (c === "string" || c === "number") l.push(u); else if (c === "object") { const d = Array.isArray(u) ? n(r, u) : Object.entries(u).map(([h, f]) => r === "style" && (f || f === 0) ? `${h.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${f}` : f ? h : void 0); l = d.length ? l.concat(d.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" ? Pn(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 Xo(t, e = {}, ...n) { { const r = document.createElement(t); return Pn(r, e), r.append(...n), r; } } function Ve(t, e) { return ut(t) ? Array.from(t.querySelectorAll(e)) : []; } function Ne(t, e) { return ut(t) ? t.matches(e) ? t : t.querySelector(e) : null; } function me(t, e) { t && document.activeElement !== t && t.focus(e); } function he(t, e) { if (ut(t)) { const n = t.getAttribute(e); return isNaN(n) ? n === "true" || n === "false" ? n === "true" : n : +n; } } function cr(t, e = "") { const n = Ve( 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 rt(t, e) { const n = cr(t, e); return n.length > 0 ? n[0] : null; } function ot(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 Qa(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 el(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 Sn(t) { var e; if (t) { const n = (e = dr(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 Yo(t, e) { const n = cr(t, e); return n.length > 0 ? n[n.length - 1] : null; } function Tn(t, e) { let n = t.nextElementSibling; for (; n; ) { if (n.matches(e)) return n; n = n.nextElementSibling; } return null; } function ft(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 || Kn(document.documentElement) || Kn(document.body) || 0) }; } return { top: "auto", left: "auto" }; } function On(t, e) { return t ? t.offsetHeight : 0; } function Qo(t, e = []) { const n = dr(t); return n === null ? e : Qo(n, e.concat([n])); } function Ln(t, e) { let n = t.previousElementSibling; for (; n; ) { if (n.matches(e)) return n; n = n.previousElementSibling; } return null; } function tl(t) { const e = []; if (t) { const n = Qo(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 = Ne(o, l); u && i(u) && e.push(u); } } o.nodeType !== 9 && i(o) && e.push(o); } } return e; } function Rr() { if (window.getSelection) return window.getSelection().toString(); if (document.getSelection) return document.getSelection().toString(); } function it(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 $r(t, e, n) { const r = t[e]; typeof r == "function" && r.apply(t, []); } function nl() { return /(android)/i.test(navigator.userAgent); } function An(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 ei() { return !!(typeof window < "u" && window.document && window.document.createElement); } function Tr(t, e = "") { return ut(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 xn(t) { return !!(t && t.offsetParent != null); } function pr() { return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; } function fr(t, e = "", n) { ut(t) && n !== null && n !== void 0 && t.setAttribute(e, n); } function hr() { 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 ze(t) { return t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0; } function rl(t, e, n, r = 1) { let i = -1; const o = ze(t), a = ze(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 Hn(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 (!Hn(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 c = t instanceof RegExp, d = e instanceof RegExp; if (c != d) return !1; if (c && d) 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], !Hn(t[s], e[s], n)) return !1; return !0; } function ol(t, e) { return Hn(t, e); } function En(t) { return typeof t == "function" && "call" in t && "apply" in t; } function G(t) { return !ze(t); } function J(t, e) { if (!t || !e) return null; try { const n = t[e]; if (G(n)) return n; } catch { } if (Object.keys(t).length) { if (En(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 dt(t, e, n) { return n ? J(t, n) === J(e, n) : ol(t, e); } function il(t, e) { if (t != null && e && e.length) { for (const n of e) if (dt(t, n)) return !0; } return !1; } function st(t, e = !0) { return t instanceof Object && t.constructor === Object && (e || Object.keys(t).length !== 0); } function Bn(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 Lr(t, e) { let n = -1; if (G(t)) try { n = t.findLastIndex(e); } catch { n = t.lastIndexOf([...t].reverse().find(e)); } return n; } function Pe(t, ...e) { return En(t) ? t(...e) : t; } function Te(t, e = !0) { return typeof t == "string" && (e || t !== ""); } function Ke(t) { return Te(t) ? t.replace(/(-|_)/g, "").toLowerCase() : t; } function mr(t, e = "", n = {}) { const r = Ke(e).split("."), i = r.shift(); if (i) { if (st(t)) { const o = Object.keys(t).find((a) => Ke(a) === i) || ""; return mr(Pe(t[o], n), r.join("."), n); } return; } return Pe(t, n); } function ti(t, e = !0) { return Array.isArray(t) && (e || t.length !== 0); } function al(t) { return G(t) && !isNaN(t); } function ll(t = "") { return G(t) && t.length === 1 && !!t.match(/\S| /); } function Er() { return new Intl.Collator(void 0, { numeric: !0 }).compare; } function mt(t, e) { if (e) { const n = e.test(t); return e.lastIndex = 0, n; } return !1; } function Ot(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 Ee(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 Dr(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 Mr(t, e, n = 1, r, i = 1) { const o = rl(t, e, r, n); let a = n; return (ze(t) || ze(e)) && (a = i === 1 ? n : i), a * o; } function sl(t) { return Te(t, !1) ? t[0].toUpperCase() + t.slice(1) : t; } function ni(t) { return Te(t) ? t.replace(/(_)/g, "-").replace(/[A-Z]/g, (e, n) => n === 0 ? e : "-" + e.toLowerCase()).toLowerCase() : t; } var fn = {}; function ul(t = "pui_id_") { return Object.hasOwn(fn, t) || (fn[t] = 0), fn[t]++, `${t}${fn[t]}`; } function dl() { let t = []; const e = (a, s, l = 999) => { const u = i(a, s, l), c = u.value + (u.key === a ? 0 : l) + 1; return t.push({ key: a, value: c }), c; }, 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 Ue = dl(), Fr = { STARTS_WITH: "startsWith", CONTAINS: "contains" }, In = { AND: "and", OR: "or" }; function Ar(t, e) { var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (!n) { if (Array.isArray(t) || (n = cl(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 cl(t, e) { if (t) { if (typeof t == "string") return Br(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) ? Br(t, e) : void 0; } } function Br(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 Nn = { filter: function(e, n, r, i, o) { var a = []; if (!e) return a; var s = Ar(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 c = Ar(n), d; try { for (c.s(); !(d = c.n()).done; ) { var h = d.value, f = J(u, h); if (this.filters[i](f, r, o)) { a.push(u); break; } } } catch (y) { c.e(y); } finally { c.f(); } } } } catch (y) { s.e(y); } finally { s.f(); } return a; }, filters: { startsWith: function(e, n, r) { if (n == null || n === "") return !0; if (e == null) return !1; var i = Ee(n.toString()).toLocaleLowerCase(r), o = Ee(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 = Ee(n.toString()).toLocaleLowerCase(r), o = Ee(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 = Ee(n.toString()).toLocaleLowerCase(r), o = Ee(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 = Ee(n.toString()).toLocaleLowerCase(r), o = Ee(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() : Ee(e.toString()).toLocaleLowerCase(r) == Ee(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() : Ee(e.toString()).toLocaleLowerCase(r) != Ee(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 (dt(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 Rt(t) { "@babel/helpers - typeof"; return Rt = 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; }, Rt(t); } function pl(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function fl(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, ml(r.key), r); } } function hl(t, e, n) { return e && fl(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function ml(t) { var e = bl(t, "string"); return Rt(e) == "symbol" ? e : e + ""; } function bl(t, e) { if (Rt(t) != "object" || !t) return t; var n = t[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(t, e); if (Rt(r) != "object") return r; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(t); } var br = /* @__PURE__ */ function() { function t(e) { var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { }; pl(this, t), this.element = e, this.listener = n; } return hl(t, [{ key: "bindScrollListener", value: function() { this.scrollableParents = tl(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 $t(t) { "@babel/helpers - typeof"; return $t = 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; }, $t(t); } function gl(t) { return Cl(t) || wl(t) || vl(t) || yl(); } function yl() { 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 vl(t, e) { if (t) { if (typeof t == "string") return Gn(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) ? Gn(t, e) : void 0; } } function wl(t) { if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); } function Cl(t) { if (Array.isArray(t)) return Gn(t); } function Gn(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 Sl(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function kl(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, ri(r.key), r); } } function Pl(t, e, n) { return e && kl(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function zr(t, e, n) { return (e = ri(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t; } function ri(t) { var e = Ol(t, "string"); return $t(e) == "symbol" ? e : e + ""; } function Ol(t, e) { if ($t(t) != "object" || !t) return t; var n = t[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(t, e); if ($t(r) != "object") return r; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(t); } var gt = /* @__PURE__ */ function() { function t(e) { var n = e.init, r = e.type; Sl(this, t), zr(this, "helpers", void 0), zr(this, "type", void 0), this.helpers = new Set(n), this.type = r; } return Pl(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(gl(this.helpers), i) : null; return G(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) : G(a.key) && (o = o.concat(r.filter(function(s) { return n._isMatched(s, a.key); }).map(function(s) { return s.vnode; }))); }), o; } }]); }(); function Qe(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 xl = Object.defineProperty, Il = Object.defineProperties, Rl = Object.getOwnPropertyDescriptors, Rn = Object.getOwnPropertySymbols, oi = Object.prototype.hasOwnProperty, ii = Object.prototype.propertyIsEnumerable, jr = (t, e, n) => e in t ? xl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Be = (t, e) => { for (var n in e || (e = {})) oi.call(e, n) && jr(t, n, e[n]); if (Rn) for (var n of Rn(e)) ii.call(e, n) && jr(t, n, e[n]); return t; }, zn = (t, e) => Il(t, Rl(e)), Ge = (t, e) => { var n = {}; for (var r in t) oi.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (t != null && Rn) for (var r of Rn(t)) e.indexOf(r) < 0 && ii.call(t, r) && (n[r] = t[r]); return n; }, $l = hr(), we = $l, _n = /{([^}]*)}/g, Tl = /(\d+\s+[\+\-\*\/]\s+\d+)/g, Ll = /var\([^)]+\)/g; function El(t) { return st(t) && t.hasOwnProperty("$value") && t.hasOwnProperty("$type") ? t.$value : t; } function Dl(t) { return t.replaceAll(/ /g, "").replace(/[^\w]/g, "-"); } function Un(t = "", e = "") { return Dl(`${Te(t, !1) && Te(e, !1) ? `${t}-` : t}${e}`); } function ai(t = "", e = "") { return `--${Un(t, e)}`; } function Ml(t = "") { const e = (t.match(/{/g) || []).length, n = (t.match(/}/g) || []).length; return (e + n) % 2 !== 0; } function li(t, e = "", n = "", r = [], i) { if (Te(t)) { const o = t.trim(); if (Ml(o)) return; if (mt(o, _n)) { const a = o.replaceAll(_n, (s) => { const u = s.replace(/{|}/g, "").split(".").filter((c) => !r.some((d) => mt(c, d))); return `var(${ai(n, ni(u.join("-")))}${G(i) ? `, ${i}` : ""})`; }); return mt(a.replace(Ll, "0"), Tl) ? `calc(${a})` : a; } return o; } else if (al(t)) return t; } function Fl(t, e, n) { Te(e, !1) && t.push(`${e}:${n};`); } function ht(t, e) { return t ? `${t}{${e}}` : ""; } function si(t, e) { if (t.indexOf("dt(") === -1) return t; function n(a, s) { const l = []; let u = 0, c = "", d = null, h = 0; for (; u <= a.length; ) { const f = a[u]; if ((f === '"' || f === "'" || f === "`") && a[u - 1] !== "\\" && (d = d === f ? null : f), !d && (f === "(" && h++, f === ")" && h--, (f === "," || u === a.length) && h === 0)) { const y = c.trim(); y.startsWith("dt(") ? l.push(si(y, s)) : l.push(r(y)), c = "", u++; continue; } f !== void 0 && (c += f), 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), c = n(u, e), d = e(...c); t = t.slice(0, s) + d + t.slice(l + 1); } return t; } var lt = (...t) => Al(le.getTheme(), ...t), Al = (t = {}, e, n, r) => { if (e) { const { variable: i, options: o } = le.defaults || {}, { prefix: a, transform: s } = (t == null ? void 0 : t.options) || o || {}, l = mt(e, _n) ? e : `{${e}}`; return r === "value" || ze(r) && s === "strict" ? le.getTokenValue(e) : li(l, void 0, a, [i.excludedKeyRegex], n); } return ""; }; function hn(t, ...e) { if (t instanceof Array) { const n = t.reduce((r, i, o) => { var a; return r + i + ((a = Pe(e[o], { dt: lt })) != null ? a : ""); }, ""); return si(n, lt); } return Pe(t, { dt: lt }); } function Bl(t, e = {}) { const n = le.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: c, path: d } = l.pop(); for (const h in c) { const f = c[h], y = El(f), C = mt(h, o) ? Un(d) : Un(d, ni(h)); if (st(y)) l.push({ node: y, path: C }); else { const g = ai(C), x = li(y, C, r, [o]); Fl(s, g, x); let D = C; r && D.startsWith(r + "-") && (D = D.slice(r.length + 1)), a.push(D.replace(/-/g, ".")); } } } const u = s.join(""); return { value: s, tokens: a, declarations: u, css: ht(i, u) }; } var Ae = { 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 Bl(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, c, d; const { preset: h, options: f } = e; let y, O, C, g, x, D, w; if (G(h) && f.transform !== "strict") { const { primitive: F, semantic: j, extend: I } = h, L = j || {}, { colorScheme: B } = L, N = Ge(L, ["colorScheme"]), _ = I || {}, { colorScheme: P } = _, W = Ge(_, ["colorScheme"]), X = B || {}, { dark: T } = X, Z = Ge(X, ["dark"]), Y = P || {}, { dark: ve } = Y, be = Ge(Y, ["dark"]), fe = G(F) ? this._toVariables({ primitive: F }, f) : {}, Le = G(N) ? this._toVariables({ semantic: N }, f) : {}, Fe = G(Z) ? this._toVariables({ light: Z }, f) : {}, ct = G(T) ? this._toVariables({ dark: T }, f) : {}, Ze = G(W) ? this._toVariables({ semantic: W }, f) : {}, V = G(be) ? this._toVariables({ light: be }, f) : {}, te = G(ve) ? this._toVariables({ dark: ve }, f) : {}, [se, ie] = [(o = fe.declarations) != null ? o : "", fe.tokens], [ue, Oe] = [(a = Le.declarations) != null ? a : "", Le.tokens || []], [xe, qe] = [(s = Fe.declarations) != null ? s : "", Fe.tokens || []], [et, dn] = [(l = ct.declarations) != null ? l : "", ct.tokens || []], [aa, la] = [(u = Ze.declarations) != null ? u : "", Ze.tokens || []], [sa, ua] = [(c = V.declarations) != null ? c : "", V.tokens || []], [da, ca] = [(d = te.declarations) != null ? d : "", te.tokens || []]; y = this.transformCSS(t, se, "light", "variable", f, r, i), O = ie; const pa = this.transformCSS(t, `${ue}${xe}`, "light", "variable", f, r, i), fa = this.transformCSS(t, `${et}`, "dark", "variable", f, r, i); C = `${pa}${fa}`, g = [.../* @__PURE__ */ new Set([...Oe, ...qe, ...dn])]; const ha = this.transformCSS(t, `${aa}${sa}color-scheme:light`, "light", "variable", f, r, i), ma = this.transformCSS(t, `${da}color-scheme:dark`, "dark", "variable", f, r, i); x = `${ha}${ma}`, D = [.../* @__PURE__ */ new Set([...la, ...ua, ...ca])], w = Pe(h.css, { dt: lt }); } return { primitive: { css: y, tokens: O }, semantic: { css: C, tokens: g }, global: { css: x, tokens: D }, style: w }; }, getPreset({ name: t = "", preset: e = {}, options: n, params: r, set: i, defaults: o, selector: a }) { var s, l, u; let c, d, h; if (G(e) && n.transform !== "strict") { const f = t.replace("-directive", ""), y = e, { colorScheme: O, extend: C, css: g } = y, x = Ge(y, ["colorScheme", "extend", "css"]), D = C || {}, { colorScheme: w } = D, F = Ge(D, ["colorScheme"]), j = O || {}, { dark: I } = j, L = Ge(j, ["dark"]), B = w || {}, { dark: N } = B, _ = Ge(B, ["dark"]), P = G(x) ? this._toVariables({ [f]: Be(Be({}, x), F) }, n) : {}, W = G(L) ? this._toVariables({ [f]: Be(Be({}, L), _) }, n) : {}, X = G(I) ? this._toVariables({ [f]: Be(Be({}, I), N) }, n) : {}, [T, Z] = [(s = P.declarations) != null ? s : "", P.tokens || []], [Y, ve] = [(l = W.declarations) != null ? l : "", W.tokens || []], [be, fe] = [(u = X.declarations) != null ? u : "", X.tokens || []], Le = this.transformCSS(f, `${T}${Y}`, "light", "variable", n, i, o, a), Fe = this.transformCSS(f, be, "dark", "variable", n, i, o, a); c = `${Le}${Fe}`, d = [.../* @__PURE__ */ new Set([...Z, ...ve, ...fe])], h = Pe(g, { dt: lt }); } return { css: c, tokens: d, 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, c = ((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: c, 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 ${Pe(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, c]) => l.push(`${u}="${c}"`) && l, []).join(" "); return Object.entries(a || {}).reduce((l, [u, c]) => { if (st(c) && Object.hasOwn(c, "css")) { const d = Ot(c.css), h = `${u}-variables`; l.push(`<style type="text/css" data-primevue-style-id="${h}" ${s}>${d}</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((c, [d, h]) => c.push(`${d}="${h}"`) && c, []).join(" "); return l ? `<style type="text/css" data-primevue-style-id="${t}-variables" ${u}>${Ot(l)}</style>` : ""; }, createTokens(t = {}, e, n = "", r = "", i = {}) { return {}; }, getTokenValue(t, e, n) { var r; const o = ((l) => l.split(".").filter((c) => !mt(c.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 c = u, { colorScheme: d } = c, h = Ge(c, ["colorScheme"]); return l[d] = h, l; }, void 0); }, getSelectorRule(t, e, n, r) { return n === "class" || n === "attr" ? ht(G(e) ? `${t}${e},${t} ${e}` : t, r) : ht(t, G(e) ? ht(e, r) : r); }, transformCSS(t, e, n, r, i = {}, o, a, s) { if (G(e)) { const { cssLayer: l } = i; if (r !== "style") { const u = this.getColorSchemeOption(i, a); e = n === "dark" ? u.reduce((c, { type: d, selector: h }) => (G(h) && (c += h.includes("[CSS]") ? h.replace("[CSS]", e) : this.getSelectorRule(h, s, d, e)), c), "") : ht(s ?? ":root", e); } if (l) { const u = { name: "primeui" }; st(l) && (u.name = Pe(l.name, { name: t, type: r })), G(u.name) && (e = ht(`@layer ${u.name}`, e), o == null || o.layerNames(u.name)); } return e; } return ""; } }, le = { 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 = zn(Be({}, e), { options: Be(Be({}, this.defaults.options), e.options) }), this._tokens = Ae.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 }), we.emit("theme:change", t); }, getPreset() { return this.preset; }, setPreset(t) { this._theme = zn(Be({}, this.theme), { preset: t }), this._tokens = Ae.createTokens(t, this.defaults), this.clearLoadedStyleNames(), we.emit("preset:change", t), we.emit("theme:change", this.theme); }, getOptions() { return this.options; }, setOptions(t) { this._theme = zn(Be({}, this.theme), { options: t }), this.clearLoadedStyleNames(), we.emit("options:change", t), we.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 Ae.getTokenValue(this.tokens, t, this.defaults); }, getCommon(t = "", e) { return Ae.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 Ae.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 Ae.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 Ae.getPreset(i); }, getLayerOrderCSS(t = "") { return Ae.getLayerOrder(t, this.options, { names: this.getLayerNames() }, this.defaults); }, transformCSS(t = "", e, n = "style", r) { return Ae.transformCSS(t, e, r, n, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults); }, getCommonStyleSheet(t = "", e, n = {}) { return Ae.getCommonStyleSheet({ name: t, theme: this.theme, params: e, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, getStyleSheet(t, e, n = {}) { return Ae.getStyleSheet({ name: t, theme: this.theme, params: e, props: n, defaults: this.def