@bunnyapp/components 1.0.0 → 1.0.2

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 (332) hide show
  1. package/dist/cjs/index.js +1293 -975
  2. package/dist/cjs/playground/main.d.ts +1 -0
  3. package/dist/cjs/{types/src → src}/components/BunnyProvider.d.ts +5 -3
  4. package/dist/cjs/src/components/Card.d.ts +7 -0
  5. package/dist/cjs/src/components/Checkout/InvoiceCheckout.d.ts +27 -0
  6. package/dist/cjs/src/components/Footer.d.ts +4 -0
  7. package/dist/cjs/src/components/Icons/ArrowDownToLine.d.ts +5 -0
  8. package/dist/{esm/types → cjs}/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -0
  9. package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentOption.d.ts +1 -1
  10. package/dist/cjs/src/components/Signup/PaymentForms.d.ts +19 -0
  11. package/dist/cjs/src/components/Signup/PaymentSuccess.d.ts +7 -0
  12. package/dist/cjs/src/components/Signup/PriceListDisplay.d.ts +6 -0
  13. package/dist/cjs/src/components/Signup/Signup.d.ts +5 -0
  14. package/dist/cjs/src/components/Signup/Signup.stories.d.ts +8 -0
  15. package/dist/cjs/src/components/Signup/index.d.ts +1 -0
  16. package/dist/cjs/{types/src → src}/components/Subscriptions/Subscriptions.d.ts +1 -1
  17. package/dist/cjs/{types/src → src}/components/Transactions/Transactions.d.ts +4 -3
  18. package/dist/{esm/types → cjs}/src/components/Transactions/TransactionsListContext.d.ts +1 -0
  19. package/dist/cjs/{types/src → src}/components/index.d.ts +1 -0
  20. package/dist/cjs/src/contexts/PaymentContext.d.ts +6 -0
  21. package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +12 -0
  22. package/dist/cjs/src/graphql/mutations/portalSessionCreate.d.ts +8 -0
  23. package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +14 -0
  24. package/dist/{esm/types → cjs}/src/graphql/mutations/quoteCompose.d.ts +5 -3
  25. package/dist/cjs/src/graphql/mutations/quoteCreate.d.ts +9 -0
  26. package/dist/cjs/src/graphql/queries/getAccount.d.ts +7 -0
  27. package/dist/cjs/src/graphql/queries/getFormattedQuote.d.ts +7 -0
  28. package/dist/cjs/src/graphql/queries/getPriceList.d.ts +7 -0
  29. package/dist/cjs/src/graphql/queries/getSubscription.d.ts +12 -0
  30. package/dist/cjs/{types/src → src}/mocks/handlers.d.ts +1 -1
  31. package/dist/esm/index.js +1294 -978
  32. package/dist/esm/playground/main.d.ts +1 -0
  33. package/dist/esm/{types/src → src}/components/BunnyProvider.d.ts +5 -3
  34. package/dist/esm/src/components/Card.d.ts +7 -0
  35. package/dist/esm/src/components/Checkout/InvoiceCheckout.d.ts +27 -0
  36. package/dist/esm/src/components/Footer.d.ts +4 -0
  37. package/dist/esm/src/components/Icons/ArrowDownToLine.d.ts +5 -0
  38. package/dist/{cjs/types → esm}/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -0
  39. package/dist/esm/{types/src → src}/components/PaymentForm/PaymentOption.d.ts +1 -1
  40. package/dist/esm/src/components/Signup/PaymentForms.d.ts +19 -0
  41. package/dist/esm/src/components/Signup/PaymentSuccess.d.ts +7 -0
  42. package/dist/esm/src/components/Signup/PriceListDisplay.d.ts +6 -0
  43. package/dist/esm/src/components/Signup/Signup.d.ts +5 -0
  44. package/dist/esm/src/components/Signup/Signup.stories.d.ts +8 -0
  45. package/dist/esm/src/components/Signup/index.d.ts +1 -0
  46. package/dist/esm/{types/src → src}/components/Subscriptions/Subscriptions.d.ts +1 -1
  47. package/dist/esm/{types/src → src}/components/Transactions/Transactions.d.ts +4 -3
  48. package/dist/{cjs/types → esm}/src/components/Transactions/TransactionsListContext.d.ts +1 -0
  49. package/dist/esm/{types/src → src}/components/index.d.ts +1 -0
  50. package/dist/esm/src/contexts/PaymentContext.d.ts +6 -0
  51. package/dist/esm/src/graphql/mutations/accountSignup.d.ts +12 -0
  52. package/dist/esm/src/graphql/mutations/portalSessionCreate.d.ts +8 -0
  53. package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +14 -0
  54. package/dist/{cjs/types → esm}/src/graphql/mutations/quoteCompose.d.ts +5 -3
  55. package/dist/esm/src/graphql/mutations/quoteCreate.d.ts +9 -0
  56. package/dist/esm/src/graphql/queries/getAccount.d.ts +7 -0
  57. package/dist/esm/src/graphql/queries/getFormattedQuote.d.ts +7 -0
  58. package/dist/esm/src/graphql/queries/getPriceList.d.ts +7 -0
  59. package/dist/esm/src/graphql/queries/getSubscription.d.ts +12 -0
  60. package/dist/esm/{types/src → src}/mocks/handlers.d.ts +1 -1
  61. package/dist/index.d.ts +14 -9
  62. package/package.json +16 -10
  63. package/dist/cjs/types/playground/main.d.ts +0 -1
  64. package/dist/cjs/types/src/components/Card.d.ts +0 -5
  65. package/dist/cjs/types/src/components/Checkout/InvoiceCheckout.d.ts +0 -7
  66. package/dist/cjs/types/src/components/Footer.d.ts +0 -2
  67. package/dist/cjs/types/src/components/Quote/QuoteContext.d.ts +0 -5
  68. package/dist/cjs/types/src/graphql/queries/getFormattedQuote.d.ts +0 -3
  69. package/dist/esm/types/playground/main.d.ts +0 -1
  70. package/dist/esm/types/src/components/Card.d.ts +0 -5
  71. package/dist/esm/types/src/components/Checkout/InvoiceCheckout.d.ts +0 -7
  72. package/dist/esm/types/src/components/Footer.d.ts +0 -2
  73. package/dist/esm/types/src/components/Quote/QuoteContext.d.ts +0 -5
  74. package/dist/esm/types/src/graphql/queries/getFormattedQuote.d.ts +0 -3
  75. /package/dist/cjs/{types/src → src}/atoms/pageContentRefAtom.d.ts +0 -0
  76. /package/dist/cjs/{types/src → src}/atoms/planPickerQuoteDataAtom.d.ts +0 -0
  77. /package/dist/cjs/{types/src → src}/atoms/updatingChargeQuantityIdAtom.d.ts +0 -0
  78. /package/dist/cjs/{types/src → src}/components/Checkout/Checkout.d.ts +0 -0
  79. /package/dist/cjs/{types/src → src}/components/Checkout/CouponComponent.d.ts +0 -0
  80. /package/dist/cjs/{types/src → src}/components/Checkout/QuoteCheckout.d.ts +0 -0
  81. /package/dist/cjs/{types/src → src}/components/Checkout/checkoutUtils.d.ts +0 -0
  82. /package/dist/cjs/{types/src → src}/components/Checkout/index.d.ts +0 -0
  83. /package/dist/cjs/{types/src → src}/components/DrawerHeader.d.ts +0 -0
  84. /package/dist/cjs/{types/src → src}/components/Error.d.ts +0 -0
  85. /package/dist/cjs/{types/src → src}/components/FeatureUsageGraph.d.ts +0 -0
  86. /package/dist/cjs/{types/src → src}/components/HeaderModalWrapper.d.ts +0 -0
  87. /package/dist/cjs/{types/src → src}/components/Icons/BunnyFooterIcon.d.ts +0 -0
  88. /package/dist/cjs/{types/src → src}/components/Icons/CardIcon.d.ts +0 -0
  89. /package/dist/cjs/{types/src → src}/components/Invoice/Invoice.d.ts +0 -0
  90. /package/dist/cjs/{types/src → src}/components/Invoice/Invoice.stories.d.ts +0 -0
  91. /package/dist/cjs/{types/src → src}/components/Invoice/InvoiceQuoteView.d.ts +0 -0
  92. /package/dist/cjs/{types/src → src}/components/Invoice/index.d.ts +0 -0
  93. /package/dist/cjs/{types/src → src}/components/LegacyInvoicePDF.d.ts +0 -0
  94. /package/dist/cjs/{types/src → src}/components/PageContent.d.ts +0 -0
  95. /package/dist/cjs/{types/src → src}/components/PageHeaderWithActions.d.ts +0 -0
  96. /package/dist/cjs/{types/src → src}/components/PageWrapper.d.ts +0 -0
  97. /package/dist/cjs/{types/src → src}/components/PandadocPollingModal.d.ts +0 -0
  98. /package/dist/cjs/{types/src → src}/components/PaymentForm/CheckoutFooter.d.ts +0 -0
  99. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardCvc.d.ts +0 -0
  100. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardNumber.d.ts +0 -0
  101. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayExpiry.d.ts +0 -0
  102. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayForm.d.ts +0 -0
  103. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/demoPayUtils.d.ts +0 -0
  104. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/index.d.ts +0 -0
  105. /package/dist/cjs/{types/src → src}/components/PaymentForm/Finix/FinixCardForm.d.ts +0 -0
  106. /package/dist/cjs/{types/src → src}/components/PaymentForm/Finix/index.d.ts +0 -0
  107. /package/dist/cjs/{types/src → src}/components/PaymentForm/FinixAch.d.ts +0 -0
  108. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentForm.d.ts +0 -0
  109. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentFormTypes.d.ts +0 -0
  110. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +0 -0
  111. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/LargCardIcon.d.ts +0 -0
  112. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/PlusIcon.d.ts +0 -0
  113. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -0
  114. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/index.d.ts +0 -0
  115. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethodForm.d.ts +0 -0
  116. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethodSelector.d.ts +0 -0
  117. /package/dist/cjs/{types/src → src}/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts +0 -0
  118. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/CheckoutForm.d.ts +0 -0
  119. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -0
  120. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/StripeForm.d.ts +0 -0
  121. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/index.d.ts +0 -0
  122. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/stripeUtils.d.ts +0 -0
  123. /package/dist/cjs/{types/src → src}/components/PaymentForm/index.d.ts +0 -0
  124. /package/dist/cjs/{types/src → src}/components/PaymentForm/paymentUtils.d.ts +0 -0
  125. /package/dist/cjs/{types/src → src}/components/Quote/AcceptQuoteModal.d.ts +0 -0
  126. /package/dist/cjs/{types/src → src}/components/Quote/DocumentNameEnum.d.ts +0 -0
  127. /package/dist/cjs/{types/src → src}/components/Quote/Quote.d.ts +0 -0
  128. /package/dist/cjs/{types/src → src}/components/Quote/Quote.stories.d.ts +0 -0
  129. /package/dist/cjs/{types/src → src}/components/Quote/StyledModal.d.ts +0 -0
  130. /package/dist/cjs/{types/src → src}/components/Quote/index.d.ts +0 -0
  131. /package/dist/cjs/{types/src → src}/components/StateTag.d.ts +0 -0
  132. /package/dist/cjs/{types/src → src}/components/Subscriptions/index.d.ts +0 -0
  133. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/ChangeQuantitiesButton.d.ts +0 -0
  134. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/HideExpiredToggle.d.ts +0 -0
  135. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +0 -0
  136. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +0 -0
  137. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +0 -0
  138. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +0 -0
  139. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +0 -0
  140. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +0 -0
  141. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +0 -0
  142. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +0 -0
  143. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionsCardCell.d.ts +0 -0
  144. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardCellMobile.d.ts +0 -0
  145. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +0 -0
  146. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -0
  147. /package/dist/cjs/{types/src → src}/components/TaxationForm.d.ts +0 -0
  148. /package/dist/cjs/{types/src → src}/components/Transactions/DocumentNameEnum.d.ts +0 -0
  149. /package/dist/cjs/{types/src → src}/components/Transactions/Transactions.stories.d.ts +0 -0
  150. /package/dist/cjs/{types/src → src}/components/Transactions/index.d.ts +0 -0
  151. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionDate.d.ts +0 -0
  152. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionDownload.d.ts +0 -0
  153. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionGridCell.d.ts +0 -0
  154. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionTitle.d.ts +0 -0
  155. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +0 -0
  156. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +0 -0
  157. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionsListMobile.d.ts +0 -0
  158. /package/dist/cjs/{types/src → src}/consts/paymentConsts.d.ts +0 -0
  159. /package/dist/cjs/{types/src → src}/contexts/BrandContext.d.ts +0 -0
  160. /package/dist/cjs/{types/src → src}/contexts/NavigationContext.d.ts +0 -0
  161. /package/dist/cjs/{types/src → src}/enums/SubscriptionState.d.ts +0 -0
  162. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridRow.d.ts +0 -0
  163. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridTitle.d.ts +0 -0
  164. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuantityInput.d.ts +0 -0
  165. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +0 -0
  166. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -0
  167. /package/dist/cjs/{types/src → src}/graphql/QuoteRequests.d.ts +0 -0
  168. /package/dist/cjs/{types/src → src}/graphql/SubscriptionRequests.d.ts +0 -0
  169. /package/dist/cjs/{types/src → src}/graphql/mutations/accountUpdate.d.ts +0 -0
  170. /package/dist/cjs/{types/src → src}/graphql/mutations/checkout.d.ts +0 -0
  171. /package/dist/cjs/{types/src → src}/graphql/mutations/quoteAddCoupon.d.ts +0 -0
  172. /package/dist/cjs/{types/src → src}/graphql/mutations/quoteRecalculateTaxes.d.ts +0 -0
  173. /package/dist/cjs/{types/src → src}/graphql/mutations/quoteSubscriptionReinstate.d.ts +0 -0
  174. /package/dist/cjs/{types/src → src}/graphql/queries/getBranding.d.ts +0 -0
  175. /package/dist/cjs/{types/src → src}/graphql/queries/getCurrentUserData.d.ts +0 -0
  176. /package/dist/cjs/{types/src → src}/graphql/queries/getFeatureUsage.d.ts +0 -0
  177. /package/dist/cjs/{types/src → src}/graphql/queries/getFormattedInvoice.d.ts +0 -0
  178. /package/dist/cjs/{types/src → src}/graphql/queries/getInvoice.d.ts +0 -0
  179. /package/dist/cjs/{types/src → src}/graphql/queries/getPlanChangeOptions.d.ts +0 -0
  180. /package/dist/cjs/{types/src → src}/graphql/queries/getQuote.d.ts +0 -0
  181. /package/dist/cjs/{types/src → src}/graphql/queries/getSubscriptions.d.ts +0 -0
  182. /package/dist/cjs/{types/src → src}/graphql/queries/getTransactions.d.ts +0 -0
  183. /package/dist/cjs/{types/src → src}/hooks/index.d.ts +0 -0
  184. /package/dist/cjs/{types/src → src}/hooks/quotes/useSendAcceptQuote.d.ts +0 -0
  185. /package/dist/cjs/{types/src → src}/hooks/quotes/useSigningComplete.d.ts +0 -0
  186. /package/dist/cjs/{types/src → src}/hooks/subscriptions/useSubscriptions.d.ts +0 -0
  187. /package/dist/cjs/{types/src → src}/hooks/useCurrentUserData.d.ts +0 -0
  188. /package/dist/cjs/{types/src → src}/hooks/useFocusFirstInput.d.ts +0 -0
  189. /package/dist/cjs/{types/src → src}/hooks/useHasTaxPlugin.d.ts +0 -0
  190. /package/dist/cjs/{types/src → src}/hooks/useIsExpired.d.ts +0 -0
  191. /package/dist/cjs/{types/src → src}/hooks/useIsMobile.d.ts +0 -0
  192. /package/dist/cjs/{types/src → src}/hooks/usePaymentMethod.d.ts +0 -0
  193. /package/dist/cjs/{types/src → src}/hooks/useSigningPlugins.d.ts +0 -0
  194. /package/dist/cjs/{types/src → src}/index.d.ts +0 -0
  195. /package/dist/cjs/{types/src → src}/mocks/browser.d.ts +0 -0
  196. /package/dist/cjs/{types/src → src}/stories/Button.d.ts +0 -0
  197. /package/dist/cjs/{types/src → src}/stories/Button.stories.d.ts +0 -0
  198. /package/dist/cjs/{types/src → src}/stories/Header.d.ts +0 -0
  199. /package/dist/cjs/{types/src → src}/stories/Header.stories.d.ts +0 -0
  200. /package/dist/cjs/{types/src → src}/stories/Page.d.ts +0 -0
  201. /package/dist/cjs/{types/src → src}/stories/Page.stories.d.ts +0 -0
  202. /package/dist/cjs/{types/src → src}/utils.d.ts +0 -0
  203. /package/dist/cjs/{types/vite.config.d.ts → vite.config.d.ts} +0 -0
  204. /package/dist/esm/{types/src → src}/atoms/pageContentRefAtom.d.ts +0 -0
  205. /package/dist/esm/{types/src → src}/atoms/planPickerQuoteDataAtom.d.ts +0 -0
  206. /package/dist/esm/{types/src → src}/atoms/updatingChargeQuantityIdAtom.d.ts +0 -0
  207. /package/dist/esm/{types/src → src}/components/Checkout/Checkout.d.ts +0 -0
  208. /package/dist/esm/{types/src → src}/components/Checkout/CouponComponent.d.ts +0 -0
  209. /package/dist/esm/{types/src → src}/components/Checkout/QuoteCheckout.d.ts +0 -0
  210. /package/dist/esm/{types/src → src}/components/Checkout/checkoutUtils.d.ts +0 -0
  211. /package/dist/esm/{types/src → src}/components/Checkout/index.d.ts +0 -0
  212. /package/dist/esm/{types/src → src}/components/DrawerHeader.d.ts +0 -0
  213. /package/dist/esm/{types/src → src}/components/Error.d.ts +0 -0
  214. /package/dist/esm/{types/src → src}/components/FeatureUsageGraph.d.ts +0 -0
  215. /package/dist/esm/{types/src → src}/components/HeaderModalWrapper.d.ts +0 -0
  216. /package/dist/esm/{types/src → src}/components/Icons/BunnyFooterIcon.d.ts +0 -0
  217. /package/dist/esm/{types/src → src}/components/Icons/CardIcon.d.ts +0 -0
  218. /package/dist/esm/{types/src → src}/components/Invoice/Invoice.d.ts +0 -0
  219. /package/dist/esm/{types/src → src}/components/Invoice/Invoice.stories.d.ts +0 -0
  220. /package/dist/esm/{types/src → src}/components/Invoice/InvoiceQuoteView.d.ts +0 -0
  221. /package/dist/esm/{types/src → src}/components/Invoice/index.d.ts +0 -0
  222. /package/dist/esm/{types/src → src}/components/LegacyInvoicePDF.d.ts +0 -0
  223. /package/dist/esm/{types/src → src}/components/PageContent.d.ts +0 -0
  224. /package/dist/esm/{types/src → src}/components/PageHeaderWithActions.d.ts +0 -0
  225. /package/dist/esm/{types/src → src}/components/PageWrapper.d.ts +0 -0
  226. /package/dist/esm/{types/src → src}/components/PandadocPollingModal.d.ts +0 -0
  227. /package/dist/esm/{types/src → src}/components/PaymentForm/CheckoutFooter.d.ts +0 -0
  228. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardCvc.d.ts +0 -0
  229. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardNumber.d.ts +0 -0
  230. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayExpiry.d.ts +0 -0
  231. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayForm.d.ts +0 -0
  232. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/demoPayUtils.d.ts +0 -0
  233. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/index.d.ts +0 -0
  234. /package/dist/esm/{types/src → src}/components/PaymentForm/Finix/FinixCardForm.d.ts +0 -0
  235. /package/dist/esm/{types/src → src}/components/PaymentForm/Finix/index.d.ts +0 -0
  236. /package/dist/esm/{types/src → src}/components/PaymentForm/FinixAch.d.ts +0 -0
  237. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentForm.d.ts +0 -0
  238. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentFormTypes.d.ts +0 -0
  239. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +0 -0
  240. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/LargCardIcon.d.ts +0 -0
  241. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/PlusIcon.d.ts +0 -0
  242. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -0
  243. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/index.d.ts +0 -0
  244. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethodForm.d.ts +0 -0
  245. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethodSelector.d.ts +0 -0
  246. /package/dist/esm/{types/src → src}/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts +0 -0
  247. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/CheckoutForm.d.ts +0 -0
  248. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -0
  249. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/StripeForm.d.ts +0 -0
  250. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/index.d.ts +0 -0
  251. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/stripeUtils.d.ts +0 -0
  252. /package/dist/esm/{types/src → src}/components/PaymentForm/index.d.ts +0 -0
  253. /package/dist/esm/{types/src → src}/components/PaymentForm/paymentUtils.d.ts +0 -0
  254. /package/dist/esm/{types/src → src}/components/Quote/AcceptQuoteModal.d.ts +0 -0
  255. /package/dist/esm/{types/src → src}/components/Quote/DocumentNameEnum.d.ts +0 -0
  256. /package/dist/esm/{types/src → src}/components/Quote/Quote.d.ts +0 -0
  257. /package/dist/esm/{types/src → src}/components/Quote/Quote.stories.d.ts +0 -0
  258. /package/dist/esm/{types/src → src}/components/Quote/StyledModal.d.ts +0 -0
  259. /package/dist/esm/{types/src → src}/components/Quote/index.d.ts +0 -0
  260. /package/dist/esm/{types/src → src}/components/StateTag.d.ts +0 -0
  261. /package/dist/esm/{types/src → src}/components/Subscriptions/index.d.ts +0 -0
  262. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/ChangeQuantitiesButton.d.ts +0 -0
  263. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/HideExpiredToggle.d.ts +0 -0
  264. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +0 -0
  265. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +0 -0
  266. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +0 -0
  267. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +0 -0
  268. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +0 -0
  269. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +0 -0
  270. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +0 -0
  271. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +0 -0
  272. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionsCardCell.d.ts +0 -0
  273. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardCellMobile.d.ts +0 -0
  274. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +0 -0
  275. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -0
  276. /package/dist/esm/{types/src → src}/components/TaxationForm.d.ts +0 -0
  277. /package/dist/esm/{types/src → src}/components/Transactions/DocumentNameEnum.d.ts +0 -0
  278. /package/dist/esm/{types/src → src}/components/Transactions/Transactions.stories.d.ts +0 -0
  279. /package/dist/esm/{types/src → src}/components/Transactions/index.d.ts +0 -0
  280. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionDate.d.ts +0 -0
  281. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionDownload.d.ts +0 -0
  282. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionGridCell.d.ts +0 -0
  283. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionTitle.d.ts +0 -0
  284. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +0 -0
  285. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +0 -0
  286. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionsListMobile.d.ts +0 -0
  287. /package/dist/esm/{types/src → src}/consts/paymentConsts.d.ts +0 -0
  288. /package/dist/esm/{types/src → src}/contexts/BrandContext.d.ts +0 -0
  289. /package/dist/esm/{types/src → src}/contexts/NavigationContext.d.ts +0 -0
  290. /package/dist/esm/{types/src → src}/enums/SubscriptionState.d.ts +0 -0
  291. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridRow.d.ts +0 -0
  292. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridTitle.d.ts +0 -0
  293. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuantityInput.d.ts +0 -0
  294. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +0 -0
  295. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -0
  296. /package/dist/esm/{types/src → src}/graphql/QuoteRequests.d.ts +0 -0
  297. /package/dist/esm/{types/src → src}/graphql/SubscriptionRequests.d.ts +0 -0
  298. /package/dist/esm/{types/src → src}/graphql/mutations/accountUpdate.d.ts +0 -0
  299. /package/dist/esm/{types/src → src}/graphql/mutations/checkout.d.ts +0 -0
  300. /package/dist/esm/{types/src → src}/graphql/mutations/quoteAddCoupon.d.ts +0 -0
  301. /package/dist/esm/{types/src → src}/graphql/mutations/quoteRecalculateTaxes.d.ts +0 -0
  302. /package/dist/esm/{types/src → src}/graphql/mutations/quoteSubscriptionReinstate.d.ts +0 -0
  303. /package/dist/esm/{types/src → src}/graphql/queries/getBranding.d.ts +0 -0
  304. /package/dist/esm/{types/src → src}/graphql/queries/getCurrentUserData.d.ts +0 -0
  305. /package/dist/esm/{types/src → src}/graphql/queries/getFeatureUsage.d.ts +0 -0
  306. /package/dist/esm/{types/src → src}/graphql/queries/getFormattedInvoice.d.ts +0 -0
  307. /package/dist/esm/{types/src → src}/graphql/queries/getInvoice.d.ts +0 -0
  308. /package/dist/esm/{types/src → src}/graphql/queries/getPlanChangeOptions.d.ts +0 -0
  309. /package/dist/esm/{types/src → src}/graphql/queries/getQuote.d.ts +0 -0
  310. /package/dist/esm/{types/src → src}/graphql/queries/getSubscriptions.d.ts +0 -0
  311. /package/dist/esm/{types/src → src}/graphql/queries/getTransactions.d.ts +0 -0
  312. /package/dist/esm/{types/src → src}/hooks/index.d.ts +0 -0
  313. /package/dist/esm/{types/src → src}/hooks/quotes/useSendAcceptQuote.d.ts +0 -0
  314. /package/dist/esm/{types/src → src}/hooks/quotes/useSigningComplete.d.ts +0 -0
  315. /package/dist/esm/{types/src → src}/hooks/subscriptions/useSubscriptions.d.ts +0 -0
  316. /package/dist/esm/{types/src → src}/hooks/useCurrentUserData.d.ts +0 -0
  317. /package/dist/esm/{types/src → src}/hooks/useFocusFirstInput.d.ts +0 -0
  318. /package/dist/esm/{types/src → src}/hooks/useHasTaxPlugin.d.ts +0 -0
  319. /package/dist/esm/{types/src → src}/hooks/useIsExpired.d.ts +0 -0
  320. /package/dist/esm/{types/src → src}/hooks/useIsMobile.d.ts +0 -0
  321. /package/dist/esm/{types/src → src}/hooks/usePaymentMethod.d.ts +0 -0
  322. /package/dist/esm/{types/src → src}/hooks/useSigningPlugins.d.ts +0 -0
  323. /package/dist/esm/{types/src → src}/index.d.ts +0 -0
  324. /package/dist/esm/{types/src → src}/mocks/browser.d.ts +0 -0
  325. /package/dist/esm/{types/src → src}/stories/Button.d.ts +0 -0
  326. /package/dist/esm/{types/src → src}/stories/Button.stories.d.ts +0 -0
  327. /package/dist/esm/{types/src → src}/stories/Header.d.ts +0 -0
  328. /package/dist/esm/{types/src → src}/stories/Header.stories.d.ts +0 -0
  329. /package/dist/esm/{types/src → src}/stories/Page.d.ts +0 -0
  330. /package/dist/esm/{types/src → src}/stories/Page.stories.d.ts +0 -0
  331. /package/dist/esm/{types/src → src}/utils.d.ts +0 -0
  332. /package/dist/esm/{types/vite.config.d.ts → vite.config.d.ts} +0 -0
package/dist/esm/index.js CHANGED
@@ -2,11 +2,12 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { createContext, useContext, useEffect, useState, useMemo, useRef } from 'react';
4
4
  import { Markup } from 'interweave';
5
- import { ConfigProvider, Button, Checkbox, Input, Divider, Modal, Form, Tag, Popconfirm, Drawer, Select, Dropdown } from 'antd';
5
+ import { ConfigProvider, Button, Typography, Checkbox, Input, Divider, Modal, Form, Tag, Popconfirm, Drawer, Select, Image, Dropdown } from 'antd';
6
6
  import styled from 'styled-components';
7
- import { DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, gqlRequest, createGraphQLClient, Misc, MARK_PRO, INPUT_BORDER_COLOR, QueryKeyFactory, useDownloadFile, SLATE_400, NotificationUtils, invokePlugin, useIsMobile as useIsMobile$1, GRAY_200, CHARCOAL_GRAY, StringUtils, usePaymentPlugins, ApiUtils, PAYABLE_INVOICE_STATES, DOCUMENT_NAME as DOCUMENT_NAME$1, QuoteInvoiceUtils, usePlugins, GraphqlUtils, Lists, getTaxationRequiredAccountFields, getAccount, FrontendTransaction, SLATE_600, ArrowDownToLine, TransactionKind, SubscriptionState as SubscriptionState$2, SLATE_50, SLATE_500, PRIMARY_COLOR, useCurrentUserData, TAG_COLORS, MODAL_MAX_HEIGHT, SLATE_200, DataInterval, ChargeType } from '@bunnyapp/common';
7
+ import { DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, gqlRequest, createGraphQLClient, Misc, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, QueryKeyFactory, useDownloadFile, NotificationUtils, invokePlugin, useIsMobile as useIsMobile$1, GRAY_500, GRAY_200, CHARCOAL_GRAY, StringUtils, usePaymentPlugins, ApiUtils, PAYABLE_INVOICE_STATES, DOCUMENT_NAME as DOCUMENT_NAME$1, QuoteInvoiceUtils, usePlugins, GraphqlUtils, MARK_PRO, Lists, getTaxationRequiredAccountFields, getAccount, useCurrentUserData, SLATE_500, PRIMARY_COLOR, FrontendTransaction, SLATE_600, WHITE, TransactionKind, SubscriptionState as SubscriptionState$2, MODAL_MAX_HEIGHT, DataInterval, TAG_COLORS, ChargeType } from '@bunnyapp/common';
8
8
  import { QueryClient, QueryClientProvider, useQuery, useMutation, useQueryClient, keepPreviousData } from '@tanstack/react-query';
9
9
  import { RecoilRoot, atom, useRecoilValue, useSetRecoilState, useRecoilState } from 'recoil';
10
+ import theme from 'antd/lib/theme';
10
11
  import { useElements, useStripe, PaymentElement, Elements } from '@stripe/react-stripe-js';
11
12
  import { loadStripe } from '@stripe/stripe-js/pure';
12
13
  import { capitalize, startCase, cloneDeep, omit } from 'lodash';
@@ -51,8 +52,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
51
52
  }
52
53
 
53
54
  function __generator(thisArg, body) {
54
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
55
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
55
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
56
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
56
57
  function verb(n) { return function (v) { return step([n, v]); }; }
57
58
  function step(op) {
58
59
  if (f) throw new TypeError("Generator is already executing.");
@@ -292,563 +293,535 @@ var classnames = {exports: {}};
292
293
 
293
294
  var classNames = classnames.exports;
294
295
 
296
+ const round = Math.round;
297
+
295
298
  /**
296
- * Take input from [0, n] and return it as [0, 1]
297
- * @hidden
298
- */
299
- function bound01(n, max) {
300
- if (isOnePointZero(n)) {
301
- n = '100%';
302
- }
303
- var isPercent = isPercentage(n);
304
- n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
305
- // Automatically convert percentage into number
306
- if (isPercent) {
307
- n = parseInt(String(n * max), 10) / 100;
308
- }
309
- // Handle floating point rounding errors
310
- if (Math.abs(n - max) < 0.000001) {
311
- return 1;
312
- }
313
- // Convert into [0, 1] range if it isn't already
314
- if (max === 360) {
315
- // If n is a hue given in degrees,
316
- // wrap around out-of-range values into [0, 360] range
317
- // then convert into [0, 1].
318
- n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
319
- }
320
- else {
321
- // If n not a hue given in degrees
322
- // Convert into [0, 1] range if it isn't already.
323
- n = (n % max) / parseFloat(String(max));
324
- }
325
- return n;
326
- }
327
- /**
328
- * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
329
- * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
330
- * @hidden
331
- */
332
- function isOnePointZero(n) {
333
- return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
334
- }
335
- /**
336
- * Check to see if string passed in is a percentage
337
- * @hidden
338
- */
339
- function isPercentage(n) {
340
- return typeof n === 'string' && n.indexOf('%') !== -1;
341
- }
342
- /**
343
- * Return a valid alpha value [0,1] with all invalid values being set to 1
344
- * @hidden
345
- */
346
- function boundAlpha(a) {
347
- a = parseFloat(a);
348
- if (isNaN(a) || a < 0 || a > 1) {
349
- a = 1;
350
- }
351
- return a;
352
- }
353
- /**
354
- * Replace a decimal with it's percentage value
355
- * @hidden
356
- */
357
- function convertToPercentage(n) {
358
- if (n <= 1) {
359
- return "".concat(Number(n) * 100, "%");
360
- }
361
- return n;
362
- }
363
- /**
364
- * Force a hex value to have 2 characters
365
- * @hidden
299
+ * Support format, alpha unit will check the % mark:
300
+ * - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]
301
+ * - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]
302
+ * - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]
303
+ * - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]
304
+ * - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]
305
+ *
306
+ * When `base` is provided, the percentage value will be divided by `base`.
366
307
  */
367
- function pad2(c) {
368
- return c.length === 1 ? '0' + c : String(c);
308
+ function splitColorStr(str, parseNum) {
309
+ const match = str
310
+ // Remove str before `(`
311
+ .replace(/^[^(]*\((.*)/, '$1')
312
+ // Remove str after `)`
313
+ .replace(/\).*/, '').match(/\d*\.?\d+%?/g) || [];
314
+ const numList = match.map(item => parseFloat(item));
315
+ for (let i = 0; i < 3; i += 1) {
316
+ numList[i] = parseNum(numList[i] || 0, match[i] || '', i);
317
+ }
318
+
319
+ // For alpha. 50% should be 0.5
320
+ if (match[3]) {
321
+ numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];
322
+ } else {
323
+ // By default, alpha is 1
324
+ numList[3] = 1;
325
+ }
326
+ return numList;
369
327
  }
328
+ const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
370
329
 
371
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
372
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
373
- /**
374
- * Handle bounds / percentage checking to conform to CSS color spec
375
- * <http://www.w3.org/TR/css3-color/>
376
- * *Assumes:* r, g, b in [0, 255] or [0, 1]
377
- * *Returns:* { r, g, b } in [0, 255]
378
- */
379
- function rgbToRgb(r, g, b) {
380
- return {
381
- r: bound01(r, 255) * 255,
382
- g: bound01(g, 255) * 255,
383
- b: bound01(b, 255) * 255,
384
- };
330
+ /** round and limit number to integer between 0-255 */
331
+ function limitRange(value, max) {
332
+ const mergedMax = max || 255;
333
+ if (value > mergedMax) {
334
+ return mergedMax;
335
+ }
336
+ if (value < 0) {
337
+ return 0;
338
+ }
339
+ return value;
385
340
  }
386
- function hue2rgb(p, q, t) {
387
- if (t < 0) {
388
- t += 1;
341
+ class FastColor {
342
+ constructor(input) {
343
+ /**
344
+ * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
345
+ */
346
+ _defineProperty(this, "isValid", true);
347
+ /**
348
+ * Red, R in RGB
349
+ */
350
+ _defineProperty(this, "r", 0);
351
+ /**
352
+ * Green, G in RGB
353
+ */
354
+ _defineProperty(this, "g", 0);
355
+ /**
356
+ * Blue, B in RGB
357
+ */
358
+ _defineProperty(this, "b", 0);
359
+ /**
360
+ * Alpha/Opacity, A in RGBA/HSLA
361
+ */
362
+ _defineProperty(this, "a", 1);
363
+ // HSV privates
364
+ _defineProperty(this, "_h", void 0);
365
+ _defineProperty(this, "_s", void 0);
366
+ _defineProperty(this, "_l", void 0);
367
+ _defineProperty(this, "_v", void 0);
368
+ // intermediate variables to calculate HSL/HSV
369
+ _defineProperty(this, "_max", void 0);
370
+ _defineProperty(this, "_min", void 0);
371
+ _defineProperty(this, "_brightness", void 0);
372
+ /**
373
+ * Always check 3 char in the object to determine the format.
374
+ * We not use function in check to save bundle size.
375
+ * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.
376
+ */
377
+ function matchFormat(str) {
378
+ return str[0] in input && str[1] in input && str[2] in input;
389
379
  }
390
- if (t > 1) {
391
- t -= 1;
380
+ if (!input) ; else if (typeof input === 'string') {
381
+ const trimStr = input.trim();
382
+ function matchPrefix(prefix) {
383
+ return trimStr.startsWith(prefix);
384
+ }
385
+ if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
386
+ this.fromHexString(trimStr);
387
+ } else if (matchPrefix('rgb')) {
388
+ this.fromRgbString(trimStr);
389
+ } else if (matchPrefix('hsl')) {
390
+ this.fromHslString(trimStr);
391
+ } else if (matchPrefix('hsv') || matchPrefix('hsb')) {
392
+ this.fromHsvString(trimStr);
393
+ }
394
+ } else if (input instanceof FastColor) {
395
+ this.r = input.r;
396
+ this.g = input.g;
397
+ this.b = input.b;
398
+ this.a = input.a;
399
+ this._h = input._h;
400
+ this._s = input._s;
401
+ this._l = input._l;
402
+ this._v = input._v;
403
+ } else if (matchFormat('rgb')) {
404
+ this.r = limitRange(input.r);
405
+ this.g = limitRange(input.g);
406
+ this.b = limitRange(input.b);
407
+ this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;
408
+ } else if (matchFormat('hsl')) {
409
+ this.fromHsl(input);
410
+ } else if (matchFormat('hsv')) {
411
+ this.fromHsv(input);
412
+ } else {
413
+ throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));
392
414
  }
393
- if (t < 1 / 6) {
394
- return p + (q - p) * (6 * t);
415
+ }
416
+
417
+ // ======================= Setter =======================
418
+
419
+ setR(value) {
420
+ return this._sc('r', value);
421
+ }
422
+ setG(value) {
423
+ return this._sc('g', value);
424
+ }
425
+ setB(value) {
426
+ return this._sc('b', value);
427
+ }
428
+ setA(value) {
429
+ return this._sc('a', value, 1);
430
+ }
431
+ setHue(value) {
432
+ const hsv = this.toHsv();
433
+ hsv.h = value;
434
+ return this._c(hsv);
435
+ }
436
+
437
+ // ======================= Getter =======================
438
+ /**
439
+ * Returns the perceived luminance of a color, from 0-1.
440
+ * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
441
+ */
442
+ getLuminance() {
443
+ function adjustGamma(raw) {
444
+ const val = raw / 255;
445
+ return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
395
446
  }
396
- if (t < 1 / 2) {
397
- return q;
447
+ const R = adjustGamma(this.r);
448
+ const G = adjustGamma(this.g);
449
+ const B = adjustGamma(this.b);
450
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
451
+ }
452
+ getHue() {
453
+ if (typeof this._h === 'undefined') {
454
+ const delta = this.getMax() - this.getMin();
455
+ if (delta === 0) {
456
+ this._h = 0;
457
+ } else {
458
+ this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
459
+ }
398
460
  }
399
- if (t < 2 / 3) {
400
- return p + (q - p) * (2 / 3 - t) * 6;
461
+ return this._h;
462
+ }
463
+ getSaturation() {
464
+ if (typeof this._s === 'undefined') {
465
+ const delta = this.getMax() - this.getMin();
466
+ if (delta === 0) {
467
+ this._s = 0;
468
+ } else {
469
+ this._s = delta / this.getMax();
470
+ }
401
471
  }
402
- return p;
403
- }
404
- /**
405
- * Converts an HSL color value to RGB.
406
- *
407
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
408
- * *Returns:* { r, g, b } in the set [0, 255]
409
- */
410
- function hslToRgb(h, s, l) {
411
- var r;
412
- var g;
413
- var b;
414
- h = bound01(h, 360);
415
- s = bound01(s, 100);
416
- l = bound01(l, 100);
417
- if (s === 0) {
418
- // achromatic
419
- g = l;
420
- b = l;
421
- r = l;
472
+ return this._s;
473
+ }
474
+ getLightness() {
475
+ if (typeof this._l === 'undefined') {
476
+ this._l = (this.getMax() + this.getMin()) / 510;
422
477
  }
423
- else {
424
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
425
- var p = 2 * l - q;
426
- r = hue2rgb(p, q, h + 1 / 3);
427
- g = hue2rgb(p, q, h);
428
- b = hue2rgb(p, q, h - 1 / 3);
478
+ return this._l;
479
+ }
480
+ getValue() {
481
+ if (typeof this._v === 'undefined') {
482
+ this._v = this.getMax() / 255;
429
483
  }
430
- return { r: r * 255, g: g * 255, b: b * 255 };
431
- }
432
- /**
433
- * Converts an RGB color value to HSV
434
- *
435
- * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
436
- * *Returns:* { h, s, v } in [0,1]
437
- */
438
- function rgbToHsv(r, g, b) {
439
- r = bound01(r, 255);
440
- g = bound01(g, 255);
441
- b = bound01(b, 255);
442
- var max = Math.max(r, g, b);
443
- var min = Math.min(r, g, b);
444
- var h = 0;
445
- var v = max;
446
- var d = max - min;
447
- var s = max === 0 ? 0 : d / max;
448
- if (max === min) {
449
- h = 0; // achromatic
484
+ return this._v;
485
+ }
486
+
487
+ /**
488
+ * Returns the perceived brightness of the color, from 0-255.
489
+ * Note: this is not the b of HSB
490
+ * @see http://www.w3.org/TR/AERT#color-contrast
491
+ */
492
+ getBrightness() {
493
+ if (typeof this._brightness === 'undefined') {
494
+ this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
450
495
  }
451
- else {
452
- switch (max) {
453
- case r:
454
- h = (g - b) / d + (g < b ? 6 : 0);
455
- break;
456
- case g:
457
- h = (b - r) / d + 2;
458
- break;
459
- case b:
460
- h = (r - g) / d + 4;
461
- break;
462
- }
463
- h /= 6;
496
+ return this._brightness;
497
+ }
498
+
499
+ // ======================== Func ========================
500
+
501
+ darken(amount = 10) {
502
+ const h = this.getHue();
503
+ const s = this.getSaturation();
504
+ let l = this.getLightness() - amount / 100;
505
+ if (l < 0) {
506
+ l = 0;
464
507
  }
465
- return { h: h, s: s, v: v };
466
- }
467
- /**
468
- * Converts an HSV color value to RGB.
469
- *
470
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
471
- * *Returns:* { r, g, b } in the set [0, 255]
472
- */
473
- function hsvToRgb(h, s, v) {
474
- h = bound01(h, 360) * 6;
475
- s = bound01(s, 100);
476
- v = bound01(v, 100);
477
- var i = Math.floor(h);
478
- var f = h - i;
479
- var p = v * (1 - s);
480
- var q = v * (1 - f * s);
481
- var t = v * (1 - (1 - f) * s);
482
- var mod = i % 6;
483
- var r = [v, q, p, p, t, v][mod];
484
- var g = [t, v, v, q, p, p][mod];
485
- var b = [p, p, t, v, v, q][mod];
486
- return { r: r * 255, g: g * 255, b: b * 255 };
487
- }
488
- /**
489
- * Converts an RGB color to hex
490
- *
491
- * Assumes r, g, and b are contained in the set [0, 255]
492
- * Returns a 3 or 6 character hex
493
- */
494
- function rgbToHex(r, g, b, allow3Char) {
495
- var hex = [
496
- pad2(Math.round(r).toString(16)),
497
- pad2(Math.round(g).toString(16)),
498
- pad2(Math.round(b).toString(16)),
499
- ];
500
- // Return a 3 character hex if possible
501
- if (allow3Char &&
502
- hex[0].startsWith(hex[0].charAt(1)) &&
503
- hex[1].startsWith(hex[1].charAt(1)) &&
504
- hex[2].startsWith(hex[2].charAt(1))) {
505
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
508
+ return this._c({
509
+ h,
510
+ s,
511
+ l,
512
+ a: this.a
513
+ });
514
+ }
515
+ lighten(amount = 10) {
516
+ const h = this.getHue();
517
+ const s = this.getSaturation();
518
+ let l = this.getLightness() + amount / 100;
519
+ if (l > 1) {
520
+ l = 1;
506
521
  }
507
- return hex.join('');
508
- }
509
- /** Converts a hex value to a decimal */
510
- function convertHexToDecimal(h) {
511
- return parseIntFromHex(h) / 255;
512
- }
513
- /** Parse a base-16 hex value into a base-10 integer */
514
- function parseIntFromHex(val) {
515
- return parseInt(val, 16);
516
- }
522
+ return this._c({
523
+ h,
524
+ s,
525
+ l,
526
+ a: this.a
527
+ });
528
+ }
517
529
 
518
- // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
519
- /**
520
- * @hidden
521
- */
522
- var names = {
523
- aliceblue: '#f0f8ff',
524
- antiquewhite: '#faebd7',
525
- aqua: '#00ffff',
526
- aquamarine: '#7fffd4',
527
- azure: '#f0ffff',
528
- beige: '#f5f5dc',
529
- bisque: '#ffe4c4',
530
- black: '#000000',
531
- blanchedalmond: '#ffebcd',
532
- blue: '#0000ff',
533
- blueviolet: '#8a2be2',
534
- brown: '#a52a2a',
535
- burlywood: '#deb887',
536
- cadetblue: '#5f9ea0',
537
- chartreuse: '#7fff00',
538
- chocolate: '#d2691e',
539
- coral: '#ff7f50',
540
- cornflowerblue: '#6495ed',
541
- cornsilk: '#fff8dc',
542
- crimson: '#dc143c',
543
- cyan: '#00ffff',
544
- darkblue: '#00008b',
545
- darkcyan: '#008b8b',
546
- darkgoldenrod: '#b8860b',
547
- darkgray: '#a9a9a9',
548
- darkgreen: '#006400',
549
- darkgrey: '#a9a9a9',
550
- darkkhaki: '#bdb76b',
551
- darkmagenta: '#8b008b',
552
- darkolivegreen: '#556b2f',
553
- darkorange: '#ff8c00',
554
- darkorchid: '#9932cc',
555
- darkred: '#8b0000',
556
- darksalmon: '#e9967a',
557
- darkseagreen: '#8fbc8f',
558
- darkslateblue: '#483d8b',
559
- darkslategray: '#2f4f4f',
560
- darkslategrey: '#2f4f4f',
561
- darkturquoise: '#00ced1',
562
- darkviolet: '#9400d3',
563
- deeppink: '#ff1493',
564
- deepskyblue: '#00bfff',
565
- dimgray: '#696969',
566
- dimgrey: '#696969',
567
- dodgerblue: '#1e90ff',
568
- firebrick: '#b22222',
569
- floralwhite: '#fffaf0',
570
- forestgreen: '#228b22',
571
- fuchsia: '#ff00ff',
572
- gainsboro: '#dcdcdc',
573
- ghostwhite: '#f8f8ff',
574
- goldenrod: '#daa520',
575
- gold: '#ffd700',
576
- gray: '#808080',
577
- green: '#008000',
578
- greenyellow: '#adff2f',
579
- grey: '#808080',
580
- honeydew: '#f0fff0',
581
- hotpink: '#ff69b4',
582
- indianred: '#cd5c5c',
583
- indigo: '#4b0082',
584
- ivory: '#fffff0',
585
- khaki: '#f0e68c',
586
- lavenderblush: '#fff0f5',
587
- lavender: '#e6e6fa',
588
- lawngreen: '#7cfc00',
589
- lemonchiffon: '#fffacd',
590
- lightblue: '#add8e6',
591
- lightcoral: '#f08080',
592
- lightcyan: '#e0ffff',
593
- lightgoldenrodyellow: '#fafad2',
594
- lightgray: '#d3d3d3',
595
- lightgreen: '#90ee90',
596
- lightgrey: '#d3d3d3',
597
- lightpink: '#ffb6c1',
598
- lightsalmon: '#ffa07a',
599
- lightseagreen: '#20b2aa',
600
- lightskyblue: '#87cefa',
601
- lightslategray: '#778899',
602
- lightslategrey: '#778899',
603
- lightsteelblue: '#b0c4de',
604
- lightyellow: '#ffffe0',
605
- lime: '#00ff00',
606
- limegreen: '#32cd32',
607
- linen: '#faf0e6',
608
- magenta: '#ff00ff',
609
- maroon: '#800000',
610
- mediumaquamarine: '#66cdaa',
611
- mediumblue: '#0000cd',
612
- mediumorchid: '#ba55d3',
613
- mediumpurple: '#9370db',
614
- mediumseagreen: '#3cb371',
615
- mediumslateblue: '#7b68ee',
616
- mediumspringgreen: '#00fa9a',
617
- mediumturquoise: '#48d1cc',
618
- mediumvioletred: '#c71585',
619
- midnightblue: '#191970',
620
- mintcream: '#f5fffa',
621
- mistyrose: '#ffe4e1',
622
- moccasin: '#ffe4b5',
623
- navajowhite: '#ffdead',
624
- navy: '#000080',
625
- oldlace: '#fdf5e6',
626
- olive: '#808000',
627
- olivedrab: '#6b8e23',
628
- orange: '#ffa500',
629
- orangered: '#ff4500',
630
- orchid: '#da70d6',
631
- palegoldenrod: '#eee8aa',
632
- palegreen: '#98fb98',
633
- paleturquoise: '#afeeee',
634
- palevioletred: '#db7093',
635
- papayawhip: '#ffefd5',
636
- peachpuff: '#ffdab9',
637
- peru: '#cd853f',
638
- pink: '#ffc0cb',
639
- plum: '#dda0dd',
640
- powderblue: '#b0e0e6',
641
- purple: '#800080',
642
- rebeccapurple: '#663399',
643
- red: '#ff0000',
644
- rosybrown: '#bc8f8f',
645
- royalblue: '#4169e1',
646
- saddlebrown: '#8b4513',
647
- salmon: '#fa8072',
648
- sandybrown: '#f4a460',
649
- seagreen: '#2e8b57',
650
- seashell: '#fff5ee',
651
- sienna: '#a0522d',
652
- silver: '#c0c0c0',
653
- skyblue: '#87ceeb',
654
- slateblue: '#6a5acd',
655
- slategray: '#708090',
656
- slategrey: '#708090',
657
- snow: '#fffafa',
658
- springgreen: '#00ff7f',
659
- steelblue: '#4682b4',
660
- tan: '#d2b48c',
661
- teal: '#008080',
662
- thistle: '#d8bfd8',
663
- tomato: '#ff6347',
664
- turquoise: '#40e0d0',
665
- violet: '#ee82ee',
666
- wheat: '#f5deb3',
667
- white: '#ffffff',
668
- whitesmoke: '#f5f5f5',
669
- yellow: '#ffff00',
670
- yellowgreen: '#9acd32',
671
- };
672
-
673
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
674
- /**
675
- * Given a string or object, convert that input to RGB
676
- *
677
- * Possible string inputs:
678
- * ```
679
- * "red"
680
- * "#f00" or "f00"
681
- * "#ff0000" or "ff0000"
682
- * "#ff000000" or "ff000000"
683
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
684
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
685
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
686
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
687
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
688
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
689
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
690
- * ```
691
- */
692
- function inputToRGB(color) {
693
- var rgb = { r: 0, g: 0, b: 0 };
694
- var a = 1;
695
- var s = null;
696
- var v = null;
697
- var l = null;
698
- var ok = false;
699
- var format = false;
700
- if (typeof color === 'string') {
701
- color = stringInputToObject(color);
702
- }
703
- if (typeof color === 'object') {
704
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
705
- rgb = rgbToRgb(color.r, color.g, color.b);
706
- ok = true;
707
- format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
708
- }
709
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
710
- s = convertToPercentage(color.s);
711
- v = convertToPercentage(color.v);
712
- rgb = hsvToRgb(color.h, s, v);
713
- ok = true;
714
- format = 'hsv';
715
- }
716
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
717
- s = convertToPercentage(color.s);
718
- l = convertToPercentage(color.l);
719
- rgb = hslToRgb(color.h, s, l);
720
- ok = true;
721
- format = 'hsl';
722
- }
723
- if (Object.prototype.hasOwnProperty.call(color, 'a')) {
724
- a = color.a;
725
- }
530
+ /**
531
+ * Mix the current color a given amount with another color, from 0 to 100.
532
+ * 0 means no mixing (return current color).
533
+ */
534
+ mix(input, amount = 50) {
535
+ const color = this._c(input);
536
+ const p = amount / 100;
537
+ const calc = key => (color[key] - this[key]) * p + this[key];
538
+ const rgba = {
539
+ r: round(calc('r')),
540
+ g: round(calc('g')),
541
+ b: round(calc('b')),
542
+ a: round(calc('a') * 100) / 100
543
+ };
544
+ return this._c(rgba);
545
+ }
546
+
547
+ /**
548
+ * Mix the color with pure white, from 0 to 100.
549
+ * Providing 0 will do nothing, providing 100 will always return white.
550
+ */
551
+ tint(amount = 10) {
552
+ return this.mix({
553
+ r: 255,
554
+ g: 255,
555
+ b: 255,
556
+ a: 1
557
+ }, amount);
558
+ }
559
+
560
+ /**
561
+ * Mix the color with pure black, from 0 to 100.
562
+ * Providing 0 will do nothing, providing 100 will always return black.
563
+ */
564
+ shade(amount = 10) {
565
+ return this.mix({
566
+ r: 0,
567
+ g: 0,
568
+ b: 0,
569
+ a: 1
570
+ }, amount);
571
+ }
572
+ onBackground(background) {
573
+ const bg = this._c(background);
574
+ const alpha = this.a + bg.a * (1 - this.a);
575
+ const calc = key => {
576
+ return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
577
+ };
578
+ return this._c({
579
+ r: calc('r'),
580
+ g: calc('g'),
581
+ b: calc('b'),
582
+ a: alpha
583
+ });
584
+ }
585
+
586
+ // ======================= Status =======================
587
+ isDark() {
588
+ return this.getBrightness() < 128;
589
+ }
590
+ isLight() {
591
+ return this.getBrightness() >= 128;
592
+ }
593
+
594
+ // ======================== MISC ========================
595
+ equals(other) {
596
+ return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
597
+ }
598
+ clone() {
599
+ return this._c(this);
600
+ }
601
+
602
+ // ======================= Format =======================
603
+ toHexString() {
604
+ let hex = '#';
605
+ const rHex = (this.r || 0).toString(16);
606
+ hex += rHex.length === 2 ? rHex : '0' + rHex;
607
+ const gHex = (this.g || 0).toString(16);
608
+ hex += gHex.length === 2 ? gHex : '0' + gHex;
609
+ const bHex = (this.b || 0).toString(16);
610
+ hex += bHex.length === 2 ? bHex : '0' + bHex;
611
+ if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {
612
+ const aHex = round(this.a * 255).toString(16);
613
+ hex += aHex.length === 2 ? aHex : '0' + aHex;
726
614
  }
727
- a = boundAlpha(a);
615
+ return hex;
616
+ }
617
+
618
+ /** CSS support color pattern */
619
+ toHsl() {
728
620
  return {
729
- ok: ok,
730
- format: color.format || format,
731
- r: Math.min(255, Math.max(rgb.r, 0)),
732
- g: Math.min(255, Math.max(rgb.g, 0)),
733
- b: Math.min(255, Math.max(rgb.b, 0)),
734
- a: a,
621
+ h: this.getHue(),
622
+ s: this.getSaturation(),
623
+ l: this.getLightness(),
624
+ a: this.a
735
625
  };
736
- }
737
- // <http://www.w3.org/TR/css3-values/#integers>
738
- var CSS_INTEGER = '[-\\+]?\\d+%?';
739
- // <http://www.w3.org/TR/css3-values/#number-value>
740
- var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
741
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
742
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
743
- // Actual matching.
744
- // Parentheses and commas are optional, but not required.
745
- // Whitespace can take the place of commas or opening paren
746
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
747
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
748
- var matchers = {
749
- CSS_UNIT: new RegExp(CSS_UNIT),
750
- rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
751
- rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
752
- hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
753
- hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
754
- hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
755
- hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
756
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
757
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
758
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
759
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
760
- };
761
- /**
762
- * Permissive string parsing. Take in a number of formats, and output an object
763
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
764
- */
765
- function stringInputToObject(color) {
766
- color = color.trim().toLowerCase();
767
- if (color.length === 0) {
768
- return false;
769
- }
770
- var named = false;
771
- if (names[color]) {
772
- color = names[color];
773
- named = true;
774
- }
775
- else if (color === 'transparent') {
776
- return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
777
- }
778
- // Try to match string input using regular expressions.
779
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
780
- // Just return an object and let the conversion functions handle that.
781
- // This way the result will be the same whether the tinycolor is initialized with string or object.
782
- var match = matchers.rgb.exec(color);
783
- if (match) {
784
- return { r: match[1], g: match[2], b: match[3] };
785
- }
786
- match = matchers.rgba.exec(color);
787
- if (match) {
788
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
789
- }
790
- match = matchers.hsl.exec(color);
791
- if (match) {
792
- return { h: match[1], s: match[2], l: match[3] };
626
+ }
627
+
628
+ /** CSS support color pattern */
629
+ toHslString() {
630
+ const h = this.getHue();
631
+ const s = round(this.getSaturation() * 100);
632
+ const l = round(this.getLightness() * 100);
633
+ return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
634
+ }
635
+
636
+ /** Same as toHsb */
637
+ toHsv() {
638
+ return {
639
+ h: this.getHue(),
640
+ s: this.getSaturation(),
641
+ v: this.getValue(),
642
+ a: this.a
643
+ };
644
+ }
645
+ toRgb() {
646
+ return {
647
+ r: this.r,
648
+ g: this.g,
649
+ b: this.b,
650
+ a: this.a
651
+ };
652
+ }
653
+ toRgbString() {
654
+ return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
655
+ }
656
+ toString() {
657
+ return this.toRgbString();
658
+ }
659
+
660
+ // ====================== Privates ======================
661
+ /** Return a new FastColor object with one channel changed */
662
+ _sc(rgb, value, max) {
663
+ const clone = this.clone();
664
+ clone[rgb] = limitRange(value, max);
665
+ return clone;
666
+ }
667
+ _c(input) {
668
+ return new this.constructor(input);
669
+ }
670
+ getMax() {
671
+ if (typeof this._max === 'undefined') {
672
+ this._max = Math.max(this.r, this.g, this.b);
793
673
  }
794
- match = matchers.hsla.exec(color);
795
- if (match) {
796
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
674
+ return this._max;
675
+ }
676
+ getMin() {
677
+ if (typeof this._min === 'undefined') {
678
+ this._min = Math.min(this.r, this.g, this.b);
797
679
  }
798
- match = matchers.hsv.exec(color);
799
- if (match) {
800
- return { h: match[1], s: match[2], v: match[3] };
680
+ return this._min;
681
+ }
682
+ fromHexString(trimStr) {
683
+ const withoutPrefix = trimStr.replace('#', '');
684
+ function connectNum(index1, index2) {
685
+ return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
801
686
  }
802
- match = matchers.hsva.exec(color);
803
- if (match) {
804
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
687
+ if (withoutPrefix.length < 6) {
688
+ // #rgb or #rgba
689
+ this.r = connectNum(0);
690
+ this.g = connectNum(1);
691
+ this.b = connectNum(2);
692
+ this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
693
+ } else {
694
+ // #rrggbb or #rrggbbaa
695
+ this.r = connectNum(0, 1);
696
+ this.g = connectNum(2, 3);
697
+ this.b = connectNum(4, 5);
698
+ this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
805
699
  }
806
- match = matchers.hex8.exec(color);
807
- if (match) {
808
- return {
809
- r: parseIntFromHex(match[1]),
810
- g: parseIntFromHex(match[2]),
811
- b: parseIntFromHex(match[3]),
812
- a: convertHexToDecimal(match[4]),
813
- format: named ? 'name' : 'hex8',
814
- };
700
+ }
701
+ fromHsl({
702
+ h,
703
+ s,
704
+ l,
705
+ a
706
+ }) {
707
+ this._h = h % 360;
708
+ this._s = s;
709
+ this._l = l;
710
+ this.a = typeof a === 'number' ? a : 1;
711
+ if (s <= 0) {
712
+ const rgb = round(l * 255);
713
+ this.r = rgb;
714
+ this.g = rgb;
715
+ this.b = rgb;
815
716
  }
816
- match = matchers.hex6.exec(color);
817
- if (match) {
818
- return {
819
- r: parseIntFromHex(match[1]),
820
- g: parseIntFromHex(match[2]),
821
- b: parseIntFromHex(match[3]),
822
- format: named ? 'name' : 'hex',
823
- };
717
+ let r = 0,
718
+ g = 0,
719
+ b = 0;
720
+ const huePrime = h / 60;
721
+ const chroma = (1 - Math.abs(2 * l - 1)) * s;
722
+ const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
723
+ if (huePrime >= 0 && huePrime < 1) {
724
+ r = chroma;
725
+ g = secondComponent;
726
+ } else if (huePrime >= 1 && huePrime < 2) {
727
+ r = secondComponent;
728
+ g = chroma;
729
+ } else if (huePrime >= 2 && huePrime < 3) {
730
+ g = chroma;
731
+ b = secondComponent;
732
+ } else if (huePrime >= 3 && huePrime < 4) {
733
+ g = secondComponent;
734
+ b = chroma;
735
+ } else if (huePrime >= 4 && huePrime < 5) {
736
+ r = secondComponent;
737
+ b = chroma;
738
+ } else if (huePrime >= 5 && huePrime < 6) {
739
+ r = chroma;
740
+ b = secondComponent;
824
741
  }
825
- match = matchers.hex4.exec(color);
826
- if (match) {
827
- return {
828
- r: parseIntFromHex(match[1] + match[1]),
829
- g: parseIntFromHex(match[2] + match[2]),
830
- b: parseIntFromHex(match[3] + match[3]),
831
- a: convertHexToDecimal(match[4] + match[4]),
832
- format: named ? 'name' : 'hex8',
833
- };
742
+ const lightnessModification = l - chroma / 2;
743
+ this.r = round((r + lightnessModification) * 255);
744
+ this.g = round((g + lightnessModification) * 255);
745
+ this.b = round((b + lightnessModification) * 255);
746
+ }
747
+ fromHsv({
748
+ h,
749
+ s,
750
+ v,
751
+ a
752
+ }) {
753
+ this._h = h % 360;
754
+ this._s = s;
755
+ this._v = v;
756
+ this.a = typeof a === 'number' ? a : 1;
757
+ const vv = round(v * 255);
758
+ this.r = vv;
759
+ this.g = vv;
760
+ this.b = vv;
761
+ if (s <= 0) {
762
+ return;
834
763
  }
835
- match = matchers.hex3.exec(color);
836
- if (match) {
837
- return {
838
- r: parseIntFromHex(match[1] + match[1]),
839
- g: parseIntFromHex(match[2] + match[2]),
840
- b: parseIntFromHex(match[3] + match[3]),
841
- format: named ? 'name' : 'hex',
842
- };
764
+ const hh = h / 60;
765
+ const i = Math.floor(hh);
766
+ const ff = hh - i;
767
+ const p = round(v * (1.0 - s) * 255);
768
+ const q = round(v * (1.0 - s * ff) * 255);
769
+ const t = round(v * (1.0 - s * (1.0 - ff)) * 255);
770
+ switch (i) {
771
+ case 0:
772
+ this.g = t;
773
+ this.b = p;
774
+ break;
775
+ case 1:
776
+ this.r = q;
777
+ this.b = p;
778
+ break;
779
+ case 2:
780
+ this.r = p;
781
+ this.b = t;
782
+ break;
783
+ case 3:
784
+ this.r = p;
785
+ this.g = q;
786
+ break;
787
+ case 4:
788
+ this.r = t;
789
+ this.g = p;
790
+ break;
791
+ case 5:
792
+ default:
793
+ this.g = p;
794
+ this.b = q;
795
+ break;
843
796
  }
844
- return false;
845
- }
846
- /**
847
- * Check to see if it looks like a CSS unit
848
- * (see `matchers` above for definition).
849
- */
850
- function isValidCSSUnit(color) {
851
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
797
+ }
798
+ fromHsvString(trimStr) {
799
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
800
+ this.fromHsv({
801
+ h: cells[0],
802
+ s: cells[1],
803
+ v: cells[2],
804
+ a: cells[3]
805
+ });
806
+ }
807
+ fromHslString(trimStr) {
808
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
809
+ this.fromHsl({
810
+ h: cells[0],
811
+ s: cells[1],
812
+ l: cells[2],
813
+ a: cells[3]
814
+ });
815
+ }
816
+ fromRgbString(trimStr) {
817
+ const cells = splitColorStr(trimStr, (num, txt) =>
818
+ // Convert percentage to number. e.g. 50% -> 128
819
+ txt.includes('%') ? round(num / 100 * 255) : num);
820
+ this.r = cells[0];
821
+ this.g = cells[1];
822
+ this.b = cells[2];
823
+ this.a = cells[3];
824
+ }
852
825
  }
853
826
 
854
827
  var hueStep = 2; // 色相阶梯
@@ -858,73 +831,39 @@ var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
858
831
  var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
859
832
  var lightColorCount = 5; // 浅色数量,主色上
860
833
  var darkColorCount = 4; // 深色数量,主色下
834
+
861
835
  // 暗色主题颜色映射关系表
862
836
  var darkColorMap = [{
863
837
  index: 7,
864
- opacity: 0.15
838
+ amount: 15
865
839
  }, {
866
840
  index: 6,
867
- opacity: 0.25
841
+ amount: 25
868
842
  }, {
869
843
  index: 5,
870
- opacity: 0.3
844
+ amount: 30
871
845
  }, {
872
846
  index: 5,
873
- opacity: 0.45
847
+ amount: 45
874
848
  }, {
875
849
  index: 5,
876
- opacity: 0.65
850
+ amount: 65
877
851
  }, {
878
852
  index: 5,
879
- opacity: 0.85
853
+ amount: 85
880
854
  }, {
881
855
  index: 4,
882
- opacity: 0.9
856
+ amount: 90
883
857
  }, {
884
858
  index: 3,
885
- opacity: 0.95
859
+ amount: 95
886
860
  }, {
887
861
  index: 2,
888
- opacity: 0.97
862
+ amount: 97
889
863
  }, {
890
864
  index: 1,
891
- opacity: 0.98
865
+ amount: 98
892
866
  }];
893
- // Wrapper function ported from TinyColor.prototype.toHsv
894
- // Keep it here because of `hsv.h * 360`
895
- function toHsv(_ref) {
896
- var r = _ref.r,
897
- g = _ref.g,
898
- b = _ref.b;
899
- var hsv = rgbToHsv(r, g, b);
900
- return {
901
- h: hsv.h * 360,
902
- s: hsv.s,
903
- v: hsv.v
904
- };
905
- }
906
-
907
- // Wrapper function ported from TinyColor.prototype.toHexString
908
- // Keep it here because of the prefix `#`
909
- function toHex(_ref2) {
910
- var r = _ref2.r,
911
- g = _ref2.g,
912
- b = _ref2.b;
913
- return "#".concat(rgbToHex(r, g, b, false));
914
- }
915
-
916
- // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
917
- // Amount in range [0, 1]
918
- // Assume color1 & color2 has no alpha, since the following src code did so.
919
- function mix(rgb1, rgb2, amount) {
920
- var p = amount / 100;
921
- var rgb = {
922
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
923
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
924
- b: (rgb2.b - rgb1.b) * p + rgb1.b
925
- };
926
- return rgb;
927
- }
928
867
  function getHue(hsv, i, light) {
929
868
  var hue;
930
869
  // 根据色相不同,色相转向不同
@@ -964,7 +903,7 @@ function getSaturation(hsv, i, light) {
964
903
  if (saturation < 0.06) {
965
904
  saturation = 0.06;
966
905
  }
967
- return Number(saturation.toFixed(2));
906
+ return Math.round(saturation * 100) / 100;
968
907
  }
969
908
  function getValue(hsv, i, light) {
970
909
  var value;
@@ -973,45 +912,44 @@ function getValue(hsv, i, light) {
973
912
  } else {
974
913
  value = hsv.v - brightnessStep2 * i;
975
914
  }
976
- if (value > 1) {
977
- value = 1;
978
- }
979
- return Number(value.toFixed(2));
915
+ // Clamp value between 0 and 1
916
+ value = Math.max(0, Math.min(1, value));
917
+ return Math.round(value * 100) / 100;
980
918
  }
981
919
  function generate$1(color) {
982
920
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
983
921
  var patterns = [];
984
- var pColor = inputToRGB(color);
922
+ var pColor = new FastColor(color);
923
+ var hsv = pColor.toHsv();
985
924
  for (var i = lightColorCount; i > 0; i -= 1) {
986
- var hsv = toHsv(pColor);
987
- var colorString = toHex(inputToRGB({
925
+ var c = new FastColor({
988
926
  h: getHue(hsv, i, true),
989
927
  s: getSaturation(hsv, i, true),
990
928
  v: getValue(hsv, i, true)
991
- }));
992
- patterns.push(colorString);
929
+ });
930
+ patterns.push(c);
993
931
  }
994
- patterns.push(toHex(pColor));
932
+ patterns.push(pColor);
995
933
  for (var _i = 1; _i <= darkColorCount; _i += 1) {
996
- var _hsv = toHsv(pColor);
997
- var _colorString = toHex(inputToRGB({
998
- h: getHue(_hsv, _i),
999
- s: getSaturation(_hsv, _i),
1000
- v: getValue(_hsv, _i)
1001
- }));
1002
- patterns.push(_colorString);
934
+ var _c = new FastColor({
935
+ h: getHue(hsv, _i),
936
+ s: getSaturation(hsv, _i),
937
+ v: getValue(hsv, _i)
938
+ });
939
+ patterns.push(_c);
1003
940
  }
1004
941
 
1005
942
  // dark theme patterns
1006
943
  if (opts.theme === 'dark') {
1007
- return darkColorMap.map(function (_ref3) {
1008
- var index = _ref3.index,
1009
- opacity = _ref3.opacity;
1010
- var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
1011
- return darkColorString;
944
+ return darkColorMap.map(function (_ref) {
945
+ var index = _ref.index,
946
+ amount = _ref.amount;
947
+ return new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
1012
948
  });
1013
949
  }
1014
- return patterns;
950
+ return patterns.map(function (c) {
951
+ return c.toHexString();
952
+ });
1015
953
  }
1016
954
 
1017
955
  // Generated by script. Do NOT modify!
@@ -1498,11 +1436,29 @@ var BankOutlined = function BankOutlined(props, ref) {
1498
1436
  };
1499
1437
 
1500
1438
  /**![bank](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg5NCA0NjJjMzAuOSAwIDQzLjgtMzkuNyAxOC43LTU4TDUzMC44IDEyNi4yYTMxLjgxIDMxLjgxIDAgMDAtMzcuNiAwTDExMS4zIDQwNGMtMjUuMSAxOC4yLTEyLjIgNTggMTguOCA1OEgxOTJ2Mzc0aC03MmMtNC40IDAtOCAzLjYtOCA4djUyYzAgNC40IDMuNiA4IDggOGg3ODRjNC40IDAgOC0zLjYgOC04di01MmMwLTQuNC0zLjYtOC04LThoLTcyVjQ2Mmg2MnpNNTEyIDE5Ni43bDI3MS4xIDE5Ny4ySDI0MC45TDUxMiAxOTYuN3pNMjY0IDQ2MmgxMTd2Mzc0SDI2NFY0NjJ6bTE4OSAwaDExN3YzNzRINDUzVjQ2MnptMzA3IDM3NEg2NDJWNDYyaDExOHYzNzR6IiAvPjwvc3ZnPg==) */
1501
- var RefIcon$3 = /*#__PURE__*/React.forwardRef(BankOutlined);
1439
+ var RefIcon$4 = /*#__PURE__*/React.forwardRef(BankOutlined);
1440
+ if (process.env.NODE_ENV !== 'production') {
1441
+ RefIcon$4.displayName = 'BankOutlined';
1442
+ }
1443
+ var BankOutlined$1 = RefIcon$4;
1444
+
1445
+ // This icon file is generated automatically.
1446
+ var CheckCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
1447
+ var CheckCircleFilledSvg = CheckCircleFilled$2;
1448
+
1449
+ var CheckCircleFilled = function CheckCircleFilled(props, ref) {
1450
+ return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {
1451
+ ref: ref,
1452
+ icon: CheckCircleFilledSvg
1453
+ }));
1454
+ };
1455
+
1456
+ /**![check-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDggNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0em0xOTMuNSAzMDEuN2wtMjEwLjYgMjkyYTMxLjggMzEuOCAwIDAxLTUxLjcgMEwzMTguNSA0ODQuOWMtMy44LTUuMyAwLTEyLjcgNi41LTEyLjdoNDYuOWMxMC4yIDAgMTkuOSA0LjkgMjUuOSAxMy4zbDcxLjIgOTguOCAxNTcuMi0yMThjNi04LjMgMTUuNi0xMy4zIDI1LjktMTMuM0g2OTljNi41IDAgMTAuMyA3LjQgNi41IDEyLjd6IiAvPjwvc3ZnPg==) */
1457
+ var RefIcon$3 = /*#__PURE__*/React.forwardRef(CheckCircleFilled);
1502
1458
  if (process.env.NODE_ENV !== 'production') {
1503
- RefIcon$3.displayName = 'BankOutlined';
1459
+ RefIcon$3.displayName = 'CheckCircleFilled';
1504
1460
  }
1505
- var BankOutlined$1 = RefIcon$3;
1461
+ var CheckCircleFilled$1 = RefIcon$3;
1506
1462
 
1507
1463
  // This icon file is generated automatically.
1508
1464
  var CloseOutlined$2 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
@@ -1565,14 +1521,14 @@ var BrandContext = createContext({
1565
1521
  topNavImageUrl: DEFAULT_TOP_NAV_IMAGE_URL,
1566
1522
  });
1567
1523
 
1568
- var MUTATION$4 = "{\n entityBranding {\n accentColor\n brandColor\n topNavImageUrl\n }\n }";
1524
+ var MUTATION$8 = "{\n entityBranding {\n accentColor\n brandColor\n topNavImageUrl\n }\n }";
1569
1525
  var getBranding = function (_a) {
1570
1526
  var token = _a.token, subdomain = _a.subdomain;
1571
1527
  return __awaiter(void 0, void 0, void 0, function () {
1572
1528
  var response;
1573
1529
  return __generator(this, function (_b) {
1574
1530
  switch (_b.label) {
1575
- case 0: return [4 /*yield*/, gqlRequest({ query: MUTATION$4, token: token, subdomain: subdomain })];
1531
+ case 0: return [4 /*yield*/, gqlRequest({ query: MUTATION$8, token: token, subdomain: subdomain })];
1576
1532
  case 1:
1577
1533
  response = _b.sent();
1578
1534
  return [2 /*return*/, response === null || response === void 0 ? void 0 : response.entityBranding];
@@ -1650,10 +1606,10 @@ var BunnyContext = createContext({});
1650
1606
  var queryClient$1 = new QueryClient();
1651
1607
  // Every component shares similar props and functionality, which this wrapper handles.
1652
1608
  function BunnyProvider(_a) {
1653
- var children = _a.children, token = _a.token, subdomain = _a.subdomain, window = _a.window, accountId = _a.accountId;
1609
+ var children = _a.children, token = _a.token, subdomain = _a.subdomain, window = _a.window, accountId = _a.accountId, _b = _a.darkMode, darkMode = _b === void 0 ? false : _b;
1654
1610
  var graphQLClient = createGraphQLClient(subdomain || "", window, token);
1655
1611
  var isMobile = useIsMobile(window);
1656
- var _b = useState(undefined), branding = _b[0], setBranding = _b[1];
1612
+ var _c = useState(undefined), branding = _c[0], setBranding = _c[1];
1657
1613
  // ====== START - Copied straight from PageContainer.tsx ========
1658
1614
  var entityBranding = useMemo(function () {
1659
1615
  var _a;
@@ -1683,16 +1639,36 @@ function BunnyProvider(_a) {
1683
1639
  document.getElementsByTagName("head")[0].removeChild(script);
1684
1640
  };
1685
1641
  }, []);
1686
- return (jsx(BunnyContext.Provider, __assign({ value: { subdomain: subdomain, graphQLClient: graphQLClient, window: window, token: token, accountId: accountId } }, { children: jsx(QueryClientProvider, __assign({ client: queryClient$1 }, { children: jsx(RecoilRoot, { children: jsx(BrandContext.Provider, __assign({ value: entityBranding }, { children: jsx(ConfigProvider, __assign({ theme: {
1642
+ return (jsx(BunnyContext.Provider, __assign({ value: {
1643
+ subdomain: subdomain,
1644
+ graphQLClient: graphQLClient,
1645
+ window: window,
1646
+ token: token,
1647
+ accountId: accountId,
1648
+ darkMode: darkMode,
1649
+ } }, { children: jsx(QueryClientProvider, __assign({ client: queryClient$1 }, { children: jsx(RecoilRoot, { children: jsx(BrandContext.Provider, __assign({ value: entityBranding }, { children: jsx(ConfigProvider, __assign({ theme: {
1650
+ algorithm: darkMode
1651
+ ? theme.darkAlgorithm
1652
+ : theme.defaultAlgorithm,
1687
1653
  token: {
1688
1654
  borderRadius: 4,
1689
1655
  colorPrimary: entityBranding.brandColor,
1690
1656
  colorLink: entityBranding.brandColor,
1691
1657
  colorLinkActive: entityBranding.brandColor,
1692
1658
  colorLinkHover: entityBranding.brandColor,
1693
- fontFamily: MARK_PRO,
1659
+ fontFamily: "Inter",
1694
1660
  colorBorder: INPUT_BORDER_COLOR,
1695
1661
  },
1662
+ components: {
1663
+ Drawer: {
1664
+ colorBgElevated: darkMode
1665
+ ? "var(--row-background-dark)"
1666
+ : SLATE_50,
1667
+ },
1668
+ Divider: {
1669
+ colorSplit: darkMode ? SLATE_400 : SLATE_200,
1670
+ },
1671
+ },
1696
1672
  } }, { children: jsx(SecondaryWrapper, __assign({ setBranding: setBranding }, { children: children })) })) })) }) })) })));
1697
1673
  }
1698
1674
  function SecondaryWrapper(_a) {
@@ -1702,10 +1678,10 @@ function SecondaryWrapper(_a) {
1702
1678
  queryKey: QueryKeyFactory.default.brandingKey,
1703
1679
  queryFn: function () { return getBranding({ token: token, subdomain: subdomain }); },
1704
1680
  }).data;
1705
- useQuery({
1681
+ var _c = useQuery({
1706
1682
  queryKey: QueryKeyFactory.default.currentUserKey,
1707
- queryFn: function () { return getCurrentUserData({ token: token, subdomain: subdomain }); },
1708
- });
1683
+ queryFn: function () { return getCurrentUserData({ token: token }); },
1684
+ }); _c.data; _c.isLoading;
1709
1685
  useEffect(function () {
1710
1686
  if (brandingData) {
1711
1687
  setBranding(brandingData);
@@ -1720,11 +1696,11 @@ var InvoiceQuoteView = function (_a) {
1720
1696
  var downloadFile = useDownloadFile(formattedInvoice === null || formattedInvoice === void 0 ? void 0 : formattedInvoice.id, onDownloadError);
1721
1697
  var secondaryColor = useContext(BrandContext).secondaryColor;
1722
1698
  var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
1723
- return (jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [formattedInvoice && (jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "shadow-padding-x" : ""), id: "acceptance" }, { children: [jsx("div", { children: onBackButtonClick && (jsx(Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
1699
+ return (jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [formattedInvoice ? (jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "shadow-padding-x" : ""), id: "acceptance" }, { children: [jsx("div", { children: onBackButtonClick ? (jsx(Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
1724
1700
  color: secondaryColor,
1725
- }, type: "link" }, { children: backButtonName || "Back" }))) }), jsx(Button, __assign({ icon: jsx(DownloadOutlined$1, {}), onClick: function () {
1701
+ }, type: "link" }, { children: backButtonName || "Back" }))) : null }), jsx(Button, __assign({ icon: jsx(DownloadOutlined$1, {}), onClick: function () {
1726
1702
  return downloadFile(subdomain + "/api/pdf/invoice/" + formattedInvoice.id, token);
1727
- } }, { children: "Download" }))] }))), isMobile ? (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full shadow-padding-xb overflow-auto" }, { children: [jsx(Markup, { content: html }), children] }))) : (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-2 w-full bg-white shadow-md rounded-md", style: {
1703
+ } }, { children: "Download" }))] }))) : null, isMobile ? (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full shadow-padding-xb overflow-auto" }, { children: [jsx(Markup, { content: html }), children] }))) : (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-2 w-full bg-white shadow-md rounded-md", style: {
1728
1704
  minWidth: "750px",
1729
1705
  } }, { children: [jsx(Markup, { content: html }), children] })))] })));
1730
1706
  };
@@ -1757,7 +1733,7 @@ function styleInject(css, ref) {
1757
1733
  }
1758
1734
  }
1759
1735
 
1760
- var css_248z = ".ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.ant-btn {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-size: 0.875rem;\n font-weight: normal;\n}\n.ant-btn > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-lg {\n height: 44px !important;\n}\n.ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.ant-btn-link {\n border: none !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link:disabled {\n background-color: transparent !important;\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-input,\n.ant-picker,\n.ant-select,\n.ant-input-affix-wrapper {\n font-size: 0.875rem;\n color: #232323;\n background: white;\n box-shadow: none !important;\n border: 1px solid #e2e8f0;\n}\n.ant-input:not(:focus) {\n border-color: #e2e8f0 !important;\n}\n.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-focused) .ant-input-prefix {\n color: rgba(0, 0, 0, 0.25) !important;\n}\n.ant-input-affix-wrapper .ant-input-prefix {\n transition: color 0.3s;\n}\n.ant-select-selector {\n box-shadow: none !important;\n background-color: transparent !important;\n border: none !important;\n}\n.ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.ant-form-item {\n margin-bottom: 0;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-divider {\n margin: 0;\n border-block-color: #e2e8f0 !important;\n border-inline-color: #e2e8f0 !important;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n.ant-drawer-body {\n background-color: #f8fafc !important;\n}\n.ant-drawer-header {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n.ant-drawer-title {\n font-weight: 400 !important;\n}\n.ant-drawer-header-title {\n flex-direction: row-reverse !important;\n align-items: start !important ;\n}\n.ant-drawer-close {\n margin-inline-end: 0 !important;\n}\n@media (min-width: 768px) {\n .ant-input,\n .ant-picker,\n .ant-select,\n .ant-input-affix-wrapper {\n font-size: 1rem !important;\n }\n .ant-drawer-header {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.fixed {\n position: fixed;\n}\n.top-0 {\n top: 0;\n}\n.right-0 {\n right: 0;\n}\n.bottom-0 {\n bottom: 0;\n}\n.left-0 {\n left: 0;\n}\n.overflow-hidden {\n overflow: hidden !important;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-visible {\n overflow: visible;\n}\n.z-50 {\n z-index: 50;\n}\n.-top-1\\/10 {\n top: -10%;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-xl {\n border-radius: 0.75rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-tr {\n border-top-right-radius: 0.25rem;\n}\n.rounded-br {\n border-bottom-right-radius: 0.25rem;\n}\n.rounded-bl {\n border-bottom-left-radius: 0.25rem;\n}\n.rounded-tl {\n border-top-left-radius: 0.25rem;\n}\n.rounded-t {\n border-top-right-radius: 0.25rem;\n border-top-left-radius: 0.25rem;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.flex {\n display: flex;\n}\n.flex-col {\n flex-direction: column;\n}\n.flex-wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex-grow: 1;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.basis-0 {\n flex-basis: 0;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.items-center {\n align-items: center;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-start {\n align-items: flex-start;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.underline {\n text-decoration: underline;\n}\n.no-underline {\n text-decoration: none;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-white {\n color: white;\n}\n.text-xxs {\n font-size: 0.625rem;\n}\n.text-xs {\n font-size: 0.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n}\n.text-base {\n font-size: 1rem;\n}\n.text-lg {\n font-size: 1.125rem;\n}\n.text-xl {\n font-size: 1.25rem;\n}\n.text-2xl {\n font-size: 1.5rem;\n}\n.text-3xl {\n font-size: 2rem;\n}\n.text-4xl {\n font-size: 2.5rem;\n}\n.text-5xl {\n font-size: 3rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.text-gray {\n color: #808080 !important;\n}\n.text-blue-gray {\n color: #717d94;\n}\n.text-primary {\n color: #ff6e1c;\n}\n.text-secondary {\n color: #4956dc;\n}\n.capitalize {\n text-transform: capitalize !important;\n}\n.font-normal {\n font-weight: 400;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-bold {\n font-weight: 700;\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n background-color: white;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.border-t-solid {\n border-top-style: solid;\n}\n.border-b-solid {\n border-bottom-style: solid;\n}\n.border-t-1 {\n border-top-width: 1px;\n}\n.border-b-1 {\n border-bottom-width: 1px;\n}\n.gap-0 {\n gap: 0 !important;\n}\n.gap-0\\.5 {\n gap: 0.125rem;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.gap-4 {\n gap: 1rem !important;\n}\n.gap-5 {\n gap: 1.25rem;\n}\n.gap-6 {\n gap: 1.5rem !important;\n}\n.gap-8 {\n gap: 2rem !important;\n}\n.gap-12 {\n gap: 3rem !important;\n}\n/* Padding Utilities */\n.p-0 {\n padding: 0;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-3 {\n padding: 0.75rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-5 {\n padding: 1.25rem;\n}\n.p-6 {\n padding: 1.5rem;\n}\n.p-8 {\n padding: 2rem;\n}\n/* Padding X Utilities */\n.px-0 {\n padding-right: 0;\n padding-left: 0;\n}\n.px-1 {\n padding-right: 0.25rem;\n padding-left: 0.25rem;\n}\n.px-2 {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n}\n.px-3 {\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n}\n.px-4 {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.px-5 {\n padding-right: 1.25rem;\n padding-left: 1.25rem;\n}\n.px-6 {\n padding-right: 1.5rem;\n padding-left: 1.5rem;\n}\n.px-8 {\n padding-right: 2rem;\n padding-left: 2rem;\n}\n.px-12 {\n padding-right: 3rem;\n padding-left: 3rem;\n}\n/* Padding Y Utilities */\n.py-0 {\n padding-top: 0;\n padding-bottom: 0;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n/* Padding Top Utilities */\n.pt-0 {\n padding-top: 0;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-3 {\n padding-top: 0.75rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n/* Padding Right Utilities */\n.pr-0 {\n padding-right: 0;\n}\n.pr-4 {\n padding-right: 1rem;\n}\n.pr-8 {\n padding-right: 2rem;\n}\n/* Padding Bottom Utilities */\n.pb-0 {\n padding-bottom: 0;\n}\n.pb-1 {\n padding-bottom: 0.25rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-3 {\n padding-bottom: 0.75rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-5 {\n padding-bottom: 1.25rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n/* Padding Left Utilities */\n.pl-0 {\n padding-left: 0;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pl-8 {\n padding-left: 2rem;\n}\n/* Margin Utilities */\n.ml-2 {\n margin-left: 0.5rem;\n}\n.ml-6 {\n margin-left: 1.5rem;\n}\n.ml-8 {\n margin-left: 2rem;\n}\n.mb-0 {\n margin-bottom: 0;\n}\n.mb-1 {\n margin-bottom: 0.25rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-3 {\n margin-bottom: 0.75rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-5 {\n margin-bottom: 1.25rem;\n}\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-6 {\n margin-right: 1.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-5 {\n margin-top: 1.25rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.my-1 {\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-14 {\n width: 3.5rem;\n /* 56px */\n}\n.w-20 {\n width: 5rem;\n /* 80px */\n}\n.h-full {\n height: 100%;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-6 {\n height: 1.5rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-14 {\n height: 3.5rem;\n /* 56px */\n}\n.h-80 {\n height: 20rem;\n}\n.h-96 {\n height: 24rem;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.cursor-not-allowed {\n cursor: not-allowed;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.grid-cols-4 {\n grid-template-columns: repeat(4, minMax(0, 1fr));\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.col-span-4 {\n grid-column: span 4 / span 4;\n}\n.col-span-full {\n grid-column: 1 / -1;\n}\n/* Background colors */\n.bg-black {\n background-color: #000000;\n}\n.bg-slate-50 {\n background-color: #f8fafc;\n}\n.bg-slate-100 {\n background-color: #f1f5f9;\n}\n.bg-slate-200 {\n background-color: #e2e8f0;\n}\n.bg-slate-300 {\n background-color: #cbd5e1;\n}\n.bg-slate-400 {\n background-color: #94a3b8;\n}\n.bg-slate-500 {\n background-color: #64748b;\n}\n.bg-slate-600 {\n background-color: #475569;\n}\n.bg-slate-700 {\n background-color: #334155;\n}\n.bg-slate-800 {\n background-color: #1e293b;\n}\n.bg-slate-900 {\n background-color: #0f172a;\n}\n.bg-slate-950 {\n background-color: #020617;\n}\n.bg-gray-50 {\n background-color: #f9fafb;\n}\n.bg-gray-100 {\n background-color: #f3f4f6;\n}\n.bg-gray-200 {\n background-color: #e5e7eb;\n}\n.bg-gray-300 {\n background-color: #d1d5db;\n}\n.bg-gray-400 {\n background-color: #9ca3af;\n}\n.bg-gray-500 {\n background-color: #6b7280;\n}\n.bg-gray-600 {\n background-color: #4b5563;\n}\n.bg-gray-700 {\n background-color: #374151;\n}\n.bg-gray-800 {\n background-color: #1f2937;\n}\n.bg-gray-900 {\n background-color: #111827;\n}\n.bg-gray-950 {\n background-color: #030712;\n}\n.bg-green-200 {\n background-color: #a7f3d0;\n}\n.bg-blue-50 {\n background-color: #eff6ff;\n}\n.bg-blue-100 {\n background-color: #dbeafe;\n}\n.bg-blue-200 {\n background-color: #bfdbfe;\n}\n.bg-blue-300 {\n background-color: #93c5fd;\n}\n.bg-blue-400 {\n background-color: #60a5fa;\n}\n.bg-blue-500 {\n background-color: #3b82f6;\n}\n.bg-blue-600 {\n background-color: #2563eb;\n}\n.bg-blue-700 {\n background-color: #1d4ed8;\n}\n.bg-blue-800 {\n background-color: #1e40af;\n}\n.bg-blue-900 {\n background-color: #1e3a8a;\n}\n.bg-blue-950 {\n background-color: #172554;\n}\n.bg-orange-50 {\n background-color: #fff7ed;\n}\n.bg-orange-100 {\n background-color: #ffedd5;\n}\n.bg-orange-200 {\n background-color: #fed7aa;\n}\n.bg-orange-300 {\n background-color: #fdba74;\n}\n.bg-orange-400 {\n background-color: #fb923c;\n}\n.bg-orange-500 {\n background-color: #f97316;\n}\n.bg-orange-600 {\n background-color: #ea580c;\n}\n.bg-orange-700 {\n background-color: #c2410c;\n}\n.bg-orange-800 {\n background-color: #9a3412;\n}\n.bg-orange-900 {\n background-color: #7c2d12;\n}\n.bg-orange-950 {\n background-color: #431407;\n}\n.bg-yellow-200 {\n background-color: #fde68a;\n}\n.bg-red-200 {\n background-color: #fecaca;\n}\n/* Text colors */\n.text-black {\n color: #000000;\n}\n.text-white {\n color: #ffffff;\n}\n.text-slate-50 {\n color: #f8fafc;\n}\n.text-slate-100 {\n color: #f1f5f9;\n}\n.text-slate-200 {\n color: #e2e8f0;\n}\n.text-slate-300 {\n color: #cbd5e1;\n}\n.text-slate-400 {\n color: #94a3b8;\n}\n.text-slate-500 {\n color: #64748b;\n}\n.text-slate-600 {\n color: #475569;\n}\n.text-slate-700 {\n color: #334155;\n}\n.text-slate-800 {\n color: #1e293b;\n}\n.text-slate-900 {\n color: #0f172a;\n}\n.text-slate-950 {\n color: #020617;\n}\n.text-gray-50 {\n color: #f9fafb;\n}\n.text-gray-100 {\n color: #f3f4f6;\n}\n.text-gray-200 {\n color: #e5e7eb;\n}\n.text-gray-300 {\n color: #d1d5db;\n}\n.text-gray-400 {\n color: #9ca3af;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.text-gray-600 {\n color: #4b5563;\n}\n.text-gray-700 {\n color: #374151;\n}\n.text-gray-800 {\n color: #1f2937;\n}\n.text-gray-900 {\n color: #111827;\n}\n.text-gray-950 {\n color: #030712;\n}\n.text-green-600 {\n color: #059669;\n}\n.text-green-700 {\n color: #047857;\n}\n.text-blue-50 {\n color: #eff6ff;\n}\n.text-blue-100 {\n color: #dbeafe;\n}\n.text-blue-200 {\n color: #bfdbfe;\n}\n.text-blue-300 {\n color: #93c5fd;\n}\n.text-blue-400 {\n color: #60a5fa;\n}\n.text-blue-500 {\n color: #3b82f6;\n}\n.text-blue-600 {\n color: #2563eb;\n}\n.text-blue-700 {\n color: #1d4ed8;\n}\n.text-blue-800 {\n color: #1e40af;\n}\n.text-blue-900 {\n color: #1e3a8a;\n}\n.text-blue-950 {\n color: #172554;\n}\n.text-orange-50 {\n color: #fff7ed;\n}\n.text-orange-100 {\n color: #ffedd5;\n}\n.text-orange-200 {\n color: #fed7aa;\n}\n.text-orange-300 {\n color: #fdba74;\n}\n.text-orange-400 {\n color: #fb923c;\n}\n.text-orange-500 {\n color: #f97316;\n}\n.text-orange-600 {\n color: #ea580c;\n}\n.text-orange-700 {\n color: #c2410c;\n}\n.text-orange-800 {\n color: #9a3412;\n}\n.text-orange-900 {\n color: #7c2d12;\n}\n.text-orange-950 {\n color: #431407;\n}\n.text-yellow-500 {\n color: #f59e0b;\n}\n.text-yellow-700 {\n color: #b45309;\n}\n.text-red-500 {\n color: #ef4444;\n}\n.text-red-700 {\n color: #b91c1c;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-l {\n border-left-width: 1px;\n}\n.border-dashed {\n border-style: dashed;\n}\n.border-solid {\n border-style: solid;\n}\n.border-slate-50 {\n border-color: #f8fafc;\n}\n.border-slate-100 {\n border-color: #f1f5f9;\n}\n.border-slate-200 {\n border-color: #e2e8f0;\n}\n.border-slate-300 {\n border-color: #cbd5e1;\n}\n.border-slate-400 {\n border-color: #94a3b8;\n}\n.border-slate-500 {\n border-color: #64748b;\n}\n.border-slate-600 {\n border-color: #475569;\n}\n.border-slate-700 {\n border-color: #334155;\n}\n.border-slate-800 {\n border-color: #1e293b;\n}\n.border-slate-900 {\n border-color: #0f172a;\n}\n.border-slate-950 {\n border-color: #020617;\n}\n.origin-center {\n transform-origin: center;\n}\n.rotate-45 {\n transform: rotate(45deg);\n}\n.translate-x-2\\/4 {\n transform: translateX(50%);\n}\n.-translate-x-2\\/4 {\n transform: translateX(-50%);\n}\n.translate-y-2\\/4 {\n transform: translateY(50%);\n}\n.translate-y-full {\n transform: translateY(100%);\n}\n.-translate-y-full {\n transform: translateY(-100%);\n}\n.shadow-sm {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow {\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n}\n.shadow-md {\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n}\n.shadow-lg {\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.shadow-xl {\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n}\n.shadow-2xl {\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n}\n.shadow-inner {\n box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow-none {\n box-shadow: 0 0 #0000;\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
1736
+ var css_248z = "@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format('truetype');\n}\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format('truetype');\n}\n.ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.ant-btn {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-size: 0.875rem;\n font-weight: normal;\n}\n.ant-btn > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-lg {\n height: 44px !important;\n}\n.ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.ant-btn-link {\n border: none !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link:disabled {\n background-color: transparent !important;\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-input-affix-wrapper .ant-input-prefix {\n transition: color 0.3s;\n}\n.ant-select-selector {\n box-shadow: none !important;\n background-color: transparent !important;\n border: none !important;\n}\n.ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.ant-form-item {\n margin-bottom: 0;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-divider {\n margin: 0;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n.ant-drawer-title {\n font-weight: 400 !important;\n}\n.ant-drawer-header-title {\n flex-direction: row-reverse !important;\n align-items: start !important ;\n}\n.ant-drawer-close {\n margin-inline-end: 0 !important;\n}\n@media (min-width: 768px) {\n .ant-input,\n .ant-picker,\n .ant-select,\n .ant-input-affix-wrapper {\n font-size: 1rem !important;\n }\n .ant-drawer-header {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n}\n:root {\n --row-background: #ffffff;\n --row-background-alternate: rgba(100, 116, 139, 0.04);\n --row-background-dark: #121212;\n --row-background-alternate-dark: #1e1e1e;\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.fixed {\n position: fixed;\n}\n.top-0 {\n top: 0;\n}\n.right-0 {\n right: 0;\n}\n.bottom-0 {\n bottom: 0;\n}\n.left-0 {\n left: 0;\n}\n.overflow-hidden {\n overflow: hidden !important;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-visible {\n overflow: visible;\n}\n.z-50 {\n z-index: 50;\n}\n.-top-1\\/10 {\n top: -10%;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-xl {\n border-radius: 0.75rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-tr {\n border-top-right-radius: 0.25rem;\n}\n.rounded-br {\n border-bottom-right-radius: 0.25rem;\n}\n.rounded-bl {\n border-bottom-left-radius: 0.25rem;\n}\n.rounded-tl {\n border-top-left-radius: 0.25rem;\n}\n.rounded-t {\n border-top-right-radius: 0.25rem;\n border-top-left-radius: 0.25rem;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.flex {\n display: flex;\n}\n.flex-col {\n flex-direction: column;\n}\n.flex-wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex-grow: 1;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.basis-0 {\n flex-basis: 0;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.items-center {\n align-items: center;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-start {\n align-items: flex-start;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.underline {\n text-decoration: underline;\n}\n.no-underline {\n text-decoration: none;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-white {\n color: white;\n}\n.text-xxs {\n font-size: 0.625rem;\n}\n.text-xs {\n font-size: 0.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n}\n.text-base {\n font-size: 1rem;\n}\n.text-lg {\n font-size: 1.125rem;\n}\n.text-xl {\n font-size: 1.25rem;\n}\n.text-2xl {\n font-size: 1.5rem;\n}\n.text-3xl {\n font-size: 2rem;\n}\n.text-4xl {\n font-size: 2.5rem;\n}\n.text-5xl {\n font-size: 3rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.text-gray {\n color: #808080 !important;\n}\n.text-gray-400 {\n color: #9ca3af !important;\n}\n.text-gray-500 {\n color: #6b7280 !important;\n}\n.text-blue-gray {\n color: #717d94;\n}\n.text-primary {\n color: #ff6e1c;\n}\n.text-secondary {\n color: #4956dc;\n}\n.capitalize {\n text-transform: capitalize !important;\n}\n.font-normal {\n font-weight: 400;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-bold {\n font-weight: 700;\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n background-color: white;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.border-t-solid {\n border-top-style: solid;\n}\n.border-b-solid {\n border-bottom-style: solid;\n}\n.border-t-1 {\n border-top-width: 1px;\n}\n.border-b-1 {\n border-bottom-width: 1px;\n}\n.gap-0 {\n gap: 0 !important;\n}\n.gap-0\\.5 {\n gap: 0.125rem;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.gap-4 {\n gap: 1rem !important;\n}\n.gap-5 {\n gap: 1.25rem;\n}\n.gap-6 {\n gap: 1.5rem !important;\n}\n.gap-8 {\n gap: 2rem !important;\n}\n.gap-12 {\n gap: 3rem !important;\n}\n/* Padding Utilities */\n.p-0 {\n padding: 0;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-3 {\n padding: 0.75rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-5 {\n padding: 1.25rem;\n}\n.p-6 {\n padding: 1.5rem;\n}\n.p-8 {\n padding: 2rem;\n}\n/* Padding X Utilities */\n.px-0 {\n padding-right: 0;\n padding-left: 0;\n}\n.px-1 {\n padding-right: 0.25rem;\n padding-left: 0.25rem;\n}\n.px-2 {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n}\n.px-3 {\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n}\n.px-4 {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.px-5 {\n padding-right: 1.25rem;\n padding-left: 1.25rem;\n}\n.px-6 {\n padding-right: 1.5rem;\n padding-left: 1.5rem;\n}\n.px-8 {\n padding-right: 2rem;\n padding-left: 2rem;\n}\n.px-12 {\n padding-right: 3rem;\n padding-left: 3rem;\n}\n/* Padding Y Utilities */\n.py-0 {\n padding-top: 0;\n padding-bottom: 0;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n/* Padding Top Utilities */\n.pt-0 {\n padding-top: 0;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-3 {\n padding-top: 0.75rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n/* Padding Right Utilities */\n.pr-0 {\n padding-right: 0;\n}\n.pr-4 {\n padding-right: 1rem;\n}\n.pr-8 {\n padding-right: 2rem;\n}\n/* Padding Bottom Utilities */\n.pb-0 {\n padding-bottom: 0;\n}\n.pb-1 {\n padding-bottom: 0.25rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-3 {\n padding-bottom: 0.75rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-5 {\n padding-bottom: 1.25rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n/* Padding Left Utilities */\n.pl-0 {\n padding-left: 0;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pl-8 {\n padding-left: 2rem;\n}\n/* Space Utilities */\n.space-y-2 {\n gap: 0.5rem;\n}\n.space-y-4 {\n gap: 1rem;\n}\n.space-y-8 {\n gap: 2rem;\n}\n/* Margin Utilities */\n.ml-2 {\n margin-left: 0.5rem;\n}\n.ml-6 {\n margin-left: 1.5rem;\n}\n.ml-8 {\n margin-left: 2rem;\n}\n.mb-0 {\n margin-bottom: 0;\n}\n.mb-1 {\n margin-bottom: 0.25rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-3 {\n margin-bottom: 0.75rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-5 {\n margin-bottom: 1.25rem;\n}\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-6 {\n margin-right: 1.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-0 {\n margin-top: 0;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-5 {\n margin-top: 1.25rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.my-1 {\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.my-8 {\n margin-top: 2rem;\n margin-bottom: 2rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.mx-8 {\n margin-left: 2rem;\n margin-right: 2rem;\n}\n.w-full {\n width: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-14 {\n width: 3.5rem;\n /* 56px */\n}\n.w-20 {\n width: 5rem;\n /* 80px */\n}\n.h-full {\n height: 100%;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-6 {\n height: 1.5rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-14 {\n height: 3.5rem;\n /* 56px */\n}\n.h-80 {\n height: 20rem;\n}\n.h-96 {\n height: 24rem;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.cursor-not-allowed {\n cursor: not-allowed;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.grid-cols-4 {\n grid-template-columns: repeat(4, minMax(0, 1fr));\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.col-span-4 {\n grid-column: span 4 / span 4;\n}\n.col-span-full {\n grid-column: 1 / -1;\n}\n/* Background colors */\n.bg-black {\n background-color: #000000;\n}\n.bg-slate-50 {\n background-color: #f8fafc;\n}\n.bg-slate-100 {\n background-color: #f1f5f9;\n}\n.bg-slate-200 {\n background-color: #e2e8f0;\n}\n.bg-slate-300 {\n background-color: #cbd5e1;\n}\n.bg-slate-400 {\n background-color: #94a3b8;\n}\n.bg-slate-500 {\n background-color: #64748b;\n}\n.bg-slate-600 {\n background-color: #475569;\n}\n.bg-slate-700 {\n background-color: #334155;\n}\n.bg-slate-800 {\n background-color: #1e293b;\n}\n.bg-slate-900 {\n background-color: #0f172a;\n}\n.bg-slate-950 {\n background-color: #020617;\n}\n.bg-gray-50 {\n background-color: #f9fafb;\n}\n.bg-gray-100 {\n background-color: #f3f4f6;\n}\n.bg-gray-200 {\n background-color: #e5e7eb;\n}\n.bg-gray-300 {\n background-color: #d1d5db;\n}\n.bg-gray-400 {\n background-color: #9ca3af;\n}\n.bg-gray-500 {\n background-color: #6b7280;\n}\n.bg-gray-600 {\n background-color: #4b5563;\n}\n.bg-gray-700 {\n background-color: #374151;\n}\n.bg-gray-800 {\n background-color: #1f2937;\n}\n.bg-gray-900 {\n background-color: #111827;\n}\n.bg-gray-950 {\n background-color: #030712;\n}\n.bg-green-200 {\n background-color: #a7f3d0;\n}\n.bg-green-500 {\n background-color: #10b981;\n}\n.bg-blue-50 {\n background-color: #eff6ff;\n}\n.bg-blue-100 {\n background-color: #dbeafe;\n}\n.bg-blue-200 {\n background-color: #bfdbfe;\n}\n.bg-blue-300 {\n background-color: #93c5fd;\n}\n.bg-blue-400 {\n background-color: #60a5fa;\n}\n.bg-blue-500 {\n background-color: #3b82f6;\n}\n.bg-blue-600 {\n background-color: #2563eb;\n}\n.bg-blue-700 {\n background-color: #1d4ed8;\n}\n.bg-blue-800 {\n background-color: #1e40af;\n}\n.bg-blue-900 {\n background-color: #1e3a8a;\n}\n.bg-blue-950 {\n background-color: #172554;\n}\n.bg-orange-50 {\n background-color: #fff7ed;\n}\n.bg-orange-100 {\n background-color: #ffedd5;\n}\n.bg-orange-200 {\n background-color: #fed7aa;\n}\n.bg-orange-300 {\n background-color: #fdba74;\n}\n.bg-orange-400 {\n background-color: #fb923c;\n}\n.bg-orange-500 {\n background-color: #f97316;\n}\n.bg-orange-600 {\n background-color: #ea580c;\n}\n.bg-orange-700 {\n background-color: #c2410c;\n}\n.bg-orange-800 {\n background-color: #9a3412;\n}\n.bg-orange-900 {\n background-color: #7c2d12;\n}\n.bg-orange-950 {\n background-color: #431407;\n}\n.bg-yellow-200 {\n background-color: #fde68a;\n}\n.bg-red-200 {\n background-color: #fecaca;\n}\n/* Text colors */\n.text-black {\n color: #000000;\n}\n.text-white {\n color: #ffffff;\n}\n.text-slate-50 {\n color: #f8fafc;\n}\n.text-slate-100 {\n color: #f1f5f9;\n}\n.text-slate-200 {\n color: #e2e8f0;\n}\n.text-slate-300 {\n color: #cbd5e1;\n}\n.text-slate-400 {\n color: #94a3b8;\n}\n.text-slate-500 {\n color: #64748b;\n}\n.text-slate-600 {\n color: #475569;\n}\n.text-slate-700 {\n color: #334155;\n}\n.text-slate-800 {\n color: #1e293b;\n}\n.text-slate-900 {\n color: #0f172a;\n}\n.text-slate-950 {\n color: #020617;\n}\n.text-gray-50 {\n color: #f9fafb;\n}\n.text-gray-100 {\n color: #f3f4f6;\n}\n.text-gray-200 {\n color: #e5e7eb;\n}\n.text-gray-300 {\n color: #d1d5db;\n}\n.text-gray-400 {\n color: #9ca3af;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.text-gray-600 {\n color: #4b5563;\n}\n.text-gray-700 {\n color: #374151;\n}\n.text-gray-800 {\n color: #1f2937;\n}\n.text-gray-900 {\n color: #111827;\n}\n.text-gray-950 {\n color: #030712;\n}\n.text-green-600 {\n color: #059669;\n}\n.text-green-700 {\n color: #047857;\n}\n.text-blue-50 {\n color: #eff6ff;\n}\n.text-blue-100 {\n color: #dbeafe;\n}\n.text-blue-200 {\n color: #bfdbfe;\n}\n.text-blue-300 {\n color: #93c5fd;\n}\n.text-blue-400 {\n color: #60a5fa;\n}\n.text-blue-500 {\n color: #3b82f6;\n}\n.text-blue-600 {\n color: #2563eb;\n}\n.text-blue-700 {\n color: #1d4ed8;\n}\n.text-blue-800 {\n color: #1e40af;\n}\n.text-blue-900 {\n color: #1e3a8a;\n}\n.text-blue-950 {\n color: #172554;\n}\n.text-orange-50 {\n color: #fff7ed;\n}\n.text-orange-100 {\n color: #ffedd5;\n}\n.text-orange-200 {\n color: #fed7aa;\n}\n.text-orange-300 {\n color: #fdba74;\n}\n.text-orange-400 {\n color: #fb923c;\n}\n.text-orange-500 {\n color: #f97316;\n}\n.text-orange-600 {\n color: #ea580c;\n}\n.text-orange-700 {\n color: #c2410c;\n}\n.text-orange-800 {\n color: #9a3412;\n}\n.text-orange-900 {\n color: #7c2d12;\n}\n.text-orange-950 {\n color: #431407;\n}\n.text-yellow-500 {\n color: #f59e0b;\n}\n.text-yellow-700 {\n color: #b45309;\n}\n.text-red-500 {\n color: #ef4444;\n}\n.text-red-700 {\n color: #b91c1c;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-l {\n border-left-width: 1px;\n}\n.border-dashed {\n border-style: dashed;\n}\n.border-solid {\n border-style: solid;\n}\n.border-slate-50 {\n border-color: #f8fafc;\n}\n.border-slate-100 {\n border-color: #f1f5f9;\n}\n.border-slate-200 {\n border-color: #e2e8f0;\n}\n.border-slate-300 {\n border-color: #cbd5e1;\n}\n.border-slate-400 {\n border-color: #94a3b8;\n}\n.border-slate-500 {\n border-color: #64748b;\n}\n.border-slate-600 {\n border-color: #475569;\n}\n.border-slate-700 {\n border-color: #334155;\n}\n.border-slate-800 {\n border-color: #1e293b;\n}\n.border-slate-900 {\n border-color: #0f172a;\n}\n.border-slate-950 {\n border-color: #020617;\n}\n.border-gray-400 {\n border-color: #9ca3af;\n}\n.border-gray-500 {\n border-color: #6b7280;\n}\n.origin-center {\n transform-origin: center;\n}\n.rotate-45 {\n transform: rotate(45deg);\n}\n.translate-x-2\\/4 {\n transform: translateX(50%);\n}\n.-translate-x-2\\/4 {\n transform: translateX(-50%);\n}\n.translate-y-2\\/4 {\n transform: translateY(50%);\n}\n.translate-y-full {\n transform: translateY(100%);\n}\n.-translate-y-full {\n transform: translateY(-100%);\n}\n.shadow-sm {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow {\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n}\n.shadow-md {\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n}\n.shadow-lg {\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.shadow-xl {\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n}\n.shadow-2xl {\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n}\n.shadow-inner {\n box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow-none {\n box-shadow: 0 0 #0000;\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
1761
1737
  styleInject(css_248z);
1762
1738
 
1763
1739
  var paymentMethodsQuery = "query paymentMethods ($filter: String, $first: Int, $sort: String) {\n paymentMethods (filter: $filter, first: $first, sort: $sort) {\n nodes {\n id\n disabled\n pluginId\n accountId\n expirationDate\n plugin {\n guid\n id\n }\n state\n metadata {\n issuer\n identifier\n kind\n description\n icon\n }\n }\n }\n}";
@@ -1785,12 +1761,16 @@ var CardIcon = function () {
1785
1761
  return (jsxs("svg", __assign({ width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsx("path", { d: "M15 3.75H3C2.17157 3.75 1.5 4.42157 1.5 5.25V12.75C1.5 13.5784 2.17157 14.25 3 14.25H15C15.8284 14.25 16.5 13.5784 16.5 12.75V5.25C16.5 4.42157 15.8284 3.75 15 3.75Z", stroke: SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M1.5 7.5H16.5", stroke: SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
1786
1762
  };
1787
1763
 
1764
+ var Text$d = Typography.Text;
1788
1765
  var PaymentOption = function (_a) {
1789
1766
  var selected = _a.selected, paymentOption = _a.paymentOption, onClick = _a.onClick, name = _a.name;
1790
1767
  var brandColor = useContext(BrandContext).brandColor;
1768
+ var darkMode = useContext(BunnyContext).darkMode;
1791
1769
  var isAch = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("ach");
1792
1770
  var isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("card");
1793
- return (jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "flex justify-between items-center w-full cursor-pointer py-2 px-4 rounded border-solid border-slate-200 bg-slate-50 border", onClick: function () { return onClick(paymentOption); } }, { children: [jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsx(Checkbox, { checked: selected }), jsx("div", __assign({ className: "text-gray-900" }, { children: name }))] })), isAch ? (jsx(BankOutlined$1, { className: "text-slate-400" })) : isCard ? (jsx(CardIcon, {})) : (jsx(CardIcon, {}))] })));
1771
+ return (jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "flex justify-between items-center w-full cursor-pointer py-2 px-4 rounded border-solid ".concat(darkMode
1772
+ ? "var(--row-background-dark) border-gray-500"
1773
+ : "bg-slate-50 border-slate-200", " border"), onClick: function () { return onClick(paymentOption); } }, { children: [jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsx(Checkbox, { checked: selected, className: darkMode ? "border-gray-400" : "" }), jsx(Text$d, { children: name })] })), isAch ? (jsx(BankOutlined$1, { className: "text-slate-400" })) : isCard ? (jsx(CardIcon, {})) : (jsx(CardIcon, {}))] })));
1794
1774
  };
1795
1775
  var PaymentOptionContainer = styled.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"], ["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"])), function (_a) {
1796
1776
  var $brandColor = _a.$brandColor, $selected = _a.$selected;
@@ -1907,16 +1887,28 @@ var useStripePlugin = function (plugin, token, subdomain, accountId) {
1907
1887
  return stripe;
1908
1888
  };
1909
1889
 
1890
+ var PaymentContext = createContext({});
1891
+
1910
1892
  var CheckoutFooter = function (_a) {
1911
1893
  var amountDue = _a.amountDue, currencyId = _a.currencyId, isSaving = _a.isSaving, onPaymentSubmit = _a.onPaymentSubmit, onlySavePaymentMethod = _a.onlySavePaymentMethod, noPadding = _a.noPadding;
1912
1894
  var isMobile = useIsMobile$1();
1913
- return (jsx("div", __assign({ className: "flex justify-end gap-2 ".concat(noPadding ? "" : "pt-6") }, { children: jsx(Button, __assign({ className: "w-full", disabled: isSaving, onClick: onPaymentSubmit, size: isMobile ? "large" : "middle", type: "primary" }, { children: "".concat(onlySavePaymentMethod
1914
- ? isSaving
1915
- ? "Saving"
1916
- : "Save"
1917
- : isSaving
1918
- ? "Paying"
1919
- : "Pay").concat(amountDue && currencyId
1895
+ var invoice = useContext(InvoiceCheckoutContext).invoice;
1896
+ var displayPayButtonNameAnyways = useContext(PaymentContext).displayPayButtonNameAnyways;
1897
+ var buttonName = function () {
1898
+ return onlySavePaymentMethod && !displayPayButtonNameAnyways
1899
+ ? isSaving
1900
+ ? "Saving"
1901
+ : "Save"
1902
+ : isSaving
1903
+ ? "Paying"
1904
+ : "Pay";
1905
+ };
1906
+ useEffect(function () {
1907
+ if (invoice) {
1908
+ onPaymentSubmit();
1909
+ }
1910
+ }, [invoice]);
1911
+ return (jsx("div", __assign({ className: "flex justify-end gap-2 ".concat(noPadding ? "" : "pt-6") }, { children: jsx(Button, __assign({ className: "w-full", disabled: isSaving, onClick: onPaymentSubmit, size: isMobile ? "large" : "middle", type: "primary" }, { children: "".concat(buttonName()).concat(amountDue && currencyId
1920
1912
  ? " ".concat(Misc.formatCurrency(amountDue, currencyId))
1921
1913
  : "") })) })));
1922
1914
  };
@@ -2008,10 +2000,11 @@ var PaymentMethodForm$1 = function (_a) {
2008
2000
  // Hooks
2009
2001
  var elements = useElements();
2010
2002
  var stripe = useStripe();
2011
- var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2003
+ var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
2004
+ var accountId = useContext(PaymentContext).accountId;
2012
2005
  // Handlers
2013
2006
  var onSubmit = function () { return __awaiter(void 0, void 0, void 0, function () {
2014
- var submitError, response, clientSecret, intentResponse, paymentMethodId, error_1;
2007
+ var submitError, response, clientSecret, intentResponse, paymentMethodId, paymentMethodResponse, error_1;
2015
2008
  var _a, _b;
2016
2009
  return __generator(this, function (_c) {
2017
2010
  switch (_c.label) {
@@ -2059,8 +2052,17 @@ var PaymentMethodForm$1 = function (_a) {
2059
2052
  accountId: accountId,
2060
2053
  })];
2061
2054
  case 4:
2062
- _c.sent();
2063
- onPaymentSuccess({});
2055
+ paymentMethodResponse = _c.sent();
2056
+ onPaymentSuccess({
2057
+ pluginPaymentResponse: {
2058
+ savePaymentMethod: true,
2059
+ plugin: plugin,
2060
+ token: paymentMethodResponse.token,
2061
+ },
2062
+ savedPaymentMethodResponse: {
2063
+ paymentMethodId: paymentMethodResponse.payload[0].id,
2064
+ },
2065
+ });
2064
2066
  return [3 /*break*/, 6];
2065
2067
  case 5:
2066
2068
  error_1 = _c.sent();
@@ -2076,7 +2078,8 @@ var PaymentMethodForm$1 = function (_a) {
2076
2078
  // This is just a wrapper to fetch the stripe object and pass it to the form
2077
2079
  var StripeForm = function (_a) {
2078
2080
  var payable = _a.payable, plugin = _a.plugin, isSaving = _a.isSaving, setIsSaving = _a.setIsSaving, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess;
2079
- var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2081
+ var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
2082
+ var accountId = useContext(PaymentContext).accountId;
2080
2083
  var stripe = useStripePlugin(plugin, token, subdomain, accountId);
2081
2084
  var onlySavePaymentMethod = !payable;
2082
2085
  if (!stripe)
@@ -2104,6 +2107,10 @@ var StripeForm = function (_a) {
2104
2107
  }
2105
2108
  };
2106
2109
 
2110
+ var getQuoteAmountDue = function (quote) {
2111
+ return quote.amountDue;
2112
+ };
2113
+
2107
2114
  // Simulated payment creation and confirmation
2108
2115
  var confirmPayment = function (_a) {
2109
2116
  var amount = _a.amount, currency = _a.currency, cardDetails = _a.cardDetails;
@@ -2170,34 +2177,34 @@ var storePayment = function (options, plugin, accountId, subdomain) { return __a
2170
2177
  });
2171
2178
  }); };
2172
2179
 
2173
- var CARD_NUMBER_MAX_LENGTH = 19; // Why 19 instead of 16? Because we add spaces
2174
- var formatCardNumber = function (cardNumber) {
2175
- return cardNumber.replace(/(\d{4})(?=\d)/g, "$1 ");
2176
- };
2177
- var DemoPayCardNumber = function (_a) {
2180
+ var DemoPayCardCvc = function (_a) {
2178
2181
  var autoFocus = _a.autoFocus, onChange = _a.onChange, placeholder = _a.placeholder, value = _a.value;
2179
2182
  var onKeyPress = function (event) {
2180
2183
  if (!isDigit(event.key) && !isValidKey(event.keyCode))
2181
2184
  event.preventDefault();
2182
2185
  };
2183
2186
  var onNumberChange = function (event) {
2184
- var number = event.target.value.replace(/\s/g, "");
2185
- onChange(number);
2187
+ var cvc = event.target.value.replace(/\D/g, "");
2188
+ onChange(cvc);
2186
2189
  };
2187
- return (jsx("div", __assign({ className: "grow" }, { children: jsx(Input, { autoFocus: autoFocus, maxLength: CARD_NUMBER_MAX_LENGTH, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, placeholder: placeholder || "Card Number", value: formatCardNumber(value) }) })));
2190
+ return (jsx("div", __assign({ className: "grow" }, { children: jsx(Input, { autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: value, maxLength: 3, placeholder: placeholder || "CVC" }) })));
2188
2191
  };
2189
2192
 
2190
- var DemoPayCardCvc = function (_a) {
2193
+ var CARD_NUMBER_MAX_LENGTH = 19; // Why 19 instead of 16? Because we add spaces
2194
+ var formatCardNumber = function (cardNumber) {
2195
+ return cardNumber.replace(/(\d{4})(?=\d)/g, "$1 ");
2196
+ };
2197
+ var DemoPayCardNumber = function (_a) {
2191
2198
  var autoFocus = _a.autoFocus, onChange = _a.onChange, placeholder = _a.placeholder, value = _a.value;
2192
2199
  var onKeyPress = function (event) {
2193
2200
  if (!isDigit(event.key) && !isValidKey(event.keyCode))
2194
2201
  event.preventDefault();
2195
2202
  };
2196
2203
  var onNumberChange = function (event) {
2197
- var cvc = event.target.value.replace(/\D/g, "");
2198
- onChange(cvc);
2204
+ var number = event.target.value.replace(/\s/g, "");
2205
+ onChange(number);
2199
2206
  };
2200
- return (jsx("div", __assign({ className: "grow" }, { children: jsx(Input, { autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: value, maxLength: 3, placeholder: placeholder || "CVC" }) })));
2207
+ return (jsx("div", __assign({ className: "grow" }, { children: jsx(Input, { autoFocus: autoFocus, maxLength: CARD_NUMBER_MAX_LENGTH, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, placeholder: placeholder || "Card Number", value: formatCardNumber(value) }) })));
2201
2208
  };
2202
2209
 
2203
2210
  var DemoPayExpiry = function (_a) {
@@ -2213,15 +2220,13 @@ var DemoPayExpiry = function (_a) {
2213
2220
  return (jsx("div", __assign({ className: "grow" }, { children: jsx(Input, { autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: formatCardExpiry(value), maxLength: 5, placeholder: placeholder || "MM/YY" }) })));
2214
2221
  };
2215
2222
 
2216
- var getQuoteAmountDue = function (quote) {
2217
- return quote.amountDue;
2218
- };
2219
-
2223
+ var Text$c = Typography.Text;
2220
2224
  var TEST_CARD = "4242424242424242";
2221
2225
  var DemoPayForm = function (_a) {
2222
2226
  var isSaving = _a.isSaving, invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, plugin = _a.plugin, quote = _a.quote, setIsSaving = _a.setIsSaving;
2223
2227
  // Context
2224
- var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2228
+ var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, darkMode = _b.darkMode;
2229
+ var accountId = useContext(PaymentContext).accountId;
2225
2230
  // Local state
2226
2231
  var _c = useState(false), savePaymentMethod = _c[0], setSavePaymentMethod = _c[1];
2227
2232
  var _d = useState({
@@ -2233,12 +2238,14 @@ var DemoPayForm = function (_a) {
2233
2238
  var currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency);
2234
2239
  var onlySavePaymentMethod = !quote && !invoice;
2235
2240
  var onPaymentSubmit = function () { return __awaiter(void 0, void 0, void 0, function () {
2236
- var response, response, error_1;
2241
+ var response, paymentMethodId, response, error_1;
2237
2242
  return __generator(this, function (_a) {
2238
2243
  switch (_a.label) {
2239
2244
  case 0:
2240
2245
  _a.trys.push([0, 6, , 7]);
2246
+ validateCardDetails();
2241
2247
  if (!onlySavePaymentMethod) return [3 /*break*/, 2];
2248
+ setIsSaving(true);
2242
2249
  return [4 /*yield*/, storePayment({
2243
2250
  testCreditCardNumber: unformatCardNumber(cardDetails.number),
2244
2251
  testCreditCardCvc: cardDetails.cvc.toString(),
@@ -2247,21 +2254,23 @@ var DemoPayForm = function (_a) {
2247
2254
  }, plugin, accountId, subdomain)];
2248
2255
  case 1:
2249
2256
  response = _a.sent();
2257
+ paymentMethodId = response.payload[0].id;
2250
2258
  if (response.status !== "success")
2251
2259
  throw new Error(response === null || response === void 0 ? void 0 : response.message);
2252
- onPaymentSuccess({});
2253
- return [3 /*break*/, 5];
2254
- case 2:
2255
- if (!(amountDue !== undefined && currencyId)) return [3 /*break*/, 4];
2260
+ onPaymentSuccess({
2261
+ pluginPaymentResponse: {
2262
+ plugin: plugin,
2263
+ token: response.token,
2264
+ savePaymentMethod: savePaymentMethod,
2265
+ },
2266
+ savedPaymentMethodResponse: {
2267
+ paymentMethodId: paymentMethodId,
2268
+ },
2269
+ });
2270
+ return [3 /*break*/, 5];
2271
+ case 2:
2272
+ if (!(amountDue !== undefined && currencyId)) return [3 /*break*/, 4];
2256
2273
  setIsSaving(true);
2257
- if (cardDetails.number !== TEST_CARD)
2258
- throw new Error("Only the card number 4242 4242 4242 4242 will be accepted.");
2259
- if (!isValidExpiry(cardDetails.expiry))
2260
- throw new Error("Invalid expiry date");
2261
- if (isCardExpired(cardDetails.expiry))
2262
- throw new Error("Card is expired");
2263
- if (cardDetails.cvc.length !== 3)
2264
- throw new Error("Invalid CVC");
2265
2274
  return [4 /*yield*/, confirmPayment({
2266
2275
  amount: amountDue,
2267
2276
  currency: currencyId,
@@ -2276,6 +2285,7 @@ var DemoPayForm = function (_a) {
2276
2285
  savePaymentMethod: savePaymentMethod,
2277
2286
  },
2278
2287
  });
2288
+ setIsSaving(false);
2279
2289
  return [3 /*break*/, 5];
2280
2290
  case 4:
2281
2291
  onFail(new Error("No amount or currencyId"));
@@ -2289,6 +2299,16 @@ var DemoPayForm = function (_a) {
2289
2299
  }
2290
2300
  });
2291
2301
  }); };
2302
+ function validateCardDetails() {
2303
+ if (cardDetails.number !== TEST_CARD)
2304
+ throw new Error("Only the card number 4242 4242 4242 4242 will be accepted.");
2305
+ if (!isValidExpiry(cardDetails.expiry))
2306
+ throw new Error("Invalid expiry date");
2307
+ if (isCardExpired(cardDetails.expiry))
2308
+ throw new Error("Card is expired");
2309
+ if (cardDetails.cvc.length !== 3)
2310
+ throw new Error("Invalid CVC");
2311
+ }
2292
2312
  var onCardNumberChange = function (number) {
2293
2313
  setCardDetails(__assign(__assign({}, cardDetails), { number: number }));
2294
2314
  };
@@ -2298,9 +2318,15 @@ var DemoPayForm = function (_a) {
2298
2318
  var onCardCvcChange = function (cvc) {
2299
2319
  setCardDetails(__assign(__assign({}, cardDetails), { cvc: cvc }));
2300
2320
  };
2301
- return (jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxs(StyledInputs, __assign({ className: "flex flex-col gap-2" }, { children: [jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxs("div", __assign({ className: "flex gap-2" }, { children: [jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsx("div", __assign({ className: "text-xs text-gray-700" }, { children: "DemoPay is for testing only." })), !onlySavePaymentMethod && (jsx(Checkbox, __assign({ className: "mt-2", onChange: function (e) { return setSavePaymentMethod(e.target.checked); } }, { children: "Save as primary payment method" }))), jsx(CheckoutFooter, { amountDue: amountDue, currencyId: currencyId, isSaving: isSaving, onPaymentSubmit: onPaymentSubmit, onlySavePaymentMethod: onlySavePaymentMethod })] })));
2321
+ return (jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxs(StyledInputs, __assign({ className: "flex flex-col gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false }, { children: [jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxs("div", __assign({ className: "flex gap-2" }, { children: [jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsx(Text$c, __assign({ className: "text-xs" }, { children: "DemoPay is for testing only." })), !onlySavePaymentMethod && (jsx(Checkbox, __assign({ className: "mt-2", onChange: function (e) { return setSavePaymentMethod(e.target.checked); } }, { children: "Save as primary payment method" }))), jsx(CheckoutFooter, { amountDue: amountDue, currencyId: currencyId, isSaving: isSaving, onPaymentSubmit: onPaymentSubmit, onlySavePaymentMethod: onlySavePaymentMethod })] })));
2302
2322
  };
2303
- var StyledInputs = styled.div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n .ant-input {\n background-color: white !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"], ["\n .ant-input {\n background-color: white !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"])), GRAY_200);
2323
+ var StyledInputs = styled.div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"], ["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"])), function (_a) {
2324
+ var darkMode = _a.darkMode;
2325
+ return darkMode ? "var(--row-background-dark)" : "white";
2326
+ }, function (_a) {
2327
+ var darkMode = _a.darkMode;
2328
+ return darkMode ? GRAY_500 : GRAY_200;
2329
+ });
2304
2330
  var templateObject_1$7;
2305
2331
 
2306
2332
  var finixStyles = function (isMobile) { return ({
@@ -2391,7 +2417,8 @@ var formatFinixError = function (response) {
2391
2417
  var FinixCardPaymentForm = function (_a) {
2392
2418
  var finixConfig = _a.formData, invoice = _a.invoice, isSaving = _a.isSaving, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, plugin = _a.plugin, quote = _a.quote, setIsSaving = _a.setIsSaving;
2393
2419
  // Context
2394
- var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2420
+ var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
2421
+ var accountId = useContext(PaymentContext).accountId;
2395
2422
  var isMobile = useIsMobile$1();
2396
2423
  // Local state
2397
2424
  var _c = useState(false), savePaymentMethod = _c[0], setSavePaymentMethod = _c[1];
@@ -2733,7 +2760,7 @@ var PaymentForm = function (_a) {
2733
2760
  return (jsx(ActualPaymentForm, { invoice: invoice, isSaving: isSaving, onFail: onFail, onPaymentSuccess: onPaymentSuccess, quote: quote, setIsSaving: setIsSaving }));
2734
2761
  };
2735
2762
 
2736
- var MUTATION$3 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
2763
+ var MUTATION$7 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
2737
2764
  var checkout = function (_a) {
2738
2765
  var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, subdomain = _a.subdomain;
2739
2766
  return __awaiter(void 0, void 0, void 0, function () {
@@ -2750,7 +2777,7 @@ var checkout = function (_a) {
2750
2777
  mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
2751
2778
  }
2752
2779
  return [4 /*yield*/, gqlRequest({
2753
- query: MUTATION$3,
2780
+ query: MUTATION$7,
2754
2781
  token: token,
2755
2782
  vars: mutationVars,
2756
2783
  subdomain: subdomain,
@@ -2768,8 +2795,9 @@ var checkout = function (_a) {
2768
2795
  });
2769
2796
  };
2770
2797
 
2798
+ var InvoiceCheckoutContext = createContext({});
2771
2799
  var InvoiceCheckout = function (_a) {
2772
- var isSaving = _a.isSaving, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, setIsSaving = _a.setIsSaving;
2800
+ var isSaving = _a.isSaving, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, setIsSaving = _a.setIsSaving, preCheckout = _a.preCheckout, setIsPreCheckoutLoading = _a.setIsPreCheckoutLoading, isPreCheckoutLoading = _a.isPreCheckoutLoading, payImmediatelyGivenInvoice = _a.payImmediatelyGivenInvoice, checkoutButtonName = _a.checkoutButtonName;
2773
2801
  var _b = useContext(BunnyContext), subdomain = _b.subdomain, token = _b.token;
2774
2802
  var checkoutMutation = useMutation({
2775
2803
  mutationFn: function (_a) {
@@ -2777,7 +2805,7 @@ var InvoiceCheckout = function (_a) {
2777
2805
  if (savedPaymentMethod) {
2778
2806
  var paymentMethodId = savedPaymentMethod.paymentMethodId;
2779
2807
  return checkout({
2780
- invoiceId: invoice.id,
2808
+ invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
2781
2809
  paymentMethodId: paymentMethodId,
2782
2810
  token: token,
2783
2811
  subdomain: subdomain,
@@ -2787,7 +2815,7 @@ var InvoiceCheckout = function (_a) {
2787
2815
  var plugin = pluginPaymentMethod.plugin, savePaymentMethod = pluginPaymentMethod.savePaymentMethod, metadata = pluginPaymentMethod.metadata;
2788
2816
  var paymentToken = pluginPaymentMethod.token;
2789
2817
  return checkout({
2790
- invoiceId: invoice.id,
2818
+ invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
2791
2819
  paymentMethodData: {
2792
2820
  metadata: metadata,
2793
2821
  pluginGuid: plugin.guid,
@@ -2833,7 +2861,14 @@ var InvoiceCheckout = function (_a) {
2833
2861
  });
2834
2862
  });
2835
2863
  };
2836
- return (jsx(PaymentForm, { isSaving: isSaving, onPaymentSuccess: handleCheckout, onFail: onFail, invoice: invoice, setIsSaving: setIsSaving }));
2864
+ return (jsx(InvoiceCheckoutContext.Provider, __assign({ value: {
2865
+ preCheckout: preCheckout,
2866
+ payImmediatelyGivenInvoice: payImmediatelyGivenInvoice,
2867
+ checkoutButtonName: checkoutButtonName,
2868
+ invoice: invoice,
2869
+ setIsPreCheckoutLoading: setIsPreCheckoutLoading,
2870
+ isPreCheckoutLoading: isPreCheckoutLoading,
2871
+ } }, { children: jsx(PaymentForm, { isSaving: isSaving, onPaymentSuccess: handleCheckout, onFail: onFail, invoice: invoice, setIsSaving: setIsSaving }) })));
2837
2872
  };
2838
2873
 
2839
2874
  var fetchPDF = function (window, apiEndpoint, invoiceUuid) { return __awaiter(void 0, void 0, void 0, function () {
@@ -2879,7 +2914,7 @@ function InvoicePDF(_a) {
2879
2914
  }, title: "Invoice PDF", width: "100%" }));
2880
2915
  }
2881
2916
 
2882
- var MUTATION$2 = "\nquery FormattedInvoice($id: ID) {\n formattedInvoice(id: $id) {\n amount\n amountDue\n amountPaid\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n createdAt\n credits\n currency\n currencyId\n currencySymbol\n customerBillingCity\n customerBillingContact\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n dueAt\n html\n id\n isLegacy\n netPaymentDays\n number\n payableId\n poNumber\n printedState\n smallUnitAmountDue\n state\n subscriptionEndDate\n subscriptionStartDate\n subtotal\n taxAmount\n taxNumber\n uuid\n vendorName\n formattedLines {\n amount\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n lineText\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListName\n prorationRate\n quantity\n unitOfMeasure\n priceTiers {\n price\n starts\n }\n }\n }\n}";
2917
+ var MUTATION$6 = "\nquery FormattedInvoice($id: ID) {\n formattedInvoice(id: $id) {\n amount\n amountDue\n amountPaid\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n createdAt\n credits\n currency\n currencyId\n currencySymbol\n customerBillingCity\n customerBillingContact\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n dueAt\n html\n id\n isLegacy\n netPaymentDays\n number\n payableId\n poNumber\n printedState\n smallUnitAmountDue\n state\n subscriptionEndDate\n subscriptionStartDate\n subtotal\n taxAmount\n taxNumber\n uuid\n vendorName\n formattedLines {\n amount\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n lineText\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListName\n prorationRate\n quantity\n unitOfMeasure\n priceTiers {\n price\n starts\n }\n }\n }\n}";
2883
2918
  var getFormattedInvoice = function (_a) {
2884
2919
  var id = _a.id, token = _a.token, subdomain = _a.subdomain;
2885
2920
  return __awaiter(void 0, void 0, void 0, function () {
@@ -2889,7 +2924,7 @@ var getFormattedInvoice = function (_a) {
2889
2924
  case 0:
2890
2925
  vars = { id: id };
2891
2926
  return [4 /*yield*/, gqlRequest({
2892
- query: MUTATION$2,
2927
+ query: MUTATION$6,
2893
2928
  token: token,
2894
2929
  vars: vars,
2895
2930
  subdomain: subdomain,
@@ -2945,7 +2980,7 @@ function ActualInvoice(_a) {
2945
2980
  return (jsxs(Fragment, { children: [jsxs(Helmet, { children: [jsxs("title", { children: [formattedInvoice.vendorName, " ", DOCUMENT_NAME$1.INVOICE] }), jsx("meta", { name: "description", content: QuoteInvoiceUtils.quoteMetaDescription(formattedInvoice.vendorName) }), jsx("meta", { property: "og:type", content: "website" }), jsx("meta", { property: "og:title", content: QuoteInvoiceUtils.quoteMetaTitle({
2946
2981
  vendorName: formattedInvoice.vendorName,
2947
2982
  documentName: DOCUMENT_NAME$1.INVOICE,
2948
- }) }), jsx("meta", { property: "og:description", content: QuoteInvoiceUtils.quoteMetaDescription(formattedInvoice.vendorName) })] }), jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: [formattedInvoice.isLegacy ? (jsx("div", __assign({ className: "flex justify-center w-full bg-red-500" }, { children: jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, subdomain: subdomain }) }))) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, isMobile: isMobile, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), !isMobile && isInvoicePayable && (jsx(Divider, { className: "h-full", type: "vertical" })), isInvoicePayable && (jsx(InvoiceCheckout, { invoice: formattedInvoice, isSaving: isSaving, onFail: function (error) {
2983
+ }) }), jsx("meta", { property: "og:description", content: QuoteInvoiceUtils.quoteMetaDescription(formattedInvoice.vendorName) })] }), jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: [formattedInvoice.isLegacy ? (jsx("div", __assign({ className: "flex justify-center w-full" }, { children: jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, subdomain: subdomain }) }))) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, isMobile: isMobile, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), !isMobile && isInvoicePayable && (jsx(Divider, { className: "h-full", type: "vertical" })), isInvoicePayable && (jsx(InvoiceCheckout, { invoice: formattedInvoice, isSaving: isSaving, onFail: function (error) {
2949
2984
  onFail(error);
2950
2985
  setIsSaving(false);
2951
2986
  }, onSuccess: onSuccess, setIsSaving: setIsSaving }))] }))] }));
@@ -2955,8 +2990,6 @@ function Invoice(_a) {
2955
2990
  return (jsx(HelmetProvider, { children: jsx(ActualInvoice, { id: id, invoiceQuoteViewComponent: invoiceQuoteViewComponent, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick, onPaymentSuccess: onPaymentSuccess }) }));
2956
2991
  }
2957
2992
 
2958
- var QuoteContext = createContext({});
2959
-
2960
2993
  var DOCUMENT_NAME;
2961
2994
  (function (DOCUMENT_NAME) {
2962
2995
  DOCUMENT_NAME["INVOICE"] = "invoice";
@@ -3082,7 +3115,7 @@ var useSigningComplete = function (_a) {
3082
3115
  var queryClient = useQueryClient();
3083
3116
  var searchParams = useContext(NavigationContext).searchParams;
3084
3117
  // Check for return param from docusign and show cosmetic quote acceptance
3085
- var eventParam = searchParams.get("event");
3118
+ var eventParam = searchParams ? searchParams.get("event") : null;
3086
3119
  useEffect(function () {
3087
3120
  if (data && eventParam === "signing_complete") {
3088
3121
  data.state = "ACCEPTED";
@@ -3166,8 +3199,6 @@ var PandadocPollingModal = function (_a) {
3166
3199
  handleAllErrorFormats(rsp.errors);
3167
3200
  else if (rsp.data.quotePollSigningUrl.status === "document.sent") {
3168
3201
  setVisible(false);
3169
- console.log("rsp", rsp);
3170
- console.log("rsp.data.quotePollSigningUrl.redirectUri", rsp.data.quotePollSigningUrl.redirectUri);
3171
3202
  window.location.href = rsp.data.quotePollSigningUrl.redirectUri;
3172
3203
  }
3173
3204
  setInfoMessage(rsp.data.quotePollSigningUrl.infoMessage || "");
@@ -3187,55 +3218,42 @@ var PandadocPollingModal = function (_a) {
3187
3218
  return (jsxs(Modal, __assign({ title: "Uploading quote to Pandadoc", open: isVisible, closable: false, footer: null }, { children: [jsxs("div", __assign({ className: "py-4 text-center" }, { children: ["This may take a few seconds", ".".repeat(numberOfPolls)] })), jsx("div", __assign({ className: "text-center" }, { children: infoMessage }))] })));
3188
3219
  };
3189
3220
 
3190
- var formattedQuoteMutation = function () { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\n object { documents { id filename size date url } }\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n contactName\n currency\n customerBillingCity\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n discount\n discountValue\n duration\n endDate\n expiresAt\n html\n formattedLines {\n amount\n amountsByPeriod {\n quantity\n id\n name\n startDate\n endDate\n amount\n amountsByTier {\n id\n tier {\n starts\n ends\n price\n }\n quantity\n amount\n }\n prorationRate\n }\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n isRamp\n periods\n planName\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListId\n priceListName\n priceTiers {\n price\n starts\n }\n pricingModel\n productName\n prorationRate\n quantity\n showProductNameOnLineItem\n taxCode\n trialEndDate\n trialStartDate\n unitOfMeasure\n vatCode\n }\n netPaymentDays\n notes\n number\n poNumberRequired\n salesContactEmail\n sharedAt\n startDate\n state\n subtotal\n taxAmount\n taxNumberLabel\n taxNumberRequired\n vendorName\n }\n }"; };
3191
- var getFormattedQuote = function (token, apiEndpoint, id) { return __awaiter(void 0, void 0, void 0, function () {
3192
- var response, _a, data, errors, formattedLines, decimals;
3193
- return __generator(this, function (_b) {
3194
- switch (_b.label) {
3195
- case 0: return [4 /*yield*/, fetch(apiEndpoint + "/graphql", {
3196
- method: "POST",
3197
- headers: {
3198
- "Content-type": "application/json; charset=utf-8",
3199
- Authorization: "Bearer ".concat(token),
3200
- },
3201
- body: JSON.stringify({
3202
- query: formattedQuoteMutation(),
3203
- variables: {
3204
- id: id,
3205
- },
3206
- }),
3207
- })];
3208
- case 1:
3209
- response = _b.sent();
3210
- return [4 /*yield*/, response.json()];
3211
- case 2:
3212
- _a = _b.sent(), data = _a.data, errors = _a.errors;
3213
- if (errors) {
3214
- throw new Error(errors[0].message);
3215
- }
3216
- formattedLines = data.formattedQuote.formattedLines;
3217
- decimals = Math.max.apply(Math, formattedLines.map(function (x) { return x.priceDecimals; }));
3218
- formattedLines.forEach(function (line) {
3219
- line.priceDecimals = decimals;
3220
- });
3221
- return [2 /*return*/, data === null || data === void 0 ? void 0 : data.formattedQuote];
3222
- }
3221
+ var MUTATION$5 = "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\n object { documents { id filename size date url } }\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n contactName\n currency\n customerBillingCity\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n discount\n discountValue\n duration\n endDate\n expiresAt\n html\n formattedLines {\n amount\n amountsByPeriod {\n quantity\n id\n name\n startDate\n endDate\n amount\n amountsByTier {\n id\n tier {\n starts\n ends\n price\n }\n quantity\n amount\n }\n prorationRate\n }\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n isRamp\n periods\n planName\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListId\n priceListName\n priceTiers {\n price\n starts\n }\n pricingModel\n productName\n prorationRate\n quantity\n showProductNameOnLineItem\n taxCode\n trialEndDate\n trialStartDate\n unitOfMeasure\n vatCode\n }\n netPaymentDays\n notes\n number\n poNumberRequired\n salesContactEmail\n sharedAt\n startDate\n state\n subtotal\n taxAmount\n taxNumberLabel\n taxNumberRequired\n vendorName\n }\n }";
3222
+ var getFormattedQuote = function (_a) {
3223
+ var id = _a.id, token = _a.token, subdomain = _a.subdomain;
3224
+ return __awaiter(void 0, void 0, void 0, function () {
3225
+ var vars, response;
3226
+ return __generator(this, function (_b) {
3227
+ switch (_b.label) {
3228
+ case 0:
3229
+ vars = { id: id };
3230
+ return [4 /*yield*/, gqlRequest({
3231
+ query: MUTATION$5,
3232
+ token: token,
3233
+ vars: vars,
3234
+ subdomain: subdomain,
3235
+ })];
3236
+ case 1:
3237
+ response = _b.sent();
3238
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.formattedQuote];
3239
+ }
3240
+ });
3223
3241
  });
3224
- }); };
3242
+ };
3225
3243
 
3226
3244
  var documentName = DOCUMENT_NAME.QUOTE;
3227
- function ActualQuote() {
3228
- var _a, _b;
3229
- var id = useContext(QuoteContext).id;
3230
- var _c = useContext(BunnyContext), token = _c.token, subdomain = _c.subdomain;
3245
+ function ActualQuote(_a) {
3246
+ var _b, _c;
3247
+ var id = _a.id;
3248
+ var _d = useContext(BunnyContext), token = _d.token, subdomain = _d.subdomain;
3231
3249
  var entityBranding = useContext(BrandContext);
3232
3250
  var isMobile = useIsMobile$1();
3233
3251
  // Queries
3234
- var data = useQuery({
3252
+ var _e = useQuery({
3235
3253
  queryKey: QueryKeyFactory.default.createQuoteKey(token),
3236
- queryFn: function () { return getFormattedQuote(token, subdomain, id); },
3254
+ queryFn: function () { return getFormattedQuote({ token: token, subdomain: subdomain, id: id }); },
3237
3255
  placeholderData: keepPreviousData,
3238
- }).data;
3256
+ }), data = _e.data; _e.isLoading; _e.isError; _e.error;
3239
3257
  useQuery({
3240
3258
  queryKey: QueryKeyFactory.default.currentUserKey,
3241
3259
  queryFn: function () { return getCurrentUserData({ token: token, subdomain: subdomain }); },
@@ -3244,7 +3262,7 @@ function ActualQuote() {
3244
3262
  // Hooks
3245
3263
  var downloadFile = useDownloadFile(id);
3246
3264
  var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
3247
- var _d = useSendAcceptQuote(token, subdomain, id), acceptBoxVisible = _d.acceptBoxVisible, isAccepting = _d.isAccepting, sendAccept = _d.sendAccept, setAcceptBoxVisible = _d.setAcceptBoxVisible, setIsAccepting = _d.setIsAccepting, startAcceptance = _d.startAcceptance, pandadocPollingModalVisible = _d.pandadocPollingModalVisible, setPandadocPollingModalVisible = _d.setPandadocPollingModalVisible;
3265
+ var _f = useSendAcceptQuote(token, subdomain, id), acceptBoxVisible = _f.acceptBoxVisible, isAccepting = _f.isAccepting, sendAccept = _f.sendAccept, setAcceptBoxVisible = _f.setAcceptBoxVisible, setIsAccepting = _f.setIsAccepting, startAcceptance = _f.startAcceptance, pandadocPollingModalVisible = _f.pandadocPollingModalVisible, setPandadocPollingModalVisible = _f.setPandadocPollingModalVisible;
3248
3266
  useSigningComplete({ data: formattedQuote, token: token });
3249
3267
  if (!formattedQuote) {
3250
3268
  return jsx(Fragment, {});
@@ -3254,25 +3272,30 @@ function ActualQuote() {
3254
3272
  documentName: documentName,
3255
3273
  }) }), jsx("meta", { property: "og:description", content: QuoteInvoiceUtils.quoteMetaDescription(formattedQuote.vendorName) })] }), jsxs("div", __assign({ className: "flex shadow-padding-x ".concat(isMobile ? "flex-col gap-1" : "items-center gap-2", " justify-end pb-4"), id: "acceptance", style: {
3256
3274
  color: entityBranding.secondaryColor,
3257
- } }, { children: [(formattedQuote.state === "ACCEPTED" ||
3258
- formattedQuote.state === "APPLIED") && (jsxs("div", { children: [formattedQuote.state === "ACCEPTED" &&
3275
+ } }, { children: [formattedQuote.state === "ACCEPTED" ||
3276
+ formattedQuote.state === "APPLIED" ? (jsxs("div", { children: [formattedQuote.state === "ACCEPTED" &&
3259
3277
  formattedQuote.acceptedAt &&
3260
3278
  "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(Misc.formatDate(formattedQuote.acceptedAt)), formattedQuote.state === "APPLIED" &&
3261
3279
  formattedQuote.acceptedAt &&
3262
- "Quote is now applied. Accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(Misc.formatDate(formattedQuote.acceptedAt))] })), jsxs("div", __assign({ className: isMobile
3280
+ "Quote is now applied. Accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(Misc.formatDate(formattedQuote.acceptedAt))] })) : null, jsxs("div", __assign({ className: isMobile
3263
3281
  ? "flex w-full justify-between gap-2"
3264
- : "flex items-center justify-end gap-2" }, { children: [!isMobile && (jsx(Button, __assign({ icon: jsx(DownloadOutlined$1, {}), onClick: function () { return downloadFile(subdomain + "/api/pdf/quote", token); } }, { children: "Download" }))), formattedQuote.state !== "ACCEPTED" &&
3265
- formattedQuote.state !== "APPLIED" && (jsx(Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" })))] }))] })), jsx("div", __assign({ className: "flex ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, isMobile: isMobile }, { children: ((_b = (_a = formattedQuote.object) === null || _a === void 0 ? void 0 : _a.documents) === null || _b === void 0 ? void 0 : _b.length) > 0 && (jsx("div", __assign({ className: "flex flex-col items-end" }, { children: formattedQuote.object.documents.map(function (doc, index) {
3282
+ : "flex items-center justify-end gap-2" }, { children: [!isMobile ? (jsx(Button, __assign({ icon: jsx(DownloadOutlined$1, {}), onClick: function () { return downloadFile(subdomain + "/api/pdf/quote", token); } }, { children: "Download" }))) : null, formattedQuote.state !== "ACCEPTED" &&
3283
+ formattedQuote.state !== "APPLIED" ? (jsx(Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" }))) : null] }))] })), jsx("div", __assign({ className: "flex ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, isMobile: isMobile }, { children: ((_c = (_b = formattedQuote.object) === null || _b === void 0 ? void 0 : _b.documents) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (jsx("div", __assign({ className: "flex flex-col items-end" }, { children: formattedQuote.object.documents.map(function (doc, index) {
3266
3284
  return (jsx(Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
3267
- }) }))) })) })), jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept }), jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
3285
+ }) }))) : null })) })), jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept }), jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
3268
3286
  }
3269
3287
  styled.div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
3270
3288
  function Quote(_a) {
3271
3289
  var id = _a.id;
3272
- return (jsx(HelmetProvider, { children: jsx(QuoteContext.Provider, __assign({ value: { id: id } }, { children: jsx(ActualQuote, {}) })) }));
3290
+ return (jsx(HelmetProvider, { children: jsx(ActualQuote, { id: id }) }));
3273
3291
  }
3274
3292
  var templateObject_1$5;
3275
3293
 
3294
+ var DrawerHeader = function (_a) {
3295
+ var description = _a.description, onClose = _a.onClose, title = _a.title;
3296
+ return (jsxs("div", __assign({ className: "flex flex-col gap-4" }, { children: [jsxs("div", __assign({ className: "flex items-center justify-between gap-2" }, { children: [jsx("div", __assign({ className: "text-xl" }, { children: title })), jsx("button", __assign({ onClick: onClose, className: "ant-drawer-close" }, { children: jsx(CloseOutlined$1, {}) }))] })), description && jsx("div", __assign({ className: "text-xs" }, { children: description }))] })));
3297
+ };
3298
+
3276
3299
  var LargeCardIcon = function () {
3277
3300
  return (jsx("svg", __assign({ width: "72", height: "56", viewBox: "0 0 72 56", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: jsx("path", { d: "M8 0H64C68.375 0 72 3.625 72 8V12H0V8C0 3.625 3.5 0 8 0ZM72 24V48C72 52.5 68.375 56 64 56H8C3.5 56 0 52.5 0 48V24H72ZM14 40C12.875 40 12 41 12 42C12 43.125 12.875 44 14 44H22C23 44 24 43.125 24 42C24 41 23 40 22 40H14ZM28 42C28 43.125 28.875 44 30 44H46C47 44 48 43.125 48 42C48 41 47 40 46 40H30C28.875 40 28 41 28 42Z", fill: "#E2E8F0" }) })));
3278
3301
  };
@@ -3284,11 +3307,15 @@ var PlusIcon = function (_a) {
3284
3307
 
3285
3308
  var PaymentMethodContext = createContext({});
3286
3309
 
3287
- // TODO: remove this eventually
3288
- var Card$1 = function (_a) {
3289
- var children = _a.children, className = _a.className;
3290
- return (jsx("div", __assign({ className: "flex flex-col bg-white rounded-md shadow-md ".concat(className) }, { children: children })));
3310
+ var Card = function (_a) {
3311
+ var children = _a.children, className = _a.className, style = _a.style;
3312
+ var darkMode = useContext(BunnyContext).darkMode;
3313
+ return (jsx("div", __assign({ className: "flex flex-col rounded-md shadow-md ".concat(className), style: __assign(__assign({}, style), { backgroundColor: darkMode
3314
+ ? "var(--row-background-dark)"
3315
+ : "var(--row-background)" }) }, { children: children })));
3291
3316
  };
3317
+
3318
+ var Text$b = Typography.Text;
3292
3319
  var CreditCard = function (_a) {
3293
3320
  var _b, _c, _d;
3294
3321
  var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate, paymentMethodData = _a.paymentMethodData;
@@ -3299,11 +3326,11 @@ var CreditCard = function (_a) {
3299
3326
  };
3300
3327
  var isMobile = useIsMobile$1();
3301
3328
  var processPublicUrl = useContext(PaymentMethodContext).processPublicUrl;
3302
- return (jsxs(Card$1, __assign({ className: "shadow-md m-0" }, { children: [jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [getCardImage((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer) && (jsx("img", { alt: "Card", width: "24px", src: "".concat(processPublicUrl, "/").concat(getCardImage((_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.issuer)) })), jsx("div", { children: (_d = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _d === void 0 ? void 0 : _d.description })] })), jsx(Tag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxs(Fragment, { children: [jsx(Divider, {}), jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsx(CardAttribute, { title: "EXPIRATION", value: dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).format("MM/YY") }), isMobile && (jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
3329
+ return (jsxs(Card, __assign({ className: "shadow-md m-0" }, { children: [jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [getCardImage((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer) && (jsx("img", { alt: "Card", width: "24px", src: "".concat(processPublicUrl, "/").concat(getCardImage((_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.issuer)) })), jsx(Text$b, { children: (_d = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _d === void 0 ? void 0 : _d.description })] })), jsx(Tag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxs(Fragment, { children: [jsx(Divider, {}), jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsx(CardAttribute, { title: "EXPIRATION", value: dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).format("MM/YY") }), isMobile && (jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
3303
3330
  };
3304
3331
  var CardAttribute = function (_a) {
3305
3332
  var title = _a.title, value = _a.value;
3306
- return (jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsx("div", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: title })), jsx("div", { children: value })] })));
3333
+ return (jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsx("div", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: title })), jsx(Text$b, { children: value })] })));
3307
3334
  };
3308
3335
  var CardActions = function (_a) {
3309
3336
  var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate;
@@ -3322,14 +3349,9 @@ var getCardImage = function (issuer) {
3322
3349
  return "mc_symbol_opt_73_3x.png";
3323
3350
  };
3324
3351
 
3325
- var DrawerHeader = function (_a) {
3326
- var description = _a.description, onClose = _a.onClose, title = _a.title;
3327
- return (jsxs("div", __assign({ className: "flex flex-col gap-4" }, { children: [jsxs("div", __assign({ className: "flex items-center justify-between gap-2" }, { children: [jsx("div", __assign({ className: "text-xl" }, { children: title })), jsx("button", __assign({ onClick: onClose, className: "ant-drawer-close" }, { children: jsx(CloseOutlined$1, {}) }))] })), description && jsx("div", __assign({ className: "text-xs" }, { children: description }))] })));
3328
- };
3329
-
3330
3352
  var ActualPaymentMethod = function () {
3331
- var _a = useContext(BunnyContext), token = _a.token, subdomain = _a.subdomain, graphQLClient = _a.graphQLClient, accountId = _a.accountId;
3332
- var footer = useContext(PaymentMethodContext).footer;
3353
+ var _a = useContext(BunnyContext), token = _a.token, subdomain = _a.subdomain, graphQLClient = _a.graphQLClient;
3354
+ var accountId = useContext(PaymentContext).accountId;
3333
3355
  // Hooks
3334
3356
  var queryClient = useQueryClient();
3335
3357
  var paymentPlugins = usePaymentPlugins({ subdomain: subdomain, token: token }).paymentPlugins;
@@ -3379,7 +3401,7 @@ var ActualPaymentMethod = function () {
3379
3401
  };
3380
3402
  if (data === undefined)
3381
3403
  return jsx(Fragment, {});
3382
- return (jsxs(Fragment, { children: [data ? (jsx(CreditCard, { onClickRemove: onClickRemove, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data })) : (jsx(EmptyCard, { onClick: function () { return setShowModal(true); } })), footer, jsx(Drawer, __assign({ closeIcon: null, onClose: function () { return setShowModal(false); }, open: showModal, styles: {
3404
+ return (jsxs(Fragment, { children: [data ? (jsx(CreditCard, { onClickRemove: onClickRemove, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data })) : (jsx(EmptyCard, { onClick: function () { return setShowModal(true); } })), jsx(Drawer, __assign({ closeIcon: null, onClose: function () { return setShowModal(false); }, open: showModal, styles: {
3383
3405
  body: isMobile
3384
3406
  ? {
3385
3407
  padding: "1rem 0 0",
@@ -3399,7 +3421,7 @@ function PaymentMethod(_a) {
3399
3421
  return (jsx(PaymentMethodContext.Provider, __assign({ value: { footer: footer, processPublicUrl: processPublicUrl } }, { children: jsx(ActualPaymentMethod, {}) })));
3400
3422
  }
3401
3423
 
3402
- var MUTATION$1 = "\nmutation accountUpdate(\n $id: ID!,\n $attributes: AccountAttributes!) {\n accountUpdate(\n id: $id,\n attributes: $attributes\n ) {\n account { id }\n errors\n }\n }\n";
3424
+ var MUTATION$4 = "\nmutation accountUpdate(\n $id: ID!,\n $attributes: AccountAttributes!) {\n accountUpdate(\n id: $id,\n attributes: $attributes\n ) {\n account { id }\n errors\n }\n }\n";
3403
3425
  var accountUpdate = function (_a) {
3404
3426
  var accountId = _a.accountId, attributes = _a.attributes, token = _a.token;
3405
3427
  return __awaiter(void 0, void 0, void 0, function () {
@@ -3409,7 +3431,7 @@ var accountUpdate = function (_a) {
3409
3431
  switch (_c.label) {
3410
3432
  case 0:
3411
3433
  vars = { id: accountId, attributes: attributes };
3412
- return [4 /*yield*/, gqlRequest({ query: MUTATION$1, token: token, vars: vars })];
3434
+ return [4 /*yield*/, gqlRequest({ query: MUTATION$4, token: token, vars: vars })];
3413
3435
  case 1:
3414
3436
  response = _c.sent();
3415
3437
  errors = (_b = response === null || response === void 0 ? void 0 : response.accountUpdate) === null || _b === void 0 ? void 0 : _b.errors;
@@ -3473,6 +3495,8 @@ var QuoteCheckout = function (_a) {
3473
3495
  var checkoutMutation = useMutation({
3474
3496
  mutationFn: function (_a) {
3475
3497
  var pluginPaymentMethod = _a.pluginPaymentMethod, savedPaymentMethod = _a.storedPaymentMethod;
3498
+ if (!quote)
3499
+ throw new Error("Quote is required");
3476
3500
  if (!paymentRequired)
3477
3501
  return checkout({ quoteId: quote.id, token: token, subdomain: subdomain });
3478
3502
  if (savedPaymentMethod) {
@@ -3675,6 +3699,280 @@ var Checkout = function (_a) {
3675
3699
  }, setIsSaving: setIsSaving }))] }))] })) })));
3676
3700
  };
3677
3701
 
3702
+ var MUTATION$3 = function () { return "\nmutation AccountSignup (\n $entityId: ID!,\n $pluginId: String!,\n $paymentMethodId: String,\n $priceListCode: String!,\n $accountId: ID!,\n $quoteId: ID!\n) {\n accountSignup(\n entityId: $entityId,\n pluginId: $pluginId,\n paymentMethodId: $paymentMethodId,\n priceListCode: $priceListCode,\n accountId: $accountId,\n quoteId: $quoteId\n ) {\n errors\n quote {\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\n backdatedPeriods\n backdatedQuote\n billingDay\n contactId\n createdAt\n credits\n currencyId\n dealId\n discount\n discountValue\n endDate\n evergreen\n expiresAt\n id\n invoiceImmediately\n invoiceImmediatelyAvailable\n invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n number\n ownerId\n payableId\n periodAmount\n poNumber\n requiresApproval\n smallUnitAmountDue\n splitInvoice\n startDate\n state\n subtotal\n taxAmount\n taxCode\n updatedAt\n uuid\n }\n }\n}"; };
3703
+ var accountSignup = function (_a) {
3704
+ var token = _a.token, subdomain = _a.subdomain, entityId = _a.entityId, accountId = _a.accountId, quoteId = _a.quoteId, paymentToken = _a.paymentToken, paymentMethodId = _a.paymentMethodId, pluginId = _a.pluginId, priceListCode = _a.priceListCode;
3705
+ return __awaiter(void 0, void 0, void 0, function () {
3706
+ var vars, response, errors;
3707
+ var _b;
3708
+ return __generator(this, function (_c) {
3709
+ switch (_c.label) {
3710
+ case 0:
3711
+ vars = {
3712
+ entityId: entityId,
3713
+ accountId: accountId,
3714
+ quoteId: quoteId,
3715
+ paymentToken: paymentToken,
3716
+ pluginId: pluginId,
3717
+ paymentMethodId: paymentMethodId,
3718
+ priceListCode: priceListCode,
3719
+ };
3720
+ return [4 /*yield*/, gqlRequest({
3721
+ query: MUTATION$3(),
3722
+ token: token,
3723
+ vars: vars,
3724
+ subdomain: subdomain,
3725
+ })];
3726
+ case 1:
3727
+ response = _c.sent();
3728
+ errors = (_b = response === null || response === void 0 ? void 0 : response.accountSignup) === null || _b === void 0 ? void 0 : _b.errors;
3729
+ if (errors)
3730
+ throw errors;
3731
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.accountSignup];
3732
+ }
3733
+ });
3734
+ });
3735
+ };
3736
+
3737
+ var MUTATION$2 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $entityId: ID!,\n $priceListCode: String!\n) {\n quoteAccountSignup(\n entityId: $entityId,\n priceListCode: $priceListCode,\n accountName: $accountName,\n billingContact: $billingContact\n ) {\n account {\n id\n }\n amount\n currencyId\n quoteId\n errors\n }\n}"; };
3738
+ var quoteAccountSignup = function (_a) {
3739
+ var token = _a.token, subdomain = _a.subdomain, entityId = _a.entityId, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact;
3740
+ return __awaiter(void 0, void 0, void 0, function () {
3741
+ var vars, response, errors;
3742
+ var _b;
3743
+ return __generator(this, function (_c) {
3744
+ switch (_c.label) {
3745
+ case 0:
3746
+ vars = {
3747
+ entityId: entityId,
3748
+ priceListCode: priceListCode,
3749
+ accountName: accountName,
3750
+ billingContact: billingContact,
3751
+ };
3752
+ return [4 /*yield*/, gqlRequest({
3753
+ query: MUTATION$2(),
3754
+ token: token,
3755
+ vars: vars,
3756
+ subdomain: subdomain,
3757
+ })];
3758
+ case 1:
3759
+ response = _c.sent();
3760
+ errors = (_b = response === null || response === void 0 ? void 0 : response.quoteAccountSignup) === null || _b === void 0 ? void 0 : _b.errors;
3761
+ if (errors)
3762
+ throw errors;
3763
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.quoteAccountSignup];
3764
+ }
3765
+ });
3766
+ });
3767
+ };
3768
+
3769
+ var MUTATION$1 = function () { return "\nquery PriceList($code: String!) {\n priceList (code: $code) {\n basePrice\n code\n createdAt\n currencyId\n id\n isVisible\n name\n periodMonths\n planId\n priceDescription\n productId\n sku\n trialAllowed\n trialLengthDays\n updatedAt\n }\n}"; };
3770
+ var getPriceList = function (_a) {
3771
+ var token = _a.token, code = _a.code, subdomain = _a.subdomain;
3772
+ return __awaiter(void 0, void 0, void 0, function () {
3773
+ var response;
3774
+ return __generator(this, function (_b) {
3775
+ switch (_b.label) {
3776
+ case 0: return [4 /*yield*/, gqlRequest({
3777
+ query: MUTATION$1(),
3778
+ token: token,
3779
+ vars: { code: code },
3780
+ subdomain: subdomain,
3781
+ })];
3782
+ case 1:
3783
+ response = _b.sent();
3784
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.priceList];
3785
+ }
3786
+ });
3787
+ });
3788
+ };
3789
+
3790
+ function PaymentForms(_a) {
3791
+ var quote = _a.quote, paying = _a.paying, setIsPaying = _a.setIsPaying, handlePaymentSaveSuccess = _a.handlePaymentSaveSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment, accountId = _a.accountId;
3792
+ return (jsx(Fragment, { children: quote ? (jsx(Fragment, { children: accountId && (jsx(PaymentContext.Provider, __assign({ value: { accountId: accountId, displayPayButtonNameAnyways: true } }, { children: jsx(PaymentForm, { isSaving: paying, setIsSaving: setIsPaying, onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSaveSuccess }) }))) })) : (jsx(InitialSignupForm, { onSubmit: handleSubmit, submitting: proceedingToPayment })) }));
3793
+ }
3794
+ function InitialSignupForm(_a) {
3795
+ var onSubmit = _a.onSubmit, submitting = _a.submitting;
3796
+ var _b = useState({
3797
+ firstName: "",
3798
+ lastName: "",
3799
+ email: "",
3800
+ accountName: "",
3801
+ }), formData = _b[0], setFormData = _b[1];
3802
+ var handleInputChange = function (e) {
3803
+ var _a;
3804
+ var _b = e.target, name = _b.name, value = _b.value;
3805
+ setFormData(__assign(__assign({}, formData), (_a = {}, _a[name] = value, _a)));
3806
+ };
3807
+ return (jsxs(Form, __assign({ className: "flex w-1/2 flex-col justify-between h-full", onFinish: function () { return onSubmit(formData); } }, { children: [jsxs("div", __assign({ className: "flex flex-col space-y-2" }, { children: [jsx(Form.Item, __assign({ rules: [{ required: true, message: "Please input your first name!" }], initialValue: formData.firstName }, { children: jsx(Input, { placeholder: "First name", value: formData.firstName, onChange: function (e) {
3808
+ handleInputChange(e);
3809
+ setFormData(__assign(__assign({}, formData), { firstName: e.target.value }));
3810
+ } }) })), jsx(Form.Item, __assign({ rules: [{ required: true, message: "Please input your last name!" }], initialValue: formData.lastName }, { children: jsx(Input, { placeholder: "Last name", value: formData.lastName, onChange: function (e) {
3811
+ handleInputChange(e);
3812
+ setFormData(__assign(__assign({}, formData), { lastName: e.target.value }));
3813
+ } }) })), jsx(Form.Item, __assign({ rules: [
3814
+ { required: true, message: "Please input your email!" },
3815
+ { type: "email", message: "Please enter a valid email!" },
3816
+ ], initialValue: formData.email }, { children: jsx(Input, { placeholder: "Email", value: formData.email, onChange: function (e) {
3817
+ handleInputChange(e);
3818
+ setFormData(__assign(__assign({}, formData), { email: e.target.value }));
3819
+ } }) })), jsx(Form.Item, __assign({ rules: [
3820
+ { required: true, message: "Please input your account name!" },
3821
+ ], initialValue: formData.accountName }, { children: jsx(Input, { placeholder: "Account name", value: formData.accountName, onChange: function (e) {
3822
+ handleInputChange(e);
3823
+ setFormData(__assign(__assign({}, formData), { accountName: e.target.value }));
3824
+ } }) }))] })), jsx(Form.Item, { children: jsx(Button, __assign({ type: "primary", htmlType: "submit", loading: submitting, className: "w-full mt-4" }, { children: "Proceed to payment" })) })] })));
3825
+ }
3826
+
3827
+ var Title = Typography.Title, Text$a = Typography.Text;
3828
+ function PaymentSuccessDisplay(_a) {
3829
+ var className = _a.className, amountPaid = _a.amountPaid, style = _a.style, returnUrl = _a.returnUrl;
3830
+ var window = useContext(BunnyContext).window;
3831
+ var companyName = useCurrentUserData().companyName;
3832
+ return (jsxs("div", __assign({ className: "flex flex-col items-center justify-center h-full ".concat(className), style: style }, { children: [jsx(CheckCircleFilled$1, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxs(Title, __assign({ level: 3, className: "mt-2 m-0" }, { children: ["Payment of ", Misc.formatCurrency(amountPaid, "USD"), " successful"] })), returnUrl && (jsxs(Text$a, __assign({ className: "text-slate-500 cursor-pointer underline", onClick: function () { return (window.location.href = returnUrl); } }, { children: ["Back to ", companyName] })))] })));
3833
+ }
3834
+
3835
+ var Text$9 = Typography.Text;
3836
+ function PriceListDisplay(_a) {
3837
+ var priceListData = _a.priceListData, topNavImageUrl = _a.topNavImageUrl;
3838
+ if (!priceListData)
3839
+ return null;
3840
+ return (jsx(Fragment, { children: jsx("div", __assign({ className: "flex flex-col justify-between h-full my-12" }, { children: jsxs("div", __assign({ className: "flex flex-col space-y-8" }, { children: [jsx(Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false }), jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsx(Text$9, __assign({ className: "text-slate-500 font-bold text-lg" }, { children: priceListData.name })), jsxs(Text$9, __assign({ className: "font-bold text-xl" }, { children: [Misc.formatCurrency(priceListData.basePrice, priceListData.currencyId), " ", "/ month"] }))] })), jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxs(Text$9, __assign({ style: { fontSize: "16px" }, className: "text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsx(Text$9, __assign({ className: "text-slate-500", style: { fontSize: "12px" } }, { children: "You will not be charged until the last day of the trial." }))] }))] })) })) }));
3841
+ }
3842
+
3843
+ var BunnyFooterIcon = function (_a) {
3844
+ var color = _a.color;
3845
+ return (jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsx("path", { className: "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: "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: "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: "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: "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: "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", __assign({ id: "clip0_6_851" }, { children: jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
3846
+ };
3847
+
3848
+ var Footer = function (_a) {
3849
+ var className = _a.className;
3850
+ var _b = useCurrentUserData(), privacyUrl = _b.privacyUrl, termsUrl = _b.termsUrl;
3851
+ var window = useContext(BunnyContext).window;
3852
+ var isMobile = useIsMobile(window);
3853
+ var quotePreviewData = useRecoilValue(planPickerQuoteDataState);
3854
+ var selectedPriceList = quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList;
3855
+ if (selectedPriceList && isMobile)
3856
+ return null;
3857
+ return (jsxs("div", __assign({ className: "flex items-center justify-between shrink-0 ".concat(className, " ").concat(isMobile ? "flex-col gap-2 grow" : "") }, { children: [(termsUrl || privacyUrl) && (jsxs("div", __assign({ className: "flex items-center gap-3" }, { children: [termsUrl && (jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Terms" }))), privacyUrl && (jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Privacy" })))] }))), jsx(BunnyMarketingLink, {})] })));
3858
+ };
3859
+ var BunnyMarketingLink = function () {
3860
+ var _a = useState(false), isHovered = _a[0], setIsHovered = _a[1];
3861
+ var window = useContext(BunnyContext).window;
3862
+ var isMobile = useIsMobile(window);
3863
+ return (jsx("div", __assign({ className: "flex items-end justify-end ".concat(isMobile ? "" : "grow") }, { children: jsx(StyledBunnyLink, __assign({ className: "flex items-end justify-end text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: jsxs("div", __assign({ className: "flex items-center", onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: ["Powered by\u00A0", jsx("div", __assign({ style: { paddingTop: "5px" } }, { children: jsx(BunnyFooterIcon, { color: isHovered ? PRIMARY_COLOR : SLATE_400 }) }))] })) })) })));
3864
+ };
3865
+ var StyedLink = styled.a(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"], ["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"])), SLATE_400, SLATE_500);
3866
+ var StyledBunnyLink = styled(StyedLink)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n color: ", " !important;\n }\n"], ["\n &:hover {\n color: ", " !important;\n }\n"])), PRIMARY_COLOR);
3867
+ var templateObject_1$4, templateObject_2;
3868
+
3869
+ var showErrorNotification = NotificationUtils.useErrorNotification();
3870
+ function Signup(_a) {
3871
+ var priceListCode = _a.priceListCode, returnUrl = _a.returnUrl;
3872
+ // Hooks
3873
+ var _b = useContext(BunnyContext), subdomain = _b.subdomain, token = _b.token, window = _b.window;
3874
+ useQuery({
3875
+ queryKey: QueryKeyFactory.default.currentUserKey,
3876
+ queryFn: function () { return getCurrentUserData({ token: token, subdomain: subdomain }); },
3877
+ });
3878
+ var isMobile = useIsMobile(window);
3879
+ var topNavImageUrl = useContext(BrandContext).topNavImageUrl;
3880
+ var entityId = useCurrentUserData().entityId;
3881
+ var _c = useState(undefined), quote = _c[0], setQuote = _c[1];
3882
+ var _d = useState(undefined), accountId = _d[0], setAccountId = _d[1];
3883
+ var _e = useState(undefined), quoteId = _e[0], setQuoteId = _e[1];
3884
+ var _f = useState(undefined), formData = _f[0], setFormData = _f[1];
3885
+ var _g = useState(false), proceedingToPayment = _g[0], setProceedingToPayment = _g[1];
3886
+ var _h = useState(false), paying = _h[0], setIsPaying = _h[1];
3887
+ var _j = useState(false), purchaseSucceeded = _j[0], setPurchaseSucceeded = _j[1];
3888
+ // Queries
3889
+ var priceListData = useQuery({
3890
+ queryKey: ["priceList", priceListCode],
3891
+ queryFn: function () { return getPriceList({ token: token, subdomain: subdomain, code: priceListCode }); },
3892
+ }).data;
3893
+ function handleSubmit(formData) {
3894
+ return __awaiter(this, void 0, void 0, function () {
3895
+ var data;
3896
+ return __generator(this, function (_a) {
3897
+ switch (_a.label) {
3898
+ case 0:
3899
+ setProceedingToPayment(true);
3900
+ setFormData(formData);
3901
+ return [4 /*yield*/, quoteAccountSignup({
3902
+ token: token,
3903
+ subdomain: subdomain,
3904
+ entityId: entityId,
3905
+ priceListCode: priceListCode,
3906
+ accountName: formData.accountName,
3907
+ billingContact: {
3908
+ firstName: formData.firstName,
3909
+ lastName: formData.lastName,
3910
+ email: formData.email,
3911
+ },
3912
+ })];
3913
+ case 1:
3914
+ data = _a.sent();
3915
+ setAccountId(data.account.id);
3916
+ setQuoteId(data.quoteId);
3917
+ setProceedingToPayment(false);
3918
+ setQuote({
3919
+ amountDue: data.amount,
3920
+ currencyId: data.currencyId,
3921
+ });
3922
+ return [2 /*return*/];
3923
+ }
3924
+ });
3925
+ });
3926
+ }
3927
+ function handlePaymentSaveSuccess(paymentSuccess) {
3928
+ var _a;
3929
+ return __awaiter(this, void 0, void 0, function () {
3930
+ var response, plugin;
3931
+ return __generator(this, function (_b) {
3932
+ switch (_b.label) {
3933
+ case 0:
3934
+ if (!formData) {
3935
+ throw new Error("Form data is required");
3936
+ }
3937
+ response = paymentSuccess.pluginPaymentResponse;
3938
+ plugin = response === null || response === void 0 ? void 0 : response.plugin;
3939
+ if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
3940
+ throw new Error("Plugin ID is required");
3941
+ }
3942
+ if (!accountId) {
3943
+ throw new Error("Account ID is required");
3944
+ }
3945
+ return [4 /*yield*/, accountSignup({
3946
+ token: token,
3947
+ subdomain: subdomain,
3948
+ entityId: entityId,
3949
+ quoteId: quoteId,
3950
+ paymentMethodId: (_a = paymentSuccess.savedPaymentMethodResponse) === null || _a === void 0 ? void 0 : _a.paymentMethodId.toString(),
3951
+ pluginId: plugin.id.toString(),
3952
+ priceListCode: priceListCode,
3953
+ accountId: accountId,
3954
+ })];
3955
+ case 1:
3956
+ _b.sent();
3957
+ setIsPaying(false);
3958
+ setPurchaseSucceeded(true);
3959
+ return [2 /*return*/];
3960
+ }
3961
+ });
3962
+ });
3963
+ }
3964
+ function handlePaymentFail(error) {
3965
+ showErrorNotification(error.message);
3966
+ setIsPaying(false);
3967
+ }
3968
+ if (isMobile) {
3969
+ return (jsx(Card, __assign({ className: "p-4 flex flex-col" }, { children: purchaseSucceeded ? (jsx(PaymentSuccessDisplay, { className: "w-full", amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, returnUrl: returnUrl })) : (jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col" : "flex-row", " h-full w-full") }, { children: [jsx("div", __assign({ className: "flex flex-col items-center" }, { children: jsx(PriceListDisplay, { priceListData: priceListData, topNavImageUrl: topNavImageUrl }) })), jsx("div", __assign({ className: "mx-8" }, { children: jsx(Divider, { className: "h-full" }) })), jsx("div", __assign({ className: "flex items-center justify-center my-12" }, { children: jsx(PaymentForms, { quote: quote, paying: paying, setIsPaying: setIsPaying, handlePaymentSaveSuccess: handlePaymentSaveSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId || "" }) }))] }))) })));
3970
+ }
3971
+ else {
3972
+ return (jsxs(Fragment, { children: [jsx(Card, __assign({ className: "p-4 flex flex-col w-screen h-screen" }, { children: purchaseSucceeded ? (jsx(PaymentSuccessDisplay, { className: "w-full", amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, returnUrl: returnUrl })) : (jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col" : "flex-row", " h-full w-full") }, { children: [jsx("div", __assign({ className: "flex flex-col w-1/2 items-center" }, { children: jsx(PriceListDisplay, { priceListData: priceListData, topNavImageUrl: topNavImageUrl }) })), jsx("div", __assign({ className: "my-4" }, { children: jsx(Divider, { className: "h-full", type: "vertical" }) })), jsx("div", __assign({ className: "flex w-1/2 items-center justify-center my-12" }, { children: jsx(PaymentForms, { quote: quote, paying: paying, setIsPaying: setIsPaying, handlePaymentSaveSuccess: handlePaymentSaveSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId || "" }) }))] }))) })), jsx(Footer, {})] }));
3973
+ }
3974
+ }
3975
+
3678
3976
  var StateTag = function (_a) {
3679
3977
  var state = _a.state;
3680
3978
  return jsx(Tag, __assign({ color: getColor(state) }, { children: capitalize(startCase(state)) }));
@@ -3709,12 +4007,13 @@ var TransactionGridCell = styled.div.withConfig({
3709
4007
  shouldForwardProp: function (prop) {
3710
4008
  return !["gridColumn", "padding", "right"].includes(prop);
3711
4009
  },
3712
- })(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"], ["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"])), function (props) { return props.gridColumn && "grid-column: ".concat(props.gridColumn, ";"); }, function (props) { return (props.right ? "flex-end" : "flex-start"); }, function (props) { return (props.right ? "right" : "left"); }, SLATE_600);
3713
- var templateObject_1$4;
4010
+ })(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"], ["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"])), function (props) { return props.gridColumn && "grid-column: ".concat(props.gridColumn, ";"); }, function (props) { return (props.right ? "flex-end" : "flex-start"); }, function (props) { return (props.right ? "right" : "left"); }, SLATE_600);
4011
+ var templateObject_1$3;
3714
4012
 
4013
+ var Text$8 = Typography.Text;
3715
4014
  var TransactionDate = function (_a) {
3716
4015
  var date = _a.date;
3717
- return jsx("div", { children: Misc.formatDate(date) });
4016
+ return jsx(Text$8, __assign({ className: "text-sm" }, { children: Misc.formatDate(date) }));
3718
4017
  };
3719
4018
 
3720
4019
  var isInvoice = function (transaction) {
@@ -3729,8 +4028,15 @@ var TransactionRowTitle = function (_a) {
3729
4028
  return (jsx("span", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: invoice.number })));
3730
4029
  };
3731
4030
 
4031
+ // TODO: delete
4032
+ var ArrowDownToLine = function (_a) {
4033
+ var className = _a.className, _b = _a.color, color = _b === void 0 ? SLATE_600 : _b;
4034
+ return (jsxs("svg", __assign({ className: className, fill: "none", height: "16", viewBox: "0 0 16 16", width: "16", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsx("path", { d: "M8 11.3333V2", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M4 7.33301L8 11.333L12 7.33301", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M12.6654 14H3.33203", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
4035
+ };
4036
+
3732
4037
  var TransactionDownload = function (_a) {
3733
4038
  var transaction = _a.transaction, token = _a.token, subdomain = _a.subdomain;
4039
+ var darkMode = useContext(BunnyContext).darkMode;
3734
4040
  var downloadFile = useDownloadFile();
3735
4041
  var isMobile = useIsMobile$1();
3736
4042
  var isClickable = transaction.kind === "INVOICE";
@@ -3739,11 +4045,12 @@ var TransactionDownload = function (_a) {
3739
4045
  return (jsx("div", __assign({ onClick: function (e) {
3740
4046
  e.stopPropagation();
3741
4047
  downloadFile("".concat(subdomain, "/api/pdf/invoice/").concat(transaction.transactionableId), token);
3742
- } }, { children: jsx(ArrowDownToLine, { className: isMobile ? "" : "show-on-hover" }) })));
4048
+ } }, { children: jsx(ArrowDownToLine, { className: "".concat(isMobile ? "" : "show-on-hover"), color: darkMode ? WHITE : SLATE_600 }) })));
3743
4049
  };
3744
4050
 
4051
+ var Text$7 = Typography.Text;
3745
4052
  var TransactionsEmptyState = function () {
3746
- return (jsx("div", __assign({ className: "flex justify-center p-4 text-base" }, { children: "There are no invoices" })));
4053
+ return (jsx(Text$7, __assign({ className: "flex justify-center p-4 text-base" }, { children: "There are no invoices" })));
3747
4054
  };
3748
4055
 
3749
4056
  var TransactionsListContext = createContext({});
@@ -3807,10 +4114,11 @@ var useGraphQLRequest = function () { return function (query, token, variables)
3807
4114
  });
3808
4115
  }); }; };
3809
4116
 
4117
+ var Text$6 = Typography.Text;
3810
4118
  var TransactionsListDesktop = function (_a) {
3811
4119
  var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
3812
4120
  var columns = useContext(TransactionsListContext).columns;
3813
- var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
4121
+ var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, darkMode = _b.darkMode;
3814
4122
  var showAmount = columns.includes("amount");
3815
4123
  var showDateAndTitle = columns.includes("date-and-title");
3816
4124
  var showDownload = columns.includes("download");
@@ -3822,15 +4130,18 @@ var TransactionsListDesktop = function (_a) {
3822
4130
  return (jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
3823
4131
  onTransactionClick(transaction);
3824
4132
  }, style: {
3825
- backgroundColor: index % 2 === 0 ? "white" : "rgba(100, 116, 139, 0.04)",
3826
- } }, { children: [showDateAndTitle && (jsxs(Fragment, { children: [jsx(TransactionGridCell, __assign({ right: false }, { children: jsx(TransactionDate, { date: transaction.createdAt }) })), jsxs(TransactionGridCell, __assign({ right: false, className: "flex items-center gap-2" }, { children: [jsx("div", { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsx(TransactionRowTitle, { transaction: transaction })] }))] })), showDownload && (jsx(TransactionGridCell, { children: jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })), showState && (jsx(TransactionGridCell, __assign({ right: true }, { children: jsx(StateTag, { state: transaction.state }) }))), showAmount && (jsx(TransactionGridCell, __assign({ right: true }, { children: Misc.formatCurrency(transaction.transactionable.amount || transaction.amount, transaction.currencyId) })))] }), index));
4133
+ backgroundColor: index % 2 === 0
4134
+ ? "var(--row-background".concat(darkMode ? "-dark" : "", ")")
4135
+ : "var(--row-background-alternate".concat(darkMode ? "-dark" : "", ")"),
4136
+ } }, { children: [showDateAndTitle && (jsxs(Fragment, { children: [jsx(TransactionGridCell, __assign({ right: false }, { children: jsx(TransactionDate, { date: transaction.createdAt }) })), jsxs(TransactionGridCell, __assign({ right: false, className: "flex items-center gap-2" }, { children: [jsx(Text$6, { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsx(TransactionRowTitle, { transaction: transaction })] }))] })), showDownload && (jsx(TransactionGridCell, { children: jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })), showState && (jsx(TransactionGridCell, __assign({ right: true }, { children: jsx(StateTag, { state: transaction.state }) }))), showAmount && (jsx(TransactionGridCell, __assign({ right: true }, { children: jsx(Text$6, { children: Misc.formatCurrency(transaction.transactionable.amount || transaction.amount, transaction.currencyId) }) })))] }), index));
3827
4137
  });
3828
4138
  };
3829
4139
 
4140
+ var Text$5 = Typography.Text;
3830
4141
  var TransactionsListMobile = function (_a) {
3831
4142
  var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
3832
4143
  var columns = useContext(TransactionsListContext).columns;
3833
- var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
4144
+ var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, darkMode = _b.darkMode;
3834
4145
  var showAmount = columns.includes("amount");
3835
4146
  var showDateAndTitle = columns.includes("date-and-title");
3836
4147
  var showDownload = columns.includes("download");
@@ -3842,8 +4153,10 @@ var TransactionsListMobile = function (_a) {
3842
4153
  return (jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
3843
4154
  onTransactionClick(transaction);
3844
4155
  }, style: {
3845
- backgroundColor: index % 2 === 0 ? "white" : "rgba(100, 116, 139, 0.04)",
3846
- } }, { children: [jsx(TransactionGridCell, { children: jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsxs(Fragment, { children: [jsx("div", { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsx(StateTag, { state: transaction.state })] })), jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsx(TransactionDate, { date: transaction.createdAt })), showAmount && showDateAndTitle && jsx("div", { children: "\u00B7" }), showAmount && (jsx("div", { children: Misc.formatCurrency(transaction.transactionable.amount, transaction.currencyId) }))] }))] })) }), showDownload && (jsx(TransactionGridCell, __assign({ right: true }, { children: jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })))] }), index));
4156
+ backgroundColor: index % 2 === 0
4157
+ ? "var(--row-background".concat(darkMode ? "-dark" : "", ")")
4158
+ : "var(--row-background-alternate".concat(darkMode ? "-dark" : "", ")"),
4159
+ } }, { children: [jsx(TransactionGridCell, { children: jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsxs(Fragment, { children: [jsx(Text$5, { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsx(StateTag, { state: transaction.state })] })), jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsx(TransactionDate, { date: transaction.createdAt })), showAmount && showDateAndTitle && jsx(Text$5, { children: "\u00B7" }), showAmount && (jsx(Text$5, { children: Misc.formatCurrency(transaction.transactionable.amount, transaction.currencyId) }))] }))] })) }), showDownload && (jsx(TransactionGridCell, __assign({ right: true }, { children: jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })))] }), index));
3847
4160
  });
3848
4161
  };
3849
4162
 
@@ -3865,6 +4178,7 @@ var getTransactions = function (filter, token, subdomain, kindsToShow) { return
3865
4178
  })];
3866
4179
  case 1:
3867
4180
  response = _d.sent();
4181
+ console.log("response", response);
3868
4182
  return [4 /*yield*/, response.json()];
3869
4183
  case 2:
3870
4184
  _a = _d.sent(), data = _a.data, errors = _a.errors;
@@ -3892,6 +4206,7 @@ var PageContent = function (_a) {
3892
4206
  return (jsx("div", __assign({ className: className, ref: pageContentRef, style: style }, { children: children })));
3893
4207
  };
3894
4208
 
4209
+ var Text$4 = Typography.Text;
3895
4210
  var PageHeaderWithActions = function (_a) {
3896
4211
  var children = _a.children, title = _a.title;
3897
4212
  var isMobile = useIsMobile$1();
@@ -3900,11 +4215,12 @@ var PageHeaderWithActions = function (_a) {
3900
4215
  var PageSubTitle = function (_a) {
3901
4216
  var title = _a.title;
3902
4217
  var secondaryColor = useContext(BrandContext).secondaryColor;
3903
- return (jsx("div", __assign({ className: "shrink-0 font-medium", style: { color: secondaryColor } }, { children: title })));
4218
+ var darkMode = useContext(BunnyContext).darkMode;
4219
+ return (jsx(Text$4, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title })));
3904
4220
  };
3905
4221
 
3906
4222
  function ActualTransactions() {
3907
- var _a = useContext(TransactionsListContext), showSearchBar = _a.showSearchBar, showTitle = _a.showTitle, transactionComponent = _a.transactionComponent, useModal = _a.useModal, onTransactionClick = _a.onTransactionClick, suppressTransactionDisplay = _a.suppressTransactionDisplay, kindsToShow = _a.kindsToShow, className = _a.className, shadow = _a.shadow, searchBarClassName = _a.searchBarClassName;
4223
+ var _a = useContext(TransactionsListContext), showSearchBar = _a.showSearchBar, showTitle = _a.showTitle, transactionComponent = _a.transactionComponent, useModal = _a.useModal, onTransactionClick = _a.onTransactionClick, suppressTransactionDisplay = _a.suppressTransactionDisplay, kindsToShow = _a.kindsToShow, className = _a.className, shadow = _a.shadow; _a.searchBarClassName; var style = _a.style;
3908
4224
  // Context
3909
4225
  var columns = useContext(TransactionsListContext).columns;
3910
4226
  var _b = useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
@@ -3965,16 +4281,26 @@ function ActualTransactions() {
3965
4281
  }
3966
4282
  return templateColumns.join(" ");
3967
4283
  };
3968
- return (jsxs(Fragment, { children: [jsx(PageHeaderWithActions, __assign({ title: showTitle ? "Past transactions" : undefined }, { children: showSearchBar && (jsx("div", { children: jsx(Input, { className: searchBarClassName
3969
- ? searchBarClassName
3970
- : "bg-white border border-slate-200", onChange: function (e) {
4284
+ return (jsxs("div", __assign({ style: style }, { children: [jsx(PageHeaderWithActions, __assign({ title: showTitle ? "Past transactions" : undefined }, { children: showSearchBar && (jsx("div", { children: jsx(Input
4285
+ // className={
4286
+ // searchBarClassName
4287
+ // ? searchBarClassName
4288
+ // : "border border-slate-200"
4289
+ // }
4290
+ , {
4291
+ // className={
4292
+ // searchBarClassName
4293
+ // ? searchBarClassName
4294
+ // : "border border-slate-200"
4295
+ // }
4296
+ onChange: function (e) {
3971
4297
  if (isNaN(Number(e.target.value))) {
3972
4298
  return;
3973
4299
  }
3974
4300
  setSearch(e.target.value);
3975
4301
  }, prefix: jsx(SearchOutlined$1, {}), placeholder: "Search by id #", style: {
3976
4302
  minWidth: "300px",
3977
- }, value: search }) })) })), jsx(PageContent, __assign({ className: "flex w-full shadow-padding-xb ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: jsx("div", __assign({ className: "grid w-full bg-white rounded-md overflow-auto ".concat("shadow-".concat(shadow)), style: {
4303
+ }, value: search }) })) })), jsx(PageContent, __assign({ className: "flex w-full shadow-padding-xb ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: jsx("div", __assign({ className: "grid w-full rounded-md overflow-auto ".concat("shadow-".concat(shadow)), style: {
3978
4304
  gridTemplateColumns: gridTemplateColumns(),
3979
4305
  } }, { children: isMobile ? (jsx(Fragment, { children: TransactionsListMobile({
3980
4306
  transactions: transactions,
@@ -3982,7 +4308,7 @@ function ActualTransactions() {
3982
4308
  }) })) : (jsx(Fragment, { children: TransactionsListDesktop({
3983
4309
  transactions: transactions,
3984
4310
  onTransactionClick: handleTransactionClick,
3985
- }) })) })) })), useModal ? (jsx(Modal, __assign({ title: "Basic Modal", open: drawerOpen, onOk: function () { return setDrawerOpen(false); }, onCancel: function () { return setDrawerOpen(false); }, width: 900, footer: null }, { children: jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || "" }) }))) : (jsx(Drawer, __assign({ title: "Invoice", onClose: function () { return setDrawerOpen(false); }, open: drawerOpen, width: 900 }, { children: transactionComponent ? (transactionComponent) : (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind) === "INVOICE" ? (jsx(Invoice, { id: selectedTransaction.transactionableId })) : (jsx("div", { children: "Not an invoice, or no transaction selected" })) })))] }));
4311
+ }) })) })) })), useModal ? (jsx(Modal, __assign({ title: "Basic Modal", open: drawerOpen, onOk: function () { return setDrawerOpen(false); }, onCancel: function () { return setDrawerOpen(false); }, width: 900, footer: null }, { children: jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || "" }) }))) : (jsx(Drawer, __assign({ title: "Invoice", onClose: function () { return setDrawerOpen(false); }, open: drawerOpen, width: 900 }, { children: transactionComponent ? (transactionComponent) : (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind) === "INVOICE" ? (jsx(Invoice, { id: selectedTransaction.transactionableId })) : (jsx("div", { children: "Not an invoice, or no transaction selected" })) })))] })));
3986
4312
  }
3987
4313
  // Create a client
3988
4314
  var queryClient = new QueryClient();
@@ -3992,7 +4318,7 @@ function Transactions(_a) {
3992
4318
  TransactionKind.PAYMENT,
3993
4319
  TransactionKind.REFUND,
3994
4320
  TransactionKind.WRITE_OFF,
3995
- ] : _h;
4321
+ ] : _h, style = _a.style;
3996
4322
  var contextValues = {
3997
4323
  showSearchBar: showSearchBar,
3998
4324
  showTitle: showTitle,
@@ -4005,6 +4331,7 @@ function Transactions(_a) {
4005
4331
  onTransactionClick: onTransactionClick,
4006
4332
  suppressTransactionDisplay: suppressTransactionDisplay,
4007
4333
  kindsToShow: kindsToShow,
4334
+ style: style,
4008
4335
  };
4009
4336
  return (jsx(QueryClientProvider, __assign({ client: queryClient }, { children: jsx(TransactionsListContext.Provider, __assign({ value: contextValues }, { children: jsx(ActualTransactions, {}) })) })));
4010
4337
  }
@@ -4470,29 +4797,7 @@ var ErrorView = function (_a) {
4470
4797
  return (jsxs("div", __assign({ className: "flex flex-col w-full", style: { marginTop: "80px" } }, { children: [jsx("div", __assign({ style: { fontSize: "32px" } }, { children: message })), children] })));
4471
4798
  };
4472
4799
 
4473
- var BunnyFooterIcon = function (_a) {
4474
- var color = _a.color;
4475
- return (jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsx("path", { className: "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: "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: "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: "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: "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: "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", __assign({ id: "clip0_6_851" }, { children: jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
4476
- };
4477
-
4478
- var Footer = function () {
4479
- var _a = useCurrentUserData(), privacyUrl = _a.privacyUrl, termsUrl = _a.termsUrl;
4480
- var isMobile = useIsMobile$1();
4481
- var quotePreviewData = useRecoilValue(planPickerQuoteDataState);
4482
- var selectedPriceList = quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList;
4483
- if (selectedPriceList && isMobile)
4484
- return null;
4485
- return (jsxs("div", __assign({ className: "flex items-center justify-between shrink-0 ".concat(isMobile ? "flex-col gap-2 grow" : "px-12") }, { children: [(termsUrl || privacyUrl) && (jsxs("div", __assign({ className: "flex items-center gap-3" }, { children: [termsUrl && (jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Terms" }))), privacyUrl && (jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Privacy" })))] }))), jsx(BunnyMarketingLink, {})] })));
4486
- };
4487
- var BunnyMarketingLink = function () {
4488
- var _a = useState(false), isHovered = _a[0], setIsHovered = _a[1];
4489
- var isMobile = useIsMobile$1();
4490
- return (jsx("div", __assign({ className: "flex items-end justify-end ".concat(isMobile ? "" : "grow") }, { children: jsx(StyledBunnyLink, __assign({ className: "flex items-end justify-end text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: jsxs("div", __assign({ className: "flex items-center", onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: ["Powered by\u00A0", jsx("div", __assign({ style: { paddingTop: "5px" } }, { children: jsx(BunnyFooterIcon, { color: isHovered ? PRIMARY_COLOR : SLATE_400 }) }))] })) })) })));
4491
- };
4492
- var StyedLink = styled.a(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"], ["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"])), SLATE_400, SLATE_500);
4493
- var StyledBunnyLink = styled(StyedLink)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n color: ", " !important;\n }\n"], ["\n &:hover {\n color: ", " !important;\n }\n"])), PRIMARY_COLOR);
4494
- var templateObject_1$3, templateObject_2;
4495
-
4800
+ var Text$3 = Typography.Text;
4496
4801
  var HideExpiredToggle = function (_a) {
4497
4802
  var hideExpired = _a.hideExpired, setHideExpired = _a.setHideExpired, subscriptions = _a.subscriptions;
4498
4803
  var isMobile = useIsMobile$1();
@@ -4506,16 +4811,11 @@ var HideExpiredToggle = function (_a) {
4506
4811
  return null;
4507
4812
  return (jsxs("div", __assign({ className: "flex items-center gap-4 pl-4" }, { children: [!isMobile && jsx(Divider, { className: "h-5", type: "vertical" }), jsx(StyledCheckbox, { children: jsx(Checkbox, __assign({ checked: hideExpired, onChange: function (e) { return setHideExpired(e.target.checked); }, style: {
4508
4813
  color: secondaryColor,
4509
- } }, { children: isMobile ? "Hide inactive" : "Hide inactive subscriptions" })) })] })));
4814
+ } }, { children: jsx(Text$3, { children: isMobile ? "Hide inactive" : "Hide inactive subscriptions" }) })) })] })));
4510
4815
  };
4511
4816
  var StyledCheckbox = styled.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n .ant-checkbox-wrapper span {\n padding-inline-end: 0 !important;\n }\n"], ["\n .ant-checkbox-wrapper span {\n padding-inline-end: 0 !important;\n }\n"])));
4512
4817
  var templateObject_1$2;
4513
4818
 
4514
- var SubscriptionsListCell = function (_a) {
4515
- var children = _a.children, className = _a.className, gridColumn = _a.gridColumn, right = _a.right, style = _a.style;
4516
- return (jsx("div", __assign({ className: "flex items-center text-sm whitespace-nowrap ".concat(className), style: __assign({ gridColumn: gridColumn, textAlign: right ? "right" : "left", justifyContent: right ? "flex-end" : "flex-start" }, style) }, { children: children })));
4517
- };
4518
-
4519
4819
  var SubscriptionState;
4520
4820
  (function (SubscriptionState) {
4521
4821
  SubscriptionState["ACTIVE"] = "ACTIVE";
@@ -4526,195 +4826,20 @@ var SubscriptionState;
4526
4826
  })(SubscriptionState || (SubscriptionState = {}));
4527
4827
  var SubscriptionState$1 = SubscriptionState;
4528
4828
 
4529
- var Card = function (_a) {
4530
- var children = _a.children, className = _a.className;
4531
- return (jsx("div", __assign({ className: "flex flex-col bg-white rounded-md shadow-md ".concat(className) }, { children: children })));
4532
- };
4533
-
4534
- var MUTATION = "\nmutation quoteSubscriptionReinstate($ids: [ID!]!) {\n quoteSubscriptionReinstate(ids: $ids) {\n quote {\n id\n uuid\n accountId\n dealId\n name\n amount\n taxAmount\n discount\n netPaymentDays\n acceptedByName\n acceptedByTitle\n state\n billingDay\n evergreen\n requiresApproval\n isPendingApprovalRequest\n poNumber\n kind\n currencyId\n ownerId\n contactId\n quoteChanges {\n id\n priceListId\n charges {\n id\n pricingModel\n chargeType\n billingPeriod\n price\n priceDecimals\n tieredAveragePrice\n quantity\n quantityMin\n quantityMax\n discount\n amount\n prorationRate\n name\n invoiceLineText\n createdAt\n updatedAt\n startDate\n endDate\n billingPeriodAmounts { id amount prorationRate }\n currencyId\n couponId\n feature { id name code isUnit unitName }\n priceTiers { starts price }\n }\n }\n expiresAt\n createdAt\n updatedAt\n startDate\n endDate\n invoiceUntil\n applicationDate\n applied\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n notes\n message\n amountsByPeriod {\n id\n name\n amount\n }\n subtotal\n credits\n discountValue\n }\n }\n}\n";
4535
- var getGuoteSubscriptionReinstate = function (_a) {
4536
- var ids = _a.ids, token = _a.token, subdomain = _a.subdomain;
4829
+ var FEATURE_USAGE_MUTATION = "\nquery GetFeatureUsage($id: ID!) {\n featureUsageHistogram(subscriptionChargeId: $id) {\n subscriptionCharge { \n id\n name\n amount\n currentPeriodPriceByTiers { \n tier { starts price } \n quantity\n amount\n }\n }\n feature { id name }\n periodRange\n dataInterval\n data {\n periodStart\n periodEnd\n intervals {\n intervalStart\n intervalUsage\n }\n intervalsTotal\n }\n }\n}\n";
4830
+ var getFeatureUsage = function (_a) {
4831
+ var subscriptionChargeId = _a.subscriptionChargeId; _a.startDate; _a.endDate; _a.dataInterval; var token = _a.token;
4537
4832
  return __awaiter(void 0, void 0, void 0, function () {
4538
- var vars, response, _b, errors, quote;
4833
+ var vars, response;
4834
+ var _b;
4539
4835
  return __generator(this, function (_c) {
4540
4836
  switch (_c.label) {
4541
4837
  case 0:
4542
- vars = { ids: ids };
4838
+ vars = {
4839
+ id: subscriptionChargeId,
4840
+ };
4543
4841
  return [4 /*yield*/, gqlRequest({
4544
- query: MUTATION,
4545
- token: token,
4546
- vars: vars,
4547
- subdomain: subdomain,
4548
- })];
4549
- case 1:
4550
- response = _c.sent();
4551
- _b = response === null || response === void 0 ? void 0 : response.quoteSubscriptionReinstate, errors = _b.errors, quote = _b.quote;
4552
- if (errors)
4553
- throw errors;
4554
- return [2 /*return*/, quote];
4555
- }
4556
- });
4557
- });
4558
- };
4559
-
4560
- var useCancelSubscription = function () {
4561
- var graphQLRequest = useGraphQLRequest();
4562
- return function (subscriptionIds, token) { return __awaiter(void 0, void 0, void 0, function () {
4563
- var data;
4564
- var _a;
4565
- return __generator(this, function (_b) {
4566
- switch (_b.label) {
4567
- case 0: return [4 /*yield*/, graphQLRequest("\n mutation SubscriptionCancel($subscriptionIds: [ID!]!) {\n subscriptionCancel(ids: $subscriptionIds) {\n subscriptions {\n accountId\n state\n }\n }\n }", token, { subscriptionIds: subscriptionIds })];
4568
- case 1:
4569
- data = _b.sent();
4570
- return [2 /*return*/, (_a = data === null || data === void 0 ? void 0 : data.subscriptions) === null || _a === void 0 ? void 0 : _a.nodes];
4571
- }
4572
- });
4573
- }); };
4574
- };
4575
-
4576
- var SubscriptionCardActions = function (_a) {
4577
- var _b, _c;
4578
- var planChangeOptions = _a.planChangeOptions, subscription = _a.subscription, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible;
4579
- // Context
4580
- var _d = useContext(BunnyContext), token = _d.token, subdomain = _d.subdomain;
4581
- var _e = useContext(SubscriptionsContext), onChangePlanClick = _e.onChangePlanClick, onClickUpgrade = _e.onClickUpgrade, isTempViewOnly = _e.isTempViewOnly;
4582
- // Hooks
4583
- var showSuccessNotification = NotificationUtils.useSuccessNotification();
4584
- var cancelSubscription = useCancelSubscription();
4585
- var queryClient = useQueryClient();
4586
- // const navigate = usePortalNavigate();
4587
- // const handleUpgradingSubscriptionChange =
4588
- // useHandleUpgradingSubscriptionChange();
4589
- // Derived state
4590
- var canShowCancelButton = subscription.plan.selfServiceCancel;
4591
- var productPlans = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.filter(function (plan) { var _a; return ((_a = plan.priceLists) === null || _a === void 0 ? void 0 : _a.length) > 0 && plan.productId === subscription.product.id; });
4592
- var canShowChangePlanButton = ((productPlans === null || productPlans === void 0 ? void 0 : productPlans.length) || 0) > 0;
4593
- // Mutations
4594
- var subscriptionCancel = useMutation({
4595
- mutationFn: function () { return cancelSubscription([subscription.id], token); },
4596
- onSuccess: function () {
4597
- queryClient.invalidateQueries({
4598
- queryKey: QueryKeyFactory.default.createTableKey("subscriptions"),
4599
- });
4600
- showSuccessNotification("Subscription canceled");
4601
- },
4602
- });
4603
- useMutation({
4604
- mutationFn: function () {
4605
- return getGuoteSubscriptionReinstate({
4606
- ids: [subscription.id],
4607
- token: token,
4608
- subdomain: subdomain,
4609
- });
4610
- },
4611
- onSuccess: function (quote) {
4612
- setEditingQuoteData({ id: quote.id, isTrial: false });
4613
- setPayModalVisible(true);
4614
- },
4615
- });
4616
- // Handlers
4617
- var handleChangePlanClick = function () {
4618
- // handleUpgradingSubscriptionChange({
4619
- // subscription,
4620
- // });
4621
- console.log("handleChangePlanClick handleUpgradingSubscriptionChange not implemented");
4622
- // navigate("plan-manager", {
4623
- // subscriptionUpgradeId: subscription.id,
4624
- // });
4625
- onChangePlanClick();
4626
- };
4627
- return (canShowChangePlanButton || canShowCancelButton) &&
4628
- canShowSubscriptionActions(subscription) ? (jsxs(Fragment, { children: [!isTempViewOnly && canShowCancelButton && (jsx(Popconfirm, __assign({ icon: null, onConfirm: function () { return subscriptionCancel.mutate(); }, title: "Cancel subscription" }, { children: jsx(Button, __assign({ className: "p-0", type: "link" }, { children: "Cancel subscription" })) }))), !isTempViewOnly && canShowChangePlanButton && (jsx(Button, __assign({ onClick: function () { return handleChangePlanClick(); }, type: "primary" }, { children: "Change plan" })))] })) : ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.TRIAL ? (jsx(Fragment, { children: !isTempViewOnly && (jsx(Button, __assign({ onClick: function () {
4629
- // handleUpgradingSubscriptionChange({
4630
- // subscription,
4631
- // });
4632
- console.log("onClickUpgrade handleUpgradingSubscriptionChange not implemented");
4633
- // navigate("plan-manager", {
4634
- // subscriptionUpgradeId: subscription.id,
4635
- // });
4636
- onClickUpgrade();
4637
- }, type: "primary" }, { children: "Upgrade" }))) })) : null;
4638
- };
4639
-
4640
- var getSubscriptionStatusText = function (subscription) {
4641
- var cancellationDate = subscription.cancellationDate, state = subscription.state, evergreen = subscription.evergreen, endDate = subscription.endDate;
4642
- if (cancellationDate &&
4643
- (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== SubscriptionState$2.CANCELED &&
4644
- (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== SubscriptionState$2.EXPIRED) {
4645
- return (jsxs(Tag, __assign({ color: "red" }, { children: ["Canceled - ends on ", Misc.formatDate(cancellationDate)] })));
4646
- }
4647
- if (evergreen) {
4648
- return "Renews on ".concat(Misc.formatDate(endDate));
4649
- }
4650
- if ((state === null || state === void 0 ? void 0 : state.toUpperCase()) === SubscriptionState$2.CANCELED ||
4651
- (state === null || state === void 0 ? void 0 : state.toUpperCase()) === SubscriptionState$2.EXPIRED) {
4652
- return "Ended on ".concat(Misc.formatDate(endDate));
4653
- }
4654
- return "Ends on ".concat(Misc.formatDate(endDate));
4655
- };
4656
- var SubscriptionCardHeader = function (_a) {
4657
- var _b, _c, _d, _e, _f;
4658
- var planChangeOptions = _a.planChangeOptions, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible, subscription = _a.subscription;
4659
- var isMobile = useIsMobile$1();
4660
- // Derived state
4661
- var trialDaysLeft = dayjs(subscription.trialEndDate).diff(dayjs(), "days");
4662
- var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL;
4663
- return (jsxs("div", __assign({ className: "flex items-center justify-between" }, { children: [jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsx("div", __assign({ className: "font-medium text-orange-500", style: { fontSize: "11px" } }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsx("span", __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxs(Tag, __assign({ className: "ant-tag-".concat(TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()]) }, { children: [capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsx("div", __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile && (jsx(SubscriptionCardActions, { planChangeOptions: planChangeOptions, subscription: subscription, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible }))] }))] })));
4664
- };
4665
-
4666
- var SubscriptionCardColumnHeaders = function (_a) {
4667
- var columns = _a.columns;
4668
- return columns.map(function (subscriptionColumn, index) { return (jsx("div", __assign({ className: "text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: "11px" } }, { children: subscriptionColumn.title }), index)); });
4669
- };
4670
-
4671
- var BillingPeriodConverter;
4672
- (function (BillingPeriodConverter) {
4673
- BillingPeriodConverter["ONCE"] = "once";
4674
- BillingPeriodConverter["MONTHLY"] = "monthly";
4675
- BillingPeriodConverter["ANNUAL"] = "annually";
4676
- BillingPeriodConverter["SEMI_ANNUAL"] = "semi annually";
4677
- BillingPeriodConverter["QUARTERLY"] = "quarterly";
4678
- })(BillingPeriodConverter || (BillingPeriodConverter = {}));
4679
- var SubscriptionChargeTotal = function (_a) {
4680
- var charge = _a.charge, subscription = _a.subscription;
4681
- var isMobile = useIsMobile$1();
4682
- return (jsxs("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: [jsx("div", { children: Misc.formatCurrency(Number(charge.periodPrice), subscription.currencyId) }), charge.billingPeriod && (jsx("div", { children: BillingPeriodConverter[charge.billingPeriod] }))] })));
4683
- };
4684
-
4685
- var SubscriptionChargeUnitPrice = function (_a) {
4686
- var _b, _c;
4687
- var charge = _a.charge, subscription = _a.subscription;
4688
- var _d = useState(false), showPriceTiers = _d[0], setShowPriceTiers = _d[1];
4689
- if ((_c = (_b = charge.priceListCharge) === null || _b === void 0 ? void 0 : _b.priceListChargeTiers) === null || _c === void 0 ? void 0 : _c.length) {
4690
- return (jsx(Dropdown, __assign({ dropdownRender: function () {
4691
- var _a, _b;
4692
- return (jsx("div", __assign({ className: "flex flex-col rounded border border-solid border-slate-200 bg-white p-2" }, { children: jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b.map(function (tier, index) {
4693
- var _a, _b, _c, _d, _e;
4694
- var ends = ((_c = (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b[index + 1]) === null || _c === void 0 ? void 0 : _c.starts)
4695
- ? ((_e = (_d = charge.priceListCharge) === null || _d === void 0 ? void 0 : _d.priceListChargeTiers[index + 1]) === null || _e === void 0 ? void 0 : _e.starts) - 1
4696
- : "∞";
4697
- return (jsxs("div", __assign({ className: "contents" }, { children: [jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " ", ":"] })), jsx("div", __assign({ className: "whitespace-nowrap text-right" }, { children: Misc.formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
4698
- }) })) })));
4699
- }, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsx("div", __assign({ className: "cursor-pointer underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "hide details" : "show details" })) })));
4700
- }
4701
- return (jsx(Fragment, { children: Misc.formatCurrency(charge.discountedPrice, subscription.currencyId) }));
4702
- };
4703
-
4704
- var FEATURE_USAGE_MUTATION = "\nquery GetFeatureUsage($id: ID!) {\n featureUsageHistogram(subscriptionChargeId: $id) {\n subscriptionCharge { \n id\n name\n amount\n currentPeriodPriceByTiers { \n tier { starts price } \n quantity\n amount\n }\n }\n feature { id name }\n periodRange\n dataInterval\n data {\n periodStart\n periodEnd\n intervals {\n intervalStart\n intervalUsage\n }\n intervalsTotal\n }\n }\n}\n";
4705
- var getFeatureUsage = function (_a) {
4706
- var subscriptionChargeId = _a.subscriptionChargeId; _a.startDate; _a.endDate; _a.dataInterval; var token = _a.token;
4707
- return __awaiter(void 0, void 0, void 0, function () {
4708
- var vars, response;
4709
- var _b;
4710
- return __generator(this, function (_c) {
4711
- switch (_c.label) {
4712
- case 0:
4713
- vars = {
4714
- id: subscriptionChargeId,
4715
- };
4716
- return [4 /*yield*/, gqlRequest({
4717
- query: FEATURE_USAGE_MUTATION,
4842
+ query: FEATURE_USAGE_MUTATION,
4718
4843
  token: token,
4719
4844
  vars: vars,
4720
4845
  })];
@@ -4885,6 +5010,191 @@ var FeatureBarChart = function (_a) {
4885
5010
  var StyledBarChart = styled(BarChart)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .recharts-surface {\n overflow: visible;\n }\n"], ["\n .recharts-surface {\n overflow: visible;\n }\n"])));
4886
5011
  var templateObject_1;
4887
5012
 
5013
+ var MUTATION = "\nmutation quoteSubscriptionReinstate($ids: [ID!]!) {\n quoteSubscriptionReinstate(ids: $ids) {\n quote {\n id\n uuid\n accountId\n dealId\n name\n amount\n taxAmount\n discount\n netPaymentDays\n acceptedByName\n acceptedByTitle\n state\n billingDay\n evergreen\n requiresApproval\n isPendingApprovalRequest\n poNumber\n kind\n currencyId\n ownerId\n contactId\n quoteChanges {\n id\n priceListId\n charges {\n id\n pricingModel\n chargeType\n billingPeriod\n price\n priceDecimals\n tieredAveragePrice\n quantity\n quantityMin\n quantityMax\n discount\n amount\n prorationRate\n name\n invoiceLineText\n createdAt\n updatedAt\n startDate\n endDate\n billingPeriodAmounts { id amount prorationRate }\n currencyId\n couponId\n feature { id name code isUnit unitName }\n priceTiers { starts price }\n }\n }\n expiresAt\n createdAt\n updatedAt\n startDate\n endDate\n invoiceUntil\n applicationDate\n applied\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n notes\n message\n amountsByPeriod {\n id\n name\n amount\n }\n subtotal\n credits\n discountValue\n }\n }\n}\n";
5014
+ var getGuoteSubscriptionReinstate = function (_a) {
5015
+ var ids = _a.ids, token = _a.token, subdomain = _a.subdomain;
5016
+ return __awaiter(void 0, void 0, void 0, function () {
5017
+ var vars, response, _b, errors, quote;
5018
+ return __generator(this, function (_c) {
5019
+ switch (_c.label) {
5020
+ case 0:
5021
+ vars = { ids: ids };
5022
+ return [4 /*yield*/, gqlRequest({
5023
+ query: MUTATION,
5024
+ token: token,
5025
+ vars: vars,
5026
+ subdomain: subdomain,
5027
+ })];
5028
+ case 1:
5029
+ response = _c.sent();
5030
+ _b = response === null || response === void 0 ? void 0 : response.quoteSubscriptionReinstate, errors = _b.errors, quote = _b.quote;
5031
+ if (errors)
5032
+ throw errors;
5033
+ return [2 /*return*/, quote];
5034
+ }
5035
+ });
5036
+ });
5037
+ };
5038
+
5039
+ var useCancelSubscription = function () {
5040
+ var graphQLRequest = useGraphQLRequest();
5041
+ return function (subscriptionIds, token) { return __awaiter(void 0, void 0, void 0, function () {
5042
+ var data;
5043
+ var _a;
5044
+ return __generator(this, function (_b) {
5045
+ switch (_b.label) {
5046
+ case 0: return [4 /*yield*/, graphQLRequest("\n mutation SubscriptionCancel($subscriptionIds: [ID!]!) {\n subscriptionCancel(ids: $subscriptionIds) {\n subscriptions {\n accountId\n state\n }\n }\n }", token, { subscriptionIds: subscriptionIds })];
5047
+ case 1:
5048
+ data = _b.sent();
5049
+ return [2 /*return*/, (_a = data === null || data === void 0 ? void 0 : data.subscriptions) === null || _a === void 0 ? void 0 : _a.nodes];
5050
+ }
5051
+ });
5052
+ }); };
5053
+ };
5054
+
5055
+ var SubscriptionCardActions = function (_a) {
5056
+ var _b, _c;
5057
+ var planChangeOptions = _a.planChangeOptions, subscription = _a.subscription, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible;
5058
+ // Context
5059
+ var _d = useContext(BunnyContext), token = _d.token, subdomain = _d.subdomain;
5060
+ var _e = useContext(SubscriptionsContext), onChangePlanClick = _e.onChangePlanClick, onClickUpgrade = _e.onClickUpgrade, isTempViewOnly = _e.isTempViewOnly;
5061
+ // Hooks
5062
+ var showSuccessNotification = NotificationUtils.useSuccessNotification();
5063
+ var cancelSubscription = useCancelSubscription();
5064
+ var queryClient = useQueryClient();
5065
+ // const navigate = usePortalNavigate();
5066
+ // const handleUpgradingSubscriptionChange =
5067
+ // useHandleUpgradingSubscriptionChange();
5068
+ // Derived state
5069
+ var canShowCancelButton = subscription.plan.selfServiceCancel;
5070
+ var productPlans = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.filter(function (plan) { var _a; return ((_a = plan.priceLists) === null || _a === void 0 ? void 0 : _a.length) > 0 && plan.productId === subscription.product.id; });
5071
+ var canShowChangePlanButton = ((productPlans === null || productPlans === void 0 ? void 0 : productPlans.length) || 0) > 0;
5072
+ // Mutations
5073
+ var subscriptionCancel = useMutation({
5074
+ mutationFn: function () { return cancelSubscription([subscription.id], token); },
5075
+ onSuccess: function () {
5076
+ queryClient.invalidateQueries({
5077
+ queryKey: QueryKeyFactory.default.createTableKey("subscriptions"),
5078
+ });
5079
+ showSuccessNotification("Subscription canceled");
5080
+ },
5081
+ });
5082
+ useMutation({
5083
+ mutationFn: function () {
5084
+ return getGuoteSubscriptionReinstate({
5085
+ ids: [subscription.id],
5086
+ token: token,
5087
+ subdomain: subdomain,
5088
+ });
5089
+ },
5090
+ onSuccess: function (quote) {
5091
+ setEditingQuoteData({ id: quote.id, isTrial: false });
5092
+ setPayModalVisible(true);
5093
+ },
5094
+ });
5095
+ // Handlers
5096
+ var handleChangePlanClick = function () {
5097
+ // handleUpgradingSubscriptionChange({
5098
+ // subscription,
5099
+ // });
5100
+ console.log("handleChangePlanClick handleUpgradingSubscriptionChange not implemented");
5101
+ // navigate("plan-manager", {
5102
+ // subscriptionUpgradeId: subscription.id,
5103
+ // });
5104
+ onChangePlanClick();
5105
+ };
5106
+ return (canShowChangePlanButton || canShowCancelButton) &&
5107
+ canShowSubscriptionActions(subscription) ? (jsxs(Fragment, { children: [!isTempViewOnly && canShowCancelButton && (jsx(Popconfirm, __assign({ icon: null, onConfirm: function () { return subscriptionCancel.mutate(); }, title: "Cancel subscription" }, { children: jsx(Button, __assign({ className: "p-0", type: "link" }, { children: "Cancel subscription" })) }))), !isTempViewOnly && canShowChangePlanButton && (jsx(Button, __assign({ onClick: function () { return handleChangePlanClick(); }, type: "primary" }, { children: "Change plan" })))] })) : ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.TRIAL ? (jsx(Fragment, { children: !isTempViewOnly && (jsx(Button, __assign({ onClick: function () {
5108
+ // handleUpgradingSubscriptionChange({
5109
+ // subscription,
5110
+ // });
5111
+ console.log("onClickUpgrade handleUpgradingSubscriptionChange not implemented");
5112
+ // navigate("plan-manager", {
5113
+ // subscriptionUpgradeId: subscription.id,
5114
+ // });
5115
+ onClickUpgrade();
5116
+ }, type: "primary" }, { children: "Upgrade" }))) })) : null;
5117
+ };
5118
+
5119
+ var Text$2 = Typography.Text;
5120
+ var getSubscriptionStatusText = function (subscription) {
5121
+ var cancellationDate = subscription.cancellationDate, state = subscription.state, evergreen = subscription.evergreen, endDate = subscription.endDate;
5122
+ if (cancellationDate &&
5123
+ (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== SubscriptionState$2.CANCELED &&
5124
+ (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== SubscriptionState$2.EXPIRED) {
5125
+ return (jsxs(Tag, __assign({ color: "red" }, { children: ["Canceled - ends on ", Misc.formatDate(cancellationDate)] })));
5126
+ }
5127
+ if (evergreen) {
5128
+ return "Renews on ".concat(Misc.formatDate(endDate));
5129
+ }
5130
+ if ((state === null || state === void 0 ? void 0 : state.toUpperCase()) === SubscriptionState$2.CANCELED ||
5131
+ (state === null || state === void 0 ? void 0 : state.toUpperCase()) === SubscriptionState$2.EXPIRED) {
5132
+ return "Ended on ".concat(Misc.formatDate(endDate));
5133
+ }
5134
+ return "Ends on ".concat(Misc.formatDate(endDate));
5135
+ };
5136
+ var SubscriptionCardHeader = function (_a) {
5137
+ var _b, _c, _d, _e, _f;
5138
+ var planChangeOptions = _a.planChangeOptions, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible, subscription = _a.subscription;
5139
+ var darkMode = useContext(BunnyContext).darkMode;
5140
+ var isMobile = useIsMobile$1();
5141
+ // Derived state
5142
+ var trialDaysLeft = dayjs(subscription.trialEndDate).diff(dayjs(), "days");
5143
+ var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL;
5144
+ return (jsxs("div", __assign({ className: "flex items-center justify-between", style: {
5145
+ backgroundColor: darkMode ? "var(--row-background-dark)" : "",
5146
+ } }, { children: [jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsx("div", __assign({ className: "font-medium text-orange-500", style: { fontSize: "11px" } }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsx(Text$2, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxs(Tag, __assign({ className: "ant-tag-".concat(TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()]) }, { children: [capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsx(Text$2, __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile && (jsx(SubscriptionCardActions, { planChangeOptions: planChangeOptions, subscription: subscription, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible }))] }))] })));
5147
+ };
5148
+
5149
+ var BillingPeriodConverter;
5150
+ (function (BillingPeriodConverter) {
5151
+ BillingPeriodConverter["ONCE"] = "once";
5152
+ BillingPeriodConverter["MONTHLY"] = "monthly";
5153
+ BillingPeriodConverter["ANNUAL"] = "annually";
5154
+ BillingPeriodConverter["SEMI_ANNUAL"] = "semi annually";
5155
+ BillingPeriodConverter["QUARTERLY"] = "quarterly";
5156
+ })(BillingPeriodConverter || (BillingPeriodConverter = {}));
5157
+ var SubscriptionChargeTotal = function (_a) {
5158
+ var charge = _a.charge, subscription = _a.subscription;
5159
+ var isMobile = useIsMobile$1();
5160
+ return (jsxs("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: [jsx("div", { children: Misc.formatCurrency(Number(charge.periodPrice), subscription.currencyId) }), charge.billingPeriod && (jsx("div", { children: BillingPeriodConverter[charge.billingPeriod] }))] })));
5161
+ };
5162
+
5163
+ var SubscriptionChargeUnitPrice = function (_a) {
5164
+ var _b, _c;
5165
+ var charge = _a.charge, subscription = _a.subscription;
5166
+ var darkMode = useContext(BunnyContext).darkMode;
5167
+ var _d = useState(false), showPriceTiers = _d[0], setShowPriceTiers = _d[1];
5168
+ if ((_c = (_b = charge.priceListCharge) === null || _b === void 0 ? void 0 : _b.priceListChargeTiers) === null || _c === void 0 ? void 0 : _c.length) {
5169
+ return (jsx(Dropdown, __assign({ dropdownRender: function () {
5170
+ var _a, _b;
5171
+ return (jsx("div", __assign({ className: "flex flex-col rounded border border-solid border-slate-200 p-2", style: {
5172
+ backgroundColor: darkMode
5173
+ ? "var(--row-background-dark)"
5174
+ : "var(--row-background)",
5175
+ } }, { children: jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b.map(function (tier, index) {
5176
+ var _a, _b, _c, _d, _e;
5177
+ var ends = ((_c = (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b[index + 1]) === null || _c === void 0 ? void 0 : _c.starts)
5178
+ ? ((_e = (_d = charge.priceListCharge) === null || _d === void 0 ? void 0 : _d.priceListChargeTiers[index + 1]) === null || _e === void 0 ? void 0 : _e.starts) - 1
5179
+ : "∞";
5180
+ return (jsxs("div", __assign({ className: "contents" }, { children: [jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " ", ":"] })), jsx("div", __assign({ className: "whitespace-nowrap text-right" }, { children: Misc.formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
5181
+ }) })) })));
5182
+ }, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsx("div", __assign({ className: "cursor-pointer underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "hide details" : "show details" })) })));
5183
+ }
5184
+ return (jsx(Fragment, { children: Misc.formatCurrency(charge.discountedPrice, subscription.currencyId) }));
5185
+ };
5186
+
5187
+ var SubscriptionCardColumnHeaders = function (_a) {
5188
+ var columns = _a.columns;
5189
+ return columns.map(function (subscriptionColumn, index) { return (jsx("div", __assign({ className: "text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: "11px" } }, { children: subscriptionColumn.title }), index)); });
5190
+ };
5191
+
5192
+ var Text$1 = Typography.Text;
5193
+ var SubscriptionsListCell = function (_a) {
5194
+ var children = _a.children, className = _a.className, gridColumn = _a.gridColumn, right = _a.right, style = _a.style;
5195
+ return (jsx(Text$1, __assign({ className: "flex items-center text-sm whitespace-nowrap ".concat(className), style: __assign({ gridColumn: gridColumn, textAlign: right ? "right" : "left", justifyContent: right ? "flex-end" : "flex-start" }, style) }, { children: children })));
5196
+ };
5197
+
4888
5198
  var createCardColumns = function () { return [
4889
5199
  {
4890
5200
  title: "CHARGE",
@@ -4963,9 +5273,10 @@ var SubscriptionCardDesktopRow = function (_a) {
4963
5273
  : charge.quantity })), jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsx(SubscriptionChargeUnitPrice, { charge: charge, subscription: subscription }) })), jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsx(SubscriptionChargeTotal, { charge: charge, subscription: subscription }) }))] })));
4964
5274
  };
4965
5275
 
5276
+ var Text = Typography.Text;
4966
5277
  var SubscriptionCardCellMobile = function (_a) {
4967
5278
  var children = _a.children, className = _a.className, style = _a.style;
4968
- return (jsx("div", __assign({ className: className, style: style }, { children: children })));
5279
+ return (jsx(Text, __assign({ className: className, style: style }, { children: children })));
4969
5280
  };
4970
5281
 
4971
5282
  var CHARGE_COLUMNS = [
@@ -4988,8 +5299,12 @@ var CHARGE_COLUMNS = [
4988
5299
  var SubscriptionCard = function (_a) {
4989
5300
  var _b;
4990
5301
  var planChangeOptions = _a.planChangeOptions, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible, subscription = _a.subscription;
5302
+ var darkMode = useContext(BunnyContext).darkMode;
4991
5303
  // Derived state
4992
5304
  var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL;
5305
+ var backgroundColor = darkMode
5306
+ ? "var(--row-background-dark)"
5307
+ : "var(--row-background)";
4993
5308
  return (jsx(Card, { children: jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsx(SubscriptionCardHeader, { planChangeOptions: planChangeOptions, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible, subscription: subscription }), jsx(Divider, { className: "my-4", style: {
4994
5309
  gridColumn: "1 / -1",
4995
5310
  width: "calc(100% + 32px)",
@@ -4998,6 +5313,7 @@ var SubscriptionCard = function (_a) {
4998
5313
  columnGap: "0.5rem",
4999
5314
  gridTemplateColumns: "1fr auto auto auto",
5000
5315
  rowGap: "0.75rem",
5316
+ backgroundColor: backgroundColor,
5001
5317
  } }, { children: [CHARGE_COLUMNS.map(function (subscriptionColumn, index) { return (jsx(SubscriptionCardCellMobile, __assign({ className: "text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: "11px" } }, { children: subscriptionColumn.title }), index)); }), subscription.charges.map(function (charge, chargeIndex) {
5002
5318
  if ((isTrial && !charge.trial) || (!isTrial && charge.trial))
5003
5319
  return null;
@@ -5140,4 +5456,4 @@ var Subscriptions = function (_a) {
5140
5456
  } }, { children: (subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.length) > 0 ? (jsx(SubscriptionsList, { hideExpired: hideExpired, planChangeOptions: planChangeOptions, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible, subscriptions: subscriptions })) : (jsx("div", __assign({ className: "flex flex-col items-center w-full" }, { children: jsx(ErrorView, { message: "You have no subscriptions with ".concat(companyName, " yet") }) }))) })), isMobile && (jsx("div", __assign({ className: "pt-4 pb-2" }, { children: jsx(SubscriptionsNavigation, { hideExpired: hideExpired, setHideExpired: setHideExpired, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), jsx(Footer, {}), jsx(QuantityChangeDrawerDesktop, { editingQuote: quote, editingQuoteData: editingQuoteData, onClose: onClose, open: quantityDrawerOpen, openCheckout: function () { return setPayModalVisible(true); }, setEditingQuoteData: setEditingQuoteData, subscriptions: subscriptions }), jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile })] })));
5141
5457
  };
5142
5458
 
5143
- export { BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
5459
+ export { BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };