@feedmepos/mf-settings 0.0.48-beta.0-ex → 0.0.49

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,4182 +0,0 @@
1
- var Lr = Object.defineProperty;
2
- var Nr = (r, e, t) => e in r ? Lr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var ze = (r, e, t) => (Nr(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { ref as ae, computed as W, defineComponent as ee, resolveComponent as q, openBlock as D, createBlock as Q, Teleport as Cr, createVNode as C, Transition as kr, withCtx as H, normalizeClass as Z, normalizeStyle as Fe, withKeys as xr, createElementVNode as O, toDisplayString as B, renderSlot as me, createElementBlock as K, Fragment as oe, renderList as be, createCommentVNode as fe, createTextVNode as je, h as Ot, unref as S, watch as At, onMounted as Mr, onUnmounted as Vr, toRaw as St, reactive as mt, normalizeProps as Fr, guardReactiveProps as jr, withModifiers as it, nextTick as Dr, getCurrentInstance as Ur, isRef as Tt } from "vue";
5
- import { c as cr, g as pt, a as we, b as De, d as _e, e as Gr, f as Br, h as Xe, i as We, j as ht, k as Je, r as Ze, l as Kr, u as Hr, m as qr, n as Yr, o as dr, p as zr, _ as Ae, q as Xr, s as Wr, t as Jr, v as Qe } from "./app-29117ada.js";
6
- import { F_PAYOUT_ACCOUNT_STATUS as Zr, F_COUNTRY as fr } from "@feedmepos/core/entity";
7
- import { useCoreStore as ge, useI18n as ye, CustomAttributesForm as Qr } from "@feedmepos/mf-common";
8
- import { useDialog as mr, useDialogChild as en, useSnackbar as vt, useBreakpoints as pr, components as tn } from "@feedmepos/ui-library";
9
- import { _ as hr, r as he } from "./rules-c9fa22f8.js";
10
- import { u as vr, _ as rn, a as nn } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-65f62fbb.js";
11
- import "@feedmepos/mf-mdm";
12
- import "vue-router";
13
- import "@feedmepos/mf-e-invoice";
14
- import "pinia";
15
- import "@vue/devtools-api";
16
- import "@feedmepos/core";
17
- var sn = {};
18
- (function(r) {
19
- Object.defineProperty(r, "__esModule", { value: !0 }), function(e) {
20
- e.SLOT_SALE = "SLOT_SALE";
21
- }(r.ReportWidgetType || (r.ReportWidgetType = {})), function(e) {
22
- e.v2 = "v2", e.v3 = "v3", e.v4 = "v4";
23
- }(r.MENU_VERSION || (r.MENU_VERSION = {})), function(e) {
24
- e.Polygon = "Polygon";
25
- }(r.GeometryType || (r.GeometryType = {})), function(e) {
26
- e.stock = "stock", e.discovery = "discovery", e.pickup = "pickup", e.delivery = "delivery", e.foodpanda = "foodpanda", e.deliveryIntegration = "deliveryIntegration", e.kds = "kds", e.ods = "ods";
27
- }(r.RestaurantFeature || (r.RestaurantFeature = {})), function(e) {
28
- e.alpha = "alpha", e.beta = "beta", e.latest = "latest";
29
- }(r.RestaurantChannel || (r.RestaurantChannel = {})), function(e) {
30
- e.pickup = "pickup", e.delivery = "delivery";
31
- }(r.DiscoveryType || (r.DiscoveryType = {})), function(e) {
32
- e.new = "NEW", e.pending = "PENDING", e.approved = "APPROVED";
33
- }(r.PAYOUT_ACCOUNT_STATUS || (r.PAYOUT_ACCOUNT_STATUS = {})), function(e) {
34
- e.maybank = "MAYBANK", e.cimbBank = "CIMB_BANK", e.rhbBank = "RHB_BANK", e.bankIslam = "BANK_ISLAM", e.bankMuamalat = "BANK_MUAMALAT", e.bankRakyat = "BANK_RAKYAT", e.bankSimpananNasional = "BANK_SIMPANAN_NASIONAL", e.citiBank = "CITIBANK", e.hongLeongBank = "HONG_LEONG_BANK", e.hsbcBank = "HSBC_BANK", e.ocbcBank = "OCBC_BANK", e.publicBank = "PUBLIC_BANK", e.affinBank = "AFFIN_BANK", e.amBank = "AMBANK", e.agroBank = "AGRO_BANK", e.allianceBank = "ALLIANCE_BANK", e.alRajhiBank = "AL_RAJHI_BANK", e.bankOfChina = "BANK_OF_CHINA", e.bankOfAmerica = "BANK_OF_AMERICA", e.bankOfTokyoMitsubishiUFJ = "BANK_OF_TOKYO_MITSUBISHI_UFJ", e.bnpParibas = "BNP_PARIBAS", e.deutscheBank = "DEUTSCHE_BANK", e.industrialCommercialBankOfChina = "INDUSTRIAL_COMMERCIAL_BANK_OF_CHINA", e.jpMorganChaseBank = "JP_MORGAN_CHASE_BANK", e.kuwaitFinanceHouse = "KUWAIT_FINANCE_HOUSE", e.mizuhoBank = "MIZUHO_BANK", e.standardCharteredBank = "STANDARD_CHARTERED_BANK", e.sumitomoMitsuiBankingCorporation = "SUMITOMO_MITSUI_BANKING_CORPORATION", e.theRoyalBankOfScotland = "THE_ROYAL_BANK_OF_SCOTLAND", e.unitedOverseasBank = "UNITED_OVERSEAS_BANK";
35
- }(r.BankName || (r.BankName = {})), function(e) {
36
- e.current = "CURRENT_ACCOUNT", e.saving = "SAVING_ACCOUNT";
37
- }(r.BankType || (r.BankType = {})), function(e) {
38
- e[e.maybank = 100002270] = "maybank", e[e.cimbBank = 100002050] = "cimbBank", e[e.rhbBank = 100002186] = "rhbBank", e[e.bankIslam = 100002458] = "bankIslam", e[e.bankMuamalat = 100002458] = "bankMuamalat", e[e.bankRakyat = 100016020] = "bankRakyat", e[e.bankSimpananNasional = 100016017] = "bankSimpananNasional", e[e.citiBank = 100002173] = "citiBank", e[e.hongLeongBank = 100002241] = "hongLeongBank", e[e.hsbcBank = 100002225] = "hsbcBank", e[e.ocbcBank = 100002296] = "ocbcBank", e[e.publicBank = 100002335] = "publicBank", e[e.affinBank = 100002322] = "affinBank", e[e.amBank = 100002089] = "amBank", e[e.agroBank = 100033061] = "agroBank", e[e.allianceBank = 100002128] = "allianceBank", e[e.alRajhiBank = 100003509] = "alRajhiBank", e[e.bankOfChina = 100002429] = "bankOfChina", e[e.bankOfAmerica = 100002076] = "bankOfAmerica", e[e.bankOfTokyoMitsubishiUFJ = 100002102] = "bankOfTokyoMitsubishiUFJ", e[e.bnpParibas = 100002636] = "bnpParibas", e[e.deutscheBank = 100002199] = "deutscheBank", e[e.industrialCommercialBankOfChina = 100002597] = "industrialCommercialBankOfChina", e[e.jpMorganChaseBank = 100002157] = "jpMorganChaseBank", e[e.kuwaitFinanceHouse = 100003460] = "kuwaitFinanceHouse", e[e.mizuhoBank = 100002610] = "mizuhoBank", e[e.standardCharteredBank = 100002144] = "standardCharteredBank", e[e.sumitomoMitsuiBankingCorporation = 100002623] = "sumitomoMitsuiBankingCorporation", e[e.unitedOverseasBank = 100002267] = "unitedOverseasBank";
39
- }(r.BankRouting || (r.BankRouting = {})), function(e) {
40
- e.maybank = "MBBEMYKL", e.cimbBank = "CIBBMYKL", e.rhbBank = "RHBBMYKL", e.bankIslam = "BIMBMYKL", e.bankMuamalat = "BMMBMYKL", e.bankRakyat = "BKRMMYKL", e.bankSimpananNasional = "BSNAMYK1", e.citiBank = "CITIMYKL", e.hongLeongBank = "HLBBMYKL", e.hsbcBank = "HBMBMYKL", e.ocbcBank = "OCBCMYKL", e.publicBank = "PBBEMYKL", e.affinBank = "PHBMMYKL", e.amBank = "ARBKMYKL", e.agroBank = "AGOBMYKL", e.allianceBank = "MFBBMYKL", e.alRajhiBank = "RJHIMYKL", e.bankOfChina = "BKCHMYKL", e.bankOfAmerica = "BOFAMY2X", e.bankOfTokyoMitsubishiUFJ = "BOTKMYKX", e.bnpParibas = "BNPAMYKL", e.deutscheBank = "DEUTMYKL", e.industrialCommercialBankOfChina = "ICBKMYKL", e.jpMorganChaseBank = "CHASMYKX", e.kuwaitFinanceHouse = "KFHOMYKL", e.mizuhoBank = "MHCBMYKA", e.standardCharteredBank = "SCBLMYKX", e.sumitomoMitsuiBankingCorporation = "SMBCMYKL", e.unitedOverseasBank = "UOVBMYKL";
41
- }(r.BankSwiftCode || (r.BankSwiftCode = {})), function(e) {
42
- e.grab = "Grab", e.merchant = "Merchant", e.partner = "Partner";
43
- }(r.GF_CAMPAIGN_CREATED_BY || (r.GF_CAMPAIGN_CREATED_BY = {})), function(e) {
44
- e.all = "all", e.new = "new";
45
- }(r.GF_CAMPAIGN_EATER_TYPE || (r.GF_CAMPAIGN_EATER_TYPE = {})), function(e) {
46
- e.net = "net", e.percentage = "percentage", e.delivery = "delivery", e.freeItem = "freeItem";
47
- }(r.GF_CAMPAIGN_DISCOUNT_TYPE || (r.GF_CAMPAIGN_DISCOUNT_TYPE = {})), function(e) {
48
- e.order = "order", e.items = "items";
49
- }(r.GF_CAMPAIGN_SCOPE_TYPE || (r.GF_CAMPAIGN_SCOPE_TYPE = {}));
50
- })(sn);
51
- var gr = { exports: {} };
52
- (function(r, e) {
53
- (function(t, n) {
54
- r.exports = n();
55
- })(cr, function() {
56
- return function(t) {
57
- var n = {};
58
- function s(o) {
59
- if (n[o])
60
- return n[o].exports;
61
- var i = n[o] = { i: o, l: !1, exports: {} };
62
- return t[o].call(i.exports, i, i.exports, s), i.l = !0, i.exports;
63
- }
64
- return s.m = t, s.c = n, s.d = function(o, i, h) {
65
- s.o(o, i) || Object.defineProperty(o, i, { enumerable: !0, get: h });
66
- }, s.r = function(o) {
67
- typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
68
- }, s.t = function(o, i) {
69
- if (1 & i && (o = s(o)), 8 & i || 4 & i && typeof o == "object" && o && o.__esModule)
70
- return o;
71
- var h = /* @__PURE__ */ Object.create(null);
72
- if (s.r(h), Object.defineProperty(h, "default", { enumerable: !0, value: o }), 2 & i && typeof o != "string")
73
- for (var p in o)
74
- s.d(
75
- h,
76
- p,
77
- (function(d) {
78
- return o[d];
79
- }).bind(null, p)
80
- );
81
- return h;
82
- }, s.n = function(o) {
83
- var i = o && o.__esModule ? function() {
84
- return o.default;
85
- } : function() {
86
- return o;
87
- };
88
- return s.d(i, "a", i), i;
89
- }, s.o = function(o, i) {
90
- return Object.prototype.hasOwnProperty.call(o, i);
91
- }, s.p = "", s(s.s = 0);
92
- }([
93
- function(t, n, s) {
94
- t.exports = s(1);
95
- },
96
- function(t, n, s) {
97
- function o(a) {
98
- return (o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
99
- return typeof l;
100
- } : function(l) {
101
- return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
102
- })(a);
103
- }
104
- function i(a) {
105
- var l = "[object " + a + "]";
106
- return function(g) {
107
- return Object.prototype.toString.call(g) === l;
108
- };
109
- }
110
- s.r(n), s.d(n, "default", function() {
111
- return Y;
112
- }), s.d(n, "compare", function() {
113
- return G;
114
- }), s.d(n, "comparable", function() {
115
- return z;
116
- });
117
- var h = i("Array"), p = i("Object"), d = i("Function");
118
- function _(a, l) {
119
- return d(a.get) ? a.get(l) : a[l];
120
- }
121
- function $(a) {
122
- return function(l, g) {
123
- if (!h(g) || !g.length)
124
- return a(l, g);
125
- for (var A = 0, L = g.length; A < L; A++)
126
- if (a(l, _(g, A)))
127
- return !0;
128
- return !1;
129
- };
130
- }
131
- function y(a) {
132
- return function(l, g) {
133
- if (!h(g) || !g.length)
134
- return a(l, g);
135
- for (var A = 0, L = g.length; A < L; A++)
136
- if (!a(l, _(g, A)))
137
- return !1;
138
- return !0;
139
- };
140
- }
141
- function w(a, l, g, A) {
142
- return a.validate(a.options, l, g, A);
143
- }
144
- var E = {
145
- $eq: $(function(a, l) {
146
- return a(l);
147
- }),
148
- $ne: y(function(a, l) {
149
- return a(l);
150
- }),
151
- $gt: $(function(a, l) {
152
- return a(l);
153
- }),
154
- $gte: $(function(a, l) {
155
- return a(l);
156
- }),
157
- $lt: $(function(a, l) {
158
- return a(l);
159
- }),
160
- $lte: $(function(a, l) {
161
- return a(l);
162
- }),
163
- $mod: $(function(a, l) {
164
- return a(l);
165
- }),
166
- $in: function(a, l) {
167
- return a(l);
168
- },
169
- $nin: function(a, l) {
170
- return a(l);
171
- },
172
- $not: function(a, l, g, A) {
173
- return a(l, g, A);
174
- },
175
- $type: function(a, l) {
176
- return a(l);
177
- },
178
- $all: function(a, l, g, A) {
179
- return E.$and(a, l, g, A);
180
- },
181
- $size: function(a, l) {
182
- return !!l && a === l.length;
183
- },
184
- $or: function(a, l, g, A) {
185
- for (var L = 0, f = a.length; L < f; L++)
186
- if (w(_(a, L), l, g, A))
187
- return !0;
188
- return !1;
189
- },
190
- $nor: function(a, l, g, A) {
191
- return !E.$or(a, l, g, A);
192
- },
193
- $and: function(a, l, g, A) {
194
- for (var L = 0, f = a.length; L < f; L++)
195
- if (!w(_(a, L), l, g, A))
196
- return !1;
197
- return !0;
198
- },
199
- $regex: $(function(a, l) {
200
- return typeof l == "string" && a.test(l);
201
- }),
202
- $where: function(a, l, g, A) {
203
- return a.call(l, l, g, A);
204
- },
205
- $elemMatch: function(a, l, g, A) {
206
- return h(l) ? !!~function(L, f) {
207
- for (var u = 0; u < L.length; u++)
208
- if (_(L, u), w(f, _(L, u)))
209
- return u;
210
- return -1;
211
- }(l, a) : w(a, l, g, A);
212
- },
213
- $exists: function(a, l, g, A) {
214
- return A.hasOwnProperty(g) === a;
215
- }
216
- }, R = {
217
- $eq: function(a, l, g) {
218
- var A = g.comparable, L = g.compare;
219
- return a instanceof RegExp ? $(function(f) {
220
- return typeof f == "string" && a.test(f);
221
- }) : a instanceof Function ? $(a) : h(a) && !a.length ? $(function(f) {
222
- return h(f) && !f.length;
223
- }) : $(
224
- a === null ? function(f) {
225
- return f == null;
226
- } : function(f) {
227
- return L(A(f), A(a)) === 0;
228
- }
229
- );
230
- },
231
- $gt: function(a, l, g) {
232
- var A = g.comparable, L = g.compare;
233
- return function(f) {
234
- return L(A(f), A(a)) > 0;
235
- };
236
- },
237
- $gte: function(a, l, g) {
238
- var A = g.comparable, L = g.compare;
239
- return function(f) {
240
- return L(A(f), A(a)) >= 0;
241
- };
242
- },
243
- $lt: function(a, l, g) {
244
- var A = g.comparable, L = g.compare;
245
- return function(f) {
246
- return L(A(f), A(a)) < 0;
247
- };
248
- },
249
- $lte: function(a, l, g) {
250
- var A = g.comparable, L = g.compare;
251
- return function(f) {
252
- return L(A(f), A(a)) <= 0;
253
- };
254
- },
255
- $in: function(a, l, g) {
256
- var A = g.comparable;
257
- return function(L) {
258
- if (!(L instanceof Array)) {
259
- var f = A(L);
260
- if (f === L && o(L) === "object") {
261
- for (m = a.length; m--; )
262
- if (String(a[m]) === String(L) && String(L) !== "[object Object]")
263
- return !0;
264
- }
265
- if (f === void 0) {
266
- for (m = a.length; m--; )
267
- if (a[m] == null)
268
- return !0;
269
- }
270
- for (m = a.length; m--; ) {
271
- var u = w(X(_(a, m), g), f, m, a);
272
- if (u && String(u) !== "[object Object]" && String(f) !== "[object Object]")
273
- return !0;
274
- }
275
- return !!~a.indexOf(f);
276
- }
277
- for (var m = L.length; m--; )
278
- if (~a.indexOf(A(_(L, m))))
279
- return !0;
280
- return !1;
281
- };
282
- },
283
- $nin: function(a, l, g) {
284
- var A = R.$in(a, l, g);
285
- return function(L, f, u, m) {
286
- return !A(L, f, u, m);
287
- };
288
- },
289
- $mod: function(a) {
290
- return function(l) {
291
- return l % a[0] == a[1];
292
- };
293
- },
294
- $ne: function(a, l, g) {
295
- var A = R.$eq(a, l, g);
296
- return y(function(L, f, u, m) {
297
- return !A(L, f, u, m);
298
- });
299
- },
300
- $and: function(a, l, g) {
301
- return a.map(T(g));
302
- },
303
- $all: function(a, l, g) {
304
- return R.$and(a, l, g);
305
- },
306
- $or: function(a, l, g) {
307
- return a.map(T(g));
308
- },
309
- $nor: function(a, l, g) {
310
- return a.map(T(g));
311
- },
312
- $not: function(a, l, g) {
313
- var A = T(g)(a);
314
- return function(L, f, u) {
315
- return !w(A, L, f, u);
316
- };
317
- },
318
- $type: function(a) {
319
- return function(l, g, A) {
320
- return l != null && (l instanceof a || l.constructor == a);
321
- };
322
- },
323
- $regex: function(a, l) {
324
- return new RegExp(a, l.$options);
325
- },
326
- $where: function(a) {
327
- if (typeof a == "function")
328
- return a;
329
- throw new Error(
330
- 'In CSP mode, sift does not support strings in "$where" condition'
331
- );
332
- },
333
- $elemMatch: function(a, l, g) {
334
- return T(g)(a);
335
- },
336
- $exists: function(a) {
337
- return !!a;
338
- }
339
- };
340
- function M(a, l) {
341
- return { options: a, validate: l };
342
- }
343
- function k(a, l) {
344
- var g = a.keyPath, A = a.child, L = a.query, f = [];
345
- if (function x(N, P, j, V, J) {
346
- if (j === P.length || N == null)
347
- return void J.push([N, P[j - 1], V]);
348
- var ne = _(P, j);
349
- if (h(N) && isNaN(Number(ne)))
350
- for (var ce = 0, de = N.length; ce < de; ce++)
351
- x(_(N, ce), P, j, N, J);
352
- else
353
- x(_(N, ne), P, j + 1, N, J);
354
- }(l, g, 0, l, f), f.length === 1) {
355
- var u = f[0];
356
- return w(A, u[0], u[1], u[2]);
357
- }
358
- for (var m = L && L.$ne !== void 0, v = m, c = 0; c < f.length; c++) {
359
- var b = f[c], I = w(A, b[0], b[1], b[2]);
360
- m ? v &= I : v |= I;
361
- }
362
- return v;
363
- }
364
- function F(a, l, g) {
365
- return M({ keyPath: a, child: l, query: g }, k);
366
- }
367
- function T(a) {
368
- var l = a.comparable, g = a.expressions, A = function(u) {
369
- var m;
370
- return (!u || !(m = u) || m.constructor !== Object && m.constructor !== Array && m.constructor.toString() !== "function Object() { [native code] }" && m.constructor.toString() !== "function Array() { [native code] }" || m.toJSON) && (u = { $eq: u }), u;
371
- }, L = function(u) {
372
- u = l(u);
373
- var m = [];
374
- for (var v in u) {
375
- var c = u[v];
376
- if (v !== "$options") {
377
- var b = E[v] || a && g && g[v];
378
- if (b)
379
- R[v] && (c = R[v](c, u, a)), m.push(M(l(c), b));
380
- else {
381
- if (v.charCodeAt(0) === 36)
382
- throw new Error("Unknown operation " + v);
383
- var I = v.split(".");
384
- m.push(F(I, f(c), c));
385
- }
386
- }
387
- }
388
- return m.length === 1 ? m[0] : M(m, E.$and);
389
- }, f = function(u) {
390
- return u = A(u), function m(v, c) {
391
- if (!p(v))
392
- return c;
393
- for (var b in v)
394
- c.push(b), m(v[b], c);
395
- return c;
396
- }(u, []).join(",").search(/[$.]/) === -1 ? M(u, U) : L(u);
397
- };
398
- return function(u) {
399
- return L(A(u));
400
- };
401
- }
402
- function U(a, l) {
403
- if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(l))
404
- return !1;
405
- if (p(a)) {
406
- if (Object.keys(a).length !== Object.keys(l).length)
407
- return !1;
408
- for (var g in a)
409
- if (!U(a[g], l[g]))
410
- return !1;
411
- return !0;
412
- }
413
- if (h(a)) {
414
- if (a.length !== l.length)
415
- return !1;
416
- for (var A = 0, L = a.length; A < L; A++)
417
- if (!U(a[A], l[A]))
418
- return !1;
419
- return !0;
420
- }
421
- return a === l;
422
- }
423
- function X(a, l) {
424
- var g = T(l)(a);
425
- return l && l.select && (g = {
426
- options: g,
427
- validate: function(A, L, f, u) {
428
- return w(A, L && l.select(L), f, u);
429
- }
430
- }), g;
431
- }
432
- function Y(a, l) {
433
- var g = X(a, l = Object.assign({ compare: G, comparable: z }, l));
434
- return function(A, L, f) {
435
- return w(g, A, L, f);
436
- };
437
- }
438
- function G(a, l) {
439
- if (U(a, l))
440
- return 0;
441
- if (o(a) === o(l)) {
442
- if (a > l)
443
- return 1;
444
- if (a < l)
445
- return -1;
446
- }
447
- }
448
- function z(a) {
449
- return a instanceof Date ? a.getTime() : h(a) ? a.map(z) : a && typeof a.toJSON == "function" ? a.toJSON() : a;
450
- }
451
- }
452
- ]);
453
- });
454
- })(gr);
455
- var an = gr.exports;
456
- const on = /* @__PURE__ */ pt(an);
457
- function Pt(r, e) {
458
- for (var t = 0; t < e.length; t++) {
459
- var n = e[t];
460
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, n.key, n);
461
- }
462
- }
463
- function ln(r, e, t) {
464
- return e && Pt(r.prototype, e), t && Pt(r, t), r;
465
- }
466
- function un(r, e) {
467
- r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.__proto__ = e;
468
- }
469
- function lt(r) {
470
- return lt = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
471
- return t.__proto__ || Object.getPrototypeOf(t);
472
- }, lt(r);
473
- }
474
- function Ue(r, e) {
475
- return Ue = Object.setPrototypeOf || function(n, s) {
476
- return n.__proto__ = s, n;
477
- }, Ue(r, e);
478
- }
479
- function cn() {
480
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
481
- return !1;
482
- if (typeof Proxy == "function")
483
- return !0;
484
- try {
485
- return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
486
- })), !0;
487
- } catch {
488
- return !1;
489
- }
490
- }
491
- function Ve(r, e, t) {
492
- return cn() ? Ve = Reflect.construct : Ve = function(s, o, i) {
493
- var h = [null];
494
- h.push.apply(h, o);
495
- var p = Function.bind.apply(s, h), d = new p();
496
- return i && Ue(d, i.prototype), d;
497
- }, Ve.apply(null, arguments);
498
- }
499
- function dn(r) {
500
- return Function.toString.call(r).indexOf("[native code]") !== -1;
501
- }
502
- function ut(r) {
503
- var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
504
- return ut = function(n) {
505
- if (n === null || !dn(n))
506
- return n;
507
- if (typeof n != "function")
508
- throw new TypeError("Super expression must either be null or a function");
509
- if (typeof e < "u") {
510
- if (e.has(n))
511
- return e.get(n);
512
- e.set(n, s);
513
- }
514
- function s() {
515
- return Ve(n, arguments, lt(this).constructor);
516
- }
517
- return s.prototype = Object.create(n.prototype, {
518
- constructor: {
519
- value: s,
520
- enumerable: !1,
521
- writable: !0,
522
- configurable: !0
523
- }
524
- }), Ue(s, n);
525
- }, ut(r);
526
- }
527
- function Lt(r) {
528
- if (r === void 0)
529
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
530
- return r;
531
- }
532
- var br = function(e) {
533
- return 'Cannot execute "' + e.action + '" on "' + e.subjectName + '"';
534
- }, Ne = br, fn = /* @__PURE__ */ function(r) {
535
- un(e, r), e.setDefaultMessage = function(s) {
536
- s === null ? Ne = br : Ne = typeof s == "string" ? function() {
537
- return s;
538
- } : s;
539
- }, e.from = function(s) {
540
- var o = new this("");
541
- return Object.defineProperty(o, "ability", {
542
- value: s
543
- }), o;
544
- };
545
- function e(n, s) {
546
- var o;
547
- return s === void 0 && (s = {}), o = r.call(this, n) || this, o._setMetadata(s), o.message = n || Ne(Lt(o)), o._customMessage = null, typeof Error.captureStackTrace == "function" && (o.name = o.constructor.name, Error.captureStackTrace(Lt(o), o.constructor)), o;
548
- }
549
- var t = e.prototype;
550
- return t.setMessage = function(s) {
551
- return this._customMessage = s, this;
552
- }, t.throwUnlessCan = function(s, o, i) {
553
- if (!this.ability)
554
- throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
555
- var h = this.ability.relevantRuleFor(s, o, i);
556
- if (!(h && !h.inverted)) {
557
- this._setMetadata({
558
- action: s,
559
- subject: o,
560
- field: i,
561
- subjectName: this.ability.subjectName(o)
562
- });
563
- var p = h ? h.reason : "";
564
- throw this.message = this._customMessage || p || Ne(this), this;
565
- }
566
- }, t._setMetadata = function(s) {
567
- this.subject = s.subject, this.subjectName = s.subjectName, this.action = s.action, this.field = s.field;
568
- }, e;
569
- }(ut(Error));
570
- function ct(r) {
571
- return Array.isArray(r) ? r : [r];
572
- }
573
- function mn(r) {
574
- if (!r || typeof r == "string")
575
- return r;
576
- var e = typeof r == "object" ? r.constructor : r;
577
- return e.modelName || e.name;
578
- }
579
- function pn(r) {
580
- return JSON.parse(JSON.stringify(r));
581
- }
582
- var hn = /[-/\\^$+?.()|[\]{}]/g, vn = /\.?\*+\.?/g, gn = /\*+/, bn = /\./g;
583
- function yn(r, e, t) {
584
- var n = t[0] === "*" || r[0] === "." && r[r.length - 1] === "." ? "+" : "*", s = r.indexOf("**") === -1 ? "[^.]" : ".", o = r.replace(bn, "\\$&").replace(gn, s + n);
585
- return e + r.length === t.length ? "(?:" + o + ")?" : o;
586
- }
587
- function $n(r, e, t) {
588
- return r === "." && (t[e - 1] === "*" || t[e + 1] === "*") ? r : "\\" + r;
589
- }
590
- function _n(r) {
591
- var e = r.map(function(n) {
592
- return n.replace(hn, $n).replace(vn, yn);
593
- }), t = e.length > 1 ? "(?:" + e.join("|") + ")" : e[0];
594
- return new RegExp("^" + t + "$");
595
- }
596
- var En = /* @__PURE__ */ function() {
597
- function r(t) {
598
- this.actions = t.actions || t.action, this.subject = t.subject, this.fields = !t.fields || t.fields.length === 0 ? void 0 : ct(t.fields), Object.defineProperty(this, "_fieldsPattern", {
599
- writable: !0
600
- }), this.inverted = !!t.inverted, this.conditions = t.conditions, Object.defineProperty(this, "_matches", {
601
- writable: !0,
602
- value: this.conditions ? on(this.conditions) : void 0
603
- }), this.reason = t.reason;
604
- }
605
- var e = r.prototype;
606
- return e.matches = function(n) {
607
- return this._matches ? typeof n == "string" ? !this.inverted : this._matches(n) : !0;
608
- }, e.isRelevantFor = function(n, s) {
609
- return this.fields ? s ? this.matchesField(s) : !this.inverted : !0;
610
- }, e.matchesField = function(n) {
611
- return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : _n(this.fields)), this._fieldsPattern === null || n.indexOf("*") !== -1 ? this.fields.indexOf(n) !== -1 : this._fieldsPattern.test(n);
612
- }, r;
613
- }(), se = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), Nt = {
614
- crud: ["create", "read", "update", "delete"]
615
- };
616
- function Ct(r, e) {
617
- return r === e || Array.isArray(e) && e.indexOf(r) !== -1;
618
- }
619
- var wn = /* @__PURE__ */ function() {
620
- r.addAlias = function(n, s) {
621
- if (n === "manage" || Ct("manage", s))
622
- throw new Error('Cannot add alias for "manage" action because it represents any action');
623
- if (Ct(n, s))
624
- throw new Error("Attempt to alias action to itself: " + n + " -> " + s.toString());
625
- return Nt[n] = s, this;
626
- };
627
- function r(t, n) {
628
- n === void 0 && (n = {}), Object.defineProperty(this, "subjectName", {
629
- value: n.subjectName || mn
630
- }), this[se] = {
631
- RuleType: n.RuleType || En,
632
- originalRules: t || [],
633
- hasPerFieldRules: !1,
634
- indexedRules: /* @__PURE__ */ Object.create(null),
635
- mergedRules: /* @__PURE__ */ Object.create(null),
636
- events: {},
637
- aliases: pn(Nt)
638
- }, this.update(t);
639
- }
640
- var e = r.prototype;
641
- return e.update = function(n) {
642
- if (!Array.isArray(n))
643
- return this;
644
- var s = {
645
- rules: n,
646
- ability: this
647
- };
648
- this.emit("update", s), this[se].originalRules = n.slice(0), this[se].mergedRules = /* @__PURE__ */ Object.create(null);
649
- var o = this.buildIndexFor(n);
650
- return process.env.NODE_ENV !== "production" && o.isAllInverted && n.length && console.warn("[casl]: Ability contains only inverted rules. That means user will not be able to do any actions. This will be changed to Error throw in the next major version"), this[se].indexedRules = o.rules, this[se].hasPerFieldRules = o.hasPerFieldRules, this.emit("updated", s), this;
651
- }, e.buildIndexFor = function(n) {
652
- for (var s = /* @__PURE__ */ Object.create(null), o = this[se].RuleType, i = !0, h = !1, p = 0; p < n.length; p++) {
653
- var d = new o(n[p]), _ = this.expandActions(d.actions), $ = ct(d.subject), y = n.length - p - 1;
654
- i = !!(i && d.inverted), !h && d.fields && (h = !0);
655
- for (var w = 0; w < $.length; w++) {
656
- var E = $[w];
657
- s[E] = s[E] || /* @__PURE__ */ Object.create(null);
658
- for (var R = 0; R < _.length; R++) {
659
- var M = _[R];
660
- s[E][M] = s[E][M] || /* @__PURE__ */ Object.create(null), s[E][M][y] = d;
661
- }
662
- }
663
- }
664
- return {
665
- isAllInverted: i,
666
- hasPerFieldRules: h,
667
- rules: s
668
- };
669
- }, e.expandActions = function(n) {
670
- for (var s = this[se].aliases, o = ct(n), i = 0; i < o.length; ) {
671
- var h = o[i++];
672
- s.hasOwnProperty(h) && (o = o.concat(s[h]));
673
- }
674
- return o;
675
- }, e.can = function(n, s, o) {
676
- if (o && typeof o != "string")
677
- throw new Error("Ability.can expects 3rd parameter to be a string. See https://stalniy.github.io/casl/abilities/2017/07/21/check-abilities.html#checking-fields for details");
678
- var i = this.relevantRuleFor(n, s, o);
679
- return !!i && !i.inverted;
680
- }, e.relevantRuleFor = function(n, s, o) {
681
- for (var i = this.rulesFor(n, s, o), h = 0; h < i.length; h++)
682
- if (i[h].matches(s))
683
- return i[h];
684
- return null;
685
- }, e.possibleRulesFor = function(n, s) {
686
- var o = this.subjectName(s), i = this[se].mergedRules, h = o + "_" + n;
687
- return i[h] || (i[h] = this.mergeRulesFor(n, o)), i[h];
688
- }, e.mergeRulesFor = function(n, s) {
689
- var o = this[se].indexedRules, i = [s, "all"].reduce(function(h, p) {
690
- var d = o[p];
691
- return d ? Object.assign(h, d[n], d.manage) : h;
692
- }, []);
693
- return i.filter(Boolean);
694
- }, e.rulesFor = function(n, s, o) {
695
- var i = this.possibleRulesFor(n, s);
696
- return this[se].hasPerFieldRules ? i.filter(function(h) {
697
- return h.isRelevantFor(s, o);
698
- }) : i;
699
- }, e.cannot = function() {
700
- return !this.can.apply(this, arguments);
701
- }, e.throwUnlessCan = function() {
702
- var n;
703
- console.warn(`
704
- Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
705
- Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
706
- `.trim()), (n = fn.from(this)).throwUnlessCan.apply(n, arguments);
707
- }, e.on = function(n, s) {
708
- var o = this[se].events, i = !0;
709
- return o[n] || (o[n] = []), o[n].push(s), function() {
710
- if (i) {
711
- var h = o[n].indexOf(s);
712
- o[n].splice(h, 1), i = !1;
713
- }
714
- };
715
- }, e.emit = function(n, s) {
716
- var o = this[se].events[n];
717
- o && o.slice(0).forEach(function(i) {
718
- return i(s);
719
- });
720
- }, ln(r, [{
721
- key: "rules",
722
- get: function() {
723
- return this[se].originalRules;
724
- }
725
- }]), r;
726
- }(), Re;
727
- ((r) => {
728
- ((e) => {
729
- e[e.feedMe = 0] = "feedMe", e[e.business = 1] = "business", e[e.restaurant = 2] = "restaurant";
730
- })(r.Level || (r.Level = {})), ((e) => {
731
- e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete";
732
- })(r.Action || (r.Action = {}));
733
- })(Re || (Re = {}));
734
- ((r) => {
735
- ((e) => {
736
- ((t) => {
737
- t.all = "all", t.restaurant = "restaurant", t.business = "business", t.delivery = "delivery", t.agent = "agent";
738
- })(e.Feedme || (e.Feedme = {})), ((t) => {
739
- t.quota = "quota", t.owner = "owner";
740
- })(e.FeedmeBusinessField || (e.FeedmeBusinessField = {})), ((t) => {
741
- t.profile = "business::profile", t.restaurant = "business::restaurant", t.menu = "business::menu", t.promotion = "business::promotion", t.voucher = "business::voucher", t.membership = "business::membership", t.stock = "business::stock", t.permission = "business::permission", t.role = "business::role";
742
- })(e.Business || (e.Business = {})), ((t) => {
743
- t.restaurant = "restaurant";
744
- })(e.Restaurant || (e.Restaurant = {}));
745
- })(r.Subject || (r.Subject = {}));
746
- })(Re || (Re = {}));
747
- function Rn(r, e) {
748
- const n = ge().sessionUser.value;
749
- if (!n)
750
- return;
751
- const { isAdmin: s } = n.role, o = n.permissions, i = e.filter((h) => h.businessId === r._id).length;
752
- return r.restaurantQuota > i && ((n == null ? void 0 : n.id) === r.ownerId || s) && new wn(o).can(
753
- Re.Action.manage,
754
- Re.Subject.Feedme.all
755
- );
756
- }
757
- const In = (r) => {
758
- const e = ae(r || "");
759
- function t(o) {
760
- return `${o}`.trim().toLowerCase();
761
- }
762
- const n = W(() => t(e.value));
763
- function s(o) {
764
- return n.value ? o.some((i) => t(i).includes(n.value)) : !0;
765
- }
766
- return { searchKey: e, filter: s };
767
- };
768
- function kt(r = "no name") {
769
- return {
770
- name: r,
771
- address: {
772
- line1: "",
773
- line2: "",
774
- state: "",
775
- city: "",
776
- postcode: "",
777
- country: "",
778
- coordinates: []
779
- },
780
- phoneNo: "",
781
- regNo: "",
782
- email: ""
783
- };
784
- }
785
- function xt() {
786
- return Te({
787
- line1: "",
788
- line2: "",
789
- city: "",
790
- postcode: "",
791
- state: "",
792
- country: "",
793
- coordinates: []
794
- });
795
- }
796
- function Te(r) {
797
- return {
798
- ...r,
799
- get formatted() {
800
- const { line1: e, line2: t, postcode: n, city: s, state: o, country: i } = r;
801
- return [e, t || "", n, s, o, i].map((h) => h.replace(/,\s*$/, "")).filter((h) => !!h.trim()).join(", ");
802
- },
803
- get isValidPostcode() {
804
- const e = Number.parseInt(r.postcode);
805
- return !isNaN(e);
806
- },
807
- get isValid() {
808
- const e = ["line2"];
809
- return Object.keys(r).filter((t) => !e.includes(t)).every((t) => !!r[t]);
810
- },
811
- get isValidCoordinate() {
812
- return (r.coordinates || []).length === 2;
813
- }
814
- };
815
- }
816
- const On = {
817
- class: /* @__PURE__ */ Z([
818
- "flex items-center",
819
- "px-24 pt-16 pb-8",
820
- "border-b border-fm-color-neutral-gray-100",
821
- "space-x-4"
822
- ])
823
- }, An = { class: "fm-typo-en-title-sm-600 mr-auto" }, Sn = {
824
- class: /* @__PURE__ */ Z(["flex flex-col", "flex-1 overflow-scroll", "w-full", "px-24"])
825
- }, Tn = /* @__PURE__ */ ee({
826
- __name: "FullScreenForm",
827
- props: {
828
- show: { type: Boolean },
829
- title: {},
830
- primaryAction: {},
831
- secondaryActions: {},
832
- zIndex: { default: 50 }
833
- },
834
- emits: ["onPrimary", "onCancel"],
835
- setup(r, { emit: e }) {
836
- const t = e, n = () => {
837
- t("onPrimary");
838
- }, s = () => {
839
- t("onCancel");
840
- };
841
- return (o, i) => {
842
- const h = q("fm-button"), p = q("fm-form");
843
- return D(), Q(Cr, { to: "body" }, [
844
- C(kr, { name: "fade" }, {
845
- default: H(() => [
846
- o.show ? (D(), Q(p, {
847
- key: 0,
848
- "blame-form-child-on-validation-failed": "",
849
- class: Z(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
850
- style: Fe({ zIndex: o.zIndex }),
851
- tabindex: "-1",
852
- onValidationSuccess: n,
853
- onKeyup: xr(s, ["esc"])
854
- }, {
855
- default: H(() => [
856
- O("div", On, [
857
- O("p", An, B(o.title), 1),
858
- me(o.$slots, "append-title", {}, void 0, !0),
859
- (D(!0), K(oe, null, be(o.secondaryActions, (d) => (D(), Q(h, {
860
- label: d.label,
861
- variant: "tertiary",
862
- onClick: d.click
863
- }, null, 8, ["label", "onClick"]))), 256)),
864
- C(h, {
865
- label: o.primaryAction.label,
866
- type: "submit",
867
- variant: "primary"
868
- }, null, 8, ["label"])
869
- ]),
870
- O("div", Sn, [
871
- me(o.$slots, "default", {}, void 0, !0)
872
- ])
873
- ]),
874
- _: 3
875
- }, 8, ["style"])) : fe("", !0)
876
- ]),
877
- _: 3
878
- })
879
- ]);
880
- };
881
- }
882
- });
883
- const Pn = /* @__PURE__ */ hr(Tn, [["__scopeId", "data-v-5b5c7179"]]), Ln = { class: "fm-typo-en-body-lg-600" }, Nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Mt = /* @__PURE__ */ ee({
884
- __name: "FormLabel",
885
- props: {
886
- label: {},
887
- optional: { type: Boolean, default: !1 },
888
- subLabel: {}
889
- },
890
- setup(r) {
891
- const e = r, t = W(() => e.optional && !e.subLabel ? "(optional)" : e.subLabel);
892
- return (n, s) => (D(), K("p", Ln, [
893
- je(B(n.label) + " ", 1),
894
- O("span", Nn, B(t.value), 1)
895
- ]));
896
- }
897
- }), Cn = { class: "space-y-4" }, kn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xn = { class: "fm-typo-en-body-lg-600" }, Vt = /* @__PURE__ */ ee({
898
- __name: "InfoBasic",
899
- props: {
900
- name: {
901
- type: String,
902
- required: !0
903
- },
904
- value: {
905
- type: String,
906
- required: !0
907
- }
908
- },
909
- setup(r) {
910
- return (e, t) => (D(), K("div", Cn, [
911
- O("div", kn, B(r.name), 1),
912
- O("div", xn, B(r.value), 1)
913
- ]));
914
- }
915
- }), Mn = {};
916
- function Vn(r, e) {
917
- return D(), K("div", null, e[0] || (e[0] = [
918
- O("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
919
- ]));
920
- }
921
- const Fn = /* @__PURE__ */ hr(Mn, [["render", Vn]]), jn = {
922
- key: 0,
923
- class: "ml-40 w-[320px] fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-200 space-y-4"
924
- }, Dn = { class: "fm-typo-en-title-sm-600" }, Ft = /* @__PURE__ */ ee({
925
- __name: "Summary",
926
- props: {
927
- title: {},
928
- variant: {},
929
- items: {}
930
- },
931
- setup(r) {
932
- const e = r, t = mr();
933
- function n() {
934
- t.open({
935
- title: e.title,
936
- contentComponent: Ot("div", { class: "space-y-4" }, [
937
- ...e.items.map(
938
- (s) => Ot(Vt, {
939
- name: s.name,
940
- value: s.value || "--"
941
- })
942
- )
943
- ])
944
- });
945
- }
946
- return (s, o) => {
947
- const i = q("FmButton");
948
- return e.variant === "full" ? (D(), K("div", jn, [
949
- O("div", Dn, B(s.title), 1),
950
- C(Fn),
951
- (D(!0), K(oe, null, be(s.items, (h) => (D(), Q(Vt, {
952
- key: h.name,
953
- name: h.name,
954
- value: h.value || "--"
955
- }, null, 8, ["name", "value"]))), 128))
956
- ])) : (D(), Q(i, {
957
- key: 1,
958
- icon: "info",
959
- variant: "tertiary",
960
- onClick: n
961
- }));
962
- };
963
- }
964
- }), Un = {
965
- key: 0,
966
- class: "space-y-4"
967
- }, Gn = { class: "fm-typo-en-body-lg-600" }, Bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Kn = {
968
- class: /* @__PURE__ */ Z(["absolute inset-0", "h-full w-full", "rounded-md overflow-hidden"])
969
- }, Hn = {
970
- class: /* @__PURE__ */ Z(["relative z-0", "w-full h-full", "overflow-hidden"])
971
- }, qn = ["src"], Yn = { class: "fm-typo-en-body-lg-600" }, zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Ee = /* @__PURE__ */ ee({
972
- __name: "ImageDropField",
973
- props: {
974
- label: {},
975
- subLabel: {},
976
- modelValue: {},
977
- previousUrl: {},
978
- width: { default: 323 },
979
- height: { default: 216 },
980
- canDelete: { type: Boolean, default: !0 }
981
- },
982
- emits: ["update:model-value", "reset:model-value"],
983
- setup(r, { emit: e }) {
984
- const t = r, n = e, s = W(() => t.modelValue ? URL.createObjectURL(t.modelValue) : t.previousUrl);
985
- return (o, i) => {
986
- const h = q("fm-icon"), p = q("fm-drop-field");
987
- return s.value ? (D(), K("div", Un, [
988
- O("p", Gn, [
989
- je(B(t.label) + " ", 1),
990
- O("span", Bn, B(o.subLabel), 1)
991
- ]),
992
- O("div", {
993
- class: Z(["relative", "border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md"]),
994
- style: Fe({ width: `${t.width}px`, height: `${t.height}px` })
995
- }, [
996
- O("div", Kn, [
997
- O("div", Hn, [
998
- O("img", {
999
- class: Z(["h-full w-full", "object-cover"]),
1000
- src: s.value,
1001
- alt: "product image"
1002
- }, null, 8, qn)
1003
- ])
1004
- ]),
1005
- o.canDelete ? (D(), K("button", {
1006
- key: 0,
1007
- class: Z([
1008
- "absolute top-12 right-12 z-10",
1009
- "w-24 h-24 rounded-[50%]",
1010
- "bg-fm-color-neutral-white"
1011
- ]),
1012
- type: "button",
1013
- onClick: i[0] || (i[0] = (d) => n("reset:model-value"))
1014
- }, [
1015
- C(h, { name: "close" })
1016
- ])) : fe("", !0)
1017
- ], 4)
1018
- ])) : (D(), Q(p, {
1019
- key: 1,
1020
- accept: ".jpg, .jpeg, .png, .gif",
1021
- style: Fe({ width: `${t.width}px`, height: `${t.height}px` }),
1022
- onFileUpload: i[1] || (i[1] = (d) => n("update:model-value", d))
1023
- }, {
1024
- label: H(() => [
1025
- O("p", Yn, [
1026
- je(B(t.label) + " ", 1),
1027
- O("span", zn, B(t.subLabel), 1)
1028
- ])
1029
- ]),
1030
- "accept-text": H(() => i[2] || (i[2] = [
1031
- O("p", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Accepts .jpg, .jpeg, .png, .gif ", -1)
1032
- ])),
1033
- _: 1
1034
- }, 8, ["style"]));
1035
- };
1036
- }
1037
- }), Xn = { class: "space-y-24" }, Wn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Jn = { class: "flex-1" }, Zn = { class: "flex-1" }, Qn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, es = { class: "flex-1" }, ts = { class: "flex-1" }, rs = { class: "flex gap-16 xs:flex-col xs:gap-24" }, ns = { class: "flex-1" }, ss = { class: "flex-1" }, as = /* @__PURE__ */ ee({
1038
- __name: "RestaurantAddress",
1039
- props: {
1040
- modelValue: {
1041
- type: Object,
1042
- required: !0
1043
- }
1044
- },
1045
- emits: ["update:model-value"],
1046
- setup(r, { emit: e }) {
1047
- const { t } = ye();
1048
- xt();
1049
- const n = r, s = e, o = W(() => we(n.modelValue || xt()));
1050
- function i(p) {
1051
- return (p || "").toString();
1052
- }
1053
- function h(p) {
1054
- s("update:model-value", p(o.value));
1055
- }
1056
- return (p, d) => {
1057
- const _ = q("FmTextField");
1058
- return D(), K("div", Xn, [
1059
- O("div", Wn, [
1060
- O("div", Jn, [
1061
- C(_, {
1062
- "model-value": o.value.line1,
1063
- label: S(t)("settings.address.line1"),
1064
- "label-mark": "required",
1065
- rules: [S(he)],
1066
- "onUpdate:modelValue": d[0] || (d[0] = ($) => h((y) => ({ ...y, line1: i($) })))
1067
- }, null, 8, ["model-value", "label", "rules"])
1068
- ]),
1069
- O("div", Zn, [
1070
- C(_, {
1071
- "model-value": o.value.line2,
1072
- label: S(t)("settings.address.line2"),
1073
- "onUpdate:modelValue": d[1] || (d[1] = ($) => h((y) => ({ ...y, line2: i($) })))
1074
- }, null, 8, ["model-value", "label"])
1075
- ])
1076
- ]),
1077
- O("div", Qn, [
1078
- O("div", es, [
1079
- C(_, {
1080
- "model-value": o.value.city,
1081
- rules: [S(he)],
1082
- label: S(t)("settings.address.city"),
1083
- "label-mark": "required",
1084
- "onUpdate:modelValue": d[2] || (d[2] = ($) => h((y) => ({ ...y, city: i($) })))
1085
- }, null, 8, ["model-value", "rules", "label"])
1086
- ]),
1087
- O("div", ts, [
1088
- C(_, {
1089
- "model-value": o.value.postcode,
1090
- label: S(t)("settings.address.postal_code"),
1091
- "label-mark": "required",
1092
- rules: [S(he)],
1093
- "onUpdate:modelValue": d[3] || (d[3] = ($) => h((y) => ({ ...y, postcode: i($) })))
1094
- }, null, 8, ["model-value", "label", "rules"])
1095
- ])
1096
- ]),
1097
- O("div", rs, [
1098
- O("div", ns, [
1099
- C(_, {
1100
- "model-value": o.value.state,
1101
- label: S(t)("settings.address.state"),
1102
- "label-mark": "required",
1103
- rules: [S(he)],
1104
- "onUpdate:modelValue": d[4] || (d[4] = ($) => h((y) => ({ ...y, state: i($) })))
1105
- }, null, 8, ["model-value", "label", "rules"])
1106
- ]),
1107
- O("div", ss, [
1108
- C(_, {
1109
- "model-value": o.value.country,
1110
- label: S(t)("settings.address.country"),
1111
- "label-mark": "required",
1112
- rules: [S(he)],
1113
- "onUpdate:modelValue": d[5] || (d[5] = ($) => h((y) => ({ ...y, country: i($) })))
1114
- }, null, 8, ["model-value", "label", "rules"])
1115
- ])
1116
- ])
1117
- ]);
1118
- };
1119
- }
1120
- }), os = /* @__PURE__ */ ee({
1121
- __name: "GoogleMap",
1122
- props: {
1123
- markers: {
1124
- type: Array,
1125
- default: () => []
1126
- },
1127
- polygons: {
1128
- type: Array,
1129
- default: () => []
1130
- },
1131
- zoom: {
1132
- type: Number,
1133
- default: 14
1134
- },
1135
- editable: {
1136
- type: Boolean,
1137
- default: !1
1138
- },
1139
- center: {
1140
- type: Object,
1141
- default: De.jb
1142
- }
1143
- },
1144
- emits: ["map-click", "marker-change", "polygon-change", "polygon-right-click"],
1145
- setup(r, { expose: e, emit: t }) {
1146
- const n = r, s = t;
1147
- e({
1148
- setCenter: (a) => {
1149
- var l;
1150
- (l = i.value) == null || l.setCenter(a);
1151
- }
1152
- });
1153
- const o = ae(), i = ae(null), h = [];
1154
- function p(a) {
1155
- return {
1156
- lat: a.latLng.lat(),
1157
- lng: a.latLng.lng()
1158
- };
1159
- }
1160
- function d(a, l, g) {
1161
- const A = _e().maps.event.addListener(a, l, g);
1162
- h.push(A);
1163
- }
1164
- const _ = ae([]);
1165
- function $(a, l, g) {
1166
- d(a, l, g);
1167
- }
1168
- function y(a) {
1169
- w(null), _.value = a.map((l, g) => {
1170
- const A = _e(), L = new A.maps.Marker({
1171
- position: l,
1172
- draggable: !0
1173
- });
1174
- return $(L, "dragend", (f) => {
1175
- s("marker-change", { index: g, position: p(f) });
1176
- }), L;
1177
- }), w(i.value);
1178
- }
1179
- function w(a) {
1180
- _.value.map((l) => St(l).setMap(a));
1181
- }
1182
- const E = ae([]);
1183
- function R(a, l, g) {
1184
- d(a, l, g);
1185
- }
1186
- function M(a, l, g) {
1187
- d(a, l, g);
1188
- }
1189
- function k(a) {
1190
- return E.value[a].getPath().getArray().map(({ lat: g, lng: A }) => ({
1191
- lat: g(),
1192
- lng: A()
1193
- }));
1194
- }
1195
- function F(a) {
1196
- const l = k(a);
1197
- s("polygon-change", { index: a, path: l });
1198
- }
1199
- function T(a, l) {
1200
- const A = k(a).filter((L, f) => f !== l);
1201
- s("polygon-change", { index: a, path: A });
1202
- }
1203
- function U(a, l) {
1204
- l.vertex !== void 0 ? T(a, l.vertex) : s("polygon-right-click", a);
1205
- }
1206
- function X(a) {
1207
- Y(null), E.value = a.map((l, g) => {
1208
- const A = _e(), L = new A.maps.Polygon({
1209
- paths: l.paths,
1210
- strokeColor: l.strokeColor,
1211
- fillColor: l.fillColor,
1212
- fillOpacity: 0.5,
1213
- editable: n.editable
1214
- });
1215
- return R(L, "contextmenu", (f) => U(g, f)), L.getPaths().forEach((f) => {
1216
- M(f, "insert_at", () => F(g)), M(f, "set_at", () => F(g));
1217
- }), L;
1218
- }), Y(i.value);
1219
- }
1220
- function Y(a) {
1221
- E.value.map((l) => St(l).setMap(a));
1222
- }
1223
- function G(a, l, g) {
1224
- d(a, l, g);
1225
- }
1226
- function z() {
1227
- const a = _e().maps.Map;
1228
- i.value = new a(o.value, {
1229
- center: n.center,
1230
- zoom: n.zoom,
1231
- mapTypeControl: !1,
1232
- streetViewControl: !1,
1233
- draggable: !0,
1234
- scrollwheel: !0
1235
- }), G(i.value, "click", (l) => s("map-click", p(l)));
1236
- }
1237
- return At(() => n.markers, y, { deep: !0 }), At(() => n.polygons, X, { deep: !0 }), Mr(() => {
1238
- !o.value || !_e() || (z(), y(n.markers), X(n.polygons));
1239
- }), Vr(() => {
1240
- h.forEach((a) => a.remove());
1241
- }), (a, l) => (D(), K("div", {
1242
- ref_key: "mapRef",
1243
- ref: o,
1244
- class: "map app-map"
1245
- }, null, 512));
1246
- }
1247
- }), is = { class: "space-y-24" }, ls = { class: "flex flex-row gap-8" }, us = { class: "flex gap-8" }, cs = { class: "flex gap-8" }, ds = /* @__PURE__ */ ee({
1248
- __name: "CoordinateDialog",
1249
- props: {
1250
- address: {
1251
- type: String,
1252
- required: !0
1253
- },
1254
- coordinate: {
1255
- type: Object,
1256
- default: void 0
1257
- }
1258
- },
1259
- setup(r) {
1260
- const { t: e } = ye(), t = r, { emitData: n } = en(), s = mt(
1261
- we(t.coordinate ? t.coordinate : De.jb)
1262
- );
1263
- function o({ position: i }) {
1264
- s.lat = i.lat, s.lng = i.lng, n(s);
1265
- }
1266
- return n(s), (i, h) => (D(), K("div", is, [
1267
- O("div", null, [
1268
- O("div", ls, [
1269
- O("div", null, B(S(e)("settings.coordinate_dialog.address")) + ":", 1),
1270
- O("div", null, B(r.address || "--"), 1)
1271
- ]),
1272
- O("div", us, [
1273
- O("div", null, B(S(e)("settings.coordinate_dialog.latitude")) + ":", 1),
1274
- O("div", null, B(s.lat), 1)
1275
- ]),
1276
- O("div", cs, [
1277
- O("div", null, B(S(e)("settings.coordinate_dialog.longitude")) + ":", 1),
1278
- O("div", null, B(s.lng), 1)
1279
- ])
1280
- ]),
1281
- C(os, {
1282
- class: "w-full",
1283
- style: { height: "300px" },
1284
- editable: "",
1285
- center: s,
1286
- markers: [s],
1287
- onMarkerChange: o,
1288
- onMapClick: h[0] || (h[0] = (p) => o({ position: p }))
1289
- }, null, 8, ["center", "markers"])
1290
- ]));
1291
- }
1292
- }), fs = /* @__PURE__ */ ee({
1293
- __name: "CoordinateInput",
1294
- props: {
1295
- modelValue: {
1296
- type: Array,
1297
- default: void 0
1298
- },
1299
- address: {
1300
- type: Object,
1301
- required: !0
1302
- },
1303
- required: {
1304
- type: Boolean,
1305
- default: !1
1306
- }
1307
- },
1308
- emits: ["update:model-value"],
1309
- setup(r, { emit: e }) {
1310
- const { t } = ye(), n = r, s = e, o = mr(), i = W(() => {
1311
- const $ = n.modelValue || [];
1312
- return $.length < 2 ? null : Gr($);
1313
- }), h = W(() => i.value ? `${i.value.lat}, ${i.value.lng}` : "");
1314
- async function p() {
1315
- const $ = _e().maps.Geocoder, y = new $();
1316
- let w = i.value;
1317
- w || await new Promise((E) => {
1318
- n.address.formatted ? y.geocode({ address: n.address.formatted }, (R) => {
1319
- var k;
1320
- const M = (k = R == null ? void 0 : R[0]) == null ? void 0 : k.geometry;
1321
- w = M ? { lng: M.location.lng(), lat: M.location.lat() } : De.jb, E(!0);
1322
- }) : (w = De.jb, E(!0));
1323
- }), o.open({
1324
- contentComponent: ds,
1325
- contentComponentProps: {
1326
- address: n.address.formatted,
1327
- coordinate: w
1328
- },
1329
- title: t("settings.coordinate_input.dialog.title"),
1330
- primaryActions: {
1331
- text: t("settings.coordinate_input.dialog.confirm"),
1332
- variant: "primary",
1333
- close: !0
1334
- },
1335
- secondaryActions: {
1336
- text: t("settings.coordinate_input.dialog.delete"),
1337
- variant: "destructive",
1338
- close: !0
1339
- }
1340
- }).onPrimary(async (E) => {
1341
- const R = E ? Br(E) : [];
1342
- _(), s("update:model-value", R);
1343
- }).onSecondary(() => {
1344
- _(), s("update:model-value", []);
1345
- });
1346
- }
1347
- const d = ae(!1);
1348
- function _() {
1349
- d.value = !1;
1350
- }
1351
- return ($, y) => {
1352
- const w = q("FmIcon"), E = q("FmField"), R = q("FmFormGroup");
1353
- return D(), Q(R, {
1354
- modelValue: i.value,
1355
- "onUpdate:modelValue": y[0] || (y[0] = (M) => i.value = M),
1356
- label: S(t)("settings.coordinate_input.title")
1357
- }, {
1358
- default: H(() => [
1359
- C(E, {
1360
- class: "cursor-pointer",
1361
- onClick: p
1362
- }, {
1363
- prepend: H(() => [
1364
- me($.$slots, "prepend")
1365
- ]),
1366
- append: H(() => [
1367
- C(w, {
1368
- class: "text-fm-color-neutral-gray-400",
1369
- name: "location_on",
1370
- outline: "",
1371
- size: "md"
1372
- })
1373
- ]),
1374
- default: H(() => [
1375
- me($.$slots, "default", {}, () => [
1376
- O("div", {
1377
- class: Z([[i.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1378
- }, B(i.value ? h.value : S(t)("settings.coordinate_input.not_set")), 3)
1379
- ])
1380
- ]),
1381
- _: 3
1382
- })
1383
- ]),
1384
- _: 3
1385
- }, 8, ["modelValue", "label"]);
1386
- };
1387
- }
1388
- });
1389
- var yr = { exports: {} };
1390
- (function(r, e) {
1391
- (function(t, n) {
1392
- r.exports = n();
1393
- })(cr, function() {
1394
- var t = 1e3, n = 6e4, s = 36e5, o = "millisecond", i = "second", h = "minute", p = "hour", d = "day", _ = "week", $ = "month", y = "quarter", w = "year", E = "date", R = "Invalid Date", M = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, k = /\[([^\]]+)]|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, F = { 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(f) {
1395
- var u = ["th", "st", "nd", "rd"], m = f % 100;
1396
- return "[" + f + (u[(m - 20) % 10] || u[m] || u[0]) + "]";
1397
- } }, T = function(f, u, m) {
1398
- var v = String(f);
1399
- return !v || v.length >= u ? f : "" + Array(u + 1 - v.length).join(m) + f;
1400
- }, U = { s: T, z: function(f) {
1401
- var u = -f.utcOffset(), m = Math.abs(u), v = Math.floor(m / 60), c = m % 60;
1402
- return (u <= 0 ? "+" : "-") + T(v, 2, "0") + ":" + T(c, 2, "0");
1403
- }, m: function f(u, m) {
1404
- if (u.date() < m.date())
1405
- return -f(m, u);
1406
- var v = 12 * (m.year() - u.year()) + (m.month() - u.month()), c = u.clone().add(v, $), b = m - c < 0, I = u.clone().add(v + (b ? -1 : 1), $);
1407
- return +(-(v + (m - c) / (b ? c - I : I - c)) || 0);
1408
- }, a: function(f) {
1409
- return f < 0 ? Math.ceil(f) || 0 : Math.floor(f);
1410
- }, p: function(f) {
1411
- return { M: $, y: w, w: _, d, D: E, h: p, m: h, s: i, ms: o, Q: y }[f] || String(f || "").toLowerCase().replace(/s$/, "");
1412
- }, u: function(f) {
1413
- return f === void 0;
1414
- } }, X = "en", Y = {};
1415
- Y[X] = F;
1416
- var G = "$isDayjsObject", z = function(f) {
1417
- return f instanceof A || !(!f || !f[G]);
1418
- }, a = function f(u, m, v) {
1419
- var c;
1420
- if (!u)
1421
- return X;
1422
- if (typeof u == "string") {
1423
- var b = u.toLowerCase();
1424
- Y[b] && (c = b), m && (Y[b] = m, c = b);
1425
- var I = u.split("-");
1426
- if (!c && I.length > 1)
1427
- return f(I[0]);
1428
- } else {
1429
- var x = u.name;
1430
- Y[x] = u, c = x;
1431
- }
1432
- return !v && c && (X = c), c || !v && X;
1433
- }, l = function(f, u) {
1434
- if (z(f))
1435
- return f.clone();
1436
- var m = typeof u == "object" ? u : {};
1437
- return m.date = f, m.args = arguments, new A(m);
1438
- }, g = U;
1439
- g.l = a, g.i = z, g.w = function(f, u) {
1440
- return l(f, { locale: u.$L, utc: u.$u, x: u.$x, $offset: u.$offset });
1441
- };
1442
- var A = function() {
1443
- function f(m) {
1444
- this.$L = a(m.locale, null, !0), this.parse(m), this.$x = this.$x || m.x || {}, this[G] = !0;
1445
- }
1446
- var u = f.prototype;
1447
- return u.parse = function(m) {
1448
- this.$d = function(v) {
1449
- var c = v.date, b = v.utc;
1450
- if (c === null)
1451
- return /* @__PURE__ */ new Date(NaN);
1452
- if (g.u(c))
1453
- return /* @__PURE__ */ new Date();
1454
- if (c instanceof Date)
1455
- return new Date(c);
1456
- if (typeof c == "string" && !/Z$/i.test(c)) {
1457
- var I = c.match(M);
1458
- if (I) {
1459
- var x = I[2] - 1 || 0, N = (I[7] || "0").substring(0, 3);
1460
- return b ? new Date(Date.UTC(I[1], x, I[3] || 1, I[4] || 0, I[5] || 0, I[6] || 0, N)) : new Date(I[1], x, I[3] || 1, I[4] || 0, I[5] || 0, I[6] || 0, N);
1461
- }
1462
- }
1463
- return new Date(c);
1464
- }(m), this.init();
1465
- }, u.init = function() {
1466
- var m = this.$d;
1467
- this.$y = m.getFullYear(), this.$M = m.getMonth(), this.$D = m.getDate(), this.$W = m.getDay(), this.$H = m.getHours(), this.$m = m.getMinutes(), this.$s = m.getSeconds(), this.$ms = m.getMilliseconds();
1468
- }, u.$utils = function() {
1469
- return g;
1470
- }, u.isValid = function() {
1471
- return this.$d.toString() !== R;
1472
- }, u.isSame = function(m, v) {
1473
- var c = l(m);
1474
- return this.startOf(v) <= c && c <= this.endOf(v);
1475
- }, u.isAfter = function(m, v) {
1476
- return l(m) < this.startOf(v);
1477
- }, u.isBefore = function(m, v) {
1478
- return this.endOf(v) < l(m);
1479
- }, u.$g = function(m, v, c) {
1480
- return g.u(m) ? this[v] : this.set(c, m);
1481
- }, u.unix = function() {
1482
- return Math.floor(this.valueOf() / 1e3);
1483
- }, u.valueOf = function() {
1484
- return this.$d.getTime();
1485
- }, u.startOf = function(m, v) {
1486
- var c = this, b = !!g.u(v) || v, I = g.p(m), x = function(de, re) {
1487
- var pe = g.w(c.$u ? Date.UTC(c.$y, re, de) : new Date(c.$y, re, de), c);
1488
- return b ? pe : pe.endOf(d);
1489
- }, N = function(de, re) {
1490
- return g.w(c.toDate()[de].apply(c.toDate("s"), (b ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(re)), c);
1491
- }, P = this.$W, j = this.$M, V = this.$D, J = "set" + (this.$u ? "UTC" : "");
1492
- switch (I) {
1493
- case w:
1494
- return b ? x(1, 0) : x(31, 11);
1495
- case $:
1496
- return b ? x(1, j) : x(0, j + 1);
1497
- case _:
1498
- var ne = this.$locale().weekStart || 0, ce = (P < ne ? P + 7 : P) - ne;
1499
- return x(b ? V - ce : V + (6 - ce), j);
1500
- case d:
1501
- case E:
1502
- return N(J + "Hours", 0);
1503
- case p:
1504
- return N(J + "Minutes", 1);
1505
- case h:
1506
- return N(J + "Seconds", 2);
1507
- case i:
1508
- return N(J + "Milliseconds", 3);
1509
- default:
1510
- return this.clone();
1511
- }
1512
- }, u.endOf = function(m) {
1513
- return this.startOf(m, !1);
1514
- }, u.$set = function(m, v) {
1515
- var c, b = g.p(m), I = "set" + (this.$u ? "UTC" : ""), x = (c = {}, c[d] = I + "Date", c[E] = I + "Date", c[$] = I + "Month", c[w] = I + "FullYear", c[p] = I + "Hours", c[h] = I + "Minutes", c[i] = I + "Seconds", c[o] = I + "Milliseconds", c)[b], N = b === d ? this.$D + (v - this.$W) : v;
1516
- if (b === $ || b === w) {
1517
- var P = this.clone().set(E, 1);
1518
- P.$d[x](N), P.init(), this.$d = P.set(E, Math.min(this.$D, P.daysInMonth())).$d;
1519
- } else
1520
- x && this.$d[x](N);
1521
- return this.init(), this;
1522
- }, u.set = function(m, v) {
1523
- return this.clone().$set(m, v);
1524
- }, u.get = function(m) {
1525
- return this[g.p(m)]();
1526
- }, u.add = function(m, v) {
1527
- var c, b = this;
1528
- m = Number(m);
1529
- var I = g.p(v), x = function(j) {
1530
- var V = l(b);
1531
- return g.w(V.date(V.date() + Math.round(j * m)), b);
1532
- };
1533
- if (I === $)
1534
- return this.set($, this.$M + m);
1535
- if (I === w)
1536
- return this.set(w, this.$y + m);
1537
- if (I === d)
1538
- return x(1);
1539
- if (I === _)
1540
- return x(7);
1541
- var N = (c = {}, c[h] = n, c[p] = s, c[i] = t, c)[I] || 1, P = this.$d.getTime() + m * N;
1542
- return g.w(P, this);
1543
- }, u.subtract = function(m, v) {
1544
- return this.add(-1 * m, v);
1545
- }, u.format = function(m) {
1546
- var v = this, c = this.$locale();
1547
- if (!this.isValid())
1548
- return c.invalidDate || R;
1549
- var b = m || "YYYY-MM-DDTHH:mm:ssZ", I = g.z(this), x = this.$H, N = this.$m, P = this.$M, j = c.weekdays, V = c.months, J = c.meridiem, ne = function(re, pe, Oe, Le) {
1550
- return re && (re[pe] || re(v, b)) || Oe[pe].slice(0, Le);
1551
- }, ce = function(re) {
1552
- return g.s(x % 12 || 12, re, "0");
1553
- }, de = J || function(re, pe, Oe) {
1554
- var Le = re < 12 ? "AM" : "PM";
1555
- return Oe ? Le.toLowerCase() : Le;
1556
- };
1557
- return b.replace(k, function(re, pe) {
1558
- return pe || function(Oe) {
1559
- switch (Oe) {
1560
- case "YY":
1561
- return String(v.$y).slice(-2);
1562
- case "YYYY":
1563
- return g.s(v.$y, 4, "0");
1564
- case "M":
1565
- return P + 1;
1566
- case "MM":
1567
- return g.s(P + 1, 2, "0");
1568
- case "MMM":
1569
- return ne(c.monthsShort, P, V, 3);
1570
- case "MMMM":
1571
- return ne(V, P);
1572
- case "D":
1573
- return v.$D;
1574
- case "DD":
1575
- return g.s(v.$D, 2, "0");
1576
- case "d":
1577
- return String(v.$W);
1578
- case "dd":
1579
- return ne(c.weekdaysMin, v.$W, j, 2);
1580
- case "ddd":
1581
- return ne(c.weekdaysShort, v.$W, j, 3);
1582
- case "dddd":
1583
- return j[v.$W];
1584
- case "H":
1585
- return String(x);
1586
- case "HH":
1587
- return g.s(x, 2, "0");
1588
- case "h":
1589
- return ce(1);
1590
- case "hh":
1591
- return ce(2);
1592
- case "a":
1593
- return de(x, N, !0);
1594
- case "A":
1595
- return de(x, N, !1);
1596
- case "m":
1597
- return String(N);
1598
- case "mm":
1599
- return g.s(N, 2, "0");
1600
- case "s":
1601
- return String(v.$s);
1602
- case "ss":
1603
- return g.s(v.$s, 2, "0");
1604
- case "SSS":
1605
- return g.s(v.$ms, 3, "0");
1606
- case "Z":
1607
- return I;
1608
- }
1609
- return null;
1610
- }(re) || I.replace(":", "");
1611
- });
1612
- }, u.utcOffset = function() {
1613
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1614
- }, u.diff = function(m, v, c) {
1615
- var b, I = this, x = g.p(v), N = l(m), P = (N.utcOffset() - this.utcOffset()) * n, j = this - N, V = function() {
1616
- return g.m(I, N);
1617
- };
1618
- switch (x) {
1619
- case w:
1620
- b = V() / 12;
1621
- break;
1622
- case $:
1623
- b = V();
1624
- break;
1625
- case y:
1626
- b = V() / 3;
1627
- break;
1628
- case _:
1629
- b = (j - P) / 6048e5;
1630
- break;
1631
- case d:
1632
- b = (j - P) / 864e5;
1633
- break;
1634
- case p:
1635
- b = j / s;
1636
- break;
1637
- case h:
1638
- b = j / n;
1639
- break;
1640
- case i:
1641
- b = j / t;
1642
- break;
1643
- default:
1644
- b = j;
1645
- }
1646
- return c ? b : g.a(b);
1647
- }, u.daysInMonth = function() {
1648
- return this.endOf($).$D;
1649
- }, u.$locale = function() {
1650
- return Y[this.$L];
1651
- }, u.locale = function(m, v) {
1652
- if (!m)
1653
- return this.$L;
1654
- var c = this.clone(), b = a(m, v, !0);
1655
- return b && (c.$L = b), c;
1656
- }, u.clone = function() {
1657
- return g.w(this.$d, this);
1658
- }, u.toDate = function() {
1659
- return new Date(this.valueOf());
1660
- }, u.toJSON = function() {
1661
- return this.isValid() ? this.toISOString() : null;
1662
- }, u.toISOString = function() {
1663
- return this.$d.toISOString();
1664
- }, u.toString = function() {
1665
- return this.$d.toUTCString();
1666
- }, f;
1667
- }(), L = A.prototype;
1668
- return l.prototype = L, [["$ms", o], ["$s", i], ["$m", h], ["$H", p], ["$W", d], ["$M", $], ["$y", w], ["$D", E]].forEach(function(f) {
1669
- L[f[1]] = function(u) {
1670
- return this.$g(u, f[0], f[1]);
1671
- };
1672
- }), l.extend = function(f, u) {
1673
- return f.$i || (f(u, A, l), f.$i = !0), l;
1674
- }, l.locale = a, l.isDayjs = z, l.unix = function(f) {
1675
- return l(1e3 * f);
1676
- }, l.en = Y[X], l.Ls = Y, l.p = {}, l;
1677
- });
1678
- })(yr);
1679
- var ms = yr.exports;
1680
- const gt = /* @__PURE__ */ pt(ms), ps = { class: "w-[140px] pt-16" }, hs = { class: "pl-32" }, vs = {
1681
- key: 1,
1682
- class: "flex gap-8 items-center my-8"
1683
- }, gs = /* @__PURE__ */ ee({
1684
- __name: "OperationHoursInput",
1685
- props: {
1686
- modelValue: {
1687
- type: Object,
1688
- default: void 0
1689
- },
1690
- title: {
1691
- type: String,
1692
- required: !1
1693
- }
1694
- },
1695
- emits: ["update:model-value"],
1696
- setup(r, { emit: e }) {
1697
- const t = r, n = e, s = vt(), { t: o } = ye();
1698
- gt().startOf("week");
1699
- const i = W(
1700
- () => [
1701
- o("settings.operation_hours.mon"),
1702
- o("settings.operation_hours.tue"),
1703
- o("settings.operation_hours.wed"),
1704
- o("settings.operation_hours.thu"),
1705
- o("settings.operation_hours.fri"),
1706
- o("settings.operation_hours.sat"),
1707
- o("settings.operation_hours.sun")
1708
- ].map((k, F) => ({
1709
- key: F.toString(),
1710
- label: k,
1711
- value: F < 6 ? F + 1 : 0,
1712
- // key of OperatingHours, since data start from sunday, UI start from monday
1713
- slot: `checkbox-${F}-end`
1714
- }))
1715
- ), h = W(
1716
- () => t.modelValue ? Object.values(t.modelValue) : Array.from(Array(7)).map(() => ({
1717
- enable: !1,
1718
- hours: []
1719
- }))
1720
- ), p = W(() => Object.values(h.value).map((k) => k.hours)), d = W(() => h.value.reduce((k, F, T) => (F.hours.length > 0 && k.push(T), k), []));
1721
- function _() {
1722
- return { start: "00:00", end: "23:59" };
1723
- }
1724
- function $(k) {
1725
- const F = d.value.find((U) => !k.includes(U));
1726
- if (F !== void 0) {
1727
- M((U) => (U[F].enable = !1, U[F].hours = [], U));
1728
- return;
1729
- }
1730
- const T = k.find((U) => !d.value.includes(U));
1731
- T !== void 0 && h.value[T].hours.length === 0 && M((U) => (U[T].enable = !0, U[T].hours = [_()], U));
1732
- }
1733
- function y(k) {
1734
- M((F) => (F[k].hours.push(_()), F));
1735
- }
1736
- function w(k, F) {
1737
- p.value[k].length > 1 ? M((T) => (T[k].hours.splice(F, 1), T)) : s.open({ title: o("settings.operation_hours.cannot_remove_last"), type: "error" });
1738
- }
1739
- function E(k, F, T) {
1740
- T && M((U) => (U[k].hours[F].start = T, U));
1741
- }
1742
- function R(k, F, T) {
1743
- T && M((U) => (U[k].hours[F].end = T, U));
1744
- }
1745
- function M(k) {
1746
- const F = k(we(h.value)), T = {
1747
- 0: F[0],
1748
- 1: F[1],
1749
- 2: F[2],
1750
- 3: F[3],
1751
- 4: F[4],
1752
- 5: F[5],
1753
- 6: F[6]
1754
- };
1755
- n("update:model-value", T);
1756
- }
1757
- return (k, F) => {
1758
- const T = q("FmCheckbox"), U = q("FmTimePicker"), X = q("FmButton"), Y = q("FmField");
1759
- return D(), K("div", null, [
1760
- (D(!0), K(oe, null, be(i.value, (G) => (D(), K("div", {
1761
- key: G.value,
1762
- class: "flex flex-col items-start"
1763
- }, [
1764
- O("div", ps, [
1765
- C(T, {
1766
- "model-value": d.value,
1767
- label: G.label,
1768
- value: G.value,
1769
- "onUpdate:modelValue": $
1770
- }, null, 8, ["model-value", "label", "value"])
1771
- ]),
1772
- O("div", hs, [
1773
- O("div", null, [
1774
- d.value.includes(G.value) ? (D(!0), K(oe, { key: 0 }, be(p.value[G.value], (z, a) => (D(), K("div", {
1775
- key: a,
1776
- class: "flex items-center gap-8"
1777
- }, [
1778
- C(U, {
1779
- "model-value": z.start,
1780
- "onUpdate:modelValue": (l) => E(G.value, a, l)
1781
- }, null, 8, ["model-value", "onUpdate:modelValue"]),
1782
- O("span", {
1783
- class: Z([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
1784
- }, B(S(o)("settings.operation_hours.to")), 1),
1785
- C(U, {
1786
- "model-value": z.end,
1787
- "onUpdate:modelValue": (l) => R(G.value, a, l)
1788
- }, null, 8, ["model-value", "onUpdate:modelValue"]),
1789
- C(X, {
1790
- icon: "close",
1791
- variant: "tertiary",
1792
- onClick: (l) => w(G.value, a)
1793
- }, null, 8, ["onClick"]),
1794
- C(X, {
1795
- class: Z(a === 0 ? "" : "invisible"),
1796
- icon: "add",
1797
- color: "primary",
1798
- variant: "secondary",
1799
- onClick: (l) => y(G.value)
1800
- }, null, 8, ["class", "onClick"])
1801
- ]))), 128)) : (D(), K("div", vs, [
1802
- C(Y, null, {
1803
- default: H(() => [
1804
- O("div", {
1805
- class: Z([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1806
- }, B(S(o)("settings.operation_hours.close")), 1)
1807
- ]),
1808
- _: 1
1809
- }),
1810
- O("span", {
1811
- class: Z([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
1812
- }, B(S(o)("settings.operation_hours.to")), 1),
1813
- C(Y, null, {
1814
- default: H(() => [
1815
- O("div", {
1816
- class: Z([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1817
- }, B(S(o)("settings.operation_hours.close")), 1)
1818
- ]),
1819
- _: 1
1820
- })
1821
- ]))
1822
- ])
1823
- ])
1824
- ]))), 128))
1825
- ]);
1826
- };
1827
- }
1828
- }), $r = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), _r = [
1829
- "home",
1830
- "app",
1831
- "about",
1832
- "tnc",
1833
- "terms-and-conditions",
1834
- "redirection",
1835
- "redirect",
1836
- "auth",
1837
- "login",
1838
- "logout",
1839
- "register",
1840
- "user",
1841
- "discovery",
1842
- "discover",
1843
- "order",
1844
- "orders",
1845
- "membership",
1846
- "memberships",
1847
- "member",
1848
- "members",
1849
- "benefit",
1850
- "benefits",
1851
- "reward",
1852
- "rewards",
1853
- "voucher",
1854
- "vouchers",
1855
- "search",
1856
- "restaurant",
1857
- "restaurants",
1858
- "business",
1859
- "businesses",
1860
- "dine",
1861
- "profile",
1862
- "scan",
1863
- "scanner",
1864
- "menu",
1865
- "cart",
1866
- "me",
1867
- "v",
1868
- "active-orders",
1869
- "qr",
1870
- "setting",
1871
- "settings",
1872
- "error",
1873
- "supportdetails",
1874
- "support-details",
1875
- "stacks",
1876
- "imulus",
1877
- "github",
1878
- "twitter",
1879
- "facebook",
1880
- "google",
1881
- "apple",
1882
- "about",
1883
- "account",
1884
- "activate",
1885
- "add",
1886
- "admin",
1887
- "administrator",
1888
- "api",
1889
- "app",
1890
- "apps",
1891
- "archive",
1892
- "archives",
1893
- "auth",
1894
- "blog",
1895
- "cache",
1896
- "cancel",
1897
- "careers",
1898
- "cart",
1899
- "changelog",
1900
- "checkout",
1901
- "codereview",
1902
- "compare",
1903
- "config",
1904
- "configuration",
1905
- "connect",
1906
- "contact",
1907
- "create",
1908
- "delete",
1909
- "direct_messages",
1910
- "documentation",
1911
- "download",
1912
- "downloads",
1913
- "edit",
1914
- "email",
1915
- "employment",
1916
- "enterprise",
1917
- "faq",
1918
- "favorites",
1919
- "feed",
1920
- "feedback",
1921
- "feeds",
1922
- "fleet",
1923
- "fleets",
1924
- "follow",
1925
- "followers",
1926
- "following",
1927
- "friend",
1928
- "friends",
1929
- "gist",
1930
- "group",
1931
- "groups",
1932
- "help",
1933
- "home",
1934
- "hosting",
1935
- "hostmaster",
1936
- "idea",
1937
- "ideas",
1938
- "index",
1939
- "info",
1940
- "invitations",
1941
- "invite",
1942
- "is",
1943
- "it",
1944
- "job",
1945
- "jobs",
1946
- "json",
1947
- "language",
1948
- "languages",
1949
- "lists",
1950
- "login",
1951
- "logout",
1952
- "logs",
1953
- "mail",
1954
- "map",
1955
- "maps",
1956
- "mine",
1957
- "mis",
1958
- "news",
1959
- "oauth",
1960
- "oauth_clients",
1961
- "offers",
1962
- "openid",
1963
- "order",
1964
- "orders",
1965
- "organizations",
1966
- "plans",
1967
- "popular",
1968
- "post",
1969
- "postmaster",
1970
- "privacy",
1971
- "projects",
1972
- "put",
1973
- "recruitment",
1974
- "register",
1975
- "remove",
1976
- "replies",
1977
- "root",
1978
- "rss",
1979
- "sales",
1980
- "save",
1981
- "search",
1982
- "security",
1983
- "sessions",
1984
- "settings",
1985
- "shop",
1986
- "signup",
1987
- "sitemap",
1988
- "ssl",
1989
- "ssladmin",
1990
- "ssladministrator",
1991
- "sslwebmaster",
1992
- "status",
1993
- "stories",
1994
- "styleguide",
1995
- "subscribe",
1996
- "subscriptions",
1997
- "support",
1998
- "sysadmin",
1999
- "sysadministrator",
2000
- "terms",
2001
- "tour",
2002
- "translations",
2003
- "trends",
2004
- "unfollow",
2005
- "unsubscribe",
2006
- "update",
2007
- "url",
2008
- "user",
2009
- "weather",
2010
- "webmaster",
2011
- "widget",
2012
- "widgets",
2013
- "wiki",
2014
- "ww",
2015
- "www",
2016
- "wwww",
2017
- "xfn",
2018
- "xml",
2019
- "xmpp",
2020
- "yaml",
2021
- "yml",
2022
- "chinese",
2023
- "mandarin",
2024
- "spanish",
2025
- "english",
2026
- "bengali",
2027
- "hindi",
2028
- "portuguese",
2029
- "russian",
2030
- "japanese",
2031
- "german",
2032
- "wu",
2033
- "javanese",
2034
- "korean",
2035
- "french",
2036
- "vietnamese",
2037
- "telugu",
2038
- "chinese",
2039
- "marathi",
2040
- "tamil",
2041
- "turkish",
2042
- "urdu",
2043
- "min-nan",
2044
- "jinyu",
2045
- "gujarati",
2046
- "polish",
2047
- "arabic",
2048
- "ukrainian",
2049
- "italian",
2050
- "xiang",
2051
- "malayalam",
2052
- "hakka",
2053
- "kannada",
2054
- "oriya",
2055
- "panjabi",
2056
- "sunda",
2057
- "panjabi",
2058
- "romanian",
2059
- "bhojpuri",
2060
- "azerbaijani",
2061
- "farsi",
2062
- "maithili",
2063
- "hausa",
2064
- "arabic",
2065
- "burmese",
2066
- "serbo-croatian",
2067
- "gan",
2068
- "awadhi",
2069
- "thai",
2070
- "dutch",
2071
- "yoruba",
2072
- "sindhi",
2073
- "ac",
2074
- "ad",
2075
- "ae",
2076
- "af",
2077
- "ag",
2078
- "ai",
2079
- "al",
2080
- "am",
2081
- "an",
2082
- "ao",
2083
- "aq",
2084
- "ar",
2085
- "as",
2086
- "at",
2087
- "au",
2088
- "aw",
2089
- "ax",
2090
- "az",
2091
- "ba",
2092
- "bb",
2093
- "bd",
2094
- "be",
2095
- "bf",
2096
- "bg",
2097
- "bh",
2098
- "bi",
2099
- "bj",
2100
- "bm",
2101
- "bn",
2102
- "bo",
2103
- "br",
2104
- "bs",
2105
- "bt",
2106
- "bv",
2107
- "bw",
2108
- "by",
2109
- "bz",
2110
- "ca",
2111
- "cc",
2112
- "cd",
2113
- "cf",
2114
- "cg",
2115
- "ch",
2116
- "ci",
2117
- "ck",
2118
- "cl",
2119
- "cm",
2120
- "cn",
2121
- "co",
2122
- "cr",
2123
- "cs",
2124
- "cu",
2125
- "cv",
2126
- "cx",
2127
- "cy",
2128
- "cz",
2129
- "dd",
2130
- "de",
2131
- "dj",
2132
- "dk",
2133
- "dm",
2134
- "do",
2135
- "dz",
2136
- "ec",
2137
- "ee",
2138
- "eg",
2139
- "eh",
2140
- "er",
2141
- "es",
2142
- "et",
2143
- "eu",
2144
- "fi",
2145
- "fj",
2146
- "fk",
2147
- "fm",
2148
- "fo",
2149
- "fr",
2150
- "ga",
2151
- "gb",
2152
- "gd",
2153
- "ge",
2154
- "gf",
2155
- "gg",
2156
- "gh",
2157
- "gi",
2158
- "gl",
2159
- "gm",
2160
- "gn",
2161
- "gp",
2162
- "gq",
2163
- "gr",
2164
- "gs",
2165
- "gt",
2166
- "gu",
2167
- "gw",
2168
- "gy",
2169
- "hk",
2170
- "hm",
2171
- "hn",
2172
- "hr",
2173
- "ht",
2174
- "hu",
2175
- "id",
2176
- "ie",
2177
- "il",
2178
- "im",
2179
- "in",
2180
- "io",
2181
- "iq",
2182
- "ir",
2183
- "is",
2184
- "it",
2185
- "je",
2186
- "jm",
2187
- "jo",
2188
- "jp",
2189
- "ke",
2190
- "kg",
2191
- "kh",
2192
- "ki",
2193
- "km",
2194
- "kn",
2195
- "kp",
2196
- "kr",
2197
- "kw",
2198
- "ky",
2199
- "kz",
2200
- "la",
2201
- "lb",
2202
- "lc",
2203
- "li",
2204
- "lk",
2205
- "lr",
2206
- "ls",
2207
- "lt",
2208
- "lu",
2209
- "lv",
2210
- "ly",
2211
- "ma",
2212
- "mc",
2213
- "md",
2214
- "me",
2215
- "mg",
2216
- "mh",
2217
- "mk",
2218
- "ml",
2219
- "mm",
2220
- "mn",
2221
- "mo",
2222
- "mp",
2223
- "mq",
2224
- "mr",
2225
- "ms",
2226
- "mt",
2227
- "mu",
2228
- "mv",
2229
- "mw",
2230
- "mx",
2231
- "my",
2232
- "mz",
2233
- "na",
2234
- "nc",
2235
- "ne",
2236
- "nf",
2237
- "ng",
2238
- "ni",
2239
- "nl",
2240
- "no",
2241
- "np",
2242
- "nr",
2243
- "nu",
2244
- "nz",
2245
- "om",
2246
- "pa",
2247
- "pe",
2248
- "pf",
2249
- "pg",
2250
- "ph",
2251
- "pk",
2252
- "pl",
2253
- "pm",
2254
- "pn",
2255
- "pr",
2256
- "ps",
2257
- "pt",
2258
- "pw",
2259
- "py",
2260
- "qa",
2261
- "re",
2262
- "ro",
2263
- "rs",
2264
- "ru",
2265
- "rw",
2266
- "sa",
2267
- "sb",
2268
- "sc",
2269
- "sd",
2270
- "se",
2271
- "sg",
2272
- "sh",
2273
- "si",
2274
- "sj",
2275
- "sk",
2276
- "sl",
2277
- "sm",
2278
- "sn",
2279
- "so",
2280
- "sr",
2281
- "ss",
2282
- "st",
2283
- "su",
2284
- "sv",
2285
- "sy",
2286
- "sz",
2287
- "tc",
2288
- "td",
2289
- "tf",
2290
- "tg",
2291
- "th",
2292
- "tj",
2293
- "tk",
2294
- "tl",
2295
- "tm",
2296
- "tn",
2297
- "to",
2298
- "tp",
2299
- "tr",
2300
- "tt",
2301
- "tv",
2302
- "tw",
2303
- "tz",
2304
- "ua",
2305
- "ug",
2306
- "uk",
2307
- "us",
2308
- "uy",
2309
- "uz",
2310
- "va",
2311
- "vc",
2312
- "ve",
2313
- "vg",
2314
- "vi",
2315
- "vn",
2316
- "vu",
2317
- "wf",
2318
- "ws",
2319
- "ye",
2320
- "yt",
2321
- "yu",
2322
- "za",
2323
- "zm",
2324
- "zw"
2325
- ];
2326
- var dt = { exports: {} };
2327
- const bs = "2.0.0", Er = 256, ys = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
2328
- 9007199254740991, $s = 16, _s = Er - 6, Es = [
2329
- "major",
2330
- "premajor",
2331
- "minor",
2332
- "preminor",
2333
- "patch",
2334
- "prepatch",
2335
- "prerelease"
2336
- ];
2337
- var Be = {
2338
- MAX_LENGTH: Er,
2339
- MAX_SAFE_COMPONENT_LENGTH: $s,
2340
- MAX_SAFE_BUILD_LENGTH: _s,
2341
- MAX_SAFE_INTEGER: ys,
2342
- RELEASE_TYPES: Es,
2343
- SEMVER_SPEC_VERSION: bs,
2344
- FLAG_INCLUDE_PRERELEASE: 1,
2345
- FLAG_LOOSE: 2
2346
- };
2347
- const ws = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...r) => console.error("SEMVER", ...r) : () => {
2348
- };
2349
- var Ke = ws;
2350
- (function(r, e) {
2351
- const {
2352
- MAX_SAFE_COMPONENT_LENGTH: t,
2353
- MAX_SAFE_BUILD_LENGTH: n,
2354
- MAX_LENGTH: s
2355
- } = Be, o = Ke;
2356
- e = r.exports = {};
2357
- const i = e.re = [], h = e.safeRe = [], p = e.src = [], d = e.t = {};
2358
- let _ = 0;
2359
- const $ = "[a-zA-Z0-9-]", y = [
2360
- ["\\s", 1],
2361
- ["\\d", s],
2362
- [$, n]
2363
- ], w = (R) => {
2364
- for (const [M, k] of y)
2365
- R = R.split(`${M}*`).join(`${M}{0,${k}}`).split(`${M}+`).join(`${M}{1,${k}}`);
2366
- return R;
2367
- }, E = (R, M, k) => {
2368
- const F = w(M), T = _++;
2369
- o(R, T, M), d[R] = T, p[T] = M, i[T] = new RegExp(M, k ? "g" : void 0), h[T] = new RegExp(F, k ? "g" : void 0);
2370
- };
2371
- E("NUMERICIDENTIFIER", "0|[1-9]\\d*"), E("NUMERICIDENTIFIERLOOSE", "\\d+"), E("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${$}*`), E("MAINVERSION", `(${p[d.NUMERICIDENTIFIER]})\\.(${p[d.NUMERICIDENTIFIER]})\\.(${p[d.NUMERICIDENTIFIER]})`), E("MAINVERSIONLOOSE", `(${p[d.NUMERICIDENTIFIERLOOSE]})\\.(${p[d.NUMERICIDENTIFIERLOOSE]})\\.(${p[d.NUMERICIDENTIFIERLOOSE]})`), E("PRERELEASEIDENTIFIER", `(?:${p[d.NUMERICIDENTIFIER]}|${p[d.NONNUMERICIDENTIFIER]})`), E("PRERELEASEIDENTIFIERLOOSE", `(?:${p[d.NUMERICIDENTIFIERLOOSE]}|${p[d.NONNUMERICIDENTIFIER]})`), E("PRERELEASE", `(?:-(${p[d.PRERELEASEIDENTIFIER]}(?:\\.${p[d.PRERELEASEIDENTIFIER]})*))`), E("PRERELEASELOOSE", `(?:-?(${p[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[d.PRERELEASEIDENTIFIERLOOSE]})*))`), E("BUILDIDENTIFIER", `${$}+`), E("BUILD", `(?:\\+(${p[d.BUILDIDENTIFIER]}(?:\\.${p[d.BUILDIDENTIFIER]})*))`), E("FULLPLAIN", `v?${p[d.MAINVERSION]}${p[d.PRERELEASE]}?${p[d.BUILD]}?`), E("FULL", `^${p[d.FULLPLAIN]}$`), E("LOOSEPLAIN", `[v=\\s]*${p[d.MAINVERSIONLOOSE]}${p[d.PRERELEASELOOSE]}?${p[d.BUILD]}?`), E("LOOSE", `^${p[d.LOOSEPLAIN]}$`), E("GTLT", "((?:<|>)?=?)"), E("XRANGEIDENTIFIERLOOSE", `${p[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), E("XRANGEIDENTIFIER", `${p[d.NUMERICIDENTIFIER]}|x|X|\\*`), E("XRANGEPLAIN", `[v=\\s]*(${p[d.XRANGEIDENTIFIER]})(?:\\.(${p[d.XRANGEIDENTIFIER]})(?:\\.(${p[d.XRANGEIDENTIFIER]})(?:${p[d.PRERELEASE]})?${p[d.BUILD]}?)?)?`), E("XRANGEPLAINLOOSE", `[v=\\s]*(${p[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[d.XRANGEIDENTIFIERLOOSE]})(?:${p[d.PRERELEASELOOSE]})?${p[d.BUILD]}?)?)?`), E("XRANGE", `^${p[d.GTLT]}\\s*${p[d.XRANGEPLAIN]}$`), E("XRANGELOOSE", `^${p[d.GTLT]}\\s*${p[d.XRANGEPLAINLOOSE]}$`), E("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), E("COERCE", `${p[d.COERCEPLAIN]}(?:$|[^\\d])`), E("COERCEFULL", p[d.COERCEPLAIN] + `(?:${p[d.PRERELEASE]})?(?:${p[d.BUILD]})?(?:$|[^\\d])`), E("COERCERTL", p[d.COERCE], !0), E("COERCERTLFULL", p[d.COERCEFULL], !0), E("LONETILDE", "(?:~>?)"), E("TILDETRIM", `(\\s*)${p[d.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", E("TILDE", `^${p[d.LONETILDE]}${p[d.XRANGEPLAIN]}$`), E("TILDELOOSE", `^${p[d.LONETILDE]}${p[d.XRANGEPLAINLOOSE]}$`), E("LONECARET", "(?:\\^)"), E("CARETTRIM", `(\\s*)${p[d.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", E("CARET", `^${p[d.LONECARET]}${p[d.XRANGEPLAIN]}$`), E("CARETLOOSE", `^${p[d.LONECARET]}${p[d.XRANGEPLAINLOOSE]}$`), E("COMPARATORLOOSE", `^${p[d.GTLT]}\\s*(${p[d.LOOSEPLAIN]})$|^$`), E("COMPARATOR", `^${p[d.GTLT]}\\s*(${p[d.FULLPLAIN]})$|^$`), E("COMPARATORTRIM", `(\\s*)${p[d.GTLT]}\\s*(${p[d.LOOSEPLAIN]}|${p[d.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", E("HYPHENRANGE", `^\\s*(${p[d.XRANGEPLAIN]})\\s+-\\s+(${p[d.XRANGEPLAIN]})\\s*$`), E("HYPHENRANGELOOSE", `^\\s*(${p[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[d.XRANGEPLAINLOOSE]})\\s*$`), E("STAR", "(<|>)?=?\\s*\\*"), E("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), E("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
2372
- })(dt, dt.exports);
2373
- var Pe = dt.exports;
2374
- const Rs = Object.freeze({ loose: !0 }), Is = Object.freeze({}), Os = (r) => r ? typeof r != "object" ? Rs : r : Is;
2375
- var bt = Os;
2376
- const jt = /^[0-9]+$/, wr = (r, e) => {
2377
- const t = jt.test(r), n = jt.test(e);
2378
- return t && n && (r = +r, e = +e), r === e ? 0 : t && !n ? -1 : n && !t ? 1 : r < e ? -1 : 1;
2379
- }, As = (r, e) => wr(e, r);
2380
- var Rr = {
2381
- compareIdentifiers: wr,
2382
- rcompareIdentifiers: As
2383
- };
2384
- const Ce = Ke, { MAX_LENGTH: Dt, MAX_SAFE_INTEGER: ke } = Be, { safeRe: Ut, t: Gt } = Pe, Ss = bt, { compareIdentifiers: $e } = Rr;
2385
- let Ts = class ue {
2386
- constructor(e, t) {
2387
- if (t = Ss(t), e instanceof ue) {
2388
- if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
2389
- return e;
2390
- e = e.version;
2391
- } else if (typeof e != "string")
2392
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
2393
- if (e.length > Dt)
2394
- throw new TypeError(
2395
- `version is longer than ${Dt} characters`
2396
- );
2397
- Ce("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
2398
- const n = e.trim().match(t.loose ? Ut[Gt.LOOSE] : Ut[Gt.FULL]);
2399
- if (!n)
2400
- throw new TypeError(`Invalid Version: ${e}`);
2401
- if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > ke || this.major < 0)
2402
- throw new TypeError("Invalid major version");
2403
- if (this.minor > ke || this.minor < 0)
2404
- throw new TypeError("Invalid minor version");
2405
- if (this.patch > ke || this.patch < 0)
2406
- throw new TypeError("Invalid patch version");
2407
- n[4] ? this.prerelease = n[4].split(".").map((s) => {
2408
- if (/^[0-9]+$/.test(s)) {
2409
- const o = +s;
2410
- if (o >= 0 && o < ke)
2411
- return o;
2412
- }
2413
- return s;
2414
- }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format();
2415
- }
2416
- format() {
2417
- return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
2418
- }
2419
- toString() {
2420
- return this.version;
2421
- }
2422
- compare(e) {
2423
- if (Ce("SemVer.compare", this.version, this.options, e), !(e instanceof ue)) {
2424
- if (typeof e == "string" && e === this.version)
2425
- return 0;
2426
- e = new ue(e, this.options);
2427
- }
2428
- return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
2429
- }
2430
- compareMain(e) {
2431
- return e instanceof ue || (e = new ue(e, this.options)), $e(this.major, e.major) || $e(this.minor, e.minor) || $e(this.patch, e.patch);
2432
- }
2433
- comparePre(e) {
2434
- if (e instanceof ue || (e = new ue(e, this.options)), this.prerelease.length && !e.prerelease.length)
2435
- return -1;
2436
- if (!this.prerelease.length && e.prerelease.length)
2437
- return 1;
2438
- if (!this.prerelease.length && !e.prerelease.length)
2439
- return 0;
2440
- let t = 0;
2441
- do {
2442
- const n = this.prerelease[t], s = e.prerelease[t];
2443
- if (Ce("prerelease compare", t, n, s), n === void 0 && s === void 0)
2444
- return 0;
2445
- if (s === void 0)
2446
- return 1;
2447
- if (n === void 0)
2448
- return -1;
2449
- if (n === s)
2450
- continue;
2451
- return $e(n, s);
2452
- } while (++t);
2453
- }
2454
- compareBuild(e) {
2455
- e instanceof ue || (e = new ue(e, this.options));
2456
- let t = 0;
2457
- do {
2458
- const n = this.build[t], s = e.build[t];
2459
- if (Ce("build compare", t, n, s), n === void 0 && s === void 0)
2460
- return 0;
2461
- if (s === void 0)
2462
- return 1;
2463
- if (n === void 0)
2464
- return -1;
2465
- if (n === s)
2466
- continue;
2467
- return $e(n, s);
2468
- } while (++t);
2469
- }
2470
- // preminor will bump the version up to the next minor release, and immediately
2471
- // down to pre-release. premajor and prepatch work the same way.
2472
- inc(e, t, n) {
2473
- switch (e) {
2474
- case "premajor":
2475
- this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, n);
2476
- break;
2477
- case "preminor":
2478
- this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, n);
2479
- break;
2480
- case "prepatch":
2481
- this.prerelease.length = 0, this.inc("patch", t, n), this.inc("pre", t, n);
2482
- break;
2483
- case "prerelease":
2484
- this.prerelease.length === 0 && this.inc("patch", t, n), this.inc("pre", t, n);
2485
- break;
2486
- case "major":
2487
- (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
2488
- break;
2489
- case "minor":
2490
- (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
2491
- break;
2492
- case "patch":
2493
- this.prerelease.length === 0 && this.patch++, this.prerelease = [];
2494
- break;
2495
- case "pre": {
2496
- const s = Number(n) ? 1 : 0;
2497
- if (!t && n === !1)
2498
- throw new Error("invalid increment argument: identifier is empty");
2499
- if (this.prerelease.length === 0)
2500
- this.prerelease = [s];
2501
- else {
2502
- let o = this.prerelease.length;
2503
- for (; --o >= 0; )
2504
- typeof this.prerelease[o] == "number" && (this.prerelease[o]++, o = -2);
2505
- if (o === -1) {
2506
- if (t === this.prerelease.join(".") && n === !1)
2507
- throw new Error("invalid increment argument: identifier already exists");
2508
- this.prerelease.push(s);
2509
- }
2510
- }
2511
- if (t) {
2512
- let o = [t, s];
2513
- n === !1 && (o = [t]), $e(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = o) : this.prerelease = o;
2514
- }
2515
- break;
2516
- }
2517
- default:
2518
- throw new Error(`invalid increment argument: ${e}`);
2519
- }
2520
- return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
2521
- }
2522
- };
2523
- var te = Ts;
2524
- const Bt = te, Ps = (r, e, t = !1) => {
2525
- if (r instanceof Bt)
2526
- return r;
2527
- try {
2528
- return new Bt(r, e);
2529
- } catch (n) {
2530
- if (!t)
2531
- return null;
2532
- throw n;
2533
- }
2534
- };
2535
- var Ie = Ps;
2536
- const Ls = Ie, Ns = (r, e) => {
2537
- const t = Ls(r, e);
2538
- return t ? t.version : null;
2539
- };
2540
- var Cs = Ns;
2541
- const ks = Ie, xs = (r, e) => {
2542
- const t = ks(r.trim().replace(/^[=v]+/, ""), e);
2543
- return t ? t.version : null;
2544
- };
2545
- var Ms = xs;
2546
- const Kt = te, Vs = (r, e, t, n, s) => {
2547
- typeof t == "string" && (s = n, n = t, t = void 0);
2548
- try {
2549
- return new Kt(
2550
- r instanceof Kt ? r.version : r,
2551
- t
2552
- ).inc(e, n, s).version;
2553
- } catch {
2554
- return null;
2555
- }
2556
- };
2557
- var Fs = Vs;
2558
- const Ht = Ie, js = (r, e) => {
2559
- const t = Ht(r, null, !0), n = Ht(e, null, !0), s = t.compare(n);
2560
- if (s === 0)
2561
- return null;
2562
- const o = s > 0, i = o ? t : n, h = o ? n : t, p = !!i.prerelease.length;
2563
- if (!!h.prerelease.length && !p)
2564
- return !h.patch && !h.minor ? "major" : i.patch ? "patch" : i.minor ? "minor" : "major";
2565
- const _ = p ? "pre" : "";
2566
- return t.major !== n.major ? _ + "major" : t.minor !== n.minor ? _ + "minor" : t.patch !== n.patch ? _ + "patch" : "prerelease";
2567
- };
2568
- var Ds = js;
2569
- const Us = te, Gs = (r, e) => new Us(r, e).major;
2570
- var Bs = Gs;
2571
- const Ks = te, Hs = (r, e) => new Ks(r, e).minor;
2572
- var qs = Hs;
2573
- const Ys = te, zs = (r, e) => new Ys(r, e).patch;
2574
- var Xs = zs;
2575
- const Ws = Ie, Js = (r, e) => {
2576
- const t = Ws(r, e);
2577
- return t && t.prerelease.length ? t.prerelease : null;
2578
- };
2579
- var Zs = Js;
2580
- const qt = te, Qs = (r, e, t) => new qt(r, t).compare(new qt(e, t));
2581
- var ie = Qs;
2582
- const ea = ie, ta = (r, e, t) => ea(e, r, t);
2583
- var ra = ta;
2584
- const na = ie, sa = (r, e) => na(r, e, !0);
2585
- var aa = sa;
2586
- const Yt = te, oa = (r, e, t) => {
2587
- const n = new Yt(r, t), s = new Yt(e, t);
2588
- return n.compare(s) || n.compareBuild(s);
2589
- };
2590
- var yt = oa;
2591
- const ia = yt, la = (r, e) => r.sort((t, n) => ia(t, n, e));
2592
- var ua = la;
2593
- const ca = yt, da = (r, e) => r.sort((t, n) => ca(n, t, e));
2594
- var fa = da;
2595
- const ma = ie, pa = (r, e, t) => ma(r, e, t) > 0;
2596
- var He = pa;
2597
- const ha = ie, va = (r, e, t) => ha(r, e, t) < 0;
2598
- var $t = va;
2599
- const ga = ie, ba = (r, e, t) => ga(r, e, t) === 0;
2600
- var Ir = ba;
2601
- const ya = ie, $a = (r, e, t) => ya(r, e, t) !== 0;
2602
- var Or = $a;
2603
- const _a = ie, Ea = (r, e, t) => _a(r, e, t) >= 0;
2604
- var _t = Ea;
2605
- const wa = ie, Ra = (r, e, t) => wa(r, e, t) <= 0;
2606
- var Et = Ra;
2607
- const Ia = Ir, Oa = Or, Aa = He, Sa = _t, Ta = $t, Pa = Et, La = (r, e, t, n) => {
2608
- switch (e) {
2609
- case "===":
2610
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r === t;
2611
- case "!==":
2612
- return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r !== t;
2613
- case "":
2614
- case "=":
2615
- case "==":
2616
- return Ia(r, t, n);
2617
- case "!=":
2618
- return Oa(r, t, n);
2619
- case ">":
2620
- return Aa(r, t, n);
2621
- case ">=":
2622
- return Sa(r, t, n);
2623
- case "<":
2624
- return Ta(r, t, n);
2625
- case "<=":
2626
- return Pa(r, t, n);
2627
- default:
2628
- throw new TypeError(`Invalid operator: ${e}`);
2629
- }
2630
- };
2631
- var Ar = La;
2632
- const Na = te, Ca = Ie, { safeRe: xe, t: Me } = Pe, ka = (r, e) => {
2633
- if (r instanceof Na)
2634
- return r;
2635
- if (typeof r == "number" && (r = String(r)), typeof r != "string")
2636
- return null;
2637
- e = e || {};
2638
- let t = null;
2639
- if (!e.rtl)
2640
- t = r.match(e.includePrerelease ? xe[Me.COERCEFULL] : xe[Me.COERCE]);
2641
- else {
2642
- const p = e.includePrerelease ? xe[Me.COERCERTLFULL] : xe[Me.COERCERTL];
2643
- let d;
2644
- for (; (d = p.exec(r)) && (!t || t.index + t[0].length !== r.length); )
2645
- (!t || d.index + d[0].length !== t.index + t[0].length) && (t = d), p.lastIndex = d.index + d[1].length + d[2].length;
2646
- p.lastIndex = -1;
2647
- }
2648
- if (t === null)
2649
- return null;
2650
- const n = t[2], s = t[3] || "0", o = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", h = e.includePrerelease && t[6] ? `+${t[6]}` : "";
2651
- return Ca(`${n}.${s}.${o}${i}${h}`, e);
2652
- };
2653
- var xa = ka;
2654
- class Ma {
2655
- constructor() {
2656
- this.max = 1e3, this.map = /* @__PURE__ */ new Map();
2657
- }
2658
- get(e) {
2659
- const t = this.map.get(e);
2660
- if (t !== void 0)
2661
- return this.map.delete(e), this.map.set(e, t), t;
2662
- }
2663
- delete(e) {
2664
- return this.map.delete(e);
2665
- }
2666
- set(e, t) {
2667
- if (!this.delete(e) && t !== void 0) {
2668
- if (this.map.size >= this.max) {
2669
- const s = this.map.keys().next().value;
2670
- this.delete(s);
2671
- }
2672
- this.map.set(e, t);
2673
- }
2674
- return this;
2675
- }
2676
- }
2677
- var Va = Ma, et, zt;
2678
- function le() {
2679
- if (zt)
2680
- return et;
2681
- zt = 1;
2682
- const r = /\s+/g;
2683
- class e {
2684
- constructor(u, m) {
2685
- if (m = s(m), u instanceof e)
2686
- return u.loose === !!m.loose && u.includePrerelease === !!m.includePrerelease ? u : new e(u.raw, m);
2687
- if (u instanceof o)
2688
- return this.raw = u.value, this.set = [[u]], this.formatted = void 0, this;
2689
- if (this.options = m, this.loose = !!m.loose, this.includePrerelease = !!m.includePrerelease, this.raw = u.trim().replace(r, " "), this.set = this.raw.split("||").map((v) => this.parseRange(v.trim())).filter((v) => v.length), !this.set.length)
2690
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
2691
- if (this.set.length > 1) {
2692
- const v = this.set[0];
2693
- if (this.set = this.set.filter((c) => !R(c[0])), this.set.length === 0)
2694
- this.set = [v];
2695
- else if (this.set.length > 1) {
2696
- for (const c of this.set)
2697
- if (c.length === 1 && M(c[0])) {
2698
- this.set = [c];
2699
- break;
2700
- }
2701
- }
2702
- }
2703
- this.formatted = void 0;
2704
- }
2705
- get range() {
2706
- if (this.formatted === void 0) {
2707
- this.formatted = "";
2708
- for (let u = 0; u < this.set.length; u++) {
2709
- u > 0 && (this.formatted += "||");
2710
- const m = this.set[u];
2711
- for (let v = 0; v < m.length; v++)
2712
- v > 0 && (this.formatted += " "), this.formatted += m[v].toString().trim();
2713
- }
2714
- }
2715
- return this.formatted;
2716
- }
2717
- format() {
2718
- return this.range;
2719
- }
2720
- toString() {
2721
- return this.range;
2722
- }
2723
- parseRange(u) {
2724
- const v = ((this.options.includePrerelease && w) | (this.options.loose && E)) + ":" + u, c = n.get(v);
2725
- if (c)
2726
- return c;
2727
- const b = this.options.loose, I = b ? p[d.HYPHENRANGELOOSE] : p[d.HYPHENRANGE];
2728
- u = u.replace(I, A(this.options.includePrerelease)), i("hyphen replace", u), u = u.replace(p[d.COMPARATORTRIM], _), i("comparator trim", u), u = u.replace(p[d.TILDETRIM], $), i("tilde trim", u), u = u.replace(p[d.CARETTRIM], y), i("caret trim", u);
2729
- let x = u.split(" ").map((V) => F(V, this.options)).join(" ").split(/\s+/).map((V) => g(V, this.options));
2730
- b && (x = x.filter((V) => (i("loose invalid filter", V, this.options), !!V.match(p[d.COMPARATORLOOSE])))), i("range list", x);
2731
- const N = /* @__PURE__ */ new Map(), P = x.map((V) => new o(V, this.options));
2732
- for (const V of P) {
2733
- if (R(V))
2734
- return [V];
2735
- N.set(V.value, V);
2736
- }
2737
- N.size > 1 && N.has("") && N.delete("");
2738
- const j = [...N.values()];
2739
- return n.set(v, j), j;
2740
- }
2741
- intersects(u, m) {
2742
- if (!(u instanceof e))
2743
- throw new TypeError("a Range is required");
2744
- return this.set.some((v) => k(v, m) && u.set.some((c) => k(c, m) && v.every((b) => c.every((I) => b.intersects(I, m)))));
2745
- }
2746
- // if ANY of the sets match ALL of its comparators, then pass
2747
- test(u) {
2748
- if (!u)
2749
- return !1;
2750
- if (typeof u == "string")
2751
- try {
2752
- u = new h(u, this.options);
2753
- } catch {
2754
- return !1;
2755
- }
2756
- for (let m = 0; m < this.set.length; m++)
2757
- if (L(this.set[m], u, this.options))
2758
- return !0;
2759
- return !1;
2760
- }
2761
- }
2762
- et = e;
2763
- const t = Va, n = new t(), s = bt, o = qe(), i = Ke, h = te, {
2764
- safeRe: p,
2765
- t: d,
2766
- comparatorTrimReplace: _,
2767
- tildeTrimReplace: $,
2768
- caretTrimReplace: y
2769
- } = Pe, { FLAG_INCLUDE_PRERELEASE: w, FLAG_LOOSE: E } = Be, R = (f) => f.value === "<0.0.0-0", M = (f) => f.value === "", k = (f, u) => {
2770
- let m = !0;
2771
- const v = f.slice();
2772
- let c = v.pop();
2773
- for (; m && v.length; )
2774
- m = v.every((b) => c.intersects(b, u)), c = v.pop();
2775
- return m;
2776
- }, F = (f, u) => (i("comp", f, u), f = Y(f, u), i("caret", f), f = U(f, u), i("tildes", f), f = z(f, u), i("xrange", f), f = l(f, u), i("stars", f), f), T = (f) => !f || f.toLowerCase() === "x" || f === "*", U = (f, u) => f.trim().split(/\s+/).map((m) => X(m, u)).join(" "), X = (f, u) => {
2777
- const m = u.loose ? p[d.TILDELOOSE] : p[d.TILDE];
2778
- return f.replace(m, (v, c, b, I, x) => {
2779
- i("tilde", f, v, c, b, I, x);
2780
- let N;
2781
- return T(c) ? N = "" : T(b) ? N = `>=${c}.0.0 <${+c + 1}.0.0-0` : T(I) ? N = `>=${c}.${b}.0 <${c}.${+b + 1}.0-0` : x ? (i("replaceTilde pr", x), N = `>=${c}.${b}.${I}-${x} <${c}.${+b + 1}.0-0`) : N = `>=${c}.${b}.${I} <${c}.${+b + 1}.0-0`, i("tilde return", N), N;
2782
- });
2783
- }, Y = (f, u) => f.trim().split(/\s+/).map((m) => G(m, u)).join(" "), G = (f, u) => {
2784
- i("caret", f, u);
2785
- const m = u.loose ? p[d.CARETLOOSE] : p[d.CARET], v = u.includePrerelease ? "-0" : "";
2786
- return f.replace(m, (c, b, I, x, N) => {
2787
- i("caret", f, c, b, I, x, N);
2788
- let P;
2789
- return T(b) ? P = "" : T(I) ? P = `>=${b}.0.0${v} <${+b + 1}.0.0-0` : T(x) ? b === "0" ? P = `>=${b}.${I}.0${v} <${b}.${+I + 1}.0-0` : P = `>=${b}.${I}.0${v} <${+b + 1}.0.0-0` : N ? (i("replaceCaret pr", N), b === "0" ? I === "0" ? P = `>=${b}.${I}.${x}-${N} <${b}.${I}.${+x + 1}-0` : P = `>=${b}.${I}.${x}-${N} <${b}.${+I + 1}.0-0` : P = `>=${b}.${I}.${x}-${N} <${+b + 1}.0.0-0`) : (i("no pr"), b === "0" ? I === "0" ? P = `>=${b}.${I}.${x}${v} <${b}.${I}.${+x + 1}-0` : P = `>=${b}.${I}.${x}${v} <${b}.${+I + 1}.0-0` : P = `>=${b}.${I}.${x} <${+b + 1}.0.0-0`), i("caret return", P), P;
2790
- });
2791
- }, z = (f, u) => (i("replaceXRanges", f, u), f.split(/\s+/).map((m) => a(m, u)).join(" ")), a = (f, u) => {
2792
- f = f.trim();
2793
- const m = u.loose ? p[d.XRANGELOOSE] : p[d.XRANGE];
2794
- return f.replace(m, (v, c, b, I, x, N) => {
2795
- i("xRange", f, v, c, b, I, x, N);
2796
- const P = T(b), j = P || T(I), V = j || T(x), J = V;
2797
- return c === "=" && J && (c = ""), N = u.includePrerelease ? "-0" : "", P ? c === ">" || c === "<" ? v = "<0.0.0-0" : v = "*" : c && J ? (j && (I = 0), x = 0, c === ">" ? (c = ">=", j ? (b = +b + 1, I = 0, x = 0) : (I = +I + 1, x = 0)) : c === "<=" && (c = "<", j ? b = +b + 1 : I = +I + 1), c === "<" && (N = "-0"), v = `${c + b}.${I}.${x}${N}`) : j ? v = `>=${b}.0.0${N} <${+b + 1}.0.0-0` : V && (v = `>=${b}.${I}.0${N} <${b}.${+I + 1}.0-0`), i("xRange return", v), v;
2798
- });
2799
- }, l = (f, u) => (i("replaceStars", f, u), f.trim().replace(p[d.STAR], "")), g = (f, u) => (i("replaceGTE0", f, u), f.trim().replace(p[u.includePrerelease ? d.GTE0PRE : d.GTE0], "")), A = (f) => (u, m, v, c, b, I, x, N, P, j, V, J) => (T(v) ? m = "" : T(c) ? m = `>=${v}.0.0${f ? "-0" : ""}` : T(b) ? m = `>=${v}.${c}.0${f ? "-0" : ""}` : I ? m = `>=${m}` : m = `>=${m}${f ? "-0" : ""}`, T(P) ? N = "" : T(j) ? N = `<${+P + 1}.0.0-0` : T(V) ? N = `<${P}.${+j + 1}.0-0` : J ? N = `<=${P}.${j}.${V}-${J}` : f ? N = `<${P}.${j}.${+V + 1}-0` : N = `<=${N}`, `${m} ${N}`.trim()), L = (f, u, m) => {
2800
- for (let v = 0; v < f.length; v++)
2801
- if (!f[v].test(u))
2802
- return !1;
2803
- if (u.prerelease.length && !m.includePrerelease) {
2804
- for (let v = 0; v < f.length; v++)
2805
- if (i(f[v].semver), f[v].semver !== o.ANY && f[v].semver.prerelease.length > 0) {
2806
- const c = f[v].semver;
2807
- if (c.major === u.major && c.minor === u.minor && c.patch === u.patch)
2808
- return !0;
2809
- }
2810
- return !1;
2811
- }
2812
- return !0;
2813
- };
2814
- return et;
2815
- }
2816
- var tt, Xt;
2817
- function qe() {
2818
- if (Xt)
2819
- return tt;
2820
- Xt = 1;
2821
- const r = Symbol("SemVer ANY");
2822
- class e {
2823
- static get ANY() {
2824
- return r;
2825
- }
2826
- constructor(_, $) {
2827
- if ($ = t($), _ instanceof e) {
2828
- if (_.loose === !!$.loose)
2829
- return _;
2830
- _ = _.value;
2831
- }
2832
- _ = _.trim().split(/\s+/).join(" "), i("comparator", _, $), this.options = $, this.loose = !!$.loose, this.parse(_), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, i("comp", this);
2833
- }
2834
- parse(_) {
2835
- const $ = this.options.loose ? n[s.COMPARATORLOOSE] : n[s.COMPARATOR], y = _.match($);
2836
- if (!y)
2837
- throw new TypeError(`Invalid comparator: ${_}`);
2838
- this.operator = y[1] !== void 0 ? y[1] : "", this.operator === "=" && (this.operator = ""), y[2] ? this.semver = new h(y[2], this.options.loose) : this.semver = r;
2839
- }
2840
- toString() {
2841
- return this.value;
2842
- }
2843
- test(_) {
2844
- if (i("Comparator.test", _, this.options.loose), this.semver === r || _ === r)
2845
- return !0;
2846
- if (typeof _ == "string")
2847
- try {
2848
- _ = new h(_, this.options);
2849
- } catch {
2850
- return !1;
2851
- }
2852
- return o(_, this.operator, this.semver, this.options);
2853
- }
2854
- intersects(_, $) {
2855
- if (!(_ instanceof e))
2856
- throw new TypeError("a Comparator is required");
2857
- return this.operator === "" ? this.value === "" ? !0 : new p(_.value, $).test(this.value) : _.operator === "" ? _.value === "" ? !0 : new p(this.value, $).test(_.semver) : ($ = t($), $.includePrerelease && (this.value === "<0.0.0-0" || _.value === "<0.0.0-0") || !$.includePrerelease && (this.value.startsWith("<0.0.0") || _.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && _.operator.startsWith(">") || this.operator.startsWith("<") && _.operator.startsWith("<") || this.semver.version === _.semver.version && this.operator.includes("=") && _.operator.includes("=") || o(this.semver, "<", _.semver, $) && this.operator.startsWith(">") && _.operator.startsWith("<") || o(this.semver, ">", _.semver, $) && this.operator.startsWith("<") && _.operator.startsWith(">")));
2858
- }
2859
- }
2860
- tt = e;
2861
- const t = bt, { safeRe: n, t: s } = Pe, o = Ar, i = Ke, h = te, p = le();
2862
- return tt;
2863
- }
2864
- const Fa = le(), ja = (r, e, t) => {
2865
- try {
2866
- e = new Fa(e, t);
2867
- } catch {
2868
- return !1;
2869
- }
2870
- return e.test(r);
2871
- };
2872
- var Ye = ja;
2873
- const Da = le(), Ua = (r, e) => new Da(r, e).set.map((t) => t.map((n) => n.value).join(" ").trim().split(" "));
2874
- var Ga = Ua;
2875
- const Ba = te, Ka = le(), Ha = (r, e, t) => {
2876
- let n = null, s = null, o = null;
2877
- try {
2878
- o = new Ka(e, t);
2879
- } catch {
2880
- return null;
2881
- }
2882
- return r.forEach((i) => {
2883
- o.test(i) && (!n || s.compare(i) === -1) && (n = i, s = new Ba(n, t));
2884
- }), n;
2885
- };
2886
- var qa = Ha;
2887
- const Ya = te, za = le(), Xa = (r, e, t) => {
2888
- let n = null, s = null, o = null;
2889
- try {
2890
- o = new za(e, t);
2891
- } catch {
2892
- return null;
2893
- }
2894
- return r.forEach((i) => {
2895
- o.test(i) && (!n || s.compare(i) === 1) && (n = i, s = new Ya(n, t));
2896
- }), n;
2897
- };
2898
- var Wa = Xa;
2899
- const rt = te, Ja = le(), Wt = He, Za = (r, e) => {
2900
- r = new Ja(r, e);
2901
- let t = new rt("0.0.0");
2902
- if (r.test(t) || (t = new rt("0.0.0-0"), r.test(t)))
2903
- return t;
2904
- t = null;
2905
- for (let n = 0; n < r.set.length; ++n) {
2906
- const s = r.set[n];
2907
- let o = null;
2908
- s.forEach((i) => {
2909
- const h = new rt(i.semver.version);
2910
- switch (i.operator) {
2911
- case ">":
2912
- h.prerelease.length === 0 ? h.patch++ : h.prerelease.push(0), h.raw = h.format();
2913
- case "":
2914
- case ">=":
2915
- (!o || Wt(h, o)) && (o = h);
2916
- break;
2917
- case "<":
2918
- case "<=":
2919
- break;
2920
- default:
2921
- throw new Error(`Unexpected operation: ${i.operator}`);
2922
- }
2923
- }), o && (!t || Wt(t, o)) && (t = o);
2924
- }
2925
- return t && r.test(t) ? t : null;
2926
- };
2927
- var Qa = Za;
2928
- const eo = le(), to = (r, e) => {
2929
- try {
2930
- return new eo(r, e).range || "*";
2931
- } catch {
2932
- return null;
2933
- }
2934
- };
2935
- var ro = to;
2936
- const no = te, Sr = qe(), { ANY: so } = Sr, ao = le(), oo = Ye, Jt = He, Zt = $t, io = Et, lo = _t, uo = (r, e, t, n) => {
2937
- r = new no(r, n), e = new ao(e, n);
2938
- let s, o, i, h, p;
2939
- switch (t) {
2940
- case ">":
2941
- s = Jt, o = io, i = Zt, h = ">", p = ">=";
2942
- break;
2943
- case "<":
2944
- s = Zt, o = lo, i = Jt, h = "<", p = "<=";
2945
- break;
2946
- default:
2947
- throw new TypeError('Must provide a hilo val of "<" or ">"');
2948
- }
2949
- if (oo(r, e, n))
2950
- return !1;
2951
- for (let d = 0; d < e.set.length; ++d) {
2952
- const _ = e.set[d];
2953
- let $ = null, y = null;
2954
- if (_.forEach((w) => {
2955
- w.semver === so && (w = new Sr(">=0.0.0")), $ = $ || w, y = y || w, s(w.semver, $.semver, n) ? $ = w : i(w.semver, y.semver, n) && (y = w);
2956
- }), $.operator === h || $.operator === p || (!y.operator || y.operator === h) && o(r, y.semver))
2957
- return !1;
2958
- if (y.operator === p && i(r, y.semver))
2959
- return !1;
2960
- }
2961
- return !0;
2962
- };
2963
- var wt = uo;
2964
- const co = wt, fo = (r, e, t) => co(r, e, ">", t);
2965
- var mo = fo;
2966
- const po = wt, ho = (r, e, t) => po(r, e, "<", t);
2967
- var vo = ho;
2968
- const Qt = le(), go = (r, e, t) => (r = new Qt(r, t), e = new Qt(e, t), r.intersects(e, t));
2969
- var bo = go;
2970
- const yo = Ye, $o = ie;
2971
- var _o = (r, e, t) => {
2972
- const n = [];
2973
- let s = null, o = null;
2974
- const i = r.sort((_, $) => $o(_, $, t));
2975
- for (const _ of i)
2976
- yo(_, e, t) ? (o = _, s || (s = _)) : (o && n.push([s, o]), o = null, s = null);
2977
- s && n.push([s, null]);
2978
- const h = [];
2979
- for (const [_, $] of n)
2980
- _ === $ ? h.push(_) : !$ && _ === i[0] ? h.push("*") : $ ? _ === i[0] ? h.push(`<=${$}`) : h.push(`${_} - ${$}`) : h.push(`>=${_}`);
2981
- const p = h.join(" || "), d = typeof e.raw == "string" ? e.raw : String(e);
2982
- return p.length < d.length ? p : e;
2983
- };
2984
- const er = le(), Rt = qe(), { ANY: nt } = Rt, Se = Ye, It = ie, Eo = (r, e, t = {}) => {
2985
- if (r === e)
2986
- return !0;
2987
- r = new er(r, t), e = new er(e, t);
2988
- let n = !1;
2989
- e:
2990
- for (const s of r.set) {
2991
- for (const o of e.set) {
2992
- const i = Ro(s, o, t);
2993
- if (n = n || i !== null, i)
2994
- continue e;
2995
- }
2996
- if (n)
2997
- return !1;
2998
- }
2999
- return !0;
3000
- }, wo = [new Rt(">=0.0.0-0")], tr = [new Rt(">=0.0.0")], Ro = (r, e, t) => {
3001
- if (r === e)
3002
- return !0;
3003
- if (r.length === 1 && r[0].semver === nt) {
3004
- if (e.length === 1 && e[0].semver === nt)
3005
- return !0;
3006
- t.includePrerelease ? r = wo : r = tr;
3007
- }
3008
- if (e.length === 1 && e[0].semver === nt) {
3009
- if (t.includePrerelease)
3010
- return !0;
3011
- e = tr;
3012
- }
3013
- const n = /* @__PURE__ */ new Set();
3014
- let s, o;
3015
- for (const w of r)
3016
- w.operator === ">" || w.operator === ">=" ? s = rr(s, w, t) : w.operator === "<" || w.operator === "<=" ? o = nr(o, w, t) : n.add(w.semver);
3017
- if (n.size > 1)
3018
- return null;
3019
- let i;
3020
- if (s && o) {
3021
- if (i = It(s.semver, o.semver, t), i > 0)
3022
- return null;
3023
- if (i === 0 && (s.operator !== ">=" || o.operator !== "<="))
3024
- return null;
3025
- }
3026
- for (const w of n) {
3027
- if (s && !Se(w, String(s), t) || o && !Se(w, String(o), t))
3028
- return null;
3029
- for (const E of e)
3030
- if (!Se(w, String(E), t))
3031
- return !1;
3032
- return !0;
3033
- }
3034
- let h, p, d, _, $ = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1, y = s && !t.includePrerelease && s.semver.prerelease.length ? s.semver : !1;
3035
- $ && $.prerelease.length === 1 && o.operator === "<" && $.prerelease[0] === 0 && ($ = !1);
3036
- for (const w of e) {
3037
- if (_ = _ || w.operator === ">" || w.operator === ">=", d = d || w.operator === "<" || w.operator === "<=", s) {
3038
- if (y && w.semver.prerelease && w.semver.prerelease.length && w.semver.major === y.major && w.semver.minor === y.minor && w.semver.patch === y.patch && (y = !1), w.operator === ">" || w.operator === ">=") {
3039
- if (h = rr(s, w, t), h === w && h !== s)
3040
- return !1;
3041
- } else if (s.operator === ">=" && !Se(s.semver, String(w), t))
3042
- return !1;
3043
- }
3044
- if (o) {
3045
- if ($ && w.semver.prerelease && w.semver.prerelease.length && w.semver.major === $.major && w.semver.minor === $.minor && w.semver.patch === $.patch && ($ = !1), w.operator === "<" || w.operator === "<=") {
3046
- if (p = nr(o, w, t), p === w && p !== o)
3047
- return !1;
3048
- } else if (o.operator === "<=" && !Se(o.semver, String(w), t))
3049
- return !1;
3050
- }
3051
- if (!w.operator && (o || s) && i !== 0)
3052
- return !1;
3053
- }
3054
- return !(s && d && !o && i !== 0 || o && _ && !s && i !== 0 || y || $);
3055
- }, rr = (r, e, t) => {
3056
- if (!r)
3057
- return e;
3058
- const n = It(r.semver, e.semver, t);
3059
- return n > 0 ? r : n < 0 || e.operator === ">" && r.operator === ">=" ? e : r;
3060
- }, nr = (r, e, t) => {
3061
- if (!r)
3062
- return e;
3063
- const n = It(r.semver, e.semver, t);
3064
- return n < 0 ? r : n > 0 || e.operator === "<" && r.operator === "<=" ? e : r;
3065
- };
3066
- var Io = Eo;
3067
- const st = Pe, sr = Be, Oo = te, ar = Rr, Ao = Ie, So = Cs, To = Ms, Po = Fs, Lo = Ds, No = Bs, Co = qs, ko = Xs, xo = Zs, Mo = ie, Vo = ra, Fo = aa, jo = yt, Do = ua, Uo = fa, Go = He, Bo = $t, Ko = Ir, Ho = Or, qo = _t, Yo = Et, zo = Ar, Xo = xa, Wo = qe(), Jo = le(), Zo = Ye, Qo = Ga, ei = qa, ti = Wa, ri = Qa, ni = ro, si = wt, ai = mo, oi = vo, ii = bo, li = _o, ui = Io;
3068
- var ci = {
3069
- parse: Ao,
3070
- valid: So,
3071
- clean: To,
3072
- inc: Po,
3073
- diff: Lo,
3074
- major: No,
3075
- minor: Co,
3076
- patch: ko,
3077
- prerelease: xo,
3078
- compare: Mo,
3079
- rcompare: Vo,
3080
- compareLoose: Fo,
3081
- compareBuild: jo,
3082
- sort: Do,
3083
- rsort: Uo,
3084
- gt: Go,
3085
- lt: Bo,
3086
- eq: Ko,
3087
- neq: Ho,
3088
- gte: qo,
3089
- lte: Yo,
3090
- cmp: zo,
3091
- coerce: Xo,
3092
- Comparator: Wo,
3093
- Range: Jo,
3094
- satisfies: Zo,
3095
- toComparators: Qo,
3096
- maxSatisfying: ei,
3097
- minSatisfying: ti,
3098
- minVersion: ri,
3099
- validRange: ni,
3100
- outside: si,
3101
- gtr: ai,
3102
- ltr: oi,
3103
- intersects: ii,
3104
- simplifyRange: li,
3105
- subset: ui,
3106
- SemVer: Oo,
3107
- re: st.re,
3108
- src: st.src,
3109
- tokens: st.t,
3110
- SEMVER_SPEC_VERSION: sr.SEMVER_SPEC_VERSION,
3111
- RELEASE_TYPES: sr.RELEASE_TYPES,
3112
- compareIdentifiers: ar.compareIdentifiers,
3113
- rcompareIdentifiers: ar.rcompareIdentifiers
3114
- };
3115
- const or = /* @__PURE__ */ pt(ci);
3116
- var ft = /* @__PURE__ */ ((r) => (r[r.menuV3 = 0] = "menuV3", r[r.applyEffectOnOrder = 1] = "applyEffectOnOrder", r[r.nestedAddon = 2] = "nestedAddon", r[r.feedmeDelivery = 3] = "feedmeDelivery", r[r.taxAndServiceChargeV4 = 4] = "taxAndServiceChargeV4", r[r.itemCombo = 5] = "itemCombo", r[r.itemTakeaway = 6] = "itemTakeaway", r[r.transferInventory = 7] = "transferInventory", r[r.qrEPayment = 8] = "qrEPayment", r[r.deliveryIntegration = 9] = "deliveryIntegration", r[r.rmsPayment = 10] = "rmsPayment", r[r.queue = 11] = "queue", r[r.paymentVoucher = 12] = "paymentVoucher", r))(ft || {});
3117
- const Tr = {
3118
- 0: "3.0.0-alpha",
3119
- 1: "3.5.0-alpha",
3120
- 2: "4.0.0-alpha",
3121
- 4: "4.0.0-alpha",
3122
- 5: "4.1.0-alpha",
3123
- // TODO: #475 make sure current pos version
3124
- 6: "4.3.10-alpha",
3125
- 7: "4.5.0-alpha",
3126
- 8: "6.9.0-alpha",
3127
- 9: "6.11.0-alpha",
3128
- 3: "6.12.0-alpha",
3129
- 10: "6.21.0-alpha",
3130
- 11: "6.21.0-alpha",
3131
- 12: "6.31.0-alpha"
3132
- };
3133
- function di(r, e) {
3134
- return or.valid(e) && or.gte(e, Tr[r]);
3135
- }
3136
- function fi(r) {
3137
- return Tr[r].replace("-alpha", "");
3138
- }
3139
- function mi({ posVersion: r, payoutAccount: e }) {
3140
- return !!r && di(ft.qrEPayment, r) ? !e || !e.enable ? "Payout account is required" : e.status !== Zr.enum.APPROVED ? "Payout account under review" : !0 : `For POS ${fi(ft.qrEPayment)} or above`;
3141
- }
3142
- function Pr(r) {
3143
- return {
3144
- id: r._id,
3145
- ...r,
3146
- profile: {
3147
- ...r.profile,
3148
- address: Te(r.profile.address)
3149
- },
3150
- allowEPayment: mi(r)
3151
- };
3152
- }
3153
- function at(r) {
3154
- return Pr(ht(r));
3155
- }
3156
- async function ir(r) {
3157
- const e = ht(r), t = [];
3158
- for (const n of e)
3159
- t.push(await Pr(n));
3160
- return t;
3161
- }
3162
- const Ge = {
3163
- async readRestaurant(r) {
3164
- return await at(await Xe().get(`/restaurants/${r}`));
3165
- },
3166
- async readRestaurants() {
3167
- return await ir(await We().get("/restaurants"));
3168
- },
3169
- async readRestaurantsByBusiness() {
3170
- return await ir(await We().get("/restaurant-list"));
3171
- },
3172
- async createRestaurant(r) {
3173
- return await at(await We().post("/restaurants", r));
3174
- },
3175
- async updateRestaurantProfile(r, e) {
3176
- return await at(
3177
- await Xe().put(`/restaurants/${r}/profile`, e)
3178
- );
3179
- },
3180
- async updateRestaurantAttributes(r, e) {
3181
- return ht(await Xe().put(`/restaurants/${r}/attributes`, {
3182
- attributes: e
3183
- }));
3184
- }
3185
- }, ot = {
3186
- async get(r, e) {
3187
- const t = Je(void 0, e), n = Ze(t, r);
3188
- return await (await Kr(n)).text();
3189
- },
3190
- async update(r, e, t) {
3191
- const n = Je(void 0, t), s = Ze(n, r);
3192
- return await Hr(s, e), await qr(s);
3193
- },
3194
- async delete(r, e) {
3195
- const t = Je(void 0, e), n = Ze(t, r);
3196
- await Yr(n);
3197
- }
3198
- }, ve = {
3199
- async get(r) {
3200
- return await ot.get(r);
3201
- },
3202
- async update(r, e, t) {
3203
- return await ot.update(r, e);
3204
- },
3205
- async delete(r) {
3206
- await ot.delete(r);
3207
- }
3208
- };
3209
- class pi {
3210
- constructor(e, t) {
3211
- ze(this, "restaurant");
3212
- ze(this, "data");
3213
- this.restaurant = e, this.data = t;
3214
- }
3215
- generateUrl(e) {
3216
- const t = e === "normal" ? gt().toISOString() : "photo";
3217
- return `restaurant/${this.restaurant.id}/${e}/${t}`;
3218
- }
3219
- async manageThumbnail() {
3220
- const { newThumbnailPhoto: e, thumbnailPhoto: t } = this.data;
3221
- if (e) {
3222
- const s = await ve.update(this.generateUrl("thumbnail"), e, {
3223
- includedTime: !0
3224
- });
3225
- this.data.thumbnailPhoto = s;
3226
- return;
3227
- }
3228
- const n = this.restaurant.profile.thumbnailPhoto;
3229
- n && !t && (await ve.delete(n), this.data.thumbnailPhoto = void 0);
3230
- }
3231
- async manageCover() {
3232
- const { newCoverPhoto: e, coverPhoto: t } = this.data;
3233
- if (e) {
3234
- const s = await ve.update(this.generateUrl("cover"), e, {
3235
- includedTime: !0
3236
- });
3237
- this.data.coverPhoto = s;
3238
- return;
3239
- }
3240
- const n = this.restaurant.profile.coverPhoto;
3241
- n && !t && (await ve.delete(n), this.data.coverPhoto = void 0);
3242
- }
3243
- async manageCarousels() {
3244
- const e = this.data.newPhotos || [];
3245
- for (const t of e) {
3246
- const n = await ve.update(this.generateUrl("normal"), t);
3247
- this.data.photos = [...this.data.photos || [], n];
3248
- }
3249
- }
3250
- async run() {
3251
- return await this.manageThumbnail(), await this.manageCover(), await this.manageCarousels(), this.data;
3252
- }
3253
- }
3254
- async function lr(r, e) {
3255
- const t = new pi(r, e);
3256
- await t.run(), await Ge.updateRestaurantProfile(r.id, t.data), await ge().readRestaurants();
3257
- }
3258
- const hi = () => {
3259
- const r = ge();
3260
- return {
3261
- async createRestaurant(e, t, n) {
3262
- const s = await Ge.createRestaurant({
3263
- businessId: e,
3264
- features: [],
3265
- profile: t
3266
- });
3267
- n && await Ge.updateRestaurantAttributes(s.id, n), await lr(s, t), await r.readRestaurants();
3268
- },
3269
- async updateRestaurantProfile(e, t) {
3270
- await lr(e, t);
3271
- }
3272
- };
3273
- }, vi = { class: "flex justify-center" }, gi = { class: "space-y-24" }, bi = { class: "space-y-24" }, yi = { class: "flex gap-16 xs:flex-col xs:gap-24" }, $i = { class: "flex-1" }, _i = { class: "flex-1" }, Ei = { class: "space-y-24" }, wi = { class: "space-y-24" }, Ri = { class: "space-y-8" }, Ii = { class: "space-y-24" }, ur = /* @__PURE__ */ ee({
3274
- __name: "RestaurantForm",
3275
- props: {
3276
- restaurantId: {
3277
- type: String,
3278
- default: void 0
3279
- },
3280
- restaurant: {
3281
- type: Object
3282
- },
3283
- initialValue: {
3284
- type: Object,
3285
- default: void 0
3286
- },
3287
- enableFeedmeExpress: {
3288
- type: Boolean,
3289
- required: !0
3290
- }
3291
- },
3292
- setup(r, { expose: e }) {
3293
- var m;
3294
- const t = r, { restaurants: n, currentBusiness: s, restaurantAttributeSettings: o } = ge(), i = vt(), h = dr(i), { copyTextToClipboard: p } = vr(), d = ae(!1), _ = (v, c) => {
3295
- d.value = !d.value;
3296
- }, $ = W(() => {
3297
- var v;
3298
- return (v = t.restaurant) == null ? void 0 : v.profile;
3299
- }), y = mt(
3300
- $.value ? we($.value) : {
3301
- ...kt(),
3302
- address: Te(kt().address),
3303
- legalName: "",
3304
- sstRegNo: "",
3305
- description: "",
3306
- url: "",
3307
- thumbnailPhoto: void 0,
3308
- coverPhoto: void 0,
3309
- newThumbnailPhoto: void 0,
3310
- newCoverPhoto: void 0,
3311
- newPhotos: [],
3312
- operatingHours: {
3313
- 0: {
3314
- enable: !1,
3315
- hours: []
3316
- },
3317
- 1: {
3318
- enable: !1,
3319
- hours: []
3320
- },
3321
- 2: {
3322
- enable: !1,
3323
- hours: []
3324
- },
3325
- 3: {
3326
- enable: !1,
3327
- hours: []
3328
- },
3329
- 4: {
3330
- enable: !1,
3331
- hours: []
3332
- },
3333
- 5: {
3334
- enable: !1,
3335
- hours: []
3336
- },
3337
- 6: {
3338
- enable: !1,
3339
- hours: []
3340
- }
3341
- }
3342
- }
3343
- ), w = "https://feedmedev.cc/", E = W(() => ge().currentCountry.value), { t: R } = ye(), M = ae(
3344
- t.restaurantId ? R("settings.business.restaurant.form.title.update") : R("settings.business.restaurant.form.title.add")
3345
- ), k = ae(((m = t.restaurant) == null ? void 0 : m.customAttributes) || {});
3346
- async function F(v) {
3347
- Object.values(k.value).length !== 0 && await Ge.updateRestaurantAttributes(v, k.value);
3348
- }
3349
- const T = W(() => Te(y.address)), U = W(() => T.value.formatted);
3350
- function X(v) {
3351
- var c;
3352
- if (typeof v == "string") {
3353
- const b = (c = n.value.find((I) => I._id === v)) == null ? void 0 : c.profile.operatingHours;
3354
- b ? y.operatingHours = we(b) : i.open({
3355
- title: R("settings.business.restaurant.form.sections.operation_hours.invalid"),
3356
- type: "error"
3357
- });
3358
- }
3359
- }
3360
- function Y() {
3361
- const v = w + (y.url || t.restaurantId);
3362
- p(v);
3363
- }
3364
- function G() {
3365
- y.thumbnailPhoto = void 0, y.newThumbnailPhoto = void 0;
3366
- }
3367
- function z() {
3368
- y.coverPhoto = void 0, y.newCoverPhoto = void 0;
3369
- }
3370
- function a(v) {
3371
- y.newPhotos = y.newPhotos || [], y.newPhotos.push(v);
3372
- }
3373
- const l = hi();
3374
- function g() {
3375
- var v, c;
3376
- if (_(), t.restaurantId) {
3377
- if (!((v = s.value) != null && v.id))
3378
- return;
3379
- h.minor(async () => {
3380
- var b, I;
3381
- t.restaurant && (await F(t.restaurantId), await l.updateRestaurantProfile(t.restaurant, {
3382
- ...y,
3383
- url: ((b = y.url) == null ? void 0 : b.trim()) || null,
3384
- code: ((I = y.code) == null ? void 0 : I.trim()) || null
3385
- }), R("settings.business.restaurant.form.message.updated"));
3386
- });
3387
- } else {
3388
- if (!((c = s.value) != null && c.id))
3389
- return;
3390
- h.minor(async () => {
3391
- var b, I;
3392
- await l.createRestaurant(
3393
- s.value.id,
3394
- {
3395
- ...y,
3396
- url: ((b = y.url) == null ? void 0 : b.trim()) || null,
3397
- code: ((I = y.code) == null ? void 0 : I.trim()) || null
3398
- },
3399
- k.value
3400
- ), R("settings.business.restaurant.form.message.created");
3401
- });
3402
- }
3403
- }
3404
- const A = W(() => ({
3405
- title: R("settings.business.restaurant.form.summary.title"),
3406
- items: [
3407
- {
3408
- name: R("settings.business.restaurant.form.summary.name"),
3409
- value: y.name
3410
- },
3411
- {
3412
- name: R("settings.business.restaurant.form.summary.legal_name"),
3413
- value: y.legalName
3414
- },
3415
- {
3416
- name: R("settings.business.restaurant.form.summary.contact"),
3417
- value: y.phoneNo
3418
- },
3419
- {
3420
- name: R("settings.business.restaurant.form.summary.address"),
3421
- value: U.value
3422
- }
3423
- ]
3424
- })), { isAtMost: L } = pr();
3425
- W(() => L("sm"));
3426
- const f = ae(null), u = zr(f);
3427
- return e({ trigger: _ }), (v, c) => {
3428
- const b = q("FmTextField"), I = q("FmPhoneNumber"), x = q("FmTextarea"), N = q("FmButton");
3429
- return D(), K(oe, null, [
3430
- me(v.$slots, "trigger", Fr(jr({
3431
- trigger: _
3432
- }))),
3433
- C(Pn, {
3434
- title: M.value,
3435
- show: d.value,
3436
- "primary-action": { label: S(R)("common.save") },
3437
- "secondary-actions": [
3438
- { label: S(R)("settings.business.restaurant.actions.discard"), click: () => d.value = !1 }
3439
- ],
3440
- onOnPrimary: g,
3441
- onOnCancel: c[17] || (c[17] = (P) => d.value = !1)
3442
- }, {
3443
- "append-title": H(() => [
3444
- S(L)("sm") ? (D(), Q(Ft, {
3445
- key: 0,
3446
- variant: "dialog",
3447
- title: A.value.title,
3448
- items: A.value.items
3449
- }, null, 8, ["title", "items"])) : fe("", !0)
3450
- ]),
3451
- default: H(() => [
3452
- O("div", vi, [
3453
- O("div", {
3454
- ref_key: "formWrapper",
3455
- ref: f,
3456
- class: "py-24 pr-[400px] w-[1150px] xs:pr-0 sm:pr-0 xs:w-full"
3457
- }, [
3458
- S(L)("sm") ? fe("", !0) : (D(), Q(Ft, {
3459
- key: 0,
3460
- class: "fixed",
3461
- style: Fe({
3462
- top: "85px",
3463
- left: S(u).right - 400 + "px"
3464
- }),
3465
- variant: "full",
3466
- title: A.value.title,
3467
- items: A.value.items
3468
- }, null, 8, ["style", "title", "items"])),
3469
- O("div", gi, [
3470
- C(Ae, {
3471
- title: S(R)("settings.business.restaurant.form.sections.basic_info.title")
3472
- }, {
3473
- default: H(() => {
3474
- var P, j;
3475
- return [
3476
- O("div", bi, [
3477
- O("div", null, [
3478
- C(b, {
3479
- label: S(R)("settings.business.restaurant.form.sections.basic_info.code.label"),
3480
- modelValue: y.code,
3481
- "onUpdate:modelValue": c[0] || (c[0] = (V) => y.code = V),
3482
- "label-mark": "optional",
3483
- "helper-text": S(R)("settings.business.restaurant.form.sections.basic_info.code.helper"),
3484
- disabled: ((P = $.value) == null ? void 0 : P.code) !== void 0 && ((j = $.value) == null ? void 0 : j.code) !== null
3485
- }, null, 8, ["label", "modelValue", "helper-text", "disabled"])
3486
- ]),
3487
- O("div", null, [
3488
- C(b, {
3489
- label: S(R)("settings.business.restaurant.form.sections.basic_info.name.label"),
3490
- modelValue: y.name,
3491
- "onUpdate:modelValue": c[1] || (c[1] = (V) => y.name = V),
3492
- "label-mark": "required",
3493
- rules: [S(he)]
3494
- }, null, 8, ["label", "modelValue", "rules"])
3495
- ]),
3496
- O("div", null, [
3497
- C(b, {
3498
- label: S(R)("settings.business.restaurant.form.sections.basic_info.legal_name.label"),
3499
- modelValue: y.legalName,
3500
- "onUpdate:modelValue": c[2] || (c[2] = (V) => y.legalName = V),
3501
- "label-mark": "required",
3502
- rules: [S(he)]
3503
- }, null, 8, ["label", "modelValue", "rules"])
3504
- ]),
3505
- O("div", null, [
3506
- C(b, {
3507
- label: S(R)("settings.business.restaurant.form.sections.basic_info.reg_no.label"),
3508
- modelValue: y.regNo,
3509
- "onUpdate:modelValue": c[3] || (c[3] = (V) => y.regNo = V),
3510
- "label-mark": "required",
3511
- rules: [S(he)]
3512
- }, null, 8, ["label", "modelValue", "rules"])
3513
- ]),
3514
- O("div", null, [
3515
- C(b, {
3516
- modelValue: y.sstRegNo,
3517
- "onUpdate:modelValue": c[4] || (c[4] = (V) => y.sstRegNo = V),
3518
- label: S(R)("settings.business.restaurant.form.sections.basic_info.tax_no.label"),
3519
- "label-mark": "optional"
3520
- }, null, 8, ["modelValue", "label"])
3521
- ]),
3522
- O("div", yi, [
3523
- O("div", $i, [
3524
- C(I, {
3525
- class: "w-full",
3526
- label: S(R)("settings.business.restaurant.form.sections.basic_info.contact.label"),
3527
- modelValue: y.phoneNo,
3528
- "onUpdate:modelValue": c[5] || (c[5] = (V) => y.phoneNo = V),
3529
- "label-mark": "optional"
3530
- }, null, 8, ["label", "modelValue"])
3531
- ]),
3532
- O("div", _i, [
3533
- C(b, {
3534
- class: "w-full",
3535
- modelValue: y.email,
3536
- "onUpdate:modelValue": c[6] || (c[6] = (V) => y.email = V),
3537
- label: S(R)("settings.business.restaurant.form.sections.basic_info.email.label"),
3538
- "label-mark": "optional"
3539
- }, null, 8, ["modelValue", "label"])
3540
- ])
3541
- ]),
3542
- O("div", null, [
3543
- C(Ee, {
3544
- label: S(R)("settings.business.restaurant.form.sections.basic_info.image.label"),
3545
- "sub-label": S(R)("settings.business.restaurant.form.sections.basic_info.image.optional"),
3546
- "previous-url": y.thumbnailPhoto,
3547
- modelValue: y.newThumbnailPhoto,
3548
- "onUpdate:modelValue": c[7] || (c[7] = (V) => y.newThumbnailPhoto = V),
3549
- "onReset:modelValue": G
3550
- }, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
3551
- ])
3552
- ])
3553
- ];
3554
- }),
3555
- _: 1
3556
- }, 8, ["title"]),
3557
- S(o).length > 0 ? (D(), K(oe, { key: 0 }, [
3558
- c[18] || (c[18] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3559
- C(Ae, {
3560
- title: S(R)("settings.restaurantTagging.title"),
3561
- "sub-title": S(R)("settings.restaurantTagging.subtitle")
3562
- }, {
3563
- default: H(() => [
3564
- C(S(Qr), {
3565
- entity: "restaurant",
3566
- modelValue: k.value,
3567
- "onUpdate:modelValue": c[8] || (c[8] = (P) => k.value = P)
3568
- }, null, 8, ["modelValue"])
3569
- ]),
3570
- _: 1
3571
- }, 8, ["title", "sub-title"])
3572
- ], 64)) : fe("", !0),
3573
- c[19] || (c[19] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3574
- C(Ae, {
3575
- title: S(R)("settings.business.restaurant.form.sections.address.title")
3576
- }, {
3577
- default: H(() => [
3578
- O("div", Ei, [
3579
- C(as, {
3580
- modelValue: y.address,
3581
- "onUpdate:modelValue": c[9] || (c[9] = (P) => y.address = P)
3582
- }, null, 8, ["modelValue"]),
3583
- C(fs, {
3584
- address: T.value,
3585
- modelValue: y.address.coordinates,
3586
- "onUpdate:modelValue": c[10] || (c[10] = (P) => y.address.coordinates = P)
3587
- }, null, 8, ["address", "modelValue"])
3588
- ])
3589
- ]),
3590
- _: 1
3591
- }, 8, ["title"]),
3592
- c[20] || (c[20] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3593
- C(Ae, {
3594
- title: S(R)("settings.business.restaurant.form.sections.operation_hours.title")
3595
- }, {
3596
- default: H(() => [
3597
- O("div", wi, [
3598
- O("div", Ri, [
3599
- C(Mt, {
3600
- label: S(R)("settings.business.restaurant.form.sections.operation_hours.copy_with"),
3601
- optional: !1
3602
- }, null, 8, ["label"]),
3603
- C(rn, {
3604
- class: "w-[320px]",
3605
- "exclude-restaurants": [r.restaurantId ?? ""],
3606
- "model-value": "",
3607
- "onUpdate:modelValue": c[11] || (c[11] = (P) => X(P))
3608
- }, null, 8, ["exclude-restaurants"]),
3609
- C(gs, {
3610
- modelValue: y.operatingHours,
3611
- "onUpdate:modelValue": c[12] || (c[12] = (P) => y.operatingHours = P)
3612
- }, null, 8, ["modelValue"])
3613
- ])
3614
- ])
3615
- ]),
3616
- _: 1
3617
- }, 8, ["title"]),
3618
- c[21] || (c[21] = O("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3619
- C(Ae, {
3620
- title: S(R)("settings.business.restaurant.form.sections.branding.title")
3621
- }, {
3622
- default: H(() => [
3623
- O("div", Ii, [
3624
- C(x, {
3625
- label: S(R)("settings.business.restaurant.form.sections.branding.description"),
3626
- "model-value": y.description ?? "",
3627
- "onUpdate:modelValue": c[13] || (c[13] = (P) => y.description = P)
3628
- }, null, 8, ["label", "model-value"]),
3629
- C(b, {
3630
- label: S(R)("settings.business.restaurant.form.sections.branding.url.label"),
3631
- placeholder: r.restaurantId,
3632
- "model-value": y.url,
3633
- "onUpdate:modelValue": c[14] || (c[14] = (P) => y.url = P),
3634
- rules: [
3635
- (P) => {
3636
- var j;
3637
- return !P || ((j = $.value) == null ? void 0 : j.url) == y.url || E.value == S(fr).enum.MY || S(R)("settings.business.restaurant.form.sections.branding.url.errors.disabled");
3638
- },
3639
- (P) => !P || S($r).test(P) || S(R)("settings.business.restaurant.form.sections.branding.url.errors.invalid"),
3640
- (P) => !P || !S(_r).includes(P) || S(R)("settings.business.restaurant.form.sections.branding.url.errors.reserved")
3641
- ]
3642
- }, {
3643
- prepend: H(() => [
3644
- O("span", null, B(w))
3645
- ]),
3646
- append: H(() => [
3647
- C(N, {
3648
- variant: "tertiary",
3649
- icon: "file_copy",
3650
- "text-color": "neutral-gray-400",
3651
- onClick: Y
3652
- })
3653
- ]),
3654
- _: 1
3655
- }, 8, ["label", "placeholder", "model-value", "rules"]),
3656
- O("div", null, [
3657
- C(Ee, {
3658
- label: S(R)("settings.business.form.cover_photo.label"),
3659
- "previous-url": y.coverPhoto,
3660
- modelValue: y.newCoverPhoto,
3661
- "onUpdate:modelValue": c[15] || (c[15] = (P) => y.newCoverPhoto = P),
3662
- "onReset:modelValue": z
3663
- }, null, 8, ["label", "previous-url", "modelValue"])
3664
- ]),
3665
- O("div", null, [
3666
- C(Mt, {
3667
- label: S(R)("settings.business.restaurant.form.sections.branding.carousel_photos.label")
3668
- }, null, 8, ["label"]),
3669
- (D(!0), K(oe, null, be(y.photos || [], (P, j) => (D(), Q(Ee, {
3670
- key: j,
3671
- "previous-url": P,
3672
- "model-value": void 0,
3673
- "onReset:modelValue": (V) => {
3674
- var J;
3675
- return (J = y.photos) == null ? void 0 : J.splice(j, 1);
3676
- }
3677
- }, null, 8, ["previous-url", "onReset:modelValue"]))), 128)),
3678
- (D(!0), K(oe, null, be(y.newPhotos || [], (P, j) => {
3679
- var V;
3680
- return D(), Q(Ee, {
3681
- key: j,
3682
- "model-value": ((V = y.newPhotos) == null ? void 0 : V[j]) || void 0,
3683
- "previous-url": void 0,
3684
- "onReset:modelValue": (J) => {
3685
- var ne;
3686
- return (ne = y.photos) == null ? void 0 : ne.splice(j, 1);
3687
- }
3688
- }, null, 8, ["model-value", "onReset:modelValue"]);
3689
- }), 128)),
3690
- C(Ee, {
3691
- "model-value": void 0,
3692
- "previous-url": void 0,
3693
- "onUpdate:modelValue": c[16] || (c[16] = (P) => a(P))
3694
- })
3695
- ])
3696
- ])
3697
- ]),
3698
- _: 1
3699
- }, 8, ["title"])
3700
- ])
3701
- ], 512)
3702
- ])
3703
- ]),
3704
- _: 1
3705
- }, 8, ["title", "show", "primary-action", "secondary-actions"])
3706
- ], 64);
3707
- };
3708
- }
3709
- }), Oi = { class: "fm-typo-en-title-md-600" }, Ai = { class: "pt-8 space-y-24" }, Si = { class: "flex gap-8 items-center justify-start" }, Ti = /* @__PURE__ */ ee({
3710
- __name: "BusinessForm",
3711
- props: {
3712
- businessId: {
3713
- type: String,
3714
- required: !0
3715
- },
3716
- initialValue: {
3717
- type: Object,
3718
- default: void 0
3719
- }
3720
- },
3721
- setup(r, { expose: e }) {
3722
- const t = r, n = vt(), s = dr(n), o = "https://feedmedev.cc", i = mt(
3723
- t.initialValue ? we(t.initialValue) : {
3724
- thumbnail: void 0,
3725
- name: "",
3726
- url: void 0,
3727
- newThumbnail: void 0
3728
- }
3729
- );
3730
- W(() => i.newThumbnail ? URL.createObjectURL(i.newThumbnail) : i.thumbnail);
3731
- const h = W(() => ge().currentCountry.value), p = ae(!1), d = ae(!1), _ = (E) => {
3732
- d.value = !d.value;
3733
- };
3734
- function $() {
3735
- i.thumbnail = void 0, i.newThumbnail = void 0;
3736
- }
3737
- const y = async () => {
3738
- const E = i;
3739
- await s.minor(async () => {
3740
- var k, F, T;
3741
- if (E.newThumbnail) {
3742
- const U = await ve.update(
3743
- `business/${t.businessId}/thumbnail/${gt().toISOString()}.png`,
3744
- E.newThumbnail
3745
- );
3746
- E.thumbnail = U, (k = t.initialValue) != null && k.thumbnail && await ve.delete(t.initialValue.thumbnail);
3747
- } else
3748
- (F = t.initialValue) != null && F.thumbnail && !E.thumbnail && await ve.delete((T = t.initialValue) == null ? void 0 : T.thumbnail);
3749
- const R = await Xr.updateBusinessProfile(t.businessId, E), M = ge().currentBusiness;
3750
- M.value = { ...M.value, ...R }, _();
3751
- });
3752
- };
3753
- e({
3754
- show: d,
3755
- trigger: _
3756
- });
3757
- const { t: w } = ye();
3758
- return (E, R) => {
3759
- const M = q("FmTextField"), k = q("fm-button"), F = q("fm-side-sheet");
3760
- return D(), K(oe, null, [
3761
- me(E.$slots, "default", { trigger: _ }),
3762
- C(F, {
3763
- id: "unit-form",
3764
- modelValue: d.value,
3765
- "onUpdate:modelValue": R[4] || (R[4] = (T) => d.value = T),
3766
- "is-container": S(tn).FmForm,
3767
- "is-container-props": {
3768
- onValidationSuccess: y,
3769
- blameFormChildOnValidationFailed: !0
3770
- },
3771
- "max-width": 560,
3772
- "z-index": 100
3773
- }, {
3774
- "side-sheet-header": H(() => [
3775
- O("p", Oi, B(S(w)("settings.business.form.title")), 1)
3776
- ]),
3777
- "side-sheet-footer": H(() => [
3778
- O("div", Si, [
3779
- C(k, {
3780
- label: S(w)("common.update"),
3781
- loading: p.value,
3782
- size: "lg",
3783
- type: "submit",
3784
- variant: "primary"
3785
- }, null, 8, ["label", "loading"]),
3786
- C(k, {
3787
- label: S(w)("common.cancel"),
3788
- size: "lg",
3789
- variant: "tertiary",
3790
- onClick: R[3] || (R[3] = () => d.value = !1)
3791
- }, null, 8, ["label"])
3792
- ])
3793
- ]),
3794
- default: H(() => [
3795
- O("div", Ai, [
3796
- O("div", null, [
3797
- C(Ee, {
3798
- label: S(w)("settings.business.form.cover_photo.label"),
3799
- "sub-label": S(w)("settings.business.form.cover_photo.optional"),
3800
- "previous-url": i.thumbnail,
3801
- modelValue: i.newThumbnail,
3802
- "onUpdate:modelValue": R[0] || (R[0] = (T) => i.newThumbnail = T),
3803
- "onReset:modelValue": $
3804
- }, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
3805
- ]),
3806
- O("div", null, [
3807
- C(M, {
3808
- label: S(w)("settings.business.form.name"),
3809
- modelValue: i.name,
3810
- "onUpdate:modelValue": R[1] || (R[1] = (T) => i.name = T)
3811
- }, null, 8, ["label", "modelValue"])
3812
- ]),
3813
- O("div", null, [
3814
- C(M, {
3815
- label: S(w)("settings.business.form.url.label"),
3816
- "model-value": i.url || "",
3817
- "onUpdate:modelValue": R[2] || (R[2] = (T) => i.url = T),
3818
- placeholder: r.businessId,
3819
- rules: [
3820
- (T) => {
3821
- var U;
3822
- return !T || ((U = r.initialValue) == null ? void 0 : U.url) == i.url || h.value == S(fr).enum.MY || S(w)("settings.business.form.url.errors.disabled");
3823
- },
3824
- (T) => !T || S($r).test(T) || S(w)("settings.business.form.url.errors.format"),
3825
- (T) => !T || !S(_r).includes(T) || S(w)("settings.business.form.url.errors.reserved")
3826
- ]
3827
- }, {
3828
- prepend: H(() => [
3829
- O("span", null, B(S(o) + "/"), 1)
3830
- ]),
3831
- _: 1
3832
- }, 8, ["label", "model-value", "placeholder", "rules"])
3833
- ])
3834
- ])
3835
- ]),
3836
- _: 1
3837
- }, 8, ["modelValue", "is-container", "is-container-props"])
3838
- ], 64);
3839
- };
3840
- }
3841
- }), Pi = /* @__PURE__ */ ee({
3842
- __name: "BottomSheetMenu",
3843
- setup(r) {
3844
- const e = ae(!1);
3845
- async function t() {
3846
- await Dr(), e.value = !e.value;
3847
- }
3848
- return (n, s) => {
3849
- const o = q("FmButton"), i = q("FmBottomSheet");
3850
- return D(), Q(i, {
3851
- modelValue: e.value,
3852
- "onUpdate:modelValue": s[1] || (s[1] = (h) => e.value = h),
3853
- "dismiss-away": "",
3854
- "no-header": "",
3855
- "z-index": 110
3856
- }, {
3857
- "bottom-sheet-button": H(() => [
3858
- n.$slots.button ? fe("", !0) : (D(), Q(o, {
3859
- key: 0,
3860
- icon: "more_vert",
3861
- variant: "tertiary",
3862
- onClick: it(t, ["stop"])
3863
- })),
3864
- me(n.$slots, "button")
3865
- ]),
3866
- default: H(() => [
3867
- O("div", {
3868
- onClick: s[0] || (s[0] = (h) => e.value = !1)
3869
- }, [
3870
- me(n.$slots, "default")
3871
- ])
3872
- ]),
3873
- _: 3
3874
- }, 8, ["modelValue"]);
3875
- };
3876
- }
3877
- }), Li = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, Ni = /* @__PURE__ */ ee({
3878
- __name: "BottomSheetMenuItem",
3879
- props: {
3880
- label: {},
3881
- icon: {},
3882
- disabled: { type: Boolean },
3883
- itemClass: {}
3884
- },
3885
- setup(r) {
3886
- const e = r;
3887
- return (t, n) => {
3888
- const s = q("FmIcon");
3889
- return D(), K("div", Li, [
3890
- t.$slots.content ? fe("", !0) : (D(), K("div", {
3891
- key: 0,
3892
- class: Z(["flex items-center", {
3893
- "text-fm-color-typo-disabled": e.disabled,
3894
- "cursor-pointer": !e.disabled,
3895
- "cursor-not-allowed": e.disabled,
3896
- [e.itemClass || ""]: e.itemClass && !e.disabled
3897
- }])
3898
- }, [
3899
- t.icon ? (D(), Q(s, {
3900
- key: 0,
3901
- name: t.icon
3902
- }, null, 8, ["name"])) : fe("", !0),
3903
- je(" " + B(t.label), 1)
3904
- ], 2)),
3905
- me(t.$slots, "content")
3906
- ]);
3907
- };
3908
- }
3909
- }), Ci = { class: "fm-typo-cn-body-md-400 text-fm-color-typo-secondary xs:flex xs:flex-col" }, ki = { class: "flex flex-1" }, xi = {
3910
- key: 0,
3911
- class: "flex gap-8"
3912
- }, Mi = {
3913
- key: 0,
3914
- class: "space-y-4"
3915
- }, Vi = { class: "fm-typo-en-body-md-600" }, Fi = {
3916
- key: 0,
3917
- class: "space-y-8"
3918
- }, ji = { class: "flex justify-end" }, Di = { class: "flex-1 pb-64 overflow-auto divide-y divide-fm-color-neutral-gray-100" }, Ui = { key: 0 }, Gi = ["onClick"], Bi = { class: "flex justify-between items-center" }, Ki = { class: "fm-typo-en-body-lg-600" }, Hi = { class: "flex gap-8" }, qi = { class: "text-fm-color-typo-secondary" }, Yi = { class: "text-fm-color-typo-secondary" }, zi = { class: "text-fm-color-typo-secondary" }, ul = /* @__PURE__ */ ee({
3919
- __name: "Business",
3920
- setup(r) {
3921
- const { searchKey: e, filter: t } = In(), { copyTextToClipboard: n } = vr(), s = pr(), o = W(() => s.breakpoints.value.xs), { t: i } = ye(), h = W(() => {
3922
- const { currentBusiness: E, restaurants: R } = ge(), M = E.value;
3923
- if (!M)
3924
- return null;
3925
- const { id: k, name: F, thumbnail: T, url: U } = M, X = R.value.filter((G) => G.managable).map((G) => {
3926
- var u;
3927
- const { _id: z, profile: a } = G, { name: l, email: g, phoneNo: A, address: L, sstRegNo: f } = {
3928
- ...a,
3929
- address: Te(a.address)
3930
- };
3931
- return {
3932
- id: z,
3933
- code: ((u = G.profile) == null ? void 0 : u.code) || "--",
3934
- name: l,
3935
- email: g,
3936
- phone: A,
3937
- address: L.formatted,
3938
- withSST: !!f,
3939
- doc: G
3940
- };
3941
- });
3942
- return {
3943
- id: k,
3944
- name: F,
3945
- thumbnail: T,
3946
- url: `https://feedmedev.cc/${U || k}`,
3947
- doc: M,
3948
- canCreateRestaurant: Rn(M, R.value),
3949
- restaurants: X.filter(
3950
- ({ code: G, name: z, address: a, phone: l, email: g }) => t([G, z, a, l, g])
3951
- )
3952
- };
3953
- }), p = W(() => [
3954
- {
3955
- header: i("settings.business.restaurant.code"),
3956
- accessorKey: "code",
3957
- enableSorting: !1
3958
- },
3959
- {
3960
- header: i("settings.business.restaurant.title"),
3961
- accessorKey: "name",
3962
- enableSorting: !1
3963
- },
3964
- {
3965
- header: i("settings.business.restaurant.address"),
3966
- accessorKey: "address",
3967
- size: 200,
3968
- enableSorting: !1
3969
- },
3970
- {
3971
- header: i("settings.business.restaurant.contact"),
3972
- accessorKey: "phone",
3973
- enableSorting: !1
3974
- },
3975
- {
3976
- header: i("settings.business.restaurant.email"),
3977
- accessorKey: "email",
3978
- enableSorting: !1
3979
- },
3980
- {
3981
- header: i("settings.business.restaurant.tax.title"),
3982
- enableSorting: !1,
3983
- cell: (E) => {
3984
- var M;
3985
- const R = E.row.original;
3986
- return (M = R.doc.profile.sstRegNo) != null && M.length ? R.doc.profile.sstRegNo : i("settings.business.restaurant.tax.not_set");
3987
- }
3988
- },
3989
- {
3990
- id: "action",
3991
- header: "",
3992
- size: 80,
3993
- cell: (E) => {
3994
- const R = E.row.original;
3995
- return Wr([
3996
- {
3997
- name: "edit",
3998
- onClick: () => w(R)
3999
- },
4000
- {
4001
- name: "file_copy",
4002
- onClick: () => {
4003
- n(R.id);
4004
- }
4005
- }
4006
- ]);
4007
- }
4008
- }
4009
- ]);
4010
- function d() {
4011
- var E;
4012
- n(((E = h.value) == null ? void 0 : E.url) || "");
4013
- }
4014
- function _() {
4015
- if (!h.value)
4016
- return;
4017
- const { name: E, url: R, thumbnail: M } = h.value.doc;
4018
- Qe($, Ti, {
4019
- businessId: h.value.id,
4020
- initialValue: {
4021
- name: E,
4022
- url: R,
4023
- thumbnail: M
4024
- }
4025
- });
4026
- }
4027
- const $ = Ur();
4028
- function y() {
4029
- Qe($, ur, {
4030
- enableFeedmeExpress: !1
4031
- });
4032
- }
4033
- function w(E) {
4034
- var R;
4035
- Qe($, ur, {
4036
- restaurantId: E.id,
4037
- restaurant: E.doc,
4038
- enableFeedmeExpress: ((R = E.doc.feedmeDelivery) == null ? void 0 : R.enable) || !1
4039
- });
4040
- }
4041
- return (E, R) => {
4042
- var Y;
4043
- const M = q("FmSpacer"), k = q("FmButton"), F = q("FmTooltip"), T = q("FmSearch"), U = q("FmTable"), X = q("FmCircularProgress");
4044
- return D(), Q(Jr, {
4045
- heading: ((Y = h.value) == null ? void 0 : Y.name) || "--"
4046
- }, {
4047
- "sub-heading": H(() => {
4048
- var G;
4049
- return [
4050
- O("div", Ci, [
4051
- O("span", null, B(S(i)("settings.business.url")) + ": ", 1),
4052
- O("span", {
4053
- class: "cursor-pointer xs:w-max-[200px] truncate",
4054
- onClick: d
4055
- }, B((G = h.value) == null ? void 0 : G.url), 1)
4056
- ])
4057
- ];
4058
- }),
4059
- "append-heading": H(() => [
4060
- O("div", ki, [
4061
- C(M),
4062
- o.value ? (D(), K(oe, { key: 1 }, [
4063
- C(nn, {
4064
- onClick: y,
4065
- label: S(i)("settings.business.add_restaurant"),
4066
- "prepend-icon": "add"
4067
- }, null, 8, ["label"]),
4068
- C(Pi, null, {
4069
- default: H(() => [
4070
- C(Ni, {
4071
- label: S(i)("common.edit"),
4072
- onClick: _
4073
- }, null, 8, ["label"])
4074
- ]),
4075
- _: 1
4076
- })
4077
- ], 64)) : (D(), K("div", xi, [
4078
- C(k, {
4079
- onClick: _,
4080
- variant: "secondary",
4081
- label: S(i)("common.edit")
4082
- }, null, 8, ["label"]),
4083
- C(F, {
4084
- variant: "rich",
4085
- placement: "left",
4086
- "z-index": 100
4087
- }, {
4088
- content: H(() => {
4089
- var G;
4090
- return [
4091
- (G = h.value) != null && G.canCreateRestaurant ? fe("", !0) : (D(), K("div", Mi, [
4092
- O("p", Vi, B(S(i)("settings.business.quota.limit_title")), 1),
4093
- O("p", null, B(S(i)("settings.business.quota.limit_message")), 1)
4094
- ]))
4095
- ];
4096
- }),
4097
- default: H(() => {
4098
- var G;
4099
- return [
4100
- C(k, {
4101
- onClick: y,
4102
- label: S(i)("settings.business.add_restaurant"),
4103
- disabled: !((G = h.value) != null && G.canCreateRestaurant),
4104
- "prepend-icon": "add"
4105
- }, null, 8, ["label", "disabled"])
4106
- ];
4107
- }),
4108
- _: 1
4109
- })
4110
- ]))
4111
- ])
4112
- ]),
4113
- default: H(() => {
4114
- var G, z;
4115
- return [
4116
- o.value ? (D(), K(oe, { key: 1 }, [
4117
- C(T, {
4118
- class: "my-8 mx-16",
4119
- modelValue: S(e),
4120
- "onUpdate:modelValue": R[2] || (R[2] = (a) => Tt(e) ? e.value = a : null),
4121
- placeholder: S(i)("settings.business.search_restaurants")
4122
- }, null, 8, ["modelValue", "placeholder"]),
4123
- O("div", Di, [
4124
- h.value ? (D(!0), K(oe, { key: 1 }, be((z = h.value) == null ? void 0 : z.restaurants, (a) => {
4125
- var l;
4126
- return D(), K("div", {
4127
- key: a.id,
4128
- class: "py-12 px-16 space-y-4",
4129
- onClick: (g) => w(a)
4130
- }, [
4131
- O("div", Bi, [
4132
- O("div", Ki, B(a.name), 1),
4133
- O("div", Hi, [
4134
- C(k, {
4135
- icon: "edit",
4136
- "text-color": "neutral-gray-400",
4137
- variant: "tertiary",
4138
- onClick: it((g) => w(a), ["stop"])
4139
- }, null, 8, ["onClick"]),
4140
- C(k, {
4141
- icon: "file_copy",
4142
- "text-color": "neutral-gray-400",
4143
- variant: "tertiary",
4144
- onClick: it((g) => S(n)(a.id), ["stop"])
4145
- }, null, 8, ["onClick"])
4146
- ])
4147
- ]),
4148
- O("div", qi, B(S(i)("settings.business.restaurant.contact")) + ": " + B(a.phone), 1),
4149
- O("div", Yi, B(S(i)("settings.business.restaurant.email")) + ": " + B(a.email), 1),
4150
- O("div", zi, B(S(i)("settings.business.restaurant.tax.title")) + ": " + B((l = a.doc.profile.sstRegNo) != null && l.length ? a.doc.profile.sstRegNo : S(i)("settings.business.restaurant.tax.not_set")), 1)
4151
- ], 8, Gi);
4152
- }), 128)) : (D(), K("div", Ui, [
4153
- C(X, { size: "lg" })
4154
- ]))
4155
- ])
4156
- ], 64)) : (D(), K("div", Fi, [
4157
- O("div", ji, [
4158
- C(T, {
4159
- class: "w-[320px]",
4160
- modelValue: S(e),
4161
- "onUpdate:modelValue": R[0] || (R[0] = (a) => Tt(e) ? e.value = a : null),
4162
- placeholder: S(i)("settings.business.search_restaurants")
4163
- }, null, 8, ["modelValue", "placeholder"])
4164
- ]),
4165
- C(U, {
4166
- "column-defs": p.value,
4167
- "row-data": ((G = h.value) == null ? void 0 : G.restaurants) || [],
4168
- "shrink-at": !1,
4169
- loading: !h.value,
4170
- onRowClick: R[1] || (R[1] = (a) => w(a.original))
4171
- }, null, 8, ["column-defs", "row-data", "loading"])
4172
- ]))
4173
- ];
4174
- }),
4175
- _: 1
4176
- }, 8, ["heading"]);
4177
- };
4178
- }
4179
- });
4180
- export {
4181
- ul as default
4182
- };