@feedmepos/mf-connect 0.1.18-prod → 0.1.20-prod
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.
- package/dist/{Analytic-D_zDhkUZ.js → Analytic-DaYL4IwZ.js} +10 -10
- package/dist/{App-Cg3jGOHs.js → App-CnRrmva6.js} +6 -6
- package/dist/{Bin-DDQbrukE.js → Bin-Bf8yL56G.js} +7 -7
- package/dist/{Broadcast-Cfgolg9v.js → Broadcast-CyqZZRc1.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-fcwwtaxY.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBAGO9mc.js} +6 -6
- package/dist/{Card-Bso_EfYT.js → Card-BHOw7yjA.js} +14 -14
- package/dist/{Collections-DhnNFiVB.js → Collections-DQYk52tc.js} +5 -5
- package/dist/{Credit-k3EIWJJ3.js → Credit-BVD4wCLN.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-c_0muFRC.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-EdpoxZlh.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B7codHAX.js → EffectSheet.vue_vue_type_style_index_0_lang-1tSUOxmX.js} +6 -6
- package/dist/{Experience-D_f18SMO.js → Experience-BKTJKeqW.js} +8 -8
- package/dist/{Game-DHuxNZcB.js → Game-DDnwUySW.js} +8 -8
- package/dist/{Index-eVtMlpFA.js → Index-Cf6d9PW1.js} +9 -9
- package/dist/{Marketing-CWjubvPu.js → Marketing-Dm2ECeZM.js} +5 -5
- package/dist/{Member-lHrV55rW.js → Member-Bjx7KU3k.js} +4 -4
- package/dist/{MemberList-B503F2VR.js → MemberList-BEiuLggu.js} +23 -23
- package/dist/{MemberTransactions-CKDoWW_j.js → MemberTransactions-C3YdUquh.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-6RaFXWbc.js → MessageInput.vue_vue_type_script_setup_true_lang-ChUeeW90.js} +2 -2
- package/dist/{Mission-DG3jWdQJ.js → Mission-CZ-jJd14.js} +8 -8
- package/dist/{Overview-CAP-QbHt.js → Overview-CgbAmJNJ.js} +16 -16
- package/dist/{Point-Bi4DG0ST.js → Point-Bt3nTcqr.js} +8 -8
- package/dist/{Promotion-DOr-8Fal.js → Promotion-DnMvO6sH.js} +9 -9
- package/dist/{Record-DbHyGWgG.js → Record-DGSd8OoA.js} +6 -6
- package/dist/{Reward-D8kJawxA.js → Reward-DjSvoVKB.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CBmfdyU3.js → RewardGroup.vue_vue_type_script_setup_true_lang-CD5NQYu7.js} +10 -10
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DEtbXGSn.js → RuleGroup.vue_vue_type_script_setup_true_lang-DL9sCsHT.js} +12 -12
- package/dist/{Segment-BYQJE7lX.js → Segment-CwyALcvm.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-XdIrcS9h.js → SelectItems.vue_vue_type_script_setup_true_lang-BpM7WgFp.js} +2 -2
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Dr2TtNPP.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bwa2RvTx.js} +3 -3
- package/dist/{Setting-CNlYQQG7.js → Setting-CCxSOD98.js} +8 -8
- package/dist/{Store-CsMXWbPn.js → Store-BTejxCBe.js} +731 -643
- package/dist/{StoreRewards-CvDtU4nt.js → StoreRewards-DrUIjbjC.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B5-J_psL.js → StoreTransactions.vue_vue_type_script_setup_true_lang-B-z5tu9A.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DnZQX8U_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CpIVuHaf.js} +1 -1
- package/dist/{Tier-BEtmw9tB.js → Tier-njMn6MiO.js} +18 -18
- package/dist/{Title-CQjCTRFS.js → Title-Db8js_gS.js} +18 -18
- package/dist/{Transaction-Dclb9Ac7.js → Transaction-D9TjDeKD.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dxdt36PT.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bod8YjzJ.js} +6 -6
- package/dist/{Voucher-BESvjc4p.js → Voucher--yr4TQ-G.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BHONAjDW.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CeL94a07.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BUGDCcYs.js → ZodTextField.vue_vue_type_script_setup_true_lang-BCc_w9J8.js} +1 -1
- package/dist/{app-Q1yckvqp.js → app-BqAFUCz8.js} +522 -514
- package/dist/{app-DpZb_uFJ.js → app-Ugrk96Pp.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CheZkwPX.js → business-CTwB-cPM.js} +1 -1
- package/dist/{campaign-CsicTS13.js → campaign-CKZMkxH5.js} +2 -2
- package/dist/{campaign-CZarn1Pn.js → campaign-DwL2D9J5.js} +9 -9
- package/dist/{campaign.enum-CGYRYexg.js → campaign.enum-uKI06HHx.js} +1 -1
- package/dist/{campaign.fn-XAWhr6-a.js → campaign.fn-Dp8mlrpN.js} +33 -33
- package/dist/{collectible.enum-tEM_nK3f.js → collectible.enum-Bw421zWp.js} +1 -1
- package/dist/{collection.fn-Dy7-oO7_.js → collection.fn-D2zmqc53.js} +2 -2
- package/dist/{dto-Cgll17wb.js → dto-FP61IJwc.js} +4 -4
- package/dist/{effect-CRtxySC5.js → effect-BE4EnD4B.js} +1 -1
- package/dist/{email-addresses-DNAdOP56.js → email-addresses-D8_sMdak.js} +1 -1
- package/dist/{export-BzglwM__.js → export-kgzxrVkq.js} +3 -3
- package/dist/{helper-kOMs19DV.js → helper-BI6pWRqN.js} +1 -1
- package/dist/{index-Diydk2cV.js → index-BUXc2Nw5.js} +1 -1
- package/dist/{index-Dal27QBg.js → index-BpBt6Y8F.js} +1 -1
- package/dist/{index-ClGbT7Ie.js → index-COe4sMRZ.js} +1 -1
- package/dist/{index-BFsyDjHp.js → index-CaJmkfzc.js} +3 -3
- package/dist/{index-RHYYXURv.js → index-Cga6gx-T.js} +1 -1
- package/dist/{index-ymsvC9M9.js → index-DLIjZTu7.js} +2 -2
- package/dist/{index-3VnMKTMI.js → index-DTbigOhK.js} +1 -1
- package/dist/{index-WJz81etb.js → index-DcBjYW9W.js} +1 -1
- package/dist/{index-CUSwI0lR.js → index-DoHEyLZn.js} +3 -3
- package/dist/{index-CL2S0cI6.js → index-aOnN-LXC.js} +1 -1
- package/dist/{index-C2l3Ifc0.js → index-fCUvdTQu.js} +6 -6
- package/dist/{index-DkXEiQWq.js → index-sLN88aCQ.js} +4 -4
- package/dist/{index.esm2017-BL3TvIjS.js → index.esm2017-CWKGaTMR.js} +1 -1
- package/dist/{loading-eMx0_Xs5.js → loading-GiUoU2Fa.js} +4 -4
- package/dist/{membership-BPY-gM3q.js → membership-Bt_7SvV0.js} +3 -3
- package/dist/{money-DfHzDPGF.js → money-BZq33xlW.js} +1 -1
- package/dist/{number-Ds8wlc5h.js → number-DFHYy76W.js} +1 -1
- package/dist/{objectid-Bk2VYf03.js → objectid-C6apWPpH.js} +4 -4
- package/dist/{reward-Cs71ZByd.js → reward-Dy_FLF01.js} +1 -1
- package/dist/{rule-builder-Dbz-Ea9H.js → rule-builder-BpZ5uHIv.js} +1 -1
- package/dist/{rule-Jngq91oM.js → rule-zl6tGcQA.js} +3 -3
- package/dist/{template-Bko9yw_T.js → template-BKEUsA_B.js} +4 -4
- package/dist/{trigger-CKKxPJPD.js → trigger-ChT3kWh_.js} +4 -4
- package/dist/{usePagination-CEZVEXNR.js → usePagination-DWyHwAZT.js} +1 -1
- package/dist/{user-B5C_dlbm.js → user-CX5C_btL.js} +1 -1
- package/dist/{vue-i18n-D6cJsUHs.js → vue-i18n--AFmNvm8.js} +232 -232
- package/package.json +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { defineComponent as ee, computed as j, resolveComponent as h, openBlock as g, createBlock as I, withCtx as T, createElementVNode as x, createElementBlock as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { c as
|
|
5
|
-
import { d as se, a as Je, p as
|
|
6
|
-
import { u as
|
|
7
|
-
import { a as Xe, c as
|
|
1
|
+
import { defineComponent as ee, computed as j, resolveComponent as h, openBlock as g, createBlock as I, withCtx as T, createElementVNode as x, createElementBlock as B, createVNode as i, createCommentVNode as M, toDisplayString as L, unref as e, Fragment as X, renderList as re, ref as R, isRef as oe, reactive as Ke, onMounted as fe, watch as we, toRaw as He, createTextVNode as de, h as qe } from "vue";
|
|
2
|
+
import { _ as Ye } from "./tier-BJDhpH6X.js";
|
|
3
|
+
import { useDialog as Me, useDialogChild as Oe, components as We } from "@feedmepos/ui-library";
|
|
4
|
+
import { c as N, e as he, S as ze } from "./index-CaJmkfzc.js";
|
|
5
|
+
import { d as se, a as Je, p as xe, u as Ee, n as Ge, f as Fe } from "./loading-GiUoU2Fa.js";
|
|
6
|
+
import { u as ke, C as me } from "./membership-Bt_7SvV0.js";
|
|
7
|
+
import { a as Xe, c as De } from "./object-qECH92oz.js";
|
|
8
8
|
import { _ as ue } from "./lodash-B5I3zXaY.js";
|
|
9
|
-
import { u as be } from "./vue-i18n
|
|
9
|
+
import { u as be } from "./vue-i18n--AFmNvm8.js";
|
|
10
10
|
import { Z, g as J, a as G } from "./zod-Bg2FbC-D.js";
|
|
11
|
-
import { z as Q, R as Ze } from "./app-
|
|
12
|
-
import { k as Qe, l as et, m as tt, n as
|
|
13
|
-
import { u as
|
|
14
|
-
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { J as
|
|
16
|
-
import { _ as
|
|
17
|
-
import { _ as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { z as st, a as rt } from "./money-
|
|
20
|
-
import { F as it } from "./number-
|
|
21
|
-
import { t as dt } from "./helper-
|
|
22
|
-
import "./index-
|
|
23
|
-
import "./index-
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./index-
|
|
26
|
-
import { m as ut } from "./index-
|
|
27
|
-
import { m as
|
|
11
|
+
import { z as Q, R as Ze } from "./app-BqAFUCz8.js";
|
|
12
|
+
import { k as Qe, l as et, m as tt, n as Ae, o as nt } from "./index-sLN88aCQ.js";
|
|
13
|
+
import { u as Se } from "./app-wDQR6dpb.js";
|
|
14
|
+
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BCc_w9J8.js";
|
|
15
|
+
import { J as Pe } from "./JsonViewer-v8_C7l5N.js";
|
|
16
|
+
import { _ as ot } from "./index-DLIjZTu7.js";
|
|
17
|
+
import { _ as at } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
18
|
+
import { _ as lt } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
19
|
+
import { z as st, a as rt } from "./money-BZq33xlW.js";
|
|
20
|
+
import { F as it } from "./number-DFHYy76W.js";
|
|
21
|
+
import { t as dt } from "./helper-BI6pWRqN.js";
|
|
22
|
+
import "./index-DTbigOhK.js";
|
|
23
|
+
import "./index-fCUvdTQu.js";
|
|
24
|
+
import "./index-COe4sMRZ.js";
|
|
25
|
+
import "./index-DoHEyLZn.js";
|
|
26
|
+
import { m as ut } from "./index-BpBt6Y8F.js";
|
|
27
|
+
import { m as Ce } from "./index-aOnN-LXC.js";
|
|
28
28
|
import { useRouter as ct } from "vue-router";
|
|
29
29
|
function je(v) {
|
|
30
30
|
return se.DineroFactory(v).toUnit();
|
|
31
31
|
}
|
|
32
|
-
function mt(v, _,
|
|
33
|
-
const
|
|
32
|
+
function mt(v, _, l, f, r = [], b = []) {
|
|
33
|
+
const o = ot.compact(
|
|
34
34
|
_.map((t) => v.find((c) => c.systemCode === t.systemCode && c.taxCode === t.taxCode)).filter((t) => !!t && b.includes(t.systemCode))
|
|
35
|
-
), m =
|
|
35
|
+
), m = o.reduce(
|
|
36
36
|
(t, c) => {
|
|
37
37
|
var y;
|
|
38
38
|
return Object.assign(t, {
|
|
39
39
|
[c.taxCode]: {
|
|
40
|
-
inclusive: ((y =
|
|
40
|
+
inclusive: ((y = r.find((d) => d.systemCode === c.systemCode)) == null ? void 0 : y.inclusive) || !1,
|
|
41
41
|
adjustment: {
|
|
42
42
|
level: 1,
|
|
43
43
|
type: {
|
|
@@ -62,7 +62,7 @@ function mt(v, _, a, f, i = [], b = []) {
|
|
|
62
62
|
level: 0,
|
|
63
63
|
type: {
|
|
64
64
|
type: "BY_AMOUNT",
|
|
65
|
-
amount: se.DineroFactory(
|
|
65
|
+
amount: se.DineroFactory(l).subtract(se.Dinero.fromNumber({ number: f }).toObject()).toObject()
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
},
|
|
@@ -72,7 +72,7 @@ function mt(v, _, a, f, i = [], b = []) {
|
|
|
72
72
|
adjustments: {},
|
|
73
73
|
roundToNearest: 0
|
|
74
74
|
});
|
|
75
|
-
return
|
|
75
|
+
return o.map((t) => ({
|
|
76
76
|
setting: t,
|
|
77
77
|
systemCode: t.systemCode,
|
|
78
78
|
name: t.name,
|
|
@@ -83,10 +83,10 @@ function mt(v, _, a, f, i = [], b = []) {
|
|
|
83
83
|
}).convertPrecision(2).toObject()
|
|
84
84
|
}));
|
|
85
85
|
}
|
|
86
|
-
function pt(v, _,
|
|
87
|
-
return v ? v.reduce((f,
|
|
86
|
+
function pt(v, _, l) {
|
|
87
|
+
return v ? v.reduce((f, r) => {
|
|
88
88
|
var b;
|
|
89
|
-
return (b =
|
|
89
|
+
return (b = l.find((o) => o.systemCode === r.systemCode)) != null && b.inclusive || (f = se.DineroFactory(f.toObject()).add(r.total)), f;
|
|
90
90
|
}, se.DineroFactory(_)).toObject() : se.DineroFactory(_).toObject();
|
|
91
91
|
}
|
|
92
92
|
const yt = { class: "relative h-[120px] aspect-video flex items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, ft = ["src"], bt = {
|
|
@@ -99,29 +99,29 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
99
99
|
},
|
|
100
100
|
emits: ["edit", "delete", "send"],
|
|
101
101
|
setup(v, { emit: _ }) {
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
`${
|
|
106
|
-
),
|
|
102
|
+
const l = v, f = _, r = j(() => {
|
|
103
|
+
const o = [];
|
|
104
|
+
return l.bundle.price.amount > 0 && o.push(
|
|
105
|
+
`${N.Config.getCountry().currency.symbol}${je(l.bundle.price)}`
|
|
106
|
+
), l.bundle.coinPrice && o.push(`${l.bundle.coinPrice} point(s)`), o.join(" or ");
|
|
107
107
|
}), b = j(() => {
|
|
108
108
|
var m, u;
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
const t =
|
|
112
|
-
|
|
109
|
+
const o = [];
|
|
110
|
+
if (l.bundle.titles.length > 0 && o.push(`${l.bundle.titles.length} title(s)`), l.bundle.vouchers.length > 0 && o.push(`${l.bundle.vouchers.length} voucher(s)`), l.bundle.credit.normal || (m = l.bundle.credit.free) != null && m.amount) {
|
|
111
|
+
const t = l.bundle.credit.normal + (((u = l.bundle.credit.free) == null ? void 0 : u.amount) ?? 0);
|
|
112
|
+
o.push(`${t} credit(s)`);
|
|
113
113
|
}
|
|
114
|
-
return
|
|
114
|
+
return o;
|
|
115
115
|
});
|
|
116
|
-
return (
|
|
117
|
-
const u = h("FmIcon"), t = h("FmChip"), c = h("FmButton"), y = h("FmMenuItem"), d = h("FmMenu"),
|
|
118
|
-
return g(), I(
|
|
116
|
+
return (o, m) => {
|
|
117
|
+
const u = h("FmIcon"), t = h("FmChip"), c = h("FmButton"), y = h("FmMenuItem"), d = h("FmMenu"), V = h("FmCard");
|
|
118
|
+
return g(), I(V, {
|
|
119
119
|
variant: "outlined",
|
|
120
120
|
class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full text-center items-center"
|
|
121
121
|
}, {
|
|
122
122
|
default: T(() => [
|
|
123
123
|
x("div", yt, [
|
|
124
|
-
v.bundle.image ? (g(),
|
|
124
|
+
v.bundle.image ? (g(), B("img", {
|
|
125
125
|
key: 1,
|
|
126
126
|
src: v.bundle.image,
|
|
127
127
|
class: "w-full h-full object-contain aspect-video"
|
|
@@ -132,35 +132,35 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
132
132
|
size: "md",
|
|
133
133
|
class: "text-fm-color-neutral-gray-200"
|
|
134
134
|
})),
|
|
135
|
-
v.bundle.isFeedvibe ? (g(),
|
|
136
|
-
|
|
135
|
+
v.bundle.isFeedvibe ? (g(), B("div", bt, [
|
|
136
|
+
i(t, {
|
|
137
137
|
label: "Feedvibe",
|
|
138
138
|
class: "text-fm-color-primary bg-fm-color-system-warning-100",
|
|
139
139
|
compact: ""
|
|
140
140
|
})
|
|
141
|
-
])) :
|
|
141
|
+
])) : M("", !0),
|
|
142
142
|
x("div", gt, [
|
|
143
|
-
|
|
143
|
+
i(d, { placement: "bottom-end" }, {
|
|
144
144
|
"menu-button": T(() => [
|
|
145
|
-
|
|
145
|
+
i(c, {
|
|
146
146
|
icon: "more_vert",
|
|
147
147
|
variant: "tertiary"
|
|
148
148
|
})
|
|
149
149
|
]),
|
|
150
150
|
default: T(() => [
|
|
151
|
-
|
|
152
|
-
onClick: m[0] || (m[0] = (
|
|
151
|
+
i(y, {
|
|
152
|
+
onClick: m[0] || (m[0] = (a) => f("edit", v.bundle)),
|
|
153
153
|
icon: "edit",
|
|
154
154
|
label: "Edit"
|
|
155
155
|
}),
|
|
156
|
-
v.bundle.stripePriceId ?
|
|
156
|
+
v.bundle.stripePriceId ? M("", !0) : (g(), I(y, {
|
|
157
157
|
key: 0,
|
|
158
|
-
onClick: m[1] || (m[1] = (
|
|
158
|
+
onClick: m[1] || (m[1] = (a) => f("send", v.bundle)),
|
|
159
159
|
icon: "send",
|
|
160
160
|
label: "Send"
|
|
161
161
|
})),
|
|
162
|
-
|
|
163
|
-
onClick: m[2] || (m[2] = (
|
|
162
|
+
i(y, {
|
|
163
|
+
onClick: m[2] || (m[2] = (a) => f("delete", v.bundle)),
|
|
164
164
|
icon: "delete"
|
|
165
165
|
}, {
|
|
166
166
|
label: T(() => [
|
|
@@ -174,11 +174,11 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
174
174
|
])
|
|
175
175
|
]),
|
|
176
176
|
x("div", ht, L(v.bundle.name), 1),
|
|
177
|
-
x("div", _t, L(e(
|
|
177
|
+
x("div", _t, L(e(r) || "Free"), 1),
|
|
178
178
|
x("div", xt, [
|
|
179
|
-
(g(!0),
|
|
180
|
-
key:
|
|
181
|
-
label:
|
|
179
|
+
(g(!0), B(X, null, re(e(b), (a, S) => (g(), I(t, {
|
|
180
|
+
key: S,
|
|
181
|
+
label: a
|
|
182
182
|
}, null, 8, ["label"]))), 128))
|
|
183
183
|
])
|
|
184
184
|
]),
|
|
@@ -186,21 +186,21 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
186
186
|
});
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
}),
|
|
189
|
+
}), St = /* @__PURE__ */ ee({
|
|
190
190
|
__name: "AddBundleCard",
|
|
191
191
|
emits: ["create"],
|
|
192
192
|
setup(v, { emit: _ }) {
|
|
193
|
-
const { t:
|
|
194
|
-
return (
|
|
195
|
-
const
|
|
193
|
+
const { t: l } = be(), f = _;
|
|
194
|
+
return (r, b) => {
|
|
195
|
+
const o = h("FmButton"), m = h("FmCard");
|
|
196
196
|
return g(), I(m, {
|
|
197
197
|
variant: "outlined",
|
|
198
198
|
class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
|
|
199
199
|
}, {
|
|
200
200
|
default: T(() => [
|
|
201
|
-
|
|
201
|
+
i(o, {
|
|
202
202
|
onClick: b[0] || (b[0] = (u) => f("create")),
|
|
203
|
-
label: e(
|
|
203
|
+
label: e(l)("connect.store.actions.addBundle"),
|
|
204
204
|
icon: "add",
|
|
205
205
|
variant: "secondary"
|
|
206
206
|
}, null, 8, ["label"])
|
|
@@ -209,7 +209,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
209
209
|
});
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
}),
|
|
212
|
+
}), Ft = { class: "space-y-16" }, Vt = { class: "flex w-full justify-between pb-16" }, wt = { class: "flex items-center justify-end gap-8" }, kt = /* @__PURE__ */ ee({
|
|
213
213
|
__name: "CategoryDialog",
|
|
214
214
|
props: {
|
|
215
215
|
action: {
|
|
@@ -222,40 +222,40 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
setup(v) {
|
|
225
|
-
const { t: _ } = be(),
|
|
225
|
+
const { t: _ } = be(), l = v, f = Me(), { emitData: r, emitAction: b } = Oe(), o = R(l.initialValue), m = Q.string().min(1);
|
|
226
226
|
function u() {
|
|
227
|
-
|
|
227
|
+
r(o.value), b("primary"), f.close();
|
|
228
228
|
}
|
|
229
229
|
function t() {
|
|
230
|
-
|
|
230
|
+
r(null), b("primary"), f.close();
|
|
231
231
|
}
|
|
232
232
|
return (c, y) => {
|
|
233
|
-
const d = h("FmTextField"),
|
|
234
|
-
return g(),
|
|
235
|
-
|
|
236
|
-
modelValue: e(
|
|
237
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
233
|
+
const d = h("FmTextField"), V = h("FmButton");
|
|
234
|
+
return g(), B("div", Ft, [
|
|
235
|
+
i(d, {
|
|
236
|
+
modelValue: e(o),
|
|
237
|
+
"onUpdate:modelValue": y[0] || (y[0] = (a) => oe(o) ? o.value = a : null),
|
|
238
238
|
label: e(_)("connect.store.category.label"),
|
|
239
239
|
rules: [e(Z).toRule(e(m))]
|
|
240
240
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
241
|
-
x("div",
|
|
241
|
+
x("div", Vt, [
|
|
242
242
|
x("div", null, [
|
|
243
|
-
v.action == "edit" ? (g(), I(
|
|
243
|
+
v.action == "edit" ? (g(), I(V, {
|
|
244
244
|
key: 0,
|
|
245
245
|
onClick: t,
|
|
246
246
|
label: e(_)("connect.common.delete"),
|
|
247
247
|
variant: "destructive"
|
|
248
|
-
}, null, 8, ["label"])) :
|
|
248
|
+
}, null, 8, ["label"])) : M("", !0)
|
|
249
249
|
]),
|
|
250
250
|
x("div", wt, [
|
|
251
|
-
|
|
251
|
+
i(V, {
|
|
252
252
|
label: e(_)("connect.common.cancel"),
|
|
253
253
|
variant: "tertiary",
|
|
254
|
-
onClick: y[1] || (y[1] = (
|
|
254
|
+
onClick: y[1] || (y[1] = (a) => e(f).close())
|
|
255
255
|
}, null, 8, ["label"]),
|
|
256
|
-
|
|
256
|
+
i(V, {
|
|
257
257
|
label: v.action == "edit" ? e(_)("connect.common.edit") : e(_)("connect.common.add"),
|
|
258
|
-
disabled: !e(
|
|
258
|
+
disabled: !e(o),
|
|
259
259
|
onClick: u
|
|
260
260
|
}, null, 8, ["label", "disabled"])
|
|
261
261
|
])
|
|
@@ -263,50 +263,50 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
263
263
|
]);
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
}),
|
|
266
|
+
}), Pt = { class: "space-y-16" }, $t = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1), Tt = { class: "flex items-center justify-end gap-8 pb-16" }, Ut = /* @__PURE__ */ ee({
|
|
267
267
|
__name: "SelectCategoryDialog",
|
|
268
268
|
setup(v) {
|
|
269
|
-
const { emitData: _, emitAction:
|
|
270
|
-
() => f.sortedStoreCategories.map((
|
|
271
|
-
label:
|
|
269
|
+
const { emitData: _, emitAction: l } = Oe(), f = ke(), r = R(), b = j(
|
|
270
|
+
() => f.sortedStoreCategories.map((o, m) => ({
|
|
271
|
+
label: o.name,
|
|
272
272
|
value: m
|
|
273
273
|
}))
|
|
274
274
|
);
|
|
275
|
-
return (
|
|
275
|
+
return (o, m) => {
|
|
276
276
|
const u = h("FmSelect"), t = h("FmButton");
|
|
277
|
-
return g(),
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
return g(), B("div", Pt, [
|
|
278
|
+
$t,
|
|
279
|
+
i(u, {
|
|
280
280
|
placeholder: "Select a category",
|
|
281
281
|
items: e(b),
|
|
282
|
-
modelValue: e(
|
|
282
|
+
modelValue: e(r),
|
|
283
283
|
"onUpdate:modelValue": [
|
|
284
|
-
m[0] || (m[0] = (c) =>
|
|
284
|
+
m[0] || (m[0] = (c) => oe(r) ? r.value = c : null),
|
|
285
285
|
m[1] || (m[1] = (c) => e(_)(c))
|
|
286
286
|
],
|
|
287
287
|
label: "Category"
|
|
288
288
|
}, null, 8, ["items", "modelValue"]),
|
|
289
289
|
x("div", Tt, [
|
|
290
|
-
|
|
290
|
+
i(t, {
|
|
291
291
|
variant: "tertiary",
|
|
292
292
|
label: "Cancel",
|
|
293
|
-
onClick: m[2] || (m[2] = (c) => e(
|
|
293
|
+
onClick: m[2] || (m[2] = (c) => e(l)("tertiary"))
|
|
294
294
|
}),
|
|
295
|
-
|
|
295
|
+
i(t, {
|
|
296
296
|
label: "Select",
|
|
297
|
-
onClick: m[3] || (m[3] = (c) => e(
|
|
298
|
-
disabled: e(
|
|
297
|
+
onClick: m[3] || (m[3] = (c) => e(l)("primary")),
|
|
298
|
+
disabled: e(r) == null
|
|
299
299
|
}, null, 8, ["disabled"])
|
|
300
300
|
])
|
|
301
301
|
]);
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
|
-
function
|
|
305
|
+
function _e(v) {
|
|
306
306
|
return v.states.map((_) => ({ label: _, value: _ }));
|
|
307
307
|
}
|
|
308
308
|
const Rt = {
|
|
309
|
-
[
|
|
309
|
+
[he.F_COUNTRY.enum.MY]: {
|
|
310
310
|
states: [
|
|
311
311
|
"Johor",
|
|
312
312
|
"Kedah",
|
|
@@ -326,16 +326,16 @@ const Rt = {
|
|
|
326
326
|
"Terengganu"
|
|
327
327
|
],
|
|
328
328
|
get stateItems() {
|
|
329
|
-
return
|
|
329
|
+
return _e(this);
|
|
330
330
|
}
|
|
331
331
|
},
|
|
332
|
-
[
|
|
332
|
+
[he.F_COUNTRY.enum.SG]: {
|
|
333
333
|
states: [],
|
|
334
334
|
get stateItems() {
|
|
335
|
-
return
|
|
335
|
+
return _e(this);
|
|
336
336
|
}
|
|
337
337
|
},
|
|
338
|
-
[
|
|
338
|
+
[he.F_COUNTRY.enum.ID]: {
|
|
339
339
|
states: [
|
|
340
340
|
"Aceh",
|
|
341
341
|
"Bali",
|
|
@@ -372,10 +372,94 @@ const Rt = {
|
|
|
372
372
|
"West Sumatra"
|
|
373
373
|
],
|
|
374
374
|
get stateItems() {
|
|
375
|
-
return
|
|
375
|
+
return _e(this);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
[he.F_COUNTRY.enum.TH]: {
|
|
379
|
+
states: [
|
|
380
|
+
"Bangkok",
|
|
381
|
+
"Amnat Charoen",
|
|
382
|
+
"Ang Thong",
|
|
383
|
+
"Bueng Kan",
|
|
384
|
+
"Buri Ram",
|
|
385
|
+
"Chachoengsao",
|
|
386
|
+
"Chai Nat",
|
|
387
|
+
"Chaiyaphum",
|
|
388
|
+
"Chanthaburi",
|
|
389
|
+
"Chiang Mai",
|
|
390
|
+
"Chiang Rai",
|
|
391
|
+
"Chonburi",
|
|
392
|
+
"Chumphon",
|
|
393
|
+
"Kalasin",
|
|
394
|
+
"Kamphaeng Phet",
|
|
395
|
+
"Kanchanaburi",
|
|
396
|
+
"Khon Kaen",
|
|
397
|
+
"Krabi",
|
|
398
|
+
"Lampang",
|
|
399
|
+
"Lamphun",
|
|
400
|
+
"Loei",
|
|
401
|
+
"Lopburi",
|
|
402
|
+
"Mae Hong Son",
|
|
403
|
+
"Maha Sarakham",
|
|
404
|
+
"Mukdahan",
|
|
405
|
+
"Nakhon Nayok",
|
|
406
|
+
"Nakhon Pathom",
|
|
407
|
+
"Nakhon Phanom",
|
|
408
|
+
"Nakhon Ratchasima",
|
|
409
|
+
"Nakhon Sawan",
|
|
410
|
+
"Nakhon Si Thammarat",
|
|
411
|
+
"Nan",
|
|
412
|
+
"Narathiwat",
|
|
413
|
+
"Nong Bua Lamphu",
|
|
414
|
+
"Nong Khai",
|
|
415
|
+
"Nonthaburi",
|
|
416
|
+
"Pathum Thani",
|
|
417
|
+
"Pattani",
|
|
418
|
+
"Phang Nga",
|
|
419
|
+
"Phatthalung",
|
|
420
|
+
"Phayao",
|
|
421
|
+
"Phetchabun",
|
|
422
|
+
"Phetchaburi",
|
|
423
|
+
"Phichit",
|
|
424
|
+
"Phitsanulok",
|
|
425
|
+
"Phra Nakhon Si Ayutthaya",
|
|
426
|
+
"Phrae",
|
|
427
|
+
"Phuket",
|
|
428
|
+
"Prachinburi",
|
|
429
|
+
"Prachuap Khiri Khan",
|
|
430
|
+
"Ranong",
|
|
431
|
+
"Ratchaburi",
|
|
432
|
+
"Rayong",
|
|
433
|
+
"Roi Et",
|
|
434
|
+
"Sa Kaeo",
|
|
435
|
+
"Sakon Nakhon",
|
|
436
|
+
"Samut Prakan",
|
|
437
|
+
"Samut Sakhon",
|
|
438
|
+
"Samut Songkhram",
|
|
439
|
+
"Saraburi",
|
|
440
|
+
"Satun",
|
|
441
|
+
"Sing Buri",
|
|
442
|
+
"Sisaket",
|
|
443
|
+
"Songkhla",
|
|
444
|
+
"Sukhothai",
|
|
445
|
+
"Suphan Buri",
|
|
446
|
+
"Surat Thani",
|
|
447
|
+
"Surin",
|
|
448
|
+
"Tak",
|
|
449
|
+
"Trang",
|
|
450
|
+
"Trat",
|
|
451
|
+
"Ubon Ratchathani",
|
|
452
|
+
"Udon Thani",
|
|
453
|
+
"Uthai Thani",
|
|
454
|
+
"Uttaradit",
|
|
455
|
+
"Yala",
|
|
456
|
+
"Yasothon"
|
|
457
|
+
],
|
|
458
|
+
get stateItems() {
|
|
459
|
+
return _e(this);
|
|
376
460
|
}
|
|
377
461
|
}
|
|
378
|
-
}, pe = () =>
|
|
462
|
+
}, pe = () => N.Config.getCountry(), ye = {
|
|
379
463
|
get fullCurrency() {
|
|
380
464
|
return pe().currency;
|
|
381
465
|
},
|
|
@@ -383,7 +467,7 @@ const Rt = {
|
|
|
383
467
|
return pe().currency.code;
|
|
384
468
|
},
|
|
385
469
|
get fullTax() {
|
|
386
|
-
return
|
|
470
|
+
return N.Country.getCountryFlattenTaxes(pe().code);
|
|
387
471
|
},
|
|
388
472
|
get taxSystem() {
|
|
389
473
|
return pe().taxSystems;
|
|
@@ -395,20 +479,20 @@ const Rt = {
|
|
|
395
479
|
}));
|
|
396
480
|
},
|
|
397
481
|
groupedTaxOptions() {
|
|
398
|
-
const v =
|
|
482
|
+
const v = N.Country.getCountryFlattenTaxes(pe().code);
|
|
399
483
|
return ye.taxSystem.map((_) => ({
|
|
400
484
|
code: _.code,
|
|
401
|
-
options: v.map((
|
|
485
|
+
options: v.map((l) => ({ ...l, feedmeTaxCode: ye.generateCode(l) })).filter((l) => l.systemCode === _.code)
|
|
402
486
|
}));
|
|
403
487
|
},
|
|
404
488
|
systemDefaultCode(v) {
|
|
405
|
-
const _ = ye.groupedTaxOptions().find((
|
|
406
|
-
return _ == null ? void 0 : _.options.find((
|
|
489
|
+
const _ = ye.groupedTaxOptions().find((l) => l.code === v);
|
|
490
|
+
return _ == null ? void 0 : _.options.find((l) => l.default);
|
|
407
491
|
},
|
|
408
492
|
generateCode(v) {
|
|
409
493
|
return `${v.systemCode}/${v.taxCode}`;
|
|
410
494
|
}
|
|
411
|
-
},
|
|
495
|
+
}, ne = ye, It = /* @__PURE__ */ ee({
|
|
412
496
|
__name: "TaxInclusiveSetting",
|
|
413
497
|
props: {
|
|
414
498
|
modelValue: {
|
|
@@ -419,53 +503,53 @@ const Rt = {
|
|
|
419
503
|
},
|
|
420
504
|
emits: ["update:model-value"],
|
|
421
505
|
setup(v, { emit: _ }) {
|
|
422
|
-
const
|
|
423
|
-
function
|
|
424
|
-
const d = ue.clone(
|
|
425
|
-
|
|
506
|
+
const l = v, f = ne.taxSystem, r = _, b = R(l.modelValue);
|
|
507
|
+
function o(c, y) {
|
|
508
|
+
const d = ue.clone(l.modelValue), V = d.findIndex((a) => a.systemCode === c);
|
|
509
|
+
V >= 0 ? d[V].inclusive = y : d.push({
|
|
426
510
|
systemCode: c,
|
|
427
511
|
inclusive: y
|
|
428
|
-
}), b.value = d,
|
|
512
|
+
}), b.value = d, r("update:model-value", d);
|
|
429
513
|
}
|
|
430
514
|
function m() {
|
|
431
515
|
return f.map((c) => {
|
|
432
|
-
const y =
|
|
516
|
+
const y = l.modelValue ? l.modelValue.find((d) => d.systemCode === c.code) : !1;
|
|
433
517
|
return {
|
|
434
518
|
label: c.name,
|
|
435
519
|
config: {
|
|
436
520
|
value: y ? y.inclusive : !1
|
|
437
521
|
},
|
|
438
522
|
input: (d) => {
|
|
439
|
-
|
|
523
|
+
o(c.code, d);
|
|
440
524
|
}
|
|
441
525
|
};
|
|
442
526
|
});
|
|
443
527
|
}
|
|
444
|
-
const u =
|
|
528
|
+
const u = Ke(m());
|
|
445
529
|
function t(c, y) {
|
|
446
530
|
return `${c} ${y ? "Inclusive" : "Exclusive"}`;
|
|
447
531
|
}
|
|
448
532
|
return fe(() => {
|
|
449
|
-
|
|
533
|
+
l.modelValue.length || o(f[0].code, !1);
|
|
450
534
|
}), we(
|
|
451
|
-
() =>
|
|
535
|
+
() => l.modelValue,
|
|
452
536
|
(c, y) => {
|
|
453
|
-
c != y && !c.length &&
|
|
537
|
+
c != y && !c.length && o(f[0].code, !1);
|
|
454
538
|
}
|
|
455
539
|
), (c, y) => {
|
|
456
540
|
const d = h("FmSwitch");
|
|
457
|
-
return g(!0),
|
|
458
|
-
var
|
|
459
|
-
return g(),
|
|
460
|
-
|
|
461
|
-
"model-value": ((
|
|
541
|
+
return g(!0), B(X, null, re(e(u), (V, a) => {
|
|
542
|
+
var S;
|
|
543
|
+
return g(), B("div", { key: a }, [
|
|
544
|
+
i(d, {
|
|
545
|
+
"model-value": ((S = e(b)[a]) == null ? void 0 : S.inclusive) || !1,
|
|
462
546
|
"label-placement": "left",
|
|
463
|
-
"onUpdate:modelValue": (w) =>
|
|
547
|
+
"onUpdate:modelValue": (w) => V.input(w)
|
|
464
548
|
}, {
|
|
465
549
|
label: T(() => {
|
|
466
550
|
var w;
|
|
467
551
|
return [
|
|
468
|
-
x("div", null, L(t(
|
|
552
|
+
x("div", null, L(t(V.label, ((w = e(b)[a]) == null ? void 0 : w.inclusive) || !1)), 1)
|
|
469
553
|
];
|
|
470
554
|
}),
|
|
471
555
|
_: 2
|
|
@@ -475,54 +559,54 @@ const Rt = {
|
|
|
475
559
|
};
|
|
476
560
|
}
|
|
477
561
|
});
|
|
478
|
-
var
|
|
479
|
-
const
|
|
562
|
+
var Bt = { mode: "production", appMode: "mf" };
|
|
563
|
+
const Nt = { class: "space-y-8" }, Dt = {
|
|
480
564
|
key: 0,
|
|
481
565
|
class: "space-y-16"
|
|
482
|
-
},
|
|
566
|
+
}, At = /* @__PURE__ */ ee({
|
|
483
567
|
__name: "StripeSetting",
|
|
484
568
|
props: {
|
|
485
569
|
modelValue: {}
|
|
486
570
|
},
|
|
487
571
|
emits: ["update:modelValue"],
|
|
488
572
|
setup(v, { emit: _ }) {
|
|
489
|
-
const
|
|
490
|
-
we(
|
|
491
|
-
m !=
|
|
573
|
+
const l = v, f = _, r = R(!1);
|
|
574
|
+
we(r, (o, m) => {
|
|
575
|
+
m != o && (!l.modelValue && o ? f("update:modelValue", {
|
|
492
576
|
apiKey: "",
|
|
493
577
|
webhookSecret: ""
|
|
494
|
-
}) :
|
|
578
|
+
}) : o || f("update:modelValue", void 0));
|
|
495
579
|
});
|
|
496
580
|
const b = j(() => {
|
|
497
|
-
const
|
|
498
|
-
return `https://marketing${
|
|
581
|
+
const o = Bt.mode === "development", m = N.Config.getCountry().code.toLowerCase(), u = m != "my" ? `.${m}` : "";
|
|
582
|
+
return `https://marketing${o ? "-dev" : ""}${u}.feedmeapi.com/stripe/${ze.getBusinessId()}/webhook`;
|
|
499
583
|
});
|
|
500
584
|
return fe(() => {
|
|
501
|
-
|
|
502
|
-
}), (
|
|
585
|
+
r.value = !!l.modelValue;
|
|
586
|
+
}), (o, m) => {
|
|
503
587
|
const u = h("FmSwitch"), t = h("FmTextField"), c = h("FmButton");
|
|
504
|
-
return g(),
|
|
505
|
-
|
|
506
|
-
modelValue: e(
|
|
507
|
-
"onUpdate:modelValue": m[0] || (m[0] = (y) =>
|
|
588
|
+
return g(), B("div", Nt, [
|
|
589
|
+
i(u, {
|
|
590
|
+
modelValue: e(r),
|
|
591
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => oe(r) ? r.value = y : null),
|
|
508
592
|
value: "true",
|
|
509
593
|
label: "Enable Stripe"
|
|
510
594
|
}, null, 8, ["modelValue"]),
|
|
511
|
-
|
|
512
|
-
|
|
595
|
+
l.modelValue ? (g(), B("div", Dt, [
|
|
596
|
+
i(t, {
|
|
513
597
|
label: "API Key",
|
|
514
|
-
modelValue:
|
|
515
|
-
"onUpdate:modelValue": m[1] || (m[1] = (y) =>
|
|
598
|
+
modelValue: l.modelValue.apiKey,
|
|
599
|
+
"onUpdate:modelValue": m[1] || (m[1] = (y) => l.modelValue.apiKey = y),
|
|
516
600
|
"helper-text": "Go to Stripe Dashboard get your API Key and paste here."
|
|
517
601
|
}, null, 8, ["modelValue"]),
|
|
518
|
-
|
|
602
|
+
i(t, {
|
|
519
603
|
label: "Webhook URL",
|
|
520
604
|
"model-value": e(b),
|
|
521
605
|
readonly: "",
|
|
522
606
|
"helper-text": "Copy this URL to your Stripe dashboard"
|
|
523
607
|
}, {
|
|
524
608
|
append: T(() => [
|
|
525
|
-
|
|
609
|
+
i(c, {
|
|
526
610
|
icon: "content_copy",
|
|
527
611
|
variant: "tertiary",
|
|
528
612
|
onClick: m[2] || (m[2] = (y) => e(Je)(e(b)))
|
|
@@ -530,28 +614,28 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
530
614
|
]),
|
|
531
615
|
_: 1
|
|
532
616
|
}, 8, ["model-value"]),
|
|
533
|
-
|
|
534
|
-
modelValue:
|
|
535
|
-
"onUpdate:modelValue": m[3] || (m[3] = (y) =>
|
|
617
|
+
i(t, {
|
|
618
|
+
modelValue: l.modelValue.webhookSecret,
|
|
619
|
+
"onUpdate:modelValue": m[3] || (m[3] = (y) => l.modelValue.webhookSecret = y),
|
|
536
620
|
label: "Webhook Secret",
|
|
537
621
|
"helper-text": `Copy the webhook signing secret from your Stripe account and paste
|
|
538
622
|
here.`
|
|
539
623
|
}, null, 8, ["modelValue"])
|
|
540
|
-
])) :
|
|
624
|
+
])) : M("", !0)
|
|
541
625
|
]);
|
|
542
626
|
};
|
|
543
627
|
}
|
|
544
|
-
}),
|
|
628
|
+
}), Mt = {
|
|
545
629
|
key: 0,
|
|
546
630
|
class: "space-y-16 pr-12"
|
|
547
|
-
},
|
|
631
|
+
}, Ot = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Et = {
|
|
548
632
|
key: 1,
|
|
549
633
|
class: "space-y-16"
|
|
550
|
-
}, jt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Lt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" },
|
|
634
|
+
}, jt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Lt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Kt = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, Ht = { class: "space-y-4" }, qt = { class: "fm-typo-en-body-lg-400" }, Yt = { class: "space-y-16" }, Wt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, zt = { class: "flex items-center gap-8" }, Jt = /* @__PURE__ */ ee({
|
|
551
635
|
__name: "StoreSettingSheet",
|
|
552
636
|
emits: ["update"],
|
|
553
|
-
setup(v, { expose: _, emit:
|
|
554
|
-
const { t: f } = be(),
|
|
637
|
+
setup(v, { expose: _, emit: l }) {
|
|
638
|
+
const { t: f } = be(), r = l, b = R(!1), o = R(), m = R(!1), u = Qe.extend({
|
|
555
639
|
company: et.extend({
|
|
556
640
|
name: Q.string().min(1, "Company name is required"),
|
|
557
641
|
regNo: Q.string().min(1, "Registration number is required"),
|
|
@@ -566,10 +650,10 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
566
650
|
phoneNo: Q.string().min(1, "Phone number is required"),
|
|
567
651
|
sstRegNo: Q.string().optional()
|
|
568
652
|
})
|
|
569
|
-
}), t = j(() => u.safeParse(
|
|
653
|
+
}), t = j(() => u.safeParse(o.value).success);
|
|
570
654
|
function c() {
|
|
571
|
-
const
|
|
572
|
-
|
|
655
|
+
const V = u.safeParse(o.value);
|
|
656
|
+
V.success && r("update", V.data);
|
|
573
657
|
}
|
|
574
658
|
function y() {
|
|
575
659
|
return {
|
|
@@ -581,7 +665,7 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
581
665
|
city: "",
|
|
582
666
|
postcode: "",
|
|
583
667
|
state: "",
|
|
584
|
-
country:
|
|
668
|
+
country: N.Config.getCountry().name
|
|
585
669
|
},
|
|
586
670
|
phoneNo: "",
|
|
587
671
|
regNo: "",
|
|
@@ -590,117 +674,117 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
590
674
|
inclusiveTaxes: []
|
|
591
675
|
};
|
|
592
676
|
}
|
|
593
|
-
function d(
|
|
594
|
-
b.value =
|
|
677
|
+
function d(V, a) {
|
|
678
|
+
b.value = V, V && (o.value = a != null && a.company ? a : y());
|
|
595
679
|
}
|
|
596
680
|
return _({
|
|
597
681
|
showSheet: d,
|
|
598
|
-
data:
|
|
599
|
-
}), (
|
|
600
|
-
const
|
|
601
|
-
return g(), I(
|
|
682
|
+
data: o
|
|
683
|
+
}), (V, a) => {
|
|
684
|
+
const S = h("FmIcon"), w = h("FmMenuItem"), D = h("FmMenu"), Y = h("FmSelect"), z = h("FmButton"), K = h("FmSideSheet");
|
|
685
|
+
return g(), I(K, {
|
|
602
686
|
"max-width": 560,
|
|
603
687
|
modelValue: e(b),
|
|
604
|
-
"onUpdate:modelValue":
|
|
688
|
+
"onUpdate:modelValue": a[15] || (a[15] = (W) => oe(b) ? b.value = W : null),
|
|
605
689
|
header: e(f)("connect.store.setting.title")
|
|
606
690
|
}, {
|
|
607
691
|
"side-sheet-footer": T(() => [
|
|
608
|
-
x("div",
|
|
609
|
-
|
|
692
|
+
x("div", zt, [
|
|
693
|
+
i(z, {
|
|
610
694
|
label: e(f)("connect.common.save"),
|
|
611
695
|
onClick: c,
|
|
612
|
-
disabled: !e(t) || e(
|
|
613
|
-
loading: e(
|
|
696
|
+
disabled: !e(t) || e(Se)().isLoading,
|
|
697
|
+
loading: e(Se)().isLoading
|
|
614
698
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
615
|
-
|
|
699
|
+
i(z, {
|
|
616
700
|
label: e(f)("connect.common.cancel"),
|
|
617
|
-
onClick:
|
|
701
|
+
onClick: a[14] || (a[14] = (W) => d(!1)),
|
|
618
702
|
variant: "tertiary"
|
|
619
703
|
}, null, 8, ["label"])
|
|
620
704
|
])
|
|
621
705
|
]),
|
|
622
706
|
default: T(() => {
|
|
623
|
-
var
|
|
707
|
+
var W, ae;
|
|
624
708
|
return [
|
|
625
|
-
|
|
626
|
-
e(
|
|
627
|
-
x("div",
|
|
628
|
-
|
|
629
|
-
modelValue: e(
|
|
630
|
-
"onUpdate:modelValue":
|
|
709
|
+
i(Pe, { json: e(o) }, null, 8, ["json"]),
|
|
710
|
+
e(o) && e(o).company ? (g(), B("div", Mt, [
|
|
711
|
+
x("div", Ot, L(e(f)("connect.store.setting.company.legal_info")), 1),
|
|
712
|
+
i(te, {
|
|
713
|
+
modelValue: e(o).company.name,
|
|
714
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => e(o).company.name = s),
|
|
631
715
|
label: e(f)("connect.store.setting.company.name"),
|
|
632
716
|
schema: e(Z).typeAtPath(e(u), "company.name")
|
|
633
717
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
634
|
-
|
|
635
|
-
modelValue: e(
|
|
636
|
-
"onUpdate:modelValue":
|
|
718
|
+
i(te, {
|
|
719
|
+
modelValue: e(o).company.regNo,
|
|
720
|
+
"onUpdate:modelValue": a[1] || (a[1] = (s) => e(o).company.regNo = s),
|
|
637
721
|
label: e(f)("connect.store.setting.company.reg_no"),
|
|
638
722
|
schema: e(Z).typeAtPath(e(u), "company.regNo")
|
|
639
723
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
640
|
-
e(
|
|
724
|
+
e(N.Config).getCountry().taxSystems.length ? (g(), I(te, {
|
|
641
725
|
key: 0,
|
|
642
|
-
modelValue: e(
|
|
726
|
+
modelValue: e(o).company.sstRegNo,
|
|
643
727
|
"onUpdate:modelValue": [
|
|
644
|
-
|
|
645
|
-
|
|
728
|
+
a[2] || (a[2] = (s) => e(o).company.sstRegNo = s),
|
|
729
|
+
a[3] || (a[3] = (s) => s ? null : e(o).inclusiveTaxes = [])
|
|
646
730
|
],
|
|
647
731
|
label: e(f)("connect.store.setting.company.tax_reg_no"),
|
|
648
732
|
schema: e(Z).typeAtPath(e(u), "company.sstRegNo")
|
|
649
|
-
}, null, 8, ["modelValue", "label", "schema"])) :
|
|
650
|
-
(
|
|
733
|
+
}, null, 8, ["modelValue", "label", "schema"])) : M("", !0),
|
|
734
|
+
(W = e(o).company) != null && W.sstRegNo && e(o).inclusiveTaxes ? (g(), B("div", Et, [
|
|
651
735
|
x("div", jt, L(e(f)("connect.store.setting.company.tax")), 1),
|
|
652
|
-
|
|
653
|
-
modelValue: e(
|
|
654
|
-
"onUpdate:modelValue":
|
|
736
|
+
i(It, {
|
|
737
|
+
modelValue: e(o).inclusiveTaxes,
|
|
738
|
+
"onUpdate:modelValue": a[4] || (a[4] = (s) => e(o).inclusiveTaxes = s)
|
|
655
739
|
}, null, 8, ["modelValue"])
|
|
656
|
-
])) :
|
|
657
|
-
|
|
658
|
-
modelValue: e(
|
|
659
|
-
"onUpdate:modelValue":
|
|
740
|
+
])) : M("", !0),
|
|
741
|
+
i(te, {
|
|
742
|
+
modelValue: e(o).company.phoneNo,
|
|
743
|
+
"onUpdate:modelValue": a[5] || (a[5] = (s) => e(o).company.phoneNo = s),
|
|
660
744
|
label: e(f)("connect.store.setting.company.phone"),
|
|
661
745
|
schema: e(Z).typeAtPath(e(u), "company.phoneNo")
|
|
662
746
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
663
747
|
x("div", Lt, L(e(f)("connect.store.setting.company.address.title")), 1),
|
|
664
|
-
|
|
665
|
-
modelValue: e(
|
|
666
|
-
"onUpdate:modelValue":
|
|
748
|
+
i(te, {
|
|
749
|
+
modelValue: e(o).company.address.line1,
|
|
750
|
+
"onUpdate:modelValue": a[6] || (a[6] = (s) => e(o).company.address.line1 = s),
|
|
667
751
|
label: e(f)("connect.store.setting.company.address.line1"),
|
|
668
752
|
schema: e(Z).typeAtPath(e(u), "company.address.line1")
|
|
669
753
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
670
|
-
|
|
671
|
-
modelValue: e(
|
|
672
|
-
"onUpdate:modelValue":
|
|
754
|
+
i(te, {
|
|
755
|
+
modelValue: e(o).company.address.line2,
|
|
756
|
+
"onUpdate:modelValue": a[7] || (a[7] = (s) => e(o).company.address.line2 = s),
|
|
673
757
|
label: e(f)("connect.store.setting.company.address.line2"),
|
|
674
758
|
schema: e(Z).typeAtPath(e(u), "company.address.line2")
|
|
675
759
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
676
|
-
x("div",
|
|
677
|
-
|
|
678
|
-
modelValue: e(
|
|
679
|
-
"onUpdate:modelValue":
|
|
760
|
+
x("div", Kt, [
|
|
761
|
+
i(te, {
|
|
762
|
+
modelValue: e(o).company.address.city,
|
|
763
|
+
"onUpdate:modelValue": a[8] || (a[8] = (s) => e(o).company.address.city = s),
|
|
680
764
|
label: e(f)("connect.store.setting.company.address.city"),
|
|
681
765
|
schema: e(Z).typeAtPath(e(u), "company.address.city")
|
|
682
766
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
683
|
-
|
|
684
|
-
modelValue: e(
|
|
685
|
-
"onUpdate:modelValue":
|
|
767
|
+
i(te, {
|
|
768
|
+
modelValue: e(o).company.address.postcode,
|
|
769
|
+
"onUpdate:modelValue": a[9] || (a[9] = (s) => e(o).company.address.postcode = s),
|
|
686
770
|
label: e(f)("connect.store.setting.company.address.postcode"),
|
|
687
771
|
schema: e(Z).typeAtPath(e(u), "company.address.postcode")
|
|
688
772
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
689
|
-
x("div",
|
|
690
|
-
x("div",
|
|
691
|
-
|
|
773
|
+
x("div", Ht, [
|
|
774
|
+
x("div", qt, L(e(f)("connect.store.setting.company.address.state")), 1),
|
|
775
|
+
i(D, {
|
|
692
776
|
placement: "top-end",
|
|
693
777
|
"model-value": e(m)
|
|
694
778
|
}, {
|
|
695
779
|
"menu-button": T(() => [
|
|
696
|
-
|
|
697
|
-
modelValue: e(
|
|
698
|
-
"onUpdate:modelValue":
|
|
780
|
+
i(te, {
|
|
781
|
+
modelValue: e(o).company.address.state,
|
|
782
|
+
"onUpdate:modelValue": a[10] || (a[10] = (s) => e(o).company.address.state = s),
|
|
699
783
|
schema: e(Z).typeAtPath(e(u), "company.address.state"),
|
|
700
|
-
onFocusChanged:
|
|
784
|
+
onFocusChanged: a[11] || (a[11] = (s) => m.value = s)
|
|
701
785
|
}, {
|
|
702
786
|
append: T(() => [
|
|
703
|
-
|
|
787
|
+
i(S, {
|
|
704
788
|
name: e(m) ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
705
789
|
}, null, 8, ["name"])
|
|
706
790
|
]),
|
|
@@ -708,44 +792,44 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
708
792
|
}, 8, ["modelValue", "schema"])
|
|
709
793
|
]),
|
|
710
794
|
default: T(() => [
|
|
711
|
-
(g(!0),
|
|
795
|
+
(g(!0), B(X, null, re(e(Rt)[e(N.Config).getCountry().code].stateItems.filter(
|
|
712
796
|
(s) => {
|
|
713
|
-
var
|
|
714
|
-
return s.label.toLowerCase().includes(((U = (
|
|
797
|
+
var k, U;
|
|
798
|
+
return s.label.toLowerCase().includes(((U = (k = e(o)) == null ? void 0 : k.company) == null ? void 0 : U.address.state.toLowerCase()) ?? "");
|
|
715
799
|
}
|
|
716
800
|
) || [], (s) => (g(), I(w, {
|
|
717
801
|
key: s.value,
|
|
718
|
-
"model-value": e(
|
|
802
|
+
"model-value": e(o).company.address.state === s.value,
|
|
719
803
|
label: s.label,
|
|
720
804
|
onClick: () => {
|
|
721
|
-
e(
|
|
805
|
+
e(o).company.address.state = s.value, m.value = !1;
|
|
722
806
|
}
|
|
723
807
|
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
724
808
|
]),
|
|
725
809
|
_: 1
|
|
726
810
|
}, 8, ["model-value"])
|
|
727
811
|
]),
|
|
728
|
-
|
|
812
|
+
i(Y, {
|
|
729
813
|
label: e(f)("connect.store.setting.company.address.country"),
|
|
730
|
-
modelValue: e(
|
|
731
|
-
"onUpdate:modelValue":
|
|
814
|
+
modelValue: e(o).company.address.country,
|
|
815
|
+
"onUpdate:modelValue": a[12] || (a[12] = (s) => e(o).company.address.country = s),
|
|
732
816
|
items: [
|
|
733
817
|
{
|
|
734
|
-
label: e(
|
|
735
|
-
value: e(
|
|
818
|
+
label: e(N.Config).getCountry().name,
|
|
819
|
+
value: e(N.Config).getCountry().name
|
|
736
820
|
}
|
|
737
821
|
],
|
|
738
822
|
rules: [e(Z).ruleAtPath(e(u), "company.address.country")]
|
|
739
823
|
}, null, 8, ["label", "modelValue", "items", "rules"])
|
|
740
824
|
]),
|
|
741
|
-
x("div",
|
|
742
|
-
x("div",
|
|
743
|
-
|
|
744
|
-
"model-value": (
|
|
745
|
-
"onUpdate:modelValue":
|
|
825
|
+
x("div", Yt, [
|
|
826
|
+
x("div", Wt, L(e(f)("connect.store.setting.stripe.title")), 1),
|
|
827
|
+
i(At, {
|
|
828
|
+
"model-value": (ae = e(o)) == null ? void 0 : ae.stripe,
|
|
829
|
+
"onUpdate:modelValue": a[13] || (a[13] = (s) => e(o).stripe = s)
|
|
746
830
|
}, null, 8, ["model-value"])
|
|
747
831
|
])
|
|
748
|
-
])) :
|
|
832
|
+
])) : M("", !0)
|
|
749
833
|
];
|
|
750
834
|
}),
|
|
751
835
|
_: 1
|
|
@@ -754,7 +838,7 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
754
838
|
}
|
|
755
839
|
});
|
|
756
840
|
function Gt(v, _ = !0) {
|
|
757
|
-
return
|
|
841
|
+
return N.DineroFactory(v).toFormat(_);
|
|
758
842
|
}
|
|
759
843
|
const Xt = /* @__PURE__ */ ee({
|
|
760
844
|
__name: "TaxVariantSetting",
|
|
@@ -767,70 +851,70 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
767
851
|
},
|
|
768
852
|
emits: ["update:modelValue"],
|
|
769
853
|
setup(v, { emit: _ }) {
|
|
770
|
-
const
|
|
854
|
+
const l = v, f = _;
|
|
771
855
|
fe(() => {
|
|
772
|
-
if (
|
|
856
|
+
if (o.value.length !== b.value.length) {
|
|
773
857
|
const t = b.value.reduce((c, y) => {
|
|
774
|
-
const d =
|
|
858
|
+
const d = ne.systemDefaultCode(y.name);
|
|
775
859
|
if (!d) return c;
|
|
776
|
-
const { systemCode:
|
|
777
|
-
return y.value || c.push({ systemCode:
|
|
860
|
+
const { systemCode: V, taxCode: a } = d;
|
|
861
|
+
return y.value || c.push({ systemCode: V, taxCode: a }), c;
|
|
778
862
|
}, []);
|
|
779
863
|
u(t);
|
|
780
864
|
}
|
|
781
865
|
});
|
|
782
|
-
function
|
|
783
|
-
return
|
|
866
|
+
function r() {
|
|
867
|
+
return ne.groupedTaxOptions();
|
|
784
868
|
}
|
|
785
|
-
const b = j(() =>
|
|
869
|
+
const b = j(() => r().map((t) => ({
|
|
786
870
|
name: t.code,
|
|
787
|
-
value: (
|
|
871
|
+
value: (o.value || []).find(
|
|
788
872
|
(c) => t.options.some((y) => y.feedmeTaxCode === c)
|
|
789
873
|
),
|
|
790
874
|
options: t.options.map((c) => ({
|
|
791
875
|
label: `${c.name} (${it(c.rate)}%)`,
|
|
792
876
|
value: c.feedmeTaxCode
|
|
793
877
|
}))
|
|
794
|
-
}))),
|
|
878
|
+
}))), o = j(() => l.modelValue.map((t) => ne.generateCode(t)));
|
|
795
879
|
function m(t) {
|
|
796
|
-
const c =
|
|
797
|
-
(
|
|
798
|
-
), y = c == null ? void 0 : c.options.find((
|
|
880
|
+
const c = r().find(
|
|
881
|
+
(a) => a.options.some((S) => S.feedmeTaxCode === t)
|
|
882
|
+
), y = c == null ? void 0 : c.options.find((a) => a.feedmeTaxCode === t);
|
|
799
883
|
if (!y) return;
|
|
800
|
-
const { systemCode: d, taxCode:
|
|
801
|
-
u([{ systemCode: d, taxCode:
|
|
884
|
+
const { systemCode: d, taxCode: V } = y;
|
|
885
|
+
u([{ systemCode: d, taxCode: V }]);
|
|
802
886
|
}
|
|
803
887
|
function u(t) {
|
|
804
|
-
const c = ue.clone(
|
|
888
|
+
const c = ue.clone(l.modelValue);
|
|
805
889
|
t.forEach((y) => {
|
|
806
|
-
const d =
|
|
807
|
-
(
|
|
808
|
-
),
|
|
809
|
-
(
|
|
890
|
+
const d = r().find(
|
|
891
|
+
(S) => S.options.some((w) => w.feedmeTaxCode === ne.generateCode(y))
|
|
892
|
+
), V = (d == null ? void 0 : d.options) || [], a = c.findIndex(
|
|
893
|
+
(S) => V.some((w) => ne.generateCode(w) === ne.generateCode(S))
|
|
810
894
|
);
|
|
811
|
-
|
|
895
|
+
a >= 0 ? c.splice(a, 1, y) : c.push(y);
|
|
812
896
|
}), f("update:modelValue", c);
|
|
813
897
|
}
|
|
814
898
|
return (t, c) => {
|
|
815
899
|
const y = h("FmRadio"), d = h("FmRadioGroup");
|
|
816
|
-
return g(!0),
|
|
817
|
-
key:
|
|
900
|
+
return g(!0), B(X, null, re(e(b), (V) => (g(), B("div", {
|
|
901
|
+
key: V.name,
|
|
818
902
|
class: "flex items-start"
|
|
819
903
|
}, [
|
|
820
|
-
|
|
821
|
-
modelValue:
|
|
904
|
+
i(d, {
|
|
905
|
+
modelValue: V.value,
|
|
822
906
|
"onUpdate:modelValue": [
|
|
823
|
-
(
|
|
824
|
-
c[0] || (c[0] = (
|
|
825
|
-
m(
|
|
907
|
+
(a) => V.value = a,
|
|
908
|
+
c[0] || (c[0] = (a) => {
|
|
909
|
+
m(a);
|
|
826
910
|
})
|
|
827
911
|
]
|
|
828
912
|
}, {
|
|
829
913
|
default: T(() => [
|
|
830
|
-
(g(!0),
|
|
831
|
-
key:
|
|
832
|
-
value:
|
|
833
|
-
label:
|
|
914
|
+
(g(!0), B(X, null, re(V.options, (a, S) => (g(), I(y, {
|
|
915
|
+
key: S,
|
|
916
|
+
value: a.value,
|
|
917
|
+
label: a.label
|
|
834
918
|
}, null, 8, ["value", "label"]))), 128))
|
|
835
919
|
]),
|
|
836
920
|
_: 2
|
|
@@ -838,13 +922,13 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
838
922
|
]))), 128);
|
|
839
923
|
};
|
|
840
924
|
}
|
|
841
|
-
}),
|
|
925
|
+
}), Ve = {
|
|
842
926
|
get _id() {
|
|
843
927
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
844
928
|
},
|
|
845
929
|
name: "",
|
|
846
|
-
price:
|
|
847
|
-
originalPrice:
|
|
930
|
+
price: N.Dinero.zero().toObject(),
|
|
931
|
+
originalPrice: N.Dinero.zero().toObject(),
|
|
848
932
|
vouchers: [],
|
|
849
933
|
credit: {
|
|
850
934
|
normal: 0,
|
|
@@ -864,18 +948,18 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
864
948
|
}, Zt = {
|
|
865
949
|
key: 0,
|
|
866
950
|
class: "space-y-24 pr-12"
|
|
867
|
-
}, Qt = { class: "space-y-8" },
|
|
951
|
+
}, Qt = { class: "space-y-8" }, en = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, tn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, nn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, on = /* @__PURE__ */ x("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1), an = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, sn = { class: "space-y-8" }, rn = { class: "flex items-center justify-between" }, dn = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, un = { class: "space-y-8" }, cn = { class: "flex items-center gap-8" }, mn = /* @__PURE__ */ ee({
|
|
868
952
|
__name: "EditBundleSheet",
|
|
869
953
|
emits: ["update"],
|
|
870
|
-
setup(v, { expose: _, emit:
|
|
871
|
-
const f =
|
|
954
|
+
setup(v, { expose: _, emit: l }) {
|
|
955
|
+
const f = l, { t: r } = be(), b = ke(), o = R(!1), m = R([]), u = R({
|
|
872
956
|
category: 0,
|
|
873
957
|
index: -1,
|
|
874
958
|
originalCategoryIndex: void 0
|
|
875
|
-
}), t = R(ue.cloneDeep(
|
|
959
|
+
}), t = R(ue.cloneDeep(Ve)), c = R(), y = Ae, d = j(() => {
|
|
876
960
|
const p = y.safeParse(t.value);
|
|
877
961
|
return p.success ? [] : p.error.errors;
|
|
878
|
-
}),
|
|
962
|
+
}), V = [
|
|
879
963
|
{
|
|
880
964
|
header: "Reward title",
|
|
881
965
|
accessorFn: (p) => p.collectible.name,
|
|
@@ -894,229 +978,233 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
894
978
|
accessorFn: (p) => p.description,
|
|
895
979
|
cell(p) {
|
|
896
980
|
var C;
|
|
897
|
-
const
|
|
898
|
-
return
|
|
899
|
-
"onUpdate:modelValue": (
|
|
981
|
+
const n = p.row.original;
|
|
982
|
+
return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description : qe(We.FmStepperField, {
|
|
983
|
+
"onUpdate:modelValue": (P) => {
|
|
900
984
|
t.value.titles = t.value.titles.map(
|
|
901
|
-
(E) => E.id ==
|
|
985
|
+
(E) => E.id == n.collectible._id ? { ...E, dayToExpire: P } : E
|
|
902
986
|
);
|
|
903
987
|
},
|
|
904
|
-
modelValue: ((C =
|
|
988
|
+
modelValue: ((C = n.selectedReward) == null ? void 0 : C.extra) ?? 0,
|
|
905
989
|
appendText: "day(s)",
|
|
906
990
|
helperState: J(d.value, "titles"),
|
|
907
991
|
helperText: G(d.value, "titles"),
|
|
908
992
|
max: 9999,
|
|
909
|
-
rules: [(
|
|
993
|
+
rules: [(P) => P <= 9999 || "Maximum 9999 days allowed"],
|
|
910
994
|
showSteppers: !1,
|
|
911
995
|
disabled: !!t.value.stripePriceId
|
|
912
996
|
});
|
|
913
997
|
}
|
|
914
998
|
}
|
|
915
|
-
],
|
|
916
|
-
const
|
|
999
|
+
], a = R([]), S = j(() => b.bundleRewards.map((p) => {
|
|
1000
|
+
const n = w.value.find((P) => P.id == p._id), C = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${dt(
|
|
1001
|
+
p.options.validityOption || {}
|
|
1002
|
+
)}` : "No expiry";
|
|
917
1003
|
return {
|
|
918
1004
|
collectible: p,
|
|
919
1005
|
description: C,
|
|
920
|
-
selectedReward:
|
|
1006
|
+
selectedReward: n
|
|
921
1007
|
};
|
|
922
1008
|
})), w = j(() => {
|
|
923
|
-
var p,
|
|
1009
|
+
var p, n;
|
|
924
1010
|
return [
|
|
925
1011
|
...((p = t.value) == null ? void 0 : p.titles.map((C) => ({
|
|
926
1012
|
id: C.id,
|
|
927
1013
|
extra: C.dayToExpire
|
|
928
1014
|
}))) ?? [],
|
|
929
|
-
...((
|
|
1015
|
+
...((n = t.value) == null ? void 0 : n.vouchers.map((C) => ({
|
|
930
1016
|
id: C,
|
|
931
1017
|
extra: void 0
|
|
932
1018
|
}))) ?? []
|
|
933
1019
|
];
|
|
934
|
-
}),
|
|
1020
|
+
}), D = j(
|
|
935
1021
|
() => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
|
|
936
1022
|
);
|
|
937
|
-
function
|
|
1023
|
+
function Y(p) {
|
|
938
1024
|
t.value.subscriptionValidity = p;
|
|
939
|
-
for (const
|
|
940
|
-
|
|
1025
|
+
for (const n of t.value.titles)
|
|
1026
|
+
n.dayToExpire = p;
|
|
941
1027
|
t.value.credit.free && (t.value.credit.free.day = p);
|
|
942
1028
|
}
|
|
943
|
-
function
|
|
944
|
-
const p =
|
|
945
|
-
if (!(!
|
|
1029
|
+
function z() {
|
|
1030
|
+
const p = S.value, n = t.value;
|
|
1031
|
+
if (!(!n || !p))
|
|
946
1032
|
for (let C = 0; C < p.length; C++) {
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
(
|
|
950
|
-
) < 0 &&
|
|
951
|
-
id:
|
|
952
|
-
dayToExpire:
|
|
953
|
-
}) :
|
|
954
|
-
(
|
|
955
|
-
) < 0 &&
|
|
956
|
-
(
|
|
1033
|
+
const P = p[C];
|
|
1034
|
+
K.value[C] ? P.collectible.type == "TITLE" ? n.titles.findIndex(
|
|
1035
|
+
(H) => H.id == P.collectible._id
|
|
1036
|
+
) < 0 && n.titles.push({
|
|
1037
|
+
id: P.collectible._id,
|
|
1038
|
+
dayToExpire: D.value
|
|
1039
|
+
}) : n.vouchers.findIndex(
|
|
1040
|
+
(H) => H == P.collectible._id
|
|
1041
|
+
) < 0 && n.vouchers.push(P.collectible._id) : (n.titles = n.titles.filter((q) => q.id != P.collectible._id), n.vouchers = n.vouchers.filter(
|
|
1042
|
+
(q) => q != P.collectible._id
|
|
957
1043
|
));
|
|
958
1044
|
}
|
|
959
1045
|
}
|
|
960
|
-
const
|
|
961
|
-
we(
|
|
962
|
-
const
|
|
963
|
-
var p,
|
|
964
|
-
return (
|
|
965
|
-
}),
|
|
966
|
-
var p,
|
|
967
|
-
return (C = (
|
|
1046
|
+
const K = R({});
|
|
1047
|
+
we(K, z, { deep: !0 });
|
|
1048
|
+
const W = j(() => {
|
|
1049
|
+
var p, n;
|
|
1050
|
+
return (n = (p = b.storeOption) == null ? void 0 : p.company) == null ? void 0 : n.sstRegNo;
|
|
1051
|
+
}), ae = j(() => {
|
|
1052
|
+
var p, n, C;
|
|
1053
|
+
return (C = (n = (p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) == null ? void 0 : n[0]) != null && C.inclusive ? "Inclusive" : "Exclusive";
|
|
968
1054
|
}), s = j(() => {
|
|
969
|
-
var p,
|
|
1055
|
+
var p, n, C;
|
|
970
1056
|
return mt(
|
|
971
|
-
|
|
972
|
-
|
|
1057
|
+
ne.fullTax,
|
|
1058
|
+
He(t.value.taxes),
|
|
973
1059
|
t.value.price,
|
|
974
1060
|
Number(t.value.credit.normal),
|
|
975
1061
|
((p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) ?? [],
|
|
976
|
-
(C = (
|
|
1062
|
+
(C = (n = b.storeOption) == null ? void 0 : n.company) != null && C.sstRegNo ? ne.taxSystem.map((P) => P.code) : []
|
|
977
1063
|
);
|
|
978
|
-
}),
|
|
979
|
-
(
|
|
1064
|
+
}), k = j(() => s.value.reduce(
|
|
1065
|
+
(n, C) => n.add(C.total),
|
|
980
1066
|
rt()
|
|
981
1067
|
).toFormat()), U = j(() => {
|
|
982
|
-
var
|
|
1068
|
+
var P;
|
|
983
1069
|
const p = pt(
|
|
984
1070
|
s.value,
|
|
985
1071
|
t.value.price,
|
|
986
|
-
((
|
|
1072
|
+
((P = b.storeOption) == null ? void 0 : P.inclusiveTaxes) ?? []
|
|
987
1073
|
);
|
|
988
1074
|
t.value.priceWithTaxes = p;
|
|
989
|
-
const
|
|
1075
|
+
const n = Gt(p, !1), C = Number(n.replace(/[^\d.-]/g, ""));
|
|
990
1076
|
return Number.isNaN(C) ? 0 : C;
|
|
991
1077
|
});
|
|
992
|
-
function
|
|
993
|
-
t.value.taxTotals = s.value, f("update",
|
|
1078
|
+
function O() {
|
|
1079
|
+
t.value.taxTotals = s.value, f("update", Ae.parse(Xe(t.value)));
|
|
994
1080
|
}
|
|
995
|
-
function
|
|
996
|
-
return ue.cloneDeep(
|
|
1081
|
+
function $() {
|
|
1082
|
+
return ue.cloneDeep(Ve);
|
|
997
1083
|
}
|
|
998
|
-
function
|
|
999
|
-
|
|
1084
|
+
function A(p, n) {
|
|
1085
|
+
o.value = p, p && n && (c.value = void 0, m.value = n.categories, t.value = n.bundle || $(), u.value.category = n.category, u.value.index = n.index, u.value.originalCategoryIndex = n.category, K.value = S.value.reduce((C, P, E) => (C[E] = !!P.selectedReward, C), {}));
|
|
1000
1086
|
}
|
|
1001
1087
|
return _({
|
|
1002
|
-
showSheet:
|
|
1088
|
+
showSheet: A,
|
|
1003
1089
|
bundleImage: c,
|
|
1004
1090
|
target: u,
|
|
1005
1091
|
data: t
|
|
1006
|
-
}), (p,
|
|
1007
|
-
const C = h("FmSwitch"),
|
|
1092
|
+
}), (p, n) => {
|
|
1093
|
+
const C = h("FmSwitch"), P = h("FmHelperText"), E = h("FmTextField"), q = h("FmSelect"), H = h("FmStepperField"), ie = h("FmMenuItem"), ge = h("FmTable"), ce = h("FmButton"), ve = h("FmSideSheet");
|
|
1008
1094
|
return g(), I(ve, {
|
|
1009
1095
|
"max-width": 768,
|
|
1010
|
-
modelValue: e(
|
|
1011
|
-
"onUpdate:modelValue":
|
|
1012
|
-
header: e(u).index != -1 ? e(
|
|
1096
|
+
modelValue: e(o),
|
|
1097
|
+
"onUpdate:modelValue": n[20] || (n[20] = (le) => oe(o) ? o.value = le : null),
|
|
1098
|
+
header: e(u).index != -1 ? e(r)("connect.store.bundle.edit.title") : e(r)("connect.store.bundle.edit.create")
|
|
1013
1099
|
}, {
|
|
1014
1100
|
"side-sheet-footer": T(() => [
|
|
1015
|
-
x("div",
|
|
1016
|
-
|
|
1101
|
+
x("div", cn, [
|
|
1102
|
+
i(ce, {
|
|
1017
1103
|
label: e(u).index != -1 ? "Save" : "Add",
|
|
1018
|
-
onClick:
|
|
1104
|
+
onClick: O,
|
|
1019
1105
|
disabled: e(d).length > 0,
|
|
1020
|
-
loading: e(
|
|
1106
|
+
loading: e(Se)().isLoading
|
|
1021
1107
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
1022
|
-
|
|
1108
|
+
i(ce, {
|
|
1023
1109
|
label: "Cancel",
|
|
1024
|
-
onClick:
|
|
1110
|
+
onClick: n[19] || (n[19] = (le) => A(!1)),
|
|
1025
1111
|
variant: "tertiary"
|
|
1026
1112
|
})
|
|
1027
1113
|
])
|
|
1028
1114
|
]),
|
|
1029
1115
|
default: T(() => {
|
|
1030
|
-
var
|
|
1116
|
+
var le, $e, Te, Ue, Re, Ie, Be, Ne;
|
|
1031
1117
|
return [
|
|
1032
|
-
|
|
1033
|
-
e(t) ? (g(),
|
|
1118
|
+
i(Pe, { json: e(t) }, null, 8, ["json"]),
|
|
1119
|
+
e(t) ? (g(), B("div", Zt, [
|
|
1034
1120
|
x("div", Qt, [
|
|
1035
|
-
e(
|
|
1121
|
+
e(N.Config).getCountry().code == "MY" && ((le = e(b).payoutAccount) == null ? void 0 : le.status) == "APPROVED" && (($e = e(b).payoutAccount) != null && $e.enable) ? (g(), I(C, {
|
|
1036
1122
|
key: 0,
|
|
1037
|
-
"onUpdate:modelValue":
|
|
1038
|
-
e(t).isFeedvibe =
|
|
1123
|
+
"onUpdate:modelValue": n[0] || (n[0] = (F) => {
|
|
1124
|
+
e(t).isFeedvibe = F, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], K.value = {});
|
|
1039
1125
|
}),
|
|
1040
1126
|
"label-placement": "right",
|
|
1041
1127
|
"model-value": e(t).isFeedvibe || !1,
|
|
1042
1128
|
label: "Feedvibe Campaign",
|
|
1043
1129
|
sublabel: "Bundle will be appear for Feedvibe campaign use"
|
|
1044
|
-
}, null, 8, ["model-value"])) :
|
|
1045
|
-
e(t).isFeedvibe ? (g(), I(
|
|
1130
|
+
}, null, 8, ["model-value"])) : M("", !0),
|
|
1131
|
+
e(t).isFeedvibe ? (g(), I(P, {
|
|
1046
1132
|
key: 1,
|
|
1047
1133
|
text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app",
|
|
1048
1134
|
state: "warning"
|
|
1049
|
-
})) :
|
|
1135
|
+
})) : M("", !0)
|
|
1050
1136
|
]),
|
|
1051
|
-
x("div",
|
|
1052
|
-
|
|
1053
|
-
label: e(
|
|
1137
|
+
x("div", en, L(e(r)("connect.store.bundle.edit.basicInformation")), 1),
|
|
1138
|
+
i(E, {
|
|
1139
|
+
label: e(r)("connect.store.bundle.edit.bundleName"),
|
|
1054
1140
|
modelValue: e(t).name,
|
|
1055
|
-
"onUpdate:modelValue":
|
|
1141
|
+
"onUpdate:modelValue": n[1] || (n[1] = (F) => e(t).name = F),
|
|
1056
1142
|
"helper-state": e(J)(e(d), "name"),
|
|
1057
1143
|
"helper-text": e(G)(e(d), "name")
|
|
1058
1144
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1059
|
-
|
|
1145
|
+
i(q, {
|
|
1060
1146
|
modelValue: e(u).category,
|
|
1061
|
-
"onUpdate:modelValue":
|
|
1147
|
+
"onUpdate:modelValue": n[2] || (n[2] = (F) => e(u).category = F),
|
|
1062
1148
|
label: "Store Category",
|
|
1063
|
-
items: e(m).map((
|
|
1149
|
+
items: e(m).map((F, Le) => ({ label: F, value: Le }))
|
|
1064
1150
|
}, null, 8, ["modelValue", "items"]),
|
|
1065
|
-
|
|
1066
|
-
label: e(
|
|
1151
|
+
i(at, {
|
|
1152
|
+
label: e(r)("connect.store.bundle.edit.bundleImage"),
|
|
1067
1153
|
class: "w-1/2 xs:w-2/3",
|
|
1068
1154
|
"aspect-ratio": "16/9",
|
|
1069
1155
|
thumbnail: e(t).image ?? void 0,
|
|
1070
1156
|
file: e(c) ?? void 0,
|
|
1071
|
-
"onUpdate:file":
|
|
1072
|
-
c.value =
|
|
1157
|
+
"onUpdate:file": n[3] || (n[3] = (F) => {
|
|
1158
|
+
c.value = F;
|
|
1073
1159
|
}),
|
|
1074
1160
|
"helper-state": e(J)(e(d), "image"),
|
|
1075
1161
|
"helper-text": e(G)(e(d), "image")
|
|
1076
1162
|
}, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
|
|
1077
|
-
|
|
1078
|
-
"model-value": e(
|
|
1079
|
-
label: e(
|
|
1163
|
+
i(H, {
|
|
1164
|
+
"model-value": e(N.Dinero).fromFdoDinero(e(t).price).toUnit(),
|
|
1165
|
+
label: e(r)("connect.store.bundle.edit.bundlePrice"),
|
|
1080
1166
|
min: 0,
|
|
1081
1167
|
"max-fraction-digits": 2,
|
|
1082
|
-
"onUpdate:modelValue":
|
|
1083
|
-
e(t).price.amount =
|
|
1168
|
+
"onUpdate:modelValue": n[4] || (n[4] = (F) => {
|
|
1169
|
+
e(t).price.amount = F * 10 ** e(t).price.precision;
|
|
1084
1170
|
}),
|
|
1085
1171
|
"is-currency": !0,
|
|
1086
1172
|
"show-steppers": !1,
|
|
1087
|
-
"helper-text": e(G)(e(d), "price") || `${e(
|
|
1173
|
+
"helper-text": e(G)(e(d), "price") || `${e(N.Dinero).fromNumber({ number: 1 }).toFormat(
|
|
1174
|
+
!0
|
|
1175
|
+
)} = ${e(N.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
|
|
1088
1176
|
"helper-state": e(J)(e(d), "price")
|
|
1089
1177
|
}, {
|
|
1090
1178
|
prepend: T(() => [
|
|
1091
|
-
de(L(e(
|
|
1179
|
+
de(L(e(N.Dinero).defaultCurrency()), 1)
|
|
1092
1180
|
]),
|
|
1093
1181
|
_: 1
|
|
1094
1182
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
1095
|
-
|
|
1096
|
-
"model-value": e(
|
|
1097
|
-
label: e(
|
|
1183
|
+
i(H, {
|
|
1184
|
+
"model-value": e(N.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
|
|
1185
|
+
label: e(r)("connect.store.bundle.edit.bundleValue"),
|
|
1098
1186
|
min: 0,
|
|
1099
1187
|
"max-fraction-digits": 2,
|
|
1100
|
-
"onUpdate:modelValue":
|
|
1101
|
-
e(t).originalPrice || (e(t).originalPrice = e(
|
|
1188
|
+
"onUpdate:modelValue": n[5] || (n[5] = (F) => {
|
|
1189
|
+
e(t).originalPrice || (e(t).originalPrice = e(N.Dinero).zero().toObject()), e(t).originalPrice.amount = F * 10 ** e(t).originalPrice.precision;
|
|
1102
1190
|
}),
|
|
1103
1191
|
"is-currency": !0,
|
|
1104
1192
|
"show-steppers": !1,
|
|
1105
|
-
"helper-text": e(G)(e(d), "originalPrice") || e(
|
|
1193
|
+
"helper-text": e(G)(e(d), "originalPrice") || e(r)("connect.store.bundle.edit.originalPriceHelper"),
|
|
1106
1194
|
"helper-state": e(J)(e(d), "originalPrice")
|
|
1107
1195
|
}, {
|
|
1108
1196
|
prepend: T(() => [
|
|
1109
|
-
de(L(e(
|
|
1197
|
+
de(L(e(N.Dinero).defaultCurrency()), 1)
|
|
1110
1198
|
]),
|
|
1111
1199
|
_: 1
|
|
1112
1200
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
1113
|
-
e(t).isFeedvibe ?
|
|
1201
|
+
e(t).isFeedvibe ? M("", !0) : (g(), I(H, {
|
|
1114
1202
|
key: 0,
|
|
1115
1203
|
"model-value": e(t).coinPrice ?? null,
|
|
1116
|
-
label: e(
|
|
1204
|
+
label: e(r)("connect.store.bundle.edit.pointNeeded"),
|
|
1117
1205
|
min: 0,
|
|
1118
|
-
"onUpdate:modelValue":
|
|
1119
|
-
|
|
1206
|
+
"onUpdate:modelValue": n[6] || (n[6] = (F) => {
|
|
1207
|
+
F > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = F;
|
|
1120
1208
|
}),
|
|
1121
1209
|
"show-steppers": !1,
|
|
1122
1210
|
"helper-state": e(J)(e(d), "coinPrice"),
|
|
@@ -1127,32 +1215,32 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1127
1215
|
]),
|
|
1128
1216
|
_: 1
|
|
1129
1217
|
}, 8, ["model-value", "label", "helper-state", "helper-text"])),
|
|
1130
|
-
(Te = e(b).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (g(),
|
|
1131
|
-
x("div",
|
|
1132
|
-
|
|
1133
|
-
label: e(
|
|
1218
|
+
(Te = e(b).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (g(), B(X, { key: 1 }, [
|
|
1219
|
+
x("div", tn, L(e(r)("connect.store.bundle.edit.subscriptionSettings")), 1),
|
|
1220
|
+
i(E, {
|
|
1221
|
+
label: e(r)("connect.store.bundle.edit.stripePriceId"),
|
|
1134
1222
|
modelValue: e(t).stripePriceId,
|
|
1135
|
-
"onUpdate:modelValue":
|
|
1223
|
+
"onUpdate:modelValue": n[7] || (n[7] = (F) => e(t).stripePriceId = F),
|
|
1136
1224
|
"helper-state": e(J)(e(d), "stripePriceId"),
|
|
1137
1225
|
"helper-text": e(G)(e(d), "stripePriceId")
|
|
1138
1226
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1139
|
-
e(t).stripePriceId ? (g(), I(
|
|
1227
|
+
e(t).stripePriceId ? (g(), I(H, {
|
|
1140
1228
|
key: 0,
|
|
1141
1229
|
"model-value": e(t).subscriptionValidity ?? null,
|
|
1142
1230
|
min: 1,
|
|
1143
|
-
"onUpdate:modelValue":
|
|
1144
|
-
label: e(
|
|
1231
|
+
"onUpdate:modelValue": Y,
|
|
1232
|
+
label: e(r)("connect.store.bundle.edit.subscriptionValidity"),
|
|
1145
1233
|
"show-steppers": !1,
|
|
1146
1234
|
"helper-state": e(J)(e(d), "subscriptionValidity"),
|
|
1147
1235
|
"helper-text": e(G)(e(d), "subscriptionValidity")
|
|
1148
|
-
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) :
|
|
1149
|
-
], 64)) :
|
|
1150
|
-
e(t).isFeedvibe ?
|
|
1151
|
-
|
|
1152
|
-
|
|
1236
|
+
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : M("", !0)
|
|
1237
|
+
], 64)) : M("", !0),
|
|
1238
|
+
e(t).isFeedvibe ? M("", !0) : (g(), B(X, { key: 2 }, [
|
|
1239
|
+
x("div", nn, L(e(r)("connect.store.bundle.edit.credit")), 1),
|
|
1240
|
+
i(H, {
|
|
1153
1241
|
modelValue: e(t).credit.normal,
|
|
1154
|
-
"onUpdate:modelValue":
|
|
1155
|
-
label: "
|
|
1242
|
+
"onUpdate:modelValue": n[8] || (n[8] = (F) => e(t).credit.normal = F),
|
|
1243
|
+
label: e(r)("connect.store.bundle.edit.normalCredit"),
|
|
1156
1244
|
"show-steppers": !1,
|
|
1157
1245
|
"helper-state": e(J)(e(d), "credit.normal"),
|
|
1158
1246
|
"helper-text": e(G)(e(d), "credit.normal")
|
|
@@ -1161,17 +1249,17 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1161
1249
|
de(" credit ")
|
|
1162
1250
|
]),
|
|
1163
1251
|
_: 1
|
|
1164
|
-
}, 8, ["modelValue", "helper-state", "helper-text"]),
|
|
1165
|
-
|
|
1252
|
+
}, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
1253
|
+
i(H, {
|
|
1166
1254
|
"model-value": ((Ue = e(t).credit.free) == null ? void 0 : Ue.amount) ?? null,
|
|
1167
1255
|
min: 0,
|
|
1168
|
-
"onUpdate:modelValue":
|
|
1256
|
+
"onUpdate:modelValue": n[9] || (n[9] = (F) => {
|
|
1169
1257
|
e(t).credit.free || (e(t).credit.free = {
|
|
1170
1258
|
amount: 0,
|
|
1171
1259
|
day: 1
|
|
1172
|
-
}), e(t).credit.free.amount =
|
|
1260
|
+
}), e(t).credit.free.amount = F;
|
|
1173
1261
|
}),
|
|
1174
|
-
label: "
|
|
1262
|
+
label: e(r)("connect.store.bundle.edit.freeCredit"),
|
|
1175
1263
|
"show-steppers": !1,
|
|
1176
1264
|
"helper-state": e(J)(e(d), "credit.free.amount"),
|
|
1177
1265
|
"helper-text": e(G)(e(d), "credit.free.amount")
|
|
@@ -1180,17 +1268,17 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1180
1268
|
de(" credit ")
|
|
1181
1269
|
]),
|
|
1182
1270
|
_: 1
|
|
1183
|
-
}, 8, ["model-value", "helper-state", "helper-text"]),
|
|
1184
|
-
(Re = e(t).credit.free) != null && Re.amount ? (g(), I(
|
|
1271
|
+
}, 8, ["model-value", "label", "helper-state", "helper-text"]),
|
|
1272
|
+
(Re = e(t).credit.free) != null && Re.amount ? (g(), I(H, {
|
|
1185
1273
|
key: 0,
|
|
1186
1274
|
disabled: !!e(t).stripePriceId,
|
|
1187
1275
|
"model-value": ((Ie = e(t).credit.free) == null ? void 0 : Ie.day) ?? null,
|
|
1188
1276
|
min: 0,
|
|
1189
|
-
"onUpdate:modelValue":
|
|
1277
|
+
"onUpdate:modelValue": n[10] || (n[10] = (F) => {
|
|
1190
1278
|
e(t).credit.free || (e(t).credit.free = {
|
|
1191
1279
|
amount: 0,
|
|
1192
1280
|
day: 1
|
|
1193
|
-
}), e(t).credit.free.day = e(
|
|
1281
|
+
}), e(t).credit.free.day = e(D) || F;
|
|
1194
1282
|
}),
|
|
1195
1283
|
label: "Free credit valid for",
|
|
1196
1284
|
"show-steppers": !1,
|
|
@@ -1201,39 +1289,39 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1201
1289
|
de(" day(s) ")
|
|
1202
1290
|
]),
|
|
1203
1291
|
_: 1
|
|
1204
|
-
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) :
|
|
1292
|
+
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : M("", !0)
|
|
1205
1293
|
], 64)),
|
|
1206
|
-
e(
|
|
1207
|
-
|
|
1208
|
-
|
|
1294
|
+
e(W) ? (g(), B(X, { key: 3 }, [
|
|
1295
|
+
on,
|
|
1296
|
+
i(Xt, {
|
|
1209
1297
|
modelValue: e(t).taxes,
|
|
1210
|
-
"onUpdate:modelValue":
|
|
1298
|
+
"onUpdate:modelValue": n[11] || (n[11] = (F) => e(t).taxes = F)
|
|
1211
1299
|
}, null, 8, ["modelValue"]),
|
|
1212
|
-
|
|
1213
|
-
label: `Tax Charged (${e(
|
|
1214
|
-
"model-value": e(
|
|
1300
|
+
i(E, {
|
|
1301
|
+
label: `Tax Charged (${e(ae)})`,
|
|
1302
|
+
"model-value": e(k),
|
|
1215
1303
|
disabled: ""
|
|
1216
1304
|
}, null, 8, ["label", "model-value"])
|
|
1217
|
-
], 64)) :
|
|
1218
|
-
|
|
1305
|
+
], 64)) : M("", !0),
|
|
1306
|
+
i(H, {
|
|
1219
1307
|
label: "Total Price",
|
|
1220
1308
|
"model-value": e(U),
|
|
1221
1309
|
disabled: !0
|
|
1222
1310
|
}, null, 8, ["model-value"]),
|
|
1223
|
-
x("div",
|
|
1224
|
-
x("div",
|
|
1225
|
-
x("div",
|
|
1226
|
-
x("div",
|
|
1227
|
-
|
|
1228
|
-
label: `Reward type: ${e(
|
|
1311
|
+
x("div", an, L(e(r)("connect.store.bundle.edit.bundleReward.title")), 1),
|
|
1312
|
+
x("div", ln, L(e(r)("connect.store.bundle.edit.bundleReward.description")), 1),
|
|
1313
|
+
x("div", sn, [
|
|
1314
|
+
x("div", rn, [
|
|
1315
|
+
i(lt, {
|
|
1316
|
+
label: `Reward type: ${e(a).length == 0 ? "All" : e(a)[0].name}`
|
|
1229
1317
|
}, {
|
|
1230
1318
|
default: T(() => [
|
|
1231
|
-
|
|
1232
|
-
onClick:
|
|
1319
|
+
i(ie, {
|
|
1320
|
+
onClick: n[12] || (n[12] = (F) => a.value = []),
|
|
1233
1321
|
label: "All"
|
|
1234
1322
|
}),
|
|
1235
|
-
|
|
1236
|
-
onClick:
|
|
1323
|
+
i(ie, {
|
|
1324
|
+
onClick: n[13] || (n[13] = (F) => a.value = [
|
|
1237
1325
|
{
|
|
1238
1326
|
id: "type",
|
|
1239
1327
|
value: "VOUCHER",
|
|
@@ -1242,8 +1330,8 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1242
1330
|
]),
|
|
1243
1331
|
label: e(me).VOUCHER.name
|
|
1244
1332
|
}, null, 8, ["label"]),
|
|
1245
|
-
|
|
1246
|
-
onClick:
|
|
1333
|
+
i(ie, {
|
|
1334
|
+
onClick: n[14] || (n[14] = (F) => a.value = [
|
|
1247
1335
|
{
|
|
1248
1336
|
id: "type",
|
|
1249
1337
|
value: "TITLE",
|
|
@@ -1256,98 +1344,98 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1256
1344
|
_: 1
|
|
1257
1345
|
}, 8, ["label"])
|
|
1258
1346
|
]),
|
|
1259
|
-
|
|
1260
|
-
modelValue: e(
|
|
1261
|
-
"onUpdate:modelValue":
|
|
1347
|
+
i(ge, {
|
|
1348
|
+
modelValue: e(K),
|
|
1349
|
+
"onUpdate:modelValue": n[15] || (n[15] = (F) => oe(K) ? K.value = F : null),
|
|
1262
1350
|
selection: "multiple",
|
|
1263
|
-
"column-filter": e(
|
|
1264
|
-
"column-defs":
|
|
1265
|
-
"row-data": e(
|
|
1266
|
-
(
|
|
1351
|
+
"column-filter": e(a),
|
|
1352
|
+
"column-defs": V,
|
|
1353
|
+
"row-data": e(S).filter(
|
|
1354
|
+
(F) => !e(t).isFeedvibe || F.collectible.type == "VOUCHER"
|
|
1267
1355
|
),
|
|
1268
|
-
"hide-footer": e(
|
|
1356
|
+
"hide-footer": e(S).length <= 10
|
|
1269
1357
|
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
|
|
1270
|
-
|
|
1358
|
+
i(P, {
|
|
1271
1359
|
text: e(G)(e(d), "titles"),
|
|
1272
1360
|
state: e(J)(e(d), "titles")
|
|
1273
1361
|
}, null, 8, ["text", "state"])
|
|
1274
1362
|
]),
|
|
1275
|
-
x("div",
|
|
1276
|
-
x("div",
|
|
1277
|
-
|
|
1363
|
+
x("div", dn, L(e(r)("connect.store.bundle.edit.advanceSetting")), 1),
|
|
1364
|
+
x("div", un, [
|
|
1365
|
+
i(C, {
|
|
1278
1366
|
"model-value": e(t).internal ?? !1,
|
|
1279
|
-
"onUpdate:modelValue":
|
|
1367
|
+
"onUpdate:modelValue": n[16] || (n[16] = (F) => e(t).internal = F),
|
|
1280
1368
|
"label-placement": "right",
|
|
1281
|
-
label: e(
|
|
1282
|
-
sublabel: e(
|
|
1369
|
+
label: e(r)("connect.store.bundle.edit.internalBundle"),
|
|
1370
|
+
sublabel: e(r)("connect.store.bundle.edit.internalBundleDescription")
|
|
1283
1371
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1284
|
-
|
|
1372
|
+
i(C, {
|
|
1285
1373
|
"model-value": e(t).hideInPos ?? !1,
|
|
1286
|
-
"onUpdate:modelValue":
|
|
1374
|
+
"onUpdate:modelValue": n[17] || (n[17] = (F) => e(t).hideInPos = F),
|
|
1287
1375
|
"label-placement": "right",
|
|
1288
|
-
label: e(
|
|
1289
|
-
sublabel: e(
|
|
1376
|
+
label: e(r)("connect.store.bundle.edit.hideInPos"),
|
|
1377
|
+
sublabel: e(r)("connect.store.bundle.edit.hideInPosDescription")
|
|
1290
1378
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1291
|
-
|
|
1292
|
-
"model-value": ((
|
|
1293
|
-
"onUpdate:modelValue":
|
|
1294
|
-
label: e(
|
|
1379
|
+
i(H, {
|
|
1380
|
+
"model-value": ((Ne = (Be = e(t).config) == null ? void 0 : Be.options) == null ? void 0 : Ne.maxPerUser) || null,
|
|
1381
|
+
"onUpdate:modelValue": n[18] || (n[18] = (F) => e(ue).set(e(t), "config.options.maxPerUser", F)),
|
|
1382
|
+
label: e(r)("connect.store.bundle.edit.maxPerUser"),
|
|
1295
1383
|
"show-steppers": !1,
|
|
1296
1384
|
placeholder: "Unlimited"
|
|
1297
1385
|
}, null, 8, ["model-value", "label"])
|
|
1298
1386
|
])
|
|
1299
|
-
])) :
|
|
1387
|
+
])) : M("", !0)
|
|
1300
1388
|
];
|
|
1301
1389
|
}),
|
|
1302
1390
|
_: 1
|
|
1303
1391
|
}, 8, ["modelValue", "header"]);
|
|
1304
1392
|
};
|
|
1305
1393
|
}
|
|
1306
|
-
}),
|
|
1394
|
+
}), pn = { class: "flex gap-8 items-center flex-wrap" }, yn = { class: "flex items-center gap-8" }, fn = /* @__PURE__ */ ee({
|
|
1307
1395
|
__name: "SendBundleSheet",
|
|
1308
1396
|
emits: ["success"],
|
|
1309
|
-
setup(v, { expose: _, emit:
|
|
1310
|
-
const { minor: f } = Ee,
|
|
1397
|
+
setup(v, { expose: _, emit: l }) {
|
|
1398
|
+
const { minor: f } = Ee, r = R(), b = R(""), o = R(""), m = R([]), u = R(!1), t = R();
|
|
1311
1399
|
R(!0);
|
|
1312
|
-
function c(
|
|
1313
|
-
u.value = !0, b.value = null,
|
|
1400
|
+
function c(S) {
|
|
1401
|
+
u.value = !0, b.value = null, o.value = "", r.value = S.bundle;
|
|
1314
1402
|
}
|
|
1315
1403
|
function y() {
|
|
1316
1404
|
u.value = !1;
|
|
1317
1405
|
}
|
|
1318
|
-
async function d(
|
|
1406
|
+
async function d(S) {
|
|
1319
1407
|
const w = await ut.read({
|
|
1320
1408
|
limit: 25,
|
|
1321
1409
|
skip: 0,
|
|
1322
1410
|
sortBy: "_id",
|
|
1323
|
-
search:
|
|
1411
|
+
search: S,
|
|
1324
1412
|
descending: !1
|
|
1325
1413
|
});
|
|
1326
|
-
m.value = w.resources.map((
|
|
1327
|
-
label: `${
|
|
1328
|
-
value:
|
|
1329
|
-
})), await new Promise((
|
|
1414
|
+
m.value = w.resources.map((D) => ({
|
|
1415
|
+
label: `${D.name} (${D.phoneNumber})`,
|
|
1416
|
+
value: D._id
|
|
1417
|
+
})), await new Promise((D) => setTimeout(D, 100));
|
|
1330
1418
|
}
|
|
1331
|
-
async function
|
|
1332
|
-
if (!
|
|
1333
|
-
const
|
|
1334
|
-
(
|
|
1419
|
+
async function V() {
|
|
1420
|
+
if (!r.value || !b.value) return;
|
|
1421
|
+
const S = m.value.find(
|
|
1422
|
+
(D) => D.value === b.value
|
|
1335
1423
|
);
|
|
1336
|
-
await
|
|
1337
|
-
`Are you sure you want to send bundle ${
|
|
1424
|
+
await xe.confirm(
|
|
1425
|
+
`Are you sure you want to send bundle ${r.value.name} to ${S == null ? void 0 : S.label}?`,
|
|
1338
1426
|
"Confirm",
|
|
1339
1427
|
"Confirm",
|
|
1340
1428
|
"Cancel"
|
|
1341
1429
|
) && await f(
|
|
1342
1430
|
async () => {
|
|
1343
|
-
const
|
|
1344
|
-
bundle:
|
|
1431
|
+
const D = {
|
|
1432
|
+
bundle: r.value._id,
|
|
1345
1433
|
member: b.value,
|
|
1346
|
-
source:
|
|
1347
|
-
ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${
|
|
1434
|
+
source: nt.enum.ADMIN,
|
|
1435
|
+
ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
|
|
1348
1436
|
withCoin: !1
|
|
1349
1437
|
};
|
|
1350
|
-
await
|
|
1438
|
+
await Ce.sendBundle(D), y();
|
|
1351
1439
|
},
|
|
1352
1440
|
{
|
|
1353
1441
|
message: "Sending bundle",
|
|
@@ -1355,100 +1443,100 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1355
1443
|
}
|
|
1356
1444
|
);
|
|
1357
1445
|
}
|
|
1358
|
-
const
|
|
1359
|
-
var w,
|
|
1360
|
-
const
|
|
1361
|
-
return ((w =
|
|
1362
|
-
`${
|
|
1363
|
-
), (
|
|
1446
|
+
const a = j(() => {
|
|
1447
|
+
var w, D, Y;
|
|
1448
|
+
const S = [];
|
|
1449
|
+
return ((w = r.value) == null ? void 0 : w.price.amount) > 0 && S.push(
|
|
1450
|
+
`${N.Config.getCountry().currency.symbol}${je((D = r.value) == null ? void 0 : D.price)}`
|
|
1451
|
+
), (Y = r.value) != null && Y.coinPrice && S.push(`${r.value.coinPrice} point(s)`), S.join(" or ");
|
|
1364
1452
|
});
|
|
1365
1453
|
return _({
|
|
1366
1454
|
showSheet: c,
|
|
1367
1455
|
hideSheet: y
|
|
1368
1456
|
}), fe(async () => {
|
|
1369
1457
|
await d("");
|
|
1370
|
-
}), (
|
|
1371
|
-
const
|
|
1372
|
-
return g(), I(
|
|
1458
|
+
}), (S, w) => {
|
|
1459
|
+
const D = h("FmCardMedia"), Y = h("FmCardHeader"), z = h("FmChip"), K = h("FmCardSection"), W = h("FmCard"), ae = h("FmSelect"), s = h("FmTextField"), k = h("FmForm"), U = h("FmButton"), O = h("FmSideSheet");
|
|
1460
|
+
return g(), I(O, {
|
|
1373
1461
|
"max-width": 560,
|
|
1374
1462
|
"dismiss-away": !0,
|
|
1375
1463
|
header: "Send bundle to member",
|
|
1376
1464
|
modelValue: e(u),
|
|
1377
1465
|
"onUpdate:modelValue": [
|
|
1378
|
-
w[4] || (w[4] = (
|
|
1379
|
-
w[5] || (w[5] = (
|
|
1466
|
+
w[4] || (w[4] = ($) => oe(u) ? u.value = $ : null),
|
|
1467
|
+
w[5] || (w[5] = ($) => u.value = $)
|
|
1380
1468
|
]
|
|
1381
1469
|
}, {
|
|
1382
1470
|
"side-sheet-footer": T(() => [
|
|
1383
|
-
x("div",
|
|
1384
|
-
|
|
1471
|
+
x("div", yn, [
|
|
1472
|
+
i(U, {
|
|
1385
1473
|
label: "Send",
|
|
1386
|
-
loading: e(
|
|
1474
|
+
loading: e(Se)().isLoading,
|
|
1387
1475
|
onClick: w[2] || (w[2] = async () => {
|
|
1388
|
-
var
|
|
1389
|
-
return (
|
|
1476
|
+
var $;
|
|
1477
|
+
return ($ = e(t)) == null ? void 0 : $.validateInputs();
|
|
1390
1478
|
})
|
|
1391
1479
|
}, null, 8, ["loading"]),
|
|
1392
|
-
|
|
1480
|
+
i(U, {
|
|
1393
1481
|
label: "Cancel",
|
|
1394
1482
|
type: "button",
|
|
1395
1483
|
variant: "tertiary",
|
|
1396
|
-
onClick: w[3] || (w[3] = (
|
|
1484
|
+
onClick: w[3] || (w[3] = ($) => u.value = !1)
|
|
1397
1485
|
})
|
|
1398
1486
|
])
|
|
1399
1487
|
]),
|
|
1400
1488
|
default: T(() => [
|
|
1401
|
-
|
|
1489
|
+
i(k, {
|
|
1402
1490
|
class: "space-y-16",
|
|
1403
1491
|
ref_key: "form",
|
|
1404
1492
|
ref: t,
|
|
1405
|
-
onValidationSuccess:
|
|
1493
|
+
onValidationSuccess: V,
|
|
1406
1494
|
blameFormChildOnValidationFailed: ""
|
|
1407
1495
|
}, {
|
|
1408
1496
|
default: T(() => [
|
|
1409
|
-
|
|
1497
|
+
i(W, {
|
|
1410
1498
|
class: "max-w-[700px]",
|
|
1411
1499
|
horizontal: "",
|
|
1412
1500
|
variant: "outlined"
|
|
1413
1501
|
}, {
|
|
1414
1502
|
default: T(() => {
|
|
1415
|
-
var
|
|
1503
|
+
var $, A;
|
|
1416
1504
|
return [
|
|
1417
|
-
(
|
|
1505
|
+
($ = e(r)) != null && $.image ? (g(), I(D, {
|
|
1418
1506
|
key: 0,
|
|
1419
1507
|
width: "100",
|
|
1420
|
-
src: (
|
|
1421
|
-
}, null, 8, ["src"])) :
|
|
1422
|
-
|
|
1508
|
+
src: (A = e(r)) == null ? void 0 : A.image
|
|
1509
|
+
}, null, 8, ["src"])) : M("", !0),
|
|
1510
|
+
i(K, { class: "flex flex-col gap-16 justify-between" }, {
|
|
1423
1511
|
default: T(() => {
|
|
1424
1512
|
var p;
|
|
1425
1513
|
return [
|
|
1426
|
-
|
|
1514
|
+
i(Y, {
|
|
1427
1515
|
class: "p-0",
|
|
1428
|
-
title: (p = e(
|
|
1429
|
-
subtitle: e(
|
|
1516
|
+
title: (p = e(r)) == null ? void 0 : p.name,
|
|
1517
|
+
subtitle: e(a)
|
|
1430
1518
|
}, null, 8, ["title", "subtitle"]),
|
|
1431
|
-
|
|
1519
|
+
i(K, { class: "p-0" }, {
|
|
1432
1520
|
default: T(() => {
|
|
1433
|
-
var
|
|
1521
|
+
var n, C, P, E, q, H, ie, ge, ce, ve, le;
|
|
1434
1522
|
return [
|
|
1435
|
-
x("div",
|
|
1436
|
-
(
|
|
1523
|
+
x("div", pn, [
|
|
1524
|
+
(n = e(r)) != null && n.isFeedvibe ? (g(), I(z, {
|
|
1437
1525
|
key: 0,
|
|
1438
1526
|
label: "Feedvibe"
|
|
1439
|
-
})) :
|
|
1440
|
-
(
|
|
1527
|
+
})) : M("", !0),
|
|
1528
|
+
(P = (C = e(r)) == null ? void 0 : C.titles) != null && P.length ? (g(), I(z, {
|
|
1441
1529
|
key: 1,
|
|
1442
|
-
label: `${e(
|
|
1443
|
-
}, null, 8, ["label"])) :
|
|
1444
|
-
(
|
|
1530
|
+
label: `${e(r).titles.length} title(s)`
|
|
1531
|
+
}, null, 8, ["label"])) : M("", !0),
|
|
1532
|
+
(q = (E = e(r)) == null ? void 0 : E.vouchers) != null && q.length ? (g(), I(z, {
|
|
1445
1533
|
key: 2,
|
|
1446
|
-
label: `${e(
|
|
1447
|
-
}, null, 8, ["label"])) :
|
|
1448
|
-
(ie = (
|
|
1534
|
+
label: `${e(r).vouchers.length} voucher(s)`
|
|
1535
|
+
}, null, 8, ["label"])) : M("", !0),
|
|
1536
|
+
(ie = (H = e(r)) == null ? void 0 : H.credit) != null && ie.normal || (ve = (ce = (ge = e(r)) == null ? void 0 : ge.credit) == null ? void 0 : ce.free) != null && ve.amount ? (g(), I(z, {
|
|
1449
1537
|
key: 3,
|
|
1450
|
-
label: `${(e(
|
|
1451
|
-
}, null, 8, ["label"])) :
|
|
1538
|
+
label: `${(e(r).credit.normal || 0) + (((le = e(r).credit.free) == null ? void 0 : le.amount) || 0)} credit(s)`
|
|
1539
|
+
}, null, 8, ["label"])) : M("", !0)
|
|
1452
1540
|
])
|
|
1453
1541
|
];
|
|
1454
1542
|
}),
|
|
@@ -1462,22 +1550,22 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1462
1550
|
}),
|
|
1463
1551
|
_: 1
|
|
1464
1552
|
}),
|
|
1465
|
-
|
|
1553
|
+
i(ae, {
|
|
1466
1554
|
modelValue: e(b),
|
|
1467
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
1555
|
+
"onUpdate:modelValue": w[0] || (w[0] = ($) => oe(b) ? b.value = $ : null),
|
|
1468
1556
|
label: "Select member",
|
|
1469
1557
|
searchable: "",
|
|
1470
1558
|
items: e(m),
|
|
1471
1559
|
onSearch: d,
|
|
1472
|
-
rules: [(
|
|
1560
|
+
rules: [($) => !!$ > 0 || "Member is required"],
|
|
1473
1561
|
"helper-text": "Type to search member"
|
|
1474
1562
|
}, null, 8, ["modelValue", "items", "rules"]),
|
|
1475
|
-
|
|
1476
|
-
modelValue: e(
|
|
1477
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
1563
|
+
i(s, {
|
|
1564
|
+
modelValue: e(o),
|
|
1565
|
+
"onUpdate:modelValue": w[1] || (w[1] = ($) => oe(o) ? o.value = $ : null),
|
|
1478
1566
|
label: "Reference (optional)",
|
|
1479
1567
|
rules: [
|
|
1480
|
-
(
|
|
1568
|
+
($) => $.length < 50 || "Reference must be less than 50 characters"
|
|
1481
1569
|
]
|
|
1482
1570
|
}, null, 8, ["modelValue", "rules"])
|
|
1483
1571
|
]),
|
|
@@ -1489,115 +1577,115 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1489
1577
|
};
|
|
1490
1578
|
}
|
|
1491
1579
|
});
|
|
1492
|
-
var
|
|
1493
|
-
const
|
|
1494
|
-
src:
|
|
1580
|
+
var bn = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1581
|
+
const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8 items-center" }, hn = { class: "fm-typo-en-body-lg-600" }, _n = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, xn = /* @__PURE__ */ x("img", {
|
|
1582
|
+
src: Ye,
|
|
1495
1583
|
class: "aspect-square w-[150px]"
|
|
1496
|
-
}, null, -1),
|
|
1584
|
+
}, null, -1), Cn = { class: "flex flex-col gap-16 text-center" }, Sn = { class: "fm-typo-en-title-sm-800" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qn = /* @__PURE__ */ ee({
|
|
1497
1585
|
__name: "Store",
|
|
1498
1586
|
setup(v) {
|
|
1499
1587
|
const _ = {
|
|
1500
1588
|
label: "Setup payout account",
|
|
1501
1589
|
value: "payout",
|
|
1502
1590
|
isPrimary: !1
|
|
1503
|
-
}, { t:
|
|
1504
|
-
label:
|
|
1591
|
+
}, { t: l } = be(), f = {
|
|
1592
|
+
label: l("connect.store.actions.setting"),
|
|
1505
1593
|
value: "setting",
|
|
1506
1594
|
isPrimary: !1
|
|
1507
|
-
},
|
|
1508
|
-
label:
|
|
1595
|
+
}, r = {
|
|
1596
|
+
label: l("connect.store.actions.manageReward"),
|
|
1509
1597
|
value: "create_reward"
|
|
1510
1598
|
}, b = {
|
|
1511
|
-
label:
|
|
1599
|
+
label: l("connect.store.actions.addCategory"),
|
|
1512
1600
|
value: "create_category",
|
|
1513
1601
|
isPrimary: !0,
|
|
1514
1602
|
prependIcon: "add"
|
|
1515
|
-
},
|
|
1603
|
+
}, o = R(), m = ct(), u = ke(), { global: t, minor: c } = Ee, y = Me(), d = j(() => u.sortedStoreCategories), V = j(() => u.sortedStoreCategories.map((s) => s.name)), a = R(), S = R();
|
|
1516
1604
|
async function w(s) {
|
|
1517
|
-
var
|
|
1518
|
-
s === "setting" ? (
|
|
1605
|
+
var k;
|
|
1606
|
+
s === "setting" ? (k = a.value) == null || k.showSheet(!0, u.storeOption) : s === "create_category" ? Y(-1) : s === "create_reward" ? await m.push({ name: Ze["$connect-STORE_REWARDS"] }) : s == "payout" && window.open(bn.paymentPortalUrl, "_blank");
|
|
1519
1607
|
}
|
|
1520
|
-
async function
|
|
1608
|
+
async function D(s) {
|
|
1521
1609
|
await c(
|
|
1522
1610
|
async () => {
|
|
1523
|
-
var
|
|
1524
|
-
await
|
|
1611
|
+
var k;
|
|
1612
|
+
await Ce.updateStore(s), await u.readMemberStore(), (k = a.value) == null || k.showSheet(!1);
|
|
1525
1613
|
},
|
|
1526
1614
|
{
|
|
1527
|
-
message:
|
|
1528
|
-
successMessage:
|
|
1615
|
+
message: l("connect.store.setting.update.message"),
|
|
1616
|
+
successMessage: l("connect.store.setting.update.success")
|
|
1529
1617
|
}
|
|
1530
1618
|
);
|
|
1531
1619
|
}
|
|
1532
|
-
async function
|
|
1533
|
-
var
|
|
1534
|
-
if ((!u.storeOption || !u.storeOption.company) && await
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1620
|
+
async function Y(s = -1) {
|
|
1621
|
+
var k, U;
|
|
1622
|
+
if ((!u.storeOption || !u.storeOption.company) && await xe.confirm(
|
|
1623
|
+
l("connect.store.category.setup.title"),
|
|
1624
|
+
l("connect.store.category.setup.button"),
|
|
1625
|
+
l("connect.store.category.setup.action"),
|
|
1626
|
+
l("connect.common.cancel")
|
|
1539
1627
|
))
|
|
1540
|
-
return (
|
|
1628
|
+
return (k = a.value) == null ? void 0 : k.showSheet(!0);
|
|
1541
1629
|
y.open({
|
|
1542
|
-
title: s == -1 ?
|
|
1543
|
-
contentComponent:
|
|
1630
|
+
title: s == -1 ? l("connect.store.category.add") : l("connect.store.category.edit"),
|
|
1631
|
+
contentComponent: kt,
|
|
1544
1632
|
contentComponentProps: {
|
|
1545
1633
|
initialValue: ((U = d.value[s]) == null ? void 0 : U.name) ?? "",
|
|
1546
1634
|
action: s == -1 ? "add" : "edit"
|
|
1547
1635
|
}
|
|
1548
|
-
}).onPrimary(async (
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1636
|
+
}).onPrimary(async (O) => {
|
|
1637
|
+
O === null && !await xe.remove(
|
|
1638
|
+
l("connect.store.category.remove.confirm"),
|
|
1639
|
+
l("connect.store.category.remove.title")
|
|
1552
1640
|
) || await c(
|
|
1553
1641
|
async () => {
|
|
1554
|
-
const
|
|
1555
|
-
await
|
|
1556
|
-
categories:
|
|
1642
|
+
const $ = s == -1 ? [...d.value, { name: O, bundles: [] }] : [...d.value].map((A, p) => p == s ? { ...A, name: O } : A).filter((A) => A.name !== null);
|
|
1643
|
+
await Ce.updateStoreBundle({
|
|
1644
|
+
categories: $
|
|
1557
1645
|
}), await u.readMemberStore();
|
|
1558
1646
|
},
|
|
1559
1647
|
{
|
|
1560
|
-
message:
|
|
1561
|
-
successMessage:
|
|
1648
|
+
message: O === null ? l("connect.store.category.update.deleting") : s == -1 ? l("connect.store.category.update.creating") : l("connect.store.category.update.updating"),
|
|
1649
|
+
successMessage: O === null ? l("connect.store.category.update.success.deleted") : s == -1 ? l("connect.store.category.update.success.created") : l("connect.store.category.update.success.updated")
|
|
1562
1650
|
}
|
|
1563
1651
|
);
|
|
1564
1652
|
});
|
|
1565
1653
|
}
|
|
1566
|
-
async function
|
|
1567
|
-
var p,
|
|
1568
|
-
|
|
1569
|
-
const
|
|
1570
|
-
for (const
|
|
1571
|
-
for (const E of
|
|
1654
|
+
async function z(s, k, U, O) {
|
|
1655
|
+
var p, n, C;
|
|
1656
|
+
k ?? (k = (p = S.value) == null ? void 0 : p.target.category), U ?? (U = (n = S.value) == null ? void 0 : n.target.index), O ?? (O = (C = S.value) == null ? void 0 : C.target.originalCategoryIndex);
|
|
1657
|
+
const $ = De(d.value);
|
|
1658
|
+
for (const P of $)
|
|
1659
|
+
for (const E of P.bundles)
|
|
1572
1660
|
console.log(E, "bundle in payload"), "pf_vouchers" in E && delete E.pf_vouchers;
|
|
1573
|
-
|
|
1574
|
-
const
|
|
1575
|
-
if (!
|
|
1661
|
+
k != O && ($[O].bundles.splice(U, 1), U = $[k].bundles.length), console.log(k, U, O, "ci, bi, originalCategoryIndex");
|
|
1662
|
+
const A = $[k];
|
|
1663
|
+
if (!A) {
|
|
1576
1664
|
Ge.error("Unexpected error", 2e3);
|
|
1577
1665
|
return;
|
|
1578
1666
|
}
|
|
1579
1667
|
if (s == null) {
|
|
1580
|
-
if (await
|
|
1668
|
+
if (await xe.remove(
|
|
1581
1669
|
"Are you sure you want to delete this bundle?",
|
|
1582
1670
|
"Delete bundle"
|
|
1583
1671
|
) == !1)
|
|
1584
1672
|
return;
|
|
1585
|
-
|
|
1673
|
+
A.bundles.splice(U, 1);
|
|
1586
1674
|
} else
|
|
1587
|
-
U == -1 ?
|
|
1675
|
+
U == -1 ? A.bundles.push(s) : A.bundles[U] = s;
|
|
1588
1676
|
await c(
|
|
1589
1677
|
async () => {
|
|
1590
|
-
var
|
|
1678
|
+
var P, E;
|
|
1591
1679
|
if (s != null) {
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
Fe.bundleImagePath(void 0,
|
|
1595
|
-
|
|
1680
|
+
const q = (P = S.value) == null ? void 0 : P.bundleImage;
|
|
1681
|
+
q === null && s.image ? (await Fe.delete(s.image), s.image = null) : q && (s.image = await Fe.update(
|
|
1682
|
+
Fe.bundleImagePath(void 0, q),
|
|
1683
|
+
q
|
|
1596
1684
|
));
|
|
1597
1685
|
}
|
|
1598
|
-
await
|
|
1599
|
-
categories:
|
|
1600
|
-
}), await u.readMemberStore(), await u.readMembership(), await u.readRewards(), (E =
|
|
1686
|
+
await Ce.updateStoreBundle({
|
|
1687
|
+
categories: $
|
|
1688
|
+
}), await u.readMemberStore(), await u.readMembership(), await u.readRewards(), (E = S.value) == null || E.showSheet(!1);
|
|
1601
1689
|
},
|
|
1602
1690
|
{
|
|
1603
1691
|
message: `${s == null ? "Deleting" : U == -1 ? "Creating" : "Updating"} bundle`,
|
|
@@ -1605,45 +1693,45 @@ const go = { class: "px-24 flex flex-col gap-y-16" }, vo = { class: "flex gap-8
|
|
|
1605
1693
|
}
|
|
1606
1694
|
);
|
|
1607
1695
|
}
|
|
1608
|
-
function
|
|
1609
|
-
var
|
|
1610
|
-
(
|
|
1696
|
+
function K(s) {
|
|
1697
|
+
var k;
|
|
1698
|
+
(k = S.value) == null || k.showSheet(!0, {
|
|
1611
1699
|
...s,
|
|
1612
|
-
bundle: s.bundle ?
|
|
1700
|
+
bundle: s.bundle ? De(s.bundle) : void 0
|
|
1613
1701
|
});
|
|
1614
1702
|
}
|
|
1615
|
-
const
|
|
1616
|
-
function
|
|
1617
|
-
var
|
|
1618
|
-
(
|
|
1703
|
+
const W = R([]);
|
|
1704
|
+
function ae(s) {
|
|
1705
|
+
var k;
|
|
1706
|
+
(k = o.value) == null || k.showSheet({
|
|
1619
1707
|
bundle: s
|
|
1620
1708
|
});
|
|
1621
1709
|
}
|
|
1622
1710
|
return fe(async () => {
|
|
1623
|
-
var s,
|
|
1711
|
+
var s, k;
|
|
1624
1712
|
await t(async () => {
|
|
1625
|
-
var U,
|
|
1713
|
+
var U, O;
|
|
1626
1714
|
if (await u.readMemberStore(), await u.readMembership(), await u.readRewards(), await u.readPayoutAccount(), (U = m.currentRoute.value.query) != null && U.action) {
|
|
1627
|
-
switch ((
|
|
1715
|
+
switch ((O = m.currentRoute.value.query) == null ? void 0 : O.action) {
|
|
1628
1716
|
case "update_setting":
|
|
1629
1717
|
w("setting");
|
|
1630
1718
|
break;
|
|
1631
1719
|
case "create_category":
|
|
1632
|
-
|
|
1720
|
+
Y(-1);
|
|
1633
1721
|
break;
|
|
1634
1722
|
case "create_feedvibe_bundle":
|
|
1635
1723
|
y.open({
|
|
1636
1724
|
title: "Select category",
|
|
1637
1725
|
contentComponent: Ut
|
|
1638
|
-
}).onPrimary((
|
|
1639
|
-
y.close(),
|
|
1640
|
-
categories:
|
|
1641
|
-
category:
|
|
1726
|
+
}).onPrimary(($) => {
|
|
1727
|
+
y.close(), K({
|
|
1728
|
+
categories: V.value,
|
|
1729
|
+
category: $,
|
|
1642
1730
|
index: -1,
|
|
1643
1731
|
bundle: {
|
|
1644
|
-
...ue.cloneDeep(
|
|
1732
|
+
...ue.cloneDeep(Ve),
|
|
1645
1733
|
isFeedvibe: !0,
|
|
1646
|
-
price:
|
|
1734
|
+
price: N.Dinero.fromNumber({
|
|
1647
1735
|
number: 10,
|
|
1648
1736
|
precision: 2
|
|
1649
1737
|
}).toObject()
|
|
@@ -1654,91 +1742,91 @@ const go = { class: "px-24 flex flex-col gap-y-16" }, vo = { class: "flex gap-8
|
|
|
1654
1742
|
}
|
|
1655
1743
|
m.replace({ query: {} });
|
|
1656
1744
|
}
|
|
1657
|
-
}),
|
|
1745
|
+
}), W.value = [f, r, b], (((s = u.payoutAccount) == null ? void 0 : s.status) != "APPROVED" || ((k = u.payoutAccount) == null ? void 0 : k.enable) != !0) && (W.value = [
|
|
1658
1746
|
_,
|
|
1659
1747
|
f,
|
|
1660
|
-
|
|
1748
|
+
r,
|
|
1661
1749
|
b
|
|
1662
1750
|
]);
|
|
1663
|
-
}), (s,
|
|
1664
|
-
const U = h("FmPageHead"),
|
|
1665
|
-
return g(),
|
|
1666
|
-
|
|
1667
|
-
title: e(
|
|
1668
|
-
actions: e(
|
|
1751
|
+
}), (s, k) => {
|
|
1752
|
+
const U = h("FmPageHead"), O = h("FmButton"), $ = h("FmCard");
|
|
1753
|
+
return g(), B(X, null, [
|
|
1754
|
+
i(U, {
|
|
1755
|
+
title: e(l)("connect.store.title"),
|
|
1756
|
+
actions: e(W),
|
|
1669
1757
|
"onClick:action": w
|
|
1670
1758
|
}, null, 8, ["title", "actions"]),
|
|
1671
|
-
x("div",
|
|
1672
|
-
e(d) && e(d).length > 0 ? (g(),
|
|
1673
|
-
(g(!0),
|
|
1674
|
-
key:
|
|
1759
|
+
x("div", gn, [
|
|
1760
|
+
e(d) && e(d).length > 0 ? (g(), B(X, { key: 0 }, [
|
|
1761
|
+
(g(!0), B(X, null, re(e(d), (A, p) => (g(), B("div", {
|
|
1762
|
+
key: A.name,
|
|
1675
1763
|
class: "space-y-8 py-12"
|
|
1676
1764
|
}, [
|
|
1677
|
-
x("div",
|
|
1678
|
-
x("div",
|
|
1679
|
-
|
|
1680
|
-
|
|
1765
|
+
x("div", vn, [
|
|
1766
|
+
x("div", hn, L(A.name), 1),
|
|
1767
|
+
i(Pe, { json: A }, null, 8, ["json"]),
|
|
1768
|
+
i(O, {
|
|
1681
1769
|
icon: "edit",
|
|
1682
1770
|
size: "md",
|
|
1683
1771
|
variant: "tertiary",
|
|
1684
|
-
onClick: (
|
|
1772
|
+
onClick: (n) => Y(p)
|
|
1685
1773
|
}, null, 8, ["onClick"])
|
|
1686
1774
|
]),
|
|
1687
|
-
x("div",
|
|
1688
|
-
(g(!0),
|
|
1689
|
-
bundle:
|
|
1690
|
-
key:
|
|
1691
|
-
onEdit: (
|
|
1692
|
-
bundle:
|
|
1775
|
+
x("div", _n, [
|
|
1776
|
+
(g(!0), B(X, null, re(A.bundles, (n, C) => (g(), I(Ct, {
|
|
1777
|
+
bundle: n,
|
|
1778
|
+
key: n._id,
|
|
1779
|
+
onEdit: (P) => K({
|
|
1780
|
+
bundle: n,
|
|
1693
1781
|
category: p,
|
|
1694
1782
|
index: C,
|
|
1695
|
-
categories: e(
|
|
1783
|
+
categories: e(V)
|
|
1696
1784
|
}),
|
|
1697
|
-
onDelete: (
|
|
1698
|
-
onSend:
|
|
1785
|
+
onDelete: (P) => z(null, p, C),
|
|
1786
|
+
onSend: ae
|
|
1699
1787
|
}, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
|
|
1700
|
-
|
|
1701
|
-
onCreate: (
|
|
1788
|
+
i(St, {
|
|
1789
|
+
onCreate: (n) => K({
|
|
1702
1790
|
category: p,
|
|
1703
1791
|
index: -1,
|
|
1704
|
-
categories: e(
|
|
1792
|
+
categories: e(V)
|
|
1705
1793
|
})
|
|
1706
1794
|
}, null, 8, ["onCreate"])
|
|
1707
1795
|
])
|
|
1708
1796
|
]))), 128)),
|
|
1709
|
-
|
|
1797
|
+
i(mn, {
|
|
1710
1798
|
ref_key: "bundleSheetRef",
|
|
1711
|
-
ref:
|
|
1712
|
-
onUpdate:
|
|
1799
|
+
ref: S,
|
|
1800
|
+
onUpdate: z
|
|
1713
1801
|
}, null, 512)
|
|
1714
|
-
], 64)) : (g(), I(
|
|
1802
|
+
], 64)) : (g(), I($, {
|
|
1715
1803
|
key: 1,
|
|
1716
1804
|
variant: "outlined",
|
|
1717
1805
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
1718
1806
|
}, {
|
|
1719
1807
|
default: T(() => [
|
|
1720
|
-
|
|
1721
|
-
x("div",
|
|
1722
|
-
x("div",
|
|
1723
|
-
x("div",
|
|
1808
|
+
xn,
|
|
1809
|
+
x("div", Cn, [
|
|
1810
|
+
x("div", Sn, L(e(l)("connect.store.bundle.title")), 1),
|
|
1811
|
+
x("div", Fn, L(e(l)("connect.store.bundle.description")), 1)
|
|
1724
1812
|
]),
|
|
1725
|
-
|
|
1813
|
+
i(O, {
|
|
1726
1814
|
variant: "primary",
|
|
1727
|
-
label: e(
|
|
1815
|
+
label: e(l)("connect.store.actions.addCategory"),
|
|
1728
1816
|
icon: "add",
|
|
1729
|
-
onClick:
|
|
1817
|
+
onClick: k[0] || (k[0] = (A) => Y(-1))
|
|
1730
1818
|
}, null, 8, ["label"])
|
|
1731
1819
|
]),
|
|
1732
1820
|
_: 1
|
|
1733
1821
|
})),
|
|
1734
|
-
|
|
1822
|
+
i(Jt, {
|
|
1735
1823
|
ref_key: "settingSheetRef",
|
|
1736
|
-
ref:
|
|
1737
|
-
onUpdate:
|
|
1824
|
+
ref: a,
|
|
1825
|
+
onUpdate: D
|
|
1738
1826
|
}, null, 512),
|
|
1739
|
-
|
|
1827
|
+
i(fn, {
|
|
1740
1828
|
ref_key: "sendBundleSheetRef",
|
|
1741
|
-
ref:
|
|
1829
|
+
ref: o
|
|
1742
1830
|
}, null, 512)
|
|
1743
1831
|
])
|
|
1744
1832
|
], 64);
|
|
@@ -1746,5 +1834,5 @@ const go = { class: "px-24 flex flex-col gap-y-16" }, vo = { class: "flex gap-8
|
|
|
1746
1834
|
}
|
|
1747
1835
|
});
|
|
1748
1836
|
export {
|
|
1749
|
-
|
|
1837
|
+
Qn as default
|
|
1750
1838
|
};
|