@feedmepos/mf-connect 0.1.98-beta.15 → 0.1.98-beta.16

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 (138) hide show
  1. package/dist/App-DNXDhULP.js +4782 -0
  2. package/dist/AuditLogs-BNS27IJT.js +2013 -0
  3. package/dist/Bin-Dkjyrbz-.js +166 -0
  4. package/dist/Broadcast-B-fpjVzY.js +266 -0
  5. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-qBcG-vPM.js +120 -0
  6. package/dist/Card-BvVHO8kN.js +910 -0
  7. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  8. package/dist/Collections-BLxPSOJl.js +540 -0
  9. package/dist/Credit-DU-stilH.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.js +3377 -0
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CTSfEq5N.js +351 -0
  14. package/dist/Experience-C3tB8hTp.js +259 -0
  15. package/dist/FileSaver.min-EIworvUf.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  17. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  18. package/dist/Game-Dq1ms2fA.js +330 -0
  19. package/dist/Grab-DnSO2oLx.js +300 -0
  20. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-n1r2bgOE.js +145 -0
  21. package/dist/Index-BFIHgW9W.js +259 -0
  22. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-Do7CJZuh.js +48 -0
  24. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-vpJmHgKM.js +18737 -0
  25. package/dist/LoyaltyDashboard-CcBogXzl.js +1082 -0
  26. package/dist/MainLayout-CPNiL_et.js +41 -0
  27. package/dist/Marketing-Bzb1VaVA.js +235 -0
  28. package/dist/MarketingMaterialEdit-8UQNx3mV.js +1035 -0
  29. package/dist/Member-Drb_NVrb.js +280 -0
  30. package/dist/MemberList-wa3JxCVr.js +1601 -0
  31. package/dist/MemberOverview-wL_ailso.js +58 -0
  32. package/dist/MemberTransactions-8qlm-T67.js +45 -0
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BHicaUXs.js +60802 -0
  34. package/dist/Mission-DmWbQmOv.js +334 -0
  35. package/dist/Overview-COEFtf12.js +1079 -0
  36. package/dist/Overview-D7ki-aBA.js +969 -0
  37. package/dist/Point-B0W-BcPA.js +262 -0
  38. package/dist/Promotion-CY16SjmK.js +397 -0
  39. package/dist/Queue-hMur40Xc.js +260 -0
  40. package/dist/Record-Bj7GQP1r.js +342 -0
  41. package/dist/Review-Z1XD6bJK.js +45 -0
  42. package/dist/ReviewFacebookCallback-DirGtKLX.js +248 -0
  43. package/dist/ReviewGoogleCallback-CVC6741e.js +213 -0
  44. package/dist/Reward-DDB5Usau.js +442 -0
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B-OnKAbx.js +149 -0
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DDHM8NLi.js +1911 -0
  47. package/dist/Segment-Bl0k9fvJ.js +1014 -0
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C33DPiN6.js +181 -0
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-YMpQ-IiW.js +188 -0
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang--Rtf3gRa.js +226 -0
  51. package/dist/Setting-CpD98E2N.js +2047 -0
  52. package/dist/SettingAdvertisements-BZFQu_HI.js +264 -0
  53. package/dist/Settings-CRqlKNsc.js +228 -0
  54. package/dist/Store-CDG2_iqc.js +1996 -0
  55. package/dist/StoreRewards-DIU5hPXv.js +540 -0
  56. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B82RH_ZC.js +1133 -0
  57. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DKGCmk5y.js +7007 -0
  58. package/dist/Tier-BXgIdYDa.js +969 -0
  59. package/dist/Title-DgHxyV8p.js +566 -0
  60. package/dist/Transaction-iDacnm6Y.js +39 -0
  61. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-RUbR6pdK.js +130 -0
  62. package/dist/Voucher-C-I8JK4F.js +421 -0
  63. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BUpYZxij.js +421 -0
  64. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-LhG5jJq3.js +56 -0
  65. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  66. package/dist/app-CyNzTZOx.js +59950 -0
  67. package/dist/app-wDQR6dpb.js +39 -0
  68. package/dist/app.js +7 -0
  69. package/dist/business-o_sAO_33.js +82 -0
  70. package/dist/campaign--IUcyI8h.js +219 -0
  71. package/dist/campaign-CpzFl8Vr.js +4 -0
  72. package/dist/campaign-zLKyql03.js +277 -0
  73. package/dist/campaign.enum-CEbNgaGZ.js +26 -0
  74. package/dist/campaign.fn-BVT0m6Uy.js +776 -0
  75. package/dist/collectible.enum-2y8KIQLL.js +19 -0
  76. package/dist/duplicateCampaign-DIzdQf0e.js +51 -0
  77. package/dist/effect-B6gKaH4T.js +89 -0
  78. package/dist/email-addresses-CO9GNnUN.js +705 -0
  79. package/dist/export-DdDpRFVg.js +97 -0
  80. package/dist/feedme.ico +0 -0
  81. package/dist/google-BQK68wbe.js +5 -0
  82. package/dist/helper-DqypCsTm.js +86 -0
  83. package/dist/index-BK0OmX3R.js +85 -0
  84. package/dist/index-Bc7JXl59.js +54 -0
  85. package/dist/index-BgiIGrLb.js +32 -0
  86. package/dist/index-C-TiT9bf.js +1157 -0
  87. package/dist/index-COXmoOd1.js +3678 -0
  88. package/dist/index-CT6uJJ9y.js +151 -0
  89. package/dist/index-Ci2gFCfD.js +61 -0
  90. package/dist/index-CtJ0MQQ1.js +3 -0
  91. package/dist/index-CuvNtC_M.js +61 -0
  92. package/dist/index-D41Xq5qY.js +8910 -0
  93. package/dist/index-DBD_e_yR.js +31 -0
  94. package/dist/index-DDpz9LmI.js +67 -0
  95. package/dist/index-Dh2apeby.js +2819 -0
  96. package/dist/index-DiDmMG_M.js +28900 -0
  97. package/dist/index-pjXQwa0j.js +30289 -0
  98. package/dist/index-vh86FiIQ.js +10 -0
  99. package/dist/index.esm2017-Cd4FhecE.js +3069 -0
  100. package/dist/loading-D-RglDMV.js +72 -0
  101. package/dist/lodash-cggYhL9V.js +3678 -0
  102. package/dist/membership-DTfMyKwP.js +255 -0
  103. package/dist/moment-D7p2TMB-.js +2583 -0
  104. package/dist/money-fGZfbdgV.js +15 -0
  105. package/dist/number-BOalh3ZH.js +12 -0
  106. package/dist/object-BYyQ0PZp.js +18 -0
  107. package/dist/objectId-dwaoBfJX.js +7 -0
  108. package/dist/objectid-zPJFVngY.js +145 -0
  109. package/dist/plugins-CbpvMMOJ.js +1788 -0
  110. package/dist/reward-DkVAHEq2.js +36 -0
  111. package/dist/rule-EzWg2u8d.js +1969 -0
  112. package/dist/string-Gcy5IM_H.js +32 -0
  113. package/dist/style.css +4 -0
  114. package/dist/template-BfVFq4on.js +188 -0
  115. package/dist/tier-BJDhpH6X.js +4 -0
  116. package/dist/tiers/tier=1.png +0 -0
  117. package/dist/tiers/tier=2.png +0 -0
  118. package/dist/tiers/tier=3.png +0 -0
  119. package/dist/tiers/tier=4.png +0 -0
  120. package/dist/titles/type=diamond.png +0 -0
  121. package/dist/titles/type=drinks.png +0 -0
  122. package/dist/titles/type=food.png +0 -0
  123. package/dist/titles/type=heart.png +0 -0
  124. package/dist/titles/type=medal.png +0 -0
  125. package/dist/titles/type=spend.png +0 -0
  126. package/dist/titles/type=thank-you.png +0 -0
  127. package/dist/titles/type=thumbs-up.png +0 -0
  128. package/dist/titles/type=years.png +0 -0
  129. package/dist/trigger-es-_uiSg.js +213 -0
  130. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  131. package/dist/type_drinks-D6jnpvwV.js +4 -0
  132. package/dist/useMarketingMaterialActions-CpiIKMmG.js +107 -0
  133. package/dist/usePagination-SYsXgU6x.js +220 -0
  134. package/dist/user-DUe40u3g.js +55 -0
  135. package/dist/vue-i18n-Dn9zxRuv.js +2365 -0
  136. package/dist/xlsx-DugGi7dB.js +15491 -0
  137. package/dist/zod-Dw8_B6RC.js +91 -0
  138. package/package.json +1 -1
@@ -0,0 +1,300 @@
1
+ import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
2
+ import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
+ import { p as P } from "./plugins-CbpvMMOJ.js";
5
+ import { u as oe } from "./loading-D-RglDMV.js";
6
+ import { u as ne } from "./business-o_sAO_33.js";
7
+ import { u as ae, c as C } from "./campaign--IUcyI8h.js";
8
+ import { u as se } from "./vue-i18n-Dn9zxRuv.js";
9
+ import { h as d } from "./moment-D7p2TMB-.js";
10
+ import { a as re, b as V } from "./campaign-zLKyql03.js";
11
+ import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.js";
12
+ import { u as le } from "./template-BfVFq4on.js";
13
+ import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
14
+ const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ q({
15
+ __name: "Grab",
16
+ setup(_e) {
17
+ const { t: o } = se(), I = {
18
+ label: o("connect.grab.createCampaign"),
19
+ value: "create",
20
+ isPrimary: !0,
21
+ prependIcon: "add"
22
+ }, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
23
+ {
24
+ label: "Bill promotion",
25
+ value: "BILL"
26
+ },
27
+ {
28
+ label: "Item promotion",
29
+ value: "ITEM"
30
+ }
31
+ ], c = L({
32
+ searchKey: "",
33
+ location: [],
34
+ effectType: []
35
+ });
36
+ function E(e) {
37
+ const t = c.value.location;
38
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
39
+ var r;
40
+ return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(a);
41
+ }) : e.targetLocation.includes(t);
42
+ }
43
+ function j(e) {
44
+ var r, s;
45
+ const t = c.value.effectType;
46
+ if (!t || t.length === 0) return !0;
47
+ const a = (s = (r = e.effect) == null ? void 0 : r.options) == null ? void 0 : s.target;
48
+ return t.includes(a);
49
+ }
50
+ const p = z(
51
+ () => g.campaigns.grab.filter(
52
+ (e) => E(e) && j(e)
53
+ )
54
+ ), G = [
55
+ {
56
+ header: o("connect.grab.promotionTitle"),
57
+ accessorFn: (e) => e.name
58
+ },
59
+ {
60
+ header: o("connect.grab.period"),
61
+ accessorFn: (e) => {
62
+ const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
63
+ return `${t} - ${a}`;
64
+ }
65
+ },
66
+ {
67
+ header: o("connect.grab.status"),
68
+ accessorFn: (e) => re(e),
69
+ cell(e) {
70
+ return V(e.row.original);
71
+ }
72
+ },
73
+ {
74
+ header: o("connect.grab.summary"),
75
+ cell(e) {
76
+ const t = ie(e.row.original.discount);
77
+ return t ? `${t.type} - ${t.adjustment}` : "-";
78
+ }
79
+ },
80
+ {
81
+ header: o("connect.grab.actions"),
82
+ cell(e) {
83
+ return J(te.FmButton, {
84
+ variant: "tertiary",
85
+ icon: "delete",
86
+ iconColor: "neutral-gray-400",
87
+ onClick: (t) => {
88
+ t.stopPropagation(), D(e.row.original);
89
+ }
90
+ });
91
+ }
92
+ }
93
+ ], B = L();
94
+ async function D(e) {
95
+ await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
96
+ async () => {
97
+ await C.delete(e._id), await g.read("PROMOTION");
98
+ },
99
+ {
100
+ message: o("connect.grab.removing", { name: e.name }),
101
+ successMessage: o("connect.grab.removedSuccessfully", {
102
+ name: e.name
103
+ })
104
+ }
105
+ );
106
+ }
107
+ async function b(e) {
108
+ e ? await t() : A.open(async (a) => {
109
+ await t(a);
110
+ });
111
+ async function t(a) {
112
+ var r;
113
+ (r = B.value) == null || r.showSheet(
114
+ !0,
115
+ "GRAB",
116
+ e ? await C.readById(e._id) : void 0,
117
+ a
118
+ );
119
+ }
120
+ }
121
+ async function N(e) {
122
+ var a;
123
+ const t = await U(e.campaign);
124
+ if (t.length > 0) {
125
+ const r = t.map(
126
+ (s) => `"${s.name}" (${d(s.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(s.timeframeOptions.end).format("DD/MM/YYYY")})`
127
+ ).join(`
128
+ `);
129
+ return await ((a = P.dialog) == null ? void 0 : a.open({
130
+ title: o("connect.grab.conflictDetected"),
131
+ message: o("connect.grab.conflictMessage", {
132
+ conflicts: r
133
+ }),
134
+ closeButton: !0,
135
+ overlay: !0,
136
+ primaryActions: {
137
+ close: !0,
138
+ text: "OK"
139
+ }
140
+ })), !1;
141
+ }
142
+ await T(
143
+ async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
144
+ {
145
+ message: o(
146
+ e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
147
+ ),
148
+ successMessage: o(
149
+ e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
150
+ )
151
+ }
152
+ );
153
+ }
154
+ async function U(e) {
155
+ const t = g.campaigns.grab, a = [], r = !!e._id;
156
+ for (const s of t) {
157
+ if (r && s._id === e._id) continue;
158
+ const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(s.timeframeOptions.start), v = d(s.timeframeOptions.end);
159
+ if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
160
+ const n = e.discount, w = s.discount;
161
+ n.scope.type === w.scope.type && a.push(s);
162
+ }
163
+ }
164
+ return a;
165
+ }
166
+ async function H(e) {
167
+ switch (e) {
168
+ case "create":
169
+ b();
170
+ break;
171
+ }
172
+ }
173
+ return Q(async () => {
174
+ await R(async () => {
175
+ await S.readLocations(), await g.read("PROMOTION");
176
+ });
177
+ }), (e, t) => {
178
+ const a = u("FmPill"), r = u("FmPageHead"), s = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
179
+ return f(), k(F, null, [
180
+ l(r, {
181
+ title: i(o)("connect.grab.title"),
182
+ actions: i(p).length > 0 ? [I] : [],
183
+ "onClick:action": H
184
+ }, {
185
+ prepend: x(() => [
186
+ l(a, { variant: "beta" }),
187
+ l(a, { variant: "premium" })
188
+ ]),
189
+ _: 1
190
+ }, 8, ["title", "actions"]),
191
+ m("div", me, [
192
+ l(s, {
193
+ modelValue: c.value.searchKey,
194
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
195
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
196
+ placeholder: i(o)("connect.grab.search"),
197
+ collapsible: ""
198
+ }, null, 8, ["modelValue", "placeholder"]),
199
+ i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
200
+ m("div", ue, [
201
+ m("div", de, [
202
+ l($, {
203
+ label: `${i(o)("connect.common.location")}: `,
204
+ "right-icon": "keyboard_arrow_down",
205
+ modelValue: c.value.location,
206
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
207
+ icon: "storefront",
208
+ "show-item-label": !0,
209
+ items: i(S).locationOptions
210
+ }, null, 8, ["label", "modelValue", "items"]),
211
+ l($, {
212
+ label: "Type:",
213
+ "right-icon": "keyboard_arrow_down",
214
+ modelValue: c.value.effectType,
215
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
216
+ icon: "filter_list",
217
+ "show-item-label": !0,
218
+ items: K
219
+ }, null, 8, ["modelValue"])
220
+ ]),
221
+ l(s, {
222
+ modelValue: c.value.searchKey,
223
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
224
+ class: "xs:hidden",
225
+ placeholder: "search",
226
+ collapsible: ""
227
+ }, null, 8, ["modelValue"])
228
+ ]),
229
+ l(_, {
230
+ class: "xs:hidden",
231
+ "row-data": i(p),
232
+ "column-defs": G,
233
+ "search-value": c.value.searchKey,
234
+ "column-filter": [],
235
+ onRowClick: t[4] || (t[4] = (n) => b(n.original)),
236
+ "hide-footer": i(p).length < 10
237
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
238
+ l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
239
+ default: x(() => [
240
+ (f(!0), k(F, null, W(i(p).filter(
241
+ (n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
242
+ ), (n) => (f(), O(h, {
243
+ key: n._id.toString(),
244
+ onClick: (w) => b(n),
245
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
246
+ }, {
247
+ default: x(() => [
248
+ m("div", pe, [
249
+ m("div", fe, [
250
+ (f(), O(X(i(V)(n))))
251
+ ])
252
+ ]),
253
+ l(y, {
254
+ icon: "delete",
255
+ "icon-color": "neutral-gray-400",
256
+ variant: "tertiary",
257
+ onClick: (w) => (w.stopPropagation(), D(n))
258
+ }, null, 8, ["onClick"])
259
+ ]),
260
+ _: 2
261
+ }, 1032, ["onClick"]))), 128))
262
+ ]),
263
+ _: 1
264
+ })
265
+ ], 64)) : (f(), O(M, {
266
+ key: 1,
267
+ variant: "outlined",
268
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
269
+ }, {
270
+ default: x(() => [
271
+ t[6] || (t[6] = m("img", {
272
+ src: Z,
273
+ class: "aspect-square w-[150px]"
274
+ }, null, -1)),
275
+ m("div", ge, [
276
+ m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
277
+ m("div", be, Y(i(o)("connect.grab.description")), 1)
278
+ ]),
279
+ l(y, {
280
+ variant: "primary",
281
+ label: i(o)("connect.grab.createPromotionCampaign"),
282
+ icon: "add",
283
+ onClick: t[5] || (t[5] = (n) => b())
284
+ }, null, 8, ["label"])
285
+ ]),
286
+ _: 1
287
+ }))
288
+ ]),
289
+ l(ce, {
290
+ ref_key: "sheetRef",
291
+ ref: B,
292
+ "onSubmit:modelValue": N
293
+ }, null, 512)
294
+ ], 64);
295
+ };
296
+ }
297
+ });
298
+ export {
299
+ Ye as default
300
+ };
@@ -0,0 +1,145 @@
1
+ import { openBlock as l, createElementBlock as o, createElementVNode as r, defineComponent as $, ref as b, onMounted as I, resolveComponent as f, renderSlot as x, toDisplayString as s, createCommentVNode as h, normalizeStyle as V, unref as i, Fragment as w, createVNode as F, withCtx as g, createTextVNode as p, normalizeClass as z, createBlock as k } from "vue";
2
+ import { u as R } from "./vue-i18n-Dn9zxRuv.js";
3
+ import { _ as H } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const N = {}, D = { class: "animate-pulse flex space-x-4 bg-gray-300 dark:bg-gray-700 items-center justify-center rounded w-full h-full" };
5
+ function L(e, d) {
6
+ return l(), o("div", D, [...d[0] || (d[0] = [
7
+ r("svg", {
8
+ class: "dark:text-gray-600 h-10 text-gray-200 w-10",
9
+ "aria-hidden": "true",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ fill: "currentColor",
12
+ viewBox: "0 0 20 18"
13
+ }, [
14
+ r("path", { d: "M18 0H2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Zm-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm4.376 10.481A1 1 0 0 1 16 15H4a1 1 0 0 1-.895-1.447l3.5-7A1 1 0 0 1 7.468 6a.965.965 0 0 1 .9.5l2.775 4.757 1.546-1.887a1 1 0 0 1 1.618.1l2.541 4a1 1 0 0 1 .028 1.011Z" })
15
+ ], -1)
16
+ ])]);
17
+ }
18
+ const T = /* @__PURE__ */ H(N, [["render", L]]), U = { class: "max-w-full max-h-[400px] space-y-4" }, Z = { key: 0 }, _ = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, A = {
19
+ key: 1,
20
+ class: "h-full w-full relative bg-fm-color-neutral-white p-12 border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md flex flex-col items-center justify-center gap-8 hover:border-fm-color-neutral-gray-400"
21
+ }, E = ["src"], M = ["src"], q = { class: "absolute right-0 top-0" }, J = /* @__PURE__ */ $({
22
+ __name: "ImageInput",
23
+ props: {
24
+ required: {
25
+ type: Boolean,
26
+ default: () => !1
27
+ },
28
+ disabled: {
29
+ type: Boolean,
30
+ default: () => !1
31
+ },
32
+ thumbnail: {
33
+ type: String,
34
+ default: () => {
35
+ }
36
+ },
37
+ file: {
38
+ type: File,
39
+ default: () => {
40
+ }
41
+ },
42
+ label: {
43
+ type: String,
44
+ default: () => {
45
+ }
46
+ },
47
+ aspectRatio: {
48
+ type: String,
49
+ default: "2/3"
50
+ },
51
+ imageFit: {
52
+ type: String,
53
+ default: "contain"
54
+ },
55
+ accept: {
56
+ type: String,
57
+ default: ".png, .jpg, .jpeg, .webm"
58
+ },
59
+ recommendedSize: {
60
+ type: String,
61
+ default: void 0
62
+ },
63
+ deleteButton: {
64
+ type: Boolean,
65
+ default: !0
66
+ }
67
+ },
68
+ emits: ["update:file"],
69
+ setup(e, { emit: d }) {
70
+ const { t: y } = R(), c = e, a = b({
71
+ loading: !1,
72
+ imgsrc: c.thumbnail
73
+ }), m = b(!1), v = d;
74
+ async function u(t) {
75
+ return t == null ? (a.value.imgsrc = void 0, v("update:file", null)) : (m.value = !!t.type.startsWith("video/"), a.value.loading = !0, a.value.imgsrc = URL.createObjectURL(t), a.value.loading = !1, v("update:file", t));
76
+ }
77
+ return I(() => {
78
+ var t;
79
+ c.file && u(c.file), (t = c.thumbnail) != null && t.includes("mp4") && (m.value = !0);
80
+ }), (t, n) => {
81
+ const S = f("FmDropField"), B = f("FmHelperText"), j = f("FmButton");
82
+ return l(), o("div", U, [
83
+ x(t.$slots, "label", {}, () => [
84
+ e.label ? (l(), o("div", Z, s(e.label), 1)) : h("", !0)
85
+ ]),
86
+ r("div", {
87
+ style: V({ "aspect-ratio": e.aspectRatio }),
88
+ class: "flex flex-col max-h-full max-w-full"
89
+ }, [
90
+ i(a).loading ? (l(), k(T, { key: 1 })) : (l(), o(w, { key: 0 }, [
91
+ i(a).imgsrc ? (l(), o("div", A, [
92
+ i(m) ? (l(), o("video", {
93
+ key: 1,
94
+ src: i(a).imgsrc || e.thumbnail,
95
+ class: "w-full h-full",
96
+ controls: ""
97
+ }, null, 8, M)) : (l(), o("img", {
98
+ key: 0,
99
+ class: z([`object-${e.imageFit}`, "w-full h-full"]),
100
+ src: i(a).imgsrc || e.thumbnail
101
+ }, null, 10, E)),
102
+ r("div", q, [
103
+ x(t.$slots, "delete-button"),
104
+ e.deleteButton ? (l(), k(j, {
105
+ key: 0,
106
+ class: "!text-neutral-50 !bg-neutral-700",
107
+ icon: "delete",
108
+ variant: "tertiary",
109
+ disabled: e.disabled,
110
+ onClick: n[1] || (n[1] = (C) => u(null))
111
+ }, null, 8, ["disabled"])) : h("", !0)
112
+ ])
113
+ ])) : (l(), o(w, { key: 0 }, [
114
+ F(S, {
115
+ class: "flex-1 hihiha",
116
+ accept: e.accept,
117
+ disabled: e.disabled,
118
+ onFileUpload: u,
119
+ onFileRejected: n[0] || (n[0] = (C) => u(null))
120
+ }, {
121
+ label: g(() => [...n[2] || (n[2] = [
122
+ p(s(void 0), -1)
123
+ ])]),
124
+ "helper-text": g(() => [...n[3] || (n[3] = [
125
+ p(s(void 0), -1)
126
+ ])]),
127
+ "accept-text": g(() => [
128
+ r("div", _, [
129
+ r("div", null, " (" + s(e.recommendedSize ?? i(y)("connect.common.imageInput.recommendedSize")) + ") ", 1),
130
+ p(" " + s(i(y)("connect.common.imageInput.accepts", { accept: e.accept })), 1)
131
+ ])
132
+ ]),
133
+ _: 1
134
+ }, 8, ["accept", "disabled"]),
135
+ F(B, { text: "" })
136
+ ], 64))
137
+ ], 64))
138
+ ], 4)
139
+ ]);
140
+ };
141
+ }
142
+ });
143
+ export {
144
+ J as _
145
+ };