@aginies/ui 0.2.0 → 0.3.1

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/dist/index.cjs CHANGED
@@ -32,6 +32,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
34
  Accordion: () => Accordion,
35
+ ActivityBar: () => ActivityBar,
35
36
  ActivityTimeline: () => ActivityTimeline,
36
37
  ActivityWidget: () => ActivityWidget,
37
38
  AgendaWidget: () => AgendaWidget,
@@ -2229,22 +2230,170 @@ function DockedFormFooter({ onSave, onCancel, changes, saving, disabled, message
2229
2230
  }
2230
2231
 
2231
2232
  // src/data/DataTable.jsx
2233
+ var import_react37 = __toESM(require("react"), 1);
2234
+
2235
+ // src/layout/responsive.js
2232
2236
  var import_react36 = __toESM(require("react"), 1);
2237
+ var BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280, "2xl": 1536 };
2238
+ var BREAKPOINT_ORDER = ["base", "sm", "md", "lg", "xl", "2xl"];
2239
+ function breakpointFor(width) {
2240
+ let name = "base";
2241
+ for (const k of BREAKPOINT_ORDER.slice(1)) if (width >= BREAKPOINTS[k]) name = k;
2242
+ return name;
2243
+ }
2244
+ function toPx(bp) {
2245
+ return typeof bp === "number" ? bp : BREAKPOINTS[bp] != null ? BREAKPOINTS[bp] : 0;
2246
+ }
2247
+ function atLeast(a, b) {
2248
+ return BREAKPOINT_ORDER.indexOf(a) >= BREAKPOINT_ORDER.indexOf(b);
2249
+ }
2250
+ var useIsoLayoutEffect = typeof window !== "undefined" ? import_react36.default.useLayoutEffect : import_react36.default.useEffect;
2251
+ function useElementWidth(ref) {
2252
+ const [w, setW] = import_react36.default.useState(null);
2253
+ useIsoLayoutEffect(() => {
2254
+ const el = ref.current;
2255
+ if (!el) return void 0;
2256
+ const read2 = () => {
2257
+ const n = el.offsetWidth;
2258
+ setW((p) => p === n ? p : n);
2259
+ };
2260
+ read2();
2261
+ if (typeof ResizeObserver === "undefined") return void 0;
2262
+ const ro = new ResizeObserver(read2);
2263
+ ro.observe(el);
2264
+ return () => ro.disconnect();
2265
+ }, [ref]);
2266
+ return w;
2267
+ }
2268
+ function useBreakpoint(ref) {
2269
+ const w = useElementWidth(ref);
2270
+ return w == null ? null : breakpointFor(w);
2271
+ }
2272
+ var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]';
2273
+ function useOverlayFocus(ref, open, onClose) {
2274
+ const closeRef = import_react36.default.useRef(onClose);
2275
+ closeRef.current = onClose;
2276
+ import_react36.default.useEffect(() => {
2277
+ if (!open) return void 0;
2278
+ const el = ref.current;
2279
+ if (!el) return void 0;
2280
+ const prev = typeof document !== "undefined" ? document.activeElement : null;
2281
+ if (!el.contains(document.activeElement)) el.focus({ preventScroll: true });
2282
+ const onKey = (e) => {
2283
+ if (e.key === "Escape") {
2284
+ if (closeRef.current) {
2285
+ e.stopPropagation();
2286
+ closeRef.current();
2287
+ }
2288
+ return;
2289
+ }
2290
+ if (e.key !== "Tab" || !el.contains(document.activeElement)) return;
2291
+ const f = Array.from(el.querySelectorAll(FOCUSABLE)).filter((n) => n.offsetParent !== null || n === document.activeElement);
2292
+ if (!f.length) {
2293
+ e.preventDefault();
2294
+ el.focus({ preventScroll: true });
2295
+ return;
2296
+ }
2297
+ const first = f[0], last = f[f.length - 1];
2298
+ if (e.shiftKey && (document.activeElement === first || document.activeElement === el)) {
2299
+ e.preventDefault();
2300
+ last.focus();
2301
+ } else if (!e.shiftKey && document.activeElement === last) {
2302
+ e.preventDefault();
2303
+ first.focus();
2304
+ }
2305
+ };
2306
+ el.addEventListener("keydown", onKey);
2307
+ return () => {
2308
+ el.removeEventListener("keydown", onKey);
2309
+ const a = document.activeElement;
2310
+ if (prev && prev.focus && document.contains(prev) && (!a || a === document.body || el.contains(a))) prev.focus({ preventScroll: true });
2311
+ };
2312
+ }, [open, ref]);
2313
+ }
2314
+
2315
+ // src/data/DataTable.jsx
2233
2316
  var import_jsx_runtime35 = require("react/jsx-runtime");
2234
- var DEFAULT_LABELS20 = { empty: "Nothing here yet", emptyHint: "", loading: "Loading\u2026", error: "Could not load the data", errorHint: "Check your connection and try again.", retry: "Try again", selectAll: "Select all rows", selectRow: "Select row", actions: "Actions", sortedAsc: "sorted ascending", sortedDesc: "sorted descending", edit: "Edit" };
2317
+ var DEFAULT_LABELS20 = { empty: "Nothing here yet", emptyHint: "", loading: "Loading\u2026", error: "Could not load the data", errorHint: "Check your connection and try again.", retry: "Try again", selectAll: "Select all rows", selectRow: "Select row", actions: "Actions", sortedAsc: "sorted ascending", sortedDesc: "sorted descending", edit: "Edit", expandRow: "Show hidden columns", collapseRow: "Hide hidden columns" };
2318
+ var DEFAULT_MIN = 120;
2319
+ var EXPANDER = 24;
2320
+ var NO_REF = { current: null };
2321
+ var pxOf = (v) => typeof v === "number" ? v : typeof v === "string" && /^\s*\d+(\.\d+)?(px)?\s*$/.test(v) ? parseFloat(v) : null;
2322
+ var colMin = (c) => {
2323
+ const m = pxOf(c.minWidth);
2324
+ if (m != null) return m;
2325
+ const w = pxOf(c.width);
2326
+ return w != null ? w : DEFAULT_MIN;
2327
+ };
2328
+ function columnsToHide(columns, avail) {
2329
+ let sum = columns.reduce((a, c) => a + colMin(c), 0);
2330
+ const order = columns.map((c, i) => ({ c, i, p: c.priority == null ? 1 : c.priority })).filter((x) => x.p > 1).sort((a, b) => b.p - a.p || b.i - a.i);
2331
+ const hidden = [];
2332
+ for (const x of order) {
2333
+ if (sum + (hidden.length ? EXPANDER : 0) <= avail) break;
2334
+ hidden.push(x.c.key);
2335
+ sum -= colMin(x.c);
2336
+ }
2337
+ return hidden;
2338
+ }
2235
2339
  var cmp = (a, b) => a == null ? 1 : b == null ? -1 : typeof a === "number" && typeof b === "number" ? a - b : String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
2236
- function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selected, defaultSelected = [], onSelectChange, sort, defaultSort = null, onSortChange, onRowClick, rowActions, stickyHeader = true, maxHeight, state, labels, onRetry, pagination, footer, caption, striped, bare, onCellEdit, skeletonRows = 5, rowClassName, activeKey, className, style, ...rest }) {
2340
+ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selected, defaultSelected = [], onSelectChange, sort, defaultSort = null, onSortChange, onRowClick, rowActions, stickyHeader = true, maxHeight, state, labels, onRetry, pagination, footer, caption, striped, bare, onCellEdit, skeletonRows = 5, rowClassName, activeKey, stickyFirst, onHiddenColumnsChange, className, style, ...rest }) {
2237
2341
  const l = { ...DEFAULT_LABELS20, ...labels };
2238
- const [localSort, setLocalSort] = (0, import_react36.useState)(defaultSort);
2342
+ const [localSort, setLocalSort] = (0, import_react37.useState)(defaultSort);
2239
2343
  const s = sort !== void 0 ? sort : localSort;
2240
- const [localSel, setLocalSel] = (0, import_react36.useState)(defaultSelected);
2344
+ const [localSel, setLocalSel] = (0, import_react37.useState)(defaultSelected);
2241
2345
  const sel = selected !== void 0 ? selected : localSel;
2242
- const [editing, setEditing] = (0, import_react36.useState)(null);
2243
- const [focusIdx, setFocusIdx] = (0, import_react36.useState)(-1);
2244
- const bodyRef = (0, import_react36.useRef)(null);
2245
- const id = (0, import_react36.useMemo)(() => uid("agn-table"), []);
2346
+ const [editing, setEditing] = (0, import_react37.useState)(null);
2347
+ const [focusIdx, setFocusIdx] = (0, import_react37.useState)(-1);
2348
+ const bodyRef = (0, import_react37.useRef)(null);
2349
+ const rootRef = (0, import_react37.useRef)(null);
2350
+ const scrollRef = (0, import_react37.useRef)(null);
2351
+ const id = (0, import_react37.useMemo)(() => uid("agn-table"), []);
2352
+ const prioritized = columns.some((c) => c.priority != null);
2353
+ const width = useElementWidth(prioritized ? rootRef : NO_REF);
2354
+ const [reserved, setReserved] = (0, import_react37.useState)(0);
2355
+ (0, import_react37.useLayoutEffect)(() => {
2356
+ const el = rootRef.current;
2357
+ if (!el) return;
2358
+ const chk = el.querySelector(".agn-table__th--check");
2359
+ if (chk) el.style.setProperty("--agn-table-check-w", chk.offsetWidth + "px");
2360
+ if (!prioritized) return;
2361
+ const act = el.querySelector(".agn-table__th--actions");
2362
+ const n = (chk ? chk.offsetWidth : 0) + (act ? act.offsetWidth : 0);
2363
+ setReserved((p) => p === n ? p : n);
2364
+ });
2365
+ const hiddenKeys = (0, import_react37.useMemo)(() => prioritized && width != null ? columnsToHide(columns, width - 2 - reserved) : [], [prioritized, width, reserved, columns]);
2366
+ const visibleColumns = hiddenKeys.length ? columns.filter((c) => !hiddenKeys.includes(c.key)) : columns;
2367
+ const hiddenColumns = hiddenKeys.length ? columns.filter((c) => hiddenKeys.includes(c.key)) : [];
2368
+ const hiddenSig = hiddenKeys.join("\0");
2369
+ const lastSig = (0, import_react37.useRef)("");
2370
+ const hiddenCb = (0, import_react37.useRef)(onHiddenColumnsChange);
2371
+ hiddenCb.current = onHiddenColumnsChange;
2372
+ (0, import_react37.useEffect)(() => {
2373
+ if (hiddenSig === lastSig.current) return;
2374
+ lastSig.current = hiddenSig;
2375
+ if (hiddenCb.current) hiddenCb.current(hiddenSig ? hiddenSig.split("\0") : []);
2376
+ }, [hiddenSig]);
2377
+ const [expanded, setExpanded] = (0, import_react37.useState)([]);
2378
+ const toggleExpanded = (k, open) => setExpanded((p) => {
2379
+ const has = p.includes(k);
2380
+ const want = open == null ? !has : open;
2381
+ return want === has ? p : want ? [...p, k] : p.filter((x) => x !== k);
2382
+ });
2383
+ (0, import_react37.useEffect)(() => {
2384
+ const el = scrollRef.current;
2385
+ if (!stickyFirst || !el) return void 0;
2386
+ const on = () => el.classList.toggle("agn-table__scroll--scrolled", el.scrollLeft > 0);
2387
+ on();
2388
+ el.addEventListener("scroll", on, { passive: true });
2389
+ return () => {
2390
+ el.removeEventListener("scroll", on);
2391
+ el.classList.remove("agn-table__scroll--scrolled");
2392
+ };
2393
+ }, [stickyFirst]);
2394
+ const stickyKey = stickyFirst && visibleColumns.length ? visibleColumns[0].key : null;
2246
2395
  const keyOf = (r, i) => typeof rowKey === "function" ? rowKey(r, i) : r[rowKey] != null ? r[rowKey] : i;
2247
- const sorted = (0, import_react36.useMemo)(() => {
2396
+ const sorted = (0, import_react37.useMemo)(() => {
2248
2397
  if (!s || !s.key) return rows;
2249
2398
  const col = columns.find((c) => c.key === s.key);
2250
2399
  const get = (r) => col && col.sortValue ? col.sortValue(r) : r[s.key];
@@ -2265,12 +2414,12 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2265
2414
  const someSel = !allSel && allKeys.some((k) => sel.includes(k));
2266
2415
  const toggleAll = () => setSel(allSel ? sel.filter((k) => !allKeys.includes(k)) : Array.from(/* @__PURE__ */ new Set([...sel, ...allKeys])));
2267
2416
  const toggleOne = (k) => setSel(sel.includes(k) ? sel.filter((x) => x !== k) : [...sel, k]);
2268
- const headRef = (0, import_react36.useRef)(null);
2269
- (0, import_react36.useEffect)(() => {
2417
+ const headRef = (0, import_react37.useRef)(null);
2418
+ (0, import_react37.useEffect)(() => {
2270
2419
  if (headRef.current) headRef.current.indeterminate = someSel;
2271
2420
  }, [someSel]);
2272
2421
  const st = state || (rows.length === 0 ? "empty" : "ready");
2273
- const colCount = columns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0);
2422
+ const colCount = visibleColumns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0);
2274
2423
  const focusRow = (i) => {
2275
2424
  const n = Math.max(0, Math.min(sorted.length - 1, i));
2276
2425
  setFocusIdx(n);
@@ -2309,8 +2458,20 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2309
2458
  onRowClick(r, i);
2310
2459
  }
2311
2460
  break;
2461
+ case "ArrowRight":
2462
+ if (hiddenColumns.length) {
2463
+ e.preventDefault();
2464
+ toggleExpanded(keyOf(r, i), true);
2465
+ }
2466
+ break;
2467
+ case "ArrowLeft":
2468
+ if (hiddenColumns.length) {
2469
+ e.preventDefault();
2470
+ toggleExpanded(keyOf(r, i), false);
2471
+ }
2472
+ break;
2312
2473
  case "F2": {
2313
- const c = columns.find((x) => x.editable);
2474
+ const c = visibleColumns.find((x) => x.editable);
2314
2475
  if (c && onCellEdit) {
2315
2476
  e.preventDefault();
2316
2477
  setEditing({ key: keyOf(r, i), col: c.key });
@@ -2327,22 +2488,28 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2327
2488
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: c.label }),
2328
2489
  c.sortable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon, { name: active ? s.dir === "asc" ? "arrow-up" : "arrow-down" : "arrow-up-down", size: 12, className: cx("agn-table__sort", active && "agn-table__sort--active") })
2329
2490
  ] });
2330
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { scope: "col", className: cx("agn-table__th", c.align && "agn-table__th--" + c.align, c.sortable && "agn-table__th--sortable", active && "agn-table__th--sorted"), style: { width: c.width, minWidth: c.minWidth }, "aria-sort": active ? s.dir === "asc" ? "ascending" : "descending" : c.sortable ? "none" : void 0, children: c.sortable ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", className: "agn-table__sort-btn agn-focus-inset", onClick: () => setSort(c), children: [
2491
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { scope: "col", className: cx("agn-table__th", c.key === stickyKey && "agn-table__th--sticky", c.align && "agn-table__th--" + c.align, c.sortable && "agn-table__th--sortable", active && "agn-table__th--sorted"), style: { width: c.width, minWidth: c.minWidth }, "aria-sort": active ? s.dir === "asc" ? "ascending" : "descending" : c.sortable ? "none" : void 0, children: c.sortable ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", className: "agn-table__sort-btn agn-focus-inset", onClick: () => setSort(c), children: [
2331
2492
  inner,
2332
2493
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-sr", children: active ? ", " + (s.dir === "asc" ? l.sortedAsc : l.sortedDesc) : "" })
2333
2494
  ] }) : inner });
2334
2495
  };
2335
- const renderCell = (c, r, ri) => {
2496
+ const cellContent = (c, r, ri) => {
2497
+ const value = r[c.key];
2498
+ return c.render ? c.render(value, r, ri) : value == null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-table__null", children: "\u2014" }) : String(value);
2499
+ };
2500
+ const renderCell = (c, r, ri, ci) => {
2336
2501
  const k = keyOf(r, ri);
2337
2502
  const isEditing = editing && editing.key === k && editing.col === c.key;
2338
2503
  const value = r[c.key];
2339
- const content = c.render ? c.render(value, r, ri) : value == null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-table__null", children: "\u2014" }) : String(value);
2504
+ const content = cellContent(c, r, ri);
2505
+ const lead = ci === 0 && hiddenColumns.length > 0;
2506
+ const open = lead && expanded.includes(k);
2340
2507
  const canEdit = c.editable && onCellEdit;
2341
2508
  const commit = (v) => {
2342
2509
  if (v !== String(value == null ? "" : value)) onCellEdit(r, c.key, v);
2343
2510
  setEditing(null);
2344
2511
  };
2345
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: cx("agn-table__td", c.align && "agn-table__td--" + c.align, c.mono && "agn-table__td--mono", c.ellipsis && "agn-table__td--ellipsis", canEdit && "agn-table__td--editable", isEditing && "agn-table__td--editing", c.className), style: { width: c.width }, onDoubleClick: canEdit ? () => setEditing({ key: k, col: c.key }) : void 0, title: c.ellipsis && typeof content === "string" ? content : void 0, children: isEditing ? (
2512
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: cx("agn-table__td", c.key === stickyKey && "agn-table__td--sticky", c.align && "agn-table__td--" + c.align, c.mono && "agn-table__td--mono", c.ellipsis && "agn-table__td--ellipsis", canEdit && "agn-table__td--editable", isEditing && "agn-table__td--editing", c.className), style: { width: c.width }, onDoubleClick: canEdit ? () => setEditing({ key: k, col: c.key }) : void 0, title: c.ellipsis && typeof content === "string" ? content : void 0, children: isEditing ? (
2346
2513
  // biome-ignore lint/a11y/noAutofocus: the editor mounts only on the user's double-click or Edit press; moving focus into it is the expected response, not a page-load surprise
2347
2514
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { className: "agn-table__input", autoFocus: true, defaultValue: value == null ? "" : value, "aria-label": typeof c.label === "string" ? c.label : void 0, onBlur: (e) => commit(e.target.value), onKeyDown: (e) => {
2348
2515
  if (e.key === "Enter") {
@@ -2356,13 +2523,16 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2356
2523
  e.stopPropagation();
2357
2524
  } })
2358
2525
  ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2359
- content,
2526
+ lead ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "agn-table__lead", children: [
2527
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "agn-table__expand agn-focus-inset", "aria-expanded": open, "aria-controls": open ? id + "-detail-" + ri : void 0, "aria-label": open ? l.collapseRow : l.expandRow, onClick: () => toggleExpanded(k), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon, { name: "chevron-right", size: 14, className: "agn-table__expand-icon" }) }),
2528
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-table__lead-content", children: content })
2529
+ ] }) : content,
2360
2530
  canEdit && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "agn-table__edit agn-focus-inset", "aria-label": l.edit, onClick: () => setEditing({ key: k, col: c.key }), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon, { name: "pencil", size: 12 }) })
2361
2531
  ] }) });
2362
2532
  };
2363
2533
  const header = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("thead", { className: cx("agn-table__head", stickyHeader && "agn-table__head--sticky"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { children: [
2364
2534
  selectable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { scope: "col", className: "agn-table__th agn-table__th--check", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { ref: headRef, type: "checkbox", className: "agn-table__check", checked: allSel, onChange: toggleAll, "aria-label": l.selectAll, disabled: st !== "ready" }) }),
2365
- columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react36.default.Fragment, { children: renderTh(c) }, c.key)),
2535
+ visibleColumns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react37.default.Fragment, { children: renderTh(c) }, c.key)),
2366
2536
  rowActions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { scope: "col", className: "agn-table__th agn-table__th--actions", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-sr", children: l.actions }) })
2367
2537
  ] }) });
2368
2538
  let body;
@@ -2376,7 +2546,7 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2376
2546
  /* biome-ignore lint/a11y/noAriaHiddenOnFocusable: skeleton rows have no tabIndex and no focusable content; the rule treats every tr as focusable */
2377
2547
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { className: "agn-table__row agn-table__row--skeleton", "aria-hidden": "true", children: [
2378
2548
  selectable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "agn-table__td agn-table__td--check", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-table__skeleton agn-table__skeleton--box" }) }),
2379
- columns.map((c, ci) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "agn-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-table__skeleton", style: { width: (ci % 3 === 0 ? 70 : ci % 3 === 1 ? 45 : 55) + "%" } }) }, c.key)),
2549
+ visibleColumns.map((c, ci) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: cx("agn-table__td", c.key === stickyKey && "agn-table__td--sticky"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "agn-table__skeleton", style: { width: (ci % 3 === 0 ? 70 : ci % 3 === 1 ? 45 : 55) + "%" } }) }, c.key)),
2380
2550
  rowActions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "agn-table__td" })
2381
2551
  ] }, i)
2382
2552
  ));
@@ -2389,20 +2559,29 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2389
2559
  const k = keyOf(r, ri);
2390
2560
  const isSel = selectable && sel.includes(k);
2391
2561
  const isActive = activeKey != null && k === activeKey;
2392
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { "data-row-index": ri, tabIndex: ri === (focusIdx < 0 ? 0 : focusIdx) ? 0 : -1, className: cx("agn-table__row", "agn-focus-inset", isSel && "agn-table__row--selected", isActive && "agn-table__row--active", onRowClick && "agn-table__row--clickable", rowClassName && rowClassName(r, ri)), "aria-selected": selectable ? isSel : void 0, "aria-current": isActive ? "true" : void 0, onKeyDown: (e) => onRowKey(e, r, ri), onFocus: () => setFocusIdx(ri), onClick: onRowClick ? (e) => {
2562
+ const open = hiddenColumns.length > 0 && expanded.includes(k);
2563
+ const row = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { "data-row-index": ri, tabIndex: ri === (focusIdx < 0 ? 0 : focusIdx) ? 0 : -1, className: cx("agn-table__row", "agn-focus-inset", isSel && "agn-table__row--selected", isActive && "agn-table__row--active", onRowClick && "agn-table__row--clickable", rowClassName && rowClassName(r, ri)), "aria-selected": selectable ? isSel : void 0, "aria-current": isActive ? "true" : void 0, onKeyDown: (e) => onRowKey(e, r, ri), onFocus: () => setFocusIdx(ri), onClick: onRowClick ? (e) => {
2393
2564
  if (!/^(INPUT|BUTTON|A|SELECT|TEXTAREA)$/.test(e.target.tagName) && !e.target.closest("button,a,input,select,textarea")) onRowClick(r, ri);
2394
2565
  } : void 0, children: [
2395
2566
  selectable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "agn-table__td agn-table__td--check", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { type: "checkbox", className: "agn-table__check", checked: isSel, onChange: () => toggleOne(k), "aria-label": l.selectRow }) }),
2396
- columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react36.default.Fragment, { children: renderCell(c, r, ri) }, c.key)),
2567
+ visibleColumns.map((c, ci) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react37.default.Fragment, { children: renderCell(c, r, ri, ci) }, c.key)),
2397
2568
  rowActions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "agn-table__td agn-table__td--actions", children: rowActions(r, ri) })
2398
2569
  ] }, k);
2570
+ if (!open) return row;
2571
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react37.default.Fragment, { children: [
2572
+ row,
2573
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tr", { id: id + "-detail-" + ri, className: "agn-table__detail", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { colSpan: colCount, className: "agn-table__detail-cell", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("dl", { className: "agn-table__detail-list", style: { maxWidth: width ? Math.max(0, width - 26) : void 0 }, children: hiddenColumns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "agn-table__detail-item", children: [
2574
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("dt", { className: "agn-table__detail-label", children: c.label }),
2575
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("dd", { className: cx("agn-table__detail-value", c.mono && "agn-table__td--mono"), children: cellContent(c, r, ri) })
2576
+ ] }, c.key)) }) }) })
2577
+ ] }, k);
2399
2578
  });
2400
2579
  if (st === "loading" && !skeletonRows) body = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("td", { colSpan: colCount, className: "agn-table__state", children: [
2401
2580
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon, { name: "loader-circle", size: 20, className: "agn-table__spin" }),
2402
2581
  l.loading
2403
2582
  ] }) });
2404
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: cx("agn-table", bare && "agn-table--bare", striped && "agn-table--striped", st !== "ready" && "agn-table--" + st, className), style, ...rest, children: [
2405
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "agn-table__scroll", style: { maxHeight }, "aria-busy": st === "loading" || void 0, "aria-live": st === "loading" ? "polite" : void 0, children: [
2583
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref: rootRef, className: cx("agn-table", bare && "agn-table--bare", striped && "agn-table--striped", stickyFirst && "agn-table--sticky-first", st !== "ready" && "agn-table--" + st, className), style, ...rest, children: [
2584
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref: scrollRef, className: "agn-table__scroll", style: { maxHeight }, "aria-busy": st === "loading" || void 0, "aria-live": st === "loading" ? "polite" : void 0, children: [
2406
2585
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("table", { className: "agn-table__table", id, children: [
2407
2586
  caption && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("caption", { className: "agn-sr", children: caption }),
2408
2587
  header,
@@ -2418,7 +2597,7 @@ function DataTable({ columns = [], rows = [], rowKey = "id", selectable, selecte
2418
2597
  }
2419
2598
 
2420
2599
  // src/data/TreeGrid.jsx
2421
- var import_react37 = __toESM(require("react"), 1);
2600
+ var import_react38 = __toESM(require("react"), 1);
2422
2601
  var import_jsx_runtime36 = require("react/jsx-runtime");
2423
2602
  var DEFAULT_LABELS21 = { expand: "Expand", collapse: "Collapse", empty: "Nothing here yet" };
2424
2603
  function flatten(rows, expanded, depth = 0, out = []) {
@@ -2432,7 +2611,7 @@ function flatten(rows, expanded, depth = 0, out = []) {
2432
2611
  }
2433
2612
  function TreeGrid({ columns = [], rows = [], defaultExpanded, expanded, onExpandChange, onRowClick, selected, stickyHeader = true, maxHeight, labels, indent = 20, bare, className, style, ...rest }) {
2434
2613
  const l = { ...DEFAULT_LABELS21, ...labels };
2435
- const [local, setLocal] = (0, import_react37.useState)(() => new Set(defaultExpanded || rows.filter((r) => r.expanded).map((r) => r.id)));
2614
+ const [local, setLocal] = (0, import_react38.useState)(() => new Set(defaultExpanded || rows.filter((r) => r.expanded).map((r) => r.id)));
2436
2615
  const exp = expanded ? new Set(expanded) : local;
2437
2616
  const setExp = (next) => {
2438
2617
  if (!expanded) setLocal(next);
@@ -2444,8 +2623,8 @@ function TreeGrid({ columns = [], rows = [], defaultExpanded, expanded, onExpand
2444
2623
  setExp(n);
2445
2624
  };
2446
2625
  const flat = flatten(rows, exp);
2447
- const [focus, setFocus] = (0, import_react37.useState)(0);
2448
- const ref = import_react37.default.useRef(null);
2626
+ const [focus, setFocus] = (0, import_react38.useState)(0);
2627
+ const ref = import_react38.default.useRef(null);
2449
2628
  const focusRow = (i) => {
2450
2629
  const n = Math.max(0, Math.min(flat.length - 1, i));
2451
2630
  setFocus(n);
@@ -2532,10 +2711,10 @@ function TreeGrid({ columns = [], rows = [], defaultExpanded, expanded, onExpand
2532
2711
  }
2533
2712
 
2534
2713
  // src/data/Tree.jsx
2535
- var import_react39 = __toESM(require("react"), 1);
2714
+ var import_react40 = __toESM(require("react"), 1);
2536
2715
 
2537
2716
  // src/data/Badge.jsx
2538
- var import_react38 = __toESM(require("react"), 1);
2717
+ var import_react39 = __toESM(require("react"), 1);
2539
2718
  var import_jsx_runtime37 = require("react/jsx-runtime");
2540
2719
  function Badge({ tone = "neutral", count, max = 99, solid, outline, icon, size = "md", children, className, ...rest }) {
2541
2720
  const hasCount = typeof count === "number";
@@ -2568,7 +2747,7 @@ function Tree({ items = [], selected, onSelect, defaultExpanded, expanded, onExp
2568
2747
  });
2569
2748
  return out;
2570
2749
  };
2571
- const [local, setLocal] = (0, import_react39.useState)(() => new Set(defaultExpanded || collect2(items)));
2750
+ const [local, setLocal] = (0, import_react40.useState)(() => new Set(defaultExpanded || collect2(items)));
2572
2751
  const exp = expanded ? new Set(expanded) : local;
2573
2752
  const setExp = (next) => {
2574
2753
  if (!expanded) setLocal(next);
@@ -2580,8 +2759,8 @@ function Tree({ items = [], selected, onSelect, defaultExpanded, expanded, onExp
2580
2759
  setExp(n);
2581
2760
  };
2582
2761
  const flat = flatten2(items, exp);
2583
- const ref = (0, import_react39.useRef)(null);
2584
- const [focus, setFocus] = (0, import_react39.useState)(() => Math.max(0, flat.findIndex((f) => f.node.id === selected)));
2762
+ const ref = (0, import_react40.useRef)(null);
2763
+ const [focus, setFocus] = (0, import_react40.useState)(() => Math.max(0, flat.findIndex((f) => f.node.id === selected)));
2585
2764
  const focusAt = (i) => {
2586
2765
  const n = Math.max(0, Math.min(flat.length - 1, i));
2587
2766
  setFocus(n);
@@ -2670,7 +2849,7 @@ function Tree({ items = [], selected, onSelect, defaultExpanded, expanded, onExp
2670
2849
  }
2671
2850
 
2672
2851
  // src/data/Tile.jsx
2673
- var import_react40 = __toESM(require("react"), 1);
2852
+ var import_react41 = __toESM(require("react"), 1);
2674
2853
  var import_jsx_runtime39 = require("react/jsx-runtime");
2675
2854
  function Tile({ icon, media: media2, title, href, onClick, meta, actions, boxed, selected, as, className, children, ...rest }) {
2676
2855
  const Comp = as || "div";
@@ -2688,7 +2867,7 @@ function Tile({ icon, media: media2, title, href, onClick, meta, actions, boxed,
2688
2867
  }
2689
2868
 
2690
2869
  // src/data/SummaryDetail.jsx
2691
- var import_react41 = __toESM(require("react"), 1);
2870
+ var import_react42 = __toESM(require("react"), 1);
2692
2871
  var import_jsx_runtime40 = require("react/jsx-runtime");
2693
2872
  function SummaryDetail({ fields = [], max, dense, className, ...rest }) {
2694
2873
  const list = max ? fields.slice(0, max) : fields;
@@ -2699,7 +2878,7 @@ function SummaryDetail({ fields = [], max, dense, className, ...rest }) {
2699
2878
  }
2700
2879
 
2701
2880
  // src/data/Avatar.jsx
2702
- var import_react42 = __toESM(require("react"), 1);
2881
+ var import_react43 = __toESM(require("react"), 1);
2703
2882
  var import_jsx_runtime41 = require("react/jsx-runtime");
2704
2883
  var SIZES = { xs: 20, sm: 24, md: 32, lg: 40, xl: 56 };
2705
2884
  var initialsOf = (name) => String(name || "").trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0)).join("").toLocaleUpperCase("tr-TR");
@@ -2741,7 +2920,7 @@ function AvatarGroup({ items = [], max = 4, size = "sm", kind = "person", classN
2741
2920
  }
2742
2921
 
2743
2922
  // src/data/Tag.jsx
2744
- var import_react43 = __toESM(require("react"), 1);
2923
+ var import_react44 = __toESM(require("react"), 1);
2745
2924
  var import_jsx_runtime42 = require("react/jsx-runtime");
2746
2925
  function Tag({ tone = "neutral", dot, icon, as: Comp = "span", children, className, ...rest }) {
2747
2926
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Comp, { className: cx("agn-tag", "agn-tag--" + tone, dot && "agn-tag--dot", className), ...rest, children: [
@@ -2752,7 +2931,7 @@ function Tag({ tone = "neutral", dot, icon, as: Comp = "span", children, classNa
2752
2931
  }
2753
2932
 
2754
2933
  // src/data/BlockIcon.jsx
2755
- var import_react44 = __toESM(require("react"), 1);
2934
+ var import_react45 = __toESM(require("react"), 1);
2756
2935
  var import_jsx_runtime43 = require("react/jsx-runtime");
2757
2936
  function BlockIcon({ icon = "box", product, tone = "signal", color, size = "md", title, children, className, style, ...rest }) {
2758
2937
  const px2 = size === "sm" ? 20 : size === "lg" ? 32 : size === "xl" ? 40 : 24;
@@ -2764,7 +2943,7 @@ function BlockIcon({ icon = "box", product, tone = "signal", color, size = "md",
2764
2943
  }
2765
2944
 
2766
2945
  // src/data/FileCard.jsx
2767
- var import_react45 = __toESM(require("react"), 1);
2946
+ var import_react46 = __toESM(require("react"), 1);
2768
2947
  var import_jsx_runtime44 = require("react/jsx-runtime");
2769
2948
  var TYPE_ICON = { pdf: "file-text", doc: "file-text", docx: "file-text", txt: "file-text", md: "file-text", xls: "file-spreadsheet", xlsx: "file-spreadsheet", csv: "file-spreadsheet", json: "file-json", js: "file-code", ts: "file-code", py: "file-code", png: "image", jpg: "image", jpeg: "image", gif: "image", svg: "image", webp: "image", mp3: "file-audio", wav: "file-audio", ogg: "file-audio", mp4: "file-video", zip: "file-archive", folder: "folder" };
2770
2949
  function FileCard({ name, type, size, modified, preview, variant = "card", selected, onOpen, href, actions, meta, className, ...rest }) {
@@ -2786,7 +2965,7 @@ function FileCard({ name, type, size, modified, preview, variant = "card", selec
2786
2965
  }
2787
2966
 
2788
2967
  // src/data/Feed.jsx
2789
- var import_react46 = __toESM(require("react"), 1);
2968
+ var import_react47 = __toESM(require("react"), 1);
2790
2969
  var import_jsx_runtime45 = require("react/jsx-runtime");
2791
2970
  var DEFAULT_LABELS23 = { reply: "Reply", like: "Like", liked: "Liked", replies: "replies" };
2792
2971
  function Feed({ children, className, ...rest }) {
@@ -2836,13 +3015,13 @@ function FeedPost({ author, avatar, kind = "person", action, target, time, child
2836
3015
  }
2837
3016
 
2838
3017
  // src/data/ActivityTimeline.jsx
2839
- var import_react47 = __toESM(require("react"), 1);
3018
+ var import_react48 = __toESM(require("react"), 1);
2840
3019
  var import_jsx_runtime46 = require("react/jsx-runtime");
2841
3020
  var KIND = { run: "play", step: "circle-dot", approval: "user-check", call: "phone", message: "message-square", note: "sticky-note", agent: "bot", deploy: "rocket", edit: "pencil", error: "circle-alert", success: "circle-check", warn: "triangle-alert", handoff: "arrow-right-left", email: "mail", event: "circle" };
2842
3021
  var DEFAULT_LABELS24 = { show: "Show details", hide: "Hide details" };
2843
3022
  function ActivityTimeline({ items = [], compact, labels, className, ...rest }) {
2844
3023
  const l = { ...DEFAULT_LABELS24, ...labels };
2845
- const [open, setOpen] = (0, import_react47.useState)(() => new Set(items.filter((i) => i.open).map((i, idx) => i.id || idx)));
3024
+ const [open, setOpen] = (0, import_react48.useState)(() => new Set(items.filter((i) => i.open).map((i, idx) => i.id || idx)));
2846
3025
  let lastGroup = null;
2847
3026
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ol", { className: cx("agn-timeline", compact && "agn-timeline--compact", className), ...rest, children: items.map((it, i) => {
2848
3027
  const key = it.id || i;
@@ -2850,7 +3029,7 @@ function ActivityTimeline({ items = [], compact, labels, className, ...rest }) {
2850
3029
  const head = it.group && it.group !== lastGroup ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { className: "agn-timeline__group", "aria-hidden": "true", children: it.group }, "g" + key) : null;
2851
3030
  lastGroup = it.group || lastGroup;
2852
3031
  const isOpen = open.has(key);
2853
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react47.default.Fragment, { children: [
3032
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react48.default.Fragment, { children: [
2854
3033
  head,
2855
3034
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("li", { className: cx("agn-timeline__item", "agn-timeline__item--" + tone, it.current && "agn-timeline__item--current", it.done === false && "agn-timeline__item--pending"), children: [
2856
3035
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "agn-timeline__marker", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { name: it.icon || KIND[it.kind] || "circle", size: compact ? 12 : 14 }) }),
@@ -2878,7 +3057,7 @@ function ActivityTimeline({ items = [], compact, labels, className, ...rest }) {
2878
3057
  }
2879
3058
 
2880
3059
  // src/data/Illustration.jsx
2881
- var import_react48 = __toESM(require("react"), 1);
3060
+ var import_react49 = __toESM(require("react"), 1);
2882
3061
  var import_jsx_runtime47 = require("react/jsx-runtime");
2883
3062
  var SCENES = {
2884
3063
  empty: { icon: "inbox", cards: [[10, 58, 58, 32], [96, 14, 54, 30]], dots: [[1, 16, 22], [2, 84, 70], [3, 74, 12]] },
@@ -2914,7 +3093,7 @@ function Illustration({ scene = "empty", icon, product, title, message, action,
2914
3093
  }
2915
3094
 
2916
3095
  // src/data/Stat.jsx
2917
- var import_react49 = __toESM(require("react"), 1);
3096
+ var import_react50 = __toESM(require("react"), 1);
2918
3097
  var import_jsx_runtime48 = require("react/jsx-runtime");
2919
3098
  function Stat({ value, label, delta, invert, sub, icon, size = "md", chart, locale, as: Comp = "div", className, ...rest }) {
2920
3099
  let d = null;
@@ -2947,7 +3126,7 @@ function Stat({ value, label, delta, invert, sub, icon, size = "md", chart, loca
2947
3126
  }
2948
3127
 
2949
3128
  // src/data/MiniChart.jsx
2950
- var import_react50 = __toESM(require("react"), 1);
3129
+ var import_react51 = __toESM(require("react"), 1);
2951
3130
  var import_jsx_runtime49 = require("react/jsx-runtime");
2952
3131
  var COLORS = ["var(--data-1)", "var(--data-2)", "var(--data-3)", "var(--data-4)", "var(--data-5)", "var(--data-6)"];
2953
3132
  var PAD = { t: 6, r: 6, b: 18, l: 6 };
@@ -2963,8 +3142,8 @@ function path(vals, x, y, close, h) {
2963
3142
  return close ? d + " L" + pts[pts.length - 1][0].toFixed(1) + " " + h + " L" + pts[0][0].toFixed(1) + " " + h + " Z" : d;
2964
3143
  }
2965
3144
  function useWidth(ref, fallback) {
2966
- const [w, setW] = import_react50.default.useState(null);
2967
- import_react50.default.useEffect(() => {
3145
+ const [w, setW] = import_react51.default.useState(null);
3146
+ import_react51.default.useEffect(() => {
2968
3147
  const el = ref.current;
2969
3148
  if (!el || typeof ResizeObserver === "undefined") return void 0;
2970
3149
  const ro = new ResizeObserver((es) => {
@@ -2984,11 +3163,11 @@ function MiniChart({ type = "line", data, series, labels = [], height = 120, wid
2984
3163
  const ref = reference == null ? null : typeof reference === "number" ? { value: reference } : reference;
2985
3164
  const extra = [ref && ref.value, band && band.from, band && band.to].filter((v) => typeof v === "number");
2986
3165
  const { hi, lo } = scale((stack ? cum.map((values) => ({ values })) : ser).concat(extra.length ? [{ values: extra }] : []), max, min);
2987
- const figRef = import_react50.default.useRef(null);
3166
+ const figRef = import_react51.default.useRef(null);
2988
3167
  const W = useWidth(figRef, width), H = height, iw = Math.max(W - PAD.l - PAD.r, 1), ih = H - PAD.t - PAD.b;
2989
3168
  const y = (v) => PAD.t + ih - (v - lo) / (hi - lo) * ih;
2990
3169
  const x = (i) => PAD.l + (n === 1 ? iw / 2 : i / (n - 1) * iw);
2991
- const id = import_react50.default.useMemo(() => uid("agn-chart"), []);
3170
+ const id = import_react51.default.useMemo(() => uid("agn-chart"), []);
2992
3171
  const ticks2 = [lo, (lo + hi) / 2, hi];
2993
3172
  const desc = ser.map((s) => (s.name ? s.name + ": " : "") + s.values.map(format).join(", ")).join("; ");
2994
3173
  let marks;
@@ -3068,13 +3247,13 @@ function Sparkline({ data = [], width = 96, height = 24, area, color = 1, tone,
3068
3247
  }
3069
3248
 
3070
3249
  // src/data/Kanban.jsx
3071
- var import_react51 = __toESM(require("react"), 1);
3250
+ var import_react52 = __toESM(require("react"), 1);
3072
3251
  var import_jsx_runtime50 = require("react/jsx-runtime");
3073
3252
  var DEFAULT_LABELS25 = { add: "Add", limit: "limit", empty: "No cards", moveTo: "Move to" };
3074
3253
  function Kanban({ columns = [], cards = [], onMove, onCardClick, onAdd, renderCard, labels, className, style, ...rest }) {
3075
3254
  const l = { ...DEFAULT_LABELS25, ...labels };
3076
- const [drag, setDrag] = (0, import_react51.useState)(null);
3077
- const [over, setOver] = (0, import_react51.useState)(null);
3255
+ const [drag, setDrag] = (0, import_react52.useState)(null);
3256
+ const [over, setOver] = (0, import_react52.useState)(null);
3078
3257
  const byCol = (id) => cards.filter((c) => c.column === id);
3079
3258
  const move = (card, dir) => {
3080
3259
  const i = columns.findIndex((c) => c.id === card.column);
@@ -3194,7 +3373,7 @@ function Kanban({ columns = [], cards = [], onMove, onCardClick, onAdd, renderCa
3194
3373
  }
3195
3374
 
3196
3375
  // src/data/CalendarView.jsx
3197
- var import_react52 = __toESM(require("react"), 1);
3376
+ var import_react53 = __toESM(require("react"), 1);
3198
3377
  var import_jsx_runtime51 = require("react/jsx-runtime");
3199
3378
  var DEFAULT_LABELS26 = { more: "more", today: "Today", prev: "Previous month", next: "Next month" };
3200
3379
  var toDate = (d) => d instanceof Date ? d : new Date(d);
@@ -3274,7 +3453,7 @@ function CalendarView({ month, events = [], locale = "en", weekStartsOn = 1, tod
3274
3453
  }
3275
3454
 
3276
3455
  // src/data/Gantt.jsx
3277
- var import_react53 = __toESM(require("react"), 1);
3456
+ var import_react54 = __toESM(require("react"), 1);
3278
3457
  var import_jsx_runtime52 = require("react/jsx-runtime");
3279
3458
  var DAY = 864e5;
3280
3459
  var toDate2 = (d) => d instanceof Date ? d : new Date(d);
@@ -3340,7 +3519,7 @@ function Gantt({ tasks = [], start, end, unit = "day", colWidth, today = /* @__P
3340
3519
  }
3341
3520
 
3342
3521
  // src/data/DescriptionList.jsx
3343
- var import_react54 = __toESM(require("react"), 1);
3522
+ var import_react55 = __toESM(require("react"), 1);
3344
3523
  var import_jsx_runtime53 = require("react/jsx-runtime");
3345
3524
  function DescriptionList({ items = [], columns = 1, horizontal, labelWidth, className, style, ...rest }) {
3346
3525
  const list = items.map((it) => Array.isArray(it) ? { label: it[0], value: it[1] } : it);
@@ -3351,7 +3530,7 @@ function DescriptionList({ items = [], columns = 1, horizontal, labelWidth, clas
3351
3530
  }
3352
3531
 
3353
3532
  // src/data/Amount.jsx
3354
- var import_react55 = __toESM(require("react"), 1);
3533
+ var import_react56 = __toESM(require("react"), 1);
3355
3534
  var import_jsx_runtime54 = require("react/jsx-runtime");
3356
3535
  function formatAmount(value, { currency = "TRY", locale = "tr-TR", decimals = 2, style } = {}) {
3357
3536
  const n = Number(value);
@@ -3385,7 +3564,7 @@ function Amount({ value, currency = "TRY", locale = "tr-TR", decimals = 2, signe
3385
3564
  }
3386
3565
 
3387
3566
  // src/data/CodeBlock.jsx
3388
- var import_react56 = __toESM(require("react"), 1);
3567
+ var import_react57 = __toESM(require("react"), 1);
3389
3568
  var import_jsx_runtime55 = require("react/jsx-runtime");
3390
3569
  var DEFAULT_LABELS27 = { copy: "Copy", copied: "Copied", wrap: "Wrap lines", unwrap: "Unwrap lines" };
3391
3570
  var KW = { js: /^(const|let|var|function|return|if|else|for|while|import|export|from|default|new|await|async|class|extends|try|catch|throw|typeof|null|undefined|true|false|this)$/, bash: /^(if|then|else|fi|for|do|done|in|case|esac|function|export|echo|cd|ls|cat|grep|curl|docker|git|npm|pnpm|npx|node|python3?|sudo|set|while|return|exit)$/, json: /^(true|false|null)$/ };
@@ -3455,8 +3634,8 @@ function tokenize(line, lang) {
3455
3634
  }
3456
3635
  function CodeBlock({ code = "", language = "text", title, lineNumbers = true, copy = true, wrap: wrapProp, wrapToggle = true, maxHeight, highlight = [], startLine = 1, labels, className, ...rest }) {
3457
3636
  const l = { ...DEFAULT_LABELS27, ...labels };
3458
- const [wrap, setWrap] = (0, import_react56.useState)(!!wrapProp);
3459
- const [copied, setCopied] = (0, import_react56.useState)(false);
3637
+ const [wrap, setWrap] = (0, import_react57.useState)(!!wrapProp);
3638
+ const [copied, setCopied] = (0, import_react57.useState)(false);
3460
3639
  const lines = String(code).replace(/\n$/, "").split("\n");
3461
3640
  const lang = ["json", "bash", "js", "sh", "javascript", "typescript", "ts"].includes(language) ? { sh: "bash", javascript: "js", typescript: "js", ts: "js" }[language] || language : null;
3462
3641
  const doCopy = () => {
@@ -3491,7 +3670,7 @@ function CodeBlock({ code = "", language = "text", title, lineNumbers = true, co
3491
3670
  }
3492
3671
 
3493
3672
  // src/data/JsonTree.jsx
3494
- var import_react57 = __toESM(require("react"), 1);
3673
+ var import_react58 = __toESM(require("react"), 1);
3495
3674
  var import_jsx_runtime56 = require("react/jsx-runtime");
3496
3675
  var DEFAULT_LABELS28 = { items: "items", keys: "keys", expand: "Expand", collapse: "Collapse", copy: "Copy", copied: "Copied" };
3497
3676
  var isObj = (v) => v !== null && typeof v === "object";
@@ -3541,8 +3720,8 @@ function collect(value, depth, maxDepth, path2, out) {
3541
3720
  }
3542
3721
  function JsonTree({ data, defaultDepth = 2, title, copy = true, maxHeight, labels, className, ...rest }) {
3543
3722
  const l = { ...DEFAULT_LABELS28, ...labels };
3544
- const [open, setOpen] = (0, import_react57.useState)(() => collect(data, 1, defaultDepth, "$", /* @__PURE__ */ new Set()));
3545
- const [copied, setCopied] = (0, import_react57.useState)(false);
3723
+ const [open, setOpen] = (0, import_react58.useState)(() => collect(data, 1, defaultDepth, "$", /* @__PURE__ */ new Set()));
3724
+ const [copied, setCopied] = (0, import_react58.useState)(false);
3546
3725
  const toggle = (p) => {
3547
3726
  const n = new Set(open);
3548
3727
  n.has(p) ? n.delete(p) : n.add(p);
@@ -3570,7 +3749,7 @@ function JsonTree({ data, defaultDepth = 2, title, copy = true, maxHeight, label
3570
3749
  }
3571
3750
 
3572
3751
  // src/data/DiffView.jsx
3573
- var import_react58 = __toESM(require("react"), 1);
3752
+ var import_react59 = __toESM(require("react"), 1);
3574
3753
  var import_jsx_runtime57 = require("react/jsx-runtime");
3575
3754
  var DEFAULT_LABELS29 = { added: "added", removed: "removed", before: "Before", after: "After", unchanged: "unchanged lines" };
3576
3755
  function diffLines(before = "", after = "") {
@@ -3792,7 +3971,7 @@ function DiffView({ before, after, lines, mode = "unified", title, context = 3,
3792
3971
  }
3793
3972
 
3794
3973
  // src/data/Heatmap.jsx
3795
- var import_react59 = __toESM(require("react"), 1);
3974
+ var import_react60 = __toESM(require("react"), 1);
3796
3975
  var import_jsx_runtime58 = require("react/jsx-runtime");
3797
3976
  var STEPS = {
3798
3977
  ok: ["var(--ok-100)", "var(--ok-200)", "var(--ok-400)", "var(--ok-600)"],
@@ -3899,7 +4078,7 @@ function Heatmap({ rows = [], columns = [], values = [], thresholds, scale: scal
3899
4078
  }
3900
4079
 
3901
4080
  // src/layout/Card.jsx
3902
- var import_react60 = __toESM(require("react"), 1);
4081
+ var import_react61 = __toESM(require("react"), 1);
3903
4082
  var import_jsx_runtime59 = require("react/jsx-runtime");
3904
4083
  var DEFAULT_LABELS30 = { viewAll: "View all" };
3905
4084
  function Card({ title, icon, count, actions, footer, viewAll, viewAllHref, padding = "md", sunken, interactive, selected, labels, as: Comp = "section", children, className, ...rest }) {
@@ -3919,7 +4098,7 @@ function Card({ title, icon, count, actions, footer, viewAll, viewAllHref, paddi
3919
4098
  }
3920
4099
 
3921
4100
  // src/layout/Toolbar.jsx
3922
- var import_react61 = __toESM(require("react"), 1);
4101
+ var import_react62 = __toESM(require("react"), 1);
3923
4102
  var import_jsx_runtime60 = require("react/jsx-runtime");
3924
4103
  var DEFAULT_LABELS31 = { search: "Search", clear: "Clear search" };
3925
4104
  function Toolbar({ title, count, search, left, right, sticky, bare, labels, children, className, ...rest }) {
@@ -3951,88 +4130,6 @@ var import_react64 = __toESM(require("react"), 1);
3951
4130
 
3952
4131
  // src/feedback/SidePanel.jsx
3953
4132
  var import_react63 = __toESM(require("react"), 1);
3954
-
3955
- // src/layout/responsive.js
3956
- var import_react62 = __toESM(require("react"), 1);
3957
- var BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280, "2xl": 1536 };
3958
- var BREAKPOINT_ORDER = ["base", "sm", "md", "lg", "xl", "2xl"];
3959
- function breakpointFor(width) {
3960
- let name = "base";
3961
- for (const k of BREAKPOINT_ORDER.slice(1)) if (width >= BREAKPOINTS[k]) name = k;
3962
- return name;
3963
- }
3964
- function toPx(bp) {
3965
- return typeof bp === "number" ? bp : BREAKPOINTS[bp] != null ? BREAKPOINTS[bp] : 0;
3966
- }
3967
- function atLeast(a, b) {
3968
- return BREAKPOINT_ORDER.indexOf(a) >= BREAKPOINT_ORDER.indexOf(b);
3969
- }
3970
- var useIsoLayoutEffect = typeof window !== "undefined" ? import_react62.default.useLayoutEffect : import_react62.default.useEffect;
3971
- function useElementWidth(ref) {
3972
- const [w, setW] = import_react62.default.useState(null);
3973
- useIsoLayoutEffect(() => {
3974
- const el = ref.current;
3975
- if (!el) return void 0;
3976
- const read2 = () => {
3977
- const n = el.offsetWidth;
3978
- setW((p) => p === n ? p : n);
3979
- };
3980
- read2();
3981
- if (typeof ResizeObserver === "undefined") return void 0;
3982
- const ro = new ResizeObserver(read2);
3983
- ro.observe(el);
3984
- return () => ro.disconnect();
3985
- }, [ref]);
3986
- return w;
3987
- }
3988
- function useBreakpoint(ref) {
3989
- const w = useElementWidth(ref);
3990
- return w == null ? null : breakpointFor(w);
3991
- }
3992
- var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]';
3993
- function useOverlayFocus(ref, open, onClose) {
3994
- const closeRef = import_react62.default.useRef(onClose);
3995
- closeRef.current = onClose;
3996
- import_react62.default.useEffect(() => {
3997
- if (!open) return void 0;
3998
- const el = ref.current;
3999
- if (!el) return void 0;
4000
- const prev = typeof document !== "undefined" ? document.activeElement : null;
4001
- if (!el.contains(document.activeElement)) el.focus({ preventScroll: true });
4002
- const onKey = (e) => {
4003
- if (e.key === "Escape") {
4004
- if (closeRef.current) {
4005
- e.stopPropagation();
4006
- closeRef.current();
4007
- }
4008
- return;
4009
- }
4010
- if (e.key !== "Tab" || !el.contains(document.activeElement)) return;
4011
- const f = Array.from(el.querySelectorAll(FOCUSABLE)).filter((n) => n.offsetParent !== null || n === document.activeElement);
4012
- if (!f.length) {
4013
- e.preventDefault();
4014
- el.focus({ preventScroll: true });
4015
- return;
4016
- }
4017
- const first = f[0], last = f[f.length - 1];
4018
- if (e.shiftKey && (document.activeElement === first || document.activeElement === el)) {
4019
- e.preventDefault();
4020
- last.focus();
4021
- } else if (!e.shiftKey && document.activeElement === last) {
4022
- e.preventDefault();
4023
- first.focus();
4024
- }
4025
- };
4026
- el.addEventListener("keydown", onKey);
4027
- return () => {
4028
- el.removeEventListener("keydown", onKey);
4029
- const a = document.activeElement;
4030
- if (prev && prev.focus && document.contains(prev) && (!a || a === document.body || el.contains(a))) prev.focus({ preventScroll: true });
4031
- };
4032
- }, [open, ref]);
4033
- }
4034
-
4035
- // src/feedback/SidePanel.jsx
4036
4133
  var import_jsx_runtime61 = require("react/jsx-runtime");
4037
4134
  function SidePanel({ open = true, onClose, title, eyebrow, subtitle, tabs, actions, footer, size = "md", width, mode = "overlay", scrim = true, children, labels, className, style, ...rest }) {
4038
4135
  const L = { close: "Close", ...labels };
@@ -5221,131 +5318,235 @@ function Stepper({ steps = [], current = 0, vertical, size = "md", errorSteps =
5221
5318
  }) });
5222
5319
  }
5223
5320
 
5224
- // src/feedback/AginiesLoader.jsx
5225
- var import_react86 = __toESM(require("react"), 1);
5226
- var import_jsx_runtime84 = (
5227
- // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
5228
- require("react/jsx-runtime")
5229
- );
5230
- var SIZE = { page: 96, region: 40, inline: 16 };
5231
- function AginiesLoader({ tier = "region", variant = "orbit", label, showLabel, labels, className, ...rest }) {
5232
- const L = { loading: "Loading", ...labels };
5233
- const text = label || L.loading;
5234
- const Tag2 = tier === "inline" ? "span" : "div";
5235
- const visible = showLabel != null ? showLabel : tier === "page";
5236
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Tag2, { className: cx("agn-loader", "agn-loader--" + tier, "agn-loader--" + variant, className), role: "status", "aria-busy": "true", "aria-live": "polite", ...rest, children: [
5237
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "agn-loader__mark", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(AginiesMark, { size: SIZE[tier] || SIZE.region, decorative: true }) }),
5238
- tier === "page" && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "agn-loader__word", children: "Aginies" }),
5239
- visible ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "agn-loader__label", children: text }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "agn-sr", children: text })
5240
- ] });
5241
- }
5242
-
5243
- // src/feedback/Skeleton.jsx
5321
+ // src/navigation/ActivityBar.jsx
5244
5322
  var import_react87 = __toESM(require("react"), 1);
5245
- var import_jsx_runtime85 = require("react/jsx-runtime");
5246
- var WIDTHS2 = ["72%", "48%", "60%", "36%", "82%", "54%"];
5247
- function Skeleton({ shape = "text", lines = 3, width, height, className, style, ...rest }) {
5248
- if (shape === "text") {
5249
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: cx("agn-skeleton-text", className), style: { width, ...style }, "aria-hidden": "true", ...rest, children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "agn-skeleton agn-skeleton--line", style: lines > 1 && i === lines - 1 ? { width: "62%" } : void 0 }, i)) });
5250
- }
5251
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: cx("agn-skeleton", "agn-skeleton--" + shape, className), style: { width, height, ...style }, "aria-hidden": "true", ...rest });
5252
- }
5253
- function PageSkeleton({ header = true, rows = 6, columns = 4, labels, className, ...rest }) {
5254
- const L = { loading: "Loading page", ...labels };
5255
- const cols = Array.from({ length: columns }, (_, i) => i);
5256
- const grid = { gridTemplateColumns: cols.map((i) => i === 0 ? "2fr" : "1fr").join(" ") };
5257
- return (
5258
- // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
5259
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: cx("agn-page-skeleton", className), role: "status", "aria-busy": "true", ...rest, children: [
5260
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "agn-sr", children: L.loading }),
5261
- header && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "agn-page-skeleton__header", "aria-hidden": "true", children: [
5262
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { children: [
5263
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Skeleton, { shape: "line", width: 88, height: 8 }),
5264
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Skeleton, { shape: "rect", width: 236, height: 22, style: { marginTop: 10 } })
5265
- ] }),
5266
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Skeleton, { shape: "rect", width: 108, height: "var(--control-h)" })
5267
- ] }),
5268
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "agn-page-skeleton__table", "aria-hidden": "true", children: [
5269
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "agn-page-skeleton__row agn-page-skeleton__row--head", style: grid, children: cols.map((c) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Skeleton, { shape: "line", width: "46%", height: 8 }, c)) }),
5270
- Array.from({ length: rows }, (_, r) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "agn-page-skeleton__row", style: grid, children: cols.map((c) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Skeleton, { shape: "line", width: WIDTHS2[(r + c) % WIDTHS2.length] }, c)) }, r))
5323
+
5324
+ // src/feedback/Tooltip.jsx
5325
+ var import_react86 = __toESM(require("react"), 1);
5326
+ var import_jsx_runtime84 = require("react/jsx-runtime");
5327
+ function Tooltip({ content, kbd, placement = "top", delay = 400, open: openProp, children, className, ...rest }) {
5328
+ const [own, setOwn] = import_react86.default.useState(false);
5329
+ const open = openProp != null ? openProp : own;
5330
+ const timer = import_react86.default.useRef(null);
5331
+ const id = import_react86.default.useMemo(() => uid("tip"), []);
5332
+ const show2 = () => {
5333
+ clearTimeout(timer.current);
5334
+ timer.current = setTimeout(() => setOwn(true), delay);
5335
+ };
5336
+ const hide = () => {
5337
+ clearTimeout(timer.current);
5338
+ setOwn(false);
5339
+ };
5340
+ import_react86.default.useEffect(() => () => clearTimeout(timer.current), []);
5341
+ import_react86.default.useEffect(() => {
5342
+ if (!open) return;
5343
+ const k = (e) => e.key === "Escape" && hide();
5344
+ document.addEventListener("keydown", k);
5345
+ return () => document.removeEventListener("keydown", k);
5346
+ }, [open]);
5347
+ const child = import_react86.default.Children.only(children);
5348
+ return (
5349
+ // biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only listens: hover and focus bubble up from the focusable trigger it wraps; it is not itself operable
5350
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: cx("agn-tip-wrap", className), onMouseEnter: show2, onMouseLeave: hide, onFocus: show2, onBlur: hide, ...rest, children: [
5351
+ import_react86.default.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] }),
5352
+ open && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { role: "tooltip", id, className: cx("agn-tip", "agn-tip--" + placement), children: [
5353
+ content,
5354
+ kbd && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("kbd", { className: "agn-tip__kbd", children: kbd })
5271
5355
  ] })
5272
5356
  ] })
5273
5357
  );
5274
5358
  }
5275
5359
 
5276
- // src/feedback/Alert.jsx
5360
+ // src/navigation/ActivityBar.jsx
5361
+ var import_jsx_runtime85 = require("react/jsx-runtime");
5362
+ var DEFAULT_LABELS50 = { navigation: "Views" };
5363
+ function ActivityBar({ items = [], footerItems = [], active, onSelect, side = "left", labels, className, ...rest }) {
5364
+ const l = { ...DEFAULT_LABELS50, ...labels };
5365
+ const all = [...items, ...footerItems];
5366
+ const enabled = all.filter((it) => !it.disabled);
5367
+ const activeEnabled = enabled.some((it) => it.id === active);
5368
+ const [focusId, setFocusId] = import_react87.default.useState(null);
5369
+ const stop = focusId != null && enabled.some((it) => it.id === focusId) ? focusId : activeEnabled ? active : enabled[0] && enabled[0].id;
5370
+ const refs = import_react87.default.useRef({});
5371
+ const move = (id) => {
5372
+ setFocusId(id);
5373
+ const el = refs.current[id];
5374
+ if (el) el.focus();
5375
+ };
5376
+ const onKey = (e, id) => {
5377
+ const i = enabled.findIndex((it) => it.id === id);
5378
+ if (i < 0) return;
5379
+ let next = null;
5380
+ if (e.key === "ArrowDown") next = enabled[(i + 1) % enabled.length];
5381
+ else if (e.key === "ArrowUp") next = enabled[(i - 1 + enabled.length) % enabled.length];
5382
+ else if (e.key === "Home") next = enabled[0];
5383
+ else if (e.key === "End") next = enabled[enabled.length - 1];
5384
+ if (next) {
5385
+ e.preventDefault();
5386
+ move(next.id);
5387
+ }
5388
+ };
5389
+ const renderItem = (it) => {
5390
+ const sel = it.id === active;
5391
+ const glyph = typeof it.icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon, { name: it.icon, size: 20, strokeWidth: sel ? 2 : 1.75 }) : it.icon;
5392
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Tooltip, { content: it.label, placement: side === "right" ? "left" : "right", className: "agn-activitybar__tip", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
5393
+ "button",
5394
+ {
5395
+ ref: (el) => {
5396
+ refs.current[it.id] = el;
5397
+ },
5398
+ type: "button",
5399
+ role: "tab",
5400
+ id: it.tabId,
5401
+ className: cx("agn-activitybar__item", "agn-focus-inset", sel && "agn-activitybar__item--active"),
5402
+ "aria-selected": sel,
5403
+ "aria-controls": it.controls,
5404
+ "aria-label": it.badge != null && it.badge !== "" ? it.label + " (" + it.badge + ")" : it.label,
5405
+ disabled: it.disabled,
5406
+ tabIndex: it.id === stop ? 0 : -1,
5407
+ onFocus: () => setFocusId(it.id),
5408
+ onKeyDown: (e) => onKey(e, it.id),
5409
+ onClick: () => {
5410
+ if (!it.disabled && onSelect) onSelect(it.id, it);
5411
+ },
5412
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "agn-activitybar__glyph", children: [
5413
+ glyph,
5414
+ it.badge != null && it.badge !== "" && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Badge, { tone: "signal", solid: true, size: "sm", count: typeof it.badge === "number" ? it.badge : void 0, className: "agn-activitybar__badge", "aria-hidden": "true", children: typeof it.badge === "number" ? void 0 : it.badge })
5415
+ ] })
5416
+ }
5417
+ ) }, it.id);
5418
+ };
5419
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { role: "tablist", "aria-orientation": "vertical", "aria-label": l.navigation, className: cx("agn-activitybar", side === "right" && "agn-activitybar--right", className), ...rest, children: [
5420
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { role: "presentation", className: "agn-activitybar__group", children: items.map(renderItem) }),
5421
+ footerItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { role: "presentation", className: "agn-activitybar__group agn-activitybar__group--footer", children: footerItems.map(renderItem) })
5422
+ ] });
5423
+ }
5424
+
5425
+ // src/feedback/AginiesLoader.jsx
5277
5426
  var import_react88 = __toESM(require("react"), 1);
5278
- var import_jsx_runtime86 = require("react/jsx-runtime");
5427
+ var import_jsx_runtime86 = (
5428
+ // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
5429
+ require("react/jsx-runtime")
5430
+ );
5431
+ var SIZE = { page: 96, region: 40, inline: 16 };
5432
+ function AginiesLoader({ tier = "region", variant = "orbit", label, showLabel, labels, className, ...rest }) {
5433
+ const L = { loading: "Loading", ...labels };
5434
+ const text = label || L.loading;
5435
+ const Tag2 = tier === "inline" ? "span" : "div";
5436
+ const visible = showLabel != null ? showLabel : tier === "page";
5437
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(Tag2, { className: cx("agn-loader", "agn-loader--" + tier, "agn-loader--" + variant, className), role: "status", "aria-busy": "true", "aria-live": "polite", ...rest, children: [
5438
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "agn-loader__mark", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(AginiesMark, { size: SIZE[tier] || SIZE.region, decorative: true }) }),
5439
+ tier === "page" && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "agn-loader__word", children: "Aginies" }),
5440
+ visible ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "agn-loader__label", children: text }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "agn-sr", children: text })
5441
+ ] });
5442
+ }
5443
+
5444
+ // src/feedback/Skeleton.jsx
5445
+ var import_react89 = __toESM(require("react"), 1);
5446
+ var import_jsx_runtime87 = require("react/jsx-runtime");
5447
+ var WIDTHS2 = ["72%", "48%", "60%", "36%", "82%", "54%"];
5448
+ function Skeleton({ shape = "text", lines = 3, width, height, className, style, ...rest }) {
5449
+ if (shape === "text") {
5450
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: cx("agn-skeleton-text", className), style: { width, ...style }, "aria-hidden": "true", ...rest, children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "agn-skeleton agn-skeleton--line", style: lines > 1 && i === lines - 1 ? { width: "62%" } : void 0 }, i)) });
5451
+ }
5452
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: cx("agn-skeleton", "agn-skeleton--" + shape, className), style: { width, height, ...style }, "aria-hidden": "true", ...rest });
5453
+ }
5454
+ function PageSkeleton({ header = true, rows = 6, columns = 4, labels, className, ...rest }) {
5455
+ const L = { loading: "Loading page", ...labels };
5456
+ const cols = Array.from({ length: columns }, (_, i) => i);
5457
+ const grid = { gridTemplateColumns: cols.map((i) => i === 0 ? "2fr" : "1fr").join(" ") };
5458
+ return (
5459
+ // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
5460
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: cx("agn-page-skeleton", className), role: "status", "aria-busy": "true", ...rest, children: [
5461
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "agn-sr", children: L.loading }),
5462
+ header && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "agn-page-skeleton__header", "aria-hidden": "true", children: [
5463
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { children: [
5464
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Skeleton, { shape: "line", width: 88, height: 8 }),
5465
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Skeleton, { shape: "rect", width: 236, height: 22, style: { marginTop: 10 } })
5466
+ ] }),
5467
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Skeleton, { shape: "rect", width: 108, height: "var(--control-h)" })
5468
+ ] }),
5469
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "agn-page-skeleton__table", "aria-hidden": "true", children: [
5470
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "agn-page-skeleton__row agn-page-skeleton__row--head", style: grid, children: cols.map((c) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Skeleton, { shape: "line", width: "46%", height: 8 }, c)) }),
5471
+ Array.from({ length: rows }, (_, r) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "agn-page-skeleton__row", style: grid, children: cols.map((c) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Skeleton, { shape: "line", width: WIDTHS2[(r + c) % WIDTHS2.length] }, c)) }, r))
5472
+ ] })
5473
+ ] })
5474
+ );
5475
+ }
5476
+
5477
+ // src/feedback/Alert.jsx
5478
+ var import_react90 = __toESM(require("react"), 1);
5479
+ var import_jsx_runtime88 = require("react/jsx-runtime");
5279
5480
  var TONE_ICON = { info: "info", ok: "circle-check", warn: "triangle-alert", bad: "circle-alert", neutral: "info", signal: "info" };
5280
5481
  function Alert({ tone = "info", icon, title, children, actions, onDismiss, labels, className, ...rest }) {
5281
5482
  const L = { dismiss: "Dismiss", ...labels };
5282
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: cx("agn-alert", "agn-alert--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
5283
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Icon, { name: icon || TONE_ICON[tone] || "info", size: 16, className: "agn-alert__icon" }),
5284
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "agn-alert__body", children: [
5285
- title && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "agn-alert__title", children: title }),
5286
- children != null && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "agn-alert__text", children }),
5287
- actions && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "agn-alert__actions", children: actions })
5483
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: cx("agn-alert", "agn-alert--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
5484
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Icon, { name: icon || TONE_ICON[tone] || "info", size: 16, className: "agn-alert__icon" }),
5485
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "agn-alert__body", children: [
5486
+ title && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "agn-alert__title", children: title }),
5487
+ children != null && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "agn-alert__text", children }),
5488
+ actions && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "agn-alert__actions", children: actions })
5288
5489
  ] }),
5289
- onDismiss && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ButtonIcon, { icon: "x", label: L.dismiss, size: "xs", onClick: onDismiss, className: "agn-alert__close" })
5490
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ButtonIcon, { icon: "x", label: L.dismiss, size: "xs", onClick: onDismiss, className: "agn-alert__close" })
5290
5491
  ] });
5291
5492
  }
5292
5493
 
5293
5494
  // src/feedback/Toast.jsx
5294
- var import_react89 = __toESM(require("react"), 1);
5295
- var import_jsx_runtime87 = require("react/jsx-runtime");
5495
+ var import_react91 = __toESM(require("react"), 1);
5496
+ var import_jsx_runtime89 = require("react/jsx-runtime");
5296
5497
  function Toast({ tone = "ok", title, children, action, onDismiss, duration, labels, className, ...rest }) {
5297
5498
  const L = { dismiss: "Dismiss", ...labels };
5298
- import_react89.default.useEffect(() => {
5499
+ import_react91.default.useEffect(() => {
5299
5500
  if (!duration || !onDismiss) return;
5300
5501
  const t = setTimeout(onDismiss, duration);
5301
5502
  return () => clearTimeout(t);
5302
5503
  }, [duration, onDismiss]);
5303
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: cx("agn-toast", "agn-toast--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
5304
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Icon, { name: TONE_ICON[tone] || "info", size: 16, className: "agn-toast__icon" }),
5305
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "agn-toast__body", children: [
5306
- title && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "agn-toast__title", children: title }),
5307
- children != null && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "agn-toast__text", children }),
5308
- action && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "agn-toast__action", children: action })
5504
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: cx("agn-toast", "agn-toast--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
5505
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Icon, { name: TONE_ICON[tone] || "info", size: 16, className: "agn-toast__icon" }),
5506
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "agn-toast__body", children: [
5507
+ title && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "agn-toast__title", children: title }),
5508
+ children != null && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "agn-toast__text", children }),
5509
+ action && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "agn-toast__action", children: action })
5309
5510
  ] }),
5310
- onDismiss && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ButtonIcon, { icon: "x", label: L.dismiss, size: "xs", onClick: onDismiss, className: "agn-toast__close" })
5511
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ButtonIcon, { icon: "x", label: L.dismiss, size: "xs", onClick: onDismiss, className: "agn-toast__close" })
5311
5512
  ] });
5312
5513
  }
5313
5514
  function ToastContainer({ position = "bottom-right", static: isStatic, contained, children, className, ...rest }) {
5314
5515
  const st = isStatic || position === "static";
5315
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: cx("agn-toasts", !st && "agn-toasts--" + position, st && "agn-toasts--static", contained && !st && "agn-toasts--contained", className), "aria-live": "polite", ...rest, children });
5516
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: cx("agn-toasts", !st && "agn-toasts--" + position, st && "agn-toasts--static", contained && !st && "agn-toasts--contained", className), "aria-live": "polite", ...rest, children });
5316
5517
  }
5317
5518
  function useToasts({ duration = 5e3, max = 3 } = {}) {
5318
- const [live, setLive] = import_react89.default.useState([]);
5319
- const [tick, setTick] = import_react89.default.useState(0);
5320
- const queue = import_react89.default.useRef([]);
5321
- const timers = import_react89.default.useRef({});
5322
- const dismiss = import_react89.default.useCallback((id) => {
5519
+ const [live, setLive] = import_react91.default.useState([]);
5520
+ const [tick, setTick] = import_react91.default.useState(0);
5521
+ const queue = import_react91.default.useRef([]);
5522
+ const timers = import_react91.default.useRef({});
5523
+ const dismiss = import_react91.default.useCallback((id) => {
5323
5524
  clearTimeout(timers.current[id]);
5324
5525
  delete timers.current[id];
5325
5526
  setLive((l) => l.filter((t) => t.id !== id));
5326
5527
  }, []);
5327
- import_react89.default.useEffect(() => {
5528
+ import_react91.default.useEffect(() => {
5328
5529
  const room = max - live.length;
5329
5530
  if (room > 0 && queue.current.length) {
5330
5531
  const take = queue.current.splice(0, room);
5331
5532
  setLive((l) => l.concat(take));
5332
5533
  }
5333
5534
  }, [live, max, tick]);
5334
- import_react89.default.useEffect(() => {
5535
+ import_react91.default.useEffect(() => {
5335
5536
  live.forEach((t) => {
5336
5537
  const ms = t.duration == null ? duration : t.duration;
5337
5538
  if (timers.current[t.id] || !ms) return;
5338
5539
  timers.current[t.id] = setTimeout(() => dismiss(t.id), ms);
5339
5540
  });
5340
5541
  }, [live, duration, dismiss]);
5341
- import_react89.default.useEffect(() => () => Object.values(timers.current).forEach(clearTimeout), []);
5342
- const push = import_react89.default.useCallback((toast) => {
5542
+ import_react91.default.useEffect(() => () => Object.values(timers.current).forEach(clearTimeout), []);
5543
+ const push = import_react91.default.useCallback((toast) => {
5343
5544
  const t = { id: uid("toast"), tone: "ok", ...toast };
5344
5545
  queue.current.push(t);
5345
5546
  setTick((n) => n + 1);
5346
5547
  return t.id;
5347
5548
  }, []);
5348
- const clear = import_react89.default.useCallback(() => {
5549
+ const clear = import_react91.default.useCallback(() => {
5349
5550
  queue.current = [];
5350
5551
  Object.values(timers.current).forEach(clearTimeout);
5351
5552
  timers.current = {};
@@ -5355,39 +5556,39 @@ function useToasts({ duration = 5e3, max = 3 } = {}) {
5355
5556
  }
5356
5557
 
5357
5558
  // src/feedback/ScopedNotification.jsx
5358
- var import_react90 = __toESM(require("react"), 1);
5359
- var import_jsx_runtime88 = require("react/jsx-runtime");
5559
+ var import_react92 = __toESM(require("react"), 1);
5560
+ var import_jsx_runtime90 = require("react/jsx-runtime");
5360
5561
  function ScopedNotification({ tone = "neutral", icon, children, action, className, ...rest }) {
5361
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: cx("agn-scoped", "agn-scoped--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
5362
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Icon, { name: icon || TONE_ICON[tone] || "info", size: 14, className: "agn-scoped__icon" }),
5363
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "agn-scoped__text", children }),
5364
- action && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "agn-scoped__action", children: action })
5562
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: cx("agn-scoped", "agn-scoped--" + tone, className), role: tone === "bad" ? "alert" : "status", ...rest, children: [
5563
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Icon, { name: icon || TONE_ICON[tone] || "info", size: 14, className: "agn-scoped__icon" }),
5564
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "agn-scoped__text", children }),
5565
+ action && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "agn-scoped__action", children: action })
5365
5566
  ] });
5366
5567
  }
5367
5568
 
5368
5569
  // src/feedback/Notification.jsx
5369
- var import_react91 = __toESM(require("react"), 1);
5370
- var import_jsx_runtime89 = require("react/jsx-runtime");
5570
+ var import_react93 = __toESM(require("react"), 1);
5571
+ var import_jsx_runtime91 = require("react/jsx-runtime");
5371
5572
  var initials2 = (name = "") => String(name).trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toLocaleUpperCase("tr-TR")).join("");
5372
5573
  function Notification({ title, message, time, unread, avatar, icon, object, onClick, as, labels, className, ...rest }) {
5373
5574
  const NL = { unread: "unread", ...labels };
5374
5575
  const Tag2 = as || (onClick ? "button" : "div");
5375
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tag2, { type: Tag2 === "button" ? "button" : void 0, className: cx("agn-notif", unread && "agn-notif--unread", onClick && "agn-notif--clickable agn-focus-inset", className), onClick, ...rest, children: [
5376
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif__dot", "aria-hidden": "true" }),
5377
- avatar ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif__avatar", "aria-hidden": "true", children: initials2(avatar) }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif__tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Icon, { name: icon || "bell", size: 16 }) }),
5378
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "agn-notif__body", children: [
5379
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "agn-notif__title", children: [
5576
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Tag2, { type: Tag2 === "button" ? "button" : void 0, className: cx("agn-notif", unread && "agn-notif--unread", onClick && "agn-notif--clickable agn-focus-inset", className), onClick, ...rest, children: [
5577
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif__dot", "aria-hidden": "true" }),
5578
+ avatar ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif__avatar", "aria-hidden": "true", children: initials2(avatar) }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif__tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Icon, { name: icon || "bell", size: 16 }) }),
5579
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("span", { className: "agn-notif__body", children: [
5580
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("span", { className: "agn-notif__title", children: [
5380
5581
  title,
5381
- unread && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "agn-sr", children: [
5582
+ unread && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("span", { className: "agn-sr", children: [
5382
5583
  " (",
5383
5584
  NL.unread,
5384
5585
  ")"
5385
5586
  ] })
5386
5587
  ] }),
5387
- message && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif__msg", children: message }),
5388
- object && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif__object", children: object })
5588
+ message && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif__msg", children: message }),
5589
+ object && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif__object", children: object })
5389
5590
  ] }),
5390
- time && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif__time", children: time })
5591
+ time && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif__time", children: time })
5391
5592
  ] });
5392
5593
  }
5393
5594
  function dayLabel(date, L, locale) {
@@ -5413,36 +5614,36 @@ function NotificationList({ title, items = [], children, onMarkAll, locale = "tr
5413
5614
  g.items.push(it);
5414
5615
  });
5415
5616
  const unread = items.filter((i) => i.unread).length;
5416
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("section", { className: cx("agn-notif-list", bare && "agn-notif-list--bare", className), "aria-label": title || L.title, ...rest, children: [
5417
- header && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("header", { className: "agn-notif-list__head", children: [
5418
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("h3", { className: "agn-notif-list__title", children: [
5617
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("section", { className: cx("agn-notif-list", bare && "agn-notif-list--bare", className), "aria-label": title || L.title, ...rest, children: [
5618
+ header && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("header", { className: "agn-notif-list__head", children: [
5619
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("h3", { className: "agn-notif-list__title", children: [
5419
5620
  title || L.title,
5420
- unread > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "agn-notif-list__count", children: unread })
5621
+ unread > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-notif-list__count", children: unread })
5421
5622
  ] }),
5422
- onMarkAll && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Button, { variant: "link", size: "sm", onClick: onMarkAll, children: L.markAll })
5623
+ onMarkAll && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Button, { variant: "link", size: "sm", onClick: onMarkAll, children: L.markAll })
5423
5624
  ] }),
5424
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "agn-notif-list__body", children: [
5425
- groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "agn-notif-list__group", children: [
5426
- g.key && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet agn-notif-list__day", children: g.key }),
5625
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "agn-notif-list__body", children: [
5626
+ groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "agn-notif-list__group", children: [
5627
+ g.key && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet agn-notif-list__day", children: g.key }),
5427
5628
  g.items.map((it, i) => {
5428
5629
  const { id, day: _day, date: _date, ...p } = it;
5429
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Notification, { labels: { unread: L.unread }, ...p }, id || i);
5630
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Notification, { labels: { unread: L.unread }, ...p }, id || i);
5430
5631
  })
5431
5632
  ] }, g.key || "all")),
5432
5633
  children,
5433
- !items.length && !children && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "agn-notif-list__empty", children: L.empty })
5634
+ !items.length && !children && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "agn-notif-list__empty", children: L.empty })
5434
5635
  ] })
5435
5636
  ] });
5436
5637
  }
5437
5638
 
5438
5639
  // src/feedback/Modal.jsx
5439
- var import_react92 = __toESM(require("react"), 1);
5440
- var import_jsx_runtime90 = require("react/jsx-runtime");
5640
+ var import_react94 = __toESM(require("react"), 1);
5641
+ var import_jsx_runtime92 = require("react/jsx-runtime");
5441
5642
  var FOCUSABLE2 = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
5442
5643
  function useDialog(open, onClose, ref, { lockScroll = true, autoFocus = true } = {}) {
5443
- const closeRef = import_react92.default.useRef(onClose);
5644
+ const closeRef = import_react94.default.useRef(onClose);
5444
5645
  closeRef.current = onClose;
5445
- import_react92.default.useEffect(() => {
5646
+ import_react94.default.useEffect(() => {
5446
5647
  if (!open) return;
5447
5648
  const previous = document.activeElement;
5448
5649
  const onKey = (e) => {
@@ -5486,99 +5687,99 @@ function useDialog(open, onClose, ref, { lockScroll = true, autoFocus = true } =
5486
5687
  }
5487
5688
  function Modal({ open, onClose, title, description, size = "md", footer, children, hideClose, scrimClose = true, labels, className, bodyClassName, ...rest }) {
5488
5689
  const L = { close: "Close", ...labels };
5489
- const ref = import_react92.default.useRef(null);
5490
- const ids = import_react92.default.useMemo(() => ({ t: uid("modal-title"), d: uid("modal-desc") }), []);
5690
+ const ref = import_react94.default.useRef(null);
5691
+ const ids = import_react94.default.useMemo(() => ({ t: uid("modal-title"), d: uid("modal-desc") }), []);
5491
5692
  useDialog(open, onClose, ref);
5492
5693
  if (!open) return null;
5493
5694
  return (
5494
5695
  // biome-ignore lint/a11y/noStaticElementInteractions: pointer-only convenience; Esc closes the dialog from the keyboard
5495
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "agn-scrim", onMouseDown: (e) => {
5696
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "agn-scrim", onMouseDown: (e) => {
5496
5697
  if (scrimClose && e.target === e.currentTarget && onClose) onClose();
5497
- }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? ids.t : void 0, "aria-describedby": description ? ids.d : void 0, tabIndex: -1, className: cx("agn-modal", "agn-modal--" + size, className), ...rest, children: [
5498
- (title || !hideClose) && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("header", { className: "agn-modal__head", children: [
5499
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "agn-modal__heading", children: [
5500
- title && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { id: ids.t, className: "agn-modal__title", children: title }),
5501
- description && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { id: ids.d, className: "agn-modal__desc", children: description })
5698
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? ids.t : void 0, "aria-describedby": description ? ids.d : void 0, tabIndex: -1, className: cx("agn-modal", "agn-modal--" + size, className), ...rest, children: [
5699
+ (title || !hideClose) && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("header", { className: "agn-modal__head", children: [
5700
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "agn-modal__heading", children: [
5701
+ title && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("h2", { id: ids.t, className: "agn-modal__title", children: title }),
5702
+ description && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { id: ids.d, className: "agn-modal__desc", children: description })
5502
5703
  ] }),
5503
- !hideClose && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose, "data-dialog-close": "", className: "agn-modal__close" })
5704
+ !hideClose && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose, "data-dialog-close": "", className: "agn-modal__close" })
5504
5705
  ] }),
5505
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: cx("agn-modal__body", bodyClassName), children }),
5506
- footer && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("footer", { className: "agn-modal__foot", children: footer })
5706
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: cx("agn-modal__body", bodyClassName), children }),
5707
+ footer && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("footer", { className: "agn-modal__foot", children: footer })
5507
5708
  ] }) })
5508
5709
  );
5509
5710
  }
5510
5711
  var PROMPT_ICON = { bad: "trash-2", warn: "triangle-alert", info: "info", ok: "circle-check" };
5511
5712
  function Prompt({ open, onClose, onConfirm, title, children, consequence, tone = "warn", icon, confirmLabel, cancelLabel, loading: loading2, labels, className, ...rest }) {
5512
5713
  const L = { confirm: "Confirm", cancel: "Cancel", ...labels };
5513
- const ref = import_react92.default.useRef(null);
5514
- const ids = import_react92.default.useMemo(() => ({ t: uid("prompt-title"), d: uid("prompt-desc") }), []);
5714
+ const ref = import_react94.default.useRef(null);
5715
+ const ids = import_react94.default.useMemo(() => ({ t: uid("prompt-title"), d: uid("prompt-desc") }), []);
5515
5716
  useDialog(open, onClose, ref);
5516
5717
  if (!open) return null;
5517
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "agn-scrim", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { ref, role: "alertdialog", "aria-modal": "true", "aria-labelledby": ids.t, "aria-describedby": ids.d, tabIndex: -1, className: cx("agn-modal agn-modal--sm agn-prompt", "agn-prompt--" + tone, className), ...rest, children: [
5518
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "agn-prompt__body", children: [
5519
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "agn-prompt__icon", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Icon, { name: icon || PROMPT_ICON[tone] || "info", size: 20 }) }),
5520
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { children: [
5521
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { id: ids.t, className: "agn-modal__title", children: title }),
5522
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { id: ids.d, className: "agn-prompt__text", children: [
5718
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "agn-scrim", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ref, role: "alertdialog", "aria-modal": "true", "aria-labelledby": ids.t, "aria-describedby": ids.d, tabIndex: -1, className: cx("agn-modal agn-modal--sm agn-prompt", "agn-prompt--" + tone, className), ...rest, children: [
5719
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "agn-prompt__body", children: [
5720
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "agn-prompt__icon", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Icon, { name: icon || PROMPT_ICON[tone] || "info", size: 20 }) }),
5721
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { children: [
5722
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("h2", { id: ids.t, className: "agn-modal__title", children: title }),
5723
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { id: ids.d, className: "agn-prompt__text", children: [
5523
5724
  children,
5524
- consequence && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "agn-prompt__consequence", children: consequence })
5725
+ consequence && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "agn-prompt__consequence", children: consequence })
5525
5726
  ] })
5526
5727
  ] })
5527
5728
  ] }),
5528
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("footer", { className: "agn-modal__foot", children: [
5529
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Button, { onClick: onClose, disabled: loading2, children: cancelLabel || L.cancel }),
5530
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Button, { variant: tone === "bad" ? "destructive" : "primary", onClick: onConfirm, loading: loading2, "data-autofocus": "", children: confirmLabel || L.confirm })
5729
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("footer", { className: "agn-modal__foot", children: [
5730
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { onClick: onClose, disabled: loading2, children: cancelLabel || L.cancel }),
5731
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { variant: tone === "bad" ? "destructive" : "primary", onClick: onConfirm, loading: loading2, "data-autofocus": "", children: confirmLabel || L.confirm })
5531
5732
  ] })
5532
5733
  ] }) });
5533
5734
  }
5534
5735
 
5535
5736
  // src/feedback/Sheet.jsx
5536
- var import_react93 = __toESM(require("react"), 1);
5537
- var import_jsx_runtime91 = require("react/jsx-runtime");
5737
+ var import_react95 = __toESM(require("react"), 1);
5738
+ var import_jsx_runtime93 = require("react/jsx-runtime");
5538
5739
  function Sheet({ open, onClose, title, description, footer, children, hideClose, scrimClose = true, contained, maxHeight, labels, className, style, ...rest }) {
5539
5740
  const L = { close: "Close", ...labels };
5540
- const ref = import_react93.default.useRef(null);
5541
- const ids = import_react93.default.useMemo(() => ({ t: uid("sheet-title"), d: uid("sheet-desc") }), []);
5741
+ const ref = import_react95.default.useRef(null);
5742
+ const ids = import_react95.default.useMemo(() => ({ t: uid("sheet-title"), d: uid("sheet-desc") }), []);
5542
5743
  useDialog(open, onClose, ref, { lockScroll: !contained });
5543
5744
  if (!open) return null;
5544
5745
  return (
5545
5746
  // biome-ignore lint/a11y/noStaticElementInteractions: pointer-only convenience; Esc closes the dialog from the keyboard
5546
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: cx("agn-sheet-scrim", contained && "agn-sheet-scrim--contained"), onMouseDown: (e) => {
5747
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: cx("agn-sheet-scrim", contained && "agn-sheet-scrim--contained"), onMouseDown: (e) => {
5547
5748
  if (scrimClose && e.target === e.currentTarget && onClose) onClose();
5548
- }, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? ids.t : void 0, "aria-describedby": description ? ids.d : void 0, tabIndex: -1, className: cx("agn-sheet", className), style: maxHeight != null ? { maxHeight: typeof maxHeight === "number" ? maxHeight + "px" : maxHeight, ...style } : style, ...rest, children: [
5549
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "agn-sheet__handle", "aria-hidden": "true" }),
5550
- (title || !hideClose) && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("header", { className: "agn-sheet__head", children: [
5551
- /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "agn-sheet__heading", children: [
5552
- title && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("h2", { id: ids.t, className: "agn-sheet__title", children: title }),
5553
- description && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("p", { id: ids.d, className: "agn-sheet__desc", children: description })
5749
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? ids.t : void 0, "aria-describedby": description ? ids.d : void 0, tabIndex: -1, className: cx("agn-sheet", className), style: maxHeight != null ? { maxHeight: typeof maxHeight === "number" ? maxHeight + "px" : maxHeight, ...style } : style, ...rest, children: [
5750
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "agn-sheet__handle", "aria-hidden": "true" }),
5751
+ (title || !hideClose) && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("header", { className: "agn-sheet__head", children: [
5752
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "agn-sheet__heading", children: [
5753
+ title && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("h2", { id: ids.t, className: "agn-sheet__title", children: title }),
5754
+ description && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { id: ids.d, className: "agn-sheet__desc", children: description })
5554
5755
  ] }),
5555
- !hideClose && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose, "data-dialog-close": "" })
5756
+ !hideClose && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "sm", onClick: onClose, "data-dialog-close": "" })
5556
5757
  ] }),
5557
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "agn-sheet__body", children }),
5558
- footer && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("footer", { className: "agn-sheet__foot", children: footer })
5758
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "agn-sheet__body", children }),
5759
+ footer && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("footer", { className: "agn-sheet__foot", children: footer })
5559
5760
  ] }) })
5560
5761
  );
5561
5762
  }
5562
5763
 
5563
5764
  // src/feedback/Popover.jsx
5564
- var import_react94 = __toESM(require("react"), 1);
5565
- var import_jsx_runtime92 = require("react/jsx-runtime");
5765
+ var import_react96 = __toESM(require("react"), 1);
5766
+ var import_jsx_runtime94 = require("react/jsx-runtime");
5566
5767
  function Popover({ trigger, open: openProp, defaultOpen = false, onOpenChange, placement = "bottom-start", arrow = false, title, footer, children, width = 288, hideClose, static: isStatic, labels, className, ...rest }) {
5567
5768
  const L = { close: "Close", ...labels };
5568
- const [own, setOwn] = import_react94.default.useState(defaultOpen);
5769
+ const [own, setOwn] = import_react96.default.useState(defaultOpen);
5569
5770
  const controlled = openProp != null;
5570
5771
  const open = controlled ? openProp : own;
5571
- const wrap = import_react94.default.useRef(null);
5572
- const pop = import_react94.default.useRef(null);
5573
- const byUser = import_react94.default.useRef(false);
5574
- const id = import_react94.default.useMemo(() => uid("pop"), []);
5772
+ const wrap = import_react96.default.useRef(null);
5773
+ const pop = import_react96.default.useRef(null);
5774
+ const byUser = import_react96.default.useRef(false);
5775
+ const id = import_react96.default.useMemo(() => uid("pop"), []);
5575
5776
  const set = (v) => {
5576
5777
  if (!controlled) setOwn(v);
5577
5778
  onOpenChange && onOpenChange(v);
5578
5779
  };
5579
- const setRef = import_react94.default.useRef(set);
5780
+ const setRef = import_react96.default.useRef(set);
5580
5781
  setRef.current = set;
5581
- import_react94.default.useEffect(() => {
5782
+ import_react96.default.useEffect(() => {
5582
5783
  if (!open || isStatic) return;
5583
5784
  const down = (e) => {
5584
5785
  if (wrap.current && !wrap.current.contains(e.target)) setRef.current(false);
@@ -5601,18 +5802,18 @@ function Popover({ trigger, open: openProp, defaultOpen = false, onOpenChange, p
5601
5802
  document.removeEventListener("keydown", key);
5602
5803
  };
5603
5804
  }, [open]);
5604
- const layer = /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ref: pop, id, role: "dialog", "aria-label": typeof title === "string" ? title : void 0, tabIndex: -1, className: cx("agn-pop", isStatic ? "agn-pop--static" : "agn-pop--" + placement, arrow && "agn-pop--arrow", className), style: { width }, ...rest, children: [
5605
- arrow && !isStatic && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "agn-pop__arrow", "aria-hidden": "true" }),
5606
- (title || !hideClose) && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "agn-pop__head", children: [
5607
- title && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "agn-pop__title", children: title }),
5608
- !hideClose && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "xs", onClick: () => set(false), className: "agn-pop__close" })
5805
+ const layer = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { ref: pop, id, role: "dialog", "aria-label": typeof title === "string" ? title : void 0, tabIndex: -1, className: cx("agn-pop", isStatic ? "agn-pop--static" : "agn-pop--" + placement, arrow && "agn-pop--arrow", className), style: { width }, ...rest, children: [
5806
+ arrow && !isStatic && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "agn-pop__arrow", "aria-hidden": "true" }),
5807
+ (title || !hideClose) && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "agn-pop__head", children: [
5808
+ title && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "agn-pop__title", children: title }),
5809
+ !hideClose && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "xs", onClick: () => set(false), className: "agn-pop__close" })
5609
5810
  ] }),
5610
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "agn-pop__body", children }),
5611
- footer && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "agn-pop__foot", children: footer })
5811
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "agn-pop__body", children }),
5812
+ footer && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "agn-pop__foot", children: footer })
5612
5813
  ] });
5613
5814
  if (isStatic) return layer;
5614
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("span", { className: "agn-pop-wrap", ref: wrap, children: [
5615
- trigger && import_react94.default.cloneElement(trigger, { onClick: (e) => {
5815
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("span", { className: "agn-pop-wrap", ref: wrap, children: [
5816
+ trigger && import_react96.default.cloneElement(trigger, { onClick: (e) => {
5616
5817
  trigger.props.onClick && trigger.props.onClick(e);
5617
5818
  byUser.current = !open;
5618
5819
  set(!open);
@@ -5621,147 +5822,111 @@ function Popover({ trigger, open: openProp, defaultOpen = false, onOpenChange, p
5621
5822
  ] });
5622
5823
  }
5623
5824
 
5624
- // src/feedback/Tooltip.jsx
5625
- var import_react95 = __toESM(require("react"), 1);
5626
- var import_jsx_runtime93 = require("react/jsx-runtime");
5627
- function Tooltip({ content, kbd, placement = "top", delay = 400, open: openProp, children, className, ...rest }) {
5628
- const [own, setOwn] = import_react95.default.useState(false);
5629
- const open = openProp != null ? openProp : own;
5630
- const timer = import_react95.default.useRef(null);
5631
- const id = import_react95.default.useMemo(() => uid("tip"), []);
5632
- const show2 = () => {
5633
- clearTimeout(timer.current);
5634
- timer.current = setTimeout(() => setOwn(true), delay);
5635
- };
5636
- const hide = () => {
5637
- clearTimeout(timer.current);
5638
- setOwn(false);
5639
- };
5640
- import_react95.default.useEffect(() => () => clearTimeout(timer.current), []);
5641
- import_react95.default.useEffect(() => {
5642
- if (!open) return;
5643
- const k = (e) => e.key === "Escape" && hide();
5644
- document.addEventListener("keydown", k);
5645
- return () => document.removeEventListener("keydown", k);
5646
- }, [open]);
5647
- const child = import_react95.default.Children.only(children);
5648
- return (
5649
- // biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only listens: hover and focus bubble up from the focusable trigger it wraps; it is not itself operable
5650
- /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: cx("agn-tip-wrap", className), onMouseEnter: show2, onMouseLeave: hide, onFocus: show2, onBlur: hide, ...rest, children: [
5651
- import_react95.default.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] }),
5652
- open && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { role: "tooltip", id, className: cx("agn-tip", "agn-tip--" + placement), children: [
5653
- content,
5654
- kbd && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("kbd", { className: "agn-tip__kbd", children: kbd })
5655
- ] })
5656
- ] })
5657
- );
5658
- }
5659
-
5660
5825
  // src/feedback/Spinner.jsx
5661
- var import_react96 = __toESM(require("react"), 1);
5662
- var import_jsx_runtime94 = require("react/jsx-runtime");
5826
+ var import_react97 = __toESM(require("react"), 1);
5827
+ var import_jsx_runtime95 = require("react/jsx-runtime");
5663
5828
  var PX = { xs: 12, sm: 16, md: 20, lg: 32 };
5664
5829
  function Spinner({ size = "md", tone = "signal", label, cover, labels, className, ...rest }) {
5665
5830
  const L = { loading: "Loading", ...labels };
5666
5831
  const px2 = PX[size] || PX.md;
5667
- const svg = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("svg", { className: "agn-spinner__svg", width: px2, height: px2, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
5668
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("circle", { className: "agn-spinner__track", cx: "12", cy: "12", r: "9.5", strokeWidth: "2.5" }),
5669
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("circle", { className: "agn-spinner__arc", cx: "12", cy: "12", r: "9.5", strokeWidth: "2.5", strokeLinecap: "round", strokeDasharray: "18 42" })
5832
+ const svg = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("svg", { className: "agn-spinner__svg", width: px2, height: px2, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
5833
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("circle", { className: "agn-spinner__track", cx: "12", cy: "12", r: "9.5", strokeWidth: "2.5" }),
5834
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("circle", { className: "agn-spinner__arc", cx: "12", cy: "12", r: "9.5", strokeWidth: "2.5", strokeLinecap: "round", strokeDasharray: "18 42" })
5670
5835
  ] });
5671
5836
  return (
5672
5837
  // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
5673
- /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("span", { className: cx("agn-spinner", "agn-spinner--" + size, "agn-spinner--" + tone, cover && "agn-spinner--cover", className), role: "status", "aria-busy": "true", ...rest, children: [
5838
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("span", { className: cx("agn-spinner", "agn-spinner--" + size, "agn-spinner--" + tone, cover && "agn-spinner--cover", className), role: "status", "aria-busy": "true", ...rest, children: [
5674
5839
  svg,
5675
- label ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "agn-spinner__label", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "agn-sr", children: L.loading })
5840
+ label ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "agn-spinner__label", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "agn-sr", children: L.loading })
5676
5841
  ] })
5677
5842
  );
5678
5843
  }
5679
5844
 
5680
5845
  // src/feedback/ProgressBar.jsx
5681
- var import_react97 = __toESM(require("react"), 1);
5682
- var import_jsx_runtime95 = require("react/jsx-runtime");
5846
+ var import_react98 = __toESM(require("react"), 1);
5847
+ var import_jsx_runtime96 = require("react/jsx-runtime");
5683
5848
  function ProgressBar({ value = 0, max = 100, indeterminate, tone = "signal", size = "md", label, showValue, valueText, labels, className, ...rest }) {
5684
5849
  const L = { working: "Working", ...labels };
5685
- const id = import_react97.default.useMemo(() => uid("progress"), []);
5850
+ const id = import_react98.default.useMemo(() => uid("progress"), []);
5686
5851
  const pct2 = Math.max(0, Math.min(100, value / (max || 1) * 100));
5687
5852
  const text = valueText != null ? valueText : Math.round(pct2) + "%";
5688
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: cx("agn-progress", "agn-progress--" + size, "agn-progress--" + tone, indeterminate && "agn-progress--indeterminate", className), ...rest, children: [
5689
- (label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "agn-progress__row", children: [
5690
- label && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { id, className: "agn-progress__label", children: label }),
5691
- showValue && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "agn-progress__value agn-num", children: text })
5853
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: cx("agn-progress", "agn-progress--" + size, "agn-progress--" + tone, indeterminate && "agn-progress--indeterminate", className), ...rest, children: [
5854
+ (label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "agn-progress__row", children: [
5855
+ label && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { id, className: "agn-progress__label", children: label }),
5856
+ showValue && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "agn-progress__value agn-num", children: text })
5692
5857
  ] }),
5693
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "agn-progress__track", role: "progressbar", "aria-labelledby": label ? id : void 0, "aria-label": !label ? L.working : void 0, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": indeterminate ? void 0 : value, "aria-valuetext": indeterminate ? L.working : text, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "agn-progress__fill", style: indeterminate ? void 0 : { width: pct2 + "%" } }) })
5858
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "agn-progress__track", role: "progressbar", "aria-labelledby": label ? id : void 0, "aria-label": !label ? L.working : void 0, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": indeterminate ? void 0 : value, "aria-valuetext": indeterminate ? L.working : text, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "agn-progress__fill", style: indeterminate ? void 0 : { width: pct2 + "%" } }) })
5694
5859
  ] });
5695
5860
  }
5696
5861
 
5697
5862
  // src/feedback/ProgressRing.jsx
5698
- var import_react98 = __toESM(require("react"), 1);
5699
- var import_jsx_runtime96 = require("react/jsx-runtime");
5863
+ var import_react99 = __toESM(require("react"), 1);
5864
+ var import_jsx_runtime97 = require("react/jsx-runtime");
5700
5865
  function ProgressRing({ value = 0, max = 100, size = 64, strokeWidth = 6, tone = "signal", showValue = true, valueText, label, children, className, ...rest }) {
5701
5866
  const pct2 = Math.max(0, Math.min(100, value / (max || 1) * 100));
5702
5867
  const r = (size - strokeWidth) / 2, c = 2 * Math.PI * r;
5703
5868
  const text = valueText != null ? valueText : Math.round(pct2) + "%";
5704
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: cx("agn-ring", "agn-ring--" + tone, className), style: { width: size }, ...rest, children: [
5705
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "agn-ring__box", style: { width: size, height: size }, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": value, "aria-valuetext": text, "aria-label": typeof label === "string" ? label : void 0, children: [
5706
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": "true", children: [
5707
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("circle", { className: "agn-ring__track", cx: size / 2, cy: size / 2, r, strokeWidth, fill: "none" }),
5708
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("circle", { className: "agn-ring__arc", cx: size / 2, cy: size / 2, r, strokeWidth, fill: "none", strokeLinecap: pct2 > 0 && pct2 < 100 ? "round" : "butt", strokeDasharray: c, strokeDashoffset: c * (1 - pct2 / 100), transform: `rotate(-90 ${size / 2} ${size / 2})` })
5869
+ return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: cx("agn-ring", "agn-ring--" + tone, className), style: { width: size }, ...rest, children: [
5870
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "agn-ring__box", style: { width: size, height: size }, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": value, "aria-valuetext": text, "aria-label": typeof label === "string" ? label : void 0, children: [
5871
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": "true", children: [
5872
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("circle", { className: "agn-ring__track", cx: size / 2, cy: size / 2, r, strokeWidth, fill: "none" }),
5873
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("circle", { className: "agn-ring__arc", cx: size / 2, cy: size / 2, r, strokeWidth, fill: "none", strokeLinecap: pct2 > 0 && pct2 < 100 ? "round" : "butt", strokeDasharray: c, strokeDashoffset: c * (1 - pct2 / 100), transform: `rotate(-90 ${size / 2} ${size / 2})` })
5709
5874
  ] }),
5710
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "agn-ring__center", style: { fontSize: Math.max(11, Math.round(size * 0.24)) }, children: children != null ? children : showValue ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "agn-ring__value agn-num", children: text }) : null })
5875
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "agn-ring__center", style: { fontSize: Math.max(11, Math.round(size * 0.24)) }, children: children != null ? children : showValue ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "agn-ring__value agn-num", children: text }) : null })
5711
5876
  ] }),
5712
- label && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "agn-ring__label", children: label })
5877
+ label && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "agn-ring__label", children: label })
5713
5878
  ] });
5714
5879
  }
5715
5880
 
5716
5881
  // src/feedback/DockedComposer.jsx
5717
- var import_react99 = __toESM(require("react"), 1);
5718
- var import_jsx_runtime97 = require("react/jsx-runtime");
5882
+ var import_react100 = __toESM(require("react"), 1);
5883
+ var import_jsx_runtime98 = require("react/jsx-runtime");
5719
5884
  function DockedComposer({ title, icon = "pen-line", minimized: minProp, defaultMinimized = false, onMinimize, onClose, toolbar, footer, children, side = "right", static: isStatic, labels, className, ...rest }) {
5720
5885
  const L = { minimize: "Minimise", restore: "Restore", close: "Close", ...labels };
5721
- const [own, setOwn] = import_react99.default.useState(defaultMinimized);
5886
+ const [own, setOwn] = import_react100.default.useState(defaultMinimized);
5722
5887
  const min = minProp != null ? minProp : own;
5723
5888
  const toggle = () => {
5724
5889
  const v = !min;
5725
5890
  if (minProp == null) setOwn(v);
5726
5891
  onMinimize && onMinimize(v);
5727
5892
  };
5728
- return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("section", { className: cx("agn-composer", "agn-composer--" + side, min && "agn-composer--min", isStatic && "agn-composer--static", className), "aria-label": typeof title === "string" ? title : void 0, ...rest, children: [
5729
- /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("header", { className: "agn-composer__head", children: [
5730
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Icon, { name: icon, size: 16, className: "agn-composer__icon" }),
5731
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("h3", { className: "agn-composer__title", children: title }),
5732
- /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "agn-composer__ctl", children: [
5733
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ButtonIcon, { icon: min ? "chevron-up" : "minus", label: min ? L.restore : L.minimize, size: "xs", onClick: toggle, "aria-expanded": !min }),
5734
- onClose && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "xs", onClick: onClose })
5893
+ return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("section", { className: cx("agn-composer", "agn-composer--" + side, min && "agn-composer--min", isStatic && "agn-composer--static", className), "aria-label": typeof title === "string" ? title : void 0, ...rest, children: [
5894
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("header", { className: "agn-composer__head", children: [
5895
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon, { name: icon, size: 16, className: "agn-composer__icon" }),
5896
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("h3", { className: "agn-composer__title", children: title }),
5897
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "agn-composer__ctl", children: [
5898
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ButtonIcon, { icon: min ? "chevron-up" : "minus", label: min ? L.restore : L.minimize, size: "xs", onClick: toggle, "aria-expanded": !min }),
5899
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ButtonIcon, { icon: "x", label: L.close, size: "xs", onClick: onClose })
5735
5900
  ] })
5736
5901
  ] }),
5737
- !min && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
5738
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "agn-composer__body", children }),
5739
- (toolbar || footer) && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("footer", { className: "agn-composer__foot", children: [
5740
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "agn-composer__tools", children: toolbar }),
5741
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "agn-composer__actions", children: footer })
5902
+ !min && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
5903
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "agn-composer__body", children }),
5904
+ (toolbar || footer) && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("footer", { className: "agn-composer__foot", children: [
5905
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "agn-composer__tools", children: toolbar }),
5906
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "agn-composer__actions", children: footer })
5742
5907
  ] })
5743
5908
  ] })
5744
5909
  ] });
5745
5910
  }
5746
5911
  function DockedUtilityBar({ items = [], active, onChange, panel, static: isStatic, labels, className, ...rest }) {
5747
5912
  const L = { utilities: "Utilities", ...labels };
5748
- return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: cx("agn-utility", isStatic && "agn-utility--static", className), ...rest, children: [
5749
- active && panel && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("section", { className: "agn-utility__panel", "aria-label": (items.find((i) => i.id === active) || {}).label, children: panel }),
5750
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "agn-utility__bar", role: "toolbar", "aria-label": L.utilities, children: items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("button", { type: "button", className: cx("agn-utility__item", it.id === active && "agn-utility__item--active"), "aria-pressed": it.id === active, onClick: () => onChange && onChange(it.id === active ? null : it.id), children: [
5751
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Icon, { name: it.icon || "panel-bottom", size: 14 }),
5752
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { children: it.label }),
5753
- it.badge != null && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "agn-utility__badge agn-num", children: it.badge })
5913
+ return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: cx("agn-utility", isStatic && "agn-utility--static", className), ...rest, children: [
5914
+ active && panel && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("section", { className: "agn-utility__panel", "aria-label": (items.find((i) => i.id === active) || {}).label, children: panel }),
5915
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "agn-utility__bar", role: "toolbar", "aria-label": L.utilities, children: items.map((it) => /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("button", { type: "button", className: cx("agn-utility__item", it.id === active && "agn-utility__item--active"), "aria-pressed": it.id === active, onClick: () => onChange && onChange(it.id === active ? null : it.id), children: [
5916
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon, { name: it.icon || "panel-bottom", size: 14 }),
5917
+ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { children: it.label }),
5918
+ it.badge != null && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "agn-utility__badge agn-num", children: it.badge })
5754
5919
  ] }, it.id)) })
5755
5920
  ] });
5756
5921
  }
5757
5922
 
5758
5923
  // src/feedback/Publisher.jsx
5759
- var import_react100 = __toESM(require("react"), 1);
5760
- var import_jsx_runtime98 = require("react/jsx-runtime");
5924
+ var import_react101 = __toESM(require("react"), 1);
5925
+ var import_jsx_runtime99 = require("react/jsx-runtime");
5761
5926
  function Publisher({ user, placeholder, value, defaultValue = "", onChange, onSubmit, onAttach, onMention, submitLabel, expanded: expProp, labels, className, ...rest }) {
5762
5927
  const L = { placeholder: "Write a note\u2026", submit: "Post", attach: "Attach file", mention: "Mention someone", ...labels };
5763
- const [own, setOwn] = import_react100.default.useState(defaultValue);
5764
- const [focus, setFocus] = import_react100.default.useState(false);
5928
+ const [own, setOwn] = import_react101.default.useState(defaultValue);
5929
+ const [focus, setFocus] = import_react101.default.useState(false);
5765
5930
  const val = value != null ? value : own;
5766
5931
  const expanded = expProp != null ? expProp : focus || val.length > 0;
5767
5932
  const name = typeof user === "string" ? user : user && user.name;
@@ -5770,10 +5935,10 @@ function Publisher({ user, placeholder, value, defaultValue = "", onChange, onSu
5770
5935
  onSubmit && onSubmit(val);
5771
5936
  if (value == null) setOwn("");
5772
5937
  };
5773
- return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: cx("agn-publisher", expanded && "agn-publisher--open", className), ...rest, children: [
5774
- name && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "agn-publisher__avatar", "aria-hidden": "true", children: initials2(name) }),
5775
- /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "agn-publisher__field", children: [
5776
- /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
5938
+ return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: cx("agn-publisher", expanded && "agn-publisher--open", className), ...rest, children: [
5939
+ name && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: "agn-publisher__avatar", "aria-hidden": "true", children: initials2(name) }),
5940
+ /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "agn-publisher__field", children: [
5941
+ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
5777
5942
  "textarea",
5778
5943
  {
5779
5944
  className: "agn-publisher__input",
@@ -5795,29 +5960,29 @@ function Publisher({ user, placeholder, value, defaultValue = "", onChange, onSu
5795
5960
  }
5796
5961
  }
5797
5962
  ),
5798
- expanded && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "agn-publisher__bar", children: [
5799
- /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "agn-publisher__tools", children: [
5800
- /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ButtonIcon, { icon: "paperclip", label: L.attach, size: "sm", onClick: onAttach }),
5801
- /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ButtonIcon, { icon: "at-sign", label: L.mention, size: "sm", onClick: onMention })
5963
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "agn-publisher__bar", children: [
5964
+ /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "agn-publisher__tools", children: [
5965
+ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ButtonIcon, { icon: "paperclip", label: L.attach, size: "sm", onClick: onAttach }),
5966
+ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ButtonIcon, { icon: "at-sign", label: L.mention, size: "sm", onClick: onMention })
5802
5967
  ] }),
5803
- /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Button, { variant: "primary", size: "sm", disabled: !val.trim(), onClick: submit, children: submitLabel || L.submit })
5968
+ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Button, { variant: "primary", size: "sm", disabled: !val.trim(), onClick: submit, children: submitLabel || L.submit })
5804
5969
  ] })
5805
5970
  ] })
5806
5971
  ] });
5807
5972
  }
5808
5973
 
5809
5974
  // src/feedback/EmptyState.jsx
5810
- var import_react101 = __toESM(require("react"), 1);
5811
- var import_jsx_runtime99 = require("react/jsx-runtime");
5975
+ var import_react102 = __toESM(require("react"), 1);
5976
+ var import_jsx_runtime100 = require("react/jsx-runtime");
5812
5977
  function EmptyState({ illustration, icon, product, title, children, action, secondary, compact, className, ...rest }) {
5813
5978
  return (
5814
5979
  // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
5815
- /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: cx("agn-empty", compact && "agn-empty--compact", className), role: "status", ...rest, children: [
5816
- illustration ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "agn-empty__art", children: illustration }) : (icon || product) && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: "agn-empty__icon", children: product ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ProductIcon, { product, size: compact ? 20 : 24 }) : /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Icon, { name: icon, size: compact ? 18 : 22 }) }),
5817
- /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "agn-empty__body", children: [
5818
- title && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("h4", { className: "agn-empty__title", children: title }),
5819
- children != null && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("p", { className: "agn-empty__text", children }),
5820
- (action || secondary) && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "agn-empty__actions", children: [
5980
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: cx("agn-empty", compact && "agn-empty--compact", className), role: "status", ...rest, children: [
5981
+ illustration ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "agn-empty__art", children: illustration }) : (icon || product) && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "agn-empty__icon", children: product ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ProductIcon, { product, size: compact ? 20 : 24 }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Icon, { name: icon, size: compact ? 18 : 22 }) }),
5982
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "agn-empty__body", children: [
5983
+ title && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("h4", { className: "agn-empty__title", children: title }),
5984
+ children != null && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("p", { className: "agn-empty__text", children }),
5985
+ (action || secondary) && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "agn-empty__actions", children: [
5821
5986
  action,
5822
5987
  secondary
5823
5988
  ] })
@@ -5827,27 +5992,27 @@ function EmptyState({ illustration, icon, product, title, children, action, seco
5827
5992
  }
5828
5993
 
5829
5994
  // src/chat/ChatThread.jsx
5830
- var import_react102 = __toESM(require("react"), 1);
5831
- var import_jsx_runtime100 = require("react/jsx-runtime");
5995
+ var import_react103 = __toESM(require("react"), 1);
5996
+ var import_jsx_runtime101 = require("react/jsx-runtime");
5832
5997
  function ChatThread({ children, stickToBottom = true, userSide = "start", maxHeight, labels, className, style, ...rest }) {
5833
5998
  const L = { thread: "Conversation", ...labels };
5834
- const ref = import_react102.default.useRef(null);
5835
- import_react102.default.useEffect(() => {
5999
+ const ref = import_react103.default.useRef(null);
6000
+ import_react103.default.useEffect(() => {
5836
6001
  if (stickToBottom && ref.current) ref.current.scrollTop = ref.current.scrollHeight;
5837
6002
  }, [children, stickToBottom]);
5838
- return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { ref, className: cx("agn-chat", "agn-chat--user-" + userSide, className), role: "log", "aria-live": "polite", "aria-label": L.thread, style: { maxHeight, ...style }, ...rest, children });
6003
+ return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { ref, className: cx("agn-chat", "agn-chat--user-" + userSide, className), role: "log", "aria-live": "polite", "aria-label": L.thread, style: { maxHeight, ...style }, ...rest, children });
5839
6004
  }
5840
6005
  function ChatDivider({ variant = "day", children, labels, className, ...rest }) {
5841
6006
  const L = { newMessages: "New messages", ...labels };
5842
- return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: cx("agn-chat__divider", "agn-chat__divider--" + variant, className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { children: children != null ? children : variant === "new" ? L.newMessages : null }) });
6007
+ return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: cx("agn-chat__divider", "agn-chat__divider--" + variant, className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { children: children != null ? children : variant === "new" ? L.newMessages : null }) });
5843
6008
  }
5844
6009
 
5845
6010
  // src/chat/ChatMessage.jsx
5846
- var import_react106 = __toESM(require("react"), 1);
6011
+ var import_react107 = __toESM(require("react"), 1);
5847
6012
 
5848
6013
  // src/chat/ChatMarkdown.jsx
5849
- var import_react103 = __toESM(require("react"), 1);
5850
- var import_jsx_runtime101 = require("react/jsx-runtime");
6014
+ var import_react104 = __toESM(require("react"), 1);
6015
+ var import_jsx_runtime102 = require("react/jsx-runtime");
5851
6016
  var INLINE = /(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(__[^_\n]+__)|(\*[^*\n]+\*)|(\b_[^_\n]+_\b)|(\[[^\]\n]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+)/g;
5852
6017
  var safeHref = (u) => /^(https?:|mailto:|tel:|\/|#)/i.test(u) ? u : "#";
5853
6018
  function renderInline(text, depth = 0) {
@@ -5857,13 +6022,13 @@ function renderInline(text, depth = 0) {
5857
6022
  while (m = re.exec(text)) {
5858
6023
  if (m.index > last) out.push(text.slice(last, m.index));
5859
6024
  const s = m[0];
5860
- if (m[1]) out.push(/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("code", { className: "agn-md__code", children: s.slice(1, -1) }, k++));
5861
- else if (m[2] || m[3]) out.push(/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("strong", { children: depth < 2 ? renderInline(s.slice(2, -2), depth + 1) : s.slice(2, -2) }, k++));
5862
- else if (m[4] || m[5]) out.push(/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("em", { children: depth < 2 ? renderInline(s.slice(1, -1), depth + 1) : s.slice(1, -1) }, k++));
6025
+ if (m[1]) out.push(/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("code", { className: "agn-md__code", children: s.slice(1, -1) }, k++));
6026
+ else if (m[2] || m[3]) out.push(/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("strong", { children: depth < 2 ? renderInline(s.slice(2, -2), depth + 1) : s.slice(2, -2) }, k++));
6027
+ else if (m[4] || m[5]) out.push(/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("em", { children: depth < 2 ? renderInline(s.slice(1, -1), depth + 1) : s.slice(1, -1) }, k++));
5863
6028
  else if (m[6]) {
5864
6029
  const mm = /^\[([^\]]+)\]\(([^)\s]+)\)/.exec(s);
5865
- out.push(/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("a", { href: safeHref(mm[2]), target: "_blank", rel: "noopener noreferrer", children: mm[1] }, k++));
5866
- } else if (m[7]) out.push(/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("a", { href: safeHref(s), target: "_blank", rel: "noopener noreferrer", children: s }, k++));
6030
+ out.push(/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("a", { href: safeHref(mm[2]), target: "_blank", rel: "noopener noreferrer", children: mm[1] }, k++));
6031
+ } else if (m[7]) out.push(/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("a", { href: safeHref(s), target: "_blank", rel: "noopener noreferrer", children: s }, k++));
5867
6032
  last = m.index + s.length;
5868
6033
  }
5869
6034
  if (last < text.length) out.push(text.slice(last));
@@ -5933,160 +6098,160 @@ function parseBlocks(src) {
5933
6098
  return blocks;
5934
6099
  }
5935
6100
  function withBreaks(text) {
5936
- return text.split("\n").flatMap((l, i) => i ? [/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("br", {}, "b" + i), ...renderInline(l)] : renderInline(l));
6101
+ return text.split("\n").flatMap((l, i) => i ? [/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("br", {}, "b" + i), ...renderInline(l)] : renderInline(l));
5937
6102
  }
5938
6103
  function renderBlock(b, i) {
5939
6104
  switch (b.type) {
5940
6105
  case "code":
5941
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("pre", { className: "agn-md__pre", "data-lang": b.lang || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("code", { children: b.text }) }, i);
6106
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("pre", { className: "agn-md__pre", "data-lang": b.lang || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("code", { children: b.text }) }, i);
5942
6107
  case "h": {
5943
6108
  const Tag2 = "h" + Math.min(6, b.level + 2);
5944
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Tag2, { className: "agn-md__h agn-md__h--" + b.level, children: renderInline(b.text) }, i);
6109
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tag2, { className: "agn-md__h agn-md__h--" + b.level, children: renderInline(b.text) }, i);
5945
6110
  }
5946
6111
  case "hr":
5947
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("hr", { className: "agn-md__hr" }, i);
6112
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("hr", { className: "agn-md__hr" }, i);
5948
6113
  case "quote":
5949
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("blockquote", { className: "agn-md__quote", children: b.blocks.map(renderBlock) }, i);
6114
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("blockquote", { className: "agn-md__quote", children: b.blocks.map(renderBlock) }, i);
5950
6115
  case "table":
5951
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "agn-md__table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("table", { className: "agn-md__table", children: [
5952
- /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("tr", { children: b.head.map((c, j) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("th", { style: { textAlign: b.aligns[j] }, children: renderInline(c) }, j)) }) }),
5953
- /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("tbody", { children: b.rows.map((r, ri) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("tr", { children: b.head.map((_, j) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("td", { style: { textAlign: b.aligns[j] }, children: renderInline(r[j] || "") }, j)) }, ri)) })
6116
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "agn-md__table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("table", { className: "agn-md__table", children: [
6117
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("tr", { children: b.head.map((c, j) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("th", { style: { textAlign: b.aligns[j] }, children: renderInline(c) }, j)) }) }),
6118
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("tbody", { children: b.rows.map((r, ri) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("tr", { children: b.head.map((_, j) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("td", { style: { textAlign: b.aligns[j] }, children: renderInline(r[j] || "") }, j)) }, ri)) })
5954
6119
  ] }) }, i);
5955
6120
  case "list": {
5956
6121
  const Tag2 = b.ordered ? "ol" : "ul";
5957
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Tag2, { className: "agn-md__list", children: b.items.map((t, j) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("li", { children: withBreaks(t) }, j)) }, i);
6122
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tag2, { className: "agn-md__list", children: b.items.map((t, j) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("li", { children: withBreaks(t) }, j)) }, i);
5958
6123
  }
5959
6124
  default:
5960
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("p", { className: "agn-md__p", children: withBreaks(b.text) }, i);
6125
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("p", { className: "agn-md__p", children: withBreaks(b.text) }, i);
5961
6126
  }
5962
6127
  }
5963
6128
  function ChatMarkdown({ source, className, ...rest }) {
5964
- const blocks = import_react103.default.useMemo(() => parseBlocks(source), [source]);
5965
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: cx("agn-md", className), ...rest, children: blocks.map(renderBlock) });
6129
+ const blocks = import_react104.default.useMemo(() => parseBlocks(source), [source]);
6130
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: cx("agn-md", className), ...rest, children: blocks.map(renderBlock) });
5966
6131
  }
5967
6132
 
5968
6133
  // src/chat/ToolCallCard.jsx
5969
- var import_react104 = __toESM(require("react"), 1);
5970
- var import_jsx_runtime102 = require("react/jsx-runtime");
6134
+ var import_react105 = __toESM(require("react"), 1);
6135
+ var import_jsx_runtime103 = require("react/jsx-runtime");
5971
6136
  var STATUS = { running: { icon: "loader-circle", tone: "info", label: "Running" }, ok: { icon: "check", tone: "ok", label: "Done" }, bad: { icon: "circle-x", tone: "bad", label: "Failed" }, pending: { icon: "clock", tone: "neutral", label: "Pending" } };
5972
6137
  var show = (v) => v == null ? "" : typeof v === "string" ? v : JSON.stringify(v, null, 2);
5973
6138
  var formatDuration = (ms, locale = "tr-TR") => ms == null ? "" : ms < 1e3 ? Math.round(ms) + " ms" : ms < 6e4 ? (ms / 1e3).toLocaleString(locale, { maximumFractionDigits: 1 }) + " s" : Math.floor(ms / 6e4) + ":" + String(Math.round(ms % 6e4 / 1e3)).padStart(2, "0");
5974
6139
  function ToolCallCard({ name, status = "ok", duration, input, output, summary, open, defaultOpen = false, onToggle, locale = "tr-TR", labels, className, ...rest }) {
5975
6140
  const L = { input: "Input", output: "Output", running: "Running", ok: "Done", bad: "Failed", pending: "Pending", ...labels };
5976
6141
  const s = STATUS[status] || STATUS.ok;
5977
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("details", { className: cx("agn-tool", "agn-tool--" + status, className), open: open != null ? open : defaultOpen || void 0, onToggle: (e) => onToggle && onToggle(e.currentTarget.open), ...rest, children: [
5978
- /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("summary", { className: "agn-tool__head agn-focus", children: [
5979
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Icon, { name: "chevron-right", size: 14, className: "agn-tool__caret" }),
5980
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Icon, { name: "wrench", size: 14, className: "agn-tool__icon" }),
5981
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "agn-tool__name", children: name }),
5982
- summary && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "agn-tool__summary", children: summary }),
5983
- /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("span", { className: cx("agn-tool__status", "agn-tool__status--" + s.tone), children: [
5984
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Icon, { name: s.icon, size: 11, className: status === "running" ? "agn-tool__spin" : void 0 }),
6142
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("details", { className: cx("agn-tool", "agn-tool--" + status, className), open: open != null ? open : defaultOpen || void 0, onToggle: (e) => onToggle && onToggle(e.currentTarget.open), ...rest, children: [
6143
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("summary", { className: "agn-tool__head agn-focus", children: [
6144
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Icon, { name: "chevron-right", size: 14, className: "agn-tool__caret" }),
6145
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Icon, { name: "wrench", size: 14, className: "agn-tool__icon" }),
6146
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "agn-tool__name", children: name }),
6147
+ summary && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "agn-tool__summary", children: summary }),
6148
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("span", { className: cx("agn-tool__status", "agn-tool__status--" + s.tone), children: [
6149
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Icon, { name: s.icon, size: 11, className: status === "running" ? "agn-tool__spin" : void 0 }),
5985
6150
  L[status] || s.label
5986
6151
  ] }),
5987
- duration != null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "agn-tool__duration agn-num", children: typeof duration === "number" ? formatDuration(duration, locale) : duration })
6152
+ duration != null && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "agn-tool__duration agn-num", children: typeof duration === "number" ? formatDuration(duration, locale) : duration })
5988
6153
  ] }),
5989
- /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "agn-tool__body", children: [
5990
- input != null && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "agn-tool__section", children: [
5991
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.input }),
5992
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("pre", { className: "agn-tool__pre", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("code", { children: show(input) }) })
6154
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "agn-tool__body", children: [
6155
+ input != null && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "agn-tool__section", children: [
6156
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.input }),
6157
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("pre", { className: "agn-tool__pre", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("code", { children: show(input) }) })
5993
6158
  ] }),
5994
- output != null && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "agn-tool__section", children: [
5995
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.output }),
5996
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("pre", { className: "agn-tool__pre", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("code", { children: show(output) }) })
6159
+ output != null && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "agn-tool__section", children: [
6160
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.output }),
6161
+ /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("pre", { className: "agn-tool__pre", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("code", { children: show(output) }) })
5997
6162
  ] })
5998
6163
  ] })
5999
6164
  ] });
6000
6165
  }
6001
6166
 
6002
6167
  // src/chat/StreamingIndicator.jsx
6003
- var import_react105 = __toESM(require("react"), 1);
6004
- var import_jsx_runtime103 = require("react/jsx-runtime");
6168
+ var import_react106 = __toESM(require("react"), 1);
6169
+ var import_jsx_runtime104 = require("react/jsx-runtime");
6005
6170
  function StreamingIndicator({ label, dots = true, inline, labels, className, ...rest }) {
6006
6171
  const L = { thinking: "Thinking\u2026", ...labels };
6007
6172
  const Tag2 = inline ? "span" : "div";
6008
6173
  return (
6009
6174
  // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
6010
- /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Tag2, { className: cx("agn-streaming", inline && "agn-streaming--inline", className), role: "status", "aria-live": "polite", ...rest, children: [
6011
- dots && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("span", { className: "agn-streaming__dots", "aria-hidden": "true", children: [
6012
- /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("i", {}),
6013
- /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("i", {}),
6014
- /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("i", {})
6175
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(Tag2, { className: cx("agn-streaming", inline && "agn-streaming--inline", className), role: "status", "aria-live": "polite", ...rest, children: [
6176
+ dots && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: "agn-streaming__dots", "aria-hidden": "true", children: [
6177
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("i", {}),
6178
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("i", {}),
6179
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("i", {})
6015
6180
  ] }),
6016
- /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "agn-streaming__text", children: label || L.thinking })
6181
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-streaming__text", children: label || L.thinking })
6017
6182
  ] })
6018
6183
  );
6019
6184
  }
6020
6185
 
6021
6186
  // src/chat/ChatMessage.jsx
6022
- var import_jsx_runtime104 = require("react/jsx-runtime");
6187
+ var import_jsx_runtime105 = require("react/jsx-runtime");
6023
6188
  var TICK = { sending: "clock", sent: "check", delivered: "check-check", read: "check-check", failed: "circle-alert" };
6024
6189
  var initials3 = (name = "") => String(name).trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toLocaleUpperCase("tr-TR")).join("");
6025
6190
  function Structured({ data, onAction }) {
6026
6191
  const act = (a) => onAction && onAction(a.value != null ? a.value : a.label, a);
6027
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__structured", children: [
6028
- data.image && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("figure", { className: "agn-msg__figure", children: [
6029
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { className: "agn-msg__image", src: data.image.src, alt: data.image.alt || "" }),
6030
- data.image.caption && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("figcaption", { children: data.image.caption })
6192
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__structured", children: [
6193
+ data.image && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("figure", { className: "agn-msg__figure", children: [
6194
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("img", { className: "agn-msg__image", src: data.image.src, alt: data.image.alt || "" }),
6195
+ data.image.caption && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("figcaption", { children: data.image.caption })
6031
6196
  ] }),
6032
- data.cards && data.cards.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__cards", children: data.cards.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__card", children: [
6033
- c.image && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { className: "agn-msg__card-image", src: c.image, alt: c.imageAlt || "" }),
6034
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__card-body", children: [
6035
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__card-title", children: c.title }),
6036
- c.text && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__card-text", children: c.text }),
6037
- c.actions && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__card-actions", children: c.actions.map((a, j) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Button, { size: "xs", variant: a.variant || "neutral", onClick: () => act(a), children: a.label }, j)) })
6197
+ data.cards && data.cards.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__cards", children: data.cards.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__card", children: [
6198
+ c.image && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("img", { className: "agn-msg__card-image", src: c.image, alt: c.imageAlt || "" }),
6199
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__card-body", children: [
6200
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__card-title", children: c.title }),
6201
+ c.text && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__card-text", children: c.text }),
6202
+ c.actions && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__card-actions", children: c.actions.map((a, j) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Button, { size: "xs", variant: a.variant || "neutral", onClick: () => act(a), children: a.label }, j)) })
6038
6203
  ] })
6039
6204
  ] }, i)) }),
6040
- data.table && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("table", { className: "agn-msg__table", children: [
6041
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("tr", { children: data.table.columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("th", { children: c }, i)) }) }),
6042
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("tbody", { children: data.table.rows.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("tr", { children: r.map((v, j) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("td", { children: v }, j)) }, i)) })
6205
+ data.table && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("table", { className: "agn-msg__table", children: [
6206
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("tr", { children: data.table.columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("th", { children: c }, i)) }) }),
6207
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("tbody", { children: data.table.rows.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("tr", { children: r.map((v, j) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("td", { children: v }, j)) }, i)) })
6043
6208
  ] }) }),
6044
- data.buttons && data.buttons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__buttons", children: data.buttons.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Button, { size: "sm", variant: b.variant || "neutral", icon: b.icon, onClick: () => act(b), children: b.label }, i)) })
6209
+ data.buttons && data.buttons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__buttons", children: data.buttons.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Button, { size: "sm", variant: b.variant || "neutral", icon: b.icon, onClick: () => act(b), children: b.label }, i)) })
6045
6210
  ] });
6046
6211
  }
6047
6212
  function ChatMessage({ role = "agent", name, time, status, avatar, children, markdown = true, structured, sources, tools, streaming, onAction, labels, className, ...rest }) {
6048
6213
  const L = { sending: "Sending", sent: "Sent", delivered: "Delivered", read: "Read", failed: "Not delivered", sources: "Sources", tools: "tool calls", tool: "tool call", agent: "Agent", you: "You", ...labels };
6049
- if (role === "system") return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: cx("agn-msg agn-msg--system", className), ...rest, children: [
6050
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__system", children }),
6051
- time && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__time", children: time })
6214
+ if (role === "system") return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: cx("agn-msg agn-msg--system", className), ...rest, children: [
6215
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__system", children }),
6216
+ time && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__time", children: time })
6052
6217
  ] });
6053
- const body = typeof children === "string" && markdown ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ChatMarkdown, { source: children }) : children;
6054
- const side = role === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Icon, { name: "bot", size: 14 }) }) : role === "human-agent" || avatar ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__avatar", "aria-hidden": "true", children: typeof avatar === "string" ? initials3(avatar) : avatar || initials3(name) }) : null;
6055
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: cx("agn-msg", "agn-msg--" + role, streaming && "agn-msg--streaming", className), ...rest, children: [
6056
- side && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__side", children: side }),
6057
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__col", children: [
6058
- (name || role === "agent") && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__name", children: name || L.agent }),
6059
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__bubble", children: [
6218
+ const body = typeof children === "string" && markdown ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ChatMarkdown, { source: children }) : children;
6219
+ const side = role === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: "bot", size: 14 }) }) : role === "human-agent" || avatar ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__avatar", "aria-hidden": "true", children: typeof avatar === "string" ? initials3(avatar) : avatar || initials3(name) }) : null;
6220
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: cx("agn-msg", "agn-msg--" + role, streaming && "agn-msg--streaming", className), ...rest, children: [
6221
+ side && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__side", children: side }),
6222
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__col", children: [
6223
+ (name || role === "agent") && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__name", children: name || L.agent }),
6224
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__bubble", children: [
6060
6225
  body,
6061
- streaming && (children == null || children === "" ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(StreamingIndicator, { inline: true }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__cursor", "aria-hidden": "true" }))
6226
+ streaming && (children == null || children === "" ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(StreamingIndicator, { inline: true }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__cursor", "aria-hidden": "true" }))
6062
6227
  ] }),
6063
- structured && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Structured, { data: structured, onAction }),
6064
- tools && tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("details", { className: "agn-msg__tools", children: [
6065
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("summary", { className: "agn-msg__tools-head agn-focus", children: [
6066
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Icon, { name: "chevron-right", size: 12, className: "agn-msg__tools-caret" }),
6067
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Icon, { name: "wrench", size: 12 }),
6228
+ structured && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Structured, { data: structured, onAction }),
6229
+ tools && tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("details", { className: "agn-msg__tools", children: [
6230
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("summary", { className: "agn-msg__tools-head agn-focus", children: [
6231
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: "chevron-right", size: 12, className: "agn-msg__tools-caret" }),
6232
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: "wrench", size: 12 }),
6068
6233
  tools.length,
6069
6234
  " ",
6070
6235
  tools.length === 1 ? L.tool : L.tools
6071
6236
  ] }),
6072
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "agn-msg__tools-body", children: tools.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ToolCallCard, { ...t }, t.id || i)) })
6237
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "agn-msg__tools-body", children: tools.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ToolCallCard, { ...t }, t.id || i)) })
6073
6238
  ] }),
6074
- sources && sources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__sources", children: [
6075
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.sources }),
6076
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("ul", { className: "agn-msg__source-list", children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("li", { children: s.href ? /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("a", { className: "agn-msg__source", href: s.href, target: "_blank", rel: "noopener noreferrer", children: [
6077
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Icon, { name: s.icon || "file-text", size: 11 }),
6239
+ sources && sources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__sources", children: [
6240
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.sources }),
6241
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("ul", { className: "agn-msg__source-list", children: sources.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("li", { children: s.href ? /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("a", { className: "agn-msg__source", href: s.href, target: "_blank", rel: "noopener noreferrer", children: [
6242
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: s.icon || "file-text", size: 11 }),
6078
6243
  s.label
6079
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: "agn-msg__source", children: [
6080
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Icon, { name: s.icon || "file-text", size: 11 }),
6244
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("span", { className: "agn-msg__source", children: [
6245
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: s.icon || "file-text", size: 11 }),
6081
6246
  s.label
6082
6247
  ] }) }, i)) })
6083
6248
  ] }),
6084
- (time || status) && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "agn-msg__meta", children: [
6085
- time && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__time", children: time }),
6086
- status && TICK[status] && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: cx("agn-msg__tick", "agn-msg__tick--" + status), title: L[status], children: [
6087
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Icon, { name: TICK[status], size: 12 }),
6088
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-sr", children: L[status] }),
6089
- status === "failed" && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "agn-msg__tick-text", children: L.failed })
6249
+ (time || status) && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "agn-msg__meta", children: [
6250
+ time && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__time", children: time }),
6251
+ status && TICK[status] && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("span", { className: cx("agn-msg__tick", "agn-msg__tick--" + status), title: L[status], children: [
6252
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: TICK[status], size: 12 }),
6253
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-sr", children: L[status] }),
6254
+ status === "failed" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-msg__tick-text", children: L.failed })
6090
6255
  ] })
6091
6256
  ] })
6092
6257
  ] })
@@ -6094,8 +6259,8 @@ function ChatMessage({ role = "agent", name, time, status, avatar, children, mar
6094
6259
  }
6095
6260
 
6096
6261
  // src/chat/ChatEvent.jsx
6097
- var import_react107 = __toESM(require("react"), 1);
6098
- var import_jsx_runtime105 = (
6262
+ var import_react108 = __toESM(require("react"), 1);
6263
+ var import_jsx_runtime106 = (
6099
6264
  // biome-ignore lint/a11y/useSemanticElements: a live status message, not the result of a calculation; <output> is a form-associated element and changes nothing for AT here
6100
6265
  require("react/jsx-runtime")
6101
6266
  );
@@ -6110,24 +6275,24 @@ var EVENT_KINDS = {
6110
6275
  };
6111
6276
  function ChatEvent({ kind = "info", tone, icon, time, children, className, ...rest }) {
6112
6277
  const k = EVENT_KINDS[kind] || EVENT_KINDS.info;
6113
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: cx("agn-chat-event", "agn-chat-event--" + (tone || k.tone), className), role: "status", ...rest, children: [
6114
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { name: icon || k.icon, size: 12 }),
6115
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-chat-event__text", children: children != null ? children : k.label }),
6116
- time && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { className: "agn-chat-event__time", children: time })
6278
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: cx("agn-chat-event", "agn-chat-event--" + (tone || k.tone), className), role: "status", ...rest, children: [
6279
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Icon, { name: icon || k.icon, size: 12 }),
6280
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "agn-chat-event__text", children: children != null ? children : k.label }),
6281
+ time && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "agn-chat-event__time", children: time })
6117
6282
  ] });
6118
6283
  }
6119
6284
 
6120
6285
  // src/chat/ChatSuggestions.jsx
6121
- var import_react108 = __toESM(require("react"), 1);
6122
- var import_jsx_runtime106 = require("react/jsx-runtime");
6286
+ var import_react109 = __toESM(require("react"), 1);
6287
+ var import_jsx_runtime107 = require("react/jsx-runtime");
6123
6288
  function ChatSuggestions({ items = [], onPick, row, labels, className, ...rest }) {
6124
6289
  const L = { suggestions: "Suggestions", ...labels };
6125
6290
  return (
6126
6291
  // biome-ignore lint/a11y/useSemanticElements: a labelled role=group is the intended semantics for this cluster; <fieldset> brings form semantics, a legend and UA chrome it does not want
6127
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: cx("agn-chat-suggest", row && "agn-chat-suggest--row", className), role: "group", "aria-label": L.suggestions, ...rest, children: items.map((s, i) => {
6292
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: cx("agn-chat-suggest", row && "agn-chat-suggest--row", className), role: "group", "aria-label": L.suggestions, ...rest, children: items.map((s, i) => {
6128
6293
  const item = typeof s === "string" ? { label: s } : s;
6129
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("button", { type: "button", className: "agn-chat-suggest__chip agn-focus", onClick: () => onPick && onPick(item.value != null ? item.value : item.label, item), children: [
6130
- item.icon && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Icon, { name: item.icon, size: 12 }),
6294
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("button", { type: "button", className: "agn-chat-suggest__chip agn-focus", onClick: () => onPick && onPick(item.value != null ? item.value : item.label, item), children: [
6295
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Icon, { name: item.icon, size: 12 }),
6131
6296
  item.label
6132
6297
  ] }, i);
6133
6298
  }) })
@@ -6135,17 +6300,17 @@ function ChatSuggestions({ items = [], onPick, row, labels, className, ...rest }
6135
6300
  }
6136
6301
 
6137
6302
  // src/chat/ChatComposer.jsx
6138
- var import_react109 = __toESM(require("react"), 1);
6139
- var import_jsx_runtime107 = require("react/jsx-runtime");
6303
+ var import_react110 = __toESM(require("react"), 1);
6304
+ var import_jsx_runtime108 = require("react/jsx-runtime");
6140
6305
  var fmtSize2 = (b) => b >= 1048576 ? (b / 1048576).toFixed(1) + " MB" : b >= 1024 ? Math.round(b / 1024) + " KB" : b + " B";
6141
6306
  function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, streaming, disabled, placeholder, attach = true, maxFiles = 5, maxFileSize = 10 * 1048576, files = [], onAttach, onRemoveFile, voice = "off", onDictate, onHandsFree, footnote, toolbar, header, maxRows = 8, labels, className, ...rest }) {
6142
6307
  const L = { placeholder: "Message the agent\u2026", send: "Send", stop: "Stop", attach: "Attach files", attachHint: "Up to 5 files, 10 MB each", dictate: "Dictate", handsFree: "Hands-free voice", listening: "Listening\u2026", speaking: "Speaking\u2026", remove: "Remove", tooMany: "You can attach up to 5 files.", tooLarge: "Each file must be under 10 MB.", ...labels };
6143
- const [own, setOwn] = import_react109.default.useState(defaultValue);
6144
- const [err, setErr] = import_react109.default.useState(null);
6308
+ const [own, setOwn] = import_react110.default.useState(defaultValue);
6309
+ const [err, setErr] = import_react110.default.useState(null);
6145
6310
  const val = value != null ? value : own;
6146
- const ta = import_react109.default.useRef(null);
6147
- const file = import_react109.default.useRef(null);
6148
- const id = import_react109.default.useMemo(() => uid("chatbox"), []);
6311
+ const ta = import_react110.default.useRef(null);
6312
+ const file = import_react110.default.useRef(null);
6313
+ const id = import_react110.default.useMemo(() => uid("chatbox"), []);
6149
6314
  const grow = () => {
6150
6315
  const el = ta.current;
6151
6316
  if (!el) return;
@@ -6153,7 +6318,7 @@ function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, stre
6153
6318
  const line = parseFloat(getComputedStyle(el).lineHeight) || 20;
6154
6319
  el.style.height = Math.min(el.scrollHeight, line * maxRows + 16) + "px";
6155
6320
  };
6156
- import_react109.default.useEffect(grow, [val, maxRows]);
6321
+ import_react110.default.useEffect(grow, [val, maxRows]);
6157
6322
  const set = (v) => {
6158
6323
  if (value == null) setOwn(v);
6159
6324
  onChange && onChange(v);
@@ -6182,16 +6347,16 @@ function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, stre
6182
6347
  onAttach && onAttach(list);
6183
6348
  };
6184
6349
  const canSend = streaming || !disabled && (val.trim().length > 0 || files.length > 0);
6185
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: cx("agn-chatbox", disabled && "agn-chatbox--disabled", className), ...rest, children: [
6186
- /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "agn-chatbox__box", children: [
6187
- header && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "agn-chatbox__header", children: header }),
6188
- files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("ul", { className: "agn-chatbox__files", children: files.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("li", { className: "agn-chatbox__file", children: [
6189
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Icon, { name: "paperclip", size: 11 }),
6190
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "agn-chatbox__file-name", children: f.name }),
6191
- f.size != null && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "agn-chatbox__file-size", children: fmtSize2(f.size) }),
6192
- onRemoveFile && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("button", { type: "button", className: "agn-chatbox__file-x", "aria-label": L.remove + " " + f.name, onClick: () => onRemoveFile(f, i), children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Icon, { name: "x", size: 11 }) })
6350
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: cx("agn-chatbox", disabled && "agn-chatbox--disabled", className), ...rest, children: [
6351
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "agn-chatbox__box", children: [
6352
+ header && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "agn-chatbox__header", children: header }),
6353
+ files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("ul", { className: "agn-chatbox__files", children: files.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("li", { className: "agn-chatbox__file", children: [
6354
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Icon, { name: "paperclip", size: 11 }),
6355
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-chatbox__file-name", children: f.name }),
6356
+ f.size != null && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-chatbox__file-size", children: fmtSize2(f.size) }),
6357
+ onRemoveFile && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("button", { type: "button", className: "agn-chatbox__file-x", "aria-label": L.remove + " " + f.name, onClick: () => onRemoveFile(f, i), children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Icon, { name: "x", size: 11 }) })
6193
6358
  ] }, i)) }),
6194
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
6359
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6195
6360
  "textarea",
6196
6361
  {
6197
6362
  ref: ta,
@@ -6211,182 +6376,182 @@ function ChatComposer({ value, defaultValue = "", onChange, onSend, onStop, stre
6211
6376
  }
6212
6377
  }
6213
6378
  ),
6214
- /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "agn-chatbox__bar", children: [
6215
- /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "agn-chatbox__tools", children: [
6216
- attach && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
6217
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("input", { ref: file, type: "file", multiple: true, className: "agn-sr", tabIndex: -1, "aria-hidden": "true", onChange: pick }),
6218
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ButtonIcon, { icon: "paperclip", label: L.attach + " \xB7 " + L.attachHint, size: "sm", disabled, onClick: () => file.current && file.current.click() })
6379
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "agn-chatbox__bar", children: [
6380
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "agn-chatbox__tools", children: [
6381
+ attach && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
6382
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("input", { ref: file, type: "file", multiple: true, className: "agn-sr", tabIndex: -1, "aria-hidden": "true", onChange: pick }),
6383
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ButtonIcon, { icon: "paperclip", label: L.attach + " \xB7 " + L.attachHint, size: "sm", disabled, onClick: () => file.current && file.current.click() })
6219
6384
  ] }),
6220
- voice !== "off" && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
6221
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ButtonIcon, { icon: "mic", label: L.dictate, size: "sm", disabled, className: cx("agn-chatbox__voice", voice === "listening" && "agn-chatbox__voice--on"), "aria-pressed": voice === "listening", onClick: onDictate }),
6222
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ButtonIcon, { icon: "audio-lines", label: L.handsFree, size: "sm", disabled, className: cx("agn-chatbox__voice", voice === "speaking" && "agn-chatbox__voice--on"), "aria-pressed": voice === "speaking", onClick: onHandsFree }),
6223
- (voice === "listening" || voice === "speaking") && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("span", { className: "agn-chatbox__voice-state", role: "status", children: [
6224
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "agn-chatbox__voice-dot", "aria-hidden": "true" }),
6385
+ voice !== "off" && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
6386
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ButtonIcon, { icon: "mic", label: L.dictate, size: "sm", disabled, className: cx("agn-chatbox__voice", voice === "listening" && "agn-chatbox__voice--on"), "aria-pressed": voice === "listening", onClick: onDictate }),
6387
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ButtonIcon, { icon: "audio-lines", label: L.handsFree, size: "sm", disabled, className: cx("agn-chatbox__voice", voice === "speaking" && "agn-chatbox__voice--on"), "aria-pressed": voice === "speaking", onClick: onHandsFree }),
6388
+ (voice === "listening" || voice === "speaking") && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "agn-chatbox__voice-state", role: "status", children: [
6389
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-chatbox__voice-dot", "aria-hidden": "true" }),
6225
6390
  voice === "listening" ? L.listening : L.speaking
6226
6391
  ] })
6227
6392
  ] }),
6228
- toolbar && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "agn-chatbox__toolbar", children: toolbar }),
6229
- err && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "agn-chatbox__error", role: "alert", children: err })
6393
+ toolbar && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "agn-chatbox__toolbar", children: toolbar }),
6394
+ err && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-chatbox__error", role: "alert", children: err })
6230
6395
  ] }),
6231
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ButtonIcon, { icon: streaming ? "square" : "arrow-up", label: streaming ? L.stop : L.send, variant: streaming ? "destructive-text" : "primary", size: "sm", disabled: !canSend, onClick: send, className: "agn-chatbox__send" })
6396
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ButtonIcon, { icon: streaming ? "square" : "arrow-up", label: streaming ? L.stop : L.send, variant: streaming ? "destructive-text" : "primary", size: "sm", disabled: !canSend, onClick: send, className: "agn-chatbox__send" })
6232
6397
  ] })
6233
6398
  ] }),
6234
- footnote && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "agn-chatbox__footnote", children: footnote })
6399
+ footnote && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "agn-chatbox__footnote", children: footnote })
6235
6400
  ] });
6236
6401
  }
6237
6402
 
6238
6403
  // src/chat/TranscriptPanel.jsx
6239
- var import_react110 = __toESM(require("react"), 1);
6240
- var import_jsx_runtime108 = require("react/jsx-runtime");
6404
+ var import_react111 = __toESM(require("react"), 1);
6405
+ var import_jsx_runtime109 = require("react/jsx-runtime");
6241
6406
  var VERDICT_ICON = { ok: "circle-check", bad: "circle-x", warn: "triangle-alert", neutral: "info", info: "info" };
6242
6407
  function TranscriptPanel({ title, meta, turns = [], verdict, selected, onSelect, maxHeight = 420, locale = "tr-TR", labels, className, ...rest }) {
6243
6408
  const L = { agent: "Agent", customer: "Customer", system: "System", judge: "Judge", latency: "latency", flagged: "Flagged", empty: "No turns", ...labels };
6244
6409
  const Row = onSelect ? "button" : "div";
6245
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("section", { className: cx("agn-transcript", className), "aria-label": typeof title === "string" ? title : void 0, ...rest, children: [
6246
- (title || meta) && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("header", { className: "agn-transcript__head", children: [
6247
- title && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("h3", { className: "agn-transcript__title", children: title }),
6248
- meta && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "agn-transcript__meta", children: meta })
6410
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("section", { className: cx("agn-transcript", className), "aria-label": typeof title === "string" ? title : void 0, ...rest, children: [
6411
+ (title || meta) && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("header", { className: "agn-transcript__head", children: [
6412
+ title && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("h3", { className: "agn-transcript__title", children: title }),
6413
+ meta && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-transcript__meta", children: meta })
6249
6414
  ] }),
6250
- verdict && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: cx("agn-transcript__verdict", "agn-transcript__verdict--" + (verdict.tone || "neutral")), children: [
6251
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Icon, { name: VERDICT_ICON[verdict.tone] || "info", size: 14 }),
6252
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "agn-transcript__verdict-label", children: [
6415
+ verdict && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: cx("agn-transcript__verdict", "agn-transcript__verdict--" + (verdict.tone || "neutral")), children: [
6416
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: VERDICT_ICON[verdict.tone] || "info", size: 14 }),
6417
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "agn-transcript__verdict-label", children: [
6253
6418
  L.judge,
6254
6419
  " \xB7 ",
6255
6420
  verdict.label
6256
6421
  ] }),
6257
- verdict.score != null && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__verdict-score agn-num", children: verdict.score }),
6258
- verdict.summary && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__verdict-text", children: verdict.summary }),
6259
- verdict.dimensions && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("ul", { className: "agn-transcript__dims", children: verdict.dimensions.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("li", { className: cx("agn-transcript__dim", d.pass ? "agn-transcript__dim--ok" : "agn-transcript__dim--bad"), children: [
6260
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Icon, { name: d.pass ? "check" : "x", size: 10 }),
6422
+ verdict.score != null && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__verdict-score agn-num", children: verdict.score }),
6423
+ verdict.summary && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__verdict-text", children: verdict.summary }),
6424
+ verdict.dimensions && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("ul", { className: "agn-transcript__dims", children: verdict.dimensions.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("li", { className: cx("agn-transcript__dim", d.pass ? "agn-transcript__dim--ok" : "agn-transcript__dim--bad"), children: [
6425
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: d.pass ? "check" : "x", size: 10 }),
6261
6426
  d.name
6262
6427
  ] }, i)) })
6263
6428
  ] }),
6264
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("ol", { className: "agn-transcript__turns", style: { maxHeight }, children: [
6429
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("ol", { className: "agn-transcript__turns", style: { maxHeight }, children: [
6265
6430
  turns.map((t, i) => {
6266
6431
  const n = t.n != null ? t.n : i + 1;
6267
6432
  const sel = selected != null && selected === (t.id != null ? t.id : n);
6268
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("li", { className: cx("agn-transcript__turn", "agn-transcript__turn--" + (t.speaker || "agent"), t.flagged && "agn-transcript__turn--flagged", sel && "agn-transcript__turn--selected"), children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Row, { type: onSelect ? "button" : void 0, className: "agn-transcript__row agn-focus-inset", "aria-pressed": onSelect ? sel : void 0, onClick: onSelect ? () => onSelect(t.id != null ? t.id : n, t) : void 0, children: [
6269
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__n agn-num", children: String(n).padStart(2, "0") }),
6270
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__speaker", children: t.name || L[t.speaker] || t.speaker }),
6271
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "agn-transcript__text", children: [
6433
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("li", { className: cx("agn-transcript__turn", "agn-transcript__turn--" + (t.speaker || "agent"), t.flagged && "agn-transcript__turn--flagged", sel && "agn-transcript__turn--selected"), children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Row, { type: onSelect ? "button" : void 0, className: "agn-transcript__row agn-focus-inset", "aria-pressed": onSelect ? sel : void 0, onClick: onSelect ? () => onSelect(t.id != null ? t.id : n, t) : void 0, children: [
6434
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__n agn-num", children: String(n).padStart(2, "0") }),
6435
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__speaker", children: t.name || L[t.speaker] || t.speaker }),
6436
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "agn-transcript__text", children: [
6272
6437
  t.text,
6273
- t.note && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__note", children: t.note })
6438
+ t.note && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__note", children: t.note })
6274
6439
  ] }),
6275
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "agn-transcript__right", children: [
6276
- t.flagged && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "agn-transcript__flag", children: [
6277
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Icon, { name: "flag", size: 11 }),
6440
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "agn-transcript__right", children: [
6441
+ t.flagged && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "agn-transcript__flag", children: [
6442
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: "flag", size: 11 }),
6278
6443
  L.flagged
6279
6444
  ] }),
6280
- t.latencyMs != null && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__latency agn-num", title: L.latency, children: formatDuration(t.latencyMs, locale) }),
6281
- t.time && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "agn-transcript__time agn-num", children: t.time })
6445
+ t.latencyMs != null && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__latency agn-num", title: L.latency, children: formatDuration(t.latencyMs, locale) }),
6446
+ t.time && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "agn-transcript__time agn-num", children: t.time })
6282
6447
  ] })
6283
6448
  ] }) }, t.id != null ? t.id : n);
6284
6449
  }),
6285
- !turns.length && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("li", { className: "agn-transcript__empty", children: L.empty })
6450
+ !turns.length && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("li", { className: "agn-transcript__empty", children: L.empty })
6286
6451
  ] })
6287
6452
  ] });
6288
6453
  }
6289
6454
 
6290
6455
  // src/widgets/ApprovalCard.jsx
6291
- var import_react111 = __toESM(require("react"), 1);
6292
- var import_jsx_runtime109 = require("react/jsx-runtime");
6456
+ var import_react112 = __toESM(require("react"), 1);
6457
+ var import_jsx_runtime110 = require("react/jsx-runtime");
6293
6458
  var STATUS2 = { pending: { tone: "warn", icon: "pause", label: "Paused \xB7 approval" }, approved: { tone: "ok", icon: "circle-check", label: "Approved" }, rejected: { tone: "bad", icon: "circle-x", label: "Rejected" }, queued: { tone: "neutral", icon: "clock", label: "Queued" } };
6294
6459
  function Field({ f, value, onChange, disabled, id }) {
6295
6460
  const set = (v) => onChange && onChange(f.key, v);
6296
6461
  const common = { id, disabled, "aria-describedby": f.help ? id + "-help" : void 0, required: f.required };
6297
6462
  switch (f.type) {
6298
6463
  case "boolean":
6299
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("label", { className: "agn-approval__check", children: [
6300
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("input", { type: "checkbox", checked: !!value, onChange: (e) => set(e.target.checked), ...common }),
6301
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: f.label })
6464
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("label", { className: "agn-approval__check", children: [
6465
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("input", { type: "checkbox", checked: !!value, onChange: (e) => set(e.target.checked), ...common }),
6466
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: f.label })
6302
6467
  ] });
6303
6468
  case "number":
6304
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("input", { className: "agn-approval__input agn-num", type: "number", value: value == null ? "" : value, min: f.min, max: f.max, step: f.step, placeholder: f.placeholder, onChange: (e) => set(e.target.value === "" ? null : Number(e.target.value)), ...common });
6469
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("input", { className: "agn-approval__input agn-num", type: "number", value: value == null ? "" : value, min: f.min, max: f.max, step: f.step, placeholder: f.placeholder, onChange: (e) => set(e.target.value === "" ? null : Number(e.target.value)), ...common });
6305
6470
  case "json":
6306
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("textarea", { className: "agn-approval__input agn-approval__input--json", rows: 4, value: typeof value === "string" ? value : value == null ? "" : JSON.stringify(value, null, 2), spellCheck: false, onChange: (e) => set(e.target.value), ...common });
6471
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("textarea", { className: "agn-approval__input agn-approval__input--json", rows: 4, value: typeof value === "string" ? value : value == null ? "" : JSON.stringify(value, null, 2), spellCheck: false, onChange: (e) => set(e.target.value), ...common });
6307
6472
  case "select":
6308
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("select", { className: "agn-approval__input", value: value == null ? "" : value, onChange: (e) => set(e.target.value), ...common, children: [
6309
- f.placeholder && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("option", { value: "", children: f.placeholder }),
6473
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("select", { className: "agn-approval__input", value: value == null ? "" : value, onChange: (e) => set(e.target.value), ...common, children: [
6474
+ f.placeholder && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("option", { value: "", children: f.placeholder }),
6310
6475
  (f.options || []).map((o) => {
6311
6476
  const opt = typeof o === "string" ? { value: o, label: o } : o;
6312
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("option", { value: opt.value, children: opt.label }, opt.value);
6477
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("option", { value: opt.value, children: opt.label }, opt.value);
6313
6478
  })
6314
6479
  ] });
6315
6480
  default:
6316
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("input", { className: "agn-approval__input", type: "text", value: value == null ? "" : value, placeholder: f.placeholder, onChange: (e) => set(e.target.value), ...common });
6481
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("input", { className: "agn-approval__input", type: "text", value: value == null ? "" : value, placeholder: f.placeholder, onChange: (e) => set(e.target.value), ...common });
6317
6482
  }
6318
6483
  }
6319
6484
  function ApprovalCard({ agent, runId, tenant, requestedAt, requester, reason, proposal = [], fields = [], values: valProp, onChange, status = "pending", queuePosition, decidedBy, decidedAt, onApprove, onReject, onAsk, onAlways, actions, variant = "approval", loading: loading2, compact, labels, className, ...rest }) {
6320
6485
  const perm = variant === "permission";
6321
6486
  const L = { eyebrow: perm ? "Permission request" : "Human approval", allowOnce: "Allow once", always: "Always allow", deny: "Deny", reason: "Why the agent stopped", proposes: "Agent proposes", decision: "Your decision", approve: "Approve", reject: "Reject", ask: "Ask the agent", queued: "Queued", ahead: "ahead", by: "by", pending: "Paused \xB7 approval", approved: "Approved", rejected: "Rejected", ...labels };
6322
- const [own, setOwn] = import_react111.default.useState(() => Object.fromEntries(fields.map((f) => [f.key, f.value])));
6487
+ const [own, setOwn] = import_react112.default.useState(() => Object.fromEntries(fields.map((f) => [f.key, f.value])));
6323
6488
  const values = valProp || own;
6324
6489
  const change = (k, v) => {
6325
6490
  if (!valProp) setOwn((o) => ({ ...o, [k]: v }));
6326
6491
  onChange && onChange(k, v, { ...values, [k]: v });
6327
6492
  };
6328
- const id = import_react111.default.useMemo(() => uid("approval"), []);
6493
+ const id = import_react112.default.useMemo(() => uid("approval"), []);
6329
6494
  const s = STATUS2[status] || STATUS2.pending;
6330
6495
  const open = status === "pending";
6331
6496
  const decide = (fn) => () => fn && fn(values);
6332
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("section", { className: cx("agn-approval", "agn-approval--" + status, perm && "agn-approval--permission", compact && "agn-approval--compact", className), "aria-labelledby": id + "-t", ...rest, children: [
6333
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("header", { className: "agn-approval__head", children: [
6334
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "agn-approval__heading", children: [
6335
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-eyebrow", children: L.eyebrow }),
6336
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("h3", { id: id + "-t", className: "agn-approval__title", children: agent }),
6337
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-approval__meta", children: [runId, tenant, requestedAt].filter(Boolean).map((x, i) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: x }, i)) })
6497
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("section", { className: cx("agn-approval", "agn-approval--" + status, perm && "agn-approval--permission", compact && "agn-approval--compact", className), "aria-labelledby": id + "-t", ...rest, children: [
6498
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("header", { className: "agn-approval__head", children: [
6499
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "agn-approval__heading", children: [
6500
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-eyebrow", children: L.eyebrow }),
6501
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("h3", { id: id + "-t", className: "agn-approval__title", children: agent }),
6502
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-approval__meta", children: [runId, tenant, requestedAt].filter(Boolean).map((x, i) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: x }, i)) })
6338
6503
  ] }),
6339
- !perm && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: cx("agn-approval__status", "agn-approval__status--" + s.tone), children: [
6340
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: s.icon, size: 12 }),
6504
+ !perm && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: cx("agn-approval__status", "agn-approval__status--" + s.tone), children: [
6505
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Icon, { name: s.icon, size: 12 }),
6341
6506
  status === "queued" && queuePosition != null ? `${L.queued} (${queuePosition} ${L.ahead})` : L[status] || s.label
6342
6507
  ] })
6343
6508
  ] }),
6344
- reason && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "agn-approval__reason", role: "note", children: [
6345
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: "triangle-alert", size: 16 }),
6346
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
6347
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-approval__reason-label", children: L.reason }),
6348
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-approval__reason-text", children: reason })
6509
+ reason && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "agn-approval__reason", role: "note", children: [
6510
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Icon, { name: "triangle-alert", size: 16 }),
6511
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { children: [
6512
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-approval__reason-label", children: L.reason }),
6513
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-approval__reason-text", children: reason })
6349
6514
  ] })
6350
6515
  ] }),
6351
- proposal.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "agn-approval__section", children: [
6352
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.proposes }),
6353
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("dl", { className: "agn-approval__kv", children: proposal.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "agn-approval__kv-row", children: [
6354
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("dt", { children: p.label }),
6355
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("dd", { className: p.mono ? "agn-mono" : void 0, children: p.value })
6516
+ proposal.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "agn-approval__section", children: [
6517
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.proposes }),
6518
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("dl", { className: "agn-approval__kv", children: proposal.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "agn-approval__kv-row", children: [
6519
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("dt", { children: p.label }),
6520
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("dd", { className: p.mono ? "agn-mono" : void 0, children: p.value })
6356
6521
  ] }, i)) })
6357
6522
  ] }),
6358
- fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "agn-approval__section", children: [
6359
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.decision }),
6360
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "agn-approval__form", children: fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: cx("agn-approval__field", f.type === "boolean" && "agn-approval__field--check"), children: [
6361
- f.type !== "boolean" && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("label", { className: "agn-approval__label", htmlFor: id + "-" + f.key, children: [
6523
+ fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "agn-approval__section", children: [
6524
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: L.decision }),
6525
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "agn-approval__form", children: fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: cx("agn-approval__field", f.type === "boolean" && "agn-approval__field--check"), children: [
6526
+ f.type !== "boolean" && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("label", { className: "agn-approval__label", htmlFor: id + "-" + f.key, children: [
6362
6527
  f.label,
6363
- f.required && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { "aria-hidden": "true", children: " *" })
6528
+ f.required && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { "aria-hidden": "true", children: " *" })
6364
6529
  ] }),
6365
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Field, { f, id: id + "-" + f.key, value: values[f.key], onChange: change, disabled: !open || loading2 }),
6366
- f.help && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { id: id + "-" + f.key + "-help", className: "agn-approval__help", children: f.help })
6530
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Field, { f, id: id + "-" + f.key, value: values[f.key], onChange: change, disabled: !open || loading2 }),
6531
+ f.help && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { id: id + "-" + f.key + "-help", className: "agn-approval__help", children: f.help })
6367
6532
  ] }, f.key)) })
6368
6533
  ] }),
6369
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("footer", { className: "agn-approval__foot", children: [
6370
- open && actions && actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: a.variant || "neutral", icon: a.icon, loading: a.loading, disabled: loading2 || a.disabled, onClick: () => a.onClick && a.onClick(values), children: a.label }, a.id || i)),
6371
- open && !actions && perm && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
6372
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "primary", icon: "check", loading: loading2, onClick: decide(onApprove), children: L.allowOnce }),
6373
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "neutral", icon: "check-check", disabled: loading2, onClick: decide(onAlways), children: L.always }),
6374
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "destructive-text", icon: "x", disabled: loading2, onClick: decide(onReject), children: L.deny })
6534
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("footer", { className: "agn-approval__foot", children: [
6535
+ open && actions && actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: a.variant || "neutral", icon: a.icon, loading: a.loading, disabled: loading2 || a.disabled, onClick: () => a.onClick && a.onClick(values), children: a.label }, a.id || i)),
6536
+ open && !actions && perm && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_jsx_runtime110.Fragment, { children: [
6537
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: "primary", icon: "check", loading: loading2, onClick: decide(onApprove), children: L.allowOnce }),
6538
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: "neutral", icon: "check-check", disabled: loading2, onClick: decide(onAlways), children: L.always }),
6539
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: "destructive-text", icon: "x", disabled: loading2, onClick: decide(onReject), children: L.deny })
6375
6540
  ] }),
6376
- open && !actions && !perm && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
6377
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "success", icon: "check", loading: loading2, onClick: decide(onApprove), children: L.approve }),
6378
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "destructive-text", icon: "x", disabled: loading2, onClick: decide(onReject), children: L.reject }),
6379
- onAsk && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "neutral", icon: "message-square", disabled: loading2, onClick: decide(onAsk), children: L.ask })
6541
+ open && !actions && !perm && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_jsx_runtime110.Fragment, { children: [
6542
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: "success", icon: "check", loading: loading2, onClick: decide(onApprove), children: L.approve }),
6543
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: "destructive-text", icon: "x", disabled: loading2, onClick: decide(onReject), children: L.reject }),
6544
+ onAsk && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Button, { variant: "neutral", icon: "message-square", disabled: loading2, onClick: decide(onAsk), children: L.ask })
6380
6545
  ] }),
6381
- status === "queued" && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "agn-approval__note", children: [
6382
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: "clock", size: 14 }),
6546
+ status === "queued" && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: "agn-approval__note", children: [
6547
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Icon, { name: "clock", size: 14 }),
6383
6548
  queuePosition != null ? `${L.queued} (${queuePosition} ${L.ahead})` : L.queued
6384
6549
  ] }),
6385
- (status === "approved" || status === "rejected") && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: cx("agn-approval__note", "agn-approval__note--" + s.tone), children: [
6386
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Icon, { name: s.icon, size: 14 }),
6550
+ (status === "approved" || status === "rejected") && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: cx("agn-approval__note", "agn-approval__note--" + s.tone), children: [
6551
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Icon, { name: s.icon, size: 14 }),
6387
6552
  L[status],
6388
6553
  decidedBy && ` ${L.by} ${decidedBy}`,
6389
- decidedAt && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "agn-approval__note-time agn-num", children: [
6554
+ decidedAt && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: "agn-approval__note-time agn-num", children: [
6390
6555
  " \xB7 ",
6391
6556
  decidedAt
6392
6557
  ] })
@@ -6396,11 +6561,11 @@ function ApprovalCard({ agent, runId, tenant, requestedAt, requester, reason, pr
6396
6561
  }
6397
6562
 
6398
6563
  // src/widgets/RunTimeline.jsx
6399
- var import_react113 = __toESM(require("react"), 1);
6564
+ var import_react114 = __toESM(require("react"), 1);
6400
6565
 
6401
6566
  // src/widgets/RunStatus.jsx
6402
- var import_react112 = __toESM(require("react"), 1);
6403
- var import_jsx_runtime110 = require("react/jsx-runtime");
6567
+ var import_react113 = __toESM(require("react"), 1);
6568
+ var import_jsx_runtime111 = require("react/jsx-runtime");
6404
6569
  var RUN_STATUS = {
6405
6570
  queued: { tone: "neutral", icon: "clock", label: "Queued" },
6406
6571
  running: { tone: "info", icon: "loader-circle", label: "Running", spin: true },
@@ -6416,16 +6581,16 @@ var RUN_STATUS = {
6416
6581
  function RunStatus({ status = "queued", detail, since, size = "md", labels, className, ...rest }) {
6417
6582
  const L = { since: "since", ...Object.fromEntries(Object.entries(RUN_STATUS).map(([k, v]) => [k, v.label])), ...labels };
6418
6583
  const s = RUN_STATUS[status] || RUN_STATUS.queued;
6419
- return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: cx("agn-run-status", "agn-run-status--" + s.tone, size !== "md" && "agn-run-status--" + size, className), ...rest, children: [
6420
- /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: "agn-run-status__tag", children: [
6421
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Icon, { name: s.icon, size: size === "sm" ? 11 : 12, className: s.spin ? "agn-run-status__spin" : void 0 }),
6584
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: cx("agn-run-status", "agn-run-status--" + s.tone, size !== "md" && "agn-run-status--" + size, className), ...rest, children: [
6585
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "agn-run-status__tag", children: [
6586
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Icon, { name: s.icon, size: size === "sm" ? 11 : 12, className: s.spin ? "agn-run-status__spin" : void 0 }),
6422
6587
  L[status] || s.label,
6423
- detail && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: "agn-run-status__detail", children: [
6588
+ detail && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "agn-run-status__detail", children: [
6424
6589
  " \xB7 ",
6425
6590
  detail
6426
6591
  ] })
6427
6592
  ] }),
6428
- since && /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: "agn-run-status__since agn-num", children: [
6593
+ since && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "agn-run-status__since agn-num", children: [
6429
6594
  L.since,
6430
6595
  " ",
6431
6596
  since
@@ -6451,14 +6616,14 @@ var fmtClock = (s) => {
6451
6616
  var initials4 = (name = "") => String(name).trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toLocaleUpperCase("tr-TR")).join("");
6452
6617
 
6453
6618
  // src/widgets/RunTimeline.jsx
6454
- var import_jsx_runtime111 = require("react/jsx-runtime");
6619
+ var import_jsx_runtime112 = require("react/jsx-runtime");
6455
6620
  function ticks(total, n = 4) {
6456
6621
  const step = total / n;
6457
6622
  return Array.from({ length: n + 1 }, (_, i) => i * step);
6458
6623
  }
6459
6624
  function useTickCount(ref) {
6460
- const [n, setN] = import_react113.default.useState(4);
6461
- import_react113.default.useEffect(() => {
6625
+ const [n, setN] = import_react114.default.useState(4);
6626
+ import_react114.default.useEffect(() => {
6462
6627
  const el = ref.current;
6463
6628
  if (!el || typeof ResizeObserver === "undefined") return void 0;
6464
6629
  const ro = new ResizeObserver((es) => {
@@ -6476,47 +6641,47 @@ function RunTimeline({ steps = [], total: totalProp, selected, onSelect, showCos
6476
6641
  const total = totalProp || Math.max(1, ...steps.map((s) => (s.start || 0) + (s.duration || 0)));
6477
6642
  const Row = onSelect ? "button" : "div";
6478
6643
  const sumCost = steps.reduce((a, s) => a + (s.cost || 0), 0), sumTok = steps.reduce((a, s) => a + (s.tokens || 0), 0);
6479
- const scaleRef = import_react113.default.useRef(null);
6644
+ const scaleRef = import_react114.default.useRef(null);
6480
6645
  const tickN = useTickCount(scaleRef);
6481
6646
  const cols = cx("agn-rt__grid", !showTokens && "agn-rt__grid--no-tokens", !showCost && "agn-rt__grid--no-cost");
6482
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: cx("agn-rt", className), role: "table", "aria-label": L.step + "s", ...rest, children: [
6483
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: cx("agn-rt__head", cols), role: "row", children: [
6484
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "columnheader", children: L.step }),
6485
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "columnheader", className: "agn-rt__scale", ref: scaleRef, children: ticks(total, tickN).map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "agn-rt__tick agn-num", style: { left: t / total * 100 + "%" }, children: formatDuration(t, locale) }, i)) }),
6486
- showTokens && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "columnheader", className: "agn-rt__num", children: L.tokens }),
6487
- showCost && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "columnheader", className: "agn-rt__num", children: L.cost })
6647
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: cx("agn-rt", className), role: "table", "aria-label": L.step + "s", ...rest, children: [
6648
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: cx("agn-rt__head", cols), role: "row", children: [
6649
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "columnheader", children: L.step }),
6650
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "columnheader", className: "agn-rt__scale", ref: scaleRef, children: ticks(total, tickN).map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-rt__tick agn-num", style: { left: t / total * 100 + "%" }, children: formatDuration(t, locale) }, i)) }),
6651
+ showTokens && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "columnheader", className: "agn-rt__num", children: L.tokens }),
6652
+ showCost && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "columnheader", className: "agn-rt__num", children: L.cost })
6488
6653
  ] }),
6489
6654
  steps.map((s, i) => {
6490
6655
  const st = RUN_STATUS[s.status] || RUN_STATUS.completed;
6491
6656
  const id = s.id != null ? s.id : i;
6492
6657
  const sel = selected != null && selected === id;
6493
6658
  const left = (s.start || 0) / total * 100, width = Math.max(0.6, (s.duration || 0) / total * 100);
6494
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Row, { type: onSelect ? "button" : void 0, role: "row", className: cx("agn-rt__row", cols, "agn-rt__row--" + st.tone, sel && "agn-rt__row--selected", "agn-focus-inset"), "aria-pressed": onSelect ? sel : void 0, onClick: onSelect ? () => onSelect(id, s) : void 0, children: [
6495
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { role: "cell", className: "agn-rt__name", children: [
6496
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "agn-rt__n agn-num", children: String(i + 1).padStart(2, "0") }),
6497
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "agn-rt__label", children: [
6498
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "agn-rt__title", children: s.name }),
6499
- s.kind && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "agn-rt__kind", children: s.kind })
6659
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(Row, { type: onSelect ? "button" : void 0, role: "row", className: cx("agn-rt__row", cols, "agn-rt__row--" + st.tone, sel && "agn-rt__row--selected", "agn-focus-inset"), "aria-pressed": onSelect ? sel : void 0, onClick: onSelect ? () => onSelect(id, s) : void 0, children: [
6660
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("span", { role: "cell", className: "agn-rt__name", children: [
6661
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-rt__n agn-num", children: String(i + 1).padStart(2, "0") }),
6662
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("span", { className: "agn-rt__label", children: [
6663
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-rt__title", children: s.name }),
6664
+ s.kind && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-rt__kind", children: s.kind })
6500
6665
  ] }),
6501
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Icon, { name: st.icon, size: 12, className: cx("agn-rt__icon", st.spin && "agn-rt__spin"), title: st.label })
6666
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Icon, { name: st.icon, size: 12, className: cx("agn-rt__icon", st.spin && "agn-rt__spin"), title: st.label })
6502
6667
  ] }),
6503
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", className: "agn-rt__track", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "agn-rt__bar", style: { left: left + "%", width: width + "%" }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "agn-rt__dur agn-num", children: formatDuration(s.duration || 0, locale) }) }) }),
6504
- showTokens && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", className: "agn-rt__num", children: s.tokens != null ? fmtInt(s.tokens, locale) : "\u2013" }),
6505
- showCost && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", className: "agn-rt__num", children: s.cost != null ? fmtMoney(s.cost, locale, currency) : "\u2013" })
6668
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", className: "agn-rt__track", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-rt__bar", style: { left: left + "%", width: width + "%" }, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-rt__dur agn-num", children: formatDuration(s.duration || 0, locale) }) }) }),
6669
+ showTokens && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", className: "agn-rt__num", children: s.tokens != null ? fmtInt(s.tokens, locale) : "\u2013" }),
6670
+ showCost && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", className: "agn-rt__num", children: s.cost != null ? fmtMoney(s.cost, locale, currency) : "\u2013" })
6506
6671
  ] }, id);
6507
6672
  }),
6508
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: cx("agn-rt__foot", cols), role: "row", children: [
6509
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", children: L.total }),
6510
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", className: "agn-rt__total agn-num", children: formatDuration(total, locale) }),
6511
- showTokens && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", className: "agn-rt__num", children: fmtInt(sumTok, locale) }),
6512
- showCost && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "cell", className: "agn-rt__num", children: fmtMoney(sumCost, locale, currency) })
6673
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: cx("agn-rt__foot", cols), role: "row", children: [
6674
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", children: L.total }),
6675
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", className: "agn-rt__total agn-num", children: formatDuration(total, locale) }),
6676
+ showTokens && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", className: "agn-rt__num", children: fmtInt(sumTok, locale) }),
6677
+ showCost && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { role: "cell", className: "agn-rt__num", children: fmtMoney(sumCost, locale, currency) })
6513
6678
  ] })
6514
6679
  ] });
6515
6680
  }
6516
6681
 
6517
6682
  // src/widgets/TraceSpans.jsx
6518
- var import_react114 = __toESM(require("react"), 1);
6519
- var import_jsx_runtime112 = require("react/jsx-runtime");
6683
+ var import_react115 = __toESM(require("react"), 1);
6684
+ var import_jsx_runtime113 = require("react/jsx-runtime");
6520
6685
  var SPAN_KINDS = ["llm", "tool", "http", "workflow", "db", "other"];
6521
6686
  function flatten3(spans, depth = 0, out = [], collapsed) {
6522
6687
  spans.forEach((s, i) => {
@@ -6528,9 +6693,9 @@ function flatten3(spans, depth = 0, out = [], collapsed) {
6528
6693
  }
6529
6694
  function TraceSpans({ spans = [], total: totalProp, selected, onSelect, locale = "tr-TR", labels, className, ...rest }) {
6530
6695
  const L = { spans: "Spans", collapse: "Collapse", expand: "Expand", error: "error", ...labels };
6531
- const [collapsed, setCollapsed] = import_react114.default.useState(() => /* @__PURE__ */ new Set());
6532
- const rows = import_react114.default.useMemo(() => flatten3(spans, 0, [], collapsed), [spans, collapsed]);
6533
- const all = import_react114.default.useMemo(() => flatten3(spans, 0, [], /* @__PURE__ */ new Set()), [spans]);
6696
+ const [collapsed, setCollapsed] = import_react115.default.useState(() => /* @__PURE__ */ new Set());
6697
+ const rows = import_react115.default.useMemo(() => flatten3(spans, 0, [], collapsed), [spans, collapsed]);
6698
+ const all = import_react115.default.useMemo(() => flatten3(spans, 0, [], /* @__PURE__ */ new Set()), [spans]);
6534
6699
  const total = totalProp || Math.max(1, ...all.map((s) => (s.start || 0) + (s.duration || 0)));
6535
6700
  const toggle = (id) => setCollapsed((c) => {
6536
6701
  const n = new Set(c);
@@ -6538,8 +6703,8 @@ function TraceSpans({ spans = [], total: totalProp, selected, onSelect, locale =
6538
6703
  return n;
6539
6704
  });
6540
6705
  const Row = onSelect ? "button" : "div";
6541
- const treeRef = import_react114.default.useRef(null);
6542
- const [focusId, setFocusId] = import_react114.default.useState(null);
6706
+ const treeRef = import_react115.default.useRef(null);
6707
+ const [focusId, setFocusId] = import_react115.default.useState(null);
6543
6708
  const focusIdx = Math.max(0, rows.findIndex((r) => r.id === (focusId != null ? focusId : selected)));
6544
6709
  const focusAt = (i) => {
6545
6710
  const n = Math.max(0, Math.min(rows.length - 1, i));
@@ -6588,88 +6753,88 @@ function TraceSpans({ spans = [], total: totalProp, selected, onSelect, locale =
6588
6753
  default:
6589
6754
  }
6590
6755
  };
6591
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { ref: treeRef, className: cx("agn-spans", className), role: "tree", "aria-label": L.spans, ...rest, children: [
6592
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "agn-spans__scale", "aria-hidden": "true", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__tick agn-num", style: { left: f * 100 + "%" }, children: formatDuration(total * f, locale) }, f)) }),
6756
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { ref: treeRef, className: cx("agn-spans", className), role: "tree", "aria-label": L.spans, ...rest, children: [
6757
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "agn-spans__scale", "aria-hidden": "true", children: [0, 0.25, 0.5, 0.75, 1].map((f) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__tick agn-num", style: { left: f * 100 + "%" }, children: formatDuration(total * f, locale) }, f)) }),
6593
6758
  rows.map((s, i) => {
6594
6759
  const sel = selected != null && selected === s.id;
6595
6760
  const kind = SPAN_KINDS.includes(s.kind) ? s.kind : "other";
6596
6761
  const left = (s.start || 0) / total * 100, width = Math.max(0.5, (s.duration || 0) / total * 100);
6597
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { role: "treeitem", "aria-level": s.depth + 1, "aria-expanded": s.hasChildren ? !collapsed.has(s.id) : void 0, "aria-selected": onSelect ? sel : void 0, "data-index": i, tabIndex: i === focusIdx ? 0 : -1, onKeyDown: (e) => onKey(e, s, i), onFocus: () => setFocusId(s.id), className: cx("agn-spans__row", "agn-focus-inset", "agn-spans__row--" + kind, s.status === "bad" && "agn-spans__row--bad", sel && "agn-spans__row--selected"), children: [
6598
- /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("span", { className: "agn-spans__name", style: { paddingLeft: s.depth * 16 }, children: [
6599
- s.hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("button", { type: "button", className: "agn-spans__caret", tabIndex: -1, "aria-label": collapsed.has(s.id) ? L.expand : L.collapse, onClick: () => toggle(s.id), children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Icon, { name: "chevron-right", size: 12, className: cx(!collapsed.has(s.id) && "agn-spans__caret--open") }) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__caret agn-spans__caret--leaf" }),
6600
- /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(Row, { type: onSelect ? "button" : void 0, tabIndex: onSelect ? -1 : void 0, className: "agn-spans__label", onClick: onSelect ? () => onSelect(s.id, s) : void 0, children: [
6601
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__title", children: s.name }),
6602
- s.service && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__service", children: s.service }),
6603
- s.status === "bad" && /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("span", { className: "agn-spans__err", children: [
6604
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Icon, { name: "circle-x", size: 11 }),
6762
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { role: "treeitem", "aria-level": s.depth + 1, "aria-expanded": s.hasChildren ? !collapsed.has(s.id) : void 0, "aria-selected": onSelect ? sel : void 0, "data-index": i, tabIndex: i === focusIdx ? 0 : -1, onKeyDown: (e) => onKey(e, s, i), onFocus: () => setFocusId(s.id), className: cx("agn-spans__row", "agn-focus-inset", "agn-spans__row--" + kind, s.status === "bad" && "agn-spans__row--bad", sel && "agn-spans__row--selected"), children: [
6763
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("span", { className: "agn-spans__name", style: { paddingLeft: s.depth * 16 }, children: [
6764
+ s.hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("button", { type: "button", className: "agn-spans__caret", tabIndex: -1, "aria-label": collapsed.has(s.id) ? L.expand : L.collapse, onClick: () => toggle(s.id), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Icon, { name: "chevron-right", size: 12, className: cx(!collapsed.has(s.id) && "agn-spans__caret--open") }) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__caret agn-spans__caret--leaf" }),
6765
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Row, { type: onSelect ? "button" : void 0, tabIndex: onSelect ? -1 : void 0, className: "agn-spans__label", onClick: onSelect ? () => onSelect(s.id, s) : void 0, children: [
6766
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__title", children: s.name }),
6767
+ s.service && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__service", children: s.service }),
6768
+ s.status === "bad" && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("span", { className: "agn-spans__err", children: [
6769
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Icon, { name: "circle-x", size: 11 }),
6605
6770
  L.error
6606
6771
  ] })
6607
6772
  ] })
6608
6773
  ] }),
6609
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__track", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__bar", style: { left: left + "%", width: width + "%" } }) }),
6610
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agn-spans__dur agn-num", children: formatDuration(s.duration || 0, locale) })
6774
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__track", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__bar", style: { left: left + "%", width: width + "%" } }) }),
6775
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-spans__dur agn-num", children: formatDuration(s.duration || 0, locale) })
6611
6776
  ] }, s.id);
6612
6777
  })
6613
6778
  ] });
6614
6779
  }
6615
6780
 
6616
6781
  // src/widgets/AgentRunCard.jsx
6617
- var import_react115 = __toESM(require("react"), 1);
6618
- var import_jsx_runtime113 = require("react/jsx-runtime");
6782
+ var import_react116 = __toESM(require("react"), 1);
6783
+ var import_jsx_runtime114 = require("react/jsx-runtime");
6619
6784
  var TRIGGER = { manual: { icon: "play", label: "Manual" }, webhook: { icon: "webhook", label: "Webhook" }, schedule: { icon: "calendar-clock", label: "Schedule" }, call: { icon: "phone", label: "Phone call" }, chat: { icon: "message-square", label: "Chat" }, api: { icon: "code", label: "API" } };
6620
6785
  var BAR_TONE = { running: "signal", completed: "ok", failed: "bad", paused: "warn", cancelled: "neutral", queued: "neutral" };
6621
6786
  function AgentRunCard({ agent, product = "platform", runId, tenant, trigger = "manual", status = "queued", since, started, duration, steps, cost, tokens, selected, onStop, onRetry, onOpen, locale = "tr-TR", currency = "TRY", labels, className, ...rest }) {
6622
6787
  const L = { stop: "Stop", retry: "Retry", open: "Open", duration: "Duration", steps: "Steps", cost: "Cost", tokens: "Tokens", started: "Started", ...Object.fromEntries(Object.entries(TRIGGER).map(([k, v]) => [k, v.label])), ...labels };
6623
6788
  const t = TRIGGER[trigger] || TRIGGER.manual;
6624
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("article", { className: cx("agn-run-card", "agn-run-card--" + status, selected && "agn-run-card--selected", className), ...rest, children: [
6625
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("header", { className: "agn-run-card__head", children: [
6626
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-run-card__icon", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(ProductIcon, { product, size: 16 }) }),
6627
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "agn-run-card__heading", children: [
6628
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("h3", { className: "agn-run-card__title", children: agent }),
6629
- runId && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "agn-run-card__id", children: runId })
6789
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("article", { className: cx("agn-run-card", "agn-run-card--" + status, selected && "agn-run-card--selected", className), ...rest, children: [
6790
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("header", { className: "agn-run-card__head", children: [
6791
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "agn-run-card__icon", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(ProductIcon, { product, size: 16 }) }),
6792
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "agn-run-card__heading", children: [
6793
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("h3", { className: "agn-run-card__title", children: agent }),
6794
+ runId && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "agn-run-card__id", children: runId })
6630
6795
  ] }),
6631
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(RunStatus, { status, since, size: "sm" })
6796
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RunStatus, { status, since, size: "sm" })
6632
6797
  ] }),
6633
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "agn-run-card__meta", children: [
6634
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("span", { children: [
6635
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Icon, { name: t.icon, size: 12 }),
6798
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "agn-run-card__meta", children: [
6799
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("span", { children: [
6800
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Icon, { name: t.icon, size: 12 }),
6636
6801
  L[trigger] || t.label
6637
6802
  ] }),
6638
- started && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("span", { children: [
6639
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Icon, { name: "clock", size: 12 }),
6803
+ started && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("span", { children: [
6804
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Icon, { name: "clock", size: 12 }),
6640
6805
  started
6641
6806
  ] }),
6642
- tenant && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("span", { children: [
6643
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Icon, { name: "building-2", size: 12 }),
6807
+ tenant && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("span", { children: [
6808
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Icon, { name: "building-2", size: 12 }),
6644
6809
  tenant
6645
6810
  ] })
6646
6811
  ] }),
6647
- steps && steps.total > 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(ProgressBar, { size: "sm", tone: BAR_TONE[status] || "neutral", value: steps.done || 0, max: steps.total, label: L.steps, showValue: true, valueText: `${steps.done || 0} / ${steps.total}` }),
6648
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("dl", { className: "agn-run-card__stats", children: [
6649
- duration != null && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
6650
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("dt", { children: L.duration }),
6651
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("dd", { className: "agn-num", children: typeof duration === "number" ? formatDuration(duration, locale) : duration })
6812
+ steps && steps.total > 0 && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(ProgressBar, { size: "sm", tone: BAR_TONE[status] || "neutral", value: steps.done || 0, max: steps.total, label: L.steps, showValue: true, valueText: `${steps.done || 0} / ${steps.total}` }),
6813
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("dl", { className: "agn-run-card__stats", children: [
6814
+ duration != null && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { children: [
6815
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("dt", { children: L.duration }),
6816
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("dd", { className: "agn-num", children: typeof duration === "number" ? formatDuration(duration, locale) : duration })
6652
6817
  ] }),
6653
- cost != null && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
6654
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("dt", { children: L.cost }),
6655
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("dd", { className: "agn-num", children: fmtMoney(cost, locale, currency) })
6818
+ cost != null && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { children: [
6819
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("dt", { children: L.cost }),
6820
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("dd", { className: "agn-num", children: fmtMoney(cost, locale, currency) })
6656
6821
  ] }),
6657
- tokens != null && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { children: [
6658
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("dt", { children: L.tokens }),
6659
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("dd", { className: "agn-num", children: fmtInt(tokens, locale) })
6822
+ tokens != null && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { children: [
6823
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("dt", { children: L.tokens }),
6824
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("dd", { className: "agn-num", children: fmtInt(tokens, locale) })
6660
6825
  ] })
6661
6826
  ] }),
6662
- (onStop || onRetry || onOpen) && /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("footer", { className: "agn-run-card__foot", children: [
6663
- onStop && (status === "running" || status === "paused" || status === "queued") && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Button, { size: "sm", variant: "destructive-text", icon: "square", onClick: onStop, children: L.stop }),
6664
- onRetry && (status === "failed" || status === "cancelled") && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Button, { size: "sm", icon: "rotate-ccw", onClick: onRetry, children: L.retry }),
6665
- onOpen && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Button, { size: "sm", variant: "ghost", iconRight: "arrow-right", onClick: onOpen, className: "agn-run-card__open", children: L.open })
6827
+ (onStop || onRetry || onOpen) && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("footer", { className: "agn-run-card__foot", children: [
6828
+ onStop && (status === "running" || status === "paused" || status === "queued") && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Button, { size: "sm", variant: "destructive-text", icon: "square", onClick: onStop, children: L.stop }),
6829
+ onRetry && (status === "failed" || status === "cancelled") && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Button, { size: "sm", icon: "rotate-ccw", onClick: onRetry, children: L.retry }),
6830
+ onOpen && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Button, { size: "sm", variant: "ghost", iconRight: "arrow-right", onClick: onOpen, className: "agn-run-card__open", children: L.open })
6666
6831
  ] })
6667
6832
  ] });
6668
6833
  }
6669
6834
 
6670
6835
  // src/widgets/CostBars.jsx
6671
- var import_react116 = __toESM(require("react"), 1);
6672
- var import_jsx_runtime114 = require("react/jsx-runtime");
6836
+ var import_react117 = __toESM(require("react"), 1);
6837
+ var import_jsx_runtime115 = require("react/jsx-runtime");
6673
6838
  function CostBars({ items = [], unit = "currency", currency = "TRY", locale = "tr-TR", max: maxProp, showValues = true, showTokens = false, colorBy = "index", sort, labels, className, ...rest }) {
6674
6839
  const L = { costs: "Costs", tokens: "tokens", ...labels };
6675
6840
  const list = sort === "desc" ? [...items].sort((a, b) => (b.value || 0) - (a.value || 0)) : items;
@@ -6678,15 +6843,15 @@ function CostBars({ items = [], unit = "currency", currency = "TRY", locale = "t
6678
6843
  return (
6679
6844
  // biome-ignore lint/a11y/noRedundantRoles: explicit role=list keeps list semantics in Safari/VoiceOver, which drops them for list-style: none
6680
6845
  // biome-ignore lint/a11y/useSemanticElements: explicit role=list keeps list semantics in Safari/VoiceOver, which drops them for list-style: none
6681
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("ul", { className: cx("agn-costbars", className), role: "list", "aria-label": L.costs, ...rest, children: list.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("li", { className: cx("agn-costbars__row", it.tone && "agn-costbars__row--" + it.tone), children: [
6682
- /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("span", { className: "agn-costbars__label", title: typeof it.label === "string" ? it.label : void 0, children: [
6846
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("ul", { className: cx("agn-costbars", className), role: "list", "aria-label": L.costs, ...rest, children: list.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("li", { className: cx("agn-costbars__row", it.tone && "agn-costbars__row--" + it.tone), children: [
6847
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-costbars__label", title: typeof it.label === "string" ? it.label : void 0, children: [
6683
6848
  it.label,
6684
- it.sub && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "agn-costbars__sub", children: it.sub })
6849
+ it.sub && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-costbars__sub", children: it.sub })
6685
6850
  ] }),
6686
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "agn-costbars__track", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: cx("agn-costbars__fill", colorBy === "index" && "agn-costbars__fill--" + (i % 6 + 1)), style: { width: Math.min(100, (it.value || 0) / max * 100) + "%" } }) }),
6687
- showValues && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("span", { className: "agn-costbars__value agn-num", children: [
6851
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-costbars__track", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: cx("agn-costbars__fill", colorBy === "index" && "agn-costbars__fill--" + (i % 6 + 1)), style: { width: Math.min(100, (it.value || 0) / max * 100) + "%" } }) }),
6852
+ showValues && /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-costbars__value agn-num", children: [
6688
6853
  fmt(it.value || 0),
6689
- showTokens && it.tokens != null && /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("span", { className: "agn-costbars__tokens", children: [
6854
+ showTokens && it.tokens != null && /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-costbars__tokens", children: [
6690
6855
  fmtInt(it.tokens, locale),
6691
6856
  " ",
6692
6857
  L.tokens
@@ -6697,8 +6862,8 @@ function CostBars({ items = [], unit = "currency", currency = "TRY", locale = "t
6697
6862
  }
6698
6863
 
6699
6864
  // src/widgets/CanvasBlock.jsx
6700
- var import_react117 = __toESM(require("react"), 1);
6701
- var import_jsx_runtime115 = require("react/jsx-runtime");
6865
+ var import_react118 = __toESM(require("react"), 1);
6866
+ var import_jsx_runtime116 = require("react/jsx-runtime");
6702
6867
  var SIDES = ["top", "right", "bottom", "left"];
6703
6868
  var portSide = (v, dflt) => v === true ? dflt : SIDES.includes(v) ? v : null;
6704
6869
  var STATE_ICON = { running: ["loader-circle", true], error: ["circle-alert"], done: ["circle-check"], waiting: ["circle-dashed"], disabled: ["eye-off"] };
@@ -6707,33 +6872,33 @@ function CanvasBlock({ name, kind, icon = "box", product, rows = [], state = "de
6707
6872
  const Tag2 = onSelect ? "button" : "div";
6708
6873
  const inSide = ports && portSide(ports.in, "left"), outSide = ports && portSide(ports.out, "right");
6709
6874
  const si = STATE_ICON[state];
6710
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(Tag2, { type: onSelect ? "button" : void 0, className: cx("agn-block", "agn-block--" + state, className), style: { width: 250, ...style }, "aria-pressed": onSelect ? state === "selected" : void 0, onClick: onSelect, ...rest, children: [
6711
- actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__bar", role: "toolbar", children: actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ButtonIcon, { icon: a.icon, label: a.label, size: "xs", variant: a.variant || "ghost", onClick: (e) => {
6875
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Tag2, { type: onSelect ? "button" : void 0, className: cx("agn-block", "agn-block--" + state, className), style: { width: 250, ...style }, "aria-pressed": onSelect ? state === "selected" : void 0, onClick: onSelect, ...rest, children: [
6876
+ actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__bar", role: "toolbar", children: actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ButtonIcon, { icon: a.icon, label: a.label, size: "xs", variant: a.variant || "ghost", onClick: (e) => {
6712
6877
  e.stopPropagation();
6713
6878
  a.onClick && a.onClick(e);
6714
6879
  } }, i)) }),
6715
- /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-block__head", children: [
6716
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__icon", children: product ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ProductIcon, { product, size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon, { name: icon, size: 16 }) }),
6717
- /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-block__heading", children: [
6718
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__name", title: typeof name === "string" ? name : void 0, children: name }),
6719
- kind && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__kind", children: kind })
6880
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "agn-block__head", children: [
6881
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__icon", children: product ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ProductIcon, { product, size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Icon, { name: icon, size: 16 }) }),
6882
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "agn-block__heading", children: [
6883
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__name", title: typeof name === "string" ? name : void 0, children: name }),
6884
+ kind && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__kind", children: kind })
6720
6885
  ] }),
6721
- si && /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-block__state", children: [
6722
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon, { name: si[0], size: 14, className: si[1] ? "agn-block__spin" : void 0, title: L[state] }),
6723
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-sr", children: L[state] })
6886
+ si && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "agn-block__state", children: [
6887
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Icon, { name: si[0], size: 14, className: si[1] ? "agn-block__spin" : void 0, title: L[state] }),
6888
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-sr", children: L[state] })
6724
6889
  ] })
6725
6890
  ] }),
6726
- rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__rows", children: rows.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-block__row", children: [
6727
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__k", children: r.label }),
6728
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: cx("agn-block__v", r.mono !== false && "agn-mono"), children: r.value })
6891
+ rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__rows", children: rows.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "agn-block__row", children: [
6892
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__k", children: r.label }),
6893
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: cx("agn-block__v", r.mono !== false && "agn-mono"), children: r.value })
6729
6894
  ] }, i)) }),
6730
- next && /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("span", { className: "agn-block__next", children: [
6731
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon, { name: "corner-down-right", size: 12 }),
6732
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "agn-block__next-label", children: L.next }),
6895
+ next && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "agn-block__next", children: [
6896
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Icon, { name: "corner-down-right", size: 12 }),
6897
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "agn-block__next-label", children: L.next }),
6733
6898
  next
6734
6899
  ] }),
6735
- inSide && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: cx("agn-block__port", "agn-block__port--in", "agn-block__port--" + inSide), "aria-hidden": "true" }),
6736
- outSide && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: cx("agn-block__port", "agn-block__port--out", "agn-block__port--" + outSide), "aria-hidden": "true" })
6900
+ inSide && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: cx("agn-block__port", "agn-block__port--in", "agn-block__port--" + inSide), "aria-hidden": "true" }),
6901
+ outSide && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: cx("agn-block__port", "agn-block__port--out", "agn-block__port--" + outSide), "aria-hidden": "true" })
6737
6902
  ] });
6738
6903
  }
6739
6904
  var horiz = (s) => s === "left" || s === "right";
@@ -6763,31 +6928,31 @@ function CanvasEdge({ from, to, fromSide = "right", toSide = "left", state = "de
6763
6928
  const ah = `M${to.x - ux * 6 - uy * 4},${to.y - uy * 6 - ux * 4} L${to.x},${to.y} L${to.x - ux * 6 + uy * 4},${to.y - uy * 6 + ux * 4}`;
6764
6929
  return (
6765
6930
  // biome-ignore lint/a11y/noStaticElementInteractions: role=button, tabIndex and the Enter/Space handler are all set whenever onClick is; the rule cannot see the conditional role
6766
- /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("g", { className: cx("agn-edge", "agn-edge--" + state, onClick && "agn-edge--clickable", className), role: onClick ? "button" : void 0, tabIndex: onClick ? 0 : void 0, "aria-label": onClick && label != null ? String(label) : void 0, onClick, onKeyDown: onClick ? (e) => {
6931
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("g", { className: cx("agn-edge", "agn-edge--" + state, onClick && "agn-edge--clickable", className), role: onClick ? "button" : void 0, tabIndex: onClick ? 0 : void 0, "aria-label": onClick && label != null ? String(label) : void 0, onClick, onKeyDown: onClick ? (e) => {
6767
6932
  if (e.key === "Enter" || e.key === " ") {
6768
6933
  e.preventDefault();
6769
6934
  onClick(e);
6770
6935
  }
6771
6936
  } : void 0, ...rest, children: [
6772
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("path", { className: "agn-edge__hit", d }),
6773
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("path", { className: "agn-edge__path", d }),
6774
- arrow && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("path", { className: "agn-edge__arrow", d: ah }),
6775
- label && /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("g", { className: "agn-edge__label", transform: `translate(${mx},${my})`, children: [
6776
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("rect", { x: -String(label).length * 3.4 - 6, y: -9, width: String(label).length * 6.8 + 12, height: 18, rx: 4 }),
6777
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("text", { textAnchor: "middle", dominantBaseline: "central", children: label })
6937
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("path", { className: "agn-edge__hit", d }),
6938
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("path", { className: "agn-edge__path", d }),
6939
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("path", { className: "agn-edge__arrow", d: ah }),
6940
+ label && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("g", { className: "agn-edge__label", transform: `translate(${mx},${my})`, children: [
6941
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("rect", { x: -String(label).length * 3.4 - 6, y: -9, width: String(label).length * 6.8 + 12, height: 18, rx: 4 }),
6942
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("text", { textAnchor: "middle", dominantBaseline: "central", children: label })
6778
6943
  ] })
6779
6944
  ] })
6780
6945
  );
6781
6946
  }
6782
6947
 
6783
6948
  // src/widgets/Canvas.jsx
6784
- var import_react118 = __toESM(require("react"), 1);
6785
- var import_jsx_runtime116 = require("react/jsx-runtime");
6949
+ var import_react119 = __toESM(require("react"), 1);
6950
+ var import_jsx_runtime117 = require("react/jsx-runtime");
6786
6951
  var clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
6787
6952
  function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange, pan: panProp, defaultPan = { x: 0, y: 0 }, onPanChange, minZoom = 0.25, maxZoom = 2, grid = true, controls = true, interactive = true, overlay, labels, className, style, ...rest }) {
6788
6953
  const L = { canvas: "Agent canvas", zoomIn: "Zoom in", zoomOut: "Zoom out", reset: "Reset view", ...labels };
6789
- const [zLocal, setZLocal] = import_react118.default.useState(defaultZoom);
6790
- const [pLocal, setPLocal] = import_react118.default.useState(defaultPan);
6954
+ const [zLocal, setZLocal] = import_react119.default.useState(defaultZoom);
6955
+ const [pLocal, setPLocal] = import_react119.default.useState(defaultPan);
6791
6956
  const z = zoomProp != null ? zoomProp : zLocal;
6792
6957
  const p = panProp || pLocal;
6793
6958
  const setZ = (v) => {
@@ -6799,7 +6964,7 @@ function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange
6799
6964
  if (!panProp) setPLocal(v);
6800
6965
  onPanChange && onPanChange(v);
6801
6966
  };
6802
- const drag = import_react118.default.useRef(null);
6967
+ const drag = import_react119.default.useRef(null);
6803
6968
  const onPointerDown = (e) => {
6804
6969
  if (!interactive || e.button !== 0) return;
6805
6970
  if (e.target.closest(".agn-block, button, a, input, textarea, select, .agn-edge--clickable, .agn-canvas__controls")) return;
@@ -6841,41 +7006,41 @@ function Canvas({ children, edges, zoom: zoomProp, defaultZoom = 1, onZoomChange
6841
7006
  };
6842
7007
  const gs = 20 * z;
6843
7008
  const bg = grid ? { backgroundSize: gs + "px " + gs + "px", backgroundPosition: p.x + "px " + p.y + "px" } : null;
6844
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: cx("agn-canvas", grid && "agn-canvas--grid", interactive && "agn-canvas--interactive", className), style: { ...bg, ...style }, role: "application", "aria-roledescription": "canvas", "aria-label": L.canvas, tabIndex: interactive ? 0 : void 0, onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp, onWheel, onKeyDown, ...rest, children: [
6845
- /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "agn-canvas__layer", style: { transform: `translate(${p.x}px, ${p.y}px) scale(${z})` }, children: [
6846
- edges && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("svg", { className: "agn-canvas__edges", "aria-hidden": "true", children: edges }),
7009
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: cx("agn-canvas", grid && "agn-canvas--grid", interactive && "agn-canvas--interactive", className), style: { ...bg, ...style }, role: "application", "aria-roledescription": "canvas", "aria-label": L.canvas, tabIndex: interactive ? 0 : void 0, onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp, onWheel, onKeyDown, ...rest, children: [
7010
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "agn-canvas__layer", style: { transform: `translate(${p.x}px, ${p.y}px) scale(${z})` }, children: [
7011
+ edges && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("svg", { className: "agn-canvas__edges", "aria-hidden": "true", children: edges }),
6847
7012
  children
6848
7013
  ] }),
6849
7014
  overlay,
6850
- controls && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "agn-canvas__controls", role: "toolbar", "aria-label": L.canvas, children: [
6851
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ButtonIcon, { icon: "minus", label: L.zoomOut, size: "sm", variant: "ghost", onClick: () => setZ(z / 1.2), disabled: z <= minZoom }),
6852
- /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("button", { type: "button", className: "agn-canvas__zoom agn-num agn-focus", onClick: () => {
7015
+ controls && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "agn-canvas__controls", role: "toolbar", "aria-label": L.canvas, children: [
7016
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ButtonIcon, { icon: "minus", label: L.zoomOut, size: "sm", variant: "ghost", onClick: () => setZ(z / 1.2), disabled: z <= minZoom }),
7017
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("button", { type: "button", className: "agn-canvas__zoom agn-num agn-focus", onClick: () => {
6853
7018
  setZ(1);
6854
7019
  setP({ x: 0, y: 0 });
6855
7020
  }, title: L.reset, "aria-label": L.reset + " (" + Math.round(z * 100) + "%)", children: [
6856
7021
  Math.round(z * 100),
6857
7022
  "%"
6858
7023
  ] }),
6859
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ButtonIcon, { icon: "plus", label: L.zoomIn, size: "sm", variant: "ghost", onClick: () => setZ(z * 1.2), disabled: z >= maxZoom })
7024
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ButtonIcon, { icon: "plus", label: L.zoomIn, size: "sm", variant: "ghost", onClick: () => setZ(z * 1.2), disabled: z >= maxZoom })
6860
7025
  ] })
6861
7026
  ] });
6862
7027
  }
6863
7028
 
6864
7029
  // src/widgets/CanvasNote.jsx
6865
- var import_react119 = __toESM(require("react"), 1);
6866
- var import_jsx_runtime117 = require("react/jsx-runtime");
7030
+ var import_react120 = __toESM(require("react"), 1);
7031
+ var import_jsx_runtime118 = require("react/jsx-runtime");
6867
7032
  function CanvasNote({ title, children, author, time, tone = "warn", width = 220, onEdit, onDelete, labels, className, style, ...rest }) {
6868
7033
  const L = { edit: "Edit note", delete: "Delete note", ...labels };
6869
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: cx("agn-note", "agn-note--" + tone, className), style: { width, ...style }, ...rest, children: [
6870
- (title || onEdit || onDelete) && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "agn-note__head", children: [
6871
- title && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "agn-note__title", children: title }),
6872
- /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("span", { className: "agn-note__ctl", children: [
6873
- onEdit && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ButtonIcon, { icon: "pencil", label: L.edit, size: "xs", onClick: onEdit }),
6874
- onDelete && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ButtonIcon, { icon: "x", label: L.delete, size: "xs", onClick: onDelete })
7034
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: cx("agn-note", "agn-note--" + tone, className), style: { width, ...style }, ...rest, children: [
7035
+ (title || onEdit || onDelete) && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "agn-note__head", children: [
7036
+ title && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-note__title", children: title }),
7037
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "agn-note__ctl", children: [
7038
+ onEdit && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ButtonIcon, { icon: "pencil", label: L.edit, size: "xs", onClick: onEdit }),
7039
+ onDelete && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ButtonIcon, { icon: "x", label: L.delete, size: "xs", onClick: onDelete })
6875
7040
  ] })
6876
7041
  ] }),
6877
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "agn-note__body", children }),
6878
- (author || time) && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "agn-note__foot", children: [
7042
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "agn-note__body", children }),
7043
+ (author || time) && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "agn-note__foot", children: [
6879
7044
  author,
6880
7045
  author && time && " \xB7 ",
6881
7046
  time
@@ -6884,8 +7049,8 @@ function CanvasNote({ title, children, author, time, tone = "warn", width = 220,
6884
7049
  }
6885
7050
 
6886
7051
  // src/widgets/QueueCard.jsx
6887
- var import_react120 = __toESM(require("react"), 1);
6888
- var import_jsx_runtime118 = require("react/jsx-runtime");
7052
+ var import_react121 = __toESM(require("react"), 1);
7053
+ var import_jsx_runtime119 = require("react/jsx-runtime");
6889
7054
  var CHANNEL = { whatsapp: { icon: "message-circle", label: "WhatsApp" }, voice: { icon: "phone", label: "Voice" }, web: { icon: "globe", label: "Web chat" }, email: { icon: "mail", label: "E-mail" } };
6890
7055
  var OWNER = { bot: { icon: "bot", label: "Bot" }, agent: { icon: null, label: "Agent" }, queue: { icon: "users", label: "Queue" } };
6891
7056
  function QueueCard({ channel = "whatsapp", customer, phone, preview, waiting, sla, owner = { kind: "queue" }, unread, selected, onClick, tenant, labels, className, ...rest }) {
@@ -6893,28 +7058,28 @@ function QueueCard({ channel = "whatsapp", customer, phone, preview, waiting, sl
6893
7058
  const ch = CHANNEL[channel] || CHANNEL.web;
6894
7059
  const ow = OWNER[owner.kind] || OWNER.queue;
6895
7060
  const Tag2 = onClick ? "button" : "div";
6896
- return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(Tag2, { type: onClick ? "button" : void 0, className: cx("agn-queue", "agn-queue--" + channel, unread && "agn-queue--unread", selected && "agn-queue--selected", onClick && "agn-queue--clickable agn-focus-inset", className), "aria-pressed": onClick ? !!selected : void 0, onClick, ...rest, children: [
6897
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-queue__channel", title: L[channel] || ch.label, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Icon, { name: ch.icon, size: 16 }) }),
6898
- /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "agn-queue__body", children: [
6899
- /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "agn-queue__top", children: [
6900
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-queue__name", children: customer }),
6901
- unread > 0 && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "agn-queue__unread agn-num", children: [
6902
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { "aria-hidden": "true", children: unread }),
6903
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-sr", children: unread + " " + L.unread })
7061
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(Tag2, { type: onClick ? "button" : void 0, className: cx("agn-queue", "agn-queue--" + channel, unread && "agn-queue--unread", selected && "agn-queue--selected", onClick && "agn-queue--clickable agn-focus-inset", className), "aria-pressed": onClick ? !!selected : void 0, onClick, ...rest, children: [
7062
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-queue__channel", title: L[channel] || ch.label, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: ch.icon, size: 16 }) }),
7063
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: "agn-queue__body", children: [
7064
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: "agn-queue__top", children: [
7065
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-queue__name", children: customer }),
7066
+ unread > 0 && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: "agn-queue__unread agn-num", children: [
7067
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { "aria-hidden": "true", children: unread }),
7068
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-sr", children: unread + " " + L.unread })
6904
7069
  ] }),
6905
- tenant && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-queue__tenant", children: tenant })
7070
+ tenant && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-queue__tenant", children: tenant })
6906
7071
  ] }),
6907
- phone && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-queue__phone agn-num", children: phone }),
6908
- preview && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-queue__preview", children: preview })
7072
+ phone && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-queue__phone agn-num", children: phone }),
7073
+ preview && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-queue__preview", children: preview })
6909
7074
  ] }),
6910
- /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "agn-queue__side", children: [
6911
- waiting && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "agn-queue__wait agn-num", children: [
6912
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Icon, { name: "timer", size: 11 }),
7075
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: "agn-queue__side", children: [
7076
+ waiting && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: "agn-queue__wait agn-num", children: [
7077
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: "timer", size: 11 }),
6913
7078
  waiting
6914
7079
  ] }),
6915
- sla && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: cx("agn-queue__sla", "agn-queue__sla--" + (sla.tone || "neutral")), children: sla.label }),
6916
- /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: cx("agn-queue__owner", "agn-queue__owner--" + owner.kind), children: [
6917
- owner.kind === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "agn-queue__owner-avatar", children: initials4(owner.name || "") }) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Icon, { name: ow.icon, size: 11 }),
7080
+ sla && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: cx("agn-queue__sla", "agn-queue__sla--" + (sla.tone || "neutral")), children: sla.label }),
7081
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: cx("agn-queue__owner", "agn-queue__owner--" + owner.kind), children: [
7082
+ owner.kind === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-queue__owner-avatar", children: initials4(owner.name || "") }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: ow.icon, size: 11 }),
6918
7083
  owner.name || L[owner.kind] || ow.label
6919
7084
  ] })
6920
7085
  ] })
@@ -6922,97 +7087,97 @@ function QueueCard({ channel = "whatsapp", customer, phone, preview, waiting, sl
6922
7087
  }
6923
7088
 
6924
7089
  // src/widgets/CallCard.jsx
6925
- var import_react121 = __toESM(require("react"), 1);
6926
- var import_jsx_runtime119 = require("react/jsx-runtime");
7090
+ var import_react122 = __toESM(require("react"), 1);
7091
+ var import_jsx_runtime120 = require("react/jsx-runtime");
6927
7092
  var STATE = { ringing: { tone: "info", icon: "phone-incoming", label: "Ringing" }, "in-call": { tone: "ok", icon: "phone-call", label: "In call" }, "on-hold": { tone: "warn", icon: "pause", label: "On hold" }, ended: { tone: "neutral", icon: "phone-off", label: "Ended" } };
6928
7093
  var WAVE = [0.3, 0.55, 0.8, 0.45, 0.95, 0.6, 0.35, 0.7, 0.5, 0.9, 0.4, 0.65, 0.85, 0.3, 0.6, 0.75, 0.45, 0.9, 0.55, 0.35];
6929
7094
  function CallCard({ number, name, direction = "inbound", state = "ringing", seconds = 0, live, agent, tenant, onAnswer, onDecline, onHold, onResume, onTransfer, onHangup, onCallBack, labels, className, ...rest }) {
6930
7095
  const L = { answer: "Answer", decline: "Decline", hold: "Hold", resume: "Resume", transfer: "Transfer", hangup: "Hang up", callBack: "Call back", inbound: "Inbound", outbound: "Outbound", ...Object.fromEntries(Object.entries(STATE).map(([k, v]) => [k, v.label])), ...labels };
6931
- const [elapsed, setElapsed] = import_react121.default.useState(seconds);
6932
- import_react121.default.useEffect(() => {
7096
+ const [elapsed, setElapsed] = import_react122.default.useState(seconds);
7097
+ import_react122.default.useEffect(() => {
6933
7098
  setElapsed(seconds);
6934
7099
  }, [seconds]);
6935
- import_react121.default.useEffect(() => {
7100
+ import_react122.default.useEffect(() => {
6936
7101
  if (!live || state !== "in-call") return;
6937
7102
  const t = setInterval(() => setElapsed((e) => e + 1), 1e3);
6938
7103
  return () => clearInterval(t);
6939
7104
  }, [live, state]);
6940
7105
  const s = STATE[state] || STATE.ringing;
6941
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("article", { className: cx("agn-call", "agn-call--" + state, className), "aria-label": (name || number) + " \xB7 " + (L[state] || s.label), ...rest, children: [
6942
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("header", { className: "agn-call__head", children: [
6943
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-call__dir", title: L[direction], children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: direction === "outbound" ? "phone-outgoing" : "phone-incoming", size: 16 }) }),
6944
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "agn-call__who", children: [
6945
- name && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "agn-call__name", children: name }),
6946
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "agn-call__number agn-num", children: number })
7106
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("article", { className: cx("agn-call", "agn-call--" + state, className), "aria-label": (name || number) + " \xB7 " + (L[state] || s.label), ...rest, children: [
7107
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("header", { className: "agn-call__head", children: [
7108
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "agn-call__dir", title: L[direction], children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon, { name: direction === "outbound" ? "phone-outgoing" : "phone-incoming", size: 16 }) }),
7109
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "agn-call__who", children: [
7110
+ name && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "agn-call__name", children: name }),
7111
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "agn-call__number agn-num", children: number })
6947
7112
  ] }),
6948
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: cx("agn-call__state", "agn-call__state--" + s.tone), children: [
6949
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: s.icon, size: 12, className: state === "ringing" ? "agn-call__ring" : void 0 }),
7113
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { className: cx("agn-call__state", "agn-call__state--" + s.tone), children: [
7114
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon, { name: s.icon, size: 12, className: state === "ringing" ? "agn-call__ring" : void 0 }),
6950
7115
  L[state] || s.label
6951
7116
  ] })
6952
7117
  ] }),
6953
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "agn-call__body", children: [
6954
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "agn-call__time agn-num", role: "timer", "aria-live": "off", children: fmtClock(elapsed) }),
6955
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "agn-call__wave", "aria-hidden": "true", children: WAVE.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agn-call__bar", style: { "--agn-h": v, "--agn-i": i } }, i)) })
7118
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "agn-call__body", children: [
7119
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "agn-call__time agn-num", role: "timer", "aria-live": "off", children: fmtClock(elapsed) }),
7120
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "agn-call__wave", "aria-hidden": "true", children: WAVE.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "agn-call__bar", style: { "--agn-h": v, "--agn-i": i } }, i)) })
6956
7121
  ] }),
6957
- (agent || tenant) && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "agn-call__meta", children: [
6958
- agent && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { children: [
6959
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: "headset", size: 12 }),
7122
+ (agent || tenant) && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "agn-call__meta", children: [
7123
+ agent && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { children: [
7124
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon, { name: "headset", size: 12 }),
6960
7125
  agent
6961
7126
  ] }),
6962
- tenant && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { children: [
6963
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon, { name: "building-2", size: 12 }),
7127
+ tenant && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { children: [
7128
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon, { name: "building-2", size: 12 }),
6964
7129
  tenant
6965
7130
  ] })
6966
7131
  ] }),
6967
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("footer", { className: "agn-call__foot", children: [
6968
- state === "ringing" && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
6969
- onAnswer && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "success", size: "sm", icon: "phone", onClick: onAnswer, children: L.answer }),
6970
- onDecline && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "destructive-text", size: "sm", icon: "phone-off", onClick: onDecline, children: L.decline })
7132
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("footer", { className: "agn-call__foot", children: [
7133
+ state === "ringing" && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
7134
+ onAnswer && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { variant: "success", size: "sm", icon: "phone", onClick: onAnswer, children: L.answer }),
7135
+ onDecline && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { variant: "destructive-text", size: "sm", icon: "phone-off", onClick: onDecline, children: L.decline })
6971
7136
  ] }),
6972
- state === "in-call" && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
6973
- onHold && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { size: "sm", icon: "pause", onClick: onHold, children: L.hold }),
6974
- onTransfer && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { size: "sm", icon: "phone-forwarded", onClick: onTransfer, children: L.transfer }),
6975
- onHangup && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "destructive", size: "sm", icon: "phone-off", onClick: onHangup, children: L.hangup })
7137
+ state === "in-call" && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
7138
+ onHold && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { size: "sm", icon: "pause", onClick: onHold, children: L.hold }),
7139
+ onTransfer && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { size: "sm", icon: "phone-forwarded", onClick: onTransfer, children: L.transfer }),
7140
+ onHangup && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { variant: "destructive", size: "sm", icon: "phone-off", onClick: onHangup, children: L.hangup })
6976
7141
  ] }),
6977
- state === "on-hold" && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
6978
- onResume && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "primary", size: "sm", icon: "play", onClick: onResume, children: L.resume }),
6979
- onTransfer && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { size: "sm", icon: "phone-forwarded", onClick: onTransfer, children: L.transfer }),
6980
- onHangup && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "destructive", size: "sm", icon: "phone-off", onClick: onHangup, children: L.hangup })
7142
+ state === "on-hold" && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
7143
+ onResume && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { variant: "primary", size: "sm", icon: "play", onClick: onResume, children: L.resume }),
7144
+ onTransfer && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { size: "sm", icon: "phone-forwarded", onClick: onTransfer, children: L.transfer }),
7145
+ onHangup && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { variant: "destructive", size: "sm", icon: "phone-off", onClick: onHangup, children: L.hangup })
6981
7146
  ] }),
6982
- state === "ended" && onCallBack && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { size: "sm", icon: "phone-outgoing", onClick: onCallBack, children: L.callBack })
7147
+ state === "ended" && onCallBack && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { size: "sm", icon: "phone-outgoing", onClick: onCallBack, children: L.callBack })
6983
7148
  ] })
6984
7149
  ] });
6985
7150
  }
6986
7151
 
6987
7152
  // src/dashboard/KpiWidget.jsx
6988
- var import_react122 = __toESM(require("react"), 1);
6989
- var import_jsx_runtime120 = require("react/jsx-runtime");
6990
- var DEFAULT_LABELS50 = { options: "Options", trend: "Trend" };
7153
+ var import_react123 = __toESM(require("react"), 1);
7154
+ var import_jsx_runtime121 = require("react/jsx-runtime");
7155
+ var DEFAULT_LABELS51 = { options: "Options", trend: "Trend" };
6991
7156
  function KpiWidget({ label, value, delta, invert, sub, icon, spark, sparkTone, sparkColor = 1, menuItems, onMenuSelect, plain, size = "md", labels, className, ...rest }) {
6992
- const L = { ...DEFAULT_LABELS50, ...labels };
6993
- const chart = spark && spark.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Sparkline, { data: spark, width: 128, height: 28, area: true, tone: sparkTone, color: sparkColor, "aria-label": L.trend + ": " + spark.join(", ") }) : null;
6994
- const stat = /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Stat, { label, value, delta, invert, sub, icon, size, chart });
6995
- const menu = menuItems && menuItems.length ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "agn-kpi__menu", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Menu, { align: "right", items: menuItems, onSelect: onMenuSelect, trigger: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(ButtonIcon, { icon: "ellipsis", label: L.options, size: "xs", variant: "ghost" }) }) }) : null;
6996
- if (plain) return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: cx("agn-kpi", "agn-kpi--plain", menu && "agn-kpi--menu", className), ...rest, children: [
7157
+ const L = { ...DEFAULT_LABELS51, ...labels };
7158
+ const chart = spark && spark.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Sparkline, { data: spark, width: 128, height: 28, area: true, tone: sparkTone, color: sparkColor, "aria-label": L.trend + ": " + spark.join(", ") }) : null;
7159
+ const stat = /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Stat, { label, value, delta, invert, sub, icon, size, chart });
7160
+ const menu = menuItems && menuItems.length ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "agn-kpi__menu", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Menu, { align: "right", items: menuItems, onSelect: onMenuSelect, trigger: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ButtonIcon, { icon: "ellipsis", label: L.options, size: "xs", variant: "ghost" }) }) }) : null;
7161
+ if (plain) return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: cx("agn-kpi", "agn-kpi--plain", menu && "agn-kpi--menu", className), ...rest, children: [
6997
7162
  stat,
6998
7163
  menu
6999
7164
  ] });
7000
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Card, { padding: "md", as: "div", className: cx("agn-kpi", menu && "agn-kpi--menu", className), ...rest, children: [
7165
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(Card, { padding: "md", as: "div", className: cx("agn-kpi", menu && "agn-kpi--menu", className), ...rest, children: [
7001
7166
  stat,
7002
7167
  menu
7003
7168
  ] });
7004
7169
  }
7005
7170
  function KpiRow({ items = [], children, label, className, ...rest }) {
7006
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: cx("agn-kpi-row", className), role: "group", "aria-label": label, ...rest, children: children || items.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(KpiWidget, { plain: true, ...it }, it.id || i)) });
7171
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: cx("agn-kpi-row", className), role: "group", "aria-label": label, ...rest, children: children || items.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(KpiWidget, { plain: true, ...it }, it.id || i)) });
7007
7172
  }
7008
7173
 
7009
7174
  // src/dashboard/ChartCard.jsx
7010
- var import_react123 = __toESM(require("react"), 1);
7011
- var import_jsx_runtime121 = require("react/jsx-runtime");
7012
- var DEFAULT_LABELS51 = { period: "Period", loading: "Loading chart", empty: "No data for this period", emptyHint: "Pick another period, or wait for the agent to receive traffic." };
7175
+ var import_react124 = __toESM(require("react"), 1);
7176
+ var import_jsx_runtime122 = require("react/jsx-runtime");
7177
+ var DEFAULT_LABELS52 = { period: "Period", loading: "Loading chart", empty: "No data for this period", emptyHint: "Pick another period, or wait for the agent to receive traffic." };
7013
7178
  function ChartCard({ title, icon, unit, periods, period, defaultPeriod, onPeriodChange, type = "line", series, data, categories = [], height = 160, format = (v) => String(v), legend = true, headline, state, footnote, actions, viewAll, labels, className, ...rest }) {
7014
- const L = { ...DEFAULT_LABELS51, ...labels };
7015
- const [own, setOwn] = import_react123.default.useState(defaultPeriod != null ? defaultPeriod : periods && periods.length ? typeof periods[0] === "string" ? periods[0] : periods[0].value : void 0);
7179
+ const L = { ...DEFAULT_LABELS52, ...labels };
7180
+ const [own, setOwn] = import_react124.default.useState(defaultPeriod != null ? defaultPeriod : periods && periods.length ? typeof periods[0] === "string" ? periods[0] : periods[0].value : void 0);
7016
7181
  const per = period !== void 0 ? period : own;
7017
7182
  const setPer = (v) => {
7018
7183
  if (period === void 0) setOwn(v);
@@ -7021,37 +7186,37 @@ function ChartCard({ title, icon, unit, periods, period, defaultPeriod, onPeriod
7021
7186
  const ser = series || [{ name: typeof title === "string" ? title : "", values: data || [] }];
7022
7187
  const empty = state === "empty" || state !== "loading" && !ser.some((s) => s.values && s.values.length);
7023
7188
  const plainTitle = typeof title === "string" ? title + (unit ? " (" + unit + ")" : "") : void 0;
7024
- const head = /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
7189
+ const head = /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
7025
7190
  title,
7026
- unit && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "agn-chart-card__unit", children: unit })
7191
+ unit && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "agn-chart-card__unit", children: unit })
7027
7192
  ] });
7028
- const right = (periods || actions) && /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
7029
- periods && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(SegmentedControl, { size: "sm", options: periods, value: per, onChange: setPer, label: L.period }),
7193
+ const right = (periods || actions) && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
7194
+ periods && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(SegmentedControl, { size: "sm", options: periods, value: per, onChange: setPer, label: L.period }),
7030
7195
  actions
7031
7196
  ] });
7032
7197
  let body;
7033
- if (state === "loading") body = /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "agn-chart-card__loading", role: "status", "aria-busy": "true", children: [
7034
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "agn-sr", children: L.loading }),
7035
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Skeleton, { shape: "rect", width: "100%", height }),
7036
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Skeleton, { shape: "line", width: "40%" })
7198
+ if (state === "loading") body = /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "agn-chart-card__loading", role: "status", "aria-busy": "true", children: [
7199
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "agn-sr", children: L.loading }),
7200
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Skeleton, { shape: "rect", width: "100%", height }),
7201
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Skeleton, { shape: "line", width: "40%" })
7037
7202
  ] });
7038
- else if (empty) body = /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "agn-chart-card__empty", style: { minHeight: height }, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(EmptyState, { compact: true, icon: "chart-no-axes-column", title: L.empty, children: L.emptyHint }) });
7039
- else body = /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(MiniChart, { type: type === "stacked" ? "bar" : type, stacked: type === "stacked", series: ser, labels: categories, height, legend, format, title: plainTitle });
7040
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(Card, { title: head, icon, actions: right, viewAll, className: cx("agn-chart-card", className), ...rest, children: [
7041
- headline && state !== "loading" && !empty && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Stat, { size: "sm", className: "agn-chart-card__headline", ...headline }),
7042
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "agn-chart-card__plot", children: body }),
7043
- footnote && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "agn-chart-card__foot", children: footnote })
7203
+ else if (empty) body = /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "agn-chart-card__empty", style: { minHeight: height }, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(EmptyState, { compact: true, icon: "chart-no-axes-column", title: L.empty, children: L.emptyHint }) });
7204
+ else body = /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(MiniChart, { type: type === "stacked" ? "bar" : type, stacked: type === "stacked", series: ser, labels: categories, height, legend, format, title: plainTitle });
7205
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Card, { title: head, icon, actions: right, viewAll, className: cx("agn-chart-card", className), ...rest, children: [
7206
+ headline && state !== "loading" && !empty && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Stat, { size: "sm", className: "agn-chart-card__headline", ...headline }),
7207
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "agn-chart-card__plot", children: body }),
7208
+ footnote && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "agn-chart-card__foot", children: footnote })
7044
7209
  ] });
7045
7210
  }
7046
7211
 
7047
7212
  // src/dashboard/TaskListWidget.jsx
7048
- var import_react124 = __toESM(require("react"), 1);
7049
- var import_jsx_runtime122 = require("react/jsx-runtime");
7213
+ var import_react125 = __toESM(require("react"), 1);
7214
+ var import_jsx_runtime123 = require("react/jsx-runtime");
7050
7215
  var PRI = { high: { tone: "bad", icon: "chevrons-up" }, medium: { tone: "warn", icon: "chevron-up" }, low: { tone: "neutral", icon: "chevron-down" } };
7051
- var DEFAULT_LABELS52 = { title: "Tasks", add: "Add task", empty: "No open tasks", emptyHint: "Tasks assigned to you appear here.", overdue: "Overdue", due: "Due", high: "High", medium: "Medium", low: "Low", viewAll: "View all" };
7216
+ var DEFAULT_LABELS53 = { title: "Tasks", add: "Add task", empty: "No open tasks", emptyHint: "Tasks assigned to you appear here.", overdue: "Overdue", due: "Due", high: "High", medium: "Medium", low: "Low", viewAll: "View all" };
7052
7217
  function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone, viewAll, labels, className, ...rest }) {
7053
- const L = { ...DEFAULT_LABELS52, ...labels };
7054
- const [map, setMap] = import_react124.default.useState({});
7218
+ const L = { ...DEFAULT_LABELS53, ...labels };
7219
+ const [map, setMap] = import_react125.default.useState({});
7055
7220
  const isDone = (t) => t.id in map ? map[t.id] : !!t.done;
7056
7221
  const toggle = (t, v) => {
7057
7222
  setMap({ ...map, [t.id]: v });
@@ -7059,7 +7224,7 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
7059
7224
  };
7060
7225
  const list = hideDone ? tasks.filter((t) => !isDone(t)) : tasks;
7061
7226
  const open = tasks.filter((t) => !isDone(t)).length;
7062
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
7227
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
7063
7228
  Card,
7064
7229
  {
7065
7230
  title: title || L.title,
@@ -7067,22 +7232,22 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
7067
7232
  count: open,
7068
7233
  viewAll,
7069
7234
  labels: { viewAll: L.viewAll },
7070
- actions: onAdd && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Button, { variant: "ghost", size: "sm", icon: "plus", onClick: onAdd, children: L.add }),
7235
+ actions: onAdd && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Button, { variant: "ghost", size: "sm", icon: "plus", onClick: onAdd, children: L.add }),
7071
7236
  padding: "none",
7072
7237
  className: cx("agn-tasks", className),
7073
7238
  ...rest,
7074
- children: list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "agn-tasks__empty", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(EmptyState, { compact: true, icon: "list-checks", title: L.empty, children: L.emptyHint }) }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("ul", { className: "agn-tasks__list", children: list.map((t) => {
7239
+ children: list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "agn-tasks__empty", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(EmptyState, { compact: true, icon: "list-checks", title: L.empty, children: L.emptyHint }) }) : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("ul", { className: "agn-tasks__list", children: list.map((t) => {
7075
7240
  const d = isDone(t);
7076
7241
  const p = PRI[t.priority];
7077
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("li", { className: cx("agn-tasks__item", d && "agn-tasks__item--done"), children: [
7078
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Checkbox, { checked: d, onChange: (v) => toggle(t, v), "aria-label": typeof t.title === "string" ? t.title : void 0 }),
7079
- /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "agn-tasks__main", children: [
7080
- onOpen ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("button", { type: "button", className: "agn-tasks__title agn-tasks__title--link agn-focus", onClick: () => onOpen(t), children: t.title }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "agn-tasks__title", children: t.title }),
7081
- (t.related || t.due) && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("span", { className: "agn-tasks__meta", children: [
7082
- t.related && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "agn-tasks__related", children: t.related }),
7083
- t.due && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("span", { className: cx("agn-tasks__due", t.overdue && !d && "agn-tasks__due--overdue"), children: [
7084
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { name: t.overdue && !d ? "circle-alert" : "calendar", size: 12 }),
7085
- t.overdue && !d ? L.overdue + " \xB7 " : /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("span", { className: "agn-sr", children: [
7242
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("li", { className: cx("agn-tasks__item", d && "agn-tasks__item--done"), children: [
7243
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Checkbox, { checked: d, onChange: (v) => toggle(t, v), "aria-label": typeof t.title === "string" ? t.title : void 0 }),
7244
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "agn-tasks__main", children: [
7245
+ onOpen ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("button", { type: "button", className: "agn-tasks__title agn-tasks__title--link agn-focus", onClick: () => onOpen(t), children: t.title }) : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "agn-tasks__title", children: t.title }),
7246
+ (t.related || t.due) && /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("span", { className: "agn-tasks__meta", children: [
7247
+ t.related && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "agn-tasks__related", children: t.related }),
7248
+ t.due && /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("span", { className: cx("agn-tasks__due", t.overdue && !d && "agn-tasks__due--overdue"), children: [
7249
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { name: t.overdue && !d ? "circle-alert" : "calendar", size: 12 }),
7250
+ t.overdue && !d ? L.overdue + " \xB7 " : /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("span", { className: "agn-sr", children: [
7086
7251
  L.due,
7087
7252
  " "
7088
7253
  ] }),
@@ -7090,8 +7255,8 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
7090
7255
  ] })
7091
7256
  ] })
7092
7257
  ] }),
7093
- p && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Tag, { tone: d ? "neutral" : p.tone, icon: p.icon, className: "agn-tasks__priority", children: L[t.priority] }),
7094
- t.owner && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Avatar, { size: "xs", name: t.owner, kind: t.ownerKind || "person", className: "agn-tasks__owner" })
7258
+ p && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Tag, { tone: d ? "neutral" : p.tone, icon: p.icon, className: "agn-tasks__priority", children: L[t.priority] }),
7259
+ t.owner && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Avatar, { size: "xs", name: t.owner, kind: t.ownerKind || "person", className: "agn-tasks__owner" })
7095
7260
  ] }, t.id);
7096
7261
  }) })
7097
7262
  }
@@ -7099,14 +7264,14 @@ function TaskListWidget({ tasks = [], onToggle, onOpen, onAdd, title, hideDone,
7099
7264
  }
7100
7265
 
7101
7266
  // src/dashboard/AiInsightWidget.jsx
7102
- var import_react125 = __toESM(require("react"), 1);
7103
- var import_jsx_runtime123 = require("react/jsx-runtime");
7104
- var DEFAULT_LABELS53 = { generated: "AI-generated", evidence: "Evidence", apply: "Apply", dismiss: "Dismiss", helpful: "Was this helpful?", yes: "Helpful", no: "Not helpful", thanks: "Thanks for the feedback", applied: "Applied", dismissed: "Dismissed", confidence: "confidence", check: "Check the evidence before you apply it." };
7267
+ var import_react126 = __toESM(require("react"), 1);
7268
+ var import_jsx_runtime124 = require("react/jsx-runtime");
7269
+ var DEFAULT_LABELS54 = { generated: "AI-generated", evidence: "Evidence", apply: "Apply", dismiss: "Dismiss", helpful: "Was this helpful?", yes: "Helpful", no: "Not helpful", thanks: "Thanks for the feedback", applied: "Applied", dismissed: "Dismissed", confidence: "confidence", check: "Check the evidence before you apply it." };
7105
7270
  function AiInsightWidget({ title, children, evidence = [], confidence, model, time, status: statusProp, onApply, onDismiss, applyLabel, feedback: fbProp, onFeedback, labels, className, ...rest }) {
7106
- const L = { ...DEFAULT_LABELS53, ...labels };
7107
- const [own, setOwn] = import_react125.default.useState("open");
7271
+ const L = { ...DEFAULT_LABELS54, ...labels };
7272
+ const [own, setOwn] = import_react126.default.useState("open");
7108
7273
  const status = statusProp || own;
7109
- const [fbOwn, setFb] = import_react125.default.useState(null);
7274
+ const [fbOwn, setFb] = import_react126.default.useState(null);
7110
7275
  const fb = fbProp !== void 0 ? fbProp : fbOwn;
7111
7276
  const vote = (v) => {
7112
7277
  const next = fb === v ? null : v;
@@ -7114,52 +7279,52 @@ function AiInsightWidget({ title, children, evidence = [], confidence, model, ti
7114
7279
  onFeedback && onFeedback(next);
7115
7280
  };
7116
7281
  const meta = [confidence != null ? Math.round(confidence * 100) + "% " + L.confidence : null, model, time].filter(Boolean);
7117
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Card, { icon: "sparkles", title: L.generated, as: "div", actions: meta.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "agn-insight__meta", children: meta.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: m }, i)) }), className: cx("agn-insight", "agn-insight--" + status, className), ...rest, children: [
7118
- title && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("h4", { className: "agn-insight__title", children: title }),
7119
- children && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "agn-insight__text", children }),
7120
- evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "agn-insight__evidence", children: [
7121
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "agn-insight__label", children: L.evidence }),
7122
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("ol", { className: "agn-insight__list", children: evidence.map((e, i) => {
7282
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(Card, { icon: "sparkles", title: L.generated, as: "div", actions: meta.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agn-insight__meta", children: meta.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { children: m }, i)) }), className: cx("agn-insight", "agn-insight--" + status, className), ...rest, children: [
7283
+ title && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("h4", { className: "agn-insight__title", children: title }),
7284
+ children && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "agn-insight__text", children }),
7285
+ evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-insight__evidence", children: [
7286
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "agn-insight__label", children: L.evidence }),
7287
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("ol", { className: "agn-insight__list", children: evidence.map((e, i) => {
7123
7288
  const src = e.source && (typeof e.source === "string" ? { label: e.source } : e.source);
7124
7289
  const SrcTag = src && src.href ? "a" : "span";
7125
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("li", { className: "agn-insight__item", children: [
7126
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "agn-insight__n agn-num", "aria-hidden": "true", children: i + 1 }),
7127
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "agn-insight__item-main", children: [
7128
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "agn-insight__claim", children: e.text }),
7129
- src && /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(SrcTag, { className: "agn-insight__source", href: src.href, children: [
7130
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { name: src.icon || "file-text", size: 12 }),
7290
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("li", { className: "agn-insight__item", children: [
7291
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agn-insight__n agn-num", "aria-hidden": "true", children: i + 1 }),
7292
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-insight__item-main", children: [
7293
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agn-insight__claim", children: e.text }),
7294
+ src && /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(SrcTag, { className: "agn-insight__source", href: src.href, children: [
7295
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { name: src.icon || "file-text", size: 12 }),
7131
7296
  src.label
7132
7297
  ] })
7133
7298
  ] })
7134
7299
  ] }, e.id || i);
7135
7300
  }) })
7136
7301
  ] }),
7137
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "agn-insight__foot", children: [
7138
- status === "open" ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "agn-insight__actions", children: [
7139
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Button, { size: "sm", variant: "neutral", icon: "check", onClick: () => {
7302
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-insight__foot", children: [
7303
+ status === "open" ? /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-insight__actions", children: [
7304
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Button, { size: "sm", variant: "neutral", icon: "check", onClick: () => {
7140
7305
  setOwn("applied");
7141
7306
  onApply && onApply();
7142
7307
  }, children: applyLabel || L.apply }),
7143
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => {
7308
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => {
7144
7309
  setOwn("dismissed");
7145
7310
  onDismiss && onDismiss();
7146
7311
  }, children: L.dismiss })
7147
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Tag, { tone: status === "applied" ? "ok" : "neutral", icon: status === "applied" ? "circle-check" : "x", children: L[status] || status }),
7148
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "agn-insight__feedback", role: "group", "aria-label": L.helpful, children: [
7149
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "agn-insight__ask", "aria-live": "polite", children: fb ? L.thanks : L.helpful }),
7150
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ButtonIcon, { icon: "thumbs-up", label: L.yes, size: "xs", "aria-pressed": fb === "up", className: cx(fb === "up" && "agn-insight__thumb--on"), onClick: () => vote("up") }),
7151
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ButtonIcon, { icon: "thumbs-down", label: L.no, size: "xs", "aria-pressed": fb === "down", className: cx(fb === "down" && "agn-insight__thumb--on"), onClick: () => vote("down") })
7312
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Tag, { tone: status === "applied" ? "ok" : "neutral", icon: status === "applied" ? "circle-check" : "x", children: L[status] || status }),
7313
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-insight__feedback", role: "group", "aria-label": L.helpful, children: [
7314
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agn-insight__ask", "aria-live": "polite", children: fb ? L.thanks : L.helpful }),
7315
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ButtonIcon, { icon: "thumbs-up", label: L.yes, size: "xs", "aria-pressed": fb === "up", className: cx(fb === "up" && "agn-insight__thumb--on"), onClick: () => vote("up") }),
7316
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ButtonIcon, { icon: "thumbs-down", label: L.no, size: "xs", "aria-pressed": fb === "down", className: cx(fb === "down" && "agn-insight__thumb--on"), onClick: () => vote("down") })
7152
7317
  ] })
7153
7318
  ] })
7154
7319
  ] });
7155
7320
  }
7156
7321
 
7157
7322
  // src/dashboard/FilterBar.jsx
7158
- var import_react126 = __toESM(require("react"), 1);
7159
- var import_jsx_runtime124 = require("react/jsx-runtime");
7160
- var DEFAULT_LABELS54 = { search: "Search\u2026", searchLabel: "Search", filters: "Quick filters", more: "More filters", views: "Saved view", active: "Filters", clear: "Clear all", remove: "Remove filter" };
7323
+ var import_react127 = __toESM(require("react"), 1);
7324
+ var import_jsx_runtime125 = require("react/jsx-runtime");
7325
+ var DEFAULT_LABELS55 = { search: "Search\u2026", searchLabel: "Search", filters: "Quick filters", more: "More filters", views: "Saved view", active: "Filters", clear: "Clear all", remove: "Remove filter" };
7161
7326
  function useCtl(value, def, cb) {
7162
- const [own, setOwn] = import_react126.default.useState(def);
7327
+ const [own, setOwn] = import_react127.default.useState(def);
7163
7328
  const v = value !== void 0 ? value : own;
7164
7329
  return [v, (x) => {
7165
7330
  if (value === void 0) setOwn(x);
@@ -7167,7 +7332,7 @@ function useCtl(value, def, cb) {
7167
7332
  }];
7168
7333
  }
7169
7334
  function FilterBar({ search, defaultSearch = "", onSearch, chips = [], chipValue, defaultChipValue = [], onChipChange, moreFilters = [], onMoreFilter, moreOpen, onMoreOpenChange, views = [], view, defaultView = null, onViewChange, active, defaultActive = [], onActiveChange, onClear, right, labels, className, ...rest }) {
7170
- const L = { ...DEFAULT_LABELS54, ...labels };
7335
+ const L = { ...DEFAULT_LABELS55, ...labels };
7171
7336
  const [q, setQ] = useCtl(search, defaultSearch, onSearch);
7172
7337
  const [cv, setCv] = useCtl(chipValue, defaultChipValue, onChipChange);
7173
7338
  const [vw, setVw] = useCtl(view, defaultView, onViewChange);
@@ -7183,76 +7348,76 @@ function FilterBar({ search, defaultSearch = "", onSearch, chips = [], chipValue
7183
7348
  setAct([]);
7184
7349
  onClear && onClear();
7185
7350
  };
7186
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: cx("agn-filterbar", className), ...rest, children: [
7187
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-filterbar__row", children: [
7188
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Input, { icon: "search", value: q, onChange: (e) => setQ(e.target.value), onClear: q ? () => setQ("") : void 0, placeholder: L.search, "aria-label": L.searchLabel, className: "agn-filterbar__search" }),
7189
- chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ChipGroup, { multiple: true, options: chips, value: cv, onChange: setCv, label: L.filters }),
7190
- moreFilters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Menu, { items: moreFilters, open: moreOpen, onOpenChange: onMoreOpenChange, searchable: moreFilters.length > 7, onSelect: add, trigger: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Button, { variant: "ghost", icon: "list-filter", children: L.more }) }),
7191
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agn-filterbar__spacer" }),
7192
- views.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Combobox, { options: views, value: vw, onChange: setVw, icon: "bookmark", placeholder: L.views, className: "agn-filterbar__views" }),
7351
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: cx("agn-filterbar", className), ...rest, children: [
7352
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "agn-filterbar__row", children: [
7353
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Input, { icon: "search", value: q, onChange: (e) => setQ(e.target.value), onClear: q ? () => setQ("") : void 0, placeholder: L.search, "aria-label": L.searchLabel, className: "agn-filterbar__search" }),
7354
+ chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ChipGroup, { multiple: true, options: chips, value: cv, onChange: setCv, label: L.filters }),
7355
+ moreFilters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Menu, { items: moreFilters, open: moreOpen, onOpenChange: onMoreOpenChange, searchable: moreFilters.length > 7, onSelect: add, trigger: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { variant: "ghost", icon: "list-filter", children: L.more }) }),
7356
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "agn-filterbar__spacer" }),
7357
+ views.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Combobox, { options: views, value: vw, onChange: setVw, icon: "bookmark", placeholder: L.views, className: "agn-filterbar__views" }),
7193
7358
  right
7194
7359
  ] }),
7195
- (act.length > 0 || any) && /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agn-filterbar__active", children: [
7196
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agn-filterbar__label", children: L.active }),
7197
- act.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(PillContainer, { bare: true, children: act.map((a) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Pill, { size: "sm", label: a.label, icon: a.icon, labels: { remove: L.remove }, onRemove: () => setAct(act.filter((x) => x.key !== a.key)) }, a.key)) }),
7198
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Button, { variant: "link", size: "sm", onClick: clearAll, children: L.clear })
7360
+ (act.length > 0 || any) && /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "agn-filterbar__active", children: [
7361
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "agn-filterbar__label", children: L.active }),
7362
+ act.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(PillContainer, { bare: true, children: act.map((a) => /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Pill, { size: "sm", label: a.label, icon: a.icon, labels: { remove: L.remove }, onRemove: () => setAct(act.filter((x) => x.key !== a.key)) }, a.key)) }),
7363
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { variant: "link", size: "sm", onClick: clearAll, children: L.clear })
7199
7364
  ] })
7200
7365
  ] });
7201
7366
  }
7202
7367
 
7203
7368
  // src/dashboard/RecordSummaryWidget.jsx
7204
- var import_react127 = __toESM(require("react"), 1);
7205
- var import_jsx_runtime125 = require("react/jsx-runtime");
7206
- var DEFAULT_LABELS55 = { open: "Open record", stage: "Stage" };
7369
+ var import_react128 = __toESM(require("react"), 1);
7370
+ var import_jsx_runtime126 = require("react/jsx-runtime");
7371
+ var DEFAULT_LABELS56 = { open: "Open record", stage: "Stage" };
7207
7372
  function RecordSummaryWidget({ object, title, subtitle, media: media2, avatar, icon = "bot", product, status, fields = [], stages, stage, lost, pathCompact, actions = [], onOpen, labels, className, ...rest }) {
7208
- const L = { ...DEFAULT_LABELS55, ...labels };
7209
- const mediaNode = media2 || (avatar ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Avatar, { size: "lg", name: avatar }) : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(BlockIcon, { size: "xl", icon, product }));
7373
+ const L = { ...DEFAULT_LABELS56, ...labels };
7374
+ const mediaNode = media2 || (avatar ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Avatar, { size: "lg", name: avatar }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(BlockIcon, { size: "xl", icon, product }));
7210
7375
  const st = status && (typeof status === "string" ? { label: status } : status);
7211
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Card, { padding: "md", as: "div", className: cx("agn-record", className), ...rest, children: [
7212
- /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "agn-record__head", children: [
7376
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Card, { padding: "md", as: "div", className: cx("agn-record", className), ...rest, children: [
7377
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "agn-record__head", children: [
7213
7378
  mediaNode,
7214
- /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "agn-record__heading", children: [
7215
- object && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: object }),
7216
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("h3", { className: "agn-record__title", children: title }),
7217
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: "agn-record__sub", children: subtitle })
7379
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "agn-record__heading", children: [
7380
+ object && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "agn-eyebrow agn-eyebrow--quiet", children: object }),
7381
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h3", { className: "agn-record__title", children: title }),
7382
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "agn-record__sub", children: subtitle })
7218
7383
  ] }),
7219
- /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "agn-record__side", children: [
7220
- st && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Tag, { tone: st.tone, dot: st.dot, icon: st.icon, children: st.label }),
7221
- onOpen && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ButtonIcon, { icon: "arrow-up-right", label: L.open, size: "sm", onClick: onOpen })
7384
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "agn-record__side", children: [
7385
+ st && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Tag, { tone: st.tone, dot: st.dot, icon: st.icon, children: st.label }),
7386
+ onOpen && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ButtonIcon, { icon: "arrow-up-right", label: L.open, size: "sm", onClick: onOpen })
7222
7387
  ] })
7223
7388
  ] }),
7224
- fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(SummaryDetail, { fields, dense: true, className: "agn-record__fields" }),
7225
- stages && stages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Path, { steps: stages, current: stage, lost, compact: pathCompact, labels: { stage: L.stage, ...L.path || {} }, className: "agn-record__path" }),
7226
- actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: "agn-record__actions", children: actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { size: "sm", variant: a.variant || (i === 0 ? "neutral" : "ghost"), icon: a.icon, onClick: a.onClick, disabled: a.disabled, children: a.label }, a.label || i)) })
7389
+ fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(SummaryDetail, { fields, dense: true, className: "agn-record__fields" }),
7390
+ stages && stages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Path, { steps: stages, current: stage, lost, compact: pathCompact, labels: { stage: L.stage, ...L.path || {} }, className: "agn-record__path" }),
7391
+ actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "agn-record__actions", children: actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Button, { size: "sm", variant: a.variant || (i === 0 ? "neutral" : "ghost"), icon: a.icon, onClick: a.onClick, disabled: a.disabled, children: a.label }, a.label || i)) })
7227
7392
  ] });
7228
7393
  }
7229
7394
 
7230
7395
  // src/dashboard/TeamWorkloadWidget.jsx
7231
- var import_react128 = __toESM(require("react"), 1);
7232
- var import_jsx_runtime126 = require("react/jsx-runtime");
7233
- var DEFAULT_LABELS56 = { title: "Team workload", over: "Over capacity", overCount: "over capacity", unit: "tasks", load: "workload", viewAll: "View all" };
7396
+ var import_react129 = __toESM(require("react"), 1);
7397
+ var import_jsx_runtime127 = require("react/jsx-runtime");
7398
+ var DEFAULT_LABELS57 = { title: "Team workload", over: "Over capacity", overCount: "over capacity", unit: "tasks", load: "workload", viewAll: "View all" };
7234
7399
  function TeamWorkloadWidget({ members = [], title, unit, overAt = 1, onMember, viewAll, labels, className, ...rest }) {
7235
- const L = { ...DEFAULT_LABELS56, ...labels };
7400
+ const L = { ...DEFAULT_LABELS57, ...labels };
7236
7401
  const u = unit || L.unit;
7237
7402
  const rows = members.map((m) => ({ ...m, ratio: m.value / (m.capacity || 1) }));
7238
7403
  const overN = rows.filter((r) => r.ratio > overAt).length;
7239
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Card, { title: title || L.title, icon: "users", viewAll, labels: { viewAll: L.viewAll }, actions: overN > 0 && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Tag, { tone: "warn", icon: "triangle-alert", children: [
7404
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Card, { title: title || L.title, icon: "users", viewAll, labels: { viewAll: L.viewAll }, actions: overN > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(Tag, { tone: "warn", icon: "triangle-alert", children: [
7240
7405
  overN,
7241
7406
  " ",
7242
7407
  L.overCount
7243
- ] }), className: cx("agn-workload", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("ul", { className: "agn-workload__list", children: rows.map((m, i) => {
7408
+ ] }), className: cx("agn-workload", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("ul", { className: "agn-workload__list", children: rows.map((m, i) => {
7244
7409
  const over = m.ratio > overAt;
7245
7410
  const text = m.value + " / " + m.capacity + " " + u;
7246
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("li", { className: cx("agn-workload__row", over && "agn-workload__row--over"), children: [
7247
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Avatar, { size: "sm", name: m.name, kind: m.kind || "person", status: m.status }),
7248
- /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "agn-workload__who", children: [
7249
- onMember ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("button", { type: "button", className: "agn-workload__name agn-workload__name--link agn-focus", onClick: () => onMember(m), children: m.name }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "agn-workload__name", children: m.name }),
7250
- m.role && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "agn-workload__role", children: m.role })
7411
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("li", { className: cx("agn-workload__row", over && "agn-workload__row--over"), children: [
7412
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Avatar, { size: "sm", name: m.name, kind: m.kind || "person", status: m.status }),
7413
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "agn-workload__who", children: [
7414
+ onMember ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("button", { type: "button", className: "agn-workload__name agn-workload__name--link agn-focus", onClick: () => onMember(m), children: m.name }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "agn-workload__name", children: m.name }),
7415
+ m.role && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "agn-workload__role", children: m.role })
7251
7416
  ] }),
7252
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ProgressBar, { className: "agn-workload__bar", size: "sm", value: Math.min(m.value, m.capacity), max: m.capacity, tone: over ? "warn" : "signal", valueText: text, labels: { working: m.name + " " + L.load } }),
7253
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "agn-workload__value agn-num", children: text }),
7254
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "agn-workload__flag", children: over && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_jsx_runtime126.Fragment, { children: [
7255
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon, { name: "triangle-alert", size: 12 }),
7417
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ProgressBar, { className: "agn-workload__bar", size: "sm", value: Math.min(m.value, m.capacity), max: m.capacity, tone: over ? "warn" : "signal", valueText: text, labels: { working: m.name + " " + L.load } }),
7418
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "agn-workload__value agn-num", children: text }),
7419
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "agn-workload__flag", children: over && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
7420
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Icon, { name: "triangle-alert", size: 12 }),
7256
7421
  L.over
7257
7422
  ] }) })
7258
7423
  ] }, m.id || m.name || i);
@@ -7260,14 +7425,14 @@ function TeamWorkloadWidget({ members = [], title, unit, overAt = 1, onMember, v
7260
7425
  }
7261
7426
 
7262
7427
  // src/dashboard/ActivityWidget.jsx
7263
- var import_react129 = __toESM(require("react"), 1);
7264
- var import_jsx_runtime127 = require("react/jsx-runtime");
7428
+ var import_react130 = __toESM(require("react"), 1);
7429
+ var import_jsx_runtime128 = require("react/jsx-runtime");
7265
7430
  var KINDS = { runs: ["run", "step", "agent", "deploy", "error", "success"], approvals: ["approval", "handoff", "warn"], conversations: ["call", "message", "email"], notes: ["note", "edit", "event"] };
7266
- var DEFAULT_LABELS57 = { title: "Activity", filter: "Activity type", all: "All", runs: "Runs", approvals: "Approvals", conversations: "Conversations", notes: "Notes", empty: "No activity of this type", emptyHint: "Pick another type to see more.", viewAll: "View all", show: "Show details", hide: "Hide details" };
7431
+ var DEFAULT_LABELS58 = { title: "Activity", filter: "Activity type", all: "All", runs: "Runs", approvals: "Approvals", conversations: "Conversations", notes: "Notes", empty: "No activity of this type", emptyHint: "Pick another type to see more.", viewAll: "View all", show: "Show details", hide: "Hide details" };
7267
7432
  function ActivityWidget({ items = [], types, type, defaultType = "all", onTypeChange, title, max, compact = true, viewAll, labels, className, ...rest }) {
7268
- const L = { ...DEFAULT_LABELS57, ...labels };
7433
+ const L = { ...DEFAULT_LABELS58, ...labels };
7269
7434
  const opts = types || [{ value: "all", label: L.all }, ...Object.keys(KINDS).map((k) => ({ value: k, label: L[k], kinds: KINDS[k] }))];
7270
- const [own, setOwn] = import_react129.default.useState(defaultType);
7435
+ const [own, setOwn] = import_react130.default.useState(defaultType);
7271
7436
  const t = type !== void 0 ? type : own;
7272
7437
  const set = (v) => {
7273
7438
  if (type === void 0) setOwn(v);
@@ -7275,43 +7440,43 @@ function ActivityWidget({ items = [], types, type, defaultType = "all", onTypeCh
7275
7440
  };
7276
7441
  const cur = opts.find((o) => o.value === t);
7277
7442
  const shown = (cur && cur.kinds ? items.filter((it) => cur.kinds.includes(it.kind)) : items).slice(0, max || void 0);
7278
- return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(Card, { title: title || L.title, icon: "history", viewAll, labels: { viewAll: L.viewAll }, className: cx("agn-activity-w", className), ...rest, children: [
7279
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "agn-activity-w__filter", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(SegmentedControl, { size: "sm", options: opts.map((o) => ({ label: o.label, value: o.value })), value: t, onChange: set, label: L.filter }) }),
7280
- shown.length ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ActivityTimeline, { items: shown, compact, labels: { show: L.show, hide: L.hide } }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(EmptyState, { compact: true, icon: "history", title: L.empty, children: L.emptyHint })
7443
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(Card, { title: title || L.title, icon: "history", viewAll, labels: { viewAll: L.viewAll }, className: cx("agn-activity-w", className), ...rest, children: [
7444
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "agn-activity-w__filter", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(SegmentedControl, { size: "sm", options: opts.map((o) => ({ label: o.label, value: o.value })), value: t, onChange: set, label: L.filter }) }),
7445
+ shown.length ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(ActivityTimeline, { items: shown, compact, labels: { show: L.show, hide: L.hide } }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(EmptyState, { compact: true, icon: "history", title: L.empty, children: L.emptyHint })
7281
7446
  ] });
7282
7447
  }
7283
7448
 
7284
7449
  // src/dashboard/QuickActions.jsx
7285
- var import_react130 = __toESM(require("react"), 1);
7286
- var import_jsx_runtime128 = require("react/jsx-runtime");
7287
- var DEFAULT_LABELS58 = { title: "Quick actions" };
7450
+ var import_react131 = __toESM(require("react"), 1);
7451
+ var import_jsx_runtime129 = require("react/jsx-runtime");
7452
+ var DEFAULT_LABELS59 = { title: "Quick actions" };
7288
7453
  function QuickActions({ actions = [], onAction, columns, minTile = 168, title, labels, className, style, ...rest }) {
7289
- const L = { ...DEFAULT_LABELS58, ...labels };
7454
+ const L = { ...DEFAULT_LABELS59, ...labels };
7290
7455
  const gridStyle = columns ? { gridTemplateColumns: "repeat(" + columns + ", minmax(0, 1fr))" } : { "--agn-quick-min": minTile + "px" };
7291
- const grid = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: cx("agn-quick", !title && className), role: "group", "aria-label": title || L.title, style: title ? gridStyle : { ...gridStyle, ...style }, ...title ? {} : rest, children: actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("button", { type: "button", className: "agn-quick__tile agn-focus", disabled: a.disabled, onClick: () => {
7456
+ const grid = /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: cx("agn-quick", !title && className), role: "group", "aria-label": title || L.title, style: title ? gridStyle : { ...gridStyle, ...style }, ...title ? {} : rest, children: actions.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("button", { type: "button", className: "agn-quick__tile agn-focus", disabled: a.disabled, onClick: () => {
7292
7457
  a.onClick && a.onClick(a);
7293
7458
  onAction && onAction(a);
7294
7459
  }, children: [
7295
- /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("span", { className: "agn-quick__top", children: [
7296
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(BlockIcon, { icon: a.icon, product: a.product, tone: a.tone || "signal", size: "lg" }),
7297
- a.shortcut && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Kbd, { size: "sm", keys: Array.isArray(a.shortcut) ? a.shortcut : String(a.shortcut).split(" "), className: "agn-quick__kbd" }),
7298
- a.badge != null && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Badge, { count: a.badge, solid: true, size: "sm", className: "agn-quick__badge" })
7460
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("span", { className: "agn-quick__top", children: [
7461
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(BlockIcon, { icon: a.icon, product: a.product, tone: a.tone || "signal", size: "lg" }),
7462
+ a.shortcut && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Kbd, { size: "sm", keys: Array.isArray(a.shortcut) ? a.shortcut : String(a.shortcut).split(" "), className: "agn-quick__kbd" }),
7463
+ a.badge != null && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Badge, { count: a.badge, solid: true, size: "sm", className: "agn-quick__badge" })
7299
7464
  ] }),
7300
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "agn-quick__label", children: a.label }),
7301
- a.description && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "agn-quick__desc", children: a.description })
7465
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "agn-quick__label", children: a.label }),
7466
+ a.description && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "agn-quick__desc", children: a.description })
7302
7467
  ] }, a.id || a.label || i)) });
7303
7468
  if (!title) return grid;
7304
- return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Card, { title, icon: "zap", padding: "sm", className: cx("agn-quick-card", className), style, ...rest, children: grid });
7469
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Card, { title, icon: "zap", padding: "sm", className: cx("agn-quick-card", className), style, ...rest, children: grid });
7305
7470
  }
7306
7471
 
7307
7472
  // src/dashboard/NotificationsWidget.jsx
7308
- var import_react131 = __toESM(require("react"), 1);
7309
- var import_jsx_runtime129 = require("react/jsx-runtime");
7310
- var DEFAULT_LABELS59 = { title: "Notifications", markAll: "Mark all as read", today: "Today", yesterday: "Yesterday", empty: "You are all caught up", viewAll: "View all" };
7473
+ var import_react132 = __toESM(require("react"), 1);
7474
+ var import_jsx_runtime130 = require("react/jsx-runtime");
7475
+ var DEFAULT_LABELS60 = { title: "Notifications", markAll: "Mark all as read", today: "Today", yesterday: "Yesterday", empty: "You are all caught up", viewAll: "View all" };
7311
7476
  function NotificationsWidget({ items = [], title, onMarkAll, onItem, max, locale, viewAll, labels, className, ...rest }) {
7312
- const L = { ...DEFAULT_LABELS59, ...labels };
7313
- const [readAll, setReadAll] = import_react131.default.useState(false);
7314
- const [read2, setRead] = import_react131.default.useState({});
7477
+ const L = { ...DEFAULT_LABELS60, ...labels };
7478
+ const [readAll, setReadAll] = import_react132.default.useState(false);
7479
+ const [read2, setRead] = import_react132.default.useState({});
7315
7480
  const list = items.slice(0, max || void 0).map((it, i) => {
7316
7481
  const key = it.id || String(i);
7317
7482
  const open = onItem || it.onClick;
@@ -7322,41 +7487,41 @@ function NotificationsWidget({ items = [], title, onMarkAll, onItem, max, locale
7322
7487
  } : void 0 };
7323
7488
  });
7324
7489
  const anyUnread = list.some((i) => i.unread);
7325
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Card, { as: "div", padding: "none", viewAll, labels: { viewAll: L.viewAll }, className: cx("agn-notifs-w", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(NotificationList, { bare: true, title: title || L.title, items: list, locale, onMarkAll: anyUnread ? () => {
7490
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Card, { as: "div", padding: "none", viewAll, labels: { viewAll: L.viewAll }, className: cx("agn-notifs-w", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(NotificationList, { bare: true, title: title || L.title, items: list, locale, onMarkAll: anyUnread ? () => {
7326
7491
  setReadAll(true);
7327
7492
  onMarkAll && onMarkAll();
7328
7493
  } : void 0, labels: { title: L.title, markAll: L.markAll, today: L.today, yesterday: L.yesterday, empty: L.empty } }) });
7329
7494
  }
7330
7495
 
7331
7496
  // src/dashboard/AgentFlowWidget.jsx
7332
- var import_react132 = __toESM(require("react"), 1);
7333
- var import_jsx_runtime130 = require("react/jsx-runtime");
7497
+ var import_react133 = __toESM(require("react"), 1);
7498
+ var import_jsx_runtime131 = require("react/jsx-runtime");
7334
7499
  var STATE2 = { done: "default", running: "running", error: "error", waiting: "default", upcoming: "default" };
7335
7500
  var CAP_ICON = { done: "check", running: "loader-circle", error: "circle-alert", waiting: "pause", upcoming: "minus" };
7336
- var DEFAULT_LABELS60 = { flow: "Agent steps", done: "Done", running: "Running", error: "Failed", waiting: "Waiting", upcoming: "Not reached", live: "live runs", liveOne: "live run", open: "Open in builder" };
7501
+ var DEFAULT_LABELS61 = { flow: "Agent steps", done: "Done", running: "Running", error: "Failed", waiting: "Waiting", upcoming: "Not reached", live: "live runs", liveOne: "live run", open: "Open in builder" };
7337
7502
  function AgentFlowWidget({ agent, title, steps = [], liveRuns, version, blockWidth = 160, gap = 24, onOpen, labels, className, ...rest }) {
7338
- const L = { ...DEFAULT_LABELS60, ...labels };
7503
+ const L = { ...DEFAULT_LABELS61, ...labels };
7339
7504
  const reached = (s) => s && s.state && s.state !== "upcoming";
7340
7505
  const edgeState = (s) => s.state === "running" || s.state === "waiting" ? "running" : reached(s) ? "active" : "deleted";
7341
- const head = /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
7506
+ const head = /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
7342
7507
  title || agent,
7343
- version && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "agn-flow__version", children: version })
7508
+ version && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-flow__version", children: version })
7344
7509
  ] });
7345
- const actions = (liveRuns != null || onOpen) && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
7346
- liveRuns != null && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(Tag, { tone: liveRuns > 0 ? "signal" : "neutral", dot: liveRuns > 0, children: [
7510
+ const actions = (liveRuns != null || onOpen) && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
7511
+ liveRuns != null && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(Tag, { tone: liveRuns > 0 ? "signal" : "neutral", dot: liveRuns > 0, children: [
7347
7512
  liveRuns,
7348
7513
  " ",
7349
7514
  liveRuns === 1 ? L.liveOne : L.live
7350
7515
  ] }),
7351
- onOpen && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ButtonIcon, { icon: "arrow-up-right", label: L.open, size: "sm", onClick: onOpen })
7516
+ onOpen && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ButtonIcon, { icon: "arrow-up-right", label: L.open, size: "sm", onClick: onOpen })
7352
7517
  ] });
7353
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Card, { title: head, icon: "route", actions, padding: "none", className: cx("agn-flow-w", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "agn-flow", role: "list", "aria-label": L.flow, children: steps.map((s, i) => {
7518
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Card, { title: head, icon: "route", actions, padding: "none", className: cx("agn-flow-w", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "agn-flow", role: "list", "aria-label": L.flow, children: steps.map((s, i) => {
7354
7519
  const st = s.state || "upcoming";
7355
7520
  const caption = st === "upcoming" ? L.upcoming : (s.runs != null ? s.runs + " \xB7 " : "") + L[st];
7356
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_react132.default.Fragment, { children: [
7357
- i > 0 && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("svg", { className: "agn-flow__edge", width: gap, height: 16, viewBox: "0 0 " + gap + " 16", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(CanvasEdge, { from: { x: 2, y: 8 }, to: { x: gap - 3, y: 8 }, state: edgeState(s) }) }),
7358
- /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "agn-flow__step", role: "listitem", "aria-current": st === "running" ? "step" : void 0, style: { width: blockWidth }, children: [
7359
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
7521
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_react133.default.Fragment, { children: [
7522
+ i > 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("svg", { className: "agn-flow__edge", width: gap, height: 16, viewBox: "0 0 " + gap + " 16", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(CanvasEdge, { from: { x: 2, y: 8 }, to: { x: gap - 3, y: 8 }, state: edgeState(s) }) }),
7523
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "agn-flow__step", role: "listitem", "aria-current": st === "running" ? "step" : void 0, style: { width: blockWidth }, children: [
7524
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
7360
7525
  CanvasBlock,
7361
7526
  {
7362
7527
  name: s.name,
@@ -7370,8 +7535,8 @@ function AgentFlowWidget({ agent, title, steps = [], liveRuns, version, blockWid
7370
7535
  style: { width: blockWidth }
7371
7536
  }
7372
7537
  ),
7373
- /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: cx("agn-flow__caption", "agn-flow__caption--" + st), children: [
7374
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: CAP_ICON[st], size: 12, className: st === "running" ? "agn-flow__spin" : void 0 }),
7538
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: cx("agn-flow__caption", "agn-flow__caption--" + st), children: [
7539
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: CAP_ICON[st], size: 12, className: st === "running" ? "agn-flow__spin" : void 0 }),
7375
7540
  caption
7376
7541
  ] })
7377
7542
  ] })
@@ -7380,12 +7545,12 @@ function AgentFlowWidget({ agent, title, steps = [], liveRuns, version, blockWid
7380
7545
  }
7381
7546
 
7382
7547
  // src/dashboard/LeaderboardWidget.jsx
7383
- var import_react133 = __toESM(require("react"), 1);
7384
- var import_jsx_runtime131 = require("react/jsx-runtime");
7385
- var DEFAULT_LABELS61 = { title: "Leaderboard", period: "Period", rank: "Rank", name: "Name", value: "Value", change: "Change", up: "up", down: "down", flat: "no change", viewAll: "View all" };
7548
+ var import_react134 = __toESM(require("react"), 1);
7549
+ var import_jsx_runtime132 = require("react/jsx-runtime");
7550
+ var DEFAULT_LABELS62 = { title: "Leaderboard", period: "Period", rank: "Rank", name: "Name", value: "Value", change: "Change", up: "up", down: "down", flat: "no change", viewAll: "View all" };
7386
7551
  function LeaderboardWidget({ rows = [], title, metric, periods, period, defaultPeriod, onPeriodChange, format = (v) => String(v), deltaFormat = (v) => (v > 0 ? "+" : "") + v, invert, highlight, max, sort = true, viewAll, labels, className, ...rest }) {
7387
- const L = { ...DEFAULT_LABELS61, ...labels };
7388
- const [own, setOwn] = import_react133.default.useState(defaultPeriod != null ? defaultPeriod : periods && periods.length ? typeof periods[0] === "string" ? periods[0] : periods[0].value : void 0);
7552
+ const L = { ...DEFAULT_LABELS62, ...labels };
7553
+ const [own, setOwn] = import_react134.default.useState(defaultPeriod != null ? defaultPeriod : periods && periods.length ? typeof periods[0] === "string" ? periods[0] : periods[0].value : void 0);
7389
7554
  const per = period !== void 0 ? period : own;
7390
7555
  const setPer = (v) => {
7391
7556
  if (period === void 0) setOwn(v);
@@ -7393,33 +7558,33 @@ function LeaderboardWidget({ rows = [], title, metric, periods, period, defaultP
7393
7558
  };
7394
7559
  const list = (sort ? [...rows].sort((a, b) => invert ? a.value - b.value : b.value - a.value) : rows).slice(0, max || void 0);
7395
7560
  const top = Math.max(...list.map((r) => r.value), 1);
7396
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(Card, { title: title || L.title, icon: "list-ordered", viewAll, labels: { viewAll: L.viewAll }, actions: periods && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SegmentedControl, { size: "sm", options: periods, value: per, onChange: setPer, label: L.period }), className: cx("agn-leader", className), ...rest, children: [
7397
- /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "agn-leader__head", "aria-hidden": "true", children: [
7398
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { children: "#" }),
7399
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { children: L.name }),
7400
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__head-value", children: metric || L.value }),
7401
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { children: L.change })
7561
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(Card, { title: title || L.title, icon: "list-ordered", viewAll, labels: { viewAll: L.viewAll }, actions: periods && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SegmentedControl, { size: "sm", options: periods, value: per, onChange: setPer, label: L.period }), className: cx("agn-leader", className), ...rest, children: [
7562
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "agn-leader__head", "aria-hidden": "true", children: [
7563
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: "#" }),
7564
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: L.name }),
7565
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__head-value", children: metric || L.value }),
7566
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: L.change })
7402
7567
  ] }),
7403
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("ol", { className: "agn-leader__list", children: list.map((r, i) => {
7568
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("ol", { className: "agn-leader__list", children: list.map((r, i) => {
7404
7569
  const d = r.delta;
7405
7570
  const dir = d == null || d === 0 ? "flat" : d > 0 ? "up" : "down";
7406
7571
  const good = dir === "flat" ? null : dir === "up" !== !!invert;
7407
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("li", { className: cx("agn-leader__row", highlight != null && (r.id === highlight || r.name === highlight) && "agn-leader__row--hl"), children: [
7408
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__rank agn-num", children: i + 1 }),
7409
- /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: "agn-leader__who", children: [
7410
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Avatar, { size: "sm", name: r.name, kind: r.kind || "agent", product: r.product, icon: r.icon }),
7411
- /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: "agn-leader__text", children: [
7412
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__name", children: r.name }),
7413
- r.sub && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__sub", children: r.sub })
7572
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("li", { className: cx("agn-leader__row", highlight != null && (r.id === highlight || r.name === highlight) && "agn-leader__row--hl"), children: [
7573
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__rank agn-num", children: i + 1 }),
7574
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-leader__who", children: [
7575
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Avatar, { size: "sm", name: r.name, kind: r.kind || "agent", product: r.product, icon: r.icon }),
7576
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-leader__text", children: [
7577
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__name", children: r.name }),
7578
+ r.sub && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__sub", children: r.sub })
7414
7579
  ] })
7415
7580
  ] }),
7416
- /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: "agn-leader__measure", children: [
7417
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__bar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__fill", style: { width: Math.max(2, r.value / top * 100) + "%" } }) }),
7418
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "agn-leader__value agn-num", children: format(r.value) })
7581
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-leader__measure", children: [
7582
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__bar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__fill", style: { width: Math.max(2, r.value / top * 100) + "%" } }) }),
7583
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-leader__value agn-num", children: format(r.value) })
7419
7584
  ] }),
7420
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: cx("agn-leader__delta", "agn-leader__delta--" + (good == null ? "flat" : good ? "ok" : "bad")), children: d != null && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
7421
- /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: dir === "up" ? "arrow-up-right" : dir === "down" ? "arrow-down-right" : "minus", size: 12 }),
7422
- /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: "agn-sr", children: [
7585
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: cx("agn-leader__delta", "agn-leader__delta--" + (good == null ? "flat" : good ? "ok" : "bad")), children: d != null && /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
7586
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: dir === "up" ? "arrow-up-right" : dir === "down" ? "arrow-down-right" : "minus", size: 12 }),
7587
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-sr", children: [
7423
7588
  L[dir],
7424
7589
  " "
7425
7590
  ] }),
@@ -7431,14 +7596,14 @@ function LeaderboardWidget({ rows = [], title, metric, periods, period, defaultP
7431
7596
  }
7432
7597
 
7433
7598
  // src/dashboard/AgendaWidget.jsx
7434
- var import_react134 = __toESM(require("react"), 1);
7435
- var import_jsx_runtime132 = require("react/jsx-runtime");
7599
+ var import_react135 = __toESM(require("react"), 1);
7600
+ var import_jsx_runtime133 = require("react/jsx-runtime");
7436
7601
  var KIND_ICON2 = { run: "play", review: "user-check", call: "phone", maintenance: "wrench", deploy: "rocket", meeting: "users" };
7437
- var DEFAULT_LABELS62 = { title: "Today", add: "Schedule a run", empty: "Nothing scheduled", emptyHint: "Scheduled runs and reviews for this day appear here.", now: "Now", done: "Done", live: "Live", soon: "in {n} min", allDay: "All day", run: "Scheduled run", review: "Review", call: "Call", maintenance: "Maintenance", deploy: "Deploy", meeting: "Meeting", viewAll: "Open calendar" };
7602
+ var DEFAULT_LABELS63 = { title: "Today", add: "Schedule a run", empty: "Nothing scheduled", emptyHint: "Scheduled runs and reviews for this day appear here.", now: "Now", done: "Done", live: "Live", soon: "in {n} min", allDay: "All day", run: "Scheduled run", review: "Review", call: "Call", maintenance: "Maintenance", deploy: "Deploy", meeting: "Meeting", viewAll: "Open calendar" };
7438
7603
  var toDate3 = (d) => d instanceof Date ? d : new Date(d);
7439
7604
  var sameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
7440
7605
  function AgendaWidget({ events = [], date, now, locale = "en", title, onEvent, onAdd, max, viewAll, labels, className, ...rest }) {
7441
- const L = { ...DEFAULT_LABELS62, ...labels };
7606
+ const L = { ...DEFAULT_LABELS63, ...labels };
7442
7607
  locale = /^en$/i.test(locale) ? "en-GB" : locale;
7443
7608
  const nowD = now ? toDate3(now) : /* @__PURE__ */ new Date();
7444
7609
  const day = date ? toDate3(date) : nowD;
@@ -7451,42 +7616,42 @@ function AgendaWidget({ events = [], date, now, locale = "en", title, onEvent, o
7451
7616
  }).filter((e) => sameDay2(e._s, day)).sort((a, b) => a.allDay ? -1 : b.allDay ? 1 : a._s - b._s).slice(0, max || void 0);
7452
7617
  const showNow = sameDay2(day, nowD);
7453
7618
  const nowAt = showNow ? list.findIndex((e) => !e.allDay && !e._past && !e._live) : -1;
7454
- const actions = /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
7455
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__date agn-num", children: dayText }),
7456
- onAdd && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(ButtonIcon, { icon: "calendar-plus", label: L.add, size: "sm", onClick: onAdd })
7619
+ const actions = /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
7620
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__date agn-num", children: dayText }),
7621
+ onAdd && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(ButtonIcon, { icon: "calendar-plus", label: L.add, size: "sm", onClick: onAdd })
7457
7622
  ] });
7458
- const nowLine = /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("li", { className: "agn-agenda__now", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-agenda__now-label agn-num", children: [
7623
+ const nowLine = /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("li", { className: "agn-agenda__now", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { className: "agn-agenda__now-label agn-num", children: [
7459
7624
  L.now,
7460
7625
  " ",
7461
7626
  tm(nowD)
7462
7627
  ] }) }, "now");
7463
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Card, { title: title || L.title, icon: "calendar-days", actions, viewAll, labels: { viewAll: L.viewAll }, padding: "none", className: cx("agn-agenda", className), ...rest, children: list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "agn-agenda__empty", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(EmptyState, { compact: true, icon: "calendar", title: L.empty, children: L.emptyHint }) }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("ol", { className: "agn-agenda__list", children: [
7628
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Card, { title: title || L.title, icon: "calendar-days", actions, viewAll, labels: { viewAll: L.viewAll }, padding: "none", className: cx("agn-agenda", className), ...rest, children: list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "agn-agenda__empty", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(EmptyState, { compact: true, icon: "calendar", title: L.empty, children: L.emptyHint }) }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("ol", { className: "agn-agenda__list", children: [
7464
7629
  list.map((e, i) => {
7465
7630
  const mins = Math.round((e._s - nowD) / 6e4);
7466
7631
  const Title = onEvent ? "button" : "span";
7467
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_react134.default.Fragment, { children: [
7632
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_react135.default.Fragment, { children: [
7468
7633
  i === nowAt && nowLine,
7469
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("li", { className: cx("agn-agenda__item", "agn-agenda__item--" + (e.tone || "signal"), e._past && "agn-agenda__item--past", e._live && "agn-agenda__item--live"), children: [
7470
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__time agn-num", children: e.allDay ? L.allDay : /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
7634
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("li", { className: cx("agn-agenda__item", "agn-agenda__item--" + (e.tone || "signal"), e._past && "agn-agenda__item--past", e._live && "agn-agenda__item--live"), children: [
7635
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__time agn-num", children: e.allDay ? L.allDay : /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
7471
7636
  tm(e._s),
7472
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__end", children: tm(e._e) })
7637
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__end", children: tm(e._e) })
7473
7638
  ] }) }),
7474
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__bar", "aria-hidden": "true" }),
7475
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-agenda__main", children: [
7476
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Title, { type: onEvent ? "button" : void 0, className: cx("agn-agenda__title", onEvent && "agn-agenda__title--link agn-focus"), onClick: onEvent ? () => onEvent(e) : void 0, children: e.title }),
7477
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-agenda__meta", children: [
7478
- e.kind && /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-agenda__kind", children: [
7479
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: KIND_ICON2[e.kind] || "circle", size: 12 }),
7639
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__bar", "aria-hidden": "true" }),
7640
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { className: "agn-agenda__main", children: [
7641
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Title, { type: onEvent ? "button" : void 0, className: cx("agn-agenda__title", onEvent && "agn-agenda__title--link agn-focus"), onClick: onEvent ? () => onEvent(e) : void 0, children: e.title }),
7642
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { className: "agn-agenda__meta", children: [
7643
+ e.kind && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { className: "agn-agenda__kind", children: [
7644
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: KIND_ICON2[e.kind] || "circle", size: 12 }),
7480
7645
  L[e.kind] || e.kind
7481
7646
  ] }),
7482
- e.tenant && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__tenant", children: e.tenant }),
7483
- e.meta && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: e.meta })
7647
+ e.tenant && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__tenant", children: e.tenant }),
7648
+ e.meta && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { children: e.meta })
7484
7649
  ] })
7485
7650
  ] }),
7486
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__status", children: e._live ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Tag, { tone: "signal", dot: true, children: L.live }) : e._past ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "agn-agenda__done", children: [
7487
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: "check", size: 12 }),
7651
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__status", children: e._live ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Tag, { tone: "signal", dot: true, children: L.live }) : e._past ? /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { className: "agn-agenda__done", children: [
7652
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: "check", size: 12 }),
7488
7653
  L.done
7489
- ] }) : showNow && mins > 0 && mins <= 60 ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "agn-agenda__soon agn-num", children: L.soon.replace("{n}", mins) }) : null })
7654
+ ] }) : showNow && mins > 0 && mins <= 60 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agn-agenda__soon agn-num", children: L.soon.replace("{n}", mins) }) : null })
7490
7655
  ] })
7491
7656
  ] }, e.id || i);
7492
7657
  }),
@@ -7495,30 +7660,30 @@ function AgendaWidget({ events = [], date, now, locale = "en", title, onEvent, o
7495
7660
  }
7496
7661
 
7497
7662
  // src/dashboard/OnboardingWidget.jsx
7498
- var import_react135 = __toESM(require("react"), 1);
7499
- var import_jsx_runtime133 = require("react/jsx-runtime");
7500
- var DEFAULT_LABELS63 = { title: "Get started", hide: "Hide", complete: "Setup complete", completeHint: "Every step is done. You can hide this card.", progress: "completed", done: "Done", optional: "optional" };
7663
+ var import_react136 = __toESM(require("react"), 1);
7664
+ var import_jsx_runtime134 = require("react/jsx-runtime");
7665
+ var DEFAULT_LABELS64 = { title: "Get started", hide: "Hide", complete: "Setup complete", completeHint: "Every step is done. You can hide this card.", progress: "completed", done: "Done", optional: "optional" };
7501
7666
  function OnboardingWidget({ title, heading, description, steps = [], onDismiss, labels, className, ...rest }) {
7502
- const L = { ...DEFAULT_LABELS63, ...labels };
7667
+ const L = { ...DEFAULT_LABELS64, ...labels };
7503
7668
  const all = steps.length > 0 && steps.every((s) => s.done);
7504
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Card, { title: title || L.title, icon: "rocket", actions: onDismiss && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(ButtonIcon, { icon: "x", label: L.hide, size: "xs", onClick: onDismiss }), className: cx("agn-onboard", className), ...rest, children: all ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(EmptyState, { compact: true, icon: "circle-check", title: L.complete, children: L.completeHint }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(SetupAssistant, { bare: true, title: heading, description, steps, labels: { progress: L.progress, done: L.done, optional: L.optional } }) });
7669
+ return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Card, { title: title || L.title, icon: "rocket", actions: onDismiss && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ButtonIcon, { icon: "x", label: L.hide, size: "xs", onClick: onDismiss }), className: cx("agn-onboard", className), ...rest, children: all ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(EmptyState, { compact: true, icon: "circle-check", title: L.complete, children: L.completeHint }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(SetupAssistant, { bare: true, title: heading, description, steps, labels: { progress: L.progress, done: L.done, optional: L.optional } }) });
7505
7670
  }
7506
7671
 
7507
7672
  // src/dashboard/CommentsWidget.jsx
7508
- var import_react136 = __toESM(require("react"), 1);
7509
- var import_jsx_runtime134 = require("react/jsx-runtime");
7510
- var DEFAULT_LABELS64 = { title: "Comments", placeholder: "Add a comment \u2014 @ mentions a teammate", submit: "Comment", empty: "No comments yet", emptyHint: "Start the thread; mention a teammate with @.", now: "now", reply: "Reply", like: "Like", liked: "Liked", attach: "Attach file", mention: "Mention someone", resolved: "Resolved" };
7511
- var withMentions = (text) => typeof text !== "string" ? text : text.split(/(@[\p{L}\p{N}_.-]+)/u).map((p, i) => p.startsWith("@") && p.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "agn-comments__mention", children: p }, i) : p);
7673
+ var import_react137 = __toESM(require("react"), 1);
7674
+ var import_jsx_runtime135 = require("react/jsx-runtime");
7675
+ var DEFAULT_LABELS65 = { title: "Comments", placeholder: "Add a comment \u2014 @ mentions a teammate", submit: "Comment", empty: "No comments yet", emptyHint: "Start the thread; mention a teammate with @.", now: "now", reply: "Reply", like: "Like", liked: "Liked", attach: "Attach file", mention: "Mention someone", resolved: "Resolved" };
7676
+ var withMentions = (text) => typeof text !== "string" ? text : text.split(/(@[\p{L}\p{N}_.-]+)/u).map((p, i) => p.startsWith("@") && p.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "agn-comments__mention", children: p }, i) : p);
7512
7677
  function CommentsWidget({ comments = [], user, onSubmit, onLike, onReply, title, maxHeight = 360, labels, className, ...rest }) {
7513
- const L = { ...DEFAULT_LABELS64, ...labels };
7514
- const [added, setAdded] = import_react136.default.useState([]);
7678
+ const L = { ...DEFAULT_LABELS65, ...labels };
7679
+ const [added, setAdded] = import_react137.default.useState([]);
7515
7680
  const all = [...comments, ...added];
7516
7681
  const submit = (v) => {
7517
7682
  if (onSubmit) onSubmit(v);
7518
7683
  else setAdded([...added, { id: "local-" + added.length, author: user || "", time: L.now, text: v }]);
7519
7684
  };
7520
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(Card, { title: title || L.title, icon: "message-square", count: all.length, padding: "none", className: cx("agn-comments", className), ...rest, children: [
7521
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "agn-comments__list", style: { maxHeight }, children: all.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(EmptyState, { compact: true, icon: "message-square", title: L.empty, children: L.emptyHint }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Feed, { children: all.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
7685
+ return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Card, { title: title || L.title, icon: "message-square", count: all.length, padding: "none", className: cx("agn-comments", className), ...rest, children: [
7686
+ /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agn-comments__list", style: { maxHeight }, children: all.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(EmptyState, { compact: true, icon: "message-square", title: L.empty, children: L.emptyHint }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Feed, { children: all.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
7522
7687
  FeedPost,
7523
7688
  {
7524
7689
  author: c.author,
@@ -7533,17 +7698,18 @@ function CommentsWidget({ comments = [], user, onSubmit, onLike, onReply, title,
7533
7698
  onLike: onLike ? () => onLike(c) : void 0,
7534
7699
  onReply: onReply ? () => onReply(c) : void 0,
7535
7700
  labels: { reply: L.reply, like: L.like, liked: L.liked },
7536
- actions: c.resolved ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Tag, { tone: "ok", icon: "circle-check", children: L.resolved }) : void 0,
7701
+ actions: c.resolved ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Tag, { tone: "ok", icon: "circle-check", children: L.resolved }) : void 0,
7537
7702
  children: withMentions(c.text)
7538
7703
  },
7539
7704
  c.id || i
7540
7705
  )) }) }),
7541
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "agn-comments__composer", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Publisher, { user, placeholder: L.placeholder, submitLabel: L.submit, onSubmit: submit, labels: { placeholder: L.placeholder, submit: L.submit, attach: L.attach, mention: L.mention } }) })
7706
+ /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agn-comments__composer", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Publisher, { user, placeholder: L.placeholder, submitLabel: L.submit, onSubmit: submit, labels: { placeholder: L.placeholder, submit: L.submit, attach: L.attach, mention: L.mention } }) })
7542
7707
  ] });
7543
7708
  }
7544
7709
  // Annotate the CommonJS export names for ESM import in node:
7545
7710
  0 && (module.exports = {
7546
7711
  Accordion,
7712
+ ActivityBar,
7547
7713
  ActivityTimeline,
7548
7714
  ActivityWidget,
7549
7715
  AgendaWidget,