@feedmepos/mf-connect 0.0.39-prod → 0.1.0-beta.2

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 (101) hide show
  1. package/dist/Analytic-DSD9TsKr.js +622 -0
  2. package/dist/{App-X3fNEBF3.js → App-D8a5eW51.js} +250 -249
  3. package/dist/Broadcast-C8jgMe6g.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CRYS_tzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js} +20 -20
  5. package/dist/Card-C1K7ULPo.js +825 -0
  6. package/dist/Collections-lMrdPUuM.js +453 -0
  7. package/dist/Credit-CJfU5tP4.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js} +1042 -1011
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js +345 -0
  10. package/dist/Experience-Bp2ki8gU.js +221 -0
  11. package/dist/Game-BpTf6ebE.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
  14. package/dist/MainLayout-B1aJoR95.js +41 -0
  15. package/dist/Marketing-BiKE2gxA.js +316 -0
  16. package/dist/Member-BSWyy32a.js +69 -0
  17. package/dist/MemberList-CHlGREyR.js +1733 -0
  18. package/dist/MemberOverview-wL_ailso.js +58 -0
  19. package/dist/{MemberTransactions-DueaXBCy.js → MemberTransactions-BzHiXCnp.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js +432 -0
  21. package/dist/Mission-8IGT3T2C.js +261 -0
  22. package/dist/Point-CbbJ6ohd.js +222 -0
  23. package/dist/Promotion-BYXCJa_S.js +247 -0
  24. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js} +557 -557
  25. package/dist/Segment-DXDNM0yd.js +437 -0
  26. package/dist/Setting-CLpvvZTv.js +1901 -0
  27. package/dist/Store-C6-P6bwc.js +1511 -0
  28. package/dist/StoreRewards-CUM2irXK.js +401 -0
  29. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CLFiuO5k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js} +10 -10
  30. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js} +1 -1
  31. package/dist/{Tier-CftEoP_R.js → Tier-DZTDxWBo.js} +481 -453
  32. package/dist/{Title-BsavXbYh.js → Title-C2Dr5ceK.js} +314 -295
  33. package/dist/Transaction-BL4mS29d.js +39 -0
  34. package/dist/Voucher-Cx0r2-df.js +490 -0
  35. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js +56 -0
  36. package/dist/{app-BNmAx3zq.js → app-B_xuZ5HB.js} +1 -1
  37. package/dist/app-wE5HTF_Y.js +5762 -0
  38. package/dist/app.js +5 -3
  39. package/dist/{business-DGL4Ayx0.js → business-DSv8zM8C.js} +1 -1
  40. package/dist/{campaign-D94sS1kM.js → campaign-7y5qquHZ.js} +5 -3
  41. package/dist/{collection.fn-BHJ1ISqO.js → collection.fn-BxVZQAx0.js} +2 -2
  42. package/dist/dto-Ew1QwLci.js +2778 -0
  43. package/dist/{effect-CFRICzlM.js → effect-BzPh8fRI.js} +9 -9
  44. package/dist/{export-w2o9NYcy.js → export-C9tDplkA.js} +3 -3
  45. package/dist/{helper-CUDWQ8vq.js → helper-Sz7oQ0F4.js} +1 -1
  46. package/dist/{index-BGuLhEym.js → index-BQm0C3Jm.js} +3 -3
  47. package/dist/{index-BjwyxNSp.js → index-C-SOz7jt.js} +1 -1
  48. package/dist/{index-BcWJcD9f.js → index-C0lpADCo.js} +1 -1
  49. package/dist/{index-DIq2KVis.js → index-C3_4GUiI.js} +1 -1
  50. package/dist/{index-BPEV5Tzg.js → index-D-2nFLsg.js} +59 -47
  51. package/dist/{index-CFMBSL24.js → index-DBMaUGYI.js} +2 -2
  52. package/dist/{index-CpwFQFTV.js → index-DH_1nOJ_.js} +3 -3
  53. package/dist/index-Dy4pmQpt.js +29193 -0
  54. package/dist/{index-BQ6isIeo.js → index-_3qBsogG.js} +1 -1
  55. package/dist/index-gIRszcHf.js +3 -0
  56. package/dist/{index-VjUw31dN.js → index-tv4t0Pnh.js} +1 -1
  57. package/dist/{index-tZ1aqhks.js → index-z0IfdrZk.js} +319 -281
  58. package/dist/{index.esm2017-zciuPty-.js → index.esm2017-BnKJDxUo.js} +55 -55
  59. package/dist/{loading-GuXe5bYG.js → loading-Ds-yFYhc.js} +469 -460
  60. package/dist/{membership-BHWJVI3e.js → membership-DaiVw9qF.js} +3 -3
  61. package/dist/money-BHtBdZoz.js +15 -0
  62. package/dist/number-CZhcB8ef.js +12 -0
  63. package/dist/{rule-MgNa_8FF.js → rule-Cd2M6Ri2.js} +2 -2
  64. package/dist/{rule-builder-BsBCWzq_.js → rule-builder-B6og27Q1.js} +1 -1
  65. package/dist/style.css +1 -1
  66. package/dist/{template-D6k3lusq.js → template-DouRWBpv.js} +63 -63
  67. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  68. package/dist/vue-i18n-BTlOChXs.js +2365 -0
  69. package/dist/{xlsx-ClrA4KOh.js → xlsx-SahfXQ70.js} +517 -517
  70. package/dist/zod-Bg2FbC-D.js +90 -0
  71. package/package.json +7 -4
  72. package/dist/Analytic-DMFueUju.js +0 -620
  73. package/dist/Broadcast-YIfWIXeA.js +0 -216
  74. package/dist/Card-BIxlgQm7.js +0 -824
  75. package/dist/Collections-M6DaHM2W.js +0 -441
  76. package/dist/Credit-BtRy-xoY.js +0 -214
  77. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js +0 -344
  78. package/dist/Experience-DGm1lnqj.js +0 -211
  79. package/dist/Game-B8-lG7qq.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  81. package/dist/Marketing-DtG3AIWr.js +0 -309
  82. package/dist/Member-K443-9Vy.js +0 -92
  83. package/dist/MemberList-CYXHXFTL.js +0 -1735
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js +0 -203
  86. package/dist/Mission-CN5umXXA.js +0 -248
  87. package/dist/Point-XAm6H2p_.js +0 -220
  88. package/dist/Promotion-DsrA4KiE.js +0 -244
  89. package/dist/Segment-CZGGHoAu.js +0 -435
  90. package/dist/Setting-BjfxLKyp.js +0 -1870
  91. package/dist/Store-D_B-vhh3.js +0 -1513
  92. package/dist/StoreRewards-BjHffUKj.js +0 -429
  93. package/dist/Transaction-CdxzoKDG.js +0 -36
  94. package/dist/Voucher-B_9Nv1Mr.js +0 -485
  95. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  96. package/dist/app--1Ks5Hms.js +0 -2974
  97. package/dist/dto-X0Eeujxx.js +0 -1151
  98. package/dist/index-BPNG8N-w.js +0 -11
  99. package/dist/index-DWM9MWGj.js +0 -28058
  100. package/dist/money-CrttVpCp.js +0 -15
  101. package/dist/number-CIndGU4O.js +0 -12
@@ -0,0 +1,345 @@
1
+ import { defineComponent as P, ref as R, onMounted as Q, computed as H, resolveComponent as y, openBlock as s, createElementBlock as x, renderSlot as W, toDisplayString as A, createCommentVNode as v, createBlock as f, unref as e, isRef as q, createVNode as b, normalizeClass as G, watch as X, withCtx as F, resolveDynamicComponent as D, Fragment as _, createElementVNode as h, createTextVNode as ee } from "vue";
2
+ import { z as te } from "./app-wE5HTF_Y.js";
3
+ import { Z as u } from "./zod-Bg2FbC-D.js";
4
+ import { g as le, h as oe } from "./index-_3qBsogG.js";
5
+ import { u as Z } from "./vue-i18n-BTlOChXs.js";
6
+ import { s as O } from "./effect-BzPh8fRI.js";
7
+ import { p as ae } from "./loading-Ds-yFYhc.js";
8
+ import { I as ne } from "./app-B_xuZ5HB.js";
9
+ const ie = { class: "flex flex-col gap-8" }, se = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-lg-600"
12
+ }, de = { key: 1 }, me = {
13
+ key: 2,
14
+ class: "space-y-16"
15
+ }, re = /* @__PURE__ */ P({
16
+ __name: "ValidityInput",
17
+ props: {
18
+ label: {
19
+ type: String
20
+ },
21
+ disabled: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ type: {
26
+ type: String,
27
+ default: void 0
28
+ },
29
+ modelValue: {
30
+ type: Object,
31
+ required: !0
32
+ },
33
+ forCredit: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ helperText: {
38
+ type: String
39
+ }
40
+ },
41
+ emits: ["update:model-value"],
42
+ setup(t, { emit: w }) {
43
+ var B, C;
44
+ const { t: d } = Z(), l = t, g = w, o = [
45
+ { label: d("connect.template.validity_option.date_range"), value: "range" },
46
+ { label: d("connect.template.validity_option.custom"), value: "custom" }
47
+ ], a = R(!1);
48
+ Q(() => {
49
+ a.value = l.modelValue && Object.entries(l.modelValue).filter(
50
+ ([p, r]) => p != "followFirstReceive" && r != null
51
+ ).length > 0;
52
+ });
53
+ const n = R(
54
+ l.type ? o.find((p) => p.value === l.type) : (B = l.modelValue) != null && B.validBefore || (C = l.modelValue) != null && C.validAfter ? o[0] : o[1]
55
+ ), S = H(
56
+ () => l.forCredit ? le : oe
57
+ ), m = H(() => {
58
+ const p = S.value.safeParse(l.modelValue);
59
+ return p.success ? [] : p.error.errors;
60
+ });
61
+ function i(p) {
62
+ g("update:model-value", p);
63
+ }
64
+ function U(p) {
65
+ var r, k;
66
+ if (p.value == "range")
67
+ return i({
68
+ followFirstReceive: (r = l.modelValue) == null ? void 0 : r.followFirstReceive,
69
+ validAfter: void 0,
70
+ validBefore: void 0
71
+ });
72
+ if (p.value == "custom")
73
+ return a.value = !1, i({
74
+ validForDay: (k = l.modelValue) == null ? void 0 : k.validForDay
75
+ });
76
+ }
77
+ return (p, r) => {
78
+ var T, $, j, E, M, N, L, z;
79
+ const k = y("FmButtonGroup"), Y = y("FmSimpleDateRangePicker"), J = y("FmSwitch"), K = y("FmStepperField"), I = y("FmHelperText");
80
+ return s(), x("div", ie, [
81
+ W(p.$slots, "label", {}, () => [
82
+ t.label ? (s(), x("div", se, A(t.label), 1)) : v("", !0)
83
+ ]),
84
+ t.type ? v("", !0) : (s(), f(k, {
85
+ key: 0,
86
+ modelValue: e(n),
87
+ "onUpdate:modelValue": [
88
+ r[0] || (r[0] = (c) => q(n) ? n.value = c : null),
89
+ r[1] || (r[1] = (c) => U(c))
90
+ ],
91
+ items: o
92
+ }, null, 8, ["modelValue"])),
93
+ e(n).value === "range" ? (s(), x("div", de, [
94
+ b(Y, {
95
+ "model-value": {
96
+ startDate: (T = t.modelValue) != null && T.validAfter ? new Date(($ = t.modelValue) == null ? void 0 : $.validAfter).toISOString() : null,
97
+ endDate: (j = t.modelValue) != null && j.validAfter ? new Date(((E = t.modelValue) == null ? void 0 : E.validBefore) || "").toISOString() : null
98
+ },
99
+ "onUpdate:modelValue": r[2] || (r[2] = (c) => {
100
+ var V;
101
+ i({
102
+ followFirstReceive: (V = l.modelValue) == null ? void 0 : V.followFirstReceive,
103
+ validAfter: new Date(c.startDate).toISOString(),
104
+ validBefore: new Date(c.endDate).toISOString()
105
+ });
106
+ })
107
+ }, null, 8, ["model-value"])
108
+ ])) : e(n).value === "custom" ? (s(), x("div", me, [
109
+ b(J, {
110
+ "model-value": e(a),
111
+ label: e(d)("connect.template.validity_option.expire"),
112
+ "label-placement": "right",
113
+ "onUpdate:modelValue": r[3] || (r[3] = (c) => {
114
+ var V;
115
+ a.value = c, i({
116
+ validForDay: c ? 1 : void 0,
117
+ followFirstReceive: (V = l.modelValue) == null ? void 0 : V.followFirstReceive
118
+ });
119
+ })
120
+ }, null, 8, ["model-value", "label"]),
121
+ e(a) ? (s(), f(K, {
122
+ key: 0,
123
+ label: e(d)("connect.template.validity_option.after_day"),
124
+ class: G([{
125
+ "opacity-50 pointer-events-none": !e(a)
126
+ }, "mt-[-4px]"]),
127
+ "max-fraction-digits": 0,
128
+ disabled: !e(a),
129
+ "show-steppers": !1,
130
+ max: 99999,
131
+ "append-text": e(d)("connect.template.validity_option.days"),
132
+ "model-value": ((M = l.modelValue) == null ? void 0 : M.validForDay) ?? null,
133
+ "onUpdate:modelValue": r[4] || (r[4] = (c) => {
134
+ var V;
135
+ return i({
136
+ validForDay: c == null ? void 0 : parseInt(c.toString()),
137
+ followFirstReceive: (V = l.modelValue) == null ? void 0 : V.followFirstReceive
138
+ });
139
+ })
140
+ }, null, 8, ["label", "class", "disabled", "append-text", "model-value"])) : v("", !0)
141
+ ])) : v("", !0),
142
+ ((N = l.modelValue) == null ? void 0 : N.followFirstReceive) === !0 && e(a) ? (s(), f(I, {
143
+ key: 3,
144
+ text: e(d)("connect.template.validity_option.expire_follow_first_receive")
145
+ }, null, 8, ["text"])) : v("", !0),
146
+ b(I, {
147
+ text: t.helperText || (((L = l.modelValue) == null ? void 0 : L.validForDay) === 0 ? e(d)("connect.template.validity_option.expires_on_same_day") : e(u).helperText(e(m), "")),
148
+ state: t.helperText ? "error" : ((z = l.modelValue) == null ? void 0 : z.validForDay) === 0 ? "warning" : e(u).helperState(e(m), "")
149
+ }, null, 8, ["text", "state"])
150
+ ]);
151
+ };
152
+ }
153
+ }), ue = { class: "space-y-8" }, he = /* @__PURE__ */ P({
154
+ __name: "CollectibleOptionInput",
155
+ props: {
156
+ modelValue: {
157
+ type: Object
158
+ },
159
+ noCampaign: {
160
+ type: Boolean
161
+ },
162
+ schema: {
163
+ type: Object,
164
+ default: () => te.any()
165
+ },
166
+ isMission: {
167
+ type: Boolean,
168
+ default: !1
169
+ }
170
+ },
171
+ emits: ["update:model-value"],
172
+ setup(t, { emit: w }) {
173
+ const { t: d } = Z(), l = t, g = w, o = R(l.modelValue ?? {});
174
+ return X(o, () => g("update:model-value", o.value)), (a, n) => {
175
+ const S = y("FmSwitch"), m = y("FmStepperField");
176
+ return s(), x("div", ue, [
177
+ t.isMission ? v("", !0) : (s(), f(S, {
178
+ key: 0,
179
+ label: e(d)("connect.template.enable_transfer"),
180
+ "label-placement": "right",
181
+ modelValue: e(o).enableTransfer,
182
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => e(o).enableTransfer = i)
183
+ }, null, 8, ["label", "modelValue"])),
184
+ t.noCampaign ? v("", !0) : (s(), x("div", {
185
+ key: 1,
186
+ class: G(["grid gap-16", t.isMission ? "" : "grid-cols-2"])
187
+ }, [
188
+ b(m, {
189
+ modelValue: e(o).maxPerUser,
190
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => e(o).maxPerUser = i),
191
+ "show-steppers": !1,
192
+ rules: [e(u).ruleAtPath(t.schema, "maxPerUser")]
193
+ }, {
194
+ label: F(() => [
195
+ (s(), f(D(
196
+ e(u).toInputLabel(
197
+ e(u).typeAtPath(t.schema, "maxPerUser"),
198
+ e(d)("connect.template.max_per_user")
199
+ )
200
+ )))
201
+ ]),
202
+ _: 1
203
+ }, 8, ["modelValue", "rules"]),
204
+ t.isMission ? v("", !0) : (s(), f(m, {
205
+ key: 0,
206
+ modelValue: e(o).maxReceive,
207
+ "onUpdate:modelValue": n[2] || (n[2] = (i) => e(o).maxReceive = i),
208
+ "show-steppers": !1,
209
+ rules: [e(u).ruleAtPath(t.schema, "maxReceive")]
210
+ }, {
211
+ label: F(() => [
212
+ (s(), f(D(
213
+ e(u).toInputLabel(
214
+ e(u).typeAtPath(t.schema, "maxReceive"),
215
+ e(d)("connect.template.max_distribute")
216
+ )
217
+ )))
218
+ ]),
219
+ _: 1
220
+ }, 8, ["modelValue", "rules"]))
221
+ ], 2)),
222
+ t.isMission ? v("", !0) : (s(), x(_, { key: 2 }, [
223
+ b(m, {
224
+ modelValue: e(o).maxUse,
225
+ "onUpdate:modelValue": n[3] || (n[3] = (i) => e(o).maxUse = i),
226
+ "append-text": "use(s)",
227
+ "show-steppers": !1,
228
+ rules: [e(u).ruleAtPath(t.schema, "maxUse")]
229
+ }, {
230
+ label: F(() => [
231
+ (s(), f(D(
232
+ e(u).toInputLabel(
233
+ e(u).typeAtPath(t.schema, "maxUse"),
234
+ e(d)("connect.template.usage_count")
235
+ )
236
+ )))
237
+ ]),
238
+ _: 1
239
+ }, 8, ["modelValue", "rules"]),
240
+ e(o).maxUse && e(o).maxUse > 1 ? (s(), f(m, {
241
+ key: 0,
242
+ modelValue: e(o).cooldown,
243
+ "onUpdate:modelValue": n[4] || (n[4] = (i) => e(o).cooldown = i),
244
+ "append-text": "minute(s)",
245
+ "show-steppers": !1,
246
+ rules: [e(u).ruleAtPath(t.schema, "cooldown")]
247
+ }, {
248
+ label: F(() => [
249
+ (s(), f(D(
250
+ e(u).toInputLabel(
251
+ e(u).typeAtPath(t.schema, "cooldown"),
252
+ e(d)("connect.template.cooldown")
253
+ )
254
+ )))
255
+ ]),
256
+ _: 1
257
+ }, 8, ["modelValue", "rules"])) : v("", !0),
258
+ b(re, {
259
+ modelValue: e(o).validityOption,
260
+ "onUpdate:modelValue": n[5] || (n[5] = (i) => e(o).validityOption = i),
261
+ label: e(d)("connect.template.validity_option.title")
262
+ }, null, 8, ["modelValue", "label"])
263
+ ], 64))
264
+ ]);
265
+ };
266
+ }
267
+ }), pe = { class: "space-y-8" }, ce = {
268
+ key: 1,
269
+ class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
270
+ }, fe = { class: "fm-typo-en-body-lg-400" }, ve = { class: "text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ P({
271
+ __name: "EffectSheet",
272
+ props: {
273
+ modelValue: { type: Object },
274
+ canSetAutoApply: {
275
+ type: Boolean
276
+ }
277
+ },
278
+ emits: ["update:model-value"],
279
+ setup(t, { emit: w }) {
280
+ const d = w, l = R(!1);
281
+ async function g(o) {
282
+ o.stopPropagation(), await ae.remove("Are you sure you want to remove this effect?") && d("update:model-value", null);
283
+ }
284
+ return (o, a) => {
285
+ const n = y("FmButton"), S = y("FmSideSheet");
286
+ return s(), f(S, {
287
+ "max-width": 550,
288
+ header: "Apply discount",
289
+ modelValue: e(l),
290
+ "onUpdate:modelValue": [
291
+ a[2] || (a[2] = (m) => q(l) ? l.value = m : null),
292
+ a[3] || (a[3] = (m) => l.value = m)
293
+ ]
294
+ }, {
295
+ "side-sheet-button": F(() => {
296
+ var m, i, U;
297
+ return [
298
+ h("div", pe, [
299
+ a[4] || (a[4] = h("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the discount you want to offer your customer. ", -1)),
300
+ t.modelValue ? (s(), x("div", ce, [
301
+ h("div", fe, [
302
+ h("div", null, A((m = e(O)(t.modelValue)) == null ? void 0 : m.type), 1),
303
+ h("div", ve, A((i = e(O)(t.modelValue)) == null ? void 0 : i.adjustment) + " with " + A((U = e(O)(t.modelValue)) == null ? void 0 : U.requirements), 1)
304
+ ]),
305
+ b(n, {
306
+ icon: "delete",
307
+ "icon-color": "neutral-gray-400",
308
+ variant: "tertiary",
309
+ onClick: g
310
+ })
311
+ ])) : (s(), f(n, {
312
+ key: 0,
313
+ label: "Apply discount",
314
+ icon: "add",
315
+ "icon-color": "primary",
316
+ variant: "secondary",
317
+ class: "border-fm-color-primary text-fm-color-primary"
318
+ }))
319
+ ])
320
+ ];
321
+ }),
322
+ "side-sheet-footer": F(() => a[5] || (a[5] = [
323
+ ee(A(void 0))
324
+ ])),
325
+ default: F(() => [
326
+ b(e(ne), {
327
+ class: "fm-effect-sheet",
328
+ title: "",
329
+ "can-set-auto-apply": t.canSetAutoApply,
330
+ "disable-effects": t.canSetAutoApply ? ["PAYMENT"] : void 0,
331
+ "initial-value": t.modelValue,
332
+ onOnConfirm: a[0] || (a[0] = (m) => (d("update:model-value", m), l.value = !1)),
333
+ onOnCancel: a[1] || (a[1] = (m) => l.value = !1)
334
+ }, null, 8, ["can-set-auto-apply", "disable-effects", "initial-value"])
335
+ ]),
336
+ _: 1
337
+ }, 8, ["modelValue"]);
338
+ };
339
+ }
340
+ });
341
+ export {
342
+ Ae as _,
343
+ he as a,
344
+ re as b
345
+ };
@@ -0,0 +1,221 @@
1
+ import { defineComponent as D, ref as S, computed as E, onMounted as U, resolveComponent as i, openBlock as m, createElementBlock as _, Fragment as x, createVNode as c, unref as t, createElementVNode as n, withCtx as h, renderList as j, createBlock as w, resolveDynamicComponent as M, toDisplayString as p, h as H } from "vue";
2
+ import { _ as q } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as z, components as G } from "@feedmepos/ui-library";
4
+ import { u as J, p as Q } from "./loading-Ds-yFYhc.js";
5
+ import { u as W } from "./business-DSv8zM8C.js";
6
+ import { u as X } from "./campaign-7y5qquHZ.js";
7
+ import { g as L, b as V } from "./dto-Ew1QwLci.js";
8
+ import { u as Y } from "./vue-i18n-BTlOChXs.js";
9
+ import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js";
11
+ import { u as te } from "./template-DouRWBpv.js";
12
+ import { c as g } from "./index-C-SOz7jt.js";
13
+ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, ne = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "space-y-4" }, le = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "flex flex-col gap-16 text-center" }, ue = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = /* @__PURE__ */ D({
14
+ __name: "Experience",
15
+ setup(ye) {
16
+ const { t: s } = Y(), I = {
17
+ label: s("connect.program.common.actions.create", {
18
+ type: s("connect.program.experience.title").toLowerCase()
19
+ }),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, P = te("POINT", z()), B = W(), l = X(), { global: T, minor: v } = J, r = S({
24
+ searchKey: "",
25
+ location: null
26
+ }), f = E(
27
+ () => l.campaigns.experience.filter(
28
+ (e) => !r.value.location || !e.targetLocation || e.targetLocation.includes(r.value.location)
29
+ )
30
+ ), K = [
31
+ {
32
+ header: "Program title",
33
+ accessorFn: (e) => e.name
34
+ },
35
+ {
36
+ header: "Status",
37
+ cell(e) {
38
+ return L(e.row.original);
39
+ }
40
+ },
41
+ {
42
+ header: "Summary",
43
+ accessorFn: (e) => V(e)
44
+ //v.effect,
45
+ },
46
+ {
47
+ header: "Actions",
48
+ cell(e) {
49
+ return H(G.FmButton, {
50
+ variant: "tertiary",
51
+ icon: "delete",
52
+ iconColor: "neutral-gray-400",
53
+ onClick: (o) => {
54
+ o.stopPropagation(), C(e.row.original);
55
+ }
56
+ });
57
+ }
58
+ }
59
+ ], b = S();
60
+ async function C(e) {
61
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await v(
62
+ async () => {
63
+ await g.delete(e._id), await l.read("POINT");
64
+ },
65
+ {
66
+ message: `Removing ${e.name}`,
67
+ successMessage: `Removed ${e.name} successfully`
68
+ }
69
+ );
70
+ }
71
+ async function y(e) {
72
+ e ? await o() : P.open(async (d) => {
73
+ await o(d);
74
+ });
75
+ async function o(d) {
76
+ var u;
77
+ (u = b.value) == null || u.showSheet(
78
+ !0,
79
+ "POINT",
80
+ e ? await g.readById(e._id) : void 0,
81
+ d
82
+ );
83
+ }
84
+ }
85
+ async function N(e) {
86
+ await v(
87
+ async () => {
88
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("POINT");
89
+ },
90
+ {
91
+ message: s("connect.program.common.update.updating", {
92
+ type: s("connect.program.experience.title")
93
+ }),
94
+ successMessage: s("connect.program.common.update.success", {
95
+ type: s("connect.program.experience.title"),
96
+ action: e.campaign._id ? "updated" : "created"
97
+ })
98
+ }
99
+ );
100
+ }
101
+ return U(async () => {
102
+ await T(async () => {
103
+ await l.read("POINT");
104
+ });
105
+ }), (e, o) => {
106
+ const d = i("FmPageHead"), u = i("FmSearch"), R = i("FmTable"), F = i("FmButton"), $ = i("FmListItem"), O = i("FmList"), A = i("FmCard");
107
+ return m(), _(x, null, [
108
+ c(d, {
109
+ title: t(s)("connect.program.experience.title"),
110
+ actions: t(f).length > 0 ? [I] : [],
111
+ "onClick:action": o[0] || (o[0] = () => y())
112
+ }, null, 8, ["title", "actions"]),
113
+ n("div", oe, [
114
+ c(u, {
115
+ modelValue: t(r).searchKey,
116
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(r).searchKey = a),
117
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
118
+ placeholder: t(s)("connect.program.common.search"),
119
+ collapsible: ""
120
+ }, null, 8, ["modelValue", "placeholder"]),
121
+ t(l).campaigns.experience && t(l).campaigns.experience.length > 0 ? (m(), _(x, { key: 0 }, [
122
+ n("div", ae, [
123
+ n("div", ne, [
124
+ c(Z, {
125
+ modelValue: t(r).location,
126
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(r).location = a),
127
+ label: "Location: ",
128
+ "show-item-label": !0,
129
+ icon: "storefront",
130
+ placement: "bottom-start",
131
+ items: t(B).locationItems
132
+ }, null, 8, ["modelValue", "items"])
133
+ ]),
134
+ c(u, {
135
+ modelValue: t(r).searchKey,
136
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(r).searchKey = a),
137
+ class: "xs:hidden",
138
+ placeholder: "search",
139
+ collapsible: ""
140
+ }, null, 8, ["modelValue"])
141
+ ]),
142
+ c(R, {
143
+ class: "xs:hidden",
144
+ "row-data": t(f),
145
+ "column-defs": K,
146
+ "search-value": t(r).searchKey,
147
+ "column-filter": [],
148
+ onRowClick: o[4] || (o[4] = (a) => y(a.original)),
149
+ "hide-footer": t(f).length < 10
150
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
151
+ c(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
152
+ default: h(() => [
153
+ (m(!0), _(x, null, j(t(f).filter(
154
+ (a) => a.name.toLowerCase().includes(t(r).searchKey.toLowerCase())
155
+ ), (a) => (m(), w($, {
156
+ key: a._id.toString(),
157
+ onClick: (k) => y(a),
158
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
159
+ }, {
160
+ default: h(() => [
161
+ n("div", se, [
162
+ n("div", re, [
163
+ (m(), w(M(t(L)(a)))),
164
+ n("div", ce, p(a.currentReceive ?? 0) + " used ", 1)
165
+ ]),
166
+ n("div", ie, [
167
+ n("div", le, p(a.name), 1),
168
+ n("div", me, p(t(V)(a)), 1)
169
+ ]),
170
+ n("div", pe, p(t(s)("program.experience.received", {
171
+ count: a.currentReceive ?? 0
172
+ })), 1)
173
+ ]),
174
+ c(F, {
175
+ icon: "delete",
176
+ "icon-color": "neutral-gray-400",
177
+ variant: "tertiary",
178
+ onClick: (k) => (k.stopPropagation(), C(a))
179
+ }, null, 8, ["onClick"])
180
+ ]),
181
+ _: 2
182
+ }, 1032, ["onClick"]))), 128))
183
+ ]),
184
+ _: 1
185
+ })
186
+ ], 64)) : (m(), w(A, {
187
+ key: 1,
188
+ variant: "outlined",
189
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
190
+ }, {
191
+ default: h(() => [
192
+ o[6] || (o[6] = n("img", {
193
+ src: q,
194
+ class: "aspect-square w-[150px]"
195
+ }, null, -1)),
196
+ n("div", de, [
197
+ n("div", ue, p(t(s)("connect.program.experience.empty_state.title")), 1),
198
+ n("div", fe, p(t(s)("connect.program.experience.empty_state.description")), 1)
199
+ ]),
200
+ c(F, {
201
+ variant: "primary",
202
+ label: "Create experience program",
203
+ icon: "add",
204
+ onClick: o[5] || (o[5] = (a) => y())
205
+ })
206
+ ]),
207
+ _: 1
208
+ })),
209
+ c(ee, {
210
+ ref_key: "sheetRef",
211
+ ref: b,
212
+ "onSubmit:modelValue": N
213
+ }, null, 512)
214
+ ])
215
+ ], 64);
216
+ };
217
+ }
218
+ });
219
+ export {
220
+ Ve as default
221
+ };