"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    CanvasZoomControls: ()=>CanvasZoomControls_CanvasZoomControls
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_react_namespaceObject = require("react");
const external_lucide_react_namespaceObject = require("lucide-react");
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
const external_ToolbarButton_cjs_namespaceObject = require("../ToolbarButton.cjs");
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
const ZOOM_ICON_BUTTON_CLASS = 'text-foreground-muted hover:bg-surface-hover hover:text-foreground [&_svg]:size-[18px] [&_svg]:transition-all hover:[&_svg]:size-[22px] disabled:hover:[&_svg]:size-[18px]';
const CanvasZoomControls_CanvasZoomControls = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(/*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(function({ orientation = 'vertical', fitViewOptions, zoomInOptions, zoomOutOptions, onOrganize, onFitView }, ref) {
    const { zoomIn, zoomOut, fitView } = (0, react_cjs_namespaceObject.useReactFlow)();
    const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
    const isVertical = 'vertical' === orientation;
    const tooltipSide = isVertical ? 'left' : 'top';
    const handleZoomIn = (0, external_react_namespaceObject.useCallback)(()=>{
        zoomIn(zoomInOptions);
    }, [
        zoomIn,
        zoomInOptions
    ]);
    const handleZoomOut = (0, external_react_namespaceObject.useCallback)(()=>{
        zoomOut(zoomOutOptions);
    }, [
        zoomOut,
        zoomOutOptions
    ]);
    const handleFitView = (0, external_react_namespaceObject.useCallback)(()=>{
        if (onFitView) onFitView();
        else fitView(fitViewOptions);
    }, [
        onFitView,
        fitView,
        fitViewOptions
    ]);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        ref: ref,
        "data-testid": "canvas-controls",
        className: `flex gap-1 items-center rounded-xl border border-border-subtle bg-surface-raised text-foreground p-1 backdrop-blur-sm shadow-lg ${isVertical ? 'flex-col' : 'flex-row'}`,
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
                testId: "zoom-in-button",
                label: _({
                    id: 'canvas.zoom.zoom_in',
                    message: 'Zoom in'
                }),
                tooltipSide: tooltipSide,
                onClick: handleZoomIn,
                className: ZOOM_ICON_BUTTON_CLASS,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ZoomIn, {})
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
                testId: "zoom-out-button",
                label: _({
                    id: 'canvas.zoom.zoom_out',
                    message: 'Zoom out'
                }),
                tooltipSide: tooltipSide,
                onClick: handleZoomOut,
                className: ZOOM_ICON_BUTTON_CLASS,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ZoomOut, {})
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
                testId: "fit-to-view-button",
                label: _({
                    id: 'canvas.zoom.fit_to_screen',
                    message: 'Fit to screen'
                }),
                tooltipSide: tooltipSide,
                onClick: handleFitView,
                className: ZOOM_ICON_BUTTON_CLASS,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Scan, {})
            }),
            onOrganize && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ToolbarButton_cjs_namespaceObject.ToolbarButton, {
                testId: "organize-button",
                label: _({
                    id: 'canvas.zoom.tidy_up',
                    message: 'Tidy up'
                }),
                tooltipSide: tooltipSide,
                onClick: onOrganize,
                className: ZOOM_ICON_BUTTON_CLASS,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.BrushCleaning, {})
            })
        ]
    });
}));
CanvasZoomControls_CanvasZoomControls.displayName = 'CanvasZoomControls';
exports.CanvasZoomControls = __webpack_exports__.CanvasZoomControls;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "CanvasZoomControls"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
