@magiclabs.ai/magicbook-client 0.6.0 → 0.6.2
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/magicbook-client.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, s) => (
|
|
4
|
-
function
|
|
1
|
+
var bs = Object.defineProperty;
|
|
2
|
+
var ws = (t, e, s) => e in t ? bs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var b = (t, e, s) => (ws(t, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
function xs(t, e, s) {
|
|
5
5
|
const n = e.pop() || "", r = e.reduce(
|
|
6
6
|
(i, a) => i[a] = i[a] || {},
|
|
7
7
|
t
|
|
8
8
|
);
|
|
9
9
|
r[n] = s;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Rt(t, e) {
|
|
12
12
|
return Object.keys(e).map((s) => {
|
|
13
|
-
typeof t[s] == "object" && typeof e[s] == "object" ?
|
|
13
|
+
typeof t[s] == "object" && typeof e[s] == "object" ? Rt(t[s], e[s]) : t[s] = e[s];
|
|
14
14
|
}), t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ks(t) {
|
|
17
17
|
return t.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function It(t) {
|
|
20
20
|
return Object.keys(t).map((e) => {
|
|
21
|
-
const s =
|
|
22
|
-
s.includes("_") && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] =
|
|
21
|
+
const s = ks(e);
|
|
22
|
+
s.includes("_") && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = It(t[s]));
|
|
23
23
|
}), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ss(t) {
|
|
26
26
|
return t.replace(/([-_][a-z])/g, (e) => e.toUpperCase().replace("-", "").replace("_", ""));
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function jt(t) {
|
|
29
29
|
return Object.keys(t).map((e) => {
|
|
30
|
-
const s =
|
|
31
|
-
s !== e && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] =
|
|
30
|
+
const s = Ss(e);
|
|
31
|
+
s !== e && (t[s] = t[e], delete t[e]), typeof t[s] == "object" && (t[s] = jt(t[s]));
|
|
32
32
|
}), t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Zt(t, e) {
|
|
35
35
|
return function() {
|
|
36
36
|
return t.apply(e, arguments);
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
const { toString:
|
|
40
|
-
const s =
|
|
39
|
+
const { toString: Ts } = Object.prototype, { getPrototypeOf: lt } = Object, $e = ((t) => (e) => {
|
|
40
|
+
const s = Ts.call(e);
|
|
41
41
|
return t[s] || (t[s] = s.slice(8, -1).toLowerCase());
|
|
42
42
|
})(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) => $e(e) === t), Ve = (t) => (e) => typeof e === t, { isArray: le } = Array, ue = Ve("undefined");
|
|
43
|
-
function
|
|
43
|
+
function Es(t) {
|
|
44
44
|
return t !== null && !ue(t) && t.constructor !== null && !ue(t.constructor) && j(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
46
|
+
const Lt = $("ArrayBuffer");
|
|
47
|
+
function Os(t) {
|
|
48
48
|
let e;
|
|
49
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer &&
|
|
49
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Lt(t.buffer), e;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const Ns = Ve("string"), j = Ve("function"), Dt = Ve("number"), Fe = (t) => t !== null && typeof t == "object", Cs = (t) => t === !0 || t === !1, Oe = (t) => {
|
|
52
52
|
if ($e(t) !== "object")
|
|
53
53
|
return !1;
|
|
54
54
|
const e = lt(t);
|
|
55
55
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
|
|
56
|
-
},
|
|
56
|
+
}, As = $("Date"), Rs = $("File"), Is = $("Blob"), js = $("FileList"), Zs = (t) => Fe(t) && j(t.pipe), Ls = (t) => {
|
|
57
57
|
let e;
|
|
58
58
|
return t && (typeof FormData == "function" && t instanceof FormData || j(t.append) && ((e = $e(t)) === "formdata" || // detect form-data instance
|
|
59
59
|
e === "object" && j(t.toString) && t.toString() === "[object FormData]"));
|
|
60
|
-
},
|
|
60
|
+
}, Ds = $("URLSearchParams"), Ps = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
61
61
|
function xe(t, e, { allOwnKeys: s = !1 } = {}) {
|
|
62
62
|
if (t === null || typeof t > "u")
|
|
63
63
|
return;
|
|
@@ -72,7 +72,7 @@ function xe(t, e, { allOwnKeys: s = !1 } = {}) {
|
|
|
72
72
|
o = i[n], e.call(null, t[o], o, t);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Pt(t, e) {
|
|
76
76
|
e = e.toLowerCase();
|
|
77
77
|
const s = Object.keys(t);
|
|
78
78
|
let n = s.length, r;
|
|
@@ -81,23 +81,23 @@ function Dt(t, e) {
|
|
|
81
81
|
return r;
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Bt = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Mt = (t) => !ue(t) && t !== Bt;
|
|
85
85
|
function et() {
|
|
86
|
-
const { caseless: t } =
|
|
87
|
-
const i = t &&
|
|
86
|
+
const { caseless: t } = Mt(this) && this || {}, e = {}, s = (n, r) => {
|
|
87
|
+
const i = t && Pt(e, r) || r;
|
|
88
88
|
Oe(e[i]) && Oe(n) ? e[i] = et(e[i], n) : Oe(n) ? e[i] = et({}, n) : le(n) ? e[i] = n.slice() : e[i] = n;
|
|
89
89
|
};
|
|
90
90
|
for (let n = 0, r = arguments.length; n < r; n++)
|
|
91
91
|
arguments[n] && xe(arguments[n], s);
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
s && j(r) ? t[i] =
|
|
96
|
-
}, { allOwnKeys: n }), t),
|
|
94
|
+
const Bs = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, i) => {
|
|
95
|
+
s && j(r) ? t[i] = Zt(r, s) : t[i] = r;
|
|
96
|
+
}, { allOwnKeys: n }), t), Ms = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Us = (t, e, s, n) => {
|
|
97
97
|
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
98
98
|
value: e.prototype
|
|
99
99
|
}), s && Object.assign(t.prototype, s);
|
|
100
|
-
},
|
|
100
|
+
}, zs = (t, e, s, n) => {
|
|
101
101
|
let r, i, a;
|
|
102
102
|
const o = {};
|
|
103
103
|
if (e = e || {}, t == null)
|
|
@@ -108,47 +108,47 @@ const Ps = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, i) => {
|
|
|
108
108
|
t = s !== !1 && lt(t);
|
|
109
109
|
} while (t && (!s || s(t, e)) && t !== Object.prototype);
|
|
110
110
|
return e;
|
|
111
|
-
},
|
|
111
|
+
}, $s = (t, e, s) => {
|
|
112
112
|
t = String(t), (s === void 0 || s > t.length) && (s = t.length), s -= e.length;
|
|
113
113
|
const n = t.indexOf(e, s);
|
|
114
114
|
return n !== -1 && n === s;
|
|
115
|
-
},
|
|
115
|
+
}, Vs = (t) => {
|
|
116
116
|
if (!t)
|
|
117
117
|
return null;
|
|
118
118
|
if (le(t))
|
|
119
119
|
return t;
|
|
120
120
|
let e = t.length;
|
|
121
|
-
if (!
|
|
121
|
+
if (!Dt(e))
|
|
122
122
|
return null;
|
|
123
123
|
const s = new Array(e);
|
|
124
124
|
for (; e-- > 0; )
|
|
125
125
|
s[e] = t[e];
|
|
126
126
|
return s;
|
|
127
|
-
},
|
|
127
|
+
}, Fs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && lt(Uint8Array)), Hs = (t, e) => {
|
|
128
128
|
const n = (t && t[Symbol.iterator]).call(t);
|
|
129
129
|
let r;
|
|
130
130
|
for (; (r = n.next()) && !r.done; ) {
|
|
131
131
|
const i = r.value;
|
|
132
132
|
e.call(t, i[0], i[1]);
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, Js = (t, e) => {
|
|
135
135
|
let s;
|
|
136
136
|
const n = [];
|
|
137
137
|
for (; (s = t.exec(e)) !== null; )
|
|
138
138
|
n.push(s);
|
|
139
139
|
return n;
|
|
140
|
-
},
|
|
140
|
+
}, Ws = $("HTMLFormElement"), Ks = (t) => t.toLowerCase().replace(
|
|
141
141
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
142
142
|
function(s, n, r) {
|
|
143
143
|
return n.toUpperCase() + r;
|
|
144
144
|
}
|
|
145
|
-
),
|
|
145
|
+
), gt = (({ hasOwnProperty: t }) => (e, s) => t.call(e, s))(Object.prototype), qs = $("RegExp"), Ut = (t, e) => {
|
|
146
146
|
const s = Object.getOwnPropertyDescriptors(t), n = {};
|
|
147
147
|
xe(s, (r, i) => {
|
|
148
148
|
e(r, i, t) !== !1 && (n[i] = r);
|
|
149
149
|
}), Object.defineProperties(t, n);
|
|
150
|
-
},
|
|
151
|
-
|
|
150
|
+
}, Gs = (t) => {
|
|
151
|
+
Ut(t, (e, s) => {
|
|
152
152
|
if (j(t) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
|
|
153
153
|
return !1;
|
|
154
154
|
const n = t[s];
|
|
@@ -162,29 +162,29 @@ const Ps = (t, e, s, { allOwnKeys: n } = {}) => (xe(e, (r, i) => {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
},
|
|
165
|
+
}, Xs = (t, e) => {
|
|
166
166
|
const s = {}, n = (r) => {
|
|
167
167
|
r.forEach((i) => {
|
|
168
168
|
s[i] = !0;
|
|
169
169
|
});
|
|
170
170
|
};
|
|
171
171
|
return le(t) ? n(t) : n(String(t).split(e)), s;
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
DIGIT:
|
|
172
|
+
}, Ys = () => {
|
|
173
|
+
}, Qs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), qe = "abcdefghijklmnopqrstuvwxyz", vt = "0123456789", zt = {
|
|
174
|
+
DIGIT: vt,
|
|
175
175
|
ALPHA: qe,
|
|
176
|
-
ALPHA_DIGIT: qe + qe.toUpperCase() +
|
|
177
|
-
},
|
|
176
|
+
ALPHA_DIGIT: qe + qe.toUpperCase() + vt
|
|
177
|
+
}, en = (t = 16, e = zt.ALPHA_DIGIT) => {
|
|
178
178
|
let s = "";
|
|
179
179
|
const { length: n } = e;
|
|
180
180
|
for (; t--; )
|
|
181
181
|
s += e[Math.random() * n | 0];
|
|
182
182
|
return s;
|
|
183
183
|
};
|
|
184
|
-
function
|
|
184
|
+
function tn(t) {
|
|
185
185
|
return !!(t && j(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const sn = (t) => {
|
|
188
188
|
const e = new Array(10), s = (n, r) => {
|
|
189
189
|
if (Fe(n)) {
|
|
190
190
|
if (e.indexOf(n) >= 0)
|
|
@@ -201,59 +201,59 @@ const tn = (t) => {
|
|
|
201
201
|
return n;
|
|
202
202
|
};
|
|
203
203
|
return s(t, 0);
|
|
204
|
-
},
|
|
204
|
+
}, nn = $("AsyncFunction"), rn = (t) => t && (Fe(t) || j(t)) && j(t.then) && j(t.catch), c = {
|
|
205
205
|
isArray: le,
|
|
206
|
-
isArrayBuffer:
|
|
207
|
-
isBuffer:
|
|
208
|
-
isFormData:
|
|
209
|
-
isArrayBufferView:
|
|
210
|
-
isString:
|
|
211
|
-
isNumber:
|
|
212
|
-
isBoolean:
|
|
206
|
+
isArrayBuffer: Lt,
|
|
207
|
+
isBuffer: Es,
|
|
208
|
+
isFormData: Ls,
|
|
209
|
+
isArrayBufferView: Os,
|
|
210
|
+
isString: Ns,
|
|
211
|
+
isNumber: Dt,
|
|
212
|
+
isBoolean: Cs,
|
|
213
213
|
isObject: Fe,
|
|
214
214
|
isPlainObject: Oe,
|
|
215
215
|
isUndefined: ue,
|
|
216
|
-
isDate:
|
|
217
|
-
isFile:
|
|
218
|
-
isBlob:
|
|
219
|
-
isRegExp:
|
|
216
|
+
isDate: As,
|
|
217
|
+
isFile: Rs,
|
|
218
|
+
isBlob: Is,
|
|
219
|
+
isRegExp: qs,
|
|
220
220
|
isFunction: j,
|
|
221
|
-
isStream:
|
|
222
|
-
isURLSearchParams:
|
|
223
|
-
isTypedArray:
|
|
224
|
-
isFileList:
|
|
221
|
+
isStream: Zs,
|
|
222
|
+
isURLSearchParams: Ds,
|
|
223
|
+
isTypedArray: Fs,
|
|
224
|
+
isFileList: js,
|
|
225
225
|
forEach: xe,
|
|
226
226
|
merge: et,
|
|
227
|
-
extend:
|
|
228
|
-
trim:
|
|
229
|
-
stripBOM:
|
|
230
|
-
inherits:
|
|
231
|
-
toFlatObject:
|
|
227
|
+
extend: Bs,
|
|
228
|
+
trim: Ps,
|
|
229
|
+
stripBOM: Ms,
|
|
230
|
+
inherits: Us,
|
|
231
|
+
toFlatObject: zs,
|
|
232
232
|
kindOf: $e,
|
|
233
233
|
kindOfTest: $,
|
|
234
|
-
endsWith:
|
|
235
|
-
toArray:
|
|
236
|
-
forEachEntry:
|
|
237
|
-
matchAll:
|
|
238
|
-
isHTMLForm:
|
|
239
|
-
hasOwnProperty:
|
|
240
|
-
hasOwnProp:
|
|
234
|
+
endsWith: $s,
|
|
235
|
+
toArray: Vs,
|
|
236
|
+
forEachEntry: Hs,
|
|
237
|
+
matchAll: Js,
|
|
238
|
+
isHTMLForm: Ws,
|
|
239
|
+
hasOwnProperty: gt,
|
|
240
|
+
hasOwnProp: gt,
|
|
241
241
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
242
|
-
reduceDescriptors:
|
|
243
|
-
freezeMethods:
|
|
244
|
-
toObjectSet:
|
|
245
|
-
toCamelCase:
|
|
246
|
-
noop:
|
|
247
|
-
toFiniteNumber:
|
|
248
|
-
findKey:
|
|
249
|
-
global:
|
|
250
|
-
isContextDefined:
|
|
251
|
-
ALPHABET:
|
|
252
|
-
generateString:
|
|
253
|
-
isSpecCompliantForm:
|
|
254
|
-
toJSONObject:
|
|
255
|
-
isAsyncFn:
|
|
256
|
-
isThenable:
|
|
242
|
+
reduceDescriptors: Ut,
|
|
243
|
+
freezeMethods: Gs,
|
|
244
|
+
toObjectSet: Xs,
|
|
245
|
+
toCamelCase: Ks,
|
|
246
|
+
noop: Ys,
|
|
247
|
+
toFiniteNumber: Qs,
|
|
248
|
+
findKey: Pt,
|
|
249
|
+
global: Bt,
|
|
250
|
+
isContextDefined: Mt,
|
|
251
|
+
ALPHABET: zt,
|
|
252
|
+
generateString: en,
|
|
253
|
+
isSpecCompliantForm: tn,
|
|
254
|
+
toJSONObject: sn,
|
|
255
|
+
isAsyncFn: nn,
|
|
256
|
+
isThenable: rn
|
|
257
257
|
};
|
|
258
258
|
function T(t, e, s, n, r) {
|
|
259
259
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), s && (this.config = s), n && (this.request = n), r && (this.response = r);
|
|
@@ -279,7 +279,7 @@ c.inherits(T, Error, {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
const
|
|
282
|
+
const $t = T.prototype, Vt = {};
|
|
283
283
|
[
|
|
284
284
|
"ERR_BAD_OPTION_VALUE",
|
|
285
285
|
"ERR_BAD_OPTION",
|
|
@@ -295,32 +295,32 @@ const zt = T.prototype, $t = {};
|
|
|
295
295
|
"ERR_INVALID_URL"
|
|
296
296
|
// eslint-disable-next-line func-names
|
|
297
297
|
].forEach((t) => {
|
|
298
|
-
|
|
298
|
+
Vt[t] = { value: t };
|
|
299
299
|
});
|
|
300
|
-
Object.defineProperties(T,
|
|
301
|
-
Object.defineProperty(
|
|
300
|
+
Object.defineProperties(T, Vt);
|
|
301
|
+
Object.defineProperty($t, "isAxiosError", { value: !0 });
|
|
302
302
|
T.from = (t, e, s, n, r, i) => {
|
|
303
|
-
const a = Object.create(
|
|
303
|
+
const a = Object.create($t);
|
|
304
304
|
return c.toFlatObject(t, a, function(u) {
|
|
305
305
|
return u !== Error.prototype;
|
|
306
306
|
}, (o) => o !== "isAxiosError"), T.call(a, t.message, e, s, n, r), a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
|
|
307
307
|
};
|
|
308
|
-
const
|
|
308
|
+
const an = null;
|
|
309
309
|
function tt(t) {
|
|
310
310
|
return c.isPlainObject(t) || c.isArray(t);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Ft(t) {
|
|
313
313
|
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function _t(t, e, s) {
|
|
316
316
|
return t ? t.concat(e).map(function(r, i) {
|
|
317
|
-
return r =
|
|
317
|
+
return r = Ft(r), !s && i ? "[" + r + "]" : r;
|
|
318
318
|
}).join(s ? "." : "") : e;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function on(t) {
|
|
321
321
|
return c.isArray(t) && !t.some(tt);
|
|
322
322
|
}
|
|
323
|
-
const
|
|
323
|
+
const ln = c.toFlatObject(c, {}, null, function(e) {
|
|
324
324
|
return /^is[A-Z]/.test(e);
|
|
325
325
|
});
|
|
326
326
|
function He(t, e, s) {
|
|
@@ -350,18 +350,18 @@ function He(t, e, s) {
|
|
|
350
350
|
if (g && !V && typeof g == "object") {
|
|
351
351
|
if (c.endsWith(S, "{}"))
|
|
352
352
|
S = n ? S : S.slice(0, -2), g = JSON.stringify(g);
|
|
353
|
-
else if (c.isArray(g) &&
|
|
354
|
-
return S =
|
|
353
|
+
else if (c.isArray(g) && on(g) || (c.isFileList(g) || c.endsWith(S, "[]")) && (Z = c.toArray(g)))
|
|
354
|
+
return S = Ft(S), Z.forEach(function(Ee, _s) {
|
|
355
355
|
!(c.isUndefined(Ee) || Ee === null) && e.append(
|
|
356
356
|
// eslint-disable-next-line no-nested-ternary
|
|
357
|
-
a === !0 ?
|
|
357
|
+
a === !0 ? _t([S], _s, i) : a === null ? S : S + "[]",
|
|
358
358
|
l(Ee)
|
|
359
359
|
);
|
|
360
360
|
}), !1;
|
|
361
361
|
}
|
|
362
|
-
return tt(g) ? !0 : (e.append(
|
|
362
|
+
return tt(g) ? !0 : (e.append(_t(V, S, i), l(g)), !1);
|
|
363
363
|
}
|
|
364
|
-
const _ = [], C = Object.assign(
|
|
364
|
+
const _ = [], C = Object.assign(ln, {
|
|
365
365
|
defaultVisitor: f,
|
|
366
366
|
convertValue: l,
|
|
367
367
|
isVisitable: tt
|
|
@@ -385,7 +385,7 @@ function He(t, e, s) {
|
|
|
385
385
|
throw new TypeError("data must be an object");
|
|
386
386
|
return O(t), e;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function bt(t) {
|
|
389
389
|
const e = {
|
|
390
390
|
"!": "%21",
|
|
391
391
|
"'": "%27",
|
|
@@ -402,25 +402,25 @@ function _t(t) {
|
|
|
402
402
|
function ct(t, e) {
|
|
403
403
|
this._pairs = [], t && He(t, this, e);
|
|
404
404
|
}
|
|
405
|
-
const
|
|
406
|
-
|
|
405
|
+
const Ht = ct.prototype;
|
|
406
|
+
Ht.append = function(e, s) {
|
|
407
407
|
this._pairs.push([e, s]);
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
Ht.toString = function(e) {
|
|
410
410
|
const s = e ? function(n) {
|
|
411
|
-
return e.call(this, n,
|
|
412
|
-
} :
|
|
411
|
+
return e.call(this, n, bt);
|
|
412
|
+
} : bt;
|
|
413
413
|
return this._pairs.map(function(r) {
|
|
414
414
|
return s(r[0]) + "=" + s(r[1]);
|
|
415
415
|
}, "").join("&");
|
|
416
416
|
};
|
|
417
|
-
function
|
|
417
|
+
function cn(t) {
|
|
418
418
|
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Jt(t, e, s) {
|
|
421
421
|
if (!e)
|
|
422
422
|
return t;
|
|
423
|
-
const n = s && s.encode ||
|
|
423
|
+
const n = s && s.encode || cn, r = s && s.serialize;
|
|
424
424
|
let i;
|
|
425
425
|
if (r ? i = r(e, s) : i = c.isURLSearchParams(e) ? e.toString() : new ct(e, s).toString(n), i) {
|
|
426
426
|
const a = t.indexOf("#");
|
|
@@ -428,7 +428,7 @@ function Ht(t, e, s) {
|
|
|
428
428
|
}
|
|
429
429
|
return t;
|
|
430
430
|
}
|
|
431
|
-
class
|
|
431
|
+
class un {
|
|
432
432
|
constructor() {
|
|
433
433
|
this.handlers = [];
|
|
434
434
|
}
|
|
@@ -482,36 +482,36 @@ class cn {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
const
|
|
485
|
+
const wt = un, Wt = {
|
|
486
486
|
silentJSONParsing: !0,
|
|
487
487
|
forcedJSONParsing: !0,
|
|
488
488
|
clarifyTimeoutError: !1
|
|
489
|
-
},
|
|
489
|
+
}, dn = typeof URLSearchParams < "u" ? URLSearchParams : ct, fn = typeof FormData < "u" ? FormData : null, hn = typeof Blob < "u" ? Blob : null, pn = (() => {
|
|
490
490
|
let t;
|
|
491
491
|
return typeof navigator < "u" && ((t = navigator.product) === "ReactNative" || t === "NativeScript" || t === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
492
|
-
})(),
|
|
492
|
+
})(), mn = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
493
493
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), M = {
|
|
494
494
|
isBrowser: !0,
|
|
495
495
|
classes: {
|
|
496
|
-
URLSearchParams:
|
|
497
|
-
FormData:
|
|
498
|
-
Blob:
|
|
496
|
+
URLSearchParams: dn,
|
|
497
|
+
FormData: fn,
|
|
498
|
+
Blob: hn
|
|
499
499
|
},
|
|
500
|
-
isStandardBrowserEnv:
|
|
501
|
-
isStandardBrowserWebWorkerEnv:
|
|
500
|
+
isStandardBrowserEnv: pn,
|
|
501
|
+
isStandardBrowserWebWorkerEnv: mn,
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
503
|
};
|
|
504
|
-
function
|
|
504
|
+
function yn(t, e) {
|
|
505
505
|
return He(t, new M.classes.URLSearchParams(), Object.assign({
|
|
506
506
|
visitor: function(s, n, r, i) {
|
|
507
507
|
return M.isNode && c.isBuffer(s) ? (this.append(n, s.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
508
508
|
}
|
|
509
509
|
}, e));
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function gn(t) {
|
|
512
512
|
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function vn(t) {
|
|
515
515
|
const e = {}, s = Object.keys(t);
|
|
516
516
|
let n;
|
|
517
517
|
const r = s.length;
|
|
@@ -520,24 +520,24 @@ function gn(t) {
|
|
|
520
520
|
i = s[n], e[i] = t[i];
|
|
521
521
|
return e;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Kt(t) {
|
|
524
524
|
function e(s, n, r, i) {
|
|
525
525
|
let a = s[i++];
|
|
526
526
|
const o = Number.isFinite(+a), u = i >= s.length;
|
|
527
|
-
return a = !a && c.isArray(r) ? r.length : a, u ? (c.hasOwnProp(r, a) ? r[a] = [r[a], n] : r[a] = n, !o) : ((!r[a] || !c.isObject(r[a])) && (r[a] = []), e(s, n, r[a], i) && c.isArray(r[a]) && (r[a] =
|
|
527
|
+
return a = !a && c.isArray(r) ? r.length : a, u ? (c.hasOwnProp(r, a) ? r[a] = [r[a], n] : r[a] = n, !o) : ((!r[a] || !c.isObject(r[a])) && (r[a] = []), e(s, n, r[a], i) && c.isArray(r[a]) && (r[a] = vn(r[a])), !o);
|
|
528
528
|
}
|
|
529
529
|
if (c.isFormData(t) && c.isFunction(t.entries)) {
|
|
530
530
|
const s = {};
|
|
531
531
|
return c.forEachEntry(t, (n, r) => {
|
|
532
|
-
e(
|
|
532
|
+
e(gn(n), r, s, 0);
|
|
533
533
|
}), s;
|
|
534
534
|
}
|
|
535
535
|
return null;
|
|
536
536
|
}
|
|
537
|
-
const
|
|
537
|
+
const _n = {
|
|
538
538
|
"Content-Type": void 0
|
|
539
539
|
};
|
|
540
|
-
function
|
|
540
|
+
function bn(t, e, s) {
|
|
541
541
|
if (c.isString(t))
|
|
542
542
|
try {
|
|
543
543
|
return (e || JSON.parse)(t), c.trim(t);
|
|
@@ -548,12 +548,12 @@ function _n(t, e, s) {
|
|
|
548
548
|
return (s || JSON.stringify)(t);
|
|
549
549
|
}
|
|
550
550
|
const Je = {
|
|
551
|
-
transitional:
|
|
551
|
+
transitional: Wt,
|
|
552
552
|
adapter: ["xhr", "http"],
|
|
553
553
|
transformRequest: [function(e, s) {
|
|
554
554
|
const n = s.getContentType() || "", r = n.indexOf("application/json") > -1, i = c.isObject(e);
|
|
555
555
|
if (i && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
|
|
556
|
-
return r && r ? JSON.stringify(
|
|
556
|
+
return r && r ? JSON.stringify(Kt(e)) : e;
|
|
557
557
|
if (c.isArrayBuffer(e) || c.isBuffer(e) || c.isStream(e) || c.isFile(e) || c.isBlob(e))
|
|
558
558
|
return e;
|
|
559
559
|
if (c.isArrayBufferView(e))
|
|
@@ -563,7 +563,7 @@ const Je = {
|
|
|
563
563
|
let o;
|
|
564
564
|
if (i) {
|
|
565
565
|
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
566
|
-
return
|
|
566
|
+
return yn(e, this.formSerializer).toString();
|
|
567
567
|
if ((o = c.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
568
568
|
const u = this.env && this.env.FormData;
|
|
569
569
|
return He(
|
|
@@ -573,7 +573,7 @@ const Je = {
|
|
|
573
573
|
);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
return i || r ? (s.setContentType("application/json", !1),
|
|
576
|
+
return i || r ? (s.setContentType("application/json", !1), bn(e)) : e;
|
|
577
577
|
}],
|
|
578
578
|
transformResponse: [function(e) {
|
|
579
579
|
const s = this.transitional || Je.transitional, n = s && s.forcedJSONParsing, r = this.responseType === "json";
|
|
@@ -614,9 +614,9 @@ c.forEach(["delete", "get", "head"], function(e) {
|
|
|
614
614
|
Je.headers[e] = {};
|
|
615
615
|
});
|
|
616
616
|
c.forEach(["post", "put", "patch"], function(e) {
|
|
617
|
-
Je.headers[e] = c.merge(
|
|
617
|
+
Je.headers[e] = c.merge(_n);
|
|
618
618
|
});
|
|
619
|
-
const ut = Je,
|
|
619
|
+
const ut = Je, wn = c.toObjectSet([
|
|
620
620
|
"age",
|
|
621
621
|
"authorization",
|
|
622
622
|
"content-length",
|
|
@@ -634,28 +634,28 @@ const ut = Je, bn = c.toObjectSet([
|
|
|
634
634
|
"referer",
|
|
635
635
|
"retry-after",
|
|
636
636
|
"user-agent"
|
|
637
|
-
]),
|
|
637
|
+
]), xn = (t) => {
|
|
638
638
|
const e = {};
|
|
639
639
|
let s, n, r;
|
|
640
640
|
return t && t.split(`
|
|
641
641
|
`).forEach(function(a) {
|
|
642
|
-
r = a.indexOf(":"), s = a.substring(0, r).trim().toLowerCase(), n = a.substring(r + 1).trim(), !(!s || e[s] &&
|
|
642
|
+
r = a.indexOf(":"), s = a.substring(0, r).trim().toLowerCase(), n = a.substring(r + 1).trim(), !(!s || e[s] && wn[s]) && (s === "set-cookie" ? e[s] ? e[s].push(n) : e[s] = [n] : e[s] = e[s] ? e[s] + ", " + n : n);
|
|
643
643
|
}), e;
|
|
644
|
-
},
|
|
644
|
+
}, xt = Symbol("internals");
|
|
645
645
|
function ce(t) {
|
|
646
646
|
return t && String(t).trim().toLowerCase();
|
|
647
647
|
}
|
|
648
648
|
function Ne(t) {
|
|
649
649
|
return t === !1 || t == null ? t : c.isArray(t) ? t.map(Ne) : String(t);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function kn(t) {
|
|
652
652
|
const e = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
653
653
|
let n;
|
|
654
654
|
for (; n = s.exec(t); )
|
|
655
655
|
e[n[1]] = n[2];
|
|
656
656
|
return e;
|
|
657
657
|
}
|
|
658
|
-
const
|
|
658
|
+
const Sn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
659
659
|
function Ge(t, e, s, n, r) {
|
|
660
660
|
if (c.isFunction(n))
|
|
661
661
|
return n.call(this, e, s);
|
|
@@ -666,10 +666,10 @@ function Ge(t, e, s, n, r) {
|
|
|
666
666
|
return n.test(e);
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Tn(t) {
|
|
670
670
|
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, s, n) => s.toUpperCase() + n);
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function En(t, e) {
|
|
673
673
|
const s = c.toCamelCase(" " + e);
|
|
674
674
|
["get", "set", "has"].forEach((n) => {
|
|
675
675
|
Object.defineProperty(t, n + s, {
|
|
@@ -694,7 +694,7 @@ class We {
|
|
|
694
694
|
(!_ || r[_] === void 0 || l === !0 || l === void 0 && r[_] !== !1) && (r[_ || u] = Ne(o));
|
|
695
695
|
}
|
|
696
696
|
const a = (o, u) => c.forEach(o, (l, f) => i(l, f, u));
|
|
697
|
-
return c.isPlainObject(e) || e instanceof this.constructor ? a(e, s) : c.isString(e) && (e = e.trim()) && !
|
|
697
|
+
return c.isPlainObject(e) || e instanceof this.constructor ? a(e, s) : c.isString(e) && (e = e.trim()) && !Sn(e) ? a(xn(e), s) : e != null && i(s, e, n), this;
|
|
698
698
|
}
|
|
699
699
|
get(e, s) {
|
|
700
700
|
if (e = ce(e), e) {
|
|
@@ -704,7 +704,7 @@ class We {
|
|
|
704
704
|
if (!s)
|
|
705
705
|
return r;
|
|
706
706
|
if (s === !0)
|
|
707
|
-
return
|
|
707
|
+
return kn(r);
|
|
708
708
|
if (c.isFunction(s))
|
|
709
709
|
return s.call(this, r, n);
|
|
710
710
|
if (c.isRegExp(s))
|
|
@@ -748,7 +748,7 @@ class We {
|
|
|
748
748
|
s[a] = Ne(r), delete s[i];
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
const o = e ?
|
|
751
|
+
const o = e ? Tn(i) : String(i).trim();
|
|
752
752
|
o !== i && delete s[i], s[o] = Ne(r), n[o] = !0;
|
|
753
753
|
}), this;
|
|
754
754
|
}
|
|
@@ -779,12 +779,12 @@ class We {
|
|
|
779
779
|
return s.forEach((r) => n.set(r)), n;
|
|
780
780
|
}
|
|
781
781
|
static accessor(e) {
|
|
782
|
-
const n = (this[
|
|
782
|
+
const n = (this[xt] = this[xt] = {
|
|
783
783
|
accessors: {}
|
|
784
784
|
}).accessors, r = this.prototype;
|
|
785
785
|
function i(a) {
|
|
786
786
|
const o = ce(a);
|
|
787
|
-
n[o] || (
|
|
787
|
+
n[o] || (En(r, a), n[o] = !0);
|
|
788
788
|
}
|
|
789
789
|
return c.isArray(e) ? e.forEach(i) : i(e), this;
|
|
790
790
|
}
|
|
@@ -800,7 +800,7 @@ function Xe(t, e) {
|
|
|
800
800
|
i = o.call(s, i, r.normalize(), e ? e.status : void 0);
|
|
801
801
|
}), r.normalize(), i;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function qt(t) {
|
|
804
804
|
return !!(t && t.__CANCEL__);
|
|
805
805
|
}
|
|
806
806
|
function ke(t, e, s) {
|
|
@@ -809,7 +809,7 @@ function ke(t, e, s) {
|
|
|
809
809
|
c.inherits(ke, T, {
|
|
810
810
|
__CANCEL__: !0
|
|
811
811
|
});
|
|
812
|
-
function
|
|
812
|
+
function On(t, e, s) {
|
|
813
813
|
const n = s.config.validateStatus;
|
|
814
814
|
!s.status || !n || n(s.status) ? t(s) : e(new T(
|
|
815
815
|
"Request failed with status code " + s.status,
|
|
@@ -819,7 +819,7 @@ function En(t, e, s) {
|
|
|
819
819
|
s
|
|
820
820
|
));
|
|
821
821
|
}
|
|
822
|
-
const
|
|
822
|
+
const Nn = M.isStandardBrowserEnv ? (
|
|
823
823
|
// Standard browser envs support document.cookie
|
|
824
824
|
function() {
|
|
825
825
|
return {
|
|
@@ -850,16 +850,16 @@ const On = M.isStandardBrowserEnv ? (
|
|
|
850
850
|
};
|
|
851
851
|
}()
|
|
852
852
|
);
|
|
853
|
-
function
|
|
853
|
+
function Cn(t) {
|
|
854
854
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function An(t, e) {
|
|
857
857
|
return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
return t && !
|
|
859
|
+
function Gt(t, e) {
|
|
860
|
+
return t && !Cn(e) ? An(t, e) : e;
|
|
861
861
|
}
|
|
862
|
-
const
|
|
862
|
+
const Rn = M.isStandardBrowserEnv ? (
|
|
863
863
|
// Standard browser envs have full support of the APIs needed to test
|
|
864
864
|
// whether the request URL is of the same origin as current location.
|
|
865
865
|
function() {
|
|
@@ -891,11 +891,11 @@ const An = M.isStandardBrowserEnv ? (
|
|
|
891
891
|
};
|
|
892
892
|
}()
|
|
893
893
|
);
|
|
894
|
-
function
|
|
894
|
+
function In(t) {
|
|
895
895
|
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
896
896
|
return e && e[1] || "";
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function jn(t, e) {
|
|
899
899
|
t = t || 10;
|
|
900
900
|
const s = new Array(t), n = new Array(t);
|
|
901
901
|
let r = 0, i = 0, a;
|
|
@@ -911,9 +911,9 @@ function In(t, e) {
|
|
|
911
911
|
return O ? Math.round(C * 1e3 / O) : void 0;
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function kt(t, e) {
|
|
915
915
|
let s = 0;
|
|
916
|
-
const n =
|
|
916
|
+
const n = jn(50, 250);
|
|
917
917
|
return (r) => {
|
|
918
918
|
const i = r.loaded, a = r.lengthComputable ? r.total : void 0, o = i - s, u = n(o), l = i <= a;
|
|
919
919
|
s = i;
|
|
@@ -929,7 +929,7 @@ function xt(t, e) {
|
|
|
929
929
|
f[e ? "download" : "upload"] = !0, t(f);
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
|
-
const
|
|
932
|
+
const Zn = typeof XMLHttpRequest < "u", Ln = Zn && function(t) {
|
|
933
933
|
return new Promise(function(s, n) {
|
|
934
934
|
let r = t.data;
|
|
935
935
|
const i = F.from(t.headers).normalize(), a = t.responseType;
|
|
@@ -943,8 +943,8 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
943
943
|
const O = t.auth.username || "", g = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
|
|
944
944
|
i.set("Authorization", "Basic " + btoa(O + ":" + g));
|
|
945
945
|
}
|
|
946
|
-
const f =
|
|
947
|
-
l.open(t.method.toUpperCase(),
|
|
946
|
+
const f = Gt(t.baseURL, t.url);
|
|
947
|
+
l.open(t.method.toUpperCase(), Jt(f, t.params, t.paramsSerializer), !0), l.timeout = t.timeout;
|
|
948
948
|
function _() {
|
|
949
949
|
if (!l)
|
|
950
950
|
return;
|
|
@@ -958,7 +958,7 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
958
958
|
config: t,
|
|
959
959
|
request: l
|
|
960
960
|
};
|
|
961
|
-
|
|
961
|
+
On(function(Z) {
|
|
962
962
|
s(Z), u();
|
|
963
963
|
}, function(Z) {
|
|
964
964
|
n(Z), u();
|
|
@@ -972,7 +972,7 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
972
972
|
n(new T("Network Error", T.ERR_NETWORK, t, l)), l = null;
|
|
973
973
|
}, l.ontimeout = function() {
|
|
974
974
|
let g = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
|
|
975
|
-
const S = t.transitional ||
|
|
975
|
+
const S = t.transitional || Wt;
|
|
976
976
|
t.timeoutErrorMessage && (g = t.timeoutErrorMessage), n(new T(
|
|
977
977
|
g,
|
|
978
978
|
S.clarifyTimeoutError ? T.ETIMEDOUT : T.ECONNABORTED,
|
|
@@ -980,15 +980,15 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
980
980
|
l
|
|
981
981
|
)), l = null;
|
|
982
982
|
}, M.isStandardBrowserEnv) {
|
|
983
|
-
const O = (t.withCredentials ||
|
|
983
|
+
const O = (t.withCredentials || Rn(f)) && t.xsrfCookieName && Nn.read(t.xsrfCookieName);
|
|
984
984
|
O && i.set(t.xsrfHeaderName, O);
|
|
985
985
|
}
|
|
986
986
|
r === void 0 && i.setContentType(null), "setRequestHeader" in l && c.forEach(i.toJSON(), function(g, S) {
|
|
987
987
|
l.setRequestHeader(S, g);
|
|
988
|
-
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials), a && a !== "json" && (l.responseType = t.responseType), typeof t.onDownloadProgress == "function" && l.addEventListener("progress",
|
|
988
|
+
}), c.isUndefined(t.withCredentials) || (l.withCredentials = !!t.withCredentials), a && a !== "json" && (l.responseType = t.responseType), typeof t.onDownloadProgress == "function" && l.addEventListener("progress", kt(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && l.upload && l.upload.addEventListener("progress", kt(t.onUploadProgress)), (t.cancelToken || t.signal) && (o = (O) => {
|
|
989
989
|
l && (n(!O || O.type ? new ke(null, t, l) : O), l.abort(), l = null);
|
|
990
990
|
}, t.cancelToken && t.cancelToken.subscribe(o), t.signal && (t.signal.aborted ? o() : t.signal.addEventListener("abort", o)));
|
|
991
|
-
const C =
|
|
991
|
+
const C = In(f);
|
|
992
992
|
if (C && M.protocols.indexOf(C) === -1) {
|
|
993
993
|
n(new T("Unsupported protocol " + C + ":", T.ERR_BAD_REQUEST, t));
|
|
994
994
|
return;
|
|
@@ -996,8 +996,8 @@ const jn = typeof XMLHttpRequest < "u", Zn = jn && function(t) {
|
|
|
996
996
|
l.send(r || null);
|
|
997
997
|
});
|
|
998
998
|
}, Ce = {
|
|
999
|
-
http:
|
|
1000
|
-
xhr:
|
|
999
|
+
http: an,
|
|
1000
|
+
xhr: Ln
|
|
1001
1001
|
};
|
|
1002
1002
|
c.forEach(Ce, (t, e) => {
|
|
1003
1003
|
if (t) {
|
|
@@ -1008,7 +1008,7 @@ c.forEach(Ce, (t, e) => {
|
|
|
1008
1008
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
|
-
const
|
|
1011
|
+
const Dn = {
|
|
1012
1012
|
getAdapter: (t) => {
|
|
1013
1013
|
t = c.isArray(t) ? t : [t];
|
|
1014
1014
|
const { length: e } = t;
|
|
@@ -1032,25 +1032,25 @@ function Ye(t) {
|
|
|
1032
1032
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1033
1033
|
throw new ke(null, t);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function St(t) {
|
|
1036
1036
|
return Ye(t), t.headers = F.from(t.headers), t.data = Xe.call(
|
|
1037
1037
|
t,
|
|
1038
1038
|
t.transformRequest
|
|
1039
|
-
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1039
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Dn.getAdapter(t.adapter || ut.adapter)(t).then(function(n) {
|
|
1040
1040
|
return Ye(t), n.data = Xe.call(
|
|
1041
1041
|
t,
|
|
1042
1042
|
t.transformResponse,
|
|
1043
1043
|
n
|
|
1044
1044
|
), n.headers = F.from(n.headers), n;
|
|
1045
1045
|
}, function(n) {
|
|
1046
|
-
return
|
|
1046
|
+
return qt(n) || (Ye(t), n && n.response && (n.response.data = Xe.call(
|
|
1047
1047
|
t,
|
|
1048
1048
|
t.transformResponse,
|
|
1049
1049
|
n.response
|
|
1050
1050
|
), n.response.headers = F.from(n.response.headers))), Promise.reject(n);
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
const
|
|
1053
|
+
const Tt = (t) => t instanceof F ? t.toJSON() : t;
|
|
1054
1054
|
function ie(t, e) {
|
|
1055
1055
|
e = e || {};
|
|
1056
1056
|
const s = {};
|
|
@@ -1109,23 +1109,23 @@ function ie(t, e) {
|
|
|
1109
1109
|
socketPath: a,
|
|
1110
1110
|
responseEncoding: a,
|
|
1111
1111
|
validateStatus: o,
|
|
1112
|
-
headers: (l, f) => r(
|
|
1112
|
+
headers: (l, f) => r(Tt(l), Tt(f), !0)
|
|
1113
1113
|
};
|
|
1114
1114
|
return c.forEach(Object.keys(Object.assign({}, t, e)), function(f) {
|
|
1115
1115
|
const _ = u[f] || r, C = _(t[f], e[f], f);
|
|
1116
1116
|
c.isUndefined(C) && _ !== o || (s[f] = C);
|
|
1117
1117
|
}), s;
|
|
1118
1118
|
}
|
|
1119
|
-
const
|
|
1119
|
+
const Xt = "1.4.0", dt = {};
|
|
1120
1120
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1121
1121
|
dt[t] = function(n) {
|
|
1122
1122
|
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1123
1123
|
};
|
|
1124
1124
|
});
|
|
1125
|
-
const
|
|
1125
|
+
const Et = {};
|
|
1126
1126
|
dt.transitional = function(e, s, n) {
|
|
1127
1127
|
function r(i, a) {
|
|
1128
|
-
return "[Axios v" +
|
|
1128
|
+
return "[Axios v" + Xt + "] Transitional option '" + i + "'" + a + (n ? ". " + n : "");
|
|
1129
1129
|
}
|
|
1130
1130
|
return (i, a, o) => {
|
|
1131
1131
|
if (e === !1)
|
|
@@ -1133,7 +1133,7 @@ dt.transitional = function(e, s, n) {
|
|
|
1133
1133
|
r(a, " has been removed" + (s ? " in " + s : "")),
|
|
1134
1134
|
T.ERR_DEPRECATED
|
|
1135
1135
|
);
|
|
1136
|
-
return s && !
|
|
1136
|
+
return s && !Et[a] && (Et[a] = !0, console.warn(
|
|
1137
1137
|
r(
|
|
1138
1138
|
a,
|
|
1139
1139
|
" has been deprecated since v" + s + " and will be removed in the near future"
|
|
@@ -1141,7 +1141,7 @@ dt.transitional = function(e, s, n) {
|
|
|
1141
1141
|
)), e ? e(i, a, o) : !0;
|
|
1142
1142
|
};
|
|
1143
1143
|
};
|
|
1144
|
-
function
|
|
1144
|
+
function Pn(t, e, s) {
|
|
1145
1145
|
if (typeof t != "object")
|
|
1146
1146
|
throw new T("options must be an object", T.ERR_BAD_OPTION_VALUE);
|
|
1147
1147
|
const n = Object.keys(t);
|
|
@@ -1159,14 +1159,14 @@ function Dn(t, e, s) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
1161
|
const st = {
|
|
1162
|
-
assertOptions:
|
|
1162
|
+
assertOptions: Pn,
|
|
1163
1163
|
validators: dt
|
|
1164
1164
|
}, W = st.validators;
|
|
1165
1165
|
class Ie {
|
|
1166
1166
|
constructor(e) {
|
|
1167
1167
|
this.defaults = e, this.interceptors = {
|
|
1168
|
-
request: new
|
|
1169
|
-
response: new
|
|
1168
|
+
request: new wt(),
|
|
1169
|
+
response: new wt()
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
@@ -1211,7 +1211,7 @@ class Ie {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
let f, _ = 0, C;
|
|
1213
1213
|
if (!u) {
|
|
1214
|
-
const g = [
|
|
1214
|
+
const g = [St.bind(this), void 0];
|
|
1215
1215
|
for (g.unshift.apply(g, o), g.push.apply(g, l), C = g.length, f = Promise.resolve(s); _ < C; )
|
|
1216
1216
|
f = f.then(g[_++], g[_++]);
|
|
1217
1217
|
return f;
|
|
@@ -1228,7 +1228,7 @@ class Ie {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
1230
|
try {
|
|
1231
|
-
f =
|
|
1231
|
+
f = St.call(this, O);
|
|
1232
1232
|
} catch (g) {
|
|
1233
1233
|
return Promise.reject(g);
|
|
1234
1234
|
}
|
|
@@ -1238,8 +1238,8 @@ class Ie {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
getUri(e) {
|
|
1240
1240
|
e = ie(this.defaults, e);
|
|
1241
|
-
const s =
|
|
1242
|
-
return
|
|
1241
|
+
const s = Gt(e.baseURL, e.url);
|
|
1242
|
+
return Jt(s, e.params, e.paramsSerializer);
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
c.forEach(["delete", "get", "head", "options"], function(e) {
|
|
@@ -1335,13 +1335,13 @@ class ft {
|
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
const
|
|
1339
|
-
function
|
|
1338
|
+
const Bn = ft;
|
|
1339
|
+
function Mn(t) {
|
|
1340
1340
|
return function(s) {
|
|
1341
1341
|
return t.apply(null, s);
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Un(t) {
|
|
1345
1345
|
return c.isObject(t) && t.isAxiosError === !0;
|
|
1346
1346
|
}
|
|
1347
1347
|
const nt = {
|
|
@@ -1412,45 +1412,48 @@ const nt = {
|
|
|
1412
1412
|
Object.entries(nt).forEach(([t, e]) => {
|
|
1413
1413
|
nt[e] = t;
|
|
1414
1414
|
});
|
|
1415
|
-
const
|
|
1416
|
-
function
|
|
1417
|
-
const e = new Ae(t), s =
|
|
1415
|
+
const zn = nt;
|
|
1416
|
+
function Yt(t) {
|
|
1417
|
+
const e = new Ae(t), s = Zt(Ae.prototype.request, e);
|
|
1418
1418
|
return c.extend(s, Ae.prototype, e, { allOwnKeys: !0 }), c.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(r) {
|
|
1419
|
-
return
|
|
1419
|
+
return Yt(ie(t, r));
|
|
1420
1420
|
}, s;
|
|
1421
1421
|
}
|
|
1422
|
-
const A =
|
|
1422
|
+
const A = Yt(ut);
|
|
1423
1423
|
A.Axios = Ae;
|
|
1424
1424
|
A.CanceledError = ke;
|
|
1425
|
-
A.CancelToken =
|
|
1426
|
-
A.isCancel =
|
|
1427
|
-
A.VERSION =
|
|
1425
|
+
A.CancelToken = Bn;
|
|
1426
|
+
A.isCancel = qt;
|
|
1427
|
+
A.VERSION = Xt;
|
|
1428
1428
|
A.toFormData = He;
|
|
1429
1429
|
A.AxiosError = T;
|
|
1430
1430
|
A.Cancel = A.CanceledError;
|
|
1431
1431
|
A.all = function(e) {
|
|
1432
1432
|
return Promise.all(e);
|
|
1433
1433
|
};
|
|
1434
|
-
A.spread =
|
|
1435
|
-
A.isAxiosError =
|
|
1434
|
+
A.spread = Mn;
|
|
1435
|
+
A.isAxiosError = Un;
|
|
1436
1436
|
A.mergeConfig = ie;
|
|
1437
1437
|
A.AxiosHeaders = F;
|
|
1438
|
-
A.formToJSON = (t) =>
|
|
1439
|
-
A.HttpStatusCode =
|
|
1438
|
+
A.formToJSON = (t) => Kt(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
1439
|
+
A.HttpStatusCode = zn;
|
|
1440
1440
|
A.default = A;
|
|
1441
1441
|
const ht = A;
|
|
1442
1442
|
function pt({ apiKey: t, options: e }) {
|
|
1443
1443
|
let s = {};
|
|
1444
|
-
return t &&
|
|
1444
|
+
return t && xs(s, ["headers", "Authorization"], `API-Key ${t}`), e && (s = Rt(s, e)), s;
|
|
1445
|
+
}
|
|
1446
|
+
function mt(t) {
|
|
1447
|
+
return t.replaceAll(" ", "").trim();
|
|
1445
1448
|
}
|
|
1446
|
-
async function
|
|
1447
|
-
return await ht.get(t, pt({ apiKey: e, options: s }));
|
|
1449
|
+
async function Qt({ url: t, apiKey: e, options: s }) {
|
|
1450
|
+
return await ht.get(mt(t), pt({ apiKey: e, options: s }));
|
|
1448
1451
|
}
|
|
1449
|
-
async function
|
|
1450
|
-
return await ht.post(t, n, pt({ apiKey: e, options: s }));
|
|
1452
|
+
async function es({ url: t, apiKey: e, options: s, payload: n = {} }) {
|
|
1453
|
+
return await ht.post(mt(t), n, pt({ apiKey: e, options: s }));
|
|
1451
1454
|
}
|
|
1452
|
-
async function
|
|
1453
|
-
return await ht.put(t, n, pt({ apiKey: e, options: s }));
|
|
1455
|
+
async function $n({ url: t, apiKey: e, options: s, payload: n }) {
|
|
1456
|
+
return await ht.put(mt(t), n, pt({ apiKey: e, options: s }));
|
|
1454
1457
|
}
|
|
1455
1458
|
async function Se(t) {
|
|
1456
1459
|
try {
|
|
@@ -1459,10 +1462,10 @@ async function Se(t) {
|
|
|
1459
1462
|
return Promise.reject(e);
|
|
1460
1463
|
}
|
|
1461
1464
|
}
|
|
1462
|
-
async function
|
|
1465
|
+
async function Vn({ apiKey: t, apiHost: e }, s, n) {
|
|
1463
1466
|
return Se(async () => {
|
|
1464
|
-
const r = (await
|
|
1465
|
-
return
|
|
1467
|
+
const r = (await es({ url: `${e}/v1/images/book/${s}`, apiKey: t, payload: n })).data;
|
|
1468
|
+
return Vr.parse(r);
|
|
1466
1469
|
});
|
|
1467
1470
|
}
|
|
1468
1471
|
var E;
|
|
@@ -1568,7 +1571,7 @@ const p = E.arrayToEnum([
|
|
|
1568
1571
|
"invalid_intersection_types",
|
|
1569
1572
|
"not_multiple_of",
|
|
1570
1573
|
"not_finite"
|
|
1571
|
-
]),
|
|
1574
|
+
]), Fn = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
1572
1575
|
class D extends Error {
|
|
1573
1576
|
constructor(e) {
|
|
1574
1577
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
@@ -1681,12 +1684,12 @@ const de = (t, e) => {
|
|
|
1681
1684
|
}
|
|
1682
1685
|
return { message: s };
|
|
1683
1686
|
};
|
|
1684
|
-
let
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1687
|
+
let ts = de;
|
|
1688
|
+
function Hn(t) {
|
|
1689
|
+
ts = t;
|
|
1687
1690
|
}
|
|
1688
1691
|
function je() {
|
|
1689
|
-
return
|
|
1692
|
+
return ts;
|
|
1690
1693
|
}
|
|
1691
1694
|
const Ze = (t) => {
|
|
1692
1695
|
const { data: e, path: s, errorMaps: n, issueData: r } = t, i = [...s, ...r.path || []], a = {
|
|
@@ -1702,7 +1705,7 @@ const Ze = (t) => {
|
|
|
1702
1705
|
path: i,
|
|
1703
1706
|
message: r.message || o
|
|
1704
1707
|
};
|
|
1705
|
-
},
|
|
1708
|
+
}, Jn = [];
|
|
1706
1709
|
function m(t, e) {
|
|
1707
1710
|
const s = Ze({
|
|
1708
1711
|
issueData: e,
|
|
@@ -1759,7 +1762,7 @@ class R {
|
|
|
1759
1762
|
}
|
|
1760
1763
|
const w = Object.freeze({
|
|
1761
1764
|
status: "aborted"
|
|
1762
|
-
}),
|
|
1765
|
+
}), ss = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), it = (t) => t.status === "aborted", at = (t) => t.status === "dirty", Le = (t) => t.status === "valid", De = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
1763
1766
|
var y;
|
|
1764
1767
|
(function(t) {
|
|
1765
1768
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
@@ -1772,7 +1775,7 @@ class U {
|
|
|
1772
1775
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1773
1776
|
}
|
|
1774
1777
|
}
|
|
1775
|
-
const
|
|
1778
|
+
const Ot = (t, e) => {
|
|
1776
1779
|
if (Le(e))
|
|
1777
1780
|
return { success: !0, data: e.value };
|
|
1778
1781
|
if (!t.common.issues.length)
|
|
@@ -1858,7 +1861,7 @@ class k {
|
|
|
1858
1861
|
data: e,
|
|
1859
1862
|
parsedType: K(e)
|
|
1860
1863
|
}, i = this._parseSync({ data: e, path: r.path, parent: r });
|
|
1861
|
-
return
|
|
1864
|
+
return Ot(r, i);
|
|
1862
1865
|
}
|
|
1863
1866
|
async parseAsync(e, s) {
|
|
1864
1867
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -1879,7 +1882,7 @@ class k {
|
|
|
1879
1882
|
data: e,
|
|
1880
1883
|
parsedType: K(e)
|
|
1881
1884
|
}, r = this._parse({ data: e, path: n.path, parent: n }), i = await (De(r) ? r : Promise.resolve(r));
|
|
1882
|
-
return
|
|
1885
|
+
return Ot(n, i);
|
|
1883
1886
|
}
|
|
1884
1887
|
refine(e, s) {
|
|
1885
1888
|
const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
|
|
@@ -1943,7 +1946,7 @@ class k {
|
|
|
1943
1946
|
});
|
|
1944
1947
|
}
|
|
1945
1948
|
brand() {
|
|
1946
|
-
return new
|
|
1949
|
+
return new rs({
|
|
1947
1950
|
typeName: v.ZodBranded,
|
|
1948
1951
|
type: this,
|
|
1949
1952
|
...x(this._def)
|
|
@@ -1975,9 +1978,9 @@ class k {
|
|
|
1975
1978
|
return this.safeParse(null).success;
|
|
1976
1979
|
}
|
|
1977
1980
|
}
|
|
1978
|
-
const
|
|
1979
|
-
function
|
|
1980
|
-
return !!((e === "v4" || !e) &&
|
|
1981
|
+
const Wn = /^c[^\s-]{8,}$/i, Kn = /^[a-z][a-z0-9]*$/, qn = /[0-9A-HJKMNP-TV-Z]{26}/, Gn = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i, Xn = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/, Yn = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u, Qn = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/, er = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, tr = (t) => t.precision ? t.offset ? new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`) : new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`) : t.precision === 0 ? t.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$") : t.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");
|
|
1982
|
+
function sr(t, e) {
|
|
1983
|
+
return !!((e === "v4" || !e) && Qn.test(t) || (e === "v6" || !e) && er.test(t));
|
|
1981
1984
|
}
|
|
1982
1985
|
class L extends k {
|
|
1983
1986
|
constructor() {
|
|
@@ -2048,37 +2051,37 @@ class L extends k {
|
|
|
2048
2051
|
message: i.message
|
|
2049
2052
|
}), n.dirty());
|
|
2050
2053
|
} else if (i.kind === "email")
|
|
2051
|
-
|
|
2054
|
+
Xn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2052
2055
|
validation: "email",
|
|
2053
2056
|
code: h.invalid_string,
|
|
2054
2057
|
message: i.message
|
|
2055
2058
|
}), n.dirty());
|
|
2056
2059
|
else if (i.kind === "emoji")
|
|
2057
|
-
|
|
2060
|
+
Yn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2058
2061
|
validation: "emoji",
|
|
2059
2062
|
code: h.invalid_string,
|
|
2060
2063
|
message: i.message
|
|
2061
2064
|
}), n.dirty());
|
|
2062
2065
|
else if (i.kind === "uuid")
|
|
2063
|
-
|
|
2066
|
+
Gn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2064
2067
|
validation: "uuid",
|
|
2065
2068
|
code: h.invalid_string,
|
|
2066
2069
|
message: i.message
|
|
2067
2070
|
}), n.dirty());
|
|
2068
2071
|
else if (i.kind === "cuid")
|
|
2069
|
-
|
|
2072
|
+
Wn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2070
2073
|
validation: "cuid",
|
|
2071
2074
|
code: h.invalid_string,
|
|
2072
2075
|
message: i.message
|
|
2073
2076
|
}), n.dirty());
|
|
2074
2077
|
else if (i.kind === "cuid2")
|
|
2075
|
-
|
|
2078
|
+
Kn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2076
2079
|
validation: "cuid2",
|
|
2077
2080
|
code: h.invalid_string,
|
|
2078
2081
|
message: i.message
|
|
2079
2082
|
}), n.dirty());
|
|
2080
2083
|
else if (i.kind === "ulid")
|
|
2081
|
-
|
|
2084
|
+
qn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2082
2085
|
validation: "ulid",
|
|
2083
2086
|
code: h.invalid_string,
|
|
2084
2087
|
message: i.message
|
|
@@ -2110,11 +2113,11 @@ class L extends k {
|
|
|
2110
2113
|
code: h.invalid_string,
|
|
2111
2114
|
validation: { endsWith: i.value },
|
|
2112
2115
|
message: i.message
|
|
2113
|
-
}), n.dirty()) : i.kind === "datetime" ?
|
|
2116
|
+
}), n.dirty()) : i.kind === "datetime" ? tr(i).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2114
2117
|
code: h.invalid_string,
|
|
2115
2118
|
validation: "datetime",
|
|
2116
2119
|
message: i.message
|
|
2117
|
-
}), n.dirty()) : i.kind === "ip" ?
|
|
2120
|
+
}), n.dirty()) : i.kind === "ip" ? sr(e.data, i.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
2118
2121
|
validation: "ip",
|
|
2119
2122
|
code: h.invalid_string,
|
|
2120
2123
|
message: i.message
|
|
@@ -2264,7 +2267,7 @@ L.create = (t) => {
|
|
|
2264
2267
|
...x(t)
|
|
2265
2268
|
});
|
|
2266
2269
|
};
|
|
2267
|
-
function
|
|
2270
|
+
function nr(t, e) {
|
|
2268
2271
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, i = parseInt(t.toFixed(r).replace(".", "")), a = parseInt(e.toFixed(r).replace(".", ""));
|
|
2269
2272
|
return i % a / Math.pow(10, r);
|
|
2270
2273
|
}
|
|
@@ -2303,7 +2306,7 @@ class q extends k {
|
|
|
2303
2306
|
inclusive: i.inclusive,
|
|
2304
2307
|
exact: !1,
|
|
2305
2308
|
message: i.message
|
|
2306
|
-
}), r.dirty()) : i.kind === "multipleOf" ?
|
|
2309
|
+
}), r.dirty()) : i.kind === "multipleOf" ? nr(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2307
2310
|
code: h.not_multiple_of,
|
|
2308
2311
|
multipleOf: i.value,
|
|
2309
2312
|
message: i.message
|
|
@@ -3124,7 +3127,7 @@ class N extends k {
|
|
|
3124
3127
|
});
|
|
3125
3128
|
}
|
|
3126
3129
|
keyof() {
|
|
3127
|
-
return
|
|
3130
|
+
return ns(E.objectKeys(this.shape));
|
|
3128
3131
|
}
|
|
3129
3132
|
}
|
|
3130
3133
|
N.create = (t, e) => new N({
|
|
@@ -3675,7 +3678,7 @@ _e.create = (t, e) => new _e({
|
|
|
3675
3678
|
typeName: v.ZodLiteral,
|
|
3676
3679
|
...x(e)
|
|
3677
3680
|
});
|
|
3678
|
-
function
|
|
3681
|
+
function ns(t, e) {
|
|
3679
3682
|
return new X({
|
|
3680
3683
|
values: t,
|
|
3681
3684
|
typeName: v.ZodEnum,
|
|
@@ -3730,7 +3733,7 @@ class X extends k {
|
|
|
3730
3733
|
return X.create(this.options.filter((s) => !e.includes(s)));
|
|
3731
3734
|
}
|
|
3732
3735
|
}
|
|
3733
|
-
X.create =
|
|
3736
|
+
X.create = ns;
|
|
3734
3737
|
class be extends k {
|
|
3735
3738
|
_parse(e) {
|
|
3736
3739
|
const s = E.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -3969,8 +3972,8 @@ ze.create = (t) => new ze({
|
|
|
3969
3972
|
typeName: v.ZodNaN,
|
|
3970
3973
|
...x(t)
|
|
3971
3974
|
});
|
|
3972
|
-
const
|
|
3973
|
-
class
|
|
3975
|
+
const rr = Symbol("zod_brand");
|
|
3976
|
+
class rs extends k {
|
|
3974
3977
|
_parse(e) {
|
|
3975
3978
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
3976
3979
|
return this._def.type._parse({
|
|
@@ -3993,7 +3996,7 @@ class Te extends k {
|
|
|
3993
3996
|
path: n.path,
|
|
3994
3997
|
parent: n
|
|
3995
3998
|
});
|
|
3996
|
-
return i.status === "aborted" ? w : i.status === "dirty" ? (s.dirty(),
|
|
3999
|
+
return i.status === "aborted" ? w : i.status === "dirty" ? (s.dirty(), ss(i.value)) : this._def.out._parseAsync({
|
|
3997
4000
|
data: i.value,
|
|
3998
4001
|
path: n.path,
|
|
3999
4002
|
parent: n
|
|
@@ -4023,22 +4026,22 @@ class Te extends k {
|
|
|
4023
4026
|
});
|
|
4024
4027
|
}
|
|
4025
4028
|
}
|
|
4026
|
-
const
|
|
4029
|
+
const is = (t, e = {}, s) => t ? ae.create().superRefine((n, r) => {
|
|
4027
4030
|
var i, a;
|
|
4028
4031
|
if (!t(n)) {
|
|
4029
4032
|
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (a = (i = o.fatal) !== null && i !== void 0 ? i : s) !== null && a !== void 0 ? a : !0, l = typeof o == "string" ? { message: o } : o;
|
|
4030
4033
|
r.addIssue({ code: "custom", ...l, fatal: u });
|
|
4031
4034
|
}
|
|
4032
|
-
}) : ae.create(),
|
|
4035
|
+
}) : ae.create(), ir = {
|
|
4033
4036
|
object: N.lazycreate
|
|
4034
4037
|
};
|
|
4035
4038
|
var v;
|
|
4036
4039
|
(function(t) {
|
|
4037
4040
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline";
|
|
4038
4041
|
})(v || (v = {}));
|
|
4039
|
-
const
|
|
4042
|
+
const ar = (t, e = {
|
|
4040
4043
|
message: `Input not instance of ${t.name}`
|
|
4041
|
-
}) =>
|
|
4044
|
+
}) => is((s) => s instanceof t, e), as = L.create, os = q.create, or = ze.create, lr = G.create, ls = fe.create, cr = Q.create, ur = Pe.create, dr = he.create, fr = pe.create, hr = ae.create, pr = Y.create, mr = J.create, yr = Be.create, gr = P.create, vr = N.create, _r = N.strictCreate, br = me.create, wr = Ke.create, xr = ye.create, kr = z.create, Sr = ge.create, Tr = Me.create, Er = ee.create, Or = re.create, Nr = ve.create, Cr = _e.create, Ar = X.create, Rr = be.create, Ir = oe.create, Nt = B.create, jr = H.create, Zr = te.create, Lr = B.createWithPreprocess, Dr = Te.create, Pr = () => as().optional(), Br = () => os().optional(), Mr = () => ls().optional(), Ur = {
|
|
4042
4045
|
string: (t) => L.create({ ...t, coerce: !0 }),
|
|
4043
4046
|
number: (t) => q.create({ ...t, coerce: !0 }),
|
|
4044
4047
|
boolean: (t) => fe.create({
|
|
@@ -4047,18 +4050,18 @@ const ir = (t, e = {
|
|
|
4047
4050
|
}),
|
|
4048
4051
|
bigint: (t) => G.create({ ...t, coerce: !0 }),
|
|
4049
4052
|
date: (t) => Q.create({ ...t, coerce: !0 })
|
|
4050
|
-
},
|
|
4053
|
+
}, zr = w;
|
|
4051
4054
|
var d = /* @__PURE__ */ Object.freeze({
|
|
4052
4055
|
__proto__: null,
|
|
4053
4056
|
defaultErrorMap: de,
|
|
4054
|
-
setErrorMap:
|
|
4057
|
+
setErrorMap: Hn,
|
|
4055
4058
|
getErrorMap: je,
|
|
4056
4059
|
makeIssue: Ze,
|
|
4057
|
-
EMPTY_PATH:
|
|
4060
|
+
EMPTY_PATH: Jn,
|
|
4058
4061
|
addIssueToContext: m,
|
|
4059
4062
|
ParseStatus: R,
|
|
4060
4063
|
INVALID: w,
|
|
4061
|
-
DIRTY:
|
|
4064
|
+
DIRTY: ss,
|
|
4062
4065
|
OK: I,
|
|
4063
4066
|
isAborted: it,
|
|
4064
4067
|
isDirty: at,
|
|
@@ -4107,62 +4110,62 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
4107
4110
|
ZodDefault: we,
|
|
4108
4111
|
ZodCatch: Ue,
|
|
4109
4112
|
ZodNaN: ze,
|
|
4110
|
-
BRAND:
|
|
4111
|
-
ZodBranded:
|
|
4113
|
+
BRAND: rr,
|
|
4114
|
+
ZodBranded: rs,
|
|
4112
4115
|
ZodPipeline: Te,
|
|
4113
|
-
custom:
|
|
4116
|
+
custom: is,
|
|
4114
4117
|
Schema: k,
|
|
4115
4118
|
ZodSchema: k,
|
|
4116
|
-
late:
|
|
4119
|
+
late: ir,
|
|
4117
4120
|
get ZodFirstPartyTypeKind() {
|
|
4118
4121
|
return v;
|
|
4119
4122
|
},
|
|
4120
|
-
coerce:
|
|
4121
|
-
any:
|
|
4122
|
-
array:
|
|
4123
|
-
bigint:
|
|
4124
|
-
boolean:
|
|
4125
|
-
date:
|
|
4126
|
-
discriminatedUnion:
|
|
4127
|
-
effect:
|
|
4128
|
-
enum:
|
|
4129
|
-
function:
|
|
4130
|
-
instanceof:
|
|
4131
|
-
intersection:
|
|
4132
|
-
lazy:
|
|
4133
|
-
literal:
|
|
4134
|
-
map:
|
|
4135
|
-
nan:
|
|
4136
|
-
nativeEnum:
|
|
4137
|
-
never:
|
|
4138
|
-
null:
|
|
4139
|
-
nullable:
|
|
4140
|
-
number:
|
|
4141
|
-
object:
|
|
4142
|
-
oboolean:
|
|
4143
|
-
onumber:
|
|
4144
|
-
optional:
|
|
4145
|
-
ostring:
|
|
4146
|
-
pipeline:
|
|
4147
|
-
preprocess:
|
|
4148
|
-
promise:
|
|
4149
|
-
record:
|
|
4150
|
-
set:
|
|
4151
|
-
strictObject:
|
|
4152
|
-
string:
|
|
4153
|
-
symbol:
|
|
4154
|
-
transformer:
|
|
4155
|
-
tuple:
|
|
4156
|
-
undefined:
|
|
4157
|
-
union:
|
|
4158
|
-
unknown:
|
|
4159
|
-
void:
|
|
4160
|
-
NEVER:
|
|
4123
|
+
coerce: Ur,
|
|
4124
|
+
any: hr,
|
|
4125
|
+
array: gr,
|
|
4126
|
+
bigint: lr,
|
|
4127
|
+
boolean: ls,
|
|
4128
|
+
date: cr,
|
|
4129
|
+
discriminatedUnion: wr,
|
|
4130
|
+
effect: Nt,
|
|
4131
|
+
enum: Ar,
|
|
4132
|
+
function: Or,
|
|
4133
|
+
instanceof: ar,
|
|
4134
|
+
intersection: xr,
|
|
4135
|
+
lazy: Nr,
|
|
4136
|
+
literal: Cr,
|
|
4137
|
+
map: Tr,
|
|
4138
|
+
nan: or,
|
|
4139
|
+
nativeEnum: Rr,
|
|
4140
|
+
never: mr,
|
|
4141
|
+
null: fr,
|
|
4142
|
+
nullable: Zr,
|
|
4143
|
+
number: os,
|
|
4144
|
+
object: vr,
|
|
4145
|
+
oboolean: Mr,
|
|
4146
|
+
onumber: Br,
|
|
4147
|
+
optional: jr,
|
|
4148
|
+
ostring: Pr,
|
|
4149
|
+
pipeline: Dr,
|
|
4150
|
+
preprocess: Lr,
|
|
4151
|
+
promise: Ir,
|
|
4152
|
+
record: Sr,
|
|
4153
|
+
set: Er,
|
|
4154
|
+
strictObject: _r,
|
|
4155
|
+
string: as,
|
|
4156
|
+
symbol: ur,
|
|
4157
|
+
transformer: Nt,
|
|
4158
|
+
tuple: kr,
|
|
4159
|
+
undefined: dr,
|
|
4160
|
+
union: br,
|
|
4161
|
+
unknown: pr,
|
|
4162
|
+
void: yr,
|
|
4163
|
+
NEVER: zr,
|
|
4161
4164
|
ZodIssueCode: h,
|
|
4162
|
-
quotelessJson:
|
|
4165
|
+
quotelessJson: Fn,
|
|
4163
4166
|
ZodError: D
|
|
4164
4167
|
});
|
|
4165
|
-
class
|
|
4168
|
+
class $r {
|
|
4166
4169
|
constructor(e, s) {
|
|
4167
4170
|
b(this, "client");
|
|
4168
4171
|
b(this, "parentId");
|
|
@@ -4171,12 +4174,12 @@ class zr {
|
|
|
4171
4174
|
this.client = e, this.parentId = s, this.images = [], this.length = this.images.length;
|
|
4172
4175
|
}
|
|
4173
4176
|
async add(e) {
|
|
4174
|
-
return this.images.push(e), this.length = this.images.length, await
|
|
4177
|
+
return this.images.push(e), this.length = this.images.length, await Vn(this.client, this.parentId, new Fr(e)), new Promise((s) => {
|
|
4175
4178
|
s(this.length);
|
|
4176
4179
|
});
|
|
4177
4180
|
}
|
|
4178
4181
|
}
|
|
4179
|
-
const
|
|
4182
|
+
const Vr = d.object({
|
|
4180
4183
|
handle: d.string(),
|
|
4181
4184
|
url: d.string(),
|
|
4182
4185
|
width: d.number(),
|
|
@@ -4187,7 +4190,7 @@ const $r = d.object({
|
|
|
4187
4190
|
camera: d.string().optional(),
|
|
4188
4191
|
filename: d.string()
|
|
4189
4192
|
});
|
|
4190
|
-
class
|
|
4193
|
+
class Fr {
|
|
4191
4194
|
constructor(e) {
|
|
4192
4195
|
b(this, "handle");
|
|
4193
4196
|
b(this, "url");
|
|
@@ -4201,7 +4204,7 @@ class Vr {
|
|
|
4201
4204
|
this.handle = e.handle, this.url = e.url, this.width = e.width, this.height = e.height, this.orientation = e.rotation, this.taken_at = e.captureTime, this.camera_make = e.cameraMake, this.camera = e.cameraModel, this.filename = e.filename;
|
|
4202
4205
|
}
|
|
4203
4206
|
}
|
|
4204
|
-
const
|
|
4207
|
+
const Hr = [
|
|
4205
4208
|
"new",
|
|
4206
4209
|
"ingesting",
|
|
4207
4210
|
"submitted",
|
|
@@ -4214,7 +4217,7 @@ const Fr = [
|
|
|
4214
4217
|
"polishing",
|
|
4215
4218
|
"ready",
|
|
4216
4219
|
"error"
|
|
4217
|
-
],
|
|
4220
|
+
], cs = [
|
|
4218
4221
|
"baby",
|
|
4219
4222
|
"birthday",
|
|
4220
4223
|
"default",
|
|
@@ -4230,7 +4233,7 @@ const Fr = [
|
|
|
4230
4233
|
"travel",
|
|
4231
4234
|
"wedding",
|
|
4232
4235
|
"year-in-review"
|
|
4233
|
-
],
|
|
4236
|
+
], us = {
|
|
4234
4237
|
1005: { slug: "modern-black-sfly" },
|
|
4235
4238
|
1101: { slug: "bon-voyage-sfly" },
|
|
4236
4239
|
1103: { slug: "fun-in-the-sun-sfly" },
|
|
@@ -4391,8 +4394,13 @@ const Fr = [
|
|
|
4391
4394
|
6097: { slug: "boho-wedding-sfly" },
|
|
4392
4395
|
6098: { slug: "black-and-white-rustic-sfly" },
|
|
4393
4396
|
6099: { slug: "bright-color-pop-sfly" }
|
|
4394
|
-
},
|
|
4395
|
-
|
|
4397
|
+
}, ds = ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"], fs = ["sc", "hc", "pl"], hs = ["sp", "sl", "dl"], ps = ["low", "medium", "high"], ms = ["best", "most", "all"], ys = ["none", "few", "lots"], gs = ["none", "few", "lots"], Jr = {
|
|
4398
|
+
state: "error",
|
|
4399
|
+
slug: "error",
|
|
4400
|
+
progress: 100,
|
|
4401
|
+
message: "Design failed"
|
|
4402
|
+
}, Wr = "https://api.sfly-sls.magicbook.io", Kr = "wss://socket.sfly-sls.magicbook.io", qr = parseInt("30000") || 3e4;
|
|
4403
|
+
class Gr {
|
|
4396
4404
|
constructor(e) {
|
|
4397
4405
|
b(this, "occasion");
|
|
4398
4406
|
b(this, "style");
|
|
@@ -4406,36 +4414,36 @@ class Kr {
|
|
|
4406
4414
|
this.occasion = e.occasion, this.style = e.style, this.book_size = e.book_size, this.cover_type = e.cover_type, this.page_type = e.page_type, this.image_density = e.image_density, this.image_filtering_level = e.image_filtering_level, this.embellishment_level = e.embellishment_level, this.text_sticker_level = e.text_sticker_level;
|
|
4407
4415
|
}
|
|
4408
4416
|
}
|
|
4409
|
-
const
|
|
4410
|
-
occasion: d.enum(
|
|
4417
|
+
const Xr = d.object({
|
|
4418
|
+
occasion: d.enum(cs),
|
|
4411
4419
|
style: d.string(),
|
|
4412
|
-
book_size: d.enum(
|
|
4413
|
-
cover_type: d.enum(
|
|
4414
|
-
page_type: d.enum(
|
|
4415
|
-
image_density: d.enum(
|
|
4416
|
-
image_filtering_level: d.enum(
|
|
4417
|
-
embellishment_level: d.enum(
|
|
4418
|
-
text_sticker_level: d.enum(
|
|
4419
|
-
}),
|
|
4420
|
+
book_size: d.enum(ds),
|
|
4421
|
+
cover_type: d.enum(fs),
|
|
4422
|
+
page_type: d.enum(hs),
|
|
4423
|
+
image_density: d.enum(ps),
|
|
4424
|
+
image_filtering_level: d.enum(ms),
|
|
4425
|
+
embellishment_level: d.enum(ys),
|
|
4426
|
+
text_sticker_level: d.enum(gs)
|
|
4427
|
+
}), vs = d.object({
|
|
4420
4428
|
id: d.string(),
|
|
4421
4429
|
title: d.string(),
|
|
4422
|
-
design_request:
|
|
4423
|
-
state: d.enum(
|
|
4430
|
+
design_request: Xr,
|
|
4431
|
+
state: d.enum(Hr).optional(),
|
|
4424
4432
|
guid: d.string().optional()
|
|
4425
4433
|
});
|
|
4426
|
-
class
|
|
4434
|
+
class yt {
|
|
4427
4435
|
constructor(e) {
|
|
4428
4436
|
b(this, "id");
|
|
4429
4437
|
b(this, "title");
|
|
4430
4438
|
b(this, "design_request");
|
|
4431
4439
|
b(this, "state");
|
|
4432
4440
|
b(this, "guid");
|
|
4433
|
-
this.id = e.id, this.title = e.title, this.design_request = new
|
|
4441
|
+
this.id = e.id, this.title = e.title, this.design_request = new Gr(e.design_request), this.state = e.state, this.guid = e.guid;
|
|
4434
4442
|
}
|
|
4435
4443
|
}
|
|
4436
|
-
function
|
|
4437
|
-
const e =
|
|
4438
|
-
return s.style = e, new
|
|
4444
|
+
function Ct(t) {
|
|
4445
|
+
const e = us[t.style].slug, s = It(JSON.parse(JSON.stringify(t)));
|
|
4446
|
+
return s.style = e, new yt({
|
|
4439
4447
|
id: t.parentId,
|
|
4440
4448
|
guid: t.guid,
|
|
4441
4449
|
title: t.title,
|
|
@@ -4448,31 +4456,35 @@ const Qe = d.object({
|
|
|
4448
4456
|
maxImageCount: d.number(),
|
|
4449
4457
|
avgImageCount: d.number(),
|
|
4450
4458
|
minImageCount: d.number()
|
|
4451
|
-
}),
|
|
4459
|
+
}), Yr = d.object({
|
|
4452
4460
|
high: Qe,
|
|
4453
4461
|
medium: Qe,
|
|
4454
4462
|
low: Qe
|
|
4455
|
-
}),
|
|
4456
|
-
densities:
|
|
4463
|
+
}), Qr = d.object({
|
|
4464
|
+
densities: Yr
|
|
4457
4465
|
});
|
|
4458
|
-
async function
|
|
4466
|
+
async function ei({ apiKey: t, apiHost: e }, s, n, r) {
|
|
4459
4467
|
return Se(async () => {
|
|
4460
|
-
const
|
|
4461
|
-
{
|
|
4462
|
-
|
|
4463
|
-
|
|
4468
|
+
const i = await Qt(
|
|
4469
|
+
{
|
|
4470
|
+
url: `${e}/v1/designoptions/booksize/${s}/imagecount/${n}
|
|
4471
|
+
/imagefilteringlevel/${r}`,
|
|
4472
|
+
apiKey: t
|
|
4473
|
+
}
|
|
4474
|
+
), a = jt(i.data);
|
|
4475
|
+
return Qr.parse(a);
|
|
4464
4476
|
});
|
|
4465
4477
|
}
|
|
4466
|
-
const
|
|
4478
|
+
const ti = d.object({
|
|
4467
4479
|
photoRefId: d.string(),
|
|
4468
4480
|
finalCrop: d.array(d.number())
|
|
4469
|
-
}),
|
|
4481
|
+
}), si = d.object({
|
|
4470
4482
|
x: d.number(),
|
|
4471
4483
|
y: d.number(),
|
|
4472
4484
|
width: d.number().optional(),
|
|
4473
4485
|
height: d.number().optional(),
|
|
4474
4486
|
rotation: d.number()
|
|
4475
|
-
}),
|
|
4487
|
+
}), ni = d.object({
|
|
4476
4488
|
id: d.string(),
|
|
4477
4489
|
llx: d.number(),
|
|
4478
4490
|
lly: d.number(),
|
|
@@ -4486,13 +4498,13 @@ const Qr = d.object({
|
|
|
4486
4498
|
source: d.string(),
|
|
4487
4499
|
rotation: d.number(),
|
|
4488
4500
|
uploadTime: d.string()
|
|
4489
|
-
}),
|
|
4501
|
+
}), ri = d.object({
|
|
4490
4502
|
key: d.string(),
|
|
4491
4503
|
value: d.any()
|
|
4492
|
-
}),
|
|
4504
|
+
}), ii = d.object({
|
|
4493
4505
|
type: d.string(),
|
|
4494
|
-
imageAssignment:
|
|
4495
|
-
position:
|
|
4506
|
+
imageAssignment: ti.optional(),
|
|
4507
|
+
position: si,
|
|
4496
4508
|
seqNum: d.number(),
|
|
4497
4509
|
z: d.number(),
|
|
4498
4510
|
id: d.string().optional(),
|
|
@@ -4503,54 +4515,55 @@ const Qr = d.object({
|
|
|
4503
4515
|
fontSize: d.number().optional(),
|
|
4504
4516
|
fontColor: d.string().optional(),
|
|
4505
4517
|
frame: d.string().optional()
|
|
4506
|
-
}),
|
|
4518
|
+
}), ai = d.object({
|
|
4507
4519
|
url: d.string(),
|
|
4508
4520
|
encryptId: d.string(),
|
|
4509
4521
|
photoRefId: d.string(),
|
|
4510
4522
|
photoId: d.string(),
|
|
4511
|
-
photoMetadata:
|
|
4512
|
-
}), ii = d.object({
|
|
4513
|
-
properties: d.array(si)
|
|
4514
|
-
}), ai = d.object({
|
|
4515
|
-
backgroundId: d.string().nullable(),
|
|
4516
|
-
assets: d.array(ni).optional()
|
|
4523
|
+
photoMetadata: ni
|
|
4517
4524
|
}), oi = d.object({
|
|
4518
|
-
|
|
4519
|
-
type: d.string(),
|
|
4520
|
-
canvas: ai
|
|
4525
|
+
properties: d.array(ri)
|
|
4521
4526
|
}), li = d.object({
|
|
4522
|
-
|
|
4523
|
-
|
|
4527
|
+
backgroundId: d.string().nullable(),
|
|
4528
|
+
assets: d.array(ii).optional()
|
|
4524
4529
|
}), ci = d.object({
|
|
4530
|
+
pageNum: d.number(),
|
|
4531
|
+
type: d.string(),
|
|
4532
|
+
canvas: li
|
|
4533
|
+
}), ui = d.object({
|
|
4534
|
+
pages: d.array(ci),
|
|
4535
|
+
photoStrip: d.array(ai)
|
|
4536
|
+
}), di = d.object({
|
|
4525
4537
|
title: d.string(),
|
|
4526
4538
|
binding: d.string(),
|
|
4527
4539
|
coverSpecId: d.string(),
|
|
4528
4540
|
styleId: d.number(),
|
|
4529
4541
|
userId: d.string(),
|
|
4530
|
-
magicShopBook:
|
|
4531
|
-
reportingData:
|
|
4542
|
+
magicShopBook: ui,
|
|
4543
|
+
reportingData: oi
|
|
4532
4544
|
});
|
|
4533
|
-
async function
|
|
4545
|
+
async function fi({ apiHost: t, apiKey: e }, s) {
|
|
4534
4546
|
return Se(async () => {
|
|
4535
|
-
const n = (await
|
|
4536
|
-
return
|
|
4547
|
+
const n = (await es({ url: `${t}/v1/books`, apiKey: e, payload: s })).data;
|
|
4548
|
+
return vs.safeParse(n), new yt(n);
|
|
4537
4549
|
});
|
|
4538
4550
|
}
|
|
4539
|
-
async function
|
|
4551
|
+
async function At({ apiHost: t, apiKey: e }, s) {
|
|
4540
4552
|
return Se(async () => {
|
|
4541
|
-
const n = (await
|
|
4542
|
-
return
|
|
4553
|
+
const n = (await $n({ url: `${t}/v1/books/${s.id}`, apiKey: e, payload: s })).data;
|
|
4554
|
+
return vs.safeParse(n), new yt(n);
|
|
4543
4555
|
});
|
|
4544
4556
|
}
|
|
4545
|
-
async function
|
|
4557
|
+
async function hi({ apiHost: t, apiKey: e }, s) {
|
|
4546
4558
|
return Se(async () => {
|
|
4547
|
-
const n = (await
|
|
4548
|
-
return
|
|
4559
|
+
const n = (await Qt({ url: `${t}/v1/books/${s}/format/galleon`, apiKey: e })).data;
|
|
4560
|
+
return di.parse(n);
|
|
4549
4561
|
});
|
|
4550
4562
|
}
|
|
4551
|
-
class
|
|
4563
|
+
class pi {
|
|
4552
4564
|
constructor(e, s, n) {
|
|
4553
4565
|
b(this, "client");
|
|
4566
|
+
b(this, "webSocket");
|
|
4554
4567
|
b(this, "parentId");
|
|
4555
4568
|
b(this, "title");
|
|
4556
4569
|
b(this, "occasion");
|
|
@@ -4564,64 +4577,72 @@ class fi {
|
|
|
4564
4577
|
b(this, "textStickerLevel");
|
|
4565
4578
|
b(this, "images");
|
|
4566
4579
|
b(this, "guid");
|
|
4567
|
-
this.client = s, this.
|
|
4580
|
+
this.parentId = e, this.client = s, this.webSocket = new WebSocket(`${this.client.webSocketHost}/?book_id=${this.parentId}`), this.title = (n == null ? void 0 : n.title) || "", this.occasion = (n == null ? void 0 : n.occasion) || cs[0], this.style = (n == null ? void 0 : n.style) || parseInt(Object.keys(us)[0]), this.bookSize = (n == null ? void 0 : n.bookSize) || ds[0], this.coverType = (n == null ? void 0 : n.coverType) || fs[0], this.pageType = (n == null ? void 0 : n.pageType) || hs[0], this.imageDensity = (n == null ? void 0 : n.imageDensity) || ps[0], this.imageFilteringLevel = (n == null ? void 0 : n.imageFilteringLevel) || ms[0], this.embellishmentLevel = (n == null ? void 0 : n.embellishmentLevel) || ys[0], this.textStickerLevel = (n == null ? void 0 : n.textStickerLevel) || gs[0], this.images = new $r(this.client, this.parentId);
|
|
4568
4581
|
}
|
|
4569
4582
|
async getOptions(e) {
|
|
4570
|
-
return await
|
|
4583
|
+
return await ei(
|
|
4584
|
+
this.client,
|
|
4585
|
+
this.bookSize,
|
|
4586
|
+
e || this.images.length,
|
|
4587
|
+
this.imageFilteringLevel
|
|
4588
|
+
);
|
|
4571
4589
|
}
|
|
4572
4590
|
async submit(e) {
|
|
4573
|
-
return e && Object.assign(this, e), this.getProgress(), await
|
|
4591
|
+
return e && Object.assign(this, e), this.getProgress(), await At(this.client, Ct(this)), this;
|
|
4574
4592
|
}
|
|
4575
4593
|
async setGuid(e) {
|
|
4576
|
-
return this.guid = e, await
|
|
4594
|
+
return this.guid = e, await At(this.client, Ct(this)), this.guid;
|
|
4577
4595
|
}
|
|
4578
4596
|
async getJSON() {
|
|
4579
|
-
return await
|
|
4597
|
+
return await hi(this.client, this.parentId);
|
|
4598
|
+
}
|
|
4599
|
+
async eventHandler(e, s = "MagicBook.designRequestUpdated") {
|
|
4600
|
+
const n = new CustomEvent(s, { detail: e });
|
|
4601
|
+
window.dispatchEvent(n), ["error", "ready"].includes(e.slug) && this.webSocket.close();
|
|
4602
|
+
}
|
|
4603
|
+
timeoutHandler() {
|
|
4604
|
+
return setTimeout(() => {
|
|
4605
|
+
this.eventHandler(Jr);
|
|
4606
|
+
}, qr);
|
|
4580
4607
|
}
|
|
4581
4608
|
async getProgress() {
|
|
4582
|
-
let e = "new";
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
const i = JSON.parse(r.data);
|
|
4588
|
-
if (e !== i.state) {
|
|
4589
|
-
e = i.state;
|
|
4590
|
-
const a = new CustomEvent("MagicBook.designRequestUpdated", { detail: i });
|
|
4591
|
-
["error", "ready"].includes(i.state) && (s.close(), clearTimeout(n)), window.dispatchEvent(a);
|
|
4592
|
-
}
|
|
4593
|
-
};
|
|
4609
|
+
let e = "new", s;
|
|
4610
|
+
this.webSocket.onmessage = (n) => {
|
|
4611
|
+
const r = JSON.parse(n.data);
|
|
4612
|
+
e !== r.slug && (s && clearTimeout(s), s = this.timeoutHandler(), this.eventHandler(r), e = r.slug);
|
|
4613
|
+
}, this.webSocket.onclose = () => clearTimeout(s);
|
|
4594
4614
|
}
|
|
4595
4615
|
}
|
|
4596
|
-
class
|
|
4597
|
-
constructor(e, s =
|
|
4616
|
+
class yi {
|
|
4617
|
+
constructor(e, s = Wr, n = Kr) {
|
|
4598
4618
|
b(this, "apiKey");
|
|
4599
4619
|
b(this, "apiHost");
|
|
4600
4620
|
b(this, "webSocketHost");
|
|
4601
4621
|
this.apiKey = e, this.apiHost = s, this.webSocketHost = n;
|
|
4602
4622
|
}
|
|
4603
4623
|
async createDesignRequest(e) {
|
|
4604
|
-
const s = await
|
|
4605
|
-
return new
|
|
4624
|
+
const s = await fi(this);
|
|
4625
|
+
return new pi(s.id, this, e);
|
|
4606
4626
|
}
|
|
4607
4627
|
}
|
|
4608
4628
|
export {
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4629
|
+
pi as DesignRequest,
|
|
4630
|
+
Fr as ImageServer,
|
|
4631
|
+
$r as Images,
|
|
4632
|
+
yi as MagicBookClient,
|
|
4633
|
+
ds as bookSizes,
|
|
4634
|
+
fs as coverTypes,
|
|
4635
|
+
Qr as designOptionsSchema,
|
|
4636
|
+
ys as embellishmentLevels,
|
|
4637
|
+
ps as imageDensities,
|
|
4618
4638
|
Qe as imageDensityOptionSchema,
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4639
|
+
Yr as imageDensityOptionsSchema,
|
|
4640
|
+
ms as imageFilteringLevels,
|
|
4641
|
+
Vr as imageServerSchema,
|
|
4642
|
+
cs as occasions,
|
|
4643
|
+
hs as pageTypes,
|
|
4644
|
+
Hr as states,
|
|
4645
|
+
us as styles,
|
|
4646
|
+
gs as textStickerLevels,
|
|
4647
|
+
Jr as timeoutMessage
|
|
4627
4648
|
};
|