@feedmepos/mf-payment 1.2.26 → 1.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OnboardForm-BwHRuUJ2.js +709 -0
- package/dist/OnboardForm-DtdgTAfM.js +671 -0
- package/dist/OnboardSubmission-Cuzay_2u.js +148 -0
- package/dist/OnboardSubmission-TvoVrbT8.js +146 -0
- package/dist/{PDFViewer-xrBtzrlR.js → PDFViewer-DlSCBBxr.js} +14 -12
- package/dist/{PayoutAccount-DoUb4juo.js → PayoutAccount-DM-Uh5AW.js} +8 -7
- package/dist/{PayoutAccount-C4zN4xMw.js → PayoutAccount-D_oz3IN_.js} +5 -5
- package/dist/{PayoutAccountSetting-IgBRFN0A.js → PayoutAccountSetting-CUlmHkw3.js} +4 -4
- package/dist/{Restaurant-CIGhOFvk.js → Restaurant-DDebeSrf.js} +4 -4
- package/dist/{RestaurantSetting-0CbusLcz.js → RestaurantSetting-Cf63FkWQ.js} +291 -222
- package/dist/{Settlement-DmG5-VSP.js → Settlement-C_V-iTDy.js} +3 -3
- package/dist/{Settlement-CUmpNHMN.js → Settlement-CctMzPsZ.js} +3 -3
- package/dist/{SettlementTransactions-DhjGSAg4.js → SettlementTransactions-9p3tYV0n.js} +3 -3
- package/dist/{SettlementTransactions-CcMUINyi.js → SettlementTransactions-DYvhz0Yh.js} +3 -3
- package/dist/Status.vue_vue_type_script_setup_true_lang-wrcEbNj3.js +29 -0
- package/dist/{Terminal-CRizNZ4p.js → Terminal-D3QDgPY6.js} +5 -5
- package/dist/{TerminalSetting-DdJl_9JJ.js → TerminalSetting-ehm_sRqf.js} +3 -3
- package/dist/{Transaction-E9_hSpx4.js → Transaction-DIz_ArbY.js} +6 -6
- package/dist/{Transaction-ykrWGKIa.js → Transaction-DzIzAIbO.js} +5 -5
- package/dist/{TransactionOld-lPUiTl8n.js → TransactionOld-CagUKhjR.js} +4 -4
- package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-B03g8Jum.js → TransactionTable.vue_vue_type_script_setup_true_lang-ChuhuUKc.js} +3 -3
- package/dist/api/index.d.ts +1 -0
- package/dist/api/onboard-submission/index.d.ts +17 -0
- package/dist/api/payment-gateway/index.d.ts +3 -1
- package/dist/api/payout/index.d.ts +1 -0
- package/dist/{app-CU7mklRE.js → app-DB_fctP1.js} +212 -131
- package/dist/app.d.ts +46 -0
- package/dist/app.js +1 -1
- package/dist/{assets-Dttfej_E.js → assets-ha4XB2PU.js} +1 -1
- package/dist/{grafana-DCGA3gMb.js → grafana-DRZOKr8c.js} +1 -1
- package/dist/{index-BQtW6X1l.js → index-8Xu0hCTB.js} +1 -1
- package/dist/{index-CZKvrBM7.js → index-B6GVzj7l.js} +1 -1
- package/dist/{index-tCobqIDD.js → index-BasdAonL.js} +4930 -4857
- package/dist/{index-BOwfUR6x.js → index-DGF3hKwg.js} +1 -1
- package/dist/{index-BYLzp2JB.js → index-Dg_mEOso.js} +1 -1
- package/dist/{index-JCMXdVSJ.js → index-DoD23lHB.js} +8 -1
- package/dist/index-MqVn-IaA.js +68 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-HBMZ5z3-.js → index.vue_vue_type_script_setup_true_lang-D4bLM6th.js} +56 -54
- package/dist/modules.d.ts +1 -0
- package/dist/package.json +9 -8
- package/dist/payout-account-6yMkxM2O.js +458 -0
- package/dist/plugins-BLG_oAxW.js +1366 -0
- package/dist/stores/payoutAccount.d.ts +16 -16
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/onboard-submission/OnboardForm.vue.d.ts +12 -0
- package/dist/views/admin/onboard-submission/OnboardSubmission.vue.d.ts +2 -0
- package/dist/views/admin/onboard-submission/cell/SignatureBoard.vue.d.ts +10 -0
- package/dist/views/admin/onboard-submission/cell/Status.vue.d.ts +5 -0
- package/dist/views/admin/onboard-submission/cell/UploadButton.vue.d.ts +11 -0
- package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +81 -0
- package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +20 -20
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +20 -20
- package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +20 -20
- package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
- package/dist/views/admin/restaurant/tabs/LocalIntegration.vue.d.ts +803 -0
- package/dist/views/admin/settlement/SettlementTable.vue.d.ts +4 -4
- package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +8 -8
- package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +8 -8
- package/dist/views/admin/terminal/tabs/Information.vue.d.ts +8 -8
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +8 -8
- package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +8 -8
- package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +8 -8
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +8 -8
- package/dist/views/onboard-submission/OnboardForm.vue.d.ts +14 -0
- package/dist/views/onboard-submission/OnboardSubmission.vue.d.ts +2 -0
- package/dist/views/onboard-submission/cell/SignatureBoard.vue.d.ts +10 -0
- package/dist/views/onboard-submission/cell/UploadButton.vue.d.ts +11 -0
- package/dist/views/onboard-submission/form/SoftSpaceSubmission.vue.d.ts +5 -0
- package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
- package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +48 -48
- package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +24 -24
- package/dist/views/settlement/SettlementTable.vue.d.ts +4 -4
- package/package.json +9 -8
- package/dist/payout-account-CdudVI6I.js +0 -1819
@@ -0,0 +1,1366 @@
|
|
1
|
+
import { a as be, C as we, r as K, g as C, b as Te, c as ye, d as H, S as ke, e as Ee, F as Ae } from "./app-DB_fctP1.js";
|
2
|
+
/**
|
3
|
+
* @license
|
4
|
+
* Copyright 2017 Google LLC
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
* you may not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*/
|
18
|
+
const ne = "firebasestorage.googleapis.com", se = "storageBucket", Ue = 2 * 60 * 1e3, Oe = 10 * 60 * 1e3;
|
19
|
+
/**
|
20
|
+
* @license
|
21
|
+
* Copyright 2017 Google LLC
|
22
|
+
*
|
23
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
24
|
+
* you may not use this file except in compliance with the License.
|
25
|
+
* You may obtain a copy of the License at
|
26
|
+
*
|
27
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
28
|
+
*
|
29
|
+
* Unless required by applicable law or agreed to in writing, software
|
30
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
31
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
32
|
+
* See the License for the specific language governing permissions and
|
33
|
+
* limitations under the License.
|
34
|
+
*/
|
35
|
+
class h extends Ae {
|
36
|
+
/**
|
37
|
+
* @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and
|
38
|
+
* added to the end of the message.
|
39
|
+
* @param message - Error message.
|
40
|
+
* @param status_ - Corresponding HTTP Status Code
|
41
|
+
*/
|
42
|
+
constructor(t, n, s = 0) {
|
43
|
+
super(F(t), `Firebase Storage: ${n} (${F(t)})`), this.status_ = s, this.customData = { serverResponse: null }, this._baseMessage = this.message, Object.setPrototypeOf(this, h.prototype);
|
44
|
+
}
|
45
|
+
get status() {
|
46
|
+
return this.status_;
|
47
|
+
}
|
48
|
+
set status(t) {
|
49
|
+
this.status_ = t;
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* Compares a `StorageErrorCode` against this error's code, filtering out the prefix.
|
53
|
+
*/
|
54
|
+
_codeEquals(t) {
|
55
|
+
return F(t) === this.code;
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* Optional response message that was added by the server.
|
59
|
+
*/
|
60
|
+
get serverResponse() {
|
61
|
+
return this.customData.serverResponse;
|
62
|
+
}
|
63
|
+
set serverResponse(t) {
|
64
|
+
this.customData.serverResponse = t, this.customData.serverResponse ? this.message = `${this._baseMessage}
|
65
|
+
${this.customData.serverResponse}` : this.message = this._baseMessage;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
var l;
|
69
|
+
(function(e) {
|
70
|
+
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";
|
71
|
+
})(l || (l = {}));
|
72
|
+
function F(e) {
|
73
|
+
return "storage/" + e;
|
74
|
+
}
|
75
|
+
function j() {
|
76
|
+
const e = "An unknown error occurred, please check the error payload for server response.";
|
77
|
+
return new h(l.UNKNOWN, e);
|
78
|
+
}
|
79
|
+
function Ie(e) {
|
80
|
+
return new h(l.OBJECT_NOT_FOUND, "Object '" + e + "' does not exist.");
|
81
|
+
}
|
82
|
+
function Ne(e) {
|
83
|
+
return new h(l.QUOTA_EXCEEDED, "Quota for bucket '" + e + "' exceeded, please view quota on https://firebase.google.com/pricing/.");
|
84
|
+
}
|
85
|
+
function Pe() {
|
86
|
+
const e = "User is not authenticated, please authenticate using Firebase Authentication and try again.";
|
87
|
+
return new h(l.UNAUTHENTICATED, e);
|
88
|
+
}
|
89
|
+
function Ce() {
|
90
|
+
return new h(l.UNAUTHORIZED_APP, "This app does not have permission to access Firebase Storage on this project.");
|
91
|
+
}
|
92
|
+
function De(e) {
|
93
|
+
return new h(l.UNAUTHORIZED, "User does not have permission to access '" + e + "'.");
|
94
|
+
}
|
95
|
+
function xe() {
|
96
|
+
return new h(l.RETRY_LIMIT_EXCEEDED, "Max retry time for operation exceeded, please try again.");
|
97
|
+
}
|
98
|
+
function Le() {
|
99
|
+
return new h(l.CANCELED, "User canceled the upload/download.");
|
100
|
+
}
|
101
|
+
function Se(e) {
|
102
|
+
return new h(l.INVALID_URL, "Invalid URL '" + e + "'.");
|
103
|
+
}
|
104
|
+
function ve(e) {
|
105
|
+
return new h(l.INVALID_DEFAULT_BUCKET, "Invalid default bucket '" + e + "'.");
|
106
|
+
}
|
107
|
+
function Be() {
|
108
|
+
return new h(l.NO_DEFAULT_BUCKET, "No default bucket found. Did you set the '" + se + "' property when initializing the app?");
|
109
|
+
}
|
110
|
+
function Fe() {
|
111
|
+
return new h(l.CANNOT_SLICE_BLOB, "Cannot slice blob for upload. Please retry the upload.");
|
112
|
+
}
|
113
|
+
function Me() {
|
114
|
+
return new h(l.NO_DOWNLOAD_URL, "The given file does not have any download URLs.");
|
115
|
+
}
|
116
|
+
function He(e) {
|
117
|
+
return new h(l.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.`);
|
118
|
+
}
|
119
|
+
function $(e) {
|
120
|
+
return new h(l.INVALID_ARGUMENT, e);
|
121
|
+
}
|
122
|
+
function re() {
|
123
|
+
return new h(l.APP_DELETED, "The Firebase app was deleted.");
|
124
|
+
}
|
125
|
+
function $e(e) {
|
126
|
+
return new h(l.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').");
|
127
|
+
}
|
128
|
+
function P(e, t) {
|
129
|
+
return new h(l.INVALID_FORMAT, "String does not match format '" + e + "': " + t);
|
130
|
+
}
|
131
|
+
function N(e) {
|
132
|
+
throw new h(l.INTERNAL_ERROR, "Internal error: " + e);
|
133
|
+
}
|
134
|
+
/**
|
135
|
+
* @license
|
136
|
+
* Copyright 2017 Google LLC
|
137
|
+
*
|
138
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
139
|
+
* you may not use this file except in compliance with the License.
|
140
|
+
* You may obtain a copy of the License at
|
141
|
+
*
|
142
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
143
|
+
*
|
144
|
+
* Unless required by applicable law or agreed to in writing, software
|
145
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
146
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
147
|
+
* See the License for the specific language governing permissions and
|
148
|
+
* limitations under the License.
|
149
|
+
*/
|
150
|
+
class _ {
|
151
|
+
constructor(t, n) {
|
152
|
+
this.bucket = t, this.path_ = n;
|
153
|
+
}
|
154
|
+
get path() {
|
155
|
+
return this.path_;
|
156
|
+
}
|
157
|
+
get isRoot() {
|
158
|
+
return this.path.length === 0;
|
159
|
+
}
|
160
|
+
fullServerUrl() {
|
161
|
+
const t = encodeURIComponent;
|
162
|
+
return "/b/" + t(this.bucket) + "/o/" + t(this.path);
|
163
|
+
}
|
164
|
+
bucketOnlyServerUrl() {
|
165
|
+
return "/b/" + encodeURIComponent(this.bucket) + "/o";
|
166
|
+
}
|
167
|
+
static makeFromBucketSpec(t, n) {
|
168
|
+
let s;
|
169
|
+
try {
|
170
|
+
s = _.makeFromUrl(t, n);
|
171
|
+
} catch {
|
172
|
+
return new _(t, "");
|
173
|
+
}
|
174
|
+
if (s.path === "")
|
175
|
+
return s;
|
176
|
+
throw ve(t);
|
177
|
+
}
|
178
|
+
static makeFromUrl(t, n) {
|
179
|
+
let s = null;
|
180
|
+
const r = "([A-Za-z0-9.\\-_]+)";
|
181
|
+
function o(p) {
|
182
|
+
p.path.charAt(p.path.length - 1) === "/" && (p.path_ = p.path_.slice(0, -1));
|
183
|
+
}
|
184
|
+
const i = "(/(.*))?$", a = new RegExp("^gs://" + r + i, "i"), u = { bucket: 1, path: 3 };
|
185
|
+
function c(p) {
|
186
|
+
p.path_ = decodeURIComponent(p.path);
|
187
|
+
}
|
188
|
+
const g = "v[A-Za-z0-9_]+", R = n.replace(/[.]/g, "\\."), m = "(/([^?#]*).*)?$", b = new RegExp(`^https?://${R}/${g}/b/${r}/o${m}`, "i"), w = { bucket: 1, path: 3 }, O = n === ne ? "(?:storage.googleapis.com|storage.cloud.google.com)" : n, f = "([^?#]*)", I = new RegExp(`^https?://${O}/${r}/${f}`, "i"), T = [
|
189
|
+
{ regex: a, indices: u, postModify: o },
|
190
|
+
{
|
191
|
+
regex: b,
|
192
|
+
indices: w,
|
193
|
+
postModify: c
|
194
|
+
},
|
195
|
+
{
|
196
|
+
regex: I,
|
197
|
+
indices: { bucket: 1, path: 2 },
|
198
|
+
postModify: c
|
199
|
+
}
|
200
|
+
];
|
201
|
+
for (let p = 0; p < T.length; p++) {
|
202
|
+
const D = T[p], v = D.regex.exec(t);
|
203
|
+
if (v) {
|
204
|
+
const Re = v[D.indices.bucket];
|
205
|
+
let B = v[D.indices.path];
|
206
|
+
B || (B = ""), s = new _(Re, B), D.postModify(s);
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
if (s == null)
|
211
|
+
throw Se(t);
|
212
|
+
return s;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
class je {
|
216
|
+
constructor(t) {
|
217
|
+
this.promise_ = Promise.reject(t);
|
218
|
+
}
|
219
|
+
/** @inheritDoc */
|
220
|
+
getPromise() {
|
221
|
+
return this.promise_;
|
222
|
+
}
|
223
|
+
/** @inheritDoc */
|
224
|
+
cancel(t = !1) {
|
225
|
+
}
|
226
|
+
}
|
227
|
+
/**
|
228
|
+
* @license
|
229
|
+
* Copyright 2017 Google LLC
|
230
|
+
*
|
231
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
232
|
+
* you may not use this file except in compliance with the License.
|
233
|
+
* You may obtain a copy of the License at
|
234
|
+
*
|
235
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
236
|
+
*
|
237
|
+
* Unless required by applicable law or agreed to in writing, software
|
238
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
239
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
240
|
+
* See the License for the specific language governing permissions and
|
241
|
+
* limitations under the License.
|
242
|
+
*/
|
243
|
+
function qe(e, t, n) {
|
244
|
+
let s = 1, r = null, o = null, i = !1, a = 0;
|
245
|
+
function u() {
|
246
|
+
return a === 2;
|
247
|
+
}
|
248
|
+
let c = !1;
|
249
|
+
function g(...f) {
|
250
|
+
c || (c = !0, t.apply(null, f));
|
251
|
+
}
|
252
|
+
function R(f) {
|
253
|
+
r = setTimeout(() => {
|
254
|
+
r = null, e(b, u());
|
255
|
+
}, f);
|
256
|
+
}
|
257
|
+
function m() {
|
258
|
+
o && clearTimeout(o);
|
259
|
+
}
|
260
|
+
function b(f, ...I) {
|
261
|
+
if (c) {
|
262
|
+
m();
|
263
|
+
return;
|
264
|
+
}
|
265
|
+
if (f) {
|
266
|
+
m(), g.call(null, f, ...I);
|
267
|
+
return;
|
268
|
+
}
|
269
|
+
if (u() || i) {
|
270
|
+
m(), g.call(null, f, ...I);
|
271
|
+
return;
|
272
|
+
}
|
273
|
+
s < 64 && (s *= 2);
|
274
|
+
let T;
|
275
|
+
a === 1 ? (a = 2, T = 0) : T = (s + Math.random()) * 1e3, R(T);
|
276
|
+
}
|
277
|
+
let w = !1;
|
278
|
+
function O(f) {
|
279
|
+
w || (w = !0, m(), !c && (r !== null ? (f || (a = 2), clearTimeout(r), R(0)) : f || (a = 1)));
|
280
|
+
}
|
281
|
+
return R(0), o = setTimeout(() => {
|
282
|
+
i = !0, O(!0);
|
283
|
+
}, n), O;
|
284
|
+
}
|
285
|
+
function Ve(e) {
|
286
|
+
e(!1);
|
287
|
+
}
|
288
|
+
/**
|
289
|
+
* @license
|
290
|
+
* Copyright 2017 Google LLC
|
291
|
+
*
|
292
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
293
|
+
* you may not use this file except in compliance with the License.
|
294
|
+
* You may obtain a copy of the License at
|
295
|
+
*
|
296
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
297
|
+
*
|
298
|
+
* Unless required by applicable law or agreed to in writing, software
|
299
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
300
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
301
|
+
* See the License for the specific language governing permissions and
|
302
|
+
* limitations under the License.
|
303
|
+
*/
|
304
|
+
function ze(e) {
|
305
|
+
return e !== void 0;
|
306
|
+
}
|
307
|
+
function We(e) {
|
308
|
+
return typeof e == "object" && !Array.isArray(e);
|
309
|
+
}
|
310
|
+
function q(e) {
|
311
|
+
return typeof e == "string" || e instanceof String;
|
312
|
+
}
|
313
|
+
function G(e) {
|
314
|
+
return V() && e instanceof Blob;
|
315
|
+
}
|
316
|
+
function V() {
|
317
|
+
return typeof Blob < "u";
|
318
|
+
}
|
319
|
+
function Y(e, t, n, s) {
|
320
|
+
if (s < t)
|
321
|
+
throw $(`Invalid value for '${e}'. Expected ${t} or greater.`);
|
322
|
+
if (s > n)
|
323
|
+
throw $(`Invalid value for '${e}'. Expected ${n} or less.`);
|
324
|
+
}
|
325
|
+
/**
|
326
|
+
* @license
|
327
|
+
* Copyright 2017 Google LLC
|
328
|
+
*
|
329
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
330
|
+
* you may not use this file except in compliance with the License.
|
331
|
+
* You may obtain a copy of the License at
|
332
|
+
*
|
333
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
334
|
+
*
|
335
|
+
* Unless required by applicable law or agreed to in writing, software
|
336
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
337
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
338
|
+
* See the License for the specific language governing permissions and
|
339
|
+
* limitations under the License.
|
340
|
+
*/
|
341
|
+
function S(e, t, n) {
|
342
|
+
let s = t;
|
343
|
+
return n == null && (s = `https://${t}`), `${n}://${s}/v0${e}`;
|
344
|
+
}
|
345
|
+
function oe(e) {
|
346
|
+
const t = encodeURIComponent;
|
347
|
+
let n = "?";
|
348
|
+
for (const s in e)
|
349
|
+
if (e.hasOwnProperty(s)) {
|
350
|
+
const r = t(s) + "=" + t(e[s]);
|
351
|
+
n = n + r + "&";
|
352
|
+
}
|
353
|
+
return n = n.slice(0, -1), n;
|
354
|
+
}
|
355
|
+
var A;
|
356
|
+
(function(e) {
|
357
|
+
e[e.NO_ERROR = 0] = "NO_ERROR", e[e.NETWORK_ERROR = 1] = "NETWORK_ERROR", e[e.ABORT = 2] = "ABORT";
|
358
|
+
})(A || (A = {}));
|
359
|
+
/**
|
360
|
+
* @license
|
361
|
+
* Copyright 2022 Google LLC
|
362
|
+
*
|
363
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
364
|
+
* you may not use this file except in compliance with the License.
|
365
|
+
* You may obtain a copy of the License at
|
366
|
+
*
|
367
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
368
|
+
*
|
369
|
+
* Unless required by applicable law or agreed to in writing, software
|
370
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
371
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
372
|
+
* See the License for the specific language governing permissions and
|
373
|
+
* limitations under the License.
|
374
|
+
*/
|
375
|
+
function Xe(e, t) {
|
376
|
+
const n = e >= 500 && e < 600, r = [
|
377
|
+
// Request Timeout: web server didn't receive full request in time.
|
378
|
+
408,
|
379
|
+
// Too Many Requests: you're getting rate-limited, basically.
|
380
|
+
429
|
381
|
+
].indexOf(e) !== -1, o = t.indexOf(e) !== -1;
|
382
|
+
return n || r || o;
|
383
|
+
}
|
384
|
+
/**
|
385
|
+
* @license
|
386
|
+
* Copyright 2017 Google LLC
|
387
|
+
*
|
388
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
389
|
+
* you may not use this file except in compliance with the License.
|
390
|
+
* You may obtain a copy of the License at
|
391
|
+
*
|
392
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
393
|
+
*
|
394
|
+
* Unless required by applicable law or agreed to in writing, software
|
395
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
396
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
397
|
+
* See the License for the specific language governing permissions and
|
398
|
+
* limitations under the License.
|
399
|
+
*/
|
400
|
+
class Ke {
|
401
|
+
constructor(t, n, s, r, o, i, a, u, c, g, R, m = !0) {
|
402
|
+
this.url_ = t, this.method_ = n, this.headers_ = s, this.body_ = r, this.successCodes_ = o, this.additionalRetryCodes_ = i, this.callback_ = a, this.errorCallback_ = u, this.timeout_ = c, this.progressCallback_ = g, this.connectionFactory_ = R, this.retry = m, this.pendingConnection_ = null, this.backoffId_ = null, this.canceled_ = !1, this.appDelete_ = !1, this.promise_ = new Promise((b, w) => {
|
403
|
+
this.resolve_ = b, this.reject_ = w, this.start_();
|
404
|
+
});
|
405
|
+
}
|
406
|
+
/**
|
407
|
+
* Actually starts the retry loop.
|
408
|
+
*/
|
409
|
+
start_() {
|
410
|
+
const t = (s, r) => {
|
411
|
+
if (r) {
|
412
|
+
s(!1, new x(!1, null, !0));
|
413
|
+
return;
|
414
|
+
}
|
415
|
+
const o = this.connectionFactory_();
|
416
|
+
this.pendingConnection_ = o;
|
417
|
+
const i = (a) => {
|
418
|
+
const u = a.loaded, c = a.lengthComputable ? a.total : -1;
|
419
|
+
this.progressCallback_ !== null && this.progressCallback_(u, c);
|
420
|
+
};
|
421
|
+
this.progressCallback_ !== null && o.addUploadProgressListener(i), o.send(this.url_, this.method_, this.body_, this.headers_).then(() => {
|
422
|
+
this.progressCallback_ !== null && o.removeUploadProgressListener(i), this.pendingConnection_ = null;
|
423
|
+
const a = o.getErrorCode() === A.NO_ERROR, u = o.getStatus();
|
424
|
+
if (!a || Xe(u, this.additionalRetryCodes_) && this.retry) {
|
425
|
+
const g = o.getErrorCode() === A.ABORT;
|
426
|
+
s(!1, new x(!1, null, g));
|
427
|
+
return;
|
428
|
+
}
|
429
|
+
const c = this.successCodes_.indexOf(u) !== -1;
|
430
|
+
s(!0, new x(c, o));
|
431
|
+
});
|
432
|
+
}, n = (s, r) => {
|
433
|
+
const o = this.resolve_, i = this.reject_, a = r.connection;
|
434
|
+
if (r.wasSuccessCode)
|
435
|
+
try {
|
436
|
+
const u = this.callback_(a, a.getResponse());
|
437
|
+
ze(u) ? o(u) : o();
|
438
|
+
} catch (u) {
|
439
|
+
i(u);
|
440
|
+
}
|
441
|
+
else if (a !== null) {
|
442
|
+
const u = j();
|
443
|
+
u.serverResponse = a.getErrorText(), this.errorCallback_ ? i(this.errorCallback_(a, u)) : i(u);
|
444
|
+
} else if (r.canceled) {
|
445
|
+
const u = this.appDelete_ ? re() : Le();
|
446
|
+
i(u);
|
447
|
+
} else {
|
448
|
+
const u = xe();
|
449
|
+
i(u);
|
450
|
+
}
|
451
|
+
};
|
452
|
+
this.canceled_ ? n(!1, new x(!1, null, !0)) : this.backoffId_ = qe(t, n, this.timeout_);
|
453
|
+
}
|
454
|
+
/** @inheritDoc */
|
455
|
+
getPromise() {
|
456
|
+
return this.promise_;
|
457
|
+
}
|
458
|
+
/** @inheritDoc */
|
459
|
+
cancel(t) {
|
460
|
+
this.canceled_ = !0, this.appDelete_ = t || !1, this.backoffId_ !== null && Ve(this.backoffId_), this.pendingConnection_ !== null && this.pendingConnection_.abort();
|
461
|
+
}
|
462
|
+
}
|
463
|
+
class x {
|
464
|
+
constructor(t, n, s) {
|
465
|
+
this.wasSuccessCode = t, this.connection = n, this.canceled = !!s;
|
466
|
+
}
|
467
|
+
}
|
468
|
+
function Ge(e, t) {
|
469
|
+
t !== null && t.length > 0 && (e.Authorization = "Firebase " + t);
|
470
|
+
}
|
471
|
+
function Ye(e, t) {
|
472
|
+
e["X-Firebase-Storage-Version"] = "webjs/" + (t ?? "AppManager");
|
473
|
+
}
|
474
|
+
function Ze(e, t) {
|
475
|
+
t && (e["X-Firebase-GMPID"] = t);
|
476
|
+
}
|
477
|
+
function Je(e, t) {
|
478
|
+
t !== null && (e["X-Firebase-AppCheck"] = t);
|
479
|
+
}
|
480
|
+
function Qe(e, t, n, s, r, o, i = !0) {
|
481
|
+
const a = oe(e.urlParams), u = e.url + a, c = Object.assign({}, e.headers);
|
482
|
+
return Ze(c, t), Ge(c, n), Ye(c, o), Je(c, s), new Ke(u, e.method, c, e.body, e.successCodes, e.additionalRetryCodes, e.handler, e.errorHandler, e.timeout, e.progressCallback, r, i);
|
483
|
+
}
|
484
|
+
/**
|
485
|
+
* @license
|
486
|
+
* Copyright 2017 Google LLC
|
487
|
+
*
|
488
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
489
|
+
* you may not use this file except in compliance with the License.
|
490
|
+
* You may obtain a copy of the License at
|
491
|
+
*
|
492
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
493
|
+
*
|
494
|
+
* Unless required by applicable law or agreed to in writing, software
|
495
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
496
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
497
|
+
* See the License for the specific language governing permissions and
|
498
|
+
* limitations under the License.
|
499
|
+
*/
|
500
|
+
function et() {
|
501
|
+
return typeof BlobBuilder < "u" ? BlobBuilder : typeof WebKitBlobBuilder < "u" ? WebKitBlobBuilder : void 0;
|
502
|
+
}
|
503
|
+
function tt(...e) {
|
504
|
+
const t = et();
|
505
|
+
if (t !== void 0) {
|
506
|
+
const n = new t();
|
507
|
+
for (let s = 0; s < e.length; s++)
|
508
|
+
n.append(e[s]);
|
509
|
+
return n.getBlob();
|
510
|
+
} else {
|
511
|
+
if (V())
|
512
|
+
return new Blob(e);
|
513
|
+
throw new h(l.UNSUPPORTED_ENVIRONMENT, "This browser doesn't seem to support creating Blobs");
|
514
|
+
}
|
515
|
+
}
|
516
|
+
function nt(e, t, n) {
|
517
|
+
return e.webkitSlice ? e.webkitSlice(t, n) : e.mozSlice ? e.mozSlice(t, n) : e.slice ? e.slice(t, n) : null;
|
518
|
+
}
|
519
|
+
/**
|
520
|
+
* @license
|
521
|
+
* Copyright 2021 Google LLC
|
522
|
+
*
|
523
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
524
|
+
* you may not use this file except in compliance with the License.
|
525
|
+
* You may obtain a copy of the License at
|
526
|
+
*
|
527
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
528
|
+
*
|
529
|
+
* Unless required by applicable law or agreed to in writing, software
|
530
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
531
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
532
|
+
* See the License for the specific language governing permissions and
|
533
|
+
* limitations under the License.
|
534
|
+
*/
|
535
|
+
function st(e) {
|
536
|
+
if (typeof atob > "u")
|
537
|
+
throw He("base-64");
|
538
|
+
return atob(e);
|
539
|
+
}
|
540
|
+
/**
|
541
|
+
* @license
|
542
|
+
* Copyright 2017 Google LLC
|
543
|
+
*
|
544
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
545
|
+
* you may not use this file except in compliance with the License.
|
546
|
+
* You may obtain a copy of the License at
|
547
|
+
*
|
548
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
549
|
+
*
|
550
|
+
* Unless required by applicable law or agreed to in writing, software
|
551
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
552
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
553
|
+
* See the License for the specific language governing permissions and
|
554
|
+
* limitations under the License.
|
555
|
+
*/
|
556
|
+
const y = {
|
557
|
+
/**
|
558
|
+
* Indicates the string should be interpreted "raw", that is, as normal text.
|
559
|
+
* The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte
|
560
|
+
* sequence.
|
561
|
+
* Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence
|
562
|
+
* 48 65 6c 6c 6f 21 20 f0 9f 98 8a
|
563
|
+
*/
|
564
|
+
RAW: "raw",
|
565
|
+
/**
|
566
|
+
* Indicates the string should be interpreted as base64-encoded data.
|
567
|
+
* Padding characters (trailing '='s) are optional.
|
568
|
+
* Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence
|
569
|
+
* ad 69 8e fb e1 3a b7 bf eb 97
|
570
|
+
*/
|
571
|
+
BASE64: "base64",
|
572
|
+
/**
|
573
|
+
* Indicates the string should be interpreted as base64url-encoded data.
|
574
|
+
* Padding characters (trailing '='s) are optional.
|
575
|
+
* Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence
|
576
|
+
* ad 69 8e fb e1 3a b7 bf eb 97
|
577
|
+
*/
|
578
|
+
BASE64URL: "base64url",
|
579
|
+
/**
|
580
|
+
* Indicates the string is a data URL, such as one obtained from
|
581
|
+
* canvas.toDataURL().
|
582
|
+
* Example: the string 'data:application/octet-stream;base64,aaaa'
|
583
|
+
* becomes the byte sequence
|
584
|
+
* 69 a6 9a
|
585
|
+
* (the content-type "application/octet-stream" is also applied, but can
|
586
|
+
* be overridden in the metadata object).
|
587
|
+
*/
|
588
|
+
DATA_URL: "data_url"
|
589
|
+
};
|
590
|
+
class M {
|
591
|
+
constructor(t, n) {
|
592
|
+
this.data = t, this.contentType = n || null;
|
593
|
+
}
|
594
|
+
}
|
595
|
+
function rt(e, t) {
|
596
|
+
switch (e) {
|
597
|
+
case y.RAW:
|
598
|
+
return new M(ie(t));
|
599
|
+
case y.BASE64:
|
600
|
+
case y.BASE64URL:
|
601
|
+
return new M(ae(e, t));
|
602
|
+
case y.DATA_URL:
|
603
|
+
return new M(it(t), at(t));
|
604
|
+
}
|
605
|
+
throw j();
|
606
|
+
}
|
607
|
+
function ie(e) {
|
608
|
+
const t = [];
|
609
|
+
for (let n = 0; n < e.length; n++) {
|
610
|
+
let s = e.charCodeAt(n);
|
611
|
+
if (s <= 127)
|
612
|
+
t.push(s);
|
613
|
+
else if (s <= 2047)
|
614
|
+
t.push(192 | s >> 6, 128 | s & 63);
|
615
|
+
else if ((s & 64512) === 55296)
|
616
|
+
if (!(n < e.length - 1 && (e.charCodeAt(n + 1) & 64512) === 56320))
|
617
|
+
t.push(239, 191, 189);
|
618
|
+
else {
|
619
|
+
const o = s, i = e.charCodeAt(++n);
|
620
|
+
s = 65536 | (o & 1023) << 10 | i & 1023, t.push(240 | s >> 18, 128 | s >> 12 & 63, 128 | s >> 6 & 63, 128 | s & 63);
|
621
|
+
}
|
622
|
+
else
|
623
|
+
(s & 64512) === 56320 ? t.push(239, 191, 189) : t.push(224 | s >> 12, 128 | s >> 6 & 63, 128 | s & 63);
|
624
|
+
}
|
625
|
+
return new Uint8Array(t);
|
626
|
+
}
|
627
|
+
function ot(e) {
|
628
|
+
let t;
|
629
|
+
try {
|
630
|
+
t = decodeURIComponent(e);
|
631
|
+
} catch {
|
632
|
+
throw P(y.DATA_URL, "Malformed data URL.");
|
633
|
+
}
|
634
|
+
return ie(t);
|
635
|
+
}
|
636
|
+
function ae(e, t) {
|
637
|
+
switch (e) {
|
638
|
+
case y.BASE64: {
|
639
|
+
const r = t.indexOf("-") !== -1, o = t.indexOf("_") !== -1;
|
640
|
+
if (r || o)
|
641
|
+
throw P(e, "Invalid character '" + (r ? "-" : "_") + "' found: is it base64url encoded?");
|
642
|
+
break;
|
643
|
+
}
|
644
|
+
case y.BASE64URL: {
|
645
|
+
const r = t.indexOf("+") !== -1, o = t.indexOf("/") !== -1;
|
646
|
+
if (r || o)
|
647
|
+
throw P(e, "Invalid character '" + (r ? "+" : "/") + "' found: is it base64 encoded?");
|
648
|
+
t = t.replace(/-/g, "+").replace(/_/g, "/");
|
649
|
+
break;
|
650
|
+
}
|
651
|
+
}
|
652
|
+
let n;
|
653
|
+
try {
|
654
|
+
n = st(t);
|
655
|
+
} catch (r) {
|
656
|
+
throw r.message.includes("polyfill") ? r : P(e, "Invalid character found");
|
657
|
+
}
|
658
|
+
const s = new Uint8Array(n.length);
|
659
|
+
for (let r = 0; r < n.length; r++)
|
660
|
+
s[r] = n.charCodeAt(r);
|
661
|
+
return s;
|
662
|
+
}
|
663
|
+
class ue {
|
664
|
+
constructor(t) {
|
665
|
+
this.base64 = !1, this.contentType = null;
|
666
|
+
const n = t.match(/^data:([^,]+)?,/);
|
667
|
+
if (n === null)
|
668
|
+
throw P(y.DATA_URL, "Must be formatted 'data:[<mediatype>][;base64],<data>");
|
669
|
+
const s = n[1] || null;
|
670
|
+
s != null && (this.base64 = ut(s, ";base64"), this.contentType = this.base64 ? s.substring(0, s.length - 7) : s), this.rest = t.substring(t.indexOf(",") + 1);
|
671
|
+
}
|
672
|
+
}
|
673
|
+
function it(e) {
|
674
|
+
const t = new ue(e);
|
675
|
+
return t.base64 ? ae(y.BASE64, t.rest) : ot(t.rest);
|
676
|
+
}
|
677
|
+
function at(e) {
|
678
|
+
return new ue(e).contentType;
|
679
|
+
}
|
680
|
+
function ut(e, t) {
|
681
|
+
return e.length >= t.length ? e.substring(e.length - t.length) === t : !1;
|
682
|
+
}
|
683
|
+
/**
|
684
|
+
* @license
|
685
|
+
* Copyright 2017 Google LLC
|
686
|
+
*
|
687
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
688
|
+
* you may not use this file except in compliance with the License.
|
689
|
+
* You may obtain a copy of the License at
|
690
|
+
*
|
691
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
692
|
+
*
|
693
|
+
* Unless required by applicable law or agreed to in writing, software
|
694
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
695
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
696
|
+
* See the License for the specific language governing permissions and
|
697
|
+
* limitations under the License.
|
698
|
+
*/
|
699
|
+
class k {
|
700
|
+
constructor(t, n) {
|
701
|
+
let s = 0, r = "";
|
702
|
+
G(t) ? (this.data_ = t, s = t.size, r = t.type) : t instanceof ArrayBuffer ? (n ? this.data_ = new Uint8Array(t) : (this.data_ = new Uint8Array(t.byteLength), this.data_.set(new Uint8Array(t))), s = this.data_.length) : t instanceof Uint8Array && (n ? this.data_ = t : (this.data_ = new Uint8Array(t.length), this.data_.set(t)), s = t.length), this.size_ = s, this.type_ = r;
|
703
|
+
}
|
704
|
+
size() {
|
705
|
+
return this.size_;
|
706
|
+
}
|
707
|
+
type() {
|
708
|
+
return this.type_;
|
709
|
+
}
|
710
|
+
slice(t, n) {
|
711
|
+
if (G(this.data_)) {
|
712
|
+
const s = this.data_, r = nt(s, t, n);
|
713
|
+
return r === null ? null : new k(r);
|
714
|
+
} else {
|
715
|
+
const s = new Uint8Array(this.data_.buffer, t, n - t);
|
716
|
+
return new k(s, !0);
|
717
|
+
}
|
718
|
+
}
|
719
|
+
static getBlob(...t) {
|
720
|
+
if (V()) {
|
721
|
+
const n = t.map((s) => s instanceof k ? s.data_ : s);
|
722
|
+
return new k(tt.apply(null, n));
|
723
|
+
} else {
|
724
|
+
const n = t.map((i) => q(i) ? rt(y.RAW, i).data : i.data_);
|
725
|
+
let s = 0;
|
726
|
+
n.forEach((i) => {
|
727
|
+
s += i.byteLength;
|
728
|
+
});
|
729
|
+
const r = new Uint8Array(s);
|
730
|
+
let o = 0;
|
731
|
+
return n.forEach((i) => {
|
732
|
+
for (let a = 0; a < i.length; a++)
|
733
|
+
r[o++] = i[a];
|
734
|
+
}), new k(r, !0);
|
735
|
+
}
|
736
|
+
}
|
737
|
+
uploadData() {
|
738
|
+
return this.data_;
|
739
|
+
}
|
740
|
+
}
|
741
|
+
/**
|
742
|
+
* @license
|
743
|
+
* Copyright 2017 Google LLC
|
744
|
+
*
|
745
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
746
|
+
* you may not use this file except in compliance with the License.
|
747
|
+
* You may obtain a copy of the License at
|
748
|
+
*
|
749
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
750
|
+
*
|
751
|
+
* Unless required by applicable law or agreed to in writing, software
|
752
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
753
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
754
|
+
* See the License for the specific language governing permissions and
|
755
|
+
* limitations under the License.
|
756
|
+
*/
|
757
|
+
function ce(e) {
|
758
|
+
let t;
|
759
|
+
try {
|
760
|
+
t = JSON.parse(e);
|
761
|
+
} catch {
|
762
|
+
return null;
|
763
|
+
}
|
764
|
+
return We(t) ? t : null;
|
765
|
+
}
|
766
|
+
/**
|
767
|
+
* @license
|
768
|
+
* Copyright 2017 Google LLC
|
769
|
+
*
|
770
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
771
|
+
* you may not use this file except in compliance with the License.
|
772
|
+
* You may obtain a copy of the License at
|
773
|
+
*
|
774
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
775
|
+
*
|
776
|
+
* Unless required by applicable law or agreed to in writing, software
|
777
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
778
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
779
|
+
* See the License for the specific language governing permissions and
|
780
|
+
* limitations under the License.
|
781
|
+
*/
|
782
|
+
function ct(e) {
|
783
|
+
if (e.length === 0)
|
784
|
+
return null;
|
785
|
+
const t = e.lastIndexOf("/");
|
786
|
+
return t === -1 ? "" : e.slice(0, t);
|
787
|
+
}
|
788
|
+
function lt(e, t) {
|
789
|
+
const n = t.split("/").filter((s) => s.length > 0).join("/");
|
790
|
+
return e.length === 0 ? n : e + "/" + n;
|
791
|
+
}
|
792
|
+
function le(e) {
|
793
|
+
const t = e.lastIndexOf("/", e.length - 2);
|
794
|
+
return t === -1 ? e : e.slice(t + 1);
|
795
|
+
}
|
796
|
+
/**
|
797
|
+
* @license
|
798
|
+
* Copyright 2017 Google LLC
|
799
|
+
*
|
800
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
801
|
+
* you may not use this file except in compliance with the License.
|
802
|
+
* You may obtain a copy of the License at
|
803
|
+
*
|
804
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
805
|
+
*
|
806
|
+
* Unless required by applicable law or agreed to in writing, software
|
807
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
808
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
809
|
+
* See the License for the specific language governing permissions and
|
810
|
+
* limitations under the License.
|
811
|
+
*/
|
812
|
+
function ht(e, t) {
|
813
|
+
return t;
|
814
|
+
}
|
815
|
+
class d {
|
816
|
+
constructor(t, n, s, r) {
|
817
|
+
this.server = t, this.local = n || t, this.writable = !!s, this.xform = r || ht;
|
818
|
+
}
|
819
|
+
}
|
820
|
+
let L = null;
|
821
|
+
function dt(e) {
|
822
|
+
return !q(e) || e.length < 2 ? e : le(e);
|
823
|
+
}
|
824
|
+
function he() {
|
825
|
+
if (L)
|
826
|
+
return L;
|
827
|
+
const e = [];
|
828
|
+
e.push(new d("bucket")), e.push(new d("generation")), e.push(new d("metageneration")), e.push(new d("name", "fullPath", !0));
|
829
|
+
function t(o, i) {
|
830
|
+
return dt(i);
|
831
|
+
}
|
832
|
+
const n = new d("name");
|
833
|
+
n.xform = t, e.push(n);
|
834
|
+
function s(o, i) {
|
835
|
+
return i !== void 0 ? Number(i) : i;
|
836
|
+
}
|
837
|
+
const r = new d("size");
|
838
|
+
return r.xform = s, e.push(r), e.push(new d("timeCreated")), e.push(new d("updated")), e.push(new d("md5Hash", null, !0)), e.push(new d("cacheControl", null, !0)), e.push(new d("contentDisposition", null, !0)), e.push(new d("contentEncoding", null, !0)), e.push(new d("contentLanguage", null, !0)), e.push(new d("contentType", null, !0)), e.push(new d("metadata", "customMetadata", !0)), L = e, L;
|
839
|
+
}
|
840
|
+
function ft(e, t) {
|
841
|
+
function n() {
|
842
|
+
const s = e.bucket, r = e.fullPath, o = new _(s, r);
|
843
|
+
return t._makeStorageReference(o);
|
844
|
+
}
|
845
|
+
Object.defineProperty(e, "ref", { get: n });
|
846
|
+
}
|
847
|
+
function pt(e, t, n) {
|
848
|
+
const s = {};
|
849
|
+
s.type = "file";
|
850
|
+
const r = n.length;
|
851
|
+
for (let o = 0; o < r; o++) {
|
852
|
+
const i = n[o];
|
853
|
+
s[i.local] = i.xform(s, t[i.server]);
|
854
|
+
}
|
855
|
+
return ft(s, e), s;
|
856
|
+
}
|
857
|
+
function de(e, t, n) {
|
858
|
+
const s = ce(t);
|
859
|
+
return s === null ? null : pt(e, s, n);
|
860
|
+
}
|
861
|
+
function _t(e, t, n, s) {
|
862
|
+
const r = ce(t);
|
863
|
+
if (r === null || !q(r.downloadTokens))
|
864
|
+
return null;
|
865
|
+
const o = r.downloadTokens;
|
866
|
+
if (o.length === 0)
|
867
|
+
return null;
|
868
|
+
const i = encodeURIComponent;
|
869
|
+
return o.split(",").map((c) => {
|
870
|
+
const g = e.bucket, R = e.fullPath, m = "/b/" + i(g) + "/o/" + i(R), b = S(m, n, s), w = oe({
|
871
|
+
alt: "media",
|
872
|
+
token: c
|
873
|
+
});
|
874
|
+
return b + w;
|
875
|
+
})[0];
|
876
|
+
}
|
877
|
+
function gt(e, t) {
|
878
|
+
const n = {}, s = t.length;
|
879
|
+
for (let r = 0; r < s; r++) {
|
880
|
+
const o = t[r];
|
881
|
+
o.writable && (n[o.server] = e[o.local]);
|
882
|
+
}
|
883
|
+
return JSON.stringify(n);
|
884
|
+
}
|
885
|
+
class z {
|
886
|
+
constructor(t, n, s, r) {
|
887
|
+
this.url = t, this.method = n, this.handler = s, this.timeout = r, this.urlParams = {}, this.headers = {}, this.body = null, this.errorHandler = null, this.progressCallback = null, this.successCodes = [200], this.additionalRetryCodes = [];
|
888
|
+
}
|
889
|
+
}
|
890
|
+
/**
|
891
|
+
* @license
|
892
|
+
* Copyright 2017 Google LLC
|
893
|
+
*
|
894
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
895
|
+
* you may not use this file except in compliance with the License.
|
896
|
+
* You may obtain a copy of the License at
|
897
|
+
*
|
898
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
899
|
+
*
|
900
|
+
* Unless required by applicable law or agreed to in writing, software
|
901
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
902
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
903
|
+
* See the License for the specific language governing permissions and
|
904
|
+
* limitations under the License.
|
905
|
+
*/
|
906
|
+
function fe(e) {
|
907
|
+
if (!e)
|
908
|
+
throw j();
|
909
|
+
}
|
910
|
+
function mt(e, t) {
|
911
|
+
function n(s, r) {
|
912
|
+
const o = de(e, r, t);
|
913
|
+
return fe(o !== null), o;
|
914
|
+
}
|
915
|
+
return n;
|
916
|
+
}
|
917
|
+
function Rt(e, t) {
|
918
|
+
function n(s, r) {
|
919
|
+
const o = de(e, r, t);
|
920
|
+
return fe(o !== null), _t(o, r, e.host, e._protocol);
|
921
|
+
}
|
922
|
+
return n;
|
923
|
+
}
|
924
|
+
function pe(e) {
|
925
|
+
function t(n, s) {
|
926
|
+
let r;
|
927
|
+
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") ? r = Ce() : r = Pe() : n.getStatus() === 402 ? r = Ne(e.bucket) : n.getStatus() === 403 ? r = De(e.path) : r = s, r.status = n.getStatus(), r.serverResponse = s.serverResponse, r;
|
928
|
+
}
|
929
|
+
return t;
|
930
|
+
}
|
931
|
+
function _e(e) {
|
932
|
+
const t = pe(e);
|
933
|
+
function n(s, r) {
|
934
|
+
let o = t(s, r);
|
935
|
+
return s.getStatus() === 404 && (o = Ie(e.path)), o.serverResponse = r.serverResponse, o;
|
936
|
+
}
|
937
|
+
return n;
|
938
|
+
}
|
939
|
+
function bt(e, t, n) {
|
940
|
+
const s = t.fullServerUrl(), r = S(s, e.host, e._protocol), o = "GET", i = e.maxOperationRetryTime, a = new z(r, o, Rt(e, n), i);
|
941
|
+
return a.errorHandler = _e(t), a;
|
942
|
+
}
|
943
|
+
function wt(e, t) {
|
944
|
+
const n = t.fullServerUrl(), s = S(n, e.host, e._protocol), r = "DELETE", o = e.maxOperationRetryTime;
|
945
|
+
function i(u, c) {
|
946
|
+
}
|
947
|
+
const a = new z(s, r, i, o);
|
948
|
+
return a.successCodes = [200, 204], a.errorHandler = _e(t), a;
|
949
|
+
}
|
950
|
+
function Tt(e, t) {
|
951
|
+
return e && e.contentType || t && t.type() || "application/octet-stream";
|
952
|
+
}
|
953
|
+
function yt(e, t, n) {
|
954
|
+
const s = Object.assign({}, n);
|
955
|
+
return s.fullPath = e.path, s.size = t.size(), s.contentType || (s.contentType = Tt(null, t)), s;
|
956
|
+
}
|
957
|
+
function kt(e, t, n, s, r) {
|
958
|
+
const o = t.bucketOnlyServerUrl(), i = {
|
959
|
+
"X-Goog-Upload-Protocol": "multipart"
|
960
|
+
};
|
961
|
+
function a() {
|
962
|
+
let T = "";
|
963
|
+
for (let p = 0; p < 2; p++)
|
964
|
+
T = T + Math.random().toString().slice(2);
|
965
|
+
return T;
|
966
|
+
}
|
967
|
+
const u = a();
|
968
|
+
i["Content-Type"] = "multipart/related; boundary=" + u;
|
969
|
+
const c = yt(t, s, r), g = gt(c, n), R = "--" + u + `\r
|
970
|
+
Content-Type: application/json; charset=utf-8\r
|
971
|
+
\r
|
972
|
+
` + g + `\r
|
973
|
+
--` + u + `\r
|
974
|
+
Content-Type: ` + c.contentType + `\r
|
975
|
+
\r
|
976
|
+
`, m = `\r
|
977
|
+
--` + u + "--", b = k.getBlob(R, s, m);
|
978
|
+
if (b === null)
|
979
|
+
throw Fe();
|
980
|
+
const w = { name: c.fullPath }, O = S(o, e.host, e._protocol), f = "POST", I = e.maxUploadRetryTime, E = new z(O, f, mt(e, n), I);
|
981
|
+
return E.urlParams = w, E.headers = i, E.body = b.uploadData(), E.errorHandler = pe(t), E;
|
982
|
+
}
|
983
|
+
class Et {
|
984
|
+
constructor() {
|
985
|
+
this.sent_ = !1, this.xhr_ = new XMLHttpRequest(), this.initXhr(), this.errorCode_ = A.NO_ERROR, this.sendPromise_ = new Promise((t) => {
|
986
|
+
this.xhr_.addEventListener("abort", () => {
|
987
|
+
this.errorCode_ = A.ABORT, t();
|
988
|
+
}), this.xhr_.addEventListener("error", () => {
|
989
|
+
this.errorCode_ = A.NETWORK_ERROR, t();
|
990
|
+
}), this.xhr_.addEventListener("load", () => {
|
991
|
+
t();
|
992
|
+
});
|
993
|
+
});
|
994
|
+
}
|
995
|
+
send(t, n, s, r) {
|
996
|
+
if (this.sent_)
|
997
|
+
throw N("cannot .send() more than once");
|
998
|
+
if (this.sent_ = !0, this.xhr_.open(n, t, !0), r !== void 0)
|
999
|
+
for (const o in r)
|
1000
|
+
r.hasOwnProperty(o) && this.xhr_.setRequestHeader(o, r[o].toString());
|
1001
|
+
return s !== void 0 ? this.xhr_.send(s) : this.xhr_.send(), this.sendPromise_;
|
1002
|
+
}
|
1003
|
+
getErrorCode() {
|
1004
|
+
if (!this.sent_)
|
1005
|
+
throw N("cannot .getErrorCode() before sending");
|
1006
|
+
return this.errorCode_;
|
1007
|
+
}
|
1008
|
+
getStatus() {
|
1009
|
+
if (!this.sent_)
|
1010
|
+
throw N("cannot .getStatus() before sending");
|
1011
|
+
try {
|
1012
|
+
return this.xhr_.status;
|
1013
|
+
} catch {
|
1014
|
+
return -1;
|
1015
|
+
}
|
1016
|
+
}
|
1017
|
+
getResponse() {
|
1018
|
+
if (!this.sent_)
|
1019
|
+
throw N("cannot .getResponse() before sending");
|
1020
|
+
return this.xhr_.response;
|
1021
|
+
}
|
1022
|
+
getErrorText() {
|
1023
|
+
if (!this.sent_)
|
1024
|
+
throw N("cannot .getErrorText() before sending");
|
1025
|
+
return this.xhr_.statusText;
|
1026
|
+
}
|
1027
|
+
/** Aborts the request. */
|
1028
|
+
abort() {
|
1029
|
+
this.xhr_.abort();
|
1030
|
+
}
|
1031
|
+
getResponseHeader(t) {
|
1032
|
+
return this.xhr_.getResponseHeader(t);
|
1033
|
+
}
|
1034
|
+
addUploadProgressListener(t) {
|
1035
|
+
this.xhr_.upload != null && this.xhr_.upload.addEventListener("progress", t);
|
1036
|
+
}
|
1037
|
+
removeUploadProgressListener(t) {
|
1038
|
+
this.xhr_.upload != null && this.xhr_.upload.removeEventListener("progress", t);
|
1039
|
+
}
|
1040
|
+
}
|
1041
|
+
class At extends Et {
|
1042
|
+
initXhr() {
|
1043
|
+
this.xhr_.responseType = "text";
|
1044
|
+
}
|
1045
|
+
}
|
1046
|
+
function W() {
|
1047
|
+
return new At();
|
1048
|
+
}
|
1049
|
+
/**
|
1050
|
+
* @license
|
1051
|
+
* Copyright 2019 Google LLC
|
1052
|
+
*
|
1053
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
1054
|
+
* you may not use this file except in compliance with the License.
|
1055
|
+
* You may obtain a copy of the License at
|
1056
|
+
*
|
1057
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
1058
|
+
*
|
1059
|
+
* Unless required by applicable law or agreed to in writing, software
|
1060
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
1061
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1062
|
+
* See the License for the specific language governing permissions and
|
1063
|
+
* limitations under the License.
|
1064
|
+
*/
|
1065
|
+
class U {
|
1066
|
+
constructor(t, n) {
|
1067
|
+
this._service = t, n instanceof _ ? this._location = n : this._location = _.makeFromUrl(n, t.host);
|
1068
|
+
}
|
1069
|
+
/**
|
1070
|
+
* Returns the URL for the bucket and path this object references,
|
1071
|
+
* in the form gs://<bucket>/<object-path>
|
1072
|
+
* @override
|
1073
|
+
*/
|
1074
|
+
toString() {
|
1075
|
+
return "gs://" + this._location.bucket + "/" + this._location.path;
|
1076
|
+
}
|
1077
|
+
_newRef(t, n) {
|
1078
|
+
return new U(t, n);
|
1079
|
+
}
|
1080
|
+
/**
|
1081
|
+
* A reference to the root of this object's bucket.
|
1082
|
+
*/
|
1083
|
+
get root() {
|
1084
|
+
const t = new _(this._location.bucket, "");
|
1085
|
+
return this._newRef(this._service, t);
|
1086
|
+
}
|
1087
|
+
/**
|
1088
|
+
* The name of the bucket containing this reference's object.
|
1089
|
+
*/
|
1090
|
+
get bucket() {
|
1091
|
+
return this._location.bucket;
|
1092
|
+
}
|
1093
|
+
/**
|
1094
|
+
* The full path of this object.
|
1095
|
+
*/
|
1096
|
+
get fullPath() {
|
1097
|
+
return this._location.path;
|
1098
|
+
}
|
1099
|
+
/**
|
1100
|
+
* The short name of this object, which is the last component of the full path.
|
1101
|
+
* For example, if fullPath is 'full/path/image.png', name is 'image.png'.
|
1102
|
+
*/
|
1103
|
+
get name() {
|
1104
|
+
return le(this._location.path);
|
1105
|
+
}
|
1106
|
+
/**
|
1107
|
+
* The `StorageService` instance this `StorageReference` is associated with.
|
1108
|
+
*/
|
1109
|
+
get storage() {
|
1110
|
+
return this._service;
|
1111
|
+
}
|
1112
|
+
/**
|
1113
|
+
* A `StorageReference` pointing to the parent location of this `StorageReference`, or null if
|
1114
|
+
* this reference is the root.
|
1115
|
+
*/
|
1116
|
+
get parent() {
|
1117
|
+
const t = ct(this._location.path);
|
1118
|
+
if (t === null)
|
1119
|
+
return null;
|
1120
|
+
const n = new _(this._location.bucket, t);
|
1121
|
+
return new U(this._service, n);
|
1122
|
+
}
|
1123
|
+
/**
|
1124
|
+
* Utility function to throw an error in methods that do not accept a root reference.
|
1125
|
+
*/
|
1126
|
+
_throwIfRoot(t) {
|
1127
|
+
if (this._location.path === "")
|
1128
|
+
throw $e(t);
|
1129
|
+
}
|
1130
|
+
}
|
1131
|
+
function Ut(e, t, n) {
|
1132
|
+
e._throwIfRoot("uploadBytes");
|
1133
|
+
const s = kt(e.storage, e._location, he(), new k(t, !0), n);
|
1134
|
+
return e.storage.makeRequestWithTokens(s, W).then((r) => ({
|
1135
|
+
metadata: r,
|
1136
|
+
ref: e
|
1137
|
+
}));
|
1138
|
+
}
|
1139
|
+
function Ot(e) {
|
1140
|
+
e._throwIfRoot("getDownloadURL");
|
1141
|
+
const t = bt(e.storage, e._location, he());
|
1142
|
+
return e.storage.makeRequestWithTokens(t, W).then((n) => {
|
1143
|
+
if (n === null)
|
1144
|
+
throw Me();
|
1145
|
+
return n;
|
1146
|
+
});
|
1147
|
+
}
|
1148
|
+
function It(e) {
|
1149
|
+
e._throwIfRoot("deleteObject");
|
1150
|
+
const t = wt(e.storage, e._location);
|
1151
|
+
return e.storage.makeRequestWithTokens(t, W);
|
1152
|
+
}
|
1153
|
+
function Nt(e, t) {
|
1154
|
+
const n = lt(e._location.path, t), s = new _(e._location.bucket, n);
|
1155
|
+
return new U(e.storage, s);
|
1156
|
+
}
|
1157
|
+
/**
|
1158
|
+
* @license
|
1159
|
+
* Copyright 2017 Google LLC
|
1160
|
+
*
|
1161
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
1162
|
+
* you may not use this file except in compliance with the License.
|
1163
|
+
* You may obtain a copy of the License at
|
1164
|
+
*
|
1165
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
1166
|
+
*
|
1167
|
+
* Unless required by applicable law or agreed to in writing, software
|
1168
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
1169
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1170
|
+
* See the License for the specific language governing permissions and
|
1171
|
+
* limitations under the License.
|
1172
|
+
*/
|
1173
|
+
function Pt(e) {
|
1174
|
+
return /^[A-Za-z]+:\/\//.test(e);
|
1175
|
+
}
|
1176
|
+
function Ct(e, t) {
|
1177
|
+
return new U(e, t);
|
1178
|
+
}
|
1179
|
+
function ge(e, t) {
|
1180
|
+
if (e instanceof X) {
|
1181
|
+
const n = e;
|
1182
|
+
if (n._bucket == null)
|
1183
|
+
throw Be();
|
1184
|
+
const s = new U(n, n._bucket);
|
1185
|
+
return t != null ? ge(s, t) : s;
|
1186
|
+
} else
|
1187
|
+
return t !== void 0 ? Nt(e, t) : e;
|
1188
|
+
}
|
1189
|
+
function Dt(e, t) {
|
1190
|
+
if (t && Pt(t)) {
|
1191
|
+
if (e instanceof X)
|
1192
|
+
return Ct(e, t);
|
1193
|
+
throw $("To use ref(service, url), the first argument must be a Storage instance.");
|
1194
|
+
} else
|
1195
|
+
return ge(e, t);
|
1196
|
+
}
|
1197
|
+
function Z(e, t) {
|
1198
|
+
const n = t == null ? void 0 : t[se];
|
1199
|
+
return n == null ? null : _.makeFromBucketSpec(n, e);
|
1200
|
+
}
|
1201
|
+
function xt(e, t, n, s = {}) {
|
1202
|
+
e.host = `${t}:${n}`, e._protocol = "http";
|
1203
|
+
const { mockUserToken: r } = s;
|
1204
|
+
r && (e._overrideAuthToken = typeof r == "string" ? r : Ee(r, e.app.options.projectId));
|
1205
|
+
}
|
1206
|
+
class X {
|
1207
|
+
constructor(t, n, s, r, o) {
|
1208
|
+
this.app = t, this._authProvider = n, this._appCheckProvider = s, this._url = r, this._firebaseVersion = o, this._bucket = null, this._host = ne, this._protocol = "https", this._appId = null, this._deleted = !1, this._maxOperationRetryTime = Ue, this._maxUploadRetryTime = Oe, this._requests = /* @__PURE__ */ new Set(), r != null ? this._bucket = _.makeFromBucketSpec(r, this._host) : this._bucket = Z(this._host, this.app.options);
|
1209
|
+
}
|
1210
|
+
/**
|
1211
|
+
* The host string for this service, in the form of `host` or
|
1212
|
+
* `host:port`.
|
1213
|
+
*/
|
1214
|
+
get host() {
|
1215
|
+
return this._host;
|
1216
|
+
}
|
1217
|
+
set host(t) {
|
1218
|
+
this._host = t, this._url != null ? this._bucket = _.makeFromBucketSpec(this._url, t) : this._bucket = Z(t, this.app.options);
|
1219
|
+
}
|
1220
|
+
/**
|
1221
|
+
* The maximum time to retry uploads in milliseconds.
|
1222
|
+
*/
|
1223
|
+
get maxUploadRetryTime() {
|
1224
|
+
return this._maxUploadRetryTime;
|
1225
|
+
}
|
1226
|
+
set maxUploadRetryTime(t) {
|
1227
|
+
Y(
|
1228
|
+
"time",
|
1229
|
+
/* minValue=*/
|
1230
|
+
0,
|
1231
|
+
/* maxValue= */
|
1232
|
+
Number.POSITIVE_INFINITY,
|
1233
|
+
t
|
1234
|
+
), this._maxUploadRetryTime = t;
|
1235
|
+
}
|
1236
|
+
/**
|
1237
|
+
* The maximum time to retry operations other than uploads or downloads in
|
1238
|
+
* milliseconds.
|
1239
|
+
*/
|
1240
|
+
get maxOperationRetryTime() {
|
1241
|
+
return this._maxOperationRetryTime;
|
1242
|
+
}
|
1243
|
+
set maxOperationRetryTime(t) {
|
1244
|
+
Y(
|
1245
|
+
"time",
|
1246
|
+
/* minValue=*/
|
1247
|
+
0,
|
1248
|
+
/* maxValue= */
|
1249
|
+
Number.POSITIVE_INFINITY,
|
1250
|
+
t
|
1251
|
+
), this._maxOperationRetryTime = t;
|
1252
|
+
}
|
1253
|
+
async _getAuthToken() {
|
1254
|
+
if (this._overrideAuthToken)
|
1255
|
+
return this._overrideAuthToken;
|
1256
|
+
const t = this._authProvider.getImmediate({ optional: !0 });
|
1257
|
+
if (t) {
|
1258
|
+
const n = await t.getToken();
|
1259
|
+
if (n !== null)
|
1260
|
+
return n.accessToken;
|
1261
|
+
}
|
1262
|
+
return null;
|
1263
|
+
}
|
1264
|
+
async _getAppCheckToken() {
|
1265
|
+
const t = this._appCheckProvider.getImmediate({ optional: !0 });
|
1266
|
+
return t ? (await t.getToken()).token : null;
|
1267
|
+
}
|
1268
|
+
/**
|
1269
|
+
* Stop running requests and prevent more from being created.
|
1270
|
+
*/
|
1271
|
+
_delete() {
|
1272
|
+
return this._deleted || (this._deleted = !0, this._requests.forEach((t) => t.cancel()), this._requests.clear()), Promise.resolve();
|
1273
|
+
}
|
1274
|
+
/**
|
1275
|
+
* Returns a new firebaseStorage.Reference object referencing this StorageService
|
1276
|
+
* at the given Location.
|
1277
|
+
*/
|
1278
|
+
_makeStorageReference(t) {
|
1279
|
+
return new U(this, t);
|
1280
|
+
}
|
1281
|
+
/**
|
1282
|
+
* @param requestInfo - HTTP RequestInfo object
|
1283
|
+
* @param authToken - Firebase auth token
|
1284
|
+
*/
|
1285
|
+
_makeRequest(t, n, s, r, o = !0) {
|
1286
|
+
if (this._deleted)
|
1287
|
+
return new je(re());
|
1288
|
+
{
|
1289
|
+
const i = Qe(t, this._appId, s, r, n, this._firebaseVersion, o);
|
1290
|
+
return this._requests.add(i), i.getPromise().then(() => this._requests.delete(i), () => this._requests.delete(i)), i;
|
1291
|
+
}
|
1292
|
+
}
|
1293
|
+
async makeRequestWithTokens(t, n) {
|
1294
|
+
const [s, r] = await Promise.all([
|
1295
|
+
this._getAuthToken(),
|
1296
|
+
this._getAppCheckToken()
|
1297
|
+
]);
|
1298
|
+
return this._makeRequest(t, n, s, r).getPromise();
|
1299
|
+
}
|
1300
|
+
}
|
1301
|
+
const J = "@firebase/storage", Q = "0.13.2";
|
1302
|
+
/**
|
1303
|
+
* @license
|
1304
|
+
* Copyright 2020 Google LLC
|
1305
|
+
*
|
1306
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
1307
|
+
* you may not use this file except in compliance with the License.
|
1308
|
+
* You may obtain a copy of the License at
|
1309
|
+
*
|
1310
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
1311
|
+
*
|
1312
|
+
* Unless required by applicable law or agreed to in writing, software
|
1313
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
1314
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1315
|
+
* See the License for the specific language governing permissions and
|
1316
|
+
* limitations under the License.
|
1317
|
+
*/
|
1318
|
+
const me = "storage";
|
1319
|
+
function Lt(e, t, n) {
|
1320
|
+
return e = C(e), Ut(e, t, n);
|
1321
|
+
}
|
1322
|
+
function St(e) {
|
1323
|
+
return e = C(e), Ot(e);
|
1324
|
+
}
|
1325
|
+
function vt(e) {
|
1326
|
+
return e = C(e), It(e);
|
1327
|
+
}
|
1328
|
+
function ee(e, t) {
|
1329
|
+
return e = C(e), Dt(e, t);
|
1330
|
+
}
|
1331
|
+
function te(e = H(), t) {
|
1332
|
+
e = C(e);
|
1333
|
+
const s = Te(e, me).getImmediate({
|
1334
|
+
identifier: t
|
1335
|
+
}), r = ye("storage");
|
1336
|
+
return r && Bt(s, ...r), s;
|
1337
|
+
}
|
1338
|
+
function Bt(e, t, n, s = {}) {
|
1339
|
+
xt(e, t, n, s);
|
1340
|
+
}
|
1341
|
+
function Ft(e, { instanceIdentifier: t }) {
|
1342
|
+
const n = e.getProvider("app").getImmediate(), s = e.getProvider("auth-internal"), r = e.getProvider("app-check-internal");
|
1343
|
+
return new X(n, s, r, t, ke);
|
1344
|
+
}
|
1345
|
+
function Mt() {
|
1346
|
+
be(new we(
|
1347
|
+
me,
|
1348
|
+
Ft,
|
1349
|
+
"PUBLIC"
|
1350
|
+
/* ComponentType.PUBLIC */
|
1351
|
+
).setMultipleInstances(!0)), K(J, Q, ""), K(J, Q, "esm2017");
|
1352
|
+
}
|
1353
|
+
Mt();
|
1354
|
+
const $t = {
|
1355
|
+
async update(e, t, n) {
|
1356
|
+
const s = te(H(), n), r = ee(s, e);
|
1357
|
+
return await Lt(r, t), St(r);
|
1358
|
+
},
|
1359
|
+
async delete(e, t) {
|
1360
|
+
const n = te(H(), t), s = ee(n, e);
|
1361
|
+
await vt(s);
|
1362
|
+
}
|
1363
|
+
};
|
1364
|
+
export {
|
1365
|
+
$t as f
|
1366
|
+
};
|