@feedmepos/mf-payment 1.1.13 → 1.1.14-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 (55) hide show
  1. package/dist/{PayoutAccount-lT5iiQa-.js → PayoutAccount-BhC9GdVa.js} +7 -6
  2. package/dist/{PayoutAccount-DH1z58gO.js → PayoutAccount-BjcP1n1D.js} +8 -7
  3. package/dist/{PayoutAccountSetting-BuUync07.js → PayoutAccountSetting-61UI9TTU.js} +3 -3
  4. package/dist/{Restaurant-31NaCvCd.js → Restaurant-BEjGTeZK.js} +4 -4
  5. package/dist/{RestaurantSetting-ByCb54gA.js → RestaurantSetting-CH5KXJd-.js} +3 -3
  6. package/dist/{Settlement-MPJE29Ry.js → Settlement-CpWtqcbV.js} +3 -3
  7. package/dist/{Settlement-DUHtGLUl.js → Settlement-Ekk7fPLv.js} +3 -3
  8. package/dist/{SettlementTransactions-BIs9YpoK.js → SettlementTransactions-CytrIXUM.js} +3 -3
  9. package/dist/{SettlementTransactions-BAMliC1r.js → SettlementTransactions-DddCRhIs.js} +3 -3
  10. package/dist/{Terminal-DID1yck1.js → Terminal-5BRplzny.js} +6 -6
  11. package/dist/TerminalSetting-D8nuI1Gv.js +587 -0
  12. package/dist/{Transaction-VhRzUzbg.js → Transaction-Bnm30wxt.js} +9 -8
  13. package/dist/{Transaction-Bfr51t2I.js → Transaction-D2qgyVJA.js} +5 -5
  14. package/dist/{TransactionOld-DP6geerP.js → TransactionOld-DL9vMDXr.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-DMYLTNO7.js → TransactionTable.vue_vue_type_script_setup_true_lang-PXvQ-nrK.js} +3 -3
  16. package/dist/{app-dky8a2sP.js → app--PNGHtZ3.js} +338 -338
  17. package/dist/app.js +1 -1
  18. package/dist/{assets-CGSnvwg_.js → assets-BAvqcM2y.js} +30 -28
  19. package/dist/{grafana-DpTNZERD.js → grafana-XJlaGQ8C.js} +7 -10
  20. package/dist/{index-yCRcX8ql.js → index-B4xE-ETp.js} +12862 -12264
  21. package/dist/{index-O5yk1zsL.js → index-DXzezAJQ.js} +4 -3
  22. package/dist/{index-B_tCR11q.js → index-DsT_D8r0.js} +1 -1
  23. package/dist/index-DtHh0OLe.js +162 -0
  24. package/dist/{index-KziNLTAM.js → index-SqBpMlb0.js} +1 -1
  25. package/dist/{index-l4KSc_D9.js → index-pPbE76Vg.js} +1 -1
  26. package/dist/{index-CcFjStnT.js → index-s6srEUqZ.js} +1 -1
  27. package/dist/{index.vue_vue_type_script_setup_true_lang-JJ6R-Wfm.js → index.vue_vue_type_script_setup_true_lang-aFl1Lbk1.js} +1 -1
  28. package/dist/model/transaction.d.ts +1 -2
  29. package/dist/package.json +2 -2
  30. package/dist/payout-account-TSBuddbd.js +1953 -0
  31. package/dist/stores/payoutAccount.d.ts +4 -4
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  34. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +16 -16
  35. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +16 -16
  36. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  37. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  38. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  39. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  40. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +6 -6
  41. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  42. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +22 -28
  43. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +22 -28
  44. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +22 -28
  45. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +22 -28
  46. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +22 -28
  47. package/dist/views/admin/terminal/tabs/SoftspaceGateway.vue.d.ts +90 -0
  48. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +22 -28
  49. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +22 -28
  50. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  51. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +40 -40
  52. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +20 -20
  53. package/package.json +2 -2
  54. package/dist/TerminalSetting-B9w9AaTE.js +0 -497
  55. package/dist/payout-account-BVO1uUOe.js +0 -1819
@@ -1,1819 +0,0 @@
1
- import { _ as Je, C as Qe, r as Ee, S as et, g as re, a as tt, b as nt, c as _e, F as rt, d as st, e as it } from "./app-dky8a2sP.js";
2
- import { c as ot, a as at, B as ut, _ as Y } from "./index-yCRcX8ql.js";
3
- import { useCoreStore as ct } from "@feedmepos/mf-common";
4
- /**
5
- * @license
6
- * Copyright 2017 Google LLC
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
20
- const xe = "firebasestorage.googleapis.com", Ce = "storageBucket", lt = 2 * 60 * 1e3, ht = 10 * 60 * 1e3;
21
- /**
22
- * @license
23
- * Copyright 2017 Google LLC
24
- *
25
- * Licensed under the Apache License, Version 2.0 (the "License");
26
- * you may not use this file except in compliance with the License.
27
- * You may obtain a copy of the License at
28
- *
29
- * http://www.apache.org/licenses/LICENSE-2.0
30
- *
31
- * Unless required by applicable law or agreed to in writing, software
32
- * distributed under the License is distributed on an "AS IS" BASIS,
33
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
- * See the License for the specific language governing permissions and
35
- * limitations under the License.
36
- */
37
- class R extends rt {
38
- /**
39
- * @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
40
- * added to the end of the message.
41
- * @param message - Error message.
42
- * @param status_ - Corresponding HTTP Status Code
43
- */
44
- constructor(t, n, r = 0) {
45
- super(de(t), `Firebase Storage: ${n} (${de(t)})`), this.status_ = r, this.customData = { serverResponse: null }, this._baseMessage = this.message, Object.setPrototypeOf(this, R.prototype);
46
- }
47
- get status() {
48
- return this.status_;
49
- }
50
- set status(t) {
51
- this.status_ = t;
52
- }
53
- /**
54
- * Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
55
- */
56
- _codeEquals(t) {
57
- return de(t) === this.code;
58
- }
59
- /**
60
- * Optional response message that was added by the server.
61
- */
62
- get serverResponse() {
63
- return this.customData.serverResponse;
64
- }
65
- set serverResponse(t) {
66
- this.customData.serverResponse = t, this.customData.serverResponse ? this.message = `${this._baseMessage}
67
- ${this.customData.serverResponse}` : this.message = this._baseMessage;
68
- }
69
- }
70
- var y;
71
- (function(e) {
72
- e.UNKNOWN = "unknown", e.OBJECT_NOT_FOUND = "object-not-found", e.BUCKET_NOT_FOUND = "bucket-not-found", e.PROJECT_NOT_FOUND = "project-not-found", e.QUOTA_EXCEEDED = "quota-exceeded", e.UNAUTHENTICATED = "unauthenticated", e.UNAUTHORIZED = "unauthorized", e.UNAUTHORIZED_APP = "unauthorized-app", e.RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded", e.INVALID_CHECKSUM = "invalid-checksum", e.CANCELED = "canceled", e.INVALID_EVENT_NAME = "invalid-event-name", e.INVALID_URL = "invalid-url", e.INVALID_DEFAULT_BUCKET = "invalid-default-bucket", e.NO_DEFAULT_BUCKET = "no-default-bucket", e.CANNOT_SLICE_BLOB = "cannot-slice-blob", e.SERVER_FILE_WRONG_SIZE = "server-file-wrong-size", e.NO_DOWNLOAD_URL = "no-download-url", e.INVALID_ARGUMENT = "invalid-argument", e.INVALID_ARGUMENT_COUNT = "invalid-argument-count", e.APP_DELETED = "app-deleted", e.INVALID_ROOT_OPERATION = "invalid-root-operation", e.INVALID_FORMAT = "invalid-format", e.INTERNAL_ERROR = "internal-error", e.UNSUPPORTED_ENVIRONMENT = "unsupported-environment";
73
- })(y || (y = {}));
74
- function de(e) {
75
- return "storage/" + e;
76
- }
77
- function be() {
78
- const e = "An unknown error occurred, please check the error payload for server response.";
79
- return new R(y.UNKNOWN, e);
80
- }
81
- function dt(e) {
82
- return new R(y.OBJECT_NOT_FOUND, "Object '" + e + "' does not exist.");
83
- }
84
- function ft(e) {
85
- return new R(y.QUOTA_EXCEEDED, "Quota for bucket '" + e + "' exceeded, please view quota on https://firebase.google.com/pricing/.");
86
- }
87
- function pt() {
88
- const e = "User is not authenticated, please authenticate using Firebase Authentication and try again.";
89
- return new R(y.UNAUTHENTICATED, e);
90
- }
91
- function _t() {
92
- return new R(y.UNAUTHORIZED_APP, "This app does not have permission to access Firebase Storage on this project.");
93
- }
94
- function mt(e) {
95
- return new R(y.UNAUTHORIZED, "User does not have permission to access '" + e + "'.");
96
- }
97
- function gt() {
98
- return new R(y.RETRY_LIMIT_EXCEEDED, "Max retry time for operation exceeded, please try again.");
99
- }
100
- function bt() {
101
- return new R(y.CANCELED, "User canceled the upload/download.");
102
- }
103
- function wt(e) {
104
- return new R(y.INVALID_URL, "Invalid URL '" + e + "'.");
105
- }
106
- function Tt(e) {
107
- return new R(y.INVALID_DEFAULT_BUCKET, "Invalid default bucket '" + e + "'.");
108
- }
109
- function yt() {
110
- return new R(y.NO_DEFAULT_BUCKET, "No default bucket found. Did you set the '" + Ce + "' property when initializing the app?");
111
- }
112
- function Rt() {
113
- return new R(y.CANNOT_SLICE_BLOB, "Cannot slice blob for upload. Please retry the upload.");
114
- }
115
- function kt() {
116
- return new R(y.NO_DOWNLOAD_URL, "The given file does not have any download URLs.");
117
- }
118
- function Ot(e) {
119
- return new R(y.UNSUPPORTED_ENVIRONMENT, `${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);
120
- }
121
- function me(e) {
122
- return new R(y.INVALID_ARGUMENT, e);
123
- }
124
- function Me() {
125
- return new R(y.APP_DELETED, "The Firebase app was deleted.");
126
- }
127
- function Et(e) {
128
- return new R(y.INVALID_ROOT_OPERATION, "The operation '" + e + "' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').");
129
- }
130
- function te(e, t) {
131
- return new R(y.INVALID_FORMAT, "String does not match format '" + e + "': " + t);
132
- }
133
- function ee(e) {
134
- throw new R(y.INTERNAL_ERROR, "Internal error: " + e);
135
- }
136
- /**
137
- * @license
138
- * Copyright 2017 Google LLC
139
- *
140
- * Licensed under the Apache License, Version 2.0 (the "License");
141
- * you may not use this file except in compliance with the License.
142
- * You may obtain a copy of the License at
143
- *
144
- * http://www.apache.org/licenses/LICENSE-2.0
145
- *
146
- * Unless required by applicable law or agreed to in writing, software
147
- * distributed under the License is distributed on an "AS IS" BASIS,
148
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
- * See the License for the specific language governing permissions and
150
- * limitations under the License.
151
- */
152
- class x {
153
- constructor(t, n) {
154
- this.bucket = t, this.path_ = n;
155
- }
156
- get path() {
157
- return this.path_;
158
- }
159
- get isRoot() {
160
- return this.path.length === 0;
161
- }
162
- fullServerUrl() {
163
- const t = encodeURIComponent;
164
- return "/b/" + t(this.bucket) + "/o/" + t(this.path);
165
- }
166
- bucketOnlyServerUrl() {
167
- return "/b/" + encodeURIComponent(this.bucket) + "/o";
168
- }
169
- static makeFromBucketSpec(t, n) {
170
- let r;
171
- try {
172
- r = x.makeFromUrl(t, n);
173
- } catch {
174
- return new x(t, "");
175
- }
176
- if (r.path === "")
177
- return r;
178
- throw Tt(t);
179
- }
180
- static makeFromUrl(t, n) {
181
- let r = null;
182
- const s = "([A-Za-z0-9.\\-_]+)";
183
- function i($) {
184
- $.path.charAt($.path.length - 1) === "/" && ($.path_ = $.path_.slice(0, -1));
185
- }
186
- const o = "(/(.*))?$", h = new RegExp("^gs://" + s + o, "i"), d = { bucket: 1, path: 3 };
187
- function m($) {
188
- $.path_ = decodeURIComponent($.path);
189
- }
190
- const T = "v[A-Za-z0-9_]+", b = n.replace(/[.]/g, "\\."), O = "(/([^?#]*).*)?$", E = new RegExp(`^https?://${b}/${T}/b/${s}/o${O}`, "i"), A = { bucket: 1, path: 3 }, F = n === xe ? "(?:storage.googleapis.com|storage.cloud.google.com)" : n, U = "([^?#]*)", H = new RegExp(`^https?://${F}/${s}/${U}`, "i"), P = [
191
- { regex: h, indices: d, postModify: i },
192
- {
193
- regex: E,
194
- indices: A,
195
- postModify: m
196
- },
197
- {
198
- regex: H,
199
- indices: { bucket: 1, path: 2 },
200
- postModify: m
201
- }
202
- ];
203
- for (let $ = 0; $ < P.length; $++) {
204
- const L = P[$], M = L.regex.exec(t);
205
- if (M) {
206
- const se = M[L.indices.bucket];
207
- let q = M[L.indices.path];
208
- q || (q = ""), r = new x(se, q), L.postModify(r);
209
- break;
210
- }
211
- }
212
- if (r == null)
213
- throw wt(t);
214
- return r;
215
- }
216
- }
217
- class St {
218
- constructor(t) {
219
- this.promise_ = Promise.reject(t);
220
- }
221
- /** @inheritDoc */
222
- getPromise() {
223
- return this.promise_;
224
- }
225
- /** @inheritDoc */
226
- cancel(t = !1) {
227
- }
228
- }
229
- /**
230
- * @license
231
- * Copyright 2017 Google LLC
232
- *
233
- * Licensed under the Apache License, Version 2.0 (the "License");
234
- * you may not use this file except in compliance with the License.
235
- * You may obtain a copy of the License at
236
- *
237
- * http://www.apache.org/licenses/LICENSE-2.0
238
- *
239
- * Unless required by applicable law or agreed to in writing, software
240
- * distributed under the License is distributed on an "AS IS" BASIS,
241
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
242
- * See the License for the specific language governing permissions and
243
- * limitations under the License.
244
- */
245
- function vt(e, t, n) {
246
- let r = 1, s = null, i = null, o = !1, h = 0;
247
- function d() {
248
- return h === 2;
249
- }
250
- let m = !1;
251
- function T(...U) {
252
- m || (m = !0, t.apply(null, U));
253
- }
254
- function b(U) {
255
- s = setTimeout(() => {
256
- s = null, e(E, d());
257
- }, U);
258
- }
259
- function O() {
260
- i && clearTimeout(i);
261
- }
262
- function E(U, ...H) {
263
- if (m) {
264
- O();
265
- return;
266
- }
267
- if (U) {
268
- O(), T.call(null, U, ...H);
269
- return;
270
- }
271
- if (d() || o) {
272
- O(), T.call(null, U, ...H);
273
- return;
274
- }
275
- r < 64 && (r *= 2);
276
- let P;
277
- h === 1 ? (h = 2, P = 0) : P = (r + Math.random()) * 1e3, b(P);
278
- }
279
- let A = !1;
280
- function F(U) {
281
- A || (A = !0, O(), !m && (s !== null ? (U || (h = 2), clearTimeout(s), b(0)) : U || (h = 1)));
282
- }
283
- return b(0), i = setTimeout(() => {
284
- o = !0, F(!0);
285
- }, n), F;
286
- }
287
- function At(e) {
288
- e(!1);
289
- }
290
- /**
291
- * @license
292
- * Copyright 2017 Google LLC
293
- *
294
- * Licensed under the Apache License, Version 2.0 (the "License");
295
- * you may not use this file except in compliance with the License.
296
- * You may obtain a copy of the License at
297
- *
298
- * http://www.apache.org/licenses/LICENSE-2.0
299
- *
300
- * Unless required by applicable law or agreed to in writing, software
301
- * distributed under the License is distributed on an "AS IS" BASIS,
302
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
303
- * See the License for the specific language governing permissions and
304
- * limitations under the License.
305
- */
306
- function Ut(e) {
307
- return e !== void 0;
308
- }
309
- function $t(e) {
310
- return typeof e == "object" && !Array.isArray(e);
311
- }
312
- function we(e) {
313
- return typeof e == "string" || e instanceof String;
314
- }
315
- function Se(e) {
316
- return Te() && e instanceof Blob;
317
- }
318
- function Te() {
319
- return typeof Blob < "u";
320
- }
321
- function ve(e, t, n, r) {
322
- if (r < t)
323
- throw me(`Invalid value for '${e}'. Expected ${t} or greater.`);
324
- if (r > n)
325
- throw me(`Invalid value for '${e}'. Expected ${n} or less.`);
326
- }
327
- /**
328
- * @license
329
- * Copyright 2017 Google LLC
330
- *
331
- * Licensed under the Apache License, Version 2.0 (the "License");
332
- * you may not use this file except in compliance with the License.
333
- * You may obtain a copy of the License at
334
- *
335
- * http://www.apache.org/licenses/LICENSE-2.0
336
- *
337
- * Unless required by applicable law or agreed to in writing, software
338
- * distributed under the License is distributed on an "AS IS" BASIS,
339
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340
- * See the License for the specific language governing permissions and
341
- * limitations under the License.
342
- */
343
- function he(e, t, n) {
344
- let r = t;
345
- return n == null && (r = `https://${t}`), `${n}://${r}/v0${e}`;
346
- }
347
- function Le(e) {
348
- const t = encodeURIComponent;
349
- let n = "?";
350
- for (const r in e)
351
- if (e.hasOwnProperty(r)) {
352
- const s = t(r) + "=" + t(e[r]);
353
- n = n + s + "&";
354
- }
355
- return n = n.slice(0, -1), n;
356
- }
357
- var G;
358
- (function(e) {
359
- e[e.NO_ERROR = 0] = "NO_ERROR", e[e.NETWORK_ERROR = 1] = "NETWORK_ERROR", e[e.ABORT = 2] = "ABORT";
360
- })(G || (G = {}));
361
- /**
362
- * @license
363
- * Copyright 2022 Google LLC
364
- *
365
- * Licensed under the Apache License, Version 2.0 (the "License");
366
- * you may not use this file except in compliance with the License.
367
- * You may obtain a copy of the License at
368
- *
369
- * http://www.apache.org/licenses/LICENSE-2.0
370
- *
371
- * Unless required by applicable law or agreed to in writing, software
372
- * distributed under the License is distributed on an "AS IS" BASIS,
373
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
374
- * See the License for the specific language governing permissions and
375
- * limitations under the License.
376
- */
377
- function Nt(e, t) {
378
- const n = e >= 500 && e < 600, s = [
379
- // Request Timeout: web server didn't receive full request in time.
380
- 408,
381
- // Too Many Requests: you're getting rate-limited, basically.
382
- 429
383
- ].indexOf(e) !== -1, i = t.indexOf(e) !== -1;
384
- return n || s || i;
385
- }
386
- /**
387
- * @license
388
- * Copyright 2017 Google LLC
389
- *
390
- * Licensed under the Apache License, Version 2.0 (the "License");
391
- * you may not use this file except in compliance with the License.
392
- * You may obtain a copy of the License at
393
- *
394
- * http://www.apache.org/licenses/LICENSE-2.0
395
- *
396
- * Unless required by applicable law or agreed to in writing, software
397
- * distributed under the License is distributed on an "AS IS" BASIS,
398
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
399
- * See the License for the specific language governing permissions and
400
- * limitations under the License.
401
- */
402
- class It {
403
- constructor(t, n, r, s, i, o, h, d, m, T, b, O = !0) {
404
- this.url_ = t, this.method_ = n, this.headers_ = r, this.body_ = s, this.successCodes_ = i, this.additionalRetryCodes_ = o, this.callback_ = h, this.errorCallback_ = d, this.timeout_ = m, this.progressCallback_ = T, this.connectionFactory_ = b, this.retry = O, this.pendingConnection_ = null, this.backoffId_ = null, this.canceled_ = !1, this.appDelete_ = !1, this.promise_ = new Promise((E, A) => {
405
- this.resolve_ = E, this.reject_ = A, this.start_();
406
- });
407
- }
408
- /**
409
- * Actually starts the retry loop.
410
- */
411
- start_() {
412
- const t = (r, s) => {
413
- if (s) {
414
- r(!1, new ue(!1, null, !0));
415
- return;
416
- }
417
- const i = this.connectionFactory_();
418
- this.pendingConnection_ = i;
419
- const o = (h) => {
420
- const d = h.loaded, m = h.lengthComputable ? h.total : -1;
421
- this.progressCallback_ !== null && this.progressCallback_(d, m);
422
- };
423
- this.progressCallback_ !== null && i.addUploadProgressListener(o), i.send(this.url_, this.method_, this.body_, this.headers_).then(() => {
424
- this.progressCallback_ !== null && i.removeUploadProgressListener(o), this.pendingConnection_ = null;
425
- const h = i.getErrorCode() === G.NO_ERROR, d = i.getStatus();
426
- if (!h || Nt(d, this.additionalRetryCodes_) && this.retry) {
427
- const T = i.getErrorCode() === G.ABORT;
428
- r(!1, new ue(!1, null, T));
429
- return;
430
- }
431
- const m = this.successCodes_.indexOf(d) !== -1;
432
- r(!0, new ue(m, i));
433
- });
434
- }, n = (r, s) => {
435
- const i = this.resolve_, o = this.reject_, h = s.connection;
436
- if (s.wasSuccessCode)
437
- try {
438
- const d = this.callback_(h, h.getResponse());
439
- Ut(d) ? i(d) : i();
440
- } catch (d) {
441
- o(d);
442
- }
443
- else if (h !== null) {
444
- const d = be();
445
- d.serverResponse = h.getErrorText(), this.errorCallback_ ? o(this.errorCallback_(h, d)) : o(d);
446
- } else if (s.canceled) {
447
- const d = this.appDelete_ ? Me() : bt();
448
- o(d);
449
- } else {
450
- const d = gt();
451
- o(d);
452
- }
453
- };
454
- this.canceled_ ? n(!1, new ue(!1, null, !0)) : this.backoffId_ = vt(t, n, this.timeout_);
455
- }
456
- /** @inheritDoc */
457
- getPromise() {
458
- return this.promise_;
459
- }
460
- /** @inheritDoc */
461
- cancel(t) {
462
- this.canceled_ = !0, this.appDelete_ = t || !1, this.backoffId_ !== null && At(this.backoffId_), this.pendingConnection_ !== null && this.pendingConnection_.abort();
463
- }
464
- }
465
- class ue {
466
- constructor(t, n, r) {
467
- this.wasSuccessCode = t, this.connection = n, this.canceled = !!r;
468
- }
469
- }
470
- function Pt(e, t) {
471
- t !== null && t.length > 0 && (e.Authorization = "Firebase " + t);
472
- }
473
- function Dt(e, t) {
474
- e["X-Firebase-Storage-Version"] = "webjs/" + (t ?? "AppManager");
475
- }
476
- function xt(e, t) {
477
- t && (e["X-Firebase-GMPID"] = t);
478
- }
479
- function Ct(e, t) {
480
- t !== null && (e["X-Firebase-AppCheck"] = t);
481
- }
482
- function Mt(e, t, n, r, s, i, o = !0) {
483
- const h = Le(e.urlParams), d = e.url + h, m = Object.assign({}, e.headers);
484
- return xt(m, t), Pt(m, n), Dt(m, i), Ct(m, r), new It(d, e.method, m, e.body, e.successCodes, e.additionalRetryCodes, e.handler, e.errorHandler, e.timeout, e.progressCallback, s, o);
485
- }
486
- /**
487
- * @license
488
- * Copyright 2017 Google LLC
489
- *
490
- * Licensed under the Apache License, Version 2.0 (the "License");
491
- * you may not use this file except in compliance with the License.
492
- * You may obtain a copy of the License at
493
- *
494
- * http://www.apache.org/licenses/LICENSE-2.0
495
- *
496
- * Unless required by applicable law or agreed to in writing, software
497
- * distributed under the License is distributed on an "AS IS" BASIS,
498
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
499
- * See the License for the specific language governing permissions and
500
- * limitations under the License.
501
- */
502
- function Lt() {
503
- return typeof BlobBuilder < "u" ? BlobBuilder : typeof WebKitBlobBuilder < "u" ? WebKitBlobBuilder : void 0;
504
- }
505
- function Bt(...e) {
506
- const t = Lt();
507
- if (t !== void 0) {
508
- const n = new t();
509
- for (let r = 0; r < e.length; r++)
510
- n.append(e[r]);
511
- return n.getBlob();
512
- } else {
513
- if (Te())
514
- return new Blob(e);
515
- throw new R(y.UNSUPPORTED_ENVIRONMENT, "This browser doesn't seem to support creating Blobs");
516
- }
517
- }
518
- function Ft(e, t, n) {
519
- return e.webkitSlice ? e.webkitSlice(t, n) : e.mozSlice ? e.mozSlice(t, n) : e.slice ? e.slice(t, n) : null;
520
- }
521
- /**
522
- * @license
523
- * Copyright 2021 Google LLC
524
- *
525
- * Licensed under the Apache License, Version 2.0 (the "License");
526
- * you may not use this file except in compliance with the License.
527
- * You may obtain a copy of the License at
528
- *
529
- * http://www.apache.org/licenses/LICENSE-2.0
530
- *
531
- * Unless required by applicable law or agreed to in writing, software
532
- * distributed under the License is distributed on an "AS IS" BASIS,
533
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
534
- * See the License for the specific language governing permissions and
535
- * limitations under the License.
536
- */
537
- function jt(e) {
538
- if (typeof atob > "u")
539
- throw Ot("base-64");
540
- return atob(e);
541
- }
542
- /**
543
- * @license
544
- * Copyright 2017 Google LLC
545
- *
546
- * Licensed under the Apache License, Version 2.0 (the "License");
547
- * you may not use this file except in compliance with the License.
548
- * You may obtain a copy of the License at
549
- *
550
- * http://www.apache.org/licenses/LICENSE-2.0
551
- *
552
- * Unless required by applicable law or agreed to in writing, software
553
- * distributed under the License is distributed on an "AS IS" BASIS,
554
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
555
- * See the License for the specific language governing permissions and
556
- * limitations under the License.
557
- */
558
- const B = {
559
- /**
560
- * Indicates the string should be interpreted "raw", that is, as normal text.
561
- * The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte
562
- * sequence.
563
- * Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence
564
- * 48 65 6c 6c 6f 21 20 f0 9f 98 8a
565
- */
566
- RAW: "raw",
567
- /**
568
- * Indicates the string should be interpreted as base64-encoded data.
569
- * Padding characters (trailing '='s) are optional.
570
- * Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence
571
- * ad 69 8e fb e1 3a b7 bf eb 97
572
- */
573
- BASE64: "base64",
574
- /**
575
- * Indicates the string should be interpreted as base64url-encoded data.
576
- * Padding characters (trailing '='s) are optional.
577
- * Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence
578
- * ad 69 8e fb e1 3a b7 bf eb 97
579
- */
580
- BASE64URL: "base64url",
581
- /**
582
- * Indicates the string is a data URL, such as one obtained from
583
- * canvas.toDataURL().
584
- * Example: the string 'data:application/octet-stream;base64,aaaa'
585
- * becomes the byte sequence
586
- * 69 a6 9a
587
- * (the content-type "application/octet-stream" is also applied, but can
588
- * be overridden in the metadata object).
589
- */
590
- DATA_URL: "data_url"
591
- };
592
- class fe {
593
- constructor(t, n) {
594
- this.data = t, this.contentType = n || null;
595
- }
596
- }
597
- function Ht(e, t) {
598
- switch (e) {
599
- case B.RAW:
600
- return new fe(Be(t));
601
- case B.BASE64:
602
- case B.BASE64URL:
603
- return new fe(Fe(e, t));
604
- case B.DATA_URL:
605
- return new fe(Vt(t), Yt(t));
606
- }
607
- throw be();
608
- }
609
- function Be(e) {
610
- const t = [];
611
- for (let n = 0; n < e.length; n++) {
612
- let r = e.charCodeAt(n);
613
- if (r <= 127)
614
- t.push(r);
615
- else if (r <= 2047)
616
- t.push(192 | r >> 6, 128 | r & 63);
617
- else if ((r & 64512) === 55296)
618
- if (!(n < e.length - 1 && (e.charCodeAt(n + 1) & 64512) === 56320))
619
- t.push(239, 191, 189);
620
- else {
621
- const i = r, o = e.charCodeAt(++n);
622
- r = 65536 | (i & 1023) << 10 | o & 1023, t.push(240 | r >> 18, 128 | r >> 12 & 63, 128 | r >> 6 & 63, 128 | r & 63);
623
- }
624
- else
625
- (r & 64512) === 56320 ? t.push(239, 191, 189) : t.push(224 | r >> 12, 128 | r >> 6 & 63, 128 | r & 63);
626
- }
627
- return new Uint8Array(t);
628
- }
629
- function Wt(e) {
630
- let t;
631
- try {
632
- t = decodeURIComponent(e);
633
- } catch {
634
- throw te(B.DATA_URL, "Malformed data URL.");
635
- }
636
- return Be(t);
637
- }
638
- function Fe(e, t) {
639
- switch (e) {
640
- case B.BASE64: {
641
- const s = t.indexOf("-") !== -1, i = t.indexOf("_") !== -1;
642
- if (s || i)
643
- throw te(e, "Invalid character '" + (s ? "-" : "_") + "' found: is it base64url encoded?");
644
- break;
645
- }
646
- case B.BASE64URL: {
647
- const s = t.indexOf("+") !== -1, i = t.indexOf("/") !== -1;
648
- if (s || i)
649
- throw te(e, "Invalid character '" + (s ? "+" : "/") + "' found: is it base64 encoded?");
650
- t = t.replace(/-/g, "+").replace(/_/g, "/");
651
- break;
652
- }
653
- }
654
- let n;
655
- try {
656
- n = jt(t);
657
- } catch (s) {
658
- throw s.message.includes("polyfill") ? s : te(e, "Invalid character found");
659
- }
660
- const r = new Uint8Array(n.length);
661
- for (let s = 0; s < n.length; s++)
662
- r[s] = n.charCodeAt(s);
663
- return r;
664
- }
665
- class je {
666
- constructor(t) {
667
- this.base64 = !1, this.contentType = null;
668
- const n = t.match(/^data:([^,]+)?,/);
669
- if (n === null)
670
- throw te(B.DATA_URL, "Must be formatted 'data:[<mediatype>][;base64],<data>");
671
- const r = n[1] || null;
672
- r != null && (this.base64 = qt(r, ";base64"), this.contentType = this.base64 ? r.substring(0, r.length - 7) : r), this.rest = t.substring(t.indexOf(",") + 1);
673
- }
674
- }
675
- function Vt(e) {
676
- const t = new je(e);
677
- return t.base64 ? Fe(B.BASE64, t.rest) : Wt(t.rest);
678
- }
679
- function Yt(e) {
680
- return new je(e).contentType;
681
- }
682
- function qt(e, t) {
683
- return e.length >= t.length ? e.substring(e.length - t.length) === t : !1;
684
- }
685
- /**
686
- * @license
687
- * Copyright 2017 Google LLC
688
- *
689
- * Licensed under the Apache License, Version 2.0 (the "License");
690
- * you may not use this file except in compliance with the License.
691
- * You may obtain a copy of the License at
692
- *
693
- * http://www.apache.org/licenses/LICENSE-2.0
694
- *
695
- * Unless required by applicable law or agreed to in writing, software
696
- * distributed under the License is distributed on an "AS IS" BASIS,
697
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
698
- * See the License for the specific language governing permissions and
699
- * limitations under the License.
700
- */
701
- class V {
702
- constructor(t, n) {
703
- let r = 0, s = "";
704
- Se(t) ? (this.data_ = t, r = t.size, s = t.type) : t instanceof ArrayBuffer ? (n ? this.data_ = new Uint8Array(t) : (this.data_ = new Uint8Array(t.byteLength), this.data_.set(new Uint8Array(t))), r = this.data_.length) : t instanceof Uint8Array && (n ? this.data_ = t : (this.data_ = new Uint8Array(t.length), this.data_.set(t)), r = t.length), this.size_ = r, this.type_ = s;
705
- }
706
- size() {
707
- return this.size_;
708
- }
709
- type() {
710
- return this.type_;
711
- }
712
- slice(t, n) {
713
- if (Se(this.data_)) {
714
- const r = this.data_, s = Ft(r, t, n);
715
- return s === null ? null : new V(s);
716
- } else {
717
- const r = new Uint8Array(this.data_.buffer, t, n - t);
718
- return new V(r, !0);
719
- }
720
- }
721
- static getBlob(...t) {
722
- if (Te()) {
723
- const n = t.map((r) => r instanceof V ? r.data_ : r);
724
- return new V(Bt.apply(null, n));
725
- } else {
726
- const n = t.map((o) => we(o) ? Ht(B.RAW, o).data : o.data_);
727
- let r = 0;
728
- n.forEach((o) => {
729
- r += o.byteLength;
730
- });
731
- const s = new Uint8Array(r);
732
- let i = 0;
733
- return n.forEach((o) => {
734
- for (let h = 0; h < o.length; h++)
735
- s[i++] = o[h];
736
- }), new V(s, !0);
737
- }
738
- }
739
- uploadData() {
740
- return this.data_;
741
- }
742
- }
743
- /**
744
- * @license
745
- * Copyright 2017 Google LLC
746
- *
747
- * Licensed under the Apache License, Version 2.0 (the "License");
748
- * you may not use this file except in compliance with the License.
749
- * You may obtain a copy of the License at
750
- *
751
- * http://www.apache.org/licenses/LICENSE-2.0
752
- *
753
- * Unless required by applicable law or agreed to in writing, software
754
- * distributed under the License is distributed on an "AS IS" BASIS,
755
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
756
- * See the License for the specific language governing permissions and
757
- * limitations under the License.
758
- */
759
- function He(e) {
760
- let t;
761
- try {
762
- t = JSON.parse(e);
763
- } catch {
764
- return null;
765
- }
766
- return $t(t) ? t : null;
767
- }
768
- /**
769
- * @license
770
- * Copyright 2017 Google LLC
771
- *
772
- * Licensed under the Apache License, Version 2.0 (the "License");
773
- * you may not use this file except in compliance with the License.
774
- * You may obtain a copy of the License at
775
- *
776
- * http://www.apache.org/licenses/LICENSE-2.0
777
- *
778
- * Unless required by applicable law or agreed to in writing, software
779
- * distributed under the License is distributed on an "AS IS" BASIS,
780
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
781
- * See the License for the specific language governing permissions and
782
- * limitations under the License.
783
- */
784
- function zt(e) {
785
- if (e.length === 0)
786
- return null;
787
- const t = e.lastIndexOf("/");
788
- return t === -1 ? "" : e.slice(0, t);
789
- }
790
- function Xt(e, t) {
791
- const n = t.split("/").filter((r) => r.length > 0).join("/");
792
- return e.length === 0 ? n : e + "/" + n;
793
- }
794
- function We(e) {
795
- const t = e.lastIndexOf("/", e.length - 2);
796
- return t === -1 ? e : e.slice(t + 1);
797
- }
798
- /**
799
- * @license
800
- * Copyright 2017 Google LLC
801
- *
802
- * Licensed under the Apache License, Version 2.0 (the "License");
803
- * you may not use this file except in compliance with the License.
804
- * You may obtain a copy of the License at
805
- *
806
- * http://www.apache.org/licenses/LICENSE-2.0
807
- *
808
- * Unless required by applicable law or agreed to in writing, software
809
- * distributed under the License is distributed on an "AS IS" BASIS,
810
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
811
- * See the License for the specific language governing permissions and
812
- * limitations under the License.
813
- */
814
- function Gt(e, t) {
815
- return t;
816
- }
817
- class I {
818
- constructor(t, n, r, s) {
819
- this.server = t, this.local = n || t, this.writable = !!r, this.xform = s || Gt;
820
- }
821
- }
822
- let ce = null;
823
- function Kt(e) {
824
- return !we(e) || e.length < 2 ? e : We(e);
825
- }
826
- function Ve() {
827
- if (ce)
828
- return ce;
829
- const e = [];
830
- e.push(new I("bucket")), e.push(new I("generation")), e.push(new I("metageneration")), e.push(new I("name", "fullPath", !0));
831
- function t(i, o) {
832
- return Kt(o);
833
- }
834
- const n = new I("name");
835
- n.xform = t, e.push(n);
836
- function r(i, o) {
837
- return o !== void 0 ? Number(o) : o;
838
- }
839
- const s = new I("size");
840
- return s.xform = r, e.push(s), e.push(new I("timeCreated")), e.push(new I("updated")), e.push(new I("md5Hash", null, !0)), e.push(new I("cacheControl", null, !0)), e.push(new I("contentDisposition", null, !0)), e.push(new I("contentEncoding", null, !0)), e.push(new I("contentLanguage", null, !0)), e.push(new I("contentType", null, !0)), e.push(new I("metadata", "customMetadata", !0)), ce = e, ce;
841
- }
842
- function Zt(e, t) {
843
- function n() {
844
- const r = e.bucket, s = e.fullPath, i = new x(r, s);
845
- return t._makeStorageReference(i);
846
- }
847
- Object.defineProperty(e, "ref", { get: n });
848
- }
849
- function Jt(e, t, n) {
850
- const r = {};
851
- r.type = "file";
852
- const s = n.length;
853
- for (let i = 0; i < s; i++) {
854
- const o = n[i];
855
- r[o.local] = o.xform(r, t[o.server]);
856
- }
857
- return Zt(r, e), r;
858
- }
859
- function Ye(e, t, n) {
860
- const r = He(t);
861
- return r === null ? null : Jt(e, r, n);
862
- }
863
- function Qt(e, t, n, r) {
864
- const s = He(t);
865
- if (s === null || !we(s.downloadTokens))
866
- return null;
867
- const i = s.downloadTokens;
868
- if (i.length === 0)
869
- return null;
870
- const o = encodeURIComponent;
871
- return i.split(",").map((m) => {
872
- const T = e.bucket, b = e.fullPath, O = "/b/" + o(T) + "/o/" + o(b), E = he(O, n, r), A = Le({
873
- alt: "media",
874
- token: m
875
- });
876
- return E + A;
877
- })[0];
878
- }
879
- function en(e, t) {
880
- const n = {}, r = t.length;
881
- for (let s = 0; s < r; s++) {
882
- const i = t[s];
883
- i.writable && (n[i.server] = e[i.local]);
884
- }
885
- return JSON.stringify(n);
886
- }
887
- class ye {
888
- constructor(t, n, r, s) {
889
- this.url = t, this.method = n, this.handler = r, this.timeout = s, this.urlParams = {}, this.headers = {}, this.body = null, this.errorHandler = null, this.progressCallback = null, this.successCodes = [200], this.additionalRetryCodes = [];
890
- }
891
- }
892
- /**
893
- * @license
894
- * Copyright 2017 Google LLC
895
- *
896
- * Licensed under the Apache License, Version 2.0 (the "License");
897
- * you may not use this file except in compliance with the License.
898
- * You may obtain a copy of the License at
899
- *
900
- * http://www.apache.org/licenses/LICENSE-2.0
901
- *
902
- * Unless required by applicable law or agreed to in writing, software
903
- * distributed under the License is distributed on an "AS IS" BASIS,
904
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
905
- * See the License for the specific language governing permissions and
906
- * limitations under the License.
907
- */
908
- function qe(e) {
909
- if (!e)
910
- throw be();
911
- }
912
- function tn(e, t) {
913
- function n(r, s) {
914
- const i = Ye(e, s, t);
915
- return qe(i !== null), i;
916
- }
917
- return n;
918
- }
919
- function nn(e, t) {
920
- function n(r, s) {
921
- const i = Ye(e, s, t);
922
- return qe(i !== null), Qt(i, s, e.host, e._protocol);
923
- }
924
- return n;
925
- }
926
- function ze(e) {
927
- function t(n, r) {
928
- let s;
929
- return n.getStatus() === 401 ? /* This exact message string is the only consistent part of the */ /* server's error response that identifies it as an App Check error. */ n.getErrorText().includes("Firebase App Check token is invalid") ? s = _t() : s = pt() : n.getStatus() === 402 ? s = ft(e.bucket) : n.getStatus() === 403 ? s = mt(e.path) : s = r, s.status = n.getStatus(), s.serverResponse = r.serverResponse, s;
930
- }
931
- return t;
932
- }
933
- function Xe(e) {
934
- const t = ze(e);
935
- function n(r, s) {
936
- let i = t(r, s);
937
- return r.getStatus() === 404 && (i = dt(e.path)), i.serverResponse = s.serverResponse, i;
938
- }
939
- return n;
940
- }
941
- function rn(e, t, n) {
942
- const r = t.fullServerUrl(), s = he(r, e.host, e._protocol), i = "GET", o = e.maxOperationRetryTime, h = new ye(s, i, nn(e, n), o);
943
- return h.errorHandler = Xe(t), h;
944
- }
945
- function sn(e, t) {
946
- const n = t.fullServerUrl(), r = he(n, e.host, e._protocol), s = "DELETE", i = e.maxOperationRetryTime;
947
- function o(d, m) {
948
- }
949
- const h = new ye(r, s, o, i);
950
- return h.successCodes = [200, 204], h.errorHandler = Xe(t), h;
951
- }
952
- function on(e, t) {
953
- return e && e.contentType || t && t.type() || "application/octet-stream";
954
- }
955
- function an(e, t, n) {
956
- const r = Object.assign({}, n);
957
- return r.fullPath = e.path, r.size = t.size(), r.contentType || (r.contentType = on(null, t)), r;
958
- }
959
- function un(e, t, n, r, s) {
960
- const i = t.bucketOnlyServerUrl(), o = {
961
- "X-Goog-Upload-Protocol": "multipart"
962
- };
963
- function h() {
964
- let P = "";
965
- for (let $ = 0; $ < 2; $++)
966
- P = P + Math.random().toString().slice(2);
967
- return P;
968
- }
969
- const d = h();
970
- o["Content-Type"] = "multipart/related; boundary=" + d;
971
- const m = an(t, r, s), T = en(m, n), b = "--" + d + `\r
972
- Content-Type: application/json; charset=utf-8\r
973
- \r
974
- ` + T + `\r
975
- --` + d + `\r
976
- Content-Type: ` + m.contentType + `\r
977
- \r
978
- `, O = `\r
979
- --` + d + "--", E = V.getBlob(b, r, O);
980
- if (E === null)
981
- throw Rt();
982
- const A = { name: m.fullPath }, F = he(i, e.host, e._protocol), U = "POST", H = e.maxUploadRetryTime, j = new ye(F, U, tn(e, n), H);
983
- return j.urlParams = A, j.headers = o, j.body = E.uploadData(), j.errorHandler = ze(t), j;
984
- }
985
- class cn {
986
- constructor() {
987
- this.sent_ = !1, this.xhr_ = new XMLHttpRequest(), this.initXhr(), this.errorCode_ = G.NO_ERROR, this.sendPromise_ = new Promise((t) => {
988
- this.xhr_.addEventListener("abort", () => {
989
- this.errorCode_ = G.ABORT, t();
990
- }), this.xhr_.addEventListener("error", () => {
991
- this.errorCode_ = G.NETWORK_ERROR, t();
992
- }), this.xhr_.addEventListener("load", () => {
993
- t();
994
- });
995
- });
996
- }
997
- send(t, n, r, s) {
998
- if (this.sent_)
999
- throw ee("cannot .send() more than once");
1000
- if (this.sent_ = !0, this.xhr_.open(n, t, !0), s !== void 0)
1001
- for (const i in s)
1002
- s.hasOwnProperty(i) && this.xhr_.setRequestHeader(i, s[i].toString());
1003
- return r !== void 0 ? this.xhr_.send(r) : this.xhr_.send(), this.sendPromise_;
1004
- }
1005
- getErrorCode() {
1006
- if (!this.sent_)
1007
- throw ee("cannot .getErrorCode() before sending");
1008
- return this.errorCode_;
1009
- }
1010
- getStatus() {
1011
- if (!this.sent_)
1012
- throw ee("cannot .getStatus() before sending");
1013
- try {
1014
- return this.xhr_.status;
1015
- } catch {
1016
- return -1;
1017
- }
1018
- }
1019
- getResponse() {
1020
- if (!this.sent_)
1021
- throw ee("cannot .getResponse() before sending");
1022
- return this.xhr_.response;
1023
- }
1024
- getErrorText() {
1025
- if (!this.sent_)
1026
- throw ee("cannot .getErrorText() before sending");
1027
- return this.xhr_.statusText;
1028
- }
1029
- /** Aborts the request. */
1030
- abort() {
1031
- this.xhr_.abort();
1032
- }
1033
- getResponseHeader(t) {
1034
- return this.xhr_.getResponseHeader(t);
1035
- }
1036
- addUploadProgressListener(t) {
1037
- this.xhr_.upload != null && this.xhr_.upload.addEventListener("progress", t);
1038
- }
1039
- removeUploadProgressListener(t) {
1040
- this.xhr_.upload != null && this.xhr_.upload.removeEventListener("progress", t);
1041
- }
1042
- }
1043
- class ln extends cn {
1044
- initXhr() {
1045
- this.xhr_.responseType = "text";
1046
- }
1047
- }
1048
- function Re() {
1049
- return new ln();
1050
- }
1051
- /**
1052
- * @license
1053
- * Copyright 2019 Google LLC
1054
- *
1055
- * Licensed under the Apache License, Version 2.0 (the "License");
1056
- * you may not use this file except in compliance with the License.
1057
- * You may obtain a copy of the License at
1058
- *
1059
- * http://www.apache.org/licenses/LICENSE-2.0
1060
- *
1061
- * Unless required by applicable law or agreed to in writing, software
1062
- * distributed under the License is distributed on an "AS IS" BASIS,
1063
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
- * See the License for the specific language governing permissions and
1065
- * limitations under the License.
1066
- */
1067
- class K {
1068
- constructor(t, n) {
1069
- this._service = t, n instanceof x ? this._location = n : this._location = x.makeFromUrl(n, t.host);
1070
- }
1071
- /**
1072
- * Returns the URL for the bucket and path this object references,
1073
- * in the form gs://<bucket>/<object-path>
1074
- * @override
1075
- */
1076
- toString() {
1077
- return "gs://" + this._location.bucket + "/" + this._location.path;
1078
- }
1079
- _newRef(t, n) {
1080
- return new K(t, n);
1081
- }
1082
- /**
1083
- * A reference to the root of this object's bucket.
1084
- */
1085
- get root() {
1086
- const t = new x(this._location.bucket, "");
1087
- return this._newRef(this._service, t);
1088
- }
1089
- /**
1090
- * The name of the bucket containing this reference's object.
1091
- */
1092
- get bucket() {
1093
- return this._location.bucket;
1094
- }
1095
- /**
1096
- * The full path of this object.
1097
- */
1098
- get fullPath() {
1099
- return this._location.path;
1100
- }
1101
- /**
1102
- * The short name of this object, which is the last component of the full path.
1103
- * For example, if fullPath is 'full/path/image.png', name is 'image.png'.
1104
- */
1105
- get name() {
1106
- return We(this._location.path);
1107
- }
1108
- /**
1109
- * The `StorageService` instance this `StorageReference` is associated with.
1110
- */
1111
- get storage() {
1112
- return this._service;
1113
- }
1114
- /**
1115
- * A `StorageReference` pointing to the parent location of this `StorageReference`, or null if
1116
- * this reference is the root.
1117
- */
1118
- get parent() {
1119
- const t = zt(this._location.path);
1120
- if (t === null)
1121
- return null;
1122
- const n = new x(this._location.bucket, t);
1123
- return new K(this._service, n);
1124
- }
1125
- /**
1126
- * Utility function to throw an error in methods that do not accept a root reference.
1127
- */
1128
- _throwIfRoot(t) {
1129
- if (this._location.path === "")
1130
- throw Et(t);
1131
- }
1132
- }
1133
- function hn(e, t, n) {
1134
- e._throwIfRoot("uploadBytes");
1135
- const r = un(e.storage, e._location, Ve(), new V(t, !0), n);
1136
- return e.storage.makeRequestWithTokens(r, Re).then((s) => ({
1137
- metadata: s,
1138
- ref: e
1139
- }));
1140
- }
1141
- function dn(e) {
1142
- e._throwIfRoot("getDownloadURL");
1143
- const t = rn(e.storage, e._location, Ve());
1144
- return e.storage.makeRequestWithTokens(t, Re).then((n) => {
1145
- if (n === null)
1146
- throw kt();
1147
- return n;
1148
- });
1149
- }
1150
- function fn(e) {
1151
- e._throwIfRoot("deleteObject");
1152
- const t = sn(e.storage, e._location);
1153
- return e.storage.makeRequestWithTokens(t, Re);
1154
- }
1155
- function pn(e, t) {
1156
- const n = Xt(e._location.path, t), r = new x(e._location.bucket, n);
1157
- return new K(e.storage, r);
1158
- }
1159
- /**
1160
- * @license
1161
- * Copyright 2017 Google LLC
1162
- *
1163
- * Licensed under the Apache License, Version 2.0 (the "License");
1164
- * you may not use this file except in compliance with the License.
1165
- * You may obtain a copy of the License at
1166
- *
1167
- * http://www.apache.org/licenses/LICENSE-2.0
1168
- *
1169
- * Unless required by applicable law or agreed to in writing, software
1170
- * distributed under the License is distributed on an "AS IS" BASIS,
1171
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1172
- * See the License for the specific language governing permissions and
1173
- * limitations under the License.
1174
- */
1175
- function _n(e) {
1176
- return /^[A-Za-z]+:\/\//.test(e);
1177
- }
1178
- function mn(e, t) {
1179
- return new K(e, t);
1180
- }
1181
- function Ge(e, t) {
1182
- if (e instanceof ke) {
1183
- const n = e;
1184
- if (n._bucket == null)
1185
- throw yt();
1186
- const r = new K(n, n._bucket);
1187
- return t != null ? Ge(r, t) : r;
1188
- } else
1189
- return t !== void 0 ? pn(e, t) : e;
1190
- }
1191
- function gn(e, t) {
1192
- if (t && _n(t)) {
1193
- if (e instanceof ke)
1194
- return mn(e, t);
1195
- throw me("To use ref(service, url), the first argument must be a Storage instance.");
1196
- } else
1197
- return Ge(e, t);
1198
- }
1199
- function Ae(e, t) {
1200
- const n = t == null ? void 0 : t[Ce];
1201
- return n == null ? null : x.makeFromBucketSpec(n, e);
1202
- }
1203
- function bn(e, t, n, r = {}) {
1204
- e.host = `${t}:${n}`, e._protocol = "http";
1205
- const { mockUserToken: s } = r;
1206
- s && (e._overrideAuthToken = typeof s == "string" ? s : st(s, e.app.options.projectId));
1207
- }
1208
- class ke {
1209
- constructor(t, n, r, s, i) {
1210
- this.app = t, this._authProvider = n, this._appCheckProvider = r, this._url = s, this._firebaseVersion = i, this._bucket = null, this._host = xe, this._protocol = "https", this._appId = null, this._deleted = !1, this._maxOperationRetryTime = lt, this._maxUploadRetryTime = ht, this._requests = /* @__PURE__ */ new Set(), s != null ? this._bucket = x.makeFromBucketSpec(s, this._host) : this._bucket = Ae(this._host, this.app.options);
1211
- }
1212
- /**
1213
- * The host string for this service, in the form of `host` or
1214
- * `host:port`.
1215
- */
1216
- get host() {
1217
- return this._host;
1218
- }
1219
- set host(t) {
1220
- this._host = t, this._url != null ? this._bucket = x.makeFromBucketSpec(this._url, t) : this._bucket = Ae(t, this.app.options);
1221
- }
1222
- /**
1223
- * The maximum time to retry uploads in milliseconds.
1224
- */
1225
- get maxUploadRetryTime() {
1226
- return this._maxUploadRetryTime;
1227
- }
1228
- set maxUploadRetryTime(t) {
1229
- ve(
1230
- "time",
1231
- /* minValue=*/
1232
- 0,
1233
- /* maxValue= */
1234
- Number.POSITIVE_INFINITY,
1235
- t
1236
- ), this._maxUploadRetryTime = t;
1237
- }
1238
- /**
1239
- * The maximum time to retry operations other than uploads or downloads in
1240
- * milliseconds.
1241
- */
1242
- get maxOperationRetryTime() {
1243
- return this._maxOperationRetryTime;
1244
- }
1245
- set maxOperationRetryTime(t) {
1246
- ve(
1247
- "time",
1248
- /* minValue=*/
1249
- 0,
1250
- /* maxValue= */
1251
- Number.POSITIVE_INFINITY,
1252
- t
1253
- ), this._maxOperationRetryTime = t;
1254
- }
1255
- async _getAuthToken() {
1256
- if (this._overrideAuthToken)
1257
- return this._overrideAuthToken;
1258
- const t = this._authProvider.getImmediate({ optional: !0 });
1259
- if (t) {
1260
- const n = await t.getToken();
1261
- if (n !== null)
1262
- return n.accessToken;
1263
- }
1264
- return null;
1265
- }
1266
- async _getAppCheckToken() {
1267
- const t = this._appCheckProvider.getImmediate({ optional: !0 });
1268
- return t ? (await t.getToken()).token : null;
1269
- }
1270
- /**
1271
- * Stop running requests and prevent more from being created.
1272
- */
1273
- _delete() {
1274
- return this._deleted || (this._deleted = !0, this._requests.forEach((t) => t.cancel()), this._requests.clear()), Promise.resolve();
1275
- }
1276
- /**
1277
- * Returns a new firebaseStorage.Reference object referencing this StorageService
1278
- * at the given Location.
1279
- */
1280
- _makeStorageReference(t) {
1281
- return new K(this, t);
1282
- }
1283
- /**
1284
- * @param requestInfo - HTTP RequestInfo object
1285
- * @param authToken - Firebase auth token
1286
- */
1287
- _makeRequest(t, n, r, s, i = !0) {
1288
- if (this._deleted)
1289
- return new St(Me());
1290
- {
1291
- const o = Mt(t, this._appId, r, s, n, this._firebaseVersion, i);
1292
- return this._requests.add(o), o.getPromise().then(() => this._requests.delete(o), () => this._requests.delete(o)), o;
1293
- }
1294
- }
1295
- async makeRequestWithTokens(t, n) {
1296
- const [r, s] = await Promise.all([
1297
- this._getAuthToken(),
1298
- this._getAppCheckToken()
1299
- ]);
1300
- return this._makeRequest(t, n, r, s).getPromise();
1301
- }
1302
- }
1303
- const Ue = "@firebase/storage", $e = "0.13.2";
1304
- /**
1305
- * @license
1306
- * Copyright 2020 Google LLC
1307
- *
1308
- * Licensed under the Apache License, Version 2.0 (the "License");
1309
- * you may not use this file except in compliance with the License.
1310
- * You may obtain a copy of the License at
1311
- *
1312
- * http://www.apache.org/licenses/LICENSE-2.0
1313
- *
1314
- * Unless required by applicable law or agreed to in writing, software
1315
- * distributed under the License is distributed on an "AS IS" BASIS,
1316
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1317
- * See the License for the specific language governing permissions and
1318
- * limitations under the License.
1319
- */
1320
- const Ke = "storage";
1321
- function wn(e, t, n) {
1322
- return e = re(e), hn(e, t, n);
1323
- }
1324
- function Tn(e) {
1325
- return e = re(e), dn(e);
1326
- }
1327
- function yn(e) {
1328
- return e = re(e), fn(e);
1329
- }
1330
- function Ne(e, t) {
1331
- return e = re(e), gn(e, t);
1332
- }
1333
- function Ie(e = _e(), t) {
1334
- e = re(e);
1335
- const r = tt(e, Ke).getImmediate({
1336
- identifier: t
1337
- }), s = nt("storage");
1338
- return s && Rn(r, ...s), r;
1339
- }
1340
- function Rn(e, t, n, r = {}) {
1341
- bn(e, t, n, r);
1342
- }
1343
- function kn(e, { instanceIdentifier: t }) {
1344
- const n = e.getProvider("app").getImmediate(), r = e.getProvider("auth-internal"), s = e.getProvider("app-check-internal");
1345
- return new ke(n, r, s, t, et);
1346
- }
1347
- function On() {
1348
- Je(new Qe(
1349
- Ke,
1350
- kn,
1351
- "PUBLIC"
1352
- /* ComponentType.PUBLIC */
1353
- ).setMultipleInstances(!0)), Ee(Ue, $e, ""), Ee(Ue, $e, "esm2017");
1354
- }
1355
- On();
1356
- const ne = {
1357
- async update(e, t, n) {
1358
- const r = Ie(_e(), n), s = Ne(r, e);
1359
- return await wn(s, t), Tn(s);
1360
- },
1361
- async delete(e, t) {
1362
- const n = Ie(_e(), t), r = Ne(n, e);
1363
- await yn(r);
1364
- }
1365
- };
1366
- var Ze = { exports: {} };
1367
- (function(e, t) {
1368
- (function(n, r) {
1369
- e.exports = r();
1370
- })(ot, function() {
1371
- var n = 1e3, r = 6e4, s = 36e5, i = "millisecond", o = "second", h = "minute", d = "hour", m = "day", T = "week", b = "month", O = "quarter", E = "year", A = "date", F = "Invalid Date", U = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, H = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, j = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) {
1372
- var c = ["th", "st", "nd", "rd"], a = f % 100;
1373
- return "[" + f + (c[(a - 20) % 10] || c[a] || c[0]) + "]";
1374
- } }, P = function(f, c, a) {
1375
- var l = String(f);
1376
- return !l || l.length >= c ? f : "" + Array(c + 1 - l.length).join(a) + f;
1377
- }, $ = { s: P, z: function(f) {
1378
- var c = -f.utcOffset(), a = Math.abs(c), l = Math.floor(a / 60), u = a % 60;
1379
- return (c <= 0 ? "+" : "-") + P(l, 2, "0") + ":" + P(u, 2, "0");
1380
- }, m: function f(c, a) {
1381
- if (c.date() < a.date()) return -f(a, c);
1382
- var l = 12 * (a.year() - c.year()) + (a.month() - c.month()), u = c.clone().add(l, b), p = a - u < 0, _ = c.clone().add(l + (p ? -1 : 1), b);
1383
- return +(-(l + (a - u) / (p ? u - _ : _ - u)) || 0);
1384
- }, a: function(f) {
1385
- return f < 0 ? Math.ceil(f) || 0 : Math.floor(f);
1386
- }, p: function(f) {
1387
- return { M: b, y: E, w: T, d: m, D: A, h: d, m: h, s: o, ms: i, Q: O }[f] || String(f || "").toLowerCase().replace(/s$/, "");
1388
- }, u: function(f) {
1389
- return f === void 0;
1390
- } }, L = "en", M = {};
1391
- M[L] = j;
1392
- var se = "$isDayjsObject", q = function(f) {
1393
- return f instanceof oe || !(!f || !f[se]);
1394
- }, ie = function f(c, a, l) {
1395
- var u;
1396
- if (!c) return L;
1397
- if (typeof c == "string") {
1398
- var p = c.toLowerCase();
1399
- M[p] && (u = p), a && (M[p] = a, u = p);
1400
- var _ = c.split("-");
1401
- if (!u && _.length > 1) return f(_[0]);
1402
- } else {
1403
- var w = c.name;
1404
- M[w] = c, u = w;
1405
- }
1406
- return !l && u && (L = u), u || !l && L;
1407
- }, S = function(f, c) {
1408
- if (q(f)) return f.clone();
1409
- var a = typeof c == "object" ? c : {};
1410
- return a.date = f, a.args = arguments, new oe(a);
1411
- }, g = $;
1412
- g.l = ie, g.i = q, g.w = function(f, c) {
1413
- return S(f, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset });
1414
- };
1415
- var oe = function() {
1416
- function f(a) {
1417
- this.$L = ie(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[se] = !0;
1418
- }
1419
- var c = f.prototype;
1420
- return c.parse = function(a) {
1421
- this.$d = function(l) {
1422
- var u = l.date, p = l.utc;
1423
- if (u === null) return /* @__PURE__ */ new Date(NaN);
1424
- if (g.u(u)) return /* @__PURE__ */ new Date();
1425
- if (u instanceof Date) return new Date(u);
1426
- if (typeof u == "string" && !/Z$/i.test(u)) {
1427
- var _ = u.match(U);
1428
- if (_) {
1429
- var w = _[2] - 1 || 0, k = (_[7] || "0").substring(0, 3);
1430
- return p ? new Date(Date.UTC(_[1], w, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, k)) : new Date(_[1], w, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, k);
1431
- }
1432
- }
1433
- return new Date(u);
1434
- }(a), this.init();
1435
- }, c.init = function() {
1436
- var a = this.$d;
1437
- this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds();
1438
- }, c.$utils = function() {
1439
- return g;
1440
- }, c.isValid = function() {
1441
- return this.$d.toString() !== F;
1442
- }, c.isSame = function(a, l) {
1443
- var u = S(a);
1444
- return this.startOf(l) <= u && u <= this.endOf(l);
1445
- }, c.isAfter = function(a, l) {
1446
- return S(a) < this.startOf(l);
1447
- }, c.isBefore = function(a, l) {
1448
- return this.endOf(l) < S(a);
1449
- }, c.$g = function(a, l, u) {
1450
- return g.u(a) ? this[l] : this.set(u, a);
1451
- }, c.unix = function() {
1452
- return Math.floor(this.valueOf() / 1e3);
1453
- }, c.valueOf = function() {
1454
- return this.$d.getTime();
1455
- }, c.startOf = function(a, l) {
1456
- var u = this, p = !!g.u(l) || l, _ = g.p(a), w = function(X, D) {
1457
- var W = g.w(u.$u ? Date.UTC(u.$y, D, X) : new Date(u.$y, D, X), u);
1458
- return p ? W : W.endOf(m);
1459
- }, k = function(X, D) {
1460
- return g.w(u.toDate()[X].apply(u.toDate("s"), (p ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(D)), u);
1461
- }, v = this.$W, N = this.$M, C = this.$D, Z = "set" + (this.$u ? "UTC" : "");
1462
- switch (_) {
1463
- case E:
1464
- return p ? w(1, 0) : w(31, 11);
1465
- case b:
1466
- return p ? w(1, N) : w(0, N + 1);
1467
- case T:
1468
- var z = this.$locale().weekStart || 0, J = (v < z ? v + 7 : v) - z;
1469
- return w(p ? C - J : C + (6 - J), N);
1470
- case m:
1471
- case A:
1472
- return k(Z + "Hours", 0);
1473
- case d:
1474
- return k(Z + "Minutes", 1);
1475
- case h:
1476
- return k(Z + "Seconds", 2);
1477
- case o:
1478
- return k(Z + "Milliseconds", 3);
1479
- default:
1480
- return this.clone();
1481
- }
1482
- }, c.endOf = function(a) {
1483
- return this.startOf(a, !1);
1484
- }, c.$set = function(a, l) {
1485
- var u, p = g.p(a), _ = "set" + (this.$u ? "UTC" : ""), w = (u = {}, u[m] = _ + "Date", u[A] = _ + "Date", u[b] = _ + "Month", u[E] = _ + "FullYear", u[d] = _ + "Hours", u[h] = _ + "Minutes", u[o] = _ + "Seconds", u[i] = _ + "Milliseconds", u)[p], k = p === m ? this.$D + (l - this.$W) : l;
1486
- if (p === b || p === E) {
1487
- var v = this.clone().set(A, 1);
1488
- v.$d[w](k), v.init(), this.$d = v.set(A, Math.min(this.$D, v.daysInMonth())).$d;
1489
- } else w && this.$d[w](k);
1490
- return this.init(), this;
1491
- }, c.set = function(a, l) {
1492
- return this.clone().$set(a, l);
1493
- }, c.get = function(a) {
1494
- return this[g.p(a)]();
1495
- }, c.add = function(a, l) {
1496
- var u, p = this;
1497
- a = Number(a);
1498
- var _ = g.p(l), w = function(N) {
1499
- var C = S(p);
1500
- return g.w(C.date(C.date() + Math.round(N * a)), p);
1501
- };
1502
- if (_ === b) return this.set(b, this.$M + a);
1503
- if (_ === E) return this.set(E, this.$y + a);
1504
- if (_ === m) return w(1);
1505
- if (_ === T) return w(7);
1506
- var k = (u = {}, u[h] = r, u[d] = s, u[o] = n, u)[_] || 1, v = this.$d.getTime() + a * k;
1507
- return g.w(v, this);
1508
- }, c.subtract = function(a, l) {
1509
- return this.add(-1 * a, l);
1510
- }, c.format = function(a) {
1511
- var l = this, u = this.$locale();
1512
- if (!this.isValid()) return u.invalidDate || F;
1513
- var p = a || "YYYY-MM-DDTHH:mm:ssZ", _ = g.z(this), w = this.$H, k = this.$m, v = this.$M, N = u.weekdays, C = u.months, Z = u.meridiem, z = function(D, W, Q, ae) {
1514
- return D && (D[W] || D(l, p)) || Q[W].slice(0, ae);
1515
- }, J = function(D) {
1516
- return g.s(w % 12 || 12, D, "0");
1517
- }, X = Z || function(D, W, Q) {
1518
- var ae = D < 12 ? "AM" : "PM";
1519
- return Q ? ae.toLowerCase() : ae;
1520
- };
1521
- return p.replace(H, function(D, W) {
1522
- return W || function(Q) {
1523
- switch (Q) {
1524
- case "YY":
1525
- return String(l.$y).slice(-2);
1526
- case "YYYY":
1527
- return g.s(l.$y, 4, "0");
1528
- case "M":
1529
- return v + 1;
1530
- case "MM":
1531
- return g.s(v + 1, 2, "0");
1532
- case "MMM":
1533
- return z(u.monthsShort, v, C, 3);
1534
- case "MMMM":
1535
- return z(C, v);
1536
- case "D":
1537
- return l.$D;
1538
- case "DD":
1539
- return g.s(l.$D, 2, "0");
1540
- case "d":
1541
- return String(l.$W);
1542
- case "dd":
1543
- return z(u.weekdaysMin, l.$W, N, 2);
1544
- case "ddd":
1545
- return z(u.weekdaysShort, l.$W, N, 3);
1546
- case "dddd":
1547
- return N[l.$W];
1548
- case "H":
1549
- return String(w);
1550
- case "HH":
1551
- return g.s(w, 2, "0");
1552
- case "h":
1553
- return J(1);
1554
- case "hh":
1555
- return J(2);
1556
- case "a":
1557
- return X(w, k, !0);
1558
- case "A":
1559
- return X(w, k, !1);
1560
- case "m":
1561
- return String(k);
1562
- case "mm":
1563
- return g.s(k, 2, "0");
1564
- case "s":
1565
- return String(l.$s);
1566
- case "ss":
1567
- return g.s(l.$s, 2, "0");
1568
- case "SSS":
1569
- return g.s(l.$ms, 3, "0");
1570
- case "Z":
1571
- return _;
1572
- }
1573
- return null;
1574
- }(D) || _.replace(":", "");
1575
- });
1576
- }, c.utcOffset = function() {
1577
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1578
- }, c.diff = function(a, l, u) {
1579
- var p, _ = this, w = g.p(l), k = S(a), v = (k.utcOffset() - this.utcOffset()) * r, N = this - k, C = function() {
1580
- return g.m(_, k);
1581
- };
1582
- switch (w) {
1583
- case E:
1584
- p = C() / 12;
1585
- break;
1586
- case b:
1587
- p = C();
1588
- break;
1589
- case O:
1590
- p = C() / 3;
1591
- break;
1592
- case T:
1593
- p = (N - v) / 6048e5;
1594
- break;
1595
- case m:
1596
- p = (N - v) / 864e5;
1597
- break;
1598
- case d:
1599
- p = N / s;
1600
- break;
1601
- case h:
1602
- p = N / r;
1603
- break;
1604
- case o:
1605
- p = N / n;
1606
- break;
1607
- default:
1608
- p = N;
1609
- }
1610
- return u ? p : g.a(p);
1611
- }, c.daysInMonth = function() {
1612
- return this.endOf(b).$D;
1613
- }, c.$locale = function() {
1614
- return M[this.$L];
1615
- }, c.locale = function(a, l) {
1616
- if (!a) return this.$L;
1617
- var u = this.clone(), p = ie(a, l, !0);
1618
- return p && (u.$L = p), u;
1619
- }, c.clone = function() {
1620
- return g.w(this.$d, this);
1621
- }, c.toDate = function() {
1622
- return new Date(this.valueOf());
1623
- }, c.toJSON = function() {
1624
- return this.isValid() ? this.toISOString() : null;
1625
- }, c.toISOString = function() {
1626
- return this.$d.toISOString();
1627
- }, c.toString = function() {
1628
- return this.$d.toUTCString();
1629
- }, f;
1630
- }(), Oe = oe.prototype;
1631
- return S.prototype = Oe, [["$ms", i], ["$s", o], ["$m", h], ["$H", d], ["$W", m], ["$M", b], ["$y", E], ["$D", A]].forEach(function(f) {
1632
- Oe[f[1]] = function(c) {
1633
- return this.$g(c, f[0], f[1]);
1634
- };
1635
- }), S.extend = function(f, c) {
1636
- return f.$i || (f(c, oe, S), f.$i = !0), S;
1637
- }, S.locale = ie, S.isDayjs = q, S.unix = function(f) {
1638
- return S(1e3 * f);
1639
- }, S.en = M[L], S.Ls = M, S.p = {}, S;
1640
- });
1641
- })(Ze);
1642
- var En = Ze.exports;
1643
- const Sn = /* @__PURE__ */ at(En);
1644
- function vn(e) {
1645
- return e.toLowerCase();
1646
- }
1647
- var An = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], Un = /[^A-Z0-9]+/gi;
1648
- function $n(e, t) {
1649
- t === void 0 && (t = {});
1650
- for (var n = t.splitRegexp, r = n === void 0 ? An : n, s = t.stripRegexp, i = s === void 0 ? Un : s, o = t.transform, h = o === void 0 ? vn : o, d = t.delimiter, m = d === void 0 ? " " : d, T = Pe(Pe(e, r, "$1\0$2"), i, "\0"), b = 0, O = T.length; T.charAt(b) === "\0"; )
1651
- b++;
1652
- for (; T.charAt(O - 1) === "\0"; )
1653
- O--;
1654
- return T.slice(b, O).split("\0").map(h).join(m);
1655
- }
1656
- function Pe(e, t, n) {
1657
- return t instanceof RegExp ? e.replace(t, n) : t.reduce(function(r, s) {
1658
- return r.replace(s, n);
1659
- }, e);
1660
- }
1661
- function Nn(e) {
1662
- return e.charAt(0).toUpperCase() + e.substr(1);
1663
- }
1664
- function In(e, t) {
1665
- var n = e.toLowerCase();
1666
- return t === 0 ? Nn(n) : n;
1667
- }
1668
- function le(e, t) {
1669
- return t === void 0 && (t = {}), $n(e, it({ delimiter: " ", transform: In }, t));
1670
- }
1671
- function Pn(e, t = []) {
1672
- const n = JSON.parse(JSON.stringify(e));
1673
- return t.length > 0 && t.forEach((r) => {
1674
- n[r] !== void 0 && delete n[r];
1675
- }), n;
1676
- }
1677
- function Dn(e, t) {
1678
- var r, s, i, o, h, d, m;
1679
- const n = t ? Pn(t) : void 0;
1680
- return {
1681
- _id: (n == null ? void 0 : n._id) ?? "",
1682
- notifyUrl: (n == null ? void 0 : n.notifyUrl) ?? "",
1683
- store: {
1684
- id: (n == null ? void 0 : n.store.id) ?? "",
1685
- event: (n == null ? void 0 : n.store.event) ?? Y.F_PAYOUT_FOR.Enum.ORDERING,
1686
- bank: {
1687
- name: ((r = n == null ? void 0 : n.store.bank) == null ? void 0 : r.name) ?? ge.bankNameOptions()[0].value,
1688
- type: ((s = n == null ? void 0 : n.store.bank) == null ? void 0 : s.type) ?? ge.bankTypeOptions()[0].value,
1689
- holderName: ((i = n == null ? void 0 : n.store.bank) == null ? void 0 : i.holderName) ?? "",
1690
- accountNumber: ((o = n == null ? void 0 : n.store.bank) == null ? void 0 : o.accountNumber) ?? ""
1691
- },
1692
- keyPerson: {
1693
- name: ((h = n == null ? void 0 : n.store.keyPerson) == null ? void 0 : h.name) ?? "",
1694
- phone: ((d = n == null ? void 0 : n.store.keyPerson) == null ? void 0 : d.phone) ?? "",
1695
- email: ((m = n == null ? void 0 : n.store.keyPerson) == null ? void 0 : m.email) ?? ""
1696
- },
1697
- ssm: (n == null ? void 0 : n.store.ssm) ?? "",
1698
- bankStatement: (n == null ? void 0 : n.store.bankStatement) ?? "",
1699
- exteriorPhoto: (n == null ? void 0 : n.store.exteriorPhoto) ?? ""
1700
- },
1701
- enable: (n == null ? void 0 : n.enable) ?? !1,
1702
- methods: (n == null ? void 0 : n.methods) ?? [],
1703
- status: (n == null ? void 0 : n.status) ?? Y.F_PAYOUT_ACCOUNT_STATUS.Enum.NEW,
1704
- businessId: e
1705
- };
1706
- }
1707
- function xn(e) {
1708
- return e.reduce(
1709
- (t, n) => ([Y.F_PAYOUT_ACCOUNT_STATUS.Enum.NEW].some((r) => r == n.status) ? t.NEW.push({
1710
- ...n
1711
- }) : t.EXISTED.push({
1712
- ...n
1713
- }), t),
1714
- {
1715
- NEW: [],
1716
- EXISTED: []
1717
- }
1718
- );
1719
- }
1720
- async function pe(e) {
1721
- await ne.delete(e);
1722
- }
1723
- async function De(e, t, n) {
1724
- const r = Sn().toISOString();
1725
- if (e.restaurantId)
1726
- return await ne.update(
1727
- `restaurant/${e.restaurantId}/documents/${t}/${r}.pdf`,
1728
- n
1729
- );
1730
- if (e.businessId)
1731
- return await ne.update(
1732
- `business/${e.businessId}/documents/${t}/${r}.pdf`,
1733
- n
1734
- );
1735
- throw "Not implemented";
1736
- }
1737
- async function Cn(e, t) {
1738
- if (e.restaurantId)
1739
- return await ne.update(
1740
- `restaurant/${e.restaurantId}/exterior/photo`,
1741
- t
1742
- );
1743
- if (e.businessId)
1744
- return await ne.update(
1745
- `business/${e.businessId}/exterior/photo`,
1746
- t
1747
- );
1748
- throw "Not implemented";
1749
- }
1750
- async function Mn(e, t, n) {
1751
- t.store.ssm && n.newSSM && await pe(t.store.ssm), t.store.bankStatement && n.newBankStatement && await pe(t.store.bankStatement), t.store.exteriorPhoto && n.newExteriorPhoto && await pe(t.store.exteriorPhoto);
1752
- let r = t.methods;
1753
- n.payoutSetting.methods.length > 0 && (r = n.payoutSetting.methods);
1754
- let s = t.store.ssm || "";
1755
- n.newSSM && (s = await De(e, "ssm", n.newSSM));
1756
- let i = t.store.bankStatement || "";
1757
- n.newBankStatement && (i = await De(
1758
- e,
1759
- "bankStatement",
1760
- n.newBankStatement
1761
- ));
1762
- let o = t.store.exteriorPhoto || "";
1763
- return n.newExteriorPhoto && (o = await Cn(
1764
- e,
1765
- n.newExteriorPhoto
1766
- )), {
1767
- ...t,
1768
- methods: r,
1769
- store: {
1770
- ...t.store,
1771
- id: n.payoutSetting.store.id,
1772
- keyPerson: n.payoutSetting.store.keyPerson,
1773
- bank: n.payoutSetting.store.bank,
1774
- ssm: s,
1775
- bankStatement: i,
1776
- exteriorPhoto: o,
1777
- event: n.payoutSetting.store.event
1778
- },
1779
- status: Y.F_PAYOUT_ACCOUNT_STATUS.Enum.PENDING,
1780
- notifyUrl: n.payoutSetting.store.event === Y.F_PAYOUT_FOR.Enum.MARKETING ? "http://marketing-api-service:3000/customer/callback/store" : "http://order-backend:3000/backend/payment"
1781
- };
1782
- }
1783
- const ge = {
1784
- bankNameOptions() {
1785
- const e = ct().currentCountry.value, t = ut(e).F_BANK_NAME;
1786
- return Object.values(t).map((n) => ({
1787
- label: le(n),
1788
- value: n
1789
- }));
1790
- },
1791
- bankTypeOptions() {
1792
- return Object.values(Y.F_BANK_TYPE.Values).map((e) => ({
1793
- label: le(e),
1794
- value: e
1795
- }));
1796
- },
1797
- storeEventOptions() {
1798
- return Object.values(Y.F_PAYOUT_FOR.Values).map((e) => ({
1799
- label: le(e),
1800
- value: e
1801
- }));
1802
- },
1803
- statusOptions() {
1804
- return Object.values(Y.F_PAYOUT_ACCOUNT_STATUS.Values).map((e) => ({
1805
- label: le(e),
1806
- value: e
1807
- }));
1808
- }
1809
- }, jn = {
1810
- mergeData: Mn,
1811
- initPayoutAccount: Dn,
1812
- groupByStatus: xn,
1813
- PayoutConfig: ge
1814
- };
1815
- export {
1816
- ge as P,
1817
- jn as a,
1818
- Pn as c
1819
- };