var r = Object.defineProperty;
var o = (t, e) => r(t, "name", { value: e, configurable: !0 });
import { copilotPlugin as i } from "./node_modules/.pnpm/@valtown_codemirror-codeium@1.1.1_@codemirror_autocomplete@6.18.6_@codemirror_state@6.5.2_@codemirror_view@6.36.4/node_modules/@valtown/codemirror-codeium/dist/plugin.js";
import { keymap as n } from "./node_modules/.pnpm/@codemirror_view@6.36.4/node_modules/@codemirror/view/dist/index.js";
import { codeiumOtherDocumentsConfig as a } from "./node_modules/.pnpm/@valtown_codemirror-codeium@1.1.1_@codemirror_autocomplete@6.18.6_@codemirror_state@6.5.2_@codemirror_view@6.36.4/node_modules/@valtown/codemirror-codeium/dist/config.js";
import { startCompletion as s } from "./node_modules/.pnpm/@valtown_codemirror-codeium@1.1.1_@codemirror_autocomplete@6.18.6_@codemirror_state@6.5.2_@codemirror_view@6.36.4/node_modules/@valtown/codemirror-codeium/dist/commands.js";
import { Language as m } from "./node_modules/.pnpm/@valtown_codemirror-codeium@1.1.1_@codemirror_autocomplete@6.18.6_@codemirror_state@6.5.2_@codemirror_view@6.36.4/node_modules/@valtown/codemirror-codeium/dist/api/proto/exa/codeium_common_pb/codeium_common_pb.js";
const c = [
  "https://esm.town/v/dinavinter/htmx_layout",
  "https://esm.town/v/dinavinter/cxai/yjs/store",
  "https://esm.town/v/dinavinter/cxai/yjs/faker",
  "https://esm.town/v/dinavinter/cxai/yjs/job",
  "https://esm.town/v/dinavinter/cxai/yjs/last",
  "https://esm.town/v/dinavinter/cxai/yjs/react-hooks",
  "https://esm.town/v/dinavinter/dcom/spotlight"
], p = await Promise.all(c.map(async (t) => ({
  absolutePath: t,
  text: await fetch(t).then((e) => e.text()),
  language: m.JAVASCRIPT,
  editorLanguage: "typescript"
})));
function g() {
  return [
    a.of({
      override: /* @__PURE__ */ o(() => p, "override")
    }),
    i({
      apiKey: "d49954eb-cfba-4992-980f-d8fb37f0e942",
      shouldComplete(t) {
        return t.tokenBefore(["String"]) ? !0 : !t.matchBefore(/(@(?:\w*))(?:[./](\w*))?/);
      }
    }),
    n.of([
      {
        key: "Cmd-k",
        run: s
      }
    ])
  ];
}
o(g, "codeiumCopilot");
const y = `
.cm-ghostText,
.cm-ghostText * {
  opacity: 0.6;
  filter: grayscale(20%);
  cursor: pointer;
}

.cm-ghostText:hover {
  background: #eee;
}
`;
export {
  g as codeiumCopilot,
  y as copilotStyle
};
