'use strict';

var _ConfigProvider = require('antd/lib/config-provider');
var _Tree = require('antd/lib/tree');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
require('react');
var classnames = require('classnames');
var reactI18next = require('react-i18next');
var constants = require('./constants.js');
var index = require('./index-CNZKW5X0.js');
var Down = require('@bigbinary/neeto-icons/Down');
var Right = require('@bigbinary/neeto-icons/Right');
var jsxRuntime = require('react/jsx-runtime');
require('antd/locale/de_DE');
require('antd/locale/en_US');
require('antd/locale/es_ES');
require('antd/locale/fr_FR');
require('antd/locale/nl_NL');
require('antd/locale/pl_PL');
require('antd/locale/pt_PT');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/classCallCheck');
require('@babel/runtime/helpers/createClass');
require('@bigbinary/neeto-cist');
require('qs');
require('ramda');
require('./en-B1i-pQJm.js');
require('./index-BgzkP01c.js');
require('@babel/runtime/helpers/toConsumableArray');
require('dayjs');
require('dayjs/plugin/localeData');
require('dayjs/plugin/utc');
require('dayjs/plugin/weekday');
require('dayjs/plugin/weekOfYear');
require('i18next');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _ConfigProvider__default = /*#__PURE__*/_interopDefault(_ConfigProvider);
var _Tree__default = /*#__PURE__*/_interopDefault(_Tree);
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
var Down__default = /*#__PURE__*/_interopDefault(Down);
var Right__default = /*#__PURE__*/_interopDefault(Right);

var SwitcherIcon = function SwitcherIcon(_ref) {
  var expanded = _ref.expanded;
  return expanded ? /*#__PURE__*/jsxRuntime.jsx(Down__default.default, {
    className: "neeto-ui-relative",
    size: 16
  }) : /*#__PURE__*/jsxRuntime.jsx(Right__default.default, {
    className: "neeto-ui-relative",
    size: 16
  });
};

var _excluded = ["componentToken"];
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), true).forEach(function (r) { _defineProperty__default.default(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 Tree = function Tree(_ref) {
  var componentToken = _ref.componentToken,
    props = _objectWithoutProperties__default.default(_ref, _excluded);
  var _useTranslation = reactI18next.useTranslation(),
    i18n = _useTranslation.i18n;
  return /*#__PURE__*/jsxRuntime.jsx(_ConfigProvider__default.default, {
    locale: constants.ANTD_LOCALE[i18n.language || "en"],
    theme: {
      token: _objectSpread({}, index.ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
      components: {
        Tree: _objectSpread({
          directoryNodeSelectedBg: "rgb(var(--neeto-ui-primary-500))",
          directoryNodeSelectedColor: "rgb(var(--neeto-ui-white))",
          nodeHoverBg: "rgb(var(--neeto-ui-gray-100))",
          nodeSelectedBg: "rgb(var(--neeto-ui-primary-100))"
        }, componentToken)
      }
    },
    children: /*#__PURE__*/jsxRuntime.jsx(_Tree__default.default, _objectSpread(_objectSpread({
      switcherIcon: SwitcherIcon
    }, props), {}, {
      className: classnames__default.default("neeto-ui-tree", props.className)
    }))
  });
};

module.exports = Tree;
//# sourceMappingURL=Tree.js.map
