@feedmepos/mf-connect 0.1.38-beta.6 → 0.1.38-beta.60

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 (130) hide show
  1. package/package.json +13 -5
  2. package/dist/Analytic-NBx32reB.js +0 -761
  3. package/dist/App-CaK9PvMd.js +0 -4632
  4. package/dist/AuditLogs-C-gCCPvF.js +0 -1887
  5. package/dist/Bin-CL6o1JSs.js +0 -166
  6. package/dist/Broadcast-B2-itjvZ.js +0 -227
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BIySMYGP.js +0 -121
  8. package/dist/Card-DNdEjt6s.js +0 -905
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-DepGq6WJ.js +0 -465
  11. package/dist/Credit-D7K0gFwc.js +0 -222
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js +0 -2185
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DrbMJlm5.js +0 -347
  16. package/dist/Experience-FlBX3eyN.js +0 -223
  17. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  19. package/dist/Game-Cc3D7lKV.js +0 -278
  20. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
  21. package/dist/Index-2wokhhFB.js +0 -259
  22. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  23. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  24. package/dist/MainLayout-B1aJoR95.js +0 -41
  25. package/dist/Marketing-D7PXYloN.js +0 -20073
  26. package/dist/Member-2xV4Izwa.js +0 -279
  27. package/dist/MemberList-CYgBdyJt.js +0 -1606
  28. package/dist/MemberOverview-wL_ailso.js +0 -58
  29. package/dist/MemberTransactions-DWDV01N4.js +0 -45
  30. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Becsw31k.js +0 -60343
  31. package/dist/Mission-BSGc9822.js +0 -296
  32. package/dist/Overview-BZjto86d.js +0 -1079
  33. package/dist/Point-0U4TTdPW.js +0 -226
  34. package/dist/Promotion-DiUa0GcV.js +0 -289
  35. package/dist/Queue-D62r2qjy.js +0 -260
  36. package/dist/Record-0iF3dG7y.js +0 -341
  37. package/dist/Reward-C5IEJYu6.js +0 -442
  38. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-S2Fd0qO8.js +0 -150
  39. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CxlamGFP.js +0 -1751
  40. package/dist/Segment-BknjBrUP.js +0 -882
  41. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BLQlkp-j.js +0 -181
  42. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CaPi4hYB.js +0 -188
  43. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BoZ0ZpNZ.js +0 -147
  44. package/dist/Setting-RLI7RgmN.js +0 -1936
  45. package/dist/Store-gxmv8hWJ.js +0 -1842
  46. package/dist/StoreRewards-C_6gY_Nk.js +0 -423
  47. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B5uzSYM4.js +0 -1029
  48. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-yjI96ZL0.js +0 -139
  49. package/dist/Tier-B168DtFj.js +0 -888
  50. package/dist/Title-uH0RI1N3.js +0 -565
  51. package/dist/Transaction-Bx-pmLrJ.js +0 -39
  52. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Ce_55V7l.js +0 -130
  53. package/dist/Voucher-Dzpz2AEB.js +0 -384
  54. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-dbA6_6b9.js +0 -419
  55. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CfLiUj9f.js +0 -56
  56. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  57. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  58. package/dist/app-B90wINOO.js +0 -33357
  59. package/dist/app-DuUxQ1ZP.js +0 -7086
  60. package/dist/app-wDQR6dpb.js +0 -39
  61. package/dist/app.js +0 -7
  62. package/dist/business-B65OtB5B.js +0 -79
  63. package/dist/campaign-CpzFl8Vr.js +0 -4
  64. package/dist/campaign-iKI-L84v.js +0 -1810
  65. package/dist/campaign-qGy6uzrC.js +0 -96
  66. package/dist/campaign.enum-CZp2DmXI.js +0 -20
  67. package/dist/campaign.fn-DKScnmjX.js +0 -758
  68. package/dist/collectible.enum-CN-lnG1m.js +0 -19
  69. package/dist/collection.fn-mMwGQWce.js +0 -26
  70. package/dist/dto-C5ri8Nws.js +0 -214
  71. package/dist/effect-Bg3yb9T6.js +0 -78
  72. package/dist/email-addresses-CQsN724N.js +0 -705
  73. package/dist/export-BLf2dhFd.js +0 -97
  74. package/dist/feedme.ico +0 -0
  75. package/dist/helper-CFaph16Q.js +0 -71
  76. package/dist/index-BBPIZjw6.js +0 -31
  77. package/dist/index-BCGDOgxb.js +0 -38
  78. package/dist/index-BCPBmANe.js +0 -3120
  79. package/dist/index-BKOgzVx6.js +0 -32
  80. package/dist/index-BN2Uyvj4.js +0 -30038
  81. package/dist/index-BPZtjcTm.js +0 -76
  82. package/dist/index-BPyac0fq.js +0 -56
  83. package/dist/index-BkySejFg.js +0 -54
  84. package/dist/index-CH2d_B8c.js +0 -121
  85. package/dist/index-CrbnfAk8.js +0 -8861
  86. package/dist/index-CsaQJMAR.js +0 -66
  87. package/dist/index-DJwQICyC.js +0 -146
  88. package/dist/index-DaEQgaiW.js +0 -2213
  89. package/dist/index-Dkmn0jmX.js +0 -32260
  90. package/dist/index-Dy5p_b1S.js +0 -3
  91. package/dist/index-vh86FiIQ.js +0 -10
  92. package/dist/index.esm2017-B9vJTKYg.js +0 -3069
  93. package/dist/loading-MEQuW9Xa.js +0 -71
  94. package/dist/lodash-B5I3zXaY.js +0 -3678
  95. package/dist/membership-Du79A0Pl.js +0 -235
  96. package/dist/moment-BWErdI6_.js +0 -2578
  97. package/dist/money-DXgYs2-R.js +0 -15
  98. package/dist/number-CBMkNZvH.js +0 -12
  99. package/dist/object-qECH92oz.js +0 -26
  100. package/dist/objectId-dwaoBfJX.js +0 -7
  101. package/dist/objectid-BeZTZYqi.js +0 -145
  102. package/dist/plugins-KiMuDTPp.js +0 -208
  103. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  104. package/dist/reward-ClX_lWcQ.js +0 -36
  105. package/dist/rule-BfidJ75Y.js +0 -1951
  106. package/dist/rule-builder-BTcZx77a.js +0 -89
  107. package/dist/style.css +0 -4
  108. package/dist/template-DPpMK30W.js +0 -190
  109. package/dist/tier-BJDhpH6X.js +0 -4
  110. package/dist/tiers/tier=1.png +0 -0
  111. package/dist/tiers/tier=2.png +0 -0
  112. package/dist/tiers/tier=3.png +0 -0
  113. package/dist/tiers/tier=4.png +0 -0
  114. package/dist/titles/type=diamond.png +0 -0
  115. package/dist/titles/type=drinks.png +0 -0
  116. package/dist/titles/type=food.png +0 -0
  117. package/dist/titles/type=heart.png +0 -0
  118. package/dist/titles/type=medal.png +0 -0
  119. package/dist/titles/type=spend.png +0 -0
  120. package/dist/titles/type=thank-you.png +0 -0
  121. package/dist/titles/type=thumbs-up.png +0 -0
  122. package/dist/titles/type=years.png +0 -0
  123. package/dist/trigger-DLp1bkZP.js +0 -144
  124. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  125. package/dist/type_drinks-D6jnpvwV.js +0 -4
  126. package/dist/usePagination-BeF5K3M7.js +0 -223
  127. package/dist/user-Cq9CGBHZ.js +0 -54
  128. package/dist/vue-i18n-COzqUgQy.js +0 -2365
  129. package/dist/xlsx-Be4bARvl.js +0 -15491
  130. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,166 +0,0 @@
1
- import { defineComponent as C, ref as c, h as s, onMounted as x, resolveComponent as d, openBlock as S, createElementBlock as B, Fragment as M, createVNode as l, unref as o, createElementVNode as u } from "vue";
2
- import { components as p } from "@feedmepos/ui-library";
3
- import { u as K } from "./loading-MEQuW9Xa.js";
4
- import { u as R } from "./business-B65OtB5B.js";
5
- import { C as A } from "./campaign-iKI-L84v.js";
6
- import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js";
7
- import { _ as U } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
8
- import { _ as Y } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-BoZ0ZpNZ.js";
9
- import { u as D } from "./vue-i18n-COzqUgQy.js";
10
- import { h as E } from "./moment-BWErdI6_.js";
11
- import { p as I } from "./plugins-KiMuDTPp.js";
12
- import { c as g } from "./index-CH2d_B8c.js";
13
- const T = { class: "px-24 flex flex-col gap-y-16" }, $ = { class: "flex items-center justify-between w-full" }, j = { class: "flex gap-8 overflow-x-auto" }, oe = /* @__PURE__ */ C({
14
- __name: "Bin",
15
- setup(H) {
16
- const { t: n } = D(), y = R(), { global: _, minor: b } = K, a = c({
17
- searchKey: "",
18
- location: null
19
- }), m = c([]), w = [
20
- {
21
- header: n("connect.campaign.common.title"),
22
- accessorFn: (e) => e.name
23
- },
24
- {
25
- header: n("connect.campaign.common.campaignType"),
26
- cell(e) {
27
- return A[e.row.original.type].chip();
28
- }
29
- },
30
- {
31
- header: n("connect.campaign.common.deletedAt"),
32
- cell(e) {
33
- return E(e.row.original.deletedAt).format("D MMM YYYY, hh:mmA");
34
- }
35
- },
36
- {
37
- header: n("connect.voucher.actions"),
38
- cell(e) {
39
- return s("div", { class: "flex items-center justify-end" }, [
40
- s(
41
- p.FmMenu,
42
- {
43
- placement: "bottom-end",
44
- onClick: (t) => {
45
- t.stopPropagation();
46
- }
47
- },
48
- {
49
- "menu-button": () => s(p.FmButton, {
50
- icon: "more_vert",
51
- iconColor: "neutral-gray-400",
52
- variant: "tertiary"
53
- }),
54
- default: () => [
55
- s(
56
- p.FmMenuItem,
57
- {
58
- icon: "restore",
59
- onClick: async (i) => {
60
- i.stopPropagation(), F(e.row.original);
61
- }
62
- },
63
- {
64
- label: s(
65
- "div",
66
- {
67
- class: "fm-typo-en-body-md-400"
68
- },
69
- n("connect.campaign.common.actions.restore")
70
- )
71
- }
72
- )
73
- ]
74
- }
75
- )
76
- ]);
77
- }
78
- }
79
- ], v = c(), V = c();
80
- async function F(e) {
81
- await I.confirm(
82
- n("connect.campaign.common.restore.confirm", { name: e.name })
83
- ) && await b(
84
- async () => {
85
- await g.restore(e._id), await f();
86
- },
87
- {
88
- message: n("connect.campaign.common.restore.restoring", { name: e.name }),
89
- successMessage: n("connect.campaign.common.restore.restored", {
90
- name: e.name
91
- })
92
- }
93
- );
94
- }
95
- async function f() {
96
- const e = await g.readAllDeleted({
97
- limit: 1e3,
98
- skip: 0,
99
- sortBy: "_id",
100
- descending: !0
101
- });
102
- m.value = e.resources;
103
- }
104
- return x(async () => {
105
- await _(async () => {
106
- await f();
107
- });
108
- }), (e, t) => {
109
- const i = d("FmPageHead"), h = d("FmSearch"), k = d("FmTable");
110
- return S(), B(M, null, [
111
- l(i, {
112
- title: o(n)("connect.bin.title")
113
- }, null, 8, ["title"]),
114
- u("div", T, [
115
- l(h, {
116
- modelValue: o(a).searchKey,
117
- "onUpdate:modelValue": t[0] || (t[0] = (r) => o(a).searchKey = r),
118
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
119
- placeholder: o(n)("connect.voucher.search"),
120
- collapsible: ""
121
- }, null, 8, ["modelValue", "placeholder"]),
122
- u("div", $, [
123
- u("div", j, [
124
- l(U, {
125
- modelValue: o(a).location,
126
- "onUpdate:modelValue": t[1] || (t[1] = (r) => o(a).location = r),
127
- label: o(n)("connect.voucher.location"),
128
- "show-item-label": !0,
129
- icon: "storefront",
130
- placement: "bottom-start",
131
- items: o(y).locationItems
132
- }, null, 8, ["modelValue", "label", "items"])
133
- ]),
134
- l(h, {
135
- modelValue: o(a).searchKey,
136
- "onUpdate:modelValue": t[2] || (t[2] = (r) => o(a).searchKey = r),
137
- class: "xs:hidden",
138
- placeholder: o(n)("connect.voucher.search"),
139
- collapsible: ""
140
- }, null, 8, ["modelValue", "placeholder"])
141
- ]),
142
- l(k, {
143
- "row-data": o(m),
144
- "column-defs": w,
145
- "search-value": o(a).searchKey,
146
- "column-filter": [],
147
- onRowClick: t[3] || (t[3] = (r) => e.onEdit(r.original)),
148
- "hide-footer": o(m).length < 10
149
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
150
- l(P, {
151
- ref_key: "sheetRef",
152
- ref: v,
153
- "onSubmit:modelValue": e.onUpdate
154
- }, null, 8, ["onSubmit:modelValue"]),
155
- l(Y, {
156
- ref_key: "sendVoucherSheetRef",
157
- ref: V
158
- }, null, 512)
159
- ])
160
- ], 64);
161
- };
162
- }
163
- });
164
- export {
165
- oe as default
166
- };
@@ -1,227 +0,0 @@
1
- import { defineComponent as N, ref as h, computed as U, onMounted as j, resolveComponent as r, openBlock as l, createElementBlock as y, Fragment as b, createVNode as i, unref as t, createElementVNode as n, withCtx as v, renderList as E, createBlock as w, resolveDynamicComponent as H, toDisplayString as d, createCommentVNode as q, h as z } from "vue";
2
- import { _ as G } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
- import { p as W } from "./plugins-KiMuDTPp.js";
5
- import { u as X } from "./loading-MEQuW9Xa.js";
6
- import { u as Y } from "./business-B65OtB5B.js";
7
- import { u as Z } from "./campaign-qGy6uzrC.js";
8
- import { a as B, b as A, g as ee } from "./campaign-iKI-L84v.js";
9
- import { u as te } from "./vue-i18n-COzqUgQy.js";
10
- import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js";
12
- import { u as ne } from "./template-DPpMK30W.js";
13
- import { c as _ } from "./index-CH2d_B8c.js";
14
- const se = { class: "px-24 flex flex-col gap-y-16" }, ce = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, re = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { key: 0 }, ge = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, ye = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ N({
15
- __name: "Broadcast",
16
- setup(be) {
17
- const { t: s } = te(), V = {
18
- label: s("connect.campaign.common.createCampaign"),
19
- value: "create",
20
- isPrimary: !0,
21
- prependIcon: "add"
22
- }, D = ne("BROADCAST", J()), R = Y(), m = Z(), { global: L, minor: C } = X, T = h((/* @__PURE__ */ new Date()).toISOString()), c = h({
23
- searchKey: "",
24
- location: null
25
- }), f = U(
26
- () => m.campaigns.broadcast.filter(
27
- (e) => !c.value.location || !e.targetLocation || e.targetLocation.includes(c.value.location)
28
- )
29
- ), I = [
30
- {
31
- header: "Broadcast title",
32
- accessorFn: (e) => e.name
33
- },
34
- {
35
- header: "Status",
36
- accessorFn: (e) => ee(e),
37
- cell(e) {
38
- return B(e.row.original);
39
- }
40
- },
41
- {
42
- header: "Summary",
43
- accessorFn: (e) => A(e)
44
- },
45
- {
46
- header: "Message sent",
47
- accessorFn: (e) => e.currentReceive ?? "N/A"
48
- },
49
- {
50
- header: "Actions",
51
- cell(e) {
52
- return z(Q.FmButton, {
53
- variant: "tertiary",
54
- icon: "delete",
55
- iconColor: "neutral-gray-400",
56
- onClick: (o) => {
57
- o.stopPropagation(), S(e.row.original);
58
- }
59
- });
60
- }
61
- }
62
- ], x = h();
63
- async function S(e) {
64
- await W.remove(
65
- s("connect.campaign.common.remove.confirm", { name: e.name })
66
- ) && await C(
67
- async () => {
68
- await _.delete(e._id), await m.read("BROADCAST");
69
- },
70
- {
71
- message: s("connect.campaign.common.remove.removing", { name: e.name }),
72
- successMessage: s("connect.campaign.common.remove.removed", {
73
- name: e.name
74
- })
75
- }
76
- );
77
- }
78
- async function g(e) {
79
- T.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await o() : D.open(async (p) => {
80
- await o(p);
81
- });
82
- async function o(p) {
83
- var u;
84
- (u = x.value) == null || u.showSheet(
85
- !0,
86
- "BROADCAST",
87
- e ? await _.readById(e._id) : void 0,
88
- p
89
- );
90
- }
91
- }
92
- async function K(e) {
93
- await C(
94
- async () => {
95
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("BROADCAST");
96
- },
97
- {
98
- message: s(
99
- `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
100
- ),
101
- successMessage: s("connect.campaign.broadcast.update.success", {
102
- action: e.campaign._id ? "updated" : "created"
103
- })
104
- }
105
- );
106
- }
107
- return j(async () => {
108
- await L(async () => {
109
- await m.read("BROADCAST");
110
- });
111
- }), (e, o) => {
112
- const p = r("FmPageHead"), u = r("FmSearch"), O = r("FmTable"), F = r("FmButton"), $ = r("FmListItem"), P = r("FmList"), M = r("FmCard");
113
- return l(), y(b, null, [
114
- i(p, {
115
- title: t(s)("connect.campaign.broadcast.title"),
116
- actions: t(f).length > 0 ? [V] : [],
117
- "onClick:action": o[0] || (o[0] = () => g())
118
- }, null, 8, ["title", "actions"]),
119
- n("div", se, [
120
- i(u, {
121
- modelValue: t(c).searchKey,
122
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(c).searchKey = a),
123
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
124
- placeholder: t(s)("connect.campaign.common.search"),
125
- collapsible: ""
126
- }, null, 8, ["modelValue", "placeholder"]),
127
- t(m).campaigns.broadcast && t(m).campaigns.broadcast.length > 0 ? (l(), y(b, { key: 0 }, [
128
- n("div", ce, [
129
- n("div", ie, [
130
- i(oe, {
131
- modelValue: t(c).location,
132
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(c).location = a),
133
- label: `${t(s)("connect.campaign.common.location")}: `,
134
- "show-item-label": !0,
135
- icon: "storefront",
136
- placement: "bottom-start",
137
- items: t(R).locationItems
138
- }, null, 8, ["modelValue", "label", "items"])
139
- ]),
140
- i(u, {
141
- modelValue: t(c).searchKey,
142
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(c).searchKey = a),
143
- class: "xs:hidden",
144
- placeholder: "search",
145
- collapsible: ""
146
- }, null, 8, ["modelValue"])
147
- ]),
148
- i(O, {
149
- class: "xs:hidden",
150
- "row-data": t(f),
151
- "column-defs": I,
152
- "search-value": t(c).searchKey,
153
- "column-filter": [],
154
- onRowClick: o[4] || (o[4] = (a) => g(a.original)),
155
- "hide-footer": !0
156
- }, null, 8, ["row-data", "search-value"]),
157
- i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
158
- default: v(() => [
159
- (l(!0), y(b, null, E(t(f).filter(
160
- (a) => a.name.toLowerCase().includes(t(c).searchKey.toLowerCase())
161
- ), (a) => (l(), w($, {
162
- key: a._id.toString(),
163
- onClick: (k) => g(a),
164
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
165
- }, {
166
- default: v(() => [
167
- n("div", re, [
168
- n("div", le, [
169
- (l(), w(H(t(B)(a)))),
170
- n("div", me, d(a.currentReceive ?? 0) + " sent ", 1)
171
- ]),
172
- n("div", de, [
173
- n("div", pe, d(a.name), 1),
174
- n("div", ue, d(t(A)(a)), 1)
175
- ])
176
- ]),
177
- i(F, {
178
- icon: "delete",
179
- "icon-color": "neutral-gray-400",
180
- variant: "tertiary",
181
- onClick: (k) => (k.stopPropagation(), S(a))
182
- }, null, 8, ["onClick"])
183
- ]),
184
- _: 2
185
- }, 1032, ["onClick"]))), 128))
186
- ]),
187
- _: 1
188
- }),
189
- t(f).length == 0 ? (l(), y("div", fe, [
190
- n("div", ge, d(t(s)("connect.campaign.common.noResults")), 1)
191
- ])) : q("", !0)
192
- ], 64)) : (l(), w(M, {
193
- key: 1,
194
- variant: "outlined",
195
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
196
- }, {
197
- default: v(() => [
198
- o[6] || (o[6] = n("img", {
199
- src: G,
200
- class: "aspect-square w-[150px]"
201
- }, null, -1)),
202
- n("div", ye, [
203
- n("div", _e, d(t(s)("connect.campaign.broadcast.create.title")), 1),
204
- n("div", he, d(t(s)("connect.campaign.broadcast.create.description")), 1)
205
- ]),
206
- i(F, {
207
- variant: "primary",
208
- label: t(s)("connect.campaign.broadcast.create.button"),
209
- icon: "add",
210
- onClick: o[5] || (o[5] = (a) => g())
211
- }, null, 8, ["label"])
212
- ]),
213
- _: 1
214
- })),
215
- i(ae, {
216
- ref_key: "sheetRef",
217
- ref: x,
218
- "onSubmit:modelValue": K
219
- }, null, 512)
220
- ])
221
- ], 64);
222
- };
223
- }
224
- });
225
- export {
226
- Te as default
227
- };
@@ -1,121 +0,0 @@
1
- import { R as RuleOperator, _ } from "./index-CrbnfAk8.js";
2
- import { i as isRuleGroup } from "./rule-builder-BTcZx77a.js";
3
- import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
4
- import { useDialog } from "@feedmepos/ui-library";
5
- import "./index-DaEQgaiW.js";
6
- import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-BCPBmANe.js";
7
- import "./index-BCGDOgxb.js";
8
- import "./index-BkySejFg.js";
9
- function validateRule(data, r, date) {
10
- const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
11
- function meetConditions(e) {
12
- return Object.entries(e.conditions ?? {}).reduce(
13
- (o, [n, t]) => {
14
- const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
15
- if (t == null)
16
- return console.log("Bad data, ignoring rule", {
17
- // property: r.property,
18
- // source,
19
- conditionKey: n,
20
- equator: t
21
- // raw: data,
22
- }), o;
23
- const i = rules[n](
24
- l,
25
- t
26
- );
27
- return o && i;
28
- },
29
- !0
30
- );
31
- }
32
- function evaluateRuleResult(rr, logic) {
33
- const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
34
- return !logic || !!eval(target);
35
- }
36
- function getRuleResults(e) {
37
- return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
38
- ...o,
39
- [n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
40
- }), {}) : {
41
- [e.name]: meetConditions(e)
42
- };
43
- }
44
- return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
45
- }
46
- const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = { class: "fm-typo-en-title-sm-600" }, _hoisted_3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main = /* @__PURE__ */ defineComponent({
47
- __name: "CampaignTypeDialog",
48
- props: {
49
- onSelect: {
50
- type: Function,
51
- required: !0
52
- }
53
- },
54
- setup(e) {
55
- const o = e, n = useDialog(), t = [
56
- {
57
- title: "Promotion",
58
- description: "Special offers or deals made available for a limited time",
59
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
60
- },
61
- {
62
- title: "Voucher",
63
- description: "A digital coupon that can be redeemed for a discounts on future purchases.",
64
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
65
- },
66
- {
67
- title: "Experience",
68
- description: "Experience points help customers gain membership tiers.",
69
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
70
- },
71
- {
72
- title: "Point",
73
- description: "Points allow customers to purchase bundle items.",
74
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
75
- },
76
- {
77
- title: "Game",
78
- description: "The game feature adds a fun and encourage customers to engage more.",
79
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
80
- },
81
- {
82
- title: "Credit",
83
- description: "Credits are virtual money that customers can use to pay for their purchases.",
84
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
85
- }
86
- ];
87
- function l(i) {
88
- n.close(), o.onSelect(i);
89
- }
90
- return (i, a) => {
91
- const c = resolveComponent("FmCard");
92
- return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
93
- default: withCtx(() => [
94
- a[0] || (a[0] = createElementVNode("div", { class: "" }, [
95
- createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
96
- createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Select the benefit type that you want to reward the selected tier. ")
97
- ], -1)),
98
- createElementVNode("div", _hoisted_1, [
99
- (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
100
- variant: "outlined",
101
- key: s.value,
102
- onClick: (u) => l(s.value),
103
- class: "p-16 space-y-8 cursor-pointer"
104
- }, {
105
- default: withCtx(() => [
106
- createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
107
- createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
108
- ]),
109
- _: 2
110
- }, 1032, ["onClick"])), 64))
111
- ])
112
- ]),
113
- _: 1
114
- });
115
- };
116
- }
117
- });
118
- export {
119
- _sfc_main as _,
120
- validateRule as v
121
- };