@feedmepos/mf-connect 0.1.76-prod → 0.1.78-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-Bu23TSdC.js → Analytic-CL8baBRg.js} +11 -11
- package/dist/{App-CFovt5At.js → App-DWrlRXyT.js} +7 -7
- package/dist/{Bin-BTZ0CGHi.js → Bin-B20xJPE8.js} +8 -8
- package/dist/{Broadcast-PLGxwGqd.js → Broadcast-CsWx4Tjg.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BP6EusQ_.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DOVdZArj.js} +6 -6
- package/dist/{Card-cHrKRkwH.js → Card-CmzFUSjw.js} +18 -18
- package/dist/{Collections-BdJKSLLq.js → Collections-CpSPvULL.js} +45 -44
- package/dist/{Credit-D1r1Sdes.js → Credit-De2OB_mb.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BB_rrikT.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DfTSheaL.js} +32 -32
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BXYIPABz.js → EffectSheet.vue_vue_type_style_index_0_lang-DB_5jfpv.js} +7 -7
- package/dist/{Experience-B8VHgHBW.js → Experience-CM8zEcnf.js} +8 -8
- package/dist/{Game-DUuF8FZi.js → Game-BFnuEizX.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BC0iTIpa.js → ImageInput.vue_vue_type_script_setup_true_lang-dsv7e6yU.js} +1 -1
- package/dist/{Index-D-kF-r95.js → Index-Bwq85y08.js} +10 -10
- package/dist/{Marketing-MM2XT5Ks.js → Marketing-D5TlEj1P.js} +6 -6
- package/dist/{Member-JePEKywx.js → Member-cbimfDJJ.js} +10 -10
- package/dist/{MemberList-Doz8RzJr.js → MemberList-Avzr02qO.js} +25 -25
- package/dist/{MemberTransactions-D3r1Shfr.js → MemberTransactions-DqHNVh2M.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Blvhn8Ve.js → MessageInput.vue_vue_type_script_setup_true_lang-DqfdpUU1.js} +8 -8
- package/dist/{Mission-Adf3hE_Q.js → Mission-BxDEA9_O.js} +9 -9
- package/dist/{Overview-D9C_ngcE.js → Overview-CDwxgoq4.js} +19 -19
- package/dist/{Point-C7YytfWh.js → Point-BGp2yObl.js} +8 -8
- package/dist/{Promotion-DLKzm-Zt.js → Promotion-BtLwPnQY.js} +9 -9
- package/dist/{Queue-BzJkaeos.js → Queue-B5yc52Fi.js} +10 -10
- package/dist/{Record-E366_Z-I.js → Record-BTJZQMcE.js} +8 -8
- package/dist/{Reward-DRqDZR_W.js → Reward-DE1IdQQP.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-mk13fdhG.js → RewardGroup.vue_vue_type_script_setup_true_lang-B5nesYsF.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CT4L602f.js → RuleGroup.vue_vue_type_script_setup_true_lang-8YjhVXHc.js} +15 -15
- package/dist/{Segment-CMBQY0Ew.js → Segment-DTL-cydj.js} +23 -23
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BJwqnJ5q.js → SelectItems.vue_vue_type_script_setup_true_lang-BhdZvJ23.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ysfMGi60.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BVD0BK7h.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DJmqtpet.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CFtgb1Xx.js} +3 -3
- package/dist/{Setting-Difs2QM2.js → Setting-DCSefbch.js} +14 -14
- package/dist/{SettingAdvertisements-nCOD94KT.js → SettingAdvertisements-B68GHFPu.js} +12 -12
- package/dist/{Store-Corm7ovM.js → Store-C5HUNrCL.js} +650 -638
- package/dist/StoreRewards-DQ3MPr5_.js +535 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DvZnfko7.js → StoreTransactions.vue_vue_type_script_setup_true_lang-fziZvSAu.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Ciy_Y3pw.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-IGFIBJK-.js} +1 -1
- package/dist/{Tier-CdG8b5i7.js → Tier-B2wfH7ov.js} +21 -21
- package/dist/{Title-HDBW1XJy.js → Title-DA02V_tW.js} +20 -20
- package/dist/{Transaction-BTdCgUTW.js → Transaction-Bcjy-XpL.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BKAixX5Q.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B01EVKWa.js} +6 -6
- package/dist/{Voucher-DXxlsMqy.js → Voucher-CMvRFukk.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-IggVStfo.js → VoucherEditor.vue_vue_type_script_setup_true_lang-hDw2GonS.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DvZJ4o-A.js → ZodTextField.vue_vue_type_script_setup_true_lang-C0SNLaTT.js} +2 -2
- package/dist/{app-BV-w2LiQ.js → app-BnwvaUjf.js} +34 -32
- package/dist/{app-XylQ73N9.js → app-Clc_fxr7.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CmK1Bgrl.js → business-DTs1RVwW.js} +1 -1
- package/dist/{campaign-BbeHkY_g.js → campaign-C-YI6eUZ.js} +1 -1
- package/dist/{campaign-B0Iu64XS.js → campaign-hjsuW70h.js} +8 -8
- package/dist/{campaign.enum-BTyjcgl5.js → campaign.enum-Y8uH9B1N.js} +1 -1
- package/dist/{campaign.fn-BRylLZN8.js → campaign.fn-CjOxPWB4.js} +32 -32
- package/dist/{collectible.enum-BaMwAovj.js → collectible.enum-FI842Eg_.js} +1 -1
- package/dist/{collection.fn-DMKcRR3s.js → collection.fn-tkZ2Jz5q.js} +2 -2
- package/dist/{dto-DWD2z5aU.js → dto-jHPSXkpQ.js} +4 -4
- package/dist/{effect-BXFkVwFt.js → effect--khp0-Dk.js} +1 -1
- package/dist/{email-addresses-CM4YhQKU.js → email-addresses-kh0JimeA.js} +1 -1
- package/dist/{export-CIH5GPPA.js → export-BpAjk801.js} +3 -3
- package/dist/{helper-Dfi5KBsu.js → helper-DrhEQHwq.js} +22 -7
- package/dist/{index-CmCHMjjj.js → index-BL3Mdvlf.js} +1 -1
- package/dist/{index-B-EJxIcf.js → index-BZrppr8k.js} +1561 -1561
- package/dist/{index-Bv3V6gFA.js → index-BmYRSyFJ.js} +6 -6
- package/dist/{index-BijInYgP.js → index-BzMFc1TL.js} +1 -1
- package/dist/{index-Cb-dmYUO.js → index-CEkk23PR.js} +1 -1
- package/dist/{index-CuYPD6KT.js → index-CjfLezA2.js} +1 -1
- package/dist/{index-CGurwPv7.js → index-D8UahMhD.js} +1 -1
- package/dist/{index-tBQVmdqJ.js → index-DUYZ2HiI.js} +1384 -1381
- package/dist/{index-DllrUMlF.js → index-Dd3r1_0V.js} +3 -3
- package/dist/{index-BMuFXYr-.js → index-DlasG3H0.js} +1 -1
- package/dist/{index-DgpNkwMC.js → index-DnyXvYsb.js} +1160 -1138
- package/dist/{index-DK5SOeWG.js → index-DuHxOBvZ.js} +3 -3
- package/dist/{index-D3EuM03E.js → index-FsB799qA.js} +1 -1
- package/dist/{index.esm2017-DaQYdqzn.js → index.esm2017-DmPf2cMZ.js} +1 -1
- package/dist/{loading-CqksxFrY.js → loading-Cce2O21E.js} +1 -1
- package/dist/{membership-DldR-rE4.js → membership-DWmspoXh.js} +3 -3
- package/dist/{money-DF9CHClT.js → money-Car_1Uu5.js} +1 -1
- package/dist/{number-BAUERN5R.js → number-BKqKRPst.js} +1 -1
- package/dist/objectid-BJMlT5vf.js +145 -0
- package/dist/{plugins-D_xP2_oh.js → plugins-DgQI-VM9.js} +3 -3
- package/dist/{reward-C_GBKqJ2.js → reward-CyDdQ3f1.js} +1 -1
- package/dist/{rule-DSqtOvSH.js → rule-AVx2VM_m.js} +3 -3
- package/dist/{rule-builder-BkLQ-LDJ.js → rule-builder-7H09UHwS.js} +1 -1
- package/dist/{template-CSnoZfH8.js → template-F0LbthP3.js} +5 -5
- package/dist/{timezone-BEtLA-7y.js → timezone-COLE0Gi_.js} +1 -1
- package/dist/{trigger-CHDwsOgx.js → trigger-CTSMJ35x.js} +5 -5
- package/dist/{user-BqlOvZQu.js → user-BQBOVBfW.js} +1 -1
- package/dist/{vue-i18n-1NETuk_J.js → vue-i18n-CN5hOv3f.js} +217 -217
- package/dist/{xlsx-CMa9ngC1.js → xlsx-RGAf1V3W.js} +1 -1
- package/dist/{zod-DuLxE9Yg.js → zod-DsTnqHJG.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreRewards-Dd9giWnX.js +0 -423
- package/dist/objectid-D8KxKrZP.js +0 -145
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { defineComponent as te, computed as L, resolveComponent as _, openBlock as h, createBlock as M, withCtx as N, createElementVNode as V, createElementBlock as D, createVNode as r, createCommentVNode as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { c as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { m as
|
|
8
|
-
import { a as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { c as de } from "./index-
|
|
11
|
-
import { u as he } from "./vue-i18n-
|
|
12
|
-
import { Z as Q, g as G, a as X } from "./zod-
|
|
13
|
-
import { z as ee, R as
|
|
1
|
+
import { defineComponent as te, computed as L, resolveComponent as _, openBlock as h, createBlock as M, withCtx as N, createElementVNode as V, createElementBlock as D, createVNode as r, createCommentVNode as E, toDisplayString as K, unref as e, Fragment as Y, renderList as ue, ref as I, isRef as se, reactive as Ye, onMounted as ve, watch as Pe, toRaw as ze, createTextVNode as ce, h as Je } from "vue";
|
|
2
|
+
import { _ as Ge } from "./tier-BJDhpH6X.js";
|
|
3
|
+
import { useDialog as Ee, useDialogChild as je, components as Xe } from "@feedmepos/ui-library";
|
|
4
|
+
import { c as A, e as Ce, S as Ze } from "./index-DuHxOBvZ.js";
|
|
5
|
+
import { u as Le } from "./loading-Cce2O21E.js";
|
|
6
|
+
import { u as Te, C as pe } from "./membership-DWmspoXh.js";
|
|
7
|
+
import { m as Qe, n as et, o as tt, p as Ae, q as nt } from "./index-DnyXvYsb.js";
|
|
8
|
+
import { a as ot, c as Fe } from "./object-qECH92oz.js";
|
|
9
|
+
import { _ as ae } from "./lodash-B5I3zXaY.js";
|
|
10
|
+
import { c as de } from "./index-BZrppr8k.js";
|
|
11
|
+
import { u as he } from "./vue-i18n-CN5hOv3f.js";
|
|
12
|
+
import { Z as Q, g as G, a as X } from "./zod-DsTnqHJG.js";
|
|
13
|
+
import { z as ee, R as at } from "./app-BnwvaUjf.js";
|
|
14
14
|
import { u as Se } from "./app-wDQR6dpb.js";
|
|
15
|
-
import { _ as
|
|
16
|
-
import { a as
|
|
17
|
-
import { J as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { _ as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { z as
|
|
22
|
-
import { F as
|
|
23
|
-
import { t as
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
27
|
-
import "./index-
|
|
28
|
-
import { m as
|
|
29
|
-
import { m as be } from "./index-
|
|
30
|
-
import { useRouter as
|
|
31
|
-
function
|
|
15
|
+
import { _ as le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-C0SNLaTT.js";
|
|
16
|
+
import { a as lt, p as ye, n as st, f as Ve } from "./plugins-DgQI-VM9.js";
|
|
17
|
+
import { J as ke } from "./JsonViewer-v8_C7l5N.js";
|
|
18
|
+
import { _ as rt } from "./index-DUYZ2HiI.js";
|
|
19
|
+
import { _ as it } from "./ImageInput.vue_vue_type_script_setup_true_lang-dsv7e6yU.js";
|
|
20
|
+
import { _ as dt } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
21
|
+
import { z as ut, a as ct } from "./money-Car_1Uu5.js";
|
|
22
|
+
import { F as mt } from "./number-BKqKRPst.js";
|
|
23
|
+
import { a as pt, t as ft } from "./helper-DrhEQHwq.js";
|
|
24
|
+
import "./index-D8UahMhD.js";
|
|
25
|
+
import "./index-BmYRSyFJ.js";
|
|
26
|
+
import "./index-BzMFc1TL.js";
|
|
27
|
+
import "./index-Dd3r1_0V.js";
|
|
28
|
+
import { m as yt } from "./index-BL3Mdvlf.js";
|
|
29
|
+
import { m as be } from "./index-CEkk23PR.js";
|
|
30
|
+
import { useRouter as bt } from "vue-router";
|
|
31
|
+
function Ke(x) {
|
|
32
32
|
return de.DineroFactory(x).toUnit();
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const o =
|
|
36
|
-
S.map((t) => x.find((
|
|
37
|
-
),
|
|
38
|
-
(t,
|
|
39
|
-
var
|
|
34
|
+
function He(x, S, a, g, s = [], v = []) {
|
|
35
|
+
const o = rt.compact(
|
|
36
|
+
S.map((t) => x.find((u) => u.systemCode === t.systemCode && u.taxCode === t.taxCode)).filter((t) => !!t && v.includes(t.systemCode))
|
|
37
|
+
), c = o.reduce(
|
|
38
|
+
(t, u) => {
|
|
39
|
+
var f;
|
|
40
40
|
return Object.assign(t, {
|
|
41
|
-
[
|
|
42
|
-
inclusive: ((
|
|
41
|
+
[u.taxCode]: {
|
|
42
|
+
inclusive: ((f = s.find((d) => d.systemCode === u.systemCode)) == null ? void 0 : f.inclusive) || !1,
|
|
43
43
|
adjustment: {
|
|
44
44
|
level: 1,
|
|
45
45
|
type: {
|
|
46
46
|
type: "BY_MULTIPLIER",
|
|
47
47
|
amount: {
|
|
48
|
-
amount:
|
|
49
|
-
precision:
|
|
48
|
+
amount: u.rate.amount,
|
|
49
|
+
precision: u.rate.precision,
|
|
50
50
|
currency: "MYR"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -64,11 +64,11 @@ function Le(x, S, a, b, s = [], g = []) {
|
|
|
64
64
|
level: 0,
|
|
65
65
|
type: {
|
|
66
66
|
type: "BY_AMOUNT",
|
|
67
|
-
amount: de.DineroFactory(a).subtract(de.Dinero.fromNumber({ number:
|
|
67
|
+
amount: de.DineroFactory(a).subtract(de.Dinero.fromNumber({ number: g }).toObject()).toObject()
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
taxes:
|
|
71
|
+
taxes: c
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
adjustments: {},
|
|
@@ -85,87 +85,87 @@ function Le(x, S, a, b, s = [], g = []) {
|
|
|
85
85
|
}).convertPrecision(2).toObject()
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return x ? x.reduce((
|
|
90
|
-
var
|
|
91
|
-
return (
|
|
88
|
+
function qe(x, S, a) {
|
|
89
|
+
return x ? x.reduce((g, s) => {
|
|
90
|
+
var v;
|
|
91
|
+
return (v = a.find((o) => o.systemCode === s.systemCode)) != null && v.inclusive || (g = de.DineroFactory(g.toObject()).add(s.total)), g;
|
|
92
92
|
}, de.DineroFactory(S)).toObject() : de.DineroFactory(S).toObject();
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const gt = { class: "relative h-[120px] aspect-video flex items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, vt = ["src"], ht = {
|
|
95
95
|
key: 2,
|
|
96
96
|
class: "absolute top-2 left-2"
|
|
97
|
-
},
|
|
97
|
+
}, xt = { class: "absolute top-0 right-0" }, Ct = { class: "fm-typo-en-body-lg-600" }, _t = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, St = { class: "flex gap-8 items-center flex-wrap" }, Ft = /* @__PURE__ */ te({
|
|
98
98
|
__name: "StoreBundleCard",
|
|
99
99
|
props: {
|
|
100
100
|
bundle: { type: Object, required: !0 }
|
|
101
101
|
},
|
|
102
102
|
emits: ["edit", "delete", "send"],
|
|
103
103
|
setup(x, { emit: S }) {
|
|
104
|
-
const a = x,
|
|
104
|
+
const a = x, g = S, s = L(() => {
|
|
105
105
|
const o = [];
|
|
106
106
|
return a.bundle.price.amount > 0 && o.push(
|
|
107
|
-
`${
|
|
107
|
+
`${A.Config.getCountry().currency.symbol}${Ke(a.bundle.price)}`
|
|
108
108
|
), a.bundle.coinPrice && o.push(`${a.bundle.coinPrice} point(s)`), o.join(" or ");
|
|
109
|
-
}),
|
|
110
|
-
var
|
|
109
|
+
}), v = L(() => {
|
|
110
|
+
var c, i;
|
|
111
111
|
const o = [];
|
|
112
|
-
if (a.bundle.titles.length > 0 && o.push(`${a.bundle.titles.length} title(s)`), a.bundle.vouchers.length > 0 && o.push(`${a.bundle.vouchers.length} voucher(s)`), a.bundle.credit.normal || (
|
|
112
|
+
if (a.bundle.titles.length > 0 && o.push(`${a.bundle.titles.length} title(s)`), a.bundle.vouchers.length > 0 && o.push(`${a.bundle.vouchers.length} voucher(s)`), a.bundle.credit.normal || (c = a.bundle.credit.free) != null && c.amount) {
|
|
113
113
|
const t = a.bundle.credit.normal + (((i = a.bundle.credit.free) == null ? void 0 : i.amount) ?? 0);
|
|
114
114
|
o.push(`${t} credit(s)`);
|
|
115
115
|
}
|
|
116
116
|
return o;
|
|
117
117
|
});
|
|
118
|
-
return (o,
|
|
119
|
-
const i = _("FmIcon"), t = _("FmChip"),
|
|
120
|
-
return h(), M(
|
|
118
|
+
return (o, c) => {
|
|
119
|
+
const i = _("FmIcon"), t = _("FmChip"), u = _("FmButton"), f = _("FmMenuItem"), d = _("FmMenu"), T = _("FmCard");
|
|
120
|
+
return h(), M(T, {
|
|
121
121
|
variant: "outlined",
|
|
122
122
|
class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full text-center items-center"
|
|
123
123
|
}, {
|
|
124
124
|
default: N(() => [
|
|
125
|
-
V("div",
|
|
125
|
+
V("div", gt, [
|
|
126
126
|
x.bundle.image ? (h(), D("img", {
|
|
127
127
|
key: 1,
|
|
128
128
|
src: x.bundle.image,
|
|
129
129
|
class: "w-full h-full object-contain aspect-video"
|
|
130
|
-
}, null, 8,
|
|
130
|
+
}, null, 8, vt)) : (h(), M(i, {
|
|
131
131
|
key: 0,
|
|
132
132
|
name: "image",
|
|
133
133
|
outline: !0,
|
|
134
134
|
size: "md",
|
|
135
135
|
class: "text-fm-color-neutral-gray-200"
|
|
136
136
|
})),
|
|
137
|
-
x.bundle.isFeedvibe ? (h(), D("div",
|
|
137
|
+
x.bundle.isFeedvibe ? (h(), D("div", ht, [
|
|
138
138
|
r(t, {
|
|
139
139
|
label: "Feedvibe",
|
|
140
140
|
class: "text-fm-color-primary bg-fm-color-system-warning-100",
|
|
141
141
|
compact: ""
|
|
142
142
|
})
|
|
143
|
-
])) :
|
|
144
|
-
V("div",
|
|
145
|
-
r(
|
|
143
|
+
])) : E("", !0),
|
|
144
|
+
V("div", xt, [
|
|
145
|
+
r(d, { placement: "bottom-end" }, {
|
|
146
146
|
"menu-button": N(() => [
|
|
147
|
-
r(
|
|
147
|
+
r(u, {
|
|
148
148
|
icon: "more_vert",
|
|
149
149
|
variant: "tertiary"
|
|
150
150
|
})
|
|
151
151
|
]),
|
|
152
152
|
default: N(() => [
|
|
153
|
-
r(
|
|
154
|
-
onClick:
|
|
153
|
+
r(f, {
|
|
154
|
+
onClick: c[0] || (c[0] = (l) => g("edit", x.bundle)),
|
|
155
155
|
icon: "edit",
|
|
156
156
|
label: "Edit"
|
|
157
157
|
}),
|
|
158
|
-
x.bundle.stripePriceId ?
|
|
158
|
+
x.bundle.stripePriceId ? E("", !0) : (h(), M(f, {
|
|
159
159
|
key: 0,
|
|
160
|
-
onClick:
|
|
160
|
+
onClick: c[1] || (c[1] = (l) => g("send", x.bundle)),
|
|
161
161
|
icon: "send",
|
|
162
162
|
label: "Send"
|
|
163
163
|
})),
|
|
164
|
-
r(
|
|
165
|
-
onClick:
|
|
164
|
+
r(f, {
|
|
165
|
+
onClick: c[2] || (c[2] = (l) => g("delete", x.bundle)),
|
|
166
166
|
icon: "delete"
|
|
167
167
|
}, {
|
|
168
|
-
label: N(() => [...
|
|
168
|
+
label: N(() => [...c[3] || (c[3] = [
|
|
169
169
|
V("div", { class: "text-fm-color-typo-error fm-typo-en-body-md-400" }, " Delete ", -1)
|
|
170
170
|
])]),
|
|
171
171
|
_: 1
|
|
@@ -175,10 +175,10 @@ const ft = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
175
175
|
})
|
|
176
176
|
])
|
|
177
177
|
]),
|
|
178
|
-
V("div",
|
|
179
|
-
V("div",
|
|
180
|
-
V("div",
|
|
181
|
-
(h(!0), D(Y, null, ue(e(
|
|
178
|
+
V("div", Ct, K(x.bundle.name), 1),
|
|
179
|
+
V("div", _t, K(e(s) || "Free"), 1),
|
|
180
|
+
V("div", St, [
|
|
181
|
+
(h(!0), D(Y, null, ue(e(v), (l, w) => (h(), M(t, {
|
|
182
182
|
key: w,
|
|
183
183
|
label: l
|
|
184
184
|
}, null, 8, ["label"]))), 128))
|
|
@@ -188,20 +188,20 @@ const ft = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
188
188
|
});
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
}),
|
|
191
|
+
}), Vt = /* @__PURE__ */ te({
|
|
192
192
|
__name: "AddBundleCard",
|
|
193
193
|
emits: ["create"],
|
|
194
194
|
setup(x, { emit: S }) {
|
|
195
|
-
const { t: a } = he(),
|
|
196
|
-
return (s,
|
|
197
|
-
const o = _("FmButton"),
|
|
198
|
-
return h(), M(
|
|
195
|
+
const { t: a } = he(), g = S;
|
|
196
|
+
return (s, v) => {
|
|
197
|
+
const o = _("FmButton"), c = _("FmCard");
|
|
198
|
+
return h(), M(c, {
|
|
199
199
|
variant: "outlined",
|
|
200
200
|
class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
|
|
201
201
|
}, {
|
|
202
202
|
default: N(() => [
|
|
203
203
|
r(o, {
|
|
204
|
-
onClick:
|
|
204
|
+
onClick: v[0] || (v[0] = (i) => g("create")),
|
|
205
205
|
label: e(a)("connect.store.actions.addBundle"),
|
|
206
206
|
icon: "add",
|
|
207
207
|
variant: "secondary"
|
|
@@ -211,7 +211,7 @@ const ft = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
211
211
|
});
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
-
}),
|
|
214
|
+
}), wt = { class: "space-y-16" }, Pt = { class: "flex w-full justify-between pb-16" }, Tt = { class: "flex items-center justify-end gap-8" }, kt = /* @__PURE__ */ te({
|
|
215
215
|
__name: "CategoryDialog",
|
|
216
216
|
props: {
|
|
217
217
|
action: {
|
|
@@ -224,38 +224,38 @@ const ft = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
226
|
setup(x) {
|
|
227
|
-
const { t: S } = he(), a = x,
|
|
227
|
+
const { t: S } = he(), a = x, g = Ee(), { emitData: s, emitAction: v } = je(), o = I(a.initialValue), c = ee.string().min(1);
|
|
228
228
|
function i() {
|
|
229
|
-
s(o.value),
|
|
229
|
+
s(o.value), v("primary"), g.close();
|
|
230
230
|
}
|
|
231
231
|
function t() {
|
|
232
|
-
s(null),
|
|
232
|
+
s(null), v("primary"), g.close();
|
|
233
233
|
}
|
|
234
|
-
return (
|
|
235
|
-
const
|
|
236
|
-
return h(), D("div",
|
|
237
|
-
r(
|
|
234
|
+
return (u, f) => {
|
|
235
|
+
const d = _("FmTextField"), T = _("FmButton");
|
|
236
|
+
return h(), D("div", wt, [
|
|
237
|
+
r(d, {
|
|
238
238
|
modelValue: e(o),
|
|
239
|
-
"onUpdate:modelValue":
|
|
239
|
+
"onUpdate:modelValue": f[0] || (f[0] = (l) => se(o) ? o.value = l : null),
|
|
240
240
|
label: e(S)("connect.store.category.label"),
|
|
241
|
-
rules: [e(Q).toRule(e(
|
|
241
|
+
rules: [e(Q).toRule(e(c))]
|
|
242
242
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
243
|
-
V("div",
|
|
243
|
+
V("div", Pt, [
|
|
244
244
|
V("div", null, [
|
|
245
|
-
x.action == "edit" ? (h(), M(
|
|
245
|
+
x.action == "edit" ? (h(), M(T, {
|
|
246
246
|
key: 0,
|
|
247
247
|
onClick: t,
|
|
248
248
|
label: e(S)("connect.common.delete"),
|
|
249
249
|
variant: "destructive"
|
|
250
|
-
}, null, 8, ["label"])) :
|
|
250
|
+
}, null, 8, ["label"])) : E("", !0)
|
|
251
251
|
]),
|
|
252
|
-
V("div",
|
|
253
|
-
r(
|
|
252
|
+
V("div", Tt, [
|
|
253
|
+
r(T, {
|
|
254
254
|
label: e(S)("connect.common.cancel"),
|
|
255
255
|
variant: "tertiary",
|
|
256
|
-
onClick:
|
|
256
|
+
onClick: f[1] || (f[1] = (l) => e(g).close())
|
|
257
257
|
}, null, 8, ["label"]),
|
|
258
|
-
r(
|
|
258
|
+
r(T, {
|
|
259
259
|
label: x.action == "edit" ? e(S)("connect.common.edit") : e(S)("connect.common.add"),
|
|
260
260
|
disabled: !e(o),
|
|
261
261
|
onClick: i
|
|
@@ -265,38 +265,38 @@ const ft = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
265
265
|
]);
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
}),
|
|
268
|
+
}), $t = { class: "space-y-16" }, Rt = { class: "flex items-center justify-end gap-8 pb-16" }, Ut = /* @__PURE__ */ te({
|
|
269
269
|
__name: "SelectCategoryDialog",
|
|
270
270
|
setup(x) {
|
|
271
|
-
const { emitData: S, emitAction: a } =
|
|
272
|
-
() =>
|
|
271
|
+
const { emitData: S, emitAction: a } = je(), g = Te(), s = I(), v = L(
|
|
272
|
+
() => g.sortedStoreCategories.map((o, c) => ({
|
|
273
273
|
label: o.name,
|
|
274
|
-
value:
|
|
274
|
+
value: c
|
|
275
275
|
}))
|
|
276
276
|
);
|
|
277
|
-
return (o,
|
|
277
|
+
return (o, c) => {
|
|
278
278
|
const i = _("FmSelect"), t = _("FmButton");
|
|
279
|
-
return h(), D("div",
|
|
280
|
-
|
|
279
|
+
return h(), D("div", $t, [
|
|
280
|
+
c[4] || (c[4] = V("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1)),
|
|
281
281
|
r(i, {
|
|
282
282
|
placeholder: "Select a category",
|
|
283
|
-
items: e(
|
|
283
|
+
items: e(v),
|
|
284
284
|
modelValue: e(s),
|
|
285
285
|
"onUpdate:modelValue": [
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
c[0] || (c[0] = (u) => se(s) ? s.value = u : null),
|
|
287
|
+
c[1] || (c[1] = (u) => e(S)(u))
|
|
288
288
|
],
|
|
289
289
|
label: "Category"
|
|
290
290
|
}, null, 8, ["items", "modelValue"]),
|
|
291
|
-
V("div",
|
|
291
|
+
V("div", Rt, [
|
|
292
292
|
r(t, {
|
|
293
293
|
variant: "tertiary",
|
|
294
294
|
label: "Cancel",
|
|
295
|
-
onClick:
|
|
295
|
+
onClick: c[2] || (c[2] = (u) => e(a)("tertiary"))
|
|
296
296
|
}),
|
|
297
297
|
r(t, {
|
|
298
298
|
label: "Select",
|
|
299
|
-
onClick:
|
|
299
|
+
onClick: c[3] || (c[3] = (u) => e(a)("primary")),
|
|
300
300
|
disabled: e(s) == null
|
|
301
301
|
}, null, 8, ["disabled"])
|
|
302
302
|
])
|
|
@@ -307,7 +307,7 @@ const ft = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
307
307
|
function _e(x) {
|
|
308
308
|
return x.states.map((S) => ({ label: S, value: S }));
|
|
309
309
|
}
|
|
310
|
-
const
|
|
310
|
+
const Bt = {
|
|
311
311
|
[Ce.F_COUNTRY.enum.MY]: {
|
|
312
312
|
states: [
|
|
313
313
|
"Johor",
|
|
@@ -461,7 +461,7 @@ const $t = {
|
|
|
461
461
|
return _e(this);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
}, fe = () =>
|
|
464
|
+
}, fe = () => A.Config.getCountry(), ge = {
|
|
465
465
|
get fullCurrency() {
|
|
466
466
|
return fe().currency;
|
|
467
467
|
},
|
|
@@ -469,7 +469,7 @@ const $t = {
|
|
|
469
469
|
return fe().currency.code;
|
|
470
470
|
},
|
|
471
471
|
get fullTax() {
|
|
472
|
-
return
|
|
472
|
+
return A.Country.getCountryFlattenTaxes(fe().code);
|
|
473
473
|
},
|
|
474
474
|
get taxSystem() {
|
|
475
475
|
return fe().taxSystems;
|
|
@@ -481,7 +481,7 @@ const $t = {
|
|
|
481
481
|
}));
|
|
482
482
|
},
|
|
483
483
|
groupedTaxOptions() {
|
|
484
|
-
const x =
|
|
484
|
+
const x = A.Country.getCountryFlattenTaxes(fe().code);
|
|
485
485
|
return ge.taxSystem.map((S) => ({
|
|
486
486
|
code: S.code,
|
|
487
487
|
options: x.map((a) => ({ ...a, feedmeTaxCode: ge.generateCode(a) })).filter((a) => a.systemCode === S.code)
|
|
@@ -494,7 +494,7 @@ const $t = {
|
|
|
494
494
|
generateCode(x) {
|
|
495
495
|
return `${x.systemCode}/${x.taxCode}`;
|
|
496
496
|
}
|
|
497
|
-
}, W = ge,
|
|
497
|
+
}, W = ge, Nt = /* @__PURE__ */ te({
|
|
498
498
|
__name: "TaxInclusiveSetting",
|
|
499
499
|
props: {
|
|
500
500
|
modelValue: {
|
|
@@ -505,53 +505,53 @@ const $t = {
|
|
|
505
505
|
},
|
|
506
506
|
emits: ["update:model-value"],
|
|
507
507
|
setup(x, { emit: S }) {
|
|
508
|
-
const a = x,
|
|
509
|
-
function o(
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
systemCode:
|
|
513
|
-
inclusive:
|
|
514
|
-
}),
|
|
508
|
+
const a = x, g = W.taxSystem, s = S, v = I(a.modelValue);
|
|
509
|
+
function o(u, f) {
|
|
510
|
+
const d = ae.clone(a.modelValue), T = d.findIndex((l) => l.systemCode === u);
|
|
511
|
+
T >= 0 ? d[T].inclusive = f : d.push({
|
|
512
|
+
systemCode: u,
|
|
513
|
+
inclusive: f
|
|
514
|
+
}), v.value = d, s("update:model-value", d);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
518
|
-
const
|
|
516
|
+
function c() {
|
|
517
|
+
return g.map((u) => {
|
|
518
|
+
const f = a.modelValue ? a.modelValue.find((d) => d.systemCode === u.code) : !1;
|
|
519
519
|
return {
|
|
520
|
-
label:
|
|
520
|
+
label: u.name,
|
|
521
521
|
config: {
|
|
522
|
-
value:
|
|
522
|
+
value: f ? f.inclusive : !1
|
|
523
523
|
},
|
|
524
|
-
input: (
|
|
525
|
-
o(
|
|
524
|
+
input: (d) => {
|
|
525
|
+
o(u.code, d);
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
|
-
const i =
|
|
531
|
-
function t(
|
|
532
|
-
return `${
|
|
530
|
+
const i = Ye(c());
|
|
531
|
+
function t(u, f) {
|
|
532
|
+
return `${u} ${f ? "Inclusive" : "Exclusive"}`;
|
|
533
533
|
}
|
|
534
534
|
return ve(() => {
|
|
535
|
-
a.modelValue.length || o(
|
|
535
|
+
a.modelValue.length || o(g[0].code, !1);
|
|
536
536
|
}), Pe(
|
|
537
537
|
() => a.modelValue,
|
|
538
|
-
(
|
|
539
|
-
|
|
538
|
+
(u, f) => {
|
|
539
|
+
u != f && !u.length && o(g[0].code, !1);
|
|
540
540
|
}
|
|
541
|
-
), (
|
|
542
|
-
const
|
|
543
|
-
return h(!0), D(Y, null, ue(e(i), (
|
|
541
|
+
), (u, f) => {
|
|
542
|
+
const d = _("FmSwitch");
|
|
543
|
+
return h(!0), D(Y, null, ue(e(i), (T, l) => {
|
|
544
544
|
var w;
|
|
545
545
|
return h(), D("div", { key: l }, [
|
|
546
|
-
r(
|
|
547
|
-
"model-value": ((w = e(
|
|
546
|
+
r(d, {
|
|
547
|
+
"model-value": ((w = e(v)[l]) == null ? void 0 : w.inclusive) || !1,
|
|
548
548
|
"label-placement": "left",
|
|
549
|
-
"onUpdate:modelValue": ($) =>
|
|
549
|
+
"onUpdate:modelValue": ($) => T.input($)
|
|
550
550
|
}, {
|
|
551
551
|
label: N(() => {
|
|
552
552
|
var $;
|
|
553
553
|
return [
|
|
554
|
-
V("div", null, K(t(
|
|
554
|
+
V("div", null, K(t(T.label, (($ = e(v)[l]) == null ? void 0 : $.inclusive) || !1)), 1)
|
|
555
555
|
];
|
|
556
556
|
}),
|
|
557
557
|
_: 2
|
|
@@ -561,87 +561,87 @@ const $t = {
|
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
563
|
});
|
|
564
|
-
var
|
|
565
|
-
const
|
|
564
|
+
var It = { mode: "production", appMode: "mf" };
|
|
565
|
+
const Dt = { class: "space-y-8" }, Mt = {
|
|
566
566
|
key: 0,
|
|
567
567
|
class: "space-y-16"
|
|
568
|
-
},
|
|
568
|
+
}, Ot = /* @__PURE__ */ te({
|
|
569
569
|
__name: "StripeSetting",
|
|
570
570
|
props: {
|
|
571
571
|
modelValue: {}
|
|
572
572
|
},
|
|
573
573
|
emits: ["update:modelValue"],
|
|
574
574
|
setup(x, { emit: S }) {
|
|
575
|
-
const a = x,
|
|
576
|
-
Pe(s, (o,
|
|
577
|
-
|
|
575
|
+
const a = x, g = S, s = I(!1);
|
|
576
|
+
Pe(s, (o, c) => {
|
|
577
|
+
c != o && (!a.modelValue && o ? g("update:modelValue", {
|
|
578
578
|
apiKey: "",
|
|
579
579
|
webhookSecret: ""
|
|
580
|
-
}) : o ||
|
|
580
|
+
}) : o || g("update:modelValue", void 0));
|
|
581
581
|
});
|
|
582
|
-
const
|
|
583
|
-
const o =
|
|
584
|
-
return `https://marketing${o ? "-dev" : ""}${i}.feedmeapi.com/stripe/${
|
|
582
|
+
const v = L(() => {
|
|
583
|
+
const o = It.mode === "development", c = A.Config.getCountry().code.toLowerCase(), i = c != "my" ? `.${c}` : "";
|
|
584
|
+
return `https://marketing${o ? "-dev" : ""}${i}.feedmeapi.com/stripe/${Ze.getBusinessId()}/webhook`;
|
|
585
585
|
});
|
|
586
586
|
return ve(() => {
|
|
587
587
|
s.value = !!a.modelValue;
|
|
588
|
-
}), (o,
|
|
589
|
-
const i = _("FmSwitch"), t = _("FmTextField"),
|
|
590
|
-
return h(), D("div",
|
|
588
|
+
}), (o, c) => {
|
|
589
|
+
const i = _("FmSwitch"), t = _("FmTextField"), u = _("FmButton");
|
|
590
|
+
return h(), D("div", Dt, [
|
|
591
591
|
r(i, {
|
|
592
592
|
modelValue: e(s),
|
|
593
|
-
"onUpdate:modelValue":
|
|
593
|
+
"onUpdate:modelValue": c[0] || (c[0] = (f) => se(s) ? s.value = f : null),
|
|
594
594
|
value: "true",
|
|
595
595
|
label: "Enable Stripe"
|
|
596
596
|
}, null, 8, ["modelValue"]),
|
|
597
|
-
a.modelValue ? (h(), D("div",
|
|
597
|
+
a.modelValue ? (h(), D("div", Mt, [
|
|
598
598
|
r(t, {
|
|
599
599
|
label: "API Key",
|
|
600
600
|
modelValue: a.modelValue.apiKey,
|
|
601
|
-
"onUpdate:modelValue":
|
|
601
|
+
"onUpdate:modelValue": c[1] || (c[1] = (f) => a.modelValue.apiKey = f),
|
|
602
602
|
"helper-text": "Go to Stripe Dashboard get your API Key and paste here."
|
|
603
603
|
}, null, 8, ["modelValue"]),
|
|
604
604
|
r(t, {
|
|
605
605
|
label: "Webhook URL",
|
|
606
|
-
"model-value": e(
|
|
606
|
+
"model-value": e(v),
|
|
607
607
|
readonly: "",
|
|
608
608
|
"helper-text": "Copy this URL to your Stripe dashboard"
|
|
609
609
|
}, {
|
|
610
610
|
append: N(() => [
|
|
611
|
-
r(
|
|
611
|
+
r(u, {
|
|
612
612
|
icon: "content_copy",
|
|
613
613
|
variant: "tertiary",
|
|
614
|
-
onClick:
|
|
614
|
+
onClick: c[2] || (c[2] = (f) => e(lt)(e(v)))
|
|
615
615
|
})
|
|
616
616
|
]),
|
|
617
617
|
_: 1
|
|
618
618
|
}, 8, ["model-value"]),
|
|
619
619
|
r(t, {
|
|
620
620
|
modelValue: a.modelValue.webhookSecret,
|
|
621
|
-
"onUpdate:modelValue":
|
|
621
|
+
"onUpdate:modelValue": c[3] || (c[3] = (f) => a.modelValue.webhookSecret = f),
|
|
622
622
|
label: "Webhook Secret",
|
|
623
623
|
"helper-text": `Copy the webhook signing secret from your Stripe account and paste
|
|
624
624
|
here.`
|
|
625
625
|
}, null, 8, ["modelValue"])
|
|
626
|
-
])) :
|
|
626
|
+
])) : E("", !0)
|
|
627
627
|
]);
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
|
-
}),
|
|
630
|
+
}), At = {
|
|
631
631
|
key: 0,
|
|
632
632
|
class: "space-y-16 pr-12"
|
|
633
|
-
},
|
|
633
|
+
}, Et = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, jt = {
|
|
634
634
|
key: 1,
|
|
635
635
|
class: "space-y-16"
|
|
636
|
-
},
|
|
636
|
+
}, Lt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Kt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Ht = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, qt = { class: "space-y-4" }, Wt = { class: "fm-typo-en-body-lg-400" }, Yt = { class: "space-y-16" }, zt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Jt = { class: "flex items-center gap-8" }, Gt = /* @__PURE__ */ te({
|
|
637
637
|
__name: "StoreSettingSheet",
|
|
638
638
|
emits: ["update"],
|
|
639
639
|
setup(x, { expose: S, emit: a }) {
|
|
640
|
-
const { t:
|
|
641
|
-
company:
|
|
640
|
+
const { t: g } = he(), s = a, v = I(!1), o = I(), c = I(!1), i = Qe.extend({
|
|
641
|
+
company: et.extend({
|
|
642
642
|
name: ee.string().min(1, "Company name is required"),
|
|
643
643
|
regNo: ee.string().min(1, "Registration number is required"),
|
|
644
|
-
address:
|
|
644
|
+
address: tt.extend({
|
|
645
645
|
line1: ee.string().min(1, "Line 1 is required"),
|
|
646
646
|
line2: ee.string().optional(),
|
|
647
647
|
state: ee.string().min(1, "State is required"),
|
|
@@ -653,11 +653,11 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
653
653
|
sstRegNo: ee.string().optional()
|
|
654
654
|
})
|
|
655
655
|
}), t = L(() => i.safeParse(o.value).success);
|
|
656
|
-
function
|
|
657
|
-
const
|
|
658
|
-
|
|
656
|
+
function u() {
|
|
657
|
+
const T = i.safeParse(o.value);
|
|
658
|
+
T.success && s("update", T.data);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function f() {
|
|
661
661
|
return {
|
|
662
662
|
company: {
|
|
663
663
|
name: "",
|
|
@@ -667,7 +667,7 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
667
667
|
city: "",
|
|
668
668
|
postcode: "",
|
|
669
669
|
state: "",
|
|
670
|
-
country:
|
|
670
|
+
country: A.Config.getCountry().name
|
|
671
671
|
},
|
|
672
672
|
phoneNo: "",
|
|
673
673
|
regNo: "",
|
|
@@ -676,31 +676,31 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
676
676
|
inclusiveTaxes: []
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
|
|
679
|
+
function d(T, l) {
|
|
680
|
+
v.value = T, T && (o.value = l != null && l.company ? ae.cloneDeep(l) : f());
|
|
681
681
|
}
|
|
682
682
|
return S({
|
|
683
|
-
showSheet:
|
|
683
|
+
showSheet: d,
|
|
684
684
|
data: o
|
|
685
|
-
}), (
|
|
686
|
-
const w = _("FmIcon"), $ = _("FmMenuItem"),
|
|
685
|
+
}), (T, l) => {
|
|
686
|
+
const w = _("FmIcon"), $ = _("FmMenuItem"), j = _("FmMenu"), ne = _("FmSelect"), Z = _("FmButton"), H = _("FmSideSheet");
|
|
687
687
|
return h(), M(H, {
|
|
688
688
|
"max-width": 560,
|
|
689
|
-
modelValue: e(
|
|
690
|
-
"onUpdate:modelValue": l[15] || (l[15] = (z) =>
|
|
691
|
-
header: e(
|
|
689
|
+
modelValue: e(v),
|
|
690
|
+
"onUpdate:modelValue": l[15] || (l[15] = (z) => se(v) ? v.value = z : null),
|
|
691
|
+
header: e(g)("connect.store.setting.title")
|
|
692
692
|
}, {
|
|
693
693
|
"side-sheet-footer": N(() => [
|
|
694
|
-
V("div",
|
|
694
|
+
V("div", Jt, [
|
|
695
695
|
r(Z, {
|
|
696
|
-
label: e(
|
|
697
|
-
onClick:
|
|
696
|
+
label: e(g)("connect.common.save"),
|
|
697
|
+
onClick: u,
|
|
698
698
|
disabled: !e(t) || e(Se)().isLoading,
|
|
699
699
|
loading: e(Se)().isLoading
|
|
700
700
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
701
701
|
r(Z, {
|
|
702
|
-
label: e(
|
|
703
|
-
onClick: l[14] || (l[14] = (z) =>
|
|
702
|
+
label: e(g)("connect.common.cancel"),
|
|
703
|
+
onClick: l[14] || (l[14] = (z) => d(!1)),
|
|
704
704
|
variant: "tertiary"
|
|
705
705
|
}, null, 8, ["label"])
|
|
706
706
|
])
|
|
@@ -708,103 +708,103 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
708
708
|
default: N(() => {
|
|
709
709
|
var z, oe;
|
|
710
710
|
return [
|
|
711
|
-
r(
|
|
712
|
-
e(o) && e(o).company ? (h(), D("div",
|
|
713
|
-
V("div",
|
|
714
|
-
r(
|
|
711
|
+
r(ke, { json: e(o) }, null, 8, ["json"]),
|
|
712
|
+
e(o) && e(o).company ? (h(), D("div", At, [
|
|
713
|
+
V("div", Et, K(e(g)("connect.store.setting.company.legal_info")), 1),
|
|
714
|
+
r(le, {
|
|
715
715
|
modelValue: e(o).company.name,
|
|
716
716
|
"onUpdate:modelValue": l[0] || (l[0] = (F) => e(o).company.name = F),
|
|
717
|
-
label: e(
|
|
717
|
+
label: e(g)("connect.store.setting.company.name"),
|
|
718
718
|
schema: e(Q).typeAtPath(e(i), "company.name")
|
|
719
719
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
720
|
-
r(
|
|
720
|
+
r(le, {
|
|
721
721
|
modelValue: e(o).company.regNo,
|
|
722
722
|
"onUpdate:modelValue": l[1] || (l[1] = (F) => e(o).company.regNo = F),
|
|
723
|
-
label: e(
|
|
723
|
+
label: e(g)("connect.store.setting.company.reg_no"),
|
|
724
724
|
schema: e(Q).typeAtPath(e(i), "company.regNo")
|
|
725
725
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
726
|
-
e(
|
|
726
|
+
e(A.Config).getCountry().taxSystems.length ? (h(), M(le, {
|
|
727
727
|
key: 0,
|
|
728
728
|
modelValue: e(o).company.sstRegNo,
|
|
729
729
|
"onUpdate:modelValue": [
|
|
730
730
|
l[2] || (l[2] = (F) => e(o).company.sstRegNo = F),
|
|
731
731
|
l[3] || (l[3] = (F) => F ? null : e(o).inclusiveTaxes = [])
|
|
732
732
|
],
|
|
733
|
-
label: e(
|
|
733
|
+
label: e(g)("connect.store.setting.company.tax_reg_no"),
|
|
734
734
|
schema: e(Q).typeAtPath(e(i), "company.sstRegNo")
|
|
735
|
-
}, null, 8, ["modelValue", "label", "schema"])) :
|
|
736
|
-
(z = e(o).company) != null && z.sstRegNo && e(o).inclusiveTaxes ? (h(), D("div",
|
|
737
|
-
V("div",
|
|
738
|
-
r(
|
|
735
|
+
}, null, 8, ["modelValue", "label", "schema"])) : E("", !0),
|
|
736
|
+
(z = e(o).company) != null && z.sstRegNo && e(o).inclusiveTaxes ? (h(), D("div", jt, [
|
|
737
|
+
V("div", Lt, K(e(g)("connect.store.setting.company.tax")), 1),
|
|
738
|
+
r(Nt, {
|
|
739
739
|
modelValue: e(o).inclusiveTaxes,
|
|
740
740
|
"onUpdate:modelValue": l[4] || (l[4] = (F) => e(o).inclusiveTaxes = F)
|
|
741
741
|
}, null, 8, ["modelValue"])
|
|
742
|
-
])) :
|
|
743
|
-
r(
|
|
742
|
+
])) : E("", !0),
|
|
743
|
+
r(le, {
|
|
744
744
|
modelValue: e(o).company.phoneNo,
|
|
745
745
|
"onUpdate:modelValue": l[5] || (l[5] = (F) => e(o).company.phoneNo = F),
|
|
746
|
-
label: e(
|
|
746
|
+
label: e(g)("connect.store.setting.company.phone"),
|
|
747
747
|
schema: e(Q).typeAtPath(e(i), "company.phoneNo")
|
|
748
748
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
749
|
-
V("div",
|
|
750
|
-
r(
|
|
749
|
+
V("div", Kt, K(e(g)("connect.store.setting.company.address.title")), 1),
|
|
750
|
+
r(le, {
|
|
751
751
|
modelValue: e(o).company.address.line1,
|
|
752
752
|
"onUpdate:modelValue": l[6] || (l[6] = (F) => e(o).company.address.line1 = F),
|
|
753
|
-
label: e(
|
|
753
|
+
label: e(g)("connect.store.setting.company.address.line1"),
|
|
754
754
|
schema: e(Q).typeAtPath(e(i), "company.address.line1")
|
|
755
755
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
756
|
-
r(
|
|
756
|
+
r(le, {
|
|
757
757
|
modelValue: e(o).company.address.line2,
|
|
758
758
|
"onUpdate:modelValue": l[7] || (l[7] = (F) => e(o).company.address.line2 = F),
|
|
759
|
-
label: e(
|
|
759
|
+
label: e(g)("connect.store.setting.company.address.line2"),
|
|
760
760
|
schema: e(Q).typeAtPath(e(i), "company.address.line2")
|
|
761
761
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
762
|
-
V("div",
|
|
763
|
-
r(
|
|
762
|
+
V("div", Ht, [
|
|
763
|
+
r(le, {
|
|
764
764
|
modelValue: e(o).company.address.city,
|
|
765
765
|
"onUpdate:modelValue": l[8] || (l[8] = (F) => e(o).company.address.city = F),
|
|
766
|
-
label: e(
|
|
766
|
+
label: e(g)("connect.store.setting.company.address.city"),
|
|
767
767
|
schema: e(Q).typeAtPath(e(i), "company.address.city")
|
|
768
768
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
769
|
-
r(
|
|
769
|
+
r(le, {
|
|
770
770
|
modelValue: e(o).company.address.postcode,
|
|
771
771
|
"onUpdate:modelValue": l[9] || (l[9] = (F) => e(o).company.address.postcode = F),
|
|
772
|
-
label: e(
|
|
772
|
+
label: e(g)("connect.store.setting.company.address.postcode"),
|
|
773
773
|
schema: e(Q).typeAtPath(e(i), "company.address.postcode")
|
|
774
774
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
775
|
-
V("div",
|
|
776
|
-
V("div",
|
|
777
|
-
r(
|
|
775
|
+
V("div", qt, [
|
|
776
|
+
V("div", Wt, K(e(g)("connect.store.setting.company.address.state")), 1),
|
|
777
|
+
r(j, {
|
|
778
778
|
placement: "top-end",
|
|
779
|
-
"model-value": e(
|
|
779
|
+
"model-value": e(c)
|
|
780
780
|
}, {
|
|
781
781
|
"menu-button": N(() => [
|
|
782
|
-
r(
|
|
782
|
+
r(le, {
|
|
783
783
|
modelValue: e(o).company.address.state,
|
|
784
784
|
"onUpdate:modelValue": l[10] || (l[10] = (F) => e(o).company.address.state = F),
|
|
785
785
|
schema: e(Q).typeAtPath(e(i), "company.address.state"),
|
|
786
|
-
onFocusChanged: l[11] || (l[11] = (F) =>
|
|
786
|
+
onFocusChanged: l[11] || (l[11] = (F) => c.value = F)
|
|
787
787
|
}, {
|
|
788
788
|
append: N(() => [
|
|
789
789
|
r(w, {
|
|
790
|
-
name: e(
|
|
790
|
+
name: e(c) ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
791
791
|
}, null, 8, ["name"])
|
|
792
792
|
]),
|
|
793
793
|
_: 1
|
|
794
794
|
}, 8, ["modelValue", "schema"])
|
|
795
795
|
]),
|
|
796
796
|
default: N(() => [
|
|
797
|
-
(h(!0), D(Y, null, ue(e(
|
|
797
|
+
(h(!0), D(Y, null, ue(e(Bt)[e(A.Config).getCountry().code].stateItems.filter(
|
|
798
798
|
(F) => {
|
|
799
|
-
var re,
|
|
800
|
-
return F.label.toLowerCase().includes(((
|
|
799
|
+
var re, b;
|
|
800
|
+
return F.label.toLowerCase().includes(((b = (re = e(o)) == null ? void 0 : re.company) == null ? void 0 : b.address.state.toLowerCase()) ?? "");
|
|
801
801
|
}
|
|
802
802
|
) || [], (F) => (h(), M($, {
|
|
803
803
|
key: F.value,
|
|
804
804
|
"model-value": e(o).company.address.state === F.value,
|
|
805
805
|
label: F.label,
|
|
806
806
|
onClick: () => {
|
|
807
|
-
e(o).company.address.state = F.value,
|
|
807
|
+
e(o).company.address.state = F.value, c.value = !1;
|
|
808
808
|
}
|
|
809
809
|
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
810
810
|
]),
|
|
@@ -812,26 +812,26 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
812
812
|
}, 8, ["model-value"])
|
|
813
813
|
]),
|
|
814
814
|
r(ne, {
|
|
815
|
-
label: e(
|
|
815
|
+
label: e(g)("connect.store.setting.company.address.country"),
|
|
816
816
|
modelValue: e(o).company.address.country,
|
|
817
817
|
"onUpdate:modelValue": l[12] || (l[12] = (F) => e(o).company.address.country = F),
|
|
818
818
|
items: [
|
|
819
819
|
{
|
|
820
|
-
label: e(
|
|
821
|
-
value: e(
|
|
820
|
+
label: e(A.Config).getCountry().name,
|
|
821
|
+
value: e(A.Config).getCountry().name
|
|
822
822
|
}
|
|
823
823
|
],
|
|
824
824
|
rules: [e(Q).ruleAtPath(e(i), "company.address.country")]
|
|
825
825
|
}, null, 8, ["label", "modelValue", "items", "rules"])
|
|
826
826
|
]),
|
|
827
|
-
V("div",
|
|
828
|
-
V("div",
|
|
829
|
-
r(
|
|
827
|
+
V("div", Yt, [
|
|
828
|
+
V("div", zt, K(e(g)("connect.store.setting.stripe.title")), 1),
|
|
829
|
+
r(Ot, {
|
|
830
830
|
"model-value": (oe = e(o)) == null ? void 0 : oe.stripe,
|
|
831
831
|
"onUpdate:modelValue": l[13] || (l[13] = (F) => e(o).stripe = F)
|
|
832
832
|
}, null, 8, ["model-value"])
|
|
833
833
|
])
|
|
834
|
-
])) :
|
|
834
|
+
])) : E("", !0)
|
|
835
835
|
];
|
|
836
836
|
}),
|
|
837
837
|
_: 1
|
|
@@ -839,10 +839,10 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
839
839
|
};
|
|
840
840
|
}
|
|
841
841
|
});
|
|
842
|
-
function
|
|
843
|
-
return
|
|
842
|
+
function Xt(x, S = !0) {
|
|
843
|
+
return A.DineroFactory(x).toFormat(S);
|
|
844
844
|
}
|
|
845
|
-
const
|
|
845
|
+
const Zt = /* @__PURE__ */ te({
|
|
846
846
|
__name: "TaxVariantSetting",
|
|
847
847
|
props: {
|
|
848
848
|
modelValue: {
|
|
@@ -853,14 +853,14 @@ const Jt = /* @__PURE__ */ te({
|
|
|
853
853
|
},
|
|
854
854
|
emits: ["update:modelValue"],
|
|
855
855
|
setup(x, { emit: S }) {
|
|
856
|
-
const a = x,
|
|
856
|
+
const a = x, g = S;
|
|
857
857
|
ve(() => {
|
|
858
|
-
if (o.value.length !==
|
|
859
|
-
const t =
|
|
860
|
-
const
|
|
861
|
-
if (!
|
|
862
|
-
const { systemCode:
|
|
863
|
-
return
|
|
858
|
+
if (o.value.length !== v.value.length) {
|
|
859
|
+
const t = v.value.reduce((u, f) => {
|
|
860
|
+
const d = W.systemDefaultCode(f.name);
|
|
861
|
+
if (!d) return u;
|
|
862
|
+
const { systemCode: T, taxCode: l } = d;
|
|
863
|
+
return f.value || u.push({ systemCode: T, taxCode: l }), u;
|
|
864
864
|
}, []);
|
|
865
865
|
i(t);
|
|
866
866
|
}
|
|
@@ -868,52 +868,52 @@ const Jt = /* @__PURE__ */ te({
|
|
|
868
868
|
function s() {
|
|
869
869
|
return W.groupedTaxOptions();
|
|
870
870
|
}
|
|
871
|
-
const
|
|
871
|
+
const v = L(() => s().map((t) => ({
|
|
872
872
|
name: t.code,
|
|
873
873
|
value: (o.value || []).find(
|
|
874
|
-
(
|
|
874
|
+
(u) => t.options.some((f) => f.feedmeTaxCode === u)
|
|
875
875
|
),
|
|
876
|
-
options: t.options.map((
|
|
877
|
-
label: `${
|
|
878
|
-
value:
|
|
876
|
+
options: t.options.map((u) => ({
|
|
877
|
+
label: `${u.name} (${mt(u.rate)}%)`,
|
|
878
|
+
value: u.feedmeTaxCode
|
|
879
879
|
}))
|
|
880
880
|
}))), o = L(() => a.modelValue.map((t) => W.generateCode(t)));
|
|
881
|
-
function
|
|
882
|
-
const
|
|
881
|
+
function c(t) {
|
|
882
|
+
const u = s().find(
|
|
883
883
|
(l) => l.options.some((w) => w.feedmeTaxCode === t)
|
|
884
|
-
),
|
|
885
|
-
if (!
|
|
886
|
-
const { systemCode:
|
|
887
|
-
i([{ systemCode:
|
|
884
|
+
), f = u == null ? void 0 : u.options.find((l) => l.feedmeTaxCode === t);
|
|
885
|
+
if (!f) return;
|
|
886
|
+
const { systemCode: d, taxCode: T } = f;
|
|
887
|
+
i([{ systemCode: d, taxCode: T }]);
|
|
888
888
|
}
|
|
889
889
|
function i(t) {
|
|
890
|
-
const
|
|
891
|
-
t.forEach((
|
|
892
|
-
const
|
|
893
|
-
(w) => w.options.some(($) => $.feedmeTaxCode === W.generateCode(
|
|
894
|
-
),
|
|
895
|
-
(w) =>
|
|
890
|
+
const u = ae.clone(a.modelValue);
|
|
891
|
+
t.forEach((f) => {
|
|
892
|
+
const d = s().find(
|
|
893
|
+
(w) => w.options.some(($) => $.feedmeTaxCode === W.generateCode(f))
|
|
894
|
+
), T = (d == null ? void 0 : d.options) || [], l = u.findIndex(
|
|
895
|
+
(w) => T.some(($) => W.generateCode($) === W.generateCode(w))
|
|
896
896
|
);
|
|
897
|
-
l >= 0 ?
|
|
898
|
-
}),
|
|
897
|
+
l >= 0 ? u.splice(l, 1, f) : u.push(f);
|
|
898
|
+
}), g("update:modelValue", u);
|
|
899
899
|
}
|
|
900
|
-
return (t,
|
|
901
|
-
const
|
|
902
|
-
return h(!0), D(Y, null, ue(e(
|
|
903
|
-
key:
|
|
900
|
+
return (t, u) => {
|
|
901
|
+
const f = _("FmRadio"), d = _("FmRadioGroup");
|
|
902
|
+
return h(!0), D(Y, null, ue(e(v), (T) => (h(), D("div", {
|
|
903
|
+
key: T.name,
|
|
904
904
|
class: "flex items-start"
|
|
905
905
|
}, [
|
|
906
|
-
r(
|
|
907
|
-
modelValue:
|
|
906
|
+
r(d, {
|
|
907
|
+
modelValue: T.value,
|
|
908
908
|
"onUpdate:modelValue": [
|
|
909
|
-
(l) =>
|
|
910
|
-
|
|
911
|
-
|
|
909
|
+
(l) => T.value = l,
|
|
910
|
+
u[0] || (u[0] = (l) => {
|
|
911
|
+
c(l);
|
|
912
912
|
})
|
|
913
913
|
]
|
|
914
914
|
}, {
|
|
915
915
|
default: N(() => [
|
|
916
|
-
(h(!0), D(Y, null, ue(
|
|
916
|
+
(h(!0), D(Y, null, ue(T.options, (l, w) => (h(), M(f, {
|
|
917
917
|
key: w,
|
|
918
918
|
value: l.value,
|
|
919
919
|
label: l.label
|
|
@@ -929,8 +929,8 @@ const Jt = /* @__PURE__ */ te({
|
|
|
929
929
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
930
930
|
},
|
|
931
931
|
name: "",
|
|
932
|
-
price:
|
|
933
|
-
originalPrice:
|
|
932
|
+
price: A.Dinero.zero().toObject(),
|
|
933
|
+
originalPrice: A.Dinero.zero().toObject(),
|
|
934
934
|
vouchers: [],
|
|
935
935
|
credit: {
|
|
936
936
|
normal: 0,
|
|
@@ -946,51 +946,51 @@ const Jt = /* @__PURE__ */ te({
|
|
|
946
946
|
taxes: [],
|
|
947
947
|
taxTotals: [],
|
|
948
948
|
internal: !1,
|
|
949
|
-
priceWithTaxes:
|
|
950
|
-
},
|
|
949
|
+
priceWithTaxes: ut()
|
|
950
|
+
}, Qt = {
|
|
951
951
|
key: 0,
|
|
952
952
|
class: "space-y-24 pr-12"
|
|
953
|
-
},
|
|
953
|
+
}, en = { class: "space-y-8" }, tn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, nn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, on = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, 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__ */ te({
|
|
954
954
|
__name: "EditBundleSheet",
|
|
955
955
|
emits: ["update"],
|
|
956
956
|
setup(x, { expose: S, emit: a }) {
|
|
957
|
-
const
|
|
957
|
+
const g = a, { t: s } = he(), v = Te(), o = I(!1), c = I([]), i = I({
|
|
958
958
|
category: 0,
|
|
959
959
|
index: -1,
|
|
960
960
|
originalCategoryIndex: void 0
|
|
961
|
-
}), t = I(
|
|
962
|
-
const
|
|
963
|
-
return
|
|
964
|
-
}),
|
|
961
|
+
}), t = I(ae.cloneDeep(we)), u = I(), f = Ae, d = L(() => {
|
|
962
|
+
const m = f.safeParse(t.value);
|
|
963
|
+
return m.success ? [] : m.error.errors;
|
|
964
|
+
}), T = [
|
|
965
965
|
{
|
|
966
966
|
header: "Reward title",
|
|
967
|
-
accessorFn: (
|
|
967
|
+
accessorFn: (m) => m.collectible.name,
|
|
968
968
|
enableSorting: !0
|
|
969
969
|
},
|
|
970
970
|
{
|
|
971
971
|
id: "type",
|
|
972
972
|
header: "Reward type",
|
|
973
|
-
accessorFn: (
|
|
974
|
-
cell(
|
|
975
|
-
return pe[
|
|
973
|
+
accessorFn: (m) => m.collectible.type,
|
|
974
|
+
cell(m) {
|
|
975
|
+
return pe[m.row.original.collectible.type].chip();
|
|
976
976
|
}
|
|
977
977
|
},
|
|
978
978
|
{
|
|
979
979
|
header: "Description",
|
|
980
|
-
accessorFn: (
|
|
981
|
-
cell(
|
|
982
|
-
var
|
|
983
|
-
const n =
|
|
984
|
-
return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description :
|
|
980
|
+
accessorFn: (m) => m.description,
|
|
981
|
+
cell(m) {
|
|
982
|
+
var p;
|
|
983
|
+
const n = m.row.original;
|
|
984
|
+
return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description : Je(Xe.FmStepperField, {
|
|
985
985
|
"onUpdate:modelValue": (y) => {
|
|
986
986
|
t.value.titles = t.value.titles.map(
|
|
987
|
-
(
|
|
987
|
+
(U) => U.id == n.collectible._id ? { ...U, dayToExpire: y } : U
|
|
988
988
|
);
|
|
989
989
|
},
|
|
990
|
-
modelValue: ((
|
|
990
|
+
modelValue: ((p = n.selectedReward) == null ? void 0 : p.extra) ?? 0,
|
|
991
991
|
appendText: "day(s)",
|
|
992
|
-
helperState: G(
|
|
993
|
-
helperText: X(
|
|
992
|
+
helperState: G(d.value, "titles"),
|
|
993
|
+
helperText: X(d.value, "titles"),
|
|
994
994
|
max: 9999,
|
|
995
995
|
rules: [(y) => y <= 9999 || "Maximum 9999 days allowed"],
|
|
996
996
|
showSteppers: !1,
|
|
@@ -998,129 +998,136 @@ const Jt = /* @__PURE__ */ te({
|
|
|
998
998
|
});
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
], l = I([]), w = L(() =>
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
)
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1001
|
+
], l = I([]), w = L(() => {
|
|
1002
|
+
var n;
|
|
1003
|
+
const m = (n = t.value) != null && n.isFeedvibe ? "STORE_BUNDLE:FEEDVIBE" : "STORE_BUNDLE:DEFAULT";
|
|
1004
|
+
return v.bundleRewards.filter((p) => {
|
|
1005
|
+
var y;
|
|
1006
|
+
return (y = t.value) != null && y.isFeedvibe && p.type !== "VOUCHER" ? !1 : pt(p.capabilities, m);
|
|
1007
|
+
}).map((p) => {
|
|
1008
|
+
const y = $.value.find((O) => O.id == p._id), U = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${ft(
|
|
1009
|
+
p.options.validityOption || {}
|
|
1010
|
+
)}` : "No expiry";
|
|
1011
|
+
return {
|
|
1012
|
+
collectible: p,
|
|
1013
|
+
description: U,
|
|
1014
|
+
selectedReward: y
|
|
1015
|
+
};
|
|
1016
|
+
});
|
|
1017
|
+
}), $ = L(() => {
|
|
1018
|
+
var m, n;
|
|
1012
1019
|
return [
|
|
1013
|
-
...((
|
|
1014
|
-
id:
|
|
1015
|
-
extra:
|
|
1020
|
+
...((m = t.value) == null ? void 0 : m.titles.map((p) => ({
|
|
1021
|
+
id: p.id,
|
|
1022
|
+
extra: p.dayToExpire
|
|
1016
1023
|
}))) ?? [],
|
|
1017
|
-
...((n = t.value) == null ? void 0 : n.vouchers.map((
|
|
1018
|
-
id:
|
|
1024
|
+
...((n = t.value) == null ? void 0 : n.vouchers.map((p) => ({
|
|
1025
|
+
id: p,
|
|
1019
1026
|
extra: void 0
|
|
1020
1027
|
}))) ?? []
|
|
1021
1028
|
];
|
|
1022
|
-
}),
|
|
1029
|
+
}), j = L(
|
|
1023
1030
|
() => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
|
|
1024
1031
|
);
|
|
1025
|
-
function ne(
|
|
1026
|
-
t.value.subscriptionValidity =
|
|
1032
|
+
function ne(m) {
|
|
1033
|
+
t.value.subscriptionValidity = m;
|
|
1027
1034
|
for (const n of t.value.titles)
|
|
1028
|
-
n.dayToExpire =
|
|
1029
|
-
t.value.credit.free && (t.value.credit.free.day =
|
|
1035
|
+
n.dayToExpire = m;
|
|
1036
|
+
t.value.credit.free && (t.value.credit.free.day = m);
|
|
1030
1037
|
}
|
|
1031
1038
|
function Z() {
|
|
1032
|
-
const
|
|
1033
|
-
if (!(!n || !
|
|
1034
|
-
for (let
|
|
1035
|
-
const y =
|
|
1036
|
-
H.value[
|
|
1037
|
-
(
|
|
1039
|
+
const m = w.value, n = t.value;
|
|
1040
|
+
if (!(!n || !m))
|
|
1041
|
+
for (let p = 0; p < m.length; p++) {
|
|
1042
|
+
const y = m[p];
|
|
1043
|
+
H.value[p] ? y.collectible.type == "TITLE" ? n.titles.findIndex(
|
|
1044
|
+
(R) => R.id == y.collectible._id
|
|
1038
1045
|
) < 0 && n.titles.push({
|
|
1039
1046
|
id: y.collectible._id,
|
|
1040
|
-
dayToExpire:
|
|
1047
|
+
dayToExpire: j.value
|
|
1041
1048
|
}) : n.vouchers.findIndex(
|
|
1042
|
-
(
|
|
1043
|
-
) < 0 && n.vouchers.push(y.collectible._id) : (n.titles = n.titles.filter((
|
|
1044
|
-
(
|
|
1049
|
+
(R) => R == y.collectible._id
|
|
1050
|
+
) < 0 && n.vouchers.push(y.collectible._id) : (n.titles = n.titles.filter((O) => O.id != y.collectible._id), n.vouchers = n.vouchers.filter(
|
|
1051
|
+
(O) => O != y.collectible._id
|
|
1045
1052
|
));
|
|
1046
1053
|
}
|
|
1047
1054
|
}
|
|
1048
1055
|
const H = I({});
|
|
1049
1056
|
Pe(H, Z, { deep: !0 });
|
|
1050
1057
|
const z = L(() => {
|
|
1051
|
-
var
|
|
1052
|
-
return (n = (
|
|
1058
|
+
var m, n;
|
|
1059
|
+
return (n = (m = v.storeOption) == null ? void 0 : m.company) == null ? void 0 : n.sstRegNo;
|
|
1053
1060
|
}), oe = L(() => {
|
|
1054
|
-
var
|
|
1055
|
-
return (
|
|
1061
|
+
var m, n, p;
|
|
1062
|
+
return (p = (n = (m = v.storeOption) == null ? void 0 : m.inclusiveTaxes) == null ? void 0 : n[0]) != null && p.inclusive ? "Inclusive" : "Exclusive";
|
|
1056
1063
|
}), F = L(() => {
|
|
1057
|
-
var
|
|
1058
|
-
return
|
|
1064
|
+
var m, n, p;
|
|
1065
|
+
return He(
|
|
1059
1066
|
W.fullTax,
|
|
1060
|
-
|
|
1067
|
+
ze(t.value.taxes),
|
|
1061
1068
|
t.value.price,
|
|
1062
1069
|
Number(t.value.credit.normal),
|
|
1063
|
-
((
|
|
1064
|
-
(
|
|
1070
|
+
((m = v.storeOption) == null ? void 0 : m.inclusiveTaxes) ?? [],
|
|
1071
|
+
(p = (n = v.storeOption) == null ? void 0 : n.company) != null && p.sstRegNo ? W.taxSystem.map((y) => y.code) : []
|
|
1065
1072
|
);
|
|
1066
1073
|
}), re = L(() => F.value.reduce(
|
|
1067
|
-
(n,
|
|
1068
|
-
|
|
1069
|
-
).toFormat()),
|
|
1074
|
+
(n, p) => n.add(p.total),
|
|
1075
|
+
ct()
|
|
1076
|
+
).toFormat()), b = L(() => {
|
|
1070
1077
|
var y;
|
|
1071
|
-
const
|
|
1078
|
+
const m = qe(
|
|
1072
1079
|
F.value,
|
|
1073
1080
|
t.value.price,
|
|
1074
|
-
((y =
|
|
1081
|
+
((y = v.storeOption) == null ? void 0 : y.inclusiveTaxes) ?? []
|
|
1075
1082
|
);
|
|
1076
|
-
t.value.priceWithTaxes =
|
|
1077
|
-
const n =
|
|
1078
|
-
return Number.isNaN(
|
|
1083
|
+
t.value.priceWithTaxes = m;
|
|
1084
|
+
const n = Xt(m, !1), p = Number(n.replace(/[^\d.-]/g, ""));
|
|
1085
|
+
return Number.isNaN(p) ? 0 : p;
|
|
1079
1086
|
});
|
|
1080
|
-
function
|
|
1081
|
-
t.value.taxTotals = F.value,
|
|
1087
|
+
function k() {
|
|
1088
|
+
t.value.taxTotals = F.value, g("update", Ae.parse(ot(t.value)));
|
|
1082
1089
|
}
|
|
1083
1090
|
function C() {
|
|
1084
|
-
return
|
|
1091
|
+
return ae.cloneDeep(we);
|
|
1085
1092
|
}
|
|
1086
|
-
function
|
|
1087
|
-
o.value =
|
|
1093
|
+
function B(m, n) {
|
|
1094
|
+
o.value = m, m && n && (u.value = void 0, c.value = n.categories, t.value = n.bundle || C(), i.value.category = n.category, i.value.index = n.index, i.value.originalCategoryIndex = n.category, H.value = w.value.reduce((p, y, U) => (p[U] = !!y.selectedReward, p), {}));
|
|
1088
1095
|
}
|
|
1089
1096
|
return S({
|
|
1090
|
-
showSheet:
|
|
1091
|
-
bundleImage:
|
|
1097
|
+
showSheet: B,
|
|
1098
|
+
bundleImage: u,
|
|
1092
1099
|
target: i,
|
|
1093
1100
|
data: t
|
|
1094
|
-
}), (
|
|
1095
|
-
const
|
|
1101
|
+
}), (m, n) => {
|
|
1102
|
+
const p = _("FmSwitch"), y = _("FmHelperText"), U = _("FmTextField"), O = _("FmSelect"), R = _("FmStepperField"), q = _("FmMenuItem"), J = _("FmTable"), me = _("FmButton"), xe = _("FmSideSheet");
|
|
1096
1103
|
return h(), M(xe, {
|
|
1097
1104
|
"max-width": 768,
|
|
1098
1105
|
modelValue: e(o),
|
|
1099
|
-
"onUpdate:modelValue": n[
|
|
1106
|
+
"onUpdate:modelValue": n[21] || (n[21] = (ie) => se(o) ? o.value = ie : null),
|
|
1100
1107
|
header: e(i).index != -1 ? e(s)("connect.store.bundle.edit.title") : e(s)("connect.store.bundle.edit.create")
|
|
1101
1108
|
}, {
|
|
1102
1109
|
"side-sheet-footer": N(() => [
|
|
1103
|
-
V("div",
|
|
1110
|
+
V("div", cn, [
|
|
1104
1111
|
r(me, {
|
|
1105
1112
|
label: e(i).index != -1 ? "Save" : "Add",
|
|
1106
|
-
onClick:
|
|
1107
|
-
disabled: e(
|
|
1113
|
+
onClick: k,
|
|
1114
|
+
disabled: e(d).length > 0,
|
|
1108
1115
|
loading: e(Se)().isLoading
|
|
1109
1116
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
1110
1117
|
r(me, {
|
|
1111
1118
|
label: "Cancel",
|
|
1112
|
-
onClick: n[
|
|
1119
|
+
onClick: n[20] || (n[20] = (ie) => B(!1)),
|
|
1113
1120
|
variant: "tertiary"
|
|
1114
1121
|
})
|
|
1115
1122
|
])
|
|
1116
1123
|
]),
|
|
1117
1124
|
default: N(() => {
|
|
1118
|
-
var ie, $e,
|
|
1125
|
+
var ie, $e, Re, Ue, Be, Ne, Ie, De, Me, Oe;
|
|
1119
1126
|
return [
|
|
1120
|
-
r(
|
|
1121
|
-
e(t) ? (h(), D("div",
|
|
1122
|
-
V("div",
|
|
1123
|
-
e(
|
|
1127
|
+
r(ke, { json: e(t) }, null, 8, ["json"]),
|
|
1128
|
+
e(t) ? (h(), D("div", Qt, [
|
|
1129
|
+
V("div", en, [
|
|
1130
|
+
e(A.Config).getCountry().code == "MY" && ((ie = e(v).payoutAccount) == null ? void 0 : ie.status) == "APPROVED" && (($e = e(v).payoutAccount) != null && $e.enable) ? (h(), M(p, {
|
|
1124
1131
|
key: 0,
|
|
1125
1132
|
"onUpdate:modelValue": n[0] || (n[0] = (P) => {
|
|
1126
1133
|
e(t).isFeedvibe = P, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], H.value = {}, e(t).hideInPos = !0, e(t).internal = !0);
|
|
@@ -1129,41 +1136,41 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1129
1136
|
"model-value": e(t).isFeedvibe || !1,
|
|
1130
1137
|
label: "Feedvibe Campaign",
|
|
1131
1138
|
sublabel: "Bundle will be appear for Feedvibe campaign use"
|
|
1132
|
-
}, null, 8, ["model-value"])) :
|
|
1139
|
+
}, null, 8, ["model-value"])) : E("", !0),
|
|
1133
1140
|
e(t).isFeedvibe ? (h(), M(y, {
|
|
1134
1141
|
key: 1,
|
|
1135
1142
|
text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app. FeedVibe bundles only show up in the FeedVibe app and cannot be sold in the POS and mini program. For more information, please contact support.",
|
|
1136
1143
|
state: "warning"
|
|
1137
|
-
})) :
|
|
1144
|
+
})) : E("", !0)
|
|
1138
1145
|
]),
|
|
1139
|
-
V("div",
|
|
1140
|
-
r(
|
|
1146
|
+
V("div", tn, K(e(s)("connect.store.bundle.edit.basicInformation")), 1),
|
|
1147
|
+
r(U, {
|
|
1141
1148
|
label: e(s)("connect.store.bundle.edit.bundleName"),
|
|
1142
1149
|
modelValue: e(t).name,
|
|
1143
1150
|
"onUpdate:modelValue": n[1] || (n[1] = (P) => e(t).name = P),
|
|
1144
|
-
"helper-state": e(G)(e(
|
|
1145
|
-
"helper-text": e(X)(e(
|
|
1151
|
+
"helper-state": e(G)(e(d), "name"),
|
|
1152
|
+
"helper-text": e(X)(e(d), "name")
|
|
1146
1153
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1147
|
-
r(
|
|
1154
|
+
r(O, {
|
|
1148
1155
|
modelValue: e(i).category,
|
|
1149
1156
|
"onUpdate:modelValue": n[2] || (n[2] = (P) => e(i).category = P),
|
|
1150
1157
|
label: "Store Category",
|
|
1151
|
-
items: e(
|
|
1158
|
+
items: e(c).map((P, We) => ({ label: P, value: We }))
|
|
1152
1159
|
}, null, 8, ["modelValue", "items"]),
|
|
1153
|
-
r(
|
|
1160
|
+
r(it, {
|
|
1154
1161
|
label: e(s)("connect.store.bundle.edit.bundleImage"),
|
|
1155
1162
|
class: "w-1/2 xs:w-2/3",
|
|
1156
1163
|
"aspect-ratio": "16/9",
|
|
1157
1164
|
thumbnail: e(t).image ?? void 0,
|
|
1158
|
-
file: e(
|
|
1165
|
+
file: e(u) ?? void 0,
|
|
1159
1166
|
"onUpdate:file": n[3] || (n[3] = (P) => {
|
|
1160
|
-
|
|
1167
|
+
u.value = P;
|
|
1161
1168
|
}),
|
|
1162
|
-
"helper-state": e(G)(e(
|
|
1163
|
-
"helper-text": e(X)(e(
|
|
1169
|
+
"helper-state": e(G)(e(d), "image"),
|
|
1170
|
+
"helper-text": e(X)(e(d), "image")
|
|
1164
1171
|
}, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
|
|
1165
|
-
r(
|
|
1166
|
-
"model-value": e(
|
|
1172
|
+
r(R, {
|
|
1173
|
+
"model-value": e(A.Dinero).fromFdoDinero(e(t).price).toUnit(),
|
|
1167
1174
|
label: e(s)("connect.store.bundle.edit.bundlePrice"),
|
|
1168
1175
|
min: 0,
|
|
1169
1176
|
"max-fraction-digits": 2,
|
|
@@ -1172,35 +1179,35 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1172
1179
|
}),
|
|
1173
1180
|
"is-currency": !0,
|
|
1174
1181
|
"show-steppers": !1,
|
|
1175
|
-
"helper-text": e(X)(e(
|
|
1182
|
+
"helper-text": e(X)(e(d), "price") || `${e(A.Dinero).fromNumber({ number: 1 }).toFormat(
|
|
1176
1183
|
!0
|
|
1177
|
-
)} = ${e(
|
|
1178
|
-
"helper-state": e(G)(e(
|
|
1184
|
+
)} = ${e(A.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
|
|
1185
|
+
"helper-state": e(G)(e(d), "price")
|
|
1179
1186
|
}, {
|
|
1180
1187
|
prepend: N(() => [
|
|
1181
|
-
ce(K(e(
|
|
1188
|
+
ce(K(e(A.Dinero).defaultCurrency()), 1)
|
|
1182
1189
|
]),
|
|
1183
1190
|
_: 1
|
|
1184
1191
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
1185
|
-
r(
|
|
1186
|
-
"model-value": e(
|
|
1192
|
+
r(R, {
|
|
1193
|
+
"model-value": e(A.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
|
|
1187
1194
|
label: e(s)("connect.store.bundle.edit.bundleValue"),
|
|
1188
1195
|
min: 0,
|
|
1189
1196
|
"max-fraction-digits": 2,
|
|
1190
1197
|
"onUpdate:modelValue": n[5] || (n[5] = (P) => {
|
|
1191
|
-
e(t).originalPrice || (e(t).originalPrice = e(
|
|
1198
|
+
e(t).originalPrice || (e(t).originalPrice = e(A.Dinero).zero().toObject()), e(t).originalPrice.amount = P * 10 ** e(t).originalPrice.precision;
|
|
1192
1199
|
}),
|
|
1193
1200
|
"is-currency": !0,
|
|
1194
1201
|
"show-steppers": !1,
|
|
1195
|
-
"helper-text": e(X)(e(
|
|
1196
|
-
"helper-state": e(G)(e(
|
|
1202
|
+
"helper-text": e(X)(e(d), "originalPrice") || e(s)("connect.store.bundle.edit.originalPriceHelper"),
|
|
1203
|
+
"helper-state": e(G)(e(d), "originalPrice")
|
|
1197
1204
|
}, {
|
|
1198
1205
|
prepend: N(() => [
|
|
1199
|
-
ce(K(e(
|
|
1206
|
+
ce(K(e(A.Dinero).defaultCurrency()), 1)
|
|
1200
1207
|
]),
|
|
1201
1208
|
_: 1
|
|
1202
1209
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
1203
|
-
e(t).isFeedvibe ?
|
|
1210
|
+
e(t).isFeedvibe ? E("", !0) : (h(), M(R, {
|
|
1204
1211
|
key: 0,
|
|
1205
1212
|
"model-value": e(t).coinPrice ?? null,
|
|
1206
1213
|
label: e(s)("connect.store.bundle.edit.pointNeeded"),
|
|
@@ -1209,51 +1216,51 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1209
1216
|
P > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = P;
|
|
1210
1217
|
}),
|
|
1211
1218
|
"show-steppers": !1,
|
|
1212
|
-
"helper-state": e(G)(e(
|
|
1213
|
-
"helper-text": e(X)(e(
|
|
1219
|
+
"helper-state": e(G)(e(d), "coinPrice"),
|
|
1220
|
+
"helper-text": e(X)(e(d), "coinPrice")
|
|
1214
1221
|
}, {
|
|
1215
|
-
append: N(() => [...n[
|
|
1222
|
+
append: N(() => [...n[22] || (n[22] = [
|
|
1216
1223
|
ce(" point(s) ", -1)
|
|
1217
1224
|
])]),
|
|
1218
1225
|
_: 1
|
|
1219
1226
|
}, 8, ["model-value", "label", "helper-state", "helper-text"])),
|
|
1220
|
-
(
|
|
1221
|
-
V("div",
|
|
1222
|
-
r(
|
|
1227
|
+
(Re = e(v).storeOption) != null && Re.stripe && !e(t).isFeedvibe ? (h(), D(Y, { key: 1 }, [
|
|
1228
|
+
V("div", nn, K(e(s)("connect.store.bundle.edit.subscriptionSettings")), 1),
|
|
1229
|
+
r(U, {
|
|
1223
1230
|
label: e(s)("connect.store.bundle.edit.stripePriceId"),
|
|
1224
1231
|
modelValue: e(t).stripePriceId,
|
|
1225
1232
|
"onUpdate:modelValue": n[7] || (n[7] = (P) => e(t).stripePriceId = P),
|
|
1226
|
-
"helper-state": e(G)(e(
|
|
1227
|
-
"helper-text": e(X)(e(
|
|
1233
|
+
"helper-state": e(G)(e(d), "stripePriceId"),
|
|
1234
|
+
"helper-text": e(X)(e(d), "stripePriceId")
|
|
1228
1235
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1229
|
-
e(t).stripePriceId ? (h(), M(
|
|
1236
|
+
e(t).stripePriceId ? (h(), M(R, {
|
|
1230
1237
|
key: 0,
|
|
1231
1238
|
"model-value": e(t).subscriptionValidity ?? null,
|
|
1232
1239
|
min: 1,
|
|
1233
1240
|
"onUpdate:modelValue": ne,
|
|
1234
1241
|
label: e(s)("connect.store.bundle.edit.subscriptionValidity"),
|
|
1235
1242
|
"show-steppers": !1,
|
|
1236
|
-
"helper-state": e(G)(e(
|
|
1237
|
-
"helper-text": e(X)(e(
|
|
1238
|
-
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) :
|
|
1239
|
-
], 64)) :
|
|
1240
|
-
e(t).isFeedvibe ?
|
|
1241
|
-
V("div",
|
|
1242
|
-
r(
|
|
1243
|
+
"helper-state": e(G)(e(d), "subscriptionValidity"),
|
|
1244
|
+
"helper-text": e(X)(e(d), "subscriptionValidity")
|
|
1245
|
+
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : E("", !0)
|
|
1246
|
+
], 64)) : E("", !0),
|
|
1247
|
+
e(t).isFeedvibe ? E("", !0) : (h(), D(Y, { key: 2 }, [
|
|
1248
|
+
V("div", on, K(e(s)("connect.store.bundle.edit.credit")), 1),
|
|
1249
|
+
r(R, {
|
|
1243
1250
|
modelValue: e(t).credit.normal,
|
|
1244
1251
|
"onUpdate:modelValue": n[8] || (n[8] = (P) => e(t).credit.normal = P),
|
|
1245
1252
|
label: e(s)("connect.store.bundle.edit.normalCredit"),
|
|
1246
1253
|
"show-steppers": !1,
|
|
1247
|
-
"helper-state": e(G)(e(
|
|
1248
|
-
"helper-text": e(X)(e(
|
|
1254
|
+
"helper-state": e(G)(e(d), "credit.normal"),
|
|
1255
|
+
"helper-text": e(X)(e(d), "credit.normal")
|
|
1249
1256
|
}, {
|
|
1250
|
-
append: N(() => [...n[
|
|
1257
|
+
append: N(() => [...n[23] || (n[23] = [
|
|
1251
1258
|
ce(" credit ", -1)
|
|
1252
1259
|
])]),
|
|
1253
1260
|
_: 1
|
|
1254
1261
|
}, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
1255
|
-
r(
|
|
1256
|
-
"model-value": ((
|
|
1262
|
+
r(R, {
|
|
1263
|
+
"model-value": ((Ue = e(t).credit.free) == null ? void 0 : Ue.amount) ?? null,
|
|
1257
1264
|
min: 0,
|
|
1258
1265
|
"onUpdate:modelValue": n[9] || (n[9] = (P) => {
|
|
1259
1266
|
e(t).credit.free || (e(t).credit.free = {
|
|
@@ -1263,15 +1270,15 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1263
1270
|
}),
|
|
1264
1271
|
label: e(s)("connect.store.bundle.edit.freeCredit"),
|
|
1265
1272
|
"show-steppers": !1,
|
|
1266
|
-
"helper-state": e(G)(e(
|
|
1267
|
-
"helper-text": e(X)(e(
|
|
1273
|
+
"helper-state": e(G)(e(d), "credit.free.amount"),
|
|
1274
|
+
"helper-text": e(X)(e(d), "credit.free.amount")
|
|
1268
1275
|
}, {
|
|
1269
|
-
append: N(() => [...n[
|
|
1276
|
+
append: N(() => [...n[24] || (n[24] = [
|
|
1270
1277
|
ce(" credit ", -1)
|
|
1271
1278
|
])]),
|
|
1272
1279
|
_: 1
|
|
1273
1280
|
}, 8, ["model-value", "label", "helper-state", "helper-text"]),
|
|
1274
|
-
(Be = e(t).credit.free) != null && Be.amount ? (h(), M(
|
|
1281
|
+
(Be = e(t).credit.free) != null && Be.amount ? (h(), M(R, {
|
|
1275
1282
|
key: 0,
|
|
1276
1283
|
disabled: !!e(t).stripePriceId,
|
|
1277
1284
|
"model-value": ((Ne = e(t).credit.free) == null ? void 0 : Ne.day) ?? null,
|
|
@@ -1280,41 +1287,41 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1280
1287
|
e(t).credit.free || (e(t).credit.free = {
|
|
1281
1288
|
amount: 0,
|
|
1282
1289
|
day: 1
|
|
1283
|
-
}), e(t).credit.free.day = e(
|
|
1290
|
+
}), e(t).credit.free.day = e(j) || P;
|
|
1284
1291
|
}),
|
|
1285
1292
|
label: "Free credit valid for",
|
|
1286
1293
|
"show-steppers": !1,
|
|
1287
|
-
"helper-state": e(G)(e(
|
|
1288
|
-
"helper-text": e(X)(e(
|
|
1294
|
+
"helper-state": e(G)(e(d), "credit.free.day"),
|
|
1295
|
+
"helper-text": e(X)(e(d), "credit.free.day")
|
|
1289
1296
|
}, {
|
|
1290
|
-
append: N(() => [...n[
|
|
1297
|
+
append: N(() => [...n[25] || (n[25] = [
|
|
1291
1298
|
ce(" day(s) ", -1)
|
|
1292
1299
|
])]),
|
|
1293
1300
|
_: 1
|
|
1294
|
-
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) :
|
|
1301
|
+
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : E("", !0)
|
|
1295
1302
|
], 64)),
|
|
1296
1303
|
e(z) ? (h(), D(Y, { key: 3 }, [
|
|
1297
|
-
n[
|
|
1298
|
-
r(
|
|
1304
|
+
n[26] || (n[26] = V("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
|
|
1305
|
+
r(Zt, {
|
|
1299
1306
|
modelValue: e(t).taxes,
|
|
1300
1307
|
"onUpdate:modelValue": n[11] || (n[11] = (P) => e(t).taxes = P)
|
|
1301
1308
|
}, null, 8, ["modelValue"]),
|
|
1302
|
-
r(
|
|
1309
|
+
r(U, {
|
|
1303
1310
|
label: `Tax Charged (${e(oe)})`,
|
|
1304
1311
|
"model-value": e(re),
|
|
1305
1312
|
disabled: ""
|
|
1306
1313
|
}, null, 8, ["label", "model-value"])
|
|
1307
|
-
], 64)) :
|
|
1308
|
-
r(
|
|
1314
|
+
], 64)) : E("", !0),
|
|
1315
|
+
r(R, {
|
|
1309
1316
|
label: "Total Price",
|
|
1310
|
-
"model-value": e(
|
|
1317
|
+
"model-value": e(b),
|
|
1311
1318
|
disabled: !0
|
|
1312
1319
|
}, null, 8, ["model-value"]),
|
|
1313
|
-
V("div",
|
|
1314
|
-
V("div",
|
|
1315
|
-
V("div",
|
|
1316
|
-
V("div",
|
|
1317
|
-
r(
|
|
1320
|
+
V("div", an, K(e(s)("connect.store.bundle.edit.bundleReward.title")), 1),
|
|
1321
|
+
V("div", ln, K(e(s)("connect.store.bundle.edit.bundleReward.description")), 1),
|
|
1322
|
+
V("div", sn, [
|
|
1323
|
+
V("div", rn, [
|
|
1324
|
+
r(dt, {
|
|
1318
1325
|
label: `Reward type: ${e(l).length == 0 ? "All" : e(l)[0].name}`
|
|
1319
1326
|
}, {
|
|
1320
1327
|
default: N(() => [
|
|
@@ -1348,31 +1355,29 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1348
1355
|
]),
|
|
1349
1356
|
r(J, {
|
|
1350
1357
|
modelValue: e(H),
|
|
1351
|
-
"onUpdate:modelValue": n[15] || (n[15] = (P) =>
|
|
1358
|
+
"onUpdate:modelValue": n[15] || (n[15] = (P) => se(H) ? H.value = P : null),
|
|
1352
1359
|
selection: "multiple",
|
|
1353
1360
|
"column-filter": e(l),
|
|
1354
|
-
"column-defs":
|
|
1355
|
-
"row-data": e(w)
|
|
1356
|
-
(P) => !e(t).isFeedvibe || P.collectible.type == "VOUCHER"
|
|
1357
|
-
),
|
|
1361
|
+
"column-defs": T,
|
|
1362
|
+
"row-data": e(w),
|
|
1358
1363
|
"hide-footer": e(w).length <= 10
|
|
1359
1364
|
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
|
|
1360
1365
|
r(y, {
|
|
1361
|
-
text: e(X)(e(
|
|
1362
|
-
state: e(G)(e(
|
|
1366
|
+
text: e(X)(e(d), "titles"),
|
|
1367
|
+
state: e(G)(e(d), "titles")
|
|
1363
1368
|
}, null, 8, ["text", "state"])
|
|
1364
1369
|
]),
|
|
1365
|
-
V("div",
|
|
1366
|
-
V("div",
|
|
1367
|
-
e(t).isFeedvibe ?
|
|
1368
|
-
r(
|
|
1370
|
+
V("div", dn, K(e(s)("connect.store.bundle.edit.advanceSetting")), 1),
|
|
1371
|
+
V("div", un, [
|
|
1372
|
+
e(t).isFeedvibe ? E("", !0) : (h(), D(Y, { key: 0 }, [
|
|
1373
|
+
r(p, {
|
|
1369
1374
|
"model-value": e(t).internal ?? !1,
|
|
1370
1375
|
"onUpdate:modelValue": n[16] || (n[16] = (P) => e(t).internal = P),
|
|
1371
1376
|
"label-placement": "right",
|
|
1372
1377
|
label: e(s)("connect.store.bundle.edit.internalBundle"),
|
|
1373
1378
|
sublabel: e(s)("connect.store.bundle.edit.internalBundleDescription")
|
|
1374
1379
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1375
|
-
r(
|
|
1380
|
+
r(p, {
|
|
1376
1381
|
"model-value": e(t).hideInPos ?? !1,
|
|
1377
1382
|
"onUpdate:modelValue": n[17] || (n[17] = (P) => e(t).hideInPos = P),
|
|
1378
1383
|
"label-placement": "right",
|
|
@@ -1380,66 +1385,73 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1380
1385
|
sublabel: e(s)("connect.store.bundle.edit.hideInPosDescription")
|
|
1381
1386
|
}, null, 8, ["model-value", "label", "sublabel"])
|
|
1382
1387
|
], 64)),
|
|
1383
|
-
r(
|
|
1388
|
+
r(R, {
|
|
1384
1389
|
"model-value": ((De = (Ie = e(t).config) == null ? void 0 : Ie.options) == null ? void 0 : De.maxPerUser) || null,
|
|
1385
|
-
"onUpdate:modelValue": n[18] || (n[18] = (P) => e(
|
|
1390
|
+
"onUpdate:modelValue": n[18] || (n[18] = (P) => e(ae).set(e(t), "config.options.maxPerUser", P)),
|
|
1386
1391
|
label: e(s)("connect.store.bundle.edit.maxPerUser"),
|
|
1387
1392
|
"show-steppers": !1,
|
|
1388
|
-
placeholder: "
|
|
1389
|
-
}, null, 8, ["model-value", "label"])
|
|
1393
|
+
placeholder: e(s)("connect.store.bundle.edit.unlimited")
|
|
1394
|
+
}, null, 8, ["model-value", "label", "placeholder"]),
|
|
1395
|
+
r(R, {
|
|
1396
|
+
"model-value": ((Oe = (Me = e(t).config) == null ? void 0 : Me.options) == null ? void 0 : Oe.maxReceive) || null,
|
|
1397
|
+
"onUpdate:modelValue": n[19] || (n[19] = (P) => e(ae).set(e(t), "config.options.maxReceive", P)),
|
|
1398
|
+
label: e(s)("connect.store.bundle.edit.maxReceive"),
|
|
1399
|
+
"show-steppers": !1,
|
|
1400
|
+
placeholder: e(s)("connect.store.bundle.edit.unlimited")
|
|
1401
|
+
}, null, 8, ["model-value", "label", "placeholder"])
|
|
1390
1402
|
])
|
|
1391
|
-
])) :
|
|
1403
|
+
])) : E("", !0)
|
|
1392
1404
|
];
|
|
1393
1405
|
}),
|
|
1394
1406
|
_: 1
|
|
1395
1407
|
}, 8, ["modelValue", "header"]);
|
|
1396
1408
|
};
|
|
1397
1409
|
}
|
|
1398
|
-
}),
|
|
1410
|
+
}), pn = { class: "flex gap-8 items-center flex-wrap" }, fn = { class: "flex items-center gap-8" }, yn = /* @__PURE__ */ te({
|
|
1399
1411
|
__name: "SendBundleSheet",
|
|
1400
1412
|
emits: ["success"],
|
|
1401
1413
|
setup(x, { expose: S, emit: a }) {
|
|
1402
|
-
const { minor:
|
|
1414
|
+
const { minor: g } = Le, s = I(), v = I(""), o = I(""), c = I([]), i = I(!1), t = I();
|
|
1403
1415
|
I(!0);
|
|
1404
|
-
function
|
|
1405
|
-
i.value = !0,
|
|
1416
|
+
function u(w) {
|
|
1417
|
+
i.value = !0, v.value = null, o.value = "", s.value = w.bundle;
|
|
1406
1418
|
}
|
|
1407
|
-
function
|
|
1419
|
+
function f() {
|
|
1408
1420
|
i.value = !1;
|
|
1409
1421
|
}
|
|
1410
|
-
async function
|
|
1411
|
-
const $ = await
|
|
1422
|
+
async function d(w) {
|
|
1423
|
+
const $ = await yt.read({
|
|
1412
1424
|
limit: 25,
|
|
1413
1425
|
skip: 0,
|
|
1414
1426
|
sortBy: "_id",
|
|
1415
1427
|
search: w,
|
|
1416
1428
|
descending: !1
|
|
1417
1429
|
});
|
|
1418
|
-
|
|
1419
|
-
label: `${
|
|
1420
|
-
value:
|
|
1421
|
-
})), await new Promise((
|
|
1430
|
+
c.value = $.resources.map((j) => ({
|
|
1431
|
+
label: `${j.name} (${j.phoneNumber})`,
|
|
1432
|
+
value: j._id
|
|
1433
|
+
})), await new Promise((j) => setTimeout(j, 100));
|
|
1422
1434
|
}
|
|
1423
|
-
async function
|
|
1424
|
-
if (!s.value || !
|
|
1425
|
-
const w =
|
|
1426
|
-
(
|
|
1435
|
+
async function T() {
|
|
1436
|
+
if (!s.value || !v.value) return;
|
|
1437
|
+
const w = c.value.find(
|
|
1438
|
+
(j) => j.value === v.value
|
|
1427
1439
|
);
|
|
1428
1440
|
await ye.confirm(
|
|
1429
1441
|
`Are you sure you want to send bundle ${s.value.name} to ${w == null ? void 0 : w.label}?`,
|
|
1430
1442
|
"Confirm",
|
|
1431
1443
|
"Confirm",
|
|
1432
1444
|
"Cancel"
|
|
1433
|
-
) && await
|
|
1445
|
+
) && await g(
|
|
1434
1446
|
async () => {
|
|
1435
|
-
const
|
|
1447
|
+
const j = {
|
|
1436
1448
|
bundle: s.value._id,
|
|
1437
|
-
member:
|
|
1438
|
-
source:
|
|
1449
|
+
member: v.value,
|
|
1450
|
+
source: nt.enum.ADMIN,
|
|
1439
1451
|
ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
|
|
1440
1452
|
withCoin: !1
|
|
1441
1453
|
};
|
|
1442
|
-
await be.sendBundle(
|
|
1454
|
+
await be.sendBundle(j), f();
|
|
1443
1455
|
},
|
|
1444
1456
|
{
|
|
1445
1457
|
message: "Sending bundle",
|
|
@@ -1448,32 +1460,32 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1448
1460
|
);
|
|
1449
1461
|
}
|
|
1450
1462
|
const l = L(() => {
|
|
1451
|
-
var $,
|
|
1463
|
+
var $, j, ne;
|
|
1452
1464
|
const w = [];
|
|
1453
1465
|
return (($ = s.value) == null ? void 0 : $.price.amount) > 0 && w.push(
|
|
1454
|
-
`${
|
|
1466
|
+
`${A.Config.getCountry().currency.symbol}${Ke((j = s.value) == null ? void 0 : j.price)}`
|
|
1455
1467
|
), (ne = s.value) != null && ne.coinPrice && w.push(`${s.value.coinPrice} point(s)`), w.join(" or ");
|
|
1456
1468
|
});
|
|
1457
1469
|
return S({
|
|
1458
|
-
showSheet:
|
|
1459
|
-
hideSheet:
|
|
1470
|
+
showSheet: u,
|
|
1471
|
+
hideSheet: f
|
|
1460
1472
|
}), ve(async () => {
|
|
1461
|
-
await
|
|
1473
|
+
await d("");
|
|
1462
1474
|
}), (w, $) => {
|
|
1463
|
-
const
|
|
1464
|
-
return h(), M(
|
|
1475
|
+
const j = _("FmCardMedia"), ne = _("FmCardHeader"), Z = _("FmChip"), H = _("FmCardSection"), z = _("FmCard"), oe = _("FmSelect"), F = _("FmTextField"), re = _("FmForm"), b = _("FmButton"), k = _("FmSideSheet");
|
|
1476
|
+
return h(), M(k, {
|
|
1465
1477
|
"max-width": 560,
|
|
1466
1478
|
"dismiss-away": !0,
|
|
1467
1479
|
header: "Send bundle to member",
|
|
1468
1480
|
modelValue: e(i),
|
|
1469
1481
|
"onUpdate:modelValue": [
|
|
1470
|
-
$[4] || ($[4] = (C) =>
|
|
1482
|
+
$[4] || ($[4] = (C) => se(i) ? i.value = C : null),
|
|
1471
1483
|
$[5] || ($[5] = (C) => i.value = C)
|
|
1472
1484
|
]
|
|
1473
1485
|
}, {
|
|
1474
1486
|
"side-sheet-footer": N(() => [
|
|
1475
|
-
V("div",
|
|
1476
|
-
r(
|
|
1487
|
+
V("div", fn, [
|
|
1488
|
+
r(b, {
|
|
1477
1489
|
label: "Send",
|
|
1478
1490
|
loading: e(Se)().isLoading,
|
|
1479
1491
|
onClick: $[2] || ($[2] = async () => {
|
|
@@ -1481,7 +1493,7 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1481
1493
|
return (C = e(t)) == null ? void 0 : C.validateInputs();
|
|
1482
1494
|
})
|
|
1483
1495
|
}, null, 8, ["loading"]),
|
|
1484
|
-
r(
|
|
1496
|
+
r(b, {
|
|
1485
1497
|
label: "Cancel",
|
|
1486
1498
|
type: "button",
|
|
1487
1499
|
variant: "tertiary",
|
|
@@ -1494,7 +1506,7 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1494
1506
|
class: "space-y-16",
|
|
1495
1507
|
ref_key: "form",
|
|
1496
1508
|
ref: t,
|
|
1497
|
-
onValidationSuccess:
|
|
1509
|
+
onValidationSuccess: T,
|
|
1498
1510
|
blameFormChildOnValidationFailed: ""
|
|
1499
1511
|
}, {
|
|
1500
1512
|
default: N(() => [
|
|
@@ -1504,43 +1516,43 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1504
1516
|
variant: "outlined"
|
|
1505
1517
|
}, {
|
|
1506
1518
|
default: N(() => {
|
|
1507
|
-
var C,
|
|
1519
|
+
var C, B;
|
|
1508
1520
|
return [
|
|
1509
|
-
(C = e(s)) != null && C.image ? (h(), M(
|
|
1521
|
+
(C = e(s)) != null && C.image ? (h(), M(j, {
|
|
1510
1522
|
key: 0,
|
|
1511
1523
|
width: "100",
|
|
1512
|
-
src: (
|
|
1513
|
-
}, null, 8, ["src"])) :
|
|
1524
|
+
src: (B = e(s)) == null ? void 0 : B.image
|
|
1525
|
+
}, null, 8, ["src"])) : E("", !0),
|
|
1514
1526
|
r(H, { class: "flex flex-col gap-16 justify-between" }, {
|
|
1515
1527
|
default: N(() => {
|
|
1516
|
-
var
|
|
1528
|
+
var m;
|
|
1517
1529
|
return [
|
|
1518
1530
|
r(ne, {
|
|
1519
1531
|
class: "p-0",
|
|
1520
|
-
title: (
|
|
1532
|
+
title: (m = e(s)) == null ? void 0 : m.name,
|
|
1521
1533
|
subtitle: e(l)
|
|
1522
1534
|
}, null, 8, ["title", "subtitle"]),
|
|
1523
1535
|
r(H, { class: "p-0" }, {
|
|
1524
1536
|
default: N(() => {
|
|
1525
|
-
var n,
|
|
1537
|
+
var n, p, y, U, O, R, q, J, me, xe, ie;
|
|
1526
1538
|
return [
|
|
1527
|
-
V("div",
|
|
1539
|
+
V("div", pn, [
|
|
1528
1540
|
(n = e(s)) != null && n.isFeedvibe ? (h(), M(Z, {
|
|
1529
1541
|
key: 0,
|
|
1530
1542
|
label: "Feedvibe"
|
|
1531
|
-
})) :
|
|
1532
|
-
(y = (
|
|
1543
|
+
})) : E("", !0),
|
|
1544
|
+
(y = (p = e(s)) == null ? void 0 : p.titles) != null && y.length ? (h(), M(Z, {
|
|
1533
1545
|
key: 1,
|
|
1534
1546
|
label: `${e(s).titles.length} title(s)`
|
|
1535
|
-
}, null, 8, ["label"])) :
|
|
1536
|
-
(
|
|
1547
|
+
}, null, 8, ["label"])) : E("", !0),
|
|
1548
|
+
(O = (U = e(s)) == null ? void 0 : U.vouchers) != null && O.length ? (h(), M(Z, {
|
|
1537
1549
|
key: 2,
|
|
1538
1550
|
label: `${e(s).vouchers.length} voucher(s)`
|
|
1539
|
-
}, null, 8, ["label"])) :
|
|
1540
|
-
(q = (
|
|
1551
|
+
}, null, 8, ["label"])) : E("", !0),
|
|
1552
|
+
(q = (R = e(s)) == null ? void 0 : R.credit) != null && q.normal || (xe = (me = (J = e(s)) == null ? void 0 : J.credit) == null ? void 0 : me.free) != null && xe.amount ? (h(), M(Z, {
|
|
1541
1553
|
key: 3,
|
|
1542
1554
|
label: `${(e(s).credit.normal || 0) + (((ie = e(s).credit.free) == null ? void 0 : ie.amount) || 0)} credit(s)`
|
|
1543
|
-
}, null, 8, ["label"])) :
|
|
1555
|
+
}, null, 8, ["label"])) : E("", !0)
|
|
1544
1556
|
])
|
|
1545
1557
|
];
|
|
1546
1558
|
}),
|
|
@@ -1555,18 +1567,18 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1555
1567
|
_: 1
|
|
1556
1568
|
}),
|
|
1557
1569
|
r(oe, {
|
|
1558
|
-
modelValue: e(
|
|
1559
|
-
"onUpdate:modelValue": $[0] || ($[0] = (C) =>
|
|
1570
|
+
modelValue: e(v),
|
|
1571
|
+
"onUpdate:modelValue": $[0] || ($[0] = (C) => se(v) ? v.value = C : null),
|
|
1560
1572
|
label: "Select member",
|
|
1561
1573
|
searchable: "",
|
|
1562
|
-
items: e(
|
|
1563
|
-
onSearch:
|
|
1574
|
+
items: e(c),
|
|
1575
|
+
onSearch: d,
|
|
1564
1576
|
rules: [(C) => !!C > 0 || "Member is required"],
|
|
1565
1577
|
"helper-text": "Type to search member"
|
|
1566
1578
|
}, null, 8, ["modelValue", "items", "rules"]),
|
|
1567
1579
|
r(F, {
|
|
1568
1580
|
modelValue: e(o),
|
|
1569
|
-
"onUpdate:modelValue": $[1] || ($[1] = (C) =>
|
|
1581
|
+
"onUpdate:modelValue": $[1] || ($[1] = (C) => se(o) ? o.value = C : null),
|
|
1570
1582
|
label: "Reference (optional)",
|
|
1571
1583
|
rules: [
|
|
1572
1584
|
(C) => C.length < 50 || "Reference must be less than 50 characters"
|
|
@@ -1581,93 +1593,93 @@ const Jt = /* @__PURE__ */ te({
|
|
|
1581
1593
|
};
|
|
1582
1594
|
}
|
|
1583
1595
|
});
|
|
1584
|
-
var
|
|
1585
|
-
const
|
|
1596
|
+
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", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
|
|
1597
|
+
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" }, xn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, Cn = { class: "flex flex-col gap-16 text-center" }, _n = { class: "fm-typo-en-title-sm-800" }, Sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, eo = /* @__PURE__ */ te({
|
|
1586
1598
|
__name: "Store",
|
|
1587
1599
|
setup(x) {
|
|
1588
1600
|
const S = {
|
|
1589
1601
|
label: "Setup payout account",
|
|
1590
1602
|
value: "payout",
|
|
1591
1603
|
isPrimary: !1
|
|
1592
|
-
}, { t: a } = he(),
|
|
1604
|
+
}, { t: a } = he(), g = {
|
|
1593
1605
|
label: a("connect.store.actions.setting"),
|
|
1594
1606
|
value: "setting",
|
|
1595
1607
|
isPrimary: !1
|
|
1596
1608
|
}, s = {
|
|
1597
1609
|
label: a("connect.store.actions.manageReward"),
|
|
1598
1610
|
value: "create_reward"
|
|
1599
|
-
},
|
|
1611
|
+
}, v = {
|
|
1600
1612
|
label: a("connect.store.actions.addCategory"),
|
|
1601
1613
|
value: "create_category",
|
|
1602
1614
|
isPrimary: !0,
|
|
1603
1615
|
prependIcon: "add"
|
|
1604
|
-
}, o = I(),
|
|
1605
|
-
async function $(
|
|
1606
|
-
var
|
|
1607
|
-
|
|
1616
|
+
}, o = I(), c = bt(), i = Te(), { global: t, minor: u } = Le, f = Ee(), d = L(() => i.sortedStoreCategories), T = L(() => i.sortedStoreCategories.map((b) => b.name)), l = I(), w = I();
|
|
1617
|
+
async function $(b) {
|
|
1618
|
+
var k;
|
|
1619
|
+
b === "setting" ? (k = l.value) == null || k.showSheet(!0, i.storeOption) : b === "create_category" ? H(-1) : b === "create_reward" ? await c.push({ name: at["$connect-STORE_REWARDS"] }) : b == "payout" && window.open(bn.paymentPortalUrl, "_blank");
|
|
1608
1620
|
}
|
|
1609
|
-
function
|
|
1610
|
-
var
|
|
1611
|
-
const C = !!((
|
|
1621
|
+
function j(b, k) {
|
|
1622
|
+
var p;
|
|
1623
|
+
const C = !!((p = k.company) != null && p.sstRegNo), B = k.inclusiveTaxes ?? [], m = W.taxSystem.map((y) => y.code), n = C ? B.flatMap((y) => {
|
|
1612
1624
|
console.log(y, "inclusive tax");
|
|
1613
|
-
const
|
|
1614
|
-
return
|
|
1625
|
+
const U = W.systemDefaultCode(y.systemCode);
|
|
1626
|
+
return U ? [{ systemCode: y.systemCode, taxCode: U.taxCode }] : [];
|
|
1615
1627
|
}) : [];
|
|
1616
1628
|
return console.log([
|
|
1617
1629
|
["hasSstRegNo", C],
|
|
1618
1630
|
["defaultTaxCodes", n],
|
|
1619
|
-
["inclusiveTaxes",
|
|
1620
|
-
["taxSystemCodes",
|
|
1621
|
-
]),
|
|
1631
|
+
["inclusiveTaxes", B],
|
|
1632
|
+
["taxSystemCodes", m]
|
|
1633
|
+
]), b.map((y) => ({
|
|
1622
1634
|
...y,
|
|
1623
|
-
bundles: y.bundles.map((
|
|
1624
|
-
const { pf_vouchers:
|
|
1635
|
+
bundles: y.bundles.map((U) => {
|
|
1636
|
+
const { pf_vouchers: O, ...R } = U;
|
|
1625
1637
|
if (!C)
|
|
1626
1638
|
return {
|
|
1627
|
-
...
|
|
1639
|
+
...R,
|
|
1628
1640
|
taxes: [],
|
|
1629
1641
|
taxTotals: [],
|
|
1630
|
-
priceWithTaxes: { ...
|
|
1642
|
+
priceWithTaxes: { ...R.price }
|
|
1631
1643
|
};
|
|
1632
|
-
const q = n, J =
|
|
1644
|
+
const q = n, J = He(
|
|
1633
1645
|
W.fullTax,
|
|
1634
1646
|
q,
|
|
1635
|
-
|
|
1636
|
-
Number(
|
|
1637
|
-
|
|
1638
|
-
|
|
1647
|
+
R.price,
|
|
1648
|
+
Number(R.credit.normal),
|
|
1649
|
+
B,
|
|
1650
|
+
m
|
|
1639
1651
|
);
|
|
1640
1652
|
return {
|
|
1641
|
-
...
|
|
1653
|
+
...R,
|
|
1642
1654
|
taxes: q,
|
|
1643
1655
|
taxTotals: J,
|
|
1644
|
-
priceWithTaxes:
|
|
1656
|
+
priceWithTaxes: qe(
|
|
1645
1657
|
J,
|
|
1646
|
-
|
|
1647
|
-
|
|
1658
|
+
R.price,
|
|
1659
|
+
B
|
|
1648
1660
|
)
|
|
1649
1661
|
};
|
|
1650
1662
|
})
|
|
1651
1663
|
}));
|
|
1652
1664
|
}
|
|
1653
|
-
async function ne(
|
|
1654
|
-
const
|
|
1665
|
+
async function ne(b, k, C) {
|
|
1666
|
+
const B = !C && !!k, m = !!C && !k;
|
|
1655
1667
|
let n;
|
|
1656
|
-
if (
|
|
1657
|
-
const y = W.taxSystem[0] ? W.systemDefaultCode(W.taxSystem[0].code) : void 0,
|
|
1668
|
+
if (B) {
|
|
1669
|
+
const y = W.taxSystem[0] ? W.systemDefaultCode(W.taxSystem[0].code) : void 0, U = y ? `${y.name} (${y.taxCode})` : a("connect.store.taxPropagation.defaultTax");
|
|
1658
1670
|
n = a("connect.store.taxPropagation.addConfirm", {
|
|
1659
|
-
taxCode:
|
|
1671
|
+
taxCode: U
|
|
1660
1672
|
});
|
|
1661
|
-
} else
|
|
1673
|
+
} else m ? n = a("connect.store.taxPropagation.removeConfirm") : n = a("connect.store.taxPropagation.updateConfirm");
|
|
1662
1674
|
await ye.confirm(
|
|
1663
1675
|
n,
|
|
1664
1676
|
a("connect.store.taxPropagation.title"),
|
|
1665
1677
|
a("connect.store.taxPropagation.confirm"),
|
|
1666
1678
|
a("connect.common.cancel")
|
|
1667
|
-
) && await
|
|
1679
|
+
) && await u(
|
|
1668
1680
|
async () => {
|
|
1669
|
-
const y = Fe(i.sortedStoreCategories),
|
|
1670
|
-
await be.updateStoreBundle({ categories:
|
|
1681
|
+
const y = Fe(i.sortedStoreCategories), U = j(y, b);
|
|
1682
|
+
await be.updateStoreBundle({ categories: U }), await i.readMemberStore(), await i.readMembership(), await i.readRewards();
|
|
1671
1683
|
},
|
|
1672
1684
|
{
|
|
1673
1685
|
message: a("connect.store.taxPropagation.updating"),
|
|
@@ -1675,77 +1687,77 @@ const fn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1675
1687
|
}
|
|
1676
1688
|
);
|
|
1677
1689
|
}
|
|
1678
|
-
async function Z(
|
|
1679
|
-
var
|
|
1680
|
-
const
|
|
1681
|
-
((
|
|
1682
|
-
),
|
|
1683
|
-
await
|
|
1690
|
+
async function Z(b) {
|
|
1691
|
+
var U, O, R, q;
|
|
1692
|
+
const k = ((O = (U = i.storeOption) == null ? void 0 : U.company) == null ? void 0 : O.sstRegNo) ?? "", C = ae.cloneDeep(
|
|
1693
|
+
((R = i.storeOption) == null ? void 0 : R.inclusiveTaxes) ?? []
|
|
1694
|
+
), B = ((q = b.company) == null ? void 0 : q.sstRegNo) ?? "";
|
|
1695
|
+
await u(
|
|
1684
1696
|
async () => {
|
|
1685
1697
|
var J;
|
|
1686
|
-
await be.updateStore(
|
|
1698
|
+
await be.updateStore(b), await i.readMemberStore(), (J = l.value) == null || J.showSheet(!1);
|
|
1687
1699
|
},
|
|
1688
1700
|
{
|
|
1689
1701
|
message: a("connect.store.setting.update.message"),
|
|
1690
1702
|
successMessage: a("connect.store.setting.update.success")
|
|
1691
1703
|
}
|
|
1692
1704
|
);
|
|
1693
|
-
const
|
|
1705
|
+
const m = k !== B, n = !ae.isEqual(
|
|
1694
1706
|
C,
|
|
1695
|
-
|
|
1707
|
+
b.inclusiveTaxes ?? []
|
|
1696
1708
|
);
|
|
1697
|
-
!(
|
|
1709
|
+
!(m || n) || i.sortedStoreCategories.flatMap(
|
|
1698
1710
|
(J) => J.bundles
|
|
1699
|
-
).length === 0 || await ne(
|
|
1711
|
+
).length === 0 || await ne(b, B, k);
|
|
1700
1712
|
}
|
|
1701
|
-
async function H(
|
|
1702
|
-
var
|
|
1713
|
+
async function H(b = -1) {
|
|
1714
|
+
var k, C;
|
|
1703
1715
|
if ((!i.storeOption || !i.storeOption.company) && await ye.confirm(
|
|
1704
1716
|
a("connect.store.category.setup.title"),
|
|
1705
1717
|
a("connect.store.category.setup.button"),
|
|
1706
1718
|
a("connect.store.category.setup.action"),
|
|
1707
1719
|
a("connect.common.cancel")
|
|
1708
1720
|
))
|
|
1709
|
-
return (
|
|
1710
|
-
|
|
1711
|
-
title:
|
|
1712
|
-
contentComponent:
|
|
1721
|
+
return (k = l.value) == null ? void 0 : k.showSheet(!0);
|
|
1722
|
+
f.open({
|
|
1723
|
+
title: b == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
|
|
1724
|
+
contentComponent: kt,
|
|
1713
1725
|
contentComponentProps: {
|
|
1714
|
-
initialValue: ((C =
|
|
1715
|
-
action:
|
|
1726
|
+
initialValue: ((C = d.value[b]) == null ? void 0 : C.name) ?? "",
|
|
1727
|
+
action: b == -1 ? "add" : "edit"
|
|
1716
1728
|
}
|
|
1717
|
-
}).onPrimary(async (
|
|
1718
|
-
|
|
1729
|
+
}).onPrimary(async (B) => {
|
|
1730
|
+
B === null && !await ye.remove(
|
|
1719
1731
|
a("connect.store.category.remove.confirm"),
|
|
1720
1732
|
a("connect.store.category.remove.title")
|
|
1721
|
-
) || await
|
|
1733
|
+
) || await u(
|
|
1722
1734
|
async () => {
|
|
1723
|
-
const
|
|
1735
|
+
const m = b == -1 ? [...d.value, { name: B, bundles: [] }] : [...d.value].map((n, p) => p == b ? { ...n, name: B } : n).filter((n) => n.name !== null);
|
|
1724
1736
|
await be.updateStoreBundle({
|
|
1725
|
-
categories:
|
|
1737
|
+
categories: m
|
|
1726
1738
|
}), await i.readMemberStore();
|
|
1727
1739
|
},
|
|
1728
1740
|
{
|
|
1729
|
-
message:
|
|
1730
|
-
successMessage:
|
|
1741
|
+
message: B === null ? a("connect.store.category.update.deleting") : b == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
|
|
1742
|
+
successMessage: B === null ? a("connect.store.category.update.success.deleted") : b == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
|
|
1731
1743
|
}
|
|
1732
1744
|
);
|
|
1733
1745
|
});
|
|
1734
1746
|
}
|
|
1735
|
-
async function z(
|
|
1736
|
-
var
|
|
1737
|
-
|
|
1738
|
-
const
|
|
1739
|
-
for (const
|
|
1740
|
-
for (const
|
|
1741
|
-
console.log(
|
|
1742
|
-
|
|
1743
|
-
const n =
|
|
1747
|
+
async function z(b, k, C, B) {
|
|
1748
|
+
var p, y, U;
|
|
1749
|
+
k ?? (k = (p = w.value) == null ? void 0 : p.target.category), C ?? (C = (y = w.value) == null ? void 0 : y.target.index), B ?? (B = (U = w.value) == null ? void 0 : U.target.originalCategoryIndex);
|
|
1750
|
+
const m = Fe(d.value);
|
|
1751
|
+
for (const O of m)
|
|
1752
|
+
for (const R of O.bundles)
|
|
1753
|
+
console.log(R, "bundle in payload"), "pf_vouchers" in R && delete R.pf_vouchers;
|
|
1754
|
+
k != B && B != null && (m[B].bundles.splice(C, 1), C = m[k].bundles.length);
|
|
1755
|
+
const n = m[k];
|
|
1744
1756
|
if (!n) {
|
|
1745
|
-
|
|
1757
|
+
st.error("Unexpected error", 2e3);
|
|
1746
1758
|
return;
|
|
1747
1759
|
}
|
|
1748
|
-
if (
|
|
1760
|
+
if (b == null) {
|
|
1749
1761
|
if (await ye.remove(
|
|
1750
1762
|
a("connect.store.bundle.delete.confirm"),
|
|
1751
1763
|
a("connect.store.bundle.delete.title")
|
|
@@ -1753,47 +1765,47 @@ const fn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1753
1765
|
return;
|
|
1754
1766
|
n.bundles.splice(C, 1);
|
|
1755
1767
|
} else
|
|
1756
|
-
C == -1 ? n.bundles.push(
|
|
1757
|
-
await
|
|
1768
|
+
C == -1 ? n.bundles.push(b) : n.bundles[C] = b;
|
|
1769
|
+
await u(
|
|
1758
1770
|
async () => {
|
|
1759
|
-
var
|
|
1760
|
-
if (
|
|
1761
|
-
const q = (
|
|
1762
|
-
q === null &&
|
|
1771
|
+
var O, R;
|
|
1772
|
+
if (b != null) {
|
|
1773
|
+
const q = (O = w.value) == null ? void 0 : O.bundleImage;
|
|
1774
|
+
q === null && b.image ? (await Ve.delete(b.image), b.image = null) : q && (b.image = await Ve.update(
|
|
1763
1775
|
Ve.bundleImagePath(void 0, q),
|
|
1764
1776
|
q
|
|
1765
1777
|
));
|
|
1766
1778
|
}
|
|
1767
1779
|
await be.updateStoreBundle({
|
|
1768
|
-
categories:
|
|
1769
|
-
}), await i.readMemberStore(), await i.readMembership(), await i.readRewards(), (
|
|
1780
|
+
categories: m
|
|
1781
|
+
}), await i.readMemberStore(), await i.readMembership(), await i.readRewards(), (R = w.value) == null || R.showSheet(!1);
|
|
1770
1782
|
},
|
|
1771
1783
|
{
|
|
1772
|
-
message: `${
|
|
1773
|
-
successMessage: `Bundle ${
|
|
1784
|
+
message: `${b == null ? "Deleting" : C == -1 ? "Creating" : "Updating"} bundle`,
|
|
1785
|
+
successMessage: `Bundle ${b == null ? "deleted" : C == -1 ? "created" : "updated"} successfully`
|
|
1774
1786
|
}
|
|
1775
1787
|
);
|
|
1776
1788
|
}
|
|
1777
|
-
function oe(
|
|
1778
|
-
var
|
|
1779
|
-
(
|
|
1780
|
-
...
|
|
1781
|
-
bundle:
|
|
1789
|
+
function oe(b) {
|
|
1790
|
+
var k;
|
|
1791
|
+
(k = w.value) == null || k.showSheet(!0, {
|
|
1792
|
+
...b,
|
|
1793
|
+
bundle: b.bundle ? Fe(b.bundle) : void 0
|
|
1782
1794
|
});
|
|
1783
1795
|
}
|
|
1784
1796
|
const F = I([]);
|
|
1785
|
-
function re(
|
|
1786
|
-
var
|
|
1787
|
-
(
|
|
1788
|
-
bundle:
|
|
1797
|
+
function re(b) {
|
|
1798
|
+
var k;
|
|
1799
|
+
(k = o.value) == null || k.showSheet({
|
|
1800
|
+
bundle: b
|
|
1789
1801
|
});
|
|
1790
1802
|
}
|
|
1791
1803
|
return ve(async () => {
|
|
1792
|
-
var
|
|
1804
|
+
var k, C;
|
|
1793
1805
|
await t(async () => {
|
|
1794
|
-
var
|
|
1795
|
-
if (await i.readMemberStore(), await i.readMembership(), await i.readRewards(), await i.readPayoutAccount(), (
|
|
1796
|
-
switch ((
|
|
1806
|
+
var B, m;
|
|
1807
|
+
if (await i.readMemberStore(), await i.readMembership(), await i.readRewards(), await i.readPayoutAccount(), (B = c.currentRoute.value.query) != null && B.action) {
|
|
1808
|
+
switch ((m = c.currentRoute.value.query) == null ? void 0 : m.action) {
|
|
1797
1809
|
case "update_setting":
|
|
1798
1810
|
$("setting");
|
|
1799
1811
|
break;
|
|
@@ -1801,116 +1813,116 @@ const fn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1801
1813
|
H(-1);
|
|
1802
1814
|
break;
|
|
1803
1815
|
case "create_feedvibe_bundle":
|
|
1804
|
-
|
|
1816
|
+
f.open({
|
|
1805
1817
|
title: "Select category",
|
|
1806
|
-
contentComponent:
|
|
1818
|
+
contentComponent: Ut
|
|
1807
1819
|
}).onPrimary((n) => {
|
|
1808
|
-
|
|
1809
|
-
categories:
|
|
1820
|
+
f.close(), oe({
|
|
1821
|
+
categories: T.value,
|
|
1810
1822
|
category: n,
|
|
1811
1823
|
index: -1,
|
|
1812
1824
|
bundle: {
|
|
1813
|
-
...
|
|
1825
|
+
...ae.cloneDeep(we),
|
|
1814
1826
|
isFeedvibe: !0,
|
|
1815
|
-
price:
|
|
1827
|
+
price: A.Dinero.fromNumber({
|
|
1816
1828
|
number: 10,
|
|
1817
1829
|
precision: 2
|
|
1818
1830
|
}).toObject()
|
|
1819
1831
|
}
|
|
1820
1832
|
});
|
|
1821
|
-
}).onTertiary(() =>
|
|
1833
|
+
}).onTertiary(() => f.close());
|
|
1822
1834
|
break;
|
|
1823
1835
|
}
|
|
1824
|
-
|
|
1836
|
+
c.replace({ query: {} });
|
|
1825
1837
|
}
|
|
1826
1838
|
});
|
|
1827
|
-
const
|
|
1839
|
+
const b = ((k = i.payoutAccount) == null ? void 0 : k.status) === "APPROVED" && ((C = i.payoutAccount) == null ? void 0 : C.enable) === !0;
|
|
1828
1840
|
F.value = [
|
|
1829
|
-
...
|
|
1830
|
-
|
|
1841
|
+
...b ? [] : [S],
|
|
1842
|
+
g,
|
|
1831
1843
|
s,
|
|
1832
|
-
|
|
1844
|
+
v
|
|
1833
1845
|
];
|
|
1834
|
-
}), (
|
|
1835
|
-
const C = _("FmPageHead"),
|
|
1846
|
+
}), (b, k) => {
|
|
1847
|
+
const C = _("FmPageHead"), B = _("FmButton"), m = _("FmCard");
|
|
1836
1848
|
return h(), D(Y, null, [
|
|
1837
1849
|
r(C, {
|
|
1838
1850
|
title: e(a)("connect.store.title"),
|
|
1839
1851
|
actions: e(F),
|
|
1840
1852
|
"onClick:action": $
|
|
1841
1853
|
}, null, 8, ["title", "actions"]),
|
|
1842
|
-
V("div",
|
|
1843
|
-
e(
|
|
1844
|
-
(h(!0), D(Y, null, ue(e(
|
|
1854
|
+
V("div", gn, [
|
|
1855
|
+
e(d) && e(d).length > 0 ? (h(), D(Y, { key: 0 }, [
|
|
1856
|
+
(h(!0), D(Y, null, ue(e(d), (n, p) => (h(), D("div", {
|
|
1845
1857
|
key: n.name,
|
|
1846
1858
|
class: "space-y-8 py-12"
|
|
1847
1859
|
}, [
|
|
1848
|
-
V("div",
|
|
1849
|
-
V("div",
|
|
1850
|
-
r(
|
|
1851
|
-
r(
|
|
1860
|
+
V("div", vn, [
|
|
1861
|
+
V("div", hn, K(n.name), 1),
|
|
1862
|
+
r(ke, { json: n }, null, 8, ["json"]),
|
|
1863
|
+
r(B, {
|
|
1852
1864
|
icon: "edit",
|
|
1853
1865
|
size: "md",
|
|
1854
1866
|
variant: "tertiary",
|
|
1855
|
-
onClick: (y) => H(
|
|
1867
|
+
onClick: (y) => H(p)
|
|
1856
1868
|
}, null, 8, ["onClick"])
|
|
1857
1869
|
]),
|
|
1858
|
-
V("div",
|
|
1859
|
-
(h(!0), D(Y, null, ue(n.bundles, (y,
|
|
1870
|
+
V("div", xn, [
|
|
1871
|
+
(h(!0), D(Y, null, ue(n.bundles, (y, U) => (h(), M(Ft, {
|
|
1860
1872
|
bundle: y,
|
|
1861
1873
|
key: y._id,
|
|
1862
|
-
onEdit: (
|
|
1874
|
+
onEdit: (O) => oe({
|
|
1863
1875
|
bundle: y,
|
|
1864
|
-
category:
|
|
1865
|
-
index:
|
|
1866
|
-
categories: e(
|
|
1876
|
+
category: p,
|
|
1877
|
+
index: U,
|
|
1878
|
+
categories: e(T)
|
|
1867
1879
|
}),
|
|
1868
|
-
onDelete: (
|
|
1880
|
+
onDelete: (O) => z(null, p, U),
|
|
1869
1881
|
onSend: re
|
|
1870
1882
|
}, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
|
|
1871
|
-
r(
|
|
1883
|
+
r(Vt, {
|
|
1872
1884
|
onCreate: (y) => oe({
|
|
1873
|
-
category:
|
|
1885
|
+
category: p,
|
|
1874
1886
|
index: -1,
|
|
1875
|
-
categories: e(
|
|
1887
|
+
categories: e(T)
|
|
1876
1888
|
})
|
|
1877
1889
|
}, null, 8, ["onCreate"])
|
|
1878
1890
|
])
|
|
1879
1891
|
]))), 128)),
|
|
1880
|
-
r(
|
|
1892
|
+
r(mn, {
|
|
1881
1893
|
ref_key: "bundleSheetRef",
|
|
1882
1894
|
ref: w,
|
|
1883
1895
|
onUpdate: z
|
|
1884
1896
|
}, null, 512)
|
|
1885
|
-
], 64)) : (h(), M(
|
|
1897
|
+
], 64)) : (h(), M(m, {
|
|
1886
1898
|
key: 1,
|
|
1887
1899
|
variant: "outlined",
|
|
1888
1900
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
1889
1901
|
}, {
|
|
1890
1902
|
default: N(() => [
|
|
1891
|
-
|
|
1892
|
-
src:
|
|
1903
|
+
k[1] || (k[1] = V("img", {
|
|
1904
|
+
src: Ge,
|
|
1893
1905
|
class: "aspect-square w-[150px]"
|
|
1894
1906
|
}, null, -1)),
|
|
1895
|
-
V("div",
|
|
1896
|
-
V("div",
|
|
1897
|
-
V("div",
|
|
1907
|
+
V("div", Cn, [
|
|
1908
|
+
V("div", _n, K(e(a)("connect.store.bundle.title")), 1),
|
|
1909
|
+
V("div", Sn, K(e(a)("connect.store.bundle.description")), 1)
|
|
1898
1910
|
]),
|
|
1899
|
-
r(
|
|
1911
|
+
r(B, {
|
|
1900
1912
|
variant: "primary",
|
|
1901
1913
|
label: e(a)("connect.store.actions.addCategory"),
|
|
1902
1914
|
icon: "add",
|
|
1903
|
-
onClick:
|
|
1915
|
+
onClick: k[0] || (k[0] = (n) => H(-1))
|
|
1904
1916
|
}, null, 8, ["label"])
|
|
1905
1917
|
]),
|
|
1906
1918
|
_: 1
|
|
1907
1919
|
})),
|
|
1908
|
-
r(
|
|
1920
|
+
r(Gt, {
|
|
1909
1921
|
ref_key: "settingSheetRef",
|
|
1910
1922
|
ref: l,
|
|
1911
1923
|
onUpdate: Z
|
|
1912
1924
|
}, null, 512),
|
|
1913
|
-
r(
|
|
1925
|
+
r(yn, {
|
|
1914
1926
|
ref_key: "sendBundleSheetRef",
|
|
1915
1927
|
ref: o
|
|
1916
1928
|
}, null, 512)
|
|
@@ -1920,5 +1932,5 @@ const fn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1920
1932
|
}
|
|
1921
1933
|
});
|
|
1922
1934
|
export {
|
|
1923
|
-
|
|
1935
|
+
eo as default
|
|
1924
1936
|
};
|