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