@feedmepos/mf-connect 0.1.114-prod → 0.1.115-dev

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 (157) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-DMYXrCc7.js → App-43mZfFAr.js} +700 -654
  3. package/dist/AuditLogs-BPpdm96t.js +2016 -0
  4. package/dist/{Bin-CHZolo56.js → Bin-CA7v180Y.js} +8 -8
  5. package/dist/Broadcast-qmdifF2Y.js +306 -0
  6. package/dist/{CampaignAnalytic-DgZvsUoF.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C42uL_JO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
  8. package/dist/{Card-wRFTJwJ9.js → Card-D8icsk7L.js} +25 -24
  9. package/dist/{Collections-9G-_9Etz.js → Collections--THcD-E_.js} +197 -185
  10. package/dist/{Credit-Bl7IDMCU.js → Credit-JrbtVMBp.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BVLJeofG.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Q1f6EQW3.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +32 -32
  14. package/dist/{Experience-Cs2iViLv.js → Experience-CFeRqBoj.js} +32 -31
  15. package/dist/{FileSaver.min-B3Levdbu.js → FileSaver.min-CCXIBm58.js} +1 -1
  16. package/dist/{Game-oXURgzan.js → Game-CPxq6Ex3.js} +19 -18
  17. package/dist/{GiftCardSetup-C2Wu-dRl.js → GiftCardSetup-D0esVZDp.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Da2e89Um.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
  19. package/dist/{Goals-B_xEM7gf.js → Goals-DaKI6uXt.js} +4 -4
  20. package/dist/Grab-BWzdN_cd.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BRJR1heE.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
  22. package/dist/{Index-kuT6W6R_.js → Index-2kENoaZm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-7JqHfSk-.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CI_4S7tW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
  25. package/dist/{LoyaltyDashboard-CqxHdZcm.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
  26. package/dist/MainLayout-DwnjGXh6.js +4 -0
  27. package/dist/{MainLayout-CAERFIms.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +5 -4
  28. package/dist/Marketing-DCco__2F.js +273 -0
  29. package/dist/MarketingMaterialEdit-BbgFtrYP.js +1037 -0
  30. package/dist/{Member-B8VZEn9t.js → Member-B--nYyr0.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-B31lVLKh.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +43 -50
  32. package/dist/{MemberImportHistory-D9tgHnTS.js → MemberImportHistory-D52Y4RTC.js} +7 -7
  33. package/dist/{MemberList-Hw_xQY1i.js → MemberList-13Owa1fj.js} +103 -105
  34. package/dist/{MemberTransactions-DiBO4plw.js → MemberTransactions-CpXEWNbq.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CbFt5X89.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +4228 -4176
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BE_-Ed4z.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
  37. package/dist/{Mission-DpYei3aF.js → Mission-Ci-UzXSu.js} +22 -21
  38. package/dist/{Overview-CARquJCS.js → Overview-CKxSfAGF.js} +145 -144
  39. package/dist/{Overview-BFQMmyT6.js → Overview-CXen9Ram.js} +23 -22
  40. package/dist/{Point-Dd2ykwNv.js → Point-CR3YOaag.js} +22 -21
  41. package/dist/{Promotion-DXl-W7np.js → Promotion-tw3J4ul-.js} +137 -131
  42. package/dist/{Queue-Cd3N-4iB.js → Queue-BZGA5ZXt.js} +47 -46
  43. package/dist/{Record-C3HdDsh5.js → Record-BTevVXnT.js} +9 -9
  44. package/dist/{Review-Bif3Ub9Z.js → Review-BU7c8ZF0.js} +2 -2
  45. package/dist/ReviewFacebookCallback-BnMF6Arh.js +225 -0
  46. package/dist/{ReviewGoogleCallback-i-RNLlLm.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
  47. package/dist/{Reward-DHxzrR_7.js → Reward-jlA_7cxz.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DcrFlcSo.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js +1923 -0
  50. package/dist/{Segment-Cjpxordk.js → Segment-C1Bwm--Q.js} +290 -291
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-6u21xBu6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BOXVzfer.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
  53. package/dist/Setting-CDM4RhLW.js +574 -0
  54. package/dist/{SettingAdvertisements-aog5fz32.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
  55. package/dist/Settings-D-0tvZRr.js +286 -0
  56. package/dist/{Store-Bq3kw1l2.js → Store-C56dXtc4.js} +31 -30
  57. package/dist/{StoreRewards-ZGXKEM09.js → StoreRewards-DQ1Q6WS6.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js +7007 -0
  60. package/dist/{Tier-CfgpEHY7.js → Tier-D4CPZqw7.js} +2576 -687
  61. package/dist/{Title-B2itYWeD.js → Title-DCbwhUic.js} +94 -92
  62. package/dist/{Transaction-hJ5ygIcf.js → Transaction-C5LrasXr.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-8BgGlpTh.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +26 -26
  64. package/dist/{Voucher-TG47pGR3.js → Voucher-rrVbNZKR.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjuXCTxg.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +16 -16
  66. package/dist/WhatsappAccount-oJDo5zTr.js +159 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js +39 -0
  68. package/dist/WhatsappBot-Cl64wG_F.js +876 -0
  69. package/dist/WhatsappBotLogs-D3uT4EiB.js +372 -0
  70. package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
  71. package/dist/WhatsappLayout-C639d2HP.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js +253 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BRs-gbP0.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
  74. package/dist/{app-tPHYkJcQ.js → app-CgimGODl.js} +10610 -8223
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-BHDVnGj2.js → base.export-D2P6HFvo.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-HLyWfrXY.js → business-Bu5TqSA0.js} +1 -1
  79. package/dist/campaign-BFIXSgdJ.js +400 -0
  80. package/dist/{campaign-5zFgUNLw.js → campaign-zJxttSIk.js} +31 -25
  81. package/dist/{campaign.enum-BOkDnP2g.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/{campaign.fn-BIAoVtJj.js → campaign.fn-gvjlcEfe.js} +78 -78
  83. package/dist/{collectible.enum-BbZSAfys.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-DPSgBHnz.js → collection.fn-DOm0HsSh.js} +2 -2
  85. package/dist/{currency-BVrMqU6-.js → currency-BpbQvbm8.js} +1 -1
  86. package/dist/duplicateCampaign-CvsvjRE9.js +51 -0
  87. package/dist/{effect-BBifVx76.js → effect-D-GtNB3n.js} +1 -1
  88. package/dist/{email-addresses-9C7xHTNv.js → email-addresses-BKMoAtMi.js} +2 -2
  89. package/dist/feature-flag-BJ_eyKsq.js +868 -0
  90. package/dist/feature-flag-Bo-k5sIG.js +50 -0
  91. package/dist/google-BQK68wbe.js +5 -0
  92. package/dist/{helper-C08jyQNK.js → helper-CkfjBgMM.js} +1 -1
  93. package/dist/{index-Dhyqf1s8.js → index-B6kU3PkV.js} +2700 -2613
  94. package/dist/{index-BgwZGunW.js → index-BAtUrtqM.js} +19 -6
  95. package/dist/index-BKsxIwbi.js +14571 -0
  96. package/dist/{index-DZ-q5O-V.js → index-BdEXUNoG.js} +4 -4
  97. package/dist/{index-hIUtD2eY.js → index-Bhl5IRXy.js} +11 -10
  98. package/dist/{index-kCbkOivd.js → index-BpTIulTX.js} +1 -1
  99. package/dist/index-C-iwb2Ln.js +109 -0
  100. package/dist/{index-Ciw2TZxV.js → index-CCEXSPxk.js} +8 -7
  101. package/dist/{index-CUle4c2B.js → index-CIej31pF.js} +4 -3
  102. package/dist/{index-ihw-WFCa.js → index-CQ8XFbBk.js} +2 -2
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-CEe1kJ0T.js → index-CfQuYqXn.js} +1 -1
  105. package/dist/{index-C_WoO58V.js → index-CuREApMc.js} +8 -7
  106. package/dist/{index-NJSI4wX4.js → index-D0JK99Ko.js} +693 -231
  107. package/dist/{index-DnRMNmUA.js → index-DKxN1mMS.js} +396 -232
  108. package/dist/index-DQ8JJhxs.js +74 -0
  109. package/dist/{index-D24Q28cH.js → index-DUAZOMVJ.js} +1 -1
  110. package/dist/{index-Yo0tP8KJ.js → index-DqGs6RJG.js} +683 -581
  111. package/dist/{index-B_334Y_i.js → index-DwU3fsLW.js} +29 -15
  112. package/dist/{index-hSRM1smQ.js → index-LygS9WsG.js} +8028 -10767
  113. package/dist/{index-96ZiAKj_.js → index-feCrYhi6.js} +1 -1
  114. package/dist/{index-Dk-jg0wN.js → index-zTvr2GR4.js} +2 -2
  115. package/dist/{index.esm2017-hN99SQTb.js → index.esm2017-DZi9IQPS.js} +209 -209
  116. package/dist/{loading-CVuY4vQ4.js → loading-Brid2wnu.js} +1 -1
  117. package/dist/{lodash-GFl9_FMH.js → lodash-C1epw3Kv.js} +1 -1
  118. package/dist/{member-import-CshTzabx.js → member-import-DAIxTIiu.js} +6 -5
  119. package/dist/{membership-S0KES3Ex.js → membership-BZmljFhF.js} +3 -3
  120. package/dist/{money-JxdX8ru4.js → money-cLcyGcSZ.js} +1 -1
  121. package/dist/{number-BRLwa-mB.js → number-C2jPLJr2.js} +1 -1
  122. package/dist/objectid-C-wocWKI.js +145 -0
  123. package/dist/{onboarding-BSKYeyP7.js → onboarding-oRfy_g05.js} +25 -25
  124. package/dist/{onboardingSetup-BqT52VRm.js → onboardingSetup-BLD6m8HY.js} +2 -2
  125. package/dist/{plugins-BR_wmMFJ.js → plugins-CUsr9vB0.js} +3 -3
  126. package/dist/{MarketingMaterialEdit-BvIthCHG.js → remy-icon-BhUGu2NI.js} +2 -1031
  127. package/dist/{reward-CpCGg_W2.js → reward-UOT03odb.js} +1 -1
  128. package/dist/{rule-Dbg9e8MO.js → rule-BgJnPjkI.js} +572 -492
  129. package/dist/style.css +1 -1
  130. package/dist/template-BZyFhr73.js +188 -0
  131. package/dist/{timezone-CDVa-xPr.js → timezone-BXA4wq7Y.js} +1 -1
  132. package/dist/{transaction.fn-DrTBoF9T.js → transaction.fn-CQ4fpRt3.js} +2 -2
  133. package/dist/{trigger-wqGwQfB2.js → trigger-DXJCGT0q.js} +8 -8
  134. package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
  135. package/dist/{usePagination-fODgpZZ8.js → usePagination-Pp4okWr8.js} +1 -1
  136. package/dist/{user-DaLUK1dk.js → user-B3gXcAIy.js} +1 -1
  137. package/dist/vue-i18n-DWGiC_vs.js +2365 -0
  138. package/dist/{xlsx-Bl4_Dtrq.js → xlsx-CCaDUTgW.js} +651 -651
  139. package/dist/{zod-CAzWyVqj.js → zod-CPwjOxvW.js} +1 -1
  140. package/package.json +12 -3
  141. package/dist/Broadcast-ByWvxVhW.js +0 -271
  142. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DGpQfV5T.js +0 -2431
  143. package/dist/Marketing-KgcwGErU.js +0 -236
  144. package/dist/ReviewFacebookCallback-mJF54-9l.js +0 -238
  145. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-39f3I4BB.js +0 -1883
  146. package/dist/Setting-Dl9MelHz.js +0 -2036
  147. package/dist/Settings-DvCCClIP.js +0 -179
  148. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DscLAF0p.js +0 -1264
  149. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l_v4FHO0.js +0 -142
  150. package/dist/campaign-awCRccgX.js +0 -228
  151. package/dist/google-C3S8u0mT.js +0 -4
  152. package/dist/index-CoNJdOx7.js +0 -51
  153. package/dist/objectid-CEHN25HN.js +0 -145
  154. package/dist/rule-builder-BEIjxsE0.js +0 -102
  155. package/dist/template-CS-lExgI.js +0 -236
  156. package/dist/useMarketingMaterialActions-DC0gIyIZ.js +0 -96
  157. package/dist/vue-i18n-Dx-KXojZ.js +0 -2365
@@ -0,0 +1,1923 @@
1
+ import { defineComponent as N, computed as M, resolveComponent as E, openBlock as r, createElementBlock as V, createElementVNode as C, createVNode as v, unref as e, createTextVNode as ne, toDisplayString as A, withCtx as B, onMounted as Z, createBlock as g, createCommentVNode as P, ref as W, watch as pe, Fragment as q, renderList as $, normalizeClass as K, resolveDynamicComponent as me, onBeforeMount as ce, isRef as fe, createSlots as ye } from "vue";
2
+ import { n as ge, C as _e, q as ke, f as Ee, r as he } from "./index-B6kU3PkV.js";
3
+ import { R as Y, i as Se } from "./index-D0JK99Ko.js";
4
+ import { useDialog as ue, useDialogChild as ve, useSnackbar as Ve } from "@feedmepos/ui-library";
5
+ import { u as G } from "./vue-i18n-DWGiC_vs.js";
6
+ import { a as Te, R as D, S as Fe, C as j, g as xe, W as Re, T as ie, O as de } from "./rule-BgJnPjkI.js";
7
+ import { p as Ue } from "./plugins-CUsr9vB0.js";
8
+ import { h as ae } from "./moment-D7p2TMB-.js";
9
+ import { z as Ce, S as Ye } from "./app-CgimGODl.js";
10
+ import { u as X } from "./membership-BZmljFhF.js";
11
+ import { u as te } from "./business-Bu5TqSA0.js";
12
+ import "./index-LygS9WsG.js";
13
+ import { _ as O } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
14
+ import { c as be } from "./object-BYyQ0PZp.js";
15
+ import { Z as le } from "./zod-CPwjOxvW.js";
16
+ import "./index-DqGs6RJG.js";
17
+ import "./index-DKxN1mMS.js";
18
+ import "./index-CuREApMc.js";
19
+ import "./index-C-iwb2Ln.js";
20
+ import "./index-CIej31pF.js";
21
+ const Oe = { class: "flex items-center justify-between" }, we = { class: "flex items-center gap-8 xs:flex-wrap" }, De = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, qe = /* @__PURE__ */ N({
22
+ __name: "RuleEntry",
23
+ props: {
24
+ modelValue: {
25
+ type: Object,
26
+ required: !0
27
+ }
28
+ },
29
+ emits: ["edit", "remove"],
30
+ setup(l, { emit: R }) {
31
+ const _ = l, m = M(() => {
32
+ const [d, o] = Object.entries(_.modelValue.conditions)[0];
33
+ return {
34
+ negated: _.modelValue.negated == !0,
35
+ property: _.modelValue.property,
36
+ operator: d,
37
+ equator: o
38
+ };
39
+ }), f = R, n = M(
40
+ () => Te(
41
+ m.value.property,
42
+ m.value.operator,
43
+ m.value.equator,
44
+ m.value.negated
45
+ )
46
+ );
47
+ async function t(d) {
48
+ d.stopPropagation(), await Ue.remove("Are you sure you want to remove this rule?") && f("remove", _.modelValue);
49
+ }
50
+ return (d, o) => {
51
+ var k;
52
+ const i = E("FmChip"), p = E("FmTooltip"), b = E("FmIcon");
53
+ return r(), V("div", Oe, [
54
+ C("div", we, [
55
+ v(i, {
56
+ label: (k = e(ge).find((U) => U.property === _.modelValue.property)) == null ? void 0 : k.name,
57
+ class: "!text-fm-color-typo-info !bg-fm-color-system-info-100"
58
+ }, null, 8, ["label"]),
59
+ o[1] || (o[1] = C("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1)),
60
+ C("div", {
61
+ onClick: o[0] || (o[0] = (U) => f("edit", _.modelValue)),
62
+ 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"
63
+ }, [
64
+ ne(A(e(n)[0]) + " ", 1),
65
+ v(p, {
66
+ "z-index": 1e3,
67
+ content: e(n)[1]
68
+ }, {
69
+ default: B(() => [
70
+ C("div", De, A(e(n)[1]), 1)
71
+ ]),
72
+ _: 1
73
+ }, 8, ["content"])
74
+ ])
75
+ ]),
76
+ v(b, {
77
+ name: "close",
78
+ size: "md",
79
+ class: "cursor-pointer hover:bg-neutral-300 rounded-lg",
80
+ onClick: t
81
+ })
82
+ ]);
83
+ };
84
+ }
85
+ });
86
+ Ce.enum([
87
+ "MIN_SPEND",
88
+ "SPECIFIC_DATE",
89
+ "SPECIFIC_TIMERANGE",
90
+ "WEEKLY",
91
+ "MONTHLY",
92
+ "BIRTHDAY",
93
+ "TIER",
94
+ "TITLE",
95
+ "LAST_X_DAY",
96
+ "CUSTOM"
97
+ ]);
98
+ const Be = [
99
+ {
100
+ type: "MIN_SPEND",
101
+ name: "Minimum spend",
102
+ for: ["bill"],
103
+ rules: []
104
+ },
105
+ {
106
+ type: "SPECIFIC_DATE",
107
+ name: "Specific date",
108
+ for: ["trigger"],
109
+ rules: []
110
+ },
111
+ {
112
+ type: "SPECIFIC_TIMERANGE",
113
+ name: "Specific time range",
114
+ for: ["trigger"],
115
+ rules: []
116
+ },
117
+ {
118
+ type: "WEEKLY",
119
+ name: "Weekly",
120
+ for: ["trigger"],
121
+ rules: [
122
+ {
123
+ property: "trigger.date",
124
+ operator: "_rrule",
125
+ equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ type: "MONTHLY",
131
+ name: "Monthly",
132
+ for: ["trigger"],
133
+ rules: [
134
+ {
135
+ property: "trigger.date",
136
+ operator: "_rrule",
137
+ equator: "RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ type: "BIRTHDAY",
143
+ name: "Birthday",
144
+ for: ["user"],
145
+ rules: [
146
+ {
147
+ property: "user.birthday",
148
+ operator: "_isRange",
149
+ equator: {
150
+ op: "this",
151
+ unit: "day",
152
+ ignoreYear: !0
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ type: "BIRTHDAY",
159
+ name: "Birthday Week",
160
+ for: ["user"],
161
+ rules: [
162
+ {
163
+ property: "user.birthday",
164
+ operator: "_isRange",
165
+ equator: {
166
+ op: "this",
167
+ unit: "week",
168
+ ignoreYear: !0
169
+ }
170
+ }
171
+ ]
172
+ },
173
+ {
174
+ type: "BIRTHDAY",
175
+ name: "Birthday Month",
176
+ for: ["user"],
177
+ rules: [
178
+ {
179
+ property: "user.birthday",
180
+ operator: "_isRange",
181
+ equator: {
182
+ op: "this",
183
+ unit: "month",
184
+ ignoreYear: !0
185
+ }
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ type: "BIRTHDAY",
191
+ name: "N day before birthday",
192
+ for: ["user"],
193
+ rules: [
194
+ {
195
+ property: "user.birthday",
196
+ operator: "_isDay",
197
+ equator: {
198
+ op: "before",
199
+ x: 1,
200
+ ignoreYear: !0
201
+ }
202
+ }
203
+ ]
204
+ },
205
+ {
206
+ type: "TIER",
207
+ name: "Specific tier",
208
+ for: ["user"],
209
+ rules: [
210
+ {
211
+ property: "user.tier",
212
+ operator: "_equal",
213
+ equator: 1
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ type: "TITLE",
219
+ name: "Specific title",
220
+ for: ["user"],
221
+ rules: [
222
+ {
223
+ property: "user.titles",
224
+ operator: "_hasAny",
225
+ equator: []
226
+ }
227
+ ]
228
+ },
229
+ {
230
+ type: "LAST_X_DAY",
231
+ name: "Last visit in X days",
232
+ for: ["user"],
233
+ rules: [
234
+ {
235
+ property: "user.stats.lastVisit",
236
+ operator: "_isRange",
237
+ equator: {
238
+ op: "last",
239
+ unit: "day",
240
+ ignoreYear: !0,
241
+ x: 0
242
+ }
243
+ }
244
+ ],
245
+ premium: !0
246
+ },
247
+ {
248
+ type: "CUSTOM",
249
+ name: "Weekday special",
250
+ for: ["trigger"],
251
+ rules: [
252
+ {
253
+ property: "trigger.date",
254
+ operator: "_rrule",
255
+ equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=MO,TU,WE,TH,FR;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
256
+ }
257
+ ]
258
+ },
259
+ {
260
+ type: "CUSTOM",
261
+ name: "Weekend special",
262
+ for: ["trigger"],
263
+ rules: [
264
+ {
265
+ property: "trigger.date",
266
+ operator: "_rrule",
267
+ equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU,SA;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ type: "CUSTOM",
273
+ name: "Happy hour",
274
+ for: ["trigger"],
275
+ rules: [
276
+ {
277
+ property: "trigger.time",
278
+ operator: "_isBetweenTime",
279
+ equator: [
280
+ {
281
+ start: "21:00",
282
+ end: "23:59"
283
+ }
284
+ ]
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ type: "CUSTOM",
290
+ name: "Mother's day special",
291
+ for: ["trigger"],
292
+ rules: [
293
+ {
294
+ property: "trigger.date",
295
+ operator: "_rrule",
296
+ equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+2SU;BYMONTH=5;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ type: "CUSTOM",
302
+ name: "Father's day special",
303
+ for: ["trigger"],
304
+ rules: [
305
+ {
306
+ property: "trigger.date",
307
+ operator: "_rrule",
308
+ equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+3SU;BYMONTH=6;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ type: "CUSTOM",
314
+ name: "Christmas",
315
+ for: ["trigger"],
316
+ rules: [
317
+ {
318
+ property: "trigger.date",
319
+ operator: "_rrule",
320
+ equator: "RRULE:FREQ=YEARLY;WKST=SU;BYMONTH=12;BYMONTHDAY=25;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
321
+ }
322
+ ]
323
+ },
324
+ {
325
+ type: "CUSTOM",
326
+ name: "Feedback rating",
327
+ for: ["feedback"],
328
+ rules: [
329
+ {
330
+ property: "feedback.rating",
331
+ operator: "_lessThanOrEqual",
332
+ equator: 5
333
+ }
334
+ ]
335
+ },
336
+ {
337
+ type: "CUSTOM",
338
+ name: "Custom",
339
+ for: ["trigger", "user", "bill", "feedback"],
340
+ rules: [
341
+ {
342
+ property: "trigger.date",
343
+ operator: "_isOnDate",
344
+ equator: ae().format("YYYY-MM-DD")
345
+ }
346
+ ]
347
+ }
348
+ ], Me = { class: "flex flex-nowrap gap-x-4 items-center" }, Ie = /* @__PURE__ */ N({
349
+ __name: "IsDayInput",
350
+ props: {
351
+ modelValue: {
352
+ type: Object
353
+ }
354
+ },
355
+ emits: ["update:model-value"],
356
+ setup(l, { emit: R }) {
357
+ const { t: _ } = G(), m = l, f = R;
358
+ Z(() => {
359
+ m.modelValue || f("update:model-value", {
360
+ op: "before",
361
+ x: 1
362
+ });
363
+ });
364
+ function n(t) {
365
+ const d = be(
366
+ m.modelValue ?? {
367
+ op: "before",
368
+ x: 1
369
+ }
370
+ );
371
+ f("update:model-value", {
372
+ ...d,
373
+ ...t
374
+ });
375
+ }
376
+ return (t, d) => {
377
+ var i, p, b;
378
+ const o = E("FmStepperField");
379
+ return r(), V("div", Me, [
380
+ v(o, {
381
+ class: "w-1/3",
382
+ "model-value": ((i = l.modelValue) == null ? void 0 : i.x) ?? null,
383
+ max: 365,
384
+ "show-steppers": !1,
385
+ "append-text": "days",
386
+ "onUpdate:modelValue": d[0] || (d[0] = (k) => n({ x: k }))
387
+ }, null, 8, ["model-value"]),
388
+ v(O, {
389
+ "model-value": ((p = l.modelValue) == null ? void 0 : p.op) ?? void 0,
390
+ items: [
391
+ {
392
+ label: e(_)("connect.template.rule.is_day.before"),
393
+ value: "before"
394
+ },
395
+ { label: e(_)("connect.template.rule.is_day.after"), value: "after" }
396
+ ],
397
+ "onUpdate:modelValue": d[1] || (d[1] = (k) => n({ op: k }))
398
+ }, null, 8, ["model-value", "items"]),
399
+ v(O, {
400
+ "model-value": ((b = l.modelValue) == null ? void 0 : b.ignoreYear) ?? !1,
401
+ items: [
402
+ {
403
+ label: e(_)("connect.template.rule.is_day.same_year"),
404
+ value: !1
405
+ },
406
+ {
407
+ label: e(_)("connect.template.rule.is_day.ignore_year"),
408
+ value: !0
409
+ }
410
+ ],
411
+ required: !0,
412
+ "onUpdate:modelValue": d[2] || (d[2] = (k) => n({ ignoreYear: k == !0 }))
413
+ }, null, 8, ["model-value", "items"])
414
+ ]);
415
+ };
416
+ }
417
+ }), Ae = { class: "grid grid-cols-4 gap-x-4 items-center" }, Pe = /* @__PURE__ */ N({
418
+ __name: "IsRangeInput",
419
+ props: {
420
+ modelValue: {
421
+ type: Object,
422
+ default: () => ({
423
+ op: "this",
424
+ unit: "day",
425
+ ignoreYear: !0
426
+ })
427
+ }
428
+ },
429
+ emits: ["update:model-value"],
430
+ setup(l, { emit: R }) {
431
+ const { t: _ } = G(), m = l, f = R;
432
+ Z(() => {
433
+ m.modelValue || f("update:model-value", {
434
+ op: "this",
435
+ unit: "day",
436
+ ignoreYear: !0
437
+ });
438
+ });
439
+ const n = [
440
+ { label: _("connect.template.rule.is_range.duration.day"), value: "day" },
441
+ { label: _("connect.template.rule.is_range.duration.week"), value: "week" },
442
+ {
443
+ label: _("connect.template.rule.is_range.duration.month"),
444
+ value: "month"
445
+ },
446
+ {
447
+ label: _("connect.template.rule.is_range.duration.quarter"),
448
+ value: "quarter"
449
+ },
450
+ { label: _("connect.template.rule.is_range.duration.year"), value: "year" }
451
+ ], t = [
452
+ {
453
+ label: _("connect.template.rule.is_range.op.this"),
454
+ value: "this"
455
+ },
456
+ {
457
+ label: _("connect.template.rule.is_range.op.last"),
458
+ value: "last"
459
+ },
460
+ {
461
+ label: _("connect.template.rule.is_range.op.next"),
462
+ value: "next"
463
+ }
464
+ ];
465
+ return (d, o) => {
466
+ var p, b, k, U, w;
467
+ const i = E("FmStepperField");
468
+ return r(), V("div", Ae, [
469
+ v(O, {
470
+ "model-value": (p = l.modelValue) == null ? void 0 : p.op,
471
+ label: "",
472
+ items: t,
473
+ required: !0,
474
+ "onUpdate:modelValue": o[0] || (o[0] = (c) => f("update:model-value", { op: c, unit: "day", ignoreYear: !1 }))
475
+ }, null, 8, ["model-value"]),
476
+ ((b = l.modelValue) == null ? void 0 : b.op) != "this" ? (r(), g(i, {
477
+ key: 0,
478
+ "model-value": ((k = l.modelValue) == null ? void 0 : k.x) || 0,
479
+ max: 365,
480
+ "show-steppers": !1,
481
+ "onUpdate:modelValue": o[1] || (o[1] = (c) => f("update:model-value", {
482
+ op: l.modelValue.op,
483
+ unit: l.modelValue.unit,
484
+ ignoreYear: l.modelValue.ignoreYear == !0,
485
+ x: c
486
+ }))
487
+ }, null, 8, ["model-value"])) : P("", !0),
488
+ v(O, {
489
+ "model-value": (U = l.modelValue) == null ? void 0 : U.unit,
490
+ label: "",
491
+ items: n,
492
+ required: !0,
493
+ "onUpdate:modelValue": o[2] || (o[2] = (c) => f("update:model-value", { ...m.modelValue, unit: c }))
494
+ }, null, 8, ["model-value"]),
495
+ v(O, {
496
+ label: "",
497
+ "model-value": (w = l.modelValue) == null ? void 0 : w.ignoreYear,
498
+ items: [
499
+ { label: "same", value: !1 },
500
+ { label: "ignore", value: !0 }
501
+ ],
502
+ required: !0,
503
+ "onUpdate:modelValue": o[3] || (o[3] = (c) => f("update:model-value", {
504
+ ...m.modelValue,
505
+ ignoreYear: c == !0
506
+ }))
507
+ }, null, 8, ["model-value"])
508
+ ]);
509
+ };
510
+ }
511
+ }), Ne = { class: "space-y-8" }, Le = { class: "text-fm-color-primary rounded-md border-dashed border-2 p-8" }, $e = {
512
+ key: 0,
513
+ class: "flex items-center gap-8"
514
+ }, He = { class: "flex gap-4" }, We = {
515
+ key: 0,
516
+ class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
517
+ }, je = ["onClick"], Ke = {
518
+ key: 1,
519
+ class: "flex items-center gap-8"
520
+ }, Ge = { class: "flex gap-4 xs:gap-[2px]" }, Qe = { class: "grid grid-cols-6 gap-8" }, ze = {
521
+ key: 0,
522
+ class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
523
+ }, Xe = ["onClick"], Ze = {
524
+ key: 1,
525
+ class: "grid grid-cols-2 items-center gap-8"
526
+ }, Je = { class: "flex gap-4" }, et = {
527
+ key: 4,
528
+ class: "flex items-center justify-end gap-8"
529
+ }, re = /* @__PURE__ */ N({
530
+ __name: "RruleInput",
531
+ props: {
532
+ modelValue: {
533
+ type: String
534
+ },
535
+ startDate: {
536
+ type: Object
537
+ },
538
+ applyButton: {
539
+ type: Boolean
540
+ },
541
+ fixedFrequency: {
542
+ type: Boolean
543
+ }
544
+ },
545
+ emits: ["update:model-value", "cancel"],
546
+ setup(l, { emit: R }) {
547
+ const { t: _ } = G(), m = l, f = R;
548
+ function n(o, i) {
549
+ return new D({
550
+ ...o,
551
+ dtstart: xe({
552
+ startDate: m.startDate,
553
+ modelValue: i
554
+ })
555
+ });
556
+ }
557
+ const t = W(
558
+ m.modelValue ? D.fromString(m.modelValue) : n({
559
+ dtstart: m.startDate,
560
+ freq: D.DAILY,
561
+ wkst: D.SU,
562
+ interval: 1,
563
+ byhour: 0,
564
+ byminute: 0,
565
+ bysecond: 0
566
+ })
567
+ );
568
+ function d(o) {
569
+ var i;
570
+ if ("freq" in o)
571
+ switch (o.freq) {
572
+ case D.WEEKLY:
573
+ t.value = n(
574
+ {
575
+ freq: o.freq,
576
+ interval: 1,
577
+ byhour: 0,
578
+ byminute: 0,
579
+ bysecond: 0,
580
+ wkst: D.SU,
581
+ byweekday: [D.MO]
582
+ },
583
+ t.value
584
+ );
585
+ break;
586
+ case D.MONTHLY:
587
+ t.value = n(
588
+ {
589
+ freq: o.freq,
590
+ interval: 1,
591
+ byhour: 0,
592
+ byminute: 0,
593
+ bysecond: 0,
594
+ bymonthday: [(/* @__PURE__ */ new Date()).getDate()],
595
+ wkst: D.SU
596
+ },
597
+ t.value
598
+ );
599
+ break;
600
+ case D.YEARLY:
601
+ t.value = n(
602
+ {
603
+ freq: o.freq,
604
+ interval: 1,
605
+ byhour: 0,
606
+ byminute: 0,
607
+ bysecond: 0,
608
+ wkst: D.SU,
609
+ bymonth: [(/* @__PURE__ */ new Date()).getMonth() + 1],
610
+ bymonthday: [(/* @__PURE__ */ new Date()).getDate()]
611
+ },
612
+ t.value
613
+ );
614
+ break;
615
+ default:
616
+ t.value = n(
617
+ {
618
+ freq: o.freq,
619
+ interval: 1,
620
+ byhour: 0,
621
+ byminute: 0,
622
+ bysecond: 0,
623
+ wkst: D.SU
624
+ },
625
+ t.value
626
+ );
627
+ }
628
+ o.interval && o.interval > 0 && (t.value = n(
629
+ {
630
+ ...t.value.origOptions,
631
+ interval: o.interval
632
+ },
633
+ t.value
634
+ )), "byweekday" in o && o.byweekday && Array.isArray(o.byweekday) && o.byweekday.length > 0 && (t.value.options.bymonthday.length > 0 && t.value.options.freq == D.MONTHLY && (t.value.options.bymonthday = []), t.value = n(
635
+ {
636
+ ...t.value.origOptions,
637
+ bymonthday: [],
638
+ byweekday: o.byweekday
639
+ },
640
+ t.value
641
+ )), "bysetpos" in o && o.bysetpos != null && (t.value = n(
642
+ {
643
+ ...t.value.origOptions,
644
+ bymonthday: [],
645
+ bysetpos: o.bysetpos,
646
+ byweekday: ((i = t.value.options.byweekday) == null ? void 0 : i.length) > 0 ? t.value.options.byweekday : [6]
647
+ },
648
+ t.value
649
+ )), "bymonthday" in o && o.bymonthday && Array.isArray(o.bymonthday) && o.bymonthday.length > 0 && (t.value = n(
650
+ {
651
+ ...t.value.origOptions,
652
+ bysetpos: [],
653
+ byweekday: [],
654
+ bymonthday: o.bymonthday
655
+ },
656
+ t.value
657
+ )), "bymonth" in o && o.bymonth && Array.isArray(o.bymonth) && o.bymonth.length > 0 && (t.value = n(
658
+ {
659
+ ...t.value.origOptions,
660
+ bysetpos: [],
661
+ bymonth: o.bymonth
662
+ },
663
+ t.value
664
+ )), "bynweekday" in o && o.bynweekday && (t.value = n(
665
+ {
666
+ ...t.value.origOptions,
667
+ bysetpos: [],
668
+ byweekday: new Re(
669
+ o.bynweekday[0][0],
670
+ o.bynweekday[0][1]
671
+ )
672
+ },
673
+ t.value
674
+ )), m.applyButton || f("update:model-value", t.value.toString());
675
+ }
676
+ return pe(
677
+ () => m.modelValue,
678
+ (o) => {
679
+ !o || o === t.value.toString() || (t.value = D.fromString(o));
680
+ }
681
+ ), Z(() => {
682
+ m.modelValue || f("update:model-value", t.value.toString());
683
+ }), (o, i) => {
684
+ var w, c, s;
685
+ const p = E("FmStepperField"), b = E("FmChip"), k = E("FmButtonGroup"), U = E("FmButton");
686
+ return r(), V("div", Ne, [
687
+ C("div", Le, A(e(Fe)(e(t).options)), 1),
688
+ l.fixedFrequency ? P("", !0) : (r(), V("div", $e, [
689
+ C("div", null, A(e(_)("connect.template.rule.rrule.repeat_every")), 1),
690
+ v(p, {
691
+ class: "w-[100px]",
692
+ "model-value": e(t).options.interval,
693
+ "onUpdate:modelValue": i[0] || (i[0] = (a) => d({ interval: a > 0 ? a : e(t).options.interval })),
694
+ min: 1
695
+ }, null, 8, ["model-value"]),
696
+ v(O, {
697
+ class: "w-min",
698
+ items: e(j).frequencies,
699
+ "model-value": e(t).origOptions.freq,
700
+ "onUpdate:modelValue": i[1] || (i[1] = (a) => d({ freq: a }))
701
+ }, null, 8, ["items", "model-value"])
702
+ ])),
703
+ e(t).options.freq === e(D).WEEKLY ? (r(), V(q, { key: 1 }, [
704
+ i[8] || (i[8] = C("div", null, "Repeat on", -1)),
705
+ C("div", He, [
706
+ (r(!0), V(q, null, $(e(j).weekdays, (a) => {
707
+ var y;
708
+ return r(), g(b, {
709
+ class: K(["cursor-pointer", `${(y = e(t).options.byweekday) != null && y.includes(a.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
710
+ label: a.label[0],
711
+ key: a.value,
712
+ compact: !0,
713
+ onClick: () => {
714
+ var T, u;
715
+ d({
716
+ byweekday: (T = e(t).options.byweekday) != null && T.includes(a.value) ? ((u = e(t).options.byweekday) == null ? void 0 : u.filter((x) => x !== a.value)) || [] : [...e(t).options.byweekday || [], a.value]
717
+ });
718
+ }
719
+ }, null, 8, ["class", "label", "onClick"]);
720
+ }), 128))
721
+ ])
722
+ ], 64)) : P("", !0),
723
+ e(t).options.freq == e(D).MONTHLY ? (r(), V(q, { key: 2 }, [
724
+ v(k, {
725
+ "model-value": e(t).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
726
+ items: [
727
+ {
728
+ label: "Each"
729
+ },
730
+ {
731
+ label: "On the"
732
+ }
733
+ ],
734
+ "onUpdate:modelValue": i[2] || (i[2] = (a) => {
735
+ a.label == "Each" ? d({ bymonthday: [1] }) : d({ bysetpos: 1 });
736
+ })
737
+ }, null, 8, ["model-value"]),
738
+ e(t).options.bymonthday.length > 0 ? (r(), V("div", We, [
739
+ (r(!0), V(q, null, $(e(j).dates, (a) => (r(), V("div", {
740
+ key: a.value,
741
+ class: K(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(t).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" : ""}`]),
742
+ onClick: (y) => d({
743
+ bymonthday: e(t).options.bymonthday.includes(a.value) ? e(t).options.bymonthday.filter((T) => T !== a.value) : [...e(t).options.bymonthday, a.value]
744
+ })
745
+ }, A(a.value), 11, je))), 128))
746
+ ])) : (r(), V("div", Ke, [
747
+ v(O, {
748
+ items: e(j).ordinals,
749
+ "model-value": (w = e(t).options.bysetpos) == null ? void 0 : w[0],
750
+ "onUpdate:modelValue": i[3] || (i[3] = (a) => d({ bysetpos: a }))
751
+ }, null, 8, ["items", "model-value"]),
752
+ C("div", Ge, [
753
+ (r(!0), V(q, null, $(e(j).weekdays, (a) => {
754
+ var y;
755
+ return r(), g(b, {
756
+ class: K(["cursor-pointer", `${(y = e(t).options.byweekday) != null && y.includes(a.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
757
+ label: a.label[0],
758
+ key: a.value,
759
+ compact: !0,
760
+ onClick: () => {
761
+ d({
762
+ byweekday: [a.value]
763
+ });
764
+ }
765
+ }, null, 8, ["class", "label", "onClick"]);
766
+ }), 128))
767
+ ])
768
+ ]))
769
+ ], 64)) : P("", !0),
770
+ e(t).options.freq == e(D).YEARLY ? (r(), V(q, { key: 3 }, [
771
+ i[9] || (i[9] = C("div", null, "Month", -1)),
772
+ C("div", Qe, [
773
+ (r(!0), V(q, null, $(e(j).months, (a) => {
774
+ var y, T;
775
+ return r(), g(b, {
776
+ key: a.value,
777
+ class: K(["cursor-pointer", {
778
+ "bg-fm-color-primary text-white": (y = e(t).options.bymonth) == null ? void 0 : y.includes(
779
+ a.value
780
+ ),
781
+ "bg-fm-color-gray-200 text-fm-color-gray-800": !((T = e(t).options.bymonth) != null && T.includes(a.value))
782
+ }]),
783
+ label: a.shortName,
784
+ compact: !0,
785
+ onClick: (u) => d({
786
+ bymonth: (e(t).options.bymonth ?? []).includes(a.value) ? (e(t).options.bymonth ?? []).filter((x) => x !== a.value) : [...e(t).options.bymonth ?? [], a.value]
787
+ })
788
+ }, null, 8, ["class", "label", "onClick"]);
789
+ }), 128))
790
+ ]),
791
+ v(k, {
792
+ "model-value": e(t).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
793
+ items: [
794
+ {
795
+ label: "Each"
796
+ },
797
+ {
798
+ label: "On the"
799
+ }
800
+ ],
801
+ "onUpdate:modelValue": i[4] || (i[4] = (a) => {
802
+ a.label == "Each" ? d({
803
+ bymonthday: [1],
804
+ bymonth: e(t).options.bymonth ?? [1]
805
+ }) : d({
806
+ byweekday: [e(D).SU.nth(1)],
807
+ bymonth: e(t).options.bymonth ?? [1]
808
+ });
809
+ })
810
+ }, null, 8, ["model-value"]),
811
+ e(t).options.bymonthday.length > 0 ? (r(), V("div", ze, [
812
+ (r(!0), V(q, null, $(Array(31).fill(null).map((a, y) => y + 1), (a) => (r(), V("div", {
813
+ key: a,
814
+ class: K(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(t).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" : ""}`]),
815
+ onClick: (y) => d({
816
+ bymonthday: e(t).options.bymonthday.includes(a) ? e(t).options.bymonthday.filter((T) => T !== a) : [...e(t).options.bymonthday, a]
817
+ })
818
+ }, A(a), 11, Xe))), 128))
819
+ ])) : (r(), V("div", Ze, [
820
+ v(O, {
821
+ items: e(j).ordinals,
822
+ "model-value": (s = (c = e(t).options.bynweekday) == null ? void 0 : c[0]) == null ? void 0 : s[1],
823
+ "onUpdate:modelValue": i[5] || (i[5] = (a) => {
824
+ var y, T;
825
+ return d({
826
+ bynweekday: [[((T = (y = e(t).options.bynweekday) == null ? void 0 : y[0]) == null ? void 0 : T[0]) ?? 1, a]]
827
+ });
828
+ })
829
+ }, null, 8, ["items", "model-value"]),
830
+ C("div", Je, [
831
+ (r(!0), V(q, null, $(e(j).weekdays, (a) => {
832
+ var y, T;
833
+ return r(), g(b, {
834
+ class: K(["cursor-pointer", `${((T = (y = e(t).options.bynweekday) == null ? void 0 : y[0]) == null ? void 0 : T[0]) === a.value ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
835
+ label: a.label[0],
836
+ key: a.value,
837
+ compact: !0,
838
+ onClick: () => {
839
+ var u, x;
840
+ d({
841
+ bynweekday: [
842
+ [a.value, ((x = (u = e(t).options.bynweekday) == null ? void 0 : u[0]) == null ? void 0 : x[1]) ?? 1]
843
+ ]
844
+ });
845
+ }
846
+ }, null, 8, ["class", "label", "onClick"]);
847
+ }), 128))
848
+ ])
849
+ ]))
850
+ ], 64)) : P("", !0),
851
+ l.applyButton ? (r(), V("div", et, [
852
+ v(U, {
853
+ label: "Cancel",
854
+ variant: "tertiary",
855
+ onClick: i[6] || (i[6] = (a) => f("cancel"))
856
+ }),
857
+ v(U, {
858
+ label: "Apply",
859
+ onClick: i[7] || (i[7] = (a) => f("update:model-value", e(t).toString()))
860
+ })
861
+ ])) : P("", !0)
862
+ ]);
863
+ };
864
+ }
865
+ }), tt = { class: "grid grid-cols-4 gap-8 w-full flex-wrap py-16" }, lt = /* @__PURE__ */ N({
866
+ __name: "IsInMonthInput",
867
+ props: {
868
+ modelValue: {
869
+ type: Object,
870
+ required: !0
871
+ }
872
+ },
873
+ emits: ["update:model-value"],
874
+ setup(l, { emit: R }) {
875
+ const _ = l, m = R, f = ae.months().map((n, t) => ({
876
+ name: n,
877
+ shortName: ae().month(t).format("MMM"),
878
+ value: t
879
+ }));
880
+ return Z(() => {
881
+ _.modelValue || m("update:model-value", []);
882
+ }), (n, t) => {
883
+ const d = E("FmChip");
884
+ return r(), V("div", tt, [
885
+ (r(!0), V(q, null, $(e(f), (o) => {
886
+ var i, p;
887
+ return r(), g(d, {
888
+ class: K(["cursor-pointer", {
889
+ "bg-fm-color-primary text-white": (i = l.modelValue) == null ? void 0 : i.includes(o.value),
890
+ "bg-fm-color-gray-200 text-fm-color-gray-800": !((p = l.modelValue) != null && p.includes(
891
+ o.value
892
+ ))
893
+ }]),
894
+ label: o.name,
895
+ key: o.value,
896
+ compact: !0,
897
+ onClick: (b) => m(
898
+ "update:model-value",
899
+ l.modelValue.includes(o.value) ? l.modelValue.filter((k) => k !== o.value) : [...l.modelValue, o.value]
900
+ )
901
+ }, null, 8, ["class", "label", "onClick"]);
902
+ }), 128))
903
+ ]);
904
+ };
905
+ }
906
+ }), ot = { class: "flex justify-end gap-8 w-full" }, at = /* @__PURE__ */ N({
907
+ __name: "MenuDialog",
908
+ props: {
909
+ modelValue: { type: Boolean },
910
+ initialValue: {},
911
+ filterItems: { type: Function }
912
+ },
913
+ emits: ["update:model-value", "confirm"],
914
+ setup(l, { emit: R }) {
915
+ const _ = l, m = W([]), f = W(!1), n = R;
916
+ function t() {
917
+ n("confirm", m.value), d();
918
+ }
919
+ function d() {
920
+ n("update:model-value", !1);
921
+ }
922
+ return pe(
923
+ () => _.modelValue,
924
+ (o) => {
925
+ f.value = o;
926
+ }
927
+ ), Z(() => {
928
+ f.value = _.modelValue;
929
+ }), (o, i) => {
930
+ const p = E("FmButton"), b = E("FmDialog");
931
+ return r(), g(b, {
932
+ "content-scrollable": !1,
933
+ contentClass: "pt-0",
934
+ modelValue: f.value,
935
+ "onUpdate:modelValue": i[1] || (i[1] = (k) => f.value = k),
936
+ title: "Select Items",
937
+ "close-button": !1
938
+ }, {
939
+ "dialog-header": B(() => [...i[2] || (i[2] = [
940
+ C("div", null, "Select Item", -1)
941
+ ])]),
942
+ "dialog-footer": B(() => [
943
+ C("div", ot, [
944
+ v(p, {
945
+ variant: "tertiary",
946
+ onClick: d,
947
+ label: "Cancel"
948
+ }),
949
+ v(p, {
950
+ variant: "primary",
951
+ onClick: t,
952
+ label: "Confirm"
953
+ })
954
+ ])
955
+ ]),
956
+ default: B(() => [
957
+ v(e(Ye), {
958
+ "initial-value": l.initialValue,
959
+ "filter-items": l.filterItems,
960
+ "max-height": 380,
961
+ onChange: i[0] || (i[0] = (k) => m.value = k)
962
+ }, null, 8, ["initial-value", "filter-items"])
963
+ ]),
964
+ _: 1
965
+ }, 8, ["modelValue"]);
966
+ };
967
+ }
968
+ }), rt = { id: "select-menu" }, nt = /* @__PURE__ */ N({
969
+ __name: "SelectMenu",
970
+ props: {
971
+ modelValue: {}
972
+ },
973
+ emits: ["update:model-value"],
974
+ setup(l, { emit: R }) {
975
+ const _ = l, m = W(!1), f = M(() => {
976
+ var d;
977
+ return ((d = _.modelValue) == null ? void 0 : d.length) || 0;
978
+ }), n = R;
979
+ function t(d) {
980
+ n("update:model-value", d);
981
+ }
982
+ return (d, o) => {
983
+ const i = E("FmField");
984
+ return r(), V("div", rt, [
985
+ v(i, {
986
+ class: "text-fm-color-typo-tertiary",
987
+ onClick: o[0] || (o[0] = (p) => m.value = !0)
988
+ }, {
989
+ default: B(() => [
990
+ ne(A(f.value) + " item(s) selected ", 1)
991
+ ]),
992
+ _: 1
993
+ }),
994
+ v(at, {
995
+ modelValue: m.value,
996
+ "onUpdate:modelValue": [
997
+ o[1] || (o[1] = (p) => m.value = p),
998
+ o[2] || (o[2] = (p) => m.value = p)
999
+ ],
1000
+ "initial-value": l.modelValue,
1001
+ onConfirm: t
1002
+ }, null, 8, ["modelValue", "initial-value"])
1003
+ ]);
1004
+ };
1005
+ }
1006
+ }), ut = {
1007
+ key: 19,
1008
+ class: "fm-typo-en-body-lg-600"
1009
+ }, st = /* @__PURE__ */ N({
1010
+ __name: "RuleEquator",
1011
+ props: {
1012
+ type: {
1013
+ type: String,
1014
+ required: !0
1015
+ },
1016
+ operator: {
1017
+ type: String,
1018
+ required: !0
1019
+ },
1020
+ modelValue: {
1021
+ type: Object
1022
+ }
1023
+ },
1024
+ emits: ["update:model-value"],
1025
+ setup(l, { emit: R }) {
1026
+ const _ = l, m = R, f = M(() => {
1027
+ const n = _e[_.operator].safeParse(_.modelValue);
1028
+ return n.success ? [] : n.error.errors;
1029
+ });
1030
+ return (n, t) => {
1031
+ var w, c, s, a, y, T;
1032
+ const d = E("FmTextField"), o = E("FmStepperField"), i = E("FmSimpleDatePicker"), p = E("FmSimpleDateRangePicker"), b = E("FmTimeRangePicker"), k = E("FmTimePicker"), U = E("FmHelperText");
1033
+ return r(), V("div", {
1034
+ class: K({ "pb-4": e(f).length })
1035
+ }, [
1036
+ l.type === "text" ? (r(), g(d, {
1037
+ key: 0,
1038
+ "model-value": l.modelValue,
1039
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => m("update:model-value", u))
1040
+ }, null, 8, ["model-value"])) : l.type === "number" ? (r(), g(o, {
1041
+ key: 1,
1042
+ "model-value": l.modelValue,
1043
+ "onUpdate:modelValue": t[1] || (t[1] = (u) => m("update:model-value", u))
1044
+ }, null, 8, ["model-value"])) : l.operator == "_isDay" ? (r(), g(me(Ie), {
1045
+ key: 2,
1046
+ "model-value": l.modelValue,
1047
+ "onUpdate:modelValue": t[2] || (t[2] = (u) => m("update:model-value", u))
1048
+ }, null, 8, ["model-value"])) : l.operator == "_isRange" ? (r(), g(me(Pe), {
1049
+ key: 3,
1050
+ "model-value": l.modelValue,
1051
+ "onUpdate:modelValue": t[3] || (t[3] = (u) => m("update:model-value", u))
1052
+ }, null, 8, ["model-value"])) : l.operator == "_isOnDate" ? (r(), g(i, {
1053
+ key: 4,
1054
+ "model-value": l.modelValue,
1055
+ "onUpdate:modelValue": t[4] || (t[4] = (u) => m("update:model-value", u))
1056
+ }, null, 8, ["model-value"])) : l.operator == "_isBetween" ? (r(), g(p, {
1057
+ key: 5,
1058
+ "model-value": {
1059
+ startDate: (w = l.modelValue) == null ? void 0 : w.start,
1060
+ endDate: (c = l.modelValue) == null ? void 0 : c.end
1061
+ },
1062
+ "onUpdate:modelValue": t[5] || (t[5] = (u) => {
1063
+ m("update:model-value", {
1064
+ start: u.startDate,
1065
+ end: u.endDate
1066
+ });
1067
+ })
1068
+ }, null, 8, ["model-value"])) : l.operator == "_isInMonth" ? (r(), g(lt, {
1069
+ key: 6,
1070
+ "model-value": l.modelValue,
1071
+ "onUpdate:modelValue": t[6] || (t[6] = (u) => m("update:model-value", u))
1072
+ }, null, 8, ["model-value"])) : l.operator == "_rrule" ? (r(), g(re, {
1073
+ key: 7,
1074
+ "model-value": l.modelValue,
1075
+ "onUpdate:modelValue": t[7] || (t[7] = (u) => m("update:model-value", u))
1076
+ }, null, 8, ["model-value"])) : l.operator == "_isBetweenTime" ? (r(), g(b, {
1077
+ key: 8,
1078
+ "disable-time-check": !0,
1079
+ "model-value": [(a = (s = l.modelValue) == null ? void 0 : s[0]) == null ? void 0 : a.start, (T = (y = l.modelValue) == null ? void 0 : y[0]) == null ? void 0 : T.end],
1080
+ "onUpdate:modelValue": t[8] || (t[8] = (u) => m("update:model-value", [
1081
+ {
1082
+ start: u[0],
1083
+ end: u[1]
1084
+ }
1085
+ ]))
1086
+ }, null, 8, ["model-value"])) : l.operator == "_isOnTime" ? (r(), g(k, {
1087
+ key: 9,
1088
+ "model-value": l.modelValue,
1089
+ "onUpdate:modelValue": t[9] || (t[9] = (u) => m("update:model-value", u))
1090
+ }, null, 8, ["model-value"])) : l.type == "tier" ? (r(), g(O, {
1091
+ key: 10,
1092
+ items: (e(X)().sortedTiers ?? []).map((u, x) => ({
1093
+ label: `Tier ${x + 1} - ${u.name}`,
1094
+ value: x + 1
1095
+ })),
1096
+ "model-value": l.modelValue,
1097
+ "onUpdate:modelValue": t[10] || (t[10] = (u) => m("update:model-value", u))
1098
+ }, null, 8, ["items", "model-value"])) : l.type == "boolean" ? (r(), g(O, {
1099
+ key: 11,
1100
+ multiselect: !0,
1101
+ items: [
1102
+ { label: "true", value: !0 },
1103
+ { label: "false", value: !1 }
1104
+ ],
1105
+ "model-value": l.modelValue ?? [],
1106
+ "onUpdate:modelValue": t[11] || (t[11] = (u) => m("update:model-value", u))
1107
+ }, null, 8, ["model-value"])) : l.type == "exist" ? (r(), g(O, {
1108
+ key: 12,
1109
+ items: [
1110
+ { label: "true", value: "true" },
1111
+ { label: "false", value: "false" }
1112
+ ],
1113
+ "model-value": l.modelValue ?? [],
1114
+ "onUpdate:modelValue": t[12] || (t[12] = (u) => m("update:model-value", u))
1115
+ }, null, 8, ["model-value"])) : l.type == "gender" ? (r(), g(O, {
1116
+ key: 13,
1117
+ multiselect: !0,
1118
+ items: [
1119
+ { label: "Male", value: "MALE" },
1120
+ { label: "Female", value: "FEMALE" }
1121
+ ],
1122
+ "model-value": l.modelValue ?? [],
1123
+ "onUpdate:modelValue": t[13] || (t[13] = (u) => m("update:model-value", u))
1124
+ }, null, 8, ["model-value"])) : l.type == "collectible" ? (r(), g(O, {
1125
+ key: 14,
1126
+ multiselect: !0,
1127
+ items: [],
1128
+ "model-value": l.modelValue ?? [],
1129
+ "onUpdate:modelValue": t[14] || (t[14] = (u) => m("update:model-value", u))
1130
+ }, null, 8, ["model-value"])) : l.type == "segment" ? (r(), g(O, {
1131
+ key: 15,
1132
+ multiselect: !0,
1133
+ items: e(X)().segmentOptions,
1134
+ "model-value": l.modelValue ?? [],
1135
+ "onUpdate:modelValue": t[15] || (t[15] = (u) => m("update:model-value", u)),
1136
+ label: "Select segment(s) to match"
1137
+ }, null, 8, ["items", "model-value"])) : l.type == "title" ? (r(), g(O, {
1138
+ key: 16,
1139
+ multiselect: !0,
1140
+ items: (e(X)().sortedTitles ?? []).map((u) => ({
1141
+ label: u.name,
1142
+ value: u._id
1143
+ })),
1144
+ "model-value": l.modelValue ?? [],
1145
+ "onUpdate:modelValue": t[16] || (t[16] = (u) => m("update:model-value", u))
1146
+ }, null, 8, ["items", "model-value"])) : l.type == "product" ? (r(), g(nt, {
1147
+ key: 17,
1148
+ "model-value": l.modelValue,
1149
+ "onUpdate:modelValue": t[17] || (t[17] = (u) => m("update:model-value", u))
1150
+ }, null, 8, ["model-value"])) : l.type == "location" ? (r(), g(O, {
1151
+ key: 18,
1152
+ multiselect: !0,
1153
+ items: e(te)().locations.map((u) => ({
1154
+ label: u.name,
1155
+ value: u._id
1156
+ })),
1157
+ "model-value": l.modelValue ?? [],
1158
+ "onUpdate:modelValue": t[18] || (t[18] = (u) => m("update:model-value", u))
1159
+ }, null, 8, ["items", "model-value"])) : (r(), V("div", ut, "Rule: " + A(l.type) + " Not implemented", 1)),
1160
+ v(U, {
1161
+ class: "items-end",
1162
+ state: e(le).helperState(e(f), ""),
1163
+ text: e(le).helperText(e(f), "")
1164
+ }, null, 8, ["state", "text"])
1165
+ ], 2);
1166
+ };
1167
+ }
1168
+ }), mt = { class: "space-y-4" }, it = { class: "fm-typo-en-body-lg-400" }, dt = { class: "fm-typo-en-body-lg-400" }, pt = { class: "flex items-center gap-8" }, ct = { class: "fm-typo-en-body-lg-400" }, yt = { class: "flex items-center justify-end gap-8 pt-16 w-full" }, vt = /* @__PURE__ */ N({
1169
+ __name: "CustomRuleDialog",
1170
+ props: {
1171
+ triggerType: {
1172
+ type: String,
1173
+ required: !0
1174
+ },
1175
+ includeOnly: {
1176
+ type: String
1177
+ },
1178
+ allowSeasonEarned: {
1179
+ type: Boolean,
1180
+ default: !1
1181
+ },
1182
+ modelValue: {
1183
+ type: Object,
1184
+ default: () => {
1185
+ }
1186
+ }
1187
+ },
1188
+ setup(l) {
1189
+ const R = ue(), _ = X(), { emitData: m, emitAction: f } = ve(), { t: n } = G(), t = {
1190
+ "user.member": "connect.template.rule.custom_modal.properties.user_member",
1191
+ "user.parentReferralCode": "connect.template.rule.custom_modal.properties.user_parent_referral_code",
1192
+ "user.name": "connect.template.rule.custom_modal.properties.user_name",
1193
+ "user.phoneNumber": "connect.template.rule.custom_modal.properties.user_phone_number",
1194
+ "user.email": "connect.template.rule.custom_modal.properties.user_email",
1195
+ "user.birthday": "connect.template.rule.custom_modal.properties.user_birthday",
1196
+ "user.joinAt": "connect.template.rule.custom_modal.properties.user_join_at",
1197
+ "user.location": "connect.template.rule.custom_modal.properties.user_location",
1198
+ "user.gender": "connect.template.rule.custom_modal.properties.user_gender",
1199
+ "user.titles": "connect.template.rule.custom_modal.properties.user_titles",
1200
+ "user.point": "connect.template.rule.custom_modal.properties.user_point",
1201
+ "user.tier": "connect.template.rule.custom_modal.properties.user_tier",
1202
+ "user.segment": "connect.template.rule.custom_modal.properties.user_segment",
1203
+ "user.stats.avgBillSize": "connect.template.rule.custom_modal.properties.user_stats_avg_bill_size",
1204
+ "user.stats.avgVisitFrequency": "connect.template.rule.custom_modal.properties.user_stats_avg_visit_frequency",
1205
+ "user.stats.feedbackCount": "connect.template.rule.custom_modal.properties.user_stats_feedback_count",
1206
+ "user.stats.lastVisit": "connect.template.rule.custom_modal.properties.user_stats_last_visit",
1207
+ "user.stats.topupCount": "connect.template.rule.custom_modal.properties.user_stats_topup_count",
1208
+ "user.stats.visitCount": "connect.template.rule.custom_modal.properties.user_stats_visit_count",
1209
+ "user.stats.lastSeasonPointEarned": "connect.template.rule.custom_modal.properties.user_stats_last_season_point_earned",
1210
+ "user.stats.lastSeasonTierEarned": "connect.template.rule.custom_modal.properties.user_stats_last_season_tier_earned",
1211
+ "user.expiringVouchers.days7": "connect.template.rule.custom_modal.properties.user_expiring_vouchers_days_7",
1212
+ "user.expiringVouchers.days30": "connect.template.rule.custom_modal.properties.user_expiring_vouchers_days_30",
1213
+ "user.expiringVouchers.days90": "connect.template.rule.custom_modal.properties.user_expiring_vouchers_days_90"
1214
+ }, d = {
1215
+ _is: "connect.template.rule.custom_modal.operators.is",
1216
+ _contains: "connect.template.rule.custom_modal.operators.contains",
1217
+ _equal: "connect.template.rule.custom_modal.operators.equal",
1218
+ _lessThan: "connect.template.rule.custom_modal.operators.less_than",
1219
+ _moreThan: "connect.template.rule.custom_modal.operators.more_than",
1220
+ _lessThanOrEqual: "connect.template.rule.custom_modal.operators.less_than_or_equal",
1221
+ _moreThanOrEqual: "connect.template.rule.custom_modal.operators.more_than_or_equal",
1222
+ _isDay: "connect.template.rule.custom_modal.operators.is_day",
1223
+ _isRange: "connect.template.rule.custom_modal.operators.is_in_range",
1224
+ _isOnDate: "connect.template.rule.custom_modal.operators.is_on_date",
1225
+ _isBetween: "connect.template.rule.custom_modal.operators.is_between",
1226
+ _isInMonth: "connect.template.rule.custom_modal.operators.is_in_month",
1227
+ _rrule: "connect.template.rule.custom_modal.operators.matches_occurrence",
1228
+ _isBetweenTime: "connect.template.rule.custom_modal.operators.between_time",
1229
+ _isOnTime: "connect.template.rule.custom_modal.operators.is_on_time",
1230
+ _isIn: "connect.template.rule.custom_modal.operators.is_in",
1231
+ _hasAll: "connect.template.rule.custom_modal.operators.has_all_of",
1232
+ _hasAny: "connect.template.rule.custom_modal.operators.has_any_of"
1233
+ };
1234
+ function o(S) {
1235
+ if (!S) return "";
1236
+ const F = t[S.property];
1237
+ return F ? n(F) : S.name;
1238
+ }
1239
+ function i(S) {
1240
+ const F = d[S];
1241
+ return F ? n(F) : de[S].name;
1242
+ }
1243
+ const p = l, b = M(
1244
+ () => ke(p.triggerType, p.includeOnly).filter(
1245
+ ({ property: S }) => p.allowSeasonEarned || S !== "user.stats.lastSeasonTierEarned" && S !== "user.stats.lastSeasonPointEarned"
1246
+ )
1247
+ ), k = M(
1248
+ () => b.value.find((S) => {
1249
+ var F;
1250
+ return S.property == ((F = y.value) == null ? void 0 : F.property);
1251
+ })
1252
+ ), U = (S) => ie[b.value.find((F) => F.property === S).type], w = M(() => {
1253
+ if (!y.value) return [];
1254
+ const S = b.value.find(
1255
+ (F) => F.property === y.value.property
1256
+ );
1257
+ return S ? ie[S.type].filter((F) => {
1258
+ var L, H;
1259
+ return !((H = (L = de[F]) == null ? void 0 : L.exclude) != null && H.includes(y.value.property));
1260
+ }).map((F) => ({
1261
+ label: i(F),
1262
+ value: F
1263
+ })) : [];
1264
+ }), c = Ee, s = M(() => {
1265
+ const S = c.safeParse(y.value);
1266
+ return S.success ? [] : S.error.errors;
1267
+ }), a = W(!1), y = W(
1268
+ be(p.modelValue) ?? Y.constructEntry(
1269
+ b.value[0].property,
1270
+ U(b.value[0].property)[0],
1271
+ null
1272
+ )
1273
+ ), T = M(() => {
1274
+ var h;
1275
+ const { property: S, negated: F, conditions: L } = y.value, H = Object.keys(L || {})[0], Q = Object.values(L || {})[0];
1276
+ return {
1277
+ property: S,
1278
+ negated: F == !0,
1279
+ type: (h = b.value.find((z) => z.property === S)) == null ? void 0 : h.type,
1280
+ operator: H,
1281
+ equator: Q
1282
+ };
1283
+ });
1284
+ function u(S) {
1285
+ y.value = Y.constructEntry(
1286
+ S,
1287
+ U(S)[0],
1288
+ null
1289
+ );
1290
+ }
1291
+ function x(S) {
1292
+ y.value = { ...y.value, negated: S == !0 };
1293
+ }
1294
+ function oe(S) {
1295
+ y.value = {
1296
+ ...y.value,
1297
+ conditions: { [S]: null }
1298
+ };
1299
+ }
1300
+ function J(S) {
1301
+ y.value.conditions = {
1302
+ [T.value.operator]: S
1303
+ };
1304
+ }
1305
+ function ee() {
1306
+ m(y.value), f("primary"), R.close();
1307
+ }
1308
+ return ce(async () => {
1309
+ await _.readMembership();
1310
+ }), (S, F) => {
1311
+ const L = E("FmIcon"), H = E("FmField"), Q = E("FmPill"), h = E("FmMenuItem"), z = E("FmMenu"), se = E("FmButton");
1312
+ return r(), V("div", mt, [
1313
+ C("div", it, A(e(n)("connect.template.rule.custom_modal.property")), 1),
1314
+ v(z, {
1315
+ shift: !0,
1316
+ placement: "bottom-start",
1317
+ modelValue: e(a),
1318
+ "onUpdate:modelValue": F[0] || (F[0] = (I) => fe(a) ? a.value = I : null),
1319
+ onMenuChanged: F[1] || (F[1] = (I) => a.value = I),
1320
+ "max-height": 300
1321
+ }, {
1322
+ "menu-button": B(() => [
1323
+ v(H, null, {
1324
+ append: B(() => [
1325
+ v(L, {
1326
+ name: e(a) ? "expand_less" : "expand_more"
1327
+ }, null, 8, ["name"])
1328
+ ]),
1329
+ default: B(() => [
1330
+ ne(A(o(e(k))) + " ", 1)
1331
+ ]),
1332
+ _: 1
1333
+ })
1334
+ ]),
1335
+ default: B(() => [
1336
+ (r(!0), V(q, null, $(e(b), (I) => (r(), g(h, {
1337
+ key: I.property,
1338
+ "model-value": e(y).property == I.property,
1339
+ label: o(I),
1340
+ disabled: I.premium && !e(te)().isPremium,
1341
+ onClick: (St) => I.premium && !e(te)().isPremium ? null : u(I.property)
1342
+ }, ye({ _: 2 }, [
1343
+ I.premium ? {
1344
+ name: "append",
1345
+ fn: B(() => [
1346
+ v(Q, { variant: "premium" })
1347
+ ]),
1348
+ key: "0"
1349
+ } : void 0
1350
+ ]), 1032, ["model-value", "label", "disabled", "onClick"]))), 128))
1351
+ ]),
1352
+ _: 1
1353
+ }, 8, ["modelValue"]),
1354
+ C("div", dt, A(e(n)("connect.template.rule.custom_modal.check_to_perform")), 1),
1355
+ C("div", pt, [
1356
+ v(O, {
1357
+ class: "w-1/4",
1358
+ items: [
1359
+ { label: e(n)("connect.template.rule.custom_modal.is"), value: !1 },
1360
+ {
1361
+ label: e(n)("connect.template.rule.custom_modal.is_not"),
1362
+ value: !0
1363
+ }
1364
+ ],
1365
+ "model-value": e(y).negated ?? !1,
1366
+ "onUpdate:modelValue": x
1367
+ }, null, 8, ["items", "model-value"]),
1368
+ v(O, {
1369
+ class: "flex-1",
1370
+ items: e(w),
1371
+ "model-value": e(T).operator,
1372
+ "onUpdate:modelValue": oe
1373
+ }, null, 8, ["items", "model-value"])
1374
+ ]),
1375
+ C("div", null, [
1376
+ C("div", ct, A(e(n)("connect.template.rule.custom_modal.criteria")), 1),
1377
+ e(T).type ? (r(), g(st, {
1378
+ key: 0,
1379
+ type: e(T).type,
1380
+ operator: e(T).operator,
1381
+ "model-value": e(T).equator,
1382
+ "onUpdate:modelValue": J
1383
+ }, null, 8, ["type", "operator", "model-value"])) : P("", !0)
1384
+ ]),
1385
+ C("div", yt, [
1386
+ v(se, {
1387
+ onClick: F[2] || (F[2] = (I) => e(R).close()),
1388
+ label: e(n)("connect.common.cancel"),
1389
+ variant: "tertiary"
1390
+ }, null, 8, ["label"]),
1391
+ v(se, {
1392
+ onClick: F[3] || (F[3] = (I) => ee()),
1393
+ disabled: e(s).length > 0 || !e(k),
1394
+ label: e(n)("connect.common.save")
1395
+ }, null, 8, ["disabled", "label"])
1396
+ ])
1397
+ ]);
1398
+ };
1399
+ }
1400
+ }), bt = { class: "flex flex-col gap-8" }, ft = { class: "grid grid-cols-2 items-center" }, gt = { class: "flex items-center gap-8" }, _t = { class: "pt-16 flex items-center self-end gap-8" }, kt = /* @__PURE__ */ N({
1401
+ __name: "PresetRuleDialog",
1402
+ props: {
1403
+ preset: {
1404
+ type: String,
1405
+ required: !0
1406
+ },
1407
+ defaultValue: {
1408
+ type: Object
1409
+ },
1410
+ modelValue: {
1411
+ type: Object
1412
+ }
1413
+ },
1414
+ setup(l) {
1415
+ const R = ue(), { emitData: _, emitAction: m } = ve(), f = X(), { t: n } = G(), t = l;
1416
+ function d() {
1417
+ const { operator: c, equator: s } = p.value;
1418
+ switch (t.preset) {
1419
+ case "MIN_SPEND":
1420
+ case "SPECIFIC_DATE":
1421
+ case "SPECIFIC_TIMERANGE":
1422
+ case "WEEKLY":
1423
+ case "MONTHLY":
1424
+ case "BIRTHDAY":
1425
+ case "TIER": {
1426
+ const a = f.sortedTiers.filter((y, T) => c == "_equal" ? T + 1 == s : c == "_moreThanOrEqual" ? T + 1 >= s : T + 1 <= s);
1427
+ return n("connect.template.rule.preset_modal.applies_to", {
1428
+ tiers: a.map((y) => y.name).join(", ")
1429
+ });
1430
+ }
1431
+ }
1432
+ }
1433
+ function o() {
1434
+ var c, s;
1435
+ switch (t.preset) {
1436
+ case "MIN_SPEND":
1437
+ return Y.constructEntry("bill.amount", "_moreThanOrEqual", 0);
1438
+ case "SPECIFIC_DATE":
1439
+ return Y.constructEntry(
1440
+ "trigger.date",
1441
+ "_isOnDate",
1442
+ (/* @__PURE__ */ new Date()).toISOString()
1443
+ );
1444
+ case "SPECIFIC_TIMERANGE":
1445
+ return Y.constructEntry("trigger.time", "_isBetweenTime", [
1446
+ { start: "00:00", end: "23:59" }
1447
+ ]);
1448
+ case "WEEKLY":
1449
+ return Y.constructEntry(
1450
+ "trigger.date",
1451
+ "_rrule",
1452
+ "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
1453
+ );
1454
+ case "MONTHLY":
1455
+ return Y.constructEntry(
1456
+ "trigger.date",
1457
+ "_rrule",
1458
+ "RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
1459
+ );
1460
+ case "BIRTHDAY":
1461
+ console.log("birthday", t);
1462
+ const a = Y.constructEntry(
1463
+ t.defaultValue.property,
1464
+ t.defaultValue.operator,
1465
+ t.defaultValue.equator
1466
+ );
1467
+ return console.log(a), a;
1468
+ case "TIER":
1469
+ return Y.constructEntry("user.tier", "_equal", 1);
1470
+ case "TITLE":
1471
+ return Y.constructEntry("user.titles", "_hasAny", [
1472
+ (s = (c = f.sortedTitles) == null ? void 0 : c[0]) == null ? void 0 : s._id
1473
+ ]);
1474
+ case "LAST_X_DAY":
1475
+ return Y.constructEntry("user.stats.lastVisit", "_isRange", {
1476
+ op: "last",
1477
+ unit: "day",
1478
+ ignoreYear: !0,
1479
+ x: 0
1480
+ });
1481
+ case "CUSTOM":
1482
+ throw new Error("Not implemented");
1483
+ }
1484
+ }
1485
+ const i = W(o()), p = M(() => {
1486
+ const c = Y.simplify(i.value);
1487
+ return {
1488
+ ...c,
1489
+ equator: c.equator
1490
+ };
1491
+ });
1492
+ function b(c, s) {
1493
+ const a = p.value;
1494
+ i.value = Y.constructEntry(
1495
+ a.property,
1496
+ s ?? a.operator,
1497
+ c,
1498
+ i.value.name
1499
+ );
1500
+ }
1501
+ function k() {
1502
+ _(i.value), m("primary"), R.close();
1503
+ }
1504
+ const U = M(() => {
1505
+ const c = he.safeParse(i.value);
1506
+ return c.success ? [] : c.error.errors;
1507
+ });
1508
+ ce(async () => {
1509
+ await f.readMembership();
1510
+ });
1511
+ const w = M(() => [
1512
+ {
1513
+ label: n("connect.template.rule.preset_modal.unit.day"),
1514
+ value: "day"
1515
+ },
1516
+ {
1517
+ label: n("connect.template.rule.preset_modal.unit.week"),
1518
+ value: "week"
1519
+ },
1520
+ {
1521
+ label: n("connect.template.rule.preset_modal.unit.month"),
1522
+ value: "month"
1523
+ }
1524
+ ]);
1525
+ return (c, s) => {
1526
+ var S, F, L, H, Q;
1527
+ const a = E("FmStepperField"), y = E("FmDatePicker"), T = E("FmTimeRangePicker"), u = E("FmRadio"), x = E("FmSelect"), oe = E("FmRadioGroup"), J = E("FmHelperText"), ee = E("FmButton");
1528
+ return r(), V("div", bt, [
1529
+ l.preset == "MIN_SPEND" ? (r(), g(a, {
1530
+ key: 0,
1531
+ label: e(n)("connect.template.rule.preset.minimum_spend"),
1532
+ "model-value": e(p).equator,
1533
+ "onUpdate:modelValue": s[0] || (s[0] = (h) => b(h))
1534
+ }, null, 8, ["label", "model-value"])) : P("", !0),
1535
+ l.preset == "LAST_X_DAY" ? (r(), g(a, {
1536
+ key: 1,
1537
+ label: "",
1538
+ min: 0,
1539
+ prepent: e(n)("connect.template.rule.preset_modal.day"),
1540
+ "model-value": e(p).equator.x,
1541
+ rules: [
1542
+ (h) => h >= 0 || e(n)(
1543
+ "connect.template.rule.preset_modal.value_must_be_greater_than_0"
1544
+ )
1545
+ ],
1546
+ "onUpdate:modelValue": s[1] || (s[1] = (h) => b({
1547
+ op: "last",
1548
+ unit: "day",
1549
+ ignoreYear: !0,
1550
+ x: h
1551
+ }))
1552
+ }, null, 8, ["prepent", "model-value", "rules"])) : l.preset == "SPECIFIC_DATE" ? (r(), g(y, {
1553
+ key: 2,
1554
+ label: e(n)("connect.template.rule.preset.specific_date"),
1555
+ "model-value": e(p).equator,
1556
+ "onUpdate:modelValue": s[2] || (s[2] = (h) => b(h))
1557
+ }, null, 8, ["label", "model-value"])) : l.preset == "SPECIFIC_TIMERANGE" ? (r(), g(T, {
1558
+ key: 3,
1559
+ label: e(n)("connect.template.rule.preset_modal.time_is_between"),
1560
+ "disable-time-check": !0,
1561
+ "model-value": [(F = (S = e(p).equator) == null ? void 0 : S[0]) == null ? void 0 : F.start, (H = (L = e(p).equator) == null ? void 0 : L[0]) == null ? void 0 : H.end],
1562
+ "onUpdate:modelValue": s[3] || (s[3] = (h) => b([
1563
+ {
1564
+ start: h[0],
1565
+ end: h[1]
1566
+ }
1567
+ ]))
1568
+ }, null, 8, ["label", "model-value"])) : l.preset == "WEEKLY" ? (r(), g(re, {
1569
+ key: 4,
1570
+ label: e(n)("connect.template.rule.preset.weekly"),
1571
+ "fixed-frequency": !0,
1572
+ "model-value": e(p).equator,
1573
+ "onUpdate:modelValue": s[4] || (s[4] = (h) => b(h))
1574
+ }, null, 8, ["label", "model-value"])) : l.preset == "MONTHLY" ? (r(), g(re, {
1575
+ key: 5,
1576
+ label: e(n)("connect.template.rule.preset.monthly"),
1577
+ "fixed-frequency": !0,
1578
+ "model-value": e(p).equator,
1579
+ "onUpdate:modelValue": s[5] || (s[5] = (h) => b(h))
1580
+ }, null, 8, ["label", "model-value"])) : l.preset == "BIRTHDAY" ? (r(), V(q, { key: 6 }, [
1581
+ C("div", ft, [
1582
+ v(u, {
1583
+ label: e(n)("connect.template.rule.birthday.days_before"),
1584
+ value: "_isDay",
1585
+ "model-value": e(p).operator,
1586
+ "onUpdate:modelValue": s[6] || (s[6] = () => {
1587
+ b(
1588
+ {
1589
+ op: "after",
1590
+ x: 1,
1591
+ ignoreYear: !0
1592
+ },
1593
+ "_isDay"
1594
+ );
1595
+ })
1596
+ }, null, 8, ["label", "model-value"]),
1597
+ C("div", gt, [
1598
+ v(u, {
1599
+ label: e(n)("connect.template.rule.preset_modal.is_in_this"),
1600
+ value: "_isRange",
1601
+ "model-value": e(p).operator,
1602
+ "onUpdate:modelValue": s[7] || (s[7] = () => {
1603
+ b(
1604
+ {
1605
+ op: "this",
1606
+ unit: "day",
1607
+ ignoreYear: !0
1608
+ },
1609
+ "_isRange"
1610
+ );
1611
+ })
1612
+ }, null, 8, ["label", "model-value"]),
1613
+ e(p).operator == "_isRange" ? (r(), g(x, {
1614
+ key: 0,
1615
+ items: e(w),
1616
+ "model-value": e(p).equator.unit,
1617
+ "onUpdate:modelValue": s[8] || (s[8] = (h) => b(
1618
+ {
1619
+ op: "this",
1620
+ unit: h,
1621
+ ignoreYear: !0
1622
+ },
1623
+ "_isRange"
1624
+ ))
1625
+ }, null, 8, ["items", "model-value"])) : P("", !0)
1626
+ ])
1627
+ ]),
1628
+ e(p).operator == "_isDay" ? (r(), g(a, {
1629
+ key: 0,
1630
+ label: e(n)("connect.template.rule.birthday.days_before_label"),
1631
+ "show-steppers": !1,
1632
+ "model-value": e(p).equator.x,
1633
+ "onUpdate:modelValue": s[9] || (s[9] = (h) => b({
1634
+ op: "after",
1635
+ x: h,
1636
+ ignoreYear: !0
1637
+ }))
1638
+ }, null, 8, ["label", "model-value"])) : P("", !0)
1639
+ ], 64)) : l.preset == "TIER" ? (r(), V(q, { key: 7 }, [
1640
+ v(oe, {
1641
+ inline: !0,
1642
+ "model-value": e(p).operator,
1643
+ "onUpdate:modelValue": s[10] || (s[10] = (h) => b(e(p).equator, h))
1644
+ }, {
1645
+ default: B(() => [
1646
+ v(u, {
1647
+ value: "_moreThanOrEqual",
1648
+ label: e(n)("connect.template.rule.preset_modal.at_least")
1649
+ }, null, 8, ["label"]),
1650
+ v(u, {
1651
+ value: "_equal",
1652
+ label: e(n)("connect.template.rule.preset_modal.equal")
1653
+ }, null, 8, ["label"]),
1654
+ v(u, {
1655
+ value: "_lessThanOrEqual",
1656
+ label: e(n)("connect.template.rule.preset_modal.at_most")
1657
+ }, null, 8, ["label"])
1658
+ ]),
1659
+ _: 1
1660
+ }, 8, ["model-value"]),
1661
+ v(O, {
1662
+ items: (e(f).sortedTiers ?? []).map((h, z) => ({
1663
+ label: `Tier ${z + 1} - ${h.name}`,
1664
+ value: z + 1
1665
+ })),
1666
+ "model-value": e(p).equator,
1667
+ "onUpdate:modelValue": s[11] || (s[11] = (h) => b(h))
1668
+ }, null, 8, ["items", "model-value"]),
1669
+ v(J, {
1670
+ text: d()
1671
+ }, null, 8, ["text"])
1672
+ ], 64)) : l.preset == "TITLE" ? (r(), g(O, {
1673
+ key: 8,
1674
+ label: e(n)("connect.template.rule.preset_modal.user_has_title"),
1675
+ items: (e(f).sortedTitles ?? []).map((h) => ({
1676
+ label: h.name,
1677
+ value: h._id
1678
+ })),
1679
+ "model-value": (Q = e(p).equator) == null ? void 0 : Q[0],
1680
+ "onUpdate:modelValue": s[12] || (s[12] = (h) => b([h]))
1681
+ }, null, 8, ["label", "items", "model-value"])) : P("", !0),
1682
+ v(J, {
1683
+ class: "mt-[-8px]",
1684
+ text: e(le).helperText(e(U), ""),
1685
+ state: e(le).helperState(e(U), "")
1686
+ }, null, 8, ["text", "state"]),
1687
+ C("div", _t, [
1688
+ v(ee, {
1689
+ onClick: s[13] || (s[13] = (h) => e(R).close()),
1690
+ label: e(n)("connect.common.cancel"),
1691
+ variant: "tertiary"
1692
+ }, null, 8, ["label"]),
1693
+ v(ee, {
1694
+ onClick: s[14] || (s[14] = (h) => k()),
1695
+ disabled: e(U).length > 0,
1696
+ label: e(n)("connect.common.save")
1697
+ }, null, 8, ["disabled", "label"])
1698
+ ])
1699
+ ]);
1700
+ };
1701
+ }
1702
+ }), Et = /* @__PURE__ */ N({
1703
+ __name: "RuleConfigurator",
1704
+ props: {
1705
+ triggerType: {
1706
+ type: String,
1707
+ required: !0
1708
+ },
1709
+ includeOnly: {
1710
+ type: String
1711
+ },
1712
+ allowSeasonEarned: {
1713
+ type: Boolean,
1714
+ default: !1
1715
+ },
1716
+ modelValue: {
1717
+ type: Object,
1718
+ default: () => {
1719
+ }
1720
+ }
1721
+ },
1722
+ emits: ["update:model-value"],
1723
+ setup(l, { expose: R, emit: _ }) {
1724
+ const m = te(), { t: f, te: n } = G(), t = {
1725
+ "Minimum spend": "connect.template.rule.preset.minimum_spend",
1726
+ "Specific date": "connect.template.rule.preset.specific_date",
1727
+ "Specific time range": "connect.template.rule.preset.specific_time_range",
1728
+ Weekly: "connect.template.rule.preset.weekly",
1729
+ Monthly: "connect.template.rule.preset.monthly",
1730
+ Birthday: "connect.template.rule.preset.birthday",
1731
+ "Birthday Week": "connect.template.rule.preset.birthday_week",
1732
+ "Birthday Month": "connect.template.rule.preset.birthday_month",
1733
+ "N day before birthday": "connect.template.rule.preset.n_day_before_birthday",
1734
+ "Specific tier": "connect.template.rule.preset.specific_tier",
1735
+ "Specific title": "connect.template.rule.preset.specific_title",
1736
+ "Last visit in X days": "connect.template.rule.preset.last_visit_in_x_days",
1737
+ "Weekday special": "connect.template.rule.preset.weekday_special",
1738
+ "Weekend special": "connect.template.rule.preset.weekend_special",
1739
+ "Happy hour": "connect.template.rule.preset.happy_hour",
1740
+ "Mother's day special": "connect.template.rule.preset.mothers_day_special",
1741
+ "Father's day special": "connect.template.rule.preset.fathers_day_special",
1742
+ Christmas: "connect.template.rule.preset.christmas",
1743
+ "Feedback rating": "connect.template.rule.preset.feedback_rating",
1744
+ Custom: "connect.template.rule.preset.custom"
1745
+ }, d = l, o = _, i = ue(), p = W();
1746
+ function b(c) {
1747
+ const [s] = c.rules;
1748
+ i.open({
1749
+ title: w(c),
1750
+ closeButton: !1,
1751
+ dismissAway: !1,
1752
+ contentComponent: kt,
1753
+ contentComponentProps: {
1754
+ preset: c.type,
1755
+ defaultValue: s,
1756
+ modelValue: d.modelValue
1757
+ }
1758
+ }).onPrimary((a) => o("update:model-value", a));
1759
+ }
1760
+ function k(c) {
1761
+ i.open({
1762
+ title: f("connect.template.rule.edit_rule"),
1763
+ closeButton: !1,
1764
+ dismissAway: !1,
1765
+ contentComponent: vt,
1766
+ contentComponentProps: {
1767
+ triggerType: d.triggerType,
1768
+ includeOnly: d.includeOnly,
1769
+ allowSeasonEarned: d.allowSeasonEarned,
1770
+ modelValue: c
1771
+ }
1772
+ }).onPrimary((s) => o("update:model-value", s));
1773
+ }
1774
+ function U(c) {
1775
+ if (c.type == "CUSTOM") {
1776
+ const [s] = c.rules;
1777
+ return k(
1778
+ Y.constructEntry(s.property, s.operator, s.equator)
1779
+ );
1780
+ }
1781
+ return b(c);
1782
+ }
1783
+ function w(c) {
1784
+ const s = t[c.name];
1785
+ return s && n(s) ? f(s) : c.name;
1786
+ }
1787
+ return R({
1788
+ showCustomDialog: k
1789
+ }), (c, s) => {
1790
+ const a = E("FmButton"), y = E("FmPill"), T = E("FmMenuItem"), u = E("FmMenu");
1791
+ return r(), g(u, {
1792
+ shift: !0,
1793
+ placement: "top-start"
1794
+ }, {
1795
+ "menu-button": B(() => [
1796
+ v(a, {
1797
+ label: e(f)("connect.template.rule.add_condition"),
1798
+ icon: "add",
1799
+ class: "text-fm-color-primary border-fm-color-primary",
1800
+ "icon-color": "primary",
1801
+ variant: "secondary"
1802
+ }, null, 8, ["label"])
1803
+ ]),
1804
+ default: B(() => [
1805
+ (r(!0), V(q, null, $(e(Be).filter(
1806
+ (x) => !l.includeOnly || x.for.includes(l.includeOnly)
1807
+ ), (x) => (r(), g(T, {
1808
+ key: x.name,
1809
+ "model-value": x.name == e(p),
1810
+ label: w(x),
1811
+ onClick: () => {
1812
+ x != null && x.premium && !e(m).isPremium || U(x);
1813
+ },
1814
+ disabled: (x == null ? void 0 : x.premium) && !e(m).isPremium
1815
+ }, ye({ _: 2 }, [
1816
+ x != null && x.premium ? {
1817
+ name: "append",
1818
+ fn: B(() => [
1819
+ v(y, { variant: "premium" })
1820
+ ]),
1821
+ key: "0"
1822
+ } : void 0
1823
+ ]), 1032, ["model-value", "label", "onClick", "disabled"]))), 128))
1824
+ ]),
1825
+ _: 1
1826
+ });
1827
+ };
1828
+ }
1829
+ }), ht = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ht = /* @__PURE__ */ N({
1830
+ __name: "RuleGroup",
1831
+ props: {
1832
+ triggerType: {
1833
+ type: String,
1834
+ required: !0
1835
+ },
1836
+ includeOnly: {
1837
+ type: String
1838
+ },
1839
+ allowSeasonEarned: {
1840
+ type: Boolean,
1841
+ default: !1
1842
+ },
1843
+ modelValue: {
1844
+ type: Object
1845
+ }
1846
+ },
1847
+ emits: ["update:model-value"],
1848
+ setup(l, { emit: R }) {
1849
+ const _ = l, m = R, f = Ve(), { t: n } = G(), t = M(
1850
+ () => _.modelValue ?? Y.scaffoldGroup()
1851
+ ), d = M(() => Y.getLogic(t.value)), o = M(() => [
1852
+ { label: n("connect.template.rule.and"), value: "&&" },
1853
+ { label: n("connect.template.rule.or"), value: "||" }
1854
+ ]), i = W();
1855
+ function p(b, k) {
1856
+ try {
1857
+ const U = Y.setRuleToGroup(b, k);
1858
+ Y.isRuleExceed(b, k), m("update:model-value", U);
1859
+ } catch (U) {
1860
+ f.open({
1861
+ message: U.message,
1862
+ type: "error"
1863
+ });
1864
+ }
1865
+ }
1866
+ return (b, k) => {
1867
+ const U = E("FmButtonGroup"), w = E("FmCard");
1868
+ return r(), g(w, { variant: "outlined" }, {
1869
+ default: B(() => [
1870
+ v(w, { class: "border-l-4 border-fm-color-primary p-16 space-y-16" }, {
1871
+ default: B(() => [
1872
+ C("div", ht, A(e(n)("connect.template.rule.when")), 1),
1873
+ v(Et, {
1874
+ ref_key: "configuratorRef",
1875
+ ref: i,
1876
+ "include-only": l.includeOnly,
1877
+ "allow-season-earned": l.allowSeasonEarned,
1878
+ "trigger-type": l.triggerType,
1879
+ "onUpdate:modelValue": k[0] || (k[0] = (c) => p(e(t), c))
1880
+ }, null, 8, ["include-only", "allow-season-earned", "trigger-type"]),
1881
+ (r(!0), V(q, null, $(e(t).rules, (c, s) => {
1882
+ var a;
1883
+ return r(), V(q, null, [
1884
+ e(Se)(c) ? (r(), g(qe, {
1885
+ "model-value": c,
1886
+ key: s,
1887
+ onEdit: (a = e(i)) == null ? void 0 : a.showCustomDialog,
1888
+ onRemove: k[1] || (k[1] = (y) => {
1889
+ m(
1890
+ "update:model-value",
1891
+ e(Y).removeEntry(e(t), y.name)
1892
+ );
1893
+ })
1894
+ }, null, 8, ["model-value", "onEdit"])) : P("", !0),
1895
+ v(U, {
1896
+ class: "w-[200px]",
1897
+ disabled: Object.keys(e(t).rules).length < 2,
1898
+ items: e(o),
1899
+ "model-value": e(o).find((y) => y.value === e(d)) ?? null,
1900
+ "onUpdate:modelValue": k[2] || (k[2] = (y) => m(
1901
+ "update:model-value",
1902
+ e(Y).setRuleToGroup(
1903
+ e(t),
1904
+ [],
1905
+ y.value
1906
+ )
1907
+ ))
1908
+ }, null, 8, ["disabled", "items", "model-value"])
1909
+ ], 64);
1910
+ }), 256))
1911
+ ]),
1912
+ _: 1
1913
+ })
1914
+ ]),
1915
+ _: 1
1916
+ });
1917
+ };
1918
+ }
1919
+ });
1920
+ export {
1921
+ re as _,
1922
+ Ht as a
1923
+ };