@solvimon/solvimon-web 0.1.0-alpha.1 → 0.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +196 -44
  2. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  3. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs} +9 -6
  5. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js +1 -0
  6. package/dist/ContentWithAsideLayout-B5B8Kwaw.js +1 -0
  7. package/dist/{ContentWithAsideLayout-BC-C5Gjt.mjs → ContentWithAsideLayout-DhfUkZZg.mjs} +10 -16
  8. package/dist/{useCustomerPaymentMethodOptions-Fe_dLxfv.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs} +29 -37
  9. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs} +20 -9
  11. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +1 -0
  12. package/dist/PaymentHistoryBlock-BiiFJkpT.js +1 -0
  13. package/dist/PaymentHistoryBlock-D_B099M7.mjs +4 -0
  14. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs} +19 -12
  15. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +1 -0
  16. package/dist/PaymentIntegrationForm-D1ZaHCTm.js +1 -0
  17. package/dist/PaymentIntegrationForm-Dmmhqqn1.mjs +4 -0
  18. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CSPZRvMV.js +1 -0
  19. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Do2KIVKH.mjs +962 -0
  20. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs +50 -0
  21. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +1 -0
  22. package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs → Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs} +24 -8
  23. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +1 -0
  24. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +1 -0
  25. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs} +42 -36
  26. package/dist/adyen-51SvcyqV.mjs +4 -0
  27. package/dist/adyen-Bwewy3HC.mjs +172 -0
  28. package/dist/adyen-DZsyEXkw.js +1 -0
  29. package/dist/adyen-R6aSZ0Yf.js +1 -0
  30. package/dist/component-BOqPDAVk.js +1 -0
  31. package/dist/component-Djrf1L-Z.mjs +889 -0
  32. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
  33. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  34. package/dist/components/BillingInformation/BillingInformation.es.js +99 -5
  35. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
  36. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  37. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +582 -5
  38. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
  39. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  40. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +126 -5
  41. package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
  42. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  43. package/dist/components/Invoice/Invoice.es.js +538 -5
  44. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
  45. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  46. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +127 -5
  47. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
  48. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  49. package/dist/components/InvoicesList/InvoicesList.es.js +106 -5
  50. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
  51. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  52. package/dist/components/PaymentHistory/PaymentHistory.es.js +131 -5
  53. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
  54. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  55. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +217 -5
  56. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
  57. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  58. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +154 -5
  59. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
  60. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  61. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +132 -5
  62. package/dist/components/WalletBalances/WalletBalances.ce.d.ts +3 -0
  63. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -0
  64. package/dist/components/WalletBalances/WalletBalances.es.js +120 -0
  65. package/dist/core/configuration.d.ts +2 -1
  66. package/dist/core/index.cjs.js +1 -1
  67. package/dist/core/index.d.ts +1 -0
  68. package/dist/core/index.es.js +1 -1
  69. package/dist/core/registry.d.ts +1 -1
  70. package/dist/core/types.d.ts +10 -2
  71. package/dist/customer-B31QzznT.mjs +32 -0
  72. package/dist/customer-hDxW1Dbp.js +1 -0
  73. package/dist/en-US-CgPY97Vq.js +1 -0
  74. package/dist/en-US-N3CUCsVy.mjs +179 -0
  75. package/dist/index-DIFK3mcJ.js +6 -0
  76. package/dist/index-DyvRdSR7.mjs +9673 -0
  77. package/dist/index.cjs.js +1 -1
  78. package/dist/index.d.ts +3 -0
  79. package/dist/index.es.js +43 -34
  80. package/dist/{invoices-C31Wz1Bu.mjs → invoices-DIYPN2j_.mjs} +2 -1
  81. package/dist/invoices-DzkA1jDc.js +1 -0
  82. package/dist/nl-NL-B8U9b85I.mjs +197 -0
  83. package/dist/nl-NL-qMRaTRrM.js +1 -0
  84. package/dist/{paymentMethods-CrU4G_2Y.mjs → paymentMethods-67b3UlTZ.mjs} +2 -1
  85. package/dist/paymentMethods-C_sdTkSF.js +1 -0
  86. package/dist/{payments-C3LPk9k9.js → payments-DkHhTHto.js} +1 -1
  87. package/dist/{payments-NtWI8KlU.mjs → payments-Dq6R37Fz.mjs} +1 -1
  88. package/dist/registry-BkViv4tv.js +1 -0
  89. package/dist/registry-Df_26rJy.mjs +144 -0
  90. package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
  91. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  92. package/dist/screens/Checkout/Checkout.es.js +4935 -5
  93. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
  94. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  95. package/dist/screens/CustomerOverview/CustomerOverview.es.js +154 -5
  96. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  97. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  98. package/dist/screens/PayInvoice/PayInvoice.es.js +458 -0
  99. package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +3 -0
  100. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -0
  101. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +1066 -0
  102. package/dist/solvimon-web.css +1 -1
  103. package/dist/{subscriptions-3R7aMoky.mjs → subscriptions-ClGIr_aS.mjs} +2 -1
  104. package/dist/subscriptions-jelITJcX.js +1 -0
  105. package/dist/{useActionDispatchProvider-CBo_Hwu5.mjs → useActionDispatchProvider-BC57-Ufn.mjs} +1 -1
  106. package/dist/useActionDispatchProvider-rw9kWeE0.js +1 -0
  107. package/dist/useCustomer-Ba9WRtuT.mjs +25 -0
  108. package/dist/useCustomer-CUcaeQn_.js +1 -0
  109. package/dist/{useIncrementalLoading-fHCizCSo.mjs → useIncrementalLoading-Cnzh2mAz.mjs} +11 -10
  110. package/dist/useIncrementalLoading-DoTTXM2Y.js +1 -0
  111. package/dist/{useInvoiceData-dyvoDwFF.mjs → useInvoiceData-BJwwDur7.mjs} +6 -12
  112. package/dist/useInvoiceData-D2jkdmlA.js +1 -0
  113. package/dist/{useInvoicesList-rDvRzMqe.mjs → useInvoicesList-CFzAxyae.mjs} +34 -30
  114. package/dist/useInvoicesList-CaBCGs4h.js +1 -0
  115. package/dist/{useLoadInitialData-Dm48tlSO.mjs → useLoadInitialData-5sgImpzc.mjs} +5 -0
  116. package/dist/useLoadInitialData-DjwRHcAH.js +1 -0
  117. package/dist/usePaymentMethodOptions-C2k4npCQ.mjs +26 -0
  118. package/dist/usePaymentMethodOptions-DYO6xr3-.js +1 -0
  119. package/dist/{usePaymentMethods-Bq5fWl1Q.mjs → usePaymentMethods-CRWbH48K.mjs} +2 -2
  120. package/dist/{usePaymentMethods-Dbimodf0.js → usePaymentMethods-ryN_YohI.js} +1 -1
  121. package/dist/usePayments-Cw5PPEJa.mjs +36 -0
  122. package/dist/usePayments-DWXPGFvp.js +1 -0
  123. package/dist/usePortal-CxX4nrE4.js +1 -0
  124. package/dist/usePortal-cmE08vYs.mjs +12 -0
  125. package/dist/useService-Bb9r_sOQ.js +1 -0
  126. package/dist/useService-BsSEI8DZ.mjs +53 -0
  127. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  128. package/dist/useViewport-CKRY1CKR.js +1 -0
  129. package/dist/useWalletBalanceItems-CkDqmk36.mjs +109 -0
  130. package/dist/useWalletBalanceItems-CpZ1NWPr.js +1 -0
  131. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  132. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  133. package/dist/vendor-ui-5pJF5KBP.js +1 -0
  134. package/dist/vendor-ui-C0K3osvz.mjs +27645 -0
  135. package/package.json +47 -20
  136. package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +0 -99
  137. package/dist/BillingInformation.entry.ce-DkrfEvK_.js +0 -1
  138. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js +0 -1
  139. package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +0 -1
  140. package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +0 -579
  141. package/dist/Checkout.entry.ce-Bif6vR1K.mjs +0 -5185
  142. package/dist/Checkout.entry.ce-CkQnLAn4.js +0 -1
  143. package/dist/ContentWithAsideLayout-CIVSoqFr.js +0 -1
  144. package/dist/CustomerOverview.entry.ce-C__omsVl.js +0 -1
  145. package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +0 -231
  146. package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +0 -135
  147. package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +0 -1
  148. package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +0 -583
  149. package/dist/Invoice.entry.ce-Cgr43ome.js +0 -1
  150. package/dist/InvoiceDetails.entry.ce-Cnpz8CLJ.mjs +0 -130
  151. package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +0 -1
  152. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js +0 -1
  153. package/dist/InvoicesList.entry.ce-38iOW5qh.js +0 -1
  154. package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +0 -105
  155. package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +0 -1
  156. package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +0 -134
  157. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js +0 -1
  158. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs +0 -6568
  159. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +0 -1
  160. package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +0 -238
  161. package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +0 -1
  162. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +0 -1
  163. package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +0 -1
  164. package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +0 -153
  165. package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +0 -1
  166. package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +0 -135
  167. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js +0 -1
  168. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  169. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  170. package/dist/auto-B_36W1Fc.js +0 -6
  171. package/dist/auto-BfMZdgp-.mjs +0 -14207
  172. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  173. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  174. package/dist/component-BkmcE85U.mjs +0 -58654
  175. package/dist/component-Df5eNqYX.js +0 -1
  176. package/dist/index-2jo9BSPM.js +0 -1
  177. package/dist/index-BFZ0dPh9.mjs +0 -179
  178. package/dist/index-CWSXne1Q.js +0 -1
  179. package/dist/index-D3v7hAtc.mjs +0 -253
  180. package/dist/invoices-8M_3ur_U.js +0 -1
  181. package/dist/paymentMethods-CzUqDlvc.js +0 -1
  182. package/dist/registry-By94DXE2.js +0 -1
  183. package/dist/registry-shRKDl3K.mjs +0 -127
  184. package/dist/sprite-i5T7eZnk-C55G-dBo.js +0 -1
  185. package/dist/sprite-i5T7eZnk-i5T7eZnk.mjs +0 -4
  186. package/dist/subscriptions-CqK7t-fF.js +0 -1
  187. package/dist/useActionDispatchProvider-DsIljrhi.js +0 -1
  188. package/dist/useCustomer-BRY0tuBH.mjs +0 -45
  189. package/dist/useCustomer-Dp8sGHI0.js +0 -1
  190. package/dist/useCustomerPaymentMethodOptions-DYpMDnJR.js +0 -1
  191. package/dist/useIncrementalLoading-D8oKNxX7.js +0 -1
  192. package/dist/useInvoiceData-DImEH1ca.js +0 -1
  193. package/dist/useInvoicesList-BZQ9Y0qN.js +0 -1
  194. package/dist/useLoadInitialData-BRg7IWqW.js +0 -1
  195. package/dist/useService-Dz13Nxbi.mjs +0 -272
  196. package/dist/useService-bNNi4GB8.js +0 -1
@@ -1,3 +1,3 @@
1
- export declare const SolvimonCustomerOverview: import('vue').VueElementConstructor<unknown>;
1
+ export declare const SolvimonCustomerOverview: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
2
  export declare const COMPONENT_NAME: string;
3
3
  export declare const defineSolvimonCustomerOverview: () => void;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../CustomerOverview.entry.ce-C__omsVl.js");require("../../component-Df5eNqYX.js"),exports.COMPONENT_NAME=e.COMPONENT_NAME,exports.SolvimonCustomerOverview=e.SolvimonCustomerOverview,exports.defineSolvimonCustomerOverview=e.defineSolvimonCustomerOverview;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),r=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),o=require("../../useInvoicesList-CaBCGs4h.js"),s=require("../../usePortal-CxX4nrE4.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js"),i=require("../../useCustomer-CUcaeQn_.js"),a=require("../../usePaymentMethods-ryN_YohI.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js"),l=require("../../useLoadInitialData-DjwRHcAH.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js"),m=require("../../paymentMethods-C_sdTkSF.js"),v=require("../../useService-Bb9r_sOQ.js"),d=require("../../useWalletBalanceItems-CpZ1NWPr.js"),p=require("../../component-BOqPDAVk.js");const y=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(p){var y;const f=null==(y=s.usePortal().value)?void 0:y.customer_id,_=i.useCustomer({customerId:f}),g=o.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=a.usePaymentMethods({customerId:f}),S=function({customerId:e,amount:t}){const{getPaymentMethodOptions:r}=m.createPaymentMethodsService(),{data:o,execute:s,error:n,apiStatus:i,isPending:a}=v.useService({initialValue:[],service:async()=>(await r({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:i,items:o,fetch:s,isPending:a}}({customerId:f}),j=d.useCustomerWalletBalances({customerId:f}),C=d.useWalletBalanceItems(j.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),S.fetch(),j.fetch());return(s,i)=>(e.openBlock(),e.createBlock(e.unref(r.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(_).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(_).customer.value,subscriptions:e.unref(h).items.value,"payment-methods":e.unref(b).items.value,"is-loading":e.unref(w),onLoadMore:e.unref(h).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(o._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(w),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(d._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(j).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(C)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{class:"sv-customer-overview__payment-methods","is-loading":e.unref(w),"payment-methods":e.unref(b).items.value},null,8,["is-loading","payment-methods"]),e.unref(_).customer.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(w),customer:e.unref(_).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),f=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:t=>(r,o)=>{var s,n,i,a;return e.openBlock(),e.createBlock(p._sfc_main,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(s=t.branding)?void 0:s.colors)?void 0:n.primary,"secondary-color":null==(a=null==(i=t.branding)?void 0:i.colors)?void 0:a.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:o[0]||(o[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),_=p.defineCustomElement(f),g=p.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=_,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,_)};
@@ -1,7 +1,156 @@
1
- import { C, S, d } from "../../CustomerOverview.entry.ce-Ce_Yk8-i.mjs";
2
- import "../../component-BkmcE85U.mjs";
1
+ import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
2
+ import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
3
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
4
+ import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-CFzAxyae.mjs";
5
+ import { u as usePortal } from "../../usePortal-cmE08vYs.mjs";
6
+ import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-Ba9WRtuT.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.mjs";
9
+ import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs";
10
+ import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
11
+ import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs";
12
+ import { c as createPaymentMethodsService } from "../../paymentMethods-67b3UlTZ.mjs";
13
+ import { u as useService } from "../../useService-BsSEI8DZ.mjs";
14
+ import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-CkDqmk36.mjs";
15
+ import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
16
+ function useCustomerPaymentMethodOptions({
17
+ customerId,
18
+ amount
19
+ }) {
20
+ const { getPaymentMethodOptions } = createPaymentMethodsService();
21
+ const initialValue = [];
22
+ const { data, execute, error, apiStatus, isPending } = useService({
23
+ initialValue,
24
+ service: async () => {
25
+ const response = await getPaymentMethodOptions({ customerId, amount });
26
+ return response.flatMap((entry) => entry.options ?? []);
27
+ }
28
+ });
29
+ return { error, apiStatus, items: data, fetch: execute, isPending };
30
+ }
31
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
32
+ __name: "CustomerOverview",
33
+ props: {
34
+ configuration: { type: Object }
35
+ },
36
+ setup(__props) {
37
+ var _a;
38
+ const portal = usePortal();
39
+ const customerId = (_a = portal.value) == null ? void 0 : _a.customer_id;
40
+ const customer = useCustomer({ customerId });
41
+ const invoices = useInvoicesList({ customerId, batchSize: 5 });
42
+ const subscriptions = useSubscriptionsList({ customerId, batchSize: 2 });
43
+ const paymentMethods = usePaymentMethods({ customerId });
44
+ const customerPaymentMethodOptions = useCustomerPaymentMethodOptions({ customerId });
45
+ const customerWalletBalances = useCustomerWalletBalances({ customerId });
46
+ const walletBalanceItems = useWalletBalanceItems(customerWalletBalances.walletBalances);
47
+ const { isLoading } = useLoadInitialData(
48
+ customer.get.execute(),
49
+ invoices.fetchInitial(),
50
+ subscriptions.fetchInitial(),
51
+ paymentMethods.fetchAll(),
52
+ customerPaymentMethodOptions.fetch(),
53
+ customerWalletBalances.fetch()
54
+ );
55
+ return (_ctx, _cache) => {
56
+ return openBlock(), createBlock(unref(ContentWithAsideLayout), { class: "sv-customer-overview sv-root sv-screen" }, {
57
+ header: withCtx(() => [
58
+ unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$6, {
59
+ key: 0,
60
+ class: "sv-customer-overview__subscriptions",
61
+ customer: unref(customer).customer.value,
62
+ subscriptions: unref(subscriptions).items.value,
63
+ "payment-methods": unref(paymentMethods).items.value,
64
+ "is-loading": unref(isLoading),
65
+ onLoadMore: unref(subscriptions).fetchMore
66
+ }, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "onLoadMore"])) : createCommentVNode("", true)
67
+ ]),
68
+ content: withCtx(() => [
69
+ createVNode(_sfc_main$5, {
70
+ class: "sv-customer-overview__invoices",
71
+ invoices: unref(invoices).items.value,
72
+ "has-more-items": unref(invoices).hasNextBatch.value,
73
+ "is-loading": unref(isLoading),
74
+ onLoadMore: unref(invoices).fetchMore
75
+ }, null, 8, ["invoices", "has-more-items", "is-loading", "onLoadMore"])
76
+ ]),
77
+ aside: withCtx(() => [
78
+ createVNode(_sfc_main$2, {
79
+ class: "sv-customer-overview__wallet-balances",
80
+ "has-error": unref(customerWalletBalances).apiStatus.value === unref(ApiStatus).Failed,
81
+ "is-loading": unref(isLoading),
82
+ "wallet-balances": unref(walletBalanceItems)
83
+ }, null, 8, ["has-error", "is-loading", "wallet-balances"]),
84
+ createVNode(_sfc_main$3, {
85
+ class: "sv-customer-overview__payment-methods",
86
+ "is-loading": unref(isLoading),
87
+ "payment-methods": unref(paymentMethods).items.value
88
+ }, null, 8, ["is-loading", "payment-methods"]),
89
+ unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$4, {
90
+ key: 0,
91
+ class: "sv-customer-overview__billing-information",
92
+ "is-loading": unref(isLoading),
93
+ customer: unref(customer).customer.value
94
+ }, null, 8, ["is-loading", "customer"])) : createCommentVNode("", true)
95
+ ]),
96
+ _: 1
97
+ });
98
+ };
99
+ }
100
+ });
101
+ const _sfc_main = /* @__PURE__ */ defineComponent({
102
+ __name: "CustomerOverview.entry",
103
+ props: {
104
+ environment: { type: String },
105
+ locale: { type: String },
106
+ dateLocale: { type: String },
107
+ messages: { type: Object },
108
+ primaryColor: { type: String },
109
+ secondaryColor: { type: String },
110
+ isShadowRoot: { type: Boolean },
111
+ experimentalFeatures: { type: Array },
112
+ logLevel: { type: String },
113
+ onLog: { type: Function },
114
+ allowedPortalTypes: { type: Array },
115
+ portalObject: { type: Object },
116
+ cssOverrides: { type: [String, Array] },
117
+ branding: { type: Object },
118
+ configuration: { type: Object }
119
+ },
120
+ setup(__props) {
121
+ return (_ctx, _cache) => {
122
+ var _a, _b, _c, _d;
123
+ return openBlock(), createBlock(_sfc_main$7, {
124
+ "custom-element-name": unref(COMPONENT_NAME),
125
+ environment: __props.environment,
126
+ locale: __props.locale,
127
+ "portal-object": __props.portalObject,
128
+ "allowed-portal-types": ["CUSTOMER"],
129
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
130
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
131
+ "experimental-features": __props.experimentalFeatures,
132
+ "log-level": __props.logLevel,
133
+ "on-log": __props.onLog,
134
+ "css-overrides": __props.cssOverrides,
135
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
136
+ }, {
137
+ default: withCtx(() => [
138
+ createVNode(_sfc_main$1)
139
+ ]),
140
+ _: 1
141
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
142
+ };
143
+ }
144
+ });
145
+ const SolvimonCustomerOverview = defineCustomElement(_sfc_main);
146
+ const COMPONENT_NAME = getComponentName("customer-overview");
147
+ const defineSolvimonCustomerOverview = () => {
148
+ if (!customElements.get(COMPONENT_NAME)) {
149
+ customElements.define(COMPONENT_NAME, SolvimonCustomerOverview);
150
+ }
151
+ };
3
152
  export {
4
- C as COMPONENT_NAME,
5
- S as SolvimonCustomerOverview,
6
- d as defineSolvimonCustomerOverview
153
+ COMPONENT_NAME,
154
+ SolvimonCustomerOverview,
155
+ defineSolvimonCustomerOverview
7
156
  };
@@ -0,0 +1,3 @@
1
+ export declare const SolvimonPayInvoice: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
+ export declare const COMPONENT_NAME: string;
3
+ export declare const defineSolvimonPayInvoice: () => void;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-BOqPDAVk.js"),n=require("../../vendor-ui-5pJF5KBP.js"),o=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CSPZRvMV.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../adyen-R6aSZ0Yf.js"),c=require("../../useLoadInitialData-DjwRHcAH.js"),l=require("../../usePayments-DWXPGFvp.js"),s=require("../../usePaymentMethodOptions-DYO6xr3-.js"),u=require("../../usePaymentMethods-ryN_YohI.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$3),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),m={key:0},y=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref();function y(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const d=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()};return(l,v)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$13),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$6),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:d,onSelect:v[0]||(v[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$12),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(p,{disabled:!s.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),d=e.defineComponent({__name:"PayInvoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:m}=l.usePayments(),{fetchInitial:y}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:d,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),y(),m(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(d),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=e.defineComponent({__name:"PayInvoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(d,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(y,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
@@ -0,0 +1,458 @@
1
+ import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
3
+ import { u as useIntl, x as formatAmount, e as _sfc_main$4, y as _sfc_main$6, _ as _sfc_main$8, l as _sfc_main$9, b as _sfc_main$a, z as _sfc_main$c, v as getCustomerCountry } from "../../vendor-ui-C0K3osvz.mjs";
4
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
5
+ import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Do2KIVKH.mjs";
6
+ import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
7
+ import { _ as _sfc_main$7 } from "../../adyen-Bwewy3HC.mjs";
8
+ import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
9
+ import { u as useInvoice, a as usePayments } from "../../usePayments-Cw5PPEJa.mjs";
10
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-C2k4npCQ.mjs";
11
+ import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.mjs";
12
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13
+ __name: "PayButton",
14
+ props: {
15
+ amount: { type: Object },
16
+ paymentMethod: { type: Object },
17
+ type: { type: String },
18
+ variant: { type: String },
19
+ color: { type: String },
20
+ size: { type: String },
21
+ pill: { type: Boolean },
22
+ square: { type: Boolean },
23
+ loading: { type: Boolean },
24
+ disabled: { type: Boolean },
25
+ iconPrefix: { type: null },
26
+ iconSuffix: { type: null },
27
+ tag: { type: String }
28
+ },
29
+ emits: ["click"],
30
+ setup(__props) {
31
+ const props = __props;
32
+ const { $t } = useIntl();
33
+ const buttonProps = computed(() => ({
34
+ color: props.color ?? "primary",
35
+ disabled: props.disabled,
36
+ iconPrefix: props.iconPrefix,
37
+ iconSuffix: props.iconSuffix,
38
+ loading: props.loading,
39
+ pill: props.pill,
40
+ size: props.size ?? "lg",
41
+ square: props.square,
42
+ tag: props.tag,
43
+ type: props.type,
44
+ variant: props.variant
45
+ }));
46
+ const paymentMethodTypeLabel = computed(() => {
47
+ var _a, _b, _c;
48
+ switch ((_a = props.paymentMethod) == null ? void 0 : _a.paymentMethodType) {
49
+ case "scheme":
50
+ return "Credit Card";
51
+ case "applepay":
52
+ return "Apple Pay";
53
+ case "googlepay":
54
+ return "Google Pay";
55
+ case "paypal":
56
+ return "PayPal";
57
+ case "ideal":
58
+ return "iDeal";
59
+ case "klarna":
60
+ return "Klarna";
61
+ case "bcmc":
62
+ return "BCMC";
63
+ case "sepadirectdebit":
64
+ return "SEPA";
65
+ case "twint":
66
+ return "Twint";
67
+ case "swish":
68
+ return "Swish";
69
+ case "vipps":
70
+ return "Vipps";
71
+ case "mbway":
72
+ return "MBway";
73
+ case "alipay":
74
+ return "AliPay";
75
+ case "wechatpayWeb":
76
+ return "WeChatPay";
77
+ case "afterpay_default":
78
+ return "Afterpay";
79
+ case "affirm":
80
+ return "Affirm";
81
+ case "ach":
82
+ return "ACH";
83
+ case "blik":
84
+ return "Blik";
85
+ case "cashapp":
86
+ return "Cash App Pay";
87
+ case "amazonpay":
88
+ return "Amazon Pay";
89
+ case "venmo":
90
+ return "Venmo";
91
+ case "clicktopay":
92
+ return "Click to Pay";
93
+ case "upi":
94
+ return "UPI";
95
+ case "revolutpay":
96
+ return "Revolut Pay";
97
+ case "ratepay":
98
+ return "Ratepay";
99
+ case "walley":
100
+ return "Walley";
101
+ case "alma":
102
+ return "Alma";
103
+ case "facilypay_3x":
104
+ case "facilypay_4x":
105
+ return "Oney";
106
+ case "samsungpay":
107
+ return "Samsung Pay";
108
+ case "bizum":
109
+ return "Bizum";
110
+ case "pix":
111
+ return "Pix";
112
+ case "multibanco":
113
+ return "Multibanco";
114
+ case "openbanking_UK":
115
+ return "Open Banking";
116
+ default:
117
+ return ((_b = props.paymentMethod) == null ? void 0 : _b.paymentMethodType) ? capitalize((_c = props.paymentMethod) == null ? void 0 : _c.paymentMethodType) : "";
118
+ }
119
+ });
120
+ const buttonText = computed(() => {
121
+ if (props.amount && props.paymentMethod) {
122
+ return $t(
123
+ {
124
+ defaultMessage: "Pay {amount} with {type}",
125
+ id: "pay_button.label.amount_and_payment_method",
126
+ description: "The label for the pay button when both the amount and the payment method are known"
127
+ },
128
+ {
129
+ amount: formatAmount(props.amount),
130
+ type: paymentMethodTypeLabel.value
131
+ }
132
+ );
133
+ }
134
+ if (props.amount) {
135
+ return $t(
136
+ {
137
+ defaultMessage: "Pay {amount}",
138
+ id: "pay_button.label.amount_only",
139
+ description: "The label for the pay button when only the amount is known"
140
+ },
141
+ {
142
+ amount: formatAmount(props.amount),
143
+ type: paymentMethodTypeLabel.value
144
+ }
145
+ );
146
+ }
147
+ return $t({
148
+ defaultMessage: "Pay",
149
+ id: "pay_button.label.default",
150
+ description: "The default label for the pay button when no amount and payment method are known"
151
+ });
152
+ });
153
+ return (_ctx, _cache) => {
154
+ return openBlock(), createBlock(unref(_sfc_main$4), mergeProps(buttonProps.value, {
155
+ class: "w-full",
156
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
157
+ }), {
158
+ default: withCtx(() => [
159
+ createTextVNode(toDisplayString(buttonText.value), 1)
160
+ ]),
161
+ _: 1
162
+ }, 16);
163
+ };
164
+ }
165
+ });
166
+ const _hoisted_1 = { key: 0 };
167
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
168
+ __name: "PayInvoice",
169
+ props: {
170
+ invoice: { type: Object },
171
+ paymentMethodOptions: { type: Array },
172
+ paymentAttempts: { default: () => [], type: Array },
173
+ countryCode: { type: String },
174
+ amount: { type: Object },
175
+ downloadService: { type: Function },
176
+ configuration: { type: Object },
177
+ isLoading: { type: Boolean },
178
+ error: { type: null }
179
+ },
180
+ setup(__props) {
181
+ const { $t } = useIntl();
182
+ const props = __props;
183
+ const selectedPaymentMethod = ref();
184
+ const paymentIntegrationFormRef = ref();
185
+ function handleSubmit() {
186
+ if (!paymentIntegrationFormRef.value) {
187
+ throw new Error("payment integration form not found");
188
+ }
189
+ paymentIntegrationFormRef.value.submit();
190
+ }
191
+ const handlePaymentSuccess = () => {
192
+ if (props.configuration.onPaymentSuccess) {
193
+ props.configuration.onPaymentSuccess();
194
+ }
195
+ };
196
+ return (_ctx, _cache) => {
197
+ return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
198
+ header: withCtx(() => [
199
+ createVNode(_sfc_main$5, { class: "min-h-[52px] w-96" }, {
200
+ default: withCtx(() => [
201
+ __props.invoice && __props.downloadService ? (openBlock(), createBlock(unref(_sfc_main$c), {
202
+ key: 0,
203
+ invoice: __props.invoice,
204
+ "payment-attempts": __props.paymentAttempts,
205
+ "download-service": () => __props.downloadService(__props.invoice.id)
206
+ }, null, 8, ["invoice", "payment-attempts", "download-service"])) : createCommentVNode("", true)
207
+ ]),
208
+ _: 1
209
+ })
210
+ ]),
211
+ content: withCtx(() => {
212
+ var _a, _b;
213
+ return [
214
+ __props.isLoading ? (openBlock(), createBlock(_sfc_main$5, {
215
+ key: 0,
216
+ variant: "section",
217
+ class: "min-h-[300px]"
218
+ })) : createCommentVNode("", true),
219
+ ((_a = __props.invoice) == null ? void 0 : _a.paid) ? (openBlock(), createBlock(_sfc_main$7, {
220
+ key: 1,
221
+ status: "success",
222
+ title: unref($t)({ id: "pay_invoice.paid.title", defaultMessage: "Thank you for your payment!", description: "Title shown when the invoice has already been paid" }),
223
+ class: "mt-8"
224
+ }, {
225
+ default: withCtx(() => [
226
+ createVNode(unref(_sfc_main$8), {
227
+ variant: "body-sm",
228
+ class: "mt-1"
229
+ }, {
230
+ default: withCtx(() => [
231
+ createVNode(unref(_sfc_main$9), { icon: "check" }),
232
+ createTextVNode(toDisplayString(unref(formatAmount)(__props.invoice.tax_summary.total_amount)), 1)
233
+ ]),
234
+ _: 1
235
+ })
236
+ ]),
237
+ _: 1
238
+ }, 8, ["title"])) : __props.error ? (openBlock(), createBlock(_sfc_main$7, {
239
+ key: 2,
240
+ status: "error",
241
+ title: unref($t)({ id: "pay_invoice.error.title", defaultMessage: "Something went wrong", description: "Title shown when the invoice payment fails to load" })
242
+ }, {
243
+ default: withCtx(() => [
244
+ createVNode(unref(_sfc_main$8), {
245
+ variant: "body-sm",
246
+ class: "mt-1"
247
+ }, {
248
+ default: withCtx(() => [
249
+ createTextVNode(toDisplayString(unref($t)({ id: "pay_invoice.error.description", defaultMessage: "Please try again or contact support.", description: "Body text shown when the invoice payment fails to load" })), 1)
250
+ ]),
251
+ _: 1
252
+ })
253
+ ]),
254
+ _: 1
255
+ }, 8, ["title"])) : !__props.isLoading && __props.countryCode && __props.amount && __props.invoice ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
256
+ ((_b = __props.paymentMethodOptions) == null ? void 0 : _b.length) ? (openBlock(), createBlock(unref(_sfc_main$a), {
257
+ key: 0,
258
+ title: unref($t)({ id: "pay_invoice.payment_methods.title", defaultMessage: "Payment methods", description: "Section title for the payment method selector on the pay invoice screen" }),
259
+ "content-background": "none",
260
+ "no-border": "",
261
+ "no-spacing": ""
262
+ }, {
263
+ default: withCtx(() => [
264
+ createVNode(_sfc_main$b, {
265
+ ref_key: "paymentIntegrationFormRef",
266
+ ref: paymentIntegrationFormRef,
267
+ amount: __props.amount,
268
+ "country-code": __props.countryCode,
269
+ context: {
270
+ type: "INVOICE",
271
+ related_resource_ids: [
272
+ {
273
+ type: "INVOICE",
274
+ id: __props.invoice.id
275
+ }
276
+ ]
277
+ },
278
+ "customer-id": __props.invoice.customer.id,
279
+ "force-store-payment-method": "",
280
+ "invoice-id": __props.invoice.id,
281
+ "payment-method-options": __props.paymentMethodOptions,
282
+ variant: "AUTHORIZE",
283
+ onPaymentSuccess: handlePaymentSuccess,
284
+ onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload)
285
+ }, null, 8, ["amount", "country-code", "context", "customer-id", "invoice-id", "payment-method-options"])
286
+ ]),
287
+ _: 1
288
+ }, 8, ["title"])) : createCommentVNode("", true)
289
+ ], 64)) : createCommentVNode("", true)
290
+ ];
291
+ }),
292
+ aside: withCtx(() => [
293
+ createVNode(_sfc_main$5, {
294
+ variant: "section",
295
+ class: "min-h-[200px]"
296
+ }, {
297
+ default: withCtx(() => [
298
+ __props.invoice ? (openBlock(), createBlock(unref(_sfc_main$6), {
299
+ key: 0,
300
+ invoice: __props.invoice
301
+ }, null, 8, ["invoice"])) : createCommentVNode("", true)
302
+ ]),
303
+ _: 1
304
+ }),
305
+ __props.invoice ? (openBlock(), createElementBlock("div", _hoisted_1, [
306
+ createVNode(_sfc_main$3, {
307
+ disabled: !selectedPaymentMethod.value,
308
+ amount: __props.amount,
309
+ "payment-method": selectedPaymentMethod.value,
310
+ onClick: handleSubmit
311
+ }, null, 8, ["disabled", "amount", "payment-method"])
312
+ ])) : createCommentVNode("", true)
313
+ ]),
314
+ _: 1
315
+ });
316
+ };
317
+ }
318
+ });
319
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
320
+ __name: "PayInvoice.entry.view",
321
+ props: {
322
+ environment: { type: String },
323
+ locale: { type: String },
324
+ dateLocale: { type: String },
325
+ messages: { type: Object },
326
+ primaryColor: { type: String },
327
+ secondaryColor: { type: String },
328
+ isShadowRoot: { type: Boolean },
329
+ experimentalFeatures: { type: Array },
330
+ logLevel: { type: String },
331
+ onLog: { type: Function },
332
+ allowedPortalTypes: { type: Array },
333
+ portalObject: { type: Object },
334
+ cssOverrides: { type: [String, Array] },
335
+ branding: { type: Object },
336
+ configuration: { type: Object }
337
+ },
338
+ setup(__props) {
339
+ const props = __props;
340
+ const {
341
+ invoice,
342
+ get: getInvoice,
343
+ downloadInvoicePdf
344
+ } = useInvoice({ invoiceId: props.configuration.invoiceId });
345
+ const { payments, get: getPayments } = usePayments();
346
+ const { fetchInitial } = usePaymentMethods({
347
+ customerId: props.portalObject.customer_id
348
+ });
349
+ const { paymentMethodOptions, get: getPaymentMethodOptions } = usePaymentMethodOptions();
350
+ const getInvoiceAndPaymentMethodOptions = async () => {
351
+ const invoice2 = await getInvoice();
352
+ await getPaymentMethodOptions({
353
+ customerId: invoice2.customer.id,
354
+ amount: invoice2.open_invoice_amount
355
+ });
356
+ };
357
+ const { isLoading } = useLoadInitialData(
358
+ getInvoiceAndPaymentMethodOptions(),
359
+ fetchInitial(),
360
+ getPayments(props.configuration.invoiceId)
361
+ );
362
+ const countryCode = computed(
363
+ () => {
364
+ var _a;
365
+ return ((_a = invoice.value) == null ? void 0 : _a.customer) ? getCustomerCountry(invoice.value.customer) : void 0;
366
+ }
367
+ );
368
+ return (_ctx, _cache) => {
369
+ var _a;
370
+ return renderSlot(_ctx.$slots, "default", {
371
+ invoice: unref(invoice),
372
+ isLoading: unref(isLoading),
373
+ amount: (_a = unref(invoice)) == null ? void 0 : _a.open_invoice_amount,
374
+ countryCode: countryCode.value,
375
+ paymentMethodOptions: unref(paymentMethodOptions),
376
+ paymentAttempts: unref(payments),
377
+ downloadService: unref(downloadInvoicePdf)
378
+ });
379
+ };
380
+ }
381
+ });
382
+ const _sfc_main = /* @__PURE__ */ defineComponent({
383
+ __name: "PayInvoice.entry",
384
+ props: {
385
+ environment: { type: String },
386
+ locale: { type: String },
387
+ dateLocale: { type: String },
388
+ messages: { type: Object },
389
+ primaryColor: { type: String },
390
+ secondaryColor: { type: String },
391
+ isShadowRoot: { type: Boolean },
392
+ experimentalFeatures: { type: Array },
393
+ logLevel: { type: String },
394
+ onLog: { type: Function },
395
+ allowedPortalTypes: { type: Array },
396
+ portalObject: { type: Object },
397
+ cssOverrides: { type: [String, Array] },
398
+ branding: { type: Object },
399
+ configuration: { type: Object }
400
+ },
401
+ setup(__props) {
402
+ return (_ctx, _cache) => {
403
+ var _a, _b, _c, _d;
404
+ return openBlock(), createBlock(unref(_sfc_main$d), {
405
+ "custom-element-name": unref(COMPONENT_NAME),
406
+ environment: __props.environment,
407
+ locale: __props.locale,
408
+ "portal-object": __props.portalObject,
409
+ "allowed-portal-types": ["CUSTOMER"],
410
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
411
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
412
+ "experimental-features": __props.experimentalFeatures,
413
+ "log-level": __props.logLevel,
414
+ "on-log": __props.onLog,
415
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
416
+ }, {
417
+ default: withCtx(() => [
418
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
419
+ default: withCtx(({
420
+ invoice,
421
+ isLoading,
422
+ amount,
423
+ countryCode,
424
+ paymentMethodOptions,
425
+ paymentAttempts,
426
+ downloadService
427
+ }) => [
428
+ createVNode(_sfc_main$2, {
429
+ "is-loading": isLoading,
430
+ invoice,
431
+ amount,
432
+ "country-code": countryCode,
433
+ "payment-method-options": paymentMethodOptions,
434
+ configuration: __props.configuration,
435
+ "payment-attempts": paymentAttempts ?? [],
436
+ "download-service": downloadService
437
+ }, null, 8, ["is-loading", "invoice", "amount", "country-code", "payment-method-options", "configuration", "payment-attempts", "download-service"])
438
+ ]),
439
+ _: 1
440
+ }, 16)
441
+ ]),
442
+ _: 1
443
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
444
+ };
445
+ }
446
+ });
447
+ const SolvimonPayInvoice = defineCustomElement(_sfc_main);
448
+ const COMPONENT_NAME = getComponentName("pay-invoice");
449
+ const defineSolvimonPayInvoice = () => {
450
+ if (!customElements.get(COMPONENT_NAME)) {
451
+ customElements.define(COMPONENT_NAME, SolvimonPayInvoice);
452
+ }
453
+ };
454
+ export {
455
+ COMPONENT_NAME,
456
+ SolvimonPayInvoice,
457
+ defineSolvimonPayInvoice
458
+ };