import a from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/forEach.js";
import m from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/clone.js";
import h from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/compact.js";
import u from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/flatten.js";
import M from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/map.js";
import E from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/difference.js";
import I from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/isEmpty.js";
import d from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/isArray.js";
import s from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/has.js";
import l from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/includes.js";
function z(e, t) {
  const n = e.tokenTypeIdx;
  return n === t.tokenTypeIdx ? !0 : t.isParent === !0 && t.categoryMatchesMap[n] === !0;
}
function B(e, t) {
  return e.tokenTypeIdx === t.tokenTypeIdx;
}
let i = 1;
const f = {};
function F(e) {
  const t = y(e);
  x(t), P(t), C(t), a(t, (n) => {
    n.isParent = n.categoryMatches.length > 0;
  });
}
function y(e) {
  let t = m(e), n = e, o = !0;
  for (; o; ) {
    n = h(u(M(n, (g) => g.CATEGORIES)));
    const r = E(n, t);
    t = t.concat(r), I(r) ? o = !1 : n = r;
  }
  return t;
}
function x(e) {
  a(e, (t) => {
    S(t) || (f[i] = t, t.tokenTypeIdx = i++), c(t) && !d(t.CATEGORIES) && (t.CATEGORIES = [t.CATEGORIES]), c(t) || (t.CATEGORIES = []), A(t) || (t.categoryMatches = []), G(t) || (t.categoryMatchesMap = {});
  });
}
function C(e) {
  a(e, (t) => {
    t.categoryMatches = [], a(t.categoryMatchesMap, (n, o) => {
      t.categoryMatches.push(f[o].tokenTypeIdx);
    });
  });
}
function P(e) {
  a(e, (t) => {
    p([], t);
  });
}
function p(e, t) {
  a(e, (n) => {
    t.categoryMatchesMap[n.tokenTypeIdx] = !0;
  }), a(t.CATEGORIES, (n) => {
    const o = e.concat(t);
    l(o, n) || p(o, n);
  });
}
function S(e) {
  return s(e, "tokenTypeIdx");
}
function c(e) {
  return s(e, "CATEGORIES");
}
function A(e) {
  return s(e, "categoryMatches");
}
function G(e) {
  return s(e, "categoryMatchesMap");
}
function H(e) {
  return s(e, "tokenTypeIdx");
}
export {
  P as assignCategoriesMapProp,
  C as assignCategoriesTokensProp,
  x as assignTokenDefaultProps,
  F as augmentTokenTypes,
  y as expandCategories,
  c as hasCategoriesProperty,
  G as hasExtendingTokensTypesMapProperty,
  A as hasExtendingTokensTypesProperty,
  S as hasShortKeyProperty,
  H as isTokenType,
  p as singleAssignCategoriesToksMap,
  f as tokenIdxToClass,
  i as tokenShortNameIdx,
  z as tokenStructuredMatcher,
  B as tokenStructuredMatcherNoCategories
};
