@feedmepos/mf-connect 0.1.47-prod → 0.1.48-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 (102) hide show
  1. package/dist/{Analytic-AnuRQDA4.js → Analytic-DrjBaKmx.js} +113 -113
  2. package/dist/{App-DP_jCyej.js → App-eIaytGsZ.js} +632 -622
  3. package/dist/{Bin-tL4lF6PB.js → Bin-CVp0eFwl.js} +9 -9
  4. package/dist/{Broadcast-T2a5tN8R.js → Broadcast-DBgBT6yz.js} +40 -40
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CugJWeBo.js} +18 -18
  6. package/dist/{Card-Bi-ODgCc.js → Card-DkP6oJVn.js} +239 -239
  7. package/dist/{Collections-JHWotZ1I.js → Collections-DYb_aeTW.js} +31 -31
  8. package/dist/{Credit-DQQCXqS0.js → Credit-WVv_PL5D.js} +74 -74
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Dt9c2kvf.js} +756 -753
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js → EffectSheet.vue_vue_type_style_index_0_lang-DT3y4k1C.js} +96 -96
  11. package/dist/{Experience-DzTV21vX.js → Experience-BdH44wBG.js} +41 -41
  12. package/dist/{Game-DUCx2Dl9.js → Game-C7jxRESY.js} +31 -31
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
  14. package/dist/{Index-zynxjOOr.js → Index-DYr1p4sh.js} +54 -54
  15. package/dist/{Marketing-BBHDVRkR.js → Marketing-Djl27fez.js} +24 -24
  16. package/dist/{Member-B09bj6C3.js → Member-CWXedfTG.js} +63 -63
  17. package/dist/MemberList-C2TvGi22.js +1606 -0
  18. package/dist/MemberOverview-wL_ailso.js +58 -0
  19. package/dist/{MemberTransactions-DERMSs7o.js → MemberTransactions-BSUocGg9.js} +1 -1
  20. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js → MessageInput.vue_vue_type_script_setup_true_lang-D8xPA6jM.js} +2286 -2220
  21. package/dist/{Mission-DAv0e_ZH.js → Mission-BVx9Cqi5.js} +20 -20
  22. package/dist/{Overview-D0rBTEtP.js → Overview-DyXF9zfB.js} +337 -337
  23. package/dist/{Point-BeBYi1BT.js → Point-ovkgTwZO.js} +41 -41
  24. package/dist/{Promotion-BSPU5hP9.js → Promotion-B0Q6GItP.js} +42 -42
  25. package/dist/{Queue-C5IFJ3iE.js → Queue-BAWG1Hh-.js} +12 -12
  26. package/dist/{Record-CoFSrv7j.js → Record-CTp80g4A.js} +10 -10
  27. package/dist/{Reward-COIOBOl-.js → Reward-_Jow1lJ7.js} +173 -173
  28. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js → RewardGroup.vue_vue_type_script_setup_true_lang-BV8xCejA.js} +11 -11
  29. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js → RuleGroup.vue_vue_type_script_setup_true_lang-DkDAuGY0.js} +381 -381
  30. package/dist/{Segment-DF5SrucQ.js → Segment-CsdJ1SjK.js} +327 -327
  31. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js → SelectItems.vue_vue_type_script_setup_true_lang-DH3oIm2t.js} +14 -14
  32. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DvVrjpxR.js} +11 -11
  33. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D5gV89Xk.js} +3 -3
  34. package/dist/Setting-BZRA50LO.js +1936 -0
  35. package/dist/{Store-E2_0EIy8.js → Store-CFnCN_7-.js} +238 -238
  36. package/dist/StoreRewards-B_McpBz-.js +423 -0
  37. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js → StoreTransactions.vue_vue_type_script_setup_true_lang-vL0vr-Xn.js} +185 -185
  38. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C1ZlLdme.js} +1 -1
  39. package/dist/{Tier-CEEHsXkC.js → Tier-CCYFu6kJ.js} +106 -106
  40. package/dist/{Title-BMAWlGeW.js → Title-7Mg-Ml4z.js} +95 -95
  41. package/dist/{Transaction-CLsceq-O.js → Transaction-BqZrbpZi.js} +2 -2
  42. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C6ZwPUD4.js} +6 -6
  43. package/dist/{Voucher-Cd293WYY.js → Voucher-Yty_7SuS.js} +36 -36
  44. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bt12t3gB.js +419 -0
  45. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js → ZodTextField.vue_vue_type_script_setup_true_lang-C3NHrEIl.js} +1 -1
  46. package/dist/{app-aVXsWATU.js → app-2EJP4psh.js} +31 -31
  47. package/dist/app-Dzon--6x.js +57962 -0
  48. package/dist/app.js +1 -1
  49. package/dist/{business-DVlHPzaL.js → business-BehG4fR2.js} +1 -1
  50. package/dist/{campaign-l-u9A514.js → campaign-BpaiTG4f.js} +10 -10
  51. package/dist/{campaign-D9KeUWA7.js → campaign-CAcP56Sz.js} +2 -2
  52. package/dist/{campaign.enum-Cud82tES.js → campaign.enum-BWjI8Hop.js} +1 -1
  53. package/dist/{campaign.fn-C-UojhHv.js → campaign.fn-PVdB1-V1.js} +166 -166
  54. package/dist/{collectible.enum-PrlUDScv.js → collectible.enum-BYmuqayi.js} +1 -1
  55. package/dist/{collection.fn-yR-xnV4g.js → collection.fn-CbH8hbWW.js} +2 -2
  56. package/dist/{dto-Cua1OHMY.js → dto-Dd3Oc4QO.js} +4 -4
  57. package/dist/{effect-B5-eXNEr.js → effect-DvEQNEl0.js} +1 -1
  58. package/dist/{email-addresses-BeYh5fr5.js → email-addresses-C-9JrAi8.js} +1 -1
  59. package/dist/{export-BUF4_DUz.js → export-RWE9Cn-d.js} +4 -4
  60. package/dist/{helper-CGwOThAl.js → helper-Bl6LdWED.js} +1 -1
  61. package/dist/{index-Cl2iYM2F.js → index-1bU9cLqV.js} +1 -1
  62. package/dist/{index-1BGPM6Uy.js → index-BCQMVr1J.js} +1 -1
  63. package/dist/{index-BmL_b0IR.js → index-Bgnrbk5x.js} +1 -1
  64. package/dist/{index-knuJv0ti.js → index-Bjf5Z2QE.js} +4 -4
  65. package/dist/{index-ng2IXlL1.js → index-CFW9ogow.js} +1 -1
  66. package/dist/{index-DNTd-FNx.js → index-CfgczUMX.js} +2 -2
  67. package/dist/{index-C-d_4n-1.js → index-CzCqc7ph.js} +1 -1
  68. package/dist/{index-aMDi62-C.js → index-DX1X6Owa.js} +1 -1
  69. package/dist/{index-DlFVLRKG.js → index-DZN5WWgq.js} +3 -3
  70. package/dist/{index-D5KIp8ZB.js → index-DhUvELhc.js} +3 -3
  71. package/dist/{index-Cx8-ipee.js → index-DpoNuVc-.js} +6 -6
  72. package/dist/{index-BLdVWQId.js → index-G_XSbrXB.js} +3 -3
  73. package/dist/{index-hX2mE0gQ.js → index-VVy4GPzJ.js} +1 -1
  74. package/dist/{index-CB8iWT_p.js → index-wOExBjGo.js} +1 -1
  75. package/dist/{index.esm2017-D8stWFci.js → index.esm2017-DfgZFSqe.js} +1 -1
  76. package/dist/{loading-c4b7n9Xp.js → loading-qlqqYGF3.js} +1 -1
  77. package/dist/{membership-oBIs4sbL.js → membership-Bh_1iu5v.js} +3 -3
  78. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  79. package/dist/{money-AP24H0gk.js → money-DvTB_Fek.js} +1 -1
  80. package/dist/{number-CwsAYC_2.js → number-DJQ3gi1P.js} +1 -1
  81. package/dist/objectid-BKU0cEuv.js +145 -0
  82. package/dist/{plugins-Dn7JDHi7.js → plugins-DJpBrPbQ.js} +2 -2
  83. package/dist/{reward-4wdoZeXw.js → reward-DZ4KlN9B.js} +1 -1
  84. package/dist/{rule-_OJza6tn.js → rule-DV0yCGlq.js} +4 -4
  85. package/dist/{rule-builder-DmlhHAED.js → rule-builder-D6ihVPNO.js} +1 -1
  86. package/dist/{template-BSQLFHf4.js → template-ElP-JIFL.js} +63 -63
  87. package/dist/timezone-FaHjut_D.js +1150 -0
  88. package/dist/{trigger-DC9tDnI2.js → trigger-D8wnJVTA.js} +4 -4
  89. package/dist/usePagination-Ds-cuHop.js +223 -0
  90. package/dist/{user-CCVOptFD.js → user-NWV9KppR.js} +1 -1
  91. package/dist/{vue-i18n--_Wu1nMj.js → vue-i18n-CkbS-IDD.js} +112 -112
  92. package/dist/{xlsx-BVMaOi8M.js → xlsx-CdQE5RZi.js} +226 -226
  93. package/package.json +5 -4
  94. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  95. package/dist/MemberList-DLSLGQ02.js +0 -1606
  96. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  97. package/dist/Setting-Dt0sG_hk.js +0 -1936
  98. package/dist/StoreRewards-DuSsWnTE.js +0 -423
  99. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js +0 -419
  100. package/dist/app-jRT7vsk_.js +0 -33357
  101. package/dist/objectid-CVDLTdni.js +0 -145
  102. package/dist/usePagination-JoYaROkV.js +0 -223
@@ -1,419 +0,0 @@
1
- import { defineComponent as U, ref as k, resolveComponent as p, openBlock as d, createBlock as h, withCtx as f, renderSlot as q, createVNode as s, createTextVNode as E, toDisplayString as F, createElementVNode as a, computed as N, createElementBlock as O, Fragment as S, renderList as z, unref as e, normalizeClass as J, createCommentVNode as R, resolveDynamicComponent as H } from "vue";
2
- import { c as X } from "./index-BLdVWQId.js";
3
- import { e as K, F as Q } from "./index-DNTd-FNx.js";
4
- import { C as W } from "./membership-oBIs4sbL.js";
5
- import { Z as g } from "./zod-Bg2FbC-D.js";
6
- import { _ as Y } from "./SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js";
7
- import { u as ee } from "./business-DVlHPzaL.js";
8
- import { useCoreStore as te } from "@feedmepos/mf-common";
9
- import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js";
10
- import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
11
- import { _ as ae, a as ne } from "./EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js";
12
- import { _ as se } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js";
13
- import { u as me } from "./vue-i18n--_Wu1nMj.js";
14
- import { i as re } from "./helper-CGwOThAl.js";
15
- const ie = { class: "flex justify-end gap-8 w-full" }, ue = /* @__PURE__ */ U({
16
- __name: "MenuSheet",
17
- props: {
18
- modelValue: {},
19
- filterItems: { type: Function }
20
- },
21
- emits: ["confirm"],
22
- setup(l, { emit: $ }) {
23
- const C = k(), n = k(!1);
24
- function o() {
25
- var r;
26
- (r = C.value) == null || r.onConfirm();
27
- }
28
- const y = $;
29
- return (r, x) => {
30
- const i = p("FmField"), v = p("FmButton"), I = p("FmSideSheet");
31
- return d(), h(I, {
32
- modelValue: n.value,
33
- "onUpdate:modelValue": x[1] || (x[1] = (b) => n.value = b),
34
- title: "Select Items",
35
- "close-button": !1,
36
- "dismiss-away": !0,
37
- "max-width": 560
38
- }, {
39
- "side-sheet-button": f(() => [
40
- q(r.$slots, "side-sheet-button", {}, () => [
41
- s(i, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
42
- default: f(() => [
43
- E(F(r.modelValue.length) + " item(s) selected ", 1)
44
- ]),
45
- _: 1
46
- })
47
- ])
48
- ]),
49
- "side-sheet-footer": f(() => [
50
- a("div", ie, [
51
- s(v, {
52
- variant: "tertiary",
53
- onClick: x[0] || (x[0] = (b) => n.value = !1),
54
- label: "Cancel"
55
- }),
56
- s(v, {
57
- variant: "primary",
58
- onClick: o,
59
- label: "Confirm"
60
- })
61
- ])
62
- ]),
63
- default: f(() => [
64
- s(Y, {
65
- class: "h-full",
66
- "max-height": 0,
67
- ref_key: "selectItemRef",
68
- ref: C,
69
- "initial-value": r.modelValue,
70
- "filter-items": r.filterItems,
71
- "on-complete": (b) => {
72
- y("confirm", b), n.value = !1;
73
- }
74
- }, null, 8, ["initial-value", "filter-items", "on-complete"])
75
- ]),
76
- _: 3
77
- }, 8, ["modelValue"]);
78
- };
79
- }
80
- }), de = { class: "space-y-24" }, ce = { class: "grid grid-cols-2 gap-16" }, pe = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ye = { class: "space-y-16" }, ve = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), be = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), ge = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xe = {
81
- key: 0,
82
- class: "xs:!block flex gap-16 items-center pt-8"
83
- }, Ve = /* @__PURE__ */ a("div", { class: "xs:py-4 text-center" }, "for every", -1), he = { class: "fm-typo-en-body-lg-400" }, _e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fe = {
84
- key: 0,
85
- class: "pt-8 space-y-8"
86
- }, Ce = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, Ie = { class: "xs:!block flex gap-16 items-center" }, Oe = /* @__PURE__ */ a("div", { class: "xs:py-4 text-center" }, "for every", -1), Ze = /* @__PURE__ */ U({
87
- __name: "EarningOptionInput",
88
- props: {
89
- modelValue: {
90
- type: Object
91
- },
92
- extras: {
93
- type: Object
94
- },
95
- fixedType: {
96
- type: Boolean
97
- },
98
- errorText: {
99
- type: String
100
- }
101
- },
102
- emits: ["update:model-value"],
103
- setup(l, { emit: $ }) {
104
- var I, b, P;
105
- const C = ee(), n = l, o = $, y = [
106
- {
107
- label: "Based on spending",
108
- sublabel: "Customers earn rewards based on how much they spend.",
109
- value: "PROPORTIONAL"
110
- },
111
- {
112
- label: "Fixed amount",
113
- sublabel: "Customers earn a set amount of rewards for specific actions.",
114
- value: "FIXED"
115
- }
116
- ].filter((c) => {
117
- var t, _;
118
- return n.fixedType || ((_ = (t = n.extras) == null ? void 0 : t.campaign) == null ? void 0 : _.event.type) != "BILL_COMPLETED" ? c.value == "FIXED" : !0;
119
- }), r = N(() => {
120
- var t, _;
121
- const c = n.extras && "configs" in n.extras ? n.extras.configs.type : (t = n.extras) == null ? void 0 : t.campaign.type;
122
- return (((_ = W[c]) == null ? void 0 : _.name) || "reward").toLowerCase();
123
- }), x = N(() => {
124
- const c = K.safeParse(n.modelValue);
125
- return c.success ? [] : c.error.errors;
126
- });
127
- function i(c) {
128
- var t;
129
- c != ((t = n.modelValue) == null ? void 0 : t.type) && o(
130
- "update:model-value",
131
- c === "FIXED" ? {
132
- type: "FIXED",
133
- amount: 1
134
- } : {
135
- type: "PROPORTIONAL",
136
- amount: 1,
137
- every: 1
138
- }
139
- );
140
- }
141
- const v = k(
142
- ((I = n.modelValue) == null ? void 0 : I.type) === "PROPORTIONAL" && !!((P = (b = n.modelValue) == null ? void 0 : b.property) != null && P.length) || !1
143
- );
144
- return (c, t) => {
145
- var L, B, D;
146
- const _ = p("FmCard"), T = p("FmStepperField"), A = p("FmRadio"), j = p("FmPill"), G = p("FmButton"), M = p("FmRadioGroup"), Z = p("FmHelperText");
147
- return d(), O("div", de, [
148
- a("div", ce, [
149
- (d(!0), O(S, null, z(e(y), (m) => {
150
- var V, u;
151
- return d(), h(_, {
152
- variant: "outlined",
153
- class: J(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
154
- "col-span-2": e(y).length == 1,
155
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((V = l.modelValue) == null ? void 0 : V.type) === m.value,
156
- "hover:bg-fm-color-opacity-sm": ((u = l.modelValue) == null ? void 0 : u.type) != m.value
157
- }]),
158
- onClick: (w) => i(m.value),
159
- key: m.value
160
- }, {
161
- default: f(() => [
162
- a("div", pe, F(m.label), 1),
163
- a("div", fe, F(m.sublabel), 1)
164
- ]),
165
- _: 2
166
- }, 1032, ["class", "onClick"]);
167
- }), 128))
168
- ]),
169
- a("div", ye, [
170
- ((L = l.modelValue) == null ? void 0 : L.type) === "FIXED" ? (d(), h(T, {
171
- key: 0,
172
- label: `Receive ${e(r)}(s)`,
173
- class: "flex-1",
174
- "model-value": ((B = l.modelValue) == null ? void 0 : B.amount) ?? null,
175
- "onUpdate:modelValue": t[0] || (t[0] = (m) => o("update:model-value", {
176
- ...l.modelValue ?? { type: "FIXED" },
177
- amount: m
178
- }))
179
- }, null, 8, ["label", "model-value"])) : ((D = l.modelValue) == null ? void 0 : D.type) === "PROPORTIONAL" ? (d(), O(S, { key: 1 }, [
180
- ve,
181
- s(M, {
182
- "model-value": e(v),
183
- "onUpdate:modelValue": t[6] || (t[6] = (m) => {
184
- e(v) != m && (o("update:model-value", {
185
- ...l.modelValue ?? {
186
- type: "PROPORTIONAL",
187
- amount: 1,
188
- every: 1
189
- },
190
- property: m ? [] : void 0,
191
- every: 1
192
- }), v.value = m);
193
- })
194
- }, {
195
- default: f(() => [
196
- s(A, {
197
- label: "Amount spent",
198
- sublabel: `Receive ${e(r)} by amount spent`,
199
- value: !1
200
- }, {
201
- label: f(() => {
202
- var m, V;
203
- return [
204
- be,
205
- a("div", ge, " Receive " + F(e(r)) + " by amount spent ", 1),
206
- e(v) ? R("", !0) : (d(), O("div", xe, [
207
- s(T, {
208
- label: `Receive ${e(r)}(s)`,
209
- inputmode: "decimal",
210
- class: "flex-1",
211
- "model-value": ((m = l.modelValue) == null ? void 0 : m.amount) ?? null,
212
- "onUpdate:modelValue": t[1] || (t[1] = (u) => o("update:model-value", {
213
- ...l.modelValue ?? { type: "FIXED" },
214
- amount: u
215
- }))
216
- }, null, 8, ["label", "model-value"]),
217
- Ve,
218
- s(T, {
219
- label: `Amount spend (${e(X.Config).getCountry().currency.symbol})`,
220
- class: "flex-1",
221
- inputmode: "decimal",
222
- "model-value": ((V = l.modelValue) == null ? void 0 : V.every) ?? null,
223
- "onUpdate:modelValue": t[2] || (t[2] = (u) => o("update:model-value", {
224
- ...l.modelValue,
225
- every: u
226
- }))
227
- }, {
228
- prepend: f(() => [
229
- E(F(e(X.Config).getCountry().currency.symbol), 1)
230
- ]),
231
- _: 1
232
- }, 8, ["label", "model-value"])
233
- ]))
234
- ];
235
- }),
236
- _: 1
237
- }, 8, ["sublabel"]),
238
- s(A, {
239
- label: "Product bought",
240
- sublabel: `Receive ${e(r)} by product bought`,
241
- value: !0,
242
- disabled: !e(C).isPremium
243
- }, {
244
- label: f(() => {
245
- var m, V;
246
- return [
247
- a("div", he, [
248
- E(" Product bought "),
249
- s(j, { variant: "premium" })
250
- ]),
251
- a("div", _e, " Receive " + F(e(r)) + " by product bought ", 1),
252
- e(v) ? (d(), O("div", Fe, [
253
- a("div", Ce, [
254
- s(ue, {
255
- "model-value": n.modelValue.property || [],
256
- onConfirm: t[3] || (t[3] = (u) => o("update:model-value", {
257
- ...l.modelValue,
258
- property: u
259
- }))
260
- }, {
261
- "side-sheet-button": f(() => {
262
- var u, w;
263
- return [
264
- s(G, {
265
- label: (u = n.modelValue.property) != null && u.length ? `${(w = n.modelValue.property) == null ? void 0 : w.length} product(s) selected` : "Select product",
266
- icon: "link",
267
- variant: "secondary"
268
- }, null, 8, ["label"])
269
- ];
270
- }),
271
- _: 1
272
- }, 8, ["model-value"])
273
- ]),
274
- a("div", Ie, [
275
- s(T, {
276
- inputmode: "decimal",
277
- label: `Receive ${e(r)}(s)`,
278
- class: "flex-1",
279
- "model-value": ((m = l.modelValue) == null ? void 0 : m.amount) ?? null,
280
- "onUpdate:modelValue": t[4] || (t[4] = (u) => o("update:model-value", {
281
- ...l.modelValue ?? { type: "FIXED" },
282
- amount: u
283
- }))
284
- }, null, 8, ["label", "model-value"]),
285
- Oe,
286
- s(T, {
287
- label: "Item purchased",
288
- class: "flex-1",
289
- "model-value": ((V = l.modelValue) == null ? void 0 : V.every) ?? null,
290
- inputmode: "numeric",
291
- "max-fraction-digits": 0,
292
- "onUpdate:modelValue": t[5] || (t[5] = (u) => o("update:model-value", {
293
- ...l.modelValue,
294
- every: u
295
- }))
296
- }, null, 8, ["model-value"])
297
- ])
298
- ])) : R("", !0)
299
- ];
300
- }),
301
- _: 1
302
- }, 8, ["sublabel", "disabled"])
303
- ]),
304
- _: 1
305
- }, 8, ["model-value"])
306
- ], 64)) : R("", !0)
307
- ]),
308
- l.errorText || e(x).length > 0 ? (d(), h(Z, {
309
- key: 0,
310
- class: "!mt-4",
311
- text: l.errorText || e(g).helperText(e(x), ""),
312
- state: "error"
313
- }, null, 8, ["text"])) : R("", !0)
314
- ]);
315
- };
316
- }
317
- }), Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, $e = /* @__PURE__ */ a("div", null, "Voucher description should not exceed 200 characters.", -1), Pe = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), Te = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), ke = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), qe = /* @__PURE__ */ U({
318
- __name: "VoucherEditor",
319
- props: {
320
- modelValue: {
321
- type: Object
322
- },
323
- rewardImage: {
324
- type: Object
325
- }
326
- },
327
- emits: ["update:model-value", "update:reward-image"],
328
- setup(l, { emit: $ }) {
329
- const { t: C } = me(), o = k(
330
- l.modelValue ?? re("VOUCHER", {
331
- business: te().currentBusiness.value._id,
332
- name: ""
333
- })
334
- ), y = Q, r = $;
335
- return (x, i) => {
336
- var b, P, c;
337
- const v = p("FmTextarea"), I = p("FmHelperText");
338
- return d(), O(S, null, [
339
- s(oe, {
340
- modelValue: e(o).name,
341
- "onUpdate:modelValue": i[0] || (i[0] = (t) => e(o).name = t),
342
- label: "Voucher name",
343
- schema: e(g).typeAtPath(e(y), "name", [e(o).type])
344
- }, null, 8, ["modelValue", "schema"]),
345
- s(v, {
346
- class: "!mb-[-16px]",
347
- modelValue: e(o).description,
348
- "onUpdate:modelValue": i[1] || (i[1] = (t) => e(o).description = t),
349
- rules: [e(g).ruleAtPath(e(y), "description", [e(o).type])]
350
- }, {
351
- label: f(() => [
352
- (d(), h(H(
353
- e(g).toInputLabel(
354
- e(g).typeAtPath(e(y), "description", [e(o).type]),
355
- "Voucher description"
356
- )
357
- )))
358
- ]),
359
- _: 1
360
- }, 8, ["modelValue", "rules"]),
361
- a("div", Re, [
362
- $e,
363
- a("div", null, F(((b = e(o).description) == null ? void 0 : b.length) ?? 0) + "/200", 1)
364
- ]),
365
- s(le, {
366
- class: "w-1/2 xs:w-2/3",
367
- "aspect-ratio": "16/9",
368
- file: l.rewardImage ?? void 0,
369
- thumbnail: e(o).image ?? void 0,
370
- "onUpdate:file": i[2] || (i[2] = async (t) => {
371
- r("update:reward-image", t), t || (e(o).image = null);
372
- })
373
- }, {
374
- label: f(() => [
375
- (d(), h(H(
376
- e(g).toInputLabel(
377
- e(g).typeAtPath(e(y), "image", [e(o).type]),
378
- "Voucher image"
379
- )
380
- )))
381
- ]),
382
- _: 1
383
- }, 8, ["file", "thumbnail"]),
384
- Pe,
385
- s(ae, {
386
- "model-value": e(o).extras.effect,
387
- "onUpdate:modelValue": i[3] || (i[3] = (t) => e(o).extras.effect = t)
388
- }, null, 8, ["model-value"]),
389
- e(o).extras.effect == null ? (d(), h(I, {
390
- key: 0,
391
- class: "!mt-8",
392
- text: e(C)("connect.campaign.common.effect_required"),
393
- state: "error"
394
- }, null, 8, ["text"])) : R("", !0),
395
- Te,
396
- s(ne, {
397
- "model-value": e(o).options,
398
- "no-campaign": e(o).noCampaign,
399
- "onUpdate:modelValue": i[4] || (i[4] = (t) => e(o).options = t),
400
- schema: e(g).typeAtPath(e(y), "options", ["VOUCHER"])
401
- }, null, 8, ["model-value", "no-campaign", "schema"]),
402
- ke,
403
- e(o).type === "VOUCHER" ? (d(), h(se, {
404
- key: 1,
405
- "model-value": ((c = (P = e(o).extras) == null ? void 0 : P.targetLocation) == null ? void 0 : c.map(String)) ?? null,
406
- type: "select",
407
- "onUpdate:modelValue": i[5] || (i[5] = (t) => {
408
- e(o).extras.targetLocation = t;
409
- }),
410
- rules: [e(g).ruleAtPath(e(y), "extras.targetLocation")]
411
- }, null, 8, ["model-value", "rules"])) : R("", !0)
412
- ], 64);
413
- };
414
- }
415
- });
416
- export {
417
- Ze as _,
418
- qe as a
419
- };