@burdenoff/website-sdk 2026.1101.1 → 2026.1101.3
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/README.md +52 -11
- package/dist/analytics/index.js +19 -69
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +3 -69
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/avatar-live/index.js +1 -0
- package/dist/avatar-live/index.js.map +1 -1
- package/dist/avatar-live/index.mjs +1 -0
- package/dist/avatar-live/index.mjs.map +1 -1
- package/dist/avatar-live-view/index.js +25 -30
- package/dist/avatar-live-view/index.js.map +1 -1
- package/dist/avatar-live-view/index.mjs +20 -25
- package/dist/avatar-live-view/index.mjs.map +1 -1
- package/dist/chunk-23H4JUL4.js +41 -0
- package/dist/chunk-23H4JUL4.js.map +1 -0
- package/dist/chunk-34RX5P75.mjs +25 -0
- package/dist/chunk-34RX5P75.mjs.map +1 -0
- package/dist/chunk-3LFFY7AZ.js +184 -0
- package/dist/chunk-3LFFY7AZ.js.map +1 -0
- package/dist/chunk-3X26GE4S.js +2794 -0
- package/dist/chunk-3X26GE4S.js.map +1 -0
- package/dist/chunk-45GCA4GG.js +85 -0
- package/dist/chunk-45GCA4GG.js.map +1 -0
- package/dist/chunk-4SAGVLHN.js +876 -0
- package/dist/chunk-4SAGVLHN.js.map +1 -0
- package/dist/chunk-4U6YAII5.js +218 -0
- package/dist/chunk-4U6YAII5.js.map +1 -0
- package/dist/chunk-5GMTBOO6.js +21 -0
- package/dist/chunk-5GMTBOO6.js.map +1 -0
- package/dist/chunk-5JRJ57CL.mjs +329 -0
- package/dist/chunk-5JRJ57CL.mjs.map +1 -0
- package/dist/chunk-6C2DKIC7.js +4 -0
- package/dist/chunk-6C2DKIC7.js.map +1 -0
- package/dist/chunk-6IBFBWC5.mjs +17 -0
- package/dist/chunk-6IBFBWC5.mjs.map +1 -0
- package/dist/chunk-6KY2ZRVI.js +116 -0
- package/dist/chunk-6KY2ZRVI.js.map +1 -0
- package/dist/chunk-6VJT3SM4.mjs +182 -0
- package/dist/chunk-6VJT3SM4.mjs.map +1 -0
- package/dist/chunk-6YZUFMK2.mjs +40 -0
- package/dist/chunk-6YZUFMK2.mjs.map +1 -0
- package/dist/chunk-7A6R7CGG.js +47 -0
- package/dist/chunk-7A6R7CGG.js.map +1 -0
- package/dist/chunk-7PWL4V2R.js +4 -0
- package/dist/chunk-7PWL4V2R.js.map +1 -0
- package/dist/chunk-AA33WDYS.js +161 -0
- package/dist/chunk-AA33WDYS.js.map +1 -0
- package/dist/chunk-AHRGFXV2.js +525 -0
- package/dist/chunk-AHRGFXV2.js.map +1 -0
- package/dist/chunk-B63XLDZH.mjs +109 -0
- package/dist/chunk-B63XLDZH.mjs.map +1 -0
- package/dist/chunk-BX2USEWF.mjs +35 -0
- package/dist/chunk-BX2USEWF.mjs.map +1 -0
- package/dist/chunk-BYSZT35R.js +150 -0
- package/dist/chunk-BYSZT35R.js.map +1 -0
- package/dist/chunk-C6OJIHNO.js +12 -0
- package/dist/chunk-C6OJIHNO.js.map +1 -0
- package/dist/chunk-COOELBX7.mjs +63 -0
- package/dist/chunk-COOELBX7.mjs.map +1 -0
- package/dist/chunk-D2TW7MNC.mjs +2771 -0
- package/dist/chunk-D2TW7MNC.mjs.map +1 -0
- package/dist/chunk-D5KEZ6V6.mjs +3 -0
- package/dist/chunk-D5KEZ6V6.mjs.map +1 -0
- package/dist/chunk-E3GUGJMY.js +46 -0
- package/dist/chunk-E3GUGJMY.js.map +1 -0
- package/dist/chunk-EBZ2HGJ2.mjs +52 -0
- package/dist/chunk-EBZ2HGJ2.mjs.map +1 -0
- package/dist/chunk-EDLTUOIA.mjs +210 -0
- package/dist/chunk-EDLTUOIA.mjs.map +1 -0
- package/dist/chunk-EJQSOT4X.js +4 -0
- package/dist/chunk-EJQSOT4X.js.map +1 -0
- package/dist/chunk-EUPFS6MZ.mjs +2019 -0
- package/dist/chunk-EUPFS6MZ.mjs.map +1 -0
- package/dist/chunk-F3XWDC3B.js +77 -0
- package/dist/chunk-F3XWDC3B.js.map +1 -0
- package/dist/chunk-FFADMVIK.mjs +5127 -0
- package/dist/chunk-FFADMVIK.mjs.map +1 -0
- package/dist/chunk-FJWS7BKT.mjs +3 -0
- package/dist/chunk-FJWS7BKT.mjs.map +1 -0
- package/dist/chunk-FJZJDUOR.mjs +3 -0
- package/dist/chunk-FJZJDUOR.mjs.map +1 -0
- package/dist/chunk-GCFLCO2Z.mjs +145 -0
- package/dist/chunk-GCFLCO2Z.mjs.map +1 -0
- package/dist/chunk-GEXC4LRP.js +61 -0
- package/dist/chunk-GEXC4LRP.js.map +1 -0
- package/dist/chunk-GTRAXQGC.mjs +3 -0
- package/dist/chunk-GTRAXQGC.mjs.map +1 -0
- package/dist/chunk-IKOIRUKW.js +270 -0
- package/dist/chunk-IKOIRUKW.js.map +1 -0
- package/dist/chunk-IXTWOPRN.js +45 -0
- package/dist/chunk-IXTWOPRN.js.map +1 -0
- package/dist/chunk-JDXOXGOK.js +547 -0
- package/dist/chunk-JDXOXGOK.js.map +1 -0
- package/dist/chunk-JSLDWYV7.mjs +558 -0
- package/dist/chunk-JSLDWYV7.mjs.map +1 -0
- package/dist/chunk-JXLSTVBK.js +336 -0
- package/dist/chunk-JXLSTVBK.js.map +1 -0
- package/dist/chunk-KHYXK7FG.mjs +49 -0
- package/dist/chunk-KHYXK7FG.mjs.map +1 -0
- package/dist/chunk-KSMBOWQQ.js +2034 -0
- package/dist/chunk-KSMBOWQQ.js.map +1 -0
- package/dist/chunk-KU2PXHGB.mjs +83 -0
- package/dist/chunk-KU2PXHGB.mjs.map +1 -0
- package/dist/chunk-KZANIV3S.mjs +37 -0
- package/dist/chunk-KZANIV3S.mjs.map +1 -0
- package/dist/chunk-L4BP6YOB.js +20 -0
- package/dist/chunk-L4BP6YOB.js.map +1 -0
- package/dist/chunk-MRKA2OAF.mjs +75 -0
- package/dist/chunk-MRKA2OAF.mjs.map +1 -0
- package/dist/chunk-N5EC53MH.mjs +80 -0
- package/dist/chunk-N5EC53MH.mjs.map +1 -0
- package/dist/chunk-NZANQGDM.mjs +34 -0
- package/dist/chunk-NZANQGDM.mjs.map +1 -0
- package/dist/chunk-O4GS3XPZ.js +10 -0
- package/dist/chunk-O4GS3XPZ.js.map +1 -0
- package/dist/chunk-O76QDGRM.js +5154 -0
- package/dist/chunk-O76QDGRM.js.map +1 -0
- package/dist/chunk-OYEUNZJY.js +114 -0
- package/dist/chunk-OYEUNZJY.js.map +1 -0
- package/dist/chunk-PHXAGQNB.js +74 -0
- package/dist/chunk-PHXAGQNB.js.map +1 -0
- package/dist/chunk-PIHHPP7J.mjs +16 -0
- package/dist/chunk-PIHHPP7J.mjs.map +1 -0
- package/dist/chunk-PXRHVVOU.mjs +499 -0
- package/dist/chunk-PXRHVVOU.mjs.map +1 -0
- package/dist/chunk-QMA6U6AU.js +36 -0
- package/dist/chunk-QMA6U6AU.js.map +1 -0
- package/dist/chunk-R6J7IULF.js +44 -0
- package/dist/chunk-R6J7IULF.js.map +1 -0
- package/dist/chunk-R7G6TWIS.mjs +10 -0
- package/dist/chunk-R7G6TWIS.mjs.map +1 -0
- package/dist/chunk-RUMGFI6L.mjs +544 -0
- package/dist/chunk-RUMGFI6L.mjs.map +1 -0
- package/dist/chunk-S54JWSJF.js +565 -0
- package/dist/chunk-S54JWSJF.js.map +1 -0
- package/dist/chunk-SK5UGG6A.js +2041 -0
- package/dist/chunk-SK5UGG6A.js.map +1 -0
- package/dist/chunk-SKIYDKIS.mjs +70 -0
- package/dist/chunk-SKIYDKIS.mjs.map +1 -0
- package/dist/chunk-SZNS5IK6.mjs +322 -0
- package/dist/chunk-SZNS5IK6.mjs.map +1 -0
- package/dist/chunk-T7JIPZAC.js +66 -0
- package/dist/chunk-T7JIPZAC.js.map +1 -0
- package/dist/chunk-TGYQHO2E.mjs +864 -0
- package/dist/chunk-TGYQHO2E.mjs.map +1 -0
- package/dist/chunk-TT3MHN42.mjs +8 -0
- package/dist/chunk-TT3MHN42.mjs.map +1 -0
- package/dist/chunk-UM55U65W.mjs +268 -0
- package/dist/chunk-UM55U65W.mjs.map +1 -0
- package/dist/chunk-UQ2HALUD.js +72 -0
- package/dist/chunk-UQ2HALUD.js.map +1 -0
- package/dist/chunk-UXWT7G77.js +82 -0
- package/dist/chunk-UXWT7G77.js.map +1 -0
- package/dist/chunk-VNS5WDWO.mjs +7 -0
- package/dist/chunk-VNS5WDWO.mjs.map +1 -0
- package/dist/chunk-VRWZLGR7.js +4 -0
- package/dist/chunk-VRWZLGR7.js.map +1 -0
- package/dist/chunk-VZLDSNH4.mjs +22 -0
- package/dist/chunk-VZLDSNH4.mjs.map +1 -0
- package/dist/chunk-W6P3YETJ.js +92 -0
- package/dist/chunk-W6P3YETJ.js.map +1 -0
- package/dist/chunk-WPKFFQCR.mjs +90 -0
- package/dist/chunk-WPKFFQCR.mjs.map +1 -0
- package/dist/chunk-WTVTI5TO.mjs +22 -0
- package/dist/chunk-WTVTI5TO.mjs.map +1 -0
- package/dist/chunk-XJOBZ4RJ.js +44 -0
- package/dist/chunk-XJOBZ4RJ.js.map +1 -0
- package/dist/chunk-XP2JDNDU.js +325 -0
- package/dist/chunk-XP2JDNDU.js.map +1 -0
- package/dist/chunk-Y4V5CEWD.mjs +112 -0
- package/dist/chunk-Y4V5CEWD.mjs.map +1 -0
- package/dist/chunk-YERN2UWM.js +116 -0
- package/dist/chunk-YERN2UWM.js.map +1 -0
- package/dist/chunk-ZKJQWFAA.mjs +114 -0
- package/dist/chunk-ZKJQWFAA.mjs.map +1 -0
- package/dist/chunk-ZOON3S3Y.mjs +138 -0
- package/dist/chunk-ZOON3S3Y.mjs.map +1 -0
- package/dist/chunk-ZP6QRAYC.mjs +2024 -0
- package/dist/chunk-ZP6QRAYC.mjs.map +1 -0
- package/dist/chunk-ZSTFX7FV.js +9 -0
- package/dist/chunk-ZSTFX7FV.js.map +1 -0
- package/dist/client/index.js +23 -331
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +3 -330
- package/dist/client/index.mjs.map +1 -1
- package/dist/comparison/index.js +28 -111
- package/dist/comparison/index.js.map +1 -1
- package/dist/comparison/index.mjs +2 -107
- package/dist/comparison/index.mjs.map +1 -1
- package/dist/components/contact.js +21 -931
- package/dist/components/contact.js.map +1 -1
- package/dist/components/contact.mjs +12 -909
- package/dist/components/contact.mjs.map +1 -1
- package/dist/components/electron-download.js +12 -124
- package/dist/components/electron-download.js.map +1 -1
- package/dist/components/electron-download.mjs +4 -106
- package/dist/components/electron-download.mjs.map +1 -1
- package/dist/components/explore-cta.js +8 -112
- package/dist/components/explore-cta.js.map +1 -1
- package/dist/components/explore-cta.mjs +3 -114
- package/dist/components/explore-cta.mjs.map +1 -1
- package/dist/components/explore.js +62 -7833
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +13 -7800
- package/dist/components/explore.mjs.map +1 -1
- package/dist/components/launch-countdown.js +8 -83
- package/dist/components/launch-countdown.js.map +1 -1
- package/dist/components/launch-countdown.mjs +3 -85
- package/dist/components/launch-countdown.mjs.map +1 -1
- package/dist/components/newsletter.js +20 -993
- package/dist/components/newsletter.js.map +1 -1
- package/dist/components/newsletter.mjs +11 -971
- package/dist/components/newsletter.mjs.map +1 -1
- package/dist/components/partners.js +24 -1302
- package/dist/components/partners.js.map +1 -1
- package/dist/components/partners.mjs +15 -1276
- package/dist/components/partners.mjs.map +1 -1
- package/dist/components/pricing.js +49 -1249
- package/dist/components/pricing.js.map +1 -1
- package/dist/components/pricing.mjs +8 -1226
- package/dist/components/pricing.mjs.map +1 -1
- package/dist/components/problems-solved.js +8 -150
- package/dist/components/problems-solved.js.map +1 -1
- package/dist/components/problems-solved.mjs +4 -133
- package/dist/components/problems-solved.mjs.map +1 -1
- package/dist/components/resource-links.js +8 -304
- package/dist/components/resource-links.js.map +1 -1
- package/dist/components/resource-links.mjs +5 -308
- package/dist/components/resource-links.mjs.map +1 -1
- package/dist/components/social-links.js +8 -343
- package/dist/components/social-links.js.map +1 -1
- package/dist/components/social-links.mjs +5 -347
- package/dist/components/social-links.mjs.map +1 -1
- package/dist/components/unsubscribe.js +10 -627
- package/dist/components/unsubscribe.js.map +1 -1
- package/dist/components/unsubscribe.mjs +6 -611
- package/dist/components/unsubscribe.mjs.map +1 -1
- package/dist/components/waitlist.js +21 -1001
- package/dist/components/waitlist.js.map +1 -1
- package/dist/components/waitlist.mjs +12 -982
- package/dist/components/waitlist.mjs.map +1 -1
- package/dist/components/website-switcher.js +12 -175
- package/dist/components/website-switcher.js.map +1 -1
- package/dist/components/website-switcher.mjs +4 -157
- package/dist/components/website-switcher.mjs.map +1 -1
- package/dist/content/index.js +118 -3616
- package/dist/content/index.js.map +1 -1
- package/dist/content/index.mjs +12 -3567
- package/dist/content/index.mjs.map +1 -1
- package/dist/hooks/index.js +37 -2321
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +6 -2318
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4145 -20599
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3766 -20567
- package/dist/index.mjs.map +1 -1
- package/dist/product/index.js +20 -393
- package/dist/product/index.js.map +1 -1
- package/dist/product/index.mjs +5 -394
- package/dist/product/index.mjs.map +1 -1
- package/dist/seo/index.js +8 -76
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/index.mjs +3 -78
- package/dist/seo/index.mjs.map +1 -1
- package/dist/store/index.js +51 -2650
- package/dist/store/index.js.map +1 -1
- package/dist/store/index.mjs +13 -2619
- package/dist/store/index.mjs.map +1 -1
- package/dist/utils/index.js +69 -134
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +5 -122
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,864 @@
|
|
|
1
|
+
import { PageHead } from './chunk-N5EC53MH.mjs';
|
|
2
|
+
import { Button } from './chunk-KHYXK7FG.mjs';
|
|
3
|
+
import { useProduct } from './chunk-GCFLCO2Z.mjs';
|
|
4
|
+
import { useWebSDK, useWebSDKConfig } from './chunk-5JRJ57CL.mjs';
|
|
5
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/components/pricing-catalog.ts
|
|
9
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10
|
+
function isUuidLike(value) {
|
|
11
|
+
return UUID_PATTERN.test(value.trim());
|
|
12
|
+
}
|
|
13
|
+
var PricingProductKeyError = class extends Error {
|
|
14
|
+
constructor(productId) {
|
|
15
|
+
super(
|
|
16
|
+
`PricingPage was given the product id "${productId}", which matches no public product. publicPlans(productId) expects the product slug (for example "vibecontrols"); pass product.slug.`
|
|
17
|
+
);
|
|
18
|
+
this.name = "PricingProductKeyError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function resolvePricingProductKey(productId, candidates) {
|
|
22
|
+
const trimmed = productId.trim();
|
|
23
|
+
if (!isUuidLike(trimmed)) return trimmed;
|
|
24
|
+
const wanted = trimmed.toLowerCase();
|
|
25
|
+
const match = candidates.find(
|
|
26
|
+
(c) => !!c && c.id.toLowerCase() === wanted && c.slug.trim().length > 0
|
|
27
|
+
);
|
|
28
|
+
return match ? match.slug.trim() : null;
|
|
29
|
+
}
|
|
30
|
+
var PERIOD_SUFFIX = /\s*[([]\s*(monthly|month|annual|annually|yearly|year)\s*[)\]]\s*$/i;
|
|
31
|
+
var PRODUCT_PREFIX = /^\S.*?\s[-–—]\s+(?=\S)/;
|
|
32
|
+
function cleanPlanDisplayName(name) {
|
|
33
|
+
const withoutPeriod = name.replace(PERIOD_SUFFIX, "").trim();
|
|
34
|
+
const withoutProduct = withoutPeriod.replace(PRODUCT_PREFIX, "").trim();
|
|
35
|
+
if (withoutProduct.length > 0) return withoutProduct;
|
|
36
|
+
if (withoutPeriod.length > 0) return withoutPeriod;
|
|
37
|
+
return name.trim();
|
|
38
|
+
}
|
|
39
|
+
function isFiniteNumber(value) {
|
|
40
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
41
|
+
}
|
|
42
|
+
function planPriceIn(plan, currency) {
|
|
43
|
+
const code = currency.toUpperCase();
|
|
44
|
+
if (plan.price === 0) return 0;
|
|
45
|
+
if (plan.currency.toUpperCase() === code) return plan.price;
|
|
46
|
+
const prices = plan.currencyPrices;
|
|
47
|
+
if (!prices) return null;
|
|
48
|
+
const direct = prices[code];
|
|
49
|
+
if (isFiniteNumber(direct)) return direct;
|
|
50
|
+
const key = Object.keys(prices).find((k) => k.toUpperCase() === code);
|
|
51
|
+
const value = key === void 0 ? void 0 : prices[key];
|
|
52
|
+
return isFiniteNumber(value) ? value : null;
|
|
53
|
+
}
|
|
54
|
+
function availablePlanCurrencies(plans) {
|
|
55
|
+
if (plans.length === 0) return [];
|
|
56
|
+
const all = /* @__PURE__ */ new Set();
|
|
57
|
+
for (const plan of plans) {
|
|
58
|
+
all.add(plan.currency.toUpperCase());
|
|
59
|
+
for (const key of Object.keys(plan.currencyPrices ?? {})) {
|
|
60
|
+
all.add(key.toUpperCase());
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const usable = [...all].filter(
|
|
64
|
+
(code) => plans.every((plan) => planPriceIn(plan, code) !== null)
|
|
65
|
+
);
|
|
66
|
+
const base = plans.find((p) => p.price > 0)?.currency.toUpperCase();
|
|
67
|
+
return usable.sort((a, b) => {
|
|
68
|
+
if (a === base) return -1;
|
|
69
|
+
if (b === base) return 1;
|
|
70
|
+
return a.localeCompare(b);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
var EURO_REGIONS = [
|
|
74
|
+
"AT",
|
|
75
|
+
"BE",
|
|
76
|
+
"CY",
|
|
77
|
+
"DE",
|
|
78
|
+
"EE",
|
|
79
|
+
"ES",
|
|
80
|
+
"FI",
|
|
81
|
+
"FR",
|
|
82
|
+
"GR",
|
|
83
|
+
"HR",
|
|
84
|
+
"IE",
|
|
85
|
+
"IT",
|
|
86
|
+
"LT",
|
|
87
|
+
"LU",
|
|
88
|
+
"LV",
|
|
89
|
+
"MT",
|
|
90
|
+
"NL",
|
|
91
|
+
"PT",
|
|
92
|
+
"SI",
|
|
93
|
+
"SK"
|
|
94
|
+
];
|
|
95
|
+
var REGION_CURRENCY = Object.freeze({
|
|
96
|
+
AU: "AUD",
|
|
97
|
+
BR: "BRL",
|
|
98
|
+
CA: "CAD",
|
|
99
|
+
CH: "CHF",
|
|
100
|
+
CN: "CNY",
|
|
101
|
+
DK: "DKK",
|
|
102
|
+
GB: "GBP",
|
|
103
|
+
HK: "HKD",
|
|
104
|
+
IN: "INR",
|
|
105
|
+
JP: "JPY",
|
|
106
|
+
KR: "KRW",
|
|
107
|
+
MX: "MXN",
|
|
108
|
+
MY: "MYR",
|
|
109
|
+
NO: "NOK",
|
|
110
|
+
NZ: "NZD",
|
|
111
|
+
PL: "PLN",
|
|
112
|
+
SE: "SEK",
|
|
113
|
+
SG: "SGD",
|
|
114
|
+
TH: "THB",
|
|
115
|
+
US: "USD",
|
|
116
|
+
...Object.fromEntries(EURO_REGIONS.map((r) => [r, "EUR"]))
|
|
117
|
+
});
|
|
118
|
+
var TIME_ZONE_REGION = Object.freeze({
|
|
119
|
+
"Asia/Kolkata": "IN",
|
|
120
|
+
"Asia/Calcutta": "IN"
|
|
121
|
+
});
|
|
122
|
+
function regionOfLanguage(tag) {
|
|
123
|
+
const parts = tag.replace(/_/g, "-").split("-");
|
|
124
|
+
for (const part of parts.slice(1)) {
|
|
125
|
+
if (/^[A-Za-z]{2}$/.test(part)) return part.toUpperCase();
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
function detectRegionalCurrency(available, locale) {
|
|
130
|
+
const sellable = new Set(available.map((c) => c.toUpperCase()));
|
|
131
|
+
const regions = [];
|
|
132
|
+
const tzRegion = locale.timeZone ? TIME_ZONE_REGION[locale.timeZone] : null;
|
|
133
|
+
if (tzRegion) regions.push(tzRegion);
|
|
134
|
+
for (const tag of locale.languages ?? []) {
|
|
135
|
+
const region = regionOfLanguage(tag);
|
|
136
|
+
if (region) regions.push(region);
|
|
137
|
+
}
|
|
138
|
+
for (const region of regions) {
|
|
139
|
+
const currency = REGION_CURRENCY[region];
|
|
140
|
+
if (currency && sellable.has(currency)) return currency;
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
function formatCatalogPrice(amount, currency) {
|
|
145
|
+
const code = currency.toUpperCase();
|
|
146
|
+
const whole = amount % 1 === 0;
|
|
147
|
+
try {
|
|
148
|
+
return new Intl.NumberFormat("en-US", {
|
|
149
|
+
style: "currency",
|
|
150
|
+
currency: code,
|
|
151
|
+
minimumFractionDigits: whole ? 0 : 2,
|
|
152
|
+
maximumFractionDigits: whole ? 0 : 2
|
|
153
|
+
}).format(amount);
|
|
154
|
+
} catch {
|
|
155
|
+
return `${code} ${whole ? amount.toString() : amount.toFixed(2)}`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function plansForBillingCycle(plans, cycle) {
|
|
159
|
+
if (cycle === "monthly") {
|
|
160
|
+
return plans.filter((p) => p.duration === "monthly");
|
|
161
|
+
}
|
|
162
|
+
const yearly = plans.filter((p) => p.duration === "yearly");
|
|
163
|
+
if (yearly.some((p) => p.priceRaw === 0)) return yearly;
|
|
164
|
+
const free = plans.filter(
|
|
165
|
+
(p) => p.duration === "monthly" && p.priceRaw === 0
|
|
166
|
+
);
|
|
167
|
+
return [...free, ...yearly];
|
|
168
|
+
}
|
|
169
|
+
var GET_PLANS_QUERY = `
|
|
170
|
+
query GetPublicPlans($productId: String!) {
|
|
171
|
+
publicPlans(productId: $productId) {
|
|
172
|
+
id
|
|
173
|
+
name
|
|
174
|
+
price
|
|
175
|
+
currency
|
|
176
|
+
currencyPrices
|
|
177
|
+
duration
|
|
178
|
+
features {
|
|
179
|
+
id
|
|
180
|
+
quotaId
|
|
181
|
+
context
|
|
182
|
+
quota {
|
|
183
|
+
id
|
|
184
|
+
name
|
|
185
|
+
limits
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
isActive
|
|
189
|
+
productID
|
|
190
|
+
createdAt
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
`;
|
|
194
|
+
var PUBLIC_PRODUCT_KEYS_QUERY = `
|
|
195
|
+
query PricingProductKeys {
|
|
196
|
+
publicProducts(limit: 200) {
|
|
197
|
+
items {
|
|
198
|
+
id
|
|
199
|
+
slug
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
204
|
+
var CURRENCY_STORAGE_KEY = "burdenoff.pricing.currency";
|
|
205
|
+
function readStoredCurrency() {
|
|
206
|
+
try {
|
|
207
|
+
if (typeof window === "undefined") return null;
|
|
208
|
+
return window.localStorage.getItem(CURRENCY_STORAGE_KEY);
|
|
209
|
+
} catch {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function storeCurrency(code) {
|
|
214
|
+
try {
|
|
215
|
+
if (typeof window === "undefined") return;
|
|
216
|
+
window.localStorage.setItem(CURRENCY_STORAGE_KEY, code);
|
|
217
|
+
} catch {
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function readVisitorLocale() {
|
|
221
|
+
let timeZone = null;
|
|
222
|
+
try {
|
|
223
|
+
timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone ?? null;
|
|
224
|
+
} catch {
|
|
225
|
+
timeZone = null;
|
|
226
|
+
}
|
|
227
|
+
const languages = typeof navigator === "undefined" ? [] : [...navigator.languages ?? [], navigator.language].filter(
|
|
228
|
+
(l) => typeof l === "string" && l.length > 0
|
|
229
|
+
);
|
|
230
|
+
return { timeZone, languages };
|
|
231
|
+
}
|
|
232
|
+
function formatPrice(price, currencyCode = "USD", currencies) {
|
|
233
|
+
const currency = currencies?.[currencyCode];
|
|
234
|
+
if (!currency) {
|
|
235
|
+
return formatCatalogPrice(price, currencyCode);
|
|
236
|
+
}
|
|
237
|
+
const formattedNumber = price % 1 === 0 ? price.toString() : price.toFixed(2);
|
|
238
|
+
return currency.position === "prefix" ? `${currency.symbol}${formattedNumber}` : `${formattedNumber}${currency.symbol}`;
|
|
239
|
+
}
|
|
240
|
+
function formatInterval(duration, billingIntervals) {
|
|
241
|
+
const defaultIntervals = {
|
|
242
|
+
monthly: "/month",
|
|
243
|
+
yearly: "/year"
|
|
244
|
+
};
|
|
245
|
+
const intervals = billingIntervals || defaultIntervals;
|
|
246
|
+
return intervals[duration] || `/${duration}`;
|
|
247
|
+
}
|
|
248
|
+
function isEnterprisePlan(planName) {
|
|
249
|
+
const name = planName.toLowerCase();
|
|
250
|
+
return name.includes("team") || name.includes("business") || name.includes("enterprise");
|
|
251
|
+
}
|
|
252
|
+
function isEnterpriseAudiencePlan(plan) {
|
|
253
|
+
if (!isEnterprisePlan(plan.name)) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
if (typeof plan.priceRaw === "number") {
|
|
257
|
+
return plan.priceRaw === 0;
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
function splitPlansByAudience(plans, showAudienceTabs) {
|
|
262
|
+
if (!showAudienceTabs) {
|
|
263
|
+
return { individualPlans: plans, enterprisePlans: [] };
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
individualPlans: plans.filter((p) => !isEnterpriseAudiencePlan(p)),
|
|
267
|
+
enterprisePlans: plans.filter((p) => isEnterpriseAudiencePlan(p))
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function resolveEnterprisePlans(apiEnterprisePlans, staticEnterprisePlans, defaultEnterpriseCard) {
|
|
271
|
+
const staticPlans = staticEnterprisePlans || [];
|
|
272
|
+
if (apiEnterprisePlans.length === 0 && staticPlans.length === 0) {
|
|
273
|
+
return [defaultEnterpriseCard];
|
|
274
|
+
}
|
|
275
|
+
const apiNames = new Set(apiEnterprisePlans.map((p) => p.name.toLowerCase()));
|
|
276
|
+
const dedupedStaticPlans = staticPlans.filter(
|
|
277
|
+
(p) => !apiNames.has(p.name.toLowerCase())
|
|
278
|
+
);
|
|
279
|
+
return [...apiEnterprisePlans, ...dedupedStaticPlans];
|
|
280
|
+
}
|
|
281
|
+
function detectPlanTier(planName) {
|
|
282
|
+
const name = planName.toLowerCase();
|
|
283
|
+
if (name.includes("free") || name.includes("basic") || name.includes("starter") || name.includes("hobby")) {
|
|
284
|
+
return "basic";
|
|
285
|
+
} else if (name.includes("pro") || name.includes("professional") || name.includes("premium") || name.includes("team")) {
|
|
286
|
+
return "professional";
|
|
287
|
+
} else if (name.includes("enterprise") || name.includes("business")) {
|
|
288
|
+
return "enterprise";
|
|
289
|
+
}
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
function getFallbackFeaturesForTier(tier, fallbackFeatures) {
|
|
293
|
+
return [...fallbackFeatures?.[tier] || []];
|
|
294
|
+
}
|
|
295
|
+
function getMetadataForPlan(planName, priceRaw, planMetadata) {
|
|
296
|
+
const normalizedName = planName.toLowerCase();
|
|
297
|
+
const cleanName = cleanPlanDisplayName(planName);
|
|
298
|
+
const meta = planMetadata?.[normalizedName] ?? planMetadata?.[cleanName.toLowerCase()];
|
|
299
|
+
if (meta) {
|
|
300
|
+
return {
|
|
301
|
+
tier: meta.tier || "basic",
|
|
302
|
+
displayName: meta.displayName || cleanName,
|
|
303
|
+
defaultDescription: meta.defaultDescription || "Choose this plan",
|
|
304
|
+
popular: meta.popular ?? false,
|
|
305
|
+
ctaText: meta.ctaText || "Get Started",
|
|
306
|
+
ctaType: meta.ctaType || "signup",
|
|
307
|
+
features: meta.features
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
const tier = detectPlanTier(planName);
|
|
311
|
+
if (tier) {
|
|
312
|
+
const isPaidEnterpriseName = tier === "enterprise" && typeof priceRaw === "number" && priceRaw > 0;
|
|
313
|
+
if (isPaidEnterpriseName) {
|
|
314
|
+
return {
|
|
315
|
+
tier: "professional",
|
|
316
|
+
displayName: cleanName,
|
|
317
|
+
defaultDescription: "Choose this plan",
|
|
318
|
+
popular: false,
|
|
319
|
+
ctaText: "Get Started",
|
|
320
|
+
ctaType: "signup"
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
tier,
|
|
325
|
+
displayName: cleanName,
|
|
326
|
+
defaultDescription: "Choose this plan",
|
|
327
|
+
popular: tier === "professional",
|
|
328
|
+
ctaText: tier === "enterprise" ? "Contact Sales" : "Get Started",
|
|
329
|
+
ctaType: tier === "enterprise" ? "contact" : "signup"
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
tier: "basic",
|
|
334
|
+
displayName: cleanName,
|
|
335
|
+
defaultDescription: "Choose this plan",
|
|
336
|
+
popular: false,
|
|
337
|
+
ctaText: "Get Started",
|
|
338
|
+
ctaType: "signup"
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function humanizeQuotaName(name) {
|
|
342
|
+
const parts = name.split(".");
|
|
343
|
+
const resource = parts.length >= 3 ? parts[parts.length - 2] : parts[parts.length - 1];
|
|
344
|
+
return resource.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
345
|
+
}
|
|
346
|
+
function transformFeatureToLabel(feature) {
|
|
347
|
+
const quota = feature.quota;
|
|
348
|
+
if (!quota) return "";
|
|
349
|
+
const { name, limits } = quota;
|
|
350
|
+
const featureContext = feature.context && typeof feature.context === "object" ? feature.context : null;
|
|
351
|
+
const limitsObj = limits && typeof limits === "object" ? limits : null;
|
|
352
|
+
const value = typeof featureContext?.quantity === "number" ? featureContext.quantity : typeof limitsObj?.value === "number" ? limitsObj.value : void 0;
|
|
353
|
+
const unit = typeof featureContext?.unit === "string" && featureContext.unit || typeof limitsObj?.unit === "string" && limitsObj.unit || void 0;
|
|
354
|
+
const description = typeof featureContext?.description === "string" && featureContext.description || typeof limitsObj?.description === "string" && limitsObj.description || void 0;
|
|
355
|
+
const type = limitsObj?.type;
|
|
356
|
+
if (description) {
|
|
357
|
+
if (type === "number" && typeof value === "number") {
|
|
358
|
+
return `${value.toLocaleString()} ${description}`;
|
|
359
|
+
}
|
|
360
|
+
return description;
|
|
361
|
+
}
|
|
362
|
+
if (unit) {
|
|
363
|
+
if (typeof value === "number") {
|
|
364
|
+
return `${value.toLocaleString()} ${unit}`;
|
|
365
|
+
}
|
|
366
|
+
return unit;
|
|
367
|
+
}
|
|
368
|
+
const label = humanizeQuotaName(name);
|
|
369
|
+
if (type === "boolean") {
|
|
370
|
+
return label;
|
|
371
|
+
}
|
|
372
|
+
if (typeof value === "number") {
|
|
373
|
+
return `${value.toLocaleString()} ${label}`;
|
|
374
|
+
}
|
|
375
|
+
return label;
|
|
376
|
+
}
|
|
377
|
+
function extractDisplayFeatures(features, planName, fallbackFeatures) {
|
|
378
|
+
const tier = detectPlanTier(planName);
|
|
379
|
+
if (tier) {
|
|
380
|
+
const tierFeatures = getFallbackFeaturesForTier(tier, fallbackFeatures);
|
|
381
|
+
if (tierFeatures.length > 0) {
|
|
382
|
+
return tierFeatures;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
const quotaFeatures = features.filter((f) => f.quota).map((f) => transformFeatureToLabel(f));
|
|
386
|
+
if (quotaFeatures.length > 0) {
|
|
387
|
+
return quotaFeatures;
|
|
388
|
+
}
|
|
389
|
+
return [];
|
|
390
|
+
}
|
|
391
|
+
function transformToDisplayCard(plan, props, currency) {
|
|
392
|
+
const metadata = getMetadataForPlan(
|
|
393
|
+
plan.name,
|
|
394
|
+
plan.price,
|
|
395
|
+
props.planMetadata
|
|
396
|
+
);
|
|
397
|
+
const selectedPrice = currency ? planPriceIn(plan, currency) : null;
|
|
398
|
+
const formattedPrice = currency && selectedPrice !== null ? formatPrice(selectedPrice, currency.toUpperCase(), props.currencies) : formatPrice(plan.price, plan.currency, props.currencies);
|
|
399
|
+
const interval = formatInterval(plan.duration, props.billingIntervals);
|
|
400
|
+
const features = metadata.features && metadata.features.length > 0 ? metadata.features : extractDisplayFeatures(
|
|
401
|
+
plan.features,
|
|
402
|
+
plan.name,
|
|
403
|
+
props.fallbackFeatures
|
|
404
|
+
);
|
|
405
|
+
const contactUrl = props.contactUrl || "/contact";
|
|
406
|
+
const ctaLink = metadata.ctaType === "contact" ? contactUrl : props.appLoginUrl;
|
|
407
|
+
const isQuoteBased = metadata.ctaType === "contact" && plan.price === 0;
|
|
408
|
+
return {
|
|
409
|
+
id: plan.id,
|
|
410
|
+
name: metadata.displayName,
|
|
411
|
+
description: metadata.defaultDescription,
|
|
412
|
+
price: isQuoteBased ? "Custom" : formattedPrice,
|
|
413
|
+
priceRaw: plan.price,
|
|
414
|
+
interval: isQuoteBased ? "" : interval,
|
|
415
|
+
duration: plan.duration,
|
|
416
|
+
features,
|
|
417
|
+
popular: metadata.popular,
|
|
418
|
+
ctaText: metadata.ctaText,
|
|
419
|
+
ctaLink,
|
|
420
|
+
tier: metadata.tier
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function PricingSection(props) {
|
|
424
|
+
const {
|
|
425
|
+
sectionHeading = "Pricing Plans",
|
|
426
|
+
sectionSubtitle = "Choose the perfect plan for your needs",
|
|
427
|
+
id,
|
|
428
|
+
className = ""
|
|
429
|
+
} = props;
|
|
430
|
+
const client = useWebSDK();
|
|
431
|
+
const config = useWebSDKConfig();
|
|
432
|
+
const { product: contextProduct } = useProduct();
|
|
433
|
+
const requestedProductId = (props.productId || config.productId || "").trim();
|
|
434
|
+
const contextKey = resolvePricingProductKey(requestedProductId, [
|
|
435
|
+
contextProduct
|
|
436
|
+
]);
|
|
437
|
+
const productKey = contextKey ?? requestedProductId;
|
|
438
|
+
const [catalogPlans, setCatalogPlans] = useState([]);
|
|
439
|
+
const [loading, setLoading] = useState(true);
|
|
440
|
+
const [error, setError] = useState(null);
|
|
441
|
+
const [billingCycle, setBillingCycle] = useState(
|
|
442
|
+
"monthly"
|
|
443
|
+
);
|
|
444
|
+
const [audience, setAudience] = useState(
|
|
445
|
+
"individual"
|
|
446
|
+
);
|
|
447
|
+
const [selectedCurrency, setSelectedCurrency] = useState(
|
|
448
|
+
props.defaultCurrency ? props.defaultCurrency.toUpperCase() : null
|
|
449
|
+
);
|
|
450
|
+
useEffect(() => {
|
|
451
|
+
let cancelled = false;
|
|
452
|
+
async function resolveKey() {
|
|
453
|
+
if (!productKey) {
|
|
454
|
+
throw new Error(
|
|
455
|
+
"PricingPage needs a product slug: pass productId or set WebSDKConfig.productId."
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
if (!isUuidLike(productKey)) return productKey;
|
|
459
|
+
const response = await client.query(
|
|
460
|
+
PUBLIC_PRODUCT_KEYS_QUERY
|
|
461
|
+
);
|
|
462
|
+
if (response.errors && response.errors.length > 0) {
|
|
463
|
+
throw new Error(response.errors[0].message);
|
|
464
|
+
}
|
|
465
|
+
const resolved = resolvePricingProductKey(
|
|
466
|
+
productKey,
|
|
467
|
+
response.data?.publicProducts?.items ?? []
|
|
468
|
+
);
|
|
469
|
+
if (!resolved) throw new PricingProductKeyError(productKey);
|
|
470
|
+
return resolved;
|
|
471
|
+
}
|
|
472
|
+
async function loadPlans() {
|
|
473
|
+
try {
|
|
474
|
+
setLoading(true);
|
|
475
|
+
const key = await resolveKey();
|
|
476
|
+
if (cancelled) return;
|
|
477
|
+
const response = await client.query(GET_PLANS_QUERY, {
|
|
478
|
+
productId: key
|
|
479
|
+
});
|
|
480
|
+
if (cancelled) return;
|
|
481
|
+
if (response.errors && response.errors.length > 0) {
|
|
482
|
+
throw new Error(response.errors[0].message);
|
|
483
|
+
}
|
|
484
|
+
if (!response.data?.publicPlans) {
|
|
485
|
+
throw new Error("No plans data received");
|
|
486
|
+
}
|
|
487
|
+
const active = response.data.publicPlans.filter(
|
|
488
|
+
(plan) => plan.isActive
|
|
489
|
+
);
|
|
490
|
+
if (active.length === 0) {
|
|
491
|
+
throw new Error(
|
|
492
|
+
`publicPlans returned no active plans for product "${key}".`
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
setCatalogPlans(active);
|
|
496
|
+
setError(null);
|
|
497
|
+
} catch (err) {
|
|
498
|
+
if (cancelled) return;
|
|
499
|
+
console.error("Failed to load plans:", err);
|
|
500
|
+
setCatalogPlans([]);
|
|
501
|
+
setError("Unable to load pricing information. Please try again later.");
|
|
502
|
+
} finally {
|
|
503
|
+
if (!cancelled) {
|
|
504
|
+
setLoading(false);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
loadPlans();
|
|
509
|
+
return () => {
|
|
510
|
+
cancelled = true;
|
|
511
|
+
};
|
|
512
|
+
}, [client, productKey]);
|
|
513
|
+
const currencyOptions = useMemo(
|
|
514
|
+
() => availablePlanCurrencies(catalogPlans),
|
|
515
|
+
[catalogPlans]
|
|
516
|
+
);
|
|
517
|
+
useEffect(() => {
|
|
518
|
+
if (selectedCurrency || currencyOptions.length < 2) return;
|
|
519
|
+
const stored = readStoredCurrency()?.toUpperCase();
|
|
520
|
+
if (stored && currencyOptions.includes(stored)) {
|
|
521
|
+
setSelectedCurrency(stored);
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
const regional = detectRegionalCurrency(
|
|
525
|
+
currencyOptions,
|
|
526
|
+
readVisitorLocale()
|
|
527
|
+
);
|
|
528
|
+
if (regional) setSelectedCurrency(regional);
|
|
529
|
+
}, [currencyOptions, selectedCurrency]);
|
|
530
|
+
const activeCurrency = selectedCurrency && currencyOptions.includes(selectedCurrency) ? selectedCurrency : currencyOptions[0] ?? null;
|
|
531
|
+
const allPlans = catalogPlans.map((plan) => transformToDisplayCard(plan, props, activeCurrency)).sort((a, b) => {
|
|
532
|
+
const aCustom = a.price === "Custom" ? 1 : 0;
|
|
533
|
+
const bCustom = b.price === "Custom" ? 1 : 0;
|
|
534
|
+
return aCustom - bCustom || a.priceRaw - b.priceRaw;
|
|
535
|
+
});
|
|
536
|
+
const showCurrencySelector = props.showCurrencySelector !== false && currencyOptions.length > 1;
|
|
537
|
+
const {
|
|
538
|
+
individualPlans: individualAllPlans,
|
|
539
|
+
enterprisePlans: enterpriseApiPlans
|
|
540
|
+
} = splitPlansByAudience(allPlans, props.showAudienceTabs);
|
|
541
|
+
const individualPlans = plansForBillingCycle(
|
|
542
|
+
individualAllPlans,
|
|
543
|
+
billingCycle
|
|
544
|
+
);
|
|
545
|
+
const enterpriseCards = enterpriseApiPlans.map((p) => {
|
|
546
|
+
if (p.priceRaw === 0 && p.name.toLowerCase().includes("enterprise")) {
|
|
547
|
+
return {
|
|
548
|
+
...p,
|
|
549
|
+
price: "Custom",
|
|
550
|
+
interval: "",
|
|
551
|
+
ctaText: "Contact Sales",
|
|
552
|
+
ctaLink: props.contactUrl || "/contact"
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
return p;
|
|
556
|
+
});
|
|
557
|
+
const defaultEnterpriseCard = {
|
|
558
|
+
name: "Enterprise",
|
|
559
|
+
subtitle: "For organizations that need more",
|
|
560
|
+
description: "For organizations that need more",
|
|
561
|
+
price: "Custom",
|
|
562
|
+
period: "",
|
|
563
|
+
interval: "",
|
|
564
|
+
button: "Contact Sales",
|
|
565
|
+
buttonLink: props.contactUrl || "/contact",
|
|
566
|
+
ctaText: "Contact Sales",
|
|
567
|
+
ctaLink: props.contactUrl || "/contact",
|
|
568
|
+
popular: false,
|
|
569
|
+
features: props.fallbackFeatures?.enterprise || [
|
|
570
|
+
"Unlimited everything",
|
|
571
|
+
"SSO & SAML",
|
|
572
|
+
"Audit logs",
|
|
573
|
+
"Dedicated support",
|
|
574
|
+
"Self-hosted option"
|
|
575
|
+
]
|
|
576
|
+
};
|
|
577
|
+
const resolvedEnterprisePlans = resolveEnterprisePlans(
|
|
578
|
+
enterpriseCards,
|
|
579
|
+
props.enterprisePlans,
|
|
580
|
+
defaultEnterpriseCard
|
|
581
|
+
);
|
|
582
|
+
const plans = props.showAudienceTabs && audience === "enterprise" ? [] : individualPlans;
|
|
583
|
+
if (loading) {
|
|
584
|
+
return /* @__PURE__ */ jsx("section", { id, className: `py-12 sm:py-16 md:py-20 ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 sm:px-6", children: [
|
|
585
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-8 sm:mb-12", children: [
|
|
586
|
+
sectionHeading ? /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4", children: sectionHeading }) : (
|
|
587
|
+
// Visually hidden but DOM-present heading so axe's heading-order
|
|
588
|
+
// rule still sees an h2 between the consumer's hero h1 and the
|
|
589
|
+
// h3 plan-card titles. See `getMetadataForPlan` for why a falsy
|
|
590
|
+
// sectionHeading is the canonical "no visible heading" signal.
|
|
591
|
+
/* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Pricing" })
|
|
592
|
+
),
|
|
593
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm sm:text-base md:text-lg", children: "Loading pricing information..." })
|
|
594
|
+
] }),
|
|
595
|
+
/* @__PURE__ */ jsx("div", { className: "grid md:grid-cols-3 gap-6 sm:gap-8", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs(
|
|
596
|
+
"div",
|
|
597
|
+
{
|
|
598
|
+
className: "bg-card border rounded-lg p-6 animate-pulse",
|
|
599
|
+
children: [
|
|
600
|
+
/* @__PURE__ */ jsx("div", { className: "h-6 bg-muted rounded w-1/2 mb-4" }),
|
|
601
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-3/4 mb-6" }),
|
|
602
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-muted rounded w-1/3 mb-6" }),
|
|
603
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-3 mb-6", children: [1, 2, 3, 4].map((j) => /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded" }, j)) }),
|
|
604
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-muted rounded" })
|
|
605
|
+
]
|
|
606
|
+
},
|
|
607
|
+
i
|
|
608
|
+
)) })
|
|
609
|
+
] }) });
|
|
610
|
+
}
|
|
611
|
+
if (error && plans.length === 0) {
|
|
612
|
+
return /* @__PURE__ */ jsx("section", { id, className: `py-12 sm:py-16 md:py-20 ${className}`, children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 sm:px-6", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
613
|
+
sectionHeading ? /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl md:text-4xl font-bold mb-4", children: sectionHeading }) : /* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Pricing" }),
|
|
614
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-8", children: error }),
|
|
615
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => window.location.reload(), children: "Retry" })
|
|
616
|
+
] }) }) });
|
|
617
|
+
}
|
|
618
|
+
return /* @__PURE__ */ jsx("section", { id, className: `py-12 sm:py-16 md:py-20 ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 sm:px-6", children: [
|
|
619
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-8 sm:mb-12", children: [
|
|
620
|
+
sectionHeading ? /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl md:text-4xl font-bold mb-3 sm:mb-4", children: sectionHeading }) : /* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Pricing" }),
|
|
621
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm sm:text-base md:text-lg mb-6", children: sectionSubtitle }),
|
|
622
|
+
props.showAudienceTabs && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center bg-muted p-1.5 rounded-xl", children: [
|
|
623
|
+
/* @__PURE__ */ jsx(
|
|
624
|
+
"button",
|
|
625
|
+
{
|
|
626
|
+
type: "button",
|
|
627
|
+
onClick: () => setAudience("individual"),
|
|
628
|
+
className: `px-6 sm:px-8 py-2.5 rounded-lg text-sm font-semibold transition-all ${audience === "individual" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
629
|
+
children: "Individual"
|
|
630
|
+
}
|
|
631
|
+
),
|
|
632
|
+
/* @__PURE__ */ jsx(
|
|
633
|
+
"button",
|
|
634
|
+
{
|
|
635
|
+
type: "button",
|
|
636
|
+
onClick: () => setAudience("enterprise"),
|
|
637
|
+
className: `px-6 sm:px-8 py-2.5 rounded-lg text-sm font-semibold transition-all ${audience === "enterprise" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
638
|
+
children: "Enterprise"
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
] }) }),
|
|
642
|
+
(audience === "individual" || !props.showAudienceTabs) && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center bg-muted/60 p-1.5 rounded-xl", children: [
|
|
643
|
+
/* @__PURE__ */ jsx(
|
|
644
|
+
"button",
|
|
645
|
+
{
|
|
646
|
+
type: "button",
|
|
647
|
+
onClick: () => setBillingCycle("monthly"),
|
|
648
|
+
className: `px-5 sm:px-6 py-2 rounded-lg text-sm font-medium transition-all ${billingCycle === "monthly" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
649
|
+
children: "Monthly"
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
/* @__PURE__ */ jsx(
|
|
653
|
+
"button",
|
|
654
|
+
{
|
|
655
|
+
type: "button",
|
|
656
|
+
onClick: () => setBillingCycle("yearly"),
|
|
657
|
+
className: `px-5 sm:px-6 py-2 rounded-lg text-sm font-medium transition-all ${billingCycle === "yearly" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
658
|
+
children: "Yearly"
|
|
659
|
+
}
|
|
660
|
+
)
|
|
661
|
+
] }) }),
|
|
662
|
+
showCurrencySelector && /* @__PURE__ */ jsx("div", { className: "flex justify-center mt-4", children: /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
663
|
+
/* @__PURE__ */ jsx("span", { children: "Currency" }),
|
|
664
|
+
/* @__PURE__ */ jsx(
|
|
665
|
+
"select",
|
|
666
|
+
{
|
|
667
|
+
value: activeCurrency ?? "",
|
|
668
|
+
onChange: (event) => {
|
|
669
|
+
const code = event.target.value;
|
|
670
|
+
setSelectedCurrency(code);
|
|
671
|
+
storeCurrency(code);
|
|
672
|
+
},
|
|
673
|
+
className: "h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
|
|
674
|
+
"data-testid": "pricing-currency-select",
|
|
675
|
+
children: currencyOptions.map((code) => /* @__PURE__ */ jsx("option", { value: code, children: code }, code))
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
] }) })
|
|
679
|
+
] }),
|
|
680
|
+
props.showAudienceTabs && audience === "enterprise" && /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-3xl text-center mb-8", children: [
|
|
681
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xl sm:text-2xl font-bold text-foreground", children: props.enterpriseHeading || "Enterprise Solutions" }),
|
|
682
|
+
/* @__PURE__ */ jsx("p", { className: "mt-3 text-muted-foreground", children: props.enterpriseSubtitle || "Built for teams, agencies, and organizations that need advanced collaboration, security, support, and scale." })
|
|
683
|
+
] }),
|
|
684
|
+
/* @__PURE__ */ jsx("div", { className: "grid md:grid-cols-3 gap-6 sm:gap-8 max-w-6xl mx-auto items-stretch", children: props.showAudienceTabs && audience === "enterprise" ? (
|
|
685
|
+
/* Enterprise cards — from API, static prop, or built-in default */
|
|
686
|
+
resolvedEnterprisePlans.map((ep) => {
|
|
687
|
+
const subtitle = ep.subtitle || ep.description || "";
|
|
688
|
+
const btnText = ep.button || ep.ctaText || "Get Started";
|
|
689
|
+
const btnLink = ep.buttonLink || ep.ctaLink || props.appLoginUrl;
|
|
690
|
+
const period = ep.period || ep.interval || "";
|
|
691
|
+
const note = ep.note || "";
|
|
692
|
+
const badge = ep.badge || "";
|
|
693
|
+
const isPopular = ep.popular;
|
|
694
|
+
const features = ep.features || [];
|
|
695
|
+
const price = String(ep.price);
|
|
696
|
+
return /* @__PURE__ */ jsxs(
|
|
697
|
+
"div",
|
|
698
|
+
{
|
|
699
|
+
className: `bg-card rounded-xl p-6 sm:p-8 transition-all duration-300 flex flex-col ${isPopular ? "border-2 border-primary shadow-xl ring-1 ring-primary/20" : "border hover:shadow-lg hover:border-primary/50"}`,
|
|
700
|
+
children: [
|
|
701
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-6", children: [
|
|
702
|
+
isPopular && badge && /* @__PURE__ */ jsx("span", { className: "inline-block bg-primary text-primary-foreground px-4 py-1 rounded-full text-xs font-semibold mb-3", children: badge }),
|
|
703
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xl sm:text-2xl font-bold mb-2", children: ep.name }),
|
|
704
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: subtitle })
|
|
705
|
+
] }),
|
|
706
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-2", children: [
|
|
707
|
+
price === "Custom" ? /* @__PURE__ */ jsx("p", { className: "text-3xl sm:text-4xl font-bold", children: "Custom" }) : /* @__PURE__ */ jsxs("p", { className: "flex items-baseline justify-center gap-1", children: [
|
|
708
|
+
/* @__PURE__ */ jsx("span", { className: "text-4xl sm:text-5xl font-extrabold", children: price }),
|
|
709
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-lg", children: period })
|
|
710
|
+
] }),
|
|
711
|
+
note && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm font-medium text-primary", children: note })
|
|
712
|
+
] }),
|
|
713
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-3 mb-8 mt-6 flex-1", children: features.map((feature) => /* @__PURE__ */ jsxs(
|
|
714
|
+
"li",
|
|
715
|
+
{
|
|
716
|
+
className: "text-sm flex items-start gap-2",
|
|
717
|
+
children: [
|
|
718
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary mt-0.5 flex-shrink-0", children: "\u2713" }),
|
|
719
|
+
/* @__PURE__ */ jsx("span", { children: feature })
|
|
720
|
+
]
|
|
721
|
+
},
|
|
722
|
+
feature
|
|
723
|
+
)) }),
|
|
724
|
+
btnLink.startsWith("/") ? /* @__PURE__ */ jsx(
|
|
725
|
+
Button,
|
|
726
|
+
{
|
|
727
|
+
className: "w-full h-11",
|
|
728
|
+
variant: isPopular ? "default" : "outline",
|
|
729
|
+
size: "lg",
|
|
730
|
+
asChild: true,
|
|
731
|
+
children: /* @__PURE__ */ jsx(
|
|
732
|
+
"a",
|
|
733
|
+
{
|
|
734
|
+
href: btnLink,
|
|
735
|
+
onClick: () => window.scrollTo({ top: 0, behavior: "smooth" }),
|
|
736
|
+
children: btnText
|
|
737
|
+
}
|
|
738
|
+
)
|
|
739
|
+
}
|
|
740
|
+
) : /* @__PURE__ */ jsx(
|
|
741
|
+
Button,
|
|
742
|
+
{
|
|
743
|
+
className: "w-full h-11",
|
|
744
|
+
variant: isPopular ? "default" : "outline",
|
|
745
|
+
size: "lg",
|
|
746
|
+
asChild: true,
|
|
747
|
+
children: /* @__PURE__ */ jsx(
|
|
748
|
+
"a",
|
|
749
|
+
{
|
|
750
|
+
href: btnLink,
|
|
751
|
+
target: "_blank",
|
|
752
|
+
rel: "noopener noreferrer",
|
|
753
|
+
children: btnText
|
|
754
|
+
}
|
|
755
|
+
)
|
|
756
|
+
}
|
|
757
|
+
)
|
|
758
|
+
]
|
|
759
|
+
},
|
|
760
|
+
ep.name
|
|
761
|
+
);
|
|
762
|
+
})
|
|
763
|
+
) : (
|
|
764
|
+
/* Individual API-fetched cards */
|
|
765
|
+
plans.map((plan) => /* @__PURE__ */ jsxs(
|
|
766
|
+
"div",
|
|
767
|
+
{
|
|
768
|
+
className: `bg-card rounded-xl p-6 sm:p-8 transition-all duration-300 flex flex-col ${plan.popular ? "border-2 border-primary shadow-xl ring-1 ring-primary/20" : "border hover:shadow-lg hover:border-primary/50"}`,
|
|
769
|
+
children: [
|
|
770
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-6", children: [
|
|
771
|
+
plan.popular && /* @__PURE__ */ jsx("span", { className: "inline-block bg-primary text-primary-foreground px-4 py-1 rounded-full text-xs font-semibold mb-3", children: "Most Popular" }),
|
|
772
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xl sm:text-2xl font-bold mb-2", children: plan.name }),
|
|
773
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: plan.description })
|
|
774
|
+
] }),
|
|
775
|
+
/* @__PURE__ */ jsx("div", { className: "text-center mb-8", children: plan.price === "Custom" ? /* @__PURE__ */ jsx("p", { className: "text-3xl sm:text-4xl font-bold", children: "Custom" }) : /* @__PURE__ */ jsxs("p", { className: "flex items-baseline justify-center gap-1", children: [
|
|
776
|
+
/* @__PURE__ */ jsx("span", { className: "text-4xl sm:text-5xl font-bold", children: plan.price }),
|
|
777
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-lg", children: plan.interval })
|
|
778
|
+
] }) }),
|
|
779
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-3 mb-8 flex-1", children: plan.features.map((feature, index) => /* @__PURE__ */ jsxs(
|
|
780
|
+
"li",
|
|
781
|
+
{
|
|
782
|
+
className: "text-sm flex items-start gap-2",
|
|
783
|
+
children: [
|
|
784
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary mt-0.5 flex-shrink-0", children: "\u2713" }),
|
|
785
|
+
/* @__PURE__ */ jsx("span", { children: feature })
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
index
|
|
789
|
+
)) }),
|
|
790
|
+
plan.ctaLink.startsWith("/") ? /* @__PURE__ */ jsx(
|
|
791
|
+
Button,
|
|
792
|
+
{
|
|
793
|
+
className: "w-full h-11",
|
|
794
|
+
variant: plan.popular ? "default" : "outline",
|
|
795
|
+
size: "lg",
|
|
796
|
+
asChild: true,
|
|
797
|
+
children: /* @__PURE__ */ jsx(
|
|
798
|
+
"a",
|
|
799
|
+
{
|
|
800
|
+
href: plan.ctaLink,
|
|
801
|
+
onClick: () => window.scrollTo({ top: 0, behavior: "smooth" }),
|
|
802
|
+
children: plan.ctaText
|
|
803
|
+
}
|
|
804
|
+
)
|
|
805
|
+
}
|
|
806
|
+
) : /* @__PURE__ */ jsx(
|
|
807
|
+
Button,
|
|
808
|
+
{
|
|
809
|
+
className: "w-full h-11",
|
|
810
|
+
variant: plan.popular ? "default" : "outline",
|
|
811
|
+
size: "lg",
|
|
812
|
+
asChild: true,
|
|
813
|
+
children: /* @__PURE__ */ jsx(
|
|
814
|
+
"a",
|
|
815
|
+
{
|
|
816
|
+
href: plan.ctaLink,
|
|
817
|
+
target: "_blank",
|
|
818
|
+
rel: "noopener noreferrer",
|
|
819
|
+
children: plan.ctaText
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
]
|
|
825
|
+
},
|
|
826
|
+
plan.id
|
|
827
|
+
))
|
|
828
|
+
) })
|
|
829
|
+
] }) });
|
|
830
|
+
}
|
|
831
|
+
function PricingPage(props) {
|
|
832
|
+
const {
|
|
833
|
+
productName,
|
|
834
|
+
heroHeading = "Simple, Transparent Pricing",
|
|
835
|
+
heroSubtitle = "Choose the plan that's right for you. No hidden fees, no surprises.",
|
|
836
|
+
seoTitle,
|
|
837
|
+
seoDescription,
|
|
838
|
+
seoKeywords,
|
|
839
|
+
seoImage,
|
|
840
|
+
seoUrl
|
|
841
|
+
} = props;
|
|
842
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
843
|
+
seoTitle && /* @__PURE__ */ jsx(
|
|
844
|
+
PageHead,
|
|
845
|
+
{
|
|
846
|
+
title: seoTitle,
|
|
847
|
+
description: seoDescription || heroSubtitle,
|
|
848
|
+
productName,
|
|
849
|
+
keywords: seoKeywords,
|
|
850
|
+
image: seoImage,
|
|
851
|
+
url: seoUrl
|
|
852
|
+
}
|
|
853
|
+
),
|
|
854
|
+
/* @__PURE__ */ jsx("section", { className: "bg-gradient-to-b from-background to-muted/20 py-12 sm:py-16 md:py-20 lg:py-24", children: /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "text-center max-w-3xl mx-auto", children: [
|
|
855
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl sm:text-4xl md:text-5xl font-bold mb-4 sm:mb-6", children: heroHeading }),
|
|
856
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg sm:text-xl text-muted-foreground leading-relaxed", children: heroSubtitle })
|
|
857
|
+
] }) }) }),
|
|
858
|
+
/* @__PURE__ */ jsx(PricingSection, { ...props })
|
|
859
|
+
] });
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
export { PricingPage, PricingProductKeyError, PricingSection, availablePlanCurrencies, cleanPlanDisplayName, isUuidLike, planPriceIn, resolveEnterprisePlans, resolvePricingProductKey, splitPlansByAudience, transformFeatureToLabel };
|
|
863
|
+
//# sourceMappingURL=chunk-TGYQHO2E.mjs.map
|
|
864
|
+
//# sourceMappingURL=chunk-TGYQHO2E.mjs.map
|