"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.ImportStepper = void 0;
var _designSystem = require("@wix/design-system");
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/ImportButton/ImportStepper.tsx";
const STEPPER_INDEX = {
  upload: 0,
  configuration: 1,
  progress: 2
};
function getStepperSteps(currentStep, t) {
  const activeIndex = STEPPER_INDEX[currentStep];
  return [{
    text: t('cairo.import.stepper.upload')
  }, {
    text: t('cairo.import.stepper.matchFields')
  }].map((step, index) => ({
    ...step,
    type: index < activeIndex ? 'completed' : index > activeIndex ? 'disabled' : 'normal'
  }));
}
function _ImportStepper({
  state,
  removeContentPadding
}) {
  const activeStep = STEPPER_INDEX[state.currentStep];
  const steps = getStepperSteps(state.currentStep, state.translate);
  const contentPadding = removeContentPadding ? undefined : 'SP4';
  const handleStepClick = stepIndex => {
    if (stepIndex < activeStep) {
      state.discardAndGoBack();
    }
  };
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    paddingLeft: contentPadding,
    paddingRight: contentPadding,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 48,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Stepper, {
    activeStep: activeStep,
    steps: steps,
    onClick: handleStepClick,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 49,
      columnNumber: 7
    }
  }));
}
const ImportStepper = exports.ImportStepper = (0, _mobxReactLite.observer)(_ImportStepper);
//# sourceMappingURL=ImportStepper.js.map