@schematichq/schematic-components 2.2.0 → 2.3.1

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.
@@ -4975,6 +4975,46 @@ var JSONApiResponse = class {
4975
4975
  }
4976
4976
  };
4977
4977
 
4978
+ // src/api/checkoutexternal/models/BillingCreditBundleStatus.ts
4979
+ function BillingCreditBundleStatusFromJSON(json) {
4980
+ return BillingCreditBundleStatusFromJSONTyped(json, false);
4981
+ }
4982
+ function BillingCreditBundleStatusFromJSONTyped(json, ignoreDiscriminator) {
4983
+ return json;
4984
+ }
4985
+
4986
+ // src/api/checkoutexternal/models/BillingCreditBundleType.ts
4987
+ function BillingCreditBundleTypeFromJSON(json) {
4988
+ return BillingCreditBundleTypeFromJSONTyped(json, false);
4989
+ }
4990
+ function BillingCreditBundleTypeFromJSONTyped(json, ignoreDiscriminator) {
4991
+ return json;
4992
+ }
4993
+
4994
+ // src/api/checkoutexternal/models/BillingCreditExpiryType.ts
4995
+ function BillingCreditExpiryTypeFromJSON(json) {
4996
+ return BillingCreditExpiryTypeFromJSONTyped(json, false);
4997
+ }
4998
+ function BillingCreditExpiryTypeFromJSONTyped(json, ignoreDiscriminator) {
4999
+ return json;
5000
+ }
5001
+
5002
+ // src/api/checkoutexternal/models/BillingProductPriceInterval.ts
5003
+ function BillingProductPriceIntervalFromJSON(json) {
5004
+ return BillingProductPriceIntervalFromJSONTyped(json, false);
5005
+ }
5006
+ function BillingProductPriceIntervalFromJSONTyped(json, ignoreDiscriminator) {
5007
+ return json;
5008
+ }
5009
+
5010
+ // src/api/checkoutexternal/models/BillingTiersMode.ts
5011
+ function BillingTiersModeFromJSON(json) {
5012
+ return BillingTiersModeFromJSONTyped(json, false);
5013
+ }
5014
+ function BillingTiersModeFromJSONTyped(json, ignoreDiscriminator) {
5015
+ return json;
5016
+ }
5017
+
4978
5018
  // src/api/checkoutexternal/models/BillingProductPriceResponseData.ts
4979
5019
  function BillingProductPriceResponseDataFromJSON(json) {
4980
5020
  return BillingProductPriceResponseDataFromJSONTyped(json, false);
@@ -4988,7 +5028,7 @@ function BillingProductPriceResponseDataFromJSONTyped(json, ignoreDiscriminator)
4988
5028
  createdAt: new Date(json["created_at"]),
4989
5029
  currency: json["currency"],
4990
5030
  id: json["id"],
4991
- interval: json["interval"],
5031
+ interval: BillingProductPriceIntervalFromJSON(json["interval"]),
4992
5032
  isActive: json["is_active"],
4993
5033
  meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
4994
5034
  packageSize: json["package_size"],
@@ -4996,12 +5036,20 @@ function BillingProductPriceResponseDataFromJSONTyped(json, ignoreDiscriminator)
4996
5036
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
4997
5037
  priceExternalId: json["price_external_id"],
4998
5038
  productExternalId: json["product_external_id"],
4999
- tiersMode: json["tiers_mode"] == null ? void 0 : json["tiers_mode"],
5039
+ tiersMode: json["tiers_mode"] == null ? void 0 : BillingTiersModeFromJSON(json["tiers_mode"]),
5000
5040
  updatedAt: new Date(json["updated_at"]),
5001
5041
  usageType: json["usage_type"]
5002
5042
  };
5003
5043
  }
5004
5044
 
5045
+ // src/api/checkoutexternal/models/BillingCreditExpiryUnit.ts
5046
+ function BillingCreditExpiryUnitFromJSON(json) {
5047
+ return BillingCreditExpiryUnitFromJSONTyped(json, false);
5048
+ }
5049
+ function BillingCreditExpiryUnitFromJSONTyped(json, ignoreDiscriminator) {
5050
+ return json;
5051
+ }
5052
+
5005
5053
  // src/api/checkoutexternal/models/BillingCreditBundleView.ts
5006
5054
  function BillingCreditBundleViewFromJSON(json) {
5007
5055
  return BillingCreditBundleViewFromJSONTyped(json, false);
@@ -5012,14 +5060,14 @@ function BillingCreditBundleViewFromJSONTyped(json, ignoreDiscriminator) {
5012
5060
  }
5013
5061
  return {
5014
5062
  billingInvoiceId: json["billing_invoice_id"] == null ? void 0 : json["billing_invoice_id"],
5015
- bundleType: json["bundle_type"],
5063
+ bundleType: BillingCreditBundleTypeFromJSON(json["bundle_type"]),
5016
5064
  createdAt: new Date(json["created_at"]),
5017
5065
  creditDescription: json["credit_description"] == null ? void 0 : json["credit_description"],
5018
5066
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
5019
5067
  creditId: json["credit_id"],
5020
5068
  creditName: json["credit_name"],
5021
- expiryType: json["expiry_type"],
5022
- expiryUnit: json["expiry_unit"],
5069
+ expiryType: BillingCreditExpiryTypeFromJSON(json["expiry_type"]),
5070
+ expiryUnit: BillingCreditExpiryUnitFromJSON(json["expiry_unit"]),
5023
5071
  expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
5024
5072
  hasGrants: json["has_grants"],
5025
5073
  id: json["id"],
@@ -5028,12 +5076,36 @@ function BillingCreditBundleViewFromJSONTyped(json, ignoreDiscriminator) {
5028
5076
  price: json["price"] == null ? void 0 : BillingProductPriceResponseDataFromJSON(json["price"]),
5029
5077
  quantity: json["quantity"] == null ? void 0 : json["quantity"],
5030
5078
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
5031
- status: json["status"],
5079
+ status: BillingCreditBundleStatusFromJSON(json["status"]),
5032
5080
  unitPrice: json["unit_price"] == null ? void 0 : BillingProductPriceResponseDataFromJSON(json["unit_price"]),
5033
5081
  updatedAt: new Date(json["updated_at"])
5034
5082
  };
5035
5083
  }
5036
5084
 
5085
+ // src/api/checkoutexternal/models/BillingCreditBurnStrategy.ts
5086
+ function BillingCreditBurnStrategyFromJSON(json) {
5087
+ return BillingCreditBurnStrategyFromJSONTyped(json, false);
5088
+ }
5089
+ function BillingCreditBurnStrategyFromJSONTyped(json, ignoreDiscriminator) {
5090
+ return json;
5091
+ }
5092
+
5093
+ // src/api/checkoutexternal/models/BillingCreditGrantReason.ts
5094
+ function BillingCreditGrantReasonFromJSON(json) {
5095
+ return BillingCreditGrantReasonFromJSONTyped(json, false);
5096
+ }
5097
+ function BillingCreditGrantReasonFromJSONTyped(json, ignoreDiscriminator) {
5098
+ return json;
5099
+ }
5100
+
5101
+ // src/api/checkoutexternal/models/BillingCreditGrantZeroedOutReason.ts
5102
+ function BillingCreditGrantZeroedOutReasonFromJSON(json) {
5103
+ return BillingCreditGrantZeroedOutReasonFromJSONTyped(json, false);
5104
+ }
5105
+ function BillingCreditGrantZeroedOutReasonFromJSONTyped(json, ignoreDiscriminator) {
5106
+ return json;
5107
+ }
5108
+
5037
5109
  // src/api/checkoutexternal/models/BillingProductResponseData.ts
5038
5110
  function BillingProductResponseDataFromJSON(json) {
5039
5111
  return BillingProductResponseDataFromJSONTyped(json, false);
@@ -5070,13 +5142,21 @@ function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5070
5142
  currency: json["currency"],
5071
5143
  externalPriceId: json["external_price_id"],
5072
5144
  id: json["id"],
5073
- interval: json["interval"],
5145
+ interval: BillingProductPriceIntervalFromJSON(json["interval"]),
5074
5146
  price: json["price"],
5075
5147
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
5076
5148
  scheme: json["scheme"]
5077
5149
  };
5078
5150
  }
5079
5151
 
5152
+ // src/api/checkoutexternal/models/BillingCreditRolloverPolicy.ts
5153
+ function BillingCreditRolloverPolicyFromJSON(json) {
5154
+ return BillingCreditRolloverPolicyFromJSONTyped(json, false);
5155
+ }
5156
+ function BillingCreditRolloverPolicyFromJSONTyped(json, ignoreDiscriminator) {
5157
+ return json;
5158
+ }
5159
+
5080
5160
  // src/api/checkoutexternal/models/BillingCreditResponseData.ts
5081
5161
  function BillingCreditResponseDataFromJSON(json) {
5082
5162
  return BillingCreditResponseDataFromJSONTyped(json, false);
@@ -5086,11 +5166,15 @@ function BillingCreditResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5086
5166
  return json;
5087
5167
  }
5088
5168
  return {
5089
- burnStrategy: json["burn_strategy"],
5169
+ burnStrategy: BillingCreditBurnStrategyFromJSON(json["burn_strategy"]),
5090
5170
  createdAt: new Date(json["created_at"]),
5091
- defaultExpiryUnit: json["default_expiry_unit"],
5171
+ defaultExpiryUnit: BillingCreditExpiryUnitFromJSON(
5172
+ json["default_expiry_unit"]
5173
+ ),
5092
5174
  defaultExpiryUnitCount: json["default_expiry_unit_count"] == null ? void 0 : json["default_expiry_unit_count"],
5093
- defaultRolloverPolicy: json["default_rollover_policy"],
5175
+ defaultRolloverPolicy: BillingCreditRolloverPolicyFromJSON(
5176
+ json["default_rollover_policy"]
5177
+ ),
5094
5178
  description: json["description"],
5095
5179
  icon: json["icon"] == null ? void 0 : json["icon"],
5096
5180
  id: json["id"],
@@ -5103,6 +5187,30 @@ function BillingCreditResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5103
5187
  };
5104
5188
  }
5105
5189
 
5190
+ // src/api/checkoutexternal/models/BillingPlanCreditGrantResetCadence.ts
5191
+ function BillingPlanCreditGrantResetCadenceFromJSON(json) {
5192
+ return BillingPlanCreditGrantResetCadenceFromJSONTyped(json, false);
5193
+ }
5194
+ function BillingPlanCreditGrantResetCadenceFromJSONTyped(json, ignoreDiscriminator) {
5195
+ return json;
5196
+ }
5197
+
5198
+ // src/api/checkoutexternal/models/BillingPlanCreditGrantResetStart.ts
5199
+ function BillingPlanCreditGrantResetStartFromJSON(json) {
5200
+ return BillingPlanCreditGrantResetStartFromJSONTyped(json, false);
5201
+ }
5202
+ function BillingPlanCreditGrantResetStartFromJSONTyped(json, ignoreDiscriminator) {
5203
+ return json;
5204
+ }
5205
+
5206
+ // src/api/checkoutexternal/models/BillingPlanCreditGrantResetType.ts
5207
+ function BillingPlanCreditGrantResetTypeFromJSON(json) {
5208
+ return BillingPlanCreditGrantResetTypeFromJSONTyped(json, false);
5209
+ }
5210
+ function BillingPlanCreditGrantResetTypeFromJSONTyped(json, ignoreDiscriminator) {
5211
+ return json;
5212
+ }
5213
+
5106
5214
  // src/api/checkoutexternal/models/BillingPlanCreditGrantResponseData.ts
5107
5215
  function BillingPlanCreditGrantResponseDataFromJSON(json) {
5108
5216
  return BillingPlanCreditGrantResponseDataFromJSONTyped(json, false);
@@ -5115,8 +5223,8 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
5115
5223
  autoTopupAmount: json["auto_topup_amount"] == null ? void 0 : json["auto_topup_amount"],
5116
5224
  autoTopupAmountType: json["auto_topup_amount_type"] == null ? void 0 : json["auto_topup_amount_type"],
5117
5225
  autoTopupEnabled: json["auto_topup_enabled"],
5118
- autoTopupExpiryType: json["auto_topup_expiry_type"] == null ? void 0 : json["auto_topup_expiry_type"],
5119
- autoTopupExpiryUnit: json["auto_topup_expiry_unit"] == null ? void 0 : json["auto_topup_expiry_unit"],
5226
+ autoTopupExpiryType: json["auto_topup_expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON(json["auto_topup_expiry_type"]),
5227
+ autoTopupExpiryUnit: json["auto_topup_expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON(json["auto_topup_expiry_unit"]),
5120
5228
  autoTopupExpiryUnitCount: json["auto_topup_expiry_unit_count"] == null ? void 0 : json["auto_topup_expiry_unit_count"],
5121
5229
  autoTopupThresholdPercent: json["auto_topup_threshold_percent"] == null ? void 0 : json["auto_topup_threshold_percent"],
5122
5230
  createdAt: new Date(json["created_at"]),
@@ -5125,19 +5233,29 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
5125
5233
  creditName: json["credit_name"],
5126
5234
  creditPluralName: json["credit_plural_name"] == null ? void 0 : json["credit_plural_name"],
5127
5235
  creditSingularName: json["credit_singular_name"] == null ? void 0 : json["credit_singular_name"],
5128
- expiryType: json["expiry_type"] == null ? void 0 : json["expiry_type"],
5129
- expiryUnit: json["expiry_unit"] == null ? void 0 : json["expiry_unit"],
5236
+ expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON(json["expiry_type"]),
5237
+ expiryUnit: json["expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON(json["expiry_unit"]),
5130
5238
  expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
5131
5239
  id: json["id"],
5132
5240
  planId: json["plan_id"],
5133
5241
  planName: json["plan_name"],
5134
- resetCadence: json["reset_cadence"],
5135
- resetStart: json["reset_start"],
5136
- resetType: json["reset_type"] == null ? void 0 : json["reset_type"],
5242
+ resetCadence: BillingPlanCreditGrantResetCadenceFromJSON(
5243
+ json["reset_cadence"]
5244
+ ),
5245
+ resetStart: BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
5246
+ resetType: json["reset_type"] == null ? void 0 : BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
5137
5247
  updatedAt: new Date(json["updated_at"])
5138
5248
  };
5139
5249
  }
5140
5250
 
5251
+ // src/api/checkoutexternal/models/BillingPriceUsageType.ts
5252
+ function BillingPriceUsageTypeFromJSON(json) {
5253
+ return BillingPriceUsageTypeFromJSONTyped(json, false);
5254
+ }
5255
+ function BillingPriceUsageTypeFromJSONTyped(json, ignoreDiscriminator) {
5256
+ return json;
5257
+ }
5258
+
5141
5259
  // src/api/checkoutexternal/models/BillingProductPriceTierResponseData.ts
5142
5260
  function BillingProductPriceTierResponseDataFromJSON(json) {
5143
5261
  return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
@@ -5167,7 +5285,7 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
5167
5285
  createdAt: new Date(json["created_at"]),
5168
5286
  currency: json["currency"],
5169
5287
  id: json["id"],
5170
- interval: json["interval"],
5288
+ interval: BillingProductPriceIntervalFromJSON(json["interval"]),
5171
5289
  isActive: json["is_active"],
5172
5290
  meterEventName: json["meter_event_name"] == null ? void 0 : json["meter_event_name"],
5173
5291
  meterEventPayloadKey: json["meter_event_payload_key"] == null ? void 0 : json["meter_event_payload_key"],
@@ -5183,7 +5301,7 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
5183
5301
  productExternalId: json["product_external_id"],
5184
5302
  productId: json["product_id"],
5185
5303
  productName: json["product_name"],
5186
- tiersMode: json["tiers_mode"] == null ? void 0 : json["tiers_mode"],
5304
+ tiersMode: json["tiers_mode"] == null ? void 0 : BillingTiersModeFromJSON(json["tiers_mode"]),
5187
5305
  updatedAt: new Date(json["updated_at"]),
5188
5306
  usageType: json["usage_type"]
5189
5307
  };
@@ -5248,7 +5366,7 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
5248
5366
  subscriptionId: json["subscription_id"],
5249
5367
  subscriptionItemExternalId: json["subscription_item_external_id"] == null ? void 0 : json["subscription_item_external_id"],
5250
5368
  updatedAt: new Date(json["updated_at"]),
5251
- usageType: json["usage_type"]
5369
+ usageType: BillingPriceUsageTypeFromJSON(json["usage_type"])
5252
5370
  };
5253
5371
  }
5254
5372
 
@@ -5278,6 +5396,14 @@ function BillingSubscriptionDiscountViewFromJSONTyped(json, ignoreDiscriminator)
5278
5396
  };
5279
5397
  }
5280
5398
 
5399
+ // src/api/checkoutexternal/models/BillingSubscriptionTrialEndSetting.ts
5400
+ function BillingSubscriptionTrialEndSettingFromJSON(json) {
5401
+ return BillingSubscriptionTrialEndSettingFromJSONTyped(json, false);
5402
+ }
5403
+ function BillingSubscriptionTrialEndSettingFromJSONTyped(json, ignoreDiscriminator) {
5404
+ return json;
5405
+ }
5406
+
5281
5407
  // src/api/checkoutexternal/models/InvoiceResponseData.ts
5282
5408
  function InvoiceResponseDataFromJSON(json) {
5283
5409
  return InvoiceResponseDataFromJSONTyped(json, false);
@@ -5371,7 +5497,7 @@ function BillingSubscriptionViewFromJSONTyped(json, ignoreDiscriminator) {
5371
5497
  subscriptionExternalId: json["subscription_external_id"],
5372
5498
  totalPrice: json["total_price"],
5373
5499
  trialEnd: json["trial_end"] == null ? void 0 : json["trial_end"],
5374
- trialEndSetting: json["trial_end_setting"] == null ? void 0 : json["trial_end_setting"]
5500
+ trialEndSetting: json["trial_end_setting"] == null ? void 0 : BillingSubscriptionTrialEndSettingFromJSON(json["trial_end_setting"])
5375
5501
  };
5376
5502
  }
5377
5503
 
@@ -5432,6 +5558,14 @@ function ChangeSubscriptionRequestBodyToJSON(value) {
5432
5558
  };
5433
5559
  }
5434
5560
 
5561
+ // src/api/checkoutexternal/models/ChargeType.ts
5562
+ function ChargeTypeFromJSON(json) {
5563
+ return ChargeTypeFromJSONTyped(json, false);
5564
+ }
5565
+ function ChargeTypeFromJSONTyped(json, ignoreDiscriminator) {
5566
+ return json;
5567
+ }
5568
+
5435
5569
  // src/api/checkoutexternal/models/CheckoutResponseData.ts
5436
5570
  function CheckoutResponseDataFromJSON(json) {
5437
5571
  return CheckoutResponseDataFromJSONTyped(json, false);
@@ -5461,7 +5595,7 @@ function CheckoutResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5461
5595
  subscriptionExternalId: json["subscription_external_id"],
5462
5596
  totalPrice: json["total_price"],
5463
5597
  trialEnd: json["trial_end"] == null ? void 0 : json["trial_end"],
5464
- trialEndSetting: json["trial_end_setting"] == null ? void 0 : json["trial_end_setting"]
5598
+ trialEndSetting: json["trial_end_setting"] == null ? void 0 : BillingSubscriptionTrialEndSettingFromJSON(json["trial_end_setting"])
5465
5599
  };
5466
5600
  }
5467
5601
 
@@ -5568,8 +5702,12 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
5568
5702
  billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
5569
5703
  billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
5570
5704
  billingCreditAutoTopupEnabled: json["billing_credit_auto_topup_enabled"],
5571
- billingCreditAutoTopupExpiryType: json["billing_credit_auto_topup_expiry_type"] == null ? void 0 : json["billing_credit_auto_topup_expiry_type"],
5572
- billingCreditAutoTopupExpiryUnit: json["billing_credit_auto_topup_expiry_unit"] == null ? void 0 : json["billing_credit_auto_topup_expiry_unit"],
5705
+ billingCreditAutoTopupExpiryType: json["billing_credit_auto_topup_expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON(
5706
+ json["billing_credit_auto_topup_expiry_type"]
5707
+ ),
5708
+ billingCreditAutoTopupExpiryUnit: json["billing_credit_auto_topup_expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON(
5709
+ json["billing_credit_auto_topup_expiry_unit"]
5710
+ ),
5573
5711
  billingCreditAutoTopupExpiryUnitCount: json["billing_credit_auto_topup_expiry_unit_count"] == null ? void 0 : json["billing_credit_auto_topup_expiry_unit_count"],
5574
5712
  billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
5575
5713
  createdAt: new Date(json["created_at"]),
@@ -5578,16 +5716,18 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
5578
5716
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
5579
5717
  creditId: json["credit_id"],
5580
5718
  creditName: json["credit_name"],
5581
- expiryType: json["expiry_type"] == null ? void 0 : json["expiry_type"],
5582
- expiryUnit: json["expiry_unit"] == null ? void 0 : json["expiry_unit"],
5719
+ expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON(json["expiry_type"]),
5720
+ expiryUnit: json["expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON(json["expiry_unit"]),
5583
5721
  expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
5584
5722
  id: json["id"],
5585
5723
  planId: json["plan_id"],
5586
5724
  planName: json["plan_name"],
5587
5725
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
5588
- resetCadence: json["reset_cadence"],
5589
- resetStart: json["reset_start"],
5590
- resetType: json["reset_type"],
5726
+ resetCadence: BillingPlanCreditGrantResetCadenceFromJSON(
5727
+ json["reset_cadence"]
5728
+ ),
5729
+ resetStart: BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
5730
+ resetType: BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
5591
5731
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
5592
5732
  updatedAt: new Date(json["updated_at"])
5593
5733
  };
@@ -5617,6 +5757,14 @@ function CompanyPlanWithBillingSubViewFromJSONTyped(json, ignoreDiscriminator) {
5617
5757
  };
5618
5758
  }
5619
5759
 
5760
+ // src/api/checkoutexternal/models/EntityType.ts
5761
+ function EntityTypeFromJSON(json) {
5762
+ return EntityTypeFromJSONTyped(json, false);
5763
+ }
5764
+ function EntityTypeFromJSONTyped(json, ignoreDiscriminator) {
5765
+ return json;
5766
+ }
5767
+
5620
5768
  // src/api/checkoutexternal/models/EntityKeyDefinitionResponseData.ts
5621
5769
  function EntityKeyDefinitionResponseDataFromJSON(json) {
5622
5770
  return EntityKeyDefinitionResponseDataFromJSONTyped(json, false);
@@ -5627,7 +5775,7 @@ function EntityKeyDefinitionResponseDataFromJSONTyped(json, ignoreDiscriminator)
5627
5775
  }
5628
5776
  return {
5629
5777
  createdAt: new Date(json["created_at"]),
5630
- entityType: json["entity_type"],
5778
+ entityType: EntityTypeFromJSON(json["entity_type"]),
5631
5779
  id: json["id"],
5632
5780
  key: json["key"],
5633
5781
  updatedAt: new Date(json["updated_at"])
@@ -5647,7 +5795,7 @@ function EntityKeyDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5647
5795
  definition: json["definition"] == null ? void 0 : EntityKeyDefinitionResponseDataFromJSON(json["definition"]),
5648
5796
  definitionId: json["definition_id"],
5649
5797
  entityId: json["entity_id"],
5650
- entityType: json["entity_type"],
5798
+ entityType: EntityTypeFromJSON(json["entity_type"]),
5651
5799
  environmentId: json["environment_id"],
5652
5800
  id: json["id"],
5653
5801
  key: json["key"],
@@ -5656,6 +5804,14 @@ function EntityKeyDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5656
5804
  };
5657
5805
  }
5658
5806
 
5807
+ // src/api/checkoutexternal/models/TraitType.ts
5808
+ function TraitTypeFromJSON(json) {
5809
+ return TraitTypeFromJSONTyped(json, false);
5810
+ }
5811
+ function TraitTypeFromJSONTyped(json, ignoreDiscriminator) {
5812
+ return json;
5813
+ }
5814
+
5659
5815
  // src/api/checkoutexternal/models/EntityTraitDefinitionResponseData.ts
5660
5816
  function EntityTraitDefinitionResponseDataFromJSON(json) {
5661
5817
  return EntityTraitDefinitionResponseDataFromJSONTyped(json, false);
@@ -5667,10 +5823,10 @@ function EntityTraitDefinitionResponseDataFromJSONTyped(json, ignoreDiscriminato
5667
5823
  return {
5668
5824
  createdAt: new Date(json["created_at"]),
5669
5825
  displayName: json["display_name"],
5670
- entityType: json["entity_type"],
5826
+ entityType: EntityTypeFromJSON(json["entity_type"]),
5671
5827
  hierarchy: json["hierarchy"],
5672
5828
  id: json["id"],
5673
- traitType: json["trait_type"],
5829
+ traitType: TraitTypeFromJSON(json["trait_type"]),
5674
5830
  updatedAt: new Date(json["updated_at"])
5675
5831
  };
5676
5832
  }
@@ -5704,7 +5860,7 @@ function TraitDefinitionFromJSONTyped(json, ignoreDiscriminator) {
5704
5860
  }
5705
5861
  return {
5706
5862
  comparableType: json["comparable_type"],
5707
- entityType: json["entity_type"],
5863
+ entityType: EntityTypeFromJSON(json["entity_type"]),
5708
5864
  id: json["id"]
5709
5865
  };
5710
5866
  }
@@ -5850,6 +6006,30 @@ function CompanyOverrideNoteResponseDataFromJSONTyped(json, ignoreDiscriminator)
5850
6006
  };
5851
6007
  }
5852
6008
 
6009
+ // src/api/checkoutexternal/models/EntitlementValueType.ts
6010
+ function EntitlementValueTypeFromJSON(json) {
6011
+ return EntitlementValueTypeFromJSONTyped(json, false);
6012
+ }
6013
+ function EntitlementValueTypeFromJSONTyped(json, ignoreDiscriminator) {
6014
+ return json;
6015
+ }
6016
+
6017
+ // src/api/checkoutexternal/models/FeatureType.ts
6018
+ function FeatureTypeFromJSON(json) {
6019
+ return FeatureTypeFromJSONTyped(json, false);
6020
+ }
6021
+ function FeatureTypeFromJSONTyped(json, ignoreDiscriminator) {
6022
+ return json;
6023
+ }
6024
+
6025
+ // src/api/checkoutexternal/models/FeatureLifecyclePhase.ts
6026
+ function FeatureLifecyclePhaseFromJSON(json) {
6027
+ return FeatureLifecyclePhaseFromJSONTyped(json, false);
6028
+ }
6029
+ function FeatureLifecyclePhaseFromJSONTyped(json, ignoreDiscriminator) {
6030
+ return json;
6031
+ }
6032
+
5853
6033
  // src/api/checkoutexternal/models/FeatureResponseData.ts
5854
6034
  function FeatureResponseDataFromJSON(json) {
5855
6035
  return FeatureResponseDataFromJSONTyped(json, false);
@@ -5862,10 +6042,10 @@ function FeatureResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5862
6042
  createdAt: new Date(json["created_at"]),
5863
6043
  description: json["description"],
5864
6044
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
5865
- featureType: json["feature_type"],
6045
+ featureType: FeatureTypeFromJSON(json["feature_type"]),
5866
6046
  icon: json["icon"],
5867
6047
  id: json["id"],
5868
- lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : json["lifecycle_phase"],
6048
+ lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON(json["lifecycle_phase"]),
5869
6049
  maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
5870
6050
  name: json["name"],
5871
6051
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
@@ -5905,7 +6085,7 @@ function CompanyOverrideResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5905
6085
  valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
5906
6086
  valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["value_trait"]),
5907
6087
  valueTraitId: json["value_trait_id"] == null ? void 0 : json["value_trait_id"],
5908
- valueType: json["value_type"]
6088
+ valueType: EntitlementValueTypeFromJSON(json["value_type"])
5909
6089
  };
5910
6090
  }
5911
6091
 
@@ -5987,7 +6167,7 @@ function RuleConditionDetailResponseDataFromJSONTyped(json, ignoreDiscriminator)
5987
6167
  ),
5988
6168
  ruleId: json["rule_id"],
5989
6169
  trait: json["trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["trait"]),
5990
- traitEntityType: json["trait_entity_type"] == null ? void 0 : json["trait_entity_type"],
6170
+ traitEntityType: json["trait_entity_type"] == null ? void 0 : EntityTypeFromJSON(json["trait_entity_type"]),
5991
6171
  traitId: json["trait_id"] == null ? void 0 : json["trait_id"],
5992
6172
  traitValue: json["trait_value"],
5993
6173
  updatedAt: new Date(json["updated_at"])
@@ -6042,6 +6222,14 @@ function RuleDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6042
6222
  };
6043
6223
  }
6044
6224
 
6225
+ // src/api/checkoutexternal/models/FlagType.ts
6226
+ function FlagTypeFromJSON(json) {
6227
+ return FlagTypeFromJSONTyped(json, false);
6228
+ }
6229
+ function FlagTypeFromJSONTyped(json, ignoreDiscriminator) {
6230
+ return json;
6231
+ }
6232
+
6045
6233
  // src/api/checkoutexternal/models/FlagDetailResponseData.ts
6046
6234
  function FlagDetailResponseDataFromJSON(json) {
6047
6235
  return FlagDetailResponseDataFromJSONTyped(json, false);
@@ -6056,7 +6244,7 @@ function FlagDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6056
6244
  description: json["description"],
6057
6245
  feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON(json["feature"]),
6058
6246
  featureId: json["feature_id"] == null ? void 0 : json["feature_id"],
6059
- flagType: json["flag_type"],
6247
+ flagType: FlagTypeFromJSON(json["flag_type"]),
6060
6248
  id: json["id"],
6061
6249
  key: json["key"],
6062
6250
  lastCheckedAt: json["last_checked_at"] == null ? void 0 : new Date(json["last_checked_at"]),
@@ -6080,11 +6268,11 @@ function FeatureDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6080
6268
  description: json["description"],
6081
6269
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
6082
6270
  eventSummary: json["event_summary"] == null ? void 0 : EventSummaryResponseDataFromJSON(json["event_summary"]),
6083
- featureType: json["feature_type"],
6271
+ featureType: FeatureTypeFromJSON(json["feature_type"]),
6084
6272
  flags: json["flags"].map(FlagDetailResponseDataFromJSON),
6085
6273
  icon: json["icon"],
6086
6274
  id: json["id"],
6087
- lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : json["lifecycle_phase"],
6275
+ lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON(json["lifecycle_phase"]),
6088
6276
  maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
6089
6277
  name: json["name"],
6090
6278
  plans: json["plans"].map(PreviewObjectFromJSON),
@@ -6096,6 +6284,30 @@ function FeatureDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6096
6284
  };
6097
6285
  }
6098
6286
 
6287
+ // src/api/checkoutexternal/models/PlanControlledByType.ts
6288
+ function PlanControlledByTypeFromJSON(json) {
6289
+ return PlanControlledByTypeFromJSONTyped(json, false);
6290
+ }
6291
+ function PlanControlledByTypeFromJSONTyped(json, ignoreDiscriminator) {
6292
+ return json;
6293
+ }
6294
+
6295
+ // src/api/checkoutexternal/models/EntitlementPriceBehavior.ts
6296
+ function EntitlementPriceBehaviorFromJSON(json) {
6297
+ return EntitlementPriceBehaviorFromJSONTyped(json, false);
6298
+ }
6299
+ function EntitlementPriceBehaviorFromJSONTyped(json, ignoreDiscriminator) {
6300
+ return json;
6301
+ }
6302
+
6303
+ // src/api/checkoutexternal/models/PlanType.ts
6304
+ function PlanTypeFromJSON(json) {
6305
+ return PlanTypeFromJSONTyped(json, false);
6306
+ }
6307
+ function PlanTypeFromJSONTyped(json, ignoreDiscriminator) {
6308
+ return json;
6309
+ }
6310
+
6099
6311
  // src/api/checkoutexternal/models/PlanResponseData.ts
6100
6312
  function PlanResponseDataFromJSON(json) {
6101
6313
  return PlanResponseDataFromJSONTyped(json, false);
@@ -6111,7 +6323,7 @@ function PlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6111
6323
  icon: json["icon"],
6112
6324
  id: json["id"],
6113
6325
  name: json["name"],
6114
- planType: json["plan_type"],
6326
+ planType: PlanTypeFromJSON(json["plan_type"]),
6115
6327
  updatedAt: new Date(json["updated_at"])
6116
6328
  };
6117
6329
  }
@@ -6138,7 +6350,7 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6138
6350
  metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
6139
6351
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
6140
6352
  planId: json["plan_id"],
6141
- priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
6353
+ priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
6142
6354
  ruleId: json["rule_id"],
6143
6355
  ruleIdUsageExceeded: json["rule_id_usage_exceeded"] == null ? void 0 : json["rule_id_usage_exceeded"],
6144
6356
  softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
@@ -6149,7 +6361,7 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6149
6361
  valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
6150
6362
  valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["value_trait"]),
6151
6363
  valueTraitId: json["value_trait_id"] == null ? void 0 : json["value_trait_id"],
6152
- valueType: json["value_type"]
6364
+ valueType: EntitlementValueTypeFromJSON(json["value_type"])
6153
6365
  };
6154
6366
  }
6155
6367
 
@@ -6179,11 +6391,19 @@ function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
6179
6391
  return {
6180
6392
  creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
6181
6393
  expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
6182
- grantReason: json["grant_reason"],
6394
+ grantReason: BillingCreditGrantReasonFromJSON(json["grant_reason"]),
6183
6395
  quantity: json["quantity"]
6184
6396
  };
6185
6397
  }
6186
6398
 
6399
+ // src/api/checkoutexternal/models/EntitlementType.ts
6400
+ function EntitlementTypeFromJSON(json) {
6401
+ return EntitlementTypeFromJSONTyped(json, false);
6402
+ }
6403
+ function EntitlementTypeFromJSONTyped(json, ignoreDiscriminator) {
6404
+ return json;
6405
+ }
6406
+
6187
6407
  // src/api/checkoutexternal/models/FeatureUsageResponseData.ts
6188
6408
  function FeatureUsageResponseDataFromJSON(json) {
6189
6409
  return FeatureUsageResponseDataFromJSONTyped(json, false);
@@ -6195,14 +6415,14 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6195
6415
  return {
6196
6416
  access: json["access"],
6197
6417
  allocation: json["allocation"] == null ? void 0 : json["allocation"],
6198
- allocationType: json["allocation_type"],
6418
+ allocationType: EntitlementValueTypeFromJSON(json["allocation_type"]),
6199
6419
  companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
6200
6420
  creditConsumptionRate: json["credit_consumption_rate"] == null ? void 0 : json["credit_consumption_rate"],
6201
6421
  creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
6202
6422
  creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
6203
6423
  CreditGrantDetailFromJSON
6204
6424
  ),
6205
- creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
6425
+ creditGrantReason: json["credit_grant_reason"] == null ? void 0 : BillingCreditGrantReasonFromJSON(json["credit_grant_reason"]),
6206
6426
  creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
6207
6427
  creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
6208
6428
  creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
@@ -6212,7 +6432,7 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6212
6432
  entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
6213
6433
  entitlementId: json["entitlement_id"],
6214
6434
  entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
6215
- entitlementType: json["entitlement_type"],
6435
+ entitlementType: EntitlementTypeFromJSON(json["entitlement_type"]),
6216
6436
  feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
6217
6437
  hasValidAllocation: json["has_valid_allocation"] == null ? void 0 : json["has_valid_allocation"],
6218
6438
  isUnlimited: json["is_unlimited"] == null ? void 0 : json["is_unlimited"],
@@ -6224,7 +6444,7 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6224
6444
  period: json["period"] == null ? void 0 : json["period"],
6225
6445
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
6226
6446
  planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
6227
- priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
6447
+ priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
6228
6448
  softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
6229
6449
  usage: json["usage"] == null ? void 0 : json["usage"],
6230
6450
  yearlyUsageBasedPrice: json["yearly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_usage_based_price"])
@@ -6242,11 +6462,11 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6242
6462
  return {
6243
6463
  audienceType: json["audience_type"] == null ? void 0 : json["audience_type"],
6244
6464
  billingProduct: json["billing_product"] == null ? void 0 : BillingProductDetailResponseDataFromJSON(json["billing_product"]),
6245
- chargeType: json["charge_type"],
6465
+ chargeType: ChargeTypeFromJSON(json["charge_type"]),
6246
6466
  companyCanTrial: json["company_can_trial"],
6247
6467
  companyCount: json["company_count"],
6248
6468
  compatiblePlanIds: json["compatible_plan_ids"],
6249
- controlledBy: json["controlled_by"],
6469
+ controlledBy: PlanControlledByTypeFromJSON(json["controlled_by"]),
6250
6470
  createdAt: new Date(json["created_at"]),
6251
6471
  current: json["current"],
6252
6472
  custom: json["custom"],
@@ -6263,6 +6483,7 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6263
6483
  includedCreditGrants: json["included_credit_grants"].map(
6264
6484
  PlanCreditGrantViewFromJSON
6265
6485
  ),
6486
+ invalidReason: json["invalid_reason"] == null ? void 0 : json["invalid_reason"],
6266
6487
  isCustom: json["is_custom"],
6267
6488
  isDefault: json["is_default"],
6268
6489
  isFree: json["is_free"],
@@ -6270,7 +6491,7 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6270
6491
  monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["monthly_price"]),
6271
6492
  name: json["name"],
6272
6493
  oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["one_time_price"]),
6273
- planType: json["plan_type"],
6494
+ planType: PlanTypeFromJSON(json["plan_type"]),
6274
6495
  trialDays: json["trial_days"] == null ? void 0 : json["trial_days"],
6275
6496
  updatedAt: new Date(json["updated_at"]),
6276
6497
  usageViolations: json["usage_violations"].map(
@@ -6355,6 +6576,14 @@ function ComponentCheckoutSettingsFromJSONTyped(json, ignoreDiscriminator) {
6355
6576
  };
6356
6577
  }
6357
6578
 
6579
+ // src/api/checkoutexternal/models/ComponentEntityType.ts
6580
+ function ComponentEntityTypeFromJSON(json) {
6581
+ return ComponentEntityTypeFromJSONTyped(json, false);
6582
+ }
6583
+ function ComponentEntityTypeFromJSONTyped(json, ignoreDiscriminator) {
6584
+ return json;
6585
+ }
6586
+
6358
6587
  // src/api/checkoutexternal/models/PlanDetailResponseData.ts
6359
6588
  function PlanDetailResponseDataFromJSON(json) {
6360
6589
  return PlanDetailResponseDataFromJSONTyped(json, false);
@@ -6366,9 +6595,9 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6366
6595
  return {
6367
6596
  audienceType: json["audience_type"] == null ? void 0 : json["audience_type"],
6368
6597
  billingProduct: json["billing_product"] == null ? void 0 : BillingProductDetailResponseDataFromJSON(json["billing_product"]),
6369
- chargeType: json["charge_type"],
6598
+ chargeType: ChargeTypeFromJSON(json["charge_type"]),
6370
6599
  companyCount: json["company_count"],
6371
- controlledBy: json["controlled_by"],
6600
+ controlledBy: PlanControlledByTypeFromJSON(json["controlled_by"]),
6372
6601
  createdAt: new Date(json["created_at"]),
6373
6602
  description: json["description"],
6374
6603
  features: json["features"].map(
@@ -6385,7 +6614,7 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6385
6614
  monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["monthly_price"]),
6386
6615
  name: json["name"],
6387
6616
  oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["one_time_price"]),
6388
- planType: json["plan_type"],
6617
+ planType: PlanTypeFromJSON(json["plan_type"]),
6389
6618
  trialDays: json["trial_days"] == null ? void 0 : json["trial_days"],
6390
6619
  updatedAt: new Date(json["updated_at"]),
6391
6620
  yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["yearly_price"])
@@ -6426,10 +6655,10 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
6426
6655
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
6427
6656
  creditName: json["credit_name"],
6428
6657
  expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
6429
- expiryType: json["expiry_type"] == null ? void 0 : json["expiry_type"],
6430
- expiryUnit: json["expiry_unit"] == null ? void 0 : json["expiry_unit"],
6658
+ expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON(json["expiry_type"]),
6659
+ expiryUnit: json["expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON(json["expiry_unit"]),
6431
6660
  expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
6432
- grantReason: json["grant_reason"],
6661
+ grantReason: BillingCreditGrantReasonFromJSON(json["grant_reason"]),
6433
6662
  id: json["id"],
6434
6663
  planId: json["plan_id"] == null ? void 0 : json["plan_id"],
6435
6664
  planName: json["plan_name"] == null ? void 0 : json["plan_name"],
@@ -6443,7 +6672,7 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
6443
6672
  updatedAt: new Date(json["updated_at"]),
6444
6673
  validFrom: json["valid_from"] == null ? void 0 : new Date(json["valid_from"]),
6445
6674
  zeroedOutDate: json["zeroed_out_date"] == null ? void 0 : new Date(json["zeroed_out_date"]),
6446
- zeroedOutReason: json["zeroed_out_reason"] == null ? void 0 : json["zeroed_out_reason"]
6675
+ zeroedOutReason: json["zeroed_out_reason"] == null ? void 0 : BillingCreditGrantZeroedOutReasonFromJSON(json["zeroed_out_reason"])
6447
6676
  };
6448
6677
  }
6449
6678
 
@@ -6463,14 +6692,22 @@ function UsageBasedEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminato
6463
6692
  metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
6464
6693
  metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
6465
6694
  monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
6466
- priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
6695
+ priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
6467
6696
  valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
6468
6697
  valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
6469
- valueType: json["value_type"],
6698
+ valueType: EntitlementValueTypeFromJSON(json["value_type"]),
6470
6699
  yearlyUsageBasedPrice: json["yearly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_usage_based_price"])
6471
6700
  };
6472
6701
  }
6473
6702
 
6703
+ // src/api/checkoutexternal/models/ComponentState.ts
6704
+ function ComponentStateFromJSON(json) {
6705
+ return ComponentStateFromJSONTyped(json, false);
6706
+ }
6707
+ function ComponentStateFromJSONTyped(json, ignoreDiscriminator) {
6708
+ return json;
6709
+ }
6710
+
6474
6711
  // src/api/checkoutexternal/models/ComponentResponseData.ts
6475
6712
  function ComponentResponseDataFromJSON(json) {
6476
6713
  return ComponentResponseDataFromJSONTyped(json, false);
@@ -6484,8 +6721,8 @@ function ComponentResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6484
6721
  createdAt: new Date(json["created_at"]),
6485
6722
  id: json["id"],
6486
6723
  name: json["name"],
6487
- state: json["state"],
6488
- type: json["type"],
6724
+ state: ComponentStateFromJSON(json["state"]),
6725
+ type: ComponentEntityTypeFromJSON(json["type"]),
6489
6726
  updatedAt: new Date(json["updated_at"])
6490
6727
  };
6491
6728
  }
@@ -6539,6 +6776,9 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
6539
6776
  defaultPlan: json["default_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["default_plan"]),
6540
6777
  featureUsage: json["feature_usage"] == null ? void 0 : FeatureUsageDetailResponseDataFromJSON(json["feature_usage"]),
6541
6778
  postTrialPlan: json["post_trial_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["post_trial_plan"]),
6779
+ preventSelfServiceDowngrade: json["prevent_self_service_downgrade"],
6780
+ preventSelfServiceDowngradeButtonText: json["prevent_self_service_downgrade_button_text"] == null ? void 0 : json["prevent_self_service_downgrade_button_text"],
6781
+ preventSelfServiceDowngradeUrl: json["prevent_self_service_downgrade_url"] == null ? void 0 : json["prevent_self_service_downgrade_url"],
6542
6782
  showCredits: json["show_credits"],
6543
6783
  showPeriodToggle: json["show_period_toggle"],
6544
6784
  showZeroPriceAsFree: json["show_zero_price_as_free"],
@@ -7526,6 +7766,30 @@ var JSONApiResponse2 = class {
7526
7766
  }
7527
7767
  };
7528
7768
 
7769
+ // src/api/componentspublic/models/BillingCreditBurnStrategy.ts
7770
+ function BillingCreditBurnStrategyFromJSON2(json) {
7771
+ return BillingCreditBurnStrategyFromJSONTyped3(json, false);
7772
+ }
7773
+ function BillingCreditBurnStrategyFromJSONTyped3(json, ignoreDiscriminator) {
7774
+ return json;
7775
+ }
7776
+
7777
+ // src/api/componentspublic/models/BillingCreditExpiryType.ts
7778
+ function BillingCreditExpiryTypeFromJSON2(json) {
7779
+ return BillingCreditExpiryTypeFromJSONTyped6(json, false);
7780
+ }
7781
+ function BillingCreditExpiryTypeFromJSONTyped6(json, ignoreDiscriminator) {
7782
+ return json;
7783
+ }
7784
+
7785
+ // src/api/componentspublic/models/BillingCreditExpiryUnit.ts
7786
+ function BillingCreditExpiryUnitFromJSON2(json) {
7787
+ return BillingCreditExpiryUnitFromJSONTyped7(json, false);
7788
+ }
7789
+ function BillingCreditExpiryUnitFromJSONTyped7(json, ignoreDiscriminator) {
7790
+ return json;
7791
+ }
7792
+
7529
7793
  // src/api/componentspublic/models/BillingProductResponseData.ts
7530
7794
  function BillingProductResponseDataFromJSON2(json) {
7531
7795
  return BillingProductResponseDataFromJSONTyped4(json, false);
@@ -7550,6 +7814,14 @@ function BillingProductResponseDataFromJSONTyped4(json, ignoreDiscriminator) {
7550
7814
  };
7551
7815
  }
7552
7816
 
7817
+ // src/api/componentspublic/models/BillingProductPriceInterval.ts
7818
+ function BillingProductPriceIntervalFromJSON2(json) {
7819
+ return BillingProductPriceIntervalFromJSONTyped5(json, false);
7820
+ }
7821
+ function BillingProductPriceIntervalFromJSONTyped5(json, ignoreDiscriminator) {
7822
+ return json;
7823
+ }
7824
+
7553
7825
  // src/api/componentspublic/models/BillingPriceResponseData.ts
7554
7826
  function BillingPriceResponseDataFromJSON2(json) {
7555
7827
  return BillingPriceResponseDataFromJSONTyped7(json, false);
@@ -7562,13 +7834,21 @@ function BillingPriceResponseDataFromJSONTyped7(json, ignoreDiscriminator) {
7562
7834
  currency: json["currency"],
7563
7835
  externalPriceId: json["external_price_id"],
7564
7836
  id: json["id"],
7565
- interval: json["interval"],
7837
+ interval: BillingProductPriceIntervalFromJSON2(json["interval"]),
7566
7838
  price: json["price"],
7567
7839
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
7568
7840
  scheme: json["scheme"]
7569
7841
  };
7570
7842
  }
7571
7843
 
7844
+ // src/api/componentspublic/models/BillingCreditRolloverPolicy.ts
7845
+ function BillingCreditRolloverPolicyFromJSON2(json) {
7846
+ return BillingCreditRolloverPolicyFromJSONTyped3(json, false);
7847
+ }
7848
+ function BillingCreditRolloverPolicyFromJSONTyped3(json, ignoreDiscriminator) {
7849
+ return json;
7850
+ }
7851
+
7572
7852
  // src/api/componentspublic/models/BillingCreditResponseData.ts
7573
7853
  function BillingCreditResponseDataFromJSON2(json) {
7574
7854
  return BillingCreditResponseDataFromJSONTyped3(json, false);
@@ -7578,11 +7858,15 @@ function BillingCreditResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
7578
7858
  return json;
7579
7859
  }
7580
7860
  return {
7581
- burnStrategy: json["burn_strategy"],
7861
+ burnStrategy: BillingCreditBurnStrategyFromJSON2(json["burn_strategy"]),
7582
7862
  createdAt: new Date(json["created_at"]),
7583
- defaultExpiryUnit: json["default_expiry_unit"],
7863
+ defaultExpiryUnit: BillingCreditExpiryUnitFromJSON2(
7864
+ json["default_expiry_unit"]
7865
+ ),
7584
7866
  defaultExpiryUnitCount: json["default_expiry_unit_count"] == null ? void 0 : json["default_expiry_unit_count"],
7585
- defaultRolloverPolicy: json["default_rollover_policy"],
7867
+ defaultRolloverPolicy: BillingCreditRolloverPolicyFromJSON2(
7868
+ json["default_rollover_policy"]
7869
+ ),
7586
7870
  description: json["description"],
7587
7871
  icon: json["icon"] == null ? void 0 : json["icon"],
7588
7872
  id: json["id"],
@@ -7595,6 +7879,30 @@ function BillingCreditResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
7595
7879
  };
7596
7880
  }
7597
7881
 
7882
+ // src/api/componentspublic/models/BillingPlanCreditGrantResetCadence.ts
7883
+ function BillingPlanCreditGrantResetCadenceFromJSON2(json) {
7884
+ return BillingPlanCreditGrantResetCadenceFromJSONTyped4(json, false);
7885
+ }
7886
+ function BillingPlanCreditGrantResetCadenceFromJSONTyped4(json, ignoreDiscriminator) {
7887
+ return json;
7888
+ }
7889
+
7890
+ // src/api/componentspublic/models/BillingPlanCreditGrantResetStart.ts
7891
+ function BillingPlanCreditGrantResetStartFromJSON2(json) {
7892
+ return BillingPlanCreditGrantResetStartFromJSONTyped4(json, false);
7893
+ }
7894
+ function BillingPlanCreditGrantResetStartFromJSONTyped4(json, ignoreDiscriminator) {
7895
+ return json;
7896
+ }
7897
+
7898
+ // src/api/componentspublic/models/BillingPlanCreditGrantResetType.ts
7899
+ function BillingPlanCreditGrantResetTypeFromJSON2(json) {
7900
+ return BillingPlanCreditGrantResetTypeFromJSONTyped4(json, false);
7901
+ }
7902
+ function BillingPlanCreditGrantResetTypeFromJSONTyped4(json, ignoreDiscriminator) {
7903
+ return json;
7904
+ }
7905
+
7598
7906
  // src/api/componentspublic/models/BillingProductPriceTierResponseData.ts
7599
7907
  function BillingProductPriceTierResponseDataFromJSON2(json) {
7600
7908
  return BillingProductPriceTierResponseDataFromJSONTyped4(json, false);
@@ -7611,6 +7919,14 @@ function BillingProductPriceTierResponseDataFromJSONTyped4(json, ignoreDiscrimin
7611
7919
  };
7612
7920
  }
7613
7921
 
7922
+ // src/api/componentspublic/models/BillingTiersMode.ts
7923
+ function BillingTiersModeFromJSON2(json) {
7924
+ return BillingTiersModeFromJSONTyped4(json, false);
7925
+ }
7926
+ function BillingTiersModeFromJSONTyped4(json, ignoreDiscriminator) {
7927
+ return json;
7928
+ }
7929
+
7614
7930
  // src/api/componentspublic/models/BillingPriceView.ts
7615
7931
  function BillingPriceViewFromJSON2(json) {
7616
7932
  return BillingPriceViewFromJSONTyped5(json, false);
@@ -7624,7 +7940,7 @@ function BillingPriceViewFromJSONTyped5(json, ignoreDiscriminator) {
7624
7940
  createdAt: new Date(json["created_at"]),
7625
7941
  currency: json["currency"],
7626
7942
  id: json["id"],
7627
- interval: json["interval"],
7943
+ interval: BillingProductPriceIntervalFromJSON2(json["interval"]),
7628
7944
  isActive: json["is_active"],
7629
7945
  meterEventName: json["meter_event_name"] == null ? void 0 : json["meter_event_name"],
7630
7946
  meterEventPayloadKey: json["meter_event_payload_key"] == null ? void 0 : json["meter_event_payload_key"],
@@ -7640,7 +7956,7 @@ function BillingPriceViewFromJSONTyped5(json, ignoreDiscriminator) {
7640
7956
  productExternalId: json["product_external_id"],
7641
7957
  productId: json["product_id"],
7642
7958
  productName: json["product_name"],
7643
- tiersMode: json["tiers_mode"] == null ? void 0 : json["tiers_mode"],
7959
+ tiersMode: json["tiers_mode"] == null ? void 0 : BillingTiersModeFromJSON2(json["tiers_mode"]),
7644
7960
  updatedAt: new Date(json["updated_at"]),
7645
7961
  usageType: json["usage_type"]
7646
7962
  };
@@ -7674,6 +7990,14 @@ function BillingProductDetailResponseDataFromJSONTyped5(json, ignoreDiscriminato
7674
7990
  };
7675
7991
  }
7676
7992
 
7993
+ // src/api/componentspublic/models/ChargeType.ts
7994
+ function ChargeTypeFromJSON2(json) {
7995
+ return ChargeTypeFromJSONTyped5(json, false);
7996
+ }
7997
+ function ChargeTypeFromJSONTyped5(json, ignoreDiscriminator) {
7998
+ return json;
7999
+ }
8000
+
7677
8001
  // src/api/componentspublic/models/CompatiblePlans.ts
7678
8002
  function CompatiblePlansFromJSON2(json) {
7679
8003
  return CompatiblePlansFromJSONTyped3(json, false);
@@ -7717,6 +8041,38 @@ function CustomPlanConfigFromJSONTyped3(json, ignoreDiscriminator) {
7717
8041
  };
7718
8042
  }
7719
8043
 
8044
+ // src/api/componentspublic/models/EntitlementPriceBehavior.ts
8045
+ function EntitlementPriceBehaviorFromJSON2(json) {
8046
+ return EntitlementPriceBehaviorFromJSONTyped5(json, false);
8047
+ }
8048
+ function EntitlementPriceBehaviorFromJSONTyped5(json, ignoreDiscriminator) {
8049
+ return json;
8050
+ }
8051
+
8052
+ // src/api/componentspublic/models/EntitlementValueType.ts
8053
+ function EntitlementValueTypeFromJSON2(json) {
8054
+ return EntitlementValueTypeFromJSONTyped6(json, false);
8055
+ }
8056
+ function EntitlementValueTypeFromJSONTyped6(json, ignoreDiscriminator) {
8057
+ return json;
8058
+ }
8059
+
8060
+ // src/api/componentspublic/models/EntityType.ts
8061
+ function EntityTypeFromJSON2(json) {
8062
+ return EntityTypeFromJSONTyped9(json, false);
8063
+ }
8064
+ function EntityTypeFromJSONTyped9(json, ignoreDiscriminator) {
8065
+ return json;
8066
+ }
8067
+
8068
+ // src/api/componentspublic/models/TraitType.ts
8069
+ function TraitTypeFromJSON2(json) {
8070
+ return TraitTypeFromJSONTyped3(json, false);
8071
+ }
8072
+ function TraitTypeFromJSONTyped3(json, ignoreDiscriminator) {
8073
+ return json;
8074
+ }
8075
+
7720
8076
  // src/api/componentspublic/models/EntityTraitDefinitionResponseData.ts
7721
8077
  function EntityTraitDefinitionResponseDataFromJSON2(json) {
7722
8078
  return EntityTraitDefinitionResponseDataFromJSONTyped7(json, false);
@@ -7728,10 +8084,10 @@ function EntityTraitDefinitionResponseDataFromJSONTyped7(json, ignoreDiscriminat
7728
8084
  return {
7729
8085
  createdAt: new Date(json["created_at"]),
7730
8086
  displayName: json["display_name"],
7731
- entityType: json["entity_type"],
8087
+ entityType: EntityTypeFromJSON2(json["entity_type"]),
7732
8088
  hierarchy: json["hierarchy"],
7733
8089
  id: json["id"],
7734
- traitType: json["trait_type"],
8090
+ traitType: TraitTypeFromJSON2(json["trait_type"]),
7735
8091
  updatedAt: new Date(json["updated_at"])
7736
8092
  };
7737
8093
  }
@@ -7754,6 +8110,14 @@ function EventSummaryResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
7754
8110
  };
7755
8111
  }
7756
8112
 
8113
+ // src/api/componentspublic/models/FeatureType.ts
8114
+ function FeatureTypeFromJSON2(json) {
8115
+ return FeatureTypeFromJSONTyped4(json, false);
8116
+ }
8117
+ function FeatureTypeFromJSONTyped4(json, ignoreDiscriminator) {
8118
+ return json;
8119
+ }
8120
+
7757
8121
  // src/api/componentspublic/models/PreviewObject.ts
7758
8122
  function PreviewObjectFromJSON2(json) {
7759
8123
  return PreviewObjectFromJSONTyped3(json, false);
@@ -7770,6 +8134,14 @@ function PreviewObjectFromJSONTyped3(json, ignoreDiscriminator) {
7770
8134
  };
7771
8135
  }
7772
8136
 
8137
+ // src/api/componentspublic/models/FeatureLifecyclePhase.ts
8138
+ function FeatureLifecyclePhaseFromJSON2(json) {
8139
+ return FeatureLifecyclePhaseFromJSONTyped4(json, false);
8140
+ }
8141
+ function FeatureLifecyclePhaseFromJSONTyped4(json, ignoreDiscriminator) {
8142
+ return json;
8143
+ }
8144
+
7773
8145
  // src/api/componentspublic/models/PreviewObjectResponseData.ts
7774
8146
  function PreviewObjectResponseDataFromJSON2(json) {
7775
8147
  return PreviewObjectResponseDataFromJSONTyped3(json, false);
@@ -7814,7 +8186,7 @@ function RuleConditionDetailResponseDataFromJSONTyped4(json, ignoreDiscriminator
7814
8186
  ),
7815
8187
  ruleId: json["rule_id"],
7816
8188
  trait: json["trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON2(json["trait"]),
7817
- traitEntityType: json["trait_entity_type"] == null ? void 0 : json["trait_entity_type"],
8189
+ traitEntityType: json["trait_entity_type"] == null ? void 0 : EntityTypeFromJSON2(json["trait_entity_type"]),
7818
8190
  traitId: json["trait_id"] == null ? void 0 : json["trait_id"],
7819
8191
  traitValue: json["trait_value"],
7820
8192
  updatedAt: new Date(json["updated_at"])
@@ -7881,10 +8253,10 @@ function FeatureResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
7881
8253
  createdAt: new Date(json["created_at"]),
7882
8254
  description: json["description"],
7883
8255
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
7884
- featureType: json["feature_type"],
8256
+ featureType: FeatureTypeFromJSON2(json["feature_type"]),
7885
8257
  icon: json["icon"],
7886
8258
  id: json["id"],
7887
- lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : json["lifecycle_phase"],
8259
+ lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON2(json["lifecycle_phase"]),
7888
8260
  maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
7889
8261
  name: json["name"],
7890
8262
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
@@ -7894,6 +8266,14 @@ function FeatureResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
7894
8266
  };
7895
8267
  }
7896
8268
 
8269
+ // src/api/componentspublic/models/FlagType.ts
8270
+ function FlagTypeFromJSON2(json) {
8271
+ return FlagTypeFromJSONTyped4(json, false);
8272
+ }
8273
+ function FlagTypeFromJSONTyped4(json, ignoreDiscriminator) {
8274
+ return json;
8275
+ }
8276
+
7897
8277
  // src/api/componentspublic/models/FlagDetailResponseData.ts
7898
8278
  function FlagDetailResponseDataFromJSON2(json) {
7899
8279
  return FlagDetailResponseDataFromJSONTyped3(json, false);
@@ -7908,7 +8288,7 @@ function FlagDetailResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
7908
8288
  description: json["description"],
7909
8289
  feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON2(json["feature"]),
7910
8290
  featureId: json["feature_id"] == null ? void 0 : json["feature_id"],
7911
- flagType: json["flag_type"],
8291
+ flagType: FlagTypeFromJSON2(json["flag_type"]),
7912
8292
  id: json["id"],
7913
8293
  key: json["key"],
7914
8294
  lastCheckedAt: json["last_checked_at"] == null ? void 0 : new Date(json["last_checked_at"]),
@@ -7932,11 +8312,11 @@ function FeatureDetailResponseDataFromJSONTyped6(json, ignoreDiscriminator) {
7932
8312
  description: json["description"],
7933
8313
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
7934
8314
  eventSummary: json["event_summary"] == null ? void 0 : EventSummaryResponseDataFromJSON2(json["event_summary"]),
7935
- featureType: json["feature_type"],
8315
+ featureType: FeatureTypeFromJSON2(json["feature_type"]),
7936
8316
  flags: json["flags"].map(FlagDetailResponseDataFromJSON2),
7937
8317
  icon: json["icon"],
7938
8318
  id: json["id"],
7939
- lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : json["lifecycle_phase"],
8319
+ lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON2(json["lifecycle_phase"]),
7940
8320
  maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
7941
8321
  name: json["name"],
7942
8322
  plans: json["plans"].map(PreviewObjectFromJSON2),
@@ -7948,6 +8328,14 @@ function FeatureDetailResponseDataFromJSONTyped6(json, ignoreDiscriminator) {
7948
8328
  };
7949
8329
  }
7950
8330
 
8331
+ // src/api/componentspublic/models/PlanControlledByType.ts
8332
+ function PlanControlledByTypeFromJSON2(json) {
8333
+ return PlanControlledByTypeFromJSONTyped5(json, false);
8334
+ }
8335
+ function PlanControlledByTypeFromJSONTyped5(json, ignoreDiscriminator) {
8336
+ return json;
8337
+ }
8338
+
7951
8339
  // src/api/componentspublic/models/PlanCreditGrantView.ts
7952
8340
  function PlanCreditGrantViewFromJSON2(json) {
7953
8341
  return PlanCreditGrantViewFromJSONTyped4(json, false);
@@ -7960,8 +8348,12 @@ function PlanCreditGrantViewFromJSONTyped4(json, ignoreDiscriminator) {
7960
8348
  billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
7961
8349
  billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
7962
8350
  billingCreditAutoTopupEnabled: json["billing_credit_auto_topup_enabled"],
7963
- billingCreditAutoTopupExpiryType: json["billing_credit_auto_topup_expiry_type"] == null ? void 0 : json["billing_credit_auto_topup_expiry_type"],
7964
- billingCreditAutoTopupExpiryUnit: json["billing_credit_auto_topup_expiry_unit"] == null ? void 0 : json["billing_credit_auto_topup_expiry_unit"],
8351
+ billingCreditAutoTopupExpiryType: json["billing_credit_auto_topup_expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON2(
8352
+ json["billing_credit_auto_topup_expiry_type"]
8353
+ ),
8354
+ billingCreditAutoTopupExpiryUnit: json["billing_credit_auto_topup_expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON2(
8355
+ json["billing_credit_auto_topup_expiry_unit"]
8356
+ ),
7965
8357
  billingCreditAutoTopupExpiryUnitCount: json["billing_credit_auto_topup_expiry_unit_count"] == null ? void 0 : json["billing_credit_auto_topup_expiry_unit_count"],
7966
8358
  billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
7967
8359
  createdAt: new Date(json["created_at"]),
@@ -7970,21 +8362,31 @@ function PlanCreditGrantViewFromJSONTyped4(json, ignoreDiscriminator) {
7970
8362
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
7971
8363
  creditId: json["credit_id"],
7972
8364
  creditName: json["credit_name"],
7973
- expiryType: json["expiry_type"] == null ? void 0 : json["expiry_type"],
7974
- expiryUnit: json["expiry_unit"] == null ? void 0 : json["expiry_unit"],
8365
+ expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON2(json["expiry_type"]),
8366
+ expiryUnit: json["expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON2(json["expiry_unit"]),
7975
8367
  expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
7976
8368
  id: json["id"],
7977
8369
  planId: json["plan_id"],
7978
8370
  planName: json["plan_name"],
7979
8371
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
7980
- resetCadence: json["reset_cadence"],
7981
- resetStart: json["reset_start"],
7982
- resetType: json["reset_type"],
8372
+ resetCadence: BillingPlanCreditGrantResetCadenceFromJSON2(
8373
+ json["reset_cadence"]
8374
+ ),
8375
+ resetStart: BillingPlanCreditGrantResetStartFromJSON2(json["reset_start"]),
8376
+ resetType: BillingPlanCreditGrantResetTypeFromJSON2(json["reset_type"]),
7983
8377
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
7984
8378
  updatedAt: new Date(json["updated_at"])
7985
8379
  };
7986
8380
  }
7987
8381
 
8382
+ // src/api/componentspublic/models/PlanType.ts
8383
+ function PlanTypeFromJSON2(json) {
8384
+ return PlanTypeFromJSONTyped6(json, false);
8385
+ }
8386
+ function PlanTypeFromJSONTyped6(json, ignoreDiscriminator) {
8387
+ return json;
8388
+ }
8389
+
7988
8390
  // src/api/componentspublic/models/PlanResponseData.ts
7989
8391
  function PlanResponseDataFromJSON2(json) {
7990
8392
  return PlanResponseDataFromJSONTyped4(json, false);
@@ -8000,7 +8402,7 @@ function PlanResponseDataFromJSONTyped4(json, ignoreDiscriminator) {
8000
8402
  icon: json["icon"],
8001
8403
  id: json["id"],
8002
8404
  name: json["name"],
8003
- planType: json["plan_type"],
8405
+ planType: PlanTypeFromJSON2(json["plan_type"]),
8004
8406
  updatedAt: new Date(json["updated_at"])
8005
8407
  };
8006
8408
  }
@@ -8027,7 +8429,7 @@ function PlanEntitlementResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
8027
8429
  metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
8028
8430
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON2(json["plan"]),
8029
8431
  planId: json["plan_id"],
8030
- priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
8432
+ priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON2(json["price_behavior"]),
8031
8433
  ruleId: json["rule_id"],
8032
8434
  ruleIdUsageExceeded: json["rule_id_usage_exceeded"] == null ? void 0 : json["rule_id_usage_exceeded"],
8033
8435
  softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
@@ -8038,7 +8440,7 @@ function PlanEntitlementResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
8038
8440
  valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
8039
8441
  valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON2(json["value_trait"]),
8040
8442
  valueTraitId: json["value_trait_id"] == null ? void 0 : json["value_trait_id"],
8041
- valueType: json["value_type"]
8443
+ valueType: EntitlementValueTypeFromJSON2(json["value_type"])
8042
8444
  };
8043
8445
  }
8044
8446
 
@@ -8053,10 +8455,10 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8053
8455
  return {
8054
8456
  audienceType: json["audience_type"] == null ? void 0 : json["audience_type"],
8055
8457
  billingProduct: json["billing_product"] == null ? void 0 : BillingProductDetailResponseDataFromJSON2(json["billing_product"]),
8056
- chargeType: json["charge_type"],
8458
+ chargeType: ChargeTypeFromJSON2(json["charge_type"]),
8057
8459
  companyCount: json["company_count"],
8058
8460
  compatiblePlanIds: json["compatible_plan_ids"],
8059
- controlledBy: json["controlled_by"],
8461
+ controlledBy: PlanControlledByTypeFromJSON2(json["controlled_by"]),
8060
8462
  createdAt: new Date(json["created_at"]),
8061
8463
  custom: json["custom"],
8062
8464
  customPlanConfig: json["custom_plan_config"] == null ? void 0 : CustomPlanConfigFromJSON2(json["custom_plan_config"]),
@@ -8079,7 +8481,7 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8079
8481
  monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["monthly_price"]),
8080
8482
  name: json["name"],
8081
8483
  oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["one_time_price"]),
8082
- planType: json["plan_type"],
8484
+ planType: PlanTypeFromJSON2(json["plan_type"]),
8083
8485
  trialDays: json["trial_days"] == null ? void 0 : json["trial_days"],
8084
8486
  updatedAt: new Date(json["updated_at"]),
8085
8487
  yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["yearly_price"])
@@ -8194,7 +8596,8 @@ function normalize(data) {
8194
8596
  taxCollectionEnabled: false
8195
8597
  },
8196
8598
  creditBundles: [],
8197
- creditGrants: []
8599
+ creditGrants: [],
8600
+ preventSelfServiceDowngrade: false
8198
8601
  });
8199
8602
  }
8200
8603
  var reducer = (state, action) => {
@@ -8315,12 +8718,29 @@ var reducer = (state, action) => {
8315
8718
  };
8316
8719
  }
8317
8720
  case "SET_PLANID_BYPASS": {
8721
+ const isStringFormat = typeof action.config === "string";
8722
+ const config = isStringFormat ? { planId: action.config, hideSkipped: false } : action.config;
8723
+ let bypassPlanSelection;
8724
+ let bypassAddOnSelection;
8725
+ if (config.skipped !== void 0) {
8726
+ bypassPlanSelection = config.skipped.planStage ?? false;
8727
+ bypassAddOnSelection = config.skipped.addOnStage ?? false;
8728
+ } else if (isStringFormat) {
8729
+ bypassPlanSelection = true;
8730
+ bypassAddOnSelection = false;
8731
+ } else {
8732
+ bypassPlanSelection = false;
8733
+ bypassAddOnSelection = false;
8734
+ }
8318
8735
  return {
8319
8736
  ...state,
8320
8737
  layout: "checkout",
8321
8738
  checkoutState: {
8322
- planId: action.planId,
8323
- bypassPlanSelection: true
8739
+ ...config.planId && { planId: config.planId },
8740
+ bypassPlanSelection,
8741
+ bypassAddOnSelection,
8742
+ ...config.addOnIds && { addOnIds: config.addOnIds },
8743
+ hideSkippedStages: config.hideSkipped ?? false
8324
8744
  }
8325
8745
  };
8326
8746
  }
@@ -8330,7 +8750,7 @@ var reducer = (state, action) => {
8330
8750
  // src/context/EmbedProvider.tsx
8331
8751
  var import_jsx_runtime2 = require("react/jsx-runtime");
8332
8752
  var getCustomHeaders = (sessionId) => ({
8333
- "X-Schematic-Components-Version": "2.2.0",
8753
+ "X-Schematic-Components-Version": "2.3.1",
8334
8754
  "X-Schematic-Session-ID": sessionId
8335
8755
  });
8336
8756
  var EmbedProvider = ({
@@ -8622,8 +9042,8 @@ var EmbedProvider = ({
8622
9042
  const setCheckoutState = (0, import_react4.useCallback)((state2) => {
8623
9043
  dispatch({ type: "SET_CHECKOUT_STATE", state: state2 });
8624
9044
  }, []);
8625
- const initializeWithPlan = (0, import_react4.useCallback)((planId) => {
8626
- dispatch({ type: "SET_PLANID_BYPASS", planId });
9045
+ const initializeWithPlan = (0, import_react4.useCallback)((config) => {
9046
+ dispatch({ type: "SET_PLANID_BYPASS", config });
8627
9047
  }, []);
8628
9048
  (0, import_react4.useEffect)(() => {
8629
9049
  const element = document.getElementById(
@@ -8994,10 +9414,10 @@ var Box = dt("div")((props) => {
8994
9414
  for (const [key, value] of Object.entries(props.$viewport || {})) {
8995
9415
  styles.push(lt`
8996
9416
  ${{
8997
- sm: "@container (min-width: 640px)",
8998
- md: "@container (min-width: 768px)",
8999
- lg: "@container (min-width: 1024px)",
9000
- xl: "@container (min-width: 1280px)",
9417
+ "sm": "@container (min-width: 640px)",
9418
+ "md": "@container (min-width: 768px)",
9419
+ "lg": "@container (min-width: 1024px)",
9420
+ "xl": "@container (min-width: 1280px)",
9001
9421
  "2xl": "@container (min-width: 1536px)"
9002
9422
  }[key] || key} {
9003
9423
  ${Object.entries(value || {}).reduce(reducer2, [])}
@@ -9489,8 +9909,8 @@ var Overlay = dt(Box)`
9489
9909
  scrollbar-gutter: stable both-edges;
9490
9910
  `;
9491
9911
  var Modal = dt.div.attrs({
9492
- tabIndex: 0,
9493
- role: "dialog",
9912
+ "tabIndex": 0,
9913
+ "role": "dialog",
9494
9914
  "aria-modal": true
9495
9915
  })`
9496
9916
  position: relative;
@@ -10319,9 +10739,6 @@ var StageButton = ({
10319
10739
  checkout,
10320
10740
  checkoutStage,
10321
10741
  checkoutStages,
10322
- hasAddOns,
10323
- hasPayInAdvanceEntitlements,
10324
- hasCreditBundles,
10325
10742
  hasPaymentMethod,
10326
10743
  hasPlan,
10327
10744
  inEditMode,
@@ -10336,7 +10753,31 @@ var StageButton = ({
10336
10753
  }) => {
10337
10754
  const { t: t2 } = (0, import_react_i18next6.useTranslation)();
10338
10755
  const isDisabled = isLoading || !hasPlan || inEditMode;
10756
+ const getNextStageId = (currentStageId) => {
10757
+ if (!checkoutStages) return void 0;
10758
+ const currentIndex = checkoutStages.findIndex(
10759
+ (s2) => s2.id === currentStageId
10760
+ );
10761
+ return checkoutStages[currentIndex + 1]?.id;
10762
+ };
10763
+ const getStageDisplayName = (stageId) => {
10764
+ switch (stageId) {
10765
+ case "usage":
10766
+ return t2("Usage");
10767
+ case "addons":
10768
+ return t2("Addons");
10769
+ case "addonsUsage":
10770
+ return t2("Add-ons Quantity");
10771
+ case "credits":
10772
+ return t2("Credits");
10773
+ case "checkout":
10774
+ return t2("Checkout");
10775
+ default:
10776
+ return t2("Checkout");
10777
+ }
10778
+ };
10339
10779
  if (checkoutStage === "plan") {
10780
+ const nextStage = getNextStageId("plan");
10340
10781
  if (isSelectedPlanTrialable && trialPaymentMethodRequired && shouldTrial) {
10341
10782
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
10342
10783
  Button,
@@ -10366,9 +10807,7 @@ var StageButton = ({
10366
10807
  }
10367
10808
  );
10368
10809
  }
10369
- if (!isPaymentMethodRequired && !checkoutStages?.some(
10370
- (stage) => stage.id === "usage" || stage.id === "addons" || stage.id === "credits"
10371
- )) {
10810
+ if (!isPaymentMethodRequired && !nextStage) {
10372
10811
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
10373
10812
  NoPaymentRequired,
10374
10813
  {
@@ -10385,27 +10824,23 @@ var StageButton = ({
10385
10824
  type: "button",
10386
10825
  disabled: isDisabled,
10387
10826
  onClick: async () => {
10388
- setCheckoutStage?.(
10389
- hasPayInAdvanceEntitlements ? "usage" : hasAddOns ? "addons" : hasCreditBundles ? "credits" : "checkout"
10390
- );
10827
+ setCheckoutStage?.(nextStage ?? "checkout");
10391
10828
  },
10392
10829
  $isLoading: isLoading,
10393
10830
  $fullWidth: true,
10394
10831
  $size: isSticky ? "sm" : "md",
10395
10832
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Flex, { $gap: "0.5rem", $justifyContent: "center", $alignItems: "center", children: [
10396
10833
  t2("Next"),
10397
- ":",
10398
- " ",
10399
- hasPayInAdvanceEntitlements ? t2("Usage") : hasAddOns ? t2("Addons") : hasCreditBundles ? t2("Credits") : t2("Checkout"),
10834
+ ": ",
10835
+ getStageDisplayName(nextStage),
10400
10836
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon3, { name: "arrow-right" })
10401
10837
  ] })
10402
10838
  }
10403
10839
  );
10404
10840
  }
10405
10841
  if (checkoutStage === "usage") {
10406
- if (!isPaymentMethodRequired && !checkoutStages?.some(
10407
- (stage) => stage.id === "addons" || stage.id === "credits"
10408
- )) {
10842
+ const nextStage = getNextStageId("usage");
10843
+ if (!isPaymentMethodRequired && !nextStage) {
10409
10844
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
10410
10845
  NoPaymentRequired,
10411
10846
  {
@@ -10422,9 +10857,7 @@ var StageButton = ({
10422
10857
  type: "button",
10423
10858
  disabled: isDisabled,
10424
10859
  onClick: async () => {
10425
- setCheckoutStage?.(
10426
- hasAddOns ? "addons" : hasCreditBundles ? "credits" : "checkout"
10427
- );
10860
+ setCheckoutStage?.(nextStage ?? "checkout");
10428
10861
  },
10429
10862
  $isLoading: isLoading,
10430
10863
  $fullWidth: true,
@@ -10438,9 +10871,8 @@ var StageButton = ({
10438
10871
  $padding: "0 1rem",
10439
10872
  children: [
10440
10873
  t2("Next"),
10441
- ":",
10442
- " ",
10443
- hasAddOns ? t2("Addons") : hasCreditBundles ? t2("Credits") : t2("Checkout"),
10874
+ ": ",
10875
+ getStageDisplayName(nextStage),
10444
10876
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon3, { name: "arrow-right" })
10445
10877
  ]
10446
10878
  }
@@ -10449,13 +10881,8 @@ var StageButton = ({
10449
10881
  );
10450
10882
  }
10451
10883
  if (checkoutStage === "addons") {
10452
- const hasAddonsUsageStage = checkoutStages?.some(
10453
- (stage) => stage.id === "addonsUsage"
10454
- );
10455
- const hasCreditsStage = checkoutStages?.some(
10456
- (stage) => stage.id === "credits"
10457
- );
10458
- if (!isPaymentMethodRequired && !hasAddonsUsageStage && !hasCreditsStage) {
10884
+ const nextStage = getNextStageId("addons");
10885
+ if (!isPaymentMethodRequired && !nextStage) {
10459
10886
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
10460
10887
  NoPaymentRequired,
10461
10888
  {
@@ -10472,9 +10899,7 @@ var StageButton = ({
10472
10899
  type: "button",
10473
10900
  disabled: isDisabled,
10474
10901
  onClick: async () => {
10475
- setCheckoutStage?.(
10476
- hasAddonsUsageStage ? "addonsUsage" : hasCreditsStage ? "credits" : "checkout"
10477
- );
10902
+ setCheckoutStage?.(nextStage ?? "checkout");
10478
10903
  },
10479
10904
  $isLoading: isLoading,
10480
10905
  $fullWidth: true,
@@ -10487,9 +10912,8 @@ var StageButton = ({
10487
10912
  $padding: "0 1rem",
10488
10913
  children: [
10489
10914
  t2("Next"),
10490
- ":",
10491
- " ",
10492
- hasAddonsUsageStage ? t2("Add-ons Quantity") : hasCreditsStage ? t2("Credits") : t2("Checkout"),
10915
+ ": ",
10916
+ getStageDisplayName(nextStage),
10493
10917
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon3, { name: "arrow-right" })
10494
10918
  ]
10495
10919
  }
@@ -10498,7 +10922,8 @@ var StageButton = ({
10498
10922
  );
10499
10923
  }
10500
10924
  if (checkoutStage === "addonsUsage") {
10501
- if (!isPaymentMethodRequired && !checkoutStages?.some((stage) => stage.id === "credits")) {
10925
+ const nextStage = getNextStageId("addonsUsage");
10926
+ if (!isPaymentMethodRequired && !nextStage) {
10502
10927
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
10503
10928
  NoPaymentRequired,
10504
10929
  {
@@ -10515,7 +10940,7 @@ var StageButton = ({
10515
10940
  type: "button",
10516
10941
  disabled: isDisabled,
10517
10942
  onClick: async () => {
10518
- setCheckoutStage?.(hasCreditBundles ? "credits" : "checkout");
10943
+ setCheckoutStage?.(nextStage ?? "checkout");
10519
10944
  },
10520
10945
  $isLoading: isLoading,
10521
10946
  $fullWidth: true,
@@ -10530,7 +10955,7 @@ var StageButton = ({
10530
10955
  children: [
10531
10956
  t2("Next"),
10532
10957
  ": ",
10533
- hasCreditBundles ? t2("Credits") : t2("Checkout"),
10958
+ getStageDisplayName(nextStage),
10534
10959
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon3, { name: "arrow-right" })
10535
10960
  ]
10536
10961
  }
@@ -10742,6 +11167,10 @@ var Sidebar = (0, import_react20.forwardRef)(
10742
11167
  }, [charges]);
10743
11168
  const updatedUsageBasedEntitlements = (0, import_react20.useMemo)(() => {
10744
11169
  const changedUsageBasedEntitlements = [];
11170
+ const allSelectedUsageBasedEntitlements = [
11171
+ ...usageBasedEntitlements,
11172
+ ...addOnUsageBasedEntitlements
11173
+ ];
10745
11174
  const addedUsageBasedEntitlements = selectedPlan ? usageBasedEntitlements.reduce(
10746
11175
  (acc, selected) => {
10747
11176
  const changed = currentUsageBasedEntitlements.find(
@@ -10761,9 +11190,10 @@ var Sidebar = (0, import_react20.forwardRef)(
10761
11190
  ) : [];
10762
11191
  const removedUsageBasedEntitlements = selectedPlan ? currentUsageBasedEntitlements.reduce(
10763
11192
  (acc, current) => {
10764
- const match2 = usageBasedEntitlements.every(
10765
- (entitlement) => entitlement.id !== current.entitlementId
10766
- ) && currentEntitlements.find(
11193
+ const existsInSelected = allSelectedUsageBasedEntitlements.some(
11194
+ (entitlement) => entitlement.id === current.entitlementId
11195
+ );
11196
+ const match2 = !existsInSelected && currentEntitlements.find(
10767
11197
  (usage) => usage.entitlementId === current.entitlementId
10768
11198
  );
10769
11199
  if (match2) {
@@ -10789,7 +11219,8 @@ var Sidebar = (0, import_react20.forwardRef)(
10789
11219
  selectedPlan,
10790
11220
  currentEntitlements,
10791
11221
  currentUsageBasedEntitlements,
10792
- usageBasedEntitlements
11222
+ usageBasedEntitlements,
11223
+ addOnUsageBasedEntitlements
10793
11224
  ]);
10794
11225
  const selectedAddOns = (0, import_react20.useMemo)(
10795
11226
  () => addOns.filter((addOn) => addOn.isSelected),
@@ -10977,9 +11408,6 @@ var Sidebar = (0, import_react20.forwardRef)(
10977
11408
  checkout: handleCheckout,
10978
11409
  checkoutStage,
10979
11410
  checkoutStages,
10980
- hasAddOns: addOns.length > 0,
10981
- hasPayInAdvanceEntitlements: payInAdvanceEntitlements.length > 0,
10982
- hasCreditBundles: creditBundles.length > 0,
10983
11411
  hasPaymentMethod: typeof paymentMethod !== "undefined" || typeof paymentMethodId === "string",
10984
11412
  hasPlan: typeof selectedPlan !== "undefined",
10985
11413
  inEditMode: settings.mode === "edit",
@@ -11843,7 +12271,7 @@ var Checkout = ({
11843
12271
  if (!isPaymentMethodRequired) {
11844
12272
  return null;
11845
12273
  }
11846
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Flex, { $position: "relative", $flexDirection: "column", $gap: "1.5rem", children: [
12274
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Flex, { $flexDirection: "column", $gap: "1.5rem", children: [
11847
12275
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
11848
12276
  PaymentMethodDetails,
11849
12277
  {
@@ -12818,20 +13246,13 @@ var CheckoutDialog = ({ top = 0 }) => {
12818
13246
  );
12819
13247
  const [isLoading, setIsLoading] = (0, import_react23.useState)(false);
12820
13248
  const [error, setError] = (0, import_react23.useState)();
12821
- const {
12822
- currentPlanId,
12823
- currentEntitlements,
12824
- showPeriodToggle,
12825
- trialPaymentMethodRequired
12826
- } = (0, import_react23.useMemo)(() => {
13249
+ const { currentEntitlements, showPeriodToggle, trialPaymentMethodRequired } = (0, import_react23.useMemo)(() => {
12827
13250
  return {
12828
- currentPlanId: data?.company?.plan?.id,
12829
13251
  currentEntitlements: data?.featureUsage ? data.featureUsage.features : [],
12830
13252
  showPeriodToggle: data?.showPeriodToggle ?? true,
12831
13253
  trialPaymentMethodRequired: data?.trialPaymentMethodRequired === true
12832
13254
  };
12833
13255
  }, [
12834
- data?.company?.plan?.id,
12835
13256
  data?.featureUsage,
12836
13257
  data?.showPeriodToggle,
12837
13258
  data?.trialPaymentMethodRequired
@@ -12859,8 +13280,12 @@ var CheckoutDialog = ({ top = 0 }) => {
12859
13280
  const [addOns, setAddOns] = (0, import_react23.useState)(() => {
12860
13281
  return availableAddOns.map((addOn) => ({
12861
13282
  ...addOn,
12862
- isSelected: typeof checkoutState?.addOnId !== "undefined" ? addOn.id === checkoutState.addOnId : (data?.company?.addOns || []).some(
12863
- (currentAddOn) => addOn.id === currentAddOn.id
13283
+ isSelected: (
13284
+ // Check if bypassed with specific add-on IDs
13285
+ checkoutState?.addOnIds?.includes(addOn.id) || // Check if single add-on ID provided
13286
+ (typeof checkoutState?.addOnId !== "undefined" ? addOn.id === checkoutState.addOnId : (data?.company?.addOns || []).some(
13287
+ (currentAddOn) => addOn.id === currentAddOn.id
13288
+ ))
12864
13289
  )
12865
13290
  }));
12866
13291
  });
@@ -12880,19 +13305,47 @@ var CheckoutDialog = ({ top = 0 }) => {
12880
13305
  )
12881
13306
  );
12882
13307
  const [addOnUsageBasedEntitlements, setAddOnUsageBasedEntitlements] = (0, import_react23.useState)(() => {
12883
- return (data?.company?.addOns || []).flatMap((currentAddOn) => {
12884
- const availableAddOn = availableAddOns.find(
12885
- (available) => available.id === currentAddOn.id
12886
- );
12887
- if (!availableAddOn) return [];
12888
- return availableAddOn.entitlements.reduce(
12889
- createActiveUsageBasedEntitlementsReducer(
12890
- currentEntitlements,
12891
- planPeriod
12892
- ),
12893
- []
13308
+ const currentAddOnEntitlements = (data?.company?.addOns || []).flatMap(
13309
+ (currentAddOn) => {
13310
+ const availableAddOn = availableAddOns.find(
13311
+ (available) => available.id === currentAddOn.id
13312
+ );
13313
+ if (!availableAddOn) return [];
13314
+ return availableAddOn.entitlements.reduce(
13315
+ createActiveUsageBasedEntitlementsReducer(
13316
+ currentEntitlements,
13317
+ planPeriod
13318
+ ),
13319
+ []
13320
+ );
13321
+ }
13322
+ );
13323
+ const bypassAddOnEntitlements = (checkoutState?.addOnIds || []).flatMap(
13324
+ (addOnId) => {
13325
+ const availableAddOn = availableAddOns.find(
13326
+ (available) => available.id === addOnId
13327
+ );
13328
+ if (!availableAddOn) return [];
13329
+ return availableAddOn.entitlements.filter(
13330
+ (entitlement) => entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */
13331
+ ).map((entitlement) => ({
13332
+ ...entitlement,
13333
+ allocation: entitlement.valueNumeric || 0,
13334
+ usage: 0,
13335
+ quantity: 1
13336
+ }));
13337
+ }
13338
+ );
13339
+ const allEntitlements = [...currentAddOnEntitlements];
13340
+ for (const bypassEnt of bypassAddOnEntitlements) {
13341
+ const exists = currentAddOnEntitlements.some(
13342
+ (current) => current.featureId === bypassEnt.featureId
12894
13343
  );
12895
- });
13344
+ if (!exists) {
13345
+ allEntitlements.push(bypassEnt);
13346
+ }
13347
+ }
13348
+ return allEntitlements;
12896
13349
  });
12897
13350
  const payInAdvanceEntitlements = (0, import_react23.useMemo)(
12898
13351
  () => usageBasedEntitlements.filter(
@@ -12981,6 +13434,10 @@ var CheckoutDialog = ({ top = 0 }) => {
12981
13434
  isPaymentMethodRequired
12982
13435
  ]);
12983
13436
  const [hasSkippedInitialPlan, setHasSkippedInitialPlan] = (0, import_react23.useState)(false);
13437
+ const [hasSkippedInitialAddOns, setHasSkippedInitialAddOns] = (0, import_react23.useState)(false);
13438
+ const [isBypassLoading, setIsBypassLoading] = (0, import_react23.useState)(
13439
+ () => checkoutState?.bypassPlanSelection || checkoutState?.bypassAddOnSelection
13440
+ );
12984
13441
  const [checkoutStage, setCheckoutStage] = (0, import_react23.useState)(() => {
12985
13442
  if (checkoutState?.addOnId) {
12986
13443
  return "addons";
@@ -12994,24 +13451,35 @@ var CheckoutDialog = ({ top = 0 }) => {
12994
13451
  if (checkoutState?.credits) {
12995
13452
  return "credits";
12996
13453
  }
12997
- if (typeof checkoutState?.planId !== "undefined" && checkoutState.planId !== currentPlanId || checkoutState?.bypassPlanSelection) {
13454
+ if (checkoutState?.bypassPlanSelection) {
12998
13455
  return checkoutStages.some((stage) => stage.id === "usage") ? "usage" : checkoutStages.some((stage) => stage.id === "addons") ? "addons" : checkoutStages.some((stage) => stage.id === "addonsUsage") ? "addonsUsage" : checkoutStages.some((stage) => stage.id === "credits") ? "credits" : checkoutStages.some((stage) => stage.id === "checkout") ? "checkout" : checkoutStages[0]?.id || "plan";
12999
13456
  }
13000
13457
  return "plan";
13001
13458
  });
13002
13459
  (0, import_react23.useEffect)(() => {
13003
13460
  if (checkoutState?.bypassPlanSelection && checkoutStage === "plan" && !hasSkippedInitialPlan) {
13004
- const nextStage = checkoutStages.find((stage) => stage.id !== "plan");
13461
+ const currentIndex = checkoutStages.findIndex((s2) => s2.id === "plan");
13462
+ const nextStage = checkoutStages[currentIndex + 1];
13005
13463
  if (nextStage) {
13006
13464
  setHasSkippedInitialPlan(true);
13007
13465
  setCheckoutStage(nextStage.id);
13008
13466
  }
13009
13467
  }
13468
+ if (checkoutState?.bypassAddOnSelection && checkoutStage === "addons" && !hasSkippedInitialAddOns) {
13469
+ const currentIndex = checkoutStages.findIndex((s2) => s2.id === "addons");
13470
+ const nextStage = checkoutStages[currentIndex + 1];
13471
+ if (nextStage) {
13472
+ setHasSkippedInitialAddOns(true);
13473
+ setCheckoutStage(nextStage.id);
13474
+ }
13475
+ }
13010
13476
  }, [
13011
13477
  checkoutStages,
13012
13478
  checkoutState?.bypassPlanSelection,
13479
+ checkoutState?.bypassAddOnSelection,
13013
13480
  checkoutStage,
13014
- hasSkippedInitialPlan
13481
+ hasSkippedInitialPlan,
13482
+ hasSkippedInitialAddOns
13015
13483
  ]);
13016
13484
  const handlePreviewCheckout = (0, import_react23.useCallback)(
13017
13485
  async (updates) => {
@@ -13122,6 +13590,9 @@ var CheckoutDialog = ({ top = 0 }) => {
13122
13590
  setError(msg);
13123
13591
  } finally {
13124
13592
  setIsLoading(false);
13593
+ if (isBypassLoading) {
13594
+ setIsBypassLoading(false);
13595
+ }
13125
13596
  }
13126
13597
  },
13127
13598
  [
@@ -13134,7 +13605,8 @@ var CheckoutDialog = ({ top = 0 }) => {
13134
13605
  addOns,
13135
13606
  creditBundles,
13136
13607
  shouldTrial,
13137
- promoCode
13608
+ promoCode,
13609
+ isBypassLoading
13138
13610
  ]
13139
13611
  );
13140
13612
  const selectPlan = (0, import_react23.useCallback)(
@@ -13281,34 +13753,29 @@ var CheckoutDialog = ({ top = 0 }) => {
13281
13753
  },
13282
13754
  [handlePreviewCheckout]
13283
13755
  );
13756
+ const hasInitializedPlan = (0, import_react23.useRef)(false);
13284
13757
  (0, import_react23.useEffect)(() => {
13285
- if (selectedPlan) {
13758
+ if (!hasInitializedPlan.current && selectedPlan) {
13759
+ hasInitializedPlan.current = true;
13286
13760
  selectPlan({ plan: selectedPlan, period: currentPeriod });
13287
13761
  }
13288
- }, []);
13762
+ }, [selectedPlan, currentPeriod, selectPlan]);
13289
13763
  (0, import_react23.useEffect)(() => {
13290
13764
  if (checkoutState?.planId) {
13291
13765
  const plan = availablePlans.find(
13292
13766
  (plan2) => plan2.id === checkoutState.planId
13293
13767
  );
13294
- setSelectedPlan(plan);
13295
- }
13296
- }, [availablePlans, checkoutState?.planId]);
13297
- (0, import_react23.useEffect)(() => {
13298
- if (checkoutState?.addOnId) {
13299
- const checkoutStateAddOn = availableAddOns.find(
13300
- (addOn) => addOn.id === checkoutState.addOnId
13301
- );
13302
- setAddOns(
13303
- (prev2) => prev2.map((addOn) => ({
13304
- ...addOn,
13305
- ...addOn.id === checkoutStateAddOn?.id && {
13306
- isSelected: true
13307
- }
13308
- }))
13309
- );
13768
+ if (plan && plan.id !== selectedPlan?.id) {
13769
+ selectPlan({ plan, period: currentPeriod });
13770
+ }
13310
13771
  }
13311
- }, [availableAddOns, checkoutState?.addOnId]);
13772
+ }, [
13773
+ availablePlans,
13774
+ checkoutState?.planId,
13775
+ currentPeriod,
13776
+ selectPlan,
13777
+ selectedPlan?.id
13778
+ ]);
13312
13779
  (0, import_react23.useEffect)(() => {
13313
13780
  setAddOns((prevAddOns) => {
13314
13781
  return availableAddOns.filter((availAddOn) => {
@@ -13350,7 +13817,36 @@ var CheckoutDialog = ({ top = 0 }) => {
13350
13817
  const activeCheckoutStage = checkoutStages.find(
13351
13818
  (stage) => stage.id === checkoutStage
13352
13819
  );
13353
- const shouldShowBypassOverlay = checkoutState?.bypassPlanSelection && checkoutStage === "plan" && !hasSkippedInitialPlan;
13820
+ const visibleStages = (0, import_react23.useMemo)(() => {
13821
+ if (!checkoutState?.hideSkippedStages) {
13822
+ return checkoutStages;
13823
+ }
13824
+ return checkoutStages.filter((stage) => {
13825
+ if (stage.id === "plan" && checkoutState.bypassPlanSelection) {
13826
+ return false;
13827
+ }
13828
+ if (stage.id === "addons" && checkoutState.bypassAddOnSelection) {
13829
+ return false;
13830
+ }
13831
+ return true;
13832
+ });
13833
+ }, [checkoutStages, checkoutState]);
13834
+ const navigableStages = (0, import_react23.useMemo)(() => {
13835
+ return checkoutStages.filter((stage) => {
13836
+ if (stage.id === "plan" && checkoutState?.bypassPlanSelection) {
13837
+ return false;
13838
+ }
13839
+ if (stage.id === "addons" && checkoutState?.bypassAddOnSelection) {
13840
+ return false;
13841
+ }
13842
+ return true;
13843
+ });
13844
+ }, [
13845
+ checkoutStages,
13846
+ checkoutState?.bypassPlanSelection,
13847
+ checkoutState?.bypassAddOnSelection
13848
+ ]);
13849
+ const shouldShowBypassOverlay = isBypassLoading || checkoutState?.bypassPlanSelection && checkoutStage === "plan" && !hasSkippedInitialPlan || checkoutState?.bypassAddOnSelection && checkoutStage === "addons" && !hasSkippedInitialAddOns;
13354
13850
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Modal2, { ref: modalRef, size: "lg", top, children: [
13355
13851
  shouldShowBypassOverlay && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
13356
13852
  Flex,
@@ -13384,12 +13880,12 @@ var CheckoutDialog = ({ top = 0 }) => {
13384
13880
  $gap: "1rem"
13385
13881
  }
13386
13882
  },
13387
- children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
13883
+ children: visibleStages.map((stage, index, stages) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
13388
13884
  Navigation,
13389
13885
  {
13390
13886
  name: stage.name,
13391
13887
  index,
13392
- activeIndex: checkoutStages.findIndex(
13888
+ activeIndex: visibleStages.findIndex(
13393
13889
  (s2) => s2.id === checkoutStage
13394
13890
  ),
13395
13891
  isLast: index === stages.length - 1,
@@ -13534,7 +14030,7 @@ var CheckoutDialog = ({ top = 0 }) => {
13534
14030
  creditBundles,
13535
14031
  charges,
13536
14032
  checkoutStage,
13537
- checkoutStages,
14033
+ checkoutStages: navigableStages,
13538
14034
  error,
13539
14035
  isLoading,
13540
14036
  isPaymentMethodRequired,
@@ -15792,7 +16288,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
15792
16288
  }
15793
16289
  stripe._registerWrapper({
15794
16290
  name: "stripe-js",
15795
- version: "8.3.0",
16291
+ version: "8.4.0",
15796
16292
  startTime
15797
16293
  });
15798
16294
  };
@@ -15867,7 +16363,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
15867
16363
  var version = runtimeVersionToUrlVersion(maybeStripe.version);
15868
16364
  var expectedVersion = RELEASE_TRAIN;
15869
16365
  if (isTestKey && version !== expectedVersion) {
15870
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.3.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
16366
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
15871
16367
  }
15872
16368
  var stripe = maybeStripe.apply(void 0, args);
15873
16369
  registerWrapper(stripe, startTime);
@@ -16061,7 +16557,7 @@ var PaymentMethodDetails = ({
16061
16557
  showPaymentForm,
16062
16558
  initializePaymentMethod
16063
16559
  ]);
16064
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
16560
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Flex, { $position: "relative", $flexDirection: "column", $gap: "1.5rem", children: [
16065
16561
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
16066
16562
  Flex,
16067
16563
  {
@@ -22380,7 +22876,7 @@ var Loading = () => {
22380
22876
  $alignItems: "center",
22381
22877
  $justifyContent: "center",
22382
22878
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
22383
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Loader, { $color: "#194BFB", $size: "2xl" })
22879
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Loader, { $color: settings.theme.primary, $size: "2xl" })
22384
22880
  }
22385
22881
  );
22386
22882
  };