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