@skill-map/cli 0.16.6 → 0.18.0

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.
Files changed (41) hide show
  1. package/dist/cli/tutorial/sm-tutorial.md +8 -0
  2. package/dist/cli.js +8324 -5644
  3. package/dist/cli.js.map +1 -1
  4. package/dist/conformance/index.js +36 -14
  5. package/dist/conformance/index.js.map +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +540 -61
  8. package/dist/index.js.map +1 -1
  9. package/dist/kernel/index.d.ts +443 -87
  10. package/dist/kernel/index.js +540 -61
  11. package/dist/kernel/index.js.map +1 -1
  12. package/dist/migrations/002_sidecar_columns.sql +53 -0
  13. package/dist/migrations/003_drop_node_author.sql +20 -0
  14. package/dist/migrations/004_sidecar_root_json.sql +23 -0
  15. package/dist/migrations/005_node_favorites.sql +20 -0
  16. package/dist/ui/chunk-3R7E3HPC.js +7 -0
  17. package/dist/ui/chunk-JKJGGXCS.js +1025 -0
  18. package/dist/ui/chunk-SX2A3WBX.js +247 -0
  19. package/dist/ui/chunk-TWZHUCAT.js +237 -0
  20. package/dist/ui/chunk-UJOZYR5I.js +1 -0
  21. package/dist/ui/chunk-WTAL2RK4.js +1 -0
  22. package/dist/ui/chunk-Z3UJHHTC.js +3091 -0
  23. package/dist/ui/index.html +2 -2
  24. package/dist/ui/main-AAYGMON4.js +1 -0
  25. package/dist/ui/skill-map-mark-dark.svg +8 -0
  26. package/dist/ui/skill-map-mark-light.svg +8 -0
  27. package/dist/ui/{styles-TCK5JUQE.css → styles-CBPFNGXA.css} +1 -1
  28. package/migrations/002_sidecar_columns.sql +53 -0
  29. package/migrations/003_drop_node_author.sql +20 -0
  30. package/migrations/004_sidecar_root_json.sql +23 -0
  31. package/migrations/005_node_favorites.sql +20 -0
  32. package/package.json +6 -6
  33. package/dist/ui/chunk-7PFTODKS.js +0 -1031
  34. package/dist/ui/chunk-A4RBO3TD.js +0 -38
  35. package/dist/ui/chunk-KPEISNOV.js +0 -819
  36. package/dist/ui/chunk-NKC42FI7.js +0 -210
  37. package/dist/ui/chunk-S5C4U3I3.js +0 -2403
  38. package/dist/ui/chunk-TG6IWVEC.js +0 -54
  39. package/dist/ui/chunk-TGJQE3TH.js +0 -54
  40. package/dist/ui/chunk-UGEECDPV.js +0 -1
  41. package/dist/ui/main-XSGTD7FQ.js +0 -1
@@ -0,0 +1,53 @@
1
+ -- Step 9.6.2 — kernel sidecar reader + drift detection.
2
+ --
3
+ -- Extends `scan_nodes` with three new columns to denormalise the
4
+ -- sidecar-derived state for fast queries:
5
+ --
6
+ -- - `sidecar_present` — boolean flag, 1 when a co-located `.sm` file
7
+ -- accompanies this node, 0 otherwise. Default 0.
8
+ -- - `sidecar_status` — fresh / stale-body / stale-frontmatter /
9
+ -- stale-both. NULL when no sidecar is present.
10
+ -- - `annotations_json` — JSON-encoded `annotations:` block from the
11
+ -- parsed sidecar (the typed surface declared by
12
+ -- `spec/schemas/annotations.schema.json`). NULL when no sidecar or
13
+ -- when the block is empty.
14
+ --
15
+ -- Hard-cut migration of the source-of-truth for three pre-existing
16
+ -- columns (Decision #3 — option (a), extend `scan_nodes`):
17
+ --
18
+ -- - `stability` — was sourced from `frontmatter.metadata.stability`,
19
+ -- now sourced from sidecar `annotations.stability`.
20
+ -- - `version` — was `TEXT` (semver string from
21
+ -- `frontmatter.metadata.version`); now `INTEGER` (monotonic counter
22
+ -- from sidecar `annotations.version`). Pre-9.6.2 rows reset to
23
+ -- NULL — greenfield migration, no automatic semver→integer
24
+ -- conversion (Decision #125 / per-project policy).
25
+ -- - `author` — was sourced from `frontmatter.author`, now sourced
26
+ -- from sidecar `annotations.author`.
27
+ --
28
+ -- The fallback path through `pickMetadata` for these three fields is
29
+ -- removed in the kernel; other consumers of `metadata.*` (e.g.
30
+ -- broken-ref's `metadata.related`) are out of scope for 9.6.2.
31
+ --
32
+ -- SQLite limitation note: the three pre-existing columns retain their
33
+ -- original types where possible. For `version` we change the type by
34
+ -- dropping and re-adding the column (safe: greenfield reset to NULL
35
+ -- is the documented migration outcome). DROP COLUMN requires SQLite
36
+ -- 3.35+; node:sqlite (Node 22+) ships SQLite ≥ 3.45.
37
+
38
+ ALTER TABLE scan_nodes DROP COLUMN version;
39
+ ALTER TABLE scan_nodes ADD COLUMN version INTEGER;
40
+
41
+ ALTER TABLE scan_nodes ADD COLUMN sidecar_present INTEGER NOT NULL DEFAULT 0;
42
+ ALTER TABLE scan_nodes ADD COLUMN sidecar_status TEXT;
43
+ ALTER TABLE scan_nodes ADD COLUMN annotations_json TEXT;
44
+
45
+ -- Reset stability + author to NULL — they used to be populated from
46
+ -- frontmatter.metadata.{stability,author}; the new source is
47
+ -- sidecar `annotations.{stability,author}` and a re-scan repopulates.
48
+ UPDATE scan_nodes SET stability = NULL, author = NULL;
49
+
50
+ -- Constraint mirrors the four legal values returned by the kernel's
51
+ -- drift detector. NULL is allowed (and required) when no sidecar is
52
+ -- present.
53
+ CREATE INDEX ix_scan_nodes_sidecar_status ON scan_nodes(sidecar_status);
@@ -0,0 +1,20 @@
1
+ -- Step 9.6 catalog-curation follow-up (2026-05-07).
2
+ --
3
+ -- Drop the vestigial `scan_nodes.author` column. The 9.6.2 migration
4
+ -- denormalised `annotations.author` into the column; the 2026-05-07
5
+ -- catalog curation removed `author` from `annotations.schema.json`,
6
+ -- which left the column without a canonical source. Anyone who still
7
+ -- writes `author:` in their `.sm` rides on `additionalProperties: true`
8
+ -- — the value lands in `annotations_json` (no longer in a typed
9
+ -- column), and `unknown-field` warns on it as a typo guard.
10
+ --
11
+ -- Greenfield drop: pre-9.6 rows had the column reset to NULL by
12
+ -- migration 002, and the curation rolled out before any released
13
+ -- consumer pinned the post-9.6.2 shape. No automatic salvage path —
14
+ -- if a deployed DB carried real data, it is preserved verbatim under
15
+ -- `scan_nodes.annotations_json` until the next scan rewrites the row.
16
+ --
17
+ -- DROP COLUMN requires SQLite 3.35+; node:sqlite (Node 22+) ships
18
+ -- SQLite ≥ 3.45.
19
+
20
+ ALTER TABLE scan_nodes DROP COLUMN author;
@@ -0,0 +1,23 @@
1
+ -- R15 closure (2026-05-07) — surface the full parsed `.sm` root on the
2
+ -- BFF wire shape (`Node.sidecar.root`).
3
+ --
4
+ -- Adds `scan_nodes.sidecar_root_json`, sibling to `annotations_json`
5
+ -- (Decision: option (b), additive — no rewrite of the existing read
6
+ -- path; duplicates the `annotations:` sub-block by design so
7
+ -- pre-R15 consumers reading `annotations_json` keep working unchanged).
8
+ --
9
+ -- Column shape:
10
+ -- - JSON-encoded full parsed YAML root of the matching `.sm` file
11
+ -- (every top-level reserved block — `for` / `annotations` /
12
+ -- `settings` / `audit` — plus `<plugin-id>:` namespaces a plugin
13
+ -- opt-in to root via `annotationContributions`).
14
+ -- - NULL when no sidecar accompanies the node, or when the sidecar
15
+ -- exists but failed to parse / validate (in that case
16
+ -- `sidecar_present` stays 1 and `sidecar_status` stays NULL).
17
+ --
18
+ -- Backfill on existing rows: NULL. Re-scan repopulates the column from
19
+ -- the live `.sm` file via `parseSidecar()`'s already-computed `raw`
20
+ -- payload. Greenfield posture per `feedback_greenfield_no_versioning.md`
21
+ -- — no released consumer depends on the prior shape.
22
+
23
+ ALTER TABLE scan_nodes ADD COLUMN sidecar_root_json TEXT;
@@ -0,0 +1,20 @@
1
+ -- Per-node "favorite" flag persisted per user (single-user local DB).
2
+ --
3
+ -- Zone `state_` because favorites are user-authored preference and must
4
+ -- survive `sm scan` truncation and `sm db reset` (which drops only
5
+ -- `scan_*`). Absence of a row means "not favorited".
6
+ --
7
+ -- `node_path` is FK-semantic to `scan_nodes.path`. The rename heuristic
8
+ -- (`migrateNodeFks` in src/kernel/adapters/sqlite/history.ts) MUST migrate
9
+ -- rows here when a path is renamed, same protocol as the other state_*
10
+ -- tables. Simple PK update — no composite key, no collision shape.
11
+ --
12
+ -- The BFF's `/api/nodes` route loads the full set of paths once per
13
+ -- request (typical favorite count is small) and decorates the in-memory
14
+ -- node list with a derived `isFavorite` boolean by Set membership. No
15
+ -- SQL JOIN against `scan_nodes` is required.
16
+
17
+ CREATE TABLE state_node_favorites (
18
+ node_path TEXT PRIMARY KEY,
19
+ favorited_at INTEGER NOT NULL
20
+ );
@@ -0,0 +1,7 @@
1
+ var ft=Object.defineProperty,ve=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,be=(e,t,n)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t)=>{for(var n in t||(t={}))pt.call(t,n)&&be(e,n,t[n]);if(ve)for(var n of ve(t))ht.call(t,n)&&be(e,n,t[n]);return e};function W(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0}function oe(e,t,n=new WeakSet){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object"||n.has(e)||n.has(t))return!1;n.add(e).add(t);let r=Array.isArray(e),i=Array.isArray(t),l,o,s;if(r&&i){if(o=e.length,o!=t.length)return!1;for(l=o;l--!==0;)if(!oe(e[l],t[l],n))return!1;return!0}if(r!=i)return!1;let a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();let d=e instanceof RegExp,p=t instanceof RegExp;if(d!=p)return!1;if(d&&p)return e.toString()==t.toString();let c=Object.keys(e);if(o=c.length,o!==Object.keys(t).length)return!1;for(l=o;l--!==0;)if(!Object.prototype.hasOwnProperty.call(t,c[l]))return!1;for(l=o;l--!==0;)if(s=c[l],!oe(e[s],t[s],n))return!1;return!0}function gt(e,t){return oe(e,t)}function xe(e){return typeof e=="function"&&"call"in e&&"apply"in e}function h(e){return!W(e)}function Se(e,t){if(!e||!t)return null;try{let n=e[t];if(h(n))return n}catch{}if(Object.keys(e).length){if(xe(t))return t(e);if(t.indexOf(".")===-1)return e[t];{let n=t.split("."),r=e;for(let i=0,l=n.length;i<l;++i){if(r==null)return null;r=r[n[i]]}return r}}return null}function yt(e,t,n){return n?Se(e,n)===Se(t,n):gt(e,t)}function Bt(e,t){if(e!=null&&t&&t.length){for(let n of t)if(yt(e,n))return!0}return!1}function C(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||Object.keys(e).length!==0)}function Ce(e={},t={}){let n=mt({},e);return Object.keys(t).forEach(r=>{let i=r;C(t[i])&&i in e&&C(e[i])?n[i]=Ce(e[i],t[i]):n[i]=t[i]}),n}function N(...e){return e.reduce((t,n,r)=>r===0?n:Ce(t,n),{})}function It(e,t){let n=-1;if(h(e))try{n=e.findLastIndex(t)}catch{n=e.lastIndexOf([...e].reverse().find(t))}return n}function $(e,...t){return xe(e)?e(...t):e}function O(e,t=!0){return typeof e=="string"&&(t||e!=="")}function we(e){return O(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function le(e,t="",n={}){let r=we(t).split("."),i=r.shift();if(i){if(C(e)){let l=Object.keys(e).find(o=>we(o)===i)||"";return le($(e[l],n),r.join("."),n)}return}return $(e,n)}function Ee(e,t=!0){return Array.isArray(e)&&(t||e.length!==0)}function Mt(e){return e instanceof Date}function ne(e){return h(e)&&!isNaN(e)}function Ht(e=""){return h(e)&&e.length===1&&!!e.match(/\S| /)}function w(e,t){if(t){let n=t.test(e);return t.lastIndex=0,n}return!1}function se(...e){return N(...e)}function ae(e){return e&&e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":").trim()}function Ut(e){if(e&&/[\xC0-\xFF\u0100-\u017E]/.test(e)){let t={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(let n in t)e=e.replace(t[n],n)}return e}function re(e){return O(e)?e.replace(/(_)/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function Kt(e){return e==="auto"?0:typeof e=="number"?e:Number(e.replace(/[^\d.]/g,"").replace(",","."))*1e3}function $e(){let e=new Map;return{on(t,n){let r=e.get(t);return r?r.push(n):r=[n],e.set(t,r),this},off(t,n){let r=e.get(t);return r&&r.splice(r.indexOf(n)>>>0,1),this},emit(t,n){let r=e.get(t);r&&r.forEach(i=>{i(n)})},clear(){e.clear()}}}function vt(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className):!1}function Oe(e,t){if(e&&t){let n=r=>{vt(e,r)||(e.classList?e.classList.add(r):e.className+=" "+r)};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function bt(){return window.innerWidth-document.documentElement.offsetWidth}function Xt(e){typeof e=="string"?Oe(document.body,e||"p-overflow-hidden"):(e!=null&&e.variableName&&document.body.style.setProperty(e.variableName,bt()+"px"),Oe(document.body,e?.className||"p-overflow-hidden"))}function ke(e,t){if(e&&t){let n=r=>{e.classList?e.classList.remove(r):e.className=e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function Zt(e){typeof e=="string"?ke(document.body,e||"p-overflow-hidden"):(e!=null&&e.variableName&&document.body.style.removeProperty(e.variableName),ke(document.body,e?.className||"p-overflow-hidden"))}function ue(e){for(let t of document?.styleSheets)try{for(let n of t?.cssRules)for(let r of n?.style)if(e.test(r))return{name:r,value:n.style.getPropertyValue(r).trim()}}catch{}return null}function Ae(e){let t={width:0,height:0};if(e){let[n,r]=[e.style.visibility,e.style.display],i=e.getBoundingClientRect();e.style.visibility="hidden",e.style.display="block",t.width=i.width||e.offsetWidth,t.height=i.height||e.offsetHeight,e.style.display=r,e.style.visibility=n}return t}function Ne(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0],i=e.innerWidth||n.clientWidth||r.clientWidth,l=e.innerHeight||n.clientHeight||r.clientHeight;return{width:i,height:l}}function de(e){return e?Math.abs(e.scrollLeft):0}function St(){let e=document.documentElement;return(window.pageXOffset||de(e))-(e.clientLeft||0)}function wt(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function xt(e){return e?getComputedStyle(e).direction==="rtl":!1}function Gt(e,t,n=!0){var r,i,l,o;if(e){let s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ae(e),a=s.height,u=s.width,d=t.offsetHeight,p=t.offsetWidth,c=t.getBoundingClientRect(),f=wt(),g=St(),v=Ne(),y,b,S="top";c.top+d+a>v.height?(y=c.top+f-a,S="bottom",y<0&&(y=f)):y=d+c.top+f,c.left+u>v.width?b=Math.max(0,c.left+g+p-u):b=c.left+g,xt(e)?e.style.insetInlineEnd=b+"px":e.style.insetInlineStart=b+"px",e.style.top=y+"px",e.style.transformOrigin=S,n&&(e.style.marginTop=S==="bottom"?`calc(${(i=(r=ue(/-anchor-gutter$/))==null?void 0:r.value)!=null?i:"2px"} * -1)`:(o=(l=ue(/-anchor-gutter$/))==null?void 0:l.value)!=null?o:"")}}function Yt(e,t){e&&(typeof t=="string"?e.style.cssText=t:Object.entries(t||{}).forEach(([n,r])=>e.style[n]=r))}function Jt(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}function Qt(e,t,n=!0,r=void 0){var i;if(e){let l=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ae(e),o=t.offsetHeight,s=t.getBoundingClientRect(),a=Ne(),u,d,p=r??"top";if(!r&&s.top+o+l.height>a.height?(u=-1*l.height,p="bottom",s.top+u<0&&(u=-1*s.top)):u=o,l.width>a.width?d=s.left*-1:s.left+l.width>a.width?d=(s.left+l.width-a.width)*-1:d=0,e.style.top=u+"px",e.style.insetInlineStart=d+"px",e.style.transformOrigin=p,n){let c=(i=ue(/-anchor-gutter$/))==null?void 0:i.value;e.style.marginTop=p==="bottom"?`calc(${c??"2px"} * -1)`:c??""}}}function Pe(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function Ct(e){return!!(e!==null&&typeof e<"u"&&e.nodeName&&Pe(e))}function T(e){return typeof Element<"u"?e instanceof Element:e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}function je(e){let t=e;return e&&typeof e=="object"&&(Object.hasOwn(e,"current")?t=e.current:Object.hasOwn(e,"el")&&(Object.hasOwn(e.el,"nativeElement")?t=e.el.nativeElement:t=e.el)),T(t)?t:void 0}function Et(e,t){var n,r,i;if(e)switch(e){case"document":return document;case"window":return window;case"body":return document.body;case"@next":return t?.nextElementSibling;case"@prev":return t?.previousElementSibling;case"@first":return t?.firstElementChild;case"@last":return t?.lastElementChild;case"@child":return(n=t?.children)==null?void 0:n[0];case"@parent":return t?.parentElement;case"@grandparent":return(r=t?.parentElement)==null?void 0:r.parentElement;default:{if(typeof e=="string"){let s=e.match(/^@child\[(\d+)]/);return s?((i=t?.children)==null?void 0:i[parseInt(s[1],10)])||null:document.querySelector(e)||null}let l=(s=>typeof s=="function"&&"call"in s&&"apply"in s)(e)?e():e,o=je(l);return Ct(o)?o:l?.nodeType===9?l:void 0}}}function en(e,t){let n=Et(e,t);if(n)n.appendChild(t);else throw new Error("Cannot append "+t+" to "+e)}function Te(e,t={}){if(T(e)){let n=(r,i)=>{var l,o;let s=(l=e?.$attrs)!=null&&l[r]?[(o=e?.$attrs)==null?void 0:o[r]]:[];return[i].flat().reduce((a,u)=>{if(u!=null){let d=typeof u;if(d==="string"||d==="number")a.push(u);else if(d==="object"){let p=Array.isArray(u)?n(r,u):Object.entries(u).map(([c,f])=>r==="style"&&(f||f===0)?`${c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${f}`:f?c:void 0);a=p.length?a.concat(p.filter(c=>!!c)):a}}return a},s)};Object.entries(t).forEach(([r,i])=>{if(i!=null){let l=r.match(/^on(.+)/);l?e.addEventListener(l[1].toLowerCase(),i):r==="p-bind"||r==="pBind"?Te(e,i):(i=r==="class"?[...new Set(n("class",i))].join(" ").trim():r==="style"?n("style",i).join(";").trim():i,(e.$attrs=e.$attrs||{})&&(e.$attrs[r]=i),e.setAttribute(r,i))}})}}function tn(e,t={},...n){if(e){let r=document.createElement(e);return Te(r,t),r.append(...n),r}}function Le(e,t={}){return e?`<style${Object.entries(t).reduce((n,[r,i])=>n+` ${r}="${i}"`,"")}>${e}</style>`:""}function nn(e,t){if(e){e.style.opacity="0";let n=+new Date,r="0",i=function(){r=`${+e.style.opacity+(new Date().getTime()-n)/t}`,e.style.opacity=r,n=+new Date,+r<1&&("requestAnimationFrame"in window?requestAnimationFrame(i):setTimeout(i,16))};i()}}function $t(e,t){return T(e)?Array.from(e.querySelectorAll(t)):[]}function rn(e,t){return T(e)?e.matches(t)?e:e.querySelector(t):null}function on(e,t){e&&document.activeElement!==e&&e.focus(t)}function ln(e,t){if(T(e)){let n=e.getAttribute(t);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}function _e(e,t=""){let n=$t(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
2
+ [href]:not([tabindex = "-1"]):not([style*="display:none"]):not([hidden])${t},
3
+ input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
4
+ select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
5
+ textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
6
+ [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
7
+ [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`),r=[];for(let i of n)getComputedStyle(i).display!="none"&&getComputedStyle(i).visibility!="hidden"&&r.push(i);return r}function sn(e,t){let n=_e(e,t);return n.length>0?n[0]:null}function an(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function un(e){var t;if(e){let n=(t=Pe(e))==null?void 0:t.childNodes,r=0;if(n)for(let i=0;i<n.length;i++){if(n[i]===e)return r;n[i].nodeType===1&&r++}}return-1}function dn(e,t){let n=_e(e,t);return n.length>0?n[n.length-1]:null}function cn(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||de(document.documentElement)||de(document.body)||0)}}return{top:"auto",left:"auto"}}function Ot(e,t){if(e){let n=e.offsetHeight;if(t){let r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}function fn(){if(window.getSelection)return window.getSelection().toString();if(document.getSelection)return document.getSelection().toString()}function pn(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function hn(e){if(e){let t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return t==="INPUT"||t==="TEXTAREA"||t==="BUTTON"||t==="A"||n==="INPUT"||n==="TEXTAREA"||n==="BUTTON"||n==="A"||!!e.closest(".p-button, .p-checkbox, .p-radiobutton")}return!1}function mn(e){return!!(e&&e.offsetParent!=null)}function gn(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function yn(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function vn(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}function bn(e){var t;e&&("remove"in Element.prototype?e.remove():(t=e.parentNode)==null||t.removeChild(e))}function Sn(e,t){let n=je(e);if(n)n.removeChild(t);else throw new Error("Cannot remove "+t+" from "+e)}function wn(e,t){let n=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=n?parseFloat(n):0,i=getComputedStyle(e).getPropertyValue("paddingTop"),l=i?parseFloat(i):0,o=e.getBoundingClientRect(),s=t.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-r-l,a=e.scrollTop,u=e.clientHeight,d=Ot(t);s<0?e.scrollTop=a+s:s+d>u&&(e.scrollTop=a+s-u+d)}function xn(e,t="",n){T(e)&&n!==null&&n!==void 0&&e.setAttribute(t,n)}function Cn(e,t,n=null,r){var i;t&&((i=e?.style)==null||i.setProperty(t,n,r))}var kt=Object.defineProperty,At=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,Fe=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))Be.call(t,n)&&Fe(e,n,t[n]);if(ie)for(var n of ie(t))Ie.call(t,n)&&Fe(e,n,t[n]);return e},j=(e,t)=>At(e,Nt(t)),k=(e,t)=>{var n={};for(var r in e)Be.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ie)for(var r of ie(e))t.indexOf(r)<0&&Ie.call(e,r)&&(n[r]=e[r]);return n};function On(...e){return N(...e)}var Pt=$e(),P=Pt,A=/{([^}]*)}/g,Me=/(\d+\s+[\+\-\*\/]\s+\d+)/g,He=/var\([^)]+\)/g;function Re(e){return O(e)?e.replace(/[A-Z]/g,(t,n)=>n===0?t:"."+t.toLowerCase()).toLowerCase():e}function Pn(e,t){Ee(e)?e.push(...t||[]):C(e)&&Object.assign(e,t)}function jt(e){return C(e)&&e.hasOwnProperty("$value")&&e.hasOwnProperty("$type")?e.$value:e}function jn(e,t=""){return["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some(n=>t.endsWith(n))?e:`${e}`.trim().split(" ").map(n=>ne(n)?`${n}px`:n).join(" ")}function Tt(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function ce(e="",t=""){return Tt(`${O(e,!1)&&O(t,!1)?`${e}-`:e}${t}`)}function Ue(e="",t=""){return`--${ce(e,t)}`}function Lt(e=""){let t=(e.match(/{/g)||[]).length,n=(e.match(/}/g)||[]).length;return(t+n)%2!==0}function Ke(e,t="",n="",r=[],i){if(O(e)){let l=e.trim();if(Lt(l))return;if(w(l,A)){let o=l.replaceAll(A,s=>{let a=s.replace(/{|}/g,"").split(".").filter(u=>!r.some(d=>w(u,d)));return`var(${Ue(n,re(a.join("-")))}${h(i)?`, ${i}`:""})`});return w(o.replace(He,"0"),Me)?`calc(${o})`:o}return l}else if(ne(e))return e}function Tn(e={},t){if(O(t)){let n=t.trim();return w(n,A)?n.replaceAll(A,r=>le(e,r.replace(/{|}/g,""))):n}else if(ne(t))return t}function _t(e,t,n){O(t,!1)&&e.push(`${t}:${n};`)}function L(e,t){return e?`${e}{${t}}`:""}function qe(e,t){if(e.indexOf("dt(")===-1)return e;function n(o,s){let a=[],u=0,d="",p=null,c=0;for(;u<=o.length;){let f=o[u];if((f==='"'||f==="'"||f==="`")&&o[u-1]!=="\\"&&(p=p===f?null:f),!p&&(f==="("&&c++,f===")"&&c--,(f===","||u===o.length)&&c===0)){let g=d.trim();g.startsWith("dt(")?a.push(qe(g,s)):a.push(r(g)),d="",u++;continue}f!==void 0&&(d+=f),u++}return a}function r(o){let s=o[0];if((s==='"'||s==="'"||s==="`")&&o[o.length-1]===s)return o.slice(1,-1);let a=Number(o);return isNaN(a)?o:a}let i=[],l=[];for(let o=0;o<e.length;o++)if(e[o]==="d"&&e.slice(o,o+3)==="dt(")l.push(o),o+=2;else if(e[o]===")"&&l.length>0){let s=l.pop();l.length===0&&i.push([s,o])}if(!i.length)return e;for(let o=i.length-1;o>=0;o--){let[s,a]=i[o],u=e.slice(s+3,a),d=n(u,t),p=t(...d);e=e.slice(0,s)+p+e.slice(a+1)}return e}function Ve(e){return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e}function We(e){let t=parseInt(e.substring(1),16),n=t>>16&255,r=t>>8&255,i=t&255;return{r:n,g:r,b:i}}function Ft(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}var ze=(e,t,n)=>{e=Ve(e),t=Ve(t);let r=(n/100*2-1+1)/2,i=1-r,l=We(e),o=We(t),s=Math.round(l.r*r+o.r*i),a=Math.round(l.g*r+o.g*i),u=Math.round(l.b*r+o.b*i);return Ft(s,a,u)},Rt=(e,t)=>ze("#000000",e,t),Vt=(e,t)=>ze("#ffffff",e,t),De=[50,100,200,300,400,500,600,700,800,900,950],Fn=e=>{if(w(e,A)){let t=e.replace(/{|}/g,"");return De.reduce((n,r)=>(n[r]=`{${t}.${r}}`,n),{})}return typeof e=="string"?De.reduce((t,n,r)=>(t[n]=r<=5?Vt(e,(5-r)*19):Rt(e,(r-5)*15),t),{}):e},Wn=e=>{var t;let n=x.getTheme(),r=fe(n,e,void 0,"variable"),i=(t=r?.match(/--[\w-]+/g))==null?void 0:t[0],l=fe(n,e,void 0,"value");return{name:i,variable:r,value:l}},D=(...e)=>fe(x.getTheme(),...e),fe=(e={},t,n,r)=>{if(t){let{variable:i,options:l}=x.defaults||{},{prefix:o,transform:s}=e?.options||l||{},a=w(t,A)?t:`{${t}}`;return r==="value"||W(r)&&s==="strict"?x.getTokenValue(t):Ke(a,void 0,o,[i.excludedKeyRegex],n)}return""};function Dn(e,...t){if(e instanceof Array){let n=e.reduce((r,i,l)=>{var o;return r+i+((o=$(t[l],{dt:D}))!=null?o:"")},"");return qe(n,D)}return $(e,{dt:D})}var pe=(e={})=>{let{preset:t,options:n}=e;return{preset(r){return t=t?se(t,r):r,this},options(r){return n=n?m(m({},n),r):r,this},primaryPalette(r){let{semantic:i}=t||{};return t=j(m({},t),{semantic:j(m({},i),{primary:r})}),this},surfacePalette(r){var i,l;let{semantic:o}=t||{},s=r&&Object.hasOwn(r,"light")?r.light:r,a=r&&Object.hasOwn(r,"dark")?r.dark:r,u={colorScheme:{light:m(m({},(i=o?.colorScheme)==null?void 0:i.light),!!s&&{surface:s}),dark:m(m({},(l=o?.colorScheme)==null?void 0:l.dark),!!a&&{surface:a})}};return t=j(m({},t),{semantic:m(m({},o),u)}),this},define({useDefaultPreset:r=!1,useDefaultOptions:i=!1}={}){return{preset:r?x.getPreset():t,options:i?x.getOptions():n}},update({mergePresets:r=!0,mergeOptions:i=!0}={}){let l={preset:r?se(x.getPreset(),t):t,options:i?m(m({},x.getOptions()),n):n};return x.setTheme(l),l},use(r){let i=this.define(r);return x.setTheme(i),i}}};function Wt(e,t={}){let n=x.defaults.variable,{prefix:r=n.prefix,selector:i=n.selector,excludedKeyRegex:l=n.excludedKeyRegex}=t,o=[],s=[],a=[{node:e,path:r}];for(;a.length;){let{node:d,path:p}=a.pop();for(let c in d){let f=d[c],g=jt(f),v=w(c,l)?ce(p):ce(p,re(c));if(C(g))a.push({node:g,path:v});else{let y=Ue(v),b=Ke(g,v,r,[l]);_t(s,y,b);let S=v;r&&S.startsWith(r+"-")&&(S=S.slice(r.length+1)),o.push(S.replace(/-/g,"."))}}}let u=s.join("");return{value:s,tokens:o,declarations:u,css:L(i,u)}}var E={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e},:host${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:e,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark)",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){let t=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[e].flat().map(n=>{var r;return(r=t.map(i=>i.resolve(n)).find(i=>i.matched))!=null?r:this.rules.custom.resolve(n)})}},_toVariables(e,t){return Wt(e,{prefix:t?.prefix})},getCommon({name:e="",theme:t={},params:n,set:r,defaults:i}){var l,o,s,a,u,d,p;let{preset:c,options:f}=t,g,v,y,b,S,_,B;if(h(c)&&f.transform!=="strict"){let{primitive:I,semantic:M,extend:H}=c,F=M||{},{colorScheme:U}=F,K=k(F,["colorScheme"]),q=H||{},{colorScheme:z}=q,R=k(q,["colorScheme"]),V=U||{},{dark:X}=V,Z=k(V,["dark"]),G=z||{},{dark:Y}=G,J=k(G,["dark"]),Q=h(I)?this._toVariables({primitive:I},f):{},ee=h(K)?this._toVariables({semantic:K},f):{},te=h(Z)?this._toVariables({light:Z},f):{},he=h(X)?this._toVariables({dark:X},f):{},me=h(R)?this._toVariables({semantic:R},f):{},ge=h(J)?this._toVariables({light:J},f):{},ye=h(Y)?this._toVariables({dark:Y},f):{},[Xe,Ze]=[(l=Q.declarations)!=null?l:"",Q.tokens],[Ge,Ye]=[(o=ee.declarations)!=null?o:"",ee.tokens||[]],[Je,Qe]=[(s=te.declarations)!=null?s:"",te.tokens||[]],[et,tt]=[(a=he.declarations)!=null?a:"",he.tokens||[]],[nt,rt]=[(u=me.declarations)!=null?u:"",me.tokens||[]],[it,ot]=[(d=ge.declarations)!=null?d:"",ge.tokens||[]],[lt,st]=[(p=ye.declarations)!=null?p:"",ye.tokens||[]];g=this.transformCSS(e,Xe,"light","variable",f,r,i),v=Ze;let at=this.transformCSS(e,`${Ge}${Je}`,"light","variable",f,r,i),ut=this.transformCSS(e,`${et}`,"dark","variable",f,r,i);y=`${at}${ut}`,b=[...new Set([...Ye,...Qe,...tt])];let dt=this.transformCSS(e,`${nt}${it}color-scheme:light`,"light","variable",f,r,i),ct=this.transformCSS(e,`${lt}color-scheme:dark`,"dark","variable",f,r,i);S=`${dt}${ct}`,_=[...new Set([...rt,...ot,...st])],B=$(c.css,{dt:D})}return{primitive:{css:g,tokens:v},semantic:{css:y,tokens:b},global:{css:S,tokens:_},style:B}},getPreset({name:e="",preset:t={},options:n,params:r,set:i,defaults:l,selector:o}){var s,a,u;let d,p,c;if(h(t)&&n.transform!=="strict"){let f=e.replace("-directive",""),g=t,{colorScheme:v,extend:y,css:b}=g,S=k(g,["colorScheme","extend","css"]),_=y||{},{colorScheme:B}=_,I=k(_,["colorScheme"]),M=v||{},{dark:H}=M,F=k(M,["dark"]),U=B||{},{dark:K}=U,q=k(U,["dark"]),z=h(S)?this._toVariables({[f]:m(m({},S),I)},n):{},R=h(F)?this._toVariables({[f]:m(m({},F),q)},n):{},V=h(H)?this._toVariables({[f]:m(m({},H),K)},n):{},[X,Z]=[(s=z.declarations)!=null?s:"",z.tokens||[]],[G,Y]=[(a=R.declarations)!=null?a:"",R.tokens||[]],[J,Q]=[(u=V.declarations)!=null?u:"",V.tokens||[]],ee=this.transformCSS(f,`${X}${G}`,"light","variable",n,i,l,o),te=this.transformCSS(f,J,"dark","variable",n,i,l,o);d=`${ee}${te}`,p=[...new Set([...Z,...Y,...Q])],c=$(b,{dt:D})}return{css:d,tokens:p,style:c}},getPresetC({name:e="",theme:t={},params:n,set:r,defaults:i}){var l;let{preset:o,options:s}=t,a=(l=o?.components)==null?void 0:l[e];return this.getPreset({name:e,preset:a,options:s,params:n,set:r,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:r,defaults:i}){var l,o;let s=e.replace("-directive",""),{preset:a,options:u}=t,d=((l=a?.components)==null?void 0:l[s])||((o=a?.directives)==null?void 0:o[s]);return this.getPreset({name:s,preset:d,options:u,params:n,set:r,defaults:i})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){var n;return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:(n=e.darkModeSelector)!=null?n:t.options.darkModeSelector):[]},getLayerOrder(e,t={},n,r){let{cssLayer:i}=t;return i?`@layer ${$(i.order||i.name||"primeui",n)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:r={},set:i,defaults:l}){let o=this.getCommon({name:e,theme:t,params:n,set:i,defaults:l}),s=Object.entries(r).reduce((a,[u,d])=>a.push(`${u}="${d}"`)&&a,[]).join(" ");return Object.entries(o||{}).reduce((a,[u,d])=>{if(C(d)&&Object.hasOwn(d,"css")){let p=ae(d.css),c=`${u}-variables`;a.push(`<style type="text/css" data-primevue-style-id="${c}" ${s}>${p}</style>`)}return a},[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:r={},set:i,defaults:l}){var o;let s={name:e,theme:t,params:n,set:i,defaults:l},a=(o=e.includes("-directive")?this.getPresetD(s):this.getPresetC(s))==null?void 0:o.css,u=Object.entries(r).reduce((d,[p,c])=>d.push(`${p}="${c}"`)&&d,[]).join(" ");return a?`<style type="text/css" data-primevue-style-id="${e}-variables" ${u}>${ae(a)}</style>`:""},createTokens(e={},t,n="",r="",i={}){let l=function(s,a={},u=[]){if(u.includes(this.path))return console.warn(`Circular reference detected at ${this.path}`),{colorScheme:s,path:this.path,paths:a,value:void 0};u.push(this.path),a.name=this.path,a.binding||(a.binding={});let d=this.value;if(typeof this.value=="string"&&A.test(this.value)){let p=this.value.trim().replace(A,c=>{var f;let g=c.slice(1,-1),v=this.tokens[g];if(!v)return console.warn(`Token not found for path: ${g}`),"__UNRESOLVED__";let y=v.computed(s,a,u);return Array.isArray(y)&&y.length===2?`light-dark(${y[0].value},${y[1].value})`:(f=y?.value)!=null?f:"__UNRESOLVED__"});d=Me.test(p.replace(He,"0"))?`calc(${p})`:p}return W(a.binding)&&delete a.binding,u.pop(),{colorScheme:s,path:this.path,paths:a,value:d.includes("__UNRESOLVED__")?void 0:d}},o=(s,a,u)=>{Object.entries(s).forEach(([d,p])=>{let c=w(d,t.variable.excludedKeyRegex)?a:a?`${a}.${Re(d)}`:Re(d),f=u?`${u}.${d}`:d;C(p)?o(p,c,f):(i[c]||(i[c]={paths:[],computed:(g,v={},y=[])=>{if(i[c].paths.length===1)return i[c].paths[0].computed(i[c].paths[0].scheme,v.binding,y);if(g&&g!=="none")for(let b=0;b<i[c].paths.length;b++){let S=i[c].paths[b];if(S.scheme===g)return S.computed(g,v.binding,y)}return i[c].paths.map(b=>b.computed(b.scheme,v[b.scheme],y))}}),i[c].paths.push({path:f,value:p,scheme:f.includes("colorScheme.light")?"light":f.includes("colorScheme.dark")?"dark":"none",computed:l,tokens:i}))})};return o(e,n,r),i},getTokenValue(e,t,n){var r;let i=(s=>s.split(".").filter(a=>!w(a.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(t),l=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,o=[(r=e[i])==null?void 0:r.computed(l)].flat().filter(s=>s);return o.length===1?o[0].value:o.reduce((s={},a)=>{let u=a,{colorScheme:d}=u,p=k(u,["colorScheme"]);return s[d]=p,s},void 0)},getSelectorRule(e,t,n,r){return n==="class"||n==="attr"?L(h(t)?`${e}${t},${e} ${t}`:e,r):L(e,L(t??":root,:host",r))},transformCSS(e,t,n,r,i={},l,o,s){if(h(t)){let{cssLayer:a}=i;if(r!=="style"){let u=this.getColorSchemeOption(i,o);t=n==="dark"?u.reduce((d,{type:p,selector:c})=>(h(c)&&(d+=c.includes("[CSS]")?c.replace("[CSS]",t):this.getSelectorRule(c,s,p,t)),d),""):L(s??":root,:host",t)}if(a){let u={name:"primeui",order:"primeui"};C(a)&&(u.name=$(a.name,{name:e,type:r})),h(u.name)&&(t=L(`@layer ${u.name}`,t),l?.layerNames(u.name))}return t}return""}},x={defaults:{variable:{prefix:"p",selector:":root,:host",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:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){let{theme:t}=e;t&&(this._theme=j(m({},t),{options:m(m({},this.defaults.options),t.options)}),this._tokens=E.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return((e=this.theme)==null?void 0:e.preset)||{}},get options(){var e;return((e=this.theme)==null?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),P.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=j(m({},this.theme),{preset:e}),this._tokens=E.createTokens(e,this.defaults),this.clearLoadedStyleNames(),P.emit("preset:change",e),P.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=j(m({},this.theme),{options:e}),this.clearLoadedStyleNames(),P.emit("options:change",e),P.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return E.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return E.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){let n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return E.getPresetC(n)},getDirective(e="",t){let n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return E.getPresetD(n)},getCustomPreset(e="",t,n,r){let i={name:e,preset:t,options:this.options,selector:n,params:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return E.getPreset(i)},getLayerOrderCSS(e=""){return E.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",r){return E.transformCSS(e,t,r,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return E.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return E.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),P.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&P.emit("theme:load"))}};function Mn(...e){let t=N(x.getPreset(),...e);return x.setPreset(t),t}function Hn(e){return pe().primaryPalette(e).update().preset}function Un(e){return pe().surfacePalette(e).update().preset}function qn(...e){let t=N(...e);return x.setPreset(t),t}function zn(e){return pe(e).update({mergePresets:!1})}var Dt=class{constructor({attrs:e}={}){this._styles=new Map,this._attrs=e||{}}get(e){return this._styles.get(e)}has(e){return this._styles.has(e)}delete(e){this._styles.delete(e)}clear(){this._styles.clear()}add(e,t){if(h(t)){let n={name:e,css:t,attrs:this._attrs,markup:Le(t,this._attrs)};this._styles.set(e,j(m({},n),{element:this.createStyleElement(n)}))}}update(){}getStyles(){return this._styles}getAllCSS(){return[...this._styles.values()].map(e=>e.css).filter(String)}getAllMarkup(){return[...this._styles.values()].map(e=>e.markup).filter(String)}getAllElements(){return[...this._styles.values()].map(e=>e.element)}createStyleElement(e={}){}},Zn=Dt;export{vt as a,Oe as b,Xt as c,ke as d,Zt as e,ue as f,Ae as g,Ne as h,St as i,wt as j,Gt as k,Yt as l,Jt as m,Qt as n,Et as o,en as p,Te as q,tn as r,nn as s,$t as t,rn as u,on as v,ln as w,_e as x,sn as y,an as z,un as A,dn as B,cn as C,Ot as D,fn as E,pn as F,hn as G,mn as H,gn as I,yn as J,vn as K,bn as L,Sn as M,wn as N,xn as O,Cn as P,W as Q,gt as R,xe as S,h as T,Se as U,yt as V,Bt as W,It as X,$ as Y,O as Z,we as _,le as $,Ee as aa,Mt as ba,Ht as ca,ae as da,Ut as ea,Kt as fa,On as ga,P as ha,A as ia,Me as ja,He as ka,Re as la,Pn as ma,jt as na,jn as oa,Tt as pa,ce as qa,Ue as ra,Lt as sa,Ke as ta,Tn as ua,_t as va,L as wa,qe as xa,ze as ya,Rt as za,Vt as Aa,Fn as Ba,Wn as Ca,D as Da,fe as Ea,Dn as Fa,pe as Ga,Wt as Ha,E as Ia,x as Ja,Mn as Ka,Hn as La,Un as Ma,qn as Na,zn as Oa,Zn as Pa};