@feedmepos/mf-settings 0.0.61-beta.2 → 0.0.61-prod

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