@bunnyapp/components 1.0.50 → 1.0.53

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.
Files changed (45) hide show
  1. package/dist/cjs/index.js +290 -394
  2. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/PriceListGrid.d.ts +3 -3
  3. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/PriceListSelector.d.ts +3 -3
  4. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +3 -3
  5. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanFeatures.d.ts +2 -3
  6. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListCardDesktop.d.ts +2 -3
  7. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +5 -4
  8. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +2 -3
  9. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListGridMobile.d.ts +4 -4
  10. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerUtils.d.ts +6 -6
  11. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCard.d.ts +2 -3
  12. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardButton.d.ts +3 -3
  13. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardFeature.d.ts +3 -3
  14. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPrice.d.ts +2 -3
  15. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +2 -3
  16. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardTitle.d.ts +3 -3
  17. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/priceListCardUtils.d.ts +3 -3
  18. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +3 -3
  19. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +3 -3
  20. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +3 -3
  21. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +3 -3
  22. package/dist/cjs/src/graphql/queries/getPriceListChangeOptions.d.ts +9 -0
  23. package/dist/esm/index.js +290 -394
  24. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/PriceListGrid.d.ts +3 -3
  25. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/PriceListSelector.d.ts +3 -3
  26. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +3 -3
  27. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanFeatures.d.ts +2 -3
  28. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListCardDesktop.d.ts +2 -3
  29. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +5 -4
  30. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +2 -3
  31. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListGridMobile.d.ts +4 -4
  32. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerUtils.d.ts +6 -6
  33. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCard.d.ts +2 -3
  34. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardButton.d.ts +3 -3
  35. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardFeature.d.ts +3 -3
  36. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPrice.d.ts +2 -3
  37. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +2 -3
  38. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardTitle.d.ts +3 -3
  39. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/priceListCardUtils.d.ts +3 -3
  40. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +3 -3
  41. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +3 -3
  42. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +3 -3
  43. package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +3 -3
  44. package/dist/esm/src/graphql/queries/getPriceListChangeOptions.d.ts +9 -0
  45. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -823,13 +823,13 @@ var PlusIcon = function (_a) {
823
823
  return (jsxRuntime.jsxs("svg", __assign({ width: "14", height: "15", viewBox: "0 0 14 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsx("path", { d: "M2.9165 7.5H11.0832", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M7 3.41663V11.5833", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })));
824
824
  };
825
825
 
826
- var Text$q = antd.Typography.Text;
826
+ var Text$o = antd.Typography.Text;
827
827
  var CreditCard = function (_a) {
828
828
  var _b;
829
829
  var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate, paymentMethodData = _a.paymentMethodData, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, _d = _a.cardEnabled, cardEnabled = _d === void 0 ? true : _d;
830
830
  var isMobile = common.useIsMobile();
831
831
  var Wrapper = cardEnabled ? Card : "div";
832
- return (jsxRuntime.jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " m-0") }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$q, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsxRuntime.jsx(CustomizedTag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(antd.Divider, {}), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsxRuntime.jsx(CardAttribute, { title: "EXPIRATION", value: expirationDate(paymentMethodData) }), isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
832
+ return (jsxRuntime.jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " m-0") }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$o, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsxRuntime.jsx(CustomizedTag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(antd.Divider, {}), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsxRuntime.jsx(CardAttribute, { title: "EXPIRATION", value: expirationDate(paymentMethodData) }), isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
833
833
  };
834
834
  var MiniCreditCard = function (_a) {
835
835
  var _b, _c;
@@ -844,7 +844,7 @@ var MiniCreditCard = function (_a) {
844
844
  function capitalize(str) {
845
845
  return str.charAt(0).toUpperCase() + str.slice(1);
846
846
  }
847
- return (jsxRuntime.jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2 space-between w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$q, { children: capitalize((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Text$q, __assign({ className: "relative -top-0.5" }, { children: "****" })), jsxRuntime.jsx(Text$q, { children: (_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.identifier })] })] })) })), !hideRemoveButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ title: "Remove card?", onConfirm: onClickRemove }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "font-normal p-0", type: "link" }, { children: "Remove" })) })))] })) : (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row gap-2 items-center" }, { children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$q, __assign({ className: "text-slate-400", style: { fontSize: "12px" } }, { children: "No payment method selected" })), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" })] }))) })));
847
+ return (jsxRuntime.jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2 space-between w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$o, { children: capitalize((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Text$o, __assign({ className: "relative -top-0.5" }, { children: "****" })), jsxRuntime.jsx(Text$o, { children: (_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.identifier })] })] })) })), !hideRemoveButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ title: "Remove card?", onConfirm: onClickRemove }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "font-normal p-0", type: "link" }, { children: "Remove" })) })))] })) : (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row gap-2 items-center" }, { children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$o, __assign({ className: "text-slate-400", style: { fontSize: "12px" } }, { children: "No payment method selected" })), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" })] }))) })));
848
848
  };
849
849
  var CardImage = function (_a) {
850
850
  var _b;
@@ -876,7 +876,7 @@ var CardImage = function (_a) {
876
876
  };
877
877
  var CardAttribute = function (_a) {
878
878
  var title = _a.title, value = _a.value;
879
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsx("div", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: title })), jsxRuntime.jsx(Text$q, { children: value })] })));
879
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsx("div", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: title })), jsxRuntime.jsx(Text$o, { children: value })] })));
880
880
  };
881
881
  var CardActions = function (_a) {
882
882
  var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate;
@@ -1057,7 +1057,7 @@ function useSave$1(_a) {
1057
1057
  return { save: save, isSaving: isSaving };
1058
1058
  }
1059
1059
 
1060
- var Text$p = antd.Typography.Text;
1060
+ var Text$n = antd.Typography.Text;
1061
1061
  var TEST_CARD = "4242424242424242";
1062
1062
  var DemoPayForm = function (_a) {
1063
1063
  var onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod, plugin = _a.plugin;
@@ -1118,7 +1118,7 @@ var DemoPayForm = function (_a) {
1118
1118
  var onCardCvcChange = function (cvc) {
1119
1119
  setCardDetails(__assign(__assign({}, cardDetails), { cvc: cvc }));
1120
1120
  };
1121
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsxs(StyledInputs, __assign({ className: "flex flex-col gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false }, { children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-2" }, { children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsxRuntime.jsx(Text$p, { children: "DemoPay is for testing only." }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSave })] })));
1121
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsxs(StyledInputs, __assign({ className: "flex flex-col gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false }, { children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-2" }, { children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsxRuntime.jsx(Text$n, { children: "DemoPay is for testing only." }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSave })] })));
1122
1122
  };
1123
1123
  var StyledInputs = defaultStyled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"], ["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"])), function (_a) {
1124
1124
  var darkMode = _a.darkMode;
@@ -1360,7 +1360,7 @@ var CardIcon = function () {
1360
1360
  return (jsxRuntime.jsxs("svg", __assign({ width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsx("path", { d: "M15 3.75H3C2.17157 3.75 1.5 4.42157 1.5 5.25V12.75C1.5 13.5784 2.17157 14.25 3 14.25H15C15.8284 14.25 16.5 13.5784 16.5 12.75V5.25C16.5 4.42157 15.8284 3.75 15 3.75Z", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M1.5 7.5H16.5", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
1361
1361
  };
1362
1362
 
1363
- var Text$o = antd.Typography.Text;
1363
+ var Text$m = antd.Typography.Text;
1364
1364
  var PaymentMethodSelector = function (_a) {
1365
1365
  var paymentMethodAllowedPlugins = _a.paymentMethodAllowedPlugins, onSelect = _a.onSelect, value = _a.value;
1366
1366
  return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-2" }, { children: paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.map(function (plugin, index) { return (jsxRuntime.jsx(PaymentOption, { name: plugin.name, onClick: onSelect, paymentPlugin: plugin, selected: (value === null || value === void 0 ? void 0 : value.id) === plugin.id }, index)); }) })));
@@ -1373,7 +1373,7 @@ var PaymentOption = function (_a) {
1373
1373
  var isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("card");
1374
1374
  return (jsxRuntime.jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "flex justify-between items-center w-full cursor-pointer py-2 px-4 rounded border-solid ".concat(darkMode
1375
1375
  ? "var(--row-background-dark) border-gray-500"
1376
- : "bg-slate-50 border-slate-200", " border"), onClick: function () { return onClick(paymentPlugin); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? "border-gray-400" : "" }), jsxRuntime.jsx(Text$o, { children: name })] })), isAch ? (jsxRuntime.jsx(icons.BankOutlined, { className: "text-slate-400" })) : isCard ? (jsxRuntime.jsx(CardIcon, {})) : (jsxRuntime.jsx(CardIcon, {}))] })));
1376
+ : "bg-slate-50 border-slate-200", " border"), onClick: function () { return onClick(paymentPlugin); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? "border-gray-400" : "" }), jsxRuntime.jsx(Text$m, { children: name })] })), isAch ? (jsxRuntime.jsx(icons.BankOutlined, { className: "text-slate-400" })) : isCard ? (jsxRuntime.jsx(CardIcon, {})) : (jsxRuntime.jsx(CardIcon, {}))] })));
1377
1377
  };
1378
1378
  var PaymentOptionContainer = defaultStyled.div(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"], ["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"])), function (_a) {
1379
1379
  var $brandColor = _a.$brandColor, $selected = _a.$selected;
@@ -1839,7 +1839,7 @@ var AcceptQuoteModal = function (_a) {
1839
1839
  }, open: acceptBoxVisible, title: "Accept quote", width: 400 }, { children: jsxRuntime.jsxs(antd.Form, __assign({ className: "flex flex-col gap-2", form: form, layout: "vertical" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your name", name: "name", rules: createRules(true, "Your name") }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: true, ref: firstInputRef }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your job title", name: "title", rules: createRules(true, "Your job title") }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Purchase order number", name: "poNumber", rules: createRules(poNumberRequired, "Purchase order number") }, { children: jsxRuntime.jsx(antd.Input, {}) })), taxNumberRequired && (jsxRuntime.jsx(antd.Form.Item, __assign({ name: "taxNumber", label: taxNumberLabel, rules: createRules(taxNumberRequired, taxNumberLabel) }, { children: jsxRuntime.jsx(antd.Input, {}) })))] })) })));
1840
1840
  };
1841
1841
 
1842
- var Text$n = antd.Typography.Text;
1842
+ var Text$l = antd.Typography.Text;
1843
1843
  defaultStyled.div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
1844
1844
  function Quote(_a) {
1845
1845
  var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? "shadow-md" : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onQuoteLoaded = _a.onQuoteLoaded;
@@ -1908,7 +1908,7 @@ function ActualQuote() {
1908
1908
  var isAccepted = formattedQuote.state === "ACCEPTED";
1909
1909
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4 ".concat(isMobile ? "w-full overflow-hidden" : "bunny-shadow-padding-xb", " ").concat(className) }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
1910
1910
  color: entityBranding.secondaryColor,
1911
- } }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$n, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile
1911
+ } }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$l, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile
1912
1912
  ? "flex w-full justify-end gap-2"
1913
1913
  : "flex items-center justify-end gap-2" }, { children: [!isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () {
1914
1914
  return downloadFile(apiHost + "/api/pdf/quote", token);
@@ -19214,10 +19214,10 @@ var getColor = function (state) {
19214
19214
  }
19215
19215
  };
19216
19216
 
19217
- var Text$m = antd.Typography.Text;
19217
+ var Text$k = antd.Typography.Text;
19218
19218
  var TransactionDate = function (_a) {
19219
19219
  var date = _a.date;
19220
- return jsxRuntime.jsx(Text$m, __assign({ className: "text-sm" }, { children: common.formatDate(date) }));
19220
+ return jsxRuntime.jsx(Text$k, __assign({ className: "text-sm" }, { children: common.formatDate(date) }));
19221
19221
  };
19222
19222
 
19223
19223
  var ArrowDownToLine = function (_a) {
@@ -19254,10 +19254,10 @@ var TransactionGridCell = defaultStyled.div.withConfig({
19254
19254
  }, common.SLATE_600);
19255
19255
  var templateObject_1$6;
19256
19256
 
19257
- var Text$l = antd.Typography.Text;
19257
+ var Text$j = antd.Typography.Text;
19258
19258
  var TransactionsEmptyState = function () {
19259
19259
  var noTransactionsMessage = react.useContext(TransactionsListContext).noTransactionsMessage;
19260
- return (jsxRuntime.jsx(Text$l, __assign({ className: "flex justify-center p-4 text-base" }, { children: noTransactionsMessage || "There are no transactions" })));
19260
+ return (jsxRuntime.jsx(Text$j, __assign({ className: "flex justify-center p-4 text-base" }, { children: noTransactionsMessage || "There are no transactions" })));
19261
19261
  };
19262
19262
 
19263
19263
  var isInvoice = function (transaction) {
@@ -19290,7 +19290,7 @@ function transactionDateToDisplay(transaction, transactionDateType) {
19290
19290
  }
19291
19291
  }
19292
19292
 
19293
- var Text$k = antd.Typography.Text;
19293
+ var Text$i = antd.Typography.Text;
19294
19294
  var TransactionsListDesktop = function (_a) {
19295
19295
  var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
19296
19296
  var _b = react.useContext(TransactionsListContext), columns = _b.columns, transactionDateType = _b.transactionDateType;
@@ -19319,11 +19319,11 @@ var TransactionsListDesktop = function (_a) {
19319
19319
  !showState &&
19320
19320
  !showAmount &&
19321
19321
  !showDownload &&
19322
- !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(Text$k, { children: "No columns selected" }) })), showDate && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) }) }))), showTitle && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(TransactionGridCell, __assign({ right: false, className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(Text$k, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })) })), showAccountName && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(Text$k, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }) }))), !showDate && !showTitle && !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { right: false })), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })), showState ? (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(StateTag, { state: transaction.state }) }))) : null, showAmount && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(Text$k, { children: common.formatCurrency(((_b = transaction === null || transaction === void 0 ? void 0 : transaction.transactionable) === null || _b === void 0 ? void 0 : _b.amount) || transaction.amount, transaction.currencyId) }) })))] }), index));
19322
+ !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(Text$i, { children: "No columns selected" }) })), showDate && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) }) }))), showTitle && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(TransactionGridCell, __assign({ right: false, className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(Text$i, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })) })), showAccountName && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(Text$i, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }) }))), !showDate && !showTitle && !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { right: false })), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })), showState ? (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(StateTag, { state: transaction.state }) }))) : null, showAmount && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(Text$i, { children: common.formatCurrency(((_b = transaction === null || transaction === void 0 ? void 0 : transaction.transactionable) === null || _b === void 0 ? void 0 : _b.amount) || transaction.amount, transaction.currencyId) }) })))] }), index));
19323
19323
  }) }));
19324
19324
  };
19325
19325
 
19326
- var Text$j = antd.Typography.Text;
19326
+ var Text$h = antd.Typography.Text;
19327
19327
  var TransactionsListMobile = function (_a) {
19328
19328
  var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
19329
19329
  var _b = react.useContext(TransactionsListContext), columns = _b.columns, transactionDateType = _b.transactionDateType;
@@ -19346,12 +19346,12 @@ var TransactionsListMobile = function (_a) {
19346
19346
  backgroundColor: index % 2 === 0
19347
19347
  ? "var(--row-background".concat(darkMode ? "-dark" : "", ")")
19348
19348
  : "var(--row-background-alternate".concat(darkMode ? "-dark" : "", ")"),
19349
- } }, { children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [(showTitle || showState) && (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$j, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] }))), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showAccountName && jsxRuntime.jsx(Text$j, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }), showAccountName && showDate && jsxRuntime.jsx(Text$j, { children: "\u00B7" }), showDate && (jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) })), showDate && showAmount && jsxRuntime.jsx(Text$j, { children: "\u00B7" }), showAmount && (jsxRuntime.jsx(Text$j, { children: common.formatCurrency(transaction.transactionable.amount ||
19349
+ } }, { children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [(showTitle || showState) && (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$h, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] }))), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showAccountName && jsxRuntime.jsx(Text$h, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }), showAccountName && showDate && jsxRuntime.jsx(Text$h, { children: "\u00B7" }), showDate && (jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) })), showDate && showAmount && jsxRuntime.jsx(Text$h, { children: "\u00B7" }), showAmount && (jsxRuntime.jsx(Text$h, { children: common.formatCurrency(transaction.transactionable.amount ||
19350
19350
  transaction.amount, transaction.currencyId) }))] }))] })) }), showDownload && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })))] }), index));
19351
19351
  }) }));
19352
19352
  };
19353
19353
 
19354
- var Text$i = antd.Typography.Text;
19354
+ var Text$g = antd.Typography.Text;
19355
19355
  var DISPLAY_WIDTH = 1200;
19356
19356
  function Transactions(_a) {
19357
19357
  var transactionComponent = _a.transactionComponent, _b = _a.showSearchBar, showSearchBar = _b === void 0 ? true : _b, _c = _a.showTitle, showTitle = _c === void 0 ? true : _c, _d = _a.title, title = _d === void 0 ? "Past transactions" : _d, _e = _a.columns, columns = _e === void 0 ? ["date", "title", "state", "amount", "download"] : _e, className = _a.className, _f = _a.shadow, shadow = _f === void 0 ? "shadow-md" : _f, searchBarClassName = _a.searchBarClassName, _g = _a.useModal, useModal = _g === void 0 ? false : _g, onTransactionClick = _a.onTransactionClick, _h = _a.suppressTransactionDisplay, suppressTransactionDisplay = _h === void 0 ? false : _h, _j = _a.kindsToShow, kindsToShow = _j === void 0 ? [
@@ -19464,7 +19464,7 @@ function TransactionsDisplay(_a) {
19464
19464
  onTransactionDisplayClose === null || onTransactionDisplayClose === void 0 ? void 0 : onTransactionDisplayClose(selectedTransaction);
19465
19465
  setDrawerOpen(false);
19466
19466
  }
19467
- return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full bunny-shadow-padding-xb gap-2 ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-1" : "flex-row items-center", " justify-between") }, { children: [showTitle ? (jsxRuntime.jsx(Text$i, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
19467
+ return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full bunny-shadow-padding-xb gap-2 ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-1" : "flex-row items-center", " justify-between") }, { children: [showTitle ? (jsxRuntime.jsx(Text$g, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
19468
19468
  ), showSearchBar && (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "") }, { children: jsxRuntime.jsx(antd.Input, { className: searchBarClassName
19469
19469
  ? searchBarClassName
19470
19470
  : "border border-slate-200", onChange: function (e) {
@@ -19609,10 +19609,10 @@ var getBillingDetails = function (_a) {
19609
19609
  });
19610
19610
  };
19611
19611
 
19612
- var Text$h = antd.Typography.Text;
19612
+ var Text$f = antd.Typography.Text;
19613
19613
  var DrawerHeader = function (_a) {
19614
19614
  var description = _a.description, onClose = _a.onClose, title = _a.title, closeButtonClassName = _a.closeButtonClassName;
19615
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-2" }, { children: [jsxRuntime.jsx(Text$h, __assign({ className: "text-xl", style: { fontWeight: 400 } }, { children: title })), onClose ? (jsxRuntime.jsx("button", __assign({ id: "closePayment", onClick: onClose, className: closeButtonClassName }, { children: jsxRuntime.jsx(icons.CloseOutlined, {}) }))) : null] })), description && jsxRuntime.jsx("div", __assign({ className: "text-xs" }, { children: description }))] })));
19615
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-2" }, { children: [jsxRuntime.jsx(Text$f, __assign({ className: "text-xl", style: { fontWeight: 400 } }, { children: title })), onClose ? (jsxRuntime.jsx("button", __assign({ id: "closePayment", onClick: onClose, className: closeButtonClassName }, { children: jsxRuntime.jsx(icons.CloseOutlined, {}) }))) : null] })), description && jsxRuntime.jsx("div", __assign({ className: "text-xs" }, { children: description }))] })));
19616
19616
  };
19617
19617
 
19618
19618
  var PaymentMethod = function (_a) {
@@ -19787,18 +19787,18 @@ function InitialSignupForm(_a) {
19787
19787
  ] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) }))] })), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, __assign({ type: "primary", onClick: handleSubmit, loading: submitting, className: "w-full mt-4" }, { children: "Proceed to payment" })) })] })));
19788
19788
  }
19789
19789
 
19790
- var Title = antd.Typography.Title, Text$g = antd.Typography.Text;
19790
+ var Title = antd.Typography.Title, Text$e = antd.Typography.Text;
19791
19791
  function PaymentSuccessDisplay(_a) {
19792
19792
  var amountPaid = _a.amountPaid, className = _a.className, companyName = _a.companyName, returnUrl = _a.returnUrl, style = _a.style, currencyId = _a.currencyId;
19793
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center justify-center h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "mt-2 m-0" }, { children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] })), returnUrl && (jsxRuntime.jsxs(Text$g, __assign({ className: "text-slate-500 cursor-pointer underline", onClick: function () { return (window.location.href = returnUrl); } }, { children: ["Back to ", companyName] })))] })));
19793
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center justify-center h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "mt-2 m-0" }, { children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] })), returnUrl && (jsxRuntime.jsxs(Text$e, __assign({ className: "text-slate-500 cursor-pointer underline", onClick: function () { return (window.location.href = returnUrl); } }, { children: ["Back to ", companyName] })))] })));
19794
19794
  }
19795
19795
 
19796
- var Text$f = antd.Typography.Text;
19796
+ var Text$d = antd.Typography.Text;
19797
19797
  function PriceListDisplay(_a) {
19798
19798
  var priceListData = _a.priceListData, topNavImageUrl = _a.topNavImageUrl;
19799
19799
  if (!priceListData)
19800
19800
  return null;
19801
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("div", __assign({ className: "flex flex-col justify-between h-full my-12" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col space-y-8" }, { children: [jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false }), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxRuntime.jsx(Text$f, __assign({ className: "text-slate-500 font-bold text-lg" }, { children: priceListData.name })), jsxRuntime.jsxs(Text$f, __assign({ className: "font-bold text-xl" }, { children: [common.formatCurrency(priceListData.basePrice, priceListData.currencyId), " ", "/ month"] }))] })), priceListData.trialAllowed ? (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxRuntime.jsxs(Text$f, __assign({ style: { fontSize: "16px" }, className: "text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsxRuntime.jsx(Text$f, __assign({ className: "text-slate-500", style: { fontSize: "12px" } }, { children: "You will not be charged until the last day of the trial." }))] }))) : null] })) })) }));
19801
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("div", __assign({ className: "flex flex-col justify-between h-full my-12" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col space-y-8" }, { children: [jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false }), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxRuntime.jsx(Text$d, __assign({ className: "text-slate-500 font-bold text-lg" }, { children: priceListData.name })), jsxRuntime.jsxs(Text$d, __assign({ className: "font-bold text-xl" }, { children: [common.formatCurrency(priceListData.basePrice, priceListData.currencyId), " ", "/ month"] }))] })), priceListData.trialAllowed ? (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxRuntime.jsxs(Text$d, __assign({ style: { fontSize: "16px" }, className: "text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsxRuntime.jsx(Text$d, __assign({ className: "text-slate-500", style: { fontSize: "12px" } }, { children: "You will not be charged until the last day of the trial." }))] }))) : null] })) })) }));
19802
19802
  }
19803
19803
 
19804
19804
  var showErrorNotification = common.useErrorNotification();
@@ -20509,13 +20509,13 @@ var billingPeriodConverter = function (period) {
20509
20509
 
20510
20510
  var removeHTMLTagsRegex = /<br>(?=(?:\s*<[^>]*>)*$)|(<br>)|<[^>]*>/gi;
20511
20511
  // Description is a string that can contain HTML tags. We want to remove all HTML tags except <br> tags.
20512
- var createPlanDescription = function (plan) {
20513
- return (plan.description || "").replace(removeHTMLTagsRegex, function (x, y) {
20512
+ var createPlanDescription = function (priceList) {
20513
+ return (priceList.plan.description || "").replace(removeHTMLTagsRegex, function (x, y) {
20514
20514
  return y ? " & " : "";
20515
20515
  });
20516
20516
  };
20517
- var getActivePlanPriceData = function (plan, selectedPriceList) {
20518
- if (!plan) {
20517
+ var getActivePlanPriceData = function (priceList, selectedPriceList) {
20518
+ if (!priceList) {
20519
20519
  return;
20520
20520
  }
20521
20521
  // If a period option is selected, return the charge that matches the selected period option
@@ -20523,33 +20523,28 @@ var getActivePlanPriceData = function (plan, selectedPriceList) {
20523
20523
  // Default to first price list charge
20524
20524
  var lowestPLCharge;
20525
20525
  // Find the lowest price list charge with a billing period that matches the selected period option
20526
- for (var i = 0; i < plan.priceLists.length; i++) {
20527
- var priceList = plan.priceLists[i];
20528
- if (priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id)) {
20529
- activeBillingPLCharge = priceList.charges[0];
20530
- break;
20531
- }
20532
- for (var j = 0; j < priceList.charges.length; j++) {
20533
- var charge = priceList.charges[j];
20534
- if (charge.chargeType === common.ChargeType.USAGE)
20535
- continue;
20536
- if (activeBillingPLCharge) {
20537
- // If we already found a charge with the same billing period check if this charge is lower
20538
- if (charge.basePrice < activeBillingPLCharge.basePrice &&
20539
- charge.billingPeriod === (activeBillingPLCharge === null || activeBillingPLCharge === void 0 ? void 0 : activeBillingPLCharge.billingPeriod)) {
20540
- activeBillingPLCharge = charge;
20541
- }
20542
- }
20543
- // If a period option is selected, only return the charge if it matches the selected period option
20544
- else if (selectedPriceList &&
20545
- charge.billingPeriod ===
20546
- periodMonthsConverter(selectedPriceList.periodMonths)) {
20526
+ if (priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id)) {
20527
+ activeBillingPLCharge = priceList.charges[0];
20528
+ }
20529
+ for (var j = 0; j < priceList.charges.length; j++) {
20530
+ var charge = priceList.charges[j];
20531
+ if (charge.chargeType === common.ChargeType.USAGE)
20532
+ continue;
20533
+ if (activeBillingPLCharge) {
20534
+ // If we already found a charge with the same billing period check if this charge is lower
20535
+ if (charge.basePrice < activeBillingPLCharge.basePrice &&
20536
+ charge.billingPeriod === (activeBillingPLCharge === null || activeBillingPLCharge === void 0 ? void 0 : activeBillingPLCharge.billingPeriod)) {
20547
20537
  activeBillingPLCharge = charge;
20548
20538
  }
20549
- // Otherwise, return the lowest price list charge
20550
- else if (charge.basePrice < ((lowestPLCharge === null || lowestPLCharge === void 0 ? void 0 : lowestPLCharge.basePrice) || -1)) {
20551
- lowestPLCharge = charge;
20552
- }
20539
+ }
20540
+ // If a period option is selected, only return the charge if it matches the selected period option
20541
+ else if (selectedPriceList &&
20542
+ charge.billingPeriod === periodMonthsConverter(selectedPriceList.periodMonths)) {
20543
+ activeBillingPLCharge = charge;
20544
+ }
20545
+ // Otherwise, return the lowest price list charge
20546
+ else if (charge.basePrice < ((lowestPLCharge === null || lowestPLCharge === void 0 ? void 0 : lowestPLCharge.basePrice) || -1)) {
20547
+ lowestPLCharge = charge;
20553
20548
  }
20554
20549
  }
20555
20550
  return {
@@ -20569,8 +20564,7 @@ var isPriceListDisabled = function (_a) {
20569
20564
  var isPriceListCurrentSubscription = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === priceList.id;
20570
20565
  // Is this plan the one that the user is upgrading from
20571
20566
  var isUpgradingPlan = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.plan.id) === priceList.plan.id;
20572
- if ((subscriptionPlan && !isUpgradingPlan) ||
20573
- isPriceListCurrentSubscription) {
20567
+ if ((subscriptionPlan && !isUpgradingPlan) || isPriceListCurrentSubscription) {
20574
20568
  disableOnClick = true;
20575
20569
  }
20576
20570
  return disableOnClick;
@@ -20595,7 +20589,7 @@ var CheckoutPrice = function (_a) {
20595
20589
  };
20596
20590
 
20597
20591
  var CheckoutBarSummarySection = function (_a) {
20598
- var _b, _c;
20592
+ var _b;
20599
20593
  var open = _a.open, quantityLocal = _a.quantityLocal, quote = _a.quote, selectedPriceList = _a.selectedPriceList, onClickCheckout = _a.onClickCheckout, upgradingSubscription = _a.upgradingSubscription, quotePreviewData = _a.quotePreviewData;
20600
20594
  // Context
20601
20595
  var apiHost = react.useContext(BunnyContext).apiHost;
@@ -20620,12 +20614,7 @@ var CheckoutBarSummarySection = function (_a) {
20620
20614
  isFetching ||
20621
20615
  selectedPriceList.id === (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) ||
20622
20616
  open);
20623
- var planChangeOptions = queryClient.getQueryData(common.QueryKeyFactory.default.planChangeOptionsKey({
20624
- subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id,
20625
- token: token,
20626
- }));
20627
- var selectedPlan = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.find(function (plan) { return plan.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.plan.id); });
20628
- var activeCharge = (_c = getActivePlanPriceData(selectedPlan, selectedPriceList)) === null || _c === void 0 ? void 0 : _c.activeCharge;
20617
+ var activeCharge = (_b = getActivePlanPriceData(selectedPriceList, selectedPriceList)) === null || _b === void 0 ? void 0 : _b.activeCharge;
20629
20618
  var isUsage = (activeCharge === null || activeCharge === void 0 ? void 0 : activeCharge.chargeType) === common.ChargeType.USAGE;
20630
20619
  var hasPaymentMethodsOrIsFree = Boolean(paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.length) ||
20631
20620
  Boolean(quote && getQuoteAmountDue(quote) === 0);
@@ -20767,64 +20756,35 @@ var PlanPickerCheckoutBar = function (_a) {
20767
20756
  };
20768
20757
 
20769
20758
  // WARNING: There is a preview button on APP that will need to be changed if this query is changed
20770
- var PLAN_CHANGE_OPTIONS_QUERY = "\n query planChangeOptions($subscriptionId: ID) {\n planChangeOptions(subscriptionId: $subscriptionId) {\n products {\n everythingInPlus\n id\n name\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n plans {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n priceLists {\n basePrice\n id\n currencyId\n periodMonths\n plan {\n id\n position\n }\n product {\n id\n }\n charges {\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n feature {\n name\n unitName\n }\n }\n }\n productId\n }\n }\n }";
20771
- var getPlanChangeOptions = function (_a) {
20772
- var isInPreviewMode = _a.isInPreviewMode, token = _a.token, upgradingSubscription = _a.upgradingSubscription, apiHost = _a.apiHost;
20759
+ var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n basePrice\n id\n currencyId\n periodMonths\n plan {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n }\n product {\n id\n }\n charges {\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n feature {\n name\n unitName\n }\n }\n }\n }\n }";
20760
+ var getPriceListChangeOptions = function (_a) {
20761
+ var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription;
20773
20762
  return __awaiter(void 0, void 0, void 0, function () {
20774
- var response, planChangeOptions;
20763
+ var response, priceListChangeOptions;
20775
20764
  return __generator(this, function (_b) {
20776
20765
  switch (_b.label) {
20777
20766
  case 0: return [4 /*yield*/, common.gqlRequest({
20778
20767
  isInPreviewMode: isInPreviewMode,
20779
- query: PLAN_CHANGE_OPTIONS_QUERY,
20780
- vars: { subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id },
20768
+ query: PRICE_LIST_CHANGE_OPTIONS_QUERY,
20769
+ vars: { subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id, productId: productId },
20781
20770
  token: token,
20782
20771
  apiHost: apiHost,
20783
20772
  })];
20784
20773
  case 1:
20785
20774
  response = _b.sent();
20786
- planChangeOptions = response.planChangeOptions;
20787
- if (planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.errors)
20788
- throw planChangeOptions.errors;
20775
+ priceListChangeOptions = response;
20776
+ if (priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.errors)
20777
+ throw priceListChangeOptions.errors;
20789
20778
  // Sort planChangeOptions.plans by position
20790
- if (planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) {
20791
- planChangeOptions.plans.sort(function (a, b) { return a.position - b.position; });
20779
+ if (priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) {
20780
+ priceListChangeOptions.priceLists.sort(function (a, b) { return a.plan.position - b.plan.position; });
20792
20781
  }
20793
- return [2 /*return*/, planChangeOptions];
20782
+ return [2 /*return*/, priceListChangeOptions];
20794
20783
  }
20795
20784
  });
20796
20785
  });
20797
20786
  };
20798
20787
 
20799
- var portalPreviewQuery = function (id) { return "\nquery portalPreviewQuery {\n product(id: ".concat(id, ") {\n everythingInPlus\n id\n name\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n plans(filter: \"plan.productId is ").concat(id, "\") {\n nodes {\n\t\t\tcode\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n priceLists {\n basePrice\n id\n currencyId\n periodMonths\n plan {\n id\n position\n }\n product {\n id\n }\n charges {\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n feature {\n name\n unitName\n }\n }\n }\n }\n }\n}"); };
20800
- var getPortalPreviewData = function (id, apiHost, token) { return __awaiter(void 0, void 0, void 0, function () {
20801
- var response;
20802
- return __generator(this, function (_a) {
20803
- switch (_a.label) {
20804
- case 0: return [4 /*yield*/, common.gqlRequest({
20805
- isInPreviewMode: true,
20806
- query: portalPreviewQuery(id),
20807
- token: token || "",
20808
- apiHost: apiHost,
20809
- })];
20810
- case 1:
20811
- response = _a.sent();
20812
- if (response.product && response.plans) {
20813
- response.plans = response.plans.nodes;
20814
- response.products = [response.product];
20815
- delete response.product;
20816
- // Sort plans by position
20817
- if (response.plans) {
20818
- response.plans.sort(function (a, b) { return a.position - b.position; });
20819
- }
20820
- return [2 /*return*/, response];
20821
- }
20822
- else
20823
- throw response;
20824
- }
20825
- });
20826
- }); };
20827
-
20828
20788
  var ErrorView = function (_a) {
20829
20789
  var children = _a.children, message = _a.message;
20830
20790
  return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full", style: { marginTop: "80px" } }, { children: [jsxRuntime.jsx("div", __assign({ style: { fontSize: "32px" } }, { children: message })), children] })));
@@ -20861,105 +20821,57 @@ var StyledRadioGroup = styled__default["default"].div(templateObject_2 || (templ
20861
20821
  });
20862
20822
  var templateObject_1$4, templateObject_2;
20863
20823
 
20864
- var NextPriceListButton = function (_a) {
20865
- var availablePriceLists = _a.availablePriceLists, priceListStart = _a.priceListStart, setPriceListStart = _a.setPriceListStart;
20866
- return (jsxRuntime.jsxs("div", __assign({ className: "absolute flex gap-1", style: { top: "12px", right: "8px", zIndex: 10 } }, { children: [priceListStart > 0 && (jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center rounded-full shadow p-1 cursor-pointer", onClick: function () {
20867
- setPriceListStart(function (prev) {
20868
- var newValue = prev - 1;
20869
- if (newValue < 0) {
20870
- return prev;
20871
- }
20872
- return newValue;
20873
- });
20874
- }, style: { width: "22px", height: "22px" } }, { children: jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faChevronLeft }) }))), priceListStart < availablePriceLists.length - 3 && (jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center rounded-full shadow p-1 cursor-pointer", onClick: function () {
20875
- return setPriceListStart(function (prev) {
20876
- var newValue = prev + 1;
20877
- if (newValue >= availablePriceLists.length) {
20878
- return prev;
20879
- }
20880
- return newValue;
20881
- });
20882
- }, style: { width: "22px", height: "22px" } }, { children: jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faChevronRight }) })))] })));
20883
- };
20884
-
20885
- var getAvailablePlansAndPriceLists = function (_a) {
20886
- var availablePriceLists = _a.availablePriceLists, planChangeOptions = _a.planChangeOptions, priceListStart = _a.priceListStart;
20887
- var displayPriceLists = availablePriceLists.slice(priceListStart, priceListStart + 3);
20888
- var availablePlansArray = displayPriceLists === null || displayPriceLists === void 0 ? void 0 : displayPriceLists.map(function (priceList) {
20889
- var _a;
20890
- var plan = (_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.find(function (plan) { return plan.id === priceList.plan.id; });
20891
- return plan;
20892
- });
20893
- return {
20894
- availablePlansArray: availablePlansArray,
20895
- displayPriceLists: displayPriceLists,
20896
- };
20897
- };
20898
- var everythingInPlusString = function (_a) {
20899
- var plan = _a.plan;
20900
- return "Everything in ".concat(plan.name, ", plus");
20901
- };
20902
-
20903
- var PLAN_GRID_PADDING = 4;
20904
- var PlanPickerGridCell = function (_a) {
20905
- var children = _a.children, noBorder = _a.noBorder;
20906
- var isMobile = common.useIsMobile();
20907
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col", style: isMobile
20908
- ? {}
20909
- : __assign({}, (noBorder ? {} : { borderLeft: "1px solid ".concat(common.SLATE_200) })) }, { children: [jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: children })), !isMobile && jsxRuntime.jsx(antd.Divider, {})] })));
20910
- };
20911
-
20912
20824
  var PriceListCardTitle = function (_a) {
20913
- var plan = _a.plan, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, trialRemainingDays = _a.trialRemainingDays;
20825
+ var priceList = _a.priceList, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, trialRemainingDays = _a.trialRemainingDays;
20914
20826
  var isMobile = common.useIsMobile();
20915
20827
  return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-4" }, { children: [Boolean(trialRemainingDays) && (jsxRuntime.jsx("div", __assign({ className: "font-medium text-secondary", style: { height: "1rem" } }, { children: isPriceListCurrentSubscription
20916
20828
  ? "Trial ends in ".concat(trialRemainingDays, " day").concat(trialRemainingDays === 1 ? "" : "s")
20917
- : " " }))), jsxRuntime.jsx("div", __assign({ className: "font-medium text-center ".concat(isMobile ? "text-slate-500" : "text-orange-600"), style: { fontSize: "20px" } }, { children: plan.name }))] })));
20918
- };
20919
-
20920
- var Text$e = antd.Typography.Text;
20921
- var PriceListCardDescription = function (_a) {
20922
- var description = _a.description;
20923
- if (!description)
20924
- return null;
20925
- return jsxRuntime.jsx(Text$e, __assign({ className: "text-center" }, { children: description }));
20829
+ : " " }))), jsxRuntime.jsx("div", __assign({ className: "font-medium text-center ".concat(isMobile ? "text-slate-500" : "text-orange-600"), style: { fontSize: "20px" } }, { children: priceList.plan.name }))] })));
20926
20830
  };
20927
20831
 
20928
20832
  var PriceListCardPrice = function (_a) {
20929
- var plan = _a.plan, priceList = _a.priceList;
20930
- return (jsxRuntime.jsx("div", __assign({ className: "font-medium text-center text-gray-900", style: { fontSize: "32px" } }, { children: !plan.pricingStyle || plan.pricingStyle === common.PricingStyle.PRICED
20833
+ var priceList = _a.priceList;
20834
+ return (jsxRuntime.jsx("div", __assign({ className: "font-medium text-center text-gray-900", style: { fontSize: "32px" } }, { children: !priceList.plan.pricingStyle || priceList.plan.pricingStyle === common.PricingStyle.PRICED
20931
20835
  ? common.formatCurrency(priceList.basePrice, priceList.currencyId, 0)
20932
- : plan.pricingStyle === common.PricingStyle.CONTACT_US
20836
+ : priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US
20933
20837
  ? ""
20934
20838
  : "Free" })));
20935
20839
  };
20936
20840
 
20937
- var Text$d = antd.Typography.Text;
20841
+ var Text$c = antd.Typography.Text;
20842
+ var PriceListCardDescription = function (_a) {
20843
+ var description = _a.description;
20844
+ if (!description)
20845
+ return null;
20846
+ return jsxRuntime.jsx(Text$c, __assign({ className: "text-center" }, { children: description }));
20847
+ };
20848
+
20849
+ var Text$b = antd.Typography.Text;
20938
20850
  var PriceListCardPriceDescription = function (_a) {
20939
- var feature = _a.feature, plan = _a.plan, priceList = _a.priceList;
20851
+ var feature = _a.feature, priceList = _a.priceList;
20940
20852
  var isMobile = common.useIsMobile();
20941
- var doesPlanHaveFlatFeeCharges = plan.priceLists.some(function (priceList) {
20942
- return priceList.charges.some(function (charge) {
20943
- return charge.pricingModel === common.PricingModel.FLAT && charge.basePrice > 0;
20944
- });
20945
- });
20946
- if (priceList.periodMonths <= 0 || plan.pricingStyle !== common.PricingStyle.PRICED)
20853
+ var doesPlanHaveFlatFeeCharges = priceList.charges.some(function (charge) { return charge.pricingModel === common.PricingModel.FLAT && charge.basePrice > 0; });
20854
+ if (priceList.periodMonths <= 0 || priceList.plan.pricingStyle !== common.PricingStyle.PRICED)
20947
20855
  return null;
20948
- return (jsxRuntime.jsx(Text$d, __assign({ className: "text-center text-gray-900", style: {
20856
+ return (jsxRuntime.jsx(Text$b, __assign({ className: "text-center text-gray-900", style: {
20949
20857
  fontSize: isMobile ? "13px" : "12px",
20950
- } }, { children: plan.pricingDescription
20951
- ? plan.pricingDescription
20858
+ } }, { children: priceList.plan.pricingDescription
20859
+ ? priceList.plan.pricingDescription
20952
20860
  : "per ".concat((feature === null || feature === void 0 ? void 0 : feature.unitName) && !doesPlanHaveFlatFeeCharges
20953
20861
  ? "".concat(feature.unitName.toLowerCase(), " / ")
20954
20862
  : "").concat(common.PERIOD_LABELS[periodMonthsConverter(priceList.periodMonths)]) })));
20955
20863
  };
20956
20864
 
20865
+ var CheckIcon = function (_a) {
20866
+ var backgroundColor = _a.backgroundColor, size = _a.size;
20867
+ return (jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center rounded-full shrink-0", style: { width: size, height: size, backgroundColor: backgroundColor } }, { children: jsxRuntime.jsx("svg", __assign({ width: "8", height: "6", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: jsxRuntime.jsx("path", { d: "M1.5 2.99992L3.16667 4.66659L6.5 1.33325", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) })));
20868
+ };
20869
+
20957
20870
  var PriceListCardButton = function (_a) {
20958
- var disableOnClick = _a.disableOnClick, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, plan = _a.plan, subscriptionPlan = _a.subscriptionPlan;
20871
+ var disableOnClick = _a.disableOnClick, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, priceList = _a.priceList, subscriptionPlan = _a.subscriptionPlan;
20959
20872
  // Context
20960
20873
  var upgradingSubscription = react.useContext(SubscriptionsContext).upgradingSubscription;
20961
- var isPriceListNonSubscribedCurrentPlan = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.plan.id) === plan.id &&
20962
- !isPriceListCurrentSubscription;
20874
+ var isPriceListNonSubscribedCurrentPlan = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.plan.id) === priceList.plan.id && !isPriceListCurrentSubscription;
20963
20875
  var createButtonText = function () {
20964
20876
  if (isPriceListCurrentSubscription)
20965
20877
  return "Current";
@@ -20967,8 +20879,8 @@ var PriceListCardButton = function (_a) {
20967
20879
  return "Selected";
20968
20880
  if (subscriptionPlan && !isPriceListNonSubscribedCurrentPlan)
20969
20881
  return "Subscribed";
20970
- if (plan.pricingStyle === common.PricingStyle.CONTACT_US)
20971
- return plan.contactUsLabel;
20882
+ if (priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US)
20883
+ return priceList.plan.contactUsLabel;
20972
20884
  return "Select";
20973
20885
  };
20974
20886
  return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col grow w-full justify-end" }, { children: jsxRuntime.jsx(StyledCardButton, __assign({ className: "flex justify-center w-full" }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "w-full", disabled: disableOnClick, style: {
@@ -20978,29 +20890,8 @@ var PriceListCardButton = function (_a) {
20978
20890
  var StyledCardButton = styled__default["default"].div(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n .ant-btn-primary {\n border-color: transparent !important;\n }\n .ant-btn-primary:disabled {\n background: ", ";\n color: ", ";\n }\n"], ["\n .ant-btn-primary {\n border-color: transparent !important;\n }\n .ant-btn-primary:disabled {\n background: ", ";\n color: ", ";\n }\n"])), common.SLATE_200, common.SLATE_600);
20979
20891
  var templateObject_1$3;
20980
20892
 
20981
- var PriceListCardDesktop = function (_a) {
20982
- var description = _a.description, disableOnClick = _a.disableOnClick, feature = _a.feature, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, onClick = _a.onClick, plan = _a.plan, priceList = _a.priceList, subscriptionPlan = _a.subscriptionPlan, trialRemainingDays = _a.trialRemainingDays;
20983
- return (jsxRuntime.jsx(PlanPickerGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center justify-between w-full rounded-md gap-4 pt-6 px-4 pb-4 ".concat(disableOnClick ? "" : "cursor-pointer"), onClick: function () {
20984
- if (!disableOnClick) {
20985
- if (plan.pricingStyle === common.PricingStyle.CONTACT_US) {
20986
- window.open(plan.contactUsUrl, "_blank");
20987
- }
20988
- else
20989
- onClick(priceList);
20990
- }
20991
- }, style: {
20992
- height: "100%",
20993
- maxWidth: "440px",
20994
- } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-3" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, plan: plan, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] })), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardPrice, { plan: plan, priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, plan: plan, priceList: priceList })] }))] })), jsxRuntime.jsx(PriceListCardButton, { disableOnClick: disableOnClick, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, plan: plan, subscriptionPlan: subscriptionPlan })] })) }));
20995
- };
20996
-
20997
- var CheckIcon = function (_a) {
20998
- var backgroundColor = _a.backgroundColor, size = _a.size;
20999
- return (jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center rounded-full shrink-0", style: { width: size, height: size, backgroundColor: backgroundColor } }, { children: jsxRuntime.jsx("svg", __assign({ width: "8", height: "6", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: jsxRuntime.jsx("path", { d: "M1.5 2.99992L3.16667 4.66659L6.5 1.33325", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) })));
21000
- };
21001
-
21002
20893
  var PriceListCardMobile = function (_a) {
21003
- var description = _a.description, disableOnClick = _a.disableOnClick, feature = _a.feature, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, onClick = _a.onClick, plan = _a.plan, priceList = _a.priceList, subscriptionPlan = _a.subscriptionPlan, trialRemainingDays = _a.trialRemainingDays;
20894
+ var description = _a.description, disableOnClick = _a.disableOnClick, feature = _a.feature, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, onClick = _a.onClick, priceList = _a.priceList, subscriptionPlan = _a.subscriptionPlan, trialRemainingDays = _a.trialRemainingDays;
21004
20895
  var brandColor = react.useContext(BrandContext).brandColor;
21005
20896
  return (jsxRuntime.jsxs("div", __assign({ className: "relative flex flex-col border-2 border-solid rounded-lg p-4", onClick: function () {
21006
20897
  if (!disableOnClick)
@@ -21011,22 +20902,44 @@ var PriceListCardMobile = function (_a) {
21011
20902
  } }, { children: [isSelected && (jsxRuntime.jsx("div", __assign({ className: "absolute", style: {
21012
20903
  top: "10px",
21013
20904
  right: "10px",
21014
- } }, { children: jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "20px" }) }))), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center grow gap-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, plan: plan, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] })), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardPrice, { plan: plan, priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, plan: plan, priceList: priceList })] })), jsxRuntime.jsx(PriceListCardButton, { disableOnClick: disableOnClick, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, plan: plan, subscriptionPlan: subscriptionPlan })] }))] })));
20905
+ } }, { children: jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "20px" }) }))), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center grow gap-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, priceList: priceList, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] })), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardPrice, { priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, priceList: priceList })] })), jsxRuntime.jsx(PriceListCardButton, { disableOnClick: disableOnClick, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, subscriptionPlan: subscriptionPlan })] }))] })));
20906
+ };
20907
+
20908
+ var PLAN_GRID_PADDING = 4;
20909
+ var PlanPickerGridCell = function (_a) {
20910
+ var children = _a.children, noBorder = _a.noBorder;
20911
+ var isMobile = common.useIsMobile();
20912
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col", style: isMobile
20913
+ ? {}
20914
+ : __assign({}, (noBorder ? {} : { borderLeft: "1px solid ".concat(common.SLATE_200) })) }, { children: [jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: children })), !isMobile && jsxRuntime.jsx(antd.Divider, {})] })));
20915
+ };
20916
+
20917
+ var PriceListCardDesktop = function (_a) {
20918
+ var description = _a.description, disableOnClick = _a.disableOnClick, feature = _a.feature, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, onClick = _a.onClick, priceList = _a.priceList, subscriptionPlan = _a.subscriptionPlan, trialRemainingDays = _a.trialRemainingDays;
20919
+ return (jsxRuntime.jsx(PlanPickerGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center justify-between w-full rounded-md gap-4 pt-6 px-4 pb-4 ".concat(disableOnClick ? "" : "cursor-pointer"), onClick: function () {
20920
+ if (!disableOnClick) {
20921
+ if (priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US) {
20922
+ window.open(priceList.plan.contactUsUrl, "_blank");
20923
+ }
20924
+ else
20925
+ onClick(priceList);
20926
+ }
20927
+ }, style: {
20928
+ height: "100%",
20929
+ maxWidth: "440px",
20930
+ } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-3" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, priceList: priceList, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] })), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center gap-2" }, { children: [jsxRuntime.jsx(PriceListCardPrice, { priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, priceList: priceList })] }))] })), jsxRuntime.jsx(PriceListCardButton, { disableOnClick: disableOnClick, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, subscriptionPlan: subscriptionPlan })] })) }));
21015
20931
  };
21016
20932
 
21017
20933
  var PriceListCard = function (_a) {
21018
20934
  var _b;
21019
- var isSelected = _a.isSelected, onClick = _a.onClick, plan = _a.plan, priceList = _a.priceList, subscriptions = _a.subscriptions, trialRemainingDays = _a.trialRemainingDays;
20935
+ var isSelected = _a.isSelected, onClick = _a.onClick, priceList = _a.priceList, subscriptions = _a.subscriptions, trialRemainingDays = _a.trialRemainingDays;
21020
20936
  // Context
21021
20937
  var upgradingSubscription = react.useContext(SubscriptionsContext).upgradingSubscription;
21022
20938
  var isMobile = common.useIsMobile();
21023
- if (!plan) {
21024
- return null;
21025
- }
21026
20939
  // Derived state
21027
- var description = createPlanDescription(plan);
20940
+ var description = createPlanDescription(priceList);
21028
20941
  // Get the active price list charge for this plan
21029
- var activeCharge = (_b = getActivePlanPriceData(plan, priceList)) === null || _b === void 0 ? void 0 : _b.activeCharge;
20942
+ var activeCharge = (_b = getActivePlanPriceData(priceList, priceList)) === null || _b === void 0 ? void 0 : _b.activeCharge;
21030
20943
  // Is the price list the current price list for the upgradingSubscription
21031
20944
  var isPriceListCurrentSubscription = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === priceList.id;
21032
20945
  var disableOnClick = isPriceListDisabled({
@@ -21036,7 +20949,7 @@ var PriceListCard = function (_a) {
21036
20949
  });
21037
20950
  var subscriptionPlan = subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.find(function (subscription) {
21038
20951
  var _a, _b;
21039
- return subscription.plan.id === plan.id &&
20952
+ return subscription.plan.id === priceList.plan.id &&
21040
20953
  ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== common.SubscriptionState.CANCELED &&
21041
20954
  ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== common.SubscriptionState.EXPIRED;
21042
20955
  });
@@ -21044,50 +20957,48 @@ var PriceListCard = function (_a) {
21044
20957
  return null;
21045
20958
  }
21046
20959
  var feature = activeCharge.feature;
21047
- return isMobile ? (jsxRuntime.jsx(PriceListCardMobile, { description: description, disableOnClick: disableOnClick, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, onClick: onClick, plan: plan, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan })) : (jsxRuntime.jsx(PriceListCardDesktop, { description: description, disableOnClick: disableOnClick, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, onClick: onClick, plan: plan, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan }));
20960
+ return isMobile ? (jsxRuntime.jsx(PriceListCardMobile, { description: description, disableOnClick: disableOnClick, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, onClick: onClick, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan })) : (jsxRuntime.jsx(PriceListCardDesktop, { description: description, disableOnClick: disableOnClick, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, onClick: onClick, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan }));
21048
20961
  };
21049
20962
 
21050
- var PLANS_TO_DISPLAY = 3;
20963
+ var Text$a = antd.Typography.Text;
20964
+ var PriceListCardFeature = function (_a) {
20965
+ var index = _a.index, planFeature = _a.planFeature;
20966
+ var brandColor = react.useContext(BrandContext).brandColor;
20967
+ if (planFeature.feature.kind === "GROUP")
20968
+ return jsxRuntime.jsx(Text$a, __assign({ className: "font-medium base-text" }, { children: planFeature.name }));
20969
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }), jsxRuntime.jsx(Text$a, __assign({ className: "text-gray-600" }, { children: planFeature.feature.name }))] }), index));
20970
+ };
21051
20971
 
21052
- var Text$c = antd.Typography.Text;
21053
- var filterUniqueFeatures = function (_a) {
21054
- // Remove any features that in previous plans if everythingInPlus is true
21055
- var availablePlansArray = _a.availablePlansArray;
21056
- var uniqueFeatures = new Set();
21057
- var updatedPlansArray = availablePlansArray.map(function (plan) {
20972
+ var getAvailablePlansAndPriceLists = function (_a) {
20973
+ var availablePriceLists = _a.availablePriceLists, priceListChangeOptions = _a.priceListChangeOptions, priceListStart = _a.priceListStart;
20974
+ var displayPriceLists = availablePriceLists.slice(priceListStart, priceListStart + 3);
20975
+ var availablePlansArray = displayPriceLists === null || displayPriceLists === void 0 ? void 0 : displayPriceLists.map(function (displayPriceList) {
21058
20976
  var _a;
21059
- var updatedPlanFeatures = (_a = plan.planFeatures) === null || _a === void 0 ? void 0 : _a.filter(function (feature) {
21060
- if (uniqueFeatures.has(feature.featureId)) {
21061
- return false;
21062
- }
21063
- else {
21064
- uniqueFeatures.add(feature.featureId);
21065
- return true;
21066
- }
21067
- });
21068
- return __assign(__assign({}, plan), { planFeatures: updatedPlanFeatures });
20977
+ var foundPriceList = (_a = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _a === void 0 ? void 0 : _a.find(function (priceList) { return priceList.plan.id === displayPriceList.plan.id; });
20978
+ return foundPriceList.plan;
21069
20979
  });
21070
- return updatedPlansArray;
20980
+ return {
20981
+ availablePlansArray: availablePlansArray,
20982
+ displayPriceLists: displayPriceLists,
20983
+ };
21071
20984
  };
21072
- var EverythingPlanFeatures = function (_a) {
21073
- var availablePlansArray = _a.availablePlansArray, selectedProduct = _a.selectedProduct;
21074
- var brandColor = react.useContext(BrandContext).brandColor;
21075
- var uniquePlanFeatures = filterUniqueFeatures({ availablePlansArray: availablePlansArray });
21076
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: __spreadArray([], Array(PLANS_TO_DISPLAY), true).map(function (_, planIndex) {
21077
- var plan = uniquePlanFeatures[planIndex];
21078
- var prevPlan = availablePlansArray[planIndex - 1];
21079
- if (!plan)
21080
- return (jsxRuntime.jsx("div", { style: prevPlan ? { borderLeft: "1px solid ".concat(common.SLATE_200) } : {} }, planIndex));
21081
- if (!plan.planFeatures)
21082
- return jsxRuntime.jsx("div", {}, planIndex);
21083
- return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-4 p-4", style: { borderLeft: "1px solid ".concat(common.SLATE_200) } }, { children: plan.planFeatures.map(function (planFeature, planFeatureIndex) {
21084
- var everythingInPlus = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus;
21085
- return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [prevPlan &&
21086
- everythingInPlus &&
21087
- planIndex > 0 &&
21088
- planFeatureIndex === 0 && (jsxRuntime.jsx(Text$c, __assign({ className: "font-medium", style: { fontSize: "13px" } }, { children: everythingInPlusString({ plan: prevPlan }) }))), jsxRuntime.jsxs("div", __assign({ className: "flex gap-1 text-gray-600", style: { fontSize: "13px" } }, { children: [jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }), jsxRuntime.jsx(Text$c, { children: planFeature.feature.name })] }))] }), planFeatureIndex));
21089
- }) }), planIndex));
21090
- }) }));
20985
+ var everythingInPlusString = function (_a) {
20986
+ var priceList = _a.priceList;
20987
+ return "Everything in ".concat(priceList.plan.name, ", plus");
20988
+ };
20989
+
20990
+ var PriceListGridMobile = function (_a) {
20991
+ var _b, _c, _d, _e;
20992
+ var availablePriceLists = _a.availablePriceLists, onChangePriceList = _a.onChangePriceList, priceListChangeOptions = _a.priceListChangeOptions, selectedPriceList = _a.selectedPriceList, selectedProduct = _a.selectedProduct, subscriptions = _a.subscriptions, trialRemainingDays = _a.trialRemainingDays;
20993
+ var everythingInPlus = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus;
20994
+ var prevPriceListIndex = availablePriceLists.findIndex(function (priceList) { return priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id); });
20995
+ var prevPriceListId = (_b = availablePriceLists[prevPriceListIndex - 1]) === null || _b === void 0 ? void 0 : _b.id;
20996
+ var prevPriceList = (_c = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _c === void 0 ? void 0 : _c.find(function (priceList) { return priceList.id === prevPriceListId; });
20997
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex gap-4 overflow-auto shadow-padding-xb", style: { flexShrink: 0 } }, { children: availablePriceLists.map(function (priceList, index) {
20998
+ return (jsxRuntime.jsx(PriceListCard, { isSelected: priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id), onClick: onChangePriceList, priceList: priceList, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }, index));
20999
+ }) })), jsxRuntime.jsx("div", __assign({ className: "text-slate-500 pt-5 pb-4 shadow-padding-x" }, { children: everythingInPlus && prevPriceList
21000
+ ? everythingInPlusString({ priceList: prevPriceList })
21001
+ : "Features" })), jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-4 overflow-auto shadow-padding-x" }, { children: (_e = (_d = selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.plan) === null || _d === void 0 ? void 0 : _d.planFeatures) === null || _e === void 0 ? void 0 : _e.map(function (planFeature, index) { return (jsxRuntime.jsx(PriceListCardFeature, { planFeature: planFeature, index: index }, index)); }) }))] }));
21091
21002
  };
21092
21003
 
21093
21004
  var shouldColorRow = function (_a) {
@@ -21104,15 +21015,15 @@ var FeatureGridCell = function (_a) {
21104
21015
  : {})) }, { children: children })));
21105
21016
  };
21106
21017
 
21107
- var Text$b = antd.Typography.Text;
21018
+ var PLANS_TO_DISPLAY$1 = 3;
21019
+
21020
+ var Text$9 = antd.Typography.Text;
21108
21021
  var PlanFeatures = function (_a) {
21109
21022
  var _b;
21110
- var availablePlansArray = _a.availablePlansArray, plans = _a.plans, selectedProduct = _a.selectedProduct;
21023
+ var availablePlansArray = _a.availablePlansArray, selectedProduct = _a.selectedProduct;
21111
21024
  var featureGroupCounter = react.useRef(0);
21112
21025
  var visibleFeatureCounter = react.useRef(1);
21113
21026
  var brandColor = react.useContext(BrandContext).brandColor;
21114
- if (!plans)
21115
- return null;
21116
21027
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (_b = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.features) === null || _b === void 0 ? void 0 : _b.map(function (feature, featureIndex) {
21117
21028
  if (!selectedProduct.features)
21118
21029
  return null;
@@ -21134,7 +21045,7 @@ var PlanFeatures = function (_a) {
21134
21045
  rowIndex = rowIndex + featureGroupCounter.current;
21135
21046
  // Increment the visible feature counter
21136
21047
  visibleFeatureCounter.current = visibleFeatureCounter.current + 1;
21137
- return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [jsxRuntime.jsx(FeatureGridCell, __assign({ isFeatureGroup: isFeatureGroup, noBorder: true, rowIndex: rowIndex }, { children: jsxRuntime.jsx(FeatureTitle, { isFeatureGroup: isFeatureGroup, feature: feature }) })), __spreadArray([], Array(PLANS_TO_DISPLAY), true).map(function (_, columnIndex) {
21048
+ return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [jsxRuntime.jsx(FeatureGridCell, __assign({ isFeatureGroup: isFeatureGroup, noBorder: true, rowIndex: rowIndex }, { children: jsxRuntime.jsx(FeatureTitle, { isFeatureGroup: isFeatureGroup, feature: feature }) })), __spreadArray([], Array(PLANS_TO_DISPLAY$1), true).map(function (_, columnIndex) {
21138
21049
  var _a;
21139
21050
  var plan = availablePlansArray[columnIndex];
21140
21051
  var doesHavePrevPlan = availablePlansArray[columnIndex - 1];
@@ -21144,91 +21055,115 @@ var PlanFeatures = function (_a) {
21144
21055
  if (!plan)
21145
21056
  return (jsxRuntime.jsx(FeatureGridCell, { rowIndex: rowIndex, noBorder: !Boolean(doesHavePrevPlan) }, columnIndex));
21146
21057
  if (isFeatureGroup)
21147
- return (jsxRuntime.jsx(FeatureGridCell, { isFeatureGroup: true, rowIndex: rowIndex }, columnIndex));
21148
- return (jsxRuntime.jsx(FeatureGridCell, __assign({ rowIndex: rowIndex }, { children: jsxRuntime.jsx("div", __assign({ className: "flex justify-center text-center" }, { children: planFeature ? ((planFeature === null || planFeature === void 0 ? void 0 : planFeature.value) ? (planFeature.value) : (jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }))) : (jsxRuntime.jsx(Text$b, __assign({ className: "text-gray" }, { children: "-" }))) })) }), columnIndex));
21058
+ return jsxRuntime.jsx(FeatureGridCell, { isFeatureGroup: true, rowIndex: rowIndex }, columnIndex);
21059
+ return (jsxRuntime.jsx(FeatureGridCell, __assign({ rowIndex: rowIndex }, { children: jsxRuntime.jsx("div", __assign({ className: "flex justify-center text-center" }, { children: planFeature ? ((planFeature === null || planFeature === void 0 ? void 0 : planFeature.value) ? (planFeature.value) : (jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }))) : (jsxRuntime.jsx(Text$9, __assign({ className: "text-gray" }, { children: "-" }))) })) }), columnIndex));
21149
21060
  })] }), rowIndex));
21150
21061
  }) }));
21151
21062
  };
21152
21063
  var FeatureTitle = function (_a) {
21153
21064
  var _b;
21154
21065
  var isFeatureGroup = _a.isFeatureGroup, feature = _a.feature;
21155
- return (jsxRuntime.jsx(Text$b, __assign({ className: " ".concat(isFeatureGroup ? "text-slate-500 font-medium pt-4" : ""), style: __assign({}, (isFeatureGroup ? { fontSize: "11px" } : {})) }, { children: isFeatureGroup ? (_b = feature === null || feature === void 0 ? void 0 : feature.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() : feature === null || feature === void 0 ? void 0 : feature.name })));
21066
+ return (jsxRuntime.jsx(Text$9, __assign({ className: " ".concat(isFeatureGroup ? "text-slate-500 font-medium pt-4" : ""), style: __assign({}, (isFeatureGroup ? { fontSize: "11px" } : {})) }, { children: isFeatureGroup ? (_b = feature === null || feature === void 0 ? void 0 : feature.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() : feature === null || feature === void 0 ? void 0 : feature.name })));
21067
+ };
21068
+
21069
+ var NextPriceListButton = function (_a) {
21070
+ var availablePriceLists = _a.availablePriceLists, priceListStart = _a.priceListStart, setPriceListStart = _a.setPriceListStart;
21071
+ return (jsxRuntime.jsxs("div", __assign({ className: "absolute flex gap-1", style: { top: "12px", right: "8px", zIndex: 10 } }, { children: [priceListStart > 0 && (jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center rounded-full shadow p-1 cursor-pointer", onClick: function () {
21072
+ setPriceListStart(function (prev) {
21073
+ var newValue = prev - 1;
21074
+ if (newValue < 0) {
21075
+ return prev;
21076
+ }
21077
+ return newValue;
21078
+ });
21079
+ }, style: { width: "22px", height: "22px" } }, { children: jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faChevronLeft }) }))), priceListStart < availablePriceLists.length - 3 && (jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center rounded-full shadow p-1 cursor-pointer", onClick: function () {
21080
+ return setPriceListStart(function (prev) {
21081
+ var newValue = prev + 1;
21082
+ if (newValue >= availablePriceLists.length) {
21083
+ return prev;
21084
+ }
21085
+ return newValue;
21086
+ });
21087
+ }, style: { width: "22px", height: "22px" } }, { children: jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faChevronRight }) })))] })));
21088
+ };
21089
+
21090
+ var filterUniqueFeatures = function (_a) {
21091
+ // Remove any features that in previous plans if everythingInPlus is true
21092
+ var availablePriceLists = _a.availablePriceLists;
21093
+ var uniqueFeatures = new Set();
21094
+ var updatedPriceLists = availablePriceLists.map(function (priceList) {
21095
+ var _a;
21096
+ var updatedPlanFeatures = (_a = priceList.plan.planFeatures) === null || _a === void 0 ? void 0 : _a.filter(function (feature) {
21097
+ if (uniqueFeatures.has(feature.featureId)) {
21098
+ return false;
21099
+ }
21100
+ else {
21101
+ uniqueFeatures.add(feature.featureId);
21102
+ return true;
21103
+ }
21104
+ });
21105
+ return __assign(__assign({}, priceList), { plan: __assign(__assign({}, priceList.plan), { planFeatures: updatedPlanFeatures }) });
21106
+ });
21107
+ return updatedPriceLists;
21108
+ };
21109
+ var EverythingPlanFeatures = function (_a) {
21110
+ var availablePriceLists = _a.availablePriceLists, selectedProduct = _a.selectedProduct;
21111
+ var brandColor = react.useContext(BrandContext).brandColor;
21112
+ var uniquePlanFeatures = filterUniqueFeatures({ availablePriceLists: availablePriceLists });
21113
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: __spreadArray([], Array(PLANS_TO_DISPLAY), true).map(function (_, planIndex) {
21114
+ var priceList = uniquePlanFeatures[planIndex];
21115
+ var prevPriceList = availablePriceLists[planIndex - 1];
21116
+ if (!priceList)
21117
+ return (jsxRuntime.jsx("div", { style: prevPriceList ? { borderLeft: "1px solid ".concat(common.SLATE_200) } : {} }, planIndex));
21118
+ if (!priceList.plan.planFeatures)
21119
+ return jsxRuntime.jsx("div", {}, planIndex);
21120
+ return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-4 p-4", style: { borderLeft: "1px solid ".concat(common.SLATE_200) } }, { children: priceList.plan.planFeatures.map(function (planFeature, planFeatureIndex) {
21121
+ var everythingInPlus = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus;
21122
+ return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [prevPriceList && everythingInPlus && planIndex > 0 && planFeatureIndex === 0 && (jsxRuntime.jsx("div", __assign({ className: "font-medium", style: { fontSize: "13px" } }, { children: everythingInPlusString({ priceList: prevPriceList }) }))), jsxRuntime.jsxs("div", __assign({ className: "flex gap-1 text-gray-600", style: { fontSize: "13px" } }, { children: [jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }), planFeature.feature.name] }))] }), planFeatureIndex));
21123
+ }) }), planIndex));
21124
+ }) }));
21156
21125
  };
21157
21126
 
21127
+ var PLANS_TO_DISPLAY = 3;
21158
21128
  var PriceListGridDesktop = function (_a) {
21159
- var availablePriceLists = _a.availablePriceLists, onChangePriceList = _a.onChangePriceList, planChangeOptions = _a.planChangeOptions, priceListStart = _a.priceListStart, selectedPlan = _a.selectedPlan, selectedProduct = _a.selectedProduct, setPriceListStart = _a.setPriceListStart, subscriptions = _a.subscriptions, trialRemainingDays = _a.trialRemainingDays;
21160
- // Context
21161
- var shadow = react.useContext(SubscriptionsContext).shadow;
21129
+ var availablePriceLists = _a.availablePriceLists, onChangePriceList = _a.onChangePriceList, priceListChangeOptions = _a.priceListChangeOptions, priceListStart = _a.priceListStart, selectedPriceList = _a.selectedPriceList, selectedProduct = _a.selectedProduct, setPriceListStart = _a.setPriceListStart, subscriptions = _a.subscriptions, trialRemainingDays = _a.trialRemainingDays;
21162
21130
  var _b = react.useMemo(function () {
21163
21131
  return getAvailablePlansAndPriceLists({
21164
21132
  availablePriceLists: availablePriceLists,
21165
- planChangeOptions: planChangeOptions,
21133
+ priceListChangeOptions: priceListChangeOptions,
21166
21134
  priceListStart: priceListStart,
21167
21135
  });
21168
- }, [availablePriceLists, planChangeOptions, priceListStart]), availablePlansArray = _b.availablePlansArray, displayPriceLists = _b.displayPriceLists;
21136
+ }, [availablePriceLists, priceListChangeOptions, priceListStart]), availablePlansArray = _b.availablePlansArray, displayPriceLists = _b.displayPriceLists;
21169
21137
  var everythingInPlus = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus;
21170
- return (jsxRuntime.jsx("div", __assign({ className: "" }, { children: jsxRuntime.jsxs("div", __assign({ className: "relative flex flex-col h-full rounded-md overflow-hidden bg-white ".concat(shadow ? "shadow-".concat(shadow) : "") }, { children: [jsxRuntime.jsx(NextPriceListButton, { availablePriceLists: availablePriceLists, priceListStart: priceListStart, setPriceListStart: setPriceListStart }), jsxRuntime.jsxs("div", __assign({ className: "grid w-full", style: {
21138
+ return (jsxRuntime.jsx("div", __assign({ className: "shadow-padding-xb" }, { children: jsxRuntime.jsxs("div", __assign({ className: "relative flex flex-col h-full rounded-md shadow overflow-hidden bg-white" }, { children: [jsxRuntime.jsx(NextPriceListButton, { availablePriceLists: availablePriceLists, priceListStart: priceListStart, setPriceListStart: setPriceListStart }), jsxRuntime.jsxs("div", __assign({ className: "grid w-full", style: {
21171
21139
  gridTemplateColumns: everythingInPlus
21172
21140
  ? "repeat(3, minmax(120px, 1fr))"
21173
21141
  : "minmax(auto, 400px) repeat(3, minmax(120px, 1fr))",
21174
21142
  } }, { children: [!everythingInPlus && jsxRuntime.jsx(PlanPickerGridCell, { noBorder: true }), __spreadArray([], Array(PLANS_TO_DISPLAY), true).map(function (_, index) {
21175
- var _a;
21176
21143
  var priceList = displayPriceLists[index];
21177
21144
  var doesPrevPriceListExist = displayPriceLists[index - 1];
21178
21145
  if (!priceList)
21179
- return (jsxRuntime.jsx(PlanPickerGridCell, { noBorder: !Boolean(doesPrevPriceListExist) }, index));
21180
- var plan = (_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.find(function (plan) { return plan.id === priceList.plan.id; });
21181
- return (jsxRuntime.jsx(PriceListCard, { isSelected: priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id), onClick: onChangePriceList, plan: plan, priceList: priceList, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }, index));
21182
- }), (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus) ? (jsxRuntime.jsx(EverythingPlanFeatures, { availablePlansArray: availablePlansArray, selectedProduct: selectedProduct })) : (jsxRuntime.jsx(PlanFeatures, { availablePlansArray: availablePlansArray, plans: planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans, selectedProduct: selectedProduct }))] }))] })) })));
21183
- };
21184
-
21185
- var Text$a = antd.Typography.Text;
21186
- var PriceListCardFeature = function (_a) {
21187
- var feature = _a.feature, index = _a.index;
21188
- var brandColor = react.useContext(BrandContext).brandColor;
21189
- if (feature.kind === "GROUP")
21190
- return jsxRuntime.jsx(Text$a, __assign({ className: "font-medium base-text" }, { children: feature.name }));
21191
- return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }), jsxRuntime.jsx(Text$a, __assign({ className: "text-gray-600" }, { children: feature.name }))] }), index));
21192
- };
21193
-
21194
- var Text$9 = antd.Typography.Text;
21195
- var PriceListGridMobile = function (_a) {
21196
- var _b, _c, _d;
21197
- var availablePriceLists = _a.availablePriceLists, onChangePriceList = _a.onChangePriceList, planChangeOptions = _a.planChangeOptions, selectedPlan = _a.selectedPlan, selectedProduct = _a.selectedProduct, subscriptions = _a.subscriptions, trialRemainingDays = _a.trialRemainingDays;
21198
- var everythingInPlus = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus;
21199
- var prevPriceListIndex = availablePriceLists.findIndex(function (priceList) { return priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id); });
21200
- var prevPlanId = (_b = availablePriceLists[prevPriceListIndex - 1]) === null || _b === void 0 ? void 0 : _b.plan.id;
21201
- var prevPlan = (_c = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _c === void 0 ? void 0 : _c.find(function (plan) { return plan.id === prevPlanId; });
21202
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex gap-4 overflow-auto bunny-shadow-padding-xb", style: { flexShrink: 0 } }, { children: availablePriceLists.map(function (priceList, index) {
21203
- var _a;
21204
- var plan = (_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.find(function (plan) { return plan.id === priceList.plan.id; });
21205
- return (jsxRuntime.jsx(PriceListCard, { isSelected: priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id), onClick: onChangePriceList, plan: plan, priceList: priceList, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }, index));
21206
- }) })), jsxRuntime.jsx(Text$9, __assign({ className: "text-slate-500 pt-5 pb-4 bunny-shadow-padding-x" }, { children: everythingInPlus && prevPlan
21207
- ? everythingInPlusString({ plan: prevPlan })
21208
- : "Features" })), jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-4 overflow-auto bunny-shadow-padding-x" }, { children: (_d = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.features) === null || _d === void 0 ? void 0 : _d.map(function (feature, index) { return (jsxRuntime.jsx(PriceListCardFeature, { feature: feature, index: index }, index)); }) }))] }));
21146
+ return jsxRuntime.jsx(PlanPickerGridCell, { noBorder: !Boolean(doesPrevPriceListExist) }, index);
21147
+ return (jsxRuntime.jsx(PriceListCard, { isSelected: priceList.plan.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.plan.id), onClick: onChangePriceList, priceList: priceList, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }, index));
21148
+ }), (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.everythingInPlus) ? (jsxRuntime.jsx(EverythingPlanFeatures, { availablePriceLists: availablePriceLists, selectedProduct: selectedProduct })) : (jsxRuntime.jsx(PlanFeatures, { availablePlansArray: availablePlansArray, selectedProduct: selectedProduct }))] }))] })) })));
21209
21149
  };
21210
21150
 
21211
21151
  var PriceListGrid = function (_a) {
21212
21152
  var _b, _c;
21213
- var availablePriceLists = _a.availablePriceLists, onChangePriceList = _a.onChangePriceList, planChangeOptions = _a.planChangeOptions, priceListStart = _a.priceListStart, selectedPriceList = _a.selectedPriceList, selectedProduct = _a.selectedProduct, setPriceListStart = _a.setPriceListStart, subscriptions = _a.subscriptions, upgradingSubscriptionState = _a.upgradingSubscriptionState;
21153
+ var availablePriceLists = _a.availablePriceLists, onChangePriceList = _a.onChangePriceList, priceListChangeOptions = _a.priceListChangeOptions, priceListStart = _a.priceListStart, selectedPriceList = _a.selectedPriceList, selectedProduct = _a.selectedProduct, setPriceListStart = _a.setPriceListStart, subscriptions = _a.subscriptions, upgradingSubscriptionState = _a.upgradingSubscriptionState;
21214
21154
  // Hooks
21215
21155
  var isMobile = common.useIsMobile();
21216
21156
  // Derived state
21217
- var currentPlan = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.find(function (plan) { return plan.id === (upgradingSubscriptionState === null || upgradingSubscriptionState === void 0 ? void 0 : upgradingSubscriptionState.plan.id); });
21218
- var selectedPlan = (_c = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _c === void 0 ? void 0 : _c.find(function (plan) { return plan.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.plan.id); });
21219
- var trialRemainingDays = dayjs(currentPlan === null || currentPlan === void 0 ? void 0 : currentPlan.trialEndDate).diff(dayjs(), "days");
21220
- return isMobile ? (jsxRuntime.jsx(PriceListGridMobile, { availablePriceLists: availablePriceLists, onChangePriceList: onChangePriceList, planChangeOptions: planChangeOptions, selectedPlan: selectedPlan, selectedProduct: selectedProduct, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays })) : (jsxRuntime.jsx(PriceListGridDesktop, { availablePriceLists: availablePriceLists, onChangePriceList: onChangePriceList, planChangeOptions: planChangeOptions, priceListStart: priceListStart, selectedPlan: selectedPlan, selectedProduct: selectedProduct, setPriceListStart: setPriceListStart, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }));
21157
+ var currentPriceList = (_b = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _b === void 0 ? void 0 : _b.find(function (priceList) { var _a; return priceList.id === ((_a = upgradingSubscriptionState === null || upgradingSubscriptionState === void 0 ? void 0 : upgradingSubscriptionState.plan) === null || _a === void 0 ? void 0 : _a.id); });
21158
+ var trialRemainingDays = dayjs((_c = currentPriceList === null || currentPriceList === void 0 ? void 0 : currentPriceList.plan) === null || _c === void 0 ? void 0 : _c.trialEndDate).diff(dayjs(), "days");
21159
+ return isMobile ? (jsxRuntime.jsx(PriceListGridMobile, { availablePriceLists: availablePriceLists, onChangePriceList: onChangePriceList, priceListChangeOptions: priceListChangeOptions, selectedPriceList: selectedPriceList, selectedProduct: selectedProduct, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays })) : (jsxRuntime.jsx(PriceListGridDesktop, { availablePriceLists: availablePriceLists, onChangePriceList: onChangePriceList, priceListChangeOptions: priceListChangeOptions, priceListStart: priceListStart, selectedPriceList: selectedPriceList, selectedProduct: selectedProduct, setPriceListStart: setPriceListStart, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }));
21221
21160
  };
21222
21161
 
21223
- var createAvailableBillingPeriods = function (plans, selectedProduct) {
21224
- return plans === null || plans === void 0 ? void 0 : plans.flatMap(function (plan) {
21225
- return plan.priceLists
21226
- .filter(function (priceList) { return priceList.product.id === (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.id); })
21227
- .map(function (priceList) { return priceList.periodMonths; });
21228
- }).sort(function (a, b) { return a - b; }).filter(function (currentValue, index, array) { return index === array.indexOf(currentValue); });
21162
+ var createAvailableBillingPeriods = function (priceLists, selectedProduct) {
21163
+ return priceLists === null || priceLists === void 0 ? void 0 : priceLists.filter(function (priceList) { return priceList.product.id === (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.id); }).map(function (priceList) { return priceList.periodMonths; }).sort(function (a, b) { return a - b; }).filter(function (currentValue, index, array) { return index === array.indexOf(currentValue); });
21229
21164
  };
21230
21165
  var PriceListSelector = function (_a) {
21231
- var arePlanChangeOptionsLoading = _a.arePlanChangeOptionsLoading, areSubscriptionsLoading = _a.areSubscriptionsLoading, onChangePriceList = _a.onChangePriceList, planChangeOptions = _a.planChangeOptions, selectedPriceList = _a.selectedPriceList, subscriptions = _a.subscriptions, upgradingSubscription = _a.upgradingSubscription;
21166
+ var arePlanChangeOptionsLoading = _a.arePlanChangeOptionsLoading, areSubscriptionsLoading = _a.areSubscriptionsLoading, onChangePriceList = _a.onChangePriceList, priceListChangeOptions = _a.priceListChangeOptions, selectedPriceList = _a.selectedPriceList, subscriptions = _a.subscriptions, upgradingSubscription = _a.upgradingSubscription;
21232
21167
  // Context
21233
21168
  var _b = react.useContext(SubscriptionsContext), isInPreviewMode = _b.isInPreviewMode, quotePreviewData = _b.quotePreviewData, setQuotePreviewData = _b.setQuotePreviewData;
21234
21169
  // Local state
@@ -21236,32 +21171,22 @@ var PriceListSelector = function (_a) {
21236
21171
  var _d = react.useState(), selectedBillingPeriod = _d[0], setSelectedBillingPeriod = _d[1];
21237
21172
  var _e = react.useState(0), priceListStart = _e[0], setPriceListStart = _e[1];
21238
21173
  // Derived state
21239
- var availableBillingPeriods = react.useMemo(function () {
21240
- return createAvailableBillingPeriods(planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans, selectedProduct);
21241
- }, [planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans, selectedProduct]);
21174
+ var availableBillingPeriods = react.useMemo(function () { return createAvailableBillingPeriods(priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists, selectedProduct); }, [priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists, selectedProduct]);
21242
21175
  var availablePriceLists = react.useMemo(function () {
21243
21176
  var _a;
21244
- return (((_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.flatMap(function (plan) {
21245
- return plan.priceLists.filter(function (priceList) {
21246
- return periodMonthsConverter(priceList.periodMonths) ===
21247
- selectedBillingPeriod &&
21248
- priceList.product.id === (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.id);
21249
- });
21177
+ return (((_a = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _a === void 0 ? void 0 : _a.filter(function (priceList) {
21178
+ return periodMonthsConverter(priceList.periodMonths) === selectedBillingPeriod &&
21179
+ priceList.product.id === (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.id);
21250
21180
  })) || []);
21251
- }, [planChangeOptions, selectedBillingPeriod, selectedProduct]);
21181
+ }, [priceListChangeOptions, selectedBillingPeriod, selectedProduct]);
21252
21182
  // Handlers
21253
21183
  var onChangeBillingPeriod = react.useCallback(function (billingPeriod) {
21254
21184
  var _a, _b;
21255
21185
  setSelectedBillingPeriod(billingPeriod);
21256
21186
  setPriceListStart(0);
21257
21187
  if ((quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList) &&
21258
- billingPeriod !==
21259
- periodMonthsConverter((_a = quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList) === null || _a === void 0 ? void 0 : _a.periodMonths)) {
21260
- var availablePriceLists_1 = ((_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.flatMap(function (plan) {
21261
- return plan.priceLists.filter(function (priceList) {
21262
- return periodMonthsConverter(priceList.periodMonths) === billingPeriod;
21263
- });
21264
- })) || [];
21188
+ billingPeriod !== periodMonthsConverter((_a = quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList) === null || _a === void 0 ? void 0 : _a.periodMonths)) {
21189
+ var availablePriceLists_1 = ((_b = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _b === void 0 ? void 0 : _b.filter(function (priceList) { return periodMonthsConverter(priceList.periodMonths) === billingPeriod; })) || [];
21265
21190
  var newSelectedPriceList = availablePriceLists_1.find(function (priceList) {
21266
21191
  var _a;
21267
21192
  return periodMonthsConverter(priceList.periodMonths) === billingPeriod &&
@@ -21272,8 +21197,7 @@ var PriceListSelector = function (_a) {
21272
21197
  upgradingSubscription: upgradingSubscription,
21273
21198
  });
21274
21199
  });
21275
- var isPriceListCurrentSubscription = newSelectedPriceList &&
21276
- (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === newSelectedPriceList.id;
21200
+ var isPriceListCurrentSubscription = newSelectedPriceList && (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === newSelectedPriceList.id;
21277
21201
  if (newSelectedPriceList && !isPriceListCurrentSubscription) {
21278
21202
  setQuotePreviewData({
21279
21203
  priceList: newSelectedPriceList,
@@ -21288,32 +21212,30 @@ var PriceListSelector = function (_a) {
21288
21212
  }
21289
21213
  }, [
21290
21214
  quotePreviewData,
21291
- planChangeOptions,
21215
+ priceListChangeOptions,
21292
21216
  subscriptions,
21293
21217
  upgradingSubscription,
21294
21218
  setQuotePreviewData,
21295
21219
  ]);
21296
21220
  var onChangeProduct = react.useCallback(function (product) {
21297
- var newAvailableBillingPeriods = createAvailableBillingPeriods(planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans, product);
21221
+ var newAvailableBillingPeriods = createAvailableBillingPeriods(priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists, product);
21298
21222
  if (!(newAvailableBillingPeriods === null || newAvailableBillingPeriods === void 0 ? void 0 : newAvailableBillingPeriods.includes(billingPeriodConverter(selectedBillingPeriod)))) {
21299
- onChangeBillingPeriod(periodMonthsConverter((newAvailableBillingPeriods === null || newAvailableBillingPeriods === void 0 ? void 0 : newAvailableBillingPeriods[0]) !== undefined
21300
- ? newAvailableBillingPeriods[0]
21301
- : 1));
21223
+ onChangeBillingPeriod(periodMonthsConverter((newAvailableBillingPeriods === null || newAvailableBillingPeriods === void 0 ? void 0 : newAvailableBillingPeriods[0]) !== undefined ? newAvailableBillingPeriods[0] : 1));
21302
21224
  }
21303
21225
  setSelectedProduct(product);
21304
- }, [planChangeOptions, selectedBillingPeriod, onChangeBillingPeriod]);
21226
+ }, [priceListChangeOptions, selectedBillingPeriod, onChangeBillingPeriod]);
21305
21227
  // Default settings
21306
21228
  react.useEffect(function () {
21307
21229
  var _a, _b, _c, _d;
21308
21230
  if (arePlanChangeOptionsLoading ||
21309
21231
  areSubscriptionsLoading ||
21310
- !planChangeOptions ||
21232
+ !priceListChangeOptions ||
21311
21233
  selectedBillingPeriod ||
21312
21234
  selectedProduct ||
21313
21235
  selectedPriceList)
21314
21236
  return;
21315
- var initialProduct = (_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.products) === null || _a === void 0 ? void 0 : _a[0];
21316
- var initialAvailableBillingPeriods = createAvailableBillingPeriods(planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans, initialProduct);
21237
+ var initialProduct = (_a = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.products) === null || _a === void 0 ? void 0 : _a[0];
21238
+ var initialAvailableBillingPeriods = createAvailableBillingPeriods(priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists, initialProduct);
21317
21239
  var initialBillingPeriod;
21318
21240
  if ((upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList) &&
21319
21241
  (initialAvailableBillingPeriods === null || initialAvailableBillingPeriods === void 0 ? void 0 : initialAvailableBillingPeriods.includes(billingPeriodConverter(periodMonthsConverter(upgradingSubscription.priceList.periodMonths))))) {
@@ -21322,12 +21244,9 @@ var PriceListSelector = function (_a) {
21322
21244
  else {
21323
21245
  initialBillingPeriod = periodMonthsConverter((initialAvailableBillingPeriods === null || initialAvailableBillingPeriods === void 0 ? void 0 : initialAvailableBillingPeriods[0]) || 1);
21324
21246
  }
21325
- var initialAvailablePriceLists = ((_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.flatMap(function (plan) {
21326
- return plan.priceLists.filter(function (priceList) {
21327
- return periodMonthsConverter(priceList.periodMonths) ===
21328
- initialBillingPeriod &&
21329
- priceList.product.id === (initialProduct === null || initialProduct === void 0 ? void 0 : initialProduct.id);
21330
- });
21247
+ var initialAvailablePriceLists = ((_b = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _b === void 0 ? void 0 : _b.filter(function (priceList) {
21248
+ return periodMonthsConverter(priceList.periodMonths) === initialBillingPeriod &&
21249
+ priceList.product.id === (initialProduct === null || initialProduct === void 0 ? void 0 : initialProduct.id);
21331
21250
  })) || [];
21332
21251
  var initialPriceList;
21333
21252
  var initialQuantity = (_d = (_c = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.quantity;
@@ -21354,7 +21273,7 @@ var PriceListSelector = function (_a) {
21354
21273
  arePlanChangeOptionsLoading,
21355
21274
  areSubscriptionsLoading,
21356
21275
  isInPreviewMode,
21357
- planChangeOptions,
21276
+ priceListChangeOptions,
21358
21277
  selectedBillingPeriod,
21359
21278
  selectedPriceList,
21360
21279
  selectedProduct,
@@ -21362,7 +21281,7 @@ var PriceListSelector = function (_a) {
21362
21281
  subscriptions,
21363
21282
  upgradingSubscription,
21364
21283
  ]);
21365
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BillingPeriodSelector, { availableBillingPeriods: availableBillingPeriods, onChangeBillingPeriod: onChangeBillingPeriod, products: planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.products, selectedBillingPeriod: selectedBillingPeriod, selectedProduct: selectedProduct, onChangeProduct: onChangeProduct }), jsxRuntime.jsx(PriceListGrid, { availablePriceLists: availablePriceLists, onChangePriceList: onChangePriceList, planChangeOptions: planChangeOptions, priceListStart: priceListStart, selectedPriceList: selectedPriceList, selectedProduct: selectedProduct, setPriceListStart: setPriceListStart, subscriptions: subscriptions, upgradingSubscriptionState: upgradingSubscription })] }));
21284
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BillingPeriodSelector, { availableBillingPeriods: availableBillingPeriods, onChangeBillingPeriod: onChangeBillingPeriod, products: priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.products, selectedBillingPeriod: selectedBillingPeriod, selectedProduct: selectedProduct, onChangeProduct: onChangeProduct }), jsxRuntime.jsx(PriceListGrid, { availablePriceLists: availablePriceLists, onChangePriceList: onChangePriceList, priceListChangeOptions: priceListChangeOptions, priceListStart: priceListStart, selectedPriceList: selectedPriceList, selectedProduct: selectedProduct, setPriceListStart: setPriceListStart, subscriptions: subscriptions, upgradingSubscriptionState: upgradingSubscription })] }));
21366
21285
  };
21367
21286
 
21368
21287
  var PlanPicker = function () {
@@ -21388,27 +21307,16 @@ var PlanPicker = function () {
21388
21307
  token: token,
21389
21308
  }),
21390
21309
  queryFn: function () {
21391
- return getPlanChangeOptions({
21310
+ return getPriceListChangeOptions({
21311
+ apiHost: apiHost,
21392
21312
  isInPreviewMode: isInPreviewMode,
21313
+ productId: productId,
21393
21314
  token: token,
21394
21315
  upgradingSubscription: upgradingSubscription,
21395
- apiHost: apiHost,
21396
21316
  });
21397
21317
  },
21398
21318
  enabled: !areSubscriptionsLoading,
21399
- }), data = _d.data, arePlanChangeOptionsLoading = _d.isLoading;
21400
- var previewDataQuery = reactQuery.useQuery({
21401
- queryKey: common.QueryKeyFactory.default.createTableKey({
21402
- pluralType: "portalPreview",
21403
- filterString: productId || "",
21404
- token: token,
21405
- }),
21406
- queryFn: function () { return getPortalPreviewData(productId || "", apiHost, token); },
21407
- enabled: isInPreviewMode,
21408
- });
21409
- var planChangeOptions = react.useMemo(function () {
21410
- return isInPreviewMode ? previewDataQuery.data : data;
21411
- }, [isInPreviewMode, previewDataQuery.data, data]);
21319
+ }), priceListChangeOptions = _d.data, arePlanChangeOptionsLoading = _d.isLoading;
21412
21320
  // Handlers
21413
21321
  var onChangePriceList = react.useCallback(function (selectedPriceList) {
21414
21322
  if (isInPreviewMode)
@@ -21424,16 +21332,16 @@ var PlanPicker = function () {
21424
21332
  setQuotePreviewData({});
21425
21333
  };
21426
21334
  }, [setQuotePreviewData]);
21427
- if (queryClient.getQueryData(common.QueryKeyFactory.default.planChangeOptionsKey({
21428
- subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id,
21429
- token: token,
21430
- })) === undefined) {
21335
+ if (queryClient.isFetching({
21336
+ queryKey: common.QueryKeyFactory.default.planChangeOptionsKey({
21337
+ subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id,
21338
+ token: token,
21339
+ }),
21340
+ }))
21431
21341
  return jsxRuntime.jsx(jsxRuntime.Fragment, {});
21432
- }
21433
- else if (((_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.length) === 0) {
21342
+ else if (((_a = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _a === void 0 ? void 0 : _a.length) === 0)
21434
21343
  return jsxRuntime.jsx(ErrorView, { message: "There are no plans available" });
21435
- }
21436
- return (jsxRuntime.jsx(PriceListSelector, { arePlanChangeOptionsLoading: arePlanChangeOptionsLoading, areSubscriptionsLoading: areSubscriptionsLoading, onChangePriceList: onChangePriceList, planChangeOptions: planChangeOptions, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList, subscriptions: subscriptions }));
21344
+ return (jsxRuntime.jsx(PriceListSelector, { arePlanChangeOptionsLoading: arePlanChangeOptionsLoading, areSubscriptionsLoading: areSubscriptionsLoading, onChangePriceList: onChangePriceList, priceListChangeOptions: priceListChangeOptions, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList, subscriptions: subscriptions }));
21437
21345
  };
21438
21346
 
21439
21347
  var Text$8 = antd.Typography.Text;
@@ -21480,25 +21388,16 @@ var PlanManager = function (_a) {
21480
21388
  token: token,
21481
21389
  }),
21482
21390
  queryFn: function () {
21483
- return (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id)
21484
- ? getQuote({ token: token, id: editingQuoteData.id, apiHost: apiHost })
21485
- : undefined;
21391
+ return (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id) ? getQuote({ token: token, id: editingQuoteData.id, apiHost: apiHost }) : undefined;
21486
21392
  },
21487
21393
  enabled: Boolean(editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
21488
21394
  }).data;
21489
21395
  react.useEffect(function () {
21490
21396
  if (subscriptionUpgradeId && !upgradingSubscription) {
21491
- var subscription = subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.find(function (subscription) {
21492
- return subscription.id === subscriptionUpgradeId;
21493
- });
21397
+ var subscription = subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.find(function (subscription) { return subscription.id === subscriptionUpgradeId; });
21494
21398
  setUpgradingSubscription(subscription);
21495
21399
  }
21496
- }, [
21497
- setUpgradingSubscription,
21498
- subscriptionUpgradeId,
21499
- subscriptions,
21500
- upgradingSubscription,
21501
- ]);
21400
+ }, [setUpgradingSubscription, subscriptionUpgradeId, subscriptions, upgradingSubscription]);
21502
21401
  react.useEffect(function () {
21503
21402
  var observer = new IntersectionObserver(function (_a) {
21504
21403
  var entry = _a[0];
@@ -21747,10 +21646,10 @@ var canShowSubscriptionActions = function (subscription) {
21747
21646
 
21748
21647
  var SubscriptionCardActions = function (_a) {
21749
21648
  var _b, _c;
21750
- var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, planChangeOptions = _a.planChangeOptions, subscription = _a.subscription;
21649
+ var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, priceListChangeOptions = _a.priceListChangeOptions, subscription = _a.subscription;
21751
21650
  // Derived state
21752
21651
  var canShowCancelButton = subscription.plan.selfServiceCancel;
21753
- var productPlans = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.filter(function (plan) { var _a; return ((_a = plan.priceLists) === null || _a === void 0 ? void 0 : _a.length) > 0 && plan.productId === subscription.product.id; });
21652
+ var productPlans = (_b = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _b === void 0 ? void 0 : _b.filter(function (priceList) { return priceList.product.id === subscription.product.id; });
21754
21653
  var canShowChangePlanButton = ((productPlans === null || productPlans === void 0 ? void 0 : productPlans.length) || 0) > 0;
21755
21654
  return (canShowChangePlanButton || canShowCancelButton) &&
21756
21655
  canShowSubscriptionActions(subscription) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [canShowCancelButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ icon: null, onConfirm: function () { return onCancelSubscriptionClick === null || onCancelSubscriptionClick === void 0 ? void 0 : onCancelSubscriptionClick(subscription); }, title: "Cancel subscription" }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "p-0", type: "link" }, { children: "Cancel subscription" })) }))), canShowChangePlanButton && (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () { return onChangePlanClick(subscription); }, type: "primary" }, { children: "Change plan" })))] })) : ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === common.SubscriptionState.TRIAL ? (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () { return onChangePlanClick(subscription); }, type: "primary" }, { children: "Upgrade" }))) : null;
@@ -21775,7 +21674,7 @@ var getSubscriptionStatusText = function (subscription) {
21775
21674
  };
21776
21675
  var SubscriptionCardHeader = function (_a) {
21777
21676
  var _b, _c, _d, _e, _f;
21778
- var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, planChangeOptions = _a.planChangeOptions, subscription = _a.subscription;
21677
+ var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, priceListChangeOptions = _a.priceListChangeOptions, subscription = _a.subscription;
21779
21678
  var darkMode = react.useContext(BunnyContext).darkMode;
21780
21679
  var brandColor = react.useContext(BrandContext).brandColor;
21781
21680
  var subscriptionProductNameStyle = react.useContext(SubscriptionsContext).subscriptionProductNameStyle;
@@ -21785,10 +21684,7 @@ var SubscriptionCardHeader = function (_a) {
21785
21684
  var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
21786
21685
  return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between", style: {
21787
21686
  backgroundColor: darkMode ? "var(--row-background-dark)" : "",
21788
- } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsxRuntime.jsx(Text$7, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsxRuntime.jsx(Text$7, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(CustomizedTag, __assign({ color: common.TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsxRuntime.jsx(Text$7, __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile &&
21789
- planChangeOptions &&
21790
- onChangePlanClick &&
21791
- onCancelSubscriptionClick && (jsxRuntime.jsx(SubscriptionCardActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscription: subscription }))] }))] })));
21687
+ } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsxRuntime.jsx(Text$7, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && jsxRuntime.jsx(Text$7, __assign({ className: "text-lg" }, { children: subscription.plan.name })), jsxRuntime.jsxs(CustomizedTag, __assign({ color: common.TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsxRuntime.jsx(Text$7, __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile && priceListChangeOptions && onChangePlanClick && onCancelSubscriptionClick && (jsxRuntime.jsx(SubscriptionCardActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, priceListChangeOptions: priceListChangeOptions, subscription: subscription }))] }))] })));
21792
21688
  };
21793
21689
 
21794
21690
  var BillingPeriodConverter;
@@ -21882,11 +21778,11 @@ var CARD_COLUMNS = [
21882
21778
  ];
21883
21779
  var SubscriptionCardDesktop = function (_a) {
21884
21780
  var _b;
21885
- var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, planChangeOptions = _a.planChangeOptions, subscription = _a.subscription;
21781
+ var onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, priceListChangeOptions = _a.priceListChangeOptions, subscription = _a.subscription;
21886
21782
  var shadow = react.useContext(SubscriptionsContext).shadow;
21887
21783
  // Derived state
21888
21784
  var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL;
21889
- return (jsxRuntime.jsxs(Card, __assign({ className: "p-4 ".concat(shadow ? "shadow-".concat(shadow) : "") }, { children: [jsxRuntime.jsx(SubscriptionCardHeader, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscription: subscription }), jsxRuntime.jsx(antd.Divider, { className: "my-4", style: {
21785
+ return (jsxRuntime.jsxs(Card, __assign({ className: "p-4 ".concat(shadow ? "shadow-".concat(shadow) : "") }, { children: [jsxRuntime.jsx(SubscriptionCardHeader, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, priceListChangeOptions: priceListChangeOptions, subscription: subscription }), jsxRuntime.jsx(antd.Divider, { className: "my-4", style: {
21890
21786
  gridColumn: "1 / 5",
21891
21787
  width: "calc(100% + 32px)",
21892
21788
  transform: "translateX(-16px)",
@@ -21993,14 +21889,14 @@ var SubscriptionCard = function (_a) {
21993
21889
  };
21994
21890
 
21995
21891
  var SubscriptionsList = function (_a) {
21996
- var hideExpired = _a.hideExpired, onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, planChangeOptions = _a.planChangeOptions, subscriptions = _a.subscriptions;
21892
+ var hideExpired = _a.hideExpired, onChangePlanClick = _a.onChangePlanClick, onCancelSubscriptionClick = _a.onCancelSubscriptionClick, priceListChangeOptions = _a.priceListChangeOptions, subscriptions = _a.subscriptions;
21997
21893
  var isMobile = common.useIsMobile();
21998
21894
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.map(function (subscription, subscriptionIndex) {
21999
21895
  if (hideExpired && isSubscriptionNotActive(subscription))
22000
21896
  return null;
22001
21897
  if (isMobile)
22002
- return (jsxRuntime.jsx(SubscriptionCard, { subscription: subscription }, subscriptionIndex));
22003
- return (jsxRuntime.jsx(SubscriptionCardDesktop, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscription: subscription }, subscriptionIndex));
21898
+ return jsxRuntime.jsx(SubscriptionCard, { subscription: subscription }, subscriptionIndex);
21899
+ return (jsxRuntime.jsx(SubscriptionCardDesktop, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, priceListChangeOptions: priceListChangeOptions, subscription: subscription }, subscriptionIndex));
22004
21900
  }) }));
22005
21901
  };
22006
21902
 
@@ -22016,13 +21912,13 @@ var SubscriptionsListContainer = function (_a) {
22016
21912
  // Queries
22017
21913
  var _c = reactQuery.useQuery({
22018
21914
  queryKey: common.QueryKeyFactory.default.planChangeOptionsKey({ token: token }),
22019
- queryFn: function () { return getPlanChangeOptions({ token: token, apiHost: apiHost }); },
21915
+ queryFn: function () { return getPriceListChangeOptions({ token: token, apiHost: apiHost }); },
22020
21916
  enabled: Boolean(onChangePlanClick),
22021
- }), planChangeOptions = _c.data, arePlanChangeOptionsLoading = _c.isLoading;
21917
+ }), priceListChangeOptions = _c.data, arePriceListChangeOptionsLoading = _c.isLoading;
22022
21918
  if (subscriptionsAreLoading ||
22023
- (Boolean(onChangePlanClick) ? arePlanChangeOptionsLoading : false))
21919
+ (Boolean(onChangePlanClick) ? arePriceListChangeOptionsLoading : false))
22024
21920
  return jsxRuntime.jsx(jsxRuntime.Fragment, {});
22025
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.length) > 0 ? (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-".concat(gap, " shrink overflow-auto") }, { children: jsxRuntime.jsx(SubscriptionsList, { hideExpired: hideExpired, onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscriptions: subscriptions }) }))) : (noSubscriptionsComponent || (jsxRuntime.jsx("div", __assign({ className: "flex flex-col items-center w-full" }, { children: jsxRuntime.jsx(ErrorView, { message: "You have no subscriptions with ".concat(companyName, " yet") }) })))) }));
21921
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.length) > 0 ? (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-".concat(gap, " shrink overflow-auto") }, { children: jsxRuntime.jsx(SubscriptionsList, { hideExpired: hideExpired, onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, priceListChangeOptions: priceListChangeOptions, subscriptions: subscriptions }) }))) : (noSubscriptionsComponent || (jsxRuntime.jsx("div", __assign({ className: "flex flex-col items-center w-full" }, { children: jsxRuntime.jsx(ErrorView, { message: "You have no subscriptions with ".concat(companyName, " yet") }) })))) }));
22026
21922
  };
22027
21923
 
22028
21924
  var QUOTE_CHARGE_CREATE = "\nmutation QuoteChargeCreate ($quoteChangeId: ID!, $startDate: ISO8601Date!, $endDate: ISO8601Date, $priceListChargeId: ID, $subscriptionChargeId: ID, $price: Float, $quantity: Int) {\n quoteChargeCreate(\n endDate: $endDate\n price: $price\n priceListChargeId: $priceListChargeId\n quantity: $quantity\n quoteChangeId: $quoteChangeId\n startDate: $startDate\n subscriptionChargeId: $subscriptionChargeId\n ) {\n quoteCharge {\n quoteChange {\n id\n quoteId\n }\n }\n }\n}\n\n";