@schematichq/schematic-components 1.4.2 → 1.5.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.
- package/dist/schematic-components.cjs.js +1191 -873
- package/dist/schematic-components.d.ts +186 -1
- package/dist/schematic-components.esm.js +959 -640
- package/package.json +14 -14
|
@@ -1852,7 +1852,7 @@ var HOURS_IN_MS = MINUTES_IN_MS * 60;
|
|
|
1852
1852
|
var DAYS_IN_MS = HOURS_IN_MS * 24;
|
|
1853
1853
|
|
|
1854
1854
|
// src/const/debounce.ts
|
|
1855
|
-
var
|
|
1855
|
+
var DEBOUNCE_SETTINGS = {
|
|
1856
1856
|
leading: true,
|
|
1857
1857
|
trailing: false
|
|
1858
1858
|
};
|
|
@@ -4207,6 +4207,7 @@ var initialContext = {
|
|
|
4207
4207
|
hydrateComponent: stub,
|
|
4208
4208
|
hydrateExternal: stub,
|
|
4209
4209
|
getUpcomingInvoice: stub,
|
|
4210
|
+
getCustomerBalance: stub,
|
|
4210
4211
|
listInvoices: stub,
|
|
4211
4212
|
createSetupIntent: stub,
|
|
4212
4213
|
updatePaymentMethod: stub,
|
|
@@ -4219,7 +4220,8 @@ var initialContext = {
|
|
|
4219
4220
|
setLayout: stub,
|
|
4220
4221
|
setCheckoutState: stub,
|
|
4221
4222
|
setData: stub,
|
|
4222
|
-
updateSettings: stub
|
|
4223
|
+
updateSettings: stub,
|
|
4224
|
+
debug: stub
|
|
4223
4225
|
};
|
|
4224
4226
|
var EmbedContext = createContext(initialContext);
|
|
4225
4227
|
|
|
@@ -6701,6 +6703,7 @@ var en_default = {
|
|
|
6701
6703
|
"After the trial, cancel": "After the trial, you will be downgraded to the {{defaultPlanName}} plan and your subscription will be cancelled.",
|
|
6702
6704
|
"After the trial, subscribe": "After the trial, subscription starts and you will be billed.",
|
|
6703
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.",
|
|
6704
6707
|
"An unknown error occurred.": "An unknown error occurred.",
|
|
6705
6708
|
Billed: "Billed {{period}}",
|
|
6706
6709
|
"Cancel subscription": "Cancel subscription",
|
|
@@ -6713,8 +6716,10 @@ var en_default = {
|
|
|
6713
6716
|
"Choose add-on": "Choose add-on",
|
|
6714
6717
|
"Choose plan": "Choose plan",
|
|
6715
6718
|
"Choose your base plan": "Choose your base plan",
|
|
6716
|
-
"
|
|
6719
|
+
"Credit bundles": "Credit bundles",
|
|
6717
6720
|
Credits: "Credits",
|
|
6721
|
+
"Credits in plan": "Credits in plan",
|
|
6722
|
+
"Credits to be applied to future invoices": "Credits to be applied to future invoices",
|
|
6718
6723
|
"Current plan": "Current plan",
|
|
6719
6724
|
"Current usage exceeds the limit of this plan.": "Current usage exceeds the limit of this plan.",
|
|
6720
6725
|
"Currently using": "Currently using {{quantity}} {{unit}}",
|
|
@@ -6765,8 +6770,10 @@ var en_default = {
|
|
|
6765
6770
|
"Please provide an access token.": "Please provide an access token.",
|
|
6766
6771
|
"Powered by": "Powered by",
|
|
6767
6772
|
"Price by unit based on final tier reached.": "Price by unit based on final tier reached.",
|
|
6773
|
+
"Promotional credits": "Promotional credits",
|
|
6768
6774
|
Proration: "Proration",
|
|
6769
6775
|
"Quantity to pay for in advance": "Quantity to pay for in advance",
|
|
6776
|
+
"Remaining balance": "Remaining balance",
|
|
6770
6777
|
"Remove add-on": "Remove add-on",
|
|
6771
6778
|
Resets: "Resets {{date}}",
|
|
6772
6779
|
"Save payment method": "Save payment method",
|
|
@@ -8633,6 +8640,22 @@ function ComponentResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8633
8640
|
};
|
|
8634
8641
|
}
|
|
8635
8642
|
|
|
8643
|
+
// src/api/checkoutexternal/models/CreditGrantDetail.ts
|
|
8644
|
+
function CreditGrantDetailFromJSON(json) {
|
|
8645
|
+
return CreditGrantDetailFromJSONTyped(json, false);
|
|
8646
|
+
}
|
|
8647
|
+
function CreditGrantDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
8648
|
+
if (json == null) {
|
|
8649
|
+
return json;
|
|
8650
|
+
}
|
|
8651
|
+
return {
|
|
8652
|
+
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8653
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
8654
|
+
grantReason: json["grant_reason"],
|
|
8655
|
+
quantity: json["quantity"]
|
|
8656
|
+
};
|
|
8657
|
+
}
|
|
8658
|
+
|
|
8636
8659
|
// src/api/checkoutexternal/models/FeatureUsageResponseData.ts
|
|
8637
8660
|
function FeatureUsageResponseDataFromJSON(json) {
|
|
8638
8661
|
return FeatureUsageResponseDataFromJSONTyped(json, false);
|
|
@@ -8646,8 +8669,18 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8646
8669
|
allocation: json["allocation"] == null ? void 0 : json["allocation"],
|
|
8647
8670
|
allocationType: json["allocation_type"],
|
|
8648
8671
|
companyOverride: json["company_override"] == null ? void 0 : CompanyOverrideResponseDataFromJSON(json["company_override"]),
|
|
8672
|
+
creditGrantCounts: json["credit_grant_counts"] == null ? void 0 : json["credit_grant_counts"],
|
|
8673
|
+
creditGrantDetails: json["credit_grant_details"] == null ? void 0 : json["credit_grant_details"].map(
|
|
8674
|
+
CreditGrantDetailFromJSON
|
|
8675
|
+
),
|
|
8676
|
+
creditGrantReason: json["credit_grant_reason"] == null ? void 0 : json["credit_grant_reason"],
|
|
8677
|
+
creditRemaining: json["credit_remaining"] == null ? void 0 : json["credit_remaining"],
|
|
8678
|
+
creditTotal: json["credit_total"] == null ? void 0 : json["credit_total"],
|
|
8679
|
+
creditTypeIcon: json["credit_type_icon"] == null ? void 0 : json["credit_type_icon"],
|
|
8680
|
+
creditUsed: json["credit_used"] == null ? void 0 : json["credit_used"],
|
|
8649
8681
|
entitlementExpirationDate: json["entitlement_expiration_date"] == null ? void 0 : new Date(json["entitlement_expiration_date"]),
|
|
8650
8682
|
entitlementId: json["entitlement_id"],
|
|
8683
|
+
entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
|
|
8651
8684
|
entitlementType: json["entitlement_type"],
|
|
8652
8685
|
feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
|
|
8653
8686
|
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
@@ -10462,7 +10495,7 @@ var EmbedProvider = ({
|
|
|
10462
10495
|
});
|
|
10463
10496
|
const customHeaders = useMemo3(
|
|
10464
10497
|
() => ({
|
|
10465
|
-
"X-Schematic-Components-Version": "1.
|
|
10498
|
+
"X-Schematic-Components-Version": "1.5.0",
|
|
10466
10499
|
"X-Schematic-Session-ID": sessionIdRef.current
|
|
10467
10500
|
}),
|
|
10468
10501
|
[]
|
|
@@ -10495,7 +10528,7 @@ var EmbedProvider = ({
|
|
|
10495
10528
|
}
|
|
10496
10529
|
}, [api.public]);
|
|
10497
10530
|
const debouncedHydratePublic = useMemo3(
|
|
10498
|
-
() => (0, import_debounce.default)(hydratePublic, FETCH_DEBOUNCE_TIMEOUT,
|
|
10531
|
+
() => (0, import_debounce.default)(hydratePublic, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10499
10532
|
[hydratePublic]
|
|
10500
10533
|
);
|
|
10501
10534
|
const hydrate = useCallback3(async () => {
|
|
@@ -10517,7 +10550,7 @@ var EmbedProvider = ({
|
|
|
10517
10550
|
}
|
|
10518
10551
|
}, [api.checkout]);
|
|
10519
10552
|
const debouncedHydrate = useMemo3(
|
|
10520
|
-
() => (0, import_debounce.default)(hydrate, FETCH_DEBOUNCE_TIMEOUT,
|
|
10553
|
+
() => (0, import_debounce.default)(hydrate, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10521
10554
|
[hydrate]
|
|
10522
10555
|
);
|
|
10523
10556
|
const hydrateComponent = useCallback3(
|
|
@@ -10544,7 +10577,7 @@ var EmbedProvider = ({
|
|
|
10544
10577
|
[api.checkout]
|
|
10545
10578
|
);
|
|
10546
10579
|
const debouncedHydrateComponent = useMemo3(
|
|
10547
|
-
() => (0, import_debounce.default)(hydrateComponent, FETCH_DEBOUNCE_TIMEOUT,
|
|
10580
|
+
() => (0, import_debounce.default)(hydrateComponent, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10548
10581
|
[hydrateComponent]
|
|
10549
10582
|
);
|
|
10550
10583
|
const hydrateExternal = useCallback3(async function(fn) {
|
|
@@ -10564,14 +10597,14 @@ var EmbedProvider = ({
|
|
|
10564
10597
|
}
|
|
10565
10598
|
}, []);
|
|
10566
10599
|
const debouncedHydrateExternal = useMemo3(
|
|
10567
|
-
() => (0, import_debounce.default)(hydrateExternal, FETCH_DEBOUNCE_TIMEOUT,
|
|
10600
|
+
() => (0, import_debounce.default)(hydrateExternal, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10568
10601
|
[hydrateExternal]
|
|
10569
10602
|
);
|
|
10570
10603
|
const createSetupIntent = useCallback3(async () => {
|
|
10571
10604
|
return api.checkout?.createSetupIntent();
|
|
10572
10605
|
}, [api.checkout]);
|
|
10573
10606
|
const debouncedCreateSetupIntent = useMemo3(
|
|
10574
|
-
() => (0, import_debounce.default)(createSetupIntent, FETCH_DEBOUNCE_TIMEOUT,
|
|
10607
|
+
() => (0, import_debounce.default)(createSetupIntent, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10575
10608
|
[createSetupIntent]
|
|
10576
10609
|
);
|
|
10577
10610
|
const updatePaymentMethod = useCallback3(
|
|
@@ -10590,7 +10623,7 @@ var EmbedProvider = ({
|
|
|
10590
10623
|
[api.checkout]
|
|
10591
10624
|
);
|
|
10592
10625
|
const debouncedUpdatePaymentMethod = useMemo3(
|
|
10593
|
-
() => (0, import_debounce.default)(updatePaymentMethod, FETCH_DEBOUNCE_TIMEOUT,
|
|
10626
|
+
() => (0, import_debounce.default)(updatePaymentMethod, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10594
10627
|
[updatePaymentMethod]
|
|
10595
10628
|
);
|
|
10596
10629
|
const deletePaymentMethod = useCallback3(
|
|
@@ -10609,7 +10642,7 @@ var EmbedProvider = ({
|
|
|
10609
10642
|
[api.checkout]
|
|
10610
10643
|
);
|
|
10611
10644
|
const debouncedDeletePaymentMethod = useMemo3(
|
|
10612
|
-
() => (0, import_debounce.default)(deletePaymentMethod, FETCH_DEBOUNCE_TIMEOUT,
|
|
10645
|
+
() => (0, import_debounce.default)(deletePaymentMethod, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10613
10646
|
[deletePaymentMethod]
|
|
10614
10647
|
);
|
|
10615
10648
|
const checkout = useCallback3(
|
|
@@ -10628,7 +10661,7 @@ var EmbedProvider = ({
|
|
|
10628
10661
|
[api.checkout]
|
|
10629
10662
|
);
|
|
10630
10663
|
const debouncedCheckout = useMemo3(
|
|
10631
|
-
() => (0, import_debounce.default)(checkout, FETCH_DEBOUNCE_TIMEOUT,
|
|
10664
|
+
() => (0, import_debounce.default)(checkout, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10632
10665
|
[checkout]
|
|
10633
10666
|
);
|
|
10634
10667
|
const previewCheckout = useCallback3(
|
|
@@ -10638,7 +10671,12 @@ var EmbedProvider = ({
|
|
|
10638
10671
|
[api.checkout]
|
|
10639
10672
|
);
|
|
10640
10673
|
const debouncedPreviewCheckout = useMemo3(
|
|
10641
|
-
() => (0, import_debounce.default)(previewCheckout, FETCH_DEBOUNCE_TIMEOUT,
|
|
10674
|
+
() => (0, import_debounce.default)(previewCheckout, FETCH_DEBOUNCE_TIMEOUT, {
|
|
10675
|
+
// invoke immediately for minimal latency
|
|
10676
|
+
leading: true,
|
|
10677
|
+
// but also ensure latest data is fetched
|
|
10678
|
+
trailing: true
|
|
10679
|
+
}),
|
|
10642
10680
|
[previewCheckout]
|
|
10643
10681
|
);
|
|
10644
10682
|
const unsubscribe = useCallback3(async () => {
|
|
@@ -10652,7 +10690,7 @@ var EmbedProvider = ({
|
|
|
10652
10690
|
return response;
|
|
10653
10691
|
}, [api.checkout]);
|
|
10654
10692
|
const debouncedUnsubscribe = useMemo3(
|
|
10655
|
-
() => (0, import_debounce.default)(unsubscribe, FETCH_DEBOUNCE_TIMEOUT,
|
|
10693
|
+
() => (0, import_debounce.default)(unsubscribe, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10656
10694
|
[unsubscribe]
|
|
10657
10695
|
);
|
|
10658
10696
|
const getUpcomingInvoice = useCallback3(
|
|
@@ -10664,19 +10702,30 @@ var EmbedProvider = ({
|
|
|
10664
10702
|
[api.checkout]
|
|
10665
10703
|
);
|
|
10666
10704
|
const debouncedGetUpcomingInvoice = useMemo3(
|
|
10667
|
-
() => (0, import_debounce.default)(getUpcomingInvoice, FETCH_DEBOUNCE_TIMEOUT,
|
|
10705
|
+
() => (0, import_debounce.default)(getUpcomingInvoice, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10668
10706
|
[getUpcomingInvoice]
|
|
10669
10707
|
);
|
|
10708
|
+
const getCustomerBalance = useCallback3(async () => {
|
|
10709
|
+
return api.checkout?.fetchCustomerBalance();
|
|
10710
|
+
}, [api.checkout]);
|
|
10711
|
+
const debouncedGetCustomerBalance = useMemo3(
|
|
10712
|
+
() => (0, import_debounce.default)(getCustomerBalance, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10713
|
+
[getCustomerBalance]
|
|
10714
|
+
);
|
|
10670
10715
|
const listInvoices = useCallback3(async () => {
|
|
10671
10716
|
return api.checkout?.listInvoices();
|
|
10672
10717
|
}, [api.checkout]);
|
|
10673
10718
|
const debouncedListInvoices = useMemo3(
|
|
10674
|
-
() => (0, import_debounce.default)(listInvoices, FETCH_DEBOUNCE_TIMEOUT,
|
|
10719
|
+
() => (0, import_debounce.default)(listInvoices, FETCH_DEBOUNCE_TIMEOUT, DEBOUNCE_SETTINGS),
|
|
10675
10720
|
[listInvoices]
|
|
10676
10721
|
);
|
|
10677
|
-
const setError = useCallback3(
|
|
10678
|
-
|
|
10679
|
-
|
|
10722
|
+
const setError = useCallback3(
|
|
10723
|
+
(error) => {
|
|
10724
|
+
debug(error.message);
|
|
10725
|
+
dispatch({ type: "ERROR", error });
|
|
10726
|
+
},
|
|
10727
|
+
[debug]
|
|
10728
|
+
);
|
|
10680
10729
|
const setAccessToken = useCallback3((token2) => {
|
|
10681
10730
|
dispatch({ type: "SET_ACCESS_TOKEN", token: token2 });
|
|
10682
10731
|
}, []);
|
|
@@ -10701,13 +10750,13 @@ var EmbedProvider = ({
|
|
|
10701
10750
|
);
|
|
10702
10751
|
if (element) {
|
|
10703
10752
|
styleRef.current = element;
|
|
10704
|
-
|
|
10753
|
+
} else {
|
|
10754
|
+
const style = document.createElement("link");
|
|
10755
|
+
style.id = "schematic-fonts";
|
|
10756
|
+
style.rel = "stylesheet";
|
|
10757
|
+
document.head.appendChild(style);
|
|
10758
|
+
styleRef.current = style;
|
|
10705
10759
|
}
|
|
10706
|
-
const style = document.createElement("link");
|
|
10707
|
-
style.id = "schematic-fonts";
|
|
10708
|
-
style.rel = "stylesheet";
|
|
10709
|
-
document.head.appendChild(style);
|
|
10710
|
-
styleRef.current = style;
|
|
10711
10760
|
const darkModeQuery = matchMedia("(prefers-color-scheme: dark)");
|
|
10712
10761
|
const colorMode = darkModeQuery.matches ? "dark" : "light";
|
|
10713
10762
|
dispatch({
|
|
@@ -10718,13 +10767,17 @@ var EmbedProvider = ({
|
|
|
10718
10767
|
}
|
|
10719
10768
|
}
|
|
10720
10769
|
});
|
|
10721
|
-
|
|
10770
|
+
function darkModeQueryHandler(event) {
|
|
10722
10771
|
const newColorMode = event.matches ? "dark" : "light";
|
|
10723
10772
|
dispatch({
|
|
10724
10773
|
type: "UPDATE_SETTINGS",
|
|
10725
10774
|
settings: { theme: { colorMode: newColorMode } }
|
|
10726
10775
|
});
|
|
10727
|
-
}
|
|
10776
|
+
}
|
|
10777
|
+
darkModeQuery.addEventListener("change", darkModeQueryHandler);
|
|
10778
|
+
return () => {
|
|
10779
|
+
darkModeQuery.removeEventListener("change", darkModeQueryHandler);
|
|
10780
|
+
};
|
|
10728
10781
|
}, []);
|
|
10729
10782
|
useEffect2(() => {
|
|
10730
10783
|
const fontSet = /* @__PURE__ */ new Set([]);
|
|
@@ -10770,24 +10823,19 @@ var EmbedProvider = ({
|
|
|
10770
10823
|
}));
|
|
10771
10824
|
}
|
|
10772
10825
|
}, [state.accessToken, apiConfig, customHeaders]);
|
|
10773
|
-
useEffect2(() => {
|
|
10774
|
-
if (state.error) {
|
|
10775
|
-
debug(state.error.message);
|
|
10776
|
-
}
|
|
10777
|
-
}, [debug, state.error]);
|
|
10778
10826
|
useEffect2(() => {
|
|
10779
10827
|
const providedSettings = { ...options.settings || {} };
|
|
10780
10828
|
updateSettings(providedSettings, { update: false });
|
|
10781
10829
|
}, [options.settings, updateSettings]);
|
|
10782
10830
|
useEffect2(() => {
|
|
10783
|
-
|
|
10831
|
+
function planChangedHandler(event) {
|
|
10784
10832
|
if (event instanceof CustomEvent) {
|
|
10785
10833
|
debug("plan changed", event.detail);
|
|
10786
10834
|
}
|
|
10787
|
-
}
|
|
10788
|
-
window.addEventListener("plan-changed",
|
|
10835
|
+
}
|
|
10836
|
+
window.addEventListener("plan-changed", planChangedHandler);
|
|
10789
10837
|
return () => {
|
|
10790
|
-
window.removeEventListener("plan-changed",
|
|
10838
|
+
window.removeEventListener("plan-changed", planChangedHandler);
|
|
10791
10839
|
};
|
|
10792
10840
|
}, [debug]);
|
|
10793
10841
|
return /* @__PURE__ */ jsx(
|
|
@@ -10812,13 +10860,15 @@ var EmbedProvider = ({
|
|
|
10812
10860
|
previewCheckout: debouncedPreviewCheckout,
|
|
10813
10861
|
unsubscribe: debouncedUnsubscribe,
|
|
10814
10862
|
getUpcomingInvoice: debouncedGetUpcomingInvoice,
|
|
10863
|
+
getCustomerBalance: debouncedGetCustomerBalance,
|
|
10815
10864
|
listInvoices: debouncedListInvoices,
|
|
10816
10865
|
setError,
|
|
10817
10866
|
setAccessToken,
|
|
10818
10867
|
setLayout,
|
|
10819
10868
|
setCheckoutState,
|
|
10820
10869
|
setData,
|
|
10821
|
-
updateSettings
|
|
10870
|
+
updateSettings,
|
|
10871
|
+
debug
|
|
10822
10872
|
},
|
|
10823
10873
|
children: /* @__PURE__ */ jsxs(ot, { theme: state.settings.theme, children: [
|
|
10824
10874
|
/* @__PURE__ */ jsx(IconStyles, {}),
|
|
@@ -11746,8 +11796,10 @@ import { createPortal } from "react-dom";
|
|
|
11746
11796
|
|
|
11747
11797
|
// src/components/ui/tooltip/styles.ts
|
|
11748
11798
|
var Trigger = dt(Box)`
|
|
11749
|
-
|
|
11750
|
-
|
|
11799
|
+
${({ $fullWidth = false }) => $fullWidth && lt`
|
|
11800
|
+
width: 100%;
|
|
11801
|
+
flex-grow: 1;
|
|
11802
|
+
`}
|
|
11751
11803
|
`;
|
|
11752
11804
|
var coords = (position2) => {
|
|
11753
11805
|
let x2 = 0;
|
|
@@ -11893,6 +11945,7 @@ var Tooltip = ({
|
|
|
11893
11945
|
trigger,
|
|
11894
11946
|
content,
|
|
11895
11947
|
position: position2 = "top",
|
|
11948
|
+
fullWidth = false,
|
|
11896
11949
|
...rest
|
|
11897
11950
|
}) => {
|
|
11898
11951
|
const ref = useRef5(null);
|
|
@@ -11933,6 +11986,7 @@ var Tooltip = ({
|
|
|
11933
11986
|
ref,
|
|
11934
11987
|
onPointerEnter: () => setShow(true),
|
|
11935
11988
|
onPointerLeave: () => setShow(false),
|
|
11989
|
+
$fullWidth: fullWidth,
|
|
11936
11990
|
...rest,
|
|
11937
11991
|
children: trigger
|
|
11938
11992
|
}
|
|
@@ -12079,6 +12133,35 @@ var import_debounce3 = __toESM(require_debounce());
|
|
|
12079
12133
|
import { forwardRef as forwardRef5, useLayoutEffect as useLayoutEffect5, useMemo as useMemo15, useState as useState12 } from "react";
|
|
12080
12134
|
import { createPortal as createPortal2 } from "react-dom";
|
|
12081
12135
|
|
|
12136
|
+
// src/components/shared/billing-threshold-tooltip/BillingThresholdTooltip.tsx
|
|
12137
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
12138
|
+
var BillingThresholdTooltip = ({
|
|
12139
|
+
billingThreshold
|
|
12140
|
+
}) => {
|
|
12141
|
+
const { t: t2 } = useTranslation();
|
|
12142
|
+
const { settings } = useEmbed();
|
|
12143
|
+
const isLightBackground = useIsLightBackground();
|
|
12144
|
+
return /* @__PURE__ */ jsx10(
|
|
12145
|
+
Tooltip,
|
|
12146
|
+
{
|
|
12147
|
+
content: /* @__PURE__ */ jsx10(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, children: t2(
|
|
12148
|
+
"An invoice is created when charges reach $X; the rest is billed monthly.",
|
|
12149
|
+
{
|
|
12150
|
+
amount: formatCurrency(billingThreshold)
|
|
12151
|
+
}
|
|
12152
|
+
) }),
|
|
12153
|
+
trigger: /* @__PURE__ */ jsx10(
|
|
12154
|
+
Icon3,
|
|
12155
|
+
{
|
|
12156
|
+
title: "billing threshold",
|
|
12157
|
+
name: "info-rounded",
|
|
12158
|
+
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`
|
|
12159
|
+
}
|
|
12160
|
+
)
|
|
12161
|
+
}
|
|
12162
|
+
);
|
|
12163
|
+
};
|
|
12164
|
+
|
|
12082
12165
|
// src/components/shared/checkout-dialog/CheckoutDialog.tsx
|
|
12083
12166
|
import {
|
|
12084
12167
|
useCallback as useCallback9,
|
|
@@ -12096,7 +12179,7 @@ import {
|
|
|
12096
12179
|
} from "react";
|
|
12097
12180
|
|
|
12098
12181
|
// src/components/shared/sidebar/EntitlementRow.tsx
|
|
12099
|
-
import { Fragment as Fragment3, jsx as
|
|
12182
|
+
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
12100
12183
|
var EntitlementRow = (entitlement) => {
|
|
12101
12184
|
const { t: t2 } = useTranslation();
|
|
12102
12185
|
const { settings } = useEmbed();
|
|
@@ -12109,7 +12192,7 @@ var EntitlementRow = (entitlement) => {
|
|
|
12109
12192
|
priceTier: priceTiers
|
|
12110
12193
|
} = getEntitlementPrice(entitlement, planPeriod) || {};
|
|
12111
12194
|
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
12112
|
-
/* @__PURE__ */
|
|
12195
|
+
/* @__PURE__ */ jsx11(Box, { children: /* @__PURE__ */ jsx11(Text, { display: "heading4", children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
12113
12196
|
quantity,
|
|
12114
12197
|
" ",
|
|
12115
12198
|
getFeatureName(feature, quantity)
|
|
@@ -12118,7 +12201,7 @@ var EntitlementRow = (entitlement) => {
|
|
|
12118
12201
|
" ",
|
|
12119
12202
|
getFeatureName(feature, softLimit)
|
|
12120
12203
|
] }) : feature.name }) }),
|
|
12121
|
-
/* @__PURE__ */
|
|
12204
|
+
/* @__PURE__ */ jsx11(Box, { $whiteSpace: "nowrap", children: priceBehavior === "pay_in_advance" /* PayInAdvance */ ? /* @__PURE__ */ jsxs6(Text, { children: [
|
|
12122
12205
|
formatCurrency((price ?? 0) * quantity, currency),
|
|
12123
12206
|
/* @__PURE__ */ jsxs6("sub", { children: [
|
|
12124
12207
|
"/",
|
|
@@ -12142,17 +12225,8 @@ var EntitlementRow = (entitlement) => {
|
|
|
12142
12225
|
shortenPeriod(planPeriod)
|
|
12143
12226
|
] })
|
|
12144
12227
|
] })
|
|
12145
|
-
] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs6(Flex, { $alignItems: "
|
|
12146
|
-
/* @__PURE__ */
|
|
12147
|
-
PricingTiersTooltip,
|
|
12148
|
-
{
|
|
12149
|
-
feature,
|
|
12150
|
-
period: planPeriod,
|
|
12151
|
-
currency,
|
|
12152
|
-
priceTiers
|
|
12153
|
-
}
|
|
12154
|
-
),
|
|
12155
|
-
/* @__PURE__ */ jsx10(
|
|
12228
|
+
] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs6(Flex, { $alignItems: "end", children: [
|
|
12229
|
+
/* @__PURE__ */ jsx11(
|
|
12156
12230
|
Text,
|
|
12157
12231
|
{
|
|
12158
12232
|
style: { opacity: 0.54 },
|
|
@@ -12160,6 +12234,15 @@ var EntitlementRow = (entitlement) => {
|
|
|
12160
12234
|
$color: settings.theme.typography.text.color,
|
|
12161
12235
|
children: t2("Tier-based")
|
|
12162
12236
|
}
|
|
12237
|
+
),
|
|
12238
|
+
/* @__PURE__ */ jsx11(
|
|
12239
|
+
PricingTiersTooltip,
|
|
12240
|
+
{
|
|
12241
|
+
feature,
|
|
12242
|
+
period: planPeriod,
|
|
12243
|
+
currency,
|
|
12244
|
+
priceTiers
|
|
12245
|
+
}
|
|
12163
12246
|
)
|
|
12164
12247
|
] }) })
|
|
12165
12248
|
] });
|
|
@@ -12168,7 +12251,7 @@ var EntitlementRow = (entitlement) => {
|
|
|
12168
12251
|
|
|
12169
12252
|
// src/components/shared/sidebar/Proration.tsx
|
|
12170
12253
|
import { useState as useState6 } from "react";
|
|
12171
|
-
import { Fragment as Fragment4, jsx as
|
|
12254
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
12172
12255
|
var Proration = ({ currency, charges }) => {
|
|
12173
12256
|
const { t: t2 } = useTranslation();
|
|
12174
12257
|
const [open, setOpen] = useState6(false);
|
|
@@ -12178,19 +12261,19 @@ var Proration = ({ currency, charges }) => {
|
|
|
12178
12261
|
setOpen((open2) => !open2);
|
|
12179
12262
|
};
|
|
12180
12263
|
return /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
12181
|
-
/* @__PURE__ */
|
|
12264
|
+
/* @__PURE__ */ jsx12(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx12(Text, { $size: 14, children: t2("Proration") }) }),
|
|
12182
12265
|
/* @__PURE__ */ jsxs7(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
12183
12266
|
open && charges?.upcomingInvoiceLineItems.map(
|
|
12184
12267
|
({ amount, description }, index) => {
|
|
12185
12268
|
return /* @__PURE__ */ jsxs7(Flex, { $gap: "1rem", children: [
|
|
12186
|
-
/* @__PURE__ */
|
|
12187
|
-
/* @__PURE__ */
|
|
12269
|
+
/* @__PURE__ */ jsx12(Text, { children: description }),
|
|
12270
|
+
/* @__PURE__ */ jsx12(Text, { children: formatCurrency(amount, currency) })
|
|
12188
12271
|
] }, index);
|
|
12189
12272
|
}
|
|
12190
12273
|
),
|
|
12191
12274
|
/* @__PURE__ */ jsxs7(Flex, { $justifyContent: "space-between", $alignItems: "center", $gap: "1rem", children: [
|
|
12192
12275
|
/* @__PURE__ */ jsxs7(Flex, { children: [
|
|
12193
|
-
/* @__PURE__ */
|
|
12276
|
+
/* @__PURE__ */ jsx12(Text, { display: "heading4", children: t2("Total") }),
|
|
12194
12277
|
/* @__PURE__ */ jsxs7(
|
|
12195
12278
|
Button,
|
|
12196
12279
|
{
|
|
@@ -12199,20 +12282,20 @@ var Proration = ({ currency, charges }) => {
|
|
|
12199
12282
|
style: { height: "auto", padding: 0 },
|
|
12200
12283
|
$variant: "text",
|
|
12201
12284
|
children: [
|
|
12202
|
-
/* @__PURE__ */
|
|
12203
|
-
/* @__PURE__ */
|
|
12285
|
+
/* @__PURE__ */ jsx12(Icon3, { name: open ? "chevron-up" : "chevron-down" }),
|
|
12286
|
+
/* @__PURE__ */ jsx12(Text, { children: open ? t2("Hide details") : t2("Show details") })
|
|
12204
12287
|
]
|
|
12205
12288
|
}
|
|
12206
12289
|
)
|
|
12207
12290
|
] }),
|
|
12208
|
-
/* @__PURE__ */
|
|
12291
|
+
/* @__PURE__ */ jsx12(Flex, { children: /* @__PURE__ */ jsx12(Text, { children: formatCurrency(charges.proration, currency) }) })
|
|
12209
12292
|
] })
|
|
12210
12293
|
] })
|
|
12211
12294
|
] });
|
|
12212
12295
|
};
|
|
12213
12296
|
|
|
12214
12297
|
// src/components/shared/sidebar/StageButton.tsx
|
|
12215
|
-
import { jsx as
|
|
12298
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
12216
12299
|
var StageButton = ({
|
|
12217
12300
|
checkout,
|
|
12218
12301
|
checkoutStage,
|
|
@@ -12234,7 +12317,7 @@ var StageButton = ({
|
|
|
12234
12317
|
const { t: t2 } = useTranslation();
|
|
12235
12318
|
const isDisabled = isLoading || !hasPlan || inEditMode;
|
|
12236
12319
|
const NoPaymentRequired = () => {
|
|
12237
|
-
return /* @__PURE__ */
|
|
12320
|
+
return /* @__PURE__ */ jsx13(
|
|
12238
12321
|
Button,
|
|
12239
12322
|
{
|
|
12240
12323
|
type: "button",
|
|
@@ -12248,7 +12331,7 @@ var StageButton = ({
|
|
|
12248
12331
|
};
|
|
12249
12332
|
if (checkoutStage === "plan") {
|
|
12250
12333
|
if (isSelectedPlanTrialable && trialPaymentMethodRequired && shouldTrial) {
|
|
12251
|
-
return /* @__PURE__ */
|
|
12334
|
+
return /* @__PURE__ */ jsx13(
|
|
12252
12335
|
Button,
|
|
12253
12336
|
{
|
|
12254
12337
|
type: "button",
|
|
@@ -12269,7 +12352,7 @@ var StageButton = ({
|
|
|
12269
12352
|
t2("Next"),
|
|
12270
12353
|
": ",
|
|
12271
12354
|
t2("Checkout"),
|
|
12272
|
-
/* @__PURE__ */
|
|
12355
|
+
/* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
|
|
12273
12356
|
]
|
|
12274
12357
|
}
|
|
12275
12358
|
)
|
|
@@ -12279,9 +12362,9 @@ var StageButton = ({
|
|
|
12279
12362
|
if (!isPaymentMethodRequired && !checkoutStages?.some(
|
|
12280
12363
|
(stage) => stage.id === "usage" || stage.id === "addons" || stage.id === "credits"
|
|
12281
12364
|
)) {
|
|
12282
|
-
return /* @__PURE__ */
|
|
12365
|
+
return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
|
|
12283
12366
|
}
|
|
12284
|
-
return /* @__PURE__ */
|
|
12367
|
+
return /* @__PURE__ */ jsx13(
|
|
12285
12368
|
Button,
|
|
12286
12369
|
{
|
|
12287
12370
|
type: "button",
|
|
@@ -12298,7 +12381,7 @@ var StageButton = ({
|
|
|
12298
12381
|
":",
|
|
12299
12382
|
" ",
|
|
12300
12383
|
hasPayInAdvanceEntitlements ? t2("Usage") : hasAddOns ? t2("Addons") : hasCreditBundles ? t2("Credits") : t2("Checkout"),
|
|
12301
|
-
/* @__PURE__ */
|
|
12384
|
+
/* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
|
|
12302
12385
|
] })
|
|
12303
12386
|
}
|
|
12304
12387
|
);
|
|
@@ -12307,9 +12390,9 @@ var StageButton = ({
|
|
|
12307
12390
|
if (!isPaymentMethodRequired && !checkoutStages?.some(
|
|
12308
12391
|
(stage) => stage.id === "addons" || stage.id === "credits"
|
|
12309
12392
|
)) {
|
|
12310
|
-
return /* @__PURE__ */
|
|
12393
|
+
return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
|
|
12311
12394
|
}
|
|
12312
|
-
return /* @__PURE__ */
|
|
12395
|
+
return /* @__PURE__ */ jsx13(
|
|
12313
12396
|
Button,
|
|
12314
12397
|
{
|
|
12315
12398
|
type: "button",
|
|
@@ -12333,7 +12416,7 @@ var StageButton = ({
|
|
|
12333
12416
|
":",
|
|
12334
12417
|
" ",
|
|
12335
12418
|
hasAddOns ? t2("Addons") : hasCreditBundles ? t2("Credits") : t2("Checkout"),
|
|
12336
|
-
/* @__PURE__ */
|
|
12419
|
+
/* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
|
|
12337
12420
|
]
|
|
12338
12421
|
}
|
|
12339
12422
|
)
|
|
@@ -12348,9 +12431,9 @@ var StageButton = ({
|
|
|
12348
12431
|
(stage) => stage.id === "credits"
|
|
12349
12432
|
);
|
|
12350
12433
|
if (!isPaymentMethodRequired && !hasAddonsUsageStage && !hasCreditsStage) {
|
|
12351
|
-
return /* @__PURE__ */
|
|
12434
|
+
return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
|
|
12352
12435
|
}
|
|
12353
|
-
return /* @__PURE__ */
|
|
12436
|
+
return /* @__PURE__ */ jsx13(
|
|
12354
12437
|
Button,
|
|
12355
12438
|
{
|
|
12356
12439
|
type: "button",
|
|
@@ -12374,7 +12457,7 @@ var StageButton = ({
|
|
|
12374
12457
|
":",
|
|
12375
12458
|
" ",
|
|
12376
12459
|
hasAddonsUsageStage ? t2("Add-ons Quantity") : hasCreditsStage ? t2("Credits") : t2("Checkout"),
|
|
12377
|
-
/* @__PURE__ */
|
|
12460
|
+
/* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
|
|
12378
12461
|
]
|
|
12379
12462
|
}
|
|
12380
12463
|
)
|
|
@@ -12383,9 +12466,9 @@ var StageButton = ({
|
|
|
12383
12466
|
}
|
|
12384
12467
|
if (checkoutStage === "addonsUsage") {
|
|
12385
12468
|
if (!isPaymentMethodRequired && !checkoutStages?.some((stage) => stage.id === "credits")) {
|
|
12386
|
-
return /* @__PURE__ */
|
|
12469
|
+
return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
|
|
12387
12470
|
}
|
|
12388
|
-
return /* @__PURE__ */
|
|
12471
|
+
return /* @__PURE__ */ jsx13(
|
|
12389
12472
|
Button,
|
|
12390
12473
|
{
|
|
12391
12474
|
type: "button",
|
|
@@ -12406,7 +12489,7 @@ var StageButton = ({
|
|
|
12406
12489
|
t2("Next"),
|
|
12407
12490
|
": ",
|
|
12408
12491
|
hasCreditBundles ? t2("Credits") : t2("Checkout"),
|
|
12409
|
-
/* @__PURE__ */
|
|
12492
|
+
/* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
|
|
12410
12493
|
]
|
|
12411
12494
|
}
|
|
12412
12495
|
)
|
|
@@ -12415,9 +12498,9 @@ var StageButton = ({
|
|
|
12415
12498
|
}
|
|
12416
12499
|
if (checkoutStage === "credits") {
|
|
12417
12500
|
if (!isPaymentMethodRequired) {
|
|
12418
|
-
return /* @__PURE__ */
|
|
12501
|
+
return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
|
|
12419
12502
|
}
|
|
12420
|
-
return /* @__PURE__ */
|
|
12503
|
+
return /* @__PURE__ */ jsx13(
|
|
12421
12504
|
Button,
|
|
12422
12505
|
{
|
|
12423
12506
|
type: "button",
|
|
@@ -12438,7 +12521,7 @@ var StageButton = ({
|
|
|
12438
12521
|
t2("Next"),
|
|
12439
12522
|
": ",
|
|
12440
12523
|
t2("Checkout"),
|
|
12441
|
-
/* @__PURE__ */
|
|
12524
|
+
/* @__PURE__ */ jsx13(Icon3, { name: "arrow-right" })
|
|
12442
12525
|
]
|
|
12443
12526
|
}
|
|
12444
12527
|
)
|
|
@@ -12447,9 +12530,9 @@ var StageButton = ({
|
|
|
12447
12530
|
}
|
|
12448
12531
|
if (checkoutStage === "checkout") {
|
|
12449
12532
|
if (!isPaymentMethodRequired) {
|
|
12450
|
-
return /* @__PURE__ */
|
|
12533
|
+
return /* @__PURE__ */ jsx13(NoPaymentRequired, {});
|
|
12451
12534
|
}
|
|
12452
|
-
return /* @__PURE__ */
|
|
12535
|
+
return /* @__PURE__ */ jsx13(
|
|
12453
12536
|
Button,
|
|
12454
12537
|
{
|
|
12455
12538
|
type: "button",
|
|
@@ -12464,7 +12547,7 @@ var StageButton = ({
|
|
|
12464
12547
|
};
|
|
12465
12548
|
|
|
12466
12549
|
// src/components/shared/sidebar/Sidebar.tsx
|
|
12467
|
-
import { jsx as
|
|
12550
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
12468
12551
|
var Sidebar = ({
|
|
12469
12552
|
planPeriod,
|
|
12470
12553
|
selectedPlan,
|
|
@@ -12793,7 +12876,7 @@ var Sidebar = ({
|
|
|
12793
12876
|
}
|
|
12794
12877
|
},
|
|
12795
12878
|
children: [
|
|
12796
|
-
showHeader && /* @__PURE__ */
|
|
12879
|
+
showHeader && /* @__PURE__ */ jsx14(
|
|
12797
12880
|
Flex,
|
|
12798
12881
|
{
|
|
12799
12882
|
$position: "relative",
|
|
@@ -12805,7 +12888,7 @@ var Sidebar = ({
|
|
|
12805
12888
|
$borderBottomWidth: "1px",
|
|
12806
12889
|
$borderStyle: "solid",
|
|
12807
12890
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
|
|
12808
|
-
children: /* @__PURE__ */
|
|
12891
|
+
children: /* @__PURE__ */ jsx14(Flex, { $justifyContent: "space-between", children: /* @__PURE__ */ jsx14(Text, { as: "h3", display: "heading3", children: t2("Subscription") }) })
|
|
12809
12892
|
}
|
|
12810
12893
|
),
|
|
12811
12894
|
/* @__PURE__ */ jsxs9(
|
|
@@ -12822,7 +12905,7 @@ var Sidebar = ({
|
|
|
12822
12905
|
$borderStyle: "solid",
|
|
12823
12906
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.1)" : "hsla(0, 0%, 100%, 0.2)",
|
|
12824
12907
|
children: [
|
|
12825
|
-
/* @__PURE__ */
|
|
12908
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Plan") }) }),
|
|
12826
12909
|
/* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
|
|
12827
12910
|
currentPlan && /* @__PURE__ */ jsxs9(
|
|
12828
12911
|
Flex,
|
|
@@ -12836,8 +12919,8 @@ var Sidebar = ({
|
|
|
12836
12919
|
$color: settings.theme.typography.heading4.color
|
|
12837
12920
|
},
|
|
12838
12921
|
children: [
|
|
12839
|
-
/* @__PURE__ */
|
|
12840
|
-
typeof currentPlan.planPrice === "number" && /* @__PURE__ */
|
|
12922
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: currentPlan.name }) }),
|
|
12923
|
+
typeof currentPlan.planPrice === "number" && /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
12841
12924
|
formatCurrency(
|
|
12842
12925
|
currentPlan.planPrice,
|
|
12843
12926
|
billingSubscription?.currency
|
|
@@ -12851,7 +12934,7 @@ var Sidebar = ({
|
|
|
12851
12934
|
}
|
|
12852
12935
|
),
|
|
12853
12936
|
willPlanChange && /* @__PURE__ */ jsxs9(Box, { children: [
|
|
12854
|
-
/* @__PURE__ */
|
|
12937
|
+
/* @__PURE__ */ jsx14(
|
|
12855
12938
|
Box,
|
|
12856
12939
|
{
|
|
12857
12940
|
$width: "100%",
|
|
@@ -12859,7 +12942,7 @@ var Sidebar = ({
|
|
|
12859
12942
|
$opacity: "50%",
|
|
12860
12943
|
$marginBottom: "0.25rem",
|
|
12861
12944
|
$marginTop: "-0.25rem",
|
|
12862
|
-
children: /* @__PURE__ */
|
|
12945
|
+
children: /* @__PURE__ */ jsx14(
|
|
12863
12946
|
Icon3,
|
|
12864
12947
|
{
|
|
12865
12948
|
name: "arrow-down",
|
|
@@ -12878,8 +12961,8 @@ var Sidebar = ({
|
|
|
12878
12961
|
$alignItems: "center",
|
|
12879
12962
|
$gap: "1rem",
|
|
12880
12963
|
children: [
|
|
12881
|
-
/* @__PURE__ */
|
|
12882
|
-
/* @__PURE__ */
|
|
12964
|
+
/* @__PURE__ */ jsx14(Flex, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: selectedPlan.name }) }),
|
|
12965
|
+
/* @__PURE__ */ jsx14(Flex, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
12883
12966
|
formatCurrency(
|
|
12884
12967
|
selectedPlanPrice ?? 0,
|
|
12885
12968
|
selectedPlanCurrency
|
|
@@ -12895,12 +12978,12 @@ var Sidebar = ({
|
|
|
12895
12978
|
] })
|
|
12896
12979
|
] }),
|
|
12897
12980
|
updatedUsageBasedEntitlements.willChange && /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
|
|
12898
|
-
/* @__PURE__ */
|
|
12981
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Usage-based") }) }),
|
|
12899
12982
|
updatedUsageBasedEntitlements.removed.reduce(
|
|
12900
12983
|
(acc, entitlement, index) => {
|
|
12901
12984
|
if (entitlement.feature?.name) {
|
|
12902
12985
|
acc.push(
|
|
12903
|
-
/* @__PURE__ */
|
|
12986
|
+
/* @__PURE__ */ jsx14(
|
|
12904
12987
|
Flex,
|
|
12905
12988
|
{
|
|
12906
12989
|
$justifyContent: "space-between",
|
|
@@ -12909,7 +12992,7 @@ var Sidebar = ({
|
|
|
12909
12992
|
$opacity: "0.625",
|
|
12910
12993
|
$textDecoration: "line-through",
|
|
12911
12994
|
$color: settings.theme.typography.heading4.color,
|
|
12912
|
-
children: /* @__PURE__ */
|
|
12995
|
+
children: /* @__PURE__ */ jsx14(
|
|
12913
12996
|
EntitlementRow,
|
|
12914
12997
|
{
|
|
12915
12998
|
...entitlement,
|
|
@@ -12930,7 +13013,7 @@ var Sidebar = ({
|
|
|
12930
13013
|
if (next2.feature?.name) {
|
|
12931
13014
|
acc.push(
|
|
12932
13015
|
/* @__PURE__ */ jsxs9(Box, { children: [
|
|
12933
|
-
/* @__PURE__ */
|
|
13016
|
+
/* @__PURE__ */ jsx14(
|
|
12934
13017
|
Flex,
|
|
12935
13018
|
{
|
|
12936
13019
|
$justifyContent: "space-between",
|
|
@@ -12939,16 +13022,16 @@ var Sidebar = ({
|
|
|
12939
13022
|
$opacity: "0.625",
|
|
12940
13023
|
$textDecoration: "line-through",
|
|
12941
13024
|
$color: settings.theme.typography.heading4.color,
|
|
12942
|
-
children: /* @__PURE__ */
|
|
13025
|
+
children: /* @__PURE__ */ jsx14(EntitlementRow, { ...previous, planPeriod })
|
|
12943
13026
|
}
|
|
12944
13027
|
),
|
|
12945
|
-
/* @__PURE__ */
|
|
13028
|
+
/* @__PURE__ */ jsx14(
|
|
12946
13029
|
Flex,
|
|
12947
13030
|
{
|
|
12948
13031
|
$justifyContent: "space-between",
|
|
12949
13032
|
$alignItems: "baseline",
|
|
12950
13033
|
$gap: "1rem",
|
|
12951
|
-
children: /* @__PURE__ */
|
|
13034
|
+
children: /* @__PURE__ */ jsx14(EntitlementRow, { ...next2, planPeriod })
|
|
12952
13035
|
}
|
|
12953
13036
|
)
|
|
12954
13037
|
] }, index)
|
|
@@ -12962,13 +13045,13 @@ var Sidebar = ({
|
|
|
12962
13045
|
(acc, entitlement, index) => {
|
|
12963
13046
|
if (entitlement.feature?.name) {
|
|
12964
13047
|
acc.push(
|
|
12965
|
-
/* @__PURE__ */
|
|
13048
|
+
/* @__PURE__ */ jsx14(
|
|
12966
13049
|
Flex,
|
|
12967
13050
|
{
|
|
12968
13051
|
$justifyContent: "space-between",
|
|
12969
13052
|
$alignItems: "baseline",
|
|
12970
13053
|
$gap: "1rem",
|
|
12971
|
-
children: /* @__PURE__ */
|
|
13054
|
+
children: /* @__PURE__ */ jsx14(
|
|
12972
13055
|
EntitlementRow,
|
|
12973
13056
|
{
|
|
12974
13057
|
...entitlement,
|
|
@@ -12986,7 +13069,7 @@ var Sidebar = ({
|
|
|
12986
13069
|
)
|
|
12987
13070
|
] }),
|
|
12988
13071
|
selectedPlan && isSelectedPlanTrialable && shouldTrial && /* @__PURE__ */ jsxs9(Box, { children: [
|
|
12989
|
-
/* @__PURE__ */
|
|
13072
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Trial") }) }),
|
|
12990
13073
|
/* @__PURE__ */ jsxs9(
|
|
12991
13074
|
Flex,
|
|
12992
13075
|
{
|
|
@@ -12994,19 +13077,19 @@ var Sidebar = ({
|
|
|
12994
13077
|
$alignItems: "center",
|
|
12995
13078
|
$gap: "1rem",
|
|
12996
13079
|
children: [
|
|
12997
|
-
/* @__PURE__ */
|
|
12998
|
-
/* @__PURE__ */
|
|
13080
|
+
/* @__PURE__ */ jsx14(Flex, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: t2("Ends on", { date: trialEndsOn.toLocaleDateString() }) }) }),
|
|
13081
|
+
/* @__PURE__ */ jsx14(Flex, { children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
12999
13082
|
"-",
|
|
13000
13083
|
formatCurrency(selectedPlanPrice ?? 0, selectedPlanCurrency),
|
|
13001
13084
|
"/",
|
|
13002
|
-
/* @__PURE__ */
|
|
13085
|
+
/* @__PURE__ */ jsx14("sub", { children: shortenPeriod(planPeriod) })
|
|
13003
13086
|
] }) })
|
|
13004
13087
|
]
|
|
13005
13088
|
}
|
|
13006
13089
|
)
|
|
13007
13090
|
] }),
|
|
13008
13091
|
(willAddOnsChange || selectedAddOns.length > 0) && /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
|
|
13009
|
-
/* @__PURE__ */
|
|
13092
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Add-ons") }) }),
|
|
13010
13093
|
removedAddOns.map((addOn, index) => {
|
|
13011
13094
|
return /* @__PURE__ */ jsxs9(
|
|
13012
13095
|
Flex,
|
|
@@ -13018,8 +13101,8 @@ var Sidebar = ({
|
|
|
13018
13101
|
$textDecoration: "line-through",
|
|
13019
13102
|
$color: settings.theme.typography.heading4.color,
|
|
13020
13103
|
children: [
|
|
13021
|
-
/* @__PURE__ */
|
|
13022
|
-
typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */
|
|
13104
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: addOn.name }) }),
|
|
13105
|
+
typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13023
13106
|
formatCurrency(addOn.planPrice, selectedPlanCurrency),
|
|
13024
13107
|
addOn.planPeriod !== "one-time" && /* @__PURE__ */ jsxs9("sub", { children: [
|
|
13025
13108
|
"/",
|
|
@@ -13040,8 +13123,8 @@ var Sidebar = ({
|
|
|
13040
13123
|
$alignItems: "center",
|
|
13041
13124
|
$gap: "1rem",
|
|
13042
13125
|
children: [
|
|
13043
|
-
/* @__PURE__ */
|
|
13044
|
-
/* @__PURE__ */
|
|
13126
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { display: "heading4", children: addOn.name }) }),
|
|
13127
|
+
/* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13045
13128
|
formatCurrency(addOnPrice ?? 0, addOnCurrency),
|
|
13046
13129
|
addOn.chargeType !== ChargeType.oneTime && /* @__PURE__ */ jsxs9("sub", { children: [
|
|
13047
13130
|
"/",
|
|
@@ -13055,7 +13138,7 @@ var Sidebar = ({
|
|
|
13055
13138
|
})
|
|
13056
13139
|
] }),
|
|
13057
13140
|
addedCreditBundles.length > 0 && /* @__PURE__ */ jsxs9(Flex, { $flexDirection: "column", $gap: "0.5rem", $marginBottom: "1.5rem", children: [
|
|
13058
|
-
/* @__PURE__ */
|
|
13141
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { $size: 14, children: t2("Credits") }) }),
|
|
13059
13142
|
addedCreditBundles.reduce(
|
|
13060
13143
|
(acc, bundle, index) => {
|
|
13061
13144
|
const price = typeof bundle.price?.priceDecimal === "string" ? Number(bundle.price.priceDecimal) : typeof bundle.price?.price === "number" ? bundle.price.price : void 0;
|
|
@@ -13070,19 +13153,19 @@ var Sidebar = ({
|
|
|
13070
13153
|
$gap: "1rem",
|
|
13071
13154
|
children: [
|
|
13072
13155
|
/* @__PURE__ */ jsxs9(Box, { children: [
|
|
13073
|
-
/* @__PURE__ */
|
|
13156
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs9(Text, { display: "heading4", children: [
|
|
13074
13157
|
bundle.name,
|
|
13075
13158
|
" (",
|
|
13076
13159
|
bundle.count,
|
|
13077
13160
|
")"
|
|
13078
13161
|
] }) }),
|
|
13079
|
-
/* @__PURE__ */
|
|
13162
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13080
13163
|
amount,
|
|
13081
13164
|
" ",
|
|
13082
13165
|
getFeatureName(bundle, amount)
|
|
13083
13166
|
] }) })
|
|
13084
13167
|
] }),
|
|
13085
|
-
bundle.count > 0 && /* @__PURE__ */
|
|
13168
|
+
bundle.count > 0 && /* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(
|
|
13086
13169
|
price * bundle.count,
|
|
13087
13170
|
bundle.price?.currency
|
|
13088
13171
|
) }) })
|
|
@@ -13096,7 +13179,7 @@ var Sidebar = ({
|
|
|
13096
13179
|
[]
|
|
13097
13180
|
)
|
|
13098
13181
|
] }),
|
|
13099
|
-
proration !== 0 && charges && selectedPlanCurrency && /* @__PURE__ */
|
|
13182
|
+
proration !== 0 && charges && selectedPlanCurrency && /* @__PURE__ */ jsx14(
|
|
13100
13183
|
Proration,
|
|
13101
13184
|
{
|
|
13102
13185
|
charges,
|
|
@@ -13123,7 +13206,7 @@ var Sidebar = ({
|
|
|
13123
13206
|
$alignItems: "center",
|
|
13124
13207
|
$gap: "1rem",
|
|
13125
13208
|
children: [
|
|
13126
|
-
/* @__PURE__ */
|
|
13209
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { children: t2("Discount") }) }),
|
|
13127
13210
|
/* @__PURE__ */ jsxs9(
|
|
13128
13211
|
Flex,
|
|
13129
13212
|
{
|
|
@@ -13134,15 +13217,15 @@ var Sidebar = ({
|
|
|
13134
13217
|
$outlineColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
|
|
13135
13218
|
$borderRadius: "0.3125rem",
|
|
13136
13219
|
children: [
|
|
13137
|
-
/* @__PURE__ */
|
|
13138
|
-
/* @__PURE__ */
|
|
13220
|
+
/* @__PURE__ */ jsx14(Text, { $size: 0.75 * settings.theme.typography.text.fontSize, children: promoCode }),
|
|
13221
|
+
/* @__PURE__ */ jsx14(
|
|
13139
13222
|
Box,
|
|
13140
13223
|
{
|
|
13141
13224
|
$cursor: "pointer",
|
|
13142
13225
|
onClick: () => {
|
|
13143
13226
|
updatePromoCode?.(null);
|
|
13144
13227
|
},
|
|
13145
|
-
children: /* @__PURE__ */
|
|
13228
|
+
children: /* @__PURE__ */ jsx14(
|
|
13146
13229
|
Icon3,
|
|
13147
13230
|
{
|
|
13148
13231
|
name: "close",
|
|
@@ -13165,8 +13248,8 @@ var Sidebar = ({
|
|
|
13165
13248
|
$alignItems: "center",
|
|
13166
13249
|
$gap: "1rem",
|
|
13167
13250
|
children: [
|
|
13168
|
-
/* @__PURE__ */
|
|
13169
|
-
/* @__PURE__ */
|
|
13251
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx14(Text, { children: t2("X% off", { percent: percentOff }) }) }),
|
|
13252
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(
|
|
13170
13253
|
newCharges / 100 * percentOff,
|
|
13171
13254
|
selectedPlanCurrency
|
|
13172
13255
|
) }) })
|
|
@@ -13180,13 +13263,13 @@ var Sidebar = ({
|
|
|
13180
13263
|
$alignItems: "center",
|
|
13181
13264
|
$gap: "1rem",
|
|
13182
13265
|
children: [
|
|
13183
|
-
/* @__PURE__ */
|
|
13266
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsx14(Text, { children: t2("X off", {
|
|
13184
13267
|
amount: formatCurrency(
|
|
13185
13268
|
Math.abs(amountOff),
|
|
13186
13269
|
selectedPlanCurrency
|
|
13187
13270
|
)
|
|
13188
13271
|
}) }) }),
|
|
13189
|
-
/* @__PURE__ */
|
|
13272
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13190
13273
|
"-",
|
|
13191
13274
|
formatCurrency(Math.abs(amountOff), selectedPlanCurrency)
|
|
13192
13275
|
] }) })
|
|
@@ -13200,11 +13283,11 @@ var Sidebar = ({
|
|
|
13200
13283
|
$alignItems: "center",
|
|
13201
13284
|
$gap: "1rem",
|
|
13202
13285
|
children: [
|
|
13203
|
-
/* @__PURE__ */
|
|
13286
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13204
13287
|
planPeriod === "year" ? t2("Yearly total") : t2("Monthly total"),
|
|
13205
13288
|
":"
|
|
13206
13289
|
] }) }),
|
|
13207
|
-
/* @__PURE__ */
|
|
13290
|
+
/* @__PURE__ */ jsx14(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13208
13291
|
subscriptionPrice,
|
|
13209
13292
|
/* @__PURE__ */ jsxs9("sub", { children: [
|
|
13210
13293
|
"/",
|
|
@@ -13221,22 +13304,22 @@ var Sidebar = ({
|
|
|
13221
13304
|
$alignItems: "center",
|
|
13222
13305
|
$gap: "1rem",
|
|
13223
13306
|
children: [
|
|
13224
|
-
/* @__PURE__ */
|
|
13307
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13225
13308
|
t2("Due today"),
|
|
13226
13309
|
":"
|
|
13227
13310
|
] }) }),
|
|
13228
|
-
/* @__PURE__ */
|
|
13311
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(Math.max(0, dueNow), selectedPlanCurrency) }) })
|
|
13229
13312
|
]
|
|
13230
13313
|
}
|
|
13231
13314
|
),
|
|
13232
13315
|
dueNow < 0 && /* @__PURE__ */ jsxs9(Flex, { $justifyContent: "space-between", $gap: "1rem", children: [
|
|
13233
|
-
/* @__PURE__ */
|
|
13316
|
+
/* @__PURE__ */ jsx14(Box, { $opacity: "0.625", $lineHeight: 1.15, children: /* @__PURE__ */ jsxs9(Text, { children: [
|
|
13234
13317
|
t2("Credits to be applied to future invoices"),
|
|
13235
13318
|
":"
|
|
13236
13319
|
] }) }),
|
|
13237
|
-
/* @__PURE__ */
|
|
13320
|
+
/* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { children: formatCurrency(Math.abs(dueNow), selectedPlanCurrency) }) })
|
|
13238
13321
|
] }),
|
|
13239
|
-
layout === "checkout" && /* @__PURE__ */
|
|
13322
|
+
layout === "checkout" && /* @__PURE__ */ jsx14(
|
|
13240
13323
|
StageButton,
|
|
13241
13324
|
{
|
|
13242
13325
|
checkout: handleCheckout,
|
|
@@ -13257,7 +13340,7 @@ var Sidebar = ({
|
|
|
13257
13340
|
willTrialWithoutPaymentMethod
|
|
13258
13341
|
}
|
|
13259
13342
|
),
|
|
13260
|
-
layout === "unsubscribe" && /* @__PURE__ */
|
|
13343
|
+
layout === "unsubscribe" && /* @__PURE__ */ jsx14(
|
|
13261
13344
|
Button,
|
|
13262
13345
|
{
|
|
13263
13346
|
type: "button",
|
|
@@ -13267,8 +13350,8 @@ var Sidebar = ({
|
|
|
13267
13350
|
children: t2("Cancel subscription")
|
|
13268
13351
|
}
|
|
13269
13352
|
),
|
|
13270
|
-
!isLoading && error && /* @__PURE__ */
|
|
13271
|
-
layout !== "unsubscribe" && /* @__PURE__ */
|
|
13353
|
+
!isLoading && error && /* @__PURE__ */ jsx14(Box, { children: /* @__PURE__ */ jsx14(Text, { $weight: 500, $color: "#DB6669", children: error }) }),
|
|
13354
|
+
layout !== "unsubscribe" && /* @__PURE__ */ jsx14(Box, { $opacity: "0.625", children: /* @__PURE__ */ jsx14(Text, { children: subscriptionPrice && // TODO: localize
|
|
13272
13355
|
`You will be billed ${subscriptionPrice} ${usageBasedEntitlements.length > 0 ? "plus usage based costs" : ""} for this subscription
|
|
13273
13356
|
every ${planPeriod} ${periodStart ? `on the ${formatOrdinal(periodStart.getDate())}` : ""} ${planPeriod === "year" && periodStart ? `of ${getMonthName(periodStart)}` : ""} unless you unsubscribe.` }) })
|
|
13274
13357
|
]
|
|
@@ -13280,13 +13363,13 @@ var Sidebar = ({
|
|
|
13280
13363
|
};
|
|
13281
13364
|
|
|
13282
13365
|
// src/components/shared/checkout-dialog/AddOns.tsx
|
|
13283
|
-
import { Fragment as Fragment5, jsx as
|
|
13366
|
+
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
13284
13367
|
var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
13285
13368
|
const { t: t2 } = useTranslation();
|
|
13286
13369
|
const { settings } = useEmbed();
|
|
13287
13370
|
const periodKey = period === "year" ? "yearlyPrice" : "monthlyPrice";
|
|
13288
13371
|
const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
13289
|
-
return /* @__PURE__ */
|
|
13372
|
+
return /* @__PURE__ */ jsx15(
|
|
13290
13373
|
Box,
|
|
13291
13374
|
{
|
|
13292
13375
|
$display: "grid",
|
|
@@ -13329,12 +13412,12 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13329
13412
|
},
|
|
13330
13413
|
children: [
|
|
13331
13414
|
/* @__PURE__ */ jsxs10(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
|
|
13332
|
-
/* @__PURE__ */
|
|
13333
|
-
addOn.description && /* @__PURE__ */
|
|
13415
|
+
/* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsx15(Text, { display: "heading3", children: addOn.name }) }),
|
|
13416
|
+
addOn.description && /* @__PURE__ */ jsx15(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx15(Text, { children: addOn.description }) }),
|
|
13334
13417
|
(addOn[periodKey] || addOn.chargeType === ChargeType.oneTime) && /* @__PURE__ */ jsxs10(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
|
|
13335
13418
|
/* @__PURE__ */ jsxs10(Box, { children: [
|
|
13336
|
-
/* @__PURE__ */
|
|
13337
|
-
/* @__PURE__ */
|
|
13419
|
+
/* @__PURE__ */ jsx15(Text, { display: "heading2", children: formatCurrency(price ?? 0, currency) }),
|
|
13420
|
+
/* @__PURE__ */ jsx15(
|
|
13338
13421
|
Text,
|
|
13339
13422
|
{
|
|
13340
13423
|
display: "heading2",
|
|
@@ -13346,7 +13429,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13346
13429
|
}
|
|
13347
13430
|
)
|
|
13348
13431
|
] }),
|
|
13349
|
-
overageInfo && overageInfo.softLimit && /* @__PURE__ */
|
|
13432
|
+
overageInfo && overageInfo.softLimit && /* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsxs10(Text, { $size: 0.875, style: { opacity: 0.8 }, children: [
|
|
13350
13433
|
overageInfo.softLimit,
|
|
13351
13434
|
" ",
|
|
13352
13435
|
overageInfo.featureName || "units",
|
|
@@ -13360,7 +13443,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13360
13443
|
overageInfo.featureName?.toLowerCase() || "unit"
|
|
13361
13444
|
] }) })
|
|
13362
13445
|
] }),
|
|
13363
|
-
isAddOnCurrent && /* @__PURE__ */
|
|
13446
|
+
isAddOnCurrent && /* @__PURE__ */ jsx15(
|
|
13364
13447
|
Flex,
|
|
13365
13448
|
{
|
|
13366
13449
|
$position: "absolute",
|
|
@@ -13369,7 +13452,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13369
13452
|
$backgroundColor: settings.theme.primary,
|
|
13370
13453
|
$borderRadius: "9999px",
|
|
13371
13454
|
$padding: "0.125rem 0.85rem",
|
|
13372
|
-
children: /* @__PURE__ */
|
|
13455
|
+
children: /* @__PURE__ */ jsx15(
|
|
13373
13456
|
Text,
|
|
13374
13457
|
{
|
|
13375
13458
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -13380,7 +13463,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13380
13463
|
}
|
|
13381
13464
|
)
|
|
13382
13465
|
] }),
|
|
13383
|
-
/* @__PURE__ */
|
|
13466
|
+
/* @__PURE__ */ jsx15(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: !addOn.isSelected ? /* @__PURE__ */ jsx15(
|
|
13384
13467
|
Button,
|
|
13385
13468
|
{
|
|
13386
13469
|
type: "button",
|
|
@@ -13392,7 +13475,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13392
13475
|
$fullWidth: true,
|
|
13393
13476
|
children: t2("Choose add-on")
|
|
13394
13477
|
}
|
|
13395
|
-
) : /* @__PURE__ */
|
|
13478
|
+
) : /* @__PURE__ */ jsx15(
|
|
13396
13479
|
Button,
|
|
13397
13480
|
{
|
|
13398
13481
|
type: "button",
|
|
@@ -13403,7 +13486,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13403
13486
|
$variant: isAddOnCurrent ? "ghost" : "text",
|
|
13404
13487
|
$fullWidth: true,
|
|
13405
13488
|
children: isAddOnCurrent ? t2("Remove add-on") : /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
13406
|
-
/* @__PURE__ */
|
|
13489
|
+
/* @__PURE__ */ jsx15(Icon3, { name: "check-rounded", size: "sm" }),
|
|
13407
13490
|
t2("Selected")
|
|
13408
13491
|
] })
|
|
13409
13492
|
}
|
|
@@ -13419,7 +13502,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
13419
13502
|
|
|
13420
13503
|
// src/components/shared/checkout-dialog/Checkout.tsx
|
|
13421
13504
|
import { useState as useState7 } from "react";
|
|
13422
|
-
import { Fragment as Fragment6, jsx as
|
|
13505
|
+
import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
13423
13506
|
var Checkout = ({
|
|
13424
13507
|
isPaymentMethodRequired,
|
|
13425
13508
|
setPaymentMethodId,
|
|
@@ -13432,9 +13515,9 @@ var Checkout = ({
|
|
|
13432
13515
|
return null;
|
|
13433
13516
|
}
|
|
13434
13517
|
return /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
13435
|
-
/* @__PURE__ */
|
|
13518
|
+
/* @__PURE__ */ jsx16(PaymentMethodDetails, { setPaymentMethodId }),
|
|
13436
13519
|
/* @__PURE__ */ jsxs11(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
13437
|
-
/* @__PURE__ */
|
|
13520
|
+
/* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsx16(Text, { display: "heading4", children: t2("Discount") }) }),
|
|
13438
13521
|
/* @__PURE__ */ jsxs11(
|
|
13439
13522
|
Flex,
|
|
13440
13523
|
{
|
|
@@ -13443,7 +13526,7 @@ var Checkout = ({
|
|
|
13443
13526
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.0625)" : "hsla(0, 0%, 100%, 0.125)",
|
|
13444
13527
|
$borderRadius: "9999px",
|
|
13445
13528
|
children: [
|
|
13446
|
-
/* @__PURE__ */
|
|
13529
|
+
/* @__PURE__ */ jsx16(Box, { $flexGrow: 1, children: /* @__PURE__ */ jsx16(
|
|
13447
13530
|
Input,
|
|
13448
13531
|
{
|
|
13449
13532
|
$size: "full",
|
|
@@ -13465,7 +13548,7 @@ var Checkout = ({
|
|
|
13465
13548
|
}
|
|
13466
13549
|
}
|
|
13467
13550
|
) }),
|
|
13468
|
-
/* @__PURE__ */
|
|
13551
|
+
/* @__PURE__ */ jsx16(Box, { $flexShrink: 0, $padding: "0.5rem 1rem", children: /* @__PURE__ */ jsx16(
|
|
13469
13552
|
Text,
|
|
13470
13553
|
{
|
|
13471
13554
|
onClick: () => updatePromoCode(discount),
|
|
@@ -13482,11 +13565,11 @@ var Checkout = ({
|
|
|
13482
13565
|
};
|
|
13483
13566
|
|
|
13484
13567
|
// src/components/shared/checkout-dialog/Credits.tsx
|
|
13485
|
-
import { jsx as
|
|
13568
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
13486
13569
|
var Credits = ({ bundles, updateCount }) => {
|
|
13487
13570
|
const { settings } = useEmbed();
|
|
13488
13571
|
const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
13489
|
-
return /* @__PURE__ */
|
|
13572
|
+
return /* @__PURE__ */ jsx17(
|
|
13490
13573
|
Box,
|
|
13491
13574
|
{
|
|
13492
13575
|
$display: "grid",
|
|
@@ -13510,16 +13593,16 @@ var Credits = ({ bundles, updateCount }) => {
|
|
|
13510
13593
|
children: [
|
|
13511
13594
|
/* @__PURE__ */ jsxs12(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
|
|
13512
13595
|
/* @__PURE__ */ jsxs12(Box, { children: [
|
|
13513
|
-
/* @__PURE__ */
|
|
13514
|
-
/* @__PURE__ */
|
|
13596
|
+
/* @__PURE__ */ jsx17(Box, { children: /* @__PURE__ */ jsx17(Text, { display: "heading3", children: bundle.name }) }),
|
|
13597
|
+
/* @__PURE__ */ jsx17(Box, { children: /* @__PURE__ */ jsxs12(Text, { display: "heading6", children: [
|
|
13515
13598
|
bundle.quantity ?? 0,
|
|
13516
13599
|
" ",
|
|
13517
13600
|
getFeatureName(bundle)
|
|
13518
13601
|
] }) })
|
|
13519
13602
|
] }),
|
|
13520
|
-
typeof price === "number" && /* @__PURE__ */
|
|
13603
|
+
typeof price === "number" && /* @__PURE__ */ jsx17(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx17(Text, { children: formatCurrency(price, bundle.price?.currency) }) })
|
|
13521
13604
|
] }),
|
|
13522
|
-
/* @__PURE__ */
|
|
13605
|
+
/* @__PURE__ */ jsx17(Flex, { $flexDirection: "column", $justifyContent: "end", $flexGrow: "1", children: /* @__PURE__ */ jsx17(
|
|
13523
13606
|
Input,
|
|
13524
13607
|
{
|
|
13525
13608
|
$size: "lg",
|
|
@@ -13549,7 +13632,7 @@ var Credits = ({ bundles, updateCount }) => {
|
|
|
13549
13632
|
};
|
|
13550
13633
|
|
|
13551
13634
|
// src/components/shared/checkout-dialog/Navigation.tsx
|
|
13552
|
-
import { Fragment as Fragment7, jsx as
|
|
13635
|
+
import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
13553
13636
|
var Navigation = ({
|
|
13554
13637
|
name,
|
|
13555
13638
|
index,
|
|
@@ -13561,7 +13644,7 @@ var Navigation = ({
|
|
|
13561
13644
|
const isLightBackground = useIsLightBackground();
|
|
13562
13645
|
return /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
13563
13646
|
/* @__PURE__ */ jsxs13(Flex, { $gap: "0.5rem", $alignItems: "center", children: [
|
|
13564
|
-
/* @__PURE__ */
|
|
13647
|
+
/* @__PURE__ */ jsx18(
|
|
13565
13648
|
Box,
|
|
13566
13649
|
{
|
|
13567
13650
|
$display: "none",
|
|
@@ -13570,7 +13653,7 @@ var Navigation = ({
|
|
|
13570
13653
|
$display: "block"
|
|
13571
13654
|
}
|
|
13572
13655
|
},
|
|
13573
|
-
children: index >= activeIndex ? /* @__PURE__ */
|
|
13656
|
+
children: index >= activeIndex ? /* @__PURE__ */ jsx18(
|
|
13574
13657
|
Box,
|
|
13575
13658
|
{
|
|
13576
13659
|
$width: `${20 / TEXT_BASE_SIZE}rem`,
|
|
@@ -13580,7 +13663,7 @@ var Navigation = ({
|
|
|
13580
13663
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.125)" : "hsla(0, 0%, 100%, 0.25)",
|
|
13581
13664
|
$borderRadius: "9999px"
|
|
13582
13665
|
}
|
|
13583
|
-
) : /* @__PURE__ */
|
|
13666
|
+
) : /* @__PURE__ */ jsx18(
|
|
13584
13667
|
Icon3,
|
|
13585
13668
|
{
|
|
13586
13669
|
name: "check",
|
|
@@ -13619,7 +13702,7 @@ var Navigation = ({
|
|
|
13619
13702
|
}
|
|
13620
13703
|
)
|
|
13621
13704
|
] }),
|
|
13622
|
-
!isLast && /* @__PURE__ */
|
|
13705
|
+
!isLast && /* @__PURE__ */ jsx18(
|
|
13623
13706
|
Icon3,
|
|
13624
13707
|
{
|
|
13625
13708
|
name: "chevron-right",
|
|
@@ -13634,7 +13717,7 @@ var Navigation = ({
|
|
|
13634
13717
|
|
|
13635
13718
|
// src/components/shared/checkout-dialog/Plan.tsx
|
|
13636
13719
|
import { useEffect as useEffect4, useMemo as useMemo8, useState as useState8 } from "react";
|
|
13637
|
-
import { Fragment as Fragment8, jsx as
|
|
13720
|
+
import { Fragment as Fragment8, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
13638
13721
|
var Selected = ({ isCurrent = false, isTrial = false }) => {
|
|
13639
13722
|
const { t: t2 } = useTranslation();
|
|
13640
13723
|
const { settings } = useEmbed();
|
|
@@ -13652,8 +13735,8 @@ var Selected = ({ isCurrent = false, isTrial = false }) => {
|
|
|
13652
13735
|
$gap: "0.25rem",
|
|
13653
13736
|
$padding: "0.625rem 0",
|
|
13654
13737
|
children: [
|
|
13655
|
-
/* @__PURE__ */
|
|
13656
|
-
/* @__PURE__ */
|
|
13738
|
+
/* @__PURE__ */ jsx19(Icon3, { name: "check-rounded", color: settings.theme.primary }),
|
|
13739
|
+
/* @__PURE__ */ jsx19(
|
|
13657
13740
|
Text,
|
|
13658
13741
|
{
|
|
13659
13742
|
$size: 0.9375 * settings.theme.typography.text.fontSize,
|
|
@@ -13690,7 +13773,7 @@ var PlanButtonGroup = ({
|
|
|
13690
13773
|
}, [data, plan]);
|
|
13691
13774
|
if (isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable) {
|
|
13692
13775
|
return /* @__PURE__ */ jsxs14(Flex, { $flexDirection: "column", $gap: "1.5rem", children: [
|
|
13693
|
-
!isTrialing && /* @__PURE__ */
|
|
13776
|
+
!isTrialing && /* @__PURE__ */ jsx19(Fragment8, { children: isSelected && shouldTrial ? /* @__PURE__ */ jsx19(Selected, { isCurrent: isCurrentPlan, isTrial: shouldTrial }) : /* @__PURE__ */ jsx19(
|
|
13694
13777
|
Button,
|
|
13695
13778
|
{
|
|
13696
13779
|
type: "button",
|
|
@@ -13712,16 +13795,16 @@ var PlanButtonGroup = ({
|
|
|
13712
13795
|
$color: "primary",
|
|
13713
13796
|
$variant: "filled",
|
|
13714
13797
|
$fullWidth: true,
|
|
13715
|
-
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */
|
|
13798
|
+
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ jsx19(
|
|
13716
13799
|
Tooltip,
|
|
13717
13800
|
{
|
|
13718
|
-
trigger: /* @__PURE__ */
|
|
13719
|
-
content: /* @__PURE__ */
|
|
13801
|
+
trigger: /* @__PURE__ */ jsx19(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
|
|
13802
|
+
content: /* @__PURE__ */ jsx19(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
13720
13803
|
}
|
|
13721
13804
|
) : t2("Start X day trial", { days: plan.trialDays })
|
|
13722
13805
|
}
|
|
13723
13806
|
) }),
|
|
13724
|
-
!plan.custom && /* @__PURE__ */
|
|
13807
|
+
!plan.custom && /* @__PURE__ */ jsx19(Fragment8, { children: isSelected && (!shouldTrial || isTrialing) ? /* @__PURE__ */ jsx19(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ jsx19(
|
|
13725
13808
|
Button,
|
|
13726
13809
|
{
|
|
13727
13810
|
type: "button",
|
|
@@ -13733,18 +13816,18 @@ var PlanButtonGroup = ({
|
|
|
13733
13816
|
$color: "primary",
|
|
13734
13817
|
$variant: isTrialing ? "filled" : "text",
|
|
13735
13818
|
$fullWidth: true,
|
|
13736
|
-
children: !isValidPlan ? /* @__PURE__ */
|
|
13819
|
+
children: !isValidPlan ? /* @__PURE__ */ jsx19(
|
|
13737
13820
|
Tooltip,
|
|
13738
13821
|
{
|
|
13739
|
-
trigger: /* @__PURE__ */
|
|
13740
|
-
content: /* @__PURE__ */
|
|
13822
|
+
trigger: /* @__PURE__ */ jsx19(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
|
|
13823
|
+
content: /* @__PURE__ */ jsx19(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
13741
13824
|
}
|
|
13742
13825
|
) : t2("Choose plan")
|
|
13743
13826
|
}
|
|
13744
13827
|
) })
|
|
13745
13828
|
] });
|
|
13746
13829
|
}
|
|
13747
|
-
return isSelected ? /* @__PURE__ */
|
|
13830
|
+
return isSelected ? /* @__PURE__ */ jsx19(Selected, { isCurrent: isCurrentPlan }) : /* @__PURE__ */ jsx19(
|
|
13748
13831
|
Button,
|
|
13749
13832
|
{
|
|
13750
13833
|
type: "button",
|
|
@@ -13763,11 +13846,11 @@ var PlanButtonGroup = ({
|
|
|
13763
13846
|
$color: "primary",
|
|
13764
13847
|
$variant: "filled",
|
|
13765
13848
|
$fullWidth: true,
|
|
13766
|
-
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */
|
|
13849
|
+
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : !isValidPlan ? /* @__PURE__ */ jsx19(
|
|
13767
13850
|
Tooltip,
|
|
13768
13851
|
{
|
|
13769
|
-
trigger: /* @__PURE__ */
|
|
13770
|
-
content: /* @__PURE__ */
|
|
13852
|
+
trigger: /* @__PURE__ */ jsx19(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
|
|
13853
|
+
content: /* @__PURE__ */ jsx19(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
13771
13854
|
}
|
|
13772
13855
|
) : t2("Choose plan")
|
|
13773
13856
|
}
|
|
@@ -13811,7 +13894,7 @@ var Plan = ({
|
|
|
13811
13894
|
setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
|
|
13812
13895
|
}, [plans]);
|
|
13813
13896
|
const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
13814
|
-
return /* @__PURE__ */
|
|
13897
|
+
return /* @__PURE__ */ jsx19(
|
|
13815
13898
|
Box,
|
|
13816
13899
|
{
|
|
13817
13900
|
$display: "grid",
|
|
@@ -13826,7 +13909,7 @@ var Plan = ({
|
|
|
13826
13909
|
(entitlement) => !!entitlement.priceBehavior
|
|
13827
13910
|
);
|
|
13828
13911
|
const isUsageBasedPlan = planPrice === 0 && hasUsageBasedEntitlements;
|
|
13829
|
-
const headerPriceFontStyle =
|
|
13912
|
+
const headerPriceFontStyle = settings.theme.typography.heading2;
|
|
13830
13913
|
const count = entitlementCounts[plan.id];
|
|
13831
13914
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
13832
13915
|
return /* @__PURE__ */ jsxs14(
|
|
@@ -13860,10 +13943,10 @@ var Plan = ({
|
|
|
13860
13943
|
}
|
|
13861
13944
|
},
|
|
13862
13945
|
children: [
|
|
13863
|
-
/* @__PURE__ */
|
|
13864
|
-
/* @__PURE__ */
|
|
13946
|
+
/* @__PURE__ */ jsx19(Box, { children: /* @__PURE__ */ jsx19(Text, { display: "heading2", children: plan.name }) }),
|
|
13947
|
+
/* @__PURE__ */ jsx19(Box, { $marginBottom: "0.5rem", $lineHeight: 1.35, children: /* @__PURE__ */ jsx19(Text, { children: plan.description }) }),
|
|
13865
13948
|
/* @__PURE__ */ jsxs14(Box, { children: [
|
|
13866
|
-
/* @__PURE__ */
|
|
13949
|
+
/* @__PURE__ */ jsx19(
|
|
13867
13950
|
Text,
|
|
13868
13951
|
{
|
|
13869
13952
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -13885,7 +13968,7 @@ var Plan = ({
|
|
|
13885
13968
|
}
|
|
13886
13969
|
)
|
|
13887
13970
|
] }),
|
|
13888
|
-
credits.length > 0 && /* @__PURE__ */
|
|
13971
|
+
credits.length > 0 && /* @__PURE__ */ jsx19(
|
|
13889
13972
|
Flex,
|
|
13890
13973
|
{
|
|
13891
13974
|
$flexDirection: "column",
|
|
@@ -13893,7 +13976,7 @@ var Plan = ({
|
|
|
13893
13976
|
$flexGrow: 1,
|
|
13894
13977
|
$marginTop: "0.5rem",
|
|
13895
13978
|
children: credits.map((credit, creditIndex) => {
|
|
13896
|
-
return /* @__PURE__ */
|
|
13979
|
+
return /* @__PURE__ */ jsx19(
|
|
13897
13980
|
Flex,
|
|
13898
13981
|
{
|
|
13899
13982
|
$flexWrap: "wrap",
|
|
@@ -13901,7 +13984,7 @@ var Plan = ({
|
|
|
13901
13984
|
$alignItems: "center",
|
|
13902
13985
|
$gap: "1rem",
|
|
13903
13986
|
children: /* @__PURE__ */ jsxs14(Flex, { $gap: "1rem", children: [
|
|
13904
|
-
credit.icon && /* @__PURE__ */
|
|
13987
|
+
credit.icon && /* @__PURE__ */ jsx19(
|
|
13905
13988
|
Icon3,
|
|
13906
13989
|
{
|
|
13907
13990
|
name: credit.icon,
|
|
@@ -13910,7 +13993,7 @@ var Plan = ({
|
|
|
13910
13993
|
rounded: true
|
|
13911
13994
|
}
|
|
13912
13995
|
),
|
|
13913
|
-
/* @__PURE__ */
|
|
13996
|
+
/* @__PURE__ */ jsx19(
|
|
13914
13997
|
Flex,
|
|
13915
13998
|
{
|
|
13916
13999
|
$flexDirection: "column",
|
|
@@ -13936,7 +14019,7 @@ var Plan = ({
|
|
|
13936
14019
|
})
|
|
13937
14020
|
}
|
|
13938
14021
|
),
|
|
13939
|
-
isHydratedPlan(plan) && plan.current && /* @__PURE__ */
|
|
14022
|
+
isHydratedPlan(plan) && plan.current && /* @__PURE__ */ jsx19(
|
|
13940
14023
|
Flex,
|
|
13941
14024
|
{
|
|
13942
14025
|
$position: "absolute",
|
|
@@ -13945,7 +14028,7 @@ var Plan = ({
|
|
|
13945
14028
|
$backgroundColor: settings.theme.primary,
|
|
13946
14029
|
$borderRadius: "9999px",
|
|
13947
14030
|
$padding: "0.125rem 0.85rem",
|
|
13948
|
-
children: /* @__PURE__ */
|
|
14031
|
+
children: /* @__PURE__ */ jsx19(
|
|
13949
14032
|
Text,
|
|
13950
14033
|
{
|
|
13951
14034
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -13978,7 +14061,7 @@ var Plan = ({
|
|
|
13978
14061
|
packageSize: entitlementPackageSize = 1
|
|
13979
14062
|
} = getEntitlementPrice(entitlement, planPeriod) || {};
|
|
13980
14063
|
const metricPeriodName = getMetricPeriodName(entitlement);
|
|
13981
|
-
return /* @__PURE__ */
|
|
14064
|
+
return /* @__PURE__ */ jsx19(
|
|
13982
14065
|
Flex,
|
|
13983
14066
|
{
|
|
13984
14067
|
$flexWrap: "wrap",
|
|
@@ -13986,7 +14069,7 @@ var Plan = ({
|
|
|
13986
14069
|
$alignItems: "center",
|
|
13987
14070
|
$gap: "1rem",
|
|
13988
14071
|
children: /* @__PURE__ */ jsxs14(Flex, { $gap: "1rem", children: [
|
|
13989
|
-
entitlement.feature?.icon && /* @__PURE__ */
|
|
14072
|
+
entitlement.feature?.icon && /* @__PURE__ */ jsx19(
|
|
13990
14073
|
Icon3,
|
|
13991
14074
|
{
|
|
13992
14075
|
name: entitlement.feature.icon,
|
|
@@ -14002,7 +14085,7 @@ var Plan = ({
|
|
|
14002
14085
|
$justifyContent: "center",
|
|
14003
14086
|
$gap: "0.5rem",
|
|
14004
14087
|
children: [
|
|
14005
|
-
/* @__PURE__ */
|
|
14088
|
+
/* @__PURE__ */ jsx19(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
14006
14089
|
formatCurrency(
|
|
14007
14090
|
entitlementPrice,
|
|
14008
14091
|
entitlementCurrency
|
|
@@ -14024,7 +14107,7 @@ var Plan = ({
|
|
|
14024
14107
|
" ",
|
|
14025
14108
|
planPeriod
|
|
14026
14109
|
] })
|
|
14027
|
-
] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */
|
|
14110
|
+
] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx19(
|
|
14028
14111
|
TieredPricingDetails,
|
|
14029
14112
|
{
|
|
14030
14113
|
entitlement,
|
|
@@ -14061,51 +14144,59 @@ var Plan = ({
|
|
|
14061
14144
|
t2(metricPeriodName)
|
|
14062
14145
|
] })
|
|
14063
14146
|
] }) : entitlement.feature.name }),
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
{
|
|
14067
|
-
style: { opacity: 0.54 },
|
|
14068
|
-
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
14069
|
-
$color: settings.theme.typography.text.color,
|
|
14070
|
-
children: [
|
|
14071
|
-
t2("then"),
|
|
14072
|
-
" ",
|
|
14073
|
-
formatCurrency(
|
|
14074
|
-
entitlementPrice,
|
|
14075
|
-
entitlementCurrency
|
|
14076
|
-
),
|
|
14077
|
-
"/",
|
|
14078
|
-
entitlementPackageSize > 1 && /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
14079
|
-
entitlementPackageSize,
|
|
14080
|
-
" "
|
|
14081
|
-
] }),
|
|
14082
|
-
getFeatureName(
|
|
14083
|
-
entitlement.feature,
|
|
14084
|
-
entitlementPackageSize
|
|
14085
|
-
),
|
|
14086
|
-
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
14087
|
-
"/",
|
|
14088
|
-
shortenPeriod(planPeriod)
|
|
14089
|
-
] })
|
|
14090
|
-
]
|
|
14091
|
-
}
|
|
14092
|
-
) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs14(Flex, { $alignItems: "center", children: [
|
|
14093
|
-
/* @__PURE__ */ jsx18(
|
|
14094
|
-
PricingTiersTooltip,
|
|
14095
|
-
{
|
|
14096
|
-
feature: entitlement.feature,
|
|
14097
|
-
period: planPeriod,
|
|
14098
|
-
currency: entitlementCurrency,
|
|
14099
|
-
priceTiers: entitlementPriceTiers
|
|
14100
|
-
}
|
|
14101
|
-
),
|
|
14102
|
-
/* @__PURE__ */ jsx18(
|
|
14147
|
+
/* @__PURE__ */ jsxs14(Flex, { $alignItems: "end", children: [
|
|
14148
|
+
entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsxs14(
|
|
14103
14149
|
Text,
|
|
14104
14150
|
{
|
|
14105
14151
|
style: { opacity: 0.54 },
|
|
14106
14152
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
14107
14153
|
$color: settings.theme.typography.text.color,
|
|
14108
|
-
children:
|
|
14154
|
+
children: [
|
|
14155
|
+
t2("then"),
|
|
14156
|
+
" ",
|
|
14157
|
+
formatCurrency(
|
|
14158
|
+
entitlementPrice,
|
|
14159
|
+
entitlementCurrency
|
|
14160
|
+
),
|
|
14161
|
+
"/",
|
|
14162
|
+
entitlementPackageSize > 1 && /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
14163
|
+
entitlementPackageSize,
|
|
14164
|
+
" "
|
|
14165
|
+
] }),
|
|
14166
|
+
getFeatureName(
|
|
14167
|
+
entitlement.feature,
|
|
14168
|
+
entitlementPackageSize
|
|
14169
|
+
),
|
|
14170
|
+
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
14171
|
+
"/",
|
|
14172
|
+
shortenPeriod(planPeriod)
|
|
14173
|
+
] })
|
|
14174
|
+
]
|
|
14175
|
+
}
|
|
14176
|
+
) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs14(Flex, { $alignItems: "end", children: [
|
|
14177
|
+
/* @__PURE__ */ jsx19(
|
|
14178
|
+
Text,
|
|
14179
|
+
{
|
|
14180
|
+
style: { opacity: 0.54 },
|
|
14181
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
14182
|
+
$color: settings.theme.typography.text.color,
|
|
14183
|
+
children: t2("Tier-based")
|
|
14184
|
+
}
|
|
14185
|
+
),
|
|
14186
|
+
/* @__PURE__ */ jsx19(
|
|
14187
|
+
PricingTiersTooltip,
|
|
14188
|
+
{
|
|
14189
|
+
feature: entitlement.feature,
|
|
14190
|
+
period: planPeriod,
|
|
14191
|
+
currency: entitlementCurrency,
|
|
14192
|
+
priceTiers: entitlementPriceTiers
|
|
14193
|
+
}
|
|
14194
|
+
)
|
|
14195
|
+
] }),
|
|
14196
|
+
entitlement.billingThreshold && /* @__PURE__ */ jsx19(
|
|
14197
|
+
BillingThresholdTooltip,
|
|
14198
|
+
{
|
|
14199
|
+
billingThreshold: entitlement.billingThreshold
|
|
14109
14200
|
}
|
|
14110
14201
|
)
|
|
14111
14202
|
] })
|
|
@@ -14125,14 +14216,14 @@ var Plan = ({
|
|
|
14125
14216
|
$gap: "0.5rem",
|
|
14126
14217
|
$marginTop: "1rem",
|
|
14127
14218
|
children: [
|
|
14128
|
-
/* @__PURE__ */
|
|
14219
|
+
/* @__PURE__ */ jsx19(
|
|
14129
14220
|
Icon3,
|
|
14130
14221
|
{
|
|
14131
14222
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
14132
14223
|
color: "#D0D0D0"
|
|
14133
14224
|
}
|
|
14134
14225
|
),
|
|
14135
|
-
/* @__PURE__ */
|
|
14226
|
+
/* @__PURE__ */ jsx19(
|
|
14136
14227
|
Text,
|
|
14137
14228
|
{
|
|
14138
14229
|
onClick: () => handleToggleShowAll(plan.id),
|
|
@@ -14152,7 +14243,7 @@ var Plan = ({
|
|
|
14152
14243
|
}
|
|
14153
14244
|
)
|
|
14154
14245
|
] }),
|
|
14155
|
-
/* @__PURE__ */
|
|
14246
|
+
/* @__PURE__ */ jsx19(
|
|
14156
14247
|
PlanButtonGroup,
|
|
14157
14248
|
{
|
|
14158
14249
|
plan,
|
|
@@ -14175,13 +14266,13 @@ var Plan = ({
|
|
|
14175
14266
|
};
|
|
14176
14267
|
|
|
14177
14268
|
// src/components/shared/checkout-dialog/Usage.tsx
|
|
14178
|
-
import { Fragment as Fragment9, jsx as
|
|
14269
|
+
import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
14179
14270
|
var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
14180
14271
|
const { settings } = useEmbed();
|
|
14181
14272
|
const { t: t2 } = useTranslation();
|
|
14182
14273
|
const cardPadding = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
14183
14274
|
const unitPriceFontSize = 0.875 * settings.theme.typography.text.fontSize;
|
|
14184
|
-
return /* @__PURE__ */
|
|
14275
|
+
return /* @__PURE__ */ jsx20(Flex, { $flexDirection: "column", $gap: "1rem", children: entitlements.reduce((acc, entitlement, index) => {
|
|
14185
14276
|
if (entitlement.feature) {
|
|
14186
14277
|
const {
|
|
14187
14278
|
price,
|
|
@@ -14209,8 +14300,8 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14209
14300
|
$gap: "0.75rem",
|
|
14210
14301
|
$flexBasis: `calc(${100 / 3}% - 0.375rem)`,
|
|
14211
14302
|
children: [
|
|
14212
|
-
/* @__PURE__ */
|
|
14213
|
-
entitlement.feature.description && /* @__PURE__ */
|
|
14303
|
+
/* @__PURE__ */ jsx20(Box, { children: /* @__PURE__ */ jsx20(Text, { display: "heading2", children: entitlement.feature.name }) }),
|
|
14304
|
+
entitlement.feature.description && /* @__PURE__ */ jsx20(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx20(Text, { children: entitlement.feature.description }) })
|
|
14214
14305
|
]
|
|
14215
14306
|
}
|
|
14216
14307
|
),
|
|
@@ -14221,7 +14312,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14221
14312
|
$gap: "0.5rem",
|
|
14222
14313
|
$flexBasis: `calc(${100 / 3}% - 0.375rem)`,
|
|
14223
14314
|
children: [
|
|
14224
|
-
/* @__PURE__ */
|
|
14315
|
+
/* @__PURE__ */ jsx20(
|
|
14225
14316
|
Input,
|
|
14226
14317
|
{
|
|
14227
14318
|
$size: "lg",
|
|
@@ -14241,7 +14332,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14241
14332
|
}
|
|
14242
14333
|
}
|
|
14243
14334
|
),
|
|
14244
|
-
/* @__PURE__ */
|
|
14335
|
+
/* @__PURE__ */ jsx20(
|
|
14245
14336
|
Text,
|
|
14246
14337
|
{
|
|
14247
14338
|
style: { opacity: 0.54 },
|
|
@@ -14253,7 +14344,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14253
14344
|
})
|
|
14254
14345
|
}
|
|
14255
14346
|
),
|
|
14256
|
-
entitlement.quantity < entitlement.usage && /* @__PURE__ */
|
|
14347
|
+
entitlement.quantity < entitlement.usage && /* @__PURE__ */ jsx20(Text, { $size: unitPriceFontSize, $color: "#DB6669", children: t2("Cannot downgrade entitlement") })
|
|
14257
14348
|
]
|
|
14258
14349
|
}
|
|
14259
14350
|
),
|
|
@@ -14263,7 +14354,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14263
14354
|
$flexBasis: `calc(${100 / 3}% - 0.375rem)`,
|
|
14264
14355
|
$textAlign: "right",
|
|
14265
14356
|
children: [
|
|
14266
|
-
/* @__PURE__ */
|
|
14357
|
+
/* @__PURE__ */ jsx20(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs15(Text, { children: [
|
|
14267
14358
|
formatCurrency(
|
|
14268
14359
|
(price ?? 0) * entitlement.quantity,
|
|
14269
14360
|
currency
|
|
@@ -14273,7 +14364,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14273
14364
|
shortenPeriod(period)
|
|
14274
14365
|
] })
|
|
14275
14366
|
] }) }),
|
|
14276
|
-
/* @__PURE__ */
|
|
14367
|
+
/* @__PURE__ */ jsx20(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsxs15(
|
|
14277
14368
|
Text,
|
|
14278
14369
|
{
|
|
14279
14370
|
style: { opacity: 0.54 },
|
|
@@ -14308,7 +14399,7 @@ var Usage = ({ entitlements, updateQuantity, period }) => {
|
|
|
14308
14399
|
};
|
|
14309
14400
|
|
|
14310
14401
|
// src/components/shared/checkout-dialog/CheckoutDialog.tsx
|
|
14311
|
-
import { jsx as
|
|
14402
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
14312
14403
|
var createActiveUsageBasedEntitlementsReducer = (entitlements, period) => (acc, entitlement) => {
|
|
14313
14404
|
if (entitlement.priceBehavior && (period === "month" && entitlement.meteredMonthlyPrice || period === "year" && entitlement.meteredYearlyPrice)) {
|
|
14314
14405
|
const featureUsage = entitlements.find(
|
|
@@ -14663,19 +14754,22 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14663
14754
|
const entitlements = plan.entitlements.reduce(
|
|
14664
14755
|
(acc, entitlement) => {
|
|
14665
14756
|
if (entitlement.priceBehavior && (period === "month" && entitlement.meteredMonthlyPrice || period === "year" && entitlement.meteredYearlyPrice)) {
|
|
14757
|
+
const allocation = entitlement.valueNumeric || 0;
|
|
14666
14758
|
acc.push({
|
|
14667
14759
|
...entitlement,
|
|
14668
|
-
allocation
|
|
14760
|
+
allocation,
|
|
14669
14761
|
usage: 0,
|
|
14670
|
-
quantity:
|
|
14762
|
+
quantity: allocation
|
|
14671
14763
|
});
|
|
14672
14764
|
}
|
|
14673
14765
|
return acc;
|
|
14674
14766
|
},
|
|
14675
14767
|
[]
|
|
14676
14768
|
);
|
|
14677
|
-
|
|
14678
|
-
|
|
14769
|
+
if (plan.id !== selectedPlan?.id) {
|
|
14770
|
+
setSelectedPlan(plan);
|
|
14771
|
+
setUsageBasedEntitlements(entitlements);
|
|
14772
|
+
}
|
|
14679
14773
|
const updatedShouldTrial = updates.shouldTrial ?? shouldTrial;
|
|
14680
14774
|
setShouldTrial(updatedShouldTrial);
|
|
14681
14775
|
if (willTrialWithoutPaymentMethod) {
|
|
@@ -14701,6 +14795,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14701
14795
|
});
|
|
14702
14796
|
},
|
|
14703
14797
|
[
|
|
14798
|
+
selectedPlan?.id,
|
|
14704
14799
|
planPeriod,
|
|
14705
14800
|
shouldTrial,
|
|
14706
14801
|
willTrialWithoutPaymentMethod,
|
|
@@ -14847,7 +14942,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14847
14942
|
(stage) => stage.id === checkoutStage
|
|
14848
14943
|
);
|
|
14849
14944
|
return /* @__PURE__ */ jsxs16(Modal2, { size: "lg", top, contentRef, children: [
|
|
14850
|
-
/* @__PURE__ */
|
|
14945
|
+
/* @__PURE__ */ jsx21(ModalHeader, { bordered: true, children: /* @__PURE__ */ jsx21(
|
|
14851
14946
|
Flex,
|
|
14852
14947
|
{
|
|
14853
14948
|
$flexWrap: "wrap",
|
|
@@ -14857,7 +14952,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14857
14952
|
$gap: "1rem"
|
|
14858
14953
|
}
|
|
14859
14954
|
},
|
|
14860
|
-
children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */
|
|
14955
|
+
children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */ jsx21(
|
|
14861
14956
|
Navigation,
|
|
14862
14957
|
{
|
|
14863
14958
|
name: stage.name,
|
|
@@ -14916,7 +15011,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14916
15011
|
},
|
|
14917
15012
|
children: [
|
|
14918
15013
|
activeCheckoutStage && /* @__PURE__ */ jsxs16(Flex, { $flexDirection: "column", $gap: "0.25rem", children: [
|
|
14919
|
-
activeCheckoutStage.label && /* @__PURE__ */
|
|
15014
|
+
activeCheckoutStage.label && /* @__PURE__ */ jsx21(
|
|
14920
15015
|
Text,
|
|
14921
15016
|
{
|
|
14922
15017
|
as: "h3",
|
|
@@ -14925,9 +15020,9 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14925
15020
|
children: activeCheckoutStage.label
|
|
14926
15021
|
}
|
|
14927
15022
|
),
|
|
14928
|
-
activeCheckoutStage.description && /* @__PURE__ */
|
|
15023
|
+
activeCheckoutStage.description && /* @__PURE__ */ jsx21(Text, { as: "p", children: activeCheckoutStage.description })
|
|
14929
15024
|
] }),
|
|
14930
|
-
checkoutStage === "plan" && showPeriodToggle && availablePeriods.length > 1 && /* @__PURE__ */
|
|
15025
|
+
checkoutStage === "plan" && showPeriodToggle && availablePeriods.length > 1 && /* @__PURE__ */ jsx21(
|
|
14931
15026
|
PeriodToggle,
|
|
14932
15027
|
{
|
|
14933
15028
|
options: availablePeriods,
|
|
@@ -14939,7 +15034,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14939
15034
|
]
|
|
14940
15035
|
}
|
|
14941
15036
|
),
|
|
14942
|
-
isPending ? /* @__PURE__ */
|
|
15037
|
+
isPending ? /* @__PURE__ */ jsx21(
|
|
14943
15038
|
Flex,
|
|
14944
15039
|
{
|
|
14945
15040
|
$width: "100%",
|
|
@@ -14947,9 +15042,9 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14947
15042
|
$alignItems: "center",
|
|
14948
15043
|
$justifyContent: "center",
|
|
14949
15044
|
$padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
14950
|
-
children: /* @__PURE__ */
|
|
15045
|
+
children: /* @__PURE__ */ jsx21(Loader, { $size: "2xl" })
|
|
14951
15046
|
}
|
|
14952
|
-
) : checkoutStage === "plan" ? /* @__PURE__ */
|
|
15047
|
+
) : checkoutStage === "plan" ? /* @__PURE__ */ jsx21(
|
|
14953
15048
|
Plan,
|
|
14954
15049
|
{
|
|
14955
15050
|
isLoading,
|
|
@@ -14960,7 +15055,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14960
15055
|
shouldTrial,
|
|
14961
15056
|
showPeriodToggle
|
|
14962
15057
|
}
|
|
14963
|
-
) : checkoutStage === "usage" ? /* @__PURE__ */
|
|
15058
|
+
) : checkoutStage === "usage" ? /* @__PURE__ */ jsx21(
|
|
14964
15059
|
Usage,
|
|
14965
15060
|
{
|
|
14966
15061
|
isLoading,
|
|
@@ -14969,7 +15064,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14969
15064
|
entitlements: payInAdvanceEntitlements,
|
|
14970
15065
|
updateQuantity: updateUsageBasedEntitlementQuantity
|
|
14971
15066
|
}
|
|
14972
|
-
) : checkoutStage === "addons" ? /* @__PURE__ */
|
|
15067
|
+
) : checkoutStage === "addons" ? /* @__PURE__ */ jsx21(
|
|
14973
15068
|
AddOns,
|
|
14974
15069
|
{
|
|
14975
15070
|
isLoading,
|
|
@@ -14977,7 +15072,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14977
15072
|
addOns,
|
|
14978
15073
|
toggle: (id) => toggleAddOn(id)
|
|
14979
15074
|
}
|
|
14980
|
-
) : checkoutStage === "addonsUsage" ? /* @__PURE__ */
|
|
15075
|
+
) : checkoutStage === "addonsUsage" ? /* @__PURE__ */ jsx21(
|
|
14981
15076
|
Usage,
|
|
14982
15077
|
{
|
|
14983
15078
|
isLoading,
|
|
@@ -14986,14 +15081,14 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
14986
15081
|
entitlements: addOnPayInAdvanceEntitlements,
|
|
14987
15082
|
updateQuantity: updateAddOnEntitlementQuantity
|
|
14988
15083
|
}
|
|
14989
|
-
) : checkoutStage === "credits" ? /* @__PURE__ */
|
|
15084
|
+
) : checkoutStage === "credits" ? /* @__PURE__ */ jsx21(
|
|
14990
15085
|
Credits,
|
|
14991
15086
|
{
|
|
14992
15087
|
isLoading,
|
|
14993
15088
|
bundles: creditBundles,
|
|
14994
15089
|
updateCount: updateCreditBundleCount
|
|
14995
15090
|
}
|
|
14996
|
-
) : checkoutStage === "checkout" && /* @__PURE__ */
|
|
15091
|
+
) : checkoutStage === "checkout" && /* @__PURE__ */ jsx21(
|
|
14997
15092
|
Checkout,
|
|
14998
15093
|
{
|
|
14999
15094
|
isPaymentMethodRequired,
|
|
@@ -15004,7 +15099,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
15004
15099
|
]
|
|
15005
15100
|
}
|
|
15006
15101
|
),
|
|
15007
|
-
/* @__PURE__ */
|
|
15102
|
+
/* @__PURE__ */ jsx21(
|
|
15008
15103
|
Sidebar,
|
|
15009
15104
|
{
|
|
15010
15105
|
planPeriod,
|
|
@@ -15038,32 +15133,93 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
15038
15133
|
|
|
15039
15134
|
// src/components/shared/payment-dialog/PaymentDialog.tsx
|
|
15040
15135
|
import { useRef as useRef7 } from "react";
|
|
15041
|
-
import { jsx as
|
|
15136
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
15042
15137
|
var PaymentDialog = ({ top = 0 }) => {
|
|
15043
15138
|
const { t: t2 } = useTranslation();
|
|
15044
15139
|
const contentRef = useRef7(null);
|
|
15045
15140
|
return /* @__PURE__ */ jsxs17(Modal2, { size: "md", top, contentRef, children: [
|
|
15046
|
-
/* @__PURE__ */
|
|
15047
|
-
/* @__PURE__ */
|
|
15141
|
+
/* @__PURE__ */ jsx22(ModalHeader, { bordered: true, children: /* @__PURE__ */ jsx22(Text, { $size: 18, children: t2("Edit payment method") }) }),
|
|
15142
|
+
/* @__PURE__ */ jsx22(PaymentMethodDetails, {})
|
|
15048
15143
|
] });
|
|
15049
15144
|
};
|
|
15050
15145
|
|
|
15051
15146
|
// src/components/shared/payment-form/PaymentForm.tsx
|
|
15052
15147
|
import {
|
|
15148
|
+
AddressElement,
|
|
15053
15149
|
PaymentElement,
|
|
15054
15150
|
useElements,
|
|
15055
15151
|
useStripe
|
|
15056
15152
|
} from "@stripe/react-stripe-js";
|
|
15057
15153
|
import { useState as useState10 } from "react";
|
|
15058
|
-
|
|
15154
|
+
|
|
15155
|
+
// src/components/shared/payment-form/styles.ts
|
|
15156
|
+
var Label = dt.label`
|
|
15157
|
+
display: flex;
|
|
15158
|
+
margin-bottom: 0.75rem;
|
|
15159
|
+
font-family: "Public Sans", system-ui, sans-serif;
|
|
15160
|
+
font-size: 1rem;
|
|
15161
|
+
font-weight: 400;
|
|
15162
|
+
transition:
|
|
15163
|
+
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
|
|
15164
|
+
opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
|
15165
|
+
color: #cdd6f4;
|
|
15166
|
+
touch-action: manipulation;
|
|
15167
|
+
`;
|
|
15168
|
+
var Input2 = dt.input`
|
|
15169
|
+
padding: 0.75rem;
|
|
15170
|
+
background-color: white;
|
|
15171
|
+
border-radius: 0.5rem;
|
|
15172
|
+
transition:
|
|
15173
|
+
background 0.15s ease,
|
|
15174
|
+
border 0.15s ease,
|
|
15175
|
+
box-shadow 0.15s ease,
|
|
15176
|
+
color 0.15s ease;
|
|
15177
|
+
border: 1px solid #e6e6e6;
|
|
15178
|
+
box-shadow:
|
|
15179
|
+
0 1px 1px rgba(0, 0, 0, 0.03),
|
|
15180
|
+
0 3px 6px rgba(0, 0, 0, 0.02);
|
|
15181
|
+
|
|
15182
|
+
appearance: none;
|
|
15183
|
+
color: inherit;
|
|
15184
|
+
filter: none;
|
|
15185
|
+
font-family: "Public Sans", system-ui, sans-serif;
|
|
15186
|
+
font-size: 1rem;
|
|
15187
|
+
letter-spacing: inherit;
|
|
15188
|
+
outline-offset: 0;
|
|
15189
|
+
outline-width: 2px;
|
|
15190
|
+
|
|
15191
|
+
animation: native-autofill-out 1ms;
|
|
15192
|
+
color-scheme: light;
|
|
15193
|
+
display: block;
|
|
15194
|
+
width: 100%;
|
|
15195
|
+
touch-action: manipulation;
|
|
15196
|
+
|
|
15197
|
+
&:focus {
|
|
15198
|
+
outline: 0;
|
|
15199
|
+
border-color: #0570de;
|
|
15200
|
+
boxshadow:
|
|
15201
|
+
0 1px 1px rgba(0, 0, 0, 0.03),
|
|
15202
|
+
0 3px 6px rgba(0, 0, 0, 0.02),
|
|
15203
|
+
0 0 0 3px hsla(210, 96%, 45%, 25%),
|
|
15204
|
+
0 1px 1px 0 rgba(0, 0, 0, 0.08);
|
|
15205
|
+
}
|
|
15206
|
+
`;
|
|
15207
|
+
|
|
15208
|
+
// src/components/shared/payment-form/PaymentForm.tsx
|
|
15209
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
15059
15210
|
var PaymentForm = ({ onConfirm }) => {
|
|
15060
15211
|
const { t: t2 } = useTranslation();
|
|
15061
15212
|
const stripe = useStripe();
|
|
15062
15213
|
const elements = useElements();
|
|
15214
|
+
const { data } = useEmbed();
|
|
15215
|
+
const [email, setEmail] = useState10("");
|
|
15063
15216
|
const [message, setMessage] = useState10();
|
|
15064
15217
|
const [isLoading, setIsLoading] = useState10(false);
|
|
15065
15218
|
const [isConfirmed, setIsConfirmed] = useState10(false);
|
|
15066
|
-
const [
|
|
15219
|
+
const [isPaymentComplete, setIsPaymentComplete] = useState10(false);
|
|
15220
|
+
const [isAddressComplete, setIsAddressComplete] = useState10(
|
|
15221
|
+
() => !isCheckoutData(data) || !data.checkoutSettings.collectAddress
|
|
15222
|
+
);
|
|
15067
15223
|
const handleSubmit = async (event) => {
|
|
15068
15224
|
event.preventDefault();
|
|
15069
15225
|
if (!stripe || !elements) {
|
|
@@ -15076,6 +15232,11 @@ var PaymentForm = ({ onConfirm }) => {
|
|
|
15076
15232
|
const { setupIntent, error } = await stripe.confirmSetup({
|
|
15077
15233
|
elements,
|
|
15078
15234
|
confirmParams: {
|
|
15235
|
+
payment_method_data: {
|
|
15236
|
+
billing_details: {
|
|
15237
|
+
email
|
|
15238
|
+
}
|
|
15239
|
+
},
|
|
15079
15240
|
return_url: window.location.href
|
|
15080
15241
|
},
|
|
15081
15242
|
redirect: "if_required"
|
|
@@ -15095,31 +15256,58 @@ var PaymentForm = ({ onConfirm }) => {
|
|
|
15095
15256
|
}
|
|
15096
15257
|
};
|
|
15097
15258
|
return /* @__PURE__ */ jsxs18(
|
|
15098
|
-
|
|
15259
|
+
Flex,
|
|
15099
15260
|
{
|
|
15261
|
+
as: "form",
|
|
15100
15262
|
id: "payment-form",
|
|
15101
15263
|
onSubmit: handleSubmit,
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
overflowX: "hidden",
|
|
15106
|
-
overflowY: "auto"
|
|
15107
|
-
},
|
|
15264
|
+
$flexDirection: "column",
|
|
15265
|
+
$overflowX: "hidden",
|
|
15266
|
+
$overflowY: "auto",
|
|
15108
15267
|
children: [
|
|
15109
|
-
/* @__PURE__ */
|
|
15268
|
+
/* @__PURE__ */ jsx23(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx23(
|
|
15110
15269
|
PaymentElement,
|
|
15111
15270
|
{
|
|
15112
15271
|
id: "payment-element",
|
|
15113
15272
|
onChange: (event) => {
|
|
15114
|
-
|
|
15273
|
+
setIsPaymentComplete(event.complete);
|
|
15274
|
+
}
|
|
15275
|
+
}
|
|
15276
|
+
) }),
|
|
15277
|
+
stripe && isCheckoutData(data) && data.checkoutSettings.collectEmail && /* @__PURE__ */ jsxs18(Box, { "data-field": "name", $marginBottom: "1.5rem", $verticalAlign: "top", children: [
|
|
15278
|
+
/* @__PURE__ */ jsx23(Label, { htmlFor: "email", children: "Email" }),
|
|
15279
|
+
/* @__PURE__ */ jsx23(
|
|
15280
|
+
Input2,
|
|
15281
|
+
{
|
|
15282
|
+
id: "email",
|
|
15283
|
+
type: "text",
|
|
15284
|
+
value: email,
|
|
15285
|
+
autoComplete: "email",
|
|
15286
|
+
placeholder: "Enter email address",
|
|
15287
|
+
onChange: (e2) => setEmail(e2.target.value)
|
|
15288
|
+
}
|
|
15289
|
+
)
|
|
15290
|
+
] }),
|
|
15291
|
+
isCheckoutData(data) && (data.checkoutSettings.collectAddress || data.checkoutSettings.collectPhone) && /* @__PURE__ */ jsx23(Box, { $marginBottom: "3.5rem", children: /* @__PURE__ */ jsx23(
|
|
15292
|
+
AddressElement,
|
|
15293
|
+
{
|
|
15294
|
+
options: {
|
|
15295
|
+
mode: "billing",
|
|
15296
|
+
fields: {
|
|
15297
|
+
phone: data.checkoutSettings.collectPhone ? "always" : "never"
|
|
15298
|
+
}
|
|
15299
|
+
},
|
|
15300
|
+
id: "address-element",
|
|
15301
|
+
onChange: (event) => {
|
|
15302
|
+
setIsAddressComplete(event.complete);
|
|
15115
15303
|
}
|
|
15116
15304
|
}
|
|
15117
15305
|
) }),
|
|
15118
|
-
/* @__PURE__ */
|
|
15306
|
+
/* @__PURE__ */ jsx23(
|
|
15119
15307
|
Button,
|
|
15120
15308
|
{
|
|
15121
15309
|
id: "submit",
|
|
15122
|
-
disabled: isLoading || !stripe || !elements || isConfirmed || !
|
|
15310
|
+
disabled: isLoading || !stripe || !elements || isConfirmed || !isPaymentComplete || !isAddressComplete,
|
|
15123
15311
|
style: { flexShrink: 0 },
|
|
15124
15312
|
$color: "primary",
|
|
15125
15313
|
$isLoading: isLoading,
|
|
@@ -15127,7 +15315,7 @@ var PaymentForm = ({ onConfirm }) => {
|
|
|
15127
15315
|
children: isLoading ? t2("Loading") : t2("Save payment method")
|
|
15128
15316
|
}
|
|
15129
15317
|
),
|
|
15130
|
-
message && /* @__PURE__ */
|
|
15318
|
+
message && /* @__PURE__ */ jsx23(Box, { $margin: "1rem 0", children: /* @__PURE__ */ jsx23(Text, { id: "payment-message", $size: 15, $weight: 500, $color: "#DB6669", children: message }) })
|
|
15131
15319
|
]
|
|
15132
15320
|
}
|
|
15133
15321
|
);
|
|
@@ -15135,7 +15323,7 @@ var PaymentForm = ({ onConfirm }) => {
|
|
|
15135
15323
|
|
|
15136
15324
|
// src/components/shared/period-toggle/PeriodToggle.tsx
|
|
15137
15325
|
import { useMemo as useMemo10 } from "react";
|
|
15138
|
-
import { jsx as
|
|
15326
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
15139
15327
|
var PeriodToggle = ({
|
|
15140
15328
|
options,
|
|
15141
15329
|
selectedOption,
|
|
@@ -15155,7 +15343,7 @@ var PeriodToggle = ({
|
|
|
15155
15343
|
}
|
|
15156
15344
|
return 0;
|
|
15157
15345
|
}, [selectedPlan]);
|
|
15158
|
-
return /* @__PURE__ */
|
|
15346
|
+
return /* @__PURE__ */ jsx24(
|
|
15159
15347
|
Flex,
|
|
15160
15348
|
{
|
|
15161
15349
|
$margin: 0,
|
|
@@ -15171,7 +15359,7 @@ var PeriodToggle = ({
|
|
|
15171
15359
|
}
|
|
15172
15360
|
},
|
|
15173
15361
|
children: options.map((option) => {
|
|
15174
|
-
const element = /* @__PURE__ */
|
|
15362
|
+
const element = /* @__PURE__ */ jsx24(
|
|
15175
15363
|
Flex,
|
|
15176
15364
|
{
|
|
15177
15365
|
tabIndex: 0,
|
|
@@ -15191,7 +15379,7 @@ var PeriodToggle = ({
|
|
|
15191
15379
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.125)" : "hsla(0, 0%, 100%, 0.125)"
|
|
15192
15380
|
},
|
|
15193
15381
|
$borderRadius: "2.5rem",
|
|
15194
|
-
children: /* @__PURE__ */
|
|
15382
|
+
children: /* @__PURE__ */ jsx24(
|
|
15195
15383
|
Text,
|
|
15196
15384
|
{
|
|
15197
15385
|
style: { flexShrink: 0 },
|
|
@@ -15204,11 +15392,11 @@ var PeriodToggle = ({
|
|
|
15204
15392
|
option
|
|
15205
15393
|
);
|
|
15206
15394
|
if (option === "year" && savingsPercentage > 0) {
|
|
15207
|
-
return /* @__PURE__ */
|
|
15395
|
+
return /* @__PURE__ */ jsx24(
|
|
15208
15396
|
Tooltip,
|
|
15209
15397
|
{
|
|
15210
15398
|
trigger: element,
|
|
15211
|
-
content: /* @__PURE__ */
|
|
15399
|
+
content: /* @__PURE__ */ jsx24(Text, { $size: 11, $leading: 1, children: selectedOption === "month" ? t2("Save with yearly billing", {
|
|
15212
15400
|
percent: savingsPercentage
|
|
15213
15401
|
}) : t2("Saving with yearly billing", {
|
|
15214
15402
|
percent: savingsPercentage
|
|
@@ -15229,7 +15417,7 @@ import { useMemo as useMemo12 } from "react";
|
|
|
15229
15417
|
|
|
15230
15418
|
// src/components/shared/pricing-tiers-tooltip/PriceText.tsx
|
|
15231
15419
|
import { useMemo as useMemo11 } from "react";
|
|
15232
|
-
import { Fragment as Fragment10, jsx as
|
|
15420
|
+
import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
15233
15421
|
var PriceText = ({
|
|
15234
15422
|
feature,
|
|
15235
15423
|
period,
|
|
@@ -15237,6 +15425,7 @@ var PriceText = ({
|
|
|
15237
15425
|
flatAmount = 0,
|
|
15238
15426
|
perUnitPrice = 0
|
|
15239
15427
|
}) => {
|
|
15428
|
+
const { settings } = useEmbed();
|
|
15240
15429
|
const text = useMemo11(() => {
|
|
15241
15430
|
if (!flatAmount && perUnitPrice) {
|
|
15242
15431
|
return /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
@@ -15270,11 +15459,11 @@ var PriceText = ({
|
|
|
15270
15459
|
] })
|
|
15271
15460
|
] });
|
|
15272
15461
|
}, [feature, period, currency, flatAmount, perUnitPrice]);
|
|
15273
|
-
return /* @__PURE__ */
|
|
15462
|
+
return /* @__PURE__ */ jsx25(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, $leading: 1, children: text });
|
|
15274
15463
|
};
|
|
15275
15464
|
|
|
15276
15465
|
// src/components/shared/pricing-tiers-tooltip/PricingTiersTooltip.tsx
|
|
15277
|
-
import { Fragment as Fragment11, jsx as
|
|
15466
|
+
import { Fragment as Fragment11, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
15278
15467
|
var PricingTiersTooltip = ({
|
|
15279
15468
|
feature,
|
|
15280
15469
|
period,
|
|
@@ -15302,20 +15491,19 @@ var PricingTiersTooltip = ({
|
|
|
15302
15491
|
if (!priceTiers.length) {
|
|
15303
15492
|
return null;
|
|
15304
15493
|
}
|
|
15305
|
-
return /* @__PURE__ */
|
|
15494
|
+
return /* @__PURE__ */ jsx26(
|
|
15306
15495
|
Tooltip,
|
|
15307
15496
|
{
|
|
15308
|
-
trigger: /* @__PURE__ */
|
|
15497
|
+
trigger: /* @__PURE__ */ jsx26(
|
|
15309
15498
|
Icon3,
|
|
15310
15499
|
{
|
|
15311
15500
|
title: "tiered pricing",
|
|
15312
15501
|
name: "info-rounded",
|
|
15313
|
-
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)
|
|
15314
|
-
style: { marginLeft: `-${1 / 3}rem` }
|
|
15502
|
+
color: `hsla(0, 0%, ${isLightBackground ? 0 : 100}%, 0.5)`
|
|
15315
15503
|
}
|
|
15316
15504
|
),
|
|
15317
15505
|
content: /* @__PURE__ */ jsxs20(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
15318
|
-
/* @__PURE__ */
|
|
15506
|
+
/* @__PURE__ */ jsx26("dl", { children: tiers.map((tier, index) => {
|
|
15319
15507
|
const flatAmount = typeof tier.flatAmount === "number" ? tier.flatAmount : void 0;
|
|
15320
15508
|
const perUnitPrice = typeof tier.perUnitPriceDecimal === "string" ? Number(tier.perUnitPriceDecimal) : typeof tier.perUnitPrice === "number" ? tier.perUnitPrice : void 0;
|
|
15321
15509
|
return /* @__PURE__ */ jsxs20(
|
|
@@ -15326,11 +15514,17 @@ var PricingTiersTooltip = ({
|
|
|
15326
15514
|
$gap: "1rem",
|
|
15327
15515
|
$padding: "0.5rem",
|
|
15328
15516
|
children: [
|
|
15329
|
-
/* @__PURE__ */
|
|
15330
|
-
|
|
15331
|
-
|
|
15332
|
-
|
|
15333
|
-
|
|
15517
|
+
/* @__PURE__ */ jsx26("dt", { children: /* @__PURE__ */ jsxs20(
|
|
15518
|
+
Text,
|
|
15519
|
+
{
|
|
15520
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
15521
|
+
children: [
|
|
15522
|
+
tier.from,
|
|
15523
|
+
tier.from !== tier.to && /* @__PURE__ */ jsx26(Fragment11, { children: tier.to === Infinity ? "+" : `\u2013${tier.to}` })
|
|
15524
|
+
]
|
|
15525
|
+
}
|
|
15526
|
+
) }),
|
|
15527
|
+
/* @__PURE__ */ jsx26("dd", { children: /* @__PURE__ */ jsx26(
|
|
15334
15528
|
PriceText,
|
|
15335
15529
|
{
|
|
15336
15530
|
period,
|
|
@@ -15346,7 +15540,7 @@ var PricingTiersTooltip = ({
|
|
|
15346
15540
|
);
|
|
15347
15541
|
}) }),
|
|
15348
15542
|
(tiersMode === "volume" /* Volume */ || tiersMode === "graduated" /* Graduated */) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
15349
|
-
/* @__PURE__ */
|
|
15543
|
+
/* @__PURE__ */ jsx26(
|
|
15350
15544
|
"hr",
|
|
15351
15545
|
{
|
|
15352
15546
|
style: {
|
|
@@ -15356,15 +15550,13 @@ var PricingTiersTooltip = ({
|
|
|
15356
15550
|
}
|
|
15357
15551
|
}
|
|
15358
15552
|
),
|
|
15359
|
-
/* @__PURE__ */
|
|
15553
|
+
/* @__PURE__ */ jsx26(Box, { children: /* @__PURE__ */ jsxs20(Text, { $size: 0.875 * settings.theme.typography.text.fontSize, children: [
|
|
15360
15554
|
"\u2139\uFE0F",
|
|
15361
15555
|
" ",
|
|
15362
15556
|
tiersMode === "volume" /* Volume */ ? t2("Price by unit based on final tier reached.") : t2("Tiers apply progressively as quantity increases.")
|
|
15363
15557
|
] }) })
|
|
15364
15558
|
] })
|
|
15365
|
-
] })
|
|
15366
|
-
$flexGrow: "0 !important",
|
|
15367
|
-
$width: "auto !important"
|
|
15559
|
+
] })
|
|
15368
15560
|
}
|
|
15369
15561
|
);
|
|
15370
15562
|
};
|
|
@@ -15425,7 +15617,7 @@ var TieredPricingDetails = ({
|
|
|
15425
15617
|
|
|
15426
15618
|
// src/components/shared/unsubscribe-dialog/UnsubscribeDialog.tsx
|
|
15427
15619
|
import { useMemo as useMemo14, useRef as useRef8, useState as useState11 } from "react";
|
|
15428
|
-
import { jsx as
|
|
15620
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
15429
15621
|
var UnsubscribeDialog = ({ top = 0 }) => {
|
|
15430
15622
|
const { t: t2 } = useTranslation();
|
|
15431
15623
|
const { data, setCheckoutState } = useEmbed();
|
|
@@ -15470,7 +15662,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
|
|
|
15470
15662
|
[currentAddOns, availableAddOns]
|
|
15471
15663
|
);
|
|
15472
15664
|
return /* @__PURE__ */ jsxs21(Modal2, { size: "auto", top, contentRef, children: [
|
|
15473
|
-
/* @__PURE__ */
|
|
15665
|
+
/* @__PURE__ */ jsx27(ModalHeader, {}),
|
|
15474
15666
|
/* @__PURE__ */ jsxs21(
|
|
15475
15667
|
Flex,
|
|
15476
15668
|
{
|
|
@@ -15493,7 +15685,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
|
|
|
15493
15685
|
$padding: "0 2.5rem 2.5rem",
|
|
15494
15686
|
children: [
|
|
15495
15687
|
/* @__PURE__ */ jsxs21(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
|
|
15496
|
-
/* @__PURE__ */
|
|
15688
|
+
/* @__PURE__ */ jsx27(Text, { as: "h2", display: "heading2", children: t2("Cancel subscription") }),
|
|
15497
15689
|
/* @__PURE__ */ jsxs21(Text, { as: "p", children: [
|
|
15498
15690
|
t2(
|
|
15499
15691
|
"You will retain access to your plan until the end of the billing period, on"
|
|
@@ -15505,8 +15697,8 @@ var UnsubscribeDialog = ({ top = 0 }) => {
|
|
|
15505
15697
|
] })
|
|
15506
15698
|
] }),
|
|
15507
15699
|
/* @__PURE__ */ jsxs21(Flex, { $flexDirection: "column", $flexWrap: "wrap", $gap: "0.5rem", children: [
|
|
15508
|
-
/* @__PURE__ */
|
|
15509
|
-
/* @__PURE__ */
|
|
15700
|
+
/* @__PURE__ */ jsx27(Text, { as: "p", children: t2("Not ready to cancel?") }),
|
|
15701
|
+
/* @__PURE__ */ jsx27(
|
|
15510
15702
|
Button,
|
|
15511
15703
|
{
|
|
15512
15704
|
type: "button",
|
|
@@ -15527,7 +15719,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
|
|
|
15527
15719
|
]
|
|
15528
15720
|
}
|
|
15529
15721
|
),
|
|
15530
|
-
/* @__PURE__ */
|
|
15722
|
+
/* @__PURE__ */ jsx27(
|
|
15531
15723
|
Sidebar,
|
|
15532
15724
|
{
|
|
15533
15725
|
planPeriod,
|
|
@@ -15548,7 +15740,7 @@ var UnsubscribeDialog = ({ top = 0 }) => {
|
|
|
15548
15740
|
};
|
|
15549
15741
|
|
|
15550
15742
|
// src/components/ui/badge/Badge.tsx
|
|
15551
|
-
import { jsx as
|
|
15743
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
15552
15744
|
var Badge = () => {
|
|
15553
15745
|
const { t: t2 } = useTranslation();
|
|
15554
15746
|
const { settings } = useEmbed();
|
|
@@ -15570,77 +15762,77 @@ var Badge = () => {
|
|
|
15570
15762
|
" "
|
|
15571
15763
|
] }),
|
|
15572
15764
|
/* @__PURE__ */ jsxs22("svg", { viewBox: "0 0 86 16", width: 86, height: 16, children: [
|
|
15573
|
-
/* @__PURE__ */
|
|
15765
|
+
/* @__PURE__ */ jsx28(
|
|
15574
15766
|
"path",
|
|
15575
15767
|
{
|
|
15576
15768
|
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",
|
|
15577
15769
|
fill: "currentColor"
|
|
15578
15770
|
}
|
|
15579
15771
|
),
|
|
15580
|
-
/* @__PURE__ */
|
|
15772
|
+
/* @__PURE__ */ jsx28(
|
|
15581
15773
|
"path",
|
|
15582
15774
|
{
|
|
15583
15775
|
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",
|
|
15584
15776
|
fill: "currentColor"
|
|
15585
15777
|
}
|
|
15586
15778
|
),
|
|
15587
|
-
/* @__PURE__ */
|
|
15779
|
+
/* @__PURE__ */ jsx28(
|
|
15588
15780
|
"path",
|
|
15589
15781
|
{
|
|
15590
15782
|
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",
|
|
15591
15783
|
fill: "currentColor"
|
|
15592
15784
|
}
|
|
15593
15785
|
),
|
|
15594
|
-
/* @__PURE__ */
|
|
15786
|
+
/* @__PURE__ */ jsx28(
|
|
15595
15787
|
"path",
|
|
15596
15788
|
{
|
|
15597
15789
|
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",
|
|
15598
15790
|
fill: "currentColor"
|
|
15599
15791
|
}
|
|
15600
15792
|
),
|
|
15601
|
-
/* @__PURE__ */
|
|
15793
|
+
/* @__PURE__ */ jsx28(
|
|
15602
15794
|
"path",
|
|
15603
15795
|
{
|
|
15604
15796
|
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",
|
|
15605
15797
|
fill: "currentColor"
|
|
15606
15798
|
}
|
|
15607
15799
|
),
|
|
15608
|
-
/* @__PURE__ */
|
|
15800
|
+
/* @__PURE__ */ jsx28(
|
|
15609
15801
|
"path",
|
|
15610
15802
|
{
|
|
15611
15803
|
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",
|
|
15612
15804
|
fill: "currentColor"
|
|
15613
15805
|
}
|
|
15614
15806
|
),
|
|
15615
|
-
/* @__PURE__ */
|
|
15807
|
+
/* @__PURE__ */ jsx28(
|
|
15616
15808
|
"path",
|
|
15617
15809
|
{
|
|
15618
15810
|
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",
|
|
15619
15811
|
fill: "currentColor"
|
|
15620
15812
|
}
|
|
15621
15813
|
),
|
|
15622
|
-
/* @__PURE__ */
|
|
15814
|
+
/* @__PURE__ */ jsx28(
|
|
15623
15815
|
"path",
|
|
15624
15816
|
{
|
|
15625
15817
|
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",
|
|
15626
15818
|
fill: "currentColor"
|
|
15627
15819
|
}
|
|
15628
15820
|
),
|
|
15629
|
-
/* @__PURE__ */
|
|
15821
|
+
/* @__PURE__ */ jsx28(
|
|
15630
15822
|
"path",
|
|
15631
15823
|
{
|
|
15632
15824
|
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",
|
|
15633
15825
|
fill: "currentColor"
|
|
15634
15826
|
}
|
|
15635
15827
|
),
|
|
15636
|
-
/* @__PURE__ */
|
|
15828
|
+
/* @__PURE__ */ jsx28(
|
|
15637
15829
|
"path",
|
|
15638
15830
|
{
|
|
15639
15831
|
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",
|
|
15640
15832
|
fill: "currentColor"
|
|
15641
15833
|
}
|
|
15642
15834
|
),
|
|
15643
|
-
/* @__PURE__ */
|
|
15835
|
+
/* @__PURE__ */ jsx28(
|
|
15644
15836
|
"path",
|
|
15645
15837
|
{
|
|
15646
15838
|
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",
|
|
@@ -15654,9 +15846,9 @@ var Badge = () => {
|
|
|
15654
15846
|
};
|
|
15655
15847
|
|
|
15656
15848
|
// src/components/layout/RenderLayout.tsx
|
|
15657
|
-
import { jsx as
|
|
15849
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
15658
15850
|
var Disabled = () => {
|
|
15659
|
-
return /* @__PURE__ */
|
|
15851
|
+
return /* @__PURE__ */ jsx29(Box, { $width: "max-content", $height: "max-content", $margin: "0 auto", children: /* @__PURE__ */ jsx29(Card, { children: /* @__PURE__ */ jsxs23(
|
|
15660
15852
|
Element,
|
|
15661
15853
|
{
|
|
15662
15854
|
as: Flex,
|
|
@@ -15665,8 +15857,8 @@ var Disabled = () => {
|
|
|
15665
15857
|
$alignItems: "center",
|
|
15666
15858
|
$whiteSpace: "nowrap",
|
|
15667
15859
|
children: [
|
|
15668
|
-
/* @__PURE__ */
|
|
15669
|
-
/* @__PURE__ */
|
|
15860
|
+
/* @__PURE__ */ jsx29(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx29(Text, { as: "h1", display: "heading1", children: "Portal not found" }) }),
|
|
15861
|
+
/* @__PURE__ */ jsx29(Text, { as: "p", children: "Please try again later." })
|
|
15670
15862
|
]
|
|
15671
15863
|
}
|
|
15672
15864
|
) }) });
|
|
@@ -15675,7 +15867,7 @@ var RenderLayout = ({ children }) => {
|
|
|
15675
15867
|
const { layout } = useEmbed();
|
|
15676
15868
|
switch (layout) {
|
|
15677
15869
|
case "disabled":
|
|
15678
|
-
return /* @__PURE__ */
|
|
15870
|
+
return /* @__PURE__ */ jsx29(Disabled, {});
|
|
15679
15871
|
default:
|
|
15680
15872
|
return children;
|
|
15681
15873
|
}
|
|
@@ -15700,7 +15892,7 @@ var StyledViewport = dt.div.withConfig({
|
|
|
15700
15892
|
`;
|
|
15701
15893
|
|
|
15702
15894
|
// src/components/layout/viewport/Viewport.tsx
|
|
15703
|
-
import { Fragment as Fragment12, jsx as
|
|
15895
|
+
import { Fragment as Fragment12, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
15704
15896
|
var Viewport = forwardRef5(
|
|
15705
15897
|
({ children, portal, ...props }, ref) => {
|
|
15706
15898
|
const { data, layout, settings } = useEmbed();
|
|
@@ -15728,22 +15920,22 @@ var Viewport = forwardRef5(
|
|
|
15728
15920
|
}, [portal, layout]);
|
|
15729
15921
|
return /* @__PURE__ */ jsxs24(Fragment12, { children: [
|
|
15730
15922
|
/* @__PURE__ */ jsxs24(StyledViewport, { ref, ...props, children: [
|
|
15731
|
-
/* @__PURE__ */
|
|
15732
|
-
isBadgeVisible && /* @__PURE__ */
|
|
15923
|
+
/* @__PURE__ */ jsx30(RenderLayout, { children }),
|
|
15924
|
+
isBadgeVisible && /* @__PURE__ */ jsx30(Badge, {})
|
|
15733
15925
|
] }),
|
|
15734
|
-
canCheckout && layout === "checkout" && createPortal2(/* @__PURE__ */
|
|
15926
|
+
canCheckout && layout === "checkout" && createPortal2(/* @__PURE__ */ jsx30(CheckoutDialog, { top }), portal || document.body),
|
|
15735
15927
|
layout === "unsubscribe" && createPortal2(
|
|
15736
|
-
/* @__PURE__ */
|
|
15928
|
+
/* @__PURE__ */ jsx30(UnsubscribeDialog, { top }),
|
|
15737
15929
|
portal || document.body
|
|
15738
15930
|
),
|
|
15739
|
-
layout === "payment" && createPortal2(/* @__PURE__ */
|
|
15931
|
+
layout === "payment" && createPortal2(/* @__PURE__ */ jsx30(PaymentDialog, { top }), portal || document.body)
|
|
15740
15932
|
] });
|
|
15741
15933
|
}
|
|
15742
15934
|
);
|
|
15743
15935
|
Viewport.displayName = "Viewport";
|
|
15744
15936
|
|
|
15745
15937
|
// src/components/elements/button/Button.tsx
|
|
15746
|
-
import { jsx as
|
|
15938
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
15747
15939
|
var resolveDesignProps = (props) => {
|
|
15748
15940
|
return {
|
|
15749
15941
|
button: {
|
|
@@ -15774,7 +15966,7 @@ var ButtonElement = forwardRef6(({ children, className, ...rest }, ref) => {
|
|
|
15774
15966
|
variant: "text"
|
|
15775
15967
|
}
|
|
15776
15968
|
};
|
|
15777
|
-
return /* @__PURE__ */
|
|
15969
|
+
return /* @__PURE__ */ jsx31(
|
|
15778
15970
|
Element,
|
|
15779
15971
|
{
|
|
15780
15972
|
as: Flex,
|
|
@@ -15782,7 +15974,7 @@ var ButtonElement = forwardRef6(({ children, className, ...rest }, ref) => {
|
|
|
15782
15974
|
className,
|
|
15783
15975
|
$flexDirection: "column",
|
|
15784
15976
|
$gap: "2rem",
|
|
15785
|
-
children: /* @__PURE__ */
|
|
15977
|
+
children: /* @__PURE__ */ jsx31(
|
|
15786
15978
|
Button,
|
|
15787
15979
|
{
|
|
15788
15980
|
as: "a",
|
|
@@ -15807,7 +15999,7 @@ import { forwardRef as forwardRef7, useMemo as useMemo17, useRef as useRef9, use
|
|
|
15807
15999
|
|
|
15808
16000
|
// src/components/elements/included-features/UsageDetails.tsx
|
|
15809
16001
|
import { Fragment as Fragment13, useMemo as useMemo16 } from "react";
|
|
15810
|
-
import { Fragment as Fragment14, jsx as
|
|
16002
|
+
import { Fragment as Fragment14, jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
15811
16003
|
var UsageDetails = ({
|
|
15812
16004
|
entitlement,
|
|
15813
16005
|
shouldWrapChildren,
|
|
@@ -15865,7 +16057,7 @@ var UsageDetails = ({
|
|
|
15865
16057
|
] });
|
|
15866
16058
|
}
|
|
15867
16059
|
if (priceBehavior === "tier" /* Tiered */) {
|
|
15868
|
-
return /* @__PURE__ */
|
|
16060
|
+
return /* @__PURE__ */ jsx32(Fragment14, { children: typeof currentTier?.to === "number" && (currentTier?.to === Infinity ? t2("Unlimited in this tier", {
|
|
15869
16061
|
feature: getFeatureName(feature)
|
|
15870
16062
|
}) : t2("Up to X units in this tier", {
|
|
15871
16063
|
amount: formatNumber(currentTier.to),
|
|
@@ -15944,7 +16136,7 @@ var UsageDetails = ({
|
|
|
15944
16136
|
if (typeof cost === "number" && cost > 0) {
|
|
15945
16137
|
acc.push(
|
|
15946
16138
|
/* @__PURE__ */ jsxs25(Fragment13, { children: [
|
|
15947
|
-
acc.length > 0 && /* @__PURE__ */
|
|
16139
|
+
acc.length > 0 && /* @__PURE__ */ jsx32(Fragment14, { children: " \u2022 " }),
|
|
15948
16140
|
formatCurrency(cost, currency)
|
|
15949
16141
|
] }, index)
|
|
15950
16142
|
);
|
|
@@ -15960,7 +16152,7 @@ var UsageDetails = ({
|
|
|
15960
16152
|
if (metricResetAt) {
|
|
15961
16153
|
acc.push(
|
|
15962
16154
|
/* @__PURE__ */ jsxs25(Fragment13, { children: [
|
|
15963
|
-
acc.length > 0 && /* @__PURE__ */
|
|
16155
|
+
acc.length > 0 && /* @__PURE__ */ jsx32(Fragment14, { children: " \u2022 " }),
|
|
15964
16156
|
t2("Resets", {
|
|
15965
16157
|
date: toPrettyDate(metricResetAt, {
|
|
15966
16158
|
month: "numeric",
|
|
@@ -16004,9 +16196,10 @@ var UsageDetails = ({
|
|
|
16004
16196
|
$flexGrow: "1",
|
|
16005
16197
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
16006
16198
|
children: [
|
|
16007
|
-
layout.entitlement.isVisible && /* @__PURE__ */
|
|
16008
|
-
layout.usage.isVisible && usageText && /* @__PURE__ */ jsxs25(Flex, { $justifyContent: "end", $alignItems: "
|
|
16009
|
-
|
|
16199
|
+
layout.entitlement.isVisible && /* @__PURE__ */ jsx32(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx32(Text, { display: layout.entitlement.fontStyle, $leading: 1, children: text }) }),
|
|
16200
|
+
layout.usage.isVisible && usageText && /* @__PURE__ */ jsxs25(Flex, { $justifyContent: "end", $alignItems: "end", $whiteSpace: "nowrap", children: [
|
|
16201
|
+
/* @__PURE__ */ jsx32(Text, { display: layout.usage.fontStyle, $leading: 1, children: usageText }),
|
|
16202
|
+
priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsx32(
|
|
16010
16203
|
PricingTiersTooltip,
|
|
16011
16204
|
{
|
|
16012
16205
|
feature,
|
|
@@ -16014,8 +16207,7 @@ var UsageDetails = ({
|
|
|
16014
16207
|
currency: billingPrice?.currency,
|
|
16015
16208
|
priceTiers: billingPrice?.priceTier
|
|
16016
16209
|
}
|
|
16017
|
-
)
|
|
16018
|
-
/* @__PURE__ */ jsx31(Text, { display: layout.usage.fontStyle, $leading: 1, children: usageText })
|
|
16210
|
+
)
|
|
16019
16211
|
] })
|
|
16020
16212
|
]
|
|
16021
16213
|
}
|
|
@@ -16023,7 +16215,7 @@ var UsageDetails = ({
|
|
|
16023
16215
|
};
|
|
16024
16216
|
|
|
16025
16217
|
// src/components/elements/included-features/IncludedFeatures.tsx
|
|
16026
|
-
import { jsx as
|
|
16218
|
+
import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
16027
16219
|
function resolveDesignProps2(props) {
|
|
16028
16220
|
return {
|
|
16029
16221
|
header: {
|
|
@@ -16107,7 +16299,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
16107
16299
|
$flexDirection: "column",
|
|
16108
16300
|
$gap: "1rem",
|
|
16109
16301
|
children: [
|
|
16110
|
-
props.header.isVisible && /* @__PURE__ */
|
|
16302
|
+
props.header.isVisible && /* @__PURE__ */ jsx33(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx33(Text, { display: props.header.fontStyle, children: props.header.text }) }),
|
|
16111
16303
|
featureUsage.slice(0, showCount).map((entitlement, index) => {
|
|
16112
16304
|
const shouldShowDetails = entitlement.feature?.name && (entitlement.feature?.featureType === "event" /* Event */ || entitlement.feature?.featureType === "trait" /* Trait */);
|
|
16113
16305
|
return /* @__PURE__ */ jsxs26(
|
|
@@ -16131,7 +16323,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
16131
16323
|
$flexBasis: "min-content",
|
|
16132
16324
|
$gap: "1rem",
|
|
16133
16325
|
children: [
|
|
16134
|
-
props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */
|
|
16326
|
+
props.icons.isVisible && entitlement.feature?.icon && /* @__PURE__ */ jsx33(
|
|
16135
16327
|
Icon3,
|
|
16136
16328
|
{
|
|
16137
16329
|
name: entitlement.feature.icon,
|
|
@@ -16140,7 +16332,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
16140
16332
|
rounded: true
|
|
16141
16333
|
}
|
|
16142
16334
|
),
|
|
16143
|
-
entitlement.feature?.name && /* @__PURE__ */
|
|
16335
|
+
entitlement.feature?.name && /* @__PURE__ */ jsx33(Text, { display: props.icons.fontStyle, children: entitlement.feature.name }),
|
|
16144
16336
|
props.entitlementExpiration.isVisible && entitlement.entitlementExpirationDate && /* @__PURE__ */ jsxs26(
|
|
16145
16337
|
Text,
|
|
16146
16338
|
{
|
|
@@ -16158,7 +16350,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
16158
16350
|
]
|
|
16159
16351
|
}
|
|
16160
16352
|
),
|
|
16161
|
-
shouldShowDetails && /* @__PURE__ */
|
|
16353
|
+
shouldShowDetails && /* @__PURE__ */ jsx33(
|
|
16162
16354
|
UsageDetails,
|
|
16163
16355
|
{
|
|
16164
16356
|
entitlement,
|
|
@@ -16172,14 +16364,14 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
16172
16364
|
);
|
|
16173
16365
|
}),
|
|
16174
16366
|
shouldShowExpand && /* @__PURE__ */ jsxs26(Flex, { $alignItems: "center", $justifyContent: "start", $marginTop: "1rem", children: [
|
|
16175
|
-
/* @__PURE__ */
|
|
16367
|
+
/* @__PURE__ */ jsx33(
|
|
16176
16368
|
Icon3,
|
|
16177
16369
|
{
|
|
16178
16370
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
16179
16371
|
color: "#D0D0D0"
|
|
16180
16372
|
}
|
|
16181
16373
|
),
|
|
16182
|
-
/* @__PURE__ */
|
|
16374
|
+
/* @__PURE__ */ jsx33(
|
|
16183
16375
|
Text,
|
|
16184
16376
|
{
|
|
16185
16377
|
onClick: handleToggleShowAll,
|
|
@@ -16197,7 +16389,7 @@ IncludedFeatures.displayName = "IncludedFeatures";
|
|
|
16197
16389
|
|
|
16198
16390
|
// src/components/elements/invoices/Invoices.tsx
|
|
16199
16391
|
import { forwardRef as forwardRef8, useCallback as useCallback10, useEffect as useEffect6, useState as useState14 } from "react";
|
|
16200
|
-
import { Fragment as Fragment15, jsx as
|
|
16392
|
+
import { Fragment as Fragment15, jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
16201
16393
|
function resolveDesignProps3(props) {
|
|
16202
16394
|
return {
|
|
16203
16395
|
header: {
|
|
@@ -16268,7 +16460,7 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
16268
16460
|
return null;
|
|
16269
16461
|
}
|
|
16270
16462
|
return /* @__PURE__ */ jsxs27(Element, { ref, className, children: [
|
|
16271
|
-
/* @__PURE__ */
|
|
16463
|
+
/* @__PURE__ */ jsx34(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx34(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
|
|
16272
16464
|
error ? /* @__PURE__ */ jsxs27(
|
|
16273
16465
|
Flex,
|
|
16274
16466
|
{
|
|
@@ -16278,8 +16470,8 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
16278
16470
|
$alignItems: "center",
|
|
16279
16471
|
$gap: "1rem",
|
|
16280
16472
|
children: [
|
|
16281
|
-
/* @__PURE__ */
|
|
16282
|
-
/* @__PURE__ */
|
|
16473
|
+
/* @__PURE__ */ jsx34(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your invoices.") }),
|
|
16474
|
+
/* @__PURE__ */ jsx34(
|
|
16283
16475
|
Button,
|
|
16284
16476
|
{
|
|
16285
16477
|
type: "button",
|
|
@@ -16292,12 +16484,12 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
16292
16484
|
)
|
|
16293
16485
|
]
|
|
16294
16486
|
}
|
|
16295
|
-
) : !isLoading && /* @__PURE__ */
|
|
16296
|
-
props.header.isVisible && /* @__PURE__ */
|
|
16487
|
+
) : !isLoading && /* @__PURE__ */ jsx34(TransitionBox, { children: /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
16488
|
+
props.header.isVisible && /* @__PURE__ */ jsx34(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsx34(Text, { display: props.header.fontStyle, children: t2("Invoices") }) }),
|
|
16297
16489
|
invoices.length > 0 ? /* @__PURE__ */ jsxs27(Fragment15, { children: [
|
|
16298
|
-
/* @__PURE__ */
|
|
16490
|
+
/* @__PURE__ */ jsx34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, url }, index) => {
|
|
16299
16491
|
return /* @__PURE__ */ jsxs27(Flex, { $justifyContent: "space-between", children: [
|
|
16300
|
-
props.date.isVisible && /* @__PURE__ */
|
|
16492
|
+
props.date.isVisible && /* @__PURE__ */ jsx34(
|
|
16301
16493
|
Text,
|
|
16302
16494
|
{
|
|
16303
16495
|
display: props.date.fontStyle,
|
|
@@ -16311,18 +16503,18 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
16311
16503
|
children: date
|
|
16312
16504
|
}
|
|
16313
16505
|
),
|
|
16314
|
-
props.amount.isVisible && /* @__PURE__ */
|
|
16506
|
+
props.amount.isVisible && /* @__PURE__ */ jsx34(Text, { display: props.amount.fontStyle, children: amount })
|
|
16315
16507
|
] }, index);
|
|
16316
16508
|
}) }),
|
|
16317
16509
|
props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ jsxs27(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
16318
|
-
/* @__PURE__ */
|
|
16510
|
+
/* @__PURE__ */ jsx34(
|
|
16319
16511
|
Icon3,
|
|
16320
16512
|
{
|
|
16321
16513
|
name: `chevron-${listSize === props.limit.number ? "down" : "up"}`,
|
|
16322
16514
|
color: "#D0D0D0"
|
|
16323
16515
|
}
|
|
16324
16516
|
),
|
|
16325
|
-
/* @__PURE__ */
|
|
16517
|
+
/* @__PURE__ */ jsx34(
|
|
16326
16518
|
Text,
|
|
16327
16519
|
{
|
|
16328
16520
|
onClick: toggleListSize,
|
|
@@ -16334,7 +16526,7 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
16334
16526
|
}
|
|
16335
16527
|
)
|
|
16336
16528
|
] })
|
|
16337
|
-
] }) : /* @__PURE__ */
|
|
16529
|
+
] }) : /* @__PURE__ */ jsx34(Text, { display: "heading2", children: t2("No invoices created yet") })
|
|
16338
16530
|
] }) })
|
|
16339
16531
|
] });
|
|
16340
16532
|
});
|
|
@@ -16344,14 +16536,14 @@ Invoices.displayName = "Invoices";
|
|
|
16344
16536
|
import { forwardRef as forwardRef9, useCallback as useCallback11, useMemo as useMemo18, useRef as useRef10, useState as useState15 } from "react";
|
|
16345
16537
|
|
|
16346
16538
|
// src/components/elements/metered-features/Meter.tsx
|
|
16347
|
-
import { jsx as
|
|
16539
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
16348
16540
|
var Meter = ({ entitlement, usageDetails }) => {
|
|
16349
16541
|
const { priceBehavior, usage } = entitlement;
|
|
16350
16542
|
const limit = usageDetails.limit ?? usageDetails.currentTier?.to;
|
|
16351
16543
|
if (typeof usage !== "number" || !limit || limit === Infinity) {
|
|
16352
16544
|
return null;
|
|
16353
16545
|
}
|
|
16354
|
-
const meter = /* @__PURE__ */
|
|
16546
|
+
const meter = /* @__PURE__ */ jsx35(
|
|
16355
16547
|
ProgressBar,
|
|
16356
16548
|
{
|
|
16357
16549
|
progress: Math.min(usage, limit) / Math.max(usage, limit) * 100,
|
|
@@ -16368,7 +16560,7 @@ var Meter = ({ entitlement, usageDetails }) => {
|
|
|
16368
16560
|
};
|
|
16369
16561
|
|
|
16370
16562
|
// src/components/elements/metered-features/PriceDetails.tsx
|
|
16371
|
-
import { Fragment as Fragment16, jsx as
|
|
16563
|
+
import { Fragment as Fragment16, jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
16372
16564
|
var PriceDetails = ({
|
|
16373
16565
|
entitlement,
|
|
16374
16566
|
usageDetails,
|
|
@@ -16425,14 +16617,14 @@ var PriceDetails = ({
|
|
|
16425
16617
|
shortenPeriod(period)
|
|
16426
16618
|
] })
|
|
16427
16619
|
] })
|
|
16428
|
-
] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs28(Flex, { $alignItems: "
|
|
16620
|
+
] }) : priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs28(Flex, { $alignItems: "end", children: [
|
|
16429
16621
|
/* @__PURE__ */ jsxs28(Text, { children: [
|
|
16430
16622
|
t2("Tier"),
|
|
16431
16623
|
": ",
|
|
16432
16624
|
currentTier?.from || 1,
|
|
16433
|
-
typeof currentTier?.to === "number" && (currentTier?.from || 1) !== currentTier?.to && /* @__PURE__ */
|
|
16625
|
+
typeof currentTier?.to === "number" && (currentTier?.from || 1) !== currentTier?.to && /* @__PURE__ */ jsx36(Fragment16, { children: currentTier.to === Infinity ? "+" : `\u2013${currentTier.to}` })
|
|
16434
16626
|
] }),
|
|
16435
|
-
/* @__PURE__ */
|
|
16627
|
+
/* @__PURE__ */ jsx36(
|
|
16436
16628
|
PricingTiersTooltip,
|
|
16437
16629
|
{
|
|
16438
16630
|
period,
|
|
@@ -16443,7 +16635,7 @@ var PriceDetails = ({
|
|
|
16443
16635
|
}
|
|
16444
16636
|
)
|
|
16445
16637
|
] }),
|
|
16446
|
-
typeof amount === "number" && /* @__PURE__ */
|
|
16638
|
+
typeof amount === "number" && /* @__PURE__ */ jsx36(Fragment16, { children: priceBehavior === "overage" /* Overage */ ? /* @__PURE__ */ jsxs28(Text, { children: [
|
|
16447
16639
|
formatNumber(amount),
|
|
16448
16640
|
" ",
|
|
16449
16641
|
getFeatureName(feature, amount),
|
|
@@ -16483,7 +16675,7 @@ var Container2 = dt.div`
|
|
|
16483
16675
|
`;
|
|
16484
16676
|
|
|
16485
16677
|
// src/components/elements/metered-features/MeteredFeatures.tsx
|
|
16486
|
-
import { Fragment as Fragment17, jsx as
|
|
16678
|
+
import { Fragment as Fragment17, jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
16487
16679
|
var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
16488
16680
|
const { t: t2 } = useTranslation();
|
|
16489
16681
|
const { feature, priceBehavior, allocation, usage, metricResetAt } = entitlement;
|
|
@@ -16512,7 +16704,7 @@ var Limit = ({ entitlement, usageDetails, fontStyle }) => {
|
|
|
16512
16704
|
})
|
|
16513
16705
|
);
|
|
16514
16706
|
}
|
|
16515
|
-
return /* @__PURE__ */
|
|
16707
|
+
return /* @__PURE__ */ jsx37(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx37(Text, { display: fontStyle, children: acc.join(" \u2022 ") }) });
|
|
16516
16708
|
};
|
|
16517
16709
|
function resolveDesignProps4(props) {
|
|
16518
16710
|
return {
|
|
@@ -16605,7 +16797,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16605
16797
|
acc.push(
|
|
16606
16798
|
/* @__PURE__ */ jsxs29(Element, { as: Flex, $flexDirection: "column", $gap: "1.5rem", children: [
|
|
16607
16799
|
/* @__PURE__ */ jsxs29(Flex, { $gap: "1.5rem", children: [
|
|
16608
|
-
props.icon.isVisible && /* @__PURE__ */
|
|
16800
|
+
props.icon.isVisible && /* @__PURE__ */ jsx37(
|
|
16609
16801
|
Icon3,
|
|
16610
16802
|
{
|
|
16611
16803
|
name: feature.icon,
|
|
@@ -16627,8 +16819,8 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16627
16819
|
$gap: "1rem",
|
|
16628
16820
|
children: [
|
|
16629
16821
|
/* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
|
|
16630
|
-
/* @__PURE__ */
|
|
16631
|
-
props.description.isVisible && /* @__PURE__ */
|
|
16822
|
+
/* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.header.fontStyle, children: feature.name }) }),
|
|
16823
|
+
props.description.isVisible && /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.description.fontStyle, children: feature.description }) })
|
|
16632
16824
|
] }),
|
|
16633
16825
|
/* @__PURE__ */ jsxs29(
|
|
16634
16826
|
Box,
|
|
@@ -16637,7 +16829,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16637
16829
|
$flexGrow: 1,
|
|
16638
16830
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
16639
16831
|
children: [
|
|
16640
|
-
props.usage.isVisible && /* @__PURE__ */
|
|
16832
|
+
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: [
|
|
16641
16833
|
typeof limit === "number" && /* @__PURE__ */ jsxs29(Fragment17, { children: [
|
|
16642
16834
|
formatNumber(limit),
|
|
16643
16835
|
" "
|
|
@@ -16650,7 +16842,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16650
16842
|
" ",
|
|
16651
16843
|
t2("used")
|
|
16652
16844
|
] }) }) }),
|
|
16653
|
-
props.allocation.isVisible && /* @__PURE__ */
|
|
16845
|
+
props.allocation.isVisible && /* @__PURE__ */ jsx37(
|
|
16654
16846
|
Limit,
|
|
16655
16847
|
{
|
|
16656
16848
|
entitlement,
|
|
@@ -16664,14 +16856,14 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16664
16856
|
]
|
|
16665
16857
|
}
|
|
16666
16858
|
),
|
|
16667
|
-
props.isVisible && priceBehavior !== "pay_as_you_go" /* PayAsYouGo */ && /* @__PURE__ */
|
|
16859
|
+
props.isVisible && priceBehavior !== "pay_as_you_go" /* PayAsYouGo */ && /* @__PURE__ */ jsx37(
|
|
16668
16860
|
Meter,
|
|
16669
16861
|
{
|
|
16670
16862
|
entitlement,
|
|
16671
16863
|
usageDetails
|
|
16672
16864
|
}
|
|
16673
16865
|
),
|
|
16674
|
-
priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */
|
|
16866
|
+
priceBehavior === "pay_in_advance" /* PayInAdvance */ && /* @__PURE__ */ jsx37(
|
|
16675
16867
|
Button,
|
|
16676
16868
|
{
|
|
16677
16869
|
type: "button",
|
|
@@ -16684,7 +16876,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16684
16876
|
)
|
|
16685
16877
|
] })
|
|
16686
16878
|
] }),
|
|
16687
|
-
(priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */
|
|
16879
|
+
(priceBehavior === "overage" /* Overage */ || priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsx37(
|
|
16688
16880
|
PriceDetails,
|
|
16689
16881
|
{
|
|
16690
16882
|
entitlement,
|
|
@@ -16700,7 +16892,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16700
16892
|
const isExpanded = creditVisibility.find(({ id }) => credit.id === id)?.isExpanded ?? false;
|
|
16701
16893
|
return /* @__PURE__ */ jsxs29(Element, { as: Flex, $flexDirection: "column", $gap: "1rem", children: [
|
|
16702
16894
|
/* @__PURE__ */ jsxs29(Flex, { $gap: "1.5rem", children: [
|
|
16703
|
-
props.icon.isVisible && /* @__PURE__ */
|
|
16895
|
+
props.icon.isVisible && /* @__PURE__ */ jsx37(
|
|
16704
16896
|
Icon3,
|
|
16705
16897
|
{
|
|
16706
16898
|
name: credit.icon,
|
|
@@ -16710,12 +16902,12 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16710
16902
|
}
|
|
16711
16903
|
),
|
|
16712
16904
|
/* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
|
|
16713
|
-
/* @__PURE__ */
|
|
16714
|
-
/* @__PURE__ */
|
|
16715
|
-
props.description.isVisible && /* @__PURE__ */
|
|
16905
|
+
/* @__PURE__ */ jsx37(Flex, { $flexWrap: "wrap", $gap: "1rem", children: /* @__PURE__ */ jsxs29(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
|
|
16906
|
+
/* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.header.fontStyle, children: credit.name }) }),
|
|
16907
|
+
props.description.isVisible && /* @__PURE__ */ jsx37(Box, { children: /* @__PURE__ */ jsx37(Text, { display: props.description.fontStyle, children: credit.description }) })
|
|
16716
16908
|
] }) }),
|
|
16717
16909
|
/* @__PURE__ */ jsxs29(Flex, { $gap: "1rem", children: [
|
|
16718
|
-
/* @__PURE__ */
|
|
16910
|
+
/* @__PURE__ */ jsx37(
|
|
16719
16911
|
ProgressBar,
|
|
16720
16912
|
{
|
|
16721
16913
|
progress: credit.total.used / credit.total.value * 100,
|
|
@@ -16726,7 +16918,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16726
16918
|
)]
|
|
16727
16919
|
}
|
|
16728
16920
|
),
|
|
16729
|
-
/* @__PURE__ */
|
|
16921
|
+
/* @__PURE__ */ jsx37(
|
|
16730
16922
|
Button,
|
|
16731
16923
|
{
|
|
16732
16924
|
type: "button",
|
|
@@ -16741,12 +16933,12 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16741
16933
|
] })
|
|
16742
16934
|
] })
|
|
16743
16935
|
] }),
|
|
16744
|
-
/* @__PURE__ */
|
|
16936
|
+
/* @__PURE__ */ jsx37(
|
|
16745
16937
|
Box,
|
|
16746
16938
|
{
|
|
16747
16939
|
$width: `calc(100% + ${2 * settings.theme.card.padding / TEXT_BASE_SIZE}rem)`,
|
|
16748
16940
|
$margin: `0 0 0 -${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
16749
|
-
children: /* @__PURE__ */
|
|
16941
|
+
children: /* @__PURE__ */ jsx37(
|
|
16750
16942
|
TransitionBox,
|
|
16751
16943
|
{
|
|
16752
16944
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.0375)" : "hsla(0, 0%, 100%, 0.075)",
|
|
@@ -16754,19 +16946,19 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16754
16946
|
children: credit.grants.map((grant, index2) => {
|
|
16755
16947
|
const paddingX = settings.theme.card.padding / TEXT_BASE_SIZE;
|
|
16756
16948
|
const padding = index2 > 0 ? `0 ${paddingX}rem 1rem` : `1rem ${paddingX}rem`;
|
|
16757
|
-
return /* @__PURE__ */
|
|
16758
|
-
/* @__PURE__ */
|
|
16949
|
+
return /* @__PURE__ */ jsx37(Box, { $display: "table-row", children: grant.grantReason === "plan" /* Plan */ ? /* @__PURE__ */ jsxs29(Fragment17, { children: [
|
|
16950
|
+
/* @__PURE__ */ jsx37(Box, { $display: "table-cell", $padding: padding, children: /* @__PURE__ */ jsx37(Text, { children: t2("X items included in plan", {
|
|
16759
16951
|
amount: grant.quantity,
|
|
16760
16952
|
item: getFeatureName(credit, grant.quantity)
|
|
16761
16953
|
}) }) }),
|
|
16762
|
-
/* @__PURE__ */
|
|
16954
|
+
/* @__PURE__ */ jsx37(
|
|
16763
16955
|
Box,
|
|
16764
16956
|
{
|
|
16765
16957
|
$display: "table-cell",
|
|
16766
16958
|
$padding: padding,
|
|
16767
16959
|
$textAlign: "right",
|
|
16768
16960
|
$whiteSpace: "nowrap",
|
|
16769
|
-
children: grant.expiresAt && /* @__PURE__ */
|
|
16961
|
+
children: grant.expiresAt && /* @__PURE__ */ jsx37(Text, { children: t2("Resets", {
|
|
16770
16962
|
date: toPrettyDate(
|
|
16771
16963
|
modifyDate(grant.expiresAt, 1),
|
|
16772
16964
|
{
|
|
@@ -16779,7 +16971,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16779
16971
|
}
|
|
16780
16972
|
)
|
|
16781
16973
|
] }) : /* @__PURE__ */ jsxs29(Fragment17, { children: [
|
|
16782
|
-
/* @__PURE__ */
|
|
16974
|
+
/* @__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", {
|
|
16783
16975
|
amount: grant.quantity,
|
|
16784
16976
|
item: getFeatureName(credit, 1),
|
|
16785
16977
|
createdAt: toPrettyDate(grant.createdAt, {
|
|
@@ -16787,7 +16979,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16787
16979
|
month: "2-digit",
|
|
16788
16980
|
year: "2-digit"
|
|
16789
16981
|
})
|
|
16790
|
-
}) }) : /* @__PURE__ */
|
|
16982
|
+
}) }) : /* @__PURE__ */ jsx37(Fragment17, { children: t2("X item grant", {
|
|
16791
16983
|
amount: grant.quantity,
|
|
16792
16984
|
item: getFeatureName(
|
|
16793
16985
|
credit,
|
|
@@ -16799,14 +16991,14 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16799
16991
|
year: "2-digit"
|
|
16800
16992
|
})
|
|
16801
16993
|
}) }) }) }),
|
|
16802
|
-
/* @__PURE__ */
|
|
16994
|
+
/* @__PURE__ */ jsx37(
|
|
16803
16995
|
Box,
|
|
16804
16996
|
{
|
|
16805
16997
|
$display: "table-cell",
|
|
16806
16998
|
$padding: padding,
|
|
16807
16999
|
$textAlign: "right",
|
|
16808
17000
|
$whiteSpace: "nowrap",
|
|
16809
|
-
children: grant.expiresAt && /* @__PURE__ */
|
|
17001
|
+
children: grant.expiresAt && /* @__PURE__ */ jsx37(Text, { children: t2("Expires", {
|
|
16810
17002
|
date: toPrettyDate(
|
|
16811
17003
|
modifyDate(grant.expiresAt, 1),
|
|
16812
17004
|
{
|
|
@@ -16825,7 +17017,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16825
17017
|
}
|
|
16826
17018
|
),
|
|
16827
17019
|
/* @__PURE__ */ jsxs29(Flex, { $gap: "0.25rem", children: [
|
|
16828
|
-
/* @__PURE__ */
|
|
17020
|
+
/* @__PURE__ */ jsx37(
|
|
16829
17021
|
Icon3,
|
|
16830
17022
|
{
|
|
16831
17023
|
name: "chevron-down",
|
|
@@ -16836,7 +17028,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
16836
17028
|
}
|
|
16837
17029
|
}
|
|
16838
17030
|
),
|
|
16839
|
-
/* @__PURE__ */
|
|
17031
|
+
/* @__PURE__ */ jsx37(
|
|
16840
17032
|
Text,
|
|
16841
17033
|
{
|
|
16842
17034
|
onClick: () => toggleBalanceDetails(credit.id),
|
|
@@ -16856,24 +17048,24 @@ import { forwardRef as forwardRef10, useMemo as useMemo20 } from "react";
|
|
|
16856
17048
|
|
|
16857
17049
|
// src/components/elements/payment-method/PaymentMethodElement.tsx
|
|
16858
17050
|
import { useMemo as useMemo19 } from "react";
|
|
16859
|
-
import { jsx as
|
|
17051
|
+
import { jsx as jsx38, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
16860
17052
|
var PaymentElement2 = ({
|
|
16861
17053
|
iconName,
|
|
16862
17054
|
iconTitle,
|
|
16863
17055
|
label,
|
|
16864
17056
|
paymentLast4
|
|
16865
17057
|
}) => {
|
|
16866
|
-
return /* @__PURE__ */
|
|
16867
|
-
iconName && /* @__PURE__ */
|
|
17058
|
+
return /* @__PURE__ */ jsx38(Text, { children: /* @__PURE__ */ jsxs30(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
|
|
17059
|
+
iconName && /* @__PURE__ */ jsx38(Icon3, { name: iconName, title: iconTitle }),
|
|
16868
17060
|
(label || paymentLast4) && /* @__PURE__ */ jsxs30(Box, { $flexGrow: 1, children: [
|
|
16869
|
-
label && /* @__PURE__ */
|
|
17061
|
+
label && /* @__PURE__ */ jsx38(Text, { children: label }),
|
|
16870
17062
|
" ",
|
|
16871
|
-
paymentLast4 && /* @__PURE__ */
|
|
17063
|
+
paymentLast4 && /* @__PURE__ */ jsx38(Text, { children: paymentLast4 })
|
|
16872
17064
|
] })
|
|
16873
17065
|
] }) });
|
|
16874
17066
|
};
|
|
16875
17067
|
var EmptyPaymentElement = () => {
|
|
16876
|
-
return /* @__PURE__ */
|
|
17068
|
+
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") }) }) }) });
|
|
16877
17069
|
};
|
|
16878
17070
|
var getPaymentMethodData = ({
|
|
16879
17071
|
accountLast4,
|
|
@@ -16940,8 +17132,8 @@ var PaymentMethodElement = ({
|
|
|
16940
17132
|
const sizeFactor = size === "lg" ? 1.5 : size === "md" ? 1 : 0.5;
|
|
16941
17133
|
return /* @__PURE__ */ jsxs30(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
|
|
16942
17134
|
props.header.isVisible && /* @__PURE__ */ jsxs30(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
|
|
16943
|
-
/* @__PURE__ */
|
|
16944
|
-
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */
|
|
17135
|
+
/* @__PURE__ */ jsx38(Text, { display: props.header.fontStyle, children: t2("Payment Method") }),
|
|
17136
|
+
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") })
|
|
16945
17137
|
] }),
|
|
16946
17138
|
/* @__PURE__ */ jsxs30(
|
|
16947
17139
|
Flex,
|
|
@@ -16952,8 +17144,8 @@ var PaymentMethodElement = ({
|
|
|
16952
17144
|
$padding: `${sizeFactor / 2.25}rem ${sizeFactor}rem`,
|
|
16953
17145
|
$borderRadius: "9999px",
|
|
16954
17146
|
children: [
|
|
16955
|
-
paymentMethod ? /* @__PURE__ */
|
|
16956
|
-
props.functions.allowEdit && onEdit && /* @__PURE__ */
|
|
17147
|
+
paymentMethod ? /* @__PURE__ */ jsx38(PaymentElement2, { ...getPaymentMethodData(paymentMethod) }) : /* @__PURE__ */ jsx38(EmptyPaymentElement, {}),
|
|
17148
|
+
props.functions.allowEdit && onEdit && /* @__PURE__ */ jsx38(
|
|
16957
17149
|
Text,
|
|
16958
17150
|
{
|
|
16959
17151
|
onClick: onEdit,
|
|
@@ -16998,21 +17190,21 @@ var PaymentListElement = ({
|
|
|
16998
17190
|
$borderStyle: "solid",
|
|
16999
17191
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
|
|
17000
17192
|
children: [
|
|
17001
|
-
iconName && /* @__PURE__ */
|
|
17193
|
+
iconName && /* @__PURE__ */ jsx38(Icon3, { name: iconName, title: iconTitle }),
|
|
17002
17194
|
(label || paymentLast4) && /* @__PURE__ */ jsxs30(Box, { $flexGrow: 1, children: [
|
|
17003
|
-
label && /* @__PURE__ */
|
|
17195
|
+
label && /* @__PURE__ */ jsx38(Text, { children: label }),
|
|
17004
17196
|
" ",
|
|
17005
|
-
paymentLast4 && /* @__PURE__ */
|
|
17197
|
+
paymentLast4 && /* @__PURE__ */ jsx38(Text, { children: paymentLast4 })
|
|
17006
17198
|
] }),
|
|
17007
|
-
expirationDate && /* @__PURE__ */
|
|
17199
|
+
expirationDate && /* @__PURE__ */ jsx38(
|
|
17008
17200
|
Box,
|
|
17009
17201
|
{
|
|
17010
17202
|
$flexGrow: 1,
|
|
17011
17203
|
$color: isLightBackground ? "hsla(0, 0%, 0%, 0.375)" : "hsla(0, 0%, 100%, 0.375)",
|
|
17012
|
-
children: /* @__PURE__ */
|
|
17204
|
+
children: /* @__PURE__ */ jsx38(Text, { children: t("Expires", { date: expirationDate }) })
|
|
17013
17205
|
}
|
|
17014
17206
|
),
|
|
17015
|
-
/* @__PURE__ */
|
|
17207
|
+
/* @__PURE__ */ jsx38(Box, { children: /* @__PURE__ */ jsx38(
|
|
17016
17208
|
Text,
|
|
17017
17209
|
{
|
|
17018
17210
|
onClick: () => {
|
|
@@ -17025,7 +17217,7 @@ var PaymentListElement = ({
|
|
|
17025
17217
|
children: t("Set default")
|
|
17026
17218
|
}
|
|
17027
17219
|
) }),
|
|
17028
|
-
/* @__PURE__ */
|
|
17220
|
+
/* @__PURE__ */ jsx38(
|
|
17029
17221
|
Icon3,
|
|
17030
17222
|
{
|
|
17031
17223
|
tabIndex: 0,
|
|
@@ -17047,7 +17239,7 @@ var PaymentListElement = ({
|
|
|
17047
17239
|
};
|
|
17048
17240
|
|
|
17049
17241
|
// src/components/elements/payment-method/PaymentMethod.tsx
|
|
17050
|
-
import { jsx as
|
|
17242
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
17051
17243
|
var resolveDesignProps5 = (props) => {
|
|
17052
17244
|
return {
|
|
17053
17245
|
header: {
|
|
@@ -17088,7 +17280,7 @@ var PaymentMethod = forwardRef10(({ children, className, portal, allowEdit = tru
|
|
|
17088
17280
|
monthsToExpiration: void 0
|
|
17089
17281
|
};
|
|
17090
17282
|
}, [data]);
|
|
17091
|
-
return /* @__PURE__ */
|
|
17283
|
+
return /* @__PURE__ */ jsx39(Element, { ref, className, children: /* @__PURE__ */ jsx39(
|
|
17092
17284
|
PaymentMethodElement,
|
|
17093
17285
|
{
|
|
17094
17286
|
paymentMethod,
|
|
@@ -17257,7 +17449,7 @@ var loadStripe = function loadStripe2() {
|
|
|
17257
17449
|
|
|
17258
17450
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
17259
17451
|
import { useCallback as useCallback12, useEffect as useEffect7, useMemo as useMemo21, useState as useState16 } from "react";
|
|
17260
|
-
import { jsx as
|
|
17452
|
+
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
17261
17453
|
var resolveDesignProps6 = () => {
|
|
17262
17454
|
return {
|
|
17263
17455
|
header: {
|
|
@@ -17397,7 +17589,7 @@ var PaymentMethodDetails = ({
|
|
|
17397
17589
|
initializePaymentMethod
|
|
17398
17590
|
]);
|
|
17399
17591
|
return /* @__PURE__ */ jsxs31(Flex, { $position: "relative", children: [
|
|
17400
|
-
/* @__PURE__ */
|
|
17592
|
+
/* @__PURE__ */ jsx40(
|
|
17401
17593
|
Flex,
|
|
17402
17594
|
{
|
|
17403
17595
|
$position: "absolute",
|
|
@@ -17406,7 +17598,7 @@ var PaymentMethodDetails = ({
|
|
|
17406
17598
|
$alignItems: "center",
|
|
17407
17599
|
$width: "100%",
|
|
17408
17600
|
$height: "100%",
|
|
17409
|
-
children: /* @__PURE__ */
|
|
17601
|
+
children: /* @__PURE__ */ jsx40(
|
|
17410
17602
|
Loader,
|
|
17411
17603
|
{
|
|
17412
17604
|
$color: settings.theme.primary,
|
|
@@ -17459,7 +17651,7 @@ var PaymentMethodDetails = ({
|
|
|
17459
17651
|
clientSecret: setupIntent?.setupIntentClientSecret
|
|
17460
17652
|
},
|
|
17461
17653
|
children: [
|
|
17462
|
-
/* @__PURE__ */
|
|
17654
|
+
/* @__PURE__ */ jsx40(
|
|
17463
17655
|
PaymentForm,
|
|
17464
17656
|
{
|
|
17465
17657
|
onConfirm: async (paymentMethodId) => {
|
|
@@ -17469,7 +17661,7 @@ var PaymentMethodDetails = ({
|
|
|
17469
17661
|
}
|
|
17470
17662
|
}
|
|
17471
17663
|
),
|
|
17472
|
-
currentPaymentMethod && /* @__PURE__ */
|
|
17664
|
+
currentPaymentMethod && /* @__PURE__ */ jsx40(Box, { children: /* @__PURE__ */ jsx40(
|
|
17473
17665
|
Text,
|
|
17474
17666
|
{
|
|
17475
17667
|
onClick: focusExistingPaymentMethods,
|
|
@@ -17483,7 +17675,7 @@ var PaymentMethodDetails = ({
|
|
|
17483
17675
|
]
|
|
17484
17676
|
}
|
|
17485
17677
|
) : /* @__PURE__ */ jsxs31(Flex, { $flexDirection: "column", $gap: "2rem", children: [
|
|
17486
|
-
/* @__PURE__ */
|
|
17678
|
+
/* @__PURE__ */ jsx40(
|
|
17487
17679
|
PaymentMethodElement,
|
|
17488
17680
|
{
|
|
17489
17681
|
paymentMethod: currentPaymentMethod,
|
|
@@ -17492,7 +17684,7 @@ var PaymentMethodDetails = ({
|
|
|
17492
17684
|
}
|
|
17493
17685
|
),
|
|
17494
17686
|
paymentMethods.length > 0 && /* @__PURE__ */ jsxs31(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
17495
|
-
/* @__PURE__ */
|
|
17687
|
+
/* @__PURE__ */ jsx40(
|
|
17496
17688
|
Text,
|
|
17497
17689
|
{
|
|
17498
17690
|
onClick: toggleShowPaymentMethods,
|
|
@@ -17503,7 +17695,7 @@ var PaymentMethodDetails = ({
|
|
|
17503
17695
|
children: t2("Choose different payment method")
|
|
17504
17696
|
}
|
|
17505
17697
|
),
|
|
17506
|
-
/* @__PURE__ */
|
|
17698
|
+
/* @__PURE__ */ jsx40(
|
|
17507
17699
|
Icon3,
|
|
17508
17700
|
{
|
|
17509
17701
|
name: showDifferentPaymentMethods ? "chevron-up" : "chevron-down"
|
|
@@ -17511,9 +17703,9 @@ var PaymentMethodDetails = ({
|
|
|
17511
17703
|
)
|
|
17512
17704
|
] }),
|
|
17513
17705
|
showDifferentPaymentMethods && /* @__PURE__ */ jsxs31(Flex, { $flexDirection: "column", $gap: "2rem", $marginTop: "-1rem", children: [
|
|
17514
|
-
/* @__PURE__ */
|
|
17706
|
+
/* @__PURE__ */ jsx40(Flex, { $flexDirection: "column", $overflow: "auto", children: (paymentMethods.filter(
|
|
17515
17707
|
(paymentMethod) => paymentMethod.id !== currentPaymentMethod?.id
|
|
17516
|
-
) || []).map((paymentMethod) => /* @__PURE__ */
|
|
17708
|
+
) || []).map((paymentMethod) => /* @__PURE__ */ jsx40(
|
|
17517
17709
|
PaymentListElement,
|
|
17518
17710
|
{
|
|
17519
17711
|
paymentMethod,
|
|
@@ -17522,7 +17714,7 @@ var PaymentMethodDetails = ({
|
|
|
17522
17714
|
},
|
|
17523
17715
|
paymentMethod.id
|
|
17524
17716
|
)) }),
|
|
17525
|
-
(!setupIntent || !currentPaymentMethod) && /* @__PURE__ */
|
|
17717
|
+
(!setupIntent || !currentPaymentMethod) && /* @__PURE__ */ jsx40(
|
|
17526
17718
|
Button,
|
|
17527
17719
|
{
|
|
17528
17720
|
type: "button",
|
|
@@ -17534,7 +17726,7 @@ var PaymentMethodDetails = ({
|
|
|
17534
17726
|
)
|
|
17535
17727
|
] })
|
|
17536
17728
|
] }),
|
|
17537
|
-
!isLoading && error && /* @__PURE__ */
|
|
17729
|
+
!isLoading && error && /* @__PURE__ */ jsx40(Box, { children: /* @__PURE__ */ jsx40(Text, { $weight: 500, $color: "#DB6669", children: error }) })
|
|
17538
17730
|
]
|
|
17539
17731
|
}
|
|
17540
17732
|
)
|
|
@@ -17545,7 +17737,7 @@ var PaymentMethodDetails = ({
|
|
|
17545
17737
|
import { forwardRef as forwardRef11, useMemo as useMemo23 } from "react";
|
|
17546
17738
|
|
|
17547
17739
|
// src/components/elements/plan-manager/AddOn.tsx
|
|
17548
|
-
import { jsx as
|
|
17740
|
+
import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
17549
17741
|
var AddOn = ({ addOn, currency, layout }) => {
|
|
17550
17742
|
return /* @__PURE__ */ jsxs32(
|
|
17551
17743
|
Flex,
|
|
@@ -17555,10 +17747,10 @@ var AddOn = ({ addOn, currency, layout }) => {
|
|
|
17555
17747
|
$flexWrap: "wrap",
|
|
17556
17748
|
$gap: "1rem",
|
|
17557
17749
|
children: [
|
|
17558
|
-
/* @__PURE__ */
|
|
17750
|
+
/* @__PURE__ */ jsx41(Text, { display: layout.addOns.fontStyle, children: addOn.name }),
|
|
17559
17751
|
typeof addOn.planPrice === "number" && addOn.planPeriod && /* @__PURE__ */ jsxs32(Text, { children: [
|
|
17560
17752
|
formatCurrency(addOn.planPrice, currency),
|
|
17561
|
-
/* @__PURE__ */
|
|
17753
|
+
/* @__PURE__ */ jsx41("sub", { children: addOn.planPeriod == "one-time" ? shortenPeriod(addOn.planPeriod) : `/${shortenPeriod(addOn.planPeriod)}` })
|
|
17562
17754
|
] })
|
|
17563
17755
|
]
|
|
17564
17756
|
}
|
|
@@ -17567,7 +17759,7 @@ var AddOn = ({ addOn, currency, layout }) => {
|
|
|
17567
17759
|
|
|
17568
17760
|
// src/components/elements/plan-manager/UsageDetails.tsx
|
|
17569
17761
|
import { Fragment as Fragment18, useMemo as useMemo22 } from "react";
|
|
17570
|
-
import { Fragment as Fragment19, jsx as
|
|
17762
|
+
import { Fragment as Fragment19, jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
17571
17763
|
var UsageDetails2 = ({
|
|
17572
17764
|
entitlement,
|
|
17573
17765
|
period,
|
|
@@ -17589,7 +17781,7 @@ var UsageDetails2 = ({
|
|
|
17589
17781
|
let index = 0;
|
|
17590
17782
|
if (entitlement.priceBehavior === "overage" /* Overage */) {
|
|
17591
17783
|
acc.push(
|
|
17592
|
-
amount > 0 ? /* @__PURE__ */
|
|
17784
|
+
amount > 0 ? /* @__PURE__ */ jsx42(Fragment18, { children: t2("X additional", {
|
|
17593
17785
|
amount
|
|
17594
17786
|
}) }, index) : /* @__PURE__ */ jsxs33(Fragment18, { children: [
|
|
17595
17787
|
t2("Additional"),
|
|
@@ -17661,13 +17853,13 @@ var UsageDetails2 = ({
|
|
|
17661
17853
|
$flexWrap: "wrap",
|
|
17662
17854
|
$gap: "0.5rem",
|
|
17663
17855
|
children: [
|
|
17664
|
-
/* @__PURE__ */
|
|
17856
|
+
/* @__PURE__ */ jsx42(Text, { display: layout.addOns.fontStyle, children: typeof quantity === "number" && quantity > 0 ? /* @__PURE__ */ jsxs33(Fragment19, { children: [
|
|
17665
17857
|
quantity,
|
|
17666
17858
|
" ",
|
|
17667
17859
|
entitlement.feature.name
|
|
17668
17860
|
] }) : entitlement.feature.name }),
|
|
17669
17861
|
/* @__PURE__ */ jsxs33(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
17670
|
-
description.length > 0 && /* @__PURE__ */
|
|
17862
|
+
description.length > 0 && /* @__PURE__ */ jsx42(
|
|
17671
17863
|
Text,
|
|
17672
17864
|
{
|
|
17673
17865
|
style: { opacity: 0.54 },
|
|
@@ -17676,8 +17868,15 @@ var UsageDetails2 = ({
|
|
|
17676
17868
|
children: description
|
|
17677
17869
|
}
|
|
17678
17870
|
),
|
|
17679
|
-
(cost > 0 || entitlement.priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsxs33(Flex, { $alignItems: "
|
|
17680
|
-
|
|
17871
|
+
(cost > 0 || entitlement.priceBehavior === "tier" /* Tiered */) && /* @__PURE__ */ jsxs33(Flex, { $alignItems: "end", children: [
|
|
17872
|
+
/* @__PURE__ */ jsxs33(Text, { children: [
|
|
17873
|
+
formatCurrency(cost, billingPrice?.currency),
|
|
17874
|
+
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs33("sub", { children: [
|
|
17875
|
+
"/",
|
|
17876
|
+
shortenPeriod(period)
|
|
17877
|
+
] })
|
|
17878
|
+
] }),
|
|
17879
|
+
entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsx42(
|
|
17681
17880
|
PricingTiersTooltip,
|
|
17682
17881
|
{
|
|
17683
17882
|
feature: entitlement.feature,
|
|
@@ -17685,14 +17884,7 @@ var UsageDetails2 = ({
|
|
|
17685
17884
|
currency: billingPrice?.currency,
|
|
17686
17885
|
priceTiers: billingPrice?.priceTier
|
|
17687
17886
|
}
|
|
17688
|
-
)
|
|
17689
|
-
/* @__PURE__ */ jsxs33(Text, { children: [
|
|
17690
|
-
formatCurrency(cost, billingPrice?.currency),
|
|
17691
|
-
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs33("sub", { children: [
|
|
17692
|
-
"/",
|
|
17693
|
-
shortenPeriod(period)
|
|
17694
|
-
] })
|
|
17695
|
-
] })
|
|
17887
|
+
)
|
|
17696
17888
|
] })
|
|
17697
17889
|
] })
|
|
17698
17890
|
]
|
|
@@ -17701,7 +17893,7 @@ var UsageDetails2 = ({
|
|
|
17701
17893
|
};
|
|
17702
17894
|
|
|
17703
17895
|
// src/components/elements/plan-manager/PlanManager.tsx
|
|
17704
|
-
import { Fragment as Fragment20, jsx as
|
|
17896
|
+
import { Fragment as Fragment20, jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
17705
17897
|
var resolveDesignProps7 = (props) => {
|
|
17706
17898
|
return {
|
|
17707
17899
|
header: {
|
|
@@ -17757,11 +17949,29 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17757
17949
|
featureUsage: featureUsage2,
|
|
17758
17950
|
trialPaymentMethodRequired: trialPaymentMethodRequired2
|
|
17759
17951
|
} = data;
|
|
17952
|
+
const creditGroups2 = groupCreditGrants(creditGrants, {
|
|
17953
|
+
groupBy: "bundle"
|
|
17954
|
+
}).reduce(
|
|
17955
|
+
(acc, grant) => {
|
|
17956
|
+
switch (grant.grantReason) {
|
|
17957
|
+
case "plan" /* Plan */:
|
|
17958
|
+
acc.plan.push(grant);
|
|
17959
|
+
break;
|
|
17960
|
+
case "purchased" /* Purchased */:
|
|
17961
|
+
acc.bundles.push(grant);
|
|
17962
|
+
break;
|
|
17963
|
+
case "free" /* Free */:
|
|
17964
|
+
acc.promotional.push(grant);
|
|
17965
|
+
}
|
|
17966
|
+
return acc;
|
|
17967
|
+
},
|
|
17968
|
+
{ plan: [], bundles: [], promotional: [] }
|
|
17969
|
+
);
|
|
17760
17970
|
return {
|
|
17761
17971
|
currentPlan: company?.plan,
|
|
17762
17972
|
currentAddOns: company?.addOns || [],
|
|
17763
17973
|
creditBundles: creditBundles2,
|
|
17764
|
-
creditGroups:
|
|
17974
|
+
creditGroups: creditGroups2,
|
|
17765
17975
|
billingSubscription: company?.billingSubscription,
|
|
17766
17976
|
canCheckout: capabilities?.checkout ?? true,
|
|
17767
17977
|
defaultPlan: defaultPlan2,
|
|
@@ -17773,7 +17983,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17773
17983
|
currentPlan: void 0,
|
|
17774
17984
|
currentAddOns: [],
|
|
17775
17985
|
creditBundles: [],
|
|
17776
|
-
creditGroups: [],
|
|
17986
|
+
creditGroups: { plan: [], bundles: [], promotional: [] },
|
|
17777
17987
|
billingSubscription: void 0,
|
|
17778
17988
|
canCheckout: false,
|
|
17779
17989
|
defaultPlan: void 0,
|
|
@@ -17814,8 +18024,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17814
18024
|
$textAlign: "center",
|
|
17815
18025
|
$backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
|
|
17816
18026
|
children: [
|
|
17817
|
-
typeof trialEnd.formatted !== "undefined" && /* @__PURE__ */
|
|
17818
|
-
/* @__PURE__ */
|
|
18027
|
+
typeof trialEnd.formatted !== "undefined" && /* @__PURE__ */ jsx43(Text, { as: "h3", display: "heading3", children: trialEnd.formatted }),
|
|
18028
|
+
/* @__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", {
|
|
17819
18029
|
defaultPlanName: defaultPlan?.name
|
|
17820
18030
|
}) : t2("After the trial, cancel no default", {
|
|
17821
18031
|
planName: currentPlan?.name
|
|
@@ -17832,8 +18042,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17832
18042
|
$textAlign: "center",
|
|
17833
18043
|
$backgroundColor: isLightBackground ? darken(settings.theme.card.background, 0.04) : lighten(settings.theme.card.background, 0.04),
|
|
17834
18044
|
children: [
|
|
17835
|
-
/* @__PURE__ */
|
|
17836
|
-
typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */
|
|
18045
|
+
/* @__PURE__ */ jsx43(Text, { as: "h3", display: "heading3", children: t2("Subscription canceled") }),
|
|
18046
|
+
typeof billingSubscription?.cancelAt === "number" && /* @__PURE__ */ jsx43(
|
|
17837
18047
|
Text,
|
|
17838
18048
|
{
|
|
17839
18049
|
as: "p",
|
|
@@ -17868,11 +18078,11 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17868
18078
|
$gap: "1rem",
|
|
17869
18079
|
children: [
|
|
17870
18080
|
/* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
17871
|
-
/* @__PURE__ */
|
|
17872
|
-
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */
|
|
18081
|
+
/* @__PURE__ */ jsx43(Text, { display: props.header.title.fontStyle, $leading: 1, children: currentPlan.name }),
|
|
18082
|
+
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ jsx43(Text, { display: props.header.description.fontStyle, children: currentPlan.description })
|
|
17873
18083
|
] }),
|
|
17874
18084
|
props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ jsxs34(Box, { children: [
|
|
17875
|
-
/* @__PURE__ */
|
|
18085
|
+
/* @__PURE__ */ jsx43(
|
|
17876
18086
|
Text,
|
|
17877
18087
|
{
|
|
17878
18088
|
display: isUsageBasedPlan ? "heading3" : props.header.price.fontStyle,
|
|
@@ -17882,7 +18092,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17882
18092
|
)
|
|
17883
18093
|
}
|
|
17884
18094
|
),
|
|
17885
|
-
!isUsageBasedPlan && /* @__PURE__ */
|
|
18095
|
+
!isUsageBasedPlan && /* @__PURE__ */ jsx43(Text, { display: props.header.price.fontStyle, children: /* @__PURE__ */ jsxs34("sub", { children: [
|
|
17886
18096
|
"/",
|
|
17887
18097
|
shortenPeriod(currentPlan.planPeriod)
|
|
17888
18098
|
] }) })
|
|
@@ -17891,7 +18101,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17891
18101
|
}
|
|
17892
18102
|
),
|
|
17893
18103
|
props.addOns.isVisible && currentAddOns.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
17894
|
-
props.addOns.showLabel && /* @__PURE__ */
|
|
18104
|
+
props.addOns.showLabel && /* @__PURE__ */ jsx43(
|
|
17895
18105
|
Text,
|
|
17896
18106
|
{
|
|
17897
18107
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -17899,7 +18109,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17899
18109
|
children: t2("Add-ons")
|
|
17900
18110
|
}
|
|
17901
18111
|
),
|
|
17902
|
-
/* @__PURE__ */
|
|
18112
|
+
/* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: currentAddOns.map((addOn, addOnIndex) => /* @__PURE__ */ jsx43(
|
|
17903
18113
|
AddOn,
|
|
17904
18114
|
{
|
|
17905
18115
|
addOn,
|
|
@@ -17910,7 +18120,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17910
18120
|
)) })
|
|
17911
18121
|
] }),
|
|
17912
18122
|
props.addOns.isVisible && usageBasedEntitlements.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
17913
|
-
props.addOns.showLabel && /* @__PURE__ */
|
|
18123
|
+
props.addOns.showLabel && /* @__PURE__ */ jsx43(
|
|
17914
18124
|
Text,
|
|
17915
18125
|
{
|
|
17916
18126
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
@@ -17918,8 +18128,8 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17918
18128
|
children: t2("Usage-based")
|
|
17919
18129
|
}
|
|
17920
18130
|
),
|
|
17921
|
-
/* @__PURE__ */
|
|
17922
|
-
return /* @__PURE__ */
|
|
18131
|
+
/* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: usageBasedEntitlements.map((entitlement, entitlementIndex) => {
|
|
18132
|
+
return /* @__PURE__ */ jsx43(
|
|
17923
18133
|
UsageDetails2,
|
|
17924
18134
|
{
|
|
17925
18135
|
entitlement,
|
|
@@ -17930,79 +18140,153 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
17930
18140
|
);
|
|
17931
18141
|
}) })
|
|
17932
18142
|
] }),
|
|
17933
|
-
props.addOns.isVisible && creditGroups.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
17934
|
-
props.addOns.showLabel && /* @__PURE__ */
|
|
18143
|
+
props.addOns.isVisible && creditGroups.plan.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18144
|
+
props.addOns.showLabel && /* @__PURE__ */ jsx43(
|
|
17935
18145
|
Text,
|
|
17936
18146
|
{
|
|
17937
18147
|
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
17938
18148
|
$leading: 1,
|
|
17939
|
-
children: t2("Credits")
|
|
18149
|
+
children: t2("Credits in plan")
|
|
17940
18150
|
}
|
|
17941
18151
|
),
|
|
17942
|
-
/* @__PURE__ */
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
18152
|
+
/* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.plan.map((group, groupIndex) => {
|
|
18153
|
+
return /* @__PURE__ */ jsxs34(
|
|
18154
|
+
Flex,
|
|
18155
|
+
{
|
|
18156
|
+
$justifyContent: "space-between",
|
|
18157
|
+
$alignItems: "center",
|
|
18158
|
+
$flexWrap: "wrap",
|
|
18159
|
+
$gap: "0.5rem",
|
|
18160
|
+
children: [
|
|
18161
|
+
/* @__PURE__ */ jsxs34(Text, { display: props.addOns.fontStyle, children: [
|
|
18162
|
+
group.quantity,
|
|
18163
|
+
" ",
|
|
18164
|
+
getFeatureName(group, group.quantity),
|
|
18165
|
+
" ",
|
|
18166
|
+
subscriptionInterval && /* @__PURE__ */ jsxs34(Fragment20, { children: [
|
|
18167
|
+
t2("per"),
|
|
18168
|
+
" ",
|
|
18169
|
+
t2(subscriptionInterval)
|
|
18170
|
+
] })
|
|
18171
|
+
] }),
|
|
18172
|
+
group.total.used > 0 && /* @__PURE__ */ jsxs34(
|
|
18173
|
+
Text,
|
|
18174
|
+
{
|
|
18175
|
+
style: { opacity: 0.54 },
|
|
18176
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
18177
|
+
$color: settings.theme.typography.text.color,
|
|
18178
|
+
children: [
|
|
18179
|
+
group.total.used,
|
|
17958
18180
|
" ",
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
18181
|
+
t2("used")
|
|
18182
|
+
]
|
|
18183
|
+
}
|
|
18184
|
+
)
|
|
18185
|
+
]
|
|
18186
|
+
},
|
|
18187
|
+
groupIndex
|
|
18188
|
+
);
|
|
18189
|
+
}) })
|
|
18190
|
+
] }),
|
|
18191
|
+
props.addOns.isVisible && creditGroups.bundles.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18192
|
+
props.addOns.showLabel && /* @__PURE__ */ jsx43(
|
|
18193
|
+
Text,
|
|
18194
|
+
{
|
|
18195
|
+
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
18196
|
+
$leading: 1,
|
|
18197
|
+
children: t2("Credit bundles")
|
|
18198
|
+
}
|
|
18199
|
+
),
|
|
18200
|
+
/* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.bundles.map((group, groupIndex) => {
|
|
18201
|
+
const bundle = group?.bundleId ? creditBundles.find((b2) => b2.id === group.bundleId) : void 0;
|
|
18202
|
+
return /* @__PURE__ */ jsxs34(
|
|
18203
|
+
Flex,
|
|
18204
|
+
{
|
|
18205
|
+
$justifyContent: "space-between",
|
|
18206
|
+
$alignItems: "center",
|
|
18207
|
+
$flexWrap: "wrap",
|
|
18208
|
+
$gap: "0.5rem",
|
|
18209
|
+
children: [
|
|
18210
|
+
bundle ? /* @__PURE__ */ jsxs34(Text, { display: props.addOns.fontStyle, children: [
|
|
18211
|
+
group.grants.length > 1 && /* @__PURE__ */ jsxs34(Text, { style: { opacity: 0.5 }, children: [
|
|
18212
|
+
"(",
|
|
18213
|
+
group.grants.length,
|
|
18214
|
+
")",
|
|
18215
|
+
" "
|
|
18216
|
+
] }),
|
|
18217
|
+
bundle.name,
|
|
18218
|
+
" (",
|
|
18219
|
+
group.quantity,
|
|
18220
|
+
" ",
|
|
18221
|
+
getFeatureName(group, group.quantity),
|
|
18222
|
+
")"
|
|
18223
|
+
] }) : /* @__PURE__ */ jsxs34(Text, { display: props.addOns.fontStyle, children: [
|
|
18224
|
+
group.quantity,
|
|
18225
|
+
" ",
|
|
18226
|
+
getFeatureName(group, group.quantity)
|
|
18227
|
+
] }),
|
|
18228
|
+
group.total.used > 0 && /* @__PURE__ */ jsxs34(
|
|
18229
|
+
Text,
|
|
18230
|
+
{
|
|
18231
|
+
style: { opacity: 0.54 },
|
|
18232
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
18233
|
+
$color: settings.theme.typography.text.color,
|
|
18234
|
+
children: [
|
|
18235
|
+
group.total.used,
|
|
17974
18236
|
" ",
|
|
17975
|
-
|
|
17976
|
-
|
|
17977
|
-
|
|
17978
|
-
|
|
18237
|
+
t2("used")
|
|
18238
|
+
]
|
|
18239
|
+
}
|
|
18240
|
+
)
|
|
18241
|
+
]
|
|
18242
|
+
},
|
|
18243
|
+
groupIndex
|
|
18244
|
+
);
|
|
18245
|
+
}) })
|
|
18246
|
+
] }),
|
|
18247
|
+
props.addOns.isVisible && creditGroups.promotional.length > 0 && /* @__PURE__ */ jsxs34(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18248
|
+
props.addOns.showLabel && /* @__PURE__ */ jsx43(
|
|
18249
|
+
Text,
|
|
18250
|
+
{
|
|
18251
|
+
$color: isLightBackground ? darken(settings.theme.card.background, 0.46) : lighten(settings.theme.card.background, 0.46),
|
|
18252
|
+
$leading: 1,
|
|
18253
|
+
children: t2("Promotional credits")
|
|
18254
|
+
}
|
|
18255
|
+
),
|
|
18256
|
+
/* @__PURE__ */ jsx43(Flex, { $flexDirection: "column", $gap: "1rem", children: creditGroups.promotional.map((group, groupIndex) => {
|
|
18257
|
+
return /* @__PURE__ */ jsxs34(
|
|
18258
|
+
Flex,
|
|
18259
|
+
{
|
|
18260
|
+
$justifyContent: "space-between",
|
|
18261
|
+
$alignItems: "center",
|
|
18262
|
+
$flexWrap: "wrap",
|
|
18263
|
+
$gap: "0.5rem",
|
|
18264
|
+
children: [
|
|
18265
|
+
/* @__PURE__ */ jsxs34(Text, { display: props.addOns.fontStyle, children: [
|
|
18266
|
+
group.quantity,
|
|
18267
|
+
" ",
|
|
18268
|
+
getFeatureName(group, group.quantity)
|
|
18269
|
+
] }),
|
|
18270
|
+
group.total.used > 0 && /* @__PURE__ */ jsxs34(
|
|
18271
|
+
Text,
|
|
18272
|
+
{
|
|
18273
|
+
style: { opacity: 0.54 },
|
|
18274
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
18275
|
+
$color: settings.theme.typography.text.color,
|
|
18276
|
+
children: [
|
|
18277
|
+
group.total.used,
|
|
17979
18278
|
" ",
|
|
17980
|
-
|
|
17981
|
-
]
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
17987
|
-
|
|
17988
|
-
|
|
17989
|
-
group.total.used,
|
|
17990
|
-
" ",
|
|
17991
|
-
t2("used")
|
|
17992
|
-
]
|
|
17993
|
-
}
|
|
17994
|
-
)
|
|
17995
|
-
]
|
|
17996
|
-
},
|
|
17997
|
-
groupIndex
|
|
17998
|
-
)
|
|
17999
|
-
);
|
|
18000
|
-
return acc;
|
|
18001
|
-
},
|
|
18002
|
-
[]
|
|
18003
|
-
) })
|
|
18279
|
+
t2("used")
|
|
18280
|
+
]
|
|
18281
|
+
}
|
|
18282
|
+
)
|
|
18283
|
+
]
|
|
18284
|
+
},
|
|
18285
|
+
groupIndex
|
|
18286
|
+
);
|
|
18287
|
+
}) })
|
|
18004
18288
|
] }),
|
|
18005
|
-
canCheckout && props.callToAction.isVisible && /* @__PURE__ */
|
|
18289
|
+
canCheckout && props.callToAction.isVisible && /* @__PURE__ */ jsx43(
|
|
18006
18290
|
Button,
|
|
18007
18291
|
{
|
|
18008
18292
|
type: "button",
|
|
@@ -18037,7 +18321,7 @@ import {
|
|
|
18037
18321
|
|
|
18038
18322
|
// src/components/elements/pricing-table/AddOn.tsx
|
|
18039
18323
|
import { useMemo as useMemo24 } from "react";
|
|
18040
|
-
import { Fragment as Fragment21, jsx as
|
|
18324
|
+
import { Fragment as Fragment21, jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
18041
18325
|
var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
18042
18326
|
const { layout } = sharedProps;
|
|
18043
18327
|
const { t: t2 } = useTranslation();
|
|
@@ -18080,16 +18364,16 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18080
18364
|
},
|
|
18081
18365
|
children: [
|
|
18082
18366
|
/* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
|
|
18083
|
-
/* @__PURE__ */
|
|
18084
|
-
layout.addOns.showDescription && /* @__PURE__ */
|
|
18085
|
-
/* @__PURE__ */
|
|
18367
|
+
/* @__PURE__ */ jsx44(Box, { children: /* @__PURE__ */ jsx44(Text, { display: layout.plans.name.fontStyle, children: addOn.name }) }),
|
|
18368
|
+
layout.addOns.showDescription && /* @__PURE__ */ jsx44(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx44(Text, { display: layout.plans.description.fontStyle, children: addOn.description }) }),
|
|
18369
|
+
/* @__PURE__ */ jsx44(Box, { children: /* @__PURE__ */ jsxs35(Text, { display: layout.plans.name.fontStyle, children: [
|
|
18086
18370
|
formatCurrency(addOnPrice ?? 0, addOnCurrency),
|
|
18087
18371
|
/* @__PURE__ */ jsxs35("sub", { children: [
|
|
18088
18372
|
"/",
|
|
18089
18373
|
selectedPeriod
|
|
18090
18374
|
] })
|
|
18091
18375
|
] }) }),
|
|
18092
|
-
isActiveAddOn && /* @__PURE__ */
|
|
18376
|
+
isActiveAddOn && /* @__PURE__ */ jsx44(
|
|
18093
18377
|
Flex,
|
|
18094
18378
|
{
|
|
18095
18379
|
$position: "absolute",
|
|
@@ -18098,7 +18382,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18098
18382
|
$backgroundColor: settings.theme.primary,
|
|
18099
18383
|
$borderRadius: "9999px",
|
|
18100
18384
|
$padding: "0.125rem 0.85rem",
|
|
18101
|
-
children: /* @__PURE__ */
|
|
18385
|
+
children: /* @__PURE__ */ jsx44(
|
|
18102
18386
|
Text,
|
|
18103
18387
|
{
|
|
18104
18388
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -18117,7 +18401,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18117
18401
|
$gap: `${cardPadding}rem`,
|
|
18118
18402
|
$flexGrow: 1,
|
|
18119
18403
|
children: [
|
|
18120
|
-
layout.addOns.showEntitlements && /* @__PURE__ */
|
|
18404
|
+
layout.addOns.showEntitlements && /* @__PURE__ */ jsx44(
|
|
18121
18405
|
Flex,
|
|
18122
18406
|
{
|
|
18123
18407
|
$flexDirection: "column",
|
|
@@ -18126,7 +18410,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18126
18410
|
$flexGrow: 1,
|
|
18127
18411
|
children: addOn.entitlements.map((entitlement, entitlementIndex) => {
|
|
18128
18412
|
const metricPeriodName = getMetricPeriodName(entitlement);
|
|
18129
|
-
return /* @__PURE__ */
|
|
18413
|
+
return /* @__PURE__ */ jsx44(
|
|
18130
18414
|
Flex,
|
|
18131
18415
|
{
|
|
18132
18416
|
$flexWrap: "wrap",
|
|
@@ -18134,7 +18418,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18134
18418
|
$alignItems: "center",
|
|
18135
18419
|
$gap: "1rem",
|
|
18136
18420
|
children: /* @__PURE__ */ jsxs35(Flex, { $gap: "1rem", children: [
|
|
18137
|
-
layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */
|
|
18421
|
+
layout.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx44(
|
|
18138
18422
|
Icon3,
|
|
18139
18423
|
{
|
|
18140
18424
|
name: entitlement.feature.icon,
|
|
@@ -18144,7 +18428,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18144
18428
|
}
|
|
18145
18429
|
),
|
|
18146
18430
|
/* @__PURE__ */ jsxs35(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18147
|
-
entitlement.feature?.name && /* @__PURE__ */
|
|
18431
|
+
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: [
|
|
18148
18432
|
entitlement.valueType === "unlimited" /* Unlimited */ ? t2("Unlimited", {
|
|
18149
18433
|
item: getFeatureName(entitlement.feature)
|
|
18150
18434
|
}) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ jsxs35(Fragment21, { children: [
|
|
@@ -18162,7 +18446,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18162
18446
|
t2(metricPeriodName)
|
|
18163
18447
|
] })
|
|
18164
18448
|
] }) : entitlement.feature.name }) }),
|
|
18165
|
-
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */
|
|
18449
|
+
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx44(
|
|
18166
18450
|
Text,
|
|
18167
18451
|
{
|
|
18168
18452
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
@@ -18178,7 +18462,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18178
18462
|
})
|
|
18179
18463
|
}
|
|
18180
18464
|
),
|
|
18181
|
-
showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */
|
|
18465
|
+
showCallToAction && layout.upgrade.isVisible && /* @__PURE__ */ jsx44(
|
|
18182
18466
|
Button,
|
|
18183
18467
|
{
|
|
18184
18468
|
type: "button",
|
|
@@ -18219,7 +18503,7 @@ var AddOn2 = ({ addOn, sharedProps, selectedPeriod }) => {
|
|
|
18219
18503
|
import { useMemo as useMemo25 } from "react";
|
|
18220
18504
|
|
|
18221
18505
|
// src/components/elements/pricing-table/Entitlement.tsx
|
|
18222
|
-
import { Fragment as Fragment22, jsx as
|
|
18506
|
+
import { Fragment as Fragment22, jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
18223
18507
|
var Entitlement = ({
|
|
18224
18508
|
entitlement,
|
|
18225
18509
|
sharedProps,
|
|
@@ -18241,7 +18525,7 @@ var Entitlement = ({
|
|
|
18241
18525
|
const limit = entitlement.softLimit ?? entitlement.valueNumeric;
|
|
18242
18526
|
const metricPeriodName = getMetricPeriodName(entitlement);
|
|
18243
18527
|
return /* @__PURE__ */ jsxs36(Flex, { $gap: "1rem", children: [
|
|
18244
|
-
layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */
|
|
18528
|
+
layout.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx45(
|
|
18245
18529
|
Icon3,
|
|
18246
18530
|
{
|
|
18247
18531
|
name: entitlement.feature.icon,
|
|
@@ -18252,7 +18536,7 @@ var Entitlement = ({
|
|
|
18252
18536
|
),
|
|
18253
18537
|
entitlement.feature?.name && /* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $gap: "0.5rem", children: [
|
|
18254
18538
|
/* @__PURE__ */ jsxs36(Flex, { $flexDirection: "column", $justifyContent: "center", $flexGrow: 1, children: [
|
|
18255
|
-
/* @__PURE__ */
|
|
18539
|
+
/* @__PURE__ */ jsx45(Text, { children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" /* PayInAdvance */ || entitlement.priceBehavior === "pay_as_you_go" /* PayAsYouGo */) ? /* @__PURE__ */ jsxs36(Fragment22, { children: [
|
|
18256
18540
|
formatCurrency(entitlementPrice, entitlementCurrency),
|
|
18257
18541
|
" ",
|
|
18258
18542
|
t2("per"),
|
|
@@ -18268,7 +18552,7 @@ var Entitlement = ({
|
|
|
18268
18552
|
" ",
|
|
18269
18553
|
selectedPeriod
|
|
18270
18554
|
] })
|
|
18271
|
-
] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */
|
|
18555
|
+
] }) : entitlement.priceBehavior === "tier" /* Tiered */ ? /* @__PURE__ */ jsx45(
|
|
18272
18556
|
TieredPricingDetails,
|
|
18273
18557
|
{
|
|
18274
18558
|
entitlement,
|
|
@@ -18289,49 +18573,57 @@ var Entitlement = ({
|
|
|
18289
18573
|
t2(metricPeriodName)
|
|
18290
18574
|
] })
|
|
18291
18575
|
] }) : entitlement.feature.name }),
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
{
|
|
18295
|
-
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
18296
|
-
$color: `color-mix(in oklch, ${settings.theme.typography.text.color}, ${settings.theme.card.background})`,
|
|
18297
|
-
children: [
|
|
18298
|
-
t2("then"),
|
|
18299
|
-
" ",
|
|
18300
|
-
formatCurrency(entitlementPrice, entitlementCurrency),
|
|
18301
|
-
"/",
|
|
18302
|
-
entitlementPackageSize > 1 && /* @__PURE__ */ jsxs36(Fragment22, { children: [
|
|
18303
|
-
entitlementPackageSize,
|
|
18304
|
-
" "
|
|
18305
|
-
] }),
|
|
18306
|
-
getFeatureName(entitlement.feature, entitlementPackageSize),
|
|
18307
|
-
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs36(Fragment22, { children: [
|
|
18308
|
-
"/",
|
|
18309
|
-
shortenPeriod(selectedPeriod)
|
|
18310
|
-
] })
|
|
18311
|
-
]
|
|
18312
|
-
}
|
|
18313
|
-
) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs36(Flex, { $alignItems: "center", children: [
|
|
18314
|
-
/* @__PURE__ */ jsx44(
|
|
18315
|
-
PricingTiersTooltip,
|
|
18316
|
-
{
|
|
18317
|
-
feature: entitlement.feature,
|
|
18318
|
-
period: selectedPeriod,
|
|
18319
|
-
currency: entitlementCurrency,
|
|
18320
|
-
priceTiers: entitlementPriceTiers
|
|
18321
|
-
}
|
|
18322
|
-
),
|
|
18323
|
-
/* @__PURE__ */ jsx44(
|
|
18576
|
+
/* @__PURE__ */ jsxs36(Flex, { $alignItems: "end", children: [
|
|
18577
|
+
entitlement.priceBehavior === "overage" /* Overage */ && typeof entitlementPrice === "number" ? /* @__PURE__ */ jsxs36(
|
|
18324
18578
|
Text,
|
|
18325
18579
|
{
|
|
18326
|
-
style: { opacity: 0.54 },
|
|
18327
18580
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
18328
|
-
$color: settings.theme.typography.text.color,
|
|
18329
|
-
children:
|
|
18581
|
+
$color: `color-mix(in oklch, ${settings.theme.typography.text.color}, ${settings.theme.card.background})`,
|
|
18582
|
+
children: [
|
|
18583
|
+
t2("then"),
|
|
18584
|
+
" ",
|
|
18585
|
+
formatCurrency(entitlementPrice, entitlementCurrency),
|
|
18586
|
+
"/",
|
|
18587
|
+
entitlementPackageSize > 1 && /* @__PURE__ */ jsxs36(Fragment22, { children: [
|
|
18588
|
+
entitlementPackageSize,
|
|
18589
|
+
" "
|
|
18590
|
+
] }),
|
|
18591
|
+
getFeatureName(entitlement.feature, entitlementPackageSize),
|
|
18592
|
+
entitlement.feature.featureType === "trait" /* Trait */ && /* @__PURE__ */ jsxs36(Fragment22, { children: [
|
|
18593
|
+
"/",
|
|
18594
|
+
shortenPeriod(selectedPeriod)
|
|
18595
|
+
] })
|
|
18596
|
+
]
|
|
18597
|
+
}
|
|
18598
|
+
) : entitlement.priceBehavior === "tier" /* Tiered */ && /* @__PURE__ */ jsxs36(Flex, { $alignItems: "end", children: [
|
|
18599
|
+
/* @__PURE__ */ jsx45(
|
|
18600
|
+
Text,
|
|
18601
|
+
{
|
|
18602
|
+
style: { opacity: 0.54 },
|
|
18603
|
+
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
18604
|
+
$color: settings.theme.typography.text.color,
|
|
18605
|
+
children: t2("Tier-based")
|
|
18606
|
+
}
|
|
18607
|
+
),
|
|
18608
|
+
/* @__PURE__ */ jsx45(
|
|
18609
|
+
PricingTiersTooltip,
|
|
18610
|
+
{
|
|
18611
|
+
feature: entitlement.feature,
|
|
18612
|
+
period: selectedPeriod,
|
|
18613
|
+
currency: entitlementCurrency,
|
|
18614
|
+
priceTiers: entitlementPriceTiers
|
|
18615
|
+
}
|
|
18616
|
+
)
|
|
18617
|
+
] }),
|
|
18618
|
+
entitlement.billingThreshold && /* @__PURE__ */ jsx45(
|
|
18619
|
+
BillingThresholdTooltip,
|
|
18620
|
+
{
|
|
18621
|
+
billingThreshold: entitlement.billingThreshold
|
|
18330
18622
|
}
|
|
18331
18623
|
)
|
|
18332
18624
|
] })
|
|
18333
18625
|
] }),
|
|
18334
|
-
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */
|
|
18626
|
+
layout.plans.showFeatureDescriptions && entitlement.feature?.description && /* @__PURE__ */ jsx45(
|
|
18335
18627
|
Text,
|
|
18336
18628
|
{
|
|
18337
18629
|
$size: 0.875 * settings.theme.typography.text.fontSize,
|
|
@@ -18344,7 +18636,7 @@ var Entitlement = ({
|
|
|
18344
18636
|
};
|
|
18345
18637
|
|
|
18346
18638
|
// src/components/elements/pricing-table/Plan.tsx
|
|
18347
|
-
import { Fragment as Fragment23, jsx as
|
|
18639
|
+
import { Fragment as Fragment23, jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
18348
18640
|
var Plan2 = ({
|
|
18349
18641
|
plan,
|
|
18350
18642
|
index,
|
|
@@ -18415,7 +18707,7 @@ var Plan2 = ({
|
|
|
18415
18707
|
(entitlement) => !!entitlement.priceBehavior
|
|
18416
18708
|
);
|
|
18417
18709
|
const isUsageBasedPlan = planPrice === 0 && hasUsageBasedEntitlements;
|
|
18418
|
-
const headerPriceFontStyle =
|
|
18710
|
+
const headerPriceFontStyle = settings.theme.typography[layout.plans.name.fontStyle];
|
|
18419
18711
|
const count = entitlementCounts[plan.id];
|
|
18420
18712
|
const isExpanded = count && count.limit > VISIBLE_ENTITLEMENT_COUNT;
|
|
18421
18713
|
return /* @__PURE__ */ jsxs37(
|
|
@@ -18446,9 +18738,9 @@ var Plan2 = ({
|
|
|
18446
18738
|
$borderStyle: "solid",
|
|
18447
18739
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
|
|
18448
18740
|
children: [
|
|
18449
|
-
/* @__PURE__ */
|
|
18450
|
-
layout.plans.description.isVisible && /* @__PURE__ */
|
|
18451
|
-
/* @__PURE__ */
|
|
18741
|
+
/* @__PURE__ */ jsx46(Box, { children: /* @__PURE__ */ jsx46(Text, { display: layout.plans.name.fontStyle, children: plan.name }) }),
|
|
18742
|
+
layout.plans.description.isVisible && /* @__PURE__ */ jsx46(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx46(Text, { display: layout.plans.description.fontStyle, children: plan.description }) }),
|
|
18743
|
+
/* @__PURE__ */ jsx46(Box, { children: /* @__PURE__ */ jsxs37(
|
|
18452
18744
|
Text,
|
|
18453
18745
|
{
|
|
18454
18746
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -18464,7 +18756,7 @@ var Plan2 = ({
|
|
|
18464
18756
|
]
|
|
18465
18757
|
}
|
|
18466
18758
|
) }),
|
|
18467
|
-
credits.length > 0 && /* @__PURE__ */
|
|
18759
|
+
credits.length > 0 && /* @__PURE__ */ jsx46(
|
|
18468
18760
|
Flex,
|
|
18469
18761
|
{
|
|
18470
18762
|
$flexDirection: "column",
|
|
@@ -18473,7 +18765,7 @@ var Plan2 = ({
|
|
|
18473
18765
|
$marginTop: "0.5rem",
|
|
18474
18766
|
children: credits.map((credit, idx) => {
|
|
18475
18767
|
return /* @__PURE__ */ jsxs37(Flex, { $gap: "1rem", children: [
|
|
18476
|
-
layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */
|
|
18768
|
+
layout.plans.showFeatureIcons && credit.icon && /* @__PURE__ */ jsx46(
|
|
18477
18769
|
Icon3,
|
|
18478
18770
|
{
|
|
18479
18771
|
name: credit.icon,
|
|
@@ -18482,7 +18774,7 @@ var Plan2 = ({
|
|
|
18482
18774
|
rounded: true
|
|
18483
18775
|
}
|
|
18484
18776
|
),
|
|
18485
|
-
credit.name && /* @__PURE__ */
|
|
18777
|
+
credit.name && /* @__PURE__ */ jsx46(
|
|
18486
18778
|
Flex,
|
|
18487
18779
|
{
|
|
18488
18780
|
$flexDirection: "column",
|
|
@@ -18505,7 +18797,7 @@ var Plan2 = ({
|
|
|
18505
18797
|
})
|
|
18506
18798
|
}
|
|
18507
18799
|
),
|
|
18508
|
-
isActivePlan && /* @__PURE__ */
|
|
18800
|
+
isActivePlan && /* @__PURE__ */ jsx46(
|
|
18509
18801
|
Flex,
|
|
18510
18802
|
{
|
|
18511
18803
|
$position: "absolute",
|
|
@@ -18514,7 +18806,7 @@ var Plan2 = ({
|
|
|
18514
18806
|
$backgroundColor: settings.theme.primary,
|
|
18515
18807
|
$borderRadius: "9999px",
|
|
18516
18808
|
$padding: "0.125rem 0.85rem",
|
|
18517
|
-
children: /* @__PURE__ */
|
|
18809
|
+
children: /* @__PURE__ */ jsx46(
|
|
18518
18810
|
Text,
|
|
18519
18811
|
{
|
|
18520
18812
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -18537,10 +18829,10 @@ var Plan2 = ({
|
|
|
18537
18829
|
$padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
|
|
18538
18830
|
children: [
|
|
18539
18831
|
layout.plans.showEntitlements && /* @__PURE__ */ jsxs37(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: [
|
|
18540
|
-
layout.plans.showInclusionText && index > 0 && /* @__PURE__ */
|
|
18832
|
+
layout.plans.showInclusionText && index > 0 && /* @__PURE__ */ jsx46(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx46(Text, { children: t2("Everything in", {
|
|
18541
18833
|
plan: plans[index - 1].name
|
|
18542
18834
|
}) }) }),
|
|
18543
|
-
plan.entitlements.map((entitlement, idx) => /* @__PURE__ */
|
|
18835
|
+
plan.entitlements.map((entitlement, idx) => /* @__PURE__ */ jsx46(
|
|
18544
18836
|
Entitlement,
|
|
18545
18837
|
{
|
|
18546
18838
|
entitlement,
|
|
@@ -18557,14 +18849,14 @@ var Plan2 = ({
|
|
|
18557
18849
|
$gap: "0.5rem",
|
|
18558
18850
|
$marginTop: "1rem",
|
|
18559
18851
|
children: [
|
|
18560
|
-
/* @__PURE__ */
|
|
18852
|
+
/* @__PURE__ */ jsx46(
|
|
18561
18853
|
Icon3,
|
|
18562
18854
|
{
|
|
18563
18855
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
18564
18856
|
color: "#D0D0D0"
|
|
18565
18857
|
}
|
|
18566
18858
|
),
|
|
18567
|
-
/* @__PURE__ */
|
|
18859
|
+
/* @__PURE__ */ jsx46(
|
|
18568
18860
|
Text,
|
|
18569
18861
|
{
|
|
18570
18862
|
onClick: () => handleToggleShowAll(plan.id),
|
|
@@ -18592,7 +18884,7 @@ var Plan2 = ({
|
|
|
18592
18884
|
$gap: "0.25rem",
|
|
18593
18885
|
$padding: "0.625rem 0",
|
|
18594
18886
|
children: [
|
|
18595
|
-
/* @__PURE__ */
|
|
18887
|
+
/* @__PURE__ */ jsx46(
|
|
18596
18888
|
Icon3,
|
|
18597
18889
|
{
|
|
18598
18890
|
name: "check-rounded",
|
|
@@ -18600,10 +18892,10 @@ var Plan2 = ({
|
|
|
18600
18892
|
color: settings.theme.primary
|
|
18601
18893
|
}
|
|
18602
18894
|
),
|
|
18603
|
-
/* @__PURE__ */
|
|
18895
|
+
/* @__PURE__ */ jsx46(Text, { $size: 15, $leading: 1, children: t2("Current plan") })
|
|
18604
18896
|
]
|
|
18605
18897
|
}
|
|
18606
|
-
) : showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */
|
|
18898
|
+
) : showCallToAction && (layout.upgrade.isVisible || layout.downgrade.isVisible) && /* @__PURE__ */ jsx46(
|
|
18607
18899
|
Button,
|
|
18608
18900
|
{
|
|
18609
18901
|
type: "button",
|
|
@@ -18640,11 +18932,11 @@ var Plan2 = ({
|
|
|
18640
18932
|
}
|
|
18641
18933
|
},
|
|
18642
18934
|
$fullWidth: true,
|
|
18643
|
-
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : isHydratedPlan(plan) && !plan.valid ? /* @__PURE__ */
|
|
18935
|
+
children: plan.custom ? plan.customPlanConfig?.ctaText ?? t2("Talk to support") : isHydratedPlan(plan) && !plan.valid ? /* @__PURE__ */ jsx46(
|
|
18644
18936
|
Tooltip,
|
|
18645
18937
|
{
|
|
18646
|
-
trigger: /* @__PURE__ */
|
|
18647
|
-
content: /* @__PURE__ */
|
|
18938
|
+
trigger: /* @__PURE__ */ jsx46(Text, { as: Box, $align: "center", children: t2("Over usage limit") }),
|
|
18939
|
+
content: /* @__PURE__ */ jsx46(Text, { children: t2("Current usage exceeds the limit of this plan.") })
|
|
18648
18940
|
}
|
|
18649
18941
|
) : isHydratedPlan(plan) && plan.companyCanTrial && plan.isTrialable ? t2("Start X day trial", { days: plan.trialDays }) : t2("Choose plan")
|
|
18650
18942
|
}
|
|
@@ -18658,7 +18950,7 @@ var Plan2 = ({
|
|
|
18658
18950
|
};
|
|
18659
18951
|
|
|
18660
18952
|
// src/components/elements/pricing-table/PricingTable.tsx
|
|
18661
|
-
import { Fragment as Fragment25, jsx as
|
|
18953
|
+
import { Fragment as Fragment25, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
18662
18954
|
var resolveDesignProps8 = (props) => {
|
|
18663
18955
|
return {
|
|
18664
18956
|
showPeriodToggle: props.showPeriodToggle ?? true,
|
|
@@ -18762,7 +19054,7 @@ var PricingTable = forwardRef12(
|
|
|
18762
19054
|
setEntitlementCounts(plans.reduce(entitlementCountsReducer, {}));
|
|
18763
19055
|
}, [plans]);
|
|
18764
19056
|
if (isPending) {
|
|
18765
|
-
return /* @__PURE__ */
|
|
19057
|
+
return /* @__PURE__ */ jsx47(
|
|
18766
19058
|
Flex,
|
|
18767
19059
|
{
|
|
18768
19060
|
$width: "100%",
|
|
@@ -18770,12 +19062,12 @@ var PricingTable = forwardRef12(
|
|
|
18770
19062
|
$alignItems: "center",
|
|
18771
19063
|
$justifyContent: "center",
|
|
18772
19064
|
$padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
18773
|
-
children: /* @__PURE__ */
|
|
19065
|
+
children: /* @__PURE__ */ jsx47(Loader, { $size: "2xl" })
|
|
18774
19066
|
}
|
|
18775
19067
|
);
|
|
18776
19068
|
}
|
|
18777
19069
|
const Wrapper = isStandalone ? Container : Fragment24;
|
|
18778
|
-
return /* @__PURE__ */
|
|
19070
|
+
return /* @__PURE__ */ jsx47(Wrapper, { children: /* @__PURE__ */ jsxs38(
|
|
18779
19071
|
FussyChild,
|
|
18780
19072
|
{
|
|
18781
19073
|
ref,
|
|
@@ -18800,7 +19092,7 @@ var PricingTable = forwardRef12(
|
|
|
18800
19092
|
}
|
|
18801
19093
|
},
|
|
18802
19094
|
children: [
|
|
18803
|
-
/* @__PURE__ */
|
|
19095
|
+
/* @__PURE__ */ jsx47(
|
|
18804
19096
|
Text,
|
|
18805
19097
|
{
|
|
18806
19098
|
display: props.header.fontStyle,
|
|
@@ -18808,7 +19100,7 @@ var PricingTable = forwardRef12(
|
|
|
18808
19100
|
children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t2("Plans")
|
|
18809
19101
|
}
|
|
18810
19102
|
),
|
|
18811
|
-
showPeriodToggle && periods.length > 1 && /* @__PURE__ */
|
|
19103
|
+
showPeriodToggle && periods.length > 1 && /* @__PURE__ */ jsx47(
|
|
18812
19104
|
PeriodToggle,
|
|
18813
19105
|
{
|
|
18814
19106
|
options: periods,
|
|
@@ -18823,7 +19115,7 @@ var PricingTable = forwardRef12(
|
|
|
18823
19115
|
]
|
|
18824
19116
|
}
|
|
18825
19117
|
),
|
|
18826
|
-
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */
|
|
19118
|
+
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ jsx47(
|
|
18827
19119
|
Box,
|
|
18828
19120
|
{
|
|
18829
19121
|
$display: "grid",
|
|
@@ -18831,7 +19123,7 @@ var PricingTable = forwardRef12(
|
|
|
18831
19123
|
$gap: "1rem",
|
|
18832
19124
|
children: plans.map((plan, index, self2) => {
|
|
18833
19125
|
const planPeriod = showPeriodToggle ? selectedPeriod : plan.yearlyPrice && !plan.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
|
|
18834
|
-
return /* @__PURE__ */
|
|
19126
|
+
return /* @__PURE__ */ jsx47(
|
|
18835
19127
|
Plan2,
|
|
18836
19128
|
{
|
|
18837
19129
|
plan,
|
|
@@ -18853,14 +19145,14 @@ var PricingTable = forwardRef12(
|
|
|
18853
19145
|
}
|
|
18854
19146
|
)
|
|
18855
19147
|
] }),
|
|
18856
|
-
/* @__PURE__ */
|
|
18857
|
-
props.header.isVisible && /* @__PURE__ */
|
|
19148
|
+
/* @__PURE__ */ jsx47(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs38(Fragment25, { children: [
|
|
19149
|
+
props.header.isVisible && /* @__PURE__ */ jsx47(
|
|
18858
19150
|
Flex,
|
|
18859
19151
|
{
|
|
18860
19152
|
$justifyContent: "space-between",
|
|
18861
19153
|
$alignItems: "center",
|
|
18862
19154
|
$marginBottom: "1rem",
|
|
18863
|
-
children: /* @__PURE__ */
|
|
19155
|
+
children: /* @__PURE__ */ jsx47(
|
|
18864
19156
|
Text,
|
|
18865
19157
|
{
|
|
18866
19158
|
display: props.header.fontStyle,
|
|
@@ -18870,7 +19162,7 @@ var PricingTable = forwardRef12(
|
|
|
18870
19162
|
)
|
|
18871
19163
|
}
|
|
18872
19164
|
),
|
|
18873
|
-
/* @__PURE__ */
|
|
19165
|
+
/* @__PURE__ */ jsx47(
|
|
18874
19166
|
Box,
|
|
18875
19167
|
{
|
|
18876
19168
|
$display: "grid",
|
|
@@ -18878,7 +19170,7 @@ var PricingTable = forwardRef12(
|
|
|
18878
19170
|
$gap: "1rem",
|
|
18879
19171
|
children: addOns.map((addOn, index) => {
|
|
18880
19172
|
const addOnPeriod = showPeriodToggle ? selectedPeriod : addOn.yearlyPrice && !addOn.monthlyPrice ? "year" /* Year */ : "month" /* Month */;
|
|
18881
|
-
return /* @__PURE__ */
|
|
19173
|
+
return /* @__PURE__ */ jsx47(
|
|
18882
19174
|
AddOn2,
|
|
18883
19175
|
{
|
|
18884
19176
|
addOn,
|
|
@@ -18905,7 +19197,7 @@ PricingTable.displayName = "PricingTable";
|
|
|
18905
19197
|
|
|
18906
19198
|
// src/components/elements/text/Text.tsx
|
|
18907
19199
|
import { forwardRef as forwardRef13 } from "react";
|
|
18908
|
-
import { jsx as
|
|
19200
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
18909
19201
|
var resolveDesignProps9 = (props) => {
|
|
18910
19202
|
return {
|
|
18911
19203
|
text: {
|
|
@@ -18917,7 +19209,7 @@ var resolveDesignProps9 = (props) => {
|
|
|
18917
19209
|
};
|
|
18918
19210
|
var TextElement = forwardRef13(({ children, className, ...rest }, ref) => {
|
|
18919
19211
|
const props = resolveDesignProps9(rest);
|
|
18920
|
-
return /* @__PURE__ */
|
|
19212
|
+
return /* @__PURE__ */ jsx48(Element, { as: Flex, ref, className, children: /* @__PURE__ */ jsx48(
|
|
18921
19213
|
Text,
|
|
18922
19214
|
{
|
|
18923
19215
|
display: props.text.fontStyle,
|
|
@@ -18931,7 +19223,7 @@ TextElement.displayName = "Text";
|
|
|
18931
19223
|
|
|
18932
19224
|
// src/components/elements/unsubscribe-button/UnsubscribeButton.tsx
|
|
18933
19225
|
import { forwardRef as forwardRef14, useMemo as useMemo27 } from "react";
|
|
18934
|
-
import { jsx as
|
|
19226
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
18935
19227
|
var buttonStyles = {
|
|
18936
19228
|
primary: {
|
|
18937
19229
|
color: "primary",
|
|
@@ -18967,7 +19259,7 @@ var UnsubscribeButton = forwardRef14(({ children, className, ...rest }, ref) =>
|
|
|
18967
19259
|
if (!hasActiveSubscription) {
|
|
18968
19260
|
return null;
|
|
18969
19261
|
}
|
|
18970
|
-
return /* @__PURE__ */
|
|
19262
|
+
return /* @__PURE__ */ jsx49(
|
|
18971
19263
|
Element,
|
|
18972
19264
|
{
|
|
18973
19265
|
as: Flex,
|
|
@@ -18975,7 +19267,7 @@ var UnsubscribeButton = forwardRef14(({ children, className, ...rest }, ref) =>
|
|
|
18975
19267
|
className,
|
|
18976
19268
|
$flexDirection: "column",
|
|
18977
19269
|
$gap: "2rem",
|
|
18978
|
-
children: /* @__PURE__ */
|
|
19270
|
+
children: /* @__PURE__ */ jsx49(
|
|
18979
19271
|
Button,
|
|
18980
19272
|
{
|
|
18981
19273
|
type: "button",
|
|
@@ -18997,7 +19289,7 @@ UnsubscribeButton.displayName = "UnsubscribeButton";
|
|
|
18997
19289
|
|
|
18998
19290
|
// src/components/elements/upcoming-bill/UpcomingBill.tsx
|
|
18999
19291
|
import { forwardRef as forwardRef15, useCallback as useCallback13, useEffect as useEffect9, useMemo as useMemo28, useState as useState18 } from "react";
|
|
19000
|
-
import { jsx as
|
|
19292
|
+
import { jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
19001
19293
|
function resolveDesignProps11(props) {
|
|
19002
19294
|
return {
|
|
19003
19295
|
header: {
|
|
@@ -19019,11 +19311,12 @@ function resolveDesignProps11(props) {
|
|
|
19019
19311
|
var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
19020
19312
|
const props = resolveDesignProps11(rest);
|
|
19021
19313
|
const { t: t2 } = useTranslation();
|
|
19022
|
-
const { data, settings, getUpcomingInvoice } = useEmbed();
|
|
19314
|
+
const { data, settings, debug, getUpcomingInvoice, getCustomerBalance } = useEmbed();
|
|
19023
19315
|
const isLightBackground = useIsLightBackground();
|
|
19024
19316
|
const [isLoading, setIsLoading] = useState18(false);
|
|
19025
19317
|
const [error, setError] = useState18();
|
|
19026
19318
|
const [upcomingInvoice, setUpcomingInvoice] = useState18();
|
|
19319
|
+
const [balances, setBalances] = useState18([]);
|
|
19027
19320
|
const discounts = useMemo28(() => {
|
|
19028
19321
|
return (isCheckoutData(data) && data.subscription?.discounts || []).map(
|
|
19029
19322
|
(discount) => ({
|
|
@@ -19052,14 +19345,27 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19052
19345
|
}
|
|
19053
19346
|
}
|
|
19054
19347
|
}, [data, getUpcomingInvoice]);
|
|
19348
|
+
const getBalances = useCallback13(async () => {
|
|
19349
|
+
try {
|
|
19350
|
+
const response = await getCustomerBalance();
|
|
19351
|
+
if (response) {
|
|
19352
|
+
setBalances(response.data.balances);
|
|
19353
|
+
}
|
|
19354
|
+
} catch (err2) {
|
|
19355
|
+
debug("Failed to fetch customer balance.", err2);
|
|
19356
|
+
}
|
|
19357
|
+
}, [debug, getCustomerBalance]);
|
|
19055
19358
|
useEffect9(() => {
|
|
19056
19359
|
getInvoice();
|
|
19057
19360
|
}, [getInvoice]);
|
|
19361
|
+
useEffect9(() => {
|
|
19362
|
+
getBalances();
|
|
19363
|
+
}, [getBalances]);
|
|
19058
19364
|
if (!isCheckoutData(data) || !data.subscription || data.subscription.cancelAt) {
|
|
19059
19365
|
return null;
|
|
19060
19366
|
}
|
|
19061
19367
|
return /* @__PURE__ */ jsxs39(Element, { ref, className, children: [
|
|
19062
|
-
/* @__PURE__ */
|
|
19368
|
+
/* @__PURE__ */ jsx50(Flex, { as: TransitionBox, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ jsx50(Loader, { $color: settings.theme.primary, $isLoading: isLoading }) }),
|
|
19063
19369
|
error ? /* @__PURE__ */ jsxs39(
|
|
19064
19370
|
Flex,
|
|
19065
19371
|
{
|
|
@@ -19069,8 +19375,8 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19069
19375
|
$alignItems: "center",
|
|
19070
19376
|
$gap: "1rem",
|
|
19071
19377
|
children: [
|
|
19072
|
-
/* @__PURE__ */
|
|
19073
|
-
/* @__PURE__ */
|
|
19378
|
+
/* @__PURE__ */ jsx50(Text, { $weight: 500, $color: "#DB6669", children: t2("There was a problem retrieving your upcoming invoice.") }),
|
|
19379
|
+
/* @__PURE__ */ jsx50(
|
|
19074
19380
|
Button,
|
|
19075
19381
|
{
|
|
19076
19382
|
type: "button",
|
|
@@ -19083,7 +19389,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19083
19389
|
)
|
|
19084
19390
|
]
|
|
19085
19391
|
}
|
|
19086
|
-
) : !isLoading && /* @__PURE__ */
|
|
19392
|
+
) : !isLoading && /* @__PURE__ */ jsx50(TransitionBox, { children: upcomingInvoice ? /* @__PURE__ */ jsxs39(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
19087
19393
|
props.header.isVisible && upcomingInvoice.dueDate && /* @__PURE__ */ jsxs39(Text, { display: props.header.fontStyle, children: [
|
|
19088
19394
|
props.header.prefix,
|
|
19089
19395
|
" ",
|
|
@@ -19096,11 +19402,24 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19096
19402
|
$alignItems: "start",
|
|
19097
19403
|
$gap: "1rem",
|
|
19098
19404
|
children: [
|
|
19099
|
-
props.price.isVisible && /* @__PURE__ */
|
|
19405
|
+
props.price.isVisible && /* @__PURE__ */ jsx50(Text, { display: props.price.fontStyle, $leading: 1, children: formatCurrency(
|
|
19100
19406
|
upcomingInvoice.amountDue,
|
|
19101
19407
|
upcomingInvoice.currency
|
|
19102
19408
|
) }),
|
|
19103
|
-
/* @__PURE__ */
|
|
19409
|
+
/* @__PURE__ */ jsx50(Box, { $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ jsx50(Text, { display: props.contractEndDate.fontStyle, children: t2("Estimated bill") }) })
|
|
19410
|
+
]
|
|
19411
|
+
}
|
|
19412
|
+
),
|
|
19413
|
+
balances.length > 0 && /* @__PURE__ */ jsxs39(
|
|
19414
|
+
Flex,
|
|
19415
|
+
{
|
|
19416
|
+
as: TransitionBox,
|
|
19417
|
+
$justifyContent: "space-between",
|
|
19418
|
+
$alignItems: "start",
|
|
19419
|
+
$gap: "1rem",
|
|
19420
|
+
children: [
|
|
19421
|
+
/* @__PURE__ */ jsx50(Text, { $weight: 600, children: t2("Remaining balance") }),
|
|
19422
|
+
/* @__PURE__ */ jsx50(Flex, { $flexDirection: "column", $gap: "0.5rem", children: balances.map((item, idx) => /* @__PURE__ */ jsx50(Text, { children: formatCurrency(item.balance, item.currency) }, idx)) })
|
|
19104
19423
|
]
|
|
19105
19424
|
}
|
|
19106
19425
|
),
|
|
@@ -19111,8 +19430,8 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19111
19430
|
$alignItems: "start",
|
|
19112
19431
|
$gap: "1rem",
|
|
19113
19432
|
children: [
|
|
19114
|
-
/* @__PURE__ */
|
|
19115
|
-
/* @__PURE__ */
|
|
19433
|
+
/* @__PURE__ */ jsx50(Text, { $weight: 600, children: t2("Discount") }),
|
|
19434
|
+
/* @__PURE__ */ jsx50(
|
|
19116
19435
|
Flex,
|
|
19117
19436
|
{
|
|
19118
19437
|
$flexDirection: "column",
|
|
@@ -19128,7 +19447,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19128
19447
|
$alignItems: "center",
|
|
19129
19448
|
$gap: "0.5rem",
|
|
19130
19449
|
children: [
|
|
19131
|
-
discount.customerFacingCode && /* @__PURE__ */
|
|
19450
|
+
discount.customerFacingCode && /* @__PURE__ */ jsx50(
|
|
19132
19451
|
Flex,
|
|
19133
19452
|
{
|
|
19134
19453
|
$alignItems: "center",
|
|
@@ -19137,7 +19456,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19137
19456
|
$borderStyle: "solid",
|
|
19138
19457
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
|
|
19139
19458
|
$borderRadius: "0.3125rem",
|
|
19140
|
-
children: /* @__PURE__ */
|
|
19459
|
+
children: /* @__PURE__ */ jsx50(
|
|
19141
19460
|
Text,
|
|
19142
19461
|
{
|
|
19143
19462
|
$size: 0.75 * settings.theme.typography.text.fontSize,
|
|
@@ -19147,7 +19466,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19147
19466
|
)
|
|
19148
19467
|
}
|
|
19149
19468
|
),
|
|
19150
|
-
/* @__PURE__ */
|
|
19469
|
+
/* @__PURE__ */ jsx50(Box, { children: /* @__PURE__ */ jsx50(Text, { children: typeof discount.percentOff === "number" ? t2("Percent off", {
|
|
19151
19470
|
percent: discount.percentOff
|
|
19152
19471
|
}) : t2("Amount off", {
|
|
19153
19472
|
amount: formatCurrency(
|
|
@@ -19171,7 +19490,7 @@ var UpcomingBill = forwardRef15(({ className, ...rest }, ref) => {
|
|
|
19171
19490
|
]
|
|
19172
19491
|
}
|
|
19173
19492
|
)
|
|
19174
|
-
] }) : /* @__PURE__ */
|
|
19493
|
+
] }) : /* @__PURE__ */ jsx50(Text, { display: "heading2", children: t2("No upcoming invoice") }) })
|
|
19175
19494
|
] });
|
|
19176
19495
|
});
|
|
19177
19496
|
UpcomingBill.displayName = "UpcomingBill";
|
|
@@ -23431,10 +23750,10 @@ function createRenderer(options) {
|
|
|
23431
23750
|
}
|
|
23432
23751
|
|
|
23433
23752
|
// src/components/embed/Embed.tsx
|
|
23434
|
-
import { Fragment as Fragment26, jsx as
|
|
23753
|
+
import { Fragment as Fragment26, jsx as jsx51, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
23435
23754
|
var Loading = () => {
|
|
23436
23755
|
const { settings } = useEmbed();
|
|
23437
|
-
return /* @__PURE__ */
|
|
23756
|
+
return /* @__PURE__ */ jsx51(
|
|
23438
23757
|
Flex,
|
|
23439
23758
|
{
|
|
23440
23759
|
$width: "100%",
|
|
@@ -23442,7 +23761,7 @@ var Loading = () => {
|
|
|
23442
23761
|
$alignItems: "center",
|
|
23443
23762
|
$justifyContent: "center",
|
|
23444
23763
|
$padding: `${settings.theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
23445
|
-
children: /* @__PURE__ */
|
|
23764
|
+
children: /* @__PURE__ */ jsx51(Loader, { $color: "#194BFB", $size: "2xl" })
|
|
23446
23765
|
}
|
|
23447
23766
|
);
|
|
23448
23767
|
};
|
|
@@ -23459,14 +23778,14 @@ var Error2 = ({ message }) => {
|
|
|
23459
23778
|
$alignItems: "center",
|
|
23460
23779
|
$justifyContent: "center",
|
|
23461
23780
|
children: [
|
|
23462
|
-
/* @__PURE__ */
|
|
23463
|
-
/* @__PURE__ */
|
|
23781
|
+
/* @__PURE__ */ jsx51(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx51(Text, { display: "heading1", children: "Error" }) }),
|
|
23782
|
+
/* @__PURE__ */ jsx51(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx51(Text, { children: message }) })
|
|
23464
23783
|
]
|
|
23465
23784
|
}
|
|
23466
23785
|
);
|
|
23467
23786
|
};
|
|
23468
23787
|
var SchematicEmbed = ({ id, accessToken }) => {
|
|
23469
|
-
const [children, setChildren] = useState19(/* @__PURE__ */
|
|
23788
|
+
const [children, setChildren] = useState19(/* @__PURE__ */ jsx51(Loading, {}));
|
|
23470
23789
|
const theme = useContext5(et);
|
|
23471
23790
|
const {
|
|
23472
23791
|
data,
|
|
@@ -23513,13 +23832,13 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
23513
23832
|
return stub();
|
|
23514
23833
|
}
|
|
23515
23834
|
if (error) {
|
|
23516
|
-
return /* @__PURE__ */
|
|
23835
|
+
return /* @__PURE__ */ jsx51(Error2, { message: error.message });
|
|
23517
23836
|
}
|
|
23518
23837
|
if (accessToken?.length === 0) {
|
|
23519
|
-
return /* @__PURE__ */
|
|
23838
|
+
return /* @__PURE__ */ jsx51(Error2, { message: "Please provide an access token." });
|
|
23520
23839
|
}
|
|
23521
23840
|
if (!accessToken?.startsWith("token_")) {
|
|
23522
|
-
return /* @__PURE__ */
|
|
23841
|
+
return /* @__PURE__ */ jsx51(
|
|
23523
23842
|
Error2,
|
|
23524
23843
|
{
|
|
23525
23844
|
message: 'Invalid access token; your temporary access token will start with "token_".'
|
|
@@ -23527,9 +23846,9 @@ var SchematicEmbed = ({ id, accessToken }) => {
|
|
|
23527
23846
|
);
|
|
23528
23847
|
}
|
|
23529
23848
|
if (isPending) {
|
|
23530
|
-
return /* @__PURE__ */
|
|
23849
|
+
return /* @__PURE__ */ jsx51(Loading, {});
|
|
23531
23850
|
}
|
|
23532
|
-
return /* @__PURE__ */
|
|
23851
|
+
return /* @__PURE__ */ jsx51(Fragment26, { children });
|
|
23533
23852
|
};
|
|
23534
23853
|
export {
|
|
23535
23854
|
Box,
|