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);

// src/components/pisellFloorMapLayout/utils/floorMapSelectionZone.ts
var floorMapSelectionZone_exports = {};
__export(floorMapSelectionZone_exports, {
  computeSelectionZoneMemberIds: () => computeSelectionZoneMemberIds,
  isSelectionZoneItem: () => isSelectionZoneItem,
  rectFullyContains: () => rectFullyContains
});
module.exports = __toCommonJS(floorMapSelectionZone_exports);
var import_types = require("../types");
function isSelectionZoneItem(item) {
  return item.elementKind === import_types.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND;
}
function rectFullyContains(zoneRect, itemRect, tolerance = 0.5) {
  return itemRect.left >= zoneRect.left - tolerance && itemRect.top >= zoneRect.top - tolerance && itemRect.left + itemRect.width <= zoneRect.left + zoneRect.width + tolerance && itemRect.top + itemRect.height <= zoneRect.top + zoneRect.height + tolerance;
}
function computeSelectionZoneMemberIds(zoneId, zoneRect, itemRects) {
  return itemRects.filter(({ item }) => {
    var _a;
    if (item.id === zoneId) return false;
    if (isSelectionZoneItem(item)) return false;
    if ((_a = item._sceneElement) == null ? void 0 : _a.layoutTransformLocked) return false;
    return true;
  }).filter(({ rect }) => rectFullyContains(zoneRect, rect)).map(({ item }) => item.id);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  computeSelectionZoneMemberIds,
  isSelectionZoneItem,
  rectFullyContains
});
