import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import { s as styleInject, u as useViewHandler } from './index-bbdfb97a.js';
import { observer } from 'mobx-react-lite';
import { useRef, useEffect } from 'react';
import classnames from 'classnames';
import { useTranslation, useDivaCore } from '@crystaldesign/diva-core';
import TabGroupHorizontal from './index-0e3e6e21.js';
import TabGroupVertical from './index-45703fc2.js';
import TabSearch from './index-98c25b7b.js';
import { jsxs, jsx } from 'react/jsx-runtime';
import 'react-dynamic-multi-render';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/regenerator';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/toConsumableArray';
import '@crystaldesign/diva-utils';
import 'mobx';
import '@crystaldesign/web-planner-logic';
import 'qrcode.react';
import '@babel/runtime/helpers/typeof';
import 'flat';
import 'react-switch';
import 'react-countup';
import './index-ffed620d.js';
import './index-f4e09e5d.js';
import '@babel/runtime/helpers/objectDestructuringEmpty';

var wcConfiguratorSteps = "wcConfigurator-steps-1pUS0";
var portrait = "portrait-uvNtu";
var horizontal = "horizontal-6TCsO";
var wcConfiguratorStepsSplit = "wcConfigurator-steps-split-ATmZ8";
var closeRight = "close-right-rv5xk";
var closeLeft = "close-left-S5bW1";
var vertical = "vertical-HLAFY";
var tabSearchVisibleClass = "tab-search-visible-class-VelST";
var landscape = "landscape-O7G0i";
var wcConfigCloseButton = "wcConfigCloseButton-mkHVY";
var closeButtonHidden = "closeButtonHidden-g1FQc";
var wcConfiguratorStepsContainer = "wcConfigurator-steps-Container-Yb9mE";
var css_248z = ".wcConfigurator-steps-1pUS0 {\n  z-index: 1100;\n}\n\n.portrait-uvNtu.wcConfigurator-steps-1pUS0 {\n  overflow: hidden;\n}\n\n.horizontal-6TCsO.wcConfigurator-steps-1pUS0 {\n  background-color: var(--thirdColor);\n}\n.portrait-uvNtu.horizontal-6TCsO.wcConfigurator-steps-1pUS0 {\n  background-color: rgba(238, 238, 238, 0.95);\n}\n.horizontal-6TCsO .wcConfigurator-steps-split-ATmZ8 {\n  height: 100%;\n  width: calc(100% - 4.3rem);\n  float: left;\n  background: var(--tabGroupBackground);\n}\n\n.horizontal-6TCsO.portrait-uvNtu.close-right-rv5xk .wcConfigurator-steps-split-ATmZ8 {\n  width: calc(100% - 3.6rem);\n}\n.horizontal-6TCsO.portrait-uvNtu.close-left-S5bW1 .wcConfigurator-steps-split-ATmZ8 {\n  width: 100%;\n}\n\n.vertical-HLAFY .wcConfigurator-steps-split-ATmZ8 {\n  height: 100%;\n  width: 100%;\n  background: var(--tabGroupBackground);\n}\n\n.tab-search-visible-class-VelST.vertical-HLAFY .wcConfigurator-steps-split-ATmZ8 {\n  height: calc(100% - 46px);\n}\n.horizontal-6TCsO.landscape-O7G0i .wcConfigurator-steps-split-ATmZ8 {\n  width: 100%;\n}\n\n.wcConfigCloseButton-mkHVY {\n  background-image: url(\"data:image/svg+xml,%3Csvg width%3D%2220%22 height%3D%2220%22 viewBox%3D%220 0 20 20%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M0.5625 0.836182L18.5625 18.8362M18.5625 0.836182L0.5625 18.8362%22 stroke%3D%22%234A4A4A%22 stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E\");\n  background-repeat: no-repeat;\n  background-position: center center;\n  float: left;\n  width: 32px;\n  height: 32px;\n  margin: 12.8px;\n  margin-left: 17.6px;\n  transition: background-color 0.15s ease;\n  border-radius: var(--globalBorderRadius);\n}\n.vertical-HLAFY .wcConfigCloseButton-mkHVY {\n  position: absolute;\n  top: -56px;\n  left: 30px;\n}\n\n.portrait-uvNtu .wcConfigCloseButton-mkHVY {\n  position: absolute;\n  top: 0;\n  margin: 10px;\n}\n\n.portrait-uvNtu.close-right-rv5xk .wcConfigCloseButton-mkHVY {\n  right: 0;\n}\n\n.portrait-uvNtu.close-left-S5bW1 .wcConfigCloseButton-mkHVY {\n  left: -50px;\n}\n\n.wcConfigCloseButton-mkHVY:hover {\n  box-shadow: 0px 1px 4px rgba(68, 49, 49, 0.15);\n}\n\n.wcConfigCloseButton-mkHVY:active {\n  background-color: rgba(197, 197, 197, 0.1);\n}\n\n.wcTabGroupItem-eqGtC:first-child {\n  border-radius: var(--globalBorderRadius) 0 0 var(--globalBorderRadius);\n}\n\n.portrait-uvNtu .wcTabGroupItem-eqGtC:first-child {\n  border-radius: 0px;\n}\n\n.horizontal-6TCsO.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8 {\n  border-radius: var(--globalBorderRadius);\n  border-width: 0px;\n  overflow-x: auto;\n}\n\n.portrait-uvNtu.horizontal-6TCsO.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8 {\n  border-radius: 0px;\n  height: calc(100% - 3px);\n}\n\n.wcConfigur-xKWej .wcConfiguratorator-steps-Container-FGpNz {\n  width: -moz-max-content;\n  width: max-content;\n  height: 100%;\n}\n\n.horizontal-6TCsO .wcConfigurator-steps-split-ATmZ8 {\n  height: 100%;\n  width: calc(100% - 4.3rem);\n  float: left;\n}\n\n.horizontal-6TCsO.closeButtonHidden-g1FQc .wcConfigurator-steps-split-ATmZ8,\n.horizontal-6TCsO.closeButtonHidden-g1FQc.portrait-uvNtu .wcConfigurator-steps-split-ATmZ8,\n.horizontal-6TCsO.closeButtonHidden-g1FQc.landscape-O7G0i .wcConfigurator-steps-split-ATmZ8 {\n  width: 100%;\n  overscroll-behavior: contain;\n}\n\n.horizontal-6TCsO.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8::-webkit-scrollbar {\n  display: none;\n}\n\n/* Hide scrollbar for IE and Edge */\n.horizontal-6TCsO.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8,\n.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8 {\n  -ms-overflow-style: none;\n  scrollbar-width: none; /* Firefox */\n}\n\n.vertical-HLAFY.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8 {\n  overflow: auto;\n\n  /* Hide scrollbar for IE, Edge add Firefox */\n\n  -ms-overflow-style: none;\n  scrollbar-width: none; /* Firefox */\n}\n\n.vertical-HLAFY.wcConfigurator-steps-1pUS0 .wcConfigurator-steps-split-ATmZ8::-webkit-scrollbar {\n  display: none;\n}\n\n.horizontal-6TCsO .wcConfigurator-steps-Container-Yb9mE {\n  width: -moz-max-content;\n  width: max-content;\n  height: 100%;\n  overscroll-behavior: contain;\n}\n\n.vertical-HLAFY .wcConfigurator-steps-Container-Yb9mE {\n  width: 100%;\n  height: 100%;\n}\n\n/* Dark mode – matches backoffice */\n.diva-component-DIVA_BACKOFFICE_NEW .darkmode .horizontal-6TCsO.wcConfigurator-steps-1pUS0,\n.diva-component-DIVA_BACKOFFICE_NEW body.darkmode .horizontal-6TCsO.wcConfigurator-steps-1pUS0 {\n  background-color: rgb(30, 30, 30);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .darkmode .portrait-uvNtu.horizontal-6TCsO.wcConfigurator-steps-1pUS0,\n.diva-component-DIVA_BACKOFFICE_NEW body.darkmode .portrait-uvNtu.horizontal-6TCsO.wcConfigurator-steps-1pUS0 {\n  background-color: rgb(30, 30, 30);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .darkmode .horizontal-6TCsO .wcConfigurator-steps-split-ATmZ8,\n.diva-component-DIVA_BACKOFFICE_NEW .darkmode .vertical-HLAFY .wcConfigurator-Q0f5q -steps-split,\n.diva-component-DIVA_BACKOFFICE_NEW body.darkmode .horizontal-6TCsO .wcConfigurator-steps-split-ATmZ8,\n.diva-component-DIVA_BACKOFFICE_NEW body.darkmode .vertical-HLAFY .wcConfigurator-steps-split-ATmZ8 {\n  background: rgb(20, 20, 20);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .darkmode .wcConfigCloseButton-mkHVY:hover,\n.diva-component-DIVA_BACKOFFICE_NEW body.darkmode .wcConfigCloseButton-mkHVY:hover {\n  box-shadow: 0px 1px 4px rgba(255, 255, 255, 0.1);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .darkmode .wcConfigCloseButton-mkHVY:active,\n.diva-component-DIVA_BACKOFFICE_NEW body.darkmode .wcConfigCloseButton-mkHVY:active {\n  background-color: rgba(255, 255, 255, 0.08);\n}\n";
styleInject(css_248z);

var _excluded = ["className", "showCloseButtonInMobile", "tabSearchClass"];
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; }
var TabGroupContainer = function TabGroupContainer(_ref) {
  var className = _ref.className,
    showCloseButtonInMobile = _ref.showCloseButtonInMobile,
    tabSearchClass = _ref.tabSearchClass,
    props = _objectWithoutProperties(_ref, _excluded);
  var viewHandler = useViewHandler();
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var _useDivaCore = useDivaCore(),
    _useDivaCore$state = _useDivaCore.state,
    isFullscreenComponent = _useDivaCore$state.isFullscreenComponent,
    isMobile = _useDivaCore$state.dimensions.isMobile;
  var closeButtonVisible = isFullscreenComponent && showCloseButtonInMobile !== 'none' && !viewHandler.uiState.isMobilePortrait || viewHandler.tabGroupState.curTabGroupType != 'vertical' && !viewHandler.uiState.ViewConfig.hideCloseButton && viewHandler.eventIsManagedByClient('onWebPlanerClose') && !((!showCloseButtonInMobile || showCloseButtonInMobile == 'none') && viewHandler.getIsInMobileView());
  var tabSearchVisible = viewHandler.uiState.ViewConfig.tabGroupSearchVisible;
  var tabGroupScroller = useRef(null);
  useEffect(function () {
    if (tabGroupScroller.current) {
      viewHandler.tabGroupState.setTabGroupScroller(tabGroupScroller.current);
    }
    return function () {};
  }, [tabGroupScroller]);
  return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({}, props), {}, {
    className: classnames(className, wcConfiguratorSteps, viewHandler.uiState.isMobilePortrait ? portrait : undefined, viewHandler.uiState.isMobileLandscape ? landscape : undefined, viewHandler.tabGroupState.curTabGroupType == 'horizontal' ? horizontal : undefined, viewHandler.tabGroupState.curTabGroupType == 'vertical' ? vertical : undefined, !closeButtonVisible ? closeButtonHidden : undefined, tabSearchVisible ? tabSearchVisibleClass : undefined, isMobile ? showCloseButtonInMobile == 'left' ? closeLeft : closeRight : undefined),
    children: [tabSearchVisible && /*#__PURE__*/jsx(TabSearch, {
      className: tabSearchClass
    }), /*#__PURE__*/jsx("div", {
      className: classnames(wcConfiguratorStepsSplit),
      ref: tabGroupScroller,
      children: /*#__PURE__*/jsxs("div", {
        className: wcConfiguratorStepsContainer,
        children: [viewHandler.tabGroupState.curTabGroupType == 'horizontal' && /*#__PURE__*/jsx(TabGroupHorizontal, {}), viewHandler.tabGroupState.curTabGroupType == 'vertical' && /*#__PURE__*/jsx(TabGroupVertical, {})]
      })
    }), closeButtonVisible && /*#__PURE__*/jsx("div", {
      className: wcConfigCloseButton,
      title: t('configurator.ConfigClose'),
      onClick: viewHandler.onCloseConfigurator
    })]
  }));
};
var TabGroup = observer(TabGroupContainer);

export { TabGroup as default };
