function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import React, { useMemo, useCallback, useRef, useState } from 'react';
import classNames from 'classnames';
import { Popconfirm, Modal, Popover } from 'antd';
import PisellBasicGrid from "../PisellBasicGrid";
import GraphicTextCard from "../PisellCards/components/GraphicTextCard";
import { locales as utilsLocales } from '@pisell/utils';
import { getText } from "../../locales";
import "./PisellBatchActionBar.less";

/** 优先 utils；若 utils 返回 key（未命中）则用 materials RecordBoard 再回退 batch-action-bar-* */
function getBatchBarText(key) {
  var _getText;
  var fullKey = "pisell2.salesManagement.batchActionBar.".concat(key);
  var fromUtils = utilsLocales.getText(fullKey);
  if (fromUtils !== fullKey) return fromUtils;
  return (_getText = getText(fullKey)) !== null && _getText !== void 0 ? _getText : getText("batch-action-bar-".concat(key));
}

/**
 * PisellBatchActionBar 批量操作栏组件
 *
 * @description 选择感知型的批量操作组件，用于承载基于选中对象的批量行为操作
 * @author Pisell Team
 * @version 1.0.0
 *
 * @example
 * ```tsx
 * <PisellBatchActionBar
 *   selectedKeys={selectedKeys}
 *   selectedRows={selectedRows}
 *   total={total}
 *   defaultActions={{
 *     selectAll: true,
 *     clear: true,
 *   }}
 *   onSelectAll={() => {
 *     // 全选逻辑
 *   }}
 *   onClear={() => {
 *     // 清空选择逻辑
 *   }}
 * />
 * ```
 */
var PisellBatchActionBar = function PisellBatchActionBar(props) {
  var className = props.className,
    style = props.style,
    selectedKeys = props.selectedKeys,
    selectedRows = props.selectedRows,
    total = props.total,
    currentPageTotal = props.currentPageTotal,
    currentPageKeys = props.currentPageKeys,
    _props$position = props.position,
    position = _props$position === void 0 ? 'float' : _props$position,
    _props$offset = props.offset,
    offset = _props$offset === void 0 ? 0 : _props$offset,
    _props$showSelectedCo = props.showSelectedCount,
    showSelectedCount = _props$showSelectedCo === void 0 ? true : _props$showSelectedCo,
    selectedCountText = props.selectedCountText,
    defaultActions = props.defaultActions,
    _props$actions = props.actions,
    actions = _props$actions === void 0 ? [] : _props$actions,
    actionOrder = props.actionOrder,
    _props$enableOverflow = props.enableOverflow,
    enableOverflow = _props$enableOverflow === void 0 ? true : _props$enableOverflow,
    _props$overflowThresh = props.overflowThreshold,
    overflowThreshold = _props$overflowThresh === void 0 ? 5 : _props$overflowThresh,
    _props$moreText = props.moreText,
    moreText = _props$moreText === void 0 ? getBatchBarText('more') : _props$moreText,
    onSelectAll = props.onSelectAll,
    onClear = props.onClear,
    onInvert = props.onInvert,
    onDelete = props.onDelete,
    deleteConfirmConfig = props.deleteConfirmConfig,
    onActionClick = props.onActionClick;

  /**
   * 用于防止删除按钮重复点击的标记
   */
  var isDeleteModalOpenRef = useRef(false);

  /**
   * "更多"按钮的展开状态
   */
  var _useState = useState(false),
    _useState2 = _slicedToArray(_useState, 2),
    moreExpanded = _useState2[0],
    setMoreExpanded = _useState2[1];

  /**
   * 计算选择状态
   */
  var selectionState = useMemo(function () {
    var selectedCount = selectedKeys.length;
    var hasSelected = selectedCount > 0;
    var isAllSelected = total ? selectedCount === total : false;
    var isCurrentPageAllSelected = function () {
      if (!currentPageKeys || !currentPageTotal) return false;
      return currentPageKeys.every(function (key) {
        return selectedKeys.includes(key);
      });
    }();
    return {
      selectedCount: selectedCount,
      hasSelected: hasSelected,
      isAllSelected: isAllSelected,
      isCurrentPageAllSelected: isCurrentPageAllSelected
    };
  }, [selectedKeys, total, currentPageKeys, currentPageTotal]);

  /**
   * 计算容器样式
   */
  var containerStyle = useMemo(function () {
    var baseStyle = _objectSpread({
      padding: '12px 16px',
      background: 'rgba(29, 41, 57, 0.75)',
      border: 'none',
      borderRadius: '8px',
      color: '#FFFFFF'
    }, style);
    switch (position) {
      case 'sticky-top':
        return _objectSpread(_objectSpread({}, baseStyle), {}, {
          position: 'sticky',
          top: offset || 0,
          zIndex: 100
        });
      case 'sticky-bottom':
        return _objectSpread(_objectSpread({}, baseStyle), {}, {
          position: 'sticky',
          bottom: offset || 0,
          zIndex: 100
        });
      case 'float':
        return _objectSpread(_objectSpread({}, baseStyle), {}, {
          position: 'fixed',
          bottom: offset || 24,
          left: '50%',
          transform: 'translateX(-50%)',
          zIndex: 1000,
          boxShadow: '0 2px 8px rgba(0,0,0,0.3)'
        });
      case 'inline':
      default:
        return baseStyle;
    }
  }, [position, offset, style]);

  /**
   * 计算选中数量提示文案
   */
  var countText = useMemo(function () {
    if (!showSelectedCount) return null;
    var count = selectionState.selectedCount;
    if (typeof selectedCountText === 'function') {
      return selectedCountText(count);
    }
    if (selectedCountText) {
      return selectedCountText.replace('{count}', String(count));
    }

    // 优先 utils locales，无则 materials getText
    var i18nText = getBatchBarText('selectedCount');
    if (typeof i18nText === 'function') {
      return i18nText(count);
    }
    return i18nText || "\u5DF2\u9009\u62E9 ".concat(count, " \u9879");
  }, [showSelectedCount, selectedCountText, selectionState.selectedCount]);

  /**
   * 渲染默认操作按钮
   * @description 固定四个按钮：全选、反选、取消选择、删除
   */
  var renderDefaultActions = useCallback(function () {
    // 如果配置了不显示默认操作按钮，则返回空数组
    if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showDefaultActions) === false) {
      return [];
    }
    var defaultActionNodes = [];

    // 第一个按钮：全选
    // 支持通过 showDefaultActions 或 showSelectAll 控制显示隐藏
    // 如果 showDefaultActions 为 false，则不显示；否则检查 showSelectAll（默认为 true）
    if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showSelectAll) !== false) {
      defaultActionNodes.push( /*#__PURE__*/React.createElement(GraphicTextCard, {
        key: "select-all",
        text: getBatchBarText('selectAll'),
        icon: "pisell2-check-square",
        variant: "horizontal",
        size: "small",
        clickable: true,
        className: "pisell-batch-action-bar-button",
        graphicConfig: {
          iconSize: 24,
          width: 24,
          height: 24,
          background: 'transparent',
          iconColor: '#FFFFFF'
        },
        textConfig: {
          color: '#FFFFFF',
          fontSize: 14
        },
        style: {
          background: '#1B1B1B',
          border: 'none',
          padding: '8px 12px',
          gap: 4,
          minWidth: '120px',
          height: '48px'
        },
        onClick: function onClick() {
          onSelectAll === null || onSelectAll === void 0 || onSelectAll();
        }
      }));
    }

    // 第二个按钮：反选
    // 支持通过 showDefaultActions 或 showInvert 控制显示隐藏
    // 如果 showDefaultActions 为 false，则不显示；否则检查 showInvert（默认为 true）
    if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showInvert) !== false) {
      defaultActionNodes.push( /*#__PURE__*/React.createElement(GraphicTextCard, {
        key: "invert",
        text: getBatchBarText('invert'),
        icon: "pisell2-check-done-01",
        variant: "horizontal",
        size: "small",
        clickable: true,
        className: "pisell-batch-action-bar-button",
        graphicConfig: {
          iconSize: 24,
          width: 24,
          height: 24,
          background: 'transparent',
          iconColor: '#FFFFFF'
        },
        textConfig: {
          color: '#FFFFFF',
          fontSize: 14
        },
        style: {
          background: '#1B1B1B',
          border: 'none',
          padding: '8px 12px',
          gap: 4,
          minWidth: '120px',
          height: '48px'
        },
        onClick: function onClick() {
          onInvert === null || onInvert === void 0 || onInvert();
        }
      }));
    }

    // 第三个按钮：取消选择
    // 支持通过 showDefaultActions 或 showClear 控制显示隐藏
    // 如果 showDefaultActions 为 false，则不显示；否则检查 showClear（默认为 true）
    if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showClear) !== false) {
      defaultActionNodes.push( /*#__PURE__*/React.createElement(GraphicTextCard, {
        key: "clear",
        text: getBatchBarText('clear'),
        icon: "pisell2-square",
        variant: "horizontal",
        size: "small",
        clickable: true,
        className: "pisell-batch-action-bar-button",
        graphicConfig: {
          iconSize: 24,
          width: 24,
          height: 24,
          background: 'transparent',
          iconColor: '#FFFFFF'
        },
        textConfig: {
          color: '#FFFFFF',
          fontSize: 14
        },
        style: {
          background: '#1B1B1B',
          border: 'none',
          padding: '8px 12px',
          gap: 4,
          minWidth: '120px',
          height: '48px'
        },
        onClick: function onClick() {
          onClear === null || onClear === void 0 || onClear();
        }
      }));
    }

    // 第四个按钮：删除
    // 支持通过 showDefaultActions 或 showDelete 控制显示隐藏
    // 如果 showDefaultActions 为 false，则不显示；否则检查 showDelete（默认为 true）
    if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showDelete) !== false) {
      defaultActionNodes.push( /*#__PURE__*/React.createElement(GraphicTextCard, {
        key: "delete",
        text: getBatchBarText('delete'),
        icon: "pisell2-delete_wght300_24px",
        variant: "horizontal",
        size: "small",
        clickable: true,
        className: "pisell-batch-action-bar-button",
        graphicConfig: {
          iconSize: 24,
          width: 24,
          height: 24,
          background: 'transparent',
          iconColor: '#FFFFFF'
        },
        textConfig: {
          color: '#FFFFFF',
          fontSize: 14
        },
        style: {
          background: '#1B1B1B',
          border: 'none',
          padding: '8px 12px',
          gap: 4,
          minWidth: '120px',
          height: '48px'
        },
        onClick: function onClick() {
          var _deleteConfirmConfig$, _deleteConfirmConfig$2, _deleteConfirmConfig$3, _deleteConfirmConfig$4;
          // 防止重复点击弹出多个 Modal
          if (isDeleteModalOpenRef.current) {
            return;
          }

          // 标记 Modal 已打开
          isDeleteModalOpenRef.current = true;

          // 显示确认弹窗
          var i18nContent = getBatchBarText('deleteConfirmContent');
          var deleteContent = typeof i18nContent === 'function' ? i18nContent(selectionState.selectedCount) : i18nContent || "\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684 ".concat(selectionState.selectedCount, " \u9879\u5417\uFF1F");
          Modal.confirm({
            title: (_deleteConfirmConfig$ = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.title) !== null && _deleteConfirmConfig$ !== void 0 ? _deleteConfirmConfig$ : getBatchBarText('deleteConfirmTitle'),
            content: (_deleteConfirmConfig$2 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.description) !== null && _deleteConfirmConfig$2 !== void 0 ? _deleteConfirmConfig$2 : deleteContent,
            okText: (_deleteConfirmConfig$3 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.okText) !== null && _deleteConfirmConfig$3 !== void 0 ? _deleteConfirmConfig$3 : getBatchBarText('deleteConfirmOk'),
            cancelText: (_deleteConfirmConfig$4 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.cancelText) !== null && _deleteConfirmConfig$4 !== void 0 ? _deleteConfirmConfig$4 : getBatchBarText('deleteConfirmCancel'),
            okButtonProps: {
              danger: true
            },
            onOk: function onOk() {
              onDelete === null || onDelete === void 0 || onDelete(selectedKeys, selectedRows);
            },
            onCancel: function onCancel() {
              // Modal 关闭时重置标记
              isDeleteModalOpenRef.current = false;
            },
            afterClose: function afterClose() {
              // Modal 完全关闭后重置标记（兜底）
              isDeleteModalOpenRef.current = false;
            }
          });
        }
      }));
    }
    return defaultActionNodes;
  }, [onSelectAll, onInvert, onClear, onDelete, selectedKeys, selectedRows, selectionState.selectedCount, defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showDefaultActions, defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showSelectAll, defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showInvert, defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showClear, defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showDelete, deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.title, deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.description, deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.okText, deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.cancelText]);

  /**
   * 处理自定义操作按钮点击
   */
  var handleActionClick = useCallback(function (action) {
    if (action.onClick) {
      action.onClick(selectedKeys, selectedRows);
    } else if (onActionClick) {
      onActionClick(action.key, selectedKeys, selectedRows);
    }
  }, [selectedKeys, selectedRows, onActionClick]);

  /**
   * 渲染自定义操作按钮
   */
  var renderCustomActions = useCallback(function () {
    // 过滤可见的按钮
    var visibleActions = actions.filter(function (action) {
      var visible = typeof action.visible === 'function' ? action.visible(selectedKeys, selectedRows) : action.visible !== false;
      return visible;
    });

    // 排序（如果提供了 actionOrder）
    var sortedActions = actionOrder ? visibleActions.sort(function (a, b) {
      var indexA = actionOrder.indexOf(a.key);
      var indexB = actionOrder.indexOf(b.key);
      if (indexA === -1 && indexB === -1) return 0;
      if (indexA === -1) return 1;
      if (indexB === -1) return -1;
      return indexA - indexB;
    }) : visibleActions;
    return sortedActions.map(function (action) {
      var disabled = typeof action.disabled === 'function' ? action.disabled(selectedKeys, selectedRows) : action.disabled || false;
      var card = /*#__PURE__*/React.createElement(GraphicTextCard, {
        key: action.key,
        text: action.label,
        icon: action.icon,
        variant: "horizontal",
        size: action.size || 'small',
        clickable: !disabled && !action.loading,
        disabled: disabled ? {
          value: true
        } : undefined,
        loading: action.loading ? {
          value: true
        } : undefined,
        className: classNames('pisell-batch-action-bar-button', action.className),
        graphicConfig: _objectSpread({
          iconSize: 24,
          width: 24,
          height: 24,
          background: 'transparent',
          iconColor: '#FFFFFF'
        }, typeof action.icon === 'string' ? {} : {}),
        textConfig: {
          color: '#FFFFFF'
        },
        style: _objectSpread({
          background: '#1B1B1B',
          border: 'none',
          padding: '8px 12px',
          minWidth: '120px',
          height: '48px'
        }, action.style),
        onClick: function onClick() {
          return handleActionClick(action);
        }
      });

      // 如果需要确认弹窗
      if (action.confirm) {
        var confirmConfig = _typeof(action.confirm) === 'object' ? action.confirm : {};
        return /*#__PURE__*/React.createElement(Popconfirm, {
          key: action.key,
          title: confirmConfig.title || getBatchBarText('confirmTitle'),
          description: confirmConfig.description,
          okText: confirmConfig.okText || getBatchBarText('deleteConfirmOk'),
          cancelText: confirmConfig.cancelText || getBatchBarText('deleteConfirmCancel'),
          onConfirm: function onConfirm() {
            return handleActionClick(action);
          }
        }, card);
      }
      return card;
    });
  }, [actions, actionOrder, selectedKeys, selectedRows, handleActionClick]);

  /**
   * 合并所有操作按钮
   */
  var allActions = useMemo(function () {
    var defaultActions = renderDefaultActions();
    var customActions = renderCustomActions();
    return [].concat(_toConsumableArray(defaultActions), _toConsumableArray(customActions));
  }, [renderDefaultActions, renderCustomActions]);

  /**
   * 计算溢出处理
   */
  var _useMemo = useMemo(function () {
      if (!enableOverflow || allActions.length <= overflowThreshold) {
        return {
          visibleActions: allActions,
          overflowActions: [],
          hasOverflow: false
        };
      }

      // 简单实现：超过阈值时，将后面的按钮放入溢出菜单
      var visible = allActions.slice(0, overflowThreshold);
      var overflow = allActions.slice(overflowThreshold);
      return {
        visibleActions: visible,
        overflowActions: overflow,
        hasOverflow: true
      };
    }, [enableOverflow, overflowThreshold, allActions]),
    visibleActions = _useMemo.visibleActions,
    overflowActions = _useMemo.overflowActions,
    hasOverflow = _useMemo.hasOverflow;

  /**
   * 渲染更多操作下拉菜单
   */
  var renderMoreActions = useCallback(function () {
    if (!hasOverflow || overflowActions.length === 0) {
      return null;
    }

    // 克隆溢出按钮并修改样式
    var modifiedOverflowActions = overflowActions.map(function (action) {
      if ( /*#__PURE__*/React.isValidElement(action)) {
        var _el$props;
        var el = action;
        var prevStyle = (_el$props = el.props) === null || _el$props === void 0 ? void 0 : _el$props.style;
        return /*#__PURE__*/React.cloneElement(el, {
          style: _objectSpread(_objectSpread({}, prevStyle || {}), {}, {
            minWidth: '160px',
            width: '160px'
          })
        });
      }
      return action;
    });
    var content = /*#__PURE__*/React.createElement(PisellBasicGrid, {
      dataSource: modifiedOverflowActions,
      renderItem: function renderItem(item) {
        return item;
      },
      direction: "vertical",
      gap: 0
    });
    return /*#__PURE__*/React.createElement(Popover, {
      key: "more-actions",
      content: content,
      trigger: "click",
      placement: "topLeft",
      arrow: false,
      open: moreExpanded,
      onOpenChange: setMoreExpanded,
      overlayClassName: "pisell-batch-action-bar__more-popover",
      overlayInnerStyle: {
        padding: 0,
        background: 'rgba(29, 41, 57, 1)'
      }
    }, /*#__PURE__*/React.createElement(GraphicTextCard, {
      text: moreText,
      icon: "pisell2-dots-horizontal",
      variant: "horizontal",
      size: "small",
      clickable: true,
      active: {
        value: moreExpanded
      },
      className: "pisell-batch-action-bar-button",
      graphicConfig: {
        iconSize: 24,
        width: 24,
        height: 24,
        background: 'transparent',
        iconColor: '#FFFFFF'
      },
      textConfig: {
        color: '#FFFFFF',
        fontSize: 14
      },
      style: {
        background: moreExpanded ? 'rgba(93, 63, 159, 1)' : '#1B1B1B',
        border: 'none',
        padding: '8px 12px',
        gap: 4,
        minWidth: '120px',
        height: '48px'
      }
    }));
  }, [hasOverflow, overflowActions, moreText, moreExpanded]);

  /**
   * 合并类名
   */
  var mergedClassName = classNames('pisell-batch-action-bar', className, _defineProperty({}, "pisell-batch-action-bar--".concat(position), position));
  return /*#__PURE__*/React.createElement("div", {
    className: mergedClassName,
    style: containerStyle
  }, countText && /*#__PURE__*/React.createElement("div", {
    className: "pisell-batch-action-bar__count"
  }, countText), /*#__PURE__*/React.createElement(PisellBasicGrid, {
    dataSource: [].concat(_toConsumableArray(visibleActions), [renderMoreActions()]).filter(Boolean),
    renderItem: function renderItem(item) {
      return item;
    },
    direction: "horizontal",
    wrap: "nowrap",
    gap: 12,
    justify: "start",
    align: "center",
    className: "pisell-batch-action-bar__actions"
  }));
};
PisellBatchActionBar.displayName = 'PisellBatchActionBar';
export default PisellBatchActionBar;