import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
import { getTranslations } from 'next-intl/server';

function buildMoneyPriceData(_a) {
    return __awaiter(this, arguments, void 0, function* ({ locale, currency, enabledBillingTypes, }) {
        const t = yield getTranslations({ locale, namespace: 'moneyPrice' });
        const allOptions = t.raw('billingSwitch.options');
        const options = (enabledBillingTypes === null || enabledBillingTypes === void 0 ? void 0 : enabledBillingTypes.length)
            ? allOptions.filter((option) => enabledBillingTypes.includes(option.key))
            : allOptions;
        return {
            title: t('title'),
            subtitle: t('subtitle'),
            billingSwitch: {
                options,
                defaultKey: t('billingSwitch.defaultKey'),
            },
            subscriptionPlans: t.raw('subscription.plans'),
            creditsPlans: t.raw('credits.plans'),
            buttonTexts: t.raw('buttonTexts'),
            currency,
        };
    });
}

export { buildMoneyPriceData };
