@feedmepos/mf-mdm 1.5.4-beta.178 → 1.5.4-beta.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-44d70250.js → App-9c71053a.js} +1 -1
- package/dist/DeviceList-c4cf7372.js +3525 -0
- package/dist/api/index.d.ts +12 -1
- package/dist/app.js +2 -2
- package/dist/components/DownloadLogDialog.vue.d.ts +12 -0
- package/dist/{index-939169c1.js → index-1fcfcd9b.js} +1115 -1094
- package/dist/utils/types.d.ts +24 -0
- package/package.json +1 -1
- package/dist/DeviceList-18849de9.js +0 -3285
|
@@ -1,3285 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Ve, resolveComponent as I, openBlock as p, createElementBlock as b, createElementVNode as d, toDisplayString as h, unref as s, createVNode as f, computed as q, ref as x, watch as Be, onMounted as Ct, createBlock as L, isRef as tn, createSlots as On, withCtx as C, createCommentVNode as R, Fragment as te, renderList as ce, normalizeClass as nn, withModifiers as kt, nextTick as on, createTextVNode as Ft, Teleport as An, h as G } from "vue";
|
|
2
|
-
import { b as Dn, C as zn, r as Wt, h as et, c as Sn, w as Nn, e as Pn, S as xn, x as Un, F as Mn, u as sn, y as Y, z as bt, A as ue, B as Te, D as mt, G as an, H as lt, v as Ln } from "./index-939169c1.js";
|
|
3
|
-
import { useI18n as Re, useCoreStore as Rt } from "@feedmepos/mf-common";
|
|
4
|
-
import { useProxiedModel as dt, useSnackbar as tt, SnackbarPosition as Q, useBreakpoints as Ot, useDialogChild as ln, useDialog as rn, components as Me } from "@feedmepos/ui-library";
|
|
5
|
-
import { storeToRefs as Bn } from "pinia";
|
|
6
|
-
const Vn = { class: "flex flex-col gap-16" }, $n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jn = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "flex gap-5 flex-col"
|
|
9
|
-
}, Hn = {
|
|
10
|
-
key: 1,
|
|
11
|
-
class: "flex justify-start"
|
|
12
|
-
}, Wn = /* @__PURE__ */ Ve({
|
|
13
|
-
__name: "BindOtpDialog",
|
|
14
|
-
props: {
|
|
15
|
-
restaurantId: {
|
|
16
|
-
type: String,
|
|
17
|
-
required: !0
|
|
18
|
-
},
|
|
19
|
-
otp: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: !0
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
setup(e) {
|
|
25
|
-
const { t } = Re(), o = dt(e, "otp"), i = tt(), l = async (r) => {
|
|
26
|
-
const m = "text/plain", v = new Blob([r], { type: m }), T = [new ClipboardItem({ [m]: v })];
|
|
27
|
-
await navigator.clipboard.write(T).then(() => {
|
|
28
|
-
i.open({
|
|
29
|
-
message: t("device.otp.otpCopiedMessage"),
|
|
30
|
-
type: "success",
|
|
31
|
-
position: Q.BOTTOM
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
return (r, m) => {
|
|
36
|
-
const v = I("FmCircularProgress");
|
|
37
|
-
return p(), b("div", Vn, [
|
|
38
|
-
d("div", $n, h(s(t)("device.otp.otpExpiryMessage")), 1),
|
|
39
|
-
s(o) ? (p(), b("div", jn, [
|
|
40
|
-
d("div", {
|
|
41
|
-
class: "fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
|
|
42
|
-
onClick: m[0] || (m[0] = (T) => l(s(o)))
|
|
43
|
-
}, h(s(o)), 1)
|
|
44
|
-
])) : (p(), b("div", Hn, [
|
|
45
|
-
f(v, { size: "lg" })
|
|
46
|
-
]))
|
|
47
|
-
]);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
/**
|
|
52
|
-
* @license
|
|
53
|
-
* Copyright 2017 Google LLC
|
|
54
|
-
*
|
|
55
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
56
|
-
* you may not use this file except in compliance with the License.
|
|
57
|
-
* You may obtain a copy of the License at
|
|
58
|
-
*
|
|
59
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
60
|
-
*
|
|
61
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
62
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
63
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
64
|
-
* See the License for the specific language governing permissions and
|
|
65
|
-
* limitations under the License.
|
|
66
|
-
*/
|
|
67
|
-
const cn = "firebasestorage.googleapis.com", un = "storageBucket", Gn = 2 * 60 * 1e3, Yn = 10 * 60 * 1e3;
|
|
68
|
-
/**
|
|
69
|
-
* @license
|
|
70
|
-
* Copyright 2017 Google LLC
|
|
71
|
-
*
|
|
72
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
73
|
-
* you may not use this file except in compliance with the License.
|
|
74
|
-
* You may obtain a copy of the License at
|
|
75
|
-
*
|
|
76
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
77
|
-
*
|
|
78
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
79
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
80
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
81
|
-
* See the License for the specific language governing permissions and
|
|
82
|
-
* limitations under the License.
|
|
83
|
-
*/
|
|
84
|
-
class $ extends Mn {
|
|
85
|
-
/**
|
|
86
|
-
* @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
|
|
87
|
-
* added to the end of the message.
|
|
88
|
-
* @param message - Error message.
|
|
89
|
-
* @param status_ - Corresponding HTTP Status Code
|
|
90
|
-
*/
|
|
91
|
-
constructor(t, n, o = 0) {
|
|
92
|
-
super(yt(t), `Firebase Storage: ${n} (${yt(t)})`), this.status_ = o, this.customData = { serverResponse: null }, this._baseMessage = this.message, Object.setPrototypeOf(this, $.prototype);
|
|
93
|
-
}
|
|
94
|
-
get status() {
|
|
95
|
-
return this.status_;
|
|
96
|
-
}
|
|
97
|
-
set status(t) {
|
|
98
|
-
this.status_ = t;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
|
|
102
|
-
*/
|
|
103
|
-
_codeEquals(t) {
|
|
104
|
-
return yt(t) === this.code;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Optional response message that was added by the server.
|
|
108
|
-
*/
|
|
109
|
-
get serverResponse() {
|
|
110
|
-
return this.customData.serverResponse;
|
|
111
|
-
}
|
|
112
|
-
set serverResponse(t) {
|
|
113
|
-
this.customData.serverResponse = t, this.customData.serverResponse ? this.message = `${this._baseMessage}
|
|
114
|
-
${this.customData.serverResponse}` : this.message = this._baseMessage;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
var V;
|
|
118
|
-
(function(e) {
|
|
119
|
-
e.UNKNOWN = "unknown", e.OBJECT_NOT_FOUND = "object-not-found", e.BUCKET_NOT_FOUND = "bucket-not-found", e.PROJECT_NOT_FOUND = "project-not-found", e.QUOTA_EXCEEDED = "quota-exceeded", e.UNAUTHENTICATED = "unauthenticated", e.UNAUTHORIZED = "unauthorized", e.UNAUTHORIZED_APP = "unauthorized-app", e.RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded", e.INVALID_CHECKSUM = "invalid-checksum", e.CANCELED = "canceled", e.INVALID_EVENT_NAME = "invalid-event-name", e.INVALID_URL = "invalid-url", e.INVALID_DEFAULT_BUCKET = "invalid-default-bucket", e.NO_DEFAULT_BUCKET = "no-default-bucket", e.CANNOT_SLICE_BLOB = "cannot-slice-blob", e.SERVER_FILE_WRONG_SIZE = "server-file-wrong-size", e.NO_DOWNLOAD_URL = "no-download-url", e.INVALID_ARGUMENT = "invalid-argument", e.INVALID_ARGUMENT_COUNT = "invalid-argument-count", e.APP_DELETED = "app-deleted", e.INVALID_ROOT_OPERATION = "invalid-root-operation", e.INVALID_FORMAT = "invalid-format", e.INTERNAL_ERROR = "internal-error", e.UNSUPPORTED_ENVIRONMENT = "unsupported-environment";
|
|
120
|
-
})(V || (V = {}));
|
|
121
|
-
function yt(e) {
|
|
122
|
-
return "storage/" + e;
|
|
123
|
-
}
|
|
124
|
-
function At() {
|
|
125
|
-
const e = "An unknown error occurred, please check the error payload for server response.";
|
|
126
|
-
return new $(V.UNKNOWN, e);
|
|
127
|
-
}
|
|
128
|
-
function qn(e) {
|
|
129
|
-
return new $(V.OBJECT_NOT_FOUND, "Object '" + e + "' does not exist.");
|
|
130
|
-
}
|
|
131
|
-
function Kn(e) {
|
|
132
|
-
return new $(V.QUOTA_EXCEEDED, "Quota for bucket '" + e + "' exceeded, please view quota on https://firebase.google.com/pricing/.");
|
|
133
|
-
}
|
|
134
|
-
function Xn() {
|
|
135
|
-
const e = "User is not authenticated, please authenticate using Firebase Authentication and try again.";
|
|
136
|
-
return new $(V.UNAUTHENTICATED, e);
|
|
137
|
-
}
|
|
138
|
-
function Zn() {
|
|
139
|
-
return new $(V.UNAUTHORIZED_APP, "This app does not have permission to access Firebase Storage on this project.");
|
|
140
|
-
}
|
|
141
|
-
function Qn(e) {
|
|
142
|
-
return new $(V.UNAUTHORIZED, "User does not have permission to access '" + e + "'.");
|
|
143
|
-
}
|
|
144
|
-
function Jn() {
|
|
145
|
-
return new $(V.RETRY_LIMIT_EXCEEDED, "Max retry time for operation exceeded, please try again.");
|
|
146
|
-
}
|
|
147
|
-
function eo() {
|
|
148
|
-
return new $(V.CANCELED, "User canceled the upload/download.");
|
|
149
|
-
}
|
|
150
|
-
function to(e) {
|
|
151
|
-
return new $(V.INVALID_URL, "Invalid URL '" + e + "'.");
|
|
152
|
-
}
|
|
153
|
-
function no(e) {
|
|
154
|
-
return new $(V.INVALID_DEFAULT_BUCKET, "Invalid default bucket '" + e + "'.");
|
|
155
|
-
}
|
|
156
|
-
function oo() {
|
|
157
|
-
return new $(V.NO_DEFAULT_BUCKET, "No default bucket found. Did you set the '" + un + "' property when initializing the app?");
|
|
158
|
-
}
|
|
159
|
-
function io() {
|
|
160
|
-
return new $(V.CANNOT_SLICE_BLOB, "Cannot slice blob for upload. Please retry the upload.");
|
|
161
|
-
}
|
|
162
|
-
function so() {
|
|
163
|
-
return new $(V.NO_DOWNLOAD_URL, "The given file does not have any download URLs.");
|
|
164
|
-
}
|
|
165
|
-
function ao(e) {
|
|
166
|
-
return new $(V.UNSUPPORTED_ENVIRONMENT, `${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);
|
|
167
|
-
}
|
|
168
|
-
function wt(e) {
|
|
169
|
-
return new $(V.INVALID_ARGUMENT, e);
|
|
170
|
-
}
|
|
171
|
-
function dn() {
|
|
172
|
-
return new $(V.APP_DELETED, "The Firebase app was deleted.");
|
|
173
|
-
}
|
|
174
|
-
function lo(e) {
|
|
175
|
-
return new $(V.INVALID_ROOT_OPERATION, "The operation '" + e + "' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').");
|
|
176
|
-
}
|
|
177
|
-
function Je(e, t) {
|
|
178
|
-
return new $(V.INVALID_FORMAT, "String does not match format '" + e + "': " + t);
|
|
179
|
-
}
|
|
180
|
-
function Qe(e) {
|
|
181
|
-
throw new $(V.INTERNAL_ERROR, "Internal error: " + e);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* @license
|
|
185
|
-
* Copyright 2017 Google LLC
|
|
186
|
-
*
|
|
187
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
188
|
-
* you may not use this file except in compliance with the License.
|
|
189
|
-
* You may obtain a copy of the License at
|
|
190
|
-
*
|
|
191
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
192
|
-
*
|
|
193
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
194
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
195
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
196
|
-
* See the License for the specific language governing permissions and
|
|
197
|
-
* limitations under the License.
|
|
198
|
-
*/
|
|
199
|
-
class ae {
|
|
200
|
-
constructor(t, n) {
|
|
201
|
-
this.bucket = t, this.path_ = n;
|
|
202
|
-
}
|
|
203
|
-
get path() {
|
|
204
|
-
return this.path_;
|
|
205
|
-
}
|
|
206
|
-
get isRoot() {
|
|
207
|
-
return this.path.length === 0;
|
|
208
|
-
}
|
|
209
|
-
fullServerUrl() {
|
|
210
|
-
const t = encodeURIComponent;
|
|
211
|
-
return "/b/" + t(this.bucket) + "/o/" + t(this.path);
|
|
212
|
-
}
|
|
213
|
-
bucketOnlyServerUrl() {
|
|
214
|
-
return "/b/" + encodeURIComponent(this.bucket) + "/o";
|
|
215
|
-
}
|
|
216
|
-
static makeFromBucketSpec(t, n) {
|
|
217
|
-
let o;
|
|
218
|
-
try {
|
|
219
|
-
o = ae.makeFromUrl(t, n);
|
|
220
|
-
} catch {
|
|
221
|
-
return new ae(t, "");
|
|
222
|
-
}
|
|
223
|
-
if (o.path === "")
|
|
224
|
-
return o;
|
|
225
|
-
throw no(t);
|
|
226
|
-
}
|
|
227
|
-
static makeFromUrl(t, n) {
|
|
228
|
-
let o = null;
|
|
229
|
-
const i = "([A-Za-z0-9.\\-_]+)";
|
|
230
|
-
function l(E) {
|
|
231
|
-
E.path.charAt(E.path.length - 1) === "/" && (E.path_ = E.path_.slice(0, -1));
|
|
232
|
-
}
|
|
233
|
-
const r = "(/(.*))?$", m = new RegExp("^gs://" + i + r, "i"), v = { bucket: 1, path: 3 };
|
|
234
|
-
function T(E) {
|
|
235
|
-
E.path_ = decodeURIComponent(E.path);
|
|
236
|
-
}
|
|
237
|
-
const F = "v[A-Za-z0-9_]+", z = n.replace(/[.]/g, "\\."), S = "(/([^?#]*).*)?$", D = new RegExp(`^https?://${z}/${F}/b/${i}/o${S}`, "i"), O = { bucket: 1, path: 3 }, N = n === cn ? "(?:storage.googleapis.com|storage.cloud.google.com)" : n, U = "([^?#]*)", H = new RegExp(`^https?://${N}/${i}/${U}`, "i"), k = [
|
|
238
|
-
{ regex: m, indices: v, postModify: l },
|
|
239
|
-
{
|
|
240
|
-
regex: D,
|
|
241
|
-
indices: O,
|
|
242
|
-
postModify: T
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
regex: H,
|
|
246
|
-
indices: { bucket: 1, path: 2 },
|
|
247
|
-
postModify: T
|
|
248
|
-
}
|
|
249
|
-
];
|
|
250
|
-
for (let E = 0; E < k.length; E++) {
|
|
251
|
-
const K = k[E], ne = K.regex.exec(t);
|
|
252
|
-
if (ne) {
|
|
253
|
-
const le = ne[K.indices.bucket];
|
|
254
|
-
let j = ne[K.indices.path];
|
|
255
|
-
j || (j = ""), o = new ae(le, j), K.postModify(o);
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
if (o == null)
|
|
260
|
-
throw to(t);
|
|
261
|
-
return o;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
class ro {
|
|
265
|
-
constructor(t) {
|
|
266
|
-
this.promise_ = Promise.reject(t);
|
|
267
|
-
}
|
|
268
|
-
/** @inheritDoc */
|
|
269
|
-
getPromise() {
|
|
270
|
-
return this.promise_;
|
|
271
|
-
}
|
|
272
|
-
/** @inheritDoc */
|
|
273
|
-
cancel(t = !1) {
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* @license
|
|
278
|
-
* Copyright 2017 Google LLC
|
|
279
|
-
*
|
|
280
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
281
|
-
* you may not use this file except in compliance with the License.
|
|
282
|
-
* You may obtain a copy of the License at
|
|
283
|
-
*
|
|
284
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
285
|
-
*
|
|
286
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
287
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
288
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
289
|
-
* See the License for the specific language governing permissions and
|
|
290
|
-
* limitations under the License.
|
|
291
|
-
*/
|
|
292
|
-
function co(e, t, n) {
|
|
293
|
-
let o = 1, i = null, l = null, r = !1, m = 0;
|
|
294
|
-
function v() {
|
|
295
|
-
return m === 2;
|
|
296
|
-
}
|
|
297
|
-
let T = !1;
|
|
298
|
-
function F(...U) {
|
|
299
|
-
T || (T = !0, t.apply(null, U));
|
|
300
|
-
}
|
|
301
|
-
function z(U) {
|
|
302
|
-
i = setTimeout(() => {
|
|
303
|
-
i = null, e(D, v());
|
|
304
|
-
}, U);
|
|
305
|
-
}
|
|
306
|
-
function S() {
|
|
307
|
-
l && clearTimeout(l);
|
|
308
|
-
}
|
|
309
|
-
function D(U, ...H) {
|
|
310
|
-
if (T) {
|
|
311
|
-
S();
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
if (U) {
|
|
315
|
-
S(), F.call(null, U, ...H);
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (v() || r) {
|
|
319
|
-
S(), F.call(null, U, ...H);
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
o < 64 && (o *= 2);
|
|
323
|
-
let k;
|
|
324
|
-
m === 1 ? (m = 2, k = 0) : k = (o + Math.random()) * 1e3, z(k);
|
|
325
|
-
}
|
|
326
|
-
let O = !1;
|
|
327
|
-
function N(U) {
|
|
328
|
-
O || (O = !0, S(), !T && (i !== null ? (U || (m = 2), clearTimeout(i), z(0)) : U || (m = 1)));
|
|
329
|
-
}
|
|
330
|
-
return z(0), l = setTimeout(() => {
|
|
331
|
-
r = !0, N(!0);
|
|
332
|
-
}, n), N;
|
|
333
|
-
}
|
|
334
|
-
function uo(e) {
|
|
335
|
-
e(!1);
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* @license
|
|
339
|
-
* Copyright 2017 Google LLC
|
|
340
|
-
*
|
|
341
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
342
|
-
* you may not use this file except in compliance with the License.
|
|
343
|
-
* You may obtain a copy of the License at
|
|
344
|
-
*
|
|
345
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
346
|
-
*
|
|
347
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
348
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
349
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
350
|
-
* See the License for the specific language governing permissions and
|
|
351
|
-
* limitations under the License.
|
|
352
|
-
*/
|
|
353
|
-
function mo(e) {
|
|
354
|
-
return e !== void 0;
|
|
355
|
-
}
|
|
356
|
-
function po(e) {
|
|
357
|
-
return typeof e == "object" && !Array.isArray(e);
|
|
358
|
-
}
|
|
359
|
-
function Dt(e) {
|
|
360
|
-
return typeof e == "string" || e instanceof String;
|
|
361
|
-
}
|
|
362
|
-
function Gt(e) {
|
|
363
|
-
return zt() && e instanceof Blob;
|
|
364
|
-
}
|
|
365
|
-
function zt() {
|
|
366
|
-
return typeof Blob < "u";
|
|
367
|
-
}
|
|
368
|
-
function Yt(e, t, n, o) {
|
|
369
|
-
if (o < t)
|
|
370
|
-
throw wt(`Invalid value for '${e}'. Expected ${t} or greater.`);
|
|
371
|
-
if (o > n)
|
|
372
|
-
throw wt(`Invalid value for '${e}'. Expected ${n} or less.`);
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* @license
|
|
376
|
-
* Copyright 2017 Google LLC
|
|
377
|
-
*
|
|
378
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
379
|
-
* you may not use this file except in compliance with the License.
|
|
380
|
-
* You may obtain a copy of the License at
|
|
381
|
-
*
|
|
382
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
383
|
-
*
|
|
384
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
385
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
386
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
387
|
-
* See the License for the specific language governing permissions and
|
|
388
|
-
* limitations under the License.
|
|
389
|
-
*/
|
|
390
|
-
function pt(e, t, n) {
|
|
391
|
-
let o = t;
|
|
392
|
-
return n == null && (o = `https://${t}`), `${n}://${o}/v0${e}`;
|
|
393
|
-
}
|
|
394
|
-
function mn(e) {
|
|
395
|
-
const t = encodeURIComponent;
|
|
396
|
-
let n = "?";
|
|
397
|
-
for (const o in e)
|
|
398
|
-
if (e.hasOwnProperty(o)) {
|
|
399
|
-
const i = t(o) + "=" + t(e[o]);
|
|
400
|
-
n = n + i + "&";
|
|
401
|
-
}
|
|
402
|
-
return n = n.slice(0, -1), n;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* @license
|
|
406
|
-
* Copyright 2017 Google LLC
|
|
407
|
-
*
|
|
408
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
409
|
-
* you may not use this file except in compliance with the License.
|
|
410
|
-
* You may obtain a copy of the License at
|
|
411
|
-
*
|
|
412
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
413
|
-
*
|
|
414
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
415
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
416
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
417
|
-
* See the License for the specific language governing permissions and
|
|
418
|
-
* limitations under the License.
|
|
419
|
-
*/
|
|
420
|
-
var Ce;
|
|
421
|
-
(function(e) {
|
|
422
|
-
e[e.NO_ERROR = 0] = "NO_ERROR", e[e.NETWORK_ERROR = 1] = "NETWORK_ERROR", e[e.ABORT = 2] = "ABORT";
|
|
423
|
-
})(Ce || (Ce = {}));
|
|
424
|
-
/**
|
|
425
|
-
* @license
|
|
426
|
-
* Copyright 2022 Google LLC
|
|
427
|
-
*
|
|
428
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
429
|
-
* you may not use this file except in compliance with the License.
|
|
430
|
-
* You may obtain a copy of the License at
|
|
431
|
-
*
|
|
432
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
433
|
-
*
|
|
434
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
435
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
436
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
437
|
-
* See the License for the specific language governing permissions and
|
|
438
|
-
* limitations under the License.
|
|
439
|
-
*/
|
|
440
|
-
function fo(e, t) {
|
|
441
|
-
const n = e >= 500 && e < 600, i = [
|
|
442
|
-
// Request Timeout: web server didn't receive full request in time.
|
|
443
|
-
408,
|
|
444
|
-
// Too Many Requests: you're getting rate-limited, basically.
|
|
445
|
-
429
|
|
446
|
-
].indexOf(e) !== -1, l = t.indexOf(e) !== -1;
|
|
447
|
-
return n || i || l;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* @license
|
|
451
|
-
* Copyright 2017 Google LLC
|
|
452
|
-
*
|
|
453
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
454
|
-
* you may not use this file except in compliance with the License.
|
|
455
|
-
* You may obtain a copy of the License at
|
|
456
|
-
*
|
|
457
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
458
|
-
*
|
|
459
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
460
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
461
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
462
|
-
* See the License for the specific language governing permissions and
|
|
463
|
-
* limitations under the License.
|
|
464
|
-
*/
|
|
465
|
-
class ho {
|
|
466
|
-
constructor(t, n, o, i, l, r, m, v, T, F, z, S = !0) {
|
|
467
|
-
this.url_ = t, this.method_ = n, this.headers_ = o, this.body_ = i, this.successCodes_ = l, this.additionalRetryCodes_ = r, this.callback_ = m, this.errorCallback_ = v, this.timeout_ = T, this.progressCallback_ = F, this.connectionFactory_ = z, this.retry = S, this.pendingConnection_ = null, this.backoffId_ = null, this.canceled_ = !1, this.appDelete_ = !1, this.promise_ = new Promise((D, O) => {
|
|
468
|
-
this.resolve_ = D, this.reject_ = O, this.start_();
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Actually starts the retry loop.
|
|
473
|
-
*/
|
|
474
|
-
start_() {
|
|
475
|
-
const t = (o, i) => {
|
|
476
|
-
if (i) {
|
|
477
|
-
o(!1, new rt(!1, null, !0));
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
const l = this.connectionFactory_();
|
|
481
|
-
this.pendingConnection_ = l;
|
|
482
|
-
const r = (m) => {
|
|
483
|
-
const v = m.loaded, T = m.lengthComputable ? m.total : -1;
|
|
484
|
-
this.progressCallback_ !== null && this.progressCallback_(v, T);
|
|
485
|
-
};
|
|
486
|
-
this.progressCallback_ !== null && l.addUploadProgressListener(r), l.send(this.url_, this.method_, this.body_, this.headers_).then(() => {
|
|
487
|
-
this.progressCallback_ !== null && l.removeUploadProgressListener(r), this.pendingConnection_ = null;
|
|
488
|
-
const m = l.getErrorCode() === Ce.NO_ERROR, v = l.getStatus();
|
|
489
|
-
if (!m || fo(v, this.additionalRetryCodes_) && this.retry) {
|
|
490
|
-
const F = l.getErrorCode() === Ce.ABORT;
|
|
491
|
-
o(!1, new rt(!1, null, F));
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
const T = this.successCodes_.indexOf(v) !== -1;
|
|
495
|
-
o(!0, new rt(T, l));
|
|
496
|
-
});
|
|
497
|
-
}, n = (o, i) => {
|
|
498
|
-
const l = this.resolve_, r = this.reject_, m = i.connection;
|
|
499
|
-
if (i.wasSuccessCode)
|
|
500
|
-
try {
|
|
501
|
-
const v = this.callback_(m, m.getResponse());
|
|
502
|
-
mo(v) ? l(v) : l();
|
|
503
|
-
} catch (v) {
|
|
504
|
-
r(v);
|
|
505
|
-
}
|
|
506
|
-
else if (m !== null) {
|
|
507
|
-
const v = At();
|
|
508
|
-
v.serverResponse = m.getErrorText(), this.errorCallback_ ? r(this.errorCallback_(m, v)) : r(v);
|
|
509
|
-
} else if (i.canceled) {
|
|
510
|
-
const v = this.appDelete_ ? dn() : eo();
|
|
511
|
-
r(v);
|
|
512
|
-
} else {
|
|
513
|
-
const v = Jn();
|
|
514
|
-
r(v);
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
this.canceled_ ? n(!1, new rt(!1, null, !0)) : this.backoffId_ = co(t, n, this.timeout_);
|
|
518
|
-
}
|
|
519
|
-
/** @inheritDoc */
|
|
520
|
-
getPromise() {
|
|
521
|
-
return this.promise_;
|
|
522
|
-
}
|
|
523
|
-
/** @inheritDoc */
|
|
524
|
-
cancel(t) {
|
|
525
|
-
this.canceled_ = !0, this.appDelete_ = t || !1, this.backoffId_ !== null && uo(this.backoffId_), this.pendingConnection_ !== null && this.pendingConnection_.abort();
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
class rt {
|
|
529
|
-
constructor(t, n, o) {
|
|
530
|
-
this.wasSuccessCode = t, this.connection = n, this.canceled = !!o;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
function _o(e, t) {
|
|
534
|
-
t !== null && t.length > 0 && (e.Authorization = "Firebase " + t);
|
|
535
|
-
}
|
|
536
|
-
function vo(e, t) {
|
|
537
|
-
e["X-Firebase-Storage-Version"] = "webjs/" + (t ?? "AppManager");
|
|
538
|
-
}
|
|
539
|
-
function go(e, t) {
|
|
540
|
-
t && (e["X-Firebase-GMPID"] = t);
|
|
541
|
-
}
|
|
542
|
-
function bo(e, t) {
|
|
543
|
-
t !== null && (e["X-Firebase-AppCheck"] = t);
|
|
544
|
-
}
|
|
545
|
-
function yo(e, t, n, o, i, l, r = !0) {
|
|
546
|
-
const m = mn(e.urlParams), v = e.url + m, T = Object.assign({}, e.headers);
|
|
547
|
-
return go(T, t), _o(T, n), vo(T, l), bo(T, o), new ho(v, e.method, T, e.body, e.successCodes, e.additionalRetryCodes, e.handler, e.errorHandler, e.timeout, e.progressCallback, i, r);
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* @license
|
|
551
|
-
* Copyright 2017 Google LLC
|
|
552
|
-
*
|
|
553
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
554
|
-
* you may not use this file except in compliance with the License.
|
|
555
|
-
* You may obtain a copy of the License at
|
|
556
|
-
*
|
|
557
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
558
|
-
*
|
|
559
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
560
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
561
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
562
|
-
* See the License for the specific language governing permissions and
|
|
563
|
-
* limitations under the License.
|
|
564
|
-
*/
|
|
565
|
-
function To() {
|
|
566
|
-
return typeof BlobBuilder < "u" ? BlobBuilder : typeof WebKitBlobBuilder < "u" ? WebKitBlobBuilder : void 0;
|
|
567
|
-
}
|
|
568
|
-
function Eo(...e) {
|
|
569
|
-
const t = To();
|
|
570
|
-
if (t !== void 0) {
|
|
571
|
-
const n = new t();
|
|
572
|
-
for (let o = 0; o < e.length; o++)
|
|
573
|
-
n.append(e[o]);
|
|
574
|
-
return n.getBlob();
|
|
575
|
-
} else {
|
|
576
|
-
if (zt())
|
|
577
|
-
return new Blob(e);
|
|
578
|
-
throw new $(V.UNSUPPORTED_ENVIRONMENT, "This browser doesn't seem to support creating Blobs");
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
function Io(e, t, n) {
|
|
582
|
-
return e.webkitSlice ? e.webkitSlice(t, n) : e.mozSlice ? e.mozSlice(t, n) : e.slice ? e.slice(t, n) : null;
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* @license
|
|
586
|
-
* Copyright 2021 Google LLC
|
|
587
|
-
*
|
|
588
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
589
|
-
* you may not use this file except in compliance with the License.
|
|
590
|
-
* You may obtain a copy of the License at
|
|
591
|
-
*
|
|
592
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
593
|
-
*
|
|
594
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
595
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
596
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
597
|
-
* See the License for the specific language governing permissions and
|
|
598
|
-
* limitations under the License.
|
|
599
|
-
*/
|
|
600
|
-
function Fo(e) {
|
|
601
|
-
if (typeof atob > "u")
|
|
602
|
-
throw ao("base-64");
|
|
603
|
-
return atob(e);
|
|
604
|
-
}
|
|
605
|
-
/**
|
|
606
|
-
* @license
|
|
607
|
-
* Copyright 2017 Google LLC
|
|
608
|
-
*
|
|
609
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
610
|
-
* you may not use this file except in compliance with the License.
|
|
611
|
-
* You may obtain a copy of the License at
|
|
612
|
-
*
|
|
613
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
614
|
-
*
|
|
615
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
616
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
617
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
618
|
-
* See the License for the specific language governing permissions and
|
|
619
|
-
* limitations under the License.
|
|
620
|
-
*/
|
|
621
|
-
const ve = {
|
|
622
|
-
/**
|
|
623
|
-
* Indicates the string should be interpreted "raw", that is, as normal text.
|
|
624
|
-
* The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte
|
|
625
|
-
* sequence.
|
|
626
|
-
* Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence
|
|
627
|
-
* 48 65 6c 6c 6f 21 20 f0 9f 98 8a
|
|
628
|
-
*/
|
|
629
|
-
RAW: "raw",
|
|
630
|
-
/**
|
|
631
|
-
* Indicates the string should be interpreted as base64-encoded data.
|
|
632
|
-
* Padding characters (trailing '='s) are optional.
|
|
633
|
-
* Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence
|
|
634
|
-
* ad 69 8e fb e1 3a b7 bf eb 97
|
|
635
|
-
*/
|
|
636
|
-
BASE64: "base64",
|
|
637
|
-
/**
|
|
638
|
-
* Indicates the string should be interpreted as base64url-encoded data.
|
|
639
|
-
* Padding characters (trailing '='s) are optional.
|
|
640
|
-
* Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence
|
|
641
|
-
* ad 69 8e fb e1 3a b7 bf eb 97
|
|
642
|
-
*/
|
|
643
|
-
BASE64URL: "base64url",
|
|
644
|
-
/**
|
|
645
|
-
* Indicates the string is a data URL, such as one obtained from
|
|
646
|
-
* canvas.toDataURL().
|
|
647
|
-
* Example: the string 'data:application/octet-stream;base64,aaaa'
|
|
648
|
-
* becomes the byte sequence
|
|
649
|
-
* 69 a6 9a
|
|
650
|
-
* (the content-type "application/octet-stream" is also applied, but can
|
|
651
|
-
* be overridden in the metadata object).
|
|
652
|
-
*/
|
|
653
|
-
DATA_URL: "data_url"
|
|
654
|
-
};
|
|
655
|
-
class Tt {
|
|
656
|
-
constructor(t, n) {
|
|
657
|
-
this.data = t, this.contentType = n || null;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
function wo(e, t) {
|
|
661
|
-
switch (e) {
|
|
662
|
-
case ve.RAW:
|
|
663
|
-
return new Tt(pn(t));
|
|
664
|
-
case ve.BASE64:
|
|
665
|
-
case ve.BASE64URL:
|
|
666
|
-
return new Tt(fn(e, t));
|
|
667
|
-
case ve.DATA_URL:
|
|
668
|
-
return new Tt(ko(t), Ro(t));
|
|
669
|
-
}
|
|
670
|
-
throw At();
|
|
671
|
-
}
|
|
672
|
-
function pn(e) {
|
|
673
|
-
const t = [];
|
|
674
|
-
for (let n = 0; n < e.length; n++) {
|
|
675
|
-
let o = e.charCodeAt(n);
|
|
676
|
-
if (o <= 127)
|
|
677
|
-
t.push(o);
|
|
678
|
-
else if (o <= 2047)
|
|
679
|
-
t.push(192 | o >> 6, 128 | o & 63);
|
|
680
|
-
else if ((o & 64512) === 55296)
|
|
681
|
-
if (!(n < e.length - 1 && (e.charCodeAt(n + 1) & 64512) === 56320))
|
|
682
|
-
t.push(239, 191, 189);
|
|
683
|
-
else {
|
|
684
|
-
const l = o, r = e.charCodeAt(++n);
|
|
685
|
-
o = 65536 | (l & 1023) << 10 | r & 1023, t.push(240 | o >> 18, 128 | o >> 12 & 63, 128 | o >> 6 & 63, 128 | o & 63);
|
|
686
|
-
}
|
|
687
|
-
else
|
|
688
|
-
(o & 64512) === 56320 ? t.push(239, 191, 189) : t.push(224 | o >> 12, 128 | o >> 6 & 63, 128 | o & 63);
|
|
689
|
-
}
|
|
690
|
-
return new Uint8Array(t);
|
|
691
|
-
}
|
|
692
|
-
function Co(e) {
|
|
693
|
-
let t;
|
|
694
|
-
try {
|
|
695
|
-
t = decodeURIComponent(e);
|
|
696
|
-
} catch {
|
|
697
|
-
throw Je(ve.DATA_URL, "Malformed data URL.");
|
|
698
|
-
}
|
|
699
|
-
return pn(t);
|
|
700
|
-
}
|
|
701
|
-
function fn(e, t) {
|
|
702
|
-
switch (e) {
|
|
703
|
-
case ve.BASE64: {
|
|
704
|
-
const i = t.indexOf("-") !== -1, l = t.indexOf("_") !== -1;
|
|
705
|
-
if (i || l)
|
|
706
|
-
throw Je(e, "Invalid character '" + (i ? "-" : "_") + "' found: is it base64url encoded?");
|
|
707
|
-
break;
|
|
708
|
-
}
|
|
709
|
-
case ve.BASE64URL: {
|
|
710
|
-
const i = t.indexOf("+") !== -1, l = t.indexOf("/") !== -1;
|
|
711
|
-
if (i || l)
|
|
712
|
-
throw Je(e, "Invalid character '" + (i ? "+" : "/") + "' found: is it base64 encoded?");
|
|
713
|
-
t = t.replace(/-/g, "+").replace(/_/g, "/");
|
|
714
|
-
break;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
let n;
|
|
718
|
-
try {
|
|
719
|
-
n = Fo(t);
|
|
720
|
-
} catch (i) {
|
|
721
|
-
throw i.message.includes("polyfill") ? i : Je(e, "Invalid character found");
|
|
722
|
-
}
|
|
723
|
-
const o = new Uint8Array(n.length);
|
|
724
|
-
for (let i = 0; i < n.length; i++)
|
|
725
|
-
o[i] = n.charCodeAt(i);
|
|
726
|
-
return o;
|
|
727
|
-
}
|
|
728
|
-
class hn {
|
|
729
|
-
constructor(t) {
|
|
730
|
-
this.base64 = !1, this.contentType = null;
|
|
731
|
-
const n = t.match(/^data:([^,]+)?,/);
|
|
732
|
-
if (n === null)
|
|
733
|
-
throw Je(ve.DATA_URL, "Must be formatted 'data:[<mediatype>][;base64],<data>");
|
|
734
|
-
const o = n[1] || null;
|
|
735
|
-
o != null && (this.base64 = Oo(o, ";base64"), this.contentType = this.base64 ? o.substring(0, o.length - 7) : o), this.rest = t.substring(t.indexOf(",") + 1);
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
function ko(e) {
|
|
739
|
-
const t = new hn(e);
|
|
740
|
-
return t.base64 ? fn(ve.BASE64, t.rest) : Co(t.rest);
|
|
741
|
-
}
|
|
742
|
-
function Ro(e) {
|
|
743
|
-
return new hn(e).contentType;
|
|
744
|
-
}
|
|
745
|
-
function Oo(e, t) {
|
|
746
|
-
return e.length >= t.length ? e.substring(e.length - t.length) === t : !1;
|
|
747
|
-
}
|
|
748
|
-
/**
|
|
749
|
-
* @license
|
|
750
|
-
* Copyright 2017 Google LLC
|
|
751
|
-
*
|
|
752
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
753
|
-
* you may not use this file except in compliance with the License.
|
|
754
|
-
* You may obtain a copy of the License at
|
|
755
|
-
*
|
|
756
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
757
|
-
*
|
|
758
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
759
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
760
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
761
|
-
* See the License for the specific language governing permissions and
|
|
762
|
-
* limitations under the License.
|
|
763
|
-
*/
|
|
764
|
-
class Ie {
|
|
765
|
-
constructor(t, n) {
|
|
766
|
-
let o = 0, i = "";
|
|
767
|
-
Gt(t) ? (this.data_ = t, o = t.size, i = t.type) : t instanceof ArrayBuffer ? (n ? this.data_ = new Uint8Array(t) : (this.data_ = new Uint8Array(t.byteLength), this.data_.set(new Uint8Array(t))), o = this.data_.length) : t instanceof Uint8Array && (n ? this.data_ = t : (this.data_ = new Uint8Array(t.length), this.data_.set(t)), o = t.length), this.size_ = o, this.type_ = i;
|
|
768
|
-
}
|
|
769
|
-
size() {
|
|
770
|
-
return this.size_;
|
|
771
|
-
}
|
|
772
|
-
type() {
|
|
773
|
-
return this.type_;
|
|
774
|
-
}
|
|
775
|
-
slice(t, n) {
|
|
776
|
-
if (Gt(this.data_)) {
|
|
777
|
-
const o = this.data_, i = Io(o, t, n);
|
|
778
|
-
return i === null ? null : new Ie(i);
|
|
779
|
-
} else {
|
|
780
|
-
const o = new Uint8Array(this.data_.buffer, t, n - t);
|
|
781
|
-
return new Ie(o, !0);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
static getBlob(...t) {
|
|
785
|
-
if (zt()) {
|
|
786
|
-
const n = t.map((o) => o instanceof Ie ? o.data_ : o);
|
|
787
|
-
return new Ie(Eo.apply(null, n));
|
|
788
|
-
} else {
|
|
789
|
-
const n = t.map((r) => Dt(r) ? wo(ve.RAW, r).data : r.data_);
|
|
790
|
-
let o = 0;
|
|
791
|
-
n.forEach((r) => {
|
|
792
|
-
o += r.byteLength;
|
|
793
|
-
});
|
|
794
|
-
const i = new Uint8Array(o);
|
|
795
|
-
let l = 0;
|
|
796
|
-
return n.forEach((r) => {
|
|
797
|
-
for (let m = 0; m < r.length; m++)
|
|
798
|
-
i[l++] = r[m];
|
|
799
|
-
}), new Ie(i, !0);
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
uploadData() {
|
|
803
|
-
return this.data_;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* @license
|
|
808
|
-
* Copyright 2017 Google LLC
|
|
809
|
-
*
|
|
810
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
811
|
-
* you may not use this file except in compliance with the License.
|
|
812
|
-
* You may obtain a copy of the License at
|
|
813
|
-
*
|
|
814
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
815
|
-
*
|
|
816
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
817
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
818
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
819
|
-
* See the License for the specific language governing permissions and
|
|
820
|
-
* limitations under the License.
|
|
821
|
-
*/
|
|
822
|
-
function _n(e) {
|
|
823
|
-
let t;
|
|
824
|
-
try {
|
|
825
|
-
t = JSON.parse(e);
|
|
826
|
-
} catch {
|
|
827
|
-
return null;
|
|
828
|
-
}
|
|
829
|
-
return po(t) ? t : null;
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* @license
|
|
833
|
-
* Copyright 2017 Google LLC
|
|
834
|
-
*
|
|
835
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
836
|
-
* you may not use this file except in compliance with the License.
|
|
837
|
-
* You may obtain a copy of the License at
|
|
838
|
-
*
|
|
839
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
840
|
-
*
|
|
841
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
842
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
843
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
844
|
-
* See the License for the specific language governing permissions and
|
|
845
|
-
* limitations under the License.
|
|
846
|
-
*/
|
|
847
|
-
function Ao(e) {
|
|
848
|
-
if (e.length === 0)
|
|
849
|
-
return null;
|
|
850
|
-
const t = e.lastIndexOf("/");
|
|
851
|
-
return t === -1 ? "" : e.slice(0, t);
|
|
852
|
-
}
|
|
853
|
-
function Do(e, t) {
|
|
854
|
-
const n = t.split("/").filter((o) => o.length > 0).join("/");
|
|
855
|
-
return e.length === 0 ? n : e + "/" + n;
|
|
856
|
-
}
|
|
857
|
-
function vn(e) {
|
|
858
|
-
const t = e.lastIndexOf("/", e.length - 2);
|
|
859
|
-
return t === -1 ? e : e.slice(t + 1);
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* @license
|
|
863
|
-
* Copyright 2017 Google LLC
|
|
864
|
-
*
|
|
865
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
866
|
-
* you may not use this file except in compliance with the License.
|
|
867
|
-
* You may obtain a copy of the License at
|
|
868
|
-
*
|
|
869
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
870
|
-
*
|
|
871
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
872
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
873
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
874
|
-
* See the License for the specific language governing permissions and
|
|
875
|
-
* limitations under the License.
|
|
876
|
-
*/
|
|
877
|
-
function zo(e, t) {
|
|
878
|
-
return t;
|
|
879
|
-
}
|
|
880
|
-
class ee {
|
|
881
|
-
constructor(t, n, o, i) {
|
|
882
|
-
this.server = t, this.local = n || t, this.writable = !!o, this.xform = i || zo;
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
let ct = null;
|
|
886
|
-
function So(e) {
|
|
887
|
-
return !Dt(e) || e.length < 2 ? e : vn(e);
|
|
888
|
-
}
|
|
889
|
-
function gn() {
|
|
890
|
-
if (ct)
|
|
891
|
-
return ct;
|
|
892
|
-
const e = [];
|
|
893
|
-
e.push(new ee("bucket")), e.push(new ee("generation")), e.push(new ee("metageneration")), e.push(new ee("name", "fullPath", !0));
|
|
894
|
-
function t(l, r) {
|
|
895
|
-
return So(r);
|
|
896
|
-
}
|
|
897
|
-
const n = new ee("name");
|
|
898
|
-
n.xform = t, e.push(n);
|
|
899
|
-
function o(l, r) {
|
|
900
|
-
return r !== void 0 ? Number(r) : r;
|
|
901
|
-
}
|
|
902
|
-
const i = new ee("size");
|
|
903
|
-
return i.xform = o, e.push(i), e.push(new ee("timeCreated")), e.push(new ee("updated")), e.push(new ee("md5Hash", null, !0)), e.push(new ee("cacheControl", null, !0)), e.push(new ee("contentDisposition", null, !0)), e.push(new ee("contentEncoding", null, !0)), e.push(new ee("contentLanguage", null, !0)), e.push(new ee("contentType", null, !0)), e.push(new ee("metadata", "customMetadata", !0)), ct = e, ct;
|
|
904
|
-
}
|
|
905
|
-
function No(e, t) {
|
|
906
|
-
function n() {
|
|
907
|
-
const o = e.bucket, i = e.fullPath, l = new ae(o, i);
|
|
908
|
-
return t._makeStorageReference(l);
|
|
909
|
-
}
|
|
910
|
-
Object.defineProperty(e, "ref", { get: n });
|
|
911
|
-
}
|
|
912
|
-
function Po(e, t, n) {
|
|
913
|
-
const o = {};
|
|
914
|
-
o.type = "file";
|
|
915
|
-
const i = n.length;
|
|
916
|
-
for (let l = 0; l < i; l++) {
|
|
917
|
-
const r = n[l];
|
|
918
|
-
o[r.local] = r.xform(o, t[r.server]);
|
|
919
|
-
}
|
|
920
|
-
return No(o, e), o;
|
|
921
|
-
}
|
|
922
|
-
function bn(e, t, n) {
|
|
923
|
-
const o = _n(t);
|
|
924
|
-
return o === null ? null : Po(e, o, n);
|
|
925
|
-
}
|
|
926
|
-
function xo(e, t, n, o) {
|
|
927
|
-
const i = _n(t);
|
|
928
|
-
if (i === null || !Dt(i.downloadTokens))
|
|
929
|
-
return null;
|
|
930
|
-
const l = i.downloadTokens;
|
|
931
|
-
if (l.length === 0)
|
|
932
|
-
return null;
|
|
933
|
-
const r = encodeURIComponent;
|
|
934
|
-
return l.split(",").map((T) => {
|
|
935
|
-
const F = e.bucket, z = e.fullPath, S = "/b/" + r(F) + "/o/" + r(z), D = pt(S, n, o), O = mn({
|
|
936
|
-
alt: "media",
|
|
937
|
-
token: T
|
|
938
|
-
});
|
|
939
|
-
return D + O;
|
|
940
|
-
})[0];
|
|
941
|
-
}
|
|
942
|
-
function Uo(e, t) {
|
|
943
|
-
const n = {}, o = t.length;
|
|
944
|
-
for (let i = 0; i < o; i++) {
|
|
945
|
-
const l = t[i];
|
|
946
|
-
l.writable && (n[l.server] = e[l.local]);
|
|
947
|
-
}
|
|
948
|
-
return JSON.stringify(n);
|
|
949
|
-
}
|
|
950
|
-
class St {
|
|
951
|
-
constructor(t, n, o, i) {
|
|
952
|
-
this.url = t, this.method = n, this.handler = o, this.timeout = i, this.urlParams = {}, this.headers = {}, this.body = null, this.errorHandler = null, this.progressCallback = null, this.successCodes = [200], this.additionalRetryCodes = [];
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
/**
|
|
956
|
-
* @license
|
|
957
|
-
* Copyright 2017 Google LLC
|
|
958
|
-
*
|
|
959
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
960
|
-
* you may not use this file except in compliance with the License.
|
|
961
|
-
* You may obtain a copy of the License at
|
|
962
|
-
*
|
|
963
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
964
|
-
*
|
|
965
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
966
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
967
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
968
|
-
* See the License for the specific language governing permissions and
|
|
969
|
-
* limitations under the License.
|
|
970
|
-
*/
|
|
971
|
-
function yn(e) {
|
|
972
|
-
if (!e)
|
|
973
|
-
throw At();
|
|
974
|
-
}
|
|
975
|
-
function Mo(e, t) {
|
|
976
|
-
function n(o, i) {
|
|
977
|
-
const l = bn(e, i, t);
|
|
978
|
-
return yn(l !== null), l;
|
|
979
|
-
}
|
|
980
|
-
return n;
|
|
981
|
-
}
|
|
982
|
-
function Lo(e, t) {
|
|
983
|
-
function n(o, i) {
|
|
984
|
-
const l = bn(e, i, t);
|
|
985
|
-
return yn(l !== null), xo(l, i, e.host, e._protocol);
|
|
986
|
-
}
|
|
987
|
-
return n;
|
|
988
|
-
}
|
|
989
|
-
function Tn(e) {
|
|
990
|
-
function t(n, o) {
|
|
991
|
-
let i;
|
|
992
|
-
return n.getStatus() === 401 ? /* This exact message string is the only consistent part of the */ /* server's error response that identifies it as an App Check error. */ n.getErrorText().includes("Firebase App Check token is invalid") ? i = Zn() : i = Xn() : n.getStatus() === 402 ? i = Kn(e.bucket) : n.getStatus() === 403 ? i = Qn(e.path) : i = o, i.status = n.getStatus(), i.serverResponse = o.serverResponse, i;
|
|
993
|
-
}
|
|
994
|
-
return t;
|
|
995
|
-
}
|
|
996
|
-
function En(e) {
|
|
997
|
-
const t = Tn(e);
|
|
998
|
-
function n(o, i) {
|
|
999
|
-
let l = t(o, i);
|
|
1000
|
-
return o.getStatus() === 404 && (l = qn(e.path)), l.serverResponse = i.serverResponse, l;
|
|
1001
|
-
}
|
|
1002
|
-
return n;
|
|
1003
|
-
}
|
|
1004
|
-
function Bo(e, t, n) {
|
|
1005
|
-
const o = t.fullServerUrl(), i = pt(o, e.host, e._protocol), l = "GET", r = e.maxOperationRetryTime, m = new St(i, l, Lo(e, n), r);
|
|
1006
|
-
return m.errorHandler = En(t), m;
|
|
1007
|
-
}
|
|
1008
|
-
function Vo(e, t) {
|
|
1009
|
-
const n = t.fullServerUrl(), o = pt(n, e.host, e._protocol), i = "DELETE", l = e.maxOperationRetryTime;
|
|
1010
|
-
function r(v, T) {
|
|
1011
|
-
}
|
|
1012
|
-
const m = new St(o, i, r, l);
|
|
1013
|
-
return m.successCodes = [200, 204], m.errorHandler = En(t), m;
|
|
1014
|
-
}
|
|
1015
|
-
function $o(e, t) {
|
|
1016
|
-
return e && e.contentType || t && t.type() || "application/octet-stream";
|
|
1017
|
-
}
|
|
1018
|
-
function jo(e, t, n) {
|
|
1019
|
-
const o = Object.assign({}, n);
|
|
1020
|
-
return o.fullPath = e.path, o.size = t.size(), o.contentType || (o.contentType = $o(null, t)), o;
|
|
1021
|
-
}
|
|
1022
|
-
function Ho(e, t, n, o, i) {
|
|
1023
|
-
const l = t.bucketOnlyServerUrl(), r = {
|
|
1024
|
-
"X-Goog-Upload-Protocol": "multipart"
|
|
1025
|
-
};
|
|
1026
|
-
function m() {
|
|
1027
|
-
let k = "";
|
|
1028
|
-
for (let E = 0; E < 2; E++)
|
|
1029
|
-
k = k + Math.random().toString().slice(2);
|
|
1030
|
-
return k;
|
|
1031
|
-
}
|
|
1032
|
-
const v = m();
|
|
1033
|
-
r["Content-Type"] = "multipart/related; boundary=" + v;
|
|
1034
|
-
const T = jo(t, o, i), F = Uo(T, n), z = "--" + v + `\r
|
|
1035
|
-
Content-Type: application/json; charset=utf-8\r
|
|
1036
|
-
\r
|
|
1037
|
-
` + F + `\r
|
|
1038
|
-
--` + v + `\r
|
|
1039
|
-
Content-Type: ` + T.contentType + `\r
|
|
1040
|
-
\r
|
|
1041
|
-
`, S = `\r
|
|
1042
|
-
--` + v + "--", D = Ie.getBlob(z, o, S);
|
|
1043
|
-
if (D === null)
|
|
1044
|
-
throw io();
|
|
1045
|
-
const O = { name: T.fullPath }, N = pt(l, e.host, e._protocol), U = "POST", H = e.maxUploadRetryTime, W = new St(N, U, Mo(e, n), H);
|
|
1046
|
-
return W.urlParams = O, W.headers = r, W.body = D.uploadData(), W.errorHandler = Tn(t), W;
|
|
1047
|
-
}
|
|
1048
|
-
class Wo {
|
|
1049
|
-
constructor() {
|
|
1050
|
-
this.sent_ = !1, this.xhr_ = new XMLHttpRequest(), this.initXhr(), this.errorCode_ = Ce.NO_ERROR, this.sendPromise_ = new Promise((t) => {
|
|
1051
|
-
this.xhr_.addEventListener("abort", () => {
|
|
1052
|
-
this.errorCode_ = Ce.ABORT, t();
|
|
1053
|
-
}), this.xhr_.addEventListener("error", () => {
|
|
1054
|
-
this.errorCode_ = Ce.NETWORK_ERROR, t();
|
|
1055
|
-
}), this.xhr_.addEventListener("load", () => {
|
|
1056
|
-
t();
|
|
1057
|
-
});
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
send(t, n, o, i) {
|
|
1061
|
-
if (this.sent_)
|
|
1062
|
-
throw Qe("cannot .send() more than once");
|
|
1063
|
-
if (this.sent_ = !0, this.xhr_.open(n, t, !0), i !== void 0)
|
|
1064
|
-
for (const l in i)
|
|
1065
|
-
i.hasOwnProperty(l) && this.xhr_.setRequestHeader(l, i[l].toString());
|
|
1066
|
-
return o !== void 0 ? this.xhr_.send(o) : this.xhr_.send(), this.sendPromise_;
|
|
1067
|
-
}
|
|
1068
|
-
getErrorCode() {
|
|
1069
|
-
if (!this.sent_)
|
|
1070
|
-
throw Qe("cannot .getErrorCode() before sending");
|
|
1071
|
-
return this.errorCode_;
|
|
1072
|
-
}
|
|
1073
|
-
getStatus() {
|
|
1074
|
-
if (!this.sent_)
|
|
1075
|
-
throw Qe("cannot .getStatus() before sending");
|
|
1076
|
-
try {
|
|
1077
|
-
return this.xhr_.status;
|
|
1078
|
-
} catch {
|
|
1079
|
-
return -1;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
getResponse() {
|
|
1083
|
-
if (!this.sent_)
|
|
1084
|
-
throw Qe("cannot .getResponse() before sending");
|
|
1085
|
-
return this.xhr_.response;
|
|
1086
|
-
}
|
|
1087
|
-
getErrorText() {
|
|
1088
|
-
if (!this.sent_)
|
|
1089
|
-
throw Qe("cannot .getErrorText() before sending");
|
|
1090
|
-
return this.xhr_.statusText;
|
|
1091
|
-
}
|
|
1092
|
-
/** Aborts the request. */
|
|
1093
|
-
abort() {
|
|
1094
|
-
this.xhr_.abort();
|
|
1095
|
-
}
|
|
1096
|
-
getResponseHeader(t) {
|
|
1097
|
-
return this.xhr_.getResponseHeader(t);
|
|
1098
|
-
}
|
|
1099
|
-
addUploadProgressListener(t) {
|
|
1100
|
-
this.xhr_.upload != null && this.xhr_.upload.addEventListener("progress", t);
|
|
1101
|
-
}
|
|
1102
|
-
removeUploadProgressListener(t) {
|
|
1103
|
-
this.xhr_.upload != null && this.xhr_.upload.removeEventListener("progress", t);
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
class Go extends Wo {
|
|
1107
|
-
initXhr() {
|
|
1108
|
-
this.xhr_.responseType = "text";
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
function Nt() {
|
|
1112
|
-
return new Go();
|
|
1113
|
-
}
|
|
1114
|
-
/**
|
|
1115
|
-
* @license
|
|
1116
|
-
* Copyright 2019 Google LLC
|
|
1117
|
-
*
|
|
1118
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1119
|
-
* you may not use this file except in compliance with the License.
|
|
1120
|
-
* You may obtain a copy of the License at
|
|
1121
|
-
*
|
|
1122
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1123
|
-
*
|
|
1124
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1125
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1126
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1127
|
-
* See the License for the specific language governing permissions and
|
|
1128
|
-
* limitations under the License.
|
|
1129
|
-
*/
|
|
1130
|
-
class ke {
|
|
1131
|
-
constructor(t, n) {
|
|
1132
|
-
this._service = t, n instanceof ae ? this._location = n : this._location = ae.makeFromUrl(n, t.host);
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Returns the URL for the bucket and path this object references,
|
|
1136
|
-
* in the form gs://<bucket>/<object-path>
|
|
1137
|
-
* @override
|
|
1138
|
-
*/
|
|
1139
|
-
toString() {
|
|
1140
|
-
return "gs://" + this._location.bucket + "/" + this._location.path;
|
|
1141
|
-
}
|
|
1142
|
-
_newRef(t, n) {
|
|
1143
|
-
return new ke(t, n);
|
|
1144
|
-
}
|
|
1145
|
-
/**
|
|
1146
|
-
* A reference to the root of this object's bucket.
|
|
1147
|
-
*/
|
|
1148
|
-
get root() {
|
|
1149
|
-
const t = new ae(this._location.bucket, "");
|
|
1150
|
-
return this._newRef(this._service, t);
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
* The name of the bucket containing this reference's object.
|
|
1154
|
-
*/
|
|
1155
|
-
get bucket() {
|
|
1156
|
-
return this._location.bucket;
|
|
1157
|
-
}
|
|
1158
|
-
/**
|
|
1159
|
-
* The full path of this object.
|
|
1160
|
-
*/
|
|
1161
|
-
get fullPath() {
|
|
1162
|
-
return this._location.path;
|
|
1163
|
-
}
|
|
1164
|
-
/**
|
|
1165
|
-
* The short name of this object, which is the last component of the full path.
|
|
1166
|
-
* For example, if fullPath is 'full/path/image.png', name is 'image.png'.
|
|
1167
|
-
*/
|
|
1168
|
-
get name() {
|
|
1169
|
-
return vn(this._location.path);
|
|
1170
|
-
}
|
|
1171
|
-
/**
|
|
1172
|
-
* The `StorageService` instance this `StorageReference` is associated with.
|
|
1173
|
-
*/
|
|
1174
|
-
get storage() {
|
|
1175
|
-
return this._service;
|
|
1176
|
-
}
|
|
1177
|
-
/**
|
|
1178
|
-
* A `StorageReference` pointing to the parent location of this `StorageReference`, or null if
|
|
1179
|
-
* this reference is the root.
|
|
1180
|
-
*/
|
|
1181
|
-
get parent() {
|
|
1182
|
-
const t = Ao(this._location.path);
|
|
1183
|
-
if (t === null)
|
|
1184
|
-
return null;
|
|
1185
|
-
const n = new ae(this._location.bucket, t);
|
|
1186
|
-
return new ke(this._service, n);
|
|
1187
|
-
}
|
|
1188
|
-
/**
|
|
1189
|
-
* Utility function to throw an error in methods that do not accept a root reference.
|
|
1190
|
-
*/
|
|
1191
|
-
_throwIfRoot(t) {
|
|
1192
|
-
if (this._location.path === "")
|
|
1193
|
-
throw lo(t);
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
function Yo(e, t, n) {
|
|
1197
|
-
e._throwIfRoot("uploadBytes");
|
|
1198
|
-
const o = Ho(e.storage, e._location, gn(), new Ie(t, !0), n);
|
|
1199
|
-
return e.storage.makeRequestWithTokens(o, Nt).then((i) => ({
|
|
1200
|
-
metadata: i,
|
|
1201
|
-
ref: e
|
|
1202
|
-
}));
|
|
1203
|
-
}
|
|
1204
|
-
function qo(e) {
|
|
1205
|
-
e._throwIfRoot("getDownloadURL");
|
|
1206
|
-
const t = Bo(e.storage, e._location, gn());
|
|
1207
|
-
return e.storage.makeRequestWithTokens(t, Nt).then((n) => {
|
|
1208
|
-
if (n === null)
|
|
1209
|
-
throw so();
|
|
1210
|
-
return n;
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
|
-
function Ko(e) {
|
|
1214
|
-
e._throwIfRoot("deleteObject");
|
|
1215
|
-
const t = Vo(e.storage, e._location);
|
|
1216
|
-
return e.storage.makeRequestWithTokens(t, Nt);
|
|
1217
|
-
}
|
|
1218
|
-
function Xo(e, t) {
|
|
1219
|
-
const n = Do(e._location.path, t), o = new ae(e._location.bucket, n);
|
|
1220
|
-
return new ke(e.storage, o);
|
|
1221
|
-
}
|
|
1222
|
-
/**
|
|
1223
|
-
* @license
|
|
1224
|
-
* Copyright 2017 Google LLC
|
|
1225
|
-
*
|
|
1226
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1227
|
-
* you may not use this file except in compliance with the License.
|
|
1228
|
-
* You may obtain a copy of the License at
|
|
1229
|
-
*
|
|
1230
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1231
|
-
*
|
|
1232
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1233
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1234
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1235
|
-
* See the License for the specific language governing permissions and
|
|
1236
|
-
* limitations under the License.
|
|
1237
|
-
*/
|
|
1238
|
-
function Zo(e) {
|
|
1239
|
-
return /^[A-Za-z]+:\/\//.test(e);
|
|
1240
|
-
}
|
|
1241
|
-
function Qo(e, t) {
|
|
1242
|
-
return new ke(e, t);
|
|
1243
|
-
}
|
|
1244
|
-
function In(e, t) {
|
|
1245
|
-
if (e instanceof Pt) {
|
|
1246
|
-
const n = e;
|
|
1247
|
-
if (n._bucket == null)
|
|
1248
|
-
throw oo();
|
|
1249
|
-
const o = new ke(n, n._bucket);
|
|
1250
|
-
return t != null ? In(o, t) : o;
|
|
1251
|
-
} else
|
|
1252
|
-
return t !== void 0 ? Xo(e, t) : e;
|
|
1253
|
-
}
|
|
1254
|
-
function Jo(e, t) {
|
|
1255
|
-
if (t && Zo(t)) {
|
|
1256
|
-
if (e instanceof Pt)
|
|
1257
|
-
return Qo(e, t);
|
|
1258
|
-
throw wt("To use ref(service, url), the first argument must be a Storage instance.");
|
|
1259
|
-
} else
|
|
1260
|
-
return In(e, t);
|
|
1261
|
-
}
|
|
1262
|
-
function qt(e, t) {
|
|
1263
|
-
const n = t == null ? void 0 : t[un];
|
|
1264
|
-
return n == null ? null : ae.makeFromBucketSpec(n, e);
|
|
1265
|
-
}
|
|
1266
|
-
function ei(e, t, n, o = {}) {
|
|
1267
|
-
e.host = `${t}:${n}`, e._protocol = "http";
|
|
1268
|
-
const { mockUserToken: i } = o;
|
|
1269
|
-
i && (e._overrideAuthToken = typeof i == "string" ? i : Un(i, e.app.options.projectId));
|
|
1270
|
-
}
|
|
1271
|
-
class Pt {
|
|
1272
|
-
constructor(t, n, o, i, l) {
|
|
1273
|
-
this.app = t, this._authProvider = n, this._appCheckProvider = o, this._url = i, this._firebaseVersion = l, this._bucket = null, this._host = cn, this._protocol = "https", this._appId = null, this._deleted = !1, this._maxOperationRetryTime = Gn, this._maxUploadRetryTime = Yn, this._requests = /* @__PURE__ */ new Set(), i != null ? this._bucket = ae.makeFromBucketSpec(i, this._host) : this._bucket = qt(this._host, this.app.options);
|
|
1274
|
-
}
|
|
1275
|
-
/**
|
|
1276
|
-
* The host string for this service, in the form of `host` or
|
|
1277
|
-
* `host:port`.
|
|
1278
|
-
*/
|
|
1279
|
-
get host() {
|
|
1280
|
-
return this._host;
|
|
1281
|
-
}
|
|
1282
|
-
set host(t) {
|
|
1283
|
-
this._host = t, this._url != null ? this._bucket = ae.makeFromBucketSpec(this._url, t) : this._bucket = qt(t, this.app.options);
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* The maximum time to retry uploads in milliseconds.
|
|
1287
|
-
*/
|
|
1288
|
-
get maxUploadRetryTime() {
|
|
1289
|
-
return this._maxUploadRetryTime;
|
|
1290
|
-
}
|
|
1291
|
-
set maxUploadRetryTime(t) {
|
|
1292
|
-
Yt(
|
|
1293
|
-
"time",
|
|
1294
|
-
/* minValue=*/
|
|
1295
|
-
0,
|
|
1296
|
-
/* maxValue= */
|
|
1297
|
-
Number.POSITIVE_INFINITY,
|
|
1298
|
-
t
|
|
1299
|
-
), this._maxUploadRetryTime = t;
|
|
1300
|
-
}
|
|
1301
|
-
/**
|
|
1302
|
-
* The maximum time to retry operations other than uploads or downloads in
|
|
1303
|
-
* milliseconds.
|
|
1304
|
-
*/
|
|
1305
|
-
get maxOperationRetryTime() {
|
|
1306
|
-
return this._maxOperationRetryTime;
|
|
1307
|
-
}
|
|
1308
|
-
set maxOperationRetryTime(t) {
|
|
1309
|
-
Yt(
|
|
1310
|
-
"time",
|
|
1311
|
-
/* minValue=*/
|
|
1312
|
-
0,
|
|
1313
|
-
/* maxValue= */
|
|
1314
|
-
Number.POSITIVE_INFINITY,
|
|
1315
|
-
t
|
|
1316
|
-
), this._maxOperationRetryTime = t;
|
|
1317
|
-
}
|
|
1318
|
-
async _getAuthToken() {
|
|
1319
|
-
if (this._overrideAuthToken)
|
|
1320
|
-
return this._overrideAuthToken;
|
|
1321
|
-
const t = this._authProvider.getImmediate({ optional: !0 });
|
|
1322
|
-
if (t) {
|
|
1323
|
-
const n = await t.getToken();
|
|
1324
|
-
if (n !== null)
|
|
1325
|
-
return n.accessToken;
|
|
1326
|
-
}
|
|
1327
|
-
return null;
|
|
1328
|
-
}
|
|
1329
|
-
async _getAppCheckToken() {
|
|
1330
|
-
const t = this._appCheckProvider.getImmediate({ optional: !0 });
|
|
1331
|
-
return t ? (await t.getToken()).token : null;
|
|
1332
|
-
}
|
|
1333
|
-
/**
|
|
1334
|
-
* Stop running requests and prevent more from being created.
|
|
1335
|
-
*/
|
|
1336
|
-
_delete() {
|
|
1337
|
-
return this._deleted || (this._deleted = !0, this._requests.forEach((t) => t.cancel()), this._requests.clear()), Promise.resolve();
|
|
1338
|
-
}
|
|
1339
|
-
/**
|
|
1340
|
-
* Returns a new firebaseStorage.Reference object referencing this StorageService
|
|
1341
|
-
* at the given Location.
|
|
1342
|
-
*/
|
|
1343
|
-
_makeStorageReference(t) {
|
|
1344
|
-
return new ke(this, t);
|
|
1345
|
-
}
|
|
1346
|
-
/**
|
|
1347
|
-
* @param requestInfo - HTTP RequestInfo object
|
|
1348
|
-
* @param authToken - Firebase auth token
|
|
1349
|
-
*/
|
|
1350
|
-
_makeRequest(t, n, o, i, l = !0) {
|
|
1351
|
-
if (this._deleted)
|
|
1352
|
-
return new ro(dn());
|
|
1353
|
-
{
|
|
1354
|
-
const r = yo(t, this._appId, o, i, n, this._firebaseVersion, l);
|
|
1355
|
-
return this._requests.add(r), r.getPromise().then(() => this._requests.delete(r), () => this._requests.delete(r)), r;
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
async makeRequestWithTokens(t, n) {
|
|
1359
|
-
const [o, i] = await Promise.all([
|
|
1360
|
-
this._getAuthToken(),
|
|
1361
|
-
this._getAppCheckToken()
|
|
1362
|
-
]);
|
|
1363
|
-
return this._makeRequest(t, n, o, i).getPromise();
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
const Kt = "@firebase/storage", Xt = "0.12.5";
|
|
1367
|
-
/**
|
|
1368
|
-
* @license
|
|
1369
|
-
* Copyright 2020 Google LLC
|
|
1370
|
-
*
|
|
1371
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1372
|
-
* you may not use this file except in compliance with the License.
|
|
1373
|
-
* You may obtain a copy of the License at
|
|
1374
|
-
*
|
|
1375
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1376
|
-
*
|
|
1377
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1378
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1379
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1380
|
-
* See the License for the specific language governing permissions and
|
|
1381
|
-
* limitations under the License.
|
|
1382
|
-
*/
|
|
1383
|
-
const Fn = "storage";
|
|
1384
|
-
function ti(e, t, n) {
|
|
1385
|
-
return e = et(e), Yo(e, t, n);
|
|
1386
|
-
}
|
|
1387
|
-
function ni(e) {
|
|
1388
|
-
return e = et(e), qo(e);
|
|
1389
|
-
}
|
|
1390
|
-
function oi(e) {
|
|
1391
|
-
return e = et(e), Ko(e);
|
|
1392
|
-
}
|
|
1393
|
-
function Zt(e, t) {
|
|
1394
|
-
return e = et(e), Jo(e, t);
|
|
1395
|
-
}
|
|
1396
|
-
function Qt(e = Pn(), t) {
|
|
1397
|
-
e = et(e);
|
|
1398
|
-
const o = Sn(e, Fn).getImmediate({
|
|
1399
|
-
identifier: t
|
|
1400
|
-
}), i = Nn("storage");
|
|
1401
|
-
return i && ii(o, ...i), o;
|
|
1402
|
-
}
|
|
1403
|
-
function ii(e, t, n, o = {}) {
|
|
1404
|
-
ei(e, t, n, o);
|
|
1405
|
-
}
|
|
1406
|
-
function si(e, { instanceIdentifier: t }) {
|
|
1407
|
-
const n = e.getProvider("app").getImmediate(), o = e.getProvider("auth-internal"), i = e.getProvider("app-check-internal");
|
|
1408
|
-
return new Pt(n, o, i, t, xn);
|
|
1409
|
-
}
|
|
1410
|
-
function ai() {
|
|
1411
|
-
Dn(new zn(
|
|
1412
|
-
Fn,
|
|
1413
|
-
si,
|
|
1414
|
-
"PUBLIC"
|
|
1415
|
-
/* ComponentType.PUBLIC */
|
|
1416
|
-
).setMultipleInstances(!0)), Wt(Kt, Xt, ""), Wt(Kt, Xt, "esm2017");
|
|
1417
|
-
}
|
|
1418
|
-
ai();
|
|
1419
|
-
const Jt = {
|
|
1420
|
-
async update(e, t) {
|
|
1421
|
-
const n = Qt(), o = Zt(n, e);
|
|
1422
|
-
return await ti(o, t), await ni(o);
|
|
1423
|
-
},
|
|
1424
|
-
async delete(e) {
|
|
1425
|
-
const t = Qt(), n = Zt(t, e);
|
|
1426
|
-
await oi(n);
|
|
1427
|
-
}
|
|
1428
|
-
}, li = { class: "w-full flex flex-col gap-5" }, ri = { class: "flex flex-col gap-4" }, ci = { class: "fm-typo-en-body-lg-400" }, ui = { class: "fm-typo-en-body-lg-600" }, di = { class: "flex flex-col gap-4" }, mi = { class: "fm-typo-en-body-lg-400" }, pi = { class: "fm-typo-en-body-lg-600" }, fi = { class: "flex flex-col gap-4" }, hi = { class: "fm-typo-en-body-lg-400" }, _i = { class: "fm-typo-en-body-lg-600" }, vi = { class: "flex flex-col gap-4" }, gi = { class: "fm-typo-en-body-lg-400" }, bi = { class: "fm-typo-en-body-lg-600" }, yi = { class: "flex flex-col gap-4" }, Ti = { class: "fm-typo-en-body-lg-400" }, Ei = { class: "flex flex-row items-center gap-1" }, Ii = { class: "fm-typo-en-body-lg-600" }, Fi = {
|
|
1429
|
-
key: 0,
|
|
1430
|
-
class: "flex flex-col gap-4"
|
|
1431
|
-
}, wi = { class: "fm-typo-en-body-lg-400" }, Ci = { class: "fm-typo-en-body-lg-600" }, ki = {
|
|
1432
|
-
key: 1,
|
|
1433
|
-
class: "flex flex-col gap-4"
|
|
1434
|
-
}, Ri = { class: "fm-typo-en-body-lg-400" }, Oi = { class: "fm-typo-en-body-lg-600" }, Ai = {
|
|
1435
|
-
key: 2,
|
|
1436
|
-
class: "flex flex-col gap-4"
|
|
1437
|
-
}, Di = { class: "fm-typo-en-body-lg-400" }, zi = { class: "fm-typo-en-body-lg-600" }, Si = {
|
|
1438
|
-
key: 3,
|
|
1439
|
-
class: "flex flex-col gap-4"
|
|
1440
|
-
}, Ni = { class: "fm-typo-en-body-lg-400" }, Pi = { class: "fm-typo-en-body-lg-600" }, xi = {
|
|
1441
|
-
key: 4,
|
|
1442
|
-
class: "flex flex-col gap-4"
|
|
1443
|
-
}, Ui = { class: "fm-typo-en-body-lg-400" }, Mi = { class: "fm-typo-en-body-lg-600" }, Li = { class: "flex flex-col gap-4" }, Bi = {
|
|
1444
|
-
key: 0,
|
|
1445
|
-
class: "fm-typo-en-body-lg-400"
|
|
1446
|
-
}, Vi = { class: "fm-typo-en-body-lg-600" }, $i = {
|
|
1447
|
-
key: 0,
|
|
1448
|
-
class: "flex flex-col gap-4"
|
|
1449
|
-
}, ji = { class: "fm-typo-en-body-lg-400" }, Hi = { class: "fm-typo-en-body-lg-600" }, Wi = {
|
|
1450
|
-
key: 1,
|
|
1451
|
-
class: "flex flex-col gap-4"
|
|
1452
|
-
}, Gi = { class: "fm-typo-en-body-lg-400" }, Yi = { class: "fm-typo-en-body-lg-600 break-words" }, qi = {
|
|
1453
|
-
key: 2,
|
|
1454
|
-
class: "flex flex-col gap-4"
|
|
1455
|
-
}, Ki = { class: "fm-typo-en-body-lg-400" }, Xi = { class: "fm-typo-en-body-lg-600" }, Zi = {
|
|
1456
|
-
key: 3,
|
|
1457
|
-
class: "flex flex-col gap-4"
|
|
1458
|
-
}, Qi = { class: "fm-typo-en-body-lg-400" }, Ji = { class: "fm-typo-en-body-lg-600" }, es = {
|
|
1459
|
-
key: 4,
|
|
1460
|
-
class: "flex flex-col gap-4"
|
|
1461
|
-
}, ts = { class: "fm-typo-en-body-lg-400" }, ns = { class: "fm-typo-en-body-lg-600" }, os = {
|
|
1462
|
-
key: 0,
|
|
1463
|
-
class: "flex flex-col gap-4"
|
|
1464
|
-
}, is = { class: "fm-typo-en-body-lg-400" }, ss = { class: "fm-typo-en-body-lg-600 break-words" }, as = {
|
|
1465
|
-
key: 0,
|
|
1466
|
-
class: "flex flex-col gap-4"
|
|
1467
|
-
}, ls = { class: "fm-typo-en-body-lg-400" }, rs = { class: "fm-typo-en-body-lg-600 break-words" }, cs = {
|
|
1468
|
-
key: 0,
|
|
1469
|
-
class: "flex flex-col gap-4"
|
|
1470
|
-
}, us = { class: "fm-typo-en-body-lg-400" }, ds = { class: "fm-typo-en-body-lg-600 break-words" }, ms = {
|
|
1471
|
-
key: 0,
|
|
1472
|
-
class: "flex flex-col gap-4"
|
|
1473
|
-
}, ps = { class: "fm-typo-en-body-lg-400" }, fs = { class: "fm-typo-en-body-lg-600" }, hs = {
|
|
1474
|
-
key: 6,
|
|
1475
|
-
class: "flex flex-col gap-8"
|
|
1476
|
-
}, _s = { class: "fm-typo-en-title-sm-800" }, vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gs = {
|
|
1477
|
-
key: 0,
|
|
1478
|
-
class: "flex h-full justify-center items-center"
|
|
1479
|
-
}, bs = {
|
|
1480
|
-
key: 1,
|
|
1481
|
-
class: "flex flex-col gap-3 flex-wrap"
|
|
1482
|
-
}, ys = {
|
|
1483
|
-
key: 0,
|
|
1484
|
-
class: "relative"
|
|
1485
|
-
}, Ts = ["src"], Es = { class: "absolute top-0 right-0 cursor-pointer mt-1 mr-1" }, Is = { class: "flex w-full overflow-x-hidden flex-col gap-24" }, Fs = {
|
|
1486
|
-
key: 0,
|
|
1487
|
-
class: "flex flex-wrap grow-0 w-auto gap-24"
|
|
1488
|
-
}, ws = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Cs = {
|
|
1489
|
-
key: 7,
|
|
1490
|
-
class: "flex flex-col gap-8"
|
|
1491
|
-
}, ks = { class: "fm-typo-en-title-sm-600" }, Rs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Os = { class: "flex flex-col gap-3" }, As = { class: "flex gap-8 items-center justify-start" }, Ds = /* @__PURE__ */ Ve({
|
|
1492
|
-
__name: "DeviceInformationSideSheet",
|
|
1493
|
-
props: {
|
|
1494
|
-
visible: { type: Boolean },
|
|
1495
|
-
device: {},
|
|
1496
|
-
devices: {},
|
|
1497
|
-
formUpdated: { type: Boolean }
|
|
1498
|
-
},
|
|
1499
|
-
setup(e) {
|
|
1500
|
-
const { t } = Re(), { isAtMost: n } = Ot(), o = e, i = dt(o, "visible"), l = dt(o, "formUpdated"), r = Rt(), m = q(() => r.restaurants.value), v = q(() => r.currentBusiness.value), T = (u) => {
|
|
1501
|
-
var A, B;
|
|
1502
|
-
return u ? u.name ?? ((A = m.value.find((X) => X._id === u.restaurantId)) == null ? void 0 : A.profile.name) : o.device.name ?? ((B = m.value.find((X) => X._id === o.device.restaurantId)) == null ? void 0 : B.profile.name);
|
|
1503
|
-
}, F = x({}), z = q(() => Object.entries(F.value).filter(([, { deleted: u }]) => !u).map(([u]) => u)), S = sn(), D = q(() => S.getCustomerDisplayImages()), O = () => {
|
|
1504
|
-
var u;
|
|
1505
|
-
F.value = D.value.reduce((A, B) => (A[B.url] = {
|
|
1506
|
-
restaurantIds: B.restaurantIds,
|
|
1507
|
-
deleted: !1
|
|
1508
|
-
}, A), {}), N.value = (u = D.value) != null && u.length ? D.value[0].url : "";
|
|
1509
|
-
}, N = x(z.value.length > 0 ? z.value[0] : "");
|
|
1510
|
-
function U(u) {
|
|
1511
|
-
N.value = u;
|
|
1512
|
-
}
|
|
1513
|
-
function H() {
|
|
1514
|
-
const u = z.value;
|
|
1515
|
-
F.value[N.value].deleted = !0;
|
|
1516
|
-
const A = u.findIndex((B) => B === N.value);
|
|
1517
|
-
A >= 0 && (N.value = u[A - 1] || u[A + 1] || "");
|
|
1518
|
-
}
|
|
1519
|
-
const W = q(
|
|
1520
|
-
() => m.value.map((u) => u._id).every((u) => E.value.includes(u))
|
|
1521
|
-
), k = (u) => {
|
|
1522
|
-
u ? F.value[N.value].restaurantIds = m.value.map((A) => A._id) : F.value[N.value].restaurantIds = [];
|
|
1523
|
-
}, E = q(() => F.value[N.value].restaurantIds), K = (u) => {
|
|
1524
|
-
F.value[N.value].restaurantIds = u;
|
|
1525
|
-
}, ne = x(null), le = x(!1);
|
|
1526
|
-
async function j(u) {
|
|
1527
|
-
var X;
|
|
1528
|
-
const A = `business/${(X = v.value) == null ? void 0 : X._id}/customer-display/${(/* @__PURE__ */ new Date()).toISOString()}`;
|
|
1529
|
-
le.value = !0, await Jt.update(A, u).then((ie) => {
|
|
1530
|
-
F.value[ie] = {
|
|
1531
|
-
restaurantIds: [],
|
|
1532
|
-
deleted: !1
|
|
1533
|
-
}, N.value = ie;
|
|
1534
|
-
}), le.value = !1, await on(), ne.value.scrollIntoView(!1);
|
|
1535
|
-
}
|
|
1536
|
-
const oe = x(!1), Fe = tt();
|
|
1537
|
-
async function J() {
|
|
1538
|
-
oe.value = !0;
|
|
1539
|
-
const u = ot();
|
|
1540
|
-
await S.updateCustomerDisplay(u).then(async () => {
|
|
1541
|
-
Fe.open({
|
|
1542
|
-
message: t("device.customerDisplay.update.success", { name: T() }),
|
|
1543
|
-
type: "success",
|
|
1544
|
-
position: Q.BOTTOM
|
|
1545
|
-
});
|
|
1546
|
-
}).catch((A) => {
|
|
1547
|
-
Fe.open({
|
|
1548
|
-
message: t("device.error.general"),
|
|
1549
|
-
type: "error",
|
|
1550
|
-
position: Q.BOTTOM
|
|
1551
|
-
});
|
|
1552
|
-
}), l.value = !0, i.value = !1, await it(), oe.value = !1;
|
|
1553
|
-
}
|
|
1554
|
-
function ot() {
|
|
1555
|
-
return {
|
|
1556
|
-
images: z.value.map((u) => ({
|
|
1557
|
-
url: u,
|
|
1558
|
-
restaurantIds: F.value[u].restaurantIds
|
|
1559
|
-
})),
|
|
1560
|
-
publishRestaurants: m.value.map((u) => u._id)
|
|
1561
|
-
};
|
|
1562
|
-
}
|
|
1563
|
-
async function it() {
|
|
1564
|
-
const u = Object.entries(F.value).filter(([, { deleted: A }]) => A).map(([A]) => A);
|
|
1565
|
-
await Promise.all(
|
|
1566
|
-
u.map(async (A) => {
|
|
1567
|
-
await Jt.delete(A);
|
|
1568
|
-
})
|
|
1569
|
-
);
|
|
1570
|
-
}
|
|
1571
|
-
const Oe = (u) => new Date(u).toLocaleDateString("en-GB", {
|
|
1572
|
-
day: "2-digit",
|
|
1573
|
-
month: "short",
|
|
1574
|
-
year: "numeric",
|
|
1575
|
-
hour: "2-digit",
|
|
1576
|
-
minute: "2-digit",
|
|
1577
|
-
hour12: !0
|
|
1578
|
-
}).replace(",", "").toUpperCase(), re = (u) => {
|
|
1579
|
-
const A = u.replace(/([A-Z])/g, " $1").toLowerCase();
|
|
1580
|
-
return A.charAt(0).toUpperCase() + A.slice(1);
|
|
1581
|
-
}, Ae = (u) => Date.now() - new Date(u).getTime() < 6e5;
|
|
1582
|
-
return Be(i, (u) => {
|
|
1583
|
-
u && O();
|
|
1584
|
-
}), Ct(() => {
|
|
1585
|
-
O();
|
|
1586
|
-
}), (u, A) => {
|
|
1587
|
-
const B = I("FmCardHeader"), X = I("FmCardSection"), ie = I("FmCard"), De = I("FmIcon"), ze = I("FmCircularProgress"), me = I("FmButton"), pe = I("FmThumbnail"), gt = I("FmDropField"), st = I("FmCheckbox"), we = I("FmForm"), Se = I("FmSideSheet");
|
|
1588
|
-
return p(), L(Se, {
|
|
1589
|
-
header: s(t)("device.information.title"),
|
|
1590
|
-
"max-width": 560,
|
|
1591
|
-
modelValue: s(i),
|
|
1592
|
-
"onUpdate:modelValue": A[2] || (A[2] = (a) => tn(i) ? i.value = a : null),
|
|
1593
|
-
"close-button": !oe.value,
|
|
1594
|
-
"dismiss-away": !0
|
|
1595
|
-
}, On({
|
|
1596
|
-
default: C(() => [
|
|
1597
|
-
f(we, null, {
|
|
1598
|
-
default: C(() => {
|
|
1599
|
-
var a, c, _, M, fe, $e, at, Ne, Pe, xe, Ee, Ue;
|
|
1600
|
-
return [
|
|
1601
|
-
d("div", li, [
|
|
1602
|
-
f(ie, { variant: "outlined" }, {
|
|
1603
|
-
default: C(() => [
|
|
1604
|
-
f(B, {
|
|
1605
|
-
title: s(t)("device.information.sections.deviceInfo"),
|
|
1606
|
-
class: "pb-8 px-16"
|
|
1607
|
-
}, null, 8, ["title"]),
|
|
1608
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1609
|
-
default: C(() => {
|
|
1610
|
-
var w, P, he, _e;
|
|
1611
|
-
return [
|
|
1612
|
-
d("div", ri, [
|
|
1613
|
-
d("div", ci, h(s(t)("device.information.main.id")), 1),
|
|
1614
|
-
d("div", ui, h(((w = u.device) == null ? void 0 : w.machineId) ?? "-"), 1)
|
|
1615
|
-
]),
|
|
1616
|
-
d("div", di, [
|
|
1617
|
-
d("div", mi, h(s(t)("device.information.main.name")), 1),
|
|
1618
|
-
d("div", pi, h(T()), 1)
|
|
1619
|
-
]),
|
|
1620
|
-
d("div", fi, [
|
|
1621
|
-
d("div", hi, h(s(t)("device.information.main.type")), 1),
|
|
1622
|
-
d("div", _i, h((P = u.device) == null ? void 0 : P.type), 1)
|
|
1623
|
-
]),
|
|
1624
|
-
d("div", vi, [
|
|
1625
|
-
d("div", gi, h(s(t)("device.information.main.bindingAt")), 1),
|
|
1626
|
-
d("div", bi, h((he = u.device) != null && he.bindAt ? Oe((_e = u.device) == null ? void 0 : _e.bindAt) : "-"), 1)
|
|
1627
|
-
])
|
|
1628
|
-
];
|
|
1629
|
-
}),
|
|
1630
|
-
_: 1
|
|
1631
|
-
})
|
|
1632
|
-
]),
|
|
1633
|
-
_: 1
|
|
1634
|
-
}),
|
|
1635
|
-
(a = u.device.heartbeatInfo) != null && a.updatedAt ? (p(), L(ie, {
|
|
1636
|
-
key: 0,
|
|
1637
|
-
variant: "outlined"
|
|
1638
|
-
}, {
|
|
1639
|
-
default: C(() => [
|
|
1640
|
-
f(B, {
|
|
1641
|
-
title: s(t)("device.information.sections.heartbeatStatus"),
|
|
1642
|
-
class: "pb-8 px-16"
|
|
1643
|
-
}, null, 8, ["title"]),
|
|
1644
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1645
|
-
default: C(() => {
|
|
1646
|
-
var w, P, he, _e, g, Z, ge, je, He, We, Ge, Ye, qe, Ke, Xe, Ze;
|
|
1647
|
-
return [
|
|
1648
|
-
d("div", yi, [
|
|
1649
|
-
d("div", Ti, h(s(t)("device.information.heartbeat.lastSyncAt")), 1),
|
|
1650
|
-
d("div", Ei, [
|
|
1651
|
-
f(De, {
|
|
1652
|
-
class: "motion-safe:animate-pulse",
|
|
1653
|
-
name: "radio_button_unchecked",
|
|
1654
|
-
size: "sm",
|
|
1655
|
-
color: Ae((P = (w = u.device) == null ? void 0 : w.heartbeatInfo) == null ? void 0 : P.updatedAt) ? "system-success-300" : "system-error-300"
|
|
1656
|
-
}, null, 8, ["color"]),
|
|
1657
|
-
d("div", Ii, h(Oe((_e = (he = u.device) == null ? void 0 : he.heartbeatInfo) == null ? void 0 : _e.updatedAt)), 1)
|
|
1658
|
-
])
|
|
1659
|
-
]),
|
|
1660
|
-
(Z = (g = u.device) == null ? void 0 : g.heartbeatInfo) != null && Z.freeMemory ? (p(), b("div", Fi, [
|
|
1661
|
-
d("div", wi, h(s(t)("device.information.heartbeat.freeMemory")), 1),
|
|
1662
|
-
d("div", Ci, h((je = (ge = u.device) == null ? void 0 : ge.heartbeatInfo) == null ? void 0 : je.freeMemory.toFixed(2)) + " MB", 1)
|
|
1663
|
-
])) : R("", !0),
|
|
1664
|
-
(He = u.device.heartbeatInfo) != null && He.appMemory ? (p(), b("div", ki, [
|
|
1665
|
-
d("div", Ri, h(s(t)("device.information.heartbeat.appMemory")), 1),
|
|
1666
|
-
d("div", Oi, h((We = u.device.heartbeatInfo) == null ? void 0 : We.appMemory.toFixed(2)) + " MB", 1)
|
|
1667
|
-
])) : R("", !0),
|
|
1668
|
-
(Ge = u.device.heartbeatInfo) != null && Ge.totalMemory ? (p(), b("div", Ai, [
|
|
1669
|
-
d("div", Di, h(s(t)("device.information.heartbeat.totalMemory")), 1),
|
|
1670
|
-
d("div", zi, h((Ye = u.device.heartbeatInfo) == null ? void 0 : Ye.totalMemory.toFixed(2)) + " MB", 1)
|
|
1671
|
-
])) : R("", !0),
|
|
1672
|
-
(qe = u.device.heartbeatInfo) != null && qe.freeSpace ? (p(), b("div", Si, [
|
|
1673
|
-
d("div", Ni, h(s(t)("device.information.heartbeat.freeSpace")), 1),
|
|
1674
|
-
d("div", Pi, h((Ke = u.device.heartbeatInfo) == null ? void 0 : Ke.freeSpace.toFixed(2)) + " MB", 1)
|
|
1675
|
-
])) : R("", !0),
|
|
1676
|
-
(Xe = u.device.heartbeatInfo) != null && Xe.totalSpace ? (p(), b("div", xi, [
|
|
1677
|
-
d("div", Ui, h(s(t)("device.information.heartbeat.totalSpace")), 1),
|
|
1678
|
-
d("div", Mi, h((Ze = u.device.heartbeatInfo) == null ? void 0 : Ze.totalSpace.toFixed(2)) + " MB", 1)
|
|
1679
|
-
])) : R("", !0)
|
|
1680
|
-
];
|
|
1681
|
-
}),
|
|
1682
|
-
_: 1
|
|
1683
|
-
})
|
|
1684
|
-
]),
|
|
1685
|
-
_: 1
|
|
1686
|
-
})) : R("", !0),
|
|
1687
|
-
(c = u.device) != null && c.appVersion && Object.values((_ = u.device) == null ? void 0 : _.appVersion).some((w) => w) ? (p(), L(ie, {
|
|
1688
|
-
key: 1,
|
|
1689
|
-
variant: "outlined"
|
|
1690
|
-
}, {
|
|
1691
|
-
default: C(() => [
|
|
1692
|
-
f(B, {
|
|
1693
|
-
title: s(t)("device.information.sections.applicationInfo"),
|
|
1694
|
-
class: "pb-8 px-16"
|
|
1695
|
-
}, null, 8, ["title"]),
|
|
1696
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1697
|
-
default: C(() => {
|
|
1698
|
-
var w, P, he, _e, g, Z, ge, je, He, We, Ge, Ye, qe, Ke, Xe, Ze, Ut, Mt, Lt, Bt, Vt, $t, jt, Ht;
|
|
1699
|
-
return [
|
|
1700
|
-
d("div", Li, [
|
|
1701
|
-
(P = (w = u.device) == null ? void 0 : w.appVersion) != null && P.appName ? (p(), b("div", Bi, h(s(t)("device.information.app.name")), 1)) : R("", !0),
|
|
1702
|
-
d("div", Vi, h((_e = (he = u.device) == null ? void 0 : he.appVersion) == null ? void 0 : _e.appName), 1)
|
|
1703
|
-
]),
|
|
1704
|
-
(Z = (g = u.device) == null ? void 0 : g.appVersion) != null && Z.buildNumber ? (p(), b("div", $i, [
|
|
1705
|
-
d("div", ji, h(s(t)("device.information.app.buildNumber")), 1),
|
|
1706
|
-
d("div", Hi, h((je = (ge = u.device) == null ? void 0 : ge.appVersion) == null ? void 0 : je.buildNumber), 1)
|
|
1707
|
-
])) : R("", !0),
|
|
1708
|
-
(We = (He = u.device) == null ? void 0 : He.appVersion) != null && We.buildSignature ? (p(), b("div", Wi, [
|
|
1709
|
-
d("div", Gi, h(s(t)("device.information.app.buildSignature")), 1),
|
|
1710
|
-
d("div", Yi, h((Ye = (Ge = u.device) == null ? void 0 : Ge.appVersion) == null ? void 0 : Ye.buildSignature), 1)
|
|
1711
|
-
])) : R("", !0),
|
|
1712
|
-
(Ke = (qe = u.device) == null ? void 0 : qe.appVersion) != null && Ke.installerStore ? (p(), b("div", qi, [
|
|
1713
|
-
d("div", Ki, h(s(t)("device.information.app.installerStore")), 1),
|
|
1714
|
-
d("div", Xi, h((Ze = (Xe = u.device) == null ? void 0 : Xe.appVersion) == null ? void 0 : Ze.installerStore), 1)
|
|
1715
|
-
])) : R("", !0),
|
|
1716
|
-
(Mt = (Ut = u.device) == null ? void 0 : Ut.appVersion) != null && Mt.packageName ? (p(), b("div", Zi, [
|
|
1717
|
-
d("div", Qi, h(s(t)("device.information.app.packageName")), 1),
|
|
1718
|
-
d("div", Ji, h((Bt = (Lt = u.device) == null ? void 0 : Lt.appVersion) == null ? void 0 : Bt.packageName), 1)
|
|
1719
|
-
])) : R("", !0),
|
|
1720
|
-
($t = (Vt = u.device) == null ? void 0 : Vt.appVersion) != null && $t.version ? (p(), b("div", es, [
|
|
1721
|
-
d("div", ts, h(s(t)("device.information.app.version")), 1),
|
|
1722
|
-
d("div", ns, h((Ht = (jt = u.device) == null ? void 0 : jt.appVersion) == null ? void 0 : Ht.version), 1)
|
|
1723
|
-
])) : R("", !0)
|
|
1724
|
-
];
|
|
1725
|
-
}),
|
|
1726
|
-
_: 1
|
|
1727
|
-
})
|
|
1728
|
-
]),
|
|
1729
|
-
_: 1
|
|
1730
|
-
})) : R("", !0),
|
|
1731
|
-
(M = u.device.os) != null && M.system ? (p(), L(ie, {
|
|
1732
|
-
key: 2,
|
|
1733
|
-
variant: "outlined"
|
|
1734
|
-
}, {
|
|
1735
|
-
default: C(() => [
|
|
1736
|
-
f(B, {
|
|
1737
|
-
title: s(t)("device.information.sections.systemInfo"),
|
|
1738
|
-
class: "pb-8 px-16"
|
|
1739
|
-
}, null, 8, ["title"]),
|
|
1740
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1741
|
-
default: C(() => [
|
|
1742
|
-
(p(!0), b(te, null, ce(u.device.os.system, (w, P) => (p(), b(te, { key: P }, [
|
|
1743
|
-
w && !(w instanceof Object) ? (p(), b("div", os, [
|
|
1744
|
-
d("div", is, h(s(t)(`device.information.system.${P}`) || re(P)), 1),
|
|
1745
|
-
d("div", null, [
|
|
1746
|
-
d("div", ss, h(w), 1)
|
|
1747
|
-
])
|
|
1748
|
-
])) : R("", !0)
|
|
1749
|
-
], 64))), 128))
|
|
1750
|
-
]),
|
|
1751
|
-
_: 1
|
|
1752
|
-
})
|
|
1753
|
-
]),
|
|
1754
|
-
_: 1
|
|
1755
|
-
})) : R("", !0),
|
|
1756
|
-
($e = (fe = u.device) == null ? void 0 : fe.os) != null && $e.android ? (p(), L(ie, {
|
|
1757
|
-
key: 3,
|
|
1758
|
-
variant: "outlined"
|
|
1759
|
-
}, {
|
|
1760
|
-
default: C(() => [
|
|
1761
|
-
f(B, {
|
|
1762
|
-
title: s(t)("device.information.sections.androidOS"),
|
|
1763
|
-
class: "pb-8 px-16"
|
|
1764
|
-
}, null, 8, ["title"]),
|
|
1765
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1766
|
-
default: C(() => [
|
|
1767
|
-
(p(!0), b(te, null, ce(u.device.os.android, (w, P) => (p(), b(te, { key: P }, [
|
|
1768
|
-
w && !(w instanceof Object) ? (p(), b("div", as, [
|
|
1769
|
-
d("div", ls, h(s(t)(`device.information.android.${P}`) || re(P)), 1),
|
|
1770
|
-
d("div", null, [
|
|
1771
|
-
d("div", rs, h(w), 1)
|
|
1772
|
-
])
|
|
1773
|
-
])) : R("", !0)
|
|
1774
|
-
], 64))), 128))
|
|
1775
|
-
]),
|
|
1776
|
-
_: 1
|
|
1777
|
-
})
|
|
1778
|
-
]),
|
|
1779
|
-
_: 1
|
|
1780
|
-
})) : R("", !0),
|
|
1781
|
-
(at = u.device.os) != null && at.iOS ? (p(), L(ie, {
|
|
1782
|
-
key: 4,
|
|
1783
|
-
variant: "outlined"
|
|
1784
|
-
}, {
|
|
1785
|
-
default: C(() => [
|
|
1786
|
-
f(B, {
|
|
1787
|
-
title: s(t)("device.information.sections.iOSOS"),
|
|
1788
|
-
class: "pb-8 px-16"
|
|
1789
|
-
}, null, 8, ["title"]),
|
|
1790
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1791
|
-
default: C(() => [
|
|
1792
|
-
(p(!0), b(te, null, ce(u.device.os.iOS, (w, P) => (p(), b(te, { key: P }, [
|
|
1793
|
-
w && !(w instanceof Object) ? (p(), b("div", cs, [
|
|
1794
|
-
d("div", us, h(s(t)(`device.information.ios.${P}`) || re(P)), 1),
|
|
1795
|
-
d("div", null, [
|
|
1796
|
-
d("div", ds, h(w), 1)
|
|
1797
|
-
])
|
|
1798
|
-
])) : R("", !0)
|
|
1799
|
-
], 64))), 128))
|
|
1800
|
-
]),
|
|
1801
|
-
_: 1
|
|
1802
|
-
})
|
|
1803
|
-
]),
|
|
1804
|
-
_: 1
|
|
1805
|
-
})) : R("", !0),
|
|
1806
|
-
(Ne = u.device.os) != null && Ne.windows ? (p(), L(ie, {
|
|
1807
|
-
key: 5,
|
|
1808
|
-
variant: "outlined"
|
|
1809
|
-
}, {
|
|
1810
|
-
default: C(() => [
|
|
1811
|
-
f(B, {
|
|
1812
|
-
title: s(t)("device.information.sections.windowsOS"),
|
|
1813
|
-
class: "pb-8 px-16"
|
|
1814
|
-
}, null, 8, ["title"]),
|
|
1815
|
-
f(X, { class: "pt-0 flex flex-col gap-8" }, {
|
|
1816
|
-
default: C(() => [
|
|
1817
|
-
(p(!0), b(te, null, ce(u.device.os.windows, (w, P) => (p(), b(te, { key: P }, [
|
|
1818
|
-
w && !(w instanceof Object) ? (p(), b("div", ms, [
|
|
1819
|
-
d("div", ps, h(s(t)(`device.information.windows.${P}`) || re(P)), 1),
|
|
1820
|
-
d("div", null, [
|
|
1821
|
-
d("div", fs, h(w), 1)
|
|
1822
|
-
])
|
|
1823
|
-
])) : R("", !0)
|
|
1824
|
-
], 64))), 128))
|
|
1825
|
-
]),
|
|
1826
|
-
_: 1
|
|
1827
|
-
})
|
|
1828
|
-
]),
|
|
1829
|
-
_: 1
|
|
1830
|
-
})) : R("", !0),
|
|
1831
|
-
u.device.type === s(Y).Enum.MAIN ? (p(), b("div", hs, [
|
|
1832
|
-
d("div", _s, h(s(t)("device.customerDisplay.title")), 1),
|
|
1833
|
-
d("div", vs, h(s(t)("device.customerDisplay.description")), 1),
|
|
1834
|
-
le.value ? (p(), b("div", gs, [
|
|
1835
|
-
f(ze, { size: "lg" })
|
|
1836
|
-
])) : (p(), b("div", bs, [
|
|
1837
|
-
(Pe = z.value) != null && Pe.length ? (p(), b("div", ys, [
|
|
1838
|
-
d("img", {
|
|
1839
|
-
class: "object-cover w-full h-[264px] xs:h-[175px]",
|
|
1840
|
-
src: N.value
|
|
1841
|
-
}, null, 8, Ts),
|
|
1842
|
-
d("div", Es, [
|
|
1843
|
-
f(me, {
|
|
1844
|
-
class: "h-[36px] w-[36px]",
|
|
1845
|
-
icon: "close",
|
|
1846
|
-
onClick: H,
|
|
1847
|
-
variant: "secondary",
|
|
1848
|
-
"bg-color": "neutral-white"
|
|
1849
|
-
})
|
|
1850
|
-
])
|
|
1851
|
-
])) : R("", !0),
|
|
1852
|
-
d("div", Is, [
|
|
1853
|
-
(xe = z.value) != null && xe.length ? (p(), b("div", Fs, [
|
|
1854
|
-
(p(!0), b(te, null, ce(z.value, (w) => (p(), L(pe, {
|
|
1855
|
-
key: w,
|
|
1856
|
-
src: w,
|
|
1857
|
-
size: s(n)("xs") ? "lg" : "xl",
|
|
1858
|
-
class: nn(["cursor-pointer mr-1", N.value == w ? "border-fm-color-primary border-[2px]" : ""]),
|
|
1859
|
-
onClick: (P) => U(w)
|
|
1860
|
-
}, null, 8, ["src", "size", "class", "onClick"]))), 128))
|
|
1861
|
-
])) : R("", !0),
|
|
1862
|
-
f(gt, {
|
|
1863
|
-
class: "w-[200px] h-[170px]",
|
|
1864
|
-
onFileUpload: A[0] || (A[0] = (w) => j(w)),
|
|
1865
|
-
accept: "image/*"
|
|
1866
|
-
}, {
|
|
1867
|
-
"accept-text": C(() => A[3] || (A[3] = [
|
|
1868
|
-
d("div", null, null, -1)
|
|
1869
|
-
])),
|
|
1870
|
-
"helper-text": C(() => [
|
|
1871
|
-
d("div", ws, [
|
|
1872
|
-
d("div", null, h(s(t)("device.customerDisplay.imageSize.recommendation")), 1),
|
|
1873
|
-
d("div", null, h(s(t)("device.customerDisplay.imageSize.dimensions")), 1)
|
|
1874
|
-
])
|
|
1875
|
-
]),
|
|
1876
|
-
_: 1
|
|
1877
|
-
})
|
|
1878
|
-
])
|
|
1879
|
-
]))
|
|
1880
|
-
])) : R("", !0),
|
|
1881
|
-
d("div", {
|
|
1882
|
-
ref_key: "bottomDiv",
|
|
1883
|
-
ref: ne
|
|
1884
|
-
}, null, 512),
|
|
1885
|
-
(Ee = z.value) != null && Ee.length && u.device.type === s(Y).Enum.MAIN ? (p(), b("div", Cs, [
|
|
1886
|
-
d("div", ks, h(s(t)("device.customerDisplay.selection.title")), 1),
|
|
1887
|
-
d("div", Rs, h(s(t)("device.customerDisplay.selection.description")), 1),
|
|
1888
|
-
d("div", Os, [
|
|
1889
|
-
f(st, {
|
|
1890
|
-
"model-value": W.value,
|
|
1891
|
-
label: s(t)("device.filters.all"),
|
|
1892
|
-
value: "1",
|
|
1893
|
-
indeterminate: ((Ue = E.value) == null ? void 0 : Ue.length) > 0,
|
|
1894
|
-
"onUpdate:modelValue": k
|
|
1895
|
-
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
1896
|
-
(p(!0), b(te, null, ce(u.devices.filter((w) => w.restaurantId && w.type === s(Y).Enum.MAIN), (w, P) => (p(), L(st, {
|
|
1897
|
-
key: P,
|
|
1898
|
-
"model-value": E.value,
|
|
1899
|
-
label: T(w),
|
|
1900
|
-
value: w.restaurantId,
|
|
1901
|
-
"onUpdate:modelValue": K
|
|
1902
|
-
}, null, 8, ["model-value", "label", "value"]))), 128))
|
|
1903
|
-
])
|
|
1904
|
-
])) : R("", !0)
|
|
1905
|
-
])
|
|
1906
|
-
];
|
|
1907
|
-
}),
|
|
1908
|
-
_: 1
|
|
1909
|
-
})
|
|
1910
|
-
]),
|
|
1911
|
-
_: 2
|
|
1912
|
-
}, [
|
|
1913
|
-
u.device.type === s(Y).Enum.MAIN ? {
|
|
1914
|
-
name: "side-sheet-footer",
|
|
1915
|
-
fn: C(() => [
|
|
1916
|
-
d("div", As, [
|
|
1917
|
-
f(me, {
|
|
1918
|
-
loading: oe.value,
|
|
1919
|
-
disabled: oe.value,
|
|
1920
|
-
variant: "primary",
|
|
1921
|
-
label: s(t)("device.actions.update"),
|
|
1922
|
-
onClick: kt(J, ["prevent"])
|
|
1923
|
-
}, null, 8, ["loading", "disabled", "label"]),
|
|
1924
|
-
f(me, {
|
|
1925
|
-
disabled: oe.value,
|
|
1926
|
-
variant: "secondary",
|
|
1927
|
-
label: s(t)("device.actions.cancel"),
|
|
1928
|
-
onClick: A[1] || (A[1] = (a) => i.value = !1)
|
|
1929
|
-
}, null, 8, ["disabled", "label"])
|
|
1930
|
-
])
|
|
1931
|
-
]),
|
|
1932
|
-
key: "0"
|
|
1933
|
-
} : void 0
|
|
1934
|
-
]), 1032, ["header", "modelValue", "close-button"]);
|
|
1935
|
-
};
|
|
1936
|
-
}
|
|
1937
|
-
});
|
|
1938
|
-
function zs(e) {
|
|
1939
|
-
return e || {};
|
|
1940
|
-
}
|
|
1941
|
-
function Ss(e) {
|
|
1942
|
-
if (e == null || e === "" || typeof e == "boolean" || Array.isArray(e) || typeof e == "object")
|
|
1943
|
-
return !1;
|
|
1944
|
-
const t = Number(e);
|
|
1945
|
-
return !isNaN(t) && isFinite(t);
|
|
1946
|
-
}
|
|
1947
|
-
function Le(e, t, n) {
|
|
1948
|
-
const { t: o } = Re();
|
|
1949
|
-
return (i) => e(i) || o(t, zs(n));
|
|
1950
|
-
}
|
|
1951
|
-
const be = {
|
|
1952
|
-
required() {
|
|
1953
|
-
return Le((e) => {
|
|
1954
|
-
var t;
|
|
1955
|
-
return !!((t = e == null ? void 0 : e.toString()) != null && t.length);
|
|
1956
|
-
}, "device.validation.required", {});
|
|
1957
|
-
},
|
|
1958
|
-
nonEmpty() {
|
|
1959
|
-
return Le((e) => {
|
|
1960
|
-
var t;
|
|
1961
|
-
return !!((t = e == null ? void 0 : e.trim()) != null && t.length);
|
|
1962
|
-
}, "device.validation.required", {});
|
|
1963
|
-
},
|
|
1964
|
-
matches(e) {
|
|
1965
|
-
return Le((t) => t === e, "device.validation.invalid", {});
|
|
1966
|
-
},
|
|
1967
|
-
min(e) {
|
|
1968
|
-
return Le((t) => t >= e, "device.validation.min", { min: e });
|
|
1969
|
-
},
|
|
1970
|
-
max(e) {
|
|
1971
|
-
return Le((t) => t <= e, "device.validation.max", { max: e });
|
|
1972
|
-
},
|
|
1973
|
-
number() {
|
|
1974
|
-
return Le(Ss, "device.validation.number", {});
|
|
1975
|
-
}
|
|
1976
|
-
}, Ns = { class: "flex gap-8 items-center justify-start" }, Ps = /* @__PURE__ */ Ve({
|
|
1977
|
-
__name: "ManageConfigurationSideSheet",
|
|
1978
|
-
props: {
|
|
1979
|
-
device: {},
|
|
1980
|
-
visible: { type: Boolean }
|
|
1981
|
-
},
|
|
1982
|
-
setup(e) {
|
|
1983
|
-
const { t } = Re(), { isAtMost: n } = Ot(), o = e, i = dt(o, "visible"), l = x(), r = x(), m = x(), v = x(), T = q(
|
|
1984
|
-
() => Object.values(bt.enum).map((D) => ({
|
|
1985
|
-
label: D,
|
|
1986
|
-
value: D
|
|
1987
|
-
}))
|
|
1988
|
-
), F = tt(), z = async () => {
|
|
1989
|
-
if (!m.value || m.value > 30 || m.value < 5)
|
|
1990
|
-
return;
|
|
1991
|
-
const D = {
|
|
1992
|
-
logging: {
|
|
1993
|
-
enable: l.value,
|
|
1994
|
-
level: r.value,
|
|
1995
|
-
ttl: m.value
|
|
1996
|
-
},
|
|
1997
|
-
telemetry: {
|
|
1998
|
-
enable: v.value
|
|
1999
|
-
}
|
|
2000
|
-
};
|
|
2001
|
-
await ue.updateDeviceConfig(o.device.deviceId, D).then(async () => {
|
|
2002
|
-
S(), setTimeout(() => {
|
|
2003
|
-
F.open({
|
|
2004
|
-
message: t("device.status.config.success", { deviceName: o.device.name ?? o.device.restaurantName }),
|
|
2005
|
-
type: "success",
|
|
2006
|
-
position: Q.BOTTOM
|
|
2007
|
-
});
|
|
2008
|
-
}, 100);
|
|
2009
|
-
}).catch((O) => {
|
|
2010
|
-
F.open({
|
|
2011
|
-
message: t("device.status.config.error", { error: O }),
|
|
2012
|
-
type: "error",
|
|
2013
|
-
position: Q.BOTTOM
|
|
2014
|
-
});
|
|
2015
|
-
});
|
|
2016
|
-
}, S = () => {
|
|
2017
|
-
i.value = !1;
|
|
2018
|
-
};
|
|
2019
|
-
return Ct(async () => {
|
|
2020
|
-
await ue.getDeviceConfig(o.device.deviceId).then((D) => {
|
|
2021
|
-
var O, N, U, H;
|
|
2022
|
-
l.value = ((O = D.logging) == null ? void 0 : O.enable) ?? !0, r.value = ((N = D.logging) == null ? void 0 : N.level) ?? bt.Enum.ALL, m.value = ((U = D.logging) == null ? void 0 : U.ttl) ?? 30, v.value = ((H = D.telemetry) == null ? void 0 : H.enable) ?? !1;
|
|
2023
|
-
}).catch(() => {
|
|
2024
|
-
l.value = !0, r.value = bt.Enum.ALL, m.value = 30, v.value = !1;
|
|
2025
|
-
});
|
|
2026
|
-
}), (D, O) => {
|
|
2027
|
-
const N = I("FmCardHeader"), U = I("FmSwitch"), H = I("FmSelect"), W = I("FmStepperField"), k = I("FmCardSection"), E = I("FmCard"), K = I("FmForm"), ne = I("FmButton"), le = I("FmSideSheet");
|
|
2028
|
-
return p(), L(le, {
|
|
2029
|
-
header: s(t)("device.config.title"),
|
|
2030
|
-
modelValue: s(i),
|
|
2031
|
-
"onUpdate:modelValue": O[4] || (O[4] = (j) => tn(i) ? i.value = j : null),
|
|
2032
|
-
"max-width": s(n)("xs") ? 560 : 470
|
|
2033
|
-
}, {
|
|
2034
|
-
"side-sheet-footer": C(() => [
|
|
2035
|
-
d("div", Ns, [
|
|
2036
|
-
f(ne, {
|
|
2037
|
-
variant: "primary",
|
|
2038
|
-
label: s(t)("device.actions.update"),
|
|
2039
|
-
onClick: kt(z, ["prevent"])
|
|
2040
|
-
}, null, 8, ["label"]),
|
|
2041
|
-
f(ne, {
|
|
2042
|
-
variant: "secondary",
|
|
2043
|
-
label: s(t)("device.actions.cancel"),
|
|
2044
|
-
onClick: S
|
|
2045
|
-
}, null, 8, ["label"])
|
|
2046
|
-
])
|
|
2047
|
-
]),
|
|
2048
|
-
default: C(() => [
|
|
2049
|
-
f(K, null, {
|
|
2050
|
-
default: C(() => [
|
|
2051
|
-
f(E, { variant: "flat" }, {
|
|
2052
|
-
default: C(() => [
|
|
2053
|
-
f(N, {
|
|
2054
|
-
title: s(t)("device.config.logging.title"),
|
|
2055
|
-
class: "p-1"
|
|
2056
|
-
}, null, 8, ["title"]),
|
|
2057
|
-
f(k, { class: "p-1 flex gap-6 flex-col" }, {
|
|
2058
|
-
default: C(() => [
|
|
2059
|
-
f(U, {
|
|
2060
|
-
modelValue: l.value,
|
|
2061
|
-
"onUpdate:modelValue": O[0] || (O[0] = (j) => l.value = j),
|
|
2062
|
-
value: "first",
|
|
2063
|
-
label: s(t)("device.config.logging.enable.label"),
|
|
2064
|
-
sublabel: s(t)("device.config.logging.enable.sublabel"),
|
|
2065
|
-
"label-placement": "right"
|
|
2066
|
-
}, null, 8, ["modelValue", "label", "sublabel"]),
|
|
2067
|
-
f(H, {
|
|
2068
|
-
width: 150,
|
|
2069
|
-
modelValue: r.value,
|
|
2070
|
-
"onUpdate:modelValue": O[1] || (O[1] = (j) => r.value = j),
|
|
2071
|
-
label: s(t)("device.config.logging.logLevel"),
|
|
2072
|
-
items: T.value
|
|
2073
|
-
}, null, 8, ["modelValue", "label", "items"]),
|
|
2074
|
-
f(W, {
|
|
2075
|
-
modelValue: m.value,
|
|
2076
|
-
"onUpdate:modelValue": O[2] || (O[2] = (j) => m.value = j),
|
|
2077
|
-
label: s(t)("device.config.logging.ttl.label"),
|
|
2078
|
-
placeholder: "5",
|
|
2079
|
-
step: 1,
|
|
2080
|
-
min: 5,
|
|
2081
|
-
max: 30,
|
|
2082
|
-
rules: [s(be).required(), s(be).number(), s(be).min(5), s(be).max(30)],
|
|
2083
|
-
"append-text": s(t)("device.config.logging.ttl.unit")
|
|
2084
|
-
}, null, 8, ["modelValue", "label", "rules", "append-text"])
|
|
2085
|
-
]),
|
|
2086
|
-
_: 1
|
|
2087
|
-
})
|
|
2088
|
-
]),
|
|
2089
|
-
_: 1
|
|
2090
|
-
}),
|
|
2091
|
-
f(E, { variant: "flat" }, {
|
|
2092
|
-
default: C(() => [
|
|
2093
|
-
f(N, {
|
|
2094
|
-
title: s(t)("device.config.telemetry.title"),
|
|
2095
|
-
class: "p-1"
|
|
2096
|
-
}, null, 8, ["title"]),
|
|
2097
|
-
f(k, { class: "p-1 flex gap-6 flex-col" }, {
|
|
2098
|
-
default: C(() => [
|
|
2099
|
-
f(U, {
|
|
2100
|
-
modelValue: v.value,
|
|
2101
|
-
"onUpdate:modelValue": O[3] || (O[3] = (j) => v.value = j),
|
|
2102
|
-
value: "first",
|
|
2103
|
-
label: s(t)("device.config.telemetry.enable.label"),
|
|
2104
|
-
sublabel: s(t)("device.config.telemetry.enable.sublabel"),
|
|
2105
|
-
"label-placement": "right"
|
|
2106
|
-
}, null, 8, ["modelValue", "label", "sublabel"])
|
|
2107
|
-
]),
|
|
2108
|
-
_: 1
|
|
2109
|
-
})
|
|
2110
|
-
]),
|
|
2111
|
-
_: 1
|
|
2112
|
-
})
|
|
2113
|
-
]),
|
|
2114
|
-
_: 1
|
|
2115
|
-
})
|
|
2116
|
-
]),
|
|
2117
|
-
_: 1
|
|
2118
|
-
}, 8, ["header", "modelValue", "max-width"]);
|
|
2119
|
-
};
|
|
2120
|
-
}
|
|
2121
|
-
}), xs = { class: "flex flex-col gap-24 fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Us = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Ms = /* @__PURE__ */ Ve({
|
|
2122
|
-
__name: "UnbindDeviceDialog",
|
|
2123
|
-
props: {
|
|
2124
|
-
restaurantName: {
|
|
2125
|
-
type: String,
|
|
2126
|
-
required: !0
|
|
2127
|
-
}
|
|
2128
|
-
},
|
|
2129
|
-
setup(e) {
|
|
2130
|
-
const { t } = Re(), { emitData: n } = ln(), o = x(), i = q({
|
|
2131
|
-
get() {
|
|
2132
|
-
return o.value;
|
|
2133
|
-
},
|
|
2134
|
-
set(l) {
|
|
2135
|
-
o.value = l, n(o.value);
|
|
2136
|
-
}
|
|
2137
|
-
});
|
|
2138
|
-
return (l, r) => {
|
|
2139
|
-
const m = I("FmTextField"), v = I("FmForm");
|
|
2140
|
-
return p(), b("div", xs, [
|
|
2141
|
-
d("div", null, h(s(t)("device.unbindDevice.unbindConfirmationMessage")), 1),
|
|
2142
|
-
d("div", null, [
|
|
2143
|
-
Ft(h(s(t)("device.unbindDevice.confirmationInstructionPart1")) + " ", 1),
|
|
2144
|
-
d("span", Us, h(e.restaurantName), 1),
|
|
2145
|
-
Ft(" " + h(s(t)("device.unbindDevice.confirmationInstructionPart2")), 1)
|
|
2146
|
-
]),
|
|
2147
|
-
f(v, null, {
|
|
2148
|
-
default: C(() => [
|
|
2149
|
-
f(m, {
|
|
2150
|
-
modelValue: i.value,
|
|
2151
|
-
"onUpdate:modelValue": r[0] || (r[0] = (T) => i.value = T),
|
|
2152
|
-
rules: [s(be).required(), s(be).matches(e.restaurantName)],
|
|
2153
|
-
required: ""
|
|
2154
|
-
}, null, 8, ["modelValue", "rules"])
|
|
2155
|
-
]),
|
|
2156
|
-
_: 1
|
|
2157
|
-
})
|
|
2158
|
-
]);
|
|
2159
|
-
};
|
|
2160
|
-
}
|
|
2161
|
-
});
|
|
2162
|
-
function Et(e) {
|
|
2163
|
-
return e && (e = e.replace(/_/g, " ").toLowerCase(), e.split(" ").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "));
|
|
2164
|
-
}
|
|
2165
|
-
var wn = /* @__PURE__ */ ((e) => (e.licensePosCreateSubPos = "license_pos_create_subpos", e))(wn || {}), Ls = {}, ye = {};
|
|
2166
|
-
Object.defineProperty(ye, "__esModule", { value: !0 });
|
|
2167
|
-
ye.F_DISPLAY_NOTIFICATION_TYPE = ye.F_DISPLAY_ACTION_EVENT = ye.F_DISPLAY_SYSTEM_EVENT = void 0;
|
|
2168
|
-
const xt = Te;
|
|
2169
|
-
ye.F_DISPLAY_SYSTEM_EVENT = xt.z.enum([
|
|
2170
|
-
"restaurantInfo",
|
|
2171
|
-
"order",
|
|
2172
|
-
"orders",
|
|
2173
|
-
"action",
|
|
2174
|
-
"notification"
|
|
2175
|
-
]);
|
|
2176
|
-
ye.F_DISPLAY_ACTION_EVENT = xt.z.enum([
|
|
2177
|
-
"Serve",
|
|
2178
|
-
"StartCook",
|
|
2179
|
-
"FinishCook",
|
|
2180
|
-
"Close",
|
|
2181
|
-
"bind",
|
|
2182
|
-
"unbind"
|
|
2183
|
-
]);
|
|
2184
|
-
ye.F_DISPLAY_NOTIFICATION_TYPE = xt.z.enum([
|
|
2185
|
-
"Information",
|
|
2186
|
-
"Warning",
|
|
2187
|
-
"Error"
|
|
2188
|
-
]);
|
|
2189
|
-
var ft = {}, se = {};
|
|
2190
|
-
Object.defineProperty(se, "__esModule", { value: !0 });
|
|
2191
|
-
se.F_PRINTER_PRINT_CUSTOMIZE = se.F_PAPER_DIRECTION = se.F_PRINTER_TYPE = se.F_PRINTER_CONNECTOR = se.F_STAR_EMULATION_MODE = void 0;
|
|
2192
|
-
const nt = Te;
|
|
2193
|
-
se.F_STAR_EMULATION_MODE = nt.z.enum([
|
|
2194
|
-
"StarPRNT",
|
|
2195
|
-
"StarLine",
|
|
2196
|
-
"StarGraphic"
|
|
2197
|
-
]);
|
|
2198
|
-
se.F_PRINTER_CONNECTOR = nt.z.enum([
|
|
2199
|
-
"IP",
|
|
2200
|
-
"USB",
|
|
2201
|
-
"BLUETOOTH",
|
|
2202
|
-
"STAR"
|
|
2203
|
-
]);
|
|
2204
|
-
se.F_PRINTER_TYPE = nt.z.enum([
|
|
2205
|
-
"ESCPOS",
|
|
2206
|
-
"TSPL",
|
|
2207
|
-
"STAR",
|
|
2208
|
-
"KITCHEN_KDS",
|
|
2209
|
-
"WINDOW_KDS"
|
|
2210
|
-
]);
|
|
2211
|
-
se.F_PAPER_DIRECTION = nt.z.nativeEnum({
|
|
2212
|
-
NORMAL: "0",
|
|
2213
|
-
REVERSE: "1"
|
|
2214
|
-
});
|
|
2215
|
-
se.F_PRINTER_PRINT_CUSTOMIZE = nt.z.enum([
|
|
2216
|
-
"ALL",
|
|
2217
|
-
"ITEMS",
|
|
2218
|
-
"DEPARTMENTS"
|
|
2219
|
-
]);
|
|
2220
|
-
Object.defineProperty(ft, "__esModule", { value: !0 });
|
|
2221
|
-
ft.FdoPrinterInfo = void 0;
|
|
2222
|
-
const y = Te, Bs = mt, ut = se;
|
|
2223
|
-
ft.FdoPrinterInfo = y.z.object({
|
|
2224
|
-
_id: y.z.string(),
|
|
2225
|
-
connector: ut.F_PRINTER_CONNECTOR,
|
|
2226
|
-
type: ut.F_PRINTER_TYPE,
|
|
2227
|
-
emulationMode: ut.F_STAR_EMULATION_MODE.nullish(),
|
|
2228
|
-
machineId: y.z.string().nullish(),
|
|
2229
|
-
billPrintTemplateId: y.z.string(),
|
|
2230
|
-
orderPrintTemplateId: y.z.string(),
|
|
2231
|
-
voidPrintTemplateId: y.z.string(),
|
|
2232
|
-
name: y.z.string(),
|
|
2233
|
-
path: y.z.string(),
|
|
2234
|
-
paperWidth: y.z.number(),
|
|
2235
|
-
paperHeight: y.z.number(),
|
|
2236
|
-
paperGapDistance: y.z.number(),
|
|
2237
|
-
paperGapOffset: y.z.number(),
|
|
2238
|
-
paperXReference: y.z.number(),
|
|
2239
|
-
paperYReference: y.z.number(),
|
|
2240
|
-
paperDirection: y.z.string(),
|
|
2241
|
-
dpi: y.z.number(),
|
|
2242
|
-
splitProduct: y.z.number().nullish(),
|
|
2243
|
-
splitQuantity: y.z.number().nullish(),
|
|
2244
|
-
printBill: y.z.boolean(),
|
|
2245
|
-
printCustomItem: y.z.boolean().nullish(),
|
|
2246
|
-
printDineInItem: y.z.boolean().nullish(),
|
|
2247
|
-
printTakeawayItem: y.z.boolean().nullish(),
|
|
2248
|
-
printChangeTable: y.z.boolean().nullish(),
|
|
2249
|
-
printReport: y.z.boolean(),
|
|
2250
|
-
printOrder: y.z.boolean(),
|
|
2251
|
-
printOrderCombine: y.z.boolean().nullish(),
|
|
2252
|
-
printVoid: y.z.boolean(),
|
|
2253
|
-
strikeThroughItem: y.z.boolean().nullish(),
|
|
2254
|
-
printAllProduct: y.z.boolean(),
|
|
2255
|
-
binded: y.z.boolean().nullish(),
|
|
2256
|
-
backupToUsb: y.z.boolean().nullish(),
|
|
2257
|
-
backupPrinterId: y.z.string(),
|
|
2258
|
-
printCustomize: ut.F_PRINTER_PRINT_CUSTOMIZE.nullish(),
|
|
2259
|
-
printingDepartments: y.z.array(y.z.string()).nullish(),
|
|
2260
|
-
printingProducts: y.z.array(y.z.string()),
|
|
2261
|
-
filterSlot: y.z.array(y.z.string()).nullish(),
|
|
2262
|
-
useInternalName: y.z.boolean().nullish(),
|
|
2263
|
-
beepAfterPrint: y.z.boolean().nullish(),
|
|
2264
|
-
chunkSize: y.z.number().nullish(),
|
|
2265
|
-
chunkDelay: y.z.number().nullish(),
|
|
2266
|
-
maxRetry: y.z.number().nullish(),
|
|
2267
|
-
sleepDelay: y.z.number().nullish(),
|
|
2268
|
-
waitForStatus: y.z.boolean().nullish(),
|
|
2269
|
-
printFinishCook: y.z.boolean().nullish(),
|
|
2270
|
-
isTextEncoding: y.z.boolean().nullish()
|
|
2271
|
-
}).describe(Bs.ZodMeta.couch().repo("printerInfo").build());
|
|
2272
|
-
var ht = {};
|
|
2273
|
-
Object.defineProperty(ht, "__esModule", { value: !0 });
|
|
2274
|
-
ht.FdtoFlatItem = void 0;
|
|
2275
|
-
const en = an, It = Te;
|
|
2276
|
-
ht.FdtoFlatItem = It.z.object({
|
|
2277
|
-
itemKey: It.z.string(),
|
|
2278
|
-
item: en.FdoBillItem,
|
|
2279
|
-
parentKey: It.z.string().nullish(),
|
|
2280
|
-
parent: en.FdoBillItem.nullish()
|
|
2281
|
-
});
|
|
2282
|
-
var de = {};
|
|
2283
|
-
Object.defineProperty(de, "__esModule", { value: !0 });
|
|
2284
|
-
de.F_CELL_WIDTH_TYPE = de.F_TEXT_ALIGN = de.F_WIDGET_ALIGNMENT = de.F_WIDGET_TEMPLATE_TYPE = void 0;
|
|
2285
|
-
const _t = Te;
|
|
2286
|
-
de.F_WIDGET_TEMPLATE_TYPE = _t.z.enum([
|
|
2287
|
-
"TEXT",
|
|
2288
|
-
"CHECKBOX",
|
|
2289
|
-
"DIVIDER",
|
|
2290
|
-
"EMPTY",
|
|
2291
|
-
"IMAGE",
|
|
2292
|
-
"QR"
|
|
2293
|
-
]);
|
|
2294
|
-
de.F_WIDGET_ALIGNMENT = _t.z.enum([
|
|
2295
|
-
"TOP_LEFT",
|
|
2296
|
-
"TOP_CENTER",
|
|
2297
|
-
"TOP_RIGHT",
|
|
2298
|
-
"CENTER_LEFT",
|
|
2299
|
-
"CENTER",
|
|
2300
|
-
"CENTER_RIGHT",
|
|
2301
|
-
"BOTTOM_LEFT",
|
|
2302
|
-
"BOTTOM_CENTER",
|
|
2303
|
-
"BOTTOM_RIGHT"
|
|
2304
|
-
]);
|
|
2305
|
-
de.F_TEXT_ALIGN = _t.z.enum([
|
|
2306
|
-
"LEFT",
|
|
2307
|
-
"CENTER",
|
|
2308
|
-
"RIGHT"
|
|
2309
|
-
]);
|
|
2310
|
-
de.F_CELL_WIDTH_TYPE = _t.z.enum([
|
|
2311
|
-
"FLEX",
|
|
2312
|
-
"FIXED"
|
|
2313
|
-
]);
|
|
2314
|
-
var Cn = {};
|
|
2315
|
-
(function(e) {
|
|
2316
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.FdtoTicketItem = e.FdtoTicketSubItem = e.FdtoDisplayOrder = e.FdtoDisplayOrderConfig = e.FdtoDisplayNotification = e.FdtoDisplayAction = void 0;
|
|
2317
|
-
const t = an, n = Te, o = ye;
|
|
2318
|
-
e.FdtoDisplayAction = n.z.object({
|
|
2319
|
-
type: o.F_DISPLAY_ACTION_EVENT,
|
|
2320
|
-
id: n.z.string(),
|
|
2321
|
-
stationName: n.z.string().nullish(),
|
|
2322
|
-
targetIds: n.z.array(n.z.string()).nullish(),
|
|
2323
|
-
undo: n.z.boolean().nullish(),
|
|
2324
|
-
isoDate: n.z.string().nullish()
|
|
2325
|
-
}), e.FdtoDisplayNotification = n.z.object({
|
|
2326
|
-
type: o.F_DISPLAY_NOTIFICATION_TYPE,
|
|
2327
|
-
id: n.z.string(),
|
|
2328
|
-
title: n.z.string().nullish(),
|
|
2329
|
-
header: n.z.string().nullish(),
|
|
2330
|
-
message: n.z.string().nullish(),
|
|
2331
|
-
billId: n.z.string().nullish(),
|
|
2332
|
-
requireAcknowledge: n.z.boolean().nullish()
|
|
2333
|
-
}), e.FdtoDisplayOrderConfig = n.z.object({
|
|
2334
|
-
removeIfExist: n.z.boolean()
|
|
2335
|
-
}), e.FdtoDisplayOrder = n.z.object({
|
|
2336
|
-
config: e.FdtoDisplayOrderConfig,
|
|
2337
|
-
bill: t.FdoBill
|
|
2338
|
-
});
|
|
2339
|
-
const i = n.z.object({
|
|
2340
|
-
id: n.z.string(),
|
|
2341
|
-
label: n.z.string()
|
|
2342
|
-
});
|
|
2343
|
-
e.FdtoTicketSubItem = i.extend({
|
|
2344
|
-
subItems: n.z.array(n.z.lazy(() => e.FdtoTicketSubItem)).optional()
|
|
2345
|
-
}), e.FdtoTicketItem = n.z.object({
|
|
2346
|
-
productId: n.z.string(),
|
|
2347
|
-
itemKey: n.z.string(),
|
|
2348
|
-
subItemKeys: n.z.array(n.z.string()),
|
|
2349
|
-
status: n.z.string(),
|
|
2350
|
-
label: n.z.string(),
|
|
2351
|
-
code: n.z.string(),
|
|
2352
|
-
quantity: n.z.number(),
|
|
2353
|
-
remark: n.z.string(),
|
|
2354
|
-
currency: n.z.string().nullish(),
|
|
2355
|
-
sentAt: n.z.string().nullish(),
|
|
2356
|
-
sentBy: n.z.string().nullish(),
|
|
2357
|
-
startAt: n.z.string().nullish(),
|
|
2358
|
-
finishAt: n.z.string().nullish(),
|
|
2359
|
-
stationFinishAt: n.z.string().nullish(),
|
|
2360
|
-
completedAt: n.z.string().nullish(),
|
|
2361
|
-
servedAt: n.z.string().nullish(),
|
|
2362
|
-
voidReason: n.z.string().nullish(),
|
|
2363
|
-
subItems: n.z.array(e.FdtoTicketSubItem).nullish()
|
|
2364
|
-
});
|
|
2365
|
-
})(Cn);
|
|
2366
|
-
var vt = {};
|
|
2367
|
-
(function(e) {
|
|
2368
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.FdoEditorGroup = e.FdoAdvanceEditorRow = e.FdoAdvanceEditorColumn = e.FdoFixedCellWidth = e.FdoFlexCellWidth = e.FdoBaseCellWidth = e.FdoEditorConfig = e.FdoQrEditorConfig = e.FdoImageEditorConfig = e.FdoCheckboxEditorConfig = e.FdoDividerEditorConfig = e.FdoTextEditorConfig = e.FdoEmptyEditorConfig = e.FdoBaseEditorConfig = e.FdoCellEdgeInset = void 0;
|
|
2369
|
-
const t = mt, n = Te, o = de;
|
|
2370
|
-
e.FdoCellEdgeInset = n.z.object({
|
|
2371
|
-
top: n.z.number(),
|
|
2372
|
-
right: n.z.number(),
|
|
2373
|
-
bottom: n.z.number(),
|
|
2374
|
-
left: n.z.number()
|
|
2375
|
-
}), e.FdoBaseEditorConfig = n.z.object({
|
|
2376
|
-
type: o.F_WIDGET_TEMPLATE_TYPE,
|
|
2377
|
-
alignment: o.F_WIDGET_ALIGNMENT,
|
|
2378
|
-
padding: e.FdoCellEdgeInset,
|
|
2379
|
-
height: n.z.number().nullish()
|
|
2380
|
-
}).describe(t.ZodMeta.dart().baseUnion({
|
|
2381
|
-
isBaseUnion: !0,
|
|
2382
|
-
unionKey: "type",
|
|
2383
|
-
baseType: "FdoBaseEditorConfig"
|
|
2384
|
-
}).build()), e.FdoEmptyEditorConfig = e.FdoBaseEditorConfig.extend({
|
|
2385
|
-
type: n.z.literal(o.F_WIDGET_TEMPLATE_TYPE.enum.EMPTY)
|
|
2386
|
-
}), e.FdoTextEditorConfig = e.FdoBaseEditorConfig.extend({
|
|
2387
|
-
type: n.z.literal(o.F_WIDGET_TEMPLATE_TYPE.enum.TEXT),
|
|
2388
|
-
textAlign: o.F_TEXT_ALIGN,
|
|
2389
|
-
value: n.z.string(),
|
|
2390
|
-
factor: n.z.number(),
|
|
2391
|
-
isBold: n.z.boolean(),
|
|
2392
|
-
isItalic: n.z.boolean(),
|
|
2393
|
-
isUnderline: n.z.boolean(),
|
|
2394
|
-
isStrikeThrough: n.z.boolean().nullish()
|
|
2395
|
-
}), e.FdoDividerEditorConfig = e.FdoBaseEditorConfig.extend({
|
|
2396
|
-
type: n.z.literal(o.F_WIDGET_TEMPLATE_TYPE.enum.DIVIDER),
|
|
2397
|
-
spacing: n.z.number(),
|
|
2398
|
-
thickness: n.z.number()
|
|
2399
|
-
}), e.FdoCheckboxEditorConfig = e.FdoBaseEditorConfig.extend({
|
|
2400
|
-
type: n.z.literal(o.F_WIDGET_TEMPLATE_TYPE.enum.CHECKBOX),
|
|
2401
|
-
size: n.z.number(),
|
|
2402
|
-
height: n.z.number().nullish()
|
|
2403
|
-
}), e.FdoImageEditorConfig = e.FdoBaseEditorConfig.extend({
|
|
2404
|
-
type: n.z.literal(o.F_WIDGET_TEMPLATE_TYPE.enum.IMAGE),
|
|
2405
|
-
width: n.z.number().nullish(),
|
|
2406
|
-
height: n.z.number().nullish(),
|
|
2407
|
-
imgData: n.z.string()
|
|
2408
|
-
}), e.FdoQrEditorConfig = e.FdoBaseEditorConfig.extend({
|
|
2409
|
-
type: n.z.literal(o.F_WIDGET_TEMPLATE_TYPE.enum.QR),
|
|
2410
|
-
size: n.z.number(),
|
|
2411
|
-
link: n.z.string()
|
|
2412
|
-
}), e.FdoEditorConfig = n.z.object({
|
|
2413
|
-
data: n.z.discriminatedUnion("type", [
|
|
2414
|
-
e.FdoEmptyEditorConfig,
|
|
2415
|
-
e.FdoTextEditorConfig,
|
|
2416
|
-
e.FdoDividerEditorConfig,
|
|
2417
|
-
e.FdoCheckboxEditorConfig,
|
|
2418
|
-
e.FdoImageEditorConfig,
|
|
2419
|
-
e.FdoQrEditorConfig
|
|
2420
|
-
]).describe(t.ZodMeta.dart().discriminatedUnion({ baseType: "FdoBaseEditorConfig" }).build())
|
|
2421
|
-
}), e.FdoBaseCellWidth = n.z.object({
|
|
2422
|
-
type: o.F_CELL_WIDTH_TYPE
|
|
2423
|
-
}).describe(t.ZodMeta.dart().baseUnion({
|
|
2424
|
-
isBaseUnion: !0,
|
|
2425
|
-
unionKey: "type",
|
|
2426
|
-
baseType: "FdoBaseCellWidth"
|
|
2427
|
-
}).build()), e.FdoFlexCellWidth = e.FdoBaseCellWidth.extend({
|
|
2428
|
-
type: n.z.literal(o.F_CELL_WIDTH_TYPE.enum.FLEX),
|
|
2429
|
-
value: n.z.number()
|
|
2430
|
-
}), e.FdoFixedCellWidth = e.FdoBaseCellWidth.extend({
|
|
2431
|
-
type: n.z.literal(o.F_CELL_WIDTH_TYPE.enum.FIXED),
|
|
2432
|
-
value: n.z.number()
|
|
2433
|
-
}), e.FdoAdvanceEditorColumn = n.z.object({
|
|
2434
|
-
cells: n.z.array(e.FdoEditorConfig),
|
|
2435
|
-
width: n.z.discriminatedUnion("type", [e.FdoFixedCellWidth, e.FdoFlexCellWidth]).describe(t.ZodMeta.dart().discriminatedUnion({ baseType: "FdoBaseCellWidth" }).build()).nullish()
|
|
2436
|
-
}), e.FdoAdvanceEditorRow = n.z.object({
|
|
2437
|
-
columns: n.z.array(e.FdoAdvanceEditorColumn)
|
|
2438
|
-
}), e.FdoEditorGroup = n.z.object({
|
|
2439
|
-
rows: n.z.array(e.FdoAdvanceEditorRow)
|
|
2440
|
-
});
|
|
2441
|
-
})(vt);
|
|
2442
|
-
var kn = {};
|
|
2443
|
-
(function(e) {
|
|
2444
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.FdoOrderTemplateV4 = e.FdoOrderTemplateData = void 0;
|
|
2445
|
-
const t = mt, n = Te, o = vt;
|
|
2446
|
-
e.FdoOrderTemplateData = n.z.object({
|
|
2447
|
-
header: o.FdoEditorGroup,
|
|
2448
|
-
body: o.FdoEditorGroup,
|
|
2449
|
-
footer: o.FdoEditorGroup
|
|
2450
|
-
}), e.FdoOrderTemplateV4 = n.z.object({
|
|
2451
|
-
template: e.FdoOrderTemplateData,
|
|
2452
|
-
fmDefaultVersion: n.z.number().nullish(),
|
|
2453
|
-
_id: n.z.string(),
|
|
2454
|
-
name: n.z.string(),
|
|
2455
|
-
fontSize: n.z.number(),
|
|
2456
|
-
stickerMode: n.z.boolean().nullish()
|
|
2457
|
-
}).describe(t.ZodMeta.couch().repo("printTemplateV4").build());
|
|
2458
|
-
})(kn);
|
|
2459
|
-
var Rn = {};
|
|
2460
|
-
(function(e) {
|
|
2461
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.FdoReceiptTemplate = e.FdoTemplateSection = e.F_RECEIPT_SECTION = e.FdoReceiptInfo = void 0;
|
|
2462
|
-
const t = mt, n = Te, o = vt;
|
|
2463
|
-
e.FdoReceiptInfo = n.z.object({
|
|
2464
|
-
_id: n.z.string(),
|
|
2465
|
-
imgData: n.z.string(),
|
|
2466
|
-
headerText: n.z.string(),
|
|
2467
|
-
needAddress: n.z.boolean(),
|
|
2468
|
-
needPhoneNo: n.z.boolean(),
|
|
2469
|
-
needEmail: n.z.boolean(),
|
|
2470
|
-
invoicePrefix: n.z.string().nullish(),
|
|
2471
|
-
footerText: n.z.string(),
|
|
2472
|
-
footerQr: n.z.string().nullish(),
|
|
2473
|
-
fontSize: n.z.number().nullish(),
|
|
2474
|
-
hideZeroPriceAddon: n.z.boolean().nullish(),
|
|
2475
|
-
hideZeroPriceItem: n.z.boolean().nullish(),
|
|
2476
|
-
hideProductCode: n.z.boolean().nullish(),
|
|
2477
|
-
imgHeight: n.z.number().nullish(),
|
|
2478
|
-
imgWidth: n.z.number().nullish()
|
|
2479
|
-
}).describe(t.ZodMeta.couch().repo("receiptInfo").isSingleDoc().build()), e.F_RECEIPT_SECTION = n.z.enum([
|
|
2480
|
-
"GENERAL",
|
|
2481
|
-
"ITEM",
|
|
2482
|
-
"CALCULATION",
|
|
2483
|
-
"PAYMENT"
|
|
2484
|
-
]), e.FdoTemplateSection = n.z.object({
|
|
2485
|
-
name: n.z.string(),
|
|
2486
|
-
type: e.F_RECEIPT_SECTION,
|
|
2487
|
-
group: o.FdoEditorGroup
|
|
2488
|
-
}), e.FdoReceiptTemplate = n.z.object({
|
|
2489
|
-
_id: n.z.string(),
|
|
2490
|
-
name: n.z.string(),
|
|
2491
|
-
fontSize: n.z.number(),
|
|
2492
|
-
template: n.z.array(e.FdoTemplateSection)
|
|
2493
|
-
}).describe(t.ZodMeta.couch().repo("receiptTemplate").build());
|
|
2494
|
-
})(Rn);
|
|
2495
|
-
(function(e) {
|
|
2496
|
-
var t = lt && lt.__createBinding || (Object.create ? function(o, i, l, r) {
|
|
2497
|
-
r === void 0 && (r = l);
|
|
2498
|
-
var m = Object.getOwnPropertyDescriptor(i, l);
|
|
2499
|
-
(!m || ("get" in m ? !i.__esModule : m.writable || m.configurable)) && (m = { enumerable: !0, get: function() {
|
|
2500
|
-
return i[l];
|
|
2501
|
-
} }), Object.defineProperty(o, r, m);
|
|
2502
|
-
} : function(o, i, l, r) {
|
|
2503
|
-
r === void 0 && (r = l), o[r] = i[l];
|
|
2504
|
-
}), n = lt && lt.__exportStar || function(o, i) {
|
|
2505
|
-
for (var l in o)
|
|
2506
|
-
l !== "default" && !Object.prototype.hasOwnProperty.call(i, l) && t(i, o, l);
|
|
2507
|
-
};
|
|
2508
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), n(ye, e), n(ft, e), n(ht, e), n(se, e), n(de, e), n(Cn, e), n(vt, e), n(kn, e), n(Rn, e);
|
|
2509
|
-
})(Ls);
|
|
2510
|
-
const Vs = { class: "fm-typo-en-body-md-400" }, $s = { class: "xs:flex-col-reverse flex items-center justify-end gap-8 sm:flex-col-reverse" }, js = /* @__PURE__ */ Ve({
|
|
2511
|
-
__name: "CreateDeviceDialog",
|
|
2512
|
-
setup(e) {
|
|
2513
|
-
const { t } = Re(), n = Rt(), o = q(
|
|
2514
|
-
() => n.restaurants.value.map((k) => ({
|
|
2515
|
-
label: k.profile.name,
|
|
2516
|
-
value: k._id
|
|
2517
|
-
})).sort((k, E) => k.label.toLowerCase().localeCompare(E.label.toLowerCase()))
|
|
2518
|
-
), i = x([]), l = async () => {
|
|
2519
|
-
m.value && (i.value = await ue.getPrinters(m.value), F.value = []);
|
|
2520
|
-
}, r = q(
|
|
2521
|
-
() => i.value.map((k) => ({
|
|
2522
|
-
label: k.name,
|
|
2523
|
-
value: k._id
|
|
2524
|
-
}))
|
|
2525
|
-
), m = x(o.value.length === 1 ? o.value[0].value : ""), v = x(""), T = x(Y.Enum.COUNTER), F = x([]), { emitData: z } = ln(), S = q(() => ({
|
|
2526
|
-
restaurantId: m.value,
|
|
2527
|
-
name: v.value,
|
|
2528
|
-
type: T.value,
|
|
2529
|
-
printers: F.value
|
|
2530
|
-
}));
|
|
2531
|
-
Be(
|
|
2532
|
-
[m, v, T, F],
|
|
2533
|
-
() => {
|
|
2534
|
-
z(S.value);
|
|
2535
|
-
},
|
|
2536
|
-
{ deep: !0 }
|
|
2537
|
-
);
|
|
2538
|
-
const D = x();
|
|
2539
|
-
function O(k) {
|
|
2540
|
-
F.value = k ? r.value.map((E) => E.value) : [];
|
|
2541
|
-
}
|
|
2542
|
-
const N = tt(), U = rn(), { getUserFlagValue: H } = Ln(), W = async () => {
|
|
2543
|
-
try {
|
|
2544
|
-
const k = (await ue.getDevices(m.value)).filter((K) => K.type != Y.Enum.MAIN), E = await H(m.value, wn.licensePosCreateSubPos, 3);
|
|
2545
|
-
if (E && k.length >= E) {
|
|
2546
|
-
N.open({
|
|
2547
|
-
message: t("device.status.creation.limitError", { limit: E }),
|
|
2548
|
-
type: "error",
|
|
2549
|
-
position: Q.BOTTOM
|
|
2550
|
-
});
|
|
2551
|
-
return;
|
|
2552
|
-
}
|
|
2553
|
-
await ue.createSubDevice(S.value).then(() => {
|
|
2554
|
-
N.open({
|
|
2555
|
-
message: t("device.status.creation.success", { name: S.value.name }),
|
|
2556
|
-
type: "success",
|
|
2557
|
-
position: Q.BOTTOM
|
|
2558
|
-
});
|
|
2559
|
-
});
|
|
2560
|
-
} catch (k) {
|
|
2561
|
-
N.open({
|
|
2562
|
-
message: t("device.status.creation.error", { error: k }),
|
|
2563
|
-
type: "error",
|
|
2564
|
-
position: Q.BOTTOM
|
|
2565
|
-
});
|
|
2566
|
-
} finally {
|
|
2567
|
-
U.close();
|
|
2568
|
-
}
|
|
2569
|
-
};
|
|
2570
|
-
return Be(F, (k) => {
|
|
2571
|
-
D.value = k.length === r.value.length;
|
|
2572
|
-
}), Be(m, l), (k, E) => {
|
|
2573
|
-
const K = I("FmSelect"), ne = I("FmTextField"), le = I("FmCheckbox"), j = I("FmSpacer"), oe = I("FmButton"), Fe = I("FmForm");
|
|
2574
|
-
return p(), L(Fe, {
|
|
2575
|
-
onValidationSuccess: W,
|
|
2576
|
-
class: "flex flex-col gap-5 py-2"
|
|
2577
|
-
}, {
|
|
2578
|
-
default: C(() => [
|
|
2579
|
-
f(K, {
|
|
2580
|
-
modelValue: m.value,
|
|
2581
|
-
"onUpdate:modelValue": E[0] || (E[0] = (J) => m.value = J),
|
|
2582
|
-
label: s(t)("device.creation.fields.restaurant.label"),
|
|
2583
|
-
items: o.value,
|
|
2584
|
-
placeholder: s(t)("device.creation.fields.restaurant.label"),
|
|
2585
|
-
rules: [s(be).required()]
|
|
2586
|
-
}, null, 8, ["modelValue", "label", "items", "placeholder", "rules"]),
|
|
2587
|
-
f(ne, {
|
|
2588
|
-
modelValue: v.value,
|
|
2589
|
-
"onUpdate:modelValue": E[1] || (E[1] = (J) => v.value = J),
|
|
2590
|
-
label: s(t)("device.creation.fields.name.label"),
|
|
2591
|
-
placeholder: s(t)("device.creation.fields.name.placeholder"),
|
|
2592
|
-
rules: [s(be).nonEmpty()]
|
|
2593
|
-
}, null, 8, ["modelValue", "label", "placeholder", "rules"]),
|
|
2594
|
-
f(K, {
|
|
2595
|
-
modelValue: T.value,
|
|
2596
|
-
"onUpdate:modelValue": E[2] || (E[2] = (J) => T.value = J),
|
|
2597
|
-
items: [
|
|
2598
|
-
{
|
|
2599
|
-
label: s(t)("device.creation.fields.type.options.counter"),
|
|
2600
|
-
value: s(Y).Enum.COUNTER
|
|
2601
|
-
},
|
|
2602
|
-
{
|
|
2603
|
-
label: s(t)("device.creation.fields.type.options.orderStation"),
|
|
2604
|
-
value: s(Y).Enum.ORDER_STATION
|
|
2605
|
-
}
|
|
2606
|
-
],
|
|
2607
|
-
label: s(t)("device.creation.fields.type.label"),
|
|
2608
|
-
placeholder: s(t)("device.creation.fields.type.placeholder"),
|
|
2609
|
-
rules: [s(be).required()]
|
|
2610
|
-
}, null, 8, ["modelValue", "items", "label", "placeholder", "rules"]),
|
|
2611
|
-
m.value && r.value.length ? (p(), L(K, {
|
|
2612
|
-
key: 0,
|
|
2613
|
-
multiselect: "",
|
|
2614
|
-
modelValue: F.value,
|
|
2615
|
-
"onUpdate:modelValue": E[4] || (E[4] = (J) => F.value = J),
|
|
2616
|
-
items: r.value,
|
|
2617
|
-
label: s(t)("device.creation.fields.printer.label"),
|
|
2618
|
-
placeholder: s(t)("device.creation.fields.printer.placeholder")
|
|
2619
|
-
}, {
|
|
2620
|
-
"prepend-menu": C(() => [
|
|
2621
|
-
f(le, {
|
|
2622
|
-
class: "ml-1",
|
|
2623
|
-
indeterminate: F.value.length > 0,
|
|
2624
|
-
"model-value": D.value,
|
|
2625
|
-
"onUpdate:modelValue": E[3] || (E[3] = (J) => O(J)),
|
|
2626
|
-
label: " ",
|
|
2627
|
-
value: !0
|
|
2628
|
-
}, {
|
|
2629
|
-
label: C(() => [
|
|
2630
|
-
d("div", Vs, h(s(t)("device.filters.all")), 1)
|
|
2631
|
-
]),
|
|
2632
|
-
_: 1
|
|
2633
|
-
}, 8, ["indeterminate", "model-value"])
|
|
2634
|
-
]),
|
|
2635
|
-
_: 1
|
|
2636
|
-
}, 8, ["modelValue", "items", "label", "placeholder"])) : R("", !0),
|
|
2637
|
-
d("div", $s, [
|
|
2638
|
-
f(j, { class: "xs:hidden sm:hidden" }),
|
|
2639
|
-
f(oe, {
|
|
2640
|
-
class: "xs:w-full sm:w-full",
|
|
2641
|
-
variant: "secondary",
|
|
2642
|
-
label: s(t)("device.actions.cancel"),
|
|
2643
|
-
size: "md",
|
|
2644
|
-
onClick: E[5] || (E[5] = (J) => s(U).close())
|
|
2645
|
-
}, null, 8, ["label"]),
|
|
2646
|
-
f(oe, {
|
|
2647
|
-
class: "xs:w-full sm:w-full",
|
|
2648
|
-
variant: "primary",
|
|
2649
|
-
label: s(t)("device.actions.create"),
|
|
2650
|
-
size: "md",
|
|
2651
|
-
type: "submit"
|
|
2652
|
-
}, null, 8, ["label"])
|
|
2653
|
-
])
|
|
2654
|
-
]),
|
|
2655
|
-
_: 1
|
|
2656
|
-
});
|
|
2657
|
-
};
|
|
2658
|
-
}
|
|
2659
|
-
}), Hs = { class: "flex flex-col p-5 bg-white gap-5" }, Ws = { class: "flex items-center" }, Gs = { class: "fm-typo-en-title-md-600" }, Ys = {
|
|
2660
|
-
key: 0,
|
|
2661
|
-
class: "flex gap-8"
|
|
2662
|
-
}, qs = { class: "flex gap-4 pb-5" }, Ks = { key: 0 }, Xs = { class: "flex flex-col gap-1 overflow-y-auto h-full" }, Zs = { class: "flex w-full justify-between" }, Qs = { class: "w-full" }, Js = { class: "max-w-[250px]" }, ea = { class: "max-h-[310px] overflow-y-auto" }, ta = { class: "w-full" }, na = { class: "w-[200px]" }, oa = { class: "grow flex flex-col gap-8" }, ia = { class: "flex flex-row gap-4 flex-wrap items-center" }, sa = { class: "fm-typo-en-body-lg-600" }, aa = { key: 0 }, la = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ra = {
|
|
2663
|
-
key: 0,
|
|
2664
|
-
class: "flex gap-8"
|
|
2665
|
-
}, ca = {
|
|
2666
|
-
key: 0,
|
|
2667
|
-
class: "flex items-center"
|
|
2668
|
-
}, ua = { class: "flex flex-row gap-4" }, da = {
|
|
2669
|
-
key: 3,
|
|
2670
|
-
class: "fixed bottom-72 right-16"
|
|
2671
|
-
}, va = /* @__PURE__ */ Ve({
|
|
2672
|
-
__name: "DeviceList",
|
|
2673
|
-
setup(e) {
|
|
2674
|
-
const { t } = Re(), { isAtMost: n } = Ot(), o = Rt(), i = sn(), l = rn(), r = tt(), m = q(() => {
|
|
2675
|
-
var a;
|
|
2676
|
-
return (a = o.restaurants.value) == null ? void 0 : a.filter((c) => c.managable);
|
|
2677
|
-
}), v = q(() => i.getCustomerDisplayImages()), T = x(!1), F = x([]), z = x([]), S = x([]), D = x(""), O = x(!0), N = async () => {
|
|
2678
|
-
var a;
|
|
2679
|
-
try {
|
|
2680
|
-
const c = await ue.getDevicesFromRestaurants();
|
|
2681
|
-
F.value = c.map((_) => ({
|
|
2682
|
-
..._,
|
|
2683
|
-
type: _.type ?? "UNASSIGNED",
|
|
2684
|
-
restaurantName: it(_.restaurantId),
|
|
2685
|
-
images: _.type === Y.Enum.MAIN ? re(_.restaurantId) : []
|
|
2686
|
-
})), z.value = (a = m.value) == null ? void 0 : a.map((_) => _._id), S.value = k.value.map((_) => _.value);
|
|
2687
|
-
} catch (c) {
|
|
2688
|
-
console.error("Failed to get restaurants devices:", c);
|
|
2689
|
-
}
|
|
2690
|
-
}, U = (a, c) => a.type === Y.Enum.MAIN ? -1 : c.type === Y.Enum.MAIN ? 1 : a.type.toLowerCase() !== c.type.toLowerCase() ? a.type.toLowerCase() > c.type.toLowerCase() ? 1 : -1 : a.createdAt && c.createdAt ? a.createdAt < c.createdAt ? 1 : -1 : 0, H = q(() => {
|
|
2691
|
-
if (O.value)
|
|
2692
|
-
return [];
|
|
2693
|
-
const a = D.value.toLowerCase(), c = F.value.filter((_) => {
|
|
2694
|
-
const M = z.value.includes(_.restaurantId), fe = S.value.includes(_.type);
|
|
2695
|
-
return M && fe;
|
|
2696
|
-
});
|
|
2697
|
-
return a ? c.filter(
|
|
2698
|
-
(_) => JSON.stringify({ ..._ }).toLowerCase().includes(a)
|
|
2699
|
-
).sort(U) : c.sort(U);
|
|
2700
|
-
}), W = q(
|
|
2701
|
-
() => m.value.map((a) => ({
|
|
2702
|
-
label: a.profile.name,
|
|
2703
|
-
value: a._id
|
|
2704
|
-
}))
|
|
2705
|
-
), k = q(
|
|
2706
|
-
() => F.value.map((a) => ({
|
|
2707
|
-
label: a.type ? Et(a.type) : a.type,
|
|
2708
|
-
value: a.type
|
|
2709
|
-
})).filter((a, c) => c === F.value.findIndex((_) => a.value === _.type))
|
|
2710
|
-
), E = (a, c) => {
|
|
2711
|
-
const _ = a.indexOf(c.value);
|
|
2712
|
-
_ === -1 ? a.push(c.value) : a.splice(_, 1);
|
|
2713
|
-
}, K = (a, c) => {
|
|
2714
|
-
a.splice(0, a.length, ...a.length ? [] : c.map((_) => _.value));
|
|
2715
|
-
}, ne = (a, c, _) => {
|
|
2716
|
-
var M;
|
|
2717
|
-
return a.length === 0 ? "" : a.length === c.length ? `${_}: ${t("device.filters.all")}` : a.length === 1 && !n("sm") ? (M = c.find((fe) => fe.value === a[0])) == null ? void 0 : M.label : t("device.filters.selected", { count: a.length });
|
|
2718
|
-
}, le = (a) => {
|
|
2719
|
-
if (!a.restaurantId)
|
|
2720
|
-
return;
|
|
2721
|
-
const _ = `https://grafana.feedme.farm/d/ee5tjb68adwjkb/pos-dashboard-quickwit?orgId=1&var-maxRows=1000&var-severity=All&var-env=dev&var-country=All&var-restaurantId=${a.restaurantId}`;
|
|
2722
|
-
r.open({
|
|
2723
|
-
message: t("device.logs.redirect", { name: a.name ?? it(a.restaurantId) }),
|
|
2724
|
-
type: "success",
|
|
2725
|
-
position: Q.BOTTOM
|
|
2726
|
-
}), setTimeout(() => window.open(_, "_blank"), 500);
|
|
2727
|
-
}, j = (a) => {
|
|
2728
|
-
a.restaurantId && l.open({
|
|
2729
|
-
title: t("device.actions.unbindDevice"),
|
|
2730
|
-
contentComponent: Ms,
|
|
2731
|
-
contentComponentProps: {
|
|
2732
|
-
restaurantName: a.restaurantName
|
|
2733
|
-
},
|
|
2734
|
-
primaryActions: { text: t("device.actions.unbind"), close: !1, variant: "destructive" },
|
|
2735
|
-
secondaryActions: { text: t("device.actions.cancel"), close: !0 }
|
|
2736
|
-
}).onPrimary(async (c) => {
|
|
2737
|
-
c != a.restaurantName || !a.restaurantId || (await ue.unbindDevice(a.restaurantId).catch(async (_) => {
|
|
2738
|
-
if (_ === "Restaurant has no machine" && a.machineId)
|
|
2739
|
-
await ue.mdmUnbindDevice(a.machineId);
|
|
2740
|
-
else
|
|
2741
|
-
throw _;
|
|
2742
|
-
}).then(async () => {
|
|
2743
|
-
await pe(), r.open({
|
|
2744
|
-
message: t("device.status.unbind.success", { name: c }),
|
|
2745
|
-
type: "success",
|
|
2746
|
-
position: Q.BOTTOM
|
|
2747
|
-
});
|
|
2748
|
-
}).catch((_) => {
|
|
2749
|
-
r.open({
|
|
2750
|
-
message: t("device.error.general", { error: _ }),
|
|
2751
|
-
type: "error",
|
|
2752
|
-
position: Q.BOTTOM
|
|
2753
|
-
});
|
|
2754
|
-
}), l.close());
|
|
2755
|
-
});
|
|
2756
|
-
}, oe = x(""), Fe = async (a) => {
|
|
2757
|
-
oe.value = "";
|
|
2758
|
-
const c = await ue.generateDeviceOtp(a);
|
|
2759
|
-
oe.value = c.machineOtp ?? "";
|
|
2760
|
-
}, J = async (a) => {
|
|
2761
|
-
a.restaurantId && await Fe(a.restaurantId).then(() => {
|
|
2762
|
-
l.open({
|
|
2763
|
-
title: t("device.actions.bindDevice"),
|
|
2764
|
-
contentComponent: Wn,
|
|
2765
|
-
contentComponentProps: {
|
|
2766
|
-
restaurantId: a.restaurantId,
|
|
2767
|
-
get otp() {
|
|
2768
|
-
return oe.value;
|
|
2769
|
-
},
|
|
2770
|
-
"onUpdate:otp"(c) {
|
|
2771
|
-
oe.value = c;
|
|
2772
|
-
}
|
|
2773
|
-
},
|
|
2774
|
-
primaryActions: { text: t("device.actions.regenerate"), close: !1 },
|
|
2775
|
-
secondaryActions: { text: t("device.actions.cancel"), close: !0 }
|
|
2776
|
-
}).onPrimary(async () => {
|
|
2777
|
-
a.restaurantId && await Fe(a.restaurantId);
|
|
2778
|
-
}).onClose(async () => {
|
|
2779
|
-
await pe();
|
|
2780
|
-
let c = F.value.find(
|
|
2781
|
-
(_) => _.restaurantId === a.restaurantId && _.type === Y.Enum.MAIN && _.machineId
|
|
2782
|
-
);
|
|
2783
|
-
c && c.restaurantId && r.open({
|
|
2784
|
-
message: t("device.status.bind.success", { name: a.restaurantName }),
|
|
2785
|
-
type: "success",
|
|
2786
|
-
position: Q.BOTTOM
|
|
2787
|
-
});
|
|
2788
|
-
});
|
|
2789
|
-
}).catch((c) => {
|
|
2790
|
-
r.open({
|
|
2791
|
-
message: t("device.error.general", { error: c }),
|
|
2792
|
-
type: "error",
|
|
2793
|
-
position: Q.BOTTOM
|
|
2794
|
-
});
|
|
2795
|
-
});
|
|
2796
|
-
}, ot = () => {
|
|
2797
|
-
l.open({
|
|
2798
|
-
title: t("device.actions.forceSync"),
|
|
2799
|
-
message: t("device.status.sync.confirmation"),
|
|
2800
|
-
primaryActions: { text: t("device.actions.confirm"), close: !0, variant: "destructive" },
|
|
2801
|
-
secondaryActions: { text: t("device.actions.cancel"), close: !0 }
|
|
2802
|
-
}).onPrimary(async () => {
|
|
2803
|
-
l.close();
|
|
2804
|
-
const a = r.open({
|
|
2805
|
-
message: t("device.status.sync.inProgress"),
|
|
2806
|
-
spinner: !0,
|
|
2807
|
-
type: "info",
|
|
2808
|
-
position: Q.BOTTOM
|
|
2809
|
-
});
|
|
2810
|
-
await ue.forceSync().then(async () => {
|
|
2811
|
-
await pe(), setTimeout(() => {
|
|
2812
|
-
r.updateSnackbar(a, {
|
|
2813
|
-
message: t("device.status.sync.success"),
|
|
2814
|
-
spinner: !1,
|
|
2815
|
-
type: "success",
|
|
2816
|
-
position: Q.BOTTOM
|
|
2817
|
-
});
|
|
2818
|
-
}, 500);
|
|
2819
|
-
}).catch((c) => {
|
|
2820
|
-
r.updateSnackbar(a, {
|
|
2821
|
-
message: t("device.status.sync.error", { error: c }),
|
|
2822
|
-
spinner: !1,
|
|
2823
|
-
type: "error",
|
|
2824
|
-
position: Q.BOTTOM
|
|
2825
|
-
});
|
|
2826
|
-
});
|
|
2827
|
-
});
|
|
2828
|
-
}, it = (a) => {
|
|
2829
|
-
var c, _;
|
|
2830
|
-
return (_ = (c = m.value) == null ? void 0 : c.find((M) => M._id === a)) == null ? void 0 : _.profile.name;
|
|
2831
|
-
}, Oe = (a) => new Date(a).toLocaleDateString("en-GB", {
|
|
2832
|
-
day: "2-digit",
|
|
2833
|
-
month: "short",
|
|
2834
|
-
year: "numeric",
|
|
2835
|
-
hour: "2-digit",
|
|
2836
|
-
minute: "2-digit",
|
|
2837
|
-
hour12: !0
|
|
2838
|
-
}).toUpperCase().split(","), re = (a) => v.value.filter((c) => c.restaurantIds.includes(a)).map((c) => c.url), Ae = (a) => a.slice(0, 3), u = (a) => {
|
|
2839
|
-
const c = [{ label: t("device.menu.logs"), value: "logs", onClick: () => le(a) }];
|
|
2840
|
-
return a.deviceId && c.push({
|
|
2841
|
-
label: t("device.menu.configurations"),
|
|
2842
|
-
value: "configurations",
|
|
2843
|
-
onClick: () => {
|
|
2844
|
-
we.value = a, Se.value = !0;
|
|
2845
|
-
}
|
|
2846
|
-
}), c;
|
|
2847
|
-
}, A = [
|
|
2848
|
-
{
|
|
2849
|
-
id: "deviceName",
|
|
2850
|
-
accessorKey: "name",
|
|
2851
|
-
header: () => t("device.table.columns.deviceName"),
|
|
2852
|
-
cell: (a) => {
|
|
2853
|
-
let c = a.row.original, _ = c.name;
|
|
2854
|
-
return a.row.original.type === Y.Enum.MAIN && (_ = c.restaurantName), G("div", { class: "text-ellipsis overflow-hidden text-balance" }, _ ?? "-");
|
|
2855
|
-
},
|
|
2856
|
-
meta: {
|
|
2857
|
-
width: "220px"
|
|
2858
|
-
}
|
|
2859
|
-
},
|
|
2860
|
-
{
|
|
2861
|
-
id: "displayImage",
|
|
2862
|
-
accessorKey: "images",
|
|
2863
|
-
header: () => t("device.table.columns.displayImage"),
|
|
2864
|
-
cell(a) {
|
|
2865
|
-
const c = Ae(a.getValue()), _ = a.getValue().length - c.length;
|
|
2866
|
-
return c.length > 0 ? G("div", { class: "flex gap-8" }, [
|
|
2867
|
-
...c.map(
|
|
2868
|
-
(M) => G(Me.FmThumbnail, {
|
|
2869
|
-
src: M,
|
|
2870
|
-
size: n("sm") ? "sm" : "md",
|
|
2871
|
-
key: M
|
|
2872
|
-
})
|
|
2873
|
-
),
|
|
2874
|
-
_ > 0 && G("span", { class: "flex items-center" }, `+${_}`)
|
|
2875
|
-
]) : G("div", "-");
|
|
2876
|
-
},
|
|
2877
|
-
meta: {
|
|
2878
|
-
width: "220px"
|
|
2879
|
-
}
|
|
2880
|
-
},
|
|
2881
|
-
{
|
|
2882
|
-
id: "restaurantName",
|
|
2883
|
-
accessorKey: "restaurantName",
|
|
2884
|
-
header: () => t("device.table.columns.restaurantName"),
|
|
2885
|
-
cell: (a) => G("div", { class: "text-ellipsis overflow-hidden text-balance" }, a.getValue()),
|
|
2886
|
-
meta: {
|
|
2887
|
-
width: "220px"
|
|
2888
|
-
}
|
|
2889
|
-
},
|
|
2890
|
-
{
|
|
2891
|
-
accessorKey: "type",
|
|
2892
|
-
header: () => t("device.table.columns.deviceType"),
|
|
2893
|
-
cell(a) {
|
|
2894
|
-
return G(
|
|
2895
|
-
"div",
|
|
2896
|
-
G(Me.FmChip, {
|
|
2897
|
-
variant: "plain",
|
|
2898
|
-
label: Et(a.getValue()),
|
|
2899
|
-
compact: !0
|
|
2900
|
-
})
|
|
2901
|
-
);
|
|
2902
|
-
},
|
|
2903
|
-
meta: {
|
|
2904
|
-
width: "160px"
|
|
2905
|
-
}
|
|
2906
|
-
},
|
|
2907
|
-
{
|
|
2908
|
-
accessorKey: "bindAt",
|
|
2909
|
-
header: () => t("device.table.columns.bindingAt"),
|
|
2910
|
-
cell: (a) => {
|
|
2911
|
-
if (a.getValue()) {
|
|
2912
|
-
const [c, _] = Oe(a.getValue());
|
|
2913
|
-
return G("div", [G("div", c), G("div", _)]);
|
|
2914
|
-
}
|
|
2915
|
-
return G("div", "-");
|
|
2916
|
-
},
|
|
2917
|
-
meta: {
|
|
2918
|
-
width: "140px"
|
|
2919
|
-
}
|
|
2920
|
-
},
|
|
2921
|
-
{
|
|
2922
|
-
id: "bind-device",
|
|
2923
|
-
cell(a) {
|
|
2924
|
-
let c = a.row.original;
|
|
2925
|
-
const _ = !!c.machineId;
|
|
2926
|
-
if (c.type === Y.Enum.MAIN)
|
|
2927
|
-
return G(
|
|
2928
|
-
"div",
|
|
2929
|
-
{ class: "flex items-center justify-center" },
|
|
2930
|
-
G(Me.FmButton, {
|
|
2931
|
-
prependIcon: _ ? "link_off" : "link",
|
|
2932
|
-
variant: "secondary",
|
|
2933
|
-
label: n("sm") ? void 0 : t(_ ? "device.actions.unbindDevice" : "device.actions.bindDevice"),
|
|
2934
|
-
onClick(M) {
|
|
2935
|
-
M.stopPropagation(), _ ? j(c) : J(c);
|
|
2936
|
-
}
|
|
2937
|
-
})
|
|
2938
|
-
);
|
|
2939
|
-
},
|
|
2940
|
-
meta: {
|
|
2941
|
-
width: "235px"
|
|
2942
|
-
}
|
|
2943
|
-
},
|
|
2944
|
-
{
|
|
2945
|
-
id: "logs",
|
|
2946
|
-
cell(a) {
|
|
2947
|
-
var _;
|
|
2948
|
-
let c = a.row.original;
|
|
2949
|
-
return (_ = o.sessionUser.value) != null && _.role.isAdmin ? G(
|
|
2950
|
-
"div",
|
|
2951
|
-
G(
|
|
2952
|
-
Me.FmMenu,
|
|
2953
|
-
{
|
|
2954
|
-
stopClickPropagation: !0,
|
|
2955
|
-
shift: !0,
|
|
2956
|
-
placement: "bottom-end",
|
|
2957
|
-
width: 180,
|
|
2958
|
-
minHeight: 3e3
|
|
2959
|
-
},
|
|
2960
|
-
{
|
|
2961
|
-
default: () => u(c).map(
|
|
2962
|
-
(M) => G(Me.FmMenuItem, {
|
|
2963
|
-
key: M.value,
|
|
2964
|
-
label: M.label,
|
|
2965
|
-
onClick: M.onClick
|
|
2966
|
-
})
|
|
2967
|
-
),
|
|
2968
|
-
"menu-button": () => G(Me.FmButton, {
|
|
2969
|
-
variant: "tertiary",
|
|
2970
|
-
prependIcon: "more_vert"
|
|
2971
|
-
})
|
|
2972
|
-
}
|
|
2973
|
-
)
|
|
2974
|
-
) : null;
|
|
2975
|
-
},
|
|
2976
|
-
meta: {
|
|
2977
|
-
width: "1px"
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
], B = x(""), X = q(
|
|
2981
|
-
() => W.value.filter(
|
|
2982
|
-
(a) => B.value ? a.label.toLowerCase().includes(B.value.toLowerCase()) : !0
|
|
2983
|
-
)
|
|
2984
|
-
), ie = () => {
|
|
2985
|
-
l.open({
|
|
2986
|
-
title: t("device.creation.title"),
|
|
2987
|
-
contentComponent: js
|
|
2988
|
-
}).onClose(async () => {
|
|
2989
|
-
await pe();
|
|
2990
|
-
});
|
|
2991
|
-
}, De = x(!1), ze = x(!1), me = x(), pe = async () => {
|
|
2992
|
-
O.value = !0, await o.readRestaurants(), await N(), await on(), O.value = !1;
|
|
2993
|
-
}, { currentBusinessWithDisplayImages: gt } = Bn(i), st = q(() => o.currentBusiness.value);
|
|
2994
|
-
Be(ze, async (a) => {
|
|
2995
|
-
var c;
|
|
2996
|
-
a && ((c = me.value) == null ? void 0 : c.type) === Y.Enum.MAIN && (me.value = void 0, await pe()), ze.value = !1;
|
|
2997
|
-
});
|
|
2998
|
-
const we = x(), Se = x(!1);
|
|
2999
|
-
return Be(Se, (a) => {
|
|
3000
|
-
a || (we.value = void 0);
|
|
3001
|
-
}), Ct(async () => {
|
|
3002
|
-
gt.value = st.value, await pe(), await ue.forceSync();
|
|
3003
|
-
}), (a, c) => {
|
|
3004
|
-
const _ = I("FmSpacer"), M = I("FmButton"), fe = I("FmListItem"), $e = I("FmList"), at = I("FmBottomSheet"), Ne = I("FmMenuDivider"), Pe = I("FmSearch"), xe = I("FmChip"), Ee = I("FmMenuItem"), Ue = I("FmMenu"), w = I("FmTableToolbar"), P = I("FmTable"), he = I("FmThumbnail"), _e = I("FmCircularProgress");
|
|
3005
|
-
return p(), b("div", Hs, [
|
|
3006
|
-
d("div", Ws, [
|
|
3007
|
-
d("div", Gs, h(s(t)("device.title")), 1),
|
|
3008
|
-
f(_),
|
|
3009
|
-
s(n)("sm") ? R("", !0) : (p(), b("div", Ys, [
|
|
3010
|
-
f(M, {
|
|
3011
|
-
bgColor: "neutral-gray-100",
|
|
3012
|
-
textColor: "typo-secondary",
|
|
3013
|
-
label: s(t)("device.actions.refresh"),
|
|
3014
|
-
variant: "tertiary",
|
|
3015
|
-
onClick: pe
|
|
3016
|
-
}, null, 8, ["label"]),
|
|
3017
|
-
f(M, {
|
|
3018
|
-
bgColor: "neutral-gray-100",
|
|
3019
|
-
textColor: "typo-secondary",
|
|
3020
|
-
label: s(t)("device.actions.forceSync"),
|
|
3021
|
-
variant: "tertiary",
|
|
3022
|
-
onClick: ot
|
|
3023
|
-
}, null, 8, ["label"]),
|
|
3024
|
-
f(M, {
|
|
3025
|
-
icon: "add",
|
|
3026
|
-
label: s(t)("device.actions.addDevice"),
|
|
3027
|
-
variant: "primary",
|
|
3028
|
-
onClick: ie
|
|
3029
|
-
}, null, 8, ["label"])
|
|
3030
|
-
])),
|
|
3031
|
-
s(n)("sm") ? (p(), L(M, {
|
|
3032
|
-
key: 1,
|
|
3033
|
-
"prepend-icon": "more_vert",
|
|
3034
|
-
variant: "tertiary",
|
|
3035
|
-
onClick: c[0] || (c[0] = (g) => T.value = !0)
|
|
3036
|
-
})) : R("", !0),
|
|
3037
|
-
f(at, {
|
|
3038
|
-
zIndex: 100,
|
|
3039
|
-
modelValue: T.value,
|
|
3040
|
-
"onUpdate:modelValue": c[1] || (c[1] = (g) => T.value = g),
|
|
3041
|
-
"dismiss-away": "",
|
|
3042
|
-
"no-header": ""
|
|
3043
|
-
}, {
|
|
3044
|
-
default: C(() => [
|
|
3045
|
-
d("div", qs, [
|
|
3046
|
-
f($e, { class: "w-full" }, {
|
|
3047
|
-
default: C(() => [
|
|
3048
|
-
f(fe, {
|
|
3049
|
-
label: s(t)("device.actions.refresh"),
|
|
3050
|
-
onClick: pe
|
|
3051
|
-
}, null, 8, ["label"]),
|
|
3052
|
-
f(fe, {
|
|
3053
|
-
label: s(t)("device.actions.forceSync"),
|
|
3054
|
-
onClick: ot
|
|
3055
|
-
}, null, 8, ["label"])
|
|
3056
|
-
]),
|
|
3057
|
-
_: 1
|
|
3058
|
-
})
|
|
3059
|
-
])
|
|
3060
|
-
]),
|
|
3061
|
-
_: 1
|
|
3062
|
-
}, 8, ["modelValue"])
|
|
3063
|
-
]),
|
|
3064
|
-
s(n)("sm") ? (p(), b("div", Ks, [
|
|
3065
|
-
f(Ne),
|
|
3066
|
-
f(Pe, {
|
|
3067
|
-
modelValue: D.value,
|
|
3068
|
-
"onUpdate:modelValue": c[2] || (c[2] = (g) => D.value = g),
|
|
3069
|
-
placeholder: s(t)("device.actions.search")
|
|
3070
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
3071
|
-
f(Ne)
|
|
3072
|
-
])) : R("", !0),
|
|
3073
|
-
d("div", Xs, [
|
|
3074
|
-
f(w, { class: "gap-x-0" }, {
|
|
3075
|
-
chips: C(() => [
|
|
3076
|
-
d("div", Zs, [
|
|
3077
|
-
d("div", {
|
|
3078
|
-
class: nn(["flex flex-row gap-2 mb-4 items-end", s(n)("sm") ? "w-full justify-between" : ""])
|
|
3079
|
-
}, [
|
|
3080
|
-
d("div", Qs, [
|
|
3081
|
-
f(Ue, { "close-on-click": !1 }, {
|
|
3082
|
-
"menu-button": C(() => [
|
|
3083
|
-
f(xe, {
|
|
3084
|
-
label: ne(z.value, W.value, s(t)("device.filters.restaurant.label")),
|
|
3085
|
-
icon: "storefront",
|
|
3086
|
-
"right-icon": "keyboard_arrow_down",
|
|
3087
|
-
class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400 w-full"
|
|
3088
|
-
}, null, 8, ["label"])
|
|
3089
|
-
]),
|
|
3090
|
-
default: C(() => [
|
|
3091
|
-
d("div", Js, [
|
|
3092
|
-
f(Pe, {
|
|
3093
|
-
"model-value": B.value,
|
|
3094
|
-
"onUpdate:modelValue": c[3] || (c[3] = (g) => B.value = g),
|
|
3095
|
-
placeholder: s(t)("device.filters.restaurant.search"),
|
|
3096
|
-
collapsible: !1
|
|
3097
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
3098
|
-
f(Ne),
|
|
3099
|
-
d("div", ea, [
|
|
3100
|
-
f(Ee, {
|
|
3101
|
-
"model-value": z.value.length === W.value.length,
|
|
3102
|
-
label: s(t)("device.filters.all"),
|
|
3103
|
-
"has-checkbox": !0,
|
|
3104
|
-
indeterminate: z.value.length > 0,
|
|
3105
|
-
onClick: c[4] || (c[4] = () => K(z.value, W.value))
|
|
3106
|
-
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
3107
|
-
(p(!0), b(te, null, ce(X.value, (g, Z) => (p(), L(Ee, {
|
|
3108
|
-
key: Z,
|
|
3109
|
-
"model-value": !!z.value.find((ge) => ge === g.value),
|
|
3110
|
-
label: g.label,
|
|
3111
|
-
"has-checkbox": !0,
|
|
3112
|
-
onClick: () => E(z.value, g)
|
|
3113
|
-
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
3114
|
-
])
|
|
3115
|
-
])
|
|
3116
|
-
]),
|
|
3117
|
-
_: 1
|
|
3118
|
-
})
|
|
3119
|
-
]),
|
|
3120
|
-
d("div", ta, [
|
|
3121
|
-
f(Ue, { "close-on-click": !1 }, {
|
|
3122
|
-
"menu-button": C(() => [
|
|
3123
|
-
f(xe, {
|
|
3124
|
-
label: ne(S.value, k.value, s(t)("device.filters.deviceType")),
|
|
3125
|
-
icon: "monitor",
|
|
3126
|
-
"right-icon": "keyboard_arrow_down",
|
|
3127
|
-
class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400 w-full"
|
|
3128
|
-
}, null, 8, ["label"])
|
|
3129
|
-
]),
|
|
3130
|
-
default: C(() => [
|
|
3131
|
-
d("div", na, [
|
|
3132
|
-
f(Ee, {
|
|
3133
|
-
"model-value": S.value.length === k.value.length,
|
|
3134
|
-
label: s(t)("device.filters.all"),
|
|
3135
|
-
"has-checkbox": !0,
|
|
3136
|
-
indeterminate: S.value.length > 0,
|
|
3137
|
-
onClick: c[5] || (c[5] = () => K(S.value, k.value))
|
|
3138
|
-
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
3139
|
-
(p(!0), b(te, null, ce(k.value, (g, Z) => (p(), L(Ee, {
|
|
3140
|
-
key: Z,
|
|
3141
|
-
"model-value": !!S.value.find((ge) => ge === g.value),
|
|
3142
|
-
label: g.label ?? "",
|
|
3143
|
-
"has-checkbox": !0,
|
|
3144
|
-
onClick: () => E(S.value, g)
|
|
3145
|
-
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
3146
|
-
])
|
|
3147
|
-
]),
|
|
3148
|
-
_: 1
|
|
3149
|
-
})
|
|
3150
|
-
])
|
|
3151
|
-
], 2),
|
|
3152
|
-
s(n)("sm") ? R("", !0) : (p(), L(Pe, {
|
|
3153
|
-
key: 0,
|
|
3154
|
-
"model-value": D.value,
|
|
3155
|
-
"onUpdate:modelValue": c[6] || (c[6] = (g) => D.value = g),
|
|
3156
|
-
placeholder: s(t)("device.actions.search"),
|
|
3157
|
-
collapsible: !1,
|
|
3158
|
-
class: "w-[343px]"
|
|
3159
|
-
}, null, 8, ["model-value", "placeholder"]))
|
|
3160
|
-
])
|
|
3161
|
-
]),
|
|
3162
|
-
_: 1
|
|
3163
|
-
}),
|
|
3164
|
-
s(n)("sm") ? R("", !0) : (p(), L(P, {
|
|
3165
|
-
key: 0,
|
|
3166
|
-
"shrink-at": !1,
|
|
3167
|
-
"auto-reset-page-index": !0,
|
|
3168
|
-
class: "flex-1 overflow-y-auto",
|
|
3169
|
-
"column-defs": A,
|
|
3170
|
-
"row-data": H.value,
|
|
3171
|
-
loading: O.value,
|
|
3172
|
-
"hide-footer": H.value.length < 11,
|
|
3173
|
-
"on-row-click": (g) => {
|
|
3174
|
-
me.value = g.original, De.value = !0;
|
|
3175
|
-
}
|
|
3176
|
-
}, null, 8, ["row-data", "loading", "hide-footer", "on-row-click"])),
|
|
3177
|
-
s(n)("sm") && !O.value ? (p(), L($e, {
|
|
3178
|
-
key: 1,
|
|
3179
|
-
class: "w-full",
|
|
3180
|
-
separator: ""
|
|
3181
|
-
}, {
|
|
3182
|
-
default: C(() => [
|
|
3183
|
-
(p(!0), b(te, null, ce(H.value, (g) => (p(), L(fe, {
|
|
3184
|
-
key: g._id,
|
|
3185
|
-
style: { padding: "12px 0 !important" },
|
|
3186
|
-
onClick: () => {
|
|
3187
|
-
me.value = g, De.value = !0;
|
|
3188
|
-
}
|
|
3189
|
-
}, {
|
|
3190
|
-
default: C(() => [
|
|
3191
|
-
d("div", oa, [
|
|
3192
|
-
d("div", ia, [
|
|
3193
|
-
f(xe, {
|
|
3194
|
-
label: s(Et)(g.type),
|
|
3195
|
-
variant: "plain",
|
|
3196
|
-
compact: ""
|
|
3197
|
-
}, null, 8, ["label"])
|
|
3198
|
-
]),
|
|
3199
|
-
d("div", sa, [
|
|
3200
|
-
Ft(h(g.restaurantName) + " ", 1),
|
|
3201
|
-
g.type != s(Y).Enum.MAIN ? (p(), b("span", aa, " - " + h(g.name), 1)) : R("", !0)
|
|
3202
|
-
]),
|
|
3203
|
-
d("div", la, h(Oe(g.createdAt)[0]) + " " + h(Oe(g.createdAt)[1]), 1),
|
|
3204
|
-
v.value.length && g.type === s(Y).Enum.MAIN ? (p(), b("div", ra, [
|
|
3205
|
-
(p(!0), b(te, null, ce(Ae(re(g.restaurantId)), (Z) => (p(), b("div", { key: Z }, [
|
|
3206
|
-
f(he, {
|
|
3207
|
-
src: Z,
|
|
3208
|
-
size: "md"
|
|
3209
|
-
}, null, 8, ["src"])
|
|
3210
|
-
]))), 128)),
|
|
3211
|
-
re(g.restaurantId).length - Ae(re(g.restaurantId)).length > 0 ? (p(), b("span", ca, "+" + h(re(g.restaurantId).length - Ae(re(g.restaurantId)).length), 1)) : R("", !0)
|
|
3212
|
-
])) : R("", !0)
|
|
3213
|
-
]),
|
|
3214
|
-
d("div", ua, [
|
|
3215
|
-
g.type === s(Y).Enum.MAIN ? (p(), L(M, {
|
|
3216
|
-
key: 0,
|
|
3217
|
-
"prepend-icon": g.machineId ? "link_off" : "link",
|
|
3218
|
-
variant: "tertiary",
|
|
3219
|
-
onClick: kt(() => g.machineId ? j(g) : J(g), ["stop"])
|
|
3220
|
-
}, null, 8, ["prepend-icon", "onClick"])) : R("", !0),
|
|
3221
|
-
f(Ue, {
|
|
3222
|
-
stopClickPropagation: !0,
|
|
3223
|
-
shift: "",
|
|
3224
|
-
placement: "bottom-end",
|
|
3225
|
-
width: 180,
|
|
3226
|
-
minHeight: 3e3
|
|
3227
|
-
}, {
|
|
3228
|
-
"menu-button": C(() => [
|
|
3229
|
-
f(M, {
|
|
3230
|
-
variant: "tertiary",
|
|
3231
|
-
prependIcon: "more_vert"
|
|
3232
|
-
})
|
|
3233
|
-
]),
|
|
3234
|
-
default: C(() => [
|
|
3235
|
-
(p(!0), b(te, null, ce(u(g), (Z) => (p(), L(Ee, {
|
|
3236
|
-
key: Z.value,
|
|
3237
|
-
label: Z.label,
|
|
3238
|
-
onClick: Z.onClick
|
|
3239
|
-
}, null, 8, ["label", "onClick"]))), 128))
|
|
3240
|
-
]),
|
|
3241
|
-
_: 2
|
|
3242
|
-
}, 1024)
|
|
3243
|
-
])
|
|
3244
|
-
]),
|
|
3245
|
-
_: 2
|
|
3246
|
-
}, 1032, ["onClick"]))), 128))
|
|
3247
|
-
]),
|
|
3248
|
-
_: 1
|
|
3249
|
-
})) : (p(), L(_e, {
|
|
3250
|
-
key: 2,
|
|
3251
|
-
class: "hidden sm:block xs:block"
|
|
3252
|
-
})),
|
|
3253
|
-
s(n)("sm") ? (p(), b("div", da, [
|
|
3254
|
-
f(M, {
|
|
3255
|
-
icon: "add",
|
|
3256
|
-
label: s(t)("device.actions.addDevice"),
|
|
3257
|
-
onClick: ie,
|
|
3258
|
-
size: "lg"
|
|
3259
|
-
}, null, 8, ["label"])
|
|
3260
|
-
])) : R("", !0)
|
|
3261
|
-
]),
|
|
3262
|
-
(p(), L(An, { to: "body" }, [
|
|
3263
|
-
me.value ? (p(), L(Ds, {
|
|
3264
|
-
key: 0,
|
|
3265
|
-
visible: De.value,
|
|
3266
|
-
"onUpdate:visible": c[7] || (c[7] = (g) => De.value = g),
|
|
3267
|
-
device: me.value,
|
|
3268
|
-
devices: F.value,
|
|
3269
|
-
"form-updated": ze.value,
|
|
3270
|
-
"onUpdate:formUpdated": c[8] || (c[8] = (g) => ze.value = g)
|
|
3271
|
-
}, null, 8, ["visible", "device", "devices", "form-updated"])) : R("", !0),
|
|
3272
|
-
we.value && we.value.deviceId ? (p(), L(Ps, {
|
|
3273
|
-
key: 1,
|
|
3274
|
-
visible: Se.value,
|
|
3275
|
-
"onUpdate:visible": c[9] || (c[9] = (g) => Se.value = g),
|
|
3276
|
-
device: we.value
|
|
3277
|
-
}, null, 8, ["visible", "device"])) : R("", !0)
|
|
3278
|
-
]))
|
|
3279
|
-
]);
|
|
3280
|
-
};
|
|
3281
|
-
}
|
|
3282
|
-
});
|
|
3283
|
-
export {
|
|
3284
|
-
va as default
|
|
3285
|
-
};
|