@feedmepos/mf-connect 0.1.98-beta.14 → 0.1.98-beta.15

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 (138) hide show
  1. package/package.json +1 -1
  2. package/dist/App-cOhxU_u8.js +0 -4782
  3. package/dist/AuditLogs-DrF4TZUW.js +0 -2013
  4. package/dist/Bin-BO-_SFaU.js +0 -166
  5. package/dist/Broadcast-3KBPqTp-.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B2k0Ax57.js +0 -120
  7. package/dist/Card-BBEYrPpW.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-BZ11k2vT.js +0 -540
  10. package/dist/Credit-CwO14_-u.js +0 -260
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D4jVrMR2.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dp9dROqK.js +0 -351
  15. package/dist/Experience-DZYYZIVR.js +0 -259
  16. package/dist/FileSaver.min-DZ6AZLEa.js +0 -74
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  19. package/dist/Game-DZly0uJ3.js +0 -330
  20. package/dist/Grab-FFgsd5Wb.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BmG1PcGa.js +0 -145
  22. package/dist/Index-Buue0sTx.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D9CPiVRL.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-DEmnoTR_.js +0 -18737
  26. package/dist/LoyaltyDashboard-iyOrUQF2.js +0 -1082
  27. package/dist/MainLayout-DDNR2vj1.js +0 -41
  28. package/dist/Marketing-BJtm-Vnf.js +0 -235
  29. package/dist/MarketingMaterialEdit-DGI8fL2j.js +0 -1035
  30. package/dist/Member-D21klZ6O.js +0 -280
  31. package/dist/MemberList-UwhfWFfo.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-DdhEdQq-.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-FQ_jtN0E.js +0 -60802
  35. package/dist/Mission-lhpygvb4.js +0 -334
  36. package/dist/Overview-Bkl8Fv1q.js +0 -1079
  37. package/dist/Overview-Ou8WJ3B7.js +0 -949
  38. package/dist/Point-CU9_iH5w.js +0 -262
  39. package/dist/Promotion-DUfpA-F5.js +0 -397
  40. package/dist/Queue-5RY1yhKG.js +0 -260
  41. package/dist/Record-CdmEH4nI.js +0 -342
  42. package/dist/Review-LtjQYKAk.js +0 -45
  43. package/dist/ReviewFacebookCallback-DPBmP1K6.js +0 -248
  44. package/dist/ReviewGoogleCallback-CDFnaibj.js +0 -213
  45. package/dist/Reward-CbEdbgTn.js +0 -442
  46. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BRWaqlw8.js +0 -149
  47. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dd8wepc7.js +0 -1911
  48. package/dist/Segment-CxTX6TU2.js +0 -1014
  49. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DUFo9F1G.js +0 -181
  50. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-YkK4-mO4.js +0 -188
  51. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-YDcyEKae.js +0 -226
  52. package/dist/Setting-DrEWfQ2K.js +0 -2047
  53. package/dist/SettingAdvertisements-BNzwx5ox.js +0 -264
  54. package/dist/Settings-D2SXYanx.js +0 -228
  55. package/dist/Store-DCi2Gebw.js +0 -1996
  56. package/dist/StoreRewards-CUvV029S.js +0 -540
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B9QdgprC.js +0 -1130
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bl2U2bAx.js +0 -7007
  59. package/dist/Tier-wxIk82Kp.js +0 -969
  60. package/dist/Title-Cx5ckWlL.js +0 -566
  61. package/dist/Transaction-CQCnhmhL.js +0 -39
  62. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DdLtspjY.js +0 -130
  63. package/dist/Voucher-D8DV8q8E.js +0 -421
  64. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Dps0mhrC.js +0 -421
  65. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BdzQYhnJ.js +0 -56
  66. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  67. package/dist/app-BYN7_HL6.js +0 -59945
  68. package/dist/app-wDQR6dpb.js +0 -39
  69. package/dist/app.js +0 -7
  70. package/dist/business-CNyGQEl3.js +0 -82
  71. package/dist/campaign-CpzFl8Vr.js +0 -4
  72. package/dist/campaign-D5dSLv9k.js +0 -277
  73. package/dist/campaign-DE4WGerQ.js +0 -219
  74. package/dist/campaign.enum-COWBdOo2.js +0 -26
  75. package/dist/campaign.fn-CBKrg_JY.js +0 -776
  76. package/dist/collectible.enum-BJKh8Szm.js +0 -19
  77. package/dist/duplicateCampaign-BJGQqxsx.js +0 -51
  78. package/dist/effect-C3uE-Ub3.js +0 -89
  79. package/dist/email-addresses-cgmjeyob.js +0 -705
  80. package/dist/export-DfPkQrIk.js +0 -97
  81. package/dist/feedme.ico +0 -0
  82. package/dist/google-BQK68wbe.js +0 -5
  83. package/dist/helper-DEZ_jgnw.js +0 -86
  84. package/dist/index-0aRjP_N-.js +0 -61
  85. package/dist/index-B4mc4nmM.js +0 -3
  86. package/dist/index-B9bDzA3j.js +0 -67
  87. package/dist/index-BVSqfE9E.js +0 -54
  88. package/dist/index-Bci4maC5.js +0 -28900
  89. package/dist/index-Bx6C3Aio.js +0 -151
  90. package/dist/index-CK4B3Egt.js +0 -2819
  91. package/dist/index-CM0_akRu.js +0 -8910
  92. package/dist/index-Ckl89tkb.js +0 -3678
  93. package/dist/index-CuFWuaJc.js +0 -85
  94. package/dist/index-CuvNtC_M.js +0 -61
  95. package/dist/index-D5Cv5Klv.js +0 -31
  96. package/dist/index-DKFmW-C4.js +0 -30289
  97. package/dist/index-fM_oxcl1.js +0 -1157
  98. package/dist/index-niKnRyUP.js +0 -32
  99. package/dist/index-vh86FiIQ.js +0 -10
  100. package/dist/index.esm2017-B2vB8CeD.js +0 -3069
  101. package/dist/loading-CBKQzRKM.js +0 -72
  102. package/dist/lodash-jJUnjhex.js +0 -3678
  103. package/dist/membership-DF-HsQ7U.js +0 -255
  104. package/dist/moment-D7p2TMB-.js +0 -2583
  105. package/dist/money-D1M9tVKp.js +0 -15
  106. package/dist/number-CtwHCTkf.js +0 -12
  107. package/dist/object-BYyQ0PZp.js +0 -18
  108. package/dist/objectId-dwaoBfJX.js +0 -7
  109. package/dist/objectid-D9V_xKfE.js +0 -145
  110. package/dist/plugins-B5hadxaX.js +0 -1788
  111. package/dist/reward-DKwcSvsL.js +0 -36
  112. package/dist/rule-_Qadty1-.js +0 -1969
  113. package/dist/string-Gcy5IM_H.js +0 -32
  114. package/dist/style.css +0 -4
  115. package/dist/template-Dd-s9Cy8.js +0 -188
  116. package/dist/tier-BJDhpH6X.js +0 -4
  117. package/dist/tiers/tier=1.png +0 -0
  118. package/dist/tiers/tier=2.png +0 -0
  119. package/dist/tiers/tier=3.png +0 -0
  120. package/dist/tiers/tier=4.png +0 -0
  121. package/dist/titles/type=diamond.png +0 -0
  122. package/dist/titles/type=drinks.png +0 -0
  123. package/dist/titles/type=food.png +0 -0
  124. package/dist/titles/type=heart.png +0 -0
  125. package/dist/titles/type=medal.png +0 -0
  126. package/dist/titles/type=spend.png +0 -0
  127. package/dist/titles/type=thank-you.png +0 -0
  128. package/dist/titles/type=thumbs-up.png +0 -0
  129. package/dist/titles/type=years.png +0 -0
  130. package/dist/trigger-Bah27aCv.js +0 -213
  131. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  132. package/dist/type_drinks-D6jnpvwV.js +0 -4
  133. package/dist/useMarketingMaterialActions-zFOd9J72.js +0 -107
  134. package/dist/usePagination-C_R_8m7X.js +0 -220
  135. package/dist/user-Mvfxwgqs.js +0 -55
  136. package/dist/vue-i18n-Cf94QH_1.js +0 -2365
  137. package/dist/xlsx-DQIcBS39.js +0 -15491
  138. package/dist/zod-BLtGmvmH.js +0 -91
@@ -1,910 +0,0 @@
1
- import { defineComponent as Z, ref as y, computed as E, watch as ne, onMounted as X, resolveComponent as v, openBlock as c, createBlock as F, unref as e, isRef as G, withCtx as h, createElementVNode as d, createVNode as i, createElementBlock as $, Fragment as z, renderList as H, createCommentVNode as k, normalizeClass as me, createSlots as ge, h as K, toDisplayString as te, withModifiers as be } from "vue";
2
- import { _ as ve } from "./campaign-CpzFl8Vr.js";
3
- import { h as oe } from "./moment-D7p2TMB-.js";
4
- import { useDialog as ye, components as se } from "@feedmepos/ui-library";
5
- import "./index-DKFmW-C4.js";
6
- import { u as J } from "./loading-CBKQzRKM.js";
7
- import { u as ce } from "./app-wDQR6dpb.js";
8
- import { u as W } from "./membership-DF-HsQ7U.js";
9
- import { _ as Q } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
10
- import { p as pe, f as ie, n as xe } from "./plugins-B5hadxaX.js";
11
- import { m as L } from "./index-Bx6C3Aio.js";
12
- import { z as re } from "./app-BYN7_HL6.js";
13
- import { Z as de } from "./zod-BLtGmvmH.js";
14
- import { _ as ue } from "./ImageInput.vue_vue_type_script_setup_true_lang-BmG1PcGa.js";
15
- import "./index-CK4B3Egt.js";
16
- import { l as Ce } from "./index-Ckl89tkb.js";
17
- import "./index-CM0_akRu.js";
18
- import "./index-BVSqfE9E.js";
19
- import { O as Se } from "./objectid-D9V_xKfE.js";
20
- import { a as he, c as _e } from "./object-BYyQ0PZp.js";
21
- import { u as we } from "./business-CNyGQEl3.js";
22
- import { w as ke } from "./xlsx-DQIcBS39.js";
23
- import { a as Fe, C as Ve } from "./export-DfPkQrIk.js";
24
- import { u as $e, _ as Me } from "./usePagination-C_R_8m7X.js";
25
- import { u as Be } from "./vue-i18n-Cf94QH_1.js";
26
- import { o as Ue } from "./objectId-dwaoBfJX.js";
27
- const Ae = { class: "space-y-16" }, De = { class: "gap-16 grid grid-cols-2" }, Ie = { class: "space-y-16" }, Ne = {
28
- key: 0,
29
- class: "flex flex-col gap-[16px] w-full"
30
- }, Pe = { class: "flex flex-col gap-[8px]" }, Re = ["src"], qe = { class: "flex pt-[24px] gap-[24px]" }, ze = ["src", "onClick", "alt"], Ee = { class: "flex items-center gap-8" }, je = /* @__PURE__ */ Z({
31
- __name: "CreateCardSheet",
32
- emits: ["success", "export"],
33
- setup(ee, { expose: j, emit: T }) {
34
- const { minor: D } = J, g = W(), M = y(), x = y(!1), w = T, o = y(!1);
35
- function B(m) {
36
- o.value = m, m && (s.value = {
37
- quantity: 1,
38
- code: "",
39
- codeConfig: {
40
- length: 16,
41
- charset: "1234567890",
42
- prefix: "",
43
- suffix: "",
44
- pattern: "####-####-####-####"
45
- }
46
- });
47
- }
48
- const s = y({
49
- quantity: 1,
50
- code: "",
51
- codeConfig: {
52
- length: 16,
53
- charset: "1234567890",
54
- prefix: "",
55
- suffix: "",
56
- pattern: "####-####-####-####"
57
- },
58
- setCardOnBind: !1,
59
- bundle: void 0
60
- }), p = [
61
- {
62
- label: "Bulk number",
63
- value: "bulk",
64
- sublabel: "Bulk generate unique number"
65
- },
66
- {
67
- label: "Custom number",
68
- value: "single",
69
- sublabel: "Enter your own custom number"
70
- }
71
- ], A = [
72
- {
73
- label: "Alphanumeric",
74
- value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
75
- },
76
- {
77
- label: "Alphabetic",
78
- value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
79
- },
80
- { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
81
- { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
82
- { label: "Numbers", value: "0123456789" },
83
- { label: "Custom", value: "" }
84
- ], I = y(A[0].value), _ = y("bulk"), C = y(0), n = E(
85
- () => {
86
- var m;
87
- return (m = g.membership.design) == null ? void 0 : m[C.value];
88
- }
89
- ), u = y(!1), r = E(
90
- () => g.sortedStoreCategories.flatMap((m) => m.bundles)
91
- );
92
- async function b(m) {
93
- var l, V;
94
- if (await ((l = M.value) == null ? void 0 : l.validateInputs()), !x.value) return;
95
- m.design = (V = n.value) == null ? void 0 : V.image;
96
- const t = await pe.confirm(
97
- "",
98
- "Do you want to export generated card(s)?",
99
- "Export",
100
- "Generate and without export"
101
- );
102
- console.log(t), await D(
103
- async () => {
104
- const U = await L.createCards(m);
105
- console.log(U), await w("success"), t && await w("export", U);
106
- },
107
- {
108
- message: "Creating card(s)",
109
- successMessage: "Card(s) created"
110
- }
111
- );
112
- }
113
- return j({
114
- showSheet: B
115
- }), ne(
116
- () => s.value.codeConfig.length,
117
- (m, t) => {
118
- m != t && (s.value.codeConfig.pattern = "#".repeat(Number(m)));
119
- }
120
- ), ne(
121
- () => s.value.codeConfig.pattern,
122
- (m, t) => {
123
- m != t && (s.value.codeConfig.length = (s.value.codeConfig.pattern.match(/#/g) || []).length);
124
- }
125
- ), X(async () => {
126
- await g.readMemberStore();
127
- }), (m, t) => {
128
- const l = v("FmRadio"), V = v("FmRadioGroup"), U = v("FmSwitch"), f = v("FmStepperField"), N = v("FmSelect"), q = v("FmTextField"), S = v("FmTextarea"), P = v("FmButton"), O = v("FmForm"), fe = v("FmSideSheet");
129
- return c(), F(fe, {
130
- "max-width": 560,
131
- "dismiss-away": !0,
132
- header: "Create collection",
133
- modelValue: e(o),
134
- "onUpdate:modelValue": [
135
- t[19] || (t[19] = (R) => G(o) ? o.value = R : null),
136
- t[20] || (t[20] = (R) => o.value = R)
137
- ]
138
- }, {
139
- "side-sheet-footer": h(() => [
140
- d("div", Ee, [
141
- i(P, {
142
- label: "Save",
143
- onClick: t[17] || (t[17] = (R) => b(e(s))),
144
- loading: e(ce)().isLoading
145
- }, null, 8, ["loading"]),
146
- i(P, {
147
- label: "Cancel",
148
- type: "button",
149
- variant: "tertiary",
150
- onClick: t[18] || (t[18] = (R) => o.value = !1)
151
- })
152
- ])
153
- ]),
154
- default: h(() => [
155
- i(O, {
156
- ref_key: "form",
157
- ref: M,
158
- class: "space-y-40",
159
- onValidationSuccess: t[15] || (t[15] = (R) => x.value = !0),
160
- onValidationFailed: t[16] || (t[16] = (R) => x.value = !1)
161
- }, {
162
- default: h(() => {
163
- var R, le, ae;
164
- return [
165
- d("div", null, [
166
- t[21] || (t[21] = d("div", { class: "fm-typo-en-body-lg-600" }, "Number type", -1)),
167
- i(V, {
168
- modelValue: e(_),
169
- "onUpdate:modelValue": t[0] || (t[0] = (a) => G(_) ? _.value = a : null),
170
- inline: !1
171
- }, {
172
- default: h(() => [
173
- (c(), $(z, null, H(p, (a) => i(l, {
174
- key: a.value,
175
- value: a.value,
176
- label: a.label,
177
- sublabel: a.sublabel
178
- }, null, 8, ["value", "label", "sublabel"])), 64))
179
- ]),
180
- _: 1
181
- }, 8, ["modelValue"])
182
- ]),
183
- d("div", Ae, [
184
- t[22] || (t[22] = d("div", { class: "fm-typo-en-body-lg-600" }, "Number Settings", -1)),
185
- e(_) === "bulk" ? (c(), $(z, { key: 0 }, [
186
- i(U, {
187
- "model-value": e(u),
188
- "label-placement": "right",
189
- value: "true",
190
- label: "Advance number setting",
191
- required: !0,
192
- "onUpdate:modelValue": t[1] || (t[1] = () => u.value = !e(u))
193
- }, null, 8, ["model-value"]),
194
- e(u) ? (c(), $(z, { key: 0 }, [
195
- i(f, {
196
- "model-value": e(s).codeConfig.length || null,
197
- "onUpdate:modelValue": t[2] || (t[2] = (a) => e(s).codeConfig.length = a),
198
- label: "Code length",
199
- rules: [(a) => Number(a) >= 1 || "Code length must at least 1"],
200
- required: !0
201
- }, null, 8, ["model-value", "rules"]),
202
- i(N, {
203
- label: "Charset",
204
- "model-value": e(I),
205
- items: A,
206
- "helper-text": e(s).codeConfig.charset.length > 62 ? `${e(s).codeConfig.charset.substring(0, 62)}...` : e(s).codeConfig.charset,
207
- "onUpdate:modelValue": t[3] || (t[3] = (a) => {
208
- I.value = a, e(s).codeConfig.charset = a;
209
- })
210
- }, null, 8, ["model-value", "helper-text"]),
211
- e(I) === "" ? (c(), F(q, {
212
- key: 0,
213
- modelValue: e(s).codeConfig.charset,
214
- "onUpdate:modelValue": t[4] || (t[4] = (a) => e(s).codeConfig.charset = a),
215
- label: "Custom Charset",
216
- required: ""
217
- }, null, 8, ["modelValue"])) : k("", !0),
218
- d("div", De, [
219
- i(q, {
220
- modelValue: e(s).codeConfig.prefix,
221
- "onUpdate:modelValue": t[5] || (t[5] = (a) => e(s).codeConfig.prefix = a),
222
- label: "Prefix (Optional)"
223
- }, null, 8, ["modelValue"]),
224
- i(q, {
225
- modelValue: e(s).codeConfig.suffix,
226
- "onUpdate:modelValue": t[6] || (t[6] = (a) => e(s).codeConfig.suffix = a),
227
- label: "Suffix (Optional)"
228
- }, null, 8, ["modelValue"])
229
- ]),
230
- i(q, {
231
- modelValue: e(s).codeConfig.pattern,
232
- "onUpdate:modelValue": t[7] || (t[7] = (a) => e(s).codeConfig.pattern = a),
233
- label: "Pattern",
234
- required: !0
235
- }, null, 8, ["modelValue"])
236
- ], 64)) : k("", !0),
237
- i(q, {
238
- modelValue: e(s).quantity,
239
- "onUpdate:modelValue": t[8] || (t[8] = (a) => e(s).quantity = a),
240
- label: "Number of code",
241
- rules: [
242
- (a) => a >= 1 || "Quantity cannot be less than 1",
243
- (a) => a <= 1e4 || "Quantity cannot more than 10,000"
244
- ],
245
- required: !0,
246
- "helper-text": `${e(s).quantity} card will be created`
247
- }, null, 8, ["modelValue", "rules", "helper-text"])
248
- ], 64)) : k("", !0),
249
- e(_) !== "bulk" ? (c(), F(S, {
250
- key: 1,
251
- modelValue: e(s).code,
252
- "onUpdate:modelValue": t[9] || (t[9] = (a) => e(s).code = a),
253
- label: "Custom Card Number",
254
- rules: [(a) => e(_) != "single" || !!a || "Custom code is required"],
255
- placeholder: "(For multiple numbers, please enter in the new row.)"
256
- }, null, 8, ["modelValue", "rules"])) : k("", !0)
257
- ]),
258
- d("div", Ie, [
259
- t[23] || (t[23] = d("div", { class: "fm-typo-en-body-lg-600" }, "Card Settings", -1)),
260
- i(U, {
261
- "label-placement": "right",
262
- label: "Set card number on bind",
263
- sublabel: "Automatically set the card number when the user binds the card",
264
- "model-value": e(s).setCardOnBind || !1,
265
- "onUpdate:modelValue": t[10] || (t[10] = (a) => e(s).setCardOnBind = a)
266
- }, null, 8, ["model-value"]),
267
- i(Q, {
268
- label: "Activate bundle on bind",
269
- placeholder: "Select bundle",
270
- items: e(r).filter((a) => !a.stripePriceId).map((a) => ({ label: a.name, value: a._id })),
271
- modelValue: e(s).bundle,
272
- "onUpdate:modelValue": t[12] || (t[12] = (a) => e(s).bundle = a)
273
- }, {
274
- append: h(() => [
275
- e(s).bundle ? (c(), F(P, {
276
- key: 0,
277
- icon: "link_off",
278
- variant: "plain",
279
- onClick: t[11] || (t[11] = (a) => e(s).bundle = void 0)
280
- })) : k("", !0)
281
- ]),
282
- _: 1
283
- }, 8, ["items", "modelValue"]),
284
- (le = (R = e(g).store) == null ? void 0 : R.stripe) != null && le.apiKey ? (c(), F(Q, {
285
- key: 0,
286
- label: "Linked subscription bundle",
287
- placeholder: "Select bundle",
288
- items: e(r).filter((a) => a.stripePriceId).map((a) => ({ label: a.name, value: a._id })),
289
- modelValue: e(s).subscriptionBundle,
290
- "onUpdate:modelValue": t[14] || (t[14] = (a) => e(s).subscriptionBundle = a)
291
- }, {
292
- append: h(() => [
293
- e(s).subscriptionBundle ? (c(), F(P, {
294
- key: 0,
295
- icon: "link_off",
296
- variant: "plain",
297
- onClick: t[13] || (t[13] = (a) => e(s).subscriptionBundle = void 0)
298
- })) : k("", !0)
299
- ]),
300
- _: 1
301
- }, 8, ["items", "modelValue"])) : k("", !0)
302
- ]),
303
- e(g).membership.design ? (c(), $("div", Ne, [
304
- d("div", Pe, [
305
- t[24] || (t[24] = d("p", { class: "fm-typo-en-title-sm-800" }, "Design preview", -1)),
306
- d("img", {
307
- src: (ae = e(n)) == null ? void 0 : ae.image,
308
- class: "aspect-[16/9]"
309
- }, null, 8, Re),
310
- d("div", qe, [
311
- (c(!0), $(z, null, H(e(g).membership.design, (a, Y) => (c(), $("img", {
312
- src: a.image,
313
- key: `image_${Y}`,
314
- class: me(["w-[112px] h-[63px] cursor-pointer", `${e(C) === Y ? "border-[2px] border-fm-color-primary" : ""}`]),
315
- onClick: (dt) => C.value = Y,
316
- alt: `ai_image_predict_${Y}`,
317
- style: { objectFit: "cover" }
318
- }, null, 10, ze))), 128))
319
- ])
320
- ])
321
- ])) : k("", !0)
322
- ];
323
- }),
324
- _: 1
325
- }, 512)
326
- ]),
327
- _: 1
328
- }, 8, ["modelValue"]);
329
- };
330
- }
331
- }), Te = { class: "space-y-16" }, Le = {
332
- key: 0,
333
- class: "flex flex-col gap-[16px] w-full"
334
- }, Oe = { class: "flex flex-col gap-[8px]" }, Ye = ["src"], Ke = { class: "flex pt-[24px] gap-[24px]" }, Ge = ["src", "onClick", "alt"], He = { class: "flex items-center gap-8" }, Qe = /* @__PURE__ */ Z({
335
- __name: "EditCardSheet",
336
- emits: ["success"],
337
- setup(ee, { expose: j, emit: T }) {
338
- const { minor: D } = J, g = W(), M = y(), x = y(!1), w = T, o = y({
339
- _id: "",
340
- business: "",
341
- serialNumber: ""
342
- }), B = y(!1);
343
- function s(C, n) {
344
- var u;
345
- B.value = C, C && n && (o.value = n, p.value = (u = g.membership.design) == null ? void 0 : u.findIndex(
346
- (r) => r.image === n.design
347
- ));
348
- }
349
- const p = y(0), A = E(
350
- () => {
351
- var C;
352
- return (C = g.membership.design) == null ? void 0 : C[p.value];
353
- }
354
- ), I = E(
355
- () => g.sortedStoreCategories.flatMap(
356
- (C) => C.bundles
357
- )
358
- );
359
- async function _(C) {
360
- var n, u;
361
- await ((n = M.value) == null ? void 0 : n.validateInputs()), x.value && (C.design = (u = A.value) == null ? void 0 : u.image, await D(
362
- async () => {
363
- await L.updateCard(C), await w("success");
364
- },
365
- {
366
- message: "Updating card",
367
- successMessage: "Card updated"
368
- }
369
- ));
370
- }
371
- return j({
372
- showSheet: s
373
- }), X(async () => {
374
- await g.readMemberStore();
375
- }), (C, n) => {
376
- const u = v("FmTextField"), r = v("FmSwitch"), b = v("FmButton"), m = v("FmForm"), t = v("FmSideSheet");
377
- return c(), F(t, {
378
- "max-width": 560,
379
- "dismiss-away": !0,
380
- header: "Edit card",
381
- modelValue: e(B),
382
- "onUpdate:modelValue": [
383
- n[10] || (n[10] = (l) => G(B) ? B.value = l : null),
384
- n[11] || (n[11] = (l) => B.value = l)
385
- ]
386
- }, {
387
- "side-sheet-footer": h(() => [
388
- d("div", He, [
389
- i(b, {
390
- label: "Save",
391
- disabled: !!e(o).redeemedAt,
392
- onClick: n[8] || (n[8] = (l) => _(e(o))),
393
- loading: e(ce)().isLoading
394
- }, null, 8, ["disabled", "loading"]),
395
- i(b, {
396
- label: "Cancel",
397
- type: "button",
398
- variant: "tertiary",
399
- onClick: n[9] || (n[9] = (l) => B.value = !1)
400
- })
401
- ])
402
- ]),
403
- default: h(() => [
404
- i(m, {
405
- ref_key: "form",
406
- ref: M,
407
- class: "space-y-40",
408
- onValidationSuccess: n[6] || (n[6] = (l) => x.value = !0),
409
- onValidationFailed: n[7] || (n[7] = (l) => x.value = !1)
410
- }, {
411
- default: h(() => {
412
- var l, V, U;
413
- return [
414
- d("div", Te, [
415
- i(u, {
416
- modelValue: e(o).serialNumber,
417
- "onUpdate:modelValue": n[0] || (n[0] = (f) => e(o).serialNumber = f),
418
- label: "Card Number",
419
- rules: [
420
- e(de).toRule(e(re).string().min(1, "Card number is required")),
421
- e(de).toRule(
422
- e(re).string().max(50, "Card number must be less than 50 characters")
423
- )
424
- ],
425
- required: !0
426
- }, null, 8, ["modelValue", "rules"]),
427
- n[12] || (n[12] = d("div", { class: "fm-typo-en-body-lg-600" }, "Card Settings", -1)),
428
- i(r, {
429
- "label-placement": "right",
430
- label: "Set card number on bind",
431
- "model-value": e(o).setCardOnBind || !1,
432
- "onUpdate:modelValue": n[1] || (n[1] = (f) => e(o).setCardOnBind = f)
433
- }, null, 8, ["model-value"]),
434
- i(Q, {
435
- label: "Activate bundle on bind",
436
- placeholder: "Select bundle",
437
- items: e(I).filter((f) => !f.stripePriceId).map((f) => ({ label: f.name, value: f._id })),
438
- modelValue: e(o).bundle,
439
- "onUpdate:modelValue": n[3] || (n[3] = (f) => e(o).bundle = f)
440
- }, {
441
- append: h(() => [
442
- e(o).bundle ? (c(), F(b, {
443
- key: 0,
444
- icon: "link_off",
445
- variant: "plain",
446
- onClick: n[2] || (n[2] = (f) => e(o).bundle = null)
447
- })) : k("", !0)
448
- ]),
449
- _: 1
450
- }, 8, ["items", "modelValue"]),
451
- (V = (l = e(g).store) == null ? void 0 : l.stripe) != null && V.apiKey ? (c(), F(Q, {
452
- key: 0,
453
- label: "Linked subscription bundle",
454
- placeholder: "Select bundle",
455
- items: e(I).filter((f) => f.stripePriceId).map((f) => ({ label: f.name, value: f._id })),
456
- modelValue: e(o).subscriptionBundle,
457
- "onUpdate:modelValue": n[5] || (n[5] = (f) => e(o).subscriptionBundle = f)
458
- }, {
459
- append: h(() => [
460
- e(o).subscriptionBundle ? (c(), F(b, {
461
- key: 0,
462
- icon: "link_off",
463
- variant: "plain",
464
- onClick: n[4] || (n[4] = (f) => e(o).subscriptionBundle = null)
465
- })) : k("", !0)
466
- ]),
467
- _: 1
468
- }, 8, ["items", "modelValue"])) : k("", !0)
469
- ]),
470
- e(g).membership.design ? (c(), $("div", Le, [
471
- d("div", Oe, [
472
- n[13] || (n[13] = d("p", { class: "fm-typo-en-title-sm-800" }, "Design preview", -1)),
473
- d("img", {
474
- src: (U = e(A)) == null ? void 0 : U.image,
475
- class: "aspect-[16/9]"
476
- }, null, 8, Ye),
477
- d("div", Ke, [
478
- (c(!0), $(z, null, H(e(g).membership.design, (f, N) => (c(), $("img", {
479
- src: f.image,
480
- key: `image_${N}`,
481
- class: me(["w-[112px] h-[63px] cursor-pointer", `${e(p) === N ? "border-[2px] border-fm-color-primary" : ""}`]),
482
- onClick: (q) => p.value = N,
483
- alt: `ai_image_predict_${N}`,
484
- style: { objectFit: "cover" }
485
- }, null, 10, Ge))), 128))
486
- ])
487
- ])
488
- ])) : k("", !0)
489
- ];
490
- }),
491
- _: 1
492
- }, 512)
493
- ]),
494
- _: 1
495
- }, 8, ["modelValue"]);
496
- };
497
- }
498
- }), Ze = {
499
- key: 0,
500
- class: "grid grid-cols-1 gap-8"
501
- }, Xe = { class: "flex items-center gap-8" }, Je = { class: "flex items-center gap-8" }, We = 5, et = /* @__PURE__ */ Z({
502
- __name: "CardDesignSheet",
503
- emits: ["success"],
504
- setup(ee, { expose: j, emit: T }) {
505
- const { minor: D } = J, g = W(), M = ye(), x = y(!1);
506
- y(), y(!1);
507
- const w = y(), o = y(null);
508
- E(() => {
509
- var u, r;
510
- return Math.min((((r = (u = w.value) == null ? void 0 : u.design) == null ? void 0 : r.length) ?? 0) + 1, We);
511
- });
512
- const B = T, s = E(() => {
513
- var u, r;
514
- return ((r = (u = g.membership) == null ? void 0 : u.design) == null ? void 0 : r.filter((b) => b.image)) || [];
515
- }), p = y(!1);
516
- function A(u) {
517
- p.value = u;
518
- }
519
- function I() {
520
- x.value = !0;
521
- }
522
- async function _() {
523
- await D(
524
- async () => {
525
- var b;
526
- const u = he(w.value), r = Ce.parse(u);
527
- if (r.design = (r == null ? void 0 : r.design) || [], o.value) {
528
- const m = Se().toHexString(), t = await ie.update(
529
- ie.designPath(m, o.value),
530
- o.value
531
- );
532
- (b = r.design) == null || b.push({
533
- _id: m,
534
- image: t
535
- });
536
- }
537
- await L.update(r), await n(), await B("success"), o.value = null, x.value = !1;
538
- },
539
- {
540
- message: "Saving card design",
541
- successMessage: "Card design saved"
542
- }
543
- );
544
- }
545
- async function C(u, r) {
546
- u ? o.value = u : r && M.open({
547
- title: "Delete Design",
548
- message: "Are you sure you want to delete this design?",
549
- primaryActions: { text: "Delete", close: !0 },
550
- secondaryActions: { text: "Cancel", close: !1 }
551
- }).onPrimary(async () => {
552
- var m, t;
553
- const b = (m = w.value.design) == null ? void 0 : m.findIndex((l) => l._id == r);
554
- console.log(b), b !== -1 && ((t = w.value.design) == null || t.splice(b, 1)), await _();
555
- }).onSecondary(() => {
556
- M.close();
557
- });
558
- }
559
- async function n() {
560
- await g.readMembership(), w.value = g.membership;
561
- }
562
- return j({
563
- showSheet: A
564
- }), X(async () => {
565
- await n(), s.value.length || (x.value = !0);
566
- }), (u, r) => {
567
- const b = v("FmButton"), m = v("FmSideSheet");
568
- return c(), F(m, {
569
- "max-width": 560,
570
- "dismiss-away": !0,
571
- header: "Manage Design",
572
- modelValue: e(p),
573
- "onUpdate:modelValue": [
574
- r[2] || (r[2] = (t) => G(p) ? p.value = t : null),
575
- r[3] || (r[3] = (t) => p.value = t)
576
- ]
577
- }, ge({
578
- default: h(() => [
579
- e(x) ? k("", !0) : (c(), $("div", Ze, [
580
- (c(!0), $(z, null, H(e(s), (t) => (c(), F(ue, {
581
- key: String(t._id),
582
- "image-fit": "cover",
583
- label: "",
584
- "aspect-ratio": "16/9",
585
- thumbnail: t.image,
586
- accept: ".png, .jpg, .jpeg, .gif",
587
- "recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
588
- file: void 0,
589
- "delete-button": !1
590
- }, {
591
- "delete-button": h(() => [
592
- i(b, {
593
- class: "!text-neutral-50 !bg-neutral-700",
594
- icon: "delete",
595
- variant: "tertiary",
596
- onClick: (l) => C(null, t._id)
597
- }, null, 8, ["onClick"])
598
- ]),
599
- _: 2
600
- }, 1032, ["thumbnail"]))), 128))
601
- ])),
602
- e(x) ? (c(), F(ue, {
603
- key: 1,
604
- "image-fit": "cover",
605
- label: "",
606
- "aspect-ratio": "16/9",
607
- accept: ".png, .jpg, .jpeg, .gif",
608
- "recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
609
- "onUpdate:file": C
610
- })) : k("", !0)
611
- ]),
612
- _: 2
613
- }, [
614
- e(x) ? {
615
- name: "side-sheet-footer",
616
- fn: h(() => [
617
- d("div", Je, [
618
- i(b, {
619
- label: "Save",
620
- onClick: _,
621
- disabled: !e(o)
622
- }, null, 8, ["disabled"]),
623
- i(b, {
624
- label: "Cancel",
625
- type: "button",
626
- variant: "tertiary",
627
- onClick: r[1] || (r[1] = (t) => x.value = !1)
628
- })
629
- ])
630
- ]),
631
- key: "1"
632
- } : {
633
- name: "side-sheet-footer",
634
- fn: h(() => [
635
- d("div", Xe, [
636
- i(b, {
637
- label: "Add Design",
638
- onClick: I
639
- }),
640
- i(b, {
641
- label: "Cancel",
642
- type: "button",
643
- variant: "tertiary",
644
- onClick: r[0] || (r[0] = (t) => p.value = !1)
645
- })
646
- ])
647
- ]),
648
- key: "0"
649
- }
650
- ]), 1032, ["modelValue"]);
651
- };
652
- }
653
- }), tt = { class: "flex items-center" }, lt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, at = { class: "px-24 flex flex-col pb-24 gap-y-16" }, nt = { class: "flex items-center justify-end" }, ot = { class: "flex flex-col gap-16 text-center" }, st = { class: "fm-typo-en-title-sm-800" }, it = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = { class: "flex gap-x-8" }, Pt = /* @__PURE__ */ Z({
654
- __name: "Card",
655
- setup(ee) {
656
- const { minor: j, global: T } = J, D = y(), g = y(), M = y(), x = we(), w = W(), { t: o } = Be(), B = E(
657
- () => w.sortedStoreCategories.flatMap((t) => t.bundles)
658
- ), s = [
659
- {
660
- header: o("connect.loyalty.card.table.card_number"),
661
- accessorFn: (t) => t.serialNumber
662
- },
663
- {
664
- header: o("connect.loyalty.card.table.redeemed_by"),
665
- accessorKey: "user",
666
- enableSorting: !1,
667
- cell(t) {
668
- const l = t.row.original.pf_member;
669
- return K(
670
- "div",
671
- {
672
- class: "flex items-center gap-x-8"
673
- },
674
- [
675
- K(se.FmAvatar, {
676
- name: l != null && l.photoUrl || l == null ? void 0 : l.name,
677
- src: (l == null ? void 0 : l.photoUrl) ?? void 0,
678
- size: "sm"
679
- }),
680
- K("span", { class: "fm-typo-en-body-sm-400" }, l == null ? void 0 : l.name)
681
- ]
682
- );
683
- }
684
- },
685
- {
686
- header: o("connect.loyalty.card.table.phone"),
687
- accessorFn: (t) => {
688
- var l;
689
- return ((l = t.pf_member) == null ? void 0 : l.phoneNumber) || "-";
690
- },
691
- accessorKey: "pf_member.phoneNumber"
692
- },
693
- {
694
- header: o("connect.loyalty.card.table.created_at"),
695
- accessorKey: "_id",
696
- accessorFn: (t) => oe(Ue(t._id.toString())).format("DD MMM YYYY hh:mmA")
697
- },
698
- {
699
- header: o("connect.loyalty.card.table.bundle"),
700
- accessorFn: (t) => {
701
- var l;
702
- return ((l = B.value.find((V) => V._id === t.bundle)) == null ? void 0 : l.name) || "-";
703
- }
704
- },
705
- {
706
- header: o("connect.loyalty.card.table.redeemed_at"),
707
- accessorKey: "redeemedAt",
708
- accessorFn: (t) => t.redeemedAt ? oe(t.redeemedAt).format("DD MMM YYYY hh:mmA") : "-"
709
- },
710
- {
711
- header: o("connect.loyalty.card.table.actions"),
712
- cell(t) {
713
- return K(se.FmButton, {
714
- variant: "tertiary",
715
- icon: "delete",
716
- iconColor: "neutral-gray-400",
717
- disabled: !!t.row.original.redeemedAt,
718
- onClick: (l) => {
719
- l.stopPropagation(), r(t.row.original);
720
- }
721
- });
722
- }
723
- }
724
- ], { tableMeta: p, rowData: A, onSort: I, debouncedFetchData: _, onSearch: C } = $e(L.readCards);
725
- async function n(t) {
726
- var l;
727
- await _(t), (l = D.value) == null || l.showSheet(!1);
728
- }
729
- const u = E(() => x.isPremium ? [
730
- {
731
- label: o("connect.loyalty.card.actions.create"),
732
- value: "create",
733
- isPrimary: !0
734
- },
735
- {
736
- label: o("connect.loyalty.card.actions.manage_design"),
737
- value: "design",
738
- isPrimary: !0
739
- }
740
- ] : []);
741
- async function r(t) {
742
- await pe.remove(
743
- `Are you sure you want to remove card ${t.serialNumber}?`
744
- ) && await j(
745
- async () => {
746
- await L.deleteCard(t._id.toString()), await _({ pageSize: 10, pageIndex: 0 });
747
- },
748
- {
749
- message: `Removing card ${t.serialNumber}`,
750
- successMessage: `Removed card ${t.serialNumber} successfully`
751
- }
752
- );
753
- }
754
- async function b(t) {
755
- if (!t || t.length === 0)
756
- return;
757
- const l = new Ve(), V = t.map((U) => ({
758
- CardNumber: U
759
- }));
760
- l.addRecords(V), await ke(
761
- l.buildExcel(),
762
- `cards-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
763
- {
764
- bookType: "xlsx",
765
- bookSST: !1,
766
- type: "array"
767
- }
768
- );
769
- }
770
- const m = (t) => {
771
- var l;
772
- if (t.redeemedAt) {
773
- xe.error("Update not permitted", 2e3);
774
- return;
775
- }
776
- (l = g == null ? void 0 : g.value) == null || l.showSheet(!0, t);
777
- };
778
- return X(async () => {
779
- await T(async () => {
780
- await x.readPremium(), await w.readMemberStore(), await w.readMembership(), await n();
781
- });
782
- }), (t, l) => {
783
- const V = v("FmPill"), U = v("FmPageHead"), f = v("FmSearch"), N = v("FmButton"), q = v("FmCard");
784
- return c(), $(z, null, [
785
- i(U, {
786
- title: e(o)("connect.loyalty.card.title"),
787
- actions: e(u),
788
- "onClick:action": l[0] || (l[0] = (S) => {
789
- var P, O;
790
- console.log(S), S === "design" && ((P = e(M)) == null || P.showSheet(!0)), S === "create" && ((O = e(D)) == null || O.showSheet(!0));
791
- })
792
- }, {
793
- title: h(() => [
794
- d("div", tt, [
795
- d("span", lt, te(e(o)("connect.loyalty.card.title")), 1),
796
- i(V, {
797
- class: "ml-8",
798
- variant: "premium"
799
- })
800
- ])
801
- ]),
802
- _: 1
803
- }, 8, ["title", "actions"]),
804
- d("div", at, [
805
- e(A).length > 0 || e(A).length <= 0 && e(p).searchValue || e(p).pageCount > 0 ? (c(), $(z, { key: 0 }, [
806
- d("div", nt, [
807
- i(f, {
808
- class: "mt-4",
809
- modelValue: e(p).searchValue,
810
- "onUpdate:modelValue": [
811
- l[1] || (l[1] = (S) => e(p).searchValue = S),
812
- e(C)
813
- ],
814
- placeholder: "Search",
815
- collapsible: ""
816
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
817
- i(N, {
818
- icon: "ios_share",
819
- variant: "tertiary",
820
- onClick: be(e(Fe), ["prevent"])
821
- }, null, 8, ["onClick"])
822
- ]),
823
- i(Me, {
824
- loading: e(p).isLoading,
825
- "row-data": e(A),
826
- "row-count": e(p).totalRows,
827
- "column-defs": s,
828
- "shrink-at": !1,
829
- "page-count": e(p).pageCount,
830
- "page-index": e(p).pageIndex,
831
- "page-size": e(p).pageSize,
832
- onSortChange: e(I),
833
- onPageChange: l[2] || (l[2] = (S) => {
834
- e(_)({
835
- pageSize: S.pageSize,
836
- pageIndex: S.pageIndex
837
- });
838
- }),
839
- onRowClick: l[3] || (l[3] = (S) => {
840
- m(e(_e)(S.original));
841
- })
842
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
843
- ], 64)) : (c(), F(q, {
844
- key: 1,
845
- variant: "outlined",
846
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
847
- }, {
848
- default: h(() => [
849
- l[8] || (l[8] = d("img", {
850
- src: ve,
851
- class: "aspect-square w-[150px]"
852
- }, null, -1)),
853
- d("div", ot, [
854
- d("div", st, te(e(o)("connect.loyalty.card.empty_state.title")), 1),
855
- d("div", it, te(e(o)("connect.loyalty.card.empty_state.description")), 1)
856
- ]),
857
- d("div", rt, [
858
- i(N, {
859
- variant: "primary",
860
- label: e(o)("connect.loyalty.card.actions.add"),
861
- icon: "add",
862
- disabled: !e(x).isPremium,
863
- onClick: l[4] || (l[4] = () => {
864
- var S;
865
- return (S = e(D)) == null ? void 0 : S.showSheet(!0);
866
- })
867
- }, null, 8, ["label", "disabled"]),
868
- i(N, {
869
- variant: "secondary",
870
- label: e(o)("connect.loyalty.card.actions.manage_design"),
871
- disabled: !e(x).isPremium,
872
- onClick: l[5] || (l[5] = () => {
873
- var S;
874
- return (S = e(M)) == null ? void 0 : S.showSheet(!0);
875
- })
876
- }, null, 8, ["label", "disabled"])
877
- ])
878
- ]),
879
- _: 1
880
- })),
881
- i(je, {
882
- ref_key: "sheetRef",
883
- ref: D,
884
- onSuccess: l[6] || (l[6] = (S) => n()),
885
- onExport: b
886
- }, null, 512),
887
- i(et, {
888
- ref_key: "designSheetRef",
889
- ref: M,
890
- onSuccess: n
891
- }, null, 512),
892
- i(Qe, {
893
- ref_key: "editSheetRef",
894
- ref: g,
895
- onSuccess: l[7] || (l[7] = (S) => {
896
- var P;
897
- n({
898
- pageSize: e(p).pageSize,
899
- pageIndex: e(p).pageIndex
900
- }), (P = e(g)) == null || P.showSheet(!1);
901
- })
902
- }, null, 512)
903
- ])
904
- ], 64);
905
- };
906
- }
907
- });
908
- export {
909
- Pt as default
910
- };