@schematichq/schematic-components 0.7.1 → 0.7.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/dist/schematic-components.cjs.js +873 -686
- package/dist/schematic-components.d.ts +309 -69
- package/dist/schematic-components.esm.js +762 -575
- package/package.json +1 -1
|
@@ -30,28 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// node_modules/void-elements/index.js
|
|
34
|
-
var require_void_elements = __commonJS({
|
|
35
|
-
"node_modules/void-elements/index.js"(exports, module2) {
|
|
36
|
-
module2.exports = {
|
|
37
|
-
"area": true,
|
|
38
|
-
"base": true,
|
|
39
|
-
"br": true,
|
|
40
|
-
"col": true,
|
|
41
|
-
"embed": true,
|
|
42
|
-
"hr": true,
|
|
43
|
-
"img": true,
|
|
44
|
-
"input": true,
|
|
45
|
-
"link": true,
|
|
46
|
-
"meta": true,
|
|
47
|
-
"param": true,
|
|
48
|
-
"source": true,
|
|
49
|
-
"track": true,
|
|
50
|
-
"wbr": true
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
33
|
// node_modules/shallowequal/index.js
|
|
56
34
|
var require_shallowequal = __commonJS({
|
|
57
35
|
"node_modules/shallowequal/index.js"(exports, module2) {
|
|
@@ -1664,6 +1642,28 @@ var require_merge = __commonJS({
|
|
|
1664
1642
|
}
|
|
1665
1643
|
});
|
|
1666
1644
|
|
|
1645
|
+
// node_modules/void-elements/index.js
|
|
1646
|
+
var require_void_elements = __commonJS({
|
|
1647
|
+
"node_modules/void-elements/index.js"(exports, module2) {
|
|
1648
|
+
module2.exports = {
|
|
1649
|
+
"area": true,
|
|
1650
|
+
"base": true,
|
|
1651
|
+
"br": true,
|
|
1652
|
+
"col": true,
|
|
1653
|
+
"embed": true,
|
|
1654
|
+
"hr": true,
|
|
1655
|
+
"img": true,
|
|
1656
|
+
"input": true,
|
|
1657
|
+
"link": true,
|
|
1658
|
+
"meta": true,
|
|
1659
|
+
"param": true,
|
|
1660
|
+
"source": true,
|
|
1661
|
+
"track": true,
|
|
1662
|
+
"wbr": true
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
1667
|
// node_modules/pluralize/pluralize.js
|
|
1668
1668
|
var require_pluralize = __commonJS({
|
|
1669
1669
|
"node_modules/pluralize/pluralize.js"(exports, module2) {
|
|
@@ -2257,6 +2257,7 @@ var index_exports = {};
|
|
|
2257
2257
|
__export(index_exports, {
|
|
2258
2258
|
Box: () => Box,
|
|
2259
2259
|
Button: () => Button2,
|
|
2260
|
+
ButtonElement: () => ButtonElement,
|
|
2260
2261
|
Card: () => Card,
|
|
2261
2262
|
Column: () => Column,
|
|
2262
2263
|
Container: () => Container2,
|
|
@@ -2285,6 +2286,7 @@ __export(index_exports, {
|
|
|
2285
2286
|
SchematicEmbed: () => SchematicEmbed,
|
|
2286
2287
|
StyledCard: () => StyledCard,
|
|
2287
2288
|
Text: () => Text,
|
|
2289
|
+
TextElement: () => TextElement,
|
|
2288
2290
|
TextPropNames: () => TextPropNames,
|
|
2289
2291
|
Tooltip: () => Tooltip,
|
|
2290
2292
|
UnsubscribeButton: () => UnsubscribeButton,
|
|
@@ -2303,280 +2305,11 @@ __export(index_exports, {
|
|
|
2303
2305
|
});
|
|
2304
2306
|
module.exports = __toCommonJS(index_exports);
|
|
2305
2307
|
|
|
2306
|
-
// src/components/elements/
|
|
2307
|
-
var
|
|
2308
|
-
|
|
2309
|
-
// node_modules/react-i18next/dist/es/Trans.js
|
|
2310
|
-
var import_react3 = require("react");
|
|
2311
|
-
|
|
2312
|
-
// node_modules/react-i18next/dist/es/TransWithoutContext.js
|
|
2313
|
-
var import_react = require("react");
|
|
2314
|
-
|
|
2315
|
-
// node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
|
|
2316
|
-
var import_void_elements = __toESM(require_void_elements());
|
|
2317
|
-
|
|
2318
|
-
// node_modules/react-i18next/dist/es/utils.js
|
|
2319
|
-
var warn = (i18n, code, msg, rest) => {
|
|
2320
|
-
const args = [msg, {
|
|
2321
|
-
code,
|
|
2322
|
-
...rest || {}
|
|
2323
|
-
}];
|
|
2324
|
-
if (i18n?.services?.logger?.forward) {
|
|
2325
|
-
return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
|
|
2326
|
-
}
|
|
2327
|
-
if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
|
|
2328
|
-
if (i18n?.services?.logger?.warn) {
|
|
2329
|
-
i18n.services.logger.warn(...args);
|
|
2330
|
-
} else if (console?.warn) {
|
|
2331
|
-
console.warn(...args);
|
|
2332
|
-
}
|
|
2333
|
-
};
|
|
2334
|
-
var alreadyWarned = {};
|
|
2335
|
-
var warnOnce = (i18n, code, msg, rest) => {
|
|
2336
|
-
if (isString(msg) && alreadyWarned[msg]) return;
|
|
2337
|
-
if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
|
|
2338
|
-
warn(i18n, code, msg, rest);
|
|
2339
|
-
};
|
|
2340
|
-
var loadedClb = (i18n, cb) => () => {
|
|
2341
|
-
if (i18n.isInitialized) {
|
|
2342
|
-
cb();
|
|
2343
|
-
} else {
|
|
2344
|
-
const initialized = () => {
|
|
2345
|
-
setTimeout(() => {
|
|
2346
|
-
i18n.off("initialized", initialized);
|
|
2347
|
-
}, 0);
|
|
2348
|
-
cb();
|
|
2349
|
-
};
|
|
2350
|
-
i18n.on("initialized", initialized);
|
|
2351
|
-
}
|
|
2352
|
-
};
|
|
2353
|
-
var loadNamespaces = (i18n, ns, cb) => {
|
|
2354
|
-
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
2355
|
-
};
|
|
2356
|
-
var loadLanguages = (i18n, lng, ns, cb) => {
|
|
2357
|
-
if (isString(ns)) ns = [ns];
|
|
2358
|
-
if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
|
|
2359
|
-
ns.forEach((n) => {
|
|
2360
|
-
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
2361
|
-
});
|
|
2362
|
-
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
2363
|
-
};
|
|
2364
|
-
var hasLoadedNamespace = (ns, i18n, options = {}) => {
|
|
2365
|
-
if (!i18n.languages || !i18n.languages.length) {
|
|
2366
|
-
warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
2367
|
-
languages: i18n.languages
|
|
2368
|
-
});
|
|
2369
|
-
return true;
|
|
2370
|
-
}
|
|
2371
|
-
return i18n.hasLoadedNamespace(ns, {
|
|
2372
|
-
lng: options.lng,
|
|
2373
|
-
precheck: (i18nInstance2, loadNotPending) => {
|
|
2374
|
-
if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
|
|
2375
|
-
}
|
|
2376
|
-
});
|
|
2377
|
-
};
|
|
2378
|
-
var isString = (obj) => typeof obj === "string";
|
|
2379
|
-
var isObject = (obj) => typeof obj === "object" && obj !== null;
|
|
2380
|
-
|
|
2381
|
-
// node_modules/react-i18next/dist/es/unescape.js
|
|
2382
|
-
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
2383
|
-
var htmlEntities = {
|
|
2384
|
-
"&": "&",
|
|
2385
|
-
"&": "&",
|
|
2386
|
-
"<": "<",
|
|
2387
|
-
"<": "<",
|
|
2388
|
-
">": ">",
|
|
2389
|
-
">": ">",
|
|
2390
|
-
"'": "'",
|
|
2391
|
-
"'": "'",
|
|
2392
|
-
""": '"',
|
|
2393
|
-
""": '"',
|
|
2394
|
-
" ": " ",
|
|
2395
|
-
" ": " ",
|
|
2396
|
-
"©": "\xA9",
|
|
2397
|
-
"©": "\xA9",
|
|
2398
|
-
"®": "\xAE",
|
|
2399
|
-
"®": "\xAE",
|
|
2400
|
-
"…": "\u2026",
|
|
2401
|
-
"…": "\u2026",
|
|
2402
|
-
"/": "/",
|
|
2403
|
-
"/": "/"
|
|
2404
|
-
};
|
|
2405
|
-
var unescapeHtmlEntity = (m2) => htmlEntities[m2];
|
|
2406
|
-
var unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
2407
|
-
|
|
2408
|
-
// node_modules/react-i18next/dist/es/defaults.js
|
|
2409
|
-
var defaultOptions = {
|
|
2410
|
-
bindI18n: "languageChanged",
|
|
2411
|
-
bindI18nStore: "",
|
|
2412
|
-
transEmptyNodeValue: "",
|
|
2413
|
-
transSupportBasicHtmlNodes: true,
|
|
2414
|
-
transWrapTextNodes: "",
|
|
2415
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
2416
|
-
useSuspense: true,
|
|
2417
|
-
unescape
|
|
2418
|
-
};
|
|
2419
|
-
var setDefaults = (options = {}) => {
|
|
2420
|
-
defaultOptions = {
|
|
2421
|
-
...defaultOptions,
|
|
2422
|
-
...options
|
|
2423
|
-
};
|
|
2424
|
-
};
|
|
2425
|
-
var getDefaults = () => defaultOptions;
|
|
2426
|
-
|
|
2427
|
-
// node_modules/react-i18next/dist/es/i18nInstance.js
|
|
2428
|
-
var i18nInstance;
|
|
2429
|
-
var setI18n = (instance2) => {
|
|
2430
|
-
i18nInstance = instance2;
|
|
2431
|
-
};
|
|
2432
|
-
var getI18n = () => i18nInstance;
|
|
2433
|
-
|
|
2434
|
-
// node_modules/react-i18next/dist/es/context.js
|
|
2435
|
-
var import_react2 = require("react");
|
|
2436
|
-
|
|
2437
|
-
// node_modules/react-i18next/dist/es/initReactI18next.js
|
|
2438
|
-
var initReactI18next = {
|
|
2439
|
-
type: "3rdParty",
|
|
2440
|
-
init(instance2) {
|
|
2441
|
-
setDefaults(instance2.options.react);
|
|
2442
|
-
setI18n(instance2);
|
|
2443
|
-
}
|
|
2444
|
-
};
|
|
2445
|
-
|
|
2446
|
-
// node_modules/react-i18next/dist/es/context.js
|
|
2447
|
-
var I18nContext = (0, import_react2.createContext)();
|
|
2448
|
-
var ReportNamespaces = class {
|
|
2449
|
-
constructor() {
|
|
2450
|
-
this.usedNamespaces = {};
|
|
2451
|
-
}
|
|
2452
|
-
addUsedNamespaces(namespaces) {
|
|
2453
|
-
namespaces.forEach((ns) => {
|
|
2454
|
-
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
2455
|
-
});
|
|
2456
|
-
}
|
|
2457
|
-
getUsedNamespaces() {
|
|
2458
|
-
return Object.keys(this.usedNamespaces);
|
|
2459
|
-
}
|
|
2460
|
-
};
|
|
2461
|
-
|
|
2462
|
-
// node_modules/react-i18next/dist/es/useTranslation.js
|
|
2463
|
-
var import_react4 = require("react");
|
|
2464
|
-
var usePrevious = (value, ignore) => {
|
|
2465
|
-
const ref = (0, import_react4.useRef)();
|
|
2466
|
-
(0, import_react4.useEffect)(() => {
|
|
2467
|
-
ref.current = ignore ? ref.current : value;
|
|
2468
|
-
}, [value, ignore]);
|
|
2469
|
-
return ref.current;
|
|
2470
|
-
};
|
|
2471
|
-
var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
2472
|
-
var useMemoizedT = (i18n, language, namespace, keyPrefix) => (0, import_react4.useCallback)(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
2473
|
-
var useTranslation = (ns, props = {}) => {
|
|
2474
|
-
const {
|
|
2475
|
-
i18n: i18nFromProps
|
|
2476
|
-
} = props;
|
|
2477
|
-
const {
|
|
2478
|
-
i18n: i18nFromContext,
|
|
2479
|
-
defaultNS: defaultNSFromContext
|
|
2480
|
-
} = (0, import_react4.useContext)(I18nContext) || {};
|
|
2481
|
-
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
2482
|
-
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
2483
|
-
if (!i18n) {
|
|
2484
|
-
warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
2485
|
-
const notReadyT = (k2, optsOrDefaultValue) => {
|
|
2486
|
-
if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
2487
|
-
if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
2488
|
-
return Array.isArray(k2) ? k2[k2.length - 1] : k2;
|
|
2489
|
-
};
|
|
2490
|
-
const retNotReady = [notReadyT, {}, false];
|
|
2491
|
-
retNotReady.t = notReadyT;
|
|
2492
|
-
retNotReady.i18n = {};
|
|
2493
|
-
retNotReady.ready = false;
|
|
2494
|
-
return retNotReady;
|
|
2495
|
-
}
|
|
2496
|
-
if (i18n.options.react?.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
2497
|
-
const i18nOptions = {
|
|
2498
|
-
...getDefaults(),
|
|
2499
|
-
...i18n.options.react,
|
|
2500
|
-
...props
|
|
2501
|
-
};
|
|
2502
|
-
const {
|
|
2503
|
-
useSuspense,
|
|
2504
|
-
keyPrefix
|
|
2505
|
-
} = i18nOptions;
|
|
2506
|
-
let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;
|
|
2507
|
-
namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
2508
|
-
i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
|
|
2509
|
-
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n, i18nOptions));
|
|
2510
|
-
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
2511
|
-
const getT = () => memoGetT;
|
|
2512
|
-
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
2513
|
-
const [t2, setT] = (0, import_react4.useState)(getT);
|
|
2514
|
-
let joinedNS = namespaces.join();
|
|
2515
|
-
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
2516
|
-
const previousJoinedNS = usePrevious(joinedNS);
|
|
2517
|
-
const isMounted = (0, import_react4.useRef)(true);
|
|
2518
|
-
(0, import_react4.useEffect)(() => {
|
|
2519
|
-
const {
|
|
2520
|
-
bindI18n,
|
|
2521
|
-
bindI18nStore
|
|
2522
|
-
} = i18nOptions;
|
|
2523
|
-
isMounted.current = true;
|
|
2524
|
-
if (!ready && !useSuspense) {
|
|
2525
|
-
if (props.lng) {
|
|
2526
|
-
loadLanguages(i18n, props.lng, namespaces, () => {
|
|
2527
|
-
if (isMounted.current) setT(getNewT);
|
|
2528
|
-
});
|
|
2529
|
-
} else {
|
|
2530
|
-
loadNamespaces(i18n, namespaces, () => {
|
|
2531
|
-
if (isMounted.current) setT(getNewT);
|
|
2532
|
-
});
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
2536
|
-
setT(getNewT);
|
|
2537
|
-
}
|
|
2538
|
-
const boundReset = () => {
|
|
2539
|
-
if (isMounted.current) setT(getNewT);
|
|
2540
|
-
};
|
|
2541
|
-
if (bindI18n) i18n?.on(bindI18n, boundReset);
|
|
2542
|
-
if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
|
|
2543
|
-
return () => {
|
|
2544
|
-
isMounted.current = false;
|
|
2545
|
-
if (i18n) bindI18n?.split(" ").forEach((e2) => i18n.off(e2, boundReset));
|
|
2546
|
-
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
|
|
2547
|
-
};
|
|
2548
|
-
}, [i18n, joinedNS]);
|
|
2549
|
-
(0, import_react4.useEffect)(() => {
|
|
2550
|
-
if (isMounted.current && ready) {
|
|
2551
|
-
setT(getT);
|
|
2552
|
-
}
|
|
2553
|
-
}, [i18n, keyPrefix, ready]);
|
|
2554
|
-
const ret = [t2, i18n, ready];
|
|
2555
|
-
ret.t = t2;
|
|
2556
|
-
ret.i18n = i18n;
|
|
2557
|
-
ret.ready = ready;
|
|
2558
|
-
if (ready) return ret;
|
|
2559
|
-
if (!ready && !useSuspense) return ret;
|
|
2560
|
-
throw new Promise((resolve) => {
|
|
2561
|
-
if (props.lng) {
|
|
2562
|
-
loadLanguages(i18n, props.lng, namespaces, () => resolve());
|
|
2563
|
-
} else {
|
|
2564
|
-
loadNamespaces(i18n, namespaces, () => resolve());
|
|
2565
|
-
}
|
|
2566
|
-
});
|
|
2567
|
-
};
|
|
2568
|
-
|
|
2569
|
-
// node_modules/react-i18next/dist/es/withTranslation.js
|
|
2570
|
-
var import_react5 = require("react");
|
|
2571
|
-
|
|
2572
|
-
// node_modules/react-i18next/dist/es/I18nextProvider.js
|
|
2573
|
-
var import_react6 = require("react");
|
|
2574
|
-
|
|
2575
|
-
// node_modules/react-i18next/dist/es/withSSR.js
|
|
2576
|
-
var import_react8 = require("react");
|
|
2308
|
+
// src/components/elements/button/Button.tsx
|
|
2309
|
+
var import_react31 = require("react");
|
|
2577
2310
|
|
|
2578
|
-
//
|
|
2579
|
-
var
|
|
2311
|
+
// src/components/layout/card/Card.tsx
|
|
2312
|
+
var import_react20 = require("react");
|
|
2580
2313
|
|
|
2581
2314
|
// node_modules/styled-components/node_modules/tslib/tslib.es6.mjs
|
|
2582
2315
|
var __assign = function() {
|
|
@@ -2618,7 +2351,7 @@ var isPropValid = /* @__PURE__ */ memoize(
|
|
|
2618
2351
|
);
|
|
2619
2352
|
|
|
2620
2353
|
// node_modules/styled-components/dist/styled-components.browser.esm.js
|
|
2621
|
-
var
|
|
2354
|
+
var import_react = __toESM(require("react"));
|
|
2622
2355
|
var import_shallowequal = __toESM(require_shallowequal());
|
|
2623
2356
|
|
|
2624
2357
|
// node_modules/stylis/src/Enum.js
|
|
@@ -3299,7 +3032,7 @@ var P = function(t2, n) {
|
|
|
3299
3032
|
console.error = function(t3) {
|
|
3300
3033
|
for (var n2 = [], o3 = 1; o3 < arguments.length; o3++) n2[o3 - 1] = arguments[o3];
|
|
3301
3034
|
E.test(t3) ? (a2 = false, N.delete(s2)) : i2.apply(void 0, __spreadArray([t3], n2, false));
|
|
3302
|
-
}, (0,
|
|
3035
|
+
}, (0, import_react.useRef)(), a2 && !N.has(s2) && (console.warn(s2), N.add(s2));
|
|
3303
3036
|
} catch (e2) {
|
|
3304
3037
|
E.test(e2.message) && N.delete(s2);
|
|
3305
3038
|
} finally {
|
|
@@ -3637,26 +3370,26 @@ function Fe(e2) {
|
|
|
3637
3370
|
}
|
|
3638
3371
|
var Me = new ke();
|
|
3639
3372
|
var ze = Fe();
|
|
3640
|
-
var $e =
|
|
3373
|
+
var $e = import_react.default.createContext({ shouldForwardProp: void 0, styleSheet: Me, stylis: ze });
|
|
3641
3374
|
var Be = $e.Consumer;
|
|
3642
|
-
var Le =
|
|
3375
|
+
var Le = import_react.default.createContext(void 0);
|
|
3643
3376
|
function Ge() {
|
|
3644
|
-
return (0,
|
|
3377
|
+
return (0, import_react.useContext)($e);
|
|
3645
3378
|
}
|
|
3646
3379
|
function Ye(e2) {
|
|
3647
|
-
var t2 = (0,
|
|
3380
|
+
var t2 = (0, import_react.useState)(e2.stylisPlugins), n = t2[0], r2 = t2[1], c2 = Ge().styleSheet, l2 = (0, import_react.useMemo)(function() {
|
|
3648
3381
|
var t3 = c2;
|
|
3649
3382
|
return e2.sheet ? t3 = e2.sheet : e2.target && (t3 = t3.reconstructWithOptions({ target: e2.target }, false)), e2.disableCSSOMInjection && (t3 = t3.reconstructWithOptions({ useCSSOMInjection: false })), t3;
|
|
3650
|
-
}, [e2.disableCSSOMInjection, e2.sheet, e2.target, c2]), u2 = (0,
|
|
3383
|
+
}, [e2.disableCSSOMInjection, e2.sheet, e2.target, c2]), u2 = (0, import_react.useMemo)(function() {
|
|
3651
3384
|
return Fe({ options: { namespace: e2.namespace, prefix: e2.enableVendorPrefixes }, plugins: n });
|
|
3652
3385
|
}, [e2.enableVendorPrefixes, e2.namespace, n]);
|
|
3653
|
-
(0,
|
|
3386
|
+
(0, import_react.useEffect)(function() {
|
|
3654
3387
|
(0, import_shallowequal.default)(n, e2.stylisPlugins) || r2(e2.stylisPlugins);
|
|
3655
3388
|
}, [e2.stylisPlugins]);
|
|
3656
|
-
var d = (0,
|
|
3389
|
+
var d = (0, import_react.useMemo)(function() {
|
|
3657
3390
|
return { shouldForwardProp: e2.shouldForwardProp, styleSheet: l2, stylis: u2 };
|
|
3658
3391
|
}, [e2.shouldForwardProp, l2, u2]);
|
|
3659
|
-
return
|
|
3392
|
+
return import_react.default.createElement($e.Provider, { value: d }, import_react.default.createElement(Le.Provider, { value: u2 }, e2.children));
|
|
3660
3393
|
}
|
|
3661
3394
|
var We = function() {
|
|
3662
3395
|
function e2(e3, t2) {
|
|
@@ -3748,15 +3481,15 @@ var Qe = function() {
|
|
|
3748
3481
|
return o2;
|
|
3749
3482
|
}, e2;
|
|
3750
3483
|
}();
|
|
3751
|
-
var et =
|
|
3484
|
+
var et = import_react.default.createContext(void 0);
|
|
3752
3485
|
var tt = et.Consumer;
|
|
3753
3486
|
function nt() {
|
|
3754
|
-
var e2 = (0,
|
|
3487
|
+
var e2 = (0, import_react.useContext)(et);
|
|
3755
3488
|
if (!e2) throw he(18);
|
|
3756
3489
|
return e2;
|
|
3757
3490
|
}
|
|
3758
3491
|
function ot(e2) {
|
|
3759
|
-
var n =
|
|
3492
|
+
var n = import_react.default.useContext(et), r2 = (0, import_react.useMemo)(function() {
|
|
3760
3493
|
return function(e3, n2) {
|
|
3761
3494
|
if (!e3) throw he(14);
|
|
3762
3495
|
if (re(e3)) {
|
|
@@ -3768,7 +3501,7 @@ function ot(e2) {
|
|
|
3768
3501
|
return n2 ? __assign(__assign({}, n2), e3) : e3;
|
|
3769
3502
|
}(e2.theme, n);
|
|
3770
3503
|
}, [e2.theme, n]);
|
|
3771
|
-
return e2.children ?
|
|
3504
|
+
return e2.children ? import_react.default.createElement(et.Provider, { value: r2 }, e2.children) : null;
|
|
3772
3505
|
}
|
|
3773
3506
|
var rt = {};
|
|
3774
3507
|
var st = /* @__PURE__ */ new Set();
|
|
@@ -3793,8 +3526,8 @@ function it(e2, r2, s2) {
|
|
|
3793
3526
|
var N2 = new Qe(s2, g2, i2 ? a2.componentStyle : void 0);
|
|
3794
3527
|
function O2(e3, r3) {
|
|
3795
3528
|
return function(e4, r4, s3) {
|
|
3796
|
-
var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d2 = e4.styledComponentId, h2 = e4.target, f3 =
|
|
3797
|
-
(0,
|
|
3529
|
+
var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d2 = e4.styledComponentId, h2 = e4.target, f3 = import_react.default.useContext(et), m3 = Ge(), y3 = e4.shouldForwardProp || m3.shouldForwardProp;
|
|
3530
|
+
(0, import_react.useDebugValue)(d2);
|
|
3798
3531
|
var v2 = I(r4, f3, c3) || C, g3 = function(e5, n, o2) {
|
|
3799
3532
|
for (var r5, s4 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i4 = 0; i4 < e5.length; i4 += 1) {
|
|
3800
3533
|
var a4 = re(r5 = e5[i4]) ? r5(s4) : r5;
|
|
@@ -3805,15 +3538,15 @@ function it(e2, r2, s2) {
|
|
|
3805
3538
|
for (var b3 in g3) void 0 === g3[b3] || "$" === b3[0] || "as" === b3 || "theme" === b3 && g3.theme === v2 || ("forwardedAs" === b3 ? w3.as = g3.forwardedAs : y3 && !y3(b3, S3) || (w3[b3] = g3[b3], y3 || false || isPropValid(b3) || st.has(b3) || !A.has(S3) || (st.add(b3), console.warn('styled-components: it looks like an unknown prop "'.concat(b3, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
|
|
3806
3539
|
var E3 = function(e5, t2) {
|
|
3807
3540
|
var n = Ge(), o2 = e5.generateAndInjectStyles(t2, n.styleSheet, n.stylis);
|
|
3808
|
-
return (0,
|
|
3541
|
+
return (0, import_react.useDebugValue)(o2), o2;
|
|
3809
3542
|
}(a3, g3);
|
|
3810
3543
|
e4.warnTooManyClasses && e4.warnTooManyClasses(E3);
|
|
3811
3544
|
var N3 = ie(p3, d2);
|
|
3812
|
-
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), (0,
|
|
3545
|
+
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), (0, import_react.createElement)(S3, w3);
|
|
3813
3546
|
}(D2, e3, r3);
|
|
3814
3547
|
}
|
|
3815
3548
|
O2.displayName = y2;
|
|
3816
|
-
var D2 =
|
|
3549
|
+
var D2 = import_react.default.forwardRef(O2);
|
|
3817
3550
|
return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e2, Object.defineProperty(D2, "defaultProps", { get: function() {
|
|
3818
3551
|
return this._foldedDefaultProps;
|
|
3819
3552
|
}, set: function(e3) {
|
|
@@ -3884,10 +3617,10 @@ function ft(n) {
|
|
|
3884
3617
|
var i2 = lt.apply(void 0, __spreadArray([n], r2, false)), a2 = "sc-global-".concat($(JSON.stringify(i2))), c2 = new ht(i2, a2);
|
|
3885
3618
|
P(a2);
|
|
3886
3619
|
var l2 = function(e2) {
|
|
3887
|
-
var t2 = Ge(), n2 =
|
|
3888
|
-
return
|
|
3620
|
+
var t2 = Ge(), n2 = import_react.default.useContext(et), r3 = import_react.default.useRef(t2.styleSheet.allocateGSInstance(a2)).current;
|
|
3621
|
+
return import_react.default.Children.count(e2.children) && console.warn("The global style component ".concat(a2, " was given child JSX. createGlobalStyle does not render children.")), i2.some(function(e3) {
|
|
3889
3622
|
return "string" == typeof e3 && -1 !== e3.indexOf("@import");
|
|
3890
|
-
}) && console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."), t2.styleSheet.server && u2(r3, e2, t2.styleSheet, n2, t2.stylis),
|
|
3623
|
+
}) && console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."), t2.styleSheet.server && u2(r3, e2, t2.styleSheet, n2, t2.stylis), import_react.default.useLayoutEffect(function() {
|
|
3891
3624
|
if (!t2.styleSheet.server) return u2(r3, e2, t2.styleSheet, n2, t2.stylis), function() {
|
|
3892
3625
|
return c2.removeStyles(r3, t2.styleSheet);
|
|
3893
3626
|
};
|
|
@@ -3900,7 +3633,7 @@ function ft(n) {
|
|
|
3900
3633
|
c2.renderStyles(e2, i3, o2, s3);
|
|
3901
3634
|
}
|
|
3902
3635
|
}
|
|
3903
|
-
return
|
|
3636
|
+
return import_react.default.memo(l2);
|
|
3904
3637
|
}
|
|
3905
3638
|
function mt(t2) {
|
|
3906
3639
|
for (var n = [], o2 = 1; o2 < arguments.length; o2++) n[o2 - 1] = arguments[o2];
|
|
@@ -3925,14 +3658,14 @@ var vt = function() {
|
|
|
3925
3658
|
var r2 = e3.instance.toString();
|
|
3926
3659
|
if (!r2) return [];
|
|
3927
3660
|
var s2 = ((n = {})[f] = "", n[y] = v, n.dangerouslySetInnerHTML = { __html: r2 }, n), i2 = Ce();
|
|
3928
|
-
return i2 && (s2.nonce = i2), [
|
|
3661
|
+
return i2 && (s2.nonce = i2), [import_react.default.createElement("style", __assign({}, s2, { key: "sc-0-0" }))];
|
|
3929
3662
|
}, this.seal = function() {
|
|
3930
3663
|
e3.sealed = true;
|
|
3931
3664
|
}, this.instance = new ke({ isServer: true }), this.sealed = false;
|
|
3932
3665
|
}
|
|
3933
3666
|
return e2.prototype.collectStyles = function(e3) {
|
|
3934
3667
|
if (this.sealed) throw he(2);
|
|
3935
|
-
return
|
|
3668
|
+
return import_react.default.createElement(Ye, { sheet: this.instance }, e3);
|
|
3936
3669
|
}, e2.prototype.interleaveWithNodeStream = function(e3) {
|
|
3937
3670
|
throw he(3);
|
|
3938
3671
|
}, e2;
|
|
@@ -3950,10 +3683,10 @@ var DEFAULT_CURRENCY = "USD";
|
|
|
3950
3683
|
var MAXIMUM_SIGNIFICANT_DIGITS = 6;
|
|
3951
3684
|
|
|
3952
3685
|
// src/hooks/useAvailablePlans.ts
|
|
3953
|
-
var
|
|
3686
|
+
var import_react2 = require("react");
|
|
3954
3687
|
function useAvailablePlans(activePeriod) {
|
|
3955
3688
|
const { data, mode } = useEmbed();
|
|
3956
|
-
const getAvailablePeriods = (0,
|
|
3689
|
+
const getAvailablePeriods = (0, import_react2.useCallback)(() => {
|
|
3957
3690
|
const periods = [];
|
|
3958
3691
|
if (data.activePlans.some((plan) => plan.monthlyPrice) || data.activeAddOns.some((addOn) => addOn.monthlyPrice)) {
|
|
3959
3692
|
periods.push("month");
|
|
@@ -3963,7 +3696,7 @@ function useAvailablePlans(activePeriod) {
|
|
|
3963
3696
|
}
|
|
3964
3697
|
return periods;
|
|
3965
3698
|
}, [data.activePlans, data.activeAddOns]);
|
|
3966
|
-
const getActivePlans = (0,
|
|
3699
|
+
const getActivePlans = (0, import_react2.useCallback)(
|
|
3967
3700
|
(plans) => {
|
|
3968
3701
|
const customPlanExist = plans.some((plan) => plan.custom);
|
|
3969
3702
|
const plansWithSelected = mode === "edit" ? plans.slice() : plans.filter(
|
|
@@ -3984,7 +3717,7 @@ function useAvailablePlans(activePeriod) {
|
|
|
3984
3717
|
},
|
|
3985
3718
|
[activePeriod, mode]
|
|
3986
3719
|
);
|
|
3987
|
-
return (0,
|
|
3720
|
+
return (0, import_react2.useMemo)(() => {
|
|
3988
3721
|
return {
|
|
3989
3722
|
plans: getActivePlans(data.activePlans),
|
|
3990
3723
|
addOns: getActivePlans(data.activeAddOns),
|
|
@@ -4002,7 +3735,7 @@ function useAvailablePlans(activePeriod) {
|
|
|
4002
3735
|
var import_react12 = require("react");
|
|
4003
3736
|
|
|
4004
3737
|
// node_modules/i18next/dist/esm/i18next.js
|
|
4005
|
-
var
|
|
3738
|
+
var isString = (obj) => typeof obj === "string";
|
|
4006
3739
|
var defer = () => {
|
|
4007
3740
|
let res;
|
|
4008
3741
|
let rej;
|
|
@@ -4025,9 +3758,9 @@ var copy2 = (a2, s2, t2) => {
|
|
|
4025
3758
|
};
|
|
4026
3759
|
var lastOfPathSeparatorRegExp = /###/g;
|
|
4027
3760
|
var cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
|
|
4028
|
-
var canNotTraverseDeeper = (object) => !object ||
|
|
3761
|
+
var canNotTraverseDeeper = (object) => !object || isString(object);
|
|
4029
3762
|
var getLastOfPath = (object, path, Empty) => {
|
|
4030
|
-
const stack = !
|
|
3763
|
+
const stack = !isString(path) ? path : path.split(".");
|
|
4031
3764
|
let stackIndex = 0;
|
|
4032
3765
|
while (stackIndex < stack.length - 1) {
|
|
4033
3766
|
if (canNotTraverseDeeper(object)) return {};
|
|
@@ -4096,7 +3829,7 @@ var deepExtend = (target, source, overwrite) => {
|
|
|
4096
3829
|
for (const prop in source) {
|
|
4097
3830
|
if (prop !== "__proto__" && prop !== "constructor") {
|
|
4098
3831
|
if (prop in target) {
|
|
4099
|
-
if (
|
|
3832
|
+
if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
|
|
4100
3833
|
if (overwrite) target[prop] = source[prop];
|
|
4101
3834
|
} else {
|
|
4102
3835
|
deepExtend(target[prop], source[prop], overwrite);
|
|
@@ -4118,7 +3851,7 @@ var _entityMap = {
|
|
|
4118
3851
|
"/": "/"
|
|
4119
3852
|
};
|
|
4120
3853
|
var escape = (data) => {
|
|
4121
|
-
if (
|
|
3854
|
+
if (isString(data)) {
|
|
4122
3855
|
return data.replace(/[&<>"'\/]/g, (s2) => _entityMap[s2]);
|
|
4123
3856
|
}
|
|
4124
3857
|
return data;
|
|
@@ -4247,7 +3980,7 @@ var Logger = class _Logger {
|
|
|
4247
3980
|
}
|
|
4248
3981
|
forward(args, lvl, prefix2, debugOnly) {
|
|
4249
3982
|
if (debugOnly && !this.debug) return null;
|
|
4250
|
-
if (
|
|
3983
|
+
if (isString(args[0])) args[0] = `${prefix2}${this.prefix} ${args[0]}`;
|
|
4251
3984
|
return this.logger[lvl](args);
|
|
4252
3985
|
}
|
|
4253
3986
|
create(moduleName) {
|
|
@@ -4348,7 +4081,7 @@ var ResourceStore = class extends EventEmitter {
|
|
|
4348
4081
|
if (key) {
|
|
4349
4082
|
if (Array.isArray(key)) {
|
|
4350
4083
|
path.push(...key);
|
|
4351
|
-
} else if (
|
|
4084
|
+
} else if (isString(key) && keySeparator) {
|
|
4352
4085
|
path.push(...key.split(keySeparator));
|
|
4353
4086
|
} else {
|
|
4354
4087
|
path.push(key);
|
|
@@ -4361,7 +4094,7 @@ var ResourceStore = class extends EventEmitter {
|
|
|
4361
4094
|
ns = path[1];
|
|
4362
4095
|
key = path.slice(2).join(".");
|
|
4363
4096
|
}
|
|
4364
|
-
if (result || !ignoreJSONStructure || !
|
|
4097
|
+
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
4365
4098
|
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
4366
4099
|
}
|
|
4367
4100
|
addResource(lng, ns, key, value) {
|
|
@@ -4385,7 +4118,7 @@ var ResourceStore = class extends EventEmitter {
|
|
|
4385
4118
|
silent: false
|
|
4386
4119
|
};
|
|
4387
4120
|
for (const m2 in resources) {
|
|
4388
|
-
if (
|
|
4121
|
+
if (isString(resources[m2]) || Array.isArray(resources[m2])) this.addResource(lng, ns, m2, resources[m2], {
|
|
4389
4122
|
silent: true
|
|
4390
4123
|
});
|
|
4391
4124
|
}
|
|
@@ -4456,7 +4189,7 @@ var postProcessor = {
|
|
|
4456
4189
|
}
|
|
4457
4190
|
};
|
|
4458
4191
|
var checkedLoadedFor = {};
|
|
4459
|
-
var shouldHandleAsObject = (res) => !
|
|
4192
|
+
var shouldHandleAsObject = (res) => !isString(res) && typeof res !== "boolean" && typeof res !== "number";
|
|
4460
4193
|
var Translator = class _Translator extends EventEmitter {
|
|
4461
4194
|
constructor(services) {
|
|
4462
4195
|
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -4493,7 +4226,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4493
4226
|
if (m2 && m2.length > 0) {
|
|
4494
4227
|
return {
|
|
4495
4228
|
key,
|
|
4496
|
-
namespaces:
|
|
4229
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
4497
4230
|
};
|
|
4498
4231
|
}
|
|
4499
4232
|
const parts = key.split(nsSeparator);
|
|
@@ -4502,7 +4235,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4502
4235
|
}
|
|
4503
4236
|
return {
|
|
4504
4237
|
key,
|
|
4505
|
-
namespaces:
|
|
4238
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
4506
4239
|
};
|
|
4507
4240
|
}
|
|
4508
4241
|
translate(keys, options, lastKey) {
|
|
@@ -4558,7 +4291,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4558
4291
|
const noObject = ["[object Number]", "[object Function]", "[object RegExp]"];
|
|
4559
4292
|
const joinArrays = options.joinArrays !== void 0 ? options.joinArrays : this.options.joinArrays;
|
|
4560
4293
|
const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
4561
|
-
const needsPluralHandling = options.count !== void 0 && !
|
|
4294
|
+
const needsPluralHandling = options.count !== void 0 && !isString(options.count);
|
|
4562
4295
|
const hasDefaultValue = _Translator.hasDefaultValue(options);
|
|
4563
4296
|
const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : "";
|
|
4564
4297
|
const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
|
|
@@ -4572,7 +4305,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4572
4305
|
}
|
|
4573
4306
|
const handleAsObject = shouldHandleAsObject(resForObjHndl);
|
|
4574
4307
|
const resType = Object.prototype.toString.apply(resForObjHndl);
|
|
4575
|
-
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(
|
|
4308
|
+
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
|
|
4576
4309
|
if (!options.returnObjects && !this.options.returnObjects) {
|
|
4577
4310
|
if (!this.options.returnedObjectHandler) {
|
|
4578
4311
|
this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -4618,7 +4351,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4618
4351
|
}
|
|
4619
4352
|
res = copy3;
|
|
4620
4353
|
}
|
|
4621
|
-
} else if (handleAsObjectInI18nFormat &&
|
|
4354
|
+
} else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
|
|
4622
4355
|
res = res.join(joinArrays);
|
|
4623
4356
|
if (res) res = this.extendTranslation(res, keys, options, lastKey);
|
|
4624
4357
|
} else {
|
|
@@ -4712,13 +4445,13 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4712
4445
|
}
|
|
4713
4446
|
}
|
|
4714
4447
|
});
|
|
4715
|
-
const skipOnVariables =
|
|
4448
|
+
const skipOnVariables = isString(res) && (options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
4716
4449
|
let nestBef;
|
|
4717
4450
|
if (skipOnVariables) {
|
|
4718
4451
|
const nb = res.match(this.interpolator.nestingRegexp);
|
|
4719
4452
|
nestBef = nb && nb.length;
|
|
4720
4453
|
}
|
|
4721
|
-
let data = options.replace && !
|
|
4454
|
+
let data = options.replace && !isString(options.replace) ? options.replace : options;
|
|
4722
4455
|
if (this.options.interpolation.defaultVariables) data = {
|
|
4723
4456
|
...this.options.interpolation.defaultVariables,
|
|
4724
4457
|
...data
|
|
@@ -4743,7 +4476,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4743
4476
|
if (options.interpolation) this.interpolator.reset();
|
|
4744
4477
|
}
|
|
4745
4478
|
const postProcess = options.postProcess || this.options.postProcess;
|
|
4746
|
-
const postProcessorNames =
|
|
4479
|
+
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
4747
4480
|
if (res != null && postProcessorNames?.length && options.applyPostProcessor !== false) {
|
|
4748
4481
|
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
4749
4482
|
i18nResolved: {
|
|
@@ -4762,7 +4495,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4762
4495
|
let exactUsedKey;
|
|
4763
4496
|
let usedLng;
|
|
4764
4497
|
let usedNS;
|
|
4765
|
-
if (
|
|
4498
|
+
if (isString(keys)) keys = [keys];
|
|
4766
4499
|
keys.forEach((k2) => {
|
|
4767
4500
|
if (this.isValidLookup(found)) return;
|
|
4768
4501
|
const extracted = this.extractFromKey(k2, options);
|
|
@@ -4770,9 +4503,9 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4770
4503
|
usedKey = key;
|
|
4771
4504
|
let namespaces = extracted.namespaces;
|
|
4772
4505
|
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
4773
|
-
const needsPluralHandling = options.count !== void 0 && !
|
|
4506
|
+
const needsPluralHandling = options.count !== void 0 && !isString(options.count);
|
|
4774
4507
|
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
|
|
4775
|
-
const needsContextHandling = options.context !== void 0 && (
|
|
4508
|
+
const needsContextHandling = options.context !== void 0 && (isString(options.context) || typeof options.context === "number") && options.context !== "";
|
|
4776
4509
|
const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
|
|
4777
4510
|
namespaces.forEach((ns) => {
|
|
4778
4511
|
if (this.isValidLookup(found)) return;
|
|
@@ -4844,7 +4577,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4844
4577
|
getUsedParamsDetails() {
|
|
4845
4578
|
let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4846
4579
|
const optionsKeys = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"];
|
|
4847
|
-
const useOptionsReplaceForData = options.replace && !
|
|
4580
|
+
const useOptionsReplaceForData = options.replace && !isString(options.replace);
|
|
4848
4581
|
let data = useOptionsReplaceForData ? options.replace : options;
|
|
4849
4582
|
if (useOptionsReplaceForData && typeof options.count !== "undefined") {
|
|
4850
4583
|
data.count = options.count;
|
|
@@ -4897,7 +4630,7 @@ var LanguageUtil = class {
|
|
|
4897
4630
|
return this.formatLanguageCode(p2[0]);
|
|
4898
4631
|
}
|
|
4899
4632
|
formatLanguageCode(code) {
|
|
4900
|
-
if (
|
|
4633
|
+
if (isString(code) && code.indexOf("-") > -1) {
|
|
4901
4634
|
let formattedCode;
|
|
4902
4635
|
try {
|
|
4903
4636
|
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
@@ -4947,7 +4680,7 @@ var LanguageUtil = class {
|
|
|
4947
4680
|
getFallbackCodes(fallbacks, code) {
|
|
4948
4681
|
if (!fallbacks) return [];
|
|
4949
4682
|
if (typeof fallbacks === "function") fallbacks = fallbacks(code);
|
|
4950
|
-
if (
|
|
4683
|
+
if (isString(fallbacks)) fallbacks = [fallbacks];
|
|
4951
4684
|
if (Array.isArray(fallbacks)) return fallbacks;
|
|
4952
4685
|
if (!code) return fallbacks.default || [];
|
|
4953
4686
|
let found = fallbacks[code];
|
|
@@ -4968,11 +4701,11 @@ var LanguageUtil = class {
|
|
|
4968
4701
|
this.logger.warn(`rejecting language code not found in supportedLngs: ${c2}`);
|
|
4969
4702
|
}
|
|
4970
4703
|
};
|
|
4971
|
-
if (
|
|
4704
|
+
if (isString(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) {
|
|
4972
4705
|
if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code));
|
|
4973
4706
|
if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code));
|
|
4974
4707
|
if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code));
|
|
4975
|
-
} else if (
|
|
4708
|
+
} else if (isString(code)) {
|
|
4976
4709
|
addCode(this.formatLanguageCode(code));
|
|
4977
4710
|
}
|
|
4978
4711
|
fallbackCodes.forEach((fc) => {
|
|
@@ -5068,7 +4801,7 @@ var deepFindWithDefaults = function(data, defaultData, key) {
|
|
|
5068
4801
|
let keySeparator = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".";
|
|
5069
4802
|
let ignoreJSONStructure = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
|
|
5070
4803
|
let path = getPathWithDefaults(data, defaultData, key);
|
|
5071
|
-
if (!path && ignoreJSONStructure &&
|
|
4804
|
+
if (!path && ignoreJSONStructure && isString(key)) {
|
|
5072
4805
|
path = deepFind(data, key, keySeparator);
|
|
5073
4806
|
if (path === void 0) path = deepFind(defaultData, key, keySeparator);
|
|
5074
4807
|
}
|
|
@@ -5178,7 +4911,7 @@ var Interpolator = class {
|
|
|
5178
4911
|
if (value === void 0) {
|
|
5179
4912
|
if (typeof missingInterpolationHandler === "function") {
|
|
5180
4913
|
const temp = missingInterpolationHandler(str, match2, options);
|
|
5181
|
-
value =
|
|
4914
|
+
value = isString(temp) ? temp : "";
|
|
5182
4915
|
} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
|
|
5183
4916
|
value = "";
|
|
5184
4917
|
} else if (skipOnVariables) {
|
|
@@ -5188,7 +4921,7 @@ var Interpolator = class {
|
|
|
5188
4921
|
this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
|
|
5189
4922
|
value = "";
|
|
5190
4923
|
}
|
|
5191
|
-
} else if (!
|
|
4924
|
+
} else if (!isString(value) && !this.useRawValueToEscape) {
|
|
5192
4925
|
value = makeString(value);
|
|
5193
4926
|
}
|
|
5194
4927
|
const safeValue = todo.safeValue(value);
|
|
@@ -5242,7 +4975,7 @@ var Interpolator = class {
|
|
|
5242
4975
|
clonedOptions = {
|
|
5243
4976
|
...options
|
|
5244
4977
|
};
|
|
5245
|
-
clonedOptions = clonedOptions.replace && !
|
|
4978
|
+
clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
|
|
5246
4979
|
clonedOptions.applyPostProcessor = false;
|
|
5247
4980
|
delete clonedOptions.defaultValue;
|
|
5248
4981
|
let doReduce = false;
|
|
@@ -5253,8 +4986,8 @@ var Interpolator = class {
|
|
|
5253
4986
|
doReduce = true;
|
|
5254
4987
|
}
|
|
5255
4988
|
value = fc(handleHasOptions.call(this, match2[1].trim(), clonedOptions), clonedOptions);
|
|
5256
|
-
if (value && match2[0] === str && !
|
|
5257
|
-
if (!
|
|
4989
|
+
if (value && match2[0] === str && !isString(value)) return value;
|
|
4990
|
+
if (!isString(value)) value = makeString(value);
|
|
5258
4991
|
if (!value) {
|
|
5259
4992
|
this.logger.warn(`missed to resolve ${match2[1]} for nesting ${str}`);
|
|
5260
4993
|
value = "";
|
|
@@ -5564,8 +5297,8 @@ var Connector = class extends EventEmitter {
|
|
|
5564
5297
|
this.logger.warn("No backend was added via i18next.use. Will not load resources.");
|
|
5565
5298
|
return callback && callback();
|
|
5566
5299
|
}
|
|
5567
|
-
if (
|
|
5568
|
-
if (
|
|
5300
|
+
if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
|
|
5301
|
+
if (isString(namespaces)) namespaces = [namespaces];
|
|
5569
5302
|
const toLoad = this.queueLoad(languages, namespaces, options, callback);
|
|
5570
5303
|
if (!toLoad.toLoad.length) {
|
|
5571
5304
|
if (!toLoad.pending.length) callback();
|
|
@@ -5669,8 +5402,8 @@ var get = () => ({
|
|
|
5669
5402
|
overloadTranslationOptionHandler: (args) => {
|
|
5670
5403
|
let ret = {};
|
|
5671
5404
|
if (typeof args[1] === "object") ret = args[1];
|
|
5672
|
-
if (
|
|
5673
|
-
if (
|
|
5405
|
+
if (isString(args[1])) ret.defaultValue = args[1];
|
|
5406
|
+
if (isString(args[2])) ret.tDescription = args[2];
|
|
5674
5407
|
if (typeof args[2] === "object" || typeof args[3] === "object") {
|
|
5675
5408
|
const options = args[3] || args[2];
|
|
5676
5409
|
Object.keys(options).forEach((key) => {
|
|
@@ -5694,9 +5427,9 @@ var get = () => ({
|
|
|
5694
5427
|
}
|
|
5695
5428
|
});
|
|
5696
5429
|
var transformOptions = (options) => {
|
|
5697
|
-
if (
|
|
5698
|
-
if (
|
|
5699
|
-
if (
|
|
5430
|
+
if (isString(options.ns)) options.ns = [options.ns];
|
|
5431
|
+
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
5432
|
+
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
5700
5433
|
if (options.supportedLngs?.indexOf?.("cimode") < 0) {
|
|
5701
5434
|
options.supportedLngs = options.supportedLngs.concat(["cimode"]);
|
|
5702
5435
|
}
|
|
@@ -5745,7 +5478,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5745
5478
|
options = {};
|
|
5746
5479
|
}
|
|
5747
5480
|
if (options.defaultNS == null && options.ns) {
|
|
5748
|
-
if (
|
|
5481
|
+
if (isString(options.ns)) {
|
|
5749
5482
|
options.defaultNS = options.ns;
|
|
5750
5483
|
} else if (options.ns.indexOf("translation") < 0) {
|
|
5751
5484
|
options.defaultNS = options.ns[0];
|
|
@@ -5875,7 +5608,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5875
5608
|
loadResources(language) {
|
|
5876
5609
|
let callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
|
|
5877
5610
|
let usedCallback = callback;
|
|
5878
|
-
const usedLng =
|
|
5611
|
+
const usedLng = isString(language) ? language : this.language;
|
|
5879
5612
|
if (typeof language === "function") usedCallback = language;
|
|
5880
5613
|
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
5881
5614
|
if (usedLng?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
@@ -5991,7 +5724,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5991
5724
|
};
|
|
5992
5725
|
const setLng = (lngs) => {
|
|
5993
5726
|
if (!lng && !lngs && this.services.languageDetector) lngs = [];
|
|
5994
|
-
const l2 =
|
|
5727
|
+
const l2 = isString(lngs) ? lngs : this.services.languageUtils.getBestMatchFromCodes(lngs);
|
|
5995
5728
|
if (l2) {
|
|
5996
5729
|
if (!this.language) {
|
|
5997
5730
|
setLngProps(l2);
|
|
@@ -6043,7 +5776,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
6043
5776
|
}
|
|
6044
5777
|
return _this3.t(resultKey, options);
|
|
6045
5778
|
};
|
|
6046
|
-
if (
|
|
5779
|
+
if (isString(lng)) {
|
|
6047
5780
|
fixedT.lng = lng;
|
|
6048
5781
|
} else {
|
|
6049
5782
|
fixedT.lngs = lng;
|
|
@@ -6100,7 +5833,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
6100
5833
|
if (callback) callback();
|
|
6101
5834
|
return Promise.resolve();
|
|
6102
5835
|
}
|
|
6103
|
-
if (
|
|
5836
|
+
if (isString(ns)) ns = [ns];
|
|
6104
5837
|
ns.forEach((n) => {
|
|
6105
5838
|
if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
|
|
6106
5839
|
});
|
|
@@ -6112,7 +5845,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
6112
5845
|
}
|
|
6113
5846
|
loadLanguages(lngs, callback) {
|
|
6114
5847
|
const deferred = defer();
|
|
6115
|
-
if (
|
|
5848
|
+
if (isString(lngs)) lngs = [lngs];
|
|
6116
5849
|
const preloaded = this.options.preload || [];
|
|
6117
5850
|
const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
|
|
6118
5851
|
if (!newLngs.length) {
|
|
@@ -6216,9 +5949,9 @@ var getFixedT = instance.getFixedT;
|
|
|
6216
5949
|
var t = instance.t;
|
|
6217
5950
|
var exists = instance.exists;
|
|
6218
5951
|
var setDefaultNamespace = instance.setDefaultNamespace;
|
|
6219
|
-
var
|
|
6220
|
-
var
|
|
6221
|
-
var
|
|
5952
|
+
var hasLoadedNamespace = instance.hasLoadedNamespace;
|
|
5953
|
+
var loadNamespaces = instance.loadNamespaces;
|
|
5954
|
+
var loadLanguages = instance.loadLanguages;
|
|
6222
5955
|
|
|
6223
5956
|
// src/context/embed.tsx
|
|
6224
5957
|
var import_merge = __toESM(require_merge());
|
|
@@ -10393,12 +10126,284 @@ var inflate_1$1 = {
|
|
|
10393
10126
|
ungzip: ungzip$1,
|
|
10394
10127
|
constants
|
|
10395
10128
|
};
|
|
10396
|
-
var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
|
|
10397
|
-
var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
|
|
10398
|
-
var inflate_1 = inflate;
|
|
10129
|
+
var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
|
|
10130
|
+
var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
|
|
10131
|
+
var inflate_1 = inflate;
|
|
10132
|
+
|
|
10133
|
+
// src/context/embed.tsx
|
|
10134
|
+
var import_react11 = require("react");
|
|
10135
|
+
|
|
10136
|
+
// node_modules/react-i18next/dist/es/Trans.js
|
|
10137
|
+
var import_react5 = require("react");
|
|
10138
|
+
|
|
10139
|
+
// node_modules/react-i18next/dist/es/TransWithoutContext.js
|
|
10140
|
+
var import_react3 = require("react");
|
|
10141
|
+
|
|
10142
|
+
// node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
|
|
10143
|
+
var import_void_elements = __toESM(require_void_elements());
|
|
10144
|
+
|
|
10145
|
+
// node_modules/react-i18next/dist/es/utils.js
|
|
10146
|
+
var warn = (i18n, code, msg, rest) => {
|
|
10147
|
+
const args = [msg, {
|
|
10148
|
+
code,
|
|
10149
|
+
...rest || {}
|
|
10150
|
+
}];
|
|
10151
|
+
if (i18n?.services?.logger?.forward) {
|
|
10152
|
+
return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
|
|
10153
|
+
}
|
|
10154
|
+
if (isString2(args[0])) args[0] = `react-i18next:: ${args[0]}`;
|
|
10155
|
+
if (i18n?.services?.logger?.warn) {
|
|
10156
|
+
i18n.services.logger.warn(...args);
|
|
10157
|
+
} else if (console?.warn) {
|
|
10158
|
+
console.warn(...args);
|
|
10159
|
+
}
|
|
10160
|
+
};
|
|
10161
|
+
var alreadyWarned = {};
|
|
10162
|
+
var warnOnce = (i18n, code, msg, rest) => {
|
|
10163
|
+
if (isString2(msg) && alreadyWarned[msg]) return;
|
|
10164
|
+
if (isString2(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
|
|
10165
|
+
warn(i18n, code, msg, rest);
|
|
10166
|
+
};
|
|
10167
|
+
var loadedClb = (i18n, cb) => () => {
|
|
10168
|
+
if (i18n.isInitialized) {
|
|
10169
|
+
cb();
|
|
10170
|
+
} else {
|
|
10171
|
+
const initialized = () => {
|
|
10172
|
+
setTimeout(() => {
|
|
10173
|
+
i18n.off("initialized", initialized);
|
|
10174
|
+
}, 0);
|
|
10175
|
+
cb();
|
|
10176
|
+
};
|
|
10177
|
+
i18n.on("initialized", initialized);
|
|
10178
|
+
}
|
|
10179
|
+
};
|
|
10180
|
+
var loadNamespaces2 = (i18n, ns, cb) => {
|
|
10181
|
+
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
10182
|
+
};
|
|
10183
|
+
var loadLanguages2 = (i18n, lng, ns, cb) => {
|
|
10184
|
+
if (isString2(ns)) ns = [ns];
|
|
10185
|
+
if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces2(i18n, ns, cb);
|
|
10186
|
+
ns.forEach((n) => {
|
|
10187
|
+
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
10188
|
+
});
|
|
10189
|
+
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
10190
|
+
};
|
|
10191
|
+
var hasLoadedNamespace2 = (ns, i18n, options = {}) => {
|
|
10192
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
10193
|
+
warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
10194
|
+
languages: i18n.languages
|
|
10195
|
+
});
|
|
10196
|
+
return true;
|
|
10197
|
+
}
|
|
10198
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
10199
|
+
lng: options.lng,
|
|
10200
|
+
precheck: (i18nInstance2, loadNotPending) => {
|
|
10201
|
+
if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
|
|
10202
|
+
}
|
|
10203
|
+
});
|
|
10204
|
+
};
|
|
10205
|
+
var isString2 = (obj) => typeof obj === "string";
|
|
10206
|
+
var isObject = (obj) => typeof obj === "object" && obj !== null;
|
|
10207
|
+
|
|
10208
|
+
// node_modules/react-i18next/dist/es/unescape.js
|
|
10209
|
+
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
10210
|
+
var htmlEntities = {
|
|
10211
|
+
"&": "&",
|
|
10212
|
+
"&": "&",
|
|
10213
|
+
"<": "<",
|
|
10214
|
+
"<": "<",
|
|
10215
|
+
">": ">",
|
|
10216
|
+
">": ">",
|
|
10217
|
+
"'": "'",
|
|
10218
|
+
"'": "'",
|
|
10219
|
+
""": '"',
|
|
10220
|
+
""": '"',
|
|
10221
|
+
" ": " ",
|
|
10222
|
+
" ": " ",
|
|
10223
|
+
"©": "\xA9",
|
|
10224
|
+
"©": "\xA9",
|
|
10225
|
+
"®": "\xAE",
|
|
10226
|
+
"®": "\xAE",
|
|
10227
|
+
"…": "\u2026",
|
|
10228
|
+
"…": "\u2026",
|
|
10229
|
+
"/": "/",
|
|
10230
|
+
"/": "/"
|
|
10231
|
+
};
|
|
10232
|
+
var unescapeHtmlEntity = (m2) => htmlEntities[m2];
|
|
10233
|
+
var unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
10234
|
+
|
|
10235
|
+
// node_modules/react-i18next/dist/es/defaults.js
|
|
10236
|
+
var defaultOptions = {
|
|
10237
|
+
bindI18n: "languageChanged",
|
|
10238
|
+
bindI18nStore: "",
|
|
10239
|
+
transEmptyNodeValue: "",
|
|
10240
|
+
transSupportBasicHtmlNodes: true,
|
|
10241
|
+
transWrapTextNodes: "",
|
|
10242
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
10243
|
+
useSuspense: true,
|
|
10244
|
+
unescape
|
|
10245
|
+
};
|
|
10246
|
+
var setDefaults = (options = {}) => {
|
|
10247
|
+
defaultOptions = {
|
|
10248
|
+
...defaultOptions,
|
|
10249
|
+
...options
|
|
10250
|
+
};
|
|
10251
|
+
};
|
|
10252
|
+
var getDefaults = () => defaultOptions;
|
|
10253
|
+
|
|
10254
|
+
// node_modules/react-i18next/dist/es/i18nInstance.js
|
|
10255
|
+
var i18nInstance;
|
|
10256
|
+
var setI18n = (instance2) => {
|
|
10257
|
+
i18nInstance = instance2;
|
|
10258
|
+
};
|
|
10259
|
+
var getI18n = () => i18nInstance;
|
|
10260
|
+
|
|
10261
|
+
// node_modules/react-i18next/dist/es/context.js
|
|
10262
|
+
var import_react4 = require("react");
|
|
10263
|
+
|
|
10264
|
+
// node_modules/react-i18next/dist/es/initReactI18next.js
|
|
10265
|
+
var initReactI18next = {
|
|
10266
|
+
type: "3rdParty",
|
|
10267
|
+
init(instance2) {
|
|
10268
|
+
setDefaults(instance2.options.react);
|
|
10269
|
+
setI18n(instance2);
|
|
10270
|
+
}
|
|
10271
|
+
};
|
|
10272
|
+
|
|
10273
|
+
// node_modules/react-i18next/dist/es/context.js
|
|
10274
|
+
var I18nContext = (0, import_react4.createContext)();
|
|
10275
|
+
var ReportNamespaces = class {
|
|
10276
|
+
constructor() {
|
|
10277
|
+
this.usedNamespaces = {};
|
|
10278
|
+
}
|
|
10279
|
+
addUsedNamespaces(namespaces) {
|
|
10280
|
+
namespaces.forEach((ns) => {
|
|
10281
|
+
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
10282
|
+
});
|
|
10283
|
+
}
|
|
10284
|
+
getUsedNamespaces() {
|
|
10285
|
+
return Object.keys(this.usedNamespaces);
|
|
10286
|
+
}
|
|
10287
|
+
};
|
|
10288
|
+
|
|
10289
|
+
// node_modules/react-i18next/dist/es/useTranslation.js
|
|
10290
|
+
var import_react6 = require("react");
|
|
10291
|
+
var usePrevious = (value, ignore) => {
|
|
10292
|
+
const ref = (0, import_react6.useRef)();
|
|
10293
|
+
(0, import_react6.useEffect)(() => {
|
|
10294
|
+
ref.current = ignore ? ref.current : value;
|
|
10295
|
+
}, [value, ignore]);
|
|
10296
|
+
return ref.current;
|
|
10297
|
+
};
|
|
10298
|
+
var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
10299
|
+
var useMemoizedT = (i18n, language, namespace, keyPrefix) => (0, import_react6.useCallback)(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
10300
|
+
var useTranslation = (ns, props = {}) => {
|
|
10301
|
+
const {
|
|
10302
|
+
i18n: i18nFromProps
|
|
10303
|
+
} = props;
|
|
10304
|
+
const {
|
|
10305
|
+
i18n: i18nFromContext,
|
|
10306
|
+
defaultNS: defaultNSFromContext
|
|
10307
|
+
} = (0, import_react6.useContext)(I18nContext) || {};
|
|
10308
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
10309
|
+
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
10310
|
+
if (!i18n) {
|
|
10311
|
+
warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
10312
|
+
const notReadyT = (k2, optsOrDefaultValue) => {
|
|
10313
|
+
if (isString2(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
10314
|
+
if (isObject(optsOrDefaultValue) && isString2(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
10315
|
+
return Array.isArray(k2) ? k2[k2.length - 1] : k2;
|
|
10316
|
+
};
|
|
10317
|
+
const retNotReady = [notReadyT, {}, false];
|
|
10318
|
+
retNotReady.t = notReadyT;
|
|
10319
|
+
retNotReady.i18n = {};
|
|
10320
|
+
retNotReady.ready = false;
|
|
10321
|
+
return retNotReady;
|
|
10322
|
+
}
|
|
10323
|
+
if (i18n.options.react?.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
10324
|
+
const i18nOptions = {
|
|
10325
|
+
...getDefaults(),
|
|
10326
|
+
...i18n.options.react,
|
|
10327
|
+
...props
|
|
10328
|
+
};
|
|
10329
|
+
const {
|
|
10330
|
+
useSuspense,
|
|
10331
|
+
keyPrefix
|
|
10332
|
+
} = i18nOptions;
|
|
10333
|
+
let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;
|
|
10334
|
+
namespaces = isString2(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
10335
|
+
i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
|
|
10336
|
+
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace2(n, i18n, i18nOptions));
|
|
10337
|
+
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
10338
|
+
const getT = () => memoGetT;
|
|
10339
|
+
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
10340
|
+
const [t2, setT] = (0, import_react6.useState)(getT);
|
|
10341
|
+
let joinedNS = namespaces.join();
|
|
10342
|
+
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
10343
|
+
const previousJoinedNS = usePrevious(joinedNS);
|
|
10344
|
+
const isMounted = (0, import_react6.useRef)(true);
|
|
10345
|
+
(0, import_react6.useEffect)(() => {
|
|
10346
|
+
const {
|
|
10347
|
+
bindI18n,
|
|
10348
|
+
bindI18nStore
|
|
10349
|
+
} = i18nOptions;
|
|
10350
|
+
isMounted.current = true;
|
|
10351
|
+
if (!ready && !useSuspense) {
|
|
10352
|
+
if (props.lng) {
|
|
10353
|
+
loadLanguages2(i18n, props.lng, namespaces, () => {
|
|
10354
|
+
if (isMounted.current) setT(getNewT);
|
|
10355
|
+
});
|
|
10356
|
+
} else {
|
|
10357
|
+
loadNamespaces2(i18n, namespaces, () => {
|
|
10358
|
+
if (isMounted.current) setT(getNewT);
|
|
10359
|
+
});
|
|
10360
|
+
}
|
|
10361
|
+
}
|
|
10362
|
+
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
10363
|
+
setT(getNewT);
|
|
10364
|
+
}
|
|
10365
|
+
const boundReset = () => {
|
|
10366
|
+
if (isMounted.current) setT(getNewT);
|
|
10367
|
+
};
|
|
10368
|
+
if (bindI18n) i18n?.on(bindI18n, boundReset);
|
|
10369
|
+
if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
|
|
10370
|
+
return () => {
|
|
10371
|
+
isMounted.current = false;
|
|
10372
|
+
if (i18n) bindI18n?.split(" ").forEach((e2) => i18n.off(e2, boundReset));
|
|
10373
|
+
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
|
|
10374
|
+
};
|
|
10375
|
+
}, [i18n, joinedNS]);
|
|
10376
|
+
(0, import_react6.useEffect)(() => {
|
|
10377
|
+
if (isMounted.current && ready) {
|
|
10378
|
+
setT(getT);
|
|
10379
|
+
}
|
|
10380
|
+
}, [i18n, keyPrefix, ready]);
|
|
10381
|
+
const ret = [t2, i18n, ready];
|
|
10382
|
+
ret.t = t2;
|
|
10383
|
+
ret.i18n = i18n;
|
|
10384
|
+
ret.ready = ready;
|
|
10385
|
+
if (ready) return ret;
|
|
10386
|
+
if (!ready && !useSuspense) return ret;
|
|
10387
|
+
throw new Promise((resolve) => {
|
|
10388
|
+
if (props.lng) {
|
|
10389
|
+
loadLanguages2(i18n, props.lng, namespaces, () => resolve());
|
|
10390
|
+
} else {
|
|
10391
|
+
loadNamespaces2(i18n, namespaces, () => resolve());
|
|
10392
|
+
}
|
|
10393
|
+
});
|
|
10394
|
+
};
|
|
10399
10395
|
|
|
10400
|
-
//
|
|
10401
|
-
var
|
|
10396
|
+
// node_modules/react-i18next/dist/es/withTranslation.js
|
|
10397
|
+
var import_react7 = require("react");
|
|
10398
|
+
|
|
10399
|
+
// node_modules/react-i18next/dist/es/I18nextProvider.js
|
|
10400
|
+
var import_react8 = require("react");
|
|
10401
|
+
|
|
10402
|
+
// node_modules/react-i18next/dist/es/withSSR.js
|
|
10403
|
+
var import_react10 = require("react");
|
|
10404
|
+
|
|
10405
|
+
// node_modules/react-i18next/dist/es/useSSR.js
|
|
10406
|
+
var import_react9 = require("react");
|
|
10402
10407
|
|
|
10403
10408
|
// node_modules/uuid/dist/esm-browser/stringify.js
|
|
10404
10409
|
var byteToHex = [];
|
|
@@ -10723,7 +10728,23 @@ function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10723
10728
|
id: json["id"],
|
|
10724
10729
|
interval: json["interval"],
|
|
10725
10730
|
price: json["price"],
|
|
10726
|
-
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"]
|
|
10731
|
+
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10732
|
+
scheme: json["scheme"]
|
|
10733
|
+
};
|
|
10734
|
+
}
|
|
10735
|
+
|
|
10736
|
+
// src/api/models/BillingProductPriceTierResponseData.ts
|
|
10737
|
+
function BillingProductPriceTierResponseDataFromJSON(json) {
|
|
10738
|
+
return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
|
|
10739
|
+
}
|
|
10740
|
+
function BillingProductPriceTierResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
10741
|
+
if (json == null) {
|
|
10742
|
+
return json;
|
|
10743
|
+
}
|
|
10744
|
+
return {
|
|
10745
|
+
flatAmount: json["flat_amount"] == null ? void 0 : json["flat_amount"],
|
|
10746
|
+
perUnitPrice: json["per_unit_price"],
|
|
10747
|
+
upTo: json["up_to"] == null ? void 0 : json["up_to"]
|
|
10727
10748
|
};
|
|
10728
10749
|
}
|
|
10729
10750
|
|
|
@@ -10736,6 +10757,7 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10736
10757
|
return json;
|
|
10737
10758
|
}
|
|
10738
10759
|
return {
|
|
10760
|
+
billingScheme: json["billing_scheme"],
|
|
10739
10761
|
createdAt: new Date(json["created_at"]),
|
|
10740
10762
|
currency: json["currency"],
|
|
10741
10763
|
id: json["id"],
|
|
@@ -10746,6 +10768,9 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10746
10768
|
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10747
10769
|
priceExternalId: json["price_external_id"],
|
|
10748
10770
|
priceId: json["price_id"],
|
|
10771
|
+
priceTier: json["price_tier"].map(
|
|
10772
|
+
BillingProductPriceTierResponseDataFromJSON
|
|
10773
|
+
),
|
|
10749
10774
|
productExternalId: json["product_external_id"],
|
|
10750
10775
|
productId: json["product_id"],
|
|
10751
10776
|
productName: json["product_name"],
|
|
@@ -10790,6 +10815,7 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
|
|
|
10790
10815
|
return json;
|
|
10791
10816
|
}
|
|
10792
10817
|
return {
|
|
10818
|
+
billingScheme: json["billing_scheme"],
|
|
10793
10819
|
createdAt: new Date(json["created_at"]),
|
|
10794
10820
|
currency: json["currency"],
|
|
10795
10821
|
environmentId: json["environment_id"],
|
|
@@ -10802,6 +10828,9 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
|
|
|
10802
10828
|
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10803
10829
|
priceExternalId: json["price_external_id"],
|
|
10804
10830
|
priceId: json["price_id"],
|
|
10831
|
+
priceTier: json["price_tier"].map(
|
|
10832
|
+
BillingProductPriceTierResponseDataFromJSON
|
|
10833
|
+
),
|
|
10805
10834
|
quantity: json["quantity"],
|
|
10806
10835
|
subscriptionId: json["subscription_id"],
|
|
10807
10836
|
updatedAt: new Date(json["updated_at"]),
|
|
@@ -10809,6 +10838,29 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
|
|
|
10809
10838
|
};
|
|
10810
10839
|
}
|
|
10811
10840
|
|
|
10841
|
+
// src/api/models/BillingProductResponseData.ts
|
|
10842
|
+
function BillingProductResponseDataFromJSON(json) {
|
|
10843
|
+
return BillingProductResponseDataFromJSONTyped(json, false);
|
|
10844
|
+
}
|
|
10845
|
+
function BillingProductResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
10846
|
+
if (json == null) {
|
|
10847
|
+
return json;
|
|
10848
|
+
}
|
|
10849
|
+
return {
|
|
10850
|
+
accountId: json["account_id"],
|
|
10851
|
+
createdAt: new Date(json["created_at"]),
|
|
10852
|
+
currency: json["currency"],
|
|
10853
|
+
environmentId: json["environment_id"],
|
|
10854
|
+
externalId: json["external_id"],
|
|
10855
|
+
name: json["name"],
|
|
10856
|
+
price: json["price"],
|
|
10857
|
+
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10858
|
+
productId: json["product_id"],
|
|
10859
|
+
quantity: json["quantity"],
|
|
10860
|
+
updatedAt: new Date(json["updated_at"])
|
|
10861
|
+
};
|
|
10862
|
+
}
|
|
10863
|
+
|
|
10812
10864
|
// src/api/models/BillingSubscriptionDiscountView.ts
|
|
10813
10865
|
function BillingSubscriptionDiscountViewFromJSON(json) {
|
|
10814
10866
|
return BillingSubscriptionDiscountViewFromJSONTyped(json, false);
|
|
@@ -11479,6 +11531,7 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
11479
11531
|
ruleIdUsageExceeded: json["rule_id_usage_exceeded"] == null ? void 0 : json["rule_id_usage_exceeded"],
|
|
11480
11532
|
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
11481
11533
|
updatedAt: new Date(json["updated_at"]),
|
|
11534
|
+
usageBasedProduct: json["usage_based_product"] == null ? void 0 : BillingProductResponseDataFromJSON(json["usage_based_product"]),
|
|
11482
11535
|
valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
|
|
11483
11536
|
valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
|
|
11484
11537
|
valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["value_trait"]),
|
|
@@ -11827,6 +11880,26 @@ function ListInvoicesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
11827
11880
|
};
|
|
11828
11881
|
}
|
|
11829
11882
|
|
|
11883
|
+
// src/api/models/PreviewSubscriptionFinanceResponseData.ts
|
|
11884
|
+
function PreviewSubscriptionFinanceResponseDataFromJSON(json) {
|
|
11885
|
+
return PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, false);
|
|
11886
|
+
}
|
|
11887
|
+
function PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
11888
|
+
if (json == null) {
|
|
11889
|
+
return json;
|
|
11890
|
+
}
|
|
11891
|
+
return {
|
|
11892
|
+
amountOff: json["amount_off"],
|
|
11893
|
+
dueNow: json["due_now"],
|
|
11894
|
+
newCharges: json["new_charges"],
|
|
11895
|
+
percentOff: json["percent_off"],
|
|
11896
|
+
periodStart: new Date(json["period_start"]),
|
|
11897
|
+
promoCodeApplied: json["promo_code_applied"],
|
|
11898
|
+
proration: json["proration"],
|
|
11899
|
+
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
|
|
11900
|
+
};
|
|
11901
|
+
}
|
|
11902
|
+
|
|
11830
11903
|
// src/api/models/PreviewSubscriptionChangeResponseData.ts
|
|
11831
11904
|
function PreviewSubscriptionChangeResponseDataFromJSON(json) {
|
|
11832
11905
|
return PreviewSubscriptionChangeResponseDataFromJSONTyped(json, false);
|
|
@@ -11838,12 +11911,16 @@ function PreviewSubscriptionChangeResponseDataFromJSONTyped(json, ignoreDiscrimi
|
|
|
11838
11911
|
return {
|
|
11839
11912
|
amountOff: json["amount_off"],
|
|
11840
11913
|
dueNow: json["due_now"],
|
|
11914
|
+
finance: json["finance"] == null ? void 0 : PreviewSubscriptionFinanceResponseDataFromJSON(json["finance"]),
|
|
11841
11915
|
newCharges: json["new_charges"],
|
|
11842
11916
|
percentOff: json["percent_off"],
|
|
11843
11917
|
periodStart: new Date(json["period_start"]),
|
|
11844
11918
|
promoCodeApplied: json["promo_code_applied"],
|
|
11845
11919
|
proration: json["proration"],
|
|
11846
|
-
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
|
|
11920
|
+
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"]),
|
|
11921
|
+
usageViolations: json["usage_violations"].map(
|
|
11922
|
+
FeatureUsageResponseDataFromJSON
|
|
11923
|
+
)
|
|
11847
11924
|
};
|
|
11848
11925
|
}
|
|
11849
11926
|
|
|
@@ -13112,7 +13189,7 @@ var EmbedProvider = ({
|
|
|
13112
13189
|
(0, import_react11.useEffect)(() => {
|
|
13113
13190
|
if (accessToken) {
|
|
13114
13191
|
const { headers = {} } = apiConfig ?? {};
|
|
13115
|
-
headers["X-Schematic-Components-Version"] = "0.7.
|
|
13192
|
+
headers["X-Schematic-Components-Version"] = "0.7.3";
|
|
13116
13193
|
headers["X-Schematic-Session-ID"] = sessionIdRef.current;
|
|
13117
13194
|
const config = new Configuration({
|
|
13118
13195
|
...apiConfig,
|
|
@@ -13451,9 +13528,6 @@ function useWrapChildren(elements) {
|
|
|
13451
13528
|
return shouldWrap.some((wrap) => wrap);
|
|
13452
13529
|
}
|
|
13453
13530
|
|
|
13454
|
-
// src/components/layout/card/Card.tsx
|
|
13455
|
-
var import_react20 = require("react");
|
|
13456
|
-
|
|
13457
13531
|
// src/components/ui/box/styles.ts
|
|
13458
13532
|
var Box = dt.div((props) => {
|
|
13459
13533
|
function reducer(acc, [key, value]) {
|
|
@@ -13668,6 +13742,8 @@ var EmbedButton = dt(Button2)`
|
|
|
13668
13742
|
font-family: "Public Sans", sans-serif;
|
|
13669
13743
|
font-weight: 500;
|
|
13670
13744
|
text-align: center;
|
|
13745
|
+
display: flex;
|
|
13746
|
+
align-items: center;
|
|
13671
13747
|
|
|
13672
13748
|
${({ disabled, $color = "primary", theme }) => {
|
|
13673
13749
|
const { l: l2 } = hexToHSL(theme[$color]);
|
|
@@ -13815,6 +13891,24 @@ var EmbedButton = dt(Button2)`
|
|
|
13815
13891
|
`;
|
|
13816
13892
|
}
|
|
13817
13893
|
}}
|
|
13894
|
+
|
|
13895
|
+
${({ $selfAlignment = "center" }) => {
|
|
13896
|
+
switch ($selfAlignment) {
|
|
13897
|
+
case "start":
|
|
13898
|
+
return lt`
|
|
13899
|
+
align-self: start;
|
|
13900
|
+
`;
|
|
13901
|
+
case "end":
|
|
13902
|
+
return lt`
|
|
13903
|
+
align-self: end;
|
|
13904
|
+
`;
|
|
13905
|
+
case "center":
|
|
13906
|
+
default:
|
|
13907
|
+
return lt`
|
|
13908
|
+
align-self: center;
|
|
13909
|
+
`;
|
|
13910
|
+
}
|
|
13911
|
+
}}
|
|
13818
13912
|
|
|
13819
13913
|
${({ $fullWidth = true }) => {
|
|
13820
13914
|
if ($fullWidth) {
|
|
@@ -17400,7 +17494,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
17400
17494
|
promoCode: updates.promoCode || promoCode
|
|
17401
17495
|
}
|
|
17402
17496
|
});
|
|
17403
|
-
setCharges(data2);
|
|
17497
|
+
setCharges(data2.finance);
|
|
17404
17498
|
} catch (error2) {
|
|
17405
17499
|
if (error2 instanceof ResponseError && error2.response.status === 401) {
|
|
17406
17500
|
const data2 = await error2.response.json();
|
|
@@ -18325,9 +18419,72 @@ var Viewport = (0, import_react30.forwardRef)(
|
|
|
18325
18419
|
);
|
|
18326
18420
|
Viewport.displayName = "Viewport";
|
|
18327
18421
|
|
|
18328
|
-
// src/components/elements/
|
|
18329
|
-
var import_react31 = require("react");
|
|
18422
|
+
// src/components/elements/button/Button.tsx
|
|
18330
18423
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
18424
|
+
var resolveDesignProps = (props) => {
|
|
18425
|
+
return {
|
|
18426
|
+
button: {
|
|
18427
|
+
link: props.button?.link ?? "",
|
|
18428
|
+
openInNewTab: props.button?.openInNewTab ?? true,
|
|
18429
|
+
text: props.button?.text ?? "Button",
|
|
18430
|
+
style: props.button?.style ?? "primary",
|
|
18431
|
+
size: props.button?.size ?? "md",
|
|
18432
|
+
fullWidth: props.button?.fullWidth ?? true,
|
|
18433
|
+
alignment: props.button?.alignment ?? "center",
|
|
18434
|
+
selfAlignment: props.button?.selfAlignment ?? "center"
|
|
18435
|
+
}
|
|
18436
|
+
};
|
|
18437
|
+
};
|
|
18438
|
+
var ButtonElement = (0, import_react31.forwardRef)(({ children, className, ...rest }, ref) => {
|
|
18439
|
+
const props = resolveDesignProps(rest);
|
|
18440
|
+
const buttonStyles = {
|
|
18441
|
+
primary: {
|
|
18442
|
+
color: "primary",
|
|
18443
|
+
variant: "filled"
|
|
18444
|
+
},
|
|
18445
|
+
secondary: {
|
|
18446
|
+
color: "primary",
|
|
18447
|
+
variant: "outline"
|
|
18448
|
+
},
|
|
18449
|
+
tertiary: {
|
|
18450
|
+
color: "primary",
|
|
18451
|
+
variant: "text"
|
|
18452
|
+
}
|
|
18453
|
+
};
|
|
18454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
18455
|
+
Element,
|
|
18456
|
+
{
|
|
18457
|
+
as: Flex,
|
|
18458
|
+
ref,
|
|
18459
|
+
className,
|
|
18460
|
+
$flexDirection: "column",
|
|
18461
|
+
$gap: "2rem",
|
|
18462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
18463
|
+
EmbedButton,
|
|
18464
|
+
{
|
|
18465
|
+
as: "a",
|
|
18466
|
+
href: props.button.link,
|
|
18467
|
+
target: props.button.openInNewTab ? "_blank" : "_self",
|
|
18468
|
+
$size: props.button.size,
|
|
18469
|
+
$color: buttonStyles[props.button.style].color,
|
|
18470
|
+
$variant: buttonStyles[props.button.style].variant,
|
|
18471
|
+
$alignment: props.button.alignment,
|
|
18472
|
+
$selfAlignment: props.button.selfAlignment,
|
|
18473
|
+
$fullWidth: props.button.fullWidth,
|
|
18474
|
+
children: props.button.text
|
|
18475
|
+
}
|
|
18476
|
+
)
|
|
18477
|
+
}
|
|
18478
|
+
);
|
|
18479
|
+
});
|
|
18480
|
+
ButtonElement.displayName = "Button";
|
|
18481
|
+
|
|
18482
|
+
// src/components/elements/included-features/IncludedFeatures.tsx
|
|
18483
|
+
var import_react33 = require("react");
|
|
18484
|
+
|
|
18485
|
+
// src/components/elements/included-features/Details.tsx
|
|
18486
|
+
var import_react32 = require("react");
|
|
18487
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
18331
18488
|
var Details = ({
|
|
18332
18489
|
shouldWrapChildren,
|
|
18333
18490
|
featureUsage,
|
|
@@ -18345,7 +18502,7 @@ var Details = ({
|
|
|
18345
18502
|
const { t: t2 } = useTranslation();
|
|
18346
18503
|
const theme = nt();
|
|
18347
18504
|
const { data } = useEmbed();
|
|
18348
|
-
const { price, currency } = (0,
|
|
18505
|
+
const { price, currency } = (0, import_react32.useMemo)(() => {
|
|
18349
18506
|
const { price: entitlementPrice, currency: entitlementCurrency } = getBillingPrice(
|
|
18350
18507
|
data.company?.plan?.planPeriod === "year" ? yearlyUsageBasedPrice : monthlyUsageBasedPrice
|
|
18351
18508
|
) || {};
|
|
@@ -18355,7 +18512,7 @@ var Details = ({
|
|
|
18355
18512
|
monthlyUsageBasedPrice,
|
|
18356
18513
|
yearlyUsageBasedPrice
|
|
18357
18514
|
]);
|
|
18358
|
-
const text = (0,
|
|
18515
|
+
const text = (0, import_react32.useMemo)(() => {
|
|
18359
18516
|
if (!feature) {
|
|
18360
18517
|
return;
|
|
18361
18518
|
}
|
|
@@ -18375,7 +18532,7 @@ var Details = ({
|
|
|
18375
18532
|
return t2("Unlimited", { item: getFeatureName(feature) });
|
|
18376
18533
|
}
|
|
18377
18534
|
}, [t2, allocation, feature, price, priceBehavior, currency, softLimit]);
|
|
18378
|
-
const usageText = (0,
|
|
18535
|
+
const usageText = (0, import_react32.useMemo)(() => {
|
|
18379
18536
|
if (!feature) {
|
|
18380
18537
|
return;
|
|
18381
18538
|
}
|
|
@@ -18419,14 +18576,14 @@ var Details = ({
|
|
|
18419
18576
|
if (!text) {
|
|
18420
18577
|
return null;
|
|
18421
18578
|
}
|
|
18422
|
-
return /* @__PURE__ */ (0,
|
|
18579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
18423
18580
|
Box,
|
|
18424
18581
|
{
|
|
18425
18582
|
$flexBasis: "min-content",
|
|
18426
18583
|
$flexGrow: "1",
|
|
18427
18584
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
18428
18585
|
children: [
|
|
18429
|
-
props.entitlement.isVisible && /* @__PURE__ */ (0,
|
|
18586
|
+
props.entitlement.isVisible && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
18430
18587
|
Text,
|
|
18431
18588
|
{
|
|
18432
18589
|
$font: theme.typography[props.entitlement.fontStyle].fontFamily,
|
|
@@ -18437,7 +18594,7 @@ var Details = ({
|
|
|
18437
18594
|
children: text
|
|
18438
18595
|
}
|
|
18439
18596
|
) }),
|
|
18440
|
-
props.usage.isVisible && usageText && /* @__PURE__ */ (0,
|
|
18597
|
+
props.usage.isVisible && usageText && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
18441
18598
|
Text,
|
|
18442
18599
|
{
|
|
18443
18600
|
$font: theme.typography[props.usage.fontStyle].fontFamily,
|
|
@@ -18454,8 +18611,8 @@ var Details = ({
|
|
|
18454
18611
|
};
|
|
18455
18612
|
|
|
18456
18613
|
// src/components/elements/included-features/IncludedFeatures.tsx
|
|
18457
|
-
var
|
|
18458
|
-
function
|
|
18614
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
18615
|
+
function resolveDesignProps2(props) {
|
|
18459
18616
|
return {
|
|
18460
18617
|
header: {
|
|
18461
18618
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -18483,16 +18640,16 @@ function resolveDesignProps(props) {
|
|
|
18483
18640
|
visibleFeatures: props.visibleFeatures
|
|
18484
18641
|
};
|
|
18485
18642
|
}
|
|
18486
|
-
var IncludedFeatures = (0,
|
|
18487
|
-
const props =
|
|
18643
|
+
var IncludedFeatures = (0, import_react33.forwardRef)(({ className, ...rest }, ref) => {
|
|
18644
|
+
const props = resolveDesignProps2(rest);
|
|
18488
18645
|
const { t: t2 } = useTranslation();
|
|
18489
18646
|
const theme = nt();
|
|
18490
18647
|
const { data } = useEmbed();
|
|
18491
|
-
const elements = (0,
|
|
18648
|
+
const elements = (0, import_react33.useRef)([]);
|
|
18492
18649
|
const shouldWrapChildren = useWrapChildren(elements.current);
|
|
18493
18650
|
const isLightBackground = useIsLightBackground();
|
|
18494
|
-
const [showCount, setShowCount] = (0,
|
|
18495
|
-
const featureUsage = (0,
|
|
18651
|
+
const [showCount, setShowCount] = (0, import_react33.useState)(VISIBLE_ENTITLEMENT_COUNT);
|
|
18652
|
+
const featureUsage = (0, import_react33.useMemo)(() => {
|
|
18496
18653
|
const orderedFeatureUsage = props.visibleFeatures?.reduce(
|
|
18497
18654
|
(acc, id) => {
|
|
18498
18655
|
const mappedFeatureUsage = data.featureUsage?.features.find(
|
|
@@ -18519,7 +18676,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18519
18676
|
}
|
|
18520
18677
|
const shouldShowExpand = featureListSize > VISIBLE_ENTITLEMENT_COUNT;
|
|
18521
18678
|
const isExpanded = showCount > VISIBLE_ENTITLEMENT_COUNT;
|
|
18522
|
-
return /* @__PURE__ */ (0,
|
|
18679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
18523
18680
|
Element,
|
|
18524
18681
|
{
|
|
18525
18682
|
as: Flex,
|
|
@@ -18528,7 +18685,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18528
18685
|
$flexDirection: "column",
|
|
18529
18686
|
$gap: "1rem",
|
|
18530
18687
|
children: [
|
|
18531
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
18688
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
18532
18689
|
Text,
|
|
18533
18690
|
{
|
|
18534
18691
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -18541,7 +18698,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18541
18698
|
featureUsage.slice(0, showCount).map((usage, index) => {
|
|
18542
18699
|
const feature = usage.feature;
|
|
18543
18700
|
const shouldShowDetails = feature?.name && (feature?.featureType === "event" || feature?.featureType === "trait");
|
|
18544
|
-
return /* @__PURE__ */ (0,
|
|
18701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
18545
18702
|
Flex,
|
|
18546
18703
|
{
|
|
18547
18704
|
ref: (el) => {
|
|
@@ -18554,7 +18711,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18554
18711
|
$alignItems: "center",
|
|
18555
18712
|
$gap: "1rem",
|
|
18556
18713
|
children: [
|
|
18557
|
-
/* @__PURE__ */ (0,
|
|
18714
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
18558
18715
|
Flex,
|
|
18559
18716
|
{
|
|
18560
18717
|
$alignItems: "center",
|
|
@@ -18562,7 +18719,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18562
18719
|
$flexBasis: "min-content",
|
|
18563
18720
|
$gap: "1rem",
|
|
18564
18721
|
children: [
|
|
18565
|
-
props.icons.isVisible && feature?.icon && /* @__PURE__ */ (0,
|
|
18722
|
+
props.icons.isVisible && feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
18566
18723
|
IconRound,
|
|
18567
18724
|
{
|
|
18568
18725
|
name: feature.icon,
|
|
@@ -18573,7 +18730,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18573
18730
|
]
|
|
18574
18731
|
}
|
|
18575
18732
|
),
|
|
18576
|
-
feature?.name && /* @__PURE__ */ (0,
|
|
18733
|
+
feature?.name && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
18577
18734
|
Text,
|
|
18578
18735
|
{
|
|
18579
18736
|
$font: theme.typography[props.icons.fontStyle].fontFamily,
|
|
@@ -18583,7 +18740,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18583
18740
|
children: feature.name
|
|
18584
18741
|
}
|
|
18585
18742
|
),
|
|
18586
|
-
props.entitlementExpiration.isVisible && usage.entitlementExpirationDate && /* @__PURE__ */ (0,
|
|
18743
|
+
props.entitlementExpiration.isVisible && usage.entitlementExpirationDate && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
18587
18744
|
Text,
|
|
18588
18745
|
{
|
|
18589
18746
|
$font: theme.typography[props.entitlementExpiration.fontStyle].fontFamily,
|
|
@@ -18603,7 +18760,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18603
18760
|
]
|
|
18604
18761
|
}
|
|
18605
18762
|
),
|
|
18606
|
-
shouldShowDetails && /* @__PURE__ */ (0,
|
|
18763
|
+
shouldShowDetails && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
18607
18764
|
Details,
|
|
18608
18765
|
{
|
|
18609
18766
|
featureUsage: usage,
|
|
@@ -18616,8 +18773,8 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18616
18773
|
index
|
|
18617
18774
|
);
|
|
18618
18775
|
}),
|
|
18619
|
-
shouldShowExpand && /* @__PURE__ */ (0,
|
|
18620
|
-
/* @__PURE__ */ (0,
|
|
18776
|
+
shouldShowExpand && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $alignItems: "center", $justifyContent: "start", $marginTop: "1rem", children: [
|
|
18777
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
18621
18778
|
Icon2,
|
|
18622
18779
|
{
|
|
18623
18780
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -18629,7 +18786,7 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18629
18786
|
}
|
|
18630
18787
|
}
|
|
18631
18788
|
),
|
|
18632
|
-
/* @__PURE__ */ (0,
|
|
18789
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
18633
18790
|
Text,
|
|
18634
18791
|
{
|
|
18635
18792
|
onClick: handleToggleShowAll,
|
|
@@ -18650,9 +18807,9 @@ var IncludedFeatures = (0, import_react32.forwardRef)(({ className, ...rest }, r
|
|
|
18650
18807
|
IncludedFeatures.displayName = "IncludedFeatures";
|
|
18651
18808
|
|
|
18652
18809
|
// src/components/elements/invoices/Invoices.tsx
|
|
18653
|
-
var
|
|
18654
|
-
var
|
|
18655
|
-
function
|
|
18810
|
+
var import_react34 = require("react");
|
|
18811
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
18812
|
+
function resolveDesignProps3(props) {
|
|
18656
18813
|
return {
|
|
18657
18814
|
header: {
|
|
18658
18815
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -18685,7 +18842,7 @@ function formatInvoices(invoices = []) {
|
|
|
18685
18842
|
}
|
|
18686
18843
|
var InvoiceDate = ({ date, fontStyle, url }) => {
|
|
18687
18844
|
const theme = nt();
|
|
18688
|
-
const dateText = /* @__PURE__ */ (0,
|
|
18845
|
+
const dateText = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18689
18846
|
Text,
|
|
18690
18847
|
{
|
|
18691
18848
|
...url && { onClick: () => {
|
|
@@ -18698,23 +18855,23 @@ var InvoiceDate = ({ date, fontStyle, url }) => {
|
|
|
18698
18855
|
}
|
|
18699
18856
|
);
|
|
18700
18857
|
if (url) {
|
|
18701
|
-
return /* @__PURE__ */ (0,
|
|
18858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("a", { href: url, target: "_blank", rel: "noreferrer", children: dateText });
|
|
18702
18859
|
}
|
|
18703
18860
|
return dateText;
|
|
18704
18861
|
};
|
|
18705
|
-
var Invoices = (0,
|
|
18706
|
-
const props =
|
|
18862
|
+
var Invoices = (0, import_react34.forwardRef)(({ className, data, ...rest }, ref) => {
|
|
18863
|
+
const props = resolveDesignProps3(rest);
|
|
18707
18864
|
const { t: t2 } = useTranslation();
|
|
18708
18865
|
const theme = nt();
|
|
18709
18866
|
const { api } = useEmbed();
|
|
18710
|
-
const [invoices, setInvoices] = (0,
|
|
18711
|
-
const [listSize, setListSize] = (0,
|
|
18867
|
+
const [invoices, setInvoices] = (0, import_react34.useState)(() => formatInvoices(data));
|
|
18868
|
+
const [listSize, setListSize] = (0, import_react34.useState)(props.limit.number);
|
|
18712
18869
|
const toggleListSize = () => {
|
|
18713
18870
|
setListSize(
|
|
18714
18871
|
(prev2) => prev2 !== props.limit.number ? props.limit.number : MAX_VISIBLE_INVOICE_COUNT
|
|
18715
18872
|
);
|
|
18716
18873
|
};
|
|
18717
|
-
(0,
|
|
18874
|
+
(0, import_react34.useEffect)(() => {
|
|
18718
18875
|
api?.listInvoices().then(({ data: data2 }) => {
|
|
18719
18876
|
setInvoices(formatInvoices(data2));
|
|
18720
18877
|
});
|
|
@@ -18722,8 +18879,8 @@ var Invoices = (0, import_react33.forwardRef)(({ className, data, ...rest }, ref
|
|
|
18722
18879
|
if (invoices.length === 0) {
|
|
18723
18880
|
return null;
|
|
18724
18881
|
}
|
|
18725
|
-
return /* @__PURE__ */ (0,
|
|
18726
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
18882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Element, { ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
18883
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18727
18884
|
Text,
|
|
18728
18885
|
{
|
|
18729
18886
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -18733,9 +18890,9 @@ var Invoices = (0, import_react33.forwardRef)(({ className, data, ...rest }, ref
|
|
|
18733
18890
|
children: t2("Invoices")
|
|
18734
18891
|
}
|
|
18735
18892
|
) }),
|
|
18736
|
-
/* @__PURE__ */ (0,
|
|
18737
|
-
return /* @__PURE__ */ (0,
|
|
18738
|
-
props.date.isVisible && date && /* @__PURE__ */ (0,
|
|
18893
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, url }, index) => {
|
|
18894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $justifyContent: "space-between", children: [
|
|
18895
|
+
props.date.isVisible && date && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18739
18896
|
InvoiceDate,
|
|
18740
18897
|
{
|
|
18741
18898
|
date,
|
|
@@ -18743,7 +18900,7 @@ var Invoices = (0, import_react33.forwardRef)(({ className, data, ...rest }, ref
|
|
|
18743
18900
|
url
|
|
18744
18901
|
}
|
|
18745
18902
|
),
|
|
18746
|
-
props.amount.isVisible && /* @__PURE__ */ (0,
|
|
18903
|
+
props.amount.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18747
18904
|
Text,
|
|
18748
18905
|
{
|
|
18749
18906
|
$font: theme.typography[props.amount.fontStyle].fontFamily,
|
|
@@ -18755,15 +18912,15 @@ var Invoices = (0, import_react33.forwardRef)(({ className, data, ...rest }, ref
|
|
|
18755
18912
|
)
|
|
18756
18913
|
] }, index);
|
|
18757
18914
|
}) }),
|
|
18758
|
-
props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ (0,
|
|
18759
|
-
/* @__PURE__ */ (0,
|
|
18915
|
+
props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
18916
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18760
18917
|
Icon2,
|
|
18761
18918
|
{
|
|
18762
18919
|
name: `chevron-${listSize === props.limit.number ? "down" : "up"}`,
|
|
18763
18920
|
style: { color: "#D0D0D0" }
|
|
18764
18921
|
}
|
|
18765
18922
|
),
|
|
18766
|
-
/* @__PURE__ */ (0,
|
|
18923
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18767
18924
|
Text,
|
|
18768
18925
|
{
|
|
18769
18926
|
onClick: toggleListSize,
|
|
@@ -18780,7 +18937,7 @@ var Invoices = (0, import_react33.forwardRef)(({ className, data, ...rest }, ref
|
|
|
18780
18937
|
Invoices.displayName = "Invoices";
|
|
18781
18938
|
|
|
18782
18939
|
// src/components/elements/metered-features/MeteredFeatures.tsx
|
|
18783
|
-
var
|
|
18940
|
+
var import_react35 = require("react");
|
|
18784
18941
|
|
|
18785
18942
|
// src/components/elements/metered-features/styles.ts
|
|
18786
18943
|
var Container4 = dt.div`
|
|
@@ -18823,8 +18980,8 @@ var Container4 = dt.div`
|
|
|
18823
18980
|
`;
|
|
18824
18981
|
|
|
18825
18982
|
// src/components/elements/metered-features/MeteredFeatures.tsx
|
|
18826
|
-
var
|
|
18827
|
-
function
|
|
18983
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
18984
|
+
function resolveDesignProps4(props) {
|
|
18828
18985
|
return {
|
|
18829
18986
|
isVisible: props.isVisible ?? true,
|
|
18830
18987
|
header: {
|
|
@@ -18849,15 +19006,15 @@ function resolveDesignProps3(props) {
|
|
|
18849
19006
|
visibleFeatures: props.visibleFeatures
|
|
18850
19007
|
};
|
|
18851
19008
|
}
|
|
18852
|
-
var MeteredFeatures = (0,
|
|
18853
|
-
const props =
|
|
18854
|
-
const elements = (0,
|
|
19009
|
+
var MeteredFeatures = (0, import_react35.forwardRef)(({ className, ...rest }, ref) => {
|
|
19010
|
+
const props = resolveDesignProps4(rest);
|
|
19011
|
+
const elements = (0, import_react35.useRef)([]);
|
|
18855
19012
|
const shouldWrapChildren = useWrapChildren(elements.current);
|
|
18856
19013
|
const { t: t2 } = useTranslation();
|
|
18857
19014
|
const theme = nt();
|
|
18858
19015
|
const { data, setLayout, setSelected } = useEmbed();
|
|
18859
19016
|
const isLightBackground = useIsLightBackground();
|
|
18860
|
-
const featureUsage = (0,
|
|
19017
|
+
const featureUsage = (0, import_react35.useMemo)(() => {
|
|
18861
19018
|
const orderedFeatureUsage = props.visibleFeatures?.reduce(
|
|
18862
19019
|
(acc, id) => {
|
|
18863
19020
|
const mappedFeatureUsage = data.featureUsage?.features.find(
|
|
@@ -18879,7 +19036,7 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18879
19036
|
if (!shouldShowFeatures) {
|
|
18880
19037
|
return null;
|
|
18881
19038
|
}
|
|
18882
|
-
return /* @__PURE__ */ (0,
|
|
19039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Container4, { ref, className, children: featureUsage.map(
|
|
18883
19040
|
({
|
|
18884
19041
|
feature,
|
|
18885
19042
|
priceBehavior,
|
|
@@ -18895,7 +19052,7 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18895
19052
|
const { price, currency } = getBillingPrice(
|
|
18896
19053
|
planPeriod === "year" ? yearlyUsageBasedPrice : monthlyUsageBasedPrice
|
|
18897
19054
|
) || {};
|
|
18898
|
-
const progressBar = props.isVisible && typeof usage === "number" && limit > 0 && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */ (0,
|
|
19055
|
+
const progressBar = props.isVisible && typeof usage === "number" && limit > 0 && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18899
19056
|
ProgressBar,
|
|
18900
19057
|
{
|
|
18901
19058
|
progress: (isOverage ? softLimit / usage : usage / limit) * 100,
|
|
@@ -18908,8 +19065,8 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18908
19065
|
$flexGrow: 1
|
|
18909
19066
|
}
|
|
18910
19067
|
);
|
|
18911
|
-
return /* @__PURE__ */ (0,
|
|
18912
|
-
priceBehavior === "overage" && typeof price === "number" && /* @__PURE__ */ (0,
|
|
19068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { $flexDirection: "column-reverse", children: [
|
|
19069
|
+
priceBehavior === "overage" && typeof price === "number" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
18913
19070
|
Flex,
|
|
18914
19071
|
{
|
|
18915
19072
|
$justifyContent: "space-between",
|
|
@@ -18921,7 +19078,7 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18921
19078
|
$borderBottomRightRadius: `${theme.card.borderRadius / TEXT_BASE_SIZE}rem`
|
|
18922
19079
|
},
|
|
18923
19080
|
children: [
|
|
18924
|
-
/* @__PURE__ */ (0,
|
|
19081
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18925
19082
|
Text,
|
|
18926
19083
|
{
|
|
18927
19084
|
$font: theme.typography.text.fontFamily,
|
|
@@ -18929,14 +19086,14 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18929
19086
|
$weight: theme.typography.text.fontWeight,
|
|
18930
19087
|
$color: theme.typography.text.color,
|
|
18931
19088
|
$leading: 1.35,
|
|
18932
|
-
children: /* @__PURE__ */ (0,
|
|
19089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
18933
19090
|
t2("Overage fee"),
|
|
18934
19091
|
": ",
|
|
18935
19092
|
formatCurrency(price, currency),
|
|
18936
|
-
feature && /* @__PURE__ */ (0,
|
|
19093
|
+
feature && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box, { as: "sub", $whiteSpace: "nowrap", children: [
|
|
18937
19094
|
"/",
|
|
18938
19095
|
getFeatureName(feature, 1),
|
|
18939
|
-
feature.featureType === "trait" && planPeriod && /* @__PURE__ */ (0,
|
|
19096
|
+
feature.featureType === "trait" && planPeriod && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
18940
19097
|
"/",
|
|
18941
19098
|
shortenPeriod(planPeriod)
|
|
18942
19099
|
] })
|
|
@@ -18944,7 +19101,7 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18944
19101
|
] })
|
|
18945
19102
|
}
|
|
18946
19103
|
),
|
|
18947
|
-
isOverage && /* @__PURE__ */ (0,
|
|
19104
|
+
isOverage && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
18948
19105
|
Text,
|
|
18949
19106
|
{
|
|
18950
19107
|
$font: theme.typography.text.fontFamily,
|
|
@@ -18958,7 +19115,7 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18958
19115
|
}),
|
|
18959
19116
|
" \xB7 ",
|
|
18960
19117
|
formatCurrency(price * (usage - softLimit), currency),
|
|
18961
|
-
feature?.featureType === "trait" && typeof planPeriod === "string" && /* @__PURE__ */ (0,
|
|
19118
|
+
feature?.featureType === "trait" && typeof planPeriod === "string" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box, { as: "sub", $whiteSpace: "nowrap", children: [
|
|
18962
19119
|
"/",
|
|
18963
19120
|
shortenPeriod(planPeriod)
|
|
18964
19121
|
] })
|
|
@@ -18968,8 +19125,8 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18968
19125
|
]
|
|
18969
19126
|
}
|
|
18970
19127
|
),
|
|
18971
|
-
/* @__PURE__ */ (0,
|
|
18972
|
-
props.icon.isVisible && feature?.icon && /* @__PURE__ */ (0,
|
|
19128
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Element, { as: Flex, $gap: "1.5rem", children: [
|
|
19129
|
+
props.icon.isVisible && feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18973
19130
|
IconRound,
|
|
18974
19131
|
{
|
|
18975
19132
|
name: feature.icon,
|
|
@@ -18980,8 +19137,8 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18980
19137
|
]
|
|
18981
19138
|
}
|
|
18982
19139
|
),
|
|
18983
|
-
/* @__PURE__ */ (0,
|
|
18984
|
-
/* @__PURE__ */ (0,
|
|
19140
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", $flexGrow: 1, children: [
|
|
19141
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
18985
19142
|
Flex,
|
|
18986
19143
|
{
|
|
18987
19144
|
ref: (el) => {
|
|
@@ -18992,8 +19149,8 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
18992
19149
|
$flexWrap: "wrap",
|
|
18993
19150
|
$gap: "1rem",
|
|
18994
19151
|
children: [
|
|
18995
|
-
feature?.name && /* @__PURE__ */ (0,
|
|
18996
|
-
/* @__PURE__ */ (0,
|
|
19152
|
+
feature?.name && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
|
|
19153
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18997
19154
|
Text,
|
|
18998
19155
|
{
|
|
18999
19156
|
as: Box,
|
|
@@ -19002,14 +19159,14 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
19002
19159
|
$weight: theme.typography[props.header.fontStyle].fontWeight,
|
|
19003
19160
|
$color: theme.typography[props.header.fontStyle].color,
|
|
19004
19161
|
$leading: 1.35,
|
|
19005
|
-
children: priceBehavior === "pay_as_you_go" ? typeof usage === "number" && /* @__PURE__ */ (0,
|
|
19162
|
+
children: priceBehavior === "pay_as_you_go" ? typeof usage === "number" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
19006
19163
|
formatNumber(usage),
|
|
19007
19164
|
" ",
|
|
19008
19165
|
getFeatureName(feature, usage)
|
|
19009
19166
|
] }) : feature.name
|
|
19010
19167
|
}
|
|
19011
19168
|
),
|
|
19012
|
-
props.description.isVisible && /* @__PURE__ */ (0,
|
|
19169
|
+
props.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
19013
19170
|
Text,
|
|
19014
19171
|
{
|
|
19015
19172
|
as: Box,
|
|
@@ -19021,14 +19178,14 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
19021
19178
|
}
|
|
19022
19179
|
)
|
|
19023
19180
|
] }),
|
|
19024
|
-
(feature?.featureType === "event" || feature?.featureType === "trait") && feature?.name && /* @__PURE__ */ (0,
|
|
19181
|
+
(feature?.featureType === "event" || feature?.featureType === "trait") && feature?.name && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
19025
19182
|
Box,
|
|
19026
19183
|
{
|
|
19027
19184
|
$flexBasis: "min-content",
|
|
19028
19185
|
$flexGrow: 1,
|
|
19029
19186
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
19030
19187
|
children: [
|
|
19031
|
-
props.usage.isVisible && /* @__PURE__ */ (0,
|
|
19188
|
+
props.usage.isVisible && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
19032
19189
|
Text,
|
|
19033
19190
|
{
|
|
19034
19191
|
as: Box,
|
|
@@ -19037,22 +19194,22 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
19037
19194
|
$weight: theme.typography[props.usage.fontStyle].fontWeight,
|
|
19038
19195
|
$color: theme.typography[props.usage.fontStyle].color,
|
|
19039
19196
|
$leading: 1.35,
|
|
19040
|
-
children: priceBehavior === "pay_in_advance" ? typeof allocation === "number" && /* @__PURE__ */ (0,
|
|
19197
|
+
children: priceBehavior === "pay_in_advance" ? typeof allocation === "number" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
19041
19198
|
formatNumber(allocation),
|
|
19042
19199
|
" ",
|
|
19043
19200
|
getFeatureName(feature, allocation)
|
|
19044
|
-
] }) : priceBehavior === "pay_as_you_go" ? typeof price === "number" && typeof usage === "number" && formatCurrency(usage * price, currency) : typeof usage === "number" && /* @__PURE__ */ (0,
|
|
19201
|
+
] }) : priceBehavior === "pay_as_you_go" ? typeof price === "number" && typeof usage === "number" && formatCurrency(usage * price, currency) : typeof usage === "number" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
19045
19202
|
formatNumber(usage),
|
|
19046
19203
|
" ",
|
|
19047
19204
|
getFeatureName(feature, usage),
|
|
19048
|
-
priceBehavior === "overage" && /* @__PURE__ */ (0,
|
|
19205
|
+
priceBehavior === "overage" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
19049
19206
|
" ",
|
|
19050
19207
|
t2("used")
|
|
19051
19208
|
] })
|
|
19052
19209
|
] })
|
|
19053
19210
|
}
|
|
19054
19211
|
),
|
|
19055
|
-
props.allocation.isVisible && priceBehavior !== "overage" && /* @__PURE__ */ (0,
|
|
19212
|
+
props.allocation.isVisible && priceBehavior !== "overage" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
19056
19213
|
Text,
|
|
19057
19214
|
{
|
|
19058
19215
|
$font: theme.typography[props.allocation.fontStyle].fontFamily,
|
|
@@ -19077,12 +19234,12 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
19077
19234
|
]
|
|
19078
19235
|
}
|
|
19079
19236
|
),
|
|
19080
|
-
props.isVisible && typeof usage === "number" && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */ (0,
|
|
19081
|
-
typeof allocation === "number" ? /* @__PURE__ */ (0,
|
|
19237
|
+
props.isVisible && typeof usage === "number" && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { $gap: "2rem", children: [
|
|
19238
|
+
typeof allocation === "number" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
19082
19239
|
Tooltip,
|
|
19083
19240
|
{
|
|
19084
19241
|
trigger: progressBar,
|
|
19085
|
-
content: /* @__PURE__ */ (0,
|
|
19242
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
19086
19243
|
Text,
|
|
19087
19244
|
{
|
|
19088
19245
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19099,7 +19256,7 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
19099
19256
|
$flexGrow: 1
|
|
19100
19257
|
}
|
|
19101
19258
|
) : progressBar,
|
|
19102
|
-
priceBehavior === "pay_in_advance" && /* @__PURE__ */ (0,
|
|
19259
|
+
priceBehavior === "pay_in_advance" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
19103
19260
|
EmbedButton,
|
|
19104
19261
|
{
|
|
19105
19262
|
onClick: () => {
|
|
@@ -19123,11 +19280,11 @@ var MeteredFeatures = (0, import_react34.forwardRef)(({ className, ...rest }, re
|
|
|
19123
19280
|
MeteredFeatures.displayName = "MeteredFeatures";
|
|
19124
19281
|
|
|
19125
19282
|
// src/components/elements/payment-method/PaymentMethod.tsx
|
|
19126
|
-
var
|
|
19283
|
+
var import_react37 = require("react");
|
|
19127
19284
|
|
|
19128
19285
|
// src/components/elements/payment-method/PaymentMethodElement.tsx
|
|
19129
|
-
var
|
|
19130
|
-
var
|
|
19286
|
+
var import_react36 = require("react");
|
|
19287
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
19131
19288
|
var PaymentElement2 = ({
|
|
19132
19289
|
iconName,
|
|
19133
19290
|
iconTitle,
|
|
@@ -19136,17 +19293,17 @@ var PaymentElement2 = ({
|
|
|
19136
19293
|
paymentLast4
|
|
19137
19294
|
}) => {
|
|
19138
19295
|
const theme = nt();
|
|
19139
|
-
return /* @__PURE__ */ (0,
|
|
19140
|
-
iconName && /* @__PURE__ */ (0,
|
|
19141
|
-
/* @__PURE__ */ (0,
|
|
19142
|
-
/* @__PURE__ */ (0,
|
|
19143
|
-
paymentLast4 && /* @__PURE__ */ (0,
|
|
19296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { $font: theme.typography.text.fontFamily, $size: 16, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
|
|
19297
|
+
iconName && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon2, { name: iconName, title: iconTitle, style: iconStyles }) }),
|
|
19298
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { $alignItems: "center", children: [
|
|
19299
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { $lineHeight: "1", $marginRight: "4px", children: t(label) }),
|
|
19300
|
+
paymentLast4 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { $display: "inline-block", $fontWeight: "bold", children: paymentLast4 })
|
|
19144
19301
|
] })
|
|
19145
19302
|
] }) });
|
|
19146
19303
|
};
|
|
19147
19304
|
var EmptyPaymentElement = () => {
|
|
19148
19305
|
const theme = nt();
|
|
19149
|
-
return /* @__PURE__ */ (0,
|
|
19306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { $font: theme.typography.text.fontFamily, $size: 16, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { $lineHeight: "1", $marginRight: "4px", children: t("No payment method selected") }) }) }) });
|
|
19150
19307
|
};
|
|
19151
19308
|
var getPaymentMethodData = ({
|
|
19152
19309
|
accountLast4,
|
|
@@ -19235,9 +19392,9 @@ var PaymentMethodElement = ({
|
|
|
19235
19392
|
if (size === "md") {
|
|
19236
19393
|
sizeFactor = 1;
|
|
19237
19394
|
}
|
|
19238
|
-
return /* @__PURE__ */ (0,
|
|
19239
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
19240
|
-
/* @__PURE__ */ (0,
|
|
19395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
|
|
19396
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
|
|
19397
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19241
19398
|
Text,
|
|
19242
19399
|
{
|
|
19243
19400
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -19247,7 +19404,7 @@ var PaymentMethodElement = ({
|
|
|
19247
19404
|
children: t2("Payment Method")
|
|
19248
19405
|
}
|
|
19249
19406
|
),
|
|
19250
|
-
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ (0,
|
|
19407
|
+
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19251
19408
|
Text,
|
|
19252
19409
|
{
|
|
19253
19410
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19258,7 +19415,7 @@ var PaymentMethodElement = ({
|
|
|
19258
19415
|
}
|
|
19259
19416
|
)
|
|
19260
19417
|
] }),
|
|
19261
|
-
/* @__PURE__ */ (0,
|
|
19418
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
19262
19419
|
Flex,
|
|
19263
19420
|
{
|
|
19264
19421
|
$justifyContent: "space-between",
|
|
@@ -19267,15 +19424,15 @@ var PaymentMethodElement = ({
|
|
|
19267
19424
|
$padding: `${sizeFactor / 2.2}rem ${sizeFactor}rem`,
|
|
19268
19425
|
$borderRadius: "9999px",
|
|
19269
19426
|
children: [
|
|
19270
|
-
paymentMethod && /* @__PURE__ */ (0,
|
|
19427
|
+
paymentMethod && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19271
19428
|
PaymentElement2,
|
|
19272
19429
|
{
|
|
19273
19430
|
...getPaymentMethodData(paymentMethod),
|
|
19274
19431
|
...getIconStyles({ size, theme })
|
|
19275
19432
|
}
|
|
19276
19433
|
),
|
|
19277
|
-
!paymentMethod && /* @__PURE__ */ (0,
|
|
19278
|
-
props.functions.allowEdit && onEdit && /* @__PURE__ */ (0,
|
|
19434
|
+
!paymentMethod && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EmptyPaymentElement, {}),
|
|
19435
|
+
props.functions.allowEdit && onEdit && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19279
19436
|
Text,
|
|
19280
19437
|
{
|
|
19281
19438
|
onClick: onEdit,
|
|
@@ -19301,7 +19458,7 @@ var PaymentListElement = ({
|
|
|
19301
19458
|
const isLightBackground = useIsLightBackground();
|
|
19302
19459
|
const { iconName, iconTitle, label, paymentLast4 } = getPaymentMethodData(paymentMethod);
|
|
19303
19460
|
const iconStyles = getIconStyles({ size: "lg", theme });
|
|
19304
|
-
const expirationDate = (0,
|
|
19461
|
+
const expirationDate = (0, import_react36.useMemo)(() => {
|
|
19305
19462
|
const { cardExpMonth, cardExpYear } = paymentMethod;
|
|
19306
19463
|
if (!cardExpMonth && !cardExpYear) {
|
|
19307
19464
|
return "";
|
|
@@ -19315,7 +19472,7 @@ var PaymentListElement = ({
|
|
|
19315
19472
|
}
|
|
19316
19473
|
return `${cardExpMonth}/${formatedYear}`;
|
|
19317
19474
|
}, [paymentMethod]);
|
|
19318
|
-
return /* @__PURE__ */ (0,
|
|
19475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
19319
19476
|
Flex,
|
|
19320
19477
|
{
|
|
19321
19478
|
$flexDirection: "row",
|
|
@@ -19329,8 +19486,8 @@ var PaymentListElement = ({
|
|
|
19329
19486
|
$font: theme.typography.text.fontFamily,
|
|
19330
19487
|
$color: theme.typography.text.color,
|
|
19331
19488
|
children: [
|
|
19332
|
-
/* @__PURE__ */ (0,
|
|
19333
|
-
/* @__PURE__ */ (0,
|
|
19489
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { $paddingLeft: "0.5rem", $paddingRight: "0.5rem", children: iconName && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon2, { name: iconName, title: iconTitle, style: iconStyles }) }),
|
|
19490
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { $flexGrow: "1", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
19334
19491
|
Text,
|
|
19335
19492
|
{
|
|
19336
19493
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19344,12 +19501,12 @@ var PaymentListElement = ({
|
|
|
19344
19501
|
]
|
|
19345
19502
|
}
|
|
19346
19503
|
) }),
|
|
19347
|
-
/* @__PURE__ */ (0,
|
|
19504
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19348
19505
|
Box,
|
|
19349
19506
|
{
|
|
19350
19507
|
$flexGrow: "1",
|
|
19351
19508
|
$color: isLightBackground ? "hsla(0, 0%, 0%, 0.375)" : "hsla(0, 0%, 100%, 0.375)",
|
|
19352
|
-
children: /* @__PURE__ */ (0,
|
|
19509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19353
19510
|
Text,
|
|
19354
19511
|
{
|
|
19355
19512
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19361,7 +19518,7 @@ var PaymentListElement = ({
|
|
|
19361
19518
|
)
|
|
19362
19519
|
}
|
|
19363
19520
|
),
|
|
19364
|
-
/* @__PURE__ */ (0,
|
|
19521
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19365
19522
|
Text,
|
|
19366
19523
|
{
|
|
19367
19524
|
onClick: () => {
|
|
@@ -19374,7 +19531,7 @@ var PaymentListElement = ({
|
|
|
19374
19531
|
children: t("Set default")
|
|
19375
19532
|
}
|
|
19376
19533
|
) }),
|
|
19377
|
-
/* @__PURE__ */ (0,
|
|
19534
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19378
19535
|
Box,
|
|
19379
19536
|
{
|
|
19380
19537
|
$cursor: "pointer",
|
|
@@ -19382,7 +19539,7 @@ var PaymentListElement = ({
|
|
|
19382
19539
|
onClick: () => {
|
|
19383
19540
|
handleDelete(paymentMethod.id);
|
|
19384
19541
|
},
|
|
19385
|
-
children: /* @__PURE__ */ (0,
|
|
19542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19386
19543
|
Icon2,
|
|
19387
19544
|
{
|
|
19388
19545
|
name: "close",
|
|
@@ -19400,8 +19557,8 @@ var PaymentListElement = ({
|
|
|
19400
19557
|
};
|
|
19401
19558
|
|
|
19402
19559
|
// src/components/elements/payment-method/PaymentMethod.tsx
|
|
19403
|
-
var
|
|
19404
|
-
var
|
|
19560
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
19561
|
+
var resolveDesignProps5 = (props) => {
|
|
19405
19562
|
return {
|
|
19406
19563
|
header: {
|
|
19407
19564
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -19413,13 +19570,13 @@ var resolveDesignProps4 = (props) => {
|
|
|
19413
19570
|
}
|
|
19414
19571
|
};
|
|
19415
19572
|
};
|
|
19416
|
-
var PaymentMethod = (0,
|
|
19417
|
-
const props =
|
|
19573
|
+
var PaymentMethod = (0, import_react37.forwardRef)(({ children, className, portal, allowEdit = true, ...rest }, ref) => {
|
|
19574
|
+
const props = resolveDesignProps5(rest);
|
|
19418
19575
|
const { data, setLayout } = useEmbed();
|
|
19419
|
-
const paymentMethod = (0,
|
|
19576
|
+
const paymentMethod = (0, import_react37.useMemo)(() => {
|
|
19420
19577
|
return data.subscription?.paymentMethod;
|
|
19421
19578
|
}, [data.subscription?.paymentMethod]);
|
|
19422
|
-
const monthsToExpiration = (0,
|
|
19579
|
+
const monthsToExpiration = (0, import_react37.useMemo)(() => {
|
|
19423
19580
|
let expiration;
|
|
19424
19581
|
if (typeof paymentMethod?.cardExpYear === "number" && typeof paymentMethod?.cardExpMonth === "number") {
|
|
19425
19582
|
const today = /* @__PURE__ */ new Date();
|
|
@@ -19432,7 +19589,7 @@ var PaymentMethod = (0, import_react36.forwardRef)(({ children, className, porta
|
|
|
19432
19589
|
}
|
|
19433
19590
|
return expiration;
|
|
19434
19591
|
}, [paymentMethod?.cardExpYear, paymentMethod?.cardExpMonth]);
|
|
19435
|
-
return /* @__PURE__ */ (0,
|
|
19592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
19436
19593
|
PaymentMethodElement,
|
|
19437
19594
|
{
|
|
19438
19595
|
paymentMethod,
|
|
@@ -19446,9 +19603,9 @@ PaymentMethod.displayName = "PaymentMethod";
|
|
|
19446
19603
|
|
|
19447
19604
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
19448
19605
|
var import_react_stripe_js2 = require("@stripe/react-stripe-js");
|
|
19449
|
-
var
|
|
19450
|
-
var
|
|
19451
|
-
var
|
|
19606
|
+
var import_react38 = require("react");
|
|
19607
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
19608
|
+
var resolveDesignProps6 = () => {
|
|
19452
19609
|
return {
|
|
19453
19610
|
header: {
|
|
19454
19611
|
isVisible: true,
|
|
@@ -19463,24 +19620,24 @@ var resolveDesignProps5 = () => {
|
|
|
19463
19620
|
var PaymentMethodDetails = ({
|
|
19464
19621
|
setPaymentMethodId
|
|
19465
19622
|
}) => {
|
|
19466
|
-
const props =
|
|
19623
|
+
const props = resolveDesignProps6();
|
|
19467
19624
|
const { t: t2 } = useTranslation();
|
|
19468
19625
|
const theme = nt();
|
|
19469
19626
|
const { api, data, setData } = useEmbed();
|
|
19470
19627
|
const isLightBackground = useIsLightBackground();
|
|
19471
|
-
const [isLoading, setIsLoading] = (0,
|
|
19472
|
-
const [error, setError] = (0,
|
|
19473
|
-
const [showPaymentForm, setShowPaymentForm] = (0,
|
|
19474
|
-
const [stripe, setStripe] = (0,
|
|
19475
|
-
const [setupIntent, setSetupIntent] = (0,
|
|
19476
|
-
const [showDifferentPaymentMethods, setShowDifferentPaymentMethods] = (0,
|
|
19477
|
-
const [paymentMethod, setPaymentMethod] = (0,
|
|
19478
|
-
(0,
|
|
19628
|
+
const [isLoading, setIsLoading] = (0, import_react38.useState)(false);
|
|
19629
|
+
const [error, setError] = (0, import_react38.useState)();
|
|
19630
|
+
const [showPaymentForm, setShowPaymentForm] = (0, import_react38.useState)(false);
|
|
19631
|
+
const [stripe, setStripe] = (0, import_react38.useState)(null);
|
|
19632
|
+
const [setupIntent, setSetupIntent] = (0, import_react38.useState)();
|
|
19633
|
+
const [showDifferentPaymentMethods, setShowDifferentPaymentMethods] = (0, import_react38.useState)(false);
|
|
19634
|
+
const [paymentMethod, setPaymentMethod] = (0, import_react38.useState)(void 0);
|
|
19635
|
+
(0, import_react38.useEffect)(() => {
|
|
19479
19636
|
if (data.subscription?.paymentMethod) {
|
|
19480
19637
|
setPaymentMethod(data.subscription.paymentMethod);
|
|
19481
19638
|
}
|
|
19482
19639
|
}, [data.subscription?.paymentMethod]);
|
|
19483
|
-
const monthsToExpiration = (0,
|
|
19640
|
+
const monthsToExpiration = (0, import_react38.useMemo)(() => {
|
|
19484
19641
|
let expiration;
|
|
19485
19642
|
if (typeof paymentMethod?.cardExpYear === "number" && typeof paymentMethod?.cardExpMonth === "number") {
|
|
19486
19643
|
const today = /* @__PURE__ */ new Date();
|
|
@@ -19493,12 +19650,12 @@ var PaymentMethodDetails = ({
|
|
|
19493
19650
|
}
|
|
19494
19651
|
return expiration;
|
|
19495
19652
|
}, [paymentMethod?.cardExpYear, paymentMethod?.cardExpMonth]);
|
|
19496
|
-
(0,
|
|
19653
|
+
(0, import_react38.useEffect)(() => {
|
|
19497
19654
|
if (!stripe && setupIntent?.publishableKey) {
|
|
19498
19655
|
setStripe(loadStripe(setupIntent.publishableKey));
|
|
19499
19656
|
}
|
|
19500
19657
|
}, [stripe, setupIntent?.publishableKey]);
|
|
19501
|
-
const createSetupIntent = (0,
|
|
19658
|
+
const createSetupIntent = (0, import_react38.useCallback)(async () => {
|
|
19502
19659
|
if (!api || !data.component?.id) {
|
|
19503
19660
|
return;
|
|
19504
19661
|
}
|
|
@@ -19517,10 +19674,10 @@ var PaymentMethodDetails = ({
|
|
|
19517
19674
|
setIsLoading(false);
|
|
19518
19675
|
}
|
|
19519
19676
|
}, [t2, api, data.component?.id]);
|
|
19520
|
-
const dropDownDifferentPaymentMethods = (0,
|
|
19677
|
+
const dropDownDifferentPaymentMethods = (0, import_react38.useCallback)(() => {
|
|
19521
19678
|
setShowDifferentPaymentMethods((state) => !state);
|
|
19522
19679
|
}, []);
|
|
19523
|
-
const updatePaymentMethod = (0,
|
|
19680
|
+
const updatePaymentMethod = (0, import_react38.useCallback)(
|
|
19524
19681
|
async (externalId) => {
|
|
19525
19682
|
if (!api || !externalId) {
|
|
19526
19683
|
return;
|
|
@@ -19553,7 +19710,7 @@ var PaymentMethodDetails = ({
|
|
|
19553
19710
|
},
|
|
19554
19711
|
[api, data, setData, setPaymentMethodId, t2]
|
|
19555
19712
|
);
|
|
19556
|
-
const deletePaymentMethod = (0,
|
|
19713
|
+
const deletePaymentMethod = (0, import_react38.useCallback)(
|
|
19557
19714
|
async (id) => {
|
|
19558
19715
|
if (!api || !id) {
|
|
19559
19716
|
return;
|
|
@@ -19580,8 +19737,8 @@ var PaymentMethodDetails = ({
|
|
|
19580
19737
|
},
|
|
19581
19738
|
[api, data, setData, t2]
|
|
19582
19739
|
);
|
|
19583
|
-
return /* @__PURE__ */ (0,
|
|
19584
|
-
isLoading && /* @__PURE__ */ (0,
|
|
19740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { $position: "relative", children: [
|
|
19741
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19585
19742
|
Flex,
|
|
19586
19743
|
{
|
|
19587
19744
|
$position: "absolute",
|
|
@@ -19593,10 +19750,10 @@ var PaymentMethodDetails = ({
|
|
|
19593
19750
|
$zIndex: 1,
|
|
19594
19751
|
$backgroundColor: "black",
|
|
19595
19752
|
$opacity: 0.5,
|
|
19596
|
-
children: /* @__PURE__ */ (0,
|
|
19753
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Loader, { $color: theme.primary, $size: "2xl" })
|
|
19597
19754
|
}
|
|
19598
19755
|
),
|
|
19599
|
-
/* @__PURE__ */ (0,
|
|
19756
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
19600
19757
|
Flex,
|
|
19601
19758
|
{
|
|
19602
19759
|
$flexDirection: "column",
|
|
@@ -19606,7 +19763,7 @@ var PaymentMethodDetails = ({
|
|
|
19606
19763
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.025)" : "hsla(0, 0%, 100%, 0.025)",
|
|
19607
19764
|
$overflow: "auto",
|
|
19608
19765
|
children: [
|
|
19609
|
-
showPaymentForm ? /* @__PURE__ */ (0,
|
|
19766
|
+
showPaymentForm ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19610
19767
|
import_react_stripe_js2.Elements,
|
|
19611
19768
|
{
|
|
19612
19769
|
stripe,
|
|
@@ -19635,7 +19792,7 @@ var PaymentMethodDetails = ({
|
|
|
19635
19792
|
},
|
|
19636
19793
|
clientSecret: setupIntent?.setupIntentClientSecret
|
|
19637
19794
|
},
|
|
19638
|
-
children: /* @__PURE__ */ (0,
|
|
19795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19639
19796
|
PaymentForm,
|
|
19640
19797
|
{
|
|
19641
19798
|
onConfirm: async (paymentMethodId) => {
|
|
@@ -19646,8 +19803,8 @@ var PaymentMethodDetails = ({
|
|
|
19646
19803
|
}
|
|
19647
19804
|
)
|
|
19648
19805
|
}
|
|
19649
|
-
) : /* @__PURE__ */ (0,
|
|
19650
|
-
/* @__PURE__ */ (0,
|
|
19806
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", children: [
|
|
19807
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19651
19808
|
PaymentMethodElement,
|
|
19652
19809
|
{
|
|
19653
19810
|
size: "lg",
|
|
@@ -19656,7 +19813,7 @@ var PaymentMethodDetails = ({
|
|
|
19656
19813
|
...props
|
|
19657
19814
|
}
|
|
19658
19815
|
),
|
|
19659
|
-
(data.company?.paymentMethods || []).length > 0 && /* @__PURE__ */ (0,
|
|
19816
|
+
(data.company?.paymentMethods || []).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
19660
19817
|
Text,
|
|
19661
19818
|
{
|
|
19662
19819
|
onClick: dropDownDifferentPaymentMethods,
|
|
@@ -19666,7 +19823,7 @@ var PaymentMethodDetails = ({
|
|
|
19666
19823
|
$color: theme.typography.link.color,
|
|
19667
19824
|
children: [
|
|
19668
19825
|
t2("Choose different payment method"),
|
|
19669
|
-
/* @__PURE__ */ (0,
|
|
19826
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19670
19827
|
Icon2,
|
|
19671
19828
|
{
|
|
19672
19829
|
name: "chevron-down",
|
|
@@ -19682,9 +19839,9 @@ var PaymentMethodDetails = ({
|
|
|
19682
19839
|
]
|
|
19683
19840
|
}
|
|
19684
19841
|
) }),
|
|
19685
|
-
showDifferentPaymentMethods && /* @__PURE__ */ (0,
|
|
19842
|
+
showDifferentPaymentMethods && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Flex, { $flexDirection: "column", $overflowY: "hidden", $height: "10rem", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Flex, { $flexDirection: "column", $overflowY: "scroll", children: (data.company?.paymentMethods.filter(
|
|
19686
19843
|
(pm) => pm.id !== paymentMethod?.id
|
|
19687
|
-
) || []).map((paymentMethod2) => /* @__PURE__ */ (0,
|
|
19844
|
+
) || []).map((paymentMethod2) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19688
19845
|
PaymentListElement,
|
|
19689
19846
|
{
|
|
19690
19847
|
paymentMethod: paymentMethod2,
|
|
@@ -19693,9 +19850,9 @@ var PaymentMethodDetails = ({
|
|
|
19693
19850
|
},
|
|
19694
19851
|
paymentMethod2.id
|
|
19695
19852
|
)) }) }),
|
|
19696
|
-
(!paymentMethod || showDifferentPaymentMethods) && /* @__PURE__ */ (0,
|
|
19853
|
+
(!paymentMethod || showDifferentPaymentMethods) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EmbedButton, { onClick: createSetupIntent, size: "lg", children: t2("Add new payment method") })
|
|
19697
19854
|
] }),
|
|
19698
|
-
!isLoading && error && /* @__PURE__ */ (0,
|
|
19855
|
+
!isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
19699
19856
|
Text,
|
|
19700
19857
|
{
|
|
19701
19858
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19712,9 +19869,9 @@ var PaymentMethodDetails = ({
|
|
|
19712
19869
|
};
|
|
19713
19870
|
|
|
19714
19871
|
// src/components/elements/plan-manager/PlanManager.tsx
|
|
19715
|
-
var
|
|
19716
|
-
var
|
|
19717
|
-
var
|
|
19872
|
+
var import_react39 = require("react");
|
|
19873
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
19874
|
+
var resolveDesignProps7 = (props) => {
|
|
19718
19875
|
return {
|
|
19719
19876
|
header: {
|
|
19720
19877
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -19742,8 +19899,8 @@ var resolveDesignProps6 = (props) => {
|
|
|
19742
19899
|
}
|
|
19743
19900
|
};
|
|
19744
19901
|
};
|
|
19745
|
-
var PlanManager = (0,
|
|
19746
|
-
const props =
|
|
19902
|
+
var PlanManager = (0, import_react39.forwardRef)(({ children, className, portal, ...rest }, ref) => {
|
|
19903
|
+
const props = resolveDesignProps7(rest);
|
|
19747
19904
|
const theme = nt();
|
|
19748
19905
|
const { t: t2 } = useTranslation();
|
|
19749
19906
|
const { data, setLayout, setSelected } = useEmbed();
|
|
@@ -19768,7 +19925,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19768
19925
|
[]
|
|
19769
19926
|
);
|
|
19770
19927
|
const billingSubscription = data.company?.billingSubscription;
|
|
19771
|
-
const trialEndDays = (0,
|
|
19928
|
+
const trialEndDays = (0, import_react39.useMemo)(() => {
|
|
19772
19929
|
const trialEnd = billingSubscription?.trialEnd;
|
|
19773
19930
|
const trialEndDate = trialEnd ? new Date(trialEnd * 1e3) : /* @__PURE__ */ new Date();
|
|
19774
19931
|
const todayDate = /* @__PURE__ */ new Date();
|
|
@@ -19781,8 +19938,8 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19781
19938
|
const willSubscriptionCancel = billingSubscription?.cancelAtPeriodEnd;
|
|
19782
19939
|
const isUsageBasedPlan = currentPlan?.planPrice === 0 && usageBasedEntitlements.length > 0;
|
|
19783
19940
|
const headerPriceFontStyle = isUsageBasedPlan ? theme.typography.heading3 : theme.typography[props.header.price.fontStyle];
|
|
19784
|
-
return /* @__PURE__ */ (0,
|
|
19785
|
-
isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ (0,
|
|
19941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
19942
|
+
isTrialSubscription && !willSubscriptionCancel ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19786
19943
|
Notice,
|
|
19787
19944
|
{
|
|
19788
19945
|
as: Flex,
|
|
@@ -19792,7 +19949,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19792
19949
|
$textAlign: "center",
|
|
19793
19950
|
$backgroundColor: isLightBackground ? darken(theme.card.background, 0.04) : lighten(theme.card.background, 0.04),
|
|
19794
19951
|
children: [
|
|
19795
|
-
/* @__PURE__ */ (0,
|
|
19952
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19796
19953
|
Text,
|
|
19797
19954
|
{
|
|
19798
19955
|
as: "h3",
|
|
@@ -19803,7 +19960,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19803
19960
|
children: t2("Trial ends in", { days: trialEndDays.toString() })
|
|
19804
19961
|
}
|
|
19805
19962
|
),
|
|
19806
|
-
/* @__PURE__ */ (0,
|
|
19963
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19807
19964
|
Text,
|
|
19808
19965
|
{
|
|
19809
19966
|
as: "p",
|
|
@@ -19820,7 +19977,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19820
19977
|
)
|
|
19821
19978
|
]
|
|
19822
19979
|
}
|
|
19823
|
-
) : willSubscriptionCancel && /* @__PURE__ */ (0,
|
|
19980
|
+
) : willSubscriptionCancel && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19824
19981
|
Notice,
|
|
19825
19982
|
{
|
|
19826
19983
|
as: Flex,
|
|
@@ -19830,7 +19987,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19830
19987
|
$textAlign: "center",
|
|
19831
19988
|
$backgroundColor: isLightBackground ? darken(theme.card.background, 0.04) : lighten(theme.card.background, 0.04),
|
|
19832
19989
|
children: [
|
|
19833
|
-
/* @__PURE__ */ (0,
|
|
19990
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19834
19991
|
Text,
|
|
19835
19992
|
{
|
|
19836
19993
|
as: "h3",
|
|
@@ -19841,7 +19998,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19841
19998
|
children: t2("Subscription canceled")
|
|
19842
19999
|
}
|
|
19843
20000
|
),
|
|
19844
|
-
billingSubscription?.cancelAt && /* @__PURE__ */ (0,
|
|
20001
|
+
billingSubscription?.cancelAt && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19845
20002
|
Text,
|
|
19846
20003
|
{
|
|
19847
20004
|
as: "p",
|
|
@@ -19862,7 +20019,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19862
20019
|
]
|
|
19863
20020
|
}
|
|
19864
20021
|
),
|
|
19865
|
-
/* @__PURE__ */ (0,
|
|
20022
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19866
20023
|
Element,
|
|
19867
20024
|
{
|
|
19868
20025
|
as: Flex,
|
|
@@ -19871,7 +20028,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19871
20028
|
$flexDirection: "column",
|
|
19872
20029
|
$gap: "2rem",
|
|
19873
20030
|
children: [
|
|
19874
|
-
props.header.isVisible && currentPlan && /* @__PURE__ */ (0,
|
|
20031
|
+
props.header.isVisible && currentPlan && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19875
20032
|
Flex,
|
|
19876
20033
|
{
|
|
19877
20034
|
$justifyContent: "space-between",
|
|
@@ -19879,8 +20036,8 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19879
20036
|
$flexWrap: "wrap",
|
|
19880
20037
|
$gap: "1rem",
|
|
19881
20038
|
children: [
|
|
19882
|
-
/* @__PURE__ */ (0,
|
|
19883
|
-
/* @__PURE__ */ (0,
|
|
20039
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
20040
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19884
20041
|
Text,
|
|
19885
20042
|
{
|
|
19886
20043
|
as: Box,
|
|
@@ -19892,7 +20049,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19892
20049
|
children: currentPlan.name
|
|
19893
20050
|
}
|
|
19894
20051
|
),
|
|
19895
|
-
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ (0,
|
|
20052
|
+
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19896
20053
|
Text,
|
|
19897
20054
|
{
|
|
19898
20055
|
as: Box,
|
|
@@ -19904,8 +20061,8 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19904
20061
|
}
|
|
19905
20062
|
)
|
|
19906
20063
|
] }),
|
|
19907
|
-
props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ (0,
|
|
19908
|
-
/* @__PURE__ */ (0,
|
|
20064
|
+
props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Box, { children: [
|
|
20065
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19909
20066
|
Text,
|
|
19910
20067
|
{
|
|
19911
20068
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -19918,14 +20075,14 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19918
20075
|
)
|
|
19919
20076
|
}
|
|
19920
20077
|
),
|
|
19921
|
-
!isUsageBasedPlan && /* @__PURE__ */ (0,
|
|
20078
|
+
!isUsageBasedPlan && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19922
20079
|
Text,
|
|
19923
20080
|
{
|
|
19924
20081
|
$font: theme.typography[props.header.price.fontStyle].fontFamily,
|
|
19925
20082
|
$size: theme.typography[props.header.price.fontStyle].fontSize,
|
|
19926
20083
|
$weight: theme.typography[props.header.price.fontStyle].fontWeight,
|
|
19927
20084
|
$color: theme.typography[props.header.price.fontStyle].color,
|
|
19928
|
-
children: /* @__PURE__ */ (0,
|
|
20085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("sub", { children: [
|
|
19929
20086
|
"/",
|
|
19930
20087
|
shortenPeriod(currentPlan.planPeriod)
|
|
19931
20088
|
] })
|
|
@@ -19935,8 +20092,8 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19935
20092
|
]
|
|
19936
20093
|
}
|
|
19937
20094
|
),
|
|
19938
|
-
props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0,
|
|
19939
|
-
props.addOns.showLabel && /* @__PURE__ */ (0,
|
|
20095
|
+
props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
20096
|
+
props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19940
20097
|
Text,
|
|
19941
20098
|
{
|
|
19942
20099
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19947,7 +20104,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19947
20104
|
children: t2("Add-ons")
|
|
19948
20105
|
}
|
|
19949
20106
|
),
|
|
19950
|
-
addOns.map((addOn, addOnIndex) => /* @__PURE__ */ (0,
|
|
20107
|
+
addOns.map((addOn, addOnIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19951
20108
|
Flex,
|
|
19952
20109
|
{
|
|
19953
20110
|
$justifyContent: "space-between",
|
|
@@ -19955,7 +20112,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19955
20112
|
$flexWrap: "wrap",
|
|
19956
20113
|
$gap: "1rem",
|
|
19957
20114
|
children: [
|
|
19958
|
-
/* @__PURE__ */ (0,
|
|
20115
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19959
20116
|
Text,
|
|
19960
20117
|
{
|
|
19961
20118
|
$font: theme.typography[props.addOns.fontStyle].fontFamily,
|
|
@@ -19965,7 +20122,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19965
20122
|
children: addOn.name
|
|
19966
20123
|
}
|
|
19967
20124
|
),
|
|
19968
|
-
addOn.planPrice && addOn.planPeriod && /* @__PURE__ */ (0,
|
|
20125
|
+
addOn.planPrice && addOn.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19969
20126
|
Text,
|
|
19970
20127
|
{
|
|
19971
20128
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19974,7 +20131,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19974
20131
|
$color: theme.typography.text.color,
|
|
19975
20132
|
children: [
|
|
19976
20133
|
formatCurrency(addOn.planPrice, subscriptionCurrency),
|
|
19977
|
-
/* @__PURE__ */ (0,
|
|
20134
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("sub", { children: [
|
|
19978
20135
|
"/",
|
|
19979
20136
|
shortenPeriod(addOn.planPeriod)
|
|
19980
20137
|
] })
|
|
@@ -19986,8 +20143,8 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
19986
20143
|
addOnIndex
|
|
19987
20144
|
))
|
|
19988
20145
|
] }),
|
|
19989
|
-
usageBasedEntitlements.length > 0 && /* @__PURE__ */ (0,
|
|
19990
|
-
/* @__PURE__ */ (0,
|
|
20146
|
+
usageBasedEntitlements.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
20147
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19991
20148
|
Text,
|
|
19992
20149
|
{
|
|
19993
20150
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20005,7 +20162,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20005
20162
|
const amount = overageAmount || entitlement.allocation || 0;
|
|
20006
20163
|
if (entitlement.feature?.name) {
|
|
20007
20164
|
acc.push(
|
|
20008
|
-
/* @__PURE__ */ (0,
|
|
20165
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
20009
20166
|
Flex,
|
|
20010
20167
|
{
|
|
20011
20168
|
$justifyContent: "space-between",
|
|
@@ -20013,7 +20170,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20013
20170
|
$flexWrap: "wrap",
|
|
20014
20171
|
$gap: "1rem",
|
|
20015
20172
|
children: [
|
|
20016
|
-
/* @__PURE__ */ (0,
|
|
20173
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
20017
20174
|
Text,
|
|
20018
20175
|
{
|
|
20019
20176
|
$font: theme.typography[props.addOns.fontStyle].fontFamily,
|
|
@@ -20021,20 +20178,20 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20021
20178
|
$weight: theme.typography[props.addOns.fontStyle].fontWeight,
|
|
20022
20179
|
$color: theme.typography[props.addOns.fontStyle].color,
|
|
20023
20180
|
children: [
|
|
20024
|
-
entitlement.priceBehavior === "pay_in_advance" || entitlement.priceBehavior === "overage" && limit > 0 ? /* @__PURE__ */ (0,
|
|
20181
|
+
entitlement.priceBehavior === "pay_in_advance" || entitlement.priceBehavior === "overage" && limit > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
20025
20182
|
limit,
|
|
20026
20183
|
" ",
|
|
20027
20184
|
getFeatureName(entitlement.feature, limit)
|
|
20028
20185
|
] }) : entitlement.feature.name,
|
|
20029
|
-
entitlement.priceBehavior === "overage" && entitlement.feature.featureType === "event" && currentPlan?.planPeriod && /* @__PURE__ */ (0,
|
|
20186
|
+
entitlement.priceBehavior === "overage" && entitlement.feature.featureType === "event" && currentPlan?.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
20030
20187
|
"/",
|
|
20031
20188
|
shortenPeriod(currentPlan.planPeriod)
|
|
20032
20189
|
] })
|
|
20033
20190
|
]
|
|
20034
20191
|
}
|
|
20035
20192
|
),
|
|
20036
|
-
/* @__PURE__ */ (0,
|
|
20037
|
-
entitlement.priceBehavior === "overage" && currentPlan?.planPeriod ? /* @__PURE__ */ (0,
|
|
20193
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Flex, { $alignItems: "center", $gap: "1rem", children: [
|
|
20194
|
+
entitlement.priceBehavior === "overage" && currentPlan?.planPeriod ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
20038
20195
|
Text,
|
|
20039
20196
|
{
|
|
20040
20197
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20043,7 +20200,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20043
20200
|
$color: hexToHSL(theme.typography.text.color).l > 50 ? darken(theme.typography.text.color, 0.46) : lighten(theme.typography.text.color, 0.46),
|
|
20044
20201
|
children: typeof overageAmount === "number" && overageAmount > 0 ? t2("X over the limit", {
|
|
20045
20202
|
amount: overageAmount
|
|
20046
|
-
}) : /* @__PURE__ */ (0,
|
|
20203
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
20047
20204
|
t2("Overage fee"),
|
|
20048
20205
|
":",
|
|
20049
20206
|
" ",
|
|
@@ -20051,17 +20208,17 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20051
20208
|
entitlement.price ?? 0,
|
|
20052
20209
|
entitlement.currency
|
|
20053
20210
|
),
|
|
20054
|
-
/* @__PURE__ */ (0,
|
|
20211
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("sub", { children: [
|
|
20055
20212
|
"/",
|
|
20056
20213
|
getFeatureName(entitlement.feature, 1),
|
|
20057
|
-
entitlement.feature.featureType === "trait" && /* @__PURE__ */ (0,
|
|
20214
|
+
entitlement.feature.featureType === "trait" && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
20058
20215
|
"/",
|
|
20059
20216
|
shortenPeriod(currentPlan.planPeriod)
|
|
20060
20217
|
] })
|
|
20061
20218
|
] })
|
|
20062
20219
|
] })
|
|
20063
20220
|
}
|
|
20064
|
-
) : entitlement.priceBehavior === "pay_in_advance" && currentPlan?.planPeriod && /* @__PURE__ */ (0,
|
|
20221
|
+
) : entitlement.priceBehavior === "pay_in_advance" && currentPlan?.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
20065
20222
|
Text,
|
|
20066
20223
|
{
|
|
20067
20224
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20073,7 +20230,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20073
20230
|
entitlement.price ?? 0,
|
|
20074
20231
|
entitlement.currency
|
|
20075
20232
|
),
|
|
20076
|
-
/* @__PURE__ */ (0,
|
|
20233
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("sub", { children: [
|
|
20077
20234
|
"/",
|
|
20078
20235
|
getFeatureName(entitlement.feature, 1),
|
|
20079
20236
|
"/",
|
|
@@ -20082,7 +20239,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20082
20239
|
]
|
|
20083
20240
|
}
|
|
20084
20241
|
),
|
|
20085
|
-
amount > 0 && /* @__PURE__ */ (0,
|
|
20242
|
+
amount > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
20086
20243
|
Text,
|
|
20087
20244
|
{
|
|
20088
20245
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20094,7 +20251,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20094
20251
|
(entitlement.price ?? 0) * amount,
|
|
20095
20252
|
entitlement.currency
|
|
20096
20253
|
),
|
|
20097
|
-
(entitlement.priceBehavior === "pay_in_advance" || entitlement.priceBehavior !== "overage") && /* @__PURE__ */ (0,
|
|
20254
|
+
(entitlement.priceBehavior === "pay_in_advance" || entitlement.priceBehavior !== "overage") && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("sub", { children: [
|
|
20098
20255
|
"/",
|
|
20099
20256
|
currentPlan?.planPeriod && entitlement.priceBehavior === "pay_in_advance" ? shortenPeriod(currentPlan.planPeriod) : getFeatureName(entitlement.feature, 1)
|
|
20100
20257
|
] })
|
|
@@ -20113,7 +20270,7 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20113
20270
|
[]
|
|
20114
20271
|
)
|
|
20115
20272
|
] }),
|
|
20116
|
-
canCheckout && props.callToAction.isVisible && /* @__PURE__ */ (0,
|
|
20273
|
+
canCheckout && props.callToAction.isVisible && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
20117
20274
|
EmbedButton,
|
|
20118
20275
|
{
|
|
20119
20276
|
type: "button",
|
|
@@ -20138,9 +20295,9 @@ var PlanManager = (0, import_react38.forwardRef)(({ children, className, portal,
|
|
|
20138
20295
|
PlanManager.displayName = "PlanManager";
|
|
20139
20296
|
|
|
20140
20297
|
// src/components/elements/pricing-table/PricingTable.tsx
|
|
20141
|
-
var
|
|
20142
|
-
var
|
|
20143
|
-
var
|
|
20298
|
+
var import_react40 = require("react");
|
|
20299
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
20300
|
+
var resolveDesignProps8 = (props) => {
|
|
20144
20301
|
return {
|
|
20145
20302
|
showPeriodToggle: props.showPeriodToggle ?? true,
|
|
20146
20303
|
showDiscount: props.showDiscount ?? true,
|
|
@@ -20179,18 +20336,18 @@ var resolveDesignProps7 = (props) => {
|
|
|
20179
20336
|
}
|
|
20180
20337
|
};
|
|
20181
20338
|
};
|
|
20182
|
-
var PricingTable = (0,
|
|
20183
|
-
const props =
|
|
20339
|
+
var PricingTable = (0, import_react40.forwardRef)(({ children, className, ...rest }, ref) => {
|
|
20340
|
+
const props = resolveDesignProps8(rest);
|
|
20184
20341
|
const { t: t2 } = useTranslation();
|
|
20185
20342
|
const theme = nt();
|
|
20186
20343
|
const { data, setLayout, setSelected } = useEmbed();
|
|
20187
20344
|
const trialEndDays = useTrialEnd();
|
|
20188
|
-
const [selectedPeriod, setSelectedPeriod] = (0,
|
|
20345
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react40.useState)(
|
|
20189
20346
|
() => data.company?.plan?.planPeriod || "month"
|
|
20190
20347
|
);
|
|
20191
20348
|
const { plans, addOns, periods } = useAvailablePlans(selectedPeriod);
|
|
20192
20349
|
const isLightBackground = useIsLightBackground();
|
|
20193
|
-
const [entitlementCounts, setEntitlementCounts] = (0,
|
|
20350
|
+
const [entitlementCounts, setEntitlementCounts] = (0, import_react40.useState)(
|
|
20194
20351
|
() => plans.reduce(
|
|
20195
20352
|
(acc, plan) => {
|
|
20196
20353
|
acc[plan.id] = {
|
|
@@ -20217,7 +20374,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20217
20374
|
};
|
|
20218
20375
|
});
|
|
20219
20376
|
};
|
|
20220
|
-
return /* @__PURE__ */ (0,
|
|
20377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20221
20378
|
FussyChild,
|
|
20222
20379
|
{
|
|
20223
20380
|
ref,
|
|
@@ -20226,8 +20383,8 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20226
20383
|
$flexDirection: "column",
|
|
20227
20384
|
$gap: "2rem",
|
|
20228
20385
|
children: [
|
|
20229
|
-
/* @__PURE__ */ (0,
|
|
20230
|
-
/* @__PURE__ */ (0,
|
|
20386
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box, { children: [
|
|
20387
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20231
20388
|
Flex,
|
|
20232
20389
|
{
|
|
20233
20390
|
$flexDirection: "column",
|
|
@@ -20242,7 +20399,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20242
20399
|
}
|
|
20243
20400
|
},
|
|
20244
20401
|
children: [
|
|
20245
|
-
/* @__PURE__ */ (0,
|
|
20402
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20246
20403
|
Text,
|
|
20247
20404
|
{
|
|
20248
20405
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -20252,7 +20409,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20252
20409
|
children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t2("Plans")
|
|
20253
20410
|
}
|
|
20254
20411
|
),
|
|
20255
|
-
props.showPeriodToggle && /* @__PURE__ */ (0,
|
|
20412
|
+
props.showPeriodToggle && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20256
20413
|
PeriodToggle,
|
|
20257
20414
|
{
|
|
20258
20415
|
options: periods,
|
|
@@ -20263,7 +20420,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20263
20420
|
]
|
|
20264
20421
|
}
|
|
20265
20422
|
),
|
|
20266
|
-
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ (0,
|
|
20423
|
+
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20267
20424
|
Box,
|
|
20268
20425
|
{
|
|
20269
20426
|
$display: "grid",
|
|
@@ -20281,7 +20438,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20281
20438
|
);
|
|
20282
20439
|
const isUsageBasedPlan = planPrice === 0 && hasUsageBasedEntitlements;
|
|
20283
20440
|
const headerPriceFontStyle = plan.custom || isUsageBasedPlan ? theme.typography.heading3 : theme.typography[props.plans.name.fontStyle];
|
|
20284
|
-
return /* @__PURE__ */ (0,
|
|
20441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20285
20442
|
Flex,
|
|
20286
20443
|
{
|
|
20287
20444
|
$position: "relative",
|
|
@@ -20294,7 +20451,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20294
20451
|
$outlineColor: isActivePlan ? theme.primary : "transparent",
|
|
20295
20452
|
...theme.card.hasShadow && { $boxShadow: cardBoxShadow },
|
|
20296
20453
|
children: [
|
|
20297
|
-
/* @__PURE__ */ (0,
|
|
20454
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20298
20455
|
Flex,
|
|
20299
20456
|
{
|
|
20300
20457
|
$flexDirection: "column",
|
|
@@ -20305,7 +20462,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20305
20462
|
$borderStyle: "solid",
|
|
20306
20463
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
|
|
20307
20464
|
children: [
|
|
20308
|
-
/* @__PURE__ */ (0,
|
|
20465
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20309
20466
|
Text,
|
|
20310
20467
|
{
|
|
20311
20468
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20315,7 +20472,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20315
20472
|
children: plan.name
|
|
20316
20473
|
}
|
|
20317
20474
|
) }),
|
|
20318
|
-
props.plans.description.isVisible && /* @__PURE__ */ (0,
|
|
20475
|
+
props.plans.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20319
20476
|
Text,
|
|
20320
20477
|
{
|
|
20321
20478
|
$font: theme.typography[props.plans.description.fontStyle].fontFamily,
|
|
@@ -20325,8 +20482,8 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20325
20482
|
children: plan.description
|
|
20326
20483
|
}
|
|
20327
20484
|
) }),
|
|
20328
|
-
/* @__PURE__ */ (0,
|
|
20329
|
-
/* @__PURE__ */ (0,
|
|
20485
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box, { children: [
|
|
20486
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20330
20487
|
Text,
|
|
20331
20488
|
{
|
|
20332
20489
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -20336,7 +20493,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20336
20493
|
children: plan.custom ? plan.customPlanConfig?.priceText ? plan.customPlanConfig.priceText : t2("Custom price") : isUsageBasedPlan ? t2("Usage-based") : formatCurrency(planPrice ?? 0, planCurrency)
|
|
20337
20494
|
}
|
|
20338
20495
|
),
|
|
20339
|
-
!plan.custom && !isUsageBasedPlan && /* @__PURE__ */ (0,
|
|
20496
|
+
!plan.custom && !isUsageBasedPlan && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20340
20497
|
Text,
|
|
20341
20498
|
{
|
|
20342
20499
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20350,7 +20507,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20350
20507
|
}
|
|
20351
20508
|
)
|
|
20352
20509
|
] }),
|
|
20353
|
-
isActivePlan && /* @__PURE__ */ (0,
|
|
20510
|
+
isActivePlan && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20354
20511
|
Flex,
|
|
20355
20512
|
{
|
|
20356
20513
|
$position: "absolute",
|
|
@@ -20359,7 +20516,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20359
20516
|
$backgroundColor: theme.primary,
|
|
20360
20517
|
$borderRadius: "9999px",
|
|
20361
20518
|
$padding: "0.125rem 0.85rem",
|
|
20362
|
-
children: /* @__PURE__ */ (0,
|
|
20519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20363
20520
|
Text,
|
|
20364
20521
|
{
|
|
20365
20522
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20374,7 +20531,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20374
20531
|
]
|
|
20375
20532
|
}
|
|
20376
20533
|
),
|
|
20377
|
-
/* @__PURE__ */ (0,
|
|
20534
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20378
20535
|
Flex,
|
|
20379
20536
|
{
|
|
20380
20537
|
$flexDirection: "column",
|
|
@@ -20383,8 +20540,8 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20383
20540
|
$gap: `${cardPadding}rem`,
|
|
20384
20541
|
$padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
|
|
20385
20542
|
children: [
|
|
20386
|
-
props.plans.showEntitlements && /* @__PURE__ */ (0,
|
|
20387
|
-
props.plans.showInclusionText && planIndex > 0 && /* @__PURE__ */ (0,
|
|
20543
|
+
props.plans.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: [
|
|
20544
|
+
props.plans.showInclusionText && planIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20388
20545
|
Text,
|
|
20389
20546
|
{
|
|
20390
20547
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20409,8 +20566,8 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20409
20566
|
return acc;
|
|
20410
20567
|
}
|
|
20411
20568
|
acc.push(
|
|
20412
|
-
/* @__PURE__ */ (0,
|
|
20413
|
-
props.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0,
|
|
20569
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $gap: "1rem", children: [
|
|
20570
|
+
props.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20414
20571
|
IconRound,
|
|
20415
20572
|
{
|
|
20416
20573
|
name: entitlement.feature.icon,
|
|
@@ -20421,14 +20578,14 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20421
20578
|
]
|
|
20422
20579
|
}
|
|
20423
20580
|
),
|
|
20424
|
-
entitlement.feature?.name && /* @__PURE__ */ (0,
|
|
20581
|
+
entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20425
20582
|
Flex,
|
|
20426
20583
|
{
|
|
20427
20584
|
$flexDirection: "column",
|
|
20428
20585
|
$justifyContent: "center",
|
|
20429
20586
|
$gap: "0.5rem",
|
|
20430
20587
|
children: [
|
|
20431
|
-
/* @__PURE__ */ (0,
|
|
20588
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20432
20589
|
Text,
|
|
20433
20590
|
{
|
|
20434
20591
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20436,7 +20593,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20436
20593
|
$weight: theme.typography.text.fontWeight,
|
|
20437
20594
|
$color: theme.typography.text.color,
|
|
20438
20595
|
$leading: 1.35,
|
|
20439
|
-
children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" || entitlement.priceBehavior === "pay_as_you_go") ? /* @__PURE__ */ (0,
|
|
20596
|
+
children: typeof entitlementPrice === "number" && (entitlement.priceBehavior === "pay_in_advance" || entitlement.priceBehavior === "pay_as_you_go") ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20440
20597
|
formatCurrency(
|
|
20441
20598
|
entitlementPrice,
|
|
20442
20599
|
entitlementCurrency
|
|
@@ -20448,18 +20605,18 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20448
20605
|
entitlement.feature,
|
|
20449
20606
|
1
|
|
20450
20607
|
),
|
|
20451
|
-
entitlement.priceBehavior === "pay_in_advance" && /* @__PURE__ */ (0,
|
|
20608
|
+
entitlement.priceBehavior === "pay_in_advance" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20452
20609
|
" ",
|
|
20453
20610
|
t2("per"),
|
|
20454
20611
|
" ",
|
|
20455
20612
|
selectedPeriod
|
|
20456
20613
|
] })
|
|
20457
|
-
] }) : entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0,
|
|
20614
|
+
] }) : entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20458
20615
|
entitlement.valueType === "unlimited" && !entitlement.priceBehavior ? t2("Unlimited", {
|
|
20459
20616
|
item: getFeatureName(
|
|
20460
20617
|
entitlement.feature
|
|
20461
20618
|
)
|
|
20462
|
-
}) : typeof limit === "number" && /* @__PURE__ */ (0,
|
|
20619
|
+
}) : typeof limit === "number" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20463
20620
|
formatNumber(limit),
|
|
20464
20621
|
" ",
|
|
20465
20622
|
getFeatureName(
|
|
@@ -20467,7 +20624,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20467
20624
|
limit
|
|
20468
20625
|
)
|
|
20469
20626
|
] }),
|
|
20470
|
-
entitlement.metricPeriod && entitlement.priceBehavior !== "overage" ? /* @__PURE__ */ (0,
|
|
20627
|
+
entitlement.metricPeriod && entitlement.priceBehavior !== "overage" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20471
20628
|
" ",
|
|
20472
20629
|
t2("per"),
|
|
20473
20630
|
" ",
|
|
@@ -20477,7 +20634,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20477
20634
|
current_month: "month",
|
|
20478
20635
|
current_year: "year"
|
|
20479
20636
|
}[entitlement.metricPeriod]
|
|
20480
|
-
] }) : entitlement.priceBehavior === "overage" && entitlement.feature.featureType === "event" && /* @__PURE__ */ (0,
|
|
20637
|
+
] }) : entitlement.priceBehavior === "overage" && entitlement.feature.featureType === "event" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20481
20638
|
"/",
|
|
20482
20639
|
shortenPeriod(
|
|
20483
20640
|
selectedPeriod
|
|
@@ -20486,7 +20643,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20486
20643
|
] }) : entitlement.feature.name
|
|
20487
20644
|
}
|
|
20488
20645
|
),
|
|
20489
|
-
entitlement.priceBehavior === "overage" && typeof entitlementPrice === "number" && /* @__PURE__ */ (0,
|
|
20646
|
+
entitlement.priceBehavior === "overage" && typeof entitlementPrice === "number" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20490
20647
|
Text,
|
|
20491
20648
|
{
|
|
20492
20649
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20512,7 +20669,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20512
20669
|
entitlement.feature,
|
|
20513
20670
|
1
|
|
20514
20671
|
),
|
|
20515
|
-
entitlement.feature.featureType === "trait" && /* @__PURE__ */ (0,
|
|
20672
|
+
entitlement.feature.featureType === "trait" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20516
20673
|
"/",
|
|
20517
20674
|
shortenPeriod(selectedPeriod)
|
|
20518
20675
|
] }),
|
|
@@ -20530,14 +20687,14 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20530
20687
|
},
|
|
20531
20688
|
[]
|
|
20532
20689
|
).slice(0, count?.limit ?? VISIBLE_ENTITLEMENT_COUNT),
|
|
20533
|
-
(count?.size || plan.entitlements.length) > VISIBLE_ENTITLEMENT_COUNT && /* @__PURE__ */ (0,
|
|
20690
|
+
(count?.size || plan.entitlements.length) > VISIBLE_ENTITLEMENT_COUNT && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20534
20691
|
Flex,
|
|
20535
20692
|
{
|
|
20536
20693
|
$alignItems: "center",
|
|
20537
20694
|
$justifyContent: "start",
|
|
20538
20695
|
$marginTop: "1rem",
|
|
20539
20696
|
children: [
|
|
20540
|
-
/* @__PURE__ */ (0,
|
|
20697
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20541
20698
|
Icon2,
|
|
20542
20699
|
{
|
|
20543
20700
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -20549,7 +20706,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20549
20706
|
}
|
|
20550
20707
|
}
|
|
20551
20708
|
),
|
|
20552
|
-
/* @__PURE__ */ (0,
|
|
20709
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20553
20710
|
Text,
|
|
20554
20711
|
{
|
|
20555
20712
|
onClick: () => handleToggleShowAll(plan.id),
|
|
@@ -20566,7 +20723,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20566
20723
|
}
|
|
20567
20724
|
)
|
|
20568
20725
|
] }),
|
|
20569
|
-
isActivePlan ? /* @__PURE__ */ (0,
|
|
20726
|
+
isActivePlan ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20570
20727
|
Flex,
|
|
20571
20728
|
{
|
|
20572
20729
|
$justifyContent: "center",
|
|
@@ -20574,7 +20731,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20574
20731
|
$gap: "0.25rem",
|
|
20575
20732
|
$padding: "0.625rem 0",
|
|
20576
20733
|
children: [
|
|
20577
|
-
/* @__PURE__ */ (0,
|
|
20734
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20578
20735
|
Icon2,
|
|
20579
20736
|
{
|
|
20580
20737
|
name: "check-rounded",
|
|
@@ -20585,7 +20742,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20585
20742
|
}
|
|
20586
20743
|
}
|
|
20587
20744
|
),
|
|
20588
|
-
/* @__PURE__ */ (0,
|
|
20745
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20589
20746
|
Text,
|
|
20590
20747
|
{
|
|
20591
20748
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20598,7 +20755,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20598
20755
|
)
|
|
20599
20756
|
]
|
|
20600
20757
|
}
|
|
20601
|
-
) : (props.upgrade.isVisible || props.downgrade.isVisible) && /* @__PURE__ */ (0,
|
|
20758
|
+
) : (props.upgrade.isVisible || props.downgrade.isVisible) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20602
20759
|
EmbedButton,
|
|
20603
20760
|
{
|
|
20604
20761
|
type: "button",
|
|
@@ -20622,14 +20779,14 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20622
20779
|
$color: props.downgrade.buttonStyle,
|
|
20623
20780
|
$variant: "outline"
|
|
20624
20781
|
},
|
|
20625
|
-
children: plan.custom ? /* @__PURE__ */ (0,
|
|
20782
|
+
children: plan.custom ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20626
20783
|
ButtonLink,
|
|
20627
20784
|
{
|
|
20628
20785
|
href: plan.customPlanConfig?.ctaWebSite ?? "#",
|
|
20629
20786
|
target: "_blank",
|
|
20630
20787
|
children: plan.customPlanConfig?.ctaText ?? t2("Talk to support")
|
|
20631
20788
|
}
|
|
20632
|
-
) : !plan.valid ? /* @__PURE__ */ (0,
|
|
20789
|
+
) : !plan.valid ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20633
20790
|
Tooltip,
|
|
20634
20791
|
{
|
|
20635
20792
|
trigger: t2("Over usage limit"),
|
|
@@ -20651,14 +20808,14 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20651
20808
|
}
|
|
20652
20809
|
)
|
|
20653
20810
|
] }),
|
|
20654
|
-
/* @__PURE__ */ (0,
|
|
20655
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
20811
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20812
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20656
20813
|
Flex,
|
|
20657
20814
|
{
|
|
20658
20815
|
$justifyContent: "space-between",
|
|
20659
20816
|
$alignItems: "center",
|
|
20660
20817
|
$marginBottom: "1rem",
|
|
20661
|
-
children: /* @__PURE__ */ (0,
|
|
20818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20662
20819
|
Text,
|
|
20663
20820
|
{
|
|
20664
20821
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -20670,7 +20827,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20670
20827
|
)
|
|
20671
20828
|
}
|
|
20672
20829
|
),
|
|
20673
|
-
/* @__PURE__ */ (0,
|
|
20830
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20674
20831
|
Box,
|
|
20675
20832
|
{
|
|
20676
20833
|
$display: "grid",
|
|
@@ -20681,7 +20838,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20681
20838
|
const { price: addOnPrice, currency: addOnCurrency } = getBillingPrice(
|
|
20682
20839
|
selectedPeriod === "year" ? addOn.yearlyPrice : addOn.monthlyPrice
|
|
20683
20840
|
) || {};
|
|
20684
|
-
return /* @__PURE__ */ (0,
|
|
20841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20685
20842
|
Flex,
|
|
20686
20843
|
{
|
|
20687
20844
|
$position: "relative",
|
|
@@ -20695,8 +20852,8 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20695
20852
|
$outlineColor: isActiveAddOn ? theme.primary : "transparent",
|
|
20696
20853
|
...theme.card.hasShadow && { $boxShadow: cardBoxShadow },
|
|
20697
20854
|
children: [
|
|
20698
|
-
/* @__PURE__ */ (0,
|
|
20699
|
-
/* @__PURE__ */ (0,
|
|
20855
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
|
|
20856
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20700
20857
|
Text,
|
|
20701
20858
|
{
|
|
20702
20859
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20706,7 +20863,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20706
20863
|
children: addOn.name
|
|
20707
20864
|
}
|
|
20708
20865
|
) }),
|
|
20709
|
-
props.addOns.showDescription && /* @__PURE__ */ (0,
|
|
20866
|
+
props.addOns.showDescription && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20710
20867
|
Text,
|
|
20711
20868
|
{
|
|
20712
20869
|
$font: theme.typography[props.plans.description.fontStyle].fontFamily,
|
|
@@ -20716,8 +20873,8 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20716
20873
|
children: addOn.description
|
|
20717
20874
|
}
|
|
20718
20875
|
) }),
|
|
20719
|
-
/* @__PURE__ */ (0,
|
|
20720
|
-
/* @__PURE__ */ (0,
|
|
20876
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Box, { children: [
|
|
20877
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20721
20878
|
Text,
|
|
20722
20879
|
{
|
|
20723
20880
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20727,7 +20884,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20727
20884
|
children: formatCurrency(addOnPrice ?? 0, addOnCurrency)
|
|
20728
20885
|
}
|
|
20729
20886
|
),
|
|
20730
|
-
/* @__PURE__ */ (0,
|
|
20887
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20731
20888
|
Text,
|
|
20732
20889
|
{
|
|
20733
20890
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20741,7 +20898,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20741
20898
|
}
|
|
20742
20899
|
)
|
|
20743
20900
|
] }),
|
|
20744
|
-
isActiveAddOn && /* @__PURE__ */ (0,
|
|
20901
|
+
isActiveAddOn && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20745
20902
|
Flex,
|
|
20746
20903
|
{
|
|
20747
20904
|
$position: "absolute",
|
|
@@ -20750,7 +20907,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20750
20907
|
$backgroundColor: theme.primary,
|
|
20751
20908
|
$borderRadius: "9999px",
|
|
20752
20909
|
$padding: "0.125rem 0.85rem",
|
|
20753
|
-
children: /* @__PURE__ */ (0,
|
|
20910
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20754
20911
|
Text,
|
|
20755
20912
|
{
|
|
20756
20913
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20763,7 +20920,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20763
20920
|
}
|
|
20764
20921
|
)
|
|
20765
20922
|
] }),
|
|
20766
|
-
/* @__PURE__ */ (0,
|
|
20923
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
20767
20924
|
Flex,
|
|
20768
20925
|
{
|
|
20769
20926
|
$flexDirection: "column",
|
|
@@ -20771,7 +20928,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20771
20928
|
$gap: `${cardPadding}rem`,
|
|
20772
20929
|
$flexGrow: 1,
|
|
20773
20930
|
children: [
|
|
20774
|
-
props.addOns.showEntitlements && /* @__PURE__ */ (0,
|
|
20931
|
+
props.addOns.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20775
20932
|
Flex,
|
|
20776
20933
|
{
|
|
20777
20934
|
$flexDirection: "column",
|
|
@@ -20780,15 +20937,15 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20780
20937
|
$flexGrow: 1,
|
|
20781
20938
|
children: addOn.entitlements.map(
|
|
20782
20939
|
(entitlement, entitlementIndex) => {
|
|
20783
|
-
return /* @__PURE__ */ (0,
|
|
20940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20784
20941
|
Flex,
|
|
20785
20942
|
{
|
|
20786
20943
|
$flexWrap: "wrap",
|
|
20787
20944
|
$justifyContent: "space-between",
|
|
20788
20945
|
$alignItems: "center",
|
|
20789
20946
|
$gap: "1rem",
|
|
20790
|
-
children: /* @__PURE__ */ (0,
|
|
20791
|
-
props.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0,
|
|
20947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex, { $gap: "1rem", children: [
|
|
20948
|
+
props.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20792
20949
|
IconRound,
|
|
20793
20950
|
{
|
|
20794
20951
|
name: entitlement.feature.icon,
|
|
@@ -20799,19 +20956,19 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20799
20956
|
]
|
|
20800
20957
|
}
|
|
20801
20958
|
),
|
|
20802
|
-
entitlement.feature?.name && /* @__PURE__ */ (0,
|
|
20959
|
+
entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20803
20960
|
Text,
|
|
20804
20961
|
{
|
|
20805
20962
|
$font: theme.typography.text.fontFamily,
|
|
20806
20963
|
$size: theme.typography.text.fontSize,
|
|
20807
20964
|
$weight: theme.typography.text.fontWeight,
|
|
20808
20965
|
$color: theme.typography.text.color,
|
|
20809
|
-
children: entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0,
|
|
20966
|
+
children: entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20810
20967
|
entitlement.valueType === "unlimited" ? t2("Unlimited", {
|
|
20811
20968
|
item: getFeatureName(
|
|
20812
20969
|
entitlement.feature
|
|
20813
20970
|
)
|
|
20814
|
-
}) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ (0,
|
|
20971
|
+
}) : typeof entitlement.valueNumeric === "number" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20815
20972
|
formatNumber(
|
|
20816
20973
|
entitlement.valueNumeric
|
|
20817
20974
|
),
|
|
@@ -20821,7 +20978,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20821
20978
|
entitlement.valueNumeric
|
|
20822
20979
|
)
|
|
20823
20980
|
] }),
|
|
20824
|
-
entitlement.metricPeriod && /* @__PURE__ */ (0,
|
|
20981
|
+
entitlement.metricPeriod && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
20825
20982
|
" ",
|
|
20826
20983
|
t2("per"),
|
|
20827
20984
|
" ",
|
|
@@ -20843,7 +21000,7 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20843
21000
|
)
|
|
20844
21001
|
}
|
|
20845
21002
|
),
|
|
20846
|
-
props.upgrade.isVisible && /* @__PURE__ */ (0,
|
|
21003
|
+
props.upgrade.isVisible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
20847
21004
|
EmbedButton,
|
|
20848
21005
|
{
|
|
20849
21006
|
type: "button",
|
|
@@ -20879,10 +21036,39 @@ var PricingTable = (0, import_react39.forwardRef)(({ children, className, ...res
|
|
|
20879
21036
|
});
|
|
20880
21037
|
PricingTable.displayName = "PricingTable";
|
|
20881
21038
|
|
|
21039
|
+
// src/components/elements/text/Text.tsx
|
|
21040
|
+
var import_react41 = require("react");
|
|
21041
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
21042
|
+
var resolveDesignProps9 = (props) => {
|
|
21043
|
+
return {
|
|
21044
|
+
text: {
|
|
21045
|
+
fontStyle: props.text?.fontStyle ?? "text",
|
|
21046
|
+
alignment: props.text?.alignment ?? "left",
|
|
21047
|
+
textContent: props.text?.textContent ?? "Text"
|
|
21048
|
+
}
|
|
21049
|
+
};
|
|
21050
|
+
};
|
|
21051
|
+
var TextElement = (0, import_react41.forwardRef)(({ children, className, ...rest }, ref) => {
|
|
21052
|
+
const props = resolveDesignProps9(rest);
|
|
21053
|
+
const theme = nt();
|
|
21054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Element, { as: Flex, ref, className, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
21055
|
+
Text,
|
|
21056
|
+
{
|
|
21057
|
+
$font: theme.typography[props.text.fontStyle].fontFamily,
|
|
21058
|
+
$size: theme.typography[props.text.fontStyle].fontSize,
|
|
21059
|
+
$weight: theme.typography[props.text.fontStyle].fontWeight,
|
|
21060
|
+
$color: theme.typography[props.text.fontStyle].color,
|
|
21061
|
+
$align: props.text.alignment,
|
|
21062
|
+
children: props.text.textContent
|
|
21063
|
+
}
|
|
21064
|
+
) });
|
|
21065
|
+
});
|
|
21066
|
+
TextElement.displayName = "Text";
|
|
21067
|
+
|
|
20882
21068
|
// src/components/elements/unsubscribe-button/UnsubscribeButton.tsx
|
|
20883
|
-
var
|
|
20884
|
-
var
|
|
20885
|
-
var
|
|
21069
|
+
var import_react42 = require("react");
|
|
21070
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
21071
|
+
var resolveDesignProps10 = (props) => {
|
|
20886
21072
|
return {
|
|
20887
21073
|
button: {
|
|
20888
21074
|
text: props.button?.text ?? "Unsubscribe",
|
|
@@ -20893,8 +21079,8 @@ var resolveDesignProps8 = (props) => {
|
|
|
20893
21079
|
}
|
|
20894
21080
|
};
|
|
20895
21081
|
};
|
|
20896
|
-
var UnsubscribeButton = (0,
|
|
20897
|
-
const props =
|
|
21082
|
+
var UnsubscribeButton = (0, import_react42.forwardRef)(({ children, className, ...rest }, ref) => {
|
|
21083
|
+
const props = resolveDesignProps10(rest);
|
|
20898
21084
|
const { t: t2 } = useTranslation();
|
|
20899
21085
|
const { data, setLayout } = useEmbed();
|
|
20900
21086
|
const disabled = !data.subscription || data.subscription.status === "cancelled" || data.subscription.cancelAtPeriodEnd;
|
|
@@ -20912,7 +21098,7 @@ var UnsubscribeButton = (0, import_react40.forwardRef)(({ children, className, .
|
|
|
20912
21098
|
variant: "text"
|
|
20913
21099
|
}
|
|
20914
21100
|
};
|
|
20915
|
-
return /* @__PURE__ */ (0,
|
|
21101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
20916
21102
|
Element,
|
|
20917
21103
|
{
|
|
20918
21104
|
as: Flex,
|
|
@@ -20920,7 +21106,7 @@ var UnsubscribeButton = (0, import_react40.forwardRef)(({ children, className, .
|
|
|
20920
21106
|
className,
|
|
20921
21107
|
$flexDirection: "column",
|
|
20922
21108
|
$gap: "2rem",
|
|
20923
|
-
children: /* @__PURE__ */ (0,
|
|
21109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
20924
21110
|
EmbedButton,
|
|
20925
21111
|
{
|
|
20926
21112
|
$size: props.button.size,
|
|
@@ -20941,9 +21127,9 @@ var UnsubscribeButton = (0, import_react40.forwardRef)(({ children, className, .
|
|
|
20941
21127
|
UnsubscribeButton.displayName = "UnsubscribeButton";
|
|
20942
21128
|
|
|
20943
21129
|
// src/components/elements/upcoming-bill/UpcomingBill.tsx
|
|
20944
|
-
var
|
|
20945
|
-
var
|
|
20946
|
-
function
|
|
21130
|
+
var import_react43 = require("react");
|
|
21131
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
21132
|
+
function resolveDesignProps11(props) {
|
|
20947
21133
|
return {
|
|
20948
21134
|
header: {
|
|
20949
21135
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -20961,13 +21147,13 @@ function resolveDesignProps9(props) {
|
|
|
20961
21147
|
}
|
|
20962
21148
|
};
|
|
20963
21149
|
}
|
|
20964
|
-
var UpcomingBill = (0,
|
|
20965
|
-
const props =
|
|
21150
|
+
var UpcomingBill = (0, import_react43.forwardRef)(({ className, ...rest }, ref) => {
|
|
21151
|
+
const props = resolveDesignProps11(rest);
|
|
20966
21152
|
const { t: t2 } = useTranslation();
|
|
20967
21153
|
const theme = nt();
|
|
20968
21154
|
const { data } = useEmbed();
|
|
20969
21155
|
const isLightBackground = useIsLightBackground();
|
|
20970
|
-
const { upcomingInvoice, discounts } = (0,
|
|
21156
|
+
const { upcomingInvoice, discounts } = (0, import_react43.useMemo)(() => {
|
|
20971
21157
|
const discounts2 = (data.subscription?.discounts || []).map((discount) => ({
|
|
20972
21158
|
amountOff: discount.amountOff,
|
|
20973
21159
|
couponId: discount.couponId,
|
|
@@ -20994,7 +21180,7 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
20994
21180
|
if (typeof upcomingInvoice.amountDue !== "number" || !upcomingInvoice.dueDate) {
|
|
20995
21181
|
return null;
|
|
20996
21182
|
}
|
|
20997
|
-
return /* @__PURE__ */ (0,
|
|
21183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
20998
21184
|
Element,
|
|
20999
21185
|
{
|
|
21000
21186
|
as: Flex,
|
|
@@ -21003,7 +21189,7 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21003
21189
|
$flexDirection: "column",
|
|
21004
21190
|
$gap: "1rem",
|
|
21005
21191
|
children: [
|
|
21006
|
-
props.header.isVisible && /* @__PURE__ */ (0,
|
|
21192
|
+
props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
21007
21193
|
Text,
|
|
21008
21194
|
{
|
|
21009
21195
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -21017,8 +21203,8 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21017
21203
|
]
|
|
21018
21204
|
}
|
|
21019
21205
|
) }),
|
|
21020
|
-
/* @__PURE__ */ (0,
|
|
21021
|
-
props.price.isVisible && /* @__PURE__ */ (0,
|
|
21206
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "start", $gap: "1rem", children: [
|
|
21207
|
+
props.price.isVisible && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Flex, { $alignItems: "end", $flexGrow: "1", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
21022
21208
|
Text,
|
|
21023
21209
|
{
|
|
21024
21210
|
$font: theme.typography[props.price.fontStyle].fontFamily,
|
|
@@ -21032,7 +21218,7 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21032
21218
|
)
|
|
21033
21219
|
}
|
|
21034
21220
|
) }),
|
|
21035
|
-
/* @__PURE__ */ (0,
|
|
21221
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { $lineHeight: 1.15, $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
21036
21222
|
Text,
|
|
21037
21223
|
{
|
|
21038
21224
|
$font: theme.typography[props.contractEndDate.fontStyle].fontFamily,
|
|
@@ -21044,8 +21230,8 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21044
21230
|
}
|
|
21045
21231
|
) })
|
|
21046
21232
|
] }),
|
|
21047
|
-
discounts.length > 0 && /* @__PURE__ */ (0,
|
|
21048
|
-
/* @__PURE__ */ (0,
|
|
21233
|
+
discounts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
|
|
21234
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
21049
21235
|
Text,
|
|
21050
21236
|
{
|
|
21051
21237
|
$font: theme.typography.text.fontFamily,
|
|
@@ -21055,8 +21241,8 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21055
21241
|
children: t2("Discount")
|
|
21056
21242
|
}
|
|
21057
21243
|
) }),
|
|
21058
|
-
/* @__PURE__ */ (0,
|
|
21059
|
-
/* @__PURE__ */ (0,
|
|
21244
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: discounts.map((discount) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
21245
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
21060
21246
|
Flex,
|
|
21061
21247
|
{
|
|
21062
21248
|
$alignItems: "center",
|
|
@@ -21065,7 +21251,7 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21065
21251
|
$borderStyle: "solid",
|
|
21066
21252
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
|
|
21067
21253
|
$borderRadius: "0.3125rem",
|
|
21068
|
-
children: /* @__PURE__ */ (0,
|
|
21254
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
21069
21255
|
Text,
|
|
21070
21256
|
{
|
|
21071
21257
|
$font: theme.typography.text.fontFamily,
|
|
@@ -21077,7 +21263,7 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21077
21263
|
)
|
|
21078
21264
|
}
|
|
21079
21265
|
),
|
|
21080
|
-
/* @__PURE__ */ (0,
|
|
21266
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
21081
21267
|
Text,
|
|
21082
21268
|
{
|
|
21083
21269
|
$font: theme.typography.text.fontFamily,
|
|
@@ -21096,10 +21282,10 @@ var UpcomingBill = (0, import_react41.forwardRef)(({ className, ...rest }, ref)
|
|
|
21096
21282
|
UpcomingBill.displayName = "UpcomingBill";
|
|
21097
21283
|
|
|
21098
21284
|
// src/components/embed/ComponentTree.tsx
|
|
21099
|
-
var
|
|
21285
|
+
var import_react45 = require("react");
|
|
21100
21286
|
|
|
21101
21287
|
// src/components/embed/renderer.ts
|
|
21102
|
-
var
|
|
21288
|
+
var import_react44 = require("react");
|
|
21103
21289
|
var components = {
|
|
21104
21290
|
Root,
|
|
21105
21291
|
Viewport,
|
|
@@ -21112,7 +21298,8 @@ var components = {
|
|
|
21112
21298
|
PaymentMethod,
|
|
21113
21299
|
Invoices,
|
|
21114
21300
|
PricingTable,
|
|
21115
|
-
UnsubscribeButton
|
|
21301
|
+
UnsubscribeButton,
|
|
21302
|
+
ButtonElement
|
|
21116
21303
|
};
|
|
21117
21304
|
function createRenderer(options) {
|
|
21118
21305
|
const { useFallback = false } = options || {};
|
|
@@ -21132,7 +21319,7 @@ function createRenderer(options) {
|
|
|
21132
21319
|
const { className, ...rest } = props;
|
|
21133
21320
|
const resolvedProps = component === "div" ? rest : props;
|
|
21134
21321
|
const resolvedChildren = children.map(renderNode);
|
|
21135
|
-
return (0,
|
|
21322
|
+
return (0, import_react44.createElement)(
|
|
21136
21323
|
component,
|
|
21137
21324
|
{
|
|
21138
21325
|
key: index,
|
|
@@ -21145,10 +21332,10 @@ function createRenderer(options) {
|
|
|
21145
21332
|
}
|
|
21146
21333
|
|
|
21147
21334
|
// src/components/embed/ComponentTree.tsx
|
|
21148
|
-
var
|
|
21335
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
21149
21336
|
var Loading = () => {
|
|
21150
21337
|
const theme = nt();
|
|
21151
|
-
return /* @__PURE__ */ (0,
|
|
21338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
21152
21339
|
Flex,
|
|
21153
21340
|
{
|
|
21154
21341
|
$width: "100%",
|
|
@@ -21156,13 +21343,13 @@ var Loading = () => {
|
|
|
21156
21343
|
$alignItems: "center",
|
|
21157
21344
|
$justifyContent: "center",
|
|
21158
21345
|
$padding: `${theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
21159
|
-
children: /* @__PURE__ */ (0,
|
|
21346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Loader, { $color: "#194BFB", $size: "2xl" })
|
|
21160
21347
|
}
|
|
21161
21348
|
);
|
|
21162
21349
|
};
|
|
21163
21350
|
var Error2 = ({ message }) => {
|
|
21164
21351
|
const theme = nt();
|
|
21165
|
-
return /* @__PURE__ */ (0,
|
|
21352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
21166
21353
|
Flex,
|
|
21167
21354
|
{
|
|
21168
21355
|
$flexDirection: "column",
|
|
@@ -21173,7 +21360,7 @@ var Error2 = ({ message }) => {
|
|
|
21173
21360
|
$alignItems: "center",
|
|
21174
21361
|
$justifyContent: "center",
|
|
21175
21362
|
children: [
|
|
21176
|
-
/* @__PURE__ */ (0,
|
|
21363
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
21177
21364
|
Box,
|
|
21178
21365
|
{
|
|
21179
21366
|
$marginBottom: `${8 / TEXT_BASE_SIZE}rem`,
|
|
@@ -21184,7 +21371,7 @@ var Error2 = ({ message }) => {
|
|
|
21184
21371
|
children: "Error"
|
|
21185
21372
|
}
|
|
21186
21373
|
),
|
|
21187
|
-
/* @__PURE__ */ (0,
|
|
21374
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
21188
21375
|
Box,
|
|
21189
21376
|
{
|
|
21190
21377
|
$marginBottom: `${8 / TEXT_BASE_SIZE}rem`,
|
|
@@ -21201,23 +21388,23 @@ var Error2 = ({ message }) => {
|
|
|
21201
21388
|
};
|
|
21202
21389
|
var ComponentTree = () => {
|
|
21203
21390
|
const { error, nodes, isPending } = useEmbed();
|
|
21204
|
-
const [children, setChildren] = (0,
|
|
21205
|
-
(0,
|
|
21391
|
+
const [children, setChildren] = (0, import_react45.useState)(/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Loading, {}));
|
|
21392
|
+
(0, import_react45.useEffect)(() => {
|
|
21206
21393
|
const renderer = createRenderer();
|
|
21207
21394
|
setChildren(nodes.map(renderer));
|
|
21208
21395
|
}, [nodes]);
|
|
21209
21396
|
if (error) {
|
|
21210
21397
|
console.error(error);
|
|
21211
|
-
return /* @__PURE__ */ (0,
|
|
21398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Error2, { message: error.message });
|
|
21212
21399
|
}
|
|
21213
21400
|
if (isPending) {
|
|
21214
|
-
return /* @__PURE__ */ (0,
|
|
21401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Loading, {});
|
|
21215
21402
|
}
|
|
21216
|
-
return /* @__PURE__ */ (0,
|
|
21403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children });
|
|
21217
21404
|
};
|
|
21218
21405
|
|
|
21219
21406
|
// src/components/embed/Embed.tsx
|
|
21220
|
-
var
|
|
21407
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
21221
21408
|
var SchematicEmbed = ({
|
|
21222
21409
|
id,
|
|
21223
21410
|
accessToken,
|
|
@@ -21225,19 +21412,19 @@ var SchematicEmbed = ({
|
|
|
21225
21412
|
debug
|
|
21226
21413
|
}) => {
|
|
21227
21414
|
if (accessToken?.length === 0) {
|
|
21228
|
-
return /* @__PURE__ */ (0,
|
|
21415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: "Please provide an access token." });
|
|
21229
21416
|
}
|
|
21230
21417
|
if (!accessToken?.startsWith("token_")) {
|
|
21231
|
-
return /* @__PURE__ */ (0,
|
|
21418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: 'Invalid access token; your temporary access token will start with "token_".' });
|
|
21232
21419
|
}
|
|
21233
|
-
return /* @__PURE__ */ (0,
|
|
21420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
21234
21421
|
EmbedProvider,
|
|
21235
21422
|
{
|
|
21236
21423
|
id,
|
|
21237
21424
|
accessToken,
|
|
21238
21425
|
apiConfig,
|
|
21239
21426
|
debug,
|
|
21240
|
-
children: /* @__PURE__ */ (0,
|
|
21427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ComponentTree, {})
|
|
21241
21428
|
}
|
|
21242
21429
|
);
|
|
21243
21430
|
};
|