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