'use strict';
import { createBaseResourceProperties } from '../../utils/base-resource-properties.js';
import { paymentPlanPrices, paymentPlanIds } from '../../../common/payments/payment-constants.js';
import { createPaymentPlan } from './payment-plan-db.js';
import { paymentPlanNames } from '../../../common/subscription-plan/subscription-plan-constants.js';
import { getNewUuid } from '../../../../fd-toolbox/uuids.js';
import { seedPricing } from './pricing-seeding.js';
import { billingIntervals } from '../../../meta/core/resources/enums/payment-enums.js';
import { seedPaymentPlanFeature } from '../../features/payment-plan-feature-data.js';
import { currencyCodes } from '../../../../fd-toolbox/constants/currency-constants.js';
import { featureIds } from '../../../meta/core/resources/features/feature-ids.js';
import { getBooleanEnvSetting } from '../../../../fd-toolbox/infra/env-functions.js';
import { toolboxEnvSettingKeys } from '../../../../fd-toolbox/infra/toolbox-env-setting-keys.js';
import { seedEnterprisePlanFeatures } from '../../features/feature-master-data.js';

var __defProp=Object['defineProperty'],__name=(_0x2157fe,_0x58739d)=>__defProp(_0x2157fe,'name',{'value':_0x58739d,'configurable':!![]});async function seedPaymentPlans(){!getBooleanEnvSetting(toolboxEnvSettingKeys['seedDemoResources'])&&await seedEnterprisePlanFeatures(),await seedThirdPaymentPlan(),await seedAdvancedPaymentPlan();}__name(seedPaymentPlans,'seedPaymentPlans');async function seedDemoPaymentPlans(){await seedBasicPaymentPlan();}__name(seedDemoPaymentPlans,'seedDemoPaymentPlans');async function internalSeedPaymentPlan(_0x12f0ff,_0x2c7045,_0x3088af,_0x3fc9e8,_0x55e545,_0x4889f2,_0x22fba5){const _0x3aefe5={...createBaseResourceProperties(_0x12f0ff),'name':_0x2c7045,'isActive':_0x3088af,'paymentSystemId':_0x3fc9e8,'isContactUs':_0x55e545,'contactUsUrl':_0x4889f2,'pricingDescription':_0x22fba5};return createPaymentPlan(_0x3aefe5);}__name(internalSeedPaymentPlan,'internalSeedPaymentPlan');async function seedPaymentPlan(_0x4b4fa3){const _0x5db462=await internalSeedPaymentPlan(_0x4b4fa3['paymentPlanId']??getNewUuid(),_0x4b4fa3['name'],!![],_0x4b4fa3['paymentSystemId'],!!_0x4b4fa3['contactUsUrl'],_0x4b4fa3['contactUsUrl'],_0x4b4fa3['pricingDescription']),_0x2d39de=_0x4b4fa3['pricingConfigs'];for(const _0x1c4d8c of _0x2d39de){await seedPricing(getNewUuid(),_0x5db462['id'],_0x1c4d8c['price'],_0x1c4d8c['currency'],_0x1c4d8c['billingInterval']);}if(_0x4b4fa3['featureIds'])for(const _0x3690f8 of _0x4b4fa3['featureIds']){await seedPaymentPlanFeature(getNewUuid(),_0x3690f8,_0x5db462['id']);}}__name(seedPaymentPlan,'seedPaymentPlan');async function seedBasicPaymentPlan(){const _0x35129a=[featureIds['userSupportId'],featureIds['contactManagementId'],featureIds['tasksAndRemindersId'],featureIds['calendarAndSchedulingId'],featureIds['analyticsAndReportingId']],_0x4b300e=[{'billingInterval':billingIntervals['month'],'currency':currencyCodes['usd'],'price':paymentPlanPrices['basicPrice']},{'billingInterval':billingIntervals['year'],'currency':currencyCodes['usd'],'price':paymentPlanPrices['basicPrice']}];await seedPaymentPlan({'name':paymentPlanNames['basic'],'pricingConfigs':_0x4b300e,'paymentPlanId':paymentPlanIds['basicId'],'featureIds':_0x35129a});}__name(seedBasicPaymentPlan,'seedBasicPaymentPlan');async function seedThirdPaymentPlan(){const _0x39ad28=[featureIds['unlimitedUsersId'],featureIds['fullCustomizationId'],featureIds['scalableAutomationId'],featureIds['backupAndRecoveryId'],featureIds['advancedAnalyticsAndReportingId']],_0xd46c9d=[{'billingInterval':billingIntervals['month'],'currency':currencyCodes['usd'],'price':paymentPlanPrices['thirdPrice']},{'billingInterval':billingIntervals['year'],'currency':currencyCodes['usd'],'price':paymentPlanPrices['thirdPrice']}];await seedPaymentPlan({'name':paymentPlanNames['professional'],'pricingConfigs':_0xd46c9d,'paymentPlanId':paymentPlanIds['thirdId'],'featureIds':_0x39ad28});}__name(seedThirdPaymentPlan,'seedThirdPaymentPlan');async function seedAdvancedPaymentPlan(){const _0x167e20=[{'billingInterval':billingIntervals['month'],'currency':currencyCodes['usd'],'price':paymentPlanPrices['basicPrice']},{'billingInterval':billingIntervals['year'],'currency':currencyCodes['usd'],'price':paymentPlanPrices['basicPrice']}];await seedPaymentPlan({'name':paymentPlanNames['advanced'],'pricingConfigs':_0x167e20,'contactUsUrl':'#','paymentPlanId':paymentPlanIds['advancedId'],'pricingDescription':'Let`s\x20tailor\x20your\x20package.\x20Contact\x20us\x20for\x20personalized\x20pricing.'});}__name(seedAdvancedPaymentPlan,'seedAdvancedPaymentPlan');

export { internalSeedPaymentPlan, seedDemoPaymentPlans, seedPaymentPlan, seedPaymentPlans };
