@feedmepos/mf-connect 0.1.2-prod → 0.1.4-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 (87) hide show
  1. package/dist/Analytic-07T9poLx.js +423 -0
  2. package/dist/{App-CRTD0U-N.js → App-C6MukSCT.js} +276 -275
  3. package/dist/Broadcast-CzsgeZNO.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BirunpzI.js} +8 -8
  5. package/dist/Card-DQnyWZZf.js +824 -0
  6. package/dist/{Collections-BgbWoLWI.js → Collections-BV7CSqRw.js} +4 -4
  7. package/dist/Credit-CxsbYGLZ.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKSZYxvb.js} +918 -901
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js +345 -0
  10. package/dist/Experience-eMUbhq7h.js +221 -0
  11. package/dist/Game-CxAG2ViS.js +255 -0
  12. package/dist/Marketing-CozMj2Y5.js +316 -0
  13. package/dist/Member-DM1dj3F5.js +69 -0
  14. package/dist/{MemberList-ISy05wGZ.js → MemberList-DNjK9BbG.js} +14 -14
  15. package/dist/{MemberTransactions-CXvhJngX.js → MemberTransactions-CsjN3LZA.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js → MessageInput.vue_vue_type_script_setup_true_lang-DVQE9v2R.js} +2 -2
  17. package/dist/Mission-BugvTPPH.js +261 -0
  18. package/dist/Point-D8BjGtqT.js +222 -0
  19. package/dist/Promotion-mc9KBzoJ.js +253 -0
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js → RuleGroup.vue_vue_type_script_setup_true_lang-B2H3D_kZ.js} +15 -15
  21. package/dist/Segment-DZRFA-Pb.js +565 -0
  22. package/dist/Setting-DxNhR44e.js +1871 -0
  23. package/dist/Store-CdkJWpjV.js +1530 -0
  24. package/dist/StoreRewards-Cdturia8.js +400 -0
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js} +1 -1
  27. package/dist/{Tier-DLrOmrnK.js → Tier-I_MMd39Y.js} +470 -445
  28. package/dist/{Title-MHQuel7h.js → Title-DK5gmUvo.js} +298 -282
  29. package/dist/Transaction-BXpTIMS_.js +39 -0
  30. package/dist/Voucher-BQ5h2G0I.js +490 -0
  31. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js +141 -0
  32. package/dist/app-CL2Wxzv5.js +5639 -0
  33. package/dist/{app-BjOpRVdv.js → app-DTAyCT-G.js} +1 -1
  34. package/dist/app.js +4 -3
  35. package/dist/{business-DveMDDHY.js → business-B9OUlaFZ.js} +1 -1
  36. package/dist/{campaign-CMb05XLt.js → campaign-CNbUA51l.js} +2 -2
  37. package/dist/{collection.fn-BjaBPYMU.js → collection.fn-D_i45T4Q.js} +2 -2
  38. package/dist/dto-B4208_es.js +2770 -0
  39. package/dist/{effect-CxAdSlyD.js → effect-Ye_yr8et.js} +1 -1
  40. package/dist/{email-addresses-Dtr5OALQ.js → email-addresses-Gm7Dyaxy.js} +1 -1
  41. package/dist/{export-DuBekrcg.js → export-Buee5oUV.js} +3 -3
  42. package/dist/{helper-DL6hnmtJ.js → helper-BBlHhMFc.js} +1 -1
  43. package/dist/{index-raYm7Ew2.js → index-BxJgFvym.js} +2 -2
  44. package/dist/{index-gcsOy_cD.js → index-ByaM-yoc.js} +91 -86
  45. package/dist/{index-DISwCnfH.js → index-C0QHb5SL.js} +2 -2
  46. package/dist/{index-Cibwzgac.js → index-C363BG5A.js} +3 -3
  47. package/dist/{index-BZAlqAaJ.js → index-CLL3no-v.js} +1 -1
  48. package/dist/{index-CAQpU5Rv.js → index-ChSVaFk3.js} +1 -1
  49. package/dist/{index-BSIUoSG3.js → index-Co9n8I_5.js} +3 -3
  50. package/dist/index-CoGNKU8v.js +3 -0
  51. package/dist/{index-Dx4pkNRc.js → index-DHGcUMVN.js} +1 -1
  52. package/dist/{index-CgPlJqkX.js → index-DWWtZSrm.js} +1 -1
  53. package/dist/{index-CGHNWhkM.js → index-DdVZgYE4.js} +258 -256
  54. package/dist/{index-BBBytzpn.js → index-Dx3HwWcb.js} +1 -1
  55. package/dist/{index.esm2017-Bs9CWbrs.js → index.esm2017-Dd02dg_O.js} +38 -38
  56. package/dist/{loading-Dj5bx8fg.js → loading-Or1ZDzDS.js} +11 -11
  57. package/dist/{membership-B2avlZoN.js → membership-B8h5ku-v.js} +3 -3
  58. package/dist/{money-CNSWtAf-.js → money-CmsKAJBT.js} +1 -1
  59. package/dist/{number-BA58pjU6.js → number-iEhp7Uai.js} +1 -1
  60. package/dist/{rule-BWazFYuZ.js → rule-BORkgSMK.js} +3 -3
  61. package/dist/{rule-builder-RIloDQBn.js → rule-builder-DEfkSr68.js} +1 -1
  62. package/dist/{template-u01r84LY.js → template-C_Y7bhlI.js} +4 -4
  63. package/dist/{usePagination--B6Wt7C1.js → usePagination-Ci8-uZvb.js} +1 -1
  64. package/dist/vue-i18n-BXzrZRP6.js +2365 -0
  65. package/package.json +7 -4
  66. package/dist/Analytic-AqWU_lJy.js +0 -620
  67. package/dist/Broadcast-utWSrzP9.js +0 -216
  68. package/dist/Card-x6qnEaIt.js +0 -823
  69. package/dist/Credit-CojzmUnh.js +0 -214
  70. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js +0 -344
  71. package/dist/Experience-CPjovKWF.js +0 -211
  72. package/dist/Game-DWcjPfZP.js +0 -250
  73. package/dist/Marketing-CwoI0pFF.js +0 -309
  74. package/dist/Member-oRcVGr20.js +0 -92
  75. package/dist/Mission-Y8s5MQIC.js +0 -248
  76. package/dist/Point-0Fw3qLIW.js +0 -220
  77. package/dist/Promotion-vqM23NPX.js +0 -244
  78. package/dist/Segment-lgzMRCyd.js +0 -564
  79. package/dist/Setting-CFGB53S0.js +0 -1870
  80. package/dist/Store-fJlew3HJ.js +0 -1533
  81. package/dist/StoreRewards-DWq34E4p.js +0 -429
  82. package/dist/Transaction-CYqMFEzc.js +0 -36
  83. package/dist/Voucher-B0QCX_nG.js +0 -485
  84. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  85. package/dist/app-SOHUUM08.js +0 -2974
  86. package/dist/dto-CY7JrHkZ.js +0 -1145
  87. package/dist/index-BMxu_XL-.js +0 -11
@@ -1,214 +0,0 @@
1
- import { defineComponent as U, ref as k, computed as A, onMounted as N, resolveComponent as i, openBlock as l, createElementBlock as f, Fragment as g, createVNode as r, unref as o, createElementVNode as s, withCtx as h, renderList as j, createBlock as C, resolveDynamicComponent as M, toDisplayString as y, createCommentVNode as H, h as q } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { u as O, p as Q } from "./loading-Dj5bx8fg.js";
5
- import { u as W } from "./business-DveMDDHY.js";
6
- import { u as X } from "./campaign-CMb05XLt.js";
7
- import { g as S, b as V } from "./dto-CY7JrHkZ.js";
8
- import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js";
10
- import { u as ee } from "./template-u01r84LY.js";
11
- import { c as _ } from "./index-CgPlJqkX.js";
12
- const te = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-center justify-between w-full" }, ae = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, ne = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "space-y-4" }, le = { class: "fm-typo-en-body-lg-600" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { key: 0 }, ue = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), pe = [
13
- ue
14
- ], fe = /* @__PURE__ */ s("img", {
15
- src: z,
16
- class: "aspect-square w-[150px]"
17
- }, null, -1), ye = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
18
- /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
19
- /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
20
- ], -1), Re = /* @__PURE__ */ U({
21
- __name: "Credit",
22
- setup(_e) {
23
- const R = {
24
- label: "Create program",
25
- value: "create",
26
- isPrimary: !0,
27
- prependIcon: "add"
28
- }, L = ee("CREDIT", G()), I = W(), c = X(), { global: B, minor: w } = O, n = k({
29
- searchKey: "",
30
- location: null
31
- }), m = A(
32
- () => c.campaigns.credit.filter(
33
- (e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
34
- )
35
- ), D = [
36
- {
37
- header: "Program title",
38
- accessorFn: (e) => e.name
39
- },
40
- {
41
- header: "Status",
42
- cell(e) {
43
- return S(e.row.original);
44
- }
45
- },
46
- {
47
- header: "Summary",
48
- accessorFn: (e) => V(e)
49
- //v.effect,
50
- },
51
- {
52
- header: "Actions",
53
- cell(e) {
54
- return q(J.FmButton, {
55
- variant: "tertiary",
56
- icon: "delete",
57
- iconColor: "neutral-gray-400",
58
- onClick: (a) => {
59
- a.stopPropagation(), x(e.row.original);
60
- }
61
- });
62
- }
63
- }
64
- ], v = k();
65
- async function x(e) {
66
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await w(
67
- async () => {
68
- await _.delete(e._id), await c.read("CREDIT");
69
- },
70
- {
71
- message: `Removing ${e.name}`,
72
- successMessage: `Removed ${e.name} successfully`
73
- }
74
- );
75
- }
76
- async function p(e) {
77
- e ? await a() : L.open(async (d) => {
78
- await a(d);
79
- });
80
- async function a(d) {
81
- var u;
82
- (u = v.value) == null || u.showSheet(
83
- !0,
84
- "CREDIT",
85
- e ? await _.readById(e._id) : void 0,
86
- d
87
- );
88
- }
89
- }
90
- async function T(e) {
91
- await w(
92
- async () => {
93
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await c.read("CREDIT");
94
- },
95
- {
96
- message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
97
- successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
98
- }
99
- );
100
- }
101
- return N(async () => {
102
- await B(async () => {
103
- await c.read("CREDIT");
104
- });
105
- }), (e, a) => {
106
- const d = i("FmPageHead"), u = i("FmSearch"), $ = i("FmTable"), b = i("FmButton"), E = i("FmListItem"), K = i("FmList"), P = i("FmCard");
107
- return l(), f(g, null, [
108
- r(d, {
109
- title: "Credit",
110
- actions: o(m).length > 0 ? [R] : [],
111
- "onClick:action": a[0] || (a[0] = () => p())
112
- }, null, 8, ["actions"]),
113
- s("div", te, [
114
- r(u, {
115
- modelValue: o(n).searchKey,
116
- "onUpdate:modelValue": a[1] || (a[1] = (t) => o(n).searchKey = t),
117
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
118
- placeholder: "search",
119
- collapsible: ""
120
- }, null, 8, ["modelValue"]),
121
- o(c).campaigns.credit && o(c).campaigns.credit.length > 0 ? (l(), f(g, { key: 0 }, [
122
- s("div", oe, [
123
- s("div", ae, [
124
- r(Y, {
125
- modelValue: o(n).location,
126
- "onUpdate:modelValue": a[2] || (a[2] = (t) => o(n).location = t),
127
- label: "Location: ",
128
- "show-item-label": !0,
129
- icon: "storefront",
130
- placement: "bottom-start",
131
- items: o(I).locationItems
132
- }, null, 8, ["modelValue", "items"])
133
- ]),
134
- r(u, {
135
- modelValue: o(n).searchKey,
136
- "onUpdate:modelValue": a[3] || (a[3] = (t) => o(n).searchKey = t),
137
- class: "xs:hidden",
138
- placeholder: "search",
139
- collapsible: ""
140
- }, null, 8, ["modelValue"])
141
- ]),
142
- r($, {
143
- class: "xs:hidden",
144
- "row-data": o(m),
145
- "column-defs": D,
146
- "search-value": o(n).searchKey,
147
- "column-filter": [],
148
- onRowClick: a[4] || (a[4] = (t) => p(t.original)),
149
- "hide-footer": o(m).length < 10
150
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
151
- r(K, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
152
- default: h(() => [
153
- (l(!0), f(g, null, j(o(m).filter(
154
- (t) => t.name.toLowerCase().includes(o(n).searchKey.toLowerCase())
155
- ), (t) => (l(), C(E, {
156
- key: t._id.toString(),
157
- onClick: (F) => p(t),
158
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
159
- }, {
160
- default: h(() => [
161
- s("div", se, [
162
- s("div", ne, [
163
- (l(), C(M(o(S)(t)))),
164
- s("div", re, y(t.currentReceive ?? 0) + " used ", 1)
165
- ]),
166
- s("div", ie, [
167
- s("div", le, y(t.name), 1),
168
- s("div", ce, y(o(V)(t)), 1)
169
- ]),
170
- s("div", me, " Credit received: " + y(t.currentReceive ?? 0), 1)
171
- ]),
172
- r(b, {
173
- icon: "delete",
174
- "icon-color": "neutral-gray-400",
175
- variant: "tertiary",
176
- onClick: (F) => (F.stopPropagation(), x(t))
177
- }, null, 8, ["onClick"])
178
- ]),
179
- _: 2
180
- }, 1032, ["onClick"]))), 128))
181
- ]),
182
- _: 1
183
- }),
184
- o(m).length == 0 ? (l(), f("div", de, pe)) : H("", !0)
185
- ], 64)) : (l(), C(P, {
186
- key: 1,
187
- variant: "outlined",
188
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
189
- }, {
190
- default: h(() => [
191
- fe,
192
- ye,
193
- r(b, {
194
- variant: "primary",
195
- label: "Create credit program",
196
- icon: "add",
197
- onClick: a[5] || (a[5] = (t) => p())
198
- })
199
- ]),
200
- _: 1
201
- })),
202
- r(Z, {
203
- ref_key: "sheetRef",
204
- ref: v,
205
- "onSubmit:modelValue": T
206
- }, null, 512)
207
- ])
208
- ], 64);
209
- };
210
- }
211
- });
212
- export {
213
- Re as default
214
- };
@@ -1,344 +0,0 @@
1
- import { defineComponent as O, ref as R, onMounted as J, computed as z, resolveComponent as y, openBlock as s, createElementBlock as x, renderSlot as K, toDisplayString as S, createCommentVNode as f, createBlock as p, unref as e, isRef as H, createVNode as b, normalizeClass as q, watch as Q, withCtx as F, resolveDynamicComponent as k, Fragment as W, createElementVNode as A, createTextVNode as X } from "vue";
2
- import { z as _ } from "./app-SOHUUM08.js";
3
- import { Z as d } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
4
- import { g as ee, h as te } from "./index-CAQpU5Rv.js";
5
- import { s as C } from "./effect-CxAdSlyD.js";
6
- import { p as le } from "./loading-Dj5bx8fg.js";
7
- import { I as oe } from "./app-BjOpRVdv.js";
8
- const ae = { class: "flex flex-col gap-8" }, ne = {
9
- key: 0,
10
- class: "fm-typo-en-body-lg-600"
11
- }, se = { key: 1 }, ie = {
12
- key: 2,
13
- class: "space-y-16"
14
- }, de = /* @__PURE__ */ O({
15
- __name: "ValidityInput",
16
- props: {
17
- label: {
18
- type: String
19
- },
20
- disabled: {
21
- type: Boolean,
22
- default: !1
23
- },
24
- type: {
25
- type: String,
26
- default: void 0
27
- },
28
- modelValue: {
29
- type: Object,
30
- required: !0
31
- },
32
- forCredit: {
33
- type: Boolean,
34
- default: !1
35
- },
36
- helperText: {
37
- type: String
38
- }
39
- },
40
- emits: ["update:model-value"],
41
- setup(t, { emit: h }) {
42
- var g, P;
43
- const n = t, c = h, a = [
44
- { label: "Date Range", value: "range" },
45
- { label: "Custom", value: "custom" }
46
- ], u = R(!1);
47
- J(() => {
48
- u.value = n.modelValue && Object.entries(n.modelValue).filter(
49
- ([r, i]) => r != "followFirstReceive" && i != null
50
- ).length > 0;
51
- });
52
- const l = R(
53
- n.type ? a.find((r) => r.value === n.type) : (g = n.modelValue) != null && g.validBefore || (P = n.modelValue) != null && P.validAfter ? a[0] : a[1]
54
- ), w = z(
55
- () => n.forCredit ? ee : te
56
- ), v = z(() => {
57
- const r = w.value.safeParse(n.modelValue);
58
- return r.success ? [] : r.error.errors;
59
- });
60
- function o(r) {
61
- c("update:model-value", r);
62
- }
63
- function U(r) {
64
- var i, D;
65
- if (r.value == "range")
66
- return o({
67
- followFirstReceive: (i = n.modelValue) == null ? void 0 : i.followFirstReceive,
68
- validAfter: void 0,
69
- validBefore: void 0
70
- });
71
- if (r.value == "custom")
72
- return u.value = !1, o({
73
- validForDay: (D = n.modelValue) == null ? void 0 : D.validForDay
74
- });
75
- }
76
- return (r, i) => {
77
- var T, I, E, M, $, j, N, L;
78
- const D = y("FmButtonGroup"), G = y("FmSimpleDateRangePicker"), Z = y("FmSwitch"), Y = y("FmStepperField"), B = y("FmHelperText");
79
- return s(), x("div", ae, [
80
- K(r.$slots, "label", {}, () => [
81
- t.label ? (s(), x("div", ne, S(t.label), 1)) : f("", !0)
82
- ]),
83
- t.type ? f("", !0) : (s(), p(D, {
84
- key: 0,
85
- modelValue: e(l),
86
- "onUpdate:modelValue": [
87
- i[0] || (i[0] = (m) => H(l) ? l.value = m : null),
88
- i[1] || (i[1] = (m) => U(m))
89
- ],
90
- items: a
91
- }, null, 8, ["modelValue"])),
92
- e(l).value === "range" ? (s(), x("div", se, [
93
- b(G, {
94
- "model-value": {
95
- startDate: (T = t.modelValue) != null && T.validAfter ? new Date((I = t.modelValue) == null ? void 0 : I.validAfter).toISOString() : null,
96
- endDate: (E = t.modelValue) != null && E.validAfter ? new Date(((M = t.modelValue) == null ? void 0 : M.validBefore) || "").toISOString() : null
97
- },
98
- "onUpdate:modelValue": i[2] || (i[2] = (m) => {
99
- var V;
100
- o({
101
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive,
102
- validAfter: new Date(m.startDate).toISOString(),
103
- validBefore: new Date(m.endDate).toISOString()
104
- });
105
- })
106
- }, null, 8, ["model-value"])
107
- ])) : e(l).value === "custom" ? (s(), x("div", ie, [
108
- b(Z, {
109
- "model-value": e(u),
110
- label: "Expires",
111
- "label-placement": "right",
112
- "onUpdate:modelValue": i[3] || (i[3] = (m) => {
113
- var V;
114
- u.value = m, o({
115
- validForDay: m ? 1 : void 0,
116
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive
117
- });
118
- })
119
- }, null, 8, ["model-value"]),
120
- e(u) ? (s(), p(Y, {
121
- key: 0,
122
- label: "After (days)",
123
- class: q([{
124
- "opacity-50 pointer-events-none": !e(u)
125
- }, "mt-[-4px]"]),
126
- "max-fraction-digits": 0,
127
- disabled: !e(u),
128
- "show-steppers": !1,
129
- max: 99999,
130
- "append-text": "day(s)",
131
- "model-value": (($ = n.modelValue) == null ? void 0 : $.validForDay) ?? null,
132
- "onUpdate:modelValue": i[4] || (i[4] = (m) => {
133
- var V;
134
- return o({
135
- validForDay: m == null ? void 0 : parseInt(m.toString()),
136
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive
137
- });
138
- })
139
- }, null, 8, ["class", "disabled", "model-value"])) : f("", !0)
140
- ])) : f("", !0),
141
- ((j = n.modelValue) == null ? void 0 : j.followFirstReceive) === !0 && e(u) ? (s(), p(B, {
142
- key: 3,
143
- text: "Expiry follows the first receive"
144
- })) : f("", !0),
145
- b(B, {
146
- text: t.helperText || (((N = n.modelValue) == null ? void 0 : N.validForDay) === 0 ? "Expires on the same day" : e(d).helperText(e(v), "")),
147
- state: t.helperText ? "error" : ((L = n.modelValue) == null ? void 0 : L.validForDay) === 0 ? "warning" : e(d).helperState(e(v), "")
148
- }, null, 8, ["text", "state"])
149
- ]);
150
- };
151
- }
152
- }), re = { class: "space-y-8" }, he = /* @__PURE__ */ O({
153
- __name: "CollectibleOptionInput",
154
- props: {
155
- modelValue: {
156
- type: Object
157
- },
158
- noCampaign: {
159
- type: Boolean
160
- },
161
- schema: {
162
- type: Object,
163
- default: () => _.any()
164
- },
165
- isMission: {
166
- type: Boolean,
167
- default: !1
168
- }
169
- },
170
- emits: ["update:model-value"],
171
- setup(t, { emit: h }) {
172
- const n = t, c = h, a = R(n.modelValue ?? {});
173
- return Q(a, () => c("update:model-value", a.value)), (u, l) => {
174
- const w = y("FmSwitch"), v = y("FmStepperField");
175
- return s(), x("div", re, [
176
- t.isMission ? f("", !0) : (s(), p(w, {
177
- key: 0,
178
- label: "Enable Transfer",
179
- "label-placement": "right",
180
- modelValue: e(a).enableTransfer,
181
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e(a).enableTransfer = o)
182
- }, null, 8, ["modelValue"])),
183
- t.noCampaign ? f("", !0) : (s(), x("div", {
184
- key: 1,
185
- class: q(["grid gap-16", t.isMission ? "" : "grid-cols-2"])
186
- }, [
187
- b(v, {
188
- modelValue: e(a).maxPerUser,
189
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e(a).maxPerUser = o),
190
- "show-steppers": !1,
191
- rules: [e(d).ruleAtPath(t.schema, "maxPerUser")]
192
- }, {
193
- label: F(() => [
194
- (s(), p(k(
195
- e(d).toInputLabel(
196
- e(d).typeAtPath(t.schema, "maxPerUser"),
197
- "Max per user"
198
- )
199
- )))
200
- ]),
201
- _: 1
202
- }, 8, ["modelValue", "rules"]),
203
- t.isMission ? f("", !0) : (s(), p(v, {
204
- key: 0,
205
- modelValue: e(a).maxReceive,
206
- "onUpdate:modelValue": l[2] || (l[2] = (o) => e(a).maxReceive = o),
207
- "show-steppers": !1,
208
- rules: [e(d).ruleAtPath(t.schema, "maxReceive")]
209
- }, {
210
- label: F(() => [
211
- (s(), p(k(
212
- e(d).toInputLabel(
213
- e(d).typeAtPath(t.schema, "maxReceive"),
214
- "Max distribute"
215
- )
216
- )))
217
- ]),
218
- _: 1
219
- }, 8, ["modelValue", "rules"]))
220
- ], 2)),
221
- t.isMission ? f("", !0) : (s(), x(W, { key: 2 }, [
222
- b(v, {
223
- modelValue: e(a).maxUse,
224
- "onUpdate:modelValue": l[3] || (l[3] = (o) => e(a).maxUse = o),
225
- "append-text": "use(s)",
226
- "show-steppers": !1,
227
- rules: [e(d).ruleAtPath(t.schema, "maxUse")]
228
- }, {
229
- label: F(() => [
230
- (s(), p(k(
231
- e(d).toInputLabel(
232
- e(d).typeAtPath(t.schema, "maxUse"),
233
- "Usage count"
234
- )
235
- )))
236
- ]),
237
- _: 1
238
- }, 8, ["modelValue", "rules"]),
239
- e(a).maxUse && e(a).maxUse > 1 ? (s(), p(v, {
240
- key: 0,
241
- modelValue: e(a).cooldown,
242
- "onUpdate:modelValue": l[4] || (l[4] = (o) => e(a).cooldown = o),
243
- "append-text": "minute(s)",
244
- "show-steppers": !1,
245
- rules: [e(d).ruleAtPath(t.schema, "cooldown")]
246
- }, {
247
- label: F(() => [
248
- (s(), p(k(
249
- e(d).toInputLabel(
250
- e(d).typeAtPath(t.schema, "cooldown"),
251
- "Cooldown"
252
- )
253
- )))
254
- ]),
255
- _: 1
256
- }, 8, ["modelValue", "rules"])) : f("", !0),
257
- b(de, {
258
- modelValue: e(a).validityOption,
259
- "onUpdate:modelValue": l[5] || (l[5] = (o) => e(a).validityOption = o),
260
- label: "Validity option"
261
- }, null, 8, ["modelValue"])
262
- ], 64))
263
- ]);
264
- };
265
- }
266
- }), ue = { class: "space-y-8" }, me = /* @__PURE__ */ A("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the discount you want to offer your customer. ", -1), pe = {
267
- key: 1,
268
- class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
269
- }, ce = { class: "fm-typo-en-body-lg-400" }, fe = { class: "text-fm-color-typo-secondary" }, ge = /* @__PURE__ */ O({
270
- __name: "EffectSheet",
271
- props: {
272
- modelValue: { type: Object },
273
- canSetAutoApply: {
274
- type: Boolean
275
- }
276
- },
277
- emits: ["update:model-value"],
278
- setup(t, { emit: h }) {
279
- const n = h, c = R(!1);
280
- async function a(u) {
281
- u.stopPropagation(), await le.remove("Are you sure you want to remove this effect?") && n("update:model-value", null);
282
- }
283
- return (u, l) => {
284
- const w = y("FmButton"), v = y("FmSideSheet");
285
- return s(), p(v, {
286
- "max-width": 550,
287
- header: "Apply discount",
288
- modelValue: e(c),
289
- "onUpdate:modelValue": [
290
- l[2] || (l[2] = (o) => H(c) ? c.value = o : null),
291
- l[3] || (l[3] = (o) => c.value = o)
292
- ]
293
- }, {
294
- "side-sheet-button": F(() => {
295
- var o, U, g;
296
- return [
297
- A("div", ue, [
298
- me,
299
- t.modelValue ? (s(), x("div", pe, [
300
- A("div", ce, [
301
- A("div", null, S((o = e(C)(t.modelValue)) == null ? void 0 : o.type), 1),
302
- A("div", fe, S((U = e(C)(t.modelValue)) == null ? void 0 : U.adjustment) + " with " + S((g = e(C)(t.modelValue)) == null ? void 0 : g.requirements), 1)
303
- ]),
304
- b(w, {
305
- icon: "delete",
306
- "icon-color": "neutral-gray-400",
307
- variant: "tertiary",
308
- onClick: a
309
- })
310
- ])) : (s(), p(w, {
311
- key: 0,
312
- label: "Apply discount",
313
- icon: "add",
314
- "icon-color": "primary",
315
- variant: "secondary",
316
- class: "border-fm-color-primary text-fm-color-primary"
317
- }))
318
- ])
319
- ];
320
- }),
321
- "side-sheet-footer": F(() => [
322
- X(S(void 0))
323
- ]),
324
- default: F(() => [
325
- b(e(oe), {
326
- class: "fm-effect-sheet",
327
- title: "",
328
- "can-set-auto-apply": t.canSetAutoApply,
329
- "disable-effects": t.canSetAutoApply ? ["PAYMENT"] : void 0,
330
- "initial-value": t.modelValue,
331
- onOnConfirm: l[0] || (l[0] = (o) => (n("update:model-value", o), c.value = !1)),
332
- onOnCancel: l[1] || (l[1] = (o) => c.value = !1)
333
- }, null, 8, ["can-set-auto-apply", "disable-effects", "initial-value"])
334
- ]),
335
- _: 1
336
- }, 8, ["modelValue"]);
337
- };
338
- }
339
- });
340
- export {
341
- ge as _,
342
- he as a,
343
- de as b
344
- };