"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var resizing_plugin_keys_exports = {};
__export(resizing_plugin_keys_exports, {
  clearResizeHoverActive: () => clearResizeHoverActive,
  columnResizingPluginKey: () => columnResizingPluginKey,
  isColumnResizingActive: () => isColumnResizingActive,
  isRowResizingActive: () => isRowResizingActive,
  rowResizingPluginKey: () => rowResizingPluginKey,
  setColumnResizeDragActive: () => setColumnResizeDragActive,
  setColumnResizeHoverActive: () => setColumnResizeHoverActive,
  setRowResizeDragActive: () => setRowResizeDragActive,
  setRowResizeHoverActive: () => setRowResizeHoverActive
});
module.exports = __toCommonJS(resizing_plugin_keys_exports);
var import_state = require("./../../../tiptap/pm/state.js");
const columnResizingPluginKey = new import_state.PluginKey("tableColumnResizing");
const rowResizingPluginKey = new import_state.PluginKey("tableRowResizing");
const resizeInteractionStateByView = /* @__PURE__ */ new WeakMap();
const getResizeInteractionState = (view) => {
  let resizeInteractionState = resizeInteractionStateByView.get(view);
  if (!resizeInteractionState) {
    resizeInteractionState = {
      columnHover: false,
      rowHover: false,
      columnDrag: false,
      rowDrag: false
    };
    resizeInteractionStateByView.set(view, resizeInteractionState);
  }
  return resizeInteractionState;
};
const setColumnResizeHoverActive = (view, active) => {
  getResizeInteractionState(view).columnHover = active;
};
const setRowResizeHoverActive = (view, active) => {
  getResizeInteractionState(view).rowHover = active;
};
const setColumnResizeDragActive = (view, active) => {
  getResizeInteractionState(view).columnDrag = active;
};
const setRowResizeDragActive = (view, active) => {
  getResizeInteractionState(view).rowDrag = active;
};
const clearResizeHoverActive = (view) => {
  const state = resizeInteractionStateByView.get(view);
  if (!state) {
    return;
  }
  state.columnHover = false;
  state.rowHover = false;
};
function isColumnResizingActive(view) {
  const state = resizeInteractionStateByView.get(view);
  return !!(state?.columnHover || state?.columnDrag);
}
function isRowResizingActive(view) {
  const state = resizeInteractionStateByView.get(view);
  return !!(state?.rowHover || state?.rowDrag);
}
//# sourceMappingURL=resizing-plugin-keys.js.map
