@feedmepos/mf-settings 0.0.46-prod → 0.0.47-beta.1

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.
@@ -1,456 +0,0 @@
1
- import { defineComponent as q, openBlock as H, createElementBlock as G, createElementVNode as U, renderSlot as V, toDisplayString as le, normalizeClass as ae, toRaw as de, mergeModels as fe, useModel as he, computed as A, watchEffect as me, resolveComponent as z, createBlock as Z, withCtx as te, createVNode as Q, Fragment as pe, renderList as $e, markRaw as ve, render as ye, normalizeProps as ge, mergeProps as ne } from "vue";
2
- import { c as be, g as Me } from "./app-2087902c.js";
3
- import { useCoreStore as _e } from "@feedmepos/mf-common";
4
- import { useSnackbar as we, useBreakpoints as Se } from "@feedmepos/ui-library";
5
- const De = {
6
- class: /* @__PURE__ */ ae([
7
- "flex flex-col",
8
- "p-24 xs:p-0",
9
- "bg-fm-color-neutral-white",
10
- "min-h-[calc(100dvh-56px)]",
11
- "xs:max-h-[calc(100dvh-56px)]"
12
- ])
13
- }, xe = {
14
- class: /* @__PURE__ */ ae([
15
- "flex items-center",
16
- "mb-24 xs:mb-0 xs:p-16",
17
- "xs:border-b border-fm-color-neutral-gray-100"
18
- ])
19
- }, Ce = { class: "fm-typo-en-title-md-600" }, Ie = /* @__PURE__ */ q({
20
- __name: "PageLayout",
21
- props: {
22
- heading: {}
23
- },
24
- setup(f) {
25
- return (c, v) => (H(), G("div", De, [
26
- U("div", xe, [
27
- V(c.$slots, "prepend-heading"),
28
- U("div", null, [
29
- U("h1", Ce, le(c.heading), 1),
30
- V(c.$slots, "sub-heading")
31
- ]),
32
- V(c.$slots, "append-heading")
33
- ]),
34
- V(c.$slots, "default")
35
- ]));
36
- }
37
- });
38
- function re(f) {
39
- return JSON.parse(JSON.stringify(f));
40
- }
41
- function Le(f) {
42
- if (typeof structuredClone > "u")
43
- return re(f);
44
- try {
45
- return structuredClone(de(f));
46
- } catch {
47
- return re(f);
48
- }
49
- }
50
- var se = { exports: {} };
51
- (function(f, c) {
52
- (function(v, h) {
53
- f.exports = h();
54
- })(be, function() {
55
- var v = 1e3, h = 6e4, M = 36e5, m = "millisecond", d = "second", g = "minute", D = "hour", S = "day", T = "week", b = "month", J = "quarter", x = "year", B = "date", K = "Invalid Date", oe = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ie = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, ue = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(a) {
56
- var n = ["th", "st", "nd", "rd"], e = a % 100;
57
- return "[" + a + (n[(e - 20) % 10] || n[e] || n[0]) + "]";
58
- } }, P = function(a, n, e) {
59
- var r = String(a);
60
- return !r || r.length >= n ? a : "" + Array(n + 1 - r.length).join(e) + a;
61
- }, ce = { s: P, z: function(a) {
62
- var n = -a.utcOffset(), e = Math.abs(n), r = Math.floor(e / 60), t = e % 60;
63
- return (n <= 0 ? "+" : "-") + P(r, 2, "0") + ":" + P(t, 2, "0");
64
- }, m: function a(n, e) {
65
- if (n.date() < e.date())
66
- return -a(e, n);
67
- var r = 12 * (e.year() - n.year()) + (e.month() - n.month()), t = n.clone().add(r, b), s = e - t < 0, o = n.clone().add(r + (s ? -1 : 1), b);
68
- return +(-(r + (e - t) / (s ? t - o : o - t)) || 0);
69
- }, a: function(a) {
70
- return a < 0 ? Math.ceil(a) || 0 : Math.floor(a);
71
- }, p: function(a) {
72
- return { M: b, y: x, w: T, d: S, D: B, h: D, m: g, s: d, ms: m, Q: J }[a] || String(a || "").toLowerCase().replace(/s$/, "");
73
- }, u: function(a) {
74
- return a === void 0;
75
- } }, I = "en", k = {};
76
- k[I] = ue;
77
- var X = "$isDayjsObject", R = function(a) {
78
- return a instanceof W || !(!a || !a[X]);
79
- }, j = function a(n, e, r) {
80
- var t;
81
- if (!n)
82
- return I;
83
- if (typeof n == "string") {
84
- var s = n.toLowerCase();
85
- k[s] && (t = s), e && (k[s] = e, t = s);
86
- var o = n.split("-");
87
- if (!t && o.length > 1)
88
- return a(o[0]);
89
- } else {
90
- var u = n.name;
91
- k[u] = n, t = u;
92
- }
93
- return !r && t && (I = t), t || !r && I;
94
- }, p = function(a, n) {
95
- if (R(a))
96
- return a.clone();
97
- var e = typeof n == "object" ? n : {};
98
- return e.date = a, e.args = arguments, new W(e);
99
- }, i = ce;
100
- i.l = j, i.i = R, i.w = function(a, n) {
101
- return p(a, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
102
- };
103
- var W = function() {
104
- function a(e) {
105
- this.$L = j(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[X] = !0;
106
- }
107
- var n = a.prototype;
108
- return n.parse = function(e) {
109
- this.$d = function(r) {
110
- var t = r.date, s = r.utc;
111
- if (t === null)
112
- return /* @__PURE__ */ new Date(NaN);
113
- if (i.u(t))
114
- return /* @__PURE__ */ new Date();
115
- if (t instanceof Date)
116
- return new Date(t);
117
- if (typeof t == "string" && !/Z$/i.test(t)) {
118
- var o = t.match(oe);
119
- if (o) {
120
- var u = o[2] - 1 || 0, l = (o[7] || "0").substring(0, 3);
121
- return s ? new Date(Date.UTC(o[1], u, o[3] || 1, o[4] || 0, o[5] || 0, o[6] || 0, l)) : new Date(o[1], u, o[3] || 1, o[4] || 0, o[5] || 0, o[6] || 0, l);
122
- }
123
- }
124
- return new Date(t);
125
- }(e), this.init();
126
- }, n.init = function() {
127
- var e = this.$d;
128
- this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
129
- }, n.$utils = function() {
130
- return i;
131
- }, n.isValid = function() {
132
- return this.$d.toString() !== K;
133
- }, n.isSame = function(e, r) {
134
- var t = p(e);
135
- return this.startOf(r) <= t && t <= this.endOf(r);
136
- }, n.isAfter = function(e, r) {
137
- return p(e) < this.startOf(r);
138
- }, n.isBefore = function(e, r) {
139
- return this.endOf(r) < p(e);
140
- }, n.$g = function(e, r, t) {
141
- return i.u(e) ? this[r] : this.set(t, e);
142
- }, n.unix = function() {
143
- return Math.floor(this.valueOf() / 1e3);
144
- }, n.valueOf = function() {
145
- return this.$d.getTime();
146
- }, n.startOf = function(e, r) {
147
- var t = this, s = !!i.u(r) || r, o = i.p(e), u = function(F, _) {
148
- var C = i.w(t.$u ? Date.UTC(t.$y, _, F) : new Date(t.$y, _, F), t);
149
- return s ? C : C.endOf(S);
150
- }, l = function(F, _) {
151
- return i.w(t.toDate()[F].apply(t.toDate("s"), (s ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(_)), t);
152
- }, $ = this.$W, y = this.$M, w = this.$D, Y = "set" + (this.$u ? "UTC" : "");
153
- switch (o) {
154
- case x:
155
- return s ? u(1, 0) : u(31, 11);
156
- case b:
157
- return s ? u(1, y) : u(0, y + 1);
158
- case T:
159
- var O = this.$locale().weekStart || 0, L = ($ < O ? $ + 7 : $) - O;
160
- return u(s ? w - L : w + (6 - L), y);
161
- case S:
162
- case B:
163
- return l(Y + "Hours", 0);
164
- case D:
165
- return l(Y + "Minutes", 1);
166
- case g:
167
- return l(Y + "Seconds", 2);
168
- case d:
169
- return l(Y + "Milliseconds", 3);
170
- default:
171
- return this.clone();
172
- }
173
- }, n.endOf = function(e) {
174
- return this.startOf(e, !1);
175
- }, n.$set = function(e, r) {
176
- var t, s = i.p(e), o = "set" + (this.$u ? "UTC" : ""), u = (t = {}, t[S] = o + "Date", t[B] = o + "Date", t[b] = o + "Month", t[x] = o + "FullYear", t[D] = o + "Hours", t[g] = o + "Minutes", t[d] = o + "Seconds", t[m] = o + "Milliseconds", t)[s], l = s === S ? this.$D + (r - this.$W) : r;
177
- if (s === b || s === x) {
178
- var $ = this.clone().set(B, 1);
179
- $.$d[u](l), $.init(), this.$d = $.set(B, Math.min(this.$D, $.daysInMonth())).$d;
180
- } else
181
- u && this.$d[u](l);
182
- return this.init(), this;
183
- }, n.set = function(e, r) {
184
- return this.clone().$set(e, r);
185
- }, n.get = function(e) {
186
- return this[i.p(e)]();
187
- }, n.add = function(e, r) {
188
- var t, s = this;
189
- e = Number(e);
190
- var o = i.p(r), u = function(y) {
191
- var w = p(s);
192
- return i.w(w.date(w.date() + Math.round(y * e)), s);
193
- };
194
- if (o === b)
195
- return this.set(b, this.$M + e);
196
- if (o === x)
197
- return this.set(x, this.$y + e);
198
- if (o === S)
199
- return u(1);
200
- if (o === T)
201
- return u(7);
202
- var l = (t = {}, t[g] = h, t[D] = M, t[d] = v, t)[o] || 1, $ = this.$d.getTime() + e * l;
203
- return i.w($, this);
204
- }, n.subtract = function(e, r) {
205
- return this.add(-1 * e, r);
206
- }, n.format = function(e) {
207
- var r = this, t = this.$locale();
208
- if (!this.isValid())
209
- return t.invalidDate || K;
210
- var s = e || "YYYY-MM-DDTHH:mm:ssZ", o = i.z(this), u = this.$H, l = this.$m, $ = this.$M, y = t.weekdays, w = t.months, Y = t.meridiem, O = function(_, C, N, E) {
211
- return _ && (_[C] || _(r, s)) || N[C].slice(0, E);
212
- }, L = function(_) {
213
- return i.s(u % 12 || 12, _, "0");
214
- }, F = Y || function(_, C, N) {
215
- var E = _ < 12 ? "AM" : "PM";
216
- return N ? E.toLowerCase() : E;
217
- };
218
- return s.replace(ie, function(_, C) {
219
- return C || function(N) {
220
- switch (N) {
221
- case "YY":
222
- return String(r.$y).slice(-2);
223
- case "YYYY":
224
- return i.s(r.$y, 4, "0");
225
- case "M":
226
- return $ + 1;
227
- case "MM":
228
- return i.s($ + 1, 2, "0");
229
- case "MMM":
230
- return O(t.monthsShort, $, w, 3);
231
- case "MMMM":
232
- return O(w, $);
233
- case "D":
234
- return r.$D;
235
- case "DD":
236
- return i.s(r.$D, 2, "0");
237
- case "d":
238
- return String(r.$W);
239
- case "dd":
240
- return O(t.weekdaysMin, r.$W, y, 2);
241
- case "ddd":
242
- return O(t.weekdaysShort, r.$W, y, 3);
243
- case "dddd":
244
- return y[r.$W];
245
- case "H":
246
- return String(u);
247
- case "HH":
248
- return i.s(u, 2, "0");
249
- case "h":
250
- return L(1);
251
- case "hh":
252
- return L(2);
253
- case "a":
254
- return F(u, l, !0);
255
- case "A":
256
- return F(u, l, !1);
257
- case "m":
258
- return String(l);
259
- case "mm":
260
- return i.s(l, 2, "0");
261
- case "s":
262
- return String(r.$s);
263
- case "ss":
264
- return i.s(r.$s, 2, "0");
265
- case "SSS":
266
- return i.s(r.$ms, 3, "0");
267
- case "Z":
268
- return o;
269
- }
270
- return null;
271
- }(_) || o.replace(":", "");
272
- });
273
- }, n.utcOffset = function() {
274
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
275
- }, n.diff = function(e, r, t) {
276
- var s, o = this, u = i.p(r), l = p(e), $ = (l.utcOffset() - this.utcOffset()) * h, y = this - l, w = function() {
277
- return i.m(o, l);
278
- };
279
- switch (u) {
280
- case x:
281
- s = w() / 12;
282
- break;
283
- case b:
284
- s = w();
285
- break;
286
- case J:
287
- s = w() / 3;
288
- break;
289
- case T:
290
- s = (y - $) / 6048e5;
291
- break;
292
- case S:
293
- s = (y - $) / 864e5;
294
- break;
295
- case D:
296
- s = y / M;
297
- break;
298
- case g:
299
- s = y / h;
300
- break;
301
- case d:
302
- s = y / v;
303
- break;
304
- default:
305
- s = y;
306
- }
307
- return t ? s : i.a(s);
308
- }, n.daysInMonth = function() {
309
- return this.endOf(b).$D;
310
- }, n.$locale = function() {
311
- return k[this.$L];
312
- }, n.locale = function(e, r) {
313
- if (!e)
314
- return this.$L;
315
- var t = this.clone(), s = j(e, r, !0);
316
- return s && (t.$L = s), t;
317
- }, n.clone = function() {
318
- return i.w(this.$d, this);
319
- }, n.toDate = function() {
320
- return new Date(this.valueOf());
321
- }, n.toJSON = function() {
322
- return this.isValid() ? this.toISOString() : null;
323
- }, n.toISOString = function() {
324
- return this.$d.toISOString();
325
- }, n.toString = function() {
326
- return this.$d.toUTCString();
327
- }, a;
328
- }(), ee = W.prototype;
329
- return p.prototype = ee, [["$ms", m], ["$s", d], ["$m", g], ["$H", D], ["$W", S], ["$M", b], ["$y", x], ["$D", B]].forEach(function(a) {
330
- ee[a[1]] = function(n) {
331
- return this.$g(n, a[0], a[1]);
332
- };
333
- }), p.extend = function(a, n) {
334
- return a.$i || (a(n, W, p), a.$i = !0), p;
335
- }, p.locale = j, p.isDayjs = R, p.unix = function(a) {
336
- return p(1e3 * a);
337
- }, p.en = k[I], p.Ls = k, p.p = {}, p;
338
- });
339
- })(se);
340
- var ke = se.exports;
341
- const Ne = /* @__PURE__ */ Me(ke), je = /* @__PURE__ */ q({
342
- __name: "RestaurantSelector",
343
- props: /* @__PURE__ */ fe({
344
- managableOnly: { type: Boolean, default: !1 },
345
- excludeRestaurants: {},
346
- label: {},
347
- autoSelectFirst: { type: Boolean, default: !1 }
348
- }, {
349
- modelValue: {},
350
- modelModifiers: {}
351
- }),
352
- emits: ["update:modelValue"],
353
- setup(f) {
354
- const c = f, v = he(f, "modelValue"), { restaurants: h } = _e(), M = A(() => {
355
- var d;
356
- return ((d = m.value.find((g) => g.value === v.value)) == null ? void 0 : d.label) || "Select restaurant";
357
- }), m = A(
358
- () => h.value.filter((d) => c.managableOnly ? d.managable : !0).map((d) => ({
359
- label: d.profile.name,
360
- value: d._id
361
- })).filter((d) => {
362
- var g;
363
- return !((g = c.excludeRestaurants) != null && g.includes(d.value));
364
- })
365
- );
366
- return me(() => {
367
- c.autoSelectFirst && m.value.length > 0 && (v.value = m.value[0].value);
368
- }), (d, g) => {
369
- const D = z("FmChip"), S = z("FmMenuItem"), T = z("FmMenu");
370
- return H(), Z(T, null, {
371
- "menu-button": te(() => [
372
- Q(D, {
373
- icon: "storefront",
374
- label: M.value,
375
- "right-icon": "keyboard_arrow_down"
376
- }, null, 8, ["label"])
377
- ]),
378
- default: te(() => [
379
- (H(!0), G(pe, null, $e(m.value, (b) => (H(), Z(S, {
380
- key: b.value,
381
- label: b.label,
382
- onClick: (J) => v.value = b.value
383
- }, null, 8, ["label", "onClick"]))), 128))
384
- ]),
385
- _: 1
386
- });
387
- };
388
- }
389
- });
390
- function We() {
391
- const f = we();
392
- return { copyTextToClipboard: async (v, h = "Copied") => {
393
- const M = "text/plain", m = new Blob([v], { type: M }), d = [new ClipboardItem({ [M]: m })];
394
- await navigator.clipboard.write(d), h && f.open({
395
- title: h,
396
- message: v,
397
- type: "success"
398
- });
399
- } };
400
- }
401
- const Oe = (f, c, v) => {
402
- if (!c)
403
- throw new Error("No current instance found");
404
- const h = document.createElement("div");
405
- document.body.appendChild(h);
406
- const M = ve(f), m = Q(M, v);
407
- return m.appContext = c.appContext, ye(m, h), { container: h, vNode: m };
408
- };
409
- function Ee(f, c, v) {
410
- var M, m;
411
- const { vNode: h } = Oe(c, f, v);
412
- (m = (M = h.component) == null ? void 0 : M.exposed) == null || m.trigger();
413
- }
414
- const Fe = {
415
- key: 1,
416
- class: "z-10 fixed bottom-72 right-16"
417
- }, Ve = /* @__PURE__ */ q({
418
- __name: "ResponsiveFabButton",
419
- props: {
420
- variant: {},
421
- label: {},
422
- icon: {},
423
- size: {},
424
- disabled: { type: Boolean },
425
- iconColor: {},
426
- borderColor: {},
427
- textColor: {},
428
- bgColor: {},
429
- type: {},
430
- iconPosition: {},
431
- prependIcon: {},
432
- appendIcon: {},
433
- loading: { type: Boolean },
434
- disableIconStatus: { type: Boolean },
435
- overwriteIconOutline: {}
436
- },
437
- setup(f) {
438
- const c = f, v = A(() => c.variant === "primary" || !c.variant ? "fab" : c.variant), h = Se(), M = A(() => h.breakpoints.value.xs);
439
- return (m, d) => {
440
- const g = z("FmButton");
441
- return M.value ? (H(), G("div", Fe, [
442
- Q(g, ne(c, { variant: v.value }), null, 16, ["variant"])
443
- ])) : (H(), Z(g, ge(ne({ key: 0 }, c)), null, 16));
444
- };
445
- }
446
- });
447
- export {
448
- Ne as D,
449
- je as _,
450
- Ie as a,
451
- Ve as b,
452
- Le as c,
453
- Ee as d,
454
- ke as e,
455
- We as u
456
- };
@@ -1,27 +0,0 @@
1
- import { defineComponent as o, computed as c, resolveComponent as u, openBlock as s, createElementBlock as a, createVNode as m } from "vue";
2
- import { useCoreStore as i, FeedMeAuth as l } from "@feedmepos/mf-common";
3
- const d = {
4
- key: 0,
5
- class: "w-full h-full flex items-center justify-center"
6
- }, p = ["src"], b = /* @__PURE__ */ o({
7
- __name: "TemplateBuilder",
8
- setup(f) {
9
- const e = i(), t = c(() => {
10
- var r;
11
- return e.currentBusiness.value ? `https://print-template-builder.feedme.cc//#/receipt-info?businessId=${(r = e.currentBusiness.value) == null ? void 0 : r.id}&country=${e.currentCountry.value}&token=${l.token}` : "";
12
- });
13
- return (r, _) => {
14
- const n = u("FmCircularProgress");
15
- return t.value ? (s(), a("iframe", {
16
- key: 1,
17
- class: "w-full h-full",
18
- src: t.value
19
- }, null, 8, p)) : (s(), a("div", d, [
20
- m(n, { size: "lg" })
21
- ]));
22
- };
23
- }
24
- });
25
- export {
26
- b as default
27
- };