@feedmepos/mf-connect 0.1.56-prod → 0.1.58-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-XUI4rZyP.js +0 -427
  3. package/dist/App-vv5J1Ebe.js +0 -4630
  4. package/dist/Bin-D4V36uXK.js +0 -166
  5. package/dist/Broadcast-BvW27G77.js +0 -233
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2MC6Gy1.js +0 -121
  7. package/dist/Card-C7xLv1Fb.js +0 -911
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-BKfS-bGL.js +0 -458
  10. package/dist/Credit-CGmWQq0t.js +0 -228
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C2p6_R01.js +0 -2194
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BGlaqjWp.js +0 -348
  14. package/dist/Experience-CT7Yab3W.js +0 -229
  15. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  17. package/dist/Game-DtW4rtYQ.js +0 -284
  18. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
  19. package/dist/Index-Bs5ob9Km.js +0 -259
  20. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  21. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  22. package/dist/MainLayout-B1aJoR95.js +0 -41
  23. package/dist/Marketing-tA350rTd.js +0 -319
  24. package/dist/Member-CZoTXgKz.js +0 -279
  25. package/dist/MemberList-ChwyPtmW.js +0 -1607
  26. package/dist/MemberOverview-wL_ailso.js +0 -58
  27. package/dist/MemberTransactions-Cchtvxm9.js +0 -45
  28. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bo0EnHBx.js +0 -60553
  29. package/dist/Mission-DDpelLqN.js +0 -302
  30. package/dist/Overview-Da3ewBat.js +0 -1079
  31. package/dist/Point-CggE8VUk.js +0 -232
  32. package/dist/Promotion-DxvbZhgQ.js +0 -289
  33. package/dist/Queue-fIxlHrMd.js +0 -260
  34. package/dist/Record-Bv90_VUG.js +0 -341
  35. package/dist/Reward-BWYLk7aC.js +0 -442
  36. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CjYEtENe.js +0 -150
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ak1R8Y2a.js +0 -1763
  38. package/dist/Segment-_VGdBy3a.js +0 -882
  39. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-Dm4hF1n1.js +0 -181
  40. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DWDMhmNr.js +0 -188
  41. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Czy25PII.js +0 -147
  42. package/dist/Setting-7fTz1dJa.js +0 -1936
  43. package/dist/Store-TQHKR__B.js +0 -1842
  44. package/dist/StoreRewards-DZy1ZwiI.js +0 -423
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cae25Vr6.js +0 -995
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BVVEzpyP.js +0 -139
  47. package/dist/Tier-CK53vdbl.js +0 -895
  48. package/dist/Title-CGWPq_FF.js +0 -566
  49. package/dist/Transaction-DjJ03PfX.js +0 -39
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DNSdyxrF.js +0 -130
  51. package/dist/Voucher-D6RuJjNn.js +0 -384
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-D4iCOq3V.js +0 -419
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BFz8RvY_.js +0 -56
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  56. package/dist/app-BLlAxdVk.js +0 -57962
  57. package/dist/app-_rmIFJ8M.js +0 -7057
  58. package/dist/app-wDQR6dpb.js +0 -39
  59. package/dist/app.js +0 -6
  60. package/dist/business-gJ9fK_2b.js +0 -82
  61. package/dist/campaign-BfznfcHc.js +0 -94
  62. package/dist/campaign-C_Yq-ffV.js +0 -1810
  63. package/dist/campaign-CpzFl8Vr.js +0 -4
  64. package/dist/campaign.enum-Dsbpz7BO.js +0 -20
  65. package/dist/campaign.fn-C6vKb-lp.js +0 -758
  66. package/dist/collectible.enum-DNpj_oyC.js +0 -19
  67. package/dist/collection.fn-Cgo0sPL2.js +0 -26
  68. package/dist/dto-CaSQ4Pp9.js +0 -216
  69. package/dist/effect-DuH74x-N.js +0 -78
  70. package/dist/email-addresses-DXr-Qqt9.js +0 -705
  71. package/dist/export-tMPFlVV0.js +0 -97
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-CJTseW10.js +0 -71
  74. package/dist/index-8RETBwYy.js +0 -8861
  75. package/dist/index-B57kxqv7.js +0 -3
  76. package/dist/index-BNUuy_4R.js +0 -44
  77. package/dist/index-BSJ-4JYy.js +0 -146
  78. package/dist/index-BTpBLMHl.js +0 -3070
  79. package/dist/index-C6Iyn1Q6.js +0 -54
  80. package/dist/index-CWI06v9e.js +0 -31
  81. package/dist/index-CdnKwJuz.js +0 -30076
  82. package/dist/index-Cr_9Bqa1.js +0 -121
  83. package/dist/index-CuvNtC_M.js +0 -61
  84. package/dist/index-DTyfvK3U.js +0 -2130
  85. package/dist/index-Dn0gJspN.js +0 -32269
  86. package/dist/index-IHKkNyxb.js +0 -38
  87. package/dist/index-J3TDCX-5.js +0 -76
  88. package/dist/index-V9kRRAB1.js +0 -32
  89. package/dist/index-vh86FiIQ.js +0 -10
  90. package/dist/index.esm2017-P2nmohVw.js +0 -3069
  91. package/dist/loading-D5ZAAdUU.js +0 -71
  92. package/dist/lodash-B5I3zXaY.js +0 -3678
  93. package/dist/membership-xl9aKOQ_.js +0 -235
  94. package/dist/moment-D7p2TMB-.js +0 -2583
  95. package/dist/money-CIHN3jJZ.js +0 -15
  96. package/dist/number-BN4-Jdog.js +0 -12
  97. package/dist/object-qECH92oz.js +0 -26
  98. package/dist/objectId-dwaoBfJX.js +0 -7
  99. package/dist/objectid-Dh6RD0Tk.js +0 -145
  100. package/dist/plugins-CJlgzIv2.js +0 -208
  101. package/dist/reward-C8mezXzs.js +0 -36
  102. package/dist/rule-9VRIJFHZ.js +0 -1951
  103. package/dist/rule-builder-CZUgrDAw.js +0 -102
  104. package/dist/style.css +0 -4
  105. package/dist/template-aPJnNGLi.js +0 -190
  106. package/dist/tier-BJDhpH6X.js +0 -4
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-CpvXaiqq.js +0 -1151
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-BfrtcBd-.js +0 -144
  122. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  123. package/dist/type_drinks-D6jnpvwV.js +0 -4
  124. package/dist/usePagination-Ds-cuHop.js +0 -223
  125. package/dist/user-Bt1C0yV5.js +0 -54
  126. package/dist/vue-i18n-OdHHHpEE.js +0 -2365
  127. package/dist/xlsx-BgB0dYfE.js +0 -15491
  128. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,1763 +0,0 @@
1
- import { defineComponent as A, computed as I, resolveComponent as V, openBlock as n, createElementBlock as F, createElementVNode as Y, createVNode as b, unref as e, createTextVNode as te, toDisplayString as W, withCtx as q, onMounted as z, createBlock as E, createCommentVNode as M, ref as $, Fragment as h, renderList as N, normalizeClass as H, watch as de, resolveDynamicComponent as ae, onBeforeMount as ue, isRef as pe, createSlots as se } from "vue";
2
- import { a as ye, C as ce, b as ve, c as be, d as fe } from "./index-8RETBwYy.js";
3
- import { R as C, a as ge } from "./rule-builder-CZUgrDAw.js";
4
- import { useDialog as le, useDialogChild as ie, useSnackbar as ke } from "@feedmepos/ui-library";
5
- import { a as Ee, R as x, S as Ve, C as L, W as Te, T as re, O as ne } from "./rule-9VRIJFHZ.js";
6
- import { p as Se } from "./plugins-CJlgzIv2.js";
7
- import { h as J } from "./moment-D7p2TMB-.js";
8
- import { z as Fe } from "./app-_rmIFJ8M.js";
9
- import { u as Q } from "./membership-xl9aKOQ_.js";
10
- import { u as X } from "./business-gJ9fK_2b.js";
11
- import "./index-Dn0gJspN.js";
12
- import { _ as D } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
13
- import { c as me } from "./object-qECH92oz.js";
14
- import { Z } from "./zod-Bg2FbC-D.js";
15
- import { _ as Ue } from "./SelectItems.vue_vue_type_script_setup_true_lang-Dm4hF1n1.js";
16
- import "./index-BTpBLMHl.js";
17
- import "./index-DTyfvK3U.js";
18
- import "./index-IHKkNyxb.js";
19
- import "./index-C6Iyn1Q6.js";
20
- const xe = { class: "flex items-center justify-between" }, Re = { class: "flex items-center gap-8 xs:flex-wrap" }, Ye = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Ce = /* @__PURE__ */ A({
21
- __name: "RuleEntry",
22
- props: {
23
- modelValue: {
24
- type: Object,
25
- required: !0
26
- }
27
- },
28
- emits: ["edit", "remove"],
29
- setup(l, { emit: R }) {
30
- const y = l, s = I(() => {
31
- const [u, c] = Object.entries(y.modelValue.conditions)[0];
32
- return {
33
- negated: y.modelValue.negated == !0,
34
- property: y.modelValue.property,
35
- operator: u,
36
- equator: c
37
- };
38
- }), o = R, m = I(
39
- () => Ee(
40
- s.value.property,
41
- s.value.operator,
42
- s.value.equator,
43
- s.value.negated
44
- )
45
- );
46
- async function t(u) {
47
- u.stopPropagation(), await Se.remove("Are you sure you want to remove this rule?") && o("remove", y.modelValue);
48
- }
49
- return (u, c) => {
50
- var v;
51
- const d = V("FmChip"), p = V("FmTooltip"), f = V("FmIcon");
52
- return n(), F("div", xe, [
53
- Y("div", Re, [
54
- b(d, {
55
- label: (v = e(ye).find((k) => k.property === y.modelValue.property)) == null ? void 0 : v.name,
56
- class: "!text-fm-color-typo-info !bg-fm-color-system-info-100"
57
- }, null, 8, ["label"]),
58
- c[1] || (c[1] = Y("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1)),
59
- Y("div", {
60
- onClick: c[0] || (c[0] = (k) => o("edit", y.modelValue)),
61
- class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 text-fm-color-typo-primary !bg-transparent border-dashed border-2 fm-typo-en-body-md-600 cursor-pointer"
62
- }, [
63
- te(W(e(m)[0]) + " ", 1),
64
- b(p, {
65
- "z-index": 1e3,
66
- content: e(m)[1]
67
- }, {
68
- default: q(() => [
69
- Y("div", Ye, W(e(m)[1]), 1)
70
- ]),
71
- _: 1
72
- }, 8, ["content"])
73
- ])
74
- ]),
75
- b(f, {
76
- name: "close",
77
- size: "md",
78
- class: "cursor-pointer hover:bg-neutral-300 rounded-lg",
79
- onClick: t
80
- })
81
- ]);
82
- };
83
- }
84
- });
85
- Fe.enum([
86
- "MIN_SPEND",
87
- "SPECIFIC_DATE",
88
- "SPECIFIC_TIMERANGE",
89
- "WEEKLY",
90
- "MONTHLY",
91
- "BIRTHDAY",
92
- "TIER",
93
- "TITLE",
94
- "LAST_X_DAY",
95
- "CUSTOM"
96
- ]);
97
- const De = [
98
- {
99
- type: "MIN_SPEND",
100
- name: "Minimum spend",
101
- for: ["bill"],
102
- rules: []
103
- },
104
- {
105
- type: "SPECIFIC_DATE",
106
- name: "Specific date",
107
- for: ["trigger"],
108
- rules: []
109
- },
110
- {
111
- type: "SPECIFIC_TIMERANGE",
112
- name: "Specific time range",
113
- for: ["trigger"],
114
- rules: []
115
- },
116
- {
117
- type: "WEEKLY",
118
- name: "Weekly",
119
- for: ["trigger"],
120
- rules: [
121
- {
122
- property: "trigger.date",
123
- operator: "_rrule",
124
- equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
125
- }
126
- ]
127
- },
128
- {
129
- type: "MONTHLY",
130
- name: "Monthly",
131
- for: ["trigger"],
132
- rules: [
133
- {
134
- property: "trigger.date",
135
- operator: "_rrule",
136
- equator: "RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
137
- }
138
- ]
139
- },
140
- {
141
- type: "BIRTHDAY",
142
- name: "Birthday",
143
- for: ["user"],
144
- rules: [
145
- {
146
- property: "user.birthday",
147
- operator: "_isRange",
148
- equator: {
149
- op: "this",
150
- unit: "day",
151
- ignoreYear: !0
152
- }
153
- }
154
- ]
155
- },
156
- {
157
- type: "BIRTHDAY",
158
- name: "Birthday Week",
159
- for: ["user"],
160
- rules: [
161
- {
162
- property: "user.birthday",
163
- operator: "_isRange",
164
- equator: {
165
- op: "this",
166
- unit: "week",
167
- ignoreYear: !0
168
- }
169
- }
170
- ]
171
- },
172
- {
173
- type: "BIRTHDAY",
174
- name: "Birthday Month",
175
- for: ["user"],
176
- rules: [
177
- {
178
- property: "user.birthday",
179
- operator: "_isRange",
180
- equator: {
181
- op: "this",
182
- unit: "month",
183
- ignoreYear: !0
184
- }
185
- }
186
- ]
187
- },
188
- {
189
- type: "BIRTHDAY",
190
- name: "N day before birthday",
191
- for: ["user"],
192
- rules: [
193
- {
194
- property: "user.birthday",
195
- operator: "_isDay",
196
- equator: {
197
- op: "before",
198
- x: 1,
199
- ignoreYear: !0
200
- }
201
- }
202
- ]
203
- },
204
- {
205
- type: "TIER",
206
- name: "Specific tier",
207
- for: ["user"],
208
- rules: [
209
- {
210
- property: "user.tier",
211
- operator: "_equal",
212
- equator: 1
213
- }
214
- ]
215
- },
216
- {
217
- type: "TITLE",
218
- name: "Specific title",
219
- for: ["user"],
220
- rules: [
221
- {
222
- property: "user.titles",
223
- operator: "_hasAny",
224
- equator: []
225
- }
226
- ]
227
- },
228
- {
229
- type: "LAST_X_DAY",
230
- name: "Last visit in X days",
231
- for: ["user"],
232
- rules: [
233
- {
234
- property: "user.stats.lastVisit",
235
- operator: "_isRange",
236
- equator: {
237
- op: "last",
238
- unit: "day",
239
- ignoreYear: !0,
240
- x: 0
241
- }
242
- }
243
- ],
244
- premium: !0
245
- },
246
- {
247
- type: "CUSTOM",
248
- name: "Weekday special",
249
- for: ["trigger"],
250
- rules: [
251
- {
252
- property: "trigger.date",
253
- operator: "_rrule",
254
- equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=MO,TU,WE,TH,FR;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
255
- }
256
- ]
257
- },
258
- {
259
- type: "CUSTOM",
260
- name: "Weekend special",
261
- for: ["trigger"],
262
- rules: [
263
- {
264
- property: "trigger.date",
265
- operator: "_rrule",
266
- equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU,SA;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
267
- }
268
- ]
269
- },
270
- {
271
- type: "CUSTOM",
272
- name: "Happy hour",
273
- for: ["trigger"],
274
- rules: [
275
- {
276
- property: "trigger.time",
277
- operator: "_isBetweenTime",
278
- equator: [
279
- {
280
- start: "21:00",
281
- end: "23:59"
282
- }
283
- ]
284
- }
285
- ]
286
- },
287
- {
288
- type: "CUSTOM",
289
- name: "Mother's day special",
290
- for: ["trigger"],
291
- rules: [
292
- {
293
- property: "trigger.date",
294
- operator: "_rrule",
295
- equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+2SU;BYMONTH=5;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
296
- }
297
- ]
298
- },
299
- {
300
- type: "CUSTOM",
301
- name: "Father's day special",
302
- for: ["trigger"],
303
- rules: [
304
- {
305
- property: "trigger.date",
306
- operator: "_rrule",
307
- equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+3SU;BYMONTH=6;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
308
- }
309
- ]
310
- },
311
- {
312
- type: "CUSTOM",
313
- name: "Christmas",
314
- for: ["trigger"],
315
- rules: [
316
- {
317
- property: "trigger.date",
318
- operator: "_rrule",
319
- equator: "RRULE:FREQ=YEARLY;WKST=SU;BYMONTH=12;BYMONTHDAY=25;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
320
- }
321
- ]
322
- },
323
- {
324
- type: "CUSTOM",
325
- name: "Feedback rating",
326
- for: ["feedback"],
327
- rules: [
328
- {
329
- property: "feedback.rating",
330
- operator: "_lessThanOrEqual",
331
- equator: 5
332
- }
333
- ]
334
- },
335
- {
336
- type: "CUSTOM",
337
- name: "Custom",
338
- for: ["trigger", "user", "bill", "feedback"],
339
- rules: [
340
- {
341
- property: "trigger.date",
342
- operator: "_isOnDate",
343
- equator: J().format("YYYY-MM-DD")
344
- }
345
- ]
346
- }
347
- ], Oe = { class: "flex flex-nowrap gap-x-4 items-center" }, we = /* @__PURE__ */ A({
348
- __name: "IsDayInput",
349
- props: {
350
- modelValue: {
351
- type: Object
352
- }
353
- },
354
- emits: ["update:model-value"],
355
- setup(l, { emit: R }) {
356
- const y = l, s = R;
357
- z(() => {
358
- y.modelValue || s("update:model-value", {
359
- op: "before",
360
- x: 1
361
- });
362
- });
363
- function o(m) {
364
- const t = me(
365
- y.modelValue ?? {
366
- op: "before",
367
- x: 1
368
- }
369
- );
370
- s("update:model-value", {
371
- ...t,
372
- ...m
373
- });
374
- }
375
- return (m, t) => {
376
- var c, d, p;
377
- const u = V("FmStepperField");
378
- return n(), F("div", Oe, [
379
- b(u, {
380
- class: "w-1/3",
381
- "model-value": ((c = l.modelValue) == null ? void 0 : c.x) ?? null,
382
- max: 365,
383
- "show-steppers": !1,
384
- "append-text": "days",
385
- "onUpdate:modelValue": t[0] || (t[0] = (f) => o({ x: f }))
386
- }, null, 8, ["model-value"]),
387
- b(D, {
388
- "model-value": ((d = l.modelValue) == null ? void 0 : d.op) ?? void 0,
389
- items: [
390
- { label: "before", value: "before" },
391
- { label: "after", value: "after" }
392
- ],
393
- "onUpdate:modelValue": t[1] || (t[1] = (f) => o({ op: f }))
394
- }, null, 8, ["model-value"]),
395
- b(D, {
396
- "model-value": ((p = l.modelValue) == null ? void 0 : p.ignoreYear) ?? !1,
397
- items: [
398
- { label: "same year", value: !1 },
399
- { label: "ignore year", value: !0 }
400
- ],
401
- required: !0,
402
- "onUpdate:modelValue": t[2] || (t[2] = (f) => o({ ignoreYear: f == !0 }))
403
- }, null, 8, ["model-value"])
404
- ]);
405
- };
406
- }
407
- }), he = { class: "grid grid-cols-4 gap-x-4 items-center" }, qe = /* @__PURE__ */ A({
408
- __name: "IsRangeInput",
409
- props: {
410
- modelValue: {
411
- type: Object,
412
- default: () => ({
413
- op: "this",
414
- unit: "day",
415
- ignoreYear: !0
416
- })
417
- }
418
- },
419
- emits: ["update:model-value"],
420
- setup(l, { emit: R }) {
421
- const y = l, s = R;
422
- z(() => {
423
- y.modelValue || s("update:model-value", {
424
- op: "this",
425
- unit: "day",
426
- ignoreYear: !0
427
- });
428
- });
429
- const o = [
430
- { label: "day", value: "day" },
431
- { label: "week", value: "week" },
432
- { label: "month", value: "month" },
433
- { label: "quarter", value: "quarter" },
434
- { label: "year", value: "year" }
435
- ], m = [
436
- {
437
- label: "this",
438
- value: "this"
439
- },
440
- {
441
- label: "last",
442
- value: "last"
443
- },
444
- {
445
- label: "next",
446
- value: "next"
447
- }
448
- ];
449
- return (t, u) => {
450
- var d, p, f, v, k;
451
- const c = V("FmStepperField");
452
- return n(), F("div", he, [
453
- b(D, {
454
- "model-value": (d = l.modelValue) == null ? void 0 : d.op,
455
- label: "",
456
- items: m,
457
- required: !0,
458
- "onUpdate:modelValue": u[0] || (u[0] = (i) => s("update:model-value", { op: i, unit: "day", ignoreYear: !1 }))
459
- }, null, 8, ["model-value"]),
460
- ((p = l.modelValue) == null ? void 0 : p.op) != "this" ? (n(), E(c, {
461
- key: 0,
462
- "model-value": ((f = l.modelValue) == null ? void 0 : f.x) || 0,
463
- max: 365,
464
- "show-steppers": !1,
465
- "onUpdate:modelValue": u[1] || (u[1] = (i) => s("update:model-value", {
466
- op: l.modelValue.op,
467
- unit: l.modelValue.unit,
468
- ignoreYear: l.modelValue.ignoreYear == !0,
469
- x: i
470
- }))
471
- }, null, 8, ["model-value"])) : M("", !0),
472
- b(D, {
473
- "model-value": (v = l.modelValue) == null ? void 0 : v.unit,
474
- label: "",
475
- items: o,
476
- required: !0,
477
- "onUpdate:modelValue": u[2] || (u[2] = (i) => s("update:model-value", { ...y.modelValue, unit: i }))
478
- }, null, 8, ["model-value"]),
479
- b(D, {
480
- label: "",
481
- "model-value": (k = l.modelValue) == null ? void 0 : k.ignoreYear,
482
- items: [
483
- { label: "same", value: !1 },
484
- { label: "ignore", value: !0 }
485
- ],
486
- required: !0,
487
- "onUpdate:modelValue": u[3] || (u[3] = (i) => s("update:model-value", {
488
- ...y.modelValue,
489
- ignoreYear: i == !0
490
- }))
491
- }, null, 8, ["model-value"])
492
- ]);
493
- };
494
- }
495
- }), Be = { class: "space-y-8" }, Me = { class: "text-fm-color-primary rounded-md border-dashed border-2 p-8" }, Ie = {
496
- key: 0,
497
- class: "flex items-center gap-8"
498
- }, Ae = { class: "flex gap-4" }, Ne = {
499
- key: 0,
500
- class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
501
- }, Pe = ["onClick"], $e = {
502
- key: 1,
503
- class: "flex items-center gap-8"
504
- }, Le = { class: "flex gap-4 xs:gap-[2px]" }, He = { class: "grid grid-cols-6 gap-8" }, We = {
505
- key: 0,
506
- class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
507
- }, je = ["onClick"], Ke = {
508
- key: 1,
509
- class: "grid grid-cols-2 items-center gap-8"
510
- }, _e = { class: "flex gap-4" }, Ge = {
511
- key: 4,
512
- class: "flex items-center justify-end gap-8"
513
- }, ee = /* @__PURE__ */ A({
514
- __name: "RruleInput",
515
- props: {
516
- modelValue: {
517
- type: String
518
- },
519
- startDate: {
520
- type: Object
521
- },
522
- applyButton: {
523
- type: Boolean
524
- },
525
- fixedFrequency: {
526
- type: Boolean
527
- }
528
- },
529
- emits: ["update:model-value", "cancel"],
530
- setup(l, { emit: R }) {
531
- const y = l, s = R, o = $(
532
- y.modelValue ? x.fromString(y.modelValue) : new x({
533
- dtstart: y.startDate,
534
- freq: x.DAILY,
535
- wkst: x.SU,
536
- interval: 1,
537
- byhour: 0,
538
- byminute: 0,
539
- bysecond: 0
540
- })
541
- );
542
- function m(t) {
543
- var u;
544
- if ("freq" in t)
545
- switch (t.freq) {
546
- case x.WEEKLY:
547
- o.value = new x({
548
- dtstart: y.startDate,
549
- freq: t.freq,
550
- interval: 1,
551
- byhour: 0,
552
- byminute: 0,
553
- bysecond: 0,
554
- wkst: x.SU,
555
- byweekday: [x.MO]
556
- });
557
- break;
558
- case x.MONTHLY:
559
- o.value = new x({
560
- dtstart: y.startDate,
561
- freq: t.freq,
562
- interval: 1,
563
- byhour: 0,
564
- byminute: 0,
565
- bysecond: 0,
566
- bymonthday: [(/* @__PURE__ */ new Date()).getDate()],
567
- wkst: x.SU
568
- });
569
- break;
570
- case x.YEARLY:
571
- o.value = new x({
572
- dtstart: y.startDate,
573
- freq: t.freq,
574
- interval: 1,
575
- byhour: 0,
576
- byminute: 0,
577
- bysecond: 0,
578
- wkst: x.SU,
579
- bymonth: [(/* @__PURE__ */ new Date()).getMonth() + 1],
580
- bymonthday: [(/* @__PURE__ */ new Date()).getDate()]
581
- });
582
- break;
583
- default:
584
- o.value = new x({
585
- dtstart: y.startDate,
586
- freq: t.freq,
587
- interval: 1,
588
- byhour: 0,
589
- byminute: 0,
590
- bysecond: 0,
591
- wkst: x.SU
592
- });
593
- }
594
- t.interval && t.interval > 0 && (o.value = new x({
595
- ...o.value.origOptions,
596
- dtstart: y.startDate,
597
- interval: t.interval
598
- })), "byweekday" in t && t.byweekday && Array.isArray(t.byweekday) && t.byweekday.length > 0 && (o.value.options.bymonthday.length > 0 && o.value.options.freq == x.MONTHLY && (o.value.options.bymonthday = []), o.value = new x({
599
- ...o.value.origOptions,
600
- dtstart: y.startDate,
601
- bymonthday: [],
602
- byweekday: t.byweekday
603
- })), "bysetpos" in t && t.bysetpos != null && (o.value = new x({
604
- ...o.value.origOptions,
605
- dtstart: y.startDate,
606
- bymonthday: [],
607
- bysetpos: t.bysetpos,
608
- byweekday: ((u = o.value.options.byweekday) == null ? void 0 : u.length) > 0 ? o.value.options.byweekday : [6]
609
- })), "bymonthday" in t && t.bymonthday && Array.isArray(t.bymonthday) && t.bymonthday.length > 0 && (o.value = new x({
610
- ...o.value.origOptions,
611
- dtstart: y.startDate,
612
- bysetpos: [],
613
- byweekday: [],
614
- bymonthday: t.bymonthday
615
- })), "bymonth" in t && t.bymonth && Array.isArray(t.bymonth) && t.bymonth.length > 0 && (o.value = new x({
616
- ...o.value.origOptions,
617
- dtstart: y.startDate,
618
- bysetpos: [],
619
- bymonth: t.bymonth
620
- })), "bynweekday" in t && t.bynweekday && (o.value = new x({
621
- ...o.value.origOptions,
622
- dtstart: y.startDate,
623
- bysetpos: [],
624
- byweekday: new Te(
625
- t.bynweekday[0][0],
626
- t.bynweekday[0][1]
627
- )
628
- })), y.applyButton || s("update:model-value", o.value.toString());
629
- }
630
- return z(() => {
631
- y.modelValue || s(
632
- "update:model-value",
633
- new x({
634
- dtstart: y.startDate,
635
- freq: x.DAILY,
636
- wkst: x.SU,
637
- interval: 1,
638
- byhour: 0,
639
- byminute: 0,
640
- bysecond: 0
641
- }).toString()
642
- );
643
- }), (t, u) => {
644
- var v, k, i;
645
- const c = V("FmStepperField"), d = V("FmChip"), p = V("FmButtonGroup"), f = V("FmButton");
646
- return n(), F("div", Be, [
647
- Y("div", Me, W(e(Ve)(e(o).options)), 1),
648
- l.fixedFrequency ? M("", !0) : (n(), F("div", Ie, [
649
- u[8] || (u[8] = Y("div", null, "Repeat every", -1)),
650
- b(c, {
651
- class: "w-[100px]",
652
- "model-value": e(o).options.interval,
653
- "onUpdate:modelValue": u[0] || (u[0] = (a) => m({ interval: a > 0 ? a : e(o).options.interval })),
654
- min: 1
655
- }, null, 8, ["model-value"]),
656
- b(D, {
657
- class: "w-min",
658
- items: e(L).frequencies,
659
- "model-value": e(o).origOptions.freq,
660
- "onUpdate:modelValue": u[1] || (u[1] = (a) => m({ freq: a }))
661
- }, null, 8, ["items", "model-value"])
662
- ])),
663
- e(o).options.freq === e(x).WEEKLY ? (n(), F(h, { key: 1 }, [
664
- u[9] || (u[9] = Y("div", null, "Repeat on", -1)),
665
- Y("div", Ae, [
666
- (n(!0), F(h, null, N(e(L).weekdays, (a) => {
667
- var S;
668
- return n(), E(d, {
669
- class: H(["cursor-pointer", `${(S = e(o).options.byweekday) != null && S.includes(a.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
670
- label: a.label[0],
671
- key: a.value,
672
- compact: !0,
673
- onClick: () => {
674
- var g, w;
675
- m({
676
- byweekday: (g = e(o).options.byweekday) != null && g.includes(a.value) ? ((w = e(o).options.byweekday) == null ? void 0 : w.filter((U) => U !== a.value)) || [] : [...e(o).options.byweekday || [], a.value]
677
- });
678
- }
679
- }, null, 8, ["class", "label", "onClick"]);
680
- }), 128))
681
- ])
682
- ], 64)) : M("", !0),
683
- e(o).options.freq == e(x).MONTHLY ? (n(), F(h, { key: 2 }, [
684
- b(p, {
685
- "model-value": e(o).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
686
- items: [
687
- {
688
- label: "Each"
689
- },
690
- {
691
- label: "On the"
692
- }
693
- ],
694
- "onUpdate:modelValue": u[2] || (u[2] = (a) => {
695
- a.label == "Each" ? m({ bymonthday: [1] }) : m({ bysetpos: 1 });
696
- })
697
- }, null, 8, ["model-value"]),
698
- e(o).options.bymonthday.length > 0 ? (n(), F("div", Ne, [
699
- (n(!0), F(h, null, N(e(L).dates, (a) => (n(), F("div", {
700
- key: a.value,
701
- class: H(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(o).options.bymonthday.includes(a.value) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${a.value == 31 ? "border-r" : ""}`]),
702
- onClick: (S) => m({
703
- bymonthday: e(o).options.bymonthday.includes(a.value) ? e(o).options.bymonthday.filter((g) => g !== a.value) : [...e(o).options.bymonthday, a.value]
704
- })
705
- }, W(a.value), 11, Pe))), 128))
706
- ])) : (n(), F("div", $e, [
707
- b(D, {
708
- items: e(L).ordinals,
709
- "model-value": (v = e(o).options.bysetpos) == null ? void 0 : v[0],
710
- "onUpdate:modelValue": u[3] || (u[3] = (a) => m({ bysetpos: a }))
711
- }, null, 8, ["items", "model-value"]),
712
- Y("div", Le, [
713
- (n(!0), F(h, null, N(e(L).weekdays, (a) => {
714
- var S;
715
- return n(), E(d, {
716
- class: H(["cursor-pointer", `${(S = e(o).options.byweekday) != null && S.includes(a.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
717
- label: a.label[0],
718
- key: a.value,
719
- compact: !0,
720
- onClick: () => {
721
- m({
722
- byweekday: [a.value]
723
- });
724
- }
725
- }, null, 8, ["class", "label", "onClick"]);
726
- }), 128))
727
- ])
728
- ]))
729
- ], 64)) : M("", !0),
730
- e(o).options.freq == e(x).YEARLY ? (n(), F(h, { key: 3 }, [
731
- u[10] || (u[10] = Y("div", null, "Month", -1)),
732
- Y("div", He, [
733
- (n(!0), F(h, null, N(e(L).months, (a) => {
734
- var S, g;
735
- return n(), E(d, {
736
- key: a.value,
737
- class: H(["cursor-pointer", {
738
- "bg-fm-color-primary text-white": (S = e(o).options.bymonth) == null ? void 0 : S.includes(
739
- a.value
740
- ),
741
- "bg-fm-color-gray-200 text-fm-color-gray-800": !((g = e(o).options.bymonth) != null && g.includes(a.value))
742
- }]),
743
- label: a.shortName,
744
- compact: !0,
745
- onClick: (w) => m({
746
- bymonth: (e(o).options.bymonth ?? []).includes(a.value) ? (e(o).options.bymonth ?? []).filter((U) => U !== a.value) : [...e(o).options.bymonth ?? [], a.value]
747
- })
748
- }, null, 8, ["class", "label", "onClick"]);
749
- }), 128))
750
- ]),
751
- b(p, {
752
- "model-value": e(o).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
753
- items: [
754
- {
755
- label: "Each"
756
- },
757
- {
758
- label: "On the"
759
- }
760
- ],
761
- "onUpdate:modelValue": u[4] || (u[4] = (a) => {
762
- a.label == "Each" ? m({
763
- bymonthday: [1],
764
- bymonth: e(o).options.bymonth ?? [1]
765
- }) : m({
766
- byweekday: [e(x).SU.nth(1)],
767
- bymonth: e(o).options.bymonth ?? [1]
768
- });
769
- })
770
- }, null, 8, ["model-value"]),
771
- e(o).options.bymonthday.length > 0 ? (n(), F("div", We, [
772
- (n(!0), F(h, null, N(Array(31).fill(null).map((a, S) => S + 1), (a) => (n(), F("div", {
773
- key: a,
774
- class: H(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(o).options.bymonthday.includes(a) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${a == 31 ? "border-r" : ""}`]),
775
- onClick: (S) => m({
776
- bymonthday: e(o).options.bymonthday.includes(a) ? e(o).options.bymonthday.filter((g) => g !== a) : [...e(o).options.bymonthday, a]
777
- })
778
- }, W(a), 11, je))), 128))
779
- ])) : (n(), F("div", Ke, [
780
- b(D, {
781
- items: e(L).ordinals,
782
- "model-value": (i = (k = e(o).options.bynweekday) == null ? void 0 : k[0]) == null ? void 0 : i[1],
783
- "onUpdate:modelValue": u[5] || (u[5] = (a) => {
784
- var S, g;
785
- return m({
786
- bynweekday: [[((g = (S = e(o).options.bynweekday) == null ? void 0 : S[0]) == null ? void 0 : g[0]) ?? 1, a]]
787
- });
788
- })
789
- }, null, 8, ["items", "model-value"]),
790
- Y("div", _e, [
791
- (n(!0), F(h, null, N(e(L).weekdays, (a) => {
792
- var S, g;
793
- return n(), E(d, {
794
- class: H(["cursor-pointer", `${((g = (S = e(o).options.bynweekday) == null ? void 0 : S[0]) == null ? void 0 : g[0]) === a.value ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
795
- label: a.label[0],
796
- key: a.value,
797
- compact: !0,
798
- onClick: () => {
799
- var w, U;
800
- m({
801
- bynweekday: [
802
- [a.value, ((U = (w = e(o).options.bynweekday) == null ? void 0 : w[0]) == null ? void 0 : U[1]) ?? 1]
803
- ]
804
- });
805
- }
806
- }, null, 8, ["class", "label", "onClick"]);
807
- }), 128))
808
- ])
809
- ]))
810
- ], 64)) : M("", !0),
811
- l.applyButton ? (n(), F("div", Ge, [
812
- b(f, {
813
- label: "Cancel",
814
- variant: "tertiary",
815
- onClick: u[6] || (u[6] = (a) => s("cancel"))
816
- }),
817
- b(f, {
818
- label: "Apply",
819
- onClick: u[7] || (u[7] = (a) => s("update:model-value", e(o).toString()))
820
- })
821
- ])) : M("", !0)
822
- ]);
823
- };
824
- }
825
- }), Qe = { class: "grid grid-cols-4 gap-8 w-full flex-wrap py-16" }, ze = /* @__PURE__ */ A({
826
- __name: "IsInMonthInput",
827
- props: {
828
- modelValue: {
829
- type: Object,
830
- required: !0
831
- }
832
- },
833
- emits: ["update:model-value"],
834
- setup(l, { emit: R }) {
835
- const y = l, s = R, o = J.months().map((m, t) => ({
836
- name: m,
837
- shortName: J().month(t).format("MMM"),
838
- value: t
839
- }));
840
- return z(() => {
841
- y.modelValue || s("update:model-value", []);
842
- }), (m, t) => {
843
- const u = V("FmChip");
844
- return n(), F("div", Qe, [
845
- (n(!0), F(h, null, N(e(o), (c) => {
846
- var d, p;
847
- return n(), E(u, {
848
- class: H(["cursor-pointer", {
849
- "bg-fm-color-primary text-white": (d = l.modelValue) == null ? void 0 : d.includes(c.value),
850
- "bg-fm-color-gray-200 text-fm-color-gray-800": !((p = l.modelValue) != null && p.includes(
851
- c.value
852
- ))
853
- }]),
854
- label: c.name,
855
- key: c.value,
856
- compact: !0,
857
- onClick: (f) => s(
858
- "update:model-value",
859
- l.modelValue.includes(c.value) ? l.modelValue.filter((v) => v !== c.value) : [...l.modelValue, c.value]
860
- )
861
- }, null, 8, ["class", "label", "onClick"]);
862
- }), 128))
863
- ]);
864
- };
865
- }
866
- }), Xe = { class: "" }, Ze = { class: "flex justify-end gap-8 w-full" }, Je = /* @__PURE__ */ A({
867
- __name: "MenuDialog",
868
- props: {
869
- modelValue: { type: Boolean },
870
- initialValue: {},
871
- filterItems: { type: Function }
872
- },
873
- emits: ["update:model-value", "confirm"],
874
- setup(l, { emit: R }) {
875
- const y = l, s = $(), o = $(!1), m = R;
876
- function t() {
877
- var c;
878
- (c = s.value) == null || c.onConfirm(), m("update:model-value", !1);
879
- }
880
- function u() {
881
- m("update:model-value", !1);
882
- }
883
- return de(
884
- () => y.modelValue,
885
- (c) => {
886
- o.value = c;
887
- }
888
- ), z(() => {
889
- o.value = y.modelValue;
890
- }), (c, d) => {
891
- const p = V("FmButton"), f = V("FmDialog");
892
- return n(), E(f, {
893
- "content-scrollable": !1,
894
- contentClass: "pt-0",
895
- modelValue: o.value,
896
- "onUpdate:modelValue": d[0] || (d[0] = (v) => o.value = v),
897
- title: "Select Items",
898
- "close-button": !1
899
- }, {
900
- "dialog-header": q(() => [...d[1] || (d[1] = [
901
- Y("div", null, "Select Item", -1)
902
- ])]),
903
- "dialog-footer": q(() => [
904
- Y("div", Ze, [
905
- b(p, {
906
- variant: "tertiary",
907
- onClick: u,
908
- label: "Cancel"
909
- }),
910
- b(p, {
911
- variant: "primary",
912
- onClick: t,
913
- label: "Confirm"
914
- })
915
- ])
916
- ]),
917
- default: q(() => [
918
- Y("div", Xe, [
919
- b(Ue, {
920
- ref_key: "selectItemRef",
921
- ref: s,
922
- "initial-value": l.initialValue,
923
- "filter-items": l.filterItems,
924
- "on-complete": (v) => {
925
- m("confirm", v), u();
926
- }
927
- }, null, 8, ["initial-value", "filter-items", "on-complete"])
928
- ])
929
- ]),
930
- _: 1
931
- }, 8, ["modelValue"]);
932
- };
933
- }
934
- }), et = { id: "select-menu" }, tt = /* @__PURE__ */ A({
935
- __name: "SelectMenu",
936
- props: {
937
- modelValue: {}
938
- },
939
- emits: ["update:model-value"],
940
- setup(l, { emit: R }) {
941
- const y = l, s = $(!1), o = I(() => {
942
- var u;
943
- return ((u = y.modelValue) == null ? void 0 : u.length) || 0;
944
- }), m = R;
945
- function t(u) {
946
- m("update:model-value", u);
947
- }
948
- return (u, c) => {
949
- const d = V("FmField");
950
- return n(), F("div", et, [
951
- b(d, {
952
- class: "text-fm-color-typo-tertiary",
953
- onClick: c[0] || (c[0] = (p) => s.value = !0)
954
- }, {
955
- default: q(() => [
956
- te(W(o.value) + " item(s) selected ", 1)
957
- ]),
958
- _: 1
959
- }),
960
- b(Je, {
961
- modelValue: s.value,
962
- "onUpdate:modelValue": [
963
- c[1] || (c[1] = (p) => s.value = p),
964
- c[2] || (c[2] = (p) => s.value = p)
965
- ],
966
- "initial-value": l.modelValue,
967
- onConfirm: t
968
- }, null, 8, ["modelValue", "initial-value"])
969
- ]);
970
- };
971
- }
972
- }), lt = {
973
- key: 19,
974
- class: "fm-typo-en-body-lg-600"
975
- }, ot = /* @__PURE__ */ A({
976
- __name: "RuleEquator",
977
- props: {
978
- type: {
979
- type: String,
980
- required: !0
981
- },
982
- operator: {
983
- type: String,
984
- required: !0
985
- },
986
- modelValue: {
987
- type: Object
988
- }
989
- },
990
- emits: ["update:model-value"],
991
- setup(l, { emit: R }) {
992
- const y = l, s = R, o = I(() => {
993
- const m = ce[y.operator].safeParse(y.modelValue);
994
- return m.success ? [] : m.error.errors;
995
- });
996
- return (m, t) => {
997
- var i, a, S, g, w, U;
998
- const u = V("FmTextField"), c = V("FmStepperField"), d = V("FmSimpleDatePicker"), p = V("FmSimpleDateRangePicker"), f = V("FmTimeRangePicker"), v = V("FmTimePicker"), k = V("FmHelperText");
999
- return n(), F("div", {
1000
- class: H({ "pb-4": e(o).length })
1001
- }, [
1002
- l.type === "text" ? (n(), E(u, {
1003
- key: 0,
1004
- "model-value": l.modelValue,
1005
- "onUpdate:modelValue": t[0] || (t[0] = (r) => s("update:model-value", r))
1006
- }, null, 8, ["model-value"])) : l.type === "number" ? (n(), E(c, {
1007
- key: 1,
1008
- "model-value": l.modelValue,
1009
- "onUpdate:modelValue": t[1] || (t[1] = (r) => s("update:model-value", r))
1010
- }, null, 8, ["model-value"])) : l.operator == "_isDay" ? (n(), E(ae(we), {
1011
- key: 2,
1012
- "model-value": l.modelValue,
1013
- "onUpdate:modelValue": t[2] || (t[2] = (r) => s("update:model-value", r))
1014
- }, null, 8, ["model-value"])) : l.operator == "_isRange" ? (n(), E(ae(qe), {
1015
- key: 3,
1016
- "model-value": l.modelValue,
1017
- "onUpdate:modelValue": t[3] || (t[3] = (r) => s("update:model-value", r))
1018
- }, null, 8, ["model-value"])) : l.operator == "_isOnDate" ? (n(), E(d, {
1019
- key: 4,
1020
- "model-value": l.modelValue,
1021
- "onUpdate:modelValue": t[4] || (t[4] = (r) => s("update:model-value", r))
1022
- }, null, 8, ["model-value"])) : l.operator == "_isBetween" ? (n(), E(p, {
1023
- key: 5,
1024
- "model-value": {
1025
- startDate: (i = l.modelValue) == null ? void 0 : i.start,
1026
- endDate: (a = l.modelValue) == null ? void 0 : a.end
1027
- },
1028
- "onUpdate:modelValue": t[5] || (t[5] = (r) => {
1029
- s("update:model-value", {
1030
- start: r.startDate,
1031
- end: r.endDate
1032
- });
1033
- })
1034
- }, null, 8, ["model-value"])) : l.operator == "_isInMonth" ? (n(), E(ze, {
1035
- key: 6,
1036
- "model-value": l.modelValue,
1037
- "onUpdate:modelValue": t[6] || (t[6] = (r) => s("update:model-value", r))
1038
- }, null, 8, ["model-value"])) : l.operator == "_rrule" ? (n(), E(ee, {
1039
- key: 7,
1040
- "model-value": l.modelValue,
1041
- "onUpdate:modelValue": t[7] || (t[7] = (r) => s("update:model-value", r))
1042
- }, null, 8, ["model-value"])) : l.operator == "_isBetweenTime" ? (n(), E(f, {
1043
- key: 8,
1044
- "disable-time-check": !0,
1045
- "model-value": [(g = (S = l.modelValue) == null ? void 0 : S[0]) == null ? void 0 : g.start, (U = (w = l.modelValue) == null ? void 0 : w[0]) == null ? void 0 : U.end],
1046
- "onUpdate:modelValue": t[8] || (t[8] = (r) => s("update:model-value", [
1047
- {
1048
- start: r[0],
1049
- end: r[1]
1050
- }
1051
- ]))
1052
- }, null, 8, ["model-value"])) : l.operator == "_isOnTime" ? (n(), E(v, {
1053
- key: 9,
1054
- "model-value": l.modelValue,
1055
- "onUpdate:modelValue": t[9] || (t[9] = (r) => s("update:model-value", r))
1056
- }, null, 8, ["model-value"])) : l.type == "tier" ? (n(), E(D, {
1057
- key: 10,
1058
- items: (e(Q)().sortedTiers ?? []).map((r, B) => ({
1059
- label: `Tier ${B + 1} - ${r.name}`,
1060
- value: B + 1
1061
- })),
1062
- "model-value": l.modelValue,
1063
- "onUpdate:modelValue": t[10] || (t[10] = (r) => s("update:model-value", r))
1064
- }, null, 8, ["items", "model-value"])) : l.type == "boolean" ? (n(), E(D, {
1065
- key: 11,
1066
- multiselect: !0,
1067
- items: [
1068
- { label: "true", value: !0 },
1069
- { label: "false", value: !1 }
1070
- ],
1071
- "model-value": l.modelValue ?? [],
1072
- "onUpdate:modelValue": t[11] || (t[11] = (r) => s("update:model-value", r))
1073
- }, null, 8, ["model-value"])) : l.type == "exist" ? (n(), E(D, {
1074
- key: 12,
1075
- items: [
1076
- { label: "true", value: "true" },
1077
- { label: "false", value: "false" }
1078
- ],
1079
- "model-value": l.modelValue ?? [],
1080
- "onUpdate:modelValue": t[12] || (t[12] = (r) => s("update:model-value", r))
1081
- }, null, 8, ["model-value"])) : l.type == "gender" ? (n(), E(D, {
1082
- key: 13,
1083
- multiselect: !0,
1084
- items: [
1085
- { label: "Male", value: "MALE" },
1086
- { label: "Female", value: "FEMALE" }
1087
- ],
1088
- "model-value": l.modelValue ?? [],
1089
- "onUpdate:modelValue": t[13] || (t[13] = (r) => s("update:model-value", r))
1090
- }, null, 8, ["model-value"])) : l.type == "collectible" ? (n(), E(D, {
1091
- key: 14,
1092
- multiselect: !0,
1093
- items: [],
1094
- "model-value": l.modelValue ?? [],
1095
- "onUpdate:modelValue": t[14] || (t[14] = (r) => s("update:model-value", r))
1096
- }, null, 8, ["model-value"])) : l.type == "segment" ? (n(), E(D, {
1097
- key: 15,
1098
- multiselect: !0,
1099
- items: e(Q)().segmentOptions,
1100
- "model-value": l.modelValue ?? [],
1101
- "onUpdate:modelValue": t[15] || (t[15] = (r) => s("update:model-value", r)),
1102
- label: "Select segment(s) to match"
1103
- }, null, 8, ["items", "model-value"])) : l.type == "title" ? (n(), E(D, {
1104
- key: 16,
1105
- multiselect: !0,
1106
- items: (e(Q)().sortedTitles ?? []).map((r) => ({
1107
- label: r.name,
1108
- value: r._id
1109
- })),
1110
- "model-value": l.modelValue ?? [],
1111
- "onUpdate:modelValue": t[16] || (t[16] = (r) => s("update:model-value", r))
1112
- }, null, 8, ["items", "model-value"])) : l.type == "product" ? (n(), E(tt, {
1113
- key: 17,
1114
- "model-value": l.modelValue,
1115
- "onUpdate:modelValue": t[17] || (t[17] = (r) => s("update:model-value", r))
1116
- }, null, 8, ["model-value"])) : l.type == "location" ? (n(), E(D, {
1117
- key: 18,
1118
- multiselect: !0,
1119
- items: e(X)().locations.map((r) => ({
1120
- label: r.name,
1121
- value: r._id
1122
- })),
1123
- "model-value": l.modelValue ?? [],
1124
- "onUpdate:modelValue": t[18] || (t[18] = (r) => s("update:model-value", r))
1125
- }, null, 8, ["items", "model-value"])) : (n(), F("div", lt, "Rule: " + W(l.type) + " Not implemented", 1)),
1126
- b(k, {
1127
- class: "items-end",
1128
- state: e(Z).helperState(e(o), ""),
1129
- text: e(Z).helperText(e(o), "")
1130
- }, null, 8, ["state", "text"])
1131
- ], 2);
1132
- };
1133
- }
1134
- }), at = { class: "space-y-4" }, rt = { class: "flex items-center gap-8" }, nt = { class: "flex items-center justify-end gap-8 pt-16 w-full" }, ut = /* @__PURE__ */ A({
1135
- __name: "CustomRuleDialog",
1136
- props: {
1137
- triggerType: {
1138
- type: String,
1139
- required: !0
1140
- },
1141
- includeOnly: {
1142
- type: String
1143
- },
1144
- modelValue: {
1145
- type: Object,
1146
- default: () => {
1147
- }
1148
- }
1149
- },
1150
- setup(l) {
1151
- const R = le(), y = Q(), { emitData: s, emitAction: o } = ie(), m = l, t = I(
1152
- () => ve(m.triggerType, m.includeOnly)
1153
- ), u = (U) => re[t.value.find((r) => r.property === U).type], c = I(() => {
1154
- if (!v.value) return [];
1155
- const U = t.value.find(
1156
- (r) => r.property === v.value.property
1157
- );
1158
- return U ? re[U.type].filter((r) => {
1159
- var B, P;
1160
- return !((P = (B = ne[r]) == null ? void 0 : B.exclude) != null && P.includes(v.value.property));
1161
- }).map((r) => ({
1162
- label: ne[r].name,
1163
- value: r
1164
- })) : [];
1165
- }), d = be, p = I(() => {
1166
- const U = d.safeParse(v.value);
1167
- return U.success ? [] : U.error.errors;
1168
- }), f = $(!1), v = $(
1169
- me(m.modelValue) ?? C.constructEntry(
1170
- t.value[0].property,
1171
- u(t.value[0].property)[0],
1172
- null
1173
- )
1174
- ), k = I(() => {
1175
- var j;
1176
- const { property: U, negated: r, conditions: B } = v.value, P = Object.keys(B || {})[0], K = Object.values(B || {})[0];
1177
- return {
1178
- property: U,
1179
- negated: r == !0,
1180
- type: (j = t.value.find((_) => _.property === U)) == null ? void 0 : j.type,
1181
- operator: P,
1182
- equator: K
1183
- };
1184
- });
1185
- function i(U) {
1186
- v.value = C.constructEntry(
1187
- U,
1188
- u(U)[0],
1189
- null
1190
- );
1191
- }
1192
- function a(U) {
1193
- v.value = { ...v.value, negated: U == !0 };
1194
- }
1195
- function S(U) {
1196
- v.value = {
1197
- ...v.value,
1198
- conditions: { [U]: null }
1199
- };
1200
- }
1201
- function g(U) {
1202
- v.value.conditions = {
1203
- [k.value.operator]: U
1204
- };
1205
- }
1206
- function w() {
1207
- s(v.value), o("primary"), R.close();
1208
- }
1209
- return ue(async () => {
1210
- await y.readMembership();
1211
- }), (U, r) => {
1212
- const B = V("FmIcon"), P = V("FmField"), K = V("FmPill"), j = V("FmMenuItem"), _ = V("FmMenu"), G = V("FmButton");
1213
- return n(), F("div", at, [
1214
- r[5] || (r[5] = Y("div", { class: "fm-typo-en-body-lg-400" }, "Property", -1)),
1215
- b(_, {
1216
- shift: !0,
1217
- placement: "bottom-start",
1218
- modelValue: e(f),
1219
- "onUpdate:modelValue": r[0] || (r[0] = (O) => pe(f) ? f.value = O : null),
1220
- onMenuChanged: r[1] || (r[1] = (O) => f.value = O),
1221
- "max-height": 300
1222
- }, {
1223
- "menu-button": q(() => [
1224
- b(P, null, {
1225
- append: q(() => [
1226
- b(B, {
1227
- name: e(f) ? "expand_less" : "expand_more"
1228
- }, null, 8, ["name"])
1229
- ]),
1230
- default: q(() => {
1231
- var O;
1232
- return [
1233
- te(W((O = e(t).find((T) => T.property == e(v).property)) == null ? void 0 : O.name) + " ", 1)
1234
- ];
1235
- }),
1236
- _: 1
1237
- })
1238
- ]),
1239
- default: q(() => [
1240
- (n(!0), F(h, null, N(e(t), (O) => (n(), E(j, {
1241
- key: O.property,
1242
- "model-value": e(v).property == O.property,
1243
- label: O.name,
1244
- disabled: O.premium && !e(X)().isPremium,
1245
- onClick: (T) => O.premium && !e(X)().isPremium ? null : i(O.property)
1246
- }, se({ _: 2 }, [
1247
- O.premium ? {
1248
- name: "append",
1249
- fn: q(() => [
1250
- b(K, { variant: "premium" })
1251
- ]),
1252
- key: "0"
1253
- } : void 0
1254
- ]), 1032, ["model-value", "label", "disabled", "onClick"]))), 128))
1255
- ]),
1256
- _: 1
1257
- }, 8, ["modelValue"]),
1258
- r[6] || (r[6] = Y("div", { class: "fm-typo-en-body-lg-400" }, "Check to perform", -1)),
1259
- Y("div", rt, [
1260
- b(D, {
1261
- class: "w-1/4",
1262
- items: [
1263
- { label: "is", value: !1 },
1264
- { label: "is not", value: !0 }
1265
- ],
1266
- "model-value": e(v).negated ?? !1,
1267
- "onUpdate:modelValue": a
1268
- }, null, 8, ["model-value"]),
1269
- b(D, {
1270
- class: "flex-1",
1271
- items: e(c),
1272
- "model-value": e(k).operator,
1273
- "onUpdate:modelValue": S
1274
- }, null, 8, ["items", "model-value"])
1275
- ]),
1276
- Y("div", null, [
1277
- r[4] || (r[4] = Y("div", { class: "fm-typo-en-body-lg-400" }, "Criteria", -1)),
1278
- e(k).type ? (n(), E(ot, {
1279
- key: 0,
1280
- type: e(k).type,
1281
- operator: e(k).operator,
1282
- "model-value": e(k).equator,
1283
- "onUpdate:modelValue": g
1284
- }, null, 8, ["type", "operator", "model-value"])) : M("", !0)
1285
- ]),
1286
- Y("div", nt, [
1287
- b(G, {
1288
- onClick: r[2] || (r[2] = (O) => e(R).close()),
1289
- label: "Cancel",
1290
- variant: "tertiary"
1291
- }),
1292
- b(G, {
1293
- onClick: r[3] || (r[3] = (O) => w()),
1294
- disabled: e(p).length > 0,
1295
- label: "Save"
1296
- }, null, 8, ["disabled"])
1297
- ])
1298
- ]);
1299
- };
1300
- }
1301
- }), st = { class: "flex flex-col gap-8" }, it = { class: "grid grid-cols-2 items-center" }, mt = { class: "flex items-center gap-8" }, dt = { class: "pt-16 flex items-center self-end gap-8" }, pt = /* @__PURE__ */ A({
1302
- __name: "PresetRuleDialog",
1303
- props: {
1304
- preset: {
1305
- type: String,
1306
- required: !0
1307
- },
1308
- defaultValue: {
1309
- type: Object
1310
- },
1311
- modelValue: {
1312
- type: Object
1313
- }
1314
- },
1315
- setup(l) {
1316
- const R = le(), { emitData: y, emitAction: s } = ie(), o = Q(), m = l;
1317
- function t() {
1318
- const { operator: k, equator: i } = d.value;
1319
- switch (m.preset) {
1320
- case "MIN_SPEND":
1321
- case "SPECIFIC_DATE":
1322
- case "SPECIFIC_TIMERANGE":
1323
- case "WEEKLY":
1324
- case "MONTHLY":
1325
- case "BIRTHDAY":
1326
- case "TIER":
1327
- return `Applies to ${o.sortedTiers.filter((S, g) => k == "_equal" ? g + 1 == i : k == "_moreThanOrEqual" ? g + 1 >= i : g + 1 <= i).map((S) => S.name).join(", ")}`;
1328
- }
1329
- }
1330
- function u() {
1331
- var k, i;
1332
- switch (m.preset) {
1333
- case "MIN_SPEND":
1334
- return C.constructEntry("bill.amount", "_moreThanOrEqual", 0);
1335
- case "SPECIFIC_DATE":
1336
- return C.constructEntry(
1337
- "trigger.date",
1338
- "_isOnDate",
1339
- (/* @__PURE__ */ new Date()).toISOString()
1340
- );
1341
- case "SPECIFIC_TIMERANGE":
1342
- return C.constructEntry("trigger.time", "_isBetweenTime", [
1343
- { start: "00:00", end: "23:59" }
1344
- ]);
1345
- case "WEEKLY":
1346
- return C.constructEntry(
1347
- "trigger.date",
1348
- "_rrule",
1349
- "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
1350
- );
1351
- case "MONTHLY":
1352
- return C.constructEntry(
1353
- "trigger.date",
1354
- "_rrule",
1355
- "RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
1356
- );
1357
- case "BIRTHDAY":
1358
- console.log("birthday", m);
1359
- const a = C.constructEntry(
1360
- m.defaultValue.property,
1361
- m.defaultValue.operator,
1362
- m.defaultValue.equator
1363
- );
1364
- return console.log(a), a;
1365
- case "TIER":
1366
- return C.constructEntry("user.tier", "_equal", 1);
1367
- case "TITLE":
1368
- return C.constructEntry("user.titles", "_hasAny", [
1369
- (i = (k = o.sortedTitles) == null ? void 0 : k[0]) == null ? void 0 : i._id
1370
- ]);
1371
- case "LAST_X_DAY":
1372
- return C.constructEntry("user.stats.lastVisit", "_isRange", {
1373
- op: "last",
1374
- unit: "day",
1375
- ignoreYear: !0,
1376
- x: 0
1377
- });
1378
- case "CUSTOM":
1379
- throw new Error("Not implemented");
1380
- }
1381
- }
1382
- const c = $(u()), d = I(() => {
1383
- const k = C.simplify(c.value);
1384
- return {
1385
- ...k,
1386
- equator: k.equator
1387
- };
1388
- });
1389
- function p(k, i) {
1390
- const a = d.value;
1391
- c.value = C.constructEntry(
1392
- a.property,
1393
- i ?? a.operator,
1394
- k,
1395
- c.value.name
1396
- );
1397
- }
1398
- function f() {
1399
- y(c.value), s("primary"), R.close();
1400
- }
1401
- const v = I(() => {
1402
- const k = fe.safeParse(c.value);
1403
- return k.success ? [] : k.error.errors;
1404
- });
1405
- return ue(async () => {
1406
- await o.readMembership();
1407
- }), (k, i) => {
1408
- var K, j, _, G, O;
1409
- const a = V("FmStepperField"), S = V("FmDatePicker"), g = V("FmTimeRangePicker"), w = V("FmRadio"), U = V("FmSelect"), r = V("FmRadioGroup"), B = V("FmHelperText"), P = V("FmButton");
1410
- return n(), F("div", st, [
1411
- l.preset == "MIN_SPEND" ? (n(), E(a, {
1412
- key: 0,
1413
- label: "Minimum spend",
1414
- "model-value": e(d).equator,
1415
- "onUpdate:modelValue": i[0] || (i[0] = (T) => p(T))
1416
- }, null, 8, ["model-value"])) : M("", !0),
1417
- l.preset == "LAST_X_DAY" ? (n(), E(a, {
1418
- key: 1,
1419
- label: "",
1420
- min: 0,
1421
- prepent: "Day(s)",
1422
- "model-value": e(d).equator.x,
1423
- rules: [(T) => T >= 0 || "Value must be greater than 0"],
1424
- "onUpdate:modelValue": i[1] || (i[1] = (T) => p({
1425
- op: "last",
1426
- unit: "day",
1427
- ignoreYear: !0,
1428
- x: T
1429
- }))
1430
- }, null, 8, ["model-value", "rules"])) : l.preset == "SPECIFIC_DATE" ? (n(), E(S, {
1431
- key: 2,
1432
- label: "Specific Date",
1433
- "model-value": e(d).equator,
1434
- "onUpdate:modelValue": i[2] || (i[2] = (T) => p(T))
1435
- }, null, 8, ["model-value"])) : l.preset == "SPECIFIC_TIMERANGE" ? (n(), E(g, {
1436
- key: 3,
1437
- label: "Time is between",
1438
- "disable-time-check": !0,
1439
- "model-value": [(j = (K = e(d).equator) == null ? void 0 : K[0]) == null ? void 0 : j.start, (G = (_ = e(d).equator) == null ? void 0 : _[0]) == null ? void 0 : G.end],
1440
- "onUpdate:modelValue": i[3] || (i[3] = (T) => p([
1441
- {
1442
- start: T[0],
1443
- end: T[1]
1444
- }
1445
- ]))
1446
- }, null, 8, ["model-value"])) : l.preset == "WEEKLY" ? (n(), E(ee, {
1447
- key: 4,
1448
- label: "Weekly",
1449
- "fixed-frequency": !0,
1450
- "model-value": e(d).equator,
1451
- "onUpdate:modelValue": i[4] || (i[4] = (T) => p(T))
1452
- }, null, 8, ["model-value"])) : l.preset == "MONTHLY" ? (n(), E(ee, {
1453
- key: 5,
1454
- label: "Weekly",
1455
- "fixed-frequency": !0,
1456
- "model-value": e(d).equator,
1457
- "onUpdate:modelValue": i[5] || (i[5] = (T) => p(T))
1458
- }, null, 8, ["model-value"])) : l.preset == "BIRTHDAY" ? (n(), F(h, { key: 6 }, [
1459
- Y("div", it, [
1460
- b(w, {
1461
- label: "N days before birthday",
1462
- value: "_isDay",
1463
- "model-value": e(d).operator,
1464
- "onUpdate:modelValue": i[6] || (i[6] = () => {
1465
- p(
1466
- {
1467
- op: "after",
1468
- x: 1,
1469
- ignoreYear: !0
1470
- },
1471
- "_isDay"
1472
- );
1473
- })
1474
- }, null, 8, ["model-value"]),
1475
- Y("div", mt, [
1476
- b(w, {
1477
- label: "Is in this",
1478
- value: "_isRange",
1479
- "model-value": e(d).operator,
1480
- "onUpdate:modelValue": i[7] || (i[7] = () => {
1481
- p(
1482
- {
1483
- op: "this",
1484
- unit: "day",
1485
- ignoreYear: !0
1486
- },
1487
- "_isRange"
1488
- );
1489
- })
1490
- }, null, 8, ["model-value"]),
1491
- e(d).operator == "_isRange" ? (n(), E(U, {
1492
- key: 0,
1493
- items: ["day", "week", "month"].map((T) => ({ label: T, value: T })),
1494
- "model-value": e(d).equator.unit,
1495
- "onUpdate:modelValue": i[8] || (i[8] = (T) => p(
1496
- {
1497
- op: "this",
1498
- unit: T,
1499
- ignoreYear: !0
1500
- },
1501
- "_isRange"
1502
- ))
1503
- }, null, 8, ["items", "model-value"])) : M("", !0)
1504
- ])
1505
- ]),
1506
- e(d).operator == "_isDay" ? (n(), E(a, {
1507
- key: 0,
1508
- label: "Days before birthday",
1509
- "show-steppers": !1,
1510
- "model-value": e(d).equator.x,
1511
- "onUpdate:modelValue": i[9] || (i[9] = (T) => p({
1512
- op: "after",
1513
- x: T,
1514
- ignoreYear: !0
1515
- }))
1516
- }, null, 8, ["model-value"])) : M("", !0)
1517
- ], 64)) : l.preset == "TIER" ? (n(), F(h, { key: 7 }, [
1518
- b(r, {
1519
- inline: !0,
1520
- "model-value": e(d).operator,
1521
- "onUpdate:modelValue": i[10] || (i[10] = (T) => p(e(d).equator, T))
1522
- }, {
1523
- default: q(() => [
1524
- b(w, {
1525
- value: "_moreThanOrEqual",
1526
- label: "At least"
1527
- }),
1528
- b(w, {
1529
- value: "_equal",
1530
- label: "Equal"
1531
- }),
1532
- b(w, {
1533
- value: "_lessThanOrEqual",
1534
- label: "At most"
1535
- })
1536
- ]),
1537
- _: 1
1538
- }, 8, ["model-value"]),
1539
- b(D, {
1540
- items: (e(o).sortedTiers ?? []).map((T, oe) => ({
1541
- label: `Tier ${oe + 1} - ${T.name}`,
1542
- value: oe + 1
1543
- })),
1544
- "model-value": e(d).equator,
1545
- "onUpdate:modelValue": i[11] || (i[11] = (T) => p(T))
1546
- }, null, 8, ["items", "model-value"]),
1547
- b(B, {
1548
- text: t()
1549
- }, null, 8, ["text"])
1550
- ], 64)) : l.preset == "TITLE" ? (n(), E(D, {
1551
- key: 8,
1552
- label: "User has title",
1553
- items: (e(o).sortedTitles ?? []).map((T) => ({
1554
- label: T.name,
1555
- value: T._id
1556
- })),
1557
- "model-value": (O = e(d).equator) == null ? void 0 : O[0],
1558
- "onUpdate:modelValue": i[12] || (i[12] = (T) => p([T]))
1559
- }, null, 8, ["items", "model-value"])) : M("", !0),
1560
- b(B, {
1561
- class: "mt-[-8px]",
1562
- text: e(Z).helperText(e(v), ""),
1563
- state: e(Z).helperState(e(v), "")
1564
- }, null, 8, ["text", "state"]),
1565
- Y("div", dt, [
1566
- b(P, {
1567
- onClick: i[13] || (i[13] = (T) => e(R).close()),
1568
- label: "Cancel",
1569
- variant: "tertiary"
1570
- }),
1571
- b(P, {
1572
- onClick: i[14] || (i[14] = (T) => f()),
1573
- disabled: e(v).length > 0,
1574
- label: "Save"
1575
- }, null, 8, ["disabled"])
1576
- ])
1577
- ]);
1578
- };
1579
- }
1580
- }), yt = /* @__PURE__ */ A({
1581
- __name: "RuleConfigurator",
1582
- props: {
1583
- triggerType: {
1584
- type: String,
1585
- required: !0
1586
- },
1587
- includeOnly: {
1588
- type: String
1589
- },
1590
- modelValue: {
1591
- type: Object,
1592
- default: () => {
1593
- }
1594
- }
1595
- },
1596
- emits: ["update:model-value"],
1597
- setup(l, { expose: R, emit: y }) {
1598
- const s = X(), o = l, m = y, t = le(), u = $();
1599
- function c(f) {
1600
- const [v] = f.rules;
1601
- t.open({
1602
- title: f.name,
1603
- closeButton: !1,
1604
- dismissAway: !1,
1605
- contentComponent: pt,
1606
- contentComponentProps: {
1607
- preset: f.type,
1608
- defaultValue: v,
1609
- modelValue: o.modelValue
1610
- }
1611
- }).onPrimary((k) => m("update:model-value", k));
1612
- }
1613
- function d(f) {
1614
- t.open({
1615
- title: "Edit rule",
1616
- closeButton: !1,
1617
- dismissAway: !1,
1618
- contentComponent: ut,
1619
- contentComponentProps: {
1620
- triggerType: o.triggerType,
1621
- includeOnly: o.includeOnly,
1622
- modelValue: f
1623
- }
1624
- }).onPrimary((v) => m("update:model-value", v));
1625
- }
1626
- function p(f) {
1627
- if (f.type == "CUSTOM") {
1628
- const [v] = f.rules;
1629
- return d(
1630
- C.constructEntry(v.property, v.operator, v.equator)
1631
- );
1632
- }
1633
- return c(f);
1634
- }
1635
- return R({
1636
- showCustomDialog: d
1637
- }), (f, v) => {
1638
- const k = V("FmButton"), i = V("FmPill"), a = V("FmMenuItem"), S = V("FmMenu");
1639
- return n(), E(S, {
1640
- shift: !0,
1641
- placement: "top-start"
1642
- }, {
1643
- "menu-button": q(() => [
1644
- b(k, {
1645
- label: "Add condition",
1646
- icon: "add",
1647
- class: "text-fm-color-primary border-fm-color-primary",
1648
- "icon-color": "primary",
1649
- variant: "secondary"
1650
- })
1651
- ]),
1652
- default: q(() => [
1653
- (n(!0), F(h, null, N(e(De).filter(
1654
- (g) => !l.includeOnly || g.for.includes(l.includeOnly)
1655
- ), (g) => (n(), E(a, {
1656
- key: g.name,
1657
- "model-value": g.name == e(u),
1658
- label: g.name,
1659
- onClick: () => {
1660
- g != null && g.premium && !e(s).isPremium || p(g);
1661
- },
1662
- disabled: (g == null ? void 0 : g.premium) && !e(s).isPremium
1663
- }, se({ _: 2 }, [
1664
- g != null && g.premium ? {
1665
- name: "append",
1666
- fn: q(() => [
1667
- b(i, { variant: "premium" })
1668
- ]),
1669
- key: "0"
1670
- } : void 0
1671
- ]), 1032, ["model-value", "label", "onClick", "disabled"]))), 128))
1672
- ]),
1673
- _: 1
1674
- });
1675
- };
1676
- }
1677
- }), ht = /* @__PURE__ */ A({
1678
- __name: "RuleGroup",
1679
- props: {
1680
- triggerType: {
1681
- type: String,
1682
- required: !0
1683
- },
1684
- includeOnly: {
1685
- type: String
1686
- },
1687
- modelValue: {
1688
- type: Object
1689
- }
1690
- },
1691
- emits: ["update:model-value"],
1692
- setup(l, { emit: R }) {
1693
- const y = l, s = R, o = ke(), m = I(
1694
- () => y.modelValue ?? C.scaffoldGroup()
1695
- ), t = I(() => C.getLogic(m.value)), u = $();
1696
- function c(d, p) {
1697
- try {
1698
- const f = C.setRuleToGroup(d, p);
1699
- C.isRuleExceed(d, p), s("update:model-value", f);
1700
- } catch (f) {
1701
- o.open({
1702
- message: f.message,
1703
- type: "error"
1704
- });
1705
- }
1706
- }
1707
- return (d, p) => {
1708
- const f = V("FmButtonGroup"), v = V("FmCard");
1709
- return n(), E(v, { variant: "outlined" }, {
1710
- default: q(() => [
1711
- b(v, { class: "border-l-4 border-fm-color-primary p-16 space-y-16" }, {
1712
- default: q(() => [
1713
- p[3] || (p[3] = Y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " When ", -1)),
1714
- b(yt, {
1715
- ref_key: "configuratorRef",
1716
- ref: u,
1717
- "include-only": l.includeOnly,
1718
- "trigger-type": l.triggerType,
1719
- "onUpdate:modelValue": p[0] || (p[0] = (k) => c(e(m), k))
1720
- }, null, 8, ["include-only", "trigger-type"]),
1721
- (n(!0), F(h, null, N(e(m).rules, (k, i) => {
1722
- var a;
1723
- return n(), F(h, null, [
1724
- e(ge)(k) ? (n(), E(Ce, {
1725
- "model-value": k,
1726
- key: i,
1727
- onEdit: (a = e(u)) == null ? void 0 : a.showCustomDialog,
1728
- onRemove: p[1] || (p[1] = (S) => {
1729
- s(
1730
- "update:model-value",
1731
- e(C).removeEntry(e(m), S.name)
1732
- );
1733
- })
1734
- }, null, 8, ["model-value", "onEdit"])) : M("", !0),
1735
- b(f, {
1736
- class: "w-[200px]",
1737
- disabled: Object.keys(e(m).rules).length < 2,
1738
- items: [{ label: "And" }, { label: "Or" }],
1739
- "model-value": e(t) === "&&" ? { label: "And" } : { label: "Or" },
1740
- "onUpdate:modelValue": p[2] || (p[2] = (S) => s(
1741
- "update:model-value",
1742
- e(C).setRuleToGroup(
1743
- e(m),
1744
- [],
1745
- S.label === "And" ? "&&" : "||"
1746
- )
1747
- ))
1748
- }, null, 8, ["disabled", "model-value"])
1749
- ], 64);
1750
- }), 256))
1751
- ]),
1752
- _: 1
1753
- })
1754
- ]),
1755
- _: 1
1756
- });
1757
- };
1758
- }
1759
- });
1760
- export {
1761
- ht as _,
1762
- ee as a
1763
- };