'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var colors = require('@ant-design/colors');
var seed = require('../seed.cjs');
var genColorMapToken = require('../shared/genColorMapToken.cjs');
var index = require('../default/index.cjs');
var colors$1 = require('./colors.cjs');

const derivative = (token, mapToken) => {
  const colorPalettes = Object.keys(seed.defaultPresetColors).map((colorKey) => {
    const colors$1 = colors.generate(token[colorKey], { theme: "dark" });
    return new Array(10).fill(1).reduce((prev, _, i) => {
      prev[`${colorKey}-${i + 1}`] = colors$1[i];
      return prev;
    }, {});
  }).reduce((prev, cur) => {
    prev = {
      ...prev,
      ...cur
    };
    return prev;
  }, {});
  const mergedMapToken = mapToken != null ? mapToken : index.default(token);
  return {
    ...mergedMapToken,
    // Dark tokens
    ...colorPalettes,
    // Colors
    ...genColorMapToken.default(token, {
      generateColorPalettes: colors$1.generateColorPalettes,
      generateNeutralColorPalettes: colors$1.generateNeutralColorPalettes
    })
  };
};

exports.default = derivative;
//# sourceMappingURL=index.cjs.map
