reifyui 0.13.7 → 0.13.8

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
@@ -71,8 +71,10 @@ __export(src_exports, {
71
71
  IcTool: () => IcTool,
72
72
  IcX: () => IcX,
73
73
  Input: () => Input,
74
+ MICROSOFT_ENABLED: () => MICROSOFT_ENABLED,
74
75
  MentionInput: () => MentionInput,
75
76
  MentionText: () => MentionText,
77
+ MicrosoftButton: () => MicrosoftButton,
76
78
  Modal: () => Modal,
77
79
  PaneResizer: () => PaneResizer,
78
80
  Panel: () => Panel,
@@ -115,6 +117,8 @@ __export(src_exports, {
115
117
  logout: () => logout,
116
118
  majorTickStep: () => majorTickStep,
117
119
  mention: () => mentionModel_exports,
120
+ microsoftIdToken: () => microsoftIdToken,
121
+ microsoftSignIn: () => microsoftSignIn,
118
122
  packLayout: () => packLayout,
119
123
  parseArgs: () => parseArgs,
120
124
  prettyJson: () => prettyJson,
@@ -2274,6 +2278,11 @@ async function googleSignIn(credential) {
2274
2278
  setSession(s);
2275
2279
  return s;
2276
2280
  }
2281
+ async function microsoftSignIn(credential) {
2282
+ const s = toSession(await authPost("/v1/auth/microsoft", { credential, product: _cfg.product }));
2283
+ setSession(s);
2284
+ return s;
2285
+ }
2277
2286
  async function requestPasswordReset(email) {
2278
2287
  await fetch(`${_cfg.engine}/v1/auth/request-password-reset`, {
2279
2288
  method: "POST",
@@ -2339,13 +2348,13 @@ async function fetchBalance() {
2339
2348
  }
2340
2349
 
2341
2350
  // src/auth/AuthForm.jsx
2342
- var import_react14 = require("react");
2351
+ var import_react15 = require("react");
2343
2352
 
2344
2353
  // src/auth/GoogleButton.jsx
2345
2354
  var import_react13 = require("react");
2346
2355
  var import_jsx_runtime11 = require("react/jsx-runtime");
2347
2356
  var CLIENT_ID = "247853836408-ojk91u8901hdlbkevid4fohmrfdot17l.apps.googleusercontent.com";
2348
- function GoogleButton({ onCredential, onError }) {
2357
+ function GoogleButton({ onCredential, onError, divider = true }) {
2349
2358
  const ref = (0, import_react13.useRef)(null);
2350
2359
  const [failed, setFailed] = (0, import_react13.useState)(false);
2351
2360
  const cb = (0, import_react13.useRef)({ onCredential, onError });
@@ -2402,23 +2411,136 @@ function GoogleButton({ onCredential, onError }) {
2402
2411
  }, []);
2403
2412
  if (!CLIENT_ID || failed) return null;
2404
2413
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2405
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "auth-or", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "or" }) }),
2414
+ divider && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "auth-or", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "or" }) }),
2406
2415
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref, className: "auth-gwrap" })
2407
2416
  ] });
2408
2417
  }
2409
2418
  var GOOGLE_ENABLED = !!CLIENT_ID;
2410
2419
 
2411
- // src/auth/AuthForm.jsx
2420
+ // src/auth/MicrosoftButton.jsx
2421
+ var import_react14 = require("react");
2412
2422
  var import_jsx_runtime12 = require("react/jsx-runtime");
2423
+ var CLIENT_ID2 = "cb5c1b6e-aca8-48dd-9da9-31320de30b73";
2424
+ var AUTHORIZE = "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize";
2425
+ var RETURN_PATH = "/auth/microsoft";
2426
+ var GIVE_UP_MS = 5 * 60 * 1e3;
2427
+ var MICROSOFT_ENABLED = !!CLIENT_ID2;
2428
+ function randomHex(bytes = 16) {
2429
+ const a = new Uint8Array(bytes);
2430
+ crypto.getRandomValues(a);
2431
+ return Array.from(a, (b) => b.toString(16).padStart(2, "0")).join("");
2432
+ }
2433
+ function jwtClaims(token) {
2434
+ try {
2435
+ const part = token.split(".")[1].replace(/-/g, "+").replace(/_/g, "/");
2436
+ const bin = atob(part + "=".repeat((4 - part.length % 4) % 4));
2437
+ return JSON.parse(new TextDecoder().decode(Uint8Array.from(bin, (c) => c.charCodeAt(0))));
2438
+ } catch {
2439
+ return {};
2440
+ }
2441
+ }
2442
+ function microsoftIdToken() {
2443
+ return new Promise((resolve, reject) => {
2444
+ const state = randomHex();
2445
+ const nonce = randomHex();
2446
+ const back = `${window.location.origin}${RETURN_PATH}`;
2447
+ const url = `${AUTHORIZE}?${new URLSearchParams({
2448
+ client_id: CLIENT_ID2,
2449
+ response_type: "id_token",
2450
+ redirect_uri: back,
2451
+ scope: "openid profile email",
2452
+ response_mode: "fragment",
2453
+ state,
2454
+ nonce,
2455
+ prompt: "select_account"
2456
+ })}`;
2457
+ const w = 480;
2458
+ const h = 640;
2459
+ const left = Math.max(0, window.screenX + (window.outerWidth - w) / 2);
2460
+ const top = Math.max(0, window.screenY + (window.outerHeight - h) / 2);
2461
+ const popup = window.open(url, "microsoft-sign-in", `width=${w},height=${h},left=${left},top=${top}`);
2462
+ if (!popup) {
2463
+ reject(new Error("Allow pop-ups for this site to sign in with Microsoft."));
2464
+ return;
2465
+ }
2466
+ const started = Date.now();
2467
+ const timer = window.setInterval(() => {
2468
+ if (popup.closed) {
2469
+ window.clearInterval(timer);
2470
+ reject(new Error("Microsoft sign in was cancelled."));
2471
+ return;
2472
+ }
2473
+ if (Date.now() - started > GIVE_UP_MS) {
2474
+ window.clearInterval(timer);
2475
+ popup.close();
2476
+ reject(new Error("Microsoft sign in took too long. Try again."));
2477
+ return;
2478
+ }
2479
+ let href = "";
2480
+ try {
2481
+ href = popup.location.href;
2482
+ } catch {
2483
+ return;
2484
+ }
2485
+ if (!href.startsWith(back)) return;
2486
+ window.clearInterval(timer);
2487
+ const params = new URLSearchParams(popup.location.hash.replace(/^#/, ""));
2488
+ popup.close();
2489
+ if (params.get("error")) {
2490
+ const why = (params.get("error_description") || "").split(/\r?\n/)[0].replace(/^AADSTS\d+:\s*/, "");
2491
+ reject(new Error(why || "Microsoft sign in did not complete."));
2492
+ return;
2493
+ }
2494
+ const token = params.get("id_token") || "";
2495
+ if (!token || params.get("state") !== state || jwtClaims(token).nonce !== nonce) {
2496
+ reject(new Error("Microsoft sign in could not be confirmed. Try again."));
2497
+ return;
2498
+ }
2499
+ resolve(token);
2500
+ }, 300);
2501
+ });
2502
+ }
2503
+ function MicrosoftLogo() {
2504
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 21 21", "aria-hidden": "true", children: [
2505
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "1", y: "1", width: "9", height: "9", fill: "#F25022" }),
2506
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "11", y: "1", width: "9", height: "9", fill: "#7FBA00" }),
2507
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "1", y: "11", width: "9", height: "9", fill: "#00A4EF" }),
2508
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "11", y: "11", width: "9", height: "9", fill: "#FFB900" })
2509
+ ] });
2510
+ }
2511
+ function MicrosoftButton({ onCredential, onError, disabled }) {
2512
+ const [waiting, setWaiting] = (0, import_react14.useState)(false);
2513
+ const cb = (0, import_react14.useRef)({ onCredential, onError });
2514
+ cb.current = { onCredential, onError };
2515
+ if (!CLIENT_ID2) return null;
2516
+ async function start() {
2517
+ setWaiting(true);
2518
+ try {
2519
+ const token = await microsoftIdToken();
2520
+ await cb.current.onCredential(token);
2521
+ } catch (ex) {
2522
+ cb.current.onError?.(ex instanceof Error ? ex.message : "Microsoft sign in failed.");
2523
+ } finally {
2524
+ setWaiting(false);
2525
+ }
2526
+ }
2527
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "auth-mswrap", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: "auth-msbtn", onClick: start, disabled: disabled || waiting, children: [
2528
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MicrosoftLogo, {}),
2529
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: waiting ? "Waiting for Microsoft..." : "Sign in with Microsoft" })
2530
+ ] }) });
2531
+ }
2532
+
2533
+ // src/auth/AuthForm.jsx
2534
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2413
2535
  function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = "" }) {
2414
- const [mode, setMode] = (0, import_react14.useState)("signin");
2415
- const [email, setEmail] = (0, import_react14.useState)("");
2416
- const [password, setPassword] = (0, import_react14.useState)("");
2417
- const [name, setName] = (0, import_react14.useState)("");
2418
- const [err, setErr] = (0, import_react14.useState)("");
2419
- const [busy, setBusy] = (0, import_react14.useState)(false);
2420
- const [choices, setChoices] = (0, import_react14.useState)(null);
2421
- const [resetSent, setResetSent] = (0, import_react14.useState)(false);
2536
+ const [mode, setMode] = (0, import_react15.useState)("signin");
2537
+ const [email, setEmail] = (0, import_react15.useState)("");
2538
+ const [password, setPassword] = (0, import_react15.useState)("");
2539
+ const [name, setName] = (0, import_react15.useState)("");
2540
+ const [err, setErr] = (0, import_react15.useState)("");
2541
+ const [busy, setBusy] = (0, import_react15.useState)(false);
2542
+ const [choices, setChoices] = (0, import_react15.useState)(null);
2543
+ const [resetSent, setResetSent] = (0, import_react15.useState)(false);
2422
2544
  async function enter(orgId) {
2423
2545
  const session = await switchOrg(orgId);
2424
2546
  onDone(session);
@@ -2447,6 +2569,17 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
2447
2569
  setBusy(false);
2448
2570
  }
2449
2571
  }
2572
+ async function onMicrosoft(credential) {
2573
+ setErr("");
2574
+ setBusy(true);
2575
+ try {
2576
+ await afterAuth(await microsoftSignIn(credential));
2577
+ } catch (ex) {
2578
+ setErr(ex instanceof Error ? ex.message : "Microsoft sign in failed.");
2579
+ } finally {
2580
+ setBusy(false);
2581
+ }
2582
+ }
2450
2583
  async function onGoogle(credential) {
2451
2584
  setErr("");
2452
2585
  setBusy(true);
@@ -2459,10 +2592,10 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
2459
2592
  }
2460
2593
  }
2461
2594
  if (choices) {
2462
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
2463
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "logo", children: brand }),
2464
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h1", { children: "Choose workspace" }),
2465
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "org-list", children: choices.map((o) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2595
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
2596
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "logo", children: brand }),
2597
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { children: "Choose workspace" }),
2598
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "org-list", children: choices.map((o) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2466
2599
  "button",
2467
2600
  {
2468
2601
  type: "button",
@@ -2480,20 +2613,20 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
2480
2613
  },
2481
2614
  o.id
2482
2615
  )) }),
2483
- err && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "auth-err", children: err })
2616
+ err && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "auth-err", children: err })
2484
2617
  ] });
2485
2618
  }
2486
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("form", { onSubmit: submit, children: [
2487
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "logo", children: brand }),
2488
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h1", { children: mode === "register" ? "Create your account" : mode === "forgot" ? "Reset password" : "Sign in" }),
2489
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "sub", children: mode === "register" ? "Get started in seconds." : mode === "forgot" ? "We will email you a reset link." : subtitle2 || "Welcome back." }),
2490
- mode === "forgot" ? resetSent ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
2491
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "auth-note", children: [
2619
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { onSubmit: submit, children: [
2620
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "logo", children: brand }),
2621
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { children: mode === "register" ? "Create your account" : mode === "forgot" ? "Reset password" : "Sign in" }),
2622
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "sub", children: mode === "register" ? "Get started in seconds." : mode === "forgot" ? "We will email you a reset link." : subtitle2 || "Welcome back." }),
2623
+ mode === "forgot" ? resetSent ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
2624
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "auth-note", children: [
2492
2625
  "If an account exists for ",
2493
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("b", { children: email.trim() }),
2626
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: email.trim() }),
2494
2627
  ", a password reset link is on its way. It is valid for 1 hour."
2495
2628
  ] }),
2496
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2629
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2497
2630
  "button",
2498
2631
  {
2499
2632
  type: "button",
@@ -2507,36 +2640,36 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
2507
2640
  children: "Back to sign in"
2508
2641
  }
2509
2642
  )
2510
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
2511
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "field", children: [
2512
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { children: "Email" }),
2513
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { className: "input", type: "email", value: email, onChange: (e) => setEmail(e.target.value), autoFocus: true, required: true, autoComplete: "email" })
2643
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
2644
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "field", children: [
2645
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { children: "Email" }),
2646
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { className: "input", type: "email", value: email, onChange: (e) => setEmail(e.target.value), autoFocus: true, required: true, autoComplete: "email" })
2514
2647
  ] }),
2515
- err && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "auth-err", children: err }),
2516
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "submit", className: "btn primary lg", style: { width: "100%", marginTop: 8 }, disabled: busy, children: busy ? "Please wait..." : "Send reset link" }),
2517
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "auth-switch", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => {
2648
+ err && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "auth-err", children: err }),
2649
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "submit", className: "btn primary lg", style: { width: "100%", marginTop: 8 }, disabled: busy, children: busy ? "Please wait..." : "Send reset link" }),
2650
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "auth-switch", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => {
2518
2651
  setErr("");
2519
2652
  setMode("signin");
2520
2653
  }, children: "Back to sign in" }) })
2521
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
2522
- mode === "register" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "field", children: [
2523
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { children: "Name" }),
2524
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { className: "input", value: name, onChange: (e) => setName(e.target.value), autoComplete: "name", placeholder: "Jane Doe" })
2654
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
2655
+ mode === "register" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "field", children: [
2656
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { children: "Name" }),
2657
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { className: "input", value: name, onChange: (e) => setName(e.target.value), autoComplete: "name", placeholder: "Jane Doe" })
2525
2658
  ] }),
2526
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "field", children: [
2527
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { children: "Email" }),
2528
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { className: "input", type: "email", value: email, onChange: (e) => setEmail(e.target.value), autoFocus: true, required: true, autoComplete: "email" })
2659
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "field", children: [
2660
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { children: "Email" }),
2661
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { className: "input", type: "email", value: email, onChange: (e) => setEmail(e.target.value), autoFocus: true, required: true, autoComplete: "email" })
2529
2662
  ] }),
2530
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "field", children: [
2531
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "field-row", children: [
2532
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { children: "Password" }),
2533
- mode === "signin" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "link-sm", onClick: () => {
2663
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "field", children: [
2664
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "field-row", children: [
2665
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { children: "Password" }),
2666
+ mode === "signin" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "link-sm", onClick: () => {
2534
2667
  setErr("");
2535
2668
  setResetSent(false);
2536
2669
  setMode("forgot");
2537
2670
  }, children: "Forgot password?" })
2538
2671
  ] }),
2539
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2672
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2540
2673
  "input",
2541
2674
  {
2542
2675
  className: "input",
@@ -2549,13 +2682,15 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
2549
2682
  }
2550
2683
  )
2551
2684
  ] }),
2552
- err && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "auth-err", children: err }),
2553
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "submit", className: "btn primary lg", style: { width: "100%", marginTop: 8 }, disabled: busy, children: busy ? "Please wait..." : mode === "register" ? "Create account" : "Sign in" }),
2554
- GOOGLE_ENABLED && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GoogleButton, { onCredential: onGoogle, onError: setErr }),
2555
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "auth-switch", children: [
2685
+ err && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "auth-err", children: err }),
2686
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "submit", className: "btn primary lg", style: { width: "100%", marginTop: 8 }, disabled: busy, children: busy ? "Please wait..." : mode === "register" ? "Create account" : "Sign in" }),
2687
+ (GOOGLE_ENABLED || MICROSOFT_ENABLED) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "auth-or", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "or" }) }),
2688
+ GOOGLE_ENABLED && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GoogleButton, { onCredential: onGoogle, onError: setErr, divider: false }),
2689
+ MICROSOFT_ENABLED && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MicrosoftButton, { onCredential: onMicrosoft, onError: setErr, disabled: busy }),
2690
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "auth-switch", children: [
2556
2691
  mode === "register" ? "Already have an account?" : `New to ${productName || "the product"}?`,
2557
2692
  " ",
2558
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => {
2693
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => {
2559
2694
  setErr("");
2560
2695
  setMode(mode === "register" ? "signin" : "register");
2561
2696
  }, children: mode === "register" ? "Sign in" : "Create one" })
@@ -2565,15 +2700,15 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
2565
2700
  }
2566
2701
 
2567
2702
  // src/sheet/SheetGrid.jsx
2568
- var import_react17 = require("react");
2703
+ var import_react18 = require("react");
2569
2704
 
2570
2705
  // src/mention/MentionInput.jsx
2571
- var import_react16 = __toESM(require("react"), 1);
2706
+ var import_react17 = __toESM(require("react"), 1);
2572
2707
 
2573
2708
  // src/components/Popover.jsx
2574
- var import_react15 = __toESM(require("react"), 1);
2709
+ var import_react16 = __toESM(require("react"), 1);
2575
2710
  var import_react_dom2 = require("react-dom");
2576
- var import_jsx_runtime13 = require("react/jsx-runtime");
2711
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2577
2712
  var GAP = 6;
2578
2713
  var MARGIN = 8;
2579
2714
  function Popover(props) {
@@ -2588,9 +2723,9 @@ function Popover(props) {
2588
2723
  className,
2589
2724
  label
2590
2725
  } = props;
2591
- const popRef = (0, import_react15.useRef)(null);
2592
- const [pos, setPos] = (0, import_react15.useState)(null);
2593
- (0, import_react15.useEffect)(() => {
2726
+ const popRef = (0, import_react16.useRef)(null);
2727
+ const [pos, setPos] = (0, import_react16.useState)(null);
2728
+ (0, import_react16.useEffect)(() => {
2594
2729
  if (!open) {
2595
2730
  setPos(null);
2596
2731
  return void 0;
@@ -2617,7 +2752,7 @@ function Popover(props) {
2617
2752
  window.removeEventListener("scroll", place, true);
2618
2753
  };
2619
2754
  }, [open, anchorRef, width, minHeight, placement]);
2620
- (0, import_react15.useEffect)(() => {
2755
+ (0, import_react16.useEffect)(() => {
2621
2756
  if (!open) return void 0;
2622
2757
  const onDown = (e) => {
2623
2758
  if (popRef.current?.contains(e.target)) return;
@@ -2627,11 +2762,11 @@ function Popover(props) {
2627
2762
  document.addEventListener("pointerdown", onDown);
2628
2763
  return () => document.removeEventListener("pointerdown", onDown);
2629
2764
  }, [open, anchorRef, onClose]);
2630
- const escape = (0, import_react15.useCallback)(() => onClose?.(), [onClose]);
2765
+ const escape = (0, import_react16.useCallback)(() => onClose?.(), [onClose]);
2631
2766
  useOverlayEscape(open, escape);
2632
2767
  if (!open || !pos || typeof document === "undefined") return null;
2633
2768
  return (0, import_react_dom2.createPortal)(
2634
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2769
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2635
2770
  "div",
2636
2771
  {
2637
2772
  ref: popRef,
@@ -2809,7 +2944,7 @@ function activeTrigger(textBeforeCaret, trigger = "@", maxLen = 48) {
2809
2944
  }
2810
2945
 
2811
2946
  // src/mention/MentionInput.jsx
2812
- var import_jsx_runtime14 = require("react/jsx-runtime");
2947
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2813
2948
  var MENTION_ATTR = "data-mention-id";
2814
2949
  function monogram(name) {
2815
2950
  const parts = String(name || "").trim().split(/\s+/).filter(Boolean);
@@ -2916,7 +3051,7 @@ function selectionIn(root) {
2916
3051
  if (!root.contains(r.startContainer)) return null;
2917
3052
  return { sel, range: r };
2918
3053
  }
2919
- var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props, ref) {
3054
+ var MentionInput = (0, import_react17.forwardRef)(function MentionInput2(props, ref) {
2920
3055
  const {
2921
3056
  value = "",
2922
3057
  onChange,
@@ -2940,13 +3075,13 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
2940
3075
  onKeyDown,
2941
3076
  id
2942
3077
  } = props;
2943
- const editorRef = (0, import_react16.useRef)(null);
2944
- const resolver = (0, import_react16.useMemo)(() => makeResolver(items), [items]);
2945
- const [menu, setMenu] = (0, import_react16.useState)(null);
2946
- const [active, setActive] = (0, import_react16.useState)(0);
2947
- const [empty, setEmpty] = (0, import_react16.useState)(!value);
2948
- const listId = (0, import_react16.useMemo)(() => `uic-mention-${Math.random().toString(36).slice(2, 8)}`, []);
2949
- const emit = (0, import_react16.useCallback)(() => {
3078
+ const editorRef = (0, import_react17.useRef)(null);
3079
+ const resolver = (0, import_react17.useMemo)(() => makeResolver(items), [items]);
3080
+ const [menu, setMenu] = (0, import_react17.useState)(null);
3081
+ const [active, setActive] = (0, import_react17.useState)(0);
3082
+ const [empty, setEmpty] = (0, import_react17.useState)(!value);
3083
+ const listId = (0, import_react17.useMemo)(() => `uic-mention-${Math.random().toString(36).slice(2, 8)}`, []);
3084
+ const emit = (0, import_react17.useCallback)(() => {
2950
3085
  const root = editorRef.current;
2951
3086
  if (!root) return;
2952
3087
  const segs = readSegments(root, resolver);
@@ -2954,7 +3089,7 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
2954
3089
  setEmpty(!next);
2955
3090
  if (onChange) onChange(next, mentionsOf(segs));
2956
3091
  }, [resolver, format, onChange]);
2957
- (0, import_react16.useLayoutEffect)(() => {
3092
+ (0, import_react17.useLayoutEffect)(() => {
2958
3093
  const root = editorRef.current;
2959
3094
  if (!root) return;
2960
3095
  const current = serializeSegments(readSegments(root, resolver), format);
@@ -2962,19 +3097,19 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
2962
3097
  writeSegments(root, parseValue(value || "", format, resolver));
2963
3098
  setEmpty(!value);
2964
3099
  }, [value, resolver, format]);
2965
- (0, import_react16.useEffect)(() => {
3100
+ (0, import_react17.useEffect)(() => {
2966
3101
  if (autoFocus && editorRef.current) editorRef.current.focus();
2967
3102
  }, [autoFocus]);
2968
- const closeMenu = (0, import_react16.useCallback)(() => setMenu(null), []);
2969
- (0, import_react16.useEffect)(() => {
3103
+ const closeMenu = (0, import_react17.useCallback)(() => setMenu(null), []);
3104
+ (0, import_react17.useEffect)(() => {
2970
3105
  if (onOpenChange) onOpenChange(!!menu);
2971
3106
  }, [menu, onOpenChange]);
2972
- const groups = (0, import_react16.useMemo)(() => menu ? groupItems(items, menu.query) : [], [items, menu]);
2973
- const flat = (0, import_react16.useMemo)(() => groups.flatMap((g) => g.items), [groups]);
2974
- (0, import_react16.useEffect)(() => {
3107
+ const groups = (0, import_react17.useMemo)(() => menu ? groupItems(items, menu.query) : [], [items, menu]);
3108
+ const flat = (0, import_react17.useMemo)(() => groups.flatMap((g) => g.items), [groups]);
3109
+ (0, import_react17.useEffect)(() => {
2975
3110
  setActive(0);
2976
3111
  }, [menu && menu.query, groups.length]);
2977
- const syncMenu = (0, import_react16.useCallback)(() => {
3112
+ const syncMenu = (0, import_react17.useCallback)(() => {
2978
3113
  const root = editorRef.current;
2979
3114
  const s = root && selectionIn(root);
2980
3115
  if (!s || !s.range.collapsed) {
@@ -2997,13 +3132,13 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
2997
3132
  const rect = r.getBoundingClientRect();
2998
3133
  setMenu({ node, start: hit.start, query: hit.query, rect: rect.width || rect.height ? rect : root.getBoundingClientRect() });
2999
3134
  }, [trigger]);
3000
- const anchorRef = (0, import_react16.useMemo)(() => ({
3135
+ const anchorRef = (0, import_react17.useMemo)(() => ({
3001
3136
  current: {
3002
3137
  getBoundingClientRect: () => menu ? menu.rect : new DOMRect(),
3003
3138
  contains: () => false
3004
3139
  }
3005
3140
  }), [menu]);
3006
- const insertPill = (0, import_react16.useCallback)((item, replace) => {
3141
+ const insertPill = (0, import_react17.useCallback)((item, replace) => {
3007
3142
  const root = editorRef.current;
3008
3143
  if (!root || !item || item.disabled) return;
3009
3144
  const pill = buildPillNode(item);
@@ -3029,8 +3164,8 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3029
3164
  setMenu(null);
3030
3165
  emit();
3031
3166
  }, [emit, trigger]);
3032
- const pick = (0, import_react16.useCallback)((item) => insertPill(item, menu), [insertPill, menu]);
3033
- const insertText = (0, import_react16.useCallback)((text) => {
3167
+ const pick = (0, import_react17.useCallback)((item) => insertPill(item, menu), [insertPill, menu]);
3168
+ const insertText = (0, import_react17.useCallback)((text) => {
3034
3169
  const root = editorRef.current;
3035
3170
  if (!root) return;
3036
3171
  root.focus();
@@ -3052,7 +3187,7 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3052
3187
  emit();
3053
3188
  syncMenu();
3054
3189
  }, [emit, syncMenu]);
3055
- const wrapSelection = (0, import_react16.useCallback)((before, after = "") => {
3190
+ const wrapSelection = (0, import_react17.useCallback)((before, after = "") => {
3056
3191
  const root = editorRef.current;
3057
3192
  if (!root) return;
3058
3193
  root.focus();
@@ -3064,7 +3199,7 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3064
3199
  for (let i = 0; i < after.length; i++) sel && sel.modify && sel.modify("move", "backward", "character");
3065
3200
  }
3066
3201
  }, [insertText]);
3067
- const prefixLine = (0, import_react16.useCallback)((prefix) => {
3202
+ const prefixLine = (0, import_react17.useCallback)((prefix) => {
3068
3203
  const root = editorRef.current;
3069
3204
  if (!root) return;
3070
3205
  root.focus();
@@ -3074,7 +3209,7 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3074
3209
  const atLineStart = !before || /\n$/.test(before) || node && node.nodeType !== 3;
3075
3210
  insertText((atLineStart ? "" : "\n") + prefix);
3076
3211
  }, [insertText]);
3077
- (0, import_react16.useImperativeHandle)(ref, () => ({
3212
+ (0, import_react17.useImperativeHandle)(ref, () => ({
3078
3213
  focus: () => editorRef.current && editorRef.current.focus(),
3079
3214
  clear: () => {
3080
3215
  const root = editorRef.current;
@@ -3176,13 +3311,13 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3176
3311
  const handleFocus = (e) => {
3177
3312
  if (onFocus) onFocus(e);
3178
3313
  };
3179
- (0, import_react16.useEffect)(() => {
3314
+ (0, import_react17.useEffect)(() => {
3180
3315
  if (!menu) return void 0;
3181
3316
  const onSel = () => syncMenu();
3182
3317
  document.addEventListener("selectionchange", onSel);
3183
3318
  return () => document.removeEventListener("selectionchange", onSel);
3184
3319
  }, [menu, syncMenu]);
3185
- (0, import_react16.useEffect)(() => {
3320
+ (0, import_react17.useEffect)(() => {
3186
3321
  if (!menu) return;
3187
3322
  const el = document.getElementById(`${listId}-${active}`);
3188
3323
  const list = el && el.closest(".uic-mention-menu");
@@ -3197,14 +3332,14 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3197
3332
  const n = renderIcon(item);
3198
3333
  if (n) return n;
3199
3334
  }
3200
- if (item.avatar) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: item.avatar, alt: "" });
3335
+ if (item.avatar) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: item.avatar, alt: "" });
3201
3336
  if (typeof item.icon === "string" && item.icon) return item.icon;
3202
3337
  if (item.icon) return item.icon;
3203
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "is-mono", children: monogram(item.name) });
3338
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "is-mono", children: monogram(item.name) });
3204
3339
  };
3205
3340
  let index = -1;
3206
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: ["uic-mention-field", disabled ? "is-disabled" : "", className].filter(Boolean).join(" "), children: [
3207
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3341
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: ["uic-mention-field", disabled ? "is-disabled" : "", className].filter(Boolean).join(" "), children: [
3342
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3208
3343
  "div",
3209
3344
  {
3210
3345
  ref: editorRef,
@@ -3228,16 +3363,16 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3228
3363
  onBlur: handleBlur
3229
3364
  }
3230
3365
  ),
3231
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Popover, { open: !!menu, anchorRef, onClose: closeMenu, width: menuWidth, minHeight: 120, className: "uic-mention-pop", label: menuTitle || "Mentions", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "uic-mention-menu", role: "listbox", id: listId, onMouseDown: (e) => e.preventDefault(), children: [
3232
- menuTitle ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "uic-mention-head", children: menuTitle }) : null,
3233
- groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "uic-mention-group", children: [
3234
- g.section ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "uic-mention-sec", children: g.section }) : null,
3366
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Popover, { open: !!menu, anchorRef, onClose: closeMenu, width: menuWidth, minHeight: 120, className: "uic-mention-pop", label: menuTitle || "Mentions", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "uic-mention-menu", role: "listbox", id: listId, onMouseDown: (e) => e.preventDefault(), children: [
3367
+ menuTitle ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uic-mention-head", children: menuTitle }) : null,
3368
+ groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "uic-mention-group", children: [
3369
+ g.section ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uic-mention-sec", children: g.section }) : null,
3235
3370
  g.items.map((item) => {
3236
3371
  index += 1;
3237
3372
  const i = index;
3238
3373
  const dis = !!item.disabled;
3239
3374
  const reason = typeof item.disabled === "string" ? item.disabled : null;
3240
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3375
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3241
3376
  "button",
3242
3377
  {
3243
3378
  type: "button",
@@ -3252,30 +3387,30 @@ var MentionInput = (0, import_react16.forwardRef)(function MentionInput2(props,
3252
3387
  if (!dis) pick(item);
3253
3388
  },
3254
3389
  children: [
3255
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "uic-mention-ic", children: iconOf(item) }),
3256
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "uic-mention-text", children: [
3257
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "uic-mention-name", children: item.name }),
3258
- item.description ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "uic-mention-desc", children: item.description }) : null
3390
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "uic-mention-ic", children: iconOf(item) }),
3391
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "uic-mention-text", children: [
3392
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "uic-mention-name", children: item.name }),
3393
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "uic-mention-desc", children: item.description }) : null
3259
3394
  ] }),
3260
- reason || item.tag ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "uic-mention-tag", children: reason || item.tag }) : null
3395
+ reason || item.tag ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "uic-mention-tag", children: reason || item.tag }) : null
3261
3396
  ]
3262
3397
  },
3263
3398
  item.id
3264
3399
  );
3265
3400
  })
3266
3401
  ] }, g.section || "_")),
3267
- !flat.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "uic-mention-empty", children: emptyText }) : null
3402
+ !flat.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "uic-mention-empty", children: emptyText }) : null
3268
3403
  ] }) })
3269
3404
  ] });
3270
3405
  });
3271
3406
  function MentionText({ value, items = [], format = CURLY, className = "", renderIcon }) {
3272
- const resolver = (0, import_react16.useMemo)(() => makeResolver(items), [items]);
3273
- const segs = (0, import_react16.useMemo)(() => parseValue(value || "", format, resolver), [value, format, resolver]);
3274
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: ["uic-mention-text-view", className].filter(Boolean).join(" "), children: segs.map((s, i) => {
3275
- if (s.type === "text") return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react16.default.Fragment, { children: s.text }, i);
3407
+ const resolver = (0, import_react17.useMemo)(() => makeResolver(items), [items]);
3408
+ const segs = (0, import_react17.useMemo)(() => parseValue(value || "", format, resolver), [value, format, resolver]);
3409
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: ["uic-mention-text-view", className].filter(Boolean).join(" "), children: segs.map((s, i) => {
3410
+ if (s.type === "text") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react17.default.Fragment, { children: s.text }, i);
3276
3411
  const item = s.item || s;
3277
3412
  const icon = renderIcon ? renderIcon(item) : null;
3278
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3413
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3279
3414
  "span",
3280
3415
  {
3281
3416
  className: "uic-mention",
@@ -3283,8 +3418,8 @@ function MentionText({ value, items = [], format = CURLY, className = "", render
3283
3418
  title: item.description || void 0,
3284
3419
  style: item.color ? { "--uic-mention-color": item.color } : void 0,
3285
3420
  children: [
3286
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "uic-mention-ic" + (icon || typeof item.icon === "string" && item.icon || item.avatar ? "" : " is-mono"), children: icon || (item.avatar ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: item.avatar, alt: "" }) : typeof item.icon === "string" && item.icon ? item.icon : monogram(item.name)) }),
3287
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "uic-mention-name", children: s.name })
3421
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "uic-mention-ic" + (icon || typeof item.icon === "string" && item.icon || item.avatar ? "" : " is-mono"), children: icon || (item.avatar ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: item.avatar, alt: "" }) : typeof item.icon === "string" && item.icon ? item.icon : monogram(item.name)) }),
3422
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "uic-mention-name", children: s.name })
3288
3423
  ]
3289
3424
  },
3290
3425
  i
@@ -3303,7 +3438,7 @@ function withAlpha(hex, alpha) {
3303
3438
  }
3304
3439
 
3305
3440
  // src/sheet/SheetGrid.jsx
3306
- var import_jsx_runtime15 = require("react/jsx-runtime");
3441
+ var import_jsx_runtime16 = require("react/jsx-runtime");
3307
3442
  var cellKey = (rowId, colId) => `${rowId}:${colId}`;
3308
3443
  var uid = (p) => `${p}_${Math.random().toString(36).slice(2, 10)}`;
3309
3444
  var TYPE_LABEL = {
@@ -3328,8 +3463,8 @@ var COMPUTE_KINDS = [
3328
3463
  var RESOURCE_KINDS = ["image", "sheet", "slides", "workflow", "graph"];
3329
3464
  var RESOURCE_ICON = { image: "\u{1F5BC}", sheet: "\u25A6", slides: "\u25A4", workflow: "\u2699", graph: "\u25C9" };
3330
3465
  function PopPortal({ anchor, width = 250, estHeight = 300, className, children, onClose }) {
3331
- const boxRef = (0, import_react17.useRef)(null);
3332
- (0, import_react17.useEffect)(() => {
3466
+ const boxRef = (0, import_react18.useRef)(null);
3467
+ (0, import_react18.useEffect)(() => {
3333
3468
  if (!onClose) return void 0;
3334
3469
  const close = (e) => {
3335
3470
  if (e?.type === "scroll" && boxRef.current && e.target instanceof Node && boxRef.current.contains(e.target)) return;
@@ -3347,7 +3482,7 @@ function PopPortal({ anchor, width = 250, estHeight = 300, className, children,
3347
3482
  let top = anchor.bottom + 6;
3348
3483
  if (top + estHeight > window.innerHeight - 8) top = Math.max(8, anchor.top - estHeight - 6);
3349
3484
  return (0, import_react_dom3.createPortal)(
3350
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref: boxRef, className, style: { position: "fixed", top, left, width, zIndex: 1e3 }, children }),
3485
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { ref: boxRef, className, style: { position: "fixed", top, left, width, zIndex: 1e3 }, children }),
3351
3486
  document.body
3352
3487
  );
3353
3488
  }
@@ -3381,8 +3516,8 @@ function pillColor(label, options) {
3381
3516
  return PILL_FALLBACKS[h % PILL_FALLBACKS.length];
3382
3517
  }
3383
3518
  function RefImage({ refVal, fetchBlobUrl }) {
3384
- const [src, setSrc] = (0, import_react17.useState)(/^https?:\/\//i.test(refVal.url || "") ? refVal.url : null);
3385
- (0, import_react17.useEffect)(() => {
3519
+ const [src, setSrc] = (0, import_react18.useState)(/^https?:\/\//i.test(refVal.url || "") ? refVal.url : null);
3520
+ (0, import_react18.useEffect)(() => {
3386
3521
  let dead = false;
3387
3522
  let obj = null;
3388
3523
  if (!src && refVal.url && fetchBlobUrl) {
@@ -3398,16 +3533,16 @@ function RefImage({ refVal, fetchBlobUrl }) {
3398
3533
  if (obj) URL.revokeObjectURL(obj);
3399
3534
  };
3400
3535
  }, [refVal.url]);
3401
- if (!src) return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "shg-refchip", children: [
3536
+ if (!src) return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "shg-refchip", children: [
3402
3537
  RESOURCE_ICON.image,
3403
3538
  " ",
3404
3539
  refVal.name || "image"
3405
3540
  ] });
3406
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { className: "shg-refimg", src, alt: refVal.name || "", title: refVal.name || "" });
3541
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { className: "shg-refimg", src, alt: refVal.name || "", title: refVal.name || "" });
3407
3542
  }
3408
3543
  function ResourceChip({ refVal, onOpen }) {
3409
3544
  const icon = RESOURCE_ICON[refVal.kind] || "\u25C7";
3410
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3545
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3411
3546
  "button",
3412
3547
  {
3413
3548
  className: "shg-refchip shg-refchip-btn",
@@ -3417,42 +3552,42 @@ function ResourceChip({ refVal, onOpen }) {
3417
3552
  onOpen && onOpen(refVal);
3418
3553
  },
3419
3554
  children: [
3420
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-refchip-ic", children: icon }),
3421
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-refchip-name", children: refVal.name || refVal.id || refVal.kind })
3555
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-refchip-ic", children: icon }),
3556
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-refchip-name", children: refVal.name || refVal.id || refVal.kind })
3422
3557
  ]
3423
3558
  }
3424
3559
  );
3425
3560
  }
3426
3561
  function StatusDot({ status }) {
3427
3562
  if (!status || status === "empty" || status === "done") return null;
3428
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `shg-dot shg-dot-${status}`, title: status });
3563
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `shg-dot shg-dot-${status}`, title: status });
3429
3564
  }
3430
3565
  function CellValue({ cell, col, fetchBlobUrl, onOpenResource }) {
3431
3566
  const v = cell?.value;
3432
- if (v === void 0 || v === null || v === "") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-val-txt" });
3567
+ if (v === void 0 || v === null || v === "") return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-val-txt" });
3433
3568
  if (v && typeof v === "object" && !Array.isArray(v) && v.kind) {
3434
- if (v.kind === "image") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefImage, { refVal: v, fetchBlobUrl });
3435
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ResourceChip, { refVal: v, onOpen: onOpenResource });
3569
+ if (v.kind === "image") return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(RefImage, { refVal: v, fetchBlobUrl });
3570
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ResourceChip, { refVal: v, onOpen: onOpenResource });
3436
3571
  }
3437
3572
  const styled = col.type !== "tags" && optionFor(v, col.options);
3438
- if (styled) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-pill", style: { background: styled.color }, children: styled.label });
3573
+ if (styled) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-pill", style: { background: styled.color }, children: styled.label });
3439
3574
  switch (col.type) {
3440
3575
  case "select":
3441
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-pill", style: { background: pillColor(String(v), col.options) }, children: String(v) });
3576
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-pill", style: { background: pillColor(String(v), col.options) }, children: String(v) });
3442
3577
  case "tags": {
3443
3578
  const tags = Array.isArray(v) ? v : String(v).split(",").map((s) => s.trim()).filter(Boolean);
3444
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-pills", children: tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-pill", style: { background: pillColor(t, col.options) }, children: t }, t)) });
3579
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-pills", children: tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-pill", style: { background: pillColor(t, col.options) }, children: t }, t)) });
3445
3580
  }
3446
3581
  case "checkbox":
3447
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-check" + (v ? " on" : ""), children: v ? "\u2713" : "" });
3582
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-check" + (v ? " on" : ""), children: v ? "\u2713" : "" });
3448
3583
  case "url": {
3449
3584
  const href = /^https?:\/\//i.test(String(v)) ? String(v) : `https://${v}`;
3450
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { className: "shg-link", href, target: "_blank", rel: "noreferrer", onClick: (e) => e.stopPropagation(), children: String(v) });
3585
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { className: "shg-link", href, target: "_blank", rel: "noreferrer", onClick: (e) => e.stopPropagation(), children: String(v) });
3451
3586
  }
3452
3587
  case "number":
3453
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-val-txt shg-num", children: String(v) });
3588
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-val-txt shg-num", children: String(v) });
3454
3589
  default:
3455
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-val-txt", children: typeof v === "object" ? JSON.stringify(v) : String(v) });
3590
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-val-txt", children: typeof v === "object" ? JSON.stringify(v) : String(v) });
3456
3591
  }
3457
3592
  }
3458
3593
  function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetchBlobUrl, onOpenResource, peers, onPresence }) {
@@ -3461,18 +3596,18 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3461
3596
  const cells = sheet?.cells || {};
3462
3597
  const tabId = sheet?.id;
3463
3598
  const canEdit = !readOnly && !!ops && !!tabId;
3464
- const [editing, setEditing] = (0, import_react17.useState)(null);
3465
- const [draft, setDraft] = (0, import_react17.useState)("");
3466
- const [menuCol, setMenuCol] = (0, import_react17.useState)(null);
3467
- const [sizeDraft, setSizeDraft] = (0, import_react17.useState)({});
3468
- const [dnd, setDnd] = (0, import_react17.useState)(null);
3469
- const [dropAt, setDropAt] = (0, import_react17.useState)(null);
3470
- const inputRef = (0, import_react17.useRef)(null);
3471
- const dragRef = (0, import_react17.useRef)(null);
3472
- const [sel, setSel] = (0, import_react17.useState)(null);
3473
- const dragSel = (0, import_react17.useRef)(false);
3474
- const rootRef = (0, import_react17.useRef)(null);
3475
- const presenceRef = (0, import_react17.useRef)(onPresence);
3599
+ const [editing, setEditing] = (0, import_react18.useState)(null);
3600
+ const [draft, setDraft] = (0, import_react18.useState)("");
3601
+ const [menuCol, setMenuCol] = (0, import_react18.useState)(null);
3602
+ const [sizeDraft, setSizeDraft] = (0, import_react18.useState)({});
3603
+ const [dnd, setDnd] = (0, import_react18.useState)(null);
3604
+ const [dropAt, setDropAt] = (0, import_react18.useState)(null);
3605
+ const inputRef = (0, import_react18.useRef)(null);
3606
+ const dragRef = (0, import_react18.useRef)(null);
3607
+ const [sel, setSel] = (0, import_react18.useState)(null);
3608
+ const dragSel = (0, import_react18.useRef)(false);
3609
+ const rootRef = (0, import_react18.useRef)(null);
3610
+ const presenceRef = (0, import_react18.useRef)(onPresence);
3476
3611
  presenceRef.current = onPresence;
3477
3612
  const range = sel ? {
3478
3613
  r0: Math.min(sel.a.r, sel.f.r),
@@ -3488,14 +3623,14 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3488
3623
  const f = clampSel({ r: cur.f.r + dr, c: cur.f.c + dc });
3489
3624
  return { a: extend ? cur.a : f, f };
3490
3625
  });
3491
- (0, import_react17.useEffect)(() => {
3626
+ (0, import_react18.useEffect)(() => {
3492
3627
  const up = () => {
3493
3628
  dragSel.current = false;
3494
3629
  };
3495
3630
  window.addEventListener("mouseup", up);
3496
3631
  return () => window.removeEventListener("mouseup", up);
3497
3632
  }, []);
3498
- (0, import_react17.useEffect)(() => {
3633
+ (0, import_react18.useEffect)(() => {
3499
3634
  const fn = presenceRef.current;
3500
3635
  if (!fn) return;
3501
3636
  const ids = (p) => [rows[p.r]?.id, columns[p.c]?.id];
@@ -3504,7 +3639,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3504
3639
  typing: editing && typeof draft === "string" ? { key: cellKey(editing.rowId, editing.colId), text: draft } : null
3505
3640
  });
3506
3641
  }, [sel, editing, draft, rows, columns]);
3507
- const peerLayer = (0, import_react17.useMemo)(() => {
3642
+ const peerLayer = (0, import_react18.useMemo)(() => {
3508
3643
  const focus = {}, tint = {}, typing = {};
3509
3644
  const rIdx = new Map(rows.map((r, i) => [r.id, i]));
3510
3645
  const cIdx = new Map(columns.map((c, i) => [c.id, i]));
@@ -3615,7 +3750,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3615
3750
  const numW = Math.max(40, 24 + String(rows.length || 1).length * 9);
3616
3751
  const numStyle = { width: numW, minWidth: numW, maxWidth: numW };
3617
3752
  const rowHeight = (row) => sizeDraft.row && sizeDraft.row[row.id] || row.height || void 0;
3618
- (0, import_react17.useEffect)(() => {
3753
+ (0, import_react18.useEffect)(() => {
3619
3754
  if (editing && inputRef.current) inputRef.current.focus();
3620
3755
  }, [editing]);
3621
3756
  const setCell = (rowId, colId, value) => {
@@ -3768,7 +3903,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3768
3903
  if (col.type === "resource") {
3769
3904
  const d = typeof draft === "object" && draft ? draft : { kind: "sheet" };
3770
3905
  const set = (k, v) => setDraft({ ...d, [k]: v });
3771
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3906
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3772
3907
  PopPortal,
3773
3908
  {
3774
3909
  anchor: editing.rect,
@@ -3776,17 +3911,17 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3776
3911
  estHeight: 230,
3777
3912
  className: "shg-select-pop shg-ref-pop",
3778
3913
  onClose: () => setEditing(null),
3779
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
3780
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("select", { className: "shg-menu-input", value: d.kind || "sheet", onChange: (e) => set("kind", e.target.value), children: RESOURCE_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: k, children: k }, k)) }),
3781
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "shg-menu-input", placeholder: "Name", value: d.name || "", onChange: (e) => set("name", e.target.value) }),
3782
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "shg-menu-input", placeholder: "Resource id (e.g. sheet.\u2026)", value: d.id || "", onChange: (e) => set("id", e.target.value) }),
3783
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "shg-menu-input", placeholder: "or URL", value: d.url || "", onChange: (e) => set("url", e.target.value) }),
3784
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-menu-actions", children: [
3785
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-pop-clear", onClick: () => {
3914
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { onClick: (e) => e.stopPropagation(), children: [
3915
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("select", { className: "shg-menu-input", value: d.kind || "sheet", onChange: (e) => set("kind", e.target.value), children: RESOURCE_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: k, children: k }, k)) }),
3916
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", { className: "shg-menu-input", placeholder: "Name", value: d.name || "", onChange: (e) => set("name", e.target.value) }),
3917
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", { className: "shg-menu-input", placeholder: "Resource id (e.g. sheet.\u2026)", value: d.id || "", onChange: (e) => set("id", e.target.value) }),
3918
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", { className: "shg-menu-input", placeholder: "or URL", value: d.url || "", onChange: (e) => set("url", e.target.value) }),
3919
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-menu-actions", children: [
3920
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-pop-clear", onClick: () => {
3786
3921
  setCell(editing.rowId, editing.colId, null);
3787
3922
  setEditing(null);
3788
3923
  }, children: "Clear" }),
3789
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-menu-apply", onClick: () => {
3924
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-menu-apply", onClick: () => {
3790
3925
  setCell(editing.rowId, editing.colId, d);
3791
3926
  setEditing(null);
3792
3927
  }, children: "Set" })
@@ -3797,7 +3932,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3797
3932
  }
3798
3933
  if (col.type === "select") {
3799
3934
  const opts = normOptions(col.options);
3800
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3935
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3801
3936
  PopPortal,
3802
3937
  {
3803
3938
  anchor: editing.rect,
@@ -3806,8 +3941,8 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3806
3941
  className: "shg-select-pop",
3807
3942
  onClose: () => setEditing(null),
3808
3943
  children: [
3809
- opts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shg-pop-note", children: "No options yet \u2014 add them in the column menu." }),
3810
- opts.map((o) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3944
+ opts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shg-pop-note", children: "No options yet \u2014 add them in the column menu." }),
3945
+ opts.map((o) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3811
3946
  "button",
3812
3947
  {
3813
3948
  className: "shg-pill shg-pill-btn",
@@ -3821,7 +3956,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3821
3956
  },
3822
3957
  o.label
3823
3958
  )),
3824
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3959
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3825
3960
  "button",
3826
3961
  {
3827
3962
  className: "shg-pop-clear",
@@ -3838,7 +3973,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3838
3973
  );
3839
3974
  }
3840
3975
  const inputType = col.type === "date" ? "date" : col.type === "number" ? "number" : "text";
3841
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3976
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3842
3977
  "input",
3843
3978
  {
3844
3979
  ref: inputRef,
@@ -3867,18 +4002,18 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3867
4002
  }
3868
4003
  );
3869
4004
  };
3870
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shg", ref: rootRef, tabIndex: 0, onKeyDown, onCopy: copySelection, onPaste: pasteAt, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shg-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: "shg-table", children: [
3871
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { children: [
3872
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "shg-corner", style: numStyle }),
3873
- columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4005
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shg", ref: rootRef, tabIndex: 0, onKeyDown, onCopy: copySelection, onPaste: pasteAt, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shg-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("table", { className: "shg-table", children: [
4006
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("tr", { children: [
4007
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("th", { className: "shg-corner", style: numStyle }),
4008
+ columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3874
4009
  "th",
3875
4010
  {
3876
4011
  className: "shg-col" + (col.type === "compute" ? " shg-col-compute" : "") + dndClass("col", col.id),
3877
4012
  style: colWidth(col) ? { width: colWidth(col), minWidth: colWidth(col), maxWidth: colWidth(col) } : void 0,
3878
4013
  ...dndProps("col", col.id),
3879
4014
  children: [
3880
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-resize-col", onMouseDown: (e) => startResize(e, "col", col.id, colWidth(col) || e.currentTarget.closest("th").offsetWidth) }),
3881
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shg-col-h", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4015
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-resize-col", onMouseDown: (e) => startResize(e, "col", col.id, colWidth(col) || e.currentTarget.closest("th").offsetWidth) }),
4016
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shg-col-h", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3882
4017
  ColumnHeader,
3883
4018
  {
3884
4019
  col,
@@ -3902,10 +4037,10 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3902
4037
  },
3903
4038
  col.id
3904
4039
  )),
3905
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "shg-add-col", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-add", onClick: addColumn, title: "Add column", children: "+" }) })
4040
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("th", { className: "shg-add-col", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-add", onClick: addColumn, title: "Add column", children: "+" }) })
3906
4041
  ] }) }),
3907
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tbody", { children: [
3908
- rows.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4042
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("tbody", { children: [
4043
+ rows.map((row, ri) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3909
4044
  "tr",
3910
4045
  {
3911
4046
  style: {
@@ -3913,7 +4048,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3913
4048
  "--shg-clamp": Math.max(1, Math.floor(((rowHeight(row) || 34) - 10) / 18))
3914
4049
  },
3915
4050
  children: [
3916
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4051
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3917
4052
  "td",
3918
4053
  {
3919
4054
  className: "shg-rownum" + dndClass("row", row.id),
@@ -3921,9 +4056,9 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3921
4056
  title: "Drag to reorder",
3922
4057
  ...dndProps("row", row.id),
3923
4058
  children: [
3924
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: ri + 1 }),
3925
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-rowdel", onClick: () => deleteRow(row.id), title: "Delete row", children: "\xD7" }),
3926
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-resize-row", onMouseDown: (e) => startResize(e, "row", row.id, rowHeight(row) || e.currentTarget.closest("tr").offsetHeight) })
4059
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: ri + 1 }),
4060
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-rowdel", onClick: () => deleteRow(row.id), title: "Delete row", children: "\xD7" }),
4061
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-resize-row", onMouseDown: (e) => startResize(e, "row", row.id, rowHeight(row) || e.currentTarget.closest("tr").offsetHeight) })
3927
4062
  ]
3928
4063
  }
3929
4064
  ),
@@ -3938,7 +4073,7 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3938
4073
  if (focused) shadows.push("inset 0 0 0 2px var(--brand, #0E7490)");
3939
4074
  if (peer) shadows.push(`inset 0 0 0 2px ${peer.color}`);
3940
4075
  const tint = !selected && peerLayer.tint[key];
3941
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4076
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3942
4077
  "td",
3943
4078
  {
3944
4079
  "data-cell": key,
@@ -3967,16 +4102,16 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3967
4102
  },
3968
4103
  title: c.error || "",
3969
4104
  children: [
3970
- peer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-peer-flag", style: { background: peer.color }, children: peer.name }),
3971
- isEditing ? renderEditor(col) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4105
+ peer && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-peer-flag", style: { background: peer.color }, children: peer.name }),
4106
+ isEditing ? renderEditor(col) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3972
4107
  "div",
3973
4108
  {
3974
4109
  className: "shg-val",
3975
4110
  style: { maxWidth: colWidth(col) ? colWidth(col) - 20 : 400 },
3976
4111
  children: [
3977
- col.type === "compute" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatusDot, { status: c.status }),
3978
- ghost ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-ghost", style: { color: ghost.color }, title: `${ghost.name} is typing`, children: ghost.text }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CellValue, { cell: c, col, fetchBlobUrl, onOpenResource }),
3979
- col.type === "compute" && !readOnly && onRunCell && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4112
+ col.type === "compute" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StatusDot, { status: c.status }),
4113
+ ghost ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-ghost", style: { color: ghost.color }, title: `${ghost.name} is typing`, children: ghost.text }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CellValue, { cell: c, col, fetchBlobUrl, onOpenResource }),
4114
+ col.type === "compute" && !readOnly && onRunCell && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3980
4115
  "button",
3981
4116
  {
3982
4117
  className: "shg-runcell",
@@ -3996,27 +4131,27 @@ function SheetGrid({ sheet, ops, onRunCell, onRunColumn, readOnly = false, fetch
3996
4131
  col.id
3997
4132
  );
3998
4133
  }),
3999
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "shg-pad" })
4134
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { className: "shg-pad" })
4000
4135
  ]
4001
4136
  },
4002
4137
  row.id
4003
4138
  )),
4004
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { className: "shg-ghost-row", onClick: addRow, children: [
4005
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "shg-rownum shg-ghost-num", style: numStyle, children: "+" }),
4006
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "shg-ghost-cell", colSpan: columns.length + 1, children: "New row" })
4139
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("tr", { className: "shg-ghost-row", onClick: addRow, children: [
4140
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { className: "shg-rownum shg-ghost-num", style: numStyle, children: "+" }),
4141
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { className: "shg-ghost-cell", colSpan: columns.length + 1, children: "New row" })
4007
4142
  ] })
4008
4143
  ] })
4009
4144
  ] }) }) });
4010
4145
  }
4011
4146
  function ColumnHeader({ col, columns, readOnly, menuOpen, menuAnchor, onMenu, onCloseMenu, onRename, onConfigure, onDelete, onRun, width }) {
4012
- const [editing, setEditing] = (0, import_react17.useState)(false);
4013
- const [name, setName] = (0, import_react17.useState)(col.name);
4014
- (0, import_react17.useEffect)(() => setName(col.name), [col.name]);
4147
+ const [editing, setEditing] = (0, import_react18.useState)(false);
4148
+ const [name, setName] = (0, import_react18.useState)(col.name);
4149
+ (0, import_react18.useEffect)(() => setName(col.name), [col.name]);
4015
4150
  const w = Number(width) || 0;
4016
4151
  const fit = w && w < 160 ? " tight" : w && w < 200 ? " narrow" : "";
4017
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-colhdr" + fit, children: [
4018
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-colhdr-main", children: [
4019
- editing && !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4152
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-colhdr" + fit, children: [
4153
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-colhdr-main", children: [
4154
+ editing && !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4020
4155
  "input",
4021
4156
  {
4022
4157
  className: "shg-colname-input",
@@ -4031,20 +4166,20 @@ function ColumnHeader({ col, columns, readOnly, menuOpen, menuAnchor, onMenu, on
4031
4166
  if (e.key === "Enter") e.target.blur();
4032
4167
  }
4033
4168
  }
4034
- ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-colname", onDoubleClick: () => !readOnly && setEditing(true), title: col.name, children: col.name }),
4035
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "shg-coltype" + (col.type === "compute" ? " compute" : ""), children: [
4169
+ ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-colname", onDoubleClick: () => !readOnly && setEditing(true), title: col.name, children: col.name }),
4170
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "shg-coltype" + (col.type === "compute" ? " compute" : ""), children: [
4036
4171
  TYPE_LABEL[col.type] || col.type,
4037
4172
  col.type === "compute" && col.compute?.kind ? ` \xB7 ${col.compute.kind}` : ""
4038
4173
  ] })
4039
4174
  ] }),
4040
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-colhdr-tools", children: [
4041
- onRun && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { className: "shg-colrun", onClick: onRun, title: "Run this column", "aria-label": "Run this column", children: [
4175
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-colhdr-tools", children: [
4176
+ onRun && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("button", { className: "shg-colrun", onClick: onRun, title: "Run this column", "aria-label": "Run this column", children: [
4042
4177
  "\u25B6",
4043
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-colrun-label", children: " Run" })
4178
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-colrun-label", children: " Run" })
4044
4179
  ] }),
4045
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-colmenu-btn", onClick: (e) => onMenu(e), title: "Column settings", children: "\u22EF" })
4180
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-colmenu-btn", onClick: (e) => onMenu(e), title: "Column settings", children: "\u22EF" })
4046
4181
  ] }),
4047
- menuOpen && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4182
+ menuOpen && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4048
4183
  ColumnMenu,
4049
4184
  {
4050
4185
  col,
@@ -4061,8 +4196,8 @@ function ColumnHeader({ col, columns, readOnly, menuOpen, menuAnchor, onMenu, on
4061
4196
  ] });
4062
4197
  }
4063
4198
  function ValuePills({ values, onChange }) {
4064
- const [text, setText] = (0, import_react17.useState)("");
4065
- const [picking, setPicking] = (0, import_react17.useState)(null);
4199
+ const [text, setText] = (0, import_react18.useState)("");
4200
+ const [picking, setPicking] = (0, import_react18.useState)(null);
4066
4201
  const add = () => {
4067
4202
  const label = text.trim();
4068
4203
  if (!label) return;
@@ -4077,11 +4212,11 @@ function ValuePills({ values, onChange }) {
4077
4212
  onChange(values.map((v, j) => j === i ? { ...v, color } : v));
4078
4213
  setPicking(null);
4079
4214
  };
4080
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-values", onClick: (e) => {
4215
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-values", onClick: (e) => {
4081
4216
  if (e.target === e.currentTarget) e.currentTarget.querySelector("input")?.focus();
4082
4217
  }, children: [
4083
- values.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "shg-value", children: [
4084
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
4218
+ values.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "shg-value", children: [
4219
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
4085
4220
  "button",
4086
4221
  {
4087
4222
  type: "button",
@@ -4095,7 +4230,7 @@ function ValuePills({ values, onChange }) {
4095
4230
  },
4096
4231
  children: [
4097
4232
  v.label,
4098
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4233
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4099
4234
  "span",
4100
4235
  {
4101
4236
  className: "shg-value-x",
@@ -4111,7 +4246,7 @@ function ValuePills({ values, onChange }) {
4111
4246
  ]
4112
4247
  }
4113
4248
  ),
4114
- picking === i && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shg-swatches", role: "listbox", "aria-label": `Color for ${v.label}`, children: PILL_PALETTE.map((p) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4249
+ picking === i && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shg-swatches", role: "listbox", "aria-label": `Color for ${v.label}`, children: PILL_PALETTE.map((p) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4115
4250
  "button",
4116
4251
  {
4117
4252
  type: "button",
@@ -4128,7 +4263,7 @@ function ValuePills({ values, onChange }) {
4128
4263
  p.name
4129
4264
  )) })
4130
4265
  ] }, v.label)),
4131
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4266
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4132
4267
  "input",
4133
4268
  {
4134
4269
  className: "shg-values-input",
@@ -4147,24 +4282,24 @@ function ValuePills({ values, onChange }) {
4147
4282
  ] });
4148
4283
  }
4149
4284
  function ColumnMenu({ col, columns, anchor, onApply, onDelete, onClose }) {
4150
- const [type, setType] = (0, import_react17.useState)(col.type || "text");
4151
- const [values, setValues] = (0, import_react17.useState)(() => (col.options || []).map((o) => typeof o === "string" ? { label: o } : { label: o.label ?? String(o.value ?? ""), ...o.color ? { color: o.color } : {} }));
4285
+ const [type, setType] = (0, import_react18.useState)(col.type || "text");
4286
+ const [values, setValues] = (0, import_react18.useState)(() => (col.options || []).map((o) => typeof o === "string" ? { label: o } : { label: o.label ?? String(o.value ?? ""), ...o.color ? { color: o.color } : {} }));
4152
4287
  const comp = col.compute || {};
4153
- const [kind, setKind] = (0, import_react17.useState)(comp.kind || "prompt");
4154
- const [prompt, setPrompt] = (0, import_react17.useState)(comp.prompt || "");
4155
- const [harnessId, setHarnessId] = (0, import_react17.useState)(comp.harness_id || "");
4156
- const [wfSlug, setWfSlug] = (0, import_react17.useState)(comp.workflow_slug || "");
4157
- const [outKey, setOutKey] = (0, import_react17.useState)(comp.output_key || "");
4158
- const [deps, setDeps] = (0, import_react17.useState)(new Set(comp.deps || []));
4159
- const ref = (0, import_react17.useRef)(null);
4160
- (0, import_react17.useEffect)(() => {
4288
+ const [kind, setKind] = (0, import_react18.useState)(comp.kind || "prompt");
4289
+ const [prompt, setPrompt] = (0, import_react18.useState)(comp.prompt || "");
4290
+ const [harnessId, setHarnessId] = (0, import_react18.useState)(comp.harness_id || "");
4291
+ const [wfSlug, setWfSlug] = (0, import_react18.useState)(comp.workflow_slug || "");
4292
+ const [outKey, setOutKey] = (0, import_react18.useState)(comp.output_key || "");
4293
+ const [deps, setDeps] = (0, import_react18.useState)(new Set(comp.deps || []));
4294
+ const ref = (0, import_react18.useRef)(null);
4295
+ (0, import_react18.useEffect)(() => {
4161
4296
  const onDown = (e) => {
4162
4297
  if (ref.current && !ref.current.contains(e.target) && !(e.target.closest && e.target.closest(".uic-pop"))) onClose();
4163
4298
  };
4164
4299
  window.addEventListener("mousedown", onDown);
4165
4300
  return () => window.removeEventListener("mousedown", onDown);
4166
4301
  }, [onClose]);
4167
- const promptItems = (0, import_react17.useMemo)(() => {
4302
+ const promptItems = (0, import_react18.useMemo)(() => {
4168
4303
  const at = columns.findIndex((c) => c.id === col.id);
4169
4304
  return columns.filter((c) => c.id !== col.id).map((c) => {
4170
4305
  const idx = columns.findIndex((x) => x.id === c.id);
@@ -4199,26 +4334,26 @@ function ColumnMenu({ col, columns, anchor, onApply, onDelete, onClose }) {
4199
4334
  }
4200
4335
  onApply(patch);
4201
4336
  };
4202
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopPortal, { anchor, width: 250, estHeight: 340, className: "shg-menu", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { ref, onClick: (e) => e.stopPropagation(), children: [
4203
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "shg-menu-lbl", children: [
4337
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopPortal, { anchor, width: 250, estHeight: 340, className: "shg-menu", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref, onClick: (e) => e.stopPropagation(), children: [
4338
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "shg-menu-lbl", children: [
4204
4339
  "Type",
4205
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { className: "shg-menu-input", value: type, onChange: (e) => setType(e.target.value), children: [
4206
- MANUAL_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: t, children: TYPE_LABEL[t] }, t)),
4207
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "compute", children: "Computed" })
4340
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("select", { className: "shg-menu-input", value: type, onChange: (e) => setType(e.target.value), children: [
4341
+ MANUAL_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: t, children: TYPE_LABEL[t] }, t)),
4342
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "compute", children: "Computed" })
4208
4343
  ] })
4209
4344
  ] }),
4210
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-menu-lbl", children: [
4345
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-menu-lbl", children: [
4211
4346
  type === "select" || type === "tags" ? "Options" : "Values",
4212
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ValuePills, { values, onChange: setValues })
4347
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ValuePills, { values, onChange: setValues })
4213
4348
  ] }),
4214
- type === "compute" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
4215
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "shg-menu-lbl", children: [
4349
+ type === "compute" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
4350
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "shg-menu-lbl", children: [
4216
4351
  "Runs",
4217
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("select", { className: "shg-menu-input", value: kind, onChange: (e) => setKind(e.target.value), children: COMPUTE_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: k.kind, children: k.label }, k.kind)) })
4352
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("select", { className: "shg-menu-input", value: kind, onChange: (e) => setKind(e.target.value), children: COMPUTE_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: k.kind, children: k.label }, k.kind)) })
4218
4353
  ] }),
4219
- (kind === "prompt" || kind === "harness") && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-menu-lbl", children: [
4354
+ (kind === "prompt" || kind === "harness") && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-menu-lbl", children: [
4220
4355
  "Prompt",
4221
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shg-menu-input shg-menu-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
4356
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shg-menu-input shg-menu-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4222
4357
  MentionInput,
4223
4358
  {
4224
4359
  value: prompt,
@@ -4233,26 +4368,26 @@ function ColumnMenu({ col, columns, anchor, onApply, onDelete, onClose }) {
4233
4368
  label: "Prompt"
4234
4369
  }
4235
4370
  ) }),
4236
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shg-menu-hint", children: "Type @ to add a column from this row. Columns to the left fill first." })
4371
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shg-menu-hint", children: "Type @ to add a column from this row. Columns to the left fill first." })
4237
4372
  ] }),
4238
- kind === "harness" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "shg-menu-lbl", children: [
4373
+ kind === "harness" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "shg-menu-lbl", children: [
4239
4374
  "Agent id",
4240
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "shg-menu-input", value: harnessId, onChange: (e) => setHarnessId(e.target.value), placeholder: "chrn_\u2026" })
4375
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", { className: "shg-menu-input", value: harnessId, onChange: (e) => setHarnessId(e.target.value), placeholder: "chrn_\u2026" })
4241
4376
  ] }),
4242
- kind === "workflow" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
4243
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "shg-menu-lbl", children: [
4377
+ kind === "workflow" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
4378
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "shg-menu-lbl", children: [
4244
4379
  "Workflow id",
4245
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "shg-menu-input", value: wfSlug, onChange: (e) => setWfSlug(e.target.value), placeholder: "my-workflow" })
4380
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", { className: "shg-menu-input", value: wfSlug, onChange: (e) => setWfSlug(e.target.value), placeholder: "my-workflow" })
4246
4381
  ] }),
4247
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "shg-menu-lbl", children: [
4382
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "shg-menu-lbl", children: [
4248
4383
  "Output key (optional)",
4249
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "shg-menu-input", value: outKey, onChange: (e) => setOutKey(e.target.value), placeholder: "summary" })
4384
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("input", { className: "shg-menu-input", value: outKey, onChange: (e) => setOutKey(e.target.value), placeholder: "summary" })
4250
4385
  ] })
4251
4386
  ] })
4252
4387
  ] }),
4253
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "shg-menu-actions", children: [
4254
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-menu-del", onClick: onDelete, children: "Delete column" }),
4255
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "shg-menu-apply", onClick: apply, children: "Apply" })
4388
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "shg-menu-actions", children: [
4389
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-menu-del", onClick: onDelete, children: "Delete column" }),
4390
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "shg-menu-apply", onClick: apply, children: "Apply" })
4256
4391
  ] })
4257
4392
  ] }) });
4258
4393
  }
@@ -4284,8 +4419,8 @@ function sheetToAoA(sheet) {
4284
4419
  }
4285
4420
 
4286
4421
  // src/components/FileTypeIcon.jsx
4287
- var import_react18 = require("react");
4288
- var import_jsx_runtime16 = require("react/jsx-runtime");
4422
+ var import_react19 = require("react");
4423
+ var import_jsx_runtime17 = require("react/jsx-runtime");
4289
4424
  function extOf(name) {
4290
4425
  const m = String(name || "").toLowerCase().match(/\.([a-z0-9]+)$/);
4291
4426
  return m ? m[1] : "";
@@ -4293,9 +4428,9 @@ function extOf(name) {
4293
4428
  var mod = null;
4294
4429
  var tried = false;
4295
4430
  function FileTypeIcon({ name, size = 36 }) {
4296
- const [, force] = (0, import_react18.useState)(0);
4431
+ const [, force] = (0, import_react19.useState)(0);
4297
4432
  const ext = extOf(name);
4298
- (0, import_react18.useEffect)(() => {
4433
+ (0, import_react19.useEffect)(() => {
4299
4434
  if (tried || mod) return;
4300
4435
  tried = true;
4301
4436
  import("react-file-icon").then((m) => {
@@ -4306,15 +4441,15 @@ function FileTypeIcon({ name, size = 36 }) {
4306
4441
  }, []);
4307
4442
  const box = { width: size, height: Math.round(size * 1.16), display: "inline-block", flex: "0 0 auto" };
4308
4443
  if (!mod) {
4309
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uic-fileglyph", style: box, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "uic-fileglyph-ext", children: (ext || "file").slice(0, 4) }) });
4444
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "uic-fileglyph", style: box, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "uic-fileglyph-ext", children: (ext || "file").slice(0, 4) }) });
4310
4445
  }
4311
4446
  const { FileIcon, defaultStyles } = mod;
4312
4447
  const style = defaultStyles?.[ext] || {};
4313
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: box, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FileIcon, { extension: ext || void 0, ...style }) });
4448
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: box, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileIcon, { extension: ext || void 0, ...style }) });
4314
4449
  }
4315
4450
 
4316
4451
  // src/components/FileCard.jsx
4317
- var import_jsx_runtime17 = require("react/jsx-runtime");
4452
+ var import_jsx_runtime18 = require("react/jsx-runtime");
4318
4453
  function subtitle(name, origin, bytes) {
4319
4454
  const parts = [(extOf(name) || "file").toUpperCase()];
4320
4455
  if (origin) parts.push(origin);
@@ -4332,7 +4467,7 @@ function FileCard({ name, origin = "output", bytes, onPreview, onDownload, class
4332
4467
  e.stopPropagation();
4333
4468
  onPreview();
4334
4469
  } : void 0;
4335
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
4470
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
4336
4471
  "div",
4337
4472
  {
4338
4473
  className: "uic-filecard" + (open ? " is-clickable" : "") + (className ? " " + className : ""),
@@ -4347,12 +4482,12 @@ function FileCard({ name, origin = "output", bytes, onPreview, onDownload, class
4347
4482
  } : void 0,
4348
4483
  title: name,
4349
4484
  children: [
4350
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "uic-filecard-ic", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileTypeIcon, { name, size: 32 }) }),
4351
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "uic-filecard-meta", children: [
4352
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "uic-filecard-name", children: name }),
4353
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "uic-filecard-sub", children: subtitle(name, origin, bytes) })
4485
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "uic-filecard-ic", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FileTypeIcon, { name, size: 32 }) }),
4486
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "uic-filecard-meta", children: [
4487
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "uic-filecard-name", children: name }),
4488
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "uic-filecard-sub", children: subtitle(name, origin, bytes) })
4354
4489
  ] }),
4355
- onDownload && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4490
+ onDownload && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4356
4491
  "button",
4357
4492
  {
4358
4493
  type: "button",
@@ -4363,18 +4498,18 @@ function FileCard({ name, origin = "output", bytes, onPreview, onDownload, class
4363
4498
  e.stopPropagation();
4364
4499
  onDownload();
4365
4500
  },
4366
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IcDownload, { size: 18 })
4501
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IcDownload, { size: 18 })
4367
4502
  }
4368
4503
  ),
4369
- onPreview && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "uic-filecard-open", "aria-label": `Preview ${name}`, onClick: open, children: "Preview" })
4504
+ onPreview && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "uic-filecard-open", "aria-label": `Preview ${name}`, onClick: open, children: "Preview" })
4370
4505
  ]
4371
4506
  }
4372
4507
  );
4373
4508
  }
4374
4509
 
4375
4510
  // src/components/FilePreview.jsx
4376
- var import_react19 = require("react");
4377
- var import_jsx_runtime18 = require("react/jsx-runtime");
4511
+ var import_react20 = require("react");
4512
+ var import_jsx_runtime19 = require("react/jsx-runtime");
4378
4513
  var LANG = {
4379
4514
  js: "javascript",
4380
4515
  mjs: "javascript",
@@ -4455,11 +4590,11 @@ function delimitedToRows(text, sep) {
4455
4590
  });
4456
4591
  }
4457
4592
  function Grid({ rows }) {
4458
- if (!rows?.length) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-empty", children: "This file is empty." });
4593
+ if (!rows?.length) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-empty", children: "This file is empty." });
4459
4594
  const [head, ...body] = rows;
4460
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-sheet", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("table", { children: [
4461
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tr", { children: head.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("th", { children: c }, i)) }) }),
4462
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tbody", { children: body.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tr", { children: r.map((c, j) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("td", { children: c }, j)) }, i)) })
4595
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-sheet", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("table", { children: [
4596
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tr", { children: head.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("th", { children: c }, i)) }) }),
4597
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tbody", { children: body.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tr", { children: r.map((c, j) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("td", { children: c }, j)) }, i)) })
4463
4598
  ] }) });
4464
4599
  }
4465
4600
  var defaultDownload = (url, name) => {
@@ -4482,10 +4617,10 @@ function FilePreview({
4482
4617
  title
4483
4618
  }) {
4484
4619
  const { url, name } = file || {};
4485
- const [st, setSt] = (0, import_react19.useState)({ kind: "loading" });
4486
- const [tab, setTab] = (0, import_react19.useState)(0);
4487
- const [view, setView] = (0, import_react19.useState)("preview");
4488
- (0, import_react19.useEffect)(() => {
4620
+ const [st, setSt] = (0, import_react20.useState)({ kind: "loading" });
4621
+ const [tab, setTab] = (0, import_react20.useState)(0);
4622
+ const [view, setView] = (0, import_react20.useState)("preview");
4623
+ (0, import_react20.useEffect)(() => {
4489
4624
  if (!url) return void 0;
4490
4625
  let alive = true;
4491
4626
  let obj;
@@ -4548,11 +4683,11 @@ function FilePreview({
4548
4683
  };
4549
4684
  }, [url, name, fetchFile, officePdfUrl, parseWorkbook]);
4550
4685
  const download = () => onDownload ? onDownload(url, name) : defaultDownload(url, name);
4551
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("aside", { className: "uic-fp", "aria-label": title || `Preview of ${name}`, children: [
4552
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("header", { className: "uic-fp-head", children: [
4553
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "uic-fp-ic", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FileTypeIcon, { name, size: 20 }) }),
4554
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "uic-fp-name", title: name, children: name }),
4555
- st.kind === "html" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-seg", role: "tablist", "aria-label": "Show the page or its source", children: [["preview", "Preview"], ["source", "Source"]].map(([id, label]) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4686
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("aside", { className: "uic-fp", "aria-label": title || `Preview of ${name}`, children: [
4687
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "uic-fp-head", children: [
4688
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uic-fp-ic", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FileTypeIcon, { name, size: 20 }) }),
4689
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uic-fp-name", title: name, children: name }),
4690
+ st.kind === "html" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-seg", role: "tablist", "aria-label": "Show the page or its source", children: [["preview", "Preview"], ["source", "Source"]].map(([id, label]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4556
4691
  "button",
4557
4692
  {
4558
4693
  type: "button",
@@ -4564,7 +4699,7 @@ function FilePreview({
4564
4699
  },
4565
4700
  id
4566
4701
  )) }),
4567
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4702
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4568
4703
  "button",
4569
4704
  {
4570
4705
  type: "button",
@@ -4572,10 +4707,10 @@ function FilePreview({
4572
4707
  "aria-label": `Download ${name}`,
4573
4708
  title: "Download",
4574
4709
  onClick: download,
4575
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IcDownload, {})
4710
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IcDownload, {})
4576
4711
  }
4577
4712
  ),
4578
- onClose && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4713
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4579
4714
  "button",
4580
4715
  {
4581
4716
  type: "button",
@@ -4583,26 +4718,26 @@ function FilePreview({
4583
4718
  "aria-label": "Close preview",
4584
4719
  title: "Close",
4585
4720
  onClick: onClose,
4586
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IcX, { size: 18 })
4721
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IcX, { size: 18 })
4587
4722
  }
4588
4723
  )
4589
4724
  ] }),
4590
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uic-fp-body", children: [
4591
- st.kind === "loading" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-pad", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "uic-skel uic-fp-skel" }) }),
4592
- st.kind === "image" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", { className: "uic-fp-img", src: st.objUrl, alt: name }) }),
4593
- st.kind === "pdf" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("iframe", { className: "uic-fp-frame", src: st.objUrl, title: name }),
4594
- st.kind === "video" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("video", { className: "uic-fp-media", src: st.objUrl, controls: true }) }),
4595
- st.kind === "audio" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("audio", { src: st.objUrl, controls: true }) }),
4596
- st.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-doc", children: renderMarkdown ? renderMarkdown(st.text || "") : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("pre", { className: "uic-fp-pre", children: st.text }) }),
4597
- st.kind === "code" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CodeBlock, { code: st.text || "", language: LANG[extOf(name)] || "plaintext" }),
4598
- st.kind === "html" && view === "source" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CodeBlock, { code: st.text || "", language: "xml" }),
4725
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uic-fp-body", children: [
4726
+ st.kind === "loading" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-pad", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uic-skel uic-fp-skel" }) }),
4727
+ st.kind === "image" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { className: "uic-fp-img", src: st.objUrl, alt: name }) }),
4728
+ st.kind === "pdf" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("iframe", { className: "uic-fp-frame", src: st.objUrl, title: name }),
4729
+ st.kind === "video" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("video", { className: "uic-fp-media", src: st.objUrl, controls: true }) }),
4730
+ st.kind === "audio" && st.objUrl && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("audio", { src: st.objUrl, controls: true }) }),
4731
+ st.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-doc", children: renderMarkdown ? renderMarkdown(st.text || "") : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("pre", { className: "uic-fp-pre", children: st.text }) }),
4732
+ st.kind === "code" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CodeBlock, { code: st.text || "", language: LANG[extOf(name)] || "plaintext" }),
4733
+ st.kind === "html" && view === "source" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CodeBlock, { code: st.text || "", language: "xml" }),
4599
4734
  st.kind === "html" && view === "preview" && // The page runs in its own origin with scripts only: a mockup's own script and styles
4600
4735
  // work, and nothing in it can read the host page, its cookies or its storage.
4601
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("iframe", { className: "uic-fp-frame", title: name, sandbox: "allow-scripts", srcDoc: st.text || "" }),
4602
- st.kind === "csv" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Grid, { rows: st.rows }),
4603
- st.kind === "sheet" && st.sheets && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uic-fp-xlsx", children: [
4604
- st.sheets[tab]?.filled ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Grid, { rows: st.sheets[tab].rows }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-empty", children: "This sheet is empty." }),
4605
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-tabs", children: st.sheets.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4736
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("iframe", { className: "uic-fp-frame", title: name, sandbox: "allow-scripts", srcDoc: st.text || "" }),
4737
+ st.kind === "csv" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { rows: st.rows }),
4738
+ st.kind === "sheet" && st.sheets && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uic-fp-xlsx", children: [
4739
+ st.sheets[tab]?.filled ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { rows: st.sheets[tab].rows }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-empty", children: "This sheet is empty." }),
4740
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-tabs", children: st.sheets.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4606
4741
  "button",
4607
4742
  {
4608
4743
  type: "button",
@@ -4614,40 +4749,40 @@ function FilePreview({
4614
4749
  s.name + i
4615
4750
  )) })
4616
4751
  ] }),
4617
- st.kind === "binary" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "uic-fp-fallback", children: [
4618
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FileTypeIcon, { name, size: 56 }),
4619
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: st.error || "No inline preview for this file type." }),
4620
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "uic-fp-dl", onClick: download, children: "Download" })
4752
+ st.kind === "binary" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "uic-fp-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uic-fp-fallback", children: [
4753
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FileTypeIcon, { name, size: 56 }),
4754
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: st.error || "No inline preview for this file type." }),
4755
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "uic-fp-dl", onClick: download, children: "Download" })
4621
4756
  ] }) })
4622
4757
  ] })
4623
4758
  ] });
4624
4759
  }
4625
4760
 
4626
4761
  // src/components/form.jsx
4627
- var import_react20 = require("react");
4628
- var import_jsx_runtime19 = require("react/jsx-runtime");
4762
+ var import_react21 = require("react");
4763
+ var import_jsx_runtime20 = require("react/jsx-runtime");
4629
4764
  function Field({ label, hint, error, htmlFor, required, children, className = "" }) {
4630
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "uic-field" + (error ? " is-error" : "") + (className ? " " + className : ""), children: [
4631
- label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "uic-field-label", htmlFor, children: [
4765
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "uic-field" + (error ? " is-error" : "") + (className ? " " + className : ""), children: [
4766
+ label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "uic-field-label", htmlFor, children: [
4632
4767
  label,
4633
- required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uic-field-req", "aria-hidden": "true", children: "*" })
4768
+ required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "uic-field-req", "aria-hidden": "true", children: "*" })
4634
4769
  ] }),
4635
4770
  children,
4636
- error ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "uic-field-err", children: error }) : hint ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "uic-field-hint", children: hint }) : null
4771
+ error ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "uic-field-err", children: error }) : hint ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "uic-field-hint", children: hint }) : null
4637
4772
  ] });
4638
4773
  }
4639
4774
  function withField(Control) {
4640
4775
  return function Fielded({ label, hint, error, required, id, className, ...rest }) {
4641
- const auto = (0, import_react20.useId)();
4776
+ const auto = (0, import_react21.useId)();
4642
4777
  const inputId = id || auto;
4643
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Field, { label, hint, error, required, htmlFor: inputId, className, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Control, { id: inputId, invalid: !!error, required, ...rest }) });
4778
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Field, { label, hint, error, required, htmlFor: inputId, className, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Control, { id: inputId, invalid: !!error, required, ...rest }) });
4644
4779
  };
4645
4780
  }
4646
4781
  function BareInput({ invalid, ...rest }) {
4647
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { className: "uic-input" + (invalid ? " is-error" : ""), "aria-invalid": invalid || void 0, ...rest });
4782
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { className: "uic-input" + (invalid ? " is-error" : ""), "aria-invalid": invalid || void 0, ...rest });
4648
4783
  }
4649
4784
  function BareTextarea({ invalid, rows = 4, ...rest }) {
4650
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4785
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4651
4786
  "textarea",
4652
4787
  {
4653
4788
  className: "uic-input uic-textarea" + (invalid ? " is-error" : ""),
@@ -4658,44 +4793,44 @@ function BareTextarea({ invalid, rows = 4, ...rest }) {
4658
4793
  );
4659
4794
  }
4660
4795
  function BareSelect({ invalid, options = [], placeholder, ...rest }) {
4661
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "uic-select-wrap", children: [
4662
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4796
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "uic-select-wrap", children: [
4797
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
4663
4798
  "select",
4664
4799
  {
4665
4800
  className: "uic-input uic-select" + (invalid ? " is-error" : ""),
4666
4801
  "aria-invalid": invalid || void 0,
4667
4802
  ...rest,
4668
4803
  children: [
4669
- placeholder && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: "", children: placeholder }),
4804
+ placeholder && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: "", children: placeholder }),
4670
4805
  options.map((o) => {
4671
4806
  const opt = typeof o === "string" ? { value: o, label: o } : o;
4672
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value);
4807
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value);
4673
4808
  })
4674
4809
  ]
4675
4810
  }
4676
4811
  ),
4677
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uic-select-chev", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Chevron, { dir: "down", size: 14 }) })
4812
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "uic-select-chev", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Chevron, { dir: "down", size: 14 }) })
4678
4813
  ] });
4679
4814
  }
4680
4815
  var Input = withField(BareInput);
4681
4816
  var Textarea = withField(BareTextarea);
4682
4817
  var Select = withField(BareSelect);
4683
4818
  function FormActions({ children, align = "end", className = "" }) {
4684
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: `uic-form-actions is-${align}${className ? " " + className : ""}`, children });
4819
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `uic-form-actions is-${align}${className ? " " + className : ""}`, children });
4685
4820
  }
4686
4821
  function Button({ variant = "default", size = "md", type = "button", className = "", ...rest }) {
4687
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type, className: `uic-btn is-${variant} is-${size}${className ? " " + className : ""}`, ...rest });
4822
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type, className: `uic-btn is-${variant} is-${size}${className ? " " + className : ""}`, ...rest });
4688
4823
  }
4689
4824
 
4690
4825
  // src/components/Carousel.jsx
4691
- var import_react21 = __toESM(require("react"), 1);
4692
- var import_jsx_runtime20 = require("react/jsx-runtime");
4826
+ var import_react22 = __toESM(require("react"), 1);
4827
+ var import_jsx_runtime21 = require("react/jsx-runtime");
4693
4828
  var EDGE = 2;
4694
4829
  function Carousel(props) {
4695
4830
  const { label, step, children, classNames = {} } = props;
4696
- const ref = (0, import_react21.useRef)(null);
4697
- const [edges, setEdges] = (0, import_react21.useState)({ start: true, end: true, overflow: false });
4698
- const measure = (0, import_react21.useCallback)(() => {
4831
+ const ref = (0, import_react22.useRef)(null);
4832
+ const [edges, setEdges] = (0, import_react22.useState)({ start: true, end: true, overflow: false });
4833
+ const measure = (0, import_react22.useCallback)(() => {
4699
4834
  const el = ref.current;
4700
4835
  if (!el) return;
4701
4836
  const overflow = el.scrollWidth - el.clientWidth > EDGE;
@@ -4705,7 +4840,7 @@ function Carousel(props) {
4705
4840
  end: el.scrollLeft >= el.scrollWidth - el.clientWidth - EDGE
4706
4841
  });
4707
4842
  }, []);
4708
- (0, import_react21.useEffect)(() => {
4843
+ (0, import_react22.useEffect)(() => {
4709
4844
  const el = ref.current;
4710
4845
  if (!el) return void 0;
4711
4846
  measure();
@@ -4719,8 +4854,8 @@ function Carousel(props) {
4719
4854
  if (!el) return;
4720
4855
  el.scrollBy({ left: dir * (step || Math.round(el.clientWidth * 0.9)), behavior: "smooth" });
4721
4856
  };
4722
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: ["uic-carousel-wrap", classNames.root || ""].filter(Boolean).join(" "), children: [
4723
- edges.overflow ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4857
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: ["uic-carousel-wrap", classNames.root || ""].filter(Boolean).join(" "), children: [
4858
+ edges.overflow ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4724
4859
  "button",
4725
4860
  {
4726
4861
  type: "button",
@@ -4728,10 +4863,10 @@ function Carousel(props) {
4728
4863
  onClick: () => scroll(-1),
4729
4864
  disabled: edges.start,
4730
4865
  "aria-label": `Scroll ${label} left`,
4731
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Chevron, { dir: "left" })
4866
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Chevron, { dir: "left" })
4732
4867
  }
4733
4868
  ) : null,
4734
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4869
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4735
4870
  "div",
4736
4871
  {
4737
4872
  className: ["uic-carousel", classNames.viewport || ""].filter(Boolean).join(" "),
@@ -4742,7 +4877,7 @@ function Carousel(props) {
4742
4877
  children
4743
4878
  }
4744
4879
  ),
4745
- edges.overflow ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4880
+ edges.overflow ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4746
4881
  "button",
4747
4882
  {
4748
4883
  type: "button",
@@ -4750,42 +4885,42 @@ function Carousel(props) {
4750
4885
  onClick: () => scroll(1),
4751
4886
  disabled: edges.end,
4752
4887
  "aria-label": `Scroll ${label} right`,
4753
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Chevron, { dir: "right" })
4888
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Chevron, { dir: "right" })
4754
4889
  }
4755
4890
  ) : null
4756
4891
  ] });
4757
4892
  }
4758
4893
 
4759
4894
  // src/components/Card.jsx
4760
- var import_react22 = __toESM(require("react"), 1);
4761
- var import_jsx_runtime21 = require("react/jsx-runtime");
4895
+ var import_react23 = __toESM(require("react"), 1);
4896
+ var import_jsx_runtime22 = require("react/jsx-runtime");
4762
4897
  function Card(props) {
4763
4898
  const { art, title, subtitle: subtitle2, onClick, selected = false, overlay, actions, classNames = {} } = props;
4764
- const foot = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "uic-card-foot", children: [
4765
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "uic-card-name", children: title }),
4766
- subtitle2 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "uic-card-sub", children: subtitle2 }) : null
4899
+ const foot = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "uic-card-foot", children: [
4900
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uic-card-name", children: title }),
4901
+ subtitle2 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uic-card-sub", children: subtitle2 }) : null
4767
4902
  ] });
4768
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: ["uic-card", selected ? "is-selected" : "", classNames.root || ""].filter(Boolean).join(" "), children: [
4769
- onClick ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "uic-card-main", onClick, "aria-pressed": selected || void 0, children: [
4770
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "uic-card-art", children: art }),
4903
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: ["uic-card", selected ? "is-selected" : "", classNames.root || ""].filter(Boolean).join(" "), children: [
4904
+ onClick ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { type: "button", className: "uic-card-main", onClick, "aria-pressed": selected || void 0, children: [
4905
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uic-card-art", children: art }),
4771
4906
  foot
4772
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "uic-card-main", children: [
4773
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "uic-card-art", children: art }),
4907
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uic-card-main", children: [
4908
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uic-card-art", children: art }),
4774
4909
  foot
4775
4910
  ] }),
4776
- overlay ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uic-card-overlay", children: overlay }) : null,
4777
- actions ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uic-card-actions", children: actions }) : null
4911
+ overlay ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uic-card-overlay", children: overlay }) : null,
4912
+ actions ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uic-card-actions", children: actions }) : null
4778
4913
  ] });
4779
4914
  }
4780
4915
 
4781
4916
  // src/components/SearchField.jsx
4782
- var import_react23 = __toESM(require("react"), 1);
4783
- var import_jsx_runtime22 = require("react/jsx-runtime");
4917
+ var import_react24 = __toESM(require("react"), 1);
4918
+ var import_jsx_runtime23 = require("react/jsx-runtime");
4784
4919
  function SearchField(props) {
4785
4920
  const { value, onChange, placeholder, clearLabel = "Clear search", className } = props;
4786
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: ["uic-search", className || ""].filter(Boolean).join(" "), children: [
4787
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uic-search-ic", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IcSearch, {}) }),
4788
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4921
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: ["uic-search", className || ""].filter(Boolean).join(" "), children: [
4922
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-search-ic", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IcSearch, {}) }),
4923
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4789
4924
  "input",
4790
4925
  {
4791
4926
  type: "search",
@@ -4795,14 +4930,14 @@ function SearchField(props) {
4795
4930
  onChange: (e) => onChange(e.target.value)
4796
4931
  }
4797
4932
  ),
4798
- value ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", className: "uic-search-x", "aria-label": clearLabel, onClick: () => onChange(""), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IcX, { size: 12 }) }) : null
4933
+ value ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { type: "button", className: "uic-search-x", "aria-label": clearLabel, onClick: () => onChange(""), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IcX, { size: 12 }) }) : null
4799
4934
  ] });
4800
4935
  }
4801
4936
 
4802
4937
  // src/components/CascadeMenu.jsx
4803
- var import_react24 = __toESM(require("react"), 1);
4804
- var import_jsx_runtime23 = require("react/jsx-runtime");
4805
- var Tick = () => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Svg, { s: 14, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "M20 6 9 17l-5-5" }) });
4938
+ var import_react25 = __toESM(require("react"), 1);
4939
+ var import_jsx_runtime24 = require("react/jsx-runtime");
4940
+ var Tick = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Svg, { s: 14, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M20 6 9 17l-5-5" }) });
4806
4941
  var FILTER_PAST = 8;
4807
4942
  var itemsOf = (groups) => groups.flatMap((g) => g.items);
4808
4943
  function CascadeMenu(props) {
@@ -4826,21 +4961,21 @@ function CascadeMenu(props) {
4826
4961
  className,
4827
4962
  value
4828
4963
  } = props;
4829
- const rootRef = (0, import_react24.useRef)(null);
4830
- const [q, setQ] = (0, import_react24.useState)("");
4831
- const [activeId, setActiveId] = (0, import_react24.useState)(null);
4832
- const [stage, setStage] = (0, import_react24.useState)("items");
4833
- const [stacked, setStacked] = (0, import_react24.useState)(false);
4834
- const visible = (0, import_react24.useMemo)(() => {
4964
+ const rootRef = (0, import_react25.useRef)(null);
4965
+ const [q, setQ] = (0, import_react25.useState)("");
4966
+ const [activeId, setActiveId] = (0, import_react25.useState)(null);
4967
+ const [stage, setStage] = (0, import_react25.useState)("items");
4968
+ const [stacked, setStacked] = (0, import_react25.useState)(false);
4969
+ const visible = (0, import_react25.useMemo)(() => {
4835
4970
  const needle = q.trim().toLowerCase();
4836
4971
  if (!needle) return groups.filter((g) => g.items.length > 0);
4837
4972
  return groups.map((g) => ({ ...g, items: g.items.filter((it) => String(it.label).toLowerCase().includes(needle)) })).filter((g) => g.items.length > 0);
4838
4973
  }, [groups, q]);
4839
- const flat = (0, import_react24.useMemo)(() => itemsOf(visible), [visible]);
4974
+ const flat = (0, import_react25.useMemo)(() => itemsOf(visible), [visible]);
4840
4975
  const active = flat.find((it) => it.id === activeId) || flat[0] || null;
4841
- const options = (0, import_react24.useMemo)(() => active && optionsOf ? optionsOf(active) : [], [active, optionsOf]);
4976
+ const options = (0, import_react25.useMemo)(() => active && optionsOf ? optionsOf(active) : [], [active, optionsOf]);
4842
4977
  const showFilter = filter === true || filter === "auto" && itemsOf(groups).length > FILTER_PAST;
4843
- (0, import_react24.useEffect)(() => {
4978
+ (0, import_react25.useEffect)(() => {
4844
4979
  if (!open) return void 0;
4845
4980
  setQ("");
4846
4981
  setActiveId(value?.item ?? null);
@@ -4859,14 +4994,14 @@ function CascadeMenu(props) {
4859
4994
  anchor?.focus?.({ preventScroll: true });
4860
4995
  };
4861
4996
  }, [open, stackBelow]);
4862
- const focusIn = (0, import_react24.useCallback)((col, index = 0) => {
4997
+ const focusIn = (0, import_react25.useCallback)((col, index = 0) => {
4863
4998
  const list = rootRef.current?.querySelectorAll(`.uic-cascade-${col} .uic-pop-item:not(:disabled)`);
4864
4999
  if (!list || !list.length) return false;
4865
5000
  const i = Math.max(0, Math.min(index, list.length - 1));
4866
5001
  list[i].focus({ preventScroll: true });
4867
5002
  return true;
4868
5003
  }, []);
4869
- const enterOptions = (0, import_react24.useCallback)(() => {
5004
+ const enterOptions = (0, import_react25.useCallback)(() => {
4870
5005
  if (stacked) {
4871
5006
  setStage("options");
4872
5007
  requestAnimationFrame(() => focusIn("options"));
@@ -4906,7 +5041,7 @@ function CascadeMenu(props) {
4906
5041
  };
4907
5042
  const showItems = !stacked || stage === "items";
4908
5043
  const showOptions = !stacked || stage === "options";
4909
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5044
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4910
5045
  Popover,
4911
5046
  {
4912
5047
  open,
@@ -4916,15 +5051,15 @@ function CascadeMenu(props) {
4916
5051
  width: stacked ? 320 : width,
4917
5052
  minHeight: 260,
4918
5053
  className: ["uic-cascade-pop", className || ""].filter(Boolean).join(" "),
4919
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { ref: rootRef, className: "uic-cascade" + (stacked ? " is-stacked" : ""), onKeyDown: onKey2, children: [
4920
- showItems && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uic-cascade-col uic-cascade-items", children: [
4921
- showFilter ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SearchField, { className: "uic-cascade-filter", value: q, onChange: setQ, placeholder: filterPlaceholder }) : null,
4922
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uic-pop-list", children: [
4923
- visible.map((g, gi) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react24.Fragment, { children: [
4924
- g.label ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uic-cascade-group", children: g.label }) : null,
5054
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { ref: rootRef, className: "uic-cascade" + (stacked ? " is-stacked" : ""), onKeyDown: onKey2, children: [
5055
+ showItems && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-cascade-col uic-cascade-items", children: [
5056
+ showFilter ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SearchField, { className: "uic-cascade-filter", value: q, onChange: setQ, placeholder: filterPlaceholder }) : null,
5057
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-pop-list", children: [
5058
+ visible.map((g, gi) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react25.Fragment, { children: [
5059
+ g.label ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uic-cascade-group", children: g.label }) : null,
4925
5060
  g.items.map((it) => {
4926
5061
  const on = active?.id === it.id;
4927
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5062
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4928
5063
  "button",
4929
5064
  {
4930
5065
  type: "button",
@@ -4937,22 +5072,22 @@ function CascadeMenu(props) {
4937
5072
  enterOptions();
4938
5073
  },
4939
5074
  children: [
4940
- it.icon ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-cascade-ic", "aria-hidden": "true", children: it.icon }) : null,
4941
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-chip-t", children: it.label }),
4942
- it.note ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-cascade-note", children: it.note }) : null,
4943
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-cascade-chev", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Chevron, { dir: "right", size: 14 }) })
5075
+ it.icon ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-cascade-ic", "aria-hidden": "true", children: it.icon }) : null,
5076
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-chip-t", children: it.label }),
5077
+ it.note ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-cascade-note", children: it.note }) : null,
5078
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-cascade-chev", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Chevron, { dir: "right", size: 14 }) })
4944
5079
  ]
4945
5080
  },
4946
5081
  it.id
4947
5082
  );
4948
5083
  })
4949
5084
  ] }, g.label || gi)),
4950
- flat.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uic-pop-note", children: emptyText }) : null
5085
+ flat.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uic-pop-note", children: emptyText }) : null
4951
5086
  ] })
4952
5087
  ] }),
4953
- showOptions && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uic-cascade-col uic-cascade-options", role: "group", "aria-label": optionsLabel, children: [
4954
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uic-cascade-head", children: [
4955
- stacked ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5088
+ showOptions && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-cascade-col uic-cascade-options", role: "group", "aria-label": optionsLabel, children: [
5089
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-cascade-head", children: [
5090
+ stacked ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4956
5091
  "button",
4957
5092
  {
4958
5093
  type: "button",
@@ -4962,16 +5097,16 @@ function CascadeMenu(props) {
4962
5097
  setStage("items");
4963
5098
  requestAnimationFrame(() => focusIn("items", flat.indexOf(active)));
4964
5099
  },
4965
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Chevron, { dir: "left", size: 14 })
5100
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Chevron, { dir: "left", size: 14 })
4966
5101
  }
4967
5102
  ) : null,
4968
- active?.icon ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-cascade-ic", "aria-hidden": "true", children: active.icon }) : null,
4969
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-chip-t", children: active ? active.label : "" })
5103
+ active?.icon ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-cascade-ic", "aria-hidden": "true", children: active.icon }) : null,
5104
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-chip-t", children: active ? active.label : "" })
4970
5105
  ] }),
4971
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uic-pop-list", children: [
5106
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-pop-list", children: [
4972
5107
  options.map((o) => {
4973
5108
  const on = !!value && active?.id === value.item && o.id === value.option;
4974
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
5109
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4975
5110
  "button",
4976
5111
  {
4977
5112
  type: "button",
@@ -4980,16 +5115,16 @@ function CascadeMenu(props) {
4980
5115
  disabled: !!o.disabled,
4981
5116
  onClick: () => onPick?.(active, o),
4982
5117
  children: [
4983
- value ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-pop-check", "aria-hidden": "true", children: on ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tick, {}) : null }) : null,
4984
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-chip-t", children: o.label }),
4985
- o.note ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uic-cascade-note", children: o.note }) : null,
5118
+ value ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-pop-check", "aria-hidden": "true", children: on ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Tick, {}) : null }) : null,
5119
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-chip-t", children: o.label }),
5120
+ o.note ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "uic-cascade-note", children: o.note }) : null,
4986
5121
  o.badge || null
4987
5122
  ]
4988
5123
  },
4989
5124
  o.id
4990
5125
  );
4991
5126
  }),
4992
- active && options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uic-pop-note", children: noOptionsText }) : null
5127
+ active && options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uic-pop-note", children: noOptionsText }) : null
4993
5128
  ] }),
4994
5129
  optionsFooter || null
4995
5130
  ] })
@@ -4999,9 +5134,9 @@ function CascadeMenu(props) {
4999
5134
  }
5000
5135
 
5001
5136
  // src/components/Modal.jsx
5002
- var import_react25 = __toESM(require("react"), 1);
5137
+ var import_react26 = __toESM(require("react"), 1);
5003
5138
  var import_react_dom4 = require("react-dom");
5004
- var import_jsx_runtime24 = require("react/jsx-runtime");
5139
+ var import_jsx_runtime25 = require("react/jsx-runtime");
5005
5140
  function Modal(props) {
5006
5141
  const {
5007
5142
  open,
@@ -5015,10 +5150,10 @@ function Modal(props) {
5015
5150
  children,
5016
5151
  classNames = {}
5017
5152
  } = props;
5018
- const titleId = (0, import_react25.useId)();
5019
- const escape = (0, import_react25.useCallback)(() => onClose?.(), [onClose]);
5153
+ const titleId = (0, import_react26.useId)();
5154
+ const escape = (0, import_react26.useCallback)(() => onClose?.(), [onClose]);
5020
5155
  useOverlayEscape(open, escape);
5021
- (0, import_react25.useEffect)(() => {
5156
+ (0, import_react26.useEffect)(() => {
5022
5157
  if (!open || typeof document === "undefined") return void 0;
5023
5158
  const prev = document.body.style.overflow;
5024
5159
  document.body.style.overflow = "hidden";
@@ -5031,12 +5166,12 @@ function Modal(props) {
5031
5166
  if (e.target === e.currentTarget) onClose?.();
5032
5167
  };
5033
5168
  return (0, import_react_dom4.createPortal)(
5034
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5169
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5035
5170
  "div",
5036
5171
  {
5037
5172
  className: ["uic-modal-backdrop", classNames.backdrop || ""].filter(Boolean).join(" "),
5038
5173
  onMouseDown: onBackdrop,
5039
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
5174
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
5040
5175
  "div",
5041
5176
  {
5042
5177
  className: ["uic-modal", `is-${size}`, classNames.root || ""].filter(Boolean).join(" "),
@@ -5045,15 +5180,15 @@ function Modal(props) {
5045
5180
  "aria-modal": "true",
5046
5181
  "aria-labelledby": labelledBy || (title ? titleId : void 0),
5047
5182
  children: [
5048
- title || actions ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-modal-h", children: [
5049
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "uic-modal-title", children: [
5050
- title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { id: titleId, children: title }) : null,
5051
- description ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: description }) : null
5183
+ title || actions ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uic-modal-h", children: [
5184
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uic-modal-title", children: [
5185
+ title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { id: titleId, children: title }) : null,
5186
+ description ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: description }) : null
5052
5187
  ] }),
5053
5188
  actions,
5054
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "uic-modal-x", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IcX, { size: 18 }) })
5189
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", className: "uic-modal-x", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IcX, { size: 18 }) })
5055
5190
  ] }) : null,
5056
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: ["uic-modal-b", classNames.body || ""].filter(Boolean).join(" "), children })
5191
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: ["uic-modal-b", classNames.body || ""].filter(Boolean).join(" "), children })
5057
5192
  ]
5058
5193
  }
5059
5194
  )
@@ -5064,15 +5199,15 @@ function Modal(props) {
5064
5199
  }
5065
5200
 
5066
5201
  // src/hooks/useTypewriter.js
5067
- var import_react26 = require("react");
5202
+ var import_react27 = require("react");
5068
5203
  var CHAR_MS = 26;
5069
5204
  var HOLD_MS = 2600;
5070
5205
  function useTypewriter(phrases, { active = true } = {}) {
5071
5206
  const list = phrases && phrases.length ? phrases : [""];
5072
- const [text, setText] = (0, import_react26.useState)(list[0]);
5073
- const listRef = (0, import_react26.useRef)(list);
5207
+ const [text, setText] = (0, import_react27.useState)(list[0]);
5208
+ const listRef = (0, import_react27.useRef)(list);
5074
5209
  listRef.current = list;
5075
- (0, import_react26.useEffect)(() => {
5210
+ (0, import_react27.useEffect)(() => {
5076
5211
  if (!active) return void 0;
5077
5212
  if (typeof window === "undefined") return void 0;
5078
5213
  if (window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches) {
@@ -5103,7 +5238,7 @@ function useTypewriter(phrases, { active = true } = {}) {
5103
5238
  }
5104
5239
 
5105
5240
  // src/components/Panel.jsx
5106
- var import_jsx_runtime25 = require("react/jsx-runtime");
5241
+ var import_jsx_runtime26 = require("react/jsx-runtime");
5107
5242
  function Panel(props) {
5108
5243
  const {
5109
5244
  title,
@@ -5125,43 +5260,43 @@ function Panel(props) {
5125
5260
  classNames = {},
5126
5261
  children
5127
5262
  } = props;
5128
- const body = loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uic-panel-load", children: [
5129
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uic-panel-load-bar" }),
5130
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uic-panel-load-bar" }),
5131
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uic-panel-load-bar" }),
5132
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "uic-sr", children: loadingLabel })
5133
- ] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uic-panel-fail", children: [
5134
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "uic-panel-fail-t", children: errorTitle }),
5135
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("pre", { className: "uic-panel-fail-m", children: error }),
5136
- errorDetail ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("details", { className: "uic-panel-fail-d", children: [
5137
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("summary", { children: detailLabel }),
5138
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uic-panel-fail-dd", children: errorDetail })
5263
+ const body = loading ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uic-panel-load", children: [
5264
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "uic-panel-load-bar" }),
5265
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "uic-panel-load-bar" }),
5266
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "uic-panel-load-bar" }),
5267
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "uic-sr", children: loadingLabel })
5268
+ ] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uic-panel-fail", children: [
5269
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "uic-panel-fail-t", children: errorTitle }),
5270
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("pre", { className: "uic-panel-fail-m", children: error }),
5271
+ errorDetail ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("details", { className: "uic-panel-fail-d", children: [
5272
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("summary", { children: detailLabel }),
5273
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uic-panel-fail-dd", children: errorDetail })
5139
5274
  ] }) : null,
5140
- onRetry ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uic-panel-fail-act", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "sm", onClick: onRetry, children: retryLabel }) }) : null
5275
+ onRetry ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uic-panel-fail-act", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { size: "sm", onClick: onRetry, children: retryLabel }) }) : null
5141
5276
  ] }) : children;
5142
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
5277
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
5143
5278
  "section",
5144
5279
  {
5145
5280
  className: ["uic-panel", className, classNames.root || ""].filter(Boolean).join(" "),
5146
5281
  "aria-busy": loading || busy || void 0,
5147
5282
  children: [
5148
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("header", { className: ["uic-panel-head", classNames.head || ""].filter(Boolean).join(" "), children: [
5149
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uic-panel-titles", children: [
5150
- title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Heading, { className: "uic-panel-title", children: title }) : null,
5151
- meta ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "uic-panel-meta", children: meta }) : null
5283
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("header", { className: ["uic-panel-head", classNames.head || ""].filter(Boolean).join(" "), children: [
5284
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "uic-panel-titles", children: [
5285
+ title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, { className: "uic-panel-title", children: title }) : null,
5286
+ meta ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "uic-panel-meta", children: meta }) : null
5152
5287
  ] }),
5153
- actions ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uic-panel-acts", children: actions }) : null
5288
+ actions ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uic-panel-acts", children: actions }) : null
5154
5289
  ] }),
5155
- busy ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uic-panel-busy", role: "status", "aria-label": busyLabel }) : null,
5156
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: ["uic-panel-body", classNames.body || ""].filter(Boolean).join(" "), children: body }),
5157
- footer ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("footer", { className: "uic-panel-foot", children: footer }) : null
5290
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uic-panel-busy", role: "status", "aria-label": busyLabel }) : null,
5291
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: ["uic-panel-body", classNames.body || ""].filter(Boolean).join(" "), children: body }),
5292
+ footer ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("footer", { className: "uic-panel-foot", children: footer }) : null
5158
5293
  ]
5159
5294
  }
5160
5295
  );
5161
5296
  }
5162
5297
 
5163
5298
  // src/grid/PanelGrid.jsx
5164
- var import_react27 = __toESM(require("react"), 1);
5299
+ var import_react28 = __toESM(require("react"), 1);
5165
5300
 
5166
5301
  // src/grid/layout.js
5167
5302
  function sortLayout(layout2) {
@@ -5234,11 +5369,11 @@ function sameLayout(a, b) {
5234
5369
  }
5235
5370
 
5236
5371
  // src/grid/PanelGrid.jsx
5237
- var import_jsx_runtime26 = require("react/jsx-runtime");
5372
+ var import_jsx_runtime27 = require("react/jsx-runtime");
5238
5373
  function useMeasuredWidth() {
5239
- const ref = (0, import_react27.useRef)(null);
5240
- const [width, setWidth] = (0, import_react27.useState)(0);
5241
- (0, import_react27.useLayoutEffect)(() => {
5374
+ const ref = (0, import_react28.useRef)(null);
5375
+ const [width, setWidth] = (0, import_react28.useState)(0);
5376
+ (0, import_react28.useLayoutEffect)(() => {
5242
5377
  const el = ref.current;
5243
5378
  if (!el) return void 0;
5244
5379
  const measure = () => setWidth(el.clientWidth);
@@ -5265,9 +5400,9 @@ function PanelGrid(props) {
5265
5400
  className = ""
5266
5401
  } = props;
5267
5402
  const [wrapRef, width] = useMeasuredWidth();
5268
- const [drag, setDrag] = (0, import_react27.useState)(null);
5269
- const dragRef = (0, import_react27.useRef)(null);
5270
- const swallowClick = (0, import_react27.useRef)(false);
5403
+ const [drag, setDrag] = (0, import_react28.useState)(null);
5404
+ const dragRef = (0, import_react28.useRef)(null);
5405
+ const swallowClick = (0, import_react28.useRef)(false);
5271
5406
  const stacked = width > 0 && width < stackAt;
5272
5407
  const arrangeable = editable && !stacked;
5273
5408
  const live = drag ? drag.preview : layout2;
@@ -5275,7 +5410,7 @@ function PanelGrid(props) {
5275
5410
  const cellW = colW + gap;
5276
5411
  const cellH = rowHeight + gap;
5277
5412
  const rowsToPx = (h) => h * rowHeight + (h - 1) * gap;
5278
- const stack2 = (0, import_react27.useMemo)(() => {
5413
+ const stack2 = (0, import_react28.useMemo)(() => {
5279
5414
  if (!stacked) return null;
5280
5415
  const tops = /* @__PURE__ */ new Map();
5281
5416
  let y = 0;
@@ -5287,11 +5422,11 @@ function PanelGrid(props) {
5287
5422
  }, [stacked, live, rowHeight, gap]);
5288
5423
  const rows = layoutRows(live);
5289
5424
  const height = stacked ? stack2.height : rows ? rowsToPx(rows) : 0;
5290
- const commit = (0, import_react27.useCallback)((next) => {
5425
+ const commit = (0, import_react28.useCallback)((next) => {
5291
5426
  if (onLayoutChange && !sameLayout(next, layout2)) onLayoutChange(next);
5292
5427
  }, [onLayoutChange, layout2]);
5293
- const detach = (0, import_react27.useRef)(null);
5294
- (0, import_react27.useEffect)(() => () => detach.current?.(), []);
5428
+ const detach = (0, import_react28.useRef)(null);
5429
+ (0, import_react28.useEffect)(() => () => detach.current?.(), []);
5295
5430
  const start = (id, mode) => (e) => {
5296
5431
  if (!arrangeable || e.button !== 0) return;
5297
5432
  const item = layout2.find((it) => it.i === id);
@@ -5356,7 +5491,7 @@ function PanelGrid(props) {
5356
5491
  const byId = new Map(live.map((it) => [it.i, it]));
5357
5492
  const ghost = drag && drag.mode === "move" && byId.has(drag.id) ? boxOf(byId.get(drag.id)) : null;
5358
5493
  const cls = ["uic-pg", arrangeable ? "is-editable" : "", stacked ? "is-stacked" : "", className].filter(Boolean).join(" ");
5359
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
5494
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5360
5495
  "div",
5361
5496
  {
5362
5497
  ref: wrapRef,
@@ -5367,15 +5502,15 @@ function PanelGrid(props) {
5367
5502
  swallowClick.current = false;
5368
5503
  },
5369
5504
  children: [
5370
- ghost ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "uic-pg-ghost", "aria-hidden": "true", style: ghost }) : null,
5371
- width > 0 && import_react27.default.Children.map(children, (child) => {
5372
- if (!import_react27.default.isValidElement(child) || child.key == null) return null;
5505
+ ghost ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "uic-pg-ghost", "aria-hidden": "true", style: ghost }) : null,
5506
+ width > 0 && import_react28.default.Children.map(children, (child) => {
5507
+ if (!import_react28.default.isValidElement(child) || child.key == null) return null;
5373
5508
  const id = String(child.key).replace(/^\.\$/, "");
5374
5509
  const it = byId.get(id);
5375
5510
  if (!it) return null;
5376
5511
  const moving = drag && drag.id === id;
5377
5512
  const offset = moving && drag.mode === "move" ? { transform: `translate(${drag.dx}px, ${drag.dy}px)` } : null;
5378
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
5513
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5379
5514
  "div",
5380
5515
  {
5381
5516
  className: "uic-pg-item" + (moving ? " is-moving" : ""),
@@ -5383,7 +5518,7 @@ function PanelGrid(props) {
5383
5518
  onPointerDown: arrangeable ? start(id, "move") : void 0,
5384
5519
  children: [
5385
5520
  child,
5386
- arrangeable && !it.static ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5521
+ arrangeable && !it.static ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5387
5522
  "button",
5388
5523
  {
5389
5524
  type: "button",
@@ -5391,7 +5526,7 @@ function PanelGrid(props) {
5391
5526
  "aria-label": resizeLabel ? resizeLabel(id) : "Resize panel. Arrow keys resize it; shift with arrow keys moves it past its neighbours.",
5392
5527
  onPointerDown: start(id, "resize"),
5393
5528
  onKeyDown: onHandleKey(id),
5394
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round" }) })
5529
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round" }) })
5395
5530
  }
5396
5531
  ) : null
5397
5532
  ]
@@ -5408,8 +5543,8 @@ function packLayout(layout2, cols = 12) {
5408
5543
  }
5409
5544
 
5410
5545
  // src/timeline/Timeline.jsx
5411
- var import_react28 = require("react");
5412
- var import_jsx_runtime27 = require("react/jsx-runtime");
5546
+ var import_react29 = require("react");
5547
+ var import_jsx_runtime28 = require("react/jsx-runtime");
5413
5548
  var TL_MIN_PPS = 4;
5414
5549
  var TL_MAX_PPS = 400;
5415
5550
  var TL_DEFAULT_PPS = 26;
@@ -5498,21 +5633,21 @@ function Timeline({
5498
5633
  emptyLabel = "Nothing here yet.",
5499
5634
  className = ""
5500
5635
  }) {
5501
- const scroller = (0, import_react28.useRef)(null);
5502
- const innerRef = (0, import_react28.useRef)(null);
5503
- const [pps, setPps] = (0, import_react28.useState)(() => {
5636
+ const scroller = (0, import_react29.useRef)(null);
5637
+ const innerRef = (0, import_react29.useRef)(null);
5638
+ const [pps, setPps] = (0, import_react29.useState)(() => {
5504
5639
  if (zoomStorageKey && typeof window !== "undefined") {
5505
5640
  const n = parseFloat(window.localStorage.getItem(zoomStorageKey) || "");
5506
5641
  if (Number.isFinite(n)) return clamp(n, TL_MIN_PPS, TL_MAX_PPS);
5507
5642
  }
5508
5643
  return TL_DEFAULT_PPS;
5509
5644
  });
5510
- const [snapping, setSnapping] = (0, import_react28.useState)(() => snapStorageKey && typeof window !== "undefined" ? window.localStorage.getItem(snapStorageKey) !== "0" : true);
5511
- const gesture = (0, import_react28.useRef)(null);
5512
- const [drag, setDrag] = (0, import_react28.useState)(null);
5513
- const anchor = (0, import_react28.useRef)(null);
5514
- const [dropAt, setDropAt] = (0, import_react28.useState)(null);
5515
- const rows = (0, import_react28.useMemo)(
5645
+ const [snapping, setSnapping] = (0, import_react29.useState)(() => snapStorageKey && typeof window !== "undefined" ? window.localStorage.getItem(snapStorageKey) !== "0" : true);
5646
+ const gesture = (0, import_react29.useRef)(null);
5647
+ const [drag, setDrag] = (0, import_react29.useState)(null);
5648
+ const anchor = (0, import_react29.useRef)(null);
5649
+ const [dropAt, setDropAt] = (0, import_react29.useState)(null);
5650
+ const rows = (0, import_react29.useMemo)(
5516
5651
  () => tracks.map((t) => ({
5517
5652
  ...t,
5518
5653
  sequential: t.sequential !== false,
@@ -5520,12 +5655,12 @@ function Timeline({
5520
5655
  })),
5521
5656
  [tracks, pps]
5522
5657
  );
5523
- const contentSeconds = (0, import_react28.useMemo)(() => {
5658
+ const contentSeconds = (0, import_react29.useMemo)(() => {
5524
5659
  let end = 0;
5525
5660
  for (const t of rows) for (const l of t.laid) end = Math.max(end, l.t0 + l.w / pps);
5526
5661
  return end;
5527
5662
  }, [rows, pps]);
5528
- const snapTimes = (0, import_react28.useMemo)(() => {
5663
+ const snapTimes = (0, import_react29.useMemo)(() => {
5529
5664
  const out = [0, currentTime];
5530
5665
  for (const t of rows) for (const l of t.laid) {
5531
5666
  out.push(l.t0);
@@ -5533,7 +5668,7 @@ function Timeline({
5533
5668
  }
5534
5669
  return out;
5535
5670
  }, [rows, pps, currentTime]);
5536
- const setZoom = (0, import_react28.useCallback)((next, clientX) => {
5671
+ const setZoom = (0, import_react29.useCallback)((next, clientX) => {
5537
5672
  const v = clamp(next, TL_MIN_PPS, TL_MAX_PPS);
5538
5673
  const el = scroller.current;
5539
5674
  if (el) {
@@ -5549,21 +5684,21 @@ function Timeline({
5549
5684
  }
5550
5685
  }
5551
5686
  }, [pps, zoomStorageKey]);
5552
- const fitPps = (0, import_react28.useCallback)((seconds) => {
5687
+ const fitPps = (0, import_react29.useCallback)((seconds) => {
5553
5688
  const el = scroller.current;
5554
5689
  if (!el || !(seconds > 0)) return null;
5555
5690
  const room = el.clientWidth - TL_HEAD_W - 56;
5556
5691
  return room > 0 ? clamp(room / seconds, TL_MIN_PPS, TL_MAX_PPS) : null;
5557
5692
  }, []);
5558
- const fit = (0, import_react28.useCallback)(() => {
5693
+ const fit = (0, import_react29.useCallback)(() => {
5559
5694
  const v = fitPps(contentSeconds);
5560
5695
  if (v !== null) {
5561
5696
  setPps(v);
5562
5697
  if (scroller.current) scroller.current.scrollLeft = 0;
5563
5698
  }
5564
5699
  }, [fitPps, contentSeconds]);
5565
- const fitted = (0, import_react28.useRef)(false);
5566
- (0, import_react28.useLayoutEffect)(() => {
5700
+ const fitted = (0, import_react29.useRef)(false);
5701
+ (0, import_react29.useLayoutEffect)(() => {
5567
5702
  if (fitted.current || !(contentSeconds > 0)) return;
5568
5703
  if (zoomStorageKey && typeof window !== "undefined" && window.localStorage.getItem(zoomStorageKey)) {
5569
5704
  fitted.current = true;
@@ -5575,13 +5710,13 @@ function Timeline({
5575
5710
  setPps(v);
5576
5711
  }
5577
5712
  }, [contentSeconds, fitPps, zoomStorageKey]);
5578
- (0, import_react28.useLayoutEffect)(() => {
5713
+ (0, import_react29.useLayoutEffect)(() => {
5579
5714
  const a = anchor.current;
5580
5715
  if (!a || !scroller.current) return;
5581
5716
  anchor.current = null;
5582
5717
  scroller.current.scrollLeft = Math.max(0, TL_HEAD_W + a.t * pps - a.vx);
5583
5718
  }, [pps]);
5584
- (0, import_react28.useEffect)(() => {
5719
+ (0, import_react29.useEffect)(() => {
5585
5720
  const el = scroller.current;
5586
5721
  if (!el) return void 0;
5587
5722
  const onWheel = (e) => {
@@ -5592,12 +5727,12 @@ function Timeline({
5592
5727
  el.addEventListener("wheel", onWheel, { passive: false });
5593
5728
  return () => el.removeEventListener("wheel", onWheel);
5594
5729
  }, [pps, setZoom]);
5595
- const timeAt = (0, import_react28.useCallback)((clientX) => {
5730
+ const timeAt = (0, import_react29.useCallback)((clientX) => {
5596
5731
  const el = innerRef.current;
5597
5732
  if (!el) return 0;
5598
5733
  return Math.max(0, (clientX - el.getBoundingClientRect().left - TL_HEAD_W) / pps);
5599
5734
  }, [pps]);
5600
- const beginGesture = (0, import_react28.useCallback)((e, spec) => {
5735
+ const beginGesture = (0, import_react29.useCallback)((e, spec) => {
5601
5736
  e.preventDefault();
5602
5737
  e.stopPropagation();
5603
5738
  gesture.current = { ...spec, startX: e.clientX, active: false, value: null };
@@ -5631,12 +5766,12 @@ function Timeline({
5631
5766
  window.addEventListener("pointermove", move);
5632
5767
  window.addEventListener("pointerup", up);
5633
5768
  }, [timeAt, snapping, snapTimes, pps, onSeek]);
5634
- const onScrub = (0, import_react28.useCallback)((e) => {
5769
+ const onScrub = (0, import_react29.useCallback)((e) => {
5635
5770
  if (!onSeek) return;
5636
5771
  onSeek(timeAt(e.clientX));
5637
5772
  beginGesture(e, { kind: "scrub" });
5638
5773
  }, [onSeek, timeAt, beginGesture]);
5639
- const splitTarget = (0, import_react28.useMemo)(() => {
5774
+ const splitTarget = (0, import_react29.useMemo)(() => {
5640
5775
  if (!onSplit) return null;
5641
5776
  for (const track of rows) {
5642
5777
  for (const l of track.laid) {
@@ -5648,17 +5783,17 @@ function Timeline({
5648
5783
  }
5649
5784
  return null;
5650
5785
  }, [rows, currentTime, onSplit]);
5651
- const doSplit = (0, import_react28.useCallback)(() => {
5786
+ const doSplit = (0, import_react29.useCallback)(() => {
5652
5787
  if (!splitTarget) return;
5653
5788
  onSplit(splitTarget.l.clip, currentTime - splitTarget.l.t0, splitTarget.track);
5654
5789
  }, [splitTarget, currentTime, onSplit]);
5655
- const selected = (0, import_react28.useMemo)(() => {
5790
+ const selected = (0, import_react29.useMemo)(() => {
5656
5791
  for (const track of rows) for (const l of track.laid) {
5657
5792
  if (l.clip.id === selectedClipId) return { track, l };
5658
5793
  }
5659
5794
  return null;
5660
5795
  }, [rows, selectedClipId]);
5661
- const onKeyDown = (0, import_react28.useCallback)((e) => {
5796
+ const onKeyDown = (0, import_react29.useCallback)((e) => {
5662
5797
  const tag = e.target?.tagName;
5663
5798
  if (tag === "INPUT" || tag === "TEXTAREA" || e.target?.isContentEditable) return;
5664
5799
  if (e.key === "+" || e.key === "=") {
@@ -5675,7 +5810,7 @@ function Timeline({
5675
5810
  onDeleteClip(selected.l.clip, selected.track);
5676
5811
  }
5677
5812
  }, [pps, setZoom, doSplit, selected, onDeleteClip]);
5678
- const toggleSnap = (0, import_react28.useCallback)(() => {
5813
+ const toggleSnap = (0, import_react29.useCallback)(() => {
5679
5814
  setSnapping((v) => {
5680
5815
  const next = !v;
5681
5816
  if (snapStorageKey && typeof window !== "undefined") {
@@ -5692,9 +5827,9 @@ function Timeline({
5692
5827
  const laneW = Math.max(contentSeconds * pps + 140, 320);
5693
5828
  const ticks = [];
5694
5829
  for (let t = 0; t <= contentSeconds + major; t += major) ticks.push(t);
5695
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: `rui-tl ${className}`, onKeyDown, tabIndex: 0, children: [
5696
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rui-tl-bar", children: [
5697
- onSplit && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5830
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: `rui-tl ${className}`, onKeyDown, tabIndex: 0, children: [
5831
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rui-tl-bar", children: [
5832
+ onSplit && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
5698
5833
  "button",
5699
5834
  {
5700
5835
  type: "button",
@@ -5703,7 +5838,7 @@ function Timeline({
5703
5838
  disabled: !splitTarget,
5704
5839
  title: splitTarget ? "Split at the playhead (B)" : "Move the playhead inside a clip to split it",
5705
5840
  children: [
5706
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5841
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
5707
5842
  "svg",
5708
5843
  {
5709
5844
  width: "13",
@@ -5715,19 +5850,19 @@ function Timeline({
5715
5850
  strokeLinecap: "round",
5716
5851
  "aria-hidden": "true",
5717
5852
  children: [
5718
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("circle", { cx: "6", cy: "6", r: "3" }),
5719
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("circle", { cx: "6", cy: "18", r: "3" }),
5720
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("line", { x1: "20", y1: "4", x2: "8.12", y2: "15.88" }),
5721
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("line", { x1: "14.47", y1: "14.48", x2: "20", y2: "20" }),
5722
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("line", { x1: "8.12", y1: "8.12", x2: "12", y2: "12" })
5853
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("circle", { cx: "6", cy: "6", r: "3" }),
5854
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("circle", { cx: "6", cy: "18", r: "3" }),
5855
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("line", { x1: "20", y1: "4", x2: "8.12", y2: "15.88" }),
5856
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("line", { x1: "14.47", y1: "14.48", x2: "20", y2: "20" }),
5857
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("line", { x1: "8.12", y1: "8.12", x2: "12", y2: "12" })
5723
5858
  ]
5724
5859
  }
5725
5860
  ),
5726
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Split" })
5861
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Split" })
5727
5862
  ]
5728
5863
  }
5729
5864
  ),
5730
- onDeleteClip && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5865
+ onDeleteClip && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5731
5866
  "button",
5732
5867
  {
5733
5868
  type: "button",
@@ -5738,7 +5873,7 @@ function Timeline({
5738
5873
  children: "Remove"
5739
5874
  }
5740
5875
  ),
5741
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5876
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5742
5877
  "button",
5743
5878
  {
5744
5879
  type: "button",
@@ -5749,9 +5884,9 @@ function Timeline({
5749
5884
  children: "Snap"
5750
5885
  }
5751
5886
  ),
5752
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-time", "aria-label": "Playhead position", children: exactLabel(currentTime) }),
5753
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-spacer" }),
5754
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5887
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-time", "aria-label": "Playhead position", children: exactLabel(currentTime) }),
5888
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-spacer" }),
5889
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5755
5890
  "button",
5756
5891
  {
5757
5892
  type: "button",
@@ -5763,7 +5898,7 @@ function Timeline({
5763
5898
  children: "\u2212"
5764
5899
  }
5765
5900
  ),
5766
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5901
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5767
5902
  "button",
5768
5903
  {
5769
5904
  type: "button",
@@ -5775,7 +5910,7 @@ function Timeline({
5775
5910
  children: "+"
5776
5911
  }
5777
5912
  ),
5778
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5913
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5779
5914
  "button",
5780
5915
  {
5781
5916
  type: "button",
@@ -5787,10 +5922,10 @@ function Timeline({
5787
5922
  }
5788
5923
  )
5789
5924
  ] }),
5790
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "rui-tl-scroll", ref: scroller, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rui-tl-inner", ref: innerRef, style: { width: TL_HEAD_W + laneW }, children: [
5791
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rui-tl-row rui-tl-rulerrow", children: [
5792
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "rui-tl-head rui-tl-rulerhead", "aria-hidden": "true" }),
5793
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5925
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "rui-tl-scroll", ref: scroller, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rui-tl-inner", ref: innerRef, style: { width: TL_HEAD_W + laneW }, children: [
5926
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rui-tl-row rui-tl-rulerrow", children: [
5927
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "rui-tl-head rui-tl-rulerhead", "aria-hidden": "true" }),
5928
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5794
5929
  "div",
5795
5930
  {
5796
5931
  className: "rui-tl-ruler",
@@ -5819,17 +5954,17 @@ function Timeline({
5819
5954
  onSeek(currentTime + step);
5820
5955
  }
5821
5956
  } : void 0,
5822
- children: ticks.map((t) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-ticklbl", style: { left: t * pps }, children: tickLabel(t, major) }, t))
5957
+ children: ticks.map((t) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-ticklbl", style: { left: t * pps }, children: tickLabel(t, major) }, t))
5823
5958
  }
5824
5959
  )
5825
5960
  ] }),
5826
- rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "rui-tl-empty", children: emptyLabel }),
5827
- rows.map((track) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rui-tl-row", children: [
5828
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rui-tl-head", title: track.title || track.label, children: [
5961
+ rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "rui-tl-empty", children: emptyLabel }),
5962
+ rows.map((track) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rui-tl-row", children: [
5963
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rui-tl-head", title: track.title || track.label, children: [
5829
5964
  track.icon,
5830
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-headlbl", children: track.label })
5965
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-headlbl", children: track.label })
5831
5966
  ] }),
5832
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5967
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
5833
5968
  "div",
5834
5969
  {
5835
5970
  className: "rui-tl-lane" + (dropAt?.trackId === track.id ? " is-dropping" : ""),
@@ -5860,8 +5995,8 @@ function Timeline({
5860
5995
  onDropClip(payload, { trackId: track.id, seconds: t, index });
5861
5996
  } : void 0,
5862
5997
  children: [
5863
- track.laid.length === 0 && track.emptyLabel && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "rui-tl-laneempty", children: track.emptyLabel }),
5864
- track.laid.map((l) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5998
+ track.laid.length === 0 && track.emptyLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "rui-tl-laneempty", children: track.emptyLabel }),
5999
+ track.laid.map((l) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5865
6000
  Clip,
5866
6001
  {
5867
6002
  l,
@@ -5877,7 +6012,7 @@ function Timeline({
5877
6012
  },
5878
6013
  l.clip.id ?? l.i
5879
6014
  )),
5880
- dropAt?.trackId === track.id && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6015
+ dropAt?.trackId === track.id && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5881
6016
  "span",
5882
6017
  {
5883
6018
  className: "rui-tl-dropmark",
@@ -5885,7 +6020,7 @@ function Timeline({
5885
6020
  "aria-hidden": "true"
5886
6021
  }
5887
6022
  ),
5888
- laneAppend && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6023
+ laneAppend && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5889
6024
  "span",
5890
6025
  {
5891
6026
  className: "rui-tl-append",
@@ -5897,9 +6032,9 @@ function Timeline({
5897
6032
  }
5898
6033
  )
5899
6034
  ] }, track.id)),
5900
- onDropClip && newLaneLabel && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "rui-tl-row", children: [
5901
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "rui-tl-head rui-tl-newhead", "aria-hidden": "true" }),
5902
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6035
+ onDropClip && newLaneLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "rui-tl-row", children: [
6036
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "rui-tl-head rui-tl-newhead", "aria-hidden": "true" }),
6037
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5903
6038
  "div",
5904
6039
  {
5905
6040
  className: "rui-tl-newlane" + (dropAt?.trackId === null ? " is-dropping" : ""),
@@ -5921,11 +6056,11 @@ function Timeline({
5921
6056
  e.preventDefault();
5922
6057
  onDropClip(payload, { trackId: null, seconds: timeAt(e.clientX), index: 0 });
5923
6058
  },
5924
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-newlbl", children: newLaneLabel })
6059
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-newlbl", children: newLaneLabel })
5925
6060
  }
5926
6061
  )
5927
6062
  ] }),
5928
- drag?.guide != null && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6063
+ drag?.guide != null && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5929
6064
  "div",
5930
6065
  {
5931
6066
  className: "rui-tl-guide",
@@ -5933,16 +6068,16 @@ function Timeline({
5933
6068
  "aria-hidden": "true"
5934
6069
  }
5935
6070
  ),
5936
- Number.isFinite(currentTime) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6071
+ Number.isFinite(currentTime) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5937
6072
  "div",
5938
6073
  {
5939
6074
  className: "rui-tl-playhead",
5940
6075
  style: { left: TL_HEAD_W + currentTime * pps },
5941
6076
  "aria-hidden": "true",
5942
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-playhead-grip" })
6077
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-playhead-grip" })
5943
6078
  }
5944
6079
  ),
5945
- drag?.annotation && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "rui-tl-annot", style: { left: TL_HEAD_W + (drag.annotAt || 0) * pps }, children: drag.annotation })
6080
+ drag?.annotation && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "rui-tl-annot", style: { left: TL_HEAD_W + (drag.annotAt || 0) * pps }, children: drag.annotation })
5946
6081
  ] }) })
5947
6082
  ] });
5948
6083
  }
@@ -6018,7 +6153,7 @@ function Clip({
6018
6153
  click: onSelect
6019
6154
  });
6020
6155
  };
6021
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
6156
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
6022
6157
  "article",
6023
6158
  {
6024
6159
  className: "rui-tl-clip" + (clip.state ? ` is-${clip.state}` : "") + (known ? "" : " is-unmeasured") + (selected ? " is-selected" : "") + (live ? " is-live" : ""),
@@ -6033,10 +6168,10 @@ function Clip({
6033
6168
  }
6034
6169
  },
6035
6170
  children: [
6036
- clip.poster ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-strip", style: {
6171
+ clip.poster ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-strip", style: {
6037
6172
  backgroundImage: `url("${String(clip.poster).replace(/"/g, '\\"')}")`,
6038
6173
  backgroundSize: `${tileW}px 100%`
6039
- } }) : clip.video ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6174
+ } }) : clip.video ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
6040
6175
  "video",
6041
6176
  {
6042
6177
  className: "rui-tl-frame",
@@ -6047,12 +6182,12 @@ function Clip({
6047
6182
  tabIndex: -1,
6048
6183
  "aria-hidden": "true"
6049
6184
  }
6050
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-blank", "aria-hidden": "true", children: clip.glyph }),
6051
- clip.badge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-badge", children: clip.badge }),
6052
- known && width > 46 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-dur", children: durationLabel(clip.duration) }),
6053
- clip.label && width > 104 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rui-tl-name", children: clip.label }),
6054
- onTrim && known && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
6055
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6185
+ ) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-blank", "aria-hidden": "true", children: clip.glyph }),
6186
+ clip.badge && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-badge", children: clip.badge }),
6187
+ known && width > 46 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-dur", children: durationLabel(clip.duration) }),
6188
+ clip.label && width > 104 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rui-tl-name", children: clip.label }),
6189
+ onTrim && known && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
6190
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
6056
6191
  "span",
6057
6192
  {
6058
6193
  className: "rui-tl-trim l",
@@ -6061,7 +6196,7 @@ function Clip({
6061
6196
  "aria-label": `Trim the start of ${clip.label || "this clip"}`
6062
6197
  }
6063
6198
  ),
6064
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6199
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
6065
6200
  "span",
6066
6201
  {
6067
6202
  className: "rui-tl-trim r",