@oneclick.dev/cms-core-modules 0.0.98 → 0.0.99
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/{ContentEditor-BPrZ-yof.mjs → ContentEditor-Cjqgb64R.mjs} +3363 -3201
- package/dist/{ContentEditor-CsZDAnGs.js → ContentEditor-YgOS3kxS.js} +249 -101
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js +349 -0
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CYXkhhdp.mjs} +989 -937
- package/dist/TableView-CyvIoyUT.js +4 -0
- package/dist/{TableView-Bf67F7Hd.mjs → TableView-zWrTCNvl.mjs} +2083 -1896
- package/dist/{agenda-D9bpW3jv.mjs → agenda-DMT75Qfo.mjs} +1 -1
- package/dist/{agenda-H1NyBNr2.js → agenda-DxD4RMsy.js} +1 -1
- package/dist/{index-DOeXSG47.js → index-BbqRTXuU.js} +1 -1
- package/dist/{index-DnH93MgM.mjs → index-D4GsbUId.mjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{orders-DDrZJHj2.mjs → orders-BRfXlWgV.mjs} +1 -1
- package/dist/{orders-BAT2ciXx.js → orders-CrCz1WTR.js} +1 -1
- package/dist/src/contentManager/components/content-editor/code-examples.d.ts +2 -1
- package/dist/src/table/components/DataTable.vue.d.ts +2 -2
- package/dist/src/table/components/DataTableMobileRowActionDrawer.vue.d.ts +1 -1
- package/dist/src/table/pages/TableView.vue.d.ts +2 -2
- package/package.json +2 -2
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js +0 -349
- package/dist/TableView-pK16x94F.js +0 -4
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { User as
|
|
3
|
-
import { useModule as
|
|
4
|
-
import { t as
|
|
5
|
-
function
|
|
1
|
+
import { defineComponent as te, ref as $, resolveComponent as _, openBlock as R, createBlock as J, withCtx as g, createVNode as c, createTextVNode as A, createElementVNode as m, unref as S, normalizeClass as le, toDisplayString as F, inject as Je, useTemplateRef as oe, computed as pe, createElementBlock as U, Fragment as fe, createCommentVNode as L } from "vue";
|
|
2
|
+
import { User as Xe, Mail as Ze, Phone as qe, Clock as et, Users as tt, Tag as st, CreditCard as nt, Receipt as ot, Ban as at, ClockCheck as it, MoreHorizontal as rt, Download as lt, MailCheck as ut, XCircle as ct, Gift as dt } from "lucide-vue-next";
|
|
3
|
+
import { useModule as se, useMailer as be, useModulePermissions as pt, useFirebaseIntegration as ft } from "@oneclick.dev/cms-kit";
|
|
4
|
+
import { t as Z } from "./index-RLz1QPrf.mjs";
|
|
5
|
+
function K(t) {
|
|
6
6
|
return Array.isArray ? Array.isArray(t) : Re(t) === "[object Array]";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function mt(t) {
|
|
9
9
|
if (typeof t == "string")
|
|
10
10
|
return t;
|
|
11
11
|
let e = t + "";
|
|
12
12
|
return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return t == null ? "" :
|
|
14
|
+
function we(t) {
|
|
15
|
+
return t == null ? "" : mt(t);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function z(t) {
|
|
18
18
|
return typeof t == "string";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function me(t) {
|
|
21
21
|
return typeof t == "number";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return t === !0 || t === !1 ||
|
|
23
|
+
function gt(t) {
|
|
24
|
+
return t === !0 || t === !1 || vt(t) && Re(t) == "[object Boolean]";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Se(t) {
|
|
27
27
|
return typeof t == "object";
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function vt(t) {
|
|
30
|
+
return Se(t) && t !== null;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function P(t) {
|
|
33
33
|
return t != null;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ae(t) {
|
|
36
36
|
return !t.trim().length;
|
|
37
37
|
}
|
|
38
38
|
function Re(t) {
|
|
39
39
|
return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const ht = "Incorrect 'index' type", _t = (t) => `Invalid value for key ${t}`, xt = (t) => `Pattern length exceeds max of ${t}.`, Dt = (t) => `Missing ${t} property in key`, bt = (t) => `Property 'weight' in key '${t}' must be a positive integer`, ke = Object.prototype.hasOwnProperty;
|
|
42
42
|
class yt {
|
|
43
43
|
constructor(e) {
|
|
44
44
|
this._keys = [], this._keyMap = {};
|
|
45
|
-
let
|
|
46
|
-
e.forEach((
|
|
47
|
-
let
|
|
48
|
-
this._keys.push(
|
|
49
|
-
}), this._keys.forEach((
|
|
50
|
-
|
|
45
|
+
let s = 0;
|
|
46
|
+
e.forEach((n) => {
|
|
47
|
+
let a = Ie(n);
|
|
48
|
+
this._keys.push(a), this._keyMap[a.id] = a, s += a.weight;
|
|
49
|
+
}), this._keys.forEach((n) => {
|
|
50
|
+
n.weight /= s;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
get(e) {
|
|
@@ -60,49 +60,51 @@ class yt {
|
|
|
60
60
|
return JSON.stringify(this._keys);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let e = null,
|
|
65
|
-
if (
|
|
66
|
-
|
|
63
|
+
function Ie(t) {
|
|
64
|
+
let e = null, s = null, n = null, a = 1, r = null;
|
|
65
|
+
if (z(t) || K(t))
|
|
66
|
+
n = t, e = Ee(t), s = ge(t);
|
|
67
67
|
else {
|
|
68
|
-
if (!
|
|
69
|
-
throw new Error(
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
throw new Error(
|
|
73
|
-
e =
|
|
74
|
-
}
|
|
75
|
-
return { path: e, id:
|
|
68
|
+
if (!ke.call(t, "name"))
|
|
69
|
+
throw new Error(Dt("name"));
|
|
70
|
+
const i = t.name;
|
|
71
|
+
if (n = i, ke.call(t, "weight") && (a = t.weight, a <= 0))
|
|
72
|
+
throw new Error(bt(i));
|
|
73
|
+
e = Ee(i), s = ge(i), r = t.getFn;
|
|
74
|
+
}
|
|
75
|
+
return { path: e, id: s, weight: a, src: n, getFn: r };
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function Ee(t) {
|
|
78
|
+
return K(t) ? t : t.split(".");
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
80
|
+
function ge(t) {
|
|
81
|
+
return K(t) ? t.join(".") : t;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
if (!
|
|
88
|
-
|
|
83
|
+
function At(t, e) {
|
|
84
|
+
let s = [], n = !1;
|
|
85
|
+
const a = (r, i, l, p) => {
|
|
86
|
+
if (P(r))
|
|
87
|
+
if (!i[l])
|
|
88
|
+
s.push(p !== void 0 ? { v: r, i: p } : r);
|
|
89
89
|
else {
|
|
90
|
-
let
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
90
|
+
let o = i[l];
|
|
91
|
+
const u = r[o];
|
|
92
|
+
if (!P(u))
|
|
93
93
|
return;
|
|
94
|
-
if (l ===
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
if (l === i.length - 1 && (z(u) || me(u) || gt(u)))
|
|
95
|
+
s.push(
|
|
96
|
+
p !== void 0 ? { v: we(u), i: p } : we(u)
|
|
97
|
+
);
|
|
98
|
+
else if (K(u)) {
|
|
99
|
+
n = !0;
|
|
100
|
+
for (let v = 0, b = u.length; v < b; v += 1)
|
|
101
|
+
a(u[v], i, l + 1, v);
|
|
102
|
+
} else i.length && a(u, i, l + 1, p);
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
|
-
return
|
|
105
|
+
return a(t, z(e) ? e.split(".") : e, 0), n ? s : s[0];
|
|
104
106
|
}
|
|
105
|
-
const
|
|
107
|
+
const Ct = {
|
|
106
108
|
// Whether the matches should be included in the result set. When `true`, each record in the result
|
|
107
109
|
// set will include the indices of the matched characters.
|
|
108
110
|
// These can consequently be used for highlighting purposes.
|
|
@@ -112,7 +114,7 @@ const At = {
|
|
|
112
114
|
findAllMatches: !1,
|
|
113
115
|
// Minimum number of characters that must be matched before a result is considered a match
|
|
114
116
|
minMatchCharLength: 1
|
|
115
|
-
},
|
|
117
|
+
}, wt = {
|
|
116
118
|
// When `true`, the algorithm continues searching to the end of the input even if a perfect
|
|
117
119
|
// match is found before the end of the same input.
|
|
118
120
|
isCaseSensitive: !1,
|
|
@@ -126,7 +128,7 @@ const At = {
|
|
|
126
128
|
shouldSort: !0,
|
|
127
129
|
// Default sort function: sort by ascending score, ascending index
|
|
128
130
|
sortFn: (t, e) => t.score === e.score ? t.idx < e.idx ? -1 : 1 : t.score < e.score ? -1 : 1
|
|
129
|
-
},
|
|
131
|
+
}, kt = {
|
|
130
132
|
// Approximately where in the text is the pattern expected to be found?
|
|
131
133
|
location: 0,
|
|
132
134
|
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
|
|
@@ -138,12 +140,12 @@ const At = {
|
|
|
138
140
|
// the exact location specified, a threshold of '1000' would require a perfect match
|
|
139
141
|
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
|
|
140
142
|
distance: 100
|
|
141
|
-
},
|
|
143
|
+
}, Et = {
|
|
142
144
|
// When `true`, it enables the use of unix-like search commands
|
|
143
145
|
useExtendedSearch: !1,
|
|
144
146
|
// The get function to use when fetching an object's properties.
|
|
145
147
|
// The default will search nested paths *ie foo.bar.baz*
|
|
146
|
-
getFn:
|
|
148
|
+
getFn: At,
|
|
147
149
|
// When `true`, search will ignore `location` and `distance`, so it won't matter
|
|
148
150
|
// where in the string the pattern appears.
|
|
149
151
|
// More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
|
|
@@ -156,33 +158,33 @@ const At = {
|
|
|
156
158
|
fieldNormWeight: 1
|
|
157
159
|
};
|
|
158
160
|
var D = {
|
|
159
|
-
...Ct,
|
|
160
|
-
...At,
|
|
161
161
|
...wt,
|
|
162
|
-
...
|
|
162
|
+
...Ct,
|
|
163
|
+
...kt,
|
|
164
|
+
...Et
|
|
163
165
|
};
|
|
164
|
-
const
|
|
165
|
-
function
|
|
166
|
-
const
|
|
166
|
+
const $t = /[^ ]+/g;
|
|
167
|
+
function Mt(t = 1, e = 3) {
|
|
168
|
+
const s = /* @__PURE__ */ new Map(), n = Math.pow(10, e);
|
|
167
169
|
return {
|
|
168
|
-
get(
|
|
169
|
-
const r =
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
172
|
-
const
|
|
173
|
-
return
|
|
170
|
+
get(a) {
|
|
171
|
+
const r = a.match($t).length;
|
|
172
|
+
if (s.has(r))
|
|
173
|
+
return s.get(r);
|
|
174
|
+
const i = 1 / Math.pow(r, 0.5 * t), l = parseFloat(Math.round(i * n) / n);
|
|
175
|
+
return s.set(r, l), l;
|
|
174
176
|
},
|
|
175
177
|
clear() {
|
|
176
|
-
|
|
178
|
+
s.clear();
|
|
177
179
|
}
|
|
178
180
|
};
|
|
179
181
|
}
|
|
180
182
|
class ye {
|
|
181
183
|
constructor({
|
|
182
184
|
getFn: e = D.getFn,
|
|
183
|
-
fieldNormWeight:
|
|
185
|
+
fieldNormWeight: s = D.fieldNormWeight
|
|
184
186
|
} = {}) {
|
|
185
|
-
this.norm =
|
|
187
|
+
this.norm = Mt(s, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
|
|
186
188
|
}
|
|
187
189
|
setSources(e = []) {
|
|
188
190
|
this.docs = e;
|
|
@@ -191,79 +193,90 @@ class ye {
|
|
|
191
193
|
this.records = e;
|
|
192
194
|
}
|
|
193
195
|
setKeys(e = []) {
|
|
194
|
-
this.keys = e, this._keysMap = {}, e.forEach((
|
|
195
|
-
this._keysMap[
|
|
196
|
+
this.keys = e, this._keysMap = {}, e.forEach((s, n) => {
|
|
197
|
+
this._keysMap[s.id] = n;
|
|
196
198
|
});
|
|
197
199
|
}
|
|
198
200
|
create() {
|
|
199
|
-
this.isCreated || !this.docs.length || (this.isCreated = !0,
|
|
200
|
-
this._addString(e,
|
|
201
|
-
}) : this.docs.forEach((e,
|
|
202
|
-
this._addObject(e,
|
|
201
|
+
this.isCreated || !this.docs.length || (this.isCreated = !0, z(this.docs[0]) ? this.docs.forEach((e, s) => {
|
|
202
|
+
this._addString(e, s);
|
|
203
|
+
}) : this.docs.forEach((e, s) => {
|
|
204
|
+
this._addObject(e, s);
|
|
203
205
|
}), this.norm.clear());
|
|
204
206
|
}
|
|
205
207
|
// Adds a doc to the end of the index
|
|
206
208
|
add(e) {
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
+
const s = this.size();
|
|
210
|
+
z(e) ? this._addString(e, s) : this._addObject(e, s);
|
|
209
211
|
}
|
|
210
212
|
// Removes the doc at the specified index of the index
|
|
211
213
|
removeAt(e) {
|
|
212
214
|
this.records.splice(e, 1);
|
|
213
|
-
for (let
|
|
214
|
-
this.records[
|
|
215
|
+
for (let s = e, n = this.size(); s < n; s += 1)
|
|
216
|
+
this.records[s].i -= 1;
|
|
215
217
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
// Removes docs at the specified indices (must be sorted ascending)
|
|
219
|
+
removeAll(e) {
|
|
220
|
+
for (let s = e.length - 1; s >= 0; s -= 1)
|
|
221
|
+
this.records.splice(e[s], 1);
|
|
222
|
+
for (let s = 0, n = this.records.length; s < n; s += 1)
|
|
223
|
+
this.records[s].i = s;
|
|
224
|
+
}
|
|
225
|
+
getValueForItemAtKeyId(e, s) {
|
|
226
|
+
return e[this._keysMap[s]];
|
|
218
227
|
}
|
|
219
228
|
size() {
|
|
220
229
|
return this.records.length;
|
|
221
230
|
}
|
|
222
|
-
_addString(e,
|
|
223
|
-
if (!
|
|
231
|
+
_addString(e, s) {
|
|
232
|
+
if (!P(e) || ae(e))
|
|
224
233
|
return;
|
|
225
|
-
let
|
|
234
|
+
let n = {
|
|
226
235
|
v: e,
|
|
227
|
-
i:
|
|
236
|
+
i: s,
|
|
228
237
|
n: this.norm.get(e)
|
|
229
238
|
};
|
|
230
|
-
this.records.push(
|
|
231
|
-
}
|
|
232
|
-
_addObject(e,
|
|
233
|
-
let
|
|
234
|
-
this.keys.forEach((
|
|
235
|
-
let
|
|
236
|
-
if (
|
|
237
|
-
if (
|
|
239
|
+
this.records.push(n);
|
|
240
|
+
}
|
|
241
|
+
_addObject(e, s) {
|
|
242
|
+
let n = { i: s, $: {} };
|
|
243
|
+
this.keys.forEach((a, r) => {
|
|
244
|
+
let i = a.getFn ? a.getFn(e) : this.getFn(e, a.path);
|
|
245
|
+
if (P(i)) {
|
|
246
|
+
if (K(i)) {
|
|
238
247
|
let l = [];
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
for (let p = 0, o = i.length; p < o; p += 1) {
|
|
249
|
+
const u = i[p];
|
|
250
|
+
if (P(u)) {
|
|
251
|
+
if (z(u)) {
|
|
252
|
+
if (!ae(u)) {
|
|
253
|
+
let v = {
|
|
254
|
+
v: u,
|
|
255
|
+
i: p,
|
|
256
|
+
n: this.norm.get(u)
|
|
257
|
+
};
|
|
258
|
+
l.push(v);
|
|
259
|
+
}
|
|
260
|
+
} else if (z(u.v) && !ae(u.v)) {
|
|
261
|
+
let v = {
|
|
262
|
+
v: u.v,
|
|
263
|
+
i: u.i,
|
|
264
|
+
n: this.norm.get(u.v)
|
|
248
265
|
};
|
|
249
|
-
l.push(
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
nestedArrIndex: y,
|
|
253
|
-
value: _
|
|
254
|
-
});
|
|
255
|
-
});
|
|
266
|
+
l.push(v);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
256
269
|
}
|
|
257
|
-
|
|
258
|
-
} else if (
|
|
270
|
+
n.$[r] = l;
|
|
271
|
+
} else if (z(i) && !ae(i)) {
|
|
259
272
|
let l = {
|
|
260
|
-
v:
|
|
261
|
-
n: this.norm.get(
|
|
273
|
+
v: i,
|
|
274
|
+
n: this.norm.get(i)
|
|
262
275
|
};
|
|
263
|
-
|
|
276
|
+
n.$[r] = l;
|
|
264
277
|
}
|
|
265
278
|
}
|
|
266
|
-
}), this.records.push(
|
|
279
|
+
}), this.records.push(n);
|
|
267
280
|
}
|
|
268
281
|
toJSON() {
|
|
269
282
|
return {
|
|
@@ -272,202 +285,181 @@ class ye {
|
|
|
272
285
|
};
|
|
273
286
|
}
|
|
274
287
|
}
|
|
275
|
-
function je(t, e, { getFn:
|
|
276
|
-
const
|
|
277
|
-
return
|
|
288
|
+
function je(t, e, { getFn: s = D.getFn, fieldNormWeight: n = D.fieldNormWeight } = {}) {
|
|
289
|
+
const a = new ye({ getFn: s, fieldNormWeight: n });
|
|
290
|
+
return a.setKeys(t.map(Ie)), a.setSources(e), a.create(), a;
|
|
278
291
|
}
|
|
279
|
-
function
|
|
280
|
-
const { keys:
|
|
281
|
-
return r.setKeys(
|
|
292
|
+
function Bt(t, { getFn: e = D.getFn, fieldNormWeight: s = D.fieldNormWeight } = {}) {
|
|
293
|
+
const { keys: n, records: a } = t, r = new ye({ getFn: e, fieldNormWeight: s });
|
|
294
|
+
return r.setKeys(n), r.setIndexRecords(a), r;
|
|
282
295
|
}
|
|
283
|
-
function
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
expectedLocation: o = 0,
|
|
287
|
-
distance: i = D.distance,
|
|
288
|
-
ignoreLocation: r = D.ignoreLocation
|
|
289
|
-
} = {}) {
|
|
290
|
-
const a = e / t.length;
|
|
291
|
-
if (r)
|
|
292
|
-
return a;
|
|
293
|
-
const l = Math.abs(o - n);
|
|
294
|
-
return i ? a + l / i : l ? 1 : a;
|
|
295
|
-
}
|
|
296
|
-
function Bt(t = [], e = D.minMatchCharLength) {
|
|
297
|
-
let n = [], o = -1, i = -1, r = 0;
|
|
298
|
-
for (let a = t.length; r < a; r += 1) {
|
|
296
|
+
function Ft(t = [], e = D.minMatchCharLength) {
|
|
297
|
+
let s = [], n = -1, a = -1, r = 0;
|
|
298
|
+
for (let i = t.length; r < i; r += 1) {
|
|
299
299
|
let l = t[r];
|
|
300
|
-
l &&
|
|
300
|
+
l && n === -1 ? n = r : !l && n !== -1 && (a = r - 1, a - n + 1 >= e && s.push([n, a]), n = -1);
|
|
301
301
|
}
|
|
302
|
-
return t[r - 1] && r -
|
|
302
|
+
return t[r - 1] && r - n >= e && s.push([n, r - 1]), s;
|
|
303
303
|
}
|
|
304
304
|
const Q = 32;
|
|
305
|
-
function
|
|
306
|
-
location:
|
|
307
|
-
distance:
|
|
305
|
+
function St(t, e, s, {
|
|
306
|
+
location: n = D.location,
|
|
307
|
+
distance: a = D.distance,
|
|
308
308
|
threshold: r = D.threshold,
|
|
309
|
-
findAllMatches:
|
|
309
|
+
findAllMatches: i = D.findAllMatches,
|
|
310
310
|
minMatchCharLength: l = D.minMatchCharLength,
|
|
311
|
-
includeMatches:
|
|
312
|
-
ignoreLocation:
|
|
311
|
+
includeMatches: p = D.includeMatches,
|
|
312
|
+
ignoreLocation: o = D.ignoreLocation
|
|
313
313
|
} = {}) {
|
|
314
314
|
if (e.length > Q)
|
|
315
|
-
throw new Error(
|
|
316
|
-
const
|
|
317
|
-
let
|
|
318
|
-
const x =
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
if (
|
|
328
|
-
let
|
|
329
|
-
for (;
|
|
330
|
-
|
|
315
|
+
throw new Error(xt(Q));
|
|
316
|
+
const u = e.length, v = t.length, b = Math.max(0, Math.min(n, v));
|
|
317
|
+
let h = r, d = b;
|
|
318
|
+
const x = (E, j) => {
|
|
319
|
+
const y = E / u;
|
|
320
|
+
if (o) return y;
|
|
321
|
+
const T = Math.abs(b - j);
|
|
322
|
+
return a ? y + T / a : T ? 1 : y;
|
|
323
|
+
}, M = l > 1 || p, O = M ? Array(v) : [];
|
|
324
|
+
let I;
|
|
325
|
+
for (; (I = t.indexOf(e, d)) > -1; ) {
|
|
326
|
+
let E = x(0, I);
|
|
327
|
+
if (h = Math.min(E, h), d = I + u, M) {
|
|
328
|
+
let j = 0;
|
|
329
|
+
for (; j < u; )
|
|
330
|
+
O[I + j] = 1, j += 1;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
|
|
334
|
-
let
|
|
335
|
-
const
|
|
336
|
-
for (let
|
|
337
|
-
let
|
|
338
|
-
for (;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
let C = Math.max(1, y - O + 1), N = a ? _ : Math.min(y + O, _) + p, K = Array(N + 2);
|
|
348
|
-
K[N + 1] = (1 << k) - 1;
|
|
349
|
-
for (let b = N; b >= C; b -= 1) {
|
|
350
|
-
let f = b - 1, E = n[t.charAt(f)];
|
|
351
|
-
if (x && (B[f] = +!!E), K[b] = (K[b + 1] << 1 | 1) & E, k && (K[b] |= (S[b + 1] | S[b]) << 1 | 1 | S[b + 1]), K[b] & U && (w = se(e, {
|
|
352
|
-
errors: k,
|
|
353
|
-
currentLocation: f,
|
|
354
|
-
expectedLocation: y,
|
|
355
|
-
distance: i,
|
|
356
|
-
ignoreLocation: s
|
|
357
|
-
}), w <= v)) {
|
|
358
|
-
if (v = w, c = f, c <= y)
|
|
333
|
+
d = -1;
|
|
334
|
+
let w = [], B = 1, N = u + v;
|
|
335
|
+
const H = 1 << u - 1;
|
|
336
|
+
for (let E = 0; E < u; E += 1) {
|
|
337
|
+
let j = 0, y = N;
|
|
338
|
+
for (; j < y; )
|
|
339
|
+
x(E, b + y) <= h ? j = y : N = y, y = Math.floor((N - j) / 2 + j);
|
|
340
|
+
N = y;
|
|
341
|
+
let T = Math.max(1, b - y + 1), ee = i ? v : Math.min(b + y, v) + u, W = Array(ee + 2);
|
|
342
|
+
W[ee + 1] = (1 << E) - 1;
|
|
343
|
+
for (let f = ee; f >= T; f -= 1) {
|
|
344
|
+
let k = f - 1, X = s[t[k]];
|
|
345
|
+
if (M && (O[k] = +!!X), W[f] = (W[f + 1] << 1 | 1) & X, E && (W[f] |= (w[f + 1] | w[f]) << 1 | 1 | w[f + 1]), W[f] & H && (B = x(E, k), B <= h)) {
|
|
346
|
+
if (h = B, d = k, d <= b)
|
|
359
347
|
break;
|
|
360
|
-
|
|
348
|
+
T = Math.max(1, 2 * b - d);
|
|
361
349
|
}
|
|
362
350
|
}
|
|
363
|
-
if (
|
|
364
|
-
errors: k + 1,
|
|
365
|
-
currentLocation: y,
|
|
366
|
-
expectedLocation: y,
|
|
367
|
-
distance: i,
|
|
368
|
-
ignoreLocation: s
|
|
369
|
-
}) > v)
|
|
351
|
+
if (x(E + 1, b) > h)
|
|
370
352
|
break;
|
|
371
|
-
|
|
353
|
+
w = W;
|
|
372
354
|
}
|
|
373
|
-
const
|
|
374
|
-
isMatch:
|
|
355
|
+
const V = {
|
|
356
|
+
isMatch: d >= 0,
|
|
375
357
|
// Count exact matches (those with a score of 0) to be "almost" exact
|
|
376
|
-
score: Math.max(1e-3,
|
|
358
|
+
score: Math.max(1e-3, B)
|
|
377
359
|
};
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
|
|
360
|
+
if (M) {
|
|
361
|
+
const E = Ft(O, l);
|
|
362
|
+
E.length ? p && (V.indices = E) : V.isMatch = !1;
|
|
381
363
|
}
|
|
382
|
-
return
|
|
364
|
+
return V;
|
|
383
365
|
}
|
|
384
|
-
function
|
|
366
|
+
function Rt(t) {
|
|
385
367
|
let e = {};
|
|
386
|
-
for (let
|
|
387
|
-
const
|
|
388
|
-
e[
|
|
368
|
+
for (let s = 0, n = t.length; s < n; s += 1) {
|
|
369
|
+
const a = t.charAt(s);
|
|
370
|
+
e[a] = (e[a] || 0) | 1 << n - s - 1;
|
|
371
|
+
}
|
|
372
|
+
return e;
|
|
373
|
+
}
|
|
374
|
+
const ie = String.prototype.normalize ? ((t) => t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((t) => t);
|
|
375
|
+
function It(t) {
|
|
376
|
+
if (t.length <= 1) return t;
|
|
377
|
+
t.sort((s, n) => s[0] - n[0] || s[1] - n[1]);
|
|
378
|
+
const e = [t[0]];
|
|
379
|
+
for (let s = 1, n = t.length; s < n; s += 1) {
|
|
380
|
+
const a = e[e.length - 1], r = t[s];
|
|
381
|
+
r[0] <= a[1] + 1 ? a[1] = Math.max(a[1], r[1]) : e.push(r);
|
|
389
382
|
}
|
|
390
383
|
return e;
|
|
391
384
|
}
|
|
392
|
-
const oe = String.prototype.normalize ? ((t) => t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((t) => t);
|
|
393
385
|
class Te {
|
|
394
386
|
constructor(e, {
|
|
395
|
-
location:
|
|
396
|
-
threshold:
|
|
397
|
-
distance:
|
|
387
|
+
location: s = D.location,
|
|
388
|
+
threshold: n = D.threshold,
|
|
389
|
+
distance: a = D.distance,
|
|
398
390
|
includeMatches: r = D.includeMatches,
|
|
399
|
-
findAllMatches:
|
|
391
|
+
findAllMatches: i = D.findAllMatches,
|
|
400
392
|
minMatchCharLength: l = D.minMatchCharLength,
|
|
401
|
-
isCaseSensitive:
|
|
402
|
-
ignoreDiacritics:
|
|
403
|
-
ignoreLocation:
|
|
393
|
+
isCaseSensitive: p = D.isCaseSensitive,
|
|
394
|
+
ignoreDiacritics: o = D.ignoreDiacritics,
|
|
395
|
+
ignoreLocation: u = D.ignoreLocation
|
|
404
396
|
} = {}) {
|
|
405
397
|
if (this.options = {
|
|
406
|
-
location:
|
|
407
|
-
threshold:
|
|
408
|
-
distance:
|
|
398
|
+
location: s,
|
|
399
|
+
threshold: n,
|
|
400
|
+
distance: a,
|
|
409
401
|
includeMatches: r,
|
|
410
|
-
findAllMatches:
|
|
402
|
+
findAllMatches: i,
|
|
411
403
|
minMatchCharLength: l,
|
|
412
|
-
isCaseSensitive:
|
|
413
|
-
ignoreDiacritics:
|
|
414
|
-
ignoreLocation:
|
|
415
|
-
}, e =
|
|
404
|
+
isCaseSensitive: p,
|
|
405
|
+
ignoreDiacritics: o,
|
|
406
|
+
ignoreLocation: u
|
|
407
|
+
}, e = p ? e : e.toLowerCase(), e = o ? ie(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length)
|
|
416
408
|
return;
|
|
417
|
-
const
|
|
409
|
+
const v = (h, d) => {
|
|
418
410
|
this.chunks.push({
|
|
419
|
-
pattern:
|
|
420
|
-
alphabet:
|
|
421
|
-
startIndex:
|
|
411
|
+
pattern: h,
|
|
412
|
+
alphabet: Rt(h),
|
|
413
|
+
startIndex: d
|
|
422
414
|
});
|
|
423
|
-
},
|
|
424
|
-
if (
|
|
425
|
-
let
|
|
426
|
-
const
|
|
427
|
-
for (;
|
|
428
|
-
|
|
429
|
-
if (
|
|
430
|
-
const
|
|
431
|
-
|
|
415
|
+
}, b = this.pattern.length;
|
|
416
|
+
if (b > Q) {
|
|
417
|
+
let h = 0;
|
|
418
|
+
const d = b % Q, x = b - d;
|
|
419
|
+
for (; h < x; )
|
|
420
|
+
v(this.pattern.substr(h, Q), h), h += Q;
|
|
421
|
+
if (d) {
|
|
422
|
+
const M = b - Q;
|
|
423
|
+
v(this.pattern.substr(M), M);
|
|
432
424
|
}
|
|
433
425
|
} else
|
|
434
|
-
|
|
426
|
+
v(this.pattern, 0);
|
|
435
427
|
}
|
|
436
428
|
searchIn(e) {
|
|
437
|
-
const { isCaseSensitive:
|
|
438
|
-
if (e =
|
|
429
|
+
const { isCaseSensitive: s, ignoreDiacritics: n, includeMatches: a } = this.options;
|
|
430
|
+
if (e = s ? e : e.toLowerCase(), e = n ? ie(e) : e, this.pattern === e) {
|
|
439
431
|
let x = {
|
|
440
432
|
isMatch: !0,
|
|
441
433
|
score: 0
|
|
442
434
|
};
|
|
443
|
-
return
|
|
435
|
+
return a && (x.indices = [[0, e.length - 1]]), x;
|
|
444
436
|
}
|
|
445
437
|
const {
|
|
446
438
|
location: r,
|
|
447
|
-
distance:
|
|
439
|
+
distance: i,
|
|
448
440
|
threshold: l,
|
|
449
|
-
findAllMatches:
|
|
450
|
-
minMatchCharLength:
|
|
451
|
-
ignoreLocation:
|
|
441
|
+
findAllMatches: p,
|
|
442
|
+
minMatchCharLength: o,
|
|
443
|
+
ignoreLocation: u
|
|
452
444
|
} = this.options;
|
|
453
|
-
let
|
|
454
|
-
this.chunks.forEach(({ pattern: x, alphabet:
|
|
455
|
-
const { isMatch:
|
|
456
|
-
location: r +
|
|
457
|
-
distance:
|
|
445
|
+
let v = [], b = 0, h = !1;
|
|
446
|
+
this.chunks.forEach(({ pattern: x, alphabet: M, startIndex: O }) => {
|
|
447
|
+
const { isMatch: I, score: w, indices: B } = St(e, x, M, {
|
|
448
|
+
location: r + O,
|
|
449
|
+
distance: i,
|
|
458
450
|
threshold: l,
|
|
459
|
-
findAllMatches:
|
|
460
|
-
minMatchCharLength:
|
|
461
|
-
includeMatches:
|
|
462
|
-
ignoreLocation:
|
|
451
|
+
findAllMatches: p,
|
|
452
|
+
minMatchCharLength: o,
|
|
453
|
+
includeMatches: a,
|
|
454
|
+
ignoreLocation: u
|
|
463
455
|
});
|
|
464
|
-
|
|
456
|
+
I && (h = !0), b += w, I && B && v.push(...B);
|
|
465
457
|
});
|
|
466
|
-
let
|
|
467
|
-
isMatch:
|
|
468
|
-
score:
|
|
458
|
+
let d = {
|
|
459
|
+
isMatch: h,
|
|
460
|
+
score: h ? b / this.chunks.length : 1
|
|
469
461
|
};
|
|
470
|
-
return
|
|
462
|
+
return h && a && (d.indices = It(v)), d;
|
|
471
463
|
}
|
|
472
464
|
}
|
|
473
465
|
class G {
|
|
@@ -475,19 +467,19 @@ class G {
|
|
|
475
467
|
this.pattern = e;
|
|
476
468
|
}
|
|
477
469
|
static isMultiMatch(e) {
|
|
478
|
-
return
|
|
470
|
+
return $e(e, this.multiRegex);
|
|
479
471
|
}
|
|
480
472
|
static isSingleMatch(e) {
|
|
481
|
-
return
|
|
473
|
+
return $e(e, this.singleRegex);
|
|
482
474
|
}
|
|
483
475
|
search() {
|
|
484
476
|
}
|
|
485
477
|
}
|
|
486
|
-
function
|
|
487
|
-
const
|
|
488
|
-
return
|
|
478
|
+
function $e(t, e) {
|
|
479
|
+
const s = t.match(e);
|
|
480
|
+
return s ? s[1] : null;
|
|
489
481
|
}
|
|
490
|
-
class
|
|
482
|
+
class jt extends G {
|
|
491
483
|
constructor(e) {
|
|
492
484
|
super(e);
|
|
493
485
|
}
|
|
@@ -501,15 +493,15 @@ class Rt extends G {
|
|
|
501
493
|
return /^=(.*)$/;
|
|
502
494
|
}
|
|
503
495
|
search(e) {
|
|
504
|
-
const
|
|
496
|
+
const s = e === this.pattern;
|
|
505
497
|
return {
|
|
506
|
-
isMatch:
|
|
507
|
-
score:
|
|
498
|
+
isMatch: s,
|
|
499
|
+
score: s ? 0 : 1,
|
|
508
500
|
indices: [0, this.pattern.length - 1]
|
|
509
501
|
};
|
|
510
502
|
}
|
|
511
503
|
}
|
|
512
|
-
class
|
|
504
|
+
class Tt extends G {
|
|
513
505
|
constructor(e) {
|
|
514
506
|
super(e);
|
|
515
507
|
}
|
|
@@ -523,15 +515,15 @@ class St extends G {
|
|
|
523
515
|
return /^!(.*)$/;
|
|
524
516
|
}
|
|
525
517
|
search(e) {
|
|
526
|
-
const
|
|
518
|
+
const n = e.indexOf(this.pattern) === -1;
|
|
527
519
|
return {
|
|
528
|
-
isMatch:
|
|
529
|
-
score:
|
|
520
|
+
isMatch: n,
|
|
521
|
+
score: n ? 0 : 1,
|
|
530
522
|
indices: [0, e.length - 1]
|
|
531
523
|
};
|
|
532
524
|
}
|
|
533
525
|
}
|
|
534
|
-
class
|
|
526
|
+
class Ot extends G {
|
|
535
527
|
constructor(e) {
|
|
536
528
|
super(e);
|
|
537
529
|
}
|
|
@@ -545,15 +537,15 @@ class jt extends G {
|
|
|
545
537
|
return /^\^(.*)$/;
|
|
546
538
|
}
|
|
547
539
|
search(e) {
|
|
548
|
-
const
|
|
540
|
+
const s = e.startsWith(this.pattern);
|
|
549
541
|
return {
|
|
550
|
-
isMatch:
|
|
551
|
-
score:
|
|
542
|
+
isMatch: s,
|
|
543
|
+
score: s ? 0 : 1,
|
|
552
544
|
indices: [0, this.pattern.length - 1]
|
|
553
545
|
};
|
|
554
546
|
}
|
|
555
547
|
}
|
|
556
|
-
class
|
|
548
|
+
class Nt extends G {
|
|
557
549
|
constructor(e) {
|
|
558
550
|
super(e);
|
|
559
551
|
}
|
|
@@ -567,15 +559,15 @@ class Tt extends G {
|
|
|
567
559
|
return /^!\^(.*)$/;
|
|
568
560
|
}
|
|
569
561
|
search(e) {
|
|
570
|
-
const
|
|
562
|
+
const s = !e.startsWith(this.pattern);
|
|
571
563
|
return {
|
|
572
|
-
isMatch:
|
|
573
|
-
score:
|
|
564
|
+
isMatch: s,
|
|
565
|
+
score: s ? 0 : 1,
|
|
574
566
|
indices: [0, e.length - 1]
|
|
575
567
|
};
|
|
576
568
|
}
|
|
577
569
|
}
|
|
578
|
-
class
|
|
570
|
+
class Lt extends G {
|
|
579
571
|
constructor(e) {
|
|
580
572
|
super(e);
|
|
581
573
|
}
|
|
@@ -589,15 +581,15 @@ class Ot extends G {
|
|
|
589
581
|
return /^(.*)\$$/;
|
|
590
582
|
}
|
|
591
583
|
search(e) {
|
|
592
|
-
const
|
|
584
|
+
const s = e.endsWith(this.pattern);
|
|
593
585
|
return {
|
|
594
|
-
isMatch:
|
|
595
|
-
score:
|
|
586
|
+
isMatch: s,
|
|
587
|
+
score: s ? 0 : 1,
|
|
596
588
|
indices: [e.length - this.pattern.length, e.length - 1]
|
|
597
589
|
};
|
|
598
590
|
}
|
|
599
591
|
}
|
|
600
|
-
class
|
|
592
|
+
class Pt extends G {
|
|
601
593
|
constructor(e) {
|
|
602
594
|
super(e);
|
|
603
595
|
}
|
|
@@ -611,36 +603,36 @@ class Nt extends G {
|
|
|
611
603
|
return /^!(.*)\$$/;
|
|
612
604
|
}
|
|
613
605
|
search(e) {
|
|
614
|
-
const
|
|
606
|
+
const s = !e.endsWith(this.pattern);
|
|
615
607
|
return {
|
|
616
|
-
isMatch:
|
|
617
|
-
score:
|
|
608
|
+
isMatch: s,
|
|
609
|
+
score: s ? 0 : 1,
|
|
618
610
|
indices: [0, e.length - 1]
|
|
619
611
|
};
|
|
620
612
|
}
|
|
621
613
|
}
|
|
622
614
|
class Oe extends G {
|
|
623
615
|
constructor(e, {
|
|
624
|
-
location:
|
|
625
|
-
threshold:
|
|
626
|
-
distance:
|
|
616
|
+
location: s = D.location,
|
|
617
|
+
threshold: n = D.threshold,
|
|
618
|
+
distance: a = D.distance,
|
|
627
619
|
includeMatches: r = D.includeMatches,
|
|
628
|
-
findAllMatches:
|
|
620
|
+
findAllMatches: i = D.findAllMatches,
|
|
629
621
|
minMatchCharLength: l = D.minMatchCharLength,
|
|
630
|
-
isCaseSensitive:
|
|
631
|
-
ignoreDiacritics:
|
|
632
|
-
ignoreLocation:
|
|
622
|
+
isCaseSensitive: p = D.isCaseSensitive,
|
|
623
|
+
ignoreDiacritics: o = D.ignoreDiacritics,
|
|
624
|
+
ignoreLocation: u = D.ignoreLocation
|
|
633
625
|
} = {}) {
|
|
634
626
|
super(e), this._bitapSearch = new Te(e, {
|
|
635
|
-
location:
|
|
636
|
-
threshold:
|
|
637
|
-
distance:
|
|
627
|
+
location: s,
|
|
628
|
+
threshold: n,
|
|
629
|
+
distance: a,
|
|
638
630
|
includeMatches: r,
|
|
639
|
-
findAllMatches:
|
|
631
|
+
findAllMatches: i,
|
|
640
632
|
minMatchCharLength: l,
|
|
641
|
-
isCaseSensitive:
|
|
642
|
-
ignoreDiacritics:
|
|
643
|
-
ignoreLocation:
|
|
633
|
+
isCaseSensitive: p,
|
|
634
|
+
ignoreDiacritics: o,
|
|
635
|
+
ignoreLocation: u
|
|
644
636
|
});
|
|
645
637
|
}
|
|
646
638
|
static get type() {
|
|
@@ -670,111 +662,111 @@ class Ne extends G {
|
|
|
670
662
|
return /^'(.*)$/;
|
|
671
663
|
}
|
|
672
664
|
search(e) {
|
|
673
|
-
let
|
|
674
|
-
const
|
|
675
|
-
for (; (
|
|
676
|
-
|
|
677
|
-
const
|
|
665
|
+
let s = 0, n;
|
|
666
|
+
const a = [], r = this.pattern.length;
|
|
667
|
+
for (; (n = e.indexOf(this.pattern, s)) > -1; )
|
|
668
|
+
s = n + r, a.push([n, s - 1]);
|
|
669
|
+
const i = !!a.length;
|
|
678
670
|
return {
|
|
679
|
-
isMatch:
|
|
680
|
-
score:
|
|
681
|
-
indices:
|
|
671
|
+
isMatch: i,
|
|
672
|
+
score: i ? 0 : 1,
|
|
673
|
+
indices: a
|
|
682
674
|
};
|
|
683
675
|
}
|
|
684
676
|
}
|
|
685
|
-
const
|
|
686
|
-
Rt,
|
|
687
|
-
Ne,
|
|
677
|
+
const ve = [
|
|
688
678
|
jt,
|
|
689
|
-
|
|
690
|
-
Nt,
|
|
679
|
+
Ne,
|
|
691
680
|
Ot,
|
|
692
|
-
|
|
681
|
+
Nt,
|
|
682
|
+
Pt,
|
|
683
|
+
Lt,
|
|
684
|
+
Tt,
|
|
693
685
|
Oe
|
|
694
|
-
],
|
|
695
|
-
function
|
|
696
|
-
return t.split(
|
|
697
|
-
let
|
|
698
|
-
for (let r = 0,
|
|
699
|
-
const l =
|
|
700
|
-
let
|
|
701
|
-
for (; !
|
|
702
|
-
const
|
|
703
|
-
let
|
|
704
|
-
|
|
686
|
+
], Me = ve.length, zt = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, Vt = "|";
|
|
687
|
+
function Ut(t, e = {}) {
|
|
688
|
+
return t.split(Vt).map((s) => {
|
|
689
|
+
let n = s.trim().split(zt).filter((r) => r && !!r.trim()), a = [];
|
|
690
|
+
for (let r = 0, i = n.length; r < i; r += 1) {
|
|
691
|
+
const l = n[r];
|
|
692
|
+
let p = !1, o = -1;
|
|
693
|
+
for (; !p && ++o < Me; ) {
|
|
694
|
+
const u = ve[o];
|
|
695
|
+
let v = u.isMultiMatch(l);
|
|
696
|
+
v && (a.push(new u(v, e)), p = !0);
|
|
705
697
|
}
|
|
706
|
-
if (!
|
|
707
|
-
for (
|
|
708
|
-
const
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
711
|
-
|
|
698
|
+
if (!p)
|
|
699
|
+
for (o = -1; ++o < Me; ) {
|
|
700
|
+
const u = ve[o];
|
|
701
|
+
let v = u.isSingleMatch(l);
|
|
702
|
+
if (v) {
|
|
703
|
+
a.push(new u(v, e));
|
|
712
704
|
break;
|
|
713
705
|
}
|
|
714
706
|
}
|
|
715
707
|
}
|
|
716
|
-
return
|
|
708
|
+
return a;
|
|
717
709
|
});
|
|
718
710
|
}
|
|
719
|
-
const
|
|
720
|
-
class
|
|
711
|
+
const Ht = /* @__PURE__ */ new Set([Oe.type, Ne.type]);
|
|
712
|
+
class Wt {
|
|
721
713
|
constructor(e, {
|
|
722
|
-
isCaseSensitive:
|
|
723
|
-
ignoreDiacritics:
|
|
724
|
-
includeMatches:
|
|
714
|
+
isCaseSensitive: s = D.isCaseSensitive,
|
|
715
|
+
ignoreDiacritics: n = D.ignoreDiacritics,
|
|
716
|
+
includeMatches: a = D.includeMatches,
|
|
725
717
|
minMatchCharLength: r = D.minMatchCharLength,
|
|
726
|
-
ignoreLocation:
|
|
718
|
+
ignoreLocation: i = D.ignoreLocation,
|
|
727
719
|
findAllMatches: l = D.findAllMatches,
|
|
728
|
-
location:
|
|
729
|
-
threshold:
|
|
730
|
-
distance:
|
|
720
|
+
location: p = D.location,
|
|
721
|
+
threshold: o = D.threshold,
|
|
722
|
+
distance: u = D.distance
|
|
731
723
|
} = {}) {
|
|
732
724
|
this.query = null, this.options = {
|
|
733
|
-
isCaseSensitive:
|
|
734
|
-
ignoreDiacritics:
|
|
735
|
-
includeMatches:
|
|
725
|
+
isCaseSensitive: s,
|
|
726
|
+
ignoreDiacritics: n,
|
|
727
|
+
includeMatches: a,
|
|
736
728
|
minMatchCharLength: r,
|
|
737
729
|
findAllMatches: l,
|
|
738
|
-
ignoreLocation:
|
|
739
|
-
location:
|
|
740
|
-
threshold:
|
|
741
|
-
distance:
|
|
742
|
-
}, e =
|
|
730
|
+
ignoreLocation: i,
|
|
731
|
+
location: p,
|
|
732
|
+
threshold: o,
|
|
733
|
+
distance: u
|
|
734
|
+
}, e = s ? e : e.toLowerCase(), e = n ? ie(e) : e, this.pattern = e, this.query = Ut(this.pattern, this.options);
|
|
743
735
|
}
|
|
744
|
-
static condition(e,
|
|
745
|
-
return
|
|
736
|
+
static condition(e, s) {
|
|
737
|
+
return s.useExtendedSearch;
|
|
746
738
|
}
|
|
747
739
|
searchIn(e) {
|
|
748
|
-
const
|
|
749
|
-
if (!
|
|
740
|
+
const s = this.query;
|
|
741
|
+
if (!s)
|
|
750
742
|
return {
|
|
751
743
|
isMatch: !1,
|
|
752
744
|
score: 1
|
|
753
745
|
};
|
|
754
|
-
const { includeMatches:
|
|
755
|
-
e =
|
|
756
|
-
let
|
|
757
|
-
for (let
|
|
758
|
-
const
|
|
759
|
-
l.length = 0,
|
|
760
|
-
for (let
|
|
761
|
-
const
|
|
746
|
+
const { includeMatches: n, isCaseSensitive: a, ignoreDiacritics: r } = this.options;
|
|
747
|
+
e = a ? e : e.toLowerCase(), e = r ? ie(e) : e;
|
|
748
|
+
let i = 0, l = [], p = 0;
|
|
749
|
+
for (let o = 0, u = s.length; o < u; o += 1) {
|
|
750
|
+
const v = s[o];
|
|
751
|
+
l.length = 0, i = 0;
|
|
752
|
+
for (let b = 0, h = v.length; b < h; b += 1) {
|
|
753
|
+
const d = v[b], { isMatch: x, indices: M, score: O } = d.search(e);
|
|
762
754
|
if (x) {
|
|
763
|
-
if (
|
|
764
|
-
const
|
|
765
|
-
|
|
755
|
+
if (i += 1, p += O, n) {
|
|
756
|
+
const I = d.constructor.type;
|
|
757
|
+
Ht.has(I) ? l.push(...M) : l.push(M);
|
|
766
758
|
}
|
|
767
759
|
} else {
|
|
768
|
-
|
|
760
|
+
p = 0, i = 0, l.length = 0;
|
|
769
761
|
break;
|
|
770
762
|
}
|
|
771
763
|
}
|
|
772
|
-
if (
|
|
773
|
-
let
|
|
764
|
+
if (i) {
|
|
765
|
+
let b = {
|
|
774
766
|
isMatch: !0,
|
|
775
|
-
score:
|
|
767
|
+
score: p / i
|
|
776
768
|
};
|
|
777
|
-
return
|
|
769
|
+
return n && (b.indices = l), b;
|
|
778
770
|
}
|
|
779
771
|
}
|
|
780
772
|
return {
|
|
@@ -783,123 +775,173 @@ class Ut {
|
|
|
783
775
|
};
|
|
784
776
|
}
|
|
785
777
|
}
|
|
786
|
-
const
|
|
787
|
-
function
|
|
788
|
-
|
|
778
|
+
const he = [];
|
|
779
|
+
function Le(...t) {
|
|
780
|
+
he.push(...t);
|
|
789
781
|
}
|
|
790
|
-
function
|
|
791
|
-
for (let
|
|
792
|
-
let
|
|
793
|
-
if (
|
|
794
|
-
return new
|
|
782
|
+
function Pe(t, e) {
|
|
783
|
+
for (let s = 0, n = he.length; s < n; s += 1) {
|
|
784
|
+
let a = he[s];
|
|
785
|
+
if (a.condition(t, e))
|
|
786
|
+
return new a(t, e);
|
|
795
787
|
}
|
|
796
788
|
return new Te(t, e);
|
|
797
789
|
}
|
|
798
|
-
const
|
|
790
|
+
const re = {
|
|
799
791
|
AND: "$and",
|
|
800
792
|
OR: "$or"
|
|
801
793
|
}, _e = {
|
|
802
794
|
PATH: "$path",
|
|
803
795
|
PATTERN: "$val"
|
|
804
|
-
}, xe = (t) => !!(t[
|
|
805
|
-
[
|
|
796
|
+
}, xe = (t) => !!(t[re.AND] || t[re.OR]), Kt = (t) => !!t[_e.PATH], Gt = (t) => !K(t) && Se(t) && !xe(t), Be = (t) => ({
|
|
797
|
+
[re.AND]: Object.keys(t).map((e) => ({
|
|
806
798
|
[e]: t[e]
|
|
807
799
|
}))
|
|
808
800
|
});
|
|
809
|
-
function
|
|
810
|
-
const
|
|
811
|
-
let r = Object.keys(
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
814
|
-
return
|
|
815
|
-
if (
|
|
816
|
-
const
|
|
817
|
-
if (!
|
|
818
|
-
throw new Error(
|
|
819
|
-
const
|
|
820
|
-
keyId:
|
|
821
|
-
pattern:
|
|
801
|
+
function ze(t, e, { auto: s = !0 } = {}) {
|
|
802
|
+
const n = (a) => {
|
|
803
|
+
let r = Object.keys(a);
|
|
804
|
+
const i = Kt(a);
|
|
805
|
+
if (!i && r.length > 1 && !xe(a))
|
|
806
|
+
return n(Be(a));
|
|
807
|
+
if (Gt(a)) {
|
|
808
|
+
const p = i ? a[_e.PATH] : r[0], o = i ? a[_e.PATTERN] : a[p];
|
|
809
|
+
if (!z(o))
|
|
810
|
+
throw new Error(_t(p));
|
|
811
|
+
const u = {
|
|
812
|
+
keyId: ge(p),
|
|
813
|
+
pattern: o
|
|
822
814
|
};
|
|
823
|
-
return
|
|
815
|
+
return s && (u.searcher = Pe(o, e)), u;
|
|
824
816
|
}
|
|
825
817
|
let l = {
|
|
826
818
|
children: [],
|
|
827
819
|
operator: r[0]
|
|
828
820
|
};
|
|
829
|
-
return r.forEach((
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
l.children.push(
|
|
821
|
+
return r.forEach((p) => {
|
|
822
|
+
const o = a[p];
|
|
823
|
+
K(o) && o.forEach((u) => {
|
|
824
|
+
l.children.push(n(u));
|
|
833
825
|
});
|
|
834
826
|
}), l;
|
|
835
827
|
};
|
|
836
|
-
return xe(t) || (t =
|
|
828
|
+
return xe(t) || (t = Be(t)), n(t);
|
|
829
|
+
}
|
|
830
|
+
function De(t, { ignoreFieldNorm: e = D.ignoreFieldNorm }) {
|
|
831
|
+
let s = 1;
|
|
832
|
+
t.matches.forEach(({ key: n, norm: a, score: r }) => {
|
|
833
|
+
const i = n ? n.weight : null;
|
|
834
|
+
s *= Math.pow(
|
|
835
|
+
r === 0 && i ? Number.EPSILON : r,
|
|
836
|
+
(i || 1) * (e ? 1 : a)
|
|
837
|
+
);
|
|
838
|
+
}), t.score = s;
|
|
837
839
|
}
|
|
838
|
-
function
|
|
839
|
-
t.forEach((
|
|
840
|
-
|
|
841
|
-
n.matches.forEach(({ key: i, norm: r, score: a }) => {
|
|
842
|
-
const l = i ? i.weight : null;
|
|
843
|
-
o *= Math.pow(
|
|
844
|
-
a === 0 && l ? Number.EPSILON : a,
|
|
845
|
-
(l || 1) * (e ? 1 : r)
|
|
846
|
-
);
|
|
847
|
-
}), n.score = o;
|
|
840
|
+
function Yt(t, { ignoreFieldNorm: e = D.ignoreFieldNorm }) {
|
|
841
|
+
t.forEach((s) => {
|
|
842
|
+
De(s, { ignoreFieldNorm: e });
|
|
848
843
|
});
|
|
849
844
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
845
|
+
class Qt {
|
|
846
|
+
constructor(e) {
|
|
847
|
+
this.limit = e, this.heap = [];
|
|
848
|
+
}
|
|
849
|
+
get size() {
|
|
850
|
+
return this.heap.length;
|
|
851
|
+
}
|
|
852
|
+
shouldInsert(e) {
|
|
853
|
+
return this.size < this.limit || e < this.heap[0].score;
|
|
854
|
+
}
|
|
855
|
+
insert(e) {
|
|
856
|
+
this.size < this.limit ? (this.heap.push(e), this._bubbleUp(this.size - 1)) : e.score < this.heap[0].score && (this.heap[0] = e, this._sinkDown(0));
|
|
857
|
+
}
|
|
858
|
+
extractSorted(e) {
|
|
859
|
+
return this.heap.sort(e);
|
|
860
|
+
}
|
|
861
|
+
_bubbleUp(e) {
|
|
862
|
+
const s = this.heap;
|
|
863
|
+
for (; e > 0; ) {
|
|
864
|
+
const n = e - 1 >> 1;
|
|
865
|
+
if (s[e].score <= s[n].score) break;
|
|
866
|
+
const a = s[e];
|
|
867
|
+
s[e] = s[n], s[n] = a, e = n;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
_sinkDown(e) {
|
|
871
|
+
const s = this.heap, n = s.length;
|
|
872
|
+
let a = e;
|
|
873
|
+
do {
|
|
874
|
+
e = a;
|
|
875
|
+
const r = 2 * e + 1, i = 2 * e + 2;
|
|
876
|
+
if (r < n && s[r].score > s[a].score && (a = r), i < n && s[i].score > s[a].score && (a = i), a !== e) {
|
|
877
|
+
const l = s[e];
|
|
878
|
+
s[e] = s[a], s[a] = l;
|
|
879
|
+
}
|
|
880
|
+
} while (a !== e);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
function Jt(t, e) {
|
|
884
|
+
const s = t.matches;
|
|
885
|
+
e.matches = [], P(s) && s.forEach((n) => {
|
|
886
|
+
if (!P(n.indices) || !n.indices.length)
|
|
854
887
|
return;
|
|
855
|
-
const { indices:
|
|
856
|
-
let
|
|
857
|
-
indices:
|
|
888
|
+
const { indices: a, value: r } = n;
|
|
889
|
+
let i = {
|
|
890
|
+
indices: a,
|
|
858
891
|
value: r
|
|
859
892
|
};
|
|
860
|
-
|
|
893
|
+
n.key && (i.key = n.key.src), n.idx > -1 && (i.refIndex = n.idx), e.matches.push(i);
|
|
861
894
|
});
|
|
862
895
|
}
|
|
863
|
-
function
|
|
896
|
+
function Xt(t, e) {
|
|
864
897
|
e.score = t.score;
|
|
865
898
|
}
|
|
866
|
-
function
|
|
867
|
-
includeMatches:
|
|
868
|
-
includeScore:
|
|
899
|
+
function Zt(t, e, {
|
|
900
|
+
includeMatches: s = D.includeMatches,
|
|
901
|
+
includeScore: n = D.includeScore
|
|
869
902
|
} = {}) {
|
|
870
|
-
const
|
|
871
|
-
return
|
|
872
|
-
const { idx:
|
|
873
|
-
item: e[
|
|
874
|
-
refIndex:
|
|
903
|
+
const a = [];
|
|
904
|
+
return s && a.push(Jt), n && a.push(Xt), t.map((r) => {
|
|
905
|
+
const { idx: i } = r, l = {
|
|
906
|
+
item: e[i],
|
|
907
|
+
refIndex: i
|
|
875
908
|
};
|
|
876
|
-
return
|
|
877
|
-
|
|
909
|
+
return a.length && a.forEach((p) => {
|
|
910
|
+
p(r, l);
|
|
878
911
|
}), l;
|
|
879
912
|
});
|
|
880
913
|
}
|
|
881
|
-
class
|
|
882
|
-
constructor(e,
|
|
883
|
-
this.options = { ...D, ...
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
if (this.
|
|
887
|
-
|
|
888
|
-
|
|
914
|
+
class q {
|
|
915
|
+
constructor(e, s = {}, n) {
|
|
916
|
+
this.options = { ...D, ...s }, this.options.useExtendedSearch, this._keyStore = new yt(this.options.keys), this.setCollection(e, n), this._lastQuery = null, this._lastSearcher = null;
|
|
917
|
+
}
|
|
918
|
+
_getSearcher(e) {
|
|
919
|
+
if (this._lastQuery === e)
|
|
920
|
+
return this._lastSearcher;
|
|
921
|
+
const s = Pe(e, this.options);
|
|
922
|
+
return this._lastQuery = e, this._lastSearcher = s, s;
|
|
923
|
+
}
|
|
924
|
+
setCollection(e, s) {
|
|
925
|
+
if (this._docs = e, s && !(s instanceof ye))
|
|
926
|
+
throw new Error(ht);
|
|
927
|
+
this._myIndex = s || je(this.options.keys, this._docs, {
|
|
889
928
|
getFn: this.options.getFn,
|
|
890
929
|
fieldNormWeight: this.options.fieldNormWeight
|
|
891
930
|
});
|
|
892
931
|
}
|
|
893
932
|
add(e) {
|
|
894
|
-
|
|
933
|
+
P(e) && (this._docs.push(e), this._myIndex.add(e));
|
|
895
934
|
}
|
|
896
935
|
remove(e = () => !1) {
|
|
897
|
-
const n = [];
|
|
898
|
-
for (let
|
|
899
|
-
|
|
900
|
-
|
|
936
|
+
const s = [], n = [];
|
|
937
|
+
for (let a = 0, r = this._docs.length; a < r; a += 1)
|
|
938
|
+
e(this._docs[a], a) && (s.push(this._docs[a]), n.push(a));
|
|
939
|
+
if (n.length) {
|
|
940
|
+
for (let a = n.length - 1; a >= 0; a -= 1)
|
|
941
|
+
this._docs.splice(n[a], 1);
|
|
942
|
+
this._myIndex.removeAll(n);
|
|
901
943
|
}
|
|
902
|
-
return
|
|
944
|
+
return s;
|
|
903
945
|
}
|
|
904
946
|
removeAt(e) {
|
|
905
947
|
this._docs.splice(e, 1), this._myIndex.removeAt(e);
|
|
@@ -907,126 +949,136 @@ class ee {
|
|
|
907
949
|
getIndex() {
|
|
908
950
|
return this._myIndex;
|
|
909
951
|
}
|
|
910
|
-
search(e, { limit:
|
|
952
|
+
search(e, { limit: s = -1 } = {}) {
|
|
911
953
|
const {
|
|
912
|
-
includeMatches:
|
|
913
|
-
includeScore:
|
|
954
|
+
includeMatches: n,
|
|
955
|
+
includeScore: a,
|
|
914
956
|
shouldSort: r,
|
|
915
|
-
sortFn:
|
|
957
|
+
sortFn: i,
|
|
916
958
|
ignoreFieldNorm: l
|
|
917
|
-
} = this.options;
|
|
918
|
-
let
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
959
|
+
} = this.options, p = me(s) && s > 0 && z(e);
|
|
960
|
+
let o;
|
|
961
|
+
if (p) {
|
|
962
|
+
const u = new Qt(s);
|
|
963
|
+
z(this._docs[0]) ? this._searchStringList(e, { heap: u, ignoreFieldNorm: l }) : this._searchObjectList(e, { heap: u, ignoreFieldNorm: l }), o = u.extractSorted(i);
|
|
964
|
+
} else
|
|
965
|
+
o = z(e) ? z(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), Yt(o, { ignoreFieldNorm: l }), r && o.sort(i), me(s) && s > -1 && (o = o.slice(0, s));
|
|
966
|
+
return Zt(o, this._docs, {
|
|
967
|
+
includeMatches: n,
|
|
968
|
+
includeScore: a
|
|
922
969
|
});
|
|
923
970
|
}
|
|
924
|
-
_searchStringList(e) {
|
|
925
|
-
const
|
|
926
|
-
return
|
|
927
|
-
if (!
|
|
971
|
+
_searchStringList(e, { heap: s, ignoreFieldNorm: n } = {}) {
|
|
972
|
+
const a = this._getSearcher(e), { records: r } = this._myIndex, i = s ? null : [];
|
|
973
|
+
return r.forEach(({ v: l, i: p, n: o }) => {
|
|
974
|
+
if (!P(l))
|
|
928
975
|
return;
|
|
929
|
-
const { isMatch:
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
976
|
+
const { isMatch: u, score: v, indices: b } = a.searchIn(l);
|
|
977
|
+
if (u) {
|
|
978
|
+
const h = {
|
|
979
|
+
item: l,
|
|
980
|
+
idx: p,
|
|
981
|
+
matches: [{ score: v, value: l, norm: o, indices: b }]
|
|
982
|
+
};
|
|
983
|
+
s ? (De(h, { ignoreFieldNorm: n }), s.shouldInsert(h.score) && s.insert(h)) : i.push(h);
|
|
984
|
+
}
|
|
935
985
|
}), i;
|
|
936
986
|
}
|
|
937
987
|
_searchLogical(e) {
|
|
938
|
-
const
|
|
988
|
+
const s = ze(e, this.options), n = (l, p, o) => {
|
|
939
989
|
if (!l.children) {
|
|
940
|
-
const { keyId:
|
|
941
|
-
key: this._keyStore.get(
|
|
942
|
-
value: this._myIndex.getValueForItemAtKeyId(
|
|
943
|
-
searcher:
|
|
990
|
+
const { keyId: v, searcher: b } = l, h = this._findMatches({
|
|
991
|
+
key: this._keyStore.get(v),
|
|
992
|
+
value: this._myIndex.getValueForItemAtKeyId(p, v),
|
|
993
|
+
searcher: b
|
|
944
994
|
});
|
|
945
|
-
return
|
|
995
|
+
return h && h.length ? [
|
|
946
996
|
{
|
|
947
|
-
idx:
|
|
948
|
-
item:
|
|
949
|
-
matches:
|
|
997
|
+
idx: o,
|
|
998
|
+
item: p,
|
|
999
|
+
matches: h
|
|
950
1000
|
}
|
|
951
1001
|
] : [];
|
|
952
1002
|
}
|
|
953
|
-
const
|
|
954
|
-
for (let
|
|
955
|
-
const
|
|
956
|
-
if (
|
|
957
|
-
|
|
958
|
-
else if (l.operator ===
|
|
1003
|
+
const u = [];
|
|
1004
|
+
for (let v = 0, b = l.children.length; v < b; v += 1) {
|
|
1005
|
+
const h = l.children[v], d = n(h, p, o);
|
|
1006
|
+
if (d.length)
|
|
1007
|
+
u.push(...d);
|
|
1008
|
+
else if (l.operator === re.AND)
|
|
959
1009
|
return [];
|
|
960
1010
|
}
|
|
961
|
-
return
|
|
962
|
-
},
|
|
963
|
-
return
|
|
964
|
-
if (
|
|
965
|
-
let
|
|
966
|
-
|
|
967
|
-
r
|
|
1011
|
+
return u;
|
|
1012
|
+
}, a = this._myIndex.records, r = /* @__PURE__ */ new Map(), i = [];
|
|
1013
|
+
return a.forEach(({ $: l, i: p }) => {
|
|
1014
|
+
if (P(l)) {
|
|
1015
|
+
let o = n(s, l, p);
|
|
1016
|
+
o.length && (r.has(p) || (r.set(p, { idx: p, item: l, matches: [] }), i.push(r.get(p))), o.forEach(({ matches: u }) => {
|
|
1017
|
+
r.get(p).matches.push(...u);
|
|
968
1018
|
}));
|
|
969
1019
|
}
|
|
970
|
-
}),
|
|
1020
|
+
}), i;
|
|
971
1021
|
}
|
|
972
|
-
_searchObjectList(e) {
|
|
973
|
-
const
|
|
974
|
-
return i.forEach(({ $:
|
|
975
|
-
if (!
|
|
1022
|
+
_searchObjectList(e, { heap: s, ignoreFieldNorm: n } = {}) {
|
|
1023
|
+
const a = this._getSearcher(e), { keys: r, records: i } = this._myIndex, l = s ? null : [];
|
|
1024
|
+
return i.forEach(({ $: p, i: o }) => {
|
|
1025
|
+
if (!P(p))
|
|
976
1026
|
return;
|
|
977
|
-
let
|
|
978
|
-
|
|
979
|
-
|
|
1027
|
+
let u = [];
|
|
1028
|
+
if (r.forEach((v, b) => {
|
|
1029
|
+
u.push(
|
|
980
1030
|
...this._findMatches({
|
|
981
|
-
key:
|
|
982
|
-
value:
|
|
983
|
-
searcher:
|
|
1031
|
+
key: v,
|
|
1032
|
+
value: p[b],
|
|
1033
|
+
searcher: a
|
|
984
1034
|
})
|
|
985
1035
|
);
|
|
986
|
-
}),
|
|
987
|
-
idx:
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
}), r;
|
|
1036
|
+
}), u.length) {
|
|
1037
|
+
const v = { idx: o, item: p, matches: u };
|
|
1038
|
+
s ? (De(v, { ignoreFieldNorm: n }), s.shouldInsert(v.score) && s.insert(v)) : l.push(v);
|
|
1039
|
+
}
|
|
1040
|
+
}), l;
|
|
992
1041
|
}
|
|
993
|
-
_findMatches({ key: e, value:
|
|
994
|
-
if (!
|
|
1042
|
+
_findMatches({ key: e, value: s, searcher: n }) {
|
|
1043
|
+
if (!P(s))
|
|
995
1044
|
return [];
|
|
996
|
-
let
|
|
997
|
-
if (
|
|
998
|
-
|
|
999
|
-
if (!
|
|
1045
|
+
let a = [];
|
|
1046
|
+
if (K(s))
|
|
1047
|
+
s.forEach(({ v: r, i, n: l }) => {
|
|
1048
|
+
if (!P(r))
|
|
1000
1049
|
return;
|
|
1001
|
-
const { isMatch:
|
|
1002
|
-
|
|
1003
|
-
score:
|
|
1050
|
+
const { isMatch: p, score: o, indices: u } = n.searchIn(r);
|
|
1051
|
+
p && a.push({
|
|
1052
|
+
score: o,
|
|
1004
1053
|
key: e,
|
|
1005
1054
|
value: r,
|
|
1006
|
-
idx:
|
|
1055
|
+
idx: i,
|
|
1007
1056
|
norm: l,
|
|
1008
|
-
indices:
|
|
1057
|
+
indices: u
|
|
1009
1058
|
});
|
|
1010
1059
|
});
|
|
1011
1060
|
else {
|
|
1012
|
-
const { v: r, n:
|
|
1013
|
-
l &&
|
|
1061
|
+
const { v: r, n: i } = s, { isMatch: l, score: p, indices: o } = n.searchIn(r);
|
|
1062
|
+
l && a.push({ score: p, key: e, value: r, norm: i, indices: o });
|
|
1014
1063
|
}
|
|
1015
|
-
return
|
|
1064
|
+
return a;
|
|
1016
1065
|
}
|
|
1017
1066
|
}
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1067
|
+
q.version = "7.2.0";
|
|
1068
|
+
q.createIndex = je;
|
|
1069
|
+
q.parseIndex = Bt;
|
|
1070
|
+
q.config = D;
|
|
1071
|
+
q.parseQuery = ze;
|
|
1072
|
+
Le(Wt);
|
|
1073
|
+
q.use = function(...t) {
|
|
1074
|
+
t.forEach((e) => Le(e));
|
|
1075
|
+
};
|
|
1076
|
+
const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, qt = (t) => {
|
|
1025
1077
|
if (!t) return "—";
|
|
1026
1078
|
if (t < 60) return `${t} min`;
|
|
1027
|
-
const e = Math.floor(t / 60),
|
|
1028
|
-
return
|
|
1029
|
-
},
|
|
1079
|
+
const e = Math.floor(t / 60), s = t % 60;
|
|
1080
|
+
return s > 0 ? `${e}h ${s}min` : `${e}h`;
|
|
1081
|
+
}, es = (t) => {
|
|
1030
1082
|
switch (t) {
|
|
1031
1083
|
case "confirmed":
|
|
1032
1084
|
return "Confirmed";
|
|
@@ -1039,7 +1091,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1039
1091
|
default:
|
|
1040
1092
|
return t || "Unknown";
|
|
1041
1093
|
}
|
|
1042
|
-
},
|
|
1094
|
+
}, Fe = (t) => {
|
|
1043
1095
|
switch (t) {
|
|
1044
1096
|
case "confirmed":
|
|
1045
1097
|
case "completed":
|
|
@@ -1054,8 +1106,8 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1054
1106
|
default:
|
|
1055
1107
|
return "#6b7280";
|
|
1056
1108
|
}
|
|
1057
|
-
},
|
|
1058
|
-
const
|
|
1109
|
+
}, ts = (t, e = {}) => {
|
|
1110
|
+
const s = `${t.customerInfo?.firstName || ""} ${t.customerInfo?.lastName || ""}`.trim() || "Unknown Customer", n = t.id?.slice(0, 8) || "—", a = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
1059
1111
|
year: "numeric",
|
|
1060
1112
|
month: "long",
|
|
1061
1113
|
day: "numeric"
|
|
@@ -1065,7 +1117,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1065
1117
|
<head>
|
|
1066
1118
|
<meta charset="UTF-8">
|
|
1067
1119
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1068
|
-
<title>Reservation ${
|
|
1120
|
+
<title>Reservation ${n}</title>
|
|
1069
1121
|
<style>
|
|
1070
1122
|
* {
|
|
1071
1123
|
margin: 0;
|
|
@@ -1276,12 +1328,12 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1276
1328
|
</div>
|
|
1277
1329
|
<div class="document-info">
|
|
1278
1330
|
<div class="document-title">Reservation</div>
|
|
1279
|
-
<div class="booking-id">Booking #${
|
|
1331
|
+
<div class="booking-id">Booking #${n}</div>
|
|
1280
1332
|
<div
|
|
1281
1333
|
class="status-badge"
|
|
1282
|
-
style="background-color: ${
|
|
1334
|
+
style="background-color: ${Fe(t.status)}20; color: ${Fe(t.status)};"
|
|
1283
1335
|
>
|
|
1284
|
-
${
|
|
1336
|
+
${es(t.status)}
|
|
1285
1337
|
</div>
|
|
1286
1338
|
</div>
|
|
1287
1339
|
</div>
|
|
@@ -1289,7 +1341,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1289
1341
|
<div class="section">
|
|
1290
1342
|
<div class="section-title">Customer</div>
|
|
1291
1343
|
<div class="section-content">
|
|
1292
|
-
<div class="customer-name">${
|
|
1344
|
+
<div class="customer-name">${s}</div>
|
|
1293
1345
|
<div class="contact-info">
|
|
1294
1346
|
${t.customerInfo?.email ? `<div>Email: <a href="mailto:${t.customerInfo.email}">${t.customerInfo.email}</a></div>` : ""}
|
|
1295
1347
|
${t.customerInfo?.phone ? `<div>Phone: <a href="tel:${t.customerInfo.phone}">${t.customerInfo.phone}</a></div>` : ""}
|
|
@@ -1334,7 +1386,7 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1334
1386
|
<div class="package-row">
|
|
1335
1387
|
<div>
|
|
1336
1388
|
<div class="package-name">${t.pricingOption.name}</div>
|
|
1337
|
-
<div class="package-duration">${
|
|
1389
|
+
<div class="package-duration">${qt(t.pricingOption.duration)}</div>
|
|
1338
1390
|
</div>
|
|
1339
1391
|
<div class="package-price">${Y(t.pricingOption.price)}</div>
|
|
1340
1392
|
</div>
|
|
@@ -1390,141 +1442,141 @@ const Y = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Xt = (t) => {
|
|
|
1390
1442
|
</div>
|
|
1391
1443
|
|
|
1392
1444
|
<div class="footer">
|
|
1393
|
-
<p>Generated on ${
|
|
1445
|
+
<p>Generated on ${a}</p>
|
|
1394
1446
|
${e.companyName ? `<p>${e.companyName}</p>` : ""}
|
|
1395
1447
|
</div>
|
|
1396
1448
|
</body>
|
|
1397
1449
|
</html>
|
|
1398
|
-
`,
|
|
1399
|
-
|
|
1400
|
-
|
|
1450
|
+
`, i = window.open("", "_blank");
|
|
1451
|
+
i && (i.document.write(r), i.document.close(), i.onload = () => {
|
|
1452
|
+
i.print();
|
|
1401
1453
|
});
|
|
1402
|
-
},
|
|
1454
|
+
}, ss = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, ns = { class: "grid gap-2" }, os = { class: "grid gap-2" }, as = { class: "grid gap-2" }, is = /* @__PURE__ */ te({
|
|
1403
1455
|
__name: "CancelReservationDialog",
|
|
1404
1456
|
emits: ["confirm"],
|
|
1405
|
-
setup(t, { expose: e, emit:
|
|
1406
|
-
const { config:
|
|
1407
|
-
l.value = !
|
|
1457
|
+
setup(t, { expose: e, emit: s }) {
|
|
1458
|
+
const { config: n } = se(), { sendMail: a } = be(n.mailAccount), r = s, i = $(!1), l = $(!1), p = $(""), o = $(""), u = $(""), v = (h) => {
|
|
1459
|
+
l.value = !n.mailAccount, i.value = !0, h && (p.value = h.customerInfo?.email, o.value = "Cancellation of your reservation - " + new Date(h.date)?.toDateString(), u.value = `Dear ${h.customerInfo?.firstName ?? ""} ${h.customerInfo?.lastName ?? ""},
|
|
1408
1460
|
|
|
1409
|
-
We are writing to inform you that your reservation scheduled for ${new Date(
|
|
1461
|
+
We are writing to inform you that your reservation scheduled for ${new Date(h.date)?.toDateString()} at ${h.startTime} has been cancelled.
|
|
1410
1462
|
|
|
1411
1463
|
Please accept our sincere apologies for any inconvenience this may cause. We would be happy to help you find an alternative time that works for you.`);
|
|
1412
|
-
},
|
|
1464
|
+
}, b = () => {
|
|
1413
1465
|
if (!l.value) {
|
|
1414
|
-
if (!
|
|
1415
|
-
|
|
1416
|
-
to:
|
|
1417
|
-
subject:
|
|
1418
|
-
body:
|
|
1466
|
+
if (!p.value || !o.value || !u.value) return alert("Please fill in all the fields.");
|
|
1467
|
+
a({
|
|
1468
|
+
to: p.value,
|
|
1469
|
+
subject: o.value,
|
|
1470
|
+
body: u.value
|
|
1419
1471
|
});
|
|
1420
1472
|
}
|
|
1421
|
-
|
|
1422
|
-
const { $confetti:
|
|
1423
|
-
|
|
1473
|
+
i.value = !1;
|
|
1474
|
+
const { $confetti: h } = useNuxtApp();
|
|
1475
|
+
h(), r("confirm");
|
|
1424
1476
|
};
|
|
1425
1477
|
return e({
|
|
1426
|
-
openDialog:
|
|
1427
|
-
}), (
|
|
1428
|
-
const x =
|
|
1429
|
-
return R(), J(
|
|
1430
|
-
open:
|
|
1431
|
-
"onUpdate:open":
|
|
1478
|
+
openDialog: v
|
|
1479
|
+
}), (h, d) => {
|
|
1480
|
+
const x = _("DialogTitle"), M = _("DialogDescription"), O = _("DialogHeader"), I = _("Checkbox"), w = _("Label"), B = _("Input"), N = _("Textarea"), H = _("Button"), V = _("DialogFooter"), E = _("DialogScrollContent"), j = _("Dialog");
|
|
1481
|
+
return R(), J(j, {
|
|
1482
|
+
open: i.value,
|
|
1483
|
+
"onUpdate:open": d[5] || (d[5] = (y) => i.value = y)
|
|
1432
1484
|
}, {
|
|
1433
1485
|
default: g(() => [
|
|
1434
|
-
|
|
1486
|
+
c(E, { class: "sm:max-w-3xl" }, {
|
|
1435
1487
|
default: g(() => [
|
|
1436
|
-
|
|
1488
|
+
c(O, null, {
|
|
1437
1489
|
default: g(() => [
|
|
1438
|
-
|
|
1439
|
-
default: g(() => [...
|
|
1490
|
+
c(x, null, {
|
|
1491
|
+
default: g(() => [...d[6] || (d[6] = [
|
|
1440
1492
|
A(" Cancel Reservation ", -1)
|
|
1441
1493
|
])]),
|
|
1442
1494
|
_: 1
|
|
1443
1495
|
}),
|
|
1444
|
-
|
|
1496
|
+
c(M)
|
|
1445
1497
|
]),
|
|
1446
1498
|
_: 1
|
|
1447
1499
|
}),
|
|
1448
|
-
m("div",
|
|
1449
|
-
|
|
1500
|
+
m("div", ss, [
|
|
1501
|
+
c(I, {
|
|
1450
1502
|
modelValue: l.value,
|
|
1451
|
-
"onUpdate:modelValue":
|
|
1503
|
+
"onUpdate:modelValue": d[0] || (d[0] = (y) => l.value = y),
|
|
1452
1504
|
id: "cancel-dialog-skip-mail",
|
|
1453
1505
|
class: "border-black/80 dark:border-gray-200",
|
|
1454
|
-
disabled: !
|
|
1506
|
+
disabled: !S(n).mailAccount
|
|
1455
1507
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1456
|
-
|
|
1508
|
+
c(w, {
|
|
1457
1509
|
for: "cancel-dialog-skip-mail",
|
|
1458
1510
|
class: "py-4 pl-2 pr-4"
|
|
1459
1511
|
}, {
|
|
1460
|
-
default: g(() => [...
|
|
1512
|
+
default: g(() => [...d[7] || (d[7] = [
|
|
1461
1513
|
A("Do not send email to customer", -1)
|
|
1462
1514
|
])]),
|
|
1463
1515
|
_: 1
|
|
1464
1516
|
})
|
|
1465
1517
|
]),
|
|
1466
1518
|
m("div", {
|
|
1467
|
-
class:
|
|
1519
|
+
class: le(["grid gap-4 py-4", { "opacity-50": l.value }])
|
|
1468
1520
|
}, [
|
|
1469
|
-
m("div",
|
|
1470
|
-
|
|
1471
|
-
default: g(() => [...
|
|
1521
|
+
m("div", ns, [
|
|
1522
|
+
c(w, { for: "cancel-dialog-email" }, {
|
|
1523
|
+
default: g(() => [...d[8] || (d[8] = [
|
|
1472
1524
|
A("To:", -1)
|
|
1473
1525
|
])]),
|
|
1474
1526
|
_: 1
|
|
1475
1527
|
}),
|
|
1476
|
-
|
|
1477
|
-
modelValue:
|
|
1478
|
-
"onUpdate:modelValue":
|
|
1528
|
+
c(B, {
|
|
1529
|
+
modelValue: p.value,
|
|
1530
|
+
"onUpdate:modelValue": d[1] || (d[1] = (y) => p.value = y),
|
|
1479
1531
|
disabled: l.value,
|
|
1480
1532
|
id: "cancel-dialog-email"
|
|
1481
1533
|
}, null, 8, ["modelValue", "disabled"])
|
|
1482
1534
|
]),
|
|
1483
|
-
m("div",
|
|
1484
|
-
|
|
1485
|
-
default: g(() => [...
|
|
1535
|
+
m("div", os, [
|
|
1536
|
+
c(w, { for: "cancel-dialog-subject" }, {
|
|
1537
|
+
default: g(() => [...d[9] || (d[9] = [
|
|
1486
1538
|
A("Subject:", -1)
|
|
1487
1539
|
])]),
|
|
1488
1540
|
_: 1
|
|
1489
1541
|
}),
|
|
1490
|
-
|
|
1491
|
-
modelValue:
|
|
1492
|
-
"onUpdate:modelValue":
|
|
1542
|
+
c(B, {
|
|
1543
|
+
modelValue: o.value,
|
|
1544
|
+
"onUpdate:modelValue": d[2] || (d[2] = (y) => o.value = y),
|
|
1493
1545
|
disabled: l.value,
|
|
1494
1546
|
id: "cancel-dialog-subject"
|
|
1495
1547
|
}, null, 8, ["modelValue", "disabled"])
|
|
1496
1548
|
]),
|
|
1497
|
-
m("div",
|
|
1498
|
-
|
|
1499
|
-
default: g(() => [...
|
|
1549
|
+
m("div", as, [
|
|
1550
|
+
c(w, { for: "cancel-dialog-body" }, {
|
|
1551
|
+
default: g(() => [...d[10] || (d[10] = [
|
|
1500
1552
|
A("Body:", -1)
|
|
1501
1553
|
])]),
|
|
1502
1554
|
_: 1
|
|
1503
1555
|
}),
|
|
1504
|
-
|
|
1505
|
-
modelValue:
|
|
1506
|
-
"onUpdate:modelValue":
|
|
1556
|
+
c(N, {
|
|
1557
|
+
modelValue: u.value,
|
|
1558
|
+
"onUpdate:modelValue": d[3] || (d[3] = (y) => u.value = y),
|
|
1507
1559
|
disabled: l.value,
|
|
1508
1560
|
id: "cancel-dialog-body"
|
|
1509
1561
|
}, null, 8, ["modelValue", "disabled"])
|
|
1510
1562
|
])
|
|
1511
1563
|
], 2),
|
|
1512
|
-
|
|
1564
|
+
c(V, null, {
|
|
1513
1565
|
default: g(() => [
|
|
1514
|
-
|
|
1566
|
+
c(H, {
|
|
1515
1567
|
variant: "outline",
|
|
1516
|
-
onClick:
|
|
1568
|
+
onClick: d[4] || (d[4] = (y) => i.value = !1)
|
|
1517
1569
|
}, {
|
|
1518
|
-
default: g(() => [...
|
|
1570
|
+
default: g(() => [...d[11] || (d[11] = [
|
|
1519
1571
|
A("Close", -1)
|
|
1520
1572
|
])]),
|
|
1521
1573
|
_: 1
|
|
1522
1574
|
}),
|
|
1523
|
-
|
|
1575
|
+
c(H, {
|
|
1524
1576
|
variant: "destructive",
|
|
1525
|
-
onClick:
|
|
1577
|
+
onClick: b
|
|
1526
1578
|
}, {
|
|
1527
|
-
default: g(() => [...
|
|
1579
|
+
default: g(() => [...d[12] || (d[12] = [
|
|
1528
1580
|
A("Cancel reservation", -1)
|
|
1529
1581
|
])]),
|
|
1530
1582
|
_: 1
|
|
@@ -1540,51 +1592,51 @@ Please accept our sincere apologies for any inconvenience this may cause. We wou
|
|
|
1540
1592
|
}, 8, ["open"]);
|
|
1541
1593
|
};
|
|
1542
1594
|
}
|
|
1543
|
-
}),
|
|
1595
|
+
}), rs = /* @__PURE__ */ te({
|
|
1544
1596
|
__name: "TransferReservationDialog",
|
|
1545
1597
|
setup(t, { expose: e }) {
|
|
1546
|
-
const { config:
|
|
1598
|
+
const { config: s } = se(), n = $(!1);
|
|
1547
1599
|
return e({
|
|
1548
1600
|
openDialog: () => {
|
|
1549
|
-
|
|
1601
|
+
n.value = !0;
|
|
1550
1602
|
}
|
|
1551
|
-
}), (r,
|
|
1552
|
-
const l =
|
|
1553
|
-
return R(), J(
|
|
1554
|
-
open:
|
|
1555
|
-
"onUpdate:open":
|
|
1603
|
+
}), (r, i) => {
|
|
1604
|
+
const l = _("DialogTitle"), p = _("DialogDescription"), o = _("DialogHeader"), u = _("Button"), v = _("DialogFooter"), b = _("DialogScrollContent"), h = _("Dialog");
|
|
1605
|
+
return R(), J(h, {
|
|
1606
|
+
open: n.value,
|
|
1607
|
+
"onUpdate:open": i[2] || (i[2] = (d) => n.value = d)
|
|
1556
1608
|
}, {
|
|
1557
1609
|
default: g(() => [
|
|
1558
|
-
|
|
1610
|
+
c(b, { class: "sm:max-w-3xl" }, {
|
|
1559
1611
|
default: g(() => [
|
|
1560
|
-
|
|
1612
|
+
c(o, null, {
|
|
1561
1613
|
default: g(() => [
|
|
1562
|
-
|
|
1563
|
-
default: g(() => [...
|
|
1614
|
+
c(l, null, {
|
|
1615
|
+
default: g(() => [...i[3] || (i[3] = [
|
|
1564
1616
|
A(" Transfer Reservation ", -1)
|
|
1565
1617
|
])]),
|
|
1566
1618
|
_: 1
|
|
1567
1619
|
}),
|
|
1568
|
-
|
|
1620
|
+
c(p)
|
|
1569
1621
|
]),
|
|
1570
1622
|
_: 1
|
|
1571
1623
|
}),
|
|
1572
|
-
|
|
1573
|
-
|
|
1624
|
+
i[6] || (i[6] = m("div", { class: "py-4" }, null, -1)),
|
|
1625
|
+
c(v, null, {
|
|
1574
1626
|
default: g(() => [
|
|
1575
|
-
u
|
|
1627
|
+
c(u, {
|
|
1576
1628
|
variant: "outline",
|
|
1577
|
-
onClick:
|
|
1629
|
+
onClick: i[0] || (i[0] = (d) => n.value = !1)
|
|
1578
1630
|
}, {
|
|
1579
|
-
default: g(() => [...
|
|
1631
|
+
default: g(() => [...i[4] || (i[4] = [
|
|
1580
1632
|
A("Close", -1)
|
|
1581
1633
|
])]),
|
|
1582
1634
|
_: 1
|
|
1583
1635
|
}),
|
|
1584
|
-
u
|
|
1585
|
-
onClick:
|
|
1636
|
+
c(u, {
|
|
1637
|
+
onClick: i[1] || (i[1] = (d) => n.value = !1)
|
|
1586
1638
|
}, {
|
|
1587
|
-
default: g(() => [...
|
|
1639
|
+
default: g(() => [...i[5] || (i[5] = [
|
|
1588
1640
|
A("Transfer reservation", -1)
|
|
1589
1641
|
])]),
|
|
1590
1642
|
_: 1
|
|
@@ -1600,61 +1652,61 @@ Please accept our sincere apologies for any inconvenience this may cause. We wou
|
|
|
1600
1652
|
}, 8, ["open"]);
|
|
1601
1653
|
};
|
|
1602
1654
|
}
|
|
1603
|
-
}),
|
|
1655
|
+
}), ls = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, us = { class: "grid gap-2" }, cs = { class: "grid gap-2" }, ds = { class: "grid gap-2" }, ps = /* @__PURE__ */ te({
|
|
1604
1656
|
__name: "ApproveReservationDialog",
|
|
1605
1657
|
emits: ["confirm"],
|
|
1606
|
-
setup(t, { expose: e, emit:
|
|
1607
|
-
const { config:
|
|
1608
|
-
|
|
1658
|
+
setup(t, { expose: e, emit: s }) {
|
|
1659
|
+
const { config: n } = se(), { sendMail: a } = be(n.mailAccount), r = s, i = $(!1), l = $("approve"), p = $(!1), o = $(""), u = $(""), v = $(""), b = (d, x) => {
|
|
1660
|
+
p.value = !n.mailAccount, i.value = !0, d && (x || (x = "approve"), l.value = x, o.value = d.customerInfo?.email, u.value = "Confirmation: Your reservation for " + new Date(d.date)?.toDateString(), v.value = `Dear ${d.customerInfo?.firstName ?? ""} ${d.customerInfo?.lastName ?? ""},
|
|
1609
1661
|
|
|
1610
|
-
This email confirms your reservation for ${new Date(
|
|
1662
|
+
This email confirms your reservation for ${new Date(d.date)?.toDateString()} at ${d.startTime}.
|
|
1611
1663
|
|
|
1612
1664
|
We've got everything ready for you and look forward to your visit! If you need to make any changes or have special requests, please let us know.`);
|
|
1613
|
-
},
|
|
1614
|
-
if (!
|
|
1615
|
-
if (!
|
|
1616
|
-
|
|
1617
|
-
to:
|
|
1618
|
-
subject:
|
|
1619
|
-
body:
|
|
1665
|
+
}, h = () => {
|
|
1666
|
+
if (!p.value) {
|
|
1667
|
+
if (!o.value || !u.value || !v.value) return alert("Please fill in all the fields.");
|
|
1668
|
+
a({
|
|
1669
|
+
to: o.value,
|
|
1670
|
+
subject: u.value,
|
|
1671
|
+
body: v.value
|
|
1620
1672
|
});
|
|
1621
1673
|
}
|
|
1622
|
-
|
|
1623
|
-
const { $confetti:
|
|
1624
|
-
|
|
1674
|
+
i.value = !1;
|
|
1675
|
+
const { $confetti: d } = useNuxtApp();
|
|
1676
|
+
d(), r("confirm");
|
|
1625
1677
|
};
|
|
1626
1678
|
return e({
|
|
1627
|
-
openDialog:
|
|
1628
|
-
}), (
|
|
1629
|
-
const
|
|
1630
|
-
return R(), J(
|
|
1631
|
-
open:
|
|
1632
|
-
"onUpdate:open": x[5] || (x[5] = (
|
|
1679
|
+
openDialog: b
|
|
1680
|
+
}), (d, x) => {
|
|
1681
|
+
const M = _("DialogTitle"), O = _("DialogDescription"), I = _("DialogHeader"), w = _("Checkbox"), B = _("Label"), N = _("Input"), H = _("Textarea"), V = _("Button"), E = _("DialogFooter"), j = _("DialogScrollContent"), y = _("Dialog");
|
|
1682
|
+
return R(), J(y, {
|
|
1683
|
+
open: i.value,
|
|
1684
|
+
"onUpdate:open": x[5] || (x[5] = (T) => i.value = T)
|
|
1633
1685
|
}, {
|
|
1634
1686
|
default: g(() => [
|
|
1635
|
-
|
|
1687
|
+
c(j, { class: "sm:max-w-3xl" }, {
|
|
1636
1688
|
default: g(() => [
|
|
1637
|
-
|
|
1689
|
+
c(I, null, {
|
|
1638
1690
|
default: g(() => [
|
|
1639
|
-
|
|
1691
|
+
c(M, null, {
|
|
1640
1692
|
default: g(() => [
|
|
1641
1693
|
A(F(l.value === "approve" ? "Approve Reservation" : "Resend Confirmation Email"), 1)
|
|
1642
1694
|
]),
|
|
1643
1695
|
_: 1
|
|
1644
1696
|
}),
|
|
1645
|
-
|
|
1697
|
+
c(O)
|
|
1646
1698
|
]),
|
|
1647
1699
|
_: 1
|
|
1648
1700
|
}),
|
|
1649
|
-
m("div",
|
|
1650
|
-
|
|
1651
|
-
modelValue:
|
|
1652
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
1701
|
+
m("div", ls, [
|
|
1702
|
+
c(w, {
|
|
1703
|
+
modelValue: p.value,
|
|
1704
|
+
"onUpdate:modelValue": x[0] || (x[0] = (T) => p.value = T),
|
|
1653
1705
|
id: "reject-dialog-skip-mail",
|
|
1654
1706
|
class: "border-black/80 dark:border-gray-200",
|
|
1655
|
-
disabled: !
|
|
1707
|
+
disabled: !S(n).mailAccount
|
|
1656
1708
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1657
|
-
|
|
1709
|
+
c(B, {
|
|
1658
1710
|
for: "reject-dialog-skip-mail",
|
|
1659
1711
|
class: "py-4 pl-2 pr-4"
|
|
1660
1712
|
}, {
|
|
@@ -1665,63 +1717,63 @@ We've got everything ready for you and look forward to your visit! If you need t
|
|
|
1665
1717
|
})
|
|
1666
1718
|
]),
|
|
1667
1719
|
m("div", {
|
|
1668
|
-
class:
|
|
1720
|
+
class: le(["grid gap-4 py-4", { "opacity-50": p.value }])
|
|
1669
1721
|
}, [
|
|
1670
|
-
m("div",
|
|
1671
|
-
|
|
1722
|
+
m("div", us, [
|
|
1723
|
+
c(B, { for: "approve-dialog-email" }, {
|
|
1672
1724
|
default: g(() => [...x[7] || (x[7] = [
|
|
1673
1725
|
A("To:", -1)
|
|
1674
1726
|
])]),
|
|
1675
1727
|
_: 1
|
|
1676
1728
|
}),
|
|
1677
|
-
|
|
1678
|
-
modelValue:
|
|
1679
|
-
"onUpdate:modelValue": x[1] || (x[1] = (
|
|
1680
|
-
disabled:
|
|
1729
|
+
c(N, {
|
|
1730
|
+
modelValue: o.value,
|
|
1731
|
+
"onUpdate:modelValue": x[1] || (x[1] = (T) => o.value = T),
|
|
1732
|
+
disabled: p.value,
|
|
1681
1733
|
id: "approve-dialog-email"
|
|
1682
1734
|
}, null, 8, ["modelValue", "disabled"])
|
|
1683
1735
|
]),
|
|
1684
|
-
m("div",
|
|
1685
|
-
|
|
1736
|
+
m("div", cs, [
|
|
1737
|
+
c(B, { for: "approve-dialog-subject" }, {
|
|
1686
1738
|
default: g(() => [...x[8] || (x[8] = [
|
|
1687
1739
|
A("Subject:", -1)
|
|
1688
1740
|
])]),
|
|
1689
1741
|
_: 1
|
|
1690
1742
|
}),
|
|
1691
|
-
|
|
1692
|
-
modelValue:
|
|
1693
|
-
"onUpdate:modelValue": x[2] || (x[2] = (
|
|
1694
|
-
disabled:
|
|
1743
|
+
c(N, {
|
|
1744
|
+
modelValue: u.value,
|
|
1745
|
+
"onUpdate:modelValue": x[2] || (x[2] = (T) => u.value = T),
|
|
1746
|
+
disabled: p.value,
|
|
1695
1747
|
id: "approve-dialog-subject"
|
|
1696
1748
|
}, null, 8, ["modelValue", "disabled"])
|
|
1697
1749
|
]),
|
|
1698
|
-
m("div",
|
|
1699
|
-
|
|
1750
|
+
m("div", ds, [
|
|
1751
|
+
c(B, { for: "approve-dialog-body" }, {
|
|
1700
1752
|
default: g(() => [...x[9] || (x[9] = [
|
|
1701
1753
|
A("Body:", -1)
|
|
1702
1754
|
])]),
|
|
1703
1755
|
_: 1
|
|
1704
1756
|
}),
|
|
1705
|
-
|
|
1706
|
-
modelValue:
|
|
1707
|
-
"onUpdate:modelValue": x[3] || (x[3] = (
|
|
1708
|
-
disabled:
|
|
1757
|
+
c(H, {
|
|
1758
|
+
modelValue: v.value,
|
|
1759
|
+
"onUpdate:modelValue": x[3] || (x[3] = (T) => v.value = T),
|
|
1760
|
+
disabled: p.value,
|
|
1709
1761
|
id: "approve-dialog-body"
|
|
1710
1762
|
}, null, 8, ["modelValue", "disabled"])
|
|
1711
1763
|
])
|
|
1712
1764
|
], 2),
|
|
1713
|
-
|
|
1765
|
+
c(E, null, {
|
|
1714
1766
|
default: g(() => [
|
|
1715
|
-
|
|
1767
|
+
c(V, {
|
|
1716
1768
|
variant: "outline",
|
|
1717
|
-
onClick: x[4] || (x[4] = (
|
|
1769
|
+
onClick: x[4] || (x[4] = (T) => i.value = !1)
|
|
1718
1770
|
}, {
|
|
1719
1771
|
default: g(() => [...x[10] || (x[10] = [
|
|
1720
1772
|
A("Close", -1)
|
|
1721
1773
|
])]),
|
|
1722
1774
|
_: 1
|
|
1723
1775
|
}),
|
|
1724
|
-
|
|
1776
|
+
c(V, { onClick: h }, {
|
|
1725
1777
|
default: g(() => [...x[11] || (x[11] = [
|
|
1726
1778
|
A("Approve reservation", -1)
|
|
1727
1779
|
])]),
|
|
@@ -1738,132 +1790,132 @@ We've got everything ready for you and look forward to your visit! If you need t
|
|
|
1738
1790
|
}, 8, ["open"]);
|
|
1739
1791
|
};
|
|
1740
1792
|
}
|
|
1741
|
-
}),
|
|
1793
|
+
}), fs = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, ms = { class: "grid gap-2" }, gs = { class: "grid gap-2" }, vs = { class: "grid gap-2" }, hs = /* @__PURE__ */ te({
|
|
1742
1794
|
__name: "RejectReservationDialog",
|
|
1743
1795
|
emits: ["confirm"],
|
|
1744
|
-
setup(t, { expose: e, emit:
|
|
1745
|
-
const { config:
|
|
1746
|
-
l.value = !
|
|
1796
|
+
setup(t, { expose: e, emit: s }) {
|
|
1797
|
+
const { config: n } = se(), { sendMail: a } = be(n.mailAccount), r = s, i = $(!1), l = $(!1), p = $(""), o = $(""), u = $(""), v = (h) => {
|
|
1798
|
+
l.value = !n.mailAccount, i.value = !0, h && (p.value = h.customerInfo?.email, o.value = "Regarding your reservation request for " + new Date(h.date)?.toDateString(), u.value = `Dear ${h.customerInfo?.firstName ?? ""} ${h.customerInfo?.lastName ?? ""},
|
|
1747
1799
|
|
|
1748
|
-
Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(
|
|
1800
|
+
Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(h.date)?.toDateString()} at ${h.startTime}.
|
|
1749
1801
|
|
|
1750
1802
|
We would love to see you another time!`);
|
|
1751
|
-
},
|
|
1803
|
+
}, b = () => {
|
|
1752
1804
|
if (!l.value) {
|
|
1753
|
-
if (!
|
|
1754
|
-
|
|
1755
|
-
to:
|
|
1756
|
-
subject:
|
|
1757
|
-
body:
|
|
1805
|
+
if (!p.value || !o.value || !u.value) return alert("Please fill in all the fields.");
|
|
1806
|
+
a({
|
|
1807
|
+
to: p.value,
|
|
1808
|
+
subject: o.value,
|
|
1809
|
+
body: u.value
|
|
1758
1810
|
});
|
|
1759
1811
|
}
|
|
1760
|
-
|
|
1761
|
-
const { $confetti:
|
|
1762
|
-
|
|
1812
|
+
i.value = !1;
|
|
1813
|
+
const { $confetti: h } = useNuxtApp();
|
|
1814
|
+
h(), r("confirm");
|
|
1763
1815
|
};
|
|
1764
1816
|
return e({
|
|
1765
|
-
openDialog:
|
|
1766
|
-
}), (
|
|
1767
|
-
const x =
|
|
1768
|
-
return R(), J(
|
|
1769
|
-
open:
|
|
1770
|
-
"onUpdate:open":
|
|
1817
|
+
openDialog: v
|
|
1818
|
+
}), (h, d) => {
|
|
1819
|
+
const x = _("DialogTitle"), M = _("DialogDescription"), O = _("DialogHeader"), I = _("Checkbox"), w = _("Label"), B = _("Input"), N = _("Textarea"), H = _("Button"), V = _("DialogFooter"), E = _("DialogScrollContent"), j = _("Dialog");
|
|
1820
|
+
return R(), J(j, {
|
|
1821
|
+
open: i.value,
|
|
1822
|
+
"onUpdate:open": d[5] || (d[5] = (y) => i.value = y)
|
|
1771
1823
|
}, {
|
|
1772
1824
|
default: g(() => [
|
|
1773
|
-
|
|
1825
|
+
c(E, { class: "sm:max-w-3xl" }, {
|
|
1774
1826
|
default: g(() => [
|
|
1775
|
-
|
|
1827
|
+
c(O, null, {
|
|
1776
1828
|
default: g(() => [
|
|
1777
|
-
|
|
1778
|
-
default: g(() => [...
|
|
1829
|
+
c(x, null, {
|
|
1830
|
+
default: g(() => [...d[6] || (d[6] = [
|
|
1779
1831
|
A(" Reject Reservation Request ", -1)
|
|
1780
1832
|
])]),
|
|
1781
1833
|
_: 1
|
|
1782
1834
|
}),
|
|
1783
|
-
|
|
1835
|
+
c(M)
|
|
1784
1836
|
]),
|
|
1785
1837
|
_: 1
|
|
1786
1838
|
}),
|
|
1787
|
-
m("div",
|
|
1788
|
-
|
|
1839
|
+
m("div", fs, [
|
|
1840
|
+
c(I, {
|
|
1789
1841
|
modelValue: l.value,
|
|
1790
|
-
"onUpdate:modelValue":
|
|
1842
|
+
"onUpdate:modelValue": d[0] || (d[0] = (y) => l.value = y),
|
|
1791
1843
|
id: "reject-dialog-skip-mail",
|
|
1792
1844
|
class: "border-black/80 dark:border-gray-200",
|
|
1793
|
-
disabled: !
|
|
1845
|
+
disabled: !S(n).mailAccount
|
|
1794
1846
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1795
|
-
|
|
1847
|
+
c(w, {
|
|
1796
1848
|
for: "reject-dialog-skip-mail",
|
|
1797
1849
|
class: "py-4 pl-2 pr-4"
|
|
1798
1850
|
}, {
|
|
1799
|
-
default: g(() => [...
|
|
1851
|
+
default: g(() => [...d[7] || (d[7] = [
|
|
1800
1852
|
A("Do not send email to customer", -1)
|
|
1801
1853
|
])]),
|
|
1802
1854
|
_: 1
|
|
1803
1855
|
})
|
|
1804
1856
|
]),
|
|
1805
1857
|
m("div", {
|
|
1806
|
-
class:
|
|
1858
|
+
class: le(["grid gap-4 py-4", { "opacity-50": l.value }])
|
|
1807
1859
|
}, [
|
|
1808
|
-
m("div",
|
|
1809
|
-
|
|
1810
|
-
default: g(() => [...
|
|
1860
|
+
m("div", ms, [
|
|
1861
|
+
c(w, { for: "reject-dialog-email" }, {
|
|
1862
|
+
default: g(() => [...d[8] || (d[8] = [
|
|
1811
1863
|
A("To:", -1)
|
|
1812
1864
|
])]),
|
|
1813
1865
|
_: 1
|
|
1814
1866
|
}),
|
|
1815
|
-
|
|
1816
|
-
modelValue:
|
|
1817
|
-
"onUpdate:modelValue":
|
|
1867
|
+
c(B, {
|
|
1868
|
+
modelValue: p.value,
|
|
1869
|
+
"onUpdate:modelValue": d[1] || (d[1] = (y) => p.value = y),
|
|
1818
1870
|
disabled: l.value,
|
|
1819
1871
|
id: "reject-dialog-email"
|
|
1820
1872
|
}, null, 8, ["modelValue", "disabled"])
|
|
1821
1873
|
]),
|
|
1822
|
-
m("div",
|
|
1823
|
-
|
|
1824
|
-
default: g(() => [...
|
|
1874
|
+
m("div", gs, [
|
|
1875
|
+
c(w, { for: "reject-dialog-subject" }, {
|
|
1876
|
+
default: g(() => [...d[9] || (d[9] = [
|
|
1825
1877
|
A("Subject:", -1)
|
|
1826
1878
|
])]),
|
|
1827
1879
|
_: 1
|
|
1828
1880
|
}),
|
|
1829
|
-
|
|
1830
|
-
modelValue:
|
|
1831
|
-
"onUpdate:modelValue":
|
|
1881
|
+
c(B, {
|
|
1882
|
+
modelValue: o.value,
|
|
1883
|
+
"onUpdate:modelValue": d[2] || (d[2] = (y) => o.value = y),
|
|
1832
1884
|
disabled: l.value,
|
|
1833
1885
|
id: "reject-dialog-subject"
|
|
1834
1886
|
}, null, 8, ["modelValue", "disabled"])
|
|
1835
1887
|
]),
|
|
1836
|
-
m("div",
|
|
1837
|
-
|
|
1838
|
-
default: g(() => [...
|
|
1888
|
+
m("div", vs, [
|
|
1889
|
+
c(w, { for: "reject-dialog-body" }, {
|
|
1890
|
+
default: g(() => [...d[10] || (d[10] = [
|
|
1839
1891
|
A("Body:", -1)
|
|
1840
1892
|
])]),
|
|
1841
1893
|
_: 1
|
|
1842
1894
|
}),
|
|
1843
|
-
|
|
1844
|
-
modelValue:
|
|
1845
|
-
"onUpdate:modelValue":
|
|
1895
|
+
c(N, {
|
|
1896
|
+
modelValue: u.value,
|
|
1897
|
+
"onUpdate:modelValue": d[3] || (d[3] = (y) => u.value = y),
|
|
1846
1898
|
disabled: l.value,
|
|
1847
1899
|
id: "reject-dialog-body"
|
|
1848
1900
|
}, null, 8, ["modelValue", "disabled"])
|
|
1849
1901
|
])
|
|
1850
1902
|
], 2),
|
|
1851
|
-
|
|
1903
|
+
c(V, null, {
|
|
1852
1904
|
default: g(() => [
|
|
1853
|
-
|
|
1905
|
+
c(H, {
|
|
1854
1906
|
variant: "outline",
|
|
1855
|
-
onClick:
|
|
1907
|
+
onClick: d[4] || (d[4] = (y) => i.value = !1)
|
|
1856
1908
|
}, {
|
|
1857
|
-
default: g(() => [...
|
|
1909
|
+
default: g(() => [...d[11] || (d[11] = [
|
|
1858
1910
|
A("Close", -1)
|
|
1859
1911
|
])]),
|
|
1860
1912
|
_: 1
|
|
1861
1913
|
}),
|
|
1862
|
-
|
|
1914
|
+
c(H, {
|
|
1863
1915
|
variant: "destructive",
|
|
1864
|
-
onClick:
|
|
1916
|
+
onClick: b
|
|
1865
1917
|
}, {
|
|
1866
|
-
default: g(() => [...
|
|
1918
|
+
default: g(() => [...d[12] || (d[12] = [
|
|
1867
1919
|
A("Reject reservation", -1)
|
|
1868
1920
|
])]),
|
|
1869
1921
|
_: 1
|
|
@@ -1879,43 +1931,43 @@ We would love to see you another time!`);
|
|
|
1879
1931
|
}, 8, ["open"]);
|
|
1880
1932
|
};
|
|
1881
1933
|
}
|
|
1882
|
-
}),
|
|
1934
|
+
}), _s = {
|
|
1883
1935
|
key: 0,
|
|
1884
1936
|
class: "space-y-6 py-4"
|
|
1885
|
-
},
|
|
1937
|
+
}, xs = { class: "space-y-3" }, Ds = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, bs = { class: "flex items-center gap-3" }, ys = { class: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center" }, As = { class: "font-medium" }, Cs = { class: "grid gap-2 text-sm" }, ws = {
|
|
1886
1938
|
key: 0,
|
|
1887
1939
|
class: "flex items-center gap-2 text-muted-foreground"
|
|
1888
|
-
},
|
|
1940
|
+
}, ks = ["href"], Es = {
|
|
1889
1941
|
key: 1,
|
|
1890
1942
|
class: "flex items-center gap-2 text-muted-foreground"
|
|
1891
|
-
},
|
|
1943
|
+
}, $s = ["href"], Ms = { class: "space-y-3" }, Bs = { class: "grid grid-cols-2 gap-3" }, Fs = { class: "bg-muted/30 rounded-lg p-3" }, Ss = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, Rs = { class: "font-medium" }, Is = { class: "bg-muted/30 rounded-lg p-3" }, js = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, Ts = { class: "font-medium" }, Os = {
|
|
1892
1944
|
key: 0,
|
|
1893
1945
|
class: "space-y-3"
|
|
1894
|
-
},
|
|
1946
|
+
}, Ns = { class: "bg-muted/30 rounded-lg p-4" }, Ls = { class: "flex items-start justify-between" }, Ps = { class: "flex items-start gap-3" }, zs = { class: "h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5" }, Vs = { class: "font-medium" }, Us = { class: "text-sm text-muted-foreground" }, Hs = { class: "font-semibold" }, Ws = { class: "space-y-3" }, Ks = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Gs = { class: "space-y-2 text-sm" }, Ys = { class: "flex justify-between" }, Qs = {
|
|
1895
1947
|
key: 0,
|
|
1896
1948
|
class: "flex justify-between"
|
|
1897
|
-
},
|
|
1949
|
+
}, Js = {
|
|
1898
1950
|
key: 1,
|
|
1899
1951
|
class: "flex justify-between text-green-600 dark:text-green-400"
|
|
1900
|
-
},
|
|
1952
|
+
}, Xs = { class: "flex justify-between font-semibold" }, Zs = {
|
|
1901
1953
|
key: 1,
|
|
1902
1954
|
class: "space-y-2 text-sm"
|
|
1903
|
-
},
|
|
1955
|
+
}, qs = {
|
|
1904
1956
|
key: 0,
|
|
1905
1957
|
class: "flex justify-between"
|
|
1906
|
-
},
|
|
1958
|
+
}, en = { class: "text-muted-foreground flex items-center gap-1.5" }, tn = { class: "text-green-600 dark:text-green-400" }, sn = {
|
|
1907
1959
|
key: 1,
|
|
1908
1960
|
class: "flex justify-between"
|
|
1909
|
-
},
|
|
1961
|
+
}, nn = { class: "text-muted-foreground flex items-center gap-1.5" }, on = { class: "text-orange-600 dark:text-orange-400 font-medium" }, cn = /* @__PURE__ */ te({
|
|
1910
1962
|
__name: "ReservationDetailDialog",
|
|
1911
1963
|
emits: ["cancelled", "confirmed", "rejected"],
|
|
1912
|
-
setup(t, { expose: e, emit:
|
|
1913
|
-
const { hasPermission:
|
|
1914
|
-
|
|
1915
|
-
},
|
|
1916
|
-
let
|
|
1917
|
-
const f =
|
|
1918
|
-
switch (["needs_approval", "rejected", "approved", "cancelled"].includes(f) && (
|
|
1964
|
+
setup(t, { expose: e, emit: s }) {
|
|
1965
|
+
const { hasPermission: n } = pt(), { config: a } = se(), r = ft(a.project), i = Je("event", $(null)), l = s, p = $(!1), o = $(null), u = $(!1), v = oe("cancelReservationDialog"), b = oe("approveReservationDialog"), h = oe("rejectReservationDialog"), d = oe("transferReservationDialog"), x = (C) => {
|
|
1966
|
+
o.value = C, p.value = !0;
|
|
1967
|
+
}, M = pe(() => o.value?.customerInfo && `${o.value.customerInfo.firstName} ${o.value.customerInfo.lastName}`.trim() || "Unknown Customer"), O = pe(() => {
|
|
1968
|
+
let C = o.value?.status;
|
|
1969
|
+
const f = o.value?.reservationStatus;
|
|
1970
|
+
switch (["needs_approval", "rejected", "approved", "cancelled"].includes(f) && (C = f), C) {
|
|
1919
1971
|
case "needs_approval":
|
|
1920
1972
|
return { label: "Needs Approval", class: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400" };
|
|
1921
1973
|
case "rejected":
|
|
@@ -1927,264 +1979,264 @@ We would love to see you another time!`);
|
|
|
1927
1979
|
case "cancelled":
|
|
1928
1980
|
return { label: "Cancelled", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
|
|
1929
1981
|
default:
|
|
1930
|
-
return { label:
|
|
1982
|
+
return { label: C || "Unknown", class: "bg-muted text-muted-foreground" };
|
|
1931
1983
|
}
|
|
1932
|
-
}),
|
|
1933
|
-
if (!
|
|
1934
|
-
if (
|
|
1935
|
-
const f = Math.floor(
|
|
1936
|
-
return
|
|
1937
|
-
},
|
|
1938
|
-
if (!
|
|
1939
|
-
let
|
|
1940
|
-
const f =
|
|
1984
|
+
}), I = pe(() => o.value?.status === "cancelled"), w = (C) => C == null || typeof C != "number" ? "—" : `€${C?.toFixed(2)}`, B = (C) => {
|
|
1985
|
+
if (!C) return "—";
|
|
1986
|
+
if (C < 60) return `${C} min`;
|
|
1987
|
+
const f = Math.floor(C / 60), k = C % 60;
|
|
1988
|
+
return k > 0 ? `${f}h ${k}min` : `${f}h`;
|
|
1989
|
+
}, N = () => {
|
|
1990
|
+
if (!o.value) return;
|
|
1991
|
+
let C = "";
|
|
1992
|
+
const f = i?.value?.date;
|
|
1941
1993
|
if (f)
|
|
1942
1994
|
try {
|
|
1943
|
-
|
|
1995
|
+
C = new Date(f).toLocaleDateString("en-US", {
|
|
1944
1996
|
weekday: "long",
|
|
1945
1997
|
year: "numeric",
|
|
1946
1998
|
month: "long",
|
|
1947
1999
|
day: "numeric"
|
|
1948
2000
|
});
|
|
1949
2001
|
} catch {
|
|
1950
|
-
|
|
2002
|
+
C = f;
|
|
1951
2003
|
}
|
|
1952
|
-
const
|
|
1953
|
-
date:
|
|
1954
|
-
resourceName:
|
|
2004
|
+
const k = {
|
|
2005
|
+
date: C,
|
|
2006
|
+
resourceName: i?.value?.resource?.name
|
|
1955
2007
|
};
|
|
1956
|
-
|
|
1957
|
-
},
|
|
1958
|
-
|
|
1959
|
-
},
|
|
1960
|
-
|
|
1961
|
-
},
|
|
1962
|
-
|
|
1963
|
-
},
|
|
1964
|
-
|
|
1965
|
-
},
|
|
2008
|
+
ts(o.value, k);
|
|
2009
|
+
}, H = () => {
|
|
2010
|
+
b.value?.openDialog(o.value);
|
|
2011
|
+
}, V = () => {
|
|
2012
|
+
h.value?.openDialog(o.value);
|
|
2013
|
+
}, E = () => {
|
|
2014
|
+
b.value?.openDialog(o.value);
|
|
2015
|
+
}, j = () => {
|
|
2016
|
+
v.value?.openDialog(o.value);
|
|
2017
|
+
}, y = async () => {
|
|
1966
2018
|
try {
|
|
1967
|
-
if (
|
|
1968
|
-
|
|
1969
|
-
let f = (await r.get(
|
|
1970
|
-
if (!f.find((
|
|
2019
|
+
if (u.value || !o.value?.id) throw new Error("Invalid state");
|
|
2020
|
+
u.value = !0;
|
|
2021
|
+
let f = (await r.get(a.reservationsCollection, o.value.id))?.reservations || [];
|
|
2022
|
+
if (!f.find((k) => k.id === o.value.res_id))
|
|
1971
2023
|
throw new Error("Reservation not found");
|
|
1972
|
-
f.find((
|
|
2024
|
+
f.find((k) => k.id === o.value.res_id).status = "cancelled", await r.update(a.reservationsCollection, o.value.id, {
|
|
1973
2025
|
reservations: f
|
|
1974
|
-
}),
|
|
1975
|
-
} catch (
|
|
1976
|
-
console.error("Error cancelling reservation:",
|
|
2026
|
+
}), o.value.status = "cancelled", Z.success("Reservation cancelled successfully"), l("cancelled"), p.value = !1;
|
|
2027
|
+
} catch (C) {
|
|
2028
|
+
console.error("Error cancelling reservation:", C), Z.error("Failed to cancel reservation");
|
|
1977
2029
|
} finally {
|
|
1978
|
-
|
|
2030
|
+
u.value = !1;
|
|
1979
2031
|
}
|
|
1980
|
-
},
|
|
2032
|
+
}, T = async () => {
|
|
1981
2033
|
try {
|
|
1982
|
-
if (
|
|
1983
|
-
|
|
1984
|
-
let f = (await r.get(
|
|
1985
|
-
if (!f.find((
|
|
2034
|
+
if (u.value || !o.value?.id) throw new Error("Invalid state");
|
|
2035
|
+
u.value = !0;
|
|
2036
|
+
let f = (await r.get(a.reservationsCollection, o.value.id))?.reservations || [];
|
|
2037
|
+
if (!f.find((k) => k.id === o.value.res_id))
|
|
1986
2038
|
throw new Error("Reservation not found");
|
|
1987
|
-
f.find((
|
|
2039
|
+
f.find((k) => k.id === o.value.res_id).status = "approved", await r.update(a.reservationsCollection, o.value.id, {
|
|
1988
2040
|
reservations: f
|
|
1989
|
-
}),
|
|
1990
|
-
} catch (
|
|
1991
|
-
console.error("Error approving reservation:",
|
|
2041
|
+
}), o.value.status = "approved", Z.success("Reservation approved successfully"), l("confirmed"), p.value = !1;
|
|
2042
|
+
} catch (C) {
|
|
2043
|
+
console.error("Error approving reservation:", C), Z.error("Failed to approve reservation");
|
|
1992
2044
|
} finally {
|
|
1993
|
-
|
|
2045
|
+
u.value = !1;
|
|
1994
2046
|
}
|
|
1995
|
-
},
|
|
2047
|
+
}, ee = async () => {
|
|
1996
2048
|
try {
|
|
1997
|
-
if (
|
|
1998
|
-
|
|
1999
|
-
let f = (await r.get(
|
|
2000
|
-
if (!f.find((
|
|
2049
|
+
if (u.value || !o.value?.id) throw new Error("Invalid state");
|
|
2050
|
+
u.value = !0;
|
|
2051
|
+
let f = (await r.get(a.reservationsCollection, o.value.id))?.reservations || [];
|
|
2052
|
+
if (!f.find((k) => k.id === o.value.res_id))
|
|
2001
2053
|
throw new Error("Reservation not found");
|
|
2002
|
-
f.find((
|
|
2054
|
+
f.find((k) => k.id === o.value.res_id).status = "rejected", await r.update(a.reservationsCollection, o.value.id, {
|
|
2003
2055
|
reservations: f
|
|
2004
|
-
}),
|
|
2005
|
-
} catch (
|
|
2006
|
-
console.error("Error rejecting reservation:",
|
|
2056
|
+
}), o.value.status = "rejected", Z.success("Reservation rejected successfully"), l("rejected"), p.value = !1;
|
|
2057
|
+
} catch (C) {
|
|
2058
|
+
console.error("Error rejecting reservation:", C), Z.error("Failed to reject reservation");
|
|
2007
2059
|
} finally {
|
|
2008
|
-
|
|
2060
|
+
u.value = !1;
|
|
2009
2061
|
}
|
|
2010
|
-
},
|
|
2062
|
+
}, W = () => {
|
|
2011
2063
|
};
|
|
2012
2064
|
return e({
|
|
2013
2065
|
openDialog: x
|
|
2014
|
-
}), (
|
|
2015
|
-
const
|
|
2016
|
-
return R(),
|
|
2017
|
-
|
|
2018
|
-
open:
|
|
2019
|
-
"onUpdate:open": f[0] || (f[0] = (
|
|
2066
|
+
}), (C, f) => {
|
|
2067
|
+
const k = _("DialogTitle"), X = _("DialogDescription"), Ve = _("DialogHeader"), Ae = _("Separator"), ue = _("Button"), Ue = _("DropdownMenuTrigger"), ce = _("DropdownMenuLabel"), ne = _("DropdownMenuItem"), de = _("DropdownMenuGroup"), Ce = _("DropdownMenuSeparator"), He = _("DropdownMenuContent"), We = _("DropdownMenu"), Ke = _("DialogFooter"), Ge = _("DialogScrollContent"), Ye = _("Dialog");
|
|
2068
|
+
return R(), U(fe, null, [
|
|
2069
|
+
c(Ye, {
|
|
2070
|
+
open: p.value,
|
|
2071
|
+
"onUpdate:open": f[0] || (f[0] = (Qe) => p.value = Qe)
|
|
2020
2072
|
}, {
|
|
2021
2073
|
default: g(() => [
|
|
2022
|
-
|
|
2074
|
+
c(Ge, { class: "sm:max-w-xl" }, {
|
|
2023
2075
|
default: g(() => [
|
|
2024
|
-
|
|
2076
|
+
c(Ve, null, {
|
|
2025
2077
|
default: g(() => [
|
|
2026
|
-
|
|
2078
|
+
c(k, { class: "flex items-center gap-3" }, {
|
|
2027
2079
|
default: g(() => [
|
|
2028
2080
|
f[1] || (f[1] = m("span", null, "Reservation Details", -1)),
|
|
2029
2081
|
m("span", {
|
|
2030
|
-
class:
|
|
2031
|
-
}, F(
|
|
2082
|
+
class: le(["px-2.5 py-1 text-xs font-medium rounded-full", O.value.class])
|
|
2083
|
+
}, F(O.value.label), 3)
|
|
2032
2084
|
]),
|
|
2033
2085
|
_: 1
|
|
2034
2086
|
}),
|
|
2035
|
-
|
|
2087
|
+
c(X, null, {
|
|
2036
2088
|
default: g(() => [
|
|
2037
|
-
A(" Booking #" + F(
|
|
2089
|
+
A(" Booking #" + F(o.value?.id?.slice(0, 8) || "—"), 1)
|
|
2038
2090
|
]),
|
|
2039
2091
|
_: 1
|
|
2040
2092
|
})
|
|
2041
2093
|
]),
|
|
2042
2094
|
_: 1
|
|
2043
2095
|
}),
|
|
2044
|
-
|
|
2045
|
-
m("div",
|
|
2096
|
+
o.value ? (R(), U("div", _s, [
|
|
2097
|
+
m("div", xs, [
|
|
2046
2098
|
f[2] || (f[2] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Customer", -1)),
|
|
2047
|
-
m("div",
|
|
2048
|
-
m("div",
|
|
2049
|
-
m("div",
|
|
2050
|
-
|
|
2099
|
+
m("div", Ds, [
|
|
2100
|
+
m("div", bs, [
|
|
2101
|
+
m("div", ys, [
|
|
2102
|
+
c(S(Xe), {
|
|
2051
2103
|
size: 20,
|
|
2052
2104
|
class: "text-primary"
|
|
2053
2105
|
})
|
|
2054
2106
|
]),
|
|
2055
2107
|
m("div", null, [
|
|
2056
|
-
m("p",
|
|
2108
|
+
m("p", As, F(M.value), 1)
|
|
2057
2109
|
])
|
|
2058
2110
|
]),
|
|
2059
|
-
m("div",
|
|
2060
|
-
|
|
2061
|
-
|
|
2111
|
+
m("div", Cs, [
|
|
2112
|
+
o.value.customerInfo?.email ? (R(), U("div", ws, [
|
|
2113
|
+
c(S(Ze), { size: 14 }),
|
|
2062
2114
|
m("a", {
|
|
2063
|
-
href: `mailto:${
|
|
2115
|
+
href: `mailto:${o.value.customerInfo.email}`,
|
|
2064
2116
|
class: "hover:text-foreground transition-colors"
|
|
2065
|
-
}, F(
|
|
2066
|
-
])) :
|
|
2067
|
-
|
|
2068
|
-
|
|
2117
|
+
}, F(o.value.customerInfo.email), 9, ks)
|
|
2118
|
+
])) : L("", !0),
|
|
2119
|
+
o.value.customerInfo?.phone ? (R(), U("div", Es, [
|
|
2120
|
+
c(S(qe), { size: 14 }),
|
|
2069
2121
|
m("a", {
|
|
2070
|
-
href: `tel:${
|
|
2122
|
+
href: `tel:${o.value.customerInfo.phone}`,
|
|
2071
2123
|
class: "hover:text-foreground transition-colors"
|
|
2072
|
-
}, F(
|
|
2073
|
-
])) :
|
|
2124
|
+
}, F(o.value.customerInfo.phone), 9, $s)
|
|
2125
|
+
])) : L("", !0)
|
|
2074
2126
|
])
|
|
2075
2127
|
])
|
|
2076
2128
|
]),
|
|
2077
|
-
m("div",
|
|
2129
|
+
m("div", Ms, [
|
|
2078
2130
|
f[5] || (f[5] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Reservation", -1)),
|
|
2079
|
-
m("div",
|
|
2080
|
-
m("div",
|
|
2081
|
-
m("div",
|
|
2082
|
-
|
|
2131
|
+
m("div", Bs, [
|
|
2132
|
+
m("div", Fs, [
|
|
2133
|
+
m("div", Ss, [
|
|
2134
|
+
c(S(et), { size: 14 }),
|
|
2083
2135
|
f[3] || (f[3] = m("span", { class: "text-xs" }, "Time", -1))
|
|
2084
2136
|
]),
|
|
2085
|
-
m("p",
|
|
2137
|
+
m("p", Rs, F(o.value.startTime) + " - " + F(o.value.endTime), 1)
|
|
2086
2138
|
]),
|
|
2087
|
-
m("div",
|
|
2088
|
-
m("div",
|
|
2089
|
-
|
|
2139
|
+
m("div", Is, [
|
|
2140
|
+
m("div", js, [
|
|
2141
|
+
c(S(tt), { size: 14 }),
|
|
2090
2142
|
f[4] || (f[4] = m("span", { class: "text-xs" }, "Spots", -1))
|
|
2091
2143
|
]),
|
|
2092
|
-
m("p",
|
|
2144
|
+
m("p", Ts, F(o.value.spots || 1) + " " + F(o.value.spots === 1 ? "person" : "people"), 1)
|
|
2093
2145
|
])
|
|
2094
2146
|
])
|
|
2095
2147
|
]),
|
|
2096
|
-
|
|
2148
|
+
o.value.pricingOption ? (R(), U("div", Os, [
|
|
2097
2149
|
f[6] || (f[6] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Package", -1)),
|
|
2098
|
-
m("div",
|
|
2099
|
-
m("div",
|
|
2100
|
-
m("div",
|
|
2101
|
-
m("div",
|
|
2102
|
-
|
|
2150
|
+
m("div", Ns, [
|
|
2151
|
+
m("div", Ls, [
|
|
2152
|
+
m("div", Ps, [
|
|
2153
|
+
m("div", zs, [
|
|
2154
|
+
c(S(st), {
|
|
2103
2155
|
size: 18,
|
|
2104
2156
|
class: "text-primary"
|
|
2105
2157
|
})
|
|
2106
2158
|
]),
|
|
2107
2159
|
m("div", null, [
|
|
2108
|
-
m("p",
|
|
2109
|
-
m("p",
|
|
2160
|
+
m("p", Vs, F(o.value.pricingOption.name), 1),
|
|
2161
|
+
m("p", Us, F(B(o.value.pricingOption.duration)), 1)
|
|
2110
2162
|
])
|
|
2111
2163
|
]),
|
|
2112
|
-
m("p",
|
|
2164
|
+
m("p", Hs, F(w(o.value.pricingOption.price)), 1)
|
|
2113
2165
|
])
|
|
2114
2166
|
])
|
|
2115
|
-
])) :
|
|
2116
|
-
m("div",
|
|
2167
|
+
])) : L("", !0),
|
|
2168
|
+
m("div", Ws, [
|
|
2117
2169
|
f[13] || (f[13] = m("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Payment", -1)),
|
|
2118
|
-
m("div",
|
|
2119
|
-
m("div",
|
|
2120
|
-
m("div",
|
|
2170
|
+
m("div", Ks, [
|
|
2171
|
+
m("div", Gs, [
|
|
2172
|
+
m("div", Ys, [
|
|
2121
2173
|
f[7] || (f[7] = m("span", { class: "text-muted-foreground" }, "Base price", -1)),
|
|
2122
|
-
m("span", null, F(w(
|
|
2174
|
+
m("span", null, F(w(o.value.reservationBasePrice)), 1)
|
|
2123
2175
|
]),
|
|
2124
|
-
|
|
2176
|
+
o.value.reservationAddOnsPrice ? (R(), U("div", Qs, [
|
|
2125
2177
|
f[8] || (f[8] = m("span", { class: "text-muted-foreground" }, "Add-ons", -1)),
|
|
2126
|
-
m("span", null, F(w(
|
|
2127
|
-
])) :
|
|
2128
|
-
|
|
2178
|
+
m("span", null, F(w(o.value.reservationAddOnsPrice)), 1)
|
|
2179
|
+
])) : L("", !0),
|
|
2180
|
+
o.value.discount ? (R(), U("div", Js, [
|
|
2129
2181
|
f[9] || (f[9] = m("span", null, "Discount", -1)),
|
|
2130
|
-
m("span", null, "-" + F(w(
|
|
2131
|
-
])) :
|
|
2182
|
+
m("span", null, "-" + F(w(o.value.discount)), 1)
|
|
2183
|
+
])) : L("", !0)
|
|
2132
2184
|
]),
|
|
2133
|
-
|
|
2134
|
-
m("div",
|
|
2185
|
+
c(Ae),
|
|
2186
|
+
m("div", Xs, [
|
|
2135
2187
|
f[10] || (f[10] = m("span", null, "Reservation Total", -1)),
|
|
2136
|
-
m("span", null, F(w(
|
|
2188
|
+
m("span", null, F(w(o.value.reservationPrice)), 1)
|
|
2137
2189
|
]),
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
m("span",
|
|
2142
|
-
|
|
2190
|
+
o.value.amountPaid !== void 0 || o.value.amountDue !== void 0 ? (R(), J(Ae, { key: 0 })) : L("", !0),
|
|
2191
|
+
o.value.amountPaid !== void 0 || o.value.amountDue !== void 0 ? (R(), U("div", Zs, [
|
|
2192
|
+
o.value.amountPaid !== void 0 ? (R(), U("div", qs, [
|
|
2193
|
+
m("span", en, [
|
|
2194
|
+
c(S(nt), { size: 14 }),
|
|
2143
2195
|
f[11] || (f[11] = A(" Amount paid ", -1))
|
|
2144
2196
|
]),
|
|
2145
|
-
m("span",
|
|
2146
|
-
])) :
|
|
2147
|
-
|
|
2148
|
-
m("span",
|
|
2149
|
-
|
|
2197
|
+
m("span", tn, F(w(o.value.amountPaid)), 1)
|
|
2198
|
+
])) : L("", !0),
|
|
2199
|
+
o.value.amountDue !== void 0 && o.value.amountDue > 0 ? (R(), U("div", sn, [
|
|
2200
|
+
m("span", nn, [
|
|
2201
|
+
c(S(ot), { size: 14 }),
|
|
2150
2202
|
f[12] || (f[12] = A(" Amount due ", -1))
|
|
2151
2203
|
]),
|
|
2152
|
-
m("span",
|
|
2153
|
-
])) :
|
|
2154
|
-
])) :
|
|
2204
|
+
m("span", on, F(w(o.value.amountDue)), 1)
|
|
2205
|
+
])) : L("", !0)
|
|
2206
|
+
])) : L("", !0)
|
|
2155
2207
|
])
|
|
2156
2208
|
])
|
|
2157
|
-
])) :
|
|
2158
|
-
|
|
2209
|
+
])) : L("", !0),
|
|
2210
|
+
c(Ke, { class: "gap-2 sm:justify-between" }, {
|
|
2159
2211
|
default: g(() => [
|
|
2160
|
-
|
|
2161
|
-
|
|
2212
|
+
o.value.reservationStatus === "needs_approval" ? (R(), U(fe, { key: 0 }, [
|
|
2213
|
+
c(ue, {
|
|
2162
2214
|
variant: "destructive",
|
|
2163
|
-
onClick:
|
|
2215
|
+
onClick: V
|
|
2164
2216
|
}, {
|
|
2165
2217
|
default: g(() => [
|
|
2166
|
-
|
|
2218
|
+
c(S(at), { size: 16 }),
|
|
2167
2219
|
f[14] || (f[14] = A(" Reject Reservation ", -1))
|
|
2168
2220
|
]),
|
|
2169
2221
|
_: 1
|
|
2170
2222
|
}),
|
|
2171
|
-
|
|
2223
|
+
c(ue, { onClick: H }, {
|
|
2172
2224
|
default: g(() => [
|
|
2173
|
-
|
|
2225
|
+
c(S(it), { size: 16 }),
|
|
2174
2226
|
f[15] || (f[15] = A(" Approve Reservation ", -1))
|
|
2175
2227
|
]),
|
|
2176
2228
|
_: 1
|
|
2177
2229
|
})
|
|
2178
|
-
], 64)) :
|
|
2230
|
+
], 64)) : o.value.reservationStatus === "approved" ? (R(), J(We, { key: 1 }, {
|
|
2179
2231
|
default: g(() => [
|
|
2180
|
-
|
|
2232
|
+
c(Ue, { "as-child": "" }, {
|
|
2181
2233
|
default: g(() => [
|
|
2182
|
-
|
|
2234
|
+
c(ue, {
|
|
2183
2235
|
variant: "outline",
|
|
2184
2236
|
class: "gap-2"
|
|
2185
2237
|
}, {
|
|
2186
2238
|
default: g(() => [
|
|
2187
|
-
|
|
2239
|
+
c(S(rt), { size: 16 }),
|
|
2188
2240
|
f[16] || (f[16] = A(" Actions ", -1))
|
|
2189
2241
|
]),
|
|
2190
2242
|
_: 1
|
|
@@ -2192,25 +2244,25 @@ We would love to see you another time!`);
|
|
|
2192
2244
|
]),
|
|
2193
2245
|
_: 1
|
|
2194
2246
|
}),
|
|
2195
|
-
|
|
2247
|
+
c(He, {
|
|
2196
2248
|
class: "w-60",
|
|
2197
2249
|
align: "start"
|
|
2198
2250
|
}, {
|
|
2199
2251
|
default: g(() => [
|
|
2200
|
-
|
|
2252
|
+
c(ce, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2201
2253
|
default: g(() => [...f[17] || (f[17] = [
|
|
2202
2254
|
A(" Reservation Actions ", -1)
|
|
2203
2255
|
])]),
|
|
2204
2256
|
_: 1
|
|
2205
2257
|
}),
|
|
2206
|
-
|
|
2258
|
+
c(de, null, {
|
|
2207
2259
|
default: g(() => [
|
|
2208
|
-
|
|
2209
|
-
onClick:
|
|
2260
|
+
c(ne, {
|
|
2261
|
+
onClick: N,
|
|
2210
2262
|
class: "gap-2 cursor-pointer"
|
|
2211
2263
|
}, {
|
|
2212
2264
|
default: g(() => [
|
|
2213
|
-
|
|
2265
|
+
c(S(lt), {
|
|
2214
2266
|
size: 16,
|
|
2215
2267
|
class: "text-muted-foreground"
|
|
2216
2268
|
}),
|
|
@@ -2221,21 +2273,21 @@ We would love to see you another time!`);
|
|
|
2221
2273
|
]),
|
|
2222
2274
|
_: 1
|
|
2223
2275
|
}),
|
|
2224
|
-
|
|
2225
|
-
|
|
2276
|
+
c(Ce),
|
|
2277
|
+
c(de, null, {
|
|
2226
2278
|
default: g(() => [
|
|
2227
|
-
|
|
2279
|
+
c(ce, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2228
2280
|
default: g(() => [...f[19] || (f[19] = [
|
|
2229
2281
|
A(" Communication ", -1)
|
|
2230
2282
|
])]),
|
|
2231
2283
|
_: 1
|
|
2232
2284
|
}),
|
|
2233
|
-
|
|
2234
|
-
onClick:
|
|
2285
|
+
c(ne, {
|
|
2286
|
+
onClick: E,
|
|
2235
2287
|
class: "gap-2 cursor-pointer"
|
|
2236
2288
|
}, {
|
|
2237
2289
|
default: g(() => [
|
|
2238
|
-
|
|
2290
|
+
c(S(ut), {
|
|
2239
2291
|
size: 16,
|
|
2240
2292
|
class: "text-muted-foreground"
|
|
2241
2293
|
}),
|
|
@@ -2246,53 +2298,53 @@ We would love to see you another time!`);
|
|
|
2246
2298
|
]),
|
|
2247
2299
|
_: 1
|
|
2248
2300
|
}),
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2301
|
+
S(n)("manage-reservations") ? (R(), U(fe, { key: 0 }, [
|
|
2302
|
+
c(Ce),
|
|
2303
|
+
c(de, null, {
|
|
2252
2304
|
default: g(() => [
|
|
2253
|
-
|
|
2305
|
+
c(ce, { class: "text-xs text-muted-foreground font-normal" }, {
|
|
2254
2306
|
default: g(() => [...f[21] || (f[21] = [
|
|
2255
2307
|
A(" Cancellation ", -1)
|
|
2256
2308
|
])]),
|
|
2257
2309
|
_: 1
|
|
2258
2310
|
}),
|
|
2259
|
-
|
|
2260
|
-
onClick:
|
|
2311
|
+
c(ne, {
|
|
2312
|
+
onClick: j,
|
|
2261
2313
|
class: "gap-2 cursor-pointer",
|
|
2262
2314
|
variant: "destructive",
|
|
2263
|
-
disabled:
|
|
2315
|
+
disabled: I.value
|
|
2264
2316
|
}, {
|
|
2265
2317
|
default: g(() => [
|
|
2266
|
-
|
|
2318
|
+
c(S(ct), { size: 16 }),
|
|
2267
2319
|
f[22] || (f[22] = m("span", null, "Cancel Reservation", -1))
|
|
2268
2320
|
]),
|
|
2269
2321
|
_: 1
|
|
2270
2322
|
}, 8, ["disabled"]),
|
|
2271
|
-
|
|
2323
|
+
o.value?.reservationPrice && o.value.reservationPrice > 0 ? (R(), J(ne, {
|
|
2272
2324
|
key: 0,
|
|
2273
|
-
onClick:
|
|
2325
|
+
onClick: W,
|
|
2274
2326
|
class: "gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",
|
|
2275
|
-
disabled:
|
|
2327
|
+
disabled: I.value
|
|
2276
2328
|
}, {
|
|
2277
2329
|
default: g(() => [
|
|
2278
|
-
|
|
2330
|
+
c(S(dt), {
|
|
2279
2331
|
class: "text-inherit",
|
|
2280
2332
|
size: 16
|
|
2281
2333
|
}),
|
|
2282
2334
|
f[23] || (f[23] = m("span", null, "Cancel & Send Coupon", -1))
|
|
2283
2335
|
]),
|
|
2284
2336
|
_: 1
|
|
2285
|
-
}, 8, ["disabled"])) :
|
|
2337
|
+
}, 8, ["disabled"])) : L("", !0)
|
|
2286
2338
|
]),
|
|
2287
2339
|
_: 1
|
|
2288
2340
|
})
|
|
2289
|
-
], 64)) :
|
|
2341
|
+
], 64)) : L("", !0)
|
|
2290
2342
|
]),
|
|
2291
2343
|
_: 1
|
|
2292
2344
|
})
|
|
2293
2345
|
]),
|
|
2294
2346
|
_: 1
|
|
2295
|
-
})) :
|
|
2347
|
+
})) : L("", !0)
|
|
2296
2348
|
]),
|
|
2297
2349
|
_: 1
|
|
2298
2350
|
})
|
|
@@ -2302,30 +2354,30 @@ We would love to see you another time!`);
|
|
|
2302
2354
|
]),
|
|
2303
2355
|
_: 1
|
|
2304
2356
|
}, 8, ["open"]),
|
|
2305
|
-
|
|
2357
|
+
c(is, {
|
|
2306
2358
|
ref_key: "cancelReservationDialog",
|
|
2307
|
-
ref:
|
|
2308
|
-
onConfirm:
|
|
2359
|
+
ref: v,
|
|
2360
|
+
onConfirm: y
|
|
2309
2361
|
}, null, 512),
|
|
2310
|
-
|
|
2362
|
+
c(ps, {
|
|
2311
2363
|
ref_key: "approveReservationDialog",
|
|
2312
|
-
ref:
|
|
2313
|
-
onConfirm:
|
|
2364
|
+
ref: b,
|
|
2365
|
+
onConfirm: T
|
|
2314
2366
|
}, null, 512),
|
|
2315
|
-
|
|
2367
|
+
c(hs, {
|
|
2316
2368
|
ref_key: "rejectReservationDialog",
|
|
2317
|
-
ref:
|
|
2318
|
-
onConfirm:
|
|
2369
|
+
ref: h,
|
|
2370
|
+
onConfirm: ee
|
|
2319
2371
|
}, null, 512),
|
|
2320
|
-
|
|
2372
|
+
c(rs, {
|
|
2321
2373
|
ref_key: "transferReservationDialog",
|
|
2322
|
-
ref:
|
|
2374
|
+
ref: d
|
|
2323
2375
|
}, null, 512)
|
|
2324
2376
|
], 64);
|
|
2325
2377
|
};
|
|
2326
2378
|
}
|
|
2327
2379
|
});
|
|
2328
2380
|
export {
|
|
2329
|
-
|
|
2330
|
-
|
|
2381
|
+
q as F,
|
|
2382
|
+
cn as _
|
|
2331
2383
|
};
|