@solvimon/solvimon-web 0.1.0-alpha.22 → 0.1.0-alpha.24

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 (218) hide show
  1. package/README.md +44 -0
  2. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DW10rozs.mjs} +6 -6
  3. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Co3XAxaY.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jWthTJk-.js} +1 -1
  4. package/dist/Alert.vue.es-RyK53a2P.js +1 -0
  5. package/dist/Alert.vue.es-lIiAWf2S.mjs +146 -0
  6. package/dist/{Avatar.vue.es-DNJ-jexx.mjs → Avatar.vue.es-DzjFvLuK.mjs} +1 -1
  7. package/dist/{Avatar.vue.es-D42J_izE.js → Avatar.vue.es-nr8srGuK.js} +1 -1
  8. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-D1uVidXk.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BptcwJMr.mjs} +4 -4
  9. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BEVkWJXT.js → BillingInformation.vue_vue_type_script_setup_true_lang-C1prOJay.js} +1 -1
  10. package/dist/{Button.vue.es-Dz-2L8dJ.mjs → Button.vue.es-PbJFK8z7.mjs} +1 -1
  11. package/dist/{Button.vue.es-M_jXZda4.js → Button.vue.es-TCF-bvDF.js} +1 -1
  12. package/dist/Checkout.entry.ce-D8O4qJ24.js +2 -0
  13. package/dist/Checkout.entry.ce-DHFx5Vnb.mjs +3900 -0
  14. package/dist/{Chip.vue.es-G8doKsZb.js → Chip.vue.es-CAoisngJ.js} +1 -1
  15. package/dist/{Chip.vue.es-DMK9C78d.mjs → Chip.vue.es-DpcOM3Ai.mjs} +2 -2
  16. package/dist/ContentWithAsideLayout-BCM8tmZN.mjs +38 -0
  17. package/dist/ContentWithAsideLayout-RSdKXqAf.js +1 -0
  18. package/dist/{ContextMenu.vue.es-B3Rz6Ojk.js → ContextMenu.vue.es-kzZ3JJHG.js} +1 -1
  19. package/dist/{ContextMenu.vue.es-CzkkNoJG.mjs → ContextMenu.vue.es-tAuFp-6i.mjs} +4 -4
  20. package/dist/{CustomerBillingInformation.vue.es-Db6bN2RZ.mjs → CustomerBillingInformation.vue.es-BQSl9q6W.mjs} +2 -2
  21. package/dist/{CustomerBillingInformation.vue.es-BmtU9Pk0.js → CustomerBillingInformation.vue.es-Nac6HgLo.js} +1 -1
  22. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BOLf-U0A.js} +1 -1
  23. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-fESZVyPe.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-R47ln7Wb.mjs} +5 -5
  24. package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DdMHG1_Y.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CaNXS48v.mjs} +15 -15
  25. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D_jcV7VG.js +1 -0
  26. package/dist/{DividerText.vue.es-IK2fns6f.mjs → DividerText.vue.es-CSE7a-T0.mjs} +1 -1
  27. package/dist/{DividerText.vue.es-D-QxT2OD.js → DividerText.vue.es-LJ2kZakb.js} +1 -1
  28. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DeotDsFP.mjs} +4 -4
  29. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-GNPyrcAQ.js} +1 -1
  30. package/dist/ErrorNotification.vue.es-BF6swP7o.js +1 -0
  31. package/dist/{ErrorNotification.vue.es-BGckEwHf.mjs → ErrorNotification.vue.es-CVUuIt8Z.mjs} +2 -2
  32. package/dist/IconButton.vue.es-CB1lIPao.js +1 -0
  33. package/dist/IconButton.vue.es-DGflbWFk.mjs +56 -0
  34. package/dist/{IconTitle.vue.es-BmX68uJx.mjs → IconTitle.vue.es-BsdjyGlQ.mjs} +3 -3
  35. package/dist/{IconTitle.vue.es-CmR2xoeu.js → IconTitle.vue.es-CMO8EyQl.js} +1 -1
  36. package/dist/{Input.vue.es-BGPELaZU.mjs → Input.vue.es-BFbiFXsU.mjs} +2 -2
  37. package/dist/{Input.vue.es-CTOrmrcB.js → Input.vue.es-CREdT4nB.js} +1 -1
  38. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-bheNAKzK.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BZ4D_-7E.js} +1 -1
  39. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CMEOOuSU.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Btv0rRk4.mjs} +2 -2
  40. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-avhwysNq.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-CrZq0d1M.mjs} +2 -2
  41. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-Xo9BR6AD.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-j-cNIRD_.js} +1 -1
  42. package/dist/{InvoiceSummary.vue.es-hpG8Tq1D.js → InvoiceSummary.vue.es-BOnvORpf.js} +1 -1
  43. package/dist/{InvoiceSummary.vue.es-BWLiwlNs.mjs → InvoiceSummary.vue.es-JtOIQ6SJ.mjs} +7 -7
  44. package/dist/{Modal.vue.es-BD4vUaOQ.js → Modal.vue.es-BbdtdxsO.js} +1 -1
  45. package/dist/{Modal.vue.es-B_G8NQS2.mjs → Modal.vue.es-jT61xK_A.mjs} +5 -5
  46. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-BBoZVnsK.js +1 -0
  47. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-Dan29qmH.mjs +294 -0
  48. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DuorCFo9.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BJZHkTqA.mjs} +3 -3
  49. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D34fD3Io.js} +1 -1
  50. package/dist/{PaymentHistoryBlock-DSHW_eW1.js → PaymentHistoryBlock-Dw2wOiAI.js} +1 -1
  51. package/dist/{PaymentHistoryBlock-ComJzB3H.mjs → PaymentHistoryBlock-quvnCSFV.mjs} +1 -1
  52. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-hjtksV2D.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-5ckQd9eQ.mjs} +4 -4
  53. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DUN0Hf2v.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C0XIdBbx.js} +1 -1
  54. package/dist/{PaymentIntegrationForm-CH5B6BY5.mjs → PaymentIntegrationForm-CQjUZi22.mjs} +1 -1
  55. package/dist/{PaymentIntegrationForm-CwfCLnKt.js → PaymentIntegrationForm-D1oJREmH.js} +1 -1
  56. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-De7h9-fH.js +1 -0
  57. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BqYk4_T9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DnBLj1wZ.mjs} +43 -40
  58. package/dist/PaymentIntegrationFormAdyen-BQXXwpUK.js +98 -0
  59. package/dist/PaymentIntegrationFormAdyen-CyZk9ofV.mjs +798 -0
  60. package/dist/PaymentIntegrationFormStripe-Bs4F7oK_.js +102 -0
  61. package/dist/{PaymentIntegrationFormStripe-CBsXDuhy.mjs → PaymentIntegrationFormStripe-D-GaLHwc.mjs} +251 -179
  62. package/dist/{PaymentMethod.vue.es-DkQdPXfk.mjs → PaymentMethod.vue.es-C0j580g7.mjs} +3 -3
  63. package/dist/{PaymentMethod.vue.es-D18g-QB4.js → PaymentMethod.vue.es-CXV_ThBY.js} +1 -1
  64. package/dist/{PaymentMethodForm-CpIZKfPH.mjs → PaymentMethodForm-Bf2Ps6eV.mjs} +1 -1
  65. package/dist/{PaymentMethodForm-DK8ntFA0.js → PaymentMethodForm-CDV5LR8i.js} +1 -1
  66. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-C1tGJsay.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-BqPu7CYA.mjs} +6 -6
  67. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-D7fDguwa.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-BwsRDlQJ.js} +1 -1
  68. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-9MUPbgWM.mjs} +6 -6
  69. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BIX0k7-q.js} +1 -1
  70. package/dist/PlanCustomizationEditor-0kEXoOcM.js +1 -0
  71. package/dist/{PlanCustomizationEditor-0zCXN-cv.mjs → PlanCustomizationEditor-Dv69xPbX.mjs} +9 -9
  72. package/dist/{PricingGroupRangeInput.vue.es-QnpfHxaY.js → PricingGroupRangeInput.vue.es-BchXhunH.js} +2 -2
  73. package/dist/{PricingGroupRangeInput.vue.es-8_5nfZDI.mjs → PricingGroupRangeInput.vue.es-CP7-dmxS.mjs} +4 -4
  74. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-t6h1j6WD.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DmVJ2JQE.mjs} +5 -5
  75. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CGJhKKNL.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-YsI__d0V.js} +1 -1
  76. package/dist/RadioGroupExtended.vue.es-Cf5R1P9a.js +1 -0
  77. package/dist/{RadioGroupExtended.vue.es-C92xlCFQ.mjs → RadioGroupExtended.vue.es-_QMReyZ8.mjs} +3 -3
  78. package/dist/{Section.vue.es-Btff-cLY.js → Section.vue.es-CBZx5x53.js} +1 -1
  79. package/dist/{Section.vue.es-DQ5H7mqW.mjs → Section.vue.es-KRsHeFoT.mjs} +1 -1
  80. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DKsunuGT.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVELHoUj.mjs} +6 -6
  81. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BfvX14E3.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-UdGQMJGY.js} +1 -1
  82. package/dist/{SubscriptionSchedules-pzNsego6.js → SubscriptionSchedules-1ikoGncQ.js} +1 -1
  83. package/dist/{SubscriptionSchedules-Dc0rUnnf.mjs → SubscriptionSchedules-B6b6xf-E.mjs} +1 -1
  84. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cd56tuZb.js +1 -0
  85. package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Brs9qDs5.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Dv2bP9vv.mjs} +12 -12
  86. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-DZKl0Zxp.js} +1 -1
  87. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-DvYZvTV9.mjs} +2 -2
  88. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-CFmCJK8M.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-DTjZcOhj.js} +1 -1
  89. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DSoNs7Xx.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DmeIKMYI.mjs} +6 -6
  90. package/dist/{TooltipParagraph.vue.es-BaqCDjl8.js → TooltipParagraph.vue.es-7IQdU3Tf.js} +1 -1
  91. package/dist/{TooltipParagraph.vue.es-CIedcXGT.mjs → TooltipParagraph.vue.es-nGFfHF1A.mjs} +1 -1
  92. package/dist/{TrialChip.vue.es-BzNI94k0.js → TrialChip.vue.es-DhC5Bpmy.js} +1 -1
  93. package/dist/{TrialChip.vue.es-DkBuMNr_.mjs → TrialChip.vue.es-eKgO6an3.mjs} +2 -2
  94. package/dist/{cn.es-BGqYNPM3.mjs → cn.es-BD7Afj5Q.mjs} +2 -2
  95. package/dist/{cn.es-CvmLj7KH.js → cn.es-BLE3T5Rx.js} +1 -1
  96. package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
  97. package/dist/components/BillingInformation/BillingInformation.mjs +5 -5
  98. package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
  99. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +7 -7
  100. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
  101. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +5 -5
  102. package/dist/components/Invoice/Invoice.cjs +1 -1
  103. package/dist/components/Invoice/Invoice.mjs +10 -10
  104. package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
  105. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
  106. package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
  107. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +8 -8
  108. package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
  109. package/dist/components/InvoicesList/InvoicesList.mjs +4 -4
  110. package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
  111. package/dist/components/PaymentHistory/PaymentHistory.mjs +9 -9
  112. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
  113. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +6 -6
  114. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
  115. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +5 -5
  116. package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
  117. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +6 -6
  118. package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
  119. package/dist/components/WalletBalances/WalletBalances.mjs +4 -4
  120. package/dist/core/index.cjs +1 -1
  121. package/dist/core/index.mjs +26 -23
  122. package/dist/customElements-CSzbVZIH.js +1211 -0
  123. package/dist/{customElements-CSE7dwUr.mjs → customElements-DT1YyL4O.mjs} +663 -626
  124. package/dist/{customer-Dsq-Moea.js → customer-CJonIvSm.js} +1 -1
  125. package/dist/{customer-5krPxZ8i.mjs → customer-Cq4fF__H.mjs} +1 -1
  126. package/dist/{de-DE-DsFtpLsx.mjs → de-DE-CyvjSD9b.mjs} +26 -2
  127. package/dist/{de-DE-C3DzP1nj.js → de-DE-DXsDvO5y.js} +1 -1
  128. package/dist/{en-US-X_pSFsNm.js → en-US-DHdI11k9.js} +1 -1
  129. package/dist/{en-US-DvkvbV0p.mjs → en-US-xQrWj8qI.mjs} +24 -0
  130. package/dist/index.cjs +1 -1
  131. package/dist/index.mjs +1 -1
  132. package/dist/{invoices-DRgfpkJ6.mjs → invoices-CVZOfEOY.mjs} +1 -1
  133. package/dist/{invoices-xOV2YaEV.js → invoices-EamWI_jz.js} +1 -1
  134. package/dist/{it-IT-TE7oqvXa.mjs → it-IT-C09oObBM.mjs} +26 -2
  135. package/dist/{it-IT-YBtHAao1.js → it-IT-CcRIzP1A.js} +1 -1
  136. package/dist/{nl-NL-C8wnyKju.js → nl-NL-5PrgQl8q.js} +1 -1
  137. package/dist/{nl-NL-Di3-JArV.mjs → nl-NL-BhNND_yi.mjs} +24 -0
  138. package/dist/paymentFailure-Bh60UhxA.mjs +47 -0
  139. package/dist/paymentFailure-Cki8c5BX.js +1 -0
  140. package/dist/{paymentMethods-CRDIw9lz.js → paymentMethods-Bwym8l9a.js} +1 -1
  141. package/dist/{paymentMethods-PmkHYomw.mjs → paymentMethods-By1SebnO.mjs} +1 -1
  142. package/dist/{payments-Dvqh6CGW.mjs → payments-BYZLQTJ-.mjs} +1 -1
  143. package/dist/{payments-jAgXhdp_.js → payments-Dnjg9Se4.js} +1 -1
  144. package/dist/screens/Checkout/Checkout.cjs +1 -1
  145. package/dist/screens/Checkout/Checkout.mjs +2 -2
  146. package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
  147. package/dist/screens/CustomerOverview/CustomerOverview.mjs +21 -21
  148. package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
  149. package/dist/screens/PayInvoice/PayInvoice.mjs +131 -127
  150. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
  151. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +11 -11
  152. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
  153. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +21 -21
  154. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
  155. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +20 -20
  156. package/dist/sessionReference-3h-6FdrC.mjs +43 -0
  157. package/dist/sessionReference-m_6Rp4X1.js +1 -0
  158. package/dist/subscriptions-BKER9RUc.js +1 -0
  159. package/dist/{subscriptions-XDyI2Cqm.mjs → subscriptions-Gj3KgCZz.mjs} +2 -2
  160. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +8 -0
  161. package/dist/types/components/providers/LoggerProvider/LoggerProvider.lib.d.ts +2 -0
  162. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +13 -2
  163. package/dist/types/services/portals.types.d.ts +2 -0
  164. package/dist/types/services/requests.types.d.ts +2 -0
  165. package/dist/types/types/errors.d.ts +5 -0
  166. package/dist/{url-DwiuKYpu.mjs → url-TNRgVI8A.mjs} +3 -2
  167. package/dist/url-vloPOiXd.js +1 -0
  168. package/dist/{useActionDispatchProvider-CNAuaHdm.js → useActionDispatchProvider-DDHrhy3i.js} +1 -1
  169. package/dist/{useActionDispatchProvider-B8-oycQk.mjs → useActionDispatchProvider-MjTckd4f.mjs} +1 -1
  170. package/dist/{useCustomer-DSx-wN-6.js → useCustomer-BW0DBEJh.js} +1 -1
  171. package/dist/{useCustomer-CP8eWUZV.mjs → useCustomer-CxnF7r8Z.mjs} +1 -1
  172. package/dist/{useCustomerFormLabels-TVTgy0MT.js → useCustomerFormLabels-C773h3J0.js} +1 -1
  173. package/dist/{useCustomerFormLabels-DW6jnDYH.mjs → useCustomerFormLabels-zPc8QrwJ.mjs} +5 -5
  174. package/dist/{useExperimentalFeature-CC-DrIcL.js → useExperimentalFeature-9teNYGuP.js} +1 -1
  175. package/dist/{useExperimentalFeature-BvE_EOX-.mjs → useExperimentalFeature-NsSDg-e3.mjs} +1 -1
  176. package/dist/{useInvoiceData-CRRPdXc6.js → useInvoiceData-DvV2AsgC.js} +1 -1
  177. package/dist/{useInvoiceData-D8ds05CX.mjs → useInvoiceData-GQwk6fl4.mjs} +2 -2
  178. package/dist/{useInvoicesList-SJU5YWBQ.mjs → useInvoicesList-CGmFSQSg.mjs} +7 -7
  179. package/dist/{useInvoicesList-DIfQcvER.js → useInvoicesList-Xnth6s6U.js} +1 -1
  180. package/dist/{useLoadInitialData-MUljS38K.mjs → useLoadInitialData-BvvaWeAe.mjs} +1 -1
  181. package/dist/{useLoadInitialData-DsabgMLZ.js → useLoadInitialData-Cjkc70u-.js} +1 -1
  182. package/dist/{usePaymentMethodAvailability-D0NUanyF.mjs → usePaymentMethodAvailability-BWaaj3N3.mjs} +4 -4
  183. package/dist/{usePaymentMethodAvailability-Bt7P9InI.js → usePaymentMethodAvailability-DKyscbom.js} +1 -1
  184. package/dist/{usePaymentMethodOptions-cT1o-BA1.js → usePaymentMethodOptions-DuXKS36F.js} +1 -1
  185. package/dist/{usePaymentMethodOptions-B7JYkGsw.mjs → usePaymentMethodOptions-l-wVAmIW.mjs} +1 -1
  186. package/dist/{usePaymentMethods-DNVw2eVg.js → usePaymentMethods-BDFVB-kK.js} +1 -1
  187. package/dist/{usePaymentMethods-CpzqXQUT.mjs → usePaymentMethods-DvQVnsSV.mjs} +1 -1
  188. package/dist/{usePayments-D9Eo-uBk.js → usePayments-CIJocDhR.js} +1 -1
  189. package/dist/{usePayments-Gx9kBvNB.mjs → usePayments-D_dyuf6S.mjs} +6 -6
  190. package/dist/{usePortal-DsebXdhx.js → usePortal-BU4ibdWq.js} +1 -1
  191. package/dist/{usePortal-3VCZwSUE.mjs → usePortal-Br5lYuPT.mjs} +1 -1
  192. package/dist/{useSubscription-DnL1wVh1.mjs → useSubscription-CqRae2I9.mjs} +1 -1
  193. package/dist/{useSubscription-K_gP9TeX.js → useSubscription-DRBUt9H5.js} +1 -1
  194. package/dist/{useTimePeriod.es-DMtKzcoB.mjs → useTimePeriod.es-BxIGnCAP.mjs} +1 -1
  195. package/dist/{useTimePeriod.es-CmltiTE-.js → useTimePeriod.es-DDos3-EH.js} +1 -1
  196. package/package.json +2 -1
  197. package/dist/Checkout.entry.ce-B5-0AM67.mjs +0 -3747
  198. package/dist/Checkout.entry.ce-C52gkrNZ.js +0 -1
  199. package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +0 -32
  200. package/dist/ContentWithAsideLayout-C6yMIVJF.js +0 -1
  201. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js +0 -1
  202. package/dist/ErrorNotification.vue.es-Cd2UKPAz.js +0 -1
  203. package/dist/IconButton.vue.es-BTAkuFsm.js +0 -1
  204. package/dist/IconButton.vue.es-C4dQEQAc.mjs +0 -198
  205. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-BnilyGBO.mjs +0 -144
  206. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-CSv-Luvz.js +0 -1
  207. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DzSQC951.js +0 -1
  208. package/dist/PaymentIntegrationFormAdyen-DfN7cPYZ.mjs +0 -621
  209. package/dist/PaymentIntegrationFormAdyen-Q48aDXR7.js +0 -98
  210. package/dist/PaymentIntegrationFormStripe-BSEqarl7.js +0 -102
  211. package/dist/PlanCustomizationEditor-XpofGULc.js +0 -1
  212. package/dist/RadioGroupExtended.vue.es-Cb1iD73r.js +0 -1
  213. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-nmVRb6hj.js +0 -1
  214. package/dist/component-5wqcK7yz.mjs +0 -8
  215. package/dist/component-B7ZDyqBp.js +0 -1
  216. package/dist/customElements-Vox1PB6G.js +0 -1211
  217. package/dist/subscriptions-fJcj88X9.js +0 -1
  218. package/dist/url-BNKStNY9.js +0 -1
@@ -1 +1 @@
1
- const e=require("vue"),d=require("./customElements-Vox1PB6G.js"),u=require("./Button.vue.es-M_jXZda4.js"),o={neutral:{base:"bg-gray-50",text:"text-gray-700",border:"border-gray-100"},brand:{base:"bg-primary-50",text:"text-primary-700",border:"border-primary-100"},info:{base:"bg-blue-50",text:"text-blue-700",border:"border-blue-100"},success:{base:"bg-green-50",text:"text-green-700",border:"border-green-100"},warning:{base:"bg-yellow-50",text:"text-yellow-700",border:"border-yellow-100"},danger:{base:"bg-red-50",text:"text-red-700",border:"border-red-100"},emphasis:{base:"bg-teal-50",text:"text-teal-700",border:"border-teal-100"}},c=e.defineComponent({__name:"Chip",props:{intent:{default:"neutral"},content:{},removable:{type:Boolean,default:!1},size:{default:"md"},variant:{default:"default"},textClass:{},tag:{default:"span"},hasChipBefore:{type:Boolean},hasChipAfter:{type:Boolean}},emits:["removed"],setup(t){const a=t,r=e.computed(()=>o[a.intent].base),n=e.computed(()=>o[a.intent].text),s=e.computed(()=>o[a.intent].border);return(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps(l.$attrs,{class:["box-content inline-flex items-center gap-1 whitespace-nowrap rounded-sm border pl-1.5",{"pr-1.5":!t.removable,"h-4 px-1.5":t.size==="xs","h-4":t.size==="sm","h-5":t.size==="md","h-6":t.size==="lg","rounded-r-none":t.hasChipAfter,"rounded-l-none":t.hasChipBefore,[n.value]:!!n.value,[r.value]:!!r.value&&t.variant!=="outline","bg-transparent":t.variant==="outline",[s.value]:!!s.value}]}),{default:e.withCtx(()=>[e.createVNode(e.unref(d._sfc_main),{tag:"span",variant:"body-xs",weight:"normal",color:"inherit",center:"",class:e.normalizeClass([t.textClass,"inline-flex h-full flex-grow items-center justify-center gap-1 leading-none"])},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)])]),_:3},8,["class"]),t.removable?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass([{"h-5 w-4":t.size==="sm","h-5 w-5":t.size==="md","h-5 w-6":t.size==="lg",[r.value]:!!r.value},"flex aspect-square h-full items-center justify-center rounded"]),type:"button",title:"Remove",onClick:i[0]||(i[0]=m=>l.$emit("removed"))},[e.createVNode(e.unref(u._sfc_main$1),{class:e.normalizeClass(n.value),icon:"close",size:"xs"},null,8,["class"])],2)):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});exports._sfc_main=c;
1
+ const e=require("vue"),d=require("./customElements-CSzbVZIH.js"),u=require("./Button.vue.es-TCF-bvDF.js"),o={neutral:{base:"bg-gray-50",text:"text-gray-700",border:"border-gray-100"},brand:{base:"bg-primary-50",text:"text-primary-700",border:"border-primary-100"},info:{base:"bg-blue-50",text:"text-blue-700",border:"border-blue-100"},success:{base:"bg-green-50",text:"text-green-700",border:"border-green-100"},warning:{base:"bg-yellow-50",text:"text-yellow-700",border:"border-yellow-100"},danger:{base:"bg-red-50",text:"text-red-700",border:"border-red-100"},emphasis:{base:"bg-teal-50",text:"text-teal-700",border:"border-teal-100"}},c=e.defineComponent({__name:"Chip",props:{intent:{default:"neutral"},content:{},removable:{type:Boolean,default:!1},size:{default:"md"},variant:{default:"default"},textClass:{},tag:{default:"span"},hasChipBefore:{type:Boolean},hasChipAfter:{type:Boolean}},emits:["removed"],setup(t){const a=t,r=e.computed(()=>o[a.intent].base),n=e.computed(()=>o[a.intent].text),s=e.computed(()=>o[a.intent].border);return(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps(l.$attrs,{class:["box-content inline-flex items-center gap-1 whitespace-nowrap rounded-sm border pl-1.5",{"pr-1.5":!t.removable,"h-4 px-1.5":t.size==="xs","h-4":t.size==="sm","h-5":t.size==="md","h-6":t.size==="lg","rounded-r-none":t.hasChipAfter,"rounded-l-none":t.hasChipBefore,[n.value]:!!n.value,[r.value]:!!r.value&&t.variant!=="outline","bg-transparent":t.variant==="outline",[s.value]:!!s.value}]}),{default:e.withCtx(()=>[e.createVNode(e.unref(d._sfc_main),{tag:"span",variant:"body-xs",weight:"normal",color:"inherit",center:"",class:e.normalizeClass([t.textClass,"inline-flex h-full flex-grow items-center justify-center gap-1 leading-none"])},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)])]),_:3},8,["class"]),t.removable?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass([{"h-5 w-4":t.size==="sm","h-5 w-5":t.size==="md","h-5 w-6":t.size==="lg",[r.value]:!!r.value},"flex aspect-square h-full items-center justify-center rounded"]),type:"button",title:"Remove",onClick:i[0]||(i[0]=m=>l.$emit("removed"))},[e.createVNode(e.unref(u._sfc_main$1),{class:e.normalizeClass(n.value),icon:"close",size:"xs"},null,8,["class"])],2)):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});exports._sfc_main=c;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, computed as o, openBlock as u, createBlock as g, resolveDynamicComponent as x, mergeProps as h, withCtx as m, createVNode as b, unref as c, normalizeClass as l, renderSlot as v, createTextVNode as y, toDisplayString as C, createElementBlock as w, createCommentVNode as p } from "vue";
2
- import { _ as z } from "./customElements-CSE7dwUr.mjs";
3
- import { a as B } from "./Button.vue.es-Dz-2L8dJ.mjs";
2
+ import { _ as z } from "./customElements-DT1YyL4O.mjs";
3
+ import { a as B } from "./Button.vue.es-PbJFK8z7.mjs";
4
4
  const s = {
5
5
  neutral: {
6
6
  base: "bg-gray-50",
@@ -0,0 +1,38 @@
1
+ import { openBlock as o, createElementBlock as e, renderSlot as t, createCommentVNode as l, createElementVNode as a } from "vue";
2
+ const i = (s, r) => {
3
+ const d = s.__vccOpts || s;
4
+ for (const [n, c] of r)
5
+ d[n] = c;
6
+ return d;
7
+ }, _ = {}, u = { class: "sv-layout grid w-full grid-cols-1 gap-4" }, f = {
8
+ key: 0,
9
+ class: "sv-layout__header"
10
+ }, v = { class: "sv-layout__body flex flex-col items-start gap-6 md:flex-row" }, g = { class: "sv-layout__content grid w-full grow grid-cols-1 gap-4 md:w-auto" }, h = {
11
+ key: 0,
12
+ class: "sv-layout__aside grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0"
13
+ }, m = {
14
+ key: 1,
15
+ class: "sv-layout__footer"
16
+ };
17
+ function y(s, r) {
18
+ return o(), e("div", u, [
19
+ s.$slots.header ? (o(), e("div", f, [
20
+ t(s.$slots, "header")
21
+ ])) : l("", !0),
22
+ a("div", v, [
23
+ a("div", g, [
24
+ t(s.$slots, "content")
25
+ ]),
26
+ s.$slots.aside ? (o(), e("aside", h, [
27
+ t(s.$slots, "aside")
28
+ ])) : l("", !0)
29
+ ]),
30
+ s.$slots.footer ? (o(), e("div", m, [
31
+ t(s.$slots, "footer")
32
+ ])) : l("", !0)
33
+ ]);
34
+ }
35
+ const k = /* @__PURE__ */ i(_, [["render", y]]);
36
+ export {
37
+ k as C
38
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),n=(o,t)=>{const s=o.__vccOpts||o;for(const[l,r]of t)s[l]=r;return s},c={},d={class:"sv-layout grid w-full grid-cols-1 gap-4"},a={key:0,class:"sv-layout__header"},i={class:"sv-layout__body flex flex-col items-start gap-6 md:flex-row"},_={class:"sv-layout__content grid w-full grow grid-cols-1 gap-4 md:w-auto"},u={key:0,class:"sv-layout__aside grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0"},m={key:1,class:"sv-layout__footer"};function f(o,t){return e.openBlock(),e.createElementBlock("div",d,[o.$slots.header?(e.openBlock(),e.createElementBlock("div",a,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0),e.createElementVNode("div",i,[e.createElementVNode("div",_,[e.renderSlot(o.$slots,"content")]),o.$slots.aside?(e.openBlock(),e.createElementBlock("aside",u,[e.renderSlot(o.$slots,"aside")])):e.createCommentVNode("",!0)]),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",m,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)])}const v=n(c,[["render",f]]);exports.ContentWithAsideLayout=v;
@@ -1 +1 @@
1
- const e=require("vue"),u=require("./floating-ui.vue.es-Bly3DGWm.js"),f=require("./customElements-Vox1PB6G.js"),k=require("./Button.vue.es-M_jXZda4.js"),w=require("./DividerText.vue.es-D-QxT2OD.js"),g=require("./Divider.vue.es-UwnWvUTl.js"),h=require("./index.es-BclokHQX.js"),$=require("./object.es-CdriXMPs.js"),S=require("./Chip.vue.es-G8doKsZb.js"),V=e.defineComponent({__name:"FullClickableBlock",props:{tag:{default:"div"}},setup(t){return(o,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),{class:"relative"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3}))}}),E={},M={class:"appearance-none after:absolute after:inset-0"};function F(t,o){return e.openBlock(),e.createElementBlock("button",M,[e.renderSlot(t.$slots,"default")])}const D=u._export_sfc(E,[["render",F]]),N={key:0},T={key:1},P=e.defineComponent({__name:"ListGroupItem",props:{disabled:{type:Boolean,default:!1},onClick:{},dataTestid:{},variant:{}},setup(t){return(o,l)=>(e.openBlock(),e.createBlock(e.unref(V),{tag:"li",class:e.normalizeClass(["w-full border-b border-gray-200 px-4 py-2 transition-colors",{block:!t.disabled&&t.onClick,"focus-within:bg-gray-50 focus-within:text-default hover:bg-gray-50 hover:text-default":!t.disabled&&t.onClick&&t.variant!=="danger","text-red-700 focus-within:bg-red-50 focus-within:text-red-700 hover:bg-red-50":!t.disabled&&t.onClick&&t.variant==="danger","cursor-not-allowed bg-gray-50 text-disabled":t.disabled}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.onClick?e.unref(D):"span"),{class:"flex w-full items-start gap-2 text-left focus:outline-none active:outline-none",disabled:t.onClick?t.disabled:void 0,type:t.onClick?"button":void 0,"data-testid":t.dataTestid,onClick:l[0]||(l[0]=n=>{var s;return(s=t.onClick)==null?void 0:s.call(t)})},{default:e.withCtx(()=>[o.$slots.prefix?(e.openBlock(),e.createElementBlock("div",N,[e.renderSlot(o.$slots,"prefix")])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default"),o.$slots.suffix?(e.openBlock(),e.createElementBlock("div",T,[e.renderSlot(o.$slots,"suffix")])):e.createCommentVNode("",!0)]),_:3},8,["disabled","type","data-testid"])),o.$slots.description?(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{key:0,tag:"span",variant:"body-xs",class:"mt-0.5 font-normal",color:t.disabled?"inherit":"secondary"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"description")]),_:3},8,["color"])):e.createCommentVNode("",!0)]),_:3},8,["class"]))}}),y=e.defineComponent({__name:"ContextMenuItem",props:{icon:{},label:{},description:{},labelSuffixComponent:{},labelPrefixComponent:{},onClick:{type:Function},classes:{},variant:{},testId:{},disabled:{type:Boolean},active:{type:Boolean}},setup(t){return(o,l)=>(e.openBlock(),e.createBlock(e.unref(P),{class:e.normalizeClass(["border-none",{[`${t.classes}`]:!!t.classes,"bg-primary-50 text-primary-700":t.active}]),"data-testid":t.testId,disabled:t.disabled,variant:t.variant,onClick:t.onClick},e.createSlots({default:e.withCtx(()=>[t.labelPrefixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelPrefixComponent.component),e.normalizeProps(e.mergeProps({key:0},t.labelPrefixComponent.props)),null,16)):e.createCommentVNode("",!0),e.createVNode(e.unref(f._sfc_main),{tag:"span",variant:"body-sm",color:"inherit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1}),t.labelSuffixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelSuffixComponent.component),e.mergeProps({key:1},t.labelSuffixComponent.props,{class:"ml-2"}),null,16)):e.createCommentVNode("",!0)]),_:2},[t.icon?{name:"prefix",fn:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main$1),{icon:t.icon},null,8,["icon"])]),key:"0"}:void 0,t.description?{name:"description",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),key:"1"}:void 0]),1032,["class","data-testid","disabled","variant","onClick"]))}}),z=e.defineComponent({__name:"ContextMenuGroup",props:{label:{},items:{}},setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(w._sfc_main),{"has-outer-divider":""},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{class:"py-2",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[n==="divider"?(e.openBlock(),e.createBlock(e.unref(g._sfc_main),{key:0})):n.label?(e.openBlock(),e.createBlock(y,{key:1,label:n.label,"on-click":n.onClick,icon:n.icon,variant:n.variant,classes:n.classes,"label-suffix-component":n.labelSuffixComponent,"label-prefix-component":n.labelPrefixComponent,disabled:n.disabled,active:n.active},null,8,["label","on-click","icon","variant","classes","label-suffix-component","label-prefix-component","disabled","active"])):e.createCommentVNode("",!0)],64))),128))],64))}}),q={};function A(t,o){return e.openBlock(),e.createBlock(e.TransitionGroup,{"enter-active-class":"duration-100 ease-out transform-gpu","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-100 ease-in transform-gpu","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3})}const B=u._export_sfc(q,[["render",A]]),p=(t,o=!0,l=[])=>(t.forEach(n=>{if(n!==null){if(typeof n!="object"){(typeof n=="string"||typeof n=="number")&&l.push(e.createTextVNode(String(n)));return}if(Array.isArray(n)){p(n,o,l);return}if(n.type===e.Fragment){if(n.children===null)return;Array.isArray(n.children)&&p(n.children,o,l)}else n.type!==e.Comment&&l.push(n)}}),l),j=(t,o="default",l=void 0)=>{const n=t[o];if(!n)return null;const s=p(n(l));return s.length===1?s[0]:null},I={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"]};function L(t,o){Object.entries(I).forEach(([,l])=>{l.forEach(n=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[n],d=o[n];s?t.props[n]=(...a)=>{s(...a),d(...a)}:t.props[n]=d})})}const C=e.defineComponent({name:"SlotListener",props:{trigger:{type:String,default:"click"}},emits:["click","focus","blur","mouseenter","mouseleave"],setup(t,{emit:o}){return{handleClick:r=>{o("click",r)},handleBlur:r=>{o("blur",r)},handleFocus:r=>{o("focus",r)},handleMouseLeave:r=>{o("mouseleave",r)},handleMouseEnter:r=>{o("mouseenter",r)}}},render(){const{$slots:t}=this,o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur},l=j(t,"default"),n=[o];return l!=null&&l.props&&n.push($.pick(l.props,"onClick","onMouseenter","onMouseleave","onFocus","onBlur")),l&&L(l,{onBlur:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onBlur)==null||r.call(a,d)})},onFocus:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onFocus)==null||r.call(a,d)})},onClick:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onClick)==null||r.call(a,d)})},onMouseenter:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onMouseenter)==null||r.call(a,d)})},onMouseleave:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onMouseleave)==null||r.call(a,d)})}}),l}}),O=["id"],x=e.defineComponent({__name:"Portal",props:{to:{},name:{},disabled:{type:Boolean}},setup(t){const o=t,l=o.to?e.inject(f.getPortalInjectKey(o.to),null):null,n=l!==null;return e.onMounted(()=>{if(!(o.name||o.to))throw new Error("Define either the `to` or the `name` prop.")}),(s,d)=>t.name?(e.openBlock(),e.createElementBlock("div",{key:0,id:`portal-${t.name}`},null,8,O)):t.to&&n&&e.unref(l)?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:e.unref(l),disabled:t.disabled},[e.renderSlot(s.$slots,"default")],8,["to","disabled"])):t.to&&!n?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:`#portal-${t.to}`,disabled:t.disabled},[e.renderSlot(s.$slots,"default")],8,["to","disabled"])):e.createCommentVNode("",!0)}}),H={class:"inline-flex items-center"},G=e.defineComponent({__name:"Dropdown",props:{placement:{default:"bottom-end"},text:{default:""},transition:{default:""},offset:{default:8},disabled:{type:Boolean},isPortalDisabled:{type:Boolean},dropdownClass:{}},setup(t){const o=t,l=e.ref(!1),n=()=>l.value=!1,s=()=>{o.disabled||(l.value=!l.value)},d={bottom:"to-bottom","bottom-start":"to-bottom","bottom-end":"to-bottom",left:"to-left","left-start":"to-left","left-end":"to-left",right:"to-right","right-start":"to-right","right-end":"to-right",top:"to-top","top-start":"to-top","top-end":"to-top"},a=e.ref(),r=e.ref(),c=e.ref(),i=e.computed(()=>o.transition===null?d[o.placement]:o.transition),{floatingStyles:m}=u.useFloating(c,r,{whileElementsMounted:u.autoUpdate,placement:o.placement,middleware:[u.offset(o.offset),u.flip()]});return h.onClickOutside(c,()=>{l.value&&(l.value=!1)}),h.onKeyStroke("Escape",()=>{l.value=!1}),(b,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapper",ref:c,class:"relative inline-flex"},[e.createElementVNode("div",H,[e.createVNode(e.unref(C),{onClick:s},{default:e.withCtx(()=>[e.renderSlot(b.$slots,"trigger",{visible:l.value},()=>[e.createVNode(e.unref(k._sfc_main),{ref_key:"trigger",ref:a},{suffix:e.withCtx(()=>[...v[0]||(v[0]=[e.createElementVNode("svg",{class:"ml-2 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text)+" ",1)]),_:1},512)],!0)]),_:3})]),e.createVNode(e.unref(x),{to:e.unref(f.DROPDOWN_PORTAL_NAME),disabled:t.isPortalDisabled},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:i.value},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"content",ref:r,style:e.normalizeStyle(e.unref(m)),class:e.normalizeClass(["z-60 divide-y divide-gray-100 rounded bg-white shadow",t.dropdownClass])},[e.createVNode(e.unref(C),{onClick:n},{default:e.withCtx(()=>[e.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3})],6)):e.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["to","disabled"])],512))}}),R=u._export_sfc(G,[["__scopeId","data-v-c0f85806"]]),K=e.defineComponent({__name:"ListGroup",props:{width:{default:"default"}},setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(["overflow-hidden rounded border border-gray-200 bg-white text-sm font-medium",{"w-48":t.width==="default","w-64":t.width==="wide"}])},[e.renderSlot(o.$slots,"default")],2))}}),U={class:"relative inline-flex"},W=e.defineComponent({inheritAttrs:!1,__name:"ContextMenu",props:{items:{},icon:{default:"more_vert"},square:{type:Boolean,default:!1},outlined:{type:Boolean},width:{},disabled:{type:Boolean,default:void 0},isPortalDisabled:{type:Boolean},triggerSize:{default:"sm"},dropdownClass:{},showActiveCount:{type:Boolean,default:!0}},setup(t){const o=t,l=e.useSlots(),n=e.computed(()=>{var a,r;return o.disabled??(((r=((a=o.items)==null?void 0:a.flatMap(c=>c!=="divider"&&"items"in c?c.items:c))??[])==null?void 0:r.filter(c=>c!=="divider").every(c=>c.disabled))&&!l.default)}),s=a=>(a??[]).reduce((r,c)=>c==="divider"?r:"items"in c?r+s(c.items):r+(c.active?1:0),0),d=e.computed(()=>s(o.items));return(a,r)=>(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(e.unref(B),null,{default:e.withCtx(()=>{var c;return[(c=t.items)!=null&&c.length||a.$slots.default||t.disabled?(e.openBlock(),e.createBlock(e.unref(R),e.mergeProps({key:0,"is-portal-disabled":n.value},a.$attrs,{"dropdown-class":t.dropdownClass}),{trigger:e.withCtx(({visible:i})=>[e.renderSlot(a.$slots,"trigger",{visible:i},()=>[e.createVNode(e.unref(k._sfc_main),{type:"button",pill:!t.square,square:"",intent:t.outlined?"secondary":"subtle",size:t.triggerSize,"data-testid":"context-menu",disabled:n.value,"icon-prefix":t.icon,onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},null,8,["pill","intent","size","disabled","icon-prefix"])])]),default:e.withCtx(()=>[t.items||a.$slots.default?(e.openBlock(),e.createBlock(e.unref(K),{key:0,width:t.width,class:"z-60 p-0.5"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"header"),t.items?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.items,(i,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[i==="divider"&&m<t.items.length-1?(e.openBlock(),e.createBlock(e.unref(g._sfc_main),{key:0,spacing:"none"})):i!=="divider"&&!("items"in i)?(e.openBlock(),e.createBlock(y,{key:1,label:i.label,variant:i.variant,icon:i.icon,"label-suffix-component":i.labelSuffixComponent,"label-prefix-component":i.labelPrefixComponent,description:i.description,classes:i.classes,"test-id":i.testId,disabled:i.disabled,active:i.active,onClick:i.onClick},null,8,["label","variant","icon","label-suffix-component","label-prefix-component","description","classes","test-id","disabled","active","onClick"])):i!=="divider"?(e.openBlock(),e.createBlock(z,{key:2,class:"rounded-sm",label:i.label,items:i.items},null,8,["label","items"])):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")]),_:3},8,["width"])):e.createCommentVNode("",!0)]),_:3},16,["is-portal-disabled","dropdown-class"])):e.createCommentVNode("",!0)]}),_:3}),t.showActiveCount&&d.value>0?(e.openBlock(),e.createBlock(e.unref(S._sfc_main),{key:0,size:"xs",intent:"brand",class:"pointer-events-none absolute -right-1.5 -top-1.5","data-testid":"context-menu-active-count"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})):e.createCommentVNode("",!0)]))}});exports.Fade=B;exports._sfc_main=x;exports._sfc_main$1=W;
1
+ const e=require("vue"),u=require("./floating-ui.vue.es-Bly3DGWm.js"),f=require("./customElements-CSzbVZIH.js"),k=require("./Button.vue.es-TCF-bvDF.js"),w=require("./DividerText.vue.es-LJ2kZakb.js"),g=require("./Divider.vue.es-UwnWvUTl.js"),h=require("./index.es-BclokHQX.js"),$=require("./object.es-CdriXMPs.js"),S=require("./Chip.vue.es-CAoisngJ.js"),V=e.defineComponent({__name:"FullClickableBlock",props:{tag:{default:"div"}},setup(t){return(o,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),{class:"relative"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3}))}}),E={},M={class:"appearance-none after:absolute after:inset-0"};function F(t,o){return e.openBlock(),e.createElementBlock("button",M,[e.renderSlot(t.$slots,"default")])}const D=u._export_sfc(E,[["render",F]]),N={key:0},T={key:1},P=e.defineComponent({__name:"ListGroupItem",props:{disabled:{type:Boolean,default:!1},onClick:{},dataTestid:{},variant:{}},setup(t){return(o,l)=>(e.openBlock(),e.createBlock(e.unref(V),{tag:"li",class:e.normalizeClass(["w-full border-b border-gray-200 px-4 py-2 transition-colors",{block:!t.disabled&&t.onClick,"focus-within:bg-gray-50 focus-within:text-default hover:bg-gray-50 hover:text-default":!t.disabled&&t.onClick&&t.variant!=="danger","text-red-700 focus-within:bg-red-50 focus-within:text-red-700 hover:bg-red-50":!t.disabled&&t.onClick&&t.variant==="danger","cursor-not-allowed bg-gray-50 text-disabled":t.disabled}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.onClick?e.unref(D):"span"),{class:"flex w-full items-start gap-2 text-left focus:outline-none active:outline-none",disabled:t.onClick?t.disabled:void 0,type:t.onClick?"button":void 0,"data-testid":t.dataTestid,onClick:l[0]||(l[0]=n=>{var s;return(s=t.onClick)==null?void 0:s.call(t)})},{default:e.withCtx(()=>[o.$slots.prefix?(e.openBlock(),e.createElementBlock("div",N,[e.renderSlot(o.$slots,"prefix")])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default"),o.$slots.suffix?(e.openBlock(),e.createElementBlock("div",T,[e.renderSlot(o.$slots,"suffix")])):e.createCommentVNode("",!0)]),_:3},8,["disabled","type","data-testid"])),o.$slots.description?(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{key:0,tag:"span",variant:"body-xs",class:"mt-0.5 font-normal",color:t.disabled?"inherit":"secondary"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"description")]),_:3},8,["color"])):e.createCommentVNode("",!0)]),_:3},8,["class"]))}}),y=e.defineComponent({__name:"ContextMenuItem",props:{icon:{},label:{},description:{},labelSuffixComponent:{},labelPrefixComponent:{},onClick:{type:Function},classes:{},variant:{},testId:{},disabled:{type:Boolean},active:{type:Boolean}},setup(t){return(o,l)=>(e.openBlock(),e.createBlock(e.unref(P),{class:e.normalizeClass(["border-none",{[`${t.classes}`]:!!t.classes,"bg-primary-50 text-primary-700":t.active}]),"data-testid":t.testId,disabled:t.disabled,variant:t.variant,onClick:t.onClick},e.createSlots({default:e.withCtx(()=>[t.labelPrefixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelPrefixComponent.component),e.normalizeProps(e.mergeProps({key:0},t.labelPrefixComponent.props)),null,16)):e.createCommentVNode("",!0),e.createVNode(e.unref(f._sfc_main),{tag:"span",variant:"body-sm",color:"inherit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1}),t.labelSuffixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelSuffixComponent.component),e.mergeProps({key:1},t.labelSuffixComponent.props,{class:"ml-2"}),null,16)):e.createCommentVNode("",!0)]),_:2},[t.icon?{name:"prefix",fn:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main$1),{icon:t.icon},null,8,["icon"])]),key:"0"}:void 0,t.description?{name:"description",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),key:"1"}:void 0]),1032,["class","data-testid","disabled","variant","onClick"]))}}),z=e.defineComponent({__name:"ContextMenuGroup",props:{label:{},items:{}},setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(w._sfc_main),{"has-outer-divider":""},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{class:"py-2",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[n==="divider"?(e.openBlock(),e.createBlock(e.unref(g._sfc_main),{key:0})):n.label?(e.openBlock(),e.createBlock(y,{key:1,label:n.label,"on-click":n.onClick,icon:n.icon,variant:n.variant,classes:n.classes,"label-suffix-component":n.labelSuffixComponent,"label-prefix-component":n.labelPrefixComponent,disabled:n.disabled,active:n.active},null,8,["label","on-click","icon","variant","classes","label-suffix-component","label-prefix-component","disabled","active"])):e.createCommentVNode("",!0)],64))),128))],64))}}),q={};function A(t,o){return e.openBlock(),e.createBlock(e.TransitionGroup,{"enter-active-class":"duration-100 ease-out transform-gpu","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-100 ease-in transform-gpu","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3})}const B=u._export_sfc(q,[["render",A]]),p=(t,o=!0,l=[])=>(t.forEach(n=>{if(n!==null){if(typeof n!="object"){(typeof n=="string"||typeof n=="number")&&l.push(e.createTextVNode(String(n)));return}if(Array.isArray(n)){p(n,o,l);return}if(n.type===e.Fragment){if(n.children===null)return;Array.isArray(n.children)&&p(n.children,o,l)}else n.type!==e.Comment&&l.push(n)}}),l),j=(t,o="default",l=void 0)=>{const n=t[o];if(!n)return null;const s=p(n(l));return s.length===1?s[0]:null},I={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"]};function L(t,o){Object.entries(I).forEach(([,l])=>{l.forEach(n=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[n],d=o[n];s?t.props[n]=(...a)=>{s(...a),d(...a)}:t.props[n]=d})})}const C=e.defineComponent({name:"SlotListener",props:{trigger:{type:String,default:"click"}},emits:["click","focus","blur","mouseenter","mouseleave"],setup(t,{emit:o}){return{handleClick:r=>{o("click",r)},handleBlur:r=>{o("blur",r)},handleFocus:r=>{o("focus",r)},handleMouseLeave:r=>{o("mouseleave",r)},handleMouseEnter:r=>{o("mouseenter",r)}}},render(){const{$slots:t}=this,o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur},l=j(t,"default"),n=[o];return l!=null&&l.props&&n.push($.pick(l.props,"onClick","onMouseenter","onMouseleave","onFocus","onBlur")),l&&L(l,{onBlur:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onBlur)==null||r.call(a,d)})},onFocus:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onFocus)==null||r.call(a,d)})},onClick:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onClick)==null||r.call(a,d)})},onMouseenter:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onMouseenter)==null||r.call(a,d)})},onMouseleave:d=>{n.forEach(a=>{var r;(r=a==null?void 0:a.onMouseleave)==null||r.call(a,d)})}}),l}}),O=["id"],x=e.defineComponent({__name:"Portal",props:{to:{},name:{},disabled:{type:Boolean}},setup(t){const o=t,l=o.to?e.inject(f.getPortalInjectKey(o.to),null):null,n=l!==null;return e.onMounted(()=>{if(!(o.name||o.to))throw new Error("Define either the `to` or the `name` prop.")}),(s,d)=>t.name?(e.openBlock(),e.createElementBlock("div",{key:0,id:`portal-${t.name}`},null,8,O)):t.to&&n&&e.unref(l)?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:e.unref(l),disabled:t.disabled},[e.renderSlot(s.$slots,"default")],8,["to","disabled"])):t.to&&!n?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:`#portal-${t.to}`,disabled:t.disabled},[e.renderSlot(s.$slots,"default")],8,["to","disabled"])):e.createCommentVNode("",!0)}}),H={class:"inline-flex items-center"},G=e.defineComponent({__name:"Dropdown",props:{placement:{default:"bottom-end"},text:{default:""},transition:{default:""},offset:{default:8},disabled:{type:Boolean},isPortalDisabled:{type:Boolean},dropdownClass:{}},setup(t){const o=t,l=e.ref(!1),n=()=>l.value=!1,s=()=>{o.disabled||(l.value=!l.value)},d={bottom:"to-bottom","bottom-start":"to-bottom","bottom-end":"to-bottom",left:"to-left","left-start":"to-left","left-end":"to-left",right:"to-right","right-start":"to-right","right-end":"to-right",top:"to-top","top-start":"to-top","top-end":"to-top"},a=e.ref(),r=e.ref(),c=e.ref(),i=e.computed(()=>o.transition===null?d[o.placement]:o.transition),{floatingStyles:m}=u.useFloating(c,r,{whileElementsMounted:u.autoUpdate,placement:o.placement,middleware:[u.offset(o.offset),u.flip()]});return h.onClickOutside(c,()=>{l.value&&(l.value=!1)}),h.onKeyStroke("Escape",()=>{l.value=!1}),(b,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapper",ref:c,class:"relative inline-flex"},[e.createElementVNode("div",H,[e.createVNode(e.unref(C),{onClick:s},{default:e.withCtx(()=>[e.renderSlot(b.$slots,"trigger",{visible:l.value},()=>[e.createVNode(e.unref(k._sfc_main),{ref_key:"trigger",ref:a},{suffix:e.withCtx(()=>[...v[0]||(v[0]=[e.createElementVNode("svg",{class:"ml-2 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text)+" ",1)]),_:1},512)],!0)]),_:3})]),e.createVNode(e.unref(x),{to:e.unref(f.DROPDOWN_PORTAL_NAME),disabled:t.isPortalDisabled},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:i.value},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"content",ref:r,style:e.normalizeStyle(e.unref(m)),class:e.normalizeClass(["z-60 divide-y divide-gray-100 rounded bg-white shadow",t.dropdownClass])},[e.createVNode(e.unref(C),{onClick:n},{default:e.withCtx(()=>[e.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3})],6)):e.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["to","disabled"])],512))}}),R=u._export_sfc(G,[["__scopeId","data-v-c0f85806"]]),K=e.defineComponent({__name:"ListGroup",props:{width:{default:"default"}},setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(["overflow-hidden rounded border border-gray-200 bg-white text-sm font-medium",{"w-48":t.width==="default","w-64":t.width==="wide"}])},[e.renderSlot(o.$slots,"default")],2))}}),U={class:"relative inline-flex"},W=e.defineComponent({inheritAttrs:!1,__name:"ContextMenu",props:{items:{},icon:{default:"more_vert"},square:{type:Boolean,default:!1},outlined:{type:Boolean},width:{},disabled:{type:Boolean,default:void 0},isPortalDisabled:{type:Boolean},triggerSize:{default:"sm"},dropdownClass:{},showActiveCount:{type:Boolean,default:!0}},setup(t){const o=t,l=e.useSlots(),n=e.computed(()=>{var a,r;return o.disabled??(((r=((a=o.items)==null?void 0:a.flatMap(c=>c!=="divider"&&"items"in c?c.items:c))??[])==null?void 0:r.filter(c=>c!=="divider").every(c=>c.disabled))&&!l.default)}),s=a=>(a??[]).reduce((r,c)=>c==="divider"?r:"items"in c?r+s(c.items):r+(c.active?1:0),0),d=e.computed(()=>s(o.items));return(a,r)=>(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(e.unref(B),null,{default:e.withCtx(()=>{var c;return[(c=t.items)!=null&&c.length||a.$slots.default||t.disabled?(e.openBlock(),e.createBlock(e.unref(R),e.mergeProps({key:0,"is-portal-disabled":n.value},a.$attrs,{"dropdown-class":t.dropdownClass}),{trigger:e.withCtx(({visible:i})=>[e.renderSlot(a.$slots,"trigger",{visible:i},()=>[e.createVNode(e.unref(k._sfc_main),{type:"button",pill:!t.square,square:"",intent:t.outlined?"secondary":"subtle",size:t.triggerSize,"data-testid":"context-menu",disabled:n.value,"icon-prefix":t.icon,onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},null,8,["pill","intent","size","disabled","icon-prefix"])])]),default:e.withCtx(()=>[t.items||a.$slots.default?(e.openBlock(),e.createBlock(e.unref(K),{key:0,width:t.width,class:"z-60 p-0.5"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"header"),t.items?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.items,(i,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[i==="divider"&&m<t.items.length-1?(e.openBlock(),e.createBlock(e.unref(g._sfc_main),{key:0,spacing:"none"})):i!=="divider"&&!("items"in i)?(e.openBlock(),e.createBlock(y,{key:1,label:i.label,variant:i.variant,icon:i.icon,"label-suffix-component":i.labelSuffixComponent,"label-prefix-component":i.labelPrefixComponent,description:i.description,classes:i.classes,"test-id":i.testId,disabled:i.disabled,active:i.active,onClick:i.onClick},null,8,["label","variant","icon","label-suffix-component","label-prefix-component","description","classes","test-id","disabled","active","onClick"])):i!=="divider"?(e.openBlock(),e.createBlock(z,{key:2,class:"rounded-sm",label:i.label,items:i.items},null,8,["label","items"])):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")]),_:3},8,["width"])):e.createCommentVNode("",!0)]),_:3},16,["is-portal-disabled","dropdown-class"])):e.createCommentVNode("",!0)]}),_:3}),t.showActiveCount&&d.value>0?(e.openBlock(),e.createBlock(e.unref(S._sfc_main),{key:0,size:"xs",intent:"brand",class:"pointer-events-none absolute -right-1.5 -top-1.5","data-testid":"context-menu-active-count"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})):e.createCommentVNode("",!0)]))}});exports.Fade=B;exports._sfc_main=x;exports._sfc_main$1=W;
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as g, openBlock as s, createBlock as b, resolveDynamicComponent as x, withCtx as r, renderSlot as m, createElementBlock as p, unref as i, withModifiers as I, normalizeClass as M, createCommentVNode as v, createSlots as G, normalizeProps as q, mergeProps as S, createVNode as h, createTextVNode as k, toDisplayString as C, Fragment as y, renderList as L, TransitionGroup as R, Comment as K, inject as U, onMounted as W, Teleport as z, ref as w, computed as E, createElementVNode as B, Transition as J, normalizeStyle as Q, useSlots as X } from "vue";
2
2
  import { _ as P, u as Y, a as Z, o as N, f as _ } from "./floating-ui.vue.es-CYt0fSY7.mjs";
3
- import { _ as D, j as ee, D as te } from "./customElements-CSE7dwUr.mjs";
4
- import { a as ne, _ as V } from "./Button.vue.es-Dz-2L8dJ.mjs";
5
- import { _ as le } from "./DividerText.vue.es-IK2fns6f.mjs";
3
+ import { _ as D, j as ee, D as te } from "./customElements-DT1YyL4O.mjs";
4
+ import { a as ne, _ as V } from "./Button.vue.es-PbJFK8z7.mjs";
5
+ import { _ as le } from "./DividerText.vue.es-CSE7a-T0.mjs";
6
6
  import { _ as O } from "./Divider.vue.es-DnP_HqLz.mjs";
7
7
  import { e as oe, o as ae } from "./index.es-CXkP_k3u.mjs";
8
8
  import { p as se } from "./object.es-8aLDIncs.mjs";
9
- import { _ as ie } from "./Chip.vue.es-DMK9C78d.mjs";
9
+ import { _ as ie } from "./Chip.vue.es-DpcOM3Ai.mjs";
10
10
  const re = /* @__PURE__ */ g({
11
11
  __name: "FullClickableBlock",
12
12
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as x, computed as v, openBlock as c, createBlock as C, withCtx as i, createElementBlock as d, createVNode as o, createTextVNode as a, toDisplayString as r, unref as u, createCommentVNode as b, renderSlot as B } from "vue";
2
- import { u as N, _ as l } from "./customElements-CSE7dwUr.mjs";
3
- import { _ as S } from "./Section.vue.es-DQ5H7mqW.mjs";
2
+ import { u as N, _ as l } from "./customElements-DT1YyL4O.mjs";
3
+ import { _ as S } from "./Section.vue.es-KRsHeFoT.mjs";
4
4
  import { g as k } from "./getCountryNameByCode.es-BDHua7VM.mjs";
5
5
  import { a as A } from "./customer.es-B5ppZf0j.mjs";
6
6
  import { a as M } from "./typeGuards.es-B4XMtlkM.mjs";
@@ -1 +1 @@
1
- const e=require("vue"),n=require("./customElements-Vox1PB6G.js"),g=require("./Section.vue.es-Btff-cLY.js"),_=require("./getCountryNameByCode.es-Xxc0nZsH.js"),h=require("./customer.es-BButyYo0.js"),b=require("./typeGuards.es-DS3vZaJn.js"),y=["US","CA"];function v(t){if(y.includes(t.country)){const c=a([t.line1,t.line2],", "),r=a([t.state,t.postal_code]," "),u=_.getCountryNameByCode(t.country);return a([c,t.city,r,u],", ")}const i=a([t.line1,t.line2]," "),l=a([t.postal_code,t.city]," "),s=_.getCountryNameByCode(t.country);return a([i,l,t.state,s],", ")}function a(t,o){return t.filter(Boolean).join(o)}const p={key:0,class:"flex flex-col gap-2"},N={key:0},x={key:1},C={key:2},k={key:3},V={key:1},T=e.defineComponent({__name:"CustomerBillingInformation",props:{customer:{},title:{},fallbackToReference:{type:Boolean,default:!0}},setup(t){const{$t:o}=n.useIntl(),i=t,l=e.computed(()=>{if(!i.customer)return;const r=h.getCustomerName(i.customer);if(i.fallbackToReference&&r==="")return i.customer.reference;if(!(!i.fallbackToReference&&r===""))return r}),s=e.computed(()=>i.title||o({defaultMessage:"Billing information",description:"Title for the billing information",id:"customer_billing_information.title"})),c=e.computed(()=>{if(i.customer){if("individual"in i.customer)return i.customer.individual.residential_address;if("organization"in i.customer)return i.customer.organization.registered_address}});return(r,u)=>(e.openBlock(),e.createBlock(g._sfc_main,{title:s.value},{right:e.withCtx(()=>[e.renderSlot(r.$slots,"settings")]),default:e.withCtx(()=>{var d;return[t.customer?(e.openBlock(),e.createElementBlock("div",p,[l.value?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Name",description:"The label for the customer name in the billing information",id:"customer_billing_information.name_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})])):e.createCommentVNode("",!0),(d=c.value)!=null&&d.line1?(e.openBlock(),e.createElementBlock("div",x,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Billing address",description:"The label for the customer billing address in the billing information",id:"customer_billing_information.billing_address_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)(c.value)),1)]),_:1})])):e.createCommentVNode("",!0),t.customer.email?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Email address",description:"The label for the customer email address in the billing information",id:"customer_billing_information.email_address_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.customer.email),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(b.isOrganization)(t.customer)?(e.openBlock(),e.createElementBlock("div",k,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"VAT number",description:"The label for the customer Vat number in the billing information",id:"customer_billing_information.vat_number_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>{var m,f;return[e.createTextVNode(e.toDisplayString((f=(m=t.customer.organization.tax_ids)==null?void 0:m[0])==null?void 0:f.id),1)]}),_:1})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(n._sfc_main,{variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"No billing information to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.billing_information.no_billing_information_available"})),1)]),_:1})]))]}),_:3},8,["title"]))}});exports._sfc_main=T;
1
+ const e=require("vue"),n=require("./customElements-CSzbVZIH.js"),g=require("./Section.vue.es-CBZx5x53.js"),_=require("./getCountryNameByCode.es-Xxc0nZsH.js"),h=require("./customer.es-BButyYo0.js"),b=require("./typeGuards.es-DS3vZaJn.js"),y=["US","CA"];function v(t){if(y.includes(t.country)){const c=a([t.line1,t.line2],", "),r=a([t.state,t.postal_code]," "),u=_.getCountryNameByCode(t.country);return a([c,t.city,r,u],", ")}const i=a([t.line1,t.line2]," "),l=a([t.postal_code,t.city]," "),s=_.getCountryNameByCode(t.country);return a([i,l,t.state,s],", ")}function a(t,o){return t.filter(Boolean).join(o)}const p={key:0,class:"flex flex-col gap-2"},N={key:0},x={key:1},C={key:2},k={key:3},V={key:1},T=e.defineComponent({__name:"CustomerBillingInformation",props:{customer:{},title:{},fallbackToReference:{type:Boolean,default:!0}},setup(t){const{$t:o}=n.useIntl(),i=t,l=e.computed(()=>{if(!i.customer)return;const r=h.getCustomerName(i.customer);if(i.fallbackToReference&&r==="")return i.customer.reference;if(!(!i.fallbackToReference&&r===""))return r}),s=e.computed(()=>i.title||o({defaultMessage:"Billing information",description:"Title for the billing information",id:"customer_billing_information.title"})),c=e.computed(()=>{if(i.customer){if("individual"in i.customer)return i.customer.individual.residential_address;if("organization"in i.customer)return i.customer.organization.registered_address}});return(r,u)=>(e.openBlock(),e.createBlock(g._sfc_main,{title:s.value},{right:e.withCtx(()=>[e.renderSlot(r.$slots,"settings")]),default:e.withCtx(()=>{var d;return[t.customer?(e.openBlock(),e.createElementBlock("div",p,[l.value?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Name",description:"The label for the customer name in the billing information",id:"customer_billing_information.name_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})])):e.createCommentVNode("",!0),(d=c.value)!=null&&d.line1?(e.openBlock(),e.createElementBlock("div",x,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Billing address",description:"The label for the customer billing address in the billing information",id:"customer_billing_information.billing_address_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)(c.value)),1)]),_:1})])):e.createCommentVNode("",!0),t.customer.email?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Email address",description:"The label for the customer email address in the billing information",id:"customer_billing_information.email_address_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.customer.email),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(b.isOrganization)(t.customer)?(e.openBlock(),e.createElementBlock("div",k,[e.createVNode(n._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"VAT number",description:"The label for the customer Vat number in the billing information",id:"customer_billing_information.vat_number_label"})),1)]),_:1}),e.createVNode(n._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>{var m,f;return[e.createTextVNode(e.toDisplayString((f=(m=t.customer.organization.tax_ids)==null?void 0:m[0])==null?void 0:f.id),1)]}),_:1})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(n._sfc_main,{variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"No billing information to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.billing_information.no_billing_information_available"})),1)]),_:1})]))]}),_:3},8,["title"]))}});exports._sfc_main=T;
@@ -1 +1 @@
1
- const e=require("vue"),m=require("./Button.vue.es-M_jXZda4.js"),r=require("./Section.vue.es-Btff-cLY.js"),l=require("./customElements-Vox1PB6G.js"),u=require("./PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js"),p=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),h=require("./useActionDispatchProvider-CNAuaHdm.js"),y=require("./configuration-akTS7Wiw.js"),_=e.defineComponent({__name:"CustomerPaymentMethodsBlock",props:{paymentMethods:{type:Array},limit:{default:2,type:Number},isLoading:{type:Boolean},showViewAllButton:{type:Boolean},showAddButton:{type:Boolean}},emits:["view-all-payment-methods","add-payment-method"],setup(t){const d=t,{$t:o}=l.useIntl(),i=e.computed(()=>d.paymentMethods.length>0);return(s,a)=>(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{class:"sv-payment-methods","no-spacing":"","no-border":"",title:e.unref(o)({defaultMessage:"{count, plural, one {Payment method} other {Payment methods}}",description:"Title for the payment methods block on the customer overview page",id:"customer_overview.payment_methods.title"},{count:String(t.paymentMethods.length)})},e.createSlots({default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,"payment-methods":t.paymentMethods},null,8,["payment-methods"])):(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{key:1,class:"sv-empty-state sv-payment-methods__empty"},{default:e.withCtx(()=>[e.createVNode(e.unref(l._sfc_main),{variant:"body-sm",color:"subtle","no-spacing":"",class:"sv-payment-methods__empty-message"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add a payment method for recurring invoice payments.",description:"Helper text for adding a payment method when no payment methods are configured",id:"customer_overview.payment_methods_block.add_payment_method_helper_text"})),1)]),_:1}),t.showAddButton?(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,class:"sv-action sv-action--secondary sv-action--full-width sv-payment-methods__add mt-4 w-full",intent:"secondary","icon-prefix":"add",type:"button",onClick:a[1]||(a[1]=n=>s.$emit("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add payment method",description:"Text for the add payment method button that is shown when no payment methods have been configured",id:"customer_overview.payment_methods_block.add_payment_method_button_label"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}))]),_:2},[t.showViewAllButton?{name:"right",fn:e.withCtx(()=>[e.createVNode(e.unref(m._sfc_main),{size:"sm",intent:"subtle","icon-suffix":"arrow_right_alt",class:"sv-action sv-action--ghost sv-payment-methods__view-all",type:"button",onClick:a[0]||(a[0]=n=>s.$emit("view-all-payment-methods"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"View all",id:"customer_overview.payment_methods_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer invoices"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),v=e.defineComponent({__name:"CustomerPaymentMethods",props:{isLoading:{type:Boolean},paymentMethods:{type:Array},maxPaymentMethods:{type:Number},configuration:{type:Object}},setup(t){const d={showViewAllButton:!0,showAddButton:!0},o=t,i=e.computed(()=>y.resolveConfiguration(d,o.configuration)),{dispatchAction:s}=h.useActionDispatchProvider();return(a,n)=>t.isLoading?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,variant:"section",class:"sv-payment-methods sv-root sv-component sv-loading h-72","data-testid":"customer-payment-methods-skeleton"})):(e.openBlock(),e.createBlock(_,{key:1,class:"sv-payment-methods sv-root sv-component","is-loading":t.isLoading,"payment-methods":t.paymentMethods,"show-view-all-button":i.value.showViewAllButton,"show-add-button":i.value.showAddButton,onViewAllPaymentMethods:n[0]||(n[0]=c=>e.unref(s)({action:"view-all-payment-methods"})),onAddPaymentMethod:n[1]||(n[1]=c=>e.unref(s)({action:"add-payment-method"}))},null,8,["is-loading","payment-methods","show-view-all-button","show-add-button"]))}});exports._sfc_main=v;
1
+ const e=require("vue"),m=require("./Button.vue.es-TCF-bvDF.js"),r=require("./Section.vue.es-CBZx5x53.js"),l=require("./customElements-CSzbVZIH.js"),u=require("./PaymentMethodsList.vue_vue_type_script_setup_true_lang-BIX0k7-q.js"),p=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),h=require("./useActionDispatchProvider-DDHrhy3i.js"),y=require("./configuration-akTS7Wiw.js"),_=e.defineComponent({__name:"CustomerPaymentMethodsBlock",props:{paymentMethods:{type:Array},limit:{default:2,type:Number},isLoading:{type:Boolean},showViewAllButton:{type:Boolean},showAddButton:{type:Boolean}},emits:["view-all-payment-methods","add-payment-method"],setup(t){const d=t,{$t:o}=l.useIntl(),i=e.computed(()=>d.paymentMethods.length>0);return(s,a)=>(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{class:"sv-payment-methods","no-spacing":"","no-border":"",title:e.unref(o)({defaultMessage:"{count, plural, one {Payment method} other {Payment methods}}",description:"Title for the payment methods block on the customer overview page",id:"customer_overview.payment_methods.title"},{count:String(t.paymentMethods.length)})},e.createSlots({default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,"payment-methods":t.paymentMethods},null,8,["payment-methods"])):(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{key:1,class:"sv-empty-state sv-payment-methods__empty"},{default:e.withCtx(()=>[e.createVNode(e.unref(l._sfc_main),{variant:"body-sm",color:"subtle","no-spacing":"",class:"sv-payment-methods__empty-message"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add a payment method for recurring invoice payments.",description:"Helper text for adding a payment method when no payment methods are configured",id:"customer_overview.payment_methods_block.add_payment_method_helper_text"})),1)]),_:1}),t.showAddButton?(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,class:"sv-action sv-action--secondary sv-action--full-width sv-payment-methods__add mt-4 w-full",intent:"secondary","icon-prefix":"add",type:"button",onClick:a[1]||(a[1]=n=>s.$emit("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add payment method",description:"Text for the add payment method button that is shown when no payment methods have been configured",id:"customer_overview.payment_methods_block.add_payment_method_button_label"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}))]),_:2},[t.showViewAllButton?{name:"right",fn:e.withCtx(()=>[e.createVNode(e.unref(m._sfc_main),{size:"sm",intent:"subtle","icon-suffix":"arrow_right_alt",class:"sv-action sv-action--ghost sv-payment-methods__view-all",type:"button",onClick:a[0]||(a[0]=n=>s.$emit("view-all-payment-methods"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"View all",id:"customer_overview.payment_methods_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer invoices"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),v=e.defineComponent({__name:"CustomerPaymentMethods",props:{isLoading:{type:Boolean},paymentMethods:{type:Array},maxPaymentMethods:{type:Number},configuration:{type:Object}},setup(t){const d={showViewAllButton:!0,showAddButton:!0},o=t,i=e.computed(()=>y.resolveConfiguration(d,o.configuration)),{dispatchAction:s}=h.useActionDispatchProvider();return(a,n)=>t.isLoading?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,variant:"section",class:"sv-payment-methods sv-root sv-component sv-loading h-72","data-testid":"customer-payment-methods-skeleton"})):(e.openBlock(),e.createBlock(_,{key:1,class:"sv-payment-methods sv-root sv-component","is-loading":t.isLoading,"payment-methods":t.paymentMethods,"show-view-all-button":i.value.showViewAllButton,"show-add-button":i.value.showAddButton,onViewAllPaymentMethods:n[0]||(n[0]=c=>e.unref(s)({action:"view-all-payment-methods"})),onAddPaymentMethod:n[1]||(n[1]=c=>e.unref(s)({action:"add-payment-method"}))},null,8,["is-loading","payment-methods","show-view-all-button","show-add-button"]))}});exports._sfc_main=v;
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as v, computed as f, openBlock as s, createBlock as m, unref as t, createSlots as w, withCtx as a, createVNode as y, createTextVNode as p, toDisplayString as h, createCommentVNode as g } from "vue";
2
- import { _ as u } from "./Button.vue.es-Dz-2L8dJ.mjs";
3
- import { _ as c } from "./Section.vue.es-DQ5H7mqW.mjs";
4
- import { u as b, _ as k } from "./customElements-CSE7dwUr.mjs";
5
- import { _ as A } from "./PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs";
2
+ import { _ as u } from "./Button.vue.es-PbJFK8z7.mjs";
3
+ import { _ as c } from "./Section.vue.es-KRsHeFoT.mjs";
4
+ import { u as b, _ as k } from "./customElements-DT1YyL4O.mjs";
5
+ import { _ as A } from "./PaymentMethodsList.vue_vue_type_script_setup_true_lang-9MUPbgWM.mjs";
6
6
  import { _ as M } from "./Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
7
- import { u as B } from "./useActionDispatchProvider-B8-oycQk.mjs";
7
+ import { u as B } from "./useActionDispatchProvider-MjTckd4f.mjs";
8
8
  import { r as $ } from "./configuration-BytDBAWs.mjs";
9
9
  const x = /* @__PURE__ */ v({
10
10
  __name: "CustomerPaymentMethodsBlock",
@@ -1,30 +1,30 @@
1
1
  import { defineComponent as z, ref as E, onMounted as xt, onBeforeUnmount as Pe, computed as s, openBlock as w, createBlock as C, withCtx as h, createElementVNode as k, toDisplayString as N, createVNode as A, createTextVNode as F, createElementBlock as W, unref as r, createCommentVNode as R, renderSlot as se, createSlots as re, Fragment as ge, renderList as he, useModel as $t, watch as ee, isRef as Et, mergeModels as Ot, mergeProps as le, reactive as Ae, normalizeClass as ze, withModifiers as Ne, normalizeStyle as ke } from "vue";
2
2
  import { w as Bt } from "./api.es-QaC926Xu.mjs";
3
- import { u as Q, _ as X, c as Qe, a as Ge, b as _e, g as It } from "./customElements-CSE7dwUr.mjs";
4
- import { E as Dt } from "./component-5wqcK7yz.mjs";
3
+ import { u as Q, _ as X, c as Qe, a as Ge, b as _e, g as It } from "./customElements-DT1YyL4O.mjs";
4
+ import { E as Dt } from "./sessionReference-3h-6FdrC.mjs";
5
5
  import { u as Nt } from "./useService-Bh47bllz.mjs";
6
- import { _ as Ke } from "./ErrorNotification.vue.es-BGckEwHf.mjs";
6
+ import { _ as Ke } from "./ErrorNotification.vue.es-CVUuIt8Z.mjs";
7
7
  import { i as kt, a as Me, h as Rt } from "./pricingItemConfigs.es-ORxsk_YS.mjs";
8
8
  import { b as Ce } from "./wallets.es-eH2C2ygn.mjs";
9
- import { _ as ue, a as Vt } from "./Button.vue.es-Dz-2L8dJ.mjs";
10
- import { _ as Xe, T as Je, a as Ze } from "./TooltipParagraph.vue.es-CIedcXGT.mjs";
11
- import { _ as fe } from "./Section.vue.es-DQ5H7mqW.mjs";
9
+ import { _ as ue, a as Vt } from "./Button.vue.es-PbJFK8z7.mjs";
10
+ import { _ as Xe, T as Je, a as Ze } from "./TooltipParagraph.vue.es-nGFfHF1A.mjs";
11
+ import { _ as fe } from "./Section.vue.es-KRsHeFoT.mjs";
12
12
  import { _ as et } from "./Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
13
- import { _ as tt } from "./RadioGroupExtended.vue.es-C92xlCFQ.mjs";
13
+ import { _ as tt } from "./RadioGroupExtended.vue.es-_QMReyZ8.mjs";
14
14
  import { u as xe, c as ie, _ as qt, a as Ft, r as ot } from "./index-BPU8tIml.mjs";
15
15
  import { f as $e } from "./formatting.es-RclXHhKo.mjs";
16
16
  import { _ as Lt } from "./Divider.vue.es-DnP_HqLz.mjs";
17
17
  import { _ as nt } from "./Expand.vue.es-BleuAfDz.mjs";
18
- import { a as at } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs";
19
- import { _ as Yt } from "./cn.es-BGqYNPM3.mjs";
20
- import { c as it } from "./invoices-DRgfpkJ6.mjs";
18
+ import { a as at } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DeotDsFP.mjs";
19
+ import { _ as Yt } from "./cn.es-BD7Afj5Q.mjs";
20
+ import { c as it } from "./invoices-CVZOfEOY.mjs";
21
21
  import { u as Ht } from "./useWatchDebounced-DT5IicPp.mjs";
22
- import { _ as Wt } from "./Input.vue.es-BGPELaZU.mjs";
23
- import { _ as st, a as jt } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs";
24
- import { _ as zt } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs";
22
+ import { _ as Wt } from "./Input.vue.es-BFbiFXsU.mjs";
23
+ import { _ as st, a as jt } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DW10rozs.mjs";
24
+ import { _ as zt } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-DvYZvTV9.mjs";
25
25
  import { g as Qt } from "./customer.es-B5ppZf0j.mjs";
26
- import { u as Gt } from "./usePaymentMethodOptions-B7JYkGsw.mjs";
27
- import { M as lt } from "./Modal.vue.es-B_G8NQS2.mjs";
26
+ import { u as Gt } from "./usePaymentMethodOptions-l-wVAmIW.mjs";
27
+ import { M as lt } from "./Modal.vue.es-jT61xK_A.mjs";
28
28
  const Kt = 3e4, we = 60, Te = 12, Xt = /* @__PURE__ */ z({
29
29
  __name: "DateTimeAgo",
30
30
  props: {
@@ -0,0 +1 @@
1
+ const e=require("vue"),Je=require("./api.es-duCDtZD9.js"),M=require("./customElements-CSzbVZIH.js"),Ze=require("./sessionReference-m_6Rp4X1.js"),et=require("./useService-H7BjLg8P.js"),Me=require("./ErrorNotification.vue.es-BF6swP7o.js"),J=require("./pricingItemConfigs.es-D4aYkYcf.js"),ue=require("./wallets.es-CNIMW5ay.js"),z=require("./Button.vue.es-TCF-bvDF.js"),j=require("./TooltipParagraph.vue.es-7IQdU3Tf.js"),Z=require("./Section.vue.es-CBZx5x53.js"),Se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),xe=require("./RadioGroupExtended.vue.es-Cf5R1P9a.js"),I=require("./index-DwueOtPi.js"),le=require("./formatting.es-C72Nsrmh.js"),tt=require("./Divider.vue.es-UwnWvUTl.js"),Be=require("./Expand.vue.es-BtM0EZEr.js"),Ue=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-GNPyrcAQ.js"),ot=require("./cn.es-BLE3T5Rx.js"),Pe=require("./invoices-EamWI_jz.js"),nt=require("./useWatchDebounced-CAU1WI1P.js"),at=require("./Input.vue.es-CREdT4nB.js"),re=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jWthTJk-.js"),it=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-DZKl0Zxp.js"),st=require("./customer.es-BButyYo0.js"),ut=require("./usePaymentMethodOptions-DuXKS36F.js"),Ae=require("./Modal.vue.es-BbdtdxsO.js"),lt=3e4,ne=60,ae=12,rt=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ne,n=24*o,a=t,{$t:i,formatDate:s}=M.useIntl(),l=e.ref(Date.now());let u;e.onMounted(()=>{u=setInterval(()=>{l.value=Date.now()},lt)}),e.onBeforeUnmount(()=>{clearInterval(u)});const d=(f,v)=>{const p=(v.getFullYear()-f.getFullYear())*ae+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?p-1:p},g=e.computed(()=>{const f=Math.max(0,(l.value-a.date.getTime())/1e3);if(f<ne)return i({defaultMessage:"{count, plural, one {# second} other {# seconds}} ago",id:"dateTimeAgo.seconds",description:"Relative time in whole seconds"},{count:Math.trunc(f)});if(f<o)return i({defaultMessage:"{count, plural, one {# minute} other {# minutes}} ago",id:"dateTimeAgo.minutes",description:"Relative time in whole minutes"},{count:Math.trunc(f/ne)});if(f<n)return i({defaultMessage:"{count, plural, one {# hour} other {# hours}} ago",id:"dateTimeAgo.hours",description:"Relative time in whole hours"},{count:Math.trunc(f/o)});const v=d(a.date,new Date(l.value));if(v<1){const p=Math.trunc(f/n);return p===1?i({defaultMessage:"yesterday",id:"dateTimeAgo.yesterday",description:'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'}):i({defaultMessage:"{count, plural, one {# day} other {# days}} ago",id:"dateTimeAgo.days",description:"Relative time in whole days"},{count:p})}return v<ae?i({defaultMessage:"{count, plural, one {# month} other {# months}} ago",id:"dateTimeAgo.months",description:"Relative time in whole months"},{count:v}):i({defaultMessage:"{count, plural, one {# year} other {# years}} ago",id:"dateTimeAgo.years",description:"Relative time in whole years"},{count:Math.trunc(v/ae)})}),y=e.computed(()=>a.actionVerb?`${a.actionVerb} ${g.value}`:g.value),S=e.computed(()=>s({date:a.date,format:"dateTime",offsetType:"local"}));return(f,v)=>(e.openBlock(),e.createBlock(j._sfc_main,null,{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(S.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(y.value),1)]),_:1}))}}),ct=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=h=>ue.formatWalletBalanceValue(o,n,h),i=e.computed(()=>{var h,T;return((T=(h=t.walletBalance.wallet)==null?void 0:h.wallet_type)==null?void 0:T.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),s=h=>{var T;return(((T=h.pricing_item)==null?void 0:T.configs)??[]).filter(m=>!!m.on_demand)},l=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(h=>s(h).some(T=>J.isFixedPricing(T)||J.isFlexiblePricing(T)))),u=e.computed(()=>l.value.find(h=>s(h).some(T=>J.isFlexiblePricing(T)))),d=e.computed(()=>!!t.showManualTopUp&&l.value.length>0),g=e.computed(()=>!!t.showAutoTopUp&&!!u.value),y=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet)==null?void 0:h.auto_top_up_configs)==null?void 0:T.find(m=>m.status==="ACTIVE")}),S=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet_balance.open_balance)==null?void 0:h.credits)==null?void 0:T.credit_type}),f=(h,T)=>a({credits:{quantity:h,credit_type_id:T,credit_type:S.value}}),v=h=>h.amount?a({amount:h.amount}):h.credits?f(h.credits.quantity,h.credits.credit_type_id):"",p=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.pricing_item_id;if(!m)return;const C=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===m).flatMap(A=>s(A)).flatMap(A=>A.wallet_grants??[]),B=(T=t.walletBalance.wallet)==null?void 0:T.wallet_type_id;return C.find(A=>A.wallet_type_id===B)??C[0]}),w=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.topup_amount,C=(T=p.value)==null?void 0:T.credits_grant;if(!m||!C)return"";if(C.credits)return f(C.credits.quantity,C.credits.credit_type_id);if(C.conversion){const B=Number(m.quantity)*Number(C.conversion.rate);return f(String(B),C.conversion.credit_type_id)}return""}),P=e.computed(()=>y.value?o({defaultMessage:"Auto top-up enabled",id:"wallet_balance.auto_top_up_enabled_label",description:"Label shown when a wallet tops itself up automatically"}):o({defaultMessage:"No auto top-up enabled",id:"wallet_balance.auto_top_up_disabled_label",description:"Label shown when a wallet has no automatic top-up configured"})),D=e.computed(()=>{const h=y.value;if(!h)return o({defaultMessage:"Set up an automatic top-up and your balance is increased for you whenever it drops below an amount you choose, so you never run out.",id:"wallet_balance.auto_top_up_setup_explanation",description:"Tooltip explaining what automatic top-ups do, shown when none is configured yet"});const T=h.topup_amount?a({amount:h.topup_amount}):"",m=v(h.threshold);return!T||!m?o({defaultMessage:"Your balance is topped up automatically once it runs low.",id:"wallet_balance.auto_top_up_generic_explanation",description:"Tooltip shown for an active automatic top-up whose amount or threshold is unknown"}):w.value?o({defaultMessage:"Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",id:"wallet_balance.auto_top_up_credits_explanation",description:"Tooltip explaining an automatic top-up that grants credits for a paid amount"},{topUpCredits:w.value,topUpAmount:T,threshold:m}):o({defaultMessage:"Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",id:"wallet_balance.auto_top_up_explanation",description:"Tooltip explaining how the automatic top-up of a wallet balance works"},{topUpAmount:T,threshold:m})});return{walletName:i,formatBalance:a,manualTopUpItems:l,flexibleManualTopUpItem:u,showManualTopUp:d,showAutoTopUp:g,activeTopUpConfig:y,autoTopUpLabel:P,autoTopUpExplanation:D}},dt={class:"flex flex-col gap-3 py-3"},pt={class:"flex flex-col gap-1 px-4"},mt={class:"flex w-full justify-between gap-3"},ft={class:"flex w-full items-center gap-4"},vt={key:0},ht={key:1,class:"flex w-full justify-between gap-3 px-4"},gt={class:"flex min-w-0 items-center gap-1"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"shrink-0"},bt=e.defineComponent({__name:"WalletBalancesItem",props:{walletBalance:{},showAutoTopUp:{type:Boolean},showManualTopUp:{type:Boolean}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){const o=t,{$t:n}=M.useIntl(),{walletName:a,formatBalance:i,manualTopUpItems:s,flexibleManualTopUpItem:l,showManualTopUp:u,showAutoTopUp:d,activeTopUpConfig:g,autoTopUpLabel:y,autoTopUpExplanation:S}=ct(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>{var p,w;return[(p=t.walletBalance.wallet_balance)!=null&&p.balance_at?(e.openBlock(),e.createBlock(rt,{key:0,date:new Date((w=t.walletBalance.wallet_balance)==null?void 0:w.balance_at),"action-verb":e.unref(n)({defaultMessage:"updated",id:"wallet_balance.updated_action_verb",description:"Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"})},null,8,["date","action-verb"])):e.createCommentVNode("",!0)]}),_:1})]),e.createElementVNode("div",ft,[e.createVNode(M._sfc_main,{variant:"body-lg",weight:"semibold","no-spacing":"",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(o.walletBalance.wallet_balance.open_balance)),1)]),_:1}),e.unref(u)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=p=>f.$emit("top-up",e.unref(s)[0]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Top up",id:"v1V8kA",description:"Button to top up a wallet balance"})),1)]),_:1})):e.createCommentVNode("",!0)])]),f.$slots.graph?(e.openBlock(),e.createElementBlock("div",vt,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",gt,[e.createVNode(j._sfc_main,{class:"min-w-0"},{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",_t,[e.createVNode(M._sfc_main,{variant:"body-sm",color:"secondary","no-spacing":"",class:"truncate"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1}),e.createVNode(z._sfc_main$1,{icon:"info",size:"2xs",class:"shrink-0 cursor-help text-gray-400"})])]),_:1})]),e.createElementVNode("div",yt,[e.unref(g)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=p=>f.$emit("cancel-auto-top-up",e.unref(g)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Disable",id:"wallet_balance.auto_top_up_disable_button",description:"Button to turn off a wallet's automatic top-up"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:1,size:"xs",intent:"secondary",onClick:v[2]||(v[2]=p=>f.$emit("auto-top-up",e.unref(l)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Enable",id:"wallet_balance.auto_top_up_enable_button",description:"Button to set up a wallet's automatic top-up"})),1)]),_:1}))])])):e.createCommentVNode("",!0)]))}}),wt={class:"flex flex-col gap-2"},Tt=e.defineComponent({__name:"WalletBalances",props:{customerWalletBalances:{},title:{default:void 0},showAutoTopUp:{type:Boolean,default:!1},showManualTopUp:{type:Boolean,default:!1}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(Z._sfc_main,{"no-spacing":"","no-border":"",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.customerWalletBalances,a=>(e.openBlock(),e.createBlock(Z._sfc_main,{key:a.wallet_id,"no-spacing":""},{default:e.withCtx(()=>[e.createVNode(bt,{"wallet-balance":a,"show-auto-top-up":t.showAutoTopUp,"show-manual-top-up":t.showManualTopUp,onTopUp:n[0]||(n[0]=i=>o.$emit("top-up",i)),onAutoTopUp:n[1]||(n[1]=i=>o.$emit("auto-top-up",i)),onCancelAutoTopUp:n[2]||(n[2]=i=>o.$emit("cancel-auto-top-up",i))},null,8,["wallet-balance","show-auto-top-up","show-manual-top-up"])]),_:2},1024))),128))])]),_:2},[o.$slots["heading-right"]?{name:"right",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"heading-right")]),key:"0"}:void 0]),1032,["title"]))}});function Ct(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Je.withExpand({expandParams:Ze.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function Mt({customerId:t}){const{getCustomerWalletBalances:o}=Ct(),{data:n,execute:a,apiStatus:i,error:s,isPending:l}=et.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:s,fetch:a,isPending:l}}const ve=(t=[],o)=>{if(o!=null&&o.pricing_item_id)return t.find(n=>(n.charge_on_demand_pricing_items??[]).some(({pricing_item_id:a})=>a===o.pricing_item_id))},St=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,xt=t=>[...new Set(((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>ce(o)&&o.pricing_plan_schedule_id?[o.pricing_plan_schedule_id]:[]))],Bt=(t,o)=>{const n=new Set(xt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:s})=>n.has(s));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:s})=>s),enabledPricingIds:i.flatMap(s=>{var l;return(((l=s.pricing_plan_schedule)==null?void 0:l.enabled_pricings)??[]).flatMap(({pricing_id:u})=>u?[u]:[])})}]})},Ut=(t,o)=>{if(!t||o.length===0)return t;const n=new Set(o);return{...t,charge_on_demand_pricing_items:(t.charge_on_demand_pricing_items??[]).filter(a=>ce(a)&&!!a.pricing_plan_schedule_id&&n.has(a.pricing_plan_schedule_id))}},Ne=t=>((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>{var a,i;if(!ce(o))return[];const n=o.pricing_item_id??((a=o.pricing_item)==null?void 0:a.id);return n?(((i=o.pricing_item)==null?void 0:i.configs)??[]).map(s=>{const l=kt(s,t),u=Pt(s,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:s,...l&&{flexiblePricing:l},...u&&{fixedPricing:u}}}):[]});function Pt(t,o){var s,l,u;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(u=(l=(s=t.details)==null?void 0:s.bands)==null?void 0:l[0])==null?void 0:u.fixed_amount;if(!n)return;const a=ke(o),i=a?Nt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const ke=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Ee=(t,o)=>{var a;const n=(a=o==null?void 0:o.wallet)==null?void 0:a.wallet_type_id;return(t.wallet_grants??[]).filter(({wallet_type_id:i})=>!n||i===n)},At=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},Nt=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.credits))==null?void 0:n.credits_grant)==null?void 0:a.credits},de=(t,o)=>({credits:{...o,quantity:t}}),Ve=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function kt(t,o){var d,g,y,S,f,v,p;if(!t.on_demand||!J.isFlexiblePricing(t))return;const n=(g=(d=t.details)==null?void 0:d.bands)==null?void 0:g[0],a=((y=n==null?void 0:n.minimum_amount)==null?void 0:y.currency)??((S=n==null?void 0:n.maximum_amount)==null?void 0:S.currency)??((v=(f=o==null?void 0:o.wallet_balance.balance)==null?void 0:f.amount)==null?void 0:v.currency);if(!a)return;const i=ke(o),s=i?At(t,o):void 0,l=(p=i==null?void 0:i.credit_type)==null?void 0:p.unit_name,u=w=>{if(!w)return;const P=i&&s?Ve(w.quantity,s.rate):void 0;return P!==void 0&&i?de(P,i):{amount:w}};return{config:{...(n==null?void 0:n.minimum_amount)&&{minimum_amount:n.minimum_amount},...(n==null?void 0:n.maximum_amount)&&{maximum_amount:n.maximum_amount}},currency:a,...s&&{creditsConfiguration:{conversionRate:s.rate,...(l==null?void 0:l.singular)&&{unitNameSingle:l.singular},...(l==null?void 0:l.plural)&&{unitNamePlural:l.plural}}},bounds:{...u(n==null?void 0:n.minimum_amount)&&{minimum:u(n==null?void 0:n.minimum_amount)},...u(n==null?void 0:n.maximum_amount)&&{maximum:u(n==null?void 0:n.maximum_amount)}}}}const Et=t=>{var o,n,a,i,s;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((s=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&s.credits)},Vt=t=>{var o;for(const{fixedPricing:n,flexiblePricing:a}of t){const i=(n==null?void 0:n.value.credits)??((o=(a==null?void 0:a.bounds.minimum)??(a==null?void 0:a.bounds.maximum))==null?void 0:o.credits);if(i!=null&&i.credit_type_id)return i.credit_type_id}},$t=(t=[])=>{for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return a}},$e=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:s}of t){const l=(i==null?void 0:i.value.credits)??((o=(s==null?void 0:s.bounds.minimum)??(s==null?void 0:s.bounds.maximum))==null?void 0:o.credits);if((a=(n=l==null?void 0:l.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return l.credit_type.unit_name.plural}},Ot=(t=[])=>{var o;for(const{flexiblePricing:n}of t){const a=(o=n==null?void 0:n.creditsConfiguration)==null?void 0:o.conversionRate;if(a)return a}},It=(t=[])=>{for(const{flexiblePricing:o}of t){const{minimum_amount:n,maximum_amount:a}=(o==null?void 0:o.config)??{};if(n||a)return{...n&&{minimum:n},...a&&{maximum:a}}}return{}},Dt=(t=[])=>{if(t.some(Et)){const o=Vt(t);return o?{creditTypeId:o}:void 0}for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return{currency:a}}},qt=(t,o)=>{var l;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(l=n.minimum??n.maximum)==null?void 0:l.credits,s=a?Ve(o.quantity,a.conversionRate):void 0;return i&&s!==void 0?de(s,i):{amount:o}},Oe=(t=[])=>{const o=Dt(t);if(o)return{denomination:o,chargeCurrency:$t(t)??"",creditUnitName:$e(t),conversionRate:Ot(t),topUpBounds:It(t)}},Rt=400;function Ft({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=Pe.createInvoicesService(),a=M.useLogger(),i=e.ref(),s=e.ref(!1),l=M.createLatestGuard(),u=async()=>{const d=t.value,g=l();if(!d||!o.value){o.value&&!d&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the top-up invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,s.value=!1;return}s.value=!0;try{const y=await n({pricingPlanScheduleId:d,pricingItems:o.value});g()&&(i.value=y)}catch(y){g()&&(i.value=void 0),a.error("INVOICE_PREVIEW_FAILED","Failed to load top-up invoice preview",{},y)}finally{g()&&(s.value=!1)}};return nt.useWatchDebounced(o,()=>void u(),{debounce:Rt,deep:!0}),u(),{invoicePreview:i,isPreviewPending:s,loadPreview:u}}const Lt={key:0},Ie=e.defineComponent({__name:"TopUpInvoicePreview",props:{pricingPlanScheduleId:{type:String},pricingItems:{type:Array}},setup(t){const o=t,{$t:n}=M.useIntl(),a=e.computed(()=>o.pricingPlanScheduleId),i=e.computed(()=>o.pricingItems),{invoicePreview:s}=Ft({pricingPlanScheduleId:a,pricingItems:i});return(l,u)=>(e.openBlock(),e.createBlock(Se._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(ot._sfc_main),{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"You will pay",description:"Label above the preview of what topping up will be invoiced for",id:"topup_modal.invoice_preview.label"})),1)]),_:1}),e.createVNode(e.unref(Z._sfc_main),{"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ue._sfc_main$1),{invoice:e.unref(s),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),De=(t,o)=>t.currency??o??t.creditTypeId??"",he=(t,o)=>({quantity:t??null,currency:o}),ie=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var s,l,u,d,g;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:he(((l=(s=t==null?void 0:t.threshold)==null?void 0:s.amount)==null?void 0:l.quantity)??((d=(u=t==null?void 0:t.threshold)==null?void 0:u.credits)==null?void 0:d.quantity),De(o,a)),topUpAmount:he(((g=t==null?void 0:t.topup_amount)==null?void 0:g.quantity)??i,n)}},Yt=(t,o)=>{var a;const n=(a=t.threshold)==null?void 0:a.quantity;return n?o.creditTypeId?{credits:{quantity:n,credit_type_id:o.creditTypeId}}:{amount:{quantity:n,currency:o.currency??""}}:{}},ge=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},qe=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...ge(t,n)&&{topup_amount:ge(t,n)}}),_e=(t,o)=>qe(ie(t,o),o),ye=(t,o)=>JSON.stringify(t)===JSON.stringify(o),be=t=>{const o=Number(t==null?void 0:t.quantity);return t!=null&&t.quantity&&Number.isFinite(o)?o:void 0},Wt=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t>=n},Ht=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t<=n},ee=t=>{const o=Number(t);return t!=null&&t!==""&&Number.isFinite(o)?o:void 0},pe=(t,o,n)=>{const a=ee(t),i=ee(n);if(!(a===void 0||i===void 0||i<=0))return o==="CREDITS"?a/i:a*i},we=(t,o,n,a)=>o===n?ee(t):pe(t,o,a),zt=(t,o,n)=>o==="CREDITS"?pe(t,"AMOUNT",n):ee(t),me=t=>t.toFixed(2),Te=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),Re=(t,o,n,a)=>{const i=zt(t==null?void 0:t.quantity,o,n);if(i!==void 0)return o==="CREDITS"?a(i):me(i)},jt=["data-testid"],se=e.defineComponent({__name:"ConvertedAmountInput",props:e.mergeModels({unit:{type:String},modelBase:{type:String},entryBase:{type:String},conversionRate:{type:String},showConversionHint:{type:Boolean},currency:{type:String},creditUnitName:{type:String},bounds:{type:Object},label:{type:String},name:{type:String},required:{type:Boolean},disabled:{type:Boolean},error:{type:[String,Object,Array]}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:a,formatNumber:i}=M.useIntl(),s=e.computed(()=>o.entryBase??o.modelBase),l=e.computed(()=>s.value!==o.modelBase&&ee(o.conversionRate)!==void 0),u=e.ref("");e.watch(()=>[n.value,s.value,o.modelBase,o.conversionRate],([m])=>{if(!l.value){u.value=m??"";return}if(m===g(u.value))return;const C=we(m,o.modelBase,s.value,o.conversionRate);u.value=C===void 0?"":Te(C,s.value)},{immediate:!0});function d(m){return typeof m=="string"?m:typeof m=="number"?String(m):""}function g(m){const C=we(m,s.value,o.modelBase,o.conversionRate);return C===void 0?"":Te(C,o.modelBase)}const y=e.computed({get:()=>u.value,set:m=>{u.value=d(m),n.value=l.value?g(u.value):u.value}}),S=e.computed(()=>pe(u.value,s.value,o.conversionRate)),f=e.computed(()=>o.creditUnitName?o.creditUnitName:s.value==="CREDITS"?o.unit:a({defaultMessage:"credits",description:"Generic name for a wallet credit, where its credit type does not name one",id:"converted_amount_input.credits"})),v=(m,C)=>le.formatAmount({quantity:me(m),currency:C}),p=m=>`${i(m)} ${f.value}`,w=e.computed(()=>{const m=o.error;return Array.isArray(m)?m.length>0:!!(e.isRef(m)?m.value:m)}),P=e.computed(()=>{const m=S.value;if(!(w.value||!o.showConversionHint||m===void 0))return s.value==="CREDITS"?o.currency?a({defaultMessage:"Will cost {amount} excluding taxes",description:"Helper text under a credits field, naming what those credits cost in money",id:"converted_amount_input.cost"},{amount:v(m,o.currency)}):void 0:a({defaultMessage:"Buys about {credits}",description:"Helper text under a money field, naming the credits that amount converts into",id:"converted_amount_input.buys"},{credits:p(m)})}),D=m=>Re(m,s.value,o.conversionRate,i),h=e.computed(()=>{var m,C,B,A;return s.value==="CREDITS"?f.value:((C=(m=o.bounds)==null?void 0:m.minimum)==null?void 0:C.currency)??((A=(B=o.bounds)==null?void 0:B.maximum)==null?void 0:A.currency)??o.unit}),T=e.computed(()=>{var A,_;const m=D((A=o.bounds)==null?void 0:A.minimum),C=D((_=o.bounds)==null?void 0:_.maximum),B=h.value;if(m&&C)return a({defaultMessage:"Between {minimum} and {maximum} {unit}",description:"Range of what a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.range"},{minimum:m,maximum:C,unit:B});if(m)return a({defaultMessage:"At least {minimum} {unit}",description:"Smallest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.minimum"},{minimum:m,unit:B});if(C)return a({defaultMessage:"Up to {maximum} {unit}",description:"Largest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.maximum"},{maximum:C,unit:B})});return(m,C)=>(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{modelValue:y.value,"onUpdate:modelValue":C[0]||(C[0]=B=>y.value=B),class:"sv-converted-amount-input",type:"number","as-text-type":"",name:t.name,label:t.label,required:t.required,disabled:t.disabled,error:t.error},e.createSlots({suffix:e.withCtx(()=>[e.createElementVNode("span",{"data-testid":`${t.name}-unit`},e.toDisplayString(t.unit),9,jt)]),_:2},[T.value?{name:"label-suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-bounds`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,P.value?{name:"helper",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-conversion`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(P.value),1)]),_:1},8,["data-testid"])]),key:"1"}:void 0]),1032,["modelValue","name","label","required","disabled","error"]))}}),Qt=e.defineComponent({__name:"Section",props:{emphasized:{type:Boolean,default:!1},contentClasses:{type:String},contentBackground:{type:String},title:{type:String},noSpacing:{type:Boolean},hasError:{type:Boolean},noBorder:{type:Boolean}},setup(t){const o=t,n=["sv-section__accent relative","before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5","before:rounded-full before:bg-primary-600"].join(" "),a=e.computed(()=>[o.emphasized?n:void 0,o.contentClasses].filter(Boolean).join(" ")),i=e.computed(()=>{const{emphasized:s,...l}=o;return l});return(s,l)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(i.value,{class:"sv-section","content-classes":a.value}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:2},[s.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},Fe=e.defineComponent({__name:"AutoTopUpConfig",props:{config:{type:Object},denomination:{type:Object},creditUnitName:{type:String},chargeCurrency:{type:String},conversionRate:{type:String},topUpBounds:{type:Object},showThresholdConversion:{type:Boolean,default:!0},contained:{type:Boolean},alwaysEnabled:{type:Boolean},disabled:{type:Boolean}},emits:["save"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:s,formatNumber:l}=M.useIntl(),u=e.computed(()=>{var _,x;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(x=(_=a.topUpBounds)==null?void 0:_.minimum)==null?void 0:x.quantity}}),d=e.ref(ie(a.config,u.value)),g=e.computed(()=>De(a.denomination,a.creditUnitName)),y=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),S=e.computed(()=>y.value==="CREDITS"?g.value:a.chargeCurrency),f=e.computed({get:()=>{var _;return((_=d.value.threshold)==null?void 0:_.quantity)??""},set:_=>{d.value.threshold={quantity:_||null,currency:g.value}}}),v=e.computed({get:()=>{var _;return((_=d.value.topUpAmount)==null?void 0:_.quantity)??""},set:_=>{d.value.topUpAmount={quantity:_||null,currency:a.chargeCurrency}}});e.watch(()=>[a.config,u.value],([_,x])=>{ye(_e(_,x),P())||(d.value=ie(_,x))});const p=e.computed({get:()=>a.alwaysEnabled||d.value.enabled,set:_=>{d.value.enabled=_}}),w=e.computed(()=>qe({...d.value,enabled:p.value},u.value)),P=()=>w.value,D=e.reactive({threshold:e.computed(()=>be(d.value.threshold)??null),topUpAmount:e.computed(()=>be(d.value.topUpAmount)??null)}),h=_=>{if(!_)return"";const x=Re(_,y.value,a.conversionRate,l);return x===void 0?le.formatAmount(_):`${x} ${S.value}`},T=I.requiredIf(()=>p.value),m=I.useValidation({threshold:{required:I.common.withMessage(()=>s({defaultMessage:"Enter the balance to top up at.",description:"Error shown under the auto top-up threshold when it is left empty",id:"auto_topup_config.threshold.required"}),T),notNegative:I.common.withMessage(()=>s({defaultMessage:"The balance to top up at cannot be negative.",description:"Error shown under the auto top-up threshold when it is below zero",id:"auto_topup_config.threshold.not_negative"}),_=>_===null||_>=0)},topUpAmount:{required:I.common.withMessage(()=>s({defaultMessage:"Enter the amount to top up with.",description:"Error shown under the auto top-up amount when it is left empty",id:"auto_topup_config.amount.required"}),T),positive:I.common.withMessage(()=>s({defaultMessage:"Top up with more than zero.",description:"Error shown under the auto top-up amount when it is zero or negative",id:"auto_topup_config.amount.positive"}),_=>_===null||_>0),atLeastMinimum:I.common.withMessage(()=>{var _;return s({defaultMessage:"Top up with at least {minimum}.",description:"Error shown under the auto top-up amount when it is below what the pricing allows",id:"auto_topup_config.amount.at_least_minimum"},{minimum:h((_=a.topUpBounds)==null?void 0:_.minimum)})},_=>{var x;return Wt(_,(x=a.topUpBounds)==null?void 0:x.minimum)}),withinMaximum:I.common.withMessage(()=>{var _;return s({defaultMessage:"Top up with at most {maximum}.",description:"Error shown under the auto top-up amount when it is above what the pricing allows",id:"auto_topup_config.amount.within_maximum"},{maximum:h((_=a.topUpBounds)==null?void 0:_.maximum)})},_=>{var x;return Ht(_,(x=a.topUpBounds)==null?void 0:x.maximum)})}},D),C=e.computed(()=>!ye(P(),_e(a.config,u.value)));function B(){return m.value.$touch(),m.value.$invalid?void 0:P()}function A(){const _=B();_&&i("save",_)}return o({submit:A,validate:B,rule:w,hasChanges:C,isInvalid:e.computed(()=>m.value.$invalid)}),(_,x)=>(e.openBlock(),e.createBlock(Qt,{class:"sv-auto-topup-config","content-background":t.contained?"gray":"none","no-spacing":!t.contained,"no-border":!t.contained},{default:e.withCtx(()=>[t.alwaysEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(I._sfc_main),{key:0,modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=q=>p.value=q),"no-spacing":"","label-position":"before",class:"!flex",disabled:t.disabled},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",Gt,[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Auto top-up",description:"Title of the automatic wallet top-up settings",id:"auto_topup_config.title"})),1)]),_:1}),e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Automatically top up your balance when it runs low.",description:"Subtitle of the automatic wallet top-up settings",id:"auto_topup_config.subtitle"})),1)]),_:1})])]),_:1},8,["modelValue","disabled"])),e.createVNode(e.unref(Be._sfc_main),{"is-open":p.value},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid grid-cols-1 gap-3",{"mt-4":!t.alwaysEnabled}])},[e.createVNode(se,{modelValue:f.value,"onUpdate:modelValue":x[1]||(x[1]=q=>f.value=q),name:"auto-top-up-threshold",unit:g.value,"model-base":y.value,"entry-base":y.value,currency:t.chargeCurrency,"conversion-rate":t.conversionRate,"show-conversion-hint":t.showThresholdConversion,required:"",disabled:t.disabled,error:e.unref(m).threshold.$errors,label:e.unref(s)({defaultMessage:"When your balance falls below",description:"Label of the balance at which an automatic top-up is charged",id:"auto_topup_config.threshold.label"})},null,8,["modelValue","unit","model-base","entry-base","currency","conversion-rate","show-conversion-hint","disabled","error","label"]),e.createVNode(se,{modelValue:v.value,"onUpdate:modelValue":x[2]||(x[2]=q=>v.value=q),name:"auto-top-up-amount",unit:S.value,"model-base":"AMOUNT","entry-base":y.value,currency:t.chargeCurrency,"credit-unit-name":t.creditUnitName,"conversion-rate":t.conversionRate,bounds:t.topUpBounds,"show-conversion-hint":"",required:"",disabled:t.disabled,error:e.unref(m).topUpAmount.$errors,label:e.unref(s)({defaultMessage:"Top-up with",description:"Label of the amount every automatic top-up adds",id:"auto_topup_config.amount.label"})},null,8,["modelValue","unit","entry-base","currency","credit-unit-name","conversion-rate","bounds","disabled","error","label"])],2)):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["content-background","no-spacing","no-border"]))}}),Ce=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function Le({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,s)=>Ce(s.created_at)-Ce(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,s,l],u)=>{var S;const d=u==null?void 0:u[0],g=i==null?void 0:i.find(({id:f})=>!(d!=null&&d.some(v=>v.id===f)));if(g&&(d!=null&&d.length)){o.value=g.id;return}const y=f=>!!f&&!!(i!=null&&i.some(v=>v.id===f));y(l)||(o.value=y(s)?s:(S=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:S.id)},{immediate:!0}),{sortedPaymentMethods:a}}function te(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>ue.formatWalletBalanceValue(t,o,i);return{formatValue:n,formatOpenBalance:i=>n(i==null?void 0:i.wallet_balance.open_balance)}}const Kt={class:"sv-top-up-form"},Xt={class:"grid grid-cols-1 gap-4"},Jt={class:"grid grid-cols-1 gap-1"},Zt={class:"sv-top-up-form__option-details"},eo={key:0},to=e.defineComponent({__name:"TopUpModalForm",props:{topUpPricingItems:{type:null},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},autoTopUpConfig:{type:Object}},emits:["add-payment-method","success","save-auto-top-up","failure"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:s}=M.useIntl(),{formatValue:l}=te(),u=e.ref({pricing_plan_schedule_id:"",pricing_items:[],start_at:"",finalize_immediately:!1,payment_method_id:void 0,preview:!0}),d=e.computed(()=>{const r=(a.topUpPricingItems??[]).filter(c=>c.flexiblePricing||c.fixedPricing);return[...r.filter(({flexiblePricing:c})=>c),...r.filter(({flexiblePricing:c})=>!c)]}),g=r=>d.value.find(c=>c.pricingItemId===r),y=e.computed(()=>{var r,c;return(c=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:c.pricingPlanScheduleId});e.watch(y,r=>{u.value.pricing_plan_schedule_id=r??""},{immediate:!0});const S=r=>{const{config:c,currency:b}=r.flexiblePricing??{},N=c==null?void 0:c.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const c=g(typeof r=="string"?r:void 0);if(!c){u.value.pricing_items=[];return}const b=S(c);u.value.pricing_items=[{pricing_item_id:c.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(d,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=u.value.pricing_items[0])==null?void 0:V.pricing_item_id)}))return;const b=r.find(({flexiblePricing:N})=>N)??r[0];f.value=b==null?void 0:b.pricingItemId},{immediate:!0});const v=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const c=(b=u.value.pricing_items[0])==null?void 0:b.pricing_item_id;c&&(u.value.pricing_items=[{pricing_item_id:c,...r&&{flexible_amount:r}}])}}),p=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.fixedPricing;return c!=null&&c.value.credits?le.formatAmount(c.amount):void 0},w=e.computed(()=>{var r;return(r=g(String(f.value)))==null?void 0:r.flexiblePricing}),P=e.computed({get:()=>{var r;return((r=v.value)==null?void 0:r.quantity)??""},set:r=>{var b;const c=(b=w.value)==null?void 0:b.currency;v.value=r&&c?{quantity:r,currency:c}:void 0}}),D=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",h=e.computed(()=>$e(a.topUpPricingItems)),T=r=>r.creditsConfiguration?h.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,m=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.flexiblePricing;return c?[c]:[]},C=r=>{var c;return!!((c=g(String(r)))!=null&&c.flexiblePricing)},B=e.computed(()=>d.value.map(r=>{var c;return{value:r.pricingItemId,label:r.fixedPricing?l(r.fixedPricing.value):s({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((c=r.flexiblePricing)==null?void 0:c.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:s({defaultMessage:"Between {minimum} and {maximum}",description:"Bounds of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.bounds"},{minimum:l(r.flexiblePricing.bounds.minimum),maximum:l(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=u.value.pricing_items.filter(c=>{var b;return!((b=g(c.pricing_item_id))!=null&&b.flexiblePricing)||!!c.flexible_amount});return r.length>0?r:void 0}),_=e.computed(()=>!a.autoTopUpConfig&&d.value.some(({flexiblePricing:c})=>c)?Oe(a.topUpPricingItems):void 0),x=e.ref(),{chargeOnDemandPricingItems:q}=Pe.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!u.value.pricing_plan_schedule_id&&!!A.value&&!!u.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>u.value.payment_method_id??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>s({defaultMessage:"Select a payment method to pay for this top-up.",description:"Error shown under the payment methods in the top-up modal when none is selected on submit",id:"topup_modal.payment_method_required"}),I.required)}},G),Y=e.computed(()=>{const[r]=u.value.pricing_items,c=g(r==null?void 0:r.pricing_item_id);return c?qt(c,r==null?void 0:r.flexible_amount):void 0});async function K(){var c,b,N;W.value.$touch();const r=(c=x.value)==null?void 0:c.validate();if(!(W.value.$invalid||(b=x.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await q({pricing_plan_schedule_id:u.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:u.value.payment_method_id,preview:!1});r&&((N=x.value)!=null&&N.hasChanges)&&u.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:u.value.payment_method_id}),i("success",V)}catch(V){Q.error("TOP_UP_FAILED","Failed to charge the wallet top-up",{},V),i("failure",V)}finally{R.value=!1}}}o({submit:K,isCharging:R,canSubmit:L,chargedValue:Y});const H=e.computed({get:()=>u.value.payment_method_id??void 0,set:r=>{u.value.payment_method_id=r}}),{sortedPaymentMethods:X}=Le({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,c)=>(e.openBlock(),e.createElementBlock("form",Kt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Jt,[B.value.length>0?(e.openBlock(),e.createBlock(e.unref(xe._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":c[3]||(c[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:B.value,"show-radio":!1,label:e.unref(s)({defaultMessage:"Top up amount",description:"Label above the list of ways to top up the wallet in the top-up modal",id:"topup_modal.pricing_items.label"})},{label:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("span",null,e.toDisplayString(b.label),1),p(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",weight:"normal","no-spacing":"",class:"sv-top-up-form__option-cost"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!C(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),m(N).length>0?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(N),V=>{var k;return e.openBlock(),e.createElementBlock("div",{key:V.currency,class:"sv-top-up-form__amount grid grid-cols-1 gap-3",onClick:c[1]||(c[1]=e.withModifiers(()=>{},["stop"])),onKeydown:c[2]||(c[2]=e.withModifiers(()=>{},["stop"]))},[b.description?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(se,{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=O=>P.value=O),name:"top-up-amount","model-base":"AMOUNT",unit:T(V),"entry-base":D(V),currency:V.currency,"conversion-rate":(k=V.creditsConfiguration)==null?void 0:k.conversionRate,required:"",disabled:R.value},null,8,["modelValue","unit","entry-base","currency","conversion-rate","disabled"])],32)}),128))]),_:2},1032,["is-open"])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","disabled","options","label"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(Ie,{"pricing-plan-schedule-id":y.value,"pricing-items":A.value},null,8,["pricing-plan-schedule-id","pricing-items"])]),_.value?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(Fe,e.mergeProps({ref_key:"autoTopUpFormRef",ref:x,class:"sv-top-up-form__auto-top-up"},_.value,{contained:"","show-threshold-conversion":!1,disabled:R.value}),null,16,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(e.unref(tt._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(re._sfc_main,{modelValue:H.value,"onUpdate:modelValue":c[4]||(c[4]=b=>H.value=b),class:"sv-top-up-form__payment-methods","payment-methods":e.unref(X),required:"",error:e.unref(W).paymentMethodId.$errors,"payment-method-options":t.paymentMethodOptions,disabled:R.value,label:e.unref(s)({defaultMessage:"Payment method",description:"Label above the payment method that pays for the top-up, in the top-up modal",id:"topup_modal.payment_method_selector.label"}),onAddPaymentMethod:c[5]||(c[5]=b=>i("add-payment-method"))},null,8,["modelValue","payment-methods","error","payment-method-options","disabled","label"])])])])]))}}),oo={class:"sv-top-up-success grid grid-cols-1 gap-4"},no=e.defineComponent({__name:"TopUpModalSuccess",props:{addedValue:{type:Object},invoice:{type:Object}},setup(t){const{$t:o}=M.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock("div",oo,[t.invoice?(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),{key:0,"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold",class:"mb-2 block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Receipt",description:"Heading above the invoice a completed top-up produced",id:"topup_modal.success.receipt.heading"})),1)]),_:1}),e.createVNode(e.unref(Ue._sfc_main$1),{invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})):e.createCommentVNode("",!0)]))}});function ao({step:t,currentBalance:o,topUpValue:n}){const{$t:a,formatNumber:i}=M.useIntl(),s=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add payment method",description:"Title of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.title"}):t.value==="SUCCESS"?a({defaultMessage:"Top-up complete",description:"Title of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_title"}):a({defaultMessage:"Top up balance",description:"Title of the wallet top-up modal",id:"topup_modal.title"})),l=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add a new payment method for topping up your balance.",description:"Subtitle of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.subtitle"}):t.value==="SUCCESS"?a({defaultMessage:"Your payment went through.",description:"Subtitle of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_subtitle"}):a({defaultMessage:"Your current balance is {balance}.",description:"Subtitle of the top-up modal showing the current wallet balance",id:"topup_modal.subtitle"},{balance:o.value})),u=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Back",description:"Label of the button that leaves the add payment method step in the top-up modal",id:"topup_modal.back_button.label"}):a({defaultMessage:"Cancel",description:"Label of the button that closes the top-up modal",id:"topup_modal.cancel_button.label"})),d=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Save payment method",description:"Label of the confirm button in the top-up modal while adding a payment method",id:"topup_modal.save_payment_method.label"}):t.value==="SUCCESS"?a({defaultMessage:"Done",description:"Label of the button that dismisses the top-up modal once the top-up has been charged",id:"topup_modal.done_button.label"}):n.value?a({defaultMessage:"Top up balance with {value}",description:"Label of the confirm button in the top-up modal once an amount is entered",id:"topup_modal.confirm_button.label"},{value:ue.formatWalletBalanceValue(a,i,n.value)}):a({defaultMessage:"Top up balance",description:"Label of the confirm button in the top-up modal while no amount is entered",id:"topup_modal.confirm_button.empty.label"}));return{title:s,subTitle:l,cancelButtonText:u,confirmButtonText:d}}function Ye({isOpen:t,customer:o}){const{paymentMethodOptions:n,get:a,isPending:i}=ut.usePaymentMethodOptions();e.watch(()=>[t.value,o.value],([l,u])=>{!l||!u||a({customerId:u.id,country:st.getCustomerCountry(u)})},{immediate:!0});const s=e.computed(()=>i.value?void 0:n.value);return{paymentMethodOptions:n,settledOptions:s,isPending:i}}function io(t){const o=e.ref(0),n=i=>{o.value=(i==null?void 0:i.offsetHeight)??0},a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i=>{var l;const s=(l=i[0])==null?void 0:l.target;n(s instanceof HTMLElement?s:void 0)});return e.watch(t,(i,s)=>{s&&(a==null||a.unobserve(s)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const so=["inert"],uo=300,lo="1rem",ro=e.defineComponent({__name:"SlidingPanes",props:{panes:{type:Array},current:{type:String}},setup(t){const o=t,n=e.ref(!1);let a;e.watch(()=>o.current,()=>{n.value=!0,clearTimeout(a),a=setTimeout(()=>{n.value=!1},uo)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),s={},l=y=>s[y]??(s[y]=S=>{i.value[y]=S instanceof HTMLElement?S:void 0}),u=e.computed(()=>i.value[o.current]),d=io(u),g=e.computed(()=>{const y=o.panes.indexOf(o.current);return y>0?`translateX(calc(${-y} * (100% + ${lo})))`:"translateX(0px)"});return(y,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",n.value?"transition-[height] duration-300 ease-in-out motion-reduce:transition-none":""]),style:e.normalizeStyle(e.unref(d)?{height:`${e.unref(d)}px`}:void 0)},[e.createElementVNode("div",{class:"sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",style:e.normalizeStyle({transform:g.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.panes,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"sv-sliding-panes__pane w-full shrink-0",inert:f!==t.current||void 0},[e.createElementVNode("div",{ref_for:!0,ref:l(f)},[e.renderSlot(y.$slots,f)],512)],8,so))),128))],4)],6))}}),co={class:"grid grid-cols-1 gap-4 pb-4"},We=e.defineComponent({__name:"WalletModalShell",props:{showModal:{type:Boolean},title:{type:String},subTitle:{type:String},cancelButtonText:{type:String},confirmButtonText:{type:String},isPending:{type:Boolean},panes:{type:Array},step:{type:String},addPaymentMethodPane:{type:String},customer:{type:Object},paymentMethodOptions:{type:Array},isPaymentMethodOptionsPending:{type:Boolean},isAddingPaymentMethod:{type:Boolean}},emits:["confirm","cancel","payment-success","payment-failed"],setup(t,{expose:o}){const n=t,a=e.ref(),i=e.computed(()=>n.panes.filter(s=>s!==n.addPaymentMethodPane));return o({submit:()=>{var s;return(s=a.value)==null?void 0:s.submit()},isSaving:e.computed(()=>{var s;return!!((s=a.value)!=null&&s.isSaving)})}),(s,l)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{"no-click-away":"","show-modal":t.showModal,size:"lg",title:t.title,"sub-title":t.subTitle,"cancel-button-text":t.cancelButtonText,"confirm-button-text":t.confirmButtonText,"is-loading":t.isPending,onConfirm:l[2]||(l[2]=u=>s.$emit("confirm")),onClose:l[3]||(l[3]=u=>s.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",co,[e.createVNode(ro,{panes:t.panes,current:t.step},e.createSlots({[t.addPaymentMethodPane]:e.withCtx(()=>[e.createVNode(re._sfc_main$1,{ref_key:"paneRef",ref:a,customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isPaymentMethodOptionsPending,"is-active":t.isAddingPaymentMethod,onSuccess:l[0]||(l[0]=u=>s.$emit("payment-success")),onFailure:l[1]||(l[1]=u=>s.$emit("payment-failed",u))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,u=>({name:u,fn:e.withCtx(()=>[e.renderSlot(s.$slots,u)])}))]),1032,["panes","current"])])]),_:2},[s.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),He=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},ze=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,je=(t,o=[])=>{if(t!=null&&t.pricing_item_id&&t.pricing_plan_schedule_id)return{pricingItemId:t.pricing_item_id,pricingPlanScheduleId:t.pricing_plan_schedule_id};const n=o.find(({flexiblePricing:a,pricingPlanScheduleId:i})=>a&&i);return n!=null&&n.pricingPlanScheduleId?{pricingItemId:n.pricingItemId,pricingPlanScheduleId:n.pricingPlanScheduleId}:void 0},Qe=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var s,l;const i=!!(((s=t==null?void 0:t.threshold)==null?void 0:s.amount)??((l=t==null?void 0:t.threshold)==null?void 0:l.credits));if(!(!t||!i||!(o!=null&&o.wallet_id)||!n||!a))return{wallet_id:o.wallet_id,status:t.status,threshold:t.threshold,pricing_plan_schedule_id:n.pricingPlanScheduleId,pricing_item_id:n.pricingItemId,payment_method_id:a,...t.topup_amount&&{topup_amount:t.topup_amount}}};function Ge({step:t,name:o,returnTo:n}){const a=e.ref();return{paneRef:a,isActive:e.computed(()=>t.value===o),isSaving:e.computed(()=>{var i;return!!((i=a.value)!=null&&i.isSaving)}),open:()=>{t.value=o},leave:()=>{t.value=n},submit:()=>{var i;return(i=a.value)==null?void 0:i.submit()}}}function Ke(){const t=M.createRequestService(),o=M.useConfig(),n="/portal/auto-top-up-configs";function a(u){return t({url:`${o.apiUrls.config}${n}`,query:{...u},isCollection:!0})}function i(u){return t({url:`${o.apiUrls.config}${n}/${u}`})}function s(u){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:u})}function l(u){return t({url:`${o.apiUrls.config}${n}/${u}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:s,deactivateAutoTopUpConfig:l}}function Xe(){const{createAutoTopUpConfig:t}=Ke(),o=M.useLogger(),n=e.ref(!1);return{save:async i=>{if(!i||n.value)return{saved:!1};n.value=!0;try{return await t(i),{saved:!0}}catch(s){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},s),{saved:!1,error:s}}finally{n.value=!1}},isSaving:n}}const po={key:0,class:"mb-4"},mo={class:"sr-only"},fo={class:"flex flex-col gap-2"},vo=e.defineComponent({__name:"TopUpModal",props:{showModal:{type:Boolean},selectedBalanceItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object},subscriptions:{type:Array}},emits:["confirm","close","auto-top-up-saved","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:s}=te(),l=e.computed(()=>ze(He(n.selectedBalanceItem))),u=e.computed(()=>s(n.selectedBalanceItem)),d=e.computed(()=>Bt(n.selectedBalanceItem,n.subscriptions??[])),g=e.ref();e.watch(d,U=>{var E;U.some(({id:oe})=>oe===g.value)||(g.value=(E=U[0])==null?void 0:E.id)},{immediate:!0});const y=e.computed(()=>d.value.length>1),S=e.computed(()=>d.value.map(({id:U,name:$})=>({value:U,label:$}))),f=e.computed(()=>Object.fromEntries(d.value.flatMap(({id:U,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:oe})=>oe===U);return E?[[U,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const U=d.value.find(({id:E})=>E===g.value);return U?Ut(n.selectedBalanceItem,U.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),p=e.computed(()=>Ne(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:D}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),h=e.ref("TOP_UP"),T=e.computed(()=>(n.paymentMethods??[]).length>0),m=e.computed(()=>!D.value&&(w.value??[]).length===0),C=e.computed(()=>h.value==="TOP_UP"&&!T.value&&m.value),B=e.ref(),A=e.ref(),_=()=>{L(),a("payment-success")},{paneRef:x,isActive:q,isSaving:Q,open:R,leave:L,submit:G}=Ge({step:h,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Xe(),Y=e.ref(),K=e.computed(()=>{var U;return(U=Y.value)==null?void 0:U.chargedValue}),H=e.computed(()=>{var U;return Q.value||!!((U=Y.value)!=null&&U.isCharging)}),{title:X,subTitle:r,cancelButtonText:c,confirmButtonText:b}=ao({step:h,currentBalance:u,topUpValue:K}),N=()=>{var U;if(q.value){G();return}(U=Y.value)==null||U.submit()},V=async({rule:U,paymentMethodId:$})=>{const{saved:E}=await W(Qe({rule:U,walletBalanceItem:n.selectedBalanceItem,chargeTarget:je(void 0,p.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=U=>{var $;B.value=U,A.value=($=Y.value)==null?void 0:$.chargedValue,h.value="SUCCESS"},O=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(q.value){L();return}if(h.value==="SUCCESS"){O();return}a("close")}},fe=e.ref(0);return e.watch(()=>n.showModal,U=>{U&&(h.value="TOP_UP",B.value=void 0,A.value=void 0,fe.value+=1)}),(U,$)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:e.unref(X),"sub-title":e.unref(r),"cancel-button-text":e.unref(c),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(St),step:h.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(w),"is-payment-method-options-pending":e.unref(D),"is-adding-payment-method":e.unref(q),onConfirm:N,onCancel:F,onPaymentSuccess:_,onPaymentFailed:$[1]||($[1]=E=>U.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[y.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(xe._sfc_main),{modelValue:g.value,"onUpdate:modelValue":$[0]||($[0]=E=>g.value=E),class:"sv-topup-modal__subscription",name:"top-up-subscription",direction:"column",required:"",options:S.value,"show-radio":!1,label:e.unref(i)({defaultMessage:"Subscription to top up",description:"Label above the list of subscriptions a top-up can be charged against, in the top-up modal",id:"topup_modal.subscriptions.label"})},{prefix:e.withCtx(({optionValue:E})=>[f.value[String(E)]?(e.openBlock(),e.createBlock(it._sfc_main,{key:0,class:"sv-topup-modal__subscription-option grow","no-spacing":"",subscription:f.value[String(E)].subscription,"enabled-pricing-ids":f.value[String(E)].enabledPricingIds},null,8,["subscription","enabled-pricing-ids"])):e.createCommentVNode("",!0)]),label:e.withCtx(({option:E})=>[e.createElementVNode("span",mo,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:fe.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":p.value,"payment-methods":t.paymentMethods,"auto-top-up-config":l.value,"payment-method-options":e.unref(P),onAddPaymentMethod:e.unref(R),onSuccess:k,onSaveAutoTopUp:V},null,8,["top-up-pricing-items","payment-methods","auto-top-up-config","payment-method-options","onAddPaymentMethod"]))]),SUCCESS:e.withCtx(()=>[B.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:B.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[h.value==="SUCCESS"||C.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",fo,[h.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:O},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(z._sfc_main),{size:"lg",disabled:"","data-testid":"confirm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1}),e.createVNode(e.unref(z._sfc_main),{size:"lg",intent:"subtle","data-testid":"cancel",onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]),_:1})],64))])]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),ho=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],go={class:"grid grid-cols-1 gap-4"},_o=e.defineComponent({__name:"AutoTopUpModal",props:{showModal:{type:Boolean},walletBalanceItem:{type:Object},topUpItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object}},emits:["saved","close","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:s}=te(),l=e.ref("AUTO_TOP_UP"),u=e.computed(()=>s(n.walletBalanceItem)),d=e.computed(()=>Ne(n.walletBalanceItem)),g=e.computed(()=>Oe(d.value)),y=e.computed(()=>He(n.walletBalanceItem)),S=e.computed(()=>ze(y.value)),f=e.computed(()=>je(n.topUpItem,d.value)),v=e.ref(),p=e.computed(()=>{var O,F;const k=(F=(O=v.value)==null?void 0:O.rule)==null?void 0:F.topup_amount;return k!=null&&k.quantity&&f.value?[{pricing_item_id:f.value.pricingItemId,flexible_amount:k}]:void 0}),w=e.computed(()=>{var k;return(k=f.value)==null?void 0:k.pricingPlanScheduleId}),P=e.ref(),{sortedPaymentMethods:D}=Le({paymentMethods:e.computed(()=>n.paymentMethods),selectedPaymentMethodId:P,preferredPaymentMethodId:e.computed(()=>{var k;return(k=y.value)==null?void 0:k.payment_method_id})}),{paymentMethodOptions:h,settledOptions:T,isPending:m}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:C,isActive:B,isSaving:A,open:_,leave:x,submit:q}=Ge({step:l,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Xe(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>i({defaultMessage:"Select a payment method to pay for automatic top-ups.",description:"Error shown in the auto top-up modal when no payment method is selected",id:"auto_topup_modal.payment_method.required"}),I.required)}},G),Y=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Title of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.title"}):i({defaultMessage:"Automatic top-up",description:"Title of the automatic wallet top-up modal",id:"auto_topup_modal.title"})),K=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"This method pays for every automatic top-up.",description:"Subtitle of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.subtitle"}):i({defaultMessage:"Your current balance is {balance}. Enable auto top so you can stay productive",description:"Subtitle of the automatic wallet top-up modal, naming the balance",id:"auto_topup_modal.subtitle"},{balance:u.value})),H=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Back",description:"Button returning from adding a payment method to the auto top-up rule",id:"auto_topup_modal.add_payment_method.cancel"}):i({defaultMessage:"Cancel",description:"Button dismissing the auto top-up modal",id:"auto_topup_modal.cancel"})),X=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Button storing the payment method being added in the auto top-up modal",id:"auto_topup_modal.add_payment_method.confirm"}):i({defaultMessage:"Save",description:"Button saving the automatic top-up rule",id:"auto_topup_modal.confirm"}));async function r(){var F;if(W.value.$touch(),L.value)return;const{saved:k,error:O}=await Q(Qe({rule:(F=v.value)==null?void 0:F.validate(),walletBalanceItem:n.walletBalanceItem,chargeTarget:f.value,paymentMethodId:P.value}));if(k){a("saved"),a("close");return}O&&a("payment-failed",O)}const c=()=>{if(B.value){q();return}r()},b=()=>{x(),a("payment-success")},N=()=>{if(!L.value){if(B.value){x();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(l.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,O)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:C,"show-modal":t.showModal,title:Y.value,"sub-title":K.value,"cancel-button-text":H.value,"confirm-button-text":X.value,"is-pending":L.value,panes:e.unref(ho),step:l.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(h),"is-payment-method-options-pending":e.unref(m),"is-adding-payment-method":e.unref(B),onConfirm:c,onCancel:N,onPaymentSuccess:b,onPaymentFailed:O[1]||(O[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",go,[g.value?(e.openBlock(),e.createBlock(Fe,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},g.value,{config:S.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ie,{"pricing-plan-schedule-id":w.value,"pricing-items":p.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(re._sfc_main,{modelValue:P.value,"onUpdate:modelValue":O[0]||(O[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(D),"payment-method-options":e.unref(T),disabled:L.value,error:e.unref(W).paymentMethodId.$errors,label:e.unref(i)({defaultMessage:"Pay automatic top-ups with",description:"Label above the payment method an automatic top-up is charged to",id:"auto_topup_modal.payment_method.label"}),onAddPaymentMethod:e.unref(_)},null,8,["modelValue","payment-methods","payment-method-options","disabled","error","label","onAddPaymentMethod"])])]),_:1},8,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),yo={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},bo=e.defineComponent({__name:"AutoTopUpCancellationModal",props:{showModal:{type:Boolean},config:{type:Object}},emits:["confirmed","close"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),s=M.useLogger(),{formatValue:l}=te(),{deactivateAutoTopUpConfig:u}=Ke(),d=e.ref(!1),g=e.ref(!1);e.watch(()=>n.showModal,v=>{v&&(g.value=!1)});const y=e.computed(()=>{var w,P;const v=(w=n.config)==null?void 0:w.threshold,p=(P=n.config)==null?void 0:P.topup_amount;return!(v!=null&&v.amount)&&!(v!=null&&v.credits)?i({defaultMessage:"Your balance will no longer be topped up automatically. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.explanation"}):p?i({defaultMessage:"Your balance will no longer be topped up with {amount} when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",id:"auto_topup_cancellation_modal.explanation_with_amount"},{amount:l({amount:p}),threshold:l(v)}):i({defaultMessage:"Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",id:"auto_topup_cancellation_modal.explanation_with_threshold"},{threshold:l(v)})}),S=async()=>{var p;const v=(p=n.config)==null?void 0:p.id;if(!(!v||d.value)){d.value=!0,g.value=!1;try{await u(v),a("confirmed"),a("close")}catch(w){s.error("AUTO_TOP_UP_CANCELLATION_FAILED","Failed to turn off a wallet's automatic top-up",{},w),g.value=!0}finally{d.value=!1}}},f=()=>{d.value||a("close")};return(v,p)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{size:"sm","show-modal":t.showModal,"is-loading":d.value,"no-click-away":d.value,"no-backdrop-close":d.value,title:e.unref(i)({defaultMessage:"Turn off automatic top-up",description:"Title of the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.title"}),"confirm-button-text":e.unref(i)({defaultMessage:"Yes, turn it off",description:"Button confirming that a wallet automatic top-up is turned off",id:"auto_topup_cancellation_modal.confirm"}),"cancel-button-text":e.unref(i)({defaultMessage:"Cancel",description:"Button dismissing the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.cancel"}),onConfirm:S,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",yo,[e.createVNode(e.unref(M._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-auto-topup-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1}),g.value?(e.openBlock(),e.createBlock(e.unref(Me._sfc_main),{key:0,class:"sv-auto-topup-cancellation-modal__error sv-error",title:e.unref(i)({defaultMessage:"Could not turn off the automatic top-up. Please try again later.",description:"Error shown when turning a wallet automatic top-up off failed",id:"auto_topup_cancellation_modal.failed"})},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","is-loading","no-click-away","no-backdrop-close","title","confirm-button-text","cancel-button-text"]))}}),wo=e.defineComponent({inheritAttrs:!1,__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array},showTopUpButton:{type:Boolean},customer:{type:Object},paymentMethods:{type:Array},subscriptions:{type:Array}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),s=e.ref(),l=e.computed(()=>ve(n.walletBalances,s.value)),u=e.computed(()=>!!l.value),d=e.ref(),g=e.computed(()=>!!d.value),y=e.computed(()=>ve(n.walletBalances,d.value)),S=e.ref(),f=e.computed(()=>!!S.value);return(v,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Se._sfc_main,e.mergeProps({key:0,variant:"section"},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-loading min-h-48","data-testid":"customer-wallet-balances-skeleton"}),null,16)):t.hasError?(e.openBlock(),e.createBlock(e.unref(Me._sfc_main),e.mergeProps({key:1},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-error",title:e.unref(i)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})}),null,16,["title"])):t.walletBalances.length>0?(e.openBlock(),e.createBlock(e.unref(Tt),e.mergeProps({key:2},v.$attrs,{class:"sv-wallet-balances sv-root sv-component","customer-wallet-balances":t.walletBalances,"show-auto-top-up":"","show-manual-top-up":"",title:e.unref(i)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(t.walletBalances.length)}),onTopUp:p[0]||(p[0]=w=>s.value=w),onAutoTopUp:p[1]||(p[1]=w=>d.value=w),onCancelAutoTopUp:p[2]||(p[2]=w=>S.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(vo,{key:3,"show-modal":u.value,"selected-balance-item":l.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:p[3]||(p[3]=w=>s.value=void 0),onConfirm:p[4]||(p[4]=w=>a("top-up-charged")),onPaymentSuccess:p[5]||(p[5]=w=>a("payment-method-stored")),onPaymentFailed:p[6]||(p[6]=w=>a("payment-failed",w))},null,8,["show-modal","selected-balance-item","payment-methods","customer","subscriptions"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(_o,{key:4,"show-modal":g.value,"wallet-balance-item":y.value,"top-up-item":d.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:p[7]||(p[7]=w=>d.value=void 0),onSaved:p[8]||(p[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:p[9]||(p[9]=w=>a("payment-method-stored")),onPaymentFailed:p[10]||(p[10]=w=>a("payment-failed",w))},null,8,["show-modal","wallet-balance-item","top-up-item","payment-methods","customer"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(bo,{key:5,"show-modal":f.value,config:S.value,onClose:p[11]||(p[11]=w=>S.value=void 0),onConfirmed:p[12]||(p[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=wo;exports.useCustomerWalletBalances=Mt;
@@ -1,5 +1,5 @@
1
1
  import { computed as o, defineComponent as f, openBlock as a, createElementBlock as n, normalizeClass as l, unref as r, createCommentVNode as c, renderSlot as g, createVNode as m, withCtx as x, createTextVNode as v, toDisplayString as h } from "vue";
2
- import { _ as D } from "./customElements-CSE7dwUr.mjs";
2
+ import { _ as D } from "./customElements-DT1YyL4O.mjs";
3
3
  const d = "relative translate-y-1/2 top-1/2 border-t border-gray-100", y = (e) => {
4
4
  const i = o(() => {
5
5
  let t = `${d}`;
@@ -1 +1 @@
1
- const e=require("vue"),r=require("./customElements-Vox1PB6G.js"),a="relative translate-y-1/2 top-1/2 border-t border-gray-100",c=t=>{const i=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="left"?s+=" w-2":s+=" grow",s}),n=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="right"?s+=" w-2":s+=" grow",s});return{leftDividerClasses:i,rightDividerClasses:n}},o=e.defineComponent({__name:"DividerText",props:{spacing:{default:"none"},textPosition:{default:"left"},hasOuterDivider:{type:Boolean,default:!1},text:{}},setup(t){const i=t,{leftDividerClasses:n,rightDividerClasses:s}=c(i);return(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex gap-2",{"my-2":t.spacing==="xs","my-4":t.spacing==="sm","my-6":t.spacing==="md","my-8":t.spacing==="lg","my-10":t.spacing==="xl"}])},[t.textPosition==="left"&&t.hasOuterDivider||["center","right"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n))},null,2)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default",{},()=>[e.createVNode(e.unref(r._sfc_main),{tag:"span","no-spacing":"",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text),1)]),_:1})]),t.textPosition==="right"&&t.hasOuterDivider||["center","left"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s))},null,2)):e.createCommentVNode("",!0)],2))}});exports._sfc_main=o;
1
+ const e=require("vue"),r=require("./customElements-CSzbVZIH.js"),a="relative translate-y-1/2 top-1/2 border-t border-gray-100",c=t=>{const i=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="left"?s+=" w-2":s+=" grow",s}),n=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="right"?s+=" w-2":s+=" grow",s});return{leftDividerClasses:i,rightDividerClasses:n}},o=e.defineComponent({__name:"DividerText",props:{spacing:{default:"none"},textPosition:{default:"left"},hasOuterDivider:{type:Boolean,default:!1},text:{}},setup(t){const i=t,{leftDividerClasses:n,rightDividerClasses:s}=c(i);return(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex gap-2",{"my-2":t.spacing==="xs","my-4":t.spacing==="sm","my-6":t.spacing==="md","my-8":t.spacing==="lg","my-10":t.spacing==="xl"}])},[t.textPosition==="left"&&t.hasOuterDivider||["center","right"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n))},null,2)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default",{},()=>[e.createVNode(e.unref(r._sfc_main),{tag:"span","no-spacing":"",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text),1)]),_:1})]),t.textPosition==="right"&&t.hasOuterDivider||["center","left"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s))},null,2)):e.createCommentVNode("",!0)],2))}});exports._sfc_main=o;
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as h, openBlock as t, createElementBlock as u, normalizeClass as k, createVNode as l, withCtx as a, renderSlot as w, createBlock as r, createTextVNode as m, toDisplayString as f, unref as d, Fragment as _, renderList as C, resolveDynamicComponent as M, ref as E, computed as $, createElementVNode as I, createCommentVNode as b } from "vue";
2
- import { _ as x, u as N } from "./customElements-CSE7dwUr.mjs";
3
- import { _ as V, T as A, a as j } from "./TooltipParagraph.vue.es-CIedcXGT.mjs";
2
+ import { _ as x, u as N } from "./customElements-DT1YyL4O.mjs";
3
+ import { _ as V, T as A, a as j } from "./TooltipParagraph.vue.es-nGFfHF1A.mjs";
4
4
  import { i as D } from "./useService-Bh47bllz.mjs";
5
5
  import { g as F } from "./getComposedString.es-C__uhJpd.mjs";
6
6
  import { _ as p } from "./Amount.vue.es-DPqHB8Xd.mjs";
7
7
  import { _ as S } from "./Divider.vue.es-DnP_HqLz.mjs";
8
8
  import { _ as q } from "./Expand.vue.es-BleuAfDz.mjs";
9
- import { a as W } from "./Button.vue.es-Dz-2L8dJ.mjs";
10
- import { _ as L } from "./Section.vue.es-DQ5H7mqW.mjs";
9
+ import { a as W } from "./Button.vue.es-PbJFK8z7.mjs";
10
+ import { _ as L } from "./Section.vue.es-KRsHeFoT.mjs";
11
11
  const y = /* @__PURE__ */ h({
12
12
  __name: "invoicePreviewRow",
13
13
  props: {
@@ -1 +1 @@
1
- const e=require("vue"),r=require("./customElements-Vox1PB6G.js"),v=require("./TooltipParagraph.vue.es-BaqCDjl8.js"),y=require("./useService-H7BjLg8P.js"),k=require("./getComposedString.es-haS4bAj7.js"),d=require("./Amount.vue.es-DExaYBqm.js"),h=require("./Divider.vue.es-UwnWvUTl.js"),C=require("./Expand.vue.es-BtM0EZEr.js"),p=require("./Button.vue.es-M_jXZda4.js"),B=require("./Section.vue.es-Btff-cLY.js"),u=e.defineComponent({__name:"invoicePreviewRow",props:{weight:{default:"normal"},variant:{default:"body-xs"},noSpacing:{type:Boolean,default:!1}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row gap-2",{"py-1.5":!t.noSpacing}])},[e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,class:"grow",weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"label")]),_:3},8,["variant","weight"]),e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"value")]),_:3},8,["variant","weight"])],2))}}),g=e.defineComponent({__name:"Skeleton",props:{widthClass:{default:"w-10"},heightClass:{default:"h-3"},shade:{default:"default"}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded",[t.widthClass,t.heightClass,{"bg-gray-50/50":t.shade==="default","bg-gray-100/50":t.shade==="dark","bg-gray-200/50":t.shade==="darker","bg-gray-400/50":t.shade==="darkest"}]])},null,2))}}),_=e.defineComponent({__name:"InvoicePreviewNoTaxesSkeleton",props:{widthClass:{default:"w-12"},heightClass:{default:"h-5"}},setup(t){const{$t:a}=r.useIntl();return(l,i)=>(e.openBlock(),e.createBlock(v._sfc_main,{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(v.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(v._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(g,{"width-class":t.widthClass,"height-class":t.heightClass,shade:"darker"},null,8,["width-class","height-class"])]),_:1}))}}),x=e.defineComponent({__name:"InvoicePreviewGroups",props:{invoice:{},wrapperComponent:{}},setup(t){const a=i=>i.groups.reduce((o,n)=>n.type in o?{...o,[n.type]:[...o[n.type],n]}:{...o,[n.type]:[n]},{}),l=i=>{var o,n,s;return(o=i.pricing)!=null&&o.name&&!y.isEmpty((n=i.pricing)==null?void 0:n.name)?i.pricing.name:k.getComposedString(((s=i.products)==null?void 0:s.map(c=>c.name))??[])};return(i,o)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.periods,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.entries(a(n)),([c,f])=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(m,w)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.wrapperComponent??"div"),{key:w},{default:e.withCtx(()=>[e.createVNode(u,{"no-spacing":t.wrapperComponent!==void 0},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(m)),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:m.amount_excluding_tax},null,8,["value"])]),_:2},1032,["no-spacing"])]),_:2},1024))),128))],64))),128))],64))),128))}}),b={class:"flex flex-col"},N=e.defineComponent({__name:"InvoicePreview",props:{invoice:{},trialInvoice:{},isCustomerFacing:{type:Boolean,default:!1},variant:{default:"default"},isPaid:{type:Boolean,default:!1},collapsible:{default:void 0},isPreviewWithoutTaxes:{type:Boolean}},setup(t){const a=t,{$t:l}=r.useIntl(),i=e.ref(a.collapsible!==void 0?a.collapsible!=="expanded":!1),o=e.computed(()=>a.collapsible!==void 0),n=e.computed(()=>!!a.trialInvoice),s=e.computed(()=>a.trialInvoice?a.trialInvoice.tax_summary.total_amount:a.invoice.tax_summary.total_amount),c=()=>{o.value&&(i.value=!i.value)};return(f,m)=>(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(C._sfc_main,{"is-open":!i.value,lazy:""},{default:e.withCtx(()=>[e.createElementVNode("div",null,[n.value?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.after_trial_heading",defaultMessage:"After trial",description:"After trial heading for the invoice preview"})),1)]),_:1})):e.createCommentVNode("",!0),t.variant!=="without-products"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(x,{invoice:t.invoice},null,8,["invoice"]),e.createVNode(h._sfc_main,{spacing:"xxs"})],64)):e.createCommentVNode("",!0),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_excluding_taxes_heading",defaultMessage:"Total excluding taxes",description:"Total excluding taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:t.invoice.tax_summary.base_amount},null,8,["value"])]),_:1}),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.taxes_heading",defaultMessage:"Taxes",description:"Taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.tax_amount},null,8,["value"]))]),_:1}),n.value?(e.openBlock(),e.createBlock(u,{key:2},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_including_taxes_heading",defaultMessage:"Total including taxes",description:"Total including taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.total_amount},null,8,["value"]))]),_:1})):e.createCommentVNode("",!0),e.createVNode(h._sfc_main,{spacing:"xxs"})])]),_:1},8,["is-open"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value?"button":"div"),{class:e.normalizeClass({"text-left hover:cursor-pointer":o.value}),onClick:c},{default:e.withCtx(()=>[e.createVNode(u,{weight:"semibold",variant:"body-sm"},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.isPaid?e.unref(l)({id:"invoice_preview.total_paid_heading",defaultMessage:"Total paid",description:"Total paid heading for the invoice preview"}):e.unref(l)({id:"invoice_preview.total_due_today_heading",defaultMessage:"Total due today",description:"Total due today heading for the invoice preview"}))+" ",1),o.value?(e.openBlock(),e.createBlock(p._sfc_main$1,{key:0,size:"xs",icon:"keyboard_arrow_down",class:e.normalizeClass(["text-gray-400 transition ease-in-out",{"rotate-0":i.value,"rotate-180":!i.value}])},null,8,["class"])):e.createCommentVNode("",!0)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes&&(!n.value||n.value&&s.value.quantity!=="0.00")?(e.openBlock(),e.createBlock(_,{key:0})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:s.value},null,8,["value"]))]),_:1})]),_:1},8,["class"]))]))}}),V={class:"sv-empty-state__body flex flex-col items-center justify-center py-2"},T={class:"sv-empty-state__action mt-3 empty:hidden"},S=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup(t){return(a,l)=>(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{class:"sv-empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(p._sfc_main$1),{icon:t.icon,size:"md",class:"sv-empty-state__icon text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",weight:"semibold",color:"subtle",class:"sv-empty-state__title mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"title")]),_:3}),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",color:"subtle",class:"sv-empty-state__message mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"message")]),_:3}),e.createElementVNode("div",T,[e.renderSlot(a.$slots,"action")])])]),_:3}))}});exports._sfc_main=S;exports._sfc_main$1=N;exports._sfc_main$2=g;exports._sfc_main$3=x;
1
+ const e=require("vue"),r=require("./customElements-CSzbVZIH.js"),v=require("./TooltipParagraph.vue.es-7IQdU3Tf.js"),y=require("./useService-H7BjLg8P.js"),k=require("./getComposedString.es-haS4bAj7.js"),d=require("./Amount.vue.es-DExaYBqm.js"),h=require("./Divider.vue.es-UwnWvUTl.js"),C=require("./Expand.vue.es-BtM0EZEr.js"),p=require("./Button.vue.es-TCF-bvDF.js"),B=require("./Section.vue.es-CBZx5x53.js"),u=e.defineComponent({__name:"invoicePreviewRow",props:{weight:{default:"normal"},variant:{default:"body-xs"},noSpacing:{type:Boolean,default:!1}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row gap-2",{"py-1.5":!t.noSpacing}])},[e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,class:"grow",weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"label")]),_:3},8,["variant","weight"]),e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"value")]),_:3},8,["variant","weight"])],2))}}),g=e.defineComponent({__name:"Skeleton",props:{widthClass:{default:"w-10"},heightClass:{default:"h-3"},shade:{default:"default"}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded",[t.widthClass,t.heightClass,{"bg-gray-50/50":t.shade==="default","bg-gray-100/50":t.shade==="dark","bg-gray-200/50":t.shade==="darker","bg-gray-400/50":t.shade==="darkest"}]])},null,2))}}),_=e.defineComponent({__name:"InvoicePreviewNoTaxesSkeleton",props:{widthClass:{default:"w-12"},heightClass:{default:"h-5"}},setup(t){const{$t:a}=r.useIntl();return(l,i)=>(e.openBlock(),e.createBlock(v._sfc_main,{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(v.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(v._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(g,{"width-class":t.widthClass,"height-class":t.heightClass,shade:"darker"},null,8,["width-class","height-class"])]),_:1}))}}),x=e.defineComponent({__name:"InvoicePreviewGroups",props:{invoice:{},wrapperComponent:{}},setup(t){const a=i=>i.groups.reduce((o,n)=>n.type in o?{...o,[n.type]:[...o[n.type],n]}:{...o,[n.type]:[n]},{}),l=i=>{var o,n,s;return(o=i.pricing)!=null&&o.name&&!y.isEmpty((n=i.pricing)==null?void 0:n.name)?i.pricing.name:k.getComposedString(((s=i.products)==null?void 0:s.map(c=>c.name))??[])};return(i,o)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.periods,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.entries(a(n)),([c,f])=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(m,w)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.wrapperComponent??"div"),{key:w},{default:e.withCtx(()=>[e.createVNode(u,{"no-spacing":t.wrapperComponent!==void 0},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(m)),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:m.amount_excluding_tax},null,8,["value"])]),_:2},1032,["no-spacing"])]),_:2},1024))),128))],64))),128))],64))),128))}}),b={class:"flex flex-col"},N=e.defineComponent({__name:"InvoicePreview",props:{invoice:{},trialInvoice:{},isCustomerFacing:{type:Boolean,default:!1},variant:{default:"default"},isPaid:{type:Boolean,default:!1},collapsible:{default:void 0},isPreviewWithoutTaxes:{type:Boolean}},setup(t){const a=t,{$t:l}=r.useIntl(),i=e.ref(a.collapsible!==void 0?a.collapsible!=="expanded":!1),o=e.computed(()=>a.collapsible!==void 0),n=e.computed(()=>!!a.trialInvoice),s=e.computed(()=>a.trialInvoice?a.trialInvoice.tax_summary.total_amount:a.invoice.tax_summary.total_amount),c=()=>{o.value&&(i.value=!i.value)};return(f,m)=>(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(C._sfc_main,{"is-open":!i.value,lazy:""},{default:e.withCtx(()=>[e.createElementVNode("div",null,[n.value?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.after_trial_heading",defaultMessage:"After trial",description:"After trial heading for the invoice preview"})),1)]),_:1})):e.createCommentVNode("",!0),t.variant!=="without-products"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(x,{invoice:t.invoice},null,8,["invoice"]),e.createVNode(h._sfc_main,{spacing:"xxs"})],64)):e.createCommentVNode("",!0),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_excluding_taxes_heading",defaultMessage:"Total excluding taxes",description:"Total excluding taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:t.invoice.tax_summary.base_amount},null,8,["value"])]),_:1}),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.taxes_heading",defaultMessage:"Taxes",description:"Taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.tax_amount},null,8,["value"]))]),_:1}),n.value?(e.openBlock(),e.createBlock(u,{key:2},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_including_taxes_heading",defaultMessage:"Total including taxes",description:"Total including taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.total_amount},null,8,["value"]))]),_:1})):e.createCommentVNode("",!0),e.createVNode(h._sfc_main,{spacing:"xxs"})])]),_:1},8,["is-open"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value?"button":"div"),{class:e.normalizeClass({"text-left hover:cursor-pointer":o.value}),onClick:c},{default:e.withCtx(()=>[e.createVNode(u,{weight:"semibold",variant:"body-sm"},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.isPaid?e.unref(l)({id:"invoice_preview.total_paid_heading",defaultMessage:"Total paid",description:"Total paid heading for the invoice preview"}):e.unref(l)({id:"invoice_preview.total_due_today_heading",defaultMessage:"Total due today",description:"Total due today heading for the invoice preview"}))+" ",1),o.value?(e.openBlock(),e.createBlock(p._sfc_main$1,{key:0,size:"xs",icon:"keyboard_arrow_down",class:e.normalizeClass(["text-gray-400 transition ease-in-out",{"rotate-0":i.value,"rotate-180":!i.value}])},null,8,["class"])):e.createCommentVNode("",!0)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes&&(!n.value||n.value&&s.value.quantity!=="0.00")?(e.openBlock(),e.createBlock(_,{key:0})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:s.value},null,8,["value"]))]),_:1})]),_:1},8,["class"]))]))}}),V={class:"sv-empty-state__body flex flex-col items-center justify-center py-2"},T={class:"sv-empty-state__action mt-3 empty:hidden"},S=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup(t){return(a,l)=>(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{class:"sv-empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(p._sfc_main$1),{icon:t.icon,size:"md",class:"sv-empty-state__icon text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",weight:"semibold",color:"subtle",class:"sv-empty-state__title mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"title")]),_:3}),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",color:"subtle",class:"sv-empty-state__message mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"message")]),_:3}),e.createElementVNode("div",T,[e.renderSlot(a.$slots,"action")])])]),_:3}))}});exports._sfc_main=S;exports._sfc_main$1=N;exports._sfc_main$2=g;exports._sfc_main$3=x;
@@ -0,0 +1 @@
1
+ const e=require("vue"),i=require("./Alert.vue.es-RyK53a2P.js"),c=require("./customElements-CSzbVZIH.js"),a={class:"grid gap-1"},l={class:"font-medium"},d={key:0},m=e.defineComponent({__name:"ErrorNotification",props:{title:{},description:{}},setup(t){const{formatMessage:o}=c.useIntl(),s=t,n=e.computed(()=>s.title??o({defaultMessage:"Something went wrong",id:"error_notification.default_error_message",description:"The default message to display"}));return(r,u)=>(e.openBlock(),e.createBlock(i._sfc_main,e.mergeProps({type:"danger"},r.$attrs),{default:e.withCtx(()=>[e.createElementVNode("div",a,[e.createElementVNode("span",l,e.toDisplayString(n.value),1),t.description?(e.openBlock(),e.createElementBlock("span",d,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])]),_:1},16))}});exports._sfc_main=m;