@bunnyapp/components 1.5.0 → 1.6.0-beta.10

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 (98) hide show
  1. package/README.md +71 -0
  2. package/dist/cjs/index.js +2054 -1714
  3. package/dist/cjs/types/src/components/FeatureUsageGraph.d.ts +4 -3
  4. package/dist/cjs/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
  5. package/dist/cjs/types/src/components/{QuoteProvider.d.ts → QuoteProvider/context/QuoteContext.d.ts} +4 -6
  6. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +77 -0
  7. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +19 -0
  8. package/dist/cjs/types/src/{hooks/quotes → components/QuoteProvider/hooks}/useQuoteQuantities.d.ts +4 -2
  9. package/dist/cjs/types/src/{graphql → components/QuoteProvider}/mutations/quoteChargeUpdate.d.ts +12 -2
  10. package/dist/cjs/types/src/components/QuoteProvider/queries/getQuote.d.ts +16 -0
  11. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/PriceListGrid.d.ts +2 -1
  12. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +2 -2
  13. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +3 -2
  14. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +2 -1
  15. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +3 -2
  16. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/util.d.ts +1 -1
  17. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
  18. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
  19. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -2
  20. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -2
  21. package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
  22. package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
  23. package/dist/cjs/types/src/components/priceListPricing/PricingTooltip.d.ts +40 -0
  24. package/dist/cjs/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
  25. package/dist/cjs/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
  26. package/dist/cjs/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
  27. package/dist/cjs/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
  28. package/dist/cjs/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
  29. package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
  30. package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
  31. package/dist/cjs/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
  32. package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
  33. package/dist/cjs/types/src/enums/SubscriptionState.d.ts +9 -0
  34. package/dist/cjs/types/src/graphql/mutations/quoteChargeDelete.d.ts +11 -2
  35. package/dist/cjs/types/src/graphql/queries/getQuote.d.ts +29 -2
  36. package/dist/cjs/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
  37. package/dist/cjs/types/src/index.d.ts +2 -2
  38. package/dist/cjs/types/src/utils/addonPlanUtils.d.ts +2 -1
  39. package/dist/cjs/types/src/utils/featureAddonUtils.d.ts +16 -1
  40. package/dist/cjs/types/src/utils/formatCurrency.d.ts +1 -0
  41. package/dist/cjs/types/src/utils/priceListUtils/doesPriceListHaveFlatFeeCharges.d.ts +7 -0
  42. package/dist/cjs/types/src/utils/priceListUtils/getPrice.d.ts +5 -0
  43. package/dist/cjs/types/src/utils/priceListUtils/priceDescription.d.ts +6 -0
  44. package/dist/cjs/types/src/utils/priceListUtils/priceListPriceText.d.ts +12 -0
  45. package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +3 -3
  46. package/dist/esm/index.js +2093 -1753
  47. package/dist/esm/types/src/components/FeatureUsageGraph.d.ts +4 -3
  48. package/dist/esm/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
  49. package/dist/esm/types/src/components/{QuoteProvider.d.ts → QuoteProvider/context/QuoteContext.d.ts} +4 -6
  50. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +77 -0
  51. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +19 -0
  52. package/dist/esm/types/src/{hooks/quotes → components/QuoteProvider/hooks}/useQuoteQuantities.d.ts +4 -2
  53. package/dist/esm/types/src/{graphql → components/QuoteProvider}/mutations/quoteChargeUpdate.d.ts +12 -2
  54. package/dist/esm/types/src/components/QuoteProvider/queries/getQuote.d.ts +16 -0
  55. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/PriceListGrid.d.ts +2 -1
  56. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +2 -2
  57. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +3 -2
  58. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +2 -1
  59. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +3 -2
  60. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/util.d.ts +1 -1
  61. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
  62. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
  63. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -2
  64. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -2
  65. package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
  66. package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
  67. package/dist/esm/types/src/components/priceListPricing/PricingTooltip.d.ts +40 -0
  68. package/dist/esm/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
  69. package/dist/esm/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
  70. package/dist/esm/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
  71. package/dist/esm/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
  72. package/dist/esm/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
  73. package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
  74. package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
  75. package/dist/esm/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
  76. package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
  77. package/dist/esm/types/src/enums/SubscriptionState.d.ts +9 -0
  78. package/dist/esm/types/src/graphql/mutations/quoteChargeDelete.d.ts +11 -2
  79. package/dist/esm/types/src/graphql/queries/getQuote.d.ts +29 -2
  80. package/dist/esm/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
  81. package/dist/esm/types/src/index.d.ts +2 -2
  82. package/dist/esm/types/src/utils/addonPlanUtils.d.ts +2 -1
  83. package/dist/esm/types/src/utils/featureAddonUtils.d.ts +16 -1
  84. package/dist/esm/types/src/utils/formatCurrency.d.ts +1 -0
  85. package/dist/esm/types/src/utils/priceListUtils/doesPriceListHaveFlatFeeCharges.d.ts +7 -0
  86. package/dist/esm/types/src/utils/priceListUtils/getPrice.d.ts +5 -0
  87. package/dist/esm/types/src/utils/priceListUtils/priceDescription.d.ts +6 -0
  88. package/dist/esm/types/src/utils/priceListUtils/priceListPriceText.d.ts +12 -0
  89. package/dist/esm/types/src/utils/pricePickerUtils.d.ts +3 -3
  90. package/package.json +2 -2
  91. package/dist/cjs/types/src/components/Subscriptions/TieredDisplayDropdown.d.ts +0 -8
  92. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +0 -13
  93. package/dist/cjs/types/src/hooks/quotes/useQuoteCreate.d.ts +0 -9
  94. package/dist/esm/types/src/components/Subscriptions/TieredDisplayDropdown.d.ts +0 -8
  95. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +0 -13
  96. package/dist/esm/types/src/hooks/quotes/useQuoteCreate.d.ts +0 -9
  97. /package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/{PriceListCardDesktop.d.ts → priceListCardDesktop/PriceListCardDesktop.d.ts} +0 -0
  98. /package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/{PriceListCardDesktop.d.ts → priceListCardDesktop/PriceListCardDesktop.d.ts} +0 -0
package/dist/cjs/index.js CHANGED
@@ -16,7 +16,7 @@ var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
16
16
  var reactFontawesome = require('@fortawesome/react-fontawesome');
17
17
  var reactStripeJs = require('@stripe/react-stripe-js');
18
18
  var index_js = require('@stripe/stripe-js/pure/index.js');
19
- var graphql = require('graphql');
19
+ var graphql$1 = require('graphql');
20
20
  var recharts = require('recharts');
21
21
  var lodashEs = require('lodash-es');
22
22
  var pkg = require('pluralize');
@@ -48,11 +48,11 @@ function styleInject(css, ref) {
48
48
  }
49
49
  }
50
50
 
51
- var css_248z = ":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 --bunny-blue-500: #3b82f6;\n --bunny-blue-200: #bfdbfe;\n --bunny-green-600: #059669;\n --bunny-green-200: #a7f3d0;\n --bunny-red-500: #ef4444;\n --bunny-red-200: #fecaca;\n --bunny-orange-500: #f97316;\n --bunny-orange-200: #fed7aa;\n --bunny-yellow-500: #f59e0b;\n --bunny-yellow-200: #fde68a;\n --bunny-purple-500: #8b5cf6;\n --bunny-purple-200: #ddd6fe;\n --bunny-black: #000000;\n}\n.bunny-component-wrapper {\n box-sizing: border-box;\n}\n.bunny-component-wrapper * {\n box-sizing: border-box;\n}\n.hidden {\n display: none;\n}\n.bunny-show-on-hover {\n opacity: 0;\n}\n.bunny-show-on-hover-container:hover .bunny-show-on-hover {\n opacity: 1;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\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.bunny-icon-path {\n transition: fill 0.3s;\n}\n.bunny-shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.bunny-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 .bunny-shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .bunny-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.bunny-shadow,\n.bunny-shadow-md {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.bunny-fixed {\n position: fixed;\n}\n.bunny-absolute {\n position: absolute;\n}\n.bunny-relative {\n position: relative;\n}\n.bunny-sticky {\n position: sticky;\n}\n.bunny-bottom-0 {\n bottom: 0px;\n}\n.bunny-bottom-4 {\n bottom: 1rem;\n}\n.bunny-left-0 {\n left: 0px;\n}\n.bunny-right-0 {\n right: 0px;\n}\n.bunny-top-0 {\n top: 0px;\n}\n.bunny-col-span-1 {\n grid-column: span 1 / span 1;\n}\n.bunny-col-span-full {\n grid-column: 1 / -1;\n}\n.bunny-m-0 {\n margin: 0px;\n}\n.bunny-mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.bunny-mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.bunny-mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.bunny-my-0 {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n.bunny-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.bunny-my-24 {\n margin-top: 6rem;\n margin-bottom: 6rem;\n}\n.bunny-my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.bunny-mb-2 {\n margin-bottom: 0.5rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-ml-auto {\n margin-left: auto;\n}\n.bunny-mt-2 {\n margin-top: 0.5rem;\n}\n.bunny-mt-24 {\n margin-top: 6rem;\n}\n.bunny-mt-4 {\n margin-top: 1rem;\n}\n.bunny-box-border {\n box-sizing: border-box;\n}\n.bunny-flex {\n display: flex;\n}\n.bunny-grid {\n display: grid;\n}\n.bunny-contents {\n display: contents;\n}\n.bunny-h-0\\.5 {\n height: 0.125rem;\n}\n.bunny-h-1\\/2 {\n height: 50%;\n}\n.bunny-h-8 {\n height: 2rem;\n}\n.bunny-h-full {\n height: 100%;\n}\n.bunny-h-screen {\n height: 100vh;\n}\n.bunny-max-h-\\[calc\\(100vh-10rem\\)\\] {\n max-height: calc(100vh - 10rem);\n}\n.bunny-min-h-0 {\n min-height: 0px;\n}\n.bunny-w-0\\.5 {\n width: 0.125rem;\n}\n.bunny-w-1\\/2 {\n width: 50%;\n}\n.bunny-w-3\\/5 {\n width: 60%;\n}\n.bunny-w-full {\n width: 100%;\n}\n.bunny-w-screen {\n width: 100vw;\n}\n.bunny-flex-1 {\n flex: 1 1 0%;\n}\n.bunny-shrink {\n flex-shrink: 1;\n}\n.bunny-shrink-0 {\n flex-shrink: 0;\n}\n.bunny-grow {\n flex-grow: 1;\n}\n.bunny-cursor-pointer {\n cursor: pointer;\n}\n.bunny-grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.bunny-flex-row {\n flex-direction: row;\n}\n.bunny-flex-col {\n flex-direction: column;\n}\n.bunny-flex-wrap {\n flex-wrap: wrap;\n}\n.bunny-items-start {\n align-items: flex-start;\n}\n.bunny-items-end {\n align-items: flex-end;\n}\n.bunny-items-center {\n align-items: center;\n}\n.bunny-justify-end {\n justify-content: flex-end;\n}\n.bunny-justify-center {\n justify-content: center;\n}\n.bunny-justify-between {\n justify-content: space-between;\n}\n.bunny-gap-0 {\n gap: 0px;\n}\n.bunny-gap-1 {\n gap: 0.25rem;\n}\n.bunny-gap-2 {\n gap: 0.5rem;\n}\n.bunny-gap-3 {\n gap: 0.75rem;\n}\n.bunny-gap-4 {\n gap: 1rem;\n}\n.bunny-gap-6 {\n gap: 1.5rem;\n}\n.bunny-gap-8 {\n gap: 2rem;\n}\n.bunny-space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.bunny-space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.bunny-space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.bunny-overflow-auto {\n overflow: auto;\n}\n.bunny-overflow-hidden {\n overflow: hidden;\n}\n.bunny-overflow-visible {\n overflow: visible;\n}\n.bunny-overflow-y-auto {\n overflow-y: auto;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-text-nowrap {\n text-wrap: nowrap;\n}\n.bunny-rounded {\n border-radius: 0.25rem;\n}\n.bunny-rounded-full {\n border-radius: 9999px;\n}\n.bunny-rounded-lg {\n border-radius: 0.5rem;\n}\n.bunny-rounded-md {\n border-radius: 0.375rem;\n}\n.bunny-border {\n border-width: 1px;\n}\n.bunny-border-2 {\n border-width: 2px;\n}\n.bunny-border-solid {\n border-style: solid;\n}\n.bunny-border-none {\n border-style: none;\n}\n.bunny-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.bunny-border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n}\n.bunny-bg-gray-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-transparent {\n background-color: transparent;\n}\n.bunny-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bunny-p-0 {\n padding: 0px;\n}\n.bunny-p-1 {\n padding: 0.25rem;\n}\n.bunny-p-4 {\n padding: 1rem;\n}\n.bunny-p-8 {\n padding: 2rem;\n}\n.bunny-px-12 {\n padding-left: 3rem;\n padding-right: 3rem;\n}\n.bunny-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.bunny-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.bunny-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.bunny-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.bunny-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.bunny-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.bunny-pb-2 {\n padding-bottom: 0.5rem;\n}\n.bunny-pb-4 {\n padding-bottom: 1rem;\n}\n.bunny-pb-6 {\n padding-bottom: 1.5rem;\n}\n.bunny-pb-8 {\n padding-bottom: 2rem;\n}\n.bunny-pl-1 {\n padding-left: 0.25rem;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-1 {\n padding-top: 0.25rem;\n}\n.bunny-pt-12 {\n padding-top: 3rem;\n}\n.bunny-pt-2 {\n padding-top: 0.5rem;\n}\n.bunny-pt-4 {\n padding-top: 1rem;\n}\n.bunny-pt-5 {\n padding-top: 1.25rem;\n}\n.bunny-pt-\\[25vh\\] {\n padding-top: 25vh;\n}\n.bunny-text-left {\n text-align: left;\n}\n.bunny-text-center {\n text-align: center;\n}\n.bunny-text-right {\n text-align: right;\n}\n.bunny-text-start {\n text-align: start;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-3xl {\n font-size: 1.875rem;\n line-height: 2.25rem;\n}\n.bunny-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.bunny-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.bunny-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.bunny-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.bunny-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.bunny-font-bold {\n font-weight: 700;\n}\n.bunny-font-medium {\n font-weight: 500;\n}\n.bunny-font-normal {\n font-weight: 400;\n}\n.bunny-text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.bunny-underline {\n text-decoration-line: underline;\n}\n.bunny-shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.bunny-shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.bunny-transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.bunny-duration-300 {\n transition-duration: 300ms;\n}\n.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.sticky {\n position: sticky;\n}\n.-top-0\\.5 {\n top: -0.125rem;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-50 {\n z-index: 50;\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-full {\n grid-column: 1 / -1;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\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.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-2 {\n margin-left: 0.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-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-12 {\n width: 3rem;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\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.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\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;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.gap-8 {\n gap: 2rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-sm {\n border-radius: 0.125rem;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\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-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.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\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.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n.hover\\:bunny-text-orange-400:hover {\n --tw-text-opacity: 1;\n color: rgb(251 146 60 / var(--tw-text-opacity, 1));\n}\n.bunny-components .ant-upload-select-picture-card {\n margin: 0 !important;\n}\n.bunny-components .ant-upload {\n border-radius: 0.5rem !important;\n}\n.bunny-components .ant-row {\n margin-bottom: 0px;\n}\n.bunny-components .ant-select-disabled .ant-select-selector .ant-select-selection-item {\n color: rgba(0, 0, 0, 0.25) !important;\n}\n.bunny-components .ant-input-number,\n.bunny-components .ant-input,\n.bunny-components .ant-picker,\n.bunny-components .ant-input-affix-wrapper,\n.bunny-components .ant-select-selector {\n font-size: 0.875rem !important;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n color: #232323 !important;\n}\n.bunny-components .ant-input-affix-wrapper {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n.bunny-components .ant-input-group-addon,\n.bunny-components .ant-input-number-group-addon {\n color: #475569 !important;\n}\n.bunny-components .ant-input-number-group-wrapper,\n.bunny-components .ant-input-number-affix-wrapper {\n width: 100%;\n}\n.bunny-components .ant-input-affix-wrapper input {\n border: none !important;\n}\n.bunny-components .ant-form-item {\n margin-bottom: 0;\n}\n.bunny-components .ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.bunny-components .ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.bunny-components .form .ant-form-item-label label {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n}\n.bunny-components .ant-form-item-explain,\n.bunny-components .ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.bunny-components .ant-timeline-item-content {\n font-size: smaller;\n}\n.bunny-components .ant-tree {\n font-size: 0.875rem;\n}\n.bunny-components .ant-tree-treenode {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-draggable-icon {\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-node-content-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-switcher {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-page-header {\n padding-left: 0;\n padding-right: 0;\n padding-top: 0;\n}\n.bunny-components .ant-tag {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 14px;\n font-weight: 500;\n white-space: nowrap;\n padding-inline-start: 0.625rem;\n padding-inline-end: 0.625rem;\n margin: 0;\n}\n.bunny-components .ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.bunny-components .ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.bunny-components .ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.bunny-components .ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.bunny-components .ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.bunny-components .ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.bunny-components .ant-tag-gray {\n color: #6b7280 !important;\n background: #e5e7eb !important;\n}\n.bunny-components .ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.bunny-components .ant-picker {\n width: 100%;\n}\n.bunny-components .ant-input,\n.bunny-components .ant-select,\n.bunny-components .ant-picker {\n height: 32px !important;\n}\n.bunny-components .ant-slider-dot {\n border: 2px solid #f0f0f0;\n}\n.bunny-components .ant-slider-dot-active {\n border-color: #ff5833;\n}\n.bunny-components .ant-slider-mark :last-child {\n transform: translateX(-75%) !important;\n}\n.bunny-components .ant-drawer-content {\n background: #f3f3f9ff;\n}\n.bunny-components .ant-drawer-body,\n.bunny-components .ant-layout {\n background: #f8fafc;\n}\n.bunny-components .vista-link {\n color: #1890ff;\n}\n.bunny-components .vista-link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.bunny-components .ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.bunny-components .ant-popconfirm-message-text {\n width: 100% !important;\n}\n.bunny-components .ant-popconfirm-title {\n padding: 0;\n text-align: center;\n font-size: 0.875rem !important;\n width: 100% !important;\n}\n.bunny-components .ant-popconfirm-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n}\n.bunny-components .ant-popconfirm-buttons button {\n margin-inline-start: 0 !important;\n}\n.bunny-components .ant-pagination-item {\n display: flex !important;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.bunny-components .ant-btn {\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-weight: normal;\n}\n.bunny-components .ant-btn-default .ant-btn-icon {\n color: #94a3b8;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n.bunny-components .ant-btn-default:hover .ant-btn-icon {\n color: #ff7f5c;\n}\n.bunny-components .ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.bunny-components .ant-btn-primary:disabled {\n background-color: rgba(113, 125, 148, 0.1) !important;\n border-color: rgba(113, 125, 148, 0.1) !important;\n}\n.bunny-components .ant-btn-primary:hover:disabled,\n.bunny-components .ant-btn-primary:disabled {\n background-clip: padding-box;\n}\n.bunny-components .ant-select-selection-item-content {\n display: flex !important;\n align-items: center;\n}\n.bunny-components .ant-select-item {\n font-size: 0.875rem;\n}\n.bunny-components .ant-select-item-option-content {\n display: flex;\n align-items: center;\n white-space: nowrap !important;\n overflow: visible !important;\n text-overflow: default !important;\n font-size: 0.875rem;\n}\n.bunny-components .ant-select-arrow .anticon:not(.ant-select-suffix) {\n pointer-events: none;\n}\n.bunny-components .select-dropdown-blue-gray .ant-select-item-option {\n background-color: #fff !important;\n}\n.bunny-components .select-dropdown-blue-gray .ant-select-item-option-active {\n color: #ff5833;\n}\n.bunny-components .ant-dropdown-menu-items {\n padding-left: 0 !important;\n}\n.bunny-components .ant-dropdown-menu-item-active {\n background-color: transparent !important;\n}\n.bunny-components .ant-input-affix-wrapper.searchfield {\n background: white !important;\n}\n.bunny-components .ant-input-affix-wrapper.searchfield input {\n background: white !important;\n}\n.bunny-components .ant-input-affix-wrapper-focused {\n background: white !important;\n}\n.bunny-components .panel .ant-input-affix-wrapper.searchfield {\n background: #f8f8f8 !important;\n}\n.bunny-components .panel .ant-input-affix-wrapper.searchfield input {\n background: #f8f8f8 !important;\n}\n.bunny-components .ant-input-steps-hidden .ant-input-number-handler-wrap {\n display: none;\n}\n.bunny-components .ant-layout-header {\n height: 48px;\n}\n.bunny-components .ant-layout-sider-children {\n width: inherit;\n position: fixed;\n}\n.bunny-components .ant-menu-item-group-list {\n display: flex !important;\n flex-direction: column !important;\n align-items: flex-start !important;\n gap: 4px !important;\n}\n.bunny-components .group {\n display: flex;\n flex-direction: row;\n flex-flow: row wrap;\n box-sizing: border-box;\n}\n.bunny-components .select-datepicker {\n animation-duration: 0.35s !important;\n}\n.bunny-components .header-datepicker {\n top: 96px !important;\n animation-duration: 0s !important;\n}\n.bunny-components .ant-picker-header {\n border-bottom: none !important;\n}\n.bunny-components .ant-picker-content thead tr th {\n font-weight: 500;\n}\n.bunny-components .ant-picker-panel-container {\n border-radius: 0.375rem;\n}\n.bunny-components .ant-picker-cell-selected .custom-date-display {\n color: #ffffff;\n background-color: #ff5833;\n}\n.bunny-components .ant-picker-cell-today .custom-date-display {\n border: 1px solid #ff5833;\n}\n.bunny-components .ant-select:hover,\n.bunny-components * .cardElement:hover {\n border-color: #ff5833;\n}\n.bunny-components .ant-input-number {\n width: 100%;\n}\n.bunny-components .ant-input-number-focused {\n border-color: #ff5833 !important;\n background-color: #ffffff !important;\n}\n.bunny-components .ant-input-affix-wrapper-focused,\n.bunny-components .ant-input-number-focused,\n.bunny-components .ant-picker,\n.bunny-components .ant-input,\n.bunny-components .ant-select-focused .ant-select-selector,\n.bunny-components .ant-select-selector:focus,\n.bunny-components .ant-select-selector:active,\n.bunny-components .ant-select-open .ant-select-selector {\n box-shadow: none !important;\n}\n.bunny-components .ant-select-item-option-selected .ant-select-item-option-state {\n display: none !important;\n}\n.bunny-components .ant-form * input[type='text'].ant-input:not(:disabled),\n.bunny-components .ant-select-selection-item:not(:disabled) {\n color: #232323;\n}\n.bunny-components .ant-tabs-ink-bar {\n display: none !important;\n}\n.bunny-components .ant-tabs-tab.ant-tabs-tab-active {\n border-bottom: 2px solid #ff5833 !important;\n}\n.bunny-components .ant-tabs-tab {\n border-bottom: 2px solid transparent !important;\n padding-bottom: 14px !important;\n}\n.bunny-components .ant-upload-wrapper {\n display: flex;\n}\n.bunny-components .ant-form-item-label > label::after {\n display: none !important;\n}\n.bunny-components .ant-menu-item {\n display: flex !important;\n align-items: center !important;\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 border-radius: 8px !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 font-size: 14px !important;\n overflow-wrap: break-word;\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: #ff5833 !important;\n font-weight: 500 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff5833;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-weight: 500 !important;\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.bunny-invoice-container {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\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";
51
+ var css_248z = ":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 --bunny-blue-500: #3b82f6;\n --bunny-blue-200: #bfdbfe;\n --bunny-green-600: #059669;\n --bunny-green-200: #a7f3d0;\n --bunny-red-500: #ef4444;\n --bunny-red-200: #fecaca;\n --bunny-orange-500: #f97316;\n --bunny-orange-200: #fed7aa;\n --bunny-yellow-500: #f59e0b;\n --bunny-yellow-200: #fde68a;\n --bunny-purple-500: #8b5cf6;\n --bunny-purple-200: #ddd6fe;\n --bunny-black: #000000;\n}\n.bunny-component-wrapper {\n box-sizing: border-box;\n}\n.bunny-component-wrapper * {\n box-sizing: border-box;\n}\n.hidden {\n display: none;\n}\n.bunny-show-on-hover {\n opacity: 0;\n}\n.bunny-show-on-hover-container:hover .bunny-show-on-hover {\n opacity: 1;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\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.bunny-icon-path {\n transition: fill 0.3s;\n}\n.bunny-shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.bunny-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 .bunny-shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .bunny-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.bunny-shadow,\n.bunny-shadow-md {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.bunny-fixed {\n position: fixed;\n}\n.bunny-absolute {\n position: absolute;\n}\n.bunny-relative {\n position: relative;\n}\n.bunny-sticky {\n position: sticky;\n}\n.bunny-bottom-0 {\n bottom: 0px;\n}\n.bunny-bottom-4 {\n bottom: 1rem;\n}\n.bunny-left-0 {\n left: 0px;\n}\n.bunny-right-0 {\n right: 0px;\n}\n.bunny-top-0 {\n top: 0px;\n}\n.bunny-col-span-1 {\n grid-column: span 1 / span 1;\n}\n.bunny-col-span-full {\n grid-column: 1 / -1;\n}\n.bunny-m-0 {\n margin: 0px;\n}\n.bunny-mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.bunny-mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.bunny-mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.bunny-my-0 {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n.bunny-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.bunny-my-24 {\n margin-top: 6rem;\n margin-bottom: 6rem;\n}\n.bunny-my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.bunny-mb-1 {\n margin-bottom: 0.25rem;\n}\n.bunny-mb-2 {\n margin-bottom: 0.5rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-ml-auto {\n margin-left: auto;\n}\n.bunny-mt-1 {\n margin-top: 0.25rem;\n}\n.bunny-mt-2 {\n margin-top: 0.5rem;\n}\n.bunny-mt-24 {\n margin-top: 6rem;\n}\n.bunny-mt-4 {\n margin-top: 1rem;\n}\n.bunny-box-border {\n box-sizing: border-box;\n}\n.bunny-flex {\n display: flex;\n}\n.bunny-grid {\n display: grid;\n}\n.bunny-contents {\n display: contents;\n}\n.bunny-h-0\\.5 {\n height: 0.125rem;\n}\n.bunny-h-1\\/2 {\n height: 50%;\n}\n.bunny-h-8 {\n height: 2rem;\n}\n.bunny-h-full {\n height: 100%;\n}\n.bunny-h-screen {\n height: 100vh;\n}\n.bunny-max-h-\\[calc\\(100vh-10rem\\)\\] {\n max-height: calc(100vh - 10rem);\n}\n.bunny-min-h-0 {\n min-height: 0px;\n}\n.bunny-w-0\\.5 {\n width: 0.125rem;\n}\n.bunny-w-1\\/2 {\n width: 50%;\n}\n.bunny-w-3\\/5 {\n width: 60%;\n}\n.bunny-w-full {\n width: 100%;\n}\n.bunny-w-screen {\n width: 100vw;\n}\n.bunny-w-4 {\n width: 1rem;\n}\n.bunny-w-10 {\n width: 2.5rem;\n}\n.bunny-w-28 {\n width: 7rem;\n}\n.bunny-flex-1 {\n flex: 1 1 0%;\n}\n.bunny-shrink {\n flex-shrink: 1;\n}\n.bunny-shrink-0 {\n flex-shrink: 0;\n}\n.bunny-grow {\n flex-grow: 1;\n}\n.bunny-cursor-pointer {\n cursor: pointer;\n}\n.bunny-grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.bunny-flex-row {\n flex-direction: row;\n}\n.bunny-flex-col {\n flex-direction: column;\n}\n.bunny-flex-wrap {\n flex-wrap: wrap;\n}\n.bunny-items-start {\n align-items: flex-start;\n}\n.bunny-items-end {\n align-items: flex-end;\n}\n.bunny-items-center {\n align-items: center;\n}\n.bunny-justify-end {\n justify-content: flex-end;\n}\n.bunny-justify-center {\n justify-content: center;\n}\n.bunny-justify-between {\n justify-content: space-between;\n}\n.bunny-gap-0 {\n gap: 0px;\n}\n.bunny-gap-1 {\n gap: 0.25rem;\n}\n.bunny-gap-2 {\n gap: 0.5rem;\n}\n.bunny-gap-3 {\n gap: 0.75rem;\n}\n.bunny-gap-4 {\n gap: 1rem;\n}\n.bunny-gap-6 {\n gap: 1.5rem;\n}\n.bunny-gap-8 {\n gap: 2rem;\n}\n.bunny-space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.bunny-space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.bunny-space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.bunny-overflow-auto {\n overflow: auto;\n}\n.bunny-overflow-hidden {\n overflow: hidden;\n}\n.bunny-overflow-y-auto {\n overflow-y: auto;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-text-nowrap {\n text-wrap: nowrap;\n}\n.bunny-rounded {\n border-radius: 0.25rem;\n}\n.bunny-rounded-full {\n border-radius: 9999px;\n}\n.bunny-rounded-lg {\n border-radius: 0.5rem;\n}\n.bunny-rounded-md {\n border-radius: 0.375rem;\n}\n.bunny-border {\n border-width: 1px;\n}\n.bunny-border-2 {\n border-width: 2px;\n}\n.bunny-border-solid {\n border-style: solid;\n}\n.bunny-border-none {\n border-style: none;\n}\n.bunny-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.bunny-bg-gray-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-transparent {\n background-color: transparent;\n}\n.bunny-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bunny-p-0 {\n padding: 0px;\n}\n.bunny-p-1 {\n padding: 0.25rem;\n}\n.bunny-p-2 {\n padding: 0.5rem;\n}\n.bunny-p-4 {\n padding: 1rem;\n}\n.bunny-px-12 {\n padding-left: 3rem;\n padding-right: 3rem;\n}\n.bunny-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.bunny-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.bunny-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.bunny-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.bunny-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.bunny-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.bunny-pb-2 {\n padding-bottom: 0.5rem;\n}\n.bunny-pb-4 {\n padding-bottom: 1rem;\n}\n.bunny-pb-6 {\n padding-bottom: 1.5rem;\n}\n.bunny-pb-8 {\n padding-bottom: 2rem;\n}\n.bunny-pl-1 {\n padding-left: 0.25rem;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-1 {\n padding-top: 0.25rem;\n}\n.bunny-pt-12 {\n padding-top: 3rem;\n}\n.bunny-pt-2 {\n padding-top: 0.5rem;\n}\n.bunny-pt-4 {\n padding-top: 1rem;\n}\n.bunny-pt-5 {\n padding-top: 1.25rem;\n}\n.bunny-pt-\\[25vh\\] {\n padding-top: 25vh;\n}\n.bunny-text-left {\n text-align: left;\n}\n.bunny-text-center {\n text-align: center;\n}\n.bunny-text-right {\n text-align: right;\n}\n.bunny-text-start {\n text-align: start;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-3xl {\n font-size: 1.875rem;\n line-height: 2.25rem;\n}\n.bunny-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.bunny-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.bunny-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.bunny-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.bunny-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.bunny-text-xs\\/6 {\n font-size: 0.75rem;\n line-height: 1.5rem;\n}\n.bunny-text-xs\\/3 {\n font-size: 0.75rem;\n line-height: 0.75rem;\n}\n.bunny-font-bold {\n font-weight: 700;\n}\n.bunny-font-medium {\n font-weight: 500;\n}\n.bunny-font-normal {\n font-weight: 400;\n}\n.bunny-text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.bunny-text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-300 {\n --tw-text-opacity: 1;\n color: rgb(209 213 219 / var(--tw-text-opacity, 1));\n}\n.bunny-underline {\n text-decoration-line: underline;\n}\n.bunny-shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.bunny-shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.bunny-transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.bunny-duration-300 {\n transition-duration: 300ms;\n}\n.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.sticky {\n position: sticky;\n}\n.-top-0\\.5 {\n top: -0.125rem;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-50 {\n z-index: 50;\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-full {\n grid-column: 1 / -1;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\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.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-2 {\n margin-left: 0.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-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-12 {\n width: 3rem;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\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.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\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;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.gap-8 {\n gap: 2rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-sm {\n border-radius: 0.125rem;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\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-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.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\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.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n.hover\\:bunny-text-orange-400:hover {\n --tw-text-opacity: 1;\n color: rgb(251 146 60 / var(--tw-text-opacity, 1));\n}\n.bunny-components .ant-upload-select-picture-card {\n margin: 0 !important;\n}\n.bunny-components .ant-upload {\n border-radius: 0.5rem !important;\n}\n.bunny-components .ant-row {\n margin-bottom: 0px;\n}\n.bunny-components .ant-select-disabled .ant-select-selector .ant-select-selection-item {\n color: rgba(0, 0, 0, 0.25) !important;\n}\n.bunny-components .ant-input-number,\n.bunny-components .ant-input,\n.bunny-components .ant-picker,\n.bunny-components .ant-input-affix-wrapper,\n.bunny-components .ant-select-selector {\n font-size: 0.875rem !important;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n color: #232323 !important;\n}\n.bunny-components .ant-input-affix-wrapper {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n.bunny-components .ant-input-group-addon,\n.bunny-components .ant-input-number-group-addon {\n color: #475569 !important;\n}\n.bunny-components .ant-input-number-group-wrapper,\n.bunny-components .ant-input-number-affix-wrapper {\n width: 100%;\n}\n.bunny-components .ant-input-affix-wrapper input {\n border: none !important;\n}\n.bunny-components .ant-form-item {\n margin-bottom: 0;\n}\n.bunny-components .ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.bunny-components .ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.bunny-components .form .ant-form-item-label label {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n}\n.bunny-components .ant-form-item-explain,\n.bunny-components .ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.bunny-components .ant-timeline-item-content {\n font-size: smaller;\n}\n.bunny-components .ant-tree {\n font-size: 0.875rem;\n}\n.bunny-components .ant-tree-treenode {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-draggable-icon {\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-node-content-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-switcher {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-page-header {\n padding-left: 0;\n padding-right: 0;\n padding-top: 0;\n}\n.bunny-components .ant-tag {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 14px;\n font-weight: 500;\n white-space: nowrap;\n padding-inline-start: 0.625rem;\n padding-inline-end: 0.625rem;\n margin: 0;\n}\n.bunny-components .ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.bunny-components .ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.bunny-components .ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.bunny-components .ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.bunny-components .ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.bunny-components .ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.bunny-components .ant-tag-gray {\n color: #6b7280 !important;\n background: #e5e7eb !important;\n}\n.bunny-components .ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.bunny-components .ant-picker {\n width: 100%;\n}\n.bunny-components .ant-input,\n.bunny-components .ant-select,\n.bunny-components .ant-picker {\n height: 32px !important;\n}\n.bunny-components .ant-slider-dot {\n border: 2px solid #f0f0f0;\n}\n.bunny-components .ant-slider-dot-active {\n border-color: #ff5833;\n}\n.bunny-components .ant-slider-mark :last-child {\n transform: translateX(-75%) !important;\n}\n.bunny-components .ant-drawer-content {\n background: #f3f3f9ff;\n}\n.bunny-components .ant-drawer-body,\n.bunny-components .ant-layout {\n background: #f8fafc;\n}\n.bunny-components .vista-link {\n color: #1890ff;\n}\n.bunny-components .vista-link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.bunny-components .ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.bunny-components .ant-popconfirm-message-text {\n width: 100% !important;\n}\n.bunny-components .ant-popconfirm-title {\n padding: 0;\n text-align: center;\n font-size: 0.875rem !important;\n width: 100% !important;\n}\n.bunny-components .ant-popconfirm-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n}\n.bunny-components .ant-popconfirm-buttons button {\n margin-inline-start: 0 !important;\n}\n.bunny-components .ant-pagination-item {\n display: flex !important;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.bunny-components .ant-btn {\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-weight: normal;\n}\n.bunny-components .ant-btn-default .ant-btn-icon {\n color: #94a3b8;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n.bunny-components .ant-btn-default:hover .ant-btn-icon {\n color: #ff7f5c;\n}\n.bunny-components .ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.bunny-components .ant-btn-primary:disabled {\n background-color: rgba(113, 125, 148, 0.1) !important;\n border-color: rgba(113, 125, 148, 0.1) !important;\n}\n.bunny-components .ant-btn-primary:hover:disabled,\n.bunny-components .ant-btn-primary:disabled {\n background-clip: padding-box;\n}\n.bunny-components .ant-select-selection-item-content {\n display: flex !important;\n align-items: center;\n}\n.bunny-components .ant-select-item {\n font-size: 0.875rem;\n}\n.bunny-components .ant-select-item-option-content {\n display: flex;\n align-items: center;\n white-space: nowrap !important;\n overflow: visible !important;\n text-overflow: default !important;\n font-size: 0.875rem;\n}\n.bunny-components .ant-select-arrow .anticon:not(.ant-select-suffix) {\n pointer-events: none;\n}\n.bunny-components .select-dropdown-blue-gray .ant-select-item-option {\n background-color: #fff !important;\n}\n.bunny-components .select-dropdown-blue-gray .ant-select-item-option-active {\n color: #ff5833;\n}\n.bunny-components .ant-dropdown-menu-items {\n padding-left: 0 !important;\n}\n.bunny-components .ant-dropdown-menu-item-active {\n background-color: transparent !important;\n}\n.bunny-components .ant-input-affix-wrapper.searchfield {\n background: white !important;\n}\n.bunny-components .ant-input-affix-wrapper.searchfield input {\n background: white !important;\n}\n.bunny-components .ant-input-affix-wrapper-focused {\n background: white !important;\n}\n.bunny-components .panel .ant-input-affix-wrapper.searchfield {\n background: #f8f8f8 !important;\n}\n.bunny-components .panel .ant-input-affix-wrapper.searchfield input {\n background: #f8f8f8 !important;\n}\n.bunny-components .ant-input-steps-hidden .ant-input-number-handler-wrap {\n display: none;\n}\n.bunny-components .ant-layout-header {\n height: 48px;\n}\n.bunny-components .ant-layout-sider-children {\n width: inherit;\n position: fixed;\n}\n.bunny-components .ant-menu-item-group-list {\n display: flex !important;\n flex-direction: column !important;\n align-items: flex-start !important;\n gap: 4px !important;\n}\n.bunny-components .group {\n display: flex;\n flex-direction: row;\n flex-flow: row wrap;\n box-sizing: border-box;\n}\n.bunny-components .select-datepicker {\n animation-duration: 0.35s !important;\n}\n.bunny-components .header-datepicker {\n top: 96px !important;\n animation-duration: 0s !important;\n}\n.bunny-components .ant-picker-header {\n border-bottom: none !important;\n}\n.bunny-components .ant-picker-content thead tr th {\n font-weight: 500;\n}\n.bunny-components .ant-picker-panel-container {\n border-radius: 0.375rem;\n}\n.bunny-components .ant-picker-cell-selected .custom-date-display {\n color: #ffffff;\n background-color: #ff5833;\n}\n.bunny-components .ant-picker-cell-today .custom-date-display {\n border: 1px solid #ff5833;\n}\n.bunny-components .ant-select:hover,\n.bunny-components * .cardElement:hover {\n border-color: #ff5833;\n}\n.bunny-components .ant-input-number {\n width: 100%;\n}\n.bunny-components .ant-input-number-focused {\n border-color: #ff5833 !important;\n background-color: #ffffff !important;\n}\n.bunny-components .ant-input-affix-wrapper-focused,\n.bunny-components .ant-input-number-focused,\n.bunny-components .ant-picker,\n.bunny-components .ant-input,\n.bunny-components .ant-select-focused .ant-select-selector,\n.bunny-components .ant-select-selector:focus,\n.bunny-components .ant-select-selector:active,\n.bunny-components .ant-select-open .ant-select-selector {\n box-shadow: none !important;\n}\n.bunny-components .ant-select-item-option-selected .ant-select-item-option-state {\n display: none !important;\n}\n.bunny-components .ant-form * input[type='text'].ant-input:not(:disabled),\n.bunny-components .ant-select-selection-item:not(:disabled) {\n color: #232323;\n}\n.bunny-components .ant-tabs-ink-bar {\n display: none !important;\n}\n.bunny-components .ant-tabs-tab.ant-tabs-tab-active {\n border-bottom: 2px solid #ff5833 !important;\n}\n.bunny-components .ant-tabs-tab {\n border-bottom: 2px solid transparent !important;\n padding-bottom: 14px !important;\n}\n.bunny-components .ant-upload-wrapper {\n display: flex;\n}\n.bunny-components .ant-form-item-label > label::after {\n display: none !important;\n}\n.bunny-components .ant-menu-item {\n display: flex !important;\n align-items: center !important;\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 border-radius: 8px !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 font-size: 14px !important;\n overflow-wrap: break-word;\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: #ff5833 !important;\n font-weight: 500 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff5833;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-weight: 500 !important;\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.bunny-invoice-container {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\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";
52
52
  styleInject(css_248z);
53
53
 
54
54
  // This will be replaced at build time by rollup-plugin-replace
55
- const PACKAGE_VERSION = '1.5.0-beta.18';
55
+ const PACKAGE_VERSION = '1.6.0-beta.9';
56
56
  const createRequestHeaders = (token) => {
57
57
  const headers = createClientDevHeaders({ token });
58
58
  // Add the components version header
@@ -337,7 +337,7 @@ const DocumentTemplatePreview = ({ targetUrl }) => {
337
337
  if (!pdfUrl) {
338
338
  return jsxRuntime.jsx(jsxRuntime.Fragment, {});
339
339
  }
340
- return (jsxRuntime.jsx("div", { className: "bunny-rounded bunny-w-full bunny-overflow-hidden bunny-grow bunny-min-h-0", children: jsxRuntime.jsx(react$1.RPConfig, { licenseKey: LISENSE_KEY, children: jsxRuntime.jsxs(react$1.RPProvider, { src: pdfUrl, children: [jsxRuntime.jsx(CustomZoomLayout, {}), jsxRuntime.jsx(react$1.RPDefaultLayout, { style: {
340
+ return (jsxRuntime.jsx("div", { className: "bunny-rounded bunny-w-full bunny-overflow-hidden bunny-grow bunny-min-h-0", style: { height: '70vh' }, children: jsxRuntime.jsx(react$1.RPConfig, { licenseKey: LISENSE_KEY, children: jsxRuntime.jsxs(react$1.RPProvider, { src: pdfUrl, children: [jsxRuntime.jsx(CustomZoomLayout, {}), jsxRuntime.jsx(react$1.RPDefaultLayout, { style: {
341
341
  width: '100%',
342
342
  height: '100%',
343
343
  }, slots: {
@@ -346,8 +346,9 @@ const DocumentTemplatePreview = ({ targetUrl }) => {
346
346
  }, children: jsxRuntime.jsx(react$1.RPPages, {}) })] }) }) }));
347
347
  };
348
348
 
349
+ const { Text: Text$A } = antd.Typography;
349
350
  function BackButton({ onClick, title }) {
350
- return (jsxRuntime.jsxs(StyledBackButton, { className: "bunny-flex bunny-items-center bunny-gap-2 bunny-p-0 bunny-text-gray-400", onClick: onClick, children: [jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { className: "pt-0.5", icon: freeSolidSvgIcons.faArrowLeft }), jsxRuntime.jsx("div", { className: "bunny-text-sm", children: title || 'back' })] }));
351
+ return (jsxRuntime.jsxs(StyledBackButton, { className: "bunny-flex bunny-items-center bunny-gap-2 bunny-p-0 bunny-text-gray-400", onClick: onClick, children: [jsxRuntime.jsx(reactFontawesome.FontAwesomeIcon, { className: "pt-0.5", icon: freeSolidSvgIcons.faArrowLeft }), jsxRuntime.jsx(Text$A, { className: "bunny-text-sm bunny-text-gray-400", children: title || 'back' })] }));
351
352
  }
352
353
  const StyledBackButton = styled.button `
353
354
  border: none;
@@ -18329,7 +18330,7 @@ const ChinaUnionPay = ({ className }) => {
18329
18330
  };
18330
18331
 
18331
18332
  const CreditCard = ({ className }) => {
18332
- return (jsxRuntime.jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsxRuntime.jsx("path", { d: "M1 10L59 10", stroke: "#D3D3D3", "stroke-width": "7" }), jsxRuntime.jsx("path", { d: "M5 20H34", stroke: "#D3D3D3", "stroke-width": "2", "stroke-linecap": "round" }), jsxRuntime.jsx("path", { d: "M5 27H25", stroke: "#D3D3D3", "stroke-width": "2", "stroke-linecap": "round" }), jsxRuntime.jsx("rect", { x: "46", y: "21", width: "10", height: "7", rx: "2", fill: "#D9D9D9" })] }));
18333
+ return (jsxRuntime.jsxs("svg", { className: className, width: "60", height: "38", viewBox: "0 0 60 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "59", height: "37", rx: "7.5", fill: "white", stroke: "#D3D3D3" }), jsxRuntime.jsx("path", { d: "M1 10L59 10", stroke: "#D3D3D3", "stroke-width": "7" }), jsxRuntime.jsx("path", { d: "M5 20H34", stroke: "#D3D3D3", "stroke-width": "2", strokeLinecap: "round" }), jsxRuntime.jsx("path", { d: "M5 27H25", stroke: "#D3D3D3", "stroke-width": "2", strokeLinecap: "round" }), jsxRuntime.jsx("rect", { x: "46", y: "21", width: "10", height: "7", rx: "2", fill: "#D9D9D9" })] }));
18333
18334
  };
18334
18335
 
18335
18336
  const DinersClub = ({ className }) => {
@@ -18368,7 +18369,7 @@ const Bancontact = ({ className }) => {
18368
18369
  return (jsxRuntime.jsxs("svg", { className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.2243 35.1715C18.2243 34.882 18.156 34.6314 18.0199 34.4199C17.8835 34.2083 17.7043 34.0468 17.4819 33.9355C17.7043 33.8242 17.8766 33.6597 17.9991 33.4426C18.1214 33.2255 18.1825 32.9806 18.1825 32.7078V32.5575C18.1825 32.2233 18.1186 31.9451 17.9908 31.7223C17.8628 31.4996 17.6833 31.3213 17.4526 31.1878C17.2219 31.0541 16.9451 30.9582 16.6227 30.8995C16.3 30.8411 15.9414 30.812 15.5465 30.812C15.4131 30.812 15.274 30.8147 15.1296 30.8203C14.9848 30.8258 14.8445 30.8328 14.7083 30.8411C14.572 30.8494 14.4468 30.8593 14.3329 30.8704C14.2188 30.8817 14.1256 30.8928 14.0534 30.9037C13.8921 30.9318 13.7781 30.9817 13.7114 31.0541C13.6448 31.1266 13.6113 31.2575 13.6113 31.4467V36.5245C13.6113 36.7139 13.646 36.8447 13.7156 36.917C13.7851 36.9895 13.9032 37.0394 14.0702 37.0673C14.1535 37.084 14.2536 37.0979 14.3704 37.1091C14.4871 37.1202 14.6136 37.1299 14.7499 37.1383C14.8862 37.1466 15.0265 37.1535 15.1711 37.1593C15.3158 37.1646 15.4575 37.1676 15.5966 37.1676C15.9581 37.1676 16.2986 37.1397 16.6185 37.084C16.9381 37.0285 17.2161 36.9295 17.4526 36.7874C17.689 36.6456 17.8766 36.4534 18.0157 36.2113C18.1546 35.969 18.2243 35.6642 18.2243 35.2967V35.1715ZM16.8063 32.7746C16.8063 32.8637 16.7924 32.9487 16.7645 33.0293C16.7366 33.11 16.6909 33.1795 16.627 33.2383C16.5629 33.2966 16.4768 33.3439 16.3684 33.38C16.2599 33.4162 16.1222 33.4343 15.9554 33.4343H15.0213V31.9895C15.049 31.9895 15.0921 31.9883 15.1505 31.9853C15.2089 31.9825 15.27 31.9812 15.3339 31.9812H15.6551C16.0833 31.9812 16.3822 32.0354 16.5518 32.144C16.7214 32.2526 16.8063 32.421 16.8063 32.6492V32.7746ZM16.5935 35.8062C16.7576 35.6782 16.8397 35.4971 16.8397 35.2634V35.1714C16.8397 34.971 16.7756 34.797 16.6478 34.6494C16.5198 34.502 16.289 34.4282 15.9554 34.4282H15.0213V35.9898H15.1671C15.231 35.9898 15.2977 35.9916 15.3673 35.9942C15.4368 35.9969 15.5035 35.9985 15.5676 35.9985H15.7051C16.1333 35.9985 16.4295 35.9343 16.5935 35.8062ZM22.7955 33.9438C22.7955 33.6377 22.7496 33.3772 22.6578 33.1629C22.5662 32.9487 22.4368 32.7732 22.27 32.6367C22.1032 32.5004 21.8988 32.4003 21.6568 32.3362C21.415 32.2722 21.1439 32.2401 20.8436 32.2401C20.5654 32.2401 20.2943 32.2597 20.0303 32.2987C19.766 32.3375 19.556 32.3766 19.4005 32.4154C19.2948 32.4435 19.242 32.5046 19.242 32.5991V33.2756C19.242 33.3314 19.2559 33.3705 19.2837 33.3925C19.3115 33.4149 19.3475 33.4261 19.3922 33.4261H19.4337C19.5006 33.4204 19.5839 33.4135 19.684 33.4051C19.7842 33.3968 19.8968 33.3901 20.022 33.3842C20.1471 33.3788 20.2777 33.3746 20.414 33.3717C20.5501 33.3689 20.6851 33.3675 20.8186 33.3675C21.0131 33.3675 21.1661 33.4038 21.2773 33.4761C21.3885 33.5486 21.4441 33.7045 21.4441 33.9438V34.2445H20.9937C20.2763 34.2445 19.7549 34.3572 19.4296 34.5827C19.1043 34.8081 18.9416 35.1659 18.9416 35.6558V35.7313C18.9416 36.0039 18.982 36.2321 19.0625 36.4158C19.1431 36.5996 19.2503 36.7472 19.3837 36.8587C19.5172 36.9699 19.6686 37.0493 19.8384 37.0964C20.008 37.1438 20.1846 37.1676 20.3681 37.1676C20.6184 37.1676 20.8339 37.1341 21.0145 37.0673C21.1952 37.0005 21.3662 36.9086 21.5276 36.7917V36.9253C21.5276 36.9699 21.5442 37.0089 21.5776 37.0422C21.6111 37.0756 21.6499 37.0923 21.6944 37.0923H22.6287C22.6731 37.0923 22.712 37.0756 22.7455 37.0422C22.7789 37.0089 22.7955 36.9699 22.7955 36.9253V33.9438ZM21.1481 36.0942C21.2619 36.0581 21.3691 36.015 21.4692 35.9648V35.0462H20.9937C20.8491 35.0462 20.7296 35.0587 20.635 35.0837C20.5404 35.1088 20.4653 35.1465 20.4098 35.1966C20.3542 35.2465 20.3152 35.3107 20.2931 35.3886C20.2707 35.4666 20.2596 35.5556 20.2596 35.6558V35.7312C20.2596 35.9092 20.3026 36.0233 20.3889 36.0734C20.4751 36.1235 20.6071 36.1485 20.7852 36.1485C20.913 36.1485 21.0339 36.1306 21.1481 36.0942ZM27.9007 36.917V34.1358C27.9007 33.8744 27.8799 33.6278 27.8381 33.3968C27.7964 33.166 27.7214 32.9653 27.6129 32.7954C27.5045 32.6256 27.3543 32.4905 27.1624 32.3904C26.9707 32.2902 26.7245 32.2401 26.4242 32.2401C26.1572 32.2401 25.9208 32.2723 25.7152 32.3369C25.5094 32.4014 25.2925 32.515 25.0646 32.6776V32.4752C25.0646 32.4305 25.0478 32.3911 25.0145 32.3575C24.9811 32.3238 24.9421 32.3068 24.8976 32.3068H23.9634C23.9187 32.3068 23.8799 32.3235 23.8467 32.357C23.8133 32.3904 23.7966 32.4295 23.7966 32.4739V36.917C23.7966 36.9615 23.8145 37.0019 23.8508 37.038C23.8869 37.0743 23.9272 37.0923 23.9717 37.0923H24.9811C25.0256 37.0923 25.0646 37.0743 25.0978 37.0382C25.1313 37.0021 25.1479 36.9619 25.1479 36.9173V33.6341C25.2925 33.5564 25.4287 33.4925 25.5567 33.4426C25.6845 33.3925 25.8096 33.3675 25.932 33.3675C26.0599 33.3675 26.1642 33.38 26.2449 33.4051C26.3254 33.4301 26.388 33.4731 26.4325 33.5345C26.477 33.5954 26.5076 33.6759 26.5243 33.7757C26.5409 33.8758 26.5494 33.9981 26.5494 34.1425V36.9173C26.5494 36.9619 26.566 37.0021 26.5994 37.0382C26.6327 37.0743 26.6715 37.0923 26.7162 37.0923H27.7255C27.7699 37.0923 27.8102 37.0743 27.8464 37.038C27.8826 37.0019 27.9007 36.9615 27.9007 36.917ZM32.0047 36.1071V36.8502C32.0047 36.9114 31.9907 36.9546 31.963 36.9796C31.9351 37.0047 31.8906 37.0255 31.8294 37.0422C31.7127 37.0701 31.5611 37.0978 31.3749 37.1259C31.1885 37.1535 30.9703 37.1676 30.72 37.1676C30.1305 37.1676 29.6592 36.9867 29.3062 36.6246C28.953 36.2628 28.7765 35.7394 28.7765 35.0546V34.3531C28.7765 33.6682 28.953 33.1448 29.3062 32.7831C29.6592 32.421 30.1305 32.2401 30.72 32.2401C30.9703 32.2401 31.1885 32.254 31.3749 32.2817C31.5611 32.3098 31.7127 32.3375 31.8294 32.3653C31.8906 32.3819 31.9351 32.4029 31.963 32.4279C31.9907 32.453 32.0047 32.4962 32.0047 32.5574V33.3007C32.0047 33.3453 31.9893 33.38 31.9588 33.4051C31.9281 33.4301 31.8906 33.4426 31.8462 33.4426H31.8294C31.6737 33.4261 31.5251 33.4121 31.3832 33.401C31.2413 33.3901 31.0508 33.3842 30.8118 33.3842C30.7172 33.3842 30.6283 33.3996 30.5448 33.4301C30.4613 33.4608 30.3891 33.5137 30.328 33.5888C30.2666 33.6641 30.2181 33.7641 30.1819 33.8895C30.1457 34.0147 30.1277 34.1692 30.1277 34.3531V35.0546C30.1277 35.2382 30.1457 35.3927 30.1819 35.5181C30.2181 35.6433 30.2666 35.7436 30.328 35.8187C30.3891 35.8939 30.4613 35.9468 30.5448 35.9774C30.6283 36.008 30.7172 36.0233 30.8118 36.0233C31.0508 36.0233 31.2413 36.0178 31.3832 36.0067C31.5251 35.9956 31.6737 35.9815 31.8294 35.9649H31.8462C31.8906 35.9649 31.9281 35.9774 31.9588 36.0025C31.9893 36.0276 32.0047 36.0623 32.0047 36.1071ZM36.6346 34.4115C36.6346 34.0773 36.5885 33.7768 36.4966 33.5095C36.4046 33.2423 36.2709 33.0155 36.0954 32.8289C35.9199 32.6424 35.7025 32.4976 35.4436 32.3946C35.1844 32.2918 34.8848 32.2401 34.5449 32.2401C34.2051 32.2401 33.9056 32.2918 33.6465 32.3946C33.3873 32.4976 33.1685 32.6424 32.9903 32.8289C32.8119 33.0155 32.6768 33.2423 32.585 33.5095C32.4928 33.7768 32.4469 34.0773 32.4469 34.4115V34.9961C32.4469 35.3301 32.4928 35.6309 32.585 35.8981C32.6768 36.1653 32.8119 36.3922 32.9903 36.5788C33.1685 36.7654 33.3873 36.91 33.6465 37.013C33.9056 37.1159 34.2051 37.1676 34.5449 37.1676C34.8848 37.1676 35.1844 37.1159 35.4436 37.013C35.7025 36.91 35.9199 36.7654 36.0954 36.5788C36.2709 36.3922 36.4046 36.1653 36.4966 35.8981C36.5885 35.6309 36.6346 35.3301 36.6346 34.9961V34.4115ZM34.5449 36.0233C35.037 36.0233 35.2832 35.6809 35.2832 34.9961V34.4115C35.2832 33.7322 35.037 33.3925 34.5449 33.3925C34.3016 33.3925 34.1164 33.4774 33.9893 33.6472C33.8619 33.8172 33.7984 34.0719 33.7984 34.4115V34.9961C33.7984 35.3357 33.8619 35.5918 33.9893 35.7644C34.1164 35.9371 34.3016 36.0233 34.5449 36.0233ZM41.5976 36.917V34.1358C41.5976 33.8744 41.5765 33.6278 41.5351 33.3968C41.4933 33.166 41.4181 32.9653 41.3095 32.7954C41.2011 32.6256 41.0511 32.4905 40.8593 32.3904C40.6674 32.2902 40.4213 32.2401 40.1211 32.2401C39.8542 32.2401 39.6177 32.2723 39.4119 32.3369C39.2062 32.4014 38.9893 32.515 38.7613 32.6776V32.4752C38.7613 32.4305 38.7447 32.3911 38.7111 32.3575C38.678 32.3238 38.6389 32.3068 38.5945 32.3068H37.6602C37.6157 32.3068 37.5769 32.3235 37.5434 32.357C37.5102 32.3904 37.4934 32.4295 37.4934 32.4739V36.917C37.4934 36.9615 37.5114 37.0019 37.5476 37.038C37.5838 37.0743 37.624 37.0923 37.6687 37.0923H38.678C38.7224 37.0923 38.7613 37.0743 38.7948 37.0382C38.828 37.0021 38.8448 36.9619 38.8448 36.9173V33.6341C38.9893 33.5564 39.1256 33.4925 39.2534 33.4426C39.3815 33.3925 39.5065 33.3675 39.629 33.3675C39.7568 33.3675 39.8611 33.38 39.9416 33.4051C40.0222 33.4301 40.0849 33.4731 40.1294 33.5345C40.1739 33.5954 40.2044 33.6759 40.2212 33.7757C40.2378 33.8758 40.2462 33.9981 40.2462 34.1425V36.9173C40.2462 36.9619 40.2628 37.0021 40.2962 37.0382C40.3296 37.0743 40.3684 37.0923 40.413 37.0923H41.4223C41.4668 37.0923 41.5072 37.0743 41.5434 37.038C41.5794 37.0019 41.5976 36.9615 41.5976 36.917ZM45.2348 36.2893V36.9357C45.2348 37.0295 45.182 37.0848 45.0763 37.1011C44.9483 37.1233 44.8371 37.1398 44.7427 37.1509C44.6481 37.162 44.5395 37.1675 44.4174 37.1675C44.1905 37.1675 43.9901 37.1493 43.816 37.1133C43.6419 37.077 43.4966 37.0061 43.3805 36.9003C43.2646 36.7945 43.1761 36.6483 43.1153 36.4617C43.0547 36.2753 43.0242 36.0347 43.0242 35.7394V33.3175L42.357 33.2088C42.3123 33.1977 42.2721 33.1769 42.2359 33.1462C42.1997 33.1157 42.1817 33.0781 42.1817 33.0335V32.4822C42.1817 32.4378 42.1997 32.3974 42.2359 32.3611C42.2721 32.325 42.3123 32.3068 42.357 32.3068H43.0242V31.622C43.0242 31.5774 43.0409 31.5414 43.0739 31.5134C43.1068 31.4857 43.1458 31.4663 43.1902 31.455L44.2016 31.2798H44.2263C44.2705 31.2798 44.3065 31.2921 44.3343 31.3171C44.3618 31.3423 44.3757 31.3771 44.3757 31.4215V32.3068H45.0597C45.104 32.3068 45.143 32.3237 45.1764 32.3573C45.2099 32.3909 45.2265 32.4305 45.2265 32.4752V33.1573C45.2265 33.2024 45.2099 33.2416 45.1764 33.2752C45.143 33.3089 45.104 33.3257 45.0597 33.3257H44.3757V35.7561C44.3757 35.9231 44.3895 36.0304 44.4174 36.0776C44.4451 36.1249 44.5229 36.1485 44.6507 36.1485H45.0597C45.1764 36.1485 45.2348 36.1955 45.2348 36.2893ZM49.6891 33.9438C49.6891 33.6377 49.6433 33.3772 49.5514 33.1629C49.4597 32.9487 49.3305 32.7732 49.1637 32.6367C48.9969 32.5004 48.7925 32.4003 48.5505 32.3362C48.3087 32.2722 48.0376 32.2401 47.7373 32.2401C47.4589 32.2401 47.188 32.2597 46.924 32.2987C46.6597 32.3375 46.4497 32.3766 46.2942 32.4154C46.1882 32.4435 46.1357 32.5046 46.1357 32.5991V33.2756C46.1357 33.3314 46.1494 33.3705 46.1773 33.3925C46.2052 33.4149 46.2412 33.4261 46.2857 33.4261H46.3274C46.3943 33.4204 46.4776 33.4135 46.5777 33.4051C46.6779 33.3968 46.7905 33.3901 46.9155 33.3842C47.0408 33.3788 47.1714 33.3746 47.3077 33.3717C47.4438 33.3689 47.5788 33.3675 47.7121 33.3675C47.9068 33.3675 48.0598 33.4038 48.171 33.4761C48.2822 33.5486 48.3378 33.7045 48.3378 33.9438V34.2445H47.8874C47.1698 34.2445 46.6486 34.3572 46.3233 34.5827C45.998 34.8081 45.8353 35.1659 45.8353 35.6558V35.7313C45.8353 36.0039 45.8755 36.2321 45.9562 36.4158C46.0366 36.5996 46.144 36.7472 46.2774 36.8587C46.4109 36.9699 46.5623 37.0493 46.7321 37.0964C46.9017 37.1438 47.0782 37.1676 47.2618 37.1676C47.5121 37.1676 47.7274 37.1341 47.9082 37.0673C48.0889 37.0005 48.2597 36.9086 48.4213 36.7917V36.9253C48.4213 36.9699 48.4379 37.0089 48.4713 37.0422C48.5046 37.0756 48.5436 37.0923 48.5881 37.0923H49.5224C49.5668 37.0923 49.6057 37.0756 49.6392 37.0422C49.6724 37.0089 49.6891 36.9699 49.6891 36.9253V33.9438ZM48.0418 36.0942C48.1556 36.0581 48.2628 36.015 48.3629 35.9648V35.0462H47.8874C47.7428 35.0462 47.6233 35.0587 47.5287 35.0837C47.4341 35.1088 47.359 35.1465 47.3035 35.1966C47.2477 35.2465 47.2088 35.3107 47.1868 35.3886C47.1644 35.4666 47.1533 35.5556 47.1533 35.6558V35.7312C47.1533 35.9092 47.1963 36.0233 47.2826 36.0734C47.3688 36.1235 47.5008 36.1485 47.6789 36.1485C47.8067 36.1485 47.9274 36.1306 48.0418 36.0942ZM53.7933 36.8502V36.1071C53.7933 36.0623 53.7779 36.0276 53.7474 36.0025C53.7167 35.9774 53.6793 35.9649 53.6348 35.9649H53.6181C53.4624 35.9815 53.3136 35.9956 53.1718 36.0067C53.0301 36.0178 52.8395 36.0233 52.6005 36.0233C52.5057 36.0233 52.4167 36.008 52.3336 35.9774C52.2501 35.9468 52.1777 35.8939 52.1165 35.8187C52.0554 35.7436 52.0067 35.6433 51.9707 35.5181C51.9343 35.3927 51.9165 35.2382 51.9165 35.0546V34.3531C51.9165 34.1692 51.9343 34.0147 51.9707 33.8895C52.0067 33.7641 52.0554 33.6641 52.1165 33.5888C52.1777 33.5137 52.2501 33.4608 52.3336 33.4301C52.4167 33.3996 52.5057 33.3842 52.6005 33.3842C52.8395 33.3842 53.0301 33.3901 53.1718 33.401C53.3136 33.4121 53.4624 33.4261 53.6181 33.4426H53.6348C53.6793 33.4426 53.7167 33.4301 53.7474 33.4051C53.7779 33.38 53.7933 33.3453 53.7933 33.3007V32.5574C53.7933 32.4962 53.7794 32.453 53.7515 32.4279C53.7235 32.4029 53.6793 32.3819 53.6181 32.3653C53.5014 32.3375 53.3497 32.3098 53.1635 32.2817C52.9771 32.254 52.759 32.2401 52.5087 32.2401C51.9189 32.2401 51.4479 32.421 51.0947 32.7831C50.7415 33.1448 50.565 33.6682 50.565 34.3531V35.0546C50.565 35.7394 50.7415 36.2628 51.0947 36.6246C51.4479 36.9867 51.9189 37.1676 52.5087 37.1676C52.759 37.1676 52.9771 37.1535 53.1635 37.1259C53.3497 37.0978 53.5014 37.0701 53.6181 37.0422C53.6793 37.0255 53.7235 37.0047 53.7515 36.9796C53.7794 36.9546 53.7933 36.9114 53.7933 36.8502ZM57.3884 36.2893V36.9357C57.3884 37.0295 57.3354 37.0848 57.2299 37.1011C57.1019 37.1233 56.9907 37.1398 56.8963 37.1509C56.8016 37.162 56.6931 37.1675 56.571 37.1675C56.3441 37.1675 56.1437 37.1493 55.9696 37.1133C55.7954 37.077 55.6502 37.0061 55.5343 36.9003C55.4183 36.7945 55.3298 36.6483 55.269 36.4617C55.2083 36.2753 55.1778 36.0347 55.1778 35.7394V33.3175L54.5106 33.2088C54.4659 33.1977 54.4257 33.1769 54.3895 33.1462C54.3533 33.1157 54.3353 33.0781 54.3353 33.0335V32.4822C54.3353 32.4378 54.3533 32.3974 54.3895 32.3611C54.4257 32.325 54.4659 32.3068 54.5106 32.3068H55.1778V31.622C55.1778 31.5774 55.1945 31.5414 55.2276 31.5134C55.2605 31.4857 55.2993 31.4663 55.3436 31.455L56.355 31.2798H56.38C56.4241 31.2798 56.4602 31.2921 56.4875 31.3171C56.5154 31.3423 56.5293 31.3771 56.5293 31.4215V32.3068H57.2133C57.2577 32.3068 57.2966 32.3237 57.3301 32.3573C57.3633 32.3909 57.3801 32.4305 57.3801 32.4752V33.1573C57.3801 33.2024 57.3633 33.2416 57.3301 33.2752C57.2966 33.3089 57.2577 33.3257 57.2133 33.3257H56.5293V35.7561C56.5293 35.9231 56.5431 36.0304 56.571 36.0776C56.5987 36.1249 56.6765 36.1485 56.8045 36.1485H57.2133C57.3301 36.1485 57.3884 36.1955 57.3884 36.2893Z", fill: "#005697" }), jsxRuntime.jsx("path", { d: "M52.6187 14.7398H39.0664L37.6881 16.2935L33.2155 21.3349V21.3351L31.8372 22.8886H18.464L19.821 21.3153L20.4633 20.5706L21.8202 18.9973H15.6582C14.5325 18.9973 13.6113 19.943 13.6113 21.0987V25.5326C13.6113 26.6885 14.5325 27.6342 15.6582 27.6342H39.2492C40.3749 27.6342 41.9127 26.9318 42.6665 26.0733L46.235 22.0097L52.6187 14.7398Z", fill: "#005697" }), jsxRuntime.jsx("path", { d: "M55.3418 10C56.4676 10 57.3887 10.9457 57.3887 12.1015V16.5353C57.3887 17.691 56.4676 18.6368 55.3418 18.6368H49.1999L50.5697 17.0753H50.5699L51.2491 16.3012L52.6189 14.7398H39.0667L31.8375 22.8945H18.3813L28.0314 11.9701L28.3966 11.5566C29.153 10.7005 30.6929 10 31.8186 10H55.3418V10Z", fill: "#FBD500" })] }));
18369
18370
  };
18370
18371
 
18371
- const { Text: Text$w } = antd.Typography;
18372
+ const { Text: Text$z } = antd.Typography;
18372
18373
  const MiniCreditCard = ({ className, buttons, hideDropdownMenu = false, hideDefaultTag = false, onClickRemove, paymentMethodData, onClickSetDefault, id, }) => {
18373
18374
  const { darkMode } = react.useContext(BunnyContext);
18374
18375
  const borderColor = react.useMemo(() => {
@@ -18378,7 +18379,7 @@ const MiniCreditCard = ({ className, buttons, hideDropdownMenu = false, hideDefa
18378
18379
  return darkMode ? 'var(--row-background-alternate)' : 'bg-slate-50';
18379
18380
  }, [darkMode]);
18380
18381
  const isDefault = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.isDefault;
18381
- return (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-row bunny-justify-between bunny-items-center bunny-p-1 bunny-px-3 bunny-border-solid ${backgroundColor} bunny-${borderColor} bunny-rounded-md bunny-border ${className}`, id: id, children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-row bunny-gap-4", children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2 bunny-space-between bunny-w-full", children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Issuer, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Identifier, { paymentMethodData: paymentMethodData }), !hideDefaultTag && (jsxRuntime.jsx("div", { children: isDefault ? (jsxRuntime.jsx(antd.Tag, { bordered: false, color: "blue", children: "Default" })) : null }))] }) }), buttons ? (buttons) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideDropdownMenu && (jsxRuntime.jsx(DropdownMenu, { setDefault: onClickSetDefault, remove: onClickRemove, isDefault: isDefault !== null && isDefault !== void 0 ? isDefault : false, id: `credit-card-dropdown-${paymentMethodData.id}` })) }))] })) : (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-items-center justify-between w-full", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-center", children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$w, { className: "bunny-text-slate-400", style: { fontSize: '12px' }, children: "No payment methods" })] }), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" }), buttons] })) }));
18382
+ return (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-row bunny-justify-between bunny-items-center bunny-p-1 bunny-px-3 bunny-border-solid ${backgroundColor} bunny-${borderColor} bunny-rounded-md bunny-border ${className}`, id: id, children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-row bunny-gap-4", children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2 bunny-space-between bunny-w-full", children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Issuer, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Identifier, { paymentMethodData: paymentMethodData }), !hideDefaultTag && (jsxRuntime.jsx("div", { children: isDefault ? (jsxRuntime.jsx(antd.Tag, { bordered: false, color: "blue", children: "Default" })) : null }))] }) }), buttons ? (buttons) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideDropdownMenu && (jsxRuntime.jsx(DropdownMenu, { setDefault: onClickSetDefault, remove: onClickRemove, isDefault: isDefault !== null && isDefault !== void 0 ? isDefault : false, id: `credit-card-dropdown-${paymentMethodData.id}` })) }))] })) : (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-items-center justify-between w-full", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-center", children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$z, { className: "bunny-text-slate-400", style: { fontSize: '12px' }, children: "No payment methods" })] }), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" }), buttons] })) }));
18382
18383
  };
18383
18384
  const Identifier = ({ paymentMethodData }) => {
18384
18385
  var _a, _b, _c;
@@ -18386,9 +18387,9 @@ const Identifier = ({ paymentMethodData }) => {
18386
18387
  return null;
18387
18388
  }
18388
18389
  if (((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.type) === 'cashapp') {
18389
- return jsxRuntime.jsx(Text$w, { children: "Cashapp" });
18390
+ return jsxRuntime.jsx(Text$z, { children: "Cashapp" });
18390
18391
  }
18391
- return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Text$w, { className: "relative -top-0.5", children: "****" }), jsxRuntime.jsx(Text$w, { children: (_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.identifier })] }));
18392
+ return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Text$z, { className: "relative -top-0.5", children: "****" }), jsxRuntime.jsx(Text$z, { children: (_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.identifier })] }));
18392
18393
  };
18393
18394
  const Issuer = ({ paymentMethodData }) => {
18394
18395
  var _a;
@@ -18396,7 +18397,7 @@ const Issuer = ({ paymentMethodData }) => {
18396
18397
  const issuer = (_a = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _a === void 0 ? void 0 : _a.issuer;
18397
18398
  if (issuer.length == 0 || list.includes(issuer.toLowerCase()))
18398
18399
  return null;
18399
- return jsxRuntime.jsx(Text$w, { children: lodashExports.capitalize(issuer) });
18400
+ return jsxRuntime.jsx(Text$z, { children: lodashExports.capitalize(issuer) });
18400
18401
  };
18401
18402
  const DropdownMenu = ({ setDefault, remove, isDefault, id, }) => {
18402
18403
  // Define the menu items
@@ -18657,7 +18658,7 @@ function useSave$1({ onSaveSuccess, onSaveError, token, apiHost, accountId, }) {
18657
18658
  return { save, isSaving };
18658
18659
  }
18659
18660
 
18660
- const { Text: Text$v } = antd.Typography;
18661
+ const { Text: Text$y } = antd.Typography;
18661
18662
  const TEST_CARD = '4242424242424242';
18662
18663
  const DemoPayForm = ({ onFail, onSavePaymentMethod, plugin, }) => {
18663
18664
  // Context
@@ -18708,7 +18709,7 @@ const DemoPayForm = ({ onFail, onSavePaymentMethod, plugin, }) => {
18708
18709
  const onCardCvcChange = (cvc) => {
18709
18710
  setCardDetails({ ...cardDetails, cvc });
18710
18711
  };
18711
- return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxRuntime.jsxs(StyledInputs, { className: "bunny-flex bunny-flex-col bunny-gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false, children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-2", children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] })] }), jsxRuntime.jsx(Text$v, { children: "DemoPay is for testing only." }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSave })] }));
18712
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxRuntime.jsxs(StyledInputs, { className: "bunny-flex bunny-flex-col bunny-gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false, children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-2", children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] })] }), jsxRuntime.jsx(Text$y, { children: "DemoPay is for testing only." }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSave })] }));
18712
18713
  };
18713
18714
  const StyledInputs = defaultStyled.div `
18714
18715
  .ant-input {
@@ -18841,7 +18842,7 @@ const CardIcon = ({ className }) => {
18841
18842
  return (jsxRuntime.jsxs("svg", { className: className, width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("path", { d: "M15 3.75H3C2.17157 3.75 1.5 4.42157 1.5 5.25V12.75C1.5 13.5784 2.17157 14.25 3 14.25H15C15.8284 14.25 16.5 13.5784 16.5 12.75V5.25C16.5 4.42157 15.8284 3.75 15 3.75Z", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M1.5 7.5H16.5", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
18842
18843
  };
18843
18844
 
18844
- const { Text: Text$u } = antd.Typography;
18845
+ const { Text: Text$x } = antd.Typography;
18845
18846
  const PaymentMethodSelector = ({ paymentMethodAllowedPlugins, onSelect, value, }) => {
18846
18847
  return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.map((plugin, index) => (jsxRuntime.jsx(PaymentOption, { name: plugin.name, onClick: onSelect, paymentPlugin: plugin, selected: (value === null || value === void 0 ? void 0 : value.id) === plugin.id }, index))) }));
18847
18848
  };
@@ -18852,7 +18853,7 @@ const PaymentOption = ({ selected, paymentPlugin, onClick, name, }) => {
18852
18853
  const isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes('card');
18853
18854
  return (jsxRuntime.jsxs(PaymentOptionContainer, { "$brandColor": brandColor, "$selected": selected, className: `bunny-flex bunny-justify-between bunny-items-center bunny-cursor-pointer bunny-py-2 bunny-rounded bunny-border-solid ${darkMode
18854
18855
  ? `var(--row-background-dark) border-gray-500`
18855
- : 'bunny-bg-slate-50 bunny-border-slate-200'} bunny-border`, onClick: () => onClick(paymentPlugin), children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-2 bunny-items-center bunny-pl-4", children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? 'border-gray-400' : '' }), jsxRuntime.jsx(Text$u, { children: name })] }), isAch ? (jsxRuntime.jsx(icons.BankOutlined, { className: "bunny-pr-4" })) : isCard ? (jsxRuntime.jsx(CardIcon, { className: "bunny-pr-4" })) : (jsxRuntime.jsx(CardIcon, { className: "bunny-pr-4" }))] }));
18856
+ : 'bunny-bg-slate-50 bunny-border-slate-200'} bunny-border`, onClick: () => onClick(paymentPlugin), children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-2 bunny-items-center bunny-pl-4", children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? 'border-gray-400' : '' }), jsxRuntime.jsx(Text$x, { children: name })] }), isAch ? (jsxRuntime.jsx(icons.BankOutlined, { className: "bunny-pr-4" })) : isCard ? (jsxRuntime.jsx(CardIcon, { className: "bunny-pr-4" })) : (jsxRuntime.jsx(CardIcon, { className: "bunny-pr-4" }))] }));
18856
18857
  };
18857
18858
  const PaymentOptionContainer = defaultStyled.div `
18858
18859
  transition: border 0.3s ease;
@@ -19596,7 +19597,7 @@ const PaymentHoldModal = ({ visible, setVisible, quote, }) => {
19596
19597
  } }) })] }));
19597
19598
  };
19598
19599
 
19599
- const { Text: Text$t } = antd.Typography;
19600
+ const { Text: Text$w } = antd.Typography;
19600
19601
  defaultStyled.div `
19601
19602
  Text {
19602
19603
  width: 100%;
@@ -19687,7 +19688,7 @@ function QuoteButtons({ isAccepted, formattedQuote, isMobile, hideDownloadButton
19687
19688
  const signingPlugins = useSigningPlugins({ apiHost, token });
19688
19689
  return (jsxRuntime.jsxs("div", { className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
19689
19690
  color: entityBranding.secondaryColor,
19690
- }, children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$t, { children: `Quote was accepted by ${formattedQuote.acceptedByName} on ${common.formatDate(formattedQuote.acceptedAt)}` })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", { className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2', children: [paymentHold ? (jsxRuntime.jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, { icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: () => downloadFile(apiHost + '/api/pdf/quote', token), children: "Download" })) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsxRuntime.jsx(antd.Button, { disabled: isExpired, onClick: () => setPaymentHoldModalVisible(true), type: "primary", children: "Pay to accept" })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isAccepted ? (jsxRuntime.jsx(antd.Button, { disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary", children: isExpired
19691
+ }, children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$w, { children: `Quote was accepted by ${formattedQuote.acceptedByName} on ${common.formatDate(formattedQuote.acceptedAt)}` })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", { className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2', children: [paymentHold ? (jsxRuntime.jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, { icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: () => downloadFile(apiHost + '/api/pdf/quote', token), children: "Download" })) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsxRuntime.jsx(antd.Button, { disabled: isExpired, onClick: () => setPaymentHoldModalVisible(true), type: "primary", children: "Pay to accept" })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isAccepted ? (jsxRuntime.jsx(antd.Button, { disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary", children: isExpired
19691
19692
  ? 'Quote is expired'
19692
19693
  : (signingPlugins === null || signingPlugins === void 0 ? void 0 : signingPlugins.length)
19693
19694
  ? 'Start signing'
@@ -19808,9 +19809,9 @@ const getColor = (state) => {
19808
19809
  }
19809
19810
  };
19810
19811
 
19811
- const { Text: Text$s } = antd.Typography;
19812
+ const { Text: Text$v } = antd.Typography;
19812
19813
  const TransactionDate = ({ date }) => {
19813
- return jsxRuntime.jsx(Text$s, { className: "bunny-text-sm", children: common.formatDate(date) });
19814
+ return jsxRuntime.jsx(Text$v, { className: "bunny-text-sm", children: common.formatDate(date) });
19814
19815
  };
19815
19816
 
19816
19817
  const ArrowDownToLine = ({ className, color = common.SLATE_600, }) => {
@@ -19854,13 +19855,13 @@ const TransactionGridCell = defaultStyled.div.withConfig({
19854
19855
  min-width: 48px;
19855
19856
  `;
19856
19857
 
19857
- const { Text: Text$r } = antd.Typography;
19858
+ const { Text: Text$u } = antd.Typography;
19858
19859
  const TransactionsEmptyState = () => {
19859
19860
  const { noTransactionsMessage } = react.useContext(TransactionsListContext);
19860
- return (jsxRuntime.jsx(Text$r, { className: "bunny-flex bunny-justify-center bunny-p-4 bunny-text-base", children: noTransactionsMessage || 'There are no transactions' }));
19861
+ return (jsxRuntime.jsx(Text$u, { className: "bunny-flex bunny-justify-center bunny-p-4 bunny-text-base", children: noTransactionsMessage || 'There are no transactions' }));
19861
19862
  };
19862
19863
 
19863
- const { Text: Text$q } = antd.Typography;
19864
+ const { Text: Text$t } = antd.Typography;
19864
19865
  const isInvoice = (transaction) => {
19865
19866
  return transaction.kind === 'INVOICE';
19866
19867
  };
@@ -19868,7 +19869,7 @@ const TransactionRowTitle = ({ transaction }) => {
19868
19869
  if (!isInvoice(transaction)) {
19869
19870
  return jsxRuntime.jsx(jsxRuntime.Fragment, {});
19870
19871
  }
19871
- return (jsxRuntime.jsx(Text$q, { className: "bunny-text-slate-400", style: { fontSize: '11px' }, children: transaction.transactionable.number }));
19872
+ return (jsxRuntime.jsx(Text$t, { className: "bunny-text-slate-400", style: { fontSize: '11px' }, children: transaction.transactionable.number }));
19872
19873
  };
19873
19874
 
19874
19875
  function transactionDateToDisplay(transaction, transactionDateType) {
@@ -19886,7 +19887,7 @@ function transactionDateToDisplay(transaction, transactionDateType) {
19886
19887
  }
19887
19888
  }
19888
19889
 
19889
- const { Text: Text$p } = antd.Typography;
19890
+ const { Text: Text$s } = antd.Typography;
19890
19891
  const TransactionsListDesktop = ({ transactions, onTransactionClick, }) => {
19891
19892
  const { columns, transactionDateType } = react.useContext(TransactionsListContext);
19892
19893
  const { apiHost, darkMode } = react.useContext(BunnyContext);
@@ -19914,11 +19915,11 @@ const TransactionsListDesktop = ({ transactions, onTransactionClick, }) => {
19914
19915
  !showState &&
19915
19916
  !showAmount &&
19916
19917
  !showDownload &&
19917
- !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(Text$p, { children: "No columns selected" }) })), showDate && (jsxRuntime.jsx(TransactionGridCell, { right: false, children: jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) }) })), showTitle && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(TransactionGridCell, { right: false, className: "bunny-flex bunny-items-center bunny-gap-2", children: [jsxRuntime.jsx(Text$p, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] }) })), showAccountName && (jsxRuntime.jsx(TransactionGridCell, { right: false, children: jsxRuntime.jsx(Text$p, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }) })), !showDate && !showTitle && !showAccountName && jsxRuntime.jsx(TransactionGridCell, { right: false }), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })), showState ? (jsxRuntime.jsx(TransactionGridCell, { right: false, children: jsxRuntime.jsx(StateTag, { state: transaction.state }) })) : null, showAmount && (jsxRuntime.jsx(TransactionGridCell, { right: true, children: jsxRuntime.jsx(Text$p, { children: common.formatCurrency(((_b = transaction === null || transaction === void 0 ? void 0 : transaction.transactionable) === null || _b === void 0 ? void 0 : _b.amount) || transaction.amount, transaction.currencyId) }) }))] }, index));
19918
+ !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(Text$s, { children: "No columns selected" }) })), showDate && (jsxRuntime.jsx(TransactionGridCell, { right: false, children: jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) }) })), showTitle && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(TransactionGridCell, { right: false, className: "bunny-flex bunny-items-center bunny-gap-2", children: [jsxRuntime.jsx(Text$s, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] }) })), showAccountName && (jsxRuntime.jsx(TransactionGridCell, { right: false, children: jsxRuntime.jsx(Text$s, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }) })), !showDate && !showTitle && !showAccountName && jsxRuntime.jsx(TransactionGridCell, { right: false }), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })), showState ? (jsxRuntime.jsx(TransactionGridCell, { right: false, children: jsxRuntime.jsx(StateTag, { state: transaction.state }) })) : null, showAmount && (jsxRuntime.jsx(TransactionGridCell, { right: true, children: jsxRuntime.jsx(Text$s, { children: common.formatCurrency(((_b = transaction === null || transaction === void 0 ? void 0 : transaction.transactionable) === null || _b === void 0 ? void 0 : _b.amount) || transaction.amount, transaction.currencyId) }) }))] }, index));
19918
19919
  }) }));
19919
19920
  };
19920
19921
 
19921
- const { Text: Text$o } = antd.Typography;
19922
+ const { Text: Text$r } = antd.Typography;
19922
19923
  const TransactionsListMobile = ({ transactions, onTransactionClick, }) => {
19923
19924
  const { columns, transactionDateType } = react.useContext(TransactionsListContext);
19924
19925
  const { apiHost, darkMode } = react.useContext(BunnyContext);
@@ -19940,11 +19941,11 @@ const TransactionsListMobile = ({ transactions, onTransactionClick, }) => {
19940
19941
  backgroundColor: index % 2 === 0
19941
19942
  ? `var(--row-background${darkMode ? '-dark' : ''})`
19942
19943
  : `var(--row-background-alternate${darkMode ? '-dark' : ''})`,
19943
- }, children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [(showTitle || showState) && (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2", children: [showTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$o, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] })), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2", children: [showAccountName && jsxRuntime.jsx(Text$o, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }), showAccountName && showDate && jsxRuntime.jsx(Text$o, { children: "\u00B7" }), showDate && (jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) })), showDate && showAmount && jsxRuntime.jsx(Text$o, { children: "\u00B7" }), showAmount && (jsxRuntime.jsx(Text$o, { children: common.formatCurrency(transaction.transactionable.amount || transaction.amount, transaction.currencyId) }))] })] }) }), showDownload && (jsxRuntime.jsx(TransactionGridCell, { right: true, children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) }))] }, index));
19944
+ }, children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [(showTitle || showState) && (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2", children: [showTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$r, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] })), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-2", children: [showAccountName && jsxRuntime.jsx(Text$r, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }), showAccountName && showDate && jsxRuntime.jsx(Text$r, { children: "\u00B7" }), showDate && (jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) })), showDate && showAmount && jsxRuntime.jsx(Text$r, { children: "\u00B7" }), showAmount && (jsxRuntime.jsx(Text$r, { children: common.formatCurrency(transaction.transactionable.amount || transaction.amount, transaction.currencyId) }))] })] }) }), showDownload && (jsxRuntime.jsx(TransactionGridCell, { right: true, children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) }))] }, index));
19944
19945
  }) }));
19945
19946
  };
19946
19947
 
19947
- const { Text: Text$n } = antd.Typography;
19948
+ const { Text: Text$q } = antd.Typography;
19948
19949
  const DISPLAY_WIDTH = 1200;
19949
19950
  function Transactions({ transactionComponent, showSearchBar = true, showTitle = true, title = 'Past transactions', columns = ['date', 'title', 'state', 'amount', 'download'], className, shadow = 'shadow-md', searchBarClassName, useModal = false, onTransactionClick, suppressTransactionDisplay = false, kindsToShow = [
19950
19951
  common.TransactionKind.INVOICE,
@@ -20048,7 +20049,7 @@ function TransactionsDisplay({ transactions, onSearchValueChanged, search, }) {
20048
20049
  onTransactionDisplayClose === null || onTransactionDisplayClose === void 0 ? void 0 : onTransactionDisplayClose(selectedTransaction);
20049
20050
  setDrawerOpen(false);
20050
20051
  }
20051
- return (jsxRuntime.jsxs("div", { style: style, children: [jsxRuntime.jsxs("div", { className: `bunny-flex bunny-flex-col bunny-w-full bunny-shadow-padding-xb bunny-gap-2 ${isMobile ? 'bunny-overflow-hidden' : ''} ${className}`, children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-col bunny-gap-1' : 'bunny-flex-row bunny-items-center'} bunny-justify-between`, children: [showTitle ? (jsxRuntime.jsx(Text$n, { className: "bunny-shrink-0 bunny-font-medium", style: { color: darkMode ? undefined : secondaryColor }, children: title })) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
20052
+ return (jsxRuntime.jsxs("div", { style: style, children: [jsxRuntime.jsxs("div", { className: `bunny-flex bunny-flex-col bunny-w-full bunny-shadow-padding-xb bunny-gap-2 ${isMobile ? 'bunny-overflow-hidden' : ''} ${className}`, children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-col bunny-gap-1' : 'bunny-flex-row bunny-items-center'} bunny-justify-between`, children: [showTitle ? (jsxRuntime.jsx(Text$q, { className: "bunny-shrink-0 bunny-font-medium", style: { color: darkMode ? undefined : secondaryColor }, children: title })) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
20052
20053
  ), showSearchBar && (jsxRuntime.jsx("div", { className: `${isMobile ? 'bunny-w-full' : ''}`, children: jsxRuntime.jsx(antd.Input, { className: searchBarClassName ? searchBarClassName : '', onChange: e => {
20053
20054
  if (isNaN(Number(e.target.value))) {
20054
20055
  return;
@@ -20161,1444 +20162,1540 @@ function QuotesWrapper() {
20161
20162
  return (jsxRuntime.jsx(TransactionsDisplay, { transactions: quotesAsTransactions, onSearchValueChanged: setSearch, search: search }));
20162
20163
  }
20163
20164
 
20164
- const MUTATION$7 = () => `
20165
- mutation AccountSignup (
20166
- $pluginId: String!,
20167
- $paymentMethodId: String,
20168
- $priceListCode: String!,
20169
- $accountId: ID!,
20170
- $quoteId: ID!,
20171
- ) {
20172
- accountSignup(
20173
- pluginId: $pluginId,
20174
- paymentMethodId: $paymentMethodId,
20175
- priceListCode: $priceListCode,
20176
- accountId: $accountId,
20177
- quoteId: $quoteId,
20178
- ) {
20179
- errors
20180
- quote {
20181
- accountId
20182
- amount
20183
- amountDue
20184
- applicationDate
20185
- applied
20186
- backdatedPeriods
20187
- backdatedQuote
20188
- billingDay
20189
- contactId
20190
- createdAt
20191
- credits
20192
- currencyId
20193
- dealId
20194
- discount
20195
- discountValue
20196
- endDate
20197
- evergreen
20198
- expiresAt
20199
- id
20200
- invoiceImmediately
20201
- invoiceImmediatelyAvailable
20202
- invoiceUntil
20203
- isPendingApprovalRequest
20204
- kind
20205
- message
20206
- name
20207
- netPaymentDays
20208
- notes
20209
- number
20210
- ownerId
20211
- payableId
20212
- periodAmount
20213
- poNumber
20214
- requiresApproval
20215
- smallUnitAmountDue
20216
- splitInvoice
20217
- startDate
20218
- state
20219
- subtotal
20220
- taxAmount
20221
- taxCode
20222
- updatedAt
20223
- uuid
20224
- }
20225
- }
20226
- }`;
20227
- const accountSignup = async ({ token, apiHost, accountId, quoteId, paymentToken, paymentMethodId, pluginId, priceListCode, }) => {
20228
- var _a;
20229
- const vars = {
20230
- accountId,
20231
- quoteId,
20232
- paymentToken,
20233
- pluginId,
20234
- paymentMethodId,
20235
- priceListCode,
20236
- };
20237
- const response = await gqlRequest({
20238
- query: MUTATION$7(),
20239
- token,
20240
- vars,
20241
- apiHost,
20242
- });
20243
- const errors = (_a = response === null || response === void 0 ? void 0 : response.accountSignup) === null || _a === void 0 ? void 0 : _a.errors;
20244
- if (errors)
20245
- throw errors;
20246
- return response === null || response === void 0 ? void 0 : response.accountSignup;
20165
+ var e$1 = {
20166
+ NAME: "Name",
20167
+ DOCUMENT: "Document",
20168
+ OPERATION_DEFINITION: "OperationDefinition",
20169
+ VARIABLE_DEFINITION: "VariableDefinition",
20170
+ SELECTION_SET: "SelectionSet",
20171
+ FIELD: "Field",
20172
+ ARGUMENT: "Argument",
20173
+ FRAGMENT_SPREAD: "FragmentSpread",
20174
+ INLINE_FRAGMENT: "InlineFragment",
20175
+ FRAGMENT_DEFINITION: "FragmentDefinition",
20176
+ VARIABLE: "Variable",
20177
+ INT: "IntValue",
20178
+ FLOAT: "FloatValue",
20179
+ STRING: "StringValue",
20180
+ BOOLEAN: "BooleanValue",
20181
+ NULL: "NullValue",
20182
+ ENUM: "EnumValue",
20183
+ LIST: "ListValue",
20184
+ OBJECT: "ObjectValue",
20185
+ OBJECT_FIELD: "ObjectField",
20186
+ DIRECTIVE: "Directive",
20187
+ NAMED_TYPE: "NamedType",
20188
+ LIST_TYPE: "ListType",
20189
+ NON_NULL_TYPE: "NonNullType"
20247
20190
  };
20248
20191
 
20249
- const MUTATION$6 = () => `
20250
- mutation QuoteAccountSignup (
20251
- $accountName: String!,
20252
- $billingContact: ContactAttributes!,
20253
- $priceListCode: String!,
20254
- $billingDetails: BillingDetailsAttributes
20255
- ) {
20256
- quoteAccountSignup(
20257
- priceListCode: $priceListCode,
20258
- accountName: $accountName,
20259
- billingContact: $billingContact,
20260
- billingDetails: $billingDetails
20261
- ) {
20262
- account {
20263
- id
20192
+ class GraphQLError extends Error {
20193
+ constructor(e, r, i, n, t, a, o) {
20194
+ if (super(e), this.name = "GraphQLError", this.message = e, t) {
20195
+ this.path = t;
20264
20196
  }
20265
- quote {
20266
- accountId
20267
- amount
20268
- amountDue
20269
- applicationDate
20270
- applied
20271
- backdatedPeriods
20272
- backdatedQuote
20273
- billingDay
20274
- contactId
20275
- createdAt
20276
- credits
20277
- currencyId
20278
- dealId
20279
- discount
20280
- discountValue
20281
- endDate
20282
- evergreen
20283
- expiresAt
20284
- id
20285
- invoiceImmediately
20286
- invoiceImmediatelyAvailable
20287
- invoiceUntil
20288
- isPendingApprovalRequest
20289
- kind
20290
- message
20291
- name
20292
- netPaymentDays
20293
- notes
20294
- number
20295
- ownerId
20296
- payableId
20297
- periodAmount
20298
- poNumber
20299
- requiresApproval
20300
- smallUnitAmountDue
20301
- splitInvoice
20302
- startDate
20303
- state
20304
- subtotal
20305
- taxAmount
20306
- taxCode
20307
- updatedAt
20308
- uuid
20197
+ if (r) {
20198
+ this.nodes = Array.isArray(r) ? r : [ r ];
20309
20199
  }
20310
- tenant {
20311
- code
20200
+ if (i) {
20201
+ this.source = i;
20312
20202
  }
20313
- portalSessionToken
20314
- errors
20203
+ if (n) {
20204
+ this.positions = n;
20205
+ }
20206
+ if (a) {
20207
+ this.originalError = a;
20208
+ }
20209
+ var l = o;
20210
+ if (!l && a) {
20211
+ var d = a.extensions;
20212
+ if (d && "object" == typeof d) {
20213
+ l = d;
20214
+ }
20215
+ }
20216
+ this.extensions = l || {};
20315
20217
  }
20316
- }`;
20317
- const quoteAccountSignup = async ({ token, apiHost, priceListCode, accountName, billingContact, billingDetails, }) => {
20318
- var _a;
20319
- const vars = {
20320
- priceListCode,
20321
- accountName,
20322
- billingContact,
20323
- billingDetails,
20218
+ toJSON() {
20219
+ return {
20220
+ ...this,
20221
+ message: this.message
20324
20222
  };
20325
- const response = await gqlRequest({
20326
- query: MUTATION$6(),
20327
- token,
20328
- vars,
20329
- apiHost,
20330
- });
20331
- const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteAccountSignup) === null || _a === void 0 ? void 0 : _a.errors;
20332
- if (errors)
20333
- throw errors;
20334
- return response === null || response === void 0 ? void 0 : response.quoteAccountSignup;
20335
- };
20223
+ }
20224
+ toString() {
20225
+ return this.message;
20226
+ }
20227
+ get [Symbol.toStringTag]() {
20228
+ return "GraphQLError";
20229
+ }
20230
+ }
20336
20231
 
20337
- const QUOTE_RECALCULATE_TAXES = `
20338
- mutation QuoteRecalculateTaxes($id: ID!) {
20339
- quoteRecalculateTaxes(id: $id) {
20340
- quote {
20341
- accountId
20342
- amount
20343
- amountDue
20344
- smallUnitAmountDue
20345
- currencyId
20346
- formattedQuote {
20347
- html
20348
- }
20349
- id
20350
- payableId
20351
- periodAmount
20352
- subtotal
20353
- taxAmount
20354
- amountsByPeriod {
20355
- amount
20356
- startDate
20357
- }
20358
- kind
20359
- quoteChanges {
20360
- currencyId
20361
- id
20362
- kind
20363
- charges {
20364
- subtotal
20365
- amountsByPeriod {
20366
- amount
20367
- startDate
20368
- }
20369
- amount
20370
- billingPeriod
20371
- currencyId
20372
- feature {
20373
- unitName
20374
- }
20375
- id
20376
- name
20377
- priceListCharge {
20378
- id
20379
- }
20380
- priceList {
20381
- id
20382
- }
20383
- coupon {
20384
- couponCode
20385
- }
20386
- quantity
20387
- kind
20388
- }
20389
- priceList {
20390
- id
20391
- plan {
20392
- name
20393
- }
20394
- product {
20395
- name
20396
- }
20397
- }
20398
- }
20399
- }
20400
- errors
20401
- }
20402
- }
20403
- `;
20404
- const quoteRecalculateTaxes = async ({ quoteId, apiHost, token, }) => {
20405
- var _a, _b;
20406
- const vars = { id: quoteId };
20407
- const response = await gqlRequest({
20408
- query: QUOTE_RECALCULATE_TAXES,
20409
- token,
20410
- vars,
20411
- apiHost,
20412
- });
20413
- const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _a === void 0 ? void 0 : _a.errors;
20414
- if (errors)
20415
- throw errors;
20416
- return (_b = response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.quote;
20417
- };
20232
+ var i;
20418
20233
 
20419
- const MUTATION$5 = () => `
20420
- query PriceList($code: String!) {
20421
- priceList (code: $code) {
20422
- basePrice
20423
- code
20424
- createdAt
20425
- currencyId
20426
- id
20427
- isVisible
20428
- name
20429
- periodMonths
20430
- planId
20431
- priceDescription
20432
- productId
20433
- product {
20434
- name
20435
- }
20436
- sku
20437
- trialAllowed
20438
- trialLengthDays
20439
- updatedAt
20234
+ var n;
20235
+
20236
+ function error(e) {
20237
+ return new GraphQLError(`Syntax Error: Unexpected token at ${n} in ${e}`);
20238
+ }
20239
+
20240
+ function advance(e) {
20241
+ if (e.lastIndex = n, e.test(i)) {
20242
+ return i.slice(n, n = e.lastIndex);
20440
20243
  }
20441
- }`;
20442
- const getPriceList = async ({ token, code, apiHost, }) => {
20443
- const response = await gqlRequest({
20444
- query: MUTATION$5(),
20445
- token,
20446
- vars: { code },
20447
- apiHost,
20448
- });
20449
- return response === null || response === void 0 ? void 0 : response.priceList;
20450
- };
20244
+ }
20451
20245
 
20452
- const QUOTE_FIELDS = (removeFormattedQuoteField) => `
20453
- fragment QuoteFields on Quote {
20454
- accountId
20455
- amount
20456
- amountDue
20457
- smallUnitAmountDue
20458
- currencyId
20459
- ${removeFormattedQuoteField ? '' : `formattedQuote { html }`}
20460
- id
20461
- payableId
20462
- periodAmount
20463
- subtotal
20464
- taxAmount
20465
- startDate
20466
- amountsByPeriod {
20467
- amount
20468
- startDate
20469
- }
20470
- kind
20471
- quoteChanges {
20472
- currencyId
20473
- id
20474
- kind
20475
- charges {
20476
- subtotal
20477
- amountsByPeriod {
20478
- amount
20479
- startDate
20480
- }
20481
- amount
20482
- billingPeriod
20483
- currencyId
20484
- feature {
20485
- unitName
20486
- }
20487
- id
20488
- name
20489
- priceListCharge {
20490
- id
20491
- }
20492
- priceList {
20493
- id
20494
- }
20495
- coupon {
20496
- couponCode
20497
- }
20498
- quantity
20499
- kind
20500
- }
20501
- priceList {
20502
- id
20503
- plan {
20504
- name
20505
- }
20506
- product {
20507
- name
20508
- }
20246
+ var t$1 = / +(?=[^\s])/y;
20247
+
20248
+ function blockString(e) {
20249
+ var r = e.split("\n");
20250
+ var i = "";
20251
+ var n = 0;
20252
+ var a = 0;
20253
+ var o = r.length - 1;
20254
+ for (var l = 0; l < r.length; l++) {
20255
+ if (t$1.lastIndex = 0, t$1.test(r[l])) {
20256
+ if (l && (!n || t$1.lastIndex < n)) {
20257
+ n = t$1.lastIndex;
20509
20258
  }
20259
+ a = a || l, o = l;
20510
20260
  }
20511
20261
  }
20512
- `;
20513
- const QUOTE_QUERY = (id, removeFormattedQuoteField) => `
20514
- ${QUOTE_FIELDS(removeFormattedQuoteField)}
20515
- query quote {
20516
- quote ${id ? `(id: ${id})` : ''} {
20517
- ...QuoteFields
20518
- }
20519
- }`;
20520
- const getQuote = async ({ id, token, apiHost, removeFormattedQuoteField = false, }) => {
20521
- const response = await gqlRequest({
20522
- query: QUOTE_QUERY(id, removeFormattedQuoteField),
20523
- token,
20524
- vars: {},
20525
- apiHost,
20526
- });
20527
- return response === null || response === void 0 ? void 0 : response.quote;
20528
- };
20529
-
20530
- const MUTATION$4 = `mutation quoteChangeAddCoupon($couponCode: String!, $quoteChangeId: ID!) {
20531
- quoteChangeAddCoupon(couponCode: $couponCode, quoteChangeId: $quoteChangeId) {
20532
- quoteChange {
20533
- id
20534
- charges {
20535
- id
20536
- amount
20537
- couponId
20538
- }
20539
- }
20262
+ for (var d = a; d <= o; d++) {
20263
+ if (d !== a) {
20264
+ i += "\n";
20540
20265
  }
20541
- }`;
20542
- const quoteChangeAddCoupon = async ({ quoteChangeId, couponCode, token, apiHost, }) => {
20543
- var _a;
20544
- const vars = { couponCode, quoteChangeId };
20545
- const response = await gqlRequest({
20546
- query: MUTATION$4,
20547
- token,
20548
- vars,
20549
- apiHost,
20550
- });
20551
- const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteAddCoupon) === null || _a === void 0 ? void 0 : _a.errors;
20552
- if (errors)
20553
- throw errors;
20554
- return response.quote;
20555
- };
20266
+ i += r[d].slice(n).replace(/\\"""/g, '"""');
20267
+ }
20268
+ return i;
20269
+ }
20556
20270
 
20557
- const MUTATION$3 = `mutation quoteChangeRemoveCoupon($quoteChangeId: ID!, $couponCode: String!) {
20558
- quoteChangeRemoveCoupon(quoteChangeId: $quoteChangeId, couponCode: $couponCode) {
20559
- errors
20271
+ function ignored() {
20272
+ for (var e = 0 | i.charCodeAt(n++); 9 === e || 10 === e || 13 === e || 32 === e || 35 === e || 44 === e || 65279 === e; e = 0 | i.charCodeAt(n++)) {
20273
+ if (35 === e) {
20274
+ for (;(e = 0 | i.charCodeAt(n++)) && 10 !== e && 13 !== e; ) {}
20560
20275
  }
20276
+ }
20277
+ n--;
20561
20278
  }
20562
- `;
20563
- const quoteChangeRemoveCoupon = async ({ quoteChangeId, couponCode, token, apiHost, }) => {
20564
- var _a;
20565
- const vars = { couponCode, quoteChangeId };
20566
- const response = await gqlRequest({
20567
- query: MUTATION$3,
20568
- token,
20569
- vars,
20570
- apiHost,
20571
- });
20572
- const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteChangeRemoveCoupon) === null || _a === void 0 ? void 0 : _a.errors;
20573
- if (errors)
20574
- throw errors;
20575
- return response.quote;
20576
- };
20577
20279
 
20578
- const COUPONS_QUERY = (filter) => `
20579
- query Coupons {
20580
- coupons(filter: ${filter ? `"${filter}"` : 'null'}) {
20581
- totalCount
20582
- }
20583
- }
20584
- `;
20585
- const getCoupons = async ({ token, apiHost, filter, }) => {
20586
- const response = await gqlRequest({
20587
- query: COUPONS_QUERY(filter),
20588
- token,
20589
- vars: {},
20590
- apiHost,
20591
- });
20592
- return response === null || response === void 0 ? void 0 : response.coupons;
20593
- };
20280
+ function name() {
20281
+ var e = n;
20282
+ for (var r = 0 | i.charCodeAt(n++); r >= 48 && r <= 57 || r >= 65 && r <= 90 || 95 === r || r >= 97 && r <= 122; r = 0 | i.charCodeAt(n++)) {}
20283
+ if (e === n - 1) {
20284
+ throw error("Name");
20285
+ }
20286
+ var t = i.slice(e, --n);
20287
+ return ignored(), t;
20288
+ }
20594
20289
 
20595
- const showErrorNotification$3 = common.useErrorNotification();
20596
- const useUpdateCoupons = ({ apiHost, token, quoteChangeId, onCouponAdded, onCouponRemoved, }) => {
20597
- const { data: coupons } = reactQuery.useQuery({
20598
- queryKey: ['coupons', token],
20599
- queryFn: () => getCoupons({ token, apiHost, filter: 'coupon.active is true' }),
20600
- });
20601
- const { mutate: addCoupon, isPending: isAddingCoupon } = reactQuery.useMutation({
20602
- mutationFn: (couponCode) => {
20603
- if (!token) {
20604
- throw new Error('Token is required');
20605
- }
20606
- if (!quoteChangeId) {
20607
- throw new Error('Quote change ID is required');
20608
- }
20609
- return quoteChangeAddCoupon({
20610
- quoteChangeId,
20611
- couponCode,
20612
- apiHost,
20613
- token,
20614
- });
20615
- },
20616
- onSuccess: () => {
20617
- onCouponAdded === null || onCouponAdded === void 0 ? void 0 : onCouponAdded();
20618
- },
20619
- onError: (error) => {
20620
- var _a, _b;
20621
- showErrorNotification$3((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error adding coupon');
20622
- },
20623
- });
20624
- const { mutate: removeCoupon, isPending: isRemovingCoupon } = reactQuery.useMutation({
20625
- mutationFn: (couponCode) => {
20626
- if (!quoteChangeId) {
20627
- throw new Error('Quote change ID is required');
20628
- }
20629
- return quoteChangeRemoveCoupon({
20630
- quoteChangeId,
20631
- couponCode,
20632
- apiHost,
20633
- token,
20634
- });
20635
- },
20636
- onSuccess: () => {
20637
- onCouponRemoved === null || onCouponRemoved === void 0 ? void 0 : onCouponRemoved();
20638
- },
20639
- onError: (error) => {
20640
- var _a, _b;
20641
- showErrorNotification$3((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error removing coupon');
20642
- },
20643
- });
20644
- return {
20645
- addCoupon,
20646
- removeCoupon,
20647
- isAddingCoupon,
20648
- isRemovingCoupon,
20649
- activeCouponsExist: (coupons === null || coupons === void 0 ? void 0 : coupons.totalCount) > 0,
20650
- };
20651
- };
20290
+ function nameNode() {
20291
+ return {
20292
+ kind: "Name",
20293
+ value: name()
20294
+ };
20295
+ }
20652
20296
 
20653
- const BunnyFooterIcon = ({ color }) => {
20654
- return (jsxRuntime.jsxs("svg", { width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsxs("g", { clipPath: "url(#clip0_6_851)", children: [jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_6_851", children: jsxRuntime.jsx("rect", { width: "39", height: "13", fill: "white" }) }) })] }));
20655
- };
20297
+ var a$1 = /(?:"""|(?:[\s\S]*?[^\\])""")/y;
20656
20298
 
20657
- const { Text: Text$m } = antd.Typography;
20658
- const Footer = ({ className }) => {
20659
- const token = useToken();
20660
- const { currentUser } = useCurrentUserData(token);
20661
- const { privacyUrl, termsUrl } = currentUser;
20662
- const isMobile = common.useIsMobile();
20663
- return (jsxRuntime.jsxs("div", { className: `bunny-flex bunny-items-center bunny-justify-between bunny-shrink-0 ${isMobile ? 'bunny-flex-col bunny-gap-2' : ''} ${className}`, children: [(termsUrl || privacyUrl) && (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-3", children: [termsUrl && (jsxRuntime.jsx(StyedLink, { className: "bunny-text-xs bunny-text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text", children: "Terms" })), privacyUrl && (jsxRuntime.jsx(StyedLink, { className: "bunny-text-xs bunny-text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text", children: "Privacy" }))] })), jsxRuntime.jsx(BunnyMarketingLink, {})] }));
20664
- };
20665
- const BunnyMarketingLink = () => {
20666
- const [isHovered, setIsHovered] = react.useState(false);
20667
- const isMobile = common.useIsMobile();
20668
- return (jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-end bunny-justify-end ${isMobile ? '' : 'grow'}`, children: jsxRuntime.jsx(StyledBunnyLink, { className: "bunny-flex bunny-items-end bunny-justify-end bunny-text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center", onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [jsxRuntime.jsx(Text$m, { className: "bunny-text-slate-400", children: "Powered by\u00A0" }), jsxRuntime.jsx("div", { style: { paddingTop: '5px' }, children: jsxRuntime.jsx(BunnyFooterIcon, { color: isHovered ? common.PRIMARY_COLOR : common.SLATE_400 }) })] }) }) }));
20669
- };
20670
- const StyedLink = styled.a `
20671
- color: ${common.SLATE_400};
20672
- transition: color 0.3s;
20673
- &:hover {
20674
- color: ${common.SLATE_500};
20675
- }
20676
- text-decoration: none;
20677
- `;
20678
- const StyledBunnyLink = styled(StyedLink) `
20679
- &:hover {
20680
- color: ${common.PRIMARY_COLOR} !important;
20681
- }
20682
- `;
20299
+ var o = /(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;
20683
20300
 
20684
- function CouponEditor({ className, onAddCoupon, isAddingCoupon, couponCode, setCouponCode, }) {
20685
- async function handleAddCoupon() {
20686
- onAddCoupon(couponCode);
20301
+ function value(e) {
20302
+ var r;
20303
+ switch (i.charCodeAt(n)) {
20304
+ case 91:
20305
+ n++, ignored();
20306
+ var t = [];
20307
+ for (;93 !== i.charCodeAt(n); ) {
20308
+ t.push(value(e));
20687
20309
  }
20688
- return (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col bunny-gap-2 ${className}`, children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2", children: [jsxRuntime.jsx(antd.Input, { value: couponCode, onChange: e => setCouponCode(e.target.value), placeholder: "Coupon code", disabled: isAddingCoupon, size: "small" }), jsxRuntime.jsx(antd.Button, { loading: isAddingCoupon, type: "primary", onClick: handleAddCoupon, disabled: couponCode.length === 0, children: "Apply" })] }) }));
20689
- }
20690
-
20691
- const { Text: Text$l } = antd.Typography;
20692
- function CheckoutSummary({ quote, className, onAddCoupon, onRemoveCoupon, isRemovingCoupon, priceListData, isAddingCoupon, couponCode, setCouponCode, activeCouponsExist, }) {
20693
- return (jsxRuntime.jsxs("div", { className: `${className} bunny-space-y-4`, children: [jsxRuntime.jsxs(Text$l, { children: [jsxRuntime.jsxs("div", { className: "bunny-text-lg bunny-font-medium bunny-mb-4", children: ["Checkout summary - ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.product.name, " ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.name] }), jsxRuntime.jsx("div", { className: "bunny-space-y-4", children: quote === null || quote === void 0 ? void 0 : quote.quoteChanges.map(quoteChange => quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(charge => {
20694
- var _a;
20695
- const multiplier = charge.kind === 'COUPON' ? -1 : 1;
20696
- return (jsxRuntime.jsxs("div", { className: "bunny-grid bunny-grid-cols-3 bunny-gap-4 bunny-items-center", children: [jsxRuntime.jsx("div", { className: "bunny-col-span-1", children: charge.name }), jsxRuntime.jsx("div", { className: "bunny-col-span-1 bunny-text-center", children: ((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode) ? (jsxRuntime.jsx("button", { onClick: () => {
20697
- var _a, _b;
20698
- if (isRemovingCoupon) {
20699
- return;
20700
- }
20701
- if (!((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode)) {
20702
- throw new Error('Coupon code not found');
20703
- }
20704
- onRemoveCoupon((_b = charge.coupon) === null || _b === void 0 ? void 0 : _b.couponCode);
20705
- }, className: "bunny-text-orange-500 hover:bunny-text-orange-400 bunny-cursor-pointer bunny-bg-transparent bunny-border-none", children: "Remove" })) : (jsxRuntime.jsx("div", { children: charge.quantity })) }), jsxRuntime.jsx("div", { className: "bunny-col-span-1 bunny-text-right", children: common.formatCurrency(multiplier * (charge.subtotal || 0), charge.currencyId) })] }, charge.id));
20706
- })) }), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", { className: "bunny-space-y-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-justify-between", children: [jsxRuntime.jsx("div", { children: "Subtotal" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.subtotal, quote.currencyId) })] }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-justify-between", children: [jsxRuntime.jsx("div", { children: "Taxes" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.taxAmount, quote.currencyId) })] })] }), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-justify-between", children: [jsxRuntime.jsx("div", { children: "Total" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue, quote.currencyId) })] })] }), activeCouponsExist && (jsxRuntime.jsx(CouponEditor, { className: "bunny-w-full", quote: quote, onAddCoupon: onAddCoupon, isAddingCoupon: isAddingCoupon, couponCode: couponCode, setCouponCode: setCouponCode }))] }));
20707
- }
20708
- const CheckoutSummaryDivider = () => {
20709
- return (jsxRuntime.jsx("div", { className: "bunny-my-2", children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) }));
20710
- };
20310
+ return n++, ignored(), {
20311
+ kind: "ListValue",
20312
+ values: t
20313
+ };
20711
20314
 
20712
- const { Title: Title$1 } = antd.Typography;
20713
- function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }) {
20714
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Payment" }), jsxRuntime.jsx("div", { className: "bunny-overflow-y-auto bunny-max-h-[calc(100vh-10rem)]", children: jsxRuntime.jsx(PaymentForm, { onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction }) })] })) : null })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Signup" }), jsxRuntime.jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment, defaultValues: defaultValues })] })) }));
20715
- }
20716
- function InitialSignupForm({ className, onSubmit, submitting, defaultValues, }) {
20717
- const [form] = antd.Form.useForm();
20718
- const isMobile = common.useIsMobile();
20719
- function handleSubmit() {
20720
- form.validateFields({ validateOnly: false }).then(() => {
20721
- onSubmit(form.getFieldsValue());
20722
- });
20315
+ case 123:
20316
+ n++, ignored();
20317
+ var l = [];
20318
+ for (;125 !== i.charCodeAt(n); ) {
20319
+ var d = nameNode();
20320
+ if (58 !== i.charCodeAt(n++)) {
20321
+ throw error("ObjectField");
20322
+ }
20323
+ ignored(), l.push({
20324
+ kind: "ObjectField",
20325
+ name: d,
20326
+ value: value(e)
20327
+ });
20723
20328
  }
20724
- react.useEffect(() => {
20725
- if (defaultValues) {
20726
- // Set all non empty default values
20727
- form.setFieldsValue(Object.fromEntries(Object.entries({
20728
- ...defaultValues,
20729
- billingCountry: undefined,
20730
- }).filter(([v, _]) => v)));
20731
- // Set billing country if it's in the country list
20732
- if (defaultValues.billingCountry &&
20733
- common.Lists.COUNTRY_LIST.find(c => c.value === defaultValues.billingCountry)) {
20734
- form.setFieldsValue({
20735
- billingCountry: defaultValues.billingCountry,
20736
- });
20737
- }
20738
- }
20739
- }, [defaultValues]);
20740
- return (jsxRuntime.jsx(antd.Form, { className: `bunny-flex bunny-flex-col bunny-h-full bunny-w-full ${className}`, form: form, layout: "vertical", autoComplete: "off", children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-space-y-2", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-4", children: [jsxRuntime.jsx(antd.Form.Item, { name: "firstName", rules: [{ required: true, message: 'First name is required' }], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "First name" }) }), jsxRuntime.jsx(antd.Form.Item, { name: "lastName", rules: [{ required: true, message: 'Last name is required' }], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "Last name" }) })] }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-4", children: [jsxRuntime.jsx(antd.Form.Item, { name: "email", rules: [
20741
- { required: true, message: 'Email is required' },
20742
- { type: 'email', message: 'Please enter a valid email' },
20743
- ], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "Email" }) }), jsxRuntime.jsx(antd.Form.Item, { name: "accountName", rules: [{ required: true, message: 'Company name is required' }], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) })] }), jsxRuntime.jsx("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-row bunny-pb-2' : 'bunny-flex-row'} bunny-gap-4`, children: jsxRuntime.jsx("div", { className: "flex-1 w-1/2", children: jsxRuntime.jsx(antd.Form.Item, { name: "billingCountry", rules: [{ required: true, message: 'Country is required' }], children: jsxRuntime.jsx(antd.Select, { options: common.Lists.COUNTRY_LIST, placeholder: "Select a country", showSearch: true, filterOption: (input, option) => {
20744
- var _a, _b;
20745
- return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '').toLowerCase().includes(input.toLowerCase()) ||
20746
- ((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : '').toLowerCase().includes(input.toLowerCase());
20747
- } }) }) }) }), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, { type: "primary", onClick: handleSubmit, loading: submitting, className: "bunny-w-full", children: "Proceed to payment" }) })] }) }));
20748
- }
20329
+ return n++, ignored(), {
20330
+ kind: "ObjectValue",
20331
+ fields: l
20332
+ };
20749
20333
 
20750
- const { Title, Text: Text$k } = antd.Typography;
20751
- function PaymentSuccessDisplay({ amountPaid, className, companyName, returnUrl, style, currencyId, }) {
20752
- return (jsxRuntime.jsxs("div", { className: `bunny-flex bunny-flex-col bunny-items-center bunny-justify-center bunny-h-full ${className}`, style: style, children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, { level: 3, className: "bunny-mt-2 bunny-m-0", children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] }), returnUrl && (jsxRuntime.jsxs(Text$k, { className: "bunny-text-slate-500 bunny-cursor-pointer bunny-underline", onClick: () => (window.location.href = returnUrl), children: ["Back to ", companyName] }))] }));
20753
- }
20334
+ case 36:
20335
+ if (e) {
20336
+ throw error("Variable");
20337
+ }
20338
+ return n++, {
20339
+ kind: "Variable",
20340
+ name: nameNode()
20341
+ };
20754
20342
 
20755
- const { Text: Text$j } = antd.Typography;
20756
- function PriceListDisplay({ priceListData }) {
20757
- if (!priceListData)
20758
- return null;
20759
- return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-space-y-8", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxRuntime.jsxs(Text$j, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [priceListData.product.name, " ", priceListData.name] }), jsxRuntime.jsxs(Text$j, { className: "bunny-font-bold bunny-text-xl", children: [common.formatCurrency(priceListData.basePrice, priceListData.currencyId), " / month"] })] }), priceListData.trialAllowed ? (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col", children: [jsxRuntime.jsxs(Text$j, { style: { fontSize: '16px' }, className: "bunny-text-slate-500", children: [priceListData.trialLengthDays, " day trial"] }), jsxRuntime.jsx(Text$j, { className: "bunny-text-slate-500", style: { fontSize: '12px' }, children: "You will not be charged until the last day of the trial." })] })) : null] }));
20760
- }
20343
+ case 34:
20344
+ if (34 === i.charCodeAt(n + 1) && 34 === i.charCodeAt(n + 2)) {
20345
+ if (n += 3, null == (r = advance(a$1))) {
20346
+ throw error("StringValue");
20347
+ }
20348
+ return ignored(), {
20349
+ kind: "StringValue",
20350
+ value: blockString(r.slice(0, -3)),
20351
+ block: !0
20352
+ };
20353
+ } else {
20354
+ var u = n;
20355
+ var s;
20356
+ n++;
20357
+ var c = !1;
20358
+ for (s = 0 | i.charCodeAt(n++); 92 === s && (n++, c = !0) || 10 !== s && 13 !== s && 34 !== s && s; s = 0 | i.charCodeAt(n++)) {}
20359
+ if (34 !== s) {
20360
+ throw error("StringValue");
20361
+ }
20362
+ return r = i.slice(u, n), ignored(), {
20363
+ kind: "StringValue",
20364
+ value: c ? JSON.parse(r) : r.slice(1, -1),
20365
+ block: !1
20366
+ };
20367
+ }
20761
20368
 
20762
- const showErrorNotification$2 = common.useErrorNotification();
20763
- const showSuccessNotification$1 = common.useSuccessNotification();
20764
- function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow = 'shadow-md', style, defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry, }) {
20765
- var _a, _b, _c;
20766
- // Hooks
20767
- const { apiHost } = react.useContext(BunnyContext);
20768
- const tokenFromContexts = useToken();
20769
- const isMobile = common.useIsMobile();
20770
- const { topNavImageUrl } = react.useContext(BrandContext);
20771
- const defaultValues = react.useMemo(() => ({
20772
- firstName: defaultFirstName,
20773
- lastName: defaultLastName,
20774
- email: defaultEmail,
20775
- accountName: defaultCompanyName,
20776
- billingCountry: defaultBillingCountry,
20777
- }), [defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry]);
20778
- const queryClient = reactQuery.useQueryClient();
20779
- const [initialQuote, setInitialQuote] = react.useState(undefined);
20780
- const [accountId, setAccountId] = react.useState(undefined);
20781
- const [portalSessionToken, setPortalSessionToken] = react.useState(undefined);
20782
- const token = portalSessionToken || tokenFromContexts;
20783
- const [purchaseSucceeded, setPurchaseSucceeded] = react.useState(false);
20784
- const defaultCouponAppliedRef = react.useRef(undefined);
20785
- const [couponEditorCouponCode, setCouponEditorCouponCode] = react.useState('');
20786
- const { defaultPaymentMethod } = usePaymentMethod({
20787
- accountId,
20788
- token,
20789
- apiHost,
20790
- enabled: Boolean(accountId),
20791
- });
20792
- const { mutate: recalculateTaxes } = reactQuery.useMutation({
20793
- mutationFn: () => {
20794
- if (!(quote === null || quote === void 0 ? void 0 : quote.id)) {
20795
- throw new Error('Quote ID is required');
20796
- }
20797
- return quoteRecalculateTaxes({ token, apiHost, quoteId: quote.id });
20798
- },
20799
- onError: (error) => {
20800
- if (!error[0].message.includes('Ensure that you have a taxation plugin')) {
20801
- showErrorNotification$2(error.message);
20802
- }
20803
- },
20804
- onSuccess: (quote) => {
20805
- queryClient.setQueryData(['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id], quote);
20806
- queryClient.invalidateQueries({
20807
- queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
20808
- });
20809
- },
20810
- });
20811
- const { mutate: quoteAccountSignupMutate, isPending: isSigningUp } = reactQuery.useMutation({
20812
- mutationFn: (formData) => {
20813
- return quoteAccountSignup({
20814
- token,
20815
- apiHost,
20816
- priceListCode,
20817
- accountName: formData.accountName,
20818
- billingContact: {
20819
- firstName: formData.firstName,
20820
- lastName: formData.lastName,
20821
- email: formData.email,
20822
- },
20823
- billingDetails: {
20824
- billingCountry: formData.billingCountry,
20825
- // TODO: add these billing details back for Avalara and AFC taxation plugins.
20826
- // billingState: formData.billingState,
20827
- // billingCity: formData.billingCity,
20828
- // billingZip: formData.billingZip,
20829
- // billingStreet: formData.billingStreet,
20830
- // taxNumber: formData.taxNumber,
20831
- },
20832
- });
20833
- },
20834
- onSuccess: (data) => {
20835
- setAccountId(data.account.id);
20836
- setPortalSessionToken(data.portalSessionToken);
20837
- // We must invalidate the accountPaymentMethodsKey query in order to clear payment methods from the provided api token,
20838
- // to instead use paymentMethods from portalSessionToken.
20839
- queryClient.invalidateQueries({
20840
- queryKey: common.QueryKeyFactory.default.accountPaymentMethodsKey({
20841
- accountId,
20842
- token,
20843
- }),
20844
- });
20845
- setInitialQuote(data.quote);
20846
- },
20847
- onError: (error) => {
20848
- const errorMessage = error.response.errors[0].message;
20849
- if (errorMessage.includes("Address couldn't be validated")) {
20850
- showErrorNotification$2('Please enter a valid billing address');
20851
- }
20852
- else {
20853
- showErrorNotification$2(errorMessage);
20854
- }
20855
- },
20856
- });
20857
- // Queries
20858
- const { data: priceListData, isLoading: isLoadingPriceList } = reactQuery.useQuery({
20859
- queryKey: ['priceList', priceListCode],
20860
- queryFn: () => getPriceList({ token, apiHost, code: priceListCode }),
20861
- });
20862
- const { data, isLoading: isLoadingQuote } = reactQuery.useQuery({
20863
- queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
20864
- queryFn: () => {
20865
- if (!(initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id)) {
20866
- throw new Error('Quote ID is required');
20867
- }
20868
- return getQuote({ token, apiHost, id: initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id });
20869
- },
20870
- enabled: !!(initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id),
20871
- });
20872
- const quote = data || initialQuote;
20873
- const quoteChangeId = (_c = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a[((_b = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _b === void 0 ? void 0 : _b.length) - 1]) === null || _c === void 0 ? void 0 : _c.id;
20874
- const { addCoupon, removeCoupon, isAddingCoupon, isRemovingCoupon, activeCouponsExist } = useUpdateCoupons({
20875
- apiHost,
20876
- token,
20877
- quoteChangeId,
20878
- onCouponAdded: () => {
20879
- queryClient.invalidateQueries({
20880
- queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
20881
- });
20882
- showSuccessNotification$1('Coupon applied');
20883
- recalculateTaxes();
20884
- setCouponEditorCouponCode('');
20885
- },
20886
- onCouponRemoved: () => {
20887
- queryClient.invalidateQueries({
20888
- queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
20889
- });
20890
- showSuccessNotification$1('Coupon removed');
20891
- recalculateTaxes();
20892
- },
20893
- });
20894
- // Handle default coupon application
20895
- react.useEffect(() => {
20896
- if (couponCode && quoteChangeId && defaultCouponAppliedRef.current !== couponCode) {
20897
- addCoupon(couponCode);
20898
- defaultCouponAppliedRef.current = couponCode;
20369
+ case 45:
20370
+ case 48:
20371
+ case 49:
20372
+ case 50:
20373
+ case 51:
20374
+ case 52:
20375
+ case 53:
20376
+ case 54:
20377
+ case 55:
20378
+ case 56:
20379
+ case 57:
20380
+ var v = n++;
20381
+ var f;
20382
+ for (;(f = 0 | i.charCodeAt(n++)) >= 48 && f <= 57; ) {}
20383
+ var m = i.slice(v, --n);
20384
+ if (46 === (f = i.charCodeAt(n)) || 69 === f || 101 === f) {
20385
+ if (null == (r = advance(o))) {
20386
+ throw error("FloatValue");
20387
+ }
20388
+ return ignored(), {
20389
+ kind: "FloatValue",
20390
+ value: m + r
20391
+ };
20392
+ } else {
20393
+ return ignored(), {
20394
+ kind: "IntValue",
20395
+ value: m
20396
+ };
20397
+ }
20398
+
20399
+ case 110:
20400
+ if (117 === i.charCodeAt(n + 1) && 108 === i.charCodeAt(n + 2) && 108 === i.charCodeAt(n + 3)) {
20401
+ return n += 4, ignored(), {
20402
+ kind: "NullValue"
20403
+ };
20404
+ } else {
20405
+ break;
20406
+ }
20407
+
20408
+ case 116:
20409
+ if (114 === i.charCodeAt(n + 1) && 117 === i.charCodeAt(n + 2) && 101 === i.charCodeAt(n + 3)) {
20410
+ return n += 4, ignored(), {
20411
+ kind: "BooleanValue",
20412
+ value: !0
20413
+ };
20414
+ } else {
20415
+ break;
20416
+ }
20417
+
20418
+ case 102:
20419
+ if (97 === i.charCodeAt(n + 1) && 108 === i.charCodeAt(n + 2) && 115 === i.charCodeAt(n + 3) && 101 === i.charCodeAt(n + 4)) {
20420
+ return n += 5, ignored(), {
20421
+ kind: "BooleanValue",
20422
+ value: !1
20423
+ };
20424
+ } else {
20425
+ break;
20426
+ }
20427
+ }
20428
+ return {
20429
+ kind: "EnumValue",
20430
+ value: name()
20431
+ };
20432
+ }
20433
+
20434
+ function arguments_(e) {
20435
+ if (40 === i.charCodeAt(n)) {
20436
+ var r = [];
20437
+ n++, ignored();
20438
+ do {
20439
+ var t = nameNode();
20440
+ if (58 !== i.charCodeAt(n++)) {
20441
+ throw error("Argument");
20442
+ }
20443
+ ignored(), r.push({
20444
+ kind: "Argument",
20445
+ name: t,
20446
+ value: value(e)
20447
+ });
20448
+ } while (41 !== i.charCodeAt(n));
20449
+ return n++, ignored(), r;
20450
+ }
20451
+ }
20452
+
20453
+ function directives(e) {
20454
+ if (64 === i.charCodeAt(n)) {
20455
+ var r = [];
20456
+ do {
20457
+ n++, r.push({
20458
+ kind: "Directive",
20459
+ name: nameNode(),
20460
+ arguments: arguments_(e)
20461
+ });
20462
+ } while (64 === i.charCodeAt(n));
20463
+ return r;
20464
+ }
20465
+ }
20466
+
20467
+ function type() {
20468
+ var e = 0;
20469
+ for (;91 === i.charCodeAt(n); ) {
20470
+ e++, n++, ignored();
20471
+ }
20472
+ var r = {
20473
+ kind: "NamedType",
20474
+ name: nameNode()
20475
+ };
20476
+ do {
20477
+ if (33 === i.charCodeAt(n)) {
20478
+ n++, ignored(), r = {
20479
+ kind: "NonNullType",
20480
+ type: r
20481
+ };
20482
+ }
20483
+ if (e) {
20484
+ if (93 !== i.charCodeAt(n++)) {
20485
+ throw error("NamedType");
20486
+ }
20487
+ ignored(), r = {
20488
+ kind: "ListType",
20489
+ type: r
20490
+ };
20491
+ }
20492
+ } while (e--);
20493
+ return r;
20494
+ }
20495
+
20496
+ function selectionSetStart() {
20497
+ if (123 !== i.charCodeAt(n++)) {
20498
+ throw error("SelectionSet");
20499
+ }
20500
+ return ignored(), selectionSet();
20501
+ }
20502
+
20503
+ function selectionSet() {
20504
+ var e = [];
20505
+ do {
20506
+ if (46 === i.charCodeAt(n)) {
20507
+ if (46 !== i.charCodeAt(++n) || 46 !== i.charCodeAt(++n)) {
20508
+ throw error("SelectionSet");
20509
+ }
20510
+ switch (n++, ignored(), i.charCodeAt(n)) {
20511
+ case 64:
20512
+ e.push({
20513
+ kind: "InlineFragment",
20514
+ typeCondition: void 0,
20515
+ directives: directives(!1),
20516
+ selectionSet: selectionSetStart()
20517
+ });
20518
+ break;
20519
+
20520
+ case 111:
20521
+ if (110 === i.charCodeAt(n + 1)) {
20522
+ n += 2, ignored(), e.push({
20523
+ kind: "InlineFragment",
20524
+ typeCondition: {
20525
+ kind: "NamedType",
20526
+ name: nameNode()
20527
+ },
20528
+ directives: directives(!1),
20529
+ selectionSet: selectionSetStart()
20530
+ });
20531
+ } else {
20532
+ e.push({
20533
+ kind: "FragmentSpread",
20534
+ name: nameNode(),
20535
+ directives: directives(!1)
20536
+ });
20899
20537
  }
20900
- }, [couponCode, quoteChangeId]);
20901
- async function handleSubmit(formData) {
20902
- quoteAccountSignupMutate(formData);
20538
+ break;
20539
+
20540
+ case 123:
20541
+ n++, ignored(), e.push({
20542
+ kind: "InlineFragment",
20543
+ typeCondition: void 0,
20544
+ directives: void 0,
20545
+ selectionSet: selectionSet()
20546
+ });
20547
+ break;
20548
+
20549
+ default:
20550
+ e.push({
20551
+ kind: "FragmentSpread",
20552
+ name: nameNode(),
20553
+ directives: directives(!1)
20554
+ });
20555
+ }
20556
+ } else {
20557
+ var r = nameNode();
20558
+ var t = void 0;
20559
+ if (58 === i.charCodeAt(n)) {
20560
+ n++, ignored(), t = r, r = nameNode();
20561
+ }
20562
+ var a = arguments_(!1);
20563
+ var o = directives(!1);
20564
+ var l = void 0;
20565
+ if (123 === i.charCodeAt(n)) {
20566
+ n++, ignored(), l = selectionSet();
20567
+ }
20568
+ e.push({
20569
+ kind: "Field",
20570
+ alias: t,
20571
+ name: r,
20572
+ arguments: a,
20573
+ directives: o,
20574
+ selectionSet: l
20575
+ });
20903
20576
  }
20904
- async function handlePaymentSuccess() {
20905
- setPurchaseSucceeded(true);
20577
+ } while (125 !== i.charCodeAt(n));
20578
+ return n++, ignored(), {
20579
+ kind: "SelectionSet",
20580
+ selections: e
20581
+ };
20582
+ }
20583
+
20584
+ function variableDefinitions() {
20585
+ if (ignored(), 40 === i.charCodeAt(n)) {
20586
+ var e = [];
20587
+ n++, ignored();
20588
+ do {
20589
+ var r = void 0;
20590
+ if (34 === i.charCodeAt(n)) {
20591
+ r = value(!0);
20592
+ }
20593
+ if (36 !== i.charCodeAt(n++)) {
20594
+ throw error("Variable");
20595
+ }
20596
+ var t = nameNode();
20597
+ if (58 !== i.charCodeAt(n++)) {
20598
+ throw error("VariableDefinition");
20599
+ }
20600
+ ignored();
20601
+ var a = type();
20602
+ var o = void 0;
20603
+ if (61 === i.charCodeAt(n)) {
20604
+ n++, ignored(), o = value(!0);
20605
+ }
20606
+ ignored();
20607
+ var l = {
20608
+ kind: "VariableDefinition",
20609
+ variable: {
20610
+ kind: "Variable",
20611
+ name: t
20612
+ },
20613
+ type: a,
20614
+ defaultValue: o,
20615
+ directives: directives(!0)
20616
+ };
20617
+ if (r) {
20618
+ l.description = r;
20619
+ }
20620
+ e.push(l);
20621
+ } while (41 !== i.charCodeAt(n));
20622
+ return n++, ignored(), e;
20623
+ }
20624
+ }
20625
+
20626
+ function fragmentDefinition(e) {
20627
+ var r = nameNode();
20628
+ if (111 !== i.charCodeAt(n++) || 110 !== i.charCodeAt(n++)) {
20629
+ throw error("FragmentDefinition");
20630
+ }
20631
+ ignored();
20632
+ var t = {
20633
+ kind: "FragmentDefinition",
20634
+ name: r,
20635
+ typeCondition: {
20636
+ kind: "NamedType",
20637
+ name: nameNode()
20638
+ },
20639
+ directives: directives(!1),
20640
+ selectionSet: selectionSetStart()
20641
+ };
20642
+ if (e) {
20643
+ t.description = e;
20644
+ }
20645
+ return t;
20646
+ }
20647
+
20648
+ function definitions() {
20649
+ var e = [];
20650
+ do {
20651
+ var r = void 0;
20652
+ if (34 === i.charCodeAt(n)) {
20653
+ r = value(!0);
20906
20654
  }
20907
- async function accountSignupFunction(plugin) {
20908
- if (!portalSessionToken) {
20909
- throw new Error('Portal session token is required');
20655
+ if (123 === i.charCodeAt(n)) {
20656
+ if (r) {
20657
+ throw error("Document");
20658
+ }
20659
+ n++, ignored(), e.push({
20660
+ kind: "OperationDefinition",
20661
+ operation: "query",
20662
+ name: void 0,
20663
+ variableDefinitions: void 0,
20664
+ directives: void 0,
20665
+ selectionSet: selectionSet()
20666
+ });
20667
+ } else {
20668
+ var t = name();
20669
+ switch (t) {
20670
+ case "fragment":
20671
+ e.push(fragmentDefinition(r));
20672
+ break;
20673
+
20674
+ case "query":
20675
+ case "mutation":
20676
+ case "subscription":
20677
+ var a;
20678
+ var o = void 0;
20679
+ if (40 !== (a = i.charCodeAt(n)) && 64 !== a && 123 !== a) {
20680
+ o = nameNode();
20910
20681
  }
20911
- if (!accountId) {
20912
- throw new Error('Account ID is required');
20682
+ var l = {
20683
+ kind: "OperationDefinition",
20684
+ operation: t,
20685
+ name: o,
20686
+ variableDefinitions: variableDefinitions(),
20687
+ directives: directives(!1),
20688
+ selectionSet: selectionSetStart()
20689
+ };
20690
+ if (r) {
20691
+ l.description = r;
20913
20692
  }
20914
- if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
20915
- throw new Error('Plugin ID is required');
20693
+ e.push(l);
20694
+ break;
20695
+
20696
+ default:
20697
+ throw error("Document");
20698
+ }
20699
+ }
20700
+ } while (n < i.length);
20701
+ return e;
20702
+ }
20703
+
20704
+ function parse(e, r) {
20705
+ if (i = e.body ? e.body : e, n = 0, ignored(), r && r.noLocation) {
20706
+ return {
20707
+ kind: "Document",
20708
+ definitions: definitions()
20709
+ };
20710
+ } else {
20711
+ return {
20712
+ kind: "Document",
20713
+ definitions: definitions(),
20714
+ loc: {
20715
+ start: 0,
20716
+ end: i.length,
20717
+ startToken: void 0,
20718
+ endToken: void 0,
20719
+ source: {
20720
+ body: i,
20721
+ name: "graphql.web",
20722
+ locationOffset: {
20723
+ line: 1,
20724
+ column: 1
20725
+ }
20916
20726
  }
20917
- if (!(defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id)) {
20918
- throw new Error('Payment method ID is required');
20727
+ }
20728
+ };
20729
+ }
20730
+ }
20731
+
20732
+ var a = 0;
20733
+
20734
+ var e = new Set;
20735
+
20736
+ function initGraphQLTada() {
20737
+ function graphql(t, i) {
20738
+ var o = parse(t).definitions;
20739
+ var s = new Set;
20740
+ for (var f of i || []) {
20741
+ for (var u of f.definitions) {
20742
+ if (u.kind === e$1.FRAGMENT_DEFINITION && !s.has(u)) {
20743
+ o.push(u);
20744
+ s.add(u);
20919
20745
  }
20920
- return await accountSignup({
20921
- token: portalSessionToken,
20922
- apiHost,
20923
- quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
20924
- paymentMethodId: defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id,
20925
- pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
20926
- priceListCode: priceListCode,
20927
- accountId,
20928
- });
20929
- }
20930
- function handlePaymentFail(error) {
20931
- var _a;
20932
- showErrorNotification$2((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.message);
20746
+ }
20933
20747
  }
20934
- react.useEffect(() => {
20935
- if (initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id) {
20936
- recalculateTaxes();
20937
- }
20938
- }, [initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id]);
20939
- if (purchaseSucceeded) {
20940
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsxRuntime.jsx("div", { className: "bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 bunny-flex bunny-items-start bunny-pt-[25vh]", children: jsxRuntime.jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "bunny-w-full", companyName: companyName, returnUrl: returnUrl, currencyId: quote === null || quote === void 0 ? void 0 : quote.currencyId }) })) : (jsxRuntime.jsx("div", { children: "No currency ID found from Quote" })) }));
20748
+ var d;
20749
+ if ((d = o[0].kind === e$1.FRAGMENT_DEFINITION) && o[0].directives) {
20750
+ o[0].directives = o[0].directives.filter((r => "_unmask" !== r.name.value));
20941
20751
  }
20942
- return (jsxRuntime.jsxs("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-col' : 'bunny-flex-row'} bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ${shadow} ${className}`, style: style, children: [jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-center bunny-flex-col ${isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full'} bunny-justify-center`, children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24", children: [jsxRuntime.jsx("div", { children: topNavImageUrl.length > 0 && (jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsxRuntime.jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon, onRemoveCoupon: removeCoupon, isRemovingCoupon: isRemovingCoupon, priceListData: priceListData, isAddingCoupon: isAddingCoupon, couponCode: couponEditorCouponCode, setCouponCode: setCouponEditorCouponCode, activeCouponsExist: activeCouponsExist })) : (jsxRuntime.jsx("div", { className: "bunny-h-full", children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true })) : (jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData })) })), jsxRuntime.jsx(Footer, {})] }) }), jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col ${isMobile ? 'bunny-w-full bunny-h-1/2 bunny-overflow-auto' : 'bunny-w-1/2 bunny-h-full'} bunny-items-center`, style: {
20943
- boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
20944
- }, children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true, className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24` })) : (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24`, children: jsxRuntime.jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: isSigningUp || isLoadingQuote, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction, defaultValues: defaultValues }) })) })] }));
20752
+ var c;
20753
+ return {
20754
+ kind: e$1.DOCUMENT,
20755
+ definitions: o,
20756
+ get loc() {
20757
+ if (!c && d) {
20758
+ var r = t + function concatLocSources(r) {
20759
+ try {
20760
+ a++;
20761
+ var n = "";
20762
+ for (var t of r) {
20763
+ if (!e.has(t)) {
20764
+ e.add(t);
20765
+ var {loc: i} = t;
20766
+ if (i) {
20767
+ n += i.source.body;
20768
+ }
20769
+ }
20770
+ }
20771
+ return n;
20772
+ } finally {
20773
+ if (0 == --a) {
20774
+ e.clear();
20775
+ }
20776
+ }
20777
+ }(i || []);
20778
+ return {
20779
+ start: 0,
20780
+ end: r.length,
20781
+ source: {
20782
+ body: r,
20783
+ name: "GraphQLTada",
20784
+ locationOffset: {
20785
+ line: 1,
20786
+ column: 1
20787
+ }
20788
+ }
20789
+ };
20790
+ }
20791
+ return c;
20792
+ },
20793
+ set loc(r) {
20794
+ c = r;
20795
+ }
20796
+ };
20797
+ }
20798
+ graphql.scalar = function scalar(r, n) {
20799
+ return n;
20800
+ };
20801
+ graphql.persisted = function persisted(n, a) {
20802
+ return {
20803
+ kind: e$1.DOCUMENT,
20804
+ definitions: a ? a.definitions : [],
20805
+ documentId: n
20806
+ };
20807
+ };
20808
+ return graphql;
20945
20809
  }
20946
20810
 
20947
- var e$1 = {
20948
- NAME: "Name",
20949
- DOCUMENT: "Document",
20950
- OPERATION_DEFINITION: "OperationDefinition",
20951
- VARIABLE_DEFINITION: "VariableDefinition",
20952
- SELECTION_SET: "SelectionSet",
20953
- FIELD: "Field",
20954
- ARGUMENT: "Argument",
20955
- FRAGMENT_SPREAD: "FragmentSpread",
20956
- INLINE_FRAGMENT: "InlineFragment",
20957
- FRAGMENT_DEFINITION: "FragmentDefinition",
20958
- VARIABLE: "Variable",
20959
- INT: "IntValue",
20960
- FLOAT: "FloatValue",
20961
- STRING: "StringValue",
20962
- BOOLEAN: "BooleanValue",
20963
- NULL: "NullValue",
20964
- ENUM: "EnumValue",
20965
- LIST: "ListValue",
20966
- OBJECT: "ObjectValue",
20967
- OBJECT_FIELD: "ObjectField",
20968
- DIRECTIVE: "Directive",
20969
- NAMED_TYPE: "NamedType",
20970
- LIST_TYPE: "ListType",
20971
- NON_NULL_TYPE: "NonNullType"
20972
- };
20811
+ function readFragment(...r) {
20812
+ return 2 === r.length ? r[1] : r[0];
20813
+ }
20973
20814
 
20974
- class GraphQLError extends Error {
20975
- constructor(e, r, i, n, t, a, o) {
20976
- if (super(e), this.name = "GraphQLError", this.message = e, t) {
20977
- this.path = t;
20978
- }
20979
- if (r) {
20980
- this.nodes = Array.isArray(r) ? r : [ r ];
20981
- }
20982
- if (i) {
20983
- this.source = i;
20815
+ var t = initGraphQLTada();
20816
+
20817
+ const MUTATION$7 = () => `
20818
+ mutation AccountSignup (
20819
+ $pluginId: String!,
20820
+ $paymentMethodId: String,
20821
+ $priceListCode: String!,
20822
+ $accountId: ID!,
20823
+ $quoteId: ID!,
20824
+ ) {
20825
+ accountSignup(
20826
+ pluginId: $pluginId,
20827
+ paymentMethodId: $paymentMethodId,
20828
+ priceListCode: $priceListCode,
20829
+ accountId: $accountId,
20830
+ quoteId: $quoteId,
20831
+ ) {
20832
+ errors
20833
+ quote {
20834
+ accountId
20835
+ amount
20836
+ amountDue
20837
+ applicationDate
20838
+ applied
20839
+ backdatedPeriods
20840
+ backdatedQuote
20841
+ billingDay
20842
+ contactId
20843
+ createdAt
20844
+ credits
20845
+ currencyId
20846
+ dealId
20847
+ discount
20848
+ discountValue
20849
+ endDate
20850
+ evergreen
20851
+ expiresAt
20852
+ id
20853
+ invoiceImmediately
20854
+ invoiceImmediatelyAvailable
20855
+ invoiceUntil
20856
+ isPendingApprovalRequest
20857
+ kind
20858
+ message
20859
+ name
20860
+ netPaymentDays
20861
+ notes
20862
+ number
20863
+ ownerId
20864
+ payableId
20865
+ periodAmount
20866
+ poNumber
20867
+ requiresApproval
20868
+ smallUnitAmountDue
20869
+ splitInvoice
20870
+ startDate
20871
+ state
20872
+ subtotal
20873
+ taxAmount
20874
+ taxCode
20875
+ updatedAt
20876
+ uuid
20984
20877
  }
20985
- if (n) {
20986
- this.positions = n;
20878
+ }
20879
+ }`;
20880
+ const accountSignup = async ({ token, apiHost, accountId, quoteId, paymentToken, paymentMethodId, pluginId, priceListCode, }) => {
20881
+ var _a;
20882
+ const vars = {
20883
+ accountId,
20884
+ quoteId,
20885
+ paymentToken,
20886
+ pluginId,
20887
+ paymentMethodId,
20888
+ priceListCode,
20889
+ };
20890
+ const response = await gqlRequest({
20891
+ query: MUTATION$7(),
20892
+ token,
20893
+ vars,
20894
+ apiHost,
20895
+ });
20896
+ const errors = (_a = response === null || response === void 0 ? void 0 : response.accountSignup) === null || _a === void 0 ? void 0 : _a.errors;
20897
+ if (errors)
20898
+ throw errors;
20899
+ return response === null || response === void 0 ? void 0 : response.accountSignup;
20900
+ };
20901
+
20902
+ const MUTATION$6 = () => `
20903
+ mutation QuoteAccountSignup (
20904
+ $accountName: String!,
20905
+ $billingContact: ContactAttributes!,
20906
+ $priceListCode: String!,
20907
+ $billingDetails: BillingDetailsAttributes
20908
+ ) {
20909
+ quoteAccountSignup(
20910
+ priceListCode: $priceListCode,
20911
+ accountName: $accountName,
20912
+ billingContact: $billingContact,
20913
+ billingDetails: $billingDetails
20914
+ ) {
20915
+ account {
20916
+ id
20987
20917
  }
20988
- if (a) {
20989
- this.originalError = a;
20918
+ quote {
20919
+ accountId
20920
+ amount
20921
+ amountDue
20922
+ applicationDate
20923
+ applied
20924
+ backdatedPeriods
20925
+ backdatedQuote
20926
+ billingDay
20927
+ contactId
20928
+ createdAt
20929
+ credits
20930
+ currencyId
20931
+ dealId
20932
+ discount
20933
+ discountValue
20934
+ endDate
20935
+ evergreen
20936
+ expiresAt
20937
+ id
20938
+ invoiceImmediately
20939
+ invoiceImmediatelyAvailable
20940
+ invoiceUntil
20941
+ isPendingApprovalRequest
20942
+ kind
20943
+ message
20944
+ name
20945
+ netPaymentDays
20946
+ notes
20947
+ number
20948
+ ownerId
20949
+ payableId
20950
+ periodAmount
20951
+ poNumber
20952
+ requiresApproval
20953
+ smallUnitAmountDue
20954
+ splitInvoice
20955
+ startDate
20956
+ state
20957
+ subtotal
20958
+ taxAmount
20959
+ taxCode
20960
+ updatedAt
20961
+ uuid
20990
20962
  }
20991
- var l = o;
20992
- if (!l && a) {
20993
- var d = a.extensions;
20994
- if (d && "object" == typeof d) {
20995
- l = d;
20996
- }
20963
+ tenant {
20964
+ code
20997
20965
  }
20998
- this.extensions = l || {};
20966
+ portalSessionToken
20967
+ errors
20999
20968
  }
21000
- toJSON() {
21001
- return {
21002
- ...this,
21003
- message: this.message
20969
+ }`;
20970
+ const quoteAccountSignup = async ({ token, apiHost, priceListCode, accountName, billingContact, billingDetails, }) => {
20971
+ var _a;
20972
+ const vars = {
20973
+ priceListCode,
20974
+ accountName,
20975
+ billingContact,
20976
+ billingDetails,
21004
20977
  };
21005
- }
21006
- toString() {
21007
- return this.message;
21008
- }
21009
- get [Symbol.toStringTag]() {
21010
- return "GraphQLError";
21011
- }
21012
- }
21013
-
21014
- var i;
21015
-
21016
- var n;
21017
-
21018
- function error(e) {
21019
- return new GraphQLError(`Syntax Error: Unexpected token at ${n} in ${e}`);
21020
- }
21021
-
21022
- function advance(e) {
21023
- if (e.lastIndex = n, e.test(i)) {
21024
- return i.slice(n, n = e.lastIndex);
21025
- }
21026
- }
21027
-
21028
- var t$1 = / +(?=[^\s])/y;
20978
+ const response = await gqlRequest({
20979
+ query: MUTATION$6(),
20980
+ token,
20981
+ vars,
20982
+ apiHost,
20983
+ });
20984
+ const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteAccountSignup) === null || _a === void 0 ? void 0 : _a.errors;
20985
+ if (errors)
20986
+ throw errors;
20987
+ return response === null || response === void 0 ? void 0 : response.quoteAccountSignup;
20988
+ };
21029
20989
 
21030
- function blockString(e) {
21031
- var r = e.split("\n");
21032
- var i = "";
21033
- var n = 0;
21034
- var a = 0;
21035
- var o = r.length - 1;
21036
- for (var l = 0; l < r.length; l++) {
21037
- if (t$1.lastIndex = 0, t$1.test(r[l])) {
21038
- if (l && (!n || t$1.lastIndex < n)) {
21039
- n = t$1.lastIndex;
20990
+ const QUOTE_RECALCULATE_TAXES = `
20991
+ mutation QuoteRecalculateTaxes($id: ID!) {
20992
+ quoteRecalculateTaxes(id: $id) {
20993
+ quote {
20994
+ accountId
20995
+ amount
20996
+ amountDue
20997
+ smallUnitAmountDue
20998
+ currencyId
20999
+ formattedQuote {
21000
+ html
21001
+ }
21002
+ id
21003
+ payableId
21004
+ periodAmount
21005
+ subtotal
21006
+ taxAmount
21007
+ amountsByPeriod {
21008
+ amount
21009
+ startDate
21010
+ }
21011
+ kind
21012
+ quoteChanges {
21013
+ currencyId
21014
+ id
21015
+ kind
21016
+ charges {
21017
+ subtotal
21018
+ amountsByPeriod {
21019
+ amount
21020
+ startDate
21021
+ }
21022
+ amount
21023
+ billingPeriod
21024
+ currencyId
21025
+ feature {
21026
+ unitName
21027
+ }
21028
+ id
21029
+ name
21030
+ priceListCharge {
21031
+ id
21032
+ }
21033
+ priceList {
21034
+ id
21035
+ }
21036
+ coupon {
21037
+ couponCode
21038
+ }
21039
+ quantity
21040
+ kind
21041
+ }
21042
+ priceList {
21043
+ id
21044
+ plan {
21045
+ name
21046
+ }
21047
+ product {
21048
+ name
21049
+ }
21050
+ }
21051
+ }
21040
21052
  }
21041
- a = a || l, o = l;
21042
- }
21043
- }
21044
- for (var d = a; d <= o; d++) {
21045
- if (d !== a) {
21046
- i += "\n";
21053
+ errors
21047
21054
  }
21048
- i += r[d].slice(n).replace(/\\"""/g, '"""');
21049
21055
  }
21050
- return i;
21051
- }
21056
+ `;
21057
+ const quoteRecalculateTaxes = async ({ quoteId, apiHost, token, }) => {
21058
+ var _a, _b;
21059
+ const vars = { id: quoteId };
21060
+ const response = await gqlRequest({
21061
+ query: QUOTE_RECALCULATE_TAXES,
21062
+ token,
21063
+ vars,
21064
+ apiHost,
21065
+ });
21066
+ const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _a === void 0 ? void 0 : _a.errors;
21067
+ if (errors)
21068
+ throw errors;
21069
+ return (_b = response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.quote;
21070
+ };
21052
21071
 
21053
- function ignored() {
21054
- for (var e = 0 | i.charCodeAt(n++); 9 === e || 10 === e || 13 === e || 32 === e || 35 === e || 44 === e || 65279 === e; e = 0 | i.charCodeAt(n++)) {
21055
- if (35 === e) {
21056
- for (;(e = 0 | i.charCodeAt(n++)) && 10 !== e && 13 !== e; ) {}
21072
+ const MUTATION$5 = () => `
21073
+ query PriceList($code: String!) {
21074
+ priceList (code: $code) {
21075
+ basePrice
21076
+ code
21077
+ createdAt
21078
+ currencyId
21079
+ id
21080
+ isVisible
21081
+ name
21082
+ periodMonths
21083
+ planId
21084
+ priceDescription
21085
+ productId
21086
+ product {
21087
+ name
21057
21088
  }
21089
+ sku
21090
+ trialAllowed
21091
+ trialLengthDays
21092
+ updatedAt
21058
21093
  }
21059
- n--;
21060
- }
21061
-
21062
- function name() {
21063
- var e = n;
21064
- for (var r = 0 | i.charCodeAt(n++); r >= 48 && r <= 57 || r >= 65 && r <= 90 || 95 === r || r >= 97 && r <= 122; r = 0 | i.charCodeAt(n++)) {}
21065
- if (e === n - 1) {
21066
- throw error("Name");
21067
- }
21068
- var t = i.slice(e, --n);
21069
- return ignored(), t;
21070
- }
21071
-
21072
- function nameNode() {
21073
- return {
21074
- kind: "Name",
21075
- value: name()
21076
- };
21077
- }
21094
+ }`;
21095
+ const getPriceList = async ({ token, code, apiHost, }) => {
21096
+ const response = await gqlRequest({
21097
+ query: MUTATION$5(),
21098
+ token,
21099
+ vars: { code },
21100
+ apiHost,
21101
+ });
21102
+ return response === null || response === void 0 ? void 0 : response.priceList;
21103
+ };
21078
21104
 
21079
- var a$1 = /(?:"""|(?:[\s\S]*?[^\\])""")/y;
21105
+ const QuoteFields_QuoteFragment = t(`
21106
+ fragment QuoteFields_QuoteFragment on Quote @_unmask {
21107
+ accountId
21108
+ amount
21109
+ amountDue
21110
+ smallUnitAmountDue
21111
+ currencyId
21112
+ id
21113
+ payableId
21114
+ periodAmount
21115
+ subtotal
21116
+ taxAmount
21117
+ startDate
21118
+ formattedQuote {
21119
+ html
21120
+ }
21121
+ amountsByPeriod {
21122
+ amount
21123
+ startDate
21124
+ }
21125
+ kind
21126
+ quoteChanges {
21127
+ currencyId
21128
+ id
21129
+ kind
21130
+ charges {
21131
+ subtotal
21132
+ amountsByPeriod {
21133
+ amount
21134
+ startDate
21135
+ }
21136
+ amount
21137
+ billingPeriod
21138
+ currencyId
21139
+ feature {
21140
+ unitName
21141
+ }
21142
+ id
21143
+ name
21144
+ priceListCharge {
21145
+ id
21146
+ }
21147
+ priceList {
21148
+ id
21149
+ }
21150
+ coupon {
21151
+ couponCode
21152
+ }
21153
+ quantity
21154
+ kind
21155
+ }
21156
+ priceList {
21157
+ id
21158
+ plan {
21159
+ name
21160
+ }
21161
+ product {
21162
+ name
21163
+ }
21164
+ }
21165
+ }
21166
+ }
21167
+ `);
21168
+ /**
21169
+ * Central quote fragment for QuoteProvider context.
21170
+ *
21171
+ * This fragment aggregates all child component fragments to ensure the QuoteProvider
21172
+ * fetches all required quote data upfront. When a component needs specific quote fields,
21173
+ * add its fragment here to maintain type safety and avoid over-fetching.
21174
+ *
21175
+ * Pattern: Fragment Composition
21176
+ * - Components define their data needs via fragments
21177
+ * - Provider composes these fragments into a single query
21178
+ * - Type safety ensures all required fields are fetched
21179
+ */
21180
+ const QuoteContext_QuoteFragment = t(`
21181
+ fragment QuoteContext_QuoteFragment on Quote {
21182
+ ...QuoteFields_QuoteFragment
21183
+ }
21184
+ `, [QuoteFields_QuoteFragment]);
21080
21185
 
21081
- var o = /(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;
21186
+ async function execute(query, config, variables) {
21187
+ const response = await gqlRequest({
21188
+ query: graphql$1.print(query),
21189
+ vars: variables,
21190
+ apiHost: config.apiHost,
21191
+ token: config.token,
21192
+ });
21193
+ return response;
21194
+ }
21082
21195
 
21083
- function value(e) {
21084
- var r;
21085
- switch (i.charCodeAt(n)) {
21086
- case 91:
21087
- n++, ignored();
21088
- var t = [];
21089
- for (;93 !== i.charCodeAt(n); ) {
21090
- t.push(value(e));
21196
+ // Deprecated: Keeping this for now because its used in many places
21197
+ const QUOTE_FIELDS = (removeFormattedQuoteField) => `
21198
+ fragment QuoteFields on Quote {
21199
+ accountId
21200
+ amount
21201
+ amountDue
21202
+ smallUnitAmountDue
21203
+ currencyId
21204
+ ${removeFormattedQuoteField ? '' : `formattedQuote { html }`}
21205
+ id
21206
+ payableId
21207
+ periodAmount
21208
+ subtotal
21209
+ taxAmount
21210
+ startDate
21211
+ amountsByPeriod {
21212
+ amount
21213
+ startDate
21091
21214
  }
21092
- return n++, ignored(), {
21093
- kind: "ListValue",
21094
- values: t
21095
- };
21096
-
21097
- case 123:
21098
- n++, ignored();
21099
- var l = [];
21100
- for (;125 !== i.charCodeAt(n); ) {
21101
- var d = nameNode();
21102
- if (58 !== i.charCodeAt(n++)) {
21103
- throw error("ObjectField");
21215
+ kind
21216
+ quoteChanges {
21217
+ currencyId
21218
+ id
21219
+ kind
21220
+ charges {
21221
+ subtotal
21222
+ amountsByPeriod {
21223
+ amount
21224
+ startDate
21225
+ }
21226
+ amount
21227
+ billingPeriod
21228
+ currencyId
21229
+ feature {
21230
+ unitName
21231
+ }
21232
+ id
21233
+ name
21234
+ priceListCharge {
21235
+ id
21236
+ }
21237
+ priceList {
21238
+ id
21239
+ }
21240
+ coupon {
21241
+ couponCode
21242
+ }
21243
+ quantity
21244
+ kind
21245
+ }
21246
+ priceList {
21247
+ id
21248
+ plan {
21249
+ name
21250
+ }
21251
+ product {
21252
+ name
21253
+ }
21104
21254
  }
21105
- ignored(), l.push({
21106
- kind: "ObjectField",
21107
- name: d,
21108
- value: value(e)
21109
- });
21110
21255
  }
21111
- return n++, ignored(), {
21112
- kind: "ObjectValue",
21113
- fields: l
21114
- };
21115
-
21116
- case 36:
21117
- if (e) {
21118
- throw error("Variable");
21256
+ }
21257
+ `;
21258
+ const FormattedQuoteField_QuoteFragment = t(`
21259
+ fragment FormattedQuoteField_QuoteFragment on Quote {
21260
+ formattedQuote {
21261
+ html
21119
21262
  }
21120
- return n++, {
21121
- kind: "Variable",
21122
- name: nameNode()
21123
- };
21124
-
21125
- case 34:
21126
- if (34 === i.charCodeAt(n + 1) && 34 === i.charCodeAt(n + 2)) {
21127
- if (n += 3, null == (r = advance(a$1))) {
21128
- throw error("StringValue");
21129
- }
21130
- return ignored(), {
21131
- kind: "StringValue",
21132
- value: blockString(r.slice(0, -3)),
21133
- block: !0
21134
- };
21135
- } else {
21136
- var u = n;
21137
- var s;
21138
- n++;
21139
- var c = !1;
21140
- for (s = 0 | i.charCodeAt(n++); 92 === s && (n++, c = !0) || 10 !== s && 13 !== s && 34 !== s && s; s = 0 | i.charCodeAt(n++)) {}
21141
- if (34 !== s) {
21142
- throw error("StringValue");
21263
+ }
21264
+ `);
21265
+ const query$1 = t(`
21266
+ query quote($id: ID, $removeFormattedQuoteField: Boolean!) {
21267
+ quote(id: $id) {
21268
+ ...QuoteContext_QuoteFragment
21269
+ ...FormattedQuoteField_QuoteFragment @include(if: $removeFormattedQuoteField)
21143
21270
  }
21144
- return r = i.slice(u, n), ignored(), {
21145
- kind: "StringValue",
21146
- value: c ? JSON.parse(r) : r.slice(1, -1),
21147
- block: !1
21148
- };
21149
21271
  }
21272
+ `, [QuoteContext_QuoteFragment, FormattedQuoteField_QuoteFragment]);
21273
+ const getQuote$1 = async ({ id, token, apiHost, removeFormattedQuoteField = false, }) => {
21274
+ const response = await execute(query$1, { apiHost, token }, { id, removeFormattedQuoteField });
21275
+ return response === null || response === void 0 ? void 0 : response.quote;
21276
+ };
21150
21277
 
21151
- case 45:
21152
- case 48:
21153
- case 49:
21154
- case 50:
21155
- case 51:
21156
- case 52:
21157
- case 53:
21158
- case 54:
21159
- case 55:
21160
- case 56:
21161
- case 57:
21162
- var v = n++;
21163
- var f;
21164
- for (;(f = 0 | i.charCodeAt(n++)) >= 48 && f <= 57; ) {}
21165
- var m = i.slice(v, --n);
21166
- if (46 === (f = i.charCodeAt(n)) || 69 === f || 101 === f) {
21167
- if (null == (r = advance(o))) {
21168
- throw error("FloatValue");
21278
+ const MUTATION$4 = `mutation quoteChangeAddCoupon($couponCode: String!, $quoteChangeId: ID!) {
21279
+ quoteChangeAddCoupon(couponCode: $couponCode, quoteChangeId: $quoteChangeId) {
21280
+ quoteChange {
21281
+ id
21282
+ charges {
21283
+ id
21284
+ amount
21285
+ couponId
21286
+ }
21169
21287
  }
21170
- return ignored(), {
21171
- kind: "FloatValue",
21172
- value: m + r
21173
- };
21174
- } else {
21175
- return ignored(), {
21176
- kind: "IntValue",
21177
- value: m
21178
- };
21179
21288
  }
21289
+ }`;
21290
+ const quoteChangeAddCoupon = async ({ quoteChangeId, couponCode, token, apiHost, }) => {
21291
+ var _a;
21292
+ const vars = { couponCode, quoteChangeId };
21293
+ const response = await gqlRequest({
21294
+ query: MUTATION$4,
21295
+ token,
21296
+ vars,
21297
+ apiHost,
21298
+ });
21299
+ const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteAddCoupon) === null || _a === void 0 ? void 0 : _a.errors;
21300
+ if (errors)
21301
+ throw errors;
21302
+ return response.quote;
21303
+ };
21180
21304
 
21181
- case 110:
21182
- if (117 === i.charCodeAt(n + 1) && 108 === i.charCodeAt(n + 2) && 108 === i.charCodeAt(n + 3)) {
21183
- return n += 4, ignored(), {
21184
- kind: "NullValue"
21185
- };
21186
- } else {
21187
- break;
21305
+ const MUTATION$3 = `mutation quoteChangeRemoveCoupon($quoteChangeId: ID!, $couponCode: String!) {
21306
+ quoteChangeRemoveCoupon(quoteChangeId: $quoteChangeId, couponCode: $couponCode) {
21307
+ errors
21188
21308
  }
21309
+ }
21310
+ `;
21311
+ const quoteChangeRemoveCoupon = async ({ quoteChangeId, couponCode, token, apiHost, }) => {
21312
+ var _a;
21313
+ const vars = { couponCode, quoteChangeId };
21314
+ const response = await gqlRequest({
21315
+ query: MUTATION$3,
21316
+ token,
21317
+ vars,
21318
+ apiHost,
21319
+ });
21320
+ const errors = (_a = response === null || response === void 0 ? void 0 : response.quoteChangeRemoveCoupon) === null || _a === void 0 ? void 0 : _a.errors;
21321
+ if (errors)
21322
+ throw errors;
21323
+ return response.quote;
21324
+ };
21189
21325
 
21190
- case 116:
21191
- if (114 === i.charCodeAt(n + 1) && 117 === i.charCodeAt(n + 2) && 101 === i.charCodeAt(n + 3)) {
21192
- return n += 4, ignored(), {
21193
- kind: "BooleanValue",
21194
- value: !0
21195
- };
21196
- } else {
21197
- break;
21326
+ const COUPONS_QUERY = (filter) => `
21327
+ query Coupons {
21328
+ coupons(filter: ${filter ? `"${filter}"` : 'null'}) {
21329
+ totalCount
21330
+ }
21198
21331
  }
21332
+ `;
21333
+ const getCoupons = async ({ token, apiHost, filter, }) => {
21334
+ const response = await gqlRequest({
21335
+ query: COUPONS_QUERY(filter),
21336
+ token,
21337
+ vars: {},
21338
+ apiHost,
21339
+ });
21340
+ return response === null || response === void 0 ? void 0 : response.coupons;
21341
+ };
21342
+
21343
+ const showErrorNotification$3 = common.useErrorNotification();
21344
+ const useUpdateCoupons = ({ apiHost, token, quoteChangeId, onCouponAdded, onCouponRemoved, }) => {
21345
+ const { data: coupons } = reactQuery.useQuery({
21346
+ queryKey: ['coupons', token],
21347
+ queryFn: () => getCoupons({ token, apiHost, filter: 'coupon.active is true' }),
21348
+ });
21349
+ const { mutate: addCoupon, isPending: isAddingCoupon } = reactQuery.useMutation({
21350
+ mutationFn: (couponCode) => {
21351
+ if (!token) {
21352
+ throw new Error('Token is required');
21353
+ }
21354
+ if (!quoteChangeId) {
21355
+ throw new Error('Quote change ID is required');
21356
+ }
21357
+ return quoteChangeAddCoupon({
21358
+ quoteChangeId,
21359
+ couponCode,
21360
+ apiHost,
21361
+ token,
21362
+ });
21363
+ },
21364
+ onSuccess: () => {
21365
+ onCouponAdded === null || onCouponAdded === void 0 ? void 0 : onCouponAdded();
21366
+ },
21367
+ onError: (error) => {
21368
+ var _a, _b;
21369
+ showErrorNotification$3((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error adding coupon');
21370
+ },
21371
+ });
21372
+ const { mutate: removeCoupon, isPending: isRemovingCoupon } = reactQuery.useMutation({
21373
+ mutationFn: (couponCode) => {
21374
+ if (!quoteChangeId) {
21375
+ throw new Error('Quote change ID is required');
21376
+ }
21377
+ return quoteChangeRemoveCoupon({
21378
+ quoteChangeId,
21379
+ couponCode,
21380
+ apiHost,
21381
+ token,
21382
+ });
21383
+ },
21384
+ onSuccess: () => {
21385
+ onCouponRemoved === null || onCouponRemoved === void 0 ? void 0 : onCouponRemoved();
21386
+ },
21387
+ onError: (error) => {
21388
+ var _a, _b;
21389
+ showErrorNotification$3((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error removing coupon');
21390
+ },
21391
+ });
21392
+ return {
21393
+ addCoupon,
21394
+ removeCoupon,
21395
+ isAddingCoupon,
21396
+ isRemovingCoupon,
21397
+ activeCouponsExist: (coupons === null || coupons === void 0 ? void 0 : coupons.totalCount) > 0,
21398
+ };
21399
+ };
21199
21400
 
21200
- case 102:
21201
- if (97 === i.charCodeAt(n + 1) && 108 === i.charCodeAt(n + 2) && 115 === i.charCodeAt(n + 3) && 101 === i.charCodeAt(n + 4)) {
21202
- return n += 5, ignored(), {
21203
- kind: "BooleanValue",
21204
- value: !1
21205
- };
21206
- } else {
21207
- break;
21208
- }
21209
- }
21210
- return {
21211
- kind: "EnumValue",
21212
- value: name()
21213
- };
21214
- }
21401
+ const BunnyFooterIcon = ({ color }) => {
21402
+ return (jsxRuntime.jsxs("svg", { width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsxs("g", { clipPath: "url(#clip0_6_851)", children: [jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_6_851", children: jsxRuntime.jsx("rect", { width: "39", height: "13", fill: "white" }) }) })] }));
21403
+ };
21215
21404
 
21216
- function arguments_(e) {
21217
- if (40 === i.charCodeAt(n)) {
21218
- var r = [];
21219
- n++, ignored();
21220
- do {
21221
- var t = nameNode();
21222
- if (58 !== i.charCodeAt(n++)) {
21223
- throw error("Argument");
21224
- }
21225
- ignored(), r.push({
21226
- kind: "Argument",
21227
- name: t,
21228
- value: value(e)
21229
- });
21230
- } while (41 !== i.charCodeAt(n));
21231
- return n++, ignored(), r;
21405
+ const { Text: Text$p } = antd.Typography;
21406
+ const Footer = ({ className }) => {
21407
+ const token = useToken();
21408
+ const { currentUser } = useCurrentUserData(token);
21409
+ const { privacyUrl, termsUrl } = currentUser;
21410
+ const isMobile = common.useIsMobile();
21411
+ return (jsxRuntime.jsxs("div", { className: `bunny-flex bunny-items-center bunny-justify-between bunny-shrink-0 ${isMobile ? 'bunny-flex-col bunny-gap-2' : ''} ${className}`, children: [(termsUrl || privacyUrl) && (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-gap-3", children: [termsUrl && (jsxRuntime.jsx(StyedLink, { className: "bunny-text-xs bunny-text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text", children: "Terms" })), privacyUrl && (jsxRuntime.jsx(StyedLink, { className: "bunny-text-xs bunny-text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text", children: "Privacy" }))] })), jsxRuntime.jsx(BunnyMarketingLink, {})] }));
21412
+ };
21413
+ const BunnyMarketingLink = () => {
21414
+ const [isHovered, setIsHovered] = react.useState(false);
21415
+ const isMobile = common.useIsMobile();
21416
+ return (jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-end bunny-justify-end ${isMobile ? '' : 'grow'}`, children: jsxRuntime.jsx(StyledBunnyLink, { className: "bunny-flex bunny-items-end bunny-justify-end bunny-text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center", onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [jsxRuntime.jsx(Text$p, { className: "bunny-text-slate-400", children: "Powered by\u00A0" }), jsxRuntime.jsx("div", { style: { paddingTop: '5px' }, children: jsxRuntime.jsx(BunnyFooterIcon, { color: isHovered ? common.PRIMARY_COLOR : common.SLATE_400 }) })] }) }) }));
21417
+ };
21418
+ const StyedLink = styled.a `
21419
+ color: ${common.SLATE_400};
21420
+ transition: color 0.3s;
21421
+ &:hover {
21422
+ color: ${common.SLATE_500};
21232
21423
  }
21233
- }
21234
-
21235
- function directives(e) {
21236
- if (64 === i.charCodeAt(n)) {
21237
- var r = [];
21238
- do {
21239
- n++, r.push({
21240
- kind: "Directive",
21241
- name: nameNode(),
21242
- arguments: arguments_(e)
21243
- });
21244
- } while (64 === i.charCodeAt(n));
21245
- return r;
21424
+ text-decoration: none;
21425
+ `;
21426
+ const StyledBunnyLink = styled(StyedLink) `
21427
+ &:hover {
21428
+ color: ${common.PRIMARY_COLOR} !important;
21246
21429
  }
21247
- }
21430
+ `;
21248
21431
 
21249
- function type() {
21250
- var e = 0;
21251
- for (;91 === i.charCodeAt(n); ) {
21252
- e++, n++, ignored();
21253
- }
21254
- var r = {
21255
- kind: "NamedType",
21256
- name: nameNode()
21257
- };
21258
- do {
21259
- if (33 === i.charCodeAt(n)) {
21260
- n++, ignored(), r = {
21261
- kind: "NonNullType",
21262
- type: r
21263
- };
21264
- }
21265
- if (e) {
21266
- if (93 !== i.charCodeAt(n++)) {
21267
- throw error("NamedType");
21268
- }
21269
- ignored(), r = {
21270
- kind: "ListType",
21271
- type: r
21272
- };
21432
+ function CouponEditor({ className, onAddCoupon, isAddingCoupon, couponCode, setCouponCode, }) {
21433
+ async function handleAddCoupon() {
21434
+ onAddCoupon(couponCode);
21273
21435
  }
21274
- } while (e--);
21275
- return r;
21436
+ return (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col bunny-gap-2 ${className}`, children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2", children: [jsxRuntime.jsx(antd.Input, { value: couponCode, onChange: e => setCouponCode(e.target.value), placeholder: "Coupon code", disabled: isAddingCoupon, size: "small" }), jsxRuntime.jsx(antd.Button, { loading: isAddingCoupon, type: "primary", onClick: handleAddCoupon, disabled: couponCode.length === 0, children: "Apply" })] }) }));
21276
21437
  }
21277
21438
 
21278
- function selectionSetStart() {
21279
- if (123 !== i.charCodeAt(n++)) {
21280
- throw error("SelectionSet");
21281
- }
21282
- return ignored(), selectionSet();
21439
+ const { Text: Text$o } = antd.Typography;
21440
+ function CheckoutSummary({ quote, className, onAddCoupon, onRemoveCoupon, isRemovingCoupon, priceListData, isAddingCoupon, couponCode, setCouponCode, activeCouponsExist, }) {
21441
+ return (jsxRuntime.jsxs("div", { className: `${className} bunny-space-y-4`, children: [jsxRuntime.jsxs(Text$o, { children: [jsxRuntime.jsxs("div", { className: "bunny-text-lg bunny-font-medium bunny-mb-4", children: ["Checkout summary - ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.product.name, " ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.name] }), jsxRuntime.jsx("div", { className: "bunny-space-y-4", children: quote === null || quote === void 0 ? void 0 : quote.quoteChanges.map(quoteChange => quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(charge => {
21442
+ var _a;
21443
+ const multiplier = charge.kind === 'COUPON' ? -1 : 1;
21444
+ return (jsxRuntime.jsxs("div", { className: "bunny-grid bunny-grid-cols-3 bunny-gap-4 bunny-items-center", children: [jsxRuntime.jsx("div", { className: "bunny-col-span-1", children: charge.name }), jsxRuntime.jsx("div", { className: "bunny-col-span-1 bunny-text-center", children: ((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode) ? (jsxRuntime.jsx("button", { onClick: () => {
21445
+ var _a, _b;
21446
+ if (isRemovingCoupon) {
21447
+ return;
21448
+ }
21449
+ if (!((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode)) {
21450
+ throw new Error('Coupon code not found');
21451
+ }
21452
+ onRemoveCoupon((_b = charge.coupon) === null || _b === void 0 ? void 0 : _b.couponCode);
21453
+ }, className: "bunny-text-orange-500 hover:bunny-text-orange-400 bunny-cursor-pointer bunny-bg-transparent bunny-border-none", children: "Remove" })) : (jsxRuntime.jsx("div", { children: charge.quantity })) }), jsxRuntime.jsx("div", { className: "bunny-col-span-1 bunny-text-right", children: common.formatCurrency(multiplier * (charge.subtotal || 0), charge.currencyId) })] }, charge.id));
21454
+ })) }), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", { className: "bunny-space-y-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-justify-between", children: [jsxRuntime.jsx("div", { children: "Subtotal" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.subtotal, quote.currencyId) })] }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-justify-between", children: [jsxRuntime.jsx("div", { children: "Taxes" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.taxAmount, quote.currencyId) })] })] }), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-justify-between", children: [jsxRuntime.jsx("div", { children: "Total" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue, quote.currencyId) })] })] }), activeCouponsExist && (jsxRuntime.jsx(CouponEditor, { className: "bunny-w-full", quote: quote, onAddCoupon: onAddCoupon, isAddingCoupon: isAddingCoupon, couponCode: couponCode, setCouponCode: setCouponCode }))] }));
21283
21455
  }
21456
+ const CheckoutSummaryDivider = () => {
21457
+ return (jsxRuntime.jsx("div", { className: "bunny-my-2", children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) }));
21458
+ };
21284
21459
 
21285
- function selectionSet() {
21286
- var e = [];
21287
- do {
21288
- if (46 === i.charCodeAt(n)) {
21289
- if (46 !== i.charCodeAt(++n) || 46 !== i.charCodeAt(++n)) {
21290
- throw error("SelectionSet");
21291
- }
21292
- switch (n++, ignored(), i.charCodeAt(n)) {
21293
- case 64:
21294
- e.push({
21295
- kind: "InlineFragment",
21296
- typeCondition: void 0,
21297
- directives: directives(!1),
21298
- selectionSet: selectionSetStart()
21299
- });
21300
- break;
21301
-
21302
- case 111:
21303
- if (110 === i.charCodeAt(n + 1)) {
21304
- n += 2, ignored(), e.push({
21305
- kind: "InlineFragment",
21306
- typeCondition: {
21307
- kind: "NamedType",
21308
- name: nameNode()
21309
- },
21310
- directives: directives(!1),
21311
- selectionSet: selectionSetStart()
21312
- });
21313
- } else {
21314
- e.push({
21315
- kind: "FragmentSpread",
21316
- name: nameNode(),
21317
- directives: directives(!1)
21318
- });
21319
- }
21320
- break;
21321
-
21322
- case 123:
21323
- n++, ignored(), e.push({
21324
- kind: "InlineFragment",
21325
- typeCondition: void 0,
21326
- directives: void 0,
21327
- selectionSet: selectionSet()
21328
- });
21329
- break;
21330
-
21331
- default:
21332
- e.push({
21333
- kind: "FragmentSpread",
21334
- name: nameNode(),
21335
- directives: directives(!1)
21460
+ const { Title: Title$1 } = antd.Typography;
21461
+ function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }) {
21462
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Payment" }), jsxRuntime.jsx("div", { className: "bunny-overflow-y-auto bunny-max-h-[calc(100vh-10rem)]", children: jsxRuntime.jsx(PaymentForm, { onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction }) })] })) : null })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, { className: "bunny-px-4 bunny-m-0", level: 2, children: "Signup" }), jsxRuntime.jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment, defaultValues: defaultValues })] })) }));
21463
+ }
21464
+ function InitialSignupForm({ className, onSubmit, submitting, defaultValues, }) {
21465
+ const [form] = antd.Form.useForm();
21466
+ const isMobile = common.useIsMobile();
21467
+ function handleSubmit() {
21468
+ form.validateFields({ validateOnly: false }).then(() => {
21469
+ onSubmit(form.getFieldsValue());
21336
21470
  });
21337
- }
21338
- } else {
21339
- var r = nameNode();
21340
- var t = void 0;
21341
- if (58 === i.charCodeAt(n)) {
21342
- n++, ignored(), t = r, r = nameNode();
21343
- }
21344
- var a = arguments_(!1);
21345
- var o = directives(!1);
21346
- var l = void 0;
21347
- if (123 === i.charCodeAt(n)) {
21348
- n++, ignored(), l = selectionSet();
21349
- }
21350
- e.push({
21351
- kind: "Field",
21352
- alias: t,
21353
- name: r,
21354
- arguments: a,
21355
- directives: o,
21356
- selectionSet: l
21357
- });
21358
21471
  }
21359
- } while (125 !== i.charCodeAt(n));
21360
- return n++, ignored(), {
21361
- kind: "SelectionSet",
21362
- selections: e
21363
- };
21472
+ react.useEffect(() => {
21473
+ if (defaultValues) {
21474
+ // Set all non empty default values
21475
+ form.setFieldsValue(Object.fromEntries(Object.entries({
21476
+ ...defaultValues,
21477
+ billingCountry: undefined,
21478
+ }).filter(([v, _]) => v)));
21479
+ // Set billing country if it's in the country list
21480
+ if (defaultValues.billingCountry &&
21481
+ common.Lists.COUNTRY_LIST.find(c => c.value === defaultValues.billingCountry)) {
21482
+ form.setFieldsValue({
21483
+ billingCountry: defaultValues.billingCountry,
21484
+ });
21485
+ }
21486
+ }
21487
+ }, [defaultValues]);
21488
+ return (jsxRuntime.jsx(antd.Form, { className: `bunny-flex bunny-flex-col bunny-h-full bunny-w-full ${className}`, form: form, layout: "vertical", autoComplete: "off", children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-space-y-2", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-4", children: [jsxRuntime.jsx(antd.Form.Item, { name: "firstName", rules: [{ required: true, message: 'First name is required' }], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "First name" }) }), jsxRuntime.jsx(antd.Form.Item, { name: "lastName", rules: [{ required: true, message: 'Last name is required' }], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "Last name" }) })] }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-gap-4", children: [jsxRuntime.jsx(antd.Form.Item, { name: "email", rules: [
21489
+ { required: true, message: 'Email is required' },
21490
+ { type: 'email', message: 'Please enter a valid email' },
21491
+ ], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "Email" }) }), jsxRuntime.jsx(antd.Form.Item, { name: "accountName", rules: [{ required: true, message: 'Company name is required' }], className: "bunny-flex-1", children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) })] }), jsxRuntime.jsx("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-row bunny-pb-2' : 'bunny-flex-row'} bunny-gap-4`, children: jsxRuntime.jsx("div", { className: "flex-1 w-1/2", children: jsxRuntime.jsx(antd.Form.Item, { name: "billingCountry", rules: [{ required: true, message: 'Country is required' }], children: jsxRuntime.jsx(antd.Select, { options: common.Lists.COUNTRY_LIST, placeholder: "Select a country", showSearch: true, filterOption: (input, option) => {
21492
+ var _a, _b;
21493
+ return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '').toLowerCase().includes(input.toLowerCase()) ||
21494
+ ((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : '').toLowerCase().includes(input.toLowerCase());
21495
+ } }) }) }) }), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, { type: "primary", onClick: handleSubmit, loading: submitting, className: "bunny-w-full", children: "Proceed to payment" }) })] }) }));
21364
21496
  }
21365
21497
 
21366
- function variableDefinitions() {
21367
- if (ignored(), 40 === i.charCodeAt(n)) {
21368
- var e = [];
21369
- n++, ignored();
21370
- do {
21371
- var r = void 0;
21372
- if (34 === i.charCodeAt(n)) {
21373
- r = value(!0);
21374
- }
21375
- if (36 !== i.charCodeAt(n++)) {
21376
- throw error("Variable");
21377
- }
21378
- var t = nameNode();
21379
- if (58 !== i.charCodeAt(n++)) {
21380
- throw error("VariableDefinition");
21381
- }
21382
- ignored();
21383
- var a = type();
21384
- var o = void 0;
21385
- if (61 === i.charCodeAt(n)) {
21386
- n++, ignored(), o = value(!0);
21387
- }
21388
- ignored();
21389
- var l = {
21390
- kind: "VariableDefinition",
21391
- variable: {
21392
- kind: "Variable",
21393
- name: t
21394
- },
21395
- type: a,
21396
- defaultValue: o,
21397
- directives: directives(!0)
21398
- };
21399
- if (r) {
21400
- l.description = r;
21401
- }
21402
- e.push(l);
21403
- } while (41 !== i.charCodeAt(n));
21404
- return n++, ignored(), e;
21405
- }
21498
+ const { Title, Text: Text$n } = antd.Typography;
21499
+ function PaymentSuccessDisplay({ amountPaid, className, companyName, returnUrl, style, currencyId, }) {
21500
+ return (jsxRuntime.jsxs("div", { className: `bunny-flex bunny-flex-col bunny-items-center bunny-justify-center bunny-h-full ${className}`, style: style, children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, { level: 3, className: "bunny-mt-2 bunny-m-0", children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] }), returnUrl && (jsxRuntime.jsxs(Text$n, { className: "bunny-text-slate-500 bunny-cursor-pointer bunny-underline", onClick: () => (window.location.href = returnUrl), children: ["Back to ", companyName] }))] }));
21406
21501
  }
21407
21502
 
21408
- function fragmentDefinition(e) {
21409
- var r = nameNode();
21410
- if (111 !== i.charCodeAt(n++) || 110 !== i.charCodeAt(n++)) {
21411
- throw error("FragmentDefinition");
21412
- }
21413
- ignored();
21414
- var t = {
21415
- kind: "FragmentDefinition",
21416
- name: r,
21417
- typeCondition: {
21418
- kind: "NamedType",
21419
- name: nameNode()
21420
- },
21421
- directives: directives(!1),
21422
- selectionSet: selectionSetStart()
21423
- };
21424
- if (e) {
21425
- t.description = e;
21426
- }
21427
- return t;
21503
+ const { Text: Text$m } = antd.Typography;
21504
+ function PriceListDisplay({ priceListData }) {
21505
+ if (!priceListData)
21506
+ return null;
21507
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-space-y-8", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-2", children: [jsxRuntime.jsxs(Text$m, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [priceListData.product.name, " ", priceListData.name] }), jsxRuntime.jsxs(Text$m, { className: "bunny-font-bold bunny-text-xl", children: [common.formatCurrency(priceListData.basePrice, priceListData.currencyId), " / month"] })] }), priceListData.trialAllowed ? (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col", children: [jsxRuntime.jsxs(Text$m, { style: { fontSize: '16px' }, className: "bunny-text-slate-500", children: [priceListData.trialLengthDays, " day trial"] }), jsxRuntime.jsx(Text$m, { className: "bunny-text-slate-500", style: { fontSize: '12px' }, children: "You will not be charged until the last day of the trial." })] })) : null] }));
21428
21508
  }
21429
21509
 
21430
- function definitions() {
21431
- var e = [];
21432
- do {
21433
- var r = void 0;
21434
- if (34 === i.charCodeAt(n)) {
21435
- r = value(!0);
21436
- }
21437
- if (123 === i.charCodeAt(n)) {
21438
- if (r) {
21439
- throw error("Document");
21440
- }
21441
- n++, ignored(), e.push({
21442
- kind: "OperationDefinition",
21443
- operation: "query",
21444
- name: void 0,
21445
- variableDefinitions: void 0,
21446
- directives: void 0,
21447
- selectionSet: selectionSet()
21448
- });
21449
- } else {
21450
- var t = name();
21451
- switch (t) {
21452
- case "fragment":
21453
- e.push(fragmentDefinition(r));
21454
- break;
21455
-
21456
- case "query":
21457
- case "mutation":
21458
- case "subscription":
21459
- var a;
21460
- var o = void 0;
21461
- if (40 !== (a = i.charCodeAt(n)) && 64 !== a && 123 !== a) {
21462
- o = nameNode();
21463
- }
21464
- var l = {
21465
- kind: "OperationDefinition",
21466
- operation: t,
21467
- name: o,
21468
- variableDefinitions: variableDefinitions(),
21469
- directives: directives(!1),
21470
- selectionSet: selectionSetStart()
21471
- };
21472
- if (r) {
21473
- l.description = r;
21510
+ const showErrorNotification$2 = common.useErrorNotification();
21511
+ const showSuccessNotification$1 = common.useSuccessNotification();
21512
+ function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow = 'shadow-md', style, defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry, }) {
21513
+ var _a, _b, _c, _d;
21514
+ // Hooks
21515
+ const { apiHost } = react.useContext(BunnyContext);
21516
+ const tokenFromContexts = useToken();
21517
+ const isMobile = common.useIsMobile();
21518
+ const { topNavImageUrl } = react.useContext(BrandContext);
21519
+ const defaultValues = react.useMemo(() => ({
21520
+ firstName: defaultFirstName,
21521
+ lastName: defaultLastName,
21522
+ email: defaultEmail,
21523
+ accountName: defaultCompanyName,
21524
+ billingCountry: defaultBillingCountry,
21525
+ }), [defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry]);
21526
+ const queryClient = reactQuery.useQueryClient();
21527
+ const [initialQuote, setInitialQuote] = react.useState(undefined);
21528
+ const [accountId, setAccountId] = react.useState(undefined);
21529
+ const [portalSessionToken, setPortalSessionToken] = react.useState(undefined);
21530
+ const token = portalSessionToken || tokenFromContexts;
21531
+ const [purchaseSucceeded, setPurchaseSucceeded] = react.useState(false);
21532
+ const defaultCouponAppliedRef = react.useRef(undefined);
21533
+ const [couponEditorCouponCode, setCouponEditorCouponCode] = react.useState('');
21534
+ const { defaultPaymentMethod } = usePaymentMethod({
21535
+ accountId,
21536
+ token,
21537
+ apiHost,
21538
+ enabled: Boolean(accountId),
21539
+ });
21540
+ const { mutate: recalculateTaxes } = reactQuery.useMutation({
21541
+ mutationFn: () => {
21542
+ if (!(quote === null || quote === void 0 ? void 0 : quote.id)) {
21543
+ throw new Error('Quote ID is required');
21544
+ }
21545
+ return quoteRecalculateTaxes({ token, apiHost, quoteId: quote.id });
21546
+ },
21547
+ onError: (error) => {
21548
+ if (!error[0].message.includes('Ensure that you have a taxation plugin')) {
21549
+ showErrorNotification$2(error.message);
21550
+ }
21551
+ },
21552
+ onSuccess: (quote) => {
21553
+ queryClient.setQueryData(['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id], quote);
21554
+ queryClient.invalidateQueries({
21555
+ queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
21556
+ });
21557
+ },
21558
+ });
21559
+ const { mutate: quoteAccountSignupMutate, isPending: isSigningUp } = reactQuery.useMutation({
21560
+ mutationFn: (formData) => {
21561
+ return quoteAccountSignup({
21562
+ token,
21563
+ apiHost,
21564
+ priceListCode,
21565
+ accountName: formData.accountName,
21566
+ billingContact: {
21567
+ firstName: formData.firstName,
21568
+ lastName: formData.lastName,
21569
+ email: formData.email,
21570
+ },
21571
+ billingDetails: {
21572
+ billingCountry: formData.billingCountry,
21573
+ // TODO: add these billing details back for Avalara and AFC taxation plugins.
21574
+ // billingState: formData.billingState,
21575
+ // billingCity: formData.billingCity,
21576
+ // billingZip: formData.billingZip,
21577
+ // billingStreet: formData.billingStreet,
21578
+ // taxNumber: formData.taxNumber,
21579
+ },
21580
+ });
21581
+ },
21582
+ onSuccess: (data) => {
21583
+ setAccountId(data.account.id);
21584
+ setPortalSessionToken(data.portalSessionToken);
21585
+ // We must invalidate the accountPaymentMethodsKey query in order to clear payment methods from the provided api token,
21586
+ // to instead use paymentMethods from portalSessionToken.
21587
+ queryClient.invalidateQueries({
21588
+ queryKey: common.QueryKeyFactory.default.accountPaymentMethodsKey({
21589
+ accountId,
21590
+ token,
21591
+ }),
21592
+ });
21593
+ setInitialQuote(data.quote);
21594
+ },
21595
+ onError: (error) => {
21596
+ const errorMessage = error.response.errors[0].message;
21597
+ if (errorMessage.includes("Address couldn't be validated")) {
21598
+ showErrorNotification$2('Please enter a valid billing address');
21599
+ }
21600
+ else {
21601
+ showErrorNotification$2(errorMessage);
21602
+ }
21603
+ },
21604
+ });
21605
+ // Queries
21606
+ const { data: priceListData, isLoading: isLoadingPriceList } = reactQuery.useQuery({
21607
+ queryKey: ['priceList', priceListCode],
21608
+ queryFn: () => getPriceList({ token, apiHost, code: priceListCode }),
21609
+ });
21610
+ const { data, isLoading: isLoadingQuote } = reactQuery.useQuery({
21611
+ queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
21612
+ queryFn: () => {
21613
+ if (!(initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id)) {
21614
+ throw new Error('Quote ID is required');
21615
+ }
21616
+ return getQuote$1({ token, apiHost, id: initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id });
21617
+ },
21618
+ enabled: !!(initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id),
21619
+ });
21620
+ const quote = readFragment(QuoteContext_QuoteFragment, data || initialQuote);
21621
+ const quoteChangeId = (_d = (_c = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a[((_b = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _b === void 0 ? void 0 : _b.length) - 1]) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : undefined;
21622
+ const { addCoupon, removeCoupon, isAddingCoupon, isRemovingCoupon, activeCouponsExist } = useUpdateCoupons({
21623
+ apiHost,
21624
+ token,
21625
+ quoteChangeId,
21626
+ onCouponAdded: () => {
21627
+ queryClient.invalidateQueries({
21628
+ queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
21629
+ });
21630
+ showSuccessNotification$1('Coupon applied');
21631
+ recalculateTaxes();
21632
+ setCouponEditorCouponCode('');
21633
+ },
21634
+ onCouponRemoved: () => {
21635
+ queryClient.invalidateQueries({
21636
+ queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
21637
+ });
21638
+ showSuccessNotification$1('Coupon removed');
21639
+ recalculateTaxes();
21640
+ },
21641
+ });
21642
+ // Handle default coupon application
21643
+ react.useEffect(() => {
21644
+ if (couponCode && quoteChangeId && defaultCouponAppliedRef.current !== couponCode) {
21645
+ addCoupon(couponCode);
21646
+ defaultCouponAppliedRef.current = couponCode;
21474
21647
  }
21475
- e.push(l);
21476
- break;
21477
-
21478
- default:
21479
- throw error("Document");
21480
- }
21648
+ }, [couponCode, quoteChangeId]);
21649
+ async function handleSubmit(formData) {
21650
+ quoteAccountSignupMutate(formData);
21481
21651
  }
21482
- } while (n < i.length);
21483
- return e;
21484
- }
21485
-
21486
- function parse(e, r) {
21487
- if (i = e.body ? e.body : e, n = 0, ignored(), r && r.noLocation) {
21488
- return {
21489
- kind: "Document",
21490
- definitions: definitions()
21491
- };
21492
- } else {
21493
- return {
21494
- kind: "Document",
21495
- definitions: definitions(),
21496
- loc: {
21497
- start: 0,
21498
- end: i.length,
21499
- startToken: void 0,
21500
- endToken: void 0,
21501
- source: {
21502
- body: i,
21503
- name: "graphql.web",
21504
- locationOffset: {
21505
- line: 1,
21506
- column: 1
21507
- }
21652
+ async function handlePaymentSuccess() {
21653
+ setPurchaseSucceeded(true);
21654
+ }
21655
+ async function accountSignupFunction(plugin) {
21656
+ var _a;
21657
+ if (!portalSessionToken) {
21658
+ throw new Error('Portal session token is required');
21508
21659
  }
21509
- }
21510
- };
21511
- }
21512
- }
21513
-
21514
- var a = 0;
21515
-
21516
- var e = new Set;
21517
-
21518
- function initGraphQLTada() {
21519
- function graphql(t, i) {
21520
- var o = parse(t).definitions;
21521
- var s = new Set;
21522
- for (var f of i || []) {
21523
- for (var u of f.definitions) {
21524
- if (u.kind === e$1.FRAGMENT_DEFINITION && !s.has(u)) {
21525
- o.push(u);
21526
- s.add(u);
21660
+ if (!accountId) {
21661
+ throw new Error('Account ID is required');
21527
21662
  }
21528
- }
21663
+ if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
21664
+ throw new Error('Plugin ID is required');
21665
+ }
21666
+ if (!(defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id)) {
21667
+ throw new Error('Payment method ID is required');
21668
+ }
21669
+ return await accountSignup({
21670
+ token: portalSessionToken,
21671
+ apiHost,
21672
+ quoteId: (_a = quote === null || quote === void 0 ? void 0 : quote.id) !== null && _a !== void 0 ? _a : undefined,
21673
+ paymentMethodId: defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.id,
21674
+ pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
21675
+ priceListCode: priceListCode,
21676
+ accountId,
21677
+ });
21529
21678
  }
21530
- var d;
21531
- if ((d = o[0].kind === e$1.FRAGMENT_DEFINITION) && o[0].directives) {
21532
- o[0].directives = o[0].directives.filter((r => "_unmask" !== r.name.value));
21679
+ function handlePaymentFail(error) {
21680
+ var _a;
21681
+ showErrorNotification$2((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.message);
21533
21682
  }
21534
- var c;
21535
- return {
21536
- kind: e$1.DOCUMENT,
21537
- definitions: o,
21538
- get loc() {
21539
- if (!c && d) {
21540
- var r = t + function concatLocSources(r) {
21541
- try {
21542
- a++;
21543
- var n = "";
21544
- for (var t of r) {
21545
- if (!e.has(t)) {
21546
- e.add(t);
21547
- var {loc: i} = t;
21548
- if (i) {
21549
- n += i.source.body;
21550
- }
21551
- }
21552
- }
21553
- return n;
21554
- } finally {
21555
- if (0 == --a) {
21556
- e.clear();
21557
- }
21558
- }
21559
- }(i || []);
21560
- return {
21561
- start: 0,
21562
- end: r.length,
21563
- source: {
21564
- body: r,
21565
- name: "GraphQLTada",
21566
- locationOffset: {
21567
- line: 1,
21568
- column: 1
21569
- }
21570
- }
21571
- };
21683
+ react.useEffect(() => {
21684
+ if (initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id) {
21685
+ recalculateTaxes();
21572
21686
  }
21573
- return c;
21574
- },
21575
- set loc(r) {
21576
- c = r;
21577
- }
21578
- };
21579
- }
21580
- graphql.scalar = function scalar(r, n) {
21581
- return n;
21582
- };
21583
- graphql.persisted = function persisted(n, a) {
21584
- return {
21585
- kind: e$1.DOCUMENT,
21586
- definitions: a ? a.definitions : [],
21587
- documentId: n
21588
- };
21589
- };
21590
- return graphql;
21591
- }
21592
-
21593
- function readFragment(...r) {
21594
- return 2 === r.length ? r[1] : r[0];
21687
+ }, [initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id]);
21688
+ if (purchaseSucceeded) {
21689
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsxRuntime.jsx("div", { className: "bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 bunny-flex bunny-items-start bunny-pt-[25vh]", children: jsxRuntime.jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "bunny-w-full", companyName: companyName, returnUrl: returnUrl, currencyId: quote === null || quote === void 0 ? void 0 : quote.currencyId }) })) : (jsxRuntime.jsx("div", { children: "No currency ID found from Quote" })) }));
21690
+ }
21691
+ return (jsxRuntime.jsxs("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-col' : 'bunny-flex-row'} bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ${shadow} ${className}`, style: style, children: [jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-center bunny-flex-col ${isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full'} bunny-justify-center`, children: jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24", children: [jsxRuntime.jsx("div", { children: topNavImageUrl.length > 0 && (jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsxRuntime.jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon, onRemoveCoupon: removeCoupon, isRemovingCoupon: isRemovingCoupon, priceListData: priceListData, isAddingCoupon: isAddingCoupon, couponCode: couponEditorCouponCode, setCouponCode: setCouponEditorCouponCode, activeCouponsExist: activeCouponsExist })) : (jsxRuntime.jsx("div", { className: "bunny-h-full", children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true })) : (jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData })) })), jsxRuntime.jsx(Footer, {})] }) }), jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col ${isMobile ? 'bunny-w-full bunny-h-1/2 bunny-overflow-auto' : 'bunny-w-1/2 bunny-h-full'} bunny-items-center`, style: {
21692
+ boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
21693
+ }, children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true, className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24` })) : (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24`, children: jsxRuntime.jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: isSigningUp || isLoadingQuote, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction, defaultValues: defaultValues }) })) })] }));
21595
21694
  }
21596
21695
 
21597
- var t = initGraphQLTada();
21598
-
21599
- const { Text: Text$i } = antd.Typography;
21696
+ const { Text: Text$l } = antd.Typography;
21600
21697
  const DrawerHeader = ({ description, onClose, title, closeButtonClassName, }) => {
21601
- return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-justify-between bunny-gap-2", children: [jsxRuntime.jsx(Text$i, { className: "bunny-text-xl bunny-font-normal", children: title }), onClose ? (jsxRuntime.jsx("button", { id: "closePayment", onClick: onClose, className: closeButtonClassName, children: jsxRuntime.jsx(icons.CloseOutlined, {}) })) : null] }), description && jsxRuntime.jsx("div", { className: "bunny-text-sm bunny-font-medium", children: description })] }));
21698
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-justify-between bunny-gap-2", children: [jsxRuntime.jsx(Text$l, { className: "bunny-text-xl bunny-font-normal", children: title }), onClose ? (jsxRuntime.jsx("button", { id: "closePayment", onClick: onClose, className: closeButtonClassName, children: jsxRuntime.jsx(icons.CloseOutlined, {}) })) : null] }), description && jsxRuntime.jsx("div", { className: "bunny-text-sm bunny-font-medium", children: description })] }));
21602
21699
  };
21603
21700
 
21604
21701
  const QUOTE_CHARGE_CREATE = `
@@ -22033,7 +22130,7 @@ const QuantityChangeGridRow_SubscriptionFragment = t(`
22033
22130
  CanShowQuantitiesInput_SubscriptionFragment,
22034
22131
  QuantityInput_SubscriptionFragment,
22035
22132
  ]);
22036
- const { Text: Text$h } = antd.Typography;
22133
+ const { Text: Text$k } = antd.Typography;
22037
22134
  const QuantityChangeGridRow = ({ chargeIndex, editingQuote, subscriptionIndex, setEditingQuoteData, subscription: maskedSubscription, subscriptionCharge: maskedSubscriptionCharge, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }) => {
22038
22135
  var _a, _b;
22039
22136
  const subscription = readFragment(QuantityChangeGridRow_SubscriptionFragment, maskedSubscription);
@@ -22041,11 +22138,11 @@ const QuantityChangeGridRow = ({ chargeIndex, editingQuote, subscriptionIndex, s
22041
22138
  if (!canShowQuantitiesInput({ charge, subscription }))
22042
22139
  return null;
22043
22140
  const { brandColor } = react.useContext(BrandContext);
22044
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx(Text$h, { className: "bunny-font-medium bunny-text-sm bunny-col-span-full", style: { color: brandColor }, children: (_a = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _a === void 0 ? void 0 : _a.name }), jsxRuntime.jsx(Text$h, { className: "bunny-text-sm", children: (_b = charge.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() })] }), jsxRuntime.jsx(Text$h, { className: "bunny-flex bunny-items-center bunny-justify-end bunny-font-medium bunny-text-sm bunny-text-gray-900", children: charge.quantity }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-justify-center bunny-items-end", children: [jsxRuntime.jsx(QuantityInput, { charge: charge, chargeIndex: chargeIndex, editingQuote: editingQuote, setEditingQuoteData: setEditingQuoteData, subscription: subscription, subscriptionIndex: subscriptionIndex, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }), jsxRuntime.jsx("div", {})] }), jsxRuntime.jsx(antd.Divider, { className: "bunny-col-span-full bunny-my-2" })] }));
22141
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx(Text$k, { className: "bunny-font-medium bunny-text-sm bunny-col-span-full", style: { color: brandColor }, children: (_a = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _a === void 0 ? void 0 : _a.name }), jsxRuntime.jsx(Text$k, { className: "bunny-text-sm", children: (_b = charge.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() })] }), jsxRuntime.jsx(Text$k, { className: "bunny-flex bunny-items-center bunny-justify-end bunny-font-medium bunny-text-sm bunny-text-gray-900", children: charge.quantity }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-justify-center bunny-items-end", children: [jsxRuntime.jsx(QuantityInput, { charge: charge, chargeIndex: chargeIndex, editingQuote: editingQuote, setEditingQuoteData: setEditingQuoteData, subscription: subscription, subscriptionIndex: subscriptionIndex, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }), jsxRuntime.jsx("div", {})] }), jsxRuntime.jsx(antd.Divider, { className: "bunny-col-span-full bunny-my-2" })] }));
22045
22142
  };
22046
22143
 
22047
- const { Text: Text$g } = antd.Typography;
22048
- const QuantityChangeGridTitle = ({ children, right }) => (jsxRuntime.jsx(Text$g, { className: `bunny-font-medium bunny-text-sm bunny-text-slate-600 ${right ? 'bunny-text-right' : 'bunny-text-left'}`, children: children }));
22144
+ const { Text: Text$j } = antd.Typography;
22145
+ const QuantityChangeGridTitle = ({ children, right }) => (jsxRuntime.jsx(Text$j, { className: `bunny-font-medium bunny-text-sm bunny-text-slate-600 ${right ? 'bunny-text-right' : 'bunny-text-left'}`, children: children }));
22049
22146
 
22050
22147
  const QuoteChangeSummarySection = ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, errorUpdatingQuantity, }) => {
22051
22148
  const { apiHost } = react.useContext(BunnyContext);
@@ -22068,10 +22165,8 @@ const QUANTITY_CHANGE_HEADER_TITLE = 'Update quantities';
22068
22165
  const QUANTITY_CHANGE_HEADER_DESCRIPTION = 'Adjust quantities below. The change will take effect immediately after checkout has been completed.';
22069
22166
  const QuantityDrawerDesktop_SubscriptionFragment = t(`
22070
22167
  fragment QuantityDrawerDesktop_SubscriptionFragment on Subscription {
22071
- state
22072
22168
  currentCharges {
22073
22169
  chargeType
22074
- trial
22075
22170
  ...QuantityChangeGridRow_SubscriptionChargeFragment
22076
22171
  }
22077
22172
  ...QuantityChangeGridRow_SubscriptionFragment
@@ -22116,11 +22211,8 @@ const QuantityChangeDrawerDesktop = ({ editingQuote, editingQuoteData, onClose,
22116
22211
  }, children: [jsxRuntime.jsx(QuantityChangeGridTitle, { children: " " }), jsxRuntime.jsx(QuantityChangeGridTitle, { right: true, children: "CURRENT QUANTITY" }), jsxRuntime.jsx(QuantityChangeGridTitle, { right: true, children: "NEW QUANTITY" }), jsxRuntime.jsx(antd.Divider, { className: "bunny-col-span-full", style: { marginBottom: '8px', marginTop: '20px' } }), subscriptions.map((maskedSubscription, index) => {
22117
22212
  var _a;
22118
22213
  const subscription = readFragment(QuantityDrawerDesktop_SubscriptionFragment, maskedSubscription);
22119
- const isTrial = (subscription === null || subscription === void 0 ? void 0 : subscription.state) === 'TRIAL';
22120
22214
  return (jsxRuntime.jsx("div", { className: "bunny-contents", children: (_a = subscription === null || subscription === void 0 ? void 0 : subscription.currentCharges) === null || _a === void 0 ? void 0 : _a.map((charge, chargeIndex) => {
22121
- if ((isTrial && !charge.trial) ||
22122
- (!isTrial && charge.trial) ||
22123
- charge.chargeType === 'USAGE')
22215
+ if (charge.chargeType === 'USAGE')
22124
22216
  return null;
22125
22217
  return (jsxRuntime.jsx(QuantityChangeGridRow, { chargeIndex: chargeIndex, editingQuote: editingQuote, setEditingQuoteData: setEditingQuoteData, subscription: subscription, subscriptionCharge: charge, subscriptionIndex: index, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }, chargeIndex));
22126
22218
  }) }, index));
@@ -22129,16 +22221,6 @@ const QuantityChangeDrawerDesktop = ({ editingQuote, editingQuoteData, onClose,
22129
22221
 
22130
22222
  const SubscriptionsContext = react.createContext({});
22131
22223
 
22132
- async function execute(query, config, variables) {
22133
- const response = await gqlRequest({
22134
- query: graphql.print(query),
22135
- vars: variables,
22136
- apiHost: config.apiHost,
22137
- token: config.token,
22138
- });
22139
- return response;
22140
- }
22141
-
22142
22224
  const MUTATION$2 = `{
22143
22225
  currentUser {
22144
22226
  taxationRequiredAccountFields
@@ -22164,9 +22246,21 @@ const useHasTaxPlugin = ({ apiHost, token, }) => {
22164
22246
  return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
22165
22247
  };
22166
22248
 
22249
+ var SubscriptionState;
22250
+ (function (SubscriptionState) {
22251
+ SubscriptionState["ACTIVE"] = "ACTIVE";
22252
+ SubscriptionState["TRIAL"] = "TRIAL";
22253
+ SubscriptionState["PENDING"] = "PENDING";
22254
+ SubscriptionState["EXPIRED"] = "EXPIRED";
22255
+ SubscriptionState["CANCELED"] = "CANCELED";
22256
+ SubscriptionState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
22257
+ })(SubscriptionState || (SubscriptionState = {}));
22258
+ var SubscriptionState$1 = SubscriptionState;
22259
+
22167
22260
  function shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) {
22168
- var _a;
22169
- const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === common.SubscriptionState.TRIAL;
22261
+ var _a, _b;
22262
+ const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$1.TRIAL ||
22263
+ ((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL_EXPIRED;
22170
22264
  function upgradingFromFree() {
22171
22265
  const totalPrice = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges.reduce((acc, charge) => acc + Number((charge === null || charge === void 0 ? void 0 : charge.discountedPrice) || 0), 0);
22172
22266
  return totalPrice === 0;
@@ -22440,15 +22534,16 @@ const QuantityDrawerContainer = ({ subscriptions, quantityDrawerOpen, setQuantit
22440
22534
  const [payModalVisible, setPayModalVisible] = react.useState(false);
22441
22535
  const [updatingChargeQuantityId, setUpdatingChargeQuantityId] = react.useState(undefined);
22442
22536
  // Quote query
22443
- const { data: quote } = reactQuery.useQuery({
22537
+ const { data } = reactQuery.useQuery({
22444
22538
  queryKey: common.QueryKeyFactory.default.createObjectKey({
22445
22539
  id: editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id,
22446
22540
  objectName: 'editingQuote',
22447
22541
  token,
22448
22542
  }),
22449
- queryFn: () => (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id) ? getQuote({ token, id: editingQuoteData.id, apiHost }) : undefined,
22543
+ queryFn: () => (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id) ? getQuote$1({ token, id: editingQuoteData.id, apiHost }) : undefined,
22450
22544
  enabled: Boolean(editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
22451
22545
  });
22546
+ const quote = data;
22452
22547
  // Handlers
22453
22548
  const onSuccess = () => {
22454
22549
  setQuantityDrawerOpen(false);
@@ -22471,6 +22566,7 @@ const QuantityDrawerContainer = ({ subscriptions, quantityDrawerOpen, setQuantit
22471
22566
  const handleDrawerClose = () => {
22472
22567
  if (updatingChargeQuantityId) {
22473
22568
  setUpdatingChargeQuantityId(undefined);
22569
+ setEditingQuoteData(undefined);
22474
22570
  }
22475
22571
  setQuantityDrawerOpen(false);
22476
22572
  };
@@ -22529,26 +22625,28 @@ const ErrorView = ({ children, message, }) => {
22529
22625
  return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-w-full", style: { marginTop: "80px" }, children: [jsxRuntime.jsx("div", { style: { fontSize: "32px" }, children: message }), children] }));
22530
22626
  };
22531
22627
 
22628
+ const graphql = initGraphQLTada();
22629
+
22532
22630
  const periodMonthsConverter = (period) => {
22533
22631
  if (period === 0)
22534
- return common.BillingPeriod.ONCE;
22632
+ return graphql.scalar('BillingPeriod', 'ONCE');
22535
22633
  else if (period === 1)
22536
- return common.BillingPeriod.MONTHLY;
22634
+ return graphql.scalar('BillingPeriod', 'MONTHLY');
22537
22635
  else if (period === 3)
22538
- return common.BillingPeriod.QUARTERLY;
22636
+ return graphql.scalar('BillingPeriod', 'QUARTERLY');
22539
22637
  else if (period === 6)
22540
- return common.BillingPeriod.SEMI_ANNUALLY;
22638
+ return graphql.scalar('BillingPeriod', 'SEMI_ANNUAL');
22541
22639
  else
22542
- return common.BillingPeriod.ANNUALLY;
22640
+ return graphql.scalar('BillingPeriod', 'ANNUAL');
22543
22641
  };
22544
22642
  const billingPeriodConverter = (period) => {
22545
- if (period === common.BillingPeriod.ONCE)
22643
+ if (period === graphql.scalar('BillingPeriod', 'ONCE'))
22546
22644
  return 0;
22547
- else if (period === common.BillingPeriod.MONTHLY)
22645
+ else if (period === graphql.scalar('BillingPeriod', 'MONTHLY'))
22548
22646
  return 1;
22549
- else if (period === common.BillingPeriod.QUARTERLY)
22647
+ else if (period === graphql.scalar('BillingPeriod', 'QUARTERLY'))
22550
22648
  return 3;
22551
- else if (period === common.BillingPeriod.SEMI_ANNUALLY)
22649
+ else if (period === graphql.scalar('BillingPeriod', 'SEMI_ANNUAL'))
22552
22650
  return 6;
22553
22651
  else
22554
22652
  return 12;
@@ -22635,6 +22733,24 @@ const getFeatureUsage = async ({ subscriptionChargeId, token, apiHost, }) => {
22635
22733
  throw new Error('No data found');
22636
22734
  };
22637
22735
 
22736
+ var utc$2 = {exports: {}};
22737
+
22738
+ var utc$1 = utc$2.exports;
22739
+
22740
+ var hasRequiredUtc;
22741
+
22742
+ function requireUtc () {
22743
+ if (hasRequiredUtc) return utc$2.exports;
22744
+ hasRequiredUtc = 1;
22745
+ (function (module, exports) {
22746
+ !function(t,i){module.exports=i();}(utc$1,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var r=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),r.call(this,t);};var o=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else o.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s;if(0===u)return this.utc(f);var r=this.clone();if(f)return r.$offset=u,r.$u=!1,r;var o=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return (r=this.local().add(u+o,t)).$offset=u,r.$x.$localOffset=o,r};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
22747
+ } (utc$2));
22748
+ return utc$2.exports;
22749
+ }
22750
+
22751
+ var utcExports = requireUtc();
22752
+ var utc = /*@__PURE__*/getDefaultExportFromCjs(utcExports);
22753
+
22638
22754
  const StyledModal = defaultStyled(antd.Modal) `
22639
22755
  z-index: 2000;
22640
22756
 
@@ -22667,170 +22783,375 @@ const HeaderModalWrapper = (props) => {
22667
22783
  };
22668
22784
 
22669
22785
  const { isPlural } = pkg;
22786
+ dayjs.extend(utc);
22670
22787
  const getDateFormat = (dataInterval) => {
22671
22788
  return dataInterval === common.DataInterval.DAILY
22672
- ? "MMM DD"
22789
+ ? 'MMM DD'
22673
22790
  : dataInterval === common.DataInterval.MONTHLY
22674
- ? "MMM"
22791
+ ? 'MMM'
22675
22792
  : dataInterval === common.DataInterval.QUARTERLY
22676
- ? "MMM"
22793
+ ? 'MMM'
22677
22794
  : dataInterval === common.DataInterval.SEMIANNUALLY
22678
- ? "MMM"
22679
- : "YYYY";
22795
+ ? 'MMM'
22796
+ : 'YYYY';
22680
22797
  };
22681
- const FeatureUsageGraph = ({ charge, featureUsage, }) => {
22798
+ const USAGE_ROW_HEIGHT = 20;
22799
+ const FeatureUsageGraph = ({ charge, featureUsage, useAreaChart = false, }) => {
22682
22800
  var _a;
22683
22801
  // State
22684
- const [isModalOpen, setIsModalOpen] = react.useState(false);
22685
- const dataFormat = getDateFormat(featureUsage.dataInterval);
22686
- const chargeFeatureName = ((_a = charge.feature) === null || _a === void 0 ? void 0 : _a.name) || "";
22802
+ const [open, setOpen] = react.useState(false);
22803
+ const chargeFeatureName = ((_a = charge.feature) === null || _a === void 0 ? void 0 : _a.name) || '';
22687
22804
  const featureName = isPlural(chargeFeatureName)
22688
22805
  ? chargeFeatureName
22689
22806
  : pkg(chargeFeatureName);
22690
- const basicViewData = featureUsage.data.map((data) => ({
22691
- label: dayjs(data.periodStart).format(dataFormat) +
22692
- " - " +
22693
- dayjs(data.periodEnd).format(dataFormat),
22694
- [featureName]: data.intervalsTotal,
22695
- }));
22696
- const detailedViewData = featureUsage.data.flatMap((data) => {
22697
- return data.intervals.map((interval) => ({
22698
- label: dayjs(interval.intervalStart).format(dataFormat),
22807
+ if (!featureUsage)
22808
+ return null;
22809
+ const dataFormat = getDateFormat(featureUsage.dataInterval);
22810
+ // Use individual intervals instead of grouped periods
22811
+ const basicViewData = featureUsage.data.flatMap(data => {
22812
+ return data.intervals.map(interval => ({
22813
+ label: dayjs.utc(interval.intervalStart).format(dataFormat),
22699
22814
  [featureName]: interval.intervalUsage,
22700
22815
  }));
22701
22816
  });
22702
- if (!basicViewData.some((d) => {
22817
+ const detailedViewData = basicViewData;
22818
+ if (!basicViewData.some(d => {
22703
22819
  const usage = d[featureName];
22704
- if (typeof usage === "number") {
22820
+ if (typeof usage === 'number') {
22705
22821
  return usage > 0;
22706
22822
  }
22707
22823
  return false;
22708
22824
  }))
22709
- return jsxRuntime.jsx("div", { children: "no usage" });
22710
- return (jsxRuntime.jsxs("div", { onClick: () => {
22711
- setIsModalOpen(true);
22712
- }, children: [jsxRuntime.jsx("div", { style: {
22713
- height: "36px",
22714
- }, children: jsxRuntime.jsx(FeatureBarChart, { data: basicViewData, featureName: featureName, height: 36, width: 120 }) }), jsxRuntime.jsx(HeaderModalWrapper, { footer: null, open: isModalOpen, onCancel: (e) => {
22715
- e.stopPropagation();
22716
- setIsModalOpen(false);
22717
- }, title: `Usage for period ${dayjs(charge.startDate).format("MMM DD, YYYY")} - ${dayjs(charge.endDate).format("MMM DD, YYYY")}`, children: jsxRuntime.jsx("div", { className: "bunny-py-4 bunny-px-6 bunny-overflow-visible", children: jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: 200, children: jsxRuntime.jsx(FeatureBarChart, { data: detailedViewData, displayXAxis: true, featureName: featureName }) }) }) })] }));
22825
+ return 'no usage';
22826
+ return (jsxRuntime.jsxs("div", { className: "bunny-cursor-pointer", onClick: e => {
22827
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
22828
+ }, children: [jsxRuntime.jsx("div", { onClick: () => setOpen(true), style: {
22829
+ height: USAGE_ROW_HEIGHT,
22830
+ }, children: jsxRuntime.jsx(FeatureBarChart, { data: basicViewData, featureName: featureName, height: USAGE_ROW_HEIGHT, width: 120, useAreaChart: useAreaChart }) }), jsxRuntime.jsx(HeaderModalWrapper, { footer: null, onCancel: () => {
22831
+ setOpen(false);
22832
+ }, open: open, title: `Usage for period ${dayjs.utc(charge.startDate).format('MMM DD, YYYY')} - ${dayjs
22833
+ .utc(charge.endDate)
22834
+ .format('MMM DD, YYYY')}`, children: jsxRuntime.jsx("div", { className: "bunny-py-4 bunny-px-6", onClick: e => e.stopPropagation(), children: jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: 200, children: jsxRuntime.jsx(FeatureBarChart, { data: detailedViewData, displayXAxis: true, featureName: featureName }) }) }) })] }));
22718
22835
  };
22719
- const FeatureBarChart = ({ data, displayXAxis, featureName, height, width, }) => {
22720
- // Context
22721
- const { brandColor } = react.useContext(BrandContext);
22722
- return (jsxRuntime.jsxs(StyledBarChart, { width: width, height: height, data: data, children: [jsxRuntime.jsx(recharts.XAxis, { className: "bunny-text-xs", dataKey: "label", ...(displayXAxis
22836
+ const FeatureBarChart = ({ data, displayXAxis, featureName, height, width, useAreaChart, }) => {
22837
+ const BLUE_300 = '#93c5fd';
22838
+ if (useAreaChart) {
22839
+ return (jsxRuntime.jsxs(StyledAreaChart, { data: data, height: height, style: { overflow: 'visible' }, width: width, margin: { top: 0, right: 0, left: 0, bottom: 0 }, children: [jsxRuntime.jsx(recharts.XAxis, { className: "bunny-text-xs", dataKey: "label", interval: "equidistantPreserveStart", axisLine: false, ...(displayXAxis
22840
+ ? {}
22841
+ : {
22842
+ tickFormatter: () => '',
22843
+ tickLine: false,
22844
+ }), style: {
22845
+ fill: common.SLATE_500,
22846
+ }, height: displayXAxis ? undefined : 1 }), jsxRuntime.jsx(recharts.Tooltip, { cursor: { fill: common.SLATE_200 }, ...(displayXAxis
22847
+ ? {}
22848
+ : {
22849
+ position: { y: -62 },
22850
+ }), wrapperStyle: { zIndex: 1000 }, content: ({ payload, label }) => {
22851
+ var _a, _b;
22852
+ const usage = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload[0]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toLocaleString();
22853
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-rounded bunny-bg-white bunny-p-2 bunny-shadow bunny-gap-1", children: [jsxRuntime.jsx("div", { className: "bunny-text-left bunny-text-sm bunny-font-medium", children: label }), jsxRuntime.jsxs("div", { className: "bunny-text-left bunny-flex bunny-items-center bunny-text-sm", children: [jsxRuntime.jsxs("span", { children: [featureName, ": "] }), jsxRuntime.jsxs("span", { children: ["\u00A0", usage] })] })] }));
22854
+ } }), jsxRuntime.jsx(recharts.Area, { type: "monotone", dataKey: featureName, stroke: BLUE_300, fill: BLUE_300, fillOpacity: 0.6 })] }));
22855
+ }
22856
+ return (jsxRuntime.jsxs(StyledBarChart, { data: data, height: height, style: { overflow: 'visible' }, width: width, margin: { top: 0, right: 0, left: 0, bottom: 0 }, children: [jsxRuntime.jsx(recharts.XAxis, { className: "bunny-text-xs", dataKey: "label", interval: "equidistantPreserveStart", ...(displayXAxis
22723
22857
  ? {}
22724
22858
  : {
22725
- tickFormatter: () => "",
22859
+ tickFormatter: () => '',
22726
22860
  tickLine: false,
22727
- }), height: displayXAxis ? undefined : 1, interval: "equidistantPreserveStart", style: {
22861
+ }), style: {
22728
22862
  fill: common.SLATE_500,
22729
- } }), jsxRuntime.jsx(recharts.Tooltip, { cursor: { fill: common.SLATE_200 }, ...(displayXAxis
22863
+ }, height: displayXAxis ? undefined : 1 }), jsxRuntime.jsx(recharts.Tooltip, { cursor: { fill: common.SLATE_200 }, ...(displayXAxis
22730
22864
  ? {}
22731
22865
  : {
22732
22866
  position: { y: -62 },
22733
- }) }), jsxRuntime.jsx(recharts.Bar, { dataKey: featureName, fill: brandColor, activeBar: jsxRuntime.jsx(recharts.Rectangle, { fill: brandColor }) })] }));
22867
+ }), wrapperStyle: { zIndex: 1000 }, content: ({ payload, label }) => {
22868
+ var _a, _b;
22869
+ const usage = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload[0]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toLocaleString();
22870
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-rounded bunny-bg-white bunny-p-2 bunny-shadow bunny-gap-1", children: [jsxRuntime.jsx("div", { className: "bunny-text-left bunny-text-sm bunny-font-medium", children: label }), jsxRuntime.jsxs("div", { className: "bunny-text-left bunny-flex bunny-items-center bunny-text-sm", children: [jsxRuntime.jsxs("span", { children: [featureName, ": "] }), jsxRuntime.jsxs("span", { children: ["\u00A0", usage] })] })] }));
22871
+ } }), jsxRuntime.jsx(recharts.Bar, { activeBar: jsxRuntime.jsx(recharts.Rectangle, { fill: BLUE_300 }), dataKey: featureName, fill: BLUE_300 })] }));
22872
+ };
22873
+ const StyledBarChart = defaultStyled(recharts.BarChart) `
22874
+ .recharts-surface {
22875
+ overflow: visible;
22876
+ outline: none;
22877
+ }
22878
+ `;
22879
+ const StyledAreaChart = defaultStyled(recharts.AreaChart) `
22880
+ .recharts-surface {
22881
+ overflow: visible;
22882
+ outline: none;
22883
+ }
22884
+ `;
22885
+
22886
+ function doesPriceListHaveFlatFeeCharges(priceList) {
22887
+ return priceList.charges.some(charge => charge.pricingModel === graphql.scalar('PricingModel', 'FLAT') &&
22888
+ charge.basePrice != undefined &&
22889
+ charge.basePrice > 0);
22890
+ }
22891
+
22892
+ function priceDescriptionString({ unitName, showPriceAsMonthly, periodMonths, priceListHasFlatFeeCharges, }) {
22893
+ return `Per ${unitName && !priceListHasFlatFeeCharges ? `${unitName.toLowerCase()} / ` : ''}${showPriceAsMonthly ? 'month' : common.PERIOD_LABELS[periodMonthsConverter(periodMonths)]}`;
22894
+ }
22895
+
22896
+ var localizedFormat$2 = {exports: {}};
22897
+
22898
+ var localizedFormat$1 = localizedFormat$2.exports;
22899
+
22900
+ var hasRequiredLocalizedFormat;
22901
+
22902
+ function requireLocalizedFormat () {
22903
+ if (hasRequiredLocalizedFormat) return localizedFormat$2.exports;
22904
+ hasRequiredLocalizedFormat = 1;
22905
+ (function (module, exports) {
22906
+ !function(e,t){module.exports=t();}(localizedFormat$1,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,o,n){var r=o.prototype,i=r.format;n.en.formats=e,r.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,n=function(t,o){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,o){return t||o.slice(1)}))}))}(t,void 0===o?{}:o);return i.call(this,n)};}}));
22907
+ } (localizedFormat$2));
22908
+ return localizedFormat$2.exports;
22909
+ }
22910
+
22911
+ var localizedFormatExports = requireLocalizedFormat();
22912
+ var localizedFormat = /*@__PURE__*/getDefaultExportFromCjs(localizedFormatExports);
22913
+
22914
+ dayjs.extend(localizedFormat);
22915
+ const formatCurrency = (value, currencyIsoCode, decimals = 2) => {
22916
+ if (value !== 0 && !value)
22917
+ return '';
22918
+ const currencyValue = typeof value === 'string' ? parseFloat(value) : value;
22919
+ if (isNaN(currencyValue))
22920
+ return value;
22921
+ const localeOptions = {
22922
+ minimumFractionDigits: decimals,
22923
+ maximumFractionDigits: decimals,
22924
+ };
22925
+ localeOptions.style = 'currency';
22926
+ localeOptions.currency = currencyIsoCode;
22927
+ return currencyValue.toLocaleString(navigator.language, localeOptions);
22928
+ };
22929
+
22930
+ const { Text: Text$i } = antd.Typography;
22931
+ const PriceTierPrice = ({ currencyId, priceDecimals, tier, }) => {
22932
+ return (jsxRuntime.jsx(Text$i, { className: "bunny-text-white", children: formatCurrency(tier.price, currencyId, priceDecimals) }));
22933
+ };
22934
+
22935
+ const { Text: Text$h } = antd.Typography;
22936
+ const PriceTierRow_PriceTierFragment = t(`
22937
+ fragment PriceTierRow_PriceTierFragment on PriceListChargeTier {
22938
+ starts
22939
+ }
22940
+ `);
22941
+ const PriceTierRow = ({ tier: maskedTier, nextTier: maskedNextTier, }) => {
22942
+ const tier = readFragment(PriceTierRow_PriceTierFragment, maskedTier);
22943
+ const nextTier = readFragment(PriceTierRow_PriceTierFragment, maskedNextTier);
22944
+ const text = (() => {
22945
+ if (nextTier === null || nextTier === void 0 ? void 0 : nextTier.starts) {
22946
+ return `${tier === null || tier === void 0 ? void 0 : tier.starts} - ${nextTier.starts - 1}`;
22947
+ }
22948
+ return `${tier === null || tier === void 0 ? void 0 : tier.starts}+`;
22949
+ })();
22950
+ return jsxRuntime.jsx(Text$h, { className: "bunny-text-white", children: text });
22951
+ };
22952
+
22953
+ const getPricingModelTitle = (pricingModel) => {
22954
+ switch (pricingModel) {
22955
+ case 'TIERED':
22956
+ return 'Tiered';
22957
+ case 'VOLUME':
22958
+ return 'Volume';
22959
+ case 'BANDS':
22960
+ return 'Bands';
22961
+ default:
22962
+ return '';
22963
+ }
22964
+ };
22965
+
22966
+ const getPricingModelDescription = (pricingModel) => {
22967
+ switch (pricingModel) {
22968
+ case 'TIERED':
22969
+ return 'units in each tier are priced separately.';
22970
+ case 'VOLUME':
22971
+ return 'the highest tier reached prices all units.';
22972
+ case 'BANDS':
22973
+ return 'the quantity indexes to a flat price.';
22974
+ default:
22975
+ return '';
22976
+ }
22977
+ };
22978
+
22979
+ const { Text: Text$g } = antd.Typography;
22980
+ const ChargePriceTiers_PriceListChargeFragment = t(`
22981
+ fragment ChargePriceTiers_PriceListChargeFragment on PriceListCharge {
22982
+ id
22983
+ name
22984
+ pricingModel
22985
+ priceDecimals
22986
+ priceListChargeTiers {
22987
+ starts
22988
+ price
22989
+ ...PriceTierRow_PriceTierFragment
22990
+ }
22991
+ }
22992
+ `, [PriceTierRow_PriceTierFragment]);
22993
+ const ChargePriceTiers = ({ charge: maskedCharge, currencyId, }) => {
22994
+ var _a;
22995
+ const charge = readFragment(ChargePriceTiers_PriceListChargeFragment, maskedCharge);
22996
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1 bunny-w-full", children: [jsxRuntime.jsx(Text$g, { className: "bunny-text-white bunny-font-bold", children: charge.name }), jsxRuntime.jsxs(Text$g, { className: "bunny-flex bunny-flex-row bunny-text-gray-400 bunny-text-xs/3", children: [getPricingModelTitle(charge.pricingModel), " pricing -", ' ', getPricingModelDescription(charge.pricingModel)] }), jsxRuntime.jsx("div", { style: {
22997
+ maxWidth: '150px',
22998
+ minWidth: '50%',
22999
+ gap: '0.1rem',
23000
+ flexDirection: 'column',
23001
+ display: 'flex',
23002
+ }, children: (_a = charge.priceListChargeTiers) === null || _a === void 0 ? void 0 : _a.map((tier, index) => {
23003
+ var _a, _b, _c;
23004
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-justify-between bunny-w-full", children: [jsxRuntime.jsx(PriceTierRow, { tier: tier, nextTier: (_b = (_a = charge.priceListChargeTiers) === null || _a === void 0 ? void 0 : _a[index + 1]) !== null && _b !== void 0 ? _b : null }), jsxRuntime.jsx(PriceTierPrice, { currencyId: currencyId, priceDecimals: (_c = charge.priceDecimals) !== null && _c !== void 0 ? _c : 0, tier: tier })] }, tier.starts));
23005
+ }) })] }));
23006
+ };
23007
+
23008
+ const TOOLTIP_BG_COLOR = '#2F353B';
23009
+
23010
+ // a pricelist has price tiers if any of its charges have > 1 price tier
23011
+ const priceListHasPriceTiers = (priceList) => {
23012
+ var _a;
23013
+ return (_a = priceList.charges) === null || _a === void 0 ? void 0 : _a.some(chargeHasPriceTiers);
23014
+ };
23015
+ const chargeHasPriceTiers = (charge) => {
23016
+ var _a;
23017
+ return ((_a = charge.priceListChargeTiers) === null || _a === void 0 ? void 0 : _a.length) && charge.priceListChargeTiers.length > 1;
23018
+ };
23019
+
23020
+ const getFirstTierPrice = (charge, currencyId) => {
23021
+ var _a, _b, _c;
23022
+ const price = (_b = (_a = charge.priceListChargeTiers) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.price;
23023
+ if (!price)
23024
+ return '';
23025
+ return formatCurrency(price, currencyId, (_c = charge.priceDecimals) !== null && _c !== void 0 ? _c : 0);
23026
+ };
23027
+
23028
+ const PricingTooltip_PriceListChargeFragment = t(`
23029
+ fragment PricingTooltip_PriceListChargeFragment on PriceListCharge {
23030
+ priceListChargeTiers {
23031
+ starts
23032
+ price
23033
+ }
23034
+ pricingModel
23035
+ feature {
23036
+ unitName
23037
+ }
23038
+ priceDecimals
23039
+ name
23040
+ ...ChargePriceTiers_PriceListChargeFragment
23041
+ }
23042
+ `, [ChargePriceTiers_PriceListChargeFragment]);
23043
+ const PricingTooltip = ({ className, priceListCharges: maskedPriceListCharges, currencyId, priceList, }) => {
23044
+ const priceListCharges = maskedPriceListCharges.map(charge => readFragment(PricingTooltip_PriceListChargeFragment, charge));
23045
+ const content = react.useMemo(() => {
23046
+ return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3 bunny-p-2", children: priceListCharges === null || priceListCharges === void 0 ? void 0 : priceListCharges.map((charge, index) => {
23047
+ var _a, _b;
23048
+ const hasPriceTiers = chargeHasPriceTiers(charge);
23049
+ if (hasPriceTiers) {
23050
+ return jsxRuntime.jsx(ChargePriceTiers, { charge: charge, currencyId: currencyId }, index);
23051
+ }
23052
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx("div", { className: "bunny-text-white bunny-font-bold", children: charge.name }), jsxRuntime.jsxs("div", { className: "bunny-text-gray-400 bunny-text-xs/3", children: [getFirstTierPrice(charge, currencyId), ' ', priceDescriptionString({
23053
+ unitName: (_b = (_a = charge.feature) === null || _a === void 0 ? void 0 : _a.unitName) !== null && _b !== void 0 ? _b : undefined,
23054
+ showPriceAsMonthly: priceList === null || priceList === void 0 ? void 0 : priceList.showPriceAsMonthly,
23055
+ periodMonths: priceList === null || priceList === void 0 ? void 0 : priceList.periodMonths,
23056
+ priceListHasFlatFeeCharges: doesPriceListHaveFlatFeeCharges(priceList),
23057
+ })] })] }));
23058
+ }) }));
23059
+ }, [priceListCharges, currencyId]);
23060
+ return (jsxRuntime.jsx(antd.Tooltip, { className: `bunny-text-gray-400 bunny-text-sm ${className}`, title: content, color: TOOLTIP_BG_COLOR, children: jsxRuntime.jsx(icons.InfoCircleOutlined, { className: "bunny-text-gray-400 ", size: 15 }) }));
22734
23061
  };
22735
- const StyledBarChart = defaultStyled(recharts.BarChart) `
22736
- .recharts-surface {
22737
- overflow: visible;
22738
- }
22739
- `;
22740
23062
 
22741
23063
  // WARNING: There is a preview button on APP that will need to be changed if this query is changed
22742
- const PRICE_LIST_CHANGE_OPTIONS_QUERY = `
22743
- query priceListChangeOptions($subscriptionId: ID, $productId: ID) {
22744
- priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {
22745
- products {
22746
- everythingInPlus
22747
- id
22748
- name
22749
- plansToDisplay
22750
- features(sort: "position asc") {
22751
- description
23064
+ const PRICE_LIST_CHANGE_OPTIONS_QUERY = t(`
23065
+ query priceListChangeOptions($subscriptionId: ID, $productId: ID) {
23066
+ priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {
23067
+ products {
23068
+ everythingInPlus
22752
23069
  id
22753
- isVisible
22754
- kind
22755
23070
  name
22756
- position
23071
+ plansToDisplay
23072
+ features(sort: "position asc") {
23073
+ description
23074
+ id
23075
+ isVisible
23076
+ kind
23077
+ name
23078
+ position
23079
+ }
22757
23080
  }
22758
- }
22759
- priceLists {
22760
- showPriceAsMonthly
22761
- basePrice
22762
- currencyId
22763
- id
22764
- monthlyBasePrice
22765
- periodMonths
22766
- plan {
22767
- code
22768
- contactUsLabel
22769
- contactUsUrl
22770
- description
23081
+ priceLists {
23082
+ showPriceAsMonthly
23083
+ basePrice
23084
+ currencyId
22771
23085
  id
22772
- name
22773
- position
22774
- pricingDescription
22775
- pricingStyle
22776
- addon
22777
- planFeatures {
22778
- featureId
22779
- value
22780
- feature {
22781
- name
22782
- }
22783
- }
22784
- addonPlans {
23086
+ monthlyBasePrice
23087
+ periodMonths
23088
+ plan {
23089
+ code
23090
+ contactUsLabel
23091
+ contactUsUrl
23092
+ description
22785
23093
  id
22786
- priceLists {
23094
+ name
23095
+ position
23096
+ pricingDescription
23097
+ pricingStyle
23098
+ addon
23099
+ planFeatures {
23100
+ featureId
23101
+ value
23102
+ feature {
23103
+ name
23104
+ }
23105
+ }
23106
+ addonPlans {
22787
23107
  id
22788
- periodMonths
22789
- isVisible
23108
+ priceLists {
23109
+ id
23110
+ periodMonths
23111
+ isVisible
23112
+ }
22790
23113
  }
22791
23114
  }
22792
- }
22793
- product {
22794
- id
22795
- }
22796
- charges {
22797
- featureAddon
22798
- basePrice
22799
- billingPeriod
22800
- chargeType
22801
- id
22802
- name
22803
- priceDecimals
22804
- pricingModel
22805
- quantityMax
22806
- quantityMin
22807
- selfServiceQuantity
22808
- priceList {
23115
+ product {
22809
23116
  id
22810
23117
  }
22811
- feature {
22812
- name
22813
- unitName
23118
+ charges {
23119
+ priceListChargeTiers {
23120
+ starts
23121
+ price
23122
+ }
23123
+ featureAddon
23124
+ basePrice
23125
+ billingPeriod
23126
+ chargeType
22814
23127
  id
23128
+ name
23129
+ priceDecimals
23130
+ pricingModel
23131
+ quantityMax
23132
+ quantityMin
23133
+ selfServiceQuantity
23134
+ priceList {
23135
+ id
23136
+ }
23137
+ feature {
23138
+ name
23139
+ unitName
23140
+ id
23141
+ }
23142
+ ...PricingTooltip_PriceListChargeFragment
22815
23143
  }
22816
23144
  }
22817
23145
  }
22818
23146
  }
22819
- }`;
23147
+ `, [PricingTooltip_PriceListChargeFragment]);
22820
23148
  const getPriceListChangeOptions = async ({ apiHost, isInPreviewMode, productId, token, upgradingSubscription, }) => {
22821
- const response = await gqlRequest({
22822
- isInPreviewMode,
22823
- query: PRICE_LIST_CHANGE_OPTIONS_QUERY,
22824
- vars: { subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id, productId },
22825
- token,
22826
- apiHost,
22827
- });
23149
+ const tokenToPass = isInPreviewMode ? undefined : token; // Do not pass token if in preview mode
23150
+ const response = await execute(PRICE_LIST_CHANGE_OPTIONS_QUERY, { apiHost, token: tokenToPass }, { subscriptionId: upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.id, productId });
22828
23151
  const { priceListChangeOptions } = response;
22829
- if (priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.errors)
22830
- throw priceListChangeOptions.errors;
22831
23152
  // Sort planChangeOptions.plans by position
22832
23153
  if (priceListChangeOptions === null || priceListChangeOptions === void 0 ? void 0 : priceListChangeOptions.priceLists) {
22833
- priceListChangeOptions.priceLists.sort((a, b) => a.plan.position - b.plan.position);
23154
+ priceListChangeOptions.priceLists.sort((a, b) => { var _a, _b, _c, _d; return ((_b = (_a = a.plan) === null || _a === void 0 ? void 0 : _a.position) !== null && _b !== void 0 ? _b : 0) - ((_d = (_c = b.plan) === null || _c === void 0 ? void 0 : _c.position) !== null && _d !== void 0 ? _d : 0); });
22834
23155
  }
22835
23156
  return priceListChangeOptions;
22836
23157
  };
@@ -22886,47 +23207,6 @@ const hasPriceTiers = (charge) => {
22886
23207
  var _a;
22887
23208
  return Boolean((_a = charge === null || charge === void 0 ? void 0 : charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length);
22888
23209
  };
22889
- const hasMultiplePriceTiers = (charge) => {
22890
- var _a;
22891
- return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length) > 1;
22892
- };
22893
- const getApplicablePriceTier = (charge, currencyId, priceDecimals) => {
22894
- var _a;
22895
- if (!((_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length))
22896
- return '';
22897
- let selectedTier;
22898
- // For TIERED pricing model: always show the first tier
22899
- if (charge.pricingModel === common.PricingModel.TIERED) {
22900
- selectedTier = charge.priceTiers[0];
22901
- }
22902
- // For VOLUME and BANDS pricing models: find the tier that contains the current quantity
22903
- else if (charge.pricingModel === common.PricingModel.VOLUME ||
22904
- charge.pricingModel === common.PricingModel.BANDS) {
22905
- // Find the appropriate tier based on quantity
22906
- selectedTier = charge.priceTiers.find((tier, index) => {
22907
- const nextTier = charge.priceTiers[index + 1];
22908
- const tierStart = tier.starts;
22909
- const tierEnd = nextTier ? nextTier.starts - 1 : Infinity;
22910
- return charge.quantity >= tierStart && charge.quantity <= tierEnd;
22911
- });
22912
- // Fallback to first tier if no tier found (shouldn't happen with proper data)
22913
- selectedTier = selectedTier || charge.priceTiers[0];
22914
- }
22915
- // Default fallback for any other pricing models
22916
- else {
22917
- selectedTier = charge.priceTiers[0];
22918
- }
22919
- if (!selectedTier)
22920
- return '';
22921
- // Calculate the tier range for display
22922
- const tierIndex = charge.priceTiers.indexOf(selectedTier);
22923
- const starts = selectedTier.starts;
22924
- const nextTier = charge.priceTiers[tierIndex + 1];
22925
- const ends = nextTier ? nextTier.starts - 1 : '∞';
22926
- return hasMultiplePriceTiers(charge)
22927
- ? `${starts}-${ends}: ${common.formatCurrency(selectedTier.price, currencyId, priceDecimals)}`
22928
- : `${common.formatCurrency(selectedTier.price, currencyId, priceDecimals)}`;
22929
- };
22930
23210
 
22931
23211
  const SubscriptionCardActions = ({ onChangePlanClick, onCancelSubscriptionClick, priceListChangeOptions, subscription, isPaymentMethodLoading, }) => {
22932
23212
  var _a;
@@ -23061,23 +23341,21 @@ const StyledTable = styled(antd.Table) `
23061
23341
  border-bottom: none !important;
23062
23342
  }
23063
23343
  `;
23064
- const TieredDisplayDropdown = ({ charge, currencyId, truncatedText, }) => {
23065
- var _a;
23066
- const onlyHasOneTier = ((_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length) === 1;
23344
+ const TieredDisplayDropdown = ({ priceTiers, currencyId, priceDecimals, truncatedText, }) => {
23345
+ const onlyHasOneTier = (priceTiers === null || priceTiers === void 0 ? void 0 : priceTiers.length) === 1;
23067
23346
  const dropdownTrigger = (jsxRuntime.jsx("div", { className: `w-full ${onlyHasOneTier ? '' : 'underline cursor-pointer'}`, children: truncatedText }));
23068
23347
  if (onlyHasOneTier) {
23069
23348
  return dropdownTrigger;
23070
23349
  }
23071
- return (jsxRuntime.jsx(antd.Dropdown, { dropdownRender: () => {
23350
+ return (jsxRuntime.jsx(antd.Dropdown, { popupRender: () => {
23072
23351
  return (jsxRuntime.jsx("div", { className: "rounded border border-solid border-slate-200 bg-white overflow-hidden", children: jsxRuntime.jsx(StyledTable, { columns: [
23073
23352
  {
23074
23353
  dataIndex: 'starts',
23075
23354
  title: 'From # of units',
23076
23355
  align: 'right',
23077
23356
  render: (_, record, index) => {
23078
- var _a;
23079
23357
  record = record;
23080
- const nextRecord = (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a[index + 1];
23358
+ const nextRecord = priceTiers === null || priceTiers === void 0 ? void 0 : priceTiers[index + 1];
23081
23359
  const starts = record.starts;
23082
23360
  const ends = (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord.starts) ? nextRecord.starts - 1 : '∞';
23083
23361
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [formatNumber(starts, 0), " -", ' ', typeof ends === 'number' ? formatNumber(ends, 0) : '∞'] }));
@@ -23088,19 +23366,61 @@ const TieredDisplayDropdown = ({ charge, currencyId, truncatedText, }) => {
23088
23366
  title: 'Unit price',
23089
23367
  align: 'right',
23090
23368
  render: value => {
23091
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: common.formatCurrency(value, currencyId, charge.priceDecimals) });
23369
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: common.formatCurrency(value, currencyId, priceDecimals) });
23092
23370
  },
23093
23371
  },
23094
- ], dataSource: charge.priceTiers, pagination: false, size: "small" }) }));
23372
+ ], dataSource: priceTiers, rowKey: "starts", pagination: false, size: "small" }) }));
23095
23373
  }, children: dropdownTrigger }));
23096
23374
  };
23097
23375
 
23376
+ // Charge type is general so both subscription charges and quote charges can use this function
23377
+ // TODO: refactor this function. It should have a clear return type and be more readable.
23378
+ // Note: cases of 'variable ?? 0' comes from transition to gql.tada. Probably need to handle that better.
23379
+ const getApplicablePriceTier = (charge, currencyId, priceDecimals) => {
23380
+ var _a, _b, _c, _d, _e;
23381
+ if (!((_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length))
23382
+ return '';
23383
+ let selectedTier;
23384
+ // For TIERED pricing model: always show the first tier
23385
+ if (charge.pricingModel === 'TIERED') {
23386
+ selectedTier = charge.priceTiers[0];
23387
+ }
23388
+ // For VOLUME and BANDS pricing models: find the tier that contains the current quantity
23389
+ else if (charge.pricingModel === 'VOLUME' || charge.pricingModel === 'BANDS') {
23390
+ // Find the appropriate tier based on quantity
23391
+ selectedTier = charge.priceTiers.find((tier, index) => {
23392
+ var _a, _b, _c, _d;
23393
+ const nextTier = (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a[index + 1];
23394
+ const tierStart = tier.starts;
23395
+ const tierEnd = nextTier ? ((_b = nextTier.starts) !== null && _b !== void 0 ? _b : 0) - 1 : Infinity;
23396
+ return ((_c = charge.quantity) !== null && _c !== void 0 ? _c : 0) >= (tierStart !== null && tierStart !== void 0 ? tierStart : 0) && ((_d = charge.quantity) !== null && _d !== void 0 ? _d : 0) <= tierEnd;
23397
+ });
23398
+ // Fallback to first tier if no tier found (shouldn't happen with proper data)
23399
+ selectedTier = selectedTier || charge.priceTiers[0];
23400
+ }
23401
+ // Default fallback for any other pricing models
23402
+ else {
23403
+ selectedTier = charge.priceTiers[0];
23404
+ }
23405
+ if (!selectedTier)
23406
+ return '';
23407
+ // Calculate the tier range for display
23408
+ const tierIndex = charge.priceTiers.indexOf(selectedTier);
23409
+ const starts = selectedTier.starts;
23410
+ const nextTier = charge.priceTiers[tierIndex + 1];
23411
+ const ends = nextTier ? ((_b = nextTier.starts) !== null && _b !== void 0 ? _b : 0) - 1 : '∞';
23412
+ const hasMultiplePriceTiers = ((_c = charge === null || charge === void 0 ? void 0 : charge.priceTiers) === null || _c === void 0 ? void 0 : _c.length) > 1;
23413
+ return hasMultiplePriceTiers
23414
+ ? `${starts}-${ends}: ${common.formatCurrency((_d = selectedTier.price) !== null && _d !== void 0 ? _d : 0, currencyId, priceDecimals)}`
23415
+ : `${common.formatCurrency((_e = selectedTier.price) !== null && _e !== void 0 ? _e : 0, currencyId, priceDecimals)}`;
23416
+ };
23417
+
23098
23418
  const SubscriptionChargeUnitPrice = ({ charge, currencyId, }) => {
23099
23419
  const price = charge.trial
23100
23420
  ? '-'
23101
23421
  : common.formatCurrency(charge.discountedPrice, currencyId, charge.priceDecimals);
23102
23422
  const isChargeDiscount = isDiscount(charge.kind);
23103
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasPriceTiers(charge) ? (jsxRuntime.jsx(TieredDisplayDropdown, { charge: charge, currencyId: currencyId, truncatedText: `${charge.kind === common.QuoteChangeKind.PRICE_UPDATE ? 'new ' : ''}${getApplicablePriceTier(charge, currencyId, charge.priceDecimals)}` })) : isChargeDiscount ? (`-${price}`) : (price) }));
23423
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasPriceTiers(charge) ? (jsxRuntime.jsx(TieredDisplayDropdown, { priceTiers: charge.priceTiers, currencyId: currencyId, priceDecimals: charge.priceDecimals, truncatedText: `${charge.kind === common.QuoteChangeKind.PRICE_UPDATE ? 'new ' : ''}${getApplicablePriceTier(charge, currencyId, charge.priceDecimals)}` })) : isChargeDiscount ? (`-${price}`) : (price) }));
23104
23424
  };
23105
23425
 
23106
23426
  const { Text: Text$e } = antd.Typography;
@@ -23213,7 +23533,7 @@ const SubscriptionCardDesktopRow = ({ charge, chargeIndex, subscription, }) => {
23213
23533
  return (jsxRuntime.jsxs("div", { className: "bunny-contents", children: [(isRampFirstRow || !isRamp) && (jsxRuntime.jsx(SubscriptionsListCell, { gridColumn: isRamp ? '1/-1' : '1', children: jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-center bunny-gap-2 ${isDiscount ? 'bunny-pl-4' : ''}`, children: jsxRuntime.jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName) ? charge.name : '' }) }) })), jsxRuntime.jsx(SubscriptionsListCell, { gridColumn: 2, children: jsxRuntime.jsx("div", { children: chargePeriod }) }), jsxRuntime.jsx(SubscriptionsListCell, { right: true, children: charge.kind === common.QuoteChangeKind.DISCOUNT
23214
23534
  ? ''
23215
23535
  : charge.chargeType === common.ChargeType.USAGE
23216
- ? data && jsxRuntime.jsx(FeatureUsageGraph, { charge: charge, featureUsage: data })
23536
+ ? data && jsxRuntime.jsx(FeatureUsageGraph, { charge: charge, featureUsage: data, useAreaChart: true })
23217
23537
  : charge.isAmendment
23218
23538
  ? `+${(_b = charge.quantity) === null || _b === void 0 ? void 0 : _b.toLocaleString()}`
23219
23539
  : (_c = charge.quantity) === null || _c === void 0 ? void 0 : _c.toLocaleString() }), jsxRuntime.jsx(SubscriptionsListCell, { right: true, children: jsxRuntime.jsx(SubscriptionChargeUnitPrice, { charge: charge, currencyId: subscription.currencyId }) }), jsxRuntime.jsx(SubscriptionsListCell, { right: true, children: jsxRuntime.jsx(SubscriptionChargeTotal, { charge: charge, subscription: subscription }) })] }));
@@ -23296,6 +23616,28 @@ const SubscriptionsListContainer = ({ companyName, showInactive = false, onCance
23296
23616
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.length) > 0 ? (jsxRuntime.jsx("div", { className: `bunny-flex bunny-flex-col bunny-gap-${gap} bunny-shrink`, children: jsxRuntime.jsx(SubscriptionsList, { showInactive: showInactive, onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, subscriptions: subscriptions }) })) : (noSubscriptionsComponent || (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-items-center bunny-w-full", children: jsxRuntime.jsx(ErrorView, { message: `You have no subscriptions with ${companyName} yet` }) }))) }));
23297
23617
  };
23298
23618
 
23619
+ const QuoteContext = react.createContext({});
23620
+
23621
+ const FormattedQuoteFields_QuoteFragment = t(`
23622
+ fragment FormattedQuoteFields_QuoteFragment on Quote {
23623
+ formattedQuote {
23624
+ html
23625
+ }
23626
+ }
23627
+ `);
23628
+ const query = t(`
23629
+ query quote($id: ID, $includeHtmlField: Boolean!) {
23630
+ quote(id: $id) {
23631
+ ...FormattedQuoteFields_QuoteFragment @include(if: $includeHtmlField)
23632
+ ...QuoteContext_QuoteFragment
23633
+ }
23634
+ }
23635
+ `, [FormattedQuoteFields_QuoteFragment, QuoteContext_QuoteFragment]);
23636
+ const getQuote = async ({ id, token, apiHost, includeHtmlField = false, }) => {
23637
+ const response = await execute(query, { apiHost, token }, { id, includeHtmlField });
23638
+ return response === null || response === void 0 ? void 0 : response.quote;
23639
+ };
23640
+
23299
23641
  const useQuoteCreate = ({ upgradingSubscription, selectedPriceList, token, }) => {
23300
23642
  // Context
23301
23643
  const { apiHost } = react.useContext(BunnyContext);
@@ -23316,7 +23658,7 @@ const useQuoteCreate = ({ upgradingSubscription, selectedPriceList, token, }) =>
23316
23658
  id: quoteId,
23317
23659
  token,
23318
23660
  apiHost,
23319
- removeFormattedQuoteField: false,
23661
+ includeHtmlField: true,
23320
23662
  });
23321
23663
  return quote;
23322
23664
  },
@@ -23386,6 +23728,14 @@ const useQuoteCreate = ({ upgradingSubscription, selectedPriceList, token, }) =>
23386
23728
  };
23387
23729
  };
23388
23730
 
23731
+ function canEditChargeQuantity(charge) {
23732
+ if (charge.chargeType === common.ChargeType.USAGE)
23733
+ return false;
23734
+ if (charge.pricingModel === common.PricingModel.FLAT)
23735
+ return false;
23736
+ return true;
23737
+ }
23738
+
23389
23739
  const calculateNewQuantity = (priceListCharge, currentQuantity = 1) => {
23390
23740
  const quantityMax = (priceListCharge === null || priceListCharge === void 0 ? void 0 : priceListCharge.quantityMax) || Number.POSITIVE_INFINITY;
23391
23741
  const quantityMin = (priceListCharge === null || priceListCharge === void 0 ? void 0 : priceListCharge.quantityMin) || Number.NEGATIVE_INFINITY;
@@ -23397,70 +23747,61 @@ const calculateNewQuantity = (priceListCharge, currentQuantity = 1) => {
23397
23747
  return quantityMin;
23398
23748
  };
23399
23749
 
23400
- const QUOTE_CHARGE_UPDATE = `
23401
- ${QUOTE_FIELDS()}
23402
- mutation QuoteChargeUpdate (
23403
- $discount: Float,
23404
- $endDate: ISO8601Date,
23405
- $name: String,
23406
- $price: Float,
23407
- $quantity: Int,
23408
- $quoteChargeId: ID!
23409
- $startDate: ISO8601Date
23410
- $subtotal: Float,
23411
- ) {
23412
- quoteChargeUpdate(
23413
- discount: $discount
23414
- endDate: $endDate
23415
- name: $name
23416
- price: $price
23417
- quantity: $quantity
23418
- quoteChargeId: $quoteChargeId
23419
- startDate: $startDate
23420
- subtotal: $subtotal
23750
+ const mutation$1 = t(`
23751
+ mutation QuoteChargeUpdate(
23752
+ $discount: Float
23753
+ $endDate: ISO8601Date
23754
+ $name: String
23755
+ $price: Float
23756
+ $quantity: Int
23757
+ $quoteChargeId: ID!
23758
+ $startDate: ISO8601Date
23759
+ $subtotal: Float
23421
23760
  ) {
23422
- quoteCharge {
23423
- quoteChange {
23424
- id
23425
- quoteId
23426
- quote {
23427
- ...QuoteFields
23761
+ quoteChargeUpdate(
23762
+ discount: $discount
23763
+ endDate: $endDate
23764
+ name: $name
23765
+ price: $price
23766
+ quantity: $quantity
23767
+ quoteChargeId: $quoteChargeId
23768
+ startDate: $startDate
23769
+ subtotal: $subtotal
23770
+ ) {
23771
+ quoteCharge {
23772
+ quoteChange {
23773
+ id
23774
+ quoteId
23775
+ quote {
23776
+ ...QuoteContext_QuoteFragment
23777
+ }
23428
23778
  }
23779
+ id
23429
23780
  }
23430
- id
23781
+ errors
23431
23782
  }
23432
23783
  }
23433
- }
23434
- `;
23784
+ `, [QuoteContext_QuoteFragment]);
23435
23785
  const quoteChargeUpdate = async ({ discount, name, price, quantity, quoteChargeId, startDate, subtotal, apiHost, token, }) => {
23436
- const response = await gqlRequest({
23437
- query: QUOTE_CHARGE_UPDATE,
23438
- vars: {
23439
- subtotal,
23440
- discount,
23441
- name,
23442
- price,
23443
- quantity,
23444
- quoteChargeId,
23445
- startDate,
23446
- },
23786
+ var _a, _b;
23787
+ const response = await execute(mutation$1, {
23447
23788
  apiHost,
23448
23789
  token,
23790
+ }, {
23791
+ subtotal,
23792
+ discount,
23793
+ name,
23794
+ price,
23795
+ quantity,
23796
+ quoteChargeId,
23797
+ startDate,
23449
23798
  });
23450
- if (response.errors) {
23451
- throw new Error(response.errors[0].message);
23799
+ if ((_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
23800
+ throw new Error(response.quoteChargeUpdate.errors[0]);
23452
23801
  }
23453
- return response.quoteChargeUpdate.quoteCharge;
23802
+ return (_b = response.quoteChargeUpdate) === null || _b === void 0 ? void 0 : _b.quoteCharge;
23454
23803
  };
23455
23804
 
23456
- function canEditChargeQuantity(charge) {
23457
- if (charge.chargeType === common.ChargeType.USAGE)
23458
- return false;
23459
- if (charge.pricingModel === common.PricingModel.FLAT)
23460
- return false;
23461
- return true;
23462
- }
23463
-
23464
23805
  // Functionality:
23465
23806
  // 1: keep track of quantities set for features based on feature.id
23466
23807
  // a. copy those quantities over to charges with same feature when initializing
@@ -23478,24 +23819,25 @@ const useQuoteQuantities = ({ selectedPriceList, quote, }) => {
23478
23819
  const { getFeatureQuantity, setFeatureQuantity } = useFeatureQuantities();
23479
23820
  const { mutate: updateCharge, isPending: isUpdatingCharge } = reactQuery.useMutation({
23480
23821
  mutationFn: async ({ quoteChargeId, quantity, apiHost, token, }) => {
23481
- const quoteCharge = await quoteChargeUpdate({
23822
+ return await quoteChargeUpdate({
23482
23823
  quoteChargeId,
23483
23824
  quantity,
23484
23825
  apiHost,
23485
23826
  token,
23486
23827
  });
23487
- return { quoteCharge };
23488
23828
  },
23489
- onSuccess: ({ quoteCharge }) => {
23829
+ onSuccess: quoteCharge => {
23830
+ var _a;
23490
23831
  queryClient.setQueryData(common.QueryKeyFactory.default.createObjectKey({
23491
23832
  objectName: 'editingQuote',
23492
- id: quote === null || quote === void 0 ? void 0 : quote.id,
23833
+ id: (_a = quote === null || quote === void 0 ? void 0 : quote.id) !== null && _a !== void 0 ? _a : undefined,
23493
23834
  token,
23494
- }), quoteCharge.quoteChange.quote);
23835
+ }), quoteCharge === null || quoteCharge === void 0 ? void 0 : quoteCharge.quoteChange.quote);
23495
23836
  },
23496
23837
  });
23497
23838
  const handleUpdateQuantity = react.useCallback((quantity, priceListChargeId, quote) => {
23498
- const quoteChange = quote === null || quote === void 0 ? void 0 : quote.quoteChanges.find(qc => qc.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id));
23839
+ var _a;
23840
+ const quoteChange = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a.find(qc => { var _a; return ((_a = qc === null || qc === void 0 ? void 0 : qc.priceList) === null || _a === void 0 ? void 0 : _a.id) === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id); });
23499
23841
  const quoteCharge = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.find(charge => {
23500
23842
  var _a;
23501
23843
  return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === priceListChargeId;
@@ -23508,6 +23850,10 @@ const useQuoteQuantities = ({ selectedPriceList, quote, }) => {
23508
23850
  showErrorNotification$1('Quote charge not found');
23509
23851
  return;
23510
23852
  }
23853
+ if (!(quoteCharge === null || quoteCharge === void 0 ? void 0 : quoteCharge.id)) {
23854
+ showErrorNotification$1('Quote charge ID not found');
23855
+ return;
23856
+ }
23511
23857
  updateCharge({
23512
23858
  quoteChargeId: quoteCharge.id,
23513
23859
  quantity,
@@ -23517,11 +23863,10 @@ const useQuoteQuantities = ({ selectedPriceList, quote, }) => {
23517
23863
  }, [apiHost, token, updateCharge, selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id, quote === null || quote === void 0 ? void 0 : quote.id]);
23518
23864
  // Helper function to get quantity from quote for a specific charge
23519
23865
  const getQuantityFromQuote = (chargeId) => {
23520
- var _a, _b;
23866
+ var _a, _b, _c, _d;
23521
23867
  if (!quote || !selectedPriceList)
23522
23868
  return undefined;
23523
- return (_b = (_a = quote.quoteChanges
23524
- .find(qc => qc.priceList.id === selectedPriceList.id)) === null || _a === void 0 ? void 0 : _a.charges.find(c => c.priceListCharge.id === chargeId)) === null || _b === void 0 ? void 0 : _b.quantity;
23869
+ return (_d = (_c = (_b = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a.find(qc => { var _a; return ((_a = qc === null || qc === void 0 ? void 0 : qc.priceList) === null || _a === void 0 ? void 0 : _a.id) === selectedPriceList.id; })) === null || _b === void 0 ? void 0 : _b.charges) === null || _c === void 0 ? void 0 : _c.find(c => { var _a; return ((_a = c === null || c === void 0 ? void 0 : c.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === chargeId; })) === null || _d === void 0 ? void 0 : _d.quantity;
23525
23870
  };
23526
23871
  // Helper function to process a single charge
23527
23872
  const processCharge = (charge) => {
@@ -23606,7 +23951,6 @@ const useFeatureQuantities = () => {
23606
23951
  };
23607
23952
  };
23608
23953
 
23609
- const QuoteContext = react.createContext({});
23610
23954
  function useFeatureAddonsPending() {
23611
23955
  const [featureAddonsLoading, setFeatureAddonsLoading] = react.useState([]);
23612
23956
  const addFeatureAddonLoading = (featureAddonId) => {
@@ -23630,14 +23974,15 @@ function QuoteProvider({ children }) {
23630
23974
  // Hooks
23631
23975
  const token = useToken();
23632
23976
  const { isFeatureAddonsLoading, addFeatureAddonLoading, removeFeatureAddonLoading } = useFeatureAddonsPending();
23633
- const { quote, isQuotePending } = useQuoteCreate({
23977
+ const { quote: maskedQuote, isQuotePending } = useQuoteCreate({
23634
23978
  upgradingSubscription,
23635
23979
  selectedPriceList: selectedPriceList,
23636
23980
  token,
23637
23981
  });
23982
+ const quote = readFragment(QuoteContext_QuoteFragment, maskedQuote);
23638
23983
  const { onChangeQuantity, getFeatureQuantity, isUpdatingCharges } = useQuoteQuantities({
23639
23984
  selectedPriceList: selectedPriceList,
23640
- quote: quote,
23985
+ quote,
23641
23986
  });
23642
23987
  // Handlers
23643
23988
  function handleClearQuote() {
@@ -23649,7 +23994,7 @@ function QuoteProvider({ children }) {
23649
23994
  // Important that we keep track of all changes taking place so we can recalculate taxes after all changes are complete
23650
23995
  const isUpdatingQuote = isUpdatingCharges || isAddonPlanLoading || isFeatureAddonsLoading;
23651
23996
  return (jsxRuntime.jsx(QuoteContext.Provider, { value: {
23652
- quote,
23997
+ quote: readFragment(QuoteContext_QuoteFragment, quote),
23653
23998
  selectedPriceList,
23654
23999
  isQuotePending, // Waiting for quote to load
23655
24000
  isUpdatingQuote, // Waiting for all changes to complete
@@ -23683,10 +24028,11 @@ function findQuoteChangeForFeatureAddon(quote) {
23683
24028
  return quote === null || quote === void 0 ? void 0 : quote.quoteChanges.find(qc => qc.kind === common.QuoteChangeKind.UPDATE || qc.kind === common.QuoteChangeKind.SUBSCRIBE);
23684
24029
  }
23685
24030
  function featureAddonInQuote(selectedPriceList, priceListCharge, quote) {
23686
- const quoteChange = quote === null || quote === void 0 ? void 0 : quote.quoteChanges.find(qc => qc.priceList.id === selectedPriceList.id);
24031
+ var _a, _b, _c;
24032
+ const quoteChange = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a.find(qc => { var _a; return ((_a = qc === null || qc === void 0 ? void 0 : qc.priceList) === null || _a === void 0 ? void 0 : _a.id) === selectedPriceList.id; });
23687
24033
  if (!quoteChange)
23688
24034
  return false;
23689
- return quoteChange.charges.some(c => { var _a; return ((_a = c.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === priceListCharge.id; });
24035
+ return (_c = (_b = quoteChange.charges) === null || _b === void 0 ? void 0 : _b.some(c => { var _a; return ((_a = c.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === priceListCharge.id; })) !== null && _c !== void 0 ? _c : false;
23690
24036
  }
23691
24037
  // ID Cucumber will use to find the feature addon switch
23692
24038
  function featureAddonSwitchTestId(featureAddon) {
@@ -23695,7 +24041,7 @@ function featureAddonSwitchTestId(featureAddon) {
23695
24041
  }
23696
24042
 
23697
24043
  const { Text: Text$b } = antd.Typography;
23698
- const CheckoutBarInput = ({ disabled, charge, quantity, onQuantityChanged, }) => {
24044
+ const CheckoutBarInput = ({ disabled, priceListCharge, quantity, onQuantityChanged, }) => {
23699
24045
  var _a;
23700
24046
  const [isTooltipOpen, setIsTooltipOpen] = react.useState(false);
23701
24047
  const isMobile = common.useIsMobile();
@@ -23707,14 +24053,14 @@ const CheckoutBarInput = ({ disabled, charge, quantity, onQuantityChanged, }) =>
23707
24053
  setIsTooltipOpen(false);
23708
24054
  }, 6000);
23709
24055
  }, []);
23710
- return (jsxRuntime.jsxs("div", { className: `bunny-flex bunny-items-center bunny-gap-2 ${isMobile ? 'bunny-justify-between' : ''}`, children: [jsxRuntime.jsx(QuantityLabel, { activeCharge: charge }), jsxRuntime.jsx(antd.Tooltip, { onOpenChange: setIsTooltipOpen, open: isTooltipOpen, title: "Change quantity here", styles: {
24056
+ return (jsxRuntime.jsxs(Text$b, { className: `bunny-flex bunny-items-center bunny-gap-2 ${isMobile ? 'bunny-justify-between' : ''}`, children: [jsxRuntime.jsx(QuantityLabel, { activeCharge: priceListCharge }), jsxRuntime.jsx(antd.Tooltip, { onOpenChange: setIsTooltipOpen, open: isTooltipOpen, title: "Change quantity here", styles: {
23711
24057
  body: {
23712
24058
  paddingTop: '0.75rem',
23713
24059
  paddingBottom: '0.75rem',
23714
24060
  },
23715
- }, children: jsxRuntime.jsx(antd.Input, { id: `${(_a = charge.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().replace(/ /g, '-')}-quantity-input`, className: isMobile ? 'text-right' : '', disabled: disabled, onChange: e => {
24061
+ }, children: jsxRuntime.jsx(antd.Input, { id: `${(_a = priceListCharge.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().replace(/ /g, '-')}-quantity-input`, className: isMobile ? 'text-right' : '', disabled: disabled, onChange: e => {
23716
24062
  onQuantityChanged(Number(e.target.value));
23717
- }, min: charge === null || charge === void 0 ? void 0 : charge.quantityMin, max: charge === null || charge === void 0 ? void 0 : charge.quantityMax, style: { minWidth: '120px' }, type: "number", value: quantity, required: true }) })] }));
24063
+ }, min: priceListCharge === null || priceListCharge === void 0 ? void 0 : priceListCharge.quantityMin, max: priceListCharge === null || priceListCharge === void 0 ? void 0 : priceListCharge.quantityMax, style: { minWidth: '120px' }, type: "number", value: quantity, required: true }) })] }));
23718
24064
  };
23719
24065
  const QuantityLabel = ({ activeCharge }) => {
23720
24066
  var _a;
@@ -23744,7 +24090,7 @@ const getActivePlanPriceData = (priceList, selectedPriceList) => {
23744
24090
  }
23745
24091
  for (let j = 0; j < priceList.charges.length; j++) {
23746
24092
  const charge = priceList.charges[j];
23747
- if (charge.chargeType === common.ChargeType.USAGE)
24093
+ if (charge.chargeType === common.ChargeType.USAGE || charge.featureAddon === true)
23748
24094
  continue;
23749
24095
  if (activeBillingPLCharge) {
23750
24096
  // If we already found a charge with the same billing period check if this charge is lower
@@ -23793,9 +24139,6 @@ const isPriceListDisabled = ({ priceList, upgradingSubscription, }) => {
23793
24139
  !canPurchaseFeatureAddons &&
23794
24140
  !canPurchasePlanAddons);
23795
24141
  }
23796
- else if (existingSubscriptionInTrialExpired) {
23797
- return true;
23798
- }
23799
24142
  else {
23800
24143
  return false;
23801
24144
  }
@@ -23828,7 +24171,8 @@ const CheckoutBarSummarySection = ({ open, selectedPriceList, onClickCheckout, }
23828
24171
  var _a;
23829
24172
  // Context
23830
24173
  const { apiHost } = react.useContext(BunnyContext);
23831
- const { quote, isQuotePending, isUpdatingQuote } = react.useContext(QuoteContext);
24174
+ const { quote: quoteData, isQuotePending, isUpdatingQuote } = react.useContext(QuoteContext);
24175
+ const quote = quoteData;
23832
24176
  const { accountId } = react.useContext(PaymentContext);
23833
24177
  const { upgradingSubscription } = react.useContext(SubscriptionsContext);
23834
24178
  // Hooks
@@ -23906,15 +24250,17 @@ const PlanPickerCheckoutBar = ({ selectedPriceList, handlePortalErrors, onChecko
23906
24250
  const isFeatureAddon = charge.featureAddon;
23907
24251
  const quantity = getFeatureQuantity((_b = charge.feature) === null || _b === void 0 ? void 0 : _b.id, charge.id);
23908
24252
  const maybeIsChargeLoading = isFeatureAddon && isFeatureAddonsLoading;
23909
- const showInput = quantity && selectedPriceList.id !== (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id);
23910
- if (!showInput)
24253
+ const showInput = selectedPriceList.id !== (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id);
24254
+ if (!isFeatureAddon && !showInput)
24255
+ return null;
24256
+ if (!quantity)
23911
24257
  return null;
23912
24258
  // if charge is a feature addon, and a corresponding quote charge is not found in quote, return null
23913
24259
  if (isFeatureAddon && !featureAddonInQuote(selectedPriceList, charge, quote)) {
23914
24260
  return null;
23915
24261
  }
23916
24262
  const isDisabled = !quote || maybeIsChargeLoading || !selectedPriceList || !charge.selfServiceQuantity;
23917
- return (jsxRuntime.jsx(CheckoutBarInput, { disabled: isDisabled, charge: charge, quantity: quantity, onQuantityChanged: quantity => {
24263
+ return (jsxRuntime.jsx(CheckoutBarInput, { disabled: isDisabled, priceListCharge: charge, quantity: quantity, onQuantityChanged: quantity => {
23918
24264
  onChangeQuantity(charge.id, quantity);
23919
24265
  } }, index));
23920
24266
  }) }), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: () => setPayModalVisible(true), open: payModalVisible, selectedPriceList: selectedPriceList }), jsxRuntime.jsx(Checkout, { onCancel: () => setPayModalVisible(false), onFail: error => handlePortalErrors === null || handlePortalErrors === void 0 ? void 0 : handlePortalErrors(error), onSuccess: handleCheckoutSuccess, open: payModalVisible, quote: quote, token: token, isUpdatingQuote: isUpdatingQuote })] }));
@@ -24096,26 +24442,25 @@ const PriceListCardButton = ({ disableSelectCurrentPlan, isPriceListCurrentSubsc
24096
24442
  return priceList.plan.contactUsLabel;
24097
24443
  return 'Change to';
24098
24444
  };
24099
- return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-grow bunny-w-full bunny-gap-3", children: jsxRuntime.jsx(antd.Button, { className: "bunny-w-full", disabled: disableSelectCurrentPlan, style: {
24100
- maxWidth: '240px',
24101
- }, type: isSelected ? 'primary' : 'default', children: createButtonText() }) }));
24445
+ return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-grow bunny-w-full bunny-gap-3", children: jsxRuntime.jsx(antd.Button, { className: "bunny-w-full", disabled: disableSelectCurrentPlan, type: isSelected ? 'primary' : 'default', children: createButtonText() }) }));
24102
24446
  };
24103
24447
 
24104
24448
  const { Text: Text$9 } = antd.Typography;
24105
24449
  const PriceListCardDescription = ({ description }) => {
24106
- return (jsxRuntime.jsx(Text$9, { className: "bunny-text-gray-400 bunny-text-xs", children: jsxRuntime.jsx(interweave.Markup, { content: description }) }));
24450
+ return (jsxRuntime.jsx(Text$9, { className: "bunny-text-gray-400 bunny-text-sm", children: jsxRuntime.jsx(interweave.Markup, { content: description }) }));
24107
24451
  };
24108
24452
 
24109
- const { Text: Text$8 } = antd.Typography;
24110
24453
  const getPrice = (priceList) => {
24111
24454
  if (priceList.showPriceAsMonthly) {
24112
24455
  return priceList.monthlyBasePrice;
24113
24456
  }
24114
24457
  return priceList.basePrice;
24115
24458
  };
24116
- const calculatePriceDecimals = (priceList) => {
24117
- if (priceList.plan.pricingStyle === common.PricingStyle.PRICED) {
24118
- const decimalPart = getPrice(priceList).toString().split('.')[1];
24459
+
24460
+ function calculatePriceDecimals(priceList) {
24461
+ var _a;
24462
+ if (priceList.plan.pricingStyle === graphql.scalar('PlanPricingStyles', 'PRICED')) {
24463
+ const decimalPart = (_a = getPrice(priceList)) === null || _a === void 0 ? void 0 : _a.toString().split('.')[1];
24119
24464
  if (!decimalPart)
24120
24465
  return 0;
24121
24466
  // If decimal part consists only of zeros, return 0
@@ -24125,16 +24470,28 @@ const calculatePriceDecimals = (priceList) => {
24125
24470
  return undefined;
24126
24471
  }
24127
24472
  return 0;
24128
- };
24129
- const PriceListCardPrice = ({ className, priceList, }) => {
24473
+ }
24474
+ function priceListPriceText({ priceList, }) {
24130
24475
  const priceDecimals = calculatePriceDecimals(priceList);
24131
- return (jsxRuntime.jsx(Text$8, { className: className
24132
- ? className
24133
- : 'bunny-font-medium bunny-text-3xl bunny-text-center bunny-text-gray-900', children: !priceList.plan.pricingStyle || priceList.plan.pricingStyle === common.PricingStyle.PRICED
24134
- ? common.formatCurrency(getPrice(priceList), priceList.currencyId, priceDecimals)
24135
- : priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US
24136
- ? ''
24137
- : 'Free' }));
24476
+ const price = !priceList.plan.pricingStyle ||
24477
+ priceList.plan.pricingStyle === graphql.scalar('PlanPricingStyles', 'PRICED')
24478
+ ? formatCurrency(getPrice(priceList), priceList.currencyId, priceDecimals)
24479
+ : priceList.plan.pricingStyle === graphql.scalar('PlanPricingStyles', 'CONTACT_US')
24480
+ ? ''
24481
+ : 'Free';
24482
+ return price;
24483
+ }
24484
+
24485
+ const { Text: Text$8 } = antd.Typography;
24486
+ const PriceListCardPrice = ({ className, priceList, }) => {
24487
+ return (jsxRuntime.jsx(Text$8, { className: className ? className : 'bunny-font-medium bunny-text-3xl bunny-text-gray-900', children: priceListPriceText({ priceList }) }));
24488
+ };
24489
+
24490
+ // Exclude add-on charges because they may not be present in the quote/subscription
24491
+ // Exclude usage charges because their price depends on the usage (we don't know what the usage will be)
24492
+ const hasMultipleRecurringCharges = (priceList) => {
24493
+ var _a;
24494
+ return ((_a = priceList.charges.filter(charge => charge.chargeType !== graphql.scalar('ChargeType', 'USAGE') && charge.featureAddon !== true).length) !== null && _a !== void 0 ? _a : 0 > 1);
24138
24495
  };
24139
24496
 
24140
24497
  const isEmptyHtml = (html) => {
@@ -24142,19 +24499,15 @@ const isEmptyHtml = (html) => {
24142
24499
  };
24143
24500
  const { Text: Text$7 } = antd.Typography;
24144
24501
  const PriceListCardPriceDescription = ({ feature, priceList, }) => {
24145
- const doesPlanHaveFlatFeeCharges = priceList.charges.some(charge => charge.pricingModel === common.PricingModel.FLAT && charge.basePrice > 0);
24146
- if (priceList.periodMonths <= 0 || priceList.plan.pricingStyle !== common.PricingStyle.PRICED)
24502
+ if (priceList.periodMonths <= 0)
24147
24503
  return null;
24148
- return (jsxRuntime.jsxs(Text$7, { className: "bunny-text-start bunny-text-gray-400 bunny-text-sm", children: [jsxRuntime.jsx("div", { children: priceList.plan.pricingDescription && !isEmptyHtml(priceList.plan.pricingDescription) ? (jsxRuntime.jsx(interweave.Markup, { content: priceList.plan.pricingDescription })) : (PriceDescriptionString({
24149
- unitName: feature === null || feature === void 0 ? void 0 : feature.unitName,
24504
+ return (jsxRuntime.jsxs(Text$7, { className: "bunny-text-start bunny-text-gray-400 bunny-text-sm", children: [jsxRuntime.jsx("div", { children: priceList.plan.pricingDescription && !isEmptyHtml(priceList.plan.pricingDescription) ? (jsxRuntime.jsx(interweave.Markup, { content: priceList.plan.pricingDescription })) : (priceDescriptionString({
24505
+ unitName: hasMultipleRecurringCharges(priceList) ? undefined : feature === null || feature === void 0 ? void 0 : feature.unitName,
24150
24506
  showPriceAsMonthly: priceList.showPriceAsMonthly,
24151
24507
  periodMonths: priceList.periodMonths,
24152
- doesPlanHaveFlatFeeCharges,
24508
+ priceListHasFlatFeeCharges: doesPriceListHaveFlatFeeCharges(priceList),
24153
24509
  })) }), priceList.periodMonths > 1 && (jsxRuntime.jsxs("div", { children: ["Billed ", BillingPeriodConverter$1[periodMonthsConverter(priceList.periodMonths)]] }))] }));
24154
24510
  };
24155
- function PriceDescriptionString({ unitName, showPriceAsMonthly, periodMonths, doesPlanHaveFlatFeeCharges, }) {
24156
- return `Per ${unitName && !doesPlanHaveFlatFeeCharges ? `${unitName.toLowerCase()} / ` : ''}${showPriceAsMonthly ? 'month' : common.PERIOD_LABELS[periodMonthsConverter(periodMonths)]}`;
24157
- }
24158
24511
 
24159
24512
  const { Text: Text$6 } = antd.Typography;
24160
24513
  const PriceListCardTitle = ({ priceList, isPriceListCurrentSubscription, trialRemainingDays, }) => {
@@ -24186,7 +24539,11 @@ const PriceListCardDesktop = ({ hideButton, description, disableSelectCurrentPla
24186
24539
  }
24187
24540
  }, style: {
24188
24541
  height: '100%',
24189
- }, children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-8 bunny-h-full bunny-justify-between", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-start bunny-gap-2", children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, priceList: priceList, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-start bunny-gap-0", children: [jsxRuntime.jsx(PriceListCardPrice, { priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, priceList: priceList })] })] }), !hideButton && (jsxRuntime.jsx(PriceListCardButton, { disableSelectCurrentPlan: disableSelectCurrentPlan, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, subscriptionPlan: subscriptionPlan }))] }) }));
24542
+ }, children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-8 bunny-h-full bunny-justify-between", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-start bunny-gap-2", children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, priceList: priceList, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] }), jsxRuntime.jsxs("div", { style: {
24543
+ display: 'grid',
24544
+ gridTemplateRows: 'auto minmax(40px, auto)',
24545
+ alignItems: 'start',
24546
+ }, children: [jsxRuntime.jsx(PriceListCardPrice, { priceList: priceList }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-start", children: [jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, priceList: priceList }), priceListHasPriceTiers(priceList) && (jsxRuntime.jsx(PricingTooltip, { priceListCharges: priceList.charges.filter(charge => charge.featureAddon !== true), currencyId: priceList.currencyId, priceList: priceList }))] })] })] }), !hideButton && (jsxRuntime.jsx(PriceListCardButton, { disableSelectCurrentPlan: disableSelectCurrentPlan, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, subscriptionPlan: subscriptionPlan }))] }) }));
24190
24547
  };
24191
24548
 
24192
24549
  const CheckIcon = ({ backgroundColor, size, }) => {
@@ -24237,39 +24594,29 @@ const PriceListCard = ({ hideButton, isSelected, priceList, subscriptions, trial
24237
24594
  disableOnClickPriceListCard: disableSelectCurrentPlan, onClickPriceListCard: onClickPriceListCard })) : (jsxRuntime.jsx(PriceListCardDesktop, { hideButton: hideButton, description: description, disableSelectCurrentPlan: disableSelectCurrentPlan, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan, noBorder: noBorder, onClickPriceListCard: onClickPriceListCard }));
24238
24595
  };
24239
24596
 
24240
- const QUOTE_CHARGE_DELETE = `
24241
- ${QUOTE_FIELDS()}
24242
- mutation QuoteChargeDelete ($quoteChargeId: ID!) {
24243
- quoteChargeDelete(
24244
- quoteChargeId: $quoteChargeId
24245
- ) {
24246
- errors
24247
- quoteCharge {
24248
- quoteChange {
24249
- id
24250
- quoteId
24251
- quote {
24252
- ...QuoteFields
24597
+ const mutation = t(`
24598
+ mutation QuoteChargeDelete($quoteChargeId: ID!) {
24599
+ quoteChargeDelete(quoteChargeId: $quoteChargeId) {
24600
+ errors
24601
+ quoteCharge {
24602
+ quoteChange {
24603
+ id
24604
+ quoteId
24605
+ quote {
24606
+ ...QuoteContext_QuoteFragment
24607
+ }
24608
+ }
24253
24609
  }
24254
24610
  }
24255
24611
  }
24256
- }
24257
- }
24258
-
24259
- `;
24612
+ `, [QuoteContext_QuoteFragment]);
24260
24613
  const quoteChargeDelete = async ({ quoteChargeId, token, apiHost }) => {
24261
- const response = await gqlRequest({
24262
- query: QUOTE_CHARGE_DELETE,
24263
- vars: {
24264
- quoteChargeId,
24265
- },
24266
- apiHost,
24267
- token,
24268
- });
24269
- if (response.errors) {
24270
- throw new Error(response.errors[0].message);
24614
+ var _a, _b, _c, _d;
24615
+ const response = await execute(mutation, { apiHost, token }, { quoteChargeId });
24616
+ if ((_a = response.quoteChargeDelete) === null || _a === void 0 ? void 0 : _a.errors) {
24617
+ throw new Error((_c = (_b = response.quoteChargeDelete) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]);
24271
24618
  }
24272
- return response.quoteChargeDelete.quoteCharge;
24619
+ return (_d = response.quoteChargeDelete) === null || _d === void 0 ? void 0 : _d.quoteCharge;
24273
24620
  };
24274
24621
 
24275
24622
  const useQuoteUpdateFeatureAddon = (quote, featureAddon) => {
@@ -24316,15 +24663,15 @@ const useQuoteUpdateFeatureAddon = (quote, featureAddon) => {
24316
24663
  const { mutate: quoteChargeDeleteMutation, isPending: isDeletingFeatureAddon } = reactQuery.useMutation({
24317
24664
  mutationFn: async ({ quoteChargeId }) => {
24318
24665
  const response = await quoteChargeDelete({ quoteChargeId, token, apiHost });
24319
- return { quoteCharge: response };
24666
+ return response;
24320
24667
  },
24321
- onSuccess: ({ quoteCharge }) => {
24668
+ onSuccess: quoteCharge => {
24322
24669
  addedQuoteChargeId.current = undefined;
24323
24670
  queryClient.setQueryData(common.QueryKeyFactory.default.createObjectKey({
24324
24671
  objectName: 'editingQuote',
24325
24672
  id: quote === null || quote === void 0 ? void 0 : quote.id,
24326
24673
  token,
24327
- }), quoteCharge.quoteChange.quote);
24674
+ }), quoteCharge === null || quoteCharge === void 0 ? void 0 : quoteCharge.quoteChange.quote);
24328
24675
  },
24329
24676
  });
24330
24677
  const isPending = isCreatingFeatureAddon || isDeletingFeatureAddon;
@@ -24363,7 +24710,6 @@ function FeatureAddonsList({ priceList }) {
24363
24710
  }) }));
24364
24711
  }
24365
24712
  function FeatureAddonRow({ featureAddon, priceList, }) {
24366
- var _a;
24367
24713
  const { quote, selectedPriceList } = react.useContext(QuoteContext);
24368
24714
  const { handleAddFeatureAddon, handleRemoveFeatureAddon, isPending, isChecked } = useQuoteUpdateFeatureAddon(quote, featureAddon);
24369
24715
  const { brandColor } = react.useContext(BrandContext);
@@ -24372,13 +24718,7 @@ function FeatureAddonRow({ featureAddon, priceList, }) {
24372
24718
  const isPurchased = isAddonPurchased(featureAddon, upgradingSubscription);
24373
24719
  const isDisabled = !isPriceListSelected || isPurchased;
24374
24720
  const checked = isChecked || isPurchased;
24375
- const tooltipContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { children: common.formatCurrency(featureAddon.basePrice, priceList.currencyId) }), featureAddon.chargeType === common.ChargeType.RECURRING && (jsxRuntime.jsx("div", { children: PriceDescriptionString({
24376
- unitName: (_a = featureAddon.feature) === null || _a === void 0 ? void 0 : _a.unitName,
24377
- showPriceAsMonthly: priceList.showPriceAsMonthly,
24378
- periodMonths: priceList.periodMonths,
24379
- doesPlanHaveFlatFeeCharges: false,
24380
- }) }))] }));
24381
- return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-flex-wrap bunny-items-center bunny-justify-between bunny-gap-1", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-1", children: [jsxRuntime.jsxs(Text$5, { className: "bunny-flex bunny-text-sm bunny-items-center bunny-gap-1 bunny-text-gray-600", children: [checked ? (jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" })) : (jsxRuntime.jsx(CheckIcon, { backgroundColor: common.SLATE_200, size: "15px" })), featureAddon.name] }), jsxRuntime.jsx(antd.Tooltip, { title: tooltipContent, children: jsxRuntime.jsx(icons.InfoCircleOutlined, { className: "bunny-text-gray-500", size: 15 }) })] }), jsxRuntime.jsx(antd.Switch, { id: featureAddonSwitchTestId(featureAddon), size: "small", loading: isPending, disabled: isDisabled || !quote, checked: checked, onChange: checked => {
24721
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-flex-wrap bunny-items-center bunny-justify-between bunny-gap-1", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-row bunny-gap-1", children: [jsxRuntime.jsxs(Text$5, { className: "bunny-flex bunny-text-sm bunny-items-center bunny-gap-1 bunny-text-gray-600", children: [checked ? (jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" })) : (jsxRuntime.jsx(CheckIcon, { backgroundColor: common.SLATE_200, size: "15px" })), featureAddon.name] }), jsxRuntime.jsx(PricingTooltip, { priceListCharges: [featureAddon], currencyId: priceList.currencyId, priceList: priceList })] }), jsxRuntime.jsx(antd.Switch, { id: featureAddonSwitchTestId(featureAddon), size: "small", loading: isPending, disabled: isDisabled || !quote, checked: checked, onChange: checked => {
24382
24722
  if (checked) {
24383
24723
  handleAddFeatureAddon();
24384
24724
  }
@@ -24687,7 +25027,7 @@ const PlanFeatures = ({ displayPriceLists, features, plansToDisplay, }) => {
24687
25027
  const featureGroup = group.groupFeature;
24688
25028
  const features = group.features;
24689
25029
  const isFeatureGroup = featureGroup ? true : false;
24690
- return (jsxRuntime.jsxs("div", { children: [featureGroup ? (jsxRuntime.jsx("div", { className: "bunny-pt-4", children: jsxRuntime.jsx(FeatureTitle, { isFeatureGroup: isFeatureGroup, feature: featureGroup }) })) : (jsxRuntime.jsx("div", { className: "bunny-pt-4" })), jsxRuntime.jsx(GridTemplateColumnsWrapper, { className: "bunny-grid bunny-w-full shadow-md bunny-rounded-md bunny-p-0 bg-white", everythingInPlus: false, plansToDisplay: plansToDisplay, children: features.map((feature, featureIndex) => {
25030
+ return (jsxRuntime.jsxs("div", { children: [featureGroup ? (jsxRuntime.jsx("div", { className: "bunny-pt-4 bunny-pb-2", children: jsxRuntime.jsx(FeatureTitle, { isFeatureGroup: isFeatureGroup, feature: featureGroup }) })) : (jsxRuntime.jsx("div", { className: "bunny-pt-4" })), jsxRuntime.jsx(GridTemplateColumnsWrapper, { className: "bunny-grid bunny-w-full shadow-md bunny-rounded-md bunny-p-0 bg-white", everythingInPlus: false, plansToDisplay: plansToDisplay, children: features.map((feature, featureIndex) => {
24691
25031
  const rowIndex = featureIndex;
24692
25032
  const isFeatureGroup = feature.kind === 'GROUP';
24693
25033
  return (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx(FeatureGridCell, { isFeatureGroup: isFeatureGroup, noBorder: true, rowIndex: featureIndex, children: jsxRuntime.jsx(FeatureTitle, { isFeatureGroup: isFeatureGroup, feature: feature }) }), [...Array(plansToDisplay)].map((_, columnIndex) => {