@solvimon/solvimon-web 0.1.0-alpha.17 → 0.1.0-alpha.18

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 (168) hide show
  1. package/README.md +28 -26
  2. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-C2IRj-FB.mjs +238 -0
  3. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Rub9ifBk.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BrPsTuoW.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BWnZ98RQ.mjs} +2 -2
  5. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BuQ8bzar.js → BillingInformation.vue_vue_type_script_setup_true_lang-DurgWlLC.js} +1 -1
  6. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CuWrBcoK.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D7gL7dZX.mjs} +3 -3
  7. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Df7CsbiW.js +1 -0
  8. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-OUg4yv7r.mjs +2654 -0
  9. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-mM5udvi8.js +1 -0
  10. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BIpg-MSJ.mjs +53 -0
  11. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BM3p8Pk8.js +1 -0
  12. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D5eSNYH2.js +1 -0
  13. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-wxP5IaGt.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DbY35gE_.mjs} +1 -1
  14. package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-05NKI2A0.js → InvoiceHeader.vue_vue_type_script_setup_true_lang-Ci8r6tuC.js} +1 -1
  15. package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-17v07F58.mjs → InvoiceHeader.vue_vue_type_script_setup_true_lang-jshby9pF.mjs} +1 -1
  16. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-CNKxTtO7.js +1 -0
  17. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBMgilG2.mjs +153 -0
  18. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CupZFJSF.mjs +52 -0
  19. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D6lpD1zo.js +1 -0
  20. package/dist/{PaymentHistoryBlock-BitwS9Re.mjs → PaymentHistoryBlock-Bxr8lUGs.mjs} +1 -1
  21. package/dist/{PaymentHistoryBlock-ZtmPXXwI.js → PaymentHistoryBlock-COjIVYX4.js} +1 -1
  22. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Bmgx7PSt.js +1 -0
  23. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3ZUDUdw.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CDjGab5p.mjs} +1 -1
  24. package/dist/{PaymentIntegrationForm-BZTzCUiu.js → PaymentIntegrationForm-BSauhuKv.js} +1 -1
  25. package/dist/{PaymentIntegrationForm-BK2aLPCo.mjs → PaymentIntegrationForm-PIT8gHYN.mjs} +1 -1
  26. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-5XKz3kop.js +1 -0
  27. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-COO2ZUhN.mjs +148 -0
  28. package/dist/PaymentIntegrationFormAdyen-B-Jbu2hU.js +1 -0
  29. package/dist/PaymentIntegrationFormAdyen-Cjj9aK0E.mjs +729 -0
  30. package/dist/PaymentIntegrationFormStripe-Bnn8S1o5.js +1 -0
  31. package/dist/PaymentIntegrationFormStripe-arpua_ZT.mjs +545 -0
  32. package/dist/PaymentMethodForm-B7T5rrNz.mjs +4 -0
  33. package/dist/PaymentMethodForm-CLz3ZS-b.js +1 -0
  34. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-C4Zf92QP.mjs} +2 -2
  35. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-zRr8iihy.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-UH9AVXnG.js} +1 -1
  36. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CIIt6fGp.mjs} +76 -30
  37. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-ifai5HVr.js +1 -0
  38. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D1TcP9PR.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DaWlLor0.mjs} +2 -2
  39. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DdUoeTUL.js +1 -0
  40. package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BMXr26gF.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-CyYhYYRp.mjs} +1 -1
  41. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DdjYVNku.js +1 -0
  42. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-Cu55ZvCH.js +1 -0
  43. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3cqlbGY.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-z8P1u1Gi.mjs} +16 -63
  44. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-BKDMwuyh.js +1 -0
  45. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BDqX6OaE.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BOUSk2ZB.mjs} +5 -5
  46. package/dist/adyen-BMDZQBUG.js +1 -0
  47. package/dist/{url-BjZ1Pg0l.mjs → adyen-Ba-mF3Jy.mjs} +31 -73
  48. package/dist/component--Y7Igv5i.mjs +1022 -0
  49. package/dist/component-DIy1hvJM.js +1 -0
  50. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  51. package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
  52. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  53. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +4 -4
  54. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  55. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
  56. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  57. package/dist/components/Invoice/Invoice.es.js +7 -7
  58. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  59. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  60. package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
  61. package/dist/components/InvoiceHeader/InvoiceHeader.es.js +4 -4
  62. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  63. package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
  64. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  65. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  66. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  67. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +6 -6
  68. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  69. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +4 -4
  70. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  71. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
  72. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  73. package/dist/components/WalletBalances/WalletBalances.es.js +21 -7
  74. package/dist/core/action-request.types.d.ts +1 -13
  75. package/dist/core/index.cjs.js +1 -1
  76. package/dist/core/index.es.js +1 -1
  77. package/dist/{customer-DAgdegIW.mjs → customer-DovIxTG1.mjs} +1 -1
  78. package/dist/{customer-AfRcAZ5P.js → customer-brfznoHY.js} +1 -1
  79. package/dist/en-US-BvOHPudj.js +1 -0
  80. package/dist/{en-US-DSzSbgL5.mjs → en-US-CXDO3qhq.mjs} +53 -0
  81. package/dist/index-BMWWP8xj.js +1 -0
  82. package/dist/index-Do7kzLpg.mjs +265 -0
  83. package/dist/index.cjs.js +1 -1
  84. package/dist/index.es.js +1 -1
  85. package/dist/{invoices-BHgajZHq.js → invoices-Cf3dSYSj.js} +1 -1
  86. package/dist/{invoices-BXDgW8ch.mjs → invoices-Dk-z04lg.mjs} +2 -2
  87. package/dist/{nl-NL-Li7RW89R.mjs → nl-NL-BgL_PuBn.mjs} +55 -1
  88. package/dist/nl-NL-COGUFg60.js +1 -0
  89. package/dist/{paymentMethods-xzFD2L30.mjs → paymentMethods-BnF1XYS1.mjs} +21 -5
  90. package/dist/paymentMethods-DVDC_WfL.js +1 -0
  91. package/dist/{payments-DMvmB5vg.js → payments-DVZFO5yb.js} +1 -1
  92. package/dist/{payments-DV6csRej.mjs → payments-TnRjtlOw.mjs} +1 -1
  93. package/dist/{pricing-BEjY_5wb.js → pricing-CuYndX6t.js} +1 -1
  94. package/dist/{pricing-B1uImUm4.mjs → pricing-GwLCiSzs.mjs} +1 -1
  95. package/dist/{pricingPlanSchedule-C_cqUyTk.mjs → pricingPlanSchedule-CXG3CQ61.mjs} +3 -1
  96. package/dist/{registry-CyENvS6l.mjs → registry-Ck0Gb6rj.mjs} +1 -1
  97. package/dist/{registry-CeMxLjwU.js → registry-Cra6yoB4.js} +1 -1
  98. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  99. package/dist/screens/Checkout/Checkout.es.js +37 -36
  100. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  101. package/dist/screens/CustomerOverview/CustomerOverview.es.js +32 -56
  102. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
  103. package/dist/screens/PayInvoice/PayInvoice.es.js +28 -12
  104. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
  105. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +28 -18
  106. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs.js +1 -1
  107. package/dist/screens/SubscriptionDetails/SubscriptionDetails.es.js +436 -89
  108. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs.js +1 -1
  109. package/dist/screens/SubscriptionManagement/SubscriptionManagement.es.js +28 -37
  110. package/dist/solvimon-web.css +1 -1
  111. package/dist/{subscription-B4dBAY9C.mjs → subscription-C41lG-rH.mjs} +1 -1
  112. package/dist/subscriptions-BFCKVHnP.js +1 -0
  113. package/dist/subscriptions-vEE4Y7qm.mjs +58 -0
  114. package/dist/{useActionDispatchProvider-zB_GKeUR.mjs → useActionDispatchProvider-BlEf-RZ5.mjs} +1 -1
  115. package/dist/{useActionDispatchProvider-bqR_FeM4.js → useActionDispatchProvider-aJOy3kr1.js} +1 -1
  116. package/dist/{useCustomer-bO4D6e4Z.js → useCustomer-C1XTqmrQ.js} +1 -1
  117. package/dist/{useCustomer-VfeQ6rG2.mjs → useCustomer-Cw8LXT6S.mjs} +2 -2
  118. package/dist/{useIncrementalLoading-C59FXHzp.mjs → useIncrementalLoading-8WtKZ-mP.mjs} +2 -2
  119. package/dist/useIncrementalLoading-CkY2klIW.js +1 -0
  120. package/dist/{useInvoiceData-CxxkBTGY.js → useInvoiceData-BrxMo4Zt.js} +1 -1
  121. package/dist/{useInvoiceData-Dhg-hx8C.mjs → useInvoiceData-Cy_ysMsq.mjs} +2 -2
  122. package/dist/{useInvoicesList-DBz7T7sM.mjs → useInvoicesList-DMsZn1tE.mjs} +4 -4
  123. package/dist/{useInvoicesList-BXZ9uV9i.js → useInvoicesList-DmisMQzy.js} +1 -1
  124. package/dist/{useLoadInitialData-BhpIg7OF.mjs → useLoadInitialData-BP1v7qhd.mjs} +1 -1
  125. package/dist/{useLoadInitialData-BqiAFNFi.js → useLoadInitialData-_BjCD0Jc.js} +1 -1
  126. package/dist/{usePaymentMethodOptions-PcMjtMSF.mjs → usePaymentMethodOptions-CWfGvW0U.mjs} +9 -3
  127. package/dist/{usePaymentMethodOptions-DszFvgKX.js → usePaymentMethodOptions-xeSTmaVo.js} +1 -1
  128. package/dist/{usePaymentMethods-Bb1Xbads.js → usePaymentMethods-CAFMvSOr.js} +1 -1
  129. package/dist/{usePaymentMethods-B5AbGWsn.mjs → usePaymentMethods-Cyk4cjoE.mjs} +2 -2
  130. package/dist/{usePayments-is5c66Z6.js → usePayments-BieVBaz-.js} +1 -1
  131. package/dist/{usePayments-DgoZoBZh.mjs → usePayments-D88XSZfS.mjs} +10 -4
  132. package/dist/{usePortal-DWLtNqBB.mjs → usePortal-0NDlbFr9.mjs} +1 -1
  133. package/dist/{usePortal-C4qWsJeq.js → usePortal-B954nyEB.js} +1 -1
  134. package/dist/{useService-DKm3QtT4.js → useService-BiljI7XA.js} +1 -1
  135. package/dist/{useService-BZqFkz7p.mjs → useService-CqfJi5ST.mjs} +1 -1
  136. package/dist/{useSubscription-CEZJw6wZ.mjs → useSubscription-9rJpFNUF.mjs} +9 -3
  137. package/dist/{useSubscription-DuUNc1_l.js → useSubscription-k3limdu_.js} +1 -1
  138. package/dist/vendor-ui-Dfh3_g4q.js +1 -0
  139. package/dist/{vendor-ui-BoGKOJ36.mjs → vendor-ui-ItGf7wJV.mjs} +1912 -1800
  140. package/package.json +12 -5
  141. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-1Op9GjGZ.js +0 -1
  142. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js +0 -1
  143. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D2BhuXsh.mjs +0 -77
  144. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js +0 -1
  145. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-dwIv_xxf.js +0 -1
  146. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CMGK71zZ.js +0 -1
  147. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B_yDNGK8.mjs +0 -1537
  148. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-GN3WAr10.js +0 -1
  149. package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-BQIN3zuf.mjs +0 -156
  150. package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DyL2-vV0.js +0 -1
  151. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-OvGGejpX.js +0 -1
  152. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BxqIfmkK.js +0 -1
  153. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js +0 -1
  154. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CyAFjCh7.js +0 -1
  155. package/dist/component-CUJ_G2Nw.mjs +0 -962
  156. package/dist/component-CiKxWtdx.js +0 -1
  157. package/dist/en-US-QzQnGXP1.js +0 -1
  158. package/dist/index-CzL1ZcGi.mjs +0 -85
  159. package/dist/index-DRdBmZ2-.js +0 -1
  160. package/dist/nl-NL-C4rr-1tr.js +0 -1
  161. package/dist/paymentMethods-BMcc-eTl.js +0 -1
  162. package/dist/subscriptions-CrNDM9qa.mjs +0 -79
  163. package/dist/subscriptions-DC-mxa17.js +0 -1
  164. package/dist/url-D8GJi5rF.js +0 -1
  165. package/dist/useIncrementalLoading-BgWuwoMo.js +0 -1
  166. package/dist/useTopUpModal-DNyWrHDv.mjs +0 -1012
  167. package/dist/useTopUpModal-DeF-cfCK.js +0 -1
  168. package/dist/vendor-ui-BuRqLx74.js +0 -1
@@ -1 +0,0 @@
1
- const e=require("vue"),t=require("./vendor-ui-BuRqLx74.js"),n=require("./url-D8GJi5rF.js"),a=require("./payments-DMvmB5vg.js"),o=require("./paymentMethods-BMcc-eTl.js"),r=require("./component-CiKxWtdx.js"),i=e=>{var t;return"ADYEN"===(null==(t=e.integration.payment_gateway)?void 0:t.variant)},s=e=>{var t;return"STRIPE"===(null==(t=e.integration.payment_gateway)?void 0:t.variant)},c=({selectedIntegration:e,paymentMethodOption:t})=>{var n,a;return e===(null==(a=null==(n=t.integration)?void 0:n.payment_gateway)?void 0:a.variant)},d="https://js.stripe.com/dahlia/stripe.js",m=`<!DOCTYPE html>\n<html>\n<head>\n<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width, initial-scale=1">\n<style>\n* { box-sizing: border-box; margin: 0; padding: 0; }\nbody { overflow: hidden; }\n</style>\n</head>\n<body>\n<div id="stripe-root"></div>\n<script src="${d}"><\/script>\n<script>\n(function () {\n let stripe, elements, countryCode, email, name, parentOrigin;\n\n window.addEventListener('message', function (event) {\n if (!event.data || typeof event.data !== 'object') return;\n if (event.source !== window.parent) return;\n\n if (event.data.type === 'stripe:init') {\n parentOrigin = event.origin;\n countryCode = event.data.countryCode;\n email = event.data.email;\n name = event.data.name;\n stripe = Stripe(event.data.publicKey);\n elements = stripe.elements(event.data.options);\n const paymentElement = elements.create('payment', { layout: { type: 'accordion', defaultCollapsed: false }, wallets: event.data.options.wallets, fields: event.data.options.fields });\n\n paymentElement.on('ready', function () {\n parent.postMessage({ type: 'stripe:ready' }, parentOrigin);\n });\n\n paymentElement.on('change', function (e) {\n parent.postMessage({ type: 'stripe:change', paymentMethodType: e.value.type }, parentOrigin);\n });\n\n paymentElement.on('loaderror', function (e) {\n parent.postMessage({\n type: 'stripe:loaderror',\n error: { message: e.error.message, type: e.error.type }\n }, parentOrigin);\n });\n\n paymentElement.mount('#stripe-root');\n\n new ResizeObserver(function () {\n parent.postMessage({\n type: 'stripe:resize',\n height: document.documentElement.scrollHeight\n }, parentOrigin);\n }).observe(document.documentElement);\n }\n\n if (event.data.type === 'stripe:submit') {\n if (!elements || !parentOrigin || event.origin !== parentOrigin) return;\n const submitEmail = 'email' in event.data ? event.data.email : email;\n const submitName = 'name' in event.data ? event.data.name : name;\n elements.submit().then(function (submitResult) {\n if (submitResult.error) {\n parent.postMessage({\n type: 'stripe:submit:error',\n error: {\n message: submitResult.error.message,\n type: submitResult.error.type,\n code: submitResult.error.code\n }\n }, parentOrigin);\n return;\n }\n const billingDetails = {};\n if (countryCode) billingDetails.address = { country: countryCode };\n if (submitEmail) billingDetails.email = submitEmail;\n if (submitName) billingDetails.name = submitName;\n const tokenParams = Object.keys(billingDetails).length\n ? { payment_method_data: { billing_details: billingDetails } }\n : {};\n stripe.createConfirmationToken({ elements: elements, params: tokenParams }).then(function (tokenResult) {\n if (tokenResult.error) {\n parent.postMessage({\n type: 'stripe:submit:error',\n error: {\n message: tokenResult.error.message,\n type: tokenResult.error.type,\n code: tokenResult.error.code\n }\n }, parentOrigin);\n return;\n }\n parent.postMessage({\n type: 'stripe:submit:success',\n confirmationTokenId: tokenResult.confirmationToken.id\n }, parentOrigin);\n });\n });\n }\n });\n})();\n<\/script>\n</body>\n</html>`,u=["src","height"],p=e.defineComponent({__name:"PaymentIntegrationFormStripeFrame",props:{publicKey:{type:String},options:{type:Object},countryCode:{type:String},email:{type:String},name:{type:String}},emits:["ready","change","loaderror","submit-success","submit-error"],setup(n,{expose:a,emit:o}){const r=n,i=o;a({triggerSubmit:function(){var e,t;null==(t=null==(e=s.value)?void 0:e.contentWindow)||t.postMessage({type:"stripe:submit",email:r.email,name:r.name},"*")}});const s=e.ref(),c=e.ref(0),d=e.ref();function p(){var e,t;null==(t=null==(e=s.value)?void 0:e.contentWindow)||t.postMessage({type:"stripe:init",publicKey:r.publicKey,options:r.options,countryCode:r.countryCode,email:r.email,name:r.name},"*")}function l(e){return"object"==typeof e&&null!==e}function y(e){if(!s.value||e.source!==s.value.contentWindow)return;if(!l(e.data))return;const t=e.data,n=t.type;if("string"==typeof n&&n.startsWith("stripe:"))switch(n){case"stripe:ready":i("ready");break;case"stripe:change":i("change","string"==typeof t.paymentMethodType?t.paymentMethodType:"card");break;case"stripe:loaderror":{const e=l(t.error)?t.error:{};i("loaderror",{message:"string"==typeof e.message?e.message:void 0,type:"string"==typeof e.type?e.type:void 0});break}case"stripe:resize":"number"==typeof t.height&&(c.value=t.height);break;case"stripe:submit:success":"string"==typeof t.confirmationTokenId&&i("submit-success",t.confirmationTokenId);break;case"stripe:submit:error":{const e=l(t.error)?t.error:{};i("submit-error",{message:"string"==typeof e.message?e.message:void 0,type:"string"==typeof e.type?e.type:void 0,code:"string"==typeof e.code?e.code:void 0});break}}}return e.onMounted(()=>{const e=new Blob([m],{type:"text/html"});d.value=URL.createObjectURL(e),window.addEventListener("message",y)}),e.onBeforeUnmount(()=>{window.removeEventListener("message",y),d.value&&URL.revokeObjectURL(d.value)}),e.watch(()=>r.options,(e,n)=>{t.isEqual(e,n)||p()},{deep:!0}),(t,n)=>(e.openBlock(),e.createElementBlock("iframe",{ref_key:"iframeRef",ref:s,src:d.value,height:c.value||void 0,frameborder:"0",style:{width:"100%",display:"block",border:"none"},title:"Payment form",onLoad:p},null,40,u))}}),l={link:"never"},y={variables:{borderRadius:"4px",colorBackground:"rgba(243, 244, 246, 0.5)"},rules:{".TermsText":{fontSize:"14px"},".Input":{backgroundColor:"rgba(243, 244, 246, 0.5)",fontSize:"14px",borderColor:"rgb(229, 231, 235)"}}};const h=e.defineComponent({__name:"PaymentCompletedCard",props:{amount:{type:Object},variant:{type:String}},setup(a){const o=a,{$t:r}=t.useIntl(),i=e.computed(()=>"AUTHORIZE"===o.variant?r({defaultMessage:"Payment successful",description:"The title for when a payment has been successful",id:"payment_completed_card.title.authorize"}):r({defaultMessage:"Your payment method is added",description:"The title for when a payment method was successfully added",id:"payment_completed_card.title.tokenize"}));return(o,s)=>(e.openBlock(),e.createBlock(n._sfc_main,{status:"success",title:i.value},{default:e.withCtx(()=>[a.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$9),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(a.amount)),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"You are being redirected...",description:"The text shown after a successful message before a redirect",id:"payment_completed_card.redirect_message"})),1)]),_:1})]),_:1},8,["title"]))}}),f={UNKNOWN_ERROR:{title:"Something went wrong",message:"An unknown error has occurred",isReloadButtonVisible:!0},AUTHORIZATION_FAILED:{title:"Payment failed",message:"The payment failed"},PAYMENT_DETAILS_CALL_FAILED:{title:"Payment details call failed",message:"There was a problem getting the payment details"},PAYMENT_METHOD_STORAGE_FAILED:{title:"Failed storing payment method",message:"Something went wrong with storing the payment method"},REDIRECT_RESULT_PAYMENT_ACCEPTOR_MISSING:{title:"Missing payment acceptor",message:"A redirect result is set, but a payment acceptor is missing in the url"},TOKENIZE_FAILED:{title:"Tokenization failed",message:"The tokenization of the payment method has failed"},PAYMENT_INTEGRATION_INITIALIZATION_FAILED:{title:"Failed loading payment methods",message:"Failed loading payment integration",isReloadButtonVisible:!0},RESOURCE_REVOKED:{title:"Resource revoked",message:"The resource has been revoked",isReloadButtonVisible:!0}},_={class:"flex flex-col items-center gap-6"},g=e.defineComponent({__name:"PaymentErrorCard",props:{error:{type:Object}},setup(a){const o=a,{$t:r}=t.useIntl(),i=e.computed(()=>f[o.error.code]),s=()=>{window.location.reload()};return(a,o)=>(e.openBlock(),e.createBlock(n._sfc_main,{status:"error",title:i.value.title},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter",class:"mt-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.message),1)]),_:1}),i.value.isReloadButtonVisible?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,type:"button",color:"gray",variant:"outline",onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Try again",description:"Retry button text when an error has happened during a payment",id:"payments.retry_button.label"})),1)]),_:1})):e.createCommentVNode("",!0)])]),_:1},8,["title"]))}}),v="STRIPE",E=e.defineComponent({__name:"PaymentIntegrationFormStripe",props:{countryCode:{type:String},customerId:{type:String},invoiceId:{type:String},paymentMethodOptionResponseEntry:{type:Object},variant:{type:String},selected:{type:Boolean},amount:{type:Object},validateOnSubmit:{type:Function,default:()=>Promise.resolve(!0)},context:{type:Object},email:{type:String},name:{type:String},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(t,{expose:i,emit:s}){const c=t,m=s;i({submit:function(){(async function(){var e;if(!(await c.validateOnSubmit()))return;null==(e=_.value)||e.triggerSubmit()})().catch(e=>{R.error("STRIPE_SUBMIT_FAILED","Unexpected error during Stripe submission",{},e)})}});const u=e.ref(!1),f=e.ref(),_=e.ref(),E=e.computed(()=>function({amount:e,email:t,name:a,variant:o}){const r=e.currency.toLowerCase(),i=function(e,t){return{billingDetails:{address:{country:"never"},...e?{email:"never"}:{},...t?{name:"never"}:{}}}}(t,a);return"TOKENIZE"===o?{mode:"setup",currency:r,setup_future_usage:"off_session",wallets:l,fields:i,appearance:y}:{mode:"payment",currency:r,amount:n.toMinorUnitAmount(e).value,setup_future_usage:"off_session",wallets:l,fields:i,appearance:y}}({amount:c.amount,email:c.email,name:c.name,variant:c.variant})),b=e.ref(null),R=r.useLogger(),{authorizePayment:I}=a.createPaymentsService(),{tokenizePaymentMethod:k}=o.createPaymentMethodsService(),O=e.computed(()=>{var e,t;return null==(t=null==(e=c.paymentMethodOptionResponseEntry.integration.payment_gateway)?void 0:e.stripe)?void 0:t.public_key});async function T(){if(b.value)return b.value;const e=O.value;if(!e)throw new Error("Missing Stripe public key");const t=await function(e){return new Promise((t,n)=>{if(window.Stripe)return void t(window.Stripe(e));const a=document.createElement("script");a.src=d,a.onload=()=>{window.Stripe?t(window.Stripe(e)):n(new Error("Stripe not available after script load"))},a.onerror=()=>n(new Error("Failed to load Stripe.js")),document.head.appendChild(a)})}(e);return b.value=t,t}async function A(e){const t=c.paymentMethodOptionResponseEntry.payment_acceptor.id,a=n.createReturnUrl({paymentAcceptorId:t,redirectUrl:window.location.href});if("AUTHORIZE"!==c.variant){if("TOKENIZE"===c.variant){if(!c.customerId)return void R.error("TOKENIZATION_FAILED",`Missing customer id for payment acceptor with id ${t}`);try{const n=await k({customer_id:c.customerId,payment_acceptor_id:t,payment_gateway_variant:v,stripe:{confirmation_token_id:e},return_url:a});await N(n)}catch(o){R.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${t}`,{error:o}),S({code:"UNKNOWN_ERROR",message:"Tokenization failed",error:o})}}}else try{const n=await I({payment_acceptor_id:t,...c.customerId?{customer_id:c.customerId}:{},payment_gateway_variant:v,stripe:{confirmation_token_id:e},amount:c.amount,...c.context&&"CHARGE_ON_DEMAND"!==c.context.type?{context:c.context}:{},return_url:a});await N(n)}catch(o){R.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${t}`,{error:o}),S({code:"UNKNOWN_ERROR",message:"Payment authorization failed",error:o})}}async function N(e){var t;if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===v){const a=e.action.client_secret||(null==(t=e.action.data)?void 0:t.client_secret);if(!a)return R.error("STRIPE_ACTION_FAILED","Missing client_secret in Stripe ACTION_REQUIRED response"),void S({code:"UNKNOWN_ERROR",message:"Payment action failed",error:e});let o;try{o=await T()}catch(n){return R.error("STRIPE_ACTION_FAILED","Failed to load Stripe.js",{error:n}),void S({code:"UNKNOWN_ERROR",message:"Payment action failed",error:n})}const{error:r}=await o.handleNextAction({clientSecret:a});return r?(R.error("STRIPE_ACTION_FAILED","Stripe handleNextAction failed",{error:r}),void S({code:"UNKNOWN_ERROR",message:"Payment action failed",error:r})):(u.value=!0,void m("payment-success"))}if("SUCCESS"===e.status)return u.value=!0,void m("payment-success");R.error("STRIPE_ACTION_FAILED","Unexpected payment result status",{error:e}),S({code:"UNKNOWN_ERROR",message:"Payment failed",error:e})}function P(){m("select",{paymentMethodType:"card",paymentGatewayVariant:v}),m("ready")}function w(e){S({code:"UNKNOWN_ERROR",message:e.message??"Failed to load payment form",error:e})}function S(e){f.value=e,m("payment-failed",e)}return e.onMounted(()=>{(async function(){const e=c.paymentMethodOptionResponseEntry.payment_acceptor.id;if(n.getQueryParam(n.PAYMENT_ACCEPTOR_ID_QUERY_STRING)!==e)return;const t=n.getQueryParam("redirect_status"),a=n.getQueryParam("payment_intent_client_secret"),o=n.getQueryParam("setup_intent_client_secret");if(t&&(a||o)){if("succeeded"===t)return u.value=!0,void m("payment-success");R.error("STRIPE_REDIRECT_RETURN_FAILED","Stripe redirect returned non-succeeded status",{redirectStatus:t}),S({code:"UNKNOWN_ERROR",message:"Payment failed",error:new globalThis.Error(`Stripe redirect returned status: ${t}`)})}})().catch(e=>{R.error("STRIPE_REDIRECT_RETURN_FAILED","handleRedirectReturn threw unexpectedly",{error:e})})}),e.onBeforeUnmount(()=>{b.value=null}),(n,a)=>u.value?(e.openBlock(),e.createBlock(h,{key:0,variant:t.variant},null,8,["variant"])):f.value?(e.openBlock(),e.createBlock(g,{key:1,error:f.value},null,8,["error"])):O.value?(e.openBlock(),e.createBlock(p,{key:2,ref_key:"frameRef",ref:_,"public-key":O.value,options:E.value,"country-code":t.countryCode,email:t.email,name:t.name,onReady:P,onChange:a[0]||(a[0]=e=>m("select",{paymentMethodType:e,paymentGatewayVariant:v})),onLoaderror:w,onSubmitSuccess:A,onSubmitError:a[1]||(a[1]=t=>e.unref(R).error("STRIPE_CONFIRMATION_TOKEN_FAILED","Stripe submission failed",{error:t}))},null,8,["public-key","options","country-code","email","name"])):e.createCommentVNode("",!0)}}),b=e=>{let t={};return"TOKENIZE"===e&&(t={"en-US":{payButton:"Add payment method",confirmPurchase:"Add payment method"},"fr-FR":{payButton:"Ajouter un moyen de paiement",confirmPurchase:"Ajouter un moyen de paiement"},"de-DE":{payButton:"Zahlungsmethode hinzufügen",confirmPurchase:"Zahlungsmethode hinzufügen"},"it-IT":{payButton:"Aggiungi metodo di pagamento",confirmPurchase:"Aggiungi metodo di pagamento"},"es-ES":{payButton:"Añadir método de pago",confirmPurchase:"Añadir método de pago"},"nl-NL":{payButton:"Betaalmethode toevoegen",confirmPurchase:"Betaalmethode toevoegen"},"pt-BR":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pt-PT":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pl-PL":{payButton:"Dodaj metodę płatności",confirmPurchase:"Dodaj metodę płatności"},"ru-RU":{payButton:"Добавить способ оплаты",confirmPurchase:"Добавить способ оплаты"},"sv-SE":{payButton:"Lägg till betalningsmetod",confirmPurchase:"Lägg till betalningsmetod"},"da-DK":{payButton:"Tilføj betalingsmetode",confirmPurchase:"Tilføj betalingsmetode"},"fi-FI":{payButton:"Lisää maksutapa",confirmPurchase:"Lisää maksutapa"},"no-NO":{payButton:"Legg til betalingsmetode",confirmPurchase:"Legg til betalingsmetode"},"cs-CZ":{payButton:"Přidat platební metodu",confirmPurchase:"Přidat platební metodu"},"hu-HU":{payButton:"Fizetési mód hozzáadása",confirmPurchase:"Fizetési mód hozzáadása"},"ro-RO":{payButton:"Adăugați metodă de plată",confirmPurchase:"Adăugați metodă de plată"},"ja-JP":{payButton:"支払い方法を追加",confirmPurchase:"支払い方法を追加"},"ko-KR":{payButton:"결제 수단 추가",confirmPurchase:"결제 수단 추가"},"zh-CN":{payButton:"添加支付方式",confirmPurchase:"添加支付方式"},"zh-TW":{payButton:"新增付款方式",confirmPurchase:"新增付款方式"},ar:{payButton:"إضافة وسيلة دفع",confirmPurchase:"إضافة وسيلة دفع"},"hr-HR":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"el-GR":{payButton:"Προσθήκη μεθόδου πληρωμής",confirmPurchase:"Προσθήκη μεθόδου πληρωμής"},"sk-SK":{payButton:"Pridať spôsob platby",confirmPurchase:"Pridať spôsob platby"},"sl-SI":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"bg-BG":{payButton:"Добавяне на начин на плащане",confirmPurchase:"Добавяне на начин на плащане"},"ca-ES":{payButton:"Afegir mètode de pagament",confirmPurchase:"Afegir mètode de pagament"},"et-EE":{payButton:"Lisa makseviis",confirmPurchase:"Lisa makseviis"},"lv-LV":{payButton:"Pievienot maksājuma veidu",confirmPurchase:"Pievienot maksājuma veidu"},"lt-LT":{payButton:"Pridėti mokėjimo metodą",confirmPurchase:"Pridėti mokėjimo metodą"}}),t},R=["applepay"];const I="ADYEN",k=e.defineComponent({__name:"PaymentIntegrationFormAdyen",props:{countryCode:{type:String},customerId:{type:String},invoiceId:{type:String},paymentMethodOptionResponseEntry:{type:Object},variant:{type:String},selected:{type:Boolean},amount:{type:Object},validateOnSubmit:{type:Function,default:()=>Promise.resolve(!0)},context:{type:Object},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(i,{expose:s,emit:c}){let d=null,m=null;const u=i,p=c;s({submit:function(){try{null==d||d.submit()}catch(e){_.error("ADYEN_SUBMIT_FAILED","Failed to submit Adyen drop-in",{},e)}}});const l=e.ref(),y=e.ref(!1),f=e.ref(),_=r.useLogger(),{locale:v}=t.useIntl(),{authorizePayment:E,getPaymentDetails:k}=a.createPaymentsService(),{tokenizePaymentMethod:O}=o.createPaymentMethodsService(),T=e.inject(r.EXPERIMENTAL_FEATURE_INJECTION_KEY);async function A(){var e;const t=n.toMinorUnitAmount(u.amount),a=(null==(e=null==T?void 0:T.value)?void 0:e["express-checkout"])?function(e){return e.filter(e=>!R.some(t=>{var n;return t===(null==(n=e.type)?void 0:n.toLowerCase())}))}(n.mapAdyenPaymentMethods(u.paymentMethodOptionResponseEntry)):n.mapAdyenPaymentMethods(u.paymentMethodOptionResponseEntry);return{checkoutConfig:{amount:t,clientKey:n.getAdyenClientKeyFromPaymentMethodOptionsResponse(u.paymentMethodOptionResponseEntry),environment:n.getAdyenEnvironmentFromPaymentMethodOptionsResponse(u.paymentMethodOptionResponseEntry,_),locale:v,translations:b(u.variant),countryCode:u.countryCode,analytics:{enabled:!1},paymentMethodsResponse:{paymentMethods:a},onSubmit:w,onAdditionalDetails:C,onPaymentCompleted:B,onPaymentFailed:M,onError:x,showPayButton:!1},dropInConfig:{disableFinalAnimation:!0,paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,enableStoreDetails:!u.forceStorePaymentMethod&&"AUTHORIZE"===u.variant},paypal:{intent:t.value>0?"authorize":"tokenize",showPayButton:!0}},openFirstPaymentMethod:u.selected,onSelect:({props:{type:e}})=>{e&&p("select",{paymentMethodType:e,paymentGatewayVariant:"ADYEN"})},onReady:()=>p("ready")}}}async function N(){if(l.value)try{await P();const[e,{default:t}]=await Promise.all([Promise.resolve().then(()=>require("./index-DIFK3mcJ.js")),Promise.resolve().then(()=>require("./adyen-DZsyEXkw.js"))]),{AdyenCheckout:n,Dropin:a,Card:o,Bancontact:r,Ach:i,AmazonPay:s,ApplePay:c,BcmcMobile:p,BacsDirectDebit:y,CashAppPay:h,EPS:f,GooglePay:_,Klarna:g,PayByBank:v,PayPal:E,SepaDirectDebit:b,Trustly:R,Twint:I,PayByBankUS:k,Redirect:O}=e,{checkoutConfig:T,dropInConfig:N}=await A();m=await n(T),d=new a(m,{...N,paymentMethodComponents:[o,r,i,s,c,p,y,h,f,_,g,v,E,b,R,I,k,O]}).mount(l.value),function(e){var t;const n=null==(t=l.value)?void 0:t.getRootNode();if(n instanceof ShadowRoot){const t=document.createElement("style");t.textContent=e,n.appendChild(t);const a=document.createElement("style");a.textContent="\n :host {\n --adyen-sdk-color-background-secondary: transparent;\n --adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);\n --adyen-sdk-color-outline-secondary: #e5e7eb;\n --adyen-sdk-color-outline-primary: transparent;\n --adyen-sdk-color-background-always-dark: var(--color-primary-500);\n --adyen-sdk-color-background-inverse-primary-hover: var(--color-primary-600);\n }\n\n .adyen-checkout__payment-method__image__wrapper {\n width: 32px;\n height: 32px;\n }\n\n .adyen-checkout__payment-method__image {\n height: 32px;\n }\n\n .adyen-checkout__input-wrapper,\n .adyen-checkout__input {\n border-color: rgb(229, 231, 235);\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__button,\n .adyen-checkout__payment-method {\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__payment-method {\n border-color: rgb(229, 231, 235);\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n transition: box-shadow 0.2s ease-in-out;\n }\n\n .adyen-checkout__payment-method--selected {\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n }\n\n .adyen-checkout__payment-method:after {\n transform: scale(0%);\n }\n\n .adyen-checkout__paypal__button {\n display: block !important;\n }\n\n .adyen-checkout__payment-methods-list {\n gap: 4px;\n }\n\n .adyen-checkout__dropdown__list {\n background-color: white;\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__payment-method.adyen-checkout__payment-method--selected:after {\n content: '✓';\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--color-primary-600);\n position: absolute;\n top: 14px;\n right: 14px;\n text-align: center;\n line-height: 20px;\n color: white;\n transform: scale(100%);\n font-size: 12px;\n }\n\n .adyen-checkout__payment-method__header {\n padding: 8px 16px !important;\n }\n\n .adyen-checkout__payment-method__brands {\n align-items: center;\n }\n .adyen-checkout__payment-method__brand-number {\n line-height: 1;\n }\n .adyen-checkout__button__text {\n font-size: 14px;\n }\n .adyen-checkout__store-details {\n background: transparent;\n padding: 0;\n }\n .adyen-checkout__checkbox__input + .adyen-checkout__checkbox__label:after {\n border-color: rgb(229, 231, 235);\n }\n ","AUTHORIZE"===u.variant&&(a.textContent+="\n .adyen-checkout__payment-method--cashapp .adyen-checkout-pm-details-wrapper {\n display: none;\n }\n "),n.appendChild(a)}}(t)}catch(e){_.error("PAYMENT_INTEGRATION_INITIALIZATION_FAILED","Failed to mount Adyen web drop-in",{error:e})}}async function P(){d&&(d.unmount(),d=null),l.value&&(l.value.innerHTML="")}function w(...e){const[t,a,o]=e;u.validateOnSubmit().then(e=>{if(!e)return;const a=u.paymentMethodOptionResponseEntry.payment_acceptor.id,r={risk_data:n.transformObjectToAdyenObject(t.data.riskData),payment_method:n.transformObjectToAdyenObject(t.data.paymentMethod),browser_info:n.transformObjectToAdyenObject(t.data.browserInfo)};if("AUTHORIZE"===u.variant){const e=n.createReturnUrl({paymentAcceptorId:u.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});return void E({payment_acceptor_id:a,...u.customerId?{customer_id:u.customerId}:{},payment_gateway_variant:I,adyen:{...r,store_payment_method:u.forceStorePaymentMethod||t.data.storePaymentMethod},amount:u.amount,...u.context?{context:u.context}:{},return_url:e}).then(e=>{const n=t.data.paymentMethod.type;if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===I){const t=S(e,n);return t?(d.handleAction(t),void o.resolve({resultCode:e.action.adyen.result_code,action:t})):void _.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e})}if("AUTHORIZED"===e.payment.result)return y.value=!0,void o.resolve({resultCode:"Authorised"});_.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})}).catch(e=>{_.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})})}if("TOKENIZE"===u.variant){const e=n.createReturnUrl({paymentAcceptorId:u.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});if(!u.customerId)return void _.error("TOKENIZATION_FAILED",`Missing customer id for payment acceptor with id ${a}`);O({customer_id:u.customerId,payment_acceptor_id:a,payment_gateway_variant:I,adyen:r,return_url:e}).then(e=>{const n=t.data.paymentMethod.type;if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===I){const t=S(e,n);return t?(d.handleAction(t),void o.resolve({resultCode:e.action.adyen.result_code,action:t})):void _.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e})}if("AUTHORIZED"===e.payment.result)return y.value=!0,void o.resolve({resultCode:"Authorised"});_.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})}).catch(e=>{_.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})})}}).catch(e=>{_.error("INTEGRATION_ERROR","Unhandled error in payment submission flow",{},e)})}function S(e,t){if("ACTION_REQUIRED"!==e.status)return;const n=e.action;if("ADYEN"!=n.payment_gateway_variant)return;const a=n.adyen;return{paymentMethodType:(null==a?void 0:a.payment_method_type)??t,method:n.method,url:n.url,data:n.data,type:null==a?void 0:a.action_type,paymentData:null==a?void 0:a.payment_data,sdkData:null==a?void 0:a.sdk_data}}function C(...e){const[t]=e,n=t.data.details,a=t.data.paymentData;if(u.paymentMethodOptionResponseEntry.payment_acceptor.id)return void D({detailsResult:n?(o=n,Object.fromEntries(Object.entries(o).filter(([,e])=>null!=e))):void 0,paymentDataResult:a,paymentAcceptorId:u.paymentMethodOptionResponseEntry.payment_acceptor.id});var o;const r={code:"UNKNOWN_ERROR",message:"Payment failed",error:e};p("payment-failed",r),f.value=r}function M(...e){const[t]=e,n={code:"UNKNOWN_ERROR",message:"Payment failed",error:t};p("payment-failed",n),f.value=n}function B(...e){const[,t]=e;null==t||t.unmount(),p("payment-success")}function x(...e){const[t,n]=e;if("CANCEL"===t.name)return;const a={code:"UNKNOWN_ERROR",message:"Something went wrong",error:t};_.error("INTEGRATION_ERROR","Something went wrong",{error:t}),f.value=a,null==n||n.unmount()}function D({detailsResult:e,threeDSResult:t,redirectResult:n,paymentDataResult:a,paymentAcceptorId:o}){k({paymentAcceptorId:o,paymentGatewayVariant:I,adyen:{...e?{details:e}:{},...n?{redirect_result:n}:{},...t?{threeds_result:t}:{},...a?{payment_data:a}:{}}}).then(e=>{"FAILURE"!==e.payment_status?"SUCCESS"!==e.payment_status||p("payment-success"):p("payment-failed",{code:"UNKNOWN_ERROR",message:"Failed getting payment details",error:e})}).catch(e=>{_.error("PAYMENT_DETAILS_CALL_FAILED","Failed fetching payment details",{error:e})})}return e.onMounted(()=>{N(),function(){const e=n.getQueryParam(n.REDIRECT_RESULT_QUERY_STRING),t=n.getQueryParam(n.PAYMENT_ACCEPTOR_ID_QUERY_STRING);e&&(t?D({paymentAcceptorId:t,detailsResult:{redirectResult:decodeURI(e)}}):_.error("INVALID_REDIRECT_RESULT","Redirect result is set but payment acceptor id is missing",{context:{redirectResult:e}}))}()}),e.onBeforeUnmount(()=>{P()}),e.watch(()=>u.paymentMethodOptionResponseEntry,(e,n)=>{t.isEqual(e,n)||N()},{deep:!0}),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y.value?(e.openBlock(),e.createBlock(h,{key:0,variant:i.variant},null,8,["variant"])):f.value?(e.openBlock(),e.createBlock(g,{key:1,error:f.value},null,8,["error"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"dropInContainerRef",ref:l},null,512)],64))}}),O=e.defineComponent({__name:"PaymentIntegrationForm",props:{customerId:{type:String},variant:{type:String},context:{type:Object},paymentMethodOptions:{type:Array},countryCode:{type:String},invoiceId:{type:String},amount:{type:Object},selectedOption:{type:String},email:{type:String},name:{type:String},validateOnSubmit:{type:Function},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(n,{expose:a,emit:o}){const r=n,d=o;a({submit:function(){var e,t;p.value||(y.value=!0,null==(e=r.validateOnSubmit)||e.call(r));null==(t=l.value.get(p.value))||t.submit()}});const{$t:m}=t.useIntl(),u=e.ref(),p=e.computed(()=>{var e,t;return u.value??(null==(t=null==(e=r.paymentMethodOptions[0])?void 0:e.integration.payment_gateway)?void 0:t.variant)}),l=e.ref(new Map),y=e.ref(!1),h=({paymentGatewayVariant:e,paymentMethodType:t})=>{y.value=!1,u.value=e,d("select",{paymentGatewayVariant:e,paymentMethodType:t})},f=e=>t=>{var n;return l.value.set(null==(n=e.integration.payment_gateway)?void 0:n.variant,t)};return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.paymentMethodOptions,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.integration.id},[e.unref(i)(t)?(e.openBlock(),e.createBlock(k,{key:0,ref_for:!0,ref:f(t),context:n.context,"payment-method-option-response-entry":t,"country-code":n.countryCode,"customer-id":n.customerId,variant:n.variant,amount:n.amount,"invoice-id":n.invoiceId,selected:e.unref(c)({selectedIntegration:p.value,paymentMethodOption:t}),"validate-on-submit":n.validateOnSubmit,"force-store-payment-method":n.forceStorePaymentMethod,onSelect:h,onPaymentFailed:o[0]||(o[0]=e=>a.$emit("payment-failed",e)),onPaymentSuccess:o[1]||(o[1]=e=>a.$emit("payment-success")),onReady:o[2]||(o[2]=e=>a.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","validate-on-submit","force-store-payment-method"])):e.unref(s)(t)?(e.openBlock(),e.createBlock(E,{key:1,ref_for:!0,ref:f(t),context:n.context,"payment-method-option-response-entry":t,"country-code":n.countryCode,"customer-id":n.customerId,variant:n.variant,amount:n.amount,"invoice-id":n.invoiceId,selected:e.unref(c)({selectedIntegration:p.value,paymentMethodOption:t}),email:n.email,name:n.name,"validate-on-submit":n.validateOnSubmit,"force-store-payment-method":n.forceStorePaymentMethod,onSelect:h,onPaymentFailed:o[3]||(o[3]=e=>a.$emit("payment-failed",e)),onPaymentSuccess:o[4]||(o[4]=e=>a.$emit("payment-success")),onReady:o[5]||(o[5]=e=>a.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","email","name","validate-on-submit","force-store-payment-method"])):e.createCommentVNode("",!0)],64))),128)),y.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$32),{key:0,variant:"error",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Select a payment method",id:"payment_integration_form.select_payment_method_error",description:"Error shown when no payment method is selected"})),1)]),_:1})):e.createCommentVNode("",!0)],64))}});exports._sfc_main=O;
@@ -1,156 +0,0 @@
1
- import { computed, defineComponent, toRef, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, unref, withCtx, toDisplayString, createVNode, createCommentVNode, createTextVNode } from "vue";
2
- import { u as useIntl, o as _sfc_main$1, n as _sfc_main$2, c as _sfc_main$3, e as _sfc_main$4 } from "./vendor-ui-BoGKOJ36.mjs";
3
- const humanise = (value) => value.replaceAll("_", " ").toLowerCase().replace(/^./, (character) => character.toUpperCase());
4
- function getAccessibleName(paymentMethod) {
5
- var _a, _b, _c, _d, _e, _f;
6
- const parts = [];
7
- switch (paymentMethod.type) {
8
- case "CARD":
9
- parts.push(
10
- paymentMethod.card.brand && humanise(paymentMethod.card.brand),
11
- paymentMethod.card.last_four_digits
12
- );
13
- break;
14
- case "ONLINE_BANKING":
15
- parts.push(
16
- ((_a = paymentMethod.online_banking) == null ? void 0 : _a.variant) && humanise(paymentMethod.online_banking.variant),
17
- (_b = paymentMethod.online_banking) == null ? void 0 : _b.owner_name
18
- );
19
- break;
20
- case "DIRECT_DEBIT":
21
- parts.push(
22
- ((_c = paymentMethod.direct_debit) == null ? void 0 : _c.variant) && humanise(paymentMethod.direct_debit.variant),
23
- (_d = paymentMethod.direct_debit) == null ? void 0 : _d.owner_name
24
- );
25
- break;
26
- case "BUY_NOW_PAY_LATER":
27
- parts.push(
28
- ((_e = paymentMethod.buy_now_pay_later) == null ? void 0 : _e.variant) && humanise(paymentMethod.buy_now_pay_later.variant)
29
- );
30
- break;
31
- case "DIGITAL_WALLET":
32
- parts.push(
33
- ((_f = paymentMethod.digital_wallet) == null ? void 0 : _f.variant) && humanise(paymentMethod.digital_wallet.variant)
34
- );
35
- break;
36
- }
37
- const name = parts.filter(Boolean).join(" ");
38
- return name || humanise(paymentMethod.type);
39
- }
40
- function usePaymentMethodSelectorOptions(paymentMethods) {
41
- const options = computed(
42
- () => paymentMethods.value.map((paymentMethod) => ({
43
- value: paymentMethod.id,
44
- label: getAccessibleName(paymentMethod)
45
- }))
46
- );
47
- const paymentMethodsById = computed(
48
- () => Object.fromEntries(
49
- paymentMethods.value.map((paymentMethod) => [paymentMethod.id, paymentMethod])
50
- )
51
- );
52
- return { options, paymentMethodsById };
53
- }
54
- const _hoisted_1 = { class: "sr-only" };
55
- const _sfc_main = /* @__PURE__ */ defineComponent({
56
- __name: "PaymentMethodSelector",
57
- props: {
58
- paymentMethods: { type: Array },
59
- modelValue: { type: String },
60
- label: { type: String },
61
- required: { type: Boolean },
62
- disabled: { type: Boolean },
63
- error: { type: [String, Object, Array] },
64
- rootClass: { type: String },
65
- showAddOption: { type: Boolean, default: true },
66
- paymentMethodOptions: { type: Array }
67
- },
68
- emits: ["update:modelValue", "add-payment-method"],
69
- setup(__props, { emit: __emit }) {
70
- const props = __props;
71
- const emit = __emit;
72
- const { $t } = useIntl();
73
- const { options, paymentMethodsById } = usePaymentMethodSelectorOptions(
74
- toRef(props, "paymentMethods")
75
- );
76
- const selectedValue = computed({
77
- get: () => props.modelValue,
78
- set: (value) => emit("update:modelValue", typeof value === "string" ? value : void 0)
79
- });
80
- const hasPaymentMethods = computed(() => props.paymentMethods.length > 0);
81
- const canAddPaymentMethod = computed(() => {
82
- var _a;
83
- return ((_a = props.paymentMethodOptions) == null ? void 0 : _a.length) !== 0;
84
- });
85
- return (_ctx, _cache) => {
86
- return openBlock(), createElementBlock("div", {
87
- class: normalizeClass(["sv-payment-method-selector grid grid-cols-1 gap-2", __props.rootClass])
88
- }, [
89
- createElementVNode("div", null, [
90
- hasPaymentMethods.value ? (openBlock(), createBlock(unref(_sfc_main$1), {
91
- key: 0,
92
- modelValue: selectedValue.value,
93
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedValue.value = $event),
94
- class: "sv-payment-method-selector__options",
95
- name: "payment-method",
96
- direction: "column",
97
- options: unref(options),
98
- label: __props.label,
99
- required: __props.required,
100
- disabled: __props.disabled,
101
- error: __props.error,
102
- "show-radio": false
103
- }, {
104
- prefix: withCtx(({ optionValue }) => [
105
- createVNode(unref(_sfc_main$2), {
106
- class: "sv-payment-method-selector__option-content grow",
107
- "payment-method": unref(paymentMethodsById)[String(optionValue)]
108
- }, null, 8, ["payment-method"])
109
- ]),
110
- label: withCtx(({ option }) => [
111
- createElementVNode("span", _hoisted_1, toDisplayString(option.label), 1)
112
- ]),
113
- _: 1
114
- }, 8, ["modelValue", "options", "label", "required", "disabled", "error"])) : createCommentVNode("", true)
115
- ]),
116
- __props.showAddOption && canAddPaymentMethod.value ? (openBlock(), createBlock(unref(_sfc_main$3), {
117
- key: 0,
118
- class: "sv-action sv-action--secondary sv-action--full-width sv-payment-method-selector__add w-full",
119
- variant: "outline",
120
- color: "gray",
121
- "icon-prefix": "add",
122
- type: "button",
123
- disabled: __props.disabled,
124
- onClick: _cache[1] || (_cache[1] = ($event) => emit("add-payment-method"))
125
- }, {
126
- default: withCtx(() => [
127
- createTextVNode(toDisplayString(unref($t)({
128
- defaultMessage: "Add payment method",
129
- description: "Label of the button that adds a new payment method",
130
- id: "payment_method_selector.add_payment_method"
131
- })), 1)
132
- ]),
133
- _: 1
134
- }, 8, ["disabled"])) : __props.showAddOption ? (openBlock(), createBlock(unref(_sfc_main$4), {
135
- key: 1,
136
- variant: "body-sm",
137
- shade: "lighter",
138
- tag: "p",
139
- class: "sv-payment-method-selector__unavailable"
140
- }, {
141
- default: withCtx(() => [
142
- createTextVNode(toDisplayString(unref($t)({
143
- defaultMessage: "There are no available payment methods. Please contact support for more information.",
144
- description: "Shown in place of the add button when the customer cannot add any payment method",
145
- id: "payment_method_selector.no_payment_methods_available"
146
- })), 1)
147
- ]),
148
- _: 1
149
- })) : createCommentVNode("", true)
150
- ], 2);
151
- };
152
- }
153
- });
154
- export {
155
- _sfc_main as _
156
- };
@@ -1 +0,0 @@
1
- const e=require("vue"),t=require("./vendor-ui-BuRqLx74.js"),a=e=>e.replaceAll("_"," ").toLowerCase().replace(/^./,e=>e.toUpperCase());function o(e){var t,o,n,l,d,r;const i=[];switch(e.type){case"CARD":i.push(e.card.brand&&a(e.card.brand),e.card.last_four_digits);break;case"ONLINE_BANKING":i.push((null==(t=e.online_banking)?void 0:t.variant)&&a(e.online_banking.variant),null==(o=e.online_banking)?void 0:o.owner_name);break;case"DIRECT_DEBIT":i.push((null==(n=e.direct_debit)?void 0:n.variant)&&a(e.direct_debit.variant),null==(l=e.direct_debit)?void 0:l.owner_name);break;case"BUY_NOW_PAY_LATER":i.push((null==(d=e.buy_now_pay_later)?void 0:d.variant)&&a(e.buy_now_pay_later.variant));break;case"DIGITAL_WALLET":i.push((null==(r=e.digital_wallet)?void 0:r.variant)&&a(e.digital_wallet.variant))}return i.filter(Boolean).join(" ")||a(e.type)}const n={class:"sr-only"},l=e.defineComponent({__name:"PaymentMethodSelector",props:{paymentMethods:{type:Array},modelValue:{type:String},label:{type:String},required:{type:Boolean},disabled:{type:Boolean},error:{type:[String,Object,Array]},rootClass:{type:String},showAddOption:{type:Boolean,default:!0},paymentMethodOptions:{type:Array}},emits:["update:modelValue","add-payment-method"],setup(a,{emit:l}){const d=a,r=l,{$t:i}=t.useIntl(),{options:s,paymentMethodsById:p}=(m=e.toRef(d,"paymentMethods"),{options:e.computed(()=>m.value.map(e=>({value:e.id,label:o(e)}))),paymentMethodsById:e.computed(()=>Object.fromEntries(m.value.map(e=>[e.id,e])))});var m;const c=e.computed({get:()=>d.modelValue,set:e=>r("update:modelValue","string"==typeof e?e:void 0)}),u=e.computed(()=>d.paymentMethods.length>0),y=e.computed(()=>{var e;return 0!==(null==(e=d.paymentMethodOptions)?void 0:e.length)});return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sv-payment-method-selector grid grid-cols-1 gap-2",a.rootClass])},[e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$7),{key:0,modelValue:c.value,"onUpdate:modelValue":l[0]||(l[0]=e=>c.value=e),class:"sv-payment-method-selector__options",name:"payment-method",direction:"column",options:e.unref(s),label:a.label,required:a.required,disabled:a.disabled,error:a.error,"show-radio":!1},{prefix:e.withCtx(({optionValue:a})=>[e.createVNode(e.unref(t._sfc_main$6),{class:"sv-payment-method-selector__option-content grow","payment-method":e.unref(p)[String(a)]},null,8,["payment-method"])]),label:e.withCtx(({option:t})=>[e.createElementVNode("span",n,e.toDisplayString(t.label),1)]),_:1},8,["modelValue","options","label","required","disabled","error"])):e.createCommentVNode("",!0)]),a.showAddOption&&y.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,class:"sv-action sv-action--secondary sv-action--full-width sv-payment-method-selector__add w-full",variant:"outline",color:"gray","icon-prefix":"add",type:"button",disabled:a.disabled,onClick:l[1]||(l[1]=e=>r("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Add payment method",description:"Label of the button that adds a new payment method",id:"payment_method_selector.add_payment_method"})),1)]),_:1},8,["disabled"])):a.showAddOption?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:1,variant:"body-sm",shade:"lighter",tag:"p",class:"sv-payment-method-selector__unavailable"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"There are no available payment methods. Please contact support for more information.",description:"Shown in place of the add button when the customer cannot add any payment method",id:"payment_method_selector.no_payment_methods_available"})),1)]),_:1})):e.createCommentVNode("",!0)],2))}});exports._sfc_main=l;
@@ -1 +0,0 @@
1
- const e=require("vue"),t=require("./vendor-ui-BuRqLx74.js"),n=require("./useService-DKm3QtT4.js"),o=require("./paymentMethods-BMcc-eTl.js");const a={key:0,class:"sv-payment-methods__list grid grid-cols-1 gap-4"},l=e.defineComponent({__name:"PaymentMethodsList",props:{paymentMethods:{type:Array}},emits:["delete","set-default"],setup(l,{emit:d}){const s=d,{$t:m}=t.useIntl(),i=e.ref(null),{execute:u}=function(){const{setDefaultPaymentMethod:e}=o.createPaymentMethodsService(),{data:t,execute:a,error:l,isPending:d}=n.useService({service:t=>e({paymentMethodId:t})});return{data:t,execute:a,error:l,isPending:d}}(),{getContextMenuItems:r}=function({onSetDefault:e,onDeleteRequest:n}){const{$t:o}=t.useIntl();return{getContextMenuItems:t=>{const a=[];return t.is_default||a.push({label:o({defaultMessage:"Set as default",id:"payment_method.context_menu.set_as_default.label",description:"Context menu option for setting the default payment method"}),onClick:()=>e(t)}),a.push({label:o({defaultMessage:"Delete",id:"payment_method.context_menu.delete.label",description:"Context menu option for deleting the payment method"}),onClick:()=>n(t)}),a}}}({onDeleteRequest:e=>{i.value=e},onSetDefault:async e=>{await u(e.id),s("set-default",e)}});function c(){i.value&&s("delete",i.value),i.value=null}return(n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.paymentMethods.length>0?(e.openBlock(),e.createElementBlock("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.paymentMethods,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:n.id,class:"sv-payment-methods__item"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$6),{class:"sv-payment-methods__item-content","payment-method":n,options:e.unref(r)(n)},null,8,["payment-method","options"])]),_:2},1024))),128))])):e.createCommentVNode("",!0),e.createVNode(e.unref(t.Modal),{"show-modal":!!i.value,title:e.unref(m)({id:"payment_methods_list.delete_modal.title",defaultMessage:"Delete payment method",description:"Title of the delete payment method confirmation modal"}),"confirm-button-text":e.unref(m)({id:"payment_methods_list.delete_modal.confirm",defaultMessage:"Delete",description:"Confirm button in the delete payment method modal"}),"cancel-button-text":e.unref(m)({id:"payment_methods_list.delete_modal.cancel",defaultMessage:"Cancel",description:"Cancel button in the delete payment method modal"}),onConfirm:c,onClose:o[0]||(o[0]=e=>i.value=null)},e.createSlots({_:2},[i.value?{name:"body",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({id:"payment_methods_list.delete_modal.body",defaultMessage:"Are you sure you want to delete this payment method?",description:"Confirmation message in the delete payment method modal"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$6),{"payment-method":i.value},null,8,["payment-method"])]),_:1})]),key:"0"}:void 0]),1032,["show-modal","title","confirm-button-text","cancel-button-text"])],64))}});exports._sfc_main=l;
@@ -1 +0,0 @@
1
- const e=require("vue"),n=require("./vendor-ui-BuRqLx74.js"),t=require("./pricing-BEjY_5wb.js"),l=require("./useViewport-CKRY1CKR.js"),i={class:"flex gap-4 border-l-2 border-primary-600 px-2"},r={class:"grow"},a=e.defineComponent({__name:"PricingGroupTitle",setup:t=>(t,l)=>(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("div",r,[e.createVNode(e.unref(n._sfc_main$3),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),_:3})]),e.createElementVNode("div",null,[e.createVNode(e.unref(n._sfc_main$3),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"description")]),_:3})])]))}),o={class:"p-1"},c={class:"pt-1"},s=e.defineComponent({__name:"PricingGroupSingleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const r=i,s=e.useModel(i,"modelValue"),{$t:u}=n.useIntl(),{renderPricingForPricingItem:p}=n.usePricingItem({currency:e.toRef(r,"currency"),billingPeriod:e.toRef(r,"billingPeriod")}),{isMobileViewport:d}=l.useViewport(),m=e.computed(()=>r.pricings.map(e=>e.id)),v=e.computed({get:()=>s.value.find(e=>m.value.includes(e))??void 0,set:e=>{const n=s.value.filter(e=>!m.value.includes(e));s.value=e?[...n,e]:n}}),g=e.computed(()=>r.pricings.map(e=>{var n;const l=null==(n=e.items)?void 0:n[0];return{label:t.getNameFromPricing(e)??"",value:e.id,description:l?p({pricingItem:l}):u({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})}}));return(t,l)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",o,[e.createVNode(a,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),_:1}),e.createElementVNode("div",c,[g.value.length<=3?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$7),{key:0,modelValue:v.value,"onUpdate:modelValue":l[0]||(l[0]=e=>v.value=e),options:g.value.slice(0,3),direction:e.unref(d)?"column":"row","show-radio":!1},null,8,["modelValue","options","direction"])):g.value.length<=6?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$18),{key:1,"single-model-value":v.value,"onUpdate:singleModelValue":l[1]||(l[1]=e=>v.value=e),options:g.value.map(({value:e,label:n,description:t})=>({label:n,subLabel:t,value:e})),size:"xl","show-sub-label-in-input":""},null,8,["single-model-value","options"])):(e.openBlock(),e.createBlock(e.unref(n._sfc_main$19),{key:2,modelValue:v.value,"onUpdate:modelValue":l[2]||(l[2]=e=>v.value=e),options:g.value,name:`pricing-group-range-input-${i.groupName}`},null,8,["modelValue","options","name"]))])])]),_:1}))}}),u={class:"flex justify-around"},p={class:"flex items-center gap-0.5"},d=["aria-label","innerHTML"],m=e.defineComponent({__name:"SecurePaymentsKPI",props:{paymentMethodOptions:{type:Array}},setup(t){const l=t,{$t:i}=n.useIntl(),r={ADYEN:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="40" height="15" fill="none" viewBox="0 0 40 15"><path fill="currentColor" d="M.049 2.917h5.845c.646 0 1.17.522 1.17 1.166v5.834H1.217c-.646 0-1.17-.522-1.17-1.167V5.833h2.924v2.334H4.14v-3.5H.049zm32.735 0v7h2.922v-5.25h1.17v5.25h2.922V4.083c0-.644-.523-1.166-1.169-1.166zm-16.367 9.916h5.845c.646 0 1.17-.522 1.17-1.166v-8.75h-2.924v5.25H19.34v-5.25h-2.922V8.75c0 .645.523 1.167 1.169 1.167h2.922v1.166h-4.091zm15.197-2.916H25.77c-.646 0-1.17-.522-1.17-1.167V2.917h5.846c.646 0 1.17.522 1.17 1.166V7h-2.923V4.667h-1.17v3.5h4.092zM15.248 0v9.917H9.402c-.646 0-1.17-.522-1.17-1.167V4.083c0-.644.524-1.166 1.17-1.166h1.754v5.25h1.169V0z"/></svg>',label:"Adyen"},STRIPE:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="15" viewBox="0 0 36 15"><path d="M35.996 7.746c0-2.559-1.238-4.578-3.61-4.578-2.378 0-3.816 2.02-3.816 4.559 0 3.011 1.7 4.53 4.137 4.53 1.191 0 2.09-.269 2.77-.648v-2c-.68.34-1.457.547-2.45.547-.968 0-1.828-.34-1.937-1.52h4.887c0-.128.02-.648.02-.89m-4.937-.95c0-1.128.691-1.597 1.32-1.597.61 0 1.258.469 1.258 1.598ZM24.707 3.168c-.977 0-1.61.46-1.957.781l-.133-.62h-2.199v11.66l2.5-.532.012-2.828c.36.258.89.629 1.77.629 1.788 0 3.417-1.442 3.417-4.61-.008-2.898-1.66-4.48-3.41-4.48m-.598 6.89c-.59 0-.941-.21-1.18-.472l-.011-3.707c.262-.29.621-.492 1.191-.492.91 0 1.54 1.02 1.54 2.332 0 1.34-.622 2.34-1.54 2.34M16.98 2.578l2.508-.539V.008L16.98.539ZM16.98 3.34h2.508v8.746H16.98ZM14.29 4.078l-.161-.738h-2.16v8.746h2.5v-5.93c.59-.77 1.59-.629 1.898-.52V3.34c-.316-.121-1.488-.34-2.078.738M9.29 1.168l-2.438.52-.012 8.011c0 1.48 1.11 2.57 2.59 2.57.82 0 1.418-.152 1.75-.332v-2.03c-.32.132-1.899.59-1.899-.887V5.469h1.899v-2.13H9.28ZM2.531 5.879c0-.39.32-.54.848-.54a5.56 5.56 0 0 1 2.48.638V3.629a6.55 6.55 0 0 0-2.48-.461C1.352 3.168 0 4.227 0 6c0 2.758 3.8 2.316 3.8 3.508 0 .46-.402.61-.96.61-.828 0-1.89-.34-2.73-.802V11.7c.93.399 1.87.57 2.73.57 2.078 0 3.512-1.03 3.512-2.82-.012-2.98-3.82-2.453-3.82-3.57m0 0" style="stroke:none;fill-rule:evenodd;fill:currentColor;fill-opacity:1"/></svg>',label:"Stripe"}},a=e.computed(()=>{const e=l.paymentMethodOptions.find(({integration:e})=>{var n;return null!=(null==(n=e.payment_gateway)?void 0:n.variant)&&e.payment_gateway.variant in r});return e?r[e.integration.payment_gateway.variant]:null}),o=e.computed(()=>a.value?i({defaultMessage:"Secure and encrypted payments by",description:"Secure encrypted payments KPI for a specific vendor, followed by a vendor logo",id:"secure_payments_kpi.specific_vendor"}):i({defaultMessage:"Secure and encrypted payments",description:"Secure encrypted payments KPI",id:"secure_payments_kpi.generic"}));return(t,l)=>(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",p,[e.createVNode(e.unref(n._sfc_main$9),{icon:"lock",size:"xs"}),e.createVNode(e.unref(n._sfc_main$3),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(o.value),1),l[0]||(l[0]=e.createTextVNode(e.toDisplayString(" ")+" ",-1)),a.value?(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":a.value.label,role:"img",class:"inline-block h-[15px] align-middle",innerHTML:a.value.svg},null,8,d)):e.createCommentVNode("",!0)]),_:1})])]))}});exports._sfc_main=s,exports._sfc_main$1=m,exports._sfc_main$2=a;
@@ -1 +0,0 @@
1
- const e=require("vue"),s=require("./vendor-ui-BuRqLx74.js"),t=e.defineComponent({__name:"SubscriptionSchedules",props:{schedulesData:{type:Array},configuration:{type:Object},isLoading:{type:Boolean}},setup(t){const{$t:n}=s.useIntl();return(i,c)=>(e.openBlock(),e.createBlock(e.unref(s._sfc_main),{class:"sv-subscription-schedules sv-root sv-component","no-border":"","no-spacing":"","content-background":"none",title:e.unref(n)({defaultMessage:"Schedules",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(e.unref(s.PricingPlanSchedules),{class:"sv-subscription-schedules__list",schedules:t.schedulesData},null,8,["schedules"])]),_:1},8,["title"]))}});exports._sfc_main=t;
@@ -1 +0,0 @@
1
- const e=require("./useIncrementalLoading-BgWuwoMo.js"),t=require("./subscriptions-DC-mxa17.js"),i=require("vue"),s=require("./vendor-ui-BuRqLx74.js"),o=require("./subscription-b0OPx8Du.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),r=require("./useActionDispatchProvider-bqR_FeM4.js");const c={class:"sv-subscriptions-list__item-body flex flex-col gap-4 md:flex-row"},a={class:"sv-subscriptions-list__item-content grow"},l={class:"sv-subscriptions-list__item-meta mt-4 flex items-center gap-6"},u={key:1,class:"sv-subscriptions-list__item-next-invoice flex gap-1"},p={class:"sv-subscriptions-list__item-actions flex flex-col items-center gap-2 md:flex-row"},d=i.defineComponent({__name:"SubscriptionsListItem",props:{subscription:{type:Object},paymentMethod:{type:Object},customer:{type:Object},showViewSubscriptionDetailsButton:{type:Boolean,default:!0}},emits:["view-subscription-details"],setup(e){const t=e,{$t:n}=s.useIntl(),{formatDate:r}=s.useIntl(),d=i.computed(()=>o.getMostRecentPricingPlan(t.subscription)),m=i.computed(()=>o.getSubscriptionName({subscription:t.subscription,fallback:n({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})})),b=i.computed(()=>{var e;return null==(e=d.value)?void 0:e.description}),_=i.computed(()=>t.showViewSubscriptionDetailsButton);return(t,o)=>(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{class:"sv-subscriptions-list__item"},{default:i.withCtx(()=>[i.createElementVNode("div",c,[i.createElementVNode("div",a,[i.createVNode(i.unref(s._sfc_main$3),{tag:"h3",variant:"heading-2",class:"sv-subscriptions-list__item-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.value),1)]),_:1}),b.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$3),{key:0,variant:"body-sm",tag:"span",shade:"lighter",class:"sv-subscriptions-list__item-description"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",l,[e.paymentMethod?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$6),{key:0,variant:"condensed",class:"sv-payment-methods__item","payment-method":e.paymentMethod},null,8,["payment-method"])):i.createCommentVNode("",!0),e.subscription.next_invoice?(i.openBlock(),i.createElementBlock("div",u,[i.createVNode(i.unref(s._sfc_main$3),{tag:"span",variant:"body-xs",shade:"light",weight:"semibold"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)({defaultMessage:"Next billing date",description:"The label for the next billing date",id:"customer.subscriptions_block.next_billing_date"})),1)]),_:1}),i.createVNode(i.unref(s._sfc_main$3),{tag:"span",variant:"body-xs",shade:"light"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)({date:e.subscription.next_invoice.invoice_date,format:"date",offsetType:"offsetted",timezone:e.customer.timezone})),1)]),_:1})])):i.createCommentVNode("",!0)])]),i.createElementVNode("div",p,[_.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$1),{key:0,color:"primary",class:"sv-action sv-action--primary sv-subscriptions-list__item-details w-full md:w-auto",type:"button",onClick:o[0]||(o[0]=i=>t.$emit("view-subscription-details",{subscriptionId:e.subscription.id}))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)({defaultMessage:"Subscription details",description:"The label for the subscription details button in the subscriptions block",id:"customer.subscriptions_block.show_details_button_label"})),1)]),_:1})):i.createCommentVNode("",!0)])])]),_:1}))}}),m={key:1,class:"sv-subscriptions-list__items grid grid-cols-1 gap-4"},b=i.defineComponent({__name:"SubscriptionsList",props:{customer:{type:Object},subscriptions:{type:Array},paymentMethods:{default:()=>[],type:Array},isLoading:{type:Boolean},showViewAllButton:{type:Boolean,default:!0},showViewDetailsButton:{type:Boolean,default:!0}},emits:["view-subscription-details","view-all-subscriptions","load-more"],setup(e){const t=e,{$t:o}=s.useIntl(),n=i.computed(()=>t.subscriptions.length>0),r=e=>{if(e)return t.paymentMethods.find(({id:t})=>t===e)},c=i.computed(()=>t.showViewAllButton);return(t,a)=>(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{class:"sv-subscriptions-list","no-spacing":"","no-border":"",title:i.unref(o)({defaultMessage:"{count, plural, one {My subscription} other {My subscriptions}}",description:"Title for the subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.title"},{count:String(e.subscriptions.length)})},i.createSlots({default:i.withCtx(()=>[n.value?(i.openBlock(),i.createElementBlock("div",m,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.subscriptions,s=>(i.openBlock(),i.createBlock(d,{key:s.id,subscription:s,"payment-method":r(s.payment_method_id),customer:e.customer,"show-view-subscription-details-button":e.showViewDetailsButton,onViewSubscriptionDetails:a[1]||(a[1]=e=>t.$emit("view-subscription-details",e))},null,8,["subscription","payment-method","customer","show-view-subscription-details-button"]))),128))])):(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{key:0,class:"sv-empty-state sv-subscriptions-list__empty"},{default:i.withCtx(()=>[i.createVNode(i.unref(s._sfc_main$3),{tag:"h3",variant:"heading-3"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"No subscriptions",description:"Title for the my subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.no_active_subscription_title"})),1)]),_:1}),i.createVNode(i.unref(s._sfc_main$3),{variant:"body-xs",shade:"lighter"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"There’s no active subscription to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.subscriptions_block.no_active_subscription_content"})),1)]),_:1})]),_:1}))]),_:2},[c.value?{name:"right",fn:i.withCtx(()=>[i.createVNode(i.unref(s._sfc_main$1),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",class:"sv-action sv-action--ghost sv-subscriptions-list__view-all",type:"button",onClick:a[0]||(a[0]=e=>t.$emit("view-all-subscriptions"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({defaultMessage:"View all",description:"The text for the view all subscriptions button",id:"customer_overview.subscriptions_block.view_all_button_label"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),_=i.defineComponent({__name:"SubscriptionsList",props:{customer:{type:null},subscriptions:{type:Array},paymentMethods:{type:Array},isLoading:{type:Boolean},configuration:{type:Object}},emits:["load-more"],setup(e){const{dispatchAction:t}=r.useActionDispatchProvider();return(s,o)=>{var r,c;return e.isLoading?(i.openBlock(),i.createBlock(n._sfc_main,{key:0,variant:"section",class:"sv-subscriptions-list sv-root sv-component sv-loading min-h-[100px]","data-testid":"subscriptions-list-skeleton"})):e.customer?(i.openBlock(),i.createBlock(b,{key:1,class:"sv-subscriptions-list sv-root sv-component",customer:e.customer,subscriptions:e.subscriptions,"payment-methods":e.paymentMethods,"is-loading":e.isLoading,"show-view-all-button":null==(r=e.configuration)?void 0:r.showViewAllButton,"show-view-details-button":null==(c=e.configuration)?void 0:c.showViewDetailsButton,onViewSubscriptionDetails:o[0]||(o[0]=e=>i.unref(t)({action:"view-subscription-details",data:{subscriptionId:e.subscriptionId}})),onViewAllSubscriptions:o[1]||(o[1]=e=>i.unref(t)({action:"view-all-subscriptions"})),onLoadMore:o[2]||(o[2]=e=>s.$emit("load-more"))},null,8,["customer","subscriptions","payment-methods","is-loading","show-view-all-button","show-view-details-button"])):i.createCommentVNode("",!0)}}});exports._sfc_main=_,exports.useSubscriptionsList=function({customerId:i,batchSize:s=15}){const o=t.createSubscriptionsService();return e.useIncrementalLoading({service:async e=>o.getActiveSubscriptions({customerId:i,pagination:{page:e,pageSize:s}})})};