'use strict';

var chunkFEN5S772_cjs = require('./chunk-FEN5S772.cjs');
var chunkQJ6GTUCO_cjs = require('./chunk-QJ6GTUCO.cjs');
var chunkYDPDTOSP_cjs = require('./chunk-YDPDTOSP.cjs');
var chunkKNDLV4PI_cjs = require('./chunk-KNDLV4PI.cjs');
var chunk5I5QNGUG_cjs = require('./chunk-5I5QNGUG.cjs');
var chunkYW5IVWHQ_cjs = require('./chunk-YW5IVWHQ.cjs');
var chunk76NNDZH6_cjs = require('./chunk-76NNDZH6.cjs');
var chunk2SXDCXLK_cjs = require('./chunk-2SXDCXLK.cjs');
var chunkYXZ6GU7H_cjs = require('./chunk-YXZ6GU7H.cjs');
var chunkIEEAENLX_cjs = require('./chunk-IEEAENLX.cjs');
var chunkQW4RBGHN_cjs = require('./chunk-QW4RBGHN.cjs');
var chunkB5AWZOHJ_cjs = require('./chunk-B5AWZOHJ.cjs');
var chunkSGP7V2UW_cjs = require('./chunk-SGP7V2UW.cjs');
require('./chunk-FP2RLYQZ.cjs');
var chunkOLISEQHS_cjs = require('./chunk-OLISEQHS.cjs');
var React = require('react');
var lib = require('@djangocfg/ui-core/lib');
var i18n = require('@djangocfg/i18n');
var jsxRuntime = require('react/jsx-runtime');
var lucideReact = require('lucide-react');
var components = require('@djangocfg/ui-core/components');
var hooks = require('@djangocfg/ui-core/hooks');
var react = require('@tiptap/react');
var StarterKit = require('@tiptap/starter-kit');
var Placeholder = require('@tiptap/extension-placeholder');
var Mention = require('@tiptap/extension-mention');
var markdown = require('@tiptap/markdown');
var dom = require('@floating-ui/dom');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
var Placeholder__default = /*#__PURE__*/_interopDefault(Placeholder);
var Mention__default = /*#__PURE__*/_interopDefault(Mention);

function Spinner({ className }) {
  const t = i18n.useAppT();
  const loadingLabel = t("ui.states.loading");
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      className: lib.cn(
        "inline-block h-8 w-8 animate-spin rounded-full",
        "border-4 border-solid border-current border-r-transparent",
        "align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
        className
      ),
      role: "status",
      "aria-label": loadingLabel
    }
  );
}
chunkOLISEQHS_cjs.__name(Spinner, "Spinner");
function LoadingFallback({
  minHeight = 200,
  showText = true,
  text,
  className
}) {
  const t = i18n.useAppT();
  const loadingText = text ?? t("ui.form.loading");
  const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      className: lib.cn(
        "flex items-center justify-center bg-muted/30 rounded-lg",
        className
      ),
      style: { minHeight: height },
      children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
        /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary" }),
        showText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
      ] })
    }
  );
}
chunkOLISEQHS_cjs.__name(LoadingFallback, "LoadingFallback");
function CardLoadingFallback({
  title,
  description,
  minHeight = 200,
  className
}) {
  const t = i18n.useAppT();
  const cardTitle = title ?? t("ui.states.loading");
  const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      className: lib.cn(
        "relative bg-card rounded-lg border border-border overflow-hidden",
        className
      ),
      children: [
        /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border-b border-border bg-muted/50", children: [
          /* @__PURE__ */ jsxRuntime.jsx("h6", { className: "text-sm font-semibold text-foreground", children: cardTitle }),
          description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: description })
        ] }),
        /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(
          "div",
          {
            className: "flex justify-center items-center",
            style: { minHeight: height },
            children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary" })
          }
        ) })
      ]
    }
  );
}
chunkOLISEQHS_cjs.__name(CardLoadingFallback, "CardLoadingFallback");
function MapLoadingFallback({
  minHeight = 400,
  className
}) {
  const t = i18n.useAppT();
  const loadingText = t("ui.form.loading");
  const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      className: lib.cn(
        "relative bg-muted/50 rounded-lg overflow-hidden",
        "flex items-center justify-center",
        className
      ),
      style: { minHeight: height },
      children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
        /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary h-10 w-10" }),
          /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
            "svg",
            {
              className: "h-5 w-5 text-muted-foreground",
              fill: "none",
              viewBox: "0 0 24 24",
              stroke: "currentColor",
              children: [
                /* @__PURE__ */ jsxRuntime.jsx(
                  "path",
                  {
                    strokeLinecap: "round",
                    strokeLinejoin: "round",
                    strokeWidth: 2,
                    d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
                  }
                ),
                /* @__PURE__ */ jsxRuntime.jsx(
                  "path",
                  {
                    strokeLinecap: "round",
                    strokeLinejoin: "round",
                    strokeWidth: 2,
                    d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
                  }
                )
              ]
            }
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
      ] })
    }
  );
}
chunkOLISEQHS_cjs.__name(MapLoadingFallback, "MapLoadingFallback");
function LazyWrapper({
  children,
  fallback,
  card = false,
  cardTitle,
  cardDescription,
  minHeight = 200,
  className
}) {
  const defaultFallback = card ? /* @__PURE__ */ jsxRuntime.jsx(
    CardLoadingFallback,
    {
      title: cardTitle,
      description: cardDescription,
      minHeight,
      className
    }
  ) : /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight, className });
  return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: fallback ?? defaultFallback, children });
}
chunkOLISEQHS_cjs.__name(LazyWrapper, "LazyWrapper");
function createLazyComponent(loader, options = {}) {
  const LazyComponent = React__namespace.lazy(loader);
  const WrappedComponent = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
    const fallback = typeof options.fallback === "function" ? options.fallback(props) : options.fallback ?? /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, {});
    return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback, children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...props }) });
  }, "WrappedComponent");
  WrappedComponent.displayName = options.displayName ?? "LazyComponent";
  return WrappedComponent;
}
chunkOLISEQHS_cjs.__name(createLazyComponent, "createLazyComponent");
var LazyMapContainer = createLazyComponent(
  () => import('./MapContainer-76YL2JXL.cjs').then((mod) => ({ default: mod.MapContainer })),
  {
    displayName: "LazyMapContainer",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(MapLoadingFallback, { minHeight: 400 })
  }
);
var LazyMapView = createLazyComponent(
  () => import('./MapContainer-76YL2JXL.cjs').then((mod) => ({ default: mod.MapView })),
  {
    displayName: "LazyMapView",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(MapLoadingFallback, { minHeight: 400 })
  }
);
var LazyMermaid = createLazyComponent(
  () => import('./Mermaid.client-NNTI6DFX.cjs'),
  {
    displayName: "LazyMermaid",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(
      CardLoadingFallback,
      {
        title: "Diagram",
        description: "Loading...",
        minHeight: 200
      }
    )
  }
);
function CodeLoadingFallback() {
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative rounded-sm border border-border overflow-hidden bg-muted dark:bg-zinc-900", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-pulse h-4 w-4 rounded-full bg-muted-foreground/20" }),
    /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "Loading code..." })
  ] }) }) });
}
chunkOLISEQHS_cjs.__name(CodeLoadingFallback, "CodeLoadingFallback");
var LazyPrettyCode = createLazyComponent(
  () => import('./PrettyCode.client-KOHDVPPN.cjs'),
  {
    displayName: "LazyPrettyCode",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(CodeLoadingFallback, {})
  }
);
function OpenapiLoadingFallback() {
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-[400px] bg-muted/30 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent" }),
    /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: "Loading API Playground..." })
  ] }) });
}
chunkOLISEQHS_cjs.__name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
var LazyDocsLayout = createLazyComponent(
  () => import('./DocsLayout-N5ZJZPBY.cjs').then((mod) => ({ default: mod.DocsLayout })),
  {
    displayName: "LazyDocsLayout",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(OpenapiLoadingFallback, {})
  }
);
var LazyOpenapiViewer = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) => {
  return /* @__PURE__ */ jsxRuntime.jsx(chunkQW4RBGHN_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(LazyDocsLayout, {}) });
}, "LazyOpenapiViewer");
LazyOpenapiViewer.displayName = "LazyOpenapiViewer";
var LazyJsonSchemaForm = createLazyComponent(
  () => import('./JsonSchemaForm-DD7CLRIG.cjs').then((mod) => ({ default: mod.JsonSchemaForm })),
  {
    displayName: "LazyJsonSchemaForm",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(
      CardLoadingFallback,
      {
        title: "Form",
        description: "Loading form schema...",
        minHeight: 200
      }
    )
  }
);
function LottieLoadingFallback() {
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary" }),
    /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Loading animation..." })
  ] }) });
}
chunkOLISEQHS_cjs.__name(LottieLoadingFallback, "LottieLoadingFallback");
var LazyLottiePlayer = createLazyComponent(
  () => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer })),
  {
    displayName: "LazyLottiePlayer",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(LottieLoadingFallback, {})
  }
);
var LazyPlayer = createLazyComponent(
  () => import('./Player-PM7F7DD7.cjs').then((mod) => ({ default: mod.Player })),
  {
    displayName: "LazyAudioPlayer",
    fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border/60 bg-card px-4 py-6 text-sm text-muted-foreground", children: "Loading audio player\u2026" })
  }
);
function VideoLoadingFallback() {
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center bg-black/90 rounded-lg aspect-video", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
    /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
      /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-white" }),
      /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
        "svg",
        {
          className: "h-5 w-5 text-white/60",
          fill: "currentColor",
          viewBox: "0 0 24 24",
          children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5v14l11-7z" })
        }
      ) })
    ] }),
    /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-white/60", children: "Loading video player..." })
  ] }) });
}
chunkOLISEQHS_cjs.__name(VideoLoadingFallback, "VideoLoadingFallback");
var LazyVideoPlayer = createLazyComponent(
  () => import('./components-MQ6DR7TX.cjs').then((mod) => ({ default: mod.VideoPlayer })),
  {
    displayName: "LazyVideoPlayer",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(VideoLoadingFallback, {})
  }
);
var LazyJsonTree = createLazyComponent(
  () => import('./JsonTree-DCM5QGWF.cjs'),
  {
    displayName: "LazyJsonTree",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 100, text: "Loading JSON viewer..." })
  }
);
var LazyImageViewer = createLazyComponent(
  () => import('./components-EHOGXATG.cjs').then((mod) => ({ default: mod.ImageViewer })),
  {
    displayName: "LazyImageViewer",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 200, text: "Loading image viewer..." })
  }
);
var LazyCronScheduler = createLazyComponent(
  () => import('./CronScheduler.client-WEJF4PWQ.cjs'),
  {
    displayName: "LazyCronScheduler",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(
      LoadingFallback,
      {
        minHeight: 120,
        showText: false,
        className: "rounded-lg"
      }
    )
  }
);
var LazyTree = createLazyComponent(
  () => import('./TreeRoot-N72OYKXU.cjs'),
  {
    displayName: "LazyTree",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
  }
);
var LazyChat = createLazyComponent(
  () => import('./ChatRoot-2KT32NFJ.cjs').then((m) => ({ default: m.ChatRoot })),
  {
    displayName: "LazyChat",
    fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
  }
);

// src/tools/Chat/core/transport/types.ts
var _TransportError = class _TransportError extends Error {
  constructor(message, code = "transport_error") {
    super(message);
    chunkOLISEQHS_cjs.__publicField(this, "code");
    this.name = "TransportError";
    this.code = code;
  }
};
chunkOLISEQHS_cjs.__name(_TransportError, "TransportError");
var TransportError = _TransportError;

// src/tools/Chat/core/transport/sse.ts
var DEFAULT_MAP = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((raw) => {
  if (!raw.data) return null;
  try {
    const parsed = JSON.parse(raw.data);
    if (raw.event && !("type" in parsed)) {
      return { ...parsed, type: raw.event };
    }
    return parsed;
  } catch {
    return null;
  }
}, "DEFAULT_MAP");
async function* parseSSE(response, options = {}) {
  if (!response.body) {
    throw new Error("SSE response has no body");
  }
  const map = options.map ?? DEFAULT_MAP;
  const idleMs = options.idleTimeoutMs ?? chunk2SXDCXLK_cjs.LIMITS.sseIdleMs;
  const reader = response.body.getReader();
  const decoder = new TextDecoder();
  let buffer = "";
  let lastChunkAt = Date.now();
  const idleCheck = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
    if (Date.now() - lastChunkAt > idleMs) {
      throw new Error(`SSE idle timeout (${idleMs}ms)`);
    }
  }, "idleCheck");
  try {
    while (true) {
      if (options.signal?.aborted) {
        return;
      }
      const { value, done } = await reader.read();
      if (done) break;
      lastChunkAt = Date.now();
      buffer += decoder.decode(value, { stream: true });
      let separator = buffer.indexOf("\n\n");
      while (separator !== -1) {
        const rawBlock = buffer.slice(0, separator);
        buffer = buffer.slice(separator + 2);
        const raw = parseEventBlock(rawBlock);
        const evt = map(raw);
        if (evt) yield evt;
        separator = buffer.indexOf("\n\n");
      }
      idleCheck();
    }
    if (buffer.trim()) {
      const raw = parseEventBlock(buffer);
      const evt = map(raw);
      if (evt) yield evt;
    }
  } finally {
    try {
      reader.releaseLock();
    } catch {
    }
  }
}
chunkOLISEQHS_cjs.__name(parseSSE, "parseSSE");
function parseEventBlock(block) {
  const out = {};
  const lines = block.split(/\r?\n/);
  const dataLines = [];
  for (const line of lines) {
    if (!line || line.startsWith(":")) continue;
    const colon = line.indexOf(":");
    if (colon === -1) continue;
    const field = line.slice(0, colon).trim();
    const value = line.slice(colon + 1).replace(/^ /, "");
    if (field === "event") out.event = value;
    else if (field === "data") dataLines.push(value);
  }
  if (dataLines.length) out.data = dataLines.join("\n");
  return out;
}
chunkOLISEQHS_cjs.__name(parseEventBlock, "parseEventBlock");

// src/tools/Chat/core/transport/http.ts
var DEFAULT_TIMEOUT = 2e4;
async function jsonOrThrow(res, label) {
  if (!res.ok) {
    const text = await res.text().catch(() => "");
    throw new TransportError(
      `${label} failed (${res.status}): ${text || res.statusText}`,
      mapStatusToCode(res.status)
    );
  }
  try {
    return await res.json();
  } catch {
    throw new TransportError(`${label} returned invalid JSON`, "invalid_response");
  }
}
chunkOLISEQHS_cjs.__name(jsonOrThrow, "jsonOrThrow");
function mapStatusToCode(status) {
  if (status === 401) return "unauthorized";
  if (status === 403) return "forbidden";
  if (status === 404) return "not_found";
  if (status === 429) return "rate_limited";
  if (status >= 500) return "server_error";
  return "http_error";
}
chunkOLISEQHS_cjs.__name(mapStatusToCode, "mapStatusToCode");
function withTimeout(signal, timeoutMs) {
  const ctrl = new AbortController();
  const onAbort = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => ctrl.abort(), "onAbort");
  signal?.addEventListener("abort", onAbort, { once: true });
  setTimeout(() => ctrl.abort(), timeoutMs);
  return ctrl.signal;
}
chunkOLISEQHS_cjs.__name(withTimeout, "withTimeout");
function createHttpTransport(config) {
  const fetchImpl = config.fetchImpl ?? fetch;
  const timeout = config.timeoutMs ?? DEFAULT_TIMEOUT;
  const base = config.baseUrl.replace(/\/$/, "");
  async function buildHeaders(extra) {
    const auth = await config.getAuthHeader?.() ?? {};
    return {
      "Content-Type": "application/json",
      ...auth,
      ...extra ?? {}
    };
  }
  chunkOLISEQHS_cjs.__name(buildHeaders, "buildHeaders");
  return {
    async createSession(opts) {
      const res = await fetchImpl(`${base}/sessions`, {
        method: "POST",
        headers: await buildHeaders(),
        body: JSON.stringify({ slug: config.slug, metadata: opts?.metadata ?? {} }),
        signal: withTimeout(void 0, timeout)
      });
      return jsonOrThrow(res, "createSession");
    },
    async loadHistory(sessionId, cursor, limit) {
      const params = new URLSearchParams();
      if (cursor) params.set("cursor", cursor);
      if (limit) params.set("limit", String(limit));
      const url = `${base}/sessions/${encodeURIComponent(sessionId)}/history${params.toString() ? `?${params.toString()}` : ""}`;
      const res = await fetchImpl(url, {
        method: "GET",
        headers: await buildHeaders(),
        signal: withTimeout(void 0, timeout)
      });
      return jsonOrThrow(res, "loadHistory");
    },
    async *stream(sessionId, content, options) {
      const url = `${base}/sessions/${encodeURIComponent(sessionId)}/messages`;
      const res = await fetchImpl(url, {
        method: "POST",
        headers: await buildHeaders({ Accept: "text/event-stream" }),
        body: JSON.stringify({
          content,
          attachments: options.attachments ?? [],
          metadata: options.metadata ?? {}
        }),
        signal: options.signal
      });
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new TransportError(
          `stream failed (${res.status}): ${text || res.statusText}`,
          mapStatusToCode(res.status)
        );
      }
      yield* parseSSE(res, { signal: options.signal });
    },
    async send(sessionId, content, options) {
      const url = `${base}/sessions/${encodeURIComponent(sessionId)}/messages/buffered`;
      const res = await fetchImpl(url, {
        method: "POST",
        headers: await buildHeaders(),
        body: JSON.stringify({
          content,
          attachments: options?.attachments ?? [],
          metadata: options?.metadata ?? {}
        }),
        signal: options?.signal ?? withTimeout(void 0, timeout)
      });
      return jsonOrThrow(res, "send");
    },
    async closeSession(sessionId) {
      const url = `${base}/sessions/${encodeURIComponent(sessionId)}`;
      const res = await fetchImpl(url, {
        method: "DELETE",
        headers: await buildHeaders(),
        signal: withTimeout(void 0, timeout)
      });
      if (!res.ok && res.status !== 404) {
        throw new TransportError(`closeSession failed (${res.status})`, mapStatusToCode(res.status));
      }
    }
  };
}
chunkOLISEQHS_cjs.__name(createHttpTransport, "createHttpTransport");

// src/tools/Chat/core/transport/mock.ts
var DEFAULT_REPLY = "Hi there!";
function splitForStream(text, parts = 4) {
  if (!text) return [];
  const chunkSize = Math.max(1, Math.ceil(text.length / parts));
  const out = [];
  for (let i = 0; i < text.length; i += chunkSize) {
    out.push(text.slice(i, i + chunkSize));
  }
  return out;
}
chunkOLISEQHS_cjs.__name(splitForStream, "splitForStream");
var sleep = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((ms) => new Promise((r) => setTimeout(r, ms)), "sleep");
function createMockTransport(opts = {}) {
  const replies = opts.replies?.length ? opts.replies : [DEFAULT_REPLY];
  const latency = opts.latencyMs ?? 30;
  const history = [...opts.initialMessages ?? []];
  let turn = 0;
  let attempt = 0;
  return {
    async createSession(_opts) {
      await sleep(latency);
      return {
        sessionId: chunk2SXDCXLK_cjs.createId("s"),
        messages: history.length ? [...history] : void 0,
        hasMore: false,
        cursor: null,
        resumed: history.length > 0
      };
    },
    async loadHistory(_sid, _cursor, _limit) {
      await sleep(latency);
      return { messages: [], hasMore: false, nextCursor: null };
    },
    async *stream(_sid, content, options) {
      attempt += 1;
      if (opts.shouldFail?.(attempt)) {
        throw new Error("mock transport scripted failure");
      }
      history.push({
        id: chunk2SXDCXLK_cjs.createId("u"),
        role: "user",
        content,
        createdAt: Date.now()
      });
      const messageId = chunk2SXDCXLK_cjs.createId("a");
      yield { type: "message_start", messageId, sessionId: _sid };
      const reply = replies[turn % replies.length];
      turn += 1;
      if (typeof reply === "string") {
        for (const piece of splitForStream(reply)) {
          if (options.signal.aborted) return;
          await sleep(latency);
          yield { type: "chunk", delta: piece };
        }
        yield { type: "message_end", tokensIn: content.length, tokensOut: reply.length };
      } else {
        for (const ev of reply) {
          if (options.signal.aborted) return;
          await sleep(latency);
          yield ev;
        }
        const lastType = reply[reply.length - 1]?.type;
        if (lastType !== "message_end" && lastType !== "error") {
          yield { type: "message_end" };
        }
      }
    },
    async send(_sid, content, _options) {
      await sleep(latency);
      const reply = replies[turn % replies.length];
      turn += 1;
      const text = typeof reply === "string" ? reply : reply.filter((e) => e.type === "chunk").map((e) => e.delta).join("");
      return {
        id: chunk2SXDCXLK_cjs.createId("a"),
        role: "assistant",
        content: text || DEFAULT_REPLY,
        createdAt: Date.now()
      };
    },
    async closeSession(_sid) {
    }
  };
}
chunkOLISEQHS_cjs.__name(createMockTransport, "createMockTransport");
function useChatLightbox() {
  const [state, setState] = React.useState(null);
  const open = React.useCallback((att, gallery) => {
    const list = gallery && gallery.length ? gallery : [att];
    const idx = list.findIndex((a) => a.id === att.id);
    setState({ gallery: list, index: idx === -1 ? 0 : idx });
  }, []);
  const close = React.useCallback(() => setState(null), []);
  return { state, open, close };
}
chunkOLISEQHS_cjs.__name(useChatLightbox, "useChatLightbox");

// src/tools/Chat/core/payload-dispatch.ts
function dispatchToolPayload(matchers, fallback) {
  return (value, kind, call) => {
    for (const m of matchers) {
      if (m.match(value, kind, call)) return m.render(value, kind, call);
    }
    return fallback(value, kind, call);
  };
}
chunkOLISEQHS_cjs.__name(dispatchToolPayload, "dispatchToolPayload");
function isPlainObject(v) {
  return v !== null && typeof v === "object" && !Array.isArray(v);
}
chunkOLISEQHS_cjs.__name(isPlainObject, "isPlainObject");
function isLatLng(v) {
  return isPlainObject(v) && typeof v.lat === "number" && typeof v.lng === "number";
}
chunkOLISEQHS_cjs.__name(isLatLng, "isLatLng");
function isGeoJSONFeatureCollection(v) {
  return isPlainObject(v) && v.type === "FeatureCollection" && Array.isArray(v.features);
}
chunkOLISEQHS_cjs.__name(isGeoJSONFeatureCollection, "isGeoJSONFeatureCollection");
function isStringValue(v) {
  return typeof v === "string";
}
chunkOLISEQHS_cjs.__name(isStringValue, "isStringValue");

// src/tools/Chat/utils/collectImageAttachments.ts
function collectImageAttachments(messages) {
  const out = [];
  for (const m of messages) {
    if (!m.attachments) continue;
    for (const a of m.attachments) {
      if (a.type === "image") out.push(a);
    }
  }
  return out;
}
chunkOLISEQHS_cjs.__name(collectImageAttachments, "collectImageAttachments");
function AudioToggle({
  size = "icon",
  variant = "ghost",
  alwaysShow = false,
  className
}) {
  const muted = chunk2SXDCXLK_cjs.useChatAudioPrefs((s) => s.muted);
  const setMuted = chunk2SXDCXLK_cjs.useChatAudioPrefs((s) => s.setMuted);
  const ctx = chunk2SXDCXLK_cjs.useChatContextOptional();
  if (ctx && !ctx.hasAudio && !alwaysShow) return null;
  const Icon = muted ? lucideReact.VolumeX : lucideReact.Volume2;
  const label = muted ? "Unmute chat sounds" : "Mute chat sounds";
  return /* @__PURE__ */ jsxRuntime.jsx(
    components.Button,
    {
      type: "button",
      variant,
      size,
      onClick: () => setMuted(!muted),
      "aria-label": label,
      "aria-pressed": muted,
      title: label,
      className: lib.cn(size === "icon" ? "h-9 w-9" : "", className),
      children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": true, className: "size-4" })
    }
  );
}
chunkOLISEQHS_cjs.__name(AudioToggle, "AudioToggle");
var LottiePlayerClient = React.lazy(
  () => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer }))
);
var LoadingFallback5 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-gray-300 border-t-gray-900" }),
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: "Loading player..." })
] }) }), "LoadingFallback");
function LottiePlayer(props) {
  return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback5, {}), children: /* @__PURE__ */ jsxRuntime.jsx(LottiePlayerClient, { ...props }) });
}
chunkOLISEQHS_cjs.__name(LottiePlayer, "LottiePlayer");
var DocsLayout = React.lazy(
  () => import('./DocsLayout-N5ZJZPBY.cjs').then((mod) => ({ default: mod.DocsLayout }))
);
var LoadingFallback6 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children: "Loading API Playground..." }) }), "LoadingFallback");
var Playground = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) => {
  return /* @__PURE__ */ jsxRuntime.jsx(chunkQW4RBGHN_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback6, {}), children: /* @__PURE__ */ jsxRuntime.jsx(DocsLayout, {}) }) });
}, "Playground");
var OpenapiViewer_default = Playground;
var CronSchedulerClient = React.lazy(() => import('./CronScheduler.client-WEJF4PWQ.cjs'));
function CronScheduler(props) {
  return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerFallback, {}), children: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerClient, { ...props }) });
}
chunkOLISEQHS_cjs.__name(CronScheduler, "CronScheduler");
function CronSchedulerFallback() {
  return /* @__PURE__ */ jsxRuntime.jsx(
    LoadingFallback,
    {
      minHeight: 120,
      showText: false,
      className: "rounded-lg"
    }
  );
}
chunkOLISEQHS_cjs.__name(CronSchedulerFallback, "CronSchedulerFallback");

// src/tools/CodeEditor/workers/setup.ts
var isSetup = false;
function setupMonacoWorkers(getWorker) {
  if (isSetup || typeof window === "undefined") return;
  if (getWorker) {
    self.MonacoEnvironment = {
      getWorker: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((_workerId, label) => getWorker(label), "getWorker")
    };
  }
  isSetup = true;
}
chunkOLISEQHS_cjs.__name(setupMonacoWorkers, "setupMonacoWorkers");

// src/tools/CodeEditor/hooks/useMonaco.ts
function useMonaco() {
  const [monaco, setMonaco] = React.useState(null);
  const [isLoading, setIsLoading] = React.useState(true);
  const [error, setError] = React.useState(null);
  React.useEffect(() => {
    let mounted = true;
    async function loadMonaco() {
      try {
        setupMonacoWorkers();
        const monacoModule = await import('monaco-editor');
        if (mounted) {
          setMonaco(monacoModule);
          setIsLoading(false);
        }
      } catch (err) {
        if (mounted) {
          setError(err instanceof Error ? err : new Error("Failed to load Monaco Editor"));
          setIsLoading(false);
        }
      }
    }
    chunkOLISEQHS_cjs.__name(loadMonaco, "loadMonaco");
    loadMonaco();
    return () => {
      mounted = false;
    };
  }, []);
  return { monaco, isLoading, error };
}
chunkOLISEQHS_cjs.__name(useMonaco, "useMonaco");
function useEditorTheme(monaco, themeOverride) {
  const appTheme = hooks.useResolvedTheme();
  const registered = React.useRef(false);
  React.useEffect(() => {
    if (!monaco || registered.current) return;
    try {
      const colors = _readCSSColors();
      monaco.editor.defineTheme("app-dark", {
        base: "vs-dark",
        inherit: true,
        rules: [
          { token: "comment", foreground: "6A9955", fontStyle: "italic" },
          { token: "keyword", foreground: "C586C0" },
          { token: "string", foreground: "CE9178" },
          { token: "number", foreground: "B5CEA8" },
          { token: "type", foreground: "4EC9B0" },
          { token: "function", foreground: "DCDCAA" },
          { token: "variable", foreground: "9CDCFE" }
        ],
        colors: {
          "editor.background": colors.background,
          "editor.foreground": colors.foreground,
          "editor.lineHighlightBackground": colors.lineHighlight,
          "editor.selectionBackground": colors.selection,
          "editorCursor.foreground": colors.foreground,
          "editorLineNumber.foreground": colors.mutedForeground,
          "editorWidget.background": colors.card,
          "editorWidget.border": colors.border,
          "input.background": colors.card,
          "dropdown.background": colors.card
        }
      });
      monaco.editor.defineTheme("app-light", {
        base: "vs",
        inherit: true,
        rules: [
          { token: "comment", foreground: "008000", fontStyle: "italic" },
          { token: "keyword", foreground: "AF00DB" },
          { token: "string", foreground: "A31515" },
          { token: "number", foreground: "098658" },
          { token: "type", foreground: "267F99" },
          { token: "function", foreground: "795E26" },
          { token: "variable", foreground: "001080" }
        ],
        colors: {
          "editor.background": colors.backgroundLight,
          "editor.foreground": colors.foregroundLight,
          "editor.lineHighlightBackground": colors.lineHighlightLight,
          "editor.selectionBackground": colors.selectionLight,
          "editorLineNumber.foreground": colors.mutedForegroundLight,
          "editorWidget.background": colors.cardLight,
          "editorWidget.border": colors.borderLight
        }
      });
      registered.current = true;
    } catch {
    }
  }, [monaco]);
  if (themeOverride) return themeOverride;
  if (registered.current) {
    return appTheme === "dark" ? "app-dark" : "app-light";
  }
  return appTheme === "dark" ? "vs-dark" : "vs";
}
chunkOLISEQHS_cjs.__name(useEditorTheme, "useEditorTheme");
function _readCSSColors() {
  const get = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((varName) => {
    if (typeof document === "undefined") return "";
    return getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
  }, "get");
  const hslToHex = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((hsl) => {
    if (!hsl) return "";
    const parts = hsl.split(/\s+/).map((s2) => parseFloat(s2.replace("%", "")));
    if (parts.length < 3 || parts.some(isNaN)) return "";
    const [h, s, l] = [parts[0], parts[1] / 100, parts[2] / 100];
    const a = s * Math.min(l, 1 - l);
    const f = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((n) => {
      const k = (n + h / 30) % 12;
      const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
      return Math.round(255 * color).toString(16).padStart(2, "0");
    }, "f");
    return `#${f(0)}${f(8)}${f(4)}`;
  }, "hslToHex");
  const background = hslToHex(get("--background")) || "#0a0a0a";
  const foreground = hslToHex(get("--foreground")) || "#f5f5f5";
  const card = hslToHex(get("--card")) || "#141414";
  const border = hslToHex(get("--border")) || "#262626";
  const mutedForeground = hslToHex(get("--muted-foreground")) || "#858585";
  const lineHighlight = _adjustBrightness(background, 10);
  const primary = hslToHex(get("--primary"));
  const selection = primary ? _adjustBrightness(primary, -40) : "#264F78";
  return {
    background,
    foreground,
    card,
    border,
    mutedForeground,
    lineHighlight,
    selection,
    // Light variants
    backgroundLight: "#ffffff",
    foregroundLight: "#1a1a1a",
    cardLight: "#ffffff",
    borderLight: "#e5e5e5",
    mutedForegroundLight: "#737373",
    lineHighlightLight: "#f5f5f5",
    selectionLight: "#ADD6FF"
  };
}
chunkOLISEQHS_cjs.__name(_readCSSColors, "_readCSSColors");
function _adjustBrightness(hex, amount) {
  const num = parseInt(hex.replace("#", ""), 16);
  const r = Math.min(255, Math.max(0, (num >> 16 & 255) + amount));
  const g = Math.min(255, Math.max(0, (num >> 8 & 255) + amount));
  const b = Math.min(255, Math.max(0, (num & 255) + amount));
  return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
}
chunkOLISEQHS_cjs.__name(_adjustBrightness, "_adjustBrightness");
var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function Editor2({
  value = "",
  language = "plaintext",
  onChange,
  onMount,
  options = {},
  className = "",
  height = "100%",
  width = "100%",
  autoHeight = false,
  minHeight = 100,
  maxHeight = 600
}, ref) {
  const containerRef = React.useRef(null);
  const editorRef = React.useRef(null);
  const { monaco, isLoading } = useMonaco();
  const resolvedTheme = useEditorTheme(monaco, options.theme);
  const [contentHeight, setContentHeight] = React.useState(null);
  const updateContentHeight = React.useCallback((editor) => {
    if (!autoHeight) return;
    const h = editor.getContentHeight();
    setContentHeight(Math.min(Math.max(h, minHeight), maxHeight));
  }, [autoHeight, minHeight, maxHeight]);
  const isInternalChangeRef = React.useRef(false);
  React.useImperativeHandle(ref, () => ({
    getEditor: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current, "getEditor"),
    getValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.getValue() || "", "getValue"),
    setValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((val) => editorRef.current?.setValue(val), "setValue"),
    focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.focus(), "focus")
  }));
  React.useEffect(() => {
    if (!monaco || !containerRef.current || editorRef.current) return;
    const editor = monaco.editor.create(containerRef.current, {
      value,
      language,
      theme: resolvedTheme,
      fontSize: options.fontSize || 14,
      fontFamily: options.fontFamily || "'Fira Code', 'Consolas', monospace",
      tabSize: options.tabSize || 2,
      insertSpaces: options.insertSpaces !== false,
      wordWrap: options.wordWrap || "on",
      minimap: { enabled: options.minimap !== false },
      lineNumbers: options.lineNumbers || "on",
      readOnly: options.readOnly || false,
      automaticLayout: true,
      scrollBeyondLastLine: autoHeight ? false : false,
      scrollbar: autoHeight ? { vertical: "hidden", horizontal: "auto" } : void 0,
      overviewRulerLanes: autoHeight ? 0 : void 0,
      padding: { top: 16, bottom: 16 },
      renderLineHighlight: "all",
      cursorBlinking: "smooth",
      cursorSmoothCaretAnimation: "on",
      smoothScrolling: true,
      bracketPairColorization: { enabled: true },
      guides: {
        bracketPairs: true,
        indentation: true
      }
    });
    editorRef.current = editor;
    if (onChange) {
      editor.onDidChangeModelContent(() => {
        isInternalChangeRef.current = true;
        onChange(editor.getValue());
      });
    }
    if (autoHeight) {
      editor.onDidContentSizeChange(() => updateContentHeight(editor));
      updateContentHeight(editor);
    }
    onMount?.(editor);
    return () => {
      editor.dispose();
      editorRef.current = null;
    };
  }, [monaco]);
  React.useEffect(() => {
    const editor = editorRef.current;
    if (!editor) return;
    if (isInternalChangeRef.current) {
      isInternalChangeRef.current = false;
      return;
    }
    const currentValue = editor.getValue();
    if (value !== currentValue) {
      const position = editor.getPosition();
      const selections = editor.getSelections();
      editor.setValue(value);
      if (position) {
        editor.setPosition(position);
      }
      if (selections && selections.length > 0) {
        editor.setSelections(selections);
      }
    }
  }, [value]);
  React.useEffect(() => {
    const editor = editorRef.current;
    if (!editor || !monaco) return;
    const model = editor.getModel();
    if (model) {
      monaco.editor.setModelLanguage(model, language);
    }
  }, [language, monaco]);
  React.useEffect(() => {
    const editor = editorRef.current;
    if (!editor) return;
    editor.updateOptions({
      theme: resolvedTheme,
      fontSize: options.fontSize,
      readOnly: options.readOnly,
      minimap: { enabled: options.minimap !== false },
      wordWrap: options.wordWrap,
      lineNumbers: options.lineNumbers
    });
  }, [options, resolvedTheme]);
  if (isLoading) {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        className,
        style: {
          width,
          height,
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          backgroundColor: "#1e1e1e",
          color: "#666"
        },
        children: "Loading editor..."
      }
    );
  }
  const resolvedHeight = autoHeight && contentHeight != null ? contentHeight : height;
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      ref: containerRef,
      className,
      style: {
        width,
        height: resolvedHeight,
        ...autoHeight && { minHeight, maxHeight, overflow: "hidden" }
      }
    }
  );
}, "Editor"));
function DiffEditor({
  original,
  modified,
  language = "plaintext",
  options = {},
  className = "",
  height = "100%"
}) {
  const containerRef = React.useRef(null);
  const editorRef = React.useRef(null);
  const { monaco, isLoading } = useMonaco();
  const resolvedTheme = useEditorTheme(monaco, options.theme);
  React.useEffect(() => {
    if (!monaco || !containerRef.current || editorRef.current) return;
    const editor = monaco.editor.createDiffEditor(containerRef.current, {
      theme: resolvedTheme,
      fontSize: options.fontSize || 14,
      fontFamily: options.fontFamily || "'Fira Code', 'Consolas', monospace",
      readOnly: true,
      automaticLayout: true,
      renderSideBySide: true,
      scrollBeyondLastLine: false,
      minimap: { enabled: false }
    });
    const originalModel = monaco.editor.createModel(original, language);
    const modifiedModel = monaco.editor.createModel(modified, language);
    editor.setModel({
      original: originalModel,
      modified: modifiedModel
    });
    editorRef.current = editor;
    return () => {
      originalModel.dispose();
      modifiedModel.dispose();
      editor.dispose();
      editorRef.current = null;
    };
  }, [monaco]);
  React.useEffect(() => {
    const editor = editorRef.current;
    if (!editor || !monaco) return;
    const model = editor.getModel();
    if (model) {
      model.original.setValue(original);
      model.modified.setValue(modified);
    }
  }, [original, modified, monaco]);
  React.useEffect(() => {
    const editor = editorRef.current;
    if (!editor || !monaco) return;
    const model = editor.getModel();
    if (model) {
      monaco.editor.setModelLanguage(model.original, language);
      monaco.editor.setModelLanguage(model.modified, language);
    }
  }, [language, monaco]);
  if (isLoading) {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        className,
        style: {
          width: "100%",
          height,
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          backgroundColor: "#1e1e1e",
          color: "#666"
        },
        children: "Loading diff editor..."
      }
    );
  }
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      ref: containerRef,
      className,
      style: {
        width: "100%",
        height
      }
    }
  );
}
chunkOLISEQHS_cjs.__name(DiffEditor, "DiffEditor");

// src/tools/CodeEditor/lib/languages.ts
var LANGUAGE_MAP = {
  // Web
  ".html": "html",
  ".htm": "html",
  ".xhtml": "html",
  ".vue": "html",
  ".svelte": "html",
  // CSS
  ".css": "css",
  ".scss": "scss",
  ".sass": "scss",
  ".less": "less",
  // JavaScript/TypeScript
  ".js": "javascript",
  ".mjs": "javascript",
  ".cjs": "javascript",
  ".jsx": "javascript",
  ".ts": "typescript",
  ".tsx": "typescript",
  ".mts": "typescript",
  ".cts": "typescript",
  // Data formats
  ".json": "json",
  ".jsonc": "json",
  ".json5": "json",
  ".yaml": "yaml",
  ".yml": "yaml",
  ".toml": "ini",
  ".xml": "xml",
  ".svg": "xml",
  ".xsl": "xml",
  ".xsd": "xml",
  // Markdown & Documentation
  ".md": "markdown",
  ".mdx": "markdown",
  ".markdown": "markdown",
  ".rst": "restructuredtext",
  ".txt": "plaintext",
  ".text": "plaintext",
  // Programming languages
  ".py": "python",
  ".pyw": "python",
  ".pyi": "python",
  ".rb": "ruby",
  ".rake": "ruby",
  ".gemspec": "ruby",
  ".php": "php",
  ".phtml": "php",
  ".java": "java",
  ".kt": "kotlin",
  ".kts": "kotlin",
  ".scala": "scala",
  ".go": "go",
  ".rs": "rust",
  ".swift": "swift",
  ".c": "c",
  ".h": "c",
  ".cpp": "cpp",
  ".cc": "cpp",
  ".cxx": "cpp",
  ".hpp": "cpp",
  ".hxx": "cpp",
  ".cs": "csharp",
  ".fs": "fsharp",
  ".fsx": "fsharp",
  ".vb": "vb",
  ".lua": "lua",
  ".r": "r",
  ".R": "r",
  ".m": "objective-c",
  ".mm": "objective-c",
  ".pl": "perl",
  ".pm": "perl",
  ".ex": "elixir",
  ".exs": "elixir",
  ".erl": "erlang",
  ".hrl": "erlang",
  ".clj": "clojure",
  ".cljs": "clojure",
  ".cljc": "clojure",
  ".hs": "haskell",
  ".lhs": "haskell",
  ".ml": "fsharp",
  ".mli": "fsharp",
  ".dart": "dart",
  ".groovy": "groovy",
  ".gradle": "groovy",
  ".jl": "julia",
  // Shell & Scripts
  ".sh": "shell",
  ".bash": "shell",
  ".zsh": "shell",
  ".fish": "shell",
  ".ps1": "powershell",
  ".psm1": "powershell",
  ".psd1": "powershell",
  ".bat": "bat",
  ".cmd": "bat",
  // Config files
  ".ini": "ini",
  ".cfg": "ini",
  ".conf": "ini",
  ".properties": "ini",
  ".env": "ini",
  ".gitignore": "ini",
  ".gitattributes": "ini",
  ".editorconfig": "ini",
  ".npmrc": "ini",
  // Database
  ".sql": "sql",
  ".mysql": "mysql",
  ".pgsql": "pgsql",
  ".plsql": "plsql",
  ".redis": "redis",
  // Templates
  ".hbs": "handlebars",
  ".handlebars": "handlebars",
  ".mustache": "handlebars",
  ".ejs": "html",
  ".pug": "pug",
  ".jade": "pug",
  ".twig": "twig",
  ".liquid": "liquid",
  // GraphQL
  ".graphql": "graphql",
  ".gql": "graphql",
  // Docker
  ".dockerfile": "dockerfile",
  // Other
  ".diff": "diff",
  ".patch": "diff",
  ".log": "log",
  ".tex": "latex",
  ".cls": "latex",
  ".sty": "latex",
  ".proto": "protobuf",
  ".sol": "sol",
  ".asm": "mips",
  ".s": "mips",
  ".wasm": "wasm"
};
var FILENAME_MAP = {
  Dockerfile: "dockerfile",
  "docker-compose.yml": "yaml",
  "docker-compose.yaml": "yaml",
  Makefile: "makefile",
  makefile: "makefile",
  Gemfile: "ruby",
  Rakefile: "ruby",
  Jenkinsfile: "groovy",
  Vagrantfile: "ruby",
  ".bashrc": "shell",
  ".bash_profile": "shell",
  ".zshrc": "shell",
  ".profile": "shell",
  ".vimrc": "plaintext",
  ".gitconfig": "ini",
  ".htaccess": "ini",
  "nginx.conf": "ini",
  "package.json": "json",
  "tsconfig.json": "json",
  "jsconfig.json": "json",
  ".prettierrc": "json",
  ".eslintrc": "json",
  "composer.json": "json",
  "Cargo.toml": "ini",
  "go.mod": "go",
  "go.sum": "plaintext",
  "requirements.txt": "plaintext",
  "pyproject.toml": "ini",
  "setup.py": "python",
  "setup.cfg": "ini"
};
function getLanguageByFilename(filename) {
  if (FILENAME_MAP[filename]) {
    return FILENAME_MAP[filename];
  }
  const lastDot = filename.lastIndexOf(".");
  if (lastDot === -1) {
    return "plaintext";
  }
  const extension = filename.slice(lastDot).toLowerCase();
  return LANGUAGE_MAP[extension] || "plaintext";
}
chunkOLISEQHS_cjs.__name(getLanguageByFilename, "getLanguageByFilename");
var EditorContext = React.createContext(null);
function useEditorContext() {
  const context = React.useContext(EditorContext);
  if (!context) {
    throw new Error("useEditorContext must be used within EditorProvider");
  }
  return context;
}
chunkOLISEQHS_cjs.__name(useEditorContext, "useEditorContext");
function EditorProvider({ children, onSave }) {
  const { monaco } = useMonaco();
  const [editor, setEditor] = React.useState(null);
  const [openFiles, setOpenFiles] = React.useState([]);
  const [activeFilePath, setActiveFilePath] = React.useState(null);
  const activeFile = React.useMemo(
    () => openFiles.find((f) => f.path === activeFilePath) || null,
    [openFiles, activeFilePath]
  );
  const openFile = React.useCallback(
    (path, content, language) => {
      setOpenFiles((files) => {
        const existing = files.find((f) => f.path === path);
        if (existing) {
          return files;
        }
        const basename = path.split("/").pop() || path;
        const detectedLanguage = language || getLanguageByFilename(basename);
        const newFile = {
          path,
          content,
          language: detectedLanguage,
          isDirty: false
        };
        return [...files, newFile];
      });
      setActiveFilePath(path);
    },
    []
  );
  const closeFile = React.useCallback(
    (path) => {
      setOpenFiles((files) => {
        const index = files.findIndex((f) => f.path === path);
        if (index === -1) return files;
        const newFiles = files.filter((f) => f.path !== path);
        if (activeFilePath === path && newFiles.length > 0) {
          const newIndex = Math.min(index, newFiles.length - 1);
          setActiveFilePath(newFiles[newIndex].path);
        } else if (newFiles.length === 0) {
          setActiveFilePath(null);
        }
        return newFiles;
      });
    },
    [activeFilePath]
  );
  const setActiveFile = React.useCallback((path) => {
    setActiveFilePath(path);
  }, []);
  const updateContent = React.useCallback((path, content) => {
    setOpenFiles(
      (files) => files.map(
        (f) => f.path === path ? { ...f, content, isDirty: true } : f
      )
    );
  }, []);
  const saveFile = React.useCallback(
    async (path) => {
      const file = openFiles.find((f) => f.path === path);
      if (!file) return;
      if (onSave) {
        await onSave(path, file.content);
      }
      setOpenFiles(
        (files) => files.map(
          (f) => f.path === path ? { ...f, isDirty: false } : f
        )
      );
    },
    [openFiles, onSave]
  );
  const isDirty = React.useCallback(
    (path) => {
      const file = openFiles.find((f) => f.path === path);
      return file?.isDirty || false;
    },
    [openFiles]
  );
  const getContent = React.useCallback(
    (path) => {
      const file = openFiles.find((f) => f.path === path);
      return file?.content || null;
    },
    [openFiles]
  );
  const getFile = React.useCallback(
    (path) => {
      return openFiles.find((f) => f.path === path) || null;
    },
    [openFiles]
  );
  const value = {
    openFiles,
    activeFile,
    monaco,
    editor,
    isReady: monaco !== null && editor !== null,
    openFile,
    closeFile,
    setActiveFile,
    updateContent,
    saveFile,
    isDirty,
    getContent,
    getFile
  };
  return /* @__PURE__ */ jsxRuntime.jsx(EditorContext.Provider, { value, children });
}
chunkOLISEQHS_cjs.__name(EditorProvider, "EditorProvider");
function useEditor() {
  const [editor, setEditorState] = React.useState(null);
  const setEditor = React.useCallback((editorInstance) => {
    setEditorState(editorInstance);
  }, []);
  return {
    editor,
    isReady: editor !== null,
    setEditor
  };
}
chunkOLISEQHS_cjs.__name(useEditor, "useEditor");
function useLanguage(filename) {
  return React.useMemo(() => {
    if (!filename) return "plaintext";
    const basename = filename.split("/").pop() || filename;
    return getLanguageByFilename(basename);
  }, [filename]);
}
chunkOLISEQHS_cjs.__name(useLanguage, "useLanguage");
var MentionList = React.forwardRef(
  ({ items, command }, ref) => {
    const [selectedIndex, setSelectedIndex] = React.useState(0);
    React.useEffect(() => setSelectedIndex(0), [items]);
    const select = React.useCallback(
      (index) => {
        const item = items[index];
        if (item) command(item);
      },
      [items, command]
    );
    React.useImperativeHandle(ref, () => ({
      onKeyDown: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((event) => {
        if (event.key === "ArrowUp") {
          setSelectedIndex((i) => (i + items.length - 1) % items.length);
          return true;
        }
        if (event.key === "ArrowDown") {
          setSelectedIndex((i) => (i + 1) % items.length);
          return true;
        }
        if (event.key === "Enter") {
          select(selectedIndex);
          return true;
        }
        return false;
      }, "onKeyDown")
    }));
    if (items.length === 0) return null;
    return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "markdown-mention-list", children: items.map((item, i) => {
      const isSelected = i === selectedIndex;
      const cls = `markdown-mention-item ${isSelected ? "selected" : ""}`;
      return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: cls, onClick: () => select(i), children: [
        item.thumbnail && /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.thumbnail, alt: "", className: "markdown-mention-avatar" }),
        /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "markdown-mention-info", children: [
          /* @__PURE__ */ jsxRuntime.jsx("span", { className: "markdown-mention-name", children: item.label }),
          item.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "markdown-mention-desc", children: item.description })
        ] })
      ] }, item.id);
    }) });
  }
);
MentionList.displayName = "MentionList";

// src/tools/MarkdownEditor/createMentionSuggestion.ts
function createMentionSuggestion(config) {
  const { maxItems = 5, trigger = "@" } = config;
  return {
    char: trigger,
    items: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ query }) => {
      const q = query.toLowerCase();
      return config.items.filter((item) => item.label.toLowerCase().includes(q)).slice(0, maxItems);
    }, "items"),
    render: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
      let component = null;
      let popup = null;
      let cleanupAutoUpdate = null;
      let getReferenceRect = null;
      const buildVirtualElement = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => ({
        getBoundingClientRect: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
          const rect = getReferenceRect?.();
          return rect ?? new DOMRect(0, 0, 0, 0);
        }, "getBoundingClientRect")
      }), "buildVirtualElement");
      const updatePosition = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
        if (!popup) return;
        const virtualEl = buildVirtualElement();
        void dom.computePosition(virtualEl, popup, {
          placement: "bottom-start",
          middleware: [
            dom.offset(4),
            dom.flip({ fallbackPlacements: ["top-start"] }),
            dom.shift({ padding: 8 })
          ]
        }).then(({ x, y }) => {
          if (!popup) return;
          popup.style.transform = `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;
        });
      }, "updatePosition");
      const teardown = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
        cleanupAutoUpdate?.();
        cleanupAutoUpdate = null;
        popup?.remove();
        popup = null;
        component?.destroy();
        component = null;
        getReferenceRect = null;
      }, "teardown");
      return {
        onStart: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
          component = new react.ReactRenderer(MentionList, {
            props: {
              items: props.items,
              command: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((item) => {
                props.command({ id: item.id, label: item.label });
              }, "command")
            },
            editor: props.editor
          });
          popup = document.createElement("div");
          popup.style.cssText = "position: absolute; top: 0; left: 0; z-index: 99999;";
          popup.appendChild(component.element);
          document.body.appendChild(popup);
          getReferenceRect = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => props.clientRect?.() ?? null, "getReferenceRect");
          const virtualEl = buildVirtualElement();
          cleanupAutoUpdate = dom.autoUpdate(virtualEl, popup, updatePosition);
        }, "onStart"),
        onUpdate: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
          component?.updateProps({
            items: props.items,
            command: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((item) => {
              props.command({ id: item.id, label: item.label });
            }, "command")
          });
          getReferenceRect = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => props.clientRect?.() ?? null, "getReferenceRect");
          updatePosition();
        }, "onUpdate"),
        onKeyDown: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
          if (props.event.key === "Escape") {
            teardown();
            return true;
          }
          return component?.ref?.onKeyDown(props.event) ?? false;
        }, "onKeyDown"),
        onExit: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
          teardown();
        }, "onExit")
      };
    }, "render")
  };
}
chunkOLISEQHS_cjs.__name(createMentionSuggestion, "createMentionSuggestion");

// src/tools/MarkdownEditor/mentionPresets.ts
var escapeMd = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((s) => s.replace(/([\\\[\]()_*~`])/g, "\\$1"), "escapeMd");
var mentionPresets = {
  /** "@Label" — default, ideal for chat where LLMs read the text. */
  plainAt: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((({ label, id }) => `@${label || id}`), "plainAt"),
  /** "Label" — bare label, no @ prefix. */
  plainLabel: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((({ label, id }) => label || id), "plainLabel"),
  /** "[@Label](baseUrl/id)" — clickable markdown link. */
  markdownLink: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((baseUrl) => ({ label, id }) => `[@${escapeMd(label || id)}](${baseUrl}${encodeURIComponent(id)})`, "markdownLink"),
  /** "@[Label](scheme://kind/id)" — Notion / Linear-style custom URI. */
  customUri: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((scheme, kind) => ({ label, id }) => `@[${escapeMd(label || id)}](${scheme}://${kind}/${encodeURIComponent(id)})`, "customUri"),
  /** "<@id>" — Slack-style id-only reference (label dropped — receivers resolve it). */
  slackStyle: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((({ id }) => `<@${id}>`), "slackStyle"),
  /** Inline HTML span — for products that consume markdown with raw HTML allowed. */
  htmlSpan: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((className = "mention") => ({ label, id }) => `<span class="${className}" data-mention-id="${encodeURIComponent(id)}">@${escapeMd(label || id)}</span>`, "htmlSpan")
};
function getMarkdown(editor) {
  const storage = editor.storage.markdown;
  if (!storage?.manager) return editor.getText();
  return storage.manager.serialize(editor.getJSON());
}
chunkOLISEQHS_cjs.__name(getMarkdown, "getMarkdown");
function extractMentionIds(editor) {
  const ids = [];
  editor.state.doc.descendants((node) => {
    if (node.type.name === "mention" && node.attrs.id) {
      ids.push(node.attrs.id);
    }
  });
  return [...new Set(ids)];
}
chunkOLISEQHS_cjs.__name(extractMentionIds, "extractMentionIds");
function MarkdownEditor({
  value,
  onChange,
  placeholder = "Write markdown...",
  minHeight = 120,
  className = "",
  disabled = false,
  showToolbar = true,
  mentions,
  onMentionIdsChange
}) {
  const isExternalUpdate = React.useRef(false);
  const initialMentionsDefinedRef = React.useRef(mentions !== void 0);
  const warnedRef = React.useRef(false);
  if (process.env.NODE_ENV !== "production" && !initialMentionsDefinedRef.current && mentions !== void 0 && !warnedRef.current) {
    warnedRef.current = true;
    console.warn(
      "[MarkdownEditor] `mentions` flipped from undefined to a config after mount. Tiptap only installs the Mention extension on first render \u2014 the @-popover will NOT work for this editor instance. Pass `{ items: [] }` from the very first render and mutate `.items` in place instead."
    );
  }
  const extensions = React.useMemo(() => {
    const exts = [
      StarterKit__default.default.configure({ heading: { levels: [1, 2, 3] } }),
      Placeholder__default.default.configure({ placeholder }),
      markdown.Markdown
    ];
    if (mentions) {
      const renderMarkdown = mentions.renderMarkdown ?? mentionPresets.plainAt;
      exts.push(
        Mention__default.default.extend({
          renderMarkdown(node) {
            const raw = node.attrs;
            const attrs = {
              id: raw?.id ?? "",
              label: raw?.label ?? ""
            };
            if (!attrs.id && !attrs.label) return "";
            return renderMarkdown(attrs);
          }
        }).configure({
          HTMLAttributes: { class: "markdown-mention" },
          suggestion: createMentionSuggestion(mentions),
          renderText: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ node }) => `@${node.attrs.label}`, "renderText")
        })
      );
    }
    return exts;
  }, [placeholder, mentions]);
  const editor = react.useEditor({
    immediatelyRender: false,
    editable: !disabled,
    extensions,
    content: value,
    onUpdate: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ editor: editor2 }) => {
      if (isExternalUpdate.current) return;
      onChange(getMarkdown(editor2));
      if (onMentionIdsChange) {
        onMentionIdsChange(extractMentionIds(editor2));
      }
    }, "onUpdate"),
    editorProps: {
      attributes: {
        class: "markdown-editor-content focus:outline-none text-sm",
        style: `min-height: ${minHeight}px`
      }
    }
  });
  React.useEffect(() => {
    if (!editor) return;
    const current = getMarkdown(editor);
    if (current !== value) {
      isExternalUpdate.current = true;
      editor.commands.setContent(value);
      isExternalUpdate.current = false;
    }
  }, [value, editor]);
  const wrapperClass = `markdown-editor rounded-md border border-input bg-background ${disabled ? "opacity-60" : ""} ${className}`.trim();
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClass, children: [
    showToolbar && editor && /* @__PURE__ */ jsxRuntime.jsx(MarkdownToolbar, { editor }),
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(react.EditorContent, { editor }) })
  ] });
}
chunkOLISEQHS_cjs.__name(MarkdownEditor, "MarkdownEditor");
function MarkdownToolbar({ editor }) {
  const items = React.useMemo(() => [
    { icon: lucideReact.Bold, title: "Bold", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBold().run(), "action"), active: editor.isActive("bold") },
    { icon: lucideReact.Italic, title: "Italic", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleItalic().run(), "action"), active: editor.isActive("italic") },
    { icon: lucideReact.Strikethrough, title: "Strike", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleStrike().run(), "action"), active: editor.isActive("strike") },
    { icon: lucideReact.Code, title: "Code", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleCode().run(), "action"), active: editor.isActive("code") },
    null,
    { icon: lucideReact.Heading1, title: "H1", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleHeading({ level: 1 }).run(), "action"), active: editor.isActive("heading", { level: 1 }) },
    { icon: lucideReact.Heading2, title: "H2", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleHeading({ level: 2 }).run(), "action"), active: editor.isActive("heading", { level: 2 }) },
    { icon: lucideReact.Heading3, title: "H3", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleHeading({ level: 3 }).run(), "action"), active: editor.isActive("heading", { level: 3 }) },
    null,
    { icon: lucideReact.List, title: "Bullet list", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBulletList().run(), "action"), active: editor.isActive("bulletList") },
    { icon: lucideReact.ListOrdered, title: "Ordered list", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleOrderedList().run(), "action"), active: editor.isActive("orderedList") },
    { icon: lucideReact.Quote, title: "Quote", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBlockquote().run(), "action"), active: editor.isActive("blockquote") },
    { icon: lucideReact.Minus, title: "Divider", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().setHorizontalRule().run(), "action"), active: false }
  ], [editor]);
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5 px-2 py-1.5 border-b border-border", children: items.map((item, i) => {
    if (!item) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-border mx-1" }, i);
    const Icon = item.icon;
    const btnClass = `markdown-toolbar-btn ${item.active ? "active" : ""}`;
    return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: item.action, title: item.title, className: btnClass, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { style: { width: 14, height: 14 } }) }, i);
  }) });
}
chunkOLISEQHS_cjs.__name(MarkdownToolbar, "MarkdownToolbar");

Object.defineProperty(exports, "ArrayFieldItemTemplate", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.ArrayFieldItemTemplate; }
});
Object.defineProperty(exports, "ArrayFieldTemplate", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.ArrayFieldTemplate; }
});
Object.defineProperty(exports, "BaseInputTemplate", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.BaseInputTemplate; }
});
Object.defineProperty(exports, "CheckboxWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.CheckboxWidget; }
});
Object.defineProperty(exports, "ColorWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.ColorWidget; }
});
Object.defineProperty(exports, "ErrorListTemplate", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.ErrorListTemplate; }
});
Object.defineProperty(exports, "FieldTemplate", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.FieldTemplate; }
});
Object.defineProperty(exports, "JsonSchemaForm", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.JsonSchemaForm; }
});
Object.defineProperty(exports, "NumberWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.NumberWidget; }
});
Object.defineProperty(exports, "ObjectFieldTemplate", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.ObjectFieldTemplate; }
});
Object.defineProperty(exports, "SelectWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.SelectWidget; }
});
Object.defineProperty(exports, "SliderWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.SliderWidget; }
});
Object.defineProperty(exports, "SwitchWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.SwitchWidget; }
});
Object.defineProperty(exports, "TextWidget", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.TextWidget; }
});
Object.defineProperty(exports, "evaluateDisabledWhen", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.evaluateDisabledWhen; }
});
Object.defineProperty(exports, "getRequiredFields", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.getRequiredFields; }
});
Object.defineProperty(exports, "hasRequiredFields", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.hasRequiredFields; }
});
Object.defineProperty(exports, "mergeDefaults", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.mergeDefaults; }
});
Object.defineProperty(exports, "normalizeFormData", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.normalizeFormData; }
});
Object.defineProperty(exports, "safeJsonParse", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.safeJsonParse; }
});
Object.defineProperty(exports, "safeJsonStringify", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.safeJsonStringify; }
});
Object.defineProperty(exports, "validateRequiredFields", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.validateRequiredFields; }
});
Object.defineProperty(exports, "validateSchema", {
  enumerable: true,
  get: function () { return chunkFEN5S772_cjs.validateSchema; }
});
Object.defineProperty(exports, "useLottie", {
  enumerable: true,
  get: function () { return chunkQJ6GTUCO_cjs.useLottie; }
});
Object.defineProperty(exports, "AudioPlayer", {
  enumerable: true,
  get: function () { return chunkYDPDTOSP_cjs.Player; }
});
Object.defineProperty(exports, "NativeProvider", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.NativeProvider; }
});
Object.defineProperty(exports, "StreamProvider", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.StreamProvider; }
});
Object.defineProperty(exports, "VideoControls", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.VideoControls; }
});
Object.defineProperty(exports, "VideoErrorFallback", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.VideoErrorFallback; }
});
Object.defineProperty(exports, "VideoPlayer", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.VideoPlayer; }
});
Object.defineProperty(exports, "VideoPlayerProvider", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.VideoPlayerProvider; }
});
Object.defineProperty(exports, "VidstackProvider", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.VidstackProvider; }
});
Object.defineProperty(exports, "createVideoErrorFallback", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.createVideoErrorFallback; }
});
Object.defineProperty(exports, "isSimpleStreamSource", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.isSimpleStreamSource; }
});
Object.defineProperty(exports, "resolveFileSource", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.resolveFileSource; }
});
Object.defineProperty(exports, "resolvePlayerMode", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.resolvePlayerMode; }
});
Object.defineProperty(exports, "resolveStreamSource", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.resolveStreamSource; }
});
Object.defineProperty(exports, "useVideoPlayerContext", {
  enumerable: true,
  get: function () { return chunkKNDLV4PI_cjs.useVideoPlayerContext; }
});
Object.defineProperty(exports, "ImageViewer", {
  enumerable: true,
  get: function () { return chunk5I5QNGUG_cjs.ImageViewer; }
});
Object.defineProperty(exports, "generateContentKey", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.generateContentKey; }
});
Object.defineProperty(exports, "useAudioCache", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.useAudioCache; }
});
Object.defineProperty(exports, "useBlobUrlCleanup", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.useBlobUrlCleanup; }
});
Object.defineProperty(exports, "useImageCache", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.useImageCache; }
});
Object.defineProperty(exports, "useMediaCacheStore", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.useMediaCacheStore; }
});
Object.defineProperty(exports, "useVideoCache", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.useVideoCache; }
});
Object.defineProperty(exports, "useVideoPlayerSettings", {
  enumerable: true,
  get: function () { return chunkYW5IVWHQ_cjs.useVideoPlayerSettings; }
});
Object.defineProperty(exports, "CronSchedulerProvider", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.CronSchedulerProvider; }
});
Object.defineProperty(exports, "CustomInput", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.CustomInput; }
});
Object.defineProperty(exports, "DayChips", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.DayChips; }
});
Object.defineProperty(exports, "MonthDayGrid", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.MonthDayGrid; }
});
Object.defineProperty(exports, "SchedulePreview", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.SchedulePreview; }
});
Object.defineProperty(exports, "ScheduleTypeSelector", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.ScheduleTypeSelector; }
});
Object.defineProperty(exports, "TimeSelector", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.TimeSelector; }
});
Object.defineProperty(exports, "buildCron", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.buildCron; }
});
Object.defineProperty(exports, "humanizeCron", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.humanizeCron; }
});
Object.defineProperty(exports, "isValidCron", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.isValidCron; }
});
Object.defineProperty(exports, "parseCron", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.parseCron; }
});
Object.defineProperty(exports, "useCronCustom", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronCustom; }
});
Object.defineProperty(exports, "useCronMonthDays", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronMonthDays; }
});
Object.defineProperty(exports, "useCronPreview", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronPreview; }
});
Object.defineProperty(exports, "useCronScheduler", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronScheduler; }
});
Object.defineProperty(exports, "useCronSchedulerContext", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronSchedulerContext; }
});
Object.defineProperty(exports, "useCronTime", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronTime; }
});
Object.defineProperty(exports, "useCronType", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronType; }
});
Object.defineProperty(exports, "useCronWeekDays", {
  enumerable: true,
  get: function () { return chunk76NNDZH6_cjs.useCronWeekDays; }
});
Object.defineProperty(exports, "Attachments", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.Attachments; }
});
Object.defineProperty(exports, "AttachmentsGrid", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.AttachmentsGrid; }
});
Object.defineProperty(exports, "AttachmentsList", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.AttachmentsList; }
});
Object.defineProperty(exports, "CHAT_EVENT_NAME", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.CHAT_EVENT_NAME; }
});
Object.defineProperty(exports, "CSS_VARS", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.CSS_VARS; }
});
Object.defineProperty(exports, "ChatProvider", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.ChatProvider; }
});
Object.defineProperty(exports, "ChatRoot", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.ChatRoot; }
});
Object.defineProperty(exports, "Composer", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.Composer; }
});
Object.defineProperty(exports, "DEFAULT_LABELS", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.DEFAULT_LABELS; }
});
Object.defineProperty(exports, "DEFAULT_SIDEBAR", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.DEFAULT_SIDEBAR; }
});
Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.DEFAULT_Z_INDEX; }
});
Object.defineProperty(exports, "EmptyState", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.EmptyState; }
});
Object.defineProperty(exports, "ErrorBanner", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.ErrorBanner; }
});
Object.defineProperty(exports, "HOTKEYS", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.HOTKEYS; }
});
Object.defineProperty(exports, "JumpToLatest", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.JumpToLatest; }
});
Object.defineProperty(exports, "LIMITS", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.LIMITS; }
});
Object.defineProperty(exports, "MessageActions", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.MessageActions; }
});
Object.defineProperty(exports, "MessageBubble", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.MessageBubble; }
});
Object.defineProperty(exports, "MessageList", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.MessageList; }
});
Object.defineProperty(exports, "STORAGE_KEYS", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.STORAGE_KEYS; }
});
Object.defineProperty(exports, "Sources", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.Sources; }
});
Object.defineProperty(exports, "StreamingIndicator", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.StreamingIndicator; }
});
Object.defineProperty(exports, "ToolCalls", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.ToolCalls; }
});
Object.defineProperty(exports, "createId", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.createId; }
});
Object.defineProperty(exports, "createTokenBuffer", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.createTokenBuffer; }
});
Object.defineProperty(exports, "deriveInitials", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.deriveInitials; }
});
Object.defineProperty(exports, "getChatLogger", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.getChatLogger; }
});
Object.defineProperty(exports, "initialState", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.initialState; }
});
Object.defineProperty(exports, "reducer", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.reducer; }
});
Object.defineProperty(exports, "resolvePersona", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.resolvePersona; }
});
Object.defineProperty(exports, "useChat", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChat; }
});
Object.defineProperty(exports, "useChatAudio", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatAudio; }
});
Object.defineProperty(exports, "useChatAudioPrefs", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatAudioPrefs; }
});
Object.defineProperty(exports, "useChatComposer", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatComposer; }
});
Object.defineProperty(exports, "useChatContext", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatContext; }
});
Object.defineProperty(exports, "useChatContextOptional", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatContextOptional; }
});
Object.defineProperty(exports, "useChatHistory", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatHistory; }
});
Object.defineProperty(exports, "useChatLayout", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatLayout; }
});
Object.defineProperty(exports, "useChatScroll", {
  enumerable: true,
  get: function () { return chunk2SXDCXLK_cjs.useChatScroll; }
});
Object.defineProperty(exports, "TreeError", {
  enumerable: true,
  get: function () { return chunkYXZ6GU7H_cjs.TreeError; }
});
Object.defineProperty(exports, "TreeSkeleton", {
  enumerable: true,
  get: function () { return chunkYXZ6GU7H_cjs.TreeSkeleton; }
});
Object.defineProperty(exports, "createDemoTree", {
  enumerable: true,
  get: function () { return chunkYXZ6GU7H_cjs.createDemoTree; }
});
Object.defineProperty(exports, "DEFAULT_TREE_APPEARANCE", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.DEFAULT_TREE_APPEARANCE; }
});
Object.defineProperty(exports, "DEFAULT_TREE_LABELS", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.DEFAULT_TREE_LABELS; }
});
Object.defineProperty(exports, "Tree", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeRoot; }
});
Object.defineProperty(exports, "TreeChevron", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeChevron; }
});
Object.defineProperty(exports, "TreeContent", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeContent; }
});
Object.defineProperty(exports, "TreeEmpty", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeEmpty; }
});
Object.defineProperty(exports, "TreeIcon", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeIcon; }
});
Object.defineProperty(exports, "TreeIndentGuides", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeIndentGuides; }
});
Object.defineProperty(exports, "TreeLabel", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeLabel; }
});
Object.defineProperty(exports, "TreeProvider", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeProvider; }
});
Object.defineProperty(exports, "TreeRoot", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeRoot; }
});
Object.defineProperty(exports, "TreeRow", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeRow; }
});
Object.defineProperty(exports, "TreeSearchInput", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.TreeSearchInput; }
});
Object.defineProperty(exports, "appearanceToStyle", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.appearanceToStyle; }
});
Object.defineProperty(exports, "clearTreeState", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.clearTreeState; }
});
Object.defineProperty(exports, "createChildCache", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.createChildCache; }
});
Object.defineProperty(exports, "flattenTree", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.flattenTree; }
});
Object.defineProperty(exports, "loadTreeState", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.loadTreeState; }
});
Object.defineProperty(exports, "resolveAppearance", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.resolveAppearance; }
});
Object.defineProperty(exports, "resolveChildren", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.resolveChildren; }
});
Object.defineProperty(exports, "saveTreeState", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.saveTreeState; }
});
Object.defineProperty(exports, "useTreeActions", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeActions; }
});
Object.defineProperty(exports, "useTreeContext", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeContext; }
});
Object.defineProperty(exports, "useTreeExpansion", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeExpansion; }
});
Object.defineProperty(exports, "useTreeFocus", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeFocus; }
});
Object.defineProperty(exports, "useTreeKeyboard", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeKeyboard; }
});
Object.defineProperty(exports, "useTreeLabels", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeLabels; }
});
Object.defineProperty(exports, "useTreeRows", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeRows; }
});
Object.defineProperty(exports, "useTreeSearch", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeSearch; }
});
Object.defineProperty(exports, "useTreeSelection", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeSelection; }
});
Object.defineProperty(exports, "useTreeTypeAhead", {
  enumerable: true,
  get: function () { return chunkIEEAENLX_cjs.useTreeTypeAhead; }
});
Object.defineProperty(exports, "MarkdownMessage", {
  enumerable: true,
  get: function () { return chunkB5AWZOHJ_cjs.MarkdownMessage; }
});
Object.defineProperty(exports, "Mermaid", {
  enumerable: true,
  get: function () { return chunkB5AWZOHJ_cjs.Mermaid_default; }
});
Object.defineProperty(exports, "PrettyCode", {
  enumerable: true,
  get: function () { return chunkB5AWZOHJ_cjs.PrettyCode_default; }
});
Object.defineProperty(exports, "extractTextFromChildren", {
  enumerable: true,
  get: function () { return chunkB5AWZOHJ_cjs.extractTextFromChildren; }
});
Object.defineProperty(exports, "useCollapsibleContent", {
  enumerable: true,
  get: function () { return chunkB5AWZOHJ_cjs.useCollapsibleContent; }
});
Object.defineProperty(exports, "JsonTree", {
  enumerable: true,
  get: function () { return chunkSGP7V2UW_cjs.JsonTree_default; }
});
exports.AudioToggle = AudioToggle;
exports.CardLoadingFallback = CardLoadingFallback;
exports.CronScheduler = CronScheduler;
exports.DiffEditor = DiffEditor;
exports.Editor = Editor;
exports.EditorProvider = EditorProvider;
exports.LazyAudioPlayer = LazyPlayer;
exports.LazyChat = LazyChat;
exports.LazyCronScheduler = LazyCronScheduler;
exports.LazyImageViewer = LazyImageViewer;
exports.LazyJsonSchemaForm = LazyJsonSchemaForm;
exports.LazyJsonTree = LazyJsonTree;
exports.LazyLottiePlayer = LazyLottiePlayer;
exports.LazyMapContainer = LazyMapContainer;
exports.LazyMapView = LazyMapView;
exports.LazyMermaid = LazyMermaid;
exports.LazyOpenapiViewer = LazyOpenapiViewer;
exports.LazyPrettyCode = LazyPrettyCode;
exports.LazyTree = LazyTree;
exports.LazyVideoPlayer = LazyVideoPlayer;
exports.LazyWrapper = LazyWrapper;
exports.LoadingFallback = LoadingFallback;
exports.LottiePlayer = LottiePlayer;
exports.MapLoadingFallback = MapLoadingFallback;
exports.MarkdownEditor = MarkdownEditor;
exports.OpenapiViewer = OpenapiViewer_default;
exports.Spinner = Spinner;
exports.TransportError = TransportError;
exports.collectImageAttachments = collectImageAttachments;
exports.createHttpTransport = createHttpTransport;
exports.createLazyComponent = createLazyComponent;
exports.createMockTransport = createMockTransport;
exports.dispatchToolPayload = dispatchToolPayload;
exports.isGeoJSONFeatureCollection = isGeoJSONFeatureCollection;
exports.isLatLng = isLatLng;
exports.isPlainObject = isPlainObject;
exports.isStringValue = isStringValue;
exports.mentionPresets = mentionPresets;
exports.parseSSE = parseSSE;
exports.useChatLightbox = useChatLightbox;
exports.useEditor = useEditor;
exports.useEditorContext = useEditorContext;
exports.useLanguage = useLanguage;
exports.useMonaco = useMonaco;
//# sourceMappingURL=index.cjs.map
//# sourceMappingURL=index.cjs.map