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

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 (132) hide show
  1. package/dist/Analytic-CM7mh-iO.js +761 -0
  2. package/dist/App-CeCzzsDu.js +4638 -0
  3. package/dist/AuditLogs-VWx8DFKA.js +1991 -0
  4. package/dist/Bin-vUuol_I9.js +166 -0
  5. package/dist/Broadcast-6VXz4-IG.js +233 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CV-zhJ15.js +121 -0
  7. package/dist/Card-CeIeGET1.js +909 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-CF_OcAL3.js +540 -0
  10. package/dist/Credit-BUqGOyp_.js +226 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-0DMFuBoG.js +3150 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BZfchHlT.js +347 -0
  15. package/dist/Experience-BxiFH_uV.js +225 -0
  16. package/dist/FileSaver.min-lgg_oBvT.js +74 -0
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/Game-BzYW0LfY.js +300 -0
  19. package/dist/GenerateMaterial-B5A7mx2y.js +589 -0
  20. package/dist/Grab-BgiMqwvj.js +301 -0
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DZ8DHrQ_.js +145 -0
  22. package/dist/Index-B85ops8K.js +259 -0
  23. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  24. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-B5rIjxYd.js +18737 -0
  25. package/dist/MainLayout-CXGVkD-W.js +41 -0
  26. package/dist/Marketing-Bnijl7lA.js +145 -0
  27. package/dist/MarketingMaterialEdit-BlUKwSoP.js +746 -0
  28. package/dist/Member-sT853g51.js +280 -0
  29. package/dist/MemberList-DYT5_fSP.js +1605 -0
  30. package/dist/MemberOverview-wL_ailso.js +58 -0
  31. package/dist/MemberTransactions-Cqce5ebe.js +45 -0
  32. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dq0Hswj8.js +60615 -0
  33. package/dist/Mission-Q5_sGgrm.js +304 -0
  34. package/dist/Overview-B0rwrHR1.js +1078 -0
  35. package/dist/Point-BGYFMvev.js +228 -0
  36. package/dist/Promotion-0acd63nA.js +364 -0
  37. package/dist/Queue-SVqRUlD_.js +259 -0
  38. package/dist/Record-BTjg4ihy.js +341 -0
  39. package/dist/Reward-DW58VMRO.js +442 -0
  40. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-s1RI55Rc.js +149 -0
  41. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Os17lXBX.js +1766 -0
  42. package/dist/Segment-Dny8pxP1.js +881 -0
  43. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-Czx7rqiq.js +181 -0
  44. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-EgVxUG_N.js +188 -0
  45. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CO0fgI3K.js +147 -0
  46. package/dist/Setting-CjcnxK34.js +1992 -0
  47. package/dist/SettingAdvertisements-CIyDF4C8.js +263 -0
  48. package/dist/Store-B8k5YVqU.js +1934 -0
  49. package/dist/StoreRewards-BW08rwpL.js +534 -0
  50. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BfFSfE2H.js +1034 -0
  51. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CZkKjUNQ.js +8093 -0
  52. package/dist/Tier-DKzu4tYw.js +969 -0
  53. package/dist/Title-BK-TXatJ.js +567 -0
  54. package/dist/Transaction-Duayg1jd.js +39 -0
  55. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BAR9h1TV.js +130 -0
  56. package/dist/Voucher-BEVAkNeJ.js +400 -0
  57. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DvFy9Z6X.js +421 -0
  58. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CU_Sx2PM.js +56 -0
  59. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  60. package/dist/app-IvbII0ql.js +45026 -0
  61. package/dist/app-wDQR6dpb.js +39 -0
  62. package/dist/app.js +7 -0
  63. package/dist/business-BFIwFfkq.js +82 -0
  64. package/dist/campaign-CpzFl8Vr.js +4 -0
  65. package/dist/campaign-RuIwxc4y.js +253 -0
  66. package/dist/campaign-w9j4I4jn.js +100 -0
  67. package/dist/campaign.enum-IHLsfdik.js +21 -0
  68. package/dist/campaign.fn-B_P1MkRV.js +776 -0
  69. package/dist/collectible.enum-CUgSjO08.js +19 -0
  70. package/dist/collection.fn-CrfnNb41.js +26 -0
  71. package/dist/dto-jwO_sX9I.js +222 -0
  72. package/dist/effect--0g8PNyt.js +78 -0
  73. package/dist/email-addresses-HtsxvXw9.js +705 -0
  74. package/dist/export-CFEwMRmd.js +96 -0
  75. package/dist/feedme.ico +0 -0
  76. package/dist/helper-CCfb24PO.js +86 -0
  77. package/dist/index-B-AMMFfT.js +3419 -0
  78. package/dist/index-BR3UbZ0F.js +56 -0
  79. package/dist/index-BZEM0T2A.js +3 -0
  80. package/dist/index-Bflu4Rft.js +8884 -0
  81. package/dist/index-CR3f3BXQ.js +32456 -0
  82. package/dist/index-CZPcwcUo.js +54 -0
  83. package/dist/index-CkuPY85X.js +76 -0
  84. package/dist/index-CppLPpqB.js +30933 -0
  85. package/dist/index-CuvNtC_M.js +61 -0
  86. package/dist/index-DDYH-IEX.js +32 -0
  87. package/dist/index-DdZdHioZ.js +2423 -0
  88. package/dist/index-Dic_WcAL.js +31 -0
  89. package/dist/index-DpjYgKTN.js +124 -0
  90. package/dist/index-vh86FiIQ.js +10 -0
  91. package/dist/index-wzSeRJAd.js +36 -0
  92. package/dist/index.esm2017-CUnjzfU-.js +3069 -0
  93. package/dist/loading-CivgDw5C.js +215 -0
  94. package/dist/lodash-BSbv_9TG.js +3678 -0
  95. package/dist/membership-j2w1YUO-.js +235 -0
  96. package/dist/moment-D7p2TMB-.js +2583 -0
  97. package/dist/money-DL-x8hiT.js +15 -0
  98. package/dist/number-D1yoFGEr.js +12 -0
  99. package/dist/object-qECH92oz.js +26 -0
  100. package/dist/objectId-dwaoBfJX.js +7 -0
  101. package/dist/objectid-CHab6j3r.js +145 -0
  102. package/dist/plugins-P-V4XWmW.js +1817 -0
  103. package/dist/remy-D_Deb3ue.js +13 -0
  104. package/dist/reward-BqMlBQRu.js +36 -0
  105. package/dist/rule-CztsLdki.js +1951 -0
  106. package/dist/rule-builder-DANv7Rmz.js +102 -0
  107. package/dist/style.css +13 -0
  108. package/dist/template-Dbz3FhHK.js +188 -0
  109. package/dist/tier-BJDhpH6X.js +4 -0
  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/timezone-BgVqObBq.js +1151 -0
  115. package/dist/titles/type=diamond.png +0 -0
  116. package/dist/titles/type=drinks.png +0 -0
  117. package/dist/titles/type=food.png +0 -0
  118. package/dist/titles/type=heart.png +0 -0
  119. package/dist/titles/type=medal.png +0 -0
  120. package/dist/titles/type=spend.png +0 -0
  121. package/dist/titles/type=thank-you.png +0 -0
  122. package/dist/titles/type=thumbs-up.png +0 -0
  123. package/dist/titles/type=years.png +0 -0
  124. package/dist/trigger-CbriUibd.js +213 -0
  125. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  126. package/dist/type_drinks-D6jnpvwV.js +4 -0
  127. package/dist/usePagination-DtNK7W0U.js +223 -0
  128. package/dist/user-CVapqHfr.js +55 -0
  129. package/dist/vue-i18n-tpDAnnmD.js +2365 -0
  130. package/dist/xlsx-EewcN2uY.js +15491 -0
  131. package/dist/zod-D-wiCQRJ.js +91 -0
  132. package/package.json +3 -3
@@ -0,0 +1,226 @@
1
+ import { defineComponent as N, ref as F, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as g, Fragment as _, createVNode as i, unref as t, createElementVNode as n, withCtx as h, renderList as q, createBlock as C, resolveDynamicComponent as O, toDisplayString as L, createCommentVNode 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-P-V4XWmW.js";
5
+ import { u as X } from "./loading-CivgDw5C.js";
6
+ import { u as Y } from "./business-BFIwFfkq.js";
7
+ import { u as Z } from "./campaign-w9j4I4jn.js";
8
+ import { a as ee, b as S, c as V } from "./campaign-RuIwxc4y.js";
9
+ import { u as oe } from "./vue-i18n-tpDAnnmD.js";
10
+ import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-0DMFuBoG.js";
12
+ import { u as ne } from "./template-Dbz3FhHK.js";
13
+ import { c as y } from "./index-DpjYgKTN.js";
14
+ const re = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { key: 0 }, Ve = /* @__PURE__ */ N({
15
+ __name: "Credit",
16
+ setup(fe) {
17
+ const { t: r } = oe(), B = {
18
+ label: r("connect.program.common.actions.create", {
19
+ type: r("connect.program.credit.title").toLowerCase()
20
+ }),
21
+ value: "create",
22
+ isPrimary: !0,
23
+ prependIcon: "add"
24
+ }, I = ne("CREDIT", J()), D = Y(), u = Z(), { global: T, minor: w } = X, s = F({
25
+ searchKey: "",
26
+ location: []
27
+ });
28
+ function E(e) {
29
+ const o = s.value.location;
30
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((c) => {
31
+ var l;
32
+ return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(c);
33
+ }) : e.targetLocation.includes(o);
34
+ }
35
+ const p = j(
36
+ () => u.campaigns.credit.filter((e) => E(e))
37
+ ), R = [
38
+ {
39
+ header: r("connect.program.common.table.title"),
40
+ accessorFn: (e) => e.name
41
+ },
42
+ {
43
+ header: r("connect.program.common.table.status"),
44
+ accessorFn: (e) => ee(e),
45
+ cell(e) {
46
+ return S(e.row.original);
47
+ }
48
+ },
49
+ {
50
+ header: r("connect.program.common.table.summary"),
51
+ accessorFn: (e) => V(e)
52
+ },
53
+ {
54
+ header: r("connect.program.common.table.actions"),
55
+ cell(e) {
56
+ return M(Q.FmButton, {
57
+ variant: "tertiary",
58
+ icon: "delete",
59
+ iconColor: "neutral-gray-400",
60
+ onClick: (o) => {
61
+ o.stopPropagation(), v(e.row.original);
62
+ }
63
+ });
64
+ }
65
+ }
66
+ ], b = F();
67
+ async function v(e) {
68
+ await W.remove(
69
+ r("connect.program.common.remove.confirm", { name: e.name })
70
+ ) && await w(
71
+ async () => {
72
+ await y.delete(e._id), await u.read("CREDIT");
73
+ },
74
+ {
75
+ message: r("connect.program.common.remove.removing", { name: e.name }),
76
+ successMessage: r("connect.program.common.remove.removed", {
77
+ name: e.name
78
+ })
79
+ }
80
+ );
81
+ }
82
+ async function f(e) {
83
+ e ? await o() : I.open(async (c) => {
84
+ await o(c);
85
+ });
86
+ async function o(c) {
87
+ var l;
88
+ (l = b.value) == null || l.showSheet(
89
+ !0,
90
+ "CREDIT",
91
+ e ? await y.readById(e._id) : void 0,
92
+ c
93
+ );
94
+ }
95
+ }
96
+ async function K(e) {
97
+ await w(
98
+ async () => {
99
+ e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await u.read("CREDIT");
100
+ },
101
+ {
102
+ message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
103
+ successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
104
+ }
105
+ );
106
+ }
107
+ return H(async () => {
108
+ await T(async () => {
109
+ await u.read("CREDIT");
110
+ });
111
+ }), (e, o) => {
112
+ const c = m("FmPageHead"), l = m("FmSearch"), $ = m("FmTable"), x = m("FmButton"), P = m("FmListItem"), U = m("FmList"), A = m("FmCard");
113
+ return d(), g(_, null, [
114
+ i(c, {
115
+ title: t(r)("connect.program.credit.title"),
116
+ actions: t(p).length > 0 ? [B] : [],
117
+ "onClick:action": o[0] || (o[0] = () => f())
118
+ }, null, 8, ["title", "actions"]),
119
+ n("div", re, [
120
+ i(l, {
121
+ modelValue: t(s).searchKey,
122
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
123
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
124
+ placeholder: "search",
125
+ collapsible: ""
126
+ }, null, 8, ["modelValue"]),
127
+ t(u).campaigns.credit && t(u).campaigns.credit.length > 0 ? (d(), g(_, { key: 0 }, [
128
+ n("div", se, [
129
+ n("div", ie, [
130
+ i(te, {
131
+ label: `${t(r)("connect.common.location")}: `,
132
+ "right-icon": "keyboard_arrow_down",
133
+ modelValue: t(s).location,
134
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
135
+ icon: "storefront",
136
+ "show-item-label": !0,
137
+ items: t(D).locationOptions
138
+ }, null, 8, ["label", "modelValue", "items"])
139
+ ]),
140
+ i(l, {
141
+ modelValue: t(s).searchKey,
142
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
143
+ class: "xs:hidden sm:hidden",
144
+ placeholder: "search",
145
+ collapsible: ""
146
+ }, null, 8, ["modelValue"])
147
+ ]),
148
+ i($, {
149
+ class: "xs:hidden sm:hidden",
150
+ "row-data": t(p),
151
+ "column-defs": R,
152
+ "search-value": t(s).searchKey,
153
+ "column-filter": [],
154
+ onRowClick: o[4] || (o[4] = (a) => f(a.original)),
155
+ "hide-footer": t(p).length < 10
156
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
157
+ i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
158
+ default: h(() => [
159
+ (d(!0), g(_, null, q(t(p).filter(
160
+ (a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
161
+ ), (a) => (d(), C(P, {
162
+ key: a._id.toString(),
163
+ onClick: (k) => f(a),
164
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
165
+ }, {
166
+ default: h(() => [
167
+ n("div", le, [
168
+ n("div", ce, [
169
+ (d(), C(O(t(S)(a))))
170
+ ]),
171
+ n("div", me, [
172
+ n("div", de, L(a.name), 1),
173
+ n("div", ue, L(t(V)(a)), 1)
174
+ ])
175
+ ]),
176
+ i(x, {
177
+ icon: "delete",
178
+ "icon-color": "neutral-gray-400",
179
+ variant: "tertiary",
180
+ onClick: (k) => (k.stopPropagation(), v(a))
181
+ }, null, 8, ["onClick"])
182
+ ]),
183
+ _: 2
184
+ }, 1032, ["onClick"]))), 128))
185
+ ]),
186
+ _: 1
187
+ }),
188
+ t(p).length == 0 ? (d(), g("div", pe, [...o[6] || (o[6] = [
189
+ n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
190
+ ])])) : z("", !0)
191
+ ], 64)) : (d(), C(A, {
192
+ key: 1,
193
+ variant: "outlined",
194
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
195
+ }, {
196
+ default: h(() => [
197
+ o[7] || (o[7] = n("img", {
198
+ src: G,
199
+ class: "aspect-square w-[150px]"
200
+ }, null, -1)),
201
+ o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
202
+ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
203
+ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
204
+ ], -1)),
205
+ i(x, {
206
+ variant: "primary",
207
+ label: "Create credit program",
208
+ icon: "add",
209
+ onClick: o[5] || (o[5] = (a) => f())
210
+ })
211
+ ]),
212
+ _: 1
213
+ })),
214
+ i(ae, {
215
+ ref_key: "sheetRef",
216
+ ref: b,
217
+ "onSubmit:modelValue": K
218
+ }, null, 512)
219
+ ])
220
+ ], 64);
221
+ };
222
+ }
223
+ });
224
+ export {
225
+ Ve as default
226
+ };
@@ -0,0 +1,128 @@
1
+ import { defineComponent as j, ref as B, computed as N, resolveComponent as i, openBlock as n, createBlock as g, unref as r, withCtx as v, renderSlot as p, createElementBlock as f, toDisplayString as h, createCommentVNode as F, createVNode as C, normalizeClass as V, createElementVNode as q, Fragment as A, renderList as E } from "vue";
2
+ const M = {
3
+ key: 0,
4
+ class: "fm-typo-en-body-lg-400 mb-4"
5
+ }, O = {
6
+ key: 1,
7
+ class: "fm-typo-en-body-lg-400"
8
+ }, D = { class: "rounded-md bg-white shadow-md max-h-[300px] overflow-y-scroll pl-4 py-12" }, G = /* @__PURE__ */ j({
9
+ __name: "CustomSelect",
10
+ props: {
11
+ label: {
12
+ type: String,
13
+ required: !1
14
+ },
15
+ placeholder: {
16
+ type: String,
17
+ required: !1
18
+ },
19
+ items: {
20
+ type: Object,
21
+ required: !0
22
+ },
23
+ modelValue: {
24
+ type: Object
25
+ },
26
+ zIndex: {
27
+ type: Number
28
+ },
29
+ multiselect: {
30
+ type: Boolean
31
+ }
32
+ },
33
+ emits: ["update:model-value"],
34
+ setup(e, { emit: w }) {
35
+ const u = e, s = w, d = B(!1), b = N(() => !u.multiselect || !u.modelValue ? !1 : u.items.every((m) => u.modelValue.includes(m.value))), I = () => {
36
+ u.multiselect && (b.value ? s("update:model-value", []) : s(
37
+ "update:model-value",
38
+ u.items.map((m) => m.value)
39
+ ));
40
+ };
41
+ return (m, c) => {
42
+ const S = i("FmIcon"), z = i("FmField"), k = i("FmMenuItem"), P = i("FmPopover");
43
+ return n(), g(P, {
44
+ "show-popover": r(d),
45
+ onPopoverChanged: c[1] || (c[1] = (l) => d.value = l),
46
+ "z-index": e.zIndex
47
+ }, {
48
+ "popover-button": v(() => [
49
+ p(m.$slots, "popover-button", {}, () => [
50
+ e.label ? (n(), f("div", M, h(e.label), 1)) : F("", !0),
51
+ C(z, null, {
52
+ append: v(() => [
53
+ p(m.$slots, "append"),
54
+ C(S, {
55
+ name: r(d) ? "expand_less" : "expand_more",
56
+ size: "md",
57
+ color: "black"
58
+ }, null, 8, ["name"])
59
+ ]),
60
+ default: v(() => {
61
+ var l;
62
+ return [
63
+ e.multiselect ? (n(), f("div", O, h((() => {
64
+ const t = e.items.filter(
65
+ (o) => {
66
+ var a;
67
+ return (a = e.modelValue) == null ? void 0 : a.includes(o.value);
68
+ }
69
+ );
70
+ return t.length <= 5 ? t.map((o) => o.label).join(", ") : t.slice(0, 5).map((o) => o.label).join(", ") + ` +${t.length - 5} selected`;
71
+ })()), 1)) : (n(), f("div", {
72
+ key: 0,
73
+ class: V(["fm-typo-en-body-lg-400", {
74
+ "text-fm-color-typo-secondary": !e.items.find(
75
+ (t) => t.value == e.modelValue
76
+ )
77
+ }])
78
+ }, h(((l = e.items.find((t) => t.value == e.modelValue)) == null ? void 0 : l.label) || e.placeholder), 3))
79
+ ];
80
+ }),
81
+ _: 3
82
+ })
83
+ ])
84
+ ]),
85
+ default: v(() => [
86
+ q("div", D, [
87
+ e.multiselect ? (n(), g(k, {
88
+ key: 0,
89
+ class: V(`${r(b) ? "bg-fm-color-system-warning-100" : ""}`),
90
+ "has-checkbox": !0,
91
+ "model-value": r(b),
92
+ label: "All",
93
+ onClick: c[0] || (c[0] = (l) => {
94
+ l.stopPropagation(), I();
95
+ })
96
+ }, null, 8, ["class", "model-value"])) : F("", !0),
97
+ (n(!0), f(A, null, E(e.items, (l) => {
98
+ var t, o;
99
+ return n(), g(k, {
100
+ class: V(`${e.multiselect ? (t = e.modelValue) != null && t.some((a) => a == l.value) ? "bg-fm-color-system-warning-100" : "" : e.modelValue == l.value}`),
101
+ "has-checkbox": e.multiselect,
102
+ key: l.value,
103
+ "model-value": e.multiselect ? (o = e.modelValue) == null ? void 0 : o.some((a) => a == l.value) : e.modelValue == l.value,
104
+ label: l.label,
105
+ onClick: (a) => {
106
+ var x;
107
+ if (a.stopPropagation(), !e.multiselect)
108
+ d.value = !1, s("update:model-value", l.value);
109
+ else {
110
+ const $ = (x = e.modelValue) == null ? void 0 : x.some((y) => y == l.value);
111
+ s(
112
+ "update:model-value",
113
+ $ ? (e.modelValue ?? []).filter((y) => y !== l.value) : [...e.modelValue ?? [], l.value]
114
+ );
115
+ }
116
+ }
117
+ }, null, 8, ["class", "has-checkbox", "model-value", "label", "onClick"]);
118
+ }), 128))
119
+ ])
120
+ ]),
121
+ _: 3
122
+ }, 8, ["show-popover", "z-index"]);
123
+ };
124
+ }
125
+ });
126
+ export {
127
+ G as _
128
+ };
@@ -0,0 +1,58 @@
1
+ import { defineComponent as f, mergeModels as l, useModel as g, computed as u, onMounted as _, watch as R, resolveComponent as m, openBlock as h, createBlock as V, withCtx as b, createVNode as k, unref as y } from "vue";
2
+ import { h as t } from "./moment-D7p2TMB-.js";
3
+ const a = "YYYY-MM-DD", F = /* @__PURE__ */ f({
4
+ __name: "DateRangeChip",
5
+ props: /* @__PURE__ */ l({
6
+ modelValue: {
7
+ type: Object,
8
+ required: !0
9
+ }
10
+ }, {
11
+ dateRange: {
12
+ type: Object,
13
+ default: () => ({
14
+ startDate: t().subtract(7, "day").format(a),
15
+ endDate: t().endOf("day").format(a)
16
+ })
17
+ },
18
+ dateRangeModifiers: {}
19
+ }),
20
+ emits: /* @__PURE__ */ l(["update:model-value"], ["update:dateRange"]),
21
+ setup(r, { emit: s }) {
22
+ const o = r, c = s, e = g(r, "dateRange"), i = u(() => e.value ? `${n.value.startDate ?? "Start"} - ${n.value.endDate ?? "End"}` : "No dates selected."), n = u(() => ({
23
+ startDate: e.value.startDate ? t(e.value.startDate).format(a) : void 0,
24
+ endDate: e.value.endDate ? t(e.value.endDate).format(a) : void 0
25
+ }));
26
+ return _(() => {
27
+ e.value = {
28
+ startDate: o.modelValue.startDate ? t(o.modelValue.startDate).format(a) : void 0,
29
+ endDate: o.modelValue.endDate ? t(o.modelValue.endDate).format(a) : void 0
30
+ };
31
+ }), R(
32
+ () => e.value,
33
+ () => {
34
+ c("update:model-value", n.value);
35
+ }
36
+ ), (C, d) => {
37
+ const p = m("FmChip"), D = m("FmDateRangePicker");
38
+ return h(), V(D, {
39
+ modelValue: e.value,
40
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => e.value = v),
41
+ "show-predefined-range": ""
42
+ }, {
43
+ "trigger-button": b(() => [
44
+ k(p, {
45
+ label: y(i),
46
+ icon: "calendar_month",
47
+ "right-icon": "keyboard_arrow_down",
48
+ class: "text-fm-color-neutral-gray-400 cursor-pointer"
49
+ }, null, 8, ["label"])
50
+ ]),
51
+ _: 1
52
+ }, 8, ["modelValue"]);
53
+ };
54
+ }
55
+ });
56
+ export {
57
+ F as _
58
+ };