var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellFloorMapLayout/utils/floorMapFallbackRender.tsx
var floorMapFallbackRender_exports = {};
__export(floorMapFallbackRender_exports, {
  renderFloorMapFallbackPlaceholder: () => renderFloorMapFallbackPlaceholder,
  renderFloorMapRenderError: () => renderFloorMapRenderError
});
module.exports = __toCommonJS(floorMapFallbackRender_exports);
var import_react = __toESM(require("react"));
var import_types = require("../types");
var import_FloorMapSelectionZoneElement = require("../components/FloorMapSelectionZoneElement");
var import_floorMapElementKindUtils = require("./floorMapElementKindUtils");
var import_FloorMapImageElement = require("../components/FloorMapImageElement");
var import_FloorMapBuiltinShapeElement = require("../components/FloorMapBuiltinShapeElement");
var import_floorMapStageDefaults = require("./floorMapStageDefaults");
function renderFloorMapRenderError(message) {
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      style: {
        padding: 8,
        fontSize: 12,
        color: "#cf1322",
        background: "#fff2f0",
        border: "1px solid #ffccc7",
        borderRadius: 4,
        height: "100%",
        boxSizing: "border-box",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        textAlign: "center",
        wordBreak: "break-word"
      }
    },
    message
  );
}
function renderFloorMapFallbackPlaceholder(item) {
  var _a, _b, _c;
  const kind = (item == null ? void 0 : item.elementKind) || "item";
  const isCircle = (item == null ? void 0 : item.shape) === "circle";
  const isStage = kind === import_types.FLOOR_MAP_STAGE_ELEMENT_KIND;
  const isSelectionZone = kind === import_types.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND;
  const nameText = (item == null ? void 0 : item.name) != null ? String(item.name).trim() : "";
  const fallbackLabel = nameText || kind;
  if (isSelectionZone) {
    return /* @__PURE__ */ import_react.default.createElement(
      import_FloorMapSelectionZoneElement.FloorMapSelectionZoneElement,
      {
        name: item.name ?? ((_a = item._sceneElement) == null ? void 0 : _a.name)
      }
    );
  }
  if ((0, import_floorMapElementKindUtils.isFloorMapImageElementKind)(kind)) {
    const url = (_b = item._sceneElement) == null ? void 0 : _b.imageUrl;
    return /* @__PURE__ */ import_react.default.createElement(
      import_FloorMapImageElement.FloorMapImageElement,
      {
        imageUrl: url,
        name: item.name ?? ((_c = item._sceneElement) == null ? void 0 : _c.name)
      }
    );
  }
  if ((0, import_floorMapElementKindUtils.isFloorMapBuiltinShapeElementKind)(kind)) {
    const el = item._sceneElement;
    return /* @__PURE__ */ import_react.default.createElement(
      import_FloorMapBuiltinShapeElement.FloorMapBuiltinShapeElement,
      {
        builtinShapeKey: el == null ? void 0 : el.builtinShapeKey,
        name: item.name ?? (el == null ? void 0 : el.name),
        fillColor: el == null ? void 0 : el.fillColor,
        strokeColor: el == null ? void 0 : el.strokeColor
      }
    );
  }
  if (isStage) {
    const display = nameText || import_floorMapStageDefaults.STAGE_DECO_DEFAULT.name;
    return /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        style: {
          width: "100%",
          height: "100%",
          boxSizing: "border-box",
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          padding: 8,
          background: "linear-gradient(180deg, #fafafa 0%, #ececec 100%)",
          border: "2px dashed #595959",
          borderRadius: 8,
          fontSize: 15,
          fontWeight: 600,
          color: "#262626",
          textAlign: "center",
          wordBreak: "break-word",
          lineHeight: 1.35,
          overflow: "hidden"
        }
      },
      display
    );
  }
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      style: {
        width: "100%",
        height: "100%",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        background: "#f0f0f0",
        border: "1px solid #d9d9d9",
        borderRadius: isCircle ? "50%" : 4,
        fontSize: 12,
        color: "#666",
        overflow: "hidden",
        padding: 4,
        textAlign: "center",
        wordBreak: "break-word"
      }
    },
    fallbackLabel
  );
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  renderFloorMapFallbackPlaceholder,
  renderFloorMapRenderError
});
