@schematichq/schematic-components 1.4.3 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6703,6 +6703,7 @@ var en_default = {
6703
6703
  "After the trial, cancel": "After the trial, you will be downgraded to the {{defaultPlanName}} plan and your subscription will be cancelled.",
6704
6704
  "After the trial, subscribe": "After the trial, subscription starts and you will be billed.",
6705
6705
  "Amount off": "{{amount}} off",
6706
+ "An invoice is created when charges reach $X; the rest is billed monthly.": "An invoice is created when charges reach {{amount}}; the rest is billed monthly.",
6706
6707
  "An unknown error occurred.": "An unknown error occurred.",
6707
6708
  Billed: "Billed {{period}}",
6708
6709
  "Cancel subscription": "Cancel subscription",
@@ -6738,6 +6739,7 @@ var en_default = {
6738
6739
  Expired: "Expired",
6739
6740
  "Expires in X months": "Expires in {{months}} mo",
6740
6741
  Expires: "Expires {{date}}",
6742
+ Free: "Free",
6741
6743
  "Hide all": "Hide all",
6742
6744
  "Hide balance details": "Hide balance details",
6743
6745
  "Hide details": "Hide details",
@@ -7036,7 +7038,7 @@ import {
7036
7038
  useState as useState2
7037
7039
  } from "react";
7038
7040
 
7039
- // node_modules/uuid/dist/esm-browser/stringify.js
7041
+ // node_modules/uuid/dist-browser/stringify.js
7040
7042
  var byteToHex = [];
7041
7043
  for (let i2 = 0; i2 < 256; ++i2) {
7042
7044
  byteToHex.push((i2 + 256).toString(16).slice(1));
@@ -7045,7 +7047,7 @@ function unsafeStringify(arr, offset = 0) {
7045
7047
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
7046
7048
  }
7047
7049
 
7048
- // node_modules/uuid/dist/esm-browser/rng.js
7050
+ // node_modules/uuid/dist-browser/rng.js
7049
7051
  var getRandomValues;
7050
7052
  var rnds8 = new Uint8Array(16);
7051
7053
  function rng() {
@@ -7058,15 +7060,12 @@ function rng() {
7058
7060
  return getRandomValues(rnds8);
7059
7061
  }
7060
7062
 
7061
- // node_modules/uuid/dist/esm-browser/native.js
7063
+ // node_modules/uuid/dist-browser/native.js
7062
7064
  var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
7063
7065
  var native_default = { randomUUID };
7064
7066
 
7065
- // node_modules/uuid/dist/esm-browser/v4.js
7066
- function v4(options, buf, offset) {
7067
- if (native_default.randomUUID && !buf && !options) {
7068
- return native_default.randomUUID();
7069
- }
7067
+ // node_modules/uuid/dist-browser/v4.js
7068
+ function _v4(options, buf, offset) {
7070
7069
  options = options || {};
7071
7070
  const rnds = options.random ?? options.rng?.() ?? rng();
7072
7071
  if (rnds.length < 16) {
@@ -7086,6 +7085,12 @@ function v4(options, buf, offset) {
7086
7085
  }
7087
7086
  return unsafeStringify(rnds);
7088
7087
  }
7088
+ function v4(options, buf, offset) {
7089
+ if (native_default.randomUUID && !buf && !options) {
7090
+ return native_default.randomUUID();
7091
+ }
7092
+ return _v4(options, buf, offset);
7093
+ }
7089
7094
  var v4_default = v4;
7090
7095
 
7091
7096
  // src/api/checkoutexternal/runtime.ts
@@ -8639,6 +8644,22 @@ function ComponentResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8639
8644
  };
8640
8645
  }
8641
8646
 
8647
+ // src/api/checkoutexternal/models/CreditGrantDetail.ts
8648
+ function CreditGrantDetailFromJSON(json) {
8649
+ return CreditGrantDetailFromJSONTyped(json, false);
8650
+ }
8651
+ function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
8652
+ if (json == null) {
8653
+ return json;
8654
+ }
8655
+ return {
8656
+ creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
8657
+ expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
8658
+ grantReason: json["grant_reason"],
8659
+ quantity: json["quantity"]
8660
+ };
8661
+ }
8662
+
8642
8663
  // src/api/checkoutexternal/models/FeatureUsageResponseData.ts
8643
8664
  function FeatureUsageResponseDataFromJSON(json) {
8644
8665
  return FeatureUsageResponseDataFromJSONTyped(json, false);
@@ -8652,8 +8673,18 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8652
8673
  allocation: json["allocation"] == null ? void 0 : json["allocation"],
8653
8674
  allocationType: json["allocation_type"],
8654
8675
  companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
8676
+ creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
8677
+ creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
8678
+ CreditGrantDetailFromJSON
8679
+ ),
8680
+ creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
8681
+ creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
8682
+ creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
8683
+ creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
8684
+ creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
8655
8685
  entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
8656
8686
  entitlementId: json["entitlement_id"],
8687
+ entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
8657
8688
  entitlementType: json["entitlement_type"],
8658
8689
  feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
8659
8690
  metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
@@ -8718,6 +8749,7 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8718
8749
  defaultPlan: json["default_plan"] == null ? void 0 : PlanDetailResponseDataFromJSON(json["default_plan"]),
8719
8750
  featureUsage: json["feature_usage"] == null ? void 0 : FeatureUsageDetailResponseDataFromJSON(json["feature_usage"]),
8720
8751
  showPeriodToggle: json["show_period_toggle"],
8752
+ showZeroPriceAsFree: json["show_zero_price_as_free"],
8721
8753
  stripeEmbed: json["stripe_embed"] == null ? void 0 : StripeEmbedInfoFromJSON(json["stripe_embed"]),
8722
8754
  subscription: json["subscription"] == null ? void 0 : CompanySubscriptionResponseDataFromJSON(json["subscription"]),
8723
8755
  trialPaymentMethodRequired: json["trial_payment_method_required"] == null ? void 0 : json["trial_payment_method_required"],
@@ -10270,7 +10302,8 @@ function PublicPlansResponseDataFromJSONTyped(json, ignoreDiscriminator) {
10270
10302
  CompatiblePlansFromJSON2
10271
10303
  ),
10272
10304
  capabilities: json["capabilities"] == null ? void 0 : ComponentCapabilitiesFromJSON2(json["capabilities"]),
10273
- showPeriodToggle: json["show_period_toggle"]
10305
+ showPeriodToggle: json["show_period_toggle"],
10306
+ showZeroPriceAsFree: json["show_zero_price_as_free"]
10274
10307
  };
10275
10308
  }
10276
10309
 
@@ -10468,7 +10501,7 @@ var EmbedProvider = ({
10468
10501
  });
10469
10502
  const customHeaders = useMemo3(
10470
10503
  () => ({
10471
- "X-Schematic-Components-Version": "1.4.3",
10504
+ "X-Schematic-Components-Version": "1.6.0",
10472
10505
  "X-Schematic-Session-ID": sessionIdRef.current
10473
10506
  }),
10474
10507
  []
@@ -11769,8 +11802,10 @@ import { createPortal } from "react-dom";
11769
11802
 
11770
11803
  // src/components/ui/tooltip/styles.ts
11771
11804
  var Trigger = dt(Box)`
11772
- width: 100%;
11773
- flex-grow: 1;
11805
+ ${({ $fullWidth = false }) => $fullWidth && lt`
11806
+ width: 100%;
11807
+ flex-grow: 1;
11808
+ `}
11774
11809
  `;
11775
11810
  var coords = (position2) => {
11776
11811
  let x2 = 0;
@@ -11916,6 +11951,7 @@ var Tooltip = ({
11916
11951
  trigger,
11917
11952
  content,
11918
11953
  position: position2 = "top",
11954
+ fullWidth = false,
11919
11955
  ...rest
11920
11956
  }) => {
11921
11957
  const ref = useRef5(null);
@@ -11956,6 +11992,7 @@ var Tooltip = ({
11956
11992
  ref,
11957
11993
  onPointerEnter: () => setShow(true),
11958
11994
  onPointerLeave: () => setShow(false),
11995
+ $fullWidth: fullWidth,
11959
11996
  ...rest,
11960
11997
  children: trigger
11961
11998
  }
@@ -12102,6 +12139,35 @@ var import_debounce3 = __toESM(require_debounce());
12102
12139
  import { forwardRef as forwardRef5, useLayoutEffect as useLayoutEffect5, useMemo as useMemo15, useState as useState12 } from "react";
12103
12140
  import { createPortal as createPortal2 } from "react-dom";
12104
12141
 
12142
+ // src/components/shared/billing-threshold-tooltip/BillingThresholdTooltip.tsx
12143
+ import { jsx as jsx10 } from "react/jsx-runtime";
12144
+ var BillingThresholdTooltip = ({
12145
+ billingThreshold
12146
+ }) => {
12147
+ const { t: t2 } = useTranslation();
12148
+ const { settings } = useEmbed();
12149
+ const isLightBackground = useIsLightBackground();
12150
+ return /* @__PURE__ */ jsx10(
12151
+ Tooltip,
12152
+ {
12153
+ content: /* @__PURE__ */ jsx10(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, children: t2(
12154
+ "An invoice is created when charges reach $X; the rest is billed monthly.",
12155
+ {
12156
+ amount: formatCurrency(billingThreshold)
12157
+ }
12158
+ ) }),
12159
+ trigger: /* @__PURE__ */ jsx10(
12160
+ Icon3,
12161
+ {
12162
+ title: "billing threshold",
12163
+ name: "info-rounded",
12164
+ color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`
12165
+ }
12166
+ )
12167
+ }
12168
+ );
12169
+ };
12170
+
12105
12171
  // src/components/shared/checkout-dialog/CheckoutDialog.tsx
12106
12172
  import {
12107
12173
  useCallback as useCallback9,
@@ -12119,7 +12185,7 @@ import {
12119
12185
  } from "react";
12120
12186
 
12121
12187
  // src/components/shared/sidebar/EntitlementRow.tsx
12122
- import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
12188
+ import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
12123
12189
  var EntitlementRow = (entitlement) => {
12124
12190
  const { t: t2 } = useTranslation();
12125
12191
  const { settings } = useEmbed();
@@ -12132,7 +12198,7 @@ var EntitlementRow = (entitlement) => {
12132
12198
  priceTier: priceTiers
12133
12199
  } = getEntitlementPrice(entitlement, planPeriod) || {};
12134
12200
  return /* @__PURE__ */ jsxs6(Fragment3, { children: [
12135
- /* @__PURE__ */ jsx10(Box, { children: /* @__PURE__ */ jsx10(Text, { display: "heading4", children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
12201
+ /* @__PURE__ */ jsx11(Box, { children: /* @__PURE__ */ jsx11(Text, { display: "heading4", children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
12136
12202
  quantity,
12137
12203
  " ",
12138
12204
  getFeatureName(feature, quantity)
@@ -12141,7 +12207,7 @@ var EntitlementRow = (entitlement) => {
12141
12207
  " ",
12142
12208
  getFeatureName(feature, softLimit)
12143
12209
  ] }) : feature.name }) }),
12144
- /* @__PURE__ */ jsx10(Box, { $whiteSpace: "nowrap", children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs6(Text, { children: [
12210
+ /* @__PURE__ */ jsx11(Box, { $whiteSpace: "nowrap", children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs6(Text, { children: [
12145
12211
  formatCurrency((price ?? 0) * quantity, currency),
12146
12212
  /* @__PURE__ */ jsxs6("sub", { children: [
12147
12213
  "/",
@@ -12165,17 +12231,8 @@ var EntitlementRow = (entitlement) => {
12165
12231
  shortenPeriod(planPeriod)
12166
12232
  ] })
12167
12233
  ] })
12168
- ] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs6(Flex, { $alignItems: "center", children: [
12169
- /* @__PURE__ */ jsx10(
12170
- PricingTiersTooltip,
12171
- {
12172
- feature,
12173
- period: planPeriod,
12174
- currency,
12175
- priceTiers
12176
- }
12177
- ),
12178
- /* @__PURE__ */ jsx10(
12234
+ ] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs6(Flex, { $alignItems: "end", children: [
12235
+ /* @__PURE__ */ jsx11(
12179
12236
  Text,
12180
12237
  {
12181
12238
  style: { opacity: 0.54 },
@@ -12183,6 +12240,15 @@ var EntitlementRow = (entitlement) => {
12183
12240
  $color: settings.theme.typography.text.color,
12184
12241
  children: t2("Tier-based")
12185
12242
  }
12243
+ ),
12244
+ /* @__PURE__ */ jsx11(
12245
+ PricingTiersTooltip,
12246
+ {
12247
+ feature,
12248
+ period: planPeriod,
12249
+ currency,
12250
+ priceTiers
12251
+ }
12186
12252
  )
12187
12253
  ] }) })
12188
12254
  ] });
@@ -12191,7 +12257,7 @@ var EntitlementRow = (entitlement) => {
12191
12257
 
12192
12258
  // src/components/shared/sidebar/Proration.tsx
12193
12259
  import { useState as useState6 } from "react";
12194
- import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
12260
+ import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
12195
12261
  var Proration = ({ currency, charges }) => {
12196
12262
  const { t: t2 } = useTranslation();
12197
12263
  const [open, setOpen] = useState6(false);
@@ -12201,19 +12267,19 @@ var Proration = ({ currency, charges }) => {
12201
12267
  setOpen((open2) => !open2);
12202
12268
  };
12203
12269
  return /* @__PURE__ */ jsxs7(Fragment4, { children: [
12204
- /* @__PURE__ */ jsx11(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx11(Text, { $size: 14, children: t2("Proration") }) }),
12270
+ /* @__PURE__ */ jsx12(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx12(Text, { $size: 14, children: t2("Proration") }) }),
12205
12271
  /* @__PURE__ */ jsxs7(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
12206
12272
  open && charges?.upcomingInvoiceLineItems.map(
12207
12273
  ({ amount, description }, index) => {
12208
12274
  return /* @__PURE__ */ jsxs7(Flex, { $gap: "1rem", children: [
12209
- /* @__PURE__ */ jsx11(Text, { children: description }),
12210
- /* @__PURE__ */ jsx11(Text, { children: formatCurrency(amount, currency) })
12275
+ /* @__PURE__ */ jsx12(Text, { children: description }),
12276
+ /* @__PURE__ */ jsx12(Text, { children: formatCurrency(amount, currency) })
12211
12277
  ] }, index);
12212
12278
  }
12213
12279
  ),
12214
12280
  /* @__PURE__ */ jsxs7(Flex, { $justifyContent: "space-between", $alignItems: "center", $gap: "1rem", children: [
12215
12281
  /* @__PURE__ */ jsxs7(Flex, { children: [
12216
- /* @__PURE__ */ jsx11(Text, { display: "heading4", children: t2("Total") }),
12282
+ /* @__PURE__ */ jsx12(Text, { display: "heading4", children: t2("Total") }),
12217
12283
  /* @__PURE__ */ jsxs7(
12218
12284
  Button,
12219
12285
  {
@@ -12222,20 +12288,20 @@ var Proration = ({ currency, charges }) => {
12222
12288
  style: { height: "auto", padding: 0 },
12223
12289
  $variant: "text",
12224
12290
  children: [
12225
- /* @__PURE__ */ jsx11(Icon3, { name: open ? "chevron-up" : "chevron-down" }),
12226
- /* @__PURE__ */ jsx11(Text, { children: open ? t2("Hide details") : t2("Show details") })
12291
+ /* @__PURE__ */ jsx12(Icon3, { name: open ? "chevron-up" : "chevron-down" }),
12292
+ /* @__PURE__ */ jsx12(Text, { children: open ? t2("Hide details") : t2("Show details") })
12227
12293
  ]
12228
12294
  }
12229
12295
  )
12230
12296
  ] }),
12231
- /* @__PURE__ */ jsx11(Flex, { children: /* @__PURE__ */ jsx11(Text, { children: formatCurrency(charges.proration, currency) }) })
12297
+ /* @__PURE__ */ jsx12(Flex, { children: /* @__PURE__ */ jsx12(Text, { children: formatCurrency(charges.proration, currency) }) })
12232
12298
  ] })
12233
12299
  ] })
12234
12300
  ] });
12235
12301
  };
12236
12302
 
12237
12303
  // src/components/shared/sidebar/StageButton.tsx
12238
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
12304
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
12239
12305
  var StageButton = ({
12240
12306
  checkout,
12241
12307
  checkoutStage,
@@ -12257,7 +12323,7 @@ var StageButton = ({
12257
12323
  const { t: t2 } = useTranslation();
12258
12324
  const isDisabled = isLoading || !hasPlan || inEditMode;
12259
12325
  const NoPaymentRequired = () => {
12260
- return /* @__PURE__ */ jsx12(
12326
+ return /* @__PURE__ */ jsx13(
12261
12327
  Button,
12262
12328
  {
12263
12329
  type: "button",
@@ -12271,7 +12337,7 @@ var StageButton = ({
12271
12337
  };
12272
12338
  if (checkoutStage === "plan") {
12273
12339
  if (isSelectedPlanTrialable && trialPaymentMethodRequired && shouldTrial) {
12274
- return /* @__PURE__ */ jsx12(
12340
+ return /* @__PURE__ */ jsx13(
12275
12341
  Button,
12276
12342
  {
12277
12343
  type: "button",
@@ -12292,7 +12358,7 @@ var StageButton = ({
12292
12358
  t2("Next"),
12293
12359
  ": ",
12294
12360
  t2("Checkout"),
12295
- /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12361
+ /* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
12296
12362
  ]
12297
12363
  }
12298
12364
  )
@@ -12302,9 +12368,9 @@ var StageButton = ({
12302
12368
  if (!isPaymentMethodRequired && !checkoutStages?.some(
12303
12369
  (stage) => stage.id === "usage" || stage.id === "addons" || stage.id === "credits"
12304
12370
  )) {
12305
- return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12371
+ return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
12306
12372
  }
12307
- return /* @__PURE__ */ jsx12(
12373
+ return /* @__PURE__ */ jsx13(
12308
12374
  Button,
12309
12375
  {
12310
12376
  type: "button",
@@ -12321,7 +12387,7 @@ var StageButton = ({
12321
12387
  ":",
12322
12388
  " ",
12323
12389
  hasPayInAdvanceEntitlements ? t2("Usage") : hasAddOns ? t2("Addons") : hasCreditBundles ? t2("Credits") : t2("Checkout"),
12324
- /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12390
+ /* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
12325
12391
  ] })
12326
12392
  }
12327
12393
  );
@@ -12330,9 +12396,9 @@ var StageButton = ({
12330
12396
  if (!isPaymentMethodRequired && !checkoutStages?.some(
12331
12397
  (stage) => stage.id === "addons" || stage.id === "credits"
12332
12398
  )) {
12333
- return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12399
+ return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
12334
12400
  }
12335
- return /* @__PURE__ */ jsx12(
12401
+ return /* @__PURE__ */ jsx13(
12336
12402
  Button,
12337
12403
  {
12338
12404
  type: "button",
@@ -12356,7 +12422,7 @@ var StageButton = ({
12356
12422
  ":",
12357
12423
  " ",
12358
12424
  hasAddOns ? t2("Addons") : hasCreditBundles ? t2("Credits") : t2("Checkout"),
12359
- /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12425
+ /* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
12360
12426
  ]
12361
12427
  }
12362
12428
  )
@@ -12371,9 +12437,9 @@ var StageButton = ({
12371
12437
  (stage) => stage.id === "credits"
12372
12438
  );
12373
12439
  if (!isPaymentMethodRequired && !hasAddonsUsageStage && !hasCreditsStage) {
12374
- return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12440
+ return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
12375
12441
  }
12376
- return /* @__PURE__ */ jsx12(
12442
+ return /* @__PURE__ */ jsx13(
12377
12443
  Button,
12378
12444
  {
12379
12445
  type: "button",
@@ -12397,7 +12463,7 @@ var StageButton = ({
12397
12463
  ":",
12398
12464
  " ",
12399
12465
  hasAddonsUsageStage ? t2("Add-ons Quantity") : hasCreditsStage ? t2("Credits") : t2("Checkout"),
12400
- /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12466
+ /* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
12401
12467
  ]
12402
12468
  }
12403
12469
  )
@@ -12406,9 +12472,9 @@ var StageButton = ({
12406
12472
  }
12407
12473
  if (checkoutStage === "addonsUsage") {
12408
12474
  if (!isPaymentMethodRequired && !checkoutStages?.some((stage) => stage.id === "credits")) {
12409
- return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12475
+ return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
12410
12476
  }
12411
- return /* @__PURE__ */ jsx12(
12477
+ return /* @__PURE__ */ jsx13(
12412
12478
  Button,
12413
12479
  {
12414
12480
  type: "button",
@@ -12429,7 +12495,7 @@ var StageButton = ({
12429
12495
  t2("Next"),
12430
12496
  ": ",
12431
12497
  hasCreditBundles ? t2("Credits") : t2("Checkout"),
12432
- /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12498
+ /* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
12433
12499
  ]
12434
12500
  }
12435
12501
  )
@@ -12438,9 +12504,9 @@ var StageButton = ({
12438
12504
  }
12439
12505
  if (checkoutStage === "credits") {
12440
12506
  if (!isPaymentMethodRequired) {
12441
- return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12507
+ return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
12442
12508
  }
12443
- return /* @__PURE__ */ jsx12(
12509
+ return /* @__PURE__ */ jsx13(
12444
12510
  Button,
12445
12511
  {
12446
12512
  type: "button",
@@ -12461,7 +12527,7 @@ var StageButton = ({
12461
12527
  t2("Next"),
12462
12528
  ": ",
12463
12529
  t2("Checkout"),
12464
- /* @__PURE__ */ jsx12(Icon3, { name: "arrow-right" })
12530
+ /* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
12465
12531
  ]
12466
12532
  }
12467
12533
  )
@@ -12470,9 +12536,9 @@ var StageButton = ({
12470
12536
  }
12471
12537
  if (checkoutStage === "checkout") {
12472
12538
  if (!isPaymentMethodRequired) {
12473
- return /* @__PURE__ */ jsx12(NoPaymentRequired, {});
12539
+ return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
12474
12540
  }
12475
- return /* @__PURE__ */ jsx12(
12541
+ return /* @__PURE__ */ jsx13(
12476
12542
  Button,
12477
12543
  {
12478
12544
  type: "button",
@@ -12487,7 +12553,7 @@ var StageButton = ({
12487
12553
  };
12488
12554
 
12489
12555
  // src/components/shared/sidebar/Sidebar.tsx
12490
- import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
12556
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
12491
12557
  var Sidebar = ({
12492
12558
  planPeriod,
12493
12559
  selectedPlan,
@@ -12670,6 +12736,10 @@ var Sidebar = ({
12670
12736
  () => creditBundles.filter((bundle) => bundle.count > 0),
12671
12737
  [creditBundles]
12672
12738
  );
12739
+ const discountApplied = useMemo7(
12740
+ () => promoCode && (amountOff > 0 || percentOff > 0),
12741
+ [promoCode, amountOff, percentOff]
12742
+ );
12673
12743
  const handleCheckout = useCallback8(async () => {
12674
12744
  const planId = selectedPlan?.id;
12675
12745
  const priceId = (planPeriod === "year" ? selectedPlan?.yearlyPrice : selectedPlan?.monthlyPrice)?.id;
@@ -12736,7 +12806,7 @@ var Sidebar = ({
12736
12806
  },
12737
12807
  []
12738
12808
  ),
12739
- skipTrial: !willTrialWithoutPaymentMethod,
12809
+ skipTrial: !shouldTrial,
12740
12810
  ...paymentMethodId && { paymentMethodId },
12741
12811
  ...promoCode && { promoCode }
12742
12812
  });
@@ -12762,7 +12832,7 @@ var Sidebar = ({
12762
12832
  setLayout,
12763
12833
  payInAdvanceEntitlements,
12764
12834
  addOnUsageBasedEntitlements,
12765
- willTrialWithoutPaymentMethod,
12835
+ shouldTrial,
12766
12836
  promoCode
12767
12837
  ]);
12768
12838
  const handleUnsubscribe = useCallback8(async () => {
@@ -12816,7 +12886,7 @@ var Sidebar = ({
12816
12886
  }
12817
12887
  },
12818
12888
  children: [
12819
- showHeader && /* @__PURE__ */ jsx13(
12889
+ showHeader && /* @__PURE__ */ jsx14(
12820
12890
  Flex,
12821
12891
  {
12822
12892
  $position: "relative",
@@ -12828,7 +12898,7 @@ var Sidebar = ({
12828
12898
  $borderBottomWidth: "1px",
12829
12899
  $borderStyle: "solid",
12830
12900
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
12831
- children: /* @__PURE__ */ jsx13(Flex, { $justifyContent: "space-between", children: /* @__PURE__ */ jsx13(Text, { as: "h3", display: "heading3", children: t2("Subscription") }) })
12901
+ children: /* @__PURE__ */ jsx14(Flex, { $justifyContent: "space-between", children: /* @__PURE__ */ jsx14(Text, { as: "h3", display: "heading3", children: t2("Subscription") }) })
12832
12902
  }
12833
12903
  ),
12834
12904
  /* @__PURE__ */ jsxs9(
@@ -12845,7 +12915,7 @@ var Sidebar = ({
12845
12915
  $borderStyle: "solid",
12846
12916
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
12847
12917
  children: [
12848
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { $size: 14, children: t2("Plan") }) }),
12918
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Plan") }) }),
12849
12919
  /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
12850
12920
  currentPlan && /* @__PURE__ */ jsxs9(
12851
12921
  Flex,
@@ -12859,8 +12929,8 @@ var Sidebar = ({
12859
12929
  $color: settings.theme.typography.heading4.color
12860
12930
  },
12861
12931
  children: [
12862
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { display: "heading4", children: currentPlan.name }) }),
12863
- typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsx13(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
12932
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: currentPlan.name }) }),
12933
+ typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
12864
12934
  formatCurrency(
12865
12935
  currentPlan.planPrice,
12866
12936
  billingSubscription?.currency
@@ -12874,7 +12944,7 @@ var Sidebar = ({
12874
12944
  }
12875
12945
  ),
12876
12946
  willPlanChange && /* @__PURE__ */ jsxs9(Box, { children: [
12877
- /* @__PURE__ */ jsx13(
12947
+ /* @__PURE__ */ jsx14(
12878
12948
  Box,
12879
12949
  {
12880
12950
  $width: "100%",
@@ -12882,7 +12952,7 @@ var Sidebar = ({
12882
12952
  $opacity: "50%",
12883
12953
  $marginBottom: "0.25rem",
12884
12954
  $marginTop: "-0.25rem",
12885
- children: /* @__PURE__ */ jsx13(
12955
+ children: /* @__PURE__ */ jsx14(
12886
12956
  Icon3,
12887
12957
  {
12888
12958
  name: "arrow-down",
@@ -12901,8 +12971,8 @@ var Sidebar = ({
12901
12971
  $alignItems: "center",
12902
12972
  $gap: "1rem",
12903
12973
  children: [
12904
- /* @__PURE__ */ jsx13(Flex, { children: /* @__PURE__ */ jsx13(Text, { display: "heading4", children: selectedPlan.name }) }),
12905
- /* @__PURE__ */ jsx13(Flex, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
12974
+ /* @__PURE__ */ jsx14(Flex, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: selectedPlan.name }) }),
12975
+ /* @__PURE__ */ jsx14(Flex, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
12906
12976
  formatCurrency(
12907
12977
  selectedPlanPrice ?? 0,
12908
12978
  selectedPlanCurrency
@@ -12918,12 +12988,12 @@ var Sidebar = ({
12918
12988
  ] })
12919
12989
  ] }),
12920
12990
  updatedUsageBasedEntitlements.willChange && /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
12921
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { $size: 14, children: t2("Usage-based") }) }),
12991
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Usage-based") }) }),
12922
12992
  updatedUsageBasedEntitlements.removed.reduce(
12923
12993
  (acc, entitlement, index) => {
12924
12994
  if (entitlement.feature?.name) {
12925
12995
  acc.push(
12926
- /* @__PURE__ */ jsx13(
12996
+ /* @__PURE__ */ jsx14(
12927
12997
  Flex,
12928
12998
  {
12929
12999
  $justifyContent: "space-between",
@@ -12932,7 +13002,7 @@ var Sidebar = ({
12932
13002
  $opacity: "0.625",
12933
13003
  $textDecoration: "line-through",
12934
13004
  $color: settings.theme.typography.heading4.color,
12935
- children: /* @__PURE__ */ jsx13(
13005
+ children: /* @__PURE__ */ jsx14(
12936
13006
  EntitlementRow,
12937
13007
  {
12938
13008
  ...entitlement,
@@ -12953,7 +13023,7 @@ var Sidebar = ({
12953
13023
  if (next2.feature?.name) {
12954
13024
  acc.push(
12955
13025
  /* @__PURE__ */ jsxs9(Box, { children: [
12956
- /* @__PURE__ */ jsx13(
13026
+ /* @__PURE__ */ jsx14(
12957
13027
  Flex,
12958
13028
  {
12959
13029
  $justifyContent: "space-between",
@@ -12962,16 +13032,16 @@ var Sidebar = ({
12962
13032
  $opacity: "0.625",
12963
13033
  $textDecoration: "line-through",
12964
13034
  $color: settings.theme.typography.heading4.color,
12965
- children: /* @__PURE__ */ jsx13(EntitlementRow, { ...previous, planPeriod })
13035
+ children: /* @__PURE__ */ jsx14(EntitlementRow, { ...previous, planPeriod })
12966
13036
  }
12967
13037
  ),
12968
- /* @__PURE__ */ jsx13(
13038
+ /* @__PURE__ */ jsx14(
12969
13039
  Flex,
12970
13040
  {
12971
13041
  $justifyContent: "space-between",
12972
13042
  $alignItems: "baseline",
12973
13043
  $gap: "1rem",
12974
- children: /* @__PURE__ */ jsx13(EntitlementRow, { ...next2, planPeriod })
13044
+ children: /* @__PURE__ */ jsx14(EntitlementRow, { ...next2, planPeriod })
12975
13045
  }
12976
13046
  )
12977
13047
  ] }, index)
@@ -12985,13 +13055,13 @@ var Sidebar = ({
12985
13055
  (acc, entitlement, index) => {
12986
13056
  if (entitlement.feature?.name) {
12987
13057
  acc.push(
12988
- /* @__PURE__ */ jsx13(
13058
+ /* @__PURE__ */ jsx14(
12989
13059
  Flex,
12990
13060
  {
12991
13061
  $justifyContent: "space-between",
12992
13062
  $alignItems: "baseline",
12993
13063
  $gap: "1rem",
12994
- children: /* @__PURE__ */ jsx13(
13064
+ children: /* @__PURE__ */ jsx14(
12995
13065
  EntitlementRow,
12996
13066
  {
12997
13067
  ...entitlement,
@@ -13009,7 +13079,7 @@ var Sidebar = ({
13009
13079
  )
13010
13080
  ] }),
13011
13081
  selectedPlan && isSelectedPlanTrialable && shouldTrial && /* @__PURE__ */ jsxs9(Box, { children: [
13012
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { $size: 14, children: t2("Trial") }) }),
13082
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Trial") }) }),
13013
13083
  /* @__PURE__ */ jsxs9(
13014
13084
  Flex,
13015
13085
  {
@@ -13017,19 +13087,19 @@ var Sidebar = ({
13017
13087
  $alignItems: "center",
13018
13088
  $gap: "1rem",
13019
13089
  children: [
13020
- /* @__PURE__ */ jsx13(Flex, { children: /* @__PURE__ */ jsx13(Text, { display: "heading4", children: t2("Ends on", { date: trialEndsOn.toLocaleDateString() }) }) }),
13021
- /* @__PURE__ */ jsx13(Flex, { children: /* @__PURE__ */ jsxs9(Text, { children: [
13090
+ /* @__PURE__ */ jsx14(Flex, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: t2("Ends on", { date: trialEndsOn.toLocaleDateString() }) }) }),
13091
+ /* @__PURE__ */ jsx14(Flex, { children: /* @__PURE__ */ jsxs9(Text, { children: [
13022
13092
  "-",
13023
13093
  formatCurrency(selectedPlanPrice ?? 0, selectedPlanCurrency),
13024
13094
  "/",
13025
- /* @__PURE__ */ jsx13("sub", { children: shortenPeriod(planPeriod) })
13095
+ /* @__PURE__ */ jsx14("sub", { children: shortenPeriod(planPeriod) })
13026
13096
  ] }) })
13027
13097
  ]
13028
13098
  }
13029
13099
  )
13030
13100
  ] }),
13031
13101
  (willAddOnsChange || selectedAddOns.length > 0) && /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
13032
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { $size: 14, children: t2("Add-ons") }) }),
13102
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Add-ons") }) }),
13033
13103
  removedAddOns.map((addOn, index) => {
13034
13104
  return /* @__PURE__ */ jsxs9(
13035
13105
  Flex,
@@ -13041,8 +13111,8 @@ var Sidebar = ({
13041
13111
  $textDecoration: "line-through",
13042
13112
  $color: settings.theme.typography.heading4.color,
13043
13113
  children: [
13044
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { display: "heading4", children: addOn.name }) }),
13045
- typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsx13(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
13114
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: addOn.name }) }),
13115
+ typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
13046
13116
  formatCurrency(addOn.planPrice, selectedPlanCurrency),
13047
13117
  addOn.planPeriod !== "one-time" && /* @__PURE__ */ jsxs9("sub", { children: [
13048
13118
  "/",
@@ -13063,8 +13133,8 @@ var Sidebar = ({
13063
13133
  $alignItems: "center",
13064
13134
  $gap: "1rem",
13065
13135
  children: [
13066
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { display: "heading4", children: addOn.name }) }),
13067
- /* @__PURE__ */ jsx13(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
13136
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: addOn.name }) }),
13137
+ /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
13068
13138
  formatCurrency(addOnPrice ?? 0, addOnCurrency),
13069
13139
  addOn.chargeType !== ChargeType.oneTime && /* @__PURE__ */ jsxs9("sub", { children: [
13070
13140
  "/",
@@ -13078,7 +13148,7 @@ var Sidebar = ({
13078
13148
  })
13079
13149
  ] }),
13080
13150
  addedCreditBundles.length > 0 && /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
13081
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { $size: 14, children: t2("Credits") }) }),
13151
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Credits") }) }),
13082
13152
  addedCreditBundles.reduce(
13083
13153
  (acc, bundle, index) => {
13084
13154
  const price = typeof bundle.price?.priceDecimal === "string" ? Number(bundle.price.priceDecimal) : typeof bundle.price?.price === "number" ? bundle.price.price : void 0;
@@ -13093,19 +13163,19 @@ var Sidebar = ({
13093
13163
  $gap: "1rem",
13094
13164
  children: [
13095
13165
  /* @__PURE__ */ jsxs9(Box, { children: [
13096
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsxs9(Text, { display: "heading4", children: [
13166
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs9(Text, { display: "heading4", children: [
13097
13167
  bundle.name,
13098
13168
  " (",
13099
13169
  bundle.count,
13100
13170
  ")"
13101
13171
  ] }) }),
13102
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsxs9(Text, { children: [
13172
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs9(Text, { children: [
13103
13173
  amount,
13104
13174
  " ",
13105
13175
  getFeatureName(bundle, amount)
13106
13176
  ] }) })
13107
13177
  ] }),
13108
- bundle.count > 0 && /* @__PURE__ */ jsx13(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx13(Text, { children: formatCurrency(
13178
+ bundle.count > 0 && /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(
13109
13179
  price * bundle.count,
13110
13180
  bundle.price?.currency
13111
13181
  ) }) })
@@ -13119,7 +13189,7 @@ var Sidebar = ({
13119
13189
  []
13120
13190
  )
13121
13191
  ] }),
13122
- proration !== 0 && charges && selectedPlanCurrency && /* @__PURE__ */ jsx13(
13192
+ proration !== 0 && charges && selectedPlanCurrency && /* @__PURE__ */ jsx14(
13123
13193
  Proration,
13124
13194
  {
13125
13195
  charges,
@@ -13139,14 +13209,14 @@ var Sidebar = ({
13139
13209
  $width: "100%",
13140
13210
  $padding: "1.5rem",
13141
13211
  children: [
13142
- promoCode && /* @__PURE__ */ jsxs9(
13212
+ discountApplied && /* @__PURE__ */ jsxs9(
13143
13213
  Flex,
13144
13214
  {
13145
13215
  $justifyContent: "space-between",
13146
13216
  $alignItems: "center",
13147
13217
  $gap: "1rem",
13148
13218
  children: [
13149
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { children: t2("Discount") }) }),
13219
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { children: t2("Discount") }) }),
13150
13220
  /* @__PURE__ */ jsxs9(
13151
13221
  Flex,
13152
13222
  {
@@ -13157,15 +13227,15 @@ var Sidebar = ({
13157
13227
  $outlineColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
13158
13228
  $borderRadius: "0.3125rem",
13159
13229
  children: [
13160
- /* @__PURE__ */ jsx13(Text, { $size: 0.75 * settings.theme.typography.text.fontSize, children: promoCode }),
13161
- /* @__PURE__ */ jsx13(
13230
+ /* @__PURE__ */ jsx14(Text, { $size: 0.75 * settings.theme.typography.text.fontSize, children: promoCode }),
13231
+ /* @__PURE__ */ jsx14(
13162
13232
  Box,
13163
13233
  {
13164
13234
  $cursor: "pointer",
13165
13235
  onClick: () => {
13166
13236
  updatePromoCode?.(null);
13167
13237
  },
13168
- children: /* @__PURE__ */ jsx13(
13238
+ children: /* @__PURE__ */ jsx14(
13169
13239
  Icon3,
13170
13240
  {
13171
13241
  name: "close",
@@ -13188,8 +13258,8 @@ var Sidebar = ({
13188
13258
  $alignItems: "center",
13189
13259
  $gap: "1rem",
13190
13260
  children: [
13191
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx13(Text, { children: t2("X% off", { percent: percentOff }) }) }),
13192
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { children: formatCurrency(
13261
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx14(Text, { children: t2("X% off", { percent: percentOff }) }) }),
13262
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(
13193
13263
  newCharges / 100 * percentOff,
13194
13264
  selectedPlanCurrency
13195
13265
  ) }) })
@@ -13203,13 +13273,13 @@ var Sidebar = ({
13203
13273
  $alignItems: "center",
13204
13274
  $gap: "1rem",
13205
13275
  children: [
13206
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx13(Text, { children: t2("X off", {
13276
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx14(Text, { children: t2("X off", {
13207
13277
  amount: formatCurrency(
13208
13278
  Math.abs(amountOff),
13209
13279
  selectedPlanCurrency
13210
13280
  )
13211
13281
  }) }) }),
13212
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsxs9(Text, { children: [
13282
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs9(Text, { children: [
13213
13283
  "-",
13214
13284
  formatCurrency(Math.abs(amountOff), selectedPlanCurrency)
13215
13285
  ] }) })
@@ -13223,11 +13293,11 @@ var Sidebar = ({
13223
13293
  $alignItems: "center",
13224
13294
  $gap: "1rem",
13225
13295
  children: [
13226
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs9(Text, { children: [
13296
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs9(Text, { children: [
13227
13297
  planPeriod === "year" ? t2("Yearly total") : t2("Monthly total"),
13228
13298
  ":"
13229
13299
  ] }) }),
13230
- /* @__PURE__ */ jsx13(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
13300
+ /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
13231
13301
  subscriptionPrice,
13232
13302
  /* @__PURE__ */ jsxs9("sub", { children: [
13233
13303
  "/",
@@ -13244,22 +13314,22 @@ var Sidebar = ({
13244
13314
  $alignItems: "center",
13245
13315
  $gap: "1rem",
13246
13316
  children: [
13247
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs9(Text, { children: [
13317
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs9(Text, { children: [
13248
13318
  t2("Due today"),
13249
13319
  ":"
13250
13320
  ] }) }),
13251
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { children: formatCurrency(Math.max(0, dueNow), selectedPlanCurrency) }) })
13321
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(Math.max(0, dueNow), selectedPlanCurrency) }) })
13252
13322
  ]
13253
13323
  }
13254
13324
  ),
13255
13325
  dueNow < 0 && /* @__PURE__ */ jsxs9(Flex, { $justifyContent: "space-between", $gap: "1rem", children: [
13256
- /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsxs9(Text, { children: [
13326
+ /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsxs9(Text, { children: [
13257
13327
  t2("Credits to be applied to future invoices"),
13258
13328
  ":"
13259
13329
  ] }) }),
13260
- /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { children: formatCurrency(Math.abs(dueNow), selectedPlanCurrency) }) })
13330
+ /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(Math.abs(dueNow), selectedPlanCurrency) }) })
13261
13331
  ] }),
13262
- layout === "checkout" && /* @__PURE__ */ jsx13(
13332
+ layout === "checkout" && /* @__PURE__ */ jsx14(
13263
13333
  StageButton,
13264
13334
  {
13265
13335
  checkout: handleCheckout,
@@ -13280,7 +13350,7 @@ var Sidebar = ({
13280
13350
  willTrialWithoutPaymentMethod
13281
13351
  }
13282
13352
  ),
13283
- layout === "unsubscribe" && /* @__PURE__ */ jsx13(
13353
+ layout === "unsubscribe" && /* @__PURE__ */ jsx14(
13284
13354
  Button,
13285
13355
  {
13286
13356
  type: "button",
@@ -13290,8 +13360,8 @@ var Sidebar = ({
13290
13360
  children: t2("Cancel subscription")
13291
13361
  }
13292
13362
  ),
13293
- !isLoading && error && /* @__PURE__ */ jsx13(Box, { children: /* @__PURE__ */ jsx13(Text, { $weight: 500, $color: "#DB6669", children: error }) }),
13294
- layout !== "unsubscribe" && /* @__PURE__ */ jsx13(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx13(Text, { children: subscriptionPrice && // TODO: localize
13363
+ !isLoading && error && /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { $weight: 500, $color: "#DB6669", children: error }) }),
13364
+ layout !== "unsubscribe" && /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { children: subscriptionPrice && // TODO: localize
13295
13365
  `You will be billed ${subscriptionPrice} ${usageBasedEntitlements.length > 0 ? "plus usage based costs" : ""} for this subscription
13296
13366
  every ${planPeriod} ${periodStart ? `on the ${formatOrdinal(periodStart.getDate())}` : ""} ${planPeriod === "year" && periodStart ? `of ${getMonthName(periodStart)}` : ""} unless you unsubscribe.` }) })
13297
13367
  ]
@@ -13303,13 +13373,13 @@ var Sidebar = ({
13303
13373
  };
13304
13374
 
13305
13375
  // src/components/shared/checkout-dialog/AddOns.tsx
13306
- import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
13376
+ import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
13307
13377
  var AddOns = ({ addOns, toggle, isLoading, period }) => {
13308
13378
  const { t: t2 } = useTranslation();
13309
13379
  const { settings } = useEmbed();
13310
13380
  const periodKey = period === "year" ? "yearlyPrice" : "monthlyPrice";
13311
13381
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
13312
- return /* @__PURE__ */ jsx14(
13382
+ return /* @__PURE__ */ jsx15(
13313
13383
  Box,
13314
13384
  {
13315
13385
  $display: "grid",
@@ -13352,12 +13422,12 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13352
13422
  },
13353
13423
  children: [
13354
13424
  /* @__PURE__ */ jsxs10(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
13355
- /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading3", children: addOn.name }) }),
13356
- addOn.description && /* @__PURE__ */ jsx14(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx14(Text, { children: addOn.description }) }),
13425
+ /* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsx15(Text, { display: "heading3", children: addOn.name }) }),
13426
+ addOn.description && /* @__PURE__ */ jsx15(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx15(Text, { children: addOn.description }) }),
13357
13427
  (addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ jsxs10(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
13358
13428
  /* @__PURE__ */ jsxs10(Box, { children: [
13359
- /* @__PURE__ */ jsx14(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13360
- /* @__PURE__ */ jsx14(
13429
+ /* @__PURE__ */ jsx15(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
13430
+ /* @__PURE__ */ jsx15(
13361
13431
  Text,
13362
13432
  {
13363
13433
  display: "heading2",
@@ -13369,7 +13439,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13369
13439
  }
13370
13440
  )
13371
13441
  ] }),
13372
- overageInfo && overageInfo.softLimit && /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs10(Text, { $size: 0.875, style: { opacity: 0.8 }, children: [
13442
+ overageInfo && overageInfo.softLimit && /* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsxs10(Text, { $size: 0.875, style: { opacity: 0.8 }, children: [
13373
13443
  overageInfo.softLimit,
13374
13444
  " ",
13375
13445
  overageInfo.featureName || "units",
@@ -13383,7 +13453,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13383
13453
  overageInfo.featureName?.toLowerCase() || "unit"
13384
13454
  ] }) })
13385
13455
  ] }),
13386
- isAddOnCurrent && /* @__PURE__ */ jsx14(
13456
+ isAddOnCurrent && /* @__PURE__ */ jsx15(
13387
13457
  Flex,
13388
13458
  {
13389
13459
  $position: "absolute",
@@ -13392,7 +13462,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13392
13462
  $backgroundColor: settings.theme.primary,
13393
13463
  $borderRadius: "9999px",
13394
13464
  $padding: "0.125rem 0.85rem",
13395
- children: /* @__PURE__ */ jsx14(
13465
+ children: /* @__PURE__ */ jsx15(
13396
13466
  Text,
13397
13467
  {
13398
13468
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -13403,7 +13473,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13403
13473
  }
13404
13474
  )
13405
13475
  ] }),
13406
- /* @__PURE__ */ jsx14(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: !addOn.isSelected ? /* @__PURE__ */ jsx14(
13476
+ /* @__PURE__ */ jsx15(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: !addOn.isSelected ? /* @__PURE__ */ jsx15(
13407
13477
  Button,
13408
13478
  {
13409
13479
  type: "button",
@@ -13415,7 +13485,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13415
13485
  $fullWidth: true,
13416
13486
  children: t2("Choose add-on")
13417
13487
  }
13418
- ) : /* @__PURE__ */ jsx14(
13488
+ ) : /* @__PURE__ */ jsx15(
13419
13489
  Button,
13420
13490
  {
13421
13491
  type: "button",
@@ -13426,7 +13496,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13426
13496
  $variant: isAddOnCurrent ? "ghost" : "text",
13427
13497
  $fullWidth: true,
13428
13498
  children: isAddOnCurrent ? t2("Remove add-on") : /* @__PURE__ */ jsxs10(Fragment5, { children: [
13429
- /* @__PURE__ */ jsx14(Icon3, { name: "check-rounded", size: "sm" }),
13499
+ /* @__PURE__ */ jsx15(Icon3, { name: "check-rounded", size: "sm" }),
13430
13500
  t2("Selected")
13431
13501
  ] })
13432
13502
  }
@@ -13442,7 +13512,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
13442
13512
 
13443
13513
  // src/components/shared/checkout-dialog/Checkout.tsx
13444
13514
  import { useState as useState7 } from "react";
13445
- import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
13515
+ import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
13446
13516
  var Checkout = ({
13447
13517
  isPaymentMethodRequired,
13448
13518
  setPaymentMethodId,
@@ -13455,9 +13525,9 @@ var Checkout = ({
13455
13525
  return null;
13456
13526
  }
13457
13527
  return /* @__PURE__ */ jsxs11(Fragment6, { children: [
13458
- /* @__PURE__ */ jsx15(PaymentMethodDetails, { setPaymentMethodId }),
13528
+ /* @__PURE__ */ jsx16(PaymentMethodDetails, { setPaymentMethodId }),
13459
13529
  /* @__PURE__ */ jsxs11(Flex, { $flexDirection: "column", $gap: "1rem", children: [
13460
- /* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsx15(Text, { display: "heading4", children: t2("Discount") }) }),
13530
+ /* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsx16(Text, { display: "heading4", children: t2("Discount") }) }),
13461
13531
  /* @__PURE__ */ jsxs11(
13462
13532
  Flex,
13463
13533
  {
@@ -13466,7 +13536,7 @@ var Checkout = ({
13466
13536
  $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.0625)" : "hsla(0, 0%, 100%, 0.125)",
13467
13537
  $borderRadius: "9999px",
13468
13538
  children: [
13469
- /* @__PURE__ */ jsx15(Box, { $flexGrow: 1, children: /* @__PURE__ */ jsx15(
13539
+ /* @__PURE__ */ jsx16(Box, { $flexGrow: 1, children: /* @__PURE__ */ jsx16(
13470
13540
  Input,
13471
13541
  {
13472
13542
  $size: "full",
@@ -13488,7 +13558,7 @@ var Checkout = ({
13488
13558
  }
13489
13559
  }
13490
13560
  ) }),
13491
- /* @__PURE__ */ jsx15(Box, { $flexShrink: 0, $padding: "0.5rem 1rem", children: /* @__PURE__ */ jsx15(
13561
+ /* @__PURE__ */ jsx16(Box, { $flexShrink: 0, $padding: "0.5rem 1rem", children: /* @__PURE__ */ jsx16(
13492
13562
  Text,
13493
13563
  {
13494
13564
  onClick: () => updatePromoCode(discount),
@@ -13505,11 +13575,11 @@ var Checkout = ({
13505
13575
  };
13506
13576
 
13507
13577
  // src/components/shared/checkout-dialog/Credits.tsx
13508
- import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
13578
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
13509
13579
  var Credits = ({ bundles, updateCount }) => {
13510
13580
  const { settings } = useEmbed();
13511
13581
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
13512
- return /* @__PURE__ */ jsx16(
13582
+ return /* @__PURE__ */ jsx17(
13513
13583
  Box,
13514
13584
  {
13515
13585
  $display: "grid",
@@ -13533,16 +13603,16 @@ var Credits = ({ bundles, updateCount }) => {
13533
13603
  children: [
13534
13604
  /* @__PURE__ */ jsxs12(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
13535
13605
  /* @__PURE__ */ jsxs12(Box, { children: [
13536
- /* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsx16(Text, { display: "heading3", children: bundle.name }) }),
13537
- /* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsxs12(Text, { display: "heading6", children: [
13606
+ /* @__PURE__ */ jsx17(Box, { children: /* @__PURE__ */ jsx17(Text, { display: "heading3", children: bundle.name }) }),
13607
+ /* @__PURE__ */ jsx17(Box, { children: /* @__PURE__ */ jsxs12(Text, { display: "heading6", children: [
13538
13608
  bundle.quantity ?? 0,
13539
13609
  " ",
13540
13610
  getFeatureName(bundle)
13541
13611
  ] }) })
13542
13612
  ] }),
13543
- typeof price === "number" && /* @__PURE__ */ jsx16(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx16(Text, { children: formatCurrency(price, bundle.price?.currency) }) })
13613
+ typeof price === "number" && /* @__PURE__ */ jsx17(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx17(Text, { children: formatCurrency(price, bundle.price?.currency) }) })
13544
13614
  ] }),
13545
- /* @__PURE__ */ jsx16(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: /* @__PURE__ */ jsx16(
13615
+ /* @__PURE__ */ jsx17(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: /* @__PURE__ */ jsx17(
13546
13616
  Input,
13547
13617
  {
13548
13618
  $size: "lg",
@@ -13572,7 +13642,7 @@ var Credits = ({ bundles, updateCount }) => {
13572
13642
  };
13573
13643
 
13574
13644
  // src/components/shared/checkout-dialog/Navigation.tsx
13575
- import { Fragment as Fragment7, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
13645
+ import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
13576
13646
  var Navigation = ({
13577
13647
  name,
13578
13648
  index,
@@ -13584,7 +13654,7 @@ var Navigation = ({
13584
13654
  const isLightBackground = useIsLightBackground();
13585
13655
  return /* @__PURE__ */ jsxs13(Fragment7, { children: [
13586
13656
  /* @__PURE__ */ jsxs13(Flex, { $gap: "0.5rem", $alignItems: "center", children: [
13587
- /* @__PURE__ */ jsx17(
13657
+ /* @__PURE__ */ jsx18(
13588
13658
  Box,
13589
13659
  {
13590
13660
  $display: "none",
@@ -13593,7 +13663,7 @@ var Navigation = ({
13593
13663
  $display: "block"
13594
13664
  }
13595
13665
  },
13596
- children: index >= activeIndex ? /* @__PURE__ */ jsx17(
13666
+ children: index >= activeIndex ? /* @__PURE__ */ jsx18(
13597
13667
  Box,
13598
13668
  {
13599
13669
  $width: `${20 / TEXT_BASE_SIZE}rem`,
@@ -13603,7 +13673,7 @@ var Navigation = ({
13603
13673
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.125)" : "hsla(0, 0%, 100%, 0.25)",
13604
13674
  $borderRadius: "9999px"
13605
13675
  }
13606
- ) : /* @__PURE__ */ jsx17(
13676
+ ) : /* @__PURE__ */ jsx18(
13607
13677
  Icon3,
13608
13678
  {
13609
13679
  name: "check",
@@ -13642,7 +13712,7 @@ var Navigation = ({
13642
13712
  }
13643
13713
  )
13644
13714
  ] }),
13645
- !isLast && /* @__PURE__ */ jsx17(
13715
+ !isLast && /* @__PURE__ */ jsx18(
13646
13716
  Icon3,
13647
13717
  {
13648
13718
  name: "chevron-right",
@@ -13657,7 +13727,7 @@ var Navigation = ({
13657
13727
 
13658
13728
  // src/components/shared/checkout-dialog/Plan.tsx
13659
13729
  import { useEffect as useEffect4, useMemo as useMemo8, useState as useState8 } from "react";
13660
- import { Fragment as Fragment8, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
13730
+ import { Fragment as Fragment8, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
13661
13731
  var Selected = ({ isCurrent = false, isTrial = false }) => {
13662
13732
  const { t: t2 } = useTranslation();
13663
13733
  const { settings } = useEmbed();
@@ -13675,8 +13745,8 @@ var Selected = ({ isCurrent = false, isTrial = false }) => {
13675
13745
  $gap: "0.25rem",
13676
13746
  $padding: "0.625rem 0",
13677
13747
  children: [
13678
- /* @__PURE__ */ jsx18(Icon3, { name: "check-rounded", color: settings.theme.primary }),
13679
- /* @__PURE__ */ jsx18(
13748
+ /* @__PURE__ */ jsx19(Icon3, { name: "check-rounded", color: settings.theme.primary }),
13749
+ /* @__PURE__ */ jsx19(
13680
13750
  Text,
13681
13751
  {
13682
13752
  $size: 0.9375 * settings.theme.typography.text.fontSize,
@@ -13713,7 +13783,7 @@ var PlanButtonGroup = ({
13713
13783
  }, [data, plan]);
13714
13784
  if (isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable) {
13715
13785
  return /* @__PURE__ */ jsxs14(Flex, { $flexDirection: "column", $gap: "1.5rem", children: [
13716
- !isTrialing && /* @__PURE__ */ jsx18(Fragment8, { children: isSelected && shouldTrial ? /* @__PURE__ */ jsx18(Selected, { isCurrent: isCurrentPlan, isTrial: shouldTrial }) : /* @__PURE__ */ jsx18(
13786
+ !isTrialing && /* @__PURE__ */ jsx19(Fragment8, { children: isSelected && shouldTrial ? /* @__PURE__ */ jsx19(Selected, { isCurrent: isCurrentPlan, isTrial: shouldTrial }) : /* @__PURE__ */ jsx19(
13717
13787
  Button,
13718
13788
  {
13719
13789
  type: "button",
@@ -13735,16 +13805,16 @@ var PlanButtonGroup = ({
13735
13805
  $color: "primary",
13736
13806
  $variant: "filled",
13737
13807
  $fullWidth: true,
13738
- children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ jsx18(
13808
+ children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ jsx19(
13739
13809
  Tooltip,
13740
13810
  {
13741
- trigger: /* @__PURE__ */ jsx18(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
13742
- content: /* @__PURE__ */ jsx18(Text, { children: t2("Current usage exceeds the limit of this plan.") })
13811
+ trigger: /* @__PURE__ */ jsx19(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
13812
+ content: /* @__PURE__ */ jsx19(Text, { children: t2("Current usage exceeds the limit of this plan.") })
13743
13813
  }
13744
13814
  ) : t2("Start X day trial", { days: plan.trialDays })
13745
13815
  }
13746
13816
  ) }),
13747
- !plan.custom && /* @__PURE__ */ jsx18(Fragment8, { children: isSelected && (!shouldTrial || isTrialing) ? /* @__PURE__ */ jsx18(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ jsx18(
13817
+ !plan.custom && /* @__PURE__ */ jsx19(Fragment8, { children: isSelected && (!shouldTrial || isTrialing) ? /* @__PURE__ */ jsx19(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ jsx19(
13748
13818
  Button,
13749
13819
  {
13750
13820
  type: "button",
@@ -13756,18 +13826,18 @@ var PlanButtonGroup = ({
13756
13826
  $color: "primary",
13757
13827
  $variant: isTrialing ? "filled" : "text",
13758
13828
  $fullWidth: true,
13759
- children: !isValidPlan ? /* @__PURE__ */ jsx18(
13829
+ children: !isValidPlan ? /* @__PURE__ */ jsx19(
13760
13830
  Tooltip,
13761
13831
  {
13762
- trigger: /* @__PURE__ */ jsx18(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
13763
- content: /* @__PURE__ */ jsx18(Text, { children: t2("Current usage exceeds the limit of this plan.") })
13832
+ trigger: /* @__PURE__ */ jsx19(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
13833
+ content: /* @__PURE__ */ jsx19(Text, { children: t2("Current usage exceeds the limit of this plan.") })
13764
13834
  }
13765
13835
  ) : t2("Choose plan")
13766
13836
  }
13767
13837
  ) })
13768
13838
  ] });
13769
13839
  }
13770
- return isSelected ? /* @__PURE__ */ jsx18(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ jsx18(
13840
+ return isSelected ? /* @__PURE__ */ jsx19(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ jsx19(
13771
13841
  Button,
13772
13842
  {
13773
13843
  type: "button",
@@ -13786,11 +13856,11 @@ var PlanButtonGroup = ({
13786
13856
  $color: "primary",
13787
13857
  $variant: "filled",
13788
13858
  $fullWidth: true,
13789
- children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ jsx18(
13859
+ children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ jsx19(
13790
13860
  Tooltip,
13791
13861
  {
13792
- trigger: /* @__PURE__ */ jsx18(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
13793
- content: /* @__PURE__ */ jsx18(Text, { children: t2("Current usage exceeds the limit of this plan.") })
13862
+ trigger: /* @__PURE__ */ jsx19(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
13863
+ content: /* @__PURE__ */ jsx19(Text, { children: t2("Current usage exceeds the limit of this plan.") })
13794
13864
  }
13795
13865
  ) : t2("Choose plan")
13796
13866
  }
@@ -13811,10 +13881,18 @@ var Plan = ({
13811
13881
  const [entitlementCounts, setEntitlementCounts] = useState8(
13812
13882
  () => plans.reduce(entitlementCountsReducer, {})
13813
13883
  );
13814
- const isTrialing = useMemo8(
13815
- () => isCheckoutData(data) && data.subscription?.status === "trialing",
13816
- [data]
13817
- );
13884
+ const { isTrialing, showZeroPriceAsFree } = useMemo8(() => {
13885
+ if (isCheckoutData(data)) {
13886
+ return {
13887
+ isTrialing: data.subscription?.status === "trialing",
13888
+ showZeroPriceAsFree: data.showZeroPriceAsFree
13889
+ };
13890
+ }
13891
+ return {
13892
+ isTrialing: false,
13893
+ showZeroPriceAsFree: false
13894
+ };
13895
+ }, [data]);
13818
13896
  const handleToggleShowAll = (id) => {
13819
13897
  setEntitlementCounts((prev2) => {
13820
13898
  const count = prev2[id] ? { ...prev2[id] } : void 0;
@@ -13834,7 +13912,7 @@ var Plan = ({
13834
13912
  setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
13835
13913
  }, [plans]);
13836
13914
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
13837
- return /* @__PURE__ */ jsx18(
13915
+ return /* @__PURE__ */ jsx19(
13838
13916
  Box,
13839
13917
  {
13840
13918
  $display: "grid",
@@ -13848,8 +13926,9 @@ var Plan = ({
13848
13926
  const hasUsageBasedEntitlements = plan.entitlements.some(
13849
13927
  (entitlement) => !!entitlement.priceBehavior
13850
13928
  );
13851
- const isUsageBasedPlan = planPrice === 0 && hasUsageBasedEntitlements;
13852
- const headerPriceFontStyle = plan.custom || isUsageBasedPlan ? settings.theme.typography.heading3 : settings.theme.typography.heading2;
13929
+ const isFreePlan = planPrice === 0;
13930
+ const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
13931
+ const headerPriceFontStyle = settings.theme.typography.heading2;
13853
13932
  const count = entitlementCounts[plan.id];
13854
13933
  const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
13855
13934
  return /* @__PURE__ */ jsxs14(
@@ -13883,20 +13962,20 @@ var Plan = ({
13883
13962
  }
13884
13963
  },
13885
13964
  children: [
13886
- /* @__PURE__ */ jsx18(Box, { children: /* @__PURE__ */ jsx18(Text, { display: "heading2", children: plan.name }) }),
13887
- /* @__PURE__ */ jsx18(Box, { $marginBottom: "0.5rem", $lineHeight: 1.35, children: /* @__PURE__ */ jsx18(Text, { children: plan.description }) }),
13965
+ /* @__PURE__ */ jsx19(Box, { children: /* @__PURE__ */ jsx19(Text, { display: "heading2", children: plan.name }) }),
13966
+ /* @__PURE__ */ jsx19(Box, { $marginBottom: "0.5rem", $lineHeight: 1.35, children: /* @__PURE__ */ jsx19(Text, { children: plan.description }) }),
13888
13967
  /* @__PURE__ */ jsxs14(Box, { children: [
13889
- /* @__PURE__ */ jsx18(
13968
+ /* @__PURE__ */ jsx19(
13890
13969
  Text,
13891
13970
  {
13892
13971
  $font: headerPriceFontStyle.fontFamily,
13893
13972
  $size: headerPriceFontStyle.fontSize,
13894
13973
  $weight: headerPriceFontStyle.fontWeight,
13895
13974
  $color: headerPriceFontStyle.color,
13896
- children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency)
13975
+ children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency)
13897
13976
  }
13898
13977
  ),
13899
- !plan.custom && !isUsageBasedPlan && /* @__PURE__ */ jsxs14(
13978
+ !plan.custom && !isFreePlan && /* @__PURE__ */ jsxs14(
13900
13979
  Text,
13901
13980
  {
13902
13981
  display: "heading2",
@@ -13908,7 +13987,7 @@ var Plan = ({
13908
13987
  }
13909
13988
  )
13910
13989
  ] }),
13911
- credits.length > 0 && /* @__PURE__ */ jsx18(
13990
+ credits.length > 0 && /* @__PURE__ */ jsx19(
13912
13991
  Flex,
13913
13992
  {
13914
13993
  $flexDirection: "column",
@@ -13916,7 +13995,7 @@ var Plan = ({
13916
13995
  $flexGrow: 1,
13917
13996
  $marginTop: "0.5rem",
13918
13997
  children: credits.map((credit, creditIndex) => {
13919
- return /* @__PURE__ */ jsx18(
13998
+ return /* @__PURE__ */ jsx19(
13920
13999
  Flex,
13921
14000
  {
13922
14001
  $flexWrap: "wrap",
@@ -13924,7 +14003,7 @@ var Plan = ({
13924
14003
  $alignItems: "center",
13925
14004
  $gap: "1rem",
13926
14005
  children: /* @__PURE__ */ jsxs14(Flex, { $gap: "1rem", children: [
13927
- credit.icon && /* @__PURE__ */ jsx18(
14006
+ credit.icon && /* @__PURE__ */ jsx19(
13928
14007
  Icon3,
13929
14008
  {
13930
14009
  name: credit.icon,
@@ -13933,7 +14012,7 @@ var Plan = ({
13933
14012
  rounded: true
13934
14013
  }
13935
14014
  ),
13936
- /* @__PURE__ */ jsx18(
14015
+ /* @__PURE__ */ jsx19(
13937
14016
  Flex,
13938
14017
  {
13939
14018
  $flexDirection: "column",
@@ -13959,7 +14038,7 @@ var Plan = ({
13959
14038
  })
13960
14039
  }
13961
14040
  ),
13962
- isHydratedPlan(plan) && plan.current && /* @__PURE__ */ jsx18(
14041
+ isHydratedPlan(plan) && plan.current && /* @__PURE__ */ jsx19(
13963
14042
  Flex,
13964
14043
  {
13965
14044
  $position: "absolute",
@@ -13968,7 +14047,7 @@ var Plan = ({
13968
14047
  $backgroundColor: settings.theme.primary,
13969
14048
  $borderRadius: "9999px",
13970
14049
  $padding: "0.125rem 0.85rem",
13971
- children: /* @__PURE__ */ jsx18(
14050
+ children: /* @__PURE__ */ jsx19(
13972
14051
  Text,
13973
14052
  {
13974
14053
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -14001,7 +14080,7 @@ var Plan = ({
14001
14080
  packageSize: entitlementPackageSize = 1
14002
14081
  } = getEntitlementPrice(entitlement, planPeriod) || {};
14003
14082
  const metricPeriodName = getMetricPeriodName(entitlement);
14004
- return /* @__PURE__ */ jsx18(
14083
+ return /* @__PURE__ */ jsx19(
14005
14084
  Flex,
14006
14085
  {
14007
14086
  $flexWrap: "wrap",
@@ -14009,7 +14088,7 @@ var Plan = ({
14009
14088
  $alignItems: "center",
14010
14089
  $gap: "1rem",
14011
14090
  children: /* @__PURE__ */ jsxs14(Flex, { $gap: "1rem", children: [
14012
- entitlement.feature?.icon && /* @__PURE__ */ jsx18(
14091
+ entitlement.feature?.icon && /* @__PURE__ */ jsx19(
14013
14092
  Icon3,
14014
14093
  {
14015
14094
  name: entitlement.feature.icon,
@@ -14025,7 +14104,7 @@ var Plan = ({
14025
14104
  $justifyContent: "center",
14026
14105
  $gap: "0.5rem",
14027
14106
  children: [
14028
- /* @__PURE__ */ jsx18(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ jsxs14(Fragment8, { children: [
14107
+ /* @__PURE__ */ jsx19(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ jsxs14(Fragment8, { children: [
14029
14108
  formatCurrency(
14030
14109
  entitlementPrice,
14031
14110
  entitlementCurrency
@@ -14047,7 +14126,7 @@ var Plan = ({
14047
14126
  " ",
14048
14127
  planPeriod
14049
14128
  ] })
14050
- ] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx18(
14129
+ ] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx19(
14051
14130
  TieredPricingDetails,
14052
14131
  {
14053
14132
  entitlement,
@@ -14084,51 +14163,59 @@ var Plan = ({
14084
14163
  t2(metricPeriodName)
14085
14164
  ] })
14086
14165
  ] }) : entitlement.feature.name }),
14087
- entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsxs14(
14088
- Text,
14089
- {
14090
- style: { opacity: 0.54 },
14091
- $size: 0.875 * settings.theme.typography.text.fontSize,
14092
- $color: settings.theme.typography.text.color,
14093
- children: [
14094
- t2("then"),
14095
- " ",
14096
- formatCurrency(
14097
- entitlementPrice,
14098
- entitlementCurrency
14099
- ),
14100
- "/",
14101
- entitlementPackageSize > 1 && /* @__PURE__ */ jsxs14(Fragment8, { children: [
14102
- entitlementPackageSize,
14103
- " "
14104
- ] }),
14105
- getFeatureName(
14106
- entitlement.feature,
14107
- entitlementPackageSize
14108
- ),
14109
- entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs14(Fragment8, { children: [
14110
- "/",
14111
- shortenPeriod(planPeriod)
14112
- ] })
14113
- ]
14114
- }
14115
- ) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs14(Flex, { $alignItems: "center", children: [
14116
- /* @__PURE__ */ jsx18(
14117
- PricingTiersTooltip,
14118
- {
14119
- feature: entitlement.feature,
14120
- period: planPeriod,
14121
- currency: entitlementCurrency,
14122
- priceTiers: entitlementPriceTiers
14123
- }
14124
- ),
14125
- /* @__PURE__ */ jsx18(
14166
+ /* @__PURE__ */ jsxs14(Flex, { $alignItems: "end", children: [
14167
+ entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsxs14(
14126
14168
  Text,
14127
14169
  {
14128
14170
  style: { opacity: 0.54 },
14129
14171
  $size: 0.875 * settings.theme.typography.text.fontSize,
14130
14172
  $color: settings.theme.typography.text.color,
14131
- children: t2("Tier-based")
14173
+ children: [
14174
+ t2("then"),
14175
+ " ",
14176
+ formatCurrency(
14177
+ entitlementPrice,
14178
+ entitlementCurrency
14179
+ ),
14180
+ "/",
14181
+ entitlementPackageSize > 1 && /* @__PURE__ */ jsxs14(Fragment8, { children: [
14182
+ entitlementPackageSize,
14183
+ " "
14184
+ ] }),
14185
+ getFeatureName(
14186
+ entitlement.feature,
14187
+ entitlementPackageSize
14188
+ ),
14189
+ entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs14(Fragment8, { children: [
14190
+ "/",
14191
+ shortenPeriod(planPeriod)
14192
+ ] })
14193
+ ]
14194
+ }
14195
+ ) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs14(Flex, { $alignItems: "end", children: [
14196
+ /* @__PURE__ */ jsx19(
14197
+ Text,
14198
+ {
14199
+ style: { opacity: 0.54 },
14200
+ $size: 0.875 * settings.theme.typography.text.fontSize,
14201
+ $color: settings.theme.typography.text.color,
14202
+ children: t2("Tier-based")
14203
+ }
14204
+ ),
14205
+ /* @__PURE__ */ jsx19(
14206
+ PricingTiersTooltip,
14207
+ {
14208
+ feature: entitlement.feature,
14209
+ period: planPeriod,
14210
+ currency: entitlementCurrency,
14211
+ priceTiers: entitlementPriceTiers
14212
+ }
14213
+ )
14214
+ ] }),
14215
+ entitlement.billingThreshold && /* @__PURE__ */ jsx19(
14216
+ BillingThresholdTooltip,
14217
+ {
14218
+ billingThreshold: entitlement.billingThreshold
14132
14219
  }
14133
14220
  )
14134
14221
  ] })
@@ -14148,14 +14235,14 @@ var Plan = ({
14148
14235
  $gap: "0.5rem",
14149
14236
  $marginTop: "1rem",
14150
14237
  children: [
14151
- /* @__PURE__ */ jsx18(
14238
+ /* @__PURE__ */ jsx19(
14152
14239
  Icon3,
14153
14240
  {
14154
14241
  name: isExpanded ? "chevron-up" : "chevron-down",
14155
14242
  color: "#D0D0D0"
14156
14243
  }
14157
14244
  ),
14158
- /* @__PURE__ */ jsx18(
14245
+ /* @__PURE__ */ jsx19(
14159
14246
  Text,
14160
14247
  {
14161
14248
  onClick: () => handleToggleShowAll(plan.id),
@@ -14175,7 +14262,7 @@ var Plan = ({
14175
14262
  }
14176
14263
  )
14177
14264
  ] }),
14178
- /* @__PURE__ */ jsx18(
14265
+ /* @__PURE__ */ jsx19(
14179
14266
  PlanButtonGroup,
14180
14267
  {
14181
14268
  plan,
@@ -14198,13 +14285,13 @@ var Plan = ({
14198
14285
  };
14199
14286
 
14200
14287
  // src/components/shared/checkout-dialog/Usage.tsx
14201
- import { Fragment as Fragment9, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
14288
+ import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
14202
14289
  var Usage = ({ entitlements, updateQuantity, period }) => {
14203
14290
  const { settings } = useEmbed();
14204
14291
  const { t: t2 } = useTranslation();
14205
14292
  const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
14206
14293
  const unitPriceFontSize = 0.875 * settings.theme.typography.text.fontSize;
14207
- return /* @__PURE__ */ jsx19(Flex, { $flexDirection: "column", $gap: "1rem", children: entitlements.reduce((acc, entitlement, index) => {
14294
+ return /* @__PURE__ */ jsx20(Flex, { $flexDirection: "column", $gap: "1rem", children: entitlements.reduce((acc, entitlement, index) => {
14208
14295
  if (entitlement.feature) {
14209
14296
  const {
14210
14297
  price,
@@ -14232,8 +14319,8 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14232
14319
  $gap: "0.75rem",
14233
14320
  $flexBasis: `calc(${100 / 3}% - 0.375rem)`,
14234
14321
  children: [
14235
- /* @__PURE__ */ jsx19(Box, { children: /* @__PURE__ */ jsx19(Text, { display: "heading2", children: entitlement.feature.name }) }),
14236
- entitlement.feature.description && /* @__PURE__ */ jsx19(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx19(Text, { children: entitlement.feature.description }) })
14322
+ /* @__PURE__ */ jsx20(Box, { children: /* @__PURE__ */ jsx20(Text, { display: "heading2", children: entitlement.feature.name }) }),
14323
+ entitlement.feature.description && /* @__PURE__ */ jsx20(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx20(Text, { children: entitlement.feature.description }) })
14237
14324
  ]
14238
14325
  }
14239
14326
  ),
@@ -14244,7 +14331,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14244
14331
  $gap: "0.5rem",
14245
14332
  $flexBasis: `calc(${100 / 3}% - 0.375rem)`,
14246
14333
  children: [
14247
- /* @__PURE__ */ jsx19(
14334
+ /* @__PURE__ */ jsx20(
14248
14335
  Input,
14249
14336
  {
14250
14337
  $size: "lg",
@@ -14264,7 +14351,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14264
14351
  }
14265
14352
  }
14266
14353
  ),
14267
- /* @__PURE__ */ jsx19(
14354
+ /* @__PURE__ */ jsx20(
14268
14355
  Text,
14269
14356
  {
14270
14357
  style: { opacity: 0.54 },
@@ -14276,7 +14363,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14276
14363
  })
14277
14364
  }
14278
14365
  ),
14279
- entitlement.quantity < entitlement.usage && /* @__PURE__ */ jsx19(Text, { $size: unitPriceFontSize, $color: "#DB6669", children: t2("Cannot downgrade entitlement") })
14366
+ entitlement.quantity < entitlement.usage && /* @__PURE__ */ jsx20(Text, { $size: unitPriceFontSize, $color: "#DB6669", children: t2("Cannot downgrade entitlement") })
14280
14367
  ]
14281
14368
  }
14282
14369
  ),
@@ -14286,7 +14373,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14286
14373
  $flexBasis: `calc(${100 / 3}% - 0.375rem)`,
14287
14374
  $textAlign: "right",
14288
14375
  children: [
14289
- /* @__PURE__ */ jsx19(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs15(Text, { children: [
14376
+ /* @__PURE__ */ jsx20(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs15(Text, { children: [
14290
14377
  formatCurrency(
14291
14378
  (price ?? 0) * entitlement.quantity,
14292
14379
  currency
@@ -14296,7 +14383,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14296
14383
  shortenPeriod(period)
14297
14384
  ] })
14298
14385
  ] }) }),
14299
- /* @__PURE__ */ jsx19(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs15(
14386
+ /* @__PURE__ */ jsx20(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs15(
14300
14387
  Text,
14301
14388
  {
14302
14389
  style: { opacity: 0.54 },
@@ -14331,7 +14418,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
14331
14418
  };
14332
14419
 
14333
14420
  // src/components/shared/checkout-dialog/CheckoutDialog.tsx
14334
- import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
14421
+ import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
14335
14422
  var createActiveUsageBasedEntitlementsReducer = (entitlements, period) => (acc, entitlement) => {
14336
14423
  if (entitlement.priceBehavior && (period === "month" && entitlement.meteredMonthlyPrice || period === "year" && entitlement.meteredYearlyPrice)) {
14337
14424
  const featureUsage = entitlements.find(
@@ -14698,8 +14785,10 @@ var CheckoutDialog = ({ top = 0 }) => {
14698
14785
  },
14699
14786
  []
14700
14787
  );
14701
- setSelectedPlan(plan);
14702
- setUsageBasedEntitlements(entitlements);
14788
+ if (plan.id !== selectedPlan?.id) {
14789
+ setSelectedPlan(plan);
14790
+ setUsageBasedEntitlements(entitlements);
14791
+ }
14703
14792
  const updatedShouldTrial = updates.shouldTrial ?? shouldTrial;
14704
14793
  setShouldTrial(updatedShouldTrial);
14705
14794
  if (willTrialWithoutPaymentMethod) {
@@ -14725,6 +14814,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14725
14814
  });
14726
14815
  },
14727
14816
  [
14817
+ selectedPlan?.id,
14728
14818
  planPeriod,
14729
14819
  shouldTrial,
14730
14820
  willTrialWithoutPaymentMethod,
@@ -14871,7 +14961,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14871
14961
  (stage) => stage.id === checkoutStage
14872
14962
  );
14873
14963
  return /* @__PURE__ */ jsxs16(Modal2, { size: "lg", top, contentRef, children: [
14874
- /* @__PURE__ */ jsx20(ModalHeader, { bordered: true, children: /* @__PURE__ */ jsx20(
14964
+ /* @__PURE__ */ jsx21(ModalHeader, { bordered: true, children: /* @__PURE__ */ jsx21(
14875
14965
  Flex,
14876
14966
  {
14877
14967
  $flexWrap: "wrap",
@@ -14881,7 +14971,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14881
14971
  $gap: "1rem"
14882
14972
  }
14883
14973
  },
14884
- children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */ jsx20(
14974
+ children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */ jsx21(
14885
14975
  Navigation,
14886
14976
  {
14887
14977
  name: stage.name,
@@ -14940,7 +15030,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14940
15030
  },
14941
15031
  children: [
14942
15032
  activeCheckoutStage && /* @__PURE__ */ jsxs16(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
14943
- activeCheckoutStage.label && /* @__PURE__ */ jsx20(
15033
+ activeCheckoutStage.label && /* @__PURE__ */ jsx21(
14944
15034
  Text,
14945
15035
  {
14946
15036
  as: "h3",
@@ -14949,9 +15039,9 @@ var CheckoutDialog = ({ top = 0 }) => {
14949
15039
  children: activeCheckoutStage.label
14950
15040
  }
14951
15041
  ),
14952
- activeCheckoutStage.description && /* @__PURE__ */ jsx20(Text, { as: "p", children: activeCheckoutStage.description })
15042
+ activeCheckoutStage.description && /* @__PURE__ */ jsx21(Text, { as: "p", children: activeCheckoutStage.description })
14953
15043
  ] }),
14954
- checkoutStage === "plan" && showPeriodToggle && availablePeriods.length > 1 && /* @__PURE__ */ jsx20(
15044
+ checkoutStage === "plan" && showPeriodToggle && availablePeriods.length > 1 && /* @__PURE__ */ jsx21(
14955
15045
  PeriodToggle,
14956
15046
  {
14957
15047
  options: availablePeriods,
@@ -14963,7 +15053,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14963
15053
  ]
14964
15054
  }
14965
15055
  ),
14966
- isPending ? /* @__PURE__ */ jsx20(
15056
+ isPending ? /* @__PURE__ */ jsx21(
14967
15057
  Flex,
14968
15058
  {
14969
15059
  $width: "100%",
@@ -14971,9 +15061,9 @@ var CheckoutDialog = ({ top = 0 }) => {
14971
15061
  $alignItems: "center",
14972
15062
  $justifyContent: "center",
14973
15063
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
14974
- children: /* @__PURE__ */ jsx20(Loader, { $size: "2xl" })
15064
+ children: /* @__PURE__ */ jsx21(Loader, { $size: "2xl" })
14975
15065
  }
14976
- ) : checkoutStage === "plan" ? /* @__PURE__ */ jsx20(
15066
+ ) : checkoutStage === "plan" ? /* @__PURE__ */ jsx21(
14977
15067
  Plan,
14978
15068
  {
14979
15069
  isLoading,
@@ -14984,7 +15074,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14984
15074
  shouldTrial,
14985
15075
  showPeriodToggle
14986
15076
  }
14987
- ) : checkoutStage === "usage" ? /* @__PURE__ */ jsx20(
15077
+ ) : checkoutStage === "usage" ? /* @__PURE__ */ jsx21(
14988
15078
  Usage,
14989
15079
  {
14990
15080
  isLoading,
@@ -14993,7 +15083,7 @@ var CheckoutDialog = ({ top = 0 }) => {
14993
15083
  entitlements: payInAdvanceEntitlements,
14994
15084
  updateQuantity: updateUsageBasedEntitlementQuantity
14995
15085
  }
14996
- ) : checkoutStage === "addons" ? /* @__PURE__ */ jsx20(
15086
+ ) : checkoutStage === "addons" ? /* @__PURE__ */ jsx21(
14997
15087
  AddOns,
14998
15088
  {
14999
15089
  isLoading,
@@ -15001,7 +15091,7 @@ var CheckoutDialog = ({ top = 0 }) => {
15001
15091
  addOns,
15002
15092
  toggle: (id) => toggleAddOn(id)
15003
15093
  }
15004
- ) : checkoutStage === "addonsUsage" ? /* @__PURE__ */ jsx20(
15094
+ ) : checkoutStage === "addonsUsage" ? /* @__PURE__ */ jsx21(
15005
15095
  Usage,
15006
15096
  {
15007
15097
  isLoading,
@@ -15010,14 +15100,14 @@ var CheckoutDialog = ({ top = 0 }) => {
15010
15100
  entitlements: addOnPayInAdvanceEntitlements,
15011
15101
  updateQuantity: updateAddOnEntitlementQuantity
15012
15102
  }
15013
- ) : checkoutStage === "credits" ? /* @__PURE__ */ jsx20(
15103
+ ) : checkoutStage === "credits" ? /* @__PURE__ */ jsx21(
15014
15104
  Credits,
15015
15105
  {
15016
15106
  isLoading,
15017
15107
  bundles: creditBundles,
15018
15108
  updateCount: updateCreditBundleCount
15019
15109
  }
15020
- ) : checkoutStage === "checkout" && /* @__PURE__ */ jsx20(
15110
+ ) : checkoutStage === "checkout" && /* @__PURE__ */ jsx21(
15021
15111
  Checkout,
15022
15112
  {
15023
15113
  isPaymentMethodRequired,
@@ -15028,7 +15118,7 @@ var CheckoutDialog = ({ top = 0 }) => {
15028
15118
  ]
15029
15119
  }
15030
15120
  ),
15031
- /* @__PURE__ */ jsx20(
15121
+ /* @__PURE__ */ jsx21(
15032
15122
  Sidebar,
15033
15123
  {
15034
15124
  planPeriod,
@@ -15062,32 +15152,93 @@ var CheckoutDialog = ({ top = 0 }) => {
15062
15152
 
15063
15153
  // src/components/shared/payment-dialog/PaymentDialog.tsx
15064
15154
  import { useRef as useRef7 } from "react";
15065
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
15155
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
15066
15156
  var PaymentDialog = ({ top = 0 }) => {
15067
15157
  const { t: t2 } = useTranslation();
15068
15158
  const contentRef = useRef7(null);
15069
15159
  return /* @__PURE__ */ jsxs17(Modal2, { size: "md", top, contentRef, children: [
15070
- /* @__PURE__ */ jsx21(ModalHeader, { bordered: true, children: /* @__PURE__ */ jsx21(Text, { $size: 18, children: t2("Edit payment method") }) }),
15071
- /* @__PURE__ */ jsx21(PaymentMethodDetails, {})
15160
+ /* @__PURE__ */ jsx22(ModalHeader, { bordered: true, children: /* @__PURE__ */ jsx22(Text, { $size: 18, children: t2("Edit payment method") }) }),
15161
+ /* @__PURE__ */ jsx22(PaymentMethodDetails, {})
15072
15162
  ] });
15073
15163
  };
15074
15164
 
15075
15165
  // src/components/shared/payment-form/PaymentForm.tsx
15076
15166
  import {
15167
+ AddressElement,
15077
15168
  PaymentElement,
15078
15169
  useElements,
15079
15170
  useStripe
15080
15171
  } from "@stripe/react-stripe-js";
15081
15172
  import { useState as useState10 } from "react";
15082
- import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
15173
+
15174
+ // src/components/shared/payment-form/styles.ts
15175
+ var Label = dt.label`
15176
+ display: flex;
15177
+ margin-bottom: 0.75rem;
15178
+ font-family: "Public Sans", system-ui, sans-serif;
15179
+ font-size: 1rem;
15180
+ font-weight: 400;
15181
+ transition:
15182
+ transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
15183
+ opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
15184
+ color: #cdd6f4;
15185
+ touch-action: manipulation;
15186
+ `;
15187
+ var Input2 = dt.input`
15188
+ padding: 0.75rem;
15189
+ background-color: white;
15190
+ border-radius: 0.5rem;
15191
+ transition:
15192
+ background 0.15s ease,
15193
+ border 0.15s ease,
15194
+ box-shadow 0.15s ease,
15195
+ color 0.15s ease;
15196
+ border: 1px solid #e6e6e6;
15197
+ box-shadow:
15198
+ 0 1px 1px rgba(0, 0, 0, 0.03),
15199
+ 0 3px 6px rgba(0, 0, 0, 0.02);
15200
+
15201
+ appearance: none;
15202
+ color: inherit;
15203
+ filter: none;
15204
+ font-family: "Public Sans", system-ui, sans-serif;
15205
+ font-size: 1rem;
15206
+ letter-spacing: inherit;
15207
+ outline-offset: 0;
15208
+ outline-width: 2px;
15209
+
15210
+ animation: native-autofill-out 1ms;
15211
+ color-scheme: light;
15212
+ display: block;
15213
+ width: 100%;
15214
+ touch-action: manipulation;
15215
+
15216
+ &:focus {
15217
+ outline: 0;
15218
+ border-color: #0570de;
15219
+ boxshadow:
15220
+ 0 1px 1px rgba(0, 0, 0, 0.03),
15221
+ 0 3px 6px rgba(0, 0, 0, 0.02),
15222
+ 0 0 0 3px hsla(210, 96%, 45%, 25%),
15223
+ 0 1px 1px 0 rgba(0, 0, 0, 0.08);
15224
+ }
15225
+ `;
15226
+
15227
+ // src/components/shared/payment-form/PaymentForm.tsx
15228
+ import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
15083
15229
  var PaymentForm = ({ onConfirm }) => {
15084
15230
  const { t: t2 } = useTranslation();
15085
15231
  const stripe = useStripe();
15086
15232
  const elements = useElements();
15233
+ const { data } = useEmbed();
15234
+ const [email, setEmail] = useState10("");
15087
15235
  const [message, setMessage] = useState10();
15088
15236
  const [isLoading, setIsLoading] = useState10(false);
15089
15237
  const [isConfirmed, setIsConfirmed] = useState10(false);
15090
- const [isComplete, setIsComplete] = useState10(false);
15238
+ const [isPaymentComplete, setIsPaymentComplete] = useState10(false);
15239
+ const [isAddressComplete, setIsAddressComplete] = useState10(
15240
+ () => !isCheckoutData(data) || !data.checkoutSettings.collectAddress
15241
+ );
15091
15242
  const handleSubmit = async (event) => {
15092
15243
  event.preventDefault();
15093
15244
  if (!stripe || !elements) {
@@ -15100,6 +15251,11 @@ var PaymentForm = ({ onConfirm }) => {
15100
15251
  const { setupIntent, error } = await stripe.confirmSetup({
15101
15252
  elements,
15102
15253
  confirmParams: {
15254
+ payment_method_data: {
15255
+ billing_details: {
15256
+ email
15257
+ }
15258
+ },
15103
15259
  return_url: window.location.href
15104
15260
  },
15105
15261
  redirect: "if_required"
@@ -15119,31 +15275,58 @@ var PaymentForm = ({ onConfirm }) => {
15119
15275
  }
15120
15276
  };
15121
15277
  return /* @__PURE__ */ jsxs18(
15122
- "form",
15278
+ Flex,
15123
15279
  {
15280
+ as: "form",
15124
15281
  id: "payment-form",
15125
15282
  onSubmit: handleSubmit,
15126
- style: {
15127
- display: "flex",
15128
- flexDirection: "column",
15129
- overflowX: "hidden",
15130
- overflowY: "auto"
15131
- },
15283
+ $flexDirection: "column",
15284
+ $overflowX: "hidden",
15285
+ $overflowY: "auto",
15132
15286
  children: [
15133
- /* @__PURE__ */ jsx22(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx22(
15287
+ /* @__PURE__ */ jsx23(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx23(
15134
15288
  PaymentElement,
15135
15289
  {
15136
15290
  id: "payment-element",
15137
15291
  onChange: (event) => {
15138
- setIsComplete(event.complete);
15292
+ setIsPaymentComplete(event.complete);
15293
+ }
15294
+ }
15295
+ ) }),
15296
+ stripe && isCheckoutData(data) && data.checkoutSettings.collectEmail && /* @__PURE__ */ jsxs18(Box, { "data-field": "name", $marginBottom: "1.5rem", $verticalAlign: "top", children: [
15297
+ /* @__PURE__ */ jsx23(Label, { htmlFor: "email", children: "Email" }),
15298
+ /* @__PURE__ */ jsx23(
15299
+ Input2,
15300
+ {
15301
+ id: "email",
15302
+ type: "text",
15303
+ value: email,
15304
+ autoComplete: "email",
15305
+ placeholder: "Enter email address",
15306
+ onChange: (e2) => setEmail(e2.target.value)
15307
+ }
15308
+ )
15309
+ ] }),
15310
+ isCheckoutData(data) && (data.checkoutSettings.collectAddress || data.checkoutSettings.collectPhone) && /* @__PURE__ */ jsx23(Box, { $marginBottom: "3.5rem", children: /* @__PURE__ */ jsx23(
15311
+ AddressElement,
15312
+ {
15313
+ options: {
15314
+ mode: "billing",
15315
+ fields: {
15316
+ phone: data.checkoutSettings.collectPhone ? "always" : "never"
15317
+ }
15318
+ },
15319
+ id: "address-element",
15320
+ onChange: (event) => {
15321
+ setIsAddressComplete(event.complete);
15139
15322
  }
15140
15323
  }
15141
15324
  ) }),
15142
- /* @__PURE__ */ jsx22(
15325
+ /* @__PURE__ */ jsx23(
15143
15326
  Button,
15144
15327
  {
15145
15328
  id: "submit",
15146
- disabled: isLoading || !stripe || !elements || isConfirmed || !isComplete,
15329
+ disabled: isLoading || !stripe || !elements || isConfirmed || !isPaymentComplete || !isAddressComplete,
15147
15330
  style: { flexShrink: 0 },
15148
15331
  $color: "primary",
15149
15332
  $isLoading: isLoading,
@@ -15151,7 +15334,7 @@ var PaymentForm = ({ onConfirm }) => {
15151
15334
  children: isLoading ? t2("Loading") : t2("Save payment method")
15152
15335
  }
15153
15336
  ),
15154
- message && /* @__PURE__ */ jsx22(Box, { $margin: "1rem 0", children: /* @__PURE__ */ jsx22(Text, { id: "payment-message", $size: 15, $weight: 500, $color: "#DB6669", children: message }) })
15337
+ message && /* @__PURE__ */ jsx23(Box, { $margin: "1rem 0", children: /* @__PURE__ */ jsx23(Text, { id: "payment-message", $size: 15, $weight: 500, $color: "#DB6669", children: message }) })
15155
15338
  ]
15156
15339
  }
15157
15340
  );
@@ -15159,7 +15342,7 @@ var PaymentForm = ({ onConfirm }) => {
15159
15342
 
15160
15343
  // src/components/shared/period-toggle/PeriodToggle.tsx
15161
15344
  import { useMemo as useMemo10 } from "react";
15162
- import { jsx as jsx23 } from "react/jsx-runtime";
15345
+ import { jsx as jsx24 } from "react/jsx-runtime";
15163
15346
  var PeriodToggle = ({
15164
15347
  options,
15165
15348
  selectedOption,
@@ -15179,7 +15362,7 @@ var PeriodToggle = ({
15179
15362
  }
15180
15363
  return 0;
15181
15364
  }, [selectedPlan]);
15182
- return /* @__PURE__ */ jsx23(
15365
+ return /* @__PURE__ */ jsx24(
15183
15366
  Flex,
15184
15367
  {
15185
15368
  $margin: 0,
@@ -15195,7 +15378,7 @@ var PeriodToggle = ({
15195
15378
  }
15196
15379
  },
15197
15380
  children: options.map((option) => {
15198
- const element = /* @__PURE__ */ jsx23(
15381
+ const element = /* @__PURE__ */ jsx24(
15199
15382
  Flex,
15200
15383
  {
15201
15384
  tabIndex: 0,
@@ -15215,7 +15398,7 @@ var PeriodToggle = ({
15215
15398
  $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.125)" : "hsla(0, 0%, 100%, 0.125)"
15216
15399
  },
15217
15400
  $borderRadius: "2.5rem",
15218
- children: /* @__PURE__ */ jsx23(
15401
+ children: /* @__PURE__ */ jsx24(
15219
15402
  Text,
15220
15403
  {
15221
15404
  style: { flexShrink: 0 },
@@ -15228,11 +15411,11 @@ var PeriodToggle = ({
15228
15411
  option
15229
15412
  );
15230
15413
  if (option === "year" && savingsPercentage > 0) {
15231
- return /* @__PURE__ */ jsx23(
15414
+ return /* @__PURE__ */ jsx24(
15232
15415
  Tooltip,
15233
15416
  {
15234
15417
  trigger: element,
15235
- content: /* @__PURE__ */ jsx23(Text, { $size: 11, $leading: 1, children: selectedOption === "month" ? t2("Save with yearly billing", {
15418
+ content: /* @__PURE__ */ jsx24(Text, { $size: 11, $leading: 1, children: selectedOption === "month" ? t2("Save with yearly billing", {
15236
15419
  percent: savingsPercentage
15237
15420
  }) : t2("Saving with yearly billing", {
15238
15421
  percent: savingsPercentage
@@ -15253,7 +15436,7 @@ import { useMemo as useMemo12 } from "react";
15253
15436
 
15254
15437
  // src/components/shared/pricing-tiers-tooltip/PriceText.tsx
15255
15438
  import { useMemo as useMemo11 } from "react";
15256
- import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
15439
+ import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
15257
15440
  var PriceText = ({
15258
15441
  feature,
15259
15442
  period,
@@ -15261,6 +15444,7 @@ var PriceText = ({
15261
15444
  flatAmount = 0,
15262
15445
  perUnitPrice = 0
15263
15446
  }) => {
15447
+ const { settings } = useEmbed();
15264
15448
  const text = useMemo11(() => {
15265
15449
  if (!flatAmount && perUnitPrice) {
15266
15450
  return /* @__PURE__ */ jsxs19(Fragment10, { children: [
@@ -15294,11 +15478,11 @@ var PriceText = ({
15294
15478
  ] })
15295
15479
  ] });
15296
15480
  }, [feature, period, currency, flatAmount, perUnitPrice]);
15297
- return /* @__PURE__ */ jsx24(Text, { $leading: 1, children: text });
15481
+ return /* @__PURE__ */ jsx25(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, $leading: 1, children: text });
15298
15482
  };
15299
15483
 
15300
15484
  // src/components/shared/pricing-tiers-tooltip/PricingTiersTooltip.tsx
15301
- import { Fragment as Fragment11, jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
15485
+ import { Fragment as Fragment11, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
15302
15486
  var PricingTiersTooltip = ({
15303
15487
  feature,
15304
15488
  period,
@@ -15326,20 +15510,19 @@ var PricingTiersTooltip = ({
15326
15510
  if (!priceTiers.length) {
15327
15511
  return null;
15328
15512
  }
15329
- return /* @__PURE__ */ jsx25(
15513
+ return /* @__PURE__ */ jsx26(
15330
15514
  Tooltip,
15331
15515
  {
15332
- trigger: /* @__PURE__ */ jsx25(
15516
+ trigger: /* @__PURE__ */ jsx26(
15333
15517
  Icon3,
15334
15518
  {
15335
15519
  title: "tiered pricing",
15336
15520
  name: "info-rounded",
15337
- color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`,
15338
- style: { marginLeft: `-${1 / 3}rem` }
15521
+ color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`
15339
15522
  }
15340
15523
  ),
15341
15524
  content: /* @__PURE__ */ jsxs20(Flex, { $flexDirection: "column", $gap: "1rem", children: [
15342
- /* @__PURE__ */ jsx25("dl", { children: tiers.map((tier, index) => {
15525
+ /* @__PURE__ */ jsx26("dl", { children: tiers.map((tier, index) => {
15343
15526
  const flatAmount = typeof tier.flatAmount === "number" ? tier.flatAmount : void 0;
15344
15527
  const perUnitPrice = typeof tier.perUnitPriceDecimal === "string" ? Number(tier.perUnitPriceDecimal) : typeof tier.perUnitPrice === "number" ? tier.perUnitPrice : void 0;
15345
15528
  return /* @__PURE__ */ jsxs20(
@@ -15350,11 +15533,17 @@ var PricingTiersTooltip = ({
15350
15533
  $gap: "1rem",
15351
15534
  $padding: "0.5rem",
15352
15535
  children: [
15353
- /* @__PURE__ */ jsx25("dt", { children: /* @__PURE__ */ jsxs20(Text, { children: [
15354
- tier.from,
15355
- tier.from !== tier.to && /* @__PURE__ */ jsx25(Fragment11, { children: tier.to === Infinity ? "+" : `\u2013${tier.to}` })
15356
- ] }) }),
15357
- /* @__PURE__ */ jsx25("dd", { children: /* @__PURE__ */ jsx25(
15536
+ /* @__PURE__ */ jsx26("dt", { children: /* @__PURE__ */ jsxs20(
15537
+ Text,
15538
+ {
15539
+ $size: 0.875 * settings.theme.typography.text.fontSize,
15540
+ children: [
15541
+ tier.from,
15542
+ tier.from !== tier.to && /* @__PURE__ */ jsx26(Fragment11, { children: tier.to === Infinity ? "+" : `\u2013${tier.to}` })
15543
+ ]
15544
+ }
15545
+ ) }),
15546
+ /* @__PURE__ */ jsx26("dd", { children: /* @__PURE__ */ jsx26(
15358
15547
  PriceText,
15359
15548
  {
15360
15549
  period,
@@ -15370,7 +15559,7 @@ var PricingTiersTooltip = ({
15370
15559
  );
15371
15560
  }) }),
15372
15561
  (tiersMode === "volume" /* Volume */ || tiersMode === "graduated" /* Graduated */) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
15373
- /* @__PURE__ */ jsx25(
15562
+ /* @__PURE__ */ jsx26(
15374
15563
  "hr",
15375
15564
  {
15376
15565
  style: {
@@ -15380,15 +15569,13 @@ var PricingTiersTooltip = ({
15380
15569
  }
15381
15570
  }
15382
15571
  ),
15383
- /* @__PURE__ */ jsx25(Box, { children: /* @__PURE__ */ jsxs20(Text, { children: [
15572
+ /* @__PURE__ */ jsx26(Box, { children: /* @__PURE__ */ jsxs20(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, children: [
15384
15573
  "\u2139\uFE0F",
15385
15574
  " ",
15386
15575
  tiersMode === "volume" /* Volume */ ? t2("Price by unit based on final tier reached.") : t2("Tiers apply progressively as quantity increases.")
15387
15576
  ] }) })
15388
15577
  ] })
15389
- ] }),
15390
- $flexGrow: "0 !important",
15391
- $width: "auto !important"
15578
+ ] })
15392
15579
  }
15393
15580
  );
15394
15581
  };
@@ -15449,7 +15636,7 @@ var TieredPricingDetails = ({
15449
15636
 
15450
15637
  // src/components/shared/unsubscribe-dialog/UnsubscribeDialog.tsx
15451
15638
  import { useMemo as useMemo14, useRef as useRef8, useState as useState11 } from "react";
15452
- import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
15639
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
15453
15640
  var UnsubscribeDialog = ({ top = 0 }) => {
15454
15641
  const { t: t2 } = useTranslation();
15455
15642
  const { data, setCheckoutState } = useEmbed();
@@ -15494,7 +15681,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
15494
15681
  [currentAddOns, availableAddOns]
15495
15682
  );
15496
15683
  return /* @__PURE__ */ jsxs21(Modal2, { size: "auto", top, contentRef, children: [
15497
- /* @__PURE__ */ jsx26(ModalHeader, {}),
15684
+ /* @__PURE__ */ jsx27(ModalHeader, {}),
15498
15685
  /* @__PURE__ */ jsxs21(
15499
15686
  Flex,
15500
15687
  {
@@ -15517,7 +15704,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
15517
15704
  $padding: "0 2.5rem 2.5rem",
15518
15705
  children: [
15519
15706
  /* @__PURE__ */ jsxs21(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
15520
- /* @__PURE__ */ jsx26(Text, { as: "h2", display: "heading2", children: t2("Cancel subscription") }),
15707
+ /* @__PURE__ */ jsx27(Text, { as: "h2", display: "heading2", children: t2("Cancel subscription") }),
15521
15708
  /* @__PURE__ */ jsxs21(Text, { as: "p", children: [
15522
15709
  t2(
15523
15710
  "You will retain access to your plan until the end of the billing period, on"
@@ -15529,8 +15716,8 @@ var UnsubscribeDialog = ({ top = 0 }) => {
15529
15716
  ] })
15530
15717
  ] }),
15531
15718
  /* @__PURE__ */ jsxs21(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
15532
- /* @__PURE__ */ jsx26(Text, { as: "p", children: t2("Not ready to cancel?") }),
15533
- /* @__PURE__ */ jsx26(
15719
+ /* @__PURE__ */ jsx27(Text, { as: "p", children: t2("Not ready to cancel?") }),
15720
+ /* @__PURE__ */ jsx27(
15534
15721
  Button,
15535
15722
  {
15536
15723
  type: "button",
@@ -15551,7 +15738,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
15551
15738
  ]
15552
15739
  }
15553
15740
  ),
15554
- /* @__PURE__ */ jsx26(
15741
+ /* @__PURE__ */ jsx27(
15555
15742
  Sidebar,
15556
15743
  {
15557
15744
  planPeriod,
@@ -15572,7 +15759,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
15572
15759
  };
15573
15760
 
15574
15761
  // src/components/ui/badge/Badge.tsx
15575
- import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
15762
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
15576
15763
  var Badge = () => {
15577
15764
  const { t: t2 } = useTranslation();
15578
15765
  const { settings } = useEmbed();
@@ -15594,77 +15781,77 @@ var Badge = () => {
15594
15781
  " "
15595
15782
  ] }),
15596
15783
  /* @__PURE__ */ jsxs22("svg", { viewBox: "0 0 86 16", width: 86, height: 16, children: [
15597
- /* @__PURE__ */ jsx27(
15784
+ /* @__PURE__ */ jsx28(
15598
15785
  "path",
15599
15786
  {
15600
15787
  d: "M21.2354 6.16227C21.1796 5.95015 21.0494 5.76779 20.8261 5.61893C20.6028 5.46635 20.3423 5.39564 20.0408 5.39564C19.3151 5.39564 18.7941 5.69708 18.7941 6.2367C18.7941 6.49721 18.9095 6.69073 19.1402 6.81726C19.3635 6.94379 19.732 7.07033 20.2344 7.18569C21.0084 7.37177 21.4922 7.51691 21.9686 7.7402C22.203 7.85557 22.3928 7.97465 22.5305 8.10863C22.7948 8.3803 22.9548 8.74501 22.9362 9.20276C22.9176 9.86147 22.6571 10.375 22.1547 10.7397C21.6523 11.1082 20.9563 11.2905 20.0818 11.2905C19.2072 11.2905 18.5597 11.1268 18.0312 10.8067C17.5065 10.4867 17.2013 10.0215 17.1194 9.41116L18.6192 9.27719C18.6974 9.57491 18.8723 9.7982 19.1514 9.94706C19.4305 10.0959 19.7394 10.1778 20.0818 10.1778C20.4614 10.1778 20.7777 10.0996 21.0308 9.9359C21.2838 9.77959 21.4104 9.56002 21.4104 9.28835C21.4104 8.90876 21.0531 8.61104 20.5991 8.43613C20.3683 8.35053 20.0855 8.27238 19.7468 8.19423C19.2705 8.07886 18.8946 7.97094 18.6155 7.87418C18.3364 7.78486 18.0908 7.66205 17.8712 7.51319C17.4358 7.21547 17.2832 6.8247 17.2832 6.2367C17.2832 5.61521 17.5325 5.13141 18.0312 4.79648C18.5262 4.46526 19.2035 4.29407 20.0669 4.29407C21.5853 4.29407 22.5752 4.9044 22.7389 6.05807L21.228 6.16227H21.2354Z",
15601
15788
  fill: "currentColor"
15602
15789
  }
15603
15790
  ),
15604
- /* @__PURE__ */ jsx27(
15791
+ /* @__PURE__ */ jsx28(
15605
15792
  "path",
15606
15793
  {
15607
15794
  d: "M29.4145 8.9796L30.7803 9.55271C30.49 10.0923 30.0621 10.5129 29.5001 10.8217C28.9382 11.1344 28.3167 11.2944 27.6319 11.2944C26.9472 11.2944 26.3629 11.1567 25.8121 10.8701C25.2613 10.5873 24.8147 10.1742 24.4835 9.6383C24.1523 9.09868 23.9811 8.48835 23.9811 7.79987C23.9811 7.11138 24.1486 6.49361 24.4835 5.95771C24.8147 5.41809 25.2613 5.00873 25.8121 4.72589C26.3629 4.44305 26.9732 4.30164 27.6319 4.30164C28.2906 4.30164 28.9382 4.45794 29.5038 4.77427C30.0658 5.08688 30.4938 5.51113 30.7803 6.05075L29.4145 6.62015C29.0535 5.93539 28.3985 5.56323 27.6319 5.56323C27.0327 5.56323 26.5303 5.77536 26.1135 6.19961C25.6967 6.62387 25.492 7.15977 25.492 7.80731C25.492 8.45486 25.6967 8.99076 26.1135 9.40757C26.5303 9.83182 27.0327 10.0439 27.6319 10.0439C28.3985 10.0439 29.0535 9.66807 29.4145 8.98703V8.9796Z",
15608
15795
  fill: "currentColor"
15609
15796
  }
15610
15797
  ),
15611
- /* @__PURE__ */ jsx27(
15798
+ /* @__PURE__ */ jsx28(
15612
15799
  "path",
15613
15800
  {
15614
15801
  d: "M37.4386 11.2049V7.80341C37.4386 6.35945 36.9139 5.59282 35.697 5.59282C35.0978 5.59282 34.614 5.7975 34.2419 6.21059C33.8623 6.61996 33.6725 7.15214 33.6725 7.80713V11.2086H32.1615V1.9234H33.6725V5.47745C34.1004 4.73315 35.001 4.29773 36.1919 4.29773C37.167 4.29773 37.8666 4.59917 38.302 5.19834C38.7375 5.7975 38.9533 6.66834 38.9533 7.80341V11.2049H37.4349H37.4386Z",
15615
15802
  fill: "currentColor"
15616
15803
  }
15617
15804
  ),
15618
- /* @__PURE__ */ jsx27(
15805
+ /* @__PURE__ */ jsx28(
15619
15806
  "path",
15620
15807
  {
15621
15808
  d: "M46.5692 5.38819C47.2167 6.07295 47.5777 7.1187 47.5107 8.30587H41.8242C41.9284 8.83805 42.1741 9.26602 42.5611 9.59352C42.9481 9.92473 43.4022 10.0885 43.9157 10.0885C44.8052 10.0885 45.5234 9.59724 45.8844 8.78222L47.1795 9.40372C46.8818 9.99172 46.4352 10.4495 45.8509 10.7881C45.2629 11.1268 44.6191 11.2943 43.9157 11.2943C42.9295 11.2943 42.0178 10.9444 41.3516 10.3453C40.6855 9.7461 40.2649 8.83432 40.2649 7.79602C40.2649 6.75771 40.6892 5.84222 41.3516 5.23933C42.0178 4.64017 42.9295 4.29034 43.9157 4.29034C44.9801 4.29034 45.9216 4.69971 46.5692 5.38447V5.38819ZM42.5388 6.00224C42.1592 6.32974 41.921 6.75772 41.8205 7.29734H46.0221C45.9179 6.75772 45.6835 6.3223 45.3039 5.99852C44.9243 5.67847 44.4628 5.51473 43.9195 5.51473C43.3761 5.51473 42.9221 5.67847 42.5425 6.00597L42.5388 6.00224Z",
15622
15809
  fill: "currentColor"
15623
15810
  }
15624
15811
  ),
15625
- /* @__PURE__ */ jsx27(
15812
+ /* @__PURE__ */ jsx28(
15626
15813
  "path",
15627
15814
  {
15628
15815
  d: "M59.7699 5.23933C60.1495 5.86827 60.3132 6.68329 60.3132 7.80347V11.2049H58.8023V7.80347C58.8023 6.35952 58.3371 5.59288 57.2318 5.59288C56.6438 5.59288 56.1861 5.79384 55.8586 6.19577C55.5311 6.60141 55.3673 7.13731 55.3673 7.80347V11.2049H53.8489V7.80347C53.8489 6.35952 53.3838 5.59288 52.2785 5.59288C51.6905 5.59288 51.2327 5.79384 50.9052 6.19577C50.574 6.60141 50.4102 7.13731 50.4102 7.80347V11.2049H48.8993V4.39827H50.3433L50.4102 5.47379C50.8196 4.65878 51.5825 4.29407 52.8106 4.29407C53.9606 4.29407 54.7161 4.78531 55.077 5.76407C55.5199 4.81508 56.4428 4.29407 57.7677 4.29407C58.7093 4.29407 59.3829 4.61412 59.7699 5.23562V5.23933Z",
15629
15816
  fill: "currentColor"
15630
15817
  }
15631
15818
  ),
15632
- /* @__PURE__ */ jsx27(
15819
+ /* @__PURE__ */ jsx28(
15633
15820
  "path",
15634
15821
  {
15635
15822
  d: "M67.4264 5.47382L67.4934 4.3983H68.9373V11.205H67.4934L67.4264 10.1294C67.0282 10.9147 66.1797 11.3092 64.8809 11.3017C63.102 11.3427 61.591 9.79823 61.6283 7.8035C61.591 5.8162 63.102 4.2606 64.8809 4.29782C66.0643 4.29782 67.0096 4.7444 67.4264 5.47754V5.47382ZM66.8049 9.37398C67.2217 8.95717 67.4264 8.43243 67.4264 7.79605C67.4264 7.15967 67.2217 6.64238 66.8049 6.21813C66.3881 5.80132 65.8782 5.58919 65.2828 5.58919C64.6874 5.58919 64.1887 5.80132 63.7719 6.21813C63.355 6.64238 63.1504 7.16711 63.1504 7.79605C63.1504 8.42499 63.355 8.95717 63.7719 9.37398C64.1887 9.79823 64.6911 10.0104 65.2828 10.0104C65.8745 10.0104 66.3881 9.79823 66.8049 9.37398Z",
15636
15823
  fill: "currentColor"
15637
15824
  }
15638
15825
  ),
15639
- /* @__PURE__ */ jsx27(
15826
+ /* @__PURE__ */ jsx28(
15640
15827
  "path",
15641
15828
  {
15642
15829
  d: "M71.3891 2.85757H72.8926V4.39828H74.6455V5.58172H72.8926V8.9683C72.8926 9.5898 73.1048 9.90985 73.5923 9.96568C73.89 10.0252 74.2398 10.0141 74.6455 9.9359V11.1863C74.1989 11.257 73.7858 11.2943 73.4062 11.2943C72.6731 11.2943 72.1595 11.1082 71.8543 10.7323C71.5454 10.3639 71.3891 9.79076 71.3891 9.02041V5.58172H70.4215V4.39828H71.3891V2.85757Z",
15643
15830
  fill: "currentColor"
15644
15831
  }
15645
15832
  ),
15646
- /* @__PURE__ */ jsx27(
15833
+ /* @__PURE__ */ jsx28(
15647
15834
  "path",
15648
15835
  {
15649
15836
  d: "M76.1747 3.15526C75.9923 2.98035 75.903 2.76078 75.903 2.50772C75.903 2.25466 75.9923 2.04997 76.1747 1.86762C76.3496 1.69271 76.5691 1.60339 76.8222 1.60339C77.0753 1.60339 77.2874 1.69271 77.4623 1.86762C77.6372 2.04997 77.7265 2.2621 77.7265 2.50772C77.7265 2.75334 77.6372 2.97291 77.4623 3.15526C77.2874 3.33762 77.0678 3.42694 76.8222 3.42694C76.5766 3.42694 76.3496 3.33762 76.1747 3.15526ZM76.0593 4.39826H77.5777V11.2049H76.0593V4.39826Z",
15650
15837
  fill: "currentColor"
15651
15838
  }
15652
15839
  ),
15653
- /* @__PURE__ */ jsx27(
15840
+ /* @__PURE__ */ jsx28(
15654
15841
  "path",
15655
15842
  {
15656
15843
  d: "M84.3023 8.9796L85.6681 9.55271C85.3778 10.0923 84.9498 10.5129 84.3879 10.8217C83.8259 11.1344 83.2044 11.2944 82.5197 11.2944C81.8349 11.2944 81.2506 11.1567 80.6998 10.8701C80.1491 10.5873 79.7025 10.1742 79.3713 9.6383C79.04 9.09868 78.8689 8.48835 78.8689 7.79987C78.8689 7.11138 79.0363 6.49361 79.3713 5.95771C79.7025 5.41809 80.1528 5.00873 80.6998 4.72589C81.2469 4.44305 81.8609 4.30164 82.5197 4.30164C83.1784 4.30164 83.8259 4.45794 84.3916 4.77427C84.9535 5.08688 85.3815 5.51113 85.6681 6.05075L84.3023 6.62015C83.9413 5.93539 83.2863 5.56323 82.5197 5.56323C81.9205 5.56323 81.4181 5.77536 81.0013 6.19961C80.5845 6.62387 80.3798 7.15977 80.3798 7.80731C80.3798 8.45486 80.5845 8.99076 81.0013 9.40757C81.4181 9.83182 81.9205 10.0439 82.5197 10.0439C83.2863 10.0439 83.9413 9.66807 84.3023 8.98703V8.9796Z",
15657
15844
  fill: "currentColor"
15658
15845
  }
15659
15846
  ),
15660
- /* @__PURE__ */ jsx27(
15847
+ /* @__PURE__ */ jsx28(
15661
15848
  "path",
15662
15849
  {
15663
15850
  d: "M5.93091 10.8141L7.2758 9.41753L3.83719 5.84667C2.98568 4.9624 2.98568 3.52157 3.83719 2.63731C4.68871 1.75305 6.07617 1.75305 6.92769 2.63731L10.3663 6.20817L11.7112 4.81156L8.27258 1.24069C6.67975 -0.413401 4.08513 -0.413401 2.4923 1.24069C0.899472 2.89479 0.899472 5.58919 2.4923 7.24328L5.93091 10.8141Z",
15664
15851
  fill: "currentColor"
15665
15852
  }
15666
15853
  ),
15667
- /* @__PURE__ */ jsx27(
15854
+ /* @__PURE__ */ jsx28(
15668
15855
  "path",
15669
15856
  {
15670
15857
  d: "M6.05827 3.54751C5.68761 3.1626 5.08404 3.1626 4.71338 3.54751C4.34272 3.93243 4.34272 4.55921 4.71338 4.94413L9.02103 9.41746L5.93054 12.6268L1.62288 8.15349C1.25223 7.76857 0.648653 7.76857 0.277994 8.15349C-0.0926647 8.5384 -0.0926647 9.16519 0.277994 9.5501L5.93054 15.4201L11.7108 9.41746L6.05827 3.54751Z",
@@ -15678,9 +15865,9 @@ var Badge = () => {
15678
15865
  };
15679
15866
 
15680
15867
  // src/components/layout/RenderLayout.tsx
15681
- import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
15868
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
15682
15869
  var Disabled = () => {
15683
- return /* @__PURE__ */ jsx28(Box, { $width: "max-content", $height: "max-content", $margin: "0 auto", children: /* @__PURE__ */ jsx28(Card, { children: /* @__PURE__ */ jsxs23(
15870
+ return /* @__PURE__ */ jsx29(Box, { $width: "max-content", $height: "max-content", $margin: "0 auto", children: /* @__PURE__ */ jsx29(Card, { children: /* @__PURE__ */ jsxs23(
15684
15871
  Element,
15685
15872
  {
15686
15873
  as: Flex,
@@ -15689,8 +15876,8 @@ var Disabled = () => {
15689
15876
  $alignItems: "center",
15690
15877
  $whiteSpace: "nowrap",
15691
15878
  children: [
15692
- /* @__PURE__ */ jsx28(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx28(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
15693
- /* @__PURE__ */ jsx28(Text, { as: "p", children: "Please try again later." })
15879
+ /* @__PURE__ */ jsx29(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx29(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
15880
+ /* @__PURE__ */ jsx29(Text, { as: "p", children: "Please try again later." })
15694
15881
  ]
15695
15882
  }
15696
15883
  ) }) });
@@ -15699,7 +15886,7 @@ var RenderLayout = ({ children }) => {
15699
15886
  const { layout } = useEmbed();
15700
15887
  switch (layout) {
15701
15888
  case "disabled":
15702
- return /* @__PURE__ */ jsx28(Disabled, {});
15889
+ return /* @__PURE__ */ jsx29(Disabled, {});
15703
15890
  default:
15704
15891
  return children;
15705
15892
  }
@@ -15724,7 +15911,7 @@ var StyledViewport = dt.div.withConfig({
15724
15911
  `;
15725
15912
 
15726
15913
  // src/components/layout/viewport/Viewport.tsx
15727
- import { Fragment as Fragment12, jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
15914
+ import { Fragment as Fragment12, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
15728
15915
  var Viewport = forwardRef5(
15729
15916
  ({ children, portal, ...props }, ref) => {
15730
15917
  const { data, layout, settings } = useEmbed();
@@ -15752,22 +15939,22 @@ var Viewport = forwardRef5(
15752
15939
  }, [portal, layout]);
15753
15940
  return /* @__PURE__ */ jsxs24(Fragment12, { children: [
15754
15941
  /* @__PURE__ */ jsxs24(StyledViewport, { ref, ...props, children: [
15755
- /* @__PURE__ */ jsx29(RenderLayout, { children }),
15756
- isBadgeVisible && /* @__PURE__ */ jsx29(Badge, {})
15942
+ /* @__PURE__ */ jsx30(RenderLayout, { children }),
15943
+ isBadgeVisible && /* @__PURE__ */ jsx30(Badge, {})
15757
15944
  ] }),
15758
- canCheckout && layout === "checkout" && createPortal2(/* @__PURE__ */ jsx29(CheckoutDialog, { top }), portal || document.body),
15945
+ canCheckout && layout === "checkout" && createPortal2(/* @__PURE__ */ jsx30(CheckoutDialog, { top }), portal || document.body),
15759
15946
  layout === "unsubscribe" && createPortal2(
15760
- /* @__PURE__ */ jsx29(UnsubscribeDialog, { top }),
15947
+ /* @__PURE__ */ jsx30(UnsubscribeDialog, { top }),
15761
15948
  portal || document.body
15762
15949
  ),
15763
- layout === "payment" && createPortal2(/* @__PURE__ */ jsx29(PaymentDialog, { top }), portal || document.body)
15950
+ layout === "payment" && createPortal2(/* @__PURE__ */ jsx30(PaymentDialog, { top }), portal || document.body)
15764
15951
  ] });
15765
15952
  }
15766
15953
  );
15767
15954
  Viewport.displayName = "Viewport";
15768
15955
 
15769
15956
  // src/components/elements/button/Button.tsx
15770
- import { jsx as jsx30 } from "react/jsx-runtime";
15957
+ import { jsx as jsx31 } from "react/jsx-runtime";
15771
15958
  var resolveDesignProps = (props) => {
15772
15959
  return {
15773
15960
  button: {
@@ -15798,7 +15985,7 @@ var ButtonElement = forwardRef6(({ children, className, ...rest }, ref) => {
15798
15985
  variant: "text"
15799
15986
  }
15800
15987
  };
15801
- return /* @__PURE__ */ jsx30(
15988
+ return /* @__PURE__ */ jsx31(
15802
15989
  Element,
15803
15990
  {
15804
15991
  as: Flex,
@@ -15806,7 +15993,7 @@ var ButtonElement = forwardRef6(({ children, className, ...rest }, ref) => {
15806
15993
  className,
15807
15994
  $flexDirection: "column",
15808
15995
  $gap: "2rem",
15809
- children: /* @__PURE__ */ jsx30(
15996
+ children: /* @__PURE__ */ jsx31(
15810
15997
  Button,
15811
15998
  {
15812
15999
  as: "a",
@@ -15831,7 +16018,7 @@ import { forwardRef as forwardRef7, useMemo as useMemo17, useRef as useRef9, use
15831
16018
 
15832
16019
  // src/components/elements/included-features/UsageDetails.tsx
15833
16020
  import { Fragment as Fragment13, useMemo as useMemo16 } from "react";
15834
- import { Fragment as Fragment14, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
16021
+ import { Fragment as Fragment14, jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
15835
16022
  var UsageDetails = ({
15836
16023
  entitlement,
15837
16024
  shouldWrapChildren,
@@ -15889,7 +16076,7 @@ var UsageDetails = ({
15889
16076
  ] });
15890
16077
  }
15891
16078
  if (priceBehavior === "tier" /* Tiered */) {
15892
- return /* @__PURE__ */ jsx31(Fragment14, { children: typeof currentTier?.to === "number" && (currentTier?.to === Infinity ? t2("Unlimited in this tier", {
16079
+ return /* @__PURE__ */ jsx32(Fragment14, { children: typeof currentTier?.to === "number" && (currentTier?.to === Infinity ? t2("Unlimited in this tier", {
15893
16080
  feature: getFeatureName(feature)
15894
16081
  }) : t2("Up to X units in this tier", {
15895
16082
  amount: formatNumber(currentTier.to),
@@ -15968,7 +16155,7 @@ var UsageDetails = ({
15968
16155
  if (typeof cost === "number" && cost > 0) {
15969
16156
  acc.push(
15970
16157
  /* @__PURE__ */ jsxs25(Fragment13, { children: [
15971
- acc.length > 0 && /* @__PURE__ */ jsx31(Fragment14, { children: " \u2022 " }),
16158
+ acc.length > 0 && /* @__PURE__ */ jsx32(Fragment14, { children: " \u2022 " }),
15972
16159
  formatCurrency(cost, currency)
15973
16160
  ] }, index)
15974
16161
  );
@@ -15984,7 +16171,7 @@ var UsageDetails = ({
15984
16171
  if (metricResetAt) {
15985
16172
  acc.push(
15986
16173
  /* @__PURE__ */ jsxs25(Fragment13, { children: [
15987
- acc.length > 0 && /* @__PURE__ */ jsx31(Fragment14, { children: " \u2022 " }),
16174
+ acc.length > 0 && /* @__PURE__ */ jsx32(Fragment14, { children: " \u2022 " }),
15988
16175
  t2("Resets", {
15989
16176
  date: toPrettyDate(metricResetAt, {
15990
16177
  month: "numeric",
@@ -16028,9 +16215,10 @@ var UsageDetails = ({
16028
16215
  $flexGrow: "1",
16029
16216
  $textAlign: shouldWrapChildren ? "left" : "right",
16030
16217
  children: [
16031
- layout.entitlement.isVisible && /* @__PURE__ */ jsx31(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx31(Text, { display: layout.entitlement.fontStyle, $leading: 1, children: text }) }),
16032
- layout.usage.isVisible && usageText && /* @__PURE__ */ jsxs25(Flex, { $justifyContent: "end", $alignItems: "center", $whiteSpace: "nowrap", children: [
16033
- priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsx31(
16218
+ layout.entitlement.isVisible && /* @__PURE__ */ jsx32(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx32(Text, { display: layout.entitlement.fontStyle, $leading: 1, children: text }) }),
16219
+ layout.usage.isVisible && usageText && /* @__PURE__ */ jsxs25(Flex, { $justifyContent: "end", $alignItems: "end", $whiteSpace: "nowrap", children: [
16220
+ /* @__PURE__ */ jsx32(Text, { display: layout.usage.fontStyle, $leading: 1, children: usageText }),
16221
+ priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsx32(
16034
16222
  PricingTiersTooltip,
16035
16223
  {
16036
16224
  feature,
@@ -16038,8 +16226,7 @@ var UsageDetails = ({
16038
16226
  currency: billingPrice?.currency,
16039
16227
  priceTiers: billingPrice?.priceTier
16040
16228
  }
16041
- ),
16042
- /* @__PURE__ */ jsx31(Text, { display: layout.usage.fontStyle, $leading: 1, children: usageText })
16229
+ )
16043
16230
  ] })
16044
16231
  ]
16045
16232
  }
@@ -16047,7 +16234,7 @@ var UsageDetails = ({
16047
16234
  };
16048
16235
 
16049
16236
  // src/components/elements/included-features/IncludedFeatures.tsx
16050
- import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
16237
+ import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
16051
16238
  function resolveDesignProps2(props) {
16052
16239
  return {
16053
16240
  header: {
@@ -16131,7 +16318,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
16131
16318
  $flexDirection: "column",
16132
16319
  $gap: "1rem",
16133
16320
  children: [
16134
- props.header.isVisible && /* @__PURE__ */ jsx32(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx32(Text, { display: props.header.fontStyle, children: props.header.text }) }),
16321
+ props.header.isVisible && /* @__PURE__ */ jsx33(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx33(Text, { display: props.header.fontStyle, children: props.header.text }) }),
16135
16322
  featureUsage.slice(0, showCount).map((entitlement, index) => {
16136
16323
  const shouldShowDetails = entitlement.feature?.name && (entitlement.feature?.featureType === "event" /* Event */ || entitlement.feature?.featureType === "trait" /* Trait */);
16137
16324
  return /* @__PURE__ */ jsxs26(
@@ -16155,7 +16342,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
16155
16342
  $flexBasis: "min-content",
16156
16343
  $gap: "1rem",
16157
16344
  children: [
16158
- props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ jsx32(
16345
+ props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ jsx33(
16159
16346
  Icon3,
16160
16347
  {
16161
16348
  name: entitlement.feature.icon,
@@ -16164,7 +16351,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
16164
16351
  rounded: true
16165
16352
  }
16166
16353
  ),
16167
- entitlement.feature?.name && /* @__PURE__ */ jsx32(Text, { display: props.icons.fontStyle, children: entitlement.feature.name }),
16354
+ entitlement.feature?.name && /* @__PURE__ */ jsx33(Text, { display: props.icons.fontStyle, children: entitlement.feature.name }),
16168
16355
  props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ jsxs26(
16169
16356
  Text,
16170
16357
  {
@@ -16182,7 +16369,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
16182
16369
  ]
16183
16370
  }
16184
16371
  ),
16185
- shouldShowDetails && /* @__PURE__ */ jsx32(
16372
+ shouldShowDetails && /* @__PURE__ */ jsx33(
16186
16373
  UsageDetails,
16187
16374
  {
16188
16375
  entitlement,
@@ -16196,14 +16383,14 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
16196
16383
  );
16197
16384
  }),
16198
16385
  shouldShowExpand && /* @__PURE__ */ jsxs26(Flex, { $alignItems: "center", $justifyContent: "start", $marginTop: "1rem", children: [
16199
- /* @__PURE__ */ jsx32(
16386
+ /* @__PURE__ */ jsx33(
16200
16387
  Icon3,
16201
16388
  {
16202
16389
  name: isExpanded ? "chevron-up" : "chevron-down",
16203
16390
  color: "#D0D0D0"
16204
16391
  }
16205
16392
  ),
16206
- /* @__PURE__ */ jsx32(
16393
+ /* @__PURE__ */ jsx33(
16207
16394
  Text,
16208
16395
  {
16209
16396
  onClick: handleToggleShowAll,
@@ -16221,7 +16408,7 @@ IncludedFeatures.displayName = "IncludedFeatures";
16221
16408
 
16222
16409
  // src/components/elements/invoices/Invoices.tsx
16223
16410
  import { forwardRef as forwardRef8, useCallback as useCallback10, useEffect as useEffect6, useState as useState14 } from "react";
16224
- import { Fragment as Fragment15, jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
16411
+ import { Fragment as Fragment15, jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
16225
16412
  function resolveDesignProps3(props) {
16226
16413
  return {
16227
16414
  header: {
@@ -16292,7 +16479,7 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
16292
16479
  return null;
16293
16480
  }
16294
16481
  return /* @__PURE__ */ jsxs27(Element, { ref, className, children: [
16295
- /* @__PURE__ */ jsx33(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx33(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
16482
+ /* @__PURE__ */ jsx34(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx34(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
16296
16483
  error ? /* @__PURE__ */ jsxs27(
16297
16484
  Flex,
16298
16485
  {
@@ -16302,8 +16489,8 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
16302
16489
  $alignItems: "center",
16303
16490
  $gap: "1rem",
16304
16491
  children: [
16305
- /* @__PURE__ */ jsx33(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your invoices.") }),
16306
- /* @__PURE__ */ jsx33(
16492
+ /* @__PURE__ */ jsx34(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your invoices.") }),
16493
+ /* @__PURE__ */ jsx34(
16307
16494
  Button,
16308
16495
  {
16309
16496
  type: "button",
@@ -16316,12 +16503,12 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
16316
16503
  )
16317
16504
  ]
16318
16505
  }
16319
- ) : !isLoading && /* @__PURE__ */ jsx33(TransitionBox, { children: /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "1rem", children: [
16320
- props.header.isVisible && /* @__PURE__ */ jsx33(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsx33(Text, { display: props.header.fontStyle, children: t2("Invoices") }) }),
16506
+ ) : !isLoading && /* @__PURE__ */ jsx34(TransitionBox, { children: /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "1rem", children: [
16507
+ props.header.isVisible && /* @__PURE__ */ jsx34(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsx34(Text, { display: props.header.fontStyle, children: t2("Invoices") }) }),
16321
16508
  invoices.length > 0 ? /* @__PURE__ */ jsxs27(Fragment15, { children: [
16322
- /* @__PURE__ */ jsx33(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, url }, index) => {
16509
+ /* @__PURE__ */ jsx34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, url }, index) => {
16323
16510
  return /* @__PURE__ */ jsxs27(Flex, { $justifyContent: "space-between", children: [
16324
- props.date.isVisible && /* @__PURE__ */ jsx33(
16511
+ props.date.isVisible && /* @__PURE__ */ jsx34(
16325
16512
  Text,
16326
16513
  {
16327
16514
  display: props.date.fontStyle,
@@ -16335,18 +16522,18 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
16335
16522
  children: date
16336
16523
  }
16337
16524
  ),
16338
- props.amount.isVisible && /* @__PURE__ */ jsx33(Text, { display: props.amount.fontStyle, children: amount })
16525
+ props.amount.isVisible && /* @__PURE__ */ jsx34(Text, { display: props.amount.fontStyle, children: amount })
16339
16526
  ] }, index);
16340
16527
  }) }),
16341
16528
  props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ jsxs27(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
16342
- /* @__PURE__ */ jsx33(
16529
+ /* @__PURE__ */ jsx34(
16343
16530
  Icon3,
16344
16531
  {
16345
16532
  name: `chevron-${listSize === props.limit.number ? "down" : "up"}`,
16346
16533
  color: "#D0D0D0"
16347
16534
  }
16348
16535
  ),
16349
- /* @__PURE__ */ jsx33(
16536
+ /* @__PURE__ */ jsx34(
16350
16537
  Text,
16351
16538
  {
16352
16539
  onClick: toggleListSize,
@@ -16358,7 +16545,7 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
16358
16545
  }
16359
16546
  )
16360
16547
  ] })
16361
- ] }) : /* @__PURE__ */ jsx33(Text, { display: "heading2", children: t2("No invoices created yet") })
16548
+ ] }) : /* @__PURE__ */ jsx34(Text, { display: "heading2", children: t2("No invoices created yet") })
16362
16549
  ] }) })
16363
16550
  ] });
16364
16551
  });
@@ -16368,14 +16555,14 @@ Invoices.displayName = "Invoices";
16368
16555
  import { forwardRef as forwardRef9, useCallback as useCallback11, useMemo as useMemo18, useRef as useRef10, useState as useState15 } from "react";
16369
16556
 
16370
16557
  // src/components/elements/metered-features/Meter.tsx
16371
- import { jsx as jsx34 } from "react/jsx-runtime";
16558
+ import { jsx as jsx35 } from "react/jsx-runtime";
16372
16559
  var Meter = ({ entitlement, usageDetails }) => {
16373
16560
  const { priceBehavior, usage } = entitlement;
16374
16561
  const limit = usageDetails.limit ?? usageDetails.currentTier?.to;
16375
16562
  if (typeof usage !== "number" || !limit || limit === Infinity) {
16376
16563
  return null;
16377
16564
  }
16378
- const meter = /* @__PURE__ */ jsx34(
16565
+ const meter = /* @__PURE__ */ jsx35(
16379
16566
  ProgressBar,
16380
16567
  {
16381
16568
  progress: Math.min(usage, limit) / Math.max(usage, limit) * 100,
@@ -16392,7 +16579,7 @@ var Meter = ({ entitlement, usageDetails }) => {
16392
16579
  };
16393
16580
 
16394
16581
  // src/components/elements/metered-features/PriceDetails.tsx
16395
- import { Fragment as Fragment16, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
16582
+ import { Fragment as Fragment16, jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
16396
16583
  var PriceDetails = ({
16397
16584
  entitlement,
16398
16585
  usageDetails,
@@ -16449,14 +16636,14 @@ var PriceDetails = ({
16449
16636
  shortenPeriod(period)
16450
16637
  ] })
16451
16638
  ] })
16452
- ] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs28(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
16639
+ ] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs28(Flex, { $alignItems: "end", children: [
16453
16640
  /* @__PURE__ */ jsxs28(Text, { children: [
16454
16641
  t2("Tier"),
16455
16642
  ": ",
16456
16643
  currentTier?.from || 1,
16457
- typeof currentTier?.to === "number" && (currentTier?.from || 1) !== currentTier?.to && /* @__PURE__ */ jsx35(Fragment16, { children: currentTier.to === Infinity ? "+" : `\u2013${currentTier.to}` })
16644
+ typeof currentTier?.to === "number" && (currentTier?.from || 1) !== currentTier?.to && /* @__PURE__ */ jsx36(Fragment16, { children: currentTier.to === Infinity ? "+" : `\u2013${currentTier.to}` })
16458
16645
  ] }),
16459
- /* @__PURE__ */ jsx35(
16646
+ /* @__PURE__ */ jsx36(
16460
16647
  PricingTiersTooltip,
16461
16648
  {
16462
16649
  period,
@@ -16467,7 +16654,7 @@ var PriceDetails = ({
16467
16654
  }
16468
16655
  )
16469
16656
  ] }),
16470
- typeof amount === "number" && /* @__PURE__ */ jsx35(Fragment16, { children: priceBehavior === "overage" /* Overage */ ? /* @__PURE__ */ jsxs28(Text, { children: [
16657
+ typeof amount === "number" && /* @__PURE__ */ jsx36(Fragment16, { children: priceBehavior === "overage" /* Overage */ ? /* @__PURE__ */ jsxs28(Text, { children: [
16471
16658
  formatNumber(amount),
16472
16659
  " ",
16473
16660
  getFeatureName(feature, amount),
@@ -16507,7 +16694,7 @@ var Container2 = dt.div`
16507
16694
  `;
16508
16695
 
16509
16696
  // src/components/elements/metered-features/MeteredFeatures.tsx
16510
- import { Fragment as Fragment17, jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
16697
+ import { Fragment as Fragment17, jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
16511
16698
  var Limit = ({ entitlement, usageDetails, fontStyle }) => {
16512
16699
  const { t: t2 } = useTranslation();
16513
16700
  const { feature, priceBehavior, allocation, usage, metricResetAt } = entitlement;
@@ -16536,7 +16723,7 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
16536
16723
  })
16537
16724
  );
16538
16725
  }
16539
- return /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx36(Text, { display: fontStyle, children: acc.join(" \u2022 ") }) });
16726
+ return /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx37(Text, { display: fontStyle, children: acc.join(" \u2022 ") }) });
16540
16727
  };
16541
16728
  function resolveDesignProps4(props) {
16542
16729
  return {
@@ -16614,7 +16801,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16614
16801
  )
16615
16802
  );
16616
16803
  }, []);
16617
- const shouldShowFeatures = meteredFeatures.length > 0;
16804
+ const shouldShowFeatures = meteredFeatures.length > 0 || creditGroups.length > 0;
16618
16805
  if (!shouldShowFeatures) {
16619
16806
  return null;
16620
16807
  }
@@ -16629,7 +16816,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16629
16816
  acc.push(
16630
16817
  /* @__PURE__ */ jsxs29(Element, { as: Flex, $flexDirection: "column", $gap: "1.5rem", children: [
16631
16818
  /* @__PURE__ */ jsxs29(Flex, { $gap: "1.5rem", children: [
16632
- props.icon.isVisible && /* @__PURE__ */ jsx36(
16819
+ props.icon.isVisible && /* @__PURE__ */ jsx37(
16633
16820
  Icon3,
16634
16821
  {
16635
16822
  name: feature.icon,
@@ -16651,8 +16838,8 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16651
16838
  $gap: "1rem",
16652
16839
  children: [
16653
16840
  /* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
16654
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: props.header.fontStyle, children: feature.name }) }),
16655
- props.description.isVisible && /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: props.description.fontStyle, children: feature.description }) })
16841
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.header.fontStyle, children: feature.name }) }),
16842
+ props.description.isVisible && /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.description.fontStyle, children: feature.description }) })
16656
16843
  ] }),
16657
16844
  /* @__PURE__ */ jsxs29(
16658
16845
  Box,
@@ -16661,7 +16848,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16661
16848
  $flexGrow: 1,
16662
16849
  $textAlign: shouldWrapChildren ? "left" : "right",
16663
16850
  children: [
16664
- props.usage.isVisible && /* @__PURE__ */ jsx36(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx36(Text, { display: props.usage.fontStyle, children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs29(Fragment17, { children: [
16851
+ props.usage.isVisible && /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx37(Text, { display: props.usage.fontStyle, children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs29(Fragment17, { children: [
16665
16852
  typeof limit === "number" && /* @__PURE__ */ jsxs29(Fragment17, { children: [
16666
16853
  formatNumber(limit),
16667
16854
  " "
@@ -16674,7 +16861,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16674
16861
  " ",
16675
16862
  t2("used")
16676
16863
  ] }) }) }),
16677
- props.allocation.isVisible && /* @__PURE__ */ jsx36(
16864
+ props.allocation.isVisible && /* @__PURE__ */ jsx37(
16678
16865
  Limit,
16679
16866
  {
16680
16867
  entitlement,
@@ -16688,14 +16875,14 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16688
16875
  ]
16689
16876
  }
16690
16877
  ),
16691
- props.isVisible && priceBehavior !== "pay_as_you_go" /* PayAsYouGo */ && /* @__PURE__ */ jsx36(
16878
+ props.isVisible && priceBehavior !== "pay_as_you_go" /* PayAsYouGo */ && /* @__PURE__ */ jsx37(
16692
16879
  Meter,
16693
16880
  {
16694
16881
  entitlement,
16695
16882
  usageDetails
16696
16883
  }
16697
16884
  ),
16698
- priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ jsx36(
16885
+ priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ jsx37(
16699
16886
  Button,
16700
16887
  {
16701
16888
  type: "button",
@@ -16708,7 +16895,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16708
16895
  )
16709
16896
  ] })
16710
16897
  ] }),
16711
- (priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsx36(
16898
+ (priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsx37(
16712
16899
  PriceDetails,
16713
16900
  {
16714
16901
  entitlement,
@@ -16724,7 +16911,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16724
16911
  const isExpanded = creditVisibility.find(({ id }) => credit.id === id)?.isExpanded ?? false;
16725
16912
  return /* @__PURE__ */ jsxs29(Element, { as: Flex, $flexDirection: "column", $gap: "1rem", children: [
16726
16913
  /* @__PURE__ */ jsxs29(Flex, { $gap: "1.5rem", children: [
16727
- props.icon.isVisible && /* @__PURE__ */ jsx36(
16914
+ props.icon.isVisible && /* @__PURE__ */ jsx37(
16728
16915
  Icon3,
16729
16916
  {
16730
16917
  name: credit.icon,
@@ -16734,12 +16921,12 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16734
16921
  }
16735
16922
  ),
16736
16923
  /* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
16737
- /* @__PURE__ */ jsx36(Flex, { $flexWrap: "wrap", $gap: "1rem", children: /* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
16738
- /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: props.header.fontStyle, children: credit.name }) }),
16739
- props.description.isVisible && /* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(Text, { display: props.description.fontStyle, children: credit.description }) })
16924
+ /* @__PURE__ */ jsx37(Flex, { $flexWrap: "wrap", $gap: "1rem", children: /* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
16925
+ /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.header.fontStyle, children: credit.name }) }),
16926
+ props.description.isVisible && /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.description.fontStyle, children: credit.description }) })
16740
16927
  ] }) }),
16741
16928
  /* @__PURE__ */ jsxs29(Flex, { $gap: "1rem", children: [
16742
- /* @__PURE__ */ jsx36(
16929
+ /* @__PURE__ */ jsx37(
16743
16930
  ProgressBar,
16744
16931
  {
16745
16932
  progress: credit.total.used / credit.total.value * 100,
@@ -16750,7 +16937,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16750
16937
  )]
16751
16938
  }
16752
16939
  ),
16753
- /* @__PURE__ */ jsx36(
16940
+ /* @__PURE__ */ jsx37(
16754
16941
  Button,
16755
16942
  {
16756
16943
  type: "button",
@@ -16765,12 +16952,12 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16765
16952
  ] })
16766
16953
  ] })
16767
16954
  ] }),
16768
- /* @__PURE__ */ jsx36(
16955
+ /* @__PURE__ */ jsx37(
16769
16956
  Box,
16770
16957
  {
16771
16958
  $width: `calc(100% + ${2 * settings.theme.card.padding / TEXT_BASE_SIZE}rem)`,
16772
16959
  $margin: `0 0 0 -${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
16773
- children: /* @__PURE__ */ jsx36(
16960
+ children: /* @__PURE__ */ jsx37(
16774
16961
  TransitionBox,
16775
16962
  {
16776
16963
  $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.0375)" : "hsla(0, 0%, 100%, 0.075)",
@@ -16778,19 +16965,19 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16778
16965
  children: credit.grants.map((grant, index2) => {
16779
16966
  const paddingX = settings.theme.card.padding / TEXT_BASE_SIZE;
16780
16967
  const padding = index2 > 0 ? `0 ${paddingX}rem 1rem` : `1rem ${paddingX}rem`;
16781
- return /* @__PURE__ */ jsx36(Box, { $display: "table-row", children: grant.grantReason === "plan" /* Plan */ ? /* @__PURE__ */ jsxs29(Fragment17, { children: [
16782
- /* @__PURE__ */ jsx36(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx36(Text, { children: t2("X items included in plan", {
16968
+ return /* @__PURE__ */ jsx37(Box, { $display: "table-row", children: grant.grantReason === "plan" /* Plan */ ? /* @__PURE__ */ jsxs29(Fragment17, { children: [
16969
+ /* @__PURE__ */ jsx37(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx37(Text, { children: t2("X items included in plan", {
16783
16970
  amount: grant.quantity,
16784
16971
  item: getFeatureName(credit, grant.quantity)
16785
16972
  }) }) }),
16786
- /* @__PURE__ */ jsx36(
16973
+ /* @__PURE__ */ jsx37(
16787
16974
  Box,
16788
16975
  {
16789
16976
  $display: "table-cell",
16790
16977
  $padding: padding,
16791
16978
  $textAlign: "right",
16792
16979
  $whiteSpace: "nowrap",
16793
- children: grant.expiresAt && /* @__PURE__ */ jsx36(Text, { children: t2("Resets", {
16980
+ children: grant.expiresAt && /* @__PURE__ */ jsx37(Text, { children: t2("Resets", {
16794
16981
  date: toPrettyDate(
16795
16982
  modifyDate(grant.expiresAt, 1),
16796
16983
  {
@@ -16803,7 +16990,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16803
16990
  }
16804
16991
  )
16805
16992
  ] }) : /* @__PURE__ */ jsxs29(Fragment17, { children: [
16806
- /* @__PURE__ */ jsx36(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx36(Text, { children: grant.grantReason === "purchased" /* Purchased */ ? /* @__PURE__ */ jsx36(Fragment17, { children: t2("X item bundle", {
16993
+ /* @__PURE__ */ jsx37(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx37(Text, { children: grant.grantReason === "purchased" /* Purchased */ ? /* @__PURE__ */ jsx37(Fragment17, { children: t2("X item bundle", {
16807
16994
  amount: grant.quantity,
16808
16995
  item: getFeatureName(credit, 1),
16809
16996
  createdAt: toPrettyDate(grant.createdAt, {
@@ -16811,7 +16998,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16811
16998
  month: "2-digit",
16812
16999
  year: "2-digit"
16813
17000
  })
16814
- }) }) : /* @__PURE__ */ jsx36(Fragment17, { children: t2("X item grant", {
17001
+ }) }) : /* @__PURE__ */ jsx37(Fragment17, { children: t2("X item grant", {
16815
17002
  amount: grant.quantity,
16816
17003
  item: getFeatureName(
16817
17004
  credit,
@@ -16823,14 +17010,14 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16823
17010
  year: "2-digit"
16824
17011
  })
16825
17012
  }) }) }) }),
16826
- /* @__PURE__ */ jsx36(
17013
+ /* @__PURE__ */ jsx37(
16827
17014
  Box,
16828
17015
  {
16829
17016
  $display: "table-cell",
16830
17017
  $padding: padding,
16831
17018
  $textAlign: "right",
16832
17019
  $whiteSpace: "nowrap",
16833
- children: grant.expiresAt && /* @__PURE__ */ jsx36(Text, { children: t2("Expires", {
17020
+ children: grant.expiresAt && /* @__PURE__ */ jsx37(Text, { children: t2("Expires", {
16834
17021
  date: toPrettyDate(
16835
17022
  modifyDate(grant.expiresAt, 1),
16836
17023
  {
@@ -16849,7 +17036,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16849
17036
  }
16850
17037
  ),
16851
17038
  /* @__PURE__ */ jsxs29(Flex, { $gap: "0.25rem", children: [
16852
- /* @__PURE__ */ jsx36(
17039
+ /* @__PURE__ */ jsx37(
16853
17040
  Icon3,
16854
17041
  {
16855
17042
  name: "chevron-down",
@@ -16860,7 +17047,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
16860
17047
  }
16861
17048
  }
16862
17049
  ),
16863
- /* @__PURE__ */ jsx36(
17050
+ /* @__PURE__ */ jsx37(
16864
17051
  Text,
16865
17052
  {
16866
17053
  onClick: () => toggleBalanceDetails(credit.id),
@@ -16880,24 +17067,24 @@ import { forwardRef as forwardRef10, useMemo as useMemo20 } from "react";
16880
17067
 
16881
17068
  // src/components/elements/payment-method/PaymentMethodElement.tsx
16882
17069
  import { useMemo as useMemo19 } from "react";
16883
- import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
17070
+ import { jsx as jsx38, jsxs as jsxs30 } from "react/jsx-runtime";
16884
17071
  var PaymentElement2 = ({
16885
17072
  iconName,
16886
17073
  iconTitle,
16887
17074
  label,
16888
17075
  paymentLast4
16889
17076
  }) => {
16890
- return /* @__PURE__ */ jsx37(Text, { children: /* @__PURE__ */ jsxs30(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
16891
- iconName && /* @__PURE__ */ jsx37(Icon3, { name: iconName, title: iconTitle }),
17077
+ return /* @__PURE__ */ jsx38(Text, { children: /* @__PURE__ */ jsxs30(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
17078
+ iconName && /* @__PURE__ */ jsx38(Icon3, { name: iconName, title: iconTitle }),
16892
17079
  (label || paymentLast4) && /* @__PURE__ */ jsxs30(Box, { $flexGrow: 1, children: [
16893
- label && /* @__PURE__ */ jsx37(Text, { children: label }),
17080
+ label && /* @__PURE__ */ jsx38(Text, { children: label }),
16894
17081
  " ",
16895
- paymentLast4 && /* @__PURE__ */ jsx37(Text, { children: paymentLast4 })
17082
+ paymentLast4 && /* @__PURE__ */ jsx38(Text, { children: paymentLast4 })
16896
17083
  ] })
16897
17084
  ] }) });
16898
17085
  };
16899
17086
  var EmptyPaymentElement = () => {
16900
- return /* @__PURE__ */ jsx37(Text, { children: /* @__PURE__ */ jsx37(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ jsx37(Flex, { $alignItems: "center", children: /* @__PURE__ */ jsx37(Box, { $lineHeight: 1, children: t("No payment method added yet") }) }) }) });
17087
+ return /* @__PURE__ */ jsx38(Text, { children: /* @__PURE__ */ jsx38(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ jsx38(Flex, { $alignItems: "center", children: /* @__PURE__ */ jsx38(Box, { $lineHeight: 1, children: t("No payment method added yet") }) }) }) });
16901
17088
  };
16902
17089
  var getPaymentMethodData = ({
16903
17090
  accountLast4,
@@ -16964,8 +17151,8 @@ var PaymentMethodElement = ({
16964
17151
  const sizeFactor = size === "lg" ? 1.5 : size === "md" ? 1 : 0.5;
16965
17152
  return /* @__PURE__ */ jsxs30(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
16966
17153
  props.header.isVisible && /* @__PURE__ */ jsxs30(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
16967
- /* @__PURE__ */ jsx37(Text, { display: props.header.fontStyle, children: t2("Payment Method") }),
16968
- props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ jsx37(Text, { $size: 14, $color: "#DB6769", children: monthsToExpiration > 0 ? t2("Expires in X months", { months: monthsToExpiration }) : t2("Expired") })
17154
+ /* @__PURE__ */ jsx38(Text, { display: props.header.fontStyle, children: t2("Payment Method") }),
17155
+ props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ jsx38(Text, { $size: 14, $color: "#DB6769", children: monthsToExpiration > 0 ? t2("Expires in X months", { months: monthsToExpiration }) : t2("Expired") })
16969
17156
  ] }),
16970
17157
  /* @__PURE__ */ jsxs30(
16971
17158
  Flex,
@@ -16976,8 +17163,8 @@ var PaymentMethodElement = ({
16976
17163
  $padding: `${sizeFactor / 2.25}rem ${sizeFactor}rem`,
16977
17164
  $borderRadius: "9999px",
16978
17165
  children: [
16979
- paymentMethod ? /* @__PURE__ */ jsx37(PaymentElement2, { ...getPaymentMethodData(paymentMethod) }) : /* @__PURE__ */ jsx37(EmptyPaymentElement, {}),
16980
- props.functions.allowEdit && onEdit && /* @__PURE__ */ jsx37(
17166
+ paymentMethod ? /* @__PURE__ */ jsx38(PaymentElement2, { ...getPaymentMethodData(paymentMethod) }) : /* @__PURE__ */ jsx38(EmptyPaymentElement, {}),
17167
+ props.functions.allowEdit && onEdit && /* @__PURE__ */ jsx38(
16981
17168
  Text,
16982
17169
  {
16983
17170
  onClick: onEdit,
@@ -17022,21 +17209,21 @@ var PaymentListElement = ({
17022
17209
  $borderStyle: "solid",
17023
17210
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
17024
17211
  children: [
17025
- iconName && /* @__PURE__ */ jsx37(Icon3, { name: iconName, title: iconTitle }),
17212
+ iconName && /* @__PURE__ */ jsx38(Icon3, { name: iconName, title: iconTitle }),
17026
17213
  (label || paymentLast4) && /* @__PURE__ */ jsxs30(Box, { $flexGrow: 1, children: [
17027
- label && /* @__PURE__ */ jsx37(Text, { children: label }),
17214
+ label && /* @__PURE__ */ jsx38(Text, { children: label }),
17028
17215
  " ",
17029
- paymentLast4 && /* @__PURE__ */ jsx37(Text, { children: paymentLast4 })
17216
+ paymentLast4 && /* @__PURE__ */ jsx38(Text, { children: paymentLast4 })
17030
17217
  ] }),
17031
- expirationDate && /* @__PURE__ */ jsx37(
17218
+ expirationDate && /* @__PURE__ */ jsx38(
17032
17219
  Box,
17033
17220
  {
17034
17221
  $flexGrow: 1,
17035
17222
  $color: isLightBackground ? "hsla(0, 0%, 0%, 0.375)" : "hsla(0, 0%, 100%, 0.375)",
17036
- children: /* @__PURE__ */ jsx37(Text, { children: t("Expires", { date: expirationDate }) })
17223
+ children: /* @__PURE__ */ jsx38(Text, { children: t("Expires", { date: expirationDate }) })
17037
17224
  }
17038
17225
  ),
17039
- /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(
17226
+ /* @__PURE__ */ jsx38(Box, { children: /* @__PURE__ */ jsx38(
17040
17227
  Text,
17041
17228
  {
17042
17229
  onClick: () => {
@@ -17049,7 +17236,7 @@ var PaymentListElement = ({
17049
17236
  children: t("Set default")
17050
17237
  }
17051
17238
  ) }),
17052
- /* @__PURE__ */ jsx37(
17239
+ /* @__PURE__ */ jsx38(
17053
17240
  Icon3,
17054
17241
  {
17055
17242
  tabIndex: 0,
@@ -17071,7 +17258,7 @@ var PaymentListElement = ({
17071
17258
  };
17072
17259
 
17073
17260
  // src/components/elements/payment-method/PaymentMethod.tsx
17074
- import { jsx as jsx38 } from "react/jsx-runtime";
17261
+ import { jsx as jsx39 } from "react/jsx-runtime";
17075
17262
  var resolveDesignProps5 = (props) => {
17076
17263
  return {
17077
17264
  header: {
@@ -17112,7 +17299,7 @@ var PaymentMethod = forwardRef10(({ children, className, portal, allowEdit = tru
17112
17299
  monthsToExpiration: void 0
17113
17300
  };
17114
17301
  }, [data]);
17115
- return /* @__PURE__ */ jsx38(Element, { ref, className, children: /* @__PURE__ */ jsx38(
17302
+ return /* @__PURE__ */ jsx39(Element, { ref, className, children: /* @__PURE__ */ jsx39(
17116
17303
  PaymentMethodElement,
17117
17304
  {
17118
17305
  paymentMethod,
@@ -17281,7 +17468,7 @@ var loadStripe = function loadStripe2() {
17281
17468
 
17282
17469
  // src/components/elements/payment-method/PaymentMethodDetails.tsx
17283
17470
  import { useCallback as useCallback12, useEffect as useEffect7, useMemo as useMemo21, useState as useState16 } from "react";
17284
- import { jsx as jsx39, jsxs as jsxs31 } from "react/jsx-runtime";
17471
+ import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
17285
17472
  var resolveDesignProps6 = () => {
17286
17473
  return {
17287
17474
  header: {
@@ -17421,7 +17608,7 @@ var PaymentMethodDetails = ({
17421
17608
  initializePaymentMethod
17422
17609
  ]);
17423
17610
  return /* @__PURE__ */ jsxs31(Flex, { $position: "relative", children: [
17424
- /* @__PURE__ */ jsx39(
17611
+ /* @__PURE__ */ jsx40(
17425
17612
  Flex,
17426
17613
  {
17427
17614
  $position: "absolute",
@@ -17430,7 +17617,7 @@ var PaymentMethodDetails = ({
17430
17617
  $alignItems: "center",
17431
17618
  $width: "100%",
17432
17619
  $height: "100%",
17433
- children: /* @__PURE__ */ jsx39(
17620
+ children: /* @__PURE__ */ jsx40(
17434
17621
  Loader,
17435
17622
  {
17436
17623
  $color: settings.theme.primary,
@@ -17483,7 +17670,7 @@ var PaymentMethodDetails = ({
17483
17670
  clientSecret: setupIntent?.setupIntentClientSecret
17484
17671
  },
17485
17672
  children: [
17486
- /* @__PURE__ */ jsx39(
17673
+ /* @__PURE__ */ jsx40(
17487
17674
  PaymentForm,
17488
17675
  {
17489
17676
  onConfirm: async (paymentMethodId) => {
@@ -17493,7 +17680,7 @@ var PaymentMethodDetails = ({
17493
17680
  }
17494
17681
  }
17495
17682
  ),
17496
- currentPaymentMethod && /* @__PURE__ */ jsx39(Box, { children: /* @__PURE__ */ jsx39(
17683
+ currentPaymentMethod && /* @__PURE__ */ jsx40(Box, { children: /* @__PURE__ */ jsx40(
17497
17684
  Text,
17498
17685
  {
17499
17686
  onClick: focusExistingPaymentMethods,
@@ -17507,7 +17694,7 @@ var PaymentMethodDetails = ({
17507
17694
  ]
17508
17695
  }
17509
17696
  ) : /* @__PURE__ */ jsxs31(Flex, { $flexDirection: "column", $gap: "2rem", children: [
17510
- /* @__PURE__ */ jsx39(
17697
+ /* @__PURE__ */ jsx40(
17511
17698
  PaymentMethodElement,
17512
17699
  {
17513
17700
  paymentMethod: currentPaymentMethod,
@@ -17516,7 +17703,7 @@ var PaymentMethodDetails = ({
17516
17703
  }
17517
17704
  ),
17518
17705
  paymentMethods.length > 0 && /* @__PURE__ */ jsxs31(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
17519
- /* @__PURE__ */ jsx39(
17706
+ /* @__PURE__ */ jsx40(
17520
17707
  Text,
17521
17708
  {
17522
17709
  onClick: toggleShowPaymentMethods,
@@ -17527,7 +17714,7 @@ var PaymentMethodDetails = ({
17527
17714
  children: t2("Choose different payment method")
17528
17715
  }
17529
17716
  ),
17530
- /* @__PURE__ */ jsx39(
17717
+ /* @__PURE__ */ jsx40(
17531
17718
  Icon3,
17532
17719
  {
17533
17720
  name: showDifferentPaymentMethods ? "chevron-up" : "chevron-down"
@@ -17535,9 +17722,9 @@ var PaymentMethodDetails = ({
17535
17722
  )
17536
17723
  ] }),
17537
17724
  showDifferentPaymentMethods && /* @__PURE__ */ jsxs31(Flex, { $flexDirection: "column", $gap: "2rem", $marginTop: "-1rem", children: [
17538
- /* @__PURE__ */ jsx39(Flex, { $flexDirection: "column", $overflow: "auto", children: (paymentMethods.filter(
17725
+ /* @__PURE__ */ jsx40(Flex, { $flexDirection: "column", $overflow: "auto", children: (paymentMethods.filter(
17539
17726
  (paymentMethod) => paymentMethod.id !== currentPaymentMethod?.id
17540
- ) || []).map((paymentMethod) => /* @__PURE__ */ jsx39(
17727
+ ) || []).map((paymentMethod) => /* @__PURE__ */ jsx40(
17541
17728
  PaymentListElement,
17542
17729
  {
17543
17730
  paymentMethod,
@@ -17546,7 +17733,7 @@ var PaymentMethodDetails = ({
17546
17733
  },
17547
17734
  paymentMethod.id
17548
17735
  )) }),
17549
- (!setupIntent || !currentPaymentMethod) && /* @__PURE__ */ jsx39(
17736
+ (!setupIntent || !currentPaymentMethod) && /* @__PURE__ */ jsx40(
17550
17737
  Button,
17551
17738
  {
17552
17739
  type: "button",
@@ -17558,7 +17745,7 @@ var PaymentMethodDetails = ({
17558
17745
  )
17559
17746
  ] })
17560
17747
  ] }),
17561
- !isLoading && error && /* @__PURE__ */ jsx39(Box, { children: /* @__PURE__ */ jsx39(Text, { $weight: 500, $color: "#DB6669", children: error }) })
17748
+ !isLoading && error && /* @__PURE__ */ jsx40(Box, { children: /* @__PURE__ */ jsx40(Text, { $weight: 500, $color: "#DB6669", children: error }) })
17562
17749
  ]
17563
17750
  }
17564
17751
  )
@@ -17569,7 +17756,7 @@ var PaymentMethodDetails = ({
17569
17756
  import { forwardRef as forwardRef11, useMemo as useMemo23 } from "react";
17570
17757
 
17571
17758
  // src/components/elements/plan-manager/AddOn.tsx
17572
- import { jsx as jsx40, jsxs as jsxs32 } from "react/jsx-runtime";
17759
+ import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
17573
17760
  var AddOn = ({ addOn, currency, layout }) => {
17574
17761
  return /* @__PURE__ */ jsxs32(
17575
17762
  Flex,
@@ -17579,10 +17766,10 @@ var AddOn = ({ addOn, currency, layout }) => {
17579
17766
  $flexWrap: "wrap",
17580
17767
  $gap: "1rem",
17581
17768
  children: [
17582
- /* @__PURE__ */ jsx40(Text, { display: layout.addOns.fontStyle, children: addOn.name }),
17769
+ /* @__PURE__ */ jsx41(Text, { display: layout.addOns.fontStyle, children: addOn.name }),
17583
17770
  typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsxs32(Text, { children: [
17584
17771
  formatCurrency(addOn.planPrice, currency),
17585
- /* @__PURE__ */ jsx40("sub", { children: addOn.planPeriod == "one-time" ? shortenPeriod(addOn.planPeriod) : `/${shortenPeriod(addOn.planPeriod)}` })
17772
+ /* @__PURE__ */ jsx41("sub", { children: addOn.planPeriod == "one-time" ? shortenPeriod(addOn.planPeriod) : `/${shortenPeriod(addOn.planPeriod)}` })
17586
17773
  ] })
17587
17774
  ]
17588
17775
  }
@@ -17591,7 +17778,7 @@ var AddOn = ({ addOn, currency, layout }) => {
17591
17778
 
17592
17779
  // src/components/elements/plan-manager/UsageDetails.tsx
17593
17780
  import { Fragment as Fragment18, useMemo as useMemo22 } from "react";
17594
- import { Fragment as Fragment19, jsx as jsx41, jsxs as jsxs33 } from "react/jsx-runtime";
17781
+ import { Fragment as Fragment19, jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
17595
17782
  var UsageDetails2 = ({
17596
17783
  entitlement,
17597
17784
  period,
@@ -17613,7 +17800,7 @@ var UsageDetails2 = ({
17613
17800
  let index = 0;
17614
17801
  if (entitlement.priceBehavior === "overage" /* Overage */) {
17615
17802
  acc.push(
17616
- amount > 0 ? /* @__PURE__ */ jsx41(Fragment18, { children: t2("X additional", {
17803
+ amount > 0 ? /* @__PURE__ */ jsx42(Fragment18, { children: t2("X additional", {
17617
17804
  amount
17618
17805
  }) }, index) : /* @__PURE__ */ jsxs33(Fragment18, { children: [
17619
17806
  t2("Additional"),
@@ -17685,13 +17872,13 @@ var UsageDetails2 = ({
17685
17872
  $flexWrap: "wrap",
17686
17873
  $gap: "0.5rem",
17687
17874
  children: [
17688
- /* @__PURE__ */ jsx41(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" && quantity > 0 ? /* @__PURE__ */ jsxs33(Fragment19, { children: [
17875
+ /* @__PURE__ */ jsx42(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" && quantity > 0 ? /* @__PURE__ */ jsxs33(Fragment19, { children: [
17689
17876
  quantity,
17690
17877
  " ",
17691
17878
  entitlement.feature.name
17692
17879
  ] }) : entitlement.feature.name }),
17693
17880
  /* @__PURE__ */ jsxs33(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
17694
- description.length > 0 && /* @__PURE__ */ jsx41(
17881
+ description.length > 0 && /* @__PURE__ */ jsx42(
17695
17882
  Text,
17696
17883
  {
17697
17884
  style: { opacity: 0.54 },
@@ -17700,8 +17887,15 @@ var UsageDetails2 = ({
17700
17887
  children: description
17701
17888
  }
17702
17889
  ),
17703
- (cost > 0 || entitlement.priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsxs33(Flex, { $alignItems: "center", children: [
17704
- entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsx41(
17890
+ (cost > 0 || entitlement.priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsxs33(Flex, { $alignItems: "end", children: [
17891
+ /* @__PURE__ */ jsxs33(Text, { children: [
17892
+ formatCurrency(cost, billingPrice?.currency),
17893
+ entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs33("sub", { children: [
17894
+ "/",
17895
+ shortenPeriod(period)
17896
+ ] })
17897
+ ] }),
17898
+ entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsx42(
17705
17899
  PricingTiersTooltip,
17706
17900
  {
17707
17901
  feature: entitlement.feature,
@@ -17709,14 +17903,7 @@ var UsageDetails2 = ({
17709
17903
  currency: billingPrice?.currency,
17710
17904
  priceTiers: billingPrice?.priceTier
17711
17905
  }
17712
- ),
17713
- /* @__PURE__ */ jsxs33(Text, { children: [
17714
- formatCurrency(cost, billingPrice?.currency),
17715
- entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs33("sub", { children: [
17716
- "/",
17717
- shortenPeriod(period)
17718
- ] })
17719
- ] })
17906
+ )
17720
17907
  ] })
17721
17908
  ] })
17722
17909
  ]
@@ -17725,7 +17912,7 @@ var UsageDetails2 = ({
17725
17912
  };
17726
17913
 
17727
17914
  // src/components/elements/plan-manager/PlanManager.tsx
17728
- import { Fragment as Fragment20, jsx as jsx42, jsxs as jsxs34 } from "react/jsx-runtime";
17915
+ import { Fragment as Fragment20, jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
17729
17916
  var resolveDesignProps7 = (props) => {
17730
17917
  return {
17731
17918
  header: {
@@ -17769,6 +17956,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17769
17956
  canCheckout,
17770
17957
  defaultPlan,
17771
17958
  featureUsage,
17959
+ showZeroPriceAsFree,
17772
17960
  trialPaymentMethodRequired
17773
17961
  } = useMemo23(() => {
17774
17962
  if (isCheckoutData(data)) {
@@ -17779,6 +17967,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17779
17967
  capabilities,
17780
17968
  defaultPlan: defaultPlan2,
17781
17969
  featureUsage: featureUsage2,
17970
+ showZeroPriceAsFree: showZeroPriceAsFree2,
17782
17971
  trialPaymentMethodRequired: trialPaymentMethodRequired2
17783
17972
  } = data;
17784
17973
  const creditGroups2 = groupCreditGrants(creditGrants, {
@@ -17808,6 +17997,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17808
17997
  canCheckout: capabilities?.checkout ?? true,
17809
17998
  defaultPlan: defaultPlan2,
17810
17999
  featureUsage: featureUsage2?.features || [],
18000
+ showZeroPriceAsFree: showZeroPriceAsFree2,
17811
18001
  trialPaymentMethodRequired: trialPaymentMethodRequired2
17812
18002
  };
17813
18003
  }
@@ -17820,6 +18010,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17820
18010
  canCheckout: false,
17821
18011
  defaultPlan: void 0,
17822
18012
  featureUsage: [],
18013
+ showZeroPriceAsFree: false,
17823
18014
  trialPaymentMethodRequired: false
17824
18015
  };
17825
18016
  }, [data]);
@@ -17844,7 +18035,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17844
18035
  willSubscriptionCancel: willSubscriptionCancel2
17845
18036
  };
17846
18037
  }, [billingSubscription]);
17847
- const isUsageBasedPlan = currentPlan?.planPrice === 0 && usageBasedEntitlements.length > 0;
18038
+ const isFreePlan = currentPlan?.planPrice === 0;
18039
+ const isUsageBasedPlan = isFreePlan && usageBasedEntitlements.length > 0;
17848
18040
  return /* @__PURE__ */ jsxs34(Fragment20, { children: [
17849
18041
  isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ jsxs34(
17850
18042
  Notice,
@@ -17856,8 +18048,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17856
18048
  $textAlign: "center",
17857
18049
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
17858
18050
  children: [
17859
- typeof trialEnd.formatted !== "undefined" && /* @__PURE__ */ jsx42(Text, { as: "h3", display: "heading3", children: trialEnd.formatted }),
17860
- /* @__PURE__ */ jsx42(Text, { as: "p", $size: 0.8125 * settings.theme.typography.text.fontSize, children: trialPaymentMethodRequired ? t2("After the trial, subscribe") : defaultPlan ? t2("After the trial, cancel", {
18051
+ typeof trialEnd.formatted !== "undefined" && /* @__PURE__ */ jsx43(Text, { as: "h3", display: "heading3", children: trialEnd.formatted }),
18052
+ /* @__PURE__ */ jsx43(Text, { as: "p", $size: 0.8125 * settings.theme.typography.text.fontSize, children: trialPaymentMethodRequired ? t2("After the trial, subscribe") : defaultPlan ? t2("After the trial, cancel", {
17861
18053
  defaultPlanName: defaultPlan?.name
17862
18054
  }) : t2("After the trial, cancel no default", {
17863
18055
  planName: currentPlan?.name
@@ -17874,8 +18066,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17874
18066
  $textAlign: "center",
17875
18067
  $backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
17876
18068
  children: [
17877
- /* @__PURE__ */ jsx42(Text, { as: "h3", display: "heading3", children: t2("Subscription canceled") }),
17878
- typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ jsx42(
18069
+ /* @__PURE__ */ jsx43(Text, { as: "h3", display: "heading3", children: t2("Subscription canceled") }),
18070
+ typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ jsx43(
17879
18071
  Text,
17880
18072
  {
17881
18073
  as: "p",
@@ -17910,21 +18102,21 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17910
18102
  $gap: "1rem",
17911
18103
  children: [
17912
18104
  /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "1rem", children: [
17913
- /* @__PURE__ */ jsx42(Text, { display: props.header.title.fontStyle, $leading: 1, children: currentPlan.name }),
17914
- props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ jsx42(Text, { display: props.header.description.fontStyle, children: currentPlan.description })
18105
+ /* @__PURE__ */ jsx43(Text, { display: props.header.title.fontStyle, $leading: 1, children: currentPlan.name }),
18106
+ props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ jsx43(Text, { display: props.header.description.fontStyle, children: currentPlan.description })
17915
18107
  ] }),
17916
18108
  props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ jsxs34(Box, { children: [
17917
- /* @__PURE__ */ jsx42(
18109
+ /* @__PURE__ */ jsx43(
17918
18110
  Text,
17919
18111
  {
17920
18112
  display: isUsageBasedPlan ? "heading3" : props.header.price.fontStyle,
17921
- children: isUsageBasedPlan ? t2("Usage-based") : formatCurrency(
18113
+ children: isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(
17922
18114
  currentPlan.planPrice,
17923
18115
  subscriptionCurrency
17924
18116
  )
17925
18117
  }
17926
18118
  ),
17927
- !isUsageBasedPlan && /* @__PURE__ */ jsx42(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ jsxs34("sub", { children: [
18119
+ !isFreePlan && /* @__PURE__ */ jsx43(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ jsxs34("sub", { children: [
17928
18120
  "/",
17929
18121
  shortenPeriod(currentPlan.planPeriod)
17930
18122
  ] }) })
@@ -17933,7 +18125,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17933
18125
  }
17934
18126
  ),
17935
18127
  props.addOns.isVisible && currentAddOns.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
17936
- props.addOns.showLabel && /* @__PURE__ */ jsx42(
18128
+ props.addOns.showLabel && /* @__PURE__ */ jsx43(
17937
18129
  Text,
17938
18130
  {
17939
18131
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -17941,7 +18133,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17941
18133
  children: t2("Add-ons")
17942
18134
  }
17943
18135
  ),
17944
- /* @__PURE__ */ jsx42(Flex, { $flexDirection: "column", $gap: "1rem", children: currentAddOns.map((addOn, addOnIndex) => /* @__PURE__ */ jsx42(
18136
+ /* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: currentAddOns.map((addOn, addOnIndex) => /* @__PURE__ */ jsx43(
17945
18137
  AddOn,
17946
18138
  {
17947
18139
  addOn,
@@ -17952,7 +18144,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17952
18144
  )) })
17953
18145
  ] }),
17954
18146
  props.addOns.isVisible && usageBasedEntitlements.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
17955
- props.addOns.showLabel && /* @__PURE__ */ jsx42(
18147
+ props.addOns.showLabel && /* @__PURE__ */ jsx43(
17956
18148
  Text,
17957
18149
  {
17958
18150
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -17960,8 +18152,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17960
18152
  children: t2("Usage-based")
17961
18153
  }
17962
18154
  ),
17963
- /* @__PURE__ */ jsx42(Flex, { $flexDirection: "column", $gap: "1rem", children: usageBasedEntitlements.map((entitlement, entitlementIndex) => {
17964
- return /* @__PURE__ */ jsx42(
18155
+ /* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: usageBasedEntitlements.map((entitlement, entitlementIndex) => {
18156
+ return /* @__PURE__ */ jsx43(
17965
18157
  UsageDetails2,
17966
18158
  {
17967
18159
  entitlement,
@@ -17973,7 +18165,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17973
18165
  }) })
17974
18166
  ] }),
17975
18167
  props.addOns.isVisible && creditGroups.plan.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
17976
- props.addOns.showLabel && /* @__PURE__ */ jsx42(
18168
+ props.addOns.showLabel && /* @__PURE__ */ jsx43(
17977
18169
  Text,
17978
18170
  {
17979
18171
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -17981,7 +18173,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
17981
18173
  children: t2("Credits in plan")
17982
18174
  }
17983
18175
  ),
17984
- /* @__PURE__ */ jsx42(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.plan.map((group, groupIndex) => {
18176
+ /* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.plan.map((group, groupIndex) => {
17985
18177
  return /* @__PURE__ */ jsxs34(
17986
18178
  Flex,
17987
18179
  {
@@ -18021,7 +18213,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
18021
18213
  }) })
18022
18214
  ] }),
18023
18215
  props.addOns.isVisible && creditGroups.bundles.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
18024
- props.addOns.showLabel && /* @__PURE__ */ jsx42(
18216
+ props.addOns.showLabel && /* @__PURE__ */ jsx43(
18025
18217
  Text,
18026
18218
  {
18027
18219
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -18029,7 +18221,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
18029
18221
  children: t2("Credit bundles")
18030
18222
  }
18031
18223
  ),
18032
- /* @__PURE__ */ jsx42(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.bundles.map((group, groupIndex) => {
18224
+ /* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.bundles.map((group, groupIndex) => {
18033
18225
  const bundle = group?.bundleId ? creditBundles.find((b2) => b2.id === group.bundleId) : void 0;
18034
18226
  return /* @__PURE__ */ jsxs34(
18035
18227
  Flex,
@@ -18077,7 +18269,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
18077
18269
  }) })
18078
18270
  ] }),
18079
18271
  props.addOns.isVisible && creditGroups.promotional.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
18080
- props.addOns.showLabel && /* @__PURE__ */ jsx42(
18272
+ props.addOns.showLabel && /* @__PURE__ */ jsx43(
18081
18273
  Text,
18082
18274
  {
18083
18275
  $color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
@@ -18085,7 +18277,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
18085
18277
  children: t2("Promotional credits")
18086
18278
  }
18087
18279
  ),
18088
- /* @__PURE__ */ jsx42(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.promotional.map((group, groupIndex) => {
18280
+ /* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.promotional.map((group, groupIndex) => {
18089
18281
  return /* @__PURE__ */ jsxs34(
18090
18282
  Flex,
18091
18283
  {
@@ -18118,7 +18310,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
18118
18310
  );
18119
18311
  }) })
18120
18312
  ] }),
18121
- canCheckout && props.callToAction.isVisible && /* @__PURE__ */ jsx42(
18313
+ canCheckout && props.callToAction.isVisible && /* @__PURE__ */ jsx43(
18122
18314
  Button,
18123
18315
  {
18124
18316
  type: "button",
@@ -18153,7 +18345,7 @@ import {
18153
18345
 
18154
18346
  // src/components/elements/pricing-table/AddOn.tsx
18155
18347
  import { useMemo as useMemo24 } from "react";
18156
- import { Fragment as Fragment21, jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
18348
+ import { Fragment as Fragment21, jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
18157
18349
  var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18158
18350
  const { layout } = sharedProps;
18159
18351
  const { t: t2 } = useTranslation();
@@ -18196,16 +18388,16 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18196
18388
  },
18197
18389
  children: [
18198
18390
  /* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
18199
- /* @__PURE__ */ jsx43(Box, { children: /* @__PURE__ */ jsx43(Text, { display: layout.plans.name.fontStyle, children: addOn.name }) }),
18200
- layout.addOns.showDescription && /* @__PURE__ */ jsx43(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx43(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
18201
- /* @__PURE__ */ jsx43(Box, { children: /* @__PURE__ */ jsxs35(Text, { display: layout.plans.name.fontStyle, children: [
18391
+ /* @__PURE__ */ jsx44(Box, { children: /* @__PURE__ */ jsx44(Text, { display: layout.plans.name.fontStyle, children: addOn.name }) }),
18392
+ layout.addOns.showDescription && /* @__PURE__ */ jsx44(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx44(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
18393
+ /* @__PURE__ */ jsx44(Box, { children: /* @__PURE__ */ jsxs35(Text, { display: layout.plans.name.fontStyle, children: [
18202
18394
  formatCurrency(addOnPrice ?? 0, addOnCurrency),
18203
18395
  /* @__PURE__ */ jsxs35("sub", { children: [
18204
18396
  "/",
18205
18397
  selectedPeriod
18206
18398
  ] })
18207
18399
  ] }) }),
18208
- isActiveAddOn && /* @__PURE__ */ jsx43(
18400
+ isActiveAddOn && /* @__PURE__ */ jsx44(
18209
18401
  Flex,
18210
18402
  {
18211
18403
  $position: "absolute",
@@ -18214,7 +18406,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18214
18406
  $backgroundColor: settings.theme.primary,
18215
18407
  $borderRadius: "9999px",
18216
18408
  $padding: "0.125rem 0.85rem",
18217
- children: /* @__PURE__ */ jsx43(
18409
+ children: /* @__PURE__ */ jsx44(
18218
18410
  Text,
18219
18411
  {
18220
18412
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -18233,7 +18425,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18233
18425
  $gap: `${cardPadding}rem`,
18234
18426
  $flexGrow: 1,
18235
18427
  children: [
18236
- layout.addOns.showEntitlements && /* @__PURE__ */ jsx43(
18428
+ layout.addOns.showEntitlements && /* @__PURE__ */ jsx44(
18237
18429
  Flex,
18238
18430
  {
18239
18431
  $flexDirection: "column",
@@ -18242,7 +18434,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18242
18434
  $flexGrow: 1,
18243
18435
  children: addOn.entitlements.map((entitlement, entitlementIndex) => {
18244
18436
  const metricPeriodName = getMetricPeriodName(entitlement);
18245
- return /* @__PURE__ */ jsx43(
18437
+ return /* @__PURE__ */ jsx44(
18246
18438
  Flex,
18247
18439
  {
18248
18440
  $flexWrap: "wrap",
@@ -18250,7 +18442,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18250
18442
  $alignItems: "center",
18251
18443
  $gap: "1rem",
18252
18444
  children: /* @__PURE__ */ jsxs35(Flex, { $gap: "1rem", children: [
18253
- layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx43(
18445
+ layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx44(
18254
18446
  Icon3,
18255
18447
  {
18256
18448
  name: entitlement.feature.icon,
@@ -18260,7 +18452,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18260
18452
  }
18261
18453
  ),
18262
18454
  /* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
18263
- entitlement.feature?.name && /* @__PURE__ */ jsx43(Flex, { $alignItems: "center", $flexGrow: 1, children: /* @__PURE__ */ jsx43(Text, { children: entitlement.valueType === "numeric" /* Numeric */ || entitlement.valueType === "unlimited" /* Unlimited */ || entitlement.valueType === "trait" /* Trait */ ? /* @__PURE__ */ jsxs35(Fragment21, { children: [
18455
+ entitlement.feature?.name && /* @__PURE__ */ jsx44(Flex, { $alignItems: "center", $flexGrow: 1, children: /* @__PURE__ */ jsx44(Text, { children: entitlement.valueType === "numeric" /* Numeric */ || entitlement.valueType === "unlimited" /* Unlimited */ || entitlement.valueType === "trait" /* Trait */ ? /* @__PURE__ */ jsxs35(Fragment21, { children: [
18264
18456
  entitlement.valueType === "unlimited" /* Unlimited */ ? t2("Unlimited", {
18265
18457
  item: getFeatureName(entitlement.feature)
18266
18458
  }) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ jsxs35(Fragment21, { children: [
@@ -18278,7 +18470,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18278
18470
  t2(metricPeriodName)
18279
18471
  ] })
18280
18472
  ] }) : entitlement.feature.name }) }),
18281
- layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx43(
18473
+ layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx44(
18282
18474
  Text,
18283
18475
  {
18284
18476
  $size: 0.875 * settings.theme.typography.text.fontSize,
@@ -18294,7 +18486,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18294
18486
  })
18295
18487
  }
18296
18488
  ),
18297
- showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */ jsx43(
18489
+ showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */ jsx44(
18298
18490
  Button,
18299
18491
  {
18300
18492
  type: "button",
@@ -18335,7 +18527,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
18335
18527
  import { useMemo as useMemo25 } from "react";
18336
18528
 
18337
18529
  // src/components/elements/pricing-table/Entitlement.tsx
18338
- import { Fragment as Fragment22, jsx as jsx44, jsxs as jsxs36 } from "react/jsx-runtime";
18530
+ import { Fragment as Fragment22, jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
18339
18531
  var Entitlement = ({
18340
18532
  entitlement,
18341
18533
  sharedProps,
@@ -18357,7 +18549,7 @@ var Entitlement = ({
18357
18549
  const limit = entitlement.softLimit ?? entitlement.valueNumeric;
18358
18550
  const metricPeriodName = getMetricPeriodName(entitlement);
18359
18551
  return /* @__PURE__ */ jsxs36(Flex, { $gap: "1rem", children: [
18360
- layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx44(
18552
+ layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx45(
18361
18553
  Icon3,
18362
18554
  {
18363
18555
  name: entitlement.feature.icon,
@@ -18368,7 +18560,7 @@ var Entitlement = ({
18368
18560
  ),
18369
18561
  entitlement.feature?.name && /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
18370
18562
  /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $justifyContent: "center", $flexGrow: 1, children: [
18371
- /* @__PURE__ */ jsx44(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ jsxs36(Fragment22, { children: [
18563
+ /* @__PURE__ */ jsx45(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ jsxs36(Fragment22, { children: [
18372
18564
  formatCurrency(entitlementPrice, entitlementCurrency),
18373
18565
  " ",
18374
18566
  t2("per"),
@@ -18384,7 +18576,7 @@ var Entitlement = ({
18384
18576
  " ",
18385
18577
  selectedPeriod
18386
18578
  ] })
18387
- ] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx44(
18579
+ ] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx45(
18388
18580
  TieredPricingDetails,
18389
18581
  {
18390
18582
  entitlement,
@@ -18405,49 +18597,57 @@ var Entitlement = ({
18405
18597
  t2(metricPeriodName)
18406
18598
  ] })
18407
18599
  ] }) : entitlement.feature.name }),
18408
- entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsxs36(
18409
- Text,
18410
- {
18411
- $size: 0.875 * settings.theme.typography.text.fontSize,
18412
- $color: `color-mix(in oklch, ${settings.theme.typography.text.color}, ${settings.theme.card.background})`,
18413
- children: [
18414
- t2("then"),
18415
- " ",
18416
- formatCurrency(entitlementPrice, entitlementCurrency),
18417
- "/",
18418
- entitlementPackageSize > 1 && /* @__PURE__ */ jsxs36(Fragment22, { children: [
18419
- entitlementPackageSize,
18420
- " "
18421
- ] }),
18422
- getFeatureName(entitlement.feature, entitlementPackageSize),
18423
- entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs36(Fragment22, { children: [
18424
- "/",
18425
- shortenPeriod(selectedPeriod)
18426
- ] })
18427
- ]
18428
- }
18429
- ) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs36(Flex, { $alignItems: "center", children: [
18430
- /* @__PURE__ */ jsx44(
18431
- PricingTiersTooltip,
18432
- {
18433
- feature: entitlement.feature,
18434
- period: selectedPeriod,
18435
- currency: entitlementCurrency,
18436
- priceTiers: entitlementPriceTiers
18437
- }
18438
- ),
18439
- /* @__PURE__ */ jsx44(
18600
+ /* @__PURE__ */ jsxs36(Flex, { $alignItems: "end", children: [
18601
+ entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsxs36(
18440
18602
  Text,
18441
18603
  {
18442
- style: { opacity: 0.54 },
18443
18604
  $size: 0.875 * settings.theme.typography.text.fontSize,
18444
- $color: settings.theme.typography.text.color,
18445
- children: t2("Tier-based")
18605
+ $color: `color-mix(in oklch, ${settings.theme.typography.text.color}, ${settings.theme.card.background})`,
18606
+ children: [
18607
+ t2("then"),
18608
+ " ",
18609
+ formatCurrency(entitlementPrice, entitlementCurrency),
18610
+ "/",
18611
+ entitlementPackageSize > 1 && /* @__PURE__ */ jsxs36(Fragment22, { children: [
18612
+ entitlementPackageSize,
18613
+ " "
18614
+ ] }),
18615
+ getFeatureName(entitlement.feature, entitlementPackageSize),
18616
+ entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs36(Fragment22, { children: [
18617
+ "/",
18618
+ shortenPeriod(selectedPeriod)
18619
+ ] })
18620
+ ]
18621
+ }
18622
+ ) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs36(Flex, { $alignItems: "end", children: [
18623
+ /* @__PURE__ */ jsx45(
18624
+ Text,
18625
+ {
18626
+ style: { opacity: 0.54 },
18627
+ $size: 0.875 * settings.theme.typography.text.fontSize,
18628
+ $color: settings.theme.typography.text.color,
18629
+ children: t2("Tier-based")
18630
+ }
18631
+ ),
18632
+ /* @__PURE__ */ jsx45(
18633
+ PricingTiersTooltip,
18634
+ {
18635
+ feature: entitlement.feature,
18636
+ period: selectedPeriod,
18637
+ currency: entitlementCurrency,
18638
+ priceTiers: entitlementPriceTiers
18639
+ }
18640
+ )
18641
+ ] }),
18642
+ entitlement.billingThreshold && /* @__PURE__ */ jsx45(
18643
+ BillingThresholdTooltip,
18644
+ {
18645
+ billingThreshold: entitlement.billingThreshold
18446
18646
  }
18447
18647
  )
18448
18648
  ] })
18449
18649
  ] }),
18450
- layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx44(
18650
+ layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx45(
18451
18651
  Text,
18452
18652
  {
18453
18653
  $size: 0.875 * settings.theme.typography.text.fontSize,
@@ -18460,7 +18660,7 @@ var Entitlement = ({
18460
18660
  };
18461
18661
 
18462
18662
  // src/components/elements/pricing-table/Plan.tsx
18463
- import { Fragment as Fragment23, jsx as jsx45, jsxs as jsxs37 } from "react/jsx-runtime";
18663
+ import { Fragment as Fragment23, jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
18464
18664
  var Plan2 = ({
18465
18665
  plan,
18466
18666
  index,
@@ -18481,7 +18681,8 @@ var Plan2 = ({
18481
18681
  isTrialSubscription,
18482
18682
  willSubscriptionCancel,
18483
18683
  isStandalone,
18484
- showCallToAction
18684
+ showCallToAction,
18685
+ showZeroPriceAsFree
18485
18686
  } = useMemo25(() => {
18486
18687
  if (isCheckoutData(data)) {
18487
18688
  const billingSubscription = data.company?.billingSubscription;
@@ -18493,7 +18694,8 @@ var Plan2 = ({
18493
18694
  isTrialSubscription: isTrialSubscription2,
18494
18695
  willSubscriptionCancel: willSubscriptionCancel2,
18495
18696
  isStandalone: false,
18496
- showCallToAction: true
18697
+ showCallToAction: true,
18698
+ showZeroPriceAsFree: data.showZeroPriceAsFree
18497
18699
  };
18498
18700
  }
18499
18701
  return {
@@ -18502,7 +18704,8 @@ var Plan2 = ({
18502
18704
  isTrialSubscription: false,
18503
18705
  willSubscriptionCancel: false,
18504
18706
  isStandalone: true,
18505
- showCallToAction: typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function"
18707
+ showCallToAction: typeof sharedProps.callToActionUrl === "string" || typeof sharedProps.onCallToAction === "function",
18708
+ showZeroPriceAsFree: false
18506
18709
  };
18507
18710
  }, [data, sharedProps.callToActionUrl, sharedProps.onCallToAction]);
18508
18711
  const callToActionTarget = useMemo25(() => {
@@ -18530,8 +18733,9 @@ var Plan2 = ({
18530
18733
  const hasUsageBasedEntitlements = plan.entitlements.some(
18531
18734
  (entitlement) => !!entitlement.priceBehavior
18532
18735
  );
18533
- const isUsageBasedPlan = planPrice === 0 && hasUsageBasedEntitlements;
18534
- const headerPriceFontStyle = plan.custom || isUsageBasedPlan ? settings.theme.typography.heading3 : settings.theme.typography[layout.plans.name.fontStyle];
18736
+ const isFreePlan = planPrice === 0;
18737
+ const isUsageBasedPlan = isFreePlan && hasUsageBasedEntitlements;
18738
+ const headerPriceFontStyle = settings.theme.typography[layout.plans.name.fontStyle];
18535
18739
  const count = entitlementCounts[plan.id];
18536
18740
  const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
18537
18741
  return /* @__PURE__ */ jsxs37(
@@ -18562,9 +18766,9 @@ var Plan2 = ({
18562
18766
  $borderStyle: "solid",
18563
18767
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
18564
18768
  children: [
18565
- /* @__PURE__ */ jsx45(Box, { children: /* @__PURE__ */ jsx45(Text, { display: layout.plans.name.fontStyle, children: plan.name }) }),
18566
- layout.plans.description.isVisible && /* @__PURE__ */ jsx45(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx45(Text, { display: layout.plans.description.fontStyle, children: plan.description }) }),
18567
- /* @__PURE__ */ jsx45(Box, { children: /* @__PURE__ */ jsxs37(
18769
+ /* @__PURE__ */ jsx46(Box, { children: /* @__PURE__ */ jsx46(Text, { display: layout.plans.name.fontStyle, children: plan.name }) }),
18770
+ layout.plans.description.isVisible && /* @__PURE__ */ jsx46(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx46(Text, { display: layout.plans.description.fontStyle, children: plan.description }) }),
18771
+ /* @__PURE__ */ jsx46(Box, { children: /* @__PURE__ */ jsxs37(
18568
18772
  Text,
18569
18773
  {
18570
18774
  $font: headerPriceFontStyle.fontFamily,
@@ -18572,15 +18776,15 @@ var Plan2 = ({
18572
18776
  $weight: headerPriceFontStyle.fontWeight,
18573
18777
  $color: headerPriceFontStyle.color,
18574
18778
  children: [
18575
- plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency),
18576
- !plan.custom && !isUsageBasedPlan && /* @__PURE__ */ jsxs37("sub", { children: [
18779
+ plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : isFreePlan && showZeroPriceAsFree ? t2("Free") : formatCurrency(planPrice ?? 0, planCurrency),
18780
+ !plan.custom && !isFreePlan && /* @__PURE__ */ jsxs37("sub", { children: [
18577
18781
  "/",
18578
18782
  selectedPeriod
18579
18783
  ] })
18580
18784
  ]
18581
18785
  }
18582
18786
  ) }),
18583
- credits.length > 0 && /* @__PURE__ */ jsx45(
18787
+ credits.length > 0 && /* @__PURE__ */ jsx46(
18584
18788
  Flex,
18585
18789
  {
18586
18790
  $flexDirection: "column",
@@ -18589,7 +18793,7 @@ var Plan2 = ({
18589
18793
  $marginTop: "0.5rem",
18590
18794
  children: credits.map((credit, idx) => {
18591
18795
  return /* @__PURE__ */ jsxs37(Flex, { $gap: "1rem", children: [
18592
- layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ jsx45(
18796
+ layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ jsx46(
18593
18797
  Icon3,
18594
18798
  {
18595
18799
  name: credit.icon,
@@ -18598,7 +18802,7 @@ var Plan2 = ({
18598
18802
  rounded: true
18599
18803
  }
18600
18804
  ),
18601
- credit.name && /* @__PURE__ */ jsx45(
18805
+ credit.name && /* @__PURE__ */ jsx46(
18602
18806
  Flex,
18603
18807
  {
18604
18808
  $flexDirection: "column",
@@ -18621,7 +18825,7 @@ var Plan2 = ({
18621
18825
  })
18622
18826
  }
18623
18827
  ),
18624
- isActivePlan && /* @__PURE__ */ jsx45(
18828
+ isActivePlan && /* @__PURE__ */ jsx46(
18625
18829
  Flex,
18626
18830
  {
18627
18831
  $position: "absolute",
@@ -18630,7 +18834,7 @@ var Plan2 = ({
18630
18834
  $backgroundColor: settings.theme.primary,
18631
18835
  $borderRadius: "9999px",
18632
18836
  $padding: "0.125rem 0.85rem",
18633
- children: /* @__PURE__ */ jsx45(
18837
+ children: /* @__PURE__ */ jsx46(
18634
18838
  Text,
18635
18839
  {
18636
18840
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -18653,10 +18857,10 @@ var Plan2 = ({
18653
18857
  $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
18654
18858
  children: [
18655
18859
  layout.plans.showEntitlements && /* @__PURE__ */ jsxs37(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: [
18656
- layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ jsx45(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx45(Text, { children: t2("Everything in", {
18860
+ layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ jsx46(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx46(Text, { children: t2("Everything in", {
18657
18861
  plan: plans[index - 1].name
18658
18862
  }) }) }),
18659
- plan.entitlements.map((entitlement, idx) => /* @__PURE__ */ jsx45(
18863
+ plan.entitlements.map((entitlement, idx) => /* @__PURE__ */ jsx46(
18660
18864
  Entitlement,
18661
18865
  {
18662
18866
  entitlement,
@@ -18673,14 +18877,14 @@ var Plan2 = ({
18673
18877
  $gap: "0.5rem",
18674
18878
  $marginTop: "1rem",
18675
18879
  children: [
18676
- /* @__PURE__ */ jsx45(
18880
+ /* @__PURE__ */ jsx46(
18677
18881
  Icon3,
18678
18882
  {
18679
18883
  name: isExpanded ? "chevron-up" : "chevron-down",
18680
18884
  color: "#D0D0D0"
18681
18885
  }
18682
18886
  ),
18683
- /* @__PURE__ */ jsx45(
18887
+ /* @__PURE__ */ jsx46(
18684
18888
  Text,
18685
18889
  {
18686
18890
  onClick: () => handleToggleShowAll(plan.id),
@@ -18708,7 +18912,7 @@ var Plan2 = ({
18708
18912
  $gap: "0.25rem",
18709
18913
  $padding: "0.625rem 0",
18710
18914
  children: [
18711
- /* @__PURE__ */ jsx45(
18915
+ /* @__PURE__ */ jsx46(
18712
18916
  Icon3,
18713
18917
  {
18714
18918
  name: "check-rounded",
@@ -18716,10 +18920,10 @@ var Plan2 = ({
18716
18920
  color: settings.theme.primary
18717
18921
  }
18718
18922
  ),
18719
- /* @__PURE__ */ jsx45(Text, { $size: 15, $leading: 1, children: t2("Current plan") })
18923
+ /* @__PURE__ */ jsx46(Text, { $size: 15, $leading: 1, children: t2("Current plan") })
18720
18924
  ]
18721
18925
  }
18722
- ) : showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsx45(
18926
+ ) : showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsx46(
18723
18927
  Button,
18724
18928
  {
18725
18929
  type: "button",
@@ -18756,11 +18960,11 @@ var Plan2 = ({
18756
18960
  }
18757
18961
  },
18758
18962
  $fullWidth: true,
18759
- children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : isHydratedPlan(plan) && !plan.valid ? /* @__PURE__ */ jsx45(
18963
+ children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : isHydratedPlan(plan) && !plan.valid ? /* @__PURE__ */ jsx46(
18760
18964
  Tooltip,
18761
18965
  {
18762
- trigger: /* @__PURE__ */ jsx45(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
18763
- content: /* @__PURE__ */ jsx45(Text, { children: t2("Current usage exceeds the limit of this plan.") })
18966
+ trigger: /* @__PURE__ */ jsx46(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
18967
+ content: /* @__PURE__ */ jsx46(Text, { children: t2("Current usage exceeds the limit of this plan.") })
18764
18968
  }
18765
18969
  ) : isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable ? t2("Start X day trial", { days: plan.trialDays }) : t2("Choose plan")
18766
18970
  }
@@ -18774,7 +18978,7 @@ var Plan2 = ({
18774
18978
  };
18775
18979
 
18776
18980
  // src/components/elements/pricing-table/PricingTable.tsx
18777
- import { Fragment as Fragment25, jsx as jsx46, jsxs as jsxs38 } from "react/jsx-runtime";
18981
+ import { Fragment as Fragment25, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
18778
18982
  var resolveDesignProps8 = (props) => {
18779
18983
  return {
18780
18984
  showPeriodToggle: props.showPeriodToggle ?? true,
@@ -18878,7 +19082,7 @@ var PricingTable = forwardRef12(
18878
19082
  setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
18879
19083
  }, [plans]);
18880
19084
  if (isPending) {
18881
- return /* @__PURE__ */ jsx46(
19085
+ return /* @__PURE__ */ jsx47(
18882
19086
  Flex,
18883
19087
  {
18884
19088
  $width: "100%",
@@ -18886,12 +19090,12 @@ var PricingTable = forwardRef12(
18886
19090
  $alignItems: "center",
18887
19091
  $justifyContent: "center",
18888
19092
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
18889
- children: /* @__PURE__ */ jsx46(Loader, { $size: "2xl" })
19093
+ children: /* @__PURE__ */ jsx47(Loader, { $size: "2xl" })
18890
19094
  }
18891
19095
  );
18892
19096
  }
18893
19097
  const Wrapper = isStandalone ? Container : Fragment24;
18894
- return /* @__PURE__ */ jsx46(Wrapper, { children: /* @__PURE__ */ jsxs38(
19098
+ return /* @__PURE__ */ jsx47(Wrapper, { children: /* @__PURE__ */ jsxs38(
18895
19099
  FussyChild,
18896
19100
  {
18897
19101
  ref,
@@ -18916,7 +19120,7 @@ var PricingTable = forwardRef12(
18916
19120
  }
18917
19121
  },
18918
19122
  children: [
18919
- /* @__PURE__ */ jsx46(
19123
+ /* @__PURE__ */ jsx47(
18920
19124
  Text,
18921
19125
  {
18922
19126
  display: props.header.fontStyle,
@@ -18924,7 +19128,7 @@ var PricingTable = forwardRef12(
18924
19128
  children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t2("Plans")
18925
19129
  }
18926
19130
  ),
18927
- showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx46(
19131
+ showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx47(
18928
19132
  PeriodToggle,
18929
19133
  {
18930
19134
  options: periods,
@@ -18939,7 +19143,7 @@ var PricingTable = forwardRef12(
18939
19143
  ]
18940
19144
  }
18941
19145
  ),
18942
- props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ jsx46(
19146
+ props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ jsx47(
18943
19147
  Box,
18944
19148
  {
18945
19149
  $display: "grid",
@@ -18947,7 +19151,7 @@ var PricingTable = forwardRef12(
18947
19151
  $gap: "1rem",
18948
19152
  children: plans.map((plan, index, self2) => {
18949
19153
  const planPeriod = showPeriodToggle ? selectedPeriod : plan.yearlyPrice && !plan.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
18950
- return /* @__PURE__ */ jsx46(
19154
+ return /* @__PURE__ */ jsx47(
18951
19155
  Plan2,
18952
19156
  {
18953
19157
  plan,
@@ -18969,14 +19173,14 @@ var PricingTable = forwardRef12(
18969
19173
  }
18970
19174
  )
18971
19175
  ] }),
18972
- /* @__PURE__ */ jsx46(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs38(Fragment25, { children: [
18973
- props.header.isVisible && /* @__PURE__ */ jsx46(
19176
+ /* @__PURE__ */ jsx47(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs38(Fragment25, { children: [
19177
+ props.header.isVisible && /* @__PURE__ */ jsx47(
18974
19178
  Flex,
18975
19179
  {
18976
19180
  $justifyContent: "space-between",
18977
19181
  $alignItems: "center",
18978
19182
  $marginBottom: "1rem",
18979
- children: /* @__PURE__ */ jsx46(
19183
+ children: /* @__PURE__ */ jsx47(
18980
19184
  Text,
18981
19185
  {
18982
19186
  display: props.header.fontStyle,
@@ -18986,7 +19190,7 @@ var PricingTable = forwardRef12(
18986
19190
  )
18987
19191
  }
18988
19192
  ),
18989
- /* @__PURE__ */ jsx46(
19193
+ /* @__PURE__ */ jsx47(
18990
19194
  Box,
18991
19195
  {
18992
19196
  $display: "grid",
@@ -18994,7 +19198,7 @@ var PricingTable = forwardRef12(
18994
19198
  $gap: "1rem",
18995
19199
  children: addOns.map((addOn, index) => {
18996
19200
  const addOnPeriod = showPeriodToggle ? selectedPeriod : addOn.yearlyPrice && !addOn.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
18997
- return /* @__PURE__ */ jsx46(
19201
+ return /* @__PURE__ */ jsx47(
18998
19202
  AddOn2,
18999
19203
  {
19000
19204
  addOn,
@@ -19021,7 +19225,7 @@ PricingTable.displayName = "PricingTable";
19021
19225
 
19022
19226
  // src/components/elements/text/Text.tsx
19023
19227
  import { forwardRef as forwardRef13 } from "react";
19024
- import { jsx as jsx47 } from "react/jsx-runtime";
19228
+ import { jsx as jsx48 } from "react/jsx-runtime";
19025
19229
  var resolveDesignProps9 = (props) => {
19026
19230
  return {
19027
19231
  text: {
@@ -19033,7 +19237,7 @@ var resolveDesignProps9 = (props) => {
19033
19237
  };
19034
19238
  var TextElement = forwardRef13(({ children, className, ...rest }, ref) => {
19035
19239
  const props = resolveDesignProps9(rest);
19036
- return /* @__PURE__ */ jsx47(Element, { as: Flex, ref, className, children: /* @__PURE__ */ jsx47(
19240
+ return /* @__PURE__ */ jsx48(Element, { as: Flex, ref, className, children: /* @__PURE__ */ jsx48(
19037
19241
  Text,
19038
19242
  {
19039
19243
  display: props.text.fontStyle,
@@ -19047,7 +19251,7 @@ TextElement.displayName = "Text";
19047
19251
 
19048
19252
  // src/components/elements/unsubscribe-button/UnsubscribeButton.tsx
19049
19253
  import { forwardRef as forwardRef14, useMemo as useMemo27 } from "react";
19050
- import { jsx as jsx48 } from "react/jsx-runtime";
19254
+ import { jsx as jsx49 } from "react/jsx-runtime";
19051
19255
  var buttonStyles = {
19052
19256
  primary: {
19053
19257
  color: "primary",
@@ -19083,7 +19287,7 @@ var UnsubscribeButton = forwardRef14(({ children, className, ...rest }, ref) =>
19083
19287
  if (!hasActiveSubscription) {
19084
19288
  return null;
19085
19289
  }
19086
- return /* @__PURE__ */ jsx48(
19290
+ return /* @__PURE__ */ jsx49(
19087
19291
  Element,
19088
19292
  {
19089
19293
  as: Flex,
@@ -19091,7 +19295,7 @@ var UnsubscribeButton = forwardRef14(({ children, className, ...rest }, ref) =>
19091
19295
  className,
19092
19296
  $flexDirection: "column",
19093
19297
  $gap: "2rem",
19094
- children: /* @__PURE__ */ jsx48(
19298
+ children: /* @__PURE__ */ jsx49(
19095
19299
  Button,
19096
19300
  {
19097
19301
  type: "button",
@@ -19113,7 +19317,7 @@ UnsubscribeButton.displayName = "UnsubscribeButton";
19113
19317
 
19114
19318
  // src/components/elements/upcoming-bill/UpcomingBill.tsx
19115
19319
  import { forwardRef as forwardRef15, useCallback as useCallback13, useEffect as useEffect9, useMemo as useMemo28, useState as useState18 } from "react";
19116
- import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
19320
+ import { jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
19117
19321
  function resolveDesignProps11(props) {
19118
19322
  return {
19119
19323
  header: {
@@ -19189,7 +19393,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19189
19393
  return null;
19190
19394
  }
19191
19395
  return /* @__PURE__ */ jsxs39(Element, { ref, className, children: [
19192
- /* @__PURE__ */ jsx49(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx49(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
19396
+ /* @__PURE__ */ jsx50(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx50(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
19193
19397
  error ? /* @__PURE__ */ jsxs39(
19194
19398
  Flex,
19195
19399
  {
@@ -19199,8 +19403,8 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19199
19403
  $alignItems: "center",
19200
19404
  $gap: "1rem",
19201
19405
  children: [
19202
- /* @__PURE__ */ jsx49(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your upcoming invoice.") }),
19203
- /* @__PURE__ */ jsx49(
19406
+ /* @__PURE__ */ jsx50(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your upcoming invoice.") }),
19407
+ /* @__PURE__ */ jsx50(
19204
19408
  Button,
19205
19409
  {
19206
19410
  type: "button",
@@ -19213,7 +19417,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19213
19417
  )
19214
19418
  ]
19215
19419
  }
19216
- ) : !isLoading && /* @__PURE__ */ jsx49(TransitionBox, { children: upcomingInvoice ? /* @__PURE__ */ jsxs39(Flex, { $flexDirection: "column", $gap: "1rem", children: [
19420
+ ) : !isLoading && /* @__PURE__ */ jsx50(TransitionBox, { children: upcomingInvoice ? /* @__PURE__ */ jsxs39(Flex, { $flexDirection: "column", $gap: "1rem", children: [
19217
19421
  props.header.isVisible && upcomingInvoice.dueDate && /* @__PURE__ */ jsxs39(Text, { display: props.header.fontStyle, children: [
19218
19422
  props.header.prefix,
19219
19423
  " ",
@@ -19226,11 +19430,11 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19226
19430
  $alignItems: "start",
19227
19431
  $gap: "1rem",
19228
19432
  children: [
19229
- props.price.isVisible && /* @__PURE__ */ jsx49(Text, { display: props.price.fontStyle, $leading: 1, children: formatCurrency(
19433
+ props.price.isVisible && /* @__PURE__ */ jsx50(Text, { display: props.price.fontStyle, $leading: 1, children: formatCurrency(
19230
19434
  upcomingInvoice.amountDue,
19231
19435
  upcomingInvoice.currency
19232
19436
  ) }),
19233
- /* @__PURE__ */ jsx49(Box, { $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ jsx49(Text, { display: props.contractEndDate.fontStyle, children: t2("Estimated bill") }) })
19437
+ /* @__PURE__ */ jsx50(Box, { $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ jsx50(Text, { display: props.contractEndDate.fontStyle, children: t2("Estimated bill") }) })
19234
19438
  ]
19235
19439
  }
19236
19440
  ),
@@ -19242,8 +19446,8 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19242
19446
  $alignItems: "start",
19243
19447
  $gap: "1rem",
19244
19448
  children: [
19245
- /* @__PURE__ */ jsx49(Text, { $weight: 600, children: t2("Remaining balance") }),
19246
- /* @__PURE__ */ jsx49(Flex, { $flexDirection: "column", $gap: "0.5rem", children: balances.map((item, idx) => /* @__PURE__ */ jsx49(Text, { children: formatCurrency(item.balance, item.currency) }, idx)) })
19449
+ /* @__PURE__ */ jsx50(Text, { $weight: 600, children: t2("Remaining balance") }),
19450
+ /* @__PURE__ */ jsx50(Flex, { $flexDirection: "column", $gap: "0.5rem", children: balances.map((item, idx) => /* @__PURE__ */ jsx50(Text, { children: formatCurrency(item.balance, item.currency) }, idx)) })
19247
19451
  ]
19248
19452
  }
19249
19453
  ),
@@ -19254,8 +19458,8 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19254
19458
  $alignItems: "start",
19255
19459
  $gap: "1rem",
19256
19460
  children: [
19257
- /* @__PURE__ */ jsx49(Text, { $weight: 600, children: t2("Discount") }),
19258
- /* @__PURE__ */ jsx49(
19461
+ /* @__PURE__ */ jsx50(Text, { $weight: 600, children: t2("Discount") }),
19462
+ /* @__PURE__ */ jsx50(
19259
19463
  Flex,
19260
19464
  {
19261
19465
  $flexDirection: "column",
@@ -19271,7 +19475,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19271
19475
  $alignItems: "center",
19272
19476
  $gap: "0.5rem",
19273
19477
  children: [
19274
- discount.customerFacingCode && /* @__PURE__ */ jsx49(
19478
+ discount.customerFacingCode && /* @__PURE__ */ jsx50(
19275
19479
  Flex,
19276
19480
  {
19277
19481
  $alignItems: "center",
@@ -19280,7 +19484,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19280
19484
  $borderStyle: "solid",
19281
19485
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
19282
19486
  $borderRadius: "0.3125rem",
19283
- children: /* @__PURE__ */ jsx49(
19487
+ children: /* @__PURE__ */ jsx50(
19284
19488
  Text,
19285
19489
  {
19286
19490
  $size: 0.75 * settings.theme.typography.text.fontSize,
@@ -19290,7 +19494,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19290
19494
  )
19291
19495
  }
19292
19496
  ),
19293
- /* @__PURE__ */ jsx49(Box, { children: /* @__PURE__ */ jsx49(Text, { children: typeof discount.percentOff === "number" ? t2("Percent off", {
19497
+ /* @__PURE__ */ jsx50(Box, { children: /* @__PURE__ */ jsx50(Text, { children: typeof discount.percentOff === "number" ? t2("Percent off", {
19294
19498
  percent: discount.percentOff
19295
19499
  }) : t2("Amount off", {
19296
19500
  amount: formatCurrency(
@@ -19314,7 +19518,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
19314
19518
  ]
19315
19519
  }
19316
19520
  )
19317
- ] }) : /* @__PURE__ */ jsx49(Text, { display: "heading2", children: t2("No upcoming invoice") }) })
19521
+ ] }) : /* @__PURE__ */ jsx50(Text, { display: "heading2", children: t2("No upcoming invoice") }) })
19318
19522
  ] });
19319
19523
  });
19320
19524
  UpcomingBill.displayName = "UpcomingBill";
@@ -23574,10 +23778,10 @@ function createRenderer(options) {
23574
23778
  }
23575
23779
 
23576
23780
  // src/components/embed/Embed.tsx
23577
- import { Fragment as Fragment26, jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
23781
+ import { Fragment as Fragment26, jsx as jsx51, jsxs as jsxs40 } from "react/jsx-runtime";
23578
23782
  var Loading = () => {
23579
23783
  const { settings } = useEmbed();
23580
- return /* @__PURE__ */ jsx50(
23784
+ return /* @__PURE__ */ jsx51(
23581
23785
  Flex,
23582
23786
  {
23583
23787
  $width: "100%",
@@ -23585,7 +23789,7 @@ var Loading = () => {
23585
23789
  $alignItems: "center",
23586
23790
  $justifyContent: "center",
23587
23791
  $padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
23588
- children: /* @__PURE__ */ jsx50(Loader, { $color: "#194BFB", $size: "2xl" })
23792
+ children: /* @__PURE__ */ jsx51(Loader, { $color: "#194BFB", $size: "2xl" })
23589
23793
  }
23590
23794
  );
23591
23795
  };
@@ -23602,14 +23806,14 @@ var Error2 = ({ message }) => {
23602
23806
  $alignItems: "center",
23603
23807
  $justifyContent: "center",
23604
23808
  children: [
23605
- /* @__PURE__ */ jsx50(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx50(Text, { display: "heading1", children: "Error" }) }),
23606
- /* @__PURE__ */ jsx50(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx50(Text, { children: message }) })
23809
+ /* @__PURE__ */ jsx51(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx51(Text, { display: "heading1", children: "Error" }) }),
23810
+ /* @__PURE__ */ jsx51(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx51(Text, { children: message }) })
23607
23811
  ]
23608
23812
  }
23609
23813
  );
23610
23814
  };
23611
23815
  var SchematicEmbed = ({ id, accessToken }) => {
23612
- const [children, setChildren] = useState19(/* @__PURE__ */ jsx50(Loading, {}));
23816
+ const [children, setChildren] = useState19(/* @__PURE__ */ jsx51(Loading, {}));
23613
23817
  const theme = useContext5(et);
23614
23818
  const {
23615
23819
  data,
@@ -23656,13 +23860,13 @@ var SchematicEmbed = ({ id, accessToken }) => {
23656
23860
  return stub();
23657
23861
  }
23658
23862
  if (error) {
23659
- return /* @__PURE__ */ jsx50(Error2, { message: error.message });
23863
+ return /* @__PURE__ */ jsx51(Error2, { message: error.message });
23660
23864
  }
23661
23865
  if (accessToken?.length === 0) {
23662
- return /* @__PURE__ */ jsx50(Error2, { message: "Please provide an access token." });
23866
+ return /* @__PURE__ */ jsx51(Error2, { message: "Please provide an access token." });
23663
23867
  }
23664
23868
  if (!accessToken?.startsWith("token_")) {
23665
- return /* @__PURE__ */ jsx50(
23869
+ return /* @__PURE__ */ jsx51(
23666
23870
  Error2,
23667
23871
  {
23668
23872
  message: 'Invalid access token; your temporary access token will start with "token_".'
@@ -23670,9 +23874,9 @@ var SchematicEmbed = ({ id, accessToken }) => {
23670
23874
  );
23671
23875
  }
23672
23876
  if (isPending) {
23673
- return /* @__PURE__ */ jsx50(Loading, {});
23877
+ return /* @__PURE__ */ jsx51(Loading, {});
23674
23878
  }
23675
- return /* @__PURE__ */ jsx50(Fragment26, { children });
23879
+ return /* @__PURE__ */ jsx51(Fragment26, { children });
23676
23880
  };
23677
23881
  export {
23678
23882
  Box,