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/components/ViewControls.tsx
var ViewControls_exports = {};
__export(ViewControls_exports, {
  ViewControls: () => ViewControls,
  default: () => ViewControls_default
});
module.exports = __toCommonJS(ViewControls_exports);
var import_react = __toESM(require("react"));
var import_classnames = __toESM(require("classnames"));
var import_icons = require("@ant-design/icons");
var import_utils = require("@pisell/utils");
var import_ViewControls = require("./ViewControls.less");
var PREFIX = "pisell-floor-map-layout";
var I18N_VC = "pisell-floor-map-layout.view-controls";
function ViewControls(props) {
  const {
    api,
    config = {},
    scale = 1,
    isFullscreen = false,
    className,
    mapGridVisible = false,
    onToggleMapGrid
  } = props;
  const showZoom = config.showZoom !== false;
  const showReset = config.showReset === true;
  const showFitBounds = config.showFitBounds === true;
  const showFullscreen = config.showFullscreen === true;
  const showGridToggle = config.showGridToggle === true && typeof onToggleMapGrid === "function";
  const scalePercent = Math.round(scale * 100);
  const showToolsCapsule = showReset || showFitBounds || showFullscreen || showGridToggle;
  return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${PREFIX}-view-controls`, className) }, showZoom && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-zoom-stepper` }, /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      type: "button",
      className: `${PREFIX}-view-controls-zoom-stepper-btn`,
      onClick: () => api.zoomOut(),
      "aria-label": import_utils.locales.getText(`${I18N_VC}.zoom-out-aria`)
    },
    /* @__PURE__ */ import_react.default.createElement(import_icons.MinusOutlined, null)
  ), /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}-view-controls-zoom-stepper-value` }, scalePercent, "%"), /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      type: "button",
      className: `${PREFIX}-view-controls-zoom-stepper-btn`,
      onClick: () => api.zoomIn(),
      "aria-label": import_utils.locales.getText(`${I18N_VC}.zoom-in-aria`)
    },
    /* @__PURE__ */ import_react.default.createElement(import_icons.PlusOutlined, null)
  )), showToolsCapsule && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-tools-capsule` }, showReset && /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      type: "button",
      className: `${PREFIX}-view-controls-tool-btn`,
      onClick: () => api.resetTransform(),
      "aria-label": import_utils.locales.getText(`${I18N_VC}.reset-aria`)
    },
    "⟲"
  ), showFitBounds && api.fitBounds && /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      type: "button",
      className: `${PREFIX}-view-controls-tool-btn`,
      onClick: () => api.fitBounds(),
      "aria-label": import_utils.locales.getText(`${I18N_VC}.fit-bounds-aria`)
    },
    "⊞"
  ), showGridToggle && /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      type: "button",
      className: (0, import_classnames.default)(`${PREFIX}-view-controls-tool-btn`, {
        [`${PREFIX}-view-controls-tool-btn--active`]: mapGridVisible
      }),
      onClick: () => onToggleMapGrid(),
      "aria-pressed": mapGridVisible,
      "aria-label": import_utils.locales.getText(
        mapGridVisible ? `${I18N_VC}.grid-hide-aria` : `${I18N_VC}.grid-show-aria`
      )
    },
    /* @__PURE__ */ import_react.default.createElement(import_icons.BorderInnerOutlined, null)
  ), showFullscreen && api.toggleFullscreen && /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      type: "button",
      className: `${PREFIX}-view-controls-tool-btn`,
      onClick: () => api.toggleFullscreen(),
      "aria-label": import_utils.locales.getText(
        isFullscreen ? `${I18N_VC}.fullscreen-exit-aria` : `${I18N_VC}.fullscreen-aria`
      )
    },
    isFullscreen ? /* @__PURE__ */ import_react.default.createElement(import_icons.FullscreenExitOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.FullscreenOutlined, null)
  )));
}
var ViewControls_default = ViewControls;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ViewControls
});
