tevrocsdk 0.1.32 → 0.1.34
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/README.md +153 -0
- package/package.json +1 -1
- package/tevroc-sdk.esm.js +263 -3488
- package/tevroc-sdk.min.js +1 -9
- package/tevroc-sdk.umd.js +266 -3491
package/tevroc-sdk.esm.js
CHANGED
|
@@ -8,9 +8,9 @@ var __esm = (fn, res, err) => function __init() {
|
|
|
8
8
|
throw err = [e], e;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
var __export = (target,
|
|
12
|
-
for (var name in
|
|
13
|
-
__defProp(target, name, { get:
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// src/services/usePlatform.js
|
|
@@ -47,7 +47,7 @@ var init_usePlatform = __esm({
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
// node_modules/@capacitor/core/dist/index.js
|
|
50
|
-
var ExceptionCode, CapacitorException, getPlatformId, createCapacitor, initCapacitorGlobal, Capacitor, registerPlugin, WebPlugin,
|
|
50
|
+
var ExceptionCode, CapacitorException, getPlatformId, createCapacitor, initCapacitorGlobal, Capacitor, registerPlugin, WebPlugin, encode, decode, CapacitorCookiesPluginWeb, CapacitorCookies, readBlobAsBase64, normalizeHttpHeaders, buildUrlParams, buildRequestInit, CapacitorHttpPluginWeb, CapacitorHttp, SystemBarsStyle, SystemBarType, SystemBarsPluginWeb, SystemBars;
|
|
51
51
|
var init_dist = __esm({
|
|
52
52
|
"node_modules/@capacitor/core/dist/index.js"() {
|
|
53
53
|
(function(ExceptionCode2) {
|
|
@@ -317,7 +317,7 @@ var init_dist = __esm({
|
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
|
-
|
|
320
|
+
encode = (str) => encodeURIComponent(str).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
321
321
|
decode = (str) => str.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
322
322
|
CapacitorCookiesPluginWeb = class extends WebPlugin {
|
|
323
323
|
async getCookies() {
|
|
@@ -335,8 +335,8 @@ var init_dist = __esm({
|
|
|
335
335
|
}
|
|
336
336
|
async setCookie(options) {
|
|
337
337
|
try {
|
|
338
|
-
const encodedKey =
|
|
339
|
-
const encodedValue =
|
|
338
|
+
const encodedKey = encode(options.key);
|
|
339
|
+
const encodedValue = encode(options.value);
|
|
340
340
|
const expires = options.expires ? `; expires=${options.expires.replace("expires=", "")}` : "";
|
|
341
341
|
const path = (options.path || "/").replace("path=", "");
|
|
342
342
|
const domain = options.url != null && options.url.length > 0 ? `domain=${options.url}` : "";
|
|
@@ -5029,9 +5029,9 @@ var init_webviewWindow = __esm({
|
|
|
5029
5029
|
// src/services/useGoogleAuth.js
|
|
5030
5030
|
var useGoogleAuth_exports = {};
|
|
5031
5031
|
__export(useGoogleAuth_exports, {
|
|
5032
|
-
createGoogleLogin: () =>
|
|
5032
|
+
createGoogleLogin: () => createGoogleLogin,
|
|
5033
5033
|
initializeGoogleLogin: () => initializeGoogleLogin,
|
|
5034
|
-
subscribeGoogleLogin: () =>
|
|
5034
|
+
subscribeGoogleLogin: () => subscribeGoogleLogin
|
|
5035
5035
|
});
|
|
5036
5036
|
function emitGoogleLogin(user, err = null) {
|
|
5037
5037
|
googleListeners.forEach((cb) => {
|
|
@@ -5042,14 +5042,14 @@ function emitGoogleLogin(user, err = null) {
|
|
|
5042
5042
|
}
|
|
5043
5043
|
});
|
|
5044
5044
|
}
|
|
5045
|
-
function
|
|
5045
|
+
function subscribeGoogleLogin(cb) {
|
|
5046
5046
|
googleListeners.push(cb);
|
|
5047
5047
|
return () => {
|
|
5048
5048
|
const i = googleListeners.indexOf(cb);
|
|
5049
5049
|
if (i !== -1) googleListeners.splice(i, 1);
|
|
5050
5050
|
};
|
|
5051
5051
|
}
|
|
5052
|
-
var googleInitialized, googleListeners, authWindowRef, handleCallback, initializeGoogleLogin,
|
|
5052
|
+
var googleInitialized, googleListeners, authWindowRef, authCleanupTimer, authMessageListener, cleanupAuthWindow, handleCallback, initializeGoogleLogin, createGoogleLogin;
|
|
5053
5053
|
var init_useGoogleAuth = __esm({
|
|
5054
5054
|
"src/services/useGoogleAuth.js"() {
|
|
5055
5055
|
init_esm2();
|
|
@@ -5059,8 +5059,58 @@ var init_useGoogleAuth = __esm({
|
|
|
5059
5059
|
googleInitialized = false;
|
|
5060
5060
|
googleListeners = [];
|
|
5061
5061
|
authWindowRef = null;
|
|
5062
|
+
authCleanupTimer = null;
|
|
5063
|
+
authMessageListener = null;
|
|
5064
|
+
cleanupAuthWindow = async () => {
|
|
5065
|
+
if (authCleanupTimer) {
|
|
5066
|
+
clearInterval(authCleanupTimer);
|
|
5067
|
+
authCleanupTimer = null;
|
|
5068
|
+
}
|
|
5069
|
+
if (authMessageListener && typeof window !== "undefined") {
|
|
5070
|
+
window.removeEventListener("message", authMessageListener);
|
|
5071
|
+
authMessageListener = null;
|
|
5072
|
+
}
|
|
5073
|
+
if (authWindowRef) {
|
|
5074
|
+
const currentAuthWindow = authWindowRef;
|
|
5075
|
+
authWindowRef = null;
|
|
5076
|
+
try {
|
|
5077
|
+
if (typeof currentAuthWindow?.close === "function") {
|
|
5078
|
+
await currentAuthWindow.close();
|
|
5079
|
+
}
|
|
5080
|
+
} catch (e) {
|
|
5081
|
+
console.warn("Error closing auth window:", e);
|
|
5082
|
+
}
|
|
5083
|
+
}
|
|
5084
|
+
if (isTauri) {
|
|
5085
|
+
try {
|
|
5086
|
+
const tauriAuthWindow = await WebviewWindow.getByLabel("auth");
|
|
5087
|
+
if (tauriAuthWindow && tauriAuthWindow !== authWindowRef) {
|
|
5088
|
+
await tauriAuthWindow.close();
|
|
5089
|
+
}
|
|
5090
|
+
} catch (e) {
|
|
5091
|
+
console.warn("Error closing Tauri auth window by label:", e);
|
|
5092
|
+
}
|
|
5093
|
+
}
|
|
5094
|
+
if (isCapacitor) {
|
|
5095
|
+
try {
|
|
5096
|
+
await Browser2.close();
|
|
5097
|
+
} catch (e) {
|
|
5098
|
+
console.warn("Error closing Capacitor browser:", e);
|
|
5099
|
+
}
|
|
5100
|
+
}
|
|
5101
|
+
if (typeof window !== "undefined" && window !== window.parent) {
|
|
5102
|
+
try {
|
|
5103
|
+
if (authWindowRef && typeof authWindowRef.close === "function") {
|
|
5104
|
+
await authWindowRef.close();
|
|
5105
|
+
}
|
|
5106
|
+
} catch (e) {
|
|
5107
|
+
console.warn("Error closing popup fallback:", e);
|
|
5108
|
+
}
|
|
5109
|
+
}
|
|
5110
|
+
};
|
|
5062
5111
|
handleCallback = async (url) => {
|
|
5063
5112
|
try {
|
|
5113
|
+
await cleanupAuthWindow();
|
|
5064
5114
|
if (!url?.includes("token=")) return;
|
|
5065
5115
|
const params = new URLSearchParams(url.split("?")[1]);
|
|
5066
5116
|
const token = params.get("token");
|
|
@@ -5106,18 +5156,11 @@ var init_useGoogleAuth = __esm({
|
|
|
5106
5156
|
url = url?.url || url?.payload || null;
|
|
5107
5157
|
}
|
|
5108
5158
|
if (!url) return;
|
|
5109
|
-
|
|
5110
|
-
try {
|
|
5111
|
-
await authWindowRef.close();
|
|
5112
|
-
authWindowRef = null;
|
|
5113
|
-
} catch (e) {
|
|
5114
|
-
}
|
|
5115
|
-
}
|
|
5116
|
-
handleCallback(url);
|
|
5159
|
+
await handleCallback(url);
|
|
5117
5160
|
});
|
|
5118
5161
|
}
|
|
5119
5162
|
};
|
|
5120
|
-
|
|
5163
|
+
createGoogleLogin = async ({
|
|
5121
5164
|
appId = "tevrocsoft",
|
|
5122
5165
|
appName = "Tevroc",
|
|
5123
5166
|
serviceUrl = "https://tevrocsoftapi.netlify.app"
|
|
@@ -5165,21 +5208,21 @@ var init_useGoogleAuth = __esm({
|
|
|
5165
5208
|
console.error("Popup blocked");
|
|
5166
5209
|
return;
|
|
5167
5210
|
}
|
|
5168
|
-
|
|
5169
|
-
|
|
5211
|
+
authWindowRef = popup;
|
|
5212
|
+
authMessageListener = async (event) => {
|
|
5213
|
+
const serviceOrigin = new URL(serviceUrl).origin;
|
|
5214
|
+
if (event.origin !== serviceOrigin) return;
|
|
5170
5215
|
if (event.data?.type === "google-auth") {
|
|
5171
5216
|
const token = event.data?.token || null;
|
|
5172
5217
|
const url = token ? `${window.location.href}${window.location.href.includes("?") ? "&" : "?"}token=${token}` : window.location.href;
|
|
5173
|
-
|
|
5174
|
-
window.removeEventListener("message", listener);
|
|
5175
|
-
handleCallback(url);
|
|
5218
|
+
await handleCallback(url);
|
|
5176
5219
|
}
|
|
5177
5220
|
};
|
|
5178
|
-
window.addEventListener("message",
|
|
5179
|
-
|
|
5221
|
+
window.addEventListener("message", authMessageListener);
|
|
5222
|
+
authCleanupTimer = setInterval(() => {
|
|
5180
5223
|
if (popup.closed) {
|
|
5181
|
-
|
|
5182
|
-
|
|
5224
|
+
cleanupAuthWindow().catch(() => {
|
|
5225
|
+
});
|
|
5183
5226
|
}
|
|
5184
5227
|
}, 500);
|
|
5185
5228
|
return;
|
|
@@ -5189,13 +5232,6 @@ var init_useGoogleAuth = __esm({
|
|
|
5189
5232
|
});
|
|
5190
5233
|
|
|
5191
5234
|
// src/services/useYocoPayment.js
|
|
5192
|
-
var useYocoPayment_exports = {};
|
|
5193
|
-
__export(useYocoPayment_exports, {
|
|
5194
|
-
createPayment: () => createPayment,
|
|
5195
|
-
default: () => PaymentHandler,
|
|
5196
|
-
initializePayment: () => initializePayment,
|
|
5197
|
-
subscribePaymentStatus: () => subscribePaymentStatus2
|
|
5198
|
-
});
|
|
5199
5235
|
function emitPaymentStatus(status, err = null) {
|
|
5200
5236
|
paymentStatusListeners.forEach((cb) => {
|
|
5201
5237
|
try {
|
|
@@ -5205,22 +5241,13 @@ function emitPaymentStatus(status, err = null) {
|
|
|
5205
5241
|
}
|
|
5206
5242
|
});
|
|
5207
5243
|
}
|
|
5208
|
-
function
|
|
5244
|
+
function subscribePaymentStatus(cb) {
|
|
5209
5245
|
paymentStatusListeners.push(cb);
|
|
5210
5246
|
return () => {
|
|
5211
5247
|
const i = paymentStatusListeners.indexOf(cb);
|
|
5212
5248
|
if (i !== -1) paymentStatusListeners.splice(i, 1);
|
|
5213
5249
|
};
|
|
5214
5250
|
}
|
|
5215
|
-
function PaymentHandler({
|
|
5216
|
-
externalCallback = () => {
|
|
5217
|
-
}
|
|
5218
|
-
} = {}) {
|
|
5219
|
-
initializePayment(externalCallback);
|
|
5220
|
-
return {
|
|
5221
|
-
createPayment
|
|
5222
|
-
};
|
|
5223
|
-
}
|
|
5224
5251
|
var paymentInitialized, paymentStatusListeners, paymentWindowRef, logs, addLog, handlePaymentCallback, initializePayment, createPayment;
|
|
5225
5252
|
var init_useYocoPayment = __esm({
|
|
5226
5253
|
"src/services/useYocoPayment.js"() {
|
|
@@ -5246,3412 +5273,148 @@ var init_useYocoPayment = __esm({
|
|
|
5246
5273
|
}) => {
|
|
5247
5274
|
try {
|
|
5248
5275
|
addLog("PAYMENT CALLBACK:", url);
|
|
5249
|
-
if (!url?.includes("
|
|
5276
|
+
if (!url?.includes("status=")) return;
|
|
5250
5277
|
const params = new URLSearchParams(url.split("?")[1]);
|
|
5251
|
-
const
|
|
5252
|
-
addLog("PAYMENT RESULT:",
|
|
5253
|
-
if (
|
|
5278
|
+
const status = params.get("status");
|
|
5279
|
+
addLog("PAYMENT RESULT:", status);
|
|
5280
|
+
if (status == "success") {
|
|
5254
5281
|
addLog("PAYMENT SUCCESS");
|
|
5255
|
-
} else {
|
|
5256
|
-
addLog("PAYMENT FAILED");
|
|
5257
|
-
}
|
|
5258
|
-
externalCallback(state, null);
|
|
5259
|
-
emitPaymentStatus(state, null);
|
|
5260
|
-
} catch (err) {
|
|
5261
|
-
addLog("PAYMENT CALLBACK ERROR:", err.message);
|
|
5262
|
-
externalCallback(null, err);
|
|
5263
|
-
emitPaymentStatus(null, err);
|
|
5264
|
-
}
|
|
5265
|
-
};
|
|
5266
|
-
initializePayment = async (externalCallback = () => {
|
|
5267
|
-
}) => {
|
|
5268
|
-
if (paymentInitialized) return;
|
|
5269
|
-
paymentInitialized = true;
|
|
5270
|
-
if (isCapacitor) {
|
|
5271
|
-
App.addListener("appUrlOpen", (event) => {
|
|
5272
|
-
handlePaymentCallback(
|
|
5273
|
-
event.url,
|
|
5274
|
-
externalCallback
|
|
5275
|
-
);
|
|
5276
|
-
});
|
|
5277
|
-
}
|
|
5278
|
-
if (isTauri) {
|
|
5279
|
-
const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
|
|
5280
|
-
await listen2("deep-link://open-url", async (event) => {
|
|
5281
|
-
let url = event.payload;
|
|
5282
|
-
if (typeof url === "object") {
|
|
5283
|
-
url = url?.url || url?.payload || null;
|
|
5284
|
-
}
|
|
5285
|
-
if (!url) return;
|
|
5286
|
-
if (paymentWindowRef) {
|
|
5287
|
-
try {
|
|
5288
|
-
await paymentWindowRef.close();
|
|
5289
|
-
paymentWindowRef = null;
|
|
5290
|
-
} catch (e) {
|
|
5291
|
-
}
|
|
5292
|
-
}
|
|
5293
|
-
handlePaymentCallback(
|
|
5294
|
-
url,
|
|
5295
|
-
externalCallback
|
|
5296
|
-
);
|
|
5297
|
-
});
|
|
5298
|
-
}
|
|
5299
|
-
};
|
|
5300
|
-
createPayment = async (amountZAR, {
|
|
5301
|
-
appId = "tevrocsoft",
|
|
5302
|
-
serviceUrl = "https://tevrocsoftapi.netlify.app",
|
|
5303
|
-
externalCallback = () => {
|
|
5304
|
-
}
|
|
5305
|
-
} = {}) => {
|
|
5306
|
-
await initializePayment(externalCallback);
|
|
5307
|
-
const cents = Math.round(Number(amountZAR) * 100);
|
|
5308
|
-
const basePaymentUrl = `${serviceUrl}/pay`;
|
|
5309
|
-
const paymentUrl = `${basePaymentUrl}?mode=mobile&amount=${cents}&app=${appId}`;
|
|
5310
|
-
if (isCapacitor) {
|
|
5311
|
-
await Browser2.open({
|
|
5312
|
-
url: paymentUrl
|
|
5313
|
-
});
|
|
5314
|
-
return;
|
|
5315
|
-
}
|
|
5316
|
-
if (isTauri) {
|
|
5317
|
-
const url = `${basePaymentUrl}?mode=desktop&amount=${cents}&app=${appId}`;
|
|
5318
|
-
const win = new WebviewWindow("payment", {
|
|
5319
|
-
url,
|
|
5320
|
-
title: "Complete Payment",
|
|
5321
|
-
width: 550,
|
|
5322
|
-
height: 600,
|
|
5323
|
-
resizable: true,
|
|
5324
|
-
center: true
|
|
5325
|
-
});
|
|
5326
|
-
paymentWindowRef = win;
|
|
5327
|
-
win.once("tauri://created", () => {
|
|
5328
|
-
console.log("Payment window opened");
|
|
5329
|
-
});
|
|
5330
|
-
win.once("tauri://error", (e) => {
|
|
5331
|
-
console.error("Payment window error:", e);
|
|
5332
|
-
});
|
|
5333
|
-
return;
|
|
5334
|
-
}
|
|
5335
|
-
const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
|
|
5336
|
-
const mode = isLocalhost ? "localhost" : "netlify";
|
|
5337
|
-
window.location.href = `${basePaymentUrl}?mode=${mode}&amount=${cents}&app=${appId}`;
|
|
5338
|
-
};
|
|
5339
|
-
}
|
|
5340
|
-
});
|
|
5341
|
-
|
|
5342
|
-
// node_modules/axios/lib/helpers/bind.js
|
|
5343
|
-
function bind(fn, thisArg) {
|
|
5344
|
-
return function wrap() {
|
|
5345
|
-
return fn.apply(thisArg, arguments);
|
|
5346
|
-
};
|
|
5347
|
-
}
|
|
5348
|
-
|
|
5349
|
-
// node_modules/axios/lib/utils.js
|
|
5350
|
-
var { toString } = Object.prototype;
|
|
5351
|
-
var { getPrototypeOf } = Object;
|
|
5352
|
-
var { iterator, toStringTag } = Symbol;
|
|
5353
|
-
var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
5354
|
-
var hasOwnInPrototypeChain = (thing, prop) => {
|
|
5355
|
-
let obj = thing;
|
|
5356
|
-
const seen = [];
|
|
5357
|
-
while (obj != null && obj !== Object.prototype) {
|
|
5358
|
-
if (seen.indexOf(obj) !== -1) {
|
|
5359
|
-
return false;
|
|
5360
|
-
}
|
|
5361
|
-
seen.push(obj);
|
|
5362
|
-
if (hasOwnProperty(obj, prop)) {
|
|
5363
|
-
return true;
|
|
5364
|
-
}
|
|
5365
|
-
obj = getPrototypeOf(obj);
|
|
5366
|
-
}
|
|
5367
|
-
return false;
|
|
5368
|
-
};
|
|
5369
|
-
var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
|
|
5370
|
-
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
5371
|
-
const str = toString.call(thing);
|
|
5372
|
-
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
5373
|
-
})(/* @__PURE__ */ Object.create(null));
|
|
5374
|
-
var kindOfTest = (type) => {
|
|
5375
|
-
type = type.toLowerCase();
|
|
5376
|
-
return (thing) => kindOf(thing) === type;
|
|
5377
|
-
};
|
|
5378
|
-
var typeOfTest = (type) => (thing) => typeof thing === type;
|
|
5379
|
-
var { isArray } = Array;
|
|
5380
|
-
var isUndefined = typeOfTest("undefined");
|
|
5381
|
-
function isBuffer(val) {
|
|
5382
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
5383
|
-
}
|
|
5384
|
-
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
5385
|
-
function isArrayBufferView(val) {
|
|
5386
|
-
let result;
|
|
5387
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
5388
|
-
result = ArrayBuffer.isView(val);
|
|
5389
|
-
} else {
|
|
5390
|
-
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
5391
|
-
}
|
|
5392
|
-
return result;
|
|
5393
|
-
}
|
|
5394
|
-
var isString = typeOfTest("string");
|
|
5395
|
-
var isFunction = typeOfTest("function");
|
|
5396
|
-
var isNumber = typeOfTest("number");
|
|
5397
|
-
var isObject = (thing) => thing !== null && typeof thing === "object";
|
|
5398
|
-
var isBoolean = (thing) => thing === true || thing === false;
|
|
5399
|
-
var isPlainObject = (val) => {
|
|
5400
|
-
if (!isObject(val)) {
|
|
5401
|
-
return false;
|
|
5402
|
-
}
|
|
5403
|
-
const prototype2 = getPrototypeOf(val);
|
|
5404
|
-
return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
|
|
5405
|
-
// Symbol.iterator as evidence the value is a tagged/iterable type rather
|
|
5406
|
-
// than a plain object, while ignoring keys injected onto Object.prototype.
|
|
5407
|
-
!hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
|
|
5408
|
-
};
|
|
5409
|
-
var isEmptyObject = (val) => {
|
|
5410
|
-
if (!isObject(val) || isBuffer(val)) {
|
|
5411
|
-
return false;
|
|
5412
|
-
}
|
|
5413
|
-
try {
|
|
5414
|
-
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
5415
|
-
} catch (e) {
|
|
5416
|
-
return false;
|
|
5417
|
-
}
|
|
5418
|
-
};
|
|
5419
|
-
var isDate = kindOfTest("Date");
|
|
5420
|
-
var isFile = kindOfTest("File");
|
|
5421
|
-
var isReactNativeBlob = (value) => {
|
|
5422
|
-
return !!(value && typeof value.uri !== "undefined");
|
|
5423
|
-
};
|
|
5424
|
-
var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
|
|
5425
|
-
var isBlob = kindOfTest("Blob");
|
|
5426
|
-
var isFileList = kindOfTest("FileList");
|
|
5427
|
-
var isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
5428
|
-
function getGlobal() {
|
|
5429
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
5430
|
-
if (typeof self !== "undefined") return self;
|
|
5431
|
-
if (typeof window !== "undefined") return window;
|
|
5432
|
-
if (typeof global !== "undefined") return global;
|
|
5433
|
-
return {};
|
|
5434
|
-
}
|
|
5435
|
-
var G = getGlobal();
|
|
5436
|
-
var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
|
|
5437
|
-
var isFormData = (thing) => {
|
|
5438
|
-
if (!thing) return false;
|
|
5439
|
-
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
5440
|
-
const proto = getPrototypeOf(thing);
|
|
5441
|
-
if (!proto || proto === Object.prototype) return false;
|
|
5442
|
-
if (!isFunction(thing.append)) return false;
|
|
5443
|
-
const kind = kindOf(thing);
|
|
5444
|
-
return kind === "formdata" || // detect form-data instance
|
|
5445
|
-
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]";
|
|
5446
|
-
};
|
|
5447
|
-
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
5448
|
-
var [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
5449
|
-
"ReadableStream",
|
|
5450
|
-
"Request",
|
|
5451
|
-
"Response",
|
|
5452
|
-
"Headers"
|
|
5453
|
-
].map(kindOfTest);
|
|
5454
|
-
var trim = (str) => {
|
|
5455
|
-
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
5456
|
-
};
|
|
5457
|
-
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
5458
|
-
if (obj === null || typeof obj === "undefined") {
|
|
5459
|
-
return;
|
|
5460
|
-
}
|
|
5461
|
-
let i;
|
|
5462
|
-
let l;
|
|
5463
|
-
if (typeof obj !== "object") {
|
|
5464
|
-
obj = [obj];
|
|
5465
|
-
}
|
|
5466
|
-
if (isArray(obj)) {
|
|
5467
|
-
for (i = 0, l = obj.length; i < l; i++) {
|
|
5468
|
-
fn.call(null, obj[i], i, obj);
|
|
5469
|
-
}
|
|
5470
|
-
} else {
|
|
5471
|
-
if (isBuffer(obj)) {
|
|
5472
|
-
return;
|
|
5473
|
-
}
|
|
5474
|
-
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
5475
|
-
const len = keys.length;
|
|
5476
|
-
let key;
|
|
5477
|
-
for (i = 0; i < len; i++) {
|
|
5478
|
-
key = keys[i];
|
|
5479
|
-
fn.call(null, obj[key], key, obj);
|
|
5480
|
-
}
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
5483
|
-
function findKey(obj, key) {
|
|
5484
|
-
if (isBuffer(obj)) {
|
|
5485
|
-
return null;
|
|
5486
|
-
}
|
|
5487
|
-
key = key.toLowerCase();
|
|
5488
|
-
const keys = Object.keys(obj);
|
|
5489
|
-
let i = keys.length;
|
|
5490
|
-
let _key;
|
|
5491
|
-
while (i-- > 0) {
|
|
5492
|
-
_key = keys[i];
|
|
5493
|
-
if (key === _key.toLowerCase()) {
|
|
5494
|
-
return _key;
|
|
5495
|
-
}
|
|
5496
|
-
}
|
|
5497
|
-
return null;
|
|
5498
|
-
}
|
|
5499
|
-
var _global = (() => {
|
|
5500
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
5501
|
-
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
5502
|
-
})();
|
|
5503
|
-
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
5504
|
-
function merge(...objs) {
|
|
5505
|
-
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
5506
|
-
const result = {};
|
|
5507
|
-
const assignValue = (val, key) => {
|
|
5508
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
5509
|
-
return;
|
|
5510
|
-
}
|
|
5511
|
-
const targetKey = caseless && typeof key === "string" && findKey(result, key) || key;
|
|
5512
|
-
const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
|
|
5513
|
-
if (isPlainObject(existing) && isPlainObject(val)) {
|
|
5514
|
-
result[targetKey] = merge(existing, val);
|
|
5515
|
-
} else if (isPlainObject(val)) {
|
|
5516
|
-
result[targetKey] = merge({}, val);
|
|
5517
|
-
} else if (isArray(val)) {
|
|
5518
|
-
result[targetKey] = val.slice();
|
|
5519
|
-
} else if (!skipUndefined || !isUndefined(val)) {
|
|
5520
|
-
result[targetKey] = val;
|
|
5521
|
-
}
|
|
5522
|
-
};
|
|
5523
|
-
for (let i = 0, l = objs.length; i < l; i++) {
|
|
5524
|
-
const source = objs[i];
|
|
5525
|
-
if (!source || isBuffer(source)) {
|
|
5526
|
-
continue;
|
|
5527
|
-
}
|
|
5528
|
-
forEach(source, assignValue);
|
|
5529
|
-
if (typeof source !== "object" || isArray(source)) {
|
|
5530
|
-
continue;
|
|
5531
|
-
}
|
|
5532
|
-
const symbols = Object.getOwnPropertySymbols(source);
|
|
5533
|
-
for (let j = 0; j < symbols.length; j++) {
|
|
5534
|
-
const symbol = symbols[j];
|
|
5535
|
-
if (propertyIsEnumerable.call(source, symbol)) {
|
|
5536
|
-
assignValue(source[symbol], symbol);
|
|
5537
|
-
}
|
|
5538
|
-
}
|
|
5539
|
-
}
|
|
5540
|
-
return result;
|
|
5541
|
-
}
|
|
5542
|
-
var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
5543
|
-
forEach(
|
|
5544
|
-
b,
|
|
5545
|
-
(val, key) => {
|
|
5546
|
-
if (thisArg && isFunction(val)) {
|
|
5547
|
-
Object.defineProperty(a, key, {
|
|
5548
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
5549
|
-
// hijack defineProperty's accessor-vs-data resolution.
|
|
5550
|
-
__proto__: null,
|
|
5551
|
-
value: bind(val, thisArg),
|
|
5552
|
-
writable: true,
|
|
5553
|
-
enumerable: true,
|
|
5554
|
-
configurable: true
|
|
5555
|
-
});
|
|
5556
|
-
} else {
|
|
5557
|
-
Object.defineProperty(a, key, {
|
|
5558
|
-
__proto__: null,
|
|
5559
|
-
value: val,
|
|
5560
|
-
writable: true,
|
|
5561
|
-
enumerable: true,
|
|
5562
|
-
configurable: true
|
|
5563
|
-
});
|
|
5564
|
-
}
|
|
5565
|
-
},
|
|
5566
|
-
{ allOwnKeys }
|
|
5567
|
-
);
|
|
5568
|
-
return a;
|
|
5569
|
-
};
|
|
5570
|
-
var stripBOM = (content) => {
|
|
5571
|
-
if (content.charCodeAt(0) === 65279) {
|
|
5572
|
-
content = content.slice(1);
|
|
5573
|
-
}
|
|
5574
|
-
return content;
|
|
5575
|
-
};
|
|
5576
|
-
var inherits = (constructor, superConstructor, props, descriptors) => {
|
|
5577
|
-
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
5578
|
-
Object.defineProperty(constructor.prototype, "constructor", {
|
|
5579
|
-
__proto__: null,
|
|
5580
|
-
value: constructor,
|
|
5581
|
-
writable: true,
|
|
5582
|
-
enumerable: false,
|
|
5583
|
-
configurable: true
|
|
5584
|
-
});
|
|
5585
|
-
Object.defineProperty(constructor, "super", {
|
|
5586
|
-
__proto__: null,
|
|
5587
|
-
value: superConstructor.prototype
|
|
5588
|
-
});
|
|
5589
|
-
props && Object.assign(constructor.prototype, props);
|
|
5590
|
-
};
|
|
5591
|
-
var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
|
|
5592
|
-
let props;
|
|
5593
|
-
let i;
|
|
5594
|
-
let prop;
|
|
5595
|
-
const merged = {};
|
|
5596
|
-
destObj = destObj || {};
|
|
5597
|
-
if (sourceObj == null) return destObj;
|
|
5598
|
-
do {
|
|
5599
|
-
props = Object.getOwnPropertyNames(sourceObj);
|
|
5600
|
-
i = props.length;
|
|
5601
|
-
while (i-- > 0) {
|
|
5602
|
-
prop = props[i];
|
|
5603
|
-
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
5604
|
-
destObj[prop] = sourceObj[prop];
|
|
5605
|
-
merged[prop] = true;
|
|
5606
|
-
}
|
|
5607
|
-
}
|
|
5608
|
-
sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
|
|
5609
|
-
} while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
5610
|
-
return destObj;
|
|
5611
|
-
};
|
|
5612
|
-
var endsWith = (str, searchString, position) => {
|
|
5613
|
-
str = String(str);
|
|
5614
|
-
if (position === void 0 || position > str.length) {
|
|
5615
|
-
position = str.length;
|
|
5616
|
-
}
|
|
5617
|
-
position -= searchString.length;
|
|
5618
|
-
const lastIndex = str.indexOf(searchString, position);
|
|
5619
|
-
return lastIndex !== -1 && lastIndex === position;
|
|
5620
|
-
};
|
|
5621
|
-
var toArray = (thing) => {
|
|
5622
|
-
if (!thing) return null;
|
|
5623
|
-
if (isArray(thing)) return thing;
|
|
5624
|
-
let i = thing.length;
|
|
5625
|
-
if (!isNumber(i)) return null;
|
|
5626
|
-
const arr = new Array(i);
|
|
5627
|
-
while (i-- > 0) {
|
|
5628
|
-
arr[i] = thing[i];
|
|
5629
|
-
}
|
|
5630
|
-
return arr;
|
|
5631
|
-
};
|
|
5632
|
-
var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
5633
|
-
return (thing) => {
|
|
5634
|
-
return TypedArray && thing instanceof TypedArray;
|
|
5635
|
-
};
|
|
5636
|
-
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
5637
|
-
var forEachEntry = (obj, fn) => {
|
|
5638
|
-
const generator = obj && obj[iterator];
|
|
5639
|
-
const _iterator = generator.call(obj);
|
|
5640
|
-
let result;
|
|
5641
|
-
while ((result = _iterator.next()) && !result.done) {
|
|
5642
|
-
const pair = result.value;
|
|
5643
|
-
fn.call(obj, pair[0], pair[1]);
|
|
5644
|
-
}
|
|
5645
|
-
};
|
|
5646
|
-
var matchAll = (regExp, str) => {
|
|
5647
|
-
let matches;
|
|
5648
|
-
const arr = [];
|
|
5649
|
-
while ((matches = regExp.exec(str)) !== null) {
|
|
5650
|
-
arr.push(matches);
|
|
5651
|
-
}
|
|
5652
|
-
return arr;
|
|
5653
|
-
};
|
|
5654
|
-
var isHTMLForm = kindOfTest("HTMLFormElement");
|
|
5655
|
-
var toCamelCase = (str) => {
|
|
5656
|
-
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
5657
|
-
return p1.toUpperCase() + p2;
|
|
5658
|
-
});
|
|
5659
|
-
};
|
|
5660
|
-
var { propertyIsEnumerable } = Object.prototype;
|
|
5661
|
-
var isRegExp = kindOfTest("RegExp");
|
|
5662
|
-
var reduceDescriptors = (obj, reducer) => {
|
|
5663
|
-
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
5664
|
-
const reducedDescriptors = {};
|
|
5665
|
-
forEach(descriptors, (descriptor, name) => {
|
|
5666
|
-
let ret;
|
|
5667
|
-
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
5668
|
-
reducedDescriptors[name] = ret || descriptor;
|
|
5669
|
-
}
|
|
5670
|
-
});
|
|
5671
|
-
Object.defineProperties(obj, reducedDescriptors);
|
|
5672
|
-
};
|
|
5673
|
-
var freezeMethods = (obj) => {
|
|
5674
|
-
reduceDescriptors(obj, (descriptor, name) => {
|
|
5675
|
-
if (isFunction(obj) && ["arguments", "caller", "callee"].includes(name)) {
|
|
5676
|
-
return false;
|
|
5677
|
-
}
|
|
5678
|
-
const value = obj[name];
|
|
5679
|
-
if (!isFunction(value)) return;
|
|
5680
|
-
descriptor.enumerable = false;
|
|
5681
|
-
if ("writable" in descriptor) {
|
|
5682
|
-
descriptor.writable = false;
|
|
5683
|
-
return;
|
|
5684
|
-
}
|
|
5685
|
-
if (!descriptor.set) {
|
|
5686
|
-
descriptor.set = () => {
|
|
5687
|
-
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
5688
|
-
};
|
|
5689
|
-
}
|
|
5690
|
-
});
|
|
5691
|
-
};
|
|
5692
|
-
var toObjectSet = (arrayOrString, delimiter) => {
|
|
5693
|
-
const obj = {};
|
|
5694
|
-
const define = (arr) => {
|
|
5695
|
-
arr.forEach((value) => {
|
|
5696
|
-
obj[value] = true;
|
|
5697
|
-
});
|
|
5698
|
-
};
|
|
5699
|
-
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
5700
|
-
return obj;
|
|
5701
|
-
};
|
|
5702
|
-
var noop = () => {
|
|
5703
|
-
};
|
|
5704
|
-
var toFiniteNumber = (value, defaultValue) => {
|
|
5705
|
-
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
5706
|
-
};
|
|
5707
|
-
function isSpecCompliantForm(thing) {
|
|
5708
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
5709
|
-
}
|
|
5710
|
-
var toJSONObject = (obj) => {
|
|
5711
|
-
const visited = /* @__PURE__ */ new WeakSet();
|
|
5712
|
-
const visit = (source) => {
|
|
5713
|
-
if (isObject(source)) {
|
|
5714
|
-
if (visited.has(source)) {
|
|
5715
|
-
return;
|
|
5716
|
-
}
|
|
5717
|
-
if (isBuffer(source)) {
|
|
5718
|
-
return source;
|
|
5719
|
-
}
|
|
5720
|
-
if (!("toJSON" in source)) {
|
|
5721
|
-
visited.add(source);
|
|
5722
|
-
const target = isArray(source) ? [] : {};
|
|
5723
|
-
forEach(source, (value, key) => {
|
|
5724
|
-
const reducedValue = visit(value);
|
|
5725
|
-
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
5726
|
-
});
|
|
5727
|
-
visited.delete(source);
|
|
5728
|
-
return target;
|
|
5729
|
-
}
|
|
5730
|
-
}
|
|
5731
|
-
return source;
|
|
5732
|
-
};
|
|
5733
|
-
return visit(obj);
|
|
5734
|
-
};
|
|
5735
|
-
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
5736
|
-
var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
5737
|
-
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
5738
|
-
if (setImmediateSupported) {
|
|
5739
|
-
return setImmediate;
|
|
5740
|
-
}
|
|
5741
|
-
return postMessageSupported ? ((token, callbacks) => {
|
|
5742
|
-
_global.addEventListener(
|
|
5743
|
-
"message",
|
|
5744
|
-
({ source, data }) => {
|
|
5745
|
-
if (source === _global && data === token) {
|
|
5746
|
-
callbacks.length && callbacks.shift()();
|
|
5747
|
-
}
|
|
5748
|
-
},
|
|
5749
|
-
false
|
|
5750
|
-
);
|
|
5751
|
-
return (cb) => {
|
|
5752
|
-
callbacks.push(cb);
|
|
5753
|
-
_global.postMessage(token, "*");
|
|
5754
|
-
};
|
|
5755
|
-
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
5756
|
-
})(typeof setImmediate === "function", isFunction(_global.postMessage));
|
|
5757
|
-
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
5758
|
-
var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
5759
|
-
var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
|
|
5760
|
-
var utils_default = {
|
|
5761
|
-
isArray,
|
|
5762
|
-
isArrayBuffer,
|
|
5763
|
-
isBuffer,
|
|
5764
|
-
isFormData,
|
|
5765
|
-
isArrayBufferView,
|
|
5766
|
-
isString,
|
|
5767
|
-
isNumber,
|
|
5768
|
-
isBoolean,
|
|
5769
|
-
isObject,
|
|
5770
|
-
isPlainObject,
|
|
5771
|
-
isEmptyObject,
|
|
5772
|
-
isReadableStream,
|
|
5773
|
-
isRequest,
|
|
5774
|
-
isResponse,
|
|
5775
|
-
isHeaders,
|
|
5776
|
-
isUndefined,
|
|
5777
|
-
isDate,
|
|
5778
|
-
isFile,
|
|
5779
|
-
isReactNativeBlob,
|
|
5780
|
-
isReactNative,
|
|
5781
|
-
isBlob,
|
|
5782
|
-
isRegExp,
|
|
5783
|
-
isFunction,
|
|
5784
|
-
isStream,
|
|
5785
|
-
isURLSearchParams,
|
|
5786
|
-
isTypedArray,
|
|
5787
|
-
isFileList,
|
|
5788
|
-
forEach,
|
|
5789
|
-
merge,
|
|
5790
|
-
extend,
|
|
5791
|
-
trim,
|
|
5792
|
-
stripBOM,
|
|
5793
|
-
inherits,
|
|
5794
|
-
toFlatObject,
|
|
5795
|
-
kindOf,
|
|
5796
|
-
kindOfTest,
|
|
5797
|
-
endsWith,
|
|
5798
|
-
toArray,
|
|
5799
|
-
forEachEntry,
|
|
5800
|
-
matchAll,
|
|
5801
|
-
isHTMLForm,
|
|
5802
|
-
hasOwnProperty,
|
|
5803
|
-
hasOwnProp: hasOwnProperty,
|
|
5804
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
|
5805
|
-
hasOwnInPrototypeChain,
|
|
5806
|
-
getSafeProp,
|
|
5807
|
-
reduceDescriptors,
|
|
5808
|
-
freezeMethods,
|
|
5809
|
-
toObjectSet,
|
|
5810
|
-
toCamelCase,
|
|
5811
|
-
noop,
|
|
5812
|
-
toFiniteNumber,
|
|
5813
|
-
findKey,
|
|
5814
|
-
global: _global,
|
|
5815
|
-
isContextDefined,
|
|
5816
|
-
isSpecCompliantForm,
|
|
5817
|
-
toJSONObject,
|
|
5818
|
-
isAsyncFn,
|
|
5819
|
-
isThenable,
|
|
5820
|
-
setImmediate: _setImmediate,
|
|
5821
|
-
asap,
|
|
5822
|
-
isIterable,
|
|
5823
|
-
isSafeIterable
|
|
5824
|
-
};
|
|
5825
|
-
|
|
5826
|
-
// node_modules/axios/lib/helpers/parseHeaders.js
|
|
5827
|
-
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
5828
|
-
"age",
|
|
5829
|
-
"authorization",
|
|
5830
|
-
"content-length",
|
|
5831
|
-
"content-type",
|
|
5832
|
-
"etag",
|
|
5833
|
-
"expires",
|
|
5834
|
-
"from",
|
|
5835
|
-
"host",
|
|
5836
|
-
"if-modified-since",
|
|
5837
|
-
"if-unmodified-since",
|
|
5838
|
-
"last-modified",
|
|
5839
|
-
"location",
|
|
5840
|
-
"max-forwards",
|
|
5841
|
-
"proxy-authorization",
|
|
5842
|
-
"referer",
|
|
5843
|
-
"retry-after",
|
|
5844
|
-
"user-agent"
|
|
5845
|
-
]);
|
|
5846
|
-
var parseHeaders_default = (rawHeaders) => {
|
|
5847
|
-
const parsed = {};
|
|
5848
|
-
let key;
|
|
5849
|
-
let val;
|
|
5850
|
-
let i;
|
|
5851
|
-
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
5852
|
-
i = line.indexOf(":");
|
|
5853
|
-
key = line.substring(0, i).trim().toLowerCase();
|
|
5854
|
-
val = line.substring(i + 1).trim();
|
|
5855
|
-
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
5856
|
-
return;
|
|
5857
|
-
}
|
|
5858
|
-
if (key === "set-cookie") {
|
|
5859
|
-
if (parsed[key]) {
|
|
5860
|
-
parsed[key].push(val);
|
|
5861
|
-
} else {
|
|
5862
|
-
parsed[key] = [val];
|
|
5863
|
-
}
|
|
5864
|
-
} else {
|
|
5865
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
5866
|
-
}
|
|
5867
|
-
});
|
|
5868
|
-
return parsed;
|
|
5869
|
-
};
|
|
5870
|
-
|
|
5871
|
-
// node_modules/axios/lib/helpers/sanitizeHeaderValue.js
|
|
5872
|
-
function trimSPorHTAB(str) {
|
|
5873
|
-
let start = 0;
|
|
5874
|
-
let end = str.length;
|
|
5875
|
-
while (start < end) {
|
|
5876
|
-
const code = str.charCodeAt(start);
|
|
5877
|
-
if (code !== 9 && code !== 32) {
|
|
5878
|
-
break;
|
|
5879
|
-
}
|
|
5880
|
-
start += 1;
|
|
5881
|
-
}
|
|
5882
|
-
while (end > start) {
|
|
5883
|
-
const code = str.charCodeAt(end - 1);
|
|
5884
|
-
if (code !== 9 && code !== 32) {
|
|
5885
|
-
break;
|
|
5886
|
-
}
|
|
5887
|
-
end -= 1;
|
|
5888
|
-
}
|
|
5889
|
-
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
5890
|
-
}
|
|
5891
|
-
var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g");
|
|
5892
|
-
var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
|
|
5893
|
-
function sanitizeValue(value, invalidChars) {
|
|
5894
|
-
if (utils_default.isArray(value)) {
|
|
5895
|
-
return value.map((item) => sanitizeValue(item, invalidChars));
|
|
5896
|
-
}
|
|
5897
|
-
return trimSPorHTAB(String(value).replace(invalidChars, ""));
|
|
5898
|
-
}
|
|
5899
|
-
var sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
|
|
5900
|
-
var sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
|
|
5901
|
-
function toByteStringHeaderObject(headers) {
|
|
5902
|
-
const byteStringHeaders = /* @__PURE__ */ Object.create(null);
|
|
5903
|
-
utils_default.forEach(headers.toJSON(), (value, header) => {
|
|
5904
|
-
byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
|
|
5905
|
-
});
|
|
5906
|
-
return byteStringHeaders;
|
|
5907
|
-
}
|
|
5908
|
-
|
|
5909
|
-
// node_modules/axios/lib/core/AxiosHeaders.js
|
|
5910
|
-
var $internals = /* @__PURE__ */ Symbol("internals");
|
|
5911
|
-
function normalizeHeader(header) {
|
|
5912
|
-
return header && String(header).trim().toLowerCase();
|
|
5913
|
-
}
|
|
5914
|
-
function normalizeValue(value) {
|
|
5915
|
-
if (value === false || value == null) {
|
|
5916
|
-
return value;
|
|
5917
|
-
}
|
|
5918
|
-
return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
5919
|
-
}
|
|
5920
|
-
function parseTokens(str) {
|
|
5921
|
-
const tokens = /* @__PURE__ */ Object.create(null);
|
|
5922
|
-
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
5923
|
-
let match;
|
|
5924
|
-
while (match = tokensRE.exec(str)) {
|
|
5925
|
-
tokens[match[1]] = match[2];
|
|
5926
|
-
}
|
|
5927
|
-
return tokens;
|
|
5928
|
-
}
|
|
5929
|
-
var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
5930
|
-
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
5931
|
-
if (utils_default.isFunction(filter2)) {
|
|
5932
|
-
return filter2.call(this, value, header);
|
|
5933
|
-
}
|
|
5934
|
-
if (isHeaderNameFilter) {
|
|
5935
|
-
value = header;
|
|
5936
|
-
}
|
|
5937
|
-
if (!utils_default.isString(value)) return;
|
|
5938
|
-
if (utils_default.isString(filter2)) {
|
|
5939
|
-
return value.indexOf(filter2) !== -1;
|
|
5940
|
-
}
|
|
5941
|
-
if (utils_default.isRegExp(filter2)) {
|
|
5942
|
-
return filter2.test(value);
|
|
5943
|
-
}
|
|
5944
|
-
}
|
|
5945
|
-
function formatHeader(header) {
|
|
5946
|
-
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
5947
|
-
return char.toUpperCase() + str;
|
|
5948
|
-
});
|
|
5949
|
-
}
|
|
5950
|
-
function buildAccessors(obj, header) {
|
|
5951
|
-
const accessorName = utils_default.toCamelCase(" " + header);
|
|
5952
|
-
["get", "set", "has"].forEach((methodName) => {
|
|
5953
|
-
Object.defineProperty(obj, methodName + accessorName, {
|
|
5954
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
5955
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
5956
|
-
__proto__: null,
|
|
5957
|
-
value: function(arg1, arg2, arg3) {
|
|
5958
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
5959
|
-
},
|
|
5960
|
-
configurable: true
|
|
5961
|
-
});
|
|
5962
|
-
});
|
|
5963
|
-
}
|
|
5964
|
-
var AxiosHeaders = class {
|
|
5965
|
-
constructor(headers) {
|
|
5966
|
-
headers && this.set(headers);
|
|
5967
|
-
}
|
|
5968
|
-
set(header, valueOrRewrite, rewrite) {
|
|
5969
|
-
const self2 = this;
|
|
5970
|
-
function setHeader(_value, _header, _rewrite) {
|
|
5971
|
-
const lHeader = normalizeHeader(_header);
|
|
5972
|
-
if (!lHeader) {
|
|
5973
|
-
return;
|
|
5974
|
-
}
|
|
5975
|
-
const key = utils_default.findKey(self2, lHeader);
|
|
5976
|
-
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
5977
|
-
self2[key || _header] = normalizeValue(_value);
|
|
5978
|
-
}
|
|
5979
|
-
}
|
|
5980
|
-
const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
5981
|
-
if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
|
|
5982
|
-
setHeaders(header, valueOrRewrite);
|
|
5983
|
-
} else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
5984
|
-
setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
5985
|
-
} else if (utils_default.isObject(header) && utils_default.isSafeIterable(header)) {
|
|
5986
|
-
let obj = /* @__PURE__ */ Object.create(null), dest, key;
|
|
5987
|
-
for (const entry of header) {
|
|
5988
|
-
if (!utils_default.isArray(entry)) {
|
|
5989
|
-
throw new TypeError("Object iterator must return a key-value pair");
|
|
5990
|
-
}
|
|
5991
|
-
key = entry[0];
|
|
5992
|
-
if (utils_default.hasOwnProp(obj, key)) {
|
|
5993
|
-
dest = obj[key];
|
|
5994
|
-
obj[key] = utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
|
|
5995
|
-
} else {
|
|
5996
|
-
obj[key] = entry[1];
|
|
5997
|
-
}
|
|
5998
|
-
}
|
|
5999
|
-
setHeaders(obj, valueOrRewrite);
|
|
6000
|
-
} else {
|
|
6001
|
-
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
6002
|
-
}
|
|
6003
|
-
return this;
|
|
6004
|
-
}
|
|
6005
|
-
get(header, parser) {
|
|
6006
|
-
header = normalizeHeader(header);
|
|
6007
|
-
if (header) {
|
|
6008
|
-
const key = utils_default.findKey(this, header);
|
|
6009
|
-
if (key) {
|
|
6010
|
-
const value = this[key];
|
|
6011
|
-
if (!parser) {
|
|
6012
|
-
return value;
|
|
6013
|
-
}
|
|
6014
|
-
if (parser === true) {
|
|
6015
|
-
return parseTokens(value);
|
|
6016
|
-
}
|
|
6017
|
-
if (utils_default.isFunction(parser)) {
|
|
6018
|
-
return parser.call(this, value, key);
|
|
6019
|
-
}
|
|
6020
|
-
if (utils_default.isRegExp(parser)) {
|
|
6021
|
-
return parser.exec(value);
|
|
6022
|
-
}
|
|
6023
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
|
6024
|
-
}
|
|
6025
|
-
}
|
|
6026
|
-
}
|
|
6027
|
-
has(header, matcher) {
|
|
6028
|
-
header = normalizeHeader(header);
|
|
6029
|
-
if (header) {
|
|
6030
|
-
const key = utils_default.findKey(this, header);
|
|
6031
|
-
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
6032
|
-
}
|
|
6033
|
-
return false;
|
|
6034
|
-
}
|
|
6035
|
-
delete(header, matcher) {
|
|
6036
|
-
const self2 = this;
|
|
6037
|
-
let deleted = false;
|
|
6038
|
-
function deleteHeader(_header) {
|
|
6039
|
-
_header = normalizeHeader(_header);
|
|
6040
|
-
if (_header) {
|
|
6041
|
-
const key = utils_default.findKey(self2, _header);
|
|
6042
|
-
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
6043
|
-
delete self2[key];
|
|
6044
|
-
deleted = true;
|
|
6045
|
-
}
|
|
6046
|
-
}
|
|
6047
|
-
}
|
|
6048
|
-
if (utils_default.isArray(header)) {
|
|
6049
|
-
header.forEach(deleteHeader);
|
|
6050
|
-
} else {
|
|
6051
|
-
deleteHeader(header);
|
|
6052
|
-
}
|
|
6053
|
-
return deleted;
|
|
6054
|
-
}
|
|
6055
|
-
clear(matcher) {
|
|
6056
|
-
const keys = Object.keys(this);
|
|
6057
|
-
let i = keys.length;
|
|
6058
|
-
let deleted = false;
|
|
6059
|
-
while (i--) {
|
|
6060
|
-
const key = keys[i];
|
|
6061
|
-
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
6062
|
-
delete this[key];
|
|
6063
|
-
deleted = true;
|
|
6064
|
-
}
|
|
6065
|
-
}
|
|
6066
|
-
return deleted;
|
|
6067
|
-
}
|
|
6068
|
-
normalize(format) {
|
|
6069
|
-
const self2 = this;
|
|
6070
|
-
const headers = {};
|
|
6071
|
-
utils_default.forEach(this, (value, header) => {
|
|
6072
|
-
const key = utils_default.findKey(headers, header);
|
|
6073
|
-
if (key) {
|
|
6074
|
-
self2[key] = normalizeValue(value);
|
|
6075
|
-
delete self2[header];
|
|
6076
|
-
return;
|
|
6077
|
-
}
|
|
6078
|
-
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
6079
|
-
if (normalized !== header) {
|
|
6080
|
-
delete self2[header];
|
|
6081
|
-
}
|
|
6082
|
-
self2[normalized] = normalizeValue(value);
|
|
6083
|
-
headers[normalized] = true;
|
|
6084
|
-
});
|
|
6085
|
-
return this;
|
|
6086
|
-
}
|
|
6087
|
-
concat(...targets) {
|
|
6088
|
-
return this.constructor.concat(this, ...targets);
|
|
6089
|
-
}
|
|
6090
|
-
toJSON(asStrings) {
|
|
6091
|
-
const obj = /* @__PURE__ */ Object.create(null);
|
|
6092
|
-
utils_default.forEach(this, (value, header) => {
|
|
6093
|
-
value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
|
|
6094
|
-
});
|
|
6095
|
-
return obj;
|
|
6096
|
-
}
|
|
6097
|
-
[Symbol.iterator]() {
|
|
6098
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
6099
|
-
}
|
|
6100
|
-
toString() {
|
|
6101
|
-
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
6102
|
-
}
|
|
6103
|
-
getSetCookie() {
|
|
6104
|
-
return this.get("set-cookie") || [];
|
|
6105
|
-
}
|
|
6106
|
-
get [Symbol.toStringTag]() {
|
|
6107
|
-
return "AxiosHeaders";
|
|
6108
|
-
}
|
|
6109
|
-
static from(thing) {
|
|
6110
|
-
return thing instanceof this ? thing : new this(thing);
|
|
6111
|
-
}
|
|
6112
|
-
static concat(first, ...targets) {
|
|
6113
|
-
const computed = new this(first);
|
|
6114
|
-
targets.forEach((target) => computed.set(target));
|
|
6115
|
-
return computed;
|
|
6116
|
-
}
|
|
6117
|
-
static accessor(header) {
|
|
6118
|
-
const internals = this[$internals] = this[$internals] = {
|
|
6119
|
-
accessors: {}
|
|
6120
|
-
};
|
|
6121
|
-
const accessors = internals.accessors;
|
|
6122
|
-
const prototype2 = this.prototype;
|
|
6123
|
-
function defineAccessor(_header) {
|
|
6124
|
-
const lHeader = normalizeHeader(_header);
|
|
6125
|
-
if (!accessors[lHeader]) {
|
|
6126
|
-
buildAccessors(prototype2, _header);
|
|
6127
|
-
accessors[lHeader] = true;
|
|
6128
|
-
}
|
|
6129
|
-
}
|
|
6130
|
-
utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
6131
|
-
return this;
|
|
6132
|
-
}
|
|
6133
|
-
};
|
|
6134
|
-
AxiosHeaders.accessor([
|
|
6135
|
-
"Content-Type",
|
|
6136
|
-
"Content-Length",
|
|
6137
|
-
"Accept",
|
|
6138
|
-
"Accept-Encoding",
|
|
6139
|
-
"User-Agent",
|
|
6140
|
-
"Authorization"
|
|
6141
|
-
]);
|
|
6142
|
-
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
6143
|
-
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
6144
|
-
return {
|
|
6145
|
-
get: () => value,
|
|
6146
|
-
set(headerValue) {
|
|
6147
|
-
this[mapped] = headerValue;
|
|
6148
|
-
}
|
|
6149
|
-
};
|
|
6150
|
-
});
|
|
6151
|
-
utils_default.freezeMethods(AxiosHeaders);
|
|
6152
|
-
var AxiosHeaders_default = AxiosHeaders;
|
|
6153
|
-
|
|
6154
|
-
// node_modules/axios/lib/core/AxiosError.js
|
|
6155
|
-
var REDACTED = "[REDACTED ****]";
|
|
6156
|
-
function hasOwnOrPrototypeToJSON(source) {
|
|
6157
|
-
if (utils_default.hasOwnProp(source, "toJSON")) {
|
|
6158
|
-
return true;
|
|
6159
|
-
}
|
|
6160
|
-
let prototype2 = Object.getPrototypeOf(source);
|
|
6161
|
-
while (prototype2 && prototype2 !== Object.prototype) {
|
|
6162
|
-
if (utils_default.hasOwnProp(prototype2, "toJSON")) {
|
|
6163
|
-
return true;
|
|
6164
|
-
}
|
|
6165
|
-
prototype2 = Object.getPrototypeOf(prototype2);
|
|
6166
|
-
}
|
|
6167
|
-
return false;
|
|
6168
|
-
}
|
|
6169
|
-
function redactConfig(config, redactKeys) {
|
|
6170
|
-
const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
|
|
6171
|
-
const seen = [];
|
|
6172
|
-
const visit = (source) => {
|
|
6173
|
-
if (source === null || typeof source !== "object") return source;
|
|
6174
|
-
if (utils_default.isBuffer(source)) return source;
|
|
6175
|
-
if (seen.indexOf(source) !== -1) return void 0;
|
|
6176
|
-
if (source instanceof AxiosHeaders_default) {
|
|
6177
|
-
source = source.toJSON();
|
|
6178
|
-
}
|
|
6179
|
-
seen.push(source);
|
|
6180
|
-
let result;
|
|
6181
|
-
if (utils_default.isArray(source)) {
|
|
6182
|
-
result = [];
|
|
6183
|
-
source.forEach((v, i) => {
|
|
6184
|
-
const reducedValue = visit(v);
|
|
6185
|
-
if (!utils_default.isUndefined(reducedValue)) {
|
|
6186
|
-
result[i] = reducedValue;
|
|
6187
|
-
}
|
|
6188
|
-
});
|
|
6189
|
-
} else {
|
|
6190
|
-
if (!utils_default.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
|
|
6191
|
-
seen.pop();
|
|
6192
|
-
return source;
|
|
6193
|
-
}
|
|
6194
|
-
result = /* @__PURE__ */ Object.create(null);
|
|
6195
|
-
for (const [key, value] of Object.entries(source)) {
|
|
6196
|
-
const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
|
|
6197
|
-
if (!utils_default.isUndefined(reducedValue)) {
|
|
6198
|
-
result[key] = reducedValue;
|
|
6199
|
-
}
|
|
6200
|
-
}
|
|
6201
|
-
}
|
|
6202
|
-
seen.pop();
|
|
6203
|
-
return result;
|
|
6204
|
-
};
|
|
6205
|
-
return visit(config);
|
|
6206
|
-
}
|
|
6207
|
-
var AxiosError = class _AxiosError extends Error {
|
|
6208
|
-
static from(error, code, config, request, response, customProps) {
|
|
6209
|
-
const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
|
|
6210
|
-
axiosError.cause = error;
|
|
6211
|
-
axiosError.name = error.name;
|
|
6212
|
-
if (error.status != null && axiosError.status == null) {
|
|
6213
|
-
axiosError.status = error.status;
|
|
6214
|
-
}
|
|
6215
|
-
customProps && Object.assign(axiosError, customProps);
|
|
6216
|
-
return axiosError;
|
|
6217
|
-
}
|
|
6218
|
-
/**
|
|
6219
|
-
* Create an Error with the specified message, config, error code, request and response.
|
|
6220
|
-
*
|
|
6221
|
-
* @param {string} message The error message.
|
|
6222
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
6223
|
-
* @param {Object} [config] The config.
|
|
6224
|
-
* @param {Object} [request] The request.
|
|
6225
|
-
* @param {Object} [response] The response.
|
|
6226
|
-
*
|
|
6227
|
-
* @returns {Error} The created error.
|
|
6228
|
-
*/
|
|
6229
|
-
constructor(message, code, config, request, response) {
|
|
6230
|
-
super(message);
|
|
6231
|
-
Object.defineProperty(this, "message", {
|
|
6232
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
6233
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
6234
|
-
__proto__: null,
|
|
6235
|
-
value: message,
|
|
6236
|
-
enumerable: true,
|
|
6237
|
-
writable: true,
|
|
6238
|
-
configurable: true
|
|
6239
|
-
});
|
|
6240
|
-
this.name = "AxiosError";
|
|
6241
|
-
this.isAxiosError = true;
|
|
6242
|
-
code && (this.code = code);
|
|
6243
|
-
config && (this.config = config);
|
|
6244
|
-
request && (this.request = request);
|
|
6245
|
-
if (response) {
|
|
6246
|
-
this.response = response;
|
|
6247
|
-
this.status = response.status;
|
|
6248
|
-
}
|
|
6249
|
-
}
|
|
6250
|
-
toJSON() {
|
|
6251
|
-
const config = this.config;
|
|
6252
|
-
const redactKeys = config && utils_default.hasOwnProp(config, "redact") ? config.redact : void 0;
|
|
6253
|
-
const serializedConfig = utils_default.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils_default.toJSONObject(config);
|
|
6254
|
-
return {
|
|
6255
|
-
// Standard
|
|
6256
|
-
message: this.message,
|
|
6257
|
-
name: this.name,
|
|
6258
|
-
// Microsoft
|
|
6259
|
-
description: this.description,
|
|
6260
|
-
number: this.number,
|
|
6261
|
-
// Mozilla
|
|
6262
|
-
fileName: this.fileName,
|
|
6263
|
-
lineNumber: this.lineNumber,
|
|
6264
|
-
columnNumber: this.columnNumber,
|
|
6265
|
-
stack: this.stack,
|
|
6266
|
-
// Axios
|
|
6267
|
-
config: serializedConfig,
|
|
6268
|
-
code: this.code,
|
|
6269
|
-
status: this.status
|
|
6270
|
-
};
|
|
6271
|
-
}
|
|
6272
|
-
};
|
|
6273
|
-
AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
6274
|
-
AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
6275
|
-
AxiosError.ECONNABORTED = "ECONNABORTED";
|
|
6276
|
-
AxiosError.ETIMEDOUT = "ETIMEDOUT";
|
|
6277
|
-
AxiosError.ECONNREFUSED = "ECONNREFUSED";
|
|
6278
|
-
AxiosError.ERR_NETWORK = "ERR_NETWORK";
|
|
6279
|
-
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
6280
|
-
AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
6281
|
-
AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
6282
|
-
AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
6283
|
-
AxiosError.ERR_CANCELED = "ERR_CANCELED";
|
|
6284
|
-
AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
6285
|
-
AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
6286
|
-
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
6287
|
-
var AxiosError_default = AxiosError;
|
|
6288
|
-
|
|
6289
|
-
// node_modules/axios/lib/helpers/null.js
|
|
6290
|
-
var null_default = null;
|
|
6291
|
-
|
|
6292
|
-
// node_modules/axios/lib/helpers/toFormData.js
|
|
6293
|
-
var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
|
|
6294
|
-
function isVisitable(thing) {
|
|
6295
|
-
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
6296
|
-
}
|
|
6297
|
-
function removeBrackets(key) {
|
|
6298
|
-
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
6299
|
-
}
|
|
6300
|
-
function renderKey(path, key, dots) {
|
|
6301
|
-
if (!path) return key;
|
|
6302
|
-
return path.concat(key).map(function each(token, i) {
|
|
6303
|
-
token = removeBrackets(token);
|
|
6304
|
-
return !dots && i ? "[" + token + "]" : token;
|
|
6305
|
-
}).join(dots ? "." : "");
|
|
6306
|
-
}
|
|
6307
|
-
function isFlatArray(arr) {
|
|
6308
|
-
return utils_default.isArray(arr) && !arr.some(isVisitable);
|
|
6309
|
-
}
|
|
6310
|
-
var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
|
|
6311
|
-
return /^is[A-Z]/.test(prop);
|
|
6312
|
-
});
|
|
6313
|
-
function toFormData(obj, formData, options) {
|
|
6314
|
-
if (!utils_default.isObject(obj)) {
|
|
6315
|
-
throw new TypeError("target must be an object");
|
|
6316
|
-
}
|
|
6317
|
-
formData = formData || new (null_default || FormData)();
|
|
6318
|
-
options = utils_default.toFlatObject(
|
|
6319
|
-
options,
|
|
6320
|
-
{
|
|
6321
|
-
metaTokens: true,
|
|
6322
|
-
dots: false,
|
|
6323
|
-
indexes: false
|
|
6324
|
-
},
|
|
6325
|
-
false,
|
|
6326
|
-
function defined(option, source) {
|
|
6327
|
-
return !utils_default.isUndefined(source[option]);
|
|
6328
|
-
}
|
|
6329
|
-
);
|
|
6330
|
-
const metaTokens = options.metaTokens;
|
|
6331
|
-
const visitor = options.visitor || defaultVisitor;
|
|
6332
|
-
const dots = options.dots;
|
|
6333
|
-
const indexes = options.indexes;
|
|
6334
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
6335
|
-
const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
|
|
6336
|
-
const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
|
|
6337
|
-
const stack = [];
|
|
6338
|
-
if (!utils_default.isFunction(visitor)) {
|
|
6339
|
-
throw new TypeError("visitor must be a function");
|
|
6340
|
-
}
|
|
6341
|
-
function convertValue(value) {
|
|
6342
|
-
if (value === null) return "";
|
|
6343
|
-
if (utils_default.isDate(value)) {
|
|
6344
|
-
return value.toISOString();
|
|
6345
|
-
}
|
|
6346
|
-
if (utils_default.isBoolean(value)) {
|
|
6347
|
-
return value.toString();
|
|
6348
|
-
}
|
|
6349
|
-
if (!useBlob && utils_default.isBlob(value)) {
|
|
6350
|
-
throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
|
|
6351
|
-
}
|
|
6352
|
-
if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
|
|
6353
|
-
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
6354
|
-
}
|
|
6355
|
-
return value;
|
|
6356
|
-
}
|
|
6357
|
-
function throwIfMaxDepthExceeded(depth) {
|
|
6358
|
-
if (depth > maxDepth) {
|
|
6359
|
-
throw new AxiosError_default(
|
|
6360
|
-
"Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth,
|
|
6361
|
-
AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
6362
|
-
);
|
|
6363
|
-
}
|
|
6364
|
-
}
|
|
6365
|
-
function stringifyWithDepthLimit(value, depth) {
|
|
6366
|
-
if (maxDepth === Infinity) {
|
|
6367
|
-
return JSON.stringify(value);
|
|
6368
|
-
}
|
|
6369
|
-
const ancestors = [];
|
|
6370
|
-
return JSON.stringify(value, function limitDepth(_key, currentValue) {
|
|
6371
|
-
if (!utils_default.isObject(currentValue)) {
|
|
6372
|
-
return currentValue;
|
|
6373
|
-
}
|
|
6374
|
-
while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
|
|
6375
|
-
ancestors.pop();
|
|
6376
|
-
}
|
|
6377
|
-
ancestors.push(currentValue);
|
|
6378
|
-
throwIfMaxDepthExceeded(depth + ancestors.length - 1);
|
|
6379
|
-
return currentValue;
|
|
6380
|
-
});
|
|
6381
|
-
}
|
|
6382
|
-
function defaultVisitor(value, key, path) {
|
|
6383
|
-
let arr = value;
|
|
6384
|
-
if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
|
|
6385
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
6386
|
-
return false;
|
|
6387
|
-
}
|
|
6388
|
-
if (value && !path && typeof value === "object") {
|
|
6389
|
-
if (utils_default.endsWith(key, "{}")) {
|
|
6390
|
-
key = metaTokens ? key : key.slice(0, -2);
|
|
6391
|
-
value = stringifyWithDepthLimit(value, 1);
|
|
6392
|
-
} else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
|
|
6393
|
-
key = removeBrackets(key);
|
|
6394
|
-
arr.forEach(function each(el, index) {
|
|
6395
|
-
!(utils_default.isUndefined(el) || el === null) && formData.append(
|
|
6396
|
-
// eslint-disable-next-line no-nested-ternary
|
|
6397
|
-
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
6398
|
-
convertValue(el)
|
|
6399
|
-
);
|
|
6400
|
-
});
|
|
6401
|
-
return false;
|
|
6402
|
-
}
|
|
6403
|
-
}
|
|
6404
|
-
if (isVisitable(value)) {
|
|
6405
|
-
return true;
|
|
6406
|
-
}
|
|
6407
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
6408
|
-
return false;
|
|
6409
|
-
}
|
|
6410
|
-
const exposedHelpers = Object.assign(predicates, {
|
|
6411
|
-
defaultVisitor,
|
|
6412
|
-
convertValue,
|
|
6413
|
-
isVisitable
|
|
6414
|
-
});
|
|
6415
|
-
function build(value, path, depth = 0) {
|
|
6416
|
-
if (utils_default.isUndefined(value)) return;
|
|
6417
|
-
throwIfMaxDepthExceeded(depth);
|
|
6418
|
-
if (stack.indexOf(value) !== -1) {
|
|
6419
|
-
throw new Error("Circular reference detected in " + path.join("."));
|
|
6420
|
-
}
|
|
6421
|
-
stack.push(value);
|
|
6422
|
-
utils_default.forEach(value, function each(el, key) {
|
|
6423
|
-
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
6424
|
-
if (result === true) {
|
|
6425
|
-
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
6426
|
-
}
|
|
6427
|
-
});
|
|
6428
|
-
stack.pop();
|
|
6429
|
-
}
|
|
6430
|
-
if (!utils_default.isObject(obj)) {
|
|
6431
|
-
throw new TypeError("data must be an object");
|
|
6432
|
-
}
|
|
6433
|
-
build(obj);
|
|
6434
|
-
return formData;
|
|
6435
|
-
}
|
|
6436
|
-
var toFormData_default = toFormData;
|
|
6437
|
-
|
|
6438
|
-
// node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
6439
|
-
function encode(str) {
|
|
6440
|
-
const charMap = {
|
|
6441
|
-
"!": "%21",
|
|
6442
|
-
"'": "%27",
|
|
6443
|
-
"(": "%28",
|
|
6444
|
-
")": "%29",
|
|
6445
|
-
"~": "%7E",
|
|
6446
|
-
"%20": "+"
|
|
6447
|
-
};
|
|
6448
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
6449
|
-
return charMap[match];
|
|
6450
|
-
});
|
|
6451
|
-
}
|
|
6452
|
-
function AxiosURLSearchParams(params, options) {
|
|
6453
|
-
this._pairs = [];
|
|
6454
|
-
params && toFormData_default(params, this, options);
|
|
6455
|
-
}
|
|
6456
|
-
var prototype = AxiosURLSearchParams.prototype;
|
|
6457
|
-
prototype.append = function append(name, value) {
|
|
6458
|
-
this._pairs.push([name, value]);
|
|
6459
|
-
};
|
|
6460
|
-
prototype.toString = function toString2(encoder) {
|
|
6461
|
-
const _encode = encoder ? function(value) {
|
|
6462
|
-
return encoder.call(this, value, encode);
|
|
6463
|
-
} : encode;
|
|
6464
|
-
return this._pairs.map(function each(pair) {
|
|
6465
|
-
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
6466
|
-
}, "").join("&");
|
|
6467
|
-
};
|
|
6468
|
-
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
6469
|
-
|
|
6470
|
-
// node_modules/axios/lib/helpers/buildURL.js
|
|
6471
|
-
function encode2(val) {
|
|
6472
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
6473
|
-
}
|
|
6474
|
-
function buildURL(url, params, options) {
|
|
6475
|
-
if (!params) {
|
|
6476
|
-
return url;
|
|
6477
|
-
}
|
|
6478
|
-
const _options = utils_default.isFunction(options) ? {
|
|
6479
|
-
serialize: options
|
|
6480
|
-
} : options;
|
|
6481
|
-
const _encode = utils_default.getSafeProp(_options, "encode") || encode2;
|
|
6482
|
-
const serializeFn = utils_default.getSafeProp(_options, "serialize");
|
|
6483
|
-
let serializedParams;
|
|
6484
|
-
if (serializeFn) {
|
|
6485
|
-
serializedParams = serializeFn(params, _options);
|
|
6486
|
-
} else {
|
|
6487
|
-
serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode);
|
|
6488
|
-
}
|
|
6489
|
-
if (serializedParams) {
|
|
6490
|
-
const hashmarkIndex = url.indexOf("#");
|
|
6491
|
-
if (hashmarkIndex !== -1) {
|
|
6492
|
-
url = url.slice(0, hashmarkIndex);
|
|
6493
|
-
}
|
|
6494
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
6495
|
-
}
|
|
6496
|
-
return url;
|
|
6497
|
-
}
|
|
6498
|
-
|
|
6499
|
-
// node_modules/axios/lib/core/InterceptorManager.js
|
|
6500
|
-
var InterceptorManager = class {
|
|
6501
|
-
constructor() {
|
|
6502
|
-
this.handlers = [];
|
|
6503
|
-
}
|
|
6504
|
-
/**
|
|
6505
|
-
* Add a new interceptor to the stack
|
|
6506
|
-
*
|
|
6507
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
6508
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
6509
|
-
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
6510
|
-
*
|
|
6511
|
-
* @return {Number} An ID used to remove interceptor later
|
|
6512
|
-
*/
|
|
6513
|
-
use(fulfilled, rejected, options) {
|
|
6514
|
-
this.handlers.push({
|
|
6515
|
-
fulfilled,
|
|
6516
|
-
rejected,
|
|
6517
|
-
synchronous: options ? options.synchronous : false,
|
|
6518
|
-
runWhen: options ? options.runWhen : null
|
|
6519
|
-
});
|
|
6520
|
-
return this.handlers.length - 1;
|
|
6521
|
-
}
|
|
6522
|
-
/**
|
|
6523
|
-
* Remove an interceptor from the stack
|
|
6524
|
-
*
|
|
6525
|
-
* @param {Number} id The ID that was returned by `use`
|
|
6526
|
-
*
|
|
6527
|
-
* @returns {void}
|
|
6528
|
-
*/
|
|
6529
|
-
eject(id) {
|
|
6530
|
-
if (this.handlers[id]) {
|
|
6531
|
-
this.handlers[id] = null;
|
|
6532
|
-
}
|
|
6533
|
-
}
|
|
6534
|
-
/**
|
|
6535
|
-
* Clear all interceptors from the stack
|
|
6536
|
-
*
|
|
6537
|
-
* @returns {void}
|
|
6538
|
-
*/
|
|
6539
|
-
clear() {
|
|
6540
|
-
if (this.handlers) {
|
|
6541
|
-
this.handlers = [];
|
|
6542
|
-
}
|
|
6543
|
-
}
|
|
6544
|
-
/**
|
|
6545
|
-
* Iterate over all the registered interceptors
|
|
6546
|
-
*
|
|
6547
|
-
* This method is particularly useful for skipping over any
|
|
6548
|
-
* interceptors that may have become `null` calling `eject`.
|
|
6549
|
-
*
|
|
6550
|
-
* @param {Function} fn The function to call for each interceptor
|
|
6551
|
-
*
|
|
6552
|
-
* @returns {void}
|
|
6553
|
-
*/
|
|
6554
|
-
forEach(fn) {
|
|
6555
|
-
utils_default.forEach(this.handlers, function forEachHandler(h) {
|
|
6556
|
-
if (h !== null) {
|
|
6557
|
-
fn(h);
|
|
6558
|
-
}
|
|
6559
|
-
});
|
|
6560
|
-
}
|
|
6561
|
-
};
|
|
6562
|
-
var InterceptorManager_default = InterceptorManager;
|
|
6563
|
-
|
|
6564
|
-
// node_modules/axios/lib/defaults/transitional.js
|
|
6565
|
-
var transitional_default = {
|
|
6566
|
-
silentJSONParsing: true,
|
|
6567
|
-
forcedJSONParsing: true,
|
|
6568
|
-
clarifyTimeoutError: false,
|
|
6569
|
-
legacyInterceptorReqResOrdering: true,
|
|
6570
|
-
advertiseZstdAcceptEncoding: false,
|
|
6571
|
-
validateStatusUndefinedResolves: true
|
|
6572
|
-
};
|
|
6573
|
-
|
|
6574
|
-
// node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
|
|
6575
|
-
var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
|
|
6576
|
-
|
|
6577
|
-
// node_modules/axios/lib/platform/browser/classes/FormData.js
|
|
6578
|
-
var FormData_default = typeof FormData !== "undefined" ? FormData : null;
|
|
6579
|
-
|
|
6580
|
-
// node_modules/axios/lib/platform/browser/classes/Blob.js
|
|
6581
|
-
var Blob_default = typeof Blob !== "undefined" ? Blob : null;
|
|
6582
|
-
|
|
6583
|
-
// node_modules/axios/lib/platform/browser/index.js
|
|
6584
|
-
var browser_default = {
|
|
6585
|
-
isBrowser: true,
|
|
6586
|
-
classes: {
|
|
6587
|
-
URLSearchParams: URLSearchParams_default,
|
|
6588
|
-
FormData: FormData_default,
|
|
6589
|
-
Blob: Blob_default
|
|
6590
|
-
},
|
|
6591
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
6592
|
-
};
|
|
6593
|
-
|
|
6594
|
-
// node_modules/axios/lib/platform/common/utils.js
|
|
6595
|
-
var utils_exports = {};
|
|
6596
|
-
__export(utils_exports, {
|
|
6597
|
-
hasBrowserEnv: () => hasBrowserEnv,
|
|
6598
|
-
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
6599
|
-
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
|
|
6600
|
-
navigator: () => _navigator,
|
|
6601
|
-
origin: () => origin
|
|
6602
|
-
});
|
|
6603
|
-
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
6604
|
-
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
6605
|
-
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
6606
|
-
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
6607
|
-
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
6608
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
6609
|
-
})();
|
|
6610
|
-
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
6611
|
-
|
|
6612
|
-
// node_modules/axios/lib/platform/index.js
|
|
6613
|
-
var platform_default = {
|
|
6614
|
-
...utils_exports,
|
|
6615
|
-
...browser_default
|
|
6616
|
-
};
|
|
6617
|
-
|
|
6618
|
-
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
6619
|
-
function toURLEncodedForm(data, options) {
|
|
6620
|
-
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
6621
|
-
visitor: function(value, key, path, helpers) {
|
|
6622
|
-
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
6623
|
-
this.append(key, value.toString("base64"));
|
|
6624
|
-
return false;
|
|
6625
|
-
}
|
|
6626
|
-
return helpers.defaultVisitor.apply(this, arguments);
|
|
6627
|
-
},
|
|
6628
|
-
...options
|
|
6629
|
-
});
|
|
6630
|
-
}
|
|
6631
|
-
|
|
6632
|
-
// node_modules/axios/lib/helpers/formDataToJSON.js
|
|
6633
|
-
var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
|
|
6634
|
-
function throwIfDepthExceeded(index) {
|
|
6635
|
-
if (index > MAX_DEPTH) {
|
|
6636
|
-
throw new AxiosError_default(
|
|
6637
|
-
"FormData field is too deeply nested (" + index + " levels). Max depth: " + MAX_DEPTH,
|
|
6638
|
-
AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
6639
|
-
);
|
|
6640
|
-
}
|
|
6641
|
-
}
|
|
6642
|
-
function parsePropPath(name) {
|
|
6643
|
-
const path = [];
|
|
6644
|
-
const pattern = /\w+|\[(\w*)]/g;
|
|
6645
|
-
let match;
|
|
6646
|
-
while ((match = pattern.exec(name)) !== null) {
|
|
6647
|
-
throwIfDepthExceeded(path.length);
|
|
6648
|
-
path.push(match[0] === "[]" ? "" : match[1] || match[0]);
|
|
6649
|
-
}
|
|
6650
|
-
return path;
|
|
6651
|
-
}
|
|
6652
|
-
function arrayToObject(arr) {
|
|
6653
|
-
const obj = {};
|
|
6654
|
-
const keys = Object.keys(arr);
|
|
6655
|
-
let i;
|
|
6656
|
-
const len = keys.length;
|
|
6657
|
-
let key;
|
|
6658
|
-
for (i = 0; i < len; i++) {
|
|
6659
|
-
key = keys[i];
|
|
6660
|
-
obj[key] = arr[key];
|
|
6661
|
-
}
|
|
6662
|
-
return obj;
|
|
6663
|
-
}
|
|
6664
|
-
function formDataToJSON(formData) {
|
|
6665
|
-
function buildPath(path, value, target, index) {
|
|
6666
|
-
throwIfDepthExceeded(index);
|
|
6667
|
-
let name = path[index++];
|
|
6668
|
-
if (name === "__proto__") return true;
|
|
6669
|
-
const isNumericKey = Number.isFinite(+name);
|
|
6670
|
-
const isLast = index >= path.length;
|
|
6671
|
-
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
6672
|
-
if (isLast) {
|
|
6673
|
-
if (utils_default.hasOwnProp(target, name)) {
|
|
6674
|
-
target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
|
|
6675
|
-
} else {
|
|
6676
|
-
target[name] = value;
|
|
6677
|
-
}
|
|
6678
|
-
return !isNumericKey;
|
|
6679
|
-
}
|
|
6680
|
-
if (!utils_default.hasOwnProp(target, name) || !utils_default.isObject(target[name])) {
|
|
6681
|
-
target[name] = [];
|
|
6682
|
-
}
|
|
6683
|
-
const result = buildPath(path, value, target[name], index);
|
|
6684
|
-
if (result && utils_default.isArray(target[name])) {
|
|
6685
|
-
target[name] = arrayToObject(target[name]);
|
|
6686
|
-
}
|
|
6687
|
-
return !isNumericKey;
|
|
6688
|
-
}
|
|
6689
|
-
if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
|
|
6690
|
-
const obj = {};
|
|
6691
|
-
utils_default.forEachEntry(formData, (name, value) => {
|
|
6692
|
-
buildPath(parsePropPath(name), value, obj, 0);
|
|
6693
|
-
});
|
|
6694
|
-
return obj;
|
|
6695
|
-
}
|
|
6696
|
-
return null;
|
|
6697
|
-
}
|
|
6698
|
-
var formDataToJSON_default = formDataToJSON;
|
|
6699
|
-
|
|
6700
|
-
// node_modules/axios/lib/defaults/index.js
|
|
6701
|
-
var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
6702
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
6703
|
-
if (utils_default.isString(rawValue)) {
|
|
6704
|
-
try {
|
|
6705
|
-
(parser || JSON.parse)(rawValue);
|
|
6706
|
-
return utils_default.trim(rawValue);
|
|
6707
|
-
} catch (e) {
|
|
6708
|
-
if (e.name !== "SyntaxError") {
|
|
6709
|
-
throw e;
|
|
6710
|
-
}
|
|
6711
|
-
}
|
|
6712
|
-
}
|
|
6713
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
6714
|
-
}
|
|
6715
|
-
var defaults = {
|
|
6716
|
-
transitional: transitional_default,
|
|
6717
|
-
adapter: ["xhr", "http", "fetch"],
|
|
6718
|
-
transformRequest: [
|
|
6719
|
-
function transformRequest(data, headers) {
|
|
6720
|
-
const contentType = headers.getContentType() || "";
|
|
6721
|
-
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
6722
|
-
const isObjectPayload = utils_default.isObject(data);
|
|
6723
|
-
if (isObjectPayload && utils_default.isHTMLForm(data)) {
|
|
6724
|
-
data = new FormData(data);
|
|
6725
|
-
}
|
|
6726
|
-
const isFormData2 = utils_default.isFormData(data);
|
|
6727
|
-
if (isFormData2) {
|
|
6728
|
-
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
6729
|
-
}
|
|
6730
|
-
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
|
|
6731
|
-
return data;
|
|
6732
|
-
}
|
|
6733
|
-
if (utils_default.isArrayBufferView(data)) {
|
|
6734
|
-
return data.buffer;
|
|
6735
|
-
}
|
|
6736
|
-
if (utils_default.isURLSearchParams(data)) {
|
|
6737
|
-
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
6738
|
-
return data.toString();
|
|
6739
|
-
}
|
|
6740
|
-
let isFileList2;
|
|
6741
|
-
if (isObjectPayload) {
|
|
6742
|
-
const formSerializer = own(this, "formSerializer");
|
|
6743
|
-
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
6744
|
-
return toURLEncodedForm(data, formSerializer).toString();
|
|
6745
|
-
}
|
|
6746
|
-
if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
6747
|
-
const env = own(this, "env");
|
|
6748
|
-
const _FormData = env && env.FormData;
|
|
6749
|
-
return toFormData_default(
|
|
6750
|
-
isFileList2 ? { "files[]": data } : data,
|
|
6751
|
-
_FormData && new _FormData(),
|
|
6752
|
-
formSerializer
|
|
6753
|
-
);
|
|
6754
|
-
}
|
|
6755
|
-
}
|
|
6756
|
-
if (isObjectPayload || hasJSONContentType) {
|
|
6757
|
-
headers.setContentType("application/json", false);
|
|
6758
|
-
return stringifySafely(data);
|
|
6759
|
-
}
|
|
6760
|
-
return data;
|
|
6761
|
-
}
|
|
6762
|
-
],
|
|
6763
|
-
transformResponse: [
|
|
6764
|
-
function transformResponse(data) {
|
|
6765
|
-
const transitional2 = own(this, "transitional") || defaults.transitional;
|
|
6766
|
-
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
6767
|
-
const responseType = own(this, "responseType");
|
|
6768
|
-
const JSONRequested = responseType === "json";
|
|
6769
|
-
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
|
|
6770
|
-
return data;
|
|
6771
|
-
}
|
|
6772
|
-
if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
|
|
6773
|
-
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
6774
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
6775
|
-
try {
|
|
6776
|
-
return JSON.parse(data, own(this, "parseReviver"));
|
|
6777
|
-
} catch (e) {
|
|
6778
|
-
if (strictJSONParsing) {
|
|
6779
|
-
if (e.name === "SyntaxError") {
|
|
6780
|
-
throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, own(this, "response"));
|
|
6781
|
-
}
|
|
6782
|
-
throw e;
|
|
6783
|
-
}
|
|
6784
|
-
}
|
|
6785
|
-
}
|
|
6786
|
-
return data;
|
|
6787
|
-
}
|
|
6788
|
-
],
|
|
6789
|
-
/**
|
|
6790
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
6791
|
-
* timeout is not created.
|
|
6792
|
-
*/
|
|
6793
|
-
timeout: 0,
|
|
6794
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
6795
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
6796
|
-
maxContentLength: -1,
|
|
6797
|
-
maxBodyLength: -1,
|
|
6798
|
-
env: {
|
|
6799
|
-
FormData: platform_default.classes.FormData,
|
|
6800
|
-
Blob: platform_default.classes.Blob
|
|
6801
|
-
},
|
|
6802
|
-
validateStatus: function validateStatus(status) {
|
|
6803
|
-
return status >= 200 && status < 300;
|
|
6804
|
-
},
|
|
6805
|
-
headers: {
|
|
6806
|
-
common: {
|
|
6807
|
-
Accept: "application/json, text/plain, */*",
|
|
6808
|
-
"Content-Type": void 0
|
|
6809
|
-
}
|
|
6810
|
-
}
|
|
6811
|
-
};
|
|
6812
|
-
utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => {
|
|
6813
|
-
defaults.headers[method] = {};
|
|
6814
|
-
});
|
|
6815
|
-
var defaults_default = defaults;
|
|
6816
|
-
|
|
6817
|
-
// node_modules/axios/lib/core/transformData.js
|
|
6818
|
-
function transformData(fns, response) {
|
|
6819
|
-
const config = this || defaults_default;
|
|
6820
|
-
const context = response || config;
|
|
6821
|
-
const headers = AxiosHeaders_default.from(context.headers);
|
|
6822
|
-
let data = context.data;
|
|
6823
|
-
utils_default.forEach(fns, function transform(fn) {
|
|
6824
|
-
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
6825
|
-
});
|
|
6826
|
-
headers.normalize();
|
|
6827
|
-
return data;
|
|
6828
|
-
}
|
|
6829
|
-
|
|
6830
|
-
// node_modules/axios/lib/cancel/isCancel.js
|
|
6831
|
-
function isCancel(value) {
|
|
6832
|
-
return !!(value && value.__CANCEL__);
|
|
6833
|
-
}
|
|
6834
|
-
|
|
6835
|
-
// node_modules/axios/lib/cancel/CanceledError.js
|
|
6836
|
-
var CanceledError = class extends AxiosError_default {
|
|
6837
|
-
/**
|
|
6838
|
-
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
6839
|
-
*
|
|
6840
|
-
* @param {string=} message The message.
|
|
6841
|
-
* @param {Object=} config The config.
|
|
6842
|
-
* @param {Object=} request The request.
|
|
6843
|
-
*
|
|
6844
|
-
* @returns {CanceledError} The created error.
|
|
6845
|
-
*/
|
|
6846
|
-
constructor(message, config, request) {
|
|
6847
|
-
super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
6848
|
-
this.name = "CanceledError";
|
|
6849
|
-
this.__CANCEL__ = true;
|
|
6850
|
-
}
|
|
6851
|
-
};
|
|
6852
|
-
var CanceledError_default = CanceledError;
|
|
6853
|
-
|
|
6854
|
-
// node_modules/axios/lib/core/settle.js
|
|
6855
|
-
function settle(resolve, reject, response) {
|
|
6856
|
-
const validateStatus2 = response.config.validateStatus;
|
|
6857
|
-
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
6858
|
-
resolve(response);
|
|
6859
|
-
} else {
|
|
6860
|
-
reject(new AxiosError_default(
|
|
6861
|
-
"Request failed with status code " + response.status,
|
|
6862
|
-
response.status >= 400 && response.status < 500 ? AxiosError_default.ERR_BAD_REQUEST : AxiosError_default.ERR_BAD_RESPONSE,
|
|
6863
|
-
response.config,
|
|
6864
|
-
response.request,
|
|
6865
|
-
response
|
|
6866
|
-
));
|
|
6867
|
-
}
|
|
6868
|
-
}
|
|
6869
|
-
|
|
6870
|
-
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
6871
|
-
function parseProtocol(url) {
|
|
6872
|
-
const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
6873
|
-
return match && match[1] || "";
|
|
6874
|
-
}
|
|
6875
|
-
|
|
6876
|
-
// node_modules/axios/lib/helpers/speedometer.js
|
|
6877
|
-
function speedometer(samplesCount, min) {
|
|
6878
|
-
samplesCount = samplesCount || 10;
|
|
6879
|
-
const bytes = new Array(samplesCount);
|
|
6880
|
-
const timestamps = new Array(samplesCount);
|
|
6881
|
-
let head = 0;
|
|
6882
|
-
let tail = 0;
|
|
6883
|
-
let firstSampleTS;
|
|
6884
|
-
min = min !== void 0 ? min : 1e3;
|
|
6885
|
-
return function push(chunkLength) {
|
|
6886
|
-
const now = Date.now();
|
|
6887
|
-
const startedAt = timestamps[tail];
|
|
6888
|
-
if (!firstSampleTS) {
|
|
6889
|
-
firstSampleTS = now;
|
|
6890
|
-
}
|
|
6891
|
-
bytes[head] = chunkLength;
|
|
6892
|
-
timestamps[head] = now;
|
|
6893
|
-
let i = tail;
|
|
6894
|
-
let bytesCount = 0;
|
|
6895
|
-
while (i !== head) {
|
|
6896
|
-
bytesCount += bytes[i++];
|
|
6897
|
-
i = i % samplesCount;
|
|
6898
|
-
}
|
|
6899
|
-
head = (head + 1) % samplesCount;
|
|
6900
|
-
if (head === tail) {
|
|
6901
|
-
tail = (tail + 1) % samplesCount;
|
|
6902
|
-
}
|
|
6903
|
-
if (now - firstSampleTS < min) {
|
|
6904
|
-
return;
|
|
6905
|
-
}
|
|
6906
|
-
const passed = startedAt && now - startedAt;
|
|
6907
|
-
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
6908
|
-
};
|
|
6909
|
-
}
|
|
6910
|
-
var speedometer_default = speedometer;
|
|
6911
|
-
|
|
6912
|
-
// node_modules/axios/lib/helpers/throttle.js
|
|
6913
|
-
function throttle(fn, freq) {
|
|
6914
|
-
let timestamp = 0;
|
|
6915
|
-
let threshold = 1e3 / freq;
|
|
6916
|
-
let lastArgs;
|
|
6917
|
-
let timer;
|
|
6918
|
-
const invoke2 = (args, now = Date.now()) => {
|
|
6919
|
-
timestamp = now;
|
|
6920
|
-
lastArgs = null;
|
|
6921
|
-
if (timer) {
|
|
6922
|
-
clearTimeout(timer);
|
|
6923
|
-
timer = null;
|
|
6924
|
-
}
|
|
6925
|
-
fn(...args);
|
|
6926
|
-
};
|
|
6927
|
-
const throttled = (...args) => {
|
|
6928
|
-
const now = Date.now();
|
|
6929
|
-
const passed = now - timestamp;
|
|
6930
|
-
if (passed >= threshold) {
|
|
6931
|
-
invoke2(args, now);
|
|
6932
|
-
} else {
|
|
6933
|
-
lastArgs = args;
|
|
6934
|
-
if (!timer) {
|
|
6935
|
-
timer = setTimeout(() => {
|
|
6936
|
-
timer = null;
|
|
6937
|
-
invoke2(lastArgs);
|
|
6938
|
-
}, threshold - passed);
|
|
6939
|
-
}
|
|
6940
|
-
}
|
|
6941
|
-
};
|
|
6942
|
-
const flush = () => lastArgs && invoke2(lastArgs);
|
|
6943
|
-
return [throttled, flush];
|
|
6944
|
-
}
|
|
6945
|
-
var throttle_default = throttle;
|
|
6946
|
-
|
|
6947
|
-
// node_modules/axios/lib/helpers/progressEventReducer.js
|
|
6948
|
-
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
6949
|
-
let bytesNotified = 0;
|
|
6950
|
-
const _speedometer = speedometer_default(50, 250);
|
|
6951
|
-
return throttle_default((e) => {
|
|
6952
|
-
if (!e || typeof e.loaded !== "number") {
|
|
6953
|
-
return;
|
|
6954
|
-
}
|
|
6955
|
-
const rawLoaded = e.loaded;
|
|
6956
|
-
const total = e.lengthComputable ? e.total : void 0;
|
|
6957
|
-
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
6958
|
-
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
6959
|
-
const rate = _speedometer(progressBytes);
|
|
6960
|
-
bytesNotified = Math.max(bytesNotified, loaded);
|
|
6961
|
-
const data = {
|
|
6962
|
-
loaded,
|
|
6963
|
-
total,
|
|
6964
|
-
progress: total ? loaded / total : void 0,
|
|
6965
|
-
bytes: progressBytes,
|
|
6966
|
-
rate: rate ? rate : void 0,
|
|
6967
|
-
estimated: rate && total ? (total - loaded) / rate : void 0,
|
|
6968
|
-
event: e,
|
|
6969
|
-
lengthComputable: total != null,
|
|
6970
|
-
[isDownloadStream ? "download" : "upload"]: true
|
|
6971
|
-
};
|
|
6972
|
-
listener(data);
|
|
6973
|
-
}, freq);
|
|
6974
|
-
};
|
|
6975
|
-
var progressEventDecorator = (total, throttled) => {
|
|
6976
|
-
const lengthComputable = total != null;
|
|
6977
|
-
return [
|
|
6978
|
-
(loaded) => throttled[0]({
|
|
6979
|
-
lengthComputable,
|
|
6980
|
-
total,
|
|
6981
|
-
loaded
|
|
6982
|
-
}),
|
|
6983
|
-
throttled[1]
|
|
6984
|
-
];
|
|
6985
|
-
};
|
|
6986
|
-
var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
6987
|
-
|
|
6988
|
-
// node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
6989
|
-
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
|
|
6990
|
-
url = new URL(url, platform_default.origin);
|
|
6991
|
-
return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
|
|
6992
|
-
})(
|
|
6993
|
-
new URL(platform_default.origin),
|
|
6994
|
-
platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
|
|
6995
|
-
) : () => true;
|
|
6996
|
-
|
|
6997
|
-
// node_modules/axios/lib/helpers/cookies.js
|
|
6998
|
-
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
6999
|
-
// Standard browser envs support document.cookie
|
|
7000
|
-
{
|
|
7001
|
-
write(name, value, expires, path, domain, secure, sameSite) {
|
|
7002
|
-
if (typeof document === "undefined") return;
|
|
7003
|
-
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
7004
|
-
if (utils_default.isNumber(expires)) {
|
|
7005
|
-
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
7006
|
-
}
|
|
7007
|
-
if (utils_default.isString(path)) {
|
|
7008
|
-
cookie.push(`path=${path}`);
|
|
7009
|
-
}
|
|
7010
|
-
if (utils_default.isString(domain)) {
|
|
7011
|
-
cookie.push(`domain=${domain}`);
|
|
7012
|
-
}
|
|
7013
|
-
if (secure === true) {
|
|
7014
|
-
cookie.push("secure");
|
|
7015
|
-
}
|
|
7016
|
-
if (utils_default.isString(sameSite)) {
|
|
7017
|
-
cookie.push(`SameSite=${sameSite}`);
|
|
7018
|
-
}
|
|
7019
|
-
document.cookie = cookie.join("; ");
|
|
7020
|
-
},
|
|
7021
|
-
read(name) {
|
|
7022
|
-
if (typeof document === "undefined") return null;
|
|
7023
|
-
const cookies = document.cookie.split(";");
|
|
7024
|
-
for (let i = 0; i < cookies.length; i++) {
|
|
7025
|
-
const cookie = cookies[i].replace(/^\s+/, "");
|
|
7026
|
-
const eq = cookie.indexOf("=");
|
|
7027
|
-
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
7028
|
-
return decodeURIComponent(cookie.slice(eq + 1));
|
|
7029
|
-
}
|
|
7030
|
-
}
|
|
7031
|
-
return null;
|
|
7032
|
-
},
|
|
7033
|
-
remove(name) {
|
|
7034
|
-
this.write(name, "", Date.now() - 864e5, "/");
|
|
7035
|
-
}
|
|
7036
|
-
}
|
|
7037
|
-
) : (
|
|
7038
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
7039
|
-
{
|
|
7040
|
-
write() {
|
|
7041
|
-
},
|
|
7042
|
-
read() {
|
|
7043
|
-
return null;
|
|
7044
|
-
},
|
|
7045
|
-
remove() {
|
|
7046
|
-
}
|
|
7047
|
-
}
|
|
7048
|
-
);
|
|
7049
|
-
|
|
7050
|
-
// node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
7051
|
-
function isAbsoluteURL(url) {
|
|
7052
|
-
if (typeof url !== "string") {
|
|
7053
|
-
return false;
|
|
7054
|
-
}
|
|
7055
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
7056
|
-
}
|
|
7057
|
-
|
|
7058
|
-
// node_modules/axios/lib/helpers/combineURLs.js
|
|
7059
|
-
function combineURLs(baseURL, relativeURL) {
|
|
7060
|
-
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
7061
|
-
}
|
|
7062
|
-
|
|
7063
|
-
// node_modules/axios/lib/core/buildFullPath.js
|
|
7064
|
-
var malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
7065
|
-
var httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
7066
|
-
function stripLeadingC0ControlOrSpace(url) {
|
|
7067
|
-
let i = 0;
|
|
7068
|
-
while (i < url.length && url.charCodeAt(i) <= 32) {
|
|
7069
|
-
i++;
|
|
7070
|
-
}
|
|
7071
|
-
return url.slice(i);
|
|
7072
|
-
}
|
|
7073
|
-
function normalizeURLForProtocolCheck(url) {
|
|
7074
|
-
return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, "");
|
|
7075
|
-
}
|
|
7076
|
-
function assertValidHttpProtocolURL(url, config) {
|
|
7077
|
-
if (typeof url === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
|
|
7078
|
-
throw new AxiosError_default(
|
|
7079
|
-
'Invalid URL: missing "//" after protocol',
|
|
7080
|
-
AxiosError_default.ERR_INVALID_URL,
|
|
7081
|
-
config
|
|
7082
|
-
);
|
|
7083
|
-
}
|
|
7084
|
-
}
|
|
7085
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
7086
|
-
assertValidHttpProtocolURL(requestedURL, config);
|
|
7087
|
-
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
7088
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
7089
|
-
assertValidHttpProtocolURL(baseURL, config);
|
|
7090
|
-
return combineURLs(baseURL, requestedURL);
|
|
7091
|
-
}
|
|
7092
|
-
return requestedURL;
|
|
7093
|
-
}
|
|
7094
|
-
|
|
7095
|
-
// node_modules/axios/lib/core/mergeConfig.js
|
|
7096
|
-
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
|
|
7097
|
-
function mergeConfig(config1, config2) {
|
|
7098
|
-
config2 = config2 || {};
|
|
7099
|
-
const config = /* @__PURE__ */ Object.create(null);
|
|
7100
|
-
Object.defineProperty(config, "hasOwnProperty", {
|
|
7101
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
7102
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
7103
|
-
__proto__: null,
|
|
7104
|
-
value: Object.prototype.hasOwnProperty,
|
|
7105
|
-
enumerable: false,
|
|
7106
|
-
writable: true,
|
|
7107
|
-
configurable: true
|
|
7108
|
-
});
|
|
7109
|
-
function getMergedValue(target, source, prop, caseless) {
|
|
7110
|
-
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
7111
|
-
return utils_default.merge.call({ caseless }, target, source);
|
|
7112
|
-
} else if (utils_default.isPlainObject(source)) {
|
|
7113
|
-
return utils_default.merge({}, source);
|
|
7114
|
-
} else if (utils_default.isArray(source)) {
|
|
7115
|
-
return source.slice();
|
|
7116
|
-
}
|
|
7117
|
-
return source;
|
|
7118
|
-
}
|
|
7119
|
-
function mergeDeepProperties(a, b, prop, caseless) {
|
|
7120
|
-
if (!utils_default.isUndefined(b)) {
|
|
7121
|
-
return getMergedValue(a, b, prop, caseless);
|
|
7122
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
7123
|
-
return getMergedValue(void 0, a, prop, caseless);
|
|
7124
|
-
}
|
|
7125
|
-
}
|
|
7126
|
-
function valueFromConfig2(a, b) {
|
|
7127
|
-
if (!utils_default.isUndefined(b)) {
|
|
7128
|
-
return getMergedValue(void 0, b);
|
|
7129
|
-
}
|
|
7130
|
-
}
|
|
7131
|
-
function defaultToConfig2(a, b) {
|
|
7132
|
-
if (!utils_default.isUndefined(b)) {
|
|
7133
|
-
return getMergedValue(void 0, b);
|
|
7134
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
7135
|
-
return getMergedValue(void 0, a);
|
|
7136
|
-
}
|
|
7137
|
-
}
|
|
7138
|
-
function getMergedTransitionalOption(prop) {
|
|
7139
|
-
const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
|
|
7140
|
-
if (!utils_default.isUndefined(transitional2)) {
|
|
7141
|
-
if (utils_default.isPlainObject(transitional2)) {
|
|
7142
|
-
if (utils_default.hasOwnProp(transitional2, prop)) {
|
|
7143
|
-
return transitional2[prop];
|
|
7144
|
-
}
|
|
7145
|
-
} else {
|
|
7146
|
-
return void 0;
|
|
7147
|
-
}
|
|
7148
|
-
}
|
|
7149
|
-
const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
|
|
7150
|
-
if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) {
|
|
7151
|
-
return transitional1[prop];
|
|
7152
|
-
}
|
|
7153
|
-
return void 0;
|
|
7154
|
-
}
|
|
7155
|
-
function mergeDirectKeys(a, b, prop) {
|
|
7156
|
-
if (utils_default.hasOwnProp(config2, prop)) {
|
|
7157
|
-
return getMergedValue(a, b);
|
|
7158
|
-
} else if (utils_default.hasOwnProp(config1, prop)) {
|
|
7159
|
-
return getMergedValue(void 0, a);
|
|
7160
|
-
}
|
|
7161
|
-
}
|
|
7162
|
-
const mergeMap = {
|
|
7163
|
-
url: valueFromConfig2,
|
|
7164
|
-
method: valueFromConfig2,
|
|
7165
|
-
data: valueFromConfig2,
|
|
7166
|
-
baseURL: defaultToConfig2,
|
|
7167
|
-
transformRequest: defaultToConfig2,
|
|
7168
|
-
transformResponse: defaultToConfig2,
|
|
7169
|
-
paramsSerializer: defaultToConfig2,
|
|
7170
|
-
timeout: defaultToConfig2,
|
|
7171
|
-
timeoutMessage: defaultToConfig2,
|
|
7172
|
-
withCredentials: defaultToConfig2,
|
|
7173
|
-
withXSRFToken: defaultToConfig2,
|
|
7174
|
-
adapter: defaultToConfig2,
|
|
7175
|
-
responseType: defaultToConfig2,
|
|
7176
|
-
xsrfCookieName: defaultToConfig2,
|
|
7177
|
-
xsrfHeaderName: defaultToConfig2,
|
|
7178
|
-
onUploadProgress: defaultToConfig2,
|
|
7179
|
-
onDownloadProgress: defaultToConfig2,
|
|
7180
|
-
decompress: defaultToConfig2,
|
|
7181
|
-
maxContentLength: defaultToConfig2,
|
|
7182
|
-
maxBodyLength: defaultToConfig2,
|
|
7183
|
-
beforeRedirect: defaultToConfig2,
|
|
7184
|
-
transport: defaultToConfig2,
|
|
7185
|
-
httpAgent: defaultToConfig2,
|
|
7186
|
-
httpsAgent: defaultToConfig2,
|
|
7187
|
-
cancelToken: defaultToConfig2,
|
|
7188
|
-
socketPath: defaultToConfig2,
|
|
7189
|
-
allowedSocketPaths: defaultToConfig2,
|
|
7190
|
-
responseEncoding: defaultToConfig2,
|
|
7191
|
-
validateStatus: mergeDirectKeys,
|
|
7192
|
-
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
7193
|
-
};
|
|
7194
|
-
utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
7195
|
-
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
7196
|
-
const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
7197
|
-
const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0;
|
|
7198
|
-
const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0;
|
|
7199
|
-
const configValue = merge2(a, b, prop);
|
|
7200
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
7201
|
-
});
|
|
7202
|
-
if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) {
|
|
7203
|
-
if (utils_default.hasOwnProp(config1, "validateStatus")) {
|
|
7204
|
-
config.validateStatus = getMergedValue(void 0, config1.validateStatus);
|
|
7205
|
-
} else {
|
|
7206
|
-
delete config.validateStatus;
|
|
7207
|
-
}
|
|
7208
|
-
}
|
|
7209
|
-
return config;
|
|
7210
|
-
}
|
|
7211
|
-
|
|
7212
|
-
// node_modules/axios/lib/helpers/resolveConfig.js
|
|
7213
|
-
var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
|
|
7214
|
-
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
7215
|
-
if (policy !== "content-only") {
|
|
7216
|
-
headers.set(formHeaders);
|
|
7217
|
-
return;
|
|
7218
|
-
}
|
|
7219
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
7220
|
-
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
7221
|
-
headers.set(key, val);
|
|
7222
|
-
}
|
|
7223
|
-
});
|
|
7224
|
-
}
|
|
7225
|
-
var encodeUTF8 = (str) => encodeURIComponent(str).replace(
|
|
7226
|
-
/%([0-9A-F]{2})/gi,
|
|
7227
|
-
(_, hex) => String.fromCharCode(parseInt(hex, 16))
|
|
7228
|
-
);
|
|
7229
|
-
function resolveConfig(config) {
|
|
7230
|
-
const newConfig = mergeConfig({}, config);
|
|
7231
|
-
const own2 = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
|
|
7232
|
-
const data = own2("data");
|
|
7233
|
-
let withXSRFToken = own2("withXSRFToken");
|
|
7234
|
-
const xsrfHeaderName = own2("xsrfHeaderName");
|
|
7235
|
-
const xsrfCookieName = own2("xsrfCookieName");
|
|
7236
|
-
let headers = own2("headers");
|
|
7237
|
-
const auth = own2("auth");
|
|
7238
|
-
const baseURL = own2("baseURL");
|
|
7239
|
-
const allowAbsoluteUrls = own2("allowAbsoluteUrls");
|
|
7240
|
-
const url = own2("url");
|
|
7241
|
-
newConfig.headers = headers = AxiosHeaders_default.from(headers);
|
|
7242
|
-
newConfig.url = buildURL(
|
|
7243
|
-
buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
|
|
7244
|
-
own2("params"),
|
|
7245
|
-
own2("paramsSerializer")
|
|
7246
|
-
);
|
|
7247
|
-
if (auth) {
|
|
7248
|
-
const username = utils_default.getSafeProp(auth, "username") || "";
|
|
7249
|
-
const password = utils_default.getSafeProp(auth, "password") || "";
|
|
7250
|
-
headers.set(
|
|
7251
|
-
"Authorization",
|
|
7252
|
-
"Basic " + btoa(username + ":" + (password ? encodeUTF8(password) : ""))
|
|
7253
|
-
);
|
|
7254
|
-
}
|
|
7255
|
-
if (utils_default.isFormData(data)) {
|
|
7256
|
-
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) {
|
|
7257
|
-
headers.setContentType(void 0);
|
|
7258
|
-
} else if (utils_default.isFunction(data.getHeaders)) {
|
|
7259
|
-
setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
|
|
7260
|
-
}
|
|
7261
|
-
}
|
|
7262
|
-
if (platform_default.hasStandardBrowserEnv) {
|
|
7263
|
-
if (utils_default.isFunction(withXSRFToken)) {
|
|
7264
|
-
withXSRFToken = withXSRFToken(newConfig);
|
|
7265
|
-
}
|
|
7266
|
-
const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url);
|
|
7267
|
-
if (shouldSendXSRF) {
|
|
7268
|
-
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
|
|
7269
|
-
if (xsrfValue) {
|
|
7270
|
-
headers.set(xsrfHeaderName, xsrfValue);
|
|
7271
|
-
}
|
|
7272
|
-
}
|
|
7273
|
-
}
|
|
7274
|
-
return newConfig;
|
|
7275
|
-
}
|
|
7276
|
-
var resolveConfig_default = resolveConfig;
|
|
7277
|
-
|
|
7278
|
-
// node_modules/axios/lib/adapters/xhr.js
|
|
7279
|
-
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
7280
|
-
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
7281
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
7282
|
-
const _config = resolveConfig_default(config);
|
|
7283
|
-
let requestData = _config.data;
|
|
7284
|
-
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
7285
|
-
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
7286
|
-
let onCanceled;
|
|
7287
|
-
let uploadThrottled, downloadThrottled;
|
|
7288
|
-
let flushUpload, flushDownload;
|
|
7289
|
-
function done() {
|
|
7290
|
-
flushUpload && flushUpload();
|
|
7291
|
-
flushDownload && flushDownload();
|
|
7292
|
-
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
7293
|
-
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
7294
|
-
}
|
|
7295
|
-
let request = new XMLHttpRequest();
|
|
7296
|
-
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
7297
|
-
request.timeout = _config.timeout;
|
|
7298
|
-
function onloadend() {
|
|
7299
|
-
if (!request) {
|
|
7300
|
-
return;
|
|
7301
|
-
}
|
|
7302
|
-
const responseHeaders = AxiosHeaders_default.from(
|
|
7303
|
-
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
7304
|
-
);
|
|
7305
|
-
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
7306
|
-
const response = {
|
|
7307
|
-
data: responseData,
|
|
7308
|
-
status: request.status,
|
|
7309
|
-
statusText: request.statusText,
|
|
7310
|
-
headers: responseHeaders,
|
|
7311
|
-
config,
|
|
7312
|
-
request
|
|
7313
|
-
};
|
|
7314
|
-
settle(
|
|
7315
|
-
function _resolve(value) {
|
|
7316
|
-
resolve(value);
|
|
7317
|
-
done();
|
|
7318
|
-
},
|
|
7319
|
-
function _reject(err) {
|
|
7320
|
-
reject(err);
|
|
7321
|
-
done();
|
|
7322
|
-
},
|
|
7323
|
-
response
|
|
7324
|
-
);
|
|
7325
|
-
request = null;
|
|
7326
|
-
}
|
|
7327
|
-
if ("onloadend" in request) {
|
|
7328
|
-
request.onloadend = onloadend;
|
|
7329
|
-
} else {
|
|
7330
|
-
request.onreadystatechange = function handleLoad() {
|
|
7331
|
-
if (!request || request.readyState !== 4) {
|
|
7332
|
-
return;
|
|
7333
|
-
}
|
|
7334
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) {
|
|
7335
|
-
return;
|
|
7336
|
-
}
|
|
7337
|
-
setTimeout(onloadend);
|
|
7338
|
-
};
|
|
7339
|
-
}
|
|
7340
|
-
request.onabort = function handleAbort() {
|
|
7341
|
-
if (!request) {
|
|
7342
|
-
return;
|
|
7343
|
-
}
|
|
7344
|
-
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
|
|
7345
|
-
done();
|
|
7346
|
-
request = null;
|
|
7347
|
-
};
|
|
7348
|
-
request.onerror = function handleError(event) {
|
|
7349
|
-
const msg = event && event.message ? event.message : "Network Error";
|
|
7350
|
-
const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
|
|
7351
|
-
err.event = event || null;
|
|
7352
|
-
reject(err);
|
|
7353
|
-
done();
|
|
7354
|
-
request = null;
|
|
7355
|
-
};
|
|
7356
|
-
request.ontimeout = function handleTimeout() {
|
|
7357
|
-
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
7358
|
-
const transitional2 = _config.transitional || transitional_default;
|
|
7359
|
-
if (_config.timeoutErrorMessage) {
|
|
7360
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
7361
|
-
}
|
|
7362
|
-
reject(
|
|
7363
|
-
new AxiosError_default(
|
|
7364
|
-
timeoutErrorMessage,
|
|
7365
|
-
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
7366
|
-
config,
|
|
7367
|
-
request
|
|
7368
|
-
)
|
|
7369
|
-
);
|
|
7370
|
-
done();
|
|
7371
|
-
request = null;
|
|
7372
|
-
};
|
|
7373
|
-
requestData === void 0 && requestHeaders.setContentType(null);
|
|
7374
|
-
if ("setRequestHeader" in request) {
|
|
7375
|
-
utils_default.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
|
|
7376
|
-
request.setRequestHeader(key, val);
|
|
7377
|
-
});
|
|
7378
|
-
}
|
|
7379
|
-
if (!utils_default.isUndefined(_config.withCredentials)) {
|
|
7380
|
-
request.withCredentials = !!_config.withCredentials;
|
|
7381
|
-
}
|
|
7382
|
-
if (responseType && responseType !== "json") {
|
|
7383
|
-
request.responseType = _config.responseType;
|
|
7384
|
-
}
|
|
7385
|
-
if (onDownloadProgress) {
|
|
7386
|
-
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
7387
|
-
request.addEventListener("progress", downloadThrottled);
|
|
7388
|
-
}
|
|
7389
|
-
if (onUploadProgress && request.upload) {
|
|
7390
|
-
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
7391
|
-
request.upload.addEventListener("progress", uploadThrottled);
|
|
7392
|
-
request.upload.addEventListener("loadend", flushUpload);
|
|
7393
|
-
}
|
|
7394
|
-
if (_config.cancelToken || _config.signal) {
|
|
7395
|
-
onCanceled = (cancel) => {
|
|
7396
|
-
if (!request) {
|
|
7397
|
-
return;
|
|
7398
|
-
}
|
|
7399
|
-
reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
|
|
7400
|
-
request.abort();
|
|
7401
|
-
done();
|
|
7402
|
-
request = null;
|
|
7403
|
-
};
|
|
7404
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
7405
|
-
if (_config.signal) {
|
|
7406
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
7407
|
-
}
|
|
7408
|
-
}
|
|
7409
|
-
const protocol = parseProtocol(_config.url);
|
|
7410
|
-
if (protocol && !platform_default.protocols.includes(protocol)) {
|
|
7411
|
-
reject(
|
|
7412
|
-
new AxiosError_default(
|
|
7413
|
-
"Unsupported protocol " + protocol + ":",
|
|
7414
|
-
AxiosError_default.ERR_BAD_REQUEST,
|
|
7415
|
-
config
|
|
7416
|
-
)
|
|
7417
|
-
);
|
|
7418
|
-
return;
|
|
7419
|
-
}
|
|
7420
|
-
request.send(requestData || null);
|
|
7421
|
-
});
|
|
7422
|
-
};
|
|
7423
|
-
|
|
7424
|
-
// node_modules/axios/lib/helpers/composeSignals.js
|
|
7425
|
-
var composeSignals = (signals, timeout) => {
|
|
7426
|
-
signals = signals ? signals.filter(Boolean) : [];
|
|
7427
|
-
if (!timeout && !signals.length) {
|
|
7428
|
-
return;
|
|
7429
|
-
}
|
|
7430
|
-
const controller = new AbortController();
|
|
7431
|
-
let aborted = false;
|
|
7432
|
-
const onabort = function(reason) {
|
|
7433
|
-
if (!aborted) {
|
|
7434
|
-
aborted = true;
|
|
7435
|
-
unsubscribe();
|
|
7436
|
-
const err = reason instanceof Error ? reason : this.reason;
|
|
7437
|
-
controller.abort(
|
|
7438
|
-
err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)
|
|
7439
|
-
);
|
|
7440
|
-
}
|
|
7441
|
-
};
|
|
7442
|
-
let timer = timeout && setTimeout(() => {
|
|
7443
|
-
timer = null;
|
|
7444
|
-
onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT));
|
|
7445
|
-
}, timeout);
|
|
7446
|
-
const unsubscribe = () => {
|
|
7447
|
-
if (!signals) {
|
|
7448
|
-
return;
|
|
7449
|
-
}
|
|
7450
|
-
timer && clearTimeout(timer);
|
|
7451
|
-
timer = null;
|
|
7452
|
-
signals.forEach((signal2) => {
|
|
7453
|
-
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
7454
|
-
});
|
|
7455
|
-
signals = null;
|
|
7456
|
-
};
|
|
7457
|
-
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
7458
|
-
const { signal } = controller;
|
|
7459
|
-
signal.unsubscribe = () => utils_default.asap(unsubscribe);
|
|
7460
|
-
return signal;
|
|
7461
|
-
};
|
|
7462
|
-
var composeSignals_default = composeSignals;
|
|
7463
|
-
|
|
7464
|
-
// node_modules/axios/lib/helpers/trackStream.js
|
|
7465
|
-
var streamChunk = function* (chunk, chunkSize) {
|
|
7466
|
-
let len = chunk.byteLength;
|
|
7467
|
-
if (!chunkSize || len < chunkSize) {
|
|
7468
|
-
yield chunk;
|
|
7469
|
-
return;
|
|
7470
|
-
}
|
|
7471
|
-
let pos = 0;
|
|
7472
|
-
let end;
|
|
7473
|
-
while (pos < len) {
|
|
7474
|
-
end = pos + chunkSize;
|
|
7475
|
-
yield chunk.slice(pos, end);
|
|
7476
|
-
pos = end;
|
|
7477
|
-
}
|
|
7478
|
-
};
|
|
7479
|
-
var readBytes = async function* (iterable, chunkSize) {
|
|
7480
|
-
for await (const chunk of readStream(iterable)) {
|
|
7481
|
-
yield* streamChunk(chunk, chunkSize);
|
|
7482
|
-
}
|
|
7483
|
-
};
|
|
7484
|
-
var readStream = async function* (stream) {
|
|
7485
|
-
if (stream[Symbol.asyncIterator]) {
|
|
7486
|
-
yield* stream;
|
|
7487
|
-
return;
|
|
7488
|
-
}
|
|
7489
|
-
const reader = stream.getReader();
|
|
7490
|
-
try {
|
|
7491
|
-
for (; ; ) {
|
|
7492
|
-
const { done, value } = await reader.read();
|
|
7493
|
-
if (done) {
|
|
7494
|
-
break;
|
|
7495
|
-
}
|
|
7496
|
-
yield value;
|
|
7497
|
-
}
|
|
7498
|
-
} finally {
|
|
7499
|
-
await reader.cancel();
|
|
7500
|
-
}
|
|
7501
|
-
};
|
|
7502
|
-
var trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
7503
|
-
const iterator2 = readBytes(stream, chunkSize);
|
|
7504
|
-
let bytes = 0;
|
|
7505
|
-
let done;
|
|
7506
|
-
let _onFinish = (e) => {
|
|
7507
|
-
if (!done) {
|
|
7508
|
-
done = true;
|
|
7509
|
-
onFinish && onFinish(e);
|
|
7510
|
-
}
|
|
7511
|
-
};
|
|
7512
|
-
return new ReadableStream(
|
|
7513
|
-
{
|
|
7514
|
-
async pull(controller) {
|
|
7515
|
-
try {
|
|
7516
|
-
const { done: done2, value } = await iterator2.next();
|
|
7517
|
-
if (done2) {
|
|
7518
|
-
_onFinish();
|
|
7519
|
-
controller.close();
|
|
7520
|
-
return;
|
|
7521
|
-
}
|
|
7522
|
-
let len = value.byteLength;
|
|
7523
|
-
if (onProgress) {
|
|
7524
|
-
let loadedBytes = bytes += len;
|
|
7525
|
-
onProgress(loadedBytes);
|
|
7526
|
-
}
|
|
7527
|
-
controller.enqueue(new Uint8Array(value));
|
|
7528
|
-
} catch (err) {
|
|
7529
|
-
_onFinish(err);
|
|
7530
|
-
throw err;
|
|
7531
|
-
}
|
|
7532
|
-
},
|
|
7533
|
-
cancel(reason) {
|
|
7534
|
-
_onFinish(reason);
|
|
7535
|
-
return iterator2.return();
|
|
7536
|
-
}
|
|
7537
|
-
},
|
|
7538
|
-
{
|
|
7539
|
-
highWaterMark: 2
|
|
7540
|
-
}
|
|
7541
|
-
);
|
|
7542
|
-
};
|
|
7543
|
-
|
|
7544
|
-
// node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
|
|
7545
|
-
var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
|
|
7546
|
-
var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
7547
|
-
function estimateDataURLDecodedBytes(url) {
|
|
7548
|
-
if (!url || typeof url !== "string") return 0;
|
|
7549
|
-
if (!url.startsWith("data:")) return 0;
|
|
7550
|
-
const comma = url.indexOf(",");
|
|
7551
|
-
if (comma < 0) return 0;
|
|
7552
|
-
const meta = url.slice(5, comma);
|
|
7553
|
-
const body = url.slice(comma + 1);
|
|
7554
|
-
const isBase64 = /;base64/i.test(meta);
|
|
7555
|
-
if (isBase64) {
|
|
7556
|
-
let effectiveLen = body.length;
|
|
7557
|
-
const len = body.length;
|
|
7558
|
-
for (let i = 0; i < len; i++) {
|
|
7559
|
-
if (body.charCodeAt(i) === 37 && i + 2 < len) {
|
|
7560
|
-
const a = body.charCodeAt(i + 1);
|
|
7561
|
-
const b = body.charCodeAt(i + 2);
|
|
7562
|
-
const isHex = isHexDigit(a) && isHexDigit(b);
|
|
7563
|
-
if (isHex) {
|
|
7564
|
-
effectiveLen -= 2;
|
|
7565
|
-
i += 2;
|
|
7566
|
-
}
|
|
7567
|
-
}
|
|
7568
|
-
}
|
|
7569
|
-
let pad = 0;
|
|
7570
|
-
let idx = len - 1;
|
|
7571
|
-
const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
|
|
7572
|
-
body.charCodeAt(j - 1) === 51 && // '3'
|
|
7573
|
-
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
|
|
7574
|
-
if (idx >= 0) {
|
|
7575
|
-
if (body.charCodeAt(idx) === 61) {
|
|
7576
|
-
pad++;
|
|
7577
|
-
idx--;
|
|
7578
|
-
} else if (tailIsPct3D(idx)) {
|
|
7579
|
-
pad++;
|
|
7580
|
-
idx -= 3;
|
|
7581
|
-
}
|
|
7582
|
-
}
|
|
7583
|
-
if (pad === 1 && idx >= 0) {
|
|
7584
|
-
if (body.charCodeAt(idx) === 61) {
|
|
7585
|
-
pad++;
|
|
7586
|
-
} else if (tailIsPct3D(idx)) {
|
|
7587
|
-
pad++;
|
|
7588
|
-
}
|
|
7589
|
-
}
|
|
7590
|
-
const groups = Math.floor(effectiveLen / 4);
|
|
7591
|
-
const bytes2 = groups * 3 - (pad || 0);
|
|
7592
|
-
return bytes2 > 0 ? bytes2 : 0;
|
|
7593
|
-
}
|
|
7594
|
-
let bytes = 0;
|
|
7595
|
-
for (let i = 0, len = body.length; i < len; i++) {
|
|
7596
|
-
const c = body.charCodeAt(i);
|
|
7597
|
-
if (c === 37 && isPercentEncodedByte(body, i, len)) {
|
|
7598
|
-
bytes += 1;
|
|
7599
|
-
i += 2;
|
|
7600
|
-
} else if (c < 128) {
|
|
7601
|
-
bytes += 1;
|
|
7602
|
-
} else if (c < 2048) {
|
|
7603
|
-
bytes += 2;
|
|
7604
|
-
} else if (c >= 55296 && c <= 56319 && i + 1 < len) {
|
|
7605
|
-
const next = body.charCodeAt(i + 1);
|
|
7606
|
-
if (next >= 56320 && next <= 57343) {
|
|
7607
|
-
bytes += 4;
|
|
7608
|
-
i++;
|
|
7609
|
-
} else {
|
|
7610
|
-
bytes += 3;
|
|
7611
|
-
}
|
|
7612
|
-
} else {
|
|
7613
|
-
bytes += 3;
|
|
7614
|
-
}
|
|
7615
|
-
}
|
|
7616
|
-
return bytes;
|
|
7617
|
-
}
|
|
7618
|
-
|
|
7619
|
-
// node_modules/axios/lib/env/data.js
|
|
7620
|
-
var VERSION = "1.18.0";
|
|
7621
|
-
|
|
7622
|
-
// node_modules/axios/lib/adapters/fetch.js
|
|
7623
|
-
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
7624
|
-
var { isFunction: isFunction2 } = utils_default;
|
|
7625
|
-
var encodeUTF82 = (str) => encodeURIComponent(str).replace(
|
|
7626
|
-
/%([0-9A-F]{2})/gi,
|
|
7627
|
-
(_, hex) => String.fromCharCode(parseInt(hex, 16))
|
|
7628
|
-
);
|
|
7629
|
-
var decodeURIComponentSafe = (value) => {
|
|
7630
|
-
if (!utils_default.isString(value)) {
|
|
7631
|
-
return value;
|
|
7632
|
-
}
|
|
7633
|
-
try {
|
|
7634
|
-
return decodeURIComponent(value);
|
|
7635
|
-
} catch (error) {
|
|
7636
|
-
return value;
|
|
7637
|
-
}
|
|
7638
|
-
};
|
|
7639
|
-
var test = (fn, ...args) => {
|
|
7640
|
-
try {
|
|
7641
|
-
return !!fn(...args);
|
|
7642
|
-
} catch (e) {
|
|
7643
|
-
return false;
|
|
7644
|
-
}
|
|
7645
|
-
};
|
|
7646
|
-
var maybeWithAuthCredentials = (url) => {
|
|
7647
|
-
const protocolIndex = url.indexOf("://");
|
|
7648
|
-
let urlToCheck = url;
|
|
7649
|
-
if (protocolIndex !== -1) {
|
|
7650
|
-
urlToCheck = urlToCheck.slice(protocolIndex + 3);
|
|
7651
|
-
}
|
|
7652
|
-
return urlToCheck.includes("@") || urlToCheck.includes(":");
|
|
7653
|
-
};
|
|
7654
|
-
var factory = (env) => {
|
|
7655
|
-
const globalObject = utils_default.global !== void 0 && utils_default.global !== null ? utils_default.global : globalThis;
|
|
7656
|
-
const { ReadableStream: ReadableStream2, TextEncoder } = globalObject;
|
|
7657
|
-
env = utils_default.merge.call(
|
|
7658
|
-
{
|
|
7659
|
-
skipUndefined: true
|
|
7660
|
-
},
|
|
7661
|
-
{
|
|
7662
|
-
Request: globalObject.Request,
|
|
7663
|
-
Response: globalObject.Response
|
|
7664
|
-
},
|
|
7665
|
-
env
|
|
7666
|
-
);
|
|
7667
|
-
const { fetch: envFetch, Request, Response } = env;
|
|
7668
|
-
const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
|
|
7669
|
-
const isRequestSupported = isFunction2(Request);
|
|
7670
|
-
const isResponseSupported = isFunction2(Response);
|
|
7671
|
-
if (!isFetchSupported) {
|
|
7672
|
-
return false;
|
|
7673
|
-
}
|
|
7674
|
-
const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
|
|
7675
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
7676
|
-
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
7677
|
-
let duplexAccessed = false;
|
|
7678
|
-
const request = new Request(platform_default.origin, {
|
|
7679
|
-
body: new ReadableStream2(),
|
|
7680
|
-
method: "POST",
|
|
7681
|
-
get duplex() {
|
|
7682
|
-
duplexAccessed = true;
|
|
7683
|
-
return "half";
|
|
7684
|
-
}
|
|
7685
|
-
});
|
|
7686
|
-
const hasContentType = request.headers.has("Content-Type");
|
|
7687
|
-
if (request.body != null) {
|
|
7688
|
-
request.body.cancel();
|
|
7689
|
-
}
|
|
7690
|
-
return duplexAccessed && !hasContentType;
|
|
7691
|
-
});
|
|
7692
|
-
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
7693
|
-
const resolvers = {
|
|
7694
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
7695
|
-
};
|
|
7696
|
-
isFetchSupported && (() => {
|
|
7697
|
-
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
7698
|
-
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
7699
|
-
let method = res && res[type];
|
|
7700
|
-
if (method) {
|
|
7701
|
-
return method.call(res);
|
|
7702
|
-
}
|
|
7703
|
-
throw new AxiosError_default(
|
|
7704
|
-
`Response type '${type}' is not supported`,
|
|
7705
|
-
AxiosError_default.ERR_NOT_SUPPORT,
|
|
7706
|
-
config
|
|
7707
|
-
);
|
|
7708
|
-
});
|
|
7709
|
-
});
|
|
7710
|
-
})();
|
|
7711
|
-
const getBodyLength = async (body) => {
|
|
7712
|
-
if (body == null) {
|
|
7713
|
-
return 0;
|
|
7714
|
-
}
|
|
7715
|
-
if (utils_default.isBlob(body)) {
|
|
7716
|
-
return body.size;
|
|
7717
|
-
}
|
|
7718
|
-
if (utils_default.isSpecCompliantForm(body)) {
|
|
7719
|
-
const _request = new Request(platform_default.origin, {
|
|
7720
|
-
method: "POST",
|
|
7721
|
-
body
|
|
7722
|
-
});
|
|
7723
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
7724
|
-
}
|
|
7725
|
-
if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
|
|
7726
|
-
return body.byteLength;
|
|
7727
|
-
}
|
|
7728
|
-
if (utils_default.isURLSearchParams(body)) {
|
|
7729
|
-
body = body + "";
|
|
7730
|
-
}
|
|
7731
|
-
if (utils_default.isString(body)) {
|
|
7732
|
-
return (await encodeText(body)).byteLength;
|
|
7733
|
-
}
|
|
7734
|
-
};
|
|
7735
|
-
const resolveBodyLength = async (headers, body) => {
|
|
7736
|
-
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
7737
|
-
return length == null ? getBodyLength(body) : length;
|
|
7738
|
-
};
|
|
7739
|
-
return async (config) => {
|
|
7740
|
-
let {
|
|
7741
|
-
url,
|
|
7742
|
-
method,
|
|
7743
|
-
data,
|
|
7744
|
-
signal,
|
|
7745
|
-
cancelToken,
|
|
7746
|
-
timeout,
|
|
7747
|
-
onDownloadProgress,
|
|
7748
|
-
onUploadProgress,
|
|
7749
|
-
responseType,
|
|
7750
|
-
headers,
|
|
7751
|
-
withCredentials = "same-origin",
|
|
7752
|
-
fetchOptions,
|
|
7753
|
-
maxContentLength,
|
|
7754
|
-
maxBodyLength
|
|
7755
|
-
} = resolveConfig_default(config);
|
|
7756
|
-
const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1;
|
|
7757
|
-
const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
7758
|
-
const own2 = (key) => utils_default.hasOwnProp(config, key) ? config[key] : void 0;
|
|
7759
|
-
let _fetch = envFetch || fetch;
|
|
7760
|
-
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
7761
|
-
let composedSignal = composeSignals_default(
|
|
7762
|
-
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
7763
|
-
timeout
|
|
7764
|
-
);
|
|
7765
|
-
let request = null;
|
|
7766
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
7767
|
-
composedSignal.unsubscribe();
|
|
7768
|
-
});
|
|
7769
|
-
let requestContentLength;
|
|
7770
|
-
let pendingBodyError = null;
|
|
7771
|
-
const maxBodyLengthError = () => new AxiosError_default(
|
|
7772
|
-
"Request body larger than maxBodyLength limit",
|
|
7773
|
-
AxiosError_default.ERR_BAD_REQUEST,
|
|
7774
|
-
config,
|
|
7775
|
-
request
|
|
7776
|
-
);
|
|
7777
|
-
try {
|
|
7778
|
-
let auth = void 0;
|
|
7779
|
-
const configAuth = own2("auth");
|
|
7780
|
-
if (configAuth) {
|
|
7781
|
-
const username = utils_default.getSafeProp(configAuth, "username") || "";
|
|
7782
|
-
const password = utils_default.getSafeProp(configAuth, "password") || "";
|
|
7783
|
-
auth = {
|
|
7784
|
-
username,
|
|
7785
|
-
password
|
|
7786
|
-
};
|
|
7787
|
-
}
|
|
7788
|
-
if (maybeWithAuthCredentials(url)) {
|
|
7789
|
-
const parsedURL = new URL(url, platform_default.origin);
|
|
7790
|
-
if (!auth && (parsedURL.username || parsedURL.password)) {
|
|
7791
|
-
const urlUsername = decodeURIComponentSafe(parsedURL.username);
|
|
7792
|
-
const urlPassword = decodeURIComponentSafe(parsedURL.password);
|
|
7793
|
-
auth = {
|
|
7794
|
-
username: urlUsername,
|
|
7795
|
-
password: urlPassword
|
|
7796
|
-
};
|
|
7797
|
-
}
|
|
7798
|
-
if (parsedURL.username || parsedURL.password) {
|
|
7799
|
-
parsedURL.username = "";
|
|
7800
|
-
parsedURL.password = "";
|
|
7801
|
-
url = parsedURL.href;
|
|
5282
|
+
} else {
|
|
5283
|
+
addLog("PAYMENT FAILED");
|
|
7802
5284
|
}
|
|
5285
|
+
externalCallback(status, null);
|
|
5286
|
+
emitPaymentStatus(status, null);
|
|
5287
|
+
} catch (err) {
|
|
5288
|
+
addLog("PAYMENT CALLBACK ERROR:", err.message);
|
|
5289
|
+
externalCallback(null, err);
|
|
5290
|
+
emitPaymentStatus(null, err);
|
|
7803
5291
|
}
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
throw new AxiosError_default(
|
|
7815
|
-
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
7816
|
-
AxiosError_default.ERR_BAD_RESPONSE,
|
|
7817
|
-
config,
|
|
7818
|
-
request
|
|
5292
|
+
};
|
|
5293
|
+
initializePayment = async (externalCallback = () => {
|
|
5294
|
+
}) => {
|
|
5295
|
+
if (paymentInitialized) return;
|
|
5296
|
+
paymentInitialized = true;
|
|
5297
|
+
if (isCapacitor) {
|
|
5298
|
+
App.addListener("appUrlOpen", (event) => {
|
|
5299
|
+
handlePaymentCallback(
|
|
5300
|
+
event.url,
|
|
5301
|
+
externalCallback
|
|
7819
5302
|
);
|
|
7820
|
-
}
|
|
7821
|
-
}
|
|
7822
|
-
if (hasMaxBodyLength && method !== "get" && method !== "head") {
|
|
7823
|
-
const outboundLength = await getBodyLength(data);
|
|
7824
|
-
if (typeof outboundLength === "number" && isFinite(outboundLength)) {
|
|
7825
|
-
requestContentLength = outboundLength;
|
|
7826
|
-
if (outboundLength > maxBodyLength) {
|
|
7827
|
-
throw maxBodyLengthError();
|
|
7828
|
-
}
|
|
7829
|
-
}
|
|
5303
|
+
});
|
|
7830
5304
|
}
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
throw pendingBodyError = maxBodyLengthError();
|
|
7838
|
-
}
|
|
7839
|
-
onProgress && onProgress(loadedBytes);
|
|
7840
|
-
},
|
|
7841
|
-
flush
|
|
7842
|
-
);
|
|
7843
|
-
if (supportsRequestStream && method !== "get" && method !== "head" && (onUploadProgress || mustEnforceStreamBody)) {
|
|
7844
|
-
requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
|
|
7845
|
-
if (requestContentLength !== 0 || mustEnforceStreamBody) {
|
|
7846
|
-
let _request = new Request(url, {
|
|
7847
|
-
method: "POST",
|
|
7848
|
-
body: data,
|
|
7849
|
-
duplex: "half"
|
|
7850
|
-
});
|
|
7851
|
-
let contentTypeHeader;
|
|
7852
|
-
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
7853
|
-
headers.setContentType(contentTypeHeader);
|
|
5305
|
+
if (isTauri) {
|
|
5306
|
+
const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
|
|
5307
|
+
await listen2("deep-link://open-url", async (event) => {
|
|
5308
|
+
let url = event.payload;
|
|
5309
|
+
if (typeof url === "object") {
|
|
5310
|
+
url = url?.url || url?.payload || null;
|
|
7854
5311
|
}
|
|
7855
|
-
if (
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
5312
|
+
if (!url) return;
|
|
5313
|
+
if (paymentWindowRef) {
|
|
5314
|
+
try {
|
|
5315
|
+
await paymentWindowRef.close();
|
|
5316
|
+
paymentWindowRef = null;
|
|
5317
|
+
} catch (e) {
|
|
5318
|
+
}
|
|
7861
5319
|
}
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
} else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== "get" && method !== "head") {
|
|
7866
|
-
throw new AxiosError_default(
|
|
7867
|
-
"Stream request bodies are not supported by the current fetch implementation",
|
|
7868
|
-
AxiosError_default.ERR_NOT_SUPPORT,
|
|
7869
|
-
config,
|
|
7870
|
-
request
|
|
7871
|
-
);
|
|
7872
|
-
}
|
|
7873
|
-
if (!utils_default.isString(withCredentials)) {
|
|
7874
|
-
withCredentials = withCredentials ? "include" : "omit";
|
|
7875
|
-
}
|
|
7876
|
-
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
7877
|
-
if (utils_default.isFormData(data)) {
|
|
7878
|
-
const contentType = headers.getContentType();
|
|
7879
|
-
if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
|
|
7880
|
-
headers.delete("content-type");
|
|
7881
|
-
}
|
|
7882
|
-
}
|
|
7883
|
-
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
7884
|
-
const resolvedOptions = {
|
|
7885
|
-
...fetchOptions,
|
|
7886
|
-
signal: composedSignal,
|
|
7887
|
-
method: method.toUpperCase(),
|
|
7888
|
-
headers: toByteStringHeaderObject(headers.normalize()),
|
|
7889
|
-
body: data,
|
|
7890
|
-
duplex: "half",
|
|
7891
|
-
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
7892
|
-
};
|
|
7893
|
-
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
7894
|
-
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
7895
|
-
const responseHeaders = AxiosHeaders_default.from(response.headers);
|
|
7896
|
-
if (hasMaxContentLength) {
|
|
7897
|
-
const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
|
|
7898
|
-
if (declaredLength != null && declaredLength > maxContentLength) {
|
|
7899
|
-
throw new AxiosError_default(
|
|
7900
|
-
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
7901
|
-
AxiosError_default.ERR_BAD_RESPONSE,
|
|
7902
|
-
config,
|
|
7903
|
-
request
|
|
5320
|
+
handlePaymentCallback(
|
|
5321
|
+
url,
|
|
5322
|
+
externalCallback
|
|
7904
5323
|
);
|
|
7905
|
-
}
|
|
7906
|
-
}
|
|
7907
|
-
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
7908
|
-
if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
|
|
7909
|
-
const options = {};
|
|
7910
|
-
["status", "statusText", "headers"].forEach((prop) => {
|
|
7911
|
-
options[prop] = response[prop];
|
|
7912
5324
|
});
|
|
7913
|
-
const responseContentLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
|
|
7914
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
7915
|
-
responseContentLength,
|
|
7916
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
7917
|
-
) || [];
|
|
7918
|
-
let bytesRead = 0;
|
|
7919
|
-
const onChunkProgress = (loadedBytes) => {
|
|
7920
|
-
if (hasMaxContentLength) {
|
|
7921
|
-
bytesRead = loadedBytes;
|
|
7922
|
-
if (bytesRead > maxContentLength) {
|
|
7923
|
-
throw new AxiosError_default(
|
|
7924
|
-
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
7925
|
-
AxiosError_default.ERR_BAD_RESPONSE,
|
|
7926
|
-
config,
|
|
7927
|
-
request
|
|
7928
|
-
);
|
|
7929
|
-
}
|
|
7930
|
-
}
|
|
7931
|
-
onProgress && onProgress(loadedBytes);
|
|
7932
|
-
};
|
|
7933
|
-
response = new Response(
|
|
7934
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
|
|
7935
|
-
flush && flush();
|
|
7936
|
-
unsubscribe && unsubscribe();
|
|
7937
|
-
}),
|
|
7938
|
-
options
|
|
7939
|
-
);
|
|
7940
5325
|
}
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
let materializedSize;
|
|
7948
|
-
if (responseData != null) {
|
|
7949
|
-
if (typeof responseData.byteLength === "number") {
|
|
7950
|
-
materializedSize = responseData.byteLength;
|
|
7951
|
-
} else if (typeof responseData.size === "number") {
|
|
7952
|
-
materializedSize = responseData.size;
|
|
7953
|
-
} else if (typeof responseData === "string") {
|
|
7954
|
-
materializedSize = typeof TextEncoder === "function" ? new TextEncoder().encode(responseData).byteLength : responseData.length;
|
|
7955
|
-
}
|
|
7956
|
-
}
|
|
7957
|
-
if (typeof materializedSize === "number" && materializedSize > maxContentLength) {
|
|
7958
|
-
throw new AxiosError_default(
|
|
7959
|
-
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
7960
|
-
AxiosError_default.ERR_BAD_RESPONSE,
|
|
7961
|
-
config,
|
|
7962
|
-
request
|
|
7963
|
-
);
|
|
7964
|
-
}
|
|
5326
|
+
};
|
|
5327
|
+
createPayment = async (amountZAR, {
|
|
5328
|
+
appId = "tevrocsoft",
|
|
5329
|
+
serviceUrl = "https://tevrocsoftapi.netlify.app",
|
|
5330
|
+
payAccount = "default",
|
|
5331
|
+
externalCallback = () => {
|
|
7965
5332
|
}
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
5333
|
+
} = {}) => {
|
|
5334
|
+
await initializePayment(externalCallback);
|
|
5335
|
+
const cents = Math.round(Number(amountZAR) * 100);
|
|
5336
|
+
const basePaymentUrl = `${serviceUrl.replace(/\/$/, "")}/yoco-pay`;
|
|
5337
|
+
const paymentUrl = `${basePaymentUrl}?mode=mobile&amount=${cents}&app=${appId}&account=${payAccount}`;
|
|
5338
|
+
console.log(basePaymentUrl, paymentUrl);
|
|
5339
|
+
if (isCapacitor) {
|
|
5340
|
+
await Browser2.open({
|
|
5341
|
+
url: paymentUrl
|
|
7975
5342
|
});
|
|
7976
|
-
|
|
7977
|
-
} catch (err) {
|
|
7978
|
-
unsubscribe && unsubscribe();
|
|
7979
|
-
if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError_default) {
|
|
7980
|
-
const canceledError = composedSignal.reason;
|
|
7981
|
-
canceledError.config = config;
|
|
7982
|
-
request && (canceledError.request = request);
|
|
7983
|
-
err !== canceledError && (canceledError.cause = err);
|
|
7984
|
-
throw canceledError;
|
|
7985
|
-
}
|
|
7986
|
-
if (pendingBodyError) {
|
|
7987
|
-
request && !pendingBodyError.request && (pendingBodyError.request = request);
|
|
7988
|
-
throw pendingBodyError;
|
|
7989
|
-
}
|
|
7990
|
-
if (err instanceof AxiosError_default) {
|
|
7991
|
-
request && !err.request && (err.request = request);
|
|
7992
|
-
throw err;
|
|
7993
|
-
}
|
|
7994
|
-
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
7995
|
-
throw Object.assign(
|
|
7996
|
-
new AxiosError_default(
|
|
7997
|
-
"Network Error",
|
|
7998
|
-
AxiosError_default.ERR_NETWORK,
|
|
7999
|
-
config,
|
|
8000
|
-
request,
|
|
8001
|
-
err && err.response
|
|
8002
|
-
),
|
|
8003
|
-
{
|
|
8004
|
-
cause: err.cause || err
|
|
8005
|
-
}
|
|
8006
|
-
);
|
|
5343
|
+
return;
|
|
8007
5344
|
}
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
var adapter = getFetch();
|
|
8027
|
-
|
|
8028
|
-
// node_modules/axios/lib/adapters/adapters.js
|
|
8029
|
-
var knownAdapters = {
|
|
8030
|
-
http: null_default,
|
|
8031
|
-
xhr: xhr_default,
|
|
8032
|
-
fetch: {
|
|
8033
|
-
get: getFetch
|
|
8034
|
-
}
|
|
8035
|
-
};
|
|
8036
|
-
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
8037
|
-
if (fn) {
|
|
8038
|
-
try {
|
|
8039
|
-
Object.defineProperty(fn, "name", { __proto__: null, value });
|
|
8040
|
-
} catch (e) {
|
|
8041
|
-
}
|
|
8042
|
-
Object.defineProperty(fn, "adapterName", { __proto__: null, value });
|
|
8043
|
-
}
|
|
8044
|
-
});
|
|
8045
|
-
var renderReason = (reason) => `- ${reason}`;
|
|
8046
|
-
var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
|
|
8047
|
-
function getAdapter(adapters, config) {
|
|
8048
|
-
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
8049
|
-
const { length } = adapters;
|
|
8050
|
-
let nameOrAdapter;
|
|
8051
|
-
let adapter2;
|
|
8052
|
-
const rejectedReasons = {};
|
|
8053
|
-
for (let i = 0; i < length; i++) {
|
|
8054
|
-
nameOrAdapter = adapters[i];
|
|
8055
|
-
let id;
|
|
8056
|
-
adapter2 = nameOrAdapter;
|
|
8057
|
-
if (!isResolvedHandle(nameOrAdapter)) {
|
|
8058
|
-
adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
8059
|
-
if (adapter2 === void 0) {
|
|
8060
|
-
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
5345
|
+
if (isTauri) {
|
|
5346
|
+
const url = `${basePaymentUrl}?mode=desktop&amount=${cents}&app=${appId}&account=${payAccount}`;
|
|
5347
|
+
const win = new WebviewWindow("payment", {
|
|
5348
|
+
url,
|
|
5349
|
+
title: "Complete Payment",
|
|
5350
|
+
width: 550,
|
|
5351
|
+
height: 600,
|
|
5352
|
+
resizable: true,
|
|
5353
|
+
center: true
|
|
5354
|
+
});
|
|
5355
|
+
paymentWindowRef = win;
|
|
5356
|
+
win.once("tauri://created", () => {
|
|
5357
|
+
console.log("Payment window opened");
|
|
5358
|
+
});
|
|
5359
|
+
win.once("tauri://error", (e) => {
|
|
5360
|
+
console.error("Payment window error:", e);
|
|
5361
|
+
});
|
|
5362
|
+
return;
|
|
8061
5363
|
}
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
}
|
|
8066
|
-
rejectedReasons[id || "#" + i] = adapter2;
|
|
8067
|
-
}
|
|
8068
|
-
if (!adapter2) {
|
|
8069
|
-
const reasons = Object.entries(rejectedReasons).map(
|
|
8070
|
-
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
8071
|
-
);
|
|
8072
|
-
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
8073
|
-
throw new AxiosError_default(
|
|
8074
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
8075
|
-
"ERR_NOT_SUPPORT"
|
|
8076
|
-
);
|
|
8077
|
-
}
|
|
8078
|
-
return adapter2;
|
|
8079
|
-
}
|
|
8080
|
-
var adapters_default = {
|
|
8081
|
-
/**
|
|
8082
|
-
* Resolve an adapter from a list of adapter names or functions.
|
|
8083
|
-
* @type {Function}
|
|
8084
|
-
*/
|
|
8085
|
-
getAdapter,
|
|
8086
|
-
/**
|
|
8087
|
-
* Exposes all known adapters
|
|
8088
|
-
* @type {Object<string, Function|Object>}
|
|
8089
|
-
*/
|
|
8090
|
-
adapters: knownAdapters
|
|
8091
|
-
};
|
|
8092
|
-
|
|
8093
|
-
// node_modules/axios/lib/core/dispatchRequest.js
|
|
8094
|
-
function throwIfCancellationRequested(config) {
|
|
8095
|
-
if (config.cancelToken) {
|
|
8096
|
-
config.cancelToken.throwIfRequested();
|
|
8097
|
-
}
|
|
8098
|
-
if (config.signal && config.signal.aborted) {
|
|
8099
|
-
throw new CanceledError_default(null, config);
|
|
8100
|
-
}
|
|
8101
|
-
}
|
|
8102
|
-
function dispatchRequest(config) {
|
|
8103
|
-
throwIfCancellationRequested(config);
|
|
8104
|
-
config.headers = AxiosHeaders_default.from(config.headers);
|
|
8105
|
-
config.data = transformData.call(config, config.transformRequest);
|
|
8106
|
-
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
8107
|
-
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
8108
|
-
}
|
|
8109
|
-
const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
|
|
8110
|
-
return adapter2(config).then(
|
|
8111
|
-
function onAdapterResolution(response) {
|
|
8112
|
-
throwIfCancellationRequested(config);
|
|
8113
|
-
config.response = response;
|
|
5364
|
+
const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
|
|
5365
|
+
const mode = isLocalhost ? "localhost" : "netlify";
|
|
5366
|
+
const finalUrl = `${basePaymentUrl}?mode=${mode}&amount=${cents}&app=${appId}`;
|
|
8114
5367
|
try {
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
if (!isCancel(reason)) {
|
|
8124
|
-
throwIfCancellationRequested(config);
|
|
8125
|
-
if (reason && reason.response) {
|
|
8126
|
-
config.response = reason.response;
|
|
5368
|
+
const popup = window.open(finalUrl, "yocoPayment", "width=500,height=650");
|
|
5369
|
+
if (!popup) {
|
|
5370
|
+
window.location.href = finalUrl;
|
|
5371
|
+
return;
|
|
5372
|
+
}
|
|
5373
|
+
let listenerAttached = true;
|
|
5374
|
+
let timerRunning = true;
|
|
5375
|
+
const listener = (event) => {
|
|
8127
5376
|
try {
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
5377
|
+
const serviceOrigin = new URL(serviceUrl).origin;
|
|
5378
|
+
if (event.origin !== serviceOrigin) return;
|
|
5379
|
+
if (event.data?.type === "payment-result") {
|
|
5380
|
+
const status = event.data?.status || null;
|
|
5381
|
+
listenerAttached = false;
|
|
5382
|
+
timerRunning = false;
|
|
5383
|
+
window.removeEventListener("message", listener);
|
|
5384
|
+
try {
|
|
5385
|
+
popup.close();
|
|
5386
|
+
} catch (e) {
|
|
5387
|
+
}
|
|
5388
|
+
const url = status ? `${window.location.href}${window.location.href.includes("?") ? "&" : "?"}status=${status}` : window.location.href;
|
|
5389
|
+
handlePaymentCallback(url, externalCallback);
|
|
5390
|
+
}
|
|
5391
|
+
} catch (err) {
|
|
5392
|
+
console.error("Payment listener error", err);
|
|
8135
5393
|
}
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
}
|
|
8143
|
-
|
|
8144
|
-
// node_modules/axios/lib/helpers/validator.js
|
|
8145
|
-
var validators = {};
|
|
8146
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
8147
|
-
validators[type] = function validator(thing) {
|
|
8148
|
-
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
8149
|
-
};
|
|
8150
|
-
});
|
|
8151
|
-
var deprecatedWarnings = {};
|
|
8152
|
-
validators.transitional = function transitional(validator, version, message) {
|
|
8153
|
-
function formatMessage(opt, desc) {
|
|
8154
|
-
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
8155
|
-
}
|
|
8156
|
-
return (value, opt, opts) => {
|
|
8157
|
-
if (validator === false) {
|
|
8158
|
-
throw new AxiosError_default(
|
|
8159
|
-
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
8160
|
-
AxiosError_default.ERR_DEPRECATED
|
|
8161
|
-
);
|
|
8162
|
-
}
|
|
8163
|
-
if (version && !deprecatedWarnings[opt]) {
|
|
8164
|
-
deprecatedWarnings[opt] = true;
|
|
8165
|
-
console.warn(
|
|
8166
|
-
formatMessage(
|
|
8167
|
-
opt,
|
|
8168
|
-
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
8169
|
-
)
|
|
8170
|
-
);
|
|
8171
|
-
}
|
|
8172
|
-
return validator ? validator(value, opt, opts) : true;
|
|
8173
|
-
};
|
|
8174
|
-
};
|
|
8175
|
-
validators.spelling = function spelling(correctSpelling) {
|
|
8176
|
-
return (value, opt) => {
|
|
8177
|
-
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
8178
|
-
return true;
|
|
8179
|
-
};
|
|
8180
|
-
};
|
|
8181
|
-
function assertOptions(options, schema, allowUnknown) {
|
|
8182
|
-
if (typeof options !== "object") {
|
|
8183
|
-
throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
8184
|
-
}
|
|
8185
|
-
const keys = Object.keys(options);
|
|
8186
|
-
let i = keys.length;
|
|
8187
|
-
while (i-- > 0) {
|
|
8188
|
-
const opt = keys[i];
|
|
8189
|
-
const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0;
|
|
8190
|
-
if (validator) {
|
|
8191
|
-
const value = options[opt];
|
|
8192
|
-
const result = value === void 0 || validator(value, opt, options);
|
|
8193
|
-
if (result !== true) {
|
|
8194
|
-
throw new AxiosError_default(
|
|
8195
|
-
"option " + opt + " must be " + result,
|
|
8196
|
-
AxiosError_default.ERR_BAD_OPTION_VALUE
|
|
8197
|
-
);
|
|
8198
|
-
}
|
|
8199
|
-
continue;
|
|
8200
|
-
}
|
|
8201
|
-
if (allowUnknown !== true) {
|
|
8202
|
-
throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
|
|
8203
|
-
}
|
|
8204
|
-
}
|
|
8205
|
-
}
|
|
8206
|
-
var validator_default = {
|
|
8207
|
-
assertOptions,
|
|
8208
|
-
validators
|
|
8209
|
-
};
|
|
8210
|
-
|
|
8211
|
-
// node_modules/axios/lib/core/Axios.js
|
|
8212
|
-
var validators2 = validator_default.validators;
|
|
8213
|
-
var Axios = class {
|
|
8214
|
-
constructor(instanceConfig) {
|
|
8215
|
-
this.defaults = instanceConfig || {};
|
|
8216
|
-
this.interceptors = {
|
|
8217
|
-
request: new InterceptorManager_default(),
|
|
8218
|
-
response: new InterceptorManager_default()
|
|
8219
|
-
};
|
|
8220
|
-
}
|
|
8221
|
-
/**
|
|
8222
|
-
* Dispatch a request
|
|
8223
|
-
*
|
|
8224
|
-
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
8225
|
-
* @param {?Object} config
|
|
8226
|
-
*
|
|
8227
|
-
* @returns {Promise} The Promise to be fulfilled
|
|
8228
|
-
*/
|
|
8229
|
-
async request(configOrUrl, config) {
|
|
8230
|
-
try {
|
|
8231
|
-
return await this._request(configOrUrl, config);
|
|
8232
|
-
} catch (err) {
|
|
8233
|
-
if (err instanceof Error) {
|
|
8234
|
-
let dummy = {};
|
|
8235
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
8236
|
-
const stack = (() => {
|
|
8237
|
-
if (!dummy.stack) {
|
|
8238
|
-
return "";
|
|
5394
|
+
};
|
|
5395
|
+
window.addEventListener("message", listener);
|
|
5396
|
+
const timer = setInterval(() => {
|
|
5397
|
+
if (!timerRunning) {
|
|
5398
|
+
clearInterval(timer);
|
|
5399
|
+
return;
|
|
8239
5400
|
}
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
} else if (stack) {
|
|
8247
|
-
const firstNewlineIndex = stack.indexOf("\n");
|
|
8248
|
-
const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
|
|
8249
|
-
const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
|
|
8250
|
-
if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
|
|
8251
|
-
err.stack += "\n" + stack;
|
|
5401
|
+
if (popup.closed) {
|
|
5402
|
+
clearInterval(timer);
|
|
5403
|
+
timerRunning = false;
|
|
5404
|
+
if (listenerAttached) {
|
|
5405
|
+
listenerAttached = false;
|
|
5406
|
+
window.removeEventListener("message", listener);
|
|
8252
5407
|
}
|
|
8253
5408
|
}
|
|
8254
|
-
}
|
|
8255
|
-
}
|
|
8256
|
-
}
|
|
8257
|
-
throw err;
|
|
8258
|
-
}
|
|
8259
|
-
}
|
|
8260
|
-
_request(configOrUrl, config) {
|
|
8261
|
-
if (typeof configOrUrl === "string") {
|
|
8262
|
-
config = config || {};
|
|
8263
|
-
config.url = configOrUrl;
|
|
8264
|
-
} else {
|
|
8265
|
-
config = configOrUrl || {};
|
|
8266
|
-
}
|
|
8267
|
-
config = mergeConfig(this.defaults, config);
|
|
8268
|
-
const { transitional: transitional2, paramsSerializer, headers } = config;
|
|
8269
|
-
if (transitional2 !== void 0) {
|
|
8270
|
-
validator_default.assertOptions(
|
|
8271
|
-
transitional2,
|
|
8272
|
-
{
|
|
8273
|
-
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
8274
|
-
forcedJSONParsing: validators2.transitional(validators2.boolean),
|
|
8275
|
-
clarifyTimeoutError: validators2.transitional(validators2.boolean),
|
|
8276
|
-
legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean),
|
|
8277
|
-
advertiseZstdAcceptEncoding: validators2.transitional(validators2.boolean),
|
|
8278
|
-
validateStatusUndefinedResolves: validators2.transitional(validators2.boolean)
|
|
8279
|
-
},
|
|
8280
|
-
false
|
|
8281
|
-
);
|
|
8282
|
-
}
|
|
8283
|
-
if (paramsSerializer != null) {
|
|
8284
|
-
if (utils_default.isFunction(paramsSerializer)) {
|
|
8285
|
-
config.paramsSerializer = {
|
|
8286
|
-
serialize: paramsSerializer
|
|
8287
|
-
};
|
|
8288
|
-
} else {
|
|
8289
|
-
validator_default.assertOptions(
|
|
8290
|
-
paramsSerializer,
|
|
8291
|
-
{
|
|
8292
|
-
encode: validators2.function,
|
|
8293
|
-
serialize: validators2.function
|
|
8294
|
-
},
|
|
8295
|
-
true
|
|
8296
|
-
);
|
|
8297
|
-
}
|
|
8298
|
-
}
|
|
8299
|
-
if (config.allowAbsoluteUrls !== void 0) {
|
|
8300
|
-
} else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
8301
|
-
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
8302
|
-
} else {
|
|
8303
|
-
config.allowAbsoluteUrls = true;
|
|
8304
|
-
}
|
|
8305
|
-
validator_default.assertOptions(
|
|
8306
|
-
config,
|
|
8307
|
-
{
|
|
8308
|
-
baseUrl: validators2.spelling("baseURL"),
|
|
8309
|
-
withXsrfToken: validators2.spelling("withXSRFToken")
|
|
8310
|
-
},
|
|
8311
|
-
true
|
|
8312
|
-
);
|
|
8313
|
-
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
8314
|
-
let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
|
|
8315
|
-
headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => {
|
|
8316
|
-
delete headers[method];
|
|
8317
|
-
});
|
|
8318
|
-
config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
8319
|
-
const requestInterceptorChain = [];
|
|
8320
|
-
let synchronousRequestInterceptors = true;
|
|
8321
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
8322
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
5409
|
+
}, 500);
|
|
8323
5410
|
return;
|
|
8324
|
-
}
|
|
8325
|
-
|
|
8326
|
-
const transitional3 = config.transitional || transitional_default;
|
|
8327
|
-
const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering;
|
|
8328
|
-
if (legacyInterceptorReqResOrdering) {
|
|
8329
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
8330
|
-
} else {
|
|
8331
|
-
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
8332
|
-
}
|
|
8333
|
-
});
|
|
8334
|
-
const responseInterceptorChain = [];
|
|
8335
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
8336
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
8337
|
-
});
|
|
8338
|
-
let promise;
|
|
8339
|
-
let i = 0;
|
|
8340
|
-
let len;
|
|
8341
|
-
if (!synchronousRequestInterceptors) {
|
|
8342
|
-
const chain = [dispatchRequest.bind(this), void 0];
|
|
8343
|
-
chain.unshift(...requestInterceptorChain);
|
|
8344
|
-
chain.push(...responseInterceptorChain);
|
|
8345
|
-
len = chain.length;
|
|
8346
|
-
promise = Promise.resolve(config);
|
|
8347
|
-
while (i < len) {
|
|
8348
|
-
promise = promise.then(chain[i++], chain[i++]);
|
|
8349
|
-
}
|
|
8350
|
-
return promise;
|
|
8351
|
-
}
|
|
8352
|
-
len = requestInterceptorChain.length;
|
|
8353
|
-
let newConfig = config;
|
|
8354
|
-
while (i < len) {
|
|
8355
|
-
const onFulfilled = requestInterceptorChain[i++];
|
|
8356
|
-
const onRejected = requestInterceptorChain[i++];
|
|
8357
|
-
try {
|
|
8358
|
-
newConfig = onFulfilled(newConfig);
|
|
8359
|
-
} catch (error) {
|
|
8360
|
-
onRejected.call(this, error);
|
|
8361
|
-
break;
|
|
8362
|
-
}
|
|
8363
|
-
}
|
|
8364
|
-
try {
|
|
8365
|
-
promise = dispatchRequest.call(this, newConfig);
|
|
8366
|
-
} catch (error) {
|
|
8367
|
-
return Promise.reject(error);
|
|
8368
|
-
}
|
|
8369
|
-
i = 0;
|
|
8370
|
-
len = responseInterceptorChain.length;
|
|
8371
|
-
while (i < len) {
|
|
8372
|
-
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
8373
|
-
}
|
|
8374
|
-
return promise;
|
|
8375
|
-
}
|
|
8376
|
-
getUri(config) {
|
|
8377
|
-
config = mergeConfig(this.defaults, config);
|
|
8378
|
-
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
|
|
8379
|
-
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
8380
|
-
}
|
|
8381
|
-
};
|
|
8382
|
-
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
8383
|
-
Axios.prototype[method] = function(url, config) {
|
|
8384
|
-
return this.request(
|
|
8385
|
-
mergeConfig(config || {}, {
|
|
8386
|
-
method,
|
|
8387
|
-
url,
|
|
8388
|
-
data: config && utils_default.hasOwnProp(config, "data") ? config.data : void 0
|
|
8389
|
-
})
|
|
8390
|
-
);
|
|
8391
|
-
};
|
|
8392
|
-
});
|
|
8393
|
-
utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
|
|
8394
|
-
function generateHTTPMethod(isForm) {
|
|
8395
|
-
return function httpMethod(url, data, config) {
|
|
8396
|
-
return this.request(
|
|
8397
|
-
mergeConfig(config || {}, {
|
|
8398
|
-
method,
|
|
8399
|
-
headers: isForm ? {
|
|
8400
|
-
"Content-Type": "multipart/form-data"
|
|
8401
|
-
} : {},
|
|
8402
|
-
url,
|
|
8403
|
-
data
|
|
8404
|
-
})
|
|
8405
|
-
);
|
|
8406
|
-
};
|
|
8407
|
-
}
|
|
8408
|
-
Axios.prototype[method] = generateHTTPMethod();
|
|
8409
|
-
if (method !== "query") {
|
|
8410
|
-
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
8411
|
-
}
|
|
8412
|
-
});
|
|
8413
|
-
var Axios_default = Axios;
|
|
8414
|
-
|
|
8415
|
-
// node_modules/axios/lib/cancel/CancelToken.js
|
|
8416
|
-
var CancelToken = class _CancelToken {
|
|
8417
|
-
constructor(executor) {
|
|
8418
|
-
if (typeof executor !== "function") {
|
|
8419
|
-
throw new TypeError("executor must be a function.");
|
|
8420
|
-
}
|
|
8421
|
-
let resolvePromise;
|
|
8422
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
8423
|
-
resolvePromise = resolve;
|
|
8424
|
-
});
|
|
8425
|
-
const token = this;
|
|
8426
|
-
this.promise.then((cancel) => {
|
|
8427
|
-
if (!token._listeners) return;
|
|
8428
|
-
let i = token._listeners.length;
|
|
8429
|
-
while (i-- > 0) {
|
|
8430
|
-
token._listeners[i](cancel);
|
|
8431
|
-
}
|
|
8432
|
-
token._listeners = null;
|
|
8433
|
-
});
|
|
8434
|
-
this.promise.then = (onfulfilled) => {
|
|
8435
|
-
let _resolve;
|
|
8436
|
-
const promise = new Promise((resolve) => {
|
|
8437
|
-
token.subscribe(resolve);
|
|
8438
|
-
_resolve = resolve;
|
|
8439
|
-
}).then(onfulfilled);
|
|
8440
|
-
promise.cancel = function reject() {
|
|
8441
|
-
token.unsubscribe(_resolve);
|
|
8442
|
-
};
|
|
8443
|
-
return promise;
|
|
8444
|
-
};
|
|
8445
|
-
executor(function cancel(message, config, request) {
|
|
8446
|
-
if (token.reason) {
|
|
5411
|
+
} catch (e) {
|
|
5412
|
+
window.location.href = finalUrl;
|
|
8447
5413
|
return;
|
|
8448
5414
|
}
|
|
8449
|
-
token.reason = new CanceledError_default(message, config, request);
|
|
8450
|
-
resolvePromise(token.reason);
|
|
8451
|
-
});
|
|
8452
|
-
}
|
|
8453
|
-
/**
|
|
8454
|
-
* Throws a `CanceledError` if cancellation has been requested.
|
|
8455
|
-
*/
|
|
8456
|
-
throwIfRequested() {
|
|
8457
|
-
if (this.reason) {
|
|
8458
|
-
throw this.reason;
|
|
8459
|
-
}
|
|
8460
|
-
}
|
|
8461
|
-
/**
|
|
8462
|
-
* Subscribe to the cancel signal
|
|
8463
|
-
*/
|
|
8464
|
-
subscribe(listener) {
|
|
8465
|
-
if (this.reason) {
|
|
8466
|
-
listener(this.reason);
|
|
8467
|
-
return;
|
|
8468
|
-
}
|
|
8469
|
-
if (this._listeners) {
|
|
8470
|
-
this._listeners.push(listener);
|
|
8471
|
-
} else {
|
|
8472
|
-
this._listeners = [listener];
|
|
8473
|
-
}
|
|
8474
|
-
}
|
|
8475
|
-
/**
|
|
8476
|
-
* Unsubscribe from the cancel signal
|
|
8477
|
-
*/
|
|
8478
|
-
unsubscribe(listener) {
|
|
8479
|
-
if (!this._listeners) {
|
|
8480
|
-
return;
|
|
8481
|
-
}
|
|
8482
|
-
const index = this._listeners.indexOf(listener);
|
|
8483
|
-
if (index !== -1) {
|
|
8484
|
-
this._listeners.splice(index, 1);
|
|
8485
|
-
}
|
|
8486
|
-
}
|
|
8487
|
-
toAbortSignal() {
|
|
8488
|
-
const controller = new AbortController();
|
|
8489
|
-
const abort = (err) => {
|
|
8490
|
-
controller.abort(err);
|
|
8491
|
-
};
|
|
8492
|
-
this.subscribe(abort);
|
|
8493
|
-
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
8494
|
-
return controller.signal;
|
|
8495
|
-
}
|
|
8496
|
-
/**
|
|
8497
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
8498
|
-
* cancels the `CancelToken`.
|
|
8499
|
-
*/
|
|
8500
|
-
static source() {
|
|
8501
|
-
let cancel;
|
|
8502
|
-
const token = new _CancelToken(function executor(c) {
|
|
8503
|
-
cancel = c;
|
|
8504
|
-
});
|
|
8505
|
-
return {
|
|
8506
|
-
token,
|
|
8507
|
-
cancel
|
|
8508
5415
|
};
|
|
8509
5416
|
}
|
|
8510
|
-
};
|
|
8511
|
-
var CancelToken_default = CancelToken;
|
|
8512
|
-
|
|
8513
|
-
// node_modules/axios/lib/helpers/spread.js
|
|
8514
|
-
function spread(callback) {
|
|
8515
|
-
return function wrap(arr) {
|
|
8516
|
-
return callback.apply(null, arr);
|
|
8517
|
-
};
|
|
8518
|
-
}
|
|
8519
|
-
|
|
8520
|
-
// node_modules/axios/lib/helpers/isAxiosError.js
|
|
8521
|
-
function isAxiosError(payload) {
|
|
8522
|
-
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
8523
|
-
}
|
|
8524
|
-
|
|
8525
|
-
// node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
8526
|
-
var HttpStatusCode = {
|
|
8527
|
-
Continue: 100,
|
|
8528
|
-
SwitchingProtocols: 101,
|
|
8529
|
-
Processing: 102,
|
|
8530
|
-
EarlyHints: 103,
|
|
8531
|
-
Ok: 200,
|
|
8532
|
-
Created: 201,
|
|
8533
|
-
Accepted: 202,
|
|
8534
|
-
NonAuthoritativeInformation: 203,
|
|
8535
|
-
NoContent: 204,
|
|
8536
|
-
ResetContent: 205,
|
|
8537
|
-
PartialContent: 206,
|
|
8538
|
-
MultiStatus: 207,
|
|
8539
|
-
AlreadyReported: 208,
|
|
8540
|
-
ImUsed: 226,
|
|
8541
|
-
MultipleChoices: 300,
|
|
8542
|
-
MovedPermanently: 301,
|
|
8543
|
-
Found: 302,
|
|
8544
|
-
SeeOther: 303,
|
|
8545
|
-
NotModified: 304,
|
|
8546
|
-
UseProxy: 305,
|
|
8547
|
-
Unused: 306,
|
|
8548
|
-
TemporaryRedirect: 307,
|
|
8549
|
-
PermanentRedirect: 308,
|
|
8550
|
-
BadRequest: 400,
|
|
8551
|
-
Unauthorized: 401,
|
|
8552
|
-
PaymentRequired: 402,
|
|
8553
|
-
Forbidden: 403,
|
|
8554
|
-
NotFound: 404,
|
|
8555
|
-
MethodNotAllowed: 405,
|
|
8556
|
-
NotAcceptable: 406,
|
|
8557
|
-
ProxyAuthenticationRequired: 407,
|
|
8558
|
-
RequestTimeout: 408,
|
|
8559
|
-
Conflict: 409,
|
|
8560
|
-
Gone: 410,
|
|
8561
|
-
LengthRequired: 411,
|
|
8562
|
-
PreconditionFailed: 412,
|
|
8563
|
-
PayloadTooLarge: 413,
|
|
8564
|
-
UriTooLong: 414,
|
|
8565
|
-
UnsupportedMediaType: 415,
|
|
8566
|
-
RangeNotSatisfiable: 416,
|
|
8567
|
-
ExpectationFailed: 417,
|
|
8568
|
-
ImATeapot: 418,
|
|
8569
|
-
MisdirectedRequest: 421,
|
|
8570
|
-
UnprocessableEntity: 422,
|
|
8571
|
-
Locked: 423,
|
|
8572
|
-
FailedDependency: 424,
|
|
8573
|
-
TooEarly: 425,
|
|
8574
|
-
UpgradeRequired: 426,
|
|
8575
|
-
PreconditionRequired: 428,
|
|
8576
|
-
TooManyRequests: 429,
|
|
8577
|
-
RequestHeaderFieldsTooLarge: 431,
|
|
8578
|
-
UnavailableForLegalReasons: 451,
|
|
8579
|
-
InternalServerError: 500,
|
|
8580
|
-
NotImplemented: 501,
|
|
8581
|
-
BadGateway: 502,
|
|
8582
|
-
ServiceUnavailable: 503,
|
|
8583
|
-
GatewayTimeout: 504,
|
|
8584
|
-
HttpVersionNotSupported: 505,
|
|
8585
|
-
VariantAlsoNegotiates: 506,
|
|
8586
|
-
InsufficientStorage: 507,
|
|
8587
|
-
LoopDetected: 508,
|
|
8588
|
-
NotExtended: 510,
|
|
8589
|
-
NetworkAuthenticationRequired: 511,
|
|
8590
|
-
WebServerIsDown: 521,
|
|
8591
|
-
ConnectionTimedOut: 522,
|
|
8592
|
-
OriginIsUnreachable: 523,
|
|
8593
|
-
TimeoutOccurred: 524,
|
|
8594
|
-
SslHandshakeFailed: 525,
|
|
8595
|
-
InvalidSslCertificate: 526
|
|
8596
|
-
};
|
|
8597
|
-
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
8598
|
-
HttpStatusCode[value] = key;
|
|
8599
5417
|
});
|
|
8600
|
-
var HttpStatusCode_default = HttpStatusCode;
|
|
8601
|
-
|
|
8602
|
-
// node_modules/axios/lib/axios.js
|
|
8603
|
-
function createInstance(defaultConfig) {
|
|
8604
|
-
const context = new Axios_default(defaultConfig);
|
|
8605
|
-
const instance = bind(Axios_default.prototype.request, context);
|
|
8606
|
-
utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
|
|
8607
|
-
utils_default.extend(instance, context, null, { allOwnKeys: true });
|
|
8608
|
-
instance.create = function create2(instanceConfig) {
|
|
8609
|
-
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
8610
|
-
};
|
|
8611
|
-
return instance;
|
|
8612
|
-
}
|
|
8613
|
-
var axios = createInstance(defaults_default);
|
|
8614
|
-
axios.Axios = Axios_default;
|
|
8615
|
-
axios.CanceledError = CanceledError_default;
|
|
8616
|
-
axios.CancelToken = CancelToken_default;
|
|
8617
|
-
axios.isCancel = isCancel;
|
|
8618
|
-
axios.VERSION = VERSION;
|
|
8619
|
-
axios.toFormData = toFormData_default;
|
|
8620
|
-
axios.AxiosError = AxiosError_default;
|
|
8621
|
-
axios.Cancel = axios.CanceledError;
|
|
8622
|
-
axios.all = function all(promises) {
|
|
8623
|
-
return Promise.all(promises);
|
|
8624
|
-
};
|
|
8625
|
-
axios.spread = spread;
|
|
8626
|
-
axios.isAxiosError = isAxiosError;
|
|
8627
|
-
axios.mergeConfig = mergeConfig;
|
|
8628
|
-
axios.AxiosHeaders = AxiosHeaders_default;
|
|
8629
|
-
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
8630
|
-
axios.getAdapter = adapters_default.getAdapter;
|
|
8631
|
-
axios.HttpStatusCode = HttpStatusCode_default;
|
|
8632
|
-
axios.default = axios;
|
|
8633
|
-
var axios_default = axios;
|
|
8634
|
-
|
|
8635
|
-
// node_modules/axios/index.js
|
|
8636
|
-
var {
|
|
8637
|
-
Axios: Axios2,
|
|
8638
|
-
AxiosError: AxiosError2,
|
|
8639
|
-
CanceledError: CanceledError2,
|
|
8640
|
-
isCancel: isCancel2,
|
|
8641
|
-
CancelToken: CancelToken2,
|
|
8642
|
-
VERSION: VERSION2,
|
|
8643
|
-
all: all2,
|
|
8644
|
-
Cancel,
|
|
8645
|
-
isAxiosError: isAxiosError2,
|
|
8646
|
-
spread: spread2,
|
|
8647
|
-
toFormData: toFormData2,
|
|
8648
|
-
AxiosHeaders: AxiosHeaders2,
|
|
8649
|
-
HttpStatusCode: HttpStatusCode2,
|
|
8650
|
-
formToJSON,
|
|
8651
|
-
getAdapter: getAdapter2,
|
|
8652
|
-
mergeConfig: mergeConfig2,
|
|
8653
|
-
create
|
|
8654
|
-
} = axios_default;
|
|
8655
5418
|
|
|
8656
5419
|
// src/services/useEntities.js
|
|
8657
5420
|
init_usePlatform();
|
|
@@ -8743,13 +5506,13 @@ function parseStoredJson(value) {
|
|
|
8743
5506
|
}
|
|
8744
5507
|
return {};
|
|
8745
5508
|
}
|
|
8746
|
-
function resolvePath(obj, path,
|
|
5509
|
+
function resolvePath(obj, path, create = false) {
|
|
8747
5510
|
const parts = String(path || "").split("/").filter(Boolean);
|
|
8748
5511
|
let ref = obj;
|
|
8749
5512
|
for (let i = 0; i < parts.length - 1; i += 1) {
|
|
8750
5513
|
const part = parts[i];
|
|
8751
5514
|
if (!(part in ref)) {
|
|
8752
|
-
if (!
|
|
5515
|
+
if (!create) return null;
|
|
8753
5516
|
ref[part] = {};
|
|
8754
5517
|
}
|
|
8755
5518
|
ref = ref[part];
|
|
@@ -8910,8 +5673,8 @@ function sortRecords(records, sort) {
|
|
|
8910
5673
|
function getFilters(input = {}) {
|
|
8911
5674
|
return input.filter || input.filters || input.where || {};
|
|
8912
5675
|
}
|
|
8913
|
-
function matchesFilter(record,
|
|
8914
|
-
return Object.entries(
|
|
5676
|
+
function matchesFilter(record, filter = {}) {
|
|
5677
|
+
return Object.entries(filter).every(([key, expected]) => {
|
|
8915
5678
|
const actual = record?.[key];
|
|
8916
5679
|
if (expected && typeof expected === "object" && !Array.isArray(expected)) {
|
|
8917
5680
|
if ("$eq" in expected && actual !== expected.$eq) return false;
|
|
@@ -8959,9 +5722,9 @@ function createEntityApi(store, entity) {
|
|
|
8959
5722
|
const sorted = sortRecords(rows, input.sort || options.sort);
|
|
8960
5723
|
return { data: sorted.slice(0, input.limit || 200), limit: input.limit };
|
|
8961
5724
|
},
|
|
8962
|
-
filter: async (
|
|
5725
|
+
filter: async (filter = {}, sortOrOptions, limit) => {
|
|
8963
5726
|
const options = normalizeListArgs(sortOrOptions, limit);
|
|
8964
|
-
return createEntityApi(store, entity).query({ ...options, filter
|
|
5727
|
+
return createEntityApi(store, entity).query({ ...options, filter });
|
|
8965
5728
|
},
|
|
8966
5729
|
bulkCreate: async (records = []) => ({ inserted: (await Promise.all(records.map((record) => createEntityApi(store, entity).create(record)))).length }),
|
|
8967
5730
|
bulkUpdate: async (records = []) => {
|
|
@@ -9028,8 +5791,8 @@ function createNativeFileApi(appId) {
|
|
|
9028
5791
|
return { fileId, fileName: filename, webViewLink: `filebase://${path}`, downloadLink: `filebase://${path}` };
|
|
9029
5792
|
},
|
|
9030
5793
|
readJsonFromDrive: async (fileId, userId = "local") => {
|
|
9031
|
-
const
|
|
9032
|
-
if (
|
|
5794
|
+
const own = (await store.get(`drive/${userId}/${fileId}`)).val();
|
|
5795
|
+
if (own?.data) return own.data;
|
|
9033
5796
|
const contexts = await resolveFileContext(store, userId);
|
|
9034
5797
|
const context = contexts.find((item) => item.fileId === fileId);
|
|
9035
5798
|
if (!context) return {};
|
|
@@ -9185,6 +5948,8 @@ function createProjectStore(appId) {
|
|
|
9185
5948
|
}
|
|
9186
5949
|
|
|
9187
5950
|
// src/index.js
|
|
5951
|
+
init_useGoogleAuth();
|
|
5952
|
+
init_useYocoPayment();
|
|
9188
5953
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
9189
5954
|
var platformModule = null;
|
|
9190
5955
|
async function getPlatformModule() {
|
|
@@ -9200,13 +5965,6 @@ async function getGoogleModule() {
|
|
|
9200
5965
|
}
|
|
9201
5966
|
return googleModule;
|
|
9202
5967
|
}
|
|
9203
|
-
var paymentModule = null;
|
|
9204
|
-
async function getPaymentModule() {
|
|
9205
|
-
if (!paymentModule) {
|
|
9206
|
-
paymentModule = await Promise.resolve().then(() => (init_useYocoPayment(), useYocoPayment_exports));
|
|
9207
|
-
}
|
|
9208
|
-
return paymentModule;
|
|
9209
|
-
}
|
|
9210
5968
|
var TevrocError = class extends Error {
|
|
9211
5969
|
constructor(message, options = {}) {
|
|
9212
5970
|
super(message);
|
|
@@ -9229,10 +5987,11 @@ var TevrocClient = class {
|
|
|
9229
5987
|
this.serviceUrl = normalizeBaseUrl(serviceUrl);
|
|
9230
5988
|
this.appId = options.appId;
|
|
9231
5989
|
this.appName = options.appName;
|
|
5990
|
+
this.payAccount = options.payAccount ?? "default";
|
|
9232
5991
|
this.isNative = options.isNative ?? false;
|
|
9233
|
-
this.
|
|
9234
|
-
if (
|
|
9235
|
-
throw new TypeError("
|
|
5992
|
+
this.fetch = (options.fetch ?? globalThis.fetch).bind(globalThis);
|
|
5993
|
+
if (typeof this.fetch !== "function") {
|
|
5994
|
+
throw new TypeError("No fetch implementation available");
|
|
9236
5995
|
}
|
|
9237
5996
|
this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
9238
5997
|
this.defaultHeaders = normalizeHeaders(options.headers);
|
|
@@ -9278,6 +6037,7 @@ var TevrocClient = class {
|
|
|
9278
6037
|
const controller = new AbortController();
|
|
9279
6038
|
const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? this.timeoutMs);
|
|
9280
6039
|
const token = this.token || getStoredToken();
|
|
6040
|
+
console.log(token, options);
|
|
9281
6041
|
if (token && options.auth !== false) {
|
|
9282
6042
|
headers.set("authorization", `Bearer ${token}`);
|
|
9283
6043
|
}
|
|
@@ -9294,17 +6054,17 @@ var TevrocClient = class {
|
|
|
9294
6054
|
if (value !== void 0 && value !== null) headers.set(key, String(value));
|
|
9295
6055
|
}
|
|
9296
6056
|
}
|
|
6057
|
+
console.error(headers, url);
|
|
9297
6058
|
try {
|
|
9298
|
-
const response = await this.
|
|
9299
|
-
url,
|
|
6059
|
+
const response = await this.fetch(url, {
|
|
9300
6060
|
method,
|
|
9301
|
-
headers
|
|
9302
|
-
|
|
9303
|
-
signal: options.signal ?? controller.signal
|
|
9304
|
-
timeout: options.timeoutMs ?? this.timeoutMs,
|
|
9305
|
-
validateStatus: () => true
|
|
6061
|
+
headers,
|
|
6062
|
+
body,
|
|
6063
|
+
signal: options.signal ?? controller.signal
|
|
9306
6064
|
});
|
|
9307
|
-
|
|
6065
|
+
let ret = await parseResponse(response, options.parseAs);
|
|
6066
|
+
console.log("Response from request:", ret);
|
|
6067
|
+
return ret;
|
|
9308
6068
|
} catch (error) {
|
|
9309
6069
|
if (error?.name === "AbortError") throw new TevrocError("Request timed out", { code: "timeout" });
|
|
9310
6070
|
if (error instanceof TevrocError) throw error;
|
|
@@ -9327,14 +6087,18 @@ function createPlatformApi(client) {
|
|
|
9327
6087
|
}
|
|
9328
6088
|
function createPaymentApi(client) {
|
|
9329
6089
|
return {
|
|
9330
|
-
create: async ({ amountZAR, appId = "tevrocsoft", mode = "web" }) => {
|
|
9331
|
-
|
|
9332
|
-
return await createPayment2(amountZAR, {
|
|
6090
|
+
create: async ({ amountZAR, appId = "tevrocsoft", mode = "web", account = "default", externalCallback = void 0 } = {}) => {
|
|
6091
|
+
return await createPayment(amountZAR, {
|
|
9333
6092
|
appId,
|
|
9334
6093
|
serviceUrl: client.serviceUrl,
|
|
9335
|
-
mode
|
|
6094
|
+
mode,
|
|
6095
|
+
payAccount: account,
|
|
6096
|
+
externalCallback
|
|
9336
6097
|
});
|
|
9337
6098
|
},
|
|
6099
|
+
createCheckout: async (payload = {}) => {
|
|
6100
|
+
return await client.request("/create-checkout", { method: "POST", body: payload, auth: false });
|
|
6101
|
+
},
|
|
9338
6102
|
onstatus: (callback) => {
|
|
9339
6103
|
if (typeof callback !== "function") {
|
|
9340
6104
|
throw new Error("onstatus requires a function");
|
|
@@ -9346,37 +6110,38 @@ function createPaymentApi(client) {
|
|
|
9346
6110
|
function createAuthApi(client) {
|
|
9347
6111
|
return {
|
|
9348
6112
|
async register(input) {
|
|
9349
|
-
const
|
|
6113
|
+
const body = buildAuthPayload(input, client);
|
|
6114
|
+
const result = await client.request("/auth/register", { method: "POST", body, auth: false });
|
|
9350
6115
|
if (result.token) client.setToken(result.token);
|
|
9351
6116
|
return result;
|
|
9352
6117
|
},
|
|
9353
6118
|
// base44
|
|
9354
|
-
loginWithProvider: async (provider, redirectTo, setToken = () => {
|
|
6119
|
+
loginWithProvider: async (provider, redirectTo, setToken = async () => {
|
|
9355
6120
|
}) => {
|
|
9356
6121
|
if (provider === "google") {
|
|
9357
|
-
const { createGoogleLogin:
|
|
6122
|
+
const { createGoogleLogin: createGoogleLogin2, subscribeGoogleLogin: subscribeGoogleLogin2 } = await getGoogleModule();
|
|
9358
6123
|
console.log({
|
|
9359
6124
|
serviceUrl: client.serviceUrl,
|
|
9360
6125
|
appId: client.appId,
|
|
9361
6126
|
appName: client.appName
|
|
9362
6127
|
});
|
|
9363
|
-
|
|
6128
|
+
createGoogleLogin2({
|
|
9364
6129
|
serviceUrl: client.serviceUrl,
|
|
9365
6130
|
appId: client.appId,
|
|
9366
6131
|
appName: client.appName
|
|
9367
6132
|
});
|
|
9368
6133
|
if (redirectTo) {
|
|
9369
|
-
const unsub =
|
|
6134
|
+
const unsub = subscribeGoogleLogin2(async (user, err) => {
|
|
9370
6135
|
console.log("Google callback:", user, err);
|
|
9371
6136
|
unsub();
|
|
9372
6137
|
if (!user) return;
|
|
9373
|
-
|
|
6138
|
+
const result = await client.request("/auth/google", {
|
|
9374
6139
|
method: "POST",
|
|
9375
|
-
body: { accessToken: user.accessToken },
|
|
6140
|
+
body: buildAuthPayload({ accessToken: user.accessToken }, client),
|
|
9376
6141
|
auth: false
|
|
9377
6142
|
});
|
|
9378
6143
|
console.log(result);
|
|
9379
|
-
setToken(result.token);
|
|
6144
|
+
await setToken(result.token, result.user);
|
|
9380
6145
|
console.log("Redirecting to:", redirectTo);
|
|
9381
6146
|
window.location.href = redirectTo;
|
|
9382
6147
|
});
|
|
@@ -9390,27 +6155,38 @@ function createAuthApi(client) {
|
|
|
9390
6155
|
},
|
|
9391
6156
|
//
|
|
9392
6157
|
async login(input) {
|
|
9393
|
-
const
|
|
6158
|
+
const body = buildAuthPayload(input, client);
|
|
6159
|
+
const result = await client.request("/auth/login", { method: "POST", body, auth: false });
|
|
9394
6160
|
if (result.token) client.setToken(result.token);
|
|
9395
6161
|
return result;
|
|
9396
6162
|
},
|
|
9397
|
-
loginViaEmailPassword: (email, password) => client.auth.login({ email, password }),
|
|
9398
|
-
loginWithGoogle: (input) => client.request("/auth/google", { method: "POST", body: input, auth: false }).then((result) => {
|
|
9399
|
-
if (result.token) client.setToken(result.token);
|
|
9400
|
-
return result;
|
|
9401
|
-
}),
|
|
9402
6163
|
async logout() {
|
|
9403
|
-
const result = await client.request("/auth/logout", { method: "POST" });
|
|
6164
|
+
const result = await client.request("/auth/logout", { method: "POST", body: buildAuthPayload({}, client) });
|
|
9404
6165
|
client.clearToken();
|
|
9405
6166
|
return result;
|
|
9406
6167
|
},
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
6168
|
+
inviteUser: (input) => client.request("/users/invite", { method: "POST", body: buildAuthPayload(input, client) }),
|
|
6169
|
+
acceptInvite: (input) => client.request("/auth/accept-invite", { method: "POST", body: buildAuthPayload(input, client), auth: false }),
|
|
6170
|
+
me: () => client.request("/auth/me", { headers: buildAuthHeaders(client) }),
|
|
6171
|
+
verifyOtp: (input) => client.request("/auth/verify-otp", { method: "POST", body: buildAuthPayload(input, client), auth: false }),
|
|
6172
|
+
changePassword: (input) => client.request("/auth/change-password", { method: "POST", body: buildAuthPayload(input, client) }),
|
|
6173
|
+
resetPassword: (input) => client.request("/auth/reset-password", { method: "POST", body: buildAuthPayload(input, client), auth: false }),
|
|
6174
|
+
loginUrl: (redirectTo) => client.request("/auth/login-url", {
|
|
6175
|
+
query: redirectTo ? { redirectTo, appId: client.appId || void 0 } : { appId: client.appId || void 0 },
|
|
6176
|
+
auth: false
|
|
6177
|
+
})
|
|
9412
6178
|
};
|
|
9413
6179
|
}
|
|
6180
|
+
function buildAuthPayload(input = {}, client) {
|
|
6181
|
+
const payload = { ...input || {} };
|
|
6182
|
+
if (client?.appId && payload.appId == null) {
|
|
6183
|
+
payload.appId = client.appId;
|
|
6184
|
+
}
|
|
6185
|
+
return payload;
|
|
6186
|
+
}
|
|
6187
|
+
function buildAuthHeaders(client) {
|
|
6188
|
+
return client?.appId ? { "x-app-id": client.appId } : {};
|
|
6189
|
+
}
|
|
9414
6190
|
function createEntityRegistry(client) {
|
|
9415
6191
|
return new Proxy(
|
|
9416
6192
|
{},
|
|
@@ -9431,7 +6207,7 @@ function createEntityApi2(client, entity) {
|
|
|
9431
6207
|
update: (id, patch) => client.request(`${base}/${encodeURIComponent(id)}`, { method: "PATCH", body: patch }),
|
|
9432
6208
|
delete: (id) => client.request(`${base}/${encodeURIComponent(id)}`, { method: "DELETE" }),
|
|
9433
6209
|
query: (input = {}) => client.request(`${base}/query`, { method: "POST", body: input }),
|
|
9434
|
-
filter: (
|
|
6210
|
+
filter: (filter = {}, sortOrOptions, limit) => client.request(`${base}/query`, { method: "POST", body: normalizeFilterInput(filter, sortOrOptions, limit) }),
|
|
9435
6211
|
bulkCreate: (records) => client.request(`${base}/bulk`, { method: "POST", body: { records } }),
|
|
9436
6212
|
bulkUpdate: (records) => client.request(`${base}/bulk`, { method: "PATCH", body: { records } }),
|
|
9437
6213
|
bulkDelete: (ids) => client.request(`${base}/bulk`, { method: "DELETE", body: { ids } }),
|
|
@@ -9554,15 +6330,14 @@ function upload(client, path, file, options) {
|
|
|
9554
6330
|
if (options.contentType) headers["content-type"] = options.contentType;
|
|
9555
6331
|
return client.request(path, { method: "POST", body: file, headers });
|
|
9556
6332
|
}
|
|
9557
|
-
async function
|
|
6333
|
+
async function parseResponse(response, parseAs) {
|
|
9558
6334
|
if (parseAs === "response") return response;
|
|
9559
|
-
const
|
|
9560
|
-
const contentType = typeof headers.get === "function" ? headers.get("content-type") ?? "" : String(headers["content-type"] ?? headers["Content-Type"] ?? "");
|
|
6335
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
9561
6336
|
const isJson = contentType.includes("application/json");
|
|
9562
|
-
const data = response.
|
|
9563
|
-
if (response.
|
|
6337
|
+
const data = isJson ? await response.json() : await response.text();
|
|
6338
|
+
if (!response.ok) {
|
|
9564
6339
|
const error = isJson && data?.error ? data.error : {};
|
|
9565
|
-
throw new TevrocError(error.message ?? response.statusText
|
|
6340
|
+
throw new TevrocError(error.message ?? response.statusText, {
|
|
9566
6341
|
status: response.status,
|
|
9567
6342
|
code: error.code ?? "api_error",
|
|
9568
6343
|
details: error.details ?? data,
|
|
@@ -9596,18 +6371,18 @@ function safeLocalStorage() {
|
|
|
9596
6371
|
function getStoredToken() {
|
|
9597
6372
|
return safeLocalStorage()?.getItem("tevroc_access_token") ?? null;
|
|
9598
6373
|
}
|
|
9599
|
-
function normalizeFilterInput(
|
|
9600
|
-
const input = { filter
|
|
6374
|
+
function normalizeFilterInput(filter = {}, sortOrOptions, limit) {
|
|
6375
|
+
const input = { filter };
|
|
9601
6376
|
if (typeof sortOrOptions === "string") input.sort = sortOrOptions;
|
|
9602
6377
|
else if (sortOrOptions && typeof sortOrOptions === "object") Object.assign(input, sortOrOptions);
|
|
9603
6378
|
if (limit !== void 0) input.limit = limit;
|
|
9604
6379
|
return input;
|
|
9605
6380
|
}
|
|
9606
6381
|
function isJsonBody(body) {
|
|
9607
|
-
const
|
|
9608
|
-
const
|
|
9609
|
-
const
|
|
9610
|
-
return typeof body === "object" && !
|
|
6382
|
+
const isArrayBuffer = typeof ArrayBuffer !== "undefined" && body instanceof ArrayBuffer;
|
|
6383
|
+
const isBlob = typeof Blob !== "undefined" && body instanceof Blob;
|
|
6384
|
+
const isFormData = typeof FormData !== "undefined" && body instanceof FormData;
|
|
6385
|
+
return typeof body === "object" && !isArrayBuffer && !isBlob && !isFormData;
|
|
9611
6386
|
}
|
|
9612
6387
|
export {
|
|
9613
6388
|
TevrocClient,
|