@schematichq/schematic-components 2.31.1 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5413,6 +5413,132 @@ function CompanyBillingProfileResponseDataFromJSONTyped(json, ignoreDiscriminato
5413
5413
  };
5414
5414
  }
5415
5415
 
5416
+ // src/api/checkoutexternal/models/CustomPlanActivationStrategy.ts
5417
+ var CustomPlanActivationStrategy = {
5418
+ Payment: "on_payment",
5419
+ Publish: "on_publish"
5420
+ };
5421
+ function CustomPlanActivationStrategyFromJSON(json) {
5422
+ return CustomPlanActivationStrategyFromJSONTyped(json, false);
5423
+ }
5424
+ function CustomPlanActivationStrategyFromJSONTyped(json, ignoreDiscriminator) {
5425
+ return json;
5426
+ }
5427
+
5428
+ // src/api/checkoutexternal/models/CompanyContextCustomPlanBillingResponseData.ts
5429
+ function CompanyContextCustomPlanBillingResponseDataFromJSON(json) {
5430
+ return CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, false);
5431
+ }
5432
+ function CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5433
+ if (json == null) {
5434
+ return json;
5435
+ }
5436
+ return {
5437
+ activationStrategy: CustomPlanActivationStrategyFromJSON(
5438
+ json["activation_strategy"]
5439
+ ),
5440
+ dueAt: new Date(json["due_at"]),
5441
+ invoiceUrl: json["invoice_url"] == null ? void 0 : json["invoice_url"],
5442
+ planId: json["plan_id"],
5443
+ planName: json["plan_name"] == null ? void 0 : json["plan_name"]
5444
+ };
5445
+ }
5446
+
5447
+ // src/api/checkoutexternal/models/CompanyContextPlanResponseData.ts
5448
+ function CompanyContextPlanResponseDataFromJSON(json) {
5449
+ return CompanyContextPlanResponseDataFromJSONTyped(json, false);
5450
+ }
5451
+ function CompanyContextPlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5452
+ if (json == null) {
5453
+ return json;
5454
+ }
5455
+ return {
5456
+ description: json["description"] == null ? void 0 : json["description"],
5457
+ id: json["id"],
5458
+ includedCreditIds: json["included_credit_ids"],
5459
+ name: json["name"],
5460
+ period: json["period"] == null ? void 0 : json["period"],
5461
+ price: json["price"] == null ? void 0 : json["price"]
5462
+ };
5463
+ }
5464
+
5465
+ // src/api/checkoutexternal/models/CompanyContextScheduledDowngradeResponseData.ts
5466
+ function CompanyContextScheduledDowngradeResponseDataFromJSON(json) {
5467
+ return CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, false);
5468
+ }
5469
+ function CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5470
+ if (json == null) {
5471
+ return json;
5472
+ }
5473
+ return {
5474
+ fromPlanId: json["from_plan_id"],
5475
+ fromPlanName: json["from_plan_name"],
5476
+ toPlanId: json["to_plan_id"],
5477
+ toPlanName: json["to_plan_name"]
5478
+ };
5479
+ }
5480
+
5481
+ // src/api/checkoutexternal/models/CompanyContextSubscriptionResponseData.ts
5482
+ function CompanyContextSubscriptionResponseDataFromJSON(json) {
5483
+ return CompanyContextSubscriptionResponseDataFromJSONTyped(json, false);
5484
+ }
5485
+ function CompanyContextSubscriptionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5486
+ if (json == null) {
5487
+ return json;
5488
+ }
5489
+ return {
5490
+ cancelAt: json["cancel_at"] == null ? void 0 : new Date(json["cancel_at"]),
5491
+ cancelAtPeriodEnd: json["cancel_at_period_end"],
5492
+ currency: CurrencyFromJSON(json["currency"]),
5493
+ nextBillAt: json["next_bill_at"] == null ? void 0 : new Date(json["next_bill_at"]),
5494
+ period: json["period"] == null ? void 0 : json["period"],
5495
+ periodEnd: json["period_end"] == null ? void 0 : new Date(json["period_end"]),
5496
+ status: json["status"],
5497
+ trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
5498
+ };
5499
+ }
5500
+
5501
+ // src/api/checkoutexternal/models/CompanyContextResponseData.ts
5502
+ function CompanyContextResponseDataFromJSON(json) {
5503
+ return CompanyContextResponseDataFromJSONTyped(json, false);
5504
+ }
5505
+ function CompanyContextResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5506
+ if (json == null) {
5507
+ return json;
5508
+ }
5509
+ return {
5510
+ addOns: json["add_ons"].map(
5511
+ CompanyContextPlanResponseDataFromJSON
5512
+ ),
5513
+ customPlanBilling: json["custom_plan_billing"] == null ? void 0 : CompanyContextCustomPlanBillingResponseDataFromJSON(
5514
+ json["custom_plan_billing"]
5515
+ ),
5516
+ id: json["id"],
5517
+ name: json["name"],
5518
+ plan: json["plan"] == null ? void 0 : CompanyContextPlanResponseDataFromJSON(json["plan"]),
5519
+ scheduledDowngrade: json["scheduled_downgrade"] == null ? void 0 : CompanyContextScheduledDowngradeResponseDataFromJSON(
5520
+ json["scheduled_downgrade"]
5521
+ ),
5522
+ subscription: json["subscription"] == null ? void 0 : CompanyContextSubscriptionResponseDataFromJSON(json["subscription"])
5523
+ };
5524
+ }
5525
+
5526
+ // src/api/checkoutexternal/models/CompanyCreditAutoTopupResponseData.ts
5527
+ function CompanyCreditAutoTopupResponseDataFromJSON(json) {
5528
+ return CompanyCreditAutoTopupResponseDataFromJSONTyped(json, false);
5529
+ }
5530
+ function CompanyCreditAutoTopupResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5531
+ if (json == null) {
5532
+ return json;
5533
+ }
5534
+ return {
5535
+ amount: json["amount"] == null ? void 0 : json["amount"],
5536
+ enabled: json["enabled"],
5537
+ selfService: json["self_service"],
5538
+ thresholdCredits: json["threshold_credits"] == null ? void 0 : json["threshold_credits"]
5539
+ };
5540
+ }
5541
+
5416
5542
  // src/api/checkoutexternal/models/CompanyCreditGrantResponseData.ts
5417
5543
  function CompanyCreditGrantResponseDataFromJSON(json) {
5418
5544
  return CompanyCreditGrantResponseDataFromJSONTyped(json, false);
@@ -5470,6 +5596,7 @@ function CompanyCreditBalanceResponseDataFromJSONTyped(json, ignoreDiscriminator
5470
5596
  return json;
5471
5597
  }
5472
5598
  return {
5599
+ autoTopup: json["auto_topup"] == null ? void 0 : CompanyCreditAutoTopupResponseDataFromJSON(json["auto_topup"]),
5473
5600
  composition: json["composition"] == null ? void 0 : CompanyCreditCompositionResponseDataFromJSON(json["composition"]),
5474
5601
  creditDescription: json["credit_description"],
5475
5602
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
@@ -5746,6 +5873,7 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
5746
5873
  metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
5747
5874
  metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
5748
5875
  monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
5876
+ quantityRates: json["quantity_rates"] == null ? void 0 : json["quantity_rates"],
5749
5877
  softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
5750
5878
  usage: json["usage"] == null ? void 0 : json["usage"],
5751
5879
  valueType: EntitlementValueTypeFromJSON(json["value_type"]),
@@ -5830,18 +5958,6 @@ function EntityTraitDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5830
5958
  };
5831
5959
  }
5832
5960
 
5833
- // src/api/checkoutexternal/models/CustomPlanActivationStrategy.ts
5834
- var CustomPlanActivationStrategy = {
5835
- Payment: "on_payment",
5836
- Publish: "on_publish"
5837
- };
5838
- function CustomPlanActivationStrategyFromJSON(json) {
5839
- return CustomPlanActivationStrategyFromJSONTyped(json, false);
5840
- }
5841
- function CustomPlanActivationStrategyFromJSONTyped(json, ignoreDiscriminator) {
5842
- return json;
5843
- }
5844
-
5845
5961
  // src/api/checkoutexternal/models/CustomPlanBillingStatus.ts
5846
5962
  var CustomPlanBillingStatus = {
5847
5963
  Active: "active",
@@ -5878,6 +5994,7 @@ function CustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5878
5994
  ),
5879
5995
  billingCycleAnchor: json["billing_cycle_anchor"] == null ? void 0 : new Date(json["billing_cycle_anchor"]),
5880
5996
  billingStartDate: json["billing_start_date"] == null ? void 0 : new Date(json["billing_start_date"]),
5997
+ checkoutId: json["checkout_id"] == null ? void 0 : json["checkout_id"],
5881
5998
  companyId: json["company_id"],
5882
5999
  createdAt: new Date(json["created_at"]),
5883
6000
  daysUntilDue: json["days_until_due"],
@@ -5887,6 +6004,9 @@ function CustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5887
6004
  paidAt: json["paid_at"] == null ? void 0 : new Date(json["paid_at"]),
5888
6005
  planBillingSource: PlanBillingSourceFromJSON(json["plan_billing_source"]),
5889
6006
  planId: json["plan_id"],
6007
+ problems: json["problems"].map(
6008
+ CheckoutProblemResponseDataFromJSON
6009
+ ),
5890
6010
  prorateFirstPeriod: json["prorate_first_period"] == null ? void 0 : json["prorate_first_period"],
5891
6011
  publishedAt: json["published_at"] == null ? void 0 : new Date(json["published_at"]),
5892
6012
  sendInvoice: json["send_invoice"],
@@ -6047,6 +6167,7 @@ function ConditionFromJSONTyped(json, ignoreDiscriminator) {
6047
6167
  metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
6048
6168
  metricValue: json["metric_value"] == null ? void 0 : json["metric_value"],
6049
6169
  operator: ComparableOperatorFromJSON(json["operator"]),
6170
+ quantityRates: json["quantity_rates"] == null ? void 0 : json["quantity_rates"],
6050
6171
  resourceIds: json["resource_ids"],
6051
6172
  traitDefinition: json["trait_definition"] == null ? void 0 : TraitDefinitionFromJSON(json["trait_definition"]),
6052
6173
  traitValue: json["trait_value"]
@@ -6984,6 +7105,20 @@ function PlanVersionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6984
7105
  };
6985
7106
  }
6986
7107
 
7108
+ // src/api/checkoutexternal/models/PlanCreditVisibility.ts
7109
+ function PlanCreditVisibilityFromJSON(json) {
7110
+ return PlanCreditVisibilityFromJSONTyped(json, false);
7111
+ }
7112
+ function PlanCreditVisibilityFromJSONTyped(json, ignoreDiscriminator) {
7113
+ if (json == null) {
7114
+ return json;
7115
+ }
7116
+ return {
7117
+ creditId: json["credit_id"],
7118
+ visible: json["visible"]
7119
+ };
7120
+ }
7121
+
6987
7122
  // src/api/checkoutexternal/models/CreditUsageAggregation.ts
6988
7123
  function CreditUsageAggregationFromJSON(json) {
6989
7124
  return CreditUsageAggregationFromJSONTyped(json, false);
@@ -7097,6 +7232,9 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
7097
7232
  controlledBy: BillingProviderTypeFromJSON(json["controlled_by"]),
7098
7233
  copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
7099
7234
  createdAt: new Date(json["created_at"]),
7235
+ creditVisibility: json["credit_visibility"] == null ? void 0 : json["credit_visibility"].map(
7236
+ PlanCreditVisibilityFromJSON
7237
+ ),
7100
7238
  credits: json["credits"].map(
7101
7239
  BillingCreditResponseDataFromJSON
7102
7240
  ),
@@ -7984,6 +8122,20 @@ function GetCompanyPaymentMethodsResponseFromJSONTyped(json, ignoreDiscriminator
7984
8122
  };
7985
8123
  }
7986
8124
 
8125
+ // src/api/checkoutexternal/models/GetCompanyResponse.ts
8126
+ function GetCompanyResponseFromJSON(json) {
8127
+ return GetCompanyResponseFromJSONTyped(json, false);
8128
+ }
8129
+ function GetCompanyResponseFromJSONTyped(json, ignoreDiscriminator) {
8130
+ if (json == null) {
8131
+ return json;
8132
+ }
8133
+ return {
8134
+ data: CompanyContextResponseDataFromJSON(json["data"]),
8135
+ params: json["params"]
8136
+ };
8137
+ }
8138
+
7987
8139
  // src/api/checkoutexternal/models/GetCompanyUpcomingInvoiceResponse.ts
7988
8140
  function GetCompanyUpcomingInvoiceResponseFromJSON(json) {
7989
8141
  return GetCompanyUpcomingInvoiceResponseFromJSONTyped(json, false);
@@ -8838,6 +8990,38 @@ var CheckoutexternalApi = class extends BaseAPI {
8838
8990
  const response = await this.getCheckoutTaxIDRaw(initOverrides);
8839
8991
  return await response.value();
8840
8992
  }
8993
+ /**
8994
+ * Get company
8995
+ */
8996
+ async getCompanyRaw(initOverrides) {
8997
+ const queryParameters = {};
8998
+ const headerParameters = {};
8999
+ if (this.configuration && this.configuration.apiKey) {
9000
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
9001
+ "X-Schematic-Api-Key"
9002
+ );
9003
+ }
9004
+ const response = await this.request(
9005
+ {
9006
+ path: `/company`,
9007
+ method: "GET",
9008
+ headers: headerParameters,
9009
+ query: queryParameters
9010
+ },
9011
+ initOverrides
9012
+ );
9013
+ return new JSONApiResponse(
9014
+ response,
9015
+ (jsonValue) => GetCompanyResponseFromJSON(jsonValue)
9016
+ );
9017
+ }
9018
+ /**
9019
+ * Get company
9020
+ */
9021
+ async getCompany(initOverrides) {
9022
+ const response = await this.getCompanyRaw(initOverrides);
9023
+ return await response.value();
9024
+ }
8841
9025
  /**
8842
9026
  * Get company credit balances
8843
9027
  */
@@ -10028,9 +10212,9 @@ function BillingCreditLedgerAuthorityFromJSONTyped4(json, ignoreDiscriminator) {
10028
10212
 
10029
10213
  // src/api/componentspublic/models/Currency.ts
10030
10214
  function CurrencyFromJSON2(json) {
10031
- return CurrencyFromJSONTyped33(json, false);
10215
+ return CurrencyFromJSONTyped34(json, false);
10032
10216
  }
10033
- function CurrencyFromJSONTyped33(json, ignoreDiscriminator) {
10217
+ function CurrencyFromJSONTyped34(json, ignoreDiscriminator) {
10034
10218
  return json;
10035
10219
  }
10036
10220
 
@@ -11105,6 +11289,20 @@ function PlanVersionResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11105
11289
  };
11106
11290
  }
11107
11291
 
11292
+ // src/api/componentspublic/models/PlanCreditVisibility.ts
11293
+ function PlanCreditVisibilityFromJSON2(json) {
11294
+ return PlanCreditVisibilityFromJSONTyped3(json, false);
11295
+ }
11296
+ function PlanCreditVisibilityFromJSONTyped3(json, ignoreDiscriminator) {
11297
+ if (json == null) {
11298
+ return json;
11299
+ }
11300
+ return {
11301
+ creditId: json["credit_id"],
11302
+ visible: json["visible"]
11303
+ };
11304
+ }
11305
+
11108
11306
  // src/api/componentspublic/models/PlanViewPublicResponseData.ts
11109
11307
  function PlanViewPublicResponseDataFromJSON(json) {
11110
11308
  return PlanViewPublicResponseDataFromJSONTyped(json, false);
@@ -11136,6 +11334,9 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
11136
11334
  controlledBy: BillingProviderTypeFromJSON2(json["controlled_by"]),
11137
11335
  copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
11138
11336
  createdAt: new Date(json["created_at"]),
11337
+ creditVisibility: json["credit_visibility"] == null ? void 0 : json["credit_visibility"].map(
11338
+ PlanCreditVisibilityFromJSON2
11339
+ ),
11139
11340
  credits: json["credits"].map(
11140
11341
  BillingCreditResponseDataFromJSON2
11141
11342
  ),
@@ -15014,6 +15215,17 @@ function getResetCadencePeriod(cadence) {
15014
15215
  function isPerLicenseGrant(grant) {
15015
15216
  return grant.scaling === PlanCreditGrantScaling.PerLicense;
15016
15217
  }
15218
+ function getDisplayedPlanCreditGrants(plan) {
15219
+ if (!plan) {
15220
+ return [];
15221
+ }
15222
+ const hidden = new Set(
15223
+ (plan.creditVisibility ?? []).filter((override) => !override.visible).map((override) => override.creditId)
15224
+ );
15225
+ return plan.includedCreditGrants.filter(
15226
+ (grant) => !hidden.has(grant.creditId)
15227
+ );
15228
+ }
15017
15229
  function groupPlanCreditGrants(creditGrants) {
15018
15230
  const map = creditGrants.reduce(
15019
15231
  (acc, grant) => {
@@ -16658,7 +16870,7 @@ var reducer = (state, action) => {
16658
16870
  // src/context/EmbedProvider.tsx
16659
16871
  var import_jsx_runtime4 = require("react/jsx-runtime");
16660
16872
  var getCustomHeaders = (sessionId) => ({
16661
- "X-Schematic-Components-Version": "2.31.1",
16873
+ "X-Schematic-Components-Version": "2.33.0",
16662
16874
  "X-Schematic-Session-ID": sessionId
16663
16875
  });
16664
16876
  var normalizeCurrencyFilter = (filter2) => {
@@ -19485,7 +19697,9 @@ var Plan = ({
19485
19697
  { useSelectedPeriod: true },
19486
19698
  currency
19487
19699
  ) || {};
19488
- const credits = groupPlanCreditGrants(plan.includedCreditGrants);
19700
+ const credits = groupPlanCreditGrants(
19701
+ getDisplayedPlanCreditGrants(plan)
19702
+ );
19489
19703
  const hasUsageBasedEntitlements = (plan.entitlements ?? []).some(
19490
19704
  (entitlement) => !!entitlement.priceBehavior
19491
19705
  );
@@ -19863,8 +20077,8 @@ var Quantity = ({
19863
20077
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
19864
20078
  const unitPriceFontSize = 0.875 * settings.theme.typography.text.fontSize;
19865
20079
  const planCredits = (0, import_react27.useMemo)(
19866
- () => groupPlanCreditGrants(selectedPlan?.includedCreditGrants ?? []),
19867
- [selectedPlan?.includedCreditGrants]
20080
+ () => groupPlanCreditGrants(getDisplayedPlanCreditGrants(selectedPlan)),
20081
+ [selectedPlan]
19868
20082
  );
19869
20083
  const prorationBehavior = data?.checkoutSettings?.prorationBehavior;
19870
20084
  const { billDate: renewalDate } = useNextBillDate();
@@ -21113,16 +21327,17 @@ var CheckoutDialog = ({ top }) => {
21113
21327
  );
21114
21328
  }, [availablePlans, checkoutState, selectedPlanId]);
21115
21329
  const [shouldTrial, setShouldTrial] = (0, import_react30.useState)(false);
21116
- const planCreditGrants = (0, import_react30.useMemo)(() => {
21117
- const grants = mergeCompanyGrants(
21118
- selectedPlan?.includedCreditGrants,
21330
+ const displayedPlanCreditGrants = (0, import_react30.useMemo)(
21331
+ () => getDisplayedPlanCreditGrants(selectedPlan),
21332
+ [selectedPlan]
21333
+ );
21334
+ const planCreditGrants = (0, import_react30.useMemo)(
21335
+ () => mergeCompanyGrants(
21336
+ displayedPlanCreditGrants,
21119
21337
  data?.company?.plan?.includedCreditGrants
21120
- );
21121
- return grants;
21122
- }, [
21123
- selectedPlan?.includedCreditGrants,
21124
- data?.company?.plan?.includedCreditGrants
21125
- ]);
21338
+ ),
21339
+ [displayedPlanCreditGrants, data?.company?.plan?.includedCreditGrants]
21340
+ );
21126
21341
  const [autoTopupConfigs, setAutoTopupConfigs] = (0, import_react30.useState)(() => {
21127
21342
  const initialConfigs = data?.company?.plan?.includedCreditGrants.reduce(
21128
21343
  (acc, companyGrant) => {
@@ -21362,7 +21577,7 @@ var CheckoutDialog = ({ top }) => {
21362
21577
  description: t3("Choose your base plan")
21363
21578
  });
21364
21579
  }
21365
- const hasSelfServiceAutoTopup = selectedPlan?.includedCreditGrants.some(
21580
+ const hasSelfServiceAutoTopup = displayedPlanCreditGrants.some(
21366
21581
  (grant) => isSelfServiceAutoTopupAvailable(grant)
21367
21582
  );
21368
21583
  if (hasSelfServiceAutoTopup) {
@@ -21422,7 +21637,7 @@ var CheckoutDialog = ({ top }) => {
21422
21637
  data?.customCheckoutFields,
21423
21638
  collectTaxId,
21424
21639
  availablePlans,
21425
- selectedPlan?.includedCreditGrants,
21640
+ displayedPlanCreditGrants,
21426
21641
  willTrialWithoutPaymentMethod,
21427
21642
  payInAdvanceEntitlements,
21428
21643
  addOns,
@@ -24062,8 +24277,8 @@ var SubscriptionSidebar = (0, import_react38.forwardRef)(
24062
24277
  data?.company?.plan?.includedCreditGrants
24063
24278
  ]);
24064
24279
  const planCredits = (0, import_react38.useMemo)(
24065
- () => groupPlanCreditGrants(selectedPlan?.includedCreditGrants ?? []),
24066
- [selectedPlan?.includedCreditGrants]
24280
+ () => groupPlanCreditGrants(getDisplayedPlanCreditGrants(selectedPlan)),
24281
+ [selectedPlan]
24067
24282
  );
24068
24283
  const { payInAdvanceEntitlements } = (0, import_react38.useMemo)(() => {
24069
24284
  const payAsYouGoEntitlements = [];
@@ -29604,7 +29819,7 @@ var Plan2 = ({
29604
29819
  const currentPlanIndex = plans.findIndex((plan2) => plan2.current);
29605
29820
  const isActivePlan = plan.current && currentPeriod === selectedPeriod;
29606
29821
  const { price: planPrice, currency: planCurrency } = getPlanPrice(plan, selectedPeriod, { useSelectedPeriod: true }, currency) || {};
29607
- const credits = groupPlanCreditGrants(plan.includedCreditGrants);
29822
+ const credits = groupPlanCreditGrants(getDisplayedPlanCreditGrants(plan));
29608
29823
  const hasUsageBasedEntitlements = (plan.entitlements ?? []).some(
29609
29824
  (entitlement) => !!entitlement.priceBehavior
29610
29825
  );