import { s as __toESM } from "./chunk-BNovOVIE.js";
import { t as require_react } from "./react-DA-nE2FX.js";
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
import { t as clsx } from "./clsx-CyyyQ8Ue.js";
import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
const Functions = {
  NOOP: () => {
  },
  ASYNC_NOOP: async () => {
  },
  THROW: () => {
    throw Error("Should not be called");
  },
  asUpdater: (e2) => typeof e2 == "function" ? e2 : () => e2,
  identity: (e2) => e2
};
function throwNotImplemented() {
  throw Error("Not implemented");
}
var createNamespacedLogger = (e2, _) => {
  let v = `[${e2}]`;
  return {
    debug: (...e3) => console.debug(v, ...e3),
    log: (...e3) => _.log(v, ...e3),
    warn: (...e3) => _.warn(v, ...e3),
    error: (...e3) => _.error(v, ...e3),
    trace: (...e3) => _.trace(v, ...e3),
    get: (v2) => createNamespacedLogger(`${e2}:${v2}`, _),
    disabled: (e3 = true) => e3 ? DisabledLogger : _
  };
}, ConsoleLogger = {
  debug: (...e2) => {
    console.debug(...e2);
  },
  log: (...e2) => {
    console.log(...e2);
  },
  warn: (...e2) => {
    console.warn(...e2);
  },
  error: (...e2) => {
    console.error(...e2);
  },
  trace: (...e2) => {
    console.trace(...e2);
  },
  get: (e2) => createNamespacedLogger(`marimo:${e2}`, ConsoleLogger),
  disabled: (e2 = true) => e2 ? DisabledLogger : ConsoleLogger
}, DisabledLogger = {
  debug: () => Functions.NOOP,
  log: () => Functions.NOOP,
  warn: () => Functions.NOOP,
  error: () => Functions.NOOP,
  trace: () => Functions.NOOP,
  get: () => DisabledLogger,
  disabled: () => DisabledLogger
};
function getLogger() {
  return typeof window < "u" && window.Logger || ConsoleLogger;
}
const Logger = getLogger();
var CLASS_PART_SEPARATOR = "-", createClassGroupUtils = (e2) => {
  let _ = createClassMap(e2), { conflictingClassGroups: v, conflictingClassGroupModifiers: y } = e2;
  return {
    getClassGroupId: (e3) => {
      let v2 = e3.split(CLASS_PART_SEPARATOR);
      return v2[0] === "" && v2.length !== 1 && v2.shift(), getGroupRecursive(v2, _) || getGroupIdForArbitraryProperty(e3);
    },
    getConflictingClassGroupIds: (e3, _2) => {
      let b = v[e3] || [];
      return _2 && y[e3] ? [...b, ...y[e3]] : b;
    }
  };
}, getGroupRecursive = (e2, _) => {
  var _a;
  if (e2.length === 0) return _.classGroupId;
  let v = e2[0], y = _.nextPart.get(v), b = y ? getGroupRecursive(e2.slice(1), y) : void 0;
  if (b) return b;
  if (_.validators.length === 0) return;
  let x = e2.join(CLASS_PART_SEPARATOR);
  return (_a = _.validators.find(({ validator: e3 }) => e3(x))) == null ? void 0 : _a.classGroupId;
}, arbitraryPropertyRegex = /^\[(.+)\]$/, getGroupIdForArbitraryProperty = (e2) => {
  if (arbitraryPropertyRegex.test(e2)) {
    let _ = arbitraryPropertyRegex.exec(e2)[1], v = _ == null ? void 0 : _.substring(0, _.indexOf(":"));
    if (v) return "arbitrary.." + v;
  }
}, createClassMap = (e2) => {
  let { theme: _, prefix: v } = e2, y = {
    nextPart: /* @__PURE__ */ new Map(),
    validators: []
  };
  return getPrefixedClassGroupEntries(Object.entries(e2.classGroups), v).forEach(([e3, v2]) => {
    processClassesRecursively(v2, y, e3, _);
  }), y;
}, processClassesRecursively = (e2, _, v, y) => {
  e2.forEach((e3) => {
    if (typeof e3 == "string") {
      let y2 = e3 === "" ? _ : getPart(_, e3);
      y2.classGroupId = v;
      return;
    }
    if (typeof e3 == "function") {
      if (isThemeGetter(e3)) {
        processClassesRecursively(e3(y), _, v, y);
        return;
      }
      _.validators.push({
        validator: e3,
        classGroupId: v
      });
      return;
    }
    Object.entries(e3).forEach(([e4, b]) => {
      processClassesRecursively(b, getPart(_, e4), v, y);
    });
  });
}, getPart = (e2, _) => {
  let v = e2;
  return _.split(CLASS_PART_SEPARATOR).forEach((e3) => {
    v.nextPart.has(e3) || v.nextPart.set(e3, {
      nextPart: /* @__PURE__ */ new Map(),
      validators: []
    }), v = v.nextPart.get(e3);
  }), v;
}, isThemeGetter = (e2) => e2.isThemeGetter, getPrefixedClassGroupEntries = (e2, _) => _ ? e2.map(([e3, v]) => [e3, v.map((e4) => typeof e4 == "string" ? _ + e4 : typeof e4 == "object" ? Object.fromEntries(Object.entries(e4).map(([e5, v2]) => [_ + e5, v2])) : e4)]) : e2, createLruCache = (e2) => {
  if (e2 < 1) return {
    get: () => void 0,
    set: () => {
    }
  };
  let _ = 0, v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), b = (b2, x) => {
    v.set(b2, x), _++, _ > e2 && (_ = 0, y = v, v = /* @__PURE__ */ new Map());
  };
  return {
    get(e3) {
      let _2 = v.get(e3);
      if (_2 !== void 0) return _2;
      if ((_2 = y.get(e3)) !== void 0) return b(e3, _2), _2;
    },
    set(e3, _2) {
      v.has(e3) ? v.set(e3, _2) : b(e3, _2);
    }
  };
}, IMPORTANT_MODIFIER = "!", createParseClassName = (e2) => {
  let { separator: _, experimentalParseClassName: v } = e2, y = _.length === 1, b = _[0], x = _.length, S = (e3) => {
    let v2 = [], S2 = 0, C = 0, w;
    for (let T2 = 0; T2 < e3.length; T2++) {
      let E2 = e3[T2];
      if (S2 === 0) {
        if (E2 === b && (y || e3.slice(T2, T2 + x) === _)) {
          v2.push(e3.slice(C, T2)), C = T2 + x;
          continue;
        }
        if (E2 === "/") {
          w = T2;
          continue;
        }
      }
      E2 === "[" ? S2++ : E2 === "]" && S2--;
    }
    let T = v2.length === 0 ? e3 : e3.substring(C), E = T.startsWith(IMPORTANT_MODIFIER);
    return {
      modifiers: v2,
      hasImportantModifier: E,
      baseClassName: E ? T.substring(1) : T,
      maybePostfixModifierPosition: w && w > C ? w - C : void 0
    };
  };
  return v ? (e3) => v({
    className: e3,
    parseClassName: S
  }) : S;
}, sortModifiers = (e2) => {
  if (e2.length <= 1) return e2;
  let _ = [], v = [];
  return e2.forEach((e3) => {
    e3[0] === "[" ? (_.push(...v.sort(), e3), v = []) : v.push(e3);
  }), _.push(...v.sort()), _;
}, createConfigUtils = (e2) => ({
  cache: createLruCache(e2.cacheSize),
  parseClassName: createParseClassName(e2),
  ...createClassGroupUtils(e2)
}), SPLIT_CLASSES_REGEX = /\s+/, mergeClassList = (e2, _) => {
  let { parseClassName: v, getClassGroupId: y, getConflictingClassGroupIds: b } = _, x = [], S = e2.trim().split(SPLIT_CLASSES_REGEX), C = "";
  for (let e3 = S.length - 1; e3 >= 0; --e3) {
    let _2 = S[e3], { modifiers: w, hasImportantModifier: T, baseClassName: E, maybePostfixModifierPosition: D } = v(_2), O = !!D, k = y(O ? E.substring(0, D) : E);
    if (!k) {
      if (!O) {
        C = _2 + (C.length > 0 ? " " + C : C);
        continue;
      }
      if (k = y(E), !k) {
        C = _2 + (C.length > 0 ? " " + C : C);
        continue;
      }
      O = false;
    }
    let A = sortModifiers(w).join(":"), j = T ? A + IMPORTANT_MODIFIER : A, M = j + k;
    if (x.includes(M)) continue;
    x.push(M);
    let N = b(k, O);
    for (let e4 = 0; e4 < N.length; ++e4) {
      let _3 = N[e4];
      x.push(j + _3);
    }
    C = _2 + (C.length > 0 ? " " + C : C);
  }
  return C;
};
function twJoin() {
  let e2 = 0, _, v, y = "";
  for (; e2 < arguments.length; ) (_ = arguments[e2++]) && (v = toValue(_)) && (y && (y += " "), y += v);
  return y;
}
var toValue = (e2) => {
  if (typeof e2 == "string") return e2;
  let _, v = "";
  for (let y = 0; y < e2.length; y++) e2[y] && (_ = toValue(e2[y])) && (v && (v += " "), v += _);
  return v;
};
function createTailwindMerge(e2, ..._) {
  let v, y, b, x = S;
  function S(S2) {
    return v = createConfigUtils(_.reduce((e3, _2) => _2(e3), e2())), y = v.cache.get, b = v.cache.set, x = C, C(S2);
  }
  function C(e3) {
    let _2 = y(e3);
    if (_2) return _2;
    let x2 = mergeClassList(e3, v);
    return b(e3, x2), x2;
  }
  return function() {
    return x(twJoin.apply(null, arguments));
  };
}
var fromTheme = (e2) => {
  let _ = (_2) => _2[e2] || [];
  return _.isThemeGetter = true, _;
}, arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i, fractionRegex = /^\d+\/\d+$/, stringLengths = /* @__PURE__ */ new Set([
  "px",
  "full",
  "screen"
]), tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, isLength = (e2) => isNumber(e2) || stringLengths.has(e2) || fractionRegex.test(e2), isArbitraryLength = (e2) => getIsArbitraryValue(e2, "length", isLengthOnly), isNumber = (e2) => !!e2 && !Number.isNaN(Number(e2)), isArbitraryNumber = (e2) => getIsArbitraryValue(e2, "number", isNumber), isInteger = (e2) => !!e2 && Number.isInteger(Number(e2)), isPercent = (e2) => e2.endsWith("%") && isNumber(e2.slice(0, -1)), isArbitraryValue = (e2) => arbitraryValueRegex.test(e2), isTshirtSize = (e2) => tshirtUnitRegex.test(e2), sizeLabels = /* @__PURE__ */ new Set([
  "length",
  "size",
  "percentage"
]), isArbitrarySize = (e2) => getIsArbitraryValue(e2, sizeLabels, isNever), isArbitraryPosition = (e2) => getIsArbitraryValue(e2, "position", isNever), imageLabels = /* @__PURE__ */ new Set(["image", "url"]), isArbitraryImage = (e2) => getIsArbitraryValue(e2, imageLabels, isImage), isArbitraryShadow = (e2) => getIsArbitraryValue(e2, "", isShadow), isAny = () => true, getIsArbitraryValue = (e2, _, v) => {
  let y = arbitraryValueRegex.exec(e2);
  return y ? y[1] ? typeof _ == "string" ? y[1] === _ : _.has(y[1]) : v(y[2]) : false;
}, isLengthOnly = (e2) => lengthUnitRegex.test(e2) && !colorFunctionRegex.test(e2), isNever = () => false, isShadow = (e2) => shadowRegex.test(e2), isImage = (e2) => imageRegex.test(e2), twMerge = /* @__PURE__ */ createTailwindMerge(() => {
  let e2 = fromTheme("colors"), _ = fromTheme("spacing"), v = fromTheme("blur"), y = fromTheme("brightness"), b = fromTheme("borderColor"), x = fromTheme("borderRadius"), S = fromTheme("borderSpacing"), C = fromTheme("borderWidth"), w = fromTheme("contrast"), T = fromTheme("grayscale"), E = fromTheme("hueRotate"), D = fromTheme("invert"), O = fromTheme("gap"), k = fromTheme("gradientColorStops"), A = fromTheme("gradientColorStopPositions"), j = fromTheme("inset"), M = fromTheme("margin"), N = fromTheme("opacity"), P = fromTheme("padding"), F = fromTheme("saturate"), I = fromTheme("scale"), L = fromTheme("sepia"), R = fromTheme("skew"), z = fromTheme("space"), B = fromTheme("translate"), V = () => [
    "auto",
    "contain",
    "none"
  ], H = () => [
    "auto",
    "hidden",
    "clip",
    "visible",
    "scroll"
  ], U = () => [
    "auto",
    isArbitraryValue,
    _
  ], W = () => [isArbitraryValue, _], G = () => [
    "",
    isLength,
    isArbitraryLength
  ], K = () => [
    "auto",
    isNumber,
    isArbitraryValue
  ], q = () => [
    "bottom",
    "center",
    "left",
    "left-bottom",
    "left-top",
    "right",
    "right-bottom",
    "right-top",
    "top"
  ], J = () => [
    "solid",
    "dashed",
    "dotted",
    "double",
    "none"
  ], Y = () => [
    "normal",
    "multiply",
    "screen",
    "overlay",
    "darken",
    "lighten",
    "color-dodge",
    "color-burn",
    "hard-light",
    "soft-light",
    "difference",
    "exclusion",
    "hue",
    "saturation",
    "color",
    "luminosity"
  ], X = () => [
    "start",
    "end",
    "center",
    "between",
    "around",
    "evenly",
    "stretch"
  ], Z = () => [
    "",
    "0",
    isArbitraryValue
  ], Q = () => [
    "auto",
    "avoid",
    "all",
    "avoid-page",
    "page",
    "left",
    "right",
    "column"
  ], $ = () => [isNumber, isArbitraryValue];
  return {
    cacheSize: 500,
    separator: ":",
    theme: {
      colors: [isAny],
      spacing: [isLength, isArbitraryLength],
      blur: [
        "none",
        "",
        isTshirtSize,
        isArbitraryValue
      ],
      brightness: $(),
      borderColor: [e2],
      borderRadius: [
        "none",
        "",
        "full",
        isTshirtSize,
        isArbitraryValue
      ],
      borderSpacing: W(),
      borderWidth: G(),
      contrast: $(),
      grayscale: Z(),
      hueRotate: $(),
      invert: Z(),
      gap: W(),
      gradientColorStops: [e2],
      gradientColorStopPositions: [isPercent, isArbitraryLength],
      inset: U(),
      margin: U(),
      opacity: $(),
      padding: W(),
      saturate: $(),
      scale: $(),
      sepia: Z(),
      skew: $(),
      space: W(),
      translate: W()
    },
    classGroups: {
      aspect: [{ aspect: [
        "auto",
        "square",
        "video",
        isArbitraryValue
      ] }],
      container: ["container"],
      columns: [{ columns: [isTshirtSize] }],
      "break-after": [{ "break-after": Q() }],
      "break-before": [{ "break-before": Q() }],
      "break-inside": [{ "break-inside": [
        "auto",
        "avoid",
        "avoid-page",
        "avoid-column"
      ] }],
      "box-decoration": [{ "box-decoration": ["slice", "clone"] }],
      box: [{ box: ["border", "content"] }],
      display: [
        "block",
        "inline-block",
        "inline",
        "flex",
        "inline-flex",
        "table",
        "inline-table",
        "table-caption",
        "table-cell",
        "table-column",
        "table-column-group",
        "table-footer-group",
        "table-header-group",
        "table-row-group",
        "table-row",
        "flow-root",
        "grid",
        "inline-grid",
        "contents",
        "list-item",
        "hidden"
      ],
      float: [{ float: [
        "right",
        "left",
        "none",
        "start",
        "end"
      ] }],
      clear: [{ clear: [
        "left",
        "right",
        "both",
        "none",
        "start",
        "end"
      ] }],
      isolation: ["isolate", "isolation-auto"],
      "object-fit": [{ object: [
        "contain",
        "cover",
        "fill",
        "none",
        "scale-down"
      ] }],
      "object-position": [{ object: [...q(), isArbitraryValue] }],
      overflow: [{ overflow: H() }],
      "overflow-x": [{ "overflow-x": H() }],
      "overflow-y": [{ "overflow-y": H() }],
      overscroll: [{ overscroll: V() }],
      "overscroll-x": [{ "overscroll-x": V() }],
      "overscroll-y": [{ "overscroll-y": V() }],
      position: [
        "static",
        "fixed",
        "absolute",
        "relative",
        "sticky"
      ],
      inset: [{ inset: [j] }],
      "inset-x": [{ "inset-x": [j] }],
      "inset-y": [{ "inset-y": [j] }],
      start: [{ start: [j] }],
      end: [{ end: [j] }],
      top: [{ top: [j] }],
      right: [{ right: [j] }],
      bottom: [{ bottom: [j] }],
      left: [{ left: [j] }],
      visibility: [
        "visible",
        "invisible",
        "collapse"
      ],
      z: [{ z: [
        "auto",
        isInteger,
        isArbitraryValue
      ] }],
      basis: [{ basis: U() }],
      "flex-direction": [{ flex: [
        "row",
        "row-reverse",
        "col",
        "col-reverse"
      ] }],
      "flex-wrap": [{ flex: [
        "wrap",
        "wrap-reverse",
        "nowrap"
      ] }],
      flex: [{ flex: [
        "1",
        "auto",
        "initial",
        "none",
        isArbitraryValue
      ] }],
      grow: [{ grow: Z() }],
      shrink: [{ shrink: Z() }],
      order: [{ order: [
        "first",
        "last",
        "none",
        isInteger,
        isArbitraryValue
      ] }],
      "grid-cols": [{ "grid-cols": [isAny] }],
      "col-start-end": [{ col: [
        "auto",
        { span: [
          "full",
          isInteger,
          isArbitraryValue
        ] },
        isArbitraryValue
      ] }],
      "col-start": [{ "col-start": K() }],
      "col-end": [{ "col-end": K() }],
      "grid-rows": [{ "grid-rows": [isAny] }],
      "row-start-end": [{ row: [
        "auto",
        { span: [isInteger, isArbitraryValue] },
        isArbitraryValue
      ] }],
      "row-start": [{ "row-start": K() }],
      "row-end": [{ "row-end": K() }],
      "grid-flow": [{ "grid-flow": [
        "row",
        "col",
        "dense",
        "row-dense",
        "col-dense"
      ] }],
      "auto-cols": [{ "auto-cols": [
        "auto",
        "min",
        "max",
        "fr",
        isArbitraryValue
      ] }],
      "auto-rows": [{ "auto-rows": [
        "auto",
        "min",
        "max",
        "fr",
        isArbitraryValue
      ] }],
      gap: [{ gap: [O] }],
      "gap-x": [{ "gap-x": [O] }],
      "gap-y": [{ "gap-y": [O] }],
      "justify-content": [{ justify: ["normal", ...X()] }],
      "justify-items": [{ "justify-items": [
        "start",
        "end",
        "center",
        "stretch"
      ] }],
      "justify-self": [{ "justify-self": [
        "auto",
        "start",
        "end",
        "center",
        "stretch"
      ] }],
      "align-content": [{ content: [
        "normal",
        ...X(),
        "baseline"
      ] }],
      "align-items": [{ items: [
        "start",
        "end",
        "center",
        "baseline",
        "stretch"
      ] }],
      "align-self": [{ self: [
        "auto",
        "start",
        "end",
        "center",
        "stretch",
        "baseline"
      ] }],
      "place-content": [{ "place-content": [...X(), "baseline"] }],
      "place-items": [{ "place-items": [
        "start",
        "end",
        "center",
        "baseline",
        "stretch"
      ] }],
      "place-self": [{ "place-self": [
        "auto",
        "start",
        "end",
        "center",
        "stretch"
      ] }],
      p: [{ p: [P] }],
      px: [{ px: [P] }],
      py: [{ py: [P] }],
      ps: [{ ps: [P] }],
      pe: [{ pe: [P] }],
      pt: [{ pt: [P] }],
      pr: [{ pr: [P] }],
      pb: [{ pb: [P] }],
      pl: [{ pl: [P] }],
      m: [{ m: [M] }],
      mx: [{ mx: [M] }],
      my: [{ my: [M] }],
      ms: [{ ms: [M] }],
      me: [{ me: [M] }],
      mt: [{ mt: [M] }],
      mr: [{ mr: [M] }],
      mb: [{ mb: [M] }],
      ml: [{ ml: [M] }],
      "space-x": [{ "space-x": [z] }],
      "space-x-reverse": ["space-x-reverse"],
      "space-y": [{ "space-y": [z] }],
      "space-y-reverse": ["space-y-reverse"],
      w: [{ w: [
        "auto",
        "min",
        "max",
        "fit",
        "svw",
        "lvw",
        "dvw",
        isArbitraryValue,
        _
      ] }],
      "min-w": [{ "min-w": [
        isArbitraryValue,
        _,
        "min",
        "max",
        "fit"
      ] }],
      "max-w": [{ "max-w": [
        isArbitraryValue,
        _,
        "none",
        "full",
        "min",
        "max",
        "fit",
        "prose",
        { screen: [isTshirtSize] },
        isTshirtSize
      ] }],
      h: [{ h: [
        isArbitraryValue,
        _,
        "auto",
        "min",
        "max",
        "fit",
        "svh",
        "lvh",
        "dvh"
      ] }],
      "min-h": [{ "min-h": [
        isArbitraryValue,
        _,
        "min",
        "max",
        "fit",
        "svh",
        "lvh",
        "dvh"
      ] }],
      "max-h": [{ "max-h": [
        isArbitraryValue,
        _,
        "min",
        "max",
        "fit",
        "svh",
        "lvh",
        "dvh"
      ] }],
      size: [{ size: [
        isArbitraryValue,
        _,
        "auto",
        "min",
        "max",
        "fit"
      ] }],
      "font-size": [{ text: [
        "base",
        isTshirtSize,
        isArbitraryLength
      ] }],
      "font-smoothing": ["antialiased", "subpixel-antialiased"],
      "font-style": ["italic", "not-italic"],
      "font-weight": [{ font: [
        "thin",
        "extralight",
        "light",
        "normal",
        "medium",
        "semibold",
        "bold",
        "extrabold",
        "black",
        isArbitraryNumber
      ] }],
      "font-family": [{ font: [isAny] }],
      "fvn-normal": ["normal-nums"],
      "fvn-ordinal": ["ordinal"],
      "fvn-slashed-zero": ["slashed-zero"],
      "fvn-figure": ["lining-nums", "oldstyle-nums"],
      "fvn-spacing": ["proportional-nums", "tabular-nums"],
      "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
      tracking: [{ tracking: [
        "tighter",
        "tight",
        "normal",
        "wide",
        "wider",
        "widest",
        isArbitraryValue
      ] }],
      "line-clamp": [{ "line-clamp": [
        "none",
        isNumber,
        isArbitraryNumber
      ] }],
      leading: [{ leading: [
        "none",
        "tight",
        "snug",
        "normal",
        "relaxed",
        "loose",
        isLength,
        isArbitraryValue
      ] }],
      "list-image": [{ "list-image": ["none", isArbitraryValue] }],
      "list-style-type": [{ list: [
        "none",
        "disc",
        "decimal",
        isArbitraryValue
      ] }],
      "list-style-position": [{ list: ["inside", "outside"] }],
      "placeholder-color": [{ placeholder: [e2] }],
      "placeholder-opacity": [{ "placeholder-opacity": [N] }],
      "text-alignment": [{ text: [
        "left",
        "center",
        "right",
        "justify",
        "start",
        "end"
      ] }],
      "text-color": [{ text: [e2] }],
      "text-opacity": [{ "text-opacity": [N] }],
      "text-decoration": [
        "underline",
        "overline",
        "line-through",
        "no-underline"
      ],
      "text-decoration-style": [{ decoration: [...J(), "wavy"] }],
      "text-decoration-thickness": [{ decoration: [
        "auto",
        "from-font",
        isLength,
        isArbitraryLength
      ] }],
      "underline-offset": [{ "underline-offset": [
        "auto",
        isLength,
        isArbitraryValue
      ] }],
      "text-decoration-color": [{ decoration: [e2] }],
      "text-transform": [
        "uppercase",
        "lowercase",
        "capitalize",
        "normal-case"
      ],
      "text-overflow": [
        "truncate",
        "text-ellipsis",
        "text-clip"
      ],
      "text-wrap": [{ text: [
        "wrap",
        "nowrap",
        "balance",
        "pretty"
      ] }],
      indent: [{ indent: W() }],
      "vertical-align": [{ align: [
        "baseline",
        "top",
        "middle",
        "bottom",
        "text-top",
        "text-bottom",
        "sub",
        "super",
        isArbitraryValue
      ] }],
      whitespace: [{ whitespace: [
        "normal",
        "nowrap",
        "pre",
        "pre-line",
        "pre-wrap",
        "break-spaces"
      ] }],
      break: [{ break: [
        "normal",
        "words",
        "all",
        "keep"
      ] }],
      hyphens: [{ hyphens: [
        "none",
        "manual",
        "auto"
      ] }],
      content: [{ content: ["none", isArbitraryValue] }],
      "bg-attachment": [{ bg: [
        "fixed",
        "local",
        "scroll"
      ] }],
      "bg-clip": [{ "bg-clip": [
        "border",
        "padding",
        "content",
        "text"
      ] }],
      "bg-opacity": [{ "bg-opacity": [N] }],
      "bg-origin": [{ "bg-origin": [
        "border",
        "padding",
        "content"
      ] }],
      "bg-position": [{ bg: [...q(), isArbitraryPosition] }],
      "bg-repeat": [{ bg: ["no-repeat", { repeat: [
        "",
        "x",
        "y",
        "round",
        "space"
      ] }] }],
      "bg-size": [{ bg: [
        "auto",
        "cover",
        "contain",
        isArbitrarySize
      ] }],
      "bg-image": [{ bg: [
        "none",
        { "gradient-to": [
          "t",
          "tr",
          "r",
          "br",
          "b",
          "bl",
          "l",
          "tl"
        ] },
        isArbitraryImage
      ] }],
      "bg-color": [{ bg: [e2] }],
      "gradient-from-pos": [{ from: [A] }],
      "gradient-via-pos": [{ via: [A] }],
      "gradient-to-pos": [{ to: [A] }],
      "gradient-from": [{ from: [k] }],
      "gradient-via": [{ via: [k] }],
      "gradient-to": [{ to: [k] }],
      rounded: [{ rounded: [x] }],
      "rounded-s": [{ "rounded-s": [x] }],
      "rounded-e": [{ "rounded-e": [x] }],
      "rounded-t": [{ "rounded-t": [x] }],
      "rounded-r": [{ "rounded-r": [x] }],
      "rounded-b": [{ "rounded-b": [x] }],
      "rounded-l": [{ "rounded-l": [x] }],
      "rounded-ss": [{ "rounded-ss": [x] }],
      "rounded-se": [{ "rounded-se": [x] }],
      "rounded-ee": [{ "rounded-ee": [x] }],
      "rounded-es": [{ "rounded-es": [x] }],
      "rounded-tl": [{ "rounded-tl": [x] }],
      "rounded-tr": [{ "rounded-tr": [x] }],
      "rounded-br": [{ "rounded-br": [x] }],
      "rounded-bl": [{ "rounded-bl": [x] }],
      "border-w": [{ border: [C] }],
      "border-w-x": [{ "border-x": [C] }],
      "border-w-y": [{ "border-y": [C] }],
      "border-w-s": [{ "border-s": [C] }],
      "border-w-e": [{ "border-e": [C] }],
      "border-w-t": [{ "border-t": [C] }],
      "border-w-r": [{ "border-r": [C] }],
      "border-w-b": [{ "border-b": [C] }],
      "border-w-l": [{ "border-l": [C] }],
      "border-opacity": [{ "border-opacity": [N] }],
      "border-style": [{ border: [...J(), "hidden"] }],
      "divide-x": [{ "divide-x": [C] }],
      "divide-x-reverse": ["divide-x-reverse"],
      "divide-y": [{ "divide-y": [C] }],
      "divide-y-reverse": ["divide-y-reverse"],
      "divide-opacity": [{ "divide-opacity": [N] }],
      "divide-style": [{ divide: J() }],
      "border-color": [{ border: [b] }],
      "border-color-x": [{ "border-x": [b] }],
      "border-color-y": [{ "border-y": [b] }],
      "border-color-s": [{ "border-s": [b] }],
      "border-color-e": [{ "border-e": [b] }],
      "border-color-t": [{ "border-t": [b] }],
      "border-color-r": [{ "border-r": [b] }],
      "border-color-b": [{ "border-b": [b] }],
      "border-color-l": [{ "border-l": [b] }],
      "divide-color": [{ divide: [b] }],
      "outline-style": [{ outline: ["", ...J()] }],
      "outline-offset": [{ "outline-offset": [isLength, isArbitraryValue] }],
      "outline-w": [{ outline: [isLength, isArbitraryLength] }],
      "outline-color": [{ outline: [e2] }],
      "ring-w": [{ ring: G() }],
      "ring-w-inset": ["ring-inset"],
      "ring-color": [{ ring: [e2] }],
      "ring-opacity": [{ "ring-opacity": [N] }],
      "ring-offset-w": [{ "ring-offset": [isLength, isArbitraryLength] }],
      "ring-offset-color": [{ "ring-offset": [e2] }],
      shadow: [{ shadow: [
        "",
        "inner",
        "none",
        isTshirtSize,
        isArbitraryShadow
      ] }],
      "shadow-color": [{ shadow: [isAny] }],
      opacity: [{ opacity: [N] }],
      "mix-blend": [{ "mix-blend": [
        ...Y(),
        "plus-lighter",
        "plus-darker"
      ] }],
      "bg-blend": [{ "bg-blend": Y() }],
      filter: [{ filter: ["", "none"] }],
      blur: [{ blur: [v] }],
      brightness: [{ brightness: [y] }],
      contrast: [{ contrast: [w] }],
      "drop-shadow": [{ "drop-shadow": [
        "",
        "none",
        isTshirtSize,
        isArbitraryValue
      ] }],
      grayscale: [{ grayscale: [T] }],
      "hue-rotate": [{ "hue-rotate": [E] }],
      invert: [{ invert: [D] }],
      saturate: [{ saturate: [F] }],
      sepia: [{ sepia: [L] }],
      "backdrop-filter": [{ "backdrop-filter": ["", "none"] }],
      "backdrop-blur": [{ "backdrop-blur": [v] }],
      "backdrop-brightness": [{ "backdrop-brightness": [y] }],
      "backdrop-contrast": [{ "backdrop-contrast": [w] }],
      "backdrop-grayscale": [{ "backdrop-grayscale": [T] }],
      "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [E] }],
      "backdrop-invert": [{ "backdrop-invert": [D] }],
      "backdrop-opacity": [{ "backdrop-opacity": [N] }],
      "backdrop-saturate": [{ "backdrop-saturate": [F] }],
      "backdrop-sepia": [{ "backdrop-sepia": [L] }],
      "border-collapse": [{ border: ["collapse", "separate"] }],
      "border-spacing": [{ "border-spacing": [S] }],
      "border-spacing-x": [{ "border-spacing-x": [S] }],
      "border-spacing-y": [{ "border-spacing-y": [S] }],
      "table-layout": [{ table: ["auto", "fixed"] }],
      caption: [{ caption: ["top", "bottom"] }],
      transition: [{ transition: [
        "none",
        "all",
        "",
        "colors",
        "opacity",
        "shadow",
        "transform",
        isArbitraryValue
      ] }],
      duration: [{ duration: $() }],
      ease: [{ ease: [
        "linear",
        "in",
        "out",
        "in-out",
        isArbitraryValue
      ] }],
      delay: [{ delay: $() }],
      animate: [{ animate: [
        "none",
        "spin",
        "ping",
        "pulse",
        "bounce",
        isArbitraryValue
      ] }],
      transform: [{ transform: [
        "",
        "gpu",
        "none"
      ] }],
      scale: [{ scale: [I] }],
      "scale-x": [{ "scale-x": [I] }],
      "scale-y": [{ "scale-y": [I] }],
      rotate: [{ rotate: [isInteger, isArbitraryValue] }],
      "translate-x": [{ "translate-x": [B] }],
      "translate-y": [{ "translate-y": [B] }],
      "skew-x": [{ "skew-x": [R] }],
      "skew-y": [{ "skew-y": [R] }],
      "transform-origin": [{ origin: [
        "center",
        "top",
        "top-right",
        "right",
        "bottom-right",
        "bottom",
        "bottom-left",
        "left",
        "top-left",
        isArbitraryValue
      ] }],
      accent: [{ accent: ["auto", e2] }],
      appearance: [{ appearance: ["none", "auto"] }],
      cursor: [{ cursor: [
        "auto",
        "default",
        "pointer",
        "wait",
        "text",
        "move",
        "help",
        "not-allowed",
        "none",
        "context-menu",
        "progress",
        "cell",
        "crosshair",
        "vertical-text",
        "alias",
        "copy",
        "no-drop",
        "grab",
        "grabbing",
        "all-scroll",
        "col-resize",
        "row-resize",
        "n-resize",
        "e-resize",
        "s-resize",
        "w-resize",
        "ne-resize",
        "nw-resize",
        "se-resize",
        "sw-resize",
        "ew-resize",
        "ns-resize",
        "nesw-resize",
        "nwse-resize",
        "zoom-in",
        "zoom-out",
        isArbitraryValue
      ] }],
      "caret-color": [{ caret: [e2] }],
      "pointer-events": [{ "pointer-events": ["none", "auto"] }],
      resize: [{ resize: [
        "none",
        "y",
        "x",
        ""
      ] }],
      "scroll-behavior": [{ scroll: ["auto", "smooth"] }],
      "scroll-m": [{ "scroll-m": W() }],
      "scroll-mx": [{ "scroll-mx": W() }],
      "scroll-my": [{ "scroll-my": W() }],
      "scroll-ms": [{ "scroll-ms": W() }],
      "scroll-me": [{ "scroll-me": W() }],
      "scroll-mt": [{ "scroll-mt": W() }],
      "scroll-mr": [{ "scroll-mr": W() }],
      "scroll-mb": [{ "scroll-mb": W() }],
      "scroll-ml": [{ "scroll-ml": W() }],
      "scroll-p": [{ "scroll-p": W() }],
      "scroll-px": [{ "scroll-px": W() }],
      "scroll-py": [{ "scroll-py": W() }],
      "scroll-ps": [{ "scroll-ps": W() }],
      "scroll-pe": [{ "scroll-pe": W() }],
      "scroll-pt": [{ "scroll-pt": W() }],
      "scroll-pr": [{ "scroll-pr": W() }],
      "scroll-pb": [{ "scroll-pb": W() }],
      "scroll-pl": [{ "scroll-pl": W() }],
      "snap-align": [{ snap: [
        "start",
        "end",
        "center",
        "align-none"
      ] }],
      "snap-stop": [{ snap: ["normal", "always"] }],
      "snap-type": [{ snap: [
        "none",
        "x",
        "y",
        "both"
      ] }],
      "snap-strictness": [{ snap: ["mandatory", "proximity"] }],
      touch: [{ touch: [
        "auto",
        "none",
        "manipulation"
      ] }],
      "touch-x": [{ "touch-pan": [
        "x",
        "left",
        "right"
      ] }],
      "touch-y": [{ "touch-pan": [
        "y",
        "up",
        "down"
      ] }],
      "touch-pz": ["touch-pinch-zoom"],
      select: [{ select: [
        "none",
        "text",
        "all",
        "auto"
      ] }],
      "will-change": [{ "will-change": [
        "auto",
        "scroll",
        "contents",
        "transform",
        isArbitraryValue
      ] }],
      fill: [{ fill: [e2, "none"] }],
      "stroke-w": [{ stroke: [
        isLength,
        isArbitraryLength,
        isArbitraryNumber
      ] }],
      stroke: [{ stroke: [e2, "none"] }],
      sr: ["sr-only", "not-sr-only"],
      "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
    },
    conflictingClassGroups: {
      overflow: ["overflow-x", "overflow-y"],
      overscroll: ["overscroll-x", "overscroll-y"],
      inset: [
        "inset-x",
        "inset-y",
        "start",
        "end",
        "top",
        "right",
        "bottom",
        "left"
      ],
      "inset-x": ["right", "left"],
      "inset-y": ["top", "bottom"],
      flex: [
        "basis",
        "grow",
        "shrink"
      ],
      gap: ["gap-x", "gap-y"],
      p: [
        "px",
        "py",
        "ps",
        "pe",
        "pt",
        "pr",
        "pb",
        "pl"
      ],
      px: ["pr", "pl"],
      py: ["pt", "pb"],
      m: [
        "mx",
        "my",
        "ms",
        "me",
        "mt",
        "mr",
        "mb",
        "ml"
      ],
      mx: ["mr", "ml"],
      my: ["mt", "mb"],
      size: ["w", "h"],
      "font-size": ["leading"],
      "fvn-normal": [
        "fvn-ordinal",
        "fvn-slashed-zero",
        "fvn-figure",
        "fvn-spacing",
        "fvn-fraction"
      ],
      "fvn-ordinal": ["fvn-normal"],
      "fvn-slashed-zero": ["fvn-normal"],
      "fvn-figure": ["fvn-normal"],
      "fvn-spacing": ["fvn-normal"],
      "fvn-fraction": ["fvn-normal"],
      "line-clamp": ["display", "overflow"],
      rounded: [
        "rounded-s",
        "rounded-e",
        "rounded-t",
        "rounded-r",
        "rounded-b",
        "rounded-l",
        "rounded-ss",
        "rounded-se",
        "rounded-ee",
        "rounded-es",
        "rounded-tl",
        "rounded-tr",
        "rounded-br",
        "rounded-bl"
      ],
      "rounded-s": ["rounded-ss", "rounded-es"],
      "rounded-e": ["rounded-se", "rounded-ee"],
      "rounded-t": ["rounded-tl", "rounded-tr"],
      "rounded-r": ["rounded-tr", "rounded-br"],
      "rounded-b": ["rounded-br", "rounded-bl"],
      "rounded-l": ["rounded-tl", "rounded-bl"],
      "border-spacing": ["border-spacing-x", "border-spacing-y"],
      "border-w": [
        "border-w-s",
        "border-w-e",
        "border-w-t",
        "border-w-r",
        "border-w-b",
        "border-w-l"
      ],
      "border-w-x": ["border-w-r", "border-w-l"],
      "border-w-y": ["border-w-t", "border-w-b"],
      "border-color": [
        "border-color-s",
        "border-color-e",
        "border-color-t",
        "border-color-r",
        "border-color-b",
        "border-color-l"
      ],
      "border-color-x": ["border-color-r", "border-color-l"],
      "border-color-y": ["border-color-t", "border-color-b"],
      "scroll-m": [
        "scroll-mx",
        "scroll-my",
        "scroll-ms",
        "scroll-me",
        "scroll-mt",
        "scroll-mr",
        "scroll-mb",
        "scroll-ml"
      ],
      "scroll-mx": ["scroll-mr", "scroll-ml"],
      "scroll-my": ["scroll-mt", "scroll-mb"],
      "scroll-p": [
        "scroll-px",
        "scroll-py",
        "scroll-ps",
        "scroll-pe",
        "scroll-pt",
        "scroll-pr",
        "scroll-pb",
        "scroll-pl"
      ],
      "scroll-px": ["scroll-pr", "scroll-pl"],
      "scroll-py": ["scroll-pt", "scroll-pb"],
      touch: [
        "touch-x",
        "touch-y",
        "touch-pz"
      ],
      "touch-x": ["touch"],
      "touch-y": ["touch"],
      "touch-pz": ["touch"]
    },
    conflictingClassGroupModifiers: { "font-size": ["leading"] }
  };
});
function cn(...e2) {
  return twMerge(clsx(e2));
}
const Events = {
  stopPropagation: (e2) => (_) => {
    _.stopPropagation(), e2 && e2(_);
  },
  onEnter: (e2) => (_) => {
    _.key === "Enter" && e2 && e2(_);
  },
  preventFocus: (e2) => {
    e2.preventDefault();
  },
  fromInput: (e2) => {
    let _ = Events.composedTarget(e2);
    return _.tagName === "INPUT" || _.tagName === "TEXTAREA" || _.tagName.startsWith("MARIMO") || _.isContentEditable || Events.fromCodeMirror(_);
  },
  fromCodeMirror: (e2) => e2.closest(".cm-editor") !== null,
  shouldIgnoreKeyboardEvent(e2) {
    let _ = Events.composedTarget(e2);
    return _ instanceof HTMLInputElement || _ instanceof HTMLTextAreaElement || _ instanceof HTMLSelectElement || _ instanceof HTMLElement && (_.isContentEditable || _.tagName === "BUTTON" || _.closest("[role='textbox']") !== null || _.closest("[contenteditable='true']") !== null || Events.fromCodeMirror(_));
  },
  composedTarget(e2) {
    return "composedPath" in e2 && typeof e2.composedPath == "function" ? e2.composedPath()[0] ?? e2.target : e2.target;
  },
  hasModifier: (e2) => e2.ctrlKey || e2.metaKey || e2.altKey || e2.shiftKey,
  isMetaOrCtrl: (e2) => e2.metaKey || e2.ctrlKey
};
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
function setRef(e2, _) {
  if (typeof e2 == "function") return e2(_);
  e2 != null && (e2.current = _);
}
function composeRefs(...e2) {
  return (_) => {
    let v = false, y = e2.map((e3) => {
      let y2 = setRef(e3, _);
      return !v && typeof y2 == "function" && (v = true), y2;
    });
    if (v) return () => {
      for (let _2 = 0; _2 < y.length; _2++) {
        let v2 = y[_2];
        typeof v2 == "function" ? v2() : setRef(e2[_2], null);
      }
    };
  };
}
function useComposedRefs(...e2) {
  return import_react.useCallback(composeRefs(...e2), e2);
}
var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
// @__NO_SIDE_EFFECTS__
function createSlot(e2) {
  let _ = /* @__PURE__ */ createSlotClone(e2), v = import_react.forwardRef((e3, v2) => {
    let { children: y, ...b } = e3, x = import_react.Children.toArray(y), S = x.find(isSlottable);
    if (S) {
      let e4 = S.props.children, y2 = x.map((_2) => _2 === S ? import_react.Children.count(e4) > 1 ? import_react.Children.only(null) : import_react.isValidElement(e4) ? e4.props.children : null : _2);
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(_, {
        ...b,
        ref: v2,
        children: import_react.isValidElement(e4) ? import_react.cloneElement(e4, void 0, y2) : null
      });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(_, {
      ...b,
      ref: v2,
      children: y
    });
  });
  return v.displayName = `${e2}.Slot`, v;
}
var Slot = /* @__PURE__ */ createSlot("Slot");
// @__NO_SIDE_EFFECTS__
function createSlotClone(e2) {
  let _ = import_react.forwardRef((e3, _2) => {
    let { children: v, ...y } = e3;
    if (import_react.isValidElement(v)) {
      let e4 = getElementRef(v), b = mergeProps(y, v.props);
      return v.type !== import_react.Fragment && (b.ref = _2 ? composeRefs(_2, e4) : e4), import_react.cloneElement(v, b);
    }
    return import_react.Children.count(v) > 1 ? import_react.Children.only(null) : null;
  });
  return _.displayName = `${e2}.SlotClone`, _;
}
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
// @__NO_SIDE_EFFECTS__
function createSlottable(e2) {
  let _ = ({ children: e3 }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: e3 });
  return _.displayName = `${e2}.Slottable`, _.__radixId = SLOTTABLE_IDENTIFIER, _;
}
function isSlottable(e2) {
  return import_react.isValidElement(e2) && typeof e2.type == "function" && "__radixId" in e2.type && e2.type.__radixId === SLOTTABLE_IDENTIFIER;
}
function mergeProps(e2, _) {
  let v = { ..._ };
  for (let y in _) {
    let b = e2[y], x = _[y];
    /^on[A-Z]/.test(y) ? b && x ? v[y] = (...e3) => {
      let _2 = x(...e3);
      return b(...e3), _2;
    } : b && (v[y] = b) : y === "style" ? v[y] = {
      ...b,
      ...x
    } : y === "className" && (v[y] = [b, x].filter(Boolean).join(" "));
  }
  return {
    ...e2,
    ...v
  };
}
function getElementRef(e2) {
  var _a, _b;
  let _ = (_a = Object.getOwnPropertyDescriptor(e2.props, "ref")) == null ? void 0 : _a.get, v = _ && "isReactWarning" in _ && _.isReactWarning;
  return v ? e2.ref : (_ = (_b = Object.getOwnPropertyDescriptor(e2, "ref")) == null ? void 0 : _b.get, v = _ && "isReactWarning" in _ && _.isReactWarning, v ? e2.props.ref : e2.props.ref || e2.ref);
}
var import_compiler_runtime$1 = require_compiler_runtime();
function isRefObject(e2) {
  return typeof e2 == "object" && !!e2 && "current" in e2;
}
function useEventListener(e2, _, v, y) {
  let b = (0, import_compiler_runtime$1.c)(8), x = (0, import_react.useRef)(v), S, C;
  b[0] === v ? (S = b[1], C = b[2]) : (S = () => {
    x.current = v;
  }, C = [v], b[0] = v, b[1] = S, b[2] = C), (0, import_react.useEffect)(S, C);
  let w, T;
  b[3] !== y || b[4] !== e2 || b[5] !== _ ? (w = () => {
    let v2 = isRefObject(e2) ? e2.current : e2;
    if (!v2) return;
    let b2 = (e3) => x.current(e3);
    return v2.addEventListener(_, b2, y), () => {
      v2.removeEventListener(_, b2, y);
    };
  }, T = [
    _,
    e2,
    y
  ], b[3] = y, b[4] = e2, b[5] = _, b[6] = w, b[7] = T) : (w = b[6], T = b[7]), (0, import_react.useEffect)(w, T);
}
const Objects = {
  EMPTY: Object.freeze({}),
  mapValues(e2, _) {
    return e2 && Objects.fromEntries(Objects.entries(e2).map(([e3, v]) => [e3, _(v, e3)]));
  },
  fromEntries(e2) {
    return Object.fromEntries(e2);
  },
  entries(e2) {
    return Object.entries(e2);
  },
  keys(e2) {
    return Object.keys(e2);
  },
  size(e2) {
    return Object.keys(e2).length;
  },
  keyBy(e2, _) {
    let v = {};
    for (let y of e2) {
      let e3 = _(y);
      e3 !== void 0 && (v[e3] = y);
    }
    return v;
  },
  collect(e2, _, v) {
    return Objects.mapValues(Objects.keyBy(e2, _), v);
  },
  groupBy(e2, _, v) {
    let y = {};
    for (let b of e2) {
      let e3 = _(b);
      if (e3 === void 0) continue;
      let x = v(b);
      e3 in y ? y[e3].push(x) : y[e3] = [x];
    }
    return y;
  },
  filter(e2, _) {
    let v = {};
    for (let [y, b] of Objects.entries(e2)) _(b, y) && (v[y] = e2[y]);
    return v;
  },
  omit(e2, _) {
    let v = new Set(_);
    return Objects.filter(e2, (e3, _2) => !v.has(_2));
  },
  pick(e2, _) {
    let v = {};
    for (let y of _) Object.hasOwn(e2, y) && (v[y] = e2[y]);
    return v;
  }
};
function isPlatformMac() {
  if (typeof window > "u") return Logger.warn("isPlatformMac() called without window"), false;
  let e2 = window.navigator.userAgentData ? window.navigator.userAgentData.platform : window.navigator.platform;
  return /mac/i.test(e2);
}
function isPlatformWindows() {
  if (typeof window > "u") return Logger.warn("isPlatformWindows() called without window"), false;
  let e2 = window.navigator.userAgentData ? window.navigator.userAgentData.platform : window.navigator.platform;
  return /win/i.test(e2);
}
function areKeysPressed(e2, _) {
  let v = true;
  for (let y of e2) {
    switch (y) {
      case "mod":
        v && (v = _.metaKey || _.ctrlKey);
        break;
      case "ctrl":
        v && (v = _.ctrlKey);
        break;
      case "meta":
        v && (v = _.metaKey);
        break;
      case "shift":
        v && (v = _.shiftKey);
        break;
      case "alt":
        v && (v = _.altKey);
        break;
      case "space":
        v && (v = _.code === "Space");
        break;
      default:
        /^\d$/.test(y) && _.shiftKey ? v && (v = _.code === `Digit${y}`) : v && (v = _.key.toLowerCase() === y);
        break;
    }
    if (!v) return false;
  }
  return e2.includes("shift") || v && (v = !_.shiftKey), !e2.includes("ctrl") && !e2.includes("mod") && (v && (v = !_.ctrlKey)), !e2.includes("meta") && !e2.includes("mod") && (v && (v = !_.metaKey)), e2.includes("alt") || v && (v = !_.altKey), v;
}
function normalizeKey(e2) {
  return {
    control: "ctrl",
    command: "mod",
    cmd: "mod",
    option: "alt",
    return: "enter"
  }[e2.toLowerCase()] || e2.toLowerCase();
}
function parseShortcut(e2) {
  if (e2 === NOT_SET || e2 === "") return () => false;
  let _ = e2.includes("+") ? "+" : "-", v = e2.split(_).map(normalizeKey);
  return (e3) => areKeysPressed(v, e3);
}
function resolvePlatform() {
  return isPlatformMac() ? "mac" : isPlatformWindows() ? "windows" : "linux";
}
const NOT_SET = /* @__PURE__ */ Symbol("NOT_SET");
var DEFAULT_HOT_KEY = {
  "cell.focusUp": {
    name: "Go to previous cell",
    group: "Navigation",
    key: "Mod-Shift-k"
  },
  "cell.focusDown": {
    name: "Go to next cell",
    group: "Navigation",
    key: "Mod-Shift-j"
  },
  "cell.moveUp": {
    name: "Move cell up",
    group: "Creation and Ordering",
    key: "Mod-Shift-9"
  },
  "cell.moveDown": {
    name: "Move cell down",
    group: "Creation and Ordering",
    key: "Mod-Shift-0"
  },
  "cell.moveLeft": {
    name: "Move left",
    group: "Creation and Ordering",
    key: "Mod-Shift-7"
  },
  "cell.moveRight": {
    name: "Move right",
    group: "Creation and Ordering",
    key: "Mod-Shift-8"
  },
  "cell.createAbove": {
    name: "New cell above",
    group: "Creation and Ordering",
    key: "Mod-Shift-o"
  },
  "cell.createBelow": {
    name: "New cell below",
    group: "Creation and Ordering",
    key: "Mod-Shift-p"
  },
  "cell.sendToTop": {
    name: "Send to top",
    group: "Creation and Ordering",
    key: "Mod-Shift-1"
  },
  "cell.sendToBottom": {
    name: "Send to bottom",
    group: "Creation and Ordering",
    key: "Mod-Shift-2"
  },
  "cell.addColumnBreakpoint": {
    name: "Add column breakpoint",
    group: "Creation and Ordering",
    key: "Mod-Shift-3"
  },
  "cell.run": {
    name: "Run",
    group: "Running Cells",
    key: "Mod-Enter",
    additionalKeywords: ["execute", "submit"]
  },
  "cell.runAndNewBelow": {
    name: "Run and new below",
    group: "Running Cells",
    key: "Shift-Enter"
  },
  "cell.runAndNewAbove": {
    name: "Run and new above",
    group: "Running Cells",
    key: "Mod-Shift-Enter"
  },
  "global.runAll": {
    name: "Re-run all cells",
    group: "Running Cells",
    key: NOT_SET
  },
  "cell.format": {
    name: "Format cell",
    group: "Editing",
    key: "Mod-b",
    additionalKeywords: ["lint"]
  },
  "cell.viewAsMarkdown": {
    name: "View as Markdown",
    group: "Editing",
    key: "Mod-Shift-m"
  },
  "cell.viewAsSQL": {
    name: "Toggle SQL",
    group: "Editing",
    key: {
      windows: "Alt-Shift-l",
      main: "Mod-Shift-l"
    }
  },
  "cell.complete": {
    name: "Code completion",
    group: "Editing",
    key: "Ctrl-Space"
  },
  "cell.signatureHelp": {
    name: "Signature help",
    group: "Editing",
    key: "Mod-Shift-Space"
  },
  "cell.undo": {
    name: "Undo",
    group: "Editing",
    key: "Mod-z"
  },
  "cell.redo": {
    name: "Redo",
    group: "Editing",
    key: {
      main: "Mod-Shift-z",
      windows: "Mod-y"
    }
  },
  "cell.findAndReplace": {
    name: "Find and Replace",
    group: "Editing",
    key: "Mod-f"
  },
  "cell.selectNextOccurrence": {
    name: "Add selection to next Find match",
    group: "Editing",
    key: "Mod-d"
  },
  "cell.fold": {
    name: "Fold region",
    group: "Editing",
    key: {
      main: "Mod-Alt-[",
      windows: "Mod-Shift-["
    }
  },
  "cell.unfold": {
    name: "Unfold region",
    group: "Editing",
    key: {
      main: "Mod-Alt-]",
      windows: "Mod-Shift-]"
    }
  },
  "cell.foldAll": {
    name: "Fold all regions",
    group: "Editing",
    key: "Ctrl-Alt-["
  },
  "cell.unfoldAll": {
    name: "Unfold all regions",
    group: "Editing",
    key: "Ctrl-Alt-]"
  },
  "cell.delete": {
    name: "Delete cell",
    group: "Editing",
    key: "Shift-Backspace",
    additionalKeywords: ["remove"]
  },
  "cell.hideCode": {
    name: "Hide cell code",
    group: "Editing",
    key: "Mod-h"
  },
  "cell.aiCompletion": {
    name: "AI completion",
    group: "Editing",
    key: "Mod-Shift-e"
  },
  "cell.cellActions": {
    name: "Open cell actions",
    group: "Editing",
    key: "Mod-p"
  },
  "cell.splitCell": {
    name: "Split cell",
    group: "Editing",
    key: "Mod-Shift-'"
  },
  "cell.toggleComment": {
    name: "Toggle comment",
    group: "Editing",
    key: "Mod-/"
  },
  "cell.toggleBlockComment": {
    name: "Toggle block comment",
    group: "Editing",
    key: "Alt-A"
  },
  "cell.renameSymbol": {
    name: "Rename symbol",
    group: "Editing",
    key: "F2"
  },
  "cell.copyLineUp": {
    name: "Copy line(s) up",
    group: "Editing",
    key: "Alt-Shift-ArrowUp",
    editable: false
  },
  "cell.copyLineDown": {
    name: "Copy line(s) down",
    group: "Editing",
    key: "Alt-Shift-ArrowDown",
    editable: false
  },
  "markdown.bold": {
    name: "Bold",
    group: "Markdown",
    key: "Mod-b"
  },
  "markdown.italic": {
    name: "Italic",
    group: "Markdown",
    key: "Mod-i"
  },
  "markdown.link": {
    name: "Convert to Link",
    group: "Markdown",
    key: "Mod-k"
  },
  "markdown.orderedList": {
    name: "Convert to Ordered list",
    group: "Markdown",
    key: "Mod-Shift-7"
  },
  "markdown.unorderedList": {
    name: "Convert to Unordered list",
    group: "Markdown",
    key: "Mod-Shift-8"
  },
  "markdown.blockquote": {
    name: "Convert to Blockquote",
    group: "Markdown",
    key: "Mod-Shift-9"
  },
  "markdown.code": {
    name: "Convert to Code",
    group: "Markdown",
    key: "Mod-Shift-0"
  },
  "global.hideCode": {
    name: "Toggle app view",
    group: "Other",
    key: "Mod-."
  },
  "global.foldCode": {
    name: "Fold all cells",
    group: "Editing",
    key: {
      main: "Ctrl-Cmd-l",
      windows: "Mod-Shift-l"
    }
  },
  "global.unfoldCode": {
    name: "Unfold all cells",
    group: "Editing",
    key: {
      main: "Ctrl-Cmd-;",
      windows: "Mod-Shift-:"
    }
  },
  "global.showHelp": {
    name: "Show keyboard shortcuts",
    group: "Other",
    key: "Mod-Shift-h"
  },
  "global.save": {
    name: "Save file",
    group: "Other",
    key: "Mod-s",
    additionalKeywords: ["write", "persist"]
  },
  "global.commandPalette": {
    name: "Show command palette",
    group: "Other",
    key: "Mod-k"
  },
  "global.runStale": {
    name: "Run all stale cells",
    group: "Running Cells",
    key: "Mod-Shift-r"
  },
  "global.interrupt": {
    name: "Stop (interrupt) execution",
    group: "Running Cells",
    key: "Mod-i"
  },
  "global.formatAll": {
    name: "Format all",
    group: "Editing",
    key: "Mod-Shift-b"
  },
  "global.toggleLanguage": {
    name: "Toggle language to markdown (if supported)",
    group: "Editing",
    key: "F4"
  },
  "global.toggleTerminal": {
    name: "Show integrated terminal",
    group: "Other",
    key: "Ctrl-`"
  },
  "global.togglePanel": {
    name: "Toggle developer panel",
    group: "Other",
    key: "Mod-j"
  },
  "global.collapseAllSections": {
    name: "Collapse all sections",
    group: "Editing",
    key: "Mod-Shift-\\"
  },
  "global.expandAllSections": {
    name: "Expand all sections",
    group: "Editing",
    key: "Mod-Shift-/"
  },
  "global.toggleMinimap": {
    name: "Toggle Minimap",
    group: "Other",
    key: "Mod-Shift-i"
  },
  "global.focusTop": {
    name: "Focus top",
    group: "Navigation",
    key: "Mod-Shift-f"
  },
  "global.focusBottom": {
    name: "Focus bottom",
    group: "Navigation",
    key: "Mod-Shift-g"
  },
  "global.toggleSidebar": {
    name: "Toggle helper panel",
    group: "Navigation",
    key: "Mod-Shift-s"
  },
  "cell.goToDefinition": {
    name: "Go to Definition",
    group: "Navigation",
    key: "F12"
  },
  "completion.moveDown": {
    name: "Move completion selection down",
    group: "Editing",
    key: "Ctrl-j"
  },
  "completion.moveUp": {
    name: "Move completion selection up",
    group: "Editing",
    key: "Ctrl-k"
  },
  "command.vimEnterCommandMode": {
    name: "Enter command mode (vim)",
    group: "Command",
    key: {
      main: "Mod-Escape",
      windows: "Shift-Escape"
    }
  },
  "command.createCellBefore": {
    name: "Create a cell before current cell",
    group: "Command",
    key: "a"
  },
  "command.createCellAfter": {
    name: "Create a cell after current cell",
    group: "Command",
    key: "b"
  },
  "command.copyCell": {
    name: "Copy cell",
    group: "Command",
    key: "c"
  },
  "command.cutCell": {
    name: "Cut cell",
    group: "Command",
    key: "x"
  },
  "command.pasteCell": {
    name: "Paste cell",
    group: "Command",
    key: "v"
  }
}, HotkeyProvider = class e {
  static create(_) {
    return new e(DEFAULT_HOT_KEY, { platform: _ });
  }
  constructor(e2, _ = {}) {
    this.hotkeys = e2, this.platform = _.platform ?? resolvePlatform(), this.mod = this.platform === "mac" ? "Cmd" : "Ctrl";
  }
  iterate() {
    return Objects.keys(this.hotkeys);
  }
  getHotkey(e2) {
    let { name: _, key: v, additionalKeywords: y } = this.hotkeys[e2];
    return typeof v == "string" ? {
      name: _,
      key: v.replace("Mod", this.mod),
      additionalKeywords: y
    } : v === NOT_SET ? {
      name: _,
      key: "",
      additionalKeywords: y
    } : {
      name: _,
      key: (v[this.platform] || v.main).replace("Mod", this.mod),
      additionalKeywords: y
    };
  }
  getHotkeyDisplay(e2) {
    return this.hotkeys[e2].name;
  }
  isEditable(e2) {
    return this.hotkeys[e2].editable !== false;
  }
  getHotkeyGroups() {
    return Objects.groupBy(Objects.entries(this.hotkeys), ([, e2]) => e2.group, ([e2]) => e2);
  }
}, OverridingHotkeyProvider = class extends HotkeyProvider {
  constructor(e2, _ = {}) {
    super(DEFAULT_HOT_KEY, _), this.overrides = e2;
  }
  getHotkey(e2) {
    let _ = super.getHotkey(e2), v = this.overrides[e2];
    return {
      name: _.name,
      key: v ? normalizeKeyString(v) : _.key,
      additionalKeywords: _.additionalKeywords
    };
  }
}, MODIFIER_RE = /^(cmd|ctrl|alt|shift|meta|mod)$/i;
function normalizeKeyString(e2) {
  let _ = e2.split("-"), v = _[_.length - 1];
  return v.length > 1 && !MODIFIER_RE.test(v) && (_[_.length - 1] = v.charAt(0).toUpperCase() + v.slice(1)), _.join("-");
}
var falsyToString = (e2) => typeof e2 == "boolean" ? `${e2}` : e2 === 0 ? "0" : e2;
const cx = clsx, cva = (e2, _) => (v) => {
  var _a;
  if ((_ == null ? void 0 : _.variants) == null) return cx(e2, v == null ? void 0 : v.class, v == null ? void 0 : v.className);
  let { variants: y, defaultVariants: b } = _, x = Object.keys(y).map((e3) => {
    let _2 = v == null ? void 0 : v[e3], x2 = b == null ? void 0 : b[e3];
    if (_2 === null) return null;
    let S2 = falsyToString(_2) || falsyToString(x2);
    return y[e3][S2];
  }), S = v && Object.entries(v).reduce((e3, _2) => {
    let [v2, y2] = _2;
    return y2 === void 0 || (e3[v2] = y2), e3;
  }, {});
  return cx(e2, x, (_a = _ == null ? void 0 : _.compoundVariants) == null ? void 0 : _a.reduce((e3, _2) => {
    let { class: v2, className: y2, ...x2 } = _2;
    return Object.entries(x2).every((e4) => {
      let [_3, v3] = e4;
      return Array.isArray(v3) ? v3.includes({
        ...b,
        ...S
      }[_3]) : {
        ...b,
        ...S
      }[_3] === v3;
    }) ? [
      ...e3,
      v2,
      y2
    ] : e3;
  }, []), v == null ? void 0 : v.class, v == null ? void 0 : v.className);
};
var import_compiler_runtime = require_compiler_runtime(), activeCommon = "active:shadow-none", buttonVariants = cva(cn("disabled:opacity-50 disabled:pointer-events-none", "inline-flex items-center justify-center rounded-md text-sm font-medium focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background"), {
  variants: {
    variant: {
      default: cn("bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs border border-primary", activeCommon),
      destructive: cn("border shadow-xs", "bg-(--red-9) hover:bg-(--red-10) dark:bg-(--red-6) dark:hover:bg-(--red-7)", "text-(--red-1) dark:text-(--red-12)", "border-(--red-11)", activeCommon),
      success: cn("border shadow-xs", "bg-(--grass-9) hover:bg-(--grass-10) dark:bg-(--grass-6) dark:hover:bg-(--grass-7)", "text-(--grass-1) dark:text-(--grass-12)", "border-(--grass-11)", activeCommon),
      warn: cn("border shadow-xs", "bg-(--yellow-9) hover:bg-(--yellow-10) dark:bg-(--yellow-6) dark:hover:bg-(--yellow-7)", "text-(--yellow-12)", "border-(--yellow-11)", activeCommon),
      action: cn("bg-action text-action-foreground shadow-xs", "hover:bg-action-hover border border-action", activeCommon),
      outline: cn("border border-slate-300 shadow-xs", "hover:bg-accent hover:text-accent-foreground", "hover:border-primary", "aria-selected:text-accent-foreground aria-selected:border-primary", activeCommon),
      secondary: cn("bg-secondary text-secondary-foreground hover:bg-secondary/80", "border border-input shadow-xs", activeCommon),
      text: cn("opacity-80 hover:opacity-100", "active:opacity-100"),
      ghost: cn("border border-transparent", "hover:bg-accent hover:text-accent-foreground hover:shadow-xs", activeCommon, "active:text-accent-foreground"),
      link: "underline-offset-4 hover:underline text-link",
      linkDestructive: "underline-offset-4 hover:underline text-destructive underline-destructive",
      outlineDestructive: "border border-destructive text-destructive hover:bg-destructive/10"
    },
    size: {
      default: "h-10 py-2 px-4",
      xs: "h-7 px-2 rounded-md text-xs",
      sm: "h-9 px-3 rounded-md",
      lg: "h-11 px-8 rounded-md",
      icon: "h-6 w-6 mb-0"
    },
    disabled: { true: "opacity-50 pointer-events-none" }
  },
  defaultVariants: {
    variant: "default",
    size: "sm"
  }
}), Button = import_react.forwardRef((e2, _) => {
  let v = (0, import_compiler_runtime.c)(7), { className: y, variant: b, size: x, asChild: S, keyboardShortcut: C, ...w } = e2, T = S === void 0 ? false : S, E = import_react.useRef(null), D;
  v[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = () => E.current, v[0] = D) : D = v[0], import_react.useImperativeHandle(_, D);
  let O;
  v[1] === C ? O = v[2] : (O = (e3) => {
    !C || e3.defaultPrevented || Events.shouldIgnoreKeyboardEvent(e3) || parseShortcut(C)(e3) && (e3.preventDefault(), e3.stopPropagation(), (E == null ? void 0 : E.current) && !E.current.disabled && E.current.click());
  }, v[1] = C, v[2] = O);
  let k = O;
  useEventListener(document, "keydown", k);
  let A = T ? Slot : "button", j = cn(buttonVariants({
    variant: b,
    size: x,
    className: y,
    disabled: w.disabled
  }), y), M;
  return v[3] !== A || v[4] !== w || v[5] !== j ? (M = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(A, {
    className: j,
    ref: E,
    ...w
  }), v[3] = A, v[4] = w, v[5] = j, v[6] = M) : M = v[6], M;
});
Button.displayName = "Button";
export {
  Logger as _,
  OverridingHotkeyProvider as a,
  Objects as c,
  createSlot as d,
  createSlottable as f,
  cn as g,
  Events as h,
  NOT_SET as i,
  useEventListener as l,
  useComposedRefs as m,
  buttonVariants as n,
  isPlatformMac as o,
  composeRefs as p,
  cva as r,
  resolvePlatform as s,
  Button as t,
  Slot as u,
  Functions as v,
  throwNotImplemented as y
};
