@bunnyapp/components 1.6.0-beta.19 → 1.6.0-beta.20

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 (118) hide show
  1. package/dist/cjs/index.js +1529 -1321
  2. package/dist/cjs/types/src/components/Checkout/QuoteCheckout.d.ts +1 -1
  3. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/CreditCard.d.ts +17 -13
  4. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/MiniCreditCard.d.ts +27 -0
  5. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/components/CardImage.d.ts +14 -0
  6. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/index.d.ts +1 -1
  7. package/dist/cjs/types/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +1 -6
  8. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/useApproveHold.d.ts +1 -1
  9. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +4 -4
  10. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +7 -16
  11. package/dist/cjs/types/src/components/PaymentForm/PaymentForm.d.ts +5 -6
  12. package/dist/cjs/types/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -6
  13. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/useApproveHold.d.ts +1 -1
  14. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +4 -4
  15. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +4 -5
  16. package/dist/cjs/types/src/components/PaymentForm/Stripe/stripeUtils.d.ts +1 -1
  17. package/dist/cjs/types/src/components/PaymentForm/components/CheckoutFooter.d.ts +2 -0
  18. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails.d.ts +2 -0
  19. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodFooter.d.ts +4 -0
  20. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodSelector.d.ts +2 -0
  21. package/dist/cjs/types/src/components/PaymentForm/context/CustomCheckoutFunctionContext.d.ts +5 -0
  22. package/dist/cjs/types/src/components/PaymentForm/context/OverrideTokenContext.d.ts +4 -0
  23. package/dist/cjs/types/src/components/PaymentForm/context/PaymentProvider.d.ts +31 -0
  24. package/dist/cjs/types/src/components/PaymentForm/context/SelectedPaymentPluginContext.d.ts +6 -0
  25. package/dist/cjs/types/src/components/PaymentForm/context/SelectedPluginProvider.d.ts +16 -0
  26. package/dist/cjs/types/src/components/PaymentForm/context/ShowPaymentDetailsContext.d.ts +5 -0
  27. package/dist/cjs/types/src/components/PaymentForm/fragments/PaymentForm_PaymentMethodsFragment.d.ts +10 -0
  28. package/dist/cjs/types/src/components/PaymentForm/hooks/useAutoSetDefaultPaymentMethod.d.ts +2 -5
  29. package/dist/cjs/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +24 -0
  30. package/dist/cjs/types/src/components/PaymentForm/hooks/usePayableCurrency.d.ts +6 -0
  31. package/dist/cjs/types/src/components/PaymentForm/hooks/useRemovePaymentMethod.d.ts +2 -0
  32. package/dist/cjs/types/src/components/PaymentForm/hooks/useSetDefaultPaymentMethod.d.ts +5 -0
  33. package/dist/cjs/types/src/components/PaymentForm/types/PaymentType.d.ts +5 -0
  34. package/dist/cjs/types/src/components/Signup/PaymentForms.d.ts +3 -4
  35. package/dist/cjs/types/src/components/Subscriptions/Subscriptions.d.ts +1 -1
  36. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/QuantityInput.d.ts +1 -1
  37. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +1 -1
  38. package/dist/cjs/types/src/graphql/queries/getCurrentUserData.d.ts +11 -7
  39. package/dist/cjs/types/src/hooks/useCurrentUserData.d.ts +11 -7
  40. package/dist/cjs/types/src/hooks/useIsMobile.d.ts +9 -0
  41. package/dist/cjs/types/src/hooks/usePaymentMethod.d.ts +47 -6
  42. package/dist/cjs/types/src/hooks/usePaymentPlugins.d.ts +13 -27
  43. package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +1 -0
  44. package/dist/cjs/types/src/utils/apiUtils/invokePlugin.d.ts +10 -0
  45. package/dist/esm/index.js +1549 -1341
  46. package/dist/esm/types/src/components/Checkout/QuoteCheckout.d.ts +1 -1
  47. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/CreditCard.d.ts +17 -13
  48. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/MiniCreditCard.d.ts +27 -0
  49. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/components/CardImage.d.ts +14 -0
  50. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/index.d.ts +1 -1
  51. package/dist/esm/types/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +1 -6
  52. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/useApproveHold.d.ts +1 -1
  53. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +4 -4
  54. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +7 -16
  55. package/dist/esm/types/src/components/PaymentForm/PaymentForm.d.ts +5 -6
  56. package/dist/esm/types/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -6
  57. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/useApproveHold.d.ts +1 -1
  58. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +4 -4
  59. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +4 -5
  60. package/dist/esm/types/src/components/PaymentForm/Stripe/stripeUtils.d.ts +1 -1
  61. package/dist/esm/types/src/components/PaymentForm/components/CheckoutFooter.d.ts +2 -0
  62. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails.d.ts +2 -0
  63. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodFooter.d.ts +4 -0
  64. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodSelector.d.ts +2 -0
  65. package/dist/esm/types/src/components/PaymentForm/context/CustomCheckoutFunctionContext.d.ts +5 -0
  66. package/dist/esm/types/src/components/PaymentForm/context/OverrideTokenContext.d.ts +4 -0
  67. package/dist/esm/types/src/components/PaymentForm/context/PaymentProvider.d.ts +31 -0
  68. package/dist/esm/types/src/components/PaymentForm/context/SelectedPaymentPluginContext.d.ts +6 -0
  69. package/dist/esm/types/src/components/PaymentForm/context/SelectedPluginProvider.d.ts +16 -0
  70. package/dist/esm/types/src/components/PaymentForm/context/ShowPaymentDetailsContext.d.ts +5 -0
  71. package/dist/esm/types/src/components/PaymentForm/fragments/PaymentForm_PaymentMethodsFragment.d.ts +10 -0
  72. package/dist/esm/types/src/components/PaymentForm/hooks/useAutoSetDefaultPaymentMethod.d.ts +2 -5
  73. package/dist/esm/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +24 -0
  74. package/dist/esm/types/src/components/PaymentForm/hooks/usePayableCurrency.d.ts +6 -0
  75. package/dist/esm/types/src/components/PaymentForm/hooks/useRemovePaymentMethod.d.ts +2 -0
  76. package/dist/esm/types/src/components/PaymentForm/hooks/useSetDefaultPaymentMethod.d.ts +5 -0
  77. package/dist/esm/types/src/components/PaymentForm/types/PaymentType.d.ts +5 -0
  78. package/dist/esm/types/src/components/Signup/PaymentForms.d.ts +3 -4
  79. package/dist/esm/types/src/components/Subscriptions/Subscriptions.d.ts +1 -1
  80. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/QuantityInput.d.ts +1 -1
  81. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +1 -1
  82. package/dist/esm/types/src/graphql/queries/getCurrentUserData.d.ts +11 -7
  83. package/dist/esm/types/src/hooks/useCurrentUserData.d.ts +11 -7
  84. package/dist/esm/types/src/hooks/useIsMobile.d.ts +9 -0
  85. package/dist/esm/types/src/hooks/usePaymentMethod.d.ts +47 -6
  86. package/dist/esm/types/src/hooks/usePaymentPlugins.d.ts +13 -27
  87. package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +1 -0
  88. package/dist/esm/types/src/utils/apiUtils/invokePlugin.d.ts +10 -0
  89. package/dist/index.d.ts +26 -9
  90. package/package.json +1 -1
  91. package/dist/cjs/types/src/components/PaymentForm/CheckoutFooter.d.ts +0 -13
  92. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/LargCardIcon.d.ts +0 -2
  93. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/PlusIcon.d.ts +0 -4
  94. package/dist/cjs/types/src/components/PaymentForm/PaymentMethodDetails.d.ts +0 -7
  95. package/dist/cjs/types/src/components/PaymentForm/PaymentMethodSelector.d.ts +0 -7
  96. package/dist/cjs/types/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +0 -6
  97. package/dist/cjs/types/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -7
  98. package/dist/cjs/types/src/components/PaymentForm/hooks/usePaymentMethodSelectorPlugin.d.ts +0 -10
  99. package/dist/cjs/types/src/components/PaymentForm/useRemovePaymentMethod.d.ts +0 -3
  100. package/dist/cjs/types/src/components/PaymentForm/useSetDefaultPaymentMethod.d.ts +0 -6
  101. package/dist/cjs/types/src/contexts/PaymentContext.d.ts +0 -10
  102. package/dist/esm/types/src/components/PaymentForm/CheckoutFooter.d.ts +0 -13
  103. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/LargCardIcon.d.ts +0 -2
  104. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/PlusIcon.d.ts +0 -4
  105. package/dist/esm/types/src/components/PaymentForm/PaymentMethodDetails.d.ts +0 -7
  106. package/dist/esm/types/src/components/PaymentForm/PaymentMethodSelector.d.ts +0 -7
  107. package/dist/esm/types/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +0 -6
  108. package/dist/esm/types/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -7
  109. package/dist/esm/types/src/components/PaymentForm/hooks/usePaymentMethodSelectorPlugin.d.ts +0 -10
  110. package/dist/esm/types/src/components/PaymentForm/useRemovePaymentMethod.d.ts +0 -3
  111. package/dist/esm/types/src/components/PaymentForm/useSetDefaultPaymentMethod.d.ts +0 -6
  112. package/dist/esm/types/src/contexts/PaymentContext.d.ts +0 -10
  113. /package/dist/cjs/types/src/components/PaymentForm/{CouponEditor.d.ts → components/CouponEditor.d.ts} +0 -0
  114. /package/dist/cjs/types/src/components/PaymentForm/{PaymentFormTypes.d.ts → types/PaymentFormTypes.d.ts} +0 -0
  115. /package/dist/cjs/types/src/utils/{apiUtils.d.ts → apiUtils/apiUtils.d.ts} +0 -0
  116. /package/dist/esm/types/src/components/PaymentForm/{CouponEditor.d.ts → components/CouponEditor.d.ts} +0 -0
  117. /package/dist/esm/types/src/components/PaymentForm/{PaymentFormTypes.d.ts → types/PaymentFormTypes.d.ts} +0 -0
  118. /package/dist/esm/types/src/utils/{apiUtils.d.ts → apiUtils/apiUtils.d.ts} +0 -0
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { isValidElement, createContext, useContext, useMemo, useState, useEffect, useRef, useCallback, Fragment as Fragment$1 } from 'react';
2
+ import { isValidElement, createContext, useContext, useMemo, useState, useEffect, useRef, createElement, useCallback, Fragment as Fragment$1 } from 'react';
3
3
  import { DownloadOutlined, CreditCardOutlined, EllipsisOutlined, BankOutlined, SearchOutlined, CloseOutlined, CheckCircleFilled, InfoCircleOutlined } from '@ant-design/icons';
4
- import { useErrorNotification, DEFAULT_CONFIG, createClientDevHeaders as createClientDevHeaders$1, X_BUNNY_COMPONENTS_VERSION_HEADER_NAME, QueryKeyFactory as QueryKeyFactory$1, useIsMobile, DEFAULT_BRAND_COLOR, isColorTooDark, DEFAULT_TOP_NAV_IMAGE_URL, DEFAULT_ACCENT_COLOR, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, DEFAULT_SECONDARY_COLOR, request as request$1, invokePlugin, useAllErrorFormats as useAllErrorFormats$1, formatCurrency as formatCurrency$1, GRAY_500, GRAY_200, useSuccessNotification, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, useInfoNotification, formatDate, TransactionState, SLATE_600, WHITE, TransactionKind, QuoteChangeKind, SLATE_500, PRIMARY_COLOR, Lists, getAccount, StringUtils, SubscriptionState as SubscriptionState$2, ChargeType, PERIOD_LABELS, MODAL_MAX_HEIGHT, DataInterval, SLATE_100 } from '@bunnyapp/common';
4
+ import { useErrorNotification, DEFAULT_CONFIG, createClientDevHeaders as createClientDevHeaders$1, X_BUNNY_COMPONENTS_VERSION_HEADER_NAME, QueryKeyFactory as QueryKeyFactory$1, useIsMobile as useIsMobile$1, DEFAULT_BRAND_COLOR, isColorTooDark, DEFAULT_TOP_NAV_IMAGE_URL, DEFAULT_ACCENT_COLOR, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, DEFAULT_SECONDARY_COLOR, request as request$1, invokePlugin, useAllErrorFormats as useAllErrorFormats$1, formatCurrency as formatCurrency$1, GRAY_500, GRAY_200, useSuccessNotification, PAYABLE_INVOICE_STATES, BreakpointNumbers as BreakpointNumbers$1, useGraphQLmutation, useInfoNotification, formatDate, TransactionState, SLATE_600, WHITE, TransactionKind, QuoteChangeKind, SLATE_500, PRIMARY_COLOR, Lists, getAccount, StringUtils, ChargeType, PERIOD_LABELS, MODAL_MAX_HEIGHT, DataInterval, SLATE_100 } from '@bunnyapp/common';
5
5
  import { ConfigProvider, Spin, Typography, Button, theme as theme$1, Tag, Dropdown, Input, Modal, Checkbox, Skeleton, Collapse, Form, Tooltip, Drawer, Card as Card$1, Select, Divider, Image, Popconfirm, Table, Radio, Space, Switch } from 'antd';
6
6
  import { Markup } from 'interweave';
7
7
  import request from 'graphql-request';
@@ -13,7 +13,7 @@ import styled, { styled as styled$1 } from 'styled-components';
13
13
  import { RPConfig, RPProvider, RPPages, RPDefaultLayout, useZoomContext } from '@pdf-viewer/react';
14
14
  import { faArrowLeft, faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';
15
15
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
16
- import { useElements, useStripe, PaymentElement, Elements } from '@stripe/react-stripe-js';
16
+ import { useElements, useStripe, Elements, PaymentElement } from '@stripe/react-stripe-js';
17
17
  import { loadStripe } from '@stripe/stripe-js/pure/index.js';
18
18
  import { BarChart, AreaChart, ResponsiveContainer, XAxis, Tooltip as Tooltip$1, Area, Bar, Rectangle } from 'recharts';
19
19
  import { omit } from 'lodash-es';
@@ -141,7 +141,7 @@ const useAllErrorFormats = () => {
141
141
  };
142
142
 
143
143
  // This will be replaced at build time by rollup-plugin-replace
144
- const PACKAGE_VERSION = '1.6.0-beta.18';
144
+ const PACKAGE_VERSION = '1.6.0-beta.19';
145
145
  const createRequestHeaders = (token) => {
146
146
  const headers = createClientDevHeaders({ token });
147
147
  // Add the components version header
@@ -239,6 +239,8 @@ const useDownloadFile = (id, onError) => {
239
239
 
240
240
  const InvoiceQuoteContext = createContext({});
241
241
 
242
+ const OverrideTokenContext = createContext({});
243
+
242
244
  /**
243
245
  * Creates a context and provider for a value
244
246
  * Unlike createStateContext, this accepts a value prop directly that can be updated
@@ -925,7 +927,7 @@ function readFragment(...r) {
925
927
 
926
928
  var t = initGraphQLTada();
927
929
 
928
- const query$4 = t(`
930
+ const query$6 = t(`
929
931
  query entityBranding {
930
932
  entityBranding {
931
933
  accentColor
@@ -935,7 +937,7 @@ const query$4 = t(`
935
937
  }
936
938
  `);
937
939
  const getBranding = async ({ token, apiHost }) => {
938
- return await execute(query$4, { apiHost, token }, {});
940
+ return await execute(query$6, { apiHost, token }, {});
939
941
  };
940
942
 
941
943
  const BunnyContext = createContext({});
@@ -957,7 +959,7 @@ function ContextualWrapper({ children, darkMode, configProviderProps, }) {
957
959
  staleTime: 1000 * 60 * 5, // 5 minutes
958
960
  });
959
961
  const branding = data === null || data === void 0 ? void 0 : data.entityBranding;
960
- const isMobile = useIsMobile();
962
+ const isMobile = useIsMobile$1();
961
963
  const entityBranding = useMemo(() => {
962
964
  // This is to determine if the secondary color should be white or black
963
965
  const brandColor = (branding === null || branding === void 0 ? void 0 : branding.brandColor) ? '#' + (branding === null || branding === void 0 ? void 0 : branding.brandColor) : DEFAULT_BRAND_COLOR;
@@ -1023,14 +1025,12 @@ function ContextualWrapper({ children, darkMode, configProviderProps, }) {
1023
1025
  return (jsx(RecoilRoot, { children: jsx(BrandProvider, { value: entityBranding, children: jsx(ConfigProvider, { theme: mergedTheme, children: jsx("div", { className: "bunny-components bunny-contents", children: children }) }) }) }));
1024
1026
  }
1025
1027
 
1026
- const PaymentContext = createContext({});
1027
-
1028
1028
  // Use this hook instead of getting the token from BunnyContext directly
1029
1029
  // Because we have overrideToken as an option, this token ensures the correct token is used
1030
1030
  function useToken() {
1031
1031
  const { token: tokenFromContext } = useContext(BunnyContext);
1032
- const { overrideToken } = useContext(PaymentContext);
1033
- return overrideToken || tokenFromContext;
1032
+ const { overrideToken } = useContext(OverrideTokenContext);
1033
+ return overrideToken !== null && overrideToken !== void 0 ? overrideToken : tokenFromContext;
1034
1034
  }
1035
1035
 
1036
1036
  const defaultStyled = typeof styled === "function" ? styled : styled.default;
@@ -1043,7 +1043,7 @@ const CustomZoomLayout = () => {
1043
1043
  // Consume from the controller provider
1044
1044
  const { currentZoom, setZoomLevel } = useZoomContext();
1045
1045
  const mountTimeRef = useRef(Date.now());
1046
- const isMobile = useIsMobile();
1046
+ const isMobile = useIsMobile$1();
1047
1047
  // Set default zoom to 100% once the document is loaded
1048
1048
  useEffect(() => {
1049
1049
  if (currentZoom < 1 && Date.now() - mountTimeRef.current < 3000) {
@@ -1056,7 +1056,7 @@ const DocumentTemplatePreview = ({ targetUrl }) => {
1056
1056
  const [pdfUrl, setPdfUrl] = useState(null);
1057
1057
  const queryClient = useQueryClient();
1058
1058
  const { apiHost, token } = useContext(BunnyContext);
1059
- const isMobile = useIsMobile();
1059
+ const isMobile = useIsMobile$1();
1060
1060
  const queryKey = useMemo(() => ['documentTemplatePreview', targetUrl], [targetUrl]);
1061
1061
  // Clear previous data when component mounts or id changes
1062
1062
  useEffect(() => {
@@ -1135,7 +1135,7 @@ const InvoiceQuoteView = ({ children, formattedInvoice, html, backButtonName, on
1135
1135
  const { apiHost } = useContext(BunnyContext);
1136
1136
  const token = useToken();
1137
1137
  const { shadow, hideDownloadButton } = useContext(InvoiceQuoteContext);
1138
- const isMobile = useIsMobile();
1138
+ const isMobile = useIsMobile$1();
1139
1139
  const { token: antdToken } = useAntdToken$1();
1140
1140
  const buttonsVisible = formattedInvoice && (!hideDownloadButton || onBackButtonClick);
1141
1141
  return (jsxs("div", { className: `bunny-flex bunny-flex-col bunny-w-full bunny-grow ${isMobile ? 'bunny-overflow-hidden' : ''}`, children: [buttonsVisible ? (jsxs("div", { className: `bunny-flex bunny-justify-between bunny-items-center bunny-pb-4 ${isMobile ? 'bunny-shadow-padding-x' : ''}`, id: "acceptance", children: [jsx("div", { children: onBackButtonClick ? (jsx(BackButton, { onClick: onBackButtonClick, title: backButtonName })) : null }), !hideDownloadButton ? (jsx(Button, { icon: jsx(DownloadOutlined, {}), onClick: () => downloadFile(apiHost + '/api/pdf/invoice/' + formattedInvoice.id, token), children: "Download" })) : null] })) : null, isMobile ? (jsxs(MarkupContainer, { className: "bunny-flex bunny-flex-col bunny-gap-4 bunny-grow bunny-overflow-auto", style: { fontFamily: antdToken.fontFamily }, children: [targetUrl ? (jsx(DocumentTemplatePreview, { targetUrl: targetUrl })) : (jsx(Markup, { content: html })), children] })) : (jsxs(MarkupContainer, { className: `bunny-flex bunny-flex-col bunny-gap-4 bunny-p-4 bunny-bg-white ${shadow ? shadow : 'shadow-md'} bunny-rounded-md`, style: {
@@ -1144,7 +1144,7 @@ const InvoiceQuoteView = ({ children, formattedInvoice, html, backButtonName, on
1144
1144
  }, children: [targetUrl ? (jsx(DocumentTemplatePreview, { targetUrl: targetUrl })) : (jsx(Markup, { content: html })), children] }))] }));
1145
1145
  };
1146
1146
 
1147
- const MUTATION$b = `
1147
+ const MUTATION$a = `
1148
1148
  query FormattedInvoice($id: ID) {
1149
1149
  formattedInvoice(id: $id) {
1150
1150
  amount
@@ -1212,7 +1212,7 @@ query FormattedInvoice($id: ID) {
1212
1212
  const getFormattedInvoice = async ({ id, token, apiHost, }) => {
1213
1213
  const vars = { id };
1214
1214
  const response = await gqlRequest({
1215
- query: MUTATION$b,
1215
+ query: MUTATION$a,
1216
1216
  token,
1217
1217
  vars,
1218
1218
  apiHost,
@@ -1258,632 +1258,63 @@ function LegacyDocument({ documentUuid, documentType, }) {
1258
1258
  }, title: "Invoice PDF", width: "100%" }));
1259
1259
  }
1260
1260
 
1261
- const MUTATION$a = `
1262
- mutation checkout(
1263
- $invoiceId: ID,
1264
- $quoteId: ID,
1265
- $paymentMethodId: ID,
1266
- $paymentMethodData: CheckoutPaymentMethodAttributes
1267
- ) {
1268
- checkout(
1269
- invoiceId: $invoiceId,
1270
- quoteId: $quoteId,
1271
- paymentMethodId: $paymentMethodId,
1272
- paymentMethodData: $paymentMethodData
1273
- ) {
1274
- invoice {
1275
- id
1276
- state
1277
- amount
1278
- amountDue
1279
- }
1280
- payment {
1281
- id
1282
- state
1283
- amount
1284
- }
1285
- paymentApplication {
1286
- id
1287
- invoiceId
1288
- paymentId
1289
- }
1290
- transaction {
1291
- id
1292
- amount
1293
- }
1294
- }
1295
- }
1296
- `;
1297
- const checkout = async ({ quoteId, invoiceId, paymentMethodId, paymentMethodData, token, apiHost, }) => {
1298
- const mutationVars = {
1299
- quoteId,
1300
- invoiceId,
1301
- paymentMethodId,
1302
- };
1303
- if (paymentMethodData) {
1304
- mutationVars.paymentMethodData = {
1305
- ...paymentMethodData,
1306
- metadata: paymentMethodData.metadata,
1307
- };
1308
- }
1309
- const response = await gqlRequest({
1310
- query: MUTATION$a,
1311
- token,
1312
- vars: mutationVars,
1313
- apiHost: apiHost,
1314
- });
1315
- const { errors } = response === null || response === void 0 ? void 0 : response.checkout;
1316
- if (errors)
1317
- throw errors;
1318
- return {
1319
- savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
1320
- };
1321
- };
1261
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1322
1262
 
1323
- const CURRENT_USER_DATA_QUERY = `{
1324
- company {
1325
- name
1326
- }
1327
- currentUser {
1328
- account {
1329
- billingCountry
1330
- currencyId
1331
- id
1332
- }
1333
- authObjectName
1334
- payload {
1335
- returnUrl
1336
- }
1337
- privacyUrl
1338
- termsUrl
1339
- entityId
1340
- }
1341
- }`;
1342
- const getCurrentUserData = async ({ token, apiHost }) => {
1343
- var _a, _b, _c, _d, _e, _f, _g, _h;
1344
- const response = await gqlRequest({
1345
- query: CURRENT_USER_DATA_QUERY,
1346
- token,
1347
- apiHost,
1348
- });
1349
- return {
1350
- authObjectName: (_a = response === null || response === void 0 ? void 0 : response.currentUser) === null || _a === void 0 ? void 0 : _a.authObjectName,
1351
- account: (_b = response === null || response === void 0 ? void 0 : response.currentUser) === null || _b === void 0 ? void 0 : _b.account,
1352
- companyName: (_c = response === null || response === void 0 ? void 0 : response.company) === null || _c === void 0 ? void 0 : _c.name,
1353
- returnUrl: (_e = (_d = response === null || response === void 0 ? void 0 : response.currentUser) === null || _d === void 0 ? void 0 : _d.payload) === null || _e === void 0 ? void 0 : _e.returnUrl,
1354
- privacyUrl: (_f = response === null || response === void 0 ? void 0 : response.currentUser) === null || _f === void 0 ? void 0 : _f.privacyUrl,
1355
- termsUrl: (_g = response === null || response === void 0 ? void 0 : response.currentUser) === null || _g === void 0 ? void 0 : _g.termsUrl,
1356
- entityId: (_h = response === null || response === void 0 ? void 0 : response.currentUser) === null || _h === void 0 ? void 0 : _h.entityId,
1357
- };
1358
- };
1263
+ function getDefaultExportFromCjs (x) {
1264
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1265
+ }
1359
1266
 
1360
- const useCurrentUserData = (token) => {
1361
- const { apiHost } = useContext(BunnyContext);
1362
- const { data: currentUserData, isLoading: isCurrentUserDataLoading } = useQuery({
1363
- queryKey: QueryKeyFactory$1.default.currentUserKey(token),
1364
- queryFn: () => getCurrentUserData({ token, apiHost }),
1365
- enabled: Boolean(token),
1366
- });
1367
- const currentUser = currentUserData || {};
1368
- return { currentUser, isCurrentUserDataLoading };
1369
- };
1267
+ var lodash$1 = {exports: {}};
1370
1268
 
1371
- const paymentMethodsQuery = () => `query PaymentMethods($accountId: ID) {
1372
- paymentMethods (accountId: $accountId) {
1373
- nodes {
1374
- id
1375
- pluginId
1376
- accountId
1377
- expirationDate
1378
- plugin {
1379
- guid
1380
- id
1381
- }
1382
- state
1383
- metadata {
1384
- issuer
1385
- identifier
1386
- kind
1387
- description
1388
- icon
1389
- type
1390
- }
1391
- isDefault
1392
- }
1393
- }
1394
- }`;
1395
- const getPaymentMethods = async ({ apiHost, token, accountId, }) => {
1396
- var _a;
1397
- const response = await gqlRequest({
1398
- query: paymentMethodsQuery(),
1399
- token,
1400
- apiHost,
1401
- vars: { accountId },
1402
- });
1403
- const paymentMethods = ((_a = response === null || response === void 0 ? void 0 : response.paymentMethods) === null || _a === void 0 ? void 0 : _a.nodes) || [];
1404
- return paymentMethods;
1405
- };
1406
- const usePaymentMethod = ({ accountId, token, apiHost, enabled = true, }) => {
1407
- const { data, isLoading } = useQuery({
1408
- queryKey: QueryKeyFactory$1.default.accountPaymentMethodsKey({
1409
- accountId,
1410
- token,
1411
- }),
1412
- queryFn: () => getPaymentMethods({ apiHost, token, accountId }),
1413
- staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
1414
- enabled,
1415
- });
1416
- return {
1417
- paymentMethods: data,
1418
- defaultPaymentMethod: data === null || data === void 0 ? void 0 : data.find((paymentMethod) => paymentMethod.isDefault),
1419
- isLoading,
1420
- };
1421
- };
1269
+ /**
1270
+ * @license
1271
+ * Lodash <https://lodash.com/>
1272
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1273
+ * Released under MIT license <https://lodash.com/license>
1274
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1275
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1276
+ */
1277
+ var lodash = lodash$1.exports;
1422
1278
 
1423
- const filterPaymentPlugins = (plugins) => plugins === null || plugins === void 0 ? void 0 : plugins.filter((plugin) => { var _a, _b; return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'payment' && ((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'valid'; });
1424
- const MUTATION$9 = `query PaymentPlugins($accountId: ID) {
1425
- paymentPlugins (accountId: $accountId) {
1426
- enabled
1427
- entities
1428
- guid
1429
- hidden
1430
- id
1431
- name
1432
- status
1433
- type
1434
- webhookEnabled
1435
- components
1436
- }
1437
- }`;
1438
- const getPaymentPlugins = async ({ apiHost, token, accountId, }) => {
1439
- try {
1440
- const response = await gqlRequest({
1441
- query: MUTATION$9,
1442
- token,
1443
- apiHost,
1444
- vars: { accountId },
1445
- });
1446
- return (response === null || response === void 0 ? void 0 : response.paymentPlugins) || [];
1447
- }
1448
- catch (error) {
1449
- return [];
1450
- }
1451
- };
1452
- const usePaymentPlugins = ({ apiHost, token, accountId, }) => {
1453
- const { data: paymentPlugins, isFetched } = useQuery({
1454
- queryKey: ['paymentPlugins', token],
1455
- queryFn: () => getPaymentPlugins({ apiHost, token, accountId }),
1456
- staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
1457
- });
1458
- const filteredPaymentPlugins = filterPaymentPlugins(paymentPlugins);
1459
- return {
1460
- paymentPlugins: filteredPaymentPlugins,
1461
- isFetched,
1462
- };
1463
- };
1279
+ var hasRequiredLodash;
1464
1280
 
1465
- const getQuoteAmountDue = (quote) => {
1466
- return quote.amountDue || quote.amount;
1467
- };
1281
+ function requireLodash () {
1282
+ if (hasRequiredLodash) return lodash$1.exports;
1283
+ hasRequiredLodash = 1;
1284
+ (function (module, exports) {
1285
+ (function() {
1468
1286
 
1469
- function usePay$1({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }) {
1470
- const { apiHost } = useContext(BunnyContext);
1471
- const { customCheckoutFunction } = useContext(PaymentContext);
1472
- const token = useToken();
1473
- const pay = async () => {
1474
- const currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currencyId);
1475
- if (!currencyId) {
1476
- throw new Error('No currencyId');
1477
- }
1478
- try {
1479
- if (customCheckoutFunction) {
1480
- const response = await customCheckoutFunction(plugin);
1481
- onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
1482
- }
1483
- else {
1484
- const response = await checkout({
1485
- invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
1486
- quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
1487
- paymentMethodId: storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.id,
1488
- token,
1489
- apiHost,
1490
- });
1491
- onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
1492
- }
1493
- }
1494
- catch (error) {
1495
- onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error);
1496
- }
1497
- };
1498
- return { pay };
1499
- }
1287
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
1288
+ var undefined$1;
1500
1289
 
1501
- const { useToken: useAntdToken } = theme$1;
1502
- const createPaymentMethod = async ({ paymentMethodId, plugin, token, apiHost, accountId, }) => {
1503
- const response = await invokePlugin({
1504
- plugin,
1505
- method: 'store_payment_method',
1506
- payload: {
1507
- payment_method_id: paymentMethodId,
1508
- account_id: accountId,
1509
- },
1510
- token,
1511
- apiHost,
1512
- });
1513
- if (response.status !== 'success')
1514
- throw new Error(response.message || 'Unknown error');
1515
- return response;
1516
- };
1517
- const createSetupIntent = (plugin, apiHost, token, accountId) => {
1518
- return invokePlugin({
1519
- plugin,
1520
- method: 'create_setup_intent',
1521
- token,
1522
- apiHost,
1523
- payload: {
1524
- account_id: accountId,
1525
- },
1526
- });
1527
- };
1528
- const createPaymentHold = async ({ quote, plugin, token, apiHost, paymentMethodId, }) => {
1529
- const payload = {
1530
- quote_id: quote.id,
1531
- amount: quote.amount,
1532
- payment_method_id: paymentMethodId,
1533
- };
1534
- const response = await invokePlugin({
1535
- plugin,
1536
- method: 'create_payment_hold',
1537
- payload,
1538
- token,
1539
- apiHost,
1540
- });
1541
- if (response.status !== 'success')
1542
- throw new Error(response.message || 'Unknown error');
1543
- return response;
1544
- };
1545
- const fetchStripeKey = async (plugin, apiHost, token, accountId) => {
1546
- const response = await invokePlugin({
1547
- plugin,
1548
- method: 'retrieve_config',
1549
- token,
1550
- apiHost,
1551
- payload: {
1552
- account_id: accountId,
1553
- },
1554
- });
1555
- return response;
1556
- };
1557
- loadStripe.setLoadParameters({ advancedFraudSignals: false });
1558
- const useStripePlugin = (plugin, apiHost, currencyId, token, accountId) => {
1559
- const [stripe, setStripe] = useState(null);
1560
- const showErrorNotification = useErrorNotification();
1561
- const { token: antdToken } = useAntdToken();
1562
- function getFontFamily() {
1563
- if (antdToken.fontFamily === 'Inter') {
1564
- return 'var(--font-inter, Inter), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
1565
- }
1566
- return antdToken.fontFamily;
1567
- }
1568
- const fontFamily = getFontFamily();
1569
- const appearance = {
1570
- variables: {
1571
- fontFamily: fontFamily,
1572
- fontLineHeight: antdToken.lineHeight.toString(),
1573
- borderRadius: antdToken.borderRadius.toString() + 'px',
1574
- colorBackground: 'white',
1575
- colorPrimary: antdToken.colorPrimary,
1576
- },
1577
- rules: {
1578
- '.Input': {
1579
- fontFamily: fontFamily,
1580
- },
1581
- '.Label': {
1582
- fontFamily: fontFamily,
1583
- },
1584
- },
1585
- };
1586
- const options = {
1587
- mode: 'setup',
1588
- currency: currencyId,
1589
- setupFutureUsage: 'off_session',
1590
- appearance,
1591
- };
1592
- useEffect(() => {
1593
- var _a, _b;
1594
- if (!plugin)
1595
- return;
1596
- if (((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) !== 'StripePayment')
1597
- return;
1598
- fetchStripeKey(plugin, apiHost || '', token, accountId)
1599
- .then(({ payload }) => loadStripe(payload.publishable_key).then(setStripe))
1600
- .catch(error => {
1601
- console.error('Caught Error in fetching stripe key: ', error);
1602
- showErrorNotification(error.message, 'Unexpected Error fetching key');
1603
- });
1604
- // eslint-disable-next-line
1605
- }, [plugin, token]);
1606
- return { stripe, options };
1607
- };
1608
-
1609
- function useApproveHold$1({ onApproveHoldSuccess, onApproveHoldError, }) {
1610
- // Hooks
1611
- const [isSaving, setIsSaving] = useState(false);
1612
- const { apiHost } = useContext(BunnyContext);
1613
- const token = useToken();
1614
- const approveHold = async ({ plugin, quote, paymentMethodId, }) => {
1615
- try {
1616
- if (!token)
1617
- throw new Error("Token couldn't be retrieved");
1618
- setIsSaving(true);
1619
- const response = await createPaymentHold({
1620
- quote,
1621
- plugin,
1622
- token,
1623
- apiHost,
1624
- paymentMethodId,
1625
- });
1626
- if (response.status !== 'success')
1627
- throw new Error(response === null || response === void 0 ? void 0 : response.message);
1628
- onApproveHoldSuccess === null || onApproveHoldSuccess === void 0 ? void 0 : onApproveHoldSuccess(response);
1629
- }
1630
- catch (error) {
1631
- console.error(error);
1632
- onApproveHoldError === null || onApproveHoldError === void 0 ? void 0 : onApproveHoldError(error);
1633
- }
1634
- finally {
1635
- setIsSaving(false);
1636
- }
1637
- };
1638
- return { approveHold, isSaving };
1639
- }
1290
+ /** Used as the semantic version number. */
1291
+ var VERSION = '4.17.21';
1640
1292
 
1641
- function useApproveHold({ onApproveHoldSuccess, onApproveHoldError, }) {
1642
- // Hooks
1643
- const [isSaving, setIsSaving] = useState(false);
1644
- const { apiHost } = useContext(BunnyContext);
1645
- const token = useToken();
1646
- const approveHold = async ({ plugin, quote, paymentMethodId, }) => {
1647
- try {
1648
- if (!token)
1649
- throw new Error("Token couldn't be retrieved");
1650
- setIsSaving(true);
1651
- const response = await createPaymentHold({
1652
- quote,
1653
- plugin,
1654
- token,
1655
- apiHost,
1656
- paymentMethodId,
1657
- });
1658
- if (response.status !== 'success')
1659
- throw new Error(response === null || response === void 0 ? void 0 : response.message);
1660
- onApproveHoldSuccess === null || onApproveHoldSuccess === void 0 ? void 0 : onApproveHoldSuccess(response);
1661
- }
1662
- catch (error) {
1663
- console.error(error);
1664
- onApproveHoldError === null || onApproveHoldError === void 0 ? void 0 : onApproveHoldError(error);
1665
- }
1666
- finally {
1667
- setIsSaving(false);
1668
- }
1669
- };
1670
- return { approveHold, isSaving };
1671
- }
1293
+ /** Used as the size to enable large array optimizations. */
1294
+ var LARGE_ARRAY_SIZE = 200;
1672
1295
 
1673
- function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }) {
1674
- // Hooks
1675
- const { apiHost } = useContext(BunnyContext);
1676
- const { customCheckoutFunction } = useContext(PaymentContext);
1677
- const token = useToken();
1678
- const pay = async () => {
1679
- try {
1680
- if (customCheckoutFunction) {
1681
- const response = await customCheckoutFunction(plugin);
1682
- onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
1683
- }
1684
- else {
1685
- const response = await checkout({
1686
- invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
1687
- quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
1688
- paymentMethodId: storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.id,
1689
- token,
1690
- apiHost,
1691
- });
1692
- onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
1693
- }
1694
- }
1695
- catch (error) {
1696
- onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error);
1697
- }
1698
- };
1699
- return { pay };
1700
- }
1296
+ /** Error message constants. */
1297
+ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
1298
+ FUNC_ERROR_TEXT = 'Expected a function',
1299
+ INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
1701
1300
 
1702
- const handleAllErrorFormats = useAllErrorFormats$1();
1703
- const showErrorNotification$5 = useErrorNotification();
1704
- const ActualCheckoutFooter = ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, }) => {
1705
- const isMobile = useIsMobile();
1706
- const [isPaying, setIsPaying] = useState(false);
1707
- const { defaultPaymentMethod } = useContext(PaymentContext);
1708
- const amountDue = quote ? getQuoteAmountDue(quote) : invoice === null || invoice === void 0 ? void 0 : invoice.amountDue;
1709
- const currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currencyId);
1710
- // Payment hooks
1711
- const { pay: payDemoPay } = usePay$1({
1712
- onPaymentSuccess,
1713
- onPaymentError: error => {
1714
- setIsPaying(false);
1715
- handleAllErrorFormats(error);
1716
- },
1717
- quote: quote,
1718
- invoice: invoice,
1719
- storedPaymentMethod: defaultPaymentMethod,
1720
- plugin,
1721
- });
1722
- const { pay: payStripe } = usePay({
1723
- onPaymentSuccess,
1724
- onPaymentError: error => {
1725
- setIsPaying(false);
1726
- handleAllErrorFormats(error);
1727
- },
1728
- quote: quote,
1729
- invoice: invoice,
1730
- storedPaymentMethod: defaultPaymentMethod,
1731
- plugin,
1732
- });
1733
- // Approve hold hooks
1734
- const { approveHold: approveHoldStripe } = useApproveHold$1({
1735
- onApproveHoldSuccess: response => {
1736
- onPaymentHoldSuccess === null || onPaymentHoldSuccess === void 0 ? void 0 : onPaymentHoldSuccess(response);
1737
- },
1738
- onApproveHoldError: error => {
1739
- setIsPaying(false);
1740
- handleAllErrorFormats(error);
1741
- },
1742
- });
1743
- const { approveHold: approveHoldDemoPay } = useApproveHold({
1744
- onApproveHoldSuccess: response => {
1745
- onPaymentHoldSuccess === null || onPaymentHoldSuccess === void 0 ? void 0 : onPaymentHoldSuccess(response);
1746
- },
1747
- onApproveHoldError: error => {
1748
- setIsPaying(false);
1749
- handleAllErrorFormats(error);
1750
- },
1751
- });
1752
- const handleApproveHold = async () => {
1753
- var _a, _b, _c, _d;
1754
- if (!plugin)
1755
- return console.error('plugin is undefined');
1756
- if (!quote)
1757
- return console.error('quote is undefined');
1758
- if (!(defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id))
1759
- return console.error('defaultPaymentMethod is undefined');
1760
- switch ((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) {
1761
- case 'StripePayment':
1762
- setIsPaying(true);
1763
- await approveHoldStripe({
1764
- plugin,
1765
- quote,
1766
- paymentMethodId: defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id,
1767
- });
1768
- break;
1769
- case 'DemoPayPayment':
1770
- setIsPaying(true);
1771
- await approveHoldDemoPay({
1772
- plugin,
1773
- quote,
1774
- paymentMethodId: defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id,
1775
- });
1776
- break;
1777
- default:
1778
- showErrorNotification$5(`Payment holds are not supported by ${(_d = (_c = plugin.components) === null || _c === void 0 ? void 0 : _c.frontend) === null || _d === void 0 ? void 0 : _d[0].name}`);
1779
- break;
1780
- }
1781
- };
1782
- const handlePaymentSubmit = async () => {
1783
- var _a, _b;
1784
- setIsPaying(true);
1785
- if (!plugin)
1786
- return;
1787
- switch ((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) {
1788
- case 'StripePayment':
1789
- await payStripe();
1790
- break;
1791
- case 'DemoPayPayment':
1792
- await payDemoPay();
1793
- break;
1794
- }
1795
- };
1796
- if (paymentHoldOptions === null || paymentHoldOptions === void 0 ? void 0 : paymentHoldOptions.payToAccept) {
1797
- return (jsx(Button, { className: "bunny-w-full", disabled: isPaying, onClick: () => {
1798
- handleApproveHold();
1799
- }, size: isMobile ? 'large' : 'middle', type: "primary", children: `${isPaying ? 'Approving hold for' : 'Approve hold for'} ${amountDue && currencyId ? formatCurrency$1(amountDue, currencyId) : ''}` }));
1800
- }
1801
- return (jsx(Button, { className: "bunny-w-full", disabled: isPaying, onClick: () => {
1802
- setIsPaying(true);
1803
- handlePaymentSubmit();
1804
- }, size: isMobile ? 'large' : 'middle', type: "primary", children: `${isPaying ? 'Paying' : 'Pay'} ${amountDue && currencyId ? formatCurrency$1(amountDue, currencyId) : ''}` }));
1805
- };
1806
- const CheckoutFooter = ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, }) => {
1807
- if (!plugin)
1808
- return null;
1809
- return (jsx(ActualCheckoutFooter, { paymentHoldOptions: paymentHoldOptions, plugin: plugin, invoice: invoice, quote: quote, onPaymentSuccess: onPaymentSuccess, onPaymentHoldSuccess: onPaymentHoldSuccess }));
1810
- };
1301
+ /** Used to stand-in for `undefined` hash values. */
1302
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1811
1303
 
1812
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1304
+ /** Used as the maximum memoize cache size. */
1305
+ var MAX_MEMOIZE_SIZE = 500;
1813
1306
 
1814
- function getDefaultExportFromCjs (x) {
1815
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1816
- }
1307
+ /** Used as the internal argument placeholder. */
1308
+ var PLACEHOLDER = '__lodash_placeholder__';
1817
1309
 
1818
- var dayjs_min$1 = {exports: {}};
1310
+ /** Used to compose bitmasks for cloning. */
1311
+ var CLONE_DEEP_FLAG = 1,
1312
+ CLONE_FLAT_FLAG = 2,
1313
+ CLONE_SYMBOLS_FLAG = 4;
1819
1314
 
1820
- var dayjs_min = dayjs_min$1.exports;
1821
-
1822
- var hasRequiredDayjs_min;
1823
-
1824
- function requireDayjs_min () {
1825
- if (hasRequiredDayjs_min) return dayjs_min$1.exports;
1826
- hasRequiredDayjs_min = 1;
1827
- (function (module, exports) {
1828
- !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
1829
- } (dayjs_min$1));
1830
- return dayjs_min$1.exports;
1831
- }
1832
-
1833
- var dayjs_minExports = requireDayjs_min();
1834
- var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
1835
-
1836
- var lodash$1 = {exports: {}};
1837
-
1838
- /**
1839
- * @license
1840
- * Lodash <https://lodash.com/>
1841
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1842
- * Released under MIT license <https://lodash.com/license>
1843
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1844
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1845
- */
1846
- var lodash = lodash$1.exports;
1847
-
1848
- var hasRequiredLodash;
1849
-
1850
- function requireLodash () {
1851
- if (hasRequiredLodash) return lodash$1.exports;
1852
- hasRequiredLodash = 1;
1853
- (function (module, exports) {
1854
- (function() {
1855
-
1856
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
1857
- var undefined$1;
1858
-
1859
- /** Used as the semantic version number. */
1860
- var VERSION = '4.17.21';
1861
-
1862
- /** Used as the size to enable large array optimizations. */
1863
- var LARGE_ARRAY_SIZE = 200;
1864
-
1865
- /** Error message constants. */
1866
- var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
1867
- FUNC_ERROR_TEXT = 'Expected a function',
1868
- INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
1869
-
1870
- /** Used to stand-in for `undefined` hash values. */
1871
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1872
-
1873
- /** Used as the maximum memoize cache size. */
1874
- var MAX_MEMOIZE_SIZE = 500;
1875
-
1876
- /** Used as the internal argument placeholder. */
1877
- var PLACEHOLDER = '__lodash_placeholder__';
1878
-
1879
- /** Used to compose bitmasks for cloning. */
1880
- var CLONE_DEEP_FLAG = 1,
1881
- CLONE_FLAT_FLAG = 2,
1882
- CLONE_SYMBOLS_FLAG = 4;
1883
-
1884
- /** Used to compose bitmasks for value comparisons. */
1885
- var COMPARE_PARTIAL_FLAG = 1,
1886
- COMPARE_UNORDERED_FLAG = 2;
1315
+ /** Used to compose bitmasks for value comparisons. */
1316
+ var COMPARE_PARTIAL_FLAG = 1,
1317
+ COMPARE_UNORDERED_FLAG = 2;
1887
1318
 
1888
1319
  /** Used to compose bitmasks for function metadata. */
1889
1320
  var WRAP_BIND_FLAG = 1,
@@ -19044,55 +18475,24 @@ function requireLodash () {
19044
18475
 
19045
18476
  var lodashExports = requireLodash();
19046
18477
 
19047
- const Card = ({ children, className, style, }) => {
19048
- const { darkMode } = useContext(BunnyContext);
19049
- return (jsx("div", { className: `bunny-flex bunny-flex-col bunny-rounded-md ${className}`, style: {
19050
- ...style,
19051
- backgroundColor: darkMode ? 'var(--row-background-dark)' : 'var(--row-background)',
19052
- }, children: children }));
19053
- };
19054
-
19055
- const tagStyleMap = {
19056
- blue: { color: 'var(--bunny-blue-500)', background: 'var(--bunny-blue-200)' },
19057
- green: {
19058
- color: 'var(--bunny-green-600)',
19059
- background: 'var(--bunny-green-200)',
19060
- },
19061
- red: { color: 'var(--bunny-red-500)', background: 'var(--bunny-red-200)' },
19062
- orange: {
19063
- color: 'var(--bunny-orange-500)',
19064
- background: 'var(--bunny-orange-200)',
19065
- },
19066
- yellow: {
19067
- color: 'var(--bunny-yellow-500)',
19068
- background: 'var(--bunny-yellow-200)',
19069
- },
19070
- purple: {
19071
- color: 'var(--bunny-purple-500)',
19072
- background: 'var(--bunny-purple-200)',
19073
- },
19074
- black: { color: 'white', background: 'var(--bunny-black)' },
19075
- };
19076
- // This component provides custom styling for antd Tag components without using antd overwrites.
19077
- // Please use this component instead of the antd Tag component directly to maintain consistent styling.
19078
- const CustomizedTag = ({ children, color, className, style, }) => {
19079
- return (jsx(Tag, { color: color, style: { ...(color ? tagStyleMap[color] : undefined), ...style }, className: `bunny-m-0 bunny-rounded-full bunny-border-none bunny-whitespace-nowrap ${className}`, children: children }));
18478
+ const Amex = ({ className }) => {
18479
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "#1F72CD", stroke: "#D9D9D9" }), jsx("path", { "fill-rule": "evenodd", clipRule: "evenodd", d: "M12.5493 17L6 31.4935H13.8405L14.8125 29.1826H17.0342L18.0062 31.4935H26.6364V29.7298L27.4054 31.4935H31.8696L32.6386 29.6925V31.4935H50.587L52.7695 29.2426L54.813 31.4935L64.0317 31.5121L57.4617 24.2872L64.0317 17H54.956L52.8315 19.2093L50.8523 17H31.3268L29.6501 20.7409L27.9341 17H20.11V18.7037L19.2396 17H12.5493ZM39.3516 19.0581H49.6584L52.8108 22.4633L56.0648 19.0581H59.2172L54.4275 24.2852L59.2172 29.452H55.9218L52.7695 26.0073L49.4989 29.452H39.3516V19.0581ZM41.8968 23.1099V21.2114V21.2096H48.328L51.1342 24.2458L48.2036 27.2986H41.8968V25.226H47.5197V23.1099H41.8968ZM14.0664 19.0581H17.8883L22.2324 28.8862V19.0581H26.4191L29.7745 26.1048L32.8668 19.0581H37.0326V29.4581H34.4978L34.4771 21.3087L30.7817 29.4581H28.5142L24.7981 21.3087V29.4581H19.5836L18.595 27.1266H13.254L12.2675 29.4561H9.47358L14.0664 19.0581ZM14.166 24.9712L15.9256 20.8177L17.6832 24.9712H14.166Z", fill: "white" })] }));
19080
18480
  };
19081
18481
 
19082
- const Amex = ({ className }) => {
19083
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "#1F72CD", stroke: "#D9D9D9" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12.5493 17L6 31.4935H13.8405L14.8125 29.1826H17.0342L18.0062 31.4935H26.6364V29.7298L27.4054 31.4935H31.8696L32.6386 29.6925V31.4935H50.587L52.7695 29.2426L54.813 31.4935L64.0317 31.5121L57.4617 24.2872L64.0317 17H54.956L52.8315 19.2093L50.8523 17H31.3268L29.6501 20.7409L27.9341 17H20.11V18.7037L19.2396 17H12.5493ZM39.3516 19.0581H49.6584L52.8108 22.4633L56.0648 19.0581H59.2172L54.4275 24.2852L59.2172 29.452H55.9218L52.7695 26.0073L49.4989 29.452H39.3516V19.0581ZM41.8968 23.1099V21.2114V21.2096H48.328L51.1342 24.2458L48.2036 27.2986H41.8968V25.226H47.5197V23.1099H41.8968ZM14.0664 19.0581H17.8883L22.2324 28.8862V19.0581H26.4191L29.7745 26.1048L32.8668 19.0581H37.0326V29.4581H34.4978L34.4771 21.3087L30.7817 29.4581H28.5142L24.7981 21.3087V29.4581H19.5836L18.595 27.1266H13.254L12.2675 29.4561H9.47358L14.0664 19.0581ZM14.166 24.9712L15.9256 20.8177L17.6832 24.9712H14.166Z", fill: "white" })] }));
18482
+ const Bancontact = ({ className }) => {
18483
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.2243 35.1715C18.2243 34.882 18.156 34.6314 18.0199 34.4199C17.8835 34.2083 17.7043 34.0468 17.4819 33.9355C17.7043 33.8242 17.8766 33.6597 17.9991 33.4426C18.1214 33.2255 18.1825 32.9806 18.1825 32.7078V32.5575C18.1825 32.2233 18.1186 31.9451 17.9908 31.7223C17.8628 31.4996 17.6833 31.3213 17.4526 31.1878C17.2219 31.0541 16.9451 30.9582 16.6227 30.8995C16.3 30.8411 15.9414 30.812 15.5465 30.812C15.4131 30.812 15.274 30.8147 15.1296 30.8203C14.9848 30.8258 14.8445 30.8328 14.7083 30.8411C14.572 30.8494 14.4468 30.8593 14.3329 30.8704C14.2188 30.8817 14.1256 30.8928 14.0534 30.9037C13.8921 30.9318 13.7781 30.9817 13.7114 31.0541C13.6448 31.1266 13.6113 31.2575 13.6113 31.4467V36.5245C13.6113 36.7139 13.646 36.8447 13.7156 36.917C13.7851 36.9895 13.9032 37.0394 14.0702 37.0673C14.1535 37.084 14.2536 37.0979 14.3704 37.1091C14.4871 37.1202 14.6136 37.1299 14.7499 37.1383C14.8862 37.1466 15.0265 37.1535 15.1711 37.1593C15.3158 37.1646 15.4575 37.1676 15.5966 37.1676C15.9581 37.1676 16.2986 37.1397 16.6185 37.084C16.9381 37.0285 17.2161 36.9295 17.4526 36.7874C17.689 36.6456 17.8766 36.4534 18.0157 36.2113C18.1546 35.969 18.2243 35.6642 18.2243 35.2967V35.1715ZM16.8063 32.7746C16.8063 32.8637 16.7924 32.9487 16.7645 33.0293C16.7366 33.11 16.6909 33.1795 16.627 33.2383C16.5629 33.2966 16.4768 33.3439 16.3684 33.38C16.2599 33.4162 16.1222 33.4343 15.9554 33.4343H15.0213V31.9895C15.049 31.9895 15.0921 31.9883 15.1505 31.9853C15.2089 31.9825 15.27 31.9812 15.3339 31.9812H15.6551C16.0833 31.9812 16.3822 32.0354 16.5518 32.144C16.7214 32.2526 16.8063 32.421 16.8063 32.6492V32.7746ZM16.5935 35.8062C16.7576 35.6782 16.8397 35.4971 16.8397 35.2634V35.1714C16.8397 34.971 16.7756 34.797 16.6478 34.6494C16.5198 34.502 16.289 34.4282 15.9554 34.4282H15.0213V35.9898H15.1671C15.231 35.9898 15.2977 35.9916 15.3673 35.9942C15.4368 35.9969 15.5035 35.9985 15.5676 35.9985H15.7051C16.1333 35.9985 16.4295 35.9343 16.5935 35.8062ZM22.7955 33.9438C22.7955 33.6377 22.7496 33.3772 22.6578 33.1629C22.5662 32.9487 22.4368 32.7732 22.27 32.6367C22.1032 32.5004 21.8988 32.4003 21.6568 32.3362C21.415 32.2722 21.1439 32.2401 20.8436 32.2401C20.5654 32.2401 20.2943 32.2597 20.0303 32.2987C19.766 32.3375 19.556 32.3766 19.4005 32.4154C19.2948 32.4435 19.242 32.5046 19.242 32.5991V33.2756C19.242 33.3314 19.2559 33.3705 19.2837 33.3925C19.3115 33.4149 19.3475 33.4261 19.3922 33.4261H19.4337C19.5006 33.4204 19.5839 33.4135 19.684 33.4051C19.7842 33.3968 19.8968 33.3901 20.022 33.3842C20.1471 33.3788 20.2777 33.3746 20.414 33.3717C20.5501 33.3689 20.6851 33.3675 20.8186 33.3675C21.0131 33.3675 21.1661 33.4038 21.2773 33.4761C21.3885 33.5486 21.4441 33.7045 21.4441 33.9438V34.2445H20.9937C20.2763 34.2445 19.7549 34.3572 19.4296 34.5827C19.1043 34.8081 18.9416 35.1659 18.9416 35.6558V35.7313C18.9416 36.0039 18.982 36.2321 19.0625 36.4158C19.1431 36.5996 19.2503 36.7472 19.3837 36.8587C19.5172 36.9699 19.6686 37.0493 19.8384 37.0964C20.008 37.1438 20.1846 37.1676 20.3681 37.1676C20.6184 37.1676 20.8339 37.1341 21.0145 37.0673C21.1952 37.0005 21.3662 36.9086 21.5276 36.7917V36.9253C21.5276 36.9699 21.5442 37.0089 21.5776 37.0422C21.6111 37.0756 21.6499 37.0923 21.6944 37.0923H22.6287C22.6731 37.0923 22.712 37.0756 22.7455 37.0422C22.7789 37.0089 22.7955 36.9699 22.7955 36.9253V33.9438ZM21.1481 36.0942C21.2619 36.0581 21.3691 36.015 21.4692 35.9648V35.0462H20.9937C20.8491 35.0462 20.7296 35.0587 20.635 35.0837C20.5404 35.1088 20.4653 35.1465 20.4098 35.1966C20.3542 35.2465 20.3152 35.3107 20.2931 35.3886C20.2707 35.4666 20.2596 35.5556 20.2596 35.6558V35.7312C20.2596 35.9092 20.3026 36.0233 20.3889 36.0734C20.4751 36.1235 20.6071 36.1485 20.7852 36.1485C20.913 36.1485 21.0339 36.1306 21.1481 36.0942ZM27.9007 36.917V34.1358C27.9007 33.8744 27.8799 33.6278 27.8381 33.3968C27.7964 33.166 27.7214 32.9653 27.6129 32.7954C27.5045 32.6256 27.3543 32.4905 27.1624 32.3904C26.9707 32.2902 26.7245 32.2401 26.4242 32.2401C26.1572 32.2401 25.9208 32.2723 25.7152 32.3369C25.5094 32.4014 25.2925 32.515 25.0646 32.6776V32.4752C25.0646 32.4305 25.0478 32.3911 25.0145 32.3575C24.9811 32.3238 24.9421 32.3068 24.8976 32.3068H23.9634C23.9187 32.3068 23.8799 32.3235 23.8467 32.357C23.8133 32.3904 23.7966 32.4295 23.7966 32.4739V36.917C23.7966 36.9615 23.8145 37.0019 23.8508 37.038C23.8869 37.0743 23.9272 37.0923 23.9717 37.0923H24.9811C25.0256 37.0923 25.0646 37.0743 25.0978 37.0382C25.1313 37.0021 25.1479 36.9619 25.1479 36.9173V33.6341C25.2925 33.5564 25.4287 33.4925 25.5567 33.4426C25.6845 33.3925 25.8096 33.3675 25.932 33.3675C26.0599 33.3675 26.1642 33.38 26.2449 33.4051C26.3254 33.4301 26.388 33.4731 26.4325 33.5345C26.477 33.5954 26.5076 33.6759 26.5243 33.7757C26.5409 33.8758 26.5494 33.9981 26.5494 34.1425V36.9173C26.5494 36.9619 26.566 37.0021 26.5994 37.0382C26.6327 37.0743 26.6715 37.0923 26.7162 37.0923H27.7255C27.7699 37.0923 27.8102 37.0743 27.8464 37.038C27.8826 37.0019 27.9007 36.9615 27.9007 36.917ZM32.0047 36.1071V36.8502C32.0047 36.9114 31.9907 36.9546 31.963 36.9796C31.9351 37.0047 31.8906 37.0255 31.8294 37.0422C31.7127 37.0701 31.5611 37.0978 31.3749 37.1259C31.1885 37.1535 30.9703 37.1676 30.72 37.1676C30.1305 37.1676 29.6592 36.9867 29.3062 36.6246C28.953 36.2628 28.7765 35.7394 28.7765 35.0546V34.3531C28.7765 33.6682 28.953 33.1448 29.3062 32.7831C29.6592 32.421 30.1305 32.2401 30.72 32.2401C30.9703 32.2401 31.1885 32.254 31.3749 32.2817C31.5611 32.3098 31.7127 32.3375 31.8294 32.3653C31.8906 32.3819 31.9351 32.4029 31.963 32.4279C31.9907 32.453 32.0047 32.4962 32.0047 32.5574V33.3007C32.0047 33.3453 31.9893 33.38 31.9588 33.4051C31.9281 33.4301 31.8906 33.4426 31.8462 33.4426H31.8294C31.6737 33.4261 31.5251 33.4121 31.3832 33.401C31.2413 33.3901 31.0508 33.3842 30.8118 33.3842C30.7172 33.3842 30.6283 33.3996 30.5448 33.4301C30.4613 33.4608 30.3891 33.5137 30.328 33.5888C30.2666 33.6641 30.2181 33.7641 30.1819 33.8895C30.1457 34.0147 30.1277 34.1692 30.1277 34.3531V35.0546C30.1277 35.2382 30.1457 35.3927 30.1819 35.5181C30.2181 35.6433 30.2666 35.7436 30.328 35.8187C30.3891 35.8939 30.4613 35.9468 30.5448 35.9774C30.6283 36.008 30.7172 36.0233 30.8118 36.0233C31.0508 36.0233 31.2413 36.0178 31.3832 36.0067C31.5251 35.9956 31.6737 35.9815 31.8294 35.9649H31.8462C31.8906 35.9649 31.9281 35.9774 31.9588 36.0025C31.9893 36.0276 32.0047 36.0623 32.0047 36.1071ZM36.6346 34.4115C36.6346 34.0773 36.5885 33.7768 36.4966 33.5095C36.4046 33.2423 36.2709 33.0155 36.0954 32.8289C35.9199 32.6424 35.7025 32.4976 35.4436 32.3946C35.1844 32.2918 34.8848 32.2401 34.5449 32.2401C34.2051 32.2401 33.9056 32.2918 33.6465 32.3946C33.3873 32.4976 33.1685 32.6424 32.9903 32.8289C32.8119 33.0155 32.6768 33.2423 32.585 33.5095C32.4928 33.7768 32.4469 34.0773 32.4469 34.4115V34.9961C32.4469 35.3301 32.4928 35.6309 32.585 35.8981C32.6768 36.1653 32.8119 36.3922 32.9903 36.5788C33.1685 36.7654 33.3873 36.91 33.6465 37.013C33.9056 37.1159 34.2051 37.1676 34.5449 37.1676C34.8848 37.1676 35.1844 37.1159 35.4436 37.013C35.7025 36.91 35.9199 36.7654 36.0954 36.5788C36.2709 36.3922 36.4046 36.1653 36.4966 35.8981C36.5885 35.6309 36.6346 35.3301 36.6346 34.9961V34.4115ZM34.5449 36.0233C35.037 36.0233 35.2832 35.6809 35.2832 34.9961V34.4115C35.2832 33.7322 35.037 33.3925 34.5449 33.3925C34.3016 33.3925 34.1164 33.4774 33.9893 33.6472C33.8619 33.8172 33.7984 34.0719 33.7984 34.4115V34.9961C33.7984 35.3357 33.8619 35.5918 33.9893 35.7644C34.1164 35.9371 34.3016 36.0233 34.5449 36.0233ZM41.5976 36.917V34.1358C41.5976 33.8744 41.5765 33.6278 41.5351 33.3968C41.4933 33.166 41.4181 32.9653 41.3095 32.7954C41.2011 32.6256 41.0511 32.4905 40.8593 32.3904C40.6674 32.2902 40.4213 32.2401 40.1211 32.2401C39.8542 32.2401 39.6177 32.2723 39.4119 32.3369C39.2062 32.4014 38.9893 32.515 38.7613 32.6776V32.4752C38.7613 32.4305 38.7447 32.3911 38.7111 32.3575C38.678 32.3238 38.6389 32.3068 38.5945 32.3068H37.6602C37.6157 32.3068 37.5769 32.3235 37.5434 32.357C37.5102 32.3904 37.4934 32.4295 37.4934 32.4739V36.917C37.4934 36.9615 37.5114 37.0019 37.5476 37.038C37.5838 37.0743 37.624 37.0923 37.6687 37.0923H38.678C38.7224 37.0923 38.7613 37.0743 38.7948 37.0382C38.828 37.0021 38.8448 36.9619 38.8448 36.9173V33.6341C38.9893 33.5564 39.1256 33.4925 39.2534 33.4426C39.3815 33.3925 39.5065 33.3675 39.629 33.3675C39.7568 33.3675 39.8611 33.38 39.9416 33.4051C40.0222 33.4301 40.0849 33.4731 40.1294 33.5345C40.1739 33.5954 40.2044 33.6759 40.2212 33.7757C40.2378 33.8758 40.2462 33.9981 40.2462 34.1425V36.9173C40.2462 36.9619 40.2628 37.0021 40.2962 37.0382C40.3296 37.0743 40.3684 37.0923 40.413 37.0923H41.4223C41.4668 37.0923 41.5072 37.0743 41.5434 37.038C41.5794 37.0019 41.5976 36.9615 41.5976 36.917ZM45.2348 36.2893V36.9357C45.2348 37.0295 45.182 37.0848 45.0763 37.1011C44.9483 37.1233 44.8371 37.1398 44.7427 37.1509C44.6481 37.162 44.5395 37.1675 44.4174 37.1675C44.1905 37.1675 43.9901 37.1493 43.816 37.1133C43.6419 37.077 43.4966 37.0061 43.3805 36.9003C43.2646 36.7945 43.1761 36.6483 43.1153 36.4617C43.0547 36.2753 43.0242 36.0347 43.0242 35.7394V33.3175L42.357 33.2088C42.3123 33.1977 42.2721 33.1769 42.2359 33.1462C42.1997 33.1157 42.1817 33.0781 42.1817 33.0335V32.4822C42.1817 32.4378 42.1997 32.3974 42.2359 32.3611C42.2721 32.325 42.3123 32.3068 42.357 32.3068H43.0242V31.622C43.0242 31.5774 43.0409 31.5414 43.0739 31.5134C43.1068 31.4857 43.1458 31.4663 43.1902 31.455L44.2016 31.2798H44.2263C44.2705 31.2798 44.3065 31.2921 44.3343 31.3171C44.3618 31.3423 44.3757 31.3771 44.3757 31.4215V32.3068H45.0597C45.104 32.3068 45.143 32.3237 45.1764 32.3573C45.2099 32.3909 45.2265 32.4305 45.2265 32.4752V33.1573C45.2265 33.2024 45.2099 33.2416 45.1764 33.2752C45.143 33.3089 45.104 33.3257 45.0597 33.3257H44.3757V35.7561C44.3757 35.9231 44.3895 36.0304 44.4174 36.0776C44.4451 36.1249 44.5229 36.1485 44.6507 36.1485H45.0597C45.1764 36.1485 45.2348 36.1955 45.2348 36.2893ZM49.6891 33.9438C49.6891 33.6377 49.6433 33.3772 49.5514 33.1629C49.4597 32.9487 49.3305 32.7732 49.1637 32.6367C48.9969 32.5004 48.7925 32.4003 48.5505 32.3362C48.3087 32.2722 48.0376 32.2401 47.7373 32.2401C47.4589 32.2401 47.188 32.2597 46.924 32.2987C46.6597 32.3375 46.4497 32.3766 46.2942 32.4154C46.1882 32.4435 46.1357 32.5046 46.1357 32.5991V33.2756C46.1357 33.3314 46.1494 33.3705 46.1773 33.3925C46.2052 33.4149 46.2412 33.4261 46.2857 33.4261H46.3274C46.3943 33.4204 46.4776 33.4135 46.5777 33.4051C46.6779 33.3968 46.7905 33.3901 46.9155 33.3842C47.0408 33.3788 47.1714 33.3746 47.3077 33.3717C47.4438 33.3689 47.5788 33.3675 47.7121 33.3675C47.9068 33.3675 48.0598 33.4038 48.171 33.4761C48.2822 33.5486 48.3378 33.7045 48.3378 33.9438V34.2445H47.8874C47.1698 34.2445 46.6486 34.3572 46.3233 34.5827C45.998 34.8081 45.8353 35.1659 45.8353 35.6558V35.7313C45.8353 36.0039 45.8755 36.2321 45.9562 36.4158C46.0366 36.5996 46.144 36.7472 46.2774 36.8587C46.4109 36.9699 46.5623 37.0493 46.7321 37.0964C46.9017 37.1438 47.0782 37.1676 47.2618 37.1676C47.5121 37.1676 47.7274 37.1341 47.9082 37.0673C48.0889 37.0005 48.2597 36.9086 48.4213 36.7917V36.9253C48.4213 36.9699 48.4379 37.0089 48.4713 37.0422C48.5046 37.0756 48.5436 37.0923 48.5881 37.0923H49.5224C49.5668 37.0923 49.6057 37.0756 49.6392 37.0422C49.6724 37.0089 49.6891 36.9699 49.6891 36.9253V33.9438ZM48.0418 36.0942C48.1556 36.0581 48.2628 36.015 48.3629 35.9648V35.0462H47.8874C47.7428 35.0462 47.6233 35.0587 47.5287 35.0837C47.4341 35.1088 47.359 35.1465 47.3035 35.1966C47.2477 35.2465 47.2088 35.3107 47.1868 35.3886C47.1644 35.4666 47.1533 35.5556 47.1533 35.6558V35.7312C47.1533 35.9092 47.1963 36.0233 47.2826 36.0734C47.3688 36.1235 47.5008 36.1485 47.6789 36.1485C47.8067 36.1485 47.9274 36.1306 48.0418 36.0942ZM53.7933 36.8502V36.1071C53.7933 36.0623 53.7779 36.0276 53.7474 36.0025C53.7167 35.9774 53.6793 35.9649 53.6348 35.9649H53.6181C53.4624 35.9815 53.3136 35.9956 53.1718 36.0067C53.0301 36.0178 52.8395 36.0233 52.6005 36.0233C52.5057 36.0233 52.4167 36.008 52.3336 35.9774C52.2501 35.9468 52.1777 35.8939 52.1165 35.8187C52.0554 35.7436 52.0067 35.6433 51.9707 35.5181C51.9343 35.3927 51.9165 35.2382 51.9165 35.0546V34.3531C51.9165 34.1692 51.9343 34.0147 51.9707 33.8895C52.0067 33.7641 52.0554 33.6641 52.1165 33.5888C52.1777 33.5137 52.2501 33.4608 52.3336 33.4301C52.4167 33.3996 52.5057 33.3842 52.6005 33.3842C52.8395 33.3842 53.0301 33.3901 53.1718 33.401C53.3136 33.4121 53.4624 33.4261 53.6181 33.4426H53.6348C53.6793 33.4426 53.7167 33.4301 53.7474 33.4051C53.7779 33.38 53.7933 33.3453 53.7933 33.3007V32.5574C53.7933 32.4962 53.7794 32.453 53.7515 32.4279C53.7235 32.4029 53.6793 32.3819 53.6181 32.3653C53.5014 32.3375 53.3497 32.3098 53.1635 32.2817C52.9771 32.254 52.759 32.2401 52.5087 32.2401C51.9189 32.2401 51.4479 32.421 51.0947 32.7831C50.7415 33.1448 50.565 33.6682 50.565 34.3531V35.0546C50.565 35.7394 50.7415 36.2628 51.0947 36.6246C51.4479 36.9867 51.9189 37.1676 52.5087 37.1676C52.759 37.1676 52.9771 37.1535 53.1635 37.1259C53.3497 37.0978 53.5014 37.0701 53.6181 37.0422C53.6793 37.0255 53.7235 37.0047 53.7515 36.9796C53.7794 36.9546 53.7933 36.9114 53.7933 36.8502ZM57.3884 36.2893V36.9357C57.3884 37.0295 57.3354 37.0848 57.2299 37.1011C57.1019 37.1233 56.9907 37.1398 56.8963 37.1509C56.8016 37.162 56.6931 37.1675 56.571 37.1675C56.3441 37.1675 56.1437 37.1493 55.9696 37.1133C55.7954 37.077 55.6502 37.0061 55.5343 36.9003C55.4183 36.7945 55.3298 36.6483 55.269 36.4617C55.2083 36.2753 55.1778 36.0347 55.1778 35.7394V33.3175L54.5106 33.2088C54.4659 33.1977 54.4257 33.1769 54.3895 33.1462C54.3533 33.1157 54.3353 33.0781 54.3353 33.0335V32.4822C54.3353 32.4378 54.3533 32.3974 54.3895 32.3611C54.4257 32.325 54.4659 32.3068 54.5106 32.3068H55.1778V31.622C55.1778 31.5774 55.1945 31.5414 55.2276 31.5134C55.2605 31.4857 55.2993 31.4663 55.3436 31.455L56.355 31.2798H56.38C56.4241 31.2798 56.4602 31.2921 56.4875 31.3171C56.5154 31.3423 56.5293 31.3771 56.5293 31.4215V32.3068H57.2133C57.2577 32.3068 57.2966 32.3237 57.3301 32.3573C57.3633 32.3909 57.3801 32.4305 57.3801 32.4752V33.1573C57.3801 33.2024 57.3633 33.2416 57.3301 33.2752C57.2966 33.3089 57.2577 33.3257 57.2133 33.3257H56.5293V35.7561C56.5293 35.9231 56.5431 36.0304 56.571 36.0776C56.5987 36.1249 56.6765 36.1485 56.8045 36.1485H57.2133C57.3301 36.1485 57.3884 36.1955 57.3884 36.2893Z", fill: "#005697" }), jsx("path", { d: "M52.6187 14.7398H39.0664L37.6881 16.2935L33.2155 21.3349V21.3351L31.8372 22.8886H18.464L19.821 21.3153L20.4633 20.5706L21.8202 18.9973H15.6582C14.5325 18.9973 13.6113 19.943 13.6113 21.0987V25.5326C13.6113 26.6885 14.5325 27.6342 15.6582 27.6342H39.2492C40.3749 27.6342 41.9127 26.9318 42.6665 26.0733L46.235 22.0097L52.6187 14.7398Z", fill: "#005697" }), jsx("path", { d: "M55.3418 10C56.4676 10 57.3887 10.9457 57.3887 12.1015V16.5353C57.3887 17.691 56.4676 18.6368 55.3418 18.6368H49.1999L50.5697 17.0753H50.5699L51.2491 16.3012L52.6189 14.7398H39.0667L31.8375 22.8945H18.3813L28.0314 11.9701L28.3966 11.5566C29.153 10.7005 30.6929 10 31.8186 10H55.3418V10Z", fill: "#FBD500" })] }));
19084
18484
  };
19085
18485
 
19086
18486
  const Cashapp$1 = ({ className }) => {
19087
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsxs("g", { "clip-path": "url(#clip0_550_235)", children: [jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M26.4382 8C22.3647 8 19.0625 11.3022 19.0625 15.3758V32.6242C19.0625 36.6978 22.3647 40 26.4382 40H43.5153C47.5889 40 50.8911 36.6978 50.8911 32.6242V15.3758C50.8911 11.3022 47.5889 8 43.5153 8H26.4382Z", fill: "#00D632" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M40.1482 19.902C38.9333 18.8737 37.3938 18.3084 35.8022 18.3059C34.4908 18.3059 33.1795 18.7405 33.1795 19.9469C33.1795 21.0467 34.347 21.4771 35.7853 22.0072C35.9248 22.0586 36.0668 22.111 36.2105 22.1649C39.0542 23.1241 41.3959 24.3005 41.3959 27.088C41.3959 30.1153 39.0467 32.1835 35.2026 32.4195L34.8542 34.0418C34.7887 34.3448 34.5199 34.5605 34.2098 34.5589H31.7932C31.5955 34.554 31.4102 34.4618 31.2872 34.307C31.1642 34.1521 31.1163 33.9507 31.1563 33.7571L31.531 32.0448C30.08 31.6748 28.7461 30.9441 27.6532 29.9205C27.5265 29.7983 27.4551 29.63 27.4551 29.454C27.4551 29.2781 27.5265 29.1097 27.6532 28.9876L28.9945 27.6763C29.2482 27.4268 29.655 27.4268 29.9086 27.6763C31.1374 28.8485 32.7778 29.4904 34.4758 29.4634C36.2255 29.4634 37.4132 28.7215 37.4132 27.5451C37.4132 26.4815 36.4394 26.1253 34.5914 25.4494C34.3953 25.3776 34.1894 25.3024 33.9738 25.2222C31.5984 24.3755 29.3504 23.1653 29.3504 20.3516C29.3504 17.0958 32.0705 15.5072 35.2776 15.3498L35.6148 13.6975C35.6816 13.3974 35.948 13.1839 36.2555 13.1842H38.6646C38.8609 13.1836 39.0469 13.2714 39.1712 13.4233C39.2955 13.5752 39.3447 13.775 39.3052 13.9673L38.9306 15.8144C40.157 16.2153 41.2935 16.8516 42.2764 17.6877C42.4118 17.8042 42.4925 17.972 42.4989 18.1505C42.5053 18.3291 42.4368 18.5022 42.31 18.6281L41.0587 19.8833C40.8081 20.1298 40.4087 20.138 40.1482 19.902Z", fill: "white" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_550_235", children: jsx("rect", { width: "32", height: "32", fill: "white", transform: "translate(19 8)" }) }) })] }));
18487
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsxs("g", { "clip-path": "url(#clip0_550_235)", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M26.4382 8C22.3647 8 19.0625 11.3022 19.0625 15.3758V32.6242C19.0625 36.6978 22.3647 40 26.4382 40H43.5153C47.5889 40 50.8911 36.6978 50.8911 32.6242V15.3758C50.8911 11.3022 47.5889 8 43.5153 8H26.4382Z", fill: "#00D632" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M40.1482 19.902C38.9333 18.8737 37.3938 18.3084 35.8022 18.3059C34.4908 18.3059 33.1795 18.7405 33.1795 19.9469C33.1795 21.0467 34.347 21.4771 35.7853 22.0072C35.9248 22.0586 36.0668 22.111 36.2105 22.1649C39.0542 23.1241 41.3959 24.3005 41.3959 27.088C41.3959 30.1153 39.0467 32.1835 35.2026 32.4195L34.8542 34.0418C34.7887 34.3448 34.5199 34.5605 34.2098 34.5589H31.7932C31.5955 34.554 31.4102 34.4618 31.2872 34.307C31.1642 34.1521 31.1163 33.9507 31.1563 33.7571L31.531 32.0448C30.08 31.6748 28.7461 30.9441 27.6532 29.9205C27.5265 29.7983 27.4551 29.63 27.4551 29.454C27.4551 29.2781 27.5265 29.1097 27.6532 28.9876L28.9945 27.6763C29.2482 27.4268 29.655 27.4268 29.9086 27.6763C31.1374 28.8485 32.7778 29.4904 34.4758 29.4634C36.2255 29.4634 37.4132 28.7215 37.4132 27.5451C37.4132 26.4815 36.4394 26.1253 34.5914 25.4494C34.3953 25.3776 34.1894 25.3024 33.9738 25.2222C31.5984 24.3755 29.3504 23.1653 29.3504 20.3516C29.3504 17.0958 32.0705 15.5072 35.2776 15.3498L35.6148 13.6975C35.6816 13.3974 35.948 13.1839 36.2555 13.1842H38.6646C38.8609 13.1836 39.0469 13.2714 39.1712 13.4233C39.2955 13.5752 39.3447 13.775 39.3052 13.9673L38.9306 15.8144C40.157 16.2153 41.2935 16.8516 42.2764 17.6877C42.4118 17.8042 42.4925 17.972 42.4989 18.1505C42.5053 18.3291 42.4368 18.5022 42.31 18.6281L41.0587 19.8833C40.8081 20.1298 40.4087 20.138 40.1482 19.902Z", fill: "white" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_550_235", children: jsx("rect", { width: "32", height: "32", fill: "white", transform: "translate(19 8)" }) }) })] }));
19088
18488
  };
19089
18489
 
19090
18490
  const ChinaUnionPay = ({ className }) => {
19091
- return (jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsx("path", { d: "M18.2466 6.855H27.4811C28.7703 6.855 29.5728 7.90603 29.272 9.20036L24.972 27.6585C24.6682 28.949 23.3782 30 22.0886 30H12.8537C11.5641 30 10.7624 28.949 11.0632 27.6585L15.3654 9.20036C15.6653 7.90603 16.9545 6.855 18.2466 6.855Z", fill: "#ED171F" }), jsx("path", { d: "M26.7132 6.855H37.3336C38.6223 6.855 38.0411 7.90603 37.7381 9.20036L33.4385 27.6585C33.1382 28.949 33.2324 30 31.9402 30H21.3206C20.0298 30 19.2303 28.949 19.5336 27.6585L23.8315 9.20036C24.1353 7.90603 25.424 6.855 26.7132 6.855Z", fill: "#082F67" }), jsx("path", { d: "M36.9136 6.855H46.1468C47.4368 6.855 48.2384 7.90603 47.9364 9.20036L43.6372 27.6585C43.3351 28.949 42.0455 30 40.7516 30H31.521C30.2288 30 29.4285 28.949 29.7314 27.6585L34.0293 9.20036C34.3318 7.90603 35.621 6.855 36.9136 6.855Z", fill: "#006A65" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M38.4247 20.4849L37.2994 24.2089H37.6019L37.3681 24.979H37.0656L36.9951 25.218H35.9242L35.9968 24.979H33.82L34.0387 24.2664H34.2587L35.4005 20.4849L35.6286 19.7209H36.7212L36.6071 20.1072C36.6071 20.1072 36.8979 19.8972 37.1741 19.8254C37.4502 19.7528 39.0337 19.7265 39.0337 19.7265L38.799 20.4849H38.4247ZM36.4995 20.4849L36.2103 21.4365C36.2103 21.4365 36.5336 21.2909 36.7112 21.2421C36.8901 21.1958 37.1589 21.1777 37.1589 21.1777L37.3681 20.4849H36.4995ZM36.0669 21.9098L35.7678 22.8994C35.7678 22.8994 36.0984 22.73 36.276 22.6773C36.4549 22.6358 36.7255 22.6021 36.7255 22.6021L36.9377 21.9098H36.0669ZM35.3702 24.2197H36.241L36.4925 23.383H35.6217L35.3702 24.2197Z", fill: "white" }), jsx("path", { d: "M38.9076 19.7265H40.0736L40.0866 20.1613C40.0797 20.2343 40.1427 20.2689 40.2776 20.2689H40.5144L40.2979 20.9863H39.6687C39.1224 21.0265 38.9163 20.7918 38.9284 20.5286L38.9076 19.7265Z", fill: "white" }), jsx("path", { d: "M39.0602 23.1305H37.9487L38.1397 22.4909H39.4099L39.5918 21.9079H38.3368L38.5525 21.1875H42.0439L41.8252 21.9079H40.6545L40.4713 22.4909H41.6446L41.4514 23.1305H40.1808L39.9561 23.3998H40.4713L40.5962 24.2049C40.6096 24.284 40.6121 24.3363 40.6372 24.3708C40.6631 24.4006 40.8174 24.4145 40.9069 24.4145H41.0633L40.8256 25.198H40.4293C40.368 25.198 40.2772 25.1928 40.1532 25.1863C40.033 25.1759 39.9479 25.1064 39.8684 25.0683C39.7958 25.032 39.6869 24.9439 39.6618 24.7939L39.5374 23.9905L38.9608 24.7831C38.7772 25.032 38.5291 25.2226 38.1108 25.2226H37.3009L37.5131 24.5238H37.8221C37.9116 24.5238 37.9906 24.4888 38.0485 24.4586C38.1082 24.4335 38.1605 24.4037 38.2201 24.3155L39.0602 23.1305Z", fill: "white" }), jsx("path", { d: "M26.8864 21.3815H29.8294L29.612 22.0842H28.4348L28.252 22.6818H29.456L29.2365 23.4075H28.0333L27.7416 24.3811C27.7057 24.4892 28.026 24.5043 28.1418 24.5043L28.7451 24.4209L28.5035 25.223H27.1457C27.0389 25.223 26.9555 25.2079 26.8371 25.1811C26.7226 25.1525 26.672 25.1015 26.6214 25.0237C26.5722 24.9438 26.497 24.879 26.548 24.7096L26.9374 23.42H26.2692L26.4909 22.6818H27.1629L27.3414 22.0842H26.672L26.8864 21.3815Z", fill: "white" }), jsx("path", { d: "M28.8682 20.1195H30.0752L29.8544 20.8541H28.2052L28.0259 21.0084C27.9498 21.0832 27.923 21.0516 27.8232 21.1057C27.7303 21.1532 27.5337 21.2461 27.28 21.2461H26.7506L26.9658 20.5395H27.1244C27.2588 20.5395 27.35 20.5283 27.3962 20.4985C27.449 20.4656 27.5073 20.3909 27.5751 20.269L27.8777 19.718H29.0786L28.8682 20.1195Z", fill: "white" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M30.5938 19.7264H31.6223L31.4728 20.2437C31.4728 20.2437 31.7969 19.9848 32.0247 19.8923C32.2511 19.8072 32.7641 19.7311 32.7641 19.7311L34.428 19.7225L33.861 21.6106C33.7659 21.9347 33.6548 22.1439 33.5852 22.239C33.5217 22.3366 33.4482 22.4183 33.3026 22.4974C33.1626 22.5722 33.0351 22.6154 32.9175 22.6275C32.8073 22.6357 32.6388 22.64 32.4046 22.6422H30.8025L30.3501 24.1366C30.3073 24.284 30.2865 24.354 30.3146 24.3937C30.3384 24.43 30.3928 24.4702 30.468 24.4702L31.1746 24.4037L30.9339 25.2226H30.1413C29.8898 25.2226 29.7066 25.2174 29.5778 25.2075C29.4559 25.198 29.3284 25.2075 29.2441 25.1414C29.1694 25.0766 29.0574 24.9918 29.06 24.9041C29.0683 24.8229 29.1011 24.688 29.1534 24.5039L30.5938 19.7264ZM32.7775 21.6344H31.0912L30.9884 21.9749H32.4473C32.6198 21.9533 32.6552 21.9779 32.669 21.9697L32.7775 21.6344ZM31.185 21.3271C31.185 21.3271 31.5139 21.0263 32.0778 20.9286C32.2062 20.9036 33.0083 20.9118 33.0083 20.9118L33.1297 20.5081H31.4305L31.185 21.3271Z", fill: "white" }), jsx("path", { d: "M33.5921 22.7747L33.4979 23.2285C33.4559 23.3693 33.4209 23.4778 33.3138 23.5686C33.2027 23.6632 33.0696 23.763 32.7606 23.763L32.191 23.7859L32.1862 24.2998C32.1785 24.4459 32.2178 24.4303 32.2411 24.4541C32.2675 24.4787 32.2904 24.4904 32.3168 24.4986L32.4961 24.4904L33.0415 24.4584L32.8168 25.2078H32.191C31.7524 25.2078 31.4274 25.1983 31.3202 25.1127C31.2156 25.0466 31.2018 24.9619 31.2048 24.8188L31.2441 22.8201H32.242L32.2295 23.2285H32.4702C32.5523 23.2285 32.6063 23.2198 32.6417 23.1986C32.6707 23.1749 32.6936 23.1437 32.7096 23.0932L32.8068 22.7747H33.5921Z", fill: "white" }), jsx("path", { d: "M19.3395 12.7519C19.3032 12.9127 18.6632 15.8704 18.6606 15.8722C18.5219 16.4698 18.4238 16.8985 18.0824 17.1721C17.8887 17.3311 17.6623 17.4094 17.4008 17.4094C16.9808 17.4094 16.734 17.2006 16.6921 16.8035L16.6843 16.6678C16.6843 16.6678 16.8122 15.8652 16.814 15.8622C16.814 15.8622 17.486 13.1664 17.6065 12.8116C17.6117 12.7917 17.6143 12.7817 17.6169 12.7714C16.3075 12.783 16.0745 12.7714 16.0594 12.7519C16.052 12.7783 16.017 12.946 16.017 12.946L15.3299 15.9815L15.2703 16.2408L15.1579 17.0826C15.1579 17.3311 15.2072 17.536 15.3044 17.7084C15.6177 18.2564 16.511 18.3377 17.0149 18.3377C17.6662 18.3377 18.2751 18.1985 18.6874 17.9478C19.4026 17.5243 19.591 16.8614 19.7583 16.2754L19.8352 15.975C19.8352 15.975 20.5288 13.1759 20.6473 12.8116C20.6507 12.7917 20.6529 12.7817 20.6576 12.7714C19.709 12.7817 19.4298 12.7714 19.3395 12.7519Z", fill: "white" }), jsx("path", { d: "M23.1723 18.3077C22.7073 18.3012 22.5444 18.3012 22.0011 18.3289L21.98 18.2887C22.0279 18.0821 22.0794 17.8785 22.1252 17.6689L22.1917 17.3867C22.2924 16.9464 22.3909 16.4347 22.4026 16.2804C22.4121 16.1862 22.4432 15.952 22.1757 15.952C22.0625 15.952 21.9449 16.0073 21.8265 16.0613C21.7608 16.2955 21.6282 16.9515 21.5672 17.2519C21.432 17.8829 21.4233 17.9542 21.3633 18.2666L21.3244 18.3077C20.8451 18.3012 20.6796 18.3012 20.1286 18.3289L20.1026 18.283C20.1951 17.9079 20.2867 17.5298 20.3749 17.1555C20.6057 16.1395 20.6601 15.7501 20.7245 15.2337L20.7677 15.203C21.3049 15.1278 21.435 15.1131 22.0163 14.9934L22.0655 15.0483L21.9778 15.372C22.0759 15.3141 22.1688 15.2549 22.2704 15.203C22.5444 15.0682 22.8495 15.0284 23.0176 15.0284C23.2713 15.0284 23.5496 15.0997 23.6663 15.394C23.7769 15.6564 23.7039 15.9805 23.5586 16.6175L23.4835 16.9412C23.3344 17.6504 23.3102 17.78 23.2267 18.2666L23.1723 18.3077Z", fill: "white" }), jsx("path", { d: "M25.0585 18.3077C24.7793 18.3064 24.5995 18.3012 24.4232 18.3064C24.2486 18.3077 24.0779 18.3168 23.8182 18.3289L23.8026 18.3064L23.7853 18.283C23.8562 18.0142 23.8964 17.92 23.9309 17.8245C23.9664 17.7299 24.001 17.6339 24.0623 17.3612C24.1436 17.006 24.1937 16.7571 24.2296 16.5397C24.2667 16.3284 24.2879 16.1495 24.3143 15.9416L24.3359 15.9252L24.3592 15.9053C24.6371 15.866 24.8147 15.84 24.9945 15.8124C25.1769 15.786 25.3605 15.7501 25.6488 15.6957L25.66 15.7207L25.6678 15.7462C25.6142 15.9662 25.5598 16.1862 25.5075 16.41C25.4561 16.6326 25.4016 16.8513 25.3532 17.073C25.2478 17.541 25.2067 17.7148 25.1816 17.8396C25.1587 17.9589 25.1509 18.0237 25.1095 18.2666L25.0844 18.2887L25.0585 18.3077Z", fill: "white" }), jsx("path", { d: "M29.2305 16.7091C29.3935 15.9948 29.2686 15.6607 29.1091 15.4563C28.8658 15.1477 28.4397 15.0479 27.9958 15.0479C27.7301 15.0479 27.0952 15.0751 26.5987 15.5332C26.2443 15.8621 26.0779 16.3107 25.9781 16.7389C25.8782 17.175 25.7628 17.9641 26.4867 18.2567C26.7114 18.3509 27.0313 18.3777 27.2396 18.3777C27.7698 18.3777 28.3135 18.2312 28.7206 17.7982C29.0382 17.446 29.1813 16.923 29.2305 16.7091ZM28.0166 16.6573C27.9911 16.777 27.8865 17.2256 27.7426 17.4161C27.6432 17.5562 27.5252 17.6404 27.3947 17.6404C27.358 17.6404 27.1285 17.6404 27.1242 17.2999C27.1216 17.1322 27.1566 16.9576 27.1985 16.7718C27.3208 16.2307 27.4651 15.7769 27.8329 15.7769C28.1225 15.7769 28.1415 16.1145 28.0166 16.6573Z", fill: "white" }), jsx("path", { d: "M40.5855 18.3561C40.0254 18.3509 39.8642 18.3509 39.3465 18.373L39.3115 18.331C39.4532 17.7982 39.595 17.267 39.7199 16.7286C39.8819 16.0298 39.9191 15.7329 39.9736 15.324L40.0155 15.2895C40.5713 15.2095 40.726 15.1875 41.3059 15.0803L41.3241 15.1278C41.2178 15.566 41.1115 16.0047 41.0103 16.4446C40.7964 17.3664 40.7186 17.8349 40.6365 18.3163L40.5855 18.3561Z", fill: "white" }), jsx("path", { d: "M40.8523 16.7721C41.0152 16.0612 40.3601 16.7094 40.2551 16.4748C40.0943 16.1092 40.195 15.3671 39.5493 15.1195C39.3017 15.0231 38.7183 15.148 38.2204 15.6031C37.8682 15.9307 37.7005 16.3736 37.6016 16.8015C37.5013 17.2315 37.3864 18.0189 38.1063 18.3015C38.3337 18.3979 38.5424 18.4256 38.7498 18.4173C39.4741 18.378 40.0265 17.2855 40.434 16.852C40.749 16.5098 40.8043 16.9808 40.8523 16.7721ZM39.7442 16.7189C39.717 16.833 39.612 17.2868 39.4681 17.4744C39.373 17.6088 39.1466 17.6939 39.0169 17.6939C38.9802 17.6939 38.7524 17.6939 38.7442 17.3564C38.7425 17.1904 38.7775 17.0158 38.8207 16.8283C38.943 16.2989 39.0874 15.8468 39.4551 15.8468C39.7451 15.8468 39.8687 16.1761 39.7442 16.7189Z", fill: "white" }), jsx("path", { d: "M32.4031 18.3077C31.9372 18.3012 31.7795 18.3012 31.2319 18.3289L31.2125 18.2887C31.2587 18.0821 31.3114 17.8785 31.3598 17.6689L31.4251 17.3867C31.5262 16.9464 31.6243 16.4347 31.6355 16.2804C31.6446 16.1862 31.6757 15.952 31.4104 15.952C31.2954 15.952 31.1792 16.0073 31.0599 16.0613C30.9951 16.2955 30.862 16.9515 30.798 17.2519C30.6653 17.8829 30.6563 17.9542 30.5962 18.2666L30.5564 18.3077C30.0776 18.3012 29.9134 18.3012 29.3637 18.3289L29.3386 18.283C29.4302 17.9079 29.5201 17.5298 29.6083 17.1555C29.8386 16.1395 29.8935 15.7501 29.9575 15.2337L30.0007 15.203C30.5378 15.1278 30.6684 15.1131 31.2496 14.9934L31.2954 15.0483L31.2112 15.372C31.3067 15.3141 31.4039 15.2549 31.5029 15.203C31.7751 15.0682 32.0828 15.0284 32.2475 15.0284C32.502 15.0284 32.7808 15.0997 32.9005 15.394C33.0098 15.6564 32.9359 15.9805 32.7894 16.6175L32.7164 16.9412C32.5643 17.6504 32.5409 17.78 32.4605 18.2666L32.4031 18.3077Z", fill: "white" }), jsx("path", { d: "M36.9307 14.4822C36.8486 14.8504 36.6096 15.1629 36.3006 15.3137C36.0452 15.4421 35.7344 15.4516 35.4129 15.4516H35.2059L35.2215 15.369C35.2215 15.369 35.6048 13.7048 35.6031 13.71L35.6143 13.6248L35.6212 13.5591L35.7742 13.5751C35.7742 13.5751 36.5616 13.6434 36.5815 13.6456C36.8931 13.764 37.0201 14.0769 36.9307 14.4822ZM36.4276 12.7467C36.4255 12.7467 36.0417 12.7518 36.0417 12.7518C35.0378 12.7631 34.6354 12.7583 34.4703 12.7385C34.4531 12.8119 34.428 12.9424 34.428 12.9424L34.0693 14.6115C34.0693 14.6115 33.2097 18.1565 33.1687 18.3229C34.0447 18.3134 34.4042 18.3134 34.5542 18.3285C34.5883 18.1621 34.7932 17.172 34.7932 17.172C34.7932 17.172 34.9682 16.4447 34.9786 16.4179C34.9786 16.4179 35.0326 16.3436 35.0883 16.3137H35.1683C35.9233 16.3137 36.7781 16.3137 37.4462 15.8206C37.9004 15.4831 38.2138 14.9848 38.3516 14.3802C38.3888 14.2316 38.4147 14.0535 38.4147 13.8772C38.4147 13.6456 38.368 13.4161 38.2323 13.2363C37.8918 12.7583 37.2142 12.7518 36.4276 12.7467Z", fill: "white" }), jsx("path", { d: "M45.1748 15.0751L45.1303 15.0254C44.5581 15.1399 44.4535 15.1598 43.9263 15.2293L43.8865 15.2674C43.8848 15.2739 43.8831 15.2842 43.8818 15.2924L43.8792 15.2842C43.4868 16.1913 43.4993 15.9951 43.1791 16.7073C43.1769 16.6736 43.1765 16.6525 43.1756 16.6187L43.0961 15.0751L43.0455 15.0254C42.4466 15.1399 42.4306 15.1598 41.8761 15.2293L41.8316 15.2674C41.8277 15.2877 41.8264 15.3076 41.8234 15.3292L41.8277 15.3374C41.8968 15.6931 41.8809 15.6131 41.9496 16.171C41.982 16.445 42.0243 16.7225 42.0567 16.9926C42.1121 17.4463 42.1423 17.6706 42.208 18.3612C41.835 18.981 41.7447 19.2148 41.3882 19.7584L41.4072 19.8077C41.9496 19.7874 42.0745 19.7874 42.4755 19.7874L42.5641 19.6884C42.8671 19.0354 45.1748 15.0751 45.1748 15.0751Z", fill: "white" }), jsx("path", { d: "M25.5693 15.4586C25.8753 15.2447 25.9146 14.9491 25.6553 14.7957C25.3926 14.6414 24.9353 14.6898 24.6259 14.9042C24.3143 15.1151 24.2802 15.4115 24.5399 15.5662C24.8001 15.7171 25.2595 15.673 25.5693 15.4586Z", fill: "white" }), jsx("path", { d: "M42.5238 19.7429L42.0727 20.5152C41.93 20.7788 41.6651 20.9771 41.2442 20.9784L40.5255 20.9668L40.7347 20.2706H40.8738C40.9477 20.2706 41.0018 20.2658 41.0432 20.2455C41.0787 20.2343 41.105 20.2062 41.1344 20.1647L41.3993 19.7429H42.5238Z", fill: "white" })] }));
18491
+ return (jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsx("path", { d: "M18.2466 6.855H27.4811C28.7703 6.855 29.5728 7.90603 29.272 9.20036L24.972 27.6585C24.6682 28.949 23.3782 30 22.0886 30H12.8537C11.5641 30 10.7624 28.949 11.0632 27.6585L15.3654 9.20036C15.6653 7.90603 16.9545 6.855 18.2466 6.855Z", fill: "#ED171F" }), jsx("path", { d: "M26.7132 6.855H37.3336C38.6223 6.855 38.0411 7.90603 37.7381 9.20036L33.4385 27.6585C33.1382 28.949 33.2324 30 31.9402 30H21.3206C20.0298 30 19.2303 28.949 19.5336 27.6585L23.8315 9.20036C24.1353 7.90603 25.424 6.855 26.7132 6.855Z", fill: "#082F67" }), jsx("path", { d: "M36.9136 6.855H46.1468C47.4368 6.855 48.2384 7.90603 47.9364 9.20036L43.6372 27.6585C43.3351 28.949 42.0455 30 40.7516 30H31.521C30.2288 30 29.4285 28.949 29.7314 27.6585L34.0293 9.20036C34.3318 7.90603 35.621 6.855 36.9136 6.855Z", fill: "#006A65" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M38.4247 20.4849L37.2994 24.2089H37.6019L37.3681 24.979H37.0656L36.9951 25.218H35.9242L35.9968 24.979H33.82L34.0387 24.2664H34.2587L35.4005 20.4849L35.6286 19.7209H36.7212L36.6071 20.1072C36.6071 20.1072 36.8979 19.8972 37.1741 19.8254C37.4502 19.7528 39.0337 19.7265 39.0337 19.7265L38.799 20.4849H38.4247ZM36.4995 20.4849L36.2103 21.4365C36.2103 21.4365 36.5336 21.2909 36.7112 21.2421C36.8901 21.1958 37.1589 21.1777 37.1589 21.1777L37.3681 20.4849H36.4995ZM36.0669 21.9098L35.7678 22.8994C35.7678 22.8994 36.0984 22.73 36.276 22.6773C36.4549 22.6358 36.7255 22.6021 36.7255 22.6021L36.9377 21.9098H36.0669ZM35.3702 24.2197H36.241L36.4925 23.383H35.6217L35.3702 24.2197Z", fill: "white" }), jsx("path", { d: "M38.9076 19.7265H40.0736L40.0866 20.1613C40.0797 20.2343 40.1427 20.2689 40.2776 20.2689H40.5144L40.2979 20.9863H39.6687C39.1224 21.0265 38.9163 20.7918 38.9284 20.5286L38.9076 19.7265Z", fill: "white" }), jsx("path", { d: "M39.0602 23.1305H37.9487L38.1397 22.4909H39.4099L39.5918 21.9079H38.3368L38.5525 21.1875H42.0439L41.8252 21.9079H40.6545L40.4713 22.4909H41.6446L41.4514 23.1305H40.1808L39.9561 23.3998H40.4713L40.5962 24.2049C40.6096 24.284 40.6121 24.3363 40.6372 24.3708C40.6631 24.4006 40.8174 24.4145 40.9069 24.4145H41.0633L40.8256 25.198H40.4293C40.368 25.198 40.2772 25.1928 40.1532 25.1863C40.033 25.1759 39.9479 25.1064 39.8684 25.0683C39.7958 25.032 39.6869 24.9439 39.6618 24.7939L39.5374 23.9905L38.9608 24.7831C38.7772 25.032 38.5291 25.2226 38.1108 25.2226H37.3009L37.5131 24.5238H37.8221C37.9116 24.5238 37.9906 24.4888 38.0485 24.4586C38.1082 24.4335 38.1605 24.4037 38.2201 24.3155L39.0602 23.1305Z", fill: "white" }), jsx("path", { d: "M26.8864 21.3815H29.8294L29.612 22.0842H28.4348L28.252 22.6818H29.456L29.2365 23.4075H28.0333L27.7416 24.3811C27.7057 24.4892 28.026 24.5043 28.1418 24.5043L28.7451 24.4209L28.5035 25.223H27.1457C27.0389 25.223 26.9555 25.2079 26.8371 25.1811C26.7226 25.1525 26.672 25.1015 26.6214 25.0237C26.5722 24.9438 26.497 24.879 26.548 24.7096L26.9374 23.42H26.2692L26.4909 22.6818H27.1629L27.3414 22.0842H26.672L26.8864 21.3815Z", fill: "white" }), jsx("path", { d: "M28.8682 20.1195H30.0752L29.8544 20.8541H28.2052L28.0259 21.0084C27.9498 21.0832 27.923 21.0516 27.8232 21.1057C27.7303 21.1532 27.5337 21.2461 27.28 21.2461H26.7506L26.9658 20.5395H27.1244C27.2588 20.5395 27.35 20.5283 27.3962 20.4985C27.449 20.4656 27.5073 20.3909 27.5751 20.269L27.8777 19.718H29.0786L28.8682 20.1195Z", fill: "white" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M30.5938 19.7264H31.6223L31.4728 20.2437C31.4728 20.2437 31.7969 19.9848 32.0247 19.8923C32.2511 19.8072 32.7641 19.7311 32.7641 19.7311L34.428 19.7225L33.861 21.6106C33.7659 21.9347 33.6548 22.1439 33.5852 22.239C33.5217 22.3366 33.4482 22.4183 33.3026 22.4974C33.1626 22.5722 33.0351 22.6154 32.9175 22.6275C32.8073 22.6357 32.6388 22.64 32.4046 22.6422H30.8025L30.3501 24.1366C30.3073 24.284 30.2865 24.354 30.3146 24.3937C30.3384 24.43 30.3928 24.4702 30.468 24.4702L31.1746 24.4037L30.9339 25.2226H30.1413C29.8898 25.2226 29.7066 25.2174 29.5778 25.2075C29.4559 25.198 29.3284 25.2075 29.2441 25.1414C29.1694 25.0766 29.0574 24.9918 29.06 24.9041C29.0683 24.8229 29.1011 24.688 29.1534 24.5039L30.5938 19.7264ZM32.7775 21.6344H31.0912L30.9884 21.9749H32.4473C32.6198 21.9533 32.6552 21.9779 32.669 21.9697L32.7775 21.6344ZM31.185 21.3271C31.185 21.3271 31.5139 21.0263 32.0778 20.9286C32.2062 20.9036 33.0083 20.9118 33.0083 20.9118L33.1297 20.5081H31.4305L31.185 21.3271Z", fill: "white" }), jsx("path", { d: "M33.5921 22.7747L33.4979 23.2285C33.4559 23.3693 33.4209 23.4778 33.3138 23.5686C33.2027 23.6632 33.0696 23.763 32.7606 23.763L32.191 23.7859L32.1862 24.2998C32.1785 24.4459 32.2178 24.4303 32.2411 24.4541C32.2675 24.4787 32.2904 24.4904 32.3168 24.4986L32.4961 24.4904L33.0415 24.4584L32.8168 25.2078H32.191C31.7524 25.2078 31.4274 25.1983 31.3202 25.1127C31.2156 25.0466 31.2018 24.9619 31.2048 24.8188L31.2441 22.8201H32.242L32.2295 23.2285H32.4702C32.5523 23.2285 32.6063 23.2198 32.6417 23.1986C32.6707 23.1749 32.6936 23.1437 32.7096 23.0932L32.8068 22.7747H33.5921Z", fill: "white" }), jsx("path", { d: "M19.3395 12.7519C19.3032 12.9127 18.6632 15.8704 18.6606 15.8722C18.5219 16.4698 18.4238 16.8985 18.0824 17.1721C17.8887 17.3311 17.6623 17.4094 17.4008 17.4094C16.9808 17.4094 16.734 17.2006 16.6921 16.8035L16.6843 16.6678C16.6843 16.6678 16.8122 15.8652 16.814 15.8622C16.814 15.8622 17.486 13.1664 17.6065 12.8116C17.6117 12.7917 17.6143 12.7817 17.6169 12.7714C16.3075 12.783 16.0745 12.7714 16.0594 12.7519C16.052 12.7783 16.017 12.946 16.017 12.946L15.3299 15.9815L15.2703 16.2408L15.1579 17.0826C15.1579 17.3311 15.2072 17.536 15.3044 17.7084C15.6177 18.2564 16.511 18.3377 17.0149 18.3377C17.6662 18.3377 18.2751 18.1985 18.6874 17.9478C19.4026 17.5243 19.591 16.8614 19.7583 16.2754L19.8352 15.975C19.8352 15.975 20.5288 13.1759 20.6473 12.8116C20.6507 12.7917 20.6529 12.7817 20.6576 12.7714C19.709 12.7817 19.4298 12.7714 19.3395 12.7519Z", fill: "white" }), jsx("path", { d: "M23.1723 18.3077C22.7073 18.3012 22.5444 18.3012 22.0011 18.3289L21.98 18.2887C22.0279 18.0821 22.0794 17.8785 22.1252 17.6689L22.1917 17.3867C22.2924 16.9464 22.3909 16.4347 22.4026 16.2804C22.4121 16.1862 22.4432 15.952 22.1757 15.952C22.0625 15.952 21.9449 16.0073 21.8265 16.0613C21.7608 16.2955 21.6282 16.9515 21.5672 17.2519C21.432 17.8829 21.4233 17.9542 21.3633 18.2666L21.3244 18.3077C20.8451 18.3012 20.6796 18.3012 20.1286 18.3289L20.1026 18.283C20.1951 17.9079 20.2867 17.5298 20.3749 17.1555C20.6057 16.1395 20.6601 15.7501 20.7245 15.2337L20.7677 15.203C21.3049 15.1278 21.435 15.1131 22.0163 14.9934L22.0655 15.0483L21.9778 15.372C22.0759 15.3141 22.1688 15.2549 22.2704 15.203C22.5444 15.0682 22.8495 15.0284 23.0176 15.0284C23.2713 15.0284 23.5496 15.0997 23.6663 15.394C23.7769 15.6564 23.7039 15.9805 23.5586 16.6175L23.4835 16.9412C23.3344 17.6504 23.3102 17.78 23.2267 18.2666L23.1723 18.3077Z", fill: "white" }), jsx("path", { d: "M25.0585 18.3077C24.7793 18.3064 24.5995 18.3012 24.4232 18.3064C24.2486 18.3077 24.0779 18.3168 23.8182 18.3289L23.8026 18.3064L23.7853 18.283C23.8562 18.0142 23.8964 17.92 23.9309 17.8245C23.9664 17.7299 24.001 17.6339 24.0623 17.3612C24.1436 17.006 24.1937 16.7571 24.2296 16.5397C24.2667 16.3284 24.2879 16.1495 24.3143 15.9416L24.3359 15.9252L24.3592 15.9053C24.6371 15.866 24.8147 15.84 24.9945 15.8124C25.1769 15.786 25.3605 15.7501 25.6488 15.6957L25.66 15.7207L25.6678 15.7462C25.6142 15.9662 25.5598 16.1862 25.5075 16.41C25.4561 16.6326 25.4016 16.8513 25.3532 17.073C25.2478 17.541 25.2067 17.7148 25.1816 17.8396C25.1587 17.9589 25.1509 18.0237 25.1095 18.2666L25.0844 18.2887L25.0585 18.3077Z", fill: "white" }), jsx("path", { d: "M29.2305 16.7091C29.3935 15.9948 29.2686 15.6607 29.1091 15.4563C28.8658 15.1477 28.4397 15.0479 27.9958 15.0479C27.7301 15.0479 27.0952 15.0751 26.5987 15.5332C26.2443 15.8621 26.0779 16.3107 25.9781 16.7389C25.8782 17.175 25.7628 17.9641 26.4867 18.2567C26.7114 18.3509 27.0313 18.3777 27.2396 18.3777C27.7698 18.3777 28.3135 18.2312 28.7206 17.7982C29.0382 17.446 29.1813 16.923 29.2305 16.7091ZM28.0166 16.6573C27.9911 16.777 27.8865 17.2256 27.7426 17.4161C27.6432 17.5562 27.5252 17.6404 27.3947 17.6404C27.358 17.6404 27.1285 17.6404 27.1242 17.2999C27.1216 17.1322 27.1566 16.9576 27.1985 16.7718C27.3208 16.2307 27.4651 15.7769 27.8329 15.7769C28.1225 15.7769 28.1415 16.1145 28.0166 16.6573Z", fill: "white" }), jsx("path", { d: "M40.5855 18.3561C40.0254 18.3509 39.8642 18.3509 39.3465 18.373L39.3115 18.331C39.4532 17.7982 39.595 17.267 39.7199 16.7286C39.8819 16.0298 39.9191 15.7329 39.9736 15.324L40.0155 15.2895C40.5713 15.2095 40.726 15.1875 41.3059 15.0803L41.3241 15.1278C41.2178 15.566 41.1115 16.0047 41.0103 16.4446C40.7964 17.3664 40.7186 17.8349 40.6365 18.3163L40.5855 18.3561Z", fill: "white" }), jsx("path", { d: "M40.8523 16.7721C41.0152 16.0612 40.3601 16.7094 40.2551 16.4748C40.0943 16.1092 40.195 15.3671 39.5493 15.1195C39.3017 15.0231 38.7183 15.148 38.2204 15.6031C37.8682 15.9307 37.7005 16.3736 37.6016 16.8015C37.5013 17.2315 37.3864 18.0189 38.1063 18.3015C38.3337 18.3979 38.5424 18.4256 38.7498 18.4173C39.4741 18.378 40.0265 17.2855 40.434 16.852C40.749 16.5098 40.8043 16.9808 40.8523 16.7721ZM39.7442 16.7189C39.717 16.833 39.612 17.2868 39.4681 17.4744C39.373 17.6088 39.1466 17.6939 39.0169 17.6939C38.9802 17.6939 38.7524 17.6939 38.7442 17.3564C38.7425 17.1904 38.7775 17.0158 38.8207 16.8283C38.943 16.2989 39.0874 15.8468 39.4551 15.8468C39.7451 15.8468 39.8687 16.1761 39.7442 16.7189Z", fill: "white" }), jsx("path", { d: "M32.4031 18.3077C31.9372 18.3012 31.7795 18.3012 31.2319 18.3289L31.2125 18.2887C31.2587 18.0821 31.3114 17.8785 31.3598 17.6689L31.4251 17.3867C31.5262 16.9464 31.6243 16.4347 31.6355 16.2804C31.6446 16.1862 31.6757 15.952 31.4104 15.952C31.2954 15.952 31.1792 16.0073 31.0599 16.0613C30.9951 16.2955 30.862 16.9515 30.798 17.2519C30.6653 17.8829 30.6563 17.9542 30.5962 18.2666L30.5564 18.3077C30.0776 18.3012 29.9134 18.3012 29.3637 18.3289L29.3386 18.283C29.4302 17.9079 29.5201 17.5298 29.6083 17.1555C29.8386 16.1395 29.8935 15.7501 29.9575 15.2337L30.0007 15.203C30.5378 15.1278 30.6684 15.1131 31.2496 14.9934L31.2954 15.0483L31.2112 15.372C31.3067 15.3141 31.4039 15.2549 31.5029 15.203C31.7751 15.0682 32.0828 15.0284 32.2475 15.0284C32.502 15.0284 32.7808 15.0997 32.9005 15.394C33.0098 15.6564 32.9359 15.9805 32.7894 16.6175L32.7164 16.9412C32.5643 17.6504 32.5409 17.78 32.4605 18.2666L32.4031 18.3077Z", fill: "white" }), jsx("path", { d: "M36.9307 14.4822C36.8486 14.8504 36.6096 15.1629 36.3006 15.3137C36.0452 15.4421 35.7344 15.4516 35.4129 15.4516H35.2059L35.2215 15.369C35.2215 15.369 35.6048 13.7048 35.6031 13.71L35.6143 13.6248L35.6212 13.5591L35.7742 13.5751C35.7742 13.5751 36.5616 13.6434 36.5815 13.6456C36.8931 13.764 37.0201 14.0769 36.9307 14.4822ZM36.4276 12.7467C36.4255 12.7467 36.0417 12.7518 36.0417 12.7518C35.0378 12.7631 34.6354 12.7583 34.4703 12.7385C34.4531 12.8119 34.428 12.9424 34.428 12.9424L34.0693 14.6115C34.0693 14.6115 33.2097 18.1565 33.1687 18.3229C34.0447 18.3134 34.4042 18.3134 34.5542 18.3285C34.5883 18.1621 34.7932 17.172 34.7932 17.172C34.7932 17.172 34.9682 16.4447 34.9786 16.4179C34.9786 16.4179 35.0326 16.3436 35.0883 16.3137H35.1683C35.9233 16.3137 36.7781 16.3137 37.4462 15.8206C37.9004 15.4831 38.2138 14.9848 38.3516 14.3802C38.3888 14.2316 38.4147 14.0535 38.4147 13.8772C38.4147 13.6456 38.368 13.4161 38.2323 13.2363C37.8918 12.7583 37.2142 12.7518 36.4276 12.7467Z", fill: "white" }), jsx("path", { d: "M45.1748 15.0751L45.1303 15.0254C44.5581 15.1399 44.4535 15.1598 43.9263 15.2293L43.8865 15.2674C43.8848 15.2739 43.8831 15.2842 43.8818 15.2924L43.8792 15.2842C43.4868 16.1913 43.4993 15.9951 43.1791 16.7073C43.1769 16.6736 43.1765 16.6525 43.1756 16.6187L43.0961 15.0751L43.0455 15.0254C42.4466 15.1399 42.4306 15.1598 41.8761 15.2293L41.8316 15.2674C41.8277 15.2877 41.8264 15.3076 41.8234 15.3292L41.8277 15.3374C41.8968 15.6931 41.8809 15.6131 41.9496 16.171C41.982 16.445 42.0243 16.7225 42.0567 16.9926C42.1121 17.4463 42.1423 17.6706 42.208 18.3612C41.835 18.981 41.7447 19.2148 41.3882 19.7584L41.4072 19.8077C41.9496 19.7874 42.0745 19.7874 42.4755 19.7874L42.5641 19.6884C42.8671 19.0354 45.1748 15.0751 45.1748 15.0751Z", fill: "white" }), jsx("path", { d: "M25.5693 15.4586C25.8753 15.2447 25.9146 14.9491 25.6553 14.7957C25.3926 14.6414 24.9353 14.6898 24.6259 14.9042C24.3143 15.1151 24.2802 15.4115 24.5399 15.5662C24.8001 15.7171 25.2595 15.673 25.5693 15.4586Z", fill: "white" }), jsx("path", { d: "M42.5238 19.7429L42.0727 20.5152C41.93 20.7788 41.6651 20.9771 41.2442 20.9784L40.5255 20.9668L40.7347 20.2706H40.8738C40.9477 20.2706 41.0018 20.2658 41.0432 20.2455C41.0787 20.2343 41.105 20.2062 41.1344 20.1647L41.3993 19.7429H42.5238Z", fill: "white" })] }));
19092
18492
  };
19093
18493
 
19094
18494
  const CreditCard = ({ className }) => {
19095
- return (jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsx("path", { d: "M1 10L59 10", stroke: "#D3D3D3", "stroke-width": "7" }), jsx("path", { d: "M5 20H34", stroke: "#D3D3D3", "stroke-width": "2", strokeLinecap: "round" }), jsx("path", { d: "M5 27H25", stroke: "#D3D3D3", "stroke-width": "2", strokeLinecap: "round" }), jsx("rect", { x: "46", y: "21", width: "10", height: "7", rx: "2", fill: "#D9D9D9" })] }));
18495
+ return (jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsx("path", { d: "M1 10L59 10", stroke: "#D3D3D3", strokeWidth: "7" }), jsx("path", { d: "M5 20H34", stroke: "#D3D3D3", strokeWidth: "2", strokeLinecap: "round" }), jsx("path", { d: "M5 27H25", stroke: "#D3D3D3", strokeWidth: "2", strokeLinecap: "round" }), jsx("rect", { x: "46", y: "21", width: "10", height: "7", rx: "2", fill: "#D9D9D9" })] }));
19096
18496
  };
19097
18497
 
19098
18498
  const DinersClub = ({ className }) => {
@@ -19103,6 +18503,10 @@ const Discover = ({ className }) => {
19103
18503
  return (jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M0.5 8C0.5 3.85786 3.85786 0.5 8 0.5H52C56.1421 0.5 59.5 3.85786 59.5 8V30C59.5 34.1421 56.1421 37.5 52 37.5H8C3.85786 37.5 0.5 34.1421 0.5 30V8Z", fill: "white", stroke: "#D3D3D3" }), jsx("path", { d: "M9.19232 21.3753C8.69269 21.8265 8.04327 22.0234 7.01615 22.0234H6.58905V16.6315H7.01615C8.04327 16.6315 8.66695 16.8153 9.19232 17.2909C9.74271 17.7809 10.0728 18.539 10.0728 19.3202C10.0728 20.1034 9.74271 20.8859 9.19232 21.3753ZM7.33469 15.2496H5V23.404H7.32208C8.55684 23.404 9.44888 23.1129 10.2316 22.4621C11.1617 21.6921 11.7116 20.5322 11.7116 19.3327C11.7116 16.926 9.91383 15.2496 7.33469 15.2496Z", fill: "#231F20" }), jsx("path", { d: "M12.4438 23.404H14.0339V15.2496H12.4438V23.404Z", fill: "#231F20" }), jsx("path", { d: "M17.9229 18.379C16.9683 18.0253 16.6881 17.7928 16.6881 17.3521C16.6881 16.8383 17.1875 16.4484 17.8729 16.4484C18.3498 16.4484 18.7411 16.644 19.1556 17.1091L19.9879 16.019C19.3038 15.4209 18.4856 15.1153 17.592 15.1153C16.1491 15.1153 15.0487 16.1171 15.0487 17.4516C15.0487 18.5746 15.5612 19.1496 17.0551 19.6871C17.6774 19.9071 17.9941 20.0533 18.1542 20.1521C18.4717 20.359 18.6312 20.6527 18.6312 20.9952C18.6312 21.6559 18.1058 22.1453 17.3959 22.1453C16.6379 22.1453 16.0266 21.7665 15.6605 21.0585L14.6329 22.0471C15.3656 23.1227 16.2456 23.5996 17.4559 23.5996C19.1087 23.5996 20.2684 22.501 20.2684 20.9228C20.2684 19.6265 19.7324 19.0403 17.9229 18.379Z", fill: "#231F20" }), jsx("path", { d: "M20.7702 19.3328C20.7702 21.729 22.652 23.5871 25.0739 23.5871C25.7583 23.5871 26.3445 23.4528 27.0677 23.1129V21.2403C26.4317 21.8766 25.8684 22.1328 25.1475 22.1328C23.5456 22.1328 22.4089 20.9715 22.4089 19.3203C22.4089 17.7552 23.5821 16.5202 25.0739 16.5202C25.8321 16.5202 26.407 16.7909 27.0677 17.4378V15.5665C26.3697 15.2121 25.7957 15.0659 25.1112 15.0659C22.7019 15.0659 20.7702 16.9615 20.7702 19.3328Z", fill: "#231F20" }), jsx("path", { d: "M39.6784 20.7265L37.5033 15.2497H35.7663L39.2264 23.6135H40.0824L43.605 15.2497H41.8806L39.6784 20.7265Z", fill: "#231F20" }), jsx("path", { d: "M44.3237 23.404H48.8345V22.0234H45.9135V19.8221H48.7263V18.4409H45.9135V16.6315H48.8345V15.2496H44.3237V23.404Z", fill: "#231F20" }), jsx("path", { d: "M51.9414 19.0041H51.4762V16.534H51.9658C52.9569 16.534 53.4954 16.949 53.4954 17.7427C53.4954 18.5628 52.9569 19.0041 51.9414 19.0041ZM55.1326 17.6571C55.1326 16.1303 54.0803 15.2496 52.246 15.2496H49.8879V23.404H51.4762V20.1284H51.6841L53.8855 23.404H55.8412L53.2739 19.9684C54.4724 19.7246 55.1326 18.9059 55.1326 17.6571Z", fill: "#231F20" }), jsx("path", { d: "M56.0974 15.7753H56.0678V15.5875H56.0989C56.1836 15.5875 56.2281 15.6178 56.2281 15.6797C56.2281 15.7436 56.1831 15.7753 56.0974 15.7753ZM56.4 15.6778C56.4 15.5342 56.3007 15.4558 56.1273 15.4558H55.8967V16.1744H56.0678V15.8958L56.269 16.1744H56.479L56.2425 15.878C56.3434 15.851 56.4 15.7772 56.4 15.6778Z", fill: "#231F20" }), jsx("path", { d: "M56.1591 16.3292C55.8843 16.3292 55.6597 16.1 55.6597 15.8148C55.6597 15.5283 55.8823 15.2997 56.1591 15.2997C56.4328 15.2997 56.6554 15.5335 56.6554 15.8148C56.6554 16.0974 56.4328 16.3292 56.1591 16.3292ZM56.1617 15.1871C55.8128 15.1871 55.5354 15.4657 55.5354 15.8135C55.5354 16.1619 55.8159 16.4412 56.1617 16.4412C56.5018 16.4412 56.7808 16.1586 56.7808 15.8135C56.7808 15.4703 56.5018 15.1871 56.1617 15.1871Z", fill: "#231F20" }), jsx("path", { d: "M36.2191 19.3183C36.2191 21.7027 34.2863 23.6359 31.9014 23.6359C29.5166 23.6359 27.5835 21.7027 27.5835 19.3183C27.5835 16.9332 29.5166 15 31.9014 15C34.2863 15 36.2191 16.9332 36.2191 19.3183Z", fill: "#F36719" })] }));
19104
18504
  };
19105
18505
 
18506
+ const IDeal = ({ className }) => {
18507
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19.0266 9.91185H35.684C47.003 9.91185 51.3527 16.0977 51.3527 23.9167C51.3527 33.2698 45.273 37.9711 35.684 37.9711H19.0266V9.91185ZM20.6082 11.5944V36.3875H35.6838C44.7786 36.3875 49.7215 32.1316 49.7215 23.9662C49.7215 15.5534 44.3832 11.5944 35.6838 11.5944H20.6082ZM25.0568 24.4115C26.722 24.4115 28.072 23.06 28.072 21.3928C28.072 19.7256 26.722 18.3741 25.0568 18.3741C23.3916 18.3741 22.0417 19.7256 22.0417 21.3928C22.0417 23.06 23.3916 24.4115 25.0568 24.4115ZM22.635 25.6982H27.479V34.309H22.635V25.6982Z", fill: "black" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44.2351 18.6216H45.6191V22.7785H47.6456C47.1019 15.207 41.1211 13.5244 35.684 13.5244H29.9009V18.6216H30.7412C32.3229 18.6216 33.262 19.6608 33.262 21.3929C33.262 23.1249 32.3229 24.1641 30.7906 24.1641H29.9009V34.309H35.684C44.5317 34.309 47.5468 30.2016 47.6951 24.1641H44.2351V18.6216ZM37.5623 22.7785V24.1641H34.1023V18.6216H37.4634V20.0072H35.4863V20.6505H37.3646V22.0362H35.5357V22.7785H37.5623ZM39.8358 18.6216H41.813L43.4935 24.1641H42.0601L41.7635 23.1249H39.9347L39.6381 24.1641H38.1553L39.8358 18.6216ZM40.3456 21.6898H40.3302V21.7393L40.3456 21.6898ZM40.3456 21.6898H41.3188L40.8739 20.1557H40.8245L40.3456 21.6898ZM29.9009 22.7785V20.0072H30.7412C31.2849 20.0072 31.878 20.1557 31.878 21.3929C31.878 22.63 31.3343 22.7785 30.7412 22.7785H29.9009Z", fill: "#D50072" })] }));
18508
+ };
18509
+
19106
18510
  const JCB = ({ className }) => {
19107
18511
  return (jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsx("path", { d: "M48 27.522C48 30.5171 45.5611 32.956 42.566 32.956H13V11.434C13 8.43887 15.4389 6 18.434 6H48V27.522Z", fill: "white" }), jsx("path", { d: "M38.3728 22.0024H40.6191C40.6833 22.0024 40.833 21.981 40.8972 21.981C41.3251 21.8954 41.6888 21.5104 41.6888 20.9755C41.6888 20.4621 41.3251 20.077 40.8972 19.97C40.833 19.9486 40.7047 19.9486 40.6191 19.9486H38.3728V22.0024Z", fill: "url(#paint0_linear_1_133)" }), jsx("path", { d: "M40.3625 7.81844C38.2231 7.81844 36.4688 9.55132 36.4688 11.7121V15.7555H41.967C42.0953 15.7555 42.2451 15.7555 42.3521 15.7769C43.5929 15.8411 44.5128 16.4829 44.5128 17.5953C44.5128 18.4725 43.8924 19.2212 42.7371 19.371V19.4138C43.9994 19.4994 44.9621 20.2054 44.9621 21.2964C44.9621 22.4731 43.8924 23.2433 42.4804 23.2433H36.4474V31.1589H42.1595C44.2989 31.1589 46.0532 29.426 46.0532 27.2653V7.81844H40.3625Z", fill: "url(#paint1_linear_1_133)" }), jsx("path", { d: "M41.4107 17.852C41.4107 17.3386 41.047 16.9963 40.6191 16.9321C40.5763 16.9321 40.4693 16.9107 40.4052 16.9107H38.3728V18.7933H40.4052C40.4693 18.7933 40.5977 18.7933 40.6191 18.7719C41.047 18.7078 41.4107 18.3655 41.4107 17.852Z", fill: "url(#paint2_linear_1_133)" }), jsx("path", { d: "M18.8405 7.81844C16.7011 7.81844 14.9468 9.55132 14.9468 11.7121V21.3178C16.0379 21.8527 17.1718 22.195 18.3056 22.195C19.6534 22.195 20.3808 21.382 20.3808 20.2695V15.7341H23.7182V20.2481C23.7182 22.0024 22.6272 23.4358 18.9261 23.4358C16.6797 23.4358 14.9254 22.9437 14.9254 22.9437V31.1375H20.6375C22.7769 31.1375 24.5312 29.4046 24.5312 27.2439V7.81844H18.8405Z", fill: "url(#paint3_linear_1_133)" }), jsx("path", { d: "M29.6015 7.81844C27.4621 7.81844 25.7079 9.55132 25.7079 11.7121V16.8038C26.692 15.9694 28.4035 15.4346 31.1632 15.5629C32.6394 15.6271 34.2225 16.0336 34.2225 16.0336V17.6809C33.431 17.2744 32.4896 16.9107 31.2702 16.8252C29.1736 16.6754 27.9114 17.7023 27.9114 19.4994C27.9114 21.3178 29.1736 22.3447 31.2702 22.1736C32.4896 22.088 33.431 21.7029 34.2225 21.3178V22.9651C34.2225 22.9651 32.6608 23.3716 31.1632 23.4358C28.4035 23.5642 26.692 23.0293 25.7079 22.195V31.1803H31.42C33.5593 31.1803 35.3136 29.4474 35.3136 27.2867V7.81844H29.6015Z", fill: "url(#paint4_linear_1_133)" }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1_133", x1: "36.4652", y1: "20.9781", x2: "46.0789", y2: "20.9781", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { "stop-color": "#007940" }), jsx("stop", { offset: "0.2285", "stop-color": "#00873F" }), jsx("stop", { offset: "0.7433", "stop-color": "#40A737" }), jsx("stop", { offset: "1", "stop-color": "#5CB531" })] }), jsxs("linearGradient", { id: "paint1_linear_1_133", x1: "36.465", y1: "19.4793", x2: "46.0794", y2: "19.4793", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { "stop-color": "#007940" }), jsx("stop", { offset: "0.2285", "stop-color": "#00873F" }), jsx("stop", { offset: "0.7433", "stop-color": "#40A737" }), jsx("stop", { offset: "1", "stop-color": "#5CB531" })] }), jsxs("linearGradient", { id: "paint2_linear_1_133", x1: "36.4649", y1: "17.8493", x2: "46.079", y2: "17.8493", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { "stop-color": "#007940" }), jsx("stop", { offset: "0.2285", "stop-color": "#00873F" }), jsx("stop", { offset: "0.7433", "stop-color": "#40A737" }), jsx("stop", { offset: "1", "stop-color": "#5CB531" })] }), jsxs("linearGradient", { id: "paint3_linear_1_133", x1: "14.9423", y1: "19.4793", x2: "24.7049", y2: "19.4793", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { "stop-color": "#1F286F" }), jsx("stop", { offset: "0.4751", "stop-color": "#004E94" }), jsx("stop", { offset: "0.8261", "stop-color": "#0066B1" }), jsx("stop", { offset: "1", "stop-color": "#006FBC" })] }), jsxs("linearGradient", { id: "paint4_linear_1_133", x1: "25.6525", y1: "19.4793", x2: "35.1343", y2: "19.4793", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { "stop-color": "#6C2C2F" }), jsx("stop", { offset: "0.1735", "stop-color": "#882730" }), jsx("stop", { offset: "0.5731", "stop-color": "#BE1833" }), jsx("stop", { offset: "0.8585", "stop-color": "#DC0436" }), jsx("stop", { offset: "1", "stop-color": "#E60039" })] })] })] }));
19108
18512
  };
@@ -19112,53 +18516,108 @@ const Cashapp = ({ className }) => {
19112
18516
  };
19113
18517
 
19114
18518
  const Mastercard = ({ className }) => {
19115
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M35.5 34.3139C33.1169 36.3704 30.0255 37.6119 26.6475 37.6119C19.1102 37.6119 13 31.4308 13 23.806C13 16.1811 19.1102 10 26.6475 10C30.0255 10 33.1169 11.2415 35.5 13.2981C37.8831 11.2415 40.9745 10 44.3525 10C51.8898 10 58 16.1811 58 23.806C58 31.4308 51.8898 37.6119 44.3525 37.6119C40.9745 37.6119 37.8831 36.3704 35.5 34.3139Z", fill: "#ED0006" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M35.5 34.3139C38.4344 31.7816 40.2951 28.0136 40.2951 23.806C40.2951 19.5983 38.4344 15.8303 35.5 13.2981C37.8831 11.2415 40.9745 10 44.3525 10C51.8898 10 58 16.1811 58 23.806C58 31.4308 51.8898 37.6119 44.3525 37.6119C40.9745 37.6119 37.8831 36.3704 35.5 34.3139Z", fill: "#F9A000" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M35.5 13.2981C38.4344 15.8304 40.2951 19.5984 40.2951 23.806C40.2951 28.0136 38.4344 31.7816 35.5 34.3138C32.5657 31.7816 30.705 28.0136 30.705 23.806C30.705 19.5984 32.5657 15.8304 35.5 13.2981Z", fill: "#FF5E00" })] }));
19116
- };
19117
-
19118
- const Visa = ({ className }) => {
19119
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M21.2505 32.5165H17.0099L13.8299 20.3847C13.679 19.8267 13.3585 19.3333 12.8871 19.1008C11.7106 18.5165 10.4142 18.0514 9 17.8169V17.3498H15.8313C16.7742 17.3498 17.4813 18.0514 17.5991 18.8663L19.2491 27.6173L23.4877 17.3498H27.6104L21.2505 32.5165ZM29.9675 32.5165H25.9626L29.2604 17.3498H33.2653L29.9675 32.5165ZM38.4467 21.5514C38.5646 20.7346 39.2717 20.2675 40.0967 20.2675C41.3931 20.1502 42.8052 20.3848 43.9838 20.9671L44.6909 17.7016C43.5123 17.2345 42.216 17 41.0395 17C37.1524 17 34.3239 19.1008 34.3239 22.0165C34.3239 24.2346 36.3274 25.3992 37.7417 26.1008C39.2717 26.8004 39.861 27.2675 39.7431 27.9671C39.7431 29.0165 38.5646 29.4836 37.3881 29.4836C35.9739 29.4836 34.5596 29.1338 33.2653 28.5494L32.5582 31.8169C33.9724 32.3992 35.5025 32.6338 36.9167 32.6338C41.2752 32.749 43.9838 30.6502 43.9838 27.5C43.9838 23.5329 38.4467 23.3004 38.4467 21.5514ZM58 32.5165L54.82 17.3498H51.4044C50.6972 17.3498 49.9901 17.8169 49.7544 18.5165L43.8659 32.5165H47.9887L48.8116 30.3004H53.8772L54.3486 32.5165H58ZM51.9936 21.4342L53.1701 27.1502H49.8723L51.9936 21.4342Z", fill: "#172B85" })] }));
18519
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M35.5 34.3139C33.1169 36.3704 30.0255 37.6119 26.6475 37.6119C19.1102 37.6119 13 31.4308 13 23.806C13 16.1811 19.1102 10 26.6475 10C30.0255 10 33.1169 11.2415 35.5 13.2981C37.8831 11.2415 40.9745 10 44.3525 10C51.8898 10 58 16.1811 58 23.806C58 31.4308 51.8898 37.6119 44.3525 37.6119C40.9745 37.6119 37.8831 36.3704 35.5 34.3139Z", fill: "#ED0006" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M35.5 34.3139C38.4344 31.7816 40.2951 28.0136 40.2951 23.806C40.2951 19.5983 38.4344 15.8303 35.5 13.2981C37.8831 11.2415 40.9745 10 44.3525 10C51.8898 10 58 16.1811 58 23.806C58 31.4308 51.8898 37.6119 44.3525 37.6119C40.9745 37.6119 37.8831 36.3704 35.5 34.3139Z", fill: "#F9A000" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M35.5 13.2981C38.4344 15.8304 40.2951 19.5984 40.2951 23.806C40.2951 28.0136 38.4344 31.7816 35.5 34.3138C32.5657 31.7816 30.705 28.0136 30.705 23.806C30.705 19.5984 32.5657 15.8304 35.5 13.2981Z", fill: "#FF5E00" })] }));
19120
18520
  };
19121
18521
 
19122
18522
  const Sepa = ({ className }) => {
19123
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "#10298E", stroke: "#D9D9D9" }), jsx("path", { d: "M12.7744 16.084C14.4396 16.084 15.6264 16.1801 16.334 16.3701C18.0609 16.8349 18.9248 18.137 18.9248 20.2764C18.9248 20.4518 18.9113 20.714 18.8857 21.0645H14.918C14.918 20.4123 14.8407 19.9748 14.6885 19.752C14.4524 19.4222 13.801 19.2569 12.7344 19.2568C11.6983 19.2568 11.0109 19.3519 10.6758 19.542C10.3409 19.7327 10.1729 20.1477 10.1729 20.7861C10.1729 21.3638 10.3217 21.7443 10.6191 21.9268C10.8324 22.0562 11.1145 22.1325 11.4658 22.1553L12.2656 22.2119C13.9806 22.3259 15.0521 22.4065 15.4795 22.4521C16.8358 22.5891 17.8195 22.9497 18.4297 23.5352C18.9098 23.992 19.1958 24.5898 19.2871 25.3271C19.3405 25.7681 19.3672 26.267 19.3672 26.8213C19.3672 28.0993 19.2457 29.0356 19.002 29.6289C18.5601 30.7174 17.5669 31.4046 16.0225 31.6934C15.3754 31.8154 14.3858 31.8769 13.0547 31.877C10.8322 31.877 9.28274 31.7449 8.4082 31.4785C7.33499 31.1522 6.6276 30.4905 6.28516 29.4951C6.09445 28.941 6.00001 28.0182 6 26.7266H9.96875C9.96875 26.8706 9.96875 26.9808 9.96875 27.0566C9.96876 27.746 10.1668 28.1893 10.5615 28.3867C10.8351 28.5229 11.1654 28.594 11.5537 28.6025H13.0127C13.7572 28.6025 14.2325 28.5649 14.4375 28.4883C14.8023 28.3446 15.0418 28.1131 15.1562 27.793C15.217 27.596 15.247 27.3411 15.2471 27.0293C15.2471 26.3303 14.992 25.9045 14.4834 25.752C14.2928 25.6917 13.4079 25.6075 11.8291 25.501C10.5609 25.4103 9.67998 25.3228 9.18652 25.2383C7.88722 24.9948 7.02094 24.4944 6.58887 23.7344C6.20918 23.0886 6.01956 22.1116 6.01953 20.8047C6.01953 19.8092 6.12198 19.0105 6.32715 18.4102C6.53252 17.8097 6.86368 17.3538 7.32031 17.042C7.98917 16.5635 8.84498 16.2823 9.88672 16.1982C10.7538 16.1225 11.7164 16.084 12.7744 16.084ZM44.2861 16C45.3761 16 46.2079 16.0894 46.7793 16.2676C48.0865 16.6779 48.9639 17.5176 49.4131 18.7871C49.645 19.4533 49.7607 20.4565 49.7607 21.7959C49.7607 23.4063 49.6323 24.564 49.3779 25.2686C48.8682 26.6618 47.8187 27.4648 46.2344 27.6729C46.048 27.7041 45.2548 27.7316 43.8555 27.7539L43.1475 27.7773H40.6045V31.877H36.3389V16H44.2861ZM64 31.877H59.6787L58.8652 29.1328H53.1621L52.3955 31.877H47.9824L52.7441 16H59.1787L64 31.877ZM54.0801 26.04H58.0186L56.0195 19.1572L54.0801 26.04ZM40.6035 24.0947H43.2627C44.1059 24.0643 44.6191 23.9992 44.8037 23.8975C45.0556 23.7585 45.2244 23.4803 45.3086 23.0635C45.3624 22.7859 45.3896 22.3732 45.3896 21.8252C45.3896 21.1539 45.336 20.6561 45.2285 20.3311C45.0751 19.8759 44.7078 19.5988 44.126 19.498C44.011 19.4828 43.7353 19.4746 43.2988 19.4746H40.6035V24.0947Z", fill: "white" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M30.45 18.2337C32.2095 18.2337 33.7797 19.0456 34.8119 20.3173L35.7314 18.3424C34.2933 16.9808 32.336 16.1413 30.1772 16.1413C26.8159 16.1413 23.9406 18.1748 22.7605 21.0533H20.9674L19.9087 23.3269H22.2154C22.1981 23.5378 22.1869 23.7489 22.1869 23.9643C22.1869 24.2249 22.2004 24.4824 22.2262 24.7369H21.0669L20.0083 27.0113H22.8155C24.0293 29.8169 26.8686 31.7866 30.1772 31.7866C31.8445 31.7866 33.3917 31.2862 34.6727 30.4314V27.644C33.6411 28.8205 32.1322 29.564 30.45 29.564C28.4837 29.564 26.754 28.5484 25.7468 27.0113H31.6253L32.6838 24.7369H24.8819C24.8417 24.4632 24.8202 24.1835 24.8202 23.8986C24.8202 23.706 24.8302 23.5153 24.8486 23.3269H33.3399L34.3985 21.0533H25.583C26.5579 19.3679 28.3721 18.2337 30.45 18.2337", fill: "#FFBE00" })] }));
18523
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "#10298E", stroke: "#D9D9D9" }), jsx("path", { d: "M12.7744 16.084C14.4396 16.084 15.6264 16.1801 16.334 16.3701C18.0609 16.8349 18.9248 18.137 18.9248 20.2764C18.9248 20.4518 18.9113 20.714 18.8857 21.0645H14.918C14.918 20.4123 14.8407 19.9748 14.6885 19.752C14.4524 19.4222 13.801 19.2569 12.7344 19.2568C11.6983 19.2568 11.0109 19.3519 10.6758 19.542C10.3409 19.7327 10.1729 20.1477 10.1729 20.7861C10.1729 21.3638 10.3217 21.7443 10.6191 21.9268C10.8324 22.0562 11.1145 22.1325 11.4658 22.1553L12.2656 22.2119C13.9806 22.3259 15.0521 22.4065 15.4795 22.4521C16.8358 22.5891 17.8195 22.9497 18.4297 23.5352C18.9098 23.992 19.1958 24.5898 19.2871 25.3271C19.3405 25.7681 19.3672 26.267 19.3672 26.8213C19.3672 28.0993 19.2457 29.0356 19.002 29.6289C18.5601 30.7174 17.5669 31.4046 16.0225 31.6934C15.3754 31.8154 14.3858 31.8769 13.0547 31.877C10.8322 31.877 9.28274 31.7449 8.4082 31.4785C7.33499 31.1522 6.6276 30.4905 6.28516 29.4951C6.09445 28.941 6.00001 28.0182 6 26.7266H9.96875C9.96875 26.8706 9.96875 26.9808 9.96875 27.0566C9.96876 27.746 10.1668 28.1893 10.5615 28.3867C10.8351 28.5229 11.1654 28.594 11.5537 28.6025H13.0127C13.7572 28.6025 14.2325 28.5649 14.4375 28.4883C14.8023 28.3446 15.0418 28.1131 15.1562 27.793C15.217 27.596 15.247 27.3411 15.2471 27.0293C15.2471 26.3303 14.992 25.9045 14.4834 25.752C14.2928 25.6917 13.4079 25.6075 11.8291 25.501C10.5609 25.4103 9.67998 25.3228 9.18652 25.2383C7.88722 24.9948 7.02094 24.4944 6.58887 23.7344C6.20918 23.0886 6.01956 22.1116 6.01953 20.8047C6.01953 19.8092 6.12198 19.0105 6.32715 18.4102C6.53252 17.8097 6.86368 17.3538 7.32031 17.042C7.98917 16.5635 8.84498 16.2823 9.88672 16.1982C10.7538 16.1225 11.7164 16.084 12.7744 16.084ZM44.2861 16C45.3761 16 46.2079 16.0894 46.7793 16.2676C48.0865 16.6779 48.9639 17.5176 49.4131 18.7871C49.645 19.4533 49.7607 20.4565 49.7607 21.7959C49.7607 23.4063 49.6323 24.564 49.3779 25.2686C48.8682 26.6618 47.8187 27.4648 46.2344 27.6729C46.048 27.7041 45.2548 27.7316 43.8555 27.7539L43.1475 27.7773H40.6045V31.877H36.3389V16H44.2861ZM64 31.877H59.6787L58.8652 29.1328H53.1621L52.3955 31.877H47.9824L52.7441 16H59.1787L64 31.877ZM54.0801 26.04H58.0186L56.0195 19.1572L54.0801 26.04ZM40.6035 24.0947H43.2627C44.1059 24.0643 44.6191 23.9992 44.8037 23.8975C45.0556 23.7585 45.2244 23.4803 45.3086 23.0635C45.3624 22.7859 45.3896 22.3732 45.3896 21.8252C45.3896 21.1539 45.336 20.6561 45.2285 20.3311C45.0751 19.8759 44.7078 19.5988 44.126 19.498C44.011 19.4828 43.7353 19.4746 43.2988 19.4746H40.6035V24.0947Z", fill: "white" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M30.45 18.2337C32.2095 18.2337 33.7797 19.0456 34.8119 20.3173L35.7314 18.3424C34.2933 16.9808 32.336 16.1413 30.1772 16.1413C26.8159 16.1413 23.9406 18.1748 22.7605 21.0533H20.9674L19.9087 23.3269H22.2154C22.1981 23.5378 22.1869 23.7489 22.1869 23.9643C22.1869 24.2249 22.2004 24.4824 22.2262 24.7369H21.0669L20.0083 27.0113H22.8155C24.0293 29.8169 26.8686 31.7866 30.1772 31.7866C31.8445 31.7866 33.3917 31.2862 34.6727 30.4314V27.644C33.6411 28.8205 32.1322 29.564 30.45 29.564C28.4837 29.564 26.754 28.5484 25.7468 27.0113H31.6253L32.6838 24.7369H24.8819C24.8417 24.4632 24.8202 24.1835 24.8202 23.8986C24.8202 23.706 24.8302 23.5153 24.8486 23.3269H33.3399L34.3985 21.0533H25.583C26.5579 19.3679 28.3721 18.2337 30.45 18.2337", fill: "#FFBE00" })] }));
19124
18524
  };
19125
18525
 
19126
- const IDeal = ({ className }) => {
19127
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.0266 9.91185H35.684C47.003 9.91185 51.3527 16.0977 51.3527 23.9167C51.3527 33.2698 45.273 37.9711 35.684 37.9711H19.0266V9.91185ZM20.6082 11.5944V36.3875H35.6838C44.7786 36.3875 49.7215 32.1316 49.7215 23.9662C49.7215 15.5534 44.3832 11.5944 35.6838 11.5944H20.6082ZM25.0568 24.4115C26.722 24.4115 28.072 23.06 28.072 21.3928C28.072 19.7256 26.722 18.3741 25.0568 18.3741C23.3916 18.3741 22.0417 19.7256 22.0417 21.3928C22.0417 23.06 23.3916 24.4115 25.0568 24.4115ZM22.635 25.6982H27.479V34.309H22.635V25.6982Z", fill: "black" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M44.2351 18.6216H45.6191V22.7785H47.6456C47.1019 15.207 41.1211 13.5244 35.684 13.5244H29.9009V18.6216H30.7412C32.3229 18.6216 33.262 19.6608 33.262 21.3929C33.262 23.1249 32.3229 24.1641 30.7906 24.1641H29.9009V34.309H35.684C44.5317 34.309 47.5468 30.2016 47.6951 24.1641H44.2351V18.6216ZM37.5623 22.7785V24.1641H34.1023V18.6216H37.4634V20.0072H35.4863V20.6505H37.3646V22.0362H35.5357V22.7785H37.5623ZM39.8358 18.6216H41.813L43.4935 24.1641H42.0601L41.7635 23.1249H39.9347L39.6381 24.1641H38.1553L39.8358 18.6216ZM40.3456 21.6898H40.3302V21.7393L40.3456 21.6898ZM40.3456 21.6898H41.3188L40.8739 20.1557H40.8245L40.3456 21.6898ZM29.9009 22.7785V20.0072H30.7412C31.2849 20.0072 31.878 20.1557 31.878 21.3929C31.878 22.63 31.3343 22.7785 30.7412 22.7785H29.9009Z", fill: "#D50072" })] }));
18526
+ const Visa = ({ className }) => {
18527
+ return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M21.2505 32.5165H17.0099L13.8299 20.3847C13.679 19.8267 13.3585 19.3333 12.8871 19.1008C11.7106 18.5165 10.4142 18.0514 9 17.8169V17.3498H15.8313C16.7742 17.3498 17.4813 18.0514 17.5991 18.8663L19.2491 27.6173L23.4877 17.3498H27.6104L21.2505 32.5165ZM29.9675 32.5165H25.9626L29.2604 17.3498H33.2653L29.9675 32.5165ZM38.4467 21.5514C38.5646 20.7346 39.2717 20.2675 40.0967 20.2675C41.3931 20.1502 42.8052 20.3848 43.9838 20.9671L44.6909 17.7016C43.5123 17.2345 42.216 17 41.0395 17C37.1524 17 34.3239 19.1008 34.3239 22.0165C34.3239 24.2346 36.3274 25.3992 37.7417 26.1008C39.2717 26.8004 39.861 27.2675 39.7431 27.9671C39.7431 29.0165 38.5646 29.4836 37.3881 29.4836C35.9739 29.4836 34.5596 29.1338 33.2653 28.5494L32.5582 31.8169C33.9724 32.3992 35.5025 32.6338 36.9167 32.6338C41.2752 32.749 43.9838 30.6502 43.9838 27.5C43.9838 23.5329 38.4467 23.3004 38.4467 21.5514ZM58 32.5165L54.82 17.3498H51.4044C50.6972 17.3498 49.9901 17.8169 49.7544 18.5165L43.8659 32.5165H47.9887L48.8116 30.3004H53.8772L54.3486 32.5165H58ZM51.9936 21.4342L53.1701 27.1502H49.8723L51.9936 21.4342Z", fill: "#172B85" })] }));
19128
18528
  };
19129
18529
 
19130
- const Bancontact = ({ className }) => {
19131
- return (jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.2243 35.1715C18.2243 34.882 18.156 34.6314 18.0199 34.4199C17.8835 34.2083 17.7043 34.0468 17.4819 33.9355C17.7043 33.8242 17.8766 33.6597 17.9991 33.4426C18.1214 33.2255 18.1825 32.9806 18.1825 32.7078V32.5575C18.1825 32.2233 18.1186 31.9451 17.9908 31.7223C17.8628 31.4996 17.6833 31.3213 17.4526 31.1878C17.2219 31.0541 16.9451 30.9582 16.6227 30.8995C16.3 30.8411 15.9414 30.812 15.5465 30.812C15.4131 30.812 15.274 30.8147 15.1296 30.8203C14.9848 30.8258 14.8445 30.8328 14.7083 30.8411C14.572 30.8494 14.4468 30.8593 14.3329 30.8704C14.2188 30.8817 14.1256 30.8928 14.0534 30.9037C13.8921 30.9318 13.7781 30.9817 13.7114 31.0541C13.6448 31.1266 13.6113 31.2575 13.6113 31.4467V36.5245C13.6113 36.7139 13.646 36.8447 13.7156 36.917C13.7851 36.9895 13.9032 37.0394 14.0702 37.0673C14.1535 37.084 14.2536 37.0979 14.3704 37.1091C14.4871 37.1202 14.6136 37.1299 14.7499 37.1383C14.8862 37.1466 15.0265 37.1535 15.1711 37.1593C15.3158 37.1646 15.4575 37.1676 15.5966 37.1676C15.9581 37.1676 16.2986 37.1397 16.6185 37.084C16.9381 37.0285 17.2161 36.9295 17.4526 36.7874C17.689 36.6456 17.8766 36.4534 18.0157 36.2113C18.1546 35.969 18.2243 35.6642 18.2243 35.2967V35.1715ZM16.8063 32.7746C16.8063 32.8637 16.7924 32.9487 16.7645 33.0293C16.7366 33.11 16.6909 33.1795 16.627 33.2383C16.5629 33.2966 16.4768 33.3439 16.3684 33.38C16.2599 33.4162 16.1222 33.4343 15.9554 33.4343H15.0213V31.9895C15.049 31.9895 15.0921 31.9883 15.1505 31.9853C15.2089 31.9825 15.27 31.9812 15.3339 31.9812H15.6551C16.0833 31.9812 16.3822 32.0354 16.5518 32.144C16.7214 32.2526 16.8063 32.421 16.8063 32.6492V32.7746ZM16.5935 35.8062C16.7576 35.6782 16.8397 35.4971 16.8397 35.2634V35.1714C16.8397 34.971 16.7756 34.797 16.6478 34.6494C16.5198 34.502 16.289 34.4282 15.9554 34.4282H15.0213V35.9898H15.1671C15.231 35.9898 15.2977 35.9916 15.3673 35.9942C15.4368 35.9969 15.5035 35.9985 15.5676 35.9985H15.7051C16.1333 35.9985 16.4295 35.9343 16.5935 35.8062ZM22.7955 33.9438C22.7955 33.6377 22.7496 33.3772 22.6578 33.1629C22.5662 32.9487 22.4368 32.7732 22.27 32.6367C22.1032 32.5004 21.8988 32.4003 21.6568 32.3362C21.415 32.2722 21.1439 32.2401 20.8436 32.2401C20.5654 32.2401 20.2943 32.2597 20.0303 32.2987C19.766 32.3375 19.556 32.3766 19.4005 32.4154C19.2948 32.4435 19.242 32.5046 19.242 32.5991V33.2756C19.242 33.3314 19.2559 33.3705 19.2837 33.3925C19.3115 33.4149 19.3475 33.4261 19.3922 33.4261H19.4337C19.5006 33.4204 19.5839 33.4135 19.684 33.4051C19.7842 33.3968 19.8968 33.3901 20.022 33.3842C20.1471 33.3788 20.2777 33.3746 20.414 33.3717C20.5501 33.3689 20.6851 33.3675 20.8186 33.3675C21.0131 33.3675 21.1661 33.4038 21.2773 33.4761C21.3885 33.5486 21.4441 33.7045 21.4441 33.9438V34.2445H20.9937C20.2763 34.2445 19.7549 34.3572 19.4296 34.5827C19.1043 34.8081 18.9416 35.1659 18.9416 35.6558V35.7313C18.9416 36.0039 18.982 36.2321 19.0625 36.4158C19.1431 36.5996 19.2503 36.7472 19.3837 36.8587C19.5172 36.9699 19.6686 37.0493 19.8384 37.0964C20.008 37.1438 20.1846 37.1676 20.3681 37.1676C20.6184 37.1676 20.8339 37.1341 21.0145 37.0673C21.1952 37.0005 21.3662 36.9086 21.5276 36.7917V36.9253C21.5276 36.9699 21.5442 37.0089 21.5776 37.0422C21.6111 37.0756 21.6499 37.0923 21.6944 37.0923H22.6287C22.6731 37.0923 22.712 37.0756 22.7455 37.0422C22.7789 37.0089 22.7955 36.9699 22.7955 36.9253V33.9438ZM21.1481 36.0942C21.2619 36.0581 21.3691 36.015 21.4692 35.9648V35.0462H20.9937C20.8491 35.0462 20.7296 35.0587 20.635 35.0837C20.5404 35.1088 20.4653 35.1465 20.4098 35.1966C20.3542 35.2465 20.3152 35.3107 20.2931 35.3886C20.2707 35.4666 20.2596 35.5556 20.2596 35.6558V35.7312C20.2596 35.9092 20.3026 36.0233 20.3889 36.0734C20.4751 36.1235 20.6071 36.1485 20.7852 36.1485C20.913 36.1485 21.0339 36.1306 21.1481 36.0942ZM27.9007 36.917V34.1358C27.9007 33.8744 27.8799 33.6278 27.8381 33.3968C27.7964 33.166 27.7214 32.9653 27.6129 32.7954C27.5045 32.6256 27.3543 32.4905 27.1624 32.3904C26.9707 32.2902 26.7245 32.2401 26.4242 32.2401C26.1572 32.2401 25.9208 32.2723 25.7152 32.3369C25.5094 32.4014 25.2925 32.515 25.0646 32.6776V32.4752C25.0646 32.4305 25.0478 32.3911 25.0145 32.3575C24.9811 32.3238 24.9421 32.3068 24.8976 32.3068H23.9634C23.9187 32.3068 23.8799 32.3235 23.8467 32.357C23.8133 32.3904 23.7966 32.4295 23.7966 32.4739V36.917C23.7966 36.9615 23.8145 37.0019 23.8508 37.038C23.8869 37.0743 23.9272 37.0923 23.9717 37.0923H24.9811C25.0256 37.0923 25.0646 37.0743 25.0978 37.0382C25.1313 37.0021 25.1479 36.9619 25.1479 36.9173V33.6341C25.2925 33.5564 25.4287 33.4925 25.5567 33.4426C25.6845 33.3925 25.8096 33.3675 25.932 33.3675C26.0599 33.3675 26.1642 33.38 26.2449 33.4051C26.3254 33.4301 26.388 33.4731 26.4325 33.5345C26.477 33.5954 26.5076 33.6759 26.5243 33.7757C26.5409 33.8758 26.5494 33.9981 26.5494 34.1425V36.9173C26.5494 36.9619 26.566 37.0021 26.5994 37.0382C26.6327 37.0743 26.6715 37.0923 26.7162 37.0923H27.7255C27.7699 37.0923 27.8102 37.0743 27.8464 37.038C27.8826 37.0019 27.9007 36.9615 27.9007 36.917ZM32.0047 36.1071V36.8502C32.0047 36.9114 31.9907 36.9546 31.963 36.9796C31.9351 37.0047 31.8906 37.0255 31.8294 37.0422C31.7127 37.0701 31.5611 37.0978 31.3749 37.1259C31.1885 37.1535 30.9703 37.1676 30.72 37.1676C30.1305 37.1676 29.6592 36.9867 29.3062 36.6246C28.953 36.2628 28.7765 35.7394 28.7765 35.0546V34.3531C28.7765 33.6682 28.953 33.1448 29.3062 32.7831C29.6592 32.421 30.1305 32.2401 30.72 32.2401C30.9703 32.2401 31.1885 32.254 31.3749 32.2817C31.5611 32.3098 31.7127 32.3375 31.8294 32.3653C31.8906 32.3819 31.9351 32.4029 31.963 32.4279C31.9907 32.453 32.0047 32.4962 32.0047 32.5574V33.3007C32.0047 33.3453 31.9893 33.38 31.9588 33.4051C31.9281 33.4301 31.8906 33.4426 31.8462 33.4426H31.8294C31.6737 33.4261 31.5251 33.4121 31.3832 33.401C31.2413 33.3901 31.0508 33.3842 30.8118 33.3842C30.7172 33.3842 30.6283 33.3996 30.5448 33.4301C30.4613 33.4608 30.3891 33.5137 30.328 33.5888C30.2666 33.6641 30.2181 33.7641 30.1819 33.8895C30.1457 34.0147 30.1277 34.1692 30.1277 34.3531V35.0546C30.1277 35.2382 30.1457 35.3927 30.1819 35.5181C30.2181 35.6433 30.2666 35.7436 30.328 35.8187C30.3891 35.8939 30.4613 35.9468 30.5448 35.9774C30.6283 36.008 30.7172 36.0233 30.8118 36.0233C31.0508 36.0233 31.2413 36.0178 31.3832 36.0067C31.5251 35.9956 31.6737 35.9815 31.8294 35.9649H31.8462C31.8906 35.9649 31.9281 35.9774 31.9588 36.0025C31.9893 36.0276 32.0047 36.0623 32.0047 36.1071ZM36.6346 34.4115C36.6346 34.0773 36.5885 33.7768 36.4966 33.5095C36.4046 33.2423 36.2709 33.0155 36.0954 32.8289C35.9199 32.6424 35.7025 32.4976 35.4436 32.3946C35.1844 32.2918 34.8848 32.2401 34.5449 32.2401C34.2051 32.2401 33.9056 32.2918 33.6465 32.3946C33.3873 32.4976 33.1685 32.6424 32.9903 32.8289C32.8119 33.0155 32.6768 33.2423 32.585 33.5095C32.4928 33.7768 32.4469 34.0773 32.4469 34.4115V34.9961C32.4469 35.3301 32.4928 35.6309 32.585 35.8981C32.6768 36.1653 32.8119 36.3922 32.9903 36.5788C33.1685 36.7654 33.3873 36.91 33.6465 37.013C33.9056 37.1159 34.2051 37.1676 34.5449 37.1676C34.8848 37.1676 35.1844 37.1159 35.4436 37.013C35.7025 36.91 35.9199 36.7654 36.0954 36.5788C36.2709 36.3922 36.4046 36.1653 36.4966 35.8981C36.5885 35.6309 36.6346 35.3301 36.6346 34.9961V34.4115ZM34.5449 36.0233C35.037 36.0233 35.2832 35.6809 35.2832 34.9961V34.4115C35.2832 33.7322 35.037 33.3925 34.5449 33.3925C34.3016 33.3925 34.1164 33.4774 33.9893 33.6472C33.8619 33.8172 33.7984 34.0719 33.7984 34.4115V34.9961C33.7984 35.3357 33.8619 35.5918 33.9893 35.7644C34.1164 35.9371 34.3016 36.0233 34.5449 36.0233ZM41.5976 36.917V34.1358C41.5976 33.8744 41.5765 33.6278 41.5351 33.3968C41.4933 33.166 41.4181 32.9653 41.3095 32.7954C41.2011 32.6256 41.0511 32.4905 40.8593 32.3904C40.6674 32.2902 40.4213 32.2401 40.1211 32.2401C39.8542 32.2401 39.6177 32.2723 39.4119 32.3369C39.2062 32.4014 38.9893 32.515 38.7613 32.6776V32.4752C38.7613 32.4305 38.7447 32.3911 38.7111 32.3575C38.678 32.3238 38.6389 32.3068 38.5945 32.3068H37.6602C37.6157 32.3068 37.5769 32.3235 37.5434 32.357C37.5102 32.3904 37.4934 32.4295 37.4934 32.4739V36.917C37.4934 36.9615 37.5114 37.0019 37.5476 37.038C37.5838 37.0743 37.624 37.0923 37.6687 37.0923H38.678C38.7224 37.0923 38.7613 37.0743 38.7948 37.0382C38.828 37.0021 38.8448 36.9619 38.8448 36.9173V33.6341C38.9893 33.5564 39.1256 33.4925 39.2534 33.4426C39.3815 33.3925 39.5065 33.3675 39.629 33.3675C39.7568 33.3675 39.8611 33.38 39.9416 33.4051C40.0222 33.4301 40.0849 33.4731 40.1294 33.5345C40.1739 33.5954 40.2044 33.6759 40.2212 33.7757C40.2378 33.8758 40.2462 33.9981 40.2462 34.1425V36.9173C40.2462 36.9619 40.2628 37.0021 40.2962 37.0382C40.3296 37.0743 40.3684 37.0923 40.413 37.0923H41.4223C41.4668 37.0923 41.5072 37.0743 41.5434 37.038C41.5794 37.0019 41.5976 36.9615 41.5976 36.917ZM45.2348 36.2893V36.9357C45.2348 37.0295 45.182 37.0848 45.0763 37.1011C44.9483 37.1233 44.8371 37.1398 44.7427 37.1509C44.6481 37.162 44.5395 37.1675 44.4174 37.1675C44.1905 37.1675 43.9901 37.1493 43.816 37.1133C43.6419 37.077 43.4966 37.0061 43.3805 36.9003C43.2646 36.7945 43.1761 36.6483 43.1153 36.4617C43.0547 36.2753 43.0242 36.0347 43.0242 35.7394V33.3175L42.357 33.2088C42.3123 33.1977 42.2721 33.1769 42.2359 33.1462C42.1997 33.1157 42.1817 33.0781 42.1817 33.0335V32.4822C42.1817 32.4378 42.1997 32.3974 42.2359 32.3611C42.2721 32.325 42.3123 32.3068 42.357 32.3068H43.0242V31.622C43.0242 31.5774 43.0409 31.5414 43.0739 31.5134C43.1068 31.4857 43.1458 31.4663 43.1902 31.455L44.2016 31.2798H44.2263C44.2705 31.2798 44.3065 31.2921 44.3343 31.3171C44.3618 31.3423 44.3757 31.3771 44.3757 31.4215V32.3068H45.0597C45.104 32.3068 45.143 32.3237 45.1764 32.3573C45.2099 32.3909 45.2265 32.4305 45.2265 32.4752V33.1573C45.2265 33.2024 45.2099 33.2416 45.1764 33.2752C45.143 33.3089 45.104 33.3257 45.0597 33.3257H44.3757V35.7561C44.3757 35.9231 44.3895 36.0304 44.4174 36.0776C44.4451 36.1249 44.5229 36.1485 44.6507 36.1485H45.0597C45.1764 36.1485 45.2348 36.1955 45.2348 36.2893ZM49.6891 33.9438C49.6891 33.6377 49.6433 33.3772 49.5514 33.1629C49.4597 32.9487 49.3305 32.7732 49.1637 32.6367C48.9969 32.5004 48.7925 32.4003 48.5505 32.3362C48.3087 32.2722 48.0376 32.2401 47.7373 32.2401C47.4589 32.2401 47.188 32.2597 46.924 32.2987C46.6597 32.3375 46.4497 32.3766 46.2942 32.4154C46.1882 32.4435 46.1357 32.5046 46.1357 32.5991V33.2756C46.1357 33.3314 46.1494 33.3705 46.1773 33.3925C46.2052 33.4149 46.2412 33.4261 46.2857 33.4261H46.3274C46.3943 33.4204 46.4776 33.4135 46.5777 33.4051C46.6779 33.3968 46.7905 33.3901 46.9155 33.3842C47.0408 33.3788 47.1714 33.3746 47.3077 33.3717C47.4438 33.3689 47.5788 33.3675 47.7121 33.3675C47.9068 33.3675 48.0598 33.4038 48.171 33.4761C48.2822 33.5486 48.3378 33.7045 48.3378 33.9438V34.2445H47.8874C47.1698 34.2445 46.6486 34.3572 46.3233 34.5827C45.998 34.8081 45.8353 35.1659 45.8353 35.6558V35.7313C45.8353 36.0039 45.8755 36.2321 45.9562 36.4158C46.0366 36.5996 46.144 36.7472 46.2774 36.8587C46.4109 36.9699 46.5623 37.0493 46.7321 37.0964C46.9017 37.1438 47.0782 37.1676 47.2618 37.1676C47.5121 37.1676 47.7274 37.1341 47.9082 37.0673C48.0889 37.0005 48.2597 36.9086 48.4213 36.7917V36.9253C48.4213 36.9699 48.4379 37.0089 48.4713 37.0422C48.5046 37.0756 48.5436 37.0923 48.5881 37.0923H49.5224C49.5668 37.0923 49.6057 37.0756 49.6392 37.0422C49.6724 37.0089 49.6891 36.9699 49.6891 36.9253V33.9438ZM48.0418 36.0942C48.1556 36.0581 48.2628 36.015 48.3629 35.9648V35.0462H47.8874C47.7428 35.0462 47.6233 35.0587 47.5287 35.0837C47.4341 35.1088 47.359 35.1465 47.3035 35.1966C47.2477 35.2465 47.2088 35.3107 47.1868 35.3886C47.1644 35.4666 47.1533 35.5556 47.1533 35.6558V35.7312C47.1533 35.9092 47.1963 36.0233 47.2826 36.0734C47.3688 36.1235 47.5008 36.1485 47.6789 36.1485C47.8067 36.1485 47.9274 36.1306 48.0418 36.0942ZM53.7933 36.8502V36.1071C53.7933 36.0623 53.7779 36.0276 53.7474 36.0025C53.7167 35.9774 53.6793 35.9649 53.6348 35.9649H53.6181C53.4624 35.9815 53.3136 35.9956 53.1718 36.0067C53.0301 36.0178 52.8395 36.0233 52.6005 36.0233C52.5057 36.0233 52.4167 36.008 52.3336 35.9774C52.2501 35.9468 52.1777 35.8939 52.1165 35.8187C52.0554 35.7436 52.0067 35.6433 51.9707 35.5181C51.9343 35.3927 51.9165 35.2382 51.9165 35.0546V34.3531C51.9165 34.1692 51.9343 34.0147 51.9707 33.8895C52.0067 33.7641 52.0554 33.6641 52.1165 33.5888C52.1777 33.5137 52.2501 33.4608 52.3336 33.4301C52.4167 33.3996 52.5057 33.3842 52.6005 33.3842C52.8395 33.3842 53.0301 33.3901 53.1718 33.401C53.3136 33.4121 53.4624 33.4261 53.6181 33.4426H53.6348C53.6793 33.4426 53.7167 33.4301 53.7474 33.4051C53.7779 33.38 53.7933 33.3453 53.7933 33.3007V32.5574C53.7933 32.4962 53.7794 32.453 53.7515 32.4279C53.7235 32.4029 53.6793 32.3819 53.6181 32.3653C53.5014 32.3375 53.3497 32.3098 53.1635 32.2817C52.9771 32.254 52.759 32.2401 52.5087 32.2401C51.9189 32.2401 51.4479 32.421 51.0947 32.7831C50.7415 33.1448 50.565 33.6682 50.565 34.3531V35.0546C50.565 35.7394 50.7415 36.2628 51.0947 36.6246C51.4479 36.9867 51.9189 37.1676 52.5087 37.1676C52.759 37.1676 52.9771 37.1535 53.1635 37.1259C53.3497 37.0978 53.5014 37.0701 53.6181 37.0422C53.6793 37.0255 53.7235 37.0047 53.7515 36.9796C53.7794 36.9546 53.7933 36.9114 53.7933 36.8502ZM57.3884 36.2893V36.9357C57.3884 37.0295 57.3354 37.0848 57.2299 37.1011C57.1019 37.1233 56.9907 37.1398 56.8963 37.1509C56.8016 37.162 56.6931 37.1675 56.571 37.1675C56.3441 37.1675 56.1437 37.1493 55.9696 37.1133C55.7954 37.077 55.6502 37.0061 55.5343 36.9003C55.4183 36.7945 55.3298 36.6483 55.269 36.4617C55.2083 36.2753 55.1778 36.0347 55.1778 35.7394V33.3175L54.5106 33.2088C54.4659 33.1977 54.4257 33.1769 54.3895 33.1462C54.3533 33.1157 54.3353 33.0781 54.3353 33.0335V32.4822C54.3353 32.4378 54.3533 32.3974 54.3895 32.3611C54.4257 32.325 54.4659 32.3068 54.5106 32.3068H55.1778V31.622C55.1778 31.5774 55.1945 31.5414 55.2276 31.5134C55.2605 31.4857 55.2993 31.4663 55.3436 31.455L56.355 31.2798H56.38C56.4241 31.2798 56.4602 31.2921 56.4875 31.3171C56.5154 31.3423 56.5293 31.3771 56.5293 31.4215V32.3068H57.2133C57.2577 32.3068 57.2966 32.3237 57.3301 32.3573C57.3633 32.3909 57.3801 32.4305 57.3801 32.4752V33.1573C57.3801 33.2024 57.3633 33.2416 57.3301 33.2752C57.2966 33.3089 57.2577 33.3257 57.2133 33.3257H56.5293V35.7561C56.5293 35.9231 56.5431 36.0304 56.571 36.0776C56.5987 36.1249 56.6765 36.1485 56.8045 36.1485H57.2133C57.3301 36.1485 57.3884 36.1955 57.3884 36.2893Z", fill: "#005697" }), jsx("path", { d: "M52.6187 14.7398H39.0664L37.6881 16.2935L33.2155 21.3349V21.3351L31.8372 22.8886H18.464L19.821 21.3153L20.4633 20.5706L21.8202 18.9973H15.6582C14.5325 18.9973 13.6113 19.943 13.6113 21.0987V25.5326C13.6113 26.6885 14.5325 27.6342 15.6582 27.6342H39.2492C40.3749 27.6342 41.9127 26.9318 42.6665 26.0733L46.235 22.0097L52.6187 14.7398Z", fill: "#005697" }), jsx("path", { d: "M55.3418 10C56.4676 10 57.3887 10.9457 57.3887 12.1015V16.5353C57.3887 17.691 56.4676 18.6368 55.3418 18.6368H49.1999L50.5697 17.0753H50.5699L51.2491 16.3012L52.6189 14.7398H39.0667L31.8375 22.8945H18.3813L28.0314 11.9701L28.3966 11.5566C29.153 10.7005 30.6929 10 31.8186 10H55.3418V10Z", fill: "#FBD500" })] }));
19132
- };
18530
+ const CardImage_PaymentMethodFragment = t(`
18531
+ fragment CardImage_PaymentMethodFragment on PaymentMethod {
18532
+ metadata {
18533
+ issuer
18534
+ type
18535
+ }
18536
+ }
18537
+ `);
18538
+ function CardImage({ paymentMethod: maskedPaymentMethod, }) {
18539
+ var _a, _b, _c, _d;
18540
+ // Read fragment
18541
+ const paymentMethod = readFragment(CardImage_PaymentMethodFragment, maskedPaymentMethod);
18542
+ const issuer = (_b = (_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.metadata) === null || _a === void 0 ? void 0 : _a.issuer) === null || _b === void 0 ? void 0 : _b.toLowerCase();
18543
+ const type = (_d = (_c = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.metadata) === null || _c === void 0 ? void 0 : _c.type) === null || _d === void 0 ? void 0 : _d.toLowerCase();
18544
+ const className = 'w-12 h-8';
18545
+ if (type === 'cashapp') {
18546
+ return jsx(Cashapp$1, { className: className });
18547
+ }
18548
+ if (type === 'link') {
18549
+ return jsx(Cashapp, { className: className });
18550
+ }
18551
+ switch (issuer) {
18552
+ case 'visa':
18553
+ return jsx(Visa, { className: className });
18554
+ case 'mastercard':
18555
+ return jsx(Mastercard, { className: className });
18556
+ case 'amex':
18557
+ return jsx(Amex, { className: className });
18558
+ case 'jcb':
18559
+ return jsx(JCB, { className: className });
18560
+ case 'diners_club':
18561
+ case 'diners':
18562
+ return jsx(DinersClub, { className: className });
18563
+ case 'discover':
18564
+ return jsx(Discover, { className: className });
18565
+ case 'unionpay':
18566
+ case 'union_pay':
18567
+ case 'china_union_pay':
18568
+ case 'china_unionpay':
18569
+ return jsx(ChinaUnionPay, { className: className });
18570
+ case 'sepa':
18571
+ return jsx(Sepa, { className: className });
18572
+ case 'ideal':
18573
+ return jsx(IDeal, { className: className });
18574
+ case 'bancontact':
18575
+ return jsx(Bancontact, { className: className });
18576
+ default:
18577
+ return jsx(CreditCard, { className: className });
18578
+ }
18579
+ }
19133
18580
 
19134
18581
  const { Text: Text$z } = Typography;
19135
- const MiniCreditCard = ({ className, buttons, hideDropdownMenu = false, hideDefaultTag = false, onClickRemove, paymentMethodData, onClickSetDefault, id, }) => {
18582
+ const MiniCreditCard_PaymentMethodFragment = t(`
18583
+ fragment MiniCreditCard_PaymentMethodFragment on PaymentMethod {
18584
+ ...CardImage_PaymentMethodFragment
18585
+ isDefault
18586
+ metadata {
18587
+ issuer
18588
+ type
18589
+ identifier
18590
+ }
18591
+ id
18592
+ }
18593
+ `, [CardImage_PaymentMethodFragment]);
18594
+ function MiniCreditCard({ className, buttons, hideDropdownMenu = false, hideDefaultTag = false, onClickRemove, paymentMethod: maskedPaymentMethod, onClickSetDefault, id, }) {
18595
+ var _a, _b, _c;
19136
18596
  const { darkMode } = useContext(BunnyContext);
19137
18597
  const { brandColor } = useBrand();
18598
+ // Read fragment
18599
+ const paymentMethod = readFragment(MiniCreditCard_PaymentMethodFragment, maskedPaymentMethod);
19138
18600
  const borderColor = useMemo(() => {
19139
18601
  return darkMode ? 'border-slate-700' : 'border-slate-200';
19140
18602
  }, [darkMode]);
19141
18603
  const backgroundColor = useMemo(() => {
19142
18604
  return darkMode ? 'var(--row-background-alternate)' : 'bg-slate-50';
19143
18605
  }, [darkMode]);
19144
- const isDefault = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.isDefault;
19145
- return (jsx("div", { className: `bunny-flex bunny-flex-row bunny-justify-between bunny-items-center bunny-p-1 bunny-px-3 bunny-border-solid ${backgroundColor} bunny-${borderColor} bunny-rounded-md bunny-border ${className}`, id: id, children: paymentMethodData ? (jsxs(Fragment, { children: [jsx("div", { className: "bunny-flex bunny-flex-row bunny-gap-4", children: jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2 bunny-space-between bunny-w-full", children: [jsx(CardImage, { paymentMethodData: paymentMethodData }), jsx(Issuer, { paymentMethodData: paymentMethodData }), jsx(Identifier, { paymentMethodData: paymentMethodData }), !hideDefaultTag && (jsx("div", { children: isDefault ? (jsx(Tag, { bordered: false, style: { color: brandColor, backgroundColor: `${brandColor}30` }, children: "Default" })) : null }))] }) }), buttons ? (buttons) : (jsx(Fragment, { children: !hideDropdownMenu && (jsx(DropdownMenu, { setDefault: onClickSetDefault, remove: onClickRemove, isDefault: isDefault !== null && isDefault !== void 0 ? isDefault : false, id: `credit-card-dropdown-${paymentMethodData.id}` })) }))] })) : (jsxs("div", { className: "bunny-flex bunny-flex-row bunny-items-center justify-between w-full", children: [jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-center", children: [jsx(CreditCardOutlined, {}), jsx(Text$z, { className: "bunny-text-slate-400 bunny-text-sm", children: "No payment methods" })] }), jsx(Button, { disabled: true, type: "link" }), buttons] })) }));
19146
- };
19147
- const Identifier = ({ paymentMethodData }) => {
19148
- var _a, _b, _c;
19149
- if (((_a = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _a === void 0 ? void 0 : _a.type) === 'link') {
18606
+ const isDefault = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.isDefault;
18607
+ return (jsx("div", { className: `bunny-flex bunny-flex-row bunny-justify-between bunny-items-center bunny-p-1 bunny-px-3 bunny-border-solid ${backgroundColor} bunny-${borderColor} bunny-rounded-md bunny-border ${className}`, id: id, children: paymentMethod ? (jsxs(Fragment, { children: [jsx("div", { className: "bunny-flex bunny-flex-row bunny-gap-4", children: jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2 bunny-space-between bunny-w-full", children: [jsx(CardImage, { paymentMethod: paymentMethod }), jsx(Issuer, { issuer: (_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.metadata) === null || _a === void 0 ? void 0 : _a.issuer }), jsx(Identifier, { type: (_b = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.metadata) === null || _b === void 0 ? void 0 : _b.type, identifier: (_c = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.metadata) === null || _c === void 0 ? void 0 : _c.identifier }), !hideDefaultTag && (jsx("div", { children: isDefault ? (jsx(Tag, { bordered: false, style: { color: brandColor, backgroundColor: `${brandColor}30` }, children: "Default" })) : null }))] }) }), buttons ? (buttons) : (jsx(Fragment, { children: !hideDropdownMenu && (jsx(DropdownMenu, { setDefault: onClickSetDefault, remove: onClickRemove, isDefault: isDefault !== null && isDefault !== void 0 ? isDefault : false, id: `credit-card-dropdown-${paymentMethod.id}` })) }))] })) : (jsxs("div", { className: "bunny-flex bunny-flex-row bunny-items-center justify-between w-full", children: [jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-center", children: [jsx(CreditCardOutlined, {}), jsx(Text$z, { className: "bunny-text-slate-400 bunny-text-sm", children: "No payment methods" })] }), jsx(Button, { disabled: true, type: "link" }), buttons] })) }));
18608
+ }
18609
+ const Identifier = ({ type, identifier, }) => {
18610
+ if (type === 'link') {
19150
18611
  return null;
19151
18612
  }
19152
- if (((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.type) === 'cashapp') {
18613
+ if (type === 'cashapp') {
19153
18614
  return jsx(Text$z, { children: "Cashapp" });
19154
18615
  }
19155
- return (jsxs("div", { children: [jsx(Text$z, { className: "relative -top-0.5", children: "****" }), jsx(Text$z, { children: (_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.identifier })] }));
18616
+ return (jsxs("div", { children: [jsx(Text$z, { className: "relative -top-0.5", children: "****" }), jsx(Text$z, { children: identifier })] }));
19156
18617
  };
19157
- const Issuer = ({ paymentMethodData }) => {
19158
- var _a;
18618
+ const Issuer = ({ issuer }) => {
19159
18619
  const list = ['visa', 'link', 'jcb', 'discover', 'sepa'];
19160
- const issuer = (_a = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _a === void 0 ? void 0 : _a.issuer;
19161
- if (issuer.length == 0 || list.includes(issuer.toLowerCase()))
18620
+ if (!issuer || issuer.length == 0 || list.includes(issuer === null || issuer === void 0 ? void 0 : issuer.toLowerCase()))
19162
18621
  return null;
19163
18622
  return jsx(Text$z, { children: lodashExports.capitalize(issuer) });
19164
18623
  };
@@ -19185,170 +18644,1065 @@ const DropdownMenu = ({ setDefault, remove, isDefault, id, }) => {
19185
18644
  ];
19186
18645
  return (jsx(Dropdown, { menu: { items }, trigger: ['click'], children: jsx("a", { onClick: e => e.preventDefault(), id: id, className: "cursor-pointer hover:bg-gray-100 rounded-md p-1", children: jsx(EllipsisOutlined, { style: { fontSize: '20px', color: brandColor } }) }) }));
19187
18646
  };
19188
- const CardImage = ({ paymentMethodData }) => {
19189
- var _a, _b;
19190
- const issuer = (((_a = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _a === void 0 ? void 0 : _a.issuer) || '').toLowerCase();
19191
- const type = (((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.type) || '').toLowerCase();
19192
- const className = 'w-12 h-8';
19193
- if (type === 'cashapp') {
19194
- return jsx(Cashapp$1, { className: className });
19195
- }
19196
- if (type === 'link') {
19197
- return jsx(Cashapp, { className: className });
19198
- }
19199
- switch (issuer) {
19200
- case 'visa':
19201
- return jsx(Visa, { className: className });
19202
- case 'mastercard':
19203
- return jsx(Mastercard, { className: className });
19204
- case 'amex':
19205
- return jsx(Amex, { className: className });
19206
- case 'jcb':
19207
- return jsx(JCB, { className: className });
19208
- case 'diners_club':
19209
- case 'diners':
19210
- return jsx(DinersClub, { className: className });
19211
- case 'discover':
19212
- return jsx(Discover, { className: className });
19213
- case 'unionpay':
19214
- case 'union_pay':
19215
- case 'china_union_pay':
19216
- case 'china_unionpay':
19217
- return jsx(ChinaUnionPay, { className: className });
19218
- case 'sepa':
19219
- return jsx(Sepa, { className: className });
19220
- case 'ideal':
19221
- return jsx(IDeal, { className: className });
19222
- case 'bancontact':
19223
- return jsx(Bancontact, { className: className });
19224
- default:
19225
- return jsx(CreditCard, { className: className });
18647
+
18648
+ const PaymentForm_PaymentMethodsFragment = t(`
18649
+ fragment PaymentForm_PaymentMethodsFragment on PaymentMethod {
18650
+ ...MiniCreditCard_PaymentMethodFragment
18651
+ id
19226
18652
  }
19227
- };
18653
+ `, [MiniCreditCard_PaymentMethodFragment]);
18654
+
18655
+ const QueryKeyFactory = {
18656
+ accountPaymentMethodsKey: ({ accountId, entityId, token }) => [
18657
+ 'accountPaymentMethods',
18658
+ ...(entityId ? [entityId] : []),
18659
+ ...(accountId ? [accountId] : []),
18660
+ ...(token ? [token] : []),
18661
+ ],
18662
+ billingDetailsKey: ({ entityId, token }) => [
18663
+ 'billingDetails',
18664
+ ...(entityId ? [entityId] : []),
18665
+ ...(token ? [token] : []),
18666
+ ],
18667
+ brandingKey: (token) => ['branding', ...(token ? [token] : [])],
18668
+ calculatedPricesKey: ({ priceListId, quantity, token }) => [
18669
+ 'calculatedPrices',
18670
+ ...(priceListId ? [priceListId] : []),
18671
+ ...(quantity ? [quantity] : []),
18672
+ ...(token ? [token] : []),
18673
+ ],
18674
+ createEventsKey: ({ entityId, pluralType, token }) => [
18675
+ pluralType,
18676
+ 'events',
18677
+ entityId,
18678
+ ...(token ? [token] : []),
18679
+ ],
18680
+ createFormattedInvoiceKey: ({ id, token }) => [
18681
+ 'formattedInvoice',
18682
+ id,
18683
+ ...(token ? [token] : []),
18684
+ ],
18685
+ createInvoiceKey: ({ id, token }) => ['invoice', id, token],
18686
+ createObjectKey: ({ id, objectName, token }) => [
18687
+ objectName,
18688
+ ...(id ? [id] : []),
18689
+ ...(token ? [token] : []),
18690
+ ],
18691
+ createQuoteKey: ({ id, token }) => ['quote', id, token],
18692
+ createQuoteTaxCalculateKey: ({ id, token }) => [
18693
+ 'quoteTaxCalculate',
18694
+ ...(id ? [id] : []),
18695
+ ...(token ? [token] : []),
18696
+ ],
18697
+ createTableKey: ({ filterString, pluralType, token }) => filterString ? [pluralType, 'list', filterString, token] : [pluralType, 'list', token],
18698
+ currentUserKey: (token) => ['currentUser', ...(token ? [token] : [])],
18699
+ editingQuoteKey: (token) => ['editingQuote', ...(token ? [token] : [])],
18700
+ finixAchKey: (token) => ['finixAchKey', ...(token ? [token] : [])],
18701
+ finixKey: (token) => ['finixKey', ...(token ? [token] : [])],
18702
+ planChangeOptionsKey: ({ subscriptionId, productId, token }) => [
18703
+ 'planChangeOptions',
18704
+ ...(subscriptionId ? [subscriptionId] : []),
18705
+ ...(productId ? [productId] : []),
18706
+ ...(token ? [token] : []),
18707
+ ],
18708
+ pluginsKey: (token) => ['plugins', ...(token ? [token] : [])],
18709
+ portalPreviewDataKey: ({ productId, token }) => [
18710
+ 'portalPreviewData',
18711
+ ...(productId ? [productId] : []),
18712
+ ...(token ? [token] : []),
18713
+ ],
18714
+ taxationRequiredAccountFieldsKey: ({ entityId, token, }) => [
18715
+ 'taxationRequiredAccountFields',
18716
+ ...(entityId ? [entityId] : []),
18717
+ ...(token ? [token] : []),
18718
+ ],
18719
+ transactionsKey: ({ filter, token }) => [
18720
+ 'transactions',
18721
+ ...(filter ? [filter] : []),
18722
+ ...(token ? [token] : []),
18723
+ ],
18724
+ availableAddonPlansKey: ({ priceListId, token, }) => ['availableAddonPlans', priceListId, ...(token ? [token] : [])],
18725
+ addonPlansKey: ({ priceListId, token }) => [
18726
+ 'addonPlans',
18727
+ priceListId,
18728
+ ...(token ? [token] : []),
18729
+ ],
18730
+ paymentPluginsKey: (token) => ['paymentPlugins', ...(token ? [token] : [])],
18731
+ };
18732
+
18733
+ const query$5 = t(`
18734
+ query PaymentMethods($accountId: ID) {
18735
+ paymentMethods(accountId: $accountId) {
18736
+ nodes {
18737
+ id
18738
+ pluginId
18739
+ accountId
18740
+ expirationDate
18741
+ plugin {
18742
+ guid
18743
+ id
18744
+ }
18745
+ state
18746
+ metadata {
18747
+ issuer
18748
+ identifier
18749
+ kind
18750
+ description
18751
+ icon
18752
+ type
18753
+ }
18754
+ isDefault
18755
+ ...PaymentForm_PaymentMethodsFragment
18756
+ }
18757
+ }
18758
+ }
18759
+ `, [PaymentForm_PaymentMethodsFragment]);
18760
+ const getPaymentMethods = async ({ apiHost, token, accountId, }) => {
18761
+ var _a, _b, _c;
18762
+ const response = await execute(query$5, { apiHost, token }, { accountId });
18763
+ // Filter out null values that are technically possible due to api schema
18764
+ return (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.paymentMethods) === null || _a === void 0 ? void 0 : _a.nodes) === null || _b === void 0 ? void 0 : _b.filter(paymentMethod => paymentMethod !== null)) !== null && _c !== void 0 ? _c : [];
18765
+ };
18766
+ const usePaymentMethod = ({ accountId, enabled = true, }) => {
18767
+ // Context
18768
+ const { apiHost } = useContext(BunnyContext);
18769
+ const token = useToken();
18770
+ // Query
18771
+ const { data, isLoading } = useQuery({
18772
+ queryKey: QueryKeyFactory.accountPaymentMethodsKey({
18773
+ accountId,
18774
+ token,
18775
+ }),
18776
+ queryFn: () => getPaymentMethods({ apiHost, token, accountId }),
18777
+ staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
18778
+ enabled,
18779
+ });
18780
+ return {
18781
+ paymentMethods: data,
18782
+ defaultPaymentMethod: data === null || data === void 0 ? void 0 : data.find(paymentMethod => paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.isDefault),
18783
+ isLoading,
18784
+ };
18785
+ };
18786
+
18787
+ const mutation$5 = t(`
18788
+ query PaymentPlugins($accountId: ID) {
18789
+ paymentPlugins(accountId: $accountId) {
18790
+ enabled
18791
+ entities
18792
+ guid
18793
+ hidden
18794
+ id
18795
+ name
18796
+ status
18797
+ type
18798
+ webhookEnabled
18799
+ components
18800
+ }
18801
+ }
18802
+ `);
18803
+ // components is json, but will look like this
18804
+ // components: {
18805
+ // frontend: {
18806
+ // name: string;
18807
+ // scenarios: string[];
18808
+ // }[];
18809
+ // backend: {
18810
+ // name: string;
18811
+ // access: string[];
18812
+ // }[];
18813
+ // };
18814
+ const getPaymentPlugins = async ({ apiHost, token, accountId, }) => {
18815
+ const response = await execute(mutation$5, { apiHost, token }, { accountId });
18816
+ return response === null || response === void 0 ? void 0 : response.paymentPlugins;
18817
+ };
18818
+ const usePaymentPlugins = (accountId) => {
18819
+ var _a;
18820
+ // Context
18821
+ const { apiHost } = useContext(BunnyContext);
18822
+ const token = useToken();
18823
+ // Query
18824
+ const { data: paymentPlugins, isFetched } = useQuery({
18825
+ queryKey: QueryKeyFactory.paymentPluginsKey(token),
18826
+ queryFn: () => getPaymentPlugins({ apiHost, token, accountId }),
18827
+ staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
18828
+ });
18829
+ // filter plugins
18830
+ const filteredPaymentPlugins = (_a = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.filter(plugin => { var _a, _b; return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'payment' && ((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'valid'; })) !== null && _a !== void 0 ? _a : [];
18831
+ return {
18832
+ paymentPlugins: filteredPaymentPlugins,
18833
+ isFetched,
18834
+ };
18835
+ };
18836
+
18837
+ var BreakpointNumbers;
18838
+ (function (BreakpointNumbers) {
18839
+ BreakpointNumbers[BreakpointNumbers["xs"] = 480] = "xs";
18840
+ BreakpointNumbers[BreakpointNumbers["sm"] = 768] = "sm";
18841
+ BreakpointNumbers[BreakpointNumbers["md"] = 992] = "md";
18842
+ BreakpointNumbers[BreakpointNumbers["lg"] = 1200] = "lg";
18843
+ BreakpointNumbers[BreakpointNumbers["xl"] = 1400] = "xl";
18844
+ BreakpointNumbers[BreakpointNumbers["xxl"] = 2000] = "xxl";
18845
+ })(BreakpointNumbers || (BreakpointNumbers = {}));
18846
+ const useIsMobile = (breakpointSize = BreakpointNumbers.sm) => {
18847
+ const [isMobile, setIsMobile] = useState(() => window.innerWidth < breakpointSize);
18848
+ useEffect(() => {
18849
+ const handleResize = () => {
18850
+ const newIsMobile = window.innerWidth < breakpointSize;
18851
+ setIsMobile(prev => (prev !== newIsMobile ? newIsMobile : prev));
18852
+ };
18853
+ window.addEventListener('resize', handleResize);
18854
+ return () => window.removeEventListener('resize', handleResize);
18855
+ }, [breakpointSize]);
18856
+ return isMobile;
18857
+ };
18858
+
18859
+ /**
18860
+ * Creates a context and provider for a state value
18861
+ * @param useValue - A function that returns the state value
18862
+ * @returns A tuple containing the provider and the context value
18863
+ * @example take a look at how this is used in the quoteIdContext in the QuantityDrawer
18864
+ */
18865
+ const createStateContext = (useValue) => {
18866
+ const StateContext = createContext(null);
18867
+ const StateProvider = ({ initialValue, children, }) => jsxs(StateContext.Provider, { value: useValue(initialValue), children: [" ", children, " "] });
18868
+ const useContextState = () => {
18869
+ const value = useContext(StateContext);
18870
+ if (value === null) {
18871
+ throw new Error('Provider missing');
18872
+ }
18873
+ return value;
18874
+ };
18875
+ return [StateProvider, useContextState];
18876
+ };
18877
+
18878
+ // Contexts
18879
+ const useSelectedPluginIdState = (id) => useState(id);
18880
+ const [SelectedPluginIdProvider, useSelectedPluginId] = createStateContext(useSelectedPluginIdState);
18881
+ const [SelectedPluginDataProvider, useSelectedPlugin] = createValueContext(); // TODO: type the response to PluginData
18882
+ /**
18883
+ * SelectedPluginProvider manages the selected payment plugin state.
18884
+ *
18885
+ * Data Flow Pattern:
18886
+ * - Children components should set the plugin ID using `setSelectedPluginId` from `useSelectedPluginId`
18887
+ * - This provider then derives the `selectedPlugin` from that ID and provides it via `useSelectedPlugin`
18888
+ * - This ensures that data flows only downward: children control the ID, and the provider computes and provides the data
18889
+ */
18890
+ function SelectedPluginProvider({ children, accountId, }) {
18891
+ return (jsx(SelectedPluginIdProvider, { initialValue: undefined, children: jsx(Content, { accountId: accountId, children: children }) }));
18892
+ }
18893
+ function Content({ children, accountId }) {
18894
+ // Context
18895
+ const { paymentPlugins } = usePaymentPlugins(accountId);
18896
+ const { defaultPaymentMethod } = usePaymentMethod({ accountId });
18897
+ const [selectedPluginId, setSelectedPluginId] = useSelectedPluginId();
18898
+ // Derived state
18899
+ const selectedPlugin = useMemo(() => {
18900
+ return paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find(plugin => plugin.id === selectedPluginId);
18901
+ }, [paymentPlugins, selectedPluginId]);
18902
+ useEffect(() => {
18903
+ var _a, _b;
18904
+ if (selectedPluginId) {
18905
+ return;
18906
+ }
18907
+ if (defaultPaymentMethod) {
18908
+ setSelectedPluginId((_a = defaultPaymentMethod.plugin) === null || _a === void 0 ? void 0 : _a.id);
18909
+ }
18910
+ else {
18911
+ setSelectedPluginId((_b = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins[0]) === null || _b === void 0 ? void 0 : _b.id);
18912
+ }
18913
+ }, [defaultPaymentMethod, paymentPlugins]);
18914
+ return jsx(SelectedPluginDataProvider, { value: selectedPlugin, children: children });
18915
+ }
18916
+
18917
+ const DIGIT_REGEX = /\d/;
18918
+ const isDigit = (char) => DIGIT_REGEX.test(char);
18919
+ const isDeletion = (char) => [8, 46].includes(char); // Backspace or Delete
18920
+ const isNavigation = (char) => [9, 37, 38, 39, 40].includes(char); // Tab, Arrows
18921
+ const isModifier = (char) => [16, 17, 18].includes(char); // Shift, Ctrl, Alt
18922
+ const isValidKey = (code) => isDeletion(code) || isNavigation(code) || isModifier(code);
18923
+ const isValidExpiry = (expiry) => {
18924
+ const month = parseInt(expiry.substring(0, 2), 10);
18925
+ const year = parseInt(expiry.substring(2, 4), 10) + 2000;
18926
+ if (isNaN(month) || isNaN(year))
18927
+ return false;
18928
+ if (month < 1 || month > 12)
18929
+ return false;
18930
+ return true;
18931
+ };
18932
+ const isCardExpired = (expiry) => {
18933
+ const month = parseInt(expiry.substring(0, 2), 10);
18934
+ const year = parseInt(expiry.substring(2, 4), 10) + 2000;
18935
+ const expiryDate = new Date(year, month, 1);
18936
+ return expiryDate < new Date();
18937
+ };
18938
+ const formatCardExpiry = (cardExpiry) => {
18939
+ if (cardExpiry.length <= 2)
18940
+ return cardExpiry;
18941
+ return cardExpiry.substring(0, 2) + '/' + cardExpiry.substring(2);
18942
+ };
18943
+ // removes spaces from a credit card number
18944
+ const unformatCardNumber = (cardNumber) => {
18945
+ const cardNumberArray = cardNumber.split('');
18946
+ const unformattedCardNumberArray = cardNumberArray.filter(character => character !== ' ');
18947
+ return unformattedCardNumberArray.join('');
18948
+ };
18949
+ const storePayment = async (options, plugin, apiHost, accountId) => {
18950
+ const { testCreditCardNumber, testCreditCardCvc, testCreditCardExpirationDate, token } = options;
18951
+ const response = await invokePlugin({
18952
+ method: 'store_payment_method',
18953
+ plugin,
18954
+ payload: {
18955
+ test_credit_card_number: testCreditCardNumber,
18956
+ test_credit_card_cvc: testCreditCardCvc,
18957
+ test_credit_card_expiration_date: testCreditCardExpirationDate,
18958
+ account_id: accountId,
18959
+ },
18960
+ token,
18961
+ apiHost,
18962
+ });
18963
+ if ((response === null || response === void 0 ? void 0 : response.status) !== 'success')
18964
+ throw new Error(response === null || response === void 0 ? void 0 : response.message);
18965
+ return response;
18966
+ };
18967
+
18968
+ function useSave$1({ onSaveSuccess, onSaveError, accountId, }) {
18969
+ const [isSaving, setIsSaving] = useState(false);
18970
+ const { apiHost } = useContext(BunnyContext);
18971
+ const token = useToken();
18972
+ const plugin = useSelectedPlugin();
18973
+ const save = async (cardDetails) => {
18974
+ try {
18975
+ setIsSaving(true);
18976
+ const response = await storePayment({
18977
+ testCreditCardNumber: unformatCardNumber(cardDetails.number),
18978
+ testCreditCardCvc: cardDetails.cvc.toString(),
18979
+ testCreditCardExpirationDate: cardDetails.expiry,
18980
+ token,
18981
+ }, plugin, apiHost, accountId);
18982
+ const paymentMethodId = response.payload[0].id;
18983
+ if (response.status !== 'success')
18984
+ throw new Error(response === null || response === void 0 ? void 0 : response.message);
18985
+ onSaveSuccess === null || onSaveSuccess === void 0 ? void 0 : onSaveSuccess({
18986
+ pluginPaymentResponse: {
18987
+ plugin,
18988
+ token: response.token,
18989
+ savePaymentMethod: true,
18990
+ },
18991
+ savedPaymentMethodResponse: {
18992
+ paymentMethodId,
18993
+ },
18994
+ });
18995
+ return paymentMethodId;
18996
+ }
18997
+ catch (error) {
18998
+ onSaveError === null || onSaveError === void 0 ? void 0 : onSaveError(error);
18999
+ }
19000
+ finally {
19001
+ setIsSaving(false);
19002
+ }
19003
+ return undefined;
19004
+ };
19005
+ return { save, isSaving };
19006
+ }
19007
+
19008
+ const MUTATION$9 = `
19009
+ mutation checkout(
19010
+ $invoiceId: ID,
19011
+ $quoteId: ID,
19012
+ $paymentMethodId: ID,
19013
+ $paymentMethodData: CheckoutPaymentMethodAttributes
19014
+ ) {
19015
+ checkout(
19016
+ invoiceId: $invoiceId,
19017
+ quoteId: $quoteId,
19018
+ paymentMethodId: $paymentMethodId,
19019
+ paymentMethodData: $paymentMethodData
19020
+ ) {
19021
+ invoice {
19022
+ id
19023
+ state
19024
+ amount
19025
+ amountDue
19026
+ }
19027
+ payment {
19028
+ id
19029
+ state
19030
+ amount
19031
+ }
19032
+ paymentApplication {
19033
+ id
19034
+ invoiceId
19035
+ paymentId
19036
+ }
19037
+ transaction {
19038
+ id
19039
+ amount
19040
+ }
19041
+ }
19042
+ }
19043
+ `;
19044
+ const checkout = async ({ quoteId, invoiceId, paymentMethodId, paymentMethodData, token, apiHost, }) => {
19045
+ const mutationVars = {
19046
+ quoteId,
19047
+ invoiceId,
19048
+ paymentMethodId,
19049
+ };
19050
+ if (paymentMethodData) {
19051
+ mutationVars.paymentMethodData = {
19052
+ ...paymentMethodData,
19053
+ metadata: paymentMethodData.metadata,
19054
+ };
19055
+ }
19056
+ const response = await gqlRequest({
19057
+ query: MUTATION$9,
19058
+ token,
19059
+ vars: mutationVars,
19060
+ apiHost: apiHost,
19061
+ });
19062
+ const { errors } = response === null || response === void 0 ? void 0 : response.checkout;
19063
+ if (errors)
19064
+ throw errors;
19065
+ return {
19066
+ savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
19067
+ };
19068
+ };
19069
+
19070
+ const getQuoteAmountDue = (quote) => {
19071
+ return quote.amountDue || quote.amount;
19072
+ };
19073
+
19074
+ const { useToken: useAntdToken } = theme$1;
19075
+ const createPaymentMethod = async ({ paymentMethodId, plugin, token, apiHost, accountId, }) => {
19076
+ const response = await invokePlugin({
19077
+ plugin,
19078
+ method: 'store_payment_method',
19079
+ payload: {
19080
+ payment_method_id: paymentMethodId,
19081
+ account_id: accountId,
19082
+ },
19083
+ token,
19084
+ apiHost,
19085
+ });
19086
+ if (response.status !== 'success')
19087
+ throw new Error(response.message || 'Unknown error');
19088
+ return response;
19089
+ };
19090
+ const createSetupIntent = (plugin, apiHost, token, accountId) => {
19091
+ return invokePlugin({
19092
+ plugin,
19093
+ method: 'create_setup_intent',
19094
+ token,
19095
+ apiHost,
19096
+ payload: {
19097
+ account_id: accountId,
19098
+ },
19099
+ });
19100
+ };
19101
+ const createPaymentHold = async ({ quote, plugin, token, apiHost, paymentMethodId, }) => {
19102
+ const payload = {
19103
+ quote_id: quote.id,
19104
+ amount: quote.amount,
19105
+ payment_method_id: paymentMethodId,
19106
+ };
19107
+ const response = await invokePlugin({
19108
+ plugin,
19109
+ method: 'create_payment_hold',
19110
+ payload,
19111
+ token,
19112
+ apiHost,
19113
+ });
19114
+ if (response.status !== 'success')
19115
+ throw new Error(response.message || 'Unknown error');
19116
+ return response;
19117
+ };
19118
+ const fetchStripeKey = async (plugin, apiHost, token, accountId) => {
19119
+ const response = await invokePlugin({
19120
+ plugin,
19121
+ method: 'retrieve_config',
19122
+ token,
19123
+ apiHost,
19124
+ payload: {
19125
+ account_id: accountId,
19126
+ },
19127
+ });
19128
+ return response;
19129
+ };
19130
+ loadStripe.setLoadParameters({ advancedFraudSignals: false });
19131
+ const useStripePlugin = (plugin, currencyId, accountId) => {
19132
+ // Context
19133
+ const { apiHost } = useContext(BunnyContext);
19134
+ const token = useToken();
19135
+ // State
19136
+ const [stripe, setStripe] = useState(null);
19137
+ // Hooks
19138
+ const showErrorNotification = useErrorNotification();
19139
+ const { token: antdToken } = useAntdToken();
19140
+ function getFontFamily() {
19141
+ if (antdToken.fontFamily === 'Inter') {
19142
+ return 'var(--font-inter, Inter), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
19143
+ }
19144
+ return antdToken.fontFamily;
19145
+ }
19146
+ const fontFamily = getFontFamily();
19147
+ const appearance = {
19148
+ variables: {
19149
+ fontFamily: fontFamily,
19150
+ fontLineHeight: antdToken.lineHeight.toString(),
19151
+ borderRadius: antdToken.borderRadius.toString() + 'px',
19152
+ colorBackground: 'white',
19153
+ colorPrimary: antdToken.colorPrimary,
19154
+ },
19155
+ rules: {
19156
+ '.Input': {
19157
+ fontFamily: fontFamily,
19158
+ },
19159
+ '.Label': {
19160
+ fontFamily: fontFamily,
19161
+ },
19162
+ },
19163
+ };
19164
+ const options = {
19165
+ mode: 'setup',
19166
+ currency: currencyId,
19167
+ setupFutureUsage: 'off_session',
19168
+ appearance,
19169
+ };
19170
+ useEffect(() => {
19171
+ var _a, _b;
19172
+ if (!plugin)
19173
+ return;
19174
+ if (((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) !== 'StripePayment')
19175
+ return;
19176
+ fetchStripeKey(plugin, apiHost || '', token, accountId)
19177
+ .then(({ payload }) => loadStripe(payload.publishable_key).then(setStripe))
19178
+ .catch(error => {
19179
+ console.error('Caught Error in fetching stripe key: ', error);
19180
+ showErrorNotification(error.message, 'Unexpected Error fetching key');
19181
+ });
19182
+ // eslint-disable-next-line
19183
+ }, [plugin, token]);
19184
+ return { stripe, options };
19185
+ };
19186
+
19187
+ function useApproveHold$1({ onApproveHoldSuccess, onApproveHoldError, }) {
19188
+ // Hooks
19189
+ const [isApprovingHold, setIsApprovingHold] = useState(false);
19190
+ const { apiHost } = useContext(BunnyContext);
19191
+ const token = useToken();
19192
+ const approveHold = async ({ plugin, quote, paymentMethodId, }) => {
19193
+ try {
19194
+ if (!token)
19195
+ throw new Error("Token couldn't be retrieved");
19196
+ setIsApprovingHold(true);
19197
+ const response = await createPaymentHold({
19198
+ quote,
19199
+ plugin,
19200
+ token,
19201
+ apiHost,
19202
+ paymentMethodId,
19203
+ });
19204
+ if (response.status !== 'success')
19205
+ throw new Error(response === null || response === void 0 ? void 0 : response.message);
19206
+ onApproveHoldSuccess === null || onApproveHoldSuccess === void 0 ? void 0 : onApproveHoldSuccess(response);
19207
+ }
19208
+ catch (error) {
19209
+ console.error(error);
19210
+ onApproveHoldError === null || onApproveHoldError === void 0 ? void 0 : onApproveHoldError(error);
19211
+ }
19212
+ finally {
19213
+ setIsApprovingHold(false);
19214
+ }
19215
+ };
19216
+ return { approveHold, isApprovingHold };
19217
+ }
19218
+
19219
+ // Used for Signup component. Signup needs a custom checkout function
19220
+ const [CustomCheckoutFunctionProvider, useCustomCheckoutFunction] = createValueContext();
19221
+
19222
+ const showErrorNotification$8 = useErrorNotification();
19223
+ function usePay$1({ onPaymentSuccess, onPaymentError, quote, invoice, plugin, }) {
19224
+ const { apiHost } = useContext(BunnyContext);
19225
+ const customCheckoutFunction = useCustomCheckoutFunction();
19226
+ const token = useToken();
19227
+ const [isPaying, setIsPaying] = useState(false);
19228
+ const pay = async (paymentMethodId) => {
19229
+ try {
19230
+ setIsPaying(true);
19231
+ if (customCheckoutFunction) {
19232
+ if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
19233
+ showErrorNotification$8('Plugin ID is required');
19234
+ return;
19235
+ }
19236
+ const response = await customCheckoutFunction(plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(), paymentMethodId.toString());
19237
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
19238
+ }
19239
+ else {
19240
+ const response = await checkout({
19241
+ invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
19242
+ quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
19243
+ paymentMethodId,
19244
+ token,
19245
+ apiHost,
19246
+ });
19247
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
19248
+ }
19249
+ }
19250
+ catch (error) {
19251
+ onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error);
19252
+ }
19253
+ finally {
19254
+ setIsPaying(false);
19255
+ }
19256
+ };
19257
+ return { pay, isPaying };
19258
+ }
19259
+
19260
+ function useApproveHold({ onApproveHoldSuccess, onApproveHoldError, }) {
19261
+ // Hooks
19262
+ const [isApprovingHold, setIsApprovingHold] = useState(false);
19263
+ const { apiHost } = useContext(BunnyContext);
19264
+ const token = useToken();
19265
+ const approveHold = async ({ plugin, quote, paymentMethodId, }) => {
19266
+ try {
19267
+ if (!token)
19268
+ throw new Error("Token couldn't be retrieved");
19269
+ setIsApprovingHold(true);
19270
+ const response = await createPaymentHold({
19271
+ quote,
19272
+ plugin,
19273
+ token,
19274
+ apiHost,
19275
+ paymentMethodId,
19276
+ });
19277
+ if (response.status !== 'success')
19278
+ throw new Error(response === null || response === void 0 ? void 0 : response.message);
19279
+ onApproveHoldSuccess === null || onApproveHoldSuccess === void 0 ? void 0 : onApproveHoldSuccess(response);
19280
+ }
19281
+ catch (error) {
19282
+ console.error(error);
19283
+ onApproveHoldError === null || onApproveHoldError === void 0 ? void 0 : onApproveHoldError(error);
19284
+ }
19285
+ finally {
19286
+ setIsApprovingHold(false);
19287
+ }
19288
+ };
19289
+ return { approveHold, isApprovingHold };
19290
+ }
19291
+
19292
+ const showErrorNotification$7 = useErrorNotification();
19293
+ function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, plugin, }) {
19294
+ // Hooks
19295
+ const { apiHost } = useContext(BunnyContext);
19296
+ const customCheckoutFunction = useCustomCheckoutFunction();
19297
+ const token = useToken();
19298
+ const [isPaying, setIsPaying] = useState(false);
19299
+ const pay = async (paymentMethodId) => {
19300
+ try {
19301
+ setIsPaying(true);
19302
+ if (customCheckoutFunction) {
19303
+ if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
19304
+ showErrorNotification$7('Plugin ID is required');
19305
+ return;
19306
+ }
19307
+ const response = await customCheckoutFunction(plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(), paymentMethodId.toString());
19308
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
19309
+ }
19310
+ else {
19311
+ const response = await checkout({
19312
+ invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
19313
+ quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
19314
+ paymentMethodId,
19315
+ token,
19316
+ apiHost,
19317
+ });
19318
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
19319
+ }
19320
+ }
19321
+ catch (error) {
19322
+ onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error);
19323
+ }
19324
+ finally {
19325
+ setIsPaying(false);
19326
+ }
19327
+ };
19328
+ return { pay, isPaying };
19329
+ }
19228
19330
 
19229
- // Automatically sets the default payment method if there is none currently set
19230
- const useAutoSetDefaultPaymentMethod = ({ accountId, token, handleSetDefault, setDefaultPaymentMethodLoading, enabled = true, }) => {
19231
- const queryClient = useQueryClient();
19331
+ var PaymentType;
19332
+ (function (PaymentType) {
19333
+ PaymentType["PAY"] = "PAY";
19334
+ PaymentType["APPROVE_HOLD"] = "APPROVE_HOLD";
19335
+ PaymentType["CHECKOUT_NO_PAYMENT"] = "CHECKOUT_NO_PAYMENT";
19336
+ })(PaymentType || (PaymentType = {}));
19337
+
19338
+ const handleAllErrorFormats$2 = useAllErrorFormats$1();
19339
+ const showErrorNotification$6 = useErrorNotification();
19340
+ const useHandlePayment = ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, accountId, }) => {
19341
+ // Context
19342
+ const { defaultPaymentMethod } = usePaymentMethod({ accountId });
19232
19343
  const { apiHost } = useContext(BunnyContext);
19233
- const { paymentMethods: storedPaymentMethods, defaultPaymentMethod } = usePaymentMethod({
19234
- accountId,
19235
- token,
19236
- apiHost,
19344
+ const token = useToken();
19345
+ const formattedAmountDue = () => {
19346
+ const amountDue = quote ? getQuoteAmountDue(quote) : invoice === null || invoice === void 0 ? void 0 : invoice.amountDue;
19347
+ const currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currencyId);
19348
+ return amountDue && currencyId ? formatCurrency$1(amountDue, currencyId).toString() : undefined;
19349
+ };
19350
+ // Payment hooks
19351
+ const { pay: payDemoPay, isPaying: isPayingDemoPay } = usePay$1({
19352
+ onPaymentSuccess,
19353
+ onPaymentError: error => {
19354
+ handleAllErrorFormats$2(error);
19355
+ },
19356
+ quote: quote,
19357
+ invoice: invoice,
19358
+ plugin,
19237
19359
  });
19238
- // Set the default payment method on the cache. Prevents 'handleSetDefault' from being called too many times.
19239
- function setDefaultPaymentMethodOnCache(targetPaymentMethod) {
19240
- let cachedPaymentMethods = queryClient.getQueryData(QueryKeyFactory$1.default.accountPaymentMethodsKey({
19241
- accountId,
19242
- token,
19243
- }));
19244
- if (cachedPaymentMethods) {
19245
- for (const paymentMethod of cachedPaymentMethods) {
19246
- paymentMethod.isDefault = paymentMethod.id === targetPaymentMethod.id;
19247
- }
19248
- queryClient.setQueryData(QueryKeyFactory$1.default.accountPaymentMethodsKey({
19249
- accountId,
19250
- token,
19251
- }), cachedPaymentMethods);
19360
+ const { pay: payStripe, isPaying: isPayingStripe } = usePay({
19361
+ onPaymentSuccess,
19362
+ onPaymentError: error => {
19363
+ handleAllErrorFormats$2(error);
19364
+ },
19365
+ quote: quote,
19366
+ invoice: invoice,
19367
+ plugin,
19368
+ });
19369
+ // Approve hold hooks
19370
+ const { approveHold: approveHoldStripe, isApprovingHold: isApprovingHoldStripe } = useApproveHold({
19371
+ onApproveHoldSuccess: response => {
19372
+ onPaymentHoldSuccess === null || onPaymentHoldSuccess === void 0 ? void 0 : onPaymentHoldSuccess(response);
19373
+ },
19374
+ onApproveHoldError: error => {
19375
+ handleAllErrorFormats$2(error);
19376
+ },
19377
+ });
19378
+ const { approveHold: approveHoldDemoPay, isApprovingHold: isApprovingHoldDemoPay } = useApproveHold$1({
19379
+ onApproveHoldSuccess: response => {
19380
+ onPaymentHoldSuccess === null || onPaymentHoldSuccess === void 0 ? void 0 : onPaymentHoldSuccess(response);
19381
+ },
19382
+ onApproveHoldError: error => {
19383
+ handleAllErrorFormats$2(error);
19384
+ },
19385
+ });
19386
+ // Mutations
19387
+ const { mutate: checkoutNoPayment, isPending: isCheckingOutNoPayment } = useMutation({
19388
+ mutationFn: async () => {
19389
+ const amountDue = formattedAmountDue();
19390
+ const paymentRequired = amountDue ? parseFloat(amountDue) > 0 : true;
19391
+ if (!quote)
19392
+ throw new Error('Quote is required');
19393
+ if (paymentRequired)
19394
+ throw new Error('Payment is required');
19395
+ return await checkout({ quoteId: quote.id, token, apiHost });
19396
+ },
19397
+ onSuccess: () => {
19398
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess({});
19399
+ },
19400
+ onError: error => {
19401
+ handleAllErrorFormats$2(error);
19402
+ },
19403
+ });
19404
+ const handleApproveHold = async (overridePaymentMethodId) => {
19405
+ var _a, _b, _c, _d;
19406
+ const paymentMethodId = overridePaymentMethodId || (defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id);
19407
+ if (!plugin)
19408
+ return showErrorNotification$6('plugin is undefined');
19409
+ if (!quote)
19410
+ return showErrorNotification$6('quote is undefined');
19411
+ if (!paymentMethodId)
19412
+ return showErrorNotification$6('payment method id is undefined');
19413
+ switch ((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) {
19414
+ case 'StripePayment':
19415
+ await approveHoldStripe({
19416
+ plugin,
19417
+ quote,
19418
+ paymentMethodId,
19419
+ });
19420
+ break;
19421
+ case 'DemoPayPayment':
19422
+ await approveHoldDemoPay({
19423
+ plugin,
19424
+ quote,
19425
+ paymentMethodId,
19426
+ });
19427
+ break;
19428
+ default:
19429
+ showErrorNotification$6(`Payment holds are not supported by ${(_d = (_c = plugin.components) === null || _c === void 0 ? void 0 : _c.frontend) === null || _d === void 0 ? void 0 : _d[0].name}`);
19430
+ break;
19252
19431
  }
19253
- }
19254
- useEffect(() => {
19255
- if (setDefaultPaymentMethodLoading || !enabled)
19432
+ };
19433
+ const handlePayment = async (overridePaymentMethodId) => {
19434
+ var _a, _b;
19435
+ if (!plugin)
19256
19436
  return;
19257
- if ((storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.length) > 0 && !defaultPaymentMethod) {
19258
- handleSetDefault(storedPaymentMethods[0]);
19259
- setDefaultPaymentMethodOnCache(storedPaymentMethods[0]);
19437
+ switch ((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) {
19438
+ case 'StripePayment':
19439
+ await payStripe(overridePaymentMethodId);
19440
+ break;
19441
+ case 'DemoPayPayment':
19442
+ await payDemoPay(overridePaymentMethodId);
19443
+ break;
19260
19444
  }
19261
- }, [
19262
- storedPaymentMethods,
19263
- defaultPaymentMethod,
19264
- handleSetDefault,
19265
- setDefaultPaymentMethodLoading,
19266
- queryClient,
19267
- accountId,
19268
- token,
19269
- ]);
19445
+ };
19446
+ return {
19447
+ handleApproveHold,
19448
+ handlePayment,
19449
+ handleCheckoutNoPayment: checkoutNoPayment,
19450
+ isPaying: isCheckingOutNoPayment ||
19451
+ isPayingDemoPay ||
19452
+ isPayingStripe ||
19453
+ isApprovingHoldDemoPay ||
19454
+ isApprovingHoldStripe,
19455
+ paymentType: paymentHoldOptions.payToAccept ? PaymentType.APPROVE_HOLD : PaymentType.PAY,
19456
+ formattedAmountDue: formattedAmountDue(),
19457
+ };
19270
19458
  };
19271
19459
 
19272
- const usePaymentMethodSelectorPlugin = ({ defaultPaymentMethod, defaultPaymentMethodPlugin, paymentMethodAllowedPlugins, }) => {
19273
- const [selectorPaymentMethodPlugin, setSelectorPaymentMethodPlugin] = useState();
19274
- useEffect(() => {
19275
- if (selectorPaymentMethodPlugin) {
19276
- return;
19460
+ function useSave({ onSaveSuccess, onSaveError, accountId, }) {
19461
+ // Hooks
19462
+ const [isSaving, setIsSaving] = useState(false);
19463
+ const elements = useElements();
19464
+ const stripe = useStripe();
19465
+ const { apiHost } = useContext(BunnyContext);
19466
+ const token = useToken();
19467
+ const selectedPlugin = useSelectedPlugin();
19468
+ const createStripePaymentMethodId = async () => {
19469
+ var _a, _b;
19470
+ if (!stripe)
19471
+ throw new Error('Form is not ready');
19472
+ if (!elements)
19473
+ throw new Error("Elements couldn't be retrieved");
19474
+ // Trigger form validation and wallet collection
19475
+ const { error: submitError } = await elements.submit();
19476
+ if (submitError)
19477
+ throw new Error(submitError.message);
19478
+ const response = await createSetupIntent(selectedPlugin, apiHost, token, accountId);
19479
+ if (response.status !== 'success')
19480
+ throw new Error(response === null || response === void 0 ? void 0 : response.message);
19481
+ const clientSecret = (_a = response === null || response === void 0 ? void 0 : response.payload) === null || _a === void 0 ? void 0 : _a.client_secret;
19482
+ if (!clientSecret)
19483
+ throw new Error('Error retrieving client secret');
19484
+ // Confirm the SetupIntent using the details collected by the Payment Element
19485
+ const intentResponse = await stripe.confirmSetup({
19486
+ elements,
19487
+ clientSecret,
19488
+ redirect: 'if_required',
19489
+ confirmParams: {
19490
+ return_url: window.location.href,
19491
+ },
19492
+ });
19493
+ // See https://stripe.com/docs/payments/save-during-payment?platform=web#web-submit-payment
19494
+ if (intentResponse.error)
19495
+ throw new Error(intentResponse.error.message);
19496
+ const paymentMethodId = (_b = intentResponse.setupIntent.payment_method) === null || _b === void 0 ? void 0 : _b.toString();
19497
+ if (!paymentMethodId)
19498
+ throw new Error("Payment method couldn't be retrieved");
19499
+ return paymentMethodId;
19500
+ };
19501
+ const save = async () => {
19502
+ try {
19503
+ setIsSaving(true);
19504
+ const paymentMethodId = await createStripePaymentMethodId();
19505
+ const paymentMethodResponse = await createPaymentMethod({
19506
+ paymentMethodId,
19507
+ plugin: selectedPlugin,
19508
+ token,
19509
+ apiHost,
19510
+ accountId,
19511
+ });
19512
+ const savedPaymentMethodId = paymentMethodResponse.payload[0].id;
19513
+ onSaveSuccess === null || onSaveSuccess === void 0 ? void 0 : onSaveSuccess({
19514
+ pluginPaymentResponse: {
19515
+ savePaymentMethod: true,
19516
+ plugin: selectedPlugin,
19517
+ token: paymentMethodResponse.token,
19518
+ },
19519
+ savedPaymentMethodResponse: {
19520
+ paymentMethodId: savedPaymentMethodId,
19521
+ },
19522
+ });
19523
+ return savedPaymentMethodId;
19277
19524
  }
19278
- if (defaultPaymentMethod) {
19279
- setSelectorPaymentMethodPlugin(defaultPaymentMethodPlugin);
19525
+ catch (error) {
19526
+ onSaveError === null || onSaveError === void 0 ? void 0 : onSaveError(error);
19280
19527
  }
19281
- else {
19282
- setSelectorPaymentMethodPlugin(paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins[0]);
19528
+ finally {
19529
+ setIsSaving(false);
19283
19530
  }
19284
- }, [
19285
- defaultPaymentMethod,
19286
- defaultPaymentMethodPlugin,
19287
- paymentMethodAllowedPlugins,
19288
- ]);
19289
- return {
19290
- selectorPaymentMethodPlugin,
19291
- setSelectorPaymentMethodPlugin,
19531
+ return undefined;
19292
19532
  };
19293
- };
19533
+ return { save, createStripePaymentMethodId, isSaving };
19534
+ }
19294
19535
 
19295
- const SavePaymentMethodFooter = ({ isSaving, onSave, noPadding, }) => {
19296
- const isMobile = useIsMobile();
19297
- const { onClickCancel } = useContext(PaymentContext);
19298
- return (jsxs("div", { className: `bunny-flex bunny-justify-end bunny-gap-2 ${noPadding ? "" : "pt-6"}`, children: [onClickCancel && (jsx(Button, { className: "bunny-w-full", size: isMobile ? "large" : "middle", onClick: () => onClickCancel(), children: "Cancel" })), jsx(Button, { className: "bunny-w-full", disabled: isSaving, onClick: onSave, size: isMobile ? "large" : "middle", type: "primary", children: isSaving ? "Saving" : "Save" })] }));
19299
- };
19536
+ const useShowPaymentDetailsState = (isOpen = false) => useState(isOpen);
19537
+ const [ShowPaymentDetailsProvider, useShowPaymentDetails] = createStateContext(useShowPaymentDetailsState);
19300
19538
 
19301
- const DIGIT_REGEX = /\d/;
19302
- const isDigit = (char) => DIGIT_REGEX.test(char);
19303
- const isDeletion = (char) => [8, 46].includes(char); // Backspace or Delete
19304
- const isNavigation = (char) => [9, 37, 38, 39, 40].includes(char); // Tab, Arrows
19305
- const isModifier = (char) => [16, 17, 18].includes(char); // Shift, Ctrl, Alt
19306
- const isValidKey = (code) => isDeletion(code) || isNavigation(code) || isModifier(code);
19307
- const isValidExpiry = (expiry) => {
19308
- const month = parseInt(expiry.substring(0, 2), 10);
19309
- const year = parseInt(expiry.substring(2, 4), 10) + 2000;
19310
- if (isNaN(month) || isNaN(year))
19311
- return false;
19312
- if (month < 1 || month > 12)
19313
- return false;
19314
- return true;
19315
- };
19316
- const isCardExpired = (expiry) => {
19317
- const month = parseInt(expiry.substring(0, 2), 10);
19318
- const year = parseInt(expiry.substring(2, 4), 10) + 2000;
19319
- const expiryDate = new Date(year, month, 1);
19320
- return expiryDate < new Date();
19321
- };
19322
- const formatCardExpiry = (cardExpiry) => {
19323
- if (cardExpiry.length <= 2)
19324
- return cardExpiry;
19325
- return cardExpiry.substring(0, 2) + '/' + cardExpiry.substring(2);
19326
- };
19327
- // removes spaces from a credit card number
19328
- const unformatCardNumber = (cardNumber) => {
19329
- const cardNumberArray = cardNumber.split('');
19330
- const unformattedCardNumberArray = cardNumberArray.filter(character => character !== ' ');
19331
- return unformattedCardNumberArray.join('');
19332
- };
19333
- const storePayment = async (options, plugin, apiHost, accountId) => {
19334
- const { testCreditCardNumber, testCreditCardCvc, testCreditCardExpirationDate, token } = options;
19335
- const response = await invokePlugin({
19336
- method: 'store_payment_method',
19337
- plugin,
19338
- payload: {
19339
- test_credit_card_number: testCreditCardNumber,
19340
- test_credit_card_cvc: testCreditCardCvc,
19341
- test_credit_card_expiration_date: testCreditCardExpirationDate,
19342
- account_id: accountId,
19539
+ const handleAllErrorFormats$1 = useAllErrorFormats$1();
19540
+ const showErrorNotification$5 = useErrorNotification();
19541
+ // Contexts
19542
+ const [AmountDueProvider, useAmountDue] = createValueContext();
19543
+ const [PaymentTypeProvider, usePaymentType] = createValueContext();
19544
+ const [IsPayingProvider, useIsPaying] = createValueContext();
19545
+ const [HandlePaymentFormSubmitProvider, useHandlePaymentFormSubmit] = createValueContext();
19546
+ const [IsSavingProvider, useIsSaving] = createValueContext();
19547
+ // Used for Signup component. Signup uses an apiClient token which api can't infer an account from, so accountId must be used
19548
+ const [AccountIdProvider, useAccountId] = createValueContext();
19549
+ function PaymentProvider({ children, accountId, quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldOptions, onSavePaymentMethod, }) {
19550
+ var _a, _b, _c;
19551
+ // Context
19552
+ const [showPaymentMethodForm, setShowPaymentMethodForm] = useShowPaymentDetails();
19553
+ const selectedPlugin = useSelectedPlugin();
19554
+ // Hooks
19555
+ const queryClient = useQueryClient();
19556
+ const token = useToken();
19557
+ const { handlePayment, handleApproveHold, handleCheckoutNoPayment, isPaying, paymentType, formattedAmountDue, } = useHandlePayment({
19558
+ quote,
19559
+ invoice,
19560
+ onPaymentSuccess: (response) => {
19561
+ // TODO: type the response to PaymentSuccessResponse
19562
+ // Hide payment method selector and form
19563
+ setShowPaymentMethodForm(false);
19564
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
19343
19565
  },
19344
- token,
19345
- apiHost,
19566
+ onPaymentHoldSuccess,
19567
+ plugin: selectedPlugin, // TODO: type the response to PluginData
19568
+ paymentHoldOptions,
19569
+ accountId,
19346
19570
  });
19347
- if ((response === null || response === void 0 ? void 0 : response.status) !== 'success')
19348
- throw new Error(response === null || response === void 0 ? void 0 : response.message);
19349
- return response;
19571
+ const { defaultPaymentMethod } = usePaymentMethod({ accountId });
19572
+ const { save: saveDemoPay, isSaving: isSavingDemoPay } = useSave$1({
19573
+ onSaveSuccess: (response) => {
19574
+ onSavePaymentMethod === null || onSavePaymentMethod === void 0 ? void 0 : onSavePaymentMethod(response);
19575
+ queryClient.invalidateQueries({
19576
+ queryKey: QueryKeyFactory.accountPaymentMethodsKey({
19577
+ accountId,
19578
+ token,
19579
+ }),
19580
+ });
19581
+ setShowPaymentMethodForm(false);
19582
+ },
19583
+ onSaveError: handleAllErrorFormats$1,
19584
+ accountId,
19585
+ });
19586
+ const { save: saveStripe, isSaving: isSavingStripe } = useSave({
19587
+ onSaveSuccess: async (response) => {
19588
+ onSavePaymentMethod === null || onSavePaymentMethod === void 0 ? void 0 : onSavePaymentMethod(response);
19589
+ queryClient.invalidateQueries({
19590
+ queryKey: QueryKeyFactory.accountPaymentMethodsKey({
19591
+ accountId,
19592
+ token,
19593
+ }),
19594
+ });
19595
+ setShowPaymentMethodForm(false);
19596
+ },
19597
+ onSaveError: handleAllErrorFormats$1,
19598
+ accountId,
19599
+ });
19600
+ const pluginName = (_c = (_b = (_a = selectedPlugin === null || selectedPlugin === void 0 ? void 0 : selectedPlugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name;
19601
+ const handleSave = async (demoPayCardDetails) => {
19602
+ var _a, _b;
19603
+ if (pluginName === 'StripePayment') {
19604
+ return await saveStripe();
19605
+ }
19606
+ else if (pluginName === 'DemoPayPayment') {
19607
+ return await saveDemoPay(demoPayCardDetails);
19608
+ }
19609
+ else {
19610
+ showErrorNotification$5(`Can not find form for plugin ${(_b = (_a = selectedPlugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name}`);
19611
+ return undefined;
19612
+ }
19613
+ };
19614
+ const handleApproveHoldFlow = async (savedPaymentMethodId) => {
19615
+ var _a, _b;
19616
+ if (pluginName === 'StripePayment') {
19617
+ await handleApproveHold(savedPaymentMethodId);
19618
+ }
19619
+ else if (pluginName === 'DemoPayPayment') {
19620
+ await handleApproveHold(savedPaymentMethodId);
19621
+ }
19622
+ else {
19623
+ showErrorNotification$5(`Can not find form for plugin ${(_b = (_a = selectedPlugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name}`);
19624
+ }
19625
+ };
19626
+ const handlePaymentFormSubmit = async (demoPayCardDetails) => {
19627
+ if (paymentType === PaymentType.CHECKOUT_NO_PAYMENT) {
19628
+ handleCheckoutNoPayment();
19629
+ return;
19630
+ }
19631
+ if (paymentType === PaymentType.APPROVE_HOLD) {
19632
+ // If payment method form is shown, save payment method first, then approve hold
19633
+ const savedPaymentMethodId = showPaymentMethodForm
19634
+ ? await handleSave(demoPayCardDetails)
19635
+ : undefined;
19636
+ await handleApproveHoldFlow(savedPaymentMethodId);
19637
+ return;
19638
+ }
19639
+ if (formattedAmountDue === undefined) {
19640
+ // If amount due is undefined, we need to save a payment method only
19641
+ await handleSave(demoPayCardDetails);
19642
+ return;
19643
+ }
19644
+ if (paymentType === PaymentType.PAY) {
19645
+ if (showPaymentMethodForm) {
19646
+ // If paying and showing payment method form, save payment method first, then pay (1 click for user convenience)
19647
+ const savedPaymentMethodId = await handleSave(demoPayCardDetails);
19648
+ if (savedPaymentMethodId) {
19649
+ await handlePayment(savedPaymentMethodId);
19650
+ }
19651
+ }
19652
+ else {
19653
+ if (!(defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id)) {
19654
+ showErrorNotification$5('Default payment method ID is undefined');
19655
+ return;
19656
+ }
19657
+ await handlePayment(defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id);
19658
+ }
19659
+ return;
19660
+ }
19661
+ };
19662
+ const providers = [
19663
+ [AmountDueProvider, { value: formattedAmountDue }],
19664
+ [PaymentTypeProvider, { value: paymentType }],
19665
+ [IsPayingProvider, { value: isPaying }],
19666
+ [HandlePaymentFormSubmitProvider, { value: handlePaymentFormSubmit }],
19667
+ [IsSavingProvider, { value: isSavingDemoPay || isSavingStripe }],
19668
+ [AccountIdProvider, { value: accountId }],
19669
+ ];
19670
+ return (jsx(Fragment, { children: providers.reduceRight((acc, [Provider, props]) => createElement(Provider, props, acc), children) }));
19671
+ }
19672
+ function StripeWrapper({ children, currencyId, accountId, }) {
19673
+ const plugin = useSelectedPlugin();
19674
+ const { stripe, options } = useStripePlugin(plugin, currencyId, accountId);
19675
+ return (jsx(Elements, { options: options, stripe: stripe, children: children }));
19676
+ }
19677
+
19678
+ const CheckoutFooter = () => {
19679
+ const isMobile = useIsMobile();
19680
+ const paymentType = usePaymentType();
19681
+ const isPaying = useIsPaying();
19682
+ const formattedAmountDue = useAmountDue();
19683
+ const onPaymentFormSubmit = useHandlePaymentFormSubmit();
19684
+ const buttonText = paymentType === PaymentType.APPROVE_HOLD ? 'Approve hold for' : 'Pay';
19685
+ const isPayingButtonText = paymentType === PaymentType.APPROVE_HOLD ? 'Approving hold for' : 'Paying';
19686
+ return (jsx(Button, { className: "bunny-w-full", disabled: isPaying, onClick: () => onPaymentFormSubmit(), size: isMobile ? 'large' : 'middle', type: "primary", children: `${isPaying ? isPayingButtonText : buttonText} ${formattedAmountDue}` }));
19350
19687
  };
19351
19688
 
19689
+ function PaymentMethodFooter({ onSubmit, noPadding, }) {
19690
+ const isPaying = useIsPaying();
19691
+ const isSaving = useIsSaving();
19692
+ const buttonText = useSubmitButtonText();
19693
+ const isMobile = useIsMobile$1();
19694
+ const [, setShowPaymentMethodForm] = useShowPaymentDetails();
19695
+ return (jsxs("div", { className: `bunny-flex bunny-justify-end bunny-gap-2 ${noPadding ? '' : 'pt-6'}`, children: [jsx(Button, { className: "bunny-w-full", size: isMobile ? 'large' : 'middle', onClick: () => setShowPaymentMethodForm(false), children: "Cancel" }), jsx(Button, { className: "bunny-w-full", disabled: isSaving || isPaying, loading: isSaving || isPaying, onClick: onSubmit, size: isMobile ? 'large' : 'middle', type: "primary", children: buttonText })] }));
19696
+ }
19697
+ function useSubmitButtonText() {
19698
+ const amountDue = useAmountDue();
19699
+ const paymentType = usePaymentType();
19700
+ const payableAvailable = amountDue !== undefined;
19701
+ const paymentTypeText = paymentType === PaymentType.APPROVE_HOLD ? 'approve hold for' : 'pay';
19702
+ const buttonTextPrefix = payableAvailable ? paymentTypeText : 'save';
19703
+ return lodashExports.capitalize(buttonTextPrefix) + ' ' + (amountDue !== null && amountDue !== void 0 ? amountDue : '');
19704
+ }
19705
+
19352
19706
  const DemoPayCardCvc = ({ autoFocus, onChange, placeholder, value, }) => {
19353
19707
  const onKeyPress = (event) => {
19354
19708
  if (!isDigit(event.key) && !isValidKey(event.keyCode))
@@ -19387,73 +19741,27 @@ const DemoPayExpiry = ({ autoFocus, onChange, placeholder, value, }) => {
19387
19741
  return (jsx("div", { className: "bunny-grow", children: jsx(Input, { name: "expiry", autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: formatCardExpiry(value), maxLength: 5, placeholder: placeholder || "MM/YY" }) }));
19388
19742
  };
19389
19743
 
19390
- function useSave$1({ onSaveSuccess, onSaveError, token, apiHost, accountId, }) {
19391
- const [isSaving, setIsSaving] = useState(false);
19392
- const save = async ({ cardDetails, plugin, savePaymentMethod, }) => {
19393
- try {
19394
- setIsSaving(true);
19395
- const response = await storePayment({
19396
- testCreditCardNumber: unformatCardNumber(cardDetails.number),
19397
- testCreditCardCvc: cardDetails.cvc.toString(),
19398
- testCreditCardExpirationDate: cardDetails.expiry,
19399
- token,
19400
- }, plugin, apiHost, accountId);
19401
- const paymentMethodId = response.payload[0].id;
19402
- if (response.status !== 'success')
19403
- throw new Error(response === null || response === void 0 ? void 0 : response.message);
19404
- onSaveSuccess === null || onSaveSuccess === void 0 ? void 0 : onSaveSuccess({
19405
- pluginPaymentResponse: {
19406
- plugin,
19407
- token: response.token,
19408
- savePaymentMethod,
19409
- },
19410
- savedPaymentMethodResponse: {
19411
- paymentMethodId,
19412
- },
19413
- });
19414
- }
19415
- catch (error) {
19416
- onSaveError === null || onSaveError === void 0 ? void 0 : onSaveError(error);
19417
- }
19418
- finally {
19419
- setIsSaving(false);
19420
- }
19421
- };
19422
- return { save, isSaving };
19423
- }
19424
-
19425
19744
  const { Text: Text$y } = Typography;
19745
+ const handleAllErrorFormats = useAllErrorFormats$1();
19426
19746
  const TEST_CARD = '4242424242424242';
19427
- const DemoPayForm = ({ onFail, onSavePaymentMethod, plugin, }) => {
19747
+ const DemoPayForm = () => {
19428
19748
  // Context
19429
- const { token, apiHost, darkMode } = useContext(BunnyContext);
19430
- const { accountId } = useContext(PaymentContext);
19431
- // Hooks
19432
- const { save, isSaving } = useSave$1({
19433
- onSaveSuccess: onSavePaymentMethod,
19434
- onSaveError: onFail,
19435
- token,
19436
- apiHost,
19437
- accountId,
19438
- });
19749
+ const { darkMode } = useContext(BunnyContext);
19750
+ const onPaymentFormSubmit = useHandlePaymentFormSubmit();
19439
19751
  const [cardDetails, setCardDetails] = useState({
19440
19752
  number: '4242424242424242',
19441
19753
  expiry: '',
19442
19754
  cvc: '',
19443
19755
  });
19444
- const onSave = async () => {
19756
+ function onSubmit() {
19445
19757
  try {
19446
19758
  validateCardDetails();
19447
- await save({
19448
- cardDetails,
19449
- plugin,
19450
- savePaymentMethod: false,
19451
- });
19759
+ onPaymentFormSubmit(cardDetails);
19452
19760
  }
19453
19761
  catch (error) {
19454
- onFail(error);
19762
+ handleAllErrorFormats(error);
19455
19763
  }
19456
- };
19764
+ }
19457
19765
  function validateCardDetails() {
19458
19766
  if (cardDetails.number !== TEST_CARD)
19459
19767
  throw new Error('Only the card number 4242 4242 4242 4242 will be accepted.');
@@ -19473,7 +19781,7 @@ const DemoPayForm = ({ onFail, onSavePaymentMethod, plugin, }) => {
19473
19781
  const onCardCvcChange = (cvc) => {
19474
19782
  setCardDetails({ ...cardDetails, cvc });
19475
19783
  };
19476
- return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxs(StyledInputs, { className: "bunny-flex bunny-flex-col bunny-gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false, children: [jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxs("div", { className: "bunny-flex bunny-gap-2", children: [jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] })] }), jsx(Text$y, { children: "DemoPay is for testing only." }), jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSave })] }));
19784
+ return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxs(StyledInputs, { className: "bunny-flex bunny-flex-col bunny-gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false, children: [jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxs("div", { className: "bunny-flex bunny-gap-2", children: [jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] })] }), jsx(Text$y, { children: "DemoPay is for testing only." }), jsx(PaymentMethodFooter, { onSubmit: onSubmit })] }));
19477
19785
  };
19478
19786
  const StyledInputs = defaultStyled.div `
19479
19787
  .ant-input {
@@ -19484,92 +19792,12 @@ const StyledInputs = defaultStyled.div `
19484
19792
  }
19485
19793
  `;
19486
19794
 
19487
- function useSave({ onSaveSuccess, onSaveError, }) {
19488
- // Hooks
19489
- const [isSaving, setIsSaving] = useState(false);
19490
- const elements = useElements();
19491
- const stripe = useStripe();
19492
- const { apiHost } = useContext(BunnyContext);
19493
- const token = useToken();
19494
- const { accountId } = useContext(PaymentContext);
19495
- const save = async ({ plugin }) => {
19496
- var _a, _b;
19497
- try {
19498
- if (!stripe)
19499
- throw new Error('Form is not ready');
19500
- if (!elements)
19501
- throw new Error("Elements couldn't be retrieved");
19502
- setIsSaving(true);
19503
- // Trigger form validation and wallet collection
19504
- const { error: submitError } = await elements.submit();
19505
- if (submitError)
19506
- throw new Error(submitError.message);
19507
- const response = await createSetupIntent(plugin, apiHost, token, accountId);
19508
- if (response.status !== 'success')
19509
- throw new Error(response === null || response === void 0 ? void 0 : response.message);
19510
- const clientSecret = (_a = response === null || response === void 0 ? void 0 : response.payload) === null || _a === void 0 ? void 0 : _a.client_secret;
19511
- if (!clientSecret)
19512
- throw new Error('Error retrieving client secret');
19513
- // Confirm the SetupIntent using the details collected by the Payment Element
19514
- const intentResponse = await stripe.confirmSetup({
19515
- elements,
19516
- clientSecret,
19517
- redirect: 'if_required',
19518
- confirmParams: {
19519
- return_url: window.location.href,
19520
- },
19521
- });
19522
- // See https://stripe.com/docs/payments/save-during-payment?platform=web#web-submit-payment
19523
- if (intentResponse.error)
19524
- throw new Error(intentResponse.error.message);
19525
- const paymentMethodId = (_b = intentResponse.setupIntent.payment_method) === null || _b === void 0 ? void 0 : _b.toString();
19526
- if (!paymentMethodId)
19527
- throw new Error("Payment method couldn't be retrieved");
19528
- const paymentMethodResponse = await createPaymentMethod({
19529
- paymentMethodId,
19530
- plugin,
19531
- token,
19532
- apiHost,
19533
- accountId,
19534
- });
19535
- onSaveSuccess === null || onSaveSuccess === void 0 ? void 0 : onSaveSuccess({
19536
- pluginPaymentResponse: {
19537
- savePaymentMethod: true,
19538
- plugin,
19539
- token: paymentMethodResponse.token,
19540
- },
19541
- savedPaymentMethodResponse: {
19542
- paymentMethodId: paymentMethodResponse.payload[0].id,
19543
- },
19544
- });
19545
- }
19546
- catch (error) {
19547
- onSaveError === null || onSaveError === void 0 ? void 0 : onSaveError(error);
19548
- }
19549
- finally {
19550
- setIsSaving(false);
19551
- }
19552
- };
19553
- return { save, isSaving };
19554
- }
19555
-
19556
- const PaymentMethodForm = ({ plugin, onFail, onSavePaymentMethod, }) => {
19795
+ const StripeForm = () => {
19796
+ // Context
19797
+ const onPaymentFormSubmit = useHandlePaymentFormSubmit();
19798
+ // State
19557
19799
  const [isIdealWarningOpen, setIsIdealWarningOpen] = useState(false);
19558
19800
  const idealWarningHasShown = useRef(false);
19559
- // Hooks
19560
- const { save, isSaving } = useSave({
19561
- onSaveSuccess: onSavePaymentMethod,
19562
- onSaveError: onFail,
19563
- });
19564
- // Handlers
19565
- const onSubmit = async () => {
19566
- try {
19567
- await save({ plugin });
19568
- }
19569
- catch (error) {
19570
- onFail(error);
19571
- }
19572
- };
19573
19801
  const onChange = (event) => {
19574
19802
  if (event.value.type === 'ideal' && !idealWarningHasShown.current) {
19575
19803
  idealWarningHasShown.current = true;
@@ -19578,26 +19806,22 @@ const PaymentMethodForm = ({ plugin, onFail, onSavePaymentMethod, }) => {
19578
19806
  };
19579
19807
  return (jsxs("form", { children: [jsx(PaymentElement, { options: {
19580
19808
  layout: { type: 'accordion' },
19581
- }, onChange: onChange }), jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSubmit }), jsx(IdealWarningModal, { isOpen: isIdealWarningOpen, onClose: () => setIsIdealWarningOpen(false) })] }));
19809
+ }, onChange: onChange }), jsx(PaymentMethodFooter, { onSubmit: onPaymentFormSubmit }), jsx(IdealWarningModal, { isOpen: isIdealWarningOpen, onClose: () => setIsIdealWarningOpen(false) })] }));
19582
19810
  };
19583
19811
  function IdealWarningModal({ isOpen, onClose }) {
19584
19812
  return (jsx(Modal, { open: isOpen, onCancel: onClose, footer: jsx(Button, { type: "primary", onClick: onClose, children: "Ok" }), children: jsx("div", { className: "bunny-p-4", children: "iDEAL will charge a 1 cent fee when storing this payment method. You will be refunded later." }) }));
19585
19813
  }
19586
19814
 
19587
- // This is just a wrapper to fetch the stripe object and pass it to the form
19588
- const StripeForm = ({ plugin, onFail, onSavePaymentMethod, }) => {
19589
- return (jsx(PaymentMethodForm, { plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }));
19590
- };
19591
-
19592
- const PaymentMethodDetails = ({ onFail, plugin, onSavePaymentMethod, }) => {
19815
+ const PaymentMethodDetails = () => {
19593
19816
  var _a, _b;
19594
- switch ((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) {
19817
+ const selectedPlugin = useSelectedPlugin();
19818
+ switch ((_b = (_a = selectedPlugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) {
19595
19819
  case 'StripePayment':
19596
- return (jsx(StripeForm, { onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
19820
+ return jsx(StripeForm, {});
19597
19821
  case 'DemoPayPayment':
19598
- return (jsx(DemoPayForm, { onFail: onFail, onSavePaymentMethod: response => onSavePaymentMethod(response), plugin: plugin }));
19822
+ return jsx(DemoPayForm, {});
19599
19823
  default:
19600
- console.warn('Can not find form for plugin', plugin);
19824
+ console.warn('Can not find form for plugin', selectedPlugin);
19601
19825
  return jsx(Fragment, {});
19602
19826
  }
19603
19827
  };
@@ -19607,17 +19831,20 @@ const CardIcon = ({ className }) => {
19607
19831
  };
19608
19832
 
19609
19833
  const { Text: Text$x } = Typography;
19610
- const PaymentMethodSelector = ({ paymentMethodAllowedPlugins, onSelect, value, }) => {
19611
- return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.map((plugin, index) => (jsx(PaymentOption, { name: plugin.name, onClick: onSelect, paymentPlugin: plugin, selected: (value === null || value === void 0 ? void 0 : value.id) === plugin.id }, index))) }));
19834
+ const PaymentMethodSelector = () => {
19835
+ const accountId = useAccountId();
19836
+ const { paymentPlugins } = usePaymentPlugins(accountId);
19837
+ const [selectedPluginId, setSelectedPluginId] = useSelectedPluginId();
19838
+ return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.map((plugin, index) => (jsx(PaymentOption, { name: plugin.name, onClick: setSelectedPluginId, paymentPluginId: plugin.id, selected: selectedPluginId === plugin.id }, index))) }));
19612
19839
  };
19613
- const PaymentOption = ({ selected, paymentPlugin, onClick, name, }) => {
19840
+ const PaymentOption = ({ selected, paymentPluginId, onClick, name, }) => {
19614
19841
  const { brandColor } = useBrand();
19615
19842
  const { darkMode } = useContext(BunnyContext);
19616
19843
  const isAch = name === null || name === void 0 ? void 0 : name.toLowerCase().includes('ach');
19617
19844
  const isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes('card');
19618
19845
  return (jsxs(PaymentOptionContainer, { "$brandColor": brandColor, "$selected": selected, className: `bunny-flex bunny-justify-between bunny-items-center bunny-cursor-pointer bunny-py-2 bunny-rounded bunny-border-solid ${darkMode
19619
19846
  ? `var(--row-background-dark) border-gray-500`
19620
- : 'bunny-bg-slate-50 bunny-border-slate-200'} bunny-border`, onClick: () => onClick(paymentPlugin), children: [jsxs("div", { className: "bunny-flex bunny-gap-2 bunny-items-center bunny-pl-4", children: [jsx(Checkbox, { checked: selected, className: darkMode ? 'border-gray-400' : '' }), jsx(Text$x, { children: name })] }), isAch ? (jsx(BankOutlined, { className: "bunny-pr-4" })) : isCard ? (jsx(CardIcon, { className: "bunny-pr-4" })) : (jsx(CardIcon, { className: "bunny-pr-4" }))] }));
19847
+ : 'bunny-bg-slate-50 bunny-border-slate-200'} bunny-border`, onClick: () => onClick(paymentPluginId), children: [jsxs("div", { className: "bunny-flex bunny-gap-2 bunny-items-center bunny-pl-4", children: [jsx(Checkbox, { checked: selected, className: darkMode ? 'border-gray-400' : '' }), jsx(Text$x, { children: name })] }), isAch ? (jsx(BankOutlined, { className: "bunny-pr-4" })) : isCard ? (jsx(CardIcon, { className: "bunny-pr-4" })) : (jsx(CardIcon, { className: "bunny-pr-4" }))] }));
19621
19848
  };
19622
19849
  const PaymentOptionContainer = defaultStyled.div `
19623
19850
  transition: border 0.3s ease;
@@ -19632,15 +19859,117 @@ const PaymentOptionContainer = defaultStyled.div `
19632
19859
  }
19633
19860
  `;
19634
19861
 
19635
- function useRemovePaymentMethod(paymentPlugins, apiHost, token, accountId, onRemovePaymentMethod, onError) {
19862
+ // Automatically sets the default payment method if there is none currently set
19863
+ const useAutoSetDefaultPaymentMethod = ({ handleSetDefault, setDefaultPaymentMethodLoading, enabled = true, }) => {
19864
+ const accountId = useAccountId();
19865
+ const token = useToken();
19866
+ const queryClient = useQueryClient();
19867
+ const { paymentMethods, defaultPaymentMethod } = usePaymentMethod({
19868
+ accountId,
19869
+ });
19870
+ // Set the default payment method on the cache. Prevents 'handleSetDefault' from being called too many times.
19871
+ function setDefaultPaymentMethodOnCache(targetPaymentMethod) {
19872
+ let cachedPaymentMethods = queryClient.getQueryData(QueryKeyFactory$1.default.accountPaymentMethodsKey({
19873
+ accountId,
19874
+ token,
19875
+ }));
19876
+ if (cachedPaymentMethods) {
19877
+ for (const paymentMethod of cachedPaymentMethods) {
19878
+ paymentMethod.isDefault = paymentMethod.id === targetPaymentMethod.id;
19879
+ }
19880
+ queryClient.setQueryData(QueryKeyFactory$1.default.accountPaymentMethodsKey({
19881
+ accountId,
19882
+ token,
19883
+ }), cachedPaymentMethods);
19884
+ }
19885
+ }
19886
+ useEffect(() => {
19887
+ var _a;
19888
+ if (setDefaultPaymentMethodLoading || !enabled)
19889
+ return;
19890
+ if ((paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.length) && (paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.length) > 0 && !defaultPaymentMethod) {
19891
+ handleSetDefault((_a = paymentMethods[0]) === null || _a === void 0 ? void 0 : _a.id);
19892
+ setDefaultPaymentMethodOnCache(paymentMethods[0]);
19893
+ }
19894
+ }, [
19895
+ paymentMethods,
19896
+ defaultPaymentMethod,
19897
+ handleSetDefault,
19898
+ setDefaultPaymentMethodLoading,
19899
+ queryClient,
19900
+ accountId,
19901
+ token,
19902
+ ]);
19903
+ };
19904
+
19905
+ const query$4 = t(`
19906
+ query GetCurrentUserData {
19907
+ company {
19908
+ name
19909
+ }
19910
+ currentUser {
19911
+ account {
19912
+ billingCountry
19913
+ currencyId
19914
+ id
19915
+ }
19916
+ authObjectName
19917
+ payload {
19918
+ returnUrl
19919
+ }
19920
+ privacyUrl
19921
+ termsUrl
19922
+ entityId
19923
+ }
19924
+ }
19925
+ `);
19926
+ const getCurrentUserData = async ({ token, apiHost }) => {
19927
+ var _a, _b, _c, _d, _e, _f, _g, _h;
19928
+ const response = await execute(query$4, { apiHost, token }, {});
19929
+ return {
19930
+ authObjectName: (_a = response === null || response === void 0 ? void 0 : response.currentUser) === null || _a === void 0 ? void 0 : _a.authObjectName,
19931
+ account: (_b = response === null || response === void 0 ? void 0 : response.currentUser) === null || _b === void 0 ? void 0 : _b.account,
19932
+ companyName: (_c = response === null || response === void 0 ? void 0 : response.company) === null || _c === void 0 ? void 0 : _c.name,
19933
+ returnUrl: (_e = (_d = response === null || response === void 0 ? void 0 : response.currentUser) === null || _d === void 0 ? void 0 : _d.payload) === null || _e === void 0 ? void 0 : _e.returnUrl,
19934
+ privacyUrl: (_f = response === null || response === void 0 ? void 0 : response.currentUser) === null || _f === void 0 ? void 0 : _f.privacyUrl,
19935
+ termsUrl: (_g = response === null || response === void 0 ? void 0 : response.currentUser) === null || _g === void 0 ? void 0 : _g.termsUrl,
19936
+ entityId: (_h = response === null || response === void 0 ? void 0 : response.currentUser) === null || _h === void 0 ? void 0 : _h.entityId,
19937
+ };
19938
+ };
19939
+
19940
+ const useCurrentUserData = (token) => {
19941
+ const { apiHost } = useContext(BunnyContext);
19942
+ const { data: currentUserData, isLoading: isCurrentUserDataLoading } = useQuery({
19943
+ queryKey: QueryKeyFactory$1.default.currentUserKey(token),
19944
+ queryFn: () => getCurrentUserData({ token, apiHost }),
19945
+ enabled: Boolean(token),
19946
+ });
19947
+ const currentUser = currentUserData || {};
19948
+ return { currentUser, isCurrentUserDataLoading };
19949
+ };
19950
+
19951
+ function usePayableCurrency({ payableCurrencyId }) {
19952
+ const token = useToken();
19953
+ const { currentUser, isCurrentUserDataLoading } = useCurrentUserData(token);
19954
+ const account = currentUser === null || currentUser === void 0 ? void 0 : currentUser.account;
19955
+ const accountCurrencyId = account === null || account === void 0 ? void 0 : account.currencyId;
19956
+ const currencyId = useMemo(() => { var _a; return (_a = (accountCurrencyId || payableCurrencyId)) === null || _a === void 0 ? void 0 : _a.toLowerCase(); }, [accountCurrencyId, payableCurrencyId]);
19957
+ return { currencyId, isCurrencyIdLoading: isCurrentUserDataLoading };
19958
+ }
19959
+
19960
+ function useRemovePaymentMethod(onRemovePaymentMethod, onError) {
19636
19961
  const queryClient = useQueryClient();
19637
19962
  const showErrorNotification = useErrorNotification();
19638
19963
  const showSuccessNotification = useSuccessNotification();
19964
+ const accountId = useAccountId();
19965
+ const { paymentPlugins } = usePaymentPlugins(accountId);
19966
+ const token = useToken();
19967
+ const { apiHost } = useContext(BunnyContext);
19639
19968
  const removePaymentMethod = useCallback(async (data) => {
19640
19969
  const plugin = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find(paymentPlugin => { var _a; return String(paymentPlugin.id) === ((_a = data === null || data === void 0 ? void 0 : data.plugin) === null || _a === void 0 ? void 0 : _a.id); });
19641
19970
  if (data && plugin) {
19642
19971
  await invokePlugin({
19643
- plugin,
19972
+ plugin: plugin, // TODO: type the plugin
19644
19973
  method: 'remove_payment_method',
19645
19974
  payload: {
19646
19975
  payment_method_id: data.id,
@@ -19664,34 +19993,48 @@ function useRemovePaymentMethod(paymentPlugins, apiHost, token, accountId, onRem
19664
19993
  });
19665
19994
  }
19666
19995
  else {
19667
- const availablePlugins = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name; });
19996
+ const availablePlugins = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.map((plugin) => { var _a, _b, _c; return (_c = (_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name; });
19668
19997
  onError === null || onError === void 0 ? void 0 : onError(`Either the payment method was not found or the plugin was not present. Available plugins: ${availablePlugins === null || availablePlugins === void 0 ? void 0 : availablePlugins.join(', ')}`);
19669
19998
  }
19670
19999
  }, [paymentPlugins, token, apiHost, queryClient]);
19671
20000
  return removePaymentMethod;
19672
20001
  }
19673
20002
 
19674
- function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, onError, onSuccess) {
19675
- const queryClient = useQueryClient();
20003
+ function useSetDefaultPaymentMethod(onError, onSuccess) {
20004
+ // Context
20005
+ const accountId = useAccountId();
20006
+ const token = useToken();
20007
+ const { apiHost } = useContext(BunnyContext);
20008
+ const { paymentPlugins } = usePaymentPlugins(accountId);
20009
+ const { paymentMethods } = usePaymentMethod({ accountId });
20010
+ // Hooks
19676
20011
  const showErrorNotification = useErrorNotification();
19677
20012
  const showSuccessNotification = useSuccessNotification();
20013
+ const queryClient = useQueryClient();
20014
+ // State
19678
20015
  const [loading, setLoading] = useState(false);
19679
- const setDefaultPaymentMethod = useCallback(async (data) => {
19680
- const plugin = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find(paymentPlugin => { var _a; return String(paymentPlugin.id) === ((_a = data === null || data === void 0 ? void 0 : data.plugin) === null || _a === void 0 ? void 0 : _a.id); });
19681
- if (data && plugin) {
20016
+ const setDefaultPaymentMethod = useCallback(async (paymentMethodId) => {
20017
+ const paymentMethod = paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.find(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) === paymentMethodId);
20018
+ if (paymentMethod === undefined) {
20019
+ showErrorNotification('Payment method not found', 'Error setting default payment method');
20020
+ return;
20021
+ }
20022
+ const plugin = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find(paymentPlugin => { var _a; return String(paymentPlugin.id) === ((_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.plugin) === null || _a === void 0 ? void 0 : _a.id); }); // TODO: type the response to PluginData
20023
+ if (plugin) {
19682
20024
  setLoading(true);
19683
20025
  await invokePlugin({
19684
- plugin,
20026
+ plugin: plugin,
19685
20027
  method: 'assign_default_payment_method',
19686
20028
  payload: {
19687
- payment_method_id: data.id,
20029
+ payment_method_id: paymentMethod.id,
19688
20030
  account_id: accountId,
19689
20031
  },
19690
20032
  token,
19691
20033
  apiHost,
19692
20034
  })
19693
20035
  .then(() => {
19694
- showSuccessNotification(`Payment method ${data.metadata.identifier} was set as default`, 'Success');
20036
+ var _a;
20037
+ showSuccessNotification(`Payment method ${(_a = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.metadata) === null || _a === void 0 ? void 0 : _a.identifier} was set as default`, 'Success');
19695
20038
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
19696
20039
  queryClient.invalidateQueries({
19697
20040
  queryKey: QueryKeyFactory$1.default.accountPaymentMethodsKey({
@@ -19709,7 +20052,7 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
19709
20052
  });
19710
20053
  }
19711
20054
  else {
19712
- const availablePlugins = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name; });
20055
+ const availablePlugins = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.map((plugin) => { var _a, _b, _c; return (_c = (_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name; });
19713
20056
  onError === null || onError === void 0 ? void 0 : onError(`Either the payment method was not found or the plugin was not present. Available plugins: ${availablePlugins === null || availablePlugins === void 0 ? void 0 : availablePlugins.join(', ')}`);
19714
20057
  }
19715
20058
  }, [paymentPlugins, token, apiHost, queryClient]);
@@ -19717,83 +20060,53 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
19717
20060
  }
19718
20061
 
19719
20062
  const showErrorNotification$4 = useErrorNotification();
19720
- const PaymentForm = ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }) => {
19721
- // Local state
19722
- const [showPaymentMethodForm, setShowPaymentMethodForm] = useState(false);
19723
- // Simple hooks
19724
- const queryClient = useQueryClient();
19725
- const { apiHost } = useContext(BunnyContext);
19726
- const tokenFromContexts = useToken();
19727
- const token = overrideToken || tokenFromContexts;
19728
- const { paymentMethods: storedPaymentMethods, defaultPaymentMethod, isLoading: isPaymentMethodLoading, } = usePaymentMethod({
19729
- accountId,
19730
- token,
19731
- apiHost,
19732
- });
19733
- // Complex hooks
19734
- const { paymentPlugins } = usePaymentPlugins({ apiHost, token, accountId });
19735
- const selectedPaymentMethodPlugin = useMemo(() => {
19736
- // TODO: consolate PluginData and PaymentPlugin into one type. Needs to be done on API side.
19737
- return paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find((plugin) => { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
19738
- }, [paymentPlugins, defaultPaymentMethod]);
19739
- // Derived state
19740
- const defaultPaymentMethodPlugin = paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find((plugin) => { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
19741
- const paying = Boolean(quote || invoice);
19742
- const { currencyId, isCurrencyIdLoading } = usePaymentFormCurrencyId({
19743
- quote,
19744
- invoice,
20063
+ function PaymentForm({ invoice, quote, onPaymentSuccess, onPaymentHoldSuccess, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }) {
20064
+ const { currencyId, isCurrencyIdLoading } = usePayableCurrency({
20065
+ payableCurrencyId: (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currencyId),
19745
20066
  });
19746
- const paymentRequired = quote ? getQuoteAmountDue(quote) > 0 : true;
20067
+ // Return early because PaymentForm should not be rendered without a valid currency ID.
20068
+ // For example, sepa / iDeal may not show for Dutch customer if no currencyId
20069
+ if (isCurrencyIdLoading) {
20070
+ return null;
20071
+ }
20072
+ if (!currencyId) {
20073
+ return jsx("div", { children: "PaymentForm error: No currency ID found from Quote or Invoice or props." });
20074
+ }
20075
+ // Wrap providers around the children
20076
+ const providers = [
20077
+ [ShowPaymentDetailsProvider, { value: undefined }],
20078
+ [CustomCheckoutFunctionProvider, { value: customCheckoutFunction }],
20079
+ ];
20080
+ return (jsx(Fragment, { children: providers.reduceRight((acc, [Provider, props]) => createElement(Provider, props, acc), jsx(OverrideTokenContext.Provider, { value: { overrideToken }, children: jsx(SelectedPluginProvider, { accountId: accountId, children: jsx(StripeWrapper, { currencyId: currencyId, accountId: accountId, children: jsx(PaymentProvider, { quote: quote, invoice: invoice, accountId: accountId, onPaymentHoldSuccess: onPaymentHoldSuccess, onPaymentSuccess: onPaymentSuccess, paymentHoldOptions: paymentHoldOptions !== null && paymentHoldOptions !== void 0 ? paymentHoldOptions : {}, onSavePaymentMethod: onSavePaymentMethod, children: jsx(PaymentFormContent, { onRemovePaymentMethod: onRemovePaymentMethod, onSetDefaultPaymentMethod: onSetDefaultPaymentMethod }) }) }) }) })) }));
20081
+ }
20082
+ function PaymentFormContent({ onRemovePaymentMethod, onSetDefaultPaymentMethod, }) {
20083
+ // Context
20084
+ const [showPaymentMethodForm, setShowPaymentMethodForm] = useShowPaymentDetails();
20085
+ const paymentType = usePaymentType();
20086
+ const isPaying = useIsPaying();
20087
+ const amountDue = useAmountDue();
20088
+ const selectedPlugin = useSelectedPlugin();
20089
+ const onPaymentFormSubmit = useHandlePaymentFormSubmit();
20090
+ const accountId = useAccountId();
20091
+ // Hooks
20092
+ const { paymentPlugins } = usePaymentPlugins(accountId);
20093
+ const { paymentMethods: maskedPaymentMethods, isLoading: isPaymentMethodLoading } = usePaymentMethod({ accountId });
20094
+ // Read fragments
20095
+ const paymentMethods = useMemo(() => maskedPaymentMethods === null || maskedPaymentMethods === void 0 ? void 0 : maskedPaymentMethods.map(paymentMethod => readFragment(PaymentForm_PaymentMethodsFragment, paymentMethod)), [maskedPaymentMethods]);
19747
20096
  // Custom hooks
19748
- const { setDefaultPaymentMethod: handleSetDefault, loading: setDefaultPaymentMethodLoading } = useSetDefaultPaymentMethod(paymentPlugins || [], apiHost, token, accountId, message => {
19749
- showErrorNotification$4(message, 'Error setting default payment method');
19750
- }, () => {
19751
- onSetDefaultPaymentMethod === null || onSetDefaultPaymentMethod === void 0 ? void 0 : onSetDefaultPaymentMethod();
19752
- });
19753
- useAutoSetDefaultPaymentMethod({
19754
- accountId,
19755
- token,
19756
- handleSetDefault,
19757
- setDefaultPaymentMethodLoading,
19758
- enabled: !!paymentPlugins,
19759
- });
19760
- const { selectorPaymentMethodPlugin, setSelectorPaymentMethodPlugin } = usePaymentMethodSelectorPlugin({
19761
- defaultPaymentMethod,
19762
- defaultPaymentMethodPlugin,
19763
- paymentMethodAllowedPlugins: paymentPlugins || [],
19764
- });
19765
- // Mutations
19766
- const { mutate: checkoutNoPayment, isPending: isCheckingOutNoPayment } = useMutation({
19767
- mutationFn: async () => {
19768
- if (!quote)
19769
- throw new Error('Quote is required');
19770
- if (paymentRequired)
19771
- throw new Error('Payment is required');
19772
- return await checkout({ quoteId: quote.id, token, apiHost });
19773
- },
19774
- onSuccess: () => {
19775
- handlePaymentSuccess();
19776
- },
19777
- onError: onFail,
20097
+ const { setDefaultPaymentMethod: handleSetDefault, loading: setDefaultPaymentMethodLoading } = useSetDefaultPaymentMethod(message => {
20098
+ showErrorNotification$4(message, 'Error setting default payment method');
20099
+ }, () => {
20100
+ onSetDefaultPaymentMethod === null || onSetDefaultPaymentMethod === void 0 ? void 0 : onSetDefaultPaymentMethod();
20101
+ });
20102
+ useAutoSetDefaultPaymentMethod({
20103
+ handleSetDefault,
20104
+ setDefaultPaymentMethodLoading,
20105
+ enabled: !!paymentPlugins,
19778
20106
  });
19779
- const onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost, token, accountId, onRemovePaymentMethod, message => {
20107
+ const onClickRemove = useRemovePaymentMethod(onRemovePaymentMethod, message => {
19780
20108
  showErrorNotification$4(message, 'Error removing payment method');
19781
20109
  });
19782
- const handlePaymentSuccess = () => {
19783
- // Hide payment method selector and form
19784
- setShowPaymentMethodForm(false);
19785
- onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess();
19786
- };
19787
- const handleSavePaymentMethod = (response) => {
19788
- queryClient.invalidateQueries({
19789
- queryKey: QueryKeyFactory$1.default.accountPaymentMethodsKey({
19790
- accountId,
19791
- token,
19792
- }),
19793
- });
19794
- onSavePaymentMethod === null || onSavePaymentMethod === void 0 ? void 0 : onSavePaymentMethod(response);
19795
- setShowPaymentMethodForm(false);
19796
- };
19797
20110
  function handleClickAddPaymentMethod() {
19798
20111
  if ((paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.length) === 0) {
19799
20112
  showErrorNotification$4('No payment plugins available', 'Error adding payment method');
@@ -19804,45 +20117,21 @@ const PaymentForm = ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess,
19804
20117
  }
19805
20118
  // Automatically show the payment method form if there are no payment methods
19806
20119
  useEffect(() => {
19807
- if ((storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.length) === 0) {
20120
+ if ((paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.length) === 0) {
19808
20121
  setShowPaymentMethodForm(true);
19809
20122
  }
19810
- }, [storedPaymentMethods]);
19811
- if (isPaymentMethodLoading || isCurrencyIdLoading) {
20123
+ }, [paymentMethods]);
20124
+ if (isPaymentMethodLoading) {
19812
20125
  return jsx(Skeleton, { active: true, className: "bunny-p-4" });
19813
20126
  }
19814
- // Return early because it is a bug if PaymentForm is rendered without a currency ID.
19815
- // For example, sepa / iDeal may not show for dutch customer if no currencyId
19816
- if (!currencyId) {
19817
- return jsx("div", { children: "PaymentForm error: No currency ID found from Quote or Invoice or props." });
19818
- }
19819
- return (jsx(PaymentContext.Provider, { value: {
19820
- onClickCancel: () => setShowPaymentMethodForm(false),
19821
- accountId,
19822
- overrideToken,
19823
- storedPaymentMethods,
19824
- defaultPaymentMethod,
19825
- customCheckoutFunction,
19826
- }, children: jsx(StripeWrapper, { plugin: selectorPaymentMethodPlugin, token: token, apiHost: apiHost, currencyId: currencyId, accountId: accountId, children: jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-0 bunny-w-full", children: jsx(Fragment, { children: paymentRequired ? (jsxs(Fragment, { children: [jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-px-4", children: [storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.map(paymentMethod => (jsx(MiniCreditCard, { onClickRemove: () => onClickRemove(paymentMethod), onClickSetDefault: () => handleSetDefault(paymentMethod), paymentMethodData: paymentMethod, id: `payment-method-${paymentMethod.id}` }, paymentMethod.id))), (storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.length) === 0 && (jsx(MiniCreditCard, { onClickRemove: () => { }, onClickSetDefault: () => { } }))] }), jsx(Collapse, { bordered: false, activeKey: showPaymentMethodForm ? '1' : undefined, ghost: true, collapsible: "disabled", destroyOnHidden: true, items: [
19827
- {
19828
- key: '1',
19829
- showArrow: false,
19830
- label: !showPaymentMethodForm ? (jsx("div", { className: "bunny-pt-2", children: jsx(Button, { onClick: handleClickAddPaymentMethod, type: "default", className: "bunny-w-full", id: "addPaymentMethod", children: "Add payment method" }) })) : null,
19831
- children: (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2", children: [jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins || [], value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsx("div", { className: "bunny-flex bunny-flex-col", children: jsx(PaymentMethodDetails, { onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) }))] })),
19832
- },
19833
- ] }), paying && defaultPaymentMethod && (jsx("div", { className: "bunny-px-4", children: jsx(CheckoutFooter, { quote: quote, invoice: invoice, onPaymentSuccess: handlePaymentSuccess, plugin: selectedPaymentMethodPlugin, onPaymentHoldSuccess: onPaymentHoldSuccess, paymentHoldOptions: paymentHoldOptions }) }))] })) : (jsx(Button, { style: { margin: '0 16px' }, loading: isCheckingOutNoPayment, onClick: () => checkoutNoPayment(), type: "primary", children: isCheckingOutNoPayment ? 'Processing...' : 'Complete Order' })) }) }) }) }));
19834
- };
19835
- function StripeWrapper({ children, plugin, token, apiHost, currencyId, accountId, }) {
19836
- const { stripe, options } = useStripePlugin(plugin, apiHost, currencyId || 'usd', token, accountId);
19837
- return (jsx(Elements, { options: options, stripe: stripe, children: children }));
19838
- }
19839
- function usePaymentFormCurrencyId({ quote, invoice, }) {
19840
- const token = useToken();
19841
- const { currentUser, isCurrentUserDataLoading } = useCurrentUserData(token);
19842
- const account = currentUser === null || currentUser === void 0 ? void 0 : currentUser.account;
19843
- const accountCurrencyId = account === null || account === void 0 ? void 0 : account.currencyId;
19844
- const currencyId = useMemo(() => { var _a; return (_a = (accountCurrencyId || (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currencyId))) === null || _a === void 0 ? void 0 : _a.toLowerCase(); }, [accountCurrencyId, quote === null || quote === void 0 ? void 0 : quote.currencyId, invoice === null || invoice === void 0 ? void 0 : invoice.currencyId]);
19845
- return { currencyId, isCurrencyIdLoading: isCurrentUserDataLoading };
20127
+ return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-0 bunny-w-full", children: paymentType === PaymentType.PAY || paymentType === PaymentType.APPROVE_HOLD ? (jsxs(Fragment, { children: [jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-px-4", children: [paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.map(paymentMethod => (jsx(MiniCreditCard, { onClickRemove: () => onClickRemove(paymentMethod), onClickSetDefault: () => handleSetDefault(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id), paymentMethod: paymentMethod, id: `payment-method-${paymentMethod.id}` }, paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id))), (paymentMethods === null || paymentMethods === void 0 ? void 0 : paymentMethods.length) === 0 && jsx(MiniCreditCard, {})] }), jsx(Collapse, { bordered: false, activeKey: showPaymentMethodForm ? '1' : undefined, ghost: true, collapsible: "disabled", destroyOnHidden: true, items: [
20128
+ {
20129
+ key: '1',
20130
+ showArrow: false,
20131
+ label: !showPaymentMethodForm ? (jsx("div", { className: "bunny-pt-2", children: jsx(Button, { onClick: handleClickAddPaymentMethod, type: "default", className: "bunny-w-full", id: "addPaymentMethod", children: "Add payment method" }) })) : null,
20132
+ children: (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2", children: [jsx(PaymentMethodSelector, {}), selectedPlugin && (jsx("div", { className: "bunny-flex bunny-flex-col", children: jsx(PaymentMethodDetails, {}) }))] })),
20133
+ },
20134
+ ] }), amountDue !== undefined && !showPaymentMethodForm && (jsx("div", { className: "bunny-px-4", children: jsx(CheckoutFooter, {}) }))] })) : (jsx(Button, { style: { margin: '0 16px' }, loading: isPaying, onClick: () => onPaymentFormSubmit(), type: "primary", children: isPaying ? 'Processing...' : 'Complete Order' })) }));
19846
20135
  }
19847
20136
 
19848
20137
  function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, shadow = 'shadow-md', className, hideDownloadButton = false, hidePaymentForm = false, onInvoiceLoaded, }) {
@@ -19863,12 +20152,11 @@ function ActualInvoice({ hidePaymentForm }) {
19863
20152
  // Context
19864
20153
  const queryClient = useQueryClient();
19865
20154
  const { id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onPaymentSuccess, className, } = useContext(InvoiceQuoteContext);
19866
- const { apiHost, onTokenExpired } = useContext(BunnyContext);
20155
+ const { apiHost } = useContext(BunnyContext);
19867
20156
  const { hideDownloadButton, onInvoiceLoaded } = useContext(InvoiceQuoteContext);
19868
20157
  const token = useToken();
19869
20158
  // Hooks
19870
20159
  const showSuccessNotification = useSuccessNotification();
19871
- const handleAllErrorFormats = useAllErrorFormats$1(onTokenExpired);
19872
20160
  // Queries
19873
20161
  const { data: formattedInvoice } = useQuery({
19874
20162
  queryKey: QueryKeyFactory$1.default.createFormattedInvoiceKey({ id, token }),
@@ -19877,7 +20165,7 @@ function ActualInvoice({ hidePaymentForm }) {
19877
20165
  // Derived state
19878
20166
  const isInvoicePayable = PAYABLE_INVOICE_STATES.includes((formattedInvoice === null || formattedInvoice === void 0 ? void 0 : formattedInvoice.state) || '');
19879
20167
  // Local state
19880
- const isMobile = useIsMobile(isInvoicePayable ? BreakpointNumbers.lg : undefined);
20168
+ const isMobile = useIsMobile$1(isInvoicePayable ? BreakpointNumbers$1.lg : undefined);
19881
20169
  const onSuccess = () => {
19882
20170
  queryClient.invalidateQueries({
19883
20171
  queryKey: QueryKeyFactory$1.default.transactionsKey({ token }),
@@ -19891,9 +20179,6 @@ function ActualInvoice({ hidePaymentForm }) {
19891
20179
  showSuccessNotification('Your invoice has been paid', 'Payment successful');
19892
20180
  onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess();
19893
20181
  };
19894
- const onFail = (error) => {
19895
- handleAllErrorFormats(error.message);
19896
- };
19897
20182
  useEffect(() => {
19898
20183
  if (formattedInvoice) {
19899
20184
  onInvoiceLoaded === null || onInvoiceLoaded === void 0 ? void 0 : onInvoiceLoaded(formattedInvoice);
@@ -19901,7 +20186,7 @@ function ActualInvoice({ hidePaymentForm }) {
19901
20186
  }, [formattedInvoice]);
19902
20187
  if (!formattedInvoice)
19903
20188
  return jsx(Fragment, {});
19904
- return (jsx("div", { className: "bunny-invoice-container", children: jsxs("div", { className: `bunny-flex bunny-gap-6 ${isMobile ? 'bunny-flex-col bunny-w-full' : ''} ${className}`, children: [formattedInvoice.isLegacy ? (jsx("div", { className: "bunny-flex bunny-justify-center bunny-w-full", children: jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) })) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && !hidePaymentForm && (jsx("div", { className: `bunny-w-full ${hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12'}`, children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) }))] }) }));
20189
+ return (jsx("div", { className: "bunny-invoice-container", children: jsxs("div", { className: `bunny-flex bunny-gap-6 ${isMobile ? 'bunny-flex-col bunny-w-full' : ''} ${className}`, children: [formattedInvoice.isLegacy ? (jsx("div", { className: "bunny-flex bunny-justify-center bunny-w-full", children: jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) })) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && !hidePaymentForm && (jsx("div", { className: `bunny-w-full ${hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12'}`, children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, invoice: formattedInvoice }) }))] }) }));
19905
20190
  }
19906
20191
 
19907
20192
  const MUTATION$8 = () => `
@@ -20219,8 +20504,53 @@ const useSigningComplete = ({ data, token }) => {
20219
20504
  }, [data, eventParam, queryClient, token]);
20220
20505
  };
20221
20506
 
20507
+ var dayjs_min$1 = {exports: {}};
20508
+
20509
+ var dayjs_min = dayjs_min$1.exports;
20510
+
20511
+ var hasRequiredDayjs_min;
20512
+
20513
+ function requireDayjs_min () {
20514
+ if (hasRequiredDayjs_min) return dayjs_min$1.exports;
20515
+ hasRequiredDayjs_min = 1;
20516
+ (function (module, exports) {
20517
+ !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
20518
+ } (dayjs_min$1));
20519
+ return dayjs_min$1.exports;
20520
+ }
20521
+
20522
+ var dayjs_minExports = requireDayjs_min();
20523
+ var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
20524
+
20222
20525
  const useIsExpired = (expiresAt) => dayjs(expiresAt).diff(dayjs(dayjs().format("YYYY-MM-DD"))) < 0;
20223
20526
 
20527
+ const tagStyleMap = {
20528
+ blue: { color: 'var(--bunny-blue-500)', background: 'var(--bunny-blue-200)' },
20529
+ green: {
20530
+ color: 'var(--bunny-green-600)',
20531
+ background: 'var(--bunny-green-200)',
20532
+ },
20533
+ red: { color: 'var(--bunny-red-500)', background: 'var(--bunny-red-200)' },
20534
+ orange: {
20535
+ color: 'var(--bunny-orange-500)',
20536
+ background: 'var(--bunny-orange-200)',
20537
+ },
20538
+ yellow: {
20539
+ color: 'var(--bunny-yellow-500)',
20540
+ background: 'var(--bunny-yellow-200)',
20541
+ },
20542
+ purple: {
20543
+ color: 'var(--bunny-purple-500)',
20544
+ background: 'var(--bunny-purple-200)',
20545
+ },
20546
+ black: { color: 'white', background: 'var(--bunny-black)' },
20547
+ };
20548
+ // This component provides custom styling for antd Tag components without using antd overwrites.
20549
+ // Please use this component instead of the antd Tag component directly to maintain consistent styling.
20550
+ const CustomizedTag = ({ children, color, className, style, }) => {
20551
+ return (jsx(Tag, { color: color, style: { ...(color ? tagStyleMap[color] : undefined), ...style }, className: `bunny-m-0 bunny-rounded-full bunny-border-none bunny-whitespace-nowrap ${className}`, children: children }));
20552
+ };
20553
+
20224
20554
  const POLLING_INTERVAL = 2000;
20225
20555
  const PandadocPollingModal = ({ isVisible, setVisible, id }) => {
20226
20556
  const { apiHost, onTokenExpired } = useContext(BunnyContext);
@@ -20339,15 +20669,13 @@ const PaymentHoldModal = ({ visible, setVisible, quote, }) => {
20339
20669
  const token = useToken();
20340
20670
  return (jsxs(StyledModal$2, { centered: true, onCancel: () => {
20341
20671
  setVisible(false);
20342
- }, footer: null, open: visible, width: 600, children: [jsxs("div", { className: "bunny-mt-5 bunny-pb-4 bunny-mx-4", children: [jsx(Title$2, { className: "bunny-mt-0", level: 5, children: "Pay to accept" }), jsxs(Text$w, { className: "bunny-bt-2 bunny-text-sm/5 bunny-text-gray-500", children: ["To accept this quote, approve a payment hold for", ' ', formatCurrency$1(quote.amount, quote.currency), ". This amount will be charged to your payment method once the quote is signed."] })] }), jsx("div", { className: "bunny-mb-3", children: jsx(PaymentForm, { quote: {
20672
+ }, footer: null, open: visible, width: 600, children: [jsxs("div", { className: "bunny-mt-5 bunny-pb-4 bunny-mx-4", children: [jsx(Title$2, { className: "bunny-mt-0", level: 5, children: "Pay now" }), jsxs(Text$w, { className: "bunny-bt-2 bunny-text-sm/5 bunny-text-gray-500", children: ["To accept this quote, approve a payment hold for", ' ', formatCurrency$1(quote.amount, quote.currency), ". This amount will be charged to your payment method once the quote is signed."] })] }), jsx("div", { className: "bunny-mb-3", children: jsx(PaymentForm, { quote: {
20343
20673
  amount: quote.amount,
20344
20674
  currencyId: quote.currency,
20345
20675
  id: quote.quote.id,
20346
20676
  }, paymentHoldOptions: {
20347
20677
  payToAccept: true,
20348
20678
  amountToHold: quote.amount,
20349
- }, onFail: () => {
20350
- setVisible(false);
20351
20679
  }, onPaymentSuccess: () => {
20352
20680
  setVisible(false);
20353
20681
  }, onPaymentHoldSuccess: () => {
@@ -20445,7 +20773,7 @@ function ActualQuote({ onQuoteAccepted }) {
20445
20773
  onQuoteAccepted,
20446
20774
  });
20447
20775
  useSigningComplete({ data: formattedQuote, token });
20448
- const isMobile = useIsMobile();
20776
+ const isMobile = useIsMobile$1();
20449
20777
  useEffect(() => {
20450
20778
  if (formattedQuote) {
20451
20779
  onQuoteLoaded === null || onQuoteLoaded === void 0 ? void 0 : onQuoteLoaded(formattedQuote);
@@ -20483,7 +20811,7 @@ function QuoteButtons({ isAccepted, formattedQuote, isMobile, hideDownloadButton
20483
20811
  const signingPlugins = useSigningPlugins({ apiHost, token });
20484
20812
  return (jsxs("div", { className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
20485
20813
  color: secondaryColor,
20486
- }, children: [isAccepted && formattedQuote.acceptedAt ? (jsx(Text$v, { children: `Quote was accepted by ${formattedQuote.acceptedByName} on ${formatDate(formattedQuote.acceptedAt)}` })) : null, (!isMobile || !isAccepted) && (jsxs("div", { className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2', children: [paymentHold ? (jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsx(Button, { icon: jsx(DownloadOutlined, {}), onClick: () => downloadFile(apiHost + '/api/pdf/quote', token), children: "Download" })) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsx(Button, { disabled: isExpired, onClick: () => setPaymentHoldModalVisible(true), type: "primary", children: "Pay to accept" })) : (jsx(Fragment, { children: !isAccepted ? (jsx(Button, { disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary", children: isExpired
20814
+ }, children: [isAccepted && formattedQuote.acceptedAt ? (jsx(Text$v, { children: `Quote was accepted by ${formattedQuote.acceptedByName} on ${formatDate(formattedQuote.acceptedAt)}` })) : null, (!isMobile || !isAccepted) && (jsxs("div", { className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2', children: [paymentHold ? (jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsx(Button, { icon: jsx(DownloadOutlined, {}), onClick: () => downloadFile(apiHost + '/api/pdf/quote', token), children: "Download" })) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsx(Button, { disabled: isExpired, onClick: () => setPaymentHoldModalVisible(true), type: "primary", children: "Pay now" })) : (jsx(Fragment, { children: !isAccepted ? (jsx(Button, { disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary", children: isExpired
20487
20815
  ? 'Quote is expired'
20488
20816
  : (signingPlugins === null || signingPlugins === void 0 ? void 0 : signingPlugins.length)
20489
20817
  ? 'Start signing'
@@ -20617,7 +20945,7 @@ const TransactionDownload = ({ transaction, token, apiHost, }) => {
20617
20945
  const { darkMode } = useContext(BunnyContext);
20618
20946
  const { downloadTransactionLink } = useContext(TransactionsListContext);
20619
20947
  const downloadFile = useDownloadFile();
20620
- const isMobile = useIsMobile();
20948
+ const isMobile = useIsMobile$1();
20621
20949
  const isClickable = transaction.kind === 'INVOICE' || downloadTransactionLink !== undefined;
20622
20950
  const downloadLink = downloadTransactionLink
20623
20951
  ? downloadTransactionLink(transaction.transactionableId)
@@ -20795,7 +21123,7 @@ function TransactionsDisplay({ transactions, onSearchValueChanged, search, }) {
20795
21123
  const [drawerOpen, setDrawerOpen] = useState(false);
20796
21124
  const updatedTransactions = (_b = (_a = transactions === null || transactions === void 0 ? void 0 : transactions.filter((transaction) => !kindsToShow || kindsToShow.includes(transaction.kind))) === null || _a === void 0 ? void 0 : _a.filter(filterTransactions || (() => true))) === null || _b === void 0 ? void 0 : _b.sort(sortTransactions || (() => 0));
20797
21125
  // Hooks
20798
- const isMobile = useIsMobile();
21126
+ const isMobile = useIsMobile$1();
20799
21127
  function handleTransactionClick(transaction) {
20800
21128
  if (onTransactionClick) {
20801
21129
  onTransactionClick(transaction);
@@ -20959,6 +21287,14 @@ function QuotesWrapper() {
20959
21287
  return (jsx(TransactionsDisplay, { transactions: quotesAsTransactions, onSearchValueChanged: setSearch, search: search }));
20960
21288
  }
20961
21289
 
21290
+ const useHasTaxPlugin = ({ apiHost, token, }) => {
21291
+ const { data: plugins } = usePlugins({
21292
+ apiHost,
21293
+ token,
21294
+ });
21295
+ return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
21296
+ };
21297
+
20962
21298
  const MUTATION$7 = () => `
20963
21299
  mutation AccountSignup (
20964
21300
  $pluginId: String!,
@@ -21302,14 +21638,6 @@ const getTaxationRequiredAccountFields = async ({ apiHost, token, }) => {
21302
21638
  : null;
21303
21639
  };
21304
21640
 
21305
- const useHasTaxPlugin = ({ apiHost, token, }) => {
21306
- const { data: plugins } = usePlugins({
21307
- apiHost,
21308
- token,
21309
- });
21310
- return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
21311
- };
21312
-
21313
21641
  const BunnyFooterIcon = ({ color }) => {
21314
21642
  return (jsxs("svg", { width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxs("g", { clipPath: "url(#clip0_6_851)", children: [jsx("path", { className: "bunny-icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_6_851", children: jsx("rect", { width: "39", height: "13", fill: "white" }) }) })] }));
21315
21643
  };
@@ -21319,12 +21647,12 @@ const Footer = ({ className }) => {
21319
21647
  const token = useToken();
21320
21648
  const { currentUser } = useCurrentUserData(token);
21321
21649
  const { privacyUrl, termsUrl } = currentUser;
21322
- const isMobile = useIsMobile();
21650
+ const isMobile = useIsMobile$1();
21323
21651
  return (jsxs("div", { className: `bunny-flex bunny-items-center bunny-justify-between bunny-shrink-0 ${isMobile ? 'bunny-flex-col bunny-gap-2' : ''} ${className}`, children: [(termsUrl || privacyUrl) && (jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-3", children: [termsUrl && (jsx(StyedLink, { className: "bunny-text-xs bunny-text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text", children: "Terms" })), privacyUrl && (jsx(StyedLink, { className: "bunny-text-xs bunny-text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text", children: "Privacy" }))] })), jsx(BunnyMarketingLink, {})] }));
21324
21652
  };
21325
21653
  const BunnyMarketingLink = () => {
21326
21654
  const [isHovered, setIsHovered] = useState(false);
21327
- const isMobile = useIsMobile();
21655
+ const isMobile = useIsMobile$1();
21328
21656
  return (jsx("div", { className: `bunny-flex bunny-items-end bunny-justify-end ${isMobile ? '' : 'grow'}`, children: jsx(StyledBunnyLink, { className: "bunny-flex bunny-items-end bunny-justify-end bunny-text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", children: jsxs("div", { className: "bunny-flex bunny-items-center", onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [jsx(Text$o, { className: "bunny-text-slate-400", children: "Powered by\u00A0" }), jsx("div", { style: { paddingTop: '5px' }, children: jsx(BunnyFooterIcon, { color: isHovered ? PRIMARY_COLOR : SLATE_400 }) })] }) }) }));
21329
21657
  };
21330
21658
  const StyedLink = styled.a `
@@ -21464,21 +21792,10 @@ const useUpdateCoupons = ({ apiHost, token, quoteChangeId, onCouponAdded, onCoup
21464
21792
  };
21465
21793
  };
21466
21794
 
21467
- var SubscriptionState;
21468
- (function (SubscriptionState) {
21469
- SubscriptionState["ACTIVE"] = "ACTIVE";
21470
- SubscriptionState["TRIAL"] = "TRIAL";
21471
- SubscriptionState["PENDING"] = "PENDING";
21472
- SubscriptionState["EXPIRED"] = "EXPIRED";
21473
- SubscriptionState["CANCELED"] = "CANCELED";
21474
- SubscriptionState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
21475
- })(SubscriptionState || (SubscriptionState = {}));
21476
- var SubscriptionState$1 = SubscriptionState;
21477
-
21478
21795
  function shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) {
21479
21796
  var _a, _b;
21480
- const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$1.TRIAL ||
21481
- ((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL_EXPIRED;
21797
+ const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL') ||
21798
+ ((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED');
21482
21799
  function upgradingFromFree() {
21483
21800
  const totalPrice = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges.reduce((acc, charge) => acc + Number((charge === null || charge === void 0 ? void 0 : charge.discountedPrice) || 0), 0);
21484
21801
  return totalPrice === 0;
@@ -21664,7 +21981,7 @@ const QuoteCheckout = ({ account, onSuccess, onFail, quote: maskedQuote, taxatio
21664
21981
  const { apiHost } = useContext(BunnyContext);
21665
21982
  const { upgradingSubscription } = useContext(SubscriptionsContext);
21666
21983
  const token = useToken();
21667
- const isMobile = useIsMobile();
21984
+ const isMobile = useIsMobile$1();
21668
21985
  const [isSaving, setIsSaving] = useState(false);
21669
21986
  const paymentRequired = getQuoteAmountDue(quote) > 0;
21670
21987
  const queryClient = useQueryClient();
@@ -21720,7 +22037,7 @@ const QuoteCheckout = ({ account, onSuccess, onFail, quote: maskedQuote, taxatio
21720
22037
  }
21721
22038
  if (taxationRequiredAccountFields)
21722
22039
  return (jsx(PaymentFormWrapper, { setMaxHeight: false, children: jsx(TaxationForm, { account: account, accountId: quote.accountId }) }));
21723
- return (jsx(Fragment, { children: paymentRequired ? (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-w-full", children: [jsx(PaymentForm, { onFail: onFail, onPaymentSuccess: onSuccess, quote: quote }), (couponsOnQuote === null || couponsOnQuote === void 0 ? void 0 : couponsOnQuote.length) === 0 ? (jsx(Fragment, { children: upgradingSubscription &&
22040
+ return (jsx(Fragment, { children: paymentRequired ? (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-w-full", children: [jsx(PaymentForm, { onPaymentSuccess: onSuccess, quote: quote }), (couponsOnQuote === null || couponsOnQuote === void 0 ? void 0 : couponsOnQuote.length) === 0 ? (jsx(Fragment, { children: upgradingSubscription &&
21724
22041
  shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) && (jsx(CouponEditor, { className: "bunny-px-4 bunny-pt-1", quote: quote, onAddCoupon: addCoupon, isAddingCoupon: isAddingCoupon, couponCode: couponCode, setCouponCode: setCouponCode })) })) : (jsx(Button, { type: "link", loading: isRemovingCoupon, onClick: () => {
21725
22042
  couponsOnQuote === null || couponsOnQuote === void 0 ? void 0 : couponsOnQuote.forEach(couponCharge => {
21726
22043
  var _a;
@@ -21732,7 +22049,7 @@ const QuoteCheckout = ({ account, onSuccess, onFail, quote: maskedQuote, taxatio
21732
22049
  }, children: "Remove coupon(s)" }))] })) : (jsx(PaymentFormWrapper, { setMaxHeight: false, children: jsxs("div", { className: `bunny-flex bunny-flex-col bunny-gap-2 bunny-px-4 ${isMobile ? 'bunny-shadow-padding-x' : ''}`, children: [jsx(Button, { onClick: handleCheckoutNoPayment, type: "primary", children: isSaving ? 'Processing...' : 'Complete order' }), jsx("div", { className: "bunny-text-xs bunny-text-slate-500", children: "No payment is required" })] }) })) }));
21733
22050
  };
21734
22051
  const PaymentFormWrapper = ({ children, setMaxHeight, className, }) => {
21735
- const isMobile = useIsMobile();
22052
+ const isMobile = useIsMobile$1();
21736
22053
  return (jsx("div", { className: `bunny-flex bunny-w-full bunny-flex-col bunny-gap-6 ${isMobile ? 'bunny-shadow-padding-xb' : ''} ${className}`, style: {
21737
22054
  ...(isMobile
21738
22055
  ? setMaxHeight
@@ -21759,7 +22076,7 @@ const Checkout_QuoteFragment = t(`
21759
22076
  const Checkout = ({ onCancel, onSuccess, onFail, invoice, open, quote: maskedQuote, isUpdatingQuote, }) => {
21760
22077
  var _a, _b, _c, _d, _e;
21761
22078
  const { apiHost } = useContext(BunnyContext);
21762
- const isMobile = useIsMobile();
22079
+ const isMobile = useIsMobile$1();
21763
22080
  const token = useToken();
21764
22081
  // Read fragments
21765
22082
  const quote = readFragment(Checkout_QuoteFragment, maskedQuote);
@@ -21822,15 +22139,13 @@ const Checkout = ({ onCancel, onSuccess, onFail, invoice, open, quote: maskedQuo
21822
22139
  return (jsx("div", { className: `bunny-flex bunny-flex-col bunny-fixed bunny-top-0 bunny-left-0 bunny-right-0 bunny-bottom-0 bunny-bg-slate-50
21823
22140
  bunny-overflow-auto bunny-height-full`, style: {
21824
22141
  zIndex: 1001,
21825
- }, children: jsxs("div", { className: `bunny-flex bunny-flex-col bunny-grow bunny-pt-4 ${isMobile ? 'bunny-pb-4' : 'bunny-pb-8'} bunny-content-container`, children: [jsx("div", { className: "bunny-flex bunny-justify-end bunny-w-full bunny-pr-4", children: jsx(CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) }), jsxs("div", { className: `bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ${isMobile ? 'bunny-flex-col' : 'bunny-shadow-padding-xb'}`, children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsx(InvoiceQuoteView, { html: invoice ? invoice.html : (_d = (_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html) !== null && _d !== void 0 ? _d : '' })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_e = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _e === void 0 ? void 0 : _e.html)) && (jsx(Divider, { className: "bunny-h-full", type: "vertical" })), invoice ? (jsx("div", { className: "bunny-w-full bunny-pt-12", children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice }) })) : quote ? (jsx(QuoteCheckout, { account: account, onFail: error => {
22142
+ }, children: jsxs("div", { className: `bunny-flex bunny-flex-col bunny-grow bunny-pt-4 ${isMobile ? 'bunny-pb-4' : 'bunny-pb-8'} bunny-content-container`, children: [jsx("div", { className: "bunny-flex bunny-justify-end bunny-w-full bunny-pr-4", children: jsx(CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) }), jsxs("div", { className: `bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ${isMobile ? 'bunny-flex-col' : 'bunny-shadow-padding-xb'}`, children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsx(InvoiceQuoteView, { html: invoice ? invoice.html : (_d = (_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html) !== null && _d !== void 0 ? _d : '' })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_e = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _e === void 0 ? void 0 : _e.html)) && (jsx(Divider, { className: "bunny-h-full", type: "vertical" })), invoice ? (jsx("div", { className: "bunny-w-full bunny-pt-12", children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, invoice: invoice }) })) : quote ? (jsx(QuoteCheckout, { account: account, onFail: error => {
21826
22143
  onFail(error);
21827
22144
  }, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token, onRecalculateTaxes: async () => {
21828
22145
  if (recalculateTaxesEnabled) {
21829
22146
  await recalculateTaxes();
21830
22147
  }
21831
- } })) : (jsx(PaymentForm, { onFail: error => {
21832
- onFail(error);
21833
- }, onPaymentSuccess: onSuccess }))] }), jsx(Footer, { className: "bunny-px-12" })] }) }));
22148
+ } })) : (jsx(PaymentForm, { onPaymentSuccess: onSuccess }))] }), jsx(Footer, { className: "bunny-px-12" })] }) }));
21834
22149
  };
21835
22150
 
21836
22151
  const QuoteContext = createContext({});
@@ -21839,7 +22154,7 @@ const { Text: Text$n } = Typography;
21839
22154
  const CheckoutBarInput = ({ disabled, priceListCharge, quantity, onQuantityChanged, }) => {
21840
22155
  var _a;
21841
22156
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
21842
- const isMobile = useIsMobile();
22157
+ const isMobile = useIsMobile$1();
21843
22158
  useEffect(() => {
21844
22159
  setTimeout(() => {
21845
22160
  setIsTooltipOpen(true);
@@ -21920,29 +22235,29 @@ function hasUnpurchasedAddonPriceLists(maskedPriceListAddonPlans, currentSubscri
21920
22235
 
21921
22236
  const canSubscriptionUpgradeFromTrial = (subscription) => {
21922
22237
  var _a;
21923
- return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL &&
22238
+ return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL') &&
21924
22239
  subscription.plan.selfServiceBuy) ||
21925
22240
  false;
21926
22241
  };
21927
22242
  const canSubscriptionUpgradeFromTrialExpired = (subscription) => {
21928
22243
  var _a;
21929
- return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED &&
22244
+ return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED') &&
21930
22245
  subscription.plan.selfServiceBuy) ||
21931
22246
  false;
21932
22247
  };
21933
22248
  const isSubscriptionNotActive = (subscription) => {
21934
22249
  var _a, _b, _c;
21935
- return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
21936
- ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.CANCELED ||
21937
- ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED;
22250
+ return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'EXPIRED') ||
22251
+ ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'CANCELED') ||
22252
+ ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED');
21938
22253
  };
21939
22254
  const isSubscriptionActiveOrPending = (subscription) => {
21940
22255
  var _a, _b;
21941
- return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.ACTIVE ||
21942
- ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.PENDING;
22256
+ return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'ACTIVE') ||
22257
+ ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'PENDING');
21943
22258
  };
21944
- const isSubscriptionTrial = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL; };
21945
- const isSubscriptionTrialExpired = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED; };
22259
+ const isSubscriptionTrial = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL'); };
22260
+ const isSubscriptionTrialExpired = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED'); };
21946
22261
  // Helper function to check if charge is a discount
21947
22262
  const isDiscount$1 = (kind) => kind === QuoteChangeKind.DISCOUNT || kind === QuoteChangeKind.FREE_PERIOD_DISCOUNT;
21948
22263
  const hasPriceTiers = (charge) => {
@@ -22024,7 +22339,7 @@ const isPriceListDisabled = ({ priceList, upgradingSubscription, }) => {
22024
22339
  };
22025
22340
 
22026
22341
  const CheckoutButton = ({ checkoutButtonDisabled, onClickCheckout, loading, tooltipText, }) => {
22027
- const isMobile = useIsMobile();
22342
+ const isMobile = useIsMobile$1();
22028
22343
  const TooltipWrapper = ({ children }) => {
22029
22344
  if (tooltipText) {
22030
22345
  return jsx(Tooltip, { title: tooltipText, children: children });
@@ -22035,7 +22350,7 @@ const CheckoutButton = ({ checkoutButtonDisabled, onClickCheckout, loading, tool
22035
22350
  };
22036
22351
 
22037
22352
  const CheckoutPrice = ({ isUsage, quote, selectedPriceList, }) => {
22038
- const isMobile = useIsMobile();
22353
+ const isMobile = useIsMobile$1();
22039
22354
  if (!isUsage && (!selectedPriceList || (quote === null || quote === void 0 ? void 0 : quote.periodAmount) === undefined))
22040
22355
  return null;
22041
22356
  const convertedPeriodMonths = periodMonthsConverter(selectedPriceList.periodMonths);
@@ -22051,20 +22366,14 @@ const { Text: Text$m } = Typography;
22051
22366
  const CheckoutBarSummarySection = ({ open, selectedPriceList, onClickCheckout, }) => {
22052
22367
  var _a;
22053
22368
  // Context
22054
- const { apiHost } = useContext(BunnyContext);
22055
22369
  const { quote: quoteData, isQuotePending, isUpdatingQuote } = useContext(QuoteContext);
22056
22370
  const quote = quoteData;
22057
- const { accountId } = useContext(PaymentContext);
22058
22371
  const { upgradingSubscription, isInPreviewMode } = useContext(SubscriptionsContext);
22059
22372
  // Hooks
22060
22373
  const token = useToken();
22061
- const { paymentPlugins } = usePaymentPlugins({
22062
- apiHost,
22063
- token,
22064
- accountId,
22065
- });
22374
+ const { paymentPlugins } = usePaymentPlugins(undefined);
22066
22375
  const queryClient = useQueryClient();
22067
- const isMobile = useIsMobile();
22376
+ const isMobile = useIsMobile$1();
22068
22377
  // Derived state
22069
22378
  const isFetching = queryClient.isFetching({
22070
22379
  queryKey: QueryKeyFactory$1.default.planChangeOptionsKey({
@@ -22114,7 +22423,7 @@ const PlanPickerCheckoutBar = ({ selectedPriceList, handlePortalErrors, onChecko
22114
22423
  const token = useToken();
22115
22424
  const showSuccessNotification = useSuccessNotification();
22116
22425
  const queryClient = useQueryClient();
22117
- const isMobile = useIsMobile();
22426
+ const isMobile = useIsMobile$1();
22118
22427
  const handleCheckoutSuccess = () => {
22119
22428
  queryClient.refetchQueries({
22120
22429
  queryKey: QueryKeyFactory$1.default.createTableKey({
@@ -22320,12 +22629,12 @@ const CheckoutSummaryDivider = () => {
22320
22629
  };
22321
22630
 
22322
22631
  const { Title: Title$1 } = Typography;
22323
- function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }) {
22324
- return (jsx(Fragment, { children: quote ? (jsx(Fragment, { children: overrideToken ? (jsxs(Fragment, { children: [jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Payment" }), jsx("div", { className: "bunny-overflow-y-auto bunny-max-h-[calc(100vh-10rem)]", children: jsx(PaymentForm, { onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction }) })] })) : null })) : (jsxs(Fragment, { children: [jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Signup" }), jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment, defaultValues: defaultValues })] })) }));
22632
+ function PaymentForms({ quote, handlePaymentSuccess, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }) {
22633
+ return (jsx(Fragment, { children: quote ? (jsx(Fragment, { children: overrideToken ? (jsxs(Fragment, { children: [jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Payment" }), jsx("div", { className: "bunny-overflow-y-auto bunny-max-h-[calc(100vh-10rem)]", children: jsx(PaymentForm, { onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction }) })] })) : null })) : (jsxs(Fragment, { children: [jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Signup" }), jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment, defaultValues: defaultValues })] })) }));
22325
22634
  }
22326
22635
  function InitialSignupForm({ className, onSubmit, submitting, defaultValues, }) {
22327
22636
  const [form] = Form.useForm();
22328
- const isMobile = useIsMobile();
22637
+ const isMobile = useIsMobile$1();
22329
22638
  function handleSubmit() {
22330
22639
  form.validateFields({ validateOnly: false }).then(() => {
22331
22640
  onSubmit(form.getFieldsValue());
@@ -22366,7 +22675,7 @@ const { Text: Text$j } = Typography;
22366
22675
  function PriceListDisplay({ priceListData }) {
22367
22676
  if (!priceListData)
22368
22677
  return null;
22369
- return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-space-y-8", children: [jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxs(Text$j, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [priceListData.product.name, " ", priceListData.name] }), jsxs(Text$j, { className: "bunny-font-bold bunny-text-xl", children: [formatCurrency$1(priceListData.basePrice, priceListData.currencyId), " / month"] })] }), priceListData.trialAllowed ? (jsxs("div", { className: "bunny-flex bunny-flex-col", children: [jsxs(Text$j, { style: { fontSize: '16px' }, className: "bunny-text-slate-500", children: [priceListData.trialLengthDays, " day trial"] }), jsx(Text$j, { className: "bunny-text-slate-500", style: { fontSize: '12px' }, children: "You will not be charged until the last day of the trial." })] })) : null] }));
22678
+ return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-space-y-8", children: jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxs(Text$j, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [priceListData.product.name, " ", priceListData.name] }), jsxs(Text$j, { className: "bunny-font-bold bunny-text-xl", children: [formatCurrency$1(priceListData.basePrice, priceListData.currencyId), " / month"] })] }) }));
22370
22679
  }
22371
22680
 
22372
22681
  const showErrorNotification$1 = useErrorNotification();
@@ -22376,7 +22685,7 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22376
22685
  // Hooks
22377
22686
  const { apiHost } = useContext(BunnyContext);
22378
22687
  const tokenFromContexts = useToken();
22379
- const isMobile = useIsMobile();
22688
+ const isMobile = useIsMobile$1();
22380
22689
  const { topNavImageUrl } = useBrand();
22381
22690
  const defaultValues = useMemo(() => ({
22382
22691
  firstName: defaultFirstName,
@@ -22393,13 +22702,11 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22393
22702
  const [purchaseSucceeded, setPurchaseSucceeded] = useState(false);
22394
22703
  const defaultCouponAppliedRef = useRef(undefined);
22395
22704
  const [couponEditorCouponCode, setCouponEditorCouponCode] = useState('');
22396
- const { defaultPaymentMethod } = usePaymentMethod({
22397
- accountId,
22398
- token,
22705
+ const hasTaxPlugin = useHasTaxPlugin({
22399
22706
  apiHost,
22400
- enabled: Boolean(accountId),
22707
+ token,
22401
22708
  });
22402
- const { mutate: recalculateTaxes } = useMutation({
22709
+ const { mutate: recalculateTaxesMutation } = useMutation({
22403
22710
  mutationFn: () => {
22404
22711
  if (!(quote === null || quote === void 0 ? void 0 : quote.id)) {
22405
22712
  throw new Error('Quote ID is required');
@@ -22453,6 +22760,8 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22453
22760
  }),
22454
22761
  });
22455
22762
  setInitialQuote(data.quote);
22763
+ console.log('handleRecalculateTaxes in quoteAccountSignupMutate');
22764
+ handleRecalculateTaxes();
22456
22765
  },
22457
22766
  onError: (error) => {
22458
22767
  const errorMessage = error.response.errors[0].message;
@@ -22490,7 +22799,7 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22490
22799
  queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
22491
22800
  });
22492
22801
  showSuccessNotification('Coupon applied');
22493
- recalculateTaxes();
22802
+ handleRecalculateTaxes();
22494
22803
  setCouponEditorCouponCode('');
22495
22804
  },
22496
22805
  onCouponRemoved: () => {
@@ -22498,7 +22807,7 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22498
22807
  queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
22499
22808
  });
22500
22809
  showSuccessNotification('Coupon removed');
22501
- recalculateTaxes();
22810
+ handleRecalculateTaxes();
22502
22811
  },
22503
22812
  });
22504
22813
  // Handle default coupon application
@@ -22514,7 +22823,7 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22514
22823
  async function handlePaymentSuccess() {
22515
22824
  setPurchaseSucceeded(true);
22516
22825
  }
22517
- async function accountSignupFunction(plugin) {
22826
+ async function accountSignupFunction(pluginId, paymentMethodId) {
22518
22827
  var _a;
22519
22828
  if (!portalSessionToken) {
22520
22829
  throw new Error('Portal session token is required');
@@ -22522,37 +22831,30 @@ function Signup({ companyName, priceListCode, returnUrl, couponCode, className,
22522
22831
  if (!accountId) {
22523
22832
  throw new Error('Account ID is required');
22524
22833
  }
22525
- if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
22526
- throw new Error('Plugin ID is required');
22527
- }
22528
- if (!(defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id)) {
22529
- throw new Error('Payment method ID is required');
22530
- }
22531
22834
  return await accountSignup({
22532
22835
  token: portalSessionToken,
22533
22836
  apiHost,
22534
22837
  quoteId: (_a = quote === null || quote === void 0 ? void 0 : quote.id) !== null && _a !== void 0 ? _a : undefined,
22535
- paymentMethodId: defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id,
22536
- pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
22838
+ paymentMethodId,
22839
+ pluginId,
22537
22840
  priceListCode: priceListCode,
22538
22841
  accountId,
22539
22842
  });
22540
22843
  }
22541
- function handlePaymentFail(error) {
22542
- var _a;
22543
- showErrorNotification$1((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.message);
22544
- }
22545
- useEffect(() => {
22546
- if (initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id) {
22547
- recalculateTaxes();
22844
+ function handleRecalculateTaxes() {
22845
+ console.log('handleRecalculateTaxes', hasTaxPlugin);
22846
+ if (!hasTaxPlugin) {
22847
+ console.log('no tax plugin, returning');
22848
+ return;
22548
22849
  }
22549
- }, [initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id]);
22850
+ recalculateTaxesMutation();
22851
+ }
22550
22852
  if (purchaseSucceeded) {
22551
22853
  return (jsx(Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsx("div", { className: "bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 bunny-flex bunny-items-start bunny-pt-[25vh]", children: jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "bunny-w-full", companyName: companyName, returnUrl: returnUrl, currencyId: quote === null || quote === void 0 ? void 0 : quote.currencyId }) })) : (jsx("div", { children: "No currency ID found from Quote" })) }));
22552
22854
  }
22553
22855
  return (jsxs("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-col' : 'bunny-flex-row'} bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ${shadow} ${className}`, style: style, children: [jsx("div", { className: `bunny-flex bunny-items-center bunny-flex-col ${isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full'} bunny-justify-center`, children: jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24", children: [jsx("div", { children: topNavImageUrl.length > 0 && (jsx(Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon, onRemoveCoupon: removeCoupon, isRemovingCoupon: isRemovingCoupon, priceListData: priceListData, isAddingCoupon: isAddingCoupon, couponCode: couponEditorCouponCode, setCouponCode: setCouponEditorCouponCode, activeCouponsExist: activeCouponsExist })) : (jsx("div", { className: "bunny-h-full", children: isLoadingPriceList ? (jsx(Skeleton, { active: true })) : (jsx(PriceListDisplay, { priceListData: priceListData })) })), jsx(Footer, {})] }) }), jsx("div", { className: `bunny-flex bunny-flex-col ${isMobile ? 'bunny-w-full bunny-h-1/2 bunny-overflow-auto' : 'bunny-w-1/2 bunny-h-full'} bunny-items-center`, style: {
22554
22856
  boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
22555
- }, children: isLoadingPriceList ? (jsx(Skeleton, { active: true, className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24` })) : (jsx("div", { className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24`, children: jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: isSigningUp || isLoadingQuote, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction, defaultValues: defaultValues }) })) })] }));
22857
+ }, children: isLoadingPriceList ? (jsx(Skeleton, { active: true, className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24` })) : (jsx("div", { className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24`, children: jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handleSubmit: handleSubmit, proceedingToPayment: isSigningUp || isLoadingQuote, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction, defaultValues: defaultValues }) })) })] }));
22556
22858
  }
22557
22859
 
22558
22860
  const { Text: Text$i } = Typography;
@@ -22560,25 +22862,6 @@ const DrawerHeader = ({ description, onClose, title, closeButtonClassName, }) =>
22560
22862
  return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxs("div", { className: "bunny-flex bunny-items-center bunny-justify-between bunny-gap-2", children: [jsx(Text$i, { className: "bunny-text-xl bunny-font-normal", children: title }), onClose ? (jsx("button", { id: "closePayment", onClick: onClose, className: closeButtonClassName, children: jsx(CloseOutlined, {}) })) : null] }), description && jsx("div", { className: "bunny-text-sm bunny-font-medium", children: description })] }));
22561
22863
  };
22562
22864
 
22563
- /**
22564
- * Creates a context and provider for a state value
22565
- * @param useValue - A function that returns the state value
22566
- * @returns A tuple containing the provider and the context value
22567
- * @example take a look at how this is used in the quoteIdContext in the QuantityDrawer
22568
- */
22569
- const createStateContext = (useValue) => {
22570
- const StateContext = createContext(null);
22571
- const StateProvider = ({ initialValue, children, }) => jsxs(StateContext.Provider, { value: useValue(initialValue), children: [" ", children, " "] });
22572
- const useContextState = () => {
22573
- const value = useContext(StateContext);
22574
- if (value === null) {
22575
- throw new Error('Provider missing');
22576
- }
22577
- return value;
22578
- };
22579
- return [StateProvider, useContextState];
22580
- };
22581
-
22582
22865
  const useQuoteIdState = (id) => useState(id);
22583
22866
  const [QuoteIdProvider, useQuoteId] = createStateContext(useQuoteIdState);
22584
22867
 
@@ -22655,7 +22938,7 @@ const QuoteChangeSummarySection_QuoteFragment = t(`
22655
22938
  }
22656
22939
  `, []);
22657
22940
  const QuoteChangeSummarySection = ({ openCheckout, errorUpdatingQuantity, }) => {
22658
- const isMobile = useIsMobile();
22941
+ const isMobile = useIsMobile$1();
22659
22942
  const [quoteId] = useQuoteId();
22660
22943
  const maskedQuote = useQuoteQueryData(quoteId);
22661
22944
  const quote = readFragment(QuoteChangeSummarySection_QuoteFragment, maskedQuote);
@@ -23073,7 +23356,7 @@ const QuantityDrawerDesktop_SubscriptionFragment = t(`
23073
23356
  const QuantityChangeDrawerDesktop = ({ onClose, open, openCheckout, subscriptions, setUpdatingChargeQuantityId, updatingChargeQuantityId, }) => {
23074
23357
  const [openLocal, setOpenLocal] = useState(open);
23075
23358
  const [errorUpdatingQuantity, setErrorUpdatingQuantity] = useState(false);
23076
- const isMobile = useIsMobile();
23359
+ const isMobile = useIsMobile$1();
23077
23360
  useEffect(() => {
23078
23361
  let timeoutId;
23079
23362
  if (!open) {
@@ -23219,7 +23502,7 @@ const ChangeQuantitiesButton = ({ setQuantityDrawerOpen, }) => {
23219
23502
 
23220
23503
  const SubscriptionsNavigation = ({ inactiveSwitchVisible, showInactive, setShowInactive, setQuantityDrawerOpen, subscriptions, }) => {
23221
23504
  // Hooks
23222
- const isMobile = useIsMobile();
23505
+ const isMobile = useIsMobile$1();
23223
23506
  // Derived state
23224
23507
  const canShowChangeQuantitiesButton = canShowChangeQuantities({
23225
23508
  subscriptions,
@@ -23255,6 +23538,14 @@ function addonPlanSwitchTestId(planName) {
23255
23538
 
23256
23539
  const AddonIndentation = ({ isLast, indentation, verticalMargin, }) => (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-relative", style: { width: `${indentation}px` }, children: [jsx("div", { className: `bunny-flex-1 bunny-bg-gray-300 bunny-w-0.5 bunny-mx-auto`, style: { marginTop: verticalMargin } }), jsx("div", { className: "bunny-bg-gray-300 bunny-h-0.5 bunny-w-1/2 bunny-ml-auto" }), isLast ? (jsx("div", { className: "bunny-flex-1" })) : (jsx("div", { className: `bunny-flex-1 bunny-bg-gray-300 bunny-w-0.5 bunny-mx-auto`, style: { marginBottom: verticalMargin } }))] }));
23257
23540
 
23541
+ const Card = ({ children, className, style, }) => {
23542
+ const { darkMode } = useContext(BunnyContext);
23543
+ return (jsx("div", { className: `bunny-flex bunny-flex-col bunny-rounded-md ${className}`, style: {
23544
+ ...style,
23545
+ backgroundColor: darkMode ? 'var(--row-background-dark)' : 'var(--row-background)',
23546
+ }, children: children }));
23547
+ };
23548
+
23258
23549
  var utc$2 = {exports: {}};
23259
23550
 
23260
23551
  var utc$1 = utc$2.exports;
@@ -23405,83 +23696,6 @@ const StyledAreaChart = defaultStyled(AreaChart) `
23405
23696
  }
23406
23697
  `;
23407
23698
 
23408
- const QueryKeyFactory = {
23409
- accountPaymentMethodsKey: ({ accountId, entityId, token }) => [
23410
- 'accountPaymentMethods',
23411
- ...(entityId ? [entityId] : []),
23412
- ...(accountId ? [accountId] : []),
23413
- ...(token ? [token] : []),
23414
- ],
23415
- billingDetailsKey: ({ entityId, token }) => [
23416
- 'billingDetails',
23417
- ...(entityId ? [entityId] : []),
23418
- ...(token ? [token] : []),
23419
- ],
23420
- brandingKey: (token) => ['branding', ...(token ? [token] : [])],
23421
- calculatedPricesKey: ({ priceListId, quantity, token }) => [
23422
- 'calculatedPrices',
23423
- ...(priceListId ? [priceListId] : []),
23424
- ...(quantity ? [quantity] : []),
23425
- ...(token ? [token] : []),
23426
- ],
23427
- createEventsKey: ({ entityId, pluralType, token }) => [
23428
- pluralType,
23429
- 'events',
23430
- entityId,
23431
- ...(token ? [token] : []),
23432
- ],
23433
- createFormattedInvoiceKey: ({ id, token }) => [
23434
- 'formattedInvoice',
23435
- id,
23436
- ...(token ? [token] : []),
23437
- ],
23438
- createInvoiceKey: ({ id, token }) => ['invoice', id, token],
23439
- createObjectKey: ({ id, objectName, token }) => [
23440
- objectName,
23441
- ...(id ? [id] : []),
23442
- ...(token ? [token] : []),
23443
- ],
23444
- createQuoteKey: ({ id, token }) => ['quote', id, token],
23445
- createQuoteTaxCalculateKey: ({ id, token }) => [
23446
- 'quoteTaxCalculate',
23447
- ...(id ? [id] : []),
23448
- ...(token ? [token] : []),
23449
- ],
23450
- createTableKey: ({ filterString, pluralType, token }) => filterString ? [pluralType, 'list', filterString, token] : [pluralType, 'list', token],
23451
- currentUserKey: (token) => ['currentUser', ...(token ? [token] : [])],
23452
- editingQuoteKey: (token) => ['editingQuote', ...(token ? [token] : [])],
23453
- finixAchKey: (token) => ['finixAchKey', ...(token ? [token] : [])],
23454
- finixKey: (token) => ['finixKey', ...(token ? [token] : [])],
23455
- planChangeOptionsKey: ({ subscriptionId, productId, token }) => [
23456
- 'planChangeOptions',
23457
- ...(subscriptionId ? [subscriptionId] : []),
23458
- ...(productId ? [productId] : []),
23459
- ...(token ? [token] : []),
23460
- ],
23461
- pluginsKey: (token) => ['plugins', ...(token ? [token] : [])],
23462
- portalPreviewDataKey: ({ productId, token }) => [
23463
- 'portalPreviewData',
23464
- ...(productId ? [productId] : []),
23465
- ...(token ? [token] : []),
23466
- ],
23467
- taxationRequiredAccountFieldsKey: ({ entityId, token, }) => [
23468
- 'taxationRequiredAccountFields',
23469
- ...(entityId ? [entityId] : []),
23470
- ...(token ? [token] : []),
23471
- ],
23472
- transactionsKey: ({ filter, token }) => [
23473
- 'transactions',
23474
- ...(filter ? [filter] : []),
23475
- ...(token ? [token] : []),
23476
- ],
23477
- availableAddonPlansKey: ({ priceListId, token, }) => ['availableAddonPlans', priceListId, ...(token ? [token] : [])],
23478
- addonPlansKey: ({ priceListId, token }) => [
23479
- 'addonPlans',
23480
- priceListId,
23481
- ...(token ? [token] : []),
23482
- ],
23483
- };
23484
-
23485
23699
  const TAG_COLORS = {
23486
23700
  ACTIVE: "green",
23487
23701
  TRIAL: "blue",
@@ -23535,12 +23749,12 @@ const { Text: Text$f } = Typography;
23535
23749
  const getSubscriptionStatusText = (subscription) => {
23536
23750
  const { cancellationDate, state, evergreen, endDate, trialEndDate, trialStartDate, startDate, trialExpirationAction, } = subscription;
23537
23751
  const stateUpperCased = state === null || state === void 0 ? void 0 : state.toUpperCase();
23538
- const isActive = stateUpperCased === SubscriptionState$2.ACTIVE;
23539
- const isPending = stateUpperCased === SubscriptionState$2.PENDING;
23540
- const isCanceled = stateUpperCased === SubscriptionState$2.CANCELED;
23541
- const isExpired = stateUpperCased === SubscriptionState$2.EXPIRED;
23542
- const isTrialExpired = stateUpperCased === SubscriptionState$2.TRIAL_EXPIRED;
23543
- const isTrial = stateUpperCased === SubscriptionState$2.TRIAL;
23752
+ const isActive = stateUpperCased === t.scalar('SubscriptionState', 'ACTIVE');
23753
+ const isPending = stateUpperCased === t.scalar('SubscriptionState', 'PENDING');
23754
+ const isCanceled = stateUpperCased === t.scalar('SubscriptionState', 'CANCELED');
23755
+ const isExpired = stateUpperCased === t.scalar('SubscriptionState', 'EXPIRED');
23756
+ const isTrialExpired = stateUpperCased === t.scalar('SubscriptionState', 'TRIAL_EXPIRED');
23757
+ const isTrial = stateUpperCased === t.scalar('SubscriptionState', 'TRIAL');
23544
23758
  if (cancellationDate && (isActive || isPending || isTrial))
23545
23759
  return (jsxs(CustomizedTag, { color: "red", children: ["Canceled - ends on ", formatDate(cancellationDate)] }));
23546
23760
  if (cancellationDate && isCanceled)
@@ -23587,7 +23801,7 @@ function SubscriptionStatusAndActions({ onChangePlanClick, onCancelSubscriptionC
23587
23801
  const { apiHost } = useContext(BunnyContext);
23588
23802
  // Hooks
23589
23803
  const token = useToken();
23590
- const isMobile = useIsMobile();
23804
+ const isMobile = useIsMobile$1();
23591
23805
  const { data: priceListChangeOptions, isLoading: arePriceListChangeOptionsLoading } = useQuery({
23592
23806
  queryKey: QueryKeyFactory.planChangeOptionsKey({ productId: subscription.product.id, token }),
23593
23807
  queryFn: () => getPriceListChangeOptions$1({ apiHost, token, productId: subscription.product.id }),
@@ -23595,8 +23809,6 @@ function SubscriptionStatusAndActions({ onChangePlanClick, onCancelSubscriptionC
23595
23809
  });
23596
23810
  const { isLoading: isPaymentMethodLoading } = usePaymentMethod({
23597
23811
  accountId: subscription.accountId,
23598
- token,
23599
- apiHost,
23600
23812
  });
23601
23813
  // Derived state
23602
23814
  const cardActionsVisible = !isMobile;
@@ -23618,7 +23830,7 @@ var BillingPeriodConverter$1 = BillingPeriodConverter;
23618
23830
 
23619
23831
  const SubscriptionChargeTotal = ({ charge, currencyId, }) => {
23620
23832
  const billingPeriod = charge.billingPeriod && BillingPeriodConverter$1[charge.billingPeriod];
23621
- const isMobile = useIsMobile();
23833
+ const isMobile = useIsMobile$1();
23622
23834
  const formattedDiscountedPrice = formatCurrency$1(charge.price, currencyId);
23623
23835
  const formattedPeriodPrice = formatCurrency$1(charge.periodPrice, currencyId);
23624
23836
  return (jsx("div", { className: `bunny-flex bunny-gap-1 ${isMobile ? 'bunny-flex-col' : ''}`, children: charge.chargeType === ChargeType.USAGE || charge.trial
@@ -23924,7 +24136,7 @@ const SubscriptionsList = ({ showInactive, onChangePlanClick, onCancelSubscripti
23924
24136
  // Context
23925
24137
  const { gap } = useContext(SubscriptionsContext);
23926
24138
  // Hooks
23927
- const isMobile = useIsMobile();
24139
+ const isMobile = useIsMobile$1();
23928
24140
  const nonAddonSubscriptions = findNonAddonSubscriptions(subscriptions);
23929
24141
  return (jsx(Fragment, { children: nonAddonSubscriptions === null || nonAddonSubscriptions === void 0 ? void 0 : nonAddonSubscriptions.map((subscription, subscriptionIndex) => {
23930
24142
  if (!showInactive && isSubscriptionNotActive(subscription))
@@ -24078,9 +24290,9 @@ const useQuoteCreate = ({ upgradingSubscription, selectedPriceList, token, }) =>
24078
24290
  return;
24079
24291
  }
24080
24292
  const buyingAddonsForCurrentSubscription = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
24081
- const isActivatingTrialSubscription = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL &&
24293
+ const isActivatingTrialSubscription = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL') &&
24082
24294
  upgradingSubscription.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
24083
- const isActivatingExpiredTrialSubscription = ((_b = upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED &&
24295
+ const isActivatingExpiredTrialSubscription = ((_b = upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED') &&
24084
24296
  upgradingSubscription.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
24085
24297
  if (isActivatingTrialSubscription || isActivatingExpiredTrialSubscription) {
24086
24298
  subscriptionActivate({
@@ -24802,7 +25014,7 @@ const PriceListCardTitle = ({ planName, isPriceListCurrentSubscription, trialRem
24802
25014
 
24803
25015
  const PLAN_GRID_PADDING = 4;
24804
25016
  const PlanPickerGridCell = ({ children, noBorder, }) => {
24805
- const isMobile = useIsMobile();
25017
+ const isMobile = useIsMobile$1();
24806
25018
  return (jsxs("div", { className: "bunny-flex bunny-flex-col", style: isMobile
24807
25019
  ? {}
24808
25020
  : {
@@ -24917,7 +25129,7 @@ const PriceListCard_PriceListFragment = t(`
24917
25129
  `, [PriceListCardDesktop_PriceListFragment, PriceListCardMobile_PriceListFragment]);
24918
25130
  const PriceListCard = ({ hideButton, isSelected, priceList: maskedPriceList, subscriptions, trialRemainingDays, noBorder, onClickPriceListCard, disableCurrentPlan, }) => {
24919
25131
  var _a, _b, _c;
24920
- const isMobile = useIsMobile();
25132
+ const isMobile = useIsMobile$1();
24921
25133
  const { upgradingSubscription } = useContext(SubscriptionsContext);
24922
25134
  // Read fragments
24923
25135
  const priceList = readFragment(PriceListCard_PriceListFragment, maskedPriceList);
@@ -24932,11 +25144,11 @@ const PriceListCard = ({ hideButton, isSelected, priceList: maskedPriceList, sub
24932
25144
  upgradingSubscription,
24933
25145
  });
24934
25146
  const subscriptionPlan = subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.find(subscription => {
24935
- var _a;
25147
+ var _a, _b;
24936
25148
  return subscription.plan.id === ((_a = priceList.plan) === null || _a === void 0 ? void 0 : _a.id) &&
24937
25149
  subscription.state !== t.scalar('SubscriptionState', 'CANCELED') &&
24938
25150
  subscription.state !== t.scalar('SubscriptionState', 'EXPIRED') &&
24939
- subscription.state !== t.scalar('SubscriptionState', 'TRIAL_EXPIRED');
25151
+ ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED');
24940
25152
  });
24941
25153
  if (!activeCharge) {
24942
25154
  return null;
@@ -25048,7 +25260,7 @@ const getPriceListChangeOptions = async ({ apiHost, isInPreviewMode, token, subs
25048
25260
 
25049
25261
  const BillingPeriodSelector = ({ availableBillingPeriods, onChangeBillingPeriod, products, selectedBillingPeriod, selectedProduct, onChangeProduct, }) => {
25050
25262
  const { secondaryColor, brandColor } = useBrand();
25051
- const isMobile = useIsMobile();
25263
+ const isMobile = useIsMobile$1();
25052
25264
  if (!availableBillingPeriods || (availableBillingPeriods === null || availableBillingPeriods === void 0 ? void 0 : availableBillingPeriods.length) < 2)
25053
25265
  return null;
25054
25266
  return (jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-8", children: [(products === null || products === void 0 ? void 0 : products.length) && products.length > 1 && (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsx("div", { className: "bunny-font-medium bunny-text-xs", style: {
@@ -25812,7 +26024,7 @@ const AddonPlans = ({ selectedPriceList, subscriptions, selectedBillingPeriod, c
25812
26024
  const addonSubscriptionIds = currentSubscription === null || currentSubscription === void 0 ? void 0 : currentSubscription.addonSubscriptions;
25813
26025
  const addonSubscriptions = addonSubscriptionIds === null || addonSubscriptionIds === void 0 ? void 0 : addonSubscriptionIds.map(addonSubscription => subscriptions.find(subscription => subscription.id === addonSubscription.id));
25814
26026
  // filter out cancelled addons
25815
- const activeAddonSubscriptions = addonSubscriptions === null || addonSubscriptions === void 0 ? void 0 : addonSubscriptions.filter(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.state) !== SubscriptionState$2.CANCELED);
26027
+ const activeAddonSubscriptions = addonSubscriptions === null || addonSubscriptions === void 0 ? void 0 : addonSubscriptions.filter(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.state) !== t.scalar('SubscriptionState', 'CANCELED'));
25816
26028
  return activeAddonSubscriptions === null || activeAddonSubscriptions === void 0 ? void 0 : activeAddonSubscriptions.some(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.priceList.id) === priceList.id);
25817
26029
  }
25818
26030
  return (jsxs(Text$2, { className: `bunny-flex bunny-flex-col ${className}`, children: [jsx(AddonPlanModal, { onClose: () => setSelectedAddonPriceListId(null), priceList: selectedAddonPriceList }), addonPriceLists.length > 0 && (jsxs(Fragment, { children: [jsx("div", { className: "bunny-text-slate-500 bunny-text-xs bunny-font-medium bunny-mb-2", children: 'Add-on plans'.toUpperCase() }), jsx("div", { className: "bunny-flex bunny-flex-col", children: addonPriceLists.map(addonPriceList => {
@@ -25824,7 +26036,7 @@ const AddonPlans = ({ selectedPriceList, subscriptions, selectedBillingPeriod, c
25824
26036
 
25825
26037
  const PriceListGridDesktop = ({ availablePriceLists, priceListChangeOptions, priceListStart, selectedPriceList, selectedProduct, setPriceListStart, subscriptions, trialRemainingDays, selectedBillingPeriod, onClickPriceListCard, }) => {
25826
26038
  const { shadow } = useContext(SubscriptionsContext);
25827
- const isMobile = useIsMobile();
26039
+ const isMobile = useIsMobile$1();
25828
26040
  const { displayPriceLists } = useMemo(() => getAvailablePlansAndPriceLists({
25829
26041
  availablePriceLists,
25830
26042
  priceListChangeOptions,
@@ -25867,7 +26079,7 @@ const PriceListGridMobile = ({ availablePriceLists, priceListChangeOptions, sele
25867
26079
  const PriceListGrid = ({ availablePriceLists, priceListChangeOptions, priceListStart, selectedPriceList, selectedProduct, setPriceListStart, subscriptions, selectedBillingPeriod, onClickPriceListCard, }) => {
25868
26080
  var _a, _b;
25869
26081
  // Hooks
25870
- const isMobile = useIsMobile();
26082
+ const isMobile = useIsMobile$1();
25871
26083
  const { upgradingSubscription } = useContext(SubscriptionsContext);
25872
26084
  // Derived state
25873
26085
  const currentPriceList = (_a = priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) === null || _a === void 0 ? void 0 : _a.find(priceList => { var _a; return priceList.id === ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.plan) === null || _a === void 0 ? void 0 : _a.id); });
@@ -26511,7 +26723,7 @@ const Subscriptions = ({ handlePortalErrors, companyName, noSubscriptionsCompone
26511
26723
  // Hooks
26512
26724
  const queryClient = useQueryClient();
26513
26725
  const showSuccessNotification = useSuccessNotification();
26514
- const isMobile = useIsMobile();
26726
+ const isMobile = useIsMobile$1();
26515
26727
  const cancelSubscription = useCancelSubscription();
26516
26728
  // Queries
26517
26729
  const { data: subscriptionsData, isLoading: subscriptionsAreLoading } = useQuery({
@@ -26546,16 +26758,16 @@ const Subscriptions = ({ handlePortalErrors, companyName, noSubscriptionsCompone
26546
26758
  const allSubscriptionsInactive = (_c = (_b = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.every(maskedSubscription => {
26547
26759
  var _a, _b, _c;
26548
26760
  const subscription = readFragment(Subscriptions_SubscriptionFragment, maskedSubscription);
26549
- return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
26550
- ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED ||
26551
- ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.CANCELED);
26761
+ return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'EXPIRED') ||
26762
+ ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED') ||
26763
+ ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === t.scalar('SubscriptionState', 'CANCELED'));
26552
26764
  });
26553
26765
  const hasInactiveSubscriptions = (_e = (_d = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _d === void 0 ? void 0 : _d.nodes) === null || _e === void 0 ? void 0 : _e.some(maskedSubscription => {
26554
26766
  var _a, _b, _c;
26555
26767
  const subscription = readFragment(Subscriptions_SubscriptionFragment, maskedSubscription);
26556
- return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
26557
- ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED ||
26558
- ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.CANCELED);
26768
+ return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === t.scalar('SubscriptionState', 'EXPIRED') ||
26769
+ ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === t.scalar('SubscriptionState', 'TRIAL_EXPIRED') ||
26770
+ ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === t.scalar('SubscriptionState', 'CANCELED'));
26559
26771
  });
26560
26772
  useEffect(() => {
26561
26773
  if (allSubscriptionsInactive && subscriptions && subscriptions.length > 0) {
@@ -26581,7 +26793,7 @@ const Subscriptions = ({ handlePortalErrors, companyName, noSubscriptionsCompone
26581
26793
  return (jsxs("div", { className: className, children: [jsx(PageHeaderWithActions, { title: jsx(Fragment, { children: showInactiveSubscriptionsToggle && isMobile && inactiveSwitchVisible && (jsx(ShowInactiveToggle, { showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState })) }), children: !isMobile && ((_f = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _f === void 0 ? void 0 : _f.nodes) && (jsx(SubscriptionsNavigation, { inactiveSwitchVisible: showInactiveSubscriptionsToggle && inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: (_g = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _g === void 0 ? void 0 : _g.nodes })) }), jsx(SubscriptionsListContainer, { companyName: companyName, showInactive: showInactiveSubscriptions, onCancelSubscriptionClick: onCancelSubscriptionClick, onChangePlanClick: onChangePlanClick, subscriptions: (_h = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _h === void 0 ? void 0 : _h.nodes, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && ((_j = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _j === void 0 ? void 0 : _j.nodes) && (jsx("div", { className: "bunny-pt-4 bunny-pb-2", children: jsx(SubscriptionsNavigation, { inactiveSwitchVisible: inactiveSwitchVisible, showInactive: showInactiveSubscriptions, setShowInactive: setShowInactiveSubscriptionsState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: (_k = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _k === void 0 ? void 0 : _k.nodes }) })), ((_l = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _l === void 0 ? void 0 : _l.nodes) && (jsx(QuantityDrawer, { subscriptions: (_m = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _m === void 0 ? void 0 : _m.nodes, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors, setShowInactive: setShowInactiveSubscriptionsState }))] }));
26582
26794
  };
26583
26795
  const PageHeaderWithActions = ({ children, title, }) => {
26584
- const isMobile = useIsMobile();
26796
+ const isMobile = useIsMobile$1();
26585
26797
  return (jsxs("div", { className: `bunny-flex bunny-pb-4 ${isMobile
26586
26798
  ? 'bunny-flex-col bunny-gap-2'
26587
26799
  : 'bunny-items-center bunny-justify-between bunny-h-8'}`, children: [title && jsx(PageSubTitle, { title: title }), children] }));
@@ -26669,7 +26881,7 @@ function BillingDetailsSection({ hidePaymentMethodForm, countryListFilter, }) {
26669
26881
  const { apiHost } = useContext(BunnyContext);
26670
26882
  const token = useToken();
26671
26883
  // Hooks
26672
- const isMobile = useIsMobile();
26884
+ const isMobile = useIsMobile$1();
26673
26885
  const queryClient = useQueryClient();
26674
26886
  const showErrorNotification = useErrorNotification();
26675
26887
  const showSuccessNotification = useSuccessNotification();
@@ -26795,24 +27007,20 @@ function BillingDetailsSection({ hidePaymentMethodForm, countryListFilter, }) {
26795
27007
 
26796
27008
  const BillingDetails = ({ className, countryListFilter, hideBillingDetailsForm = false, hidePaymentMethodForm = false, isCardEnabled = true, isUpgradeFromTrial = false, shadow = 'shadow-md', onSavePaymentMethod, }) => {
26797
27009
  // Hooks
26798
- const isMobile = useIsMobile();
27010
+ const isMobile = useIsMobile$1();
26799
27011
  return (jsx(WrapperComponent, { isCardEnabled: isCardEnabled, shadow: shadow, className: className, children: jsxs("div", { className: `bunny-flex bunny-py-2 bunny-my-2 ${isMobile ? 'bunny-flex-col bunny-space-y-4' : 'bunny-flex-row'} bunny-gap-4`, children: [!hideBillingDetailsForm ? (jsx(BillingDetailsSection, { hidePaymentMethodForm: hidePaymentMethodForm, countryListFilter: countryListFilter })) : null, !hideBillingDetailsForm && !hidePaymentMethodForm ? jsx(ResponsiveDivider, {}) : null, !hidePaymentMethodForm ? (jsx(PaymentFormSection, { hideBillingDetailsForm: hideBillingDetailsForm, isUpgradeFromTrial: isUpgradeFromTrial, onSavePaymentMethod: onSavePaymentMethod })) : null] }) }));
26800
27012
  };
26801
27013
  const WrapperComponent = ({ children, isCardEnabled, shadow, className, }) => {
26802
27014
  return (jsx("div", { className: `${className}`, children: isCardEnabled ? jsx(Card, { className: `${shadow}`, children: children }) : jsx("div", { children: children }) }));
26803
27015
  };
26804
27016
  const ResponsiveDivider = () => {
26805
- const isMobile = useIsMobile();
27017
+ const isMobile = useIsMobile$1();
26806
27018
  return isMobile ? (jsx("div", { className: "bunny-mx-4", children: jsx(Divider, {}) })) : (jsx("div", { children: jsx(Divider, { className: "bunny-h-full", type: "vertical" }) }));
26807
27019
  };
26808
27020
  const PaymentFormSection = ({ hideBillingDetailsForm, isUpgradeFromTrial, onSavePaymentMethod, }) => {
26809
- const isMobile = useIsMobile();
26810
- const { onTokenExpired } = useContext(BunnyContext);
26811
- const handleAllErrorFormats = useAllErrorFormats$1(onTokenExpired);
27021
+ const isMobile = useIsMobile$1();
26812
27022
  const showSuccessNotification = useSuccessNotification();
26813
- return (jsx("div", { className: `${isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4'} bunny-flex bunny-justify-center`, children: jsx(PaymentForm, { onFail: (error) => {
26814
- handleAllErrorFormats(error);
26815
- }, onSavePaymentMethod: (response) => {
27023
+ return (jsx("div", { className: `${isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4'} bunny-flex bunny-justify-center`, children: jsx(PaymentForm, { onSavePaymentMethod: (response) => {
26816
27024
  showSuccessNotification(isUpgradeFromTrial
26817
27025
  ? 'Payment method saved! Your trial will automatically convert to a paid subscription.'
26818
27026
  : 'Payment method saved successfully!');