import { i as d } from "./monaco-importer.js";
import { languages as a } from "monaco-editor";
import "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
import "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
import "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
import { b as t } from "./arcade-defaults.js";
import { g as c } from "./arcade-service-accessors.js";
import { a as n } from "./sql-expr-defaults.js";
import { g as m } from "./sql-expr-service-accessors.js";
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.0-next.146 */
const s = /* @__PURE__ */ new Set();
function g(e, o) {
  return () => {
    s.has(e) || s.add(e), o();
  };
}
async function F(e) {
  if (s.has(e))
    return;
  (await d()).createModel("", e).dispose();
}
const u = {
  "light-theme": { comment: "#606060", constant: "#9809C8", date: "#296389", identifier: "#0000B3", keyword: "#BF4900", number: "#136D3D", string: "#A31515", operator: "#9809C8", predefined: "#0000B3" },
  "dark-theme": { comment: "#BFBFBF", constant: "#CDBAEA", date: "#97A6CE", identifier: "#9FD4F3", keyword: "#EEAA5A", number: "#AAD04B", string: "#F2877B", operator: "#CDBAEA", predefined: "#9FD4F3" }
};
p();
function p() {
  d().then((e) => {
    ["light", "dark"].forEach((o) => {
      const i = o === "light" ? "vs" : "vs-dark", r = u[`${o}-theme`];
      e.defineTheme(i, {
        base: i,
        inherit: !0,
        rules: [
          { token: "comment.arcgis", foreground: r.comment },
          { token: "constant.arcgis", foreground: r.constant },
          { token: "keyword.arcgis", foreground: r.keyword },
          { token: "identifier.arcgis", foreground: r.identifier },
          { token: "number.arcgis", foreground: r.number },
          { token: "string.arcgis", foreground: r.string },
          { token: "operator.arcgis", foreground: r.operator },
          { token: "predefined.arcgis", foreground: r.predefined }
        ],
        colors: {}
      });
    });
  });
}
a.register({
  id: t.languageId,
  aliases: ["Arcade", "arcade"],
  extensions: [".arc"],
  mimetypes: ["application/arcade"]
});
a.onLanguage(
  t.languageId,
  g(t.languageId, () => {
    c().then((e) => {
      e.setupMode(t);
    }).catch((e) => {
      throw e;
    });
  })
);
a.register({
  id: n.languageId,
  aliases: ["EsiSqlExpression", "sql-expression"],
  extensions: [".sql-expression"],
  mimetypes: ["application/sql-expression"]
});
a.onLanguage(
  n.languageId,
  g(n.languageId, () => {
    m().then((e) => {
      e.setupMode(n);
    }).catch((e) => {
      throw e;
    });
  })
);
export {
  F as s
};
