@feedmepos/mf-settings 0.0.49 → 0.0.50-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/App-22eddb78.js +4352 -0
  2. package/dist/{Business-618e5ec3.js → Business-416835ab.js} +57 -52
  3. package/dist/{CreateBusiness-8f569ca5.js → CreateBusiness-138ac258.js} +21 -22
  4. package/dist/{FoodCourt-b50a5495.js → FoodCourt-561cd7e3.js} +24 -26
  5. package/dist/{ResponsiveFabButton.vue_vue_type_script_setup_true_lang-664bb402.js → ResponsiveFabButton.vue_vue_type_script_setup_true_lang-977372d5.js} +1 -1
  6. package/dist/Tagging-b746a5f3.js +6683 -0
  7. package/dist/actionButton-cc6bcf01.js +66 -0
  8. package/dist/app-abfabbcf.js +782 -0
  9. package/dist/app.js +6 -9
  10. package/dist/apps/mf-settings/src/app.d.ts +1 -2
  11. package/dist/apps/mf-settings/src/components/business/RestaurantForm.vue.d.ts +1 -1
  12. package/dist/apps/mf-settings/src/components/tagging/TaggingForm.vue.d.ts +3 -3
  13. package/dist/apps/mf-settings/src/init.d.ts +1 -0
  14. package/dist/apps/mf-settings/src/store/attributeSettings.d.ts +15 -15
  15. package/dist/apps/mf-settings/tsconfig.app.tsbuildinfo +1 -1
  16. package/dist/business-9a4e5bd7.js +31 -0
  17. package/dist/createForm-681e977a.js +64 -0
  18. package/dist/{index-3dd7fe2c.js → index-1eb3cc0a.js} +1 -1
  19. package/dist/index-f1e5e565.js +10903 -0
  20. package/dist/index.esm2017-c60b1ce5.js +3147 -0
  21. package/dist/loading-84215dce.js +2385 -0
  22. package/dist/packages/shared/src/components/form/ImageDropField.vue.d.ts +1 -1
  23. package/dist/packages/shared/src/components/info/TextChip.vue.d.ts +1 -1
  24. package/dist/packages/shared/src/components/loading/PageLoading.vue.d.ts +2 -0
  25. package/dist/packages/shared/src/components/loading/index.d.ts +1 -0
  26. package/package.json +4 -4
  27. package/dist/App-358f23fc.js +0 -53
  28. package/dist/app-050b47dd.js +0 -34303
@@ -0,0 +1,2385 @@
1
+ import { e as Q } from "./index-f1e5e565.js";
2
+ import { useCoreStore as j } from "@feedmepos/mf-common";
3
+ import { computed as Et, isRef as St, watch as Rt } from "vue";
4
+ import { defineStore as Tt } from "pinia";
5
+ import { SnackbarPosition as oe } from "@feedmepos/ui-library";
6
+ function We(t, e) {
7
+ return function() {
8
+ return t.apply(e, arguments);
9
+ };
10
+ }
11
+ const { toString: Ot } = Object.prototype, { getPrototypeOf: ge } = Object, Y = ((t) => (e) => {
12
+ const n = Ot.call(e);
13
+ return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
14
+ })(/* @__PURE__ */ Object.create(null)), x = (t) => (t = t.toLowerCase(), (e) => Y(e) === t), ee = (t) => (e) => typeof e === t, { isArray: F } = Array, $ = ee("undefined");
15
+ function At(t) {
16
+ return t !== null && !$(t) && t.constructor !== null && !$(t.constructor) && C(t.constructor.isBuffer) && t.constructor.isBuffer(t);
17
+ }
18
+ const Ge = x("ArrayBuffer");
19
+ function Ct(t) {
20
+ let e;
21
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Ge(t.buffer), e;
22
+ }
23
+ const It = ee("string"), C = ee("function"), Ve = ee("number"), te = (t) => t !== null && typeof t == "object", xt = (t) => t === !0 || t === !1, W = (t) => {
24
+ if (Y(t) !== "object")
25
+ return !1;
26
+ const e = ge(t);
27
+ return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
28
+ }, Ut = x("Date"), kt = x("File"), Pt = x("Blob"), Lt = x("FileList"), _t = (t) => te(t) && C(t.pipe), Bt = (t) => {
29
+ let e;
30
+ return t && (typeof FormData == "function" && t instanceof FormData || C(t.append) && ((e = Y(t)) === "formdata" || // detect form-data instance
31
+ e === "object" && C(t.toString) && t.toString() === "[object FormData]"));
32
+ }, vt = x("URLSearchParams"), [Nt, Ft, Mt, Dt] = ["ReadableStream", "Request", "Response", "Headers"].map(x), $t = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
33
+ function q(t, e, { allOwnKeys: n = !1 } = {}) {
34
+ if (t === null || typeof t > "u")
35
+ return;
36
+ let r, s;
37
+ if (typeof t != "object" && (t = [t]), F(t))
38
+ for (r = 0, s = t.length; r < s; r++)
39
+ e.call(null, t[r], r, t);
40
+ else {
41
+ const o = n ? Object.getOwnPropertyNames(t) : Object.keys(t), i = o.length;
42
+ let a;
43
+ for (r = 0; r < i; r++)
44
+ a = o[r], e.call(null, t[a], a, t);
45
+ }
46
+ }
47
+ function Qe(t, e) {
48
+ e = e.toLowerCase();
49
+ const n = Object.keys(t);
50
+ let r = n.length, s;
51
+ for (; r-- > 0; )
52
+ if (s = n[r], e === s.toLowerCase())
53
+ return s;
54
+ return null;
55
+ }
56
+ const B = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ke = (t) => !$(t) && t !== B;
57
+ function fe() {
58
+ const { caseless: t } = Ke(this) && this || {}, e = {}, n = (r, s) => {
59
+ const o = t && Qe(e, s) || s;
60
+ W(e[o]) && W(r) ? e[o] = fe(e[o], r) : W(r) ? e[o] = fe({}, r) : F(r) ? e[o] = r.slice() : e[o] = r;
61
+ };
62
+ for (let r = 0, s = arguments.length; r < s; r++)
63
+ arguments[r] && q(arguments[r], n);
64
+ return e;
65
+ }
66
+ const jt = (t, e, n, { allOwnKeys: r } = {}) => (q(e, (s, o) => {
67
+ n && C(s) ? t[o] = We(s, n) : t[o] = s;
68
+ }, { allOwnKeys: r }), t), qt = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ht = (t, e, n, r) => {
69
+ t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
70
+ value: e.prototype
71
+ }), n && Object.assign(t.prototype, n);
72
+ }, zt = (t, e, n, r) => {
73
+ let s, o, i;
74
+ const a = {};
75
+ if (e = e || {}, t == null)
76
+ return e;
77
+ do {
78
+ for (s = Object.getOwnPropertyNames(t), o = s.length; o-- > 0; )
79
+ i = s[o], (!r || r(i, t, e)) && !a[i] && (e[i] = t[i], a[i] = !0);
80
+ t = n !== !1 && ge(t);
81
+ } while (t && (!n || n(t, e)) && t !== Object.prototype);
82
+ return e;
83
+ }, Jt = (t, e, n) => {
84
+ t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
85
+ const r = t.indexOf(e, n);
86
+ return r !== -1 && r === n;
87
+ }, Wt = (t) => {
88
+ if (!t)
89
+ return null;
90
+ if (F(t))
91
+ return t;
92
+ let e = t.length;
93
+ if (!Ve(e))
94
+ return null;
95
+ const n = new Array(e);
96
+ for (; e-- > 0; )
97
+ n[e] = t[e];
98
+ return n;
99
+ }, Gt = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && ge(Uint8Array)), Vt = (t, e) => {
100
+ const r = (t && t[Symbol.iterator]).call(t);
101
+ let s;
102
+ for (; (s = r.next()) && !s.done; ) {
103
+ const o = s.value;
104
+ e.call(t, o[0], o[1]);
105
+ }
106
+ }, Qt = (t, e) => {
107
+ let n;
108
+ const r = [];
109
+ for (; (n = t.exec(e)) !== null; )
110
+ r.push(n);
111
+ return r;
112
+ }, Kt = x("HTMLFormElement"), Xt = (t) => t.toLowerCase().replace(
113
+ /[-_\s]([a-z\d])(\w*)/g,
114
+ function(n, r, s) {
115
+ return r.toUpperCase() + s;
116
+ }
117
+ ), Ie = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Zt = x("RegExp"), Xe = (t, e) => {
118
+ const n = Object.getOwnPropertyDescriptors(t), r = {};
119
+ q(n, (s, o) => {
120
+ let i;
121
+ (i = e(s, o, t)) !== !1 && (r[o] = i || s);
122
+ }), Object.defineProperties(t, r);
123
+ }, Yt = (t) => {
124
+ Xe(t, (e, n) => {
125
+ if (C(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
126
+ return !1;
127
+ const r = t[n];
128
+ if (C(r)) {
129
+ if (e.enumerable = !1, "writable" in e) {
130
+ e.writable = !1;
131
+ return;
132
+ }
133
+ e.set || (e.set = () => {
134
+ throw Error("Can not rewrite read-only method '" + n + "'");
135
+ });
136
+ }
137
+ });
138
+ }, en = (t, e) => {
139
+ const n = {}, r = (s) => {
140
+ s.forEach((o) => {
141
+ n[o] = !0;
142
+ });
143
+ };
144
+ return F(t) ? r(t) : r(String(t).split(e)), n;
145
+ }, tn = () => {
146
+ }, nn = (t, e) => t != null && Number.isFinite(t = +t) ? t : e, ie = "abcdefghijklmnopqrstuvwxyz", xe = "0123456789", Ze = {
147
+ DIGIT: xe,
148
+ ALPHA: ie,
149
+ ALPHA_DIGIT: ie + ie.toUpperCase() + xe
150
+ }, rn = (t = 16, e = Ze.ALPHA_DIGIT) => {
151
+ let n = "";
152
+ const { length: r } = e;
153
+ for (; t--; )
154
+ n += e[Math.random() * r | 0];
155
+ return n;
156
+ };
157
+ function sn(t) {
158
+ return !!(t && C(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
159
+ }
160
+ const on = (t) => {
161
+ const e = new Array(10), n = (r, s) => {
162
+ if (te(r)) {
163
+ if (e.indexOf(r) >= 0)
164
+ return;
165
+ if (!("toJSON" in r)) {
166
+ e[s] = r;
167
+ const o = F(r) ? [] : {};
168
+ return q(r, (i, a) => {
169
+ const d = n(i, s + 1);
170
+ !$(d) && (o[a] = d);
171
+ }), e[s] = void 0, o;
172
+ }
173
+ }
174
+ return r;
175
+ };
176
+ return n(t, 0);
177
+ }, an = x("AsyncFunction"), cn = (t) => t && (te(t) || C(t)) && C(t.then) && C(t.catch), Ye = ((t, e) => t ? setImmediate : e ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
178
+ s === B && o === n && r.length && r.shift()();
179
+ }, !1), (s) => {
180
+ r.push(s), B.postMessage(n, "*");
181
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
182
+ typeof setImmediate == "function",
183
+ C(B.postMessage)
184
+ ), un = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || Ye, c = {
185
+ isArray: F,
186
+ isArrayBuffer: Ge,
187
+ isBuffer: At,
188
+ isFormData: Bt,
189
+ isArrayBufferView: Ct,
190
+ isString: It,
191
+ isNumber: Ve,
192
+ isBoolean: xt,
193
+ isObject: te,
194
+ isPlainObject: W,
195
+ isReadableStream: Nt,
196
+ isRequest: Ft,
197
+ isResponse: Mt,
198
+ isHeaders: Dt,
199
+ isUndefined: $,
200
+ isDate: Ut,
201
+ isFile: kt,
202
+ isBlob: Pt,
203
+ isRegExp: Zt,
204
+ isFunction: C,
205
+ isStream: _t,
206
+ isURLSearchParams: vt,
207
+ isTypedArray: Gt,
208
+ isFileList: Lt,
209
+ forEach: q,
210
+ merge: fe,
211
+ extend: jt,
212
+ trim: $t,
213
+ stripBOM: qt,
214
+ inherits: Ht,
215
+ toFlatObject: zt,
216
+ kindOf: Y,
217
+ kindOfTest: x,
218
+ endsWith: Jt,
219
+ toArray: Wt,
220
+ forEachEntry: Vt,
221
+ matchAll: Qt,
222
+ isHTMLForm: Kt,
223
+ hasOwnProperty: Ie,
224
+ hasOwnProp: Ie,
225
+ // an alias to avoid ESLint no-prototype-builtins detection
226
+ reduceDescriptors: Xe,
227
+ freezeMethods: Yt,
228
+ toObjectSet: en,
229
+ toCamelCase: Xt,
230
+ noop: tn,
231
+ toFiniteNumber: nn,
232
+ findKey: Qe,
233
+ global: B,
234
+ isContextDefined: Ke,
235
+ ALPHABET: Ze,
236
+ generateString: rn,
237
+ isSpecCompliantForm: sn,
238
+ toJSONObject: on,
239
+ isAsyncFn: an,
240
+ isThenable: cn,
241
+ setImmediate: Ye,
242
+ asap: un
243
+ };
244
+ function m(t, e, n, r, s) {
245
+ Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
246
+ }
247
+ c.inherits(m, Error, {
248
+ toJSON: function() {
249
+ return {
250
+ // Standard
251
+ message: this.message,
252
+ name: this.name,
253
+ // Microsoft
254
+ description: this.description,
255
+ number: this.number,
256
+ // Mozilla
257
+ fileName: this.fileName,
258
+ lineNumber: this.lineNumber,
259
+ columnNumber: this.columnNumber,
260
+ stack: this.stack,
261
+ // Axios
262
+ config: c.toJSONObject(this.config),
263
+ code: this.code,
264
+ status: this.status
265
+ };
266
+ }
267
+ });
268
+ const et = m.prototype, tt = {};
269
+ [
270
+ "ERR_BAD_OPTION_VALUE",
271
+ "ERR_BAD_OPTION",
272
+ "ECONNABORTED",
273
+ "ETIMEDOUT",
274
+ "ERR_NETWORK",
275
+ "ERR_FR_TOO_MANY_REDIRECTS",
276
+ "ERR_DEPRECATED",
277
+ "ERR_BAD_RESPONSE",
278
+ "ERR_BAD_REQUEST",
279
+ "ERR_CANCELED",
280
+ "ERR_NOT_SUPPORT",
281
+ "ERR_INVALID_URL"
282
+ // eslint-disable-next-line func-names
283
+ ].forEach((t) => {
284
+ tt[t] = { value: t };
285
+ });
286
+ Object.defineProperties(m, tt);
287
+ Object.defineProperty(et, "isAxiosError", { value: !0 });
288
+ m.from = (t, e, n, r, s, o) => {
289
+ const i = Object.create(et);
290
+ return c.toFlatObject(t, i, function(d) {
291
+ return d !== Error.prototype;
292
+ }, (a) => a !== "isAxiosError"), m.call(i, t.message, e, n, r, s), i.cause = t, i.name = t.name, o && Object.assign(i, o), i;
293
+ };
294
+ const ln = null;
295
+ function pe(t) {
296
+ return c.isPlainObject(t) || c.isArray(t);
297
+ }
298
+ function nt(t) {
299
+ return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
300
+ }
301
+ function Ue(t, e, n) {
302
+ return t ? t.concat(e).map(function(s, o) {
303
+ return s = nt(s), !n && o ? "[" + s + "]" : s;
304
+ }).join(n ? "." : "") : e;
305
+ }
306
+ function dn(t) {
307
+ return c.isArray(t) && !t.some(pe);
308
+ }
309
+ const fn = c.toFlatObject(c, {}, null, function(e) {
310
+ return /^is[A-Z]/.test(e);
311
+ });
312
+ function ne(t, e, n) {
313
+ if (!c.isObject(t))
314
+ throw new TypeError("target must be an object");
315
+ e = e || new FormData(), n = c.toFlatObject(n, {
316
+ metaTokens: !0,
317
+ dots: !1,
318
+ indexes: !1
319
+ }, !1, function(y, h) {
320
+ return !c.isUndefined(h[y]);
321
+ });
322
+ const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(e);
323
+ if (!c.isFunction(s))
324
+ throw new TypeError("visitor must be a function");
325
+ function u(p) {
326
+ if (p === null)
327
+ return "";
328
+ if (c.isDate(p))
329
+ return p.toISOString();
330
+ if (!d && c.isBlob(p))
331
+ throw new m("Blob is not supported. Use a Buffer instead.");
332
+ return c.isArrayBuffer(p) || c.isTypedArray(p) ? d && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
333
+ }
334
+ function l(p, y, h) {
335
+ let b = p;
336
+ if (p && !h && typeof p == "object") {
337
+ if (c.endsWith(y, "{}"))
338
+ y = r ? y : y.slice(0, -2), p = JSON.stringify(p);
339
+ else if (c.isArray(p) && dn(p) || (c.isFileList(p) || c.endsWith(y, "[]")) && (b = c.toArray(p)))
340
+ return y = nt(y), b.forEach(function(R, U) {
341
+ !(c.isUndefined(R) || R === null) && e.append(
342
+ // eslint-disable-next-line no-nested-ternary
343
+ i === !0 ? Ue([y], U, o) : i === null ? y : y + "[]",
344
+ u(R)
345
+ );
346
+ }), !1;
347
+ }
348
+ return pe(p) ? !0 : (e.append(Ue(h, y, o), u(p)), !1);
349
+ }
350
+ const f = [], w = Object.assign(fn, {
351
+ defaultVisitor: l,
352
+ convertValue: u,
353
+ isVisitable: pe
354
+ });
355
+ function E(p, y) {
356
+ if (!c.isUndefined(p)) {
357
+ if (f.indexOf(p) !== -1)
358
+ throw Error("Circular reference detected in " + y.join("."));
359
+ f.push(p), c.forEach(p, function(b, S) {
360
+ (!(c.isUndefined(b) || b === null) && s.call(
361
+ e,
362
+ b,
363
+ c.isString(S) ? S.trim() : S,
364
+ y,
365
+ w
366
+ )) === !0 && E(b, y ? y.concat(S) : [S]);
367
+ }), f.pop();
368
+ }
369
+ }
370
+ if (!c.isObject(t))
371
+ throw new TypeError("data must be an object");
372
+ return E(t), e;
373
+ }
374
+ function ke(t) {
375
+ const e = {
376
+ "!": "%21",
377
+ "'": "%27",
378
+ "(": "%28",
379
+ ")": "%29",
380
+ "~": "%7E",
381
+ "%20": "+",
382
+ "%00": "\0"
383
+ };
384
+ return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
385
+ return e[r];
386
+ });
387
+ }
388
+ function Ee(t, e) {
389
+ this._pairs = [], t && ne(t, this, e);
390
+ }
391
+ const rt = Ee.prototype;
392
+ rt.append = function(e, n) {
393
+ this._pairs.push([e, n]);
394
+ };
395
+ rt.toString = function(e) {
396
+ const n = e ? function(r) {
397
+ return e.call(this, r, ke);
398
+ } : ke;
399
+ return this._pairs.map(function(s) {
400
+ return n(s[0]) + "=" + n(s[1]);
401
+ }, "").join("&");
402
+ };
403
+ function pn(t) {
404
+ return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
405
+ }
406
+ function st(t, e, n) {
407
+ if (!e)
408
+ return t;
409
+ const r = n && n.encode || pn, s = n && n.serialize;
410
+ let o;
411
+ if (s ? o = s(e, n) : o = c.isURLSearchParams(e) ? e.toString() : new Ee(e, n).toString(r), o) {
412
+ const i = t.indexOf("#");
413
+ i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
414
+ }
415
+ return t;
416
+ }
417
+ class hn {
418
+ constructor() {
419
+ this.handlers = [];
420
+ }
421
+ /**
422
+ * Add a new interceptor to the stack
423
+ *
424
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
425
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
426
+ *
427
+ * @return {Number} An ID used to remove interceptor later
428
+ */
429
+ use(e, n, r) {
430
+ return this.handlers.push({
431
+ fulfilled: e,
432
+ rejected: n,
433
+ synchronous: r ? r.synchronous : !1,
434
+ runWhen: r ? r.runWhen : null
435
+ }), this.handlers.length - 1;
436
+ }
437
+ /**
438
+ * Remove an interceptor from the stack
439
+ *
440
+ * @param {Number} id The ID that was returned by `use`
441
+ *
442
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
443
+ */
444
+ eject(e) {
445
+ this.handlers[e] && (this.handlers[e] = null);
446
+ }
447
+ /**
448
+ * Clear all interceptors from the stack
449
+ *
450
+ * @returns {void}
451
+ */
452
+ clear() {
453
+ this.handlers && (this.handlers = []);
454
+ }
455
+ /**
456
+ * Iterate over all the registered interceptors
457
+ *
458
+ * This method is particularly useful for skipping over any
459
+ * interceptors that may have become `null` calling `eject`.
460
+ *
461
+ * @param {Function} fn The function to call for each interceptor
462
+ *
463
+ * @returns {void}
464
+ */
465
+ forEach(e) {
466
+ c.forEach(this.handlers, function(r) {
467
+ r !== null && e(r);
468
+ });
469
+ }
470
+ }
471
+ const Pe = hn, ot = {
472
+ silentJSONParsing: !0,
473
+ forcedJSONParsing: !0,
474
+ clarifyTimeoutError: !1
475
+ }, mn = typeof URLSearchParams < "u" ? URLSearchParams : Ee, yn = typeof FormData < "u" ? FormData : null, wn = typeof Blob < "u" ? Blob : null, bn = {
476
+ isBrowser: !0,
477
+ classes: {
478
+ URLSearchParams: mn,
479
+ FormData: yn,
480
+ Blob: wn
481
+ },
482
+ protocols: ["http", "https", "file", "blob", "url", "data"]
483
+ }, Se = typeof window < "u" && typeof document < "u", he = typeof navigator == "object" && navigator || void 0, gn = Se && (!he || ["ReactNative", "NativeScript", "NS"].indexOf(he.product) < 0), En = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
484
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), Sn = Se && window.location.href || "http://localhost", Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
485
+ __proto__: null,
486
+ hasBrowserEnv: Se,
487
+ hasStandardBrowserEnv: gn,
488
+ hasStandardBrowserWebWorkerEnv: En,
489
+ navigator: he,
490
+ origin: Sn
491
+ }, Symbol.toStringTag, { value: "Module" })), A = {
492
+ ...Rn,
493
+ ...bn
494
+ };
495
+ function Tn(t, e) {
496
+ return ne(t, new A.classes.URLSearchParams(), Object.assign({
497
+ visitor: function(n, r, s, o) {
498
+ return A.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
499
+ }
500
+ }, e));
501
+ }
502
+ function On(t) {
503
+ return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
504
+ }
505
+ function An(t) {
506
+ const e = {}, n = Object.keys(t);
507
+ let r;
508
+ const s = n.length;
509
+ let o;
510
+ for (r = 0; r < s; r++)
511
+ o = n[r], e[o] = t[o];
512
+ return e;
513
+ }
514
+ function it(t) {
515
+ function e(n, r, s, o) {
516
+ let i = n[o++];
517
+ if (i === "__proto__")
518
+ return !0;
519
+ const a = Number.isFinite(+i), d = o >= n.length;
520
+ return i = !i && c.isArray(s) ? s.length : i, d ? (c.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), e(n, r, s[i], o) && c.isArray(s[i]) && (s[i] = An(s[i])), !a);
521
+ }
522
+ if (c.isFormData(t) && c.isFunction(t.entries)) {
523
+ const n = {};
524
+ return c.forEachEntry(t, (r, s) => {
525
+ e(On(r), s, n, 0);
526
+ }), n;
527
+ }
528
+ return null;
529
+ }
530
+ function Cn(t, e, n) {
531
+ if (c.isString(t))
532
+ try {
533
+ return (e || JSON.parse)(t), c.trim(t);
534
+ } catch (r) {
535
+ if (r.name !== "SyntaxError")
536
+ throw r;
537
+ }
538
+ return (n || JSON.stringify)(t);
539
+ }
540
+ const Re = {
541
+ transitional: ot,
542
+ adapter: ["xhr", "http", "fetch"],
543
+ transformRequest: [function(e, n) {
544
+ const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = c.isObject(e);
545
+ if (o && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
546
+ return s ? JSON.stringify(it(e)) : e;
547
+ if (c.isArrayBuffer(e) || c.isBuffer(e) || c.isStream(e) || c.isFile(e) || c.isBlob(e) || c.isReadableStream(e))
548
+ return e;
549
+ if (c.isArrayBufferView(e))
550
+ return e.buffer;
551
+ if (c.isURLSearchParams(e))
552
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
553
+ let a;
554
+ if (o) {
555
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
556
+ return Tn(e, this.formSerializer).toString();
557
+ if ((a = c.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
558
+ const d = this.env && this.env.FormData;
559
+ return ne(
560
+ a ? { "files[]": e } : e,
561
+ d && new d(),
562
+ this.formSerializer
563
+ );
564
+ }
565
+ }
566
+ return o || s ? (n.setContentType("application/json", !1), Cn(e)) : e;
567
+ }],
568
+ transformResponse: [function(e) {
569
+ const n = this.transitional || Re.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
570
+ if (c.isResponse(e) || c.isReadableStream(e))
571
+ return e;
572
+ if (e && c.isString(e) && (r && !this.responseType || s)) {
573
+ const i = !(n && n.silentJSONParsing) && s;
574
+ try {
575
+ return JSON.parse(e);
576
+ } catch (a) {
577
+ if (i)
578
+ throw a.name === "SyntaxError" ? m.from(a, m.ERR_BAD_RESPONSE, this, null, this.response) : a;
579
+ }
580
+ }
581
+ return e;
582
+ }],
583
+ /**
584
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
585
+ * timeout is not created.
586
+ */
587
+ timeout: 0,
588
+ xsrfCookieName: "XSRF-TOKEN",
589
+ xsrfHeaderName: "X-XSRF-TOKEN",
590
+ maxContentLength: -1,
591
+ maxBodyLength: -1,
592
+ env: {
593
+ FormData: A.classes.FormData,
594
+ Blob: A.classes.Blob
595
+ },
596
+ validateStatus: function(e) {
597
+ return e >= 200 && e < 300;
598
+ },
599
+ headers: {
600
+ common: {
601
+ Accept: "application/json, text/plain, */*",
602
+ "Content-Type": void 0
603
+ }
604
+ }
605
+ };
606
+ c.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
607
+ Re.headers[t] = {};
608
+ });
609
+ const Te = Re, In = c.toObjectSet([
610
+ "age",
611
+ "authorization",
612
+ "content-length",
613
+ "content-type",
614
+ "etag",
615
+ "expires",
616
+ "from",
617
+ "host",
618
+ "if-modified-since",
619
+ "if-unmodified-since",
620
+ "last-modified",
621
+ "location",
622
+ "max-forwards",
623
+ "proxy-authorization",
624
+ "referer",
625
+ "retry-after",
626
+ "user-agent"
627
+ ]), xn = (t) => {
628
+ const e = {};
629
+ let n, r, s;
630
+ return t && t.split(`
631
+ `).forEach(function(i) {
632
+ s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || e[n] && In[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r);
633
+ }), e;
634
+ }, Le = Symbol("internals");
635
+ function D(t) {
636
+ return t && String(t).trim().toLowerCase();
637
+ }
638
+ function G(t) {
639
+ return t === !1 || t == null ? t : c.isArray(t) ? t.map(G) : String(t);
640
+ }
641
+ function Un(t) {
642
+ const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
643
+ let r;
644
+ for (; r = n.exec(t); )
645
+ e[r[1]] = r[2];
646
+ return e;
647
+ }
648
+ const kn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
649
+ function ae(t, e, n, r, s) {
650
+ if (c.isFunction(r))
651
+ return r.call(this, e, n);
652
+ if (s && (e = n), !!c.isString(e)) {
653
+ if (c.isString(r))
654
+ return e.indexOf(r) !== -1;
655
+ if (c.isRegExp(r))
656
+ return r.test(e);
657
+ }
658
+ }
659
+ function Pn(t) {
660
+ return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
661
+ }
662
+ function Ln(t, e) {
663
+ const n = c.toCamelCase(" " + e);
664
+ ["get", "set", "has"].forEach((r) => {
665
+ Object.defineProperty(t, r + n, {
666
+ value: function(s, o, i) {
667
+ return this[r].call(this, e, s, o, i);
668
+ },
669
+ configurable: !0
670
+ });
671
+ });
672
+ }
673
+ let re = class {
674
+ constructor(e) {
675
+ e && this.set(e);
676
+ }
677
+ set(e, n, r) {
678
+ const s = this;
679
+ function o(a, d, u) {
680
+ const l = D(d);
681
+ if (!l)
682
+ throw new Error("header name must be a non-empty string");
683
+ const f = c.findKey(s, l);
684
+ (!f || s[f] === void 0 || u === !0 || u === void 0 && s[f] !== !1) && (s[f || d] = G(a));
685
+ }
686
+ const i = (a, d) => c.forEach(a, (u, l) => o(u, l, d));
687
+ if (c.isPlainObject(e) || e instanceof this.constructor)
688
+ i(e, n);
689
+ else if (c.isString(e) && (e = e.trim()) && !kn(e))
690
+ i(xn(e), n);
691
+ else if (c.isHeaders(e))
692
+ for (const [a, d] of e.entries())
693
+ o(d, a, r);
694
+ else
695
+ e != null && o(n, e, r);
696
+ return this;
697
+ }
698
+ get(e, n) {
699
+ if (e = D(e), e) {
700
+ const r = c.findKey(this, e);
701
+ if (r) {
702
+ const s = this[r];
703
+ if (!n)
704
+ return s;
705
+ if (n === !0)
706
+ return Un(s);
707
+ if (c.isFunction(n))
708
+ return n.call(this, s, r);
709
+ if (c.isRegExp(n))
710
+ return n.exec(s);
711
+ throw new TypeError("parser must be boolean|regexp|function");
712
+ }
713
+ }
714
+ }
715
+ has(e, n) {
716
+ if (e = D(e), e) {
717
+ const r = c.findKey(this, e);
718
+ return !!(r && this[r] !== void 0 && (!n || ae(this, this[r], r, n)));
719
+ }
720
+ return !1;
721
+ }
722
+ delete(e, n) {
723
+ const r = this;
724
+ let s = !1;
725
+ function o(i) {
726
+ if (i = D(i), i) {
727
+ const a = c.findKey(r, i);
728
+ a && (!n || ae(r, r[a], a, n)) && (delete r[a], s = !0);
729
+ }
730
+ }
731
+ return c.isArray(e) ? e.forEach(o) : o(e), s;
732
+ }
733
+ clear(e) {
734
+ const n = Object.keys(this);
735
+ let r = n.length, s = !1;
736
+ for (; r--; ) {
737
+ const o = n[r];
738
+ (!e || ae(this, this[o], o, e, !0)) && (delete this[o], s = !0);
739
+ }
740
+ return s;
741
+ }
742
+ normalize(e) {
743
+ const n = this, r = {};
744
+ return c.forEach(this, (s, o) => {
745
+ const i = c.findKey(r, o);
746
+ if (i) {
747
+ n[i] = G(s), delete n[o];
748
+ return;
749
+ }
750
+ const a = e ? Pn(o) : String(o).trim();
751
+ a !== o && delete n[o], n[a] = G(s), r[a] = !0;
752
+ }), this;
753
+ }
754
+ concat(...e) {
755
+ return this.constructor.concat(this, ...e);
756
+ }
757
+ toJSON(e) {
758
+ const n = /* @__PURE__ */ Object.create(null);
759
+ return c.forEach(this, (r, s) => {
760
+ r != null && r !== !1 && (n[s] = e && c.isArray(r) ? r.join(", ") : r);
761
+ }), n;
762
+ }
763
+ [Symbol.iterator]() {
764
+ return Object.entries(this.toJSON())[Symbol.iterator]();
765
+ }
766
+ toString() {
767
+ return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(`
768
+ `);
769
+ }
770
+ get [Symbol.toStringTag]() {
771
+ return "AxiosHeaders";
772
+ }
773
+ static from(e) {
774
+ return e instanceof this ? e : new this(e);
775
+ }
776
+ static concat(e, ...n) {
777
+ const r = new this(e);
778
+ return n.forEach((s) => r.set(s)), r;
779
+ }
780
+ static accessor(e) {
781
+ const r = (this[Le] = this[Le] = {
782
+ accessors: {}
783
+ }).accessors, s = this.prototype;
784
+ function o(i) {
785
+ const a = D(i);
786
+ r[a] || (Ln(s, i), r[a] = !0);
787
+ }
788
+ return c.isArray(e) ? e.forEach(o) : o(e), this;
789
+ }
790
+ };
791
+ re.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
792
+ c.reduceDescriptors(re.prototype, ({ value: t }, e) => {
793
+ let n = e[0].toUpperCase() + e.slice(1);
794
+ return {
795
+ get: () => t,
796
+ set(r) {
797
+ this[n] = r;
798
+ }
799
+ };
800
+ });
801
+ c.freezeMethods(re);
802
+ const I = re;
803
+ function ce(t, e) {
804
+ const n = this || Te, r = e || n, s = I.from(r.headers);
805
+ let o = r.data;
806
+ return c.forEach(t, function(a) {
807
+ o = a.call(n, o, s.normalize(), e ? e.status : void 0);
808
+ }), s.normalize(), o;
809
+ }
810
+ function at(t) {
811
+ return !!(t && t.__CANCEL__);
812
+ }
813
+ function M(t, e, n) {
814
+ m.call(this, t ?? "canceled", m.ERR_CANCELED, e, n), this.name = "CanceledError";
815
+ }
816
+ c.inherits(M, m, {
817
+ __CANCEL__: !0
818
+ });
819
+ function ct(t, e, n) {
820
+ const r = n.config.validateStatus;
821
+ !n.status || !r || r(n.status) ? t(n) : e(new m(
822
+ "Request failed with status code " + n.status,
823
+ [m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
824
+ n.config,
825
+ n.request,
826
+ n
827
+ ));
828
+ }
829
+ function _n(t) {
830
+ const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
831
+ return e && e[1] || "";
832
+ }
833
+ function Bn(t, e) {
834
+ t = t || 10;
835
+ const n = new Array(t), r = new Array(t);
836
+ let s = 0, o = 0, i;
837
+ return e = e !== void 0 ? e : 1e3, function(d) {
838
+ const u = Date.now(), l = r[o];
839
+ i || (i = u), n[s] = d, r[s] = u;
840
+ let f = o, w = 0;
841
+ for (; f !== s; )
842
+ w += n[f++], f = f % t;
843
+ if (s = (s + 1) % t, s === o && (o = (o + 1) % t), u - i < e)
844
+ return;
845
+ const E = l && u - l;
846
+ return E ? Math.round(w * 1e3 / E) : void 0;
847
+ };
848
+ }
849
+ function vn(t, e) {
850
+ let n = 0, r = 1e3 / e, s, o;
851
+ const i = (u, l = Date.now()) => {
852
+ n = l, s = null, o && (clearTimeout(o), o = null), t.apply(null, u);
853
+ };
854
+ return [(...u) => {
855
+ const l = Date.now(), f = l - n;
856
+ f >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
857
+ o = null, i(s);
858
+ }, r - f)));
859
+ }, () => s && i(s)];
860
+ }
861
+ const K = (t, e, n = 3) => {
862
+ let r = 0;
863
+ const s = Bn(50, 250);
864
+ return vn((o) => {
865
+ const i = o.loaded, a = o.lengthComputable ? o.total : void 0, d = i - r, u = s(d), l = i <= a;
866
+ r = i;
867
+ const f = {
868
+ loaded: i,
869
+ total: a,
870
+ progress: a ? i / a : void 0,
871
+ bytes: d,
872
+ rate: u || void 0,
873
+ estimated: u && a && l ? (a - i) / u : void 0,
874
+ event: o,
875
+ lengthComputable: a != null,
876
+ [e ? "download" : "upload"]: !0
877
+ };
878
+ t(f);
879
+ }, n);
880
+ }, _e = (t, e) => {
881
+ const n = t != null;
882
+ return [(r) => e[0]({
883
+ lengthComputable: n,
884
+ total: t,
885
+ loaded: r
886
+ }), e[1]];
887
+ }, Be = (t) => (...e) => c.asap(() => t(...e)), Nn = A.hasStandardBrowserEnv ? (
888
+ // Standard browser envs have full support of the APIs needed to test
889
+ // whether the request URL is of the same origin as current location.
890
+ function() {
891
+ const e = A.navigator && /(msie|trident)/i.test(A.navigator.userAgent), n = document.createElement("a");
892
+ let r;
893
+ function s(o) {
894
+ let i = o;
895
+ return e && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
896
+ href: n.href,
897
+ protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
898
+ host: n.host,
899
+ search: n.search ? n.search.replace(/^\?/, "") : "",
900
+ hash: n.hash ? n.hash.replace(/^#/, "") : "",
901
+ hostname: n.hostname,
902
+ port: n.port,
903
+ pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
904
+ };
905
+ }
906
+ return r = s(window.location.href), function(i) {
907
+ const a = c.isString(i) ? s(i) : i;
908
+ return a.protocol === r.protocol && a.host === r.host;
909
+ };
910
+ }()
911
+ ) : (
912
+ // Non standard browser envs (web workers, react-native) lack needed support.
913
+ function() {
914
+ return function() {
915
+ return !0;
916
+ };
917
+ }()
918
+ ), Fn = A.hasStandardBrowserEnv ? (
919
+ // Standard browser envs support document.cookie
920
+ {
921
+ write(t, e, n, r, s, o) {
922
+ const i = [t + "=" + encodeURIComponent(e)];
923
+ c.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), c.isString(r) && i.push("path=" + r), c.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
924
+ },
925
+ read(t) {
926
+ const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
927
+ return e ? decodeURIComponent(e[3]) : null;
928
+ },
929
+ remove(t) {
930
+ this.write(t, "", Date.now() - 864e5);
931
+ }
932
+ }
933
+ ) : (
934
+ // Non-standard browser env (web workers, react-native) lack needed support.
935
+ {
936
+ write() {
937
+ },
938
+ read() {
939
+ return null;
940
+ },
941
+ remove() {
942
+ }
943
+ }
944
+ );
945
+ function Mn(t) {
946
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
947
+ }
948
+ function Dn(t, e) {
949
+ return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
950
+ }
951
+ function ut(t, e) {
952
+ return t && !Mn(e) ? Dn(t, e) : e;
953
+ }
954
+ const ve = (t) => t instanceof I ? { ...t } : t;
955
+ function v(t, e) {
956
+ e = e || {};
957
+ const n = {};
958
+ function r(u, l, f) {
959
+ return c.isPlainObject(u) && c.isPlainObject(l) ? c.merge.call({ caseless: f }, u, l) : c.isPlainObject(l) ? c.merge({}, l) : c.isArray(l) ? l.slice() : l;
960
+ }
961
+ function s(u, l, f) {
962
+ if (c.isUndefined(l)) {
963
+ if (!c.isUndefined(u))
964
+ return r(void 0, u, f);
965
+ } else
966
+ return r(u, l, f);
967
+ }
968
+ function o(u, l) {
969
+ if (!c.isUndefined(l))
970
+ return r(void 0, l);
971
+ }
972
+ function i(u, l) {
973
+ if (c.isUndefined(l)) {
974
+ if (!c.isUndefined(u))
975
+ return r(void 0, u);
976
+ } else
977
+ return r(void 0, l);
978
+ }
979
+ function a(u, l, f) {
980
+ if (f in e)
981
+ return r(u, l);
982
+ if (f in t)
983
+ return r(void 0, u);
984
+ }
985
+ const d = {
986
+ url: o,
987
+ method: o,
988
+ data: o,
989
+ baseURL: i,
990
+ transformRequest: i,
991
+ transformResponse: i,
992
+ paramsSerializer: i,
993
+ timeout: i,
994
+ timeoutMessage: i,
995
+ withCredentials: i,
996
+ withXSRFToken: i,
997
+ adapter: i,
998
+ responseType: i,
999
+ xsrfCookieName: i,
1000
+ xsrfHeaderName: i,
1001
+ onUploadProgress: i,
1002
+ onDownloadProgress: i,
1003
+ decompress: i,
1004
+ maxContentLength: i,
1005
+ maxBodyLength: i,
1006
+ beforeRedirect: i,
1007
+ transport: i,
1008
+ httpAgent: i,
1009
+ httpsAgent: i,
1010
+ cancelToken: i,
1011
+ socketPath: i,
1012
+ responseEncoding: i,
1013
+ validateStatus: a,
1014
+ headers: (u, l) => s(ve(u), ve(l), !0)
1015
+ };
1016
+ return c.forEach(Object.keys(Object.assign({}, t, e)), function(l) {
1017
+ const f = d[l] || s, w = f(t[l], e[l], l);
1018
+ c.isUndefined(w) && f !== a || (n[l] = w);
1019
+ }), n;
1020
+ }
1021
+ const lt = (t) => {
1022
+ const e = v({}, t);
1023
+ let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = e;
1024
+ e.headers = i = I.from(i), e.url = st(ut(e.baseURL, e.url), t.params, t.paramsSerializer), a && i.set(
1025
+ "Authorization",
1026
+ "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1027
+ );
1028
+ let d;
1029
+ if (c.isFormData(n)) {
1030
+ if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
1031
+ i.setContentType(void 0);
1032
+ else if ((d = i.getContentType()) !== !1) {
1033
+ const [u, ...l] = d ? d.split(";").map((f) => f.trim()).filter(Boolean) : [];
1034
+ i.setContentType([u || "multipart/form-data", ...l].join("; "));
1035
+ }
1036
+ }
1037
+ if (A.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(e)), r || r !== !1 && Nn(e.url))) {
1038
+ const u = s && o && Fn.read(o);
1039
+ u && i.set(s, u);
1040
+ }
1041
+ return e;
1042
+ }, $n = typeof XMLHttpRequest < "u", jn = $n && function(t) {
1043
+ return new Promise(function(n, r) {
1044
+ const s = lt(t);
1045
+ let o = s.data;
1046
+ const i = I.from(s.headers).normalize();
1047
+ let { responseType: a, onUploadProgress: d, onDownloadProgress: u } = s, l, f, w, E, p;
1048
+ function y() {
1049
+ E && E(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1050
+ }
1051
+ let h = new XMLHttpRequest();
1052
+ h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1053
+ function b() {
1054
+ if (!h)
1055
+ return;
1056
+ const R = I.from(
1057
+ "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1058
+ ), O = {
1059
+ data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1060
+ status: h.status,
1061
+ statusText: h.statusText,
1062
+ headers: R,
1063
+ config: t,
1064
+ request: h
1065
+ };
1066
+ ct(function(_) {
1067
+ n(_), y();
1068
+ }, function(_) {
1069
+ r(_), y();
1070
+ }, O), h = null;
1071
+ }
1072
+ "onloadend" in h ? h.onloadend = b : h.onreadystatechange = function() {
1073
+ !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(b);
1074
+ }, h.onabort = function() {
1075
+ h && (r(new m("Request aborted", m.ECONNABORTED, t, h)), h = null);
1076
+ }, h.onerror = function() {
1077
+ r(new m("Network Error", m.ERR_NETWORK, t, h)), h = null;
1078
+ }, h.ontimeout = function() {
1079
+ let U = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1080
+ const O = s.transitional || ot;
1081
+ s.timeoutErrorMessage && (U = s.timeoutErrorMessage), r(new m(
1082
+ U,
1083
+ O.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
1084
+ t,
1085
+ h
1086
+ )), h = null;
1087
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && c.forEach(i.toJSON(), function(U, O) {
1088
+ h.setRequestHeader(O, U);
1089
+ }), c.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), u && ([w, p] = K(u, !0), h.addEventListener("progress", w)), d && h.upload && ([f, E] = K(d), h.upload.addEventListener("progress", f), h.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (l = (R) => {
1090
+ h && (r(!R || R.type ? new M(null, t, h) : R), h.abort(), h = null);
1091
+ }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1092
+ const S = _n(s.url);
1093
+ if (S && A.protocols.indexOf(S) === -1) {
1094
+ r(new m("Unsupported protocol " + S + ":", m.ERR_BAD_REQUEST, t));
1095
+ return;
1096
+ }
1097
+ h.send(o || null);
1098
+ });
1099
+ }, qn = (t, e) => {
1100
+ const { length: n } = t = t ? t.filter(Boolean) : [];
1101
+ if (e || n) {
1102
+ let r = new AbortController(), s;
1103
+ const o = function(u) {
1104
+ if (!s) {
1105
+ s = !0, a();
1106
+ const l = u instanceof Error ? u : this.reason;
1107
+ r.abort(l instanceof m ? l : new M(l instanceof Error ? l.message : l));
1108
+ }
1109
+ };
1110
+ let i = e && setTimeout(() => {
1111
+ i = null, o(new m(`timeout ${e} of ms exceeded`, m.ETIMEDOUT));
1112
+ }, e);
1113
+ const a = () => {
1114
+ t && (i && clearTimeout(i), i = null, t.forEach((u) => {
1115
+ u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
1116
+ }), t = null);
1117
+ };
1118
+ t.forEach((u) => u.addEventListener("abort", o));
1119
+ const { signal: d } = r;
1120
+ return d.unsubscribe = () => c.asap(a), d;
1121
+ }
1122
+ }, Hn = qn, zn = function* (t, e) {
1123
+ let n = t.byteLength;
1124
+ if (!e || n < e) {
1125
+ yield t;
1126
+ return;
1127
+ }
1128
+ let r = 0, s;
1129
+ for (; r < n; )
1130
+ s = r + e, yield t.slice(r, s), r = s;
1131
+ }, Jn = async function* (t, e) {
1132
+ for await (const n of Wn(t))
1133
+ yield* zn(n, e);
1134
+ }, Wn = async function* (t) {
1135
+ if (t[Symbol.asyncIterator]) {
1136
+ yield* t;
1137
+ return;
1138
+ }
1139
+ const e = t.getReader();
1140
+ try {
1141
+ for (; ; ) {
1142
+ const { done: n, value: r } = await e.read();
1143
+ if (n)
1144
+ break;
1145
+ yield r;
1146
+ }
1147
+ } finally {
1148
+ await e.cancel();
1149
+ }
1150
+ }, Ne = (t, e, n, r) => {
1151
+ const s = Jn(t, e);
1152
+ let o = 0, i, a = (d) => {
1153
+ i || (i = !0, r && r(d));
1154
+ };
1155
+ return new ReadableStream({
1156
+ async pull(d) {
1157
+ try {
1158
+ const { done: u, value: l } = await s.next();
1159
+ if (u) {
1160
+ a(), d.close();
1161
+ return;
1162
+ }
1163
+ let f = l.byteLength;
1164
+ if (n) {
1165
+ let w = o += f;
1166
+ n(w);
1167
+ }
1168
+ d.enqueue(new Uint8Array(l));
1169
+ } catch (u) {
1170
+ throw a(u), u;
1171
+ }
1172
+ },
1173
+ cancel(d) {
1174
+ return a(d), s.return();
1175
+ }
1176
+ }, {
1177
+ highWaterMark: 2
1178
+ });
1179
+ }, se = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", dt = se && typeof ReadableStream == "function", Gn = se && (typeof TextEncoder == "function" ? ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), ft = (t, ...e) => {
1180
+ try {
1181
+ return !!t(...e);
1182
+ } catch {
1183
+ return !1;
1184
+ }
1185
+ }, Vn = dt && ft(() => {
1186
+ let t = !1;
1187
+ const e = new Request(A.origin, {
1188
+ body: new ReadableStream(),
1189
+ method: "POST",
1190
+ get duplex() {
1191
+ return t = !0, "half";
1192
+ }
1193
+ }).headers.has("Content-Type");
1194
+ return t && !e;
1195
+ }), Fe = 64 * 1024, me = dt && ft(() => c.isReadableStream(new Response("").body)), X = {
1196
+ stream: me && ((t) => t.body)
1197
+ };
1198
+ se && ((t) => {
1199
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
1200
+ !X[e] && (X[e] = c.isFunction(t[e]) ? (n) => n[e]() : (n, r) => {
1201
+ throw new m(`Response type '${e}' is not supported`, m.ERR_NOT_SUPPORT, r);
1202
+ });
1203
+ });
1204
+ })(new Response());
1205
+ const Qn = async (t) => {
1206
+ if (t == null)
1207
+ return 0;
1208
+ if (c.isBlob(t))
1209
+ return t.size;
1210
+ if (c.isSpecCompliantForm(t))
1211
+ return (await new Request(A.origin, {
1212
+ method: "POST",
1213
+ body: t
1214
+ }).arrayBuffer()).byteLength;
1215
+ if (c.isArrayBufferView(t) || c.isArrayBuffer(t))
1216
+ return t.byteLength;
1217
+ if (c.isURLSearchParams(t) && (t = t + ""), c.isString(t))
1218
+ return (await Gn(t)).byteLength;
1219
+ }, Kn = async (t, e) => {
1220
+ const n = c.toFiniteNumber(t.getContentLength());
1221
+ return n ?? Qn(e);
1222
+ }, Xn = se && (async (t) => {
1223
+ let {
1224
+ url: e,
1225
+ method: n,
1226
+ data: r,
1227
+ signal: s,
1228
+ cancelToken: o,
1229
+ timeout: i,
1230
+ onDownloadProgress: a,
1231
+ onUploadProgress: d,
1232
+ responseType: u,
1233
+ headers: l,
1234
+ withCredentials: f = "same-origin",
1235
+ fetchOptions: w
1236
+ } = lt(t);
1237
+ u = u ? (u + "").toLowerCase() : "text";
1238
+ let E = Hn([s, o && o.toAbortSignal()], i), p;
1239
+ const y = E && E.unsubscribe && (() => {
1240
+ E.unsubscribe();
1241
+ });
1242
+ let h;
1243
+ try {
1244
+ if (d && Vn && n !== "get" && n !== "head" && (h = await Kn(l, r)) !== 0) {
1245
+ let O = new Request(e, {
1246
+ method: "POST",
1247
+ body: r,
1248
+ duplex: "half"
1249
+ }), k;
1250
+ if (c.isFormData(r) && (k = O.headers.get("content-type")) && l.setContentType(k), O.body) {
1251
+ const [_, H] = _e(
1252
+ h,
1253
+ K(Be(d))
1254
+ );
1255
+ r = Ne(O.body, Fe, _, H);
1256
+ }
1257
+ }
1258
+ c.isString(f) || (f = f ? "include" : "omit");
1259
+ const b = "credentials" in Request.prototype;
1260
+ p = new Request(e, {
1261
+ ...w,
1262
+ signal: E,
1263
+ method: n.toUpperCase(),
1264
+ headers: l.normalize().toJSON(),
1265
+ body: r,
1266
+ duplex: "half",
1267
+ credentials: b ? f : void 0
1268
+ });
1269
+ let S = await fetch(p);
1270
+ const R = me && (u === "stream" || u === "response");
1271
+ if (me && (a || R && y)) {
1272
+ const O = {};
1273
+ ["status", "statusText", "headers"].forEach((Ce) => {
1274
+ O[Ce] = S[Ce];
1275
+ });
1276
+ const k = c.toFiniteNumber(S.headers.get("content-length")), [_, H] = a && _e(
1277
+ k,
1278
+ K(Be(a), !0)
1279
+ ) || [];
1280
+ S = new Response(
1281
+ Ne(S.body, Fe, _, () => {
1282
+ H && H(), y && y();
1283
+ }),
1284
+ O
1285
+ );
1286
+ }
1287
+ u = u || "text";
1288
+ let U = await X[c.findKey(X, u) || "text"](S, t);
1289
+ return !R && y && y(), await new Promise((O, k) => {
1290
+ ct(O, k, {
1291
+ data: U,
1292
+ headers: I.from(S.headers),
1293
+ status: S.status,
1294
+ statusText: S.statusText,
1295
+ config: t,
1296
+ request: p
1297
+ });
1298
+ });
1299
+ } catch (b) {
1300
+ throw y && y(), b && b.name === "TypeError" && /fetch/i.test(b.message) ? Object.assign(
1301
+ new m("Network Error", m.ERR_NETWORK, t, p),
1302
+ {
1303
+ cause: b.cause || b
1304
+ }
1305
+ ) : m.from(b, b && b.code, t, p);
1306
+ }
1307
+ }), ye = {
1308
+ http: ln,
1309
+ xhr: jn,
1310
+ fetch: Xn
1311
+ };
1312
+ c.forEach(ye, (t, e) => {
1313
+ if (t) {
1314
+ try {
1315
+ Object.defineProperty(t, "name", { value: e });
1316
+ } catch {
1317
+ }
1318
+ Object.defineProperty(t, "adapterName", { value: e });
1319
+ }
1320
+ });
1321
+ const Me = (t) => `- ${t}`, Zn = (t) => c.isFunction(t) || t === null || t === !1, pt = {
1322
+ getAdapter: (t) => {
1323
+ t = c.isArray(t) ? t : [t];
1324
+ const { length: e } = t;
1325
+ let n, r;
1326
+ const s = {};
1327
+ for (let o = 0; o < e; o++) {
1328
+ n = t[o];
1329
+ let i;
1330
+ if (r = n, !Zn(n) && (r = ye[(i = String(n)).toLowerCase()], r === void 0))
1331
+ throw new m(`Unknown adapter '${i}'`);
1332
+ if (r)
1333
+ break;
1334
+ s[i || "#" + o] = r;
1335
+ }
1336
+ if (!r) {
1337
+ const o = Object.entries(s).map(
1338
+ ([a, d]) => `adapter ${a} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1339
+ );
1340
+ let i = e ? o.length > 1 ? `since :
1341
+ ` + o.map(Me).join(`
1342
+ `) : " " + Me(o[0]) : "as no adapter specified";
1343
+ throw new m(
1344
+ "There is no suitable adapter to dispatch the request " + i,
1345
+ "ERR_NOT_SUPPORT"
1346
+ );
1347
+ }
1348
+ return r;
1349
+ },
1350
+ adapters: ye
1351
+ };
1352
+ function ue(t) {
1353
+ if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
1354
+ throw new M(null, t);
1355
+ }
1356
+ function De(t) {
1357
+ return ue(t), t.headers = I.from(t.headers), t.data = ce.call(
1358
+ t,
1359
+ t.transformRequest
1360
+ ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), pt.getAdapter(t.adapter || Te.adapter)(t).then(function(r) {
1361
+ return ue(t), r.data = ce.call(
1362
+ t,
1363
+ t.transformResponse,
1364
+ r
1365
+ ), r.headers = I.from(r.headers), r;
1366
+ }, function(r) {
1367
+ return at(r) || (ue(t), r && r.response && (r.response.data = ce.call(
1368
+ t,
1369
+ t.transformResponse,
1370
+ r.response
1371
+ ), r.response.headers = I.from(r.response.headers))), Promise.reject(r);
1372
+ });
1373
+ }
1374
+ const ht = "1.7.7", Oe = {};
1375
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
1376
+ Oe[t] = function(r) {
1377
+ return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
1378
+ };
1379
+ });
1380
+ const $e = {};
1381
+ Oe.transitional = function(e, n, r) {
1382
+ function s(o, i) {
1383
+ return "[Axios v" + ht + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1384
+ }
1385
+ return (o, i, a) => {
1386
+ if (e === !1)
1387
+ throw new m(
1388
+ s(i, " has been removed" + (n ? " in " + n : "")),
1389
+ m.ERR_DEPRECATED
1390
+ );
1391
+ return n && !$e[i] && ($e[i] = !0, console.warn(
1392
+ s(
1393
+ i,
1394
+ " has been deprecated since v" + n + " and will be removed in the near future"
1395
+ )
1396
+ )), e ? e(o, i, a) : !0;
1397
+ };
1398
+ };
1399
+ function Yn(t, e, n) {
1400
+ if (typeof t != "object")
1401
+ throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
1402
+ const r = Object.keys(t);
1403
+ let s = r.length;
1404
+ for (; s-- > 0; ) {
1405
+ const o = r[s], i = e[o];
1406
+ if (i) {
1407
+ const a = t[o], d = a === void 0 || i(a, o, t);
1408
+ if (d !== !0)
1409
+ throw new m("option " + o + " must be " + d, m.ERR_BAD_OPTION_VALUE);
1410
+ continue;
1411
+ }
1412
+ if (n !== !0)
1413
+ throw new m("Unknown option " + o, m.ERR_BAD_OPTION);
1414
+ }
1415
+ }
1416
+ const we = {
1417
+ assertOptions: Yn,
1418
+ validators: Oe
1419
+ }, P = we.validators;
1420
+ let Z = class {
1421
+ constructor(e) {
1422
+ this.defaults = e, this.interceptors = {
1423
+ request: new Pe(),
1424
+ response: new Pe()
1425
+ };
1426
+ }
1427
+ /**
1428
+ * Dispatch a request
1429
+ *
1430
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1431
+ * @param {?Object} config
1432
+ *
1433
+ * @returns {Promise} The Promise to be fulfilled
1434
+ */
1435
+ async request(e, n) {
1436
+ try {
1437
+ return await this._request(e, n);
1438
+ } catch (r) {
1439
+ if (r instanceof Error) {
1440
+ let s;
1441
+ Error.captureStackTrace ? Error.captureStackTrace(s = {}) : s = new Error();
1442
+ const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1443
+ try {
1444
+ r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1445
+ ` + o) : r.stack = o;
1446
+ } catch {
1447
+ }
1448
+ }
1449
+ throw r;
1450
+ }
1451
+ }
1452
+ _request(e, n) {
1453
+ typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = v(this.defaults, n);
1454
+ const { transitional: r, paramsSerializer: s, headers: o } = n;
1455
+ r !== void 0 && we.assertOptions(r, {
1456
+ silentJSONParsing: P.transitional(P.boolean),
1457
+ forcedJSONParsing: P.transitional(P.boolean),
1458
+ clarifyTimeoutError: P.transitional(P.boolean)
1459
+ }, !1), s != null && (c.isFunction(s) ? n.paramsSerializer = {
1460
+ serialize: s
1461
+ } : we.assertOptions(s, {
1462
+ encode: P.function,
1463
+ serialize: P.function
1464
+ }, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1465
+ let i = o && c.merge(
1466
+ o.common,
1467
+ o[n.method]
1468
+ );
1469
+ o && c.forEach(
1470
+ ["delete", "get", "head", "post", "put", "patch", "common"],
1471
+ (p) => {
1472
+ delete o[p];
1473
+ }
1474
+ ), n.headers = I.concat(i, o);
1475
+ const a = [];
1476
+ let d = !0;
1477
+ this.interceptors.request.forEach(function(y) {
1478
+ typeof y.runWhen == "function" && y.runWhen(n) === !1 || (d = d && y.synchronous, a.unshift(y.fulfilled, y.rejected));
1479
+ });
1480
+ const u = [];
1481
+ this.interceptors.response.forEach(function(y) {
1482
+ u.push(y.fulfilled, y.rejected);
1483
+ });
1484
+ let l, f = 0, w;
1485
+ if (!d) {
1486
+ const p = [De.bind(this), void 0];
1487
+ for (p.unshift.apply(p, a), p.push.apply(p, u), w = p.length, l = Promise.resolve(n); f < w; )
1488
+ l = l.then(p[f++], p[f++]);
1489
+ return l;
1490
+ }
1491
+ w = a.length;
1492
+ let E = n;
1493
+ for (f = 0; f < w; ) {
1494
+ const p = a[f++], y = a[f++];
1495
+ try {
1496
+ E = p(E);
1497
+ } catch (h) {
1498
+ y.call(this, h);
1499
+ break;
1500
+ }
1501
+ }
1502
+ try {
1503
+ l = De.call(this, E);
1504
+ } catch (p) {
1505
+ return Promise.reject(p);
1506
+ }
1507
+ for (f = 0, w = u.length; f < w; )
1508
+ l = l.then(u[f++], u[f++]);
1509
+ return l;
1510
+ }
1511
+ getUri(e) {
1512
+ e = v(this.defaults, e);
1513
+ const n = ut(e.baseURL, e.url);
1514
+ return st(n, e.params, e.paramsSerializer);
1515
+ }
1516
+ };
1517
+ c.forEach(["delete", "get", "head", "options"], function(e) {
1518
+ Z.prototype[e] = function(n, r) {
1519
+ return this.request(v(r || {}, {
1520
+ method: e,
1521
+ url: n,
1522
+ data: (r || {}).data
1523
+ }));
1524
+ };
1525
+ });
1526
+ c.forEach(["post", "put", "patch"], function(e) {
1527
+ function n(r) {
1528
+ return function(o, i, a) {
1529
+ return this.request(v(a || {}, {
1530
+ method: e,
1531
+ headers: r ? {
1532
+ "Content-Type": "multipart/form-data"
1533
+ } : {},
1534
+ url: o,
1535
+ data: i
1536
+ }));
1537
+ };
1538
+ }
1539
+ Z.prototype[e] = n(), Z.prototype[e + "Form"] = n(!0);
1540
+ });
1541
+ const V = Z;
1542
+ let er = class mt {
1543
+ constructor(e) {
1544
+ if (typeof e != "function")
1545
+ throw new TypeError("executor must be a function.");
1546
+ let n;
1547
+ this.promise = new Promise(function(o) {
1548
+ n = o;
1549
+ });
1550
+ const r = this;
1551
+ this.promise.then((s) => {
1552
+ if (!r._listeners)
1553
+ return;
1554
+ let o = r._listeners.length;
1555
+ for (; o-- > 0; )
1556
+ r._listeners[o](s);
1557
+ r._listeners = null;
1558
+ }), this.promise.then = (s) => {
1559
+ let o;
1560
+ const i = new Promise((a) => {
1561
+ r.subscribe(a), o = a;
1562
+ }).then(s);
1563
+ return i.cancel = function() {
1564
+ r.unsubscribe(o);
1565
+ }, i;
1566
+ }, e(function(o, i, a) {
1567
+ r.reason || (r.reason = new M(o, i, a), n(r.reason));
1568
+ });
1569
+ }
1570
+ /**
1571
+ * Throws a `CanceledError` if cancellation has been requested.
1572
+ */
1573
+ throwIfRequested() {
1574
+ if (this.reason)
1575
+ throw this.reason;
1576
+ }
1577
+ /**
1578
+ * Subscribe to the cancel signal
1579
+ */
1580
+ subscribe(e) {
1581
+ if (this.reason) {
1582
+ e(this.reason);
1583
+ return;
1584
+ }
1585
+ this._listeners ? this._listeners.push(e) : this._listeners = [e];
1586
+ }
1587
+ /**
1588
+ * Unsubscribe from the cancel signal
1589
+ */
1590
+ unsubscribe(e) {
1591
+ if (!this._listeners)
1592
+ return;
1593
+ const n = this._listeners.indexOf(e);
1594
+ n !== -1 && this._listeners.splice(n, 1);
1595
+ }
1596
+ toAbortSignal() {
1597
+ const e = new AbortController(), n = (r) => {
1598
+ e.abort(r);
1599
+ };
1600
+ return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal;
1601
+ }
1602
+ /**
1603
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1604
+ * cancels the `CancelToken`.
1605
+ */
1606
+ static source() {
1607
+ let e;
1608
+ return {
1609
+ token: new mt(function(s) {
1610
+ e = s;
1611
+ }),
1612
+ cancel: e
1613
+ };
1614
+ }
1615
+ };
1616
+ const tr = er;
1617
+ function nr(t) {
1618
+ return function(n) {
1619
+ return t.apply(null, n);
1620
+ };
1621
+ }
1622
+ function rr(t) {
1623
+ return c.isObject(t) && t.isAxiosError === !0;
1624
+ }
1625
+ const be = {
1626
+ Continue: 100,
1627
+ SwitchingProtocols: 101,
1628
+ Processing: 102,
1629
+ EarlyHints: 103,
1630
+ Ok: 200,
1631
+ Created: 201,
1632
+ Accepted: 202,
1633
+ NonAuthoritativeInformation: 203,
1634
+ NoContent: 204,
1635
+ ResetContent: 205,
1636
+ PartialContent: 206,
1637
+ MultiStatus: 207,
1638
+ AlreadyReported: 208,
1639
+ ImUsed: 226,
1640
+ MultipleChoices: 300,
1641
+ MovedPermanently: 301,
1642
+ Found: 302,
1643
+ SeeOther: 303,
1644
+ NotModified: 304,
1645
+ UseProxy: 305,
1646
+ Unused: 306,
1647
+ TemporaryRedirect: 307,
1648
+ PermanentRedirect: 308,
1649
+ BadRequest: 400,
1650
+ Unauthorized: 401,
1651
+ PaymentRequired: 402,
1652
+ Forbidden: 403,
1653
+ NotFound: 404,
1654
+ MethodNotAllowed: 405,
1655
+ NotAcceptable: 406,
1656
+ ProxyAuthenticationRequired: 407,
1657
+ RequestTimeout: 408,
1658
+ Conflict: 409,
1659
+ Gone: 410,
1660
+ LengthRequired: 411,
1661
+ PreconditionFailed: 412,
1662
+ PayloadTooLarge: 413,
1663
+ UriTooLong: 414,
1664
+ UnsupportedMediaType: 415,
1665
+ RangeNotSatisfiable: 416,
1666
+ ExpectationFailed: 417,
1667
+ ImATeapot: 418,
1668
+ MisdirectedRequest: 421,
1669
+ UnprocessableEntity: 422,
1670
+ Locked: 423,
1671
+ FailedDependency: 424,
1672
+ TooEarly: 425,
1673
+ UpgradeRequired: 426,
1674
+ PreconditionRequired: 428,
1675
+ TooManyRequests: 429,
1676
+ RequestHeaderFieldsTooLarge: 431,
1677
+ UnavailableForLegalReasons: 451,
1678
+ InternalServerError: 500,
1679
+ NotImplemented: 501,
1680
+ BadGateway: 502,
1681
+ ServiceUnavailable: 503,
1682
+ GatewayTimeout: 504,
1683
+ HttpVersionNotSupported: 505,
1684
+ VariantAlsoNegotiates: 506,
1685
+ InsufficientStorage: 507,
1686
+ LoopDetected: 508,
1687
+ NotExtended: 510,
1688
+ NetworkAuthenticationRequired: 511
1689
+ };
1690
+ Object.entries(be).forEach(([t, e]) => {
1691
+ be[e] = t;
1692
+ });
1693
+ const sr = be;
1694
+ function yt(t) {
1695
+ const e = new V(t), n = We(V.prototype.request, e);
1696
+ return c.extend(n, V.prototype, e, { allOwnKeys: !0 }), c.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(s) {
1697
+ return yt(v(t, s));
1698
+ }, n;
1699
+ }
1700
+ const g = yt(Te);
1701
+ g.Axios = V;
1702
+ g.CanceledError = M;
1703
+ g.CancelToken = tr;
1704
+ g.isCancel = at;
1705
+ g.VERSION = ht;
1706
+ g.toFormData = ne;
1707
+ g.AxiosError = m;
1708
+ g.Cancel = g.CanceledError;
1709
+ g.all = function(e) {
1710
+ return Promise.all(e);
1711
+ };
1712
+ g.spread = nr;
1713
+ g.isAxiosError = rr;
1714
+ g.mergeConfig = v;
1715
+ g.AxiosHeaders = I;
1716
+ g.formToJSON = (t) => it(c.isHTMLForm(t) ? new FormData(t) : t);
1717
+ g.getAdapter = pt.getAdapter;
1718
+ g.HttpStatusCode = sr;
1719
+ g.default = g;
1720
+ const Ae = g, {
1721
+ Axios: Cr,
1722
+ AxiosError: wt,
1723
+ CanceledError: Ir,
1724
+ isCancel: xr,
1725
+ CancelToken: Ur,
1726
+ VERSION: kr,
1727
+ all: Pr,
1728
+ Cancel: Lr,
1729
+ isAxiosError: _r,
1730
+ spread: Br,
1731
+ toFormData: vr,
1732
+ AxiosHeaders: Nr,
1733
+ HttpStatusCode: Fr,
1734
+ formToJSON: Mr,
1735
+ getAdapter: Dr,
1736
+ mergeConfig: $r
1737
+ } = Ae;
1738
+ var N = globalThis && globalThis.__awaiter || function(t, e, n, r) {
1739
+ function s(o) {
1740
+ return o instanceof n ? o : new n(function(i) {
1741
+ i(o);
1742
+ });
1743
+ }
1744
+ return new (n || (n = Promise))(function(o, i) {
1745
+ function a(l) {
1746
+ try {
1747
+ u(r.next(l));
1748
+ } catch (f) {
1749
+ i(f);
1750
+ }
1751
+ }
1752
+ function d(l) {
1753
+ try {
1754
+ u(r.throw(l));
1755
+ } catch (f) {
1756
+ i(f);
1757
+ }
1758
+ }
1759
+ function u(l) {
1760
+ l.done ? o(l.value) : s(l.value).then(a, d);
1761
+ }
1762
+ u((r = r.apply(t, e || [])).next());
1763
+ });
1764
+ };
1765
+ const z = "feedme-one-tap", or = "feedme-login-iframe", le = "feedme-otp-iframe", ir = "fm-iframe-message-request", ar = "fm-iframe-message-response";
1766
+ class L {
1767
+ static get token() {
1768
+ if (!this.bgIframe)
1769
+ throw new Error("FeedMeAuth.token must be called after initialize()");
1770
+ return this.bgIframe.contentWindow.postMessage("fm-get-token", this.baseUrl + "/one-tap/background"), this._token;
1771
+ }
1772
+ static setBaseUrl(e) {
1773
+ typeof e == "string" ? this.baseUrl = e : this.baseUrl = `https://account.feedme${e ? "dev" : ""}.cc`;
1774
+ }
1775
+ static initialize({ clientId: e, setProfile: n = !0, profileAllowSkip: r = !0, oneTapMode: s = "popup", loginMode: o = "new_window", forceOtpLogin: i = !1 }) {
1776
+ if (!e)
1777
+ throw new Error("FeedMeAuth: clientId is required");
1778
+ this.feedMePosOptions = {
1779
+ clientId: e,
1780
+ setProfile: n,
1781
+ forceOtpLogin: i,
1782
+ profileAllowSkip: r,
1783
+ oneTapMode: s,
1784
+ loginMode: o
1785
+ }, this.startBackground();
1786
+ const a = document.createElement("style");
1787
+ a.innerHTML = `
1788
+ #feedme-one-tap.popup {
1789
+ width: 100%;
1790
+ max-width: 350px;
1791
+ height: 0;
1792
+ position: absolute;
1793
+ bottom: 20px;
1794
+ /* center align */
1795
+ left: 50%;
1796
+ transform: translateX(-50%);
1797
+ background-color: white;
1798
+ transition: opacity 0.3s;
1799
+ }
1800
+
1801
+ #feedme-otp-iframe.full-screen {
1802
+ width: 100vw;
1803
+ height: 100vh;
1804
+ left: 0;
1805
+ top: 0;
1806
+ position: fixed;
1807
+ background-color: white;
1808
+ transition: opacity 0.3s;
1809
+ }
1810
+
1811
+ #feedme-otp-iframe iframe {
1812
+ width: 100%;
1813
+ height: 100%;
1814
+ }
1815
+
1816
+ #feedme-one-tap.full-screen {
1817
+ width: 100vw;
1818
+ height: 100vh;
1819
+ left: 0;
1820
+ top: 0;
1821
+ position: fixed;
1822
+ background-color: white;
1823
+ transition: opacity 0.3s;
1824
+ }
1825
+
1826
+ #feedme-login-iframe {
1827
+ position: fixed;
1828
+ left: 0;
1829
+ right: 0;
1830
+ top: 0;
1831
+ bottom: 0;
1832
+ background: white;
1833
+ transition: opacity 0.3s;
1834
+ }
1835
+
1836
+ #feedme-login-iframe iframe {
1837
+ width: 100%;
1838
+ height: 100%;
1839
+ }
1840
+
1841
+ /* media query if pc or tablet */
1842
+ @media (min-width: 768px) {
1843
+ #feedme-one-tap.popup {
1844
+ top: 20px;
1845
+ right: 20px;
1846
+ left: auto;
1847
+ transform: none;
1848
+ }
1849
+ }
1850
+
1851
+ #feedme-one-tap iframe {
1852
+ width: 100%;
1853
+ height: 100%;
1854
+ border: none;
1855
+ border-radius: 10px;
1856
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
1857
+ }
1858
+ `, document.head.appendChild(a);
1859
+ }
1860
+ static signIn({ waitForInitialAuthState: e = !1, root: n } = {}) {
1861
+ return N(this, void 0, void 0, function* () {
1862
+ if (e && (yield this.initialAuthStatePromise) || (window.parent !== window && console.warn("FeedMeAuth: looks like you are inside an iframe now, please let the parent window to handle the login instead."), document.getElementById(z)))
1863
+ return;
1864
+ const r = this.feedMePosOptions.oneTapMode, { wrapper: s } = this.createIframe({
1865
+ root: n,
1866
+ url: this.getOneTapUrl(),
1867
+ id: z,
1868
+ classList: [r === "full_screen" ? "full-screen" : "popup"]
1869
+ }), o = (i) => {
1870
+ if (i.origin === this.baseUrl) {
1871
+ if (typeof i.data == "string")
1872
+ if (i.data === "fm-close-one-tap")
1873
+ this.unmountById(z), window.removeEventListener("message", o);
1874
+ else if (i.data.startsWith("fm-one-tap-height-") && this.feedMePosOptions.oneTapMode === "popup") {
1875
+ const a = i.data.replace("fm-one-tap-height-", "");
1876
+ s.style.height = a + "px";
1877
+ } else
1878
+ i.data === "fm-one-tap-open-login-iframe" && this.startLoginIframe();
1879
+ else if (i.data instanceof Error)
1880
+ throw s.style.display = "none", i.data;
1881
+ }
1882
+ };
1883
+ window.addEventListener("message", o);
1884
+ });
1885
+ }
1886
+ static setToken(e) {
1887
+ this._token = e;
1888
+ }
1889
+ static onAuthStateChanged(e) {
1890
+ const n = this.authStateChangeCallBackId++;
1891
+ return this.authStateChangeCallbacks[n] = e, () => {
1892
+ delete this.authStateChangeCallbacks[n];
1893
+ };
1894
+ }
1895
+ static signOut() {
1896
+ if (!this.bgIframe)
1897
+ throw new Error("FeedMeAuth.signOut() must be called after initialize()");
1898
+ return this.bgIframe.contentWindow.postMessage("fm-sign-out", this.baseUrl + "/one-tap/background"), new Promise((e, n) => {
1899
+ const r = this.onAuthStateChanged((o) => {
1900
+ o || (r(), e({ status: "success" }));
1901
+ });
1902
+ setTimeout(() => {
1903
+ r(), n({ status: "failed" });
1904
+ }, 3e3);
1905
+ });
1906
+ }
1907
+ static verifyOtp({ phone: e, tokenType: n = "idtoken" }) {
1908
+ return new Promise((r, s) => {
1909
+ this.createIframe({
1910
+ id: le,
1911
+ url: this.getOtpUrl(e, n),
1912
+ classList: ["full-screen"]
1913
+ });
1914
+ const o = (i) => {
1915
+ if (i.origin === this.baseUrl && typeof i.data == "string") {
1916
+ const a = "fm-idtoken-";
1917
+ if (i.data.startsWith(a)) {
1918
+ const d = i.data.replace(a, "");
1919
+ window.removeEventListener("message", o), this.unmountById(le), r(d);
1920
+ }
1921
+ i.data === "fm-close-otp" && (this.unmountById(le), window.removeEventListener("message", o), s(new Error("Verify Failed.")));
1922
+ }
1923
+ };
1924
+ window.addEventListener("message", o);
1925
+ });
1926
+ }
1927
+ static unmountById(e) {
1928
+ const n = document.getElementById(e);
1929
+ n && (n.style.opacity = "0", setTimeout(() => {
1930
+ n.remove();
1931
+ }, 300));
1932
+ }
1933
+ static getCustomToken() {
1934
+ return N(this, void 0, void 0, function* () {
1935
+ const e = yield fetch(this.baseUrl + "/api/token/custom", {
1936
+ method: "POST",
1937
+ headers: {
1938
+ Authorization: `Bearer ${this.token}`,
1939
+ "Content-Type": "application/json"
1940
+ },
1941
+ body: JSON.stringify({
1942
+ token: this.token
1943
+ })
1944
+ });
1945
+ if (!e.ok)
1946
+ throw new Error("Failed to get custom token");
1947
+ return yield e.text();
1948
+ });
1949
+ }
1950
+ static currentUser() {
1951
+ return N(this, void 0, void 0, function* () {
1952
+ if (!this.bgIframe)
1953
+ throw new Error("Can't call before initialize");
1954
+ return yield this.initialAuthStatePromise, yield this.callMethodOnIframe({
1955
+ iframe: this.bgIframe,
1956
+ methodName: "currentUser",
1957
+ timeout: 6e3
1958
+ });
1959
+ });
1960
+ }
1961
+ static signInWithCustomToken(e) {
1962
+ return N(this, void 0, void 0, function* () {
1963
+ if (!this.bgIframe)
1964
+ throw new Error("Can't call before initialize");
1965
+ return yield this.callMethodOnIframe({
1966
+ iframe: this.bgIframe,
1967
+ methodName: "signInWithCustomToken",
1968
+ params: [e],
1969
+ timeout: 6e3
1970
+ });
1971
+ });
1972
+ }
1973
+ static refreshToken() {
1974
+ return N(this, void 0, void 0, function* () {
1975
+ if (!this.bgIframe)
1976
+ throw new Error("FeedMeAuth.refreshToken must be called after initialize()");
1977
+ return new Promise((e, n) => {
1978
+ const r = (o) => {
1979
+ o.origin === this.baseUrl && o.data.type === "fm-token-refreshed" && (clearTimeout(s), window.removeEventListener("message", r), this.setToken(o.data.token), e(o.data.token));
1980
+ }, s = setTimeout(() => {
1981
+ window.removeEventListener("message", r), n(new Error("FeedMeAuth.refreshToken timed out"));
1982
+ }, 6e4);
1983
+ window.addEventListener("message", r), this.bgIframe.contentWindow.postMessage("fm-refresh-token", this.baseUrl + "/one-tap/background");
1984
+ });
1985
+ });
1986
+ }
1987
+ static getUserClaims() {
1988
+ return N(this, void 0, void 0, function* () {
1989
+ const e = yield fetch(this.baseUrl + "/api/user/claims", {
1990
+ method: "GET",
1991
+ headers: {
1992
+ Authorization: `Bearer ${this.token}`
1993
+ }
1994
+ });
1995
+ if (!e.ok)
1996
+ throw new Error("Failed to get user claims");
1997
+ return yield e.json();
1998
+ });
1999
+ }
2000
+ static startBackground() {
2001
+ if (!document)
2002
+ throw new Error("FeedMeAuth.prompt() must be called in the browser");
2003
+ const e = document.createElement("div");
2004
+ e.id = "feedme-auth-bg", this.bgIframe = document.createElement("iframe"), this.bgIframe.src = this.getBackgroundUrl(), e.appendChild(this.bgIframe), e.style.display = "none", document.body.appendChild(e), window.addEventListener("message", (n) => {
2005
+ if (n.origin === this.baseUrl && typeof n.data == "object") {
2006
+ const r = n.data;
2007
+ if (r.type === "fm-auth-state-changed") {
2008
+ if (r.user && !r.user.phoneNumber)
2009
+ return;
2010
+ this._token = r.token, Object.values(this.authStateChangeCallbacks).forEach((s) => s(r.user, r.token)), this._token && this.unmountById(z);
2011
+ }
2012
+ }
2013
+ }), this.initialAuthStatePromise = new Promise((n, r) => {
2014
+ const s = this.onAuthStateChanged((i) => {
2015
+ s(), n(!!i);
2016
+ });
2017
+ setTimeout(() => {
2018
+ s(), n(!1);
2019
+ }, 3e3);
2020
+ });
2021
+ }
2022
+ static startLoginIframe() {
2023
+ const { wrapper: e } = this.createIframe({
2024
+ id: or,
2025
+ url: this.getLoginUrl()
2026
+ }), n = (r) => {
2027
+ if (r.origin === this.baseUrl) {
2028
+ if (typeof r.data == "string")
2029
+ r.data === "fm-close-login-iframe" && (this.unmountById("feedme-login-iframe"), window.removeEventListener("message", n));
2030
+ else if (r.data instanceof Error)
2031
+ throw e.style.display = "none", r.data;
2032
+ }
2033
+ };
2034
+ window.addEventListener("message", n);
2035
+ }
2036
+ static createIframe({ root: e = document.body, url: n, id: r, classList: s = [] }) {
2037
+ const o = document.getElementById(r), i = document.querySelector("iframe");
2038
+ if (o && i)
2039
+ return {
2040
+ wrapper: o,
2041
+ iframe: i
2042
+ };
2043
+ const a = document.createElement("div");
2044
+ a.id = r, a.style.zIndex = String(this.getMaxZIndex() + 1), a.classList.add(...s), a.style.opacity = "0";
2045
+ const d = document.createElement("iframe");
2046
+ return d.src = n, a.appendChild(d), e.appendChild(a), d.addEventListener("load", () => {
2047
+ a.style.opacity = "1";
2048
+ }), {
2049
+ wrapper: a,
2050
+ iframe: d
2051
+ };
2052
+ }
2053
+ static getQueryParams() {
2054
+ const e = this.feedMePosOptions;
2055
+ return `client_id=${e.clientId}&set_profile=${e.setProfile}&profile_allow_skip=${e.profileAllowSkip}&login_mode=${e.loginMode}&force_otp_login=${e.forceOtpLogin}`;
2056
+ }
2057
+ static getBackgroundUrl() {
2058
+ return `${this.baseUrl}/one-tap/background?${this.getQueryParams()}`;
2059
+ }
2060
+ static getOneTapUrl() {
2061
+ const e = this.feedMePosOptions.oneTapMode === "full_screen";
2062
+ return `${this.baseUrl}/one-tap${e ? "/full" : ""}?${this.getQueryParams()}`;
2063
+ }
2064
+ static getLoginUrl() {
2065
+ return `${this.baseUrl}/login?${this.getQueryParams()}`;
2066
+ }
2067
+ static getOtpUrl(e, n) {
2068
+ return `${this.baseUrl}/otp?phone=${encodeURIComponent(e)}&tokentype=${encodeURIComponent(n)}`;
2069
+ }
2070
+ static getMaxZIndex() {
2071
+ const e = document.querySelectorAll("body *");
2072
+ let n = 1;
2073
+ for (let r = 0; r < e.length; r++) {
2074
+ const s = Number(getComputedStyle(e[r]).zIndex);
2075
+ s > n && (n = s);
2076
+ }
2077
+ return n;
2078
+ }
2079
+ static callMethodOnIframe({ iframe: e, methodName: n, params: r = [], timeout: s }) {
2080
+ if (!e)
2081
+ throw new Error("Target iframe not exist.");
2082
+ const o = String(Math.random());
2083
+ return e.contentWindow.postMessage({
2084
+ type: ir,
2085
+ messageId: o,
2086
+ methodName: n,
2087
+ params: r
2088
+ }, "*"), new Promise((i, a) => {
2089
+ const d = (l) => {
2090
+ var f, w;
2091
+ l.origin === this.baseUrl && l.data.type === ar && ((f = l.data) === null || f === void 0 ? void 0 : f.messageId) === o && (clearTimeout(u), window.removeEventListener("message", d), i((w = l.data) === null || w === void 0 ? void 0 : w.response));
2092
+ };
2093
+ window.addEventListener("message", d);
2094
+ let u;
2095
+ s && (u = setTimeout(() => {
2096
+ window.removeEventListener("message", d), a(new Error(`FeedMeAuth ${n} timed out`));
2097
+ }, s));
2098
+ });
2099
+ }
2100
+ }
2101
+ L.baseUrl = "https://account.feedmedev.cc";
2102
+ L.authStateChangeCallbacks = {};
2103
+ L.bgIframe = null;
2104
+ L._token = null;
2105
+ L.authStateChangeCallBackId = 1;
2106
+ window.FeedMeAuthGlobal = L;
2107
+ const cr = (t) => (e) => {
2108
+ var s;
2109
+ const n = ((s = j().sessionUser.value) == null ? void 0 : s.token) ?? L.token;
2110
+ if (!n)
2111
+ throw new Error("Invalid token");
2112
+ const r = Ae.create({
2113
+ baseURL: `${t}/${e}`,
2114
+ headers: {
2115
+ Authorization: `Bearer ${n}`
2116
+ }
2117
+ });
2118
+ return r.interceptors.response.use(
2119
+ (o) => o,
2120
+ async (o) => {
2121
+ var i;
2122
+ if (o instanceof wt) {
2123
+ const a = (i = o.response) == null ? void 0 : i.data, d = (a == null ? void 0 : a.message) || (a == null ? void 0 : a.error) || `${o.message}` || `${o}`;
2124
+ return Promise.reject(d);
2125
+ }
2126
+ return Promise.reject(o);
2127
+ }
2128
+ ), r;
2129
+ }, bt = (t = "", e = void 0) => {
2130
+ const { portalBackendUrl: n } = ur(e);
2131
+ return cr(n)(t);
2132
+ }, jr = () => {
2133
+ var e;
2134
+ const t = j();
2135
+ if (t.currentBusiness.value) {
2136
+ const n = `businesses/${(e = t.currentBusiness.value) == null ? void 0 : e.id}`;
2137
+ return bt(n);
2138
+ } else
2139
+ throw new Error("Invalid business");
2140
+ }, qr = (t, e) => {
2141
+ const n = `/restaurants/${t}`, r = e ? `/${e}${n}` : n;
2142
+ if (t)
2143
+ return bt(r);
2144
+ throw new Error("Invalid restaurant");
2145
+ };
2146
+ Q.F_COUNTRY.enum.SG, Q.F_COUNTRY.enum.ID;
2147
+ function ur(t = void 0) {
2148
+ const { namespace: e, currentCountry: n } = j(), r = t ?? n.value, s = e.value === "dev", o = (r == null ? void 0 : r.toLowerCase()) !== "my" ? `.${r == null ? void 0 : r.toLowerCase()}` : "", a = `https://portal-v2${`${s ? "-dev" : ""}${o}.feedmeapi.com`}`;
2149
+ return {
2150
+ portalBackendUrl: { remy: "https://remy-dev.feedmeapi.com/v1", customerApp: "https://feedmedev.cc", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", templateBuilderUrl: "https://print-template-builder.feedme.dev/", gtm: { id: "GTM-P7Z9FMS6", serverUrl: "https://server-side-tagging-rsrq3ogsuq-as.a.run.app", env: "development", serverMeasurementId: "G-759WBZPF06", debug: !0 }, firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, r2: null }.mainBackend ?? a,
2151
+ menuBackendUrl: { remy: "https://remy-dev.feedmeapi.com/v1", customerApp: "https://feedmedev.cc", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", templateBuilderUrl: "https://print-template-builder.feedme.dev/", gtm: { id: "GTM-P7Z9FMS6", serverUrl: "https://server-side-tagging-rsrq3ogsuq-as.a.run.app", env: "development", serverMeasurementId: "G-759WBZPF06", debug: !0 }, firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, r2: null }.menuBackend ?? a
2152
+ };
2153
+ }
2154
+ function Hr(t) {
2155
+ return t.data;
2156
+ }
2157
+ var T = [];
2158
+ for (var de = 0; de < 256; ++de)
2159
+ T.push((de + 256).toString(16).slice(1));
2160
+ function lr(t, e = 0) {
2161
+ return (T[t[e + 0]] + T[t[e + 1]] + T[t[e + 2]] + T[t[e + 3]] + "-" + T[t[e + 4]] + T[t[e + 5]] + "-" + T[t[e + 6]] + T[t[e + 7]] + "-" + T[t[e + 8]] + T[t[e + 9]] + "-" + T[t[e + 10]] + T[t[e + 11]] + T[t[e + 12]] + T[t[e + 13]] + T[t[e + 14]] + T[t[e + 15]]).toLowerCase();
2162
+ }
2163
+ var J, dr = new Uint8Array(16);
2164
+ function fr() {
2165
+ if (!J && (J = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !J))
2166
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2167
+ return J(dr);
2168
+ }
2169
+ var pr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2170
+ const je = {
2171
+ randomUUID: pr
2172
+ };
2173
+ function gt(t, e, n) {
2174
+ if (je.randomUUID && !e && !t)
2175
+ return je.randomUUID();
2176
+ t = t || {};
2177
+ var r = t.random || (t.rng || fr)();
2178
+ if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, e) {
2179
+ n = n || 0;
2180
+ for (var s = 0; s < 16; ++s)
2181
+ e[n + s] = r[s];
2182
+ return e;
2183
+ }
2184
+ return lr(r);
2185
+ }
2186
+ const hr = (t) => (e) => {
2187
+ var s;
2188
+ const n = ((s = j().sessionUser.value) == null ? void 0 : s.token) ?? L.token;
2189
+ if (!n)
2190
+ throw new Error("Invalid token");
2191
+ const r = Ae.create({
2192
+ baseURL: `${t}/${e}`,
2193
+ headers: {
2194
+ Authorization: `Bearer ${n}`
2195
+ }
2196
+ });
2197
+ return r.interceptors.response.use(
2198
+ (o) => o,
2199
+ async (o) => {
2200
+ var i;
2201
+ if (o instanceof wt) {
2202
+ const a = (i = o.response) == null ? void 0 : i.data, d = (a == null ? void 0 : a.message) || (a == null ? void 0 : a.error) || `${o.message}` || `${o}`;
2203
+ return Promise.reject(d);
2204
+ }
2205
+ return Promise.reject(o);
2206
+ }
2207
+ ), r;
2208
+ }, qe = (t = "") => {
2209
+ const { portalBackendUrl: e } = yr();
2210
+ return hr(e)(t);
2211
+ }, mr = [Q.F_COUNTRY.enum.SG, Q.F_COUNTRY.enum.ID];
2212
+ function He(t) {
2213
+ return t.data;
2214
+ }
2215
+ function yr() {
2216
+ var i;
2217
+ const { namespace: t, currentCountry: e } = j(), n = t.value === "dev", r = mr.includes(e.value) ? `.${(i = e.value) == null ? void 0 : i.toLowerCase()}` : "";
2218
+ return {
2219
+ portalBackendUrl: `https://portal-v2${`${n ? "-dev" : ""}${r}.feedmeapi.com`}`
2220
+ };
2221
+ }
2222
+ const ze = {
2223
+ async read() {
2224
+ return He(await qe().get("/public-setting"));
2225
+ },
2226
+ async update(t) {
2227
+ return He(await qe().put("/public-setting", t));
2228
+ }
2229
+ };
2230
+ function wr() {
2231
+ return {
2232
+ loadingQueue: [],
2233
+ publicSetting: {
2234
+ delivery: {
2235
+ feedMe: {
2236
+ areas: [],
2237
+ enable: !1,
2238
+ maxDistance: 0
2239
+ }
2240
+ },
2241
+ sms: {
2242
+ firebase: !1
2243
+ },
2244
+ assets: {
2245
+ groups: []
2246
+ },
2247
+ aiSettings: {
2248
+ remy: { enable: !1 }
2249
+ }
2250
+ }
2251
+ };
2252
+ }
2253
+ const Je = Tt("portal-app-store", {
2254
+ state: () => wr(),
2255
+ actions: {
2256
+ addLoadingQueues(t) {
2257
+ this.loadingQueue = [...this.loadingQueue, ...t];
2258
+ },
2259
+ clearLoadingQueue() {
2260
+ this.loadingQueue = [];
2261
+ },
2262
+ resolveQueues(t) {
2263
+ this.loadingQueue = this.loadingQueue.filter((e) => !t.includes(e.id));
2264
+ },
2265
+ async promise(t, e = !0) {
2266
+ const n = gt();
2267
+ try {
2268
+ const r = [{ id: n, isGlobal: e }];
2269
+ return this.addLoadingQueues(r), await t();
2270
+ } finally {
2271
+ this.resolveQueues([n]);
2272
+ }
2273
+ },
2274
+ async getPublicSetting() {
2275
+ return this.publicSetting = await ze.read(), this.publicSetting;
2276
+ },
2277
+ async updatePublicSetting(t) {
2278
+ return this.publicSetting = await ze.update({
2279
+ ...this.publicSetting,
2280
+ ...t
2281
+ }), this.publicSetting;
2282
+ }
2283
+ }
2284
+ }), br = (t) => {
2285
+ async function e(r, s) {
2286
+ var a, d;
2287
+ let o = [];
2288
+ !s || !s.customId ? o.push(`${(/* @__PURE__ */ new Date()).toISOString()}_${gt().split("-")[0]}`) : typeof s.customId == "string" ? o.push(s.customId) : o = s.customId;
2289
+ const i = Je();
2290
+ i.addLoadingQueues(
2291
+ o.map((u) => ({
2292
+ id: u,
2293
+ isGlobal: (s == null ? void 0 : s.isGlobal) || !1
2294
+ }))
2295
+ );
2296
+ try {
2297
+ const u = await r();
2298
+ return await ((a = s == null ? void 0 : s.onSuccess) == null ? void 0 : a.call(s, u)), u;
2299
+ } catch (u) {
2300
+ const l = u instanceof Error ? u.message : `${u}`;
2301
+ throw s != null && s.onError ? await s.onError(l) : t.open({
2302
+ type: "error",
2303
+ message: l
2304
+ }), u;
2305
+ } finally {
2306
+ i.resolveQueues(o), (d = s == null ? void 0 : s.onComplete) == null || d.call(s);
2307
+ }
2308
+ }
2309
+ const n = Je();
2310
+ return {
2311
+ queue: Et(() => n.loadingQueue),
2312
+ checkIsLoading: (r) => n.loadingQueue.some((s) => s.id === r),
2313
+ global: async (r, s) => await e(r, {
2314
+ isGlobal: !0,
2315
+ onSuccess: async (o) => {
2316
+ var i;
2317
+ await ((i = s == null ? void 0 : s.onSuccess) == null ? void 0 : i.call(s, o)), s != null && s.successMessage && t.open({
2318
+ type: "success",
2319
+ message: s.successMessage,
2320
+ position: oe.BOTTOM
2321
+ });
2322
+ }
2323
+ }),
2324
+ minor: async (r, s) => {
2325
+ const o = t.open({
2326
+ type: "info",
2327
+ message: "Loading",
2328
+ spinner: !0,
2329
+ persistent: !0
2330
+ }), i = (a, d) => {
2331
+ if (!d)
2332
+ return;
2333
+ const u = (l) => {
2334
+ t.updateSnackbar(o, { [a]: l });
2335
+ };
2336
+ St(d) ? (u(d.value), Rt(d, (l) => u(l))) : u(d);
2337
+ };
2338
+ return i("title", s == null ? void 0 : s.message), i("message", s == null ? void 0 : s.caption), await e(
2339
+ async () => (s != null && s.isLoading && (s.isLoading.value = !0), await r()),
2340
+ {
2341
+ onSuccess: () => {
2342
+ const a = (s == null ? void 0 : s.successMessage) || "Completed";
2343
+ t.close(o), t.open({
2344
+ type: "success",
2345
+ title: a,
2346
+ position: oe.BOTTOM
2347
+ });
2348
+ },
2349
+ onError: (a) => {
2350
+ const d = `${a}` || "Error";
2351
+ t.close(o), t.open({
2352
+ type: "error",
2353
+ title: d,
2354
+ position: oe.BOTTOM
2355
+ });
2356
+ },
2357
+ onComplete: () => {
2358
+ s != null && s.isLoading && (s.isLoading.value = !1);
2359
+ },
2360
+ customId: s == null ? void 0 : s.customId
2361
+ }
2362
+ );
2363
+ },
2364
+ custom: async (r, s) => await e(
2365
+ async () => (s != null && s.isLoading && (s.isLoading.value = !0), await r()),
2366
+ {
2367
+ onSuccess: async () => {
2368
+ s != null && s.successMessage && t.open({ message: s.successMessage });
2369
+ },
2370
+ onComplete: () => {
2371
+ s && s.isLoading && (s.isLoading.value = !1);
2372
+ },
2373
+ customId: s == null ? void 0 : s.customId
2374
+ }
2375
+ )
2376
+ };
2377
+ }, zr = br;
2378
+ export {
2379
+ L as F,
2380
+ jr as a,
2381
+ bt as b,
2382
+ Hr as g,
2383
+ qr as r,
2384
+ zr as u
2385
+ };