@gemboss/ui 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/catalog/editor.html +1 -1
- package/catalog/index.html +1 -1
- package/gemboss-ui.css +1 -1
- package/package.json +1 -1
- package/parts/components.css +1 -1
- package/parts/core.css +1 -1
- package/parts/shell.css +1 -1
- package/src/assistant/engine-settings-store.ts +95 -0
- package/src/assistant/engine-settings.tsx +106 -0
- package/src/assistant/engine.tsx +98 -31
- package/src/assistant/index.ts +2 -0
- package/src/assistant-engine.css +1 -1
- package/src/engine-plain.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ Versions up to 0.9.0 are described in the README, each in the section that intro
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.52.0 (25/10/2026)
|
|
8
|
+
|
|
9
|
+
**The assistant's engine in Settings › AI & engines; the composer chip opens it** (24/10/2026, Chris: "đưa hết về nằm trong
|
|
10
|
+
popup settings để có nhiều không gian hơn… bấm vào đó mở settings"). The chip's 0.25 popup was 360px wide and 212–405px tall over
|
|
11
|
+
the chat (measured on five surfaces), with the bridge split over two more tabs. The admin's top-bar AI chip already opened
|
|
12
|
+
Settings › AI & engines: now every assistant does that.
|
|
13
|
+
|
|
14
|
+
Added
|
|
15
|
+
- `EnginePicker` `onOpenSettings(tab)` and `useEnginePicker({ onOpenSettings })`: the chip opens the surface's Settings, no
|
|
16
|
+
popup. `openTab("setup")` opens it with Install or update in view and focus on Copy; `open` is true while the section is SEEN
|
|
17
|
+
(not mounted: a closed SettingsDialog keeps its section); `close()` does nothing.
|
|
18
|
+
- `EngineSettings` and `EngineSettingsSection` (`@gemboss/ui/assistant`): the three tabs as two cards, Engine (engines, models,
|
|
19
|
+
effort, notes, problem) and Bridge on your machine (the callout, State / Version / Starts at sign-in, the actions, Install or
|
|
20
|
+
update). The section draws what the assistant's chip published (a module store, engine-settings-store.ts), so a surface puts
|
|
21
|
+
`<EngineSettingsSection />` in its Settings and changes nothing else. Labels `state`, `setupTitle`.
|
|
22
|
+
- `engine-plain.js`: `onOpenSettings`, `picker.mountSettings(el)`, `picker.unmountSettings()`, the same markup.
|
|
23
|
+
|
|
24
|
+
Weight: `engine-plain.js` ceiling 5959 → 6723 B gzip (Chris's OK, 24/10/2026): the popup mode goes once every surface has moved.
|
|
25
|
+
|
|
7
26
|
## 0.51.0 (24/10/2026)
|
|
8
27
|
|
|
9
28
|
**AuthSignIn: the server's sentence, a notice, the cursor, and a sentence that blames no field** (24/10/2026). Moving the
|
package/catalog/editor.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
.cat-code summary{padding:10px 16px;font-size:13px;cursor:pointer;color:var(--gemboss-text-muted);border-top:1px solid var(--gemboss-divider);min-height:24px}
|
|
9
9
|
.cat-code pre,.cat-api{margin:0;padding:12px 16px;overflow:auto;background:#0f1012;color:#e8e8e6;font-size:12px;line-height:1.5;border-radius:0}
|
|
10
10
|
.cat-api{border-radius:12px;margin:0 0 16px}</style></head><body><div class="cat">
|
|
11
|
-
<h1>@gemboss/ui 0.
|
|
11
|
+
<h1>@gemboss/ui 0.52.0 · Editor</h1>
|
|
12
12
|
<p>Khung của mọi editor: <code>EditorFrame</code> (cột trái · khe kéo · preview · cột phải dock trên mép phải preview) và <code>EditorTopbar</code> (← · tiêu đề · cụm giữa · cụm phải · dòng trạng thái). Là đúng khung của theme / page / section editor trong admin. Gói chỉ vẽ KHUNG; chat, Configure, canvas, page picker, menu, Publish là của editor, đi vào bằng slot. Trang HTML thuần nạp <code>editor.css</code> + <code>editor-plain.js</code> rồi gọi <code>gembossUI.initEditorFrame()</code>: kéo khe (chuột, chạm, phím mũi tên / Home / End), đổi thiết bị, mở ⋯ và Publish ▾, ẩn cột trái, Chat | Preview trên điện thoại. <a href="index.html">← Catalog</a></p>
|
|
13
13
|
<h2>React</h2><pre class="cat-api"><code>import "@gemboss/ui/editor.css";
|
|
14
14
|
import { EditorFrame, EditorTopbar, EditorBack, EditorChatToggle, EditorPaneTabs, EditorSaveState, DeviceToggle } from "@gemboss/ui/editor";
|
package/catalog/index.html
CHANGED
|
@@ -27,7 +27,7 @@ body{margin:0;background:var(--gemboss-app-bg,#f1f1f1);color:var(--gemboss-text)
|
|
|
27
27
|
@media (max-width:760px){.cat{grid-template-columns:1fr;padding:16px}.cat-nav{position:static;flex-direction:row;flex-wrap:wrap}}
|
|
28
28
|
</style></head><body>
|
|
29
29
|
<div class="cat"><nav class="cat-nav" aria-label="Mục"><a href="#tokens">Token</a><a href="#buttons">Nút</a><a href="#fields">Ô nhập</a><a href="#choice">Tab, nhóm nút, thẻ</a><a href="#surfaces">Thẻ, số liệu, bảng, trạng thái trống</a><a href="#report">Báo cáo</a><a href="#collections">Bảng, list, lưới, board</a><a href="#resizer">Thanh kéo giữa hai cột</a><a href="#modal">Hộp thoại, toast, menu (JS thuần)</a><a href="#sheet">Ngăn trượt cạnh phải</a><a href="#reader">Hộp đọc tài liệu</a><a href="#settings">Hộp cài đặt</a><a href="#switcher">Chuyển dịch vụ</a><a href="#shell">Khung app</a><a href="#nav">Chờ điều hướng</a><a href="#page">Bề rộng nội dung</a><a href="#portal">Cổng công khai: tab trên topbar, tìm kiếm, sáng / tối, người dẫn đầu</a><a href="#site">Trang công khai: thanh trên, logo cỡ site, nút, chân trang</a><a href="#auth">Đăng nhập</a><a href="#setup">Hướng dẫn thiết lập</a><a href="#chat">Thân chat</a><a href="#reactions">Reactions</a><a href="#team-chat">Chat đội</a><a href="#action-card">Thẻ hành động</a><a href="#assistant-engine">Trợ lý: chọn engine</a><a href="#assistant-bridge">Trợ lý: cầu nối trên máy (0.32.0)</a><a href="#assistant-chat">Trợ lý: khung chat (0.29.0)</a><a href="#assistant">Trợ lý: cột phiên</a><a href="#icons">Icon</a><a href="#editor">Editor</a></nav>
|
|
30
|
-
<main><header class="cat-head"><h1>@gemboss/ui 0.
|
|
30
|
+
<main><header class="cat-head"><h1>@gemboss/ui 0.52.0</h1><p>Ngôn ngữ thiết kế chung của các công cụ GemBoss. Markup dưới mỗi ví dụ là đúng thứ package render ra; bề mặt không dùng React (HTML tĩnh, Python) chép markup này và nạp <code>gemboss-ui.css</code>. Dựng từ gemboss <code>3dca8802a774</code>.</p></header>
|
|
31
31
|
<section id="tokens"><h2>Token</h2><p>Đổi giao diện một bề mặt bằng cách đặt lại token, không viết đè class. Tên và giá trị đọc thẳng từ gemboss-ui.css.</p><div class="cat-swatches"><div class="cat-swatch"><i style="background:var(--gemboss-primary)"></i><code>--gemboss-primary</code><span>#1b1c1e</span></div><div class="cat-swatch"><i style="background:var(--gemboss-primary-dark)"></i><code>--gemboss-primary-dark</code><span>#000000</span></div><div class="cat-swatch"><i style="background:var(--gemboss-primary-soft)"></i><code>--gemboss-primary-soft</code><span>#f2f3f5</span></div><div class="cat-swatch"><i style="background:var(--gemboss-accent)"></i><code>--gemboss-accent</code><span>#5661f5</span></div><div class="cat-swatch"><i style="background:var(--gemboss-accent-strong)"></i><code>--gemboss-accent-strong</code><span>#3a44de</span></div><div class="cat-swatch"><i style="background:var(--gemboss-accent-soft)"></i><code>--gemboss-accent-soft</code><span>#eef0fe</span></div><div class="cat-swatch"><i style="background:var(--gemboss-accent-wash)"></i><code>--gemboss-accent-wash</code><span>#f7f8ff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-accent-tint)"></i><code>--gemboss-accent-tint</code><span>#dfe2ff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-accent-mid)"></i><code>--gemboss-accent-mid</code><span>#c9cffd</span></div><div class="cat-swatch"><i style="background:var(--gemboss-text-strong)"></i><code>--gemboss-text-strong</code><span>#1b1c1e</span></div><div class="cat-swatch"><i style="background:var(--gemboss-text)"></i><code>--gemboss-text</code><span>#1b1c1e</span></div><div class="cat-swatch"><i style="background:var(--gemboss-text-muted)"></i><code>--gemboss-text-muted</code><span>#686b71</span></div><div class="cat-swatch"><i style="background:var(--gemboss-surface)"></i><code>--gemboss-surface</code><span>#ffffff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-canvas)"></i><code>--gemboss-canvas</code><span>#ffffff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-preview-canvas)"></i><code>--gemboss-preview-canvas</code><span>#eceef1</span></div><div class="cat-swatch"><i style="background:var(--gemboss-rail-bg)"></i><code>--gemboss-rail-bg</code><span>#ffffff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-panel-bg)"></i><code>--gemboss-panel-bg</code><span>#ffffff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-divider)"></i><code>--gemboss-divider</code><span>#e5e7ea</span></div><div class="cat-swatch"><i style="background:var(--gemboss-divider-soft)"></i><code>--gemboss-divider-soft</code><span>#edeff2</span></div><div class="cat-swatch"><i style="background:var(--gemboss-hover)"></i><code>--gemboss-hover</code><span>#eceef2</span></div><div class="cat-swatch"><i style="background:var(--gemboss-active-bg)"></i><code>--gemboss-active-bg</code><span>#f0f1f4</span></div><div class="cat-swatch"><i style="background:var(--gemboss-active-fg)"></i><code>--gemboss-active-fg</code><span>#1b1c1e</span></div><div class="cat-swatch"><i style="background:var(--gemboss-danger)"></i><code>--gemboss-danger</code><span>#d72c0d</span></div><div class="cat-swatch"><i style="background:var(--gemboss-danger-strong)"></i><code>--gemboss-danger-strong</code><span>#b42318</span></div><div class="cat-swatch"><i style="background:var(--gemboss-danger-soft)"></i><code>--gemboss-danger-soft</code><span>#fff0e9</span></div><div class="cat-swatch"><i style="background:var(--gemboss-danger-border)"></i><code>--gemboss-danger-border</code><span>#f5c9bc</span></div><div class="cat-swatch"><i style="background:var(--gemboss-success)"></i><code>--gemboss-success</code><span>#007f5f</span></div><div class="cat-swatch"><i style="background:var(--gemboss-success-strong)"></i><code>--gemboss-success-strong</code><span>#0a6a4c</span></div><div class="cat-swatch"><i style="background:var(--gemboss-success-soft)"></i><code>--gemboss-success-soft</code><span>#e3f1df</span></div><div class="cat-swatch"><i style="background:var(--gemboss-success-border)"></i><code>--gemboss-success-border</code><span>#b7dfcd</span></div><div class="cat-swatch"><i style="background:var(--gemboss-warning)"></i><code>--gemboss-warning</code><span>#9a6700</span></div><div class="cat-swatch"><i style="background:var(--gemboss-warning-soft)"></i><code>--gemboss-warning-soft</code><span>#fff8e0</span></div><div class="cat-swatch"><i style="background:var(--gemboss-warning-border)"></i><code>--gemboss-warning-border</code><span>#f5d569</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-bg)"></i><code>--gemboss-dark-bg</code><span>#0a0a0c</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-rail)"></i><code>--gemboss-dark-rail</code><span>#0e0e11</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-surface)"></i><code>--gemboss-dark-surface</code><span>#16161a</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-surface-2)"></i><code>--gemboss-dark-surface-2</code><span>#1e1e24</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-divider)"></i><code>--gemboss-dark-divider</code><span>#2a2a31</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-text)"></i><code>--gemboss-dark-text</code><span>#ededf0</span></div><div class="cat-swatch"><i style="background:var(--gemboss-dark-muted)"></i><code>--gemboss-dark-muted</code><span>#9a9aa4</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-bg)"></i><code>--gemboss-field-bg</code><span>#fdfdfd</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-bg-hover)"></i><code>--gemboss-field-bg-hover</code><span>#fafafa</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-ink)"></i><code>--gemboss-field-ink</code><span>#303030</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-placeholder)"></i><code>--gemboss-field-placeholder</code><span>#616161</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-line)"></i><code>--gemboss-field-line</code><span>#8a8a8a</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-line-hover)"></i><code>--gemboss-field-line-hover</code><span>#616161</span></div><div class="cat-swatch"><i style="background:var(--gemboss-field-line-active)"></i><code>--gemboss-field-line-active</code><span>#1a1a1a</span></div><div class="cat-swatch"><i style="background:var(--gemboss-chip-ink)"></i><code>--gemboss-chip-ink</code><span>#303633</span></div><div class="cat-swatch"><i style="background:var(--gemboss-chip-line)"></i><code>--gemboss-chip-line</code><span>#cfd6ce</span></div><div class="cat-swatch"><i style="background:var(--gemboss-chip-line-hover)"></i><code>--gemboss-chip-line-hover</code><span>#aab4ad</span></div><div class="cat-swatch"><i style="background:var(--gemboss-chip-bg-hover)"></i><code>--gemboss-chip-bg-hover</code><span>#f6f7f5</span></div><div class="cat-swatch"><i style="background:var(--gemboss-on-primary)"></i><code>--gemboss-on-primary</code><span>#ffffff</span></div><div class="cat-swatch"><i style="background:var(--gemboss-app-bg)"></i><code>--gemboss-app-bg</code><span>#ffffff</span></div></div><table class="ui-table cat-scale"><thead><tr><th>Token</th><th>Giá trị</th><th>Mẫu</th></tr></thead><tbody><tr><td><code>--gemboss-fs-micro</code></td><td>11px</td><td style="font-size:var(--gemboss-fs-micro)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-caption</code></td><td>12px</td><td style="font-size:var(--gemboss-fs-caption)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-body</code></td><td>14px</td><td style="font-size:var(--gemboss-fs-body)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-body-lg</code></td><td>16px</td><td style="font-size:var(--gemboss-fs-body-lg)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-h3</code></td><td>16px</td><td style="font-size:var(--gemboss-fs-h3)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-h2</code></td><td>20px</td><td style="font-size:var(--gemboss-fs-h2)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-h1</code></td><td>24px</td><td style="font-size:var(--gemboss-fs-h1)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-fs-display</code></td><td>30px</td><td style="font-size:var(--gemboss-fs-display)">Ngôn ngữ thiết kế chung</td></tr><tr><td><code>--gemboss-radius-xs</code></td><td>4px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-xs)"></i></td></tr><tr><td><code>--gemboss-radius-sm</code></td><td>6px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-sm)"></i></td></tr><tr><td><code>--gemboss-radius-md</code></td><td>8px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-md)"></i></td></tr><tr><td><code>--gemboss-radius-lg</code></td><td>12px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-lg)"></i></td></tr><tr><td><code>--gemboss-radius-xl</code></td><td>16px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-xl)"></i></td></tr><tr><td><code>--gemboss-radius-2xl</code></td><td>20px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-2xl)"></i></td></tr><tr><td><code>--gemboss-radius-full</code></td><td>999px</td><td><i class="cat-radius" style="border-radius:var(--gemboss-radius-full)"></i></td></tr><tr><td><code>--gemboss-shadow-resting</code></td><td class="cat-small">0 1px 2px rgba(31, 30, 29, 0.04), 0 2px 6px rgba(31, 30, 29, 0.06)</td><td><i class="cat-radius" style="box-shadow:var(--gemboss-shadow-resting);border:0"></i></td></tr><tr><td><code>--gemboss-shadow-raised</code></td><td class="cat-small">0 4px 16px rgba(31, 30, 29, 0.10)</td><td><i class="cat-radius" style="box-shadow:var(--gemboss-shadow-raised);border:0"></i></td></tr><tr><td><code>--gemboss-shadow-overlay</code></td><td class="cat-small">0 16px 48px rgba(31, 30, 29, 0.18)</td><td><i class="cat-radius" style="box-shadow:var(--gemboss-shadow-overlay);border:0"></i></td></tr></tbody></table></section>
|
|
32
32
|
<section id="buttons"><h2>Nút</h2><p>Một lớp <code>ui-btn</code>, ba biến thể, tông đỏ, một cỡ nhỏ. Cao 28px dưới chuột như Button của Polaris (ô nhập và ô chọn 32, như TextField), 44px dưới ngón tay và ở khổ điện thoại, cỡ nhỏ cũng vậy. Dùng được trên <code><button></code> lẫn <code><a></code> (căn giữa sẵn).</p><figure class="cat-demo"><figcaption>Mặc định · chính · ghost · nhỏ · tắt</figcaption><div class="cat-live"><div class="cat-row"><button type="button" class="ui-btn">Lưu nháp</button><button type="button" class="ui-btn ui-btn--primary">Xuất bản</button><button type="button" class="ui-btn ui-btn--ghost">Huỷ</button><button type="button" class="ui-btn ui-btn--sm">Nhỏ</button><button type="button" class="ui-btn ui-btn--primary" disabled>Đang lưu…</button><a class="ui-btn" href="#buttons">Link dạng nút</a></div></div><details class="cat-code"><summary>Markup</summary><pre><code><div class="cat-row">
|
|
33
33
|
<button type="button" class="ui-btn">Lưu nháp</button>
|
package/gemboss-ui.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* GemBoss admin design system — GENERATED — do not edit; regenerate from gemboss:
|
|
3
3
|
* node apps/admin/scripts/export-ui-css.mjs --out <path> (npm run export:ui-css)
|
|
4
|
-
* gemboss commit:
|
|
4
|
+
* gemboss commit: 3dca8802a7748e92806a754e2232b1d9749db720
|
|
5
5
|
* sources sha256: 8195d897d87606ad33f8b4be997b2df09f2323a6c7fe2c0fe36ccbbea465a436
|
|
6
6
|
* contents: 1 allow-listed rule from apps/admin/src/app/globals.css + packages/ui/src/gemboss-tokens.css
|
|
7
7
|
* (verbatim) + packages/ui/src/ui.css (verbatim) + packages/ui/src/gemboss-field.css (verbatim)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemboss/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "GemBoss design system for every surface in the fleet: the admin shell (topbar + rail + drawer) as React components, and the admin stylesheet exported as one CSS file.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
package/parts/components.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @gemboss/ui components.css — GENERATED by packages/ui/scripts/build-css.mjs from export:ui + export:field + src/menu.css + src/pager.css + src/kit-plain.css; do not edit
|
|
3
|
-
* gemboss commit:
|
|
3
|
+
* gemboss commit: 3dca8802a7748e92806a754e2232b1d9749db720
|
|
4
4
|
*/
|
|
5
5
|
:root{--ui-surface: #ffffff;--ui-surface: var(--gemboss-surface, #ffffff);--ui-surface-2: var(--gemboss-hover, #eceef2);--ui-text: var(--gemboss-text, #1b1c1e);--ui-text-muted: var(--gemboss-text-muted, #686b71);--ui-border: var(--gemboss-divider, #e5e7ea);--ui-accent: var(--gemboss-primary, #1b1c1e);--ui-accent-hover: var(--gemboss-primary-dark, #000000);--ui-accent-fg: #ffffff;--ui-accent-soft: var(--gemboss-active-bg, #f0f1f4);--ui-accent-strong: var(--gemboss-active-fg, #1b1c1e);--ui-text-strong: var(--gemboss-text-strong, #1b1c1e);--ui-success-fg: var(--gemboss-success);--ui-warning-fg: var(--gemboss-primary-dark);--ui-danger-fg: var(--gemboss-danger-strong);--ui-focus: var(--gemboss-accent, #5661f5);--ui-radius-sm: 6px;--ui-radius-md: 8px;--ui-radius-lg: 12px;--ui-space-1: 4px;--ui-space-2: 8px;--ui-space-3: 12px;--ui-space-4: 16px;--ui-control-h: 32px;--ui-btn-h: 28px;--ui-card-shadow: 0 1px 0 rgba(26,26,26,.07);--ui-fs-body: 13px;--ui-fs-caption: 12px;--ui-content-max: 900px}.gemboss-admin-shell{--ui-surface: var(--adm-surface);--ui-surface-2: var(--adm-surface-2);--ui-text: var(--adm-text);--ui-text-muted: var(--adm-muted);--ui-border: var(--adm-divider);--ui-accent: var(--adm-accent);--ui-accent-hover: var(--gemboss-primary-dark, #000000);--ui-accent-fg: #ffffff;--ui-accent-soft: var(--adm-accent-soft);--ui-accent-strong: var(--adm-accent-fg);--ui-text-strong: var(--adm-text-strong);--ui-success-fg: color-mix(in srgb, var(--gemboss-success) 70%, #ffffff);--ui-warning-fg: color-mix(in srgb, #c99a2e 70%, #ffffff);--ui-danger-fg: color-mix(in srgb, var(--gemboss-danger-strong) 70%, #ffffff);--ui-focus: var(--adm-accent);--ui-card-shadow: none}.ui-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-space-2);height:var(--ui-btn-h);padding:0 var(--ui-space-3);box-sizing:border-box;line-height:1;white-space:nowrap;vertical-align:middle;border-radius:var(--ui-radius-md);font-family:inherit;font-size:var(--ui-fs-caption);font-weight:550;cursor:pointer;text-decoration:none;user-select:none;border:1px solid var(--ui-border);background:transparent;color:var(--ui-text);transition:background .12s ease,border-color .12s ease}.ui-btn:hover{background:var(--ui-surface-2);text-decoration:none}.ui-btn:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.ui-btn[disabled],.ui-btn[aria-disabled=true]{opacity:.5;cursor:not-allowed}.ui-btn--primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-accent-fg)}.ui-btn--primary:hover{background:var(--ui-accent-hover);border-color:var(--ui-accent-hover)}.ui-btn--ghost{border-color:transparent;background:transparent;color:var(--ui-text-muted)}.ui-btn--ghost:hover{background:var(--ui-surface-2);color:var(--ui-text)}.ui-btn--on,.ui-btn--on:hover{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-strong)}.ui-card{background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg);box-shadow:var(--ui-card-shadow);padding:var(--ui-space-4);color:var(--ui-text)}.ui-card__title{font-size:14px;line-height:20px;font-weight:650;margin:0 0 var(--ui-space-2)}.ui-card__head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--ui-space-2);margin-bottom:var(--ui-space-2)}.ui-card__head>.ui-card__title{margin:0}.ui-card__head>:last-child:not(.ui-card__title){display:flex;flex-wrap:wrap;gap:var(--ui-space-2)}.ui-select{height:var(--ui-control-h);padding:0 32px 0 12px;max-width:100%;background:var(--gemboss-field-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'><path fill='%239a9aa4' d='M5 7l5 5 5-5z'/></svg>") no-repeat right 10px center;border:1px solid var(--gemboss-field-line);border-radius:var(--ui-radius-md);color:var(--gemboss-field-ink);font-family:inherit;font-size:var(--ui-fs-body);font-weight:450;appearance:none;-webkit-appearance:none;cursor:pointer}.ui-select:hover:not(:disabled){border-color:var(--gemboss-field-line-hover);background-color:var(--gemboss-field-bg-hover)}.ui-select:focus{outline:none}.ui-select:focus-visible:not(:disabled){outline:2px solid var(--ui-focus);outline-offset:1px;border-color:var(--gemboss-field-line-active)}.ui-select:disabled{opacity:.5;cursor:not-allowed}.ui-select--slim{height:30px;font-size:var(--ui-fs-caption)}.ui-tag{display:inline-flex;align-items:center;gap:6px;font-size:var(--ui-fs-caption);line-height:20px;font-weight:450;padding:0 6px;border-radius:var(--ui-radius-md);background:var(--ui-surface-2);color:var(--ui-text-muted)}.ui-tag--accent{background:var(--adm-accent-soft, rgba(20,22,26,.05));color:var(--adm-accent-fg, var(--ui-accent))}.ui-tag--chip{text-transform:none;letter-spacing:0;font-size:11px;font-weight:500;padding:2px 8px;background:transparent;border:1px solid var(--ui-border);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ui-tag--chip.ui-tag--accent{color:var(--adm-accent-fg, var(--ui-accent));border-color:var(--ui-accent);background:transparent}.ui-chips{display:flex;flex-wrap:wrap;gap:var(--ui-space-2, 8px);margin:0;padding:0;list-style:none}.ui-chips>a.ui-tag--chip{min-height:28px;padding:4px 12px;border-radius:var(--ui-radius-md, 8px);font-family:inherit;font-size:var(--gemboss-fs-caption, 12px);color:var(--ui-text);text-decoration:none}.ui-chips>a.ui-tag--chip:hover{background:var(--ui-surface-2);border-color:var(--ui-text-muted)}.ui-chips>a.ui-tag--chip:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-chips>a.ui-tag--chip[aria-current=page]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-strong);font-weight:600}.ui-tag--success{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong, var(--gemboss-success))}.ui-tag--warning{background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.ui-tag--danger{background:var(--gemboss-danger-soft);color:var(--gemboss-danger-strong, var(--gemboss-danger))}.ui-muted{color:var(--ui-text-muted);font-size:var(--ui-fs-caption)}.ui-page-head{margin-bottom:20px}.ui-page-head h1{color:var(--ui-text-strong);font-size:20px;line-height:24px;font-weight:700;letter-spacing:-.01em}.ui-page-head p{color:var(--ui-text-muted);font-size:var(--ui-fs-body);margin-top:4px}.ui-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:20px}.ui-metrics{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0}.ui-metric{display:flex;flex-direction:column;gap:1px;min-width:78px;padding:8px 12px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:12px}a.ui-metric{text-decoration:none;color:inherit}a.ui-metric:hover{border-color:var(--ui-text-muted)}a.ui-metric:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-metric__val{font-size:17px;font-weight:700;color:var(--ui-text);font-variant-numeric:tabular-nums;line-height:1.15}.ui-metric__lbl{font-size:var(--ui-fs-caption);font-weight:500;color:var(--ui-text-muted)}.ui-metric--success{border-color:color-mix(in srgb,var(--gemboss-success) 40%,transparent)}.ui-metric--success .ui-metric__val{color:var(--ui-success-fg)}.ui-metric--warning{border-color:color-mix(in srgb,#c99a2e 40%,transparent)}.ui-metric--warning .ui-metric__val{color:var(--ui-warning-fg)}.ui-metric--danger{border-color:color-mix(in srgb,var(--gemboss-danger-strong) 40%,transparent)}.ui-metric--danger .ui-metric__val{color:var(--ui-danger-fg)}.ui-dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px 16px;margin:0}.ui-dl>div{min-width:0}.ui-dl dt{font-size:var(--ui-fs-caption);color:var(--ui-text-muted)}.ui-dl dd{margin:4px 0 0;font-weight:600;color:var(--ui-text);overflow-wrap:anywhere}.ui-notice{padding:12px 16px;border-radius:var(--ui-radius-md);border:1px solid var(--ui-border);background:var(--ui-surface-2);color:var(--ui-text);font-size:var(--ui-fs-body);overflow-wrap:anywhere}.ui-notice--warning{background:var(--gemboss-warning-soft);border-color:var(--gemboss-warning-border);color:var(--gemboss-warning)}.ui-notice--danger{background:var(--gemboss-danger-soft);border-color:var(--gemboss-danger-border);color:var(--gemboss-danger-strong)}.ui-notice--success{background:var(--gemboss-success-soft);border-color:var(--gemboss-success-border);color:var(--gemboss-success-strong)}.ui-pager{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:16px 0}.ui-pager>a{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md);color:var(--ui-text);text-decoration:none;font-size:var(--ui-fs-body)}.ui-pager>a:hover{background:var(--ui-surface-2)}.ui-pager>a:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-pager>[aria-current=page]{color:var(--ui-text-muted);font-size:var(--ui-fs-caption)}.ui-badge{display:inline-flex;align-items:center;gap:4px;font-size:var(--ui-fs-caption);line-height:16px;font-weight:450;white-space:nowrap;padding:2px 8px;border-radius:var(--ui-radius-md);background:color-mix(in srgb,var(--ui-text) 8%,transparent);color:var(--ui-text-muted)}.ui-overlay{position:fixed;inset:0;z-index:500;background:#00000080;display:grid;place-items:center;padding:20px}.ui-modal{width:min(460px,100%);background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:16px;box-shadow:var(--gemboss-shadow-overlay, 0 20px 60px rgba(0, 0, 0, .4));overflow:hidden}.ui-modal:focus{outline:none}.ui-modal__head{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--ui-border);font-size:14px;line-height:20px;font-weight:650;color:var(--ui-text)}.ui-modal__title{min-width:0;flex:1 1 auto}.ui-modal__subtitle{display:block;margin-top:2px;font-size:var(--ui-fs-caption);line-height:16px;font-weight:450;color:var(--ui-text-muted);overflow-wrap:anywhere}.ui-modal__actions{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2)}.ui-modal__close{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:var(--ui-radius-md, 8px);background:transparent;color:var(--ui-text-muted);cursor:pointer}.ui-modal__close svg{width:20px;height:20px}.ui-modal__close:hover{background:var(--ui-surface-2);color:var(--ui-text)}.ui-modal__close:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.ui-modal__body{padding:16px}.ui-modal__foot{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;padding:12px 16px;border-top:1px solid var(--ui-border)}@media (pointer: coarse),(max-width: 47.9975em){.ui-modal__close{width:44px;height:44px;margin:-8px -8px -8px 0}:is(.ui-modal__head,.ui-modal__foot) .ui-btn{min-height:44px}}.ui-modal--lg{position:relative}.ui-textarea{width:100%;min-height:96px;resize:vertical;box-sizing:border-box;background:var(--gemboss-field-bg);border:1px solid var(--gemboss-field-line);border-radius:var(--ui-radius-md);padding:12px;color:var(--gemboss-field-ink);font-size:var(--ui-fs-body);line-height:1.5;font-family:inherit}.ui-textarea::placeholder{color:var(--gemboss-field-placeholder)}.ui-textarea:hover:not(:disabled){border-color:var(--gemboss-field-line-hover);background-color:var(--gemboss-field-bg-hover)}.ui-textarea:focus{outline:none}.ui-textarea:focus-visible:not(:disabled){outline:2px solid var(--ui-focus);outline-offset:1px;border-color:var(--gemboss-field-line-active)}.ui-textarea:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 47.9975em){.ui-select.ui-select,.ui-textarea{font-size:16px}.ui-select:not(.ui-select--slim){min-height:44px}}.ui-seg{display:inline-flex;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md);overflow:hidden;overflow:clip;min-width:0}.ui-seg :is(button,a){display:inline-grid;place-items:center;width:calc(var(--ui-btn-h) - 2px);height:calc(var(--ui-btn-h) - 2px);border:0;background:transparent;color:var(--ui-text-muted);cursor:pointer;font-family:inherit}.ui-seg :is(button,a).is-text{width:auto;padding:0 12px;font-size:var(--ui-fs-caption);font-weight:550;grid-auto-flow:column;column-gap:2px}.ui-seg :is(button,a)+:is(button,a){border-left:1px solid var(--ui-border)}.ui-seg :is(button,a):hover{background:var(--ui-surface-2);color:var(--ui-text)}.ui-seg :is(button,a):focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.ui-seg a{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:var(--ui-text-muted)}.ui-seg a[aria-current=page],.ui-seg button.active{background:var(--ui-accent-soft);color:var(--ui-accent-strong)}.ui-seg svg{width:16px;height:16px;fill:currentColor}.ui-seg svg[fill=none]{fill:none}.ui-seg :is(button,a):is(:disabled,[aria-disabled=true]){opacity:.45;cursor:not-allowed}.ui-seg :is(button,a):is(:disabled,[aria-disabled=true]):not(.active):hover{background:transparent;color:var(--ui-text-muted)}.ui-seg--fill{display:flex;width:100%}.ui-seg.ui-seg--fill>:is(button,a).is-text{flex:1 1 0;min-width:0}.ui-seg-n{margin-left:6px;font-variant-numeric:tabular-nums;color:var(--ui-text-muted);font-weight:450}.ui-stats{display:flex;flex-wrap:wrap;gap:var(--ui-space-2);margin-bottom:24px}.ui-stat{display:inline-flex;align-items:center;gap:var(--ui-space-2);padding:6px 12px;border-radius:999px;font-family:inherit;background:var(--ui-surface);border:1px solid var(--ui-border);font-size:var(--ui-fs-caption);color:var(--ui-text-muted)}.ui-stat b{color:var(--ui-text-strong);font-weight:650}.ui-stat.is-clickable{cursor:pointer;transition:border-color .14s ease,background-color .14s ease}.ui-stat.is-clickable:hover{border-color:var(--ui-text-muted);background:var(--ui-surface-2)}.ui-stat.is-clickable.active{border-color:var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent-strong)}.ui-stat.is-clickable.active b{color:var(--ui-accent-strong)}.gemboss-toast-viewport{position:fixed;left:50%;bottom:24px;transform:translate(-50%);z-index:2147483000;display:flex;flex-direction:column;align-items:center;gap:12px;width:max-content;max-width:min(560px,calc(100vw - 32px));pointer-events:none}.gemboss-toast{pointer-events:auto;display:flex;align-items:center;gap:12px;min-width:220px;max-width:100%;padding:12px 12px 12px 16px;background:var(--ui-text-strong, #1a1917);color:var(--gemboss-on-primary, #fff);border-radius:12px;font-size:var(--ui-fs-body, 13px);line-height:1.4;font-weight:500;box-shadow:var(--gemboss-shadow-overlay, 0 8px 28px rgba(0, 0, 0, .24));animation:gemboss-toast-in .24s cubic-bezier(.16,1,.3,1)}.gemboss-toast.is-error{background:var(--gemboss-danger, #d72c0d)}.gemboss-toast-text{flex:1 1 auto;min-width:0}.gemboss-toast-action{flex:0 0 auto;border:0;background:transparent;color:var(--gemboss-on-primary, #fff);cursor:pointer;padding:4px 8px;border-radius:8px;font:inherit;font-weight:650;text-decoration:underline;text-underline-offset:2px;transition:background .14s ease}.gemboss-toast-action:hover{background:#ffffff29}.gemboss-toast-dismiss{flex:0 0 auto;display:inline-grid;place-items:center;width:24px;height:24px;border:0;border-radius:8px;cursor:pointer;background:#ffffff1f;color:var(--gemboss-on-primary, #fff);transition:background .14s ease}.gemboss-toast-dismiss:hover{background:#ffffff42}.gemboss-toast-action:focus-visible,.gemboss-toast-dismiss:focus-visible{outline:2px solid var(--gemboss-on-primary, #fff);outline-offset:2px}@keyframes gemboss-toast-in{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.gemboss-toast{animation:none}}@media (max-width: 47.9975em){.ui-btn:not(.ui-btn--sm),.ui-seg :is(button,a){min-height:44px}.ui-seg :is(button,a):not(.is-text){min-width:44px}}@media (pointer: coarse){.ui-btn:not(.ui-btn--sm),.ui-stat.is-clickable,.ui-chips>a.ui-tag--chip,.ui-pager>a,.ui-seg :is(button,a){min-height:44px}.ui-stat.is-clickable{min-width:44px;justify-content:center}.ui-chips>a.ui-tag--chip{min-width:44px;justify-content:center}.ui-select.ui-select,.ui-select--slim.ui-select--slim{min-height:44px}.ui-seg :is(button,a){min-width:44px}}.ui-skeleton{display:flex;flex-direction:column;gap:var(--ui-space-2)}.ui-skeleton__line{display:block;height:12px;border-radius:6px;background:linear-gradient(90deg,var(--ui-surface-2) 25%,var(--ui-border) 37%,var(--ui-surface-2) 63%);background-size:400% 100%;animation:ui-skeleton-sheen 1.4s ease-in-out infinite}@keyframes ui-skeleton-sheen{0%{background-position:100% 50%}to{background-position:0 50%}}@media (prefers-reduced-motion: reduce){.ui-skeleton__line{animation:none;background:var(--ui-surface-2)}}.ui-sr-only{position:absolute;left:0;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.ui-resizer{cursor:col-resize;position:relative;touch-action:none;outline:none}.ui-resizer:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:44px;border-radius:var(--gemboss-radius-full);background:var(--gemboss-primary);opacity:0;transition:opacity .14s ease,height .14s ease}.ui-resizer:hover:before,.ui-resizer:focus-visible:before,.ui-resizer.dragging:before,body.ui-resizing .ui-resizer:before{opacity:1;height:52px}@media (pointer: coarse){.ui-resizer:after{content:"";position:absolute;inset:0 -14px;touch-action:none;z-index:2}}body.ui-resizing,body.ui-resizing *{cursor:col-resize!important;user-select:none!important}body.ui-resizing:after{content:"";position:fixed;inset:0;z-index:9999;cursor:col-resize}.ui-tabs{display:flex;gap:var(--ui-space-2);border-bottom:1px solid var(--ui-border);overflow-x:auto;scrollbar-width:none}.ui-tabs>button,.ui-tabs>a{position:relative;flex:0 0 auto;display:inline-flex;align-items:center;gap:var(--ui-space-2);min-height:var(--ui-btn-h);padding:0 var(--ui-space-3);border:0;background:transparent;cursor:pointer;border-radius:var(--ui-radius-sm) var(--ui-radius-sm) 0 0;font-family:inherit;font-size:var(--ui-fs-caption);font-weight:550;white-space:nowrap;color:var(--ui-text-muted);transition:color var(--gemboss-transition-fast) ease,background-color var(--gemboss-transition-fast) ease}.ui-tabs>button:hover,.ui-tabs>a:hover{color:var(--ui-text);background:var(--ui-surface-2)}.ui-tabs>button:focus-visible,.ui-tabs>a:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.ui-tabs>a{text-decoration:none}.ui-tabs>a[aria-current=page],.ui-tabs>button[aria-selected=true]{color:var(--ui-text-strong)}.ui-tabs>a[aria-current=page]:after,.ui-tabs>button[aria-selected=true]:after{content:"";position:absolute;left:var(--ui-space-3);right:var(--ui-space-3);bottom:0;height:2px;border-radius:var(--gemboss-radius-full);background:var(--ui-accent)}.ui-tabs>button:disabled{opacity:.5;cursor:not-allowed}@media (pointer: coarse),(max-width: 47.9975em){.ui-tabs>:is(button,a){min-height:44px}}.ui-table-wrap{overflow-x:auto;max-width:100%;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:var(--ui-radius-lg);box-shadow:var(--ui-card-shadow)}.ui-table{width:100%;border-collapse:collapse;font-size:var(--ui-fs-body);color:var(--ui-text)}.ui-table th,.ui-table td{padding:var(--ui-space-2) 6px;text-align:left;vertical-align:middle;border-bottom:1px solid var(--ui-border)}.ui-table :is(th,td):where(:first-child){padding-left:var(--ui-space-3)}.ui-table :is(th,td):where(:last-child){padding-right:var(--ui-space-3)}.ui-table th{font-weight:450;color:var(--ui-text-muted);white-space:nowrap}.ui-table thead th{padding-block:var(--ui-space-3)}.ui-table tbody tr:last-child>:is(td,th){border-bottom:0}.ui-table tbody tr:hover{background:var(--ui-surface-2)}.ui-table .is-num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.ui-table td>a{display:inline-flex;align-items:center;min-height:24px}.ui-table .ui-sub{display:block;margin-top:2px;font-size:var(--ui-fs-caption);color:var(--ui-text-muted);font-weight:400}.ui-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--ui-space-2);padding:var(--ui-space-4);padding-block:40px;text-align:center;color:var(--ui-text-muted);font-size:var(--ui-fs-body)}.ui-empty__title{margin:0;font-size:14px;line-height:20px;font-weight:650;color:var(--ui-text-strong)}.ui-empty__body{margin:0;max-width:48ch;line-height:1.5}.ui-empty>.ui-btn{margin-top:var(--ui-space-2)}.gemboss-field,.gemboss-control{box-sizing:border-box;height:32px;min-width:0;padding:0 12px;font:inherit;font-size:13px;line-height:20px;color:var(--gemboss-field-ink);background-color:var(--gemboss-field-bg);border:1px solid var(--gemboss-field-line);border-radius:8px}input[type=search]:is(.gemboss-field,.gemboss-field__bare){-webkit-appearance:none;appearance:none}.gemboss-field::placeholder{color:var(--gemboss-field-placeholder)}.gemboss-field--tall{min-height:44px}.gemboss-field--narrow{padding:0 6px;appearance:textfield;-moz-appearance:textfield}.gemboss-field--narrow::-webkit-outer-spin-button,.gemboss-field--narrow::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gemboss-field:hover:not(:disabled):not(:has(>.gemboss-field__bare:disabled)),.gemboss-control:hover:not(:disabled){border-color:var(--gemboss-field-line-hover);background-color:var(--gemboss-field-bg-hover)}.gemboss-field:focus-visible,.gemboss-control:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--gemboss-field-line-active)}.gemboss-field:disabled,.gemboss-control:disabled{opacity:.5;cursor:not-allowed}@media (max-width: 47.9975em){.gemboss-field,.gemboss-control{font-size:16px;min-height:44px}}textarea.gemboss-field{height:auto;padding:6px 12px;resize:vertical}.gemboss-field--group{display:flex;align-items:center;gap:6px;height:auto;min-height:32px;padding-right:0;overflow:hidden}@media (max-width: 47.9975em){.gemboss-field--group{min-height:44px}}.gemboss-field--group:focus-within{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px;border-color:var(--gemboss-field-line-active)}.gemboss-field--group input[type=color]{flex:none;align-self:stretch;width:44px;min-width:44px;height:auto;min-height:0;margin:-1px 0 -1px -12px;padding:0;border:0;border-right:1px solid var(--gemboss-field-line);border-radius:0;background:none;cursor:pointer}.gemboss-field--group input[type=color]::-webkit-color-swatch-wrapper{padding:0}.gemboss-field--group input[type=color]::-webkit-color-swatch{border:0;border-radius:0}.gemboss-field__bare{flex:1;min-width:0;align-self:stretch;margin-block:-1px;padding:0 12px 0 0;border:0;border-radius:0;outline:none;background:transparent;color:inherit;font:inherit}.gemboss-field__bare::placeholder{color:var(--gemboss-field-placeholder)}.gemboss-field__suffix{flex:none;padding-right:12px;color:var(--gemboss-field-placeholder)}.gemboss-field__bare:has(+.gemboss-field__suffix){padding-right:0}.gemboss-field--group:has(>.gemboss-field__bare:disabled){opacity:.5;cursor:not-allowed}.gemboss-field__bare:disabled{cursor:not-allowed}@media (pointer: coarse){.gemboss-field,.gemboss-control{height:auto;min-height:44px}}.gemboss-control{cursor:pointer}.gemboss-control.gemboss-control--icon{width:32px;flex:0 0 auto;padding:0}@media (pointer: coarse){.gemboss-control.gemboss-control--icon{width:44px;min-width:44px}}.ui-btn--icon{flex:none;width:var(--ui-btn-h);padding:0}.ui-btn--icon svg{width:18px;height:18px}.ui-menu{position:relative;display:inline-block}.ui-menu>summary{list-style:none;cursor:pointer}.ui-menu>summary::-webkit-details-marker{display:none}.ui-menu__list{position:absolute;z-index:20;top:calc(100% + 4px);left:0;display:grid;min-width:220px;padding:6px;box-sizing:border-box}.ui-menu--end .ui-menu__list{left:auto;right:0}.ui-menu__list[popover]{position:fixed;inset:auto;margin:0;overflow:auto}.ui-menu__list[popover]:not(:popover-open){display:none}:where(.ui-menu__list[popover]){border:0;background:none;color:inherit}:root[data-gb-menus=float] .ui-menu[open]>.ui-menu__list:not([popover]){visibility:hidden}.ui-menu__item:is([disabled],[aria-disabled=true]){opacity:.5;cursor:not-allowed;pointer-events:none}.ui-menu__hint{margin-left:auto;padding-left:var(--ui-space-4);color:var(--ui-text-muted);font-size:var(--ui-fs-caption)}.ui-menu__sep{height:1px;margin:var(--ui-space-1) 0;border:0;background:var(--ui-border)}@media (pointer: coarse){.ui-btn--icon:not(.ui-btn--sm){min-width:44px}}@media (max-width: 47.9975em){.ui-btn--icon:not(.ui-btn--sm){min-width:44px;min-height:44px}}.ui-pager>a,.ui-pager>[aria-disabled=true]{min-width:32px;justify-content:center;box-sizing:border-box;gap:4px}.ui-pager>a[aria-current=page]{background:var(--ui-text);border-color:var(--ui-text);color:var(--ui-surface);font-size:var(--ui-fs-body);font-weight:600}.ui-pager>a[aria-current=page]:hover{background:var(--ui-text)}.ui-pager>[aria-disabled=true]{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md);color:var(--ui-text-muted);font-size:var(--ui-fs-body);opacity:.55;cursor:default}.ui-pager>[aria-disabled=true]:hover{background:none}.ui-pager__gap{min-width:16px;text-align:center;color:var(--ui-text-muted)}.ui-pager__range{margin-left:auto;color:var(--ui-text-muted);font-size:var(--ui-fs-body);font-variant-numeric:tabular-nums}@media (pointer: coarse),(max-width: 47.9975em){.ui-pager>a,.ui-pager>[aria-disabled=true]{min-width:44px;min-height:44px}}@media (max-width: 35.9975em){.ui-pager>a:not([rel]):not([aria-current]):not([aria-disabled]),.ui-pager__gap{display:none}}.ui-check{display:inline-flex;align-items:center;gap:var(--ui-space-2);min-height:44px;max-width:100%;overflow-wrap:break-word;cursor:pointer;font-size:var(--ui-fs-body);color:var(--ui-text)}.ui-check>input{flex:none;width:18px;height:18px;margin:0;accent-color:var(--ui-accent);cursor:inherit}.ui-check>input:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.ui-check:has(>input:disabled){opacity:.5;cursor:not-allowed}.ui-check>:last-child:not(input){min-width:0}.ui-label{display:block;margin:0 0 var(--ui-space-1);font-size:var(--ui-fs-caption);font-weight:600;color:var(--ui-text-muted)}.ui-kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:var(--ui-space-2) var(--ui-space-4);margin:0;font-size:var(--ui-fs-body)}.ui-kv>dt{color:var(--ui-text-muted)}.ui-kv>dd{margin:0;min-width:0;overflow-wrap:anywhere;color:var(--ui-text)}.ui-link,.ui-prose :where(a:not([class])){color:var(--gemboss-accent-strong, #3a44de);text-decoration:underline;text-decoration-thickness:from-font;text-underline-offset:2px}.ui-link:visited,.ui-prose :where(a:not([class])):visited{color:var(--gemboss-accent-strong, #3a44de)}.ui-link:hover,.ui-prose :where(a:not([class])):hover{color:var(--gemboss-accent, #5661f5);text-decoration-thickness:2px}.ui-link:focus-visible,.ui-prose :where(a:not([class])):focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px;border-radius:2px}.ui-card--media{position:relative;padding:0;overflow:hidden;display:flex;flex-direction:column}.ui-card__link{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;color:var(--ui-text);font-size:var(--ui-fs-body);line-height:20px;font-weight:650;text-decoration:none;overflow-wrap:anywhere}.ui-card__link:after{content:"";position:absolute;inset:0;z-index:0}.ui-card__link:focus-visible{outline:none}.ui-card--media:has(.ui-card__link){cursor:pointer}.ui-card--media:has(.ui-card__link:hover){border-color:var(--ui-text-muted)}.ui-card--media:has(.ui-card__link:focus-visible){outline:2px solid var(--ui-focus);outline-offset:1px}.ui-card--media :is(.ui-card__foot button,.ui-card__foot a,.ui-card__body a:not(.ui-card__link),.ui-card__body button,select,input,summary){position:relative;z-index:1}.ui-card__menu{position:absolute;top:8px;right:8px;z-index:2}.ui-card--media:has(>.ui-card__menu){overflow:visible}.ui-card--media:has(>.ui-card__menu)>.ui-card__media{border-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0}.ui-card__meta{color:var(--ui-text-muted);font-size:var(--ui-fs-caption);line-height:16px}.ui-card--media[data-ratio="4/3"]>.ui-card__media{aspect-ratio:4 / 3}.ui-card--media[data-ratio="1/1"]>.ui-card__media{aspect-ratio:1 / 1}.ui-card__media{display:block;width:100%;aspect-ratio:16 / 10;margin:0;padding:0;border:0;border-bottom:1px solid var(--ui-border);background:var(--ui-surface-2);overflow:hidden;color:inherit}.ui-card__media>img{display:block;width:100%;height:100%;object-fit:cover}button.ui-card__media,a.ui-card__media{cursor:pointer}.ui-card__media:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:-2px}.ui-card__body{display:grid;justify-items:start;gap:var(--ui-space-2, 8px);padding:var(--ui-space-3, 12px) var(--ui-space-4, 16px);min-width:0}.ui-card__foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--ui-space-2, 8px);margin-top:auto;padding:0 var(--ui-space-4, 16px) var(--ui-space-3, 12px);color:var(--ui-text-muted);font-size:var(--ui-fs-caption, 13px)}.ui-overlay>.ui-modal{display:flex;flex-direction:column;max-height:calc(100dvh - 40px)}.ui-modal>.ui-modal__head,.ui-modal>.ui-modal__foot{flex:none}.ui-modal>.ui-modal__body{flex:1 1 auto;min-height:0;overflow:auto}:root{--ui-series-1: var(--gemboss-accent, #5661f5);--ui-series-2: #0f9f8f;--ui-series-3: #d9822b;--ui-series-4: #c2417a;--ui-series-5: #6b7280}.ui-delta{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:2px;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-delta--good{color:var(--ui-success-fg)}.ui-delta--bad{color:var(--ui-danger-fg)}.ui-metrics--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:var(--ui-space-3);margin:0}.ui-metric--lg{gap:4px;padding:var(--ui-space-3) var(--ui-space-4)}.ui-metric--lg .ui-metric__val{font-size:24px;line-height:32px}.ui-metric--lg .ui-metric__lbl{order:-1;font-size:var(--ui-fs-body)}.ui-metric__foot{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}@media (max-width: 520px){.ui-metrics--grid{grid-template-columns:repeat(2,minmax(0,1fr))}}.ui-barlist{display:grid;gap:var(--ui-space-3);margin:0;padding:0;list-style:none;font-size:var(--ui-fs-body, 13px)}.ui-barlist>li{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:4px var(--ui-space-3)}.ui-barlist__label{min-width:0;overflow-wrap:anywhere;color:var(--ui-text)}.ui-barlist__label a{color:inherit}.ui-barlist__val{font-weight:600;color:var(--ui-text);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}.ui-barlist__share{margin-left:6px;font-weight:400;color:var(--ui-text-muted)}.ui-barlist__note{grid-column:1 / -1;margin-top:-2px;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}.ui-barlist__bar{grid-column:1 / -1;position:relative;height:6px;border-radius:999px;background:var(--ui-surface-2);overflow:hidden}.ui-barlist__bar:after{content:"";position:absolute;inset:0 auto 0 0;width:calc(var(--v, 0) * 100%);min-width:3px;border-radius:inherit;background:var(--c, var(--ui-series-1))}.ui-chart{margin:0}.ui-chart__plot{position:relative;display:flex;align-items:flex-end;justify-content:space-between;gap:3px;height:180px;padding-top:18px;border-bottom:1px solid var(--ui-border);background:linear-gradient(to top,var(--ui-border) 1px,transparent 1px) 0 0 / 100% 25% repeat-y;background-origin:content-box;background-clip:content-box}.ui-chart__plot[data-max]:before{content:attr(data-max);position:absolute;top:0;left:0;font-size:var(--gemboss-fs-micro, 11px);line-height:1;color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-chart__col{position:relative;flex:1 1 0;min-width:0;max-width:48px;height:100%;display:flex;flex-direction:column-reverse}.ui-chart__col:hover{background:color-mix(in srgb,var(--ui-text) 6%,transparent)}.ui-chart__seg{display:block;flex:none;height:calc(var(--v, 0) * 100%);background:var(--c, var(--ui-series-1))}.ui-chart__dot{position:absolute;left:50%;bottom:calc(var(--v, 0) * 100%);width:8px;height:8px;margin:0 0 -4px -4px;box-sizing:border-box;border-radius:50%;background:var(--ui-surface);border:2px solid var(--c, var(--ui-text-strong, var(--ui-text)))}.ui-chart__axis{display:flex;justify-content:space-between;gap:var(--ui-space-2);margin-top:6px;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted);font-variant-numeric:tabular-nums}.ui-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin:var(--ui-space-2) 0 0;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}.ui-legend__item{display:inline-flex;align-items:center;gap:6px}.ui-legend__item>i{display:inline-block;width:10px;height:10px;border-radius:2px;background:var(--c, var(--ui-series-1))}.ui-legend__item--dot>i{border-radius:50%;background:var(--ui-surface);border:2px solid var(--c, var(--ui-text-strong, var(--ui-text)));box-sizing:border-box}.ui-funnel{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:var(--ui-space-2);margin:0;padding:0;list-style:none}.ui-funnel>li{position:relative;display:flex;flex-direction:column;gap:2px;padding:var(--ui-space-3);border-radius:var(--ui-radius-md);background:var(--ui-surface-2);min-width:0}.ui-funnel__val{font-size:20px;font-weight:700;color:var(--ui-text);font-variant-numeric:tabular-nums;line-height:24px}.ui-funnel__lbl{font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted);overflow-wrap:anywhere}.ui-funnel__rate{order:-1;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--ui-series-1);font-variant-numeric:tabular-nums}@media (max-width: 520px){.ui-funnel{grid-auto-flow:row}}.ui-grid{display:grid;gap:var(--ui-space-4);align-items:start}.ui-grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}.ui-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width: 1100px){.ui-grid--3{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 960px){.ui-grid--2{grid-template-columns:minmax(0,1fr)}}@media (max-width: 720px){.ui-grid--3{grid-template-columns:minmax(0,1fr)}}.ui-section-head{margin:var(--ui-space-4) 0 0}.ui-section-head>h2{margin:0;font-size:14px;line-height:20px;font-weight:650;color:var(--ui-text)}.ui-section-head>p{margin:2px 0 0;font-size:var(--gemboss-fs-caption);color:var(--ui-text-muted)}.ui-seg{max-width:100%;overflow-x:auto}.ui-seg :is(button,a).is-text{flex:none;white-space:nowrap}@media (max-width: 360px){.ui-seg :is(button,a).is-text{padding:0 9px}}@media (pointer: coarse),(max-width: 47.9975em){.ui-seg :is(button,a){height:44px;min-height:44px}}.ui-btn--critical{color:var(--gemboss-danger-strong)}.ui-btn--critical:hover{background:var(--gemboss-danger-soft);color:var(--gemboss-danger-strong)}.ui-btn--primary.ui-btn--critical{background:var(--gemboss-danger);border-color:var(--gemboss-danger);color:var(--gemboss-on-primary)}.ui-btn--primary.ui-btn--critical:hover{background:var(--gemboss-danger-strong);border-color:var(--gemboss-danger-strong);color:var(--gemboss-on-primary)}.ui-btn--critical:focus-visible{outline-color:var(--gemboss-danger-strong)}@media (pointer: coarse),(max-width: 47.9975em){.ui-btn,.ui-btn.ui-btn--sm,.ui-select.ui-select{min-height:44px}.ui-btn--icon.ui-btn--sm,.ui-seg :is(button,a):not(.is-text){min-width:44px}}.ui-badge--success{background:var(--gemboss-success-soft);color:var(--gemboss-success-strong)}.ui-badge--warning{background:var(--gemboss-warning-soft);color:var(--gemboss-warning)}.ui-badge--critical{background:var(--gemboss-danger-soft);color:var(--gemboss-danger-strong)}.ui-badge--info{background:var(--gemboss-accent-soft);color:var(--gemboss-accent-strong)}.ui-badge--dot:before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:currentColor}.ui-banner{--ui-banner-bg: var(--ui-surface-2);--ui-banner-fg: var(--ui-text);border-radius:var(--ui-radius-lg);overflow:hidden;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 0 0 1px var(--ui-border),0 3px 1px -1px #1a1a1a12;font-size:var(--ui-fs-body);line-height:20px}.ui-banner--success{--ui-banner-bg: var(--gemboss-success-soft);--ui-banner-fg: var(--gemboss-success-strong)}.ui-banner--warning{--ui-banner-bg: var(--gemboss-warning-soft);--ui-banner-fg: var(--gemboss-warning)}.ui-banner--critical{--ui-banner-bg: var(--gemboss-danger-soft);--ui-banner-fg: var(--gemboss-danger-strong)}.ui-banner--info{--ui-banner-bg: var(--gemboss-accent-soft);--ui-banner-fg: var(--gemboss-accent-strong)}.ui-banner__head{display:flex;align-items:center;gap:var(--ui-space-2);min-height:32px;padding:6px var(--ui-space-3);background:var(--ui-banner-bg);color:var(--ui-banner-fg)}.ui-banner__icon{flex:none;width:20px;height:20px;fill:currentColor}.ui-banner__title{flex:1 1 auto;min-width:0;margin:0;font-size:var(--ui-fs-body);font-weight:650;line-height:20px}.ui-banner__close{flex:none;display:inline-grid;place-items:center;width:32px;height:32px;margin:-6px -8px -6px 0;border:0;border-radius:var(--ui-radius-md);background:transparent;color:inherit;cursor:pointer}.ui-banner__close:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.ui-banner__close:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.ui-banner__close svg{width:16px;height:16px}.ui-banner__body{padding:var(--ui-space-3) var(--ui-space-4)}.ui-banner__body>:first-child{margin-top:0}.ui-banner__body>:last-child{margin-bottom:0}.ui-banner__actions{display:flex;flex-wrap:wrap;gap:var(--ui-space-2);margin-top:var(--ui-space-3)}@media (pointer: coarse),(max-width: 47.9975em){.ui-banner__close{width:44px;height:44px;margin:-12px -12px -12px 0}}.ui-help{margin:var(--ui-space-1) 0 0;font-size:var(--ui-fs-body);line-height:20px;color:var(--ui-text-muted)}.ui-error:empty{display:none}.ui-error{display:flex;gap:6px;margin:var(--ui-space-1) 0 0;font-size:var(--ui-fs-body);line-height:20px;color:var(--gemboss-danger-strong)}.ui-error:before{content:"";flex:none;width:16px;height:16px;margin-top:2px;background:currentColor;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 4h1.5v5.5h-1.5V6Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/></svg>") center / contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 4h1.5v5.5h-1.5V6Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/></svg>") center / contain no-repeat}.gemboss-field[aria-invalid=true],.gemboss-field--group:has([aria-invalid=true]),.ui-select[aria-invalid=true],.ui-textarea[aria-invalid=true]{border-color:var(--gemboss-danger-strong);background-color:var(--gemboss-danger-soft)}.ui-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:0;margin:0;padding:0;border:0;min-width:0}.ui-choices>legend{padding:0}.ui-switch>input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;width:32px;height:20px;margin:0;border-radius:var(--gemboss-radius-full);background:var(--gemboss-field-line);transition:background-color var(--gemboss-transition-fast) ease}.ui-switch>input[type=checkbox]:before{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--gemboss-surface);box-shadow:0 1px 2px #0003;transition:transform var(--gemboss-transition-fast) ease}.ui-switch>input[type=checkbox]:checked{background:var(--ui-accent)}.ui-switch>input[type=checkbox]:checked:before{transform:translate(12px)}@media (prefers-reduced-motion: reduce){.ui-switch>input[type=checkbox],.ui-switch>input[type=checkbox]:before{transition:none}}.ui-tooltip{position:relative;display:inline-flex}.ui-tooltip__bubble{position:absolute;z-index:30;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);width:max-content;max-width:240px;padding:4px 8px;border-radius:var(--ui-radius-md);background:var(--ui-surface);color:var(--ui-text);font-size:var(--ui-fs-body);line-height:20px;font-weight:450;box-shadow:0 8px 16px -4px #1a1a1a38,0 0 0 1px var(--ui-border);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--gemboss-transition-fast) ease}.ui-tooltip--end .ui-tooltip__bubble{left:auto;right:0;transform:none}.ui-tooltip:hover>.ui-tooltip__bubble,.ui-tooltip:focus-within>.ui-tooltip__bubble{opacity:1;visibility:visible}.ui-spinner{display:inline-block;flex:none;width:20px;height:20px;box-sizing:border-box;border-radius:50%;border:2px solid color-mix(in srgb,var(--ui-text) 18%,transparent);border-top-color:var(--ui-text);animation:ui-spin .7s linear infinite;vertical-align:middle}.ui-spinner--lg{width:44px;height:44px;border-width:4px}@keyframes ui-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.ui-spinner{animation-duration:2s}}.ui-progress{appearance:none;-webkit-appearance:none;display:block;width:100%;height:8px;border:0;border-radius:var(--gemboss-radius-full);overflow:hidden;background:var(--gemboss-divider);color:var(--ui-accent)}.ui-progress::-webkit-progress-bar{background:var(--gemboss-divider);border-radius:inherit}.ui-progress::-webkit-progress-value{background:currentColor;border-radius:inherit}.ui-progress::-moz-progress-bar{background:currentColor;border-radius:inherit}.ui-progress--success{color:var(--gemboss-success)}.ui-progress--critical{color:var(--gemboss-danger)}.ui-modal--wide{width:min(620px,100%)}dialog.ui-modal{padding:0;max-width:calc(100% - 40px);max-height:calc(100dvh - 40px);color:var(--ui-text)}dialog.ui-modal[open]{display:flex;flex-direction:column}dialog.ui-modal::backdrop{background:#00000080}html:has(dialog.ui-modal:modal){overflow:hidden}@media (pointer: coarse),(max-width: 47.9975em){.ui-btn.ui-btn--sm{min-width:44px}}.ui-badge--wrap{white-space:normal;overflow-wrap:anywhere;line-height:16px}.ui-page-head--actions{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 16px}.ui-page-head--actions>:first-child{min-width:0}.ui-page-head__actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2)}.ui-chips>button.ui-tag--chip{min-height:28px;padding:4px 12px;border-radius:var(--ui-radius-md, 8px);cursor:pointer;font-family:inherit;font-size:var(--gemboss-fs-caption, 12px);color:var(--ui-text)}.ui-chips>button.ui-tag--chip:hover{background:var(--ui-surface-2);border-color:var(--ui-text-muted)}.ui-chips>button.ui-tag--chip:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:1px}.ui-chips>button.ui-tag--chip[aria-pressed=true]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-accent-strong);font-weight:600}@media (pointer: coarse),(max-width: 47.9975em){.ui-chips>button.ui-tag--chip{min-height:44px;min-width:44px;justify-content:center}}@media (max-width: 47.9975em){.gemboss-ec-input.gemboss-ec-input textarea{font-size:16px}}.ui-seg button[aria-pressed=true]{background:var(--ui-accent-soft);color:var(--ui-accent-strong)}:is(.gemboss-field,.ui-textarea)[readonly][readonly]{background:var(--ui-surface-2);border-color:var(--ui-border);cursor:default}.ui-modal>form{display:contents}.ui-modal>form>.ui-modal__head,.ui-modal>form>.ui-modal__foot{flex:none}.ui-modal>form>.ui-modal__body{flex:1 1 auto;min-height:0;overflow:auto}button.ui-metric{font:inherit;text-align:left;color:inherit;cursor:pointer}button.ui-metric:hover{border-color:var(--ui-text-muted)}button.ui-metric:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-metric.ui-metric:is([aria-pressed=true],[aria-current=page]){border-color:var(--gemboss-accent);box-shadow:inset 0 0 0 1px var(--gemboss-accent)}.ui-more{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;padding:16px 0;color:var(--ui-text-muted);font-size:var(--ui-fs-body);text-align:center}.ui-more[hidden]{display:none}.ui-chip{display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 12px;border:1px dashed var(--ui-border);border-radius:var(--ui-radius-md);background:var(--ui-surface);color:var(--ui-text);font:inherit;font-size:var(--ui-fs-caption);font-weight:550;line-height:16px;white-space:nowrap;text-decoration:none;cursor:pointer}.ui-chip:hover{border-style:solid;background:var(--ui-surface-2)}.ui-chip:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.ui-chip:is([aria-pressed=true],[aria-current=page],[aria-current=true]){border-style:solid;border-color:var(--ui-accent);background:var(--ui-accent-soft);color:var(--ui-accent-strong)}@media (pointer: coarse),(max-width: 47.9975em){.ui-chip{height:auto;min-height:44px;min-width:44px}}.ui-stack{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--ui-space-4)}.ui-stack--tight{gap:var(--ui-space-2)}
|
package/parts/core.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @gemboss/ui core.css — GENERATED by packages/ui/scripts/build-css.mjs from export:globals + export:tokens; do not edit
|
|
3
|
-
* gemboss commit:
|
|
3
|
+
* gemboss commit: 3dca8802a7748e92806a754e2232b1d9749db720
|
|
4
4
|
*/
|
|
5
5
|
*{box-sizing:border-box}:root{--gemboss-primary: #1b1c1e;--gemboss-primary-dark: #000000;--gemboss-primary-soft: #f2f3f5;--gemboss-accent: #5661f5;--gemboss-accent-strong: #3a44de;--gemboss-accent-soft: #eef0fe;--gemboss-accent-wash: #f7f8ff;--gemboss-accent-tint: #dfe2ff;--gemboss-accent-mid: #c9cffd;--gemboss-text-strong: #1b1c1e;--gemboss-text: #1b1c1e;--gemboss-text-muted: #686b71;--gemboss-surface: #ffffff;--gemboss-canvas: #ffffff;--gemboss-preview-canvas: #eceef1;--gemboss-rail-bg: #ffffff;--gemboss-panel-bg: #ffffff;--gemboss-divider: #e5e7ea;--gemboss-invite-h: 0px;--gemboss-divider-soft: #edeff2;--gemboss-hover: #eceef2;--gemboss-active-bg: #f0f1f4;--gemboss-active-fg: #1b1c1e;--gemboss-danger: #d72c0d;--gemboss-danger-strong: #b42318;--gemboss-danger-soft: #fff0e9;--gemboss-danger-border: #f5c9bc;--gemboss-success: #007f5f;--gemboss-success-strong: #0a6a4c;--gemboss-success-soft: #e3f1df;--gemboss-success-border: #b7dfcd;--gemboss-warning: #9a6700;--gemboss-warning-soft: #fff8e0;--gemboss-warning-border: #f5d569;--gemboss-radius-xs: 4px;--gemboss-radius-sm: 6px;--gemboss-radius-md: 8px;--gemboss-radius-lg: 12px;--gemboss-radius-xl: 16px;--gemboss-radius-2xl: 20px;--gemboss-radius-full: 999px;--gemboss-shadow-resting: 0 1px 2px rgba(31, 30, 29, .04), 0 2px 6px rgba(31, 30, 29, .06);--gemboss-shadow-raised: 0 4px 16px rgba(31, 30, 29, .1);--gemboss-shadow-overlay: 0 16px 48px rgba(31, 30, 29, .18);--gemboss-transition-fast: .12s;--gemboss-transition-base: .15s;--gemboss-fs-micro: 11px;--gemboss-fs-caption: 12px;--gemboss-fs-body: 14px;--gemboss-fs-body-lg: 16px;--gemboss-fs-h3: 16px;--gemboss-fs-h2: 20px;--gemboss-fs-h1: 24px;--gemboss-fs-display: 30px;--gemboss-dark-bg: #0a0a0c;--gemboss-dark-rail: #0e0e11;--gemboss-dark-surface: #16161a;--gemboss-dark-surface-2: #1e1e24;--gemboss-dark-divider: #2a2a31;--gemboss-dark-text: #ededf0;--gemboss-dark-muted: #9a9aa4;--gemboss-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--gemboss-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;--gemboss-field-bg: #fdfdfd;--gemboss-field-bg-hover: #fafafa;--gemboss-field-ink: #303030;--gemboss-field-placeholder: #616161;--gemboss-field-line: #8a8a8a;--gemboss-field-line-hover: #616161;--gemboss-field-line-active: #1a1a1a;--gemboss-chip-ink: #303633;--gemboss-chip-line: #cfd6ce;--gemboss-chip-line-hover: #aab4ad;--gemboss-chip-bg-hover: #f6f7f5;--gemboss-on-primary: #ffffff;--gemboss-topbar-bg: rgba(255, 255, 255, .98);--gemboss-nav-bg: var(--gemboss-surface);--gemboss-nav-hover: rgba(20, 19, 18, .045)}:root{--gemboss-primary: #1b1c1e;--gemboss-primary-dark: #000000;--gemboss-primary-soft: #f2f3f5;--gemboss-accent: #5661f5;--gemboss-accent-strong: #3a44de;--gemboss-accent-soft: #eef0fe;--gemboss-active-bg: #f0f1f4;--gemboss-active-fg: #1b1c1e;--gemboss-app-bg: #ffffff}
|
package/parts/shell.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @gemboss/ui shell.css — GENERATED by packages/ui/scripts/build-css.mjs from export:shell + src/app-shell.css; do not edit
|
|
3
|
-
* gemboss commit:
|
|
3
|
+
* gemboss commit: 3dca8802a7748e92806a754e2232b1d9749db720
|
|
4
4
|
*/
|
|
5
5
|
.gemboss-popover-surface{background:var(--gemboss-surface);background:color-mix(in srgb,var(--gemboss-surface) 93%,transparent);-webkit-backdrop-filter:blur(14px) saturate(1.4);backdrop-filter:blur(14px) saturate(1.4);border:1px solid var(--gemboss-divider);border-radius:var(--gemboss-radius-lg);box-shadow:var(--gemboss-shadow-raised)}@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){.gemboss-popover-surface{background:var(--gemboss-surface)}}.icon-nav{position:fixed;top:56px;left:0;z-index:200;height:calc(100dvh - 56px);background:var(--gemboss-rail-bg);border-right:1px solid var(--gemboss-divider);display:flex;flex-direction:column;padding-top:8px;overflow:hidden}.gemboss-account-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:220px;z-index:320;overflow:hidden}.gemboss-account-menu-item,.ui-menu__item{box-sizing:border-box;width:100%;min-height:32px;padding:4px 16px;border:0;background:transparent;font:inherit;font-size:13px;color:var(--gemboss-text);text-align:left;text-decoration:none;cursor:pointer;transition:background var(--gemboss-transition-fast) ease,color var(--gemboss-transition-fast) ease}.gemboss-account-menu-item{display:block}.ui-menu__item{display:flex;align-items:center;gap:8px;padding-inline:6px;white-space:nowrap;border-radius:var(--gemboss-radius-sm)}@media (pointer: coarse),(max-width: 47.9975em){.gemboss-account-menu-item,.ui-menu__item{min-height:44px;padding:12px 16px}}.gemboss-account-menu-item:hover,.ui-menu__item:hover{background:var(--gemboss-hover)}.gemboss-account-menu-item:focus-visible,.ui-menu__item:focus-visible{outline:2px solid var(--gemboss-primary);outline-offset:-2px;background:var(--gemboss-hover)}.gemboss-account-menu-item.danger,.ui-menu__item--danger{color:var(--gemboss-danger-strong)}.gemboss-account-chip{width:30px;height:30px;border:1px solid #cfd6ce;border-radius:var(--gemboss-radius-full);background:#f5f7f4;color:#303633;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;font-size:11px;font-weight:700;cursor:pointer}.gemboss-platform-main{box-sizing:border-box;min-height:100dvh;padding-top:56px;background:var(--gemboss-app-bg)}.icon-nav{top:56px;height:calc(100dvh - 56px);background:var(--gemboss-nav-bg);border-right-color:var(--gemboss-divider)}@media (max-width: 760px){.gemboss-platform-main{margin-left:0}}.gemboss-account-chip{width:32px;height:32px;border-radius:50%;background:var(--gemboss-primary);color:#fff;font-weight:600;font-size:12px;display:inline-flex;align-items:center;justify-content:center;border:none;cursor:pointer;transition:transform var(--gemboss-transition-base) ease}.gemboss-account-chip:hover{transform:scale(1.05)}.gemboss-account-chip:focus-visible{outline:2px solid var(--gemboss-primary);outline-offset:2px}.gemboss-platform-main{margin-top:56px;min-height:calc(100vh - 56px);padding:24px;background:#fafafb}@media (max-width: 768px){.gemboss-platform-main{margin-left:0;padding:16px}}.gemboss-platform-shell{display:block;min-height:100vh;background:var(--gemboss-app-bg)}.gemboss-platform-topbar{position:fixed;inset:0 0 auto;z-index:300;height:56px;border-bottom:1px solid var(--gemboss-divider);background:var(--gemboss-topbar-bg);display:grid;grid-template-columns:minmax(200px,1fr) minmax(0,560px) minmax(max-content,1fr);align-items:center;gap:16px;padding:0 16px;box-shadow:var(--gemboss-shadow-resting)}:root:has(.gemboss-platform-topbar){scroll-padding-top:64px}.gemboss-account-chip{width:32px;height:32px;border:1px solid var(--gemboss-chip-line);border-radius:var(--gemboss-radius-full);background:var(--gemboss-surface);color:var(--gemboss-chip-ink);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;font-size:11px;font-weight:700;cursor:pointer;transition:border-color var(--gemboss-transition-base) ease,background-color var(--gemboss-transition-base) ease}.gemboss-account-chip:hover{border-color:var(--gemboss-chip-line-hover);background:var(--gemboss-chip-bg-hover);transform:none}.icon-nav{position:fixed;top:56px;left:0;z-index:200;height:calc(100dvh - 56px);border-right:1px solid var(--gemboss-divider);background:var(--gemboss-nav-bg);padding-top:12px}.gemboss-platform-main{min-height:calc(100vh - 56px);margin-top:56px;background:var(--gemboss-app-bg);padding:24px}@media (max-width: 1120px){.gemboss-platform-topbar{grid-template-columns:220px minmax(0,1fr) max-content;gap:12px}}@media (max-width: 760px){.gemboss-platform-topbar{height:auto;min-height:56px;grid-template-columns:minmax(0,1fr) auto;padding:12px}.gemboss-account-chip,.icon-nav{display:none}.gemboss-platform-main{margin-left:0;padding:16px}}.gnav-scroll{scrollbar-width:thin;scrollbar-color:rgba(31,30,29,.22) transparent}.gemboss-assistant-railfoot.is-button{width:100%;border:none;background:none;cursor:pointer;text-align:left;font:inherit;border-radius:8px;transition:background .12s ease,color .12s ease}.gemboss-assistant-railfoot.is-button:hover{background:var(--gemboss-primary-soft);color:var(--gemboss-primary-dark)}.gemboss-assistant-empty{padding:24px 20px;color:var(--gemboss-text-muted);font-size:13px}@media (max-width: 760px){.gemboss-platform-topbar{display:flex;align-items:center;gap:8px;height:56px;min-height:56px;padding:0 12px}.gemboss-account-chip{display:inline-flex}.gemboss-platform-main{padding-top:16px;padding-bottom:calc(56px + env(safe-area-inset-bottom))}}@media (pointer: coarse){.gemboss-account-chip{width:44px;height:44px}.gnav-item{min-height:44px}.gemboss-assistant-collapse,.gemboss-assistant-newchat{min-height:44px;min-width:44px}}.icon-nav{width:240px;padding:12px 0 0;overflow:hidden;background:var(--gemboss-nav-bg);display:flex;flex-direction:column}.gnav-scroll{flex:1;overflow-y:auto;overflow-x:hidden;padding-inline:12px}.gnav-bottom{padding:0 12px 12px}.gnav-item{display:flex;align-items:center;gap:12px;width:100%;padding:8px 12px;margin:1px 0;border:0;background:transparent;cursor:pointer;text-align:left;border-radius:var(--gemboss-radius-md);text-decoration:none;font-family:inherit;color:var(--gemboss-text);font-size:var(--gemboss-fs-body);font-weight:500;line-height:1.2;transition:background-color var(--gemboss-transition-fast) ease,color var(--gemboss-transition-fast) ease}.gnav-item:hover{background:var(--gemboss-nav-hover)}.gnav-item:focus-visible{outline:2px solid var(--gemboss-accent);outline-offset:-2px}.gnav-item.active{color:var(--gemboss-active-fg);font-weight:600}.gnav-group:not(.has-active-child)>.gnav-item.active{background:var(--gemboss-active-bg)}.gnav-group:not(.has-active-child)>.gnav-item.active:hover{background:var(--gemboss-active-bg)}.gnav-group.has-active-child>.gnav-item.active:hover{background:var(--gemboss-nav-hover)}.gnav-ico{flex:0 0 20px;width:20px;height:20px;display:grid;place-items:center}.gnav-ico svg{width:20px;height:20px;fill:currentColor}.gnav-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gnav-sub{list-style:none;margin:1px 0 6px;padding:0}.gnav-subitem{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px 6px 44px;margin:1px 0;border-radius:var(--gemboss-radius-sm);color:var(--gemboss-text-muted);font-size:13px;line-height:1.2;text-decoration:none;white-space:nowrap;transition:background-color var(--gemboss-transition-fast) ease,color var(--gemboss-transition-fast) ease}@media (pointer: coarse){.gnav-subitem{min-height:44px}}.gnav-subitem:hover{background:var(--gemboss-nav-hover);color:var(--gemboss-text)}.gnav-subitem.active{color:var(--gemboss-active-fg);font-weight:600;background:var(--gemboss-active-bg)}.gnav-subitem.active:hover{background:var(--gemboss-active-bg);color:var(--gemboss-active-fg)}.gnav-subitem.active:before{content:"";position:absolute;left:20px;top:50%;transform:translateY(-50%);width:3px;height:15px;border-radius:2px;background:var(--gemboss-primary)}.gnav-subitem.is-soon{opacity:.5;cursor:default}.gnav-subitem em{font-style:normal;font-size:var(--gemboss-fs-micro);font-weight:600;letter-spacing:.04em;text-transform:uppercase;border:1px solid var(--gemboss-divider);border-radius:var(--gemboss-radius-sm);padding:1px 6px}.gnav-sep{height:1px;background:var(--gemboss-divider);margin:8px 6px}.gnav-item.gnav-assistant{color:var(--gemboss-accent-strong);font-weight:600;background:var(--gemboss-accent-soft)}.gnav-item.gnav-assistant .gnav-ico svg{fill:var(--gemboss-accent)}.gnav-item.gnav-assistant:hover{background:color-mix(in srgb,var(--gemboss-accent) 16%,var(--gemboss-surface))}.gnav-item.gnav-assistant.active{background:var(--gemboss-active-bg);color:var(--gemboss-active-fg)}.gnav-item.gnav-assistant.active .gnav-ico svg{fill:var(--gemboss-active-fg)}.gemboss-platform-main{margin-left:240px}.gemboss-mobile-menu-btn,.gemboss-mobile-nav-backdrop{display:none}@media (max-width: 760px){.gemboss-platform-main{margin-left:0;padding-bottom:env(safe-area-inset-bottom)}.gemboss-mobile-menu-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:38px;height:38px;margin-left:-2px;border:0;border-radius:8px;background:transparent;cursor:pointer;color:var(--gemboss-text)}.gemboss-mobile-menu-btn:active{background:var(--gemboss-hover)}.icon-nav{display:flex;width:min(82vw,300px);transform:translate(-100%);transition:transform .26s cubic-bezier(.4,0,.2,1),box-shadow .26s cubic-bezier(.4,0,.2,1);z-index:1000;box-shadow:none}.gemboss-platform-shell.is-mobile-nav-open .icon-nav{transform:translate(0);box-shadow:2px 0 26px #1f1e1d33}.gemboss-mobile-nav-backdrop{display:block;position:fixed;inset:56px 0 0;width:100%;border:0;padding:0;background:#14131261;opacity:0;pointer-events:none;transition:opacity .22s ease;z-index:999}.gemboss-platform-shell.is-mobile-nav-open .gemboss-mobile-nav-backdrop{opacity:1;pointer-events:auto}}@media (max-width: 305.98px){.gemboss-platform-topbar{padding:0 8px}}@media (min-width: 306px) and (max-width: 460px){.gemboss-platform-topbar{padding:0 8px}.gemboss-mobile-menu-btn,.gemboss-account-chip{width:44px;height:44px}}.gemboss-assistant-chatslot{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;min-width:0}.gemboss-assistant-chatslot[hidden]{display:none}.gemboss-assistant-page>.gemboss-assistant-tabs{flex:0 0 auto;display:flex;align-items:center;gap:4px;padding:4px 8px 0;overflow-x:auto;scrollbar-width:none}.gemboss-assistant-tabs::-webkit-scrollbar{display:none}.gemboss-assistant-tab{display:flex;align-items:center;flex:0 1 auto;min-width:0;max-width:190px;border:1px solid var(--gemboss-divider);border-radius:var(--gemboss-radius-md);background:transparent}.gemboss-assistant-tab.active{background:var(--gemboss-active-bg);border-color:var(--gemboss-active-bg)}.gemboss-assistant-tab-main{display:flex;align-items:center;gap:6px;min-width:0;min-height:44px;padding:0 4px 0 8px;border:0;background:transparent;font:inherit;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted);cursor:pointer}.gemboss-assistant-tab.active .gemboss-assistant-tab-main{color:var(--gemboss-text-strong)}.gemboss-assistant-tab-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gemboss-assistant-tab-dot{flex:0 0 auto;width:6px;height:6px;border-radius:var(--gemboss-radius-full);background:var(--gemboss-divider)}.gemboss-assistant-tab-dot.is-running{background:var(--gemboss-primary);animation:gemboss-assistant-pulse 1.4s ease-in-out infinite}.gemboss-assistant-tab-close{flex:0 0 auto;width:44px;height:44px;display:grid;place-items:center;border:0;background:transparent;color:var(--gemboss-text-muted);cursor:pointer;padding:0}.gemboss-assistant-tab-close:hover{color:var(--gemboss-text-strong)}.gemboss-assistant-tab-close svg{width:14px;height:14px}.gemboss-assistant-sronly{position:absolute;left:0;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.gemboss-assistant-thread-running{flex:0 0 auto;width:6px;height:6px;border-radius:var(--gemboss-radius-full);background:var(--gemboss-primary);animation:gemboss-assistant-pulse 1.4s ease-in-out infinite}@media (prefers-reduced-motion: reduce){.gemboss-assistant-tab-dot.is-running,.gemboss-assistant-thread-running{animation:none}}.gemboss-assistant-route-claim{display:block;height:100%}.gemboss-assistant-layout.is-dock{height:auto;min-height:0}.gemboss-assistant-layout.is-dock .gemboss-assistant-page{height:auto;max-width:none;padding:4px 0 8px}.gnav-item.gnav-assistant{position:relative}body.gemboss-assistant-busy .gnav-item.gnav-assistant:after,body.gemboss-assistant-unread .gnav-item.gnav-assistant:after{content:"";position:absolute;top:6px;left:26px;width:8px;height:8px;border-radius:50%;border:2px solid var(--gemboss-surface)}body.gemboss-assistant-busy .gnav-item.gnav-assistant:after{background:var(--gemboss-primary);animation:gemboss-assistant-pulse 1.4s ease-in-out infinite}body.gemboss-assistant-unread .gnav-item.gnav-assistant:after{background:var(--gemboss-success-strong)}@media (prefers-reduced-motion: reduce){body.gemboss-assistant-busy .gnav-item.gnav-assistant:after{animation:none}}.gemboss-assistant-layout{display:flex;height:calc(100dvh - 56px);width:100%;min-height:0}.gemboss-assistant-rail{flex:0 0 264px;width:264px;display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--gemboss-divider);background:transparent;padding:16px 12px 12px;gap:12px;transition:flex-basis .18s ease,width .18s ease}.gemboss-assistant-rail-top{display:flex;align-items:center;gap:6px}.gemboss-assistant-newchat{display:flex;align-items:center;gap:8px;flex:1 1 auto;min-width:0;padding:12px;border:1px solid var(--gemboss-divider);border-radius:12px;background:transparent;color:var(--gemboss-text);font-size:var(--gemboss-fs-body);font-weight:600;cursor:pointer;transition:background .12s ease,border-color .12s ease}.gemboss-assistant-newchat:hover{background:#00000009;border-color:var(--gemboss-text-muted)}.gemboss-assistant-newchat svg{width:17px;height:17px;fill:currentColor;flex:0 0 auto}.gemboss-assistant-newchat span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.gemboss-assistant-kbd{flex:0 0 auto;font-size:var(--gemboss-fs-micro);font-weight:600;line-height:1;padding:4px 6px;border:1px solid var(--gemboss-divider);border-radius:6px;background:transparent;color:var(--gemboss-text-muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.gemboss-assistant-search:focus-within .gemboss-assistant-kbd{display:none}.gemboss-assistant-collapse{flex:0 0 auto;display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:8px;background:transparent;color:var(--gemboss-text-muted);cursor:pointer;transition:background .12s ease,color .12s ease}.gemboss-assistant-collapse:hover{background:#0000000d;color:var(--gemboss-text)}.gemboss-assistant-collapse svg{width:16px;height:16px;fill:currentColor}.gemboss-assistant-search{gap:6px}.gemboss-assistant-search>svg{width:15px;height:15px;fill:var(--gemboss-text-muted);flex:0 0 auto}.gemboss-assistant-search-clear{display:grid;place-items:center;width:20px;height:20px;border:0;border-radius:6px;background:transparent;color:var(--gemboss-text-muted);cursor:pointer}.gemboss-assistant-search-clear:hover{background:#00000012;color:var(--gemboss-text)}.gemboss-assistant-search-clear svg{width:13px;height:13px;fill:currentColor}.gemboss-assistant-railfoot{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:8px 12px 2px;border-top:1px solid var(--gemboss-divider);margin-top:4px;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption);line-height:1.35}.gemboss-assistant-railfoot svg{width:13px;height:13px;flex:0 0 auto;fill:currentColor;opacity:.8}.gemboss-assistant-threads{flex:1 1 auto;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:2px}.gemboss-assistant-threads-empty{padding:16px 8px;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption)}.gemboss-assistant-group{display:flex;flex-direction:column;gap:2px}.gemboss-assistant-group+.gemboss-assistant-group{margin-top:12px}.gemboss-assistant-group-label{padding:4px 12px;font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--gemboss-text-muted);text-transform:uppercase}.gemboss-assistant-thread{position:relative;display:flex;align-items:center;border-radius:8px;transition:background .12s ease}.gemboss-assistant-thread:hover{background:var(--gemboss-hover, rgba(0,0,0,.04))}.gemboss-assistant-thread.active{background:#00000012}.gemboss-assistant-thread-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 12px;border:0;background:transparent;text-align:left;cursor:pointer}.gemboss-assistant-thread-titlerow{display:flex;align-items:center;gap:6px;width:100%;min-width:0}.gemboss-assistant-pin-dot{width:12px;height:12px;flex:0 0 auto;fill:var(--gemboss-text-muted)}.gemboss-assistant-thread-title{flex:1 1 auto;min-width:0;font-size:13px;font-weight:500;color:var(--gemboss-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gemboss-assistant-thread-meta{max-width:100%;font-size:var(--gemboss-fs-caption);color:var(--gemboss-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gemboss-assistant-thread.menu-open{background:#00000012}.gemboss-assistant-thread.menu-open .gemboss-assistant-thread-actions{opacity:1}.gemboss-assistant-menu{z-index:60;width:184px;padding:6px;display:flex;flex-direction:column}.gemboss-assistant-menu-confirm{padding:8px 12px 6px;font-size:var(--gemboss-fs-caption);font-weight:600;color:var(--gemboss-text)}.gemboss-assistant-menu button{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:0;border-radius:8px;background:transparent;text-align:left;font-size:13px;color:var(--gemboss-text);cursor:pointer}.gemboss-assistant-menu button:hover{background:var(--gemboss-hover, rgba(0,0,0,.05))}.gemboss-assistant-menu button.danger{color:var(--gemboss-danger-strong)}.gemboss-assistant-menu button svg{width:15px;height:15px;fill:currentColor;flex:0 0 auto}.gemboss-assistant-thread-actions{position:absolute;right:6px;display:flex;gap:2px;opacity:0;transition:opacity .12s ease}.gemboss-assistant-thread:hover .gemboss-assistant-thread-actions,.gemboss-assistant-thread:focus-within .gemboss-assistant-thread-actions{opacity:1}.gemboss-assistant-thread-act{display:grid;place-items:center;width:26px;height:26px;border:0;border-radius:8px;background:transparent;color:var(--gemboss-text-muted);cursor:pointer;transition:background .12s ease,color .12s ease}.gemboss-assistant-thread-act:hover{background:#00000012;color:var(--gemboss-text)}.gemboss-assistant-thread-act.danger:hover{color:var(--gemboss-danger-strong)}.gemboss-assistant-thread-act svg{width:15px;height:15px;fill:currentColor}.gemboss-assistant-thread.editing{background:#00000012}.gemboss-assistant-thread-edit{display:flex;align-items:center;gap:2px;width:100%;padding:6px}.gemboss-assistant-thread-edit input{flex:1 1 auto;min-width:0}.gemboss-assistant-layout .gemboss-assistant-page{height:100%;max-width:820px;flex:1 1 auto;min-width:0;padding-top:16px}.gemboss-assistant-layout .gemboss-assistant-page.is-switching{opacity:.55;transition:opacity .12s ease;pointer-events:none}.gemboss-assistant-rail.is-collapsed{flex-basis:60px;width:60px;padding:16px 8px 12px}.gemboss-assistant-rail.is-collapsed .gemboss-assistant-rail-top{flex-direction:column;gap:8px}.gemboss-assistant-rail.is-collapsed .gemboss-assistant-newchat{justify-content:center;padding:8px;flex:0 0 auto}.gemboss-assistant-rail.is-collapsed .gemboss-assistant-newchat span,.gemboss-assistant-rail.is-collapsed .gemboss-assistant-search,.gemboss-assistant-rail.is-collapsed .gemboss-assistant-railfoot,.gemboss-assistant-rail.is-collapsed .gemboss-assistant-threads{display:none}@media (max-width: 760px){.gemboss-assistant-rail{flex-basis:60px;width:60px;padding:16px 8px 12px}.gemboss-assistant-rail .gemboss-assistant-rail-top{flex-direction:column;gap:8px}.gemboss-assistant-newchat{justify-content:center;padding:8px;flex:0 0 auto}.gemboss-assistant-newchat span,.gemboss-assistant-search,.gemboss-assistant-railfoot,.gemboss-assistant-threads,.gemboss-assistant-collapse{display:none}}.gemboss-assistant-page{height:calc(100dvh - 56px);width:100%;max-width:760px;margin:0 auto;padding:24px 0 16px;display:flex;flex-direction:column;min-height:0}.gemboss-assistant-page>*{flex:1 1 auto;min-height:0}.gemboss-assistant-empty{flex:1;display:grid;place-items:center;color:var(--gemboss-text-muted);font-size:14px}.gemboss-platform-shell{display:flow-root}.gemboss-platform-main{padding-bottom:calc(24px + var(--gemboss-invite-h, 0px))}.gb-account{position:relative}.gb-account>summary{list-style:none}.gb-account>summary::-webkit-details-marker{display:none}.gb-account-head{padding:12px 16px;border-bottom:1px solid var(--gemboss-divider)}.gb-account-name{font-size:13px;font-weight:600;color:var(--gemboss-text-strong)}.gb-account-email{font-size:12px;color:var(--gemboss-text-muted)}.gb-account-role{display:inline-block;margin-top:4px;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:600;color:var(--gemboss-active-fg);background:var(--gemboss-active-bg)}.gb-account-form{margin:0}.gnav-scroll::-webkit-scrollbar{width:9px}.gnav-scroll::-webkit-scrollbar-track{background:transparent}.gnav-scroll::-webkit-scrollbar-thumb{background:#1f1e1d33;border-radius:6px;border:2px solid transparent;background-clip:content-box}@keyframes gemboss-assistant-pulse{0%,to{opacity:1}50%{opacity:.35}}:where(html,body,button){font-family:var(--gemboss-font-sans)}:where(body){font-size:13px;line-height:20px;font-weight:450;color:var(--gemboss-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:where(h1,h2,h3){letter-spacing:-.01em;line-height:1.3}:where(.gemboss-platform-shell) :where(h1,h2,h3,h4,h5,h6,p):where(:not([class])):not(:where(.ui-prose,[data-content],[class*=prose i],[class*=markdown i],.md-body,.recap-md,.asst-md,.article-body) *){margin:0;font-size:1em;font-weight:inherit;line-height:inherit}.gemboss-topbar-start{display:flex;align-items:center;gap:8px;min-width:0}.gemboss-topbar-center{display:flex;justify-content:center;min-width:0}.gemboss-topbar-end{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}@media (max-width: 760px){.gemboss-topbar-center{flex:1 1 0;min-width:96px;justify-content:flex-start}.gemboss-topbar-center:empty{min-width:0}.gemboss-topbar-end:empty{display:none}.gemboss-topbar-end{flex:0 0 auto}.gemboss-topbar-start{flex:0 1 auto}.gemboss-topbar-start>.gemboss-mobile-menu-btn{flex:0 0 auto}.gemboss-topbar-start>.gb-brand{min-width:44px}}.gnav-heading{padding:10px 12px 4px;font-size:var(--gemboss-fs-micro);font-weight:600;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;color:var(--gemboss-text-muted)}.gnav-scroll>.gnav-heading:first-child,.gnav-scroll>.gnav-section:first-child>.gnav-heading:first-child{padding-top:2px}.gnav-count{margin-left:auto;flex:0 0 auto;min-width:20px;padding:0 6px;border-radius:var(--gemboss-radius-full);background:var(--gemboss-hover);color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-micro);font-weight:700;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}.gnav-item.active .gnav-count{background:var(--gemboss-primary);color:var(--gemboss-on-primary)}.gnav-item:is([aria-busy=true],:has(>.gnav-pending)),.gnav-subitem:is([aria-busy=true],:has(>.gnav-pending)){cursor:progress}.gnav-item:is([aria-busy=true],:has(>.gnav-pending))>.gnav-ico>*{visibility:hidden}.gnav-item:is([aria-busy=true],:has(>.gnav-pending))>.gnav-ico:after,.gnav-subitem:is([aria-busy=true],:has(>.gnav-pending)):after,.gb-pending-mark{content:"";display:inline-block;vertical-align:middle;grid-area:1 / 1;flex:none;box-sizing:border-box;width:20px;height:20px;border-radius:50%;border:2px solid color-mix(in srgb,currentColor 18%,transparent);border-top-color:currentColor;animation:gnav-spin .7s linear infinite}.gnav-subitem:is([aria-busy=true],:has(>.gnav-pending)):after{position:absolute;left:22px;top:50%;margin-top:-6px;width:12px;height:12px;border-width:1.5px}@keyframes gnav-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.gnav-item:is([aria-busy=true],:has(>.gnav-pending))>.gnav-ico:after,.gnav-subitem:is([aria-busy=true],:has(>.gnav-pending)):after,.gb-pending-mark{animation-duration:2s}}a[data-gb-pending]:has(>.gb-pending-mark),a[data-gb-pending][aria-busy=true]{cursor:progress}a[data-gb-pending]>.gb-pending-mark{display:inline-block;width:12px;height:12px;border-width:1.5px;margin-left:6px;vertical-align:-1px}a[data-gb-pending=corner]{position:relative}a[data-gb-pending=corner]>.gb-pending-mark{position:absolute;top:12px;right:12px;width:16px;height:16px;margin:0}.gb-route-holding{padding-top:4px}.gb-route-holding .ui-skeleton{gap:16px}.gb-route-holding__heading{margin:0 0 20px;font-size:20px;font-weight:650;line-height:1.3;color:var(--gemboss-text)}.gb-route-holding .ui-skeleton__line{height:10px}.gb-route-holding .ui-skeleton__line.gb-route-holding__title{height:20px;width:34%;margin-bottom:8px}.gb-route-holding .ui-skeleton__line:nth-last-child(4){width:46%}.gb-route-holding .ui-skeleton__line:nth-last-child(3){width:92%}.gb-route-holding .ui-skeleton__line:nth-last-child(2){width:78%}.gb-route-holding .ui-skeleton__line:nth-last-child(1){width:61%}.gb-route-cover{display:none}html[data-gb-navigating] .gb-route-cover{display:block;position:fixed;inset:56px 0 0 240px;z-index:5;overflow:hidden;box-sizing:border-box;padding:24px;background:var(--gemboss-app-bg);pointer-events:none;animation:gb-route-cover-in .08s ease-out both}@keyframes gb-route-cover-in{0%{opacity:0}to{opacity:1}}@media (max-width: 760px){html[data-gb-navigating] .gb-route-cover{left:0;padding:16px}}@media (prefers-reduced-motion: reduce){html[data-gb-navigating] .gb-route-cover{animation-duration:0s}}.gnav-pending{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.gb-brand{min-width:0;height:40px;margin:0;padding:0 8px;border-radius:var(--gemboss-radius-md);display:inline-flex;align-items:center;gap:4.5px;color:var(--gb-brand-ink, #14151a);text-decoration:none;transition:background-color var(--gemboss-transition-base) ease}.gb-brand:hover{background:var(--gemboss-hover)}.gb-brand:focus-visible{outline:2px solid var(--gemboss-primary);outline-offset:2px}.gb-brand-gem{display:block;flex:0 0 auto}.gb-brand-name{font-family:Inter,var(--gemboss-font-sans);font-size:13.3px;font-weight:700;letter-spacing:-.13px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}@media (max-width: 460px){.gb-brand-name{display:none}.gb-brand{min-width:44px;height:44px;justify-content:center}}.gemboss-topbar-search{width:100%;max-width:560px;height:36px;min-width:0;margin:0 auto;border:1px solid var(--gemboss-field-line);border-radius:var(--gemboss-radius-md);background:var(--gemboss-field-bg);padding:0 8px 0 12px;display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:8px;align-items:center;color:var(--gemboss-text-muted)}.gemboss-topbar-search:hover{border-color:var(--gemboss-field-line-hover);background:var(--gemboss-field-bg-hover)}.gemboss-topbar-search:focus-within{border-color:var(--gemboss-field-line-active);background:var(--gemboss-surface)}.gemboss-topbar-search-icon{width:18px;height:18px;color:currentColor}.gemboss-topbar-search-input{min-width:0;height:calc(100% + 2px);border:0;background:transparent;padding:0;margin:-1px 0;font:inherit;font-size:var(--gemboss-fs-body);line-height:18px;color:var(--gemboss-field-ink);outline:none}.gemboss-topbar-search-input::placeholder{color:var(--gemboss-field-placeholder);opacity:1}.gemboss-topbar-search-kbd{border:1px solid var(--gemboss-field-line);border-radius:var(--gemboss-radius-sm);background:var(--gemboss-surface);padding:1px 6px;color:var(--gemboss-text-muted);font-family:inherit;font-size:var(--gemboss-fs-micro);line-height:16px}.gemboss-topbar-search:focus-within .gemboss-topbar-search-kbd{display:none}@media (pointer: coarse),(max-width: 47.9975em){.gemboss-topbar-search{height:44px}}@media (max-width: 460px){.gemboss-topbar-search-kbd{display:none}}.ui-page{box-sizing:border-box;width:100%;min-width:0;max-width:var(--ui-content-max, 900px);margin-inline:auto}.ui-page--feed{max-width:720px}.ui-page--form{max-width:662px}.ui-page--canvas{max-width:1440px}.ui-page--full{max-width:none}@media (max-width: 47.9975em){.gemboss-assistant-collapse,.gemboss-assistant-newchat{min-height:44px;min-width:44px}}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Where the composer's engine chip and the Settings section meet (@gemboss/ui 0.52.0). The chip lives in the assistant's
|
|
5
|
+
* composer, the "AI & engines" section in the surface's Settings popup: two places in the tree (in content-radar the
|
|
6
|
+
* popup is even another route's layout), one engine. The chip PUBLISHES its props here on every render (the engines, the
|
|
7
|
+
* bridge's state, the callbacks that switch and that start a new conversation); the section READS them and draws them, and
|
|
8
|
+
* counts itself as a VIEWER so the chip can tell the surface "the engine is on screen" (`onOpenChange(true)`), which is
|
|
9
|
+
* what the surfaces poll the bridge on.
|
|
10
|
+
*
|
|
11
|
+
* A module store, not a context: the surfaces mount Settings and the assistant under different providers, and a store has
|
|
12
|
+
* no provider to forget. One assistant per page, so one source; a second chip that publishes replaces the first, and the
|
|
13
|
+
* first one's unmount does not clear the second's.
|
|
14
|
+
*/
|
|
15
|
+
import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
16
|
+
import type { EnginePickerProps, EnginePickerTab } from "./engine";
|
|
17
|
+
|
|
18
|
+
interface Snapshot {
|
|
19
|
+
props: EnginePickerProps | null;
|
|
20
|
+
/** Which publisher `props` came from (its ref object), so an old one's unmount leaves a newer one's props alone. */
|
|
21
|
+
owner: object | null;
|
|
22
|
+
viewers: number;
|
|
23
|
+
/** Where the next section that opens should take the user ("setup" from a failed turn's Open setup). */
|
|
24
|
+
focus: EnginePickerTab | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const EMPTY: Snapshot = { props: null, owner: null, viewers: 0, focus: null };
|
|
28
|
+
let snap: Snapshot = EMPTY;
|
|
29
|
+
const listeners = new Set<() => void>();
|
|
30
|
+
function change(next: Partial<Snapshot>) {
|
|
31
|
+
snap = { ...snap, ...next };
|
|
32
|
+
listeners.forEach((f) => f());
|
|
33
|
+
}
|
|
34
|
+
const subscribe = (f: () => void) => { listeners.add(f); return () => { listeners.delete(f); }; };
|
|
35
|
+
const read = () => snap;
|
|
36
|
+
const readOnServer = () => EMPTY;
|
|
37
|
+
const isViewed = () => snap.viewers > 0;
|
|
38
|
+
const notViewed = () => false;
|
|
39
|
+
|
|
40
|
+
const useBeforePaint = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
41
|
+
|
|
42
|
+
/** The chip's side: publish `props` (null: not in Settings mode, publish nothing) and tell it when a section shows them. */
|
|
43
|
+
export function usePublishEngineSettings(props: EnginePickerProps | null) {
|
|
44
|
+
const me = useRef<object>({});
|
|
45
|
+
const on = props !== null;
|
|
46
|
+
// Every render: the callbacks close over the surface's latest state, and the bridge's state changes with each poll.
|
|
47
|
+
useBeforePaint(() => {
|
|
48
|
+
if (props) change({ props, owner: me.current });
|
|
49
|
+
});
|
|
50
|
+
useEffect(() => () => {
|
|
51
|
+
if (snap.owner === me.current) change({ props: null, owner: null });
|
|
52
|
+
}, []);
|
|
53
|
+
const viewing = useSyncExternalStore(subscribe, isViewed, notViewed);
|
|
54
|
+
const told = useRef(false);
|
|
55
|
+
const onOpenChange = props?.onOpenChange;
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!on || viewing === told.current) return;
|
|
58
|
+
told.current = viewing;
|
|
59
|
+
onOpenChange?.(viewing);
|
|
60
|
+
// Only when `viewing` turns: the surface's onOpenChange is a new arrow on every render.
|
|
61
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
+
}, [viewing, on]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The section's side: what the chip published, and a ref for its box, counted as a viewer while that box is SEEN. Not
|
|
66
|
+
* while mounted: the kit's SettingsDialog keeps its section mounted after it closes (a closed <dialog> is display:none),
|
|
67
|
+
* and a section counted then would keep the surface polling the bridge for good (measured in the browser test). */
|
|
68
|
+
export function useEngineSettingsSource(): [Snapshot, (el: Element | null) => void] {
|
|
69
|
+
const s = useSyncExternalStore(subscribe, read, readOnServer);
|
|
70
|
+
const [el, setEl] = useState<Element | null>(null);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!el) return undefined;
|
|
73
|
+
let counted = false;
|
|
74
|
+
const count = (v: boolean) => {
|
|
75
|
+
if (v === counted) return;
|
|
76
|
+
counted = v;
|
|
77
|
+
change({ viewers: snap.viewers + (v ? 1 : -1) });
|
|
78
|
+
};
|
|
79
|
+
if (typeof IntersectionObserver === "undefined") { count(true); return () => count(false); }
|
|
80
|
+
const io = new IntersectionObserver((entries) => count(entries[entries.length - 1].isIntersecting));
|
|
81
|
+
io.observe(el);
|
|
82
|
+
return () => { io.disconnect(); count(false); };
|
|
83
|
+
}, [el]);
|
|
84
|
+
return [s, setEl];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Ask the next "AI & engines" section to bring `tab`'s part into view (the chip asks for "engine": the top). */
|
|
88
|
+
export function requestEngineSettingsFocus(tab: EnginePickerTab) {
|
|
89
|
+
change({ focus: tab });
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** The section has acted on the request. */
|
|
93
|
+
export function clearEngineSettingsFocus() {
|
|
94
|
+
if (snap.focus !== null) change({ focus: null });
|
|
95
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The assistant's engine IN SETTINGS — @gemboss/ui 0.52.0 (Chris 24/10/2026: "các assistant có phần bấm vào chọn model là
|
|
5
|
+
* claude code hay codex… đưa hết về nằm trong popup settings để có nhiều không gian hơn", and the chip: "bấm vào đó mở
|
|
6
|
+
* settings").
|
|
7
|
+
*
|
|
8
|
+
* Measured that day on five surfaces: the chip's popup was 360px wide and 212–405px tall over the chat, with three engines,
|
|
9
|
+
* a model row and five effort buttons on one tab and the bridge split over two more (partner-radar's scrolled inside).
|
|
10
|
+
* The GemBoss admin already had the shape: its top-bar "AI: GemBoss AI" opens Settings › AI & engines. So the chip
|
|
11
|
+
* becomes a door to that section (`EnginePicker` `onOpenSettings`), and the section draws what the three tabs held, one
|
|
12
|
+
* under the other, at the pane's body size:
|
|
13
|
+
*
|
|
14
|
+
* Engine — the engines (radios, or each with its own models), model, effort, notes
|
|
15
|
+
* Bridge on your machine — what is wrong (one callout), state / version / starts at sign-in, the actions,
|
|
16
|
+
* then "Install or update": the steps, the command with Copy, the pairing code
|
|
17
|
+
*
|
|
18
|
+
* `EngineSettingsSection` draws whatever the surface's chip published (engine-settings-store.ts): the surface puts it in
|
|
19
|
+
* its Settings popup and changes nothing else. `EngineSettings` takes the props itself, for a surface that holds them
|
|
20
|
+
* where its settings are drawn (and for the catalog).
|
|
21
|
+
*
|
|
22
|
+
* Its look is assistant-engine.css (the picker's own entry, imported by engine.tsx) on the kit's `.ui-card`.
|
|
23
|
+
*/
|
|
24
|
+
import "../assistant-engine.css"; // the picker's own entry (engine.tsx imports it too): this section draws its classes
|
|
25
|
+
import React, { useCallback, useEffect, useId, useRef, type ReactNode } from "react";
|
|
26
|
+
import { BridgeCallout, ENGINE_PICKER_EN, EngineTab, SetupTab, StatusTab, type EnginePickerProps, type EnginePickerTab } from "./engine";
|
|
27
|
+
import { clearEngineSettingsFocus, useEngineSettingsSource } from "./engine-settings-store";
|
|
28
|
+
|
|
29
|
+
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
30
|
+
|
|
31
|
+
/** The part of the section each tab's content now lives in. */
|
|
32
|
+
const PART: Record<EnginePickerTab, string> = { engine: "engine", status: "bridge", setup: "setup" };
|
|
33
|
+
|
|
34
|
+
export interface EngineSettingsProps extends EnginePickerProps {
|
|
35
|
+
/** Bring this part into view once (the request a failed turn's Open setup makes), then `onFocused`. */
|
|
36
|
+
focus?: EnginePickerTab | null;
|
|
37
|
+
onFocused?: () => void;
|
|
38
|
+
/** The section's root element (EngineSettingsSection watches whether it is seen). */
|
|
39
|
+
rootRef?: (el: HTMLDivElement | null) => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function EngineSettings({ focus, onFocused, rootRef, className, ...props }: EngineSettingsProps) {
|
|
43
|
+
const L = { ...ENGINE_PICKER_EN, ...props.labels };
|
|
44
|
+
const id = useId();
|
|
45
|
+
const box = useRef<HTMLDivElement | null>(null);
|
|
46
|
+
const setBox = useCallback((el: HTMLDivElement | null) => { box.current = el; rootRef?.(el); }, [rootRef]);
|
|
47
|
+
const hasBridgeCard = Boolean(props.bridge || props.setup);
|
|
48
|
+
|
|
49
|
+
// "engine" is the top, where the popup's own focus already is (SettingsDialog focuses itself on open). Setup and Status
|
|
50
|
+
// are below the fold: scroll their part to the top of the pane and put focus on its first control, after the dialog has
|
|
51
|
+
// taken focus (a frame later), or the dialog would take it back.
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!focus) return undefined;
|
|
54
|
+
const part = focus === "engine" ? null : box.current?.querySelector<HTMLElement>(`[data-gb-part="${PART[focus]}"]`);
|
|
55
|
+
if (!part) { onFocused?.(); return undefined; }
|
|
56
|
+
const raf = requestAnimationFrame(() => {
|
|
57
|
+
part.scrollIntoView({ block: "start" });
|
|
58
|
+
const first = part.querySelector<HTMLElement>("button:not([disabled]), select:not([disabled]), input:not([disabled])");
|
|
59
|
+
(first ?? part).focus({ preventScroll: true });
|
|
60
|
+
onFocused?.();
|
|
61
|
+
});
|
|
62
|
+
return () => cancelAnimationFrame(raf);
|
|
63
|
+
// On the request only: a poll redraws the section without moving the user.
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
}, [focus]);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div ref={setBox} className={cx("gb-engine-settings", className)}>
|
|
69
|
+
<section className="ui-card gb-engine-sect" data-gb-part="engine" aria-labelledby={`${id}-engine`}>
|
|
70
|
+
<h3 className="ui-card__title" id={`${id}-engine`}>{L.engine}</h3>
|
|
71
|
+
<EngineTab {...props} L={L} labelledBy={`${id}-engine`} />
|
|
72
|
+
</section>
|
|
73
|
+
{hasBridgeCard ? (
|
|
74
|
+
<section className="ui-card gb-engine-sect" data-gb-part="bridge" aria-labelledby={`${id}-bridge`} tabIndex={-1}>
|
|
75
|
+
<h3 className="ui-card__title" id={`${id}-bridge`}>{L.bridge}</h3>
|
|
76
|
+
<BridgeCallout bridge={props.bridge} L={L} />
|
|
77
|
+
{props.bridge ? <StatusTab bridge={props.bridge} actions={props.statusActions} L={L} inSettings /> : null}
|
|
78
|
+
{props.setup ? (
|
|
79
|
+
<div className="gb-engine-sub" data-gb-part="setup" role="group" aria-labelledby={`${id}-setup`} tabIndex={-1}>
|
|
80
|
+
<h4 className="gb-engine-subtitle" id={`${id}-setup`}>{L.setupTitle ?? ENGINE_PICKER_EN.setupTitle}</h4>
|
|
81
|
+
<SetupTab setup={props.setup} bridge={props.bridge} L={L} noCallout />
|
|
82
|
+
</div>
|
|
83
|
+
) : null}
|
|
84
|
+
</section>
|
|
85
|
+
) : null}
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The "AI & engines" section's body: what the assistant's chip published, drawn with `EngineSettings`.
|
|
92
|
+
*
|
|
93
|
+
* const picker = useEnginePicker({ onOpenSettings: () => openSettings("ai") }); // the assistant
|
|
94
|
+
* <EnginePicker {...picker.props} engines={…} … /> // its composer, unchanged
|
|
95
|
+
* <EngineSettingsSection /> // Settings › AI & engines
|
|
96
|
+
*
|
|
97
|
+
* `empty`: what to say when no assistant on this page has published (it was never mounted). Default: one quiet line.
|
|
98
|
+
*/
|
|
99
|
+
export function EngineSettingsSection({ empty, className }: { empty?: ReactNode; className?: string }) {
|
|
100
|
+
const [s, setEl] = useEngineSettingsSource();
|
|
101
|
+
if (!s.props) {
|
|
102
|
+
if (empty !== undefined) return <>{empty}</>;
|
|
103
|
+
return <p className="gb-engine-note">The assistant has not loaded on this page yet: open it once, then come back here.</p>;
|
|
104
|
+
}
|
|
105
|
+
return <EngineSettings {...s.props} rootRef={setEl} className={cx(s.props.className, className)} focus={s.focus} onFocused={clearEngineSettingsFocus} />;
|
|
106
|
+
}
|
package/src/assistant/engine.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import React, { useCallback, useEffect, useId, useLayoutEffect, useRef, useState
|
|
|
29
29
|
import { createPortal } from "react-dom";
|
|
30
30
|
import { canFloatMenus, placeFloating } from "../menu-layer";
|
|
31
31
|
import { EngineMark, isEngineMarkId } from "./engine-mark";
|
|
32
|
+
import { requestEngineSettingsFocus, usePublishEngineSettings } from "./engine-settings-store";
|
|
32
33
|
|
|
33
34
|
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
34
35
|
const useBeforePaint = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
@@ -102,6 +103,9 @@ export interface EnginePickerLabels {
|
|
|
102
103
|
yes: string; no: string; unknown: string;
|
|
103
104
|
running: string; outdated: string; offline: string; unpaired: string; checking: string;
|
|
104
105
|
updateDue: string; close: string;
|
|
106
|
+
/** In Settings (`EngineSettings`, 0.52.0): the bridge's first row, under a card already titled `bridge`, and the heading
|
|
107
|
+
* of its install / update part. Optional so a surface's own label set from before 0.52.0 still type-checks. */
|
|
108
|
+
state?: string; setupTitle?: string;
|
|
105
109
|
}
|
|
106
110
|
export const ENGINE_PICKER_EN: EnginePickerLabels = {
|
|
107
111
|
chip: "Engine", dialog: "Assistant engine", tabs: "Engine, setup and status",
|
|
@@ -113,6 +117,7 @@ export const ENGINE_PICKER_EN: EnginePickerLabels = {
|
|
|
113
117
|
yes: "Yes", no: "No", unknown: "Not known",
|
|
114
118
|
running: "Running", outdated: "Outdated", offline: "Not connected", unpaired: "Not set up", checking: "Checking",
|
|
115
119
|
updateDue: "Update available", close: "Close",
|
|
120
|
+
state: "State", setupTitle: "Install or update",
|
|
116
121
|
};
|
|
117
122
|
|
|
118
123
|
/** The dot's tone per state: one word each, so the CSS has one rule per tone and a test can read it. */
|
|
@@ -173,6 +178,11 @@ export interface EnginePickerProps {
|
|
|
173
178
|
end?: boolean;
|
|
174
179
|
/** The chip button, for the surface (`useEnginePicker` passes its own: `close()` puts focus back on it). 0.32.0. */
|
|
175
180
|
chipRef?: React.Ref<HTMLButtonElement>;
|
|
181
|
+
/** 0.52.0: the chip opens the surface's SETTINGS on its "AI & engines" section, which draws everything the panel held
|
|
182
|
+
* (`EngineSettingsSection`), and there is no panel of its own. Called with "engine" from the chip, with "setup" from
|
|
183
|
+
* `useEnginePicker().openTab("setup")` (a failed turn's Open setup). While that section is on screen, `onOpenChange(true)`:
|
|
184
|
+
* a surface that polls the bridge while the picker is open keeps doing so. See engine-settings.tsx. */
|
|
185
|
+
onOpenSettings?: (tab: EnginePickerTab) => void;
|
|
176
186
|
labels?: Partial<EnginePickerLabels>;
|
|
177
187
|
className?: string;
|
|
178
188
|
}
|
|
@@ -184,17 +194,38 @@ export interface EnginePickerProps {
|
|
|
184
194
|
* from this machine, before a confirm opens). The button that had focus goes away with the panel, so focus would fall to
|
|
185
195
|
* <body> and the confirm would record <body> as where to return; `close()` puts it on the chip first. Every surface
|
|
186
196
|
* wrote that by hand (`querySelector(".gb-engine-chip").focus()`: partner-radar, search-radar, gemwatcher #922). An
|
|
187
|
-
* outside click still closes without moving focus (`props.onOpenChange(false)`).
|
|
188
|
-
|
|
197
|
+
* outside click still closes without moving focus (`props.onOpenChange(false)`).
|
|
198
|
+
*
|
|
199
|
+
* 0.52.0, `{ onOpenSettings }`: the engine lives in the surface's Settings (see `EnginePickerProps.onOpenSettings`).
|
|
200
|
+
* `openTab("setup")` then opens Settings on that section and brings its install / update part into view; `open` is true
|
|
201
|
+
* while the section is on screen; `close()` does nothing (there is no panel, and the chip sits behind the Settings popup:
|
|
202
|
+
* focus stays on the button in Settings, where a confirm it opens comes back to). */
|
|
203
|
+
export function useEnginePicker(options: EnginePickerTab | { initial?: EnginePickerTab; onOpenSettings?: (tab: EnginePickerTab) => void } = "engine") {
|
|
204
|
+
const initial = typeof options === "string" ? options : options.initial ?? "engine";
|
|
205
|
+
const toSettings = typeof options === "string" ? undefined : options.onOpenSettings;
|
|
206
|
+
// The latest opener (a surface passes a new arrow each render), behind one stable function.
|
|
207
|
+
const toSettingsRef = useRef(toSettings);
|
|
208
|
+
toSettingsRef.current = toSettings;
|
|
209
|
+
const inSettings = Boolean(toSettings);
|
|
189
210
|
const [open, setOpen] = useState(false);
|
|
190
211
|
const [tab, setTab] = useState<EnginePickerTab>(initial);
|
|
191
212
|
const chipRef = useRef<HTMLButtonElement | null>(null);
|
|
192
|
-
const
|
|
213
|
+
const openSettings = useCallback((t: EnginePickerTab) => {
|
|
214
|
+
requestEngineSettingsFocus(t);
|
|
215
|
+
toSettingsRef.current?.(t);
|
|
216
|
+
}, []);
|
|
217
|
+
const openTab = useCallback((t: EnginePickerTab) => {
|
|
218
|
+
if (toSettingsRef.current) { openSettings(t); return; }
|
|
219
|
+
setTab(t); setOpen(true);
|
|
220
|
+
}, [openSettings]);
|
|
193
221
|
// Closing goes back to Engine: after "Open setup" the next click on the chip is about the engine again (review #3885).
|
|
194
222
|
const onOpenChange = useCallback((v: boolean) => { setOpen(v); if (!v) setTab(initial); }, [initial]);
|
|
195
223
|
const focusChip = useCallback(() => { chipRef.current?.focus(); }, []);
|
|
196
|
-
const close = useCallback(() => { onOpenChange(false); focusChip(); }, [onOpenChange, focusChip]);
|
|
197
|
-
return {
|
|
224
|
+
const close = useCallback(() => { if (toSettingsRef.current) return; onOpenChange(false); focusChip(); }, [onOpenChange, focusChip]);
|
|
225
|
+
return {
|
|
226
|
+
open, tab, setOpen, setTab, openTab, close, focusChip, chipRef,
|
|
227
|
+
props: { open, onOpenChange, tab, onTabChange: setTab, chipRef, onOpenSettings: inSettings ? openSettings : undefined },
|
|
228
|
+
};
|
|
198
229
|
}
|
|
199
230
|
|
|
200
231
|
function availableTabs(p: Pick<EnginePickerProps, "bridge" | "setup">): EnginePickerTab[] {
|
|
@@ -227,8 +258,12 @@ export function engineChipName(p: Pick<EnginePickerProps, "engines" | "engine" |
|
|
|
227
258
|
export function EnginePicker(props: EnginePickerProps) {
|
|
228
259
|
const { engines, engine, models, model, bridge, end = false, className } = props;
|
|
229
260
|
const L = { ...ENGINE_PICKER_EN, ...props.labels };
|
|
261
|
+
const toSettings = props.onOpenSettings;
|
|
262
|
+
// In Settings (0.52.0) the chip hands its props to the "AI & engines" section and hears when that section is on screen.
|
|
263
|
+
usePublishEngineSettings(toSettings ? props : null);
|
|
230
264
|
const [ownOpen, setOwnOpen] = useState(false);
|
|
231
|
-
|
|
265
|
+
// No panel in Settings: `open` there means "the section is on screen" (useEnginePicker), not a popup to draw.
|
|
266
|
+
const open = toSettings ? false : props.open ?? ownOpen;
|
|
232
267
|
const { tabs, tab, setTab, resetOwn } = useTabs(props);
|
|
233
268
|
// Without the popover API (Safari < 17) a fixed layer inside the assistant's frame is cut by it (overflow, and in the
|
|
234
269
|
// popup and mini modes the frame's backdrop-filter makes it the containing block; full and side have none since
|
|
@@ -354,6 +389,30 @@ export function EnginePicker(props: EnginePickerProps) {
|
|
|
354
389
|
const mark = current?.mark && isEngineMarkId(current.mark) ? current.mark : null;
|
|
355
390
|
const tone = bridge && props.showBridgeDot !== false ? BRIDGE_TONE[bridge.state] : null;
|
|
356
391
|
const name = engineChipName(props.showBridgeDot === false ? { ...props, bridge: undefined } : props, L);
|
|
392
|
+
const chipFace = (
|
|
393
|
+
<>
|
|
394
|
+
{tone ? <span className={DOT_CLASS[tone]} aria-hidden /> : null}
|
|
395
|
+
<span className="gb-engine-chiplabel">
|
|
396
|
+
{current?.label ?? engine}
|
|
397
|
+
{modelLabel ? <span className="gb-engine-chipsub"> · {modelLabel}</span> : null}
|
|
398
|
+
</span>
|
|
399
|
+
{/* Shown instead of the name when the composer is too narrow for it (assistant-engine.css, ChatComposer density). */}
|
|
400
|
+
{mark ? <span className="gb-engine-chipmark"><EngineMark engine={mark} decorative /></span> : null}
|
|
401
|
+
</>
|
|
402
|
+
);
|
|
403
|
+
|
|
404
|
+
if (toSettings) {
|
|
405
|
+
// The same chip, a door to Settings: it opens a dialog (the surface's), so no expanded state or panel id of its own.
|
|
406
|
+
return (
|
|
407
|
+
<span className={cx("gb-engine", className)}>
|
|
408
|
+
<button ref={setChip} type="button" className={mark ? "gb-engine-chip has-mark" : "gb-engine-chip"}
|
|
409
|
+
disabled={props.disabled || undefined} aria-haspopup="dialog" aria-label={name} title={name}
|
|
410
|
+
onClick={() => { requestEngineSettingsFocus("engine"); toSettings("engine"); }}>
|
|
411
|
+
{chipFace}
|
|
412
|
+
</button>
|
|
413
|
+
</span>
|
|
414
|
+
);
|
|
415
|
+
}
|
|
357
416
|
|
|
358
417
|
return (
|
|
359
418
|
<span className={cx("gb-engine", className)}>
|
|
@@ -369,13 +428,7 @@ export function EnginePicker(props: EnginePickerProps) {
|
|
|
369
428
|
title={name}
|
|
370
429
|
onClick={() => setOpen(!open)}
|
|
371
430
|
>
|
|
372
|
-
{
|
|
373
|
-
<span className="gb-engine-chiplabel">
|
|
374
|
-
{current?.label ?? engine}
|
|
375
|
-
{modelLabel ? <span className="gb-engine-chipsub"> · {modelLabel}</span> : null}
|
|
376
|
-
</span>
|
|
377
|
-
{/* Shown instead of the name when the composer is too narrow for it (assistant-engine.css, ChatComposer density). */}
|
|
378
|
-
{mark ? <span className="gb-engine-chipmark"><EngineMark engine={mark} decorative /></span> : null}
|
|
431
|
+
{chipFace}
|
|
379
432
|
</button>
|
|
380
433
|
{(() => { const panelEl = (<div
|
|
381
434
|
ref={panelRef}
|
|
@@ -510,8 +563,9 @@ function Options({ label, items, value, onChange, locked, onPicked, disabledReas
|
|
|
510
563
|
}
|
|
511
564
|
|
|
512
565
|
/** Every engine with its own models, all at once; one click picks both (the admin's popup, 0.29.0). */
|
|
513
|
-
function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelChange, locked, L, onPicked }: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void }) {
|
|
514
|
-
const
|
|
566
|
+
function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelChange, locked, L, onPicked, labelledBy }: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void; labelledBy?: string }) {
|
|
567
|
+
const ownId = useId();
|
|
568
|
+
const id = labelledBy ?? ownId;
|
|
515
569
|
const choose = (e: EngineChoice, m: Choice) => {
|
|
516
570
|
// The pick already in force: close, change nothing (a surface that starts a new conversation on a switch must not).
|
|
517
571
|
if (e.id === engine && (model ?? "") === m.id) { onPicked?.(); return; }
|
|
@@ -522,7 +576,7 @@ function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelC
|
|
|
522
576
|
const canChoose = Boolean(onPick || onEngineChange || onModelChange);
|
|
523
577
|
return (
|
|
524
578
|
<div className="gb-engine-field">
|
|
525
|
-
<span className="gb-engine-label" id={id}>{L.engine}</span>
|
|
579
|
+
{labelledBy ? null : <span className="gb-engine-label" id={id}>{L.engine}</span>}
|
|
526
580
|
<div className="gb-engine-groups" role="group" aria-labelledby={id}>
|
|
527
581
|
{engines.map((e) => {
|
|
528
582
|
const chosen = e.id === engine;
|
|
@@ -552,9 +606,12 @@ function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelC
|
|
|
552
606
|
);
|
|
553
607
|
}
|
|
554
608
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
609
|
+
/** The Engine tab's content. `labelledBy` (0.52.0, Settings): a heading outside names the engine list, so its own "Engine"
|
|
610
|
+
* label is not drawn a second time under it. */
|
|
611
|
+
export function EngineTab(props: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void; labelledBy?: string }) {
|
|
612
|
+
const { engines, engine, onEngineChange, models, model, onModelChange, modelControl, efforts, effort, onEffortChange, effortDisabled, notes, locked, L, onPicked, labelledBy } = props;
|
|
613
|
+
const ownId = useId();
|
|
614
|
+
const id = labelledBy ?? ownId;
|
|
558
615
|
if (engines.some((e) => e.models && e.models.length)) {
|
|
559
616
|
return (
|
|
560
617
|
<>
|
|
@@ -582,7 +639,7 @@ function EngineTab(props: EnginePickerProps & { L: EnginePickerLabels; onPicked?
|
|
|
582
639
|
return (
|
|
583
640
|
<>
|
|
584
641
|
<div className="gb-engine-field">
|
|
585
|
-
<span className="gb-engine-label" id={id}>{L.engine}</span>
|
|
642
|
+
{labelledBy ? null : <span className="gb-engine-label" id={id}>{L.engine}</span>}
|
|
586
643
|
<div className="gb-engine-list" role="radiogroup" aria-labelledby={id} onKeyDown={onKey}>
|
|
587
644
|
{engines.map((e) => (
|
|
588
645
|
<button
|
|
@@ -635,7 +692,19 @@ export async function copyText(text: string): Promise<boolean> {
|
|
|
635
692
|
} catch { return false; }
|
|
636
693
|
}
|
|
637
694
|
|
|
638
|
-
|
|
695
|
+
/** What is wrong with the bridge, in one callout: on Setup, and at the top of the bridge card in Settings. */
|
|
696
|
+
export function BridgeCallout({ bridge, L }: { bridge?: BridgeStatus; L: EnginePickerLabels }) {
|
|
697
|
+
if (!(bridge?.state === "outdated" || bridge?.state === "offline" || bridge?.state === "unpaired")) return null;
|
|
698
|
+
return (
|
|
699
|
+
<p className={cx("gb-engine-callout", bridge.state === "outdated" ? "gb-engine-callout--warn" : "gb-engine-callout--down")}>
|
|
700
|
+
<strong>{L.bridge}: {L[STATE_LABEL[bridge.state]]!.toLowerCase()}.</strong>
|
|
701
|
+
{bridge.detail ? <> {bridge.detail}</> : null}
|
|
702
|
+
</p>
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/** The Setup tab's content. `noCallout` (Settings): the bridge card already says what is wrong above it. */
|
|
707
|
+
export function SetupTab({ setup, bridge, L, noCallout = false }: { setup: BridgeSetup; bridge?: BridgeStatus; L: EnginePickerLabels; noCallout?: boolean }) {
|
|
639
708
|
const [said, setSaid] = useState<"" | "copied" | "failed">("");
|
|
640
709
|
const timer = useRef<number | undefined>(undefined);
|
|
641
710
|
useEffect(() => () => window.clearTimeout(timer.current), []);
|
|
@@ -648,13 +717,8 @@ function SetupTab({ setup, bridge, L }: { setup: BridgeSetup; bridge?: BridgeSta
|
|
|
648
717
|
};
|
|
649
718
|
return (
|
|
650
719
|
<>
|
|
651
|
-
{
|
|
652
|
-
|
|
653
|
-
<strong>{L.bridge}: {L[STATE_LABEL[bridge.state]].toLowerCase()}.</strong>
|
|
654
|
-
{bridge.detail ? <> {bridge.detail}</> : null}
|
|
655
|
-
</p>
|
|
656
|
-
) : null}
|
|
657
|
-
{setup.steps || setup.command ? <div className="gb-engine-steps">{setup.steps ?? <p>{L.steps}</p>}</div> : null}
|
|
720
|
+
{noCallout ? null : <BridgeCallout bridge={bridge} L={L} />}
|
|
721
|
+
{setup.steps || setup.command ?<div className="gb-engine-steps">{setup.steps ?? <p>{L.steps}</p>}</div> : null}
|
|
658
722
|
{setup.command ? (
|
|
659
723
|
<>
|
|
660
724
|
<pre className="gb-engine-cmd"><code>{setup.command}</code></pre>
|
|
@@ -674,20 +738,23 @@ function SetupTab({ setup, bridge, L }: { setup: BridgeSetup; bridge?: BridgeSta
|
|
|
674
738
|
);
|
|
675
739
|
}
|
|
676
740
|
|
|
677
|
-
|
|
741
|
+
/** The Status tab's content. `inSettings`: the card is titled with the bridge, so the first row says "State", and the
|
|
742
|
+
* callout above it already carries `detail`. */
|
|
743
|
+
export function StatusTab({ bridge, actions, L, inSettings = false }: { bridge: BridgeStatus; actions?: ReactNode; L: EnginePickerLabels; inSettings?: boolean }) {
|
|
678
744
|
const tone = BRIDGE_TONE[bridge.state];
|
|
679
745
|
const yesNo = (v: boolean | undefined) => (v === undefined ? L.unknown : v ? L.yes : L.no);
|
|
746
|
+
const calledOut = inSettings && (bridge.state === "outdated" || bridge.state === "offline" || bridge.state === "unpaired");
|
|
680
747
|
return (
|
|
681
748
|
<>
|
|
682
749
|
<dl className="gb-engine-rows">
|
|
683
|
-
<dt>{L.bridge}</dt>
|
|
750
|
+
<dt>{inSettings ? L.state ?? ENGINE_PICKER_EN.state : L.bridge}</dt>
|
|
684
751
|
<dd><span className={DOT_CLASS[tone]} aria-hidden /> {L[STATE_LABEL[bridge.state]]}</dd>
|
|
685
752
|
{bridge.version ? <><dt>{L.version}</dt><dd>{bridge.version}{bridge.latest && bridge.latest !== bridge.version ? ` · ${L.latest} ${bridge.latest}` : ""}</dd></> : null}
|
|
686
753
|
<dt>{L.startsAtSignIn}</dt><dd>{yesNo(bridge.autostart)}</dd>
|
|
687
754
|
{bridge.machine ? <><dt>{L.machine}</dt><dd>{bridge.machine}</dd></> : null}
|
|
688
755
|
{bridge.lastSeen ? <><dt>{L.lastSeen}</dt><dd>{bridge.lastSeen}</dd></> : null}
|
|
689
756
|
</dl>
|
|
690
|
-
{bridge.detail && bridge.state !== "running" ? <p className="gb-engine-note">{bridge.detail}</p> : null}
|
|
757
|
+
{bridge.detail && bridge.state !== "running" && !calledOut ? <p className="gb-engine-note">{bridge.detail}</p> : null}
|
|
691
758
|
{actions ? <div className="gb-engine-actions">{actions}</div> : null}
|
|
692
759
|
</>
|
|
693
760
|
);
|
package/src/assistant/index.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { AssistantProvider, SIDE_WIDTH_VAR, useAssistant, useAssistantPageFacts,
|
|
|
5
5
|
export * from "./dock";
|
|
6
6
|
export { AssistantWorkspaceLayout, OpenChatTabs, SessionRail, SESSION_RAIL_EN, groupSessions, normalizeForSearch, relativeTime, type AssistantSession, type SessionGroup, type SessionRailIcons, type SessionRailLabels } from "./sessions";
|
|
7
7
|
export { BRIDGE_TONE, BridgeNotice, ENGINE_PICKER_EN, EnginePanel, EnginePicker, engineChipName, useEnginePicker, type BridgeSetup, type BridgeState, type BridgeStatus, type Choice, type EngineChoice, type EnginePickerLabels, type EnginePickerProps, type EnginePickerTab } from "./engine";
|
|
8
|
+
// 0.52.0: the engine in the surface's Settings ("AI & engines"): the chip opens it (`onOpenSettings`), the section draws it.
|
|
9
|
+
export { EngineSettings, EngineSettingsSection, type EngineSettingsProps } from "./engine-settings";
|
|
8
10
|
// 0.29.0: the chat BODY as components (the surface hands in messages and actions), its markdown, and each engine's mark.
|
|
9
11
|
export { AssistantChat, ChatAttach, ChatBubble, ChatComposer, ChatError, ChatLabelsProvider, ChatMarkdown, ChatMessage, ChatMeta, ChatNote, ChatPending, ChatStarters, ChatSteps, ChatThread, CHAT_EN, PaperclipIcon, firstBlank, selectBlank, useComposerDensity, useFullChromeRoom, type AssistantChatProps, type ChatComposerProps, type ChatFix, type ChatLabels, type ChatMarkdownProps, type ChatMessageData, type ChatStarter, type ChatStep, type ComposerDensity } from "./chat";
|
|
10
12
|
export { bareUrl, CODE_FOLD_LINES, FLEET_IMAGE_HOSTS, imageSource, linkTarget, parseBlocks, parseInline, type Block, type ImageHost, type Inline, type InlineOptions } from "./chat-markdown";
|
package/src/assistant-engine.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gb-engine{display:inline-flex;min-width:0;max-width:100%}.gb-engine-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 24px 0 8px;font:inherit;font-size:var(--ui-fs-caption, 12px);font-weight:500;line-height:20px;white-space:nowrap;color:var(--ui-text-muted);background-color:transparent;border:1px solid transparent;border-radius:var(--ui-radius-md, 8px);cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23686b71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}@media (hover: hover){.gb-engine-chip:hover{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}}@media (hover: none){.gb-engine-chip{color:var(--ui-text)}}.gb-engine-chip[aria-expanded=true]{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}.gb-engine-chip:focus-visible{color:var(--ui-text);outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-chiplabel{min-width:0;overflow:hidden;text-overflow:ellipsis}.gb-engine-chipsub{font-weight:450}.gb-engine-chip:disabled{cursor:default;opacity:.55}.gemboss-engine-mark{display:block;width:14px;height:14px;flex:0 0 auto}.gb-engine-chipmark{display:none}.gb-engine-chipmark .gemboss-engine-mark{width:16px;height:16px}.gemboss-ec-input:not([data-density=full]) .gb-engine-chipsub{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chiplabel{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chipmark{display:block}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine:has(.has-mark){flex-shrink:0}.gb-engine-dot{flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ui-text-muted);vertical-align:middle}.gb-engine-dot--ok{background:var(--gemboss-success, #007f5f)}.gb-engine-dot--warn{background:#e8a10a;box-shadow:0 0 0 1px var(--gemboss-warning, #9a6700) inset}.gb-engine-dot--down{background:var(--gemboss-danger, #d72c0d)}.gb-engine-dot--idle{background:transparent;box-shadow:0 0 0 1.5px var(--ui-text-muted) inset}.gb-engine-panel{position:fixed;z-index:1000;inset:auto;margin:0;width:min(360px,calc(100vw - 16px));box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:0 0 var(--ui-space-3, 12px);color:var(--ui-text);font-size:var(--ui-fs-caption, 12px);line-height:16px}.gb-engine-panel[hidden],.gb-engine-panel[popover]:not(:popover-open):not([data-open]){display:none}:where(.gb-engine-panel[popover]){border:0;background:none;color:inherit}.gb-engine-panel--inline{position:static;z-index:auto;overflow:visible}.gb-engine-tabs{padding:0 var(--ui-space-2, 8px)}.gb-engine-tabs>button{gap:6px}.gb-engine-pane{display:grid;gap:var(--ui-space-3, 12px);padding:var(--ui-space-3, 12px) var(--ui-space-3, 12px) 0}.gb-engine-pane p{margin:0}.gb-engine-field{display:grid;gap:6px}.gb-engine-label{font-weight:550;color:var(--ui-text-strong, var(--ui-text))}.gb-engine-note{color:var(--ui-text-muted)}.gb-engine-list{display:grid;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);overflow:hidden}.gb-engine-row{display:grid;gap:2px;min-height:44px;padding:6px 10px 6px 32px;box-sizing:border-box;position:relative;font:inherit;text-align:left;color:inherit;background:transparent;border:0;cursor:pointer}.gb-engine-row+.gb-engine-row{border-top:1px solid var(--ui-border)}.gb-engine-row:before{content:"";position:absolute;left:10px;top:50%;width:14px;height:14px;margin-top:-7px;box-sizing:border-box;border:1.5px solid var(--ui-text-muted);border-radius:50%}.gb-engine-row[aria-checked=true]{background:var(--gemboss-active-bg, #f0f1f4)}.gb-engine-row[aria-checked=true]:before{border:4.5px solid var(--ui-accent)}.gb-engine-row[aria-checked=true] .gb-engine-rowname{font-weight:600}@media (hover: hover){.gb-engine-row:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-row:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.gb-engine-row:disabled{cursor:not-allowed}.gb-engine-row:disabled .gb-engine-rowname{color:var(--ui-text-muted)}.gb-engine-rowhead{display:flex;align-items:center;gap:var(--ui-space-2, 8px);min-width:0}.gb-engine-rowname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:450}.gb-engine-opts{display:flex;flex-wrap:wrap;gap:var(--ui-space-2, 8px)}.gb-engine-opt{height:var(--ui-btn-h, 28px);padding:0 10px;box-sizing:border-box;font:inherit;font-weight:500;color:var(--ui-text);background:transparent;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);cursor:pointer}@media (hover: hover){.gb-engine-opt:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-opt[aria-pressed=true]{background:var(--gemboss-active-bg, #f0f1f4);border-color:var(--ui-text);font-weight:600}.gb-engine-opt:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-opt:disabled{opacity:.5;cursor:not-allowed}.gb-engine-select{width:100%}.gb-engine-groups{display:grid;gap:var(--ui-space-3, 12px)}.gb-engine-group{display:grid;gap:6px}.gb-engine-group+.gb-engine-group{padding-top:var(--ui-space-3, 12px);border-top:1px solid var(--ui-border)}.gb-engine-group[data-current] .gb-engine-rowname{font-weight:600}.gb-engine-problem{color:var(--gemboss-danger-strong, #b42318)}.gb-engine-notes{display:grid;gap:4px;color:var(--ui-text-muted)}.gb-engine-notes p{margin:0}.gb-engine-callout{padding:8px 10px;border-radius:var(--ui-radius-md, 8px);border:1px solid}.gb-engine-callout--warn{background:var(--gemboss-warning-soft, #fff8e0);border-color:var(--gemboss-warning-border, #f5d569);color:var(--gemboss-warning, #9a6700)}.gb-engine-callout--down{background:var(--gemboss-danger-soft, #fff0e9);border-color:var(--gemboss-danger-border, #f5c9bc);color:var(--gemboss-danger-strong, #b42318)}.gb-engine-steps ol,.gb-engine-steps ul{margin:0;padding-left:18px;display:grid;gap:4px}.gb-engine-cmd{margin:0;padding:8px 10px;border-radius:var(--ui-radius-md, 8px);background:var(--ui-surface-2);border:1px solid var(--ui-border);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;line-height:16px;white-space:pre-wrap;word-break:break-all;user-select:all;max-height:96px;overflow:auto}.gb-engine-cmd code{padding:0;border:0;background:none;font:inherit;color:inherit}.gb-engine-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2, 8px)}.gb-engine-said{color:var(--ui-text-muted)}.gb-engine-said:empty{display:none}.gb-engine-code code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600;letter-spacing:.04em;user-select:all}.gb-engine-rows{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0}.gb-engine-rows dt{color:var(--ui-text-muted)}.gb-engine-rows dd{margin:0;display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}.gb-engine-notice{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:4px 6px;margin:0;padding:4px 0;font-size:var(--ui-fs-caption, 12px);line-height:16px;color:var(--ui-text-muted)}.gb-engine-notice>.gb-engine-dot{margin-top:4px}.gb-engine-notice>.gb-engine-notice-link{grid-column:2;justify-self:start}.gb-engine-notice--down .gb-engine-notice-text,.gb-engine-notice--warn .gb-engine-notice-text{color:var(--ui-text)}.gb-engine-notice-text{min-width:0;overflow-wrap:anywhere}.gb-engine-notice-link{flex:none;display:inline-flex;align-items:center;min-height:24px;margin:-4px 0 -4px -4px;padding:0 4px;border:0;border-radius:4px;background:none;font:inherit;font-weight:550;color:var(--ui-accent);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.gb-engine-notice-link:focus-visible{outline:2px solid var(--ui-focus);outline-offset:0}@media (pointer: coarse),(max-width: 47.9975em){.gb-engine-chip{min-height:44px}.gb-engine-opt{min-height:44px;min-width:44px}.gb-engine-notice-link{min-height:44px;margin:-14px 0 -14px -8px;padding:0 8px}}@media (prefers-reduced-motion: no-preference){.gb-engine-chip,.gb-engine-opt,.gb-engine-row{transition:background-color .12s ease,color .12s ease}}
|
|
1
|
+
.gb-engine{display:inline-flex;min-width:0;max-width:100%}.gb-engine-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 24px 0 8px;font:inherit;font-size:var(--ui-fs-caption, 12px);font-weight:500;line-height:20px;white-space:nowrap;color:var(--ui-text-muted);background-color:transparent;border:1px solid transparent;border-radius:var(--ui-radius-md, 8px);cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23686b71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}@media (hover: hover){.gb-engine-chip:hover{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}}@media (hover: none){.gb-engine-chip{color:var(--ui-text)}}.gb-engine-chip[aria-expanded=true]{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}.gb-engine-chip:focus-visible{color:var(--ui-text);outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-chiplabel{min-width:0;overflow:hidden;text-overflow:ellipsis}.gb-engine-chipsub{font-weight:450}.gb-engine-chip:disabled{cursor:default;opacity:.55}.gemboss-engine-mark{display:block;width:14px;height:14px;flex:0 0 auto}.gb-engine-chipmark{display:none}.gb-engine-chipmark .gemboss-engine-mark{width:16px;height:16px}.gemboss-ec-input:not([data-density=full]) .gb-engine-chipsub{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chiplabel{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chipmark{display:block}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine:has(.has-mark){flex-shrink:0}.gb-engine-dot{flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ui-text-muted);vertical-align:middle}.gb-engine-dot--ok{background:var(--gemboss-success, #007f5f)}.gb-engine-dot--warn{background:#e8a10a;box-shadow:0 0 0 1px var(--gemboss-warning, #9a6700) inset}.gb-engine-dot--down{background:var(--gemboss-danger, #d72c0d)}.gb-engine-dot--idle{background:transparent;box-shadow:0 0 0 1.5px var(--ui-text-muted) inset}.gb-engine-panel{position:fixed;z-index:1000;inset:auto;margin:0;width:min(360px,calc(100vw - 16px));box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:0 0 var(--ui-space-3, 12px);color:var(--ui-text);font-size:var(--ui-fs-caption, 12px);line-height:16px}.gb-engine-panel[hidden],.gb-engine-panel[popover]:not(:popover-open):not([data-open]){display:none}:where(.gb-engine-panel[popover]){border:0;background:none;color:inherit}.gb-engine-panel--inline{position:static;z-index:auto;overflow:visible}.gb-engine-tabs{padding:0 var(--ui-space-2, 8px)}.gb-engine-tabs>button{gap:6px}.gb-engine-pane{display:grid;gap:var(--ui-space-3, 12px);padding:var(--ui-space-3, 12px) var(--ui-space-3, 12px) 0}.gb-engine-pane p{margin:0}.gb-engine-field{display:grid;gap:6px}.gb-engine-label{font-weight:550;color:var(--ui-text-strong, var(--ui-text))}.gb-engine-note{color:var(--ui-text-muted)}.gb-engine-list{display:grid;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);overflow:hidden}.gb-engine-row{display:grid;gap:2px;min-height:44px;padding:6px 10px 6px 32px;box-sizing:border-box;position:relative;font:inherit;text-align:left;color:inherit;background:transparent;border:0;cursor:pointer}.gb-engine-row+.gb-engine-row{border-top:1px solid var(--ui-border)}.gb-engine-row:before{content:"";position:absolute;left:10px;top:50%;width:14px;height:14px;margin-top:-7px;box-sizing:border-box;border:1.5px solid var(--ui-text-muted);border-radius:50%}.gb-engine-row[aria-checked=true]{background:var(--gemboss-active-bg, #f0f1f4)}.gb-engine-row[aria-checked=true]:before{border:4.5px solid var(--ui-accent)}.gb-engine-row[aria-checked=true] .gb-engine-rowname{font-weight:600}@media (hover: hover){.gb-engine-row:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-row:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.gb-engine-row:disabled{cursor:not-allowed}.gb-engine-row:disabled .gb-engine-rowname{color:var(--ui-text-muted)}.gb-engine-rowhead{display:flex;align-items:center;gap:var(--ui-space-2, 8px);min-width:0}.gb-engine-rowname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:450}.gb-engine-opts{display:flex;flex-wrap:wrap;gap:var(--ui-space-2, 8px)}.gb-engine-opt{height:var(--ui-btn-h, 28px);padding:0 10px;box-sizing:border-box;font:inherit;font-weight:500;color:var(--ui-text);background:transparent;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);cursor:pointer}@media (hover: hover){.gb-engine-opt:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-opt[aria-pressed=true]{background:var(--gemboss-active-bg, #f0f1f4);border-color:var(--ui-text);font-weight:600}.gb-engine-opt:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-opt:disabled{opacity:.5;cursor:not-allowed}.gb-engine-select{width:100%}.gb-engine-groups{display:grid;gap:var(--ui-space-3, 12px)}.gb-engine-group{display:grid;gap:6px}.gb-engine-group+.gb-engine-group{padding-top:var(--ui-space-3, 12px);border-top:1px solid var(--ui-border)}.gb-engine-group[data-current] .gb-engine-rowname{font-weight:600}.gb-engine-problem{color:var(--gemboss-danger-strong, #b42318)}.gb-engine-notes{display:grid;gap:4px;color:var(--ui-text-muted)}.gb-engine-notes p{margin:0}.gb-engine-callout{padding:8px 10px;border-radius:var(--ui-radius-md, 8px);border:1px solid}.gb-engine-callout--warn{background:var(--gemboss-warning-soft, #fff8e0);border-color:var(--gemboss-warning-border, #f5d569);color:var(--gemboss-warning, #9a6700)}.gb-engine-callout--down{background:var(--gemboss-danger-soft, #fff0e9);border-color:var(--gemboss-danger-border, #f5c9bc);color:var(--gemboss-danger-strong, #b42318)}.gb-engine-steps ol,.gb-engine-steps ul{margin:0;padding-left:18px;display:grid;gap:4px}.gb-engine-cmd{margin:0;padding:8px 10px;border-radius:var(--ui-radius-md, 8px);background:var(--ui-surface-2);border:1px solid var(--ui-border);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;line-height:16px;white-space:pre-wrap;word-break:break-all;user-select:all;max-height:96px;overflow:auto}.gb-engine-cmd code{padding:0;border:0;background:none;font:inherit;color:inherit}.gb-engine-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2, 8px)}.gb-engine-said{color:var(--ui-text-muted)}.gb-engine-said:empty{display:none}.gb-engine-code code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600;letter-spacing:.04em;user-select:all}.gb-engine-rows{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0}.gb-engine-rows dt{color:var(--ui-text-muted)}.gb-engine-rows dd{margin:0;display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}.gb-engine-settings{display:grid;gap:var(--ui-space-4, 16px);max-width:662px;font-size:var(--ui-fs-body, 13px);line-height:20px}.gb-engine-sect{display:grid;gap:var(--ui-space-3, 12px)}.gb-engine-sect>.ui-card__title{margin:0}.gb-engine-sect p{margin:0}.gb-engine-sect:focus,.gb-engine-sub:focus{outline:none}.gb-engine-sub{display:grid;gap:var(--ui-space-3, 12px);padding-top:var(--ui-space-3, 12px);border-top:1px solid var(--ui-border);scroll-margin-top:var(--ui-space-4, 16px)}.gb-engine-subtitle{margin:0;font-size:inherit;line-height:inherit;font-weight:650}.gb-engine-settings .gb-engine-cmd{max-height:none}.gb-engine-notice{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:4px 6px;margin:0;padding:4px 0;font-size:var(--ui-fs-caption, 12px);line-height:16px;color:var(--ui-text-muted)}.gb-engine-notice>.gb-engine-dot{margin-top:4px}.gb-engine-notice>.gb-engine-notice-link{grid-column:2;justify-self:start}.gb-engine-notice--down .gb-engine-notice-text,.gb-engine-notice--warn .gb-engine-notice-text{color:var(--ui-text)}.gb-engine-notice-text{min-width:0;overflow-wrap:anywhere}.gb-engine-notice-link{flex:none;display:inline-flex;align-items:center;min-height:24px;margin:-4px 0 -4px -4px;padding:0 4px;border:0;border-radius:4px;background:none;font:inherit;font-weight:550;color:var(--ui-accent);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.gb-engine-notice-link:focus-visible{outline:2px solid var(--ui-focus);outline-offset:0}@media (pointer: coarse),(max-width: 47.9975em){.gb-engine-chip{min-height:44px}.gb-engine-opt{min-height:44px;min-width:44px}.gb-engine-notice-link{min-height:44px;margin:-14px 0 -14px -8px;padding:0 8px}}@media (prefers-reduced-motion: no-preference){.gb-engine-chip,.gb-engine-opt,.gb-engine-row{transition:background-color .12s ease,color .12s ease}}
|
package/src/engine-plain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(L){"use strict";var N=L.gembossUI;if(!N){L.console&&L.console.error("@gemboss/ui engine-plain.js: load kit-plain.js first (it defines gembossUI)");return}if(N.enginePicker)return;var Z={chip:"Engine",dialog:"Assistant engine",tabs:"Engine, setup and status",engineTab:"Engine",setupTab:"Setup",statusTab:"Status",engine:"Engine",model:"Model",effort:"Effort",defaultChoice:"Default",copy:"Copy command",copied:"Copied",copyFailed:"Select the command and copy it",pairingCode:"Pairing code",steps:"Paste the command into Terminal, then press Enter.",bridge:"Bridge on your machine",version:"Version",latest:"Latest",startsAtSignIn:"Starts at sign-in",machine:"Machine",lastSeen:"Last seen",yes:"Yes",no:"No",unknown:"Not known",running:"Running",outdated:"Outdated",offline:"Not connected",unpaired:"Not set up",checking:"Checking",updateDue:"Update available",close:"Close"},U={running:"ok",outdated:"warn",offline:"down",unpaired:"down",checking:"idle"},q={ok:"gb-engine-dot gb-engine-dot--ok",warn:"gb-engine-dot gb-engine-dot--warn",down:"gb-engine-dot gb-engine-dot--down",idle:"gb-engine-dot gb-engine-dot--idle"},$={success:"ui-badge ui-badge--success",warning:"ui-badge ui-badge--warning",critical:"ui-badge ui-badge--critical",info:"ui-badge ui-badge--info"},ee={warn:"gb-engine-notice gb-engine-notice--warn",down:"gb-engine-notice gb-engine-notice--down"},ne=["notes","modelControl","statusActions"],V=function(i){return i&&N.engineMark?N.engineMark(i,{decorative:!0}):null},I=typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover"),D=function(i){return typeof Node<"u"&&i instanceof Node},te=0;function r(i,g,t){var u=document.createElement(i);if(g)for(var l in g){var o=g[l];o==null||o===!1||(l==="text"?u.textContent=String(o):l==="className"?u.className=o:u.setAttribute(l,o===!0?"":String(o)))}return z(u,t),u}function z(i,g){return g==null||g===!1?i:Array.isArray(g)?(g.forEach(function(t){z(i,t)}),i):(i.appendChild(D(g)?g:document.createTextNode(String(g))),i)}function x(i){return typeof DocumentFragment<"u"&&i instanceof DocumentFragment?Array.prototype.slice.call(i.childNodes):i}var ae=function(i){return D(i)||Array.isArray(i)&&i.some(D)};function j(i,g){for(var t=Array.prototype.slice.call(g.childNodes),u=0;u<t.length;u++){var l=t[u],o=i.childNodes[u];o?o.nodeType===l.nodeType&&(o.nodeType!==1||o.tagName===l.tagName&&o.getAttribute("data-gb-key")===l.getAttribute("data-gb-key"))?ie(o,l):i.replaceChild(l,o):i.appendChild(l)}for(;i.childNodes.length>t.length;)i.removeChild(i.lastChild)}function ie(i,g){if(i.nodeType!==1){i.nodeValue!==g.nodeValue&&(i.nodeValue=g.nodeValue);return}var t,u;for(t=i.attributes.length-1;t>=0;t--)u=i.attributes[t].name,u!=="style"&&!g.hasAttribute(u)&&i.removeAttribute(u);for(t=0;t<g.attributes.length;t++)u=g.attributes[t],i.getAttribute(u.name)!==u.value&&i.setAttribute(u.name,u.value);i.hasAttribute("data-gb-slot")||(j(i,g),i.tagName==="SELECT"&&i.value!==g.getAttribute("data-value")&&(i.value=g.getAttribute("data-value")||""))}function re(i){var g=function(){try{var t=document.createElement("textarea");t.value=i,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();var u=document.execCommand("copy");return t.remove(),u}catch{return!1}};try{if(navigator.clipboard&&navigator.clipboard.writeText)return navigator.clipboard.writeText(i).then(function(){return!0},g)}catch{}return Promise.resolve(g())}function oe(i,g){var t={},u="gb-engine-"+ ++te,l={open:!1,tab:"engine",said:"",saidTimer:0},o=Object.assign({},Z),M={};function G(e){Object.keys(e||{}).forEach(function(n){var a=e[n];if((n==="bridge"||n==="setup")&&a&&typeof a=="object"&&t[n]&&typeof t[n]=="object"&&(a=Object.assign({},t[n],a)),n==="labels"){o=Object.assign({},o,a||{});return}ne.indexOf(n)>=0&&(a=x(a)),n==="engines"&&Array.isArray(a)&&(a=a.map(function(s){return s&&s.note?Object.assign({},s,{note:x(s.note)}):s})),n==="setup"&&a&&a.steps&&(a=Object.assign({},a,{steps:x(a.steps)})),n==="bridge"&&a&&a.detail&&(a=Object.assign({},a,{detail:x(a.detail)})),t[n]=a})}G(g);var T=document.createElement("span");T.className="gb-engine"+(t.className?" "+t.className:"");var b=r("button",{type:"button",className:"gb-engine-chip","aria-haspopup":"dialog","aria-expanded":"false","aria-controls":u+"-panel"}),d=r("div",{id:u+"-panel",className:"gb-engine-panel gemboss-popover-surface",role:"dialog","aria-label":o.dialog,hidden:!0});I&&d.setAttribute("popover","manual"),T.appendChild(b),I?T.appendChild(d):document.body.appendChild(d),i.appendChild(T);function H(){return["engine"].concat(t.setup?["setup"]:[],t.bridge?["status"]:[])}function B(){return H().indexOf(l.tab)>=0?l.tab:"engine"}function A(e,n){return ae(n)?(M[e]=Array.isArray(n)?n.filter(D):[n],r("span",{"data-gb-slot":e,"data-gb-key":"slot-"+e,style:"display:contents"})):n}function le(){d.querySelectorAll("[data-gb-slot]").forEach(function(e){var n=M[e.getAttribute("data-gb-slot")]||[],a=Array.prototype.slice.call(e.childNodes);a.length===n.length&&a.every(function(s,c){return s===n[c]})||e.replaceChildren.apply(e,n)})}function de(){var e=t.bridge&&t.showBridgeDot!==!1?U[t.bridge.state]:null,n=(t.engines||[]).filter(function(c){return c.id===t.engine})[0],a=t.model?(t.models||[]).filter(function(c){return c.id===t.model})[0]:null,s=n?V(n.mark):null;return r("span",null,[e?r("span",{className:q[e],"aria-hidden":"true"}):null,r("span",{className:"gb-engine-chiplabel"},[n?n.label:t.engine||"",a?r("span",{className:"gb-engine-chipsub",text:" \xB7 "+a.label}):null]),s?r("span",{className:"gb-engine-chipmark"},s):null])}function ue(){var e=(t.engines||[]).filter(function(s){return s.id===t.engine})[0],n=t.model?(t.models||[]).filter(function(s){return s.id===t.model})[0]:null,a=t.bridge&&t.showBridgeDot!==!1&&t.bridge.state!=="running"?". "+o.bridge+": "+o[t.bridge.state]:"";return o.chip+": "+(e?e.label:t.engine)+(n?" \xB7 "+n.label:"")+a}function K(e,n,a,s,c,p){var m=t.locked||!c||!!p,F=typeof p=="string"?p:void 0;if(a.length>6||a.some(function(f){return f.group})){var w=r("select",{className:"ui-select ui-select--slim gb-engine-select",disabled:m,title:F,"data-kind":e,"data-value":s||""}),y=null,O;return a.forEach(function(f){var X=r("option",{value:f.id,title:f.title,text:f.label,selected:(s||"")===f.id});f.group?((!y||O!==f.group)&&(y=r("optgroup",{label:f.group}),O=f.group,w.appendChild(y)),y.appendChild(X)):(y=null,O=void 0,w.appendChild(X))}),r("label",{className:"gb-engine-field","data-gb-key":e},[r("span",{className:"gb-engine-label",text:n}),w])}var W=u+"-lbl-"+e;return r("div",{className:"gb-engine-field","data-gb-key":e},[r("span",{className:"gb-engine-label",id:W,text:n}),r("div",{className:"gb-engine-opts",role:"group","aria-labelledby":W},a.map(function(f){return r("button",{type:"button",className:"gb-engine-opt","aria-pressed":String((s||"")===f.id),disabled:m,title:F||f.title,text:f.label,"data-kind":e,"data-choice":f.id})}))])}function P(e){return!(t.locked||e.disabled||!t.onEngineChange)}function ce(){var e=u+"-lbl-engine",n=t.engines||[],a=(n.filter(function(c){return c.id===t.engine&&P(c)})[0]||n.filter(P)[0]||{}).id,s=[r("div",{className:"gb-engine-field","data-gb-key":"engine"},[r("span",{className:"gb-engine-label",id:e,text:o.engine}),r("div",{className:"gb-engine-list",role:"radiogroup","aria-labelledby":e},n.map(function(c){return r("button",{type:"button",role:"radio","aria-checked":String(c.id===t.engine),"data-engine":c.id,"data-gb-key":"engine-"+c.id,tabindex:c.id===a?"0":"-1",className:"gb-engine-row",disabled:!P(c)},[r("span",{className:"gb-engine-rowhead"},[r("span",{className:"gb-engine-rowname",text:c.label}),c.badge?r("span",{className:c.badgeTone?$[c.badgeTone]:"ui-badge",text:c.badge}):null]),c.note?r("span",{className:"gb-engine-note"},A("note-"+c.id,c.note)):null])}))])];return t.modelControl?s.push(r("div",{className:"gb-engine-field","data-gb-key":"model"},[r("span",{className:"gb-engine-label",text:o.model}),A("modelControl",t.modelControl)])):t.models&&t.models.length&&s.push(K("model",o.model,t.models,t.model,t.onModelChange)),t.efforts&&t.efforts.length&&s.push(K("effort",o.effort,t.efforts,t.effort,t.onEffortChange,t.effortDisabled)),t.notes&&s.push(r("div",{className:"gb-engine-notes"},A("notes",t.notes))),s}function ge(){var e=t.setup||{},n=t.bridge,a=[];return n&&(n.state==="outdated"||n.state==="offline"||n.state==="unpaired")&&a.push(r("p",{className:"gb-engine-callout "+(n.state==="outdated"?"gb-engine-callout--warn":"gb-engine-callout--down")},[r("strong",{text:o.bridge+": "+o[n.state].toLowerCase()+"."}),n.detail?" ":null,n.detail?A("detail",n.detail):null])),(e.steps||e.command)&&a.push(r("div",{className:"gb-engine-steps"},e.steps?A("steps",e.steps):r("p",{text:o.steps}))),e.command&&(a.push(r("pre",{className:"gb-engine-cmd"},r("code",{text:e.command}))),a.push(r("div",{className:"gb-engine-actions"},[r("button",{type:"button",className:"ui-btn ui-btn--primary","data-gb-copy":"",text:l.said==="copied"?o.copied:o.copy}),r("span",{className:"gb-engine-said",role:"status",text:l.said==="failed"?o.copyFailed:l.said==="copied"?o.copied:""})]))),e.pairingCode&&a.push(r("p",{className:"gb-engine-code"},[o.pairingCode+": ",r("code",{text:e.pairingCode})])),e.note&&a.push(r("p",{className:"gb-engine-note"},e.note)),a}function fe(){var e=t.bridge,n=r("dl",{className:"gb-engine-rows"}),a=function(p,m){n.appendChild(r("dt",{text:p})),n.appendChild(r("dd",null,m))},s=function(p){return p==null?o.unknown:p?o.yes:o.no};a(o.bridge,[r("span",{className:q[U[e.state]],"aria-hidden":"true"})," "+o[e.state]]),e.version&&a(o.version,e.version+(e.latest&&e.latest!==e.version?" \xB7 "+o.latest+" "+e.latest:"")),a(o.startsAtSignIn,s(e.autostart)),e.machine&&a(o.machine,e.machine),e.lastSeen&&a(o.lastSeen,e.lastSeen);var c=[n];return e.detail&&e.state!=="running"&&c.push(r("p",{className:"gb-engine-note"},A("detail",e.detail))),t.statusActions&&c.push(r("div",{className:"gb-engine-actions"},A("statusActions",t.statusActions))),c}function be(){var e=H(),n=B(),a=document.createElement("div");return e.length>1&&a.appendChild(r("div",{className:"ui-tabs gb-engine-tabs",role:"tablist","aria-label":o.tabs,"data-gb-key":"tabs"},e.map(function(s){return r("button",{type:"button",role:"tab",id:u+"-tab-"+s,"aria-controls":u+"-pane-"+s,"aria-selected":String(n===s),tabindex:n===s?"0":"-1","data-tab":s,"data-gb-key":"tab-"+s},[{engine:o.engineTab,setup:o.setupTab,status:o.statusTab}[s],s==="setup"&&t.bridge&&t.bridge.state==="outdated"?r("span",{className:"gb-engine-dot gb-engine-dot--warn",role:"img","aria-label":o.updateDue}):null])}))),a.appendChild(r("div",{className:"gb-engine-pane",role:e.length>1?"tabpanel":null,id:u+"-pane-"+n,"aria-labelledby":e.length>1?u+"-tab-"+n:null,"data-gb-key":"pane-"+n},n==="engine"?ce():n==="setup"?ge():fe())),a}var S=null;function h(){var e=ue();b.setAttribute("aria-label",e),b.title=e,b.setAttribute("aria-expanded",l.open?"true":"false");var n=(t.engines||[]).filter(function(s){return s.id===t.engine})[0];if(b.className=n&&V(n.mark)?"gb-engine-chip has-mark":"gb-engine-chip",j(b,de()),d.setAttribute("aria-label",o.dialog),M={},!l.open){j(d,document.createElement("div"));return}j(d,be()),le();var a=d.querySelector(".gb-engine-pane");C&&a!==S&&(S&&C.unobserve(S),a&&C.observe(a),S=a)}function E(){l.open&&N.placeFloating(d,b,t.end)}function Y(e){e!==t.engine&&(t.engine=e,t.onEngineChange&&t.onEngineChange(e),h())}function _(e,n,a){var s=e==="model"?t.model:t.effort,c=e==="model"?t.onModelChange:t.onEffortChange;!c||t.locked||((s||"")!==n&&(e==="model"?t.model=n:t.effort=n,c(n)),a?Q():h())}function J(e,n){if(e!==B()&&(l.tab=e,t.onTabChange&&t.onTabChange(e),h(),E()),n){var a=d.querySelector('[role="tab"][data-tab="'+e+'"]');a&&a.focus()}}d.addEventListener("click",function(e){var n=e.target.closest?e.target:e.target.parentElement,a=n&&n.closest("button");!a||!d.contains(a)||a.disabled||(a.hasAttribute("data-tab")?J(a.getAttribute("data-tab")):a.hasAttribute("data-engine")?Y(a.getAttribute("data-engine")):a.hasAttribute("data-choice")?_(a.getAttribute("data-kind"),a.getAttribute("data-choice"),!0):a.hasAttribute("data-gb-copy")&&pe())}),d.addEventListener("change",function(e){var n=e.target;n&&n.tagName==="SELECT"&&n.hasAttribute("data-kind")&&d.contains(n)&&_(n.getAttribute("data-kind"),n.value,!1)}),d.addEventListener("keydown",function(e){var n=e.target;if(!(!n||!n.getAttribute)){if(n.getAttribute("role")==="tab"){var a=H(),s=a.indexOf(B()),c=e.key==="ArrowRight"?a[(s+1)%a.length]:e.key==="ArrowLeft"?a[(s-1+a.length)%a.length]:e.key==="Home"?a[0]:e.key==="End"?a[a.length-1]:null;if(!c)return;e.preventDefault(),J(c,!0)}else if(n.hasAttribute("data-engine")){var p=e.key==="ArrowDown"||e.key==="ArrowRight"?1:e.key==="ArrowUp"||e.key==="ArrowLeft"?-1:0,m=(t.engines||[]).filter(P);if(!p||!m.length)return;e.preventDefault();var F=m.map(function(O){return O.id}).indexOf(n.getAttribute("data-engine")),w=m[(F+p+m.length)%m.length];Y(w.id);var y=d.querySelector('[data-engine="'+(L.CSS&&CSS.escape?CSS.escape(w.id):w.id)+'"]');y&&y.focus()}}});function pe(){var e=t.setup||{};e.command&&re(e.command).then(function(n){l.said=n?"copied":"failed",h(),clearTimeout(l.saidTimer),l.saidTimer=setTimeout(function(){l.said="",h()},2e3)})}var R=-1,k=0,C=typeof ResizeObserver>"u"?null:new ResizeObserver(function(){d.scrollHeight!==R&&(R=d.scrollHeight,E())});function me(e){if(!(e.key!=="Escape"||e.defaultPrevented||!l.open)&&!(e.isComposing||e.keyCode===229)){var n=document.activeElement,a=n&&n.closest?n.closest('dialog[open], [aria-modal="true"]'):null;a&&!d.contains(a)||(e.preventDefault(),n&&(d.contains(n)||b.contains(n))?(e.stopPropagation(),Q()):v(!1))}}function he(e){var n=e.target,a=n&&n.closest?n.closest('dialog[open], [aria-modal="true"]'):null;a&&!d.contains(a)&&v(!1)}function ve(e){var n=e.target;d.contains(n)||b.contains(n)||n&&n.closest&&n.closest('dialog[open], [aria-modal="true"], .ui-overlay')||v(!1)}function ye(e){var n=e.target;!n||d.contains(n)||n!==document&&n.nodeType!==9&&!n.contains(b)||k||(k=requestAnimationFrame(function(){k=0,E()}))}function Ne(e){var n=e?"addEventListener":"removeEventListener";document[n]("keydown",me,!0),document[n]("pointerdown",ve,!0),document[n]("focusin",he,!0),document[n]("scroll",ye,!0),window[n]("resize",E),e?C&&C.observe(d):(cancelAnimationFrame(k),k=0,C&&C.disconnect(),S=null,R=-1)}function v(e){if(e!==l.open){if(l.open=e,e||(l.tab="engine"),d.hidden=!e,e?d.setAttribute("data-open",""):d.removeAttribute("data-open"),I&&(e&&!d.matches(":popover-open")&&d.showPopover(),!e&&d.matches(":popover-open")&&d.hidePopover()),Ne(e),h(),E(),e){var n=d.querySelector('[role="tab"][aria-selected="true"]')||d.querySelector("button:not([disabled])");n&&n.focus()}t.onOpenChange&&t.onOpenChange(e)}}function Q(){v(!1),b.focus()}return b.addEventListener("click",function(){v(!l.open)}),h(),{element:T,panel:d,update:function(e){G(e),h()},openTab:function(e){var n=l.open;if(e!==l.tab&&(l.tab=e,t.onTabChange&&t.onTabChange(e)),!n)v(!0);else{h(),E();var a=d.querySelector('[role="tab"][aria-selected="true"]');a&&a.focus()}},open:function(){v(!0)},close:function(){v(!1)},isOpen:function(){return l.open},destroy:function(){v(!1),clearTimeout(l.saidTimer),T.remove(),d.remove()}}}function se(i){i=i||{};var g=i.tone==="warn"?"warn":"down",t=r("p",{className:ee[g]+(i.className?" "+i.className:""),role:"status"},[r("span",{className:q[g],"aria-hidden":"true"}),r("span",{className:"gb-engine-notice-text"},x(i.node)||i.text||"")]);if(i.onOpenSetup){var u=r("button",{type:"button",className:"gb-engine-notice-link",text:i.action||"Open setup"});u.addEventListener("click",i.onOpenSetup),t.appendChild(u)}return t}N.enginePicker=oe,N.bridgeNotice=se})(typeof globalThis<"u"?globalThis:this);
|
|
1
|
+
(function(j){"use strict";var A=j.gembossUI;if(!A){j.console&&j.console.error("@gemboss/ui engine-plain.js: load kit-plain.js first (it defines gembossUI)");return}if(A.enginePicker)return;var ce={chip:"Engine",dialog:"Assistant engine",tabs:"Engine, setup and status",engineTab:"Engine",setupTab:"Setup",statusTab:"Status",engine:"Engine",model:"Model",effort:"Effort",defaultChoice:"Default",copy:"Copy command",copied:"Copied",copyFailed:"Select the command and copy it",pairingCode:"Pairing code",steps:"Paste the command into Terminal, then press Enter.",bridge:"Bridge on your machine",version:"Version",latest:"Latest",startsAtSignIn:"Starts at sign-in",machine:"Machine",lastSeen:"Last seen",yes:"Yes",no:"No",unknown:"Not known",running:"Running",outdated:"Outdated",offline:"Not connected",unpaired:"Not set up",checking:"Checking",updateDue:"Update available",close:"Close",state:"State",setupTitle:"Install or update"},J={running:"ok",outdated:"warn",offline:"down",unpaired:"down",checking:"idle"},M={ok:"gb-engine-dot gb-engine-dot--ok",warn:"gb-engine-dot gb-engine-dot--warn",down:"gb-engine-dot gb-engine-dot--down",idle:"gb-engine-dot gb-engine-dot--idle"},ge={success:"ui-badge ui-badge--success",warning:"ui-badge ui-badge--warning",critical:"ui-badge ui-badge--critical",info:"ui-badge ui-badge--info"},fe={warn:"gb-engine-notice gb-engine-notice--warn",down:"gb-engine-notice gb-engine-notice--down"},be=["notes","modelControl","statusActions"],Q=function(o){return o&&A.engineMark?A.engineMark(o,{decorative:!0}):null},H=typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover"),q=function(o){return typeof Node<"u"&&o instanceof Node},pe=0;function r(o,c,t){var u=document.createElement(o);if(c)for(var s in c){var g=c[s];g==null||g===!1||(s==="text"?u.textContent=String(g):s==="className"?u.className=g:u.setAttribute(s,g===!0?"":String(g)))}return W(u,t),u}function W(o,c){return c==null||c===!1?o:Array.isArray(c)?(c.forEach(function(t){W(o,t)}),o):(o.appendChild(q(c)?c:document.createTextNode(String(c))),o)}function O(o){return typeof DocumentFragment<"u"&&o instanceof DocumentFragment?Array.prototype.slice.call(o.childNodes):o}var me=function(o){return q(o)||Array.isArray(o)&&o.some(q)};function k(o,c){for(var t=Array.prototype.slice.call(c.childNodes),u=0;u<t.length;u++){var s=t[u],g=o.childNodes[u];g?g.nodeType===s.nodeType&&(g.nodeType!==1||g.tagName===s.tagName&&g.getAttribute("data-gb-key")===s.getAttribute("data-gb-key"))?he(g,s):o.replaceChild(s,g):o.appendChild(s)}for(;o.childNodes.length>t.length;)o.removeChild(o.lastChild)}function he(o,c){if(o.nodeType!==1){o.nodeValue!==c.nodeValue&&(o.nodeValue=c.nodeValue);return}var t,u;for(t=o.attributes.length-1;t>=0;t--)u=o.attributes[t].name,u!=="style"&&!c.hasAttribute(u)&&o.removeAttribute(u);for(t=0;t<c.attributes.length;t++)u=c.attributes[t],o.getAttribute(u.name)!==u.value&&o.setAttribute(u.name,u.value);o.hasAttribute("data-gb-slot")||(k(o,c),o.tagName==="SELECT"&&o.value!==c.getAttribute("data-value")&&(o.value=c.getAttribute("data-value")||""))}function ve(o){var c=function(){try{var t=document.createElement("textarea");t.value=o,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();var u=document.execCommand("copy");return t.remove(),u}catch{return!1}};try{if(navigator.clipboard&&navigator.clipboard.writeText)return navigator.clipboard.writeText(o).then(function(){return!0},c)}catch{}return Promise.resolve(c())}function ye(o,c){var t={},u="gb-engine-"+ ++pe,s={open:!1,tab:"engine",said:"",saidTimer:0,focus:null},g=null,l=Object.assign({},ce),V={};function X(n){Object.keys(n||{}).forEach(function(e){var a=n[e];if((e==="bridge"||e==="setup")&&a&&typeof a=="object"&&t[e]&&typeof t[e]=="object"&&(a=Object.assign({},t[e],a)),e==="labels"){l=Object.assign({},l,a||{});return}be.indexOf(e)>=0&&(a=O(a)),e==="engines"&&Array.isArray(a)&&(a=a.map(function(i){return i&&i.note?Object.assign({},i,{note:O(i.note)}):i})),e==="setup"&&a&&a.steps&&(a=Object.assign({},a,{steps:O(a.steps)})),e==="bridge"&&a&&a.detail&&(a=Object.assign({},a,{detail:O(a.detail)})),t[e]=a})}X(c);var S=document.createElement("span");S.className="gb-engine"+(t.className?" "+t.className:"");var m=r("button",{type:"button",className:"gb-engine-chip","aria-haspopup":"dialog","aria-expanded":t.onOpenSettings?null:"false","aria-controls":t.onOpenSettings?null:u+"-panel"}),d=r("div",{id:u+"-panel",className:"gb-engine-panel gemboss-popover-surface",role:"dialog","aria-label":l.dialog,hidden:!0});H&&d.setAttribute("popover","manual"),S.appendChild(m),H?S.appendChild(d):document.body.appendChild(d),o.appendChild(S);function R(){return["engine"].concat(t.setup?["setup"]:[],t.bridge?["status"]:[])}function U(){return R().indexOf(s.tab)>=0?s.tab:"engine"}function w(n,e){return me(e)?(V[n]=Array.isArray(e)?e.filter(q):[e],r("span",{"data-gb-slot":n,"data-gb-key":"slot-"+n,style:"display:contents"})):e}function Z(n){n.querySelectorAll("[data-gb-slot]").forEach(function(e){var a=V[e.getAttribute("data-gb-slot")]||[],i=Array.prototype.slice.call(e.childNodes);i.length===a.length&&i.every(function(b,f){return b===a[f]})||e.replaceChildren.apply(e,a)})}function Ce(){var n=t.bridge&&t.showBridgeDot!==!1?J[t.bridge.state]:null,e=(t.engines||[]).filter(function(b){return b.id===t.engine})[0],a=t.model?(t.models||[]).filter(function(b){return b.id===t.model})[0]:null,i=e?Q(e.mark):null;return r("span",null,[n?r("span",{className:M[n],"aria-hidden":"true"}):null,r("span",{className:"gb-engine-chiplabel"},[e?e.label:t.engine||"",a?r("span",{className:"gb-engine-chipsub",text:" \xB7 "+a.label}):null]),i?r("span",{className:"gb-engine-chipmark"},i):null])}function Ae(){var n=(t.engines||[]).filter(function(i){return i.id===t.engine})[0],e=t.model?(t.models||[]).filter(function(i){return i.id===t.model})[0]:null,a=t.bridge&&t.showBridgeDot!==!1&&t.bridge.state!=="running"?". "+l.bridge+": "+l[t.bridge.state]:"";return l.chip+": "+(n?n.label:t.engine)+(e?" \xB7 "+e.label:"")+a}function $(n,e,a,i,b,f){var h=t.locked||!b||!!f,y=typeof f=="string"?f:void 0;if(a.length>6||a.some(function(p){return p.group})){var P=r("select",{className:"ui-select ui-select--slim gb-engine-select",disabled:h,title:y,"data-kind":n,"data-value":i||""}),C=null,E;return a.forEach(function(p){var de=r("option",{value:p.id,title:p.title,text:p.label,selected:(i||"")===p.id});p.group?((!C||E!==p.group)&&(C=r("optgroup",{label:p.group}),E=p.group,P.appendChild(C)),C.appendChild(de)):(C=null,E=void 0,P.appendChild(de))}),r("label",{className:"gb-engine-field","data-gb-key":n},[r("span",{className:"gb-engine-label",text:e}),P])}var B=u+"-lbl-"+n;return r("div",{className:"gb-engine-field","data-gb-key":n},[r("span",{className:"gb-engine-label",id:B,text:e}),r("div",{className:"gb-engine-opts",role:"group","aria-labelledby":B},a.map(function(p){return r("button",{type:"button",className:"gb-engine-opt","aria-pressed":String((i||"")===p.id),disabled:h,title:y||p.title,text:p.label,"data-kind":n,"data-choice":p.id})}))])}function F(n){return!(t.locked||n.disabled||!t.onEngineChange)}function ee(n){var e=n||u+"-lbl-engine",a=t.engines||[],i=(a.filter(function(f){return f.id===t.engine&&F(f)})[0]||a.filter(F)[0]||{}).id,b=[r("div",{className:"gb-engine-field","data-gb-key":"engine"},[n?null:r("span",{className:"gb-engine-label",id:e,text:l.engine}),r("div",{className:"gb-engine-list",role:"radiogroup","aria-labelledby":e},a.map(function(f){return r("button",{type:"button",role:"radio","aria-checked":String(f.id===t.engine),"data-engine":f.id,"data-gb-key":"engine-"+f.id,tabindex:f.id===i?"0":"-1",className:"gb-engine-row",disabled:!F(f)},[r("span",{className:"gb-engine-rowhead"},[r("span",{className:"gb-engine-rowname",text:f.label}),f.badge?r("span",{className:f.badgeTone?ge[f.badgeTone]:"ui-badge",text:f.badge}):null]),f.note?r("span",{className:"gb-engine-note"},w("note-"+f.id,f.note)):null])}))])];return t.modelControl?b.push(r("div",{className:"gb-engine-field","data-gb-key":"model"},[r("span",{className:"gb-engine-label",text:l.model}),w("modelControl",t.modelControl)])):t.models&&t.models.length&&b.push($("model",l.model,t.models,t.model,t.onModelChange)),t.efforts&&t.efforts.length&&b.push($("effort",l.effort,t.efforts,t.effort,t.onEffortChange,t.effortDisabled)),t.notes&&b.push(r("div",{className:"gb-engine-notes"},w("notes",t.notes))),b}function ne(){var n=t.bridge;return!!n&&(n.state==="outdated"||n.state==="offline"||n.state==="unpaired")}function te(){var n=t.bridge;return ne()?r("p",{className:"gb-engine-callout "+(n.state==="outdated"?"gb-engine-callout--warn":"gb-engine-callout--down"),"data-gb-key":"callout"},[r("strong",{text:l.bridge+": "+l[n.state].toLowerCase()+"."}),n.detail?" ":null,n.detail?w("detail",n.detail):null]):null}function ae(n){var e=t.setup||{},a=[],i=n?null:te();return i&&a.push(i),(e.steps||e.command)&&a.push(r("div",{className:"gb-engine-steps"},e.steps?w("steps",e.steps):r("p",{text:l.steps}))),e.command&&(a.push(r("pre",{className:"gb-engine-cmd"},r("code",{text:e.command}))),a.push(r("div",{className:"gb-engine-actions"},[r("button",{type:"button",className:"ui-btn ui-btn--primary","data-gb-copy":"",text:s.said==="copied"?l.copied:l.copy}),r("span",{className:"gb-engine-said",role:"status",text:s.said==="failed"?l.copyFailed:s.said==="copied"?l.copied:""})]))),e.pairingCode&&a.push(r("p",{className:"gb-engine-code"},[l.pairingCode+": ",r("code",{text:e.pairingCode})])),e.note&&a.push(r("p",{className:"gb-engine-note"},e.note)),a}function ie(n){var e=t.bridge,a=r("dl",{className:"gb-engine-rows"}),i=function(h,y){a.appendChild(r("dt",{text:h})),a.appendChild(r("dd",null,y))},b=function(h){return h==null?l.unknown:h?l.yes:l.no};i(n?l.state:l.bridge,[r("span",{className:M[J[e.state]],"aria-hidden":"true"})," "+l[e.state]]),e.version&&i(l.version,e.version+(e.latest&&e.latest!==e.version?" \xB7 "+l.latest+" "+e.latest:"")),i(l.startsAtSignIn,b(e.autostart)),e.machine&&i(l.machine,e.machine),e.lastSeen&&i(l.lastSeen,e.lastSeen);var f=[a];return e.detail&&e.state!=="running"&&!(n&&ne())&&f.push(r("p",{className:"gb-engine-note"},w("detail",e.detail))),t.statusActions&&f.push(r("div",{className:"gb-engine-actions"},w("statusActions",t.statusActions))),f}function we(){var n=R(),e=U(),a=document.createElement("div");return n.length>1&&a.appendChild(r("div",{className:"ui-tabs gb-engine-tabs",role:"tablist","aria-label":l.tabs,"data-gb-key":"tabs"},n.map(function(i){return r("button",{type:"button",role:"tab",id:u+"-tab-"+i,"aria-controls":u+"-pane-"+i,"aria-selected":String(e===i),tabindex:e===i?"0":"-1","data-tab":i,"data-gb-key":"tab-"+i},[{engine:l.engineTab,setup:l.setupTab,status:l.statusTab}[i],i==="setup"&&t.bridge&&t.bridge.state==="outdated"?r("span",{className:"gb-engine-dot gb-engine-dot--warn",role:"img","aria-label":l.updateDue}):null])}))),a.appendChild(r("div",{className:"gb-engine-pane",role:n.length>1?"tabpanel":null,id:u+"-pane-"+e,"aria-labelledby":n.length>1?u+"-tab-"+e:null,"data-gb-key":"pane-"+e},e==="engine"?ee():e==="setup"?ae():ie())),a}function Te(){var n=document.createElement("div"),e=u+"-s-engine",a=u+"-s-bridge",i=u+"-s-setup";if(n.appendChild(r("section",{className:"ui-card gb-engine-sect","data-gb-part":"engine","aria-labelledby":e,"data-gb-key":"s-engine"},[r("h3",{className:"ui-card__title",id:e,text:l.engine})].concat(ee(e)))),t.bridge||t.setup){var b=[r("h3",{className:"ui-card__title",id:a,text:l.bridge}),te()];t.bridge&&(b=b.concat(ie(!0))),t.setup&&b.push(r("div",{className:"gb-engine-sub","data-gb-part":"setup",role:"group","aria-labelledby":i,tabindex:"-1","data-gb-key":"s-setup"},[r("h4",{className:"gb-engine-subtitle",id:i,text:l.setupTitle})].concat(ae(!0)))),n.appendChild(r("section",{className:"ui-card gb-engine-sect","data-gb-part":"bridge","aria-labelledby":a,tabindex:"-1","data-gb-key":"s-bridge"},b))}return n}var D=null;function v(){var n=Ae();m.setAttribute("aria-label",n),m.title=n,t.onOpenSettings||m.setAttribute("aria-expanded",s.open?"true":"false");var e=(t.engines||[]).filter(function(i){return i.id===t.engine})[0];if(m.className=e&&Q(e.mark)?"gb-engine-chip has-mark":"gb-engine-chip",k(m,Ce()),d.setAttribute("aria-label",l.dialog),V={},g&&(k(g,Te()),Z(g)),!s.open){k(d,document.createElement("div"));return}k(d,we()),Z(d);var a=d.querySelector(".gb-engine-pane");T&&a!==D&&(D&&T.unobserve(D),a&&T.observe(a),D=a)}function x(){s.open&&A.placeFloating(d,m,t.end)}function re(n){n!==t.engine&&(t.engine=n,t.onEngineChange&&t.onEngineChange(n),v())}function oe(n,e,a){var i=n==="model"?t.model:t.effort,b=n==="model"?t.onModelChange:t.onEffortChange;!b||t.locked||((i||"")!==e&&(n==="model"?t.model=e:t.effort=e,b(e)),a?le():v())}function se(n,e){if(n!==U()&&(s.tab=n,t.onTabChange&&t.onTabChange(n),v(),x()),e){var a=d.querySelector('[role="tab"][data-tab="'+n+'"]');a&&a.focus()}}function Se(n){var e=n.currentTarget,a=n.target.closest?n.target:n.target.parentElement,i=a&&a.closest("button");!i||!e.contains(i)||i.disabled||(i.hasAttribute("data-tab")?se(i.getAttribute("data-tab")):i.hasAttribute("data-engine")?re(i.getAttribute("data-engine")):i.hasAttribute("data-choice")?oe(i.getAttribute("data-kind"),i.getAttribute("data-choice"),e===d):i.hasAttribute("data-gb-copy")&&Oe())}function xe(n){var e=n.target;e&&e.tagName==="SELECT"&&e.hasAttribute("data-kind")&&n.currentTarget.contains(e)&&oe(e.getAttribute("data-kind"),e.value,!1)}function Ee(n){var e=n.currentTarget,a=n.target;if(!(!a||!a.getAttribute)){if(a.getAttribute("role")==="tab"){var i=R(),b=i.indexOf(U()),f=n.key==="ArrowRight"?i[(b+1)%i.length]:n.key==="ArrowLeft"?i[(b-1+i.length)%i.length]:n.key==="Home"?i[0]:n.key==="End"?i[i.length-1]:null;if(!f)return;n.preventDefault(),se(f,!0)}else if(a.hasAttribute("data-engine")){var h=n.key==="ArrowDown"||n.key==="ArrowRight"?1:n.key==="ArrowUp"||n.key==="ArrowLeft"?-1:0,y=(t.engines||[]).filter(F);if(!h||!y.length)return;n.preventDefault();var P=y.map(function(B){return B.id}).indexOf(a.getAttribute("data-engine")),C=y[(P+h+y.length)%y.length];re(C.id);var E=e.querySelector('[data-engine="'+(j.CSS&&CSS.escape?CSS.escape(C.id):C.id)+'"]');E&&E.focus()}}}function _(n,e){var a=e?"addEventListener":"removeEventListener";n[a]("click",Se),n[a]("change",xe),n[a]("keydown",Ee)}_(d,!0);function Oe(){var n=t.setup||{};n.command&&ve(n.command).then(function(e){s.said=e?"copied":"failed",v(),clearTimeout(s.saidTimer),s.saidTimer=setTimeout(function(){s.said="",v()},2e3)})}var z=-1,L=0,T=typeof ResizeObserver>"u"?null:new ResizeObserver(function(){d.scrollHeight!==z&&(z=d.scrollHeight,x())});function ke(n){if(!(n.key!=="Escape"||n.defaultPrevented||!s.open)&&!(n.isComposing||n.keyCode===229)){var e=document.activeElement,a=e&&e.closest?e.closest('dialog[open], [aria-modal="true"]'):null;a&&!d.contains(a)||(n.preventDefault(),e&&(d.contains(e)||m.contains(e))?(n.stopPropagation(),le()):N(!1))}}function De(n){var e=n.target,a=e&&e.closest?e.closest('dialog[open], [aria-modal="true"]'):null;a&&!d.contains(a)&&N(!1)}function Le(n){var e=n.target;d.contains(e)||m.contains(e)||e&&e.closest&&e.closest('dialog[open], [aria-modal="true"], .ui-overlay')||N(!1)}function Ie(n){var e=n.target;!e||d.contains(e)||e!==document&&e.nodeType!==9&&!e.contains(m)||L||(L=requestAnimationFrame(function(){L=0,x()}))}function Pe(n){var e=n?"addEventListener":"removeEventListener";document[e]("keydown",ke,!0),document[e]("pointerdown",Le,!0),document[e]("focusin",De,!0),document[e]("scroll",Ie,!0),window[e]("resize",x),n?T&&T.observe(d):(cancelAnimationFrame(L),L=0,T&&T.disconnect(),D=null,z=-1)}function N(n){if(n!==s.open){if(s.open=n,n||(s.tab="engine"),d.hidden=!n,n?d.setAttribute("data-open",""):d.removeAttribute("data-open"),H&&(n&&!d.matches(":popover-open")&&d.showPopover(),!n&&d.matches(":popover-open")&&d.hidePopover()),Pe(n),v(),x(),n){var e=d.querySelector('[role="tab"][aria-selected="true"]')||d.querySelector("button:not([disabled])");e&&e.focus()}t.onOpenChange&&t.onOpenChange(n)}}function le(){N(!1),m.focus()}m.addEventListener("click",function(){if(t.onOpenSettings){s.focus="engine",t.onOpenSettings("engine");return}N(!s.open)});function ue(){var n=s.focus;if(s.focus=null,!(!g||!n||n==="engine")){var e=g.querySelector('[data-gb-part="'+(n==="status"?"bridge":n)+'"]');e&&requestAnimationFrame(function(){e.scrollIntoView({block:"start"});var a=e.querySelector("button:not([disabled]), select:not([disabled]), input:not([disabled])");(a||e).focus({preventScroll:!0})})}}var K=!1,I=null;function G(n){n!==K&&(K=n,t.onOpenChange&&t.onOpenChange(n))}function je(n){g&&Y(),g=r("div",{className:"gb-engine-settings"}),_(g,!0),n.appendChild(g),v(),ue(),typeof IntersectionObserver>"u"?G(!0):(I=new IntersectionObserver(function(e){G(e[e.length-1].isIntersecting)}),I.observe(g))}function Y(){g&&(I&&(I.disconnect(),I=null),_(g,!1),g.remove(),g=null,G(!1))}return v(),{element:S,panel:d,update:function(n){X(n),v()},openTab:function(n){if(t.onOpenSettings){s.focus=n,t.onOpenSettings(n),g&&ue();return}var e=s.open;if(n!==s.tab&&(s.tab=n,t.onTabChange&&t.onTabChange(n)),!e)N(!0);else{v(),x();var a=d.querySelector('[role="tab"][aria-selected="true"]');a&&a.focus()}},open:function(){N(!0)},close:function(){t.onOpenSettings||N(!1)},isOpen:function(){return t.onOpenSettings?K:s.open},mountSettings:je,unmountSettings:Y,destroy:function(){N(!1),Y(),clearTimeout(s.saidTimer),S.remove(),d.remove()}}}function Ne(o){o=o||{};var c=o.tone==="warn"?"warn":"down",t=r("p",{className:fe[c]+(o.className?" "+o.className:""),role:"status"},[r("span",{className:M[c],"aria-hidden":"true"}),r("span",{className:"gb-engine-notice-text"},O(o.node)||o.text||"")]);if(o.onOpenSetup){var u=r("button",{type:"button",className:"gb-engine-notice-link",text:o.action||"Open setup"});u.addEventListener("click",o.onOpenSetup),t.appendChild(u)}return t}A.enginePicker=ye,A.bridgeNotice=Ne})(typeof globalThis<"u"?globalThis:this);
|