import { theme } from 'antd';
var themeTokenCache = new Map();
var useThemeTokens = function useThemeTokens(themeInput) {
  var _themeInput$token;
  var useToken = theme.useToken,
    getDesignToken = theme.getDesignToken;
  var _useToken = useToken(),
    antdToken = _useToken.token;
  var overrideColorPrimary = (themeInput === null || themeInput === void 0 || (_themeInput$token = themeInput.token) === null || _themeInput$token === void 0 ? void 0 : _themeInput$token.colorPrimary) || antdToken.colorPrimary;
  var cached = themeTokenCache.get(overrideColorPrimary);
  if (cached) return cached;
  var computed = getDesignToken({
    token: {
      colorPrimary: overrideColorPrimary
    }
  });
  themeTokenCache.set(overrideColorPrimary, computed);
  return computed;
};
export default useThemeTokens;