import { s as styleInject, u as useViewHandler } from './index-bbdfb97a.js';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { useRef, useEffect } from 'react';
import { useTranslation } from '@crystaldesign/diva-core';
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
import '@babel/runtime/helpers/defineProperty';
import 'react-dynamic-multi-render';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/objectWithoutProperties';
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';

var wcTabGroupItem = "wcTabGroupItem-TP7vT";
var portrait = "portrait-3cTAf";
var tablet = "tablet-JA0TU";
var wcActiveStep = "wcActiveStep-y3S9Y";
var wcVisitedStep = "wcVisitedStep-yDCqq";
var wcStepNum = "wcStepNum-6FgQh";
var css_248z = ".wcTabGroupItem-TP7vT {\n  height: 100%;\n  width: -moz-fit-content;\n  width: fit-content;\n  float: left;\n  border: none;\n  transition:\n    background-color 0.3s ease-out,\n    color 0.3s ease-out;\n  line-height: 56px;\n  padding: 0 13px;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  gap: 10px;\n}\n.portrait-3cTAf.wcTabGroupItem-TP7vT {\n  line-height: calc(var(--configuratorTabGroupHeight) - 3px);\n}\n\n.portrait-3cTAf:not(.tablet-JA0TU).wcTabGroupItem-TP7vT {\n  gap: 6px;\n  font-size: 12px;\n  font-weight: 300;\n  padding: 0 10px;\n}\n\n.wcTabGroupItem-TP7vT.wcActiveStep-y3S9Y {\n  color: white;\n  background-color: var(--primaryColor);\n}\n\n.wcActiveStep-y3S9Y.wcTabGroupItem-TP7vT:hover {\n  background-color: var(--primaryColor);\n}\n\n.wcVisitedStep-yDCqq {\n  background-color: #d8d8d8;\n}\n\n.wcTabGroupItem-TP7vT:hover {\n  background-color: #dcdcdc;\n}\n.wcVisitedStep-yDCqq.wcTabGroupItem-TP7vT:hover {\n  background-color: #cacaca;\n}\n\n.wcStepNum-6FgQh {\n  display: inline-block;\n  height: 20px;\n  width: 20px;\n  border: 1px solid white;\n  background-color: white;\n  border-radius: 10px;\n  text-align: center;\n  line-height: 20px;\n  font-size: 14px;\n  color: #6f6f6f;\n}\n\n.portrait-3cTAf:not(.tablet-JA0TU) .wcStepNum-6FgQh {\n  height: 14px;\n  width: 14px;\n  line-height: 14px;\n  font-size: 10px;\n}\n\n.wcActiveStep-y3S9Y .wcStepNum-6FgQh {\n  color: var(--primaryColor);\n  font-weight: 700;\n}\n.wcVisitedStep-yDCqq .wcStepNum-6FgQh {\n  background-image: url(\"data:image/svg+xml,%3Csvg width%3D%2212%22 height%3D%229%22 viewBox%3D%220 0 12 9%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M1.44531 3.49126L5.625 8.09375L10.75 0.953613%22 stroke%3D%22%236F6F6F%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\");\n  background-repeat: no-repeat;\n  background-position: center center;\n  color: transparent;\n}\n\n.portrait-3cTAf:not(.tablet-JA0TU).wcVisitedStep-yDCqq .wcStepNum-6FgQh {\n  background-size: 8px;\n}\n\n.wcVisitedStep-yDCqq .wcStepNum-6FgQh:empty:before {\n  content: '\\200b';\n}\n";
styleInject(css_248z);

var TabGroupItemHorizontalGold = function TabGroupItemHorizontalGold(_ref) {
  var tabGroup = _ref.tabGroup;
  var viewHandler = useViewHandler();
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var tabGroupItemRef = useRef(null);
  var curTabGroup = viewHandler.tabGroupState.curTabGroup;
  useEffect(function () {
    viewHandler.tabGroupState.setTabGroupItems(tabGroup.key, tabGroupItemRef.current);
  }, [tabGroupItemRef]);
  var onTabGroupClick = function onTabGroupClick(tabGroup) {
    window.lastNavigationType = 'TABGROUP_BY_POS_NR';
    viewHandler.tabGroupState.navigateToTabgroupByPosNr(+tabGroup.posNr);
  };
  var isActive = tabGroup.posNr == (curTabGroup === null || curTabGroup === void 0 ? void 0 : curTabGroup.posNr);
  return /*#__PURE__*/jsxs("div", {
    ref: tabGroupItemRef,
    onClick: function onClick(e) {
      e.stopPropagation();
      onTabGroupClick(tabGroup);
    },
    className: classnames(wcTabGroupItem, viewHandler.uiState.isMobilePortrait ? portrait : undefined, viewHandler.uiState.isTablet ? tablet : undefined, tabGroup.title == (curTabGroup === null || curTabGroup === void 0 ? void 0 : curTabGroup.title) && isActive ? wcActiveStep : undefined, viewHandler.tabGroupAlreadyVisited(tabGroup) && !(tabGroup.title == (curTabGroup === null || curTabGroup === void 0 ? void 0 : curTabGroup.title) && isActive) ? wcVisitedStep : undefined),
    children: [viewHandler.uiState.isMobilePortrait ? /*#__PURE__*/jsx(Fragment, {}) : /*#__PURE__*/jsx("span", {
      className: classnames(wcStepNum),
      children: tabGroup.posNr
    }), t('configurator.' + tabGroup.title, tabGroup.title)]
  });
};
var index = observer(TabGroupItemHorizontalGold);

export { index as default };
