import { _ as a } from "./ProxyEmit-CLpxDp9Y.js";
const c = {
  function: "Function",
  window: "Window Function",
  aggregate: "Aggregate Function",
  procedure: "Stored Procedure"
}, h = ["position", "name"];
function w(n) {
  return n === "table" || n === "" || n === void 0;
}
function m(n, t) {
  const o = n.filter((e) => w(e.entityType) && t.showTables && (e.parenttype != "p" && !t.showPartitions || t.showPartitions) || e.entityType === "view" && t.showViews || e.entityType === "materialized-view" && t.showViews || Object.keys(c).includes(e.type) && t.showRoutines), { filterQuery: i } = t;
  if (!i)
    return o;
  const r = a(o).filter((e) => a.startsWith(e.name.toLowerCase(), i.toLowerCase())).value(), s = a(o).difference(r).filter((e) => e.name.toLowerCase().includes(i.toLowerCase())).value();
  return a.concat(r, s);
}
function y(n, t, o, i) {
  const r = Math.min(o, i), s = Math.max(o, i), e = Math.min(n, t), u = Math.max(n, t);
  return r >= e && r <= u || s > e && s <= u || r <= e && s >= u;
}
export {
  c as R,
  h as S,
  m as e,
  y as i
};
//# sourceMappingURL=sql_tools-C8sHaFo_.js.map
