@solvimon/solvimon-web 0.1.0-alpha.1

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 (132) hide show
  1. package/README.md +80 -0
  2. package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +99 -0
  3. package/dist/BillingInformation.entry.ce-DkrfEvK_.js +1 -0
  4. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs +56 -0
  5. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js +1 -0
  6. package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +1 -0
  7. package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +579 -0
  8. package/dist/Checkout.entry.ce-Bif6vR1K.mjs +5185 -0
  9. package/dist/Checkout.entry.ce-CkQnLAn4.js +1 -0
  10. package/dist/ContentWithAsideLayout-BC-C5Gjt.mjs +42 -0
  11. package/dist/ContentWithAsideLayout-CIVSoqFr.js +1 -0
  12. package/dist/CustomerOverview.entry.ce-C__omsVl.js +1 -0
  13. package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +231 -0
  14. package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +135 -0
  15. package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +1 -0
  16. package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +583 -0
  17. package/dist/Invoice.entry.ce-Cgr43ome.js +1 -0
  18. package/dist/InvoiceDetails.entry.ce-Cnpz8CLJ.mjs +130 -0
  19. package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +1 -0
  20. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs +85 -0
  21. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js +1 -0
  22. package/dist/InvoicesList.entry.ce-38iOW5qh.js +1 -0
  23. package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +105 -0
  24. package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +1 -0
  25. package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +134 -0
  26. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js +1 -0
  27. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs +90 -0
  28. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs +6568 -0
  29. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +1 -0
  30. package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +238 -0
  31. package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +1 -0
  32. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs +62 -0
  33. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +1 -0
  34. package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +1 -0
  35. package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +153 -0
  36. package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +1 -0
  37. package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +135 -0
  38. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs +373 -0
  39. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js +1 -0
  40. package/dist/_Uint8Array-DHE03FZr.mjs +507 -0
  41. package/dist/_Uint8Array-DxISR7XF.js +1 -0
  42. package/dist/auto-B_36W1Fc.js +6 -0
  43. package/dist/auto-BfMZdgp-.mjs +14207 -0
  44. package/dist/cloneDeep-Hs8Pp07F.js +1 -0
  45. package/dist/cloneDeep-sm9cY-u2.mjs +212 -0
  46. package/dist/component-BkmcE85U.mjs +58654 -0
  47. package/dist/component-Df5eNqYX.js +1 -0
  48. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +3 -0
  49. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -0
  50. package/dist/components/BillingInformation/BillingInformation.es.js +7 -0
  51. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +3 -0
  52. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -0
  53. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +7 -0
  54. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +3 -0
  55. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -0
  56. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +7 -0
  57. package/dist/components/Invoice/Invoice.ce.d.ts +3 -0
  58. package/dist/components/Invoice/Invoice.cjs.js +1 -0
  59. package/dist/components/Invoice/Invoice.es.js +7 -0
  60. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +3 -0
  61. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -0
  62. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +7 -0
  63. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +3 -0
  64. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -0
  65. package/dist/components/InvoicesList/InvoicesList.es.js +7 -0
  66. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +3 -0
  67. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -0
  68. package/dist/components/PaymentHistory/PaymentHistory.es.js +7 -0
  69. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +3 -0
  70. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -0
  71. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -0
  72. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +3 -0
  73. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -0
  74. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +7 -0
  75. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +3 -0
  76. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -0
  77. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +7 -0
  78. package/dist/core/action-request.types.d.ts +58 -0
  79. package/dist/core/configuration.d.ts +2 -0
  80. package/dist/core/index.cjs.js +1 -0
  81. package/dist/core/index.d.ts +10 -0
  82. package/dist/core/index.es.js +6 -0
  83. package/dist/core/registry.ce.d.ts +2 -0
  84. package/dist/core/registry.d.ts +6 -0
  85. package/dist/core/types.d.ts +107 -0
  86. package/dist/index-2jo9BSPM.js +1 -0
  87. package/dist/index-BFZ0dPh9.mjs +179 -0
  88. package/dist/index-CWSXne1Q.js +1 -0
  89. package/dist/index-CzL1ZcGi.mjs +85 -0
  90. package/dist/index-D3v7hAtc.mjs +253 -0
  91. package/dist/index-DRdBmZ2-.js +1 -0
  92. package/dist/index.cjs.js +1 -0
  93. package/dist/index.d.ts +13 -0
  94. package/dist/index.es.js +39 -0
  95. package/dist/invoices-8M_3ur_U.js +1 -0
  96. package/dist/invoices-C31Wz1Bu.mjs +84 -0
  97. package/dist/paymentMethods-CrU4G_2Y.mjs +65 -0
  98. package/dist/paymentMethods-CzUqDlvc.js +1 -0
  99. package/dist/payments-C3LPk9k9.js +1 -0
  100. package/dist/payments-NtWI8KlU.mjs +47 -0
  101. package/dist/registry-By94DXE2.js +1 -0
  102. package/dist/registry-shRKDl3K.mjs +127 -0
  103. package/dist/screens/Checkout/Checkout.ce.d.ts +3 -0
  104. package/dist/screens/Checkout/Checkout.cjs.js +1 -0
  105. package/dist/screens/Checkout/Checkout.es.js +7 -0
  106. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +3 -0
  107. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -0
  108. package/dist/screens/CustomerOverview/CustomerOverview.es.js +7 -0
  109. package/dist/solvimon-web.css +1 -0
  110. package/dist/sprite-i5T7eZnk-C55G-dBo.js +1 -0
  111. package/dist/sprite-i5T7eZnk-i5T7eZnk.mjs +4 -0
  112. package/dist/subscriptions-3R7aMoky.mjs +74 -0
  113. package/dist/subscriptions-CqK7t-fF.js +1 -0
  114. package/dist/useActionDispatchProvider-CBo_Hwu5.mjs +12 -0
  115. package/dist/useActionDispatchProvider-DsIljrhi.js +1 -0
  116. package/dist/useCustomer-BRY0tuBH.mjs +45 -0
  117. package/dist/useCustomer-Dp8sGHI0.js +1 -0
  118. package/dist/useCustomerPaymentMethodOptions-DYpMDnJR.js +1 -0
  119. package/dist/useCustomerPaymentMethodOptions-Fe_dLxfv.mjs +168 -0
  120. package/dist/useIncrementalLoading-D8oKNxX7.js +1 -0
  121. package/dist/useIncrementalLoading-fHCizCSo.mjs +69 -0
  122. package/dist/useInvoiceData-DImEH1ca.js +1 -0
  123. package/dist/useInvoiceData-dyvoDwFF.mjs +51 -0
  124. package/dist/useInvoicesList-BZQ9Y0qN.js +1 -0
  125. package/dist/useInvoicesList-rDvRzMqe.mjs +294 -0
  126. package/dist/useLoadInitialData-BRg7IWqW.js +1 -0
  127. package/dist/useLoadInitialData-Dm48tlSO.mjs +13 -0
  128. package/dist/usePaymentMethods-Bq5fWl1Q.mjs +16 -0
  129. package/dist/usePaymentMethods-Dbimodf0.js +1 -0
  130. package/dist/useService-Dz13Nxbi.mjs +272 -0
  131. package/dist/useService-bNNi4GB8.js +1 -0
  132. package/package.json +174 -0
@@ -0,0 +1,130 @@
1
+ import { defineComponent, openBlock, createBlock, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps, createCommentVNode } from "vue";
2
+ import { _ as _sfc_main$4 } from "./InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs";
3
+ import { _ as _sfc_main$3 } from "./Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs";
4
+ import { u as useInvoiceData } from "./useInvoiceData-dyvoDwFF.mjs";
5
+ import { o as _sfc_main$5, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
6
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7
+ __name: "InvoiceDetails",
8
+ props: {
9
+ invoice: { type: Object },
10
+ isLoading: { type: Boolean },
11
+ configuration: { type: Object }
12
+ },
13
+ setup(__props) {
14
+ return (_ctx, _cache) => {
15
+ return __props.isLoading ? (openBlock(), createBlock(_sfc_main$3, {
16
+ key: 0,
17
+ variant: "section",
18
+ class: "min-h-[100px]",
19
+ "data-testid": "invoice-details-skeleton"
20
+ })) : (openBlock(), createBlock(_sfc_main$4, {
21
+ key: 1,
22
+ invoice: __props.invoice
23
+ }, null, 8, ["invoice"]));
24
+ };
25
+ }
26
+ });
27
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28
+ __name: "InvoiceDetails.entry.view",
29
+ props: {
30
+ environment: { type: String },
31
+ locale: { type: String },
32
+ dateLocale: { type: String },
33
+ messages: { type: Object },
34
+ showTimezones: { type: Boolean },
35
+ primaryColor: { type: String },
36
+ secondaryColor: { type: String },
37
+ isShadowRoot: { type: Boolean },
38
+ experimentalFeatures: { type: Array },
39
+ logLevel: { type: String },
40
+ onLog: { type: Function },
41
+ allowedPortalTypes: { type: Array },
42
+ portalObject: { type: Object },
43
+ customElementName: { type: String },
44
+ branding: { type: Object },
45
+ configuration: { type: Object }
46
+ },
47
+ setup(__props) {
48
+ const props = __props;
49
+ const invoiceData = useInvoiceData(props.configuration.invoiceId);
50
+ return (_ctx, _cache) => {
51
+ var _a;
52
+ return renderSlot(_ctx.$slots, "default", {
53
+ invoice: (_a = unref(invoiceData).data.value) == null ? void 0 : _a.invoice,
54
+ isLoading: unref(invoiceData).isPending.value
55
+ });
56
+ };
57
+ }
58
+ });
59
+ const _sfc_main = /* @__PURE__ */ defineComponent({
60
+ __name: "InvoiceDetails.entry",
61
+ props: {
62
+ environment: { type: String },
63
+ locale: { type: String },
64
+ dateLocale: { type: String },
65
+ messages: { type: Object },
66
+ showTimezones: { type: Boolean },
67
+ primaryColor: { type: String },
68
+ secondaryColor: { type: String },
69
+ isShadowRoot: { type: Boolean },
70
+ experimentalFeatures: { type: Array },
71
+ logLevel: { type: String },
72
+ onLog: { type: Function },
73
+ allowedPortalTypes: { type: Array },
74
+ portalObject: { type: Object },
75
+ customElementName: { type: String },
76
+ branding: { type: Object },
77
+ configuration: { type: Object }
78
+ },
79
+ setup(__props) {
80
+ var _a;
81
+ const props = __props;
82
+ if (!((_a = props.configuration) == null ? void 0 : _a.invoiceId)) {
83
+ throw new Error("Missing invoice id");
84
+ }
85
+ return (_ctx, _cache) => {
86
+ var _a2, _b, _c, _d;
87
+ return openBlock(), createBlock(unref(_sfc_main$5), {
88
+ "custom-element-name": unref(COMPONENT_NAME),
89
+ environment: __props.environment,
90
+ locale: __props.locale,
91
+ "portal-object": __props.portalObject,
92
+ "allowed-portal-types": ["CUSTOMER"],
93
+ "primary-color": (_b = (_a2 = __props.branding) == null ? void 0 : _a2.colors) == null ? void 0 : _b.primary,
94
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
95
+ "experimental-features": __props.experimentalFeatures,
96
+ "log-level": __props.logLevel,
97
+ "on-log": __props.onLog,
98
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
99
+ }, {
100
+ default: withCtx(() => [
101
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
102
+ default: withCtx(({ invoice, isLoading }) => [
103
+ invoice ? (openBlock(), createBlock(_sfc_main$2, {
104
+ key: 0,
105
+ "is-loading": isLoading,
106
+ invoice,
107
+ configuration: __props.configuration
108
+ }, null, 8, ["is-loading", "invoice", "configuration"])) : createCommentVNode("", true)
109
+ ]),
110
+ _: 1
111
+ }, 16)
112
+ ]),
113
+ _: 1
114
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
115
+ };
116
+ }
117
+ });
118
+ const SolvimonInvoiceDetails = defineCustomElement(_sfc_main);
119
+ const COMPONENT_NAME = getComponentName("invoice-details");
120
+ const defineSolvimonInvoiceDetails = () => {
121
+ if (!customElements.get(COMPONENT_NAME)) {
122
+ customElements.define(COMPONENT_NAME, SolvimonInvoiceDetails);
123
+ }
124
+ };
125
+ export {
126
+ COMPONENT_NAME as C,
127
+ SolvimonInvoiceDetails as S,
128
+ _sfc_main as _,
129
+ defineSolvimonInvoiceDetails as d
130
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),o=require("./InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js"),t=require("./Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js"),n=require("./useInvoiceData-DImEH1ca.js"),i=require("./component-Df5eNqYX.js"),r=e.defineComponent({__name:"InvoiceDetails",props:{invoice:{type:Object},isLoading:{type:Boolean},configuration:{type:Object}},setup:n=>(i,r)=>n.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"invoice-details-skeleton"})):(e.openBlock(),e.createBlock(o._sfc_main,{key:1,invoice:n.invoice},null,8,["invoice"]))}),a=e.defineComponent({__name:"InvoiceDetails.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(o){const t=o,i=n.useInvoiceData(t.configuration.invoiceId);return(o,t)=>{var n;return e.renderSlot(o.$slots,"default",{invoice:null==(n=e.unref(i).data.value)?void 0:n.invoice,isLoading:e.unref(i).isPending.value})}}}),l=e.defineComponent({__name:"InvoiceDetails.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(o){var t;if(!(null==(t=o.configuration)?void 0:t.invoiceId))throw new Error("Missing invoice id");return(t,n)=>{var l,c,p,u;return e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{"custom-element-name":e.unref(s),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(l=o.branding)?void 0:l.colors)?void 0:c.primary,"secondary-color":null==(u=null==(p=o.branding)?void 0:p.colors)?void 0:u.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:n[0]||(n[0]=e=>t.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(({invoice:t,isLoading:n})=>[t?(e.openBlock(),e.createBlock(r,{key:0,"is-loading":n,invoice:t,configuration:o.configuration},null,8,["is-loading","invoice","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),c=i.defineCustomElement(l),s=i.getComponentName("invoice-details");exports.COMPONENT_NAME=s,exports.SolvimonInvoiceDetails=c,exports._sfc_main=l,exports.defineSolvimonInvoiceDetails=()=>{customElements.get(s)||customElements.define(s,c)};
@@ -0,0 +1,85 @@
1
+ import { defineComponent, openBlock, createBlock, unref, withCtx, createElementBlock, createElementVNode, createVNode, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { b as useIntl, d as _sfc_main$1g, _ as _sfc_main$2 } from "./component-BkmcE85U.mjs";
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "flex flex-col gap-2"
6
+ };
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "InvoiceDetailsBlock",
9
+ props: {
10
+ invoice: { type: Object }
11
+ },
12
+ setup(__props) {
13
+ const { $t, formatDate } = useIntl();
14
+ return (_ctx, _cache) => {
15
+ return openBlock(), createBlock(unref(_sfc_main$1g), {
16
+ title: unref($t)({
17
+ defaultMessage: "Invoice details",
18
+ description: "Title for the invoice details block on the invoice overview page",
19
+ id: "sdk.invoice_details.invoice_details_block.title"
20
+ })
21
+ }, {
22
+ default: withCtx(() => [
23
+ __props.invoice ? (openBlock(), createElementBlock("div", _hoisted_1, [
24
+ createElementVNode("div", null, [
25
+ createVNode(unref(_sfc_main$2), { variant: "caps-heading" }, {
26
+ default: withCtx(() => [
27
+ createTextVNode(toDisplayString(unref($t)({
28
+ defaultMessage: "Invoice date",
29
+ description: "Title for the invoice date in invoice details block on the invoice overview page",
30
+ id: "sdk.invoice_details.invoice_details_block.invoice_date"
31
+ })), 1)
32
+ ]),
33
+ _: 1
34
+ }),
35
+ __props.invoice.invoice_date ? (openBlock(), createBlock(unref(_sfc_main$2), {
36
+ key: 0,
37
+ variant: "body-xs"
38
+ }, {
39
+ default: withCtx(() => [
40
+ createTextVNode(toDisplayString(unref(formatDate)({
41
+ date: __props.invoice.invoice_date,
42
+ format: "date",
43
+ timezone: __props.invoice.customer.timezone,
44
+ offsetType: "offsetted"
45
+ })), 1)
46
+ ]),
47
+ _: 1
48
+ })) : createCommentVNode("", true)
49
+ ]),
50
+ createElementVNode("div", null, [
51
+ createVNode(unref(_sfc_main$2), { variant: "caps-heading" }, {
52
+ default: withCtx(() => [
53
+ createTextVNode(toDisplayString(unref($t)({
54
+ defaultMessage: "Due date",
55
+ description: "Title for the due date in invoice details block on the invoice overview page",
56
+ id: "sdk.invoice_details.invoice_details_block.due_date"
57
+ })), 1)
58
+ ]),
59
+ _: 1
60
+ }),
61
+ __props.invoice.due_date ? (openBlock(), createBlock(unref(_sfc_main$2), {
62
+ key: 0,
63
+ variant: "body-xs"
64
+ }, {
65
+ default: withCtx(() => [
66
+ createTextVNode(toDisplayString(unref(formatDate)({
67
+ date: __props.invoice.due_date,
68
+ format: "date",
69
+ timezone: __props.invoice.customer.timezone,
70
+ offsetType: "offsetted"
71
+ })), 1)
72
+ ]),
73
+ _: 1
74
+ })) : createCommentVNode("", true)
75
+ ])
76
+ ])) : createCommentVNode("", true)
77
+ ]),
78
+ _: 1
79
+ }, 8, ["title"]);
80
+ };
81
+ }
82
+ });
83
+ export {
84
+ _sfc_main as _
85
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./component-Df5eNqYX.js"),i={key:0,class:"flex flex-col gap-2"},o=e.defineComponent({__name:"InvoiceDetailsBlock",props:{invoice:{type:Object}},setup(o){const{$t:n,formatDate:a}=t.useIntl();return(c,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{title:e.unref(n)({defaultMessage:"Invoice details",description:"Title for the invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.title"})},{default:e.withCtx(()=>[o.invoice?(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Invoice date",description:"Title for the invoice date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.invoice_date"})),1)]),_:1}),o.invoice.invoice_date?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:o.invoice.invoice_date,format:"date",timezone:o.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Due date",description:"Title for the due date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.due_date"})),1)]),_:1}),o.invoice.due_date?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:o.invoice.due_date,format:"date",timezone:o.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}});exports._sfc_main=o;
@@ -0,0 +1 @@
1
+ const e=require("vue"),o=require("./useInvoicesList-BZQ9Y0qN.js"),t=require("./component-Df5eNqYX.js"),n=e.defineComponent({__name:"InvoicesList.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){var n,r;const i=t,a=i.portalObject.customer_id,l=o.useInvoicesList({customerId:a,batchSize:(null==(r=null==(n=i.configuration)?void 0:n.pagination)?void 0:r.batchSize)||15});return(o,t)=>e.renderSlot(o.$slots,"default",{invoices:e.unref(l)})}}),r=e.defineComponent({__name:"InvoicesList.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:r=>(i,l)=>{var s,c,p,m;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(a),environment:r.environment,locale:r.locale,"portal-object":r.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(s=r.branding)?void 0:s.colors)?void 0:c.primary,"secondary-color":null==(m=null==(p=r.branding)?void 0:p.colors)?void 0:m.secondary,"experimental-features":r.experimentalFeatures,"log-level":r.logLevel,"on-log":r.onLog,onError:l[0]||(l[0]=e=>i.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(n,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({invoices:t})=>[e.createVNode(o._sfc_main,{configuration:r.configuration,invoices:t.items.value,"is-loading":t.isPending.value,"has-more-items":t.hasNextBatch.value,onLoadMore:t.fetchMore},null,8,["configuration","invoices","is-loading","has-more-items","onLoadMore"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),i=t.defineCustomElement(r),a=t.getComponentName("customer-overview");exports.COMPONENT_NAME=a,exports.SolvimonInvoicesList=i,exports._sfc_main=r,exports.defineSolvimonInvoicesList=()=>{customElements.get(a)||customElements.define(a,i)};
@@ -0,0 +1,105 @@
1
+ import { defineComponent, renderSlot, unref, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
2
+ import { u as useInvoicesList, _ as _sfc_main$3 } from "./useInvoicesList-rDvRzMqe.mjs";
3
+ import { o as _sfc_main$2, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
4
+ const DEFAULT_BATCH_SIZE = 15;
5
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6
+ __name: "InvoicesList.entry.view",
7
+ props: {
8
+ environment: { type: String },
9
+ locale: { type: String },
10
+ dateLocale: { type: String },
11
+ messages: { type: Object },
12
+ showTimezones: { type: Boolean },
13
+ primaryColor: { type: String },
14
+ secondaryColor: { type: String },
15
+ isShadowRoot: { type: Boolean },
16
+ experimentalFeatures: { type: Array },
17
+ logLevel: { type: String },
18
+ onLog: { type: Function },
19
+ allowedPortalTypes: { type: Array },
20
+ portalObject: { type: Object },
21
+ customElementName: { type: String },
22
+ branding: { type: Object },
23
+ configuration: { type: Object }
24
+ },
25
+ setup(__props) {
26
+ var _a, _b;
27
+ const props = __props;
28
+ const customerId = props.portalObject.customer_id;
29
+ const invoices = useInvoicesList({
30
+ customerId,
31
+ batchSize: ((_b = (_a = props.configuration) == null ? void 0 : _a.pagination) == null ? void 0 : _b.batchSize) || DEFAULT_BATCH_SIZE
32
+ });
33
+ return (_ctx, _cache) => {
34
+ return renderSlot(_ctx.$slots, "default", { invoices: unref(invoices) });
35
+ };
36
+ }
37
+ });
38
+ const _sfc_main = /* @__PURE__ */ defineComponent({
39
+ __name: "InvoicesList.entry",
40
+ props: {
41
+ environment: { type: String },
42
+ locale: { type: String },
43
+ dateLocale: { type: String },
44
+ messages: { type: Object },
45
+ showTimezones: { type: Boolean },
46
+ primaryColor: { type: String },
47
+ secondaryColor: { type: String },
48
+ isShadowRoot: { type: Boolean },
49
+ experimentalFeatures: { type: Array },
50
+ logLevel: { type: String },
51
+ onLog: { type: Function },
52
+ allowedPortalTypes: { type: Array },
53
+ portalObject: { type: Object },
54
+ customElementName: { type: String },
55
+ branding: { type: Object },
56
+ configuration: { type: Object }
57
+ },
58
+ setup(__props) {
59
+ return (_ctx, _cache) => {
60
+ var _a, _b, _c, _d;
61
+ return openBlock(), createBlock(unref(_sfc_main$2), {
62
+ "custom-element-name": unref(COMPONENT_NAME),
63
+ environment: __props.environment,
64
+ locale: __props.locale,
65
+ "portal-object": __props.portalObject,
66
+ "allowed-portal-types": ["CUSTOMER"],
67
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
68
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
69
+ "experimental-features": __props.experimentalFeatures,
70
+ "log-level": __props.logLevel,
71
+ "on-log": __props.onLog,
72
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
73
+ }, {
74
+ default: withCtx(() => [
75
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
76
+ default: withCtx(({ invoices }) => [
77
+ createVNode(_sfc_main$3, {
78
+ configuration: __props.configuration,
79
+ invoices: invoices.items.value,
80
+ "is-loading": invoices.isPending.value,
81
+ "has-more-items": invoices.hasNextBatch.value,
82
+ onLoadMore: invoices.fetchMore
83
+ }, null, 8, ["configuration", "invoices", "is-loading", "has-more-items", "onLoadMore"])
84
+ ]),
85
+ _: 1
86
+ }, 16)
87
+ ]),
88
+ _: 1
89
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
90
+ };
91
+ }
92
+ });
93
+ const SolvimonInvoicesList = defineCustomElement(_sfc_main);
94
+ const COMPONENT_NAME = getComponentName("customer-overview");
95
+ const defineSolvimonInvoicesList = () => {
96
+ if (!customElements.get(COMPONENT_NAME)) {
97
+ customElements.define(COMPONENT_NAME, SolvimonInvoicesList);
98
+ }
99
+ };
100
+ export {
101
+ COMPONENT_NAME as C,
102
+ SolvimonInvoicesList as S,
103
+ _sfc_main as _,
104
+ defineSolvimonInvoicesList as d
105
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js"),o=require("./Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js"),n=require("./useInvoiceData-DImEH1ca.js"),r=require("./component-Df5eNqYX.js"),a=e.defineComponent({__name:"PaymentHistory",props:{customer:{type:Object},paymentAttempts:{type:Array},isLoading:{type:Boolean},configuration:{type:Object}},setup:n=>(r,a)=>n.isLoading?(e.openBlock(),e.createBlock(o._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"payment-history-skeleton"})):n.paymentAttempts.length?(e.openBlock(),e.createBlock(t._sfc_main,{key:1,"payment-attempts":n.paymentAttempts,customer:n.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0)}),i=e.defineComponent({__name:"PaymentHistory.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,r=n.useInvoiceData(o.configuration.invoiceId);return(t,o)=>{var n,a;return e.renderSlot(t.$slots,"default",{invoice:null==(n=e.unref(r).data.value)?void 0:n.invoice,paymentAttempts:null==(a=e.unref(r).data.value)?void 0:a.paymentAttempts.data,isLoading:e.unref(r).isPending.value})}}}),l=e.defineComponent({__name:"PaymentHistory.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){var o;if(!(null==(o=t.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");return(o,n)=>{var l,p,m,c;return e.openBlock(),e.createBlock(e.unref(r._sfc_main$1),{"custom-element-name":e.unref(s),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(l=t.branding)?void 0:l.colors)?void 0:p.primary,"secondary-color":null==(c=null==(m=t.branding)?void 0:m.colors)?void 0:c.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(i,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:o,paymentAttempts:n,isLoading:r})=>[o&&n?(e.openBlock(),e.createBlock(a,{key:0,"is-loading":r,customer:o.customer,"payment-attempts":n,configuration:t.configuration},null,8,["is-loading","customer","payment-attempts","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),p=r.defineCustomElement(l),s=r.getComponentName("payment-history");exports.COMPONENT_NAME=s,exports.SolvimonPaymentHistory=p,exports._sfc_main=l,exports.defineSolvimonPaymentHistory=()=>{customElements.get(s)||customElements.define(s,p)};
@@ -0,0 +1,134 @@
1
+ import { defineComponent, openBlock, createBlock, createCommentVNode, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
2
+ import { _ as _sfc_main$4 } from "./PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs";
3
+ import { _ as _sfc_main$3 } from "./Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs";
4
+ import { u as useInvoiceData } from "./useInvoiceData-dyvoDwFF.mjs";
5
+ import { o as _sfc_main$5, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
6
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7
+ __name: "PaymentHistory",
8
+ props: {
9
+ customer: { type: Object },
10
+ paymentAttempts: { type: Array },
11
+ isLoading: { type: Boolean },
12
+ configuration: { type: Object }
13
+ },
14
+ setup(__props) {
15
+ return (_ctx, _cache) => {
16
+ return __props.isLoading ? (openBlock(), createBlock(_sfc_main$3, {
17
+ key: 0,
18
+ variant: "section",
19
+ class: "min-h-[100px]",
20
+ "data-testid": "payment-history-skeleton"
21
+ })) : __props.paymentAttempts.length ? (openBlock(), createBlock(_sfc_main$4, {
22
+ key: 1,
23
+ "payment-attempts": __props.paymentAttempts,
24
+ customer: __props.customer
25
+ }, null, 8, ["payment-attempts", "customer"])) : createCommentVNode("", true);
26
+ };
27
+ }
28
+ });
29
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
30
+ __name: "PaymentHistory.entry.view",
31
+ props: {
32
+ environment: { type: String },
33
+ locale: { type: String },
34
+ dateLocale: { type: String },
35
+ messages: { type: Object },
36
+ showTimezones: { type: Boolean },
37
+ primaryColor: { type: String },
38
+ secondaryColor: { type: String },
39
+ isShadowRoot: { type: Boolean },
40
+ experimentalFeatures: { type: Array },
41
+ logLevel: { type: String },
42
+ onLog: { type: Function },
43
+ allowedPortalTypes: { type: Array },
44
+ portalObject: { type: Object },
45
+ customElementName: { type: String },
46
+ branding: { type: Object },
47
+ configuration: { type: Object }
48
+ },
49
+ setup(__props) {
50
+ const props = __props;
51
+ const invoiceData = useInvoiceData(props.configuration.invoiceId);
52
+ return (_ctx, _cache) => {
53
+ var _a, _b;
54
+ return renderSlot(_ctx.$slots, "default", {
55
+ invoice: (_a = unref(invoiceData).data.value) == null ? void 0 : _a.invoice,
56
+ paymentAttempts: (_b = unref(invoiceData).data.value) == null ? void 0 : _b.paymentAttempts.data,
57
+ isLoading: unref(invoiceData).isPending.value
58
+ });
59
+ };
60
+ }
61
+ });
62
+ const _sfc_main = /* @__PURE__ */ defineComponent({
63
+ __name: "PaymentHistory.entry",
64
+ props: {
65
+ environment: { type: String },
66
+ locale: { type: String },
67
+ dateLocale: { type: String },
68
+ messages: { type: Object },
69
+ showTimezones: { type: Boolean },
70
+ primaryColor: { type: String },
71
+ secondaryColor: { type: String },
72
+ isShadowRoot: { type: Boolean },
73
+ experimentalFeatures: { type: Array },
74
+ logLevel: { type: String },
75
+ onLog: { type: Function },
76
+ allowedPortalTypes: { type: Array },
77
+ portalObject: { type: Object },
78
+ customElementName: { type: String },
79
+ branding: { type: Object },
80
+ configuration: { type: Object }
81
+ },
82
+ setup(__props) {
83
+ var _a;
84
+ const props = __props;
85
+ if (!((_a = props.configuration) == null ? void 0 : _a.invoiceId)) {
86
+ throw new Error("Missing invoice id");
87
+ }
88
+ return (_ctx, _cache) => {
89
+ var _a2, _b, _c, _d;
90
+ return openBlock(), createBlock(unref(_sfc_main$5), {
91
+ "custom-element-name": unref(COMPONENT_NAME),
92
+ environment: __props.environment,
93
+ locale: __props.locale,
94
+ "portal-object": __props.portalObject,
95
+ "allowed-portal-types": ["CUSTOMER"],
96
+ "primary-color": (_b = (_a2 = __props.branding) == null ? void 0 : _a2.colors) == null ? void 0 : _b.primary,
97
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
98
+ "experimental-features": __props.experimentalFeatures,
99
+ "log-level": __props.logLevel,
100
+ "on-log": __props.onLog,
101
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
102
+ }, {
103
+ default: withCtx(() => [
104
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
105
+ default: withCtx(({ invoice, paymentAttempts, isLoading }) => [
106
+ invoice && paymentAttempts ? (openBlock(), createBlock(_sfc_main$2, {
107
+ key: 0,
108
+ "is-loading": isLoading,
109
+ customer: invoice.customer,
110
+ "payment-attempts": paymentAttempts,
111
+ configuration: __props.configuration
112
+ }, null, 8, ["is-loading", "customer", "payment-attempts", "configuration"])) : createCommentVNode("", true)
113
+ ]),
114
+ _: 1
115
+ }, 16)
116
+ ]),
117
+ _: 1
118
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
119
+ };
120
+ }
121
+ });
122
+ const SolvimonPaymentHistory = defineCustomElement(_sfc_main);
123
+ const COMPONENT_NAME = getComponentName("payment-history");
124
+ const defineSolvimonPaymentHistory = () => {
125
+ if (!customElements.get(COMPONENT_NAME)) {
126
+ customElements.define(COMPONENT_NAME, SolvimonPaymentHistory);
127
+ }
128
+ };
129
+ export {
130
+ COMPONENT_NAME as C,
131
+ SolvimonPaymentHistory as S,
132
+ _sfc_main as _,
133
+ defineSolvimonPaymentHistory as d
134
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./component-Df5eNqYX.js"),a={class:"flex flex-col-reverse gap-1"},n={class:"flex justify-between items-center mb-2"},o=e.defineComponent({__name:"PaymentHistoryBlock",props:{paymentAttempts:{type:Array},customer:{type:Object}},setup(o){const{$t:r,formatDate:i}=t.useIntl(),s={AUTHORIZED:"green",CANCELLED:"red",ERROR:"red",PENDING:"orange",PENDING_REFUND:"orange",REFUNDED:"orange",CHARGED_BACK:"orange",REFUSED:"red"};return(m,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(t._sfc_main$2),{tag:"h2",variant:"heading-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Payment history",description:"Title for the payment history block on the invoice details page",id:"sdk.invoice_details.payment_history.title"})),1)]),_:1}),e.createElementVNode("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.paymentAttempts,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.id,class:"mt-1 md:mt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",n,[e.createVNode(e.unref(t._sfc_main$2),{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Payment attempt",description:"Title for the payment attempt block",id:"sdk.invoice_details.payment_history.payment_attempt"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$3),{color:s[a.result]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatEnum)(a.result)),1)]),_:2},1032,["color"])]),a.payment_method_details?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"payment-method":a.payment_method_details},{description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({date:a.created_at,format:"dateTime",offsetType:"offsetted",timezone:o.customer.timezone})),1)]),_:2},1032,["payment-method"])):e.createCommentVNode("",!0)]),_:2},1024))),128))])]))}});exports._sfc_main=o;
@@ -0,0 +1,90 @@
1
+ import { defineComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, createBlock, createCommentVNode } from "vue";
2
+ import { b as useIntl, _ as _sfc_main$2, d as _sfc_main$1g, e as _sfc_main$3, f as formatEnum, g as _sfc_main$1 } from "./component-BkmcE85U.mjs";
3
+ const _hoisted_1 = { class: "flex flex-col-reverse gap-1" };
4
+ const _hoisted_2 = { class: "flex justify-between items-center mb-2" };
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "PaymentHistoryBlock",
7
+ props: {
8
+ paymentAttempts: { type: Array },
9
+ customer: { type: Object }
10
+ },
11
+ setup(__props) {
12
+ const { $t, formatDate } = useIntl();
13
+ const colorMapping = {
14
+ AUTHORIZED: "green",
15
+ CANCELLED: "red",
16
+ ERROR: "red",
17
+ PENDING: "orange",
18
+ PENDING_REFUND: "orange",
19
+ REFUNDED: "orange",
20
+ CHARGED_BACK: "orange",
21
+ REFUSED: "red"
22
+ };
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createElementBlock("div", null, [
25
+ createVNode(unref(_sfc_main$2), {
26
+ tag: "h2",
27
+ variant: "heading-3"
28
+ }, {
29
+ default: withCtx(() => [
30
+ createTextVNode(toDisplayString(unref($t)({
31
+ defaultMessage: "Payment history",
32
+ description: "Title for the payment history block on the invoice details page",
33
+ id: "sdk.invoice_details.payment_history.title"
34
+ })), 1)
35
+ ]),
36
+ _: 1
37
+ }),
38
+ createElementVNode("div", _hoisted_1, [
39
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.paymentAttempts, (paymentAttempt) => {
40
+ return openBlock(), createBlock(unref(_sfc_main$1g), {
41
+ key: paymentAttempt.id,
42
+ class: "mt-1 md:mt-2"
43
+ }, {
44
+ default: withCtx(() => [
45
+ createElementVNode("div", _hoisted_2, [
46
+ createVNode(unref(_sfc_main$2), { variant: "caps-heading" }, {
47
+ default: withCtx(() => [
48
+ createTextVNode(toDisplayString(unref($t)({
49
+ defaultMessage: "Payment attempt",
50
+ description: "Title for the payment attempt block",
51
+ id: "sdk.invoice_details.payment_history.payment_attempt"
52
+ })), 1)
53
+ ]),
54
+ _: 1
55
+ }),
56
+ createVNode(unref(_sfc_main$3), {
57
+ color: colorMapping[paymentAttempt.result]
58
+ }, {
59
+ default: withCtx(() => [
60
+ createTextVNode(toDisplayString(unref(formatEnum)(paymentAttempt.result)), 1)
61
+ ]),
62
+ _: 2
63
+ }, 1032, ["color"])
64
+ ]),
65
+ paymentAttempt.payment_method_details ? (openBlock(), createBlock(unref(_sfc_main$1), {
66
+ key: 0,
67
+ "payment-method": paymentAttempt.payment_method_details
68
+ }, {
69
+ description: withCtx(() => [
70
+ createTextVNode(toDisplayString(unref(formatDate)({
71
+ date: paymentAttempt.created_at,
72
+ format: "dateTime",
73
+ offsetType: "offsetted",
74
+ timezone: __props.customer.timezone
75
+ })), 1)
76
+ ]),
77
+ _: 2
78
+ }, 1032, ["payment-method"])) : createCommentVNode("", true)
79
+ ]),
80
+ _: 2
81
+ }, 1024);
82
+ }), 128))
83
+ ])
84
+ ]);
85
+ };
86
+ }
87
+ });
88
+ export {
89
+ _sfc_main as _
90
+ };