import {
  __spreadProps,
  __spreadValues
} from "./chunk-W7FAWX6T.js";

// src/hooks/useNumberInput/utils/getLocaleConfig.ts
var defaultConfig = {
  currencySymbol: "",
  groupSeparator: "",
  decimalSeparator: "",
  prefix: "",
  suffix: ""
};
var getLocaleConfig = (intlConfig) => {
  const { locale, currency } = intlConfig || {};
  const numberFormatter = locale ? new Intl.NumberFormat(
    locale,
    currency ? { currency, style: "currency" } : void 0
  ) : new Intl.NumberFormat();
  return numberFormatter.formatToParts(1000.1).reduce((prev, curr, i) => {
    if (curr.type === "currency") {
      if (i === 0) {
        return __spreadProps(__spreadValues({}, prev), { currencySymbol: curr.value, prefix: curr.value });
      } else {
        return __spreadProps(__spreadValues({}, prev), { currencySymbol: curr.value, suffix: curr.value });
      }
    }
    if (curr.type === "group") {
      return __spreadProps(__spreadValues({}, prev), { groupSeparator: curr.value });
    }
    if (curr.type === "decimal") {
      return __spreadProps(__spreadValues({}, prev), { decimalSeparator: curr.value });
    }
    return prev;
  }, defaultConfig);
};

export {
  getLocaleConfig
};
