@feedmepos/mf-settings 0.0.64-prod → 0.0.65

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