@adia-ai/web-modules 0.7.11 → 0.7.13

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.7.13] — 2026-06-06
4
+
5
+ ### Fixed
6
+ - **`./css/sheet` subpath export now resolves TS types.** Same fix as `@adia-ai/web-components` — added `web-modules.sheet.d.ts` + the `types` condition + the `.d.ts` to `files[]`.
7
+
8
+ ### Added
9
+ - **`<embed-shell>` `/with-css` companion** (ADR-0030) — `import '@adia-ai/web-modules/shell/embed-shell/with-css'` registers the element + mounts its CSS in one line; completes the 5-shell `/with-css` family (was the lone shell missing it). (check:with-css-pairing.)
10
+
11
+ ### Docs
12
+ - README CDN snippets refreshed: `@0.6` → `@0.7`.
13
+
14
+ ## [0.7.12] — 2026-06-04
15
+
16
+ ### Changed
17
+ - **`data-theme` → `theme` rename reaches the shell demos + CSS** — the repo-wide, pre-1.0 token-attribute rename (see `@adia-ai/web-components`'s `[Unreleased]`). Any `data-theme="…"` in a shell surface (billing/, chat/, dashboard/, editor/, feedback/, runtime/, settings/, simple/) is now `theme="…"`.
18
+ - **`web-modules.sheet.js` constructable twin** co-emitted beside `dist/web-modules.min.css` (exposed as the `./css/sheet` export), in lockstep with the web-components `.sheet.js` twin work. CDN bundle rebuilt.
19
+
3
20
  ## [0.7.11] — 2026-06-04
4
21
 
5
22
  ### Changed
@@ -961,7 +978,7 @@ import '@adia-ai/web-modules/theme/theme-panel.css';
961
978
  "./theme/*.css": "./theme/*/*.css"
962
979
  ```
963
980
 
964
- The pattern key `./<cluster>/*.css` captures the element name; the value's two `*` are both substituted with the captured name, resolving `<cluster>/<elem>.css` requests to `<cluster>/<elem>/<elem>.css` on disk. Existing JS subpath exports (`./<cluster>/*` → `./<cluster>/*/*.js`) are preserved unchanged — both can coexist because `.css` requests don't collide with bare-name `.js` requests. Driven by [consumer feedback](/Users/kimba/Projects/adia/color-app/docs/outbound/FEEDBACK-adia-packages.md) from Design Tokens Studio (claim #6, the only fully-correct item in their 8-claim audit).
981
+ The pattern key `./<cluster>/*.css` captures the element name; the value's two `*` are both substituted with the captured name, resolving `<cluster>/<elem>.css` requests to `<cluster>/<elem>/<elem>.css` on disk. Existing JS subpath exports (`./<cluster>/*` → `./<cluster>/*/*.js`) are preserved unchanged — both can coexist because `.css` requests don't collide with bare-name `.js` requests. Driven by consumer feedback from Design Tokens Studio (claim #6, the only fully-correct item in their 8-claim audit).
965
982
 
966
983
  ### Documentation
967
984
 
@@ -972,7 +989,7 @@ The pattern key `./<cluster>/*.css` captures the element name; the value's two `
972
989
 
973
990
  Lockstep PATCH cut alongside `@adia-ai/web-components@0.4.4` (14 yaml gap closures from corpus simplification arc), `@adia-ai/a2ui-runtime@0.4.4` (registry expansion +27 web-modules + renderer kebab-case fix), `@adia-ai/a2ui-compose@0.4.4` (composition-library rename + transpiler `<a>` → Link), `@adia-ai/a2ui-corpus@0.4.4` (corpus simplification arc §36–§51), `@adia-ai/a2ui-mcp@0.4.4` (`get_fragment` tool retirement). Source byte-identical to v0.4.3.
974
991
 
975
- Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4.0` covers `0.4.x` under semver). See root [CHANGELOG.md `## [0.4.4]`](../../../CHANGELOG.md) for the cut narrative.
992
+ Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4.0` covers `0.4.x` under semver). See root [CHANGELOG.md `## [0.4.4]`](../../CHANGELOG.md) for the cut narrative.
976
993
  ## [0.4.3] - 2026-05-11
977
994
 
978
995
  ### Documentation
@@ -986,7 +1003,7 @@ Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4
986
1003
 
987
1004
  ### Added
988
1005
 
989
- - **`<theme-panel>` module — new `theme/` cluster.** Module-tier appearance-preferences control surface. Owns the three knobs of the AdiaUI theming contract: `[data-theme]` named themes (8 built-in slugs + tolerant for custom), `--a-density` / `--a-radius-k` parametric overrides, and `color-scheme` light/dark switching, plus optional `localStorage` persistence behind a small attribute API ([`packages/web-modules/theme/theme-panel/`](./theme/theme-panel/)). Reflected state — `[active-theme]`, `[active-scheme]`, `[active-density]`, `[active-radius]` — lets external CSS / JS react via `:has(theme-panel[active-scheme="dark"])` patterns without listening to events. One `theme-change` event per user-visible change (source ∈ `theme | slider | preset | scheme | reset | programmatic`). Attribute API: `[themes="slug1 slug2…"]` (override default 8), `[parametric]` (renders density + radius sliders), `[presets]` (renders compact / reset / spacious preset row), `[scheme-toggle]` (renders inline light/dark toggle — absorbs the legacy standalone `#theme-toggle` button per OD-002=A). 23 unit tests. Promoted from the ~30-line inline `#theme-panel` block + ~90 LOC of controller wiring previously duplicated in `site/index.html` and `playgrounds/admin-shell/`. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). Plan: [`docs/plans/theme-panel-module-2026-05-11.md`](../../docs/plans/theme-panel-module-2026-05-11.md). Commits `63d9deb4` (module Phase 1) + `a35d3131` (site consumer migration Phase 2; site.js −90 LOC + index.html −27 inline lines) + `c844aef4` (admin-shell playground consumer migration Phase 3; contents.html −25 lines + contents.js −48 LOC).
1006
+ - **`<theme-panel>` module — new `theme/` cluster.** Module-tier appearance-preferences control surface. Owns the three knobs of the AdiaUI theming contract: `[theme]` named themes (8 built-in slugs + tolerant for custom), `--a-density` / `--a-radius-k` parametric overrides, and `color-scheme` light/dark switching, plus optional `localStorage` persistence behind a small attribute API ([`packages/web-modules/theme/theme-panel/`](./theme/theme-panel/)). Reflected state — `[active-theme]`, `[active-scheme]`, `[active-density]`, `[active-radius]` — lets external CSS / JS react via `:has(theme-panel[active-scheme="dark"])` patterns without listening to events. One `theme-change` event per user-visible change (source ∈ `theme | slider | preset | scheme | reset | programmatic`). Attribute API: `[themes="slug1 slug2…"]` (override default 8), `[parametric]` (renders density + radius sliders), `[presets]` (renders compact / reset / spacious preset row), `[scheme-toggle]` (renders inline light/dark toggle — absorbs the legacy standalone `#theme-toggle` button per OD-002=A). 23 unit tests. Promoted from the ~30-line inline `#theme-panel` block + ~90 LOC of controller wiring previously duplicated in `site/index.html` and `playgrounds/admin-shell/`. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). Plan: [`docs/plans/theme-panel-module-2026-05-11.md`](../../docs/plans/theme-panel-module-2026-05-11.md). Commits `63d9deb4` (module Phase 1) + `a35d3131` (site consumer migration Phase 2; site.js −90 LOC + index.html −27 inline lines) + `c844aef4` (admin-shell playground consumer migration Phase 3; contents.html −25 lines + contents.js −48 LOC).
990
1007
  - **New subpath export `@adia-ai/web-modules/theme`** — consumers wanting just this cluster can `import '@adia-ai/web-modules/theme'` instead of the full barrel. `package.json` `exports` / `files` / `sideEffects` updated.
991
1008
 
992
1009
  ### Fixed
@@ -1123,7 +1140,7 @@ Legacy authoring shapes (`<section data-chat-messages>`, `<chat-input-ui data-ch
1123
1140
  Legacy authoring shapes (`<aside data-sidebar="leading">`, `<dialog data-command>`, `<div data-resize>`, `[data-sidebar-toggle]`, `<aside-ui slot="leading">`) all still work identically. Mixed markup (some bespoke, some legacy) renders the same. Migration is opt-in.
1124
1141
  ## [0.3.3] - 2026-05-07
1125
1142
 
1126
- **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
1143
+ **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
1127
1144
 
1128
1145
  ### Changed
1129
1146
 
@@ -1136,7 +1153,7 @@ Legacy authoring shapes (`<aside data-sidebar="leading">`, `<dialog data-command
1136
1153
  ## [0.3.2] - 2026-05-06
1137
1154
 
1138
1155
  **9-package lockstep patch cut to v0.3.2.** All lockstep members share
1139
- one version per [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
1156
+ one version per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
1140
1157
  Internal `@adia-ai/*` dep ranges unchanged at `^0.3.0`.
1141
1158
 
1142
1159
  ### No source changes
@@ -1220,7 +1237,7 @@ _Nothing yet._
1220
1237
 
1221
1238
  **Lockstep cut.** All 8 published `@adia-ai/*` packages bump
1222
1239
  0.2.2 → 0.2.3 per
1223
- [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
1240
+ [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
1224
1241
  Patch cut — no breaking changes.
1225
1242
 
1226
1243
  ### Changed
package/README.md CHANGED
@@ -19,11 +19,11 @@ Since **v0.6.30**, both this package and `@adia-ai/web-components` ship pre-flat
19
19
 
20
20
  ```html
21
21
  <!-- CSS: all primitives + the shell tier you use -->
22
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.6/dist/web-components.min.css">
23
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/shell/admin-shell.min.css">
22
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.css">
23
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.css">
24
24
 
25
25
  <!-- JS: everything in one bundle (primitives + all 4 shells + a2ui-runtime; ~190 KB gzipped) -->
26
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/everything.min.js"></script>
26
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/everything.min.js"></script>
27
27
 
28
28
  <admin-shell mode="rounded borderless">
29
29
  <admin-sidebar slot="leading" resizable collapsible>
@@ -81,8 +81,8 @@ Since **v0.6.30**, both this package and `@adia-ai/web-components` ship pre-flat
81
81
  **Per-shell setup (advanced — only one shell tier loaded):**
82
82
 
83
83
  ```html
84
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.6/dist/web-components.min.js"></script>
85
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/shell/admin-shell.min.js"></script>
84
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.js"></script>
85
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.js"></script>
86
86
  ```
87
87
 
88
88
  | Bundle | Path | Gzipped | Contents | When to use |
@@ -96,13 +96,13 @@ Since **v0.6.30**, both this package and `@adia-ai/web-components` ship pre-flat
96
96
  **Each shell needs its matching CSS** (the kitchen-sink example above loads only `admin-shell.min.css`). Mirror the JS path — swap the shell tier:
97
97
 
98
98
  ```html
99
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/shell/admin-shell.min.css">
100
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/chat/chat-shell.min.css">
101
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/editor/editor-shell.min.css">
102
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.6/dist/simple/simple-shell.min.css">
99
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.css">
100
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/chat/chat-shell.min.css">
101
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/editor/editor-shell.min.css">
102
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/simple/simple-shell.min.css">
103
103
  ```
104
104
 
105
- The `@0.6` range tracks the latest `0.6.x` patch (won't jump to a breaking `0.7`); pin an exact version (e.g. `@0.6.45`) for reproducible builds.
105
+ The `@0.7` range tracks the latest `0.6.x` patch (won't jump to a breaking `0.8`); pin an exact version (e.g. `@0.7.13`) for reproducible builds.
106
106
 
107
107
  **Pick ONE bundle path.** Mixing `everything.min.js` with a separate `web-components.min.js` causes `customElements.define` to throw "name already defined". For CodePen the kitchen-sink path is correct.
108
108
 
@@ -207,7 +207,7 @@ elements with state-as-attribute semantics) per [ADR-0023](../../.brain/adrs/002
207
207
  | `chat` | `<chat-shell>` | `<chat-thread>`, `<chat-composer>`, `<chat-sidebar>` (JS-bearing); `<chat-empty>`, `<chat-header>`, `<chat-status>` (CSS-only); 6 children total | Conversational surface — streaming messages, composer with `[disabled]` propagation, scroll-to-bottom thread, `[streaming]` reflected. |
208
208
  | `editor` | `<editor-shell>` | `<editor-toolbar>`, `<editor-canvas>`, `<editor-sidebar>` (JS-bearing); `<editor-statusbar>`, `<editor-canvas-empty>` (CSS-only); 5 children total | Design-tool surface — toolbar with `[full-screen]`, central canvas with `[focused]`/`[empty]`, sidebar wraps `<pane-ui resizable>` for delegation. |
209
209
  | `runtime` | `<gen-root>`, `<a2ui-root>` | — | Render roots that turn JSON or gen-UI intents into live DOM. |
210
- | `theme` | — (controls-only) | `<theme-panel>` (JS-bearing); 1 child total | Appearance-preferences control surface — `[data-theme]` named themes, `--a-density` / `--a-radius-k` parametric overrides, `color-scheme` light/dark, opt-in `[persist]`. Drops into any consumer's `<popover-ui slot="content">` topbar. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). |
210
+ | `theme` | — (controls-only) | `<theme-panel>` (JS-bearing); 1 child total | Appearance-preferences control surface — `[theme]` named themes, `--a-density` / `--a-radius-k` parametric overrides, `color-scheme` light/dark, opt-in `[persist]`. Drops into any consumer's `<popover-ui slot="content">` topbar. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). |
211
211
 
212
212
  ### Cross-package convenience subpaths
213
213
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<chat-composer-ui>` — Module-tier chat composer wrapper — replaces legacy <chat-input-ui
2
+ * `<chat-composer>` — Module-tier chat composer wrapper — replaces legacy <chat-input-ui
3
3
  data-chat-input> direct child of <chat-shell> per ADR-0023.
4
4
  Forwards submit events as 'composer-submit', propagates [disabled]
5
5
  to the inner input, provides slot vocabulary for future composer
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<chat-shell-ui>` — Behavior-only chat orchestrator (LLM-streaming module). Canonical
2
+ * `<chat-shell>` — Behavior-only chat orchestrator (LLM-streaming module). Canonical
3
3
  authoring shape uses cluster-namespaced bespoke children —
4
4
  <chat-thread> as the message scroll surface (containing <chat-empty>
5
5
  as the empty-state slot), <chat-composer> wrapping the input
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<chat-sidebar-ui>` — Module-tier chat-cluster sidebar — owns resize, snap-to-collapsed,
2
+ * `<chat-sidebar>` — Module-tier chat-cluster sidebar — owns resize, snap-to-collapsed,
3
3
  persistence, and the [collapsed] reflected attribute. Sits inside
4
4
  <chat-shell> as slot="leading" (conversation history rail) or
5
5
  slot="trailing" (artifacts/citations panel). Mirrors the admin-sidebar
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<chat-thread-ui>` — Module-tier chat message thread container — replaces legacy
2
+ * `<chat-thread>` — Module-tier chat message thread container — replaces legacy
3
3
  <section data-chat-messages> per ADR-0023. Owns scroll-to-bottom
4
4
  on new message (with user-scroll-up suspension), [streaming] and
5
5
  [empty] reflected attributes, and a stable target for the host's
@@ -378,7 +378,7 @@ Correct shape for <chart-ui x="label" y="value">:
378
378
  `,e.addEventListener("click",()=>this.#c(t)),this.#n.appendChild(e)}this.#a&&(this.#a.disabled=this.#i||this.#e.size===0)}}#c(t){this.#i||(this.multi?(this.#e.has(t.id)?this.#e.delete(t.id):this.#e.add(t.id),this.#l()):(this.#e.clear(),this.#e.add(t.id),this.#i=!0,this.#l(),this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:[t.id],option:t}}))))}#h=()=>{if(this.#i||this.#e.size===0)return;this.#i=!0,this.#l();let t=[...this.#e],e=this.#t.find(i=>i.id===t[0])||null;this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:t,option:e}}))}};S("agent-questions-ui",ga);C();var J1={neutral:"default",accent:"accent",warning:"warning",danger:"danger"},ba=class extends v{static properties={title:{type:String,default:"",reflect:!0},kind:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},tone:{type:String,default:"neutral",reflect:!0}};static requiredIcons=["caret-right","caret-down"];static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;connected(){this.#l()}disconnected(){this.#t?.removeEventListener("click",this.#a),this.#t?.removeEventListener("keydown",this.#o),this.#t=this.#e=this.#i=null,this.#s=this.#r=this.#n=null}#a=t=>{t.target.closest('[slot="primary"], [slot="secondary"]')||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("artifact-toggle",{bubbles:!0,detail:{collapsed:this.collapsed}})),this.render())};#o=t=>{if(t.key===" "||t.key==="Enter"){if(t.target.closest('[slot="primary"], [slot="secondary"]'))return;t.preventDefault(),this.#a(t)}};render(){this.#t&&(this.#e&&(this.icon?(this.#e.setAttribute("name",this.icon),this.#e.hidden=!1):this.#e.hidden=!0),this.#i&&(this.#i.textContent=this.title||"",this.#i.hidden=!this.title),this.#s&&(this.#s.setAttribute("text",(this.kind||"").toUpperCase()),this.#s.setAttribute("variant",J1[this.tone]||"default"),this.#s.hidden=!this.kind),this.#r&&this.#r.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#n&&(this.#n.hidden=this.collapsed),this.#t&&this.#t.setAttribute("aria-expanded",String(!this.collapsed)))}#l(){let t=[],e=[],i=[],r=a=>a.getAttribute("role")==="presentation"||a.style?.display==="contents",n=a=>{for(let l of a){if(l.nodeType===1){let h=l;if(r(h)){n(h.childNodes);continue}let c=h.getAttribute("slot")||"";if(c==="primary"){t.push(h);continue}if(c==="secondary"){e.push(h);continue}}i.push(l)}};n(Array.from(this.childNodes)),this.innerHTML="",this.#t=document.createElement("div"),this.#t.setAttribute("data-artifact-header",""),this.#t.setAttribute("role","button"),this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-expanded",String(!this.collapsed)),this.#t.addEventListener("click",this.#a),this.#t.addEventListener("keydown",this.#o),this.#e=document.createElement("icon-ui"),this.#e.setAttribute("data-artifact-icon",""),this.#e.setAttribute("color","muted"),this.icon?this.#e.setAttribute("name",this.icon):this.#e.hidden=!0,this.#i=document.createElement("span"),this.#i.setAttribute("data-artifact-title",""),this.title?this.#i.textContent=this.title:this.#i.hidden=!0,this.#s=document.createElement("badge-ui"),this.#s.setAttribute("data-artifact-kind",""),this.#s.setAttribute("size","sm"),this.#s.setAttribute("variant",J1[this.tone]||"default"),this.kind?this.#s.setAttribute("text",this.kind.toUpperCase()):this.#s.hidden=!0;let o=document.createElement("span");o.setAttribute("data-artifact-actions","");for(let a of e)o.appendChild(a);for(let a of t)o.appendChild(a);this.#r=document.createElement("icon-ui"),this.#r.setAttribute("color","muted"),this.#r.setAttribute("data-artifact-caret",""),this.#r.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#t.append(this.#e,this.#i,this.#s,o,this.#r),this.#n=document.createElement("div"),this.#n.setAttribute("data-artifact-body","");for(let a of i)this.#n.appendChild(a);this.collapsed&&(this.#n.hidden=!0),this.append(this.#t,this.#n)}};S("agent-artifact-ui",ba);C();var FD="rounded borderless",Wl=class s extends v{static properties={mode:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("mode")||(this.mode=FD),this.addEventListener("click",this.#e),this.#i()}#t(t){return this.querySelector(`admin-sidebar[slot="${t}"], admin-sidebar[name="${t}"]`)}#e=t=>{let e=t.target.closest("[data-sidebar-toggle]");if(e&&this.contains(e)){let r=e.getAttribute("data-sidebar-toggle"),n=this.#t(r);n&&typeof n.toggle!="function"&&this.#r("admin-sidebar",`slot="${r}"`,"Sidebar toggle"),n?.toggle?.();return}let i=t.target.closest("[data-command-trigger]");if(i&&this.contains(i)){t.stopPropagation();let r=this.querySelector("admin-command");if(!r)return;if(typeof r.show!="function"){this.#r("admin-command","","Command palette");return}r.show()}};#i(){let t=this.querySelector("admin-command"),e=this.querySelector("nav-ui");!t||!e||t.addEventListener("command-select",i=>{let r=e.querySelector(`nav-item-ui[value="${i.detail.value}"]`);r&&e.select(r)})}static#s=new WeakSet;#r(t,e,i){let r=e?this.querySelector(`${t}[${e}], ${t}[${e.replace("slot=","name=")}]`):this.querySelector(t);if(!r||s.#s.has(r))return;s.#s.add(r);let n=t==="admin-sidebar"?"shell/admin-sidebar":"shell/admin-command";console.warn(`[admin-shell] <${t}${e?" "+e:""}> is in the DOM but ${t==="admin-sidebar"?"AdminSidebar":"AdminCommand"} is NOT registered \u2014 ${i} will not work. Import the cluster barrel \`@adia-ai/web-modules/shell\` (which registers all shell elements), OR add \`@adia-ai/web-modules/${n}\` alongside \`@adia-ai/web-modules/shell/admin-shell\` on the per-component path. Closes FB-55 silent-failure trap.`)}};customElements.define("admin-shell",Wl);C();var Ul=96,tE=160,Fl=class s extends v{static properties={collapsed:{type:Boolean,default:!1,reflect:!0},resizing:{type:Boolean,default:!1,reflect:!0},resizable:{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!1,reflect:!0},name:{type:String,default:"",reflect:!0},minWidth:{type:String,default:"",reflect:!0,attribute:"min-width"}};static template=()=>null;static#t=new WeakSet;#e="";#i=[];#s=null;connected(){this.#a(),this.resizable&&this.#l(),this.#c(),this.#o()}disconnected(){for(let t of this.#i)t();this.#i=[],this.#s?.disconnect(),this.#s=null}toggle(){return this.collapsed?this.expand():this.collapse(),this.collapsed}collapse(){if(this.collapsed)return;let t=this.style.width||getComputedStyle(this).width;parseFloat(t)>Ul&&(this.#e=t);let e=this.minWidth||getComputedStyle(this).minWidth;this.style.width=e,this.#n(e),this.collapsed=!0,this.#h(!1)}expand(){if(!this.collapsed)return;let t=this.#e||"";this.style.width=t,this.#n(t),this.collapsed=!1,this.#h(!0)}#r(){return`adia-sidebar-${this.name||this.getAttribute("slot")||"default"}`}#n(t){try{localStorage.setItem(this.#r(),t)}catch{}}#a(){try{let t=localStorage.getItem(this.#r());if(!t)return;this.style.width=t;let e=parseFloat(t);!isNaN(e)&&e>Ul&&(this.#e=t)}catch{}}#o(){let t=this.getBoundingClientRect().width;this.collapsed=t<=Ul}#l(){let t=this.querySelector(":scope > [data-resize]");if(!t){s.#t.has(this)||(s.#t.add(this),console.warn("[admin-sidebar] `resizable` is set but no `[data-resize]` child was found. Add `<div data-resize></div>` as a direct child to enable drag-to-resize. (Unlike `collapsible`, `resizable` requires this author-supplied handle.)",this));return}let e=this.getAttribute("slot"),i=e==="leading",r=n=>{n.preventDefault(),t.setPointerCapture(n.pointerId);let o=n.clientX,a=this.getBoundingClientRect().width;this.resizing=!0,document.documentElement.style.cursor="col-resize";let l=c=>{let u=c.clientX-o,d=parseInt(getComputedStyle(this).getPropertyValue("max-width"))||480,f=Math.max(48,Math.min(d,a+(i?u:-u)));this.style.width=`${f}px`},h=()=>{this.resizing=!1,document.documentElement.style.cursor="",t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",h);let c=this.getBoundingClientRect().width;c<=Ul?this.style.width=this.minWidth||getComputedStyle(this).minWidth:c<tE&&(this.style.width=`${tE}px`),this.#n(this.style.width),this.#o(),this.dispatchEvent(new CustomEvent("sidebar-resize",{bubbles:!0,detail:{name:this.name||e,width:this.getBoundingClientRect().width}}))};t.addEventListener("pointermove",l),t.addEventListener("pointerup",h)};t.addEventListener("pointerdown",r),this.#i.push(()=>t.removeEventListener("pointerdown",r))}#c(){this.#s=new ResizeObserver(t=>{for(let e of t){let i=e.contentBoxSize[0].inlineSize<=Ul;for(let r of this.querySelectorAll("select-ui"))r.setAttribute("placement",i?"right":"bottom-start")}}),this.#s.observe(this)}#h(t){this.dispatchEvent(new CustomEvent("sidebar-toggle",{bubbles:!0,detail:{name:this.name||this.getAttribute("slot")||"default",expanded:t}}))}};customElements.define("admin-sidebar",Fl);C();var Yl=class extends v{static properties={open:{type:Boolean,default:!1,reflect:!0},shortcut:{type:String,default:"both",reflect:!0},noShortcut:{type:Boolean,default:!1,reflect:!0,attribute:"no-shortcut"}};static template=()=>null;#t=null;#e=null;#i=null;connected(){if(this.#i=this.querySelector(":scope > dialog"),!this.#i){for(this.#i=document.createElement("dialog");this.firstChild;)this.#i.appendChild(this.firstChild);this.appendChild(this.#i)}this.#e=this.querySelector("command-ui"),this.#s(),this.#r(),this.noShortcut||this.#n()}disconnected(){this.#t&&(document.removeEventListener("keydown",this.#t),this.#t=null)}show(){this.#i&&(this.#i.open||(this.#i.showModal(),this.#e&&(this.#e.open=!0,this.#e.value="",this.#e.focus()),this.open=!0))}hide(){this.#i&&this.#i.open&&(this.#i.close(),this.#e&&(this.#e.open=!1),this.open=!1)}toggle(){return this.open?this.hide():this.show(),this.open}#s(){this.#i&&(this.#i.addEventListener("click",t=>{t.target===this.#i&&this.hide()}),this.#i.addEventListener("close",()=>{this.#e&&(this.#e.open=!1),this.open=!1}))}#r(){this.#e&&(this.#e.addEventListener("dismiss",()=>this.hide()),this.#e.addEventListener("select",t=>{this.dispatchEvent(new CustomEvent("command-select",{bubbles:!0,detail:t.detail})),this.hide()}))}#n(){let t=e=>{let i=e.metaKey,r=e.ctrlKey;return e.key!=="k"?!1:this.shortcut==="cmd+k"?i:this.shortcut==="ctrl+k"?r:i||r};this.#t=e=>{t(e)&&(e.preventDefault(),this.toggle())},document.addEventListener("keydown",this.#t)}};customElements.define("admin-command",Yl);C();var Hl=class extends v{static template=()=>null;connected(){this.addEventListener("click",this.#t),this.addEventListener("embed:open",this.#e),this.addEventListener("keydown",this.#i)}#t=t=>{let e=t.target.closest?.("[opens]");if(e&&this.contains(e)){this.toggle(e.getAttribute("opens"));return}let i=t.target.closest?.("[close]");i&&this.contains(i)&&this.close()};#e=t=>this.toggle(t.detail?.panel);#i=t=>{t.key==="Escape"&&this.panel&&(t.stopPropagation(),this.close())};get panel(){return this.getAttribute("panel")||""}toggle(t){return this.panel===t?this.close():this.open(t)}open(t){if(!t)return;let e=this.querySelector(`:scope > [panel="${CSS.escape(t)}"]`);if(e){for(let i of this.querySelectorAll(":scope > [panel][active]"))i!==e&&i.removeAttribute("active");e.setAttribute("active",""),this.setAttribute("panel",t),requestAnimationFrame(()=>e.querySelector("[autofocus], [close], button-ui, [tabindex]")?.focus?.({preventScroll:!0})),this.#s(t)}}close(){this.panel&&(this.querySelector(":scope > [panel][active]")?.removeAttribute("active"),this.removeAttribute("panel"),this.#s(""))}#s(t){this.dispatchEvent(new CustomEvent("embed:change",{detail:{panel:t},bubbles:!0}))}};customElements.define("embed-shell",Hl);uE();C();function vO(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var sq=0,Gl=class extends v{static properties={streaming:{type:Boolean,default:!1,reflect:!0},provider:{type:String,default:"",reflect:!0},model:{type:String,default:"",reflect:!0},system:{type:String,default:"",reflect:!0},proxyUrl:{type:String,default:"",attribute:"proxy-url",reflect:!0},thinking:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];#e=null;#i=null;#s=null;#r=null;#n=null;#a="";get messages(){return[...this.#t]}get conversation(){return this.#t.filter(t=>t.role==="user"||t.role==="assistant").map(t=>({role:t.role,content:t.content}))}set conversation(t){this.clear();for(let e of t)this.appendMessage({role:e.role,content:e.content,render:!0})}set apiKey(t){this.#a=t}connected(){this.#i=this.querySelector("chat-thread"),this.#s=this.querySelector("chat-composer"),this.#r=this.querySelector("chat-empty"),this.#n=this.querySelector("chat-status"),this.#s?.addEventListener("composer-submit",this.#l)}disconnected(){this.#s?.removeEventListener("composer-submit",this.#l),this.abort()}#o(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))}#l=t=>{if(this.streaming)return;let{text:e,model:i}=t.detail||{};e&&(this.#s.clear(),this.#o("submit",{text:e,model:i}),(this.proxyUrl||this.#a)&&this.send(e,i?{model:i}:{}))};appendMessage({role:t,content:e="",render:i=!1}){let r=`msg_${++sq}`;this.#t.push({id:r,role:t,content:e});let n=document.createElement("div");if(n.setAttribute("data-role",t),n.setAttribute("data-id",r),t==="user")n.innerHTML=`<div data-bubble>${vO(e)}</div>`;else if(t==="assistant"){let o=i&&e?ui(e):vO(e);n.innerHTML=`
379
379
  <span data-avatar>AI</span>
380
380
  <div data-bubble><div data-content>${o}</div>${i?"":"<span data-cursor></span>"}</div>
381
- `}else t==="error"&&(n.innerHTML=`<icon-ui name="warning"></icon-ui><span>${vO(e)}</span>`);return this.#i?.appendChild(n),this.#c(),this.#o("message",{id:r,role:t,content:e}),n}appendChunk(t){let e=this.#t[this.#t.length-1];if(!e||e.role!=="assistant")return;e.content+=t;let i=this.#i?.querySelector("[data-role]:last-child [data-content]");i&&i.insertAdjacentText("beforeend",t),this.#c()}deleteMessage(t){let e=this.#t.findIndex(i=>i.id===t);e!==-1&&(this.#t.splice(e,1),this.#i?.querySelector(`[data-id="${t}"]`)?.remove())}clear(){if(this.#t.length=0,this.#i){let t=this.#r;this.#i.innerHTML="",t&&this.#i.appendChild(t)}this.#o("clear")}startStreaming(){this.streaming=!0,this.#s&&(this.#s.disabled=!0),this.#n&&(this.#n.textContent="Typing..."),this.#i?.tagName?.toLowerCase()==="chat-thread"&&(this.#i.streaming=!0)}stopStreaming(){this.streaming=!1,this.#s&&(this.#s.disabled=!1),this.#n&&(this.#n.textContent=""),this.#i?.tagName?.toLowerCase()==="chat-thread"&&(this.#i.streaming=!1),this.#i?.querySelector("[data-role]:last-child [data-cursor]")?.remove();let t=this.#t[this.#t.length-1];if(t?.role==="assistant"&&t.content){let e=this.#i?.querySelector("[data-role]:last-child [data-content]");e&&(e.innerHTML=ui(t.content),this.#h(e))}this.#s?.focus()}abort(){this.#e&&(this.#e.abort(),this.#e=null,this.#o("abort")),this.streaming&&this.stopStreaming()}async send(t,e={}){let i=e.model||this.model||this.#s?.model;if(!i)throw new Error("No model specified");this.appendMessage({role:"user",content:t}),this.appendMessage({role:"assistant",content:""}),this.startStreaming(),this.#e=new AbortController;try{let r={provider:this.provider||void 0,apiKey:this.#a||void 0,model:i,system:this.system||void 0,proxyUrl:this.proxyUrl||void 0,thinking:this.thinking||void 0,messages:this.conversation.slice(0,-1),signal:this.#e.signal,...e};for await(let n of Od(r))n.type==="text"?(this.appendChunk(n.text),this.#o("chunk",{text:n.text,snapshot:n.snapshot})):n.type==="thinking"?this.#o("thinking",{text:n.text}):n.type==="done"?this.#o("done",{text:n.text,usage:n.usage,stopReason:n.stopReason}):n.type==="error"&&(this.appendMessage({role:"error",content:n.error.message}),this.#o("error",{error:n.error}))}catch(r){r.name!=="AbortError"&&(this.appendMessage({role:"error",content:r.message}),this.#o("error",{error:r}))}this.#e=null,this.stopStreaming()}export(){return{messages:this.#t.map(t=>({role:t.role,content:t.content})),model:this.model,system:this.system}}import(t){t.model&&(this.model=t.model),t.system&&(this.system=t.system),t.messages&&(this.conversation=t.messages)}#c(){let t=this.#i;t&&requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight})}#h(t){for(let e of t.querySelectorAll("pre")){let i=e.querySelector("code");if(!i)continue;let r=i.getAttribute("data-lang")||"",n=document.createElement("code-ui");r&&n.setAttribute("language",r),n.textContent=i.textContent,e.replaceWith(n)}}};customElements.define("chat-shell",Gl);C();var rq=40,Kl=class extends v{static properties={streaming:{type:Boolean,default:!1,reflect:!0},empty:{type:Boolean,default:!0,reflect:!0}};static template=()=>null;#t=null;#e=!0;#i=null;connected(){this.#s(),this.#r(),this.#n()}disconnected(){this.#t?.disconnect(),this.#t=null,this.#i&&(this.removeEventListener("scroll",this.#i),this.#i=null)}scrollToBottom(){this.scrollTo({top:this.scrollHeight,behavior:"smooth"})}scrollToBottomInstant(){this.scrollTop=this.scrollHeight}#s(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()!=="chat-empty");this.empty=t.length===0}#r(){this.#t=new MutationObserver(()=>{this.#s(),this.#e&&this.scrollToBottomInstant()}),this.#t.observe(this,{childList:!0})}#n(){this.#i=()=>{let t=this.scrollHeight-(this.scrollTop+this.clientHeight);this.#e=t<=rq},this.addEventListener("scroll",this.#i,{passive:!0})}};customElements.define("chat-thread",Kl);C();var Jl=class extends v{static properties={disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.#t=this.querySelector("chat-input-ui")||this.querySelector("input-ui")||this.querySelector("textarea-ui"),this.#e=t=>{this.dispatchEvent(new CustomEvent("composer-submit",{bubbles:!0,detail:t.detail||{}}))},this.#t?.addEventListener("submit",this.#e),this.#i()}disconnected(){this.#t&&this.#e&&this.#t.removeEventListener("submit",this.#e),this.#t=null,this.#e=null}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),t==="disabled"&&this.#i()}focus(){this.#t?.focus?.()}clear(){this.#t?.clear?.()}get input(){return this.#t}#i(){this.#t&&(this.disabled?this.#t.setAttribute("disabled",""):this.#t.removeAttribute("disabled"))}};customElements.define("chat-composer",Jl);C();var th=96,dE=160,eh=class extends v{static properties={collapsed:{type:Boolean,default:!1,reflect:!0},resizing:{type:Boolean,default:!1,reflect:!0},resizable:{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!1,reflect:!0},name:{type:String,default:"",reflect:!0},minWidth:{type:String,default:"",reflect:!0,attribute:"min-width"}};static template=()=>null;#t="";#e=[];#i=null;connected(){this.#n(),this.resizable&&this.#o(),this.#l(),this.#a()}disconnected(){for(let t of this.#e)t();this.#e=[],this.#i?.disconnect(),this.#i=null}toggle(){return this.collapsed?this.expand():this.collapse(),this.collapsed}collapse(){if(this.collapsed)return;let t=this.style.width||getComputedStyle(this).width;parseFloat(t)>th&&(this.#t=t);let e=this.minWidth||getComputedStyle(this).minWidth;this.style.width=e,this.#r(e),this.collapsed=!0,this.#c(!1)}expand(){if(!this.collapsed)return;let t=this.#t||"";this.style.width=t,this.#r(t),this.collapsed=!1,this.#c(!0)}#s(){return`adia-chat-sidebar-${this.name||this.getAttribute("slot")||"default"}`}#r(t){try{localStorage.setItem(this.#s(),t)}catch{}}#n(){try{let t=localStorage.getItem(this.#s());if(!t)return;this.style.width=t;let e=parseFloat(t);!isNaN(e)&&e>th&&(this.#t=t)}catch{}}#a(){let t=this.getBoundingClientRect().width;this.collapsed=t<=th}#o(){let t=this.querySelector(":scope > [data-resize]");if(!t)return;let e=this.getAttribute("slot"),i=e==="leading",r=n=>{n.preventDefault(),t.setPointerCapture(n.pointerId);let o=n.clientX,a=this.getBoundingClientRect().width;this.resizing=!0,document.documentElement.style.cursor="col-resize";let l=c=>{let u=c.clientX-o,d=parseInt(getComputedStyle(this).getPropertyValue("max-width"))||480,f=Math.max(48,Math.min(d,a+(i?u:-u)));this.style.width=`${f}px`},h=()=>{this.resizing=!1,document.documentElement.style.cursor="",t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",h);let c=this.getBoundingClientRect().width;c<=th?this.style.width=this.minWidth||getComputedStyle(this).minWidth:c<dE&&(this.style.width=`${dE}px`),this.#r(this.style.width),this.#a(),this.dispatchEvent(new CustomEvent("sidebar-resize",{bubbles:!0,detail:{name:this.name||e,width:this.getBoundingClientRect().width}}))};t.addEventListener("pointermove",l),t.addEventListener("pointerup",h)};t.addEventListener("pointerdown",r),this.#e.push(()=>t.removeEventListener("pointerdown",r))}#l(){this.#i=new ResizeObserver(t=>{for(let e of t){let i=e.contentBoxSize[0].inlineSize<=th;for(let r of this.querySelectorAll("select-ui"))r.setAttribute("placement",i?"right":"bottom-start")}}),this.#i.observe(this)}#c(t){this.dispatchEvent(new CustomEvent("sidebar-toggle",{bubbles:!0,detail:{name:this.name||this.getAttribute("slot")||"default",expanded:t}}))}};customElements.define("chat-sidebar",eh);C();var ih=class extends v{static properties={focusMode:{type:Boolean,default:!1,reflect:!0,attribute:"focus-mode"}};static template=()=>null;#t=null;#e=null;#i=null;connected(){this.#t=this.querySelector("editor-toolbar"),this.#e=this.querySelector("editor-canvas"),this.#s(),this.#i=t=>{let e=t?.detail?.name;e&&(e==="toggle-focus"||e==="full-screen")&&this.toggleFocusMode()},this.addEventListener("toolbar-action",this.#i)}disconnected(){this.#i&&this.removeEventListener("toolbar-action",this.#i),this.#i=null}toggleFocusMode(){this.focusMode=!this.focusMode,this.#t?.tagName?.toLowerCase()==="editor-toolbar"&&(this.#t.fullScreen=this.focusMode),this.#e?.tagName?.toLowerCase()==="editor-canvas"&&(this.focusMode?this.#e.focus?.():this.#e.blur?.()),this.dispatchEvent(new CustomEvent("editor-mode-change",{bubbles:!0,detail:{focusMode:this.focusMode}}))}#s(){for(let t of this.querySelectorAll("select-ui[data-options]"))try{let e=JSON.parse(t.getAttribute("data-options"));t.options=e}catch{}}};customElements.define("editor-shell",ih);C();var sh=class extends v{static properties={fullScreen:{type:Boolean,default:!1,reflect:!0,attribute:"full-screen"}};static template=()=>null;#t=null;connected(){this.#t=t=>{let e=t.target.closest("[data-toolbar-action]");if(!e||!this.contains(e))return;let i=e.getAttribute("data-toolbar-action");this.dispatchEvent(new CustomEvent("toolbar-action",{bubbles:!0,detail:{name:i}}))},this.addEventListener("click",this.#t)}disconnected(){this.#t&&this.removeEventListener("click",this.#t),this.#t=null}};customElements.define("editor-toolbar",sh);C();var rh=class extends v{static properties={empty:{type:Boolean,default:!0,reflect:!0},focused:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=1;#e=null;connected(){this.#i(),this.#s()}disconnected(){this.#e?.disconnect(),this.#e=null}get zoom(){return this.#t}set zoom(t){let e=parseFloat(t);!isFinite(e)||e<=0||(this.#t=e,this.style.setProperty("--editor-canvas-zoom",String(e)))}resetView(){this.zoom=1}focus(){super.focus?.(),this.focused=!0}blur(){super.blur?.(),this.focused=!1}#i(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()!=="editor-canvas-empty");this.empty=t.length===0}#s(){this.#e=new MutationObserver(()=>{this.#i()}),this.#e.observe(this,{childList:!0})}};customElements.define("editor-canvas",rh);C();var nh=96,nq="adia-editor-sidebar-",oh=class extends v{static properties={collapsed:{type:Boolean,default:!1,reflect:!0},resizing:{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;connected(){if(this.#t=this.querySelector("pane-ui"),!this.#t)return;let t=this.getAttribute("slot")||"leading",e=this.getAttribute("persist")||this.getAttribute("name")||t;this.#i=`${nq}${e}`,this.#h(),this.#e=new ResizeObserver(i=>{if(getComputedStyle(this).display==="none")return;this.#a();let r=this.#t.offsetWidth;r>0&&(this.style.width=`${r}px`)}),this.#e.observe(this.#t),this.#s=i=>{i.target?.closest?.('[slot="resize"], [data-resize], [class*="handle"]')&&(this.resizing=!0)},this.#t.addEventListener("pointerdown",this.#s),this.#r=()=>{this.resizing&&(this.resizing=!1),this.#l()},document.addEventListener("pointerup",this.#r)}disconnected(){this.#n!==null&&(cancelAnimationFrame(this.#n),this.#n=null),this.#e?.disconnect(),this.#e=null,this.#s&&this.#t&&(this.#t.removeEventListener("pointerdown",this.#s),this.#s=null),this.#r&&(document.removeEventListener("pointerup",this.#r),this.#r=null)}toggle(){return this.collapsed?this.expand():this.collapse(),this.collapsed}collapse(){this.#t&&(this.collapsed||this.#l(),this.#t.style.width=`${nh}px`,this.collapsed=!0,this.#o())}expand(){if(!this.#t)return;let t=this.#c(),e=t&&t>nh?t:240;this.#t.style.width=`${e}px`,this.collapsed=!1,this.#l(),this.#o()}#a(){if(!this.#t||getComputedStyle(this).display==="none")return;let t=this.#t.getBoundingClientRect();if(t.width!==0){if(t.width>nh){this.#n!==null&&(cancelAnimationFrame(this.#n),this.#n=null),this.collapsed=!1;return}this.#n===null&&(this.#n=requestAnimationFrame(()=>{if(this.#n=null,!this.#t||getComputedStyle(this).display==="none")return;let e=this.#t.getBoundingClientRect();e.width>0&&e.width<=nh&&(this.collapsed=!0)}))}}#o(){let t=this.getAttribute("slot")||"leading",e=this.getAttribute("persist")||this.getAttribute("name")||t;this.dispatchEvent(new CustomEvent("sidebar-toggle",{bubbles:!0,detail:{name:e,expanded:!this.collapsed}}))}#l(){if(!(!this.#t||!this.#i))try{let t=this.#t.style.width||"";t&&localStorage.setItem(this.#i,t)}catch{}}#c(){if(!this.#i)return null;try{let t=localStorage.getItem(this.#i);if(!t)return null;let e=parseFloat(t);return isFinite(e)?e:null}catch{return null}}#h(){if(!this.#t)return;let t=this.#c();t&&t>0&&(this.#t.style.width=`${t}px`,this.collapsed=t<=nh)}};customElements.define("editor-sidebar",oh);function oq(){let s=document.activeElement;if(!s)return!1;let t=s.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||s.isContentEditable||t==="INPUT-UI"||t==="TEXTAREA-UI"||t==="OTP-INPUT-UI"||t==="SEARCH-UI")}C();var ah=class extends v{static properties={centered:{type:Boolean,default:!1,reflect:!0},"full-bleed":{type:Boolean,default:!1,reflect:!0}};static template=()=>null};customElements.get("simple-shell")||customElements.define("simple-shell",ah);C();var yd=class extends v{static properties={mode:{type:String,default:"chat",reflect:!0},inspector:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;#e=null;#i=null;#s=null;connected(){}render(){this.#t||(this.#t=!0,this.#e=document.createElement("chat-thread-ui"),this.#i=document.createElement("canvas-ui"),this.appendChild(this.#e),this.appendChild(this.#i),this.inspector&&(this.#s=document.createElement("inspector-ui"),this.appendChild(this.#s)))}appendMessage(t){this.#e?.appendMessage(t)}appendCoT(t){this.#e?.appendCoT(t)}pushArtifact(t){this.mode==="chat"&&(this.mode="split"),this.#i?.processAll(t)}setSuggestions(t){this.#e?.setSuggestions(t)}appendResultMessage(t){this.#e?.appendResultMessage(t)}showSavePatternBar(t){this.#e?.showSavePatternBar(t)}showFeedbackWidget(t){this.#e?.showFeedbackWidget(t)}showTyping(){this.#e?.showTyping()}hideTyping(){this.#e?.hideTyping()}appendError(t){this.#e?.appendError(t)}startPipelineStatus(){return this.#e?.startPipelineStatus()}updatePipelineStatus(t){this.#e?.updatePipelineStatus(t)}completePipelineStatus(){this.#e?.completePipelineStatus()}reset(){this.#e?.clear(),this.#i?.reset(),this.mode="chat"}get thread(){return this.#e}get canvas(){return this.#i}get inspect(){return this.#s}};customElements.define("gen-root",yd);fO();C();var aq=["default","ocean","forest","sunset","lavender","rose","slate","midnight"],lq={compact:{density:.85,radius:.75},default:{density:1,radius:1,clearTheme:!0},spacious:{density:1.15,radius:1.25}},fE=s=>s.length?s[0].toUpperCase()+s.slice(1):s,lh=class extends v{static properties={themes:{type:String,default:aq.join(" "),reflect:!0},parametric:{type:Boolean,default:!1,reflect:!0},presets:{type:Boolean,default:!1,reflect:!0},schemeToggle:{type:Boolean,default:!1,reflect:!0,attribute:"scheme-toggle"},persist:{type:Boolean,default:!1,reflect:!0},storagePrefix:{type:String,default:"adia-theme-",reflect:!0,attribute:"storage-prefix"},target:{type:String,default:":root",reflect:!0},scheme:{type:String,default:"auto",reflect:!0},activeTheme:{type:String,default:"",reflect:!0,attribute:"active-theme"},activeScheme:{type:String,default:"",reflect:!0,attribute:"active-scheme"},activeDensity:{type:String,default:"",reflect:!0,attribute:"active-density"},activeRadius:{type:String,default:"",reflect:!0,attribute:"active-radius"},register:{type:Boolean,default:!1,reflect:!0},activeRegister:{type:String,default:"",reflect:!0,attribute:"active-register"}};static template=()=>null;#t=null;#e=null;#i=[];#s=null;#r=null;#n=null;#a=null;#o=!1;connected(){this.#o||(this.#l(),this.#o=!0,this.#p(),this.#g())}disconnected(){for(let t of this.#i)t();this.#i=[],this.#O()}apply(t={}){this.#d(t,"programmatic")}reset(){let t=this.#y();if(t.removeAttribute("data-theme"),t.style.removeProperty("--a-density"),t.style.removeProperty("--a-radius-k"),t.style.removeProperty("color-scheme"),t.removeAttribute("verse"),t.removeAttribute("prose"),this.persist)for(let i of["theme","scheme","density","radius","register"])try{localStorage.removeItem(`${this.storagePrefix}${i}`)}catch{}this.activeTheme="",this.activeDensity="",this.activeRadius="",this.activeRegister="";let e=this.#m();this.activeScheme=e,this.#n&&(this.#n.value=e),this.#s&&(this.#s.value=1),this.#r&&(this.#r.value=1),this.#a&&(this.#a.value="regular"),this.#f("reset")}#l(){let t=document.createDocumentFragment();if(this.schemeToggle){let n=document.createElement("div");n.setAttribute("part","scheme");let o=document.createElement("segmented-ui");o.id=`${this.#x}-scheme`;let a=document.createElement("segment-ui");a.setAttribute("value","light"),a.setAttribute("text","Light");let l=document.createElement("segment-ui");l.setAttribute("value","dark"),l.setAttribute("text","Dark"),o.append(a,l),n.appendChild(o),t.appendChild(n),this.#n=o}let e=document.createElement("text-ui");e.setAttribute("variant","label"),e.textContent="Theme",t.appendChild(e);let i=document.createElement("div");i.setAttribute("part","themes");let r=(this.themes||"").trim().split(/\s+/).filter(Boolean);for(let n of r){let o=document.createElement("button-ui");o.setAttribute("data-theme-slug",n),o.setAttribute("text",fE(n)),o.setAttribute("variant","outline"),o.setAttribute("size","sm"),i.appendChild(o)}if(t.appendChild(i),this.parametric){t.appendChild(document.createElement("divider-ui"));let n=document.createElement("text-ui");n.setAttribute("variant","label"),n.textContent="Parametric",t.appendChild(n);let o=document.createElement("field-ui");o.setAttribute("label","Density");let a=document.createElement("slider-ui");a.setAttribute("part","density"),a.setAttribute("value","1"),a.setAttribute("min","0.5"),a.setAttribute("max","1.5"),a.setAttribute("step","0.05"),a.setAttribute("suffix","\xD7"),o.appendChild(a),t.appendChild(o),this.#s=a;let l=document.createElement("field-ui");l.setAttribute("label","Radius");let h=document.createElement("slider-ui");h.setAttribute("part","radius"),h.setAttribute("value","1"),h.setAttribute("min","0"),h.setAttribute("max","2"),h.setAttribute("step","0.1"),h.setAttribute("suffix","\xD7"),l.appendChild(h),t.appendChild(l),this.#r=h}if(this.presets||this.register){if(t.appendChild(document.createElement("divider-ui")),this.presets){let n=document.createElement("div");n.setAttribute("part","preset-row");let o=document.createElement("text-ui");o.setAttribute("variant","label"),o.textContent="Density",n.appendChild(o);let a=document.createElement("div");a.setAttribute("part","presets");for(let l of["compact","default","spacious"]){let h=document.createElement("button-ui");h.setAttribute("data-preset",l),h.setAttribute("text",l==="default"?"Reset":fE(l)),h.setAttribute("variant","outline"),h.setAttribute("size","sm"),a.appendChild(h)}n.appendChild(a),t.appendChild(n)}if(this.register){let n=document.createElement("div");n.setAttribute("part","preset-row");let o=document.createElement("text-ui");o.setAttribute("variant","label"),o.textContent="Scale Context",n.appendChild(o);let a=document.createElement("segmented-ui");a.setAttribute("part","register"),a.setAttribute("size","sm"),a.id=`${this.#x}-register`;for(let l of["verse","regular","prose"]){let h=document.createElement("segment-ui");h.setAttribute("value",l),h.setAttribute("text",l),a.appendChild(h)}a.setAttribute("value","regular"),n.appendChild(a),t.appendChild(n),this.#a=a}}this.appendChild(t),this.#c()}#c(){for(let t of this.querySelectorAll('[part="themes"] button-ui')){let e=t.getAttribute("data-theme-slug"),i=()=>this.#h(e);t.addEventListener("press",i),t.addEventListener("click",i),this.#i.push(()=>{t.removeEventListener("press",i),t.removeEventListener("click",i)})}if(this.#s){let t=()=>this.#d({density:parseFloat(this.#s.value)},"slider");this.#s.addEventListener("input",t),this.#i.push(()=>this.#s.removeEventListener("input",t))}if(this.#r){let t=()=>this.#d({radius:parseFloat(this.#r.value)},"slider");this.#r.addEventListener("input",t),this.#i.push(()=>this.#r.removeEventListener("input",t))}for(let t of this.querySelectorAll('[part="presets"] button-ui')){let e=t.getAttribute("data-preset"),i=()=>this.#u(e);t.addEventListener("press",i),t.addEventListener("click",i),this.#i.push(()=>{t.removeEventListener("press",i),t.removeEventListener("click",i)})}if(this.#n){let t=e=>{let i=e.detail?.value??this.#n.value;(i==="light"||i==="dark")&&this.#d({scheme:i},"scheme")};this.#n.addEventListener("change",t),this.#i.push(()=>this.#n.removeEventListener("change",t))}if(this.#a){let t=e=>{let i=e.detail?.value??this.#a.value;this.#d({register:i},"register")};this.#a.addEventListener("change",t),this.#i.push(()=>this.#a.removeEventListener("change",t))}}#h(t){let e=this.#y();if(e.style.removeProperty("--a-density"),e.style.removeProperty("--a-radius-k"),this.persist)try{localStorage.removeItem(`${this.storagePrefix}density`),localStorage.removeItem(`${this.storagePrefix}radius`)}catch{}this.#d({theme:t},"theme");let i=()=>{let r=getComputedStyle(e),n=parseFloat(r.getPropertyValue("--a-density"))||1,o=parseFloat(r.getPropertyValue("--a-radius-k"))||1;this.#s&&(this.#s.value=n),this.#r&&(this.#r.value=o),this.activeDensity=String(n),this.activeRadius=String(o)};typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}#u(t){let e=lq[t];if(e){if(e.clearTheme&&(this.#y().removeAttribute("data-theme"),this.activeTheme="",this.persist))try{localStorage.removeItem(`${this.storagePrefix}theme`)}catch{}this.#d({density:e.density,radius:e.radius},"preset"),this.#s&&(this.#s.value=e.density),this.#r&&(this.#r.value=e.radius)}}#d(t,e){let i=this.#y();if(t.theme!==void 0&&(t.theme===""||t.theme==="default"?(i.removeAttribute("data-theme"),this.activeTheme=""):(i.setAttribute("data-theme",t.theme),this.activeTheme=t.theme),this.persist))try{this.activeTheme?localStorage.setItem(`${this.storagePrefix}theme`,this.activeTheme):localStorage.removeItem(`${this.storagePrefix}theme`)}catch{}if(t.density!==void 0&&(i.style.setProperty("--a-density",t.density),this.activeDensity=String(t.density),this.persist))try{localStorage.setItem(`${this.storagePrefix}density`,String(t.density))}catch{}if(t.radius!==void 0&&(i.style.setProperty("--a-radius-k",t.radius),this.activeRadius=String(t.radius),this.persist))try{localStorage.setItem(`${this.storagePrefix}radius`,String(t.radius))}catch{}if(t.scheme!==void 0){let r=t.scheme;if(r==="auto"){if(i.style.removeProperty("color-scheme"),this.activeScheme=this.#m(),this.persist)try{localStorage.removeItem(`${this.storagePrefix}scheme`)}catch{}this.#b()}else if(r==="light"||r==="dark"){if(i.style.setProperty("color-scheme",r),this.activeScheme=r,this.persist)try{localStorage.setItem(`${this.storagePrefix}scheme`,r)}catch{}this.#O()}this.#n&&(this.#n.value=this.activeScheme)}if(t.register!==void 0){let r=t.register;if(i.toggleAttribute("verse",r==="verse"),i.toggleAttribute("prose",r==="prose"),this.activeRegister=r==="verse"||r==="prose"?r:"",this.persist)try{this.activeRegister?localStorage.setItem(`${this.storagePrefix}register`,this.activeRegister):localStorage.removeItem(`${this.storagePrefix}register`)}catch{}this.#a&&(this.#a.value=r)}this.#f(e)}#f(t){this.dispatchEvent(new CustomEvent("theme-change",{bubbles:!0,detail:{theme:this.activeTheme,scheme:this.activeScheme,density:this.activeDensity?parseFloat(this.activeDensity):1,radius:this.activeRadius?parseFloat(this.activeRadius):1,source:t}}))}#p(){let t=this.#y(),e,i,r,n,o;if(this.persist)try{e=localStorage.getItem(`${this.storagePrefix}theme`)||"",i=localStorage.getItem(`${this.storagePrefix}scheme`)||"";let a=localStorage.getItem(`${this.storagePrefix}density`),l=localStorage.getItem(`${this.storagePrefix}radius`);r=a!=null?parseFloat(a):void 0,n=l!=null?parseFloat(l):void 0,o=localStorage.getItem(`${this.storagePrefix}register`)||""}catch{}if(e?(t.setAttribute("data-theme",e),this.activeTheme=e):this.activeTheme=t.getAttribute("data-theme")||"",i==="light"||i==="dark")t.style.setProperty("color-scheme",i),this.activeScheme=i,this.#n&&(this.#n.value=i);else{let a=this.scheme||"auto";a==="light"||a==="dark"?(t.style.setProperty("color-scheme",a),this.activeScheme=a):this.activeScheme=this.#m(),this.#n&&(this.#n.value=this.activeScheme)}if(r!=null&&!Number.isNaN(r))t.style.setProperty("--a-density",r),this.activeDensity=String(r),this.#s&&(this.#s.value=r);else if(this.#s){let a=getComputedStyle(t),l=parseFloat(a.getPropertyValue("--a-density"))||1;this.#s.value=l,this.activeDensity=String(l)}if(n!=null&&!Number.isNaN(n))t.style.setProperty("--a-radius-k",n),this.activeRadius=String(n),this.#r&&(this.#r.value=n);else if(this.#r){let a=getComputedStyle(t),l=parseFloat(a.getPropertyValue("--a-radius-k"))||1;this.#r.value=l,this.activeRadius=String(l)}if(this.#a){let a=o==="verse"||o==="prose"?o:"regular";t.toggleAttribute("verse",a==="verse"),t.toggleAttribute("prose",a==="prose"),this.#a.value=a,this.activeRegister=a==="regular"?"":a}}#m(){try{if(typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches)return"dark"}catch{}return"light"}#g(){if(this.scheme==="auto"){if(this.persist)try{let t=localStorage.getItem(`${this.storagePrefix}scheme`);if(t==="light"||t==="dark")return}catch{}this.#b()}}#b(){if(!(this.#t||typeof matchMedia!="function"))try{this.#t=matchMedia("(prefers-color-scheme: dark)"),this.#e=()=>{let t=this.#t.matches?"dark":"light";this.activeScheme=t,this.#n&&(this.#n.value=t),this.#f("scheme")},this.#t.addEventListener("change",this.#e)}catch{}}#O(){if(this.#t&&this.#e)try{this.#t.removeEventListener("change",this.#e)}catch{}this.#t=null,this.#e=null}#y(){let t=this.target||":root";if(t===":root")return document.documentElement;try{return document.querySelector(t)??document.documentElement}catch{return document.documentElement}}get#x(){return this.id||"theme-panel"}};customElements.define("theme-panel",lh);C();var hh=class extends v{static properties={items:{type:Array,default:[]},"storage-key":{type:String,default:"",reflect:!0},storage:{type:String,default:"local",reflect:!0},"dismiss-on-complete":{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!0,reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},value:{type:Object,default:{}},title:{type:String,default:"Get started",reflect:!0}};static template=t=>t._renderTemplate();#t=`obc-h-${Math.random().toString(36).slice(2,8)}`;#e=`obc-l-${Math.random().toString(36).slice(2,8)}`;#i=!1;#s=!1;#r=null;#n=null;attributeChangedCallback(t,e,i){if(t==="items"||t==="value"){if(i==null)this[t]=t==="items"?[]:{};else try{let r=JSON.parse(i);this[t]=r}catch{this[t]=t==="items"?[]:{}}return}super.attributeChangedCallback(t,e,i)}connected(){if(this.setAttribute("role","region"),this.setAttribute("aria-labelledby",this.#t),this.hasAttribute("items")&&!Array.isArray(this.items))try{this.items=JSON.parse(this.getAttribute("items"))}catch{this.items=[]}if(this.hasAttribute("value")&&(typeof this.value!="object"||Array.isArray(this.value)))try{this.value=JSON.parse(this.getAttribute("value"))}catch{this.value={}}if(this.#i=this.value&&Object.keys(this.value).length>0,!this.#i){let t=this.#x();t&&(this.value=t)}this.#r=this.#o.bind(this),this.#n=this.#l.bind(this),this.addEventListener("change",this.#r),this.addEventListener("click",this.#n),this.#s=this.#p(),this.#m()}disconnected(){this.#r&&this.removeEventListener("change",this.#r),this.#n&&this.removeEventListener("click",this.#n),this.#r=null,this.#n=null,this.#v()}render(){this.#m(),this.#O(),this.#g()}_renderTemplate(){let t=Array.isArray(this.items)?this.items:[],{done:e,total:i,percent:r}=this.#f(),n=this.collapsed?"Expand":"Collapse",o=this.collapsed?"chevron-down":"chevron-up",a=!!this.collapsible,l=this.title||"Get started",h=i>0&&e===i;return it`
381
+ `}else t==="error"&&(n.innerHTML=`<icon-ui name="warning"></icon-ui><span>${vO(e)}</span>`);return this.#i?.appendChild(n),this.#c(),this.#o("message",{id:r,role:t,content:e}),n}appendChunk(t){let e=this.#t[this.#t.length-1];if(!e||e.role!=="assistant")return;e.content+=t;let i=this.#i?.querySelector("[data-role]:last-child [data-content]");i&&i.insertAdjacentText("beforeend",t),this.#c()}deleteMessage(t){let e=this.#t.findIndex(i=>i.id===t);e!==-1&&(this.#t.splice(e,1),this.#i?.querySelector(`[data-id="${t}"]`)?.remove())}clear(){if(this.#t.length=0,this.#i){let t=this.#r;this.#i.innerHTML="",t&&this.#i.appendChild(t)}this.#o("clear")}startStreaming(){this.streaming=!0,this.#s&&(this.#s.disabled=!0),this.#n&&(this.#n.textContent="Typing..."),this.#i?.tagName?.toLowerCase()==="chat-thread"&&(this.#i.streaming=!0)}stopStreaming(){this.streaming=!1,this.#s&&(this.#s.disabled=!1),this.#n&&(this.#n.textContent=""),this.#i?.tagName?.toLowerCase()==="chat-thread"&&(this.#i.streaming=!1),this.#i?.querySelector("[data-role]:last-child [data-cursor]")?.remove();let t=this.#t[this.#t.length-1];if(t?.role==="assistant"&&t.content){let e=this.#i?.querySelector("[data-role]:last-child [data-content]");e&&(e.innerHTML=ui(t.content),this.#h(e))}this.#s?.focus()}abort(){this.#e&&(this.#e.abort(),this.#e=null,this.#o("abort")),this.streaming&&this.stopStreaming()}async send(t,e={}){let i=e.model||this.model||this.#s?.model;if(!i)throw new Error("No model specified");this.appendMessage({role:"user",content:t}),this.appendMessage({role:"assistant",content:""}),this.startStreaming(),this.#e=new AbortController;try{let r={provider:this.provider||void 0,apiKey:this.#a||void 0,model:i,system:this.system||void 0,proxyUrl:this.proxyUrl||void 0,thinking:this.thinking||void 0,messages:this.conversation.slice(0,-1),signal:this.#e.signal,...e};for await(let n of Od(r))n.type==="text"?(this.appendChunk(n.text),this.#o("chunk",{text:n.text,snapshot:n.snapshot})):n.type==="thinking"?this.#o("thinking",{text:n.text}):n.type==="done"?this.#o("done",{text:n.text,usage:n.usage,stopReason:n.stopReason}):n.type==="error"&&(this.appendMessage({role:"error",content:n.error.message}),this.#o("error",{error:n.error}))}catch(r){r.name!=="AbortError"&&(this.appendMessage({role:"error",content:r.message}),this.#o("error",{error:r}))}this.#e=null,this.stopStreaming()}export(){return{messages:this.#t.map(t=>({role:t.role,content:t.content})),model:this.model,system:this.system}}import(t){t.model&&(this.model=t.model),t.system&&(this.system=t.system),t.messages&&(this.conversation=t.messages)}#c(){let t=this.#i;t&&requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight})}#h(t){for(let e of t.querySelectorAll("pre")){let i=e.querySelector("code");if(!i)continue;let r=i.getAttribute("data-lang")||"",n=document.createElement("code-ui");r&&n.setAttribute("language",r),n.textContent=i.textContent,e.replaceWith(n)}}};customElements.define("chat-shell",Gl);C();var rq=40,Kl=class extends v{static properties={streaming:{type:Boolean,default:!1,reflect:!0},empty:{type:Boolean,default:!0,reflect:!0}};static template=()=>null;#t=null;#e=!0;#i=null;connected(){this.#s(),this.#r(),this.#n()}disconnected(){this.#t?.disconnect(),this.#t=null,this.#i&&(this.removeEventListener("scroll",this.#i),this.#i=null)}scrollToBottom(){this.scrollTo({top:this.scrollHeight,behavior:"smooth"})}scrollToBottomInstant(){this.scrollTop=this.scrollHeight}#s(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()!=="chat-empty");this.empty=t.length===0}#r(){this.#t=new MutationObserver(()=>{this.#s(),this.#e&&this.scrollToBottomInstant()}),this.#t.observe(this,{childList:!0})}#n(){this.#i=()=>{let t=this.scrollHeight-(this.scrollTop+this.clientHeight);this.#e=t<=rq},this.addEventListener("scroll",this.#i,{passive:!0})}};customElements.define("chat-thread",Kl);C();var Jl=class extends v{static properties={disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.#t=this.querySelector("chat-input-ui")||this.querySelector("input-ui")||this.querySelector("textarea-ui"),this.#e=t=>{this.dispatchEvent(new CustomEvent("composer-submit",{bubbles:!0,detail:t.detail||{}}))},this.#t?.addEventListener("submit",this.#e),this.#i()}disconnected(){this.#t&&this.#e&&this.#t.removeEventListener("submit",this.#e),this.#t=null,this.#e=null}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),t==="disabled"&&this.#i()}focus(){this.#t?.focus?.()}clear(){this.#t?.clear?.()}get input(){return this.#t}#i(){this.#t&&(this.disabled?this.#t.setAttribute("disabled",""):this.#t.removeAttribute("disabled"))}};customElements.define("chat-composer",Jl);C();var th=96,dE=160,eh=class extends v{static properties={collapsed:{type:Boolean,default:!1,reflect:!0},resizing:{type:Boolean,default:!1,reflect:!0},resizable:{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!1,reflect:!0},name:{type:String,default:"",reflect:!0},minWidth:{type:String,default:"",reflect:!0,attribute:"min-width"}};static template=()=>null;#t="";#e=[];#i=null;connected(){this.#n(),this.resizable&&this.#o(),this.#l(),this.#a()}disconnected(){for(let t of this.#e)t();this.#e=[],this.#i?.disconnect(),this.#i=null}toggle(){return this.collapsed?this.expand():this.collapse(),this.collapsed}collapse(){if(this.collapsed)return;let t=this.style.width||getComputedStyle(this).width;parseFloat(t)>th&&(this.#t=t);let e=this.minWidth||getComputedStyle(this).minWidth;this.style.width=e,this.#r(e),this.collapsed=!0,this.#c(!1)}expand(){if(!this.collapsed)return;let t=this.#t||"";this.style.width=t,this.#r(t),this.collapsed=!1,this.#c(!0)}#s(){return`adia-chat-sidebar-${this.name||this.getAttribute("slot")||"default"}`}#r(t){try{localStorage.setItem(this.#s(),t)}catch{}}#n(){try{let t=localStorage.getItem(this.#s());if(!t)return;this.style.width=t;let e=parseFloat(t);!isNaN(e)&&e>th&&(this.#t=t)}catch{}}#a(){let t=this.getBoundingClientRect().width;this.collapsed=t<=th}#o(){let t=this.querySelector(":scope > [data-resize]");if(!t)return;let e=this.getAttribute("slot"),i=e==="leading",r=n=>{n.preventDefault(),t.setPointerCapture(n.pointerId);let o=n.clientX,a=this.getBoundingClientRect().width;this.resizing=!0,document.documentElement.style.cursor="col-resize";let l=c=>{let u=c.clientX-o,d=parseInt(getComputedStyle(this).getPropertyValue("max-width"))||480,f=Math.max(48,Math.min(d,a+(i?u:-u)));this.style.width=`${f}px`},h=()=>{this.resizing=!1,document.documentElement.style.cursor="",t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",h);let c=this.getBoundingClientRect().width;c<=th?this.style.width=this.minWidth||getComputedStyle(this).minWidth:c<dE&&(this.style.width=`${dE}px`),this.#r(this.style.width),this.#a(),this.dispatchEvent(new CustomEvent("sidebar-resize",{bubbles:!0,detail:{name:this.name||e,width:this.getBoundingClientRect().width}}))};t.addEventListener("pointermove",l),t.addEventListener("pointerup",h)};t.addEventListener("pointerdown",r),this.#e.push(()=>t.removeEventListener("pointerdown",r))}#l(){this.#i=new ResizeObserver(t=>{for(let e of t){let i=e.contentBoxSize[0].inlineSize<=th;for(let r of this.querySelectorAll("select-ui"))r.setAttribute("placement",i?"right":"bottom-start")}}),this.#i.observe(this)}#c(t){this.dispatchEvent(new CustomEvent("sidebar-toggle",{bubbles:!0,detail:{name:this.name||this.getAttribute("slot")||"default",expanded:t}}))}};customElements.define("chat-sidebar",eh);C();var ih=class extends v{static properties={focusMode:{type:Boolean,default:!1,reflect:!0,attribute:"focus-mode"}};static template=()=>null;#t=null;#e=null;#i=null;connected(){this.#t=this.querySelector("editor-toolbar"),this.#e=this.querySelector("editor-canvas"),this.#s(),this.#i=t=>{let e=t?.detail?.name;e&&(e==="toggle-focus"||e==="full-screen")&&this.toggleFocusMode()},this.addEventListener("toolbar-action",this.#i)}disconnected(){this.#i&&this.removeEventListener("toolbar-action",this.#i),this.#i=null}toggleFocusMode(){this.focusMode=!this.focusMode,this.#t?.tagName?.toLowerCase()==="editor-toolbar"&&(this.#t.fullScreen=this.focusMode),this.#e?.tagName?.toLowerCase()==="editor-canvas"&&(this.focusMode?this.#e.focus?.():this.#e.blur?.()),this.dispatchEvent(new CustomEvent("editor-mode-change",{bubbles:!0,detail:{focusMode:this.focusMode}}))}#s(){for(let t of this.querySelectorAll("select-ui[data-options]"))try{let e=JSON.parse(t.getAttribute("data-options"));t.options=e}catch{}}};customElements.define("editor-shell",ih);C();var sh=class extends v{static properties={fullScreen:{type:Boolean,default:!1,reflect:!0,attribute:"full-screen"}};static template=()=>null;#t=null;connected(){this.#t=t=>{let e=t.target.closest("[data-toolbar-action]");if(!e||!this.contains(e))return;let i=e.getAttribute("data-toolbar-action");this.dispatchEvent(new CustomEvent("toolbar-action",{bubbles:!0,detail:{name:i}}))},this.addEventListener("click",this.#t)}disconnected(){this.#t&&this.removeEventListener("click",this.#t),this.#t=null}};customElements.define("editor-toolbar",sh);C();var rh=class extends v{static properties={empty:{type:Boolean,default:!0,reflect:!0},focused:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=1;#e=null;connected(){this.#i(),this.#s()}disconnected(){this.#e?.disconnect(),this.#e=null}get zoom(){return this.#t}set zoom(t){let e=parseFloat(t);!isFinite(e)||e<=0||(this.#t=e,this.style.setProperty("--editor-canvas-zoom",String(e)))}resetView(){this.zoom=1}focus(){super.focus?.(),this.focused=!0}blur(){super.blur?.(),this.focused=!1}#i(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()!=="editor-canvas-empty");this.empty=t.length===0}#s(){this.#e=new MutationObserver(()=>{this.#i()}),this.#e.observe(this,{childList:!0})}};customElements.define("editor-canvas",rh);C();var nh=96,nq="adia-editor-sidebar-",oh=class extends v{static properties={collapsed:{type:Boolean,default:!1,reflect:!0},resizing:{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;connected(){if(this.#t=this.querySelector("pane-ui"),!this.#t)return;let t=this.getAttribute("slot")||"leading",e=this.getAttribute("persist")||this.getAttribute("name")||t;this.#i=`${nq}${e}`,this.#h(),this.#e=new ResizeObserver(i=>{if(getComputedStyle(this).display==="none")return;this.#a();let r=this.#t.offsetWidth;r>0&&(this.style.width=`${r}px`)}),this.#e.observe(this.#t),this.#s=i=>{i.target?.closest?.('[slot="resize"], [data-resize], [class*="handle"]')&&(this.resizing=!0)},this.#t.addEventListener("pointerdown",this.#s),this.#r=()=>{this.resizing&&(this.resizing=!1),this.#l()},document.addEventListener("pointerup",this.#r)}disconnected(){this.#n!==null&&(cancelAnimationFrame(this.#n),this.#n=null),this.#e?.disconnect(),this.#e=null,this.#s&&this.#t&&(this.#t.removeEventListener("pointerdown",this.#s),this.#s=null),this.#r&&(document.removeEventListener("pointerup",this.#r),this.#r=null)}toggle(){return this.collapsed?this.expand():this.collapse(),this.collapsed}collapse(){this.#t&&(this.collapsed||this.#l(),this.#t.style.width=`${nh}px`,this.collapsed=!0,this.#o())}expand(){if(!this.#t)return;let t=this.#c(),e=t&&t>nh?t:240;this.#t.style.width=`${e}px`,this.collapsed=!1,this.#l(),this.#o()}#a(){if(!this.#t||getComputedStyle(this).display==="none")return;let t=this.#t.getBoundingClientRect();if(t.width!==0){if(t.width>nh){this.#n!==null&&(cancelAnimationFrame(this.#n),this.#n=null),this.collapsed=!1;return}this.#n===null&&(this.#n=requestAnimationFrame(()=>{if(this.#n=null,!this.#t||getComputedStyle(this).display==="none")return;let e=this.#t.getBoundingClientRect();e.width>0&&e.width<=nh&&(this.collapsed=!0)}))}}#o(){let t=this.getAttribute("slot")||"leading",e=this.getAttribute("persist")||this.getAttribute("name")||t;this.dispatchEvent(new CustomEvent("sidebar-toggle",{bubbles:!0,detail:{name:e,expanded:!this.collapsed}}))}#l(){if(!(!this.#t||!this.#i))try{let t=this.#t.style.width||"";t&&localStorage.setItem(this.#i,t)}catch{}}#c(){if(!this.#i)return null;try{let t=localStorage.getItem(this.#i);if(!t)return null;let e=parseFloat(t);return isFinite(e)?e:null}catch{return null}}#h(){if(!this.#t)return;let t=this.#c();t&&t>0&&(this.#t.style.width=`${t}px`,this.collapsed=t<=nh)}};customElements.define("editor-sidebar",oh);function oq(){let s=document.activeElement;if(!s)return!1;let t=s.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||s.isContentEditable||t==="INPUT-UI"||t==="TEXTAREA-UI"||t==="OTP-INPUT-UI"||t==="SEARCH-UI")}C();var ah=class extends v{static properties={centered:{type:Boolean,default:!1,reflect:!0},"full-bleed":{type:Boolean,default:!1,reflect:!0}};static template=()=>null};customElements.get("simple-shell")||customElements.define("simple-shell",ah);C();var yd=class extends v{static properties={mode:{type:String,default:"chat",reflect:!0},inspector:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;#e=null;#i=null;#s=null;connected(){}render(){this.#t||(this.#t=!0,this.#e=document.createElement("chat-thread-ui"),this.#i=document.createElement("canvas-ui"),this.appendChild(this.#e),this.appendChild(this.#i),this.inspector&&(this.#s=document.createElement("inspector-ui"),this.appendChild(this.#s)))}appendMessage(t){this.#e?.appendMessage(t)}appendCoT(t){this.#e?.appendCoT(t)}pushArtifact(t){this.mode==="chat"&&(this.mode="split"),this.#i?.processAll(t)}setSuggestions(t){this.#e?.setSuggestions(t)}appendResultMessage(t){this.#e?.appendResultMessage(t)}showSavePatternBar(t){this.#e?.showSavePatternBar(t)}showFeedbackWidget(t){this.#e?.showFeedbackWidget(t)}showTyping(){this.#e?.showTyping()}hideTyping(){this.#e?.hideTyping()}appendError(t){this.#e?.appendError(t)}startPipelineStatus(){return this.#e?.startPipelineStatus()}updatePipelineStatus(t){this.#e?.updatePipelineStatus(t)}completePipelineStatus(){this.#e?.completePipelineStatus()}reset(){this.#e?.clear(),this.#i?.reset(),this.mode="chat"}get thread(){return this.#e}get canvas(){return this.#i}get inspect(){return this.#s}};customElements.define("gen-root",yd);fO();C();var aq=["default","ocean","forest","sunset","lavender","rose","slate","midnight"],lq={compact:{density:.85,radius:.75},default:{density:1,radius:1,clearTheme:!0},spacious:{density:1.15,radius:1.25}},fE=s=>s.length?s[0].toUpperCase()+s.slice(1):s,lh=class extends v{static properties={themes:{type:String,default:aq.join(" "),reflect:!0},parametric:{type:Boolean,default:!1,reflect:!0},presets:{type:Boolean,default:!1,reflect:!0},schemeToggle:{type:Boolean,default:!1,reflect:!0,attribute:"scheme-toggle"},persist:{type:Boolean,default:!1,reflect:!0},storagePrefix:{type:String,default:"adia-theme-",reflect:!0,attribute:"storage-prefix"},target:{type:String,default:":root",reflect:!0},scheme:{type:String,default:"auto",reflect:!0},activeTheme:{type:String,default:"",reflect:!0,attribute:"active-theme"},activeScheme:{type:String,default:"",reflect:!0,attribute:"active-scheme"},activeDensity:{type:String,default:"",reflect:!0,attribute:"active-density"},activeRadius:{type:String,default:"",reflect:!0,attribute:"active-radius"},register:{type:Boolean,default:!1,reflect:!0},activeRegister:{type:String,default:"",reflect:!0,attribute:"active-register"}};static template=()=>null;#t=null;#e=null;#i=[];#s=null;#r=null;#n=null;#a=null;#o=!1;connected(){this.#o||(this.#l(),this.#o=!0,this.#p(),this.#g())}disconnected(){for(let t of this.#i)t();this.#i=[],this.#O()}apply(t={}){this.#d(t,"programmatic")}reset(){let t=this.#y();if(t.removeAttribute("theme"),t.style.removeProperty("--a-density"),t.style.removeProperty("--a-radius-k"),t.style.removeProperty("color-scheme"),t.removeAttribute("verse"),t.removeAttribute("prose"),this.persist)for(let i of["theme","scheme","density","radius","register"])try{localStorage.removeItem(`${this.storagePrefix}${i}`)}catch{}this.activeTheme="",this.activeDensity="",this.activeRadius="",this.activeRegister="";let e=this.#m();this.activeScheme=e,this.#n&&(this.#n.value=e),this.#s&&(this.#s.value=1),this.#r&&(this.#r.value=1),this.#a&&(this.#a.value="regular"),this.#f("reset")}#l(){let t=document.createDocumentFragment();if(this.schemeToggle){let n=document.createElement("div");n.setAttribute("part","scheme");let o=document.createElement("segmented-ui");o.id=`${this.#x}-scheme`;let a=document.createElement("segment-ui");a.setAttribute("value","light"),a.setAttribute("text","Light");let l=document.createElement("segment-ui");l.setAttribute("value","dark"),l.setAttribute("text","Dark"),o.append(a,l),n.appendChild(o),t.appendChild(n),this.#n=o}let e=document.createElement("text-ui");e.setAttribute("variant","label"),e.textContent="Theme",t.appendChild(e);let i=document.createElement("div");i.setAttribute("part","themes");let r=(this.themes||"").trim().split(/\s+/).filter(Boolean);for(let n of r){let o=document.createElement("button-ui");o.setAttribute("data-theme-slug",n),o.setAttribute("text",fE(n)),o.setAttribute("variant","outline"),o.setAttribute("size","sm"),i.appendChild(o)}if(t.appendChild(i),this.parametric){t.appendChild(document.createElement("divider-ui"));let n=document.createElement("text-ui");n.setAttribute("variant","label"),n.textContent="Parametric",t.appendChild(n);let o=document.createElement("field-ui");o.setAttribute("label","Density");let a=document.createElement("slider-ui");a.setAttribute("part","density"),a.setAttribute("value","1"),a.setAttribute("min","0.5"),a.setAttribute("max","1.5"),a.setAttribute("step","0.05"),a.setAttribute("suffix","\xD7"),o.appendChild(a),t.appendChild(o),this.#s=a;let l=document.createElement("field-ui");l.setAttribute("label","Radius");let h=document.createElement("slider-ui");h.setAttribute("part","radius"),h.setAttribute("value","1"),h.setAttribute("min","0"),h.setAttribute("max","2"),h.setAttribute("step","0.1"),h.setAttribute("suffix","\xD7"),l.appendChild(h),t.appendChild(l),this.#r=h}if(this.presets||this.register){if(t.appendChild(document.createElement("divider-ui")),this.presets){let n=document.createElement("div");n.setAttribute("part","preset-row");let o=document.createElement("text-ui");o.setAttribute("variant","label"),o.textContent="Density",n.appendChild(o);let a=document.createElement("div");a.setAttribute("part","presets");for(let l of["compact","default","spacious"]){let h=document.createElement("button-ui");h.setAttribute("data-preset",l),h.setAttribute("text",l==="default"?"Reset":fE(l)),h.setAttribute("variant","outline"),h.setAttribute("size","sm"),a.appendChild(h)}n.appendChild(a),t.appendChild(n)}if(this.register){let n=document.createElement("div");n.setAttribute("part","preset-row");let o=document.createElement("text-ui");o.setAttribute("variant","label"),o.textContent="Scale Context",n.appendChild(o);let a=document.createElement("segmented-ui");a.setAttribute("part","register"),a.setAttribute("size","sm"),a.id=`${this.#x}-register`;for(let l of["verse","regular","prose"]){let h=document.createElement("segment-ui");h.setAttribute("value",l),h.setAttribute("text",l),a.appendChild(h)}a.setAttribute("value","regular"),n.appendChild(a),t.appendChild(n),this.#a=a}}this.appendChild(t),this.#c()}#c(){for(let t of this.querySelectorAll('[part="themes"] button-ui')){let e=t.getAttribute("data-theme-slug"),i=()=>this.#h(e);t.addEventListener("press",i),t.addEventListener("click",i),this.#i.push(()=>{t.removeEventListener("press",i),t.removeEventListener("click",i)})}if(this.#s){let t=()=>this.#d({density:parseFloat(this.#s.value)},"slider");this.#s.addEventListener("input",t),this.#i.push(()=>this.#s.removeEventListener("input",t))}if(this.#r){let t=()=>this.#d({radius:parseFloat(this.#r.value)},"slider");this.#r.addEventListener("input",t),this.#i.push(()=>this.#r.removeEventListener("input",t))}for(let t of this.querySelectorAll('[part="presets"] button-ui')){let e=t.getAttribute("data-preset"),i=()=>this.#u(e);t.addEventListener("press",i),t.addEventListener("click",i),this.#i.push(()=>{t.removeEventListener("press",i),t.removeEventListener("click",i)})}if(this.#n){let t=e=>{let i=e.detail?.value??this.#n.value;(i==="light"||i==="dark")&&this.#d({scheme:i},"scheme")};this.#n.addEventListener("change",t),this.#i.push(()=>this.#n.removeEventListener("change",t))}if(this.#a){let t=e=>{let i=e.detail?.value??this.#a.value;this.#d({register:i},"register")};this.#a.addEventListener("change",t),this.#i.push(()=>this.#a.removeEventListener("change",t))}}#h(t){let e=this.#y();if(e.style.removeProperty("--a-density"),e.style.removeProperty("--a-radius-k"),this.persist)try{localStorage.removeItem(`${this.storagePrefix}density`),localStorage.removeItem(`${this.storagePrefix}radius`)}catch{}this.#d({theme:t},"theme");let i=()=>{let r=getComputedStyle(e),n=parseFloat(r.getPropertyValue("--a-density"))||1,o=parseFloat(r.getPropertyValue("--a-radius-k"))||1;this.#s&&(this.#s.value=n),this.#r&&(this.#r.value=o),this.activeDensity=String(n),this.activeRadius=String(o)};typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}#u(t){let e=lq[t];if(e){if(e.clearTheme&&(this.#y().removeAttribute("theme"),this.activeTheme="",this.persist))try{localStorage.removeItem(`${this.storagePrefix}theme`)}catch{}this.#d({density:e.density,radius:e.radius},"preset"),this.#s&&(this.#s.value=e.density),this.#r&&(this.#r.value=e.radius)}}#d(t,e){let i=this.#y();if(t.theme!==void 0&&(t.theme===""||t.theme==="default"?(i.removeAttribute("theme"),this.activeTheme=""):(i.setAttribute("theme",t.theme),this.activeTheme=t.theme),this.persist))try{this.activeTheme?localStorage.setItem(`${this.storagePrefix}theme`,this.activeTheme):localStorage.removeItem(`${this.storagePrefix}theme`)}catch{}if(t.density!==void 0&&(i.style.setProperty("--a-density",t.density),this.activeDensity=String(t.density),this.persist))try{localStorage.setItem(`${this.storagePrefix}density`,String(t.density))}catch{}if(t.radius!==void 0&&(i.style.setProperty("--a-radius-k",t.radius),this.activeRadius=String(t.radius),this.persist))try{localStorage.setItem(`${this.storagePrefix}radius`,String(t.radius))}catch{}if(t.scheme!==void 0){let r=t.scheme;if(r==="auto"){if(i.style.removeProperty("color-scheme"),this.activeScheme=this.#m(),this.persist)try{localStorage.removeItem(`${this.storagePrefix}scheme`)}catch{}this.#b()}else if(r==="light"||r==="dark"){if(i.style.setProperty("color-scheme",r),this.activeScheme=r,this.persist)try{localStorage.setItem(`${this.storagePrefix}scheme`,r)}catch{}this.#O()}this.#n&&(this.#n.value=this.activeScheme)}if(t.register!==void 0){let r=t.register;if(i.toggleAttribute("verse",r==="verse"),i.toggleAttribute("prose",r==="prose"),this.activeRegister=r==="verse"||r==="prose"?r:"",this.persist)try{this.activeRegister?localStorage.setItem(`${this.storagePrefix}register`,this.activeRegister):localStorage.removeItem(`${this.storagePrefix}register`)}catch{}this.#a&&(this.#a.value=r)}this.#f(e)}#f(t){this.dispatchEvent(new CustomEvent("theme-change",{bubbles:!0,detail:{theme:this.activeTheme,scheme:this.activeScheme,density:this.activeDensity?parseFloat(this.activeDensity):1,radius:this.activeRadius?parseFloat(this.activeRadius):1,source:t}}))}#p(){let t=this.#y(),e,i,r,n,o;if(this.persist)try{e=localStorage.getItem(`${this.storagePrefix}theme`)||"",i=localStorage.getItem(`${this.storagePrefix}scheme`)||"";let a=localStorage.getItem(`${this.storagePrefix}density`),l=localStorage.getItem(`${this.storagePrefix}radius`);r=a!=null?parseFloat(a):void 0,n=l!=null?parseFloat(l):void 0,o=localStorage.getItem(`${this.storagePrefix}register`)||""}catch{}if(e?(t.setAttribute("theme",e),this.activeTheme=e):this.activeTheme=t.getAttribute("theme")||"",i==="light"||i==="dark")t.style.setProperty("color-scheme",i),this.activeScheme=i,this.#n&&(this.#n.value=i);else{let a=this.scheme||"auto";a==="light"||a==="dark"?(t.style.setProperty("color-scheme",a),this.activeScheme=a):this.activeScheme=this.#m(),this.#n&&(this.#n.value=this.activeScheme)}if(r!=null&&!Number.isNaN(r))t.style.setProperty("--a-density",r),this.activeDensity=String(r),this.#s&&(this.#s.value=r);else if(this.#s){let a=getComputedStyle(t),l=parseFloat(a.getPropertyValue("--a-density"))||1;this.#s.value=l,this.activeDensity=String(l)}if(n!=null&&!Number.isNaN(n))t.style.setProperty("--a-radius-k",n),this.activeRadius=String(n),this.#r&&(this.#r.value=n);else if(this.#r){let a=getComputedStyle(t),l=parseFloat(a.getPropertyValue("--a-radius-k"))||1;this.#r.value=l,this.activeRadius=String(l)}if(this.#a){let a=o==="verse"||o==="prose"?o:"regular";t.toggleAttribute("verse",a==="verse"),t.toggleAttribute("prose",a==="prose"),this.#a.value=a,this.activeRegister=a==="regular"?"":a}}#m(){try{if(typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches)return"dark"}catch{}return"light"}#g(){if(this.scheme==="auto"){if(this.persist)try{let t=localStorage.getItem(`${this.storagePrefix}scheme`);if(t==="light"||t==="dark")return}catch{}this.#b()}}#b(){if(!(this.#t||typeof matchMedia!="function"))try{this.#t=matchMedia("(prefers-color-scheme: dark)"),this.#e=()=>{let t=this.#t.matches?"dark":"light";this.activeScheme=t,this.#n&&(this.#n.value=t),this.#f("scheme")},this.#t.addEventListener("change",this.#e)}catch{}}#O(){if(this.#t&&this.#e)try{this.#t.removeEventListener("change",this.#e)}catch{}this.#t=null,this.#e=null}#y(){let t=this.target||":root";if(t===":root")return document.documentElement;try{return document.querySelector(t)??document.documentElement}catch{return document.documentElement}}get#x(){return this.id||"theme-panel"}};customElements.define("theme-panel",lh);C();var hh=class extends v{static properties={items:{type:Array,default:[]},"storage-key":{type:String,default:"",reflect:!0},storage:{type:String,default:"local",reflect:!0},"dismiss-on-complete":{type:Boolean,default:!1,reflect:!0},collapsible:{type:Boolean,default:!0,reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},value:{type:Object,default:{}},title:{type:String,default:"Get started",reflect:!0}};static template=t=>t._renderTemplate();#t=`obc-h-${Math.random().toString(36).slice(2,8)}`;#e=`obc-l-${Math.random().toString(36).slice(2,8)}`;#i=!1;#s=!1;#r=null;#n=null;attributeChangedCallback(t,e,i){if(t==="items"||t==="value"){if(i==null)this[t]=t==="items"?[]:{};else try{let r=JSON.parse(i);this[t]=r}catch{this[t]=t==="items"?[]:{}}return}super.attributeChangedCallback(t,e,i)}connected(){if(this.setAttribute("role","region"),this.setAttribute("aria-labelledby",this.#t),this.hasAttribute("items")&&!Array.isArray(this.items))try{this.items=JSON.parse(this.getAttribute("items"))}catch{this.items=[]}if(this.hasAttribute("value")&&(typeof this.value!="object"||Array.isArray(this.value)))try{this.value=JSON.parse(this.getAttribute("value"))}catch{this.value={}}if(this.#i=this.value&&Object.keys(this.value).length>0,!this.#i){let t=this.#x();t&&(this.value=t)}this.#r=this.#o.bind(this),this.#n=this.#l.bind(this),this.addEventListener("change",this.#r),this.addEventListener("click",this.#n),this.#s=this.#p(),this.#m()}disconnected(){this.#r&&this.removeEventListener("change",this.#r),this.#n&&this.removeEventListener("click",this.#n),this.#r=null,this.#n=null,this.#v()}render(){this.#m(),this.#O(),this.#g()}_renderTemplate(){let t=Array.isArray(this.items)?this.items:[],{done:e,total:i,percent:r}=this.#f(),n=this.collapsed?"Expand":"Collapse",o=this.collapsed?"chevron-down":"chevron-up",a=!!this.collapsible,l=this.title||"Get started",h=i>0&&e===i;return it`
382
382
  <div data-part="header">
383
383
  <div data-part="title" id=${this.#t}>${l}</div>
384
384
  ${a?it`<button-ui
@@ -0,0 +1,11 @@
1
+ // Auto-generated by scripts/build/bundle-css.mjs — DO NOT EDIT.
2
+ // Constructable CSSStyleSheet form of web-modules.min.css (same build, byte-identical CSS).
3
+ // For <theme-provider> / runtime injection where a <link> in <head> isn't possible.
4
+ const css = "billing-overview-ui{--billing-overview-bg:transparent;--billing-overview-gap:var(--a-space-5);--billing-overview-px:var(--a-space-5);--billing-overview-py:var(--a-space-5);--billing-overview-section-radius:var(--a-radius-lg);--billing-overview-header-gap:var(--a-space-3);--billing-overview-kpi-columns:repeat(3, minmax(0, 1fr));--billing-overview-kpi-gap:var(--a-space-3);--billing-overview-section-heading-fg:var(--a-fg);--billing-overview-section-heading-size:var(--a-text-base,1rem);--billing-overview-section-heading-weight:var(--a-weight-semibold,600);--billing-overview-title-size:var(--a-text-2xl,1.5rem);--billing-overview-title-weight:var(--a-weight-bold,700);--billing-overview-meta-fg:var(--a-fg-muted);--billing-overview-meta-size:var(--a-text-sm,.875rem);--billing-overview-empty-fg:var(--a-fg-muted)}@scope(billing-overview-ui){:scope{gap:var(--billing-overview-gap);background:var(--billing-overview-bg);padding-block:var(--billing-overview-py);padding-inline:var(--billing-overview-px);box-sizing:border-box;flex-direction:column;display:flex;container:billing-overview/inline-size}:scope>[data-header] [data-billing-plan-name]{font-size:var(--billing-overview-title-size);font-weight:var(--billing-overview-title-weight);color:var(--a-fg);margin:0;line-height:1.2}:scope>[data-header] [data-billing-plan-meta]{gap:var(--a-space-3);font-size:var(--billing-overview-meta-size);color:var(--billing-overview-meta-fg);flex-wrap:wrap;display:flex}:scope>[data-header] [data-billing-plan-meta]:empty{display:none}:scope>[data-header] [data-billing-status]{vertical-align:baseline;margin-inline-start:var(--a-space-2)}:scope>[data-header] [data-billing-status][hidden]{display:none}:scope>[data-header] [data-header-actions]{gap:var(--a-space-2);flex-wrap:wrap;justify-content:flex-end;align-items:center;display:flex}:scope>[data-header] [data-header-actions]:empty{display:none}:scope>[data-kpis]{grid-template-columns:var(--billing-overview-kpi-columns);gap:var(--billing-overview-kpi-gap);display:grid}:scope>[data-dunning]{display:block}:scope>[data-dunning][hidden]{display:none}:scope>[data-plan-picker],:scope>[data-payment-methods],:scope>[data-invoice-history]{gap:var(--a-space-3);background:var(--a-bg);border:1px solid var(--a-border-subtle);border-radius:var(--billing-overview-section-radius);padding:var(--a-space-4);flex-direction:column;display:flex}:scope>[data-plan-picker][hidden],:scope>[data-payment-methods][hidden],:scope>[data-invoice-history][hidden]{display:none}:scope [data-section-heading]{font-size:var(--billing-overview-section-heading-size);font-weight:var(--billing-overview-section-heading-weight);color:var(--billing-overview-section-heading-fg);margin:0}:scope[variant=compact]>[data-plan-picker],:scope[variant=enterprise]>[data-plan-picker],:scope [data-before-plan-picker]:empty,:scope [data-after-invoice-history]:empty{display:none}:scope>[data-empty]{color:var(--billing-overview-empty-fg);text-align:center;padding-block:var(--a-space-6);display:none}:scope[empty]>[data-empty]{display:block}:scope[empty]>[data-header],:scope[empty]>[data-kpis],:scope[empty]>[data-dunning],:scope[empty]>[data-plan-picker],:scope[empty]>[data-payment-methods],:scope[empty]>[data-invoice-history]{display:none}:scope [data-empty-heading]{margin:0 0 var(--a-space-2) 0;font-size:var(--a-text-base,1rem);font-weight:var(--a-weight-semibold,600);color:var(--a-fg)}:scope [data-empty-description]{font-size:var(--a-text-sm,.875rem);margin:0}:scope[loading]{opacity:.85}:scope[past-due]>[data-header] [data-billing-plan-meta]{color:var(--a-danger-strong,var(--a-danger,var(--a-fg-muted)))}@container billing-overview (width<=40rem){:scope>[data-kpis],:scope>[data-header]{grid-template-columns:1fr}:scope>[data-header] [data-header-actions]{justify-content:flex-start}}}invoice-detail-ui{--invoice-detail-bg:transparent;--invoice-detail-page-padding:var(--a-space-5);--invoice-detail-section-gap:var(--a-space-5);--invoice-detail-totals-width:min(360px, 100%);--invoice-detail-status-badge-radius:var(--a-radius-md);--invoice-detail-meta-fg:var(--a-fg-muted);--invoice-detail-amount-fg:var(--a-fg);--invoice-detail-total-size:var(--a-text-2xl,1.5rem);--invoice-detail-total-weight:var(--a-weight-bold,700);--invoice-detail-line-amount-align:end;--invoice-detail-heading-size:var(--a-text-2xl,1.5rem);--invoice-detail-heading-weight:var(--a-weight-bold,700);--invoice-detail-party-heading-fg:var(--a-fg-muted);--invoice-detail-party-heading-size:var(--a-text-xs,.75rem);--invoice-detail-totals-row-fg:var(--a-fg);--invoice-detail-totals-row-muted-fg:var(--a-fg-muted);--invoice-detail-totals-border:1px solid var(--a-border)}@scope(invoice-detail-ui){:scope{gap:var(--invoice-detail-section-gap);background:var(--invoice-detail-bg);padding:var(--invoice-detail-page-padding);box-sizing:border-box;flex-direction:column;display:flex;container-type:inline-size}:scope>[data-header]{gap:var(--a-space-2) var(--a-space-4);grid-template-columns:1fr auto;grid-template-areas:\"title actions\"\"meta actions\";align-items:start;display:grid}:scope>[data-header]>[data-header-title]{align-items:center;gap:var(--a-space-3);flex-wrap:wrap;grid-area:title;display:flex}:scope>[data-header]>[data-header-title]>[data-invoice-number]{font-size:var(--invoice-detail-heading-size);font-weight:var(--invoice-detail-heading-weight);color:var(--a-fg);margin:0;line-height:1.2}:scope>[data-header]>[data-header-title]>[data-invoice-status]{--tag-radius:var(--invoice-detail-status-badge-radius)}:scope>[data-header]>[data-header-title]>[data-invoice-status][hidden]{display:none}:scope>[data-header]>[data-header-meta]{gap:var(--a-space-4);color:var(--invoice-detail-meta-fg);font-size:var(--a-text-sm,.875rem);flex-wrap:wrap;grid-area:meta;display:flex}:scope>[data-header]>[data-header-actions]{gap:var(--a-space-2);flex-wrap:wrap;grid-area:actions;justify-content:flex-end;align-items:center;display:flex}:scope>[data-header]>[data-header-actions]>[slot=header-actions]{flex:none}:scope>[data-parties]{gap:var(--a-space-4);grid-template-columns:1fr 1fr;display:grid}:scope>[data-parties]>[data-customer],:scope>[data-parties]>[data-remit-to]{gap:var(--a-space-1);flex-direction:column;display:flex}:scope>[data-parties] [data-party-heading]{text-transform:uppercase;letter-spacing:.05em;font-size:var(--invoice-detail-party-heading-size);color:var(--invoice-detail-party-heading-fg);margin-block-end:var(--a-space-1)}:scope>[data-parties] [data-party-name]{font-weight:var(--a-weight-semibold,600);color:var(--a-fg)}:scope>[data-parties] [data-party-email],:scope>[data-parties] [data-party-address]{color:var(--invoice-detail-meta-fg);font-size:var(--a-text-sm,.875rem)}:scope>[data-parties]>[data-customer]:has(>[slot=customer-block])>[data-customer-default],:scope>[data-parties]>[data-remit-to]:has(>[slot=remit-to-block])>[data-remit-to-default],:scope>[data-parties]>[data-remit-to]:not(:has(>[slot=remit-to-block]))>[data-remit-to-default]:empty{display:none}:scope>[data-lines]{display:block}:scope>[data-lines]>[data-lines-card]{--card-padding:0}:scope>[data-lines] [data-lines-table] [data-body]>[role=row]:last-child [role=gridcell]{border-bottom:none}:scope>[data-totals]{gap:var(--a-space-2);inline-size:var(--invoice-detail-totals-width);box-sizing:border-box;flex-direction:column;margin-inline-start:auto;display:flex}:scope>[data-totals]>[data-totals-row]{justify-content:space-between;align-items:baseline;gap:var(--a-space-3);color:var(--invoice-detail-totals-row-muted-fg);font-size:var(--a-text-sm,.875rem);display:flex}:scope>[data-totals]>[data-totals-row]>[data-totals-value]{text-align:var(--invoice-detail-line-amount-align);color:var(--invoice-detail-amount-fg);font-variant-numeric:tabular-nums}:scope>[data-totals]>[data-grand-total]{border-block-start:var(--invoice-detail-totals-border);color:var(--invoice-detail-totals-row-fg);padding-block-start:var(--a-space-2)}:scope>[data-totals]>[data-grand-total]>[data-totals-label]{font-weight:var(--invoice-detail-total-weight)}:scope>[data-totals]>[data-grand-total]>[data-totals-value]{font-size:var(--invoice-detail-total-size);font-weight:var(--invoice-detail-total-weight);color:var(--invoice-detail-amount-fg)}:scope>[data-footer]{color:var(--invoice-detail-meta-fg);font-size:var(--a-text-sm,.875rem)}:scope>[data-footer]:not(:has(>[slot=footer]))>[data-footer-notes]:empty,:scope>[data-footer]:not(:has(>[slot=footer])):not(:has([data-footer-notes]:not(:empty))),:scope:not([empty])>[data-empty],:scope[empty]>[data-parties],:scope[empty]>[data-lines],:scope[empty]>[data-totals],:scope[empty]>[data-footer]{display:none}:scope[loading]{opacity:.7}:scope[density=compact]>[data-lines]>[data-lines-card] table-ui{--table-row-py:var(--a-space-1)}@media print{:scope[printable]{background:0 0;padding:0}:scope[printable]>[data-header]>[data-header-actions]{display:none}:scope[printable] [data-invoice-status]{--tag-bg:transparent}}@container (width<=640px){:scope>[data-parties]{grid-template-columns:1fr}:scope>[data-totals]{inline-size:100%;margin-inline-start:0}:scope>[data-header]{grid-template-columns:1fr;grid-template-areas:\"title\"\"meta\"\"actions\"}:scope>[data-header]>[data-header-actions]{justify-content:flex-start}}}invoice-history-ui{--invoice-history-bg:transparent;--invoice-history-gap:var(--a-space-3);--invoice-history-row-min-height:var(--table-row-h,3rem);--invoice-history-toolbar-gap:var(--a-space-3);--invoice-history-amount-font:var(--a-font-mono);--invoice-history-amount-fg:var(--a-fg-strong,var(--a-fg));--invoice-history-date-fg:var(--a-fg-muted);--invoice-history-filter-gap:var(--a-space-2);--invoice-history-actions-gap:var(--a-space-1)}@scope(invoice-history-ui){:scope{background:var(--invoice-history-bg);display:block}:scope>[data-toolbar],:scope>[data-table-host],:scope>[data-empty]{display:block}:scope>[data-toolbar]{margin-block-end:var(--invoice-history-gap)}:scope [data-invoice-filter]{gap:var(--invoice-history-filter-gap);flex-wrap:wrap;align-items:center;display:inline-flex}:scope>[data-table-host]>table-ui{--table-row-h:var(--invoice-history-row-min-height);width:100%}:scope [data-invoice-amount]{font-family:var(--invoice-history-amount-font);font-variant-numeric:tabular-nums;color:var(--invoice-history-amount-fg);text-align:end}:scope [data-invoice-status]{align-items:center;display:inline-flex}:scope [data-invoice-actions]{gap:var(--invoice-history-actions-gap);justify-content:flex-end;align-items:center;display:inline-flex}:scope:not([empty])>[data-empty],:scope[empty]>[data-table-host],:scope[loading]>[data-empty],:scope>[slot=empty]{display:none}:scope[empty]>[slot=empty]{display:block}:scope[error]>[data-empty]{--empty-state-icon-fg:var(--a-danger-strong,var(--a-danger))}:scope[density=compact]{--invoice-history-row-min-height:var(--table-row-h-compact,2.25rem)}:scope[density=comfortable]{--invoice-history-row-min-height:var(--table-row-h-comfortable,3.5rem)}}payment-method-form-ui{--payment-method-form-gap:var(--a-space-3);--payment-method-form-grid-template:\"name name\" \"card card\" \"expiry cvc\" \"country postal\";--payment-method-form-grid-template-billing:\"name name\" \"card card\" \"expiry cvc\" \"address1 address1\" \"address2 address2\" \"country postal\";--payment-method-form-brand-icon-size:1.25em;--payment-method-form-alert-mb:var(--a-space-3);--payment-method-form-summary-bg:var(--a-bg-muted);--payment-method-form-summary-border:1px solid var(--a-border);--payment-method-form-summary-radius:var(--a-radius-md);--payment-method-form-summary-px:var(--a-space-4);--payment-method-form-summary-py:var(--a-space-3);--payment-method-form-legal-fg:var(--a-fg-muted);--payment-method-form-legal-size:var(--a-text-xs,.75rem);--payment-method-form-disabled-opacity:var(--a-opacity-disabled,.5)}@scope(payment-method-form-ui){:scope{gap:var(--payment-method-form-gap);flex-direction:column;display:flex}:scope>[data-alert]{margin-block-end:var(--payment-method-form-alert-mb)}:scope>[data-alert][hidden]{display:none}:scope>[data-summary]{align-items:center;gap:var(--a-space-3);background:var(--payment-method-form-summary-bg);border:var(--payment-method-form-summary-border);border-radius:var(--payment-method-form-summary-radius);padding-inline:var(--payment-method-form-summary-px);padding-block:var(--payment-method-form-summary-py);display:flex}:scope>[data-summary][hidden]{display:none}:scope>[data-summary]>[data-summary-icon]{--a-icon-size:1.25rem;color:var(--a-fg-muted);flex-shrink:0}:scope>[data-summary]>[data-summary-text]{color:var(--a-fg);font-size:var(--a-text-sm,.875rem);flex:1}:scope>[data-summary]>[data-summary-edit]{flex-shrink:0}:scope>[data-grid]{grid-template-columns:1fr 1fr;grid-template-areas:var(--payment-method-form-grid-template);gap:var(--payment-method-form-gap);display:grid}:scope>[data-grid][hidden]{display:none}:scope[require-billing-address]>[data-grid]{grid-template-areas:var(--payment-method-form-grid-template-billing)}:scope>[data-grid]>field-ui[hidden]{display:none}:scope [data-brand-badge]{font-size:var(--payment-method-form-brand-icon-size);color:var(--a-fg-muted);letter-spacing:.025em;text-transform:uppercase;align-items:center;display:inline-flex}:scope [data-brand-badge]>[data-brand]{font-weight:var(--a-weight-semibold,600);color:var(--a-fg);font-size:var(--a-text-xs,.75rem);padding-inline:var(--a-space-2);padding-block:var(--a-space-1);border-radius:var(--a-radius-sm);background:var(--a-bg-muted)}:scope [data-brand-badge]>[data-brand=visa]{color:var(--a-info-fg,var(--a-fg))}:scope [data-brand-badge]>[data-brand=mastercard]{color:var(--a-warning-fg,var(--a-fg))}:scope [data-brand-badge]>[data-brand=amex]{color:var(--a-accent-fg,var(--a-fg))}:scope [data-brand-badge]>[data-brand=discover]{color:var(--a-success-fg,var(--a-fg))}:scope>[data-legal]{color:var(--payment-method-form-legal-fg);font-size:var(--payment-method-form-legal-size);line-height:1.5}:scope>[data-legal]:empty{display:none}:scope[disabled]{opacity:var(--payment-method-form-disabled-opacity);pointer-events:none}}payment-method-list-ui{--payment-method-list-bg:transparent;--payment-method-list-gap:var(--a-space-2);--payment-method-list-row-bg:var(--a-accent-muted);--payment-method-list-row-border:1px solid var(--a-accent);--payment-method-list-add-justify:flex-start;--payment-method-list-disabled-opacity:var(--a-opacity-disabled,.5)}@scope(payment-method-list-ui){:scope{gap:var(--a-space-4);background:var(--payment-method-list-bg);flex-direction:column;display:flex}:scope>[data-rows]{gap:var(--payment-method-list-gap);flex-direction:column;display:flex}:scope>[data-rows]>[data-row]{cursor:pointer;transition:background var(--a-duration-fast,.12s) var(--a-easing,ease), box-shadow var(--a-duration-fast,.12s) var(--a-easing,ease)}:scope>[data-rows]>[data-row]:hover{box-shadow:var(--a-shadow-sm)}:scope>[data-rows]>[data-row]:focus-visible{outline:var(--a-focus-ring,2px solid var(--a-accent));outline-offset:2px}:scope>[data-rows]>[data-row][data-default]{--card-bg:var(--payment-method-list-row-bg);--card-border:var(--payment-method-list-row-border)}:scope:not([empty])>[data-empty],:scope[empty]>[data-rows]{display:none}:scope>[data-add]{justify-content:var(--payment-method-list-add-justify);display:flex}:scope>[data-add][hidden]{display:none}:scope[disabled]{opacity:var(--payment-method-list-disabled-opacity);pointer-events:none}}plan-picker-ui{--plan-picker-bg:transparent;--plan-picker-grid-gap:var(--a-space-4);--plan-picker-grid-min:16rem;--plan-picker-card-bg:var(--a-bg);--plan-picker-card-bg-recommended:var(--a-accent-muted);--plan-picker-card-bg-current:var(--a-bg-muted);--plan-picker-card-border:1px solid var(--a-border);--plan-picker-card-border-recommended:2px solid var(--a-accent);--plan-picker-card-radius:var(--a-radius-lg);--plan-picker-card-py:var(--a-space-5);--plan-picker-card-px:var(--a-space-5);--plan-picker-card-shadow-recommended:var(--a-shadow-md);--plan-picker-price-size:var(--a-text-3xl,1.875rem);--plan-picker-price-fg:var(--a-fg-strong,var(--a-fg));--plan-picker-cycle-fg:var(--a-fg-muted);--plan-picker-features-gap:var(--a-space-2);--plan-picker-feature-icon-fg:var(--a-accent);--plan-picker-toggle-justify:center;--plan-picker-disabled-opacity:var(--a-opacity-disabled,.5)}@scope(plan-picker-ui){:scope{gap:var(--a-space-4);background:var(--plan-picker-bg);flex-direction:column;display:flex}:scope>[data-toggle]{justify-content:var(--plan-picker-toggle-justify);display:flex}:scope>[data-toggle][hidden]{display:none}:scope>[data-plans]{grid-template-columns:repeat(auto-fit, minmax(var(--plan-picker-grid-min), 1fr));gap:var(--plan-picker-grid-gap);align-items:stretch;display:grid}:scope[layout=list]>[data-plans]{grid-template-columns:1fr}:scope>[data-plans]>option-card-ui{--option-card-bg:var(--plan-picker-card-bg);--option-card-border:var(--plan-picker-card-border);--option-card-radius:var(--plan-picker-card-radius);--option-card-padding-block:var(--plan-picker-card-py);--option-card-padding-inline:var(--plan-picker-card-px);box-sizing:border-box;height:100%}:scope>[data-plans]>option-card-ui[data-recommended]{--option-card-bg:var(--plan-picker-card-bg-recommended);--option-card-border:var(--plan-picker-card-border-recommended);box-shadow:var(--plan-picker-card-shadow-recommended)}:scope>[data-plans]>option-card-ui[data-current]{--option-card-bg:var(--plan-picker-card-bg-current)}:scope>[data-plans]>option-card-ui>[data-plan-body]{gap:var(--a-space-3);flex-direction:column;flex:1;display:flex!important}:scope>[data-plans]>option-card-ui>[data-plan-tags]{align-self:start;align-items:center;gap:var(--a-space-1);display:flex}:scope>[data-plans]>option-card-ui>[data-plan-tags]:empty{display:none}:scope [data-price-row]{align-items:baseline;gap:var(--a-space-1);display:flex}:scope [data-price]{font-size:var(--plan-picker-price-size);color:var(--plan-picker-price-fg);font-weight:var(--a-weight-bold,700);line-height:1}:scope [data-cycle]{font-size:var(--a-text-sm,.875rem);color:var(--plan-picker-cycle-fg)}:scope [data-price-note]{font-size:var(--a-text-xs,.75rem);color:var(--plan-picker-cycle-fg)}:scope ul[data-features]{gap:var(--plan-picker-features-gap);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}:scope ul[data-features]>li{align-items:flex-start;gap:var(--a-space-2);color:var(--a-fg);font-size:var(--a-text-sm,.875rem);padding-inline-start:0;line-height:1.4;display:flex}:scope ul[data-features]>li>icon-ui{color:var(--plan-picker-feature-icon-fg);--a-icon-size:1rem;flex-shrink:0;margin-block-start:.125rem}:scope ul[data-features]>li:before{content:none}:scope button-ui[data-cta]{width:100%;margin-block-start:auto}:scope:not([empty])>[data-empty],:scope[empty]>[data-plans],:scope>[data-skeleton]{display:none}:scope[loading]>[data-skeleton]{grid-template-columns:repeat(auto-fit, minmax(var(--plan-picker-grid-min), 1fr));gap:var(--plan-picker-grid-gap);display:grid}:scope[loading]>[data-plans]{visibility:hidden}:scope[disabled]{opacity:var(--plan-picker-disabled-opacity);pointer-events:none}}:where(chat-shell){--chat-bg:var(--a-canvas-0);--chat-border:unset;--chat-radius:unset;--chat-header-height:var(--a-chrome-app-header-height);--chat-header-px:var(--a-space-4);--chat-header-gap:var(--a-space-2);--chat-header-border:1px solid var(--a-border-subtle);--chat-messages-px:var(--a-space-4);--chat-messages-py:var(--a-space-4);--chat-messages-gap:var(--a-space-3);--chat-message-max-width:85%;--chat-user-bg:var(--a-primary);--chat-user-fg:var(--a-primary-fg);--chat-user-radius:var(--a-radius-md);--chat-user-tail-radius:var(--a-radius-sm);--chat-user-px:var(--a-space-3);--chat-user-py:var(--a-space-1);--chat-assistant-bg:var(--a-canvas-2);--chat-assistant-fg:var(--a-fg);--chat-assistant-radius:var(--a-radius-lg);--chat-assistant-tail-radius:var(--a-radius-sm);--chat-assistant-px:var(--a-space-3);--chat-assistant-py:var(--a-space-1);--chat-avatar-size:1.75rem;--chat-avatar-bg:var(--chat-assistant-bg);--chat-avatar-fg:var(--chat-assistant-fg);--chat-avatar-font:var(--a-ui-sm);--chat-avatar-weight:var(--a-weight-semibold);--chat-cursor-width:2px;--chat-cursor-color:currentColor;--chat-cursor-speed:.8s;--chat-footer-px:var(--a-space-3);--chat-footer-py:var(--a-space-3);--chat-actions-gap:var(--a-space-1);--chat-code-bg:var(--a-canvas-2);--chat-code-radius:var(--a-radius-md);--chat-font-size:var(--a-ui-size);--chat-line-height:var(--a-leading-normal);--chat-weight-semibold:var(--a-weight-semibold);--chat-header-name-font:var(--a-ui-lg);--chat-header-status-font:var(--a-ui-md);--chat-header-status-fg:var(--a-fg-muted);--chat-error-gap:var(--a-space-2);--chat-error-fg:var(--a-danger-strong);--chat-error-font:var(--a-ui-sm);--chat-actions-duration:var(--a-duration-fast);--chat-actions-easing:var(--a-easing);--chat-avatar-radius:var(--a-radius-full);--chat-thinking-fg:var(--a-fg-muted);--chat-code-inline-radius:var(--a-radius-sm);--chat-code-inline-family:var(--a-font-family-code);--chat-code-block-px:var(--a-space-3);--chat-code-block-my:var(--a-space-2);--chat-code-block-font:var(--a-ui-sm)}chat-shell{box-sizing:border-box;border:var(--chat-border);border-radius:var(--chat-radius);background:var(--chat-bg);flex-direction:column;height:100%;display:flex;overflow:hidden}chat-shell>header{align-items:center;gap:var(--chat-header-gap);min-height:var(--chat-header-height);padding:0 var(--chat-header-px);border-bottom:var(--chat-header-border);flex-shrink:0;display:flex}chat-shell>header [data-chat-name]{font-weight:var(--chat-weight-semibold);font-size:var(--chat-header-name-font)}chat-shell>header chat-status{font-size:var(--chat-header-status-font);color:var(--chat-header-status-fg);margin-inline-start:auto}chat-shell>chat-thread,chat-shell>section{padding:var(--chat-messages-py) var(--chat-messages-px);gap:var(--chat-messages-gap);flex-direction:column;flex:1;min-height:0;display:flex;overflow-y:auto}chat-shell>footer{padding:var(--chat-footer-py) var(--chat-footer-px);flex-shrink:0;align-items:center;display:flex}chat-shell>footer chat-input-ui{flex:1}chat-shell [data-role]{gap:var(--chat-header-gap);max-width:var(--chat-message-max-width);align-items:flex-end;display:flex}chat-shell [data-role=user]{flex-direction:row-reverse;align-self:flex-end}chat-shell [data-role=assistant]{align-self:flex-start}chat-shell [data-role] [data-avatar]{width:var(--chat-avatar-size);height:var(--chat-avatar-size);border-radius:var(--chat-avatar-radius);background:var(--chat-avatar-bg);color:var(--chat-avatar-fg);font-size:var(--chat-avatar-font);font-weight:var(--chat-avatar-weight);flex-shrink:0;justify-content:center;align-items:center;display:flex}chat-shell [data-role] [data-bubble]{padding:var(--chat-assistant-py) var(--chat-assistant-px);border-radius:var(--chat-assistant-radius);font-size:var(--chat-font-size);line-height:var(--chat-line-height);white-space:pre-wrap;word-break:break-word}chat-shell [data-role] [data-bubble]>:first-child{margin-block-start:0}chat-shell [data-role] [data-bubble]>:last-child{margin-block-end:0}chat-shell [data-role=user] [data-bubble]{background:var(--chat-user-bg);color:var(--chat-user-fg);padding:var(--chat-user-py) var(--chat-user-px);border-radius:var(--chat-user-radius);border-bottom-right-radius:var(--chat-user-tail-radius)}chat-shell [data-role=assistant] [data-bubble]{background:var(--chat-assistant-bg);color:var(--chat-assistant-fg);border-bottom-left-radius:var(--chat-assistant-tail-radius)}chat-shell [data-role=error]{align-self:center;align-items:center;gap:var(--chat-error-gap);max-width:none;color:var(--chat-error-fg);font-size:var(--chat-error-font);display:flex}chat-shell [data-role] [data-actions]{gap:var(--chat-actions-gap);opacity:0;transition:opacity var(--chat-actions-duration) var(--chat-actions-easing);display:flex}chat-shell [data-role]:hover [data-actions]{opacity:1}chat-shell [data-cursor]{width:var(--chat-cursor-width);background:var(--chat-cursor-color);vertical-align:text-bottom;height:1em;animation:chat-shell-blink var(--chat-cursor-speed) step-end infinite;margin-inline-start:1px;display:inline-block}@keyframes chat-shell-blink{50%{opacity:0}}@media (prefers-reduced-motion:reduce){chat-shell [data-cursor]{opacity:.7;animation:none}}chat-shell [data-role=assistant][data-thinking] [data-bubble]{color:var(--chat-thinking-fg)}chat-shell [data-bubble] [data-content]{white-space:normal}chat-shell [data-bubble] [data-content] p{margin:0 0 .5em}chat-shell [data-bubble] [data-content] p:last-child{margin-bottom:0}chat-shell [data-bubble] [data-content] strong{font-weight:var(--chat-weight-semibold)}chat-shell [data-bubble] [data-content] code{background:var(--chat-code-bg);border-radius:var(--chat-code-inline-radius);font-family:var(--chat-code-inline-family);padding:.1em .15em;font-size:.875em}chat-shell [data-bubble] [data-content] pre{background:var(--chat-code-bg);border-radius:var(--chat-code-radius);padding:var(--chat-code-block-px);margin:var(--chat-code-block-my) 0;font-size:var(--chat-code-block-font);line-height:1.5;overflow-x:auto}chat-shell [data-bubble] [data-content] pre code{font-size:inherit;background:0 0;border-radius:0;padding:0}chat-shell [data-bubble] [data-content] ul,chat-shell [data-bubble] [data-content] ol{margin:.25em 0;padding-inline-start:1.25em}chat-shell [data-bubble] [data-content] li{margin-bottom:.15em}chat-shell [data-bubble] [data-content] a{color:inherit;text-underline-offset:2px;text-decoration:underline}chat-shell [data-bubble] [data-content] h1,chat-shell [data-bubble] [data-content] h2,chat-shell [data-bubble] [data-content] h3,chat-shell [data-bubble] [data-content] h4{font-weight:var(--chat-weight-semibold);margin:.75em 0 .25em}chat-shell [data-bubble] [data-content] h1:first-child,chat-shell [data-bubble] [data-content] h2:first-child,chat-shell [data-bubble] [data-content] h3:first-child{margin-top:0}chat-shell chat-empty{margin:auto}chat-shell[streaming] chat-empty,chat-shell:has([data-role]) chat-empty{display:none}chat-shell>chat-header,chat-sidebar>chat-header[slot=header],chat-sidebar>chat-header:first-child{align-items:center;gap:var(--chat-header-gap,var(--a-space-2));padding:0 var(--chat-header-px,var(--a-space-3));height:var(--chat-header-height,var(--a-size-lg));font-size:var(--chat-header-font,var(--a-ui-size));border-bottom:var(--chat-border,1px solid var(--a-border-subtle));background:var(--chat-bg,var(--a-bg));flex-shrink:0;display:flex}chat-header>[slot=name]{font-weight:var(--a-weight-medium,500);color:var(--a-fg)}chat-header>[slot=status]{margin-inline-start:var(--a-space-2)}chat-header>[slot=action]:first-of-type{margin-inline-start:auto}chat-header>[slot=action-leading]{margin-inline-end:var(--a-space-2)}chat-status{align-items:center;gap:var(--a-space-1);font-size:var(--a-ui-sm);color:var(--a-fg-muted);display:inline-flex}chat-shell>chat-thread{overscroll-behavior:contain;gap:var(--chat-message-gap,var(--a-space-3));min-height:0;padding:var(--chat-thread-py,var(--a-space-4)) var(--chat-thread-px,var(--a-space-4));background:var(--chat-thread-bg,var(--a-bg));flex-direction:column;flex:1;display:flex;overflow-y:auto}chat-thread:not([empty])>chat-empty{display:none}chat-thread[empty]>chat-empty{padding:var(--a-space-6);flex:1;justify-content:center;align-items:center;display:flex}chat-shell>chat-composer{align-items:stretch;gap:var(--a-space-2);padding:var(--chat-composer-py,var(--a-space-3)) var(--chat-composer-px,var(--a-space-3));border-top:var(--chat-border,1px solid var(--a-border-subtle));background:var(--chat-bg,var(--a-bg));flex-shrink:0;display:flex}chat-composer>[slot=leading],chat-composer>[slot=attach],chat-composer>[slot=trailing]{align-items:center;gap:var(--a-space-1);flex-shrink:0;display:inline-flex}chat-composer>:is(chat-input-ui,input-ui,textarea-ui){flex:1;min-width:0}chat-composer[disabled]{opacity:.6;pointer-events:none}:is(chat-sidebar[slot=leading],chat-sidebar[slot=trailing]){min-width:var(--chat-sidebar-min-width,48px);max-width:var(--chat-sidebar-max-width,480px);min-height:0;font-size:var(--chat-sidebar-font,var(--a-ui-size));transition:width var(--chat-duration,var(--a-duration,.2s)) var(--chat-easing,var(--a-easing,ease));background:var(--chat-bg,var(--a-bg));flex-direction:column;flex-shrink:0;display:flex;position:relative;container:sidebar/inline-size}chat-sidebar[slot=leading]{width:var(--chat-sidebar-width-leading,240px);border-right:var(--chat-border,1px solid var(--a-border-subtle))}chat-sidebar[slot=trailing]{width:var(--chat-sidebar-width-trailing,320px);border-left:var(--chat-border,1px solid var(--a-border-subtle))}:is(chat-sidebar[slot=leading],chat-sidebar[slot=trailing])>[data-resize]{cursor:col-resize;z-index:1;-webkit-user-select:none;user-select:none;width:6px;position:absolute;top:0;bottom:0}chat-sidebar[slot=leading]>[data-resize]{right:-3px}chat-sidebar[slot=trailing]>[data-resize]{left:-3px}:is(chat-sidebar[slot=leading],chat-sidebar[slot=trailing])>[data-resize]:hover{background:var(--a-accent);opacity:.5}chat-sidebar[resizing]{transition:none}chat-sidebar[resizing]>[data-resize]{background:var(--a-accent);opacity:.8}chat-shell:has(>chat-sidebar){flex-direction:row;display:flex}chat-shell:has(>chat-sidebar)>:not(chat-sidebar){display:contents}dashboard-layout-ui{--dashboard-layout-gap:var(--a-space-4);--dashboard-layout-kpi-gap:var(--a-space-2);--dashboard-layout-chart-gap:var(--a-space-4);--dashboard-layout-aside-width:20em;--dashboard-layout-padding:0;--dashboard-layout-loading-opacity:var(--a-opacity-disabled,.6);--dashboard-layout-gap-compact:var(--a-space-3);--dashboard-layout-kpi-gap-compact:var(--a-space-2);--dashboard-layout-gap-spacious:var(--a-space-5);--dashboard-layout-kpi-gap-spacious:var(--a-space-3)}@scope(dashboard-layout-ui){:scope{gap:var(--dashboard-layout-gap);padding:var(--dashboard-layout-padding);grid-template-columns:1fr;grid-template-areas:\"toolbar\"\"kpis\"\"charts\"\"table\";grid-auto-rows:auto;display:grid;container:dashboard-layout/inline-size}:scope>[slot=toolbar]{grid-area:toolbar}:scope>[slot=kpis]{grid-area:kpis}:scope>[slot=charts]{grid-area:charts}:scope>[slot=table]{grid-area:table}:scope>[slot=aside]{grid-area:aside}:scope>[slot=kpis]{grid-template-columns:repeat(var(--dashboard-layout-kpi-cols,4), 1fr);gap:var(--dashboard-layout-kpi-gap);display:grid}:scope[kpi-columns=\"2\"]>[slot=kpis]{--dashboard-layout-kpi-cols:2}:scope[kpi-columns=\"3\"]>[slot=kpis]{--dashboard-layout-kpi-cols:3}:scope[kpi-columns=\"4\"]>[slot=kpis]{--dashboard-layout-kpi-cols:4}:scope[kpi-columns=\"5\"]>[slot=kpis]{--dashboard-layout-kpi-cols:5}:scope[kpi-columns=\"6\"]>[slot=kpis]{--dashboard-layout-kpi-cols:6}:scope>[slot=charts]{gap:var(--dashboard-layout-chart-gap);grid-template-columns:1fr;display:grid}:scope[chart-split=\"2\"]>[slot=charts]{grid-template-columns:1fr 1fr}:scope[chart-split=\"2:1\"]>[slot=charts]{grid-template-columns:2fr 1fr}:scope[chart-split=\"3:2\"]>[slot=charts]{grid-template-columns:3fr 2fr}:scope[chart-split=\"3:1\"]>[slot=charts]{grid-template-columns:3fr 1fr}:scope:has(>[slot=aside]){grid-template-columns:1fr var(--dashboard-layout-aside-width);grid-template-areas:\"toolbar toolbar\"\"kpis aside\"\"charts aside\"\"table aside\"}:scope>[slot=aside]{top:var(--a-space-4);align-self:start;position:sticky}:scope[density=comfortable]{--a-density:1}:scope[density=compact]{--dashboard-layout-gap:var(--dashboard-layout-gap-compact);--dashboard-layout-kpi-gap:var(--dashboard-layout-kpi-gap-compact);--a-density:.85}:scope[density=spacious]{--dashboard-layout-gap:var(--dashboard-layout-gap-spacious);--dashboard-layout-kpi-gap:var(--dashboard-layout-kpi-gap-spacious);--a-density:1.15}:scope[loading]>[slot]{opacity:var(--dashboard-layout-loading-opacity);pointer-events:none}@container dashboard-layout (inline-size<44em){:scope[kpi-columns=\"5\"]>[slot=kpis],:scope[kpi-columns=\"6\"]>[slot=kpis]{--dashboard-layout-kpi-cols:3}}@container dashboard-layout (inline-size<40em){:scope[chart-split=\"2\"]>[slot=charts],:scope[chart-split=\"2:1\"]>[slot=charts],:scope[chart-split=\"3:2\"]>[slot=charts],:scope[chart-split=\"3:1\"]>[slot=charts]{grid-template-columns:1fr}}@container dashboard-layout (inline-size<32em){:scope[kpi-columns=\"3\"]>[slot=kpis],:scope[kpi-columns=\"4\"]>[slot=kpis],:scope[kpi-columns=\"5\"]>[slot=kpis],:scope[kpi-columns=\"6\"]>[slot=kpis]{--dashboard-layout-kpi-cols:2}}@container dashboard-layout (inline-size<20em){:scope[kpi-columns=\"2\"]>[slot=kpis],:scope[kpi-columns=\"3\"]>[slot=kpis],:scope[kpi-columns=\"4\"]>[slot=kpis],:scope[kpi-columns=\"5\"]>[slot=kpis],:scope[kpi-columns=\"6\"]>[slot=kpis]{--dashboard-layout-kpi-cols:1}}}date-range-selector-ui{--date-range-selector-gap:var(--a-space-3);--date-range-selector-readout-size:var(--a-font-size-sm);--date-range-selector-readout-fg:var(--a-fg-muted);--date-range-selector-picker-trigger-py:var(--a-space-2);--date-range-selector-disabled-opacity:var(--a-opacity-disabled,.5)}@scope(date-range-selector-ui){:scope{align-items:center;gap:var(--date-range-selector-gap);color:var(--date-range-selector-readout-fg);font-size:var(--date-range-selector-readout-size);display:inline-flex}:scope>[slot=prefix]{order:0}:scope>[data-region=chips]{order:1}:scope>[data-region=picker]{order:2}:scope>[data-region=readout]{order:3}:scope>[slot=suffix]{order:4}:scope:not([value=custom])>[data-region=picker]{display:none}:scope>[data-region=picker]{--date-range-picker-py:var(--date-range-selector-picker-trigger-py)}:scope:not([value=custom])>[data-region=readout]{display:none}:scope>[data-region=readout]{color:var(--date-range-selector-readout-fg);font-size:var(--date-range-selector-readout-size);white-space:nowrap}:scope[disabled]{opacity:var(--date-range-selector-disabled-opacity);pointer-events:none}:scope>[slot=prefix],:scope>[slot=suffix]{align-items:center;gap:var(--a-space-2);display:inline-flex}}:where(editor-shell){--editor-bg:var(--a-canvas-0);--editor-border:1px solid var(--a-border-subtle);--editor-panel-bg:var(--a-canvas-2);--editor-bar-height:var(--a-chrome-pane-header-height);--editor-bar-px:var(--a-space-3);--editor-bar-gap:var(--a-space-2);--editor-bar-font:var(--a-ui-size);--editor-bar-fg:var(--a-fg-subtle);--editor-bar-fg-strong:var(--a-fg);--editor-canvas-bg:var(--a-canvas-1);--editor-canvas-fg:var(--a-fg-muted);--editor-canvas-toolbar-bg:var(--editor-panel-bg);--editor-canvas-toolbar-px:var(--a-space-3);--editor-canvas-toolbar-gap:var(--a-space-2);--editor-title-weight:var(--a-weight-medium);--editor-pane-width-left:240px;--editor-pane-width-right:280px}editor-shell{box-sizing:border-box;background:var(--editor-bg);flex-direction:column;height:100%;display:flex;overflow:hidden}editor-shell editor-canvas{background:var(--editor-canvas-bg);min-width:0;color:var(--editor-canvas-fg);flex:1;justify-content:flex-start;align-items:stretch;display:flex}editor-shell pane-ui{--pane-radius:0;--pane-bg:var(--editor-panel-bg);flex-shrink:0;height:100%}editor-shell editor-sidebar[slot=leading]>pane-ui{width:var(--editor-pane-width-left)}editor-shell editor-sidebar[slot=trailing]>pane-ui{width:var(--editor-pane-width-right)}editor-shell>editor-toolbar{box-sizing:border-box;align-items:center;gap:var(--editor-toolbar-gap,var(--a-space-2));padding:0 var(--editor-toolbar-px,var(--a-space-3));height:var(--editor-toolbar-height,var(--a-size-lg));font-size:var(--editor-toolbar-font,var(--a-ui-size));box-shadow:inset 0 -1px 0 var(--a-border-subtle);background:var(--editor-panel-bg,var(--a-bg));flex-shrink:0;grid-area:toolbar;display:flex}editor-toolbar>[slot=title]{font-weight:var(--a-weight-medium,500);color:var(--a-fg)}editor-toolbar>[slot=action-leading]{margin-inline-end:var(--a-space-2)}editor-toolbar>[slot=status]{color:var(--a-fg-muted);margin-inline-start:var(--a-space-2)}editor-toolbar>[slot=action]{margin-inline-start:auto}editor-toolbar>[slot=action]~[slot=action]{margin-inline-start:var(--a-space-2)}editor-shell>editor-canvas{background:var(--editor-canvas-bg,var(--a-bg-subtle));flex-direction:column;flex:1;grid-area:canvas;justify-content:flex-start;align-items:stretch;min-width:0;min-height:0;display:flex;position:relative;overflow:auto}editor-canvas>*{transform:scale(var(--editor-canvas-zoom,1));transform-origin:0 0}editor-canvas-toolbar{align-items:center;gap:var(--editor-canvas-toolbar-gap,var(--a-space-2));padding:0 var(--editor-canvas-toolbar-px,var(--a-space-3));box-shadow:inset 0 -1px 0 var(--a-border-subtle);background:var(--editor-canvas-toolbar-bg,var(--editor-panel-bg,var(--a-bg)));z-index:1;flex-shrink:0;display:flex;position:sticky;top:0;transform:none}editor-canvas-toolbar>[slot=title]{font-weight:var(--a-weight-medium,500);color:var(--a-fg)}editor-canvas-toolbar>[slot=action-leading]{align-items:center;gap:var(--editor-canvas-toolbar-gap,var(--a-space-2));flex-shrink:0;margin-inline-end:var(--a-space-2);display:flex}editor-canvas-toolbar>[slot=action]{align-items:center;gap:var(--editor-canvas-toolbar-gap,var(--a-space-2));flex-shrink:0;margin-inline-start:auto;display:flex}editor-canvas-toolbar>[slot=action]~[slot=action]{margin-inline-start:var(--editor-canvas-toolbar-gap,var(--a-space-2))}editor-canvas:not([empty])>editor-canvas-empty{display:none}editor-canvas[empty]>editor-canvas-empty{padding:var(--a-space-6);flex:1;justify-content:center;align-items:center;display:flex}:is(editor-sidebar[slot=leading],editor-sidebar[slot=trailing]){flex-direction:column;flex-shrink:0;min-height:0;display:flex;position:relative}editor-sidebar[slot=leading]{border-right:var(--editor-border,1px solid var(--a-border-subtle));grid-area:leading}editor-sidebar[slot=trailing]{border-left:var(--editor-border,1px solid var(--a-border-subtle));grid-area:trailing}editor-sidebar>pane-ui{flex-direction:column;flex:1;min-height:0;display:flex}editor-sidebar{transition:width var(--editor-sidebar-duration,var(--a-duration,.18s)) var(--editor-sidebar-easing,var(--a-easing,ease));container:editor-sidebar/inline-size}editor-sidebar>pane-ui{transition:width var(--editor-sidebar-duration,var(--a-duration,.18s)) var(--editor-sidebar-easing,var(--a-easing,ease))}editor-sidebar[collapsed]>pane-ui{min-width:var(--editor-sidebar-collapsed-width,48px);overflow:hidden;width:var(--editor-sidebar-collapsed-width,48px)!important}editor-sidebar[collapsed]>pane-ui>section,editor-sidebar[collapsed]>pane-ui>footer{display:none}editor-sidebar[collapsed]>pane-ui>header{justify-content:flex-start;align-items:center;gap:var(--a-space-1);padding:var(--a-space-2) 0;flex-direction:column;display:flex}editor-sidebar[collapsed]>pane-ui>header :is(span:not([data-icon]):not([slot]),label,h1,h2,h3){display:none}editor-sidebar[collapsed]{background:var(--editor-sidebar-rail-bg,var(--a-bg-subtle,var(--a-bg)))}editor-sidebar:is([resizing],:has(pane-ui[data-resizing])),editor-sidebar:is([resizing],:has(pane-ui[data-resizing]))>pane-ui{transition:none}editor-shell>editor-statusbar{box-sizing:border-box;align-items:center;gap:var(--editor-statusbar-gap,var(--a-space-2));padding:0 var(--editor-statusbar-px,var(--a-space-3));height:var(--editor-statusbar-height,var(--a-size-md));font-size:var(--editor-statusbar-font,var(--a-ui-sm));box-shadow:inset 0 1px 0 var(--a-border-subtle);background:var(--editor-panel-bg,var(--a-bg));color:var(--a-fg-muted);flex-shrink:0;grid-area:statusbar;display:flex}editor-statusbar>[slot=cursor],editor-statusbar>[slot=zoom]{font-family:var(--a-font-family-mono);margin-inline-start:var(--a-space-2)}editor-statusbar>[slot=action]{margin-inline-start:auto}editor-statusbar>[slot=action]~[slot=action]{margin-inline-start:var(--a-space-2)}editor-shell:has(>editor-canvas){grid-template:\"toolbar toolbar toolbar\"\"leading canvas trailing\"1fr\"statusbar statusbar statusbar\"/auto 1fr auto;height:100%;display:grid}confirm-dialog-ui{--confirm-dialog-icon-bg:var(--a-bg-muted);--confirm-dialog-icon-fg:var(--a-fg);--confirm-dialog-confirm-bg:var(--a-accent-bg);--confirm-dialog-header-gap:var(--a-space-3);--confirm-dialog-body-gap:var(--a-space-3);--confirm-dialog-footer-gap:var(--a-space-2);--confirm-dialog-icon-size:var(--a-space-7)}@scope(confirm-dialog-ui){:scope{display:contents}:scope>modal-ui{--modal-pad-body:var(--a-space-4)}:scope header[slot=header]{column-gap:var(--confirm-dialog-header-gap);row-gap:var(--a-space-1);grid-template-columns:auto 1fr auto;align-items:center;display:grid}:scope header[slot=header]>[slot=close]{grid-area:1/3;place-self:start end}:scope header[slot=header]>[slot=icon]{inline-size:var(--confirm-dialog-icon-size);block-size:var(--confirm-dialog-icon-size);--a-icon-size:calc(var(--confirm-dialog-icon-size) - var(--a-space-2));box-sizing:border-box;background:var(--confirm-dialog-icon-bg);color:var(--confirm-dialog-icon-fg);border-radius:50%;flex-shrink:0;grid-area:1/1;justify-content:center;align-items:center;display:inline-flex}:scope header[slot=header]>[slot=heading]{font-weight:var(--a-weight-semibold);color:var(--a-fg);grid-column:2}:scope [slot=body] [slot=description]{color:var(--a-fg-muted);line-height:var(--a-line-height-prose,1.5);margin:0}:scope [slot=body] [slot=description][hidden]{display:none}:scope [slot=body]{gap:var(--confirm-dialog-body-gap);flex-direction:column;display:flex}:scope [slot=body]>[data-extra]{display:contents}:scope [slot=footer]{justify-content:flex-end;align-items:center;gap:var(--confirm-dialog-footer-gap);display:flex}:scope [data-confirm-action=confirm]{--button-background:var(--confirm-dialog-confirm-bg)}:scope[confirm-variant=ghost] [data-confirm-action=confirm]{--button-background:transparent;--button-foreground:var(--a-fg)}:scope[loading] [data-confirm-action=cancel],:scope[loading] [data-confirm-action=confirm]{pointer-events:none;opacity:var(--a-opacity-disabled,.6)}}@scope(onboarding-checklist-ui){:where(:scope){--onboarding-checklist-bg:var(--a-canvas-1);--onboarding-checklist-fg:var(--a-fg);--onboarding-checklist-fg-muted:var(--a-fg-muted);--onboarding-checklist-radius:var(--a-radius-lg);--onboarding-checklist-px:var(--a-space-4);--onboarding-checklist-py:var(--a-space-4);--onboarding-checklist-gap:var(--a-space-3);--onboarding-checklist-progress-fill:var(--a-accent);--onboarding-checklist-shadow:var(--a-shadow-sm);--onboarding-checklist-border:1px solid var(--a-border-subtle)}:scope{box-sizing:border-box;padding:var(--onboarding-checklist-py) var(--onboarding-checklist-px);background:var(--onboarding-checklist-bg);color:var(--onboarding-checklist-fg);border-radius:var(--onboarding-checklist-radius);border:var(--onboarding-checklist-border);box-shadow:var(--onboarding-checklist-shadow);display:block}:scope[hidden]{display:none}:scope>[data-part=header]{justify-content:space-between;align-items:center;gap:var(--a-space-2);margin-block-end:var(--onboarding-checklist-gap);display:flex}:scope>[data-part=header]>[data-part=title]{min-width:0;font-weight:var(--a-weight-medium);color:var(--onboarding-checklist-fg);flex:1}:scope>[data-part=header]>[data-part=collapse-toggle]{box-sizing:border-box;padding:var(--a-space-1);border-radius:var(--a-radius-md);color:var(--onboarding-checklist-fg-muted);cursor:pointer;font:inherit;font-family:var(--onboarding-checklist-font-family,var(--a-font-family-ui));appearance:none;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;margin:0;display:inline-flex}:scope>[data-part=header]>[data-part=collapse-toggle]:hover{background:var(--a-bg-muted);color:var(--onboarding-checklist-fg)}:scope>[data-part=header]>[data-part=collapse-toggle]:focus-visible{box-shadow:var(--a-focus-ring);outline:none}:scope>[data-part=progress]{--progress-fill:var(--onboarding-checklist-progress-fill);margin-block-end:var(--onboarding-checklist-gap);display:block}:scope>[data-part=meter]{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}:scope>[data-part=items]{gap:var(--a-space-2);flex-direction:column;margin:0;display:flex}:scope [data-part=complete]{color:var(--onboarding-checklist-fg-muted);margin-block-start:var(--onboarding-checklist-gap)}:scope>[data-part=footer]{margin-block-start:var(--onboarding-checklist-gap)}:scope>[data-part=footer]:empty,:scope[collapsed]>[data-part=items],:scope[collapsed]>[data-part=footer],:scope[collapsed] [data-part=complete]{display:none}:scope [data-item-id][data-done=true] [slot=description]{color:var(--onboarding-checklist-fg-muted);text-decoration:line-through;-webkit-text-decoration-color:var(--a-border-subtle);text-decoration-color:var(--a-border-subtle)}}@scope(gen-root){:scope{box-sizing:border-box;background:var(--chat-bg,var(--a-canvas-0));height:100%;min-height:0;font-family:var(--a-font-family);grid-template-columns:1fr;display:grid;overflow:hidden}:scope[mode=chat]{grid-template-columns:1fr}:scope[mode=chat]>canvas-ui{display:none}:scope[mode=split]{grid-template-columns:minmax(320px,1fr) 1.5fr}:scope[mode=split]>chat-ui{border-right:var(--a-border-thin) solid var(--a-canvas-border-subtle)}:scope[mode=canvas]{grid-template-columns:1fr}:scope[mode=canvas]>chat-ui,:scope>inspector-ui{display:none}:scope[inspector]>inspector-ui{border-left:var(--a-border-thin) solid var(--a-canvas-border-subtle);display:flex}:scope[mode=split][inspector]{grid-template-columns:minmax(320px,1fr) 1.5fr 1fr}:scope>chat-ui,:scope>canvas-ui,:scope>inspector-ui{min-width:0;min-height:0}}@scope(integrations-page-ui){:where(:scope){--integrations-page-bg:var(--a-bg);--integrations-page-fg:var(--a-fg);--integrations-page-fg-muted:var(--a-fg-muted);--integrations-page-px:var(--a-space-5);--integrations-page-py:var(--a-space-5);--integrations-page-gap:var(--a-space-5);--integrations-page-section-gap:var(--a-space-6);--integrations-page-card-gap:var(--a-space-4);--integrations-page-grid-min:var(--a-space-12);--integrations-page-section-heading-fg:var(--a-fg-strong);--integrations-page-section-heading-size:var(--a-ui-sm);--integrations-page-section-heading-weight:var(--a-weight-medium)}:scope{box-sizing:border-box;gap:var(--integrations-page-gap);padding:var(--integrations-page-py) var(--integrations-page-px);background:var(--integrations-page-bg);color:var(--integrations-page-fg);width:100%;min-width:0;display:grid}:scope>[data-part=header]{justify-content:space-between;align-items:baseline;gap:var(--a-space-3);flex-wrap:wrap;display:flex}:scope>[data-part=header]>[data-part=title]{font-size:var(--a-text-lg);font-weight:var(--a-weight-medium);color:var(--integrations-page-section-heading-fg);margin:0}:scope>[data-part=toolbar]{justify-content:space-between;align-items:center;gap:var(--a-space-3);flex-wrap:wrap;display:flex}:scope>[data-part=toolbar]>[data-part=search]{flex:auto;min-width:0;max-width:100%}:scope>[data-part=toolbar]>[data-part=filter]{flex:none}:scope [data-part=sections]{gap:var(--integrations-page-section-gap);display:grid}:scope [data-part=section]{gap:var(--integrations-page-card-gap);display:grid}:scope [data-part=section-heading]{color:var(--integrations-page-section-heading-fg);font-size:var(--integrations-page-section-heading-size);font-weight:var(--integrations-page-section-heading-weight);text-transform:uppercase;letter-spacing:.04em}:scope[group-by=none] [data-part=section-heading]{display:none}:scope [data-part=skeleton]{display:block}:scope [data-part=skeleton-tile]{min-height:var(--a-space-12);border:1px solid var(--a-border-subtle);border-radius:var(--a-radius-md);background:linear-gradient(90deg, var(--a-bg-muted) 0%, var(--a-bg) 50%, var(--a-bg-muted) 100%);background-size:200% 100%;animation:1.4s ease-in-out infinite integrations-page-shimmer;display:block}@keyframes integrations-page-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}:scope[loading] integration-card-ui{opacity:.5;pointer-events:none}:scope [data-part=empty]{gap:var(--a-space-2);text-align:center;padding:var(--a-space-6) var(--a-space-4);border:1px dashed var(--a-border-subtle);border-radius:var(--a-radius-md);background:var(--a-bg-muted);color:var(--integrations-page-fg-muted);place-items:center;display:grid}:scope [data-part=empty] [data-part=empty-heading]{color:var(--integrations-page-fg)}@media (width<=480px){:scope>[data-part=toolbar]{flex-direction:column;align-items:stretch}:scope>[data-part=toolbar]>[data-part=filter]{width:100%;overflow-x:auto}}}notification-preferences-ui{--notification-preferences-bg:var(--a-bg);--notification-preferences-row-bg:var(--a-bg-muted);--notification-preferences-px:var(--a-space-5);--notification-preferences-py:var(--a-space-5);--notification-preferences-row-py:var(--a-space-3);--notification-preferences-row-px:var(--a-space-3);--notification-preferences-channel-width:var(--a-space-9);--notification-preferences-row-label-min:12rem;--notification-preferences-border:var(--a-border-subtle);--notification-preferences-radius:var(--a-radius-md);--notification-preferences-group-fg:var(--a-fg-muted);--notification-preferences-disabled-opacity:var(--a-opacity-disabled,.5)}@scope(notification-preferences-ui){:scope{gap:var(--a-space-4);padding:var(--notification-preferences-py) var(--notification-preferences-px);background:var(--notification-preferences-bg);border:1px solid var(--notification-preferences-border);border-radius:var(--notification-preferences-radius);flex-direction:column;display:flex}:scope>[data-part=header]{gap:var(--a-space-2);flex-direction:column;display:flex}:scope>[data-part=header]:empty{display:none}:scope>[data-part=footer]{gap:var(--a-space-2);flex-direction:column;display:flex}:scope>[data-part=footer]:empty{display:none}:scope [data-part=matrix]{flex-direction:column;display:flex}:scope [role=row],:scope [data-part=header-row]{grid-template-columns:minmax(var(--notification-preferences-row-label-min), 1fr) var(--np-columns,repeat(3, minmax(var(--notification-preferences-channel-width), auto)));align-items:center;gap:var(--a-space-2);padding:var(--notification-preferences-row-py) var(--notification-preferences-row-px);border-bottom:1px solid var(--notification-preferences-border);display:grid}:scope [data-part=header-row]{background:0 0}:scope [data-part=body] [role=row]:nth-child(2n){background:var(--notification-preferences-row-bg)}:scope [data-part=body] [role=row]:last-child{border-bottom:0}:scope [role=columnheader]{justify-content:center;align-items:center;gap:var(--a-space-1);min-width:var(--notification-preferences-channel-width);color:var(--a-fg-muted);font-size:var(--a-text-xs,.75rem);font-weight:var(--a-weight-medium,500);letter-spacing:.06em;text-transform:uppercase;flex-direction:column;display:flex}:scope [role=columnheader][data-row-label]{text-align:start;flex-direction:row;justify-content:flex-start;align-items:flex-start}:scope [role=columnheader]>icon-ui{--a-icon-size:1rem;color:var(--a-fg-muted)}:scope [role=columnheader]>[data-channel-label]{display:block}:scope [role=columnheader]>switch-ui{margin-block-start:var(--a-space-1)}:scope [role=rowheader]{gap:var(--a-space-1);flex-direction:column;align-items:flex-start;min-width:0;display:flex}:scope [role=rowheader]>[data-row-label-text]{color:var(--a-fg);font-weight:var(--a-weight-medium,500);font-size:var(--a-text-sm,.875rem)}:scope [role=rowheader]>[data-row-description]{color:var(--a-fg-muted);font-size:var(--a-text-xs,.75rem);line-height:1.4}:scope [role=cell]{min-width:var(--notification-preferences-channel-width);justify-content:center;align-items:center;display:flex}:scope [data-part=group-heading]{padding:var(--a-space-3) var(--notification-preferences-row-px) var(--a-space-2);color:var(--notification-preferences-group-fg);font-size:var(--a-text-xs,.75rem);font-weight:var(--a-weight-medium,500);letter-spacing:.06em;text-transform:uppercase}:scope [data-part=group-heading]:first-child{padding-block-start:0}:scope>[data-part=empty]{display:none}:scope[empty]>[data-part=empty]{display:block}:scope[empty]>[data-part=matrix]{display:none}:scope[loading] [role=cell],:scope[loading] [role=columnheader]>switch-ui{opacity:.4;pointer-events:none}:scope[disabled]{opacity:var(--notification-preferences-disabled-opacity)}:scope[disabled] check-ui,:scope[disabled] switch-ui{pointer-events:none}}admin-command dialog{background:0 0;border:none;max-width:none;max-height:none;margin:0;padding:0;position:fixed;top:20vh;left:50%;overflow:visible;transform:translate(-50%)}admin-command dialog command-ui{width:32rem;height:24rem}admin-command dialog::backdrop{background:#00000080}:where(admin-shell){--page-bg:var(--a-canvas-1);--page-border:1px solid var(--a-border-subtle);--page-main-border:var(--page-border);--page-header-height:var(--a-chrome-app-header-height);--page-header-px:var(--a-space-3);--page-header-gap:var(--a-space-3);--page-header-font:var(--a-ui-size);--page-header-fg-muted:var(--a-fg-muted);--page-sidebar-px:var(--a-space-1);--page-sidebar-gap:var(--a-space-1);--page-sidebar-font:var(--a-ui-size);--page-sidebar-min-width:48px;--page-sidebar-max-width:480px;--page-sidebar-resize-accent:var(--a-accent);--page-sidebar-divider-bg:var(--a-border-subtle);--page-sidebar-width-leading:clamp(var(--page-sidebar-min-width), 200px, 240px);--page-sidebar-width-trailing:clamp(var(--page-sidebar-min-width), 200px, 240px);--page-content-bg:var(--a-canvas-0);--page-content-header-bg:var(--a-canvas-0);--page-content-radius:var(--a-radius-lg);--page-content-inset:var(--a-space-10);--page-content-max-width:1540px;--page-content-border:1px solid var(--a-border-subtle);--page-content-shadow:var(--a-shadow-sm);--page-content-bp-sm:480px;--page-content-bp-md:720px;--page-content-bp-lg:1024px;--page-section-gap:var(--a-space-6);--page-block-gap:var(--a-space-4);--page-deck-gap:var(--a-space-1);--page-section-size:var(--a-kicker-size);--page-section-weight:var(--a-kicker-weight);--page-section-leading:var(--a-kicker-leading);--page-section-tracking:var(--a-kicker-tracking);--page-section-case:var(--a-kicker-case);--page-section-color:var(--a-kicker-color);--page-section-mb:var(--a-space-3);--page-section-pb:var(--a-space-2);--page-subsection-size:var(--a-subsection-size);--page-subsection-weight:var(--a-subsection-weight);--page-subsection-color:var(--a-subsection-color);--page-sidebar-collapsed-icon:1.0625rem;--page-sidebar-collapsed-avatar:1.5rem;--page-actions-gap:var(--a-space-2);--page-grid-gap:var(--a-space-3);--page-duration:var(--a-duration);--page-duration-fast:var(--a-duration-fast);--page-easing:var(--a-easing);--page-font-family:var(--a-font-family);--page-body-size:var(--a-body-size);--nav-duration:var(--a-duration);--nav-duration-fast:var(--a-duration-fast);--nav-easing:var(--a-easing);--nav-label-px:var(--a-space-2);--nav-label-py:var(--a-space-1);--nav-label-font-size:var(--a-kicker-sm);--nav-label-weight:var(--a-weight-medium);--nav-label-fg:var(--a-fg-muted);--nav-divider-bg:var(--a-border-subtle);--nav-divider-my:var(--a-space-1);--nav-group-indent-rail-bg:var(--a-border-subtle);--nav-group-icon-font-size:var(--a-ui-size);--nav-group-text-weight:var(--a-weight-medium);--nav-group-badge-bg:var(--a-bg-muted);--nav-group-badge-px:var(--a-space-1);--nav-group-badge-radius:var(--a-radius-full);--nav-item-icon-font-size:var(--a-ui-size);--nav-item-selected-weight:var(--a-weight-medium);--nav-item-badge-fg:var(--a-fg-muted);--nav-item-badge-bg:var(--a-bg-muted);--nav-item-badge-px:var(--a-space-1);--nav-item-badge-radius:var(--a-radius-full);--nav-item-trailing-font:var(--a-ui-sm);--nav-item-trailing-fg:var(--a-fg-muted);--nav-item-trailing-border:var(--a-border-subtle);--nav-item-trailing-radius:var(--a-radius-sm);--nav-item-trailing-px:var(--a-space-0-5);--a-icon-size:18px}admin-shell[mode~=borderless]{--page-main-border:none;--page-border:none}admin-shell{background:var(--page-bg);overscroll-behavior:none;height:100dvh;font-family:var(--page-font-family);font-size:var(--page-body-size);display:flex;position:fixed;inset:0;overflow:hidden}admin-shell:not(:has(>:is(asideadmin-sidebar[slot=trailing],admin-sidebar[slot=trailing]):not([hidden])))>admin-content>admin-scroll{margin-inline-end:var(--a-space-2)}admin-shell:not(:has(>:is(header,header-ui,admin-topbar):not([hidden]),>admin-content>admin-topbar:not([hidden])))>admin-content>admin-scroll{margin-block-start:var(--a-space-2)}admin-shell:not(:has(>:is(footer,footer-ui,admin-statusbar):not([hidden]),>admin-content>admin-statusbar:not([hidden])))>admin-content>admin-scroll{margin-block-end:var(--a-space-2)}admin-shell>admin-content>admin-scroll::-webkit-scrollbar{display:none}admin-shell>admin-content>admin-scroll:has(>[data-subnav]:not([hidden])){grid-template-columns:var(--subnav-width,14rem) 1fr;grid-template-rows:minmax(0,1fr);gap:0;display:grid}admin-shell>admin-content>admin-scroll>[data-subnav]{overscroll-behavior:contain;border-inline-end:1px solid var(--a-border-subtle);min-height:0;padding-block:var(--a-space-2);padding-inline:var(--a-space-2);overflow-y:auto}@container (width<=40rem){admin-shell>admin-content>admin-scroll:has(>[data-subnav]:not([hidden])){grid-template-columns:1fr}admin-shell>admin-content>admin-scroll>[data-subnav]{border-inline-end:none;border-block-end:1px solid var(--a-border-subtle)}}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing]){min-width:var(--page-sidebar-min-width);max-width:var(--page-sidebar-max-width);min-height:0;font-size:var(--page-sidebar-font);transition:width var(--page-duration) var(--page-easing);flex-direction:column;flex-shrink:0;display:flex;position:relative;container:sidebar/inline-size}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>[data-resize]{cursor:col-resize;width:6px;transition:background var(--page-duration-fast) var(--page-easing);z-index:2;background:0 0;position:absolute;top:0;bottom:0}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>[data-resize]:hover,:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])[data-resizing]>[data-resize]{background:var(--page-sidebar-resize-accent)}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])[data-resizing]{-webkit-user-select:none;user-select:none;transition:none}admin-sidebar[slot=leading]{width:var(--page-sidebar-width-leading)}admin-sidebar[slot=trailing]{width:var(--page-sidebar-width-trailing)}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui),:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui){align-items:center;gap:var(--page-sidebar-gap);padding:var(--page-sidebar-px);flex-shrink:0;min-width:0;display:flex;overflow:hidden}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui){min-height:var(--page-header-height);border-bottom:var(--page-border)}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui){min-height:var(--page-header-height);border-top:var(--page-border);margin-top:auto}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui)>[slot=icon],:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui)>[slot=icon]{color:var(--page-header-fg-muted);flex-shrink:0;align-items:center;display:flex}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui)>[slot=heading],:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui)>[slot=heading]{font-weight:var(--a-weight-medium);color:var(--a-fg)}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui)>[slot=description],:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui)>[slot=description]{color:var(--page-header-fg-muted);font-size:var(--a-ui-sm)}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui)>[slot=action],:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui)>[slot=action]{align-items:center;gap:var(--page-actions-gap);flex-shrink:0;margin-inline-start:auto;display:flex}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui)>[slot=action]~[slot=action],:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui)>[slot=action]~[slot=action]{margin-inline-start:0}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(header,header-ui)>[slot=action-leading],:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(footer,footer-ui)>[slot=action-leading]{align-items:center;gap:var(--page-actions-gap);flex-shrink:0;margin-inline-end:auto;display:flex}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(section,section-ui){padding:var(--page-sidebar-px);scrollbar-width:none;flex:1;min-height:0;overflow-y:auto}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(section,section-ui)::-webkit-scrollbar{display:none}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing]) span[slot=pad]{padding:var(--page-sidebar-px);display:block}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing]) nav-ui{border:none;padding:0}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>:is(section,section-ui)>hr[data-nav-divider]{background:var(--page-sidebar-divider-bg);height:1px;margin:var(--page-sidebar-gap) var(--page-sidebar-px);border:none}@container sidebar (width<=96px){:is(admin-topbar,admin-statusbar){padding:var(--page-sidebar-px);justify-content:center}:is(section,section-ui){flex-direction:column;align-items:center;display:flex}select-ui [slot=display],select-ui [slot=caret]{display:none}select-ui [slot=trigger]{min-height:var(--page-header-height);justify-content:center;padding:0}select-ui [slot=leading]{--a-icon-size:var(--page-sidebar-collapsed-icon);font-size:var(--page-sidebar-collapsed-icon)}select-ui img[slot=leading]{width:var(--page-sidebar-collapsed-avatar);height:var(--page-sidebar-collapsed-avatar)}nav-ui [slot=text],nav-ui [slot=badge],nav-ui [slot=caret],nav-ui [slot=trailing],nav-ui [data-nav-label],nav-ui [data-nav-divider]{display:none!important}nav-group-ui [slot=header]{min-height:var(--nav-group-row-height);min-width:var(--nav-group-row-height);justify-content:center;padding:0}nav-item-ui{min-height:var(--nav-item-row-height);min-width:var(--nav-item-row-height);justify-content:center;width:100%;padding:0}nav-ui{width:100%}button-ui{--button-px:0;justify-content:center;width:auto!important}button-ui [slot=trailing]{display:none}:scope,:is(admin-topbar,admin-statusbar),:is(section,section-ui,nav){overflow:hidden}:is(span,p,div,h1,h2,h3,h4,h5,h6)[slot=heading],[slot=heading]:not(:has(>[slot])){display:none}button.nav-item,a.nav-item,[data-nav]{text-indent:-9999px;white-space:nowrap;justify-content:center;overflow:hidden}button.nav-item>icon-ui,a.nav-item>icon-ui,[data-nav]>icon-ui,button.nav-item>:has(>icon-ui),a.nav-item>:has(>icon-ui),[data-nav]>:has(>icon-ui){text-indent:0}}admin-page-header>:is(header,header-ui),admin-page-body>:is(section,section-ui),admin-page-footer>:is(footer,footer-ui){max-width:var(--page-content-max-width);box-sizing:border-box;width:100%;margin-inline:auto}admin-page-header>:is(header,header-ui){padding-inline:var(--page-content-inset)}admin-page-header[data-content-full]>:is(header,header-ui),admin-page-body[data-content-full]>:is(section,section-ui),admin-page-footer[data-content-full]>:is(footer,footer-ui),admin-page-header>:is(header,header-ui)[data-content-full],admin-page-body>:is(section,section-ui)[data-content-full],admin-page-footer>:is(footer,footer-ui)[data-content-full]{max-width:100%}admin-page-header>:is(header,header-ui){gap:var(--page-header-gap);padding-block:var(--page-content-inset) var(--page-header-gap);flex-direction:column;display:flex}admin-page-header>:is(header,header-ui):has(tabs-ui){padding-bottom:0}admin-page-header:has(>:is(header,header-ui)[data-flush]){background:0 0;border-bottom:none;position:static}admin-page-header>:is(header,header-ui)[data-compact]{padding-block:var(--page-header-px)}admin-page-header>:is(header,header-ui)>div:first-of-type{justify-content:space-between;align-items:center;gap:var(--page-header-gap);display:flex}admin-page-header h1,admin-page-header>:is(header,header-ui)>p{margin:0}admin-page-body>:is(section,section-ui){padding:var(--page-content-inset);gap:var(--page-section-gap,var(--a-space-8));flex-direction:column;display:flex}admin-page-footer>:is(footer,footer-ui){justify-content:flex-end;align-items:center;gap:var(--page-header-gap);padding-inline:var(--page-content-inset);padding-block:var(--page-header-gap);display:flex}admin-page-body>iframe{border:0;flex:1;block-size:100%;inline-size:100%;display:block}[data-tab-content]>section{margin-bottom:var(--page-section-gap)}[data-tab-content]>section>h2{font-size:var(--page-section-size);font-weight:var(--page-section-weight);line-height:var(--page-section-leading);letter-spacing:var(--page-section-tracking);text-transform:var(--page-section-case);color:var(--page-section-color);margin:0 0 var(--page-section-mb);padding-bottom:var(--page-section-pb);border-bottom:var(--page-content-border)}[data-tab-content]>section>[data-section]{gap:var(--page-section-gap) var(--page-header-gap);grid-template-columns:1fr 2fr;display:grid}[data-tab-content]>section>[data-section]>aside>h3{font-size:var(--page-subsection-size);font-weight:var(--page-subsection-weight);color:var(--page-subsection-color);margin:0 0 var(--page-section-pb)}[data-tab-content]>section>[data-section]>aside>p{margin:0}@container page-content (width<=720px){[data-tab-content]>section>[data-section]{gap:var(--page-block-gap) 0;grid-template-columns:minmax(0,1fr)}}@container page-content (width<=768px){admin-page-header>:is(header,header-ui),admin-page-body>:is(section,section-ui){padding-inline:var(--a-space-8)}admin-page-body>:is(section,section-ui){padding-block:var(--a-space-8)}}@container page-content (width<=480px){admin-page-header>:is(header,header-ui),admin-page-body>:is(section,section-ui){padding-inline:var(--a-space-6)}admin-page-body>:is(section,section-ui){padding-block:var(--a-space-6)}}admin-shell [data-spacer]{flex:1}admin-shell [data-actions]{align-items:center;gap:var(--page-actions-gap);display:flex}admin-shell [data-grid]{gap:var(--page-grid-gap);grid-template-columns:1fr 1fr;display:grid}admin-shell [data-grid=\"3\"]{grid-template-columns:1fr 1fr 1fr}admin-shell [data-col]{gap:var(--page-grid-gap);flex-direction:column;display:flex}admin-shell [data-row]{align-items:center;gap:var(--page-grid-gap);display:flex}admin-shell>admin-content{border-inline:var(--page-main-border);flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}admin-content>admin-topbar,admin-shell>admin-topbar,admin-sidebar>admin-topbar{align-items:center;gap:var(--page-header-gap);padding:0 var(--a-space-3);height:var(--page-header-height);font-size:var(--page-header-font);border-bottom:var(--page-border);flex-shrink:0;display:flex}admin-content>admin-statusbar,admin-shell>admin-statusbar,admin-sidebar>admin-statusbar{align-items:center;gap:var(--page-header-gap);padding:0 var(--a-space-3);height:var(--page-header-height);font-size:var(--page-header-font);color:var(--page-header-fg-muted);border-top:var(--page-border);flex-shrink:0;display:flex}admin-sidebar>:is(admin-topbar,admin-statusbar){padding-inline:var(--page-sidebar-px)}admin-sidebar>:is(admin-topbar,admin-statusbar)>:where(span,p,small,time,text-ui,code-ui){padding-inline:var(--a-space-2)}admin-content>admin-scroll{overscroll-behavior:contain;scrollbar-width:none;background:var(--page-content-bg);border-inline:var(--page-content-border);min-height:0;box-shadow:var(--page-content-shadow);flex:1;overflow-y:auto}admin-shell[mode~=rounded]>admin-content>admin-scroll{border-radius:var(--page-content-radius)}:is(admin-scroll,admin-content) admin-page{flex-direction:column;min-height:100%;display:flex;container:page-content/inline-size}admin-page>admin-page-header{z-index:1;background:var(--page-content-header-bg);border-bottom:var(--page-content-border);box-shadow:var(--a-shadow-sm);flex-shrink:0;position:sticky;top:0}admin-page>admin-page-body{box-sizing:border-box;flex-direction:column;flex:1;width:100%;min-height:0;display:flex}admin-page>admin-page-footer{z-index:1;background:var(--page-content-header-bg);border-top:var(--page-content-border);flex-shrink:0;position:sticky;bottom:0}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing]){min-width:var(--page-sidebar-min-width);max-width:var(--page-sidebar-max-width);min-height:0;font-size:var(--page-sidebar-font);transition:width var(--page-duration) var(--page-easing);background:var(--page-bg);flex-direction:column;flex-shrink:0;display:flex;position:relative;container:sidebar/inline-size}admin-sidebar[slot=leading]{width:var(--page-sidebar-width-leading);border-right:var(--page-border)}admin-sidebar[slot=trailing]{width:var(--page-sidebar-width-trailing);border-left:var(--page-border)}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>[data-resize]{cursor:col-resize;z-index:1;-webkit-user-select:none;user-select:none;width:6px;position:absolute;top:0;bottom:0}admin-sidebar[slot=leading]>[data-resize]{right:-3px}admin-sidebar[slot=trailing]>[data-resize]{left:-3px}:is(admin-sidebar[slot=leading],admin-sidebar[slot=trailing])>[data-resize]:hover{background:var(--page-sidebar-resize-accent);opacity:.5}admin-sidebar[resizing]{transition:none}admin-sidebar[resizing]>[data-resize]{background:var(--page-sidebar-resize-accent);opacity:.8}:is(admin-topbar,admin-statusbar)>[slot=action]:first-of-type{margin-inline-start:auto}:is(admin-topbar,admin-statusbar)>[slot=action-leading]{margin-inline-end:var(--page-actions-gap)}:is(admin-topbar,admin-statusbar)>[slot=icon]{color:var(--page-header-fg-muted);flex-shrink:0}:is(admin-topbar,admin-statusbar)>[slot=heading]{font-weight:var(--a-weight-medium,500);color:var(--a-fg)}:is(admin-topbar,admin-statusbar)>[slot=description]{color:var(--page-header-fg-muted);font-size:var(--a-ui-sm)}:is(admin-topbar,admin-statusbar)>[slot=action],:is(admin-topbar,admin-statusbar)>[slot=action-leading]{align-items:center;gap:var(--page-actions-gap);flex-shrink:0;display:flex}:is(admin-topbar,admin-statusbar)>[slot=action]~[slot=action]{margin-inline-start:0}:is(admin-topbar,admin-statusbar)>[slot=icon]{align-items:center;display:flex}admin-entity-item{--entity-item-gap:var(--a-space-1);--entity-item-px:var(--a-ui-px);--entity-item-icon-size:calc(var(--a-size) - var(--a-space-2));--entity-item-icon-color:var(--a-fg-muted);--entity-item-avatar-size:1.5rem;align-items:center;gap:var(--entity-item-gap);padding:0 var(--entity-item-px);min-width:0;display:inline-flex;overflow:hidden}admin-entity-item>[slot=icon]{color:var(--entity-item-icon-color);--a-icon-size:var(--entity-item-icon-size);flex-shrink:0;align-items:center;line-height:1;display:inline-flex}admin-entity-item>img[slot=icon]{width:var(--entity-item-avatar-size);height:var(--entity-item-avatar-size);border-radius:var(--a-radius-full);object-fit:cover}admin-entity-item>[slot=label]{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--a-ui-sm);font-weight:var(--a-weight-medium,500);color:var(--a-fg);flex:1;overflow:hidden}admin-entity-item>[slot=badge]{flex-shrink:0}@container sidebar (width<=96px){admin-entity-item>[slot=label],admin-entity-item>[slot=badge]{display:none}}embed-shell{box-sizing:border-box;background:var(--a-bg);color:var(--a-fg);border:1px solid var(--a-border-subtle);border-radius:var(--a-radius-lg,var(--a-radius-md));box-shadow:var(--a-shadow-lg);font-family:var(--a-font-family);display:flex;position:relative;overflow:hidden}embed-shell>[app]{block-size:100%;min-inline-size:0;box-shadow:none;border:none;border-radius:0;flex:1;position:relative}embed-shell>[panel]{box-sizing:border-box;flex-direction:column;min-block-size:0}@media (width>=760px){embed-shell[panel]>[app]{flex:none;inline-size:50%}embed-shell>[panel]{display:none}embed-shell>[panel][active]{border-inline-start:1px solid var(--a-border-subtle);flex:none;block-size:100%;inline-size:50%;display:flex}}@media (width<=759.98px){embed-shell>[panel]{z-index:5;background:var(--a-bg);transition:transform .26s var(--a-easing-out,ease);display:flex;position:absolute;inset:0;transform:translateY(100%)}embed-shell>[panel][active]{transform:translateY(0)}}@media (prefers-reduced-motion:reduce){embed-shell>[panel]{transition:none}}@scope(simple-content){:scope{gap:var(--a-density-4,1.5rem);width:100%;color:var(--a-text);flex-direction:column;display:flex}:scope>h1,:scope>h2,:scope>h3{color:var(--a-text-heading,var(--a-text));margin:0}:scope>p{line-height:var(--a-line-height-prose,1.6);margin:0}}@scope(simple-hero){:scope{text-align:center;align-items:center;gap:var(--a-density-3,1rem);width:100%;padding-block:var(--a-density-6,3rem);flex-direction:column;display:flex}:scope [slot=heading]{font-size:var(--a-font-size-display,2.5rem);line-height:var(--a-line-height-tight,1.2);color:var(--a-text-heading,var(--a-text));font-weight:var(--a-font-weight-bold,600);margin:0}:scope [slot=lede]{font-size:var(--a-font-size-lede,1.25rem);line-height:var(--a-line-height-prose,1.5);color:var(--a-text-muted);max-width:42rem;margin:0}:scope [slot=actions]{gap:var(--a-density-2,.75rem);margin-top:var(--a-density-2,.75rem);flex-wrap:wrap;justify-content:center;display:flex}}@scope(simple-shell){:scope{box-sizing:border-box;width:100%;min-height:100dvh;padding-inline:var(--a-density-4,1.5rem);padding-block:var(--a-density-6,3rem);align-items:center;gap:var(--a-density-4,1.5rem);background:var(--a-canvas-1);color:var(--a-text);flex-direction:column;display:flex}:scope[centered]{justify-content:center}:scope>*{width:100%;max-width:var(--a-content-max-width,56rem)}:scope[full-bleed]>*{max-width:none}}theme-panel{--theme-panel-gap:var(--a-space-3);--theme-panel-pad:var(--a-space-3);--theme-panel-min-width:260px;--theme-panel-row-gap:var(--a-space-1);--theme-panel-preset-gap:var(--a-space-2)}@scope(theme-panel){:scope{gap:var(--theme-panel-gap);padding:var(--theme-panel-pad);min-width:var(--theme-panel-min-width);flex-direction:column;display:flex}[part=scheme]{display:flex}[part=scheme]>segmented-ui{flex:1}[part=themes]{gap:var(--theme-panel-row-gap);flex-wrap:wrap;display:flex}[part=preset-row]{justify-content:space-between;align-items:center;gap:var(--theme-panel-preset-gap);display:flex}[part=presets]{gap:var(--theme-panel-preset-gap);flex-wrap:wrap;display:flex}}";
5
+ let _sheet = null;
6
+ export function constructSheet() {
7
+ if (typeof CSSStyleSheet === 'undefined') return null; // non-DOM (SSR/Node) — link the .min.css instead
8
+ if (!_sheet) { _sheet = new CSSStyleSheet(); _sheet.replaceSync(css); }
9
+ return _sheet;
10
+ }
11
+ export default constructSheet;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<editor-canvas-ui>` — Module-tier editor canvas surface — replaces legacy <div data-canvas>
2
+ * `<editor-canvas>` — Module-tier editor canvas surface — replaces legacy <div data-canvas>
3
3
  inside <editor-shell> per ADR-0023. Owns scroll/zoom container
4
4
  semantics, [empty] and [focused] reflected attributes, and a stable
5
5
  target for the host's content rendering pipeline.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<editor-shell-ui>` — Behavior-only editor shell for design-tool / code-editor / canvas
2
+ * `<editor-shell>` — Behavior-only editor shell for design-tool / code-editor / canvas
3
3
  layouts. Canonical authoring shape uses cluster-namespaced bespoke
4
4
  children — <editor-toolbar> at the top, <editor-sidebar
5
5
  slot="leading|trailing"> rails wrapping <pane-ui resizable>,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<editor-sidebar-ui>` — Module-tier editor-cluster sidebar — wraps <pane-ui resizable>
2
+ * `<editor-sidebar>` — Module-tier editor-cluster sidebar — wraps <pane-ui resizable>
3
3
  (the primitive that owns drag) and adds [collapsed] reflected
4
4
  state, localStorage persistence (adia-editor-sidebar-{name}),
5
5
  and .toggle() / .collapse() / .expand() public API.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<editor-toolbar-ui>` — Module-tier editor toolbar — replaces legacy <header> chrome bar
2
+ * `<editor-toolbar>` — Module-tier editor toolbar — replaces legacy <header> chrome bar
3
3
  inside <editor-shell> per ADR-0023. Owns the [full-screen] reflected
4
4
  attribute (set when host enters focus mode), click-bubble for
5
5
  [data-toolbar-action] buttons, and slot vocabulary routing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.7.11",
3
+ "version": "0.7.13",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -13,6 +13,11 @@
13
13
  "types": "./css-module.d.ts",
14
14
  "default": "./dist/web-modules.min.css"
15
15
  },
16
+ "./css/sheet": {
17
+ "types": "./web-modules.sheet.d.ts",
18
+ "import": "./dist/web-modules.sheet.js",
19
+ "default": "./dist/web-modules.sheet.js"
20
+ },
16
21
  "./shell": {
17
22
  "types": "./shell/index.d.ts",
18
23
  "import": "./shell/index.js",
@@ -256,6 +261,7 @@
256
261
  "!generative/**/*.html",
257
262
  "index.js",
258
263
  "css-module.d.ts",
264
+ "web-modules.sheet.d.ts",
259
265
  "README.md",
260
266
  "CHANGELOG.md"
261
267
  ],
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<a2ui-root-ui>` — A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.
2
+ * `<a2ui-root>` — A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.
3
3
  *
4
4
  * @see https://ui-kit.exe.xyz/site/components/a2ui-root
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<gen-root-ui>` — Composition shell for chat + canvas generative UI. Manages layout modes
2
+ * `<gen-root>` — Composition shell for chat + canvas generative UI. Manages layout modes
3
3
  (chat-only / split / canvas-only) and delegates a unified API across
4
4
  child chat-ui, canvas-ui, and inspector-ui elements.
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<admin-command-ui>` — Module-tier command palette wrapper — wraps a native <dialog> and the
2
+ * `<admin-command>` — Module-tier command palette wrapper — wraps a native <dialog> and the
3
3
  inner <command-ui>. Owns the keyboard shortcut listener, focus
4
4
  management, and dismiss handlers. Reflects [open].
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<admin-shell-ui>` — Behavior-only application shell. Canonical authoring shape uses
2
+ * `<admin-shell>` — Behavior-only application shell. Canonical authoring shape uses
3
3
  cluster-namespaced bespoke children — <admin-topbar> at the top,
4
4
  <admin-sidebar slot="leading|trailing"> rails, <admin-content> for
5
5
  the main content region, <admin-command> for the Cmd+K palette, and
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<admin-sidebar-ui>` — Module-tier shell sidebar — owns resize, snap-to-collapsed, persistence,
2
+ * `<admin-sidebar>` — Module-tier shell sidebar — owns resize, snap-to-collapsed, persistence,
3
3
  and the [collapsed] reflected attribute. Sits inside <admin-shell> as
4
4
  slot="leading" or slot="trailing". Authors compose chrome bars + content
5
5
  inside via slot vocabulary.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<embed-shell-ui>` — Embedded multi-surface shell — composes a primary [app] surface with secondary
2
+ * `<embed-shell>` — Embedded multi-surface shell — composes a primary [app] surface with secondary
3
3
  [panel="<name>"] surfaces the consumer provides, arranging them responsively.
4
4
  Peer of <admin-shell>. Content-agnostic: it orchestrates whatever [app] +
5
5
  [panel] children it is given (it owns layout, not content), so any embedded app
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Type declarations for `embed-shell/with-css` — opt-in CSS-bundled companion.
3
+ *
4
+ * Side-effect-only module. Importing this registers the `<embed-shell>`
5
+ * custom element AND side-effect-imports its layout CSS.
6
+ *
7
+ * Per ADR-0030 (shell `/with-css` opt-in carve-out, v0.6.10). The
8
+ * canonical class type is re-exported here so consumers using the
9
+ * `/with-css` companion don't lose typing parity with the default
10
+ * subpath.
11
+ */
12
+
13
+ export * from './embed-shell.js';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Opt-in `/with-css` companion for <embed-shell>.
3
+ *
4
+ * Side-effect-only module. Importing this:
5
+ * 1. Loads `./embed-shell.js` (registers the `<embed-shell>` custom element)
6
+ * 2. Side-effect-imports `./embed-shell.css` (mounts the shell's layout CSS)
7
+ *
8
+ * Consumer-facing entry point:
9
+ * import '@adia-ai/web-modules/shell/embed-shell/with-css';
10
+ *
11
+ * This is the explicit CSS-policy carve-out documented in ADR-0030. The
12
+ * default subpath (`@adia-ai/web-modules/shell/embed-shell`) preserves
13
+ * the explicit-import contract; this `/with-css` companion is the named
14
+ * opt-in for consumers who prefer one-line cold-start over tree-shake.
15
+ *
16
+ * Pairs verified at CI by `scripts/release/check-with-css-pairing.mjs`.
17
+ */
18
+ import './embed-shell.js';
19
+ import './embed-shell.css';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `<simple-shell-ui>` — Module-tier minimal shell for marketing / landing / error pages.
2
+ * `<simple-shell>` — Module-tier minimal shell for marketing / landing / error pages.
3
3
  Behavior-only orchestrator with two reflected attributes — [centered]
4
4
  for vertical centering, [full-bleed] for dropping the max-width
5
5
  constraint.
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://adiaui.dev/a2ui/v0_9/components/ThemePanel.json",
4
4
  "title": "ThemePanel",
5
- "description": "Module-tier appearance-preferences control surface. Owns the three knobs\nof the AdiaUI theming contract: [data-theme=<slug>] named themes,\n--a-density / --a-radius-k parametric overrides, and color-scheme\nlight/dark switching, plus optional localStorage persistence behind a\nsmall attribute API.\n\nDrops into any consumer's <popover-ui slot=\"content\"> (the canonical\ncomposition) or directly into a sidebar section. Eight named themes\nship by default; section visibility flips on/off via boolean attributes\n([parametric], [presets], [scheme-toggle]).\n\nPromoted from the duplicated <div id=\"theme-panel\"> block in site/ and\nplaygrounds/admin-shell/ — see docs/specs/theme-panel-module.md.\n",
5
+ "description": "Module-tier appearance-preferences control surface. Owns the three knobs\nof the AdiaUI theming contract: [theme=<slug>] named themes,\n--a-density / --a-radius-k parametric overrides, and color-scheme\nlight/dark switching, plus optional localStorage persistence behind a\nsmall attribute API.\n\nDrops into any consumer's <popover-ui slot=\"content\"> (the canonical\ncomposition) or directly into a sidebar section. Eight named themes\nship by default; section visibility flips on/off via boolean attributes\n([parametric], [presets], [scheme-toggle]).\n\nPromoted from the duplicated <div id=\"theme-panel\"> block in site/ and\nplaygrounds/admin-shell/ — see docs/specs/theme-panel-module.md.\n",
6
6
  "type": "object",
7
7
  "allOf": [
8
8
  {
@@ -52,7 +52,7 @@
52
52
  "default": false
53
53
  },
54
54
  "presets": {
55
- "description": "Renders the compact / reset / spacious preset row. Each preset\napplies a (density, radius) pair; \"default\" also clears the\n[data-theme] attribute.\n",
55
+ "description": "Renders the compact / reset / spacious preset row. Each preset\napplies a (density, radius) pair; \"default\" also clears the\n[theme] attribute.\n",
56
56
  "type": "boolean",
57
57
  "default": false
58
58
  },
@@ -82,12 +82,12 @@
82
82
  "default": "adia-theme-"
83
83
  },
84
84
  "target": {
85
- "description": "CSS selector for the element that receives [data-theme] and\n--a-density / --a-radius-k writes. Defaults to :root (the\n<html> element). Scoped targets are useful for preview-pane\ndemos.\n",
85
+ "description": "CSS selector for the element that receives [theme] and\n--a-density / --a-radius-k writes. Defaults to :root (the\n<html> element). Scoped targets are useful for preview-pane\ndemos.\n",
86
86
  "type": "string",
87
87
  "default": ":root"
88
88
  },
89
89
  "themes": {
90
- "description": "Space-separated list of theme slugs to render as buttons. Author\nmay restrict ([themes=\"default ocean\"]) or extend. Tolerant —\nunknown slugs render a button; clicking applies [data-theme=slug]\nregardless of whether themes.css has a matching block.\n",
90
+ "description": "Space-separated list of theme slugs to render as buttons. Author\nmay restrict ([themes=\"default ocean\"]) or extend. Tolerant —\nunknown slugs render a button; clicking applies [theme=slug]\nregardless of whether themes.css has a matching block.\n",
91
91
  "type": "string",
92
92
  "default": "default ocean forest sunset lavender rose slate midnight"
93
93
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
- * `<theme-panel-ui>` — Module-tier appearance-preferences control surface. Owns the three knobs
3
- of the AdiaUI theming contract: [data-theme=<slug>] named themes,
2
+ * `<theme-panel>` — Module-tier appearance-preferences control surface. Owns the three knobs
3
+ of the AdiaUI theming contract: [theme=<slug>] named themes,
4
4
  --a-density / --a-radius-k parametric overrides, and color-scheme
5
5
  light/dark switching, plus optional localStorage persistence behind a
6
6
  small attribute API.
@@ -47,7 +47,7 @@ docs-shell preferences.
47
47
  persist: boolean;
48
48
  /** Renders the compact / reset / spacious preset row. Each preset
49
49
  applies a (density, radius) pair; "default" also clears the
50
- [data-theme] attribute.
50
+ [theme] attribute.
51
51
  */
52
52
  presets: boolean;
53
53
  /** Renders a "Scale Context" row (verse / regular / prose) — a
@@ -61,7 +61,7 @@ matchMedia listener; user clicks on the scheme toggle promote to
61
61
  an explicit light or dark choice.
62
62
  */
63
63
  scheme: 'light' | 'dark' | 'auto';
64
- /** CSS selector for the element that receives [data-theme] and
64
+ /** CSS selector for the element that receives [theme] and
65
65
  --a-density / --a-radius-k writes. Defaults to :root (the
66
66
  <html> element). Scoped targets are useful for preview-pane
67
67
  demos.
@@ -69,7 +69,7 @@ demos.
69
69
  target: string;
70
70
  /** Space-separated list of theme slugs to render as buttons. Author
71
71
  may restrict ([themes="default ocean"]) or extend. Tolerant —
72
- unknown slugs render a button; clicking applies [data-theme=slug]
72
+ unknown slugs render a button; clicking applies [theme=slug]
73
73
  regardless of whether themes.css has a matching block.
74
74
  */
75
75
  themes: string;
@@ -2,7 +2,7 @@
2
2
  * <theme-panel persist parametric presets scheme-toggle>
3
3
  *
4
4
  * Module-tier appearance-preferences control surface. Owns the three knobs
5
- * of the AdiaUI theming contract: [data-theme] named themes, --a-density /
5
+ * of the AdiaUI theming contract: [theme] named themes, --a-density /
6
6
  * --a-radius-k parametric overrides, and color-scheme light/dark switching,
7
7
  * plus optional localStorage persistence.
8
8
  *
@@ -103,13 +103,13 @@ class ThemePanel extends UIElement {
103
103
  }
104
104
 
105
105
  /**
106
- * Clear all state on target — remove [data-theme], inline parametric
106
+ * Clear all state on target — remove [theme], inline parametric
107
107
  * overrides, color-scheme, and (if [persist]) localStorage keys.
108
108
  * Emits theme-change with source: 'reset'.
109
109
  */
110
110
  reset() {
111
111
  const target = this.#resolveTarget();
112
- target.removeAttribute('data-theme');
112
+ target.removeAttribute('theme');
113
113
  target.style.removeProperty('--a-density');
114
114
  target.style.removeProperty('--a-radius-k');
115
115
  target.style.removeProperty('color-scheme');
@@ -340,10 +340,10 @@ class ThemePanel extends UIElement {
340
340
  localStorage.removeItem(`${this.storagePrefix}radius`);
341
341
  } catch {}
342
342
  }
343
- // Apply the theme (which may write [data-theme] on target)
343
+ // Apply the theme (which may write [theme] on target)
344
344
  this.#apply({ theme: slug }, 'theme');
345
345
  // Then re-read computed values into sliders on next frame, so the
346
- // theme's [data-theme] block has taken effect.
346
+ // theme's [theme] block has taken effect.
347
347
  const sync = () => {
348
348
  const cs = getComputedStyle(target);
349
349
  const density = parseFloat(cs.getPropertyValue('--a-density')) || 1;
@@ -364,9 +364,9 @@ class ThemePanel extends UIElement {
364
364
  const preset = PRESETS[name];
365
365
  if (!preset) return;
366
366
  if (preset.clearTheme) {
367
- // "Reset" preset — clears [data-theme] too
367
+ // "Reset" preset — clears [theme] too
368
368
  const target = this.#resolveTarget();
369
- target.removeAttribute('data-theme');
369
+ target.removeAttribute('theme');
370
370
  this.activeTheme = '';
371
371
  if (this.persist) {
372
372
  try { localStorage.removeItem(`${this.storagePrefix}theme`); } catch {}
@@ -384,10 +384,10 @@ class ThemePanel extends UIElement {
384
384
 
385
385
  if (partial.theme !== undefined) {
386
386
  if (partial.theme === '' || partial.theme === 'default') {
387
- target.removeAttribute('data-theme');
387
+ target.removeAttribute('theme');
388
388
  this.activeTheme = '';
389
389
  } else {
390
- target.setAttribute('data-theme', partial.theme);
390
+ target.setAttribute('theme', partial.theme);
391
391
  this.activeTheme = partial.theme;
392
392
  }
393
393
  if (this.persist) {
@@ -485,10 +485,10 @@ class ThemePanel extends UIElement {
485
485
 
486
486
  // Apply theme
487
487
  if (theme) {
488
- target.setAttribute('data-theme', theme);
488
+ target.setAttribute('theme', theme);
489
489
  this.activeTheme = theme;
490
490
  } else {
491
- this.activeTheme = target.getAttribute('data-theme') || '';
491
+ this.activeTheme = target.getAttribute('theme') || '';
492
492
  }
493
493
 
494
494
  // Apply scheme
@@ -46,7 +46,7 @@ beforeEach(() => {
46
46
 
47
47
  afterEach(() => {
48
48
  // Always clean any html-level inline state so tests don't leak
49
- document.documentElement.removeAttribute('data-theme');
49
+ document.documentElement.removeAttribute('theme');
50
50
  document.documentElement.style.removeProperty('--a-density');
51
51
  document.documentElement.style.removeProperty('--a-radius-k');
52
52
  document.documentElement.style.removeProperty('color-scheme');
@@ -96,24 +96,24 @@ describe('theme-panel', () => {
96
96
  expect(tp.querySelector('[part="scheme"] segmented-ui')).toBeTruthy();
97
97
  });
98
98
 
99
- it('theme button click sets [data-theme] on the target (defaults to <html>)', async () => {
99
+ it('theme button click sets [theme] on the target (defaults to <html>)', async () => {
100
100
  const tp = mount('<theme-panel></theme-panel>');
101
101
  await tick();
102
102
  const oceanBtn = tp.querySelector('button-ui[data-theme-slug="ocean"]');
103
103
  oceanBtn.dispatchEvent(new Event('click', { bubbles: true }));
104
104
  await tick();
105
- expect(document.documentElement.getAttribute('data-theme')).toBe('ocean');
105
+ expect(document.documentElement.getAttribute('theme')).toBe('ocean');
106
106
  expect(tp.getAttribute('active-theme')).toBe('ocean');
107
107
  });
108
108
 
109
- it('theme button click for "default" clears [data-theme]', async () => {
110
- document.documentElement.setAttribute('data-theme', 'ocean');
109
+ it('theme button click for "default" clears [theme]', async () => {
110
+ document.documentElement.setAttribute('theme', 'ocean');
111
111
  const tp = mount('<theme-panel></theme-panel>');
112
112
  await tick();
113
113
  const defaultBtn = tp.querySelector('button-ui[data-theme-slug="default"]');
114
114
  defaultBtn.dispatchEvent(new Event('click', { bubbles: true }));
115
115
  await tick();
116
- expect(document.documentElement.hasAttribute('data-theme')).toBe(false);
116
+ expect(document.documentElement.hasAttribute('theme')).toBe(false);
117
117
  expect(tp.getAttribute('active-theme')).toBe('');
118
118
  });
119
119
 
@@ -166,14 +166,14 @@ describe('theme-panel', () => {
166
166
  expect(document.documentElement.style.getPropertyValue('--a-radius-k')).toBe('1.25');
167
167
  });
168
168
 
169
- it('preset "default" (Reset) clears [data-theme]', async () => {
170
- document.documentElement.setAttribute('data-theme', 'ocean');
169
+ it('preset "default" (Reset) clears [theme]', async () => {
170
+ document.documentElement.setAttribute('theme', 'ocean');
171
171
  const tp = mount('<theme-panel parametric presets></theme-panel>');
172
172
  await tick();
173
173
  const reset = tp.querySelector('button-ui[data-preset="default"]');
174
174
  reset.dispatchEvent(new Event('click', { bubbles: true }));
175
175
  await tick();
176
- expect(document.documentElement.hasAttribute('data-theme')).toBe(false);
176
+ expect(document.documentElement.hasAttribute('theme')).toBe(false);
177
177
  });
178
178
 
179
179
  it('[persist] writes localStorage keys on theme click', async () => {
@@ -193,7 +193,7 @@ describe('theme-panel', () => {
193
193
  });
194
194
 
195
195
  it('reset() clears all state and emits source: "reset"', async () => {
196
- document.documentElement.setAttribute('data-theme', 'ocean');
196
+ document.documentElement.setAttribute('theme', 'ocean');
197
197
  document.documentElement.style.setProperty('--a-density', '1.2');
198
198
  const tp = mount('<theme-panel parametric persist></theme-panel>');
199
199
  await tick();
@@ -201,7 +201,7 @@ describe('theme-panel', () => {
201
201
  tp.addEventListener('theme-change', onChange);
202
202
  tp.reset();
203
203
  await tick();
204
- expect(document.documentElement.hasAttribute('data-theme')).toBe(false);
204
+ expect(document.documentElement.hasAttribute('theme')).toBe(false);
205
205
  expect(document.documentElement.style.getPropertyValue('--a-density')).toBe('');
206
206
  expect(onChange).toHaveBeenCalled();
207
207
  expect(onChange.mock.calls[0][0].detail.source).toBe('reset');
@@ -223,7 +223,7 @@ describe('theme-panel', () => {
223
223
  tp.addEventListener('theme-change', onChange);
224
224
  tp.apply({ theme: 'slate' });
225
225
  await tick();
226
- expect(document.documentElement.getAttribute('data-theme')).toBe('slate');
226
+ expect(document.documentElement.getAttribute('theme')).toBe('slate');
227
227
  expect(onChange.mock.calls[0][0].detail.source).toBe('programmatic');
228
228
  });
229
229
 
@@ -251,8 +251,8 @@ describe('theme-panel', () => {
251
251
  await tick();
252
252
  tp.querySelector('button-ui[data-theme-slug="ocean"]').dispatchEvent(new Event('click', { bubbles: true }));
253
253
  await tick();
254
- expect(preview.getAttribute('data-theme')).toBe('ocean');
255
- expect(document.documentElement.getAttribute('data-theme')).toBeNull();
254
+ expect(preview.getAttribute('theme')).toBe('ocean');
255
+ expect(document.documentElement.getAttribute('theme')).toBeNull();
256
256
  });
257
257
 
258
258
  it('cleans up listeners on disconnect (no zombie listeners)', async () => {
@@ -8,7 +8,7 @@ category: layout
8
8
  version: 1
9
9
  description: |
10
10
  Module-tier appearance-preferences control surface. Owns the three knobs
11
- of the AdiaUI theming contract: [data-theme=<slug>] named themes,
11
+ of the AdiaUI theming contract: [theme=<slug>] named themes,
12
12
  --a-density / --a-radius-k parametric overrides, and color-scheme
13
13
  light/dark switching, plus optional localStorage persistence behind a
14
14
  small attribute API.
@@ -36,7 +36,7 @@ props:
36
36
  description: |
37
37
  Space-separated list of theme slugs to render as buttons. Author
38
38
  may restrict ([themes="default ocean"]) or extend. Tolerant —
39
- unknown slugs render a button; clicking applies [data-theme=slug]
39
+ unknown slugs render a button; clicking applies [theme=slug]
40
40
  regardless of whether themes.css has a matching block.
41
41
  type: string
42
42
  default: "default ocean forest sunset lavender rose slate midnight"
@@ -54,7 +54,7 @@ props:
54
54
  description: |
55
55
  Renders the compact / reset / spacious preset row. Each preset
56
56
  applies a (density, radius) pair; "default" also clears the
57
- [data-theme] attribute.
57
+ [theme] attribute.
58
58
  type: boolean
59
59
  default: false
60
60
  reflect: true
@@ -100,7 +100,7 @@ props:
100
100
 
101
101
  target:
102
102
  description: |
103
- CSS selector for the element that receives [data-theme] and
103
+ CSS selector for the element that receives [theme] and
104
104
  --a-density / --a-radius-k writes. Defaults to :root (the
105
105
  <html> element). Scoped targets are useful for preview-pane
106
106
  demos.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Type declarations for the `@adia-ai/web-modules/css/sheet` subpath — the
3
+ * constructable-`CSSStyleSheet` twin of `web-modules.min.css` (byte-identical to the
4
+ * CDN bundle), adopted via `document.adoptedStyleSheets`.
5
+ */
6
+ export function constructSheet(): CSSStyleSheet | null;
7
+ export default constructSheet;