@feedmepos/mf-connect 0.1.9-prod → 0.1.10-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.
Files changed (90) hide show
  1. package/dist/{Analytic-8Ew7y5t9.js → Analytic-CpSbitWV.js} +24 -23
  2. package/dist/{App-3BVNH3r-.js → App-BPT8XzjX.js} +56 -51
  3. package/dist/{Broadcast-CrsPUhLT.js → Broadcast-CJHpiQeN.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DE300Y56.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DUPqWdIm.js} +7 -7
  5. package/dist/Card-Bvn36zqZ.js +895 -0
  6. package/dist/{Collections-djS9hLI8.js → Collections-Bq6OxsJC.js} +24 -29
  7. package/dist/{Credit-D4KEvIov.js → Credit-Dno_g7dW.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-cGbwORhw.js} +648 -1284
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-aEWfdpCg.js → EffectSheet.vue_vue_type_style_index_0_lang-Ho7zwlbb.js} +19 -19
  10. package/dist/{Experience-2FPLO7aV.js → Experience-BC1qSIGO.js} +8 -8
  11. package/dist/{Game-e_UjVJgU.js → Game-C_CKGMBW.js} +8 -8
  12. package/dist/Index-BXFaWTfw.js +255 -0
  13. package/dist/{Marketing-B2hCjZ2r.js → Marketing-Ni0WAie5.js} +5 -5
  14. package/dist/{Member-D_ykRIBb.js → Member-djnisrK1.js} +4 -4
  15. package/dist/{MemberList-LmzzYxEn.js → MemberList-CclU-3B7.js} +193 -189
  16. package/dist/{MemberTransactions-B2vqlKaP.js → MemberTransactions-DVVsv3Ux.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DQ2ubF0N.js → MessageInput.vue_vue_type_script_setup_true_lang-khyDg1m4.js} +2 -2
  18. package/dist/Mission-Z5somdo_.js +273 -0
  19. package/dist/Overview-BvMVz3lQ.js +1074 -0
  20. package/dist/{Point-DFriwWWY.js → Point-DdPukiTg.js} +8 -8
  21. package/dist/{Promotion-Db3IEs2F.js → Promotion-DCqdIwjG.js} +9 -9
  22. package/dist/Record-CvMxXm1B.js +337 -0
  23. package/dist/Reward-CiJHGXfQ.js +441 -0
  24. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CrGCBRmH.js +150 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-tnT6i0Jq.js +1638 -0
  26. package/dist/{Segment-CE8q9JV2.js → Segment-CQb3j-o0.js} +13 -13
  27. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-B7YqIU5D.js +181 -0
  28. package/dist/{Setting-Vcz1S27V.js → Setting-91cK3ssU.js} +31 -31
  29. package/dist/Store-B-uldUKt.js +1744 -0
  30. package/dist/{StoreRewards-Dt30AkWo.js → StoreRewards-dDNeFlA9.js} +12 -12
  31. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BVb1X0aq.js +1132 -0
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-f59onlgt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Ds0WxGxr.js} +1 -1
  33. package/dist/{Tier-a6yXEtLd.js → Tier-_jMaLj3u.js} +19 -19
  34. package/dist/{Title-A3-2EI0w.js → Title-By7o67aT.js} +19 -19
  35. package/dist/{Transaction-DswABr2P.js → Transaction-BLpEgeI2.js} +2 -2
  36. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Bf_nO9zH.js +130 -0
  37. package/dist/{Voucher-DEoVgZYa.js → Voucher-CG5tfibn.js} +11 -11
  38. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DpQUoXyQ.js +419 -0
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-ccc1vxjS.js → ZodTextField.vue_vue_type_script_setup_true_lang-YwGR2En3.js} +1 -1
  40. package/dist/{app-C23GfQGq.js → app-DDmTqTb7.js} +1 -1
  41. package/dist/{app-C66C2KLW.js → app-vCqTQIeC.js} +424 -273
  42. package/dist/app.js +1 -1
  43. package/dist/{business-DNAVZOSH.js → business-Cz78KGF2.js} +1 -1
  44. package/dist/{campaign-Cv0HaUD1.js → campaign-BBd4o7F_.js} +2 -2
  45. package/dist/campaign.enum-CIhi0b-m.js +20 -0
  46. package/dist/campaign.fn-5silF1DK.js +758 -0
  47. package/dist/collectible.enum-cMIQ6ogq.js +19 -0
  48. package/dist/{collection.fn-Dxzr2oPt.js → collection.fn-BGc7Qeli.js} +2 -2
  49. package/dist/dto-i04OPJfW.js +2018 -0
  50. package/dist/{effect-CUuL8Tci.js → effect-D8UzkYRg.js} +1 -1
  51. package/dist/{email-addresses-Yt3s7i2b.js → email-addresses-u05o35hN.js} +1 -1
  52. package/dist/{export-CNg5YWMm.js → export-BEXuPYEd.js} +3 -3
  53. package/dist/{helper-DzmKNFue.js → helper-RptRJGv6.js} +1 -1
  54. package/dist/{index-Dnf7j71V.js → index-B8s-gucK.js} +9 -3
  55. package/dist/{index-B88e_9YI.js → index-BjHZUhiH.js} +1 -1
  56. package/dist/{index-O9lB54LY.js → index-Bpu2DYUc.js} +1348 -1342
  57. package/dist/{index-BK8X9RF6.js → index-C6-rCMhD.js} +3 -3
  58. package/dist/{index-D0obMrAS.js → index-Cq_ZIbRm.js} +173 -62
  59. package/dist/{index-CsCgQ8gt.js → index-DFAnoAe9.js} +1 -1
  60. package/dist/index-DbyJ6Nyn.js +54 -0
  61. package/dist/{index-yzH5eyKW.js → index-Dt6K2eG8.js} +1 -1
  62. package/dist/{index-9CXt2kbQ.js → index-DwzoqCt8.js} +293 -287
  63. package/dist/index-UfL5qRzR.js +1049 -0
  64. package/dist/index-g8EbRVnr.js +32 -0
  65. package/dist/{index-QuBsnXgx.js → index-hEE_ntHd.js} +1 -1
  66. package/dist/index-vh86FiIQ.js +10 -0
  67. package/dist/{index.esm2017-TpBElhnN.js → index.esm2017-BSzW_yaL.js} +1 -1
  68. package/dist/{loading-ChoC5E9d.js → loading-DjEdwdnj.js} +156 -153
  69. package/dist/{membership-CU-k0-Tf.js → membership-BL9Xs8lD.js} +52 -44
  70. package/dist/{money-DANmyTBj.js → money-D7lq0cx-.js} +1 -1
  71. package/dist/{number-DrocTWDD.js → number-BiDabTkI.js} +1 -1
  72. package/dist/objectid-CXf0jb1W.js +145 -0
  73. package/dist/reward-Cr8rbe5R.js +36 -0
  74. package/dist/{rule-builder-3YRdr18A.js → rule-builder-DPKFZ5UX.js} +1 -1
  75. package/dist/{rule-BQLmpER9.js → rule-vkYJij4h.js} +4 -3
  76. package/dist/{template-DOKU1QkY.js → template-Bep5Y5ch.js} +4 -4
  77. package/dist/trigger-fWhQ3bqv.js +144 -0
  78. package/dist/{usePagination-JGI7x0W7.js → usePagination-DSF5b4hM.js} +1 -1
  79. package/dist/user-9UiaP0xs.js +54 -0
  80. package/dist/{vue-i18n-Bch1JmhI.js → vue-i18n-BhiDOB1j.js} +232 -232
  81. package/package.json +2 -2
  82. package/dist/Card-DndggRLr.js +0 -1036
  83. package/dist/Mission-CsLdMq1M.js +0 -261
  84. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-_P2yImhi.js +0 -1804
  85. package/dist/Store-C8kT7JN5.js +0 -1531
  86. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cc2F_06x.js +0 -1065
  87. package/dist/dto-CcrufW2j.js +0 -2770
  88. package/dist/index-C7745kXl.js +0 -755
  89. package/dist/index-CZ28ywyB.js +0 -298
  90. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,1531 +0,0 @@
1
- import { defineComponent as X, computed as I, resolveComponent as F, openBlock as _, createBlock as O, withCtx as T, createElementVNode as x, createElementBlock as P, createVNode as i, createCommentVNode as E, toDisplayString as D, unref as e, Fragment as q, renderList as le, ref as N, isRef as ie, reactive as je, onMounted as ye, watch as Ve, toRaw as Le, createTextVNode as se, h as qe } from "vue";
2
- import { _ as He } from "./tier-BJDhpH6X.js";
3
- import { useDialog as Ne, useDialogChild as Oe, components as Ke } from "@feedmepos/ui-library";
4
- import { c as U, e as be, S as We } from "./index-BK8X9RF6.js";
5
- import { d as oe, a as ze, u as Ye, p as ge, n as Je, f as ve } from "./loading-ChoC5E9d.js";
6
- import { u as Fe, C as ce } from "./membership-CU-k0-Tf.js";
7
- import { a as Ge, c as De } from "./object-qECH92oz.js";
8
- import { _ as re } from "./lodash-B5I3zXaY.js";
9
- import { u as pe } from "./vue-i18n-Bch1JmhI.js";
10
- import { Z as Y, g as W, a as z } from "./zod-Bg2FbC-D.js";
11
- import { z as J, R as Xe } from "./app-C66C2KLW.js";
12
- import { F as Ze, a as Qe, b as et, c as Be } from "./index-CZ28ywyB.js";
13
- import { u as xe } from "./app-wDQR6dpb.js";
14
- import { _ as Q } from "./ZodTextField.vue_vue_type_script_setup_true_lang-ccc1vxjS.js";
15
- import { J as Se } from "./JsonViewer-v8_C7l5N.js";
16
- import { _ as tt } from "./index-O9lB54LY.js";
17
- import { _ as ot } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
18
- import { _ as nt } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
19
- import { z as lt, a as at } from "./money-DANmyTBj.js";
20
- import { F as st } from "./number-DrocTWDD.js";
21
- import { t as rt } from "./helper-DzmKNFue.js";
22
- import "./index-yzH5eyKW.js";
23
- import { useRouter as it } from "vue-router";
24
- import { m as he } from "./index-Dnf7j71V.js";
25
- function dt(b) {
26
- return oe.DineroFactory(b).toUnit();
27
- }
28
- function ct(b, h, a, y, m = [], g = []) {
29
- const n = tt.compact(
30
- h.map((t) => b.find((r) => r.systemCode === t.systemCode && r.taxCode === t.taxCode)).filter((t) => !!t && g.includes(t.systemCode))
31
- ), s = n.reduce(
32
- (t, r) => {
33
- var u;
34
- return Object.assign(t, {
35
- [r.taxCode]: {
36
- inclusive: ((u = m.find((d) => d.systemCode === r.systemCode)) == null ? void 0 : u.inclusive) || !1,
37
- adjustment: {
38
- level: 1,
39
- type: {
40
- type: "BY_MULTIPLIER",
41
- amount: {
42
- amount: r.rate.amount,
43
- precision: r.rate.precision,
44
- currency: "MYR"
45
- }
46
- }
47
- }
48
- }
49
- });
50
- },
51
- {}
52
- ), f = oe.Calculator.calculate({
53
- items: {
54
- 0: {
55
- quantity: 1,
56
- adjustments: {
57
- price: {
58
- level: 0,
59
- type: {
60
- type: "BY_AMOUNT",
61
- amount: oe.DineroFactory(a).subtract(oe.Dinero.fromNumber({ number: y }).toObject()).toObject()
62
- }
63
- }
64
- },
65
- taxes: s
66
- }
67
- },
68
- adjustments: {},
69
- roundToNearest: 0
70
- });
71
- return n.map((t) => ({
72
- setting: t,
73
- systemCode: t.systemCode,
74
- name: t.name,
75
- taxCode: t.taxCode,
76
- rate: t.rate,
77
- total: oe.DineroFactory({
78
- ...f.items[0].taxes[t.taxCode]
79
- }).convertPrecision(2).toObject()
80
- }));
81
- }
82
- function ut(b, h, a) {
83
- return b ? b.reduce((y, m) => {
84
- var g;
85
- return (g = a.find((n) => n.systemCode === m.systemCode)) != null && g.inclusive || (y = oe.DineroFactory(y.toObject()).add(m.total)), y;
86
- }, oe.DineroFactory(h)).toObject() : oe.DineroFactory(h).toObject();
87
- }
88
- const mt = { class: "relative h-[120px] aspect-video flex items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, pt = ["src"], yt = {
89
- key: 2,
90
- class: "absolute top-2 left-2"
91
- }, ft = { class: "absolute top-0 right-0" }, bt = { class: "fm-typo-en-body-lg-600" }, gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = { class: "flex gap-8 items-center flex-wrap" }, ht = /* @__PURE__ */ X({
92
- __name: "StoreBundleCard",
93
- props: {
94
- bundle: { type: Object, required: !0 }
95
- },
96
- emits: ["edit", "delete"],
97
- setup(b, { emit: h }) {
98
- const a = b, y = h, m = I(() => {
99
- const n = [];
100
- return a.bundle.price.amount > 0 && n.push(
101
- `${U.Config.getCountry().currency.symbol}${dt(a.bundle.price)}`
102
- ), a.bundle.coinPrice && n.push(`${a.bundle.coinPrice} point(s)`), n.join(" or ");
103
- }), g = I(() => {
104
- var s, f;
105
- const n = [];
106
- if (a.bundle.titles.length > 0 && n.push(`${a.bundle.titles.length} title(s)`), a.bundle.vouchers.length > 0 && n.push(`${a.bundle.vouchers.length} voucher(s)`), a.bundle.credit.normal || (s = a.bundle.credit.free) != null && s.amount) {
107
- const t = a.bundle.credit.normal + (((f = a.bundle.credit.free) == null ? void 0 : f.amount) ?? 0);
108
- n.push(`${t} credit(s)`);
109
- }
110
- return n;
111
- });
112
- return (n, s) => {
113
- const f = F("FmIcon"), t = F("FmChip"), r = F("FmButton"), u = F("FmMenuItem"), d = F("FmMenu"), V = F("FmCard");
114
- return _(), O(V, {
115
- variant: "outlined",
116
- class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full text-center items-center"
117
- }, {
118
- default: T(() => [
119
- x("div", mt, [
120
- b.bundle.image ? (_(), P("img", {
121
- key: 1,
122
- src: b.bundle.image,
123
- class: "w-full h-full object-contain aspect-video"
124
- }, null, 8, pt)) : (_(), O(f, {
125
- key: 0,
126
- name: "image",
127
- outline: !0,
128
- size: "md",
129
- class: "text-fm-color-neutral-gray-200"
130
- })),
131
- b.bundle.isFeedvibe ? (_(), P("div", yt, [
132
- i(t, {
133
- label: "Feedvibe",
134
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
135
- compact: ""
136
- })
137
- ])) : E("", !0),
138
- x("div", ft, [
139
- i(d, { placement: "bottom-end" }, {
140
- "menu-button": T(() => [
141
- i(r, {
142
- icon: "more_vert",
143
- variant: "tertiary"
144
- })
145
- ]),
146
- default: T(() => [
147
- i(u, {
148
- onClick: s[0] || (s[0] = (l) => y("edit", b.bundle)),
149
- label: "Edit"
150
- }),
151
- i(u, {
152
- onClick: s[1] || (s[1] = (l) => y("delete", b.bundle)),
153
- label: "Delete"
154
- })
155
- ]),
156
- _: 1
157
- })
158
- ])
159
- ]),
160
- x("div", bt, D(b.bundle.name), 1),
161
- x("div", gt, D(e(m) || "Free"), 1),
162
- x("div", vt, [
163
- (_(!0), P(q, null, le(e(g), (l, k) => (_(), O(t, {
164
- key: k,
165
- label: l
166
- }, null, 8, ["label"]))), 128))
167
- ])
168
- ]),
169
- _: 1
170
- });
171
- };
172
- }
173
- }), _t = /* @__PURE__ */ X({
174
- __name: "AddBundleCard",
175
- emits: ["create"],
176
- setup(b, { emit: h }) {
177
- const { t: a } = pe(), y = h;
178
- return (m, g) => {
179
- const n = F("FmButton"), s = F("FmCard");
180
- return _(), O(s, {
181
- variant: "outlined",
182
- class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
183
- }, {
184
- default: T(() => [
185
- i(n, {
186
- onClick: g[0] || (g[0] = (f) => y("create")),
187
- label: e(a)("connect.store.actions.addBundle"),
188
- icon: "add",
189
- variant: "secondary"
190
- }, null, 8, ["label"])
191
- ]),
192
- _: 1
193
- });
194
- };
195
- }
196
- }), xt = { class: "space-y-16" }, Ct = { class: "flex w-full justify-between pb-16" }, Vt = { class: "flex items-center justify-end gap-8" }, Ft = /* @__PURE__ */ X({
197
- __name: "CategoryDialog",
198
- props: {
199
- action: {
200
- type: String,
201
- default: () => "add"
202
- },
203
- initialValue: {
204
- type: String,
205
- default: () => ""
206
- }
207
- },
208
- setup(b) {
209
- const { t: h } = pe(), a = b, y = Ne(), { emitData: m, emitAction: g } = Oe(), n = N(a.initialValue), s = J.string().min(1);
210
- function f() {
211
- m(n.value), g("primary"), y.close();
212
- }
213
- function t() {
214
- m(null), g("primary"), y.close();
215
- }
216
- return (r, u) => {
217
- const d = F("FmTextField"), V = F("FmButton");
218
- return _(), P("div", xt, [
219
- i(d, {
220
- modelValue: e(n),
221
- "onUpdate:modelValue": u[0] || (u[0] = (l) => ie(n) ? n.value = l : null),
222
- label: e(h)("connect.store.category.label"),
223
- rules: [e(Y).toRule(e(s))]
224
- }, null, 8, ["modelValue", "label", "rules"]),
225
- x("div", Ct, [
226
- x("div", null, [
227
- b.action == "edit" ? (_(), O(V, {
228
- key: 0,
229
- onClick: t,
230
- label: e(h)("connect.common.delete"),
231
- variant: "destructive"
232
- }, null, 8, ["label"])) : E("", !0)
233
- ]),
234
- x("div", Vt, [
235
- i(V, {
236
- label: e(h)("connect.common.cancel"),
237
- variant: "tertiary",
238
- onClick: u[1] || (u[1] = (l) => e(y).close())
239
- }, null, 8, ["label"]),
240
- i(V, {
241
- label: b.action == "edit" ? e(h)("connect.common.edit") : e(h)("connect.common.add"),
242
- disabled: !e(n),
243
- onClick: f
244
- }, null, 8, ["label", "disabled"])
245
- ])
246
- ])
247
- ]);
248
- };
249
- }
250
- }), St = { class: "space-y-16" }, wt = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1), $t = { class: "flex items-center justify-end gap-8 pb-16" }, Pt = /* @__PURE__ */ X({
251
- __name: "SelectCategoryDialog",
252
- setup(b) {
253
- const { emitData: h, emitAction: a } = Oe(), y = Fe(), m = N(), g = I(
254
- () => y.sortedStoreCategories.map((n, s) => ({
255
- label: n.name,
256
- value: s
257
- }))
258
- );
259
- return (n, s) => {
260
- const f = F("FmSelect"), t = F("FmButton");
261
- return _(), P("div", St, [
262
- wt,
263
- i(f, {
264
- placeholder: "Select a category",
265
- items: e(g),
266
- modelValue: e(m),
267
- "onUpdate:modelValue": [
268
- s[0] || (s[0] = (r) => ie(m) ? m.value = r : null),
269
- s[1] || (s[1] = (r) => e(h)(r))
270
- ],
271
- label: "Category"
272
- }, null, 8, ["items", "modelValue"]),
273
- x("div", $t, [
274
- i(t, {
275
- variant: "tertiary",
276
- label: "Cancel",
277
- onClick: s[2] || (s[2] = (r) => e(a)("tertiary"))
278
- }),
279
- i(t, {
280
- label: "Select",
281
- onClick: s[3] || (s[3] = (r) => e(a)("primary")),
282
- disabled: e(m) == null
283
- }, null, 8, ["disabled"])
284
- ])
285
- ]);
286
- };
287
- }
288
- });
289
- function _e(b) {
290
- return b.states.map((h) => ({ label: h, value: h }));
291
- }
292
- const kt = {
293
- [be.F_COUNTRY.enum.MY]: {
294
- states: [
295
- "Johor",
296
- "Kedah",
297
- "Kelantan",
298
- "Kuala Lumpur",
299
- "Labuan",
300
- "Melaka",
301
- "Negeri Sembilan",
302
- "Pahang",
303
- "Perak",
304
- "Perlis",
305
- "Pulau Pinang",
306
- "Putrajaya",
307
- "Sabah",
308
- "Sarawak",
309
- "Selangor",
310
- "Terengganu"
311
- ],
312
- get stateItems() {
313
- return _e(this);
314
- }
315
- },
316
- [be.F_COUNTRY.enum.SG]: {
317
- states: [],
318
- get stateItems() {
319
- return _e(this);
320
- }
321
- },
322
- [be.F_COUNTRY.enum.ID]: {
323
- states: [
324
- "Aceh",
325
- "Bali",
326
- "Bangka-Belitung",
327
- "Banten",
328
- "Bengkulu",
329
- "Central Java",
330
- "Central Sulawesi",
331
- "Daerah Istimewa Yogyakarta",
332
- "East Java",
333
- "East Kalimantan",
334
- "East Nusa Tenggara",
335
- "Gorontalo",
336
- "Jakarta Raya",
337
- "Jambi",
338
- "Kalimantan Tengah",
339
- "Lampung",
340
- "Maluku",
341
- "Maluku Utara",
342
- "North Sulawesi",
343
- "North Sumatra",
344
- "Nusa Tenggara Barat",
345
- "Papua",
346
- "Riau",
347
- "Riau Islands",
348
- "South Kalimantan",
349
- "South Sulawesi",
350
- "South Sumatra",
351
- "Sulawesi Barat",
352
- "Sulawesi Tenggara",
353
- "West Java",
354
- "West Kalimantan",
355
- "West Papua",
356
- "West Sumatra"
357
- ],
358
- get stateItems() {
359
- return _e(this);
360
- }
361
- }
362
- }, ue = () => U.Config.getCountry(), me = {
363
- get fullCurrency() {
364
- return ue().currency;
365
- },
366
- get currency() {
367
- return ue().currency.code;
368
- },
369
- get fullTax() {
370
- return U.Country.getCountryFlattenTaxes(ue().code);
371
- },
372
- get taxSystem() {
373
- return ue().taxSystems;
374
- },
375
- taxInclusion(b) {
376
- return me.taxSystem.map((h) => ({
377
- systemCode: h.code,
378
- inclusive: b !== void 0 ? b : !1
379
- }));
380
- },
381
- groupedTaxOptions() {
382
- const b = U.Country.getCountryFlattenTaxes(ue().code);
383
- return me.taxSystem.map((h) => ({
384
- code: h.code,
385
- options: b.map((a) => ({ ...a, feedmeTaxCode: me.generateCode(a) })).filter((a) => a.systemCode === h.code)
386
- }));
387
- },
388
- systemDefaultCode(b) {
389
- const h = me.groupedTaxOptions().find((a) => a.code === b);
390
- return h == null ? void 0 : h.options.find((a) => a.default);
391
- },
392
- generateCode(b) {
393
- return `${b.systemCode}/${b.taxCode}`;
394
- }
395
- }, ee = me, Tt = /* @__PURE__ */ X({
396
- __name: "TaxInclusiveSetting",
397
- props: {
398
- modelValue: {
399
- type: Array,
400
- required: !0,
401
- default: () => []
402
- }
403
- },
404
- emits: ["update:model-value"],
405
- setup(b, { emit: h }) {
406
- const a = b, y = ee.taxSystem, m = h, g = N(a.modelValue);
407
- function n(r, u) {
408
- const d = re.clone(a.modelValue), V = d.findIndex((l) => l.systemCode === r);
409
- V >= 0 ? d[V].inclusive = u : d.push({
410
- systemCode: r,
411
- inclusive: u
412
- }), g.value = d, m("update:model-value", d);
413
- }
414
- function s() {
415
- return y.map((r) => {
416
- const u = a.modelValue ? a.modelValue.find((d) => d.systemCode === r.code) : !1;
417
- return {
418
- label: r.name,
419
- config: {
420
- value: u ? u.inclusive : !1
421
- },
422
- input: (d) => {
423
- n(r.code, d);
424
- }
425
- };
426
- });
427
- }
428
- const f = je(s());
429
- function t(r, u) {
430
- return `${r} ${u ? "Inclusive" : "Exclusive"}`;
431
- }
432
- return ye(() => {
433
- a.modelValue.length || n(y[0].code, !1);
434
- }), Ve(
435
- () => a.modelValue,
436
- (r, u) => {
437
- r != u && !r.length && n(y[0].code, !1);
438
- }
439
- ), (r, u) => {
440
- const d = F("FmSwitch");
441
- return _(!0), P(q, null, le(e(f), (V, l) => {
442
- var k;
443
- return _(), P("div", { key: l }, [
444
- i(d, {
445
- "model-value": ((k = e(g)[l]) == null ? void 0 : k.inclusive) || !1,
446
- "label-placement": "left",
447
- "onUpdate:modelValue": (M) => V.input(M)
448
- }, {
449
- label: T(() => {
450
- var M;
451
- return [
452
- x("div", null, D(t(V.label, ((M = e(g)[l]) == null ? void 0 : M.inclusive) || !1)), 1)
453
- ];
454
- }),
455
- _: 2
456
- }, 1032, ["model-value", "onUpdate:modelValue"])
457
- ]);
458
- }), 128);
459
- };
460
- }
461
- });
462
- var Ut = { mode: "production", appMode: "mf" };
463
- const Rt = { class: "space-y-8" }, It = {
464
- key: 0,
465
- class: "space-y-16"
466
- }, Dt = /* @__PURE__ */ X({
467
- __name: "StripeSetting",
468
- props: {
469
- modelValue: {}
470
- },
471
- emits: ["update:modelValue"],
472
- setup(b, { emit: h }) {
473
- const a = b, y = h, m = N(!1);
474
- Ve(m, (n, s) => {
475
- s != n && (!a.modelValue && n ? y("update:modelValue", {
476
- apiKey: "",
477
- webhookSecret: ""
478
- }) : n || y("update:modelValue", void 0));
479
- });
480
- const g = I(() => {
481
- const n = Ut.mode === "development", s = U.Config.getCountry().code.toLowerCase(), f = s != "my" ? `.${s}` : "";
482
- return `https://marketing${n ? "-dev" : ""}${f}.feedmeapi.com/stripe/${We.getBusinessId()}/webhook`;
483
- });
484
- return ye(() => {
485
- m.value = !!a.modelValue;
486
- }), (n, s) => {
487
- const f = F("FmSwitch"), t = F("FmTextField"), r = F("FmButton");
488
- return _(), P("div", Rt, [
489
- i(f, {
490
- modelValue: e(m),
491
- "onUpdate:modelValue": s[0] || (s[0] = (u) => ie(m) ? m.value = u : null),
492
- value: "true",
493
- label: "Enable Stripe"
494
- }, null, 8, ["modelValue"]),
495
- a.modelValue ? (_(), P("div", It, [
496
- i(t, {
497
- label: "API Key",
498
- modelValue: a.modelValue.apiKey,
499
- "onUpdate:modelValue": s[1] || (s[1] = (u) => a.modelValue.apiKey = u),
500
- "helper-text": "Go to Stripe Dashboard get your API Key and paste here."
501
- }, null, 8, ["modelValue"]),
502
- i(t, {
503
- label: "Webhook URL",
504
- "model-value": e(g),
505
- readonly: "",
506
- "helper-text": "Copy this URL to your Stripe dashboard"
507
- }, {
508
- append: T(() => [
509
- i(r, {
510
- icon: "content_copy",
511
- variant: "tertiary",
512
- onClick: s[2] || (s[2] = (u) => e(ze)(e(g)))
513
- })
514
- ]),
515
- _: 1
516
- }, 8, ["model-value"]),
517
- i(t, {
518
- modelValue: a.modelValue.webhookSecret,
519
- "onUpdate:modelValue": s[3] || (s[3] = (u) => a.modelValue.webhookSecret = u),
520
- label: "Webhook Secret",
521
- "helper-text": `Copy the webhook signing secret from your Stripe account and paste
522
- here.`
523
- }, null, 8, ["modelValue"])
524
- ])) : E("", !0)
525
- ]);
526
- };
527
- }
528
- }), Bt = {
529
- key: 0,
530
- class: "space-y-16 pr-12"
531
- }, Nt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Ot = {
532
- key: 1,
533
- class: "space-y-16"
534
- }, At = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Et = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Mt = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, jt = { class: "space-y-4" }, Lt = { class: "fm-typo-en-body-lg-400" }, qt = { class: "space-y-16" }, Ht = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Kt = { class: "flex items-center gap-8" }, Wt = /* @__PURE__ */ X({
535
- __name: "StoreSettingSheet",
536
- emits: ["update"],
537
- setup(b, { expose: h, emit: a }) {
538
- const { t: y } = pe(), m = a, g = N(!1), n = N(), s = N(!1), f = Ze.extend({
539
- company: Qe.extend({
540
- name: J.string().min(1, "Company name is required"),
541
- regNo: J.string().min(1, "Registration number is required"),
542
- address: et.extend({
543
- line1: J.string().min(1, "Line 1 is required"),
544
- line2: J.string().optional(),
545
- state: J.string().min(1, "State is required"),
546
- city: J.string().min(1, "City is required"),
547
- postcode: J.string().min(1, "Postcode is required"),
548
- country: J.string().min(1, "Country is required")
549
- }),
550
- phoneNo: J.string().min(1, "Phone number is required"),
551
- sstRegNo: J.string().optional()
552
- })
553
- }), t = I(() => f.safeParse(n.value).success);
554
- function r() {
555
- const V = f.safeParse(n.value);
556
- V.success && m("update", V.data);
557
- }
558
- function u() {
559
- return {
560
- company: {
561
- name: "",
562
- address: {
563
- line1: "",
564
- line2: "",
565
- city: "",
566
- postcode: "",
567
- state: "",
568
- country: U.Config.getCountry().name
569
- },
570
- phoneNo: "",
571
- regNo: "",
572
- sstRegNo: ""
573
- },
574
- inclusiveTaxes: []
575
- };
576
- }
577
- function d(V, l) {
578
- g.value = V, V && (n.value = l != null && l.company ? l : u());
579
- }
580
- return h({
581
- showSheet: d,
582
- data: n
583
- }), (V, l) => {
584
- const k = F("FmIcon"), M = F("FmMenuItem"), Z = F("FmMenu"), ae = F("FmSelect"), te = F("FmButton"), j = F("FmSideSheet");
585
- return _(), O(j, {
586
- "max-width": 560,
587
- modelValue: e(g),
588
- "onUpdate:modelValue": l[15] || (l[15] = (v) => ie(g) ? g.value = v : null),
589
- header: e(y)("connect.store.setting.title")
590
- }, {
591
- "side-sheet-footer": T(() => [
592
- x("div", Kt, [
593
- i(te, {
594
- label: e(y)("connect.common.save"),
595
- onClick: r,
596
- disabled: !e(t) || e(xe)().isLoading,
597
- loading: e(xe)().isLoading
598
- }, null, 8, ["label", "disabled", "loading"]),
599
- i(te, {
600
- label: e(y)("connect.common.cancel"),
601
- onClick: l[14] || (l[14] = (v) => d(!1)),
602
- variant: "tertiary"
603
- }, null, 8, ["label"])
604
- ])
605
- ]),
606
- default: T(() => {
607
- var v, w;
608
- return [
609
- i(Se, { json: e(n) }, null, 8, ["json"]),
610
- e(n) && e(n).company ? (_(), P("div", Bt, [
611
- x("div", Nt, D(e(y)("connect.store.setting.company.legal_info")), 1),
612
- i(Q, {
613
- modelValue: e(n).company.name,
614
- "onUpdate:modelValue": l[0] || (l[0] = (c) => e(n).company.name = c),
615
- label: e(y)("connect.store.setting.company.name"),
616
- schema: e(Y).typeAtPath(e(f), "company.name")
617
- }, null, 8, ["modelValue", "label", "schema"]),
618
- i(Q, {
619
- modelValue: e(n).company.regNo,
620
- "onUpdate:modelValue": l[1] || (l[1] = (c) => e(n).company.regNo = c),
621
- label: e(y)("connect.store.setting.company.reg_no"),
622
- schema: e(Y).typeAtPath(e(f), "company.regNo")
623
- }, null, 8, ["modelValue", "label", "schema"]),
624
- e(U.Config).getCountry().taxSystems.length ? (_(), O(Q, {
625
- key: 0,
626
- modelValue: e(n).company.sstRegNo,
627
- "onUpdate:modelValue": [
628
- l[2] || (l[2] = (c) => e(n).company.sstRegNo = c),
629
- l[3] || (l[3] = (c) => c ? null : e(n).inclusiveTaxes = [])
630
- ],
631
- label: e(y)("connect.store.setting.company.tax_reg_no"),
632
- schema: e(Y).typeAtPath(e(f), "company.sstRegNo")
633
- }, null, 8, ["modelValue", "label", "schema"])) : E("", !0),
634
- (v = e(n).company) != null && v.sstRegNo && e(n).inclusiveTaxes ? (_(), P("div", Ot, [
635
- x("div", At, D(e(y)("connect.store.setting.company.tax")), 1),
636
- i(Tt, {
637
- modelValue: e(n).inclusiveTaxes,
638
- "onUpdate:modelValue": l[4] || (l[4] = (c) => e(n).inclusiveTaxes = c)
639
- }, null, 8, ["modelValue"])
640
- ])) : E("", !0),
641
- i(Q, {
642
- modelValue: e(n).company.phoneNo,
643
- "onUpdate:modelValue": l[5] || (l[5] = (c) => e(n).company.phoneNo = c),
644
- label: e(y)("connect.store.setting.company.phone"),
645
- schema: e(Y).typeAtPath(e(f), "company.phoneNo")
646
- }, null, 8, ["modelValue", "label", "schema"]),
647
- x("div", Et, D(e(y)("connect.store.setting.company.address.title")), 1),
648
- i(Q, {
649
- modelValue: e(n).company.address.line1,
650
- "onUpdate:modelValue": l[6] || (l[6] = (c) => e(n).company.address.line1 = c),
651
- label: e(y)("connect.store.setting.company.address.line1"),
652
- schema: e(Y).typeAtPath(e(f), "company.address.line1")
653
- }, null, 8, ["modelValue", "label", "schema"]),
654
- i(Q, {
655
- modelValue: e(n).company.address.line2,
656
- "onUpdate:modelValue": l[7] || (l[7] = (c) => e(n).company.address.line2 = c),
657
- label: e(y)("connect.store.setting.company.address.line2"),
658
- schema: e(Y).typeAtPath(e(f), "company.address.line2")
659
- }, null, 8, ["modelValue", "label", "schema"]),
660
- x("div", Mt, [
661
- i(Q, {
662
- modelValue: e(n).company.address.city,
663
- "onUpdate:modelValue": l[8] || (l[8] = (c) => e(n).company.address.city = c),
664
- label: e(y)("connect.store.setting.company.address.city"),
665
- schema: e(Y).typeAtPath(e(f), "company.address.city")
666
- }, null, 8, ["modelValue", "label", "schema"]),
667
- i(Q, {
668
- modelValue: e(n).company.address.postcode,
669
- "onUpdate:modelValue": l[9] || (l[9] = (c) => e(n).company.address.postcode = c),
670
- label: e(y)("connect.store.setting.company.address.postcode"),
671
- schema: e(Y).typeAtPath(e(f), "company.address.postcode")
672
- }, null, 8, ["modelValue", "label", "schema"]),
673
- x("div", jt, [
674
- x("div", Lt, D(e(y)("connect.store.setting.company.address.state")), 1),
675
- i(Z, {
676
- placement: "top-end",
677
- "model-value": e(s)
678
- }, {
679
- "menu-button": T(() => [
680
- i(Q, {
681
- modelValue: e(n).company.address.state,
682
- "onUpdate:modelValue": l[10] || (l[10] = (c) => e(n).company.address.state = c),
683
- schema: e(Y).typeAtPath(e(f), "company.address.state"),
684
- onFocusChanged: l[11] || (l[11] = (c) => s.value = c)
685
- }, {
686
- append: T(() => [
687
- i(k, {
688
- name: e(s) ? "keyboard_arrow_up" : "keyboard_arrow_down"
689
- }, null, 8, ["name"])
690
- ]),
691
- _: 1
692
- }, 8, ["modelValue", "schema"])
693
- ]),
694
- default: T(() => [
695
- (_(!0), P(q, null, le(e(kt)[e(U.Config).getCountry().code].stateItems.filter(
696
- (c) => {
697
- var R, A;
698
- return c.label.toLowerCase().includes(((A = (R = e(n)) == null ? void 0 : R.company) == null ? void 0 : A.address.state.toLowerCase()) ?? "");
699
- }
700
- ) || [], (c) => (_(), O(M, {
701
- key: c.value,
702
- "model-value": e(n).company.address.state === c.value,
703
- label: c.label,
704
- onClick: () => {
705
- e(n).company.address.state = c.value, s.value = !1;
706
- }
707
- }, null, 8, ["model-value", "label", "onClick"]))), 128))
708
- ]),
709
- _: 1
710
- }, 8, ["model-value"])
711
- ]),
712
- i(ae, {
713
- label: e(y)("connect.store.setting.company.address.country"),
714
- modelValue: e(n).company.address.country,
715
- "onUpdate:modelValue": l[12] || (l[12] = (c) => e(n).company.address.country = c),
716
- items: [
717
- {
718
- label: e(U.Config).getCountry().name,
719
- value: e(U.Config).getCountry().name
720
- }
721
- ],
722
- rules: [e(Y).ruleAtPath(e(f), "company.address.country")]
723
- }, null, 8, ["label", "modelValue", "items", "rules"])
724
- ]),
725
- x("div", qt, [
726
- x("div", Ht, D(e(y)("connect.store.setting.stripe.title")), 1),
727
- i(Dt, {
728
- "model-value": (w = e(n)) == null ? void 0 : w.stripe,
729
- "onUpdate:modelValue": l[13] || (l[13] = (c) => e(n).stripe = c)
730
- }, null, 8, ["model-value"])
731
- ])
732
- ])) : E("", !0)
733
- ];
734
- }),
735
- _: 1
736
- }, 8, ["modelValue", "header"]);
737
- };
738
- }
739
- });
740
- function zt(b, h = !0) {
741
- return U.DineroFactory(b).toFormat(h);
742
- }
743
- const Yt = /* @__PURE__ */ X({
744
- __name: "TaxVariantSetting",
745
- props: {
746
- modelValue: {
747
- type: Array,
748
- required: !0,
749
- default: () => []
750
- }
751
- },
752
- emits: ["update:modelValue"],
753
- setup(b, { emit: h }) {
754
- const a = b, y = h;
755
- ye(() => {
756
- if (n.value.length !== g.value.length) {
757
- const t = g.value.reduce((r, u) => {
758
- const d = ee.systemDefaultCode(u.name);
759
- if (!d) return r;
760
- const { systemCode: V, taxCode: l } = d;
761
- return u.value || r.push({ systemCode: V, taxCode: l }), r;
762
- }, []);
763
- f(t);
764
- }
765
- });
766
- function m() {
767
- return ee.groupedTaxOptions();
768
- }
769
- const g = I(() => m().map((t) => ({
770
- name: t.code,
771
- value: (n.value || []).find(
772
- (r) => t.options.some((u) => u.feedmeTaxCode === r)
773
- ),
774
- options: t.options.map((r) => ({
775
- label: `${r.name} (${st(r.rate)}%)`,
776
- value: r.feedmeTaxCode
777
- }))
778
- }))), n = I(() => a.modelValue.map((t) => ee.generateCode(t)));
779
- function s(t) {
780
- const r = m().find(
781
- (l) => l.options.some((k) => k.feedmeTaxCode === t)
782
- ), u = r == null ? void 0 : r.options.find((l) => l.feedmeTaxCode === t);
783
- if (!u) return;
784
- const { systemCode: d, taxCode: V } = u;
785
- f([{ systemCode: d, taxCode: V }]);
786
- }
787
- function f(t) {
788
- const r = re.clone(a.modelValue);
789
- t.forEach((u) => {
790
- const d = m().find(
791
- (k) => k.options.some((M) => M.feedmeTaxCode === ee.generateCode(u))
792
- ), V = (d == null ? void 0 : d.options) || [], l = r.findIndex(
793
- (k) => V.some((M) => ee.generateCode(M) === ee.generateCode(k))
794
- );
795
- l >= 0 ? r.splice(l, 1, u) : r.push(u);
796
- }), y("update:modelValue", r);
797
- }
798
- return (t, r) => {
799
- const u = F("FmRadio"), d = F("FmRadioGroup");
800
- return _(!0), P(q, null, le(e(g), (V) => (_(), P("div", {
801
- key: V.name,
802
- class: "flex items-start"
803
- }, [
804
- i(d, {
805
- modelValue: V.value,
806
- "onUpdate:modelValue": [
807
- (l) => V.value = l,
808
- r[0] || (r[0] = (l) => {
809
- s(l);
810
- })
811
- ]
812
- }, {
813
- default: T(() => [
814
- (_(!0), P(q, null, le(V.options, (l, k) => (_(), O(u, {
815
- key: k,
816
- value: l.value,
817
- label: l.label
818
- }, null, 8, ["value", "label"]))), 128))
819
- ]),
820
- _: 2
821
- }, 1032, ["modelValue", "onUpdate:modelValue"])
822
- ]))), 128);
823
- };
824
- }
825
- }), Ce = {
826
- get _id() {
827
- return (/* @__PURE__ */ new Date()).toISOString();
828
- },
829
- name: "",
830
- price: U.Dinero.zero().toObject(),
831
- originalPrice: U.Dinero.zero().toObject(),
832
- vouchers: [],
833
- credit: {
834
- normal: 0,
835
- free: {
836
- amount: 0,
837
- day: 0
838
- }
839
- },
840
- config: {
841
- options: {}
842
- },
843
- titles: [],
844
- taxes: [],
845
- taxTotals: [],
846
- internal: !1,
847
- priceWithTaxes: lt()
848
- }, Jt = {
849
- key: 0,
850
- class: "space-y-24 pr-12"
851
- }, Gt = { class: "space-y-8" }, Xt = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, Zt = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, Qt = /* @__PURE__ */ x("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Credit", -1), eo = /* @__PURE__ */ x("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1), to = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, oo = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, no = { class: "space-y-8" }, lo = { class: "flex items-center justify-between" }, ao = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, so = { class: "space-y-8" }, ro = { class: "flex items-center gap-8" }, io = /* @__PURE__ */ X({
852
- __name: "EditBundleSheet",
853
- emits: ["update"],
854
- setup(b, { expose: h, emit: a }) {
855
- const y = a, { t: m } = pe(), g = Fe(), n = N(!1), s = N([]), f = N({
856
- category: 0,
857
- index: -1,
858
- originalCategoryIndex: void 0
859
- }), t = N(re.cloneDeep(Ce)), r = N(), u = Be, d = I(() => {
860
- const p = u.safeParse(t.value);
861
- return p.success ? [] : p.error.errors;
862
- }), V = [
863
- {
864
- header: "Reward title",
865
- accessorFn: (p) => p.collectible.name,
866
- enableSorting: !0
867
- },
868
- {
869
- id: "type",
870
- header: "Reward type",
871
- accessorFn: (p) => p.collectible.type,
872
- cell(p) {
873
- return ce[p.row.original.collectible.type].chip();
874
- }
875
- },
876
- {
877
- header: "Description",
878
- accessorFn: (p) => p.description,
879
- cell(p) {
880
- var S;
881
- const o = p.row.original;
882
- return o.collectible.type == "VOUCHER" || o.selectedReward == null ? o.description : qe(Ke.FmStepperField, {
883
- "onUpdate:modelValue": ($) => {
884
- t.value.titles = t.value.titles.map(
885
- (G) => G.id == o.collectible._id ? { ...G, dayToExpire: $ } : G
886
- );
887
- },
888
- modelValue: ((S = o.selectedReward) == null ? void 0 : S.extra) ?? 0,
889
- appendText: "day(s)",
890
- showSteppers: !1,
891
- disabled: !!t.value.stripePriceId
892
- });
893
- }
894
- }
895
- ], l = N([]), k = I(() => g.bundleRewards.map((p) => {
896
- const o = M.value.find(($) => $.id == p._id), S = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${rt(p.options.validityOption || {})}` : "No expiry";
897
- return {
898
- collectible: p,
899
- description: S,
900
- selectedReward: o
901
- };
902
- })), M = I(() => {
903
- var p, o;
904
- return [
905
- ...((p = t.value) == null ? void 0 : p.titles.map((S) => ({
906
- id: S.id,
907
- extra: S.dayToExpire
908
- }))) ?? [],
909
- ...((o = t.value) == null ? void 0 : o.vouchers.map((S) => ({
910
- id: S,
911
- extra: void 0
912
- }))) ?? []
913
- ];
914
- }), Z = I(
915
- () => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
916
- );
917
- function ae(p) {
918
- t.value.subscriptionValidity = p;
919
- for (const o of t.value.titles)
920
- o.dayToExpire = p;
921
- t.value.credit.free && (t.value.credit.free.day = p);
922
- }
923
- function te() {
924
- const p = k.value, o = t.value;
925
- if (!(!o || !p))
926
- for (let S = 0; S < p.length; S++) {
927
- const $ = p[S];
928
- j.value[S] ? $.collectible.type == "TITLE" ? o.titles.findIndex(
929
- (L) => L.id == $.collectible._id
930
- ) < 0 && o.titles.push({
931
- id: $.collectible._id,
932
- dayToExpire: Z.value
933
- }) : o.vouchers.findIndex(
934
- (L) => L == $.collectible._id
935
- ) < 0 && o.vouchers.push($.collectible._id) : (o.titles = o.titles.filter((ne) => ne.id != $.collectible._id), o.vouchers = o.vouchers.filter(
936
- (ne) => ne != $.collectible._id
937
- ));
938
- }
939
- }
940
- const j = N({});
941
- Ve(j, te, { deep: !0 });
942
- const v = I(() => {
943
- var p, o;
944
- return (o = (p = g.storeOption) == null ? void 0 : p.company) == null ? void 0 : o.sstRegNo;
945
- }), w = I(() => {
946
- var p, o, S;
947
- return (S = (o = (p = g.storeOption) == null ? void 0 : p.inclusiveTaxes) == null ? void 0 : o[0]) != null && S.inclusive ? "Inclusive" : "Exclusive";
948
- }), c = I(() => {
949
- var p, o, S;
950
- return ct(
951
- ee.fullTax,
952
- Le(t.value.taxes),
953
- t.value.price,
954
- Number(t.value.credit.normal),
955
- ((p = g.storeOption) == null ? void 0 : p.inclusiveTaxes) ?? [],
956
- (S = (o = g.storeOption) == null ? void 0 : o.company) != null && S.sstRegNo ? ee.taxSystem.map(($) => $.code) : []
957
- );
958
- }), R = I(() => c.value.reduce(
959
- (o, S) => o.add(S.total),
960
- at()
961
- ).toFormat()), A = I(() => {
962
- var $;
963
- const p = ut(
964
- c.value,
965
- t.value.price,
966
- (($ = g.storeOption) == null ? void 0 : $.inclusiveTaxes) ?? []
967
- );
968
- t.value.priceWithTaxes = p;
969
- const o = zt(p, !1), S = Number(o.replace(/[^\d.-]/g, ""));
970
- return Number.isNaN(S) ? 0 : S;
971
- });
972
- function B() {
973
- t.value.taxTotals = c.value, y("update", Be.parse(Ge(t.value)));
974
- }
975
- function H() {
976
- return re.cloneDeep(Ce);
977
- }
978
- function K(p, o) {
979
- n.value = p, p && o && (r.value = void 0, s.value = o.categories, t.value = o.bundle || H(), f.value.category = o.category, f.value.index = o.index, f.value.originalCategoryIndex = o.category, j.value = k.value.reduce((S, $, G) => (S[G] = !!$.selectedReward, S), {}));
980
- }
981
- return h({
982
- showSheet: K,
983
- bundleImage: r,
984
- target: f,
985
- data: t
986
- }), (p, o) => {
987
- const S = F("FmSwitch"), $ = F("FmHelperText"), G = F("FmTextField"), ne = F("FmSelect"), L = F("FmStepperField"), fe = F("FmMenuItem"), Ae = F("FmTable"), we = F("FmButton"), Ee = F("FmSideSheet");
988
- return _(), O(Ee, {
989
- "max-width": 560,
990
- modelValue: e(n),
991
- "onUpdate:modelValue": o[20] || (o[20] = (de) => ie(n) ? n.value = de : null),
992
- header: e(f).index != -1 ? e(m)("connect.store.bundle.edit.title") : e(m)("connect.store.bundle.edit.create")
993
- }, {
994
- "side-sheet-footer": T(() => [
995
- x("div", ro, [
996
- i(we, {
997
- label: e(f).index != -1 ? "Save" : "Add",
998
- onClick: B,
999
- disabled: e(d).length > 0,
1000
- loading: e(xe)().isLoading
1001
- }, null, 8, ["label", "disabled", "loading"]),
1002
- i(we, {
1003
- label: "Cancel",
1004
- onClick: o[19] || (o[19] = (de) => K(!1)),
1005
- variant: "tertiary"
1006
- })
1007
- ])
1008
- ]),
1009
- default: T(() => {
1010
- var de, $e, Pe, ke, Te, Ue, Re, Ie;
1011
- return [
1012
- i(Se, { json: e(t) }, null, 8, ["json"]),
1013
- e(t) ? (_(), P("div", Jt, [
1014
- x("div", Gt, [
1015
- e(U.Config).getCountry().code == "MY" && ((de = e(g).payoutAccount) == null ? void 0 : de.status) == "APPROVED" && (($e = e(g).payoutAccount) != null && $e.enable) ? (_(), O(S, {
1016
- key: 0,
1017
- "onUpdate:modelValue": o[0] || (o[0] = (C) => {
1018
- e(t).isFeedvibe = C, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], j.value = {});
1019
- }),
1020
- "label-placement": "right",
1021
- "model-value": e(t).isFeedvibe || !1,
1022
- label: "Feedvibe Campaign",
1023
- sublabel: "Bundle will be appear for Feedvibe campaign use"
1024
- }, null, 8, ["model-value"])) : E("", !0),
1025
- e(t).isFeedvibe ? (_(), O($, {
1026
- key: 1,
1027
- text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app",
1028
- state: "warning"
1029
- })) : E("", !0)
1030
- ]),
1031
- x("div", Xt, D(e(m)("connect.store.bundle.edit.basicInformation")), 1),
1032
- i(G, {
1033
- label: e(m)("connect.store.bundle.edit.bundleName"),
1034
- modelValue: e(t).name,
1035
- "onUpdate:modelValue": o[1] || (o[1] = (C) => e(t).name = C),
1036
- "helper-state": e(W)(e(d), "name"),
1037
- "helper-text": e(z)(e(d), "name")
1038
- }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1039
- i(ne, {
1040
- modelValue: e(f).category,
1041
- "onUpdate:modelValue": o[2] || (o[2] = (C) => e(f).category = C),
1042
- label: "Store Category",
1043
- items: e(s).map((C, Me) => ({ label: C, value: Me }))
1044
- }, null, 8, ["modelValue", "items"]),
1045
- i(ot, {
1046
- label: e(m)("connect.store.bundle.edit.bundleImage"),
1047
- class: "w-1/2 xs:w-2/3",
1048
- "aspect-ratio": "16/9",
1049
- thumbnail: e(t).image ?? void 0,
1050
- file: e(r) ?? void 0,
1051
- "onUpdate:file": o[3] || (o[3] = (C) => {
1052
- r.value = C;
1053
- }),
1054
- "helper-state": e(W)(e(d), "image"),
1055
- "helper-text": e(z)(e(d), "image")
1056
- }, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
1057
- i(L, {
1058
- "model-value": e(U.Dinero).fromFdoDinero(e(t).price).toUnit(),
1059
- label: e(m)("connect.store.bundle.edit.bundlePrice"),
1060
- min: 0,
1061
- "max-fraction-digits": 2,
1062
- "onUpdate:modelValue": o[4] || (o[4] = (C) => {
1063
- e(t).price.amount = C * 10 ** e(t).price.precision;
1064
- }),
1065
- "is-currency": !0,
1066
- "show-steppers": !1,
1067
- "helper-text": e(z)(e(d), "price") || `${e(U.Dinero).fromNumber({ number: 1 }).toFormat(!0)} = ${e(U.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
1068
- "helper-state": e(W)(e(d), "price")
1069
- }, {
1070
- prepend: T(() => [
1071
- se(D(e(U.Dinero).defaultCurrency()), 1)
1072
- ]),
1073
- _: 1
1074
- }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1075
- i(L, {
1076
- "model-value": e(U.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
1077
- label: e(m)("connect.store.bundle.edit.bundleValue"),
1078
- min: 0,
1079
- "max-fraction-digits": 2,
1080
- "onUpdate:modelValue": o[5] || (o[5] = (C) => {
1081
- e(t).originalPrice || (e(t).originalPrice = e(U.Dinero).zero().toObject()), e(t).originalPrice.amount = C * 10 ** e(t).originalPrice.precision;
1082
- }),
1083
- "is-currency": !0,
1084
- "show-steppers": !1,
1085
- "helper-text": e(z)(e(d), "originalPrice") || e(m)("connect.store.bundle.edit.originalPriceHelper"),
1086
- "helper-state": e(W)(e(d), "originalPrice")
1087
- }, {
1088
- prepend: T(() => [
1089
- se(D(e(U.Dinero).defaultCurrency()), 1)
1090
- ]),
1091
- _: 1
1092
- }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1093
- e(t).isFeedvibe ? E("", !0) : (_(), O(L, {
1094
- key: 0,
1095
- "model-value": e(t).coinPrice ?? null,
1096
- label: e(m)("connect.store.bundle.edit.pointNeeded"),
1097
- min: 0,
1098
- "onUpdate:modelValue": o[6] || (o[6] = (C) => {
1099
- C > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = C;
1100
- }),
1101
- "show-steppers": !1,
1102
- "helper-state": e(W)(e(d), "coinPrice"),
1103
- "helper-text": e(z)(e(d), "coinPrice")
1104
- }, {
1105
- append: T(() => [
1106
- se(" point(s) ")
1107
- ]),
1108
- _: 1
1109
- }, 8, ["model-value", "label", "helper-state", "helper-text"])),
1110
- (Pe = e(g).storeOption) != null && Pe.stripe && !e(t).isFeedvibe ? (_(), P(q, { key: 1 }, [
1111
- x("div", Zt, D(e(m)("connect.store.bundle.edit.subscriptionSettings")), 1),
1112
- i(G, {
1113
- label: e(m)("connect.store.bundle.edit.stripePriceId"),
1114
- modelValue: e(t).stripePriceId,
1115
- "onUpdate:modelValue": o[7] || (o[7] = (C) => e(t).stripePriceId = C),
1116
- "helper-state": e(W)(e(d), "stripePriceId"),
1117
- "helper-text": e(z)(e(d), "stripePriceId")
1118
- }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1119
- e(t).stripePriceId ? (_(), O(L, {
1120
- key: 0,
1121
- "model-value": e(t).subscriptionValidity ?? null,
1122
- min: 1,
1123
- "onUpdate:modelValue": ae,
1124
- label: e(m)("connect.store.bundle.edit.subscriptionValidity"),
1125
- "show-steppers": !1,
1126
- "helper-state": e(W)(e(d), "subscriptionValidity"),
1127
- "helper-text": e(z)(e(d), "subscriptionValidity")
1128
- }, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : E("", !0)
1129
- ], 64)) : E("", !0),
1130
- e(t).isFeedvibe ? E("", !0) : (_(), P(q, { key: 2 }, [
1131
- Qt,
1132
- i(L, {
1133
- modelValue: e(t).credit.normal,
1134
- "onUpdate:modelValue": o[8] || (o[8] = (C) => e(t).credit.normal = C),
1135
- label: "Normal credit",
1136
- "show-steppers": !1,
1137
- "helper-state": e(W)(e(d), "credit.normal"),
1138
- "helper-text": e(z)(e(d), "credit.normal")
1139
- }, {
1140
- append: T(() => [
1141
- se(" credit ")
1142
- ]),
1143
- _: 1
1144
- }, 8, ["modelValue", "helper-state", "helper-text"]),
1145
- i(L, {
1146
- "model-value": ((ke = e(t).credit.free) == null ? void 0 : ke.amount) ?? null,
1147
- min: 0,
1148
- "onUpdate:modelValue": o[9] || (o[9] = (C) => {
1149
- e(t).credit.free || (e(t).credit.free = {
1150
- amount: 0,
1151
- day: 1
1152
- }), e(t).credit.free.amount = C;
1153
- }),
1154
- label: "Free credit",
1155
- "show-steppers": !1,
1156
- "helper-state": e(W)(e(d), "credit.free.amount"),
1157
- "helper-text": e(z)(e(d), "credit.free.amount")
1158
- }, {
1159
- append: T(() => [
1160
- se(" credit ")
1161
- ]),
1162
- _: 1
1163
- }, 8, ["model-value", "helper-state", "helper-text"]),
1164
- (Te = e(t).credit.free) != null && Te.amount ? (_(), O(L, {
1165
- key: 0,
1166
- disabled: !!e(t).stripePriceId,
1167
- "model-value": ((Ue = e(t).credit.free) == null ? void 0 : Ue.day) ?? null,
1168
- min: 0,
1169
- "onUpdate:modelValue": o[10] || (o[10] = (C) => {
1170
- e(t).credit.free || (e(t).credit.free = {
1171
- amount: 0,
1172
- day: 1
1173
- }), e(t).credit.free.day = e(Z) || C;
1174
- }),
1175
- label: "Free credit valid for",
1176
- "show-steppers": !1,
1177
- "helper-state": e(W)(e(d), "credit.free.day"),
1178
- "helper-text": e(z)(e(d), "credit.free.day")
1179
- }, {
1180
- append: T(() => [
1181
- se(" day(s) ")
1182
- ]),
1183
- _: 1
1184
- }, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : E("", !0)
1185
- ], 64)),
1186
- e(v) ? (_(), P(q, { key: 3 }, [
1187
- eo,
1188
- i(Yt, {
1189
- modelValue: e(t).taxes,
1190
- "onUpdate:modelValue": o[11] || (o[11] = (C) => e(t).taxes = C)
1191
- }, null, 8, ["modelValue"]),
1192
- i(G, {
1193
- label: `Tax Charged (${e(w)})`,
1194
- "model-value": e(R),
1195
- disabled: ""
1196
- }, null, 8, ["label", "model-value"])
1197
- ], 64)) : E("", !0),
1198
- i(L, {
1199
- label: "Total Price",
1200
- "model-value": e(A),
1201
- disabled: !0
1202
- }, null, 8, ["model-value"]),
1203
- x("div", to, D(e(m)("connect.store.bundle.edit.bundleReward.title")), 1),
1204
- x("div", oo, D(e(m)("connect.store.bundle.edit.bundleReward.description")), 1),
1205
- x("div", no, [
1206
- x("div", lo, [
1207
- i(nt, {
1208
- label: `Reward type: ${e(l).length == 0 ? "All" : e(l)[0].name}`
1209
- }, {
1210
- default: T(() => [
1211
- i(fe, {
1212
- onClick: o[12] || (o[12] = (C) => l.value = []),
1213
- label: "All"
1214
- }),
1215
- i(fe, {
1216
- onClick: o[13] || (o[13] = (C) => l.value = [
1217
- {
1218
- id: "type",
1219
- value: "VOUCHER",
1220
- name: e(ce).VOUCHER.name
1221
- }
1222
- ]),
1223
- label: e(ce).VOUCHER.name
1224
- }, null, 8, ["label"]),
1225
- i(fe, {
1226
- onClick: o[14] || (o[14] = (C) => l.value = [
1227
- {
1228
- id: "type",
1229
- value: "TITLE",
1230
- name: e(ce).TITLE.name
1231
- }
1232
- ]),
1233
- label: e(ce).TITLE.name
1234
- }, null, 8, ["label"])
1235
- ]),
1236
- _: 1
1237
- }, 8, ["label"])
1238
- ]),
1239
- i(Ae, {
1240
- modelValue: e(j),
1241
- "onUpdate:modelValue": o[15] || (o[15] = (C) => ie(j) ? j.value = C : null),
1242
- selection: "multiple",
1243
- "column-filter": e(l),
1244
- "column-defs": V,
1245
- "row-data": e(k).filter(
1246
- (C) => !e(t).isFeedvibe || C.collectible.type == "VOUCHER"
1247
- ),
1248
- "hide-footer": e(k).length <= 10
1249
- }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
1250
- i($, {
1251
- text: e(z)(e(d), "titles"),
1252
- state: e(W)(e(d), "titles")
1253
- }, null, 8, ["text", "state"])
1254
- ]),
1255
- x("div", ao, D(e(m)("connect.store.bundle.edit.advanceSetting")), 1),
1256
- x("div", so, [
1257
- i(S, {
1258
- "model-value": e(t).internal ?? !1,
1259
- "onUpdate:modelValue": o[16] || (o[16] = (C) => e(t).internal = C),
1260
- "label-placement": "right",
1261
- label: e(m)("connect.store.bundle.edit.internalBundle"),
1262
- sublabel: e(m)("connect.store.bundle.edit.internalBundleDescription")
1263
- }, null, 8, ["model-value", "label", "sublabel"]),
1264
- i(S, {
1265
- "model-value": e(t).hideInPos ?? !1,
1266
- "onUpdate:modelValue": o[17] || (o[17] = (C) => e(t).hideInPos = C),
1267
- "label-placement": "right",
1268
- label: e(m)("connect.store.bundle.edit.hideInPos"),
1269
- sublabel: e(m)("connect.store.bundle.edit.hideInPosDescription")
1270
- }, null, 8, ["model-value", "label", "sublabel"]),
1271
- i(L, {
1272
- "model-value": ((Ie = (Re = e(t).config) == null ? void 0 : Re.options) == null ? void 0 : Ie.maxPerUser) || null,
1273
- "onUpdate:modelValue": o[18] || (o[18] = (C) => e(re).set(e(t), "config.options.maxPerUser", C)),
1274
- label: e(m)("connect.store.bundle.edit.maxPerUser"),
1275
- "show-steppers": !1,
1276
- placeholder: "Unlimited"
1277
- }, null, 8, ["model-value", "label"])
1278
- ])
1279
- ])) : E("", !0)
1280
- ];
1281
- }),
1282
- _: 1
1283
- }, 8, ["modelValue", "header"]);
1284
- };
1285
- }
1286
- });
1287
- var co = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
1288
- const uo = { class: "px-24 flex flex-col gap-y-16" }, mo = { class: "flex gap-8 items-center" }, po = { class: "fm-typo-en-body-lg-600" }, yo = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, fo = /* @__PURE__ */ x("img", {
1289
- src: He,
1290
- class: "aspect-square w-[150px]"
1291
- }, null, -1), bo = { class: "flex flex-col gap-16 text-center" }, go = { class: "fm-typo-en-title-sm-800" }, vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qo = /* @__PURE__ */ X({
1292
- __name: "Store",
1293
- setup(b) {
1294
- const h = {
1295
- label: "Setup payout account",
1296
- value: "payout",
1297
- isPrimary: !1
1298
- }, { t: a } = pe(), y = {
1299
- label: a("connect.store.actions.setting"),
1300
- value: "setting",
1301
- isPrimary: !1
1302
- }, m = {
1303
- label: a("connect.store.actions.manageReward"),
1304
- value: "create_reward"
1305
- }, g = {
1306
- label: a("connect.store.actions.addCategory"),
1307
- value: "create_category",
1308
- isPrimary: !0,
1309
- prependIcon: "add"
1310
- }, n = it(), s = Fe(), { global: f, minor: t } = Ye, r = Ne(), u = I(() => s.sortedStoreCategories), d = I(() => s.sortedStoreCategories.map((v) => v.name)), V = N(), l = N();
1311
- async function k(v) {
1312
- var w;
1313
- v === "setting" ? (w = V.value) == null || w.showSheet(!0, s.storeOption) : v === "create_category" ? Z(-1) : v === "create_reward" ? await n.push({ name: Xe["$connect-STORE_REWARDS"] }) : v == "payout" && window.open(co.paymentPortalUrl, "_blank");
1314
- }
1315
- async function M(v) {
1316
- await t(
1317
- async () => {
1318
- var w;
1319
- await he.updateStore(v), await s.readMemberStore(), (w = V.value) == null || w.showSheet(!1);
1320
- },
1321
- {
1322
- message: a("connect.store.setting.update.message"),
1323
- successMessage: a("connect.store.setting.update.success")
1324
- }
1325
- );
1326
- }
1327
- async function Z(v = -1) {
1328
- var w, c;
1329
- if ((!s.storeOption || !s.storeOption.company) && await ge.confirm(
1330
- a("connect.store.category.setup.title"),
1331
- a("connect.store.category.setup.button"),
1332
- a("connect.store.category.setup.action"),
1333
- a("connect.common.cancel")
1334
- ))
1335
- return (w = V.value) == null ? void 0 : w.showSheet(!0);
1336
- r.open({
1337
- title: v == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
1338
- contentComponent: Ft,
1339
- contentComponentProps: {
1340
- initialValue: ((c = u.value[v]) == null ? void 0 : c.name) ?? "",
1341
- action: v == -1 ? "add" : "edit"
1342
- }
1343
- }).onPrimary(async (R) => {
1344
- R === null && !await ge.remove(
1345
- a("connect.store.category.remove.confirm"),
1346
- a("connect.store.category.remove.title")
1347
- ) || await t(
1348
- async () => {
1349
- const A = v == -1 ? [...u.value, { name: R, bundles: [] }] : [...u.value].map((B, H) => H == v ? { ...B, name: R } : B).filter((B) => B.name !== null);
1350
- await he.updateStoreBundle({
1351
- categories: A
1352
- }), await s.readMemberStore();
1353
- },
1354
- {
1355
- message: R === null ? a("connect.store.category.update.deleting") : v == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
1356
- successMessage: R === null ? a("connect.store.category.update.success.deleted") : v == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
1357
- }
1358
- );
1359
- });
1360
- }
1361
- async function ae(v, w, c, R) {
1362
- var H, K, p;
1363
- w ?? (w = (H = l.value) == null ? void 0 : H.target.category), c ?? (c = (K = l.value) == null ? void 0 : K.target.index), R ?? (R = (p = l.value) == null ? void 0 : p.target.originalCategoryIndex);
1364
- const A = De(u.value);
1365
- w != R && (A[R].bundles.splice(c, 1), c = A[w].bundles.length), console.log(w, c, R, "ci, bi, originalCategoryIndex");
1366
- const B = A[w];
1367
- if (!B) {
1368
- Je.error("Unexpected error", 2e3);
1369
- return;
1370
- }
1371
- if (v == null) {
1372
- if (await ge.remove(
1373
- "Are you sure you want to delete this bundle?",
1374
- "Delete bundle"
1375
- ) == !1)
1376
- return;
1377
- B.bundles.splice(c, 1);
1378
- } else
1379
- c == -1 ? B.bundles.push(v) : B.bundles[c] = v;
1380
- await t(
1381
- async () => {
1382
- var o, S;
1383
- if (v != null) {
1384
- const $ = (o = l.value) == null ? void 0 : o.bundleImage;
1385
- $ === null && v.image ? (await ve.delete(v.image), v.image = null) : $ && (v.image = await ve.update(
1386
- ve.bundleImagePath(void 0, $),
1387
- $
1388
- ));
1389
- }
1390
- await he.updateStoreBundle({
1391
- categories: A
1392
- }), await s.readMemberStore(), await s.readMembership(), await s.readRewards(), (S = l.value) == null || S.showSheet(!1);
1393
- },
1394
- {
1395
- message: `${v == null ? "Deleting" : c == -1 ? "Creating" : "Updating"} bundle`,
1396
- successMessage: `Bundle ${v == null ? "deleted" : c == -1 ? "created" : "updated"} successfully`
1397
- }
1398
- );
1399
- }
1400
- function te(v) {
1401
- var w;
1402
- (w = l.value) == null || w.showSheet(!0, {
1403
- ...v,
1404
- bundle: v.bundle ? De(v.bundle) : void 0
1405
- });
1406
- }
1407
- const j = N([]);
1408
- return ye(async () => {
1409
- var v, w;
1410
- await f(async () => {
1411
- var c, R;
1412
- if (await s.readMemberStore(), await s.readMembership(), await s.readRewards(), await s.readPayoutAccount(), (c = n.currentRoute.value.query) != null && c.action) {
1413
- switch ((R = n.currentRoute.value.query) == null ? void 0 : R.action) {
1414
- case "update_setting":
1415
- k("setting");
1416
- break;
1417
- case "create_category":
1418
- Z(-1);
1419
- break;
1420
- case "create_feedvibe_bundle":
1421
- r.open({
1422
- title: "Select category",
1423
- contentComponent: Pt
1424
- }).onPrimary((A) => {
1425
- r.close(), te({
1426
- categories: d.value,
1427
- category: A,
1428
- index: -1,
1429
- bundle: {
1430
- ...re.cloneDeep(Ce),
1431
- isFeedvibe: !0,
1432
- price: U.Dinero.fromNumber({
1433
- number: 10,
1434
- precision: 2
1435
- }).toObject()
1436
- }
1437
- });
1438
- }).onTertiary(() => r.close());
1439
- break;
1440
- }
1441
- n.replace({ query: {} });
1442
- }
1443
- }), j.value = [y, m, g], (((v = s.payoutAccount) == null ? void 0 : v.status) != "APPROVED" || ((w = s.payoutAccount) == null ? void 0 : w.enable) != !0) && (j.value = [
1444
- h,
1445
- y,
1446
- m,
1447
- g
1448
- ]);
1449
- }), (v, w) => {
1450
- const c = F("FmPageHead"), R = F("FmButton"), A = F("FmCard");
1451
- return _(), P(q, null, [
1452
- i(c, {
1453
- title: e(a)("connect.store.title"),
1454
- actions: e(j),
1455
- "onClick:action": k
1456
- }, null, 8, ["title", "actions"]),
1457
- x("div", uo, [
1458
- e(u) && e(u).length > 0 ? (_(), P(q, { key: 0 }, [
1459
- (_(!0), P(q, null, le(e(u), (B, H) => (_(), P("div", {
1460
- key: B.name,
1461
- class: "space-y-8 py-12"
1462
- }, [
1463
- x("div", mo, [
1464
- x("div", po, D(B.name), 1),
1465
- i(Se, { json: B }, null, 8, ["json"]),
1466
- i(R, {
1467
- icon: "edit",
1468
- size: "md",
1469
- variant: "tertiary",
1470
- onClick: (K) => Z(H)
1471
- }, null, 8, ["onClick"])
1472
- ]),
1473
- x("div", yo, [
1474
- (_(!0), P(q, null, le(B.bundles, (K, p) => (_(), O(ht, {
1475
- bundle: K,
1476
- key: K._id,
1477
- onEdit: (o) => te({
1478
- bundle: K,
1479
- category: H,
1480
- index: p,
1481
- categories: e(d)
1482
- }),
1483
- onDelete: (o) => ae(null, H, p)
1484
- }, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
1485
- i(_t, {
1486
- onCreate: (K) => te({
1487
- category: H,
1488
- index: -1,
1489
- categories: e(d)
1490
- })
1491
- }, null, 8, ["onCreate"])
1492
- ])
1493
- ]))), 128)),
1494
- i(io, {
1495
- ref_key: "bundleSheetRef",
1496
- ref: l,
1497
- onUpdate: ae
1498
- }, null, 512)
1499
- ], 64)) : (_(), O(A, {
1500
- key: 1,
1501
- variant: "outlined",
1502
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
1503
- }, {
1504
- default: T(() => [
1505
- fo,
1506
- x("div", bo, [
1507
- x("div", go, D(e(a)("connect.store.bundle.title")), 1),
1508
- x("div", vo, D(e(a)("connect.store.bundle.description")), 1)
1509
- ]),
1510
- i(R, {
1511
- variant: "primary",
1512
- label: e(a)("connect.store.actions.addCategory"),
1513
- icon: "add",
1514
- onClick: w[0] || (w[0] = (B) => Z(-1))
1515
- }, null, 8, ["label"])
1516
- ]),
1517
- _: 1
1518
- })),
1519
- i(Wt, {
1520
- ref_key: "settingSheetRef",
1521
- ref: V,
1522
- onUpdate: M
1523
- }, null, 512)
1524
- ])
1525
- ], 64);
1526
- };
1527
- }
1528
- });
1529
- export {
1530
- qo as default
1531
- };