iboot-http-client 1.2.6 → 1.2.8

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.
@@ -1,16 +1,16 @@
1
- import R from "pino";
2
- import U from "pino-pretty";
3
- import B from "js-md5";
4
- import I from "crypto-js";
5
- const K = {
1
+ import zt from "pino";
2
+ import Vt from "pino-pretty";
3
+ import Kt from "js-md5";
4
+ import ne from "crypto-js";
5
+ const Ir = {
6
6
  GENERAL: 0,
7
7
  PHONE: 1,
8
8
  EMAIL: 2
9
- }, C = {
9
+ }, Dt = {
10
10
  TYPE_MGT: 0,
11
11
  TYPE_C: 1,
12
12
  TYPE_B: 2
13
- }, G = {
13
+ }, Or = {
14
14
  FROM_WEB: 1,
15
15
  FROM_PC: 2,
16
16
  FROM_WX_MINI_PRO: 3,
@@ -18,246 +18,1936 @@ const K = {
18
18
  FROM_WX_E: 5,
19
19
  FROM_APP: 6,
20
20
  FROM_DEVICE: 7
21
- }, F = {
21
+ }, xr = {
22
22
  unknown: 0,
23
23
  male: 1,
24
24
  female: 2
25
- }, M = U({
25
+ }, Yt = Vt({
26
26
  colorize: !0,
27
27
  destination: process.stdout,
28
28
  translateTime: "SYS:yyyy-mm-dd HH:MM:ss",
29
29
  ignore: "pid,hostname",
30
30
  messageFormat: "{msg}",
31
31
  singleLine: !0
32
- }), d = R({
32
+ }), k = zt({
33
33
  name: process.env.APP_NAME ?? "iBoot",
34
34
  level: process.env.APP_ENV === "production" ? "info" : "debug",
35
35
  nestedKey: "payload"
36
- }, M), O = (s) => Array.isArray(s) || typeof s == "object" && Object.prototype.toString.call(s) === "[object Array]", b = (s) => {
37
- const e = s || 32, t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678", n = t.length;
38
- let r = "";
39
- for (let o = 0; o < e; o++)
40
- r += t.charAt(Math.floor(Math.random() * n));
41
- return r;
42
- }, L = (s, e) => {
36
+ }, Yt), st = (i) => Array.isArray(i) || typeof i == "object" && Object.prototype.toString.call(i) === "[object Array]", at = (i) => {
37
+ const e = i || 32, t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678", o = t.length;
38
+ let n = "";
39
+ for (let a = 0; a < e; a++)
40
+ n += t.charAt(Math.floor(Math.random() * o));
41
+ return n;
42
+ }, Ze = (i, e) => {
43
43
  const t = {};
44
- return s.split("&").forEach((r) => {
45
- const o = r.split("=");
46
- o[1] && (!e || e.indexOf(o[0]) == -1) && (t[o[0]] = o[1]);
44
+ return i.split("&").forEach((n) => {
45
+ const a = n.split("=");
46
+ a[1] && (!e || e.indexOf(a[0]) == -1) && (t[a[0]] = a[1]);
47
47
  }), t;
48
- }, T = (s) => !s || s == "" || s.length == 0 ? "" : encodeURIComponent(s).replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\'/g, "%27").replace(/\!/g, "%21").replace(/\~/g, "%7E"), k = (s, e) => {
48
+ }, we = (i) => !i || i == "" || i.length == 0 ? "" : encodeURIComponent(i).replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\'/g, "%27").replace(/\!/g, "%21").replace(/\~/g, "%7E"), Nr = (i, e) => {
49
49
  const t = {
50
- "M+": s.getMonth() + 1,
50
+ "M+": i.getMonth() + 1,
51
51
  //月份
52
- "d+": s.getDate(),
52
+ "d+": i.getDate(),
53
53
  //日
54
- "h+": s.getHours(),
54
+ "h+": i.getHours(),
55
55
  //小时
56
- "m+": s.getMinutes(),
56
+ "m+": i.getMinutes(),
57
57
  //分
58
- "s+": s.getSeconds(),
58
+ "s+": i.getSeconds(),
59
59
  //秒
60
- "q+": Math.floor((s.getMonth() + 3) / 3),
60
+ "q+": Math.floor((i.getMonth() + 3) / 3),
61
61
  //季度
62
- S: s.getMilliseconds()
62
+ S: i.getMilliseconds()
63
63
  //毫秒
64
64
  };
65
65
  if (/(y+)/.test(e)) {
66
- const r = new RegExp(/(y+)/).exec(e);
67
- let o = 0;
68
- r && r.length > 0 && (o = r[0].length), e = e.replace(/(y+)/, s.getFullYear() + "").substring(4 - o);
66
+ const n = new RegExp(/(y+)/).exec(e);
67
+ let a = 0;
68
+ n && n.length > 0 && (a = n[0].length), e = e.replace(/(y+)/, i.getFullYear() + "").substring(4 - a);
69
69
  }
70
- for (const n in t) {
71
- const r = "(" + n + ")", o = new RegExp(r);
72
- if (o.test(e)) {
73
- const i = o.exec(e);
74
- let a = 0;
75
- i && i.length > 0 && (a = i[0].length), e = e.replace(o, a == 1 ? t[n].toString() : ("00" + t[n]).substring(t[n].toString().length));
70
+ for (const o in t) {
71
+ const n = "(" + o + ")", a = new RegExp(n);
72
+ if (a.test(e)) {
73
+ const c = a.exec(e);
74
+ let r = 0;
75
+ c && c.length > 0 && (r = c[0].length), e = e.replace(a, r == 1 ? t[o].toString() : ("00" + t[o]).substring(t[o].toString().length));
76
76
  }
77
77
  }
78
78
  return e;
79
- }, D = "zh-CN", S = "_device_id_key", P = "_current_website_key", _ = "Get request error!", w = "Post request error!", f = {
79
+ };
80
+ var Ee = { exports: {} }, ye = {}, Se = {}, Ae = {}, ut;
81
+ function $t() {
82
+ return ut || (ut = 1, (function(i) {
83
+ Object.defineProperty(i, "__esModule", {
84
+ value: !0
85
+ }), Object.defineProperty(i, "detectDomainLocale", {
86
+ enumerable: !0,
87
+ get: function() {
88
+ return e;
89
+ }
90
+ });
91
+ function e(t, o, n) {
92
+ if (t) {
93
+ n && (n = n.toLowerCase());
94
+ for (const r of t) {
95
+ var a, c;
96
+ const d = (a = r.domain) == null ? void 0 : a.split(":", 1)[0].toLowerCase();
97
+ if (o === d || n === r.defaultLocale.toLowerCase() || (c = r.locales) != null && c.some((g) => g.toLowerCase() === n))
98
+ return r;
99
+ }
100
+ }
101
+ }
102
+ })(Ae)), Ae;
103
+ }
104
+ var Te = {}, Ie = {}, ct;
105
+ function Jt() {
106
+ return ct || (ct = 1, (function(i) {
107
+ Object.defineProperty(i, "__esModule", {
108
+ value: !0
109
+ }), Object.defineProperty(i, "removeTrailingSlash", {
110
+ enumerable: !0,
111
+ get: function() {
112
+ return e;
113
+ }
114
+ });
115
+ function e(t) {
116
+ return t.replace(/\/$/, "") || "/";
117
+ }
118
+ })(Ie)), Ie;
119
+ }
120
+ var Oe = {}, xe = {}, lt;
121
+ function et() {
122
+ return lt || (lt = 1, (function(i) {
123
+ Object.defineProperty(i, "__esModule", {
124
+ value: !0
125
+ }), Object.defineProperty(i, "parsePath", {
126
+ enumerable: !0,
127
+ get: function() {
128
+ return e;
129
+ }
130
+ });
131
+ function e(t) {
132
+ const o = t.indexOf("#"), n = t.indexOf("?"), a = n > -1 && (o < 0 || n < o);
133
+ return a || o > -1 ? {
134
+ pathname: t.substring(0, a ? n : o),
135
+ query: a ? t.substring(n, o > -1 ? o : void 0) : "",
136
+ hash: o > -1 ? t.slice(o) : ""
137
+ } : {
138
+ pathname: t,
139
+ query: "",
140
+ hash: ""
141
+ };
142
+ }
143
+ })(xe)), xe;
144
+ }
145
+ var dt;
146
+ function Mt() {
147
+ return dt || (dt = 1, (function(i) {
148
+ Object.defineProperty(i, "__esModule", {
149
+ value: !0
150
+ }), Object.defineProperty(i, "addPathPrefix", {
151
+ enumerable: !0,
152
+ get: function() {
153
+ return t;
154
+ }
155
+ });
156
+ const e = et();
157
+ function t(o, n) {
158
+ if (!o.startsWith("/") || !n)
159
+ return o;
160
+ const { pathname: a, query: c, hash: r } = (0, e.parsePath)(o);
161
+ return "" + n + a + c + r;
162
+ }
163
+ })(Oe)), Oe;
164
+ }
165
+ var Ne = {}, ht;
166
+ function Qt() {
167
+ return ht || (ht = 1, (function(i) {
168
+ Object.defineProperty(i, "__esModule", {
169
+ value: !0
170
+ }), Object.defineProperty(i, "addPathSuffix", {
171
+ enumerable: !0,
172
+ get: function() {
173
+ return t;
174
+ }
175
+ });
176
+ const e = et();
177
+ function t(o, n) {
178
+ if (!o.startsWith("/") || !n)
179
+ return o;
180
+ const { pathname: a, query: c, hash: r } = (0, e.parsePath)(o);
181
+ return "" + a + n + c + r;
182
+ }
183
+ })(Ne)), Ne;
184
+ }
185
+ var Ce = {}, Le = {}, ft;
186
+ function tt() {
187
+ return ft || (ft = 1, (function(i) {
188
+ Object.defineProperty(i, "__esModule", {
189
+ value: !0
190
+ }), Object.defineProperty(i, "pathHasPrefix", {
191
+ enumerable: !0,
192
+ get: function() {
193
+ return t;
194
+ }
195
+ });
196
+ const e = et();
197
+ function t(o, n) {
198
+ if (typeof o != "string")
199
+ return !1;
200
+ const { pathname: a } = (0, e.parsePath)(o);
201
+ return a === n || a.startsWith(n + "/");
202
+ }
203
+ })(Le)), Le;
204
+ }
205
+ var pt;
206
+ function Zt() {
207
+ return pt || (pt = 1, (function(i) {
208
+ Object.defineProperty(i, "__esModule", {
209
+ value: !0
210
+ }), Object.defineProperty(i, "addLocale", {
211
+ enumerable: !0,
212
+ get: function() {
213
+ return o;
214
+ }
215
+ });
216
+ const e = Mt(), t = tt();
217
+ function o(n, a, c, r) {
218
+ if (!a || a === c) return n;
219
+ const d = n.toLowerCase();
220
+ return !r && ((0, t.pathHasPrefix)(d, "/api") || (0, t.pathHasPrefix)(d, "/" + a.toLowerCase())) ? n : (0, e.addPathPrefix)(n, "/" + a);
221
+ }
222
+ })(Ce)), Ce;
223
+ }
224
+ var mt;
225
+ function er() {
226
+ return mt || (mt = 1, (function(i) {
227
+ Object.defineProperty(i, "__esModule", {
228
+ value: !0
229
+ }), Object.defineProperty(i, "formatNextPathnameInfo", {
230
+ enumerable: !0,
231
+ get: function() {
232
+ return a;
233
+ }
234
+ });
235
+ const e = Jt(), t = Mt(), o = Qt(), n = Zt();
236
+ function a(c) {
237
+ let r = (0, n.addLocale)(c.pathname, c.locale, c.buildId ? void 0 : c.defaultLocale, c.ignorePrefix);
238
+ return (c.buildId || !c.trailingSlash) && (r = (0, e.removeTrailingSlash)(r)), c.buildId && (r = (0, o.addPathSuffix)((0, t.addPathPrefix)(r, "/_next/data/" + c.buildId), c.pathname === "/" ? "index.json" : ".json")), r = (0, t.addPathPrefix)(r, c.basePath), !c.buildId && c.trailingSlash ? r.endsWith("/") ? r : (0, o.addPathSuffix)(r, "/") : (0, e.removeTrailingSlash)(r);
239
+ }
240
+ })(Te)), Te;
241
+ }
242
+ var ke = {}, _t;
243
+ function tr() {
244
+ return _t || (_t = 1, (function(i) {
245
+ Object.defineProperty(i, "__esModule", {
246
+ value: !0
247
+ }), Object.defineProperty(i, "getHostname", {
248
+ enumerable: !0,
249
+ get: function() {
250
+ return e;
251
+ }
252
+ });
253
+ function e(t, o) {
254
+ let n;
255
+ if (o?.host && !Array.isArray(o.host))
256
+ n = o.host.toString().split(":", 1)[0];
257
+ else if (t.hostname)
258
+ n = t.hostname;
259
+ else return;
260
+ return n.toLowerCase();
261
+ }
262
+ })(ke)), ke;
263
+ }
264
+ var Ue = {}, De = {}, gt;
265
+ function rr() {
266
+ return gt || (gt = 1, (function(i) {
267
+ Object.defineProperty(i, "__esModule", {
268
+ value: !0
269
+ }), Object.defineProperty(i, "normalizeLocalePath", {
270
+ enumerable: !0,
271
+ get: function() {
272
+ return e;
273
+ }
274
+ });
275
+ function e(t, o) {
276
+ let n;
277
+ const a = t.split("/");
278
+ return (o || []).some((c) => a[1] && a[1].toLowerCase() === c.toLowerCase() ? (n = c, a.splice(1, 1), t = a.join("/") || "/", !0) : !1), {
279
+ pathname: t,
280
+ detectedLocale: n
281
+ };
282
+ }
283
+ })(De)), De;
284
+ }
285
+ var Me = {}, bt;
286
+ function nr() {
287
+ return bt || (bt = 1, (function(i) {
288
+ Object.defineProperty(i, "__esModule", {
289
+ value: !0
290
+ }), Object.defineProperty(i, "removePathPrefix", {
291
+ enumerable: !0,
292
+ get: function() {
293
+ return t;
294
+ }
295
+ });
296
+ const e = tt();
297
+ function t(o, n) {
298
+ if (!(0, e.pathHasPrefix)(o, n))
299
+ return o;
300
+ const a = o.slice(n.length);
301
+ return a.startsWith("/") ? a : "/" + a;
302
+ }
303
+ })(Me)), Me;
304
+ }
305
+ var wt;
306
+ function ir() {
307
+ return wt || (wt = 1, (function(i) {
308
+ Object.defineProperty(i, "__esModule", {
309
+ value: !0
310
+ }), Object.defineProperty(i, "getNextPathnameInfo", {
311
+ enumerable: !0,
312
+ get: function() {
313
+ return n;
314
+ }
315
+ });
316
+ const e = rr(), t = nr(), o = tt();
317
+ function n(a, c) {
318
+ var r;
319
+ const { basePath: d, i18n: g, trailingSlash: u } = (r = c.nextConfig) != null ? r : {}, _ = {
320
+ pathname: a,
321
+ trailingSlash: a !== "/" ? a.endsWith("/") : u
322
+ };
323
+ d && (0, o.pathHasPrefix)(_.pathname, d) && (_.pathname = (0, t.removePathPrefix)(_.pathname, d), _.basePath = d);
324
+ let p = _.pathname;
325
+ if (_.pathname.startsWith("/_next/data/") && _.pathname.endsWith(".json")) {
326
+ const S = _.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), x = S[0];
327
+ _.buildId = x, p = S[1] !== "index" ? "/" + S.slice(1).join("/") : "/", c.parseData === !0 && (_.pathname = p);
328
+ }
329
+ if (g) {
330
+ let S = c.i18nProvider ? c.i18nProvider.analyze(_.pathname) : (0, e.normalizeLocalePath)(_.pathname, g.locales);
331
+ _.locale = S.detectedLocale;
332
+ var R;
333
+ _.pathname = (R = S.pathname) != null ? R : _.pathname, !S.detectedLocale && _.buildId && (S = c.i18nProvider ? c.i18nProvider.analyze(p) : (0, e.normalizeLocalePath)(p, g.locales), S.detectedLocale && (_.locale = S.detectedLocale));
334
+ }
335
+ return _;
336
+ }
337
+ })(Ue)), Ue;
338
+ }
339
+ var Et;
340
+ function jt() {
341
+ return Et || (Et = 1, (function(i) {
342
+ Object.defineProperty(i, "__esModule", {
343
+ value: !0
344
+ }), Object.defineProperty(i, "NextURL", {
345
+ enumerable: !0,
346
+ get: function() {
347
+ return d;
348
+ }
349
+ });
350
+ const e = $t(), t = er(), o = tr(), n = ir(), a = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;
351
+ function c(g, u) {
352
+ return new URL(String(g).replace(a, "localhost"), u && String(u).replace(a, "localhost"));
353
+ }
354
+ const r = /* @__PURE__ */ Symbol("NextURLInternal");
355
+ class d {
356
+ constructor(u, _, p) {
357
+ let R, S;
358
+ typeof _ == "object" && "pathname" in _ || typeof _ == "string" ? (R = _, S = p || {}) : S = p || _ || {}, this[r] = {
359
+ url: c(u, R ?? S.base),
360
+ options: S,
361
+ basePath: ""
362
+ }, this.analyze();
363
+ }
364
+ analyze() {
365
+ var u, _, p, R, S;
366
+ const x = (0, n.getNextPathnameInfo)(this[r].url.pathname, {
367
+ nextConfig: this[r].options.nextConfig,
368
+ parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,
369
+ i18nProvider: this[r].options.i18nProvider
370
+ }), l = (0, o.getHostname)(this[r].url, this[r].options.headers);
371
+ this[r].domainLocale = this[r].options.i18nProvider ? this[r].options.i18nProvider.detectDomainLocale(l) : (0, e.detectDomainLocale)((_ = this[r].options.nextConfig) == null || (u = _.i18n) == null ? void 0 : u.domains, l);
372
+ const b = ((p = this[r].domainLocale) == null ? void 0 : p.defaultLocale) || ((S = this[r].options.nextConfig) == null || (R = S.i18n) == null ? void 0 : R.defaultLocale);
373
+ this[r].url.pathname = x.pathname, this[r].defaultLocale = b, this[r].basePath = x.basePath ?? "", this[r].buildId = x.buildId, this[r].locale = x.locale ?? b, this[r].trailingSlash = x.trailingSlash;
374
+ }
375
+ formatPathname() {
376
+ return (0, t.formatNextPathnameInfo)({
377
+ basePath: this[r].basePath,
378
+ buildId: this[r].buildId,
379
+ defaultLocale: this[r].options.forceLocale ? void 0 : this[r].defaultLocale,
380
+ locale: this[r].locale,
381
+ pathname: this[r].url.pathname,
382
+ trailingSlash: this[r].trailingSlash
383
+ });
384
+ }
385
+ formatSearch() {
386
+ return this[r].url.search;
387
+ }
388
+ get buildId() {
389
+ return this[r].buildId;
390
+ }
391
+ set buildId(u) {
392
+ this[r].buildId = u;
393
+ }
394
+ get locale() {
395
+ return this[r].locale ?? "";
396
+ }
397
+ set locale(u) {
398
+ var _, p;
399
+ if (!this[r].locale || !(!((p = this[r].options.nextConfig) == null || (_ = p.i18n) == null) && _.locales.includes(u)))
400
+ throw new TypeError(`The NextURL configuration includes no locale "${u}"`);
401
+ this[r].locale = u;
402
+ }
403
+ get defaultLocale() {
404
+ return this[r].defaultLocale;
405
+ }
406
+ get domainLocale() {
407
+ return this[r].domainLocale;
408
+ }
409
+ get searchParams() {
410
+ return this[r].url.searchParams;
411
+ }
412
+ get host() {
413
+ return this[r].url.host;
414
+ }
415
+ set host(u) {
416
+ this[r].url.host = u;
417
+ }
418
+ get hostname() {
419
+ return this[r].url.hostname;
420
+ }
421
+ set hostname(u) {
422
+ this[r].url.hostname = u;
423
+ }
424
+ get port() {
425
+ return this[r].url.port;
426
+ }
427
+ set port(u) {
428
+ this[r].url.port = u;
429
+ }
430
+ get protocol() {
431
+ return this[r].url.protocol;
432
+ }
433
+ set protocol(u) {
434
+ this[r].url.protocol = u;
435
+ }
436
+ get href() {
437
+ const u = this.formatPathname(), _ = this.formatSearch();
438
+ return `${this.protocol}//${this.host}${u}${_}${this.hash}`;
439
+ }
440
+ set href(u) {
441
+ this[r].url = c(u), this.analyze();
442
+ }
443
+ get origin() {
444
+ return this[r].url.origin;
445
+ }
446
+ get pathname() {
447
+ return this[r].url.pathname;
448
+ }
449
+ set pathname(u) {
450
+ this[r].url.pathname = u;
451
+ }
452
+ get hash() {
453
+ return this[r].url.hash;
454
+ }
455
+ set hash(u) {
456
+ this[r].url.hash = u;
457
+ }
458
+ get search() {
459
+ return this[r].url.search;
460
+ }
461
+ set search(u) {
462
+ this[r].url.search = u;
463
+ }
464
+ get password() {
465
+ return this[r].url.password;
466
+ }
467
+ set password(u) {
468
+ this[r].url.password = u;
469
+ }
470
+ get username() {
471
+ return this[r].url.username;
472
+ }
473
+ set username(u) {
474
+ this[r].url.username = u;
475
+ }
476
+ get basePath() {
477
+ return this[r].basePath;
478
+ }
479
+ set basePath(u) {
480
+ this[r].basePath = u.startsWith("/") ? u : `/${u}`;
481
+ }
482
+ toString() {
483
+ return this.href;
484
+ }
485
+ toJSON() {
486
+ return this.href;
487
+ }
488
+ [/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
489
+ return {
490
+ href: this.href,
491
+ origin: this.origin,
492
+ protocol: this.protocol,
493
+ username: this.username,
494
+ password: this.password,
495
+ host: this.host,
496
+ hostname: this.hostname,
497
+ port: this.port,
498
+ pathname: this.pathname,
499
+ search: this.search,
500
+ searchParams: this.searchParams,
501
+ hash: this.hash
502
+ };
503
+ }
504
+ clone() {
505
+ return new d(String(this), this[r].options);
506
+ }
507
+ }
508
+ })(Se)), Se;
509
+ }
510
+ var je = {}, qe = {}, vt;
511
+ function or() {
512
+ return vt || (vt = 1, (function(i) {
513
+ Object.defineProperty(i, "__esModule", {
514
+ value: !0
515
+ });
516
+ function e(_e, ge) {
517
+ for (var $ in ge) Object.defineProperty(_e, $, {
518
+ enumerable: !0,
519
+ get: ge[$]
520
+ });
521
+ }
522
+ e(i, {
523
+ ACTION_SUFFIX: function() {
524
+ return d;
525
+ },
526
+ APP_DIR_ALIAS: function() {
527
+ return M;
528
+ },
529
+ CACHE_ONE_YEAR: function() {
530
+ return E;
531
+ },
532
+ DOT_NEXT_ALIAS: function() {
533
+ return P;
534
+ },
535
+ ESLINT_DEFAULT_DIRS: function() {
536
+ return te;
537
+ },
538
+ GSP_NO_RETURNED_VALUE: function() {
539
+ return oe;
540
+ },
541
+ GSSP_COMPONENT_MEMBER_ERROR: function() {
542
+ return ee;
543
+ },
544
+ GSSP_NO_RETURNED_VALUE: function() {
545
+ return se;
546
+ },
547
+ INSTRUMENTATION_HOOK_FILENAME: function() {
548
+ return f;
549
+ },
550
+ MIDDLEWARE_FILENAME: function() {
551
+ return s;
552
+ },
553
+ MIDDLEWARE_LOCATION_REGEXP: function() {
554
+ return v;
555
+ },
556
+ NEXT_BODY_SUFFIX: function() {
557
+ return _;
558
+ },
559
+ NEXT_CACHE_IMPLICIT_TAG_ID: function() {
560
+ return m;
561
+ },
562
+ NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
563
+ return S;
564
+ },
565
+ NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
566
+ return x;
567
+ },
568
+ NEXT_CACHE_SOFT_TAGS_HEADER: function() {
569
+ return R;
570
+ },
571
+ NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
572
+ return h;
573
+ },
574
+ NEXT_CACHE_TAGS_HEADER: function() {
575
+ return p;
576
+ },
577
+ NEXT_CACHE_TAG_MAX_ITEMS: function() {
578
+ return l;
579
+ },
580
+ NEXT_CACHE_TAG_MAX_LENGTH: function() {
581
+ return b;
582
+ },
583
+ NEXT_DATA_SUFFIX: function() {
584
+ return g;
585
+ },
586
+ NEXT_INTERCEPTION_MARKER_PREFIX: function() {
587
+ return o;
588
+ },
589
+ NEXT_META_SUFFIX: function() {
590
+ return u;
591
+ },
592
+ NEXT_QUERY_PARAM_PREFIX: function() {
593
+ return t;
594
+ },
595
+ NON_STANDARD_NODE_ENV: function() {
596
+ return ae;
597
+ },
598
+ PAGES_DIR_ALIAS: function() {
599
+ return w;
600
+ },
601
+ PRERENDER_REVALIDATE_HEADER: function() {
602
+ return n;
603
+ },
604
+ PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
605
+ return a;
606
+ },
607
+ PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
608
+ return F;
609
+ },
610
+ ROOT_DIR_ALIAS: function() {
611
+ return N;
612
+ },
613
+ RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
614
+ return Q;
615
+ },
616
+ RSC_ACTION_ENCRYPTION_ALIAS: function() {
617
+ return J;
618
+ },
619
+ RSC_ACTION_PROXY_ALIAS: function() {
620
+ return j;
621
+ },
622
+ RSC_ACTION_VALIDATE_ALIAS: function() {
623
+ return H;
624
+ },
625
+ RSC_MOD_REF_PROXY_ALIAS: function() {
626
+ return D;
627
+ },
628
+ RSC_PREFETCH_SUFFIX: function() {
629
+ return c;
630
+ },
631
+ RSC_SUFFIX: function() {
632
+ return r;
633
+ },
634
+ SERVER_PROPS_EXPORT_ERROR: function() {
635
+ return de;
636
+ },
637
+ SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
638
+ return ie;
639
+ },
640
+ SERVER_PROPS_SSG_CONFLICT: function() {
641
+ return z;
642
+ },
643
+ SERVER_RUNTIME: function() {
644
+ return ue;
645
+ },
646
+ SSG_FALLBACK_EXPORT_ERROR: function() {
647
+ return fe;
648
+ },
649
+ SSG_GET_INITIAL_PROPS_CONFLICT: function() {
650
+ return W;
651
+ },
652
+ STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
653
+ return Z;
654
+ },
655
+ UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
656
+ return he;
657
+ },
658
+ WEBPACK_LAYERS: function() {
659
+ return pe;
660
+ },
661
+ WEBPACK_RESOURCE_QUERIES: function() {
662
+ return me;
663
+ }
664
+ });
665
+ const t = "nxtP", o = "nxtI", n = "x-prerender-revalidate", a = "x-prerender-revalidate-if-generated", c = ".prefetch.rsc", r = ".rsc", d = ".action", g = ".json", u = ".meta", _ = ".body", p = "x-next-cache-tags", R = "x-next-cache-soft-tags", S = "x-next-revalidated-tags", x = "x-next-revalidate-tag-token", l = 128, b = 256, h = 1024, m = "_N_T_", E = 31536e3, s = "middleware", v = `(?:src/)?${s}`, f = "instrumentation", w = "private-next-pages", P = "private-dot-next", N = "private-next-root-dir", M = "private-next-app-dir", D = "private-next-rsc-mod-ref-proxy", H = "private-next-rsc-action-validate", j = "private-next-rsc-server-reference", J = "private-next-rsc-action-encryption", Q = "private-next-rsc-action-client-wrapper", F = "You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict", W = "You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps", ie = "You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.", z = "You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps", Z = "can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props", de = "pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export", oe = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?", se = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?", he = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.", ee = "can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member", ae = 'You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env', fe = "Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export", te = [
666
+ "app",
667
+ "pages",
668
+ "components",
669
+ "lib",
670
+ "src"
671
+ ], ue = {
672
+ edge: "edge",
673
+ experimentalEdge: "experimental-edge",
674
+ nodejs: "nodejs"
675
+ }, L = {
676
+ /**
677
+ * The layer for the shared code between the client and server bundles.
678
+ */
679
+ shared: "shared",
680
+ /**
681
+ * React Server Components layer (rsc).
682
+ */
683
+ reactServerComponents: "rsc",
684
+ /**
685
+ * Server Side Rendering layer for app (ssr).
686
+ */
687
+ serverSideRendering: "ssr",
688
+ /**
689
+ * The browser client bundle layer for actions.
690
+ */
691
+ actionBrowser: "action-browser",
692
+ /**
693
+ * The layer for the API routes.
694
+ */
695
+ api: "api",
696
+ /**
697
+ * The layer for the middleware code.
698
+ */
699
+ middleware: "middleware",
700
+ /**
701
+ * The layer for the instrumentation hooks.
702
+ */
703
+ instrument: "instrument",
704
+ /**
705
+ * The layer for assets on the edge.
706
+ */
707
+ edgeAsset: "edge-asset",
708
+ /**
709
+ * The browser client bundle layer for App directory.
710
+ */
711
+ appPagesBrowser: "app-pages-browser",
712
+ /**
713
+ * The server bundle layer for metadata routes.
714
+ */
715
+ appMetadataRoute: "app-metadata-route",
716
+ /**
717
+ * The layer for the server bundle for App Route handlers.
718
+ */
719
+ appRouteHandler: "app-route-handler"
720
+ }, pe = {
721
+ ...L,
722
+ GROUP: {
723
+ serverOnly: [
724
+ L.reactServerComponents,
725
+ L.actionBrowser,
726
+ L.appMetadataRoute,
727
+ L.appRouteHandler,
728
+ L.instrument
729
+ ],
730
+ clientOnly: [
731
+ L.serverSideRendering,
732
+ L.appPagesBrowser
733
+ ],
734
+ nonClientServerTarget: [
735
+ // middleware and pages api
736
+ L.middleware,
737
+ L.api
738
+ ],
739
+ app: [
740
+ L.reactServerComponents,
741
+ L.actionBrowser,
742
+ L.appMetadataRoute,
743
+ L.appRouteHandler,
744
+ L.serverSideRendering,
745
+ L.appPagesBrowser,
746
+ L.shared,
747
+ L.instrument
748
+ ]
749
+ }
750
+ }, me = {
751
+ edgeSSREntry: "__next_edge_ssr_entry__",
752
+ metadata: "__next_metadata__",
753
+ metadataRoute: "__next_metadata_route__",
754
+ metadataImageMeta: "__next_metadata_image_meta__"
755
+ };
756
+ })(qe)), qe;
757
+ }
758
+ var Rt;
759
+ function qt() {
760
+ return Rt || (Rt = 1, (function(i) {
761
+ Object.defineProperty(i, "__esModule", {
762
+ value: !0
763
+ });
764
+ function e(d, g) {
765
+ for (var u in g) Object.defineProperty(d, u, {
766
+ enumerable: !0,
767
+ get: g[u]
768
+ });
769
+ }
770
+ e(i, {
771
+ fromNodeOutgoingHttpHeaders: function() {
772
+ return o;
773
+ },
774
+ normalizeNextQueryParam: function() {
775
+ return r;
776
+ },
777
+ splitCookiesString: function() {
778
+ return n;
779
+ },
780
+ toNodeOutgoingHttpHeaders: function() {
781
+ return a;
782
+ },
783
+ validateURL: function() {
784
+ return c;
785
+ }
786
+ });
787
+ const t = or();
788
+ function o(d) {
789
+ const g = new Headers();
790
+ for (let [u, _] of Object.entries(d)) {
791
+ const p = Array.isArray(_) ? _ : [
792
+ _
793
+ ];
794
+ for (let R of p)
795
+ typeof R > "u" || (typeof R == "number" && (R = R.toString()), g.append(u, R));
796
+ }
797
+ return g;
798
+ }
799
+ function n(d) {
800
+ var g = [], u = 0, _, p, R, S, x;
801
+ function l() {
802
+ for (; u < d.length && /\s/.test(d.charAt(u)); )
803
+ u += 1;
804
+ return u < d.length;
805
+ }
806
+ function b() {
807
+ return p = d.charAt(u), p !== "=" && p !== ";" && p !== ",";
808
+ }
809
+ for (; u < d.length; ) {
810
+ for (_ = u, x = !1; l(); )
811
+ if (p = d.charAt(u), p === ",") {
812
+ for (R = u, u += 1, l(), S = u; u < d.length && b(); )
813
+ u += 1;
814
+ u < d.length && d.charAt(u) === "=" ? (x = !0, u = S, g.push(d.substring(_, R)), _ = u) : u = R + 1;
815
+ } else
816
+ u += 1;
817
+ (!x || u >= d.length) && g.push(d.substring(_, d.length));
818
+ }
819
+ return g;
820
+ }
821
+ function a(d) {
822
+ const g = {}, u = [];
823
+ if (d)
824
+ for (const [_, p] of d.entries())
825
+ _.toLowerCase() === "set-cookie" ? (u.push(...n(p)), g[_] = u.length === 1 ? u[0] : u) : g[_] = p;
826
+ return g;
827
+ }
828
+ function c(d) {
829
+ try {
830
+ return String(new URL(String(d)));
831
+ } catch (g) {
832
+ throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
833
+ cause: g
834
+ });
835
+ }
836
+ }
837
+ function r(d, g) {
838
+ const u = [
839
+ t.NEXT_QUERY_PARAM_PREFIX,
840
+ t.NEXT_INTERCEPTION_MARKER_PREFIX
841
+ ];
842
+ for (const _ of u)
843
+ if (d !== _ && d.startsWith(_)) {
844
+ const p = d.substring(_.length);
845
+ g(p);
846
+ }
847
+ }
848
+ })(je)), je;
849
+ }
850
+ var He = {}, Pt;
851
+ function sr() {
852
+ return Pt || (Pt = 1, (function(i) {
853
+ Object.defineProperty(i, "__esModule", {
854
+ value: !0
855
+ });
856
+ function e(a, c) {
857
+ for (var r in c) Object.defineProperty(a, r, {
858
+ enumerable: !0,
859
+ get: c[r]
860
+ });
861
+ }
862
+ e(i, {
863
+ PageSignatureError: function() {
864
+ return t;
865
+ },
866
+ RemovedPageError: function() {
867
+ return o;
868
+ },
869
+ RemovedUAError: function() {
870
+ return n;
871
+ }
872
+ });
873
+ class t extends Error {
874
+ constructor({ page: c }) {
875
+ super(`The middleware "${c}" accepts an async API directly with the form:
876
+
877
+ export function middleware(request, event) {
878
+ return NextResponse.redirect('/new-location')
879
+ }
880
+
881
+ Read more: https://nextjs.org/docs/messages/middleware-new-signature
882
+ `);
883
+ }
884
+ }
885
+ class o extends Error {
886
+ constructor() {
887
+ super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ");
888
+ }
889
+ }
890
+ class n extends Error {
891
+ constructor() {
892
+ super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ");
893
+ }
894
+ }
895
+ })(He)), He;
896
+ }
897
+ var Fe = {}, Ge, yt;
898
+ function ar() {
899
+ if (yt) return Ge;
900
+ yt = 1;
901
+ var i = Object.defineProperty, e = Object.getOwnPropertyDescriptor, t = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, n = (s, v) => {
902
+ for (var f in v)
903
+ i(s, f, { get: v[f], enumerable: !0 });
904
+ }, a = (s, v, f, w) => {
905
+ if (v && typeof v == "object" || typeof v == "function")
906
+ for (let P of t(v))
907
+ !o.call(s, P) && P !== f && i(s, P, { get: () => v[P], enumerable: !(w = e(v, P)) || w.enumerable });
908
+ return s;
909
+ }, c = (s) => a(i({}, "__esModule", { value: !0 }), s), r = {};
910
+ n(r, {
911
+ RequestCookies: () => b,
912
+ ResponseCookies: () => h,
913
+ parseCookie: () => g,
914
+ parseSetCookie: () => u,
915
+ stringifyCookie: () => d
916
+ }), Ge = c(r);
917
+ function d(s) {
918
+ var v;
919
+ const f = [
920
+ "path" in s && s.path && `Path=${s.path}`,
921
+ "expires" in s && (s.expires || s.expires === 0) && `Expires=${(typeof s.expires == "number" ? new Date(s.expires) : s.expires).toUTCString()}`,
922
+ "maxAge" in s && typeof s.maxAge == "number" && `Max-Age=${s.maxAge}`,
923
+ "domain" in s && s.domain && `Domain=${s.domain}`,
924
+ "secure" in s && s.secure && "Secure",
925
+ "httpOnly" in s && s.httpOnly && "HttpOnly",
926
+ "sameSite" in s && s.sameSite && `SameSite=${s.sameSite}`,
927
+ "partitioned" in s && s.partitioned && "Partitioned",
928
+ "priority" in s && s.priority && `Priority=${s.priority}`
929
+ ].filter(Boolean), w = `${s.name}=${encodeURIComponent((v = s.value) != null ? v : "")}`;
930
+ return f.length === 0 ? w : `${w}; ${f.join("; ")}`;
931
+ }
932
+ function g(s) {
933
+ const v = /* @__PURE__ */ new Map();
934
+ for (const f of s.split(/; */)) {
935
+ if (!f)
936
+ continue;
937
+ const w = f.indexOf("=");
938
+ if (w === -1) {
939
+ v.set(f, "true");
940
+ continue;
941
+ }
942
+ const [P, N] = [f.slice(0, w), f.slice(w + 1)];
943
+ try {
944
+ v.set(P, decodeURIComponent(N ?? "true"));
945
+ } catch {
946
+ }
947
+ }
948
+ return v;
949
+ }
950
+ function u(s) {
951
+ if (!s)
952
+ return;
953
+ const [[v, f], ...w] = g(s), {
954
+ domain: P,
955
+ expires: N,
956
+ httponly: M,
957
+ maxage: D,
958
+ path: H,
959
+ samesite: j,
960
+ secure: J,
961
+ partitioned: Q,
962
+ priority: F
963
+ } = Object.fromEntries(
964
+ w.map(([ie, z]) => [ie.toLowerCase(), z])
965
+ ), W = {
966
+ name: v,
967
+ value: decodeURIComponent(f),
968
+ domain: P,
969
+ ...N && { expires: new Date(N) },
970
+ ...M && { httpOnly: !0 },
971
+ ...typeof D == "string" && { maxAge: Number(D) },
972
+ path: H,
973
+ ...j && { sameSite: R(j) },
974
+ ...J && { secure: !0 },
975
+ ...F && { priority: x(F) },
976
+ ...Q && { partitioned: !0 }
977
+ };
978
+ return _(W);
979
+ }
980
+ function _(s) {
981
+ const v = {};
982
+ for (const f in s)
983
+ s[f] && (v[f] = s[f]);
984
+ return v;
985
+ }
986
+ var p = ["strict", "lax", "none"];
987
+ function R(s) {
988
+ return s = s.toLowerCase(), p.includes(s) ? s : void 0;
989
+ }
990
+ var S = ["low", "medium", "high"];
991
+ function x(s) {
992
+ return s = s.toLowerCase(), S.includes(s) ? s : void 0;
993
+ }
994
+ function l(s) {
995
+ if (!s)
996
+ return [];
997
+ var v = [], f = 0, w, P, N, M, D;
998
+ function H() {
999
+ for (; f < s.length && /\s/.test(s.charAt(f)); )
1000
+ f += 1;
1001
+ return f < s.length;
1002
+ }
1003
+ function j() {
1004
+ return P = s.charAt(f), P !== "=" && P !== ";" && P !== ",";
1005
+ }
1006
+ for (; f < s.length; ) {
1007
+ for (w = f, D = !1; H(); )
1008
+ if (P = s.charAt(f), P === ",") {
1009
+ for (N = f, f += 1, H(), M = f; f < s.length && j(); )
1010
+ f += 1;
1011
+ f < s.length && s.charAt(f) === "=" ? (D = !0, f = M, v.push(s.substring(w, N)), w = f) : f = N + 1;
1012
+ } else
1013
+ f += 1;
1014
+ (!D || f >= s.length) && v.push(s.substring(w, s.length));
1015
+ }
1016
+ return v;
1017
+ }
1018
+ var b = class {
1019
+ constructor(s) {
1020
+ this._parsed = /* @__PURE__ */ new Map(), this._headers = s;
1021
+ const v = s.get("cookie");
1022
+ if (v) {
1023
+ const f = g(v);
1024
+ for (const [w, P] of f)
1025
+ this._parsed.set(w, { name: w, value: P });
1026
+ }
1027
+ }
1028
+ [Symbol.iterator]() {
1029
+ return this._parsed[Symbol.iterator]();
1030
+ }
1031
+ /**
1032
+ * The amount of cookies received from the client
1033
+ */
1034
+ get size() {
1035
+ return this._parsed.size;
1036
+ }
1037
+ get(...s) {
1038
+ const v = typeof s[0] == "string" ? s[0] : s[0].name;
1039
+ return this._parsed.get(v);
1040
+ }
1041
+ getAll(...s) {
1042
+ var v;
1043
+ const f = Array.from(this._parsed);
1044
+ if (!s.length)
1045
+ return f.map(([P, N]) => N);
1046
+ const w = typeof s[0] == "string" ? s[0] : (v = s[0]) == null ? void 0 : v.name;
1047
+ return f.filter(([P]) => P === w).map(([P, N]) => N);
1048
+ }
1049
+ has(s) {
1050
+ return this._parsed.has(s);
1051
+ }
1052
+ set(...s) {
1053
+ const [v, f] = s.length === 1 ? [s[0].name, s[0].value] : s, w = this._parsed;
1054
+ return w.set(v, { name: v, value: f }), this._headers.set(
1055
+ "cookie",
1056
+ Array.from(w).map(([P, N]) => d(N)).join("; ")
1057
+ ), this;
1058
+ }
1059
+ /**
1060
+ * Delete the cookies matching the passed name or names in the request.
1061
+ */
1062
+ delete(s) {
1063
+ const v = this._parsed, f = Array.isArray(s) ? s.map((w) => v.delete(w)) : v.delete(s);
1064
+ return this._headers.set(
1065
+ "cookie",
1066
+ Array.from(v).map(([w, P]) => d(P)).join("; ")
1067
+ ), f;
1068
+ }
1069
+ /**
1070
+ * Delete all the cookies in the cookies in the request.
1071
+ */
1072
+ clear() {
1073
+ return this.delete(Array.from(this._parsed.keys())), this;
1074
+ }
1075
+ /**
1076
+ * Format the cookies in the request as a string for logging
1077
+ */
1078
+ [/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
1079
+ return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
1080
+ }
1081
+ toString() {
1082
+ return [...this._parsed.values()].map((s) => `${s.name}=${encodeURIComponent(s.value)}`).join("; ");
1083
+ }
1084
+ }, h = class {
1085
+ constructor(s) {
1086
+ this._parsed = /* @__PURE__ */ new Map();
1087
+ var v, f, w;
1088
+ this._headers = s;
1089
+ const P = (w = (f = (v = s.getSetCookie) == null ? void 0 : v.call(s)) != null ? f : s.get("set-cookie")) != null ? w : [], N = Array.isArray(P) ? P : l(P);
1090
+ for (const M of N) {
1091
+ const D = u(M);
1092
+ D && this._parsed.set(D.name, D);
1093
+ }
1094
+ }
1095
+ /**
1096
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
1097
+ */
1098
+ get(...s) {
1099
+ const v = typeof s[0] == "string" ? s[0] : s[0].name;
1100
+ return this._parsed.get(v);
1101
+ }
1102
+ /**
1103
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
1104
+ */
1105
+ getAll(...s) {
1106
+ var v;
1107
+ const f = Array.from(this._parsed.values());
1108
+ if (!s.length)
1109
+ return f;
1110
+ const w = typeof s[0] == "string" ? s[0] : (v = s[0]) == null ? void 0 : v.name;
1111
+ return f.filter((P) => P.name === w);
1112
+ }
1113
+ has(s) {
1114
+ return this._parsed.has(s);
1115
+ }
1116
+ /**
1117
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
1118
+ */
1119
+ set(...s) {
1120
+ const [v, f, w] = s.length === 1 ? [s[0].name, s[0].value, s[0]] : s, P = this._parsed;
1121
+ return P.set(v, E({ name: v, value: f, ...w })), m(P, this._headers), this;
1122
+ }
1123
+ /**
1124
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
1125
+ */
1126
+ delete(...s) {
1127
+ const [v, f, w] = typeof s[0] == "string" ? [s[0]] : [s[0].name, s[0].path, s[0].domain];
1128
+ return this.set({ name: v, path: f, domain: w, value: "", expires: /* @__PURE__ */ new Date(0) });
1129
+ }
1130
+ [/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
1131
+ return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
1132
+ }
1133
+ toString() {
1134
+ return [...this._parsed.values()].map(d).join("; ");
1135
+ }
1136
+ };
1137
+ function m(s, v) {
1138
+ v.delete("set-cookie");
1139
+ for (const [, f] of s) {
1140
+ const w = d(f);
1141
+ v.append("set-cookie", w);
1142
+ }
1143
+ }
1144
+ function E(s = { name: "", value: "" }) {
1145
+ return typeof s.expires == "number" && (s.expires = new Date(s.expires)), s.maxAge && (s.expires = new Date(Date.now() + s.maxAge * 1e3)), (s.path === null || s.path === void 0) && (s.path = "/"), s;
1146
+ }
1147
+ return Ge;
1148
+ }
1149
+ var St;
1150
+ function $e() {
1151
+ return St || (St = 1, (function(i) {
1152
+ Object.defineProperty(i, "__esModule", {
1153
+ value: !0
1154
+ });
1155
+ function e(o, n) {
1156
+ for (var a in n) Object.defineProperty(o, a, {
1157
+ enumerable: !0,
1158
+ get: n[a]
1159
+ });
1160
+ }
1161
+ e(i, {
1162
+ RequestCookies: function() {
1163
+ return t.RequestCookies;
1164
+ },
1165
+ ResponseCookies: function() {
1166
+ return t.ResponseCookies;
1167
+ },
1168
+ stringifyCookie: function() {
1169
+ return t.stringifyCookie;
1170
+ }
1171
+ });
1172
+ const t = ar();
1173
+ })(Fe)), Fe;
1174
+ }
1175
+ var At;
1176
+ function ur() {
1177
+ return At || (At = 1, (function(i) {
1178
+ Object.defineProperty(i, "__esModule", {
1179
+ value: !0
1180
+ });
1181
+ function e(d, g) {
1182
+ for (var u in g) Object.defineProperty(d, u, {
1183
+ enumerable: !0,
1184
+ get: g[u]
1185
+ });
1186
+ }
1187
+ e(i, {
1188
+ INTERNALS: function() {
1189
+ return c;
1190
+ },
1191
+ NextRequest: function() {
1192
+ return r;
1193
+ }
1194
+ });
1195
+ const t = jt(), o = qt(), n = sr(), a = $e(), c = /* @__PURE__ */ Symbol("internal request");
1196
+ class r extends Request {
1197
+ constructor(g, u = {}) {
1198
+ const _ = typeof g != "string" && "url" in g ? g.url : String(g);
1199
+ (0, o.validateURL)(_), g instanceof Request ? super(g, u) : super(_, u);
1200
+ const p = new t.NextURL(_, {
1201
+ headers: (0, o.toNodeOutgoingHttpHeaders)(this.headers),
1202
+ nextConfig: u.nextConfig
1203
+ });
1204
+ this[c] = {
1205
+ cookies: new a.RequestCookies(this.headers),
1206
+ geo: u.geo || {},
1207
+ ip: u.ip,
1208
+ nextUrl: p,
1209
+ url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? _ : p.toString()
1210
+ };
1211
+ }
1212
+ [/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
1213
+ return {
1214
+ cookies: this.cookies,
1215
+ geo: this.geo,
1216
+ ip: this.ip,
1217
+ nextUrl: this.nextUrl,
1218
+ url: this.url,
1219
+ // rest of props come from Request
1220
+ bodyUsed: this.bodyUsed,
1221
+ cache: this.cache,
1222
+ credentials: this.credentials,
1223
+ destination: this.destination,
1224
+ headers: Object.fromEntries(this.headers),
1225
+ integrity: this.integrity,
1226
+ keepalive: this.keepalive,
1227
+ method: this.method,
1228
+ mode: this.mode,
1229
+ redirect: this.redirect,
1230
+ referrer: this.referrer,
1231
+ referrerPolicy: this.referrerPolicy,
1232
+ signal: this.signal
1233
+ };
1234
+ }
1235
+ get cookies() {
1236
+ return this[c].cookies;
1237
+ }
1238
+ get geo() {
1239
+ return this[c].geo;
1240
+ }
1241
+ get ip() {
1242
+ return this[c].ip;
1243
+ }
1244
+ get nextUrl() {
1245
+ return this[c].nextUrl;
1246
+ }
1247
+ /**
1248
+ * @deprecated
1249
+ * `page` has been deprecated in favour of `URLPattern`.
1250
+ * Read more: https://nextjs.org/docs/messages/middleware-request-page
1251
+ */
1252
+ get page() {
1253
+ throw new n.RemovedPageError();
1254
+ }
1255
+ /**
1256
+ * @deprecated
1257
+ * `ua` has been removed in favour of \`userAgent\` function.
1258
+ * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
1259
+ */
1260
+ get ua() {
1261
+ throw new n.RemovedUAError();
1262
+ }
1263
+ get url() {
1264
+ return this[c].url;
1265
+ }
1266
+ }
1267
+ })(ye)), ye;
1268
+ }
1269
+ var Be = {}, Xe = {}, Tt;
1270
+ function cr() {
1271
+ return Tt || (Tt = 1, (function(i) {
1272
+ Object.defineProperty(i, "__esModule", {
1273
+ value: !0
1274
+ }), Object.defineProperty(i, "ReflectAdapter", {
1275
+ enumerable: !0,
1276
+ get: function() {
1277
+ return e;
1278
+ }
1279
+ });
1280
+ class e {
1281
+ static get(o, n, a) {
1282
+ const c = Reflect.get(o, n, a);
1283
+ return typeof c == "function" ? c.bind(o) : c;
1284
+ }
1285
+ static set(o, n, a, c) {
1286
+ return Reflect.set(o, n, a, c);
1287
+ }
1288
+ static has(o, n) {
1289
+ return Reflect.has(o, n);
1290
+ }
1291
+ static deleteProperty(o, n) {
1292
+ return Reflect.deleteProperty(o, n);
1293
+ }
1294
+ }
1295
+ })(Xe)), Xe;
1296
+ }
1297
+ var It;
1298
+ function lr() {
1299
+ return It || (It = 1, (function(i) {
1300
+ Object.defineProperty(i, "__esModule", {
1301
+ value: !0
1302
+ }), Object.defineProperty(i, "NextResponse", {
1303
+ enumerable: !0,
1304
+ get: function() {
1305
+ return g;
1306
+ }
1307
+ });
1308
+ const e = $e(), t = jt(), o = qt(), n = cr(), a = $e(), c = /* @__PURE__ */ Symbol("internal response"), r = /* @__PURE__ */ new Set([
1309
+ 301,
1310
+ 302,
1311
+ 303,
1312
+ 307,
1313
+ 308
1314
+ ]);
1315
+ function d(u, _) {
1316
+ var p;
1317
+ if (!(u == null || (p = u.request) == null) && p.headers) {
1318
+ if (!(u.request.headers instanceof Headers))
1319
+ throw new Error("request.headers must be an instance of Headers");
1320
+ const R = [];
1321
+ for (const [S, x] of u.request.headers)
1322
+ _.set("x-middleware-request-" + S, x), R.push(S);
1323
+ _.set("x-middleware-override-headers", R.join(","));
1324
+ }
1325
+ }
1326
+ class g extends Response {
1327
+ constructor(_, p = {}) {
1328
+ super(_, p);
1329
+ const R = this.headers, S = new a.ResponseCookies(R), x = new Proxy(S, {
1330
+ get(l, b, h) {
1331
+ switch (b) {
1332
+ case "delete":
1333
+ case "set":
1334
+ return (...m) => {
1335
+ const E = Reflect.apply(l[b], l, m), s = new Headers(R);
1336
+ return E instanceof a.ResponseCookies && R.set("x-middleware-set-cookie", E.getAll().map((v) => (0, e.stringifyCookie)(v)).join(",")), d(p, s), E;
1337
+ };
1338
+ default:
1339
+ return n.ReflectAdapter.get(l, b, h);
1340
+ }
1341
+ }
1342
+ });
1343
+ this[c] = {
1344
+ cookies: x,
1345
+ url: p.url ? new t.NextURL(p.url, {
1346
+ headers: (0, o.toNodeOutgoingHttpHeaders)(R),
1347
+ nextConfig: p.nextConfig
1348
+ }) : void 0
1349
+ };
1350
+ }
1351
+ [/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
1352
+ return {
1353
+ cookies: this.cookies,
1354
+ url: this.url,
1355
+ // rest of props come from Response
1356
+ body: this.body,
1357
+ bodyUsed: this.bodyUsed,
1358
+ headers: Object.fromEntries(this.headers),
1359
+ ok: this.ok,
1360
+ redirected: this.redirected,
1361
+ status: this.status,
1362
+ statusText: this.statusText,
1363
+ type: this.type
1364
+ };
1365
+ }
1366
+ get cookies() {
1367
+ return this[c].cookies;
1368
+ }
1369
+ static json(_, p) {
1370
+ const R = Response.json(_, p);
1371
+ return new g(R.body, R);
1372
+ }
1373
+ static redirect(_, p) {
1374
+ const R = typeof p == "number" ? p : p?.status ?? 307;
1375
+ if (!r.has(R))
1376
+ throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
1377
+ const S = typeof p == "object" ? p : {}, x = new Headers(S?.headers);
1378
+ return x.set("Location", (0, o.validateURL)(_)), new g(null, {
1379
+ ...S,
1380
+ headers: x,
1381
+ status: R
1382
+ });
1383
+ }
1384
+ static rewrite(_, p) {
1385
+ const R = new Headers(p?.headers);
1386
+ return R.set("x-middleware-rewrite", (0, o.validateURL)(_)), d(p, R), new g(null, {
1387
+ ...p,
1388
+ headers: R
1389
+ });
1390
+ }
1391
+ static next(_) {
1392
+ const p = new Headers(_?.headers);
1393
+ return p.set("x-middleware-next", "1"), d(_, p), new g(null, {
1394
+ ..._,
1395
+ headers: p
1396
+ });
1397
+ }
1398
+ }
1399
+ })(Be)), Be;
1400
+ }
1401
+ var We = {}, Ot;
1402
+ function dr() {
1403
+ return Ot || (Ot = 1, (function(i) {
1404
+ Object.defineProperty(i, "__esModule", {
1405
+ value: !0
1406
+ }), Object.defineProperty(i, "ImageResponse", {
1407
+ enumerable: !0,
1408
+ get: function() {
1409
+ return e;
1410
+ }
1411
+ });
1412
+ function e() {
1413
+ throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead');
1414
+ }
1415
+ })(We)), We;
1416
+ }
1417
+ var ze = {}, Ve = { exports: {} }, xt;
1418
+ function hr() {
1419
+ return xt || (xt = 1, (() => {
1420
+ var i = { 226: function(n, a) {
1421
+ (function(c, r) {
1422
+ var d = "1.0.35", g = "", u = "?", _ = "function", p = "undefined", R = "object", S = "string", x = "major", l = "model", b = "name", h = "type", m = "vendor", E = "version", s = "architecture", v = "console", f = "mobile", w = "tablet", P = "smarttv", N = "wearable", M = "embedded", D = 350, H = "Amazon", j = "Apple", J = "ASUS", Q = "BlackBerry", F = "Browser", W = "Chrome", ie = "Edge", z = "Firefox", Z = "Google", de = "Huawei", oe = "LG", se = "Microsoft", he = "Motorola", ee = "Opera", ae = "Samsung", fe = "Sharp", te = "Sony", ue = "Xiaomi", L = "Zebra", pe = "Facebook", me = "Chromium OS", _e = "Mac OS", ge = function(T, O) {
1423
+ var A = {};
1424
+ for (var C in T)
1425
+ O[C] && O[C].length % 2 === 0 ? A[C] = O[C].concat(T[C]) : A[C] = T[C];
1426
+ return A;
1427
+ }, $ = function(T) {
1428
+ for (var O = {}, A = 0; A < T.length; A++)
1429
+ O[T[A].toUpperCase()] = T[A];
1430
+ return O;
1431
+ }, rt = function(T, O) {
1432
+ return typeof T === S ? ce(O).indexOf(ce(T)) !== -1 : !1;
1433
+ }, ce = function(T) {
1434
+ return T.toLowerCase();
1435
+ }, Xt = function(T) {
1436
+ return typeof T === S ? T.replace(/[^\d\.]/g, g).split(".")[0] : r;
1437
+ }, ve = function(T, O) {
1438
+ if (typeof T === S)
1439
+ return T = T.replace(/^\s\s*/, g), typeof O === p ? T : T.substring(0, D);
1440
+ }, le = function(T, O) {
1441
+ for (var A = 0, C, V, G, I, y, B; A < O.length && !y; ) {
1442
+ var Pe = O[A], ot = O[A + 1];
1443
+ for (C = V = 0; C < Pe.length && !y && Pe[C]; )
1444
+ if (y = Pe[C++].exec(T), y)
1445
+ for (G = 0; G < ot.length; G++)
1446
+ B = y[++V], I = ot[G], typeof I === R && I.length > 0 ? I.length === 2 ? typeof I[1] == _ ? this[I[0]] = I[1].call(this, B) : this[I[0]] = I[1] : I.length === 3 ? typeof I[1] === _ && !(I[1].exec && I[1].test) ? this[I[0]] = B ? I[1].call(this, B, I[2]) : r : this[I[0]] = B ? B.replace(I[1], I[2]) : r : I.length === 4 && (this[I[0]] = B ? I[3].call(this, B.replace(I[1], I[2])) : r) : this[I] = B || r;
1447
+ A += 2;
1448
+ }
1449
+ }, Re = function(T, O) {
1450
+ for (var A in O)
1451
+ if (typeof O[A] === R && O[A].length > 0) {
1452
+ for (var C = 0; C < O[A].length; C++)
1453
+ if (rt(O[A][C], T))
1454
+ return A === u ? r : A;
1455
+ } else if (rt(O[A], T))
1456
+ return A === u ? r : A;
1457
+ return T;
1458
+ }, Wt = { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" }, nt = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }, it = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [E, [b, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [E, [b, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [b, E], [/opios[\/ ]+([\w\.]+)/i], [E, [b, ee + " Mini"]], [/\bopr\/([\w\.]+)/i], [E, [b, ee]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i], [b, E], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [E, [b, "UC" + F]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i], [E, [b, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [E, [b, "WeChat"]], [/konqueror\/([\w\.]+)/i], [E, [b, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [E, [b, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [E, [b, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[b, /(.+)/, "$1 Secure " + F], E], [/\bfocus\/([\w\.]+)/i], [E, [b, z + " Focus"]], [/\bopt\/([\w\.]+)/i], [E, [b, ee + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [E, [b, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [E, [b, "Dolphin"]], [/coast\/([\w\.]+)/i], [E, [b, ee + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [E, [b, "MIUI " + F]], [/fxios\/([-\w\.]+)/i], [E, [b, z]], [/\bqihu|(qi?ho?o?|360)browser/i], [[b, "360 " + F]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[b, /(.+)/, "$1 " + F], E], [/(comodo_dragon)\/([\w\.]+)/i], [[b, /_/g, " "], E], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i], [b, E], [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i], [b], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[b, pe], E], [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i], [b, E], [/\bgsa\/([\w\.]+) .*safari\//i], [E, [b, "GSA"]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [E, [b, "TikTok"]], [/headlesschrome(?:\/([\w\.]+)| )/i], [E, [b, W + " Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[b, W + " WebView"], E], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [E, [b, "Android " + F]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [b, E], [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i], [E, [b, "Mobile Safari"]], [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i], [E, b], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [b, [E, Re, Wt]], [/(webkit|khtml)\/([\w\.]+)/i], [b, E], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[b, "Netscape"], E], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [E, [b, z + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i], [b, E], [/(cobalt)\/([\w\.]+)/i], [b, [E, /master.|lts./, ""]]], cpu: [[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, ce]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i], [[s, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[s, "armhf"]], [/windows (ce|mobile); ppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i], [[s, /ower/, g, ce]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[s, ce]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [l, [m, ae], [h, w]], [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i], [l, [m, ae], [h, f]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [l, [m, j], [h, f]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [l, [m, j], [h, w]], [/(macintosh);/i], [l, [m, j]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [l, [m, fe], [h, f]], [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [l, [m, de], [h, w]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [l, [m, de], [h, f]], [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i], [[l, /_/g, " "], [m, ue], [h, f]], [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i], [[l, /_/g, " "], [m, ue], [h, w]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [l, [m, "OPPO"], [h, f]], [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [l, [m, "Vivo"], [h, f]], [/\b(rmx[12]\d{3})(?: bui|;|\))/i], [l, [m, "Realme"], [h, f]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [l, [m, he], [h, f]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [l, [m, he], [h, w]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [l, [m, oe], [h, w]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [l, [m, oe], [h, f]], [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [l, [m, "Lenovo"], [h, w]], [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[l, /_/g, " "], [m, "Nokia"], [h, f]], [/(pixel c)\b/i], [l, [m, Z], [h, w]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [l, [m, Z], [h, f]], [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [l, [m, te], [h, f]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[l, "Xperia Tablet"], [m, te], [h, w]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [l, [m, "OnePlus"], [h, f]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [l, [m, H], [h, w]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[l, /(.+)/g, "Fire Phone $1"], [m, H], [h, f]], [/(playbook);[-\w\),; ]+(rim)/i], [l, m, [h, w]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [l, [m, Q], [h, f]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [l, [m, J], [h, w]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [l, [m, J], [h, f]], [/(nexus 9)/i], [l, [m, "HTC"], [h, w]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [m, [l, /_/g, " "], [h, f]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [l, [m, "Acer"], [h, w]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [l, [m, "Meizu"], [h, f]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i], [m, l, [h, f]], [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i], [m, l, [h, w]], [/(surface duo)/i], [l, [m, se], [h, w]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [l, [m, "Fairphone"], [h, f]], [/(u304aa)/i], [l, [m, "AT&T"], [h, f]], [/\bsie-(\w*)/i], [l, [m, "Siemens"], [h, f]], [/\b(rct\w+) b/i], [l, [m, "RCA"], [h, w]], [/\b(venue[\d ]{2,7}) b/i], [l, [m, "Dell"], [h, w]], [/\b(q(?:mv|ta)\w+) b/i], [l, [m, "Verizon"], [h, w]], [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i], [l, [m, "Barnes & Noble"], [h, w]], [/\b(tm\d{3}\w+) b/i], [l, [m, "NuVision"], [h, w]], [/\b(k88) b/i], [l, [m, "ZTE"], [h, w]], [/\b(nx\d{3}j) b/i], [l, [m, "ZTE"], [h, f]], [/\b(gen\d{3}) b.+49h/i], [l, [m, "Swiss"], [h, f]], [/\b(zur\d{3}) b/i], [l, [m, "Swiss"], [h, w]], [/\b((zeki)?tb.*\b) b/i], [l, [m, "Zeki"], [h, w]], [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i], [[m, "Dragon Touch"], l, [h, w]], [/\b(ns-?\w{0,9}) b/i], [l, [m, "Insignia"], [h, w]], [/\b((nxa|next)-?\w{0,9}) b/i], [l, [m, "NextBook"], [h, w]], [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i], [[m, "Voice"], l, [h, f]], [/\b(lvtel\-)?(v1[12]) b/i], [[m, "LvTel"], l, [h, f]], [/\b(ph-1) /i], [l, [m, "Essential"], [h, f]], [/\b(v(100md|700na|7011|917g).*\b) b/i], [l, [m, "Envizen"], [h, w]], [/\b(trio[-\w\. ]+) b/i], [l, [m, "MachSpeed"], [h, w]], [/\btu_(1491) b/i], [l, [m, "Rotor"], [h, w]], [/(shield[\w ]+) b/i], [l, [m, "Nvidia"], [h, w]], [/(sprint) (\w+)/i], [m, l, [h, f]], [/(kin\.[onetw]{3})/i], [[l, /\./g, " "], [m, se], [h, f]], [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [l, [m, L], [h, w]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [l, [m, L], [h, f]], [/smart-tv.+(samsung)/i], [m, [h, P]], [/hbbtv.+maple;(\d+)/i], [[l, /^/, "SmartTV"], [m, ae], [h, P]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[m, oe], [h, P]], [/(apple) ?tv/i], [m, [l, j + " TV"], [h, P]], [/crkey/i], [[l, W + "cast"], [m, Z], [h, P]], [/droid.+aft(\w)( bui|\))/i], [l, [m, H], [h, P]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [l, [m, fe], [h, P]], [/(bravia[\w ]+)( bui|\))/i], [l, [m, te], [h, P]], [/(mitv-\w{5}) bui/i], [l, [m, ue], [h, P]], [/Hbbtv.*(technisat) (.*);/i], [m, l, [h, P]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[m, ve], [l, ve], [h, P]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[h, P]], [/(ouya)/i, /(nintendo) ([wids3utch]+)/i], [m, l, [h, v]], [/droid.+; (shield) bui/i], [l, [m, "Nvidia"], [h, v]], [/(playstation [345portablevi]+)/i], [l, [m, te], [h, v]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [l, [m, se], [h, v]], [/((pebble))app/i], [m, l, [h, N]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [l, [m, j], [h, N]], [/droid.+; (glass) \d/i], [l, [m, Z], [h, N]], [/droid.+; (wt63?0{2,3})\)/i], [l, [m, L], [h, N]], [/(quest( 2| pro)?)/i], [l, [m, pe], [h, N]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [m, [h, M]], [/(aeobc)\b/i], [l, [m, H], [h, M]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i], [l, [h, f]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i], [l, [h, w]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[h, w]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[h, f]], [/(android[-\w\. ]{0,9});.+buil/i], [l, [m, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [E, [b, ie + "HTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [E, [b, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [b, E], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [E, b]], os: [[/microsoft (windows) (vista|xp)/i], [b, E], [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i], [b, [E, Re, nt]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[b, "Windows"], [E, Re, nt]], [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[E, /_/g, "."], [b, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[b, _e], [E, /_/g, "."]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [E, b], [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i], [b, E], [/\(bb(10);/i], [E, [b, Q]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i], [E, [b, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [E, [b, z + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [E, [b, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [E, [b, "watchOS"]], [/crkey\/([\d\.]+)/i], [E, [b, W + "cast"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[b, me], E], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [b, E], [/(sunos) ?([\w\.\d]*)/i], [[b, "Solaris"], E], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [b, E]] }, q = function(T, O) {
1459
+ if (typeof T === R && (O = T, T = r), !(this instanceof q))
1460
+ return new q(T, O).getResult();
1461
+ var A = typeof c !== p && c.navigator ? c.navigator : r, C = T || (A && A.userAgent ? A.userAgent : g), V = A && A.userAgentData ? A.userAgentData : r, G = O ? ge(it, O) : it, I = A && A.userAgent == C;
1462
+ return this.getBrowser = function() {
1463
+ var y = {};
1464
+ return y[b] = r, y[E] = r, le.call(y, C, G.browser), y[x] = Xt(y[E]), I && A && A.brave && typeof A.brave.isBrave == _ && (y[b] = "Brave"), y;
1465
+ }, this.getCPU = function() {
1466
+ var y = {};
1467
+ return y[s] = r, le.call(y, C, G.cpu), y;
1468
+ }, this.getDevice = function() {
1469
+ var y = {};
1470
+ return y[m] = r, y[l] = r, y[h] = r, le.call(y, C, G.device), I && !y[h] && V && V.mobile && (y[h] = f), I && y[l] == "Macintosh" && A && typeof A.standalone !== p && A.maxTouchPoints && A.maxTouchPoints > 2 && (y[l] = "iPad", y[h] = w), y;
1471
+ }, this.getEngine = function() {
1472
+ var y = {};
1473
+ return y[b] = r, y[E] = r, le.call(y, C, G.engine), y;
1474
+ }, this.getOS = function() {
1475
+ var y = {};
1476
+ return y[b] = r, y[E] = r, le.call(y, C, G.os), I && !y[b] && V && V.platform != "Unknown" && (y[b] = V.platform.replace(/chrome os/i, me).replace(/macos/i, _e)), y;
1477
+ }, this.getResult = function() {
1478
+ return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
1479
+ }, this.getUA = function() {
1480
+ return C;
1481
+ }, this.setUA = function(y) {
1482
+ return C = typeof y === S && y.length > D ? ve(y, D) : y, this;
1483
+ }, this.setUA(C), this;
1484
+ };
1485
+ q.VERSION = d, q.BROWSER = $([b, E, x]), q.CPU = $([s]), q.DEVICE = $([l, m, h, v, f, P, w, N, M]), q.ENGINE = q.OS = $([b, E]), typeof a !== p ? (n.exports && (a = n.exports = q), a.UAParser = q) : typeof c !== p && (c.UAParser = q);
1486
+ var re = typeof c !== p && (c.jQuery || c.Zepto);
1487
+ if (re && !re.ua) {
1488
+ var be = new q();
1489
+ re.ua = be.getResult(), re.ua.get = function() {
1490
+ return be.getUA();
1491
+ }, re.ua.set = function(T) {
1492
+ be.setUA(T);
1493
+ var O = be.getResult();
1494
+ for (var A in O)
1495
+ re.ua[A] = O[A];
1496
+ };
1497
+ }
1498
+ })(typeof window == "object" ? window : this);
1499
+ } }, e = {};
1500
+ function t(n) {
1501
+ var a = e[n];
1502
+ if (a !== void 0)
1503
+ return a.exports;
1504
+ var c = e[n] = { exports: {} }, r = !0;
1505
+ try {
1506
+ i[n].call(c.exports, c, c.exports, t), r = !1;
1507
+ } finally {
1508
+ r && delete e[n];
1509
+ }
1510
+ return c.exports;
1511
+ }
1512
+ typeof t < "u" && (t.ab = __dirname + "/");
1513
+ var o = t(226);
1514
+ Ve.exports = o;
1515
+ })()), Ve.exports;
1516
+ }
1517
+ var Nt;
1518
+ function Ct() {
1519
+ return Nt || (Nt = 1, (function(i) {
1520
+ Object.defineProperty(i, "__esModule", {
1521
+ value: !0
1522
+ });
1523
+ function e(r, d) {
1524
+ for (var g in d) Object.defineProperty(r, g, {
1525
+ enumerable: !0,
1526
+ get: d[g]
1527
+ });
1528
+ }
1529
+ e(i, {
1530
+ isBot: function() {
1531
+ return n;
1532
+ },
1533
+ userAgent: function() {
1534
+ return c;
1535
+ },
1536
+ userAgentFromString: function() {
1537
+ return a;
1538
+ }
1539
+ });
1540
+ const t = /* @__PURE__ */ o(hr());
1541
+ function o(r) {
1542
+ return r && r.__esModule ? r : {
1543
+ default: r
1544
+ };
1545
+ }
1546
+ function n(r) {
1547
+ return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(r);
1548
+ }
1549
+ function a(r) {
1550
+ return {
1551
+ ...(0, t.default)(r),
1552
+ isBot: r === void 0 ? !1 : n(r)
1553
+ };
1554
+ }
1555
+ function c({ headers: r }) {
1556
+ return a(r.get("user-agent") || void 0);
1557
+ }
1558
+ })(ze)), ze;
1559
+ }
1560
+ var Ke = {}, Lt;
1561
+ function fr() {
1562
+ return Lt || (Lt = 1, (function(i) {
1563
+ Object.defineProperty(i, "__esModule", {
1564
+ value: !0
1565
+ }), Object.defineProperty(i, "URLPattern", {
1566
+ enumerable: !0,
1567
+ get: function() {
1568
+ return e;
1569
+ }
1570
+ });
1571
+ const e = (
1572
+ // @ts-expect-error: URLPattern is not available in Node.js
1573
+ typeof URLPattern > "u" ? void 0 : URLPattern
1574
+ );
1575
+ })(Ke)), Ke;
1576
+ }
1577
+ var kt;
1578
+ function pr() {
1579
+ return kt || (kt = 1, (function(i, e) {
1580
+ const t = {
1581
+ NextRequest: ur().NextRequest,
1582
+ NextResponse: lr().NextResponse,
1583
+ ImageResponse: dr().ImageResponse,
1584
+ userAgentFromString: Ct().userAgentFromString,
1585
+ userAgent: Ct().userAgent,
1586
+ URLPattern: fr().URLPattern
1587
+ };
1588
+ i.exports = t, e.NextRequest = t.NextRequest, e.NextResponse = t.NextResponse, e.ImageResponse = t.ImageResponse, e.userAgentFromString = t.userAgentFromString, e.userAgent = t.userAgent, e.URLPattern = t.URLPattern;
1589
+ })(Ee, Ee.exports)), Ee.exports;
1590
+ }
1591
+ var mr = pr();
1592
+ class Cr {
1593
+ async parseRequest(e) {
1594
+ const t = new URL(e.url);
1595
+ let o, n;
1596
+ if (e.method !== "GET") {
1597
+ const r = e.headers.get(K) || "";
1598
+ if (r.includes(X.applicationJson))
1599
+ try {
1600
+ o = await e.json();
1601
+ } catch {
1602
+ k.warn("request body is null!");
1603
+ }
1604
+ else if (r.includes(X.multipartFormData))
1605
+ n = await e.formData();
1606
+ else if (r.includes(X.applicationXwwwFormUrlencoded)) {
1607
+ const d = await e.text();
1608
+ o = Ze(d);
1609
+ }
1610
+ }
1611
+ const a = e.headers, c = {};
1612
+ return e.cookies.getAll().forEach((r) => {
1613
+ c[r.name] = r.value;
1614
+ }), {
1615
+ url: t,
1616
+ headers: a,
1617
+ body: o,
1618
+ formData: n,
1619
+ cookies: c,
1620
+ raw: e,
1621
+ clone() {
1622
+ return e.clone();
1623
+ }
1624
+ };
1625
+ }
1626
+ createResponse(e) {
1627
+ const t = mr.NextResponse.json(e.body, {
1628
+ status: e.status,
1629
+ headers: e.headers
1630
+ });
1631
+ return Object.entries(e.cookies).forEach(([o, n]) => {
1632
+ typeof n == "object" && n.value ? t.cookies.set(o, n.value, n.options) : typeof n == "string" && t.cookies.set(o, n);
1633
+ }), t;
1634
+ }
1635
+ setCookie(e, t, o, n) {
1636
+ e.cookies[t] = { value: o, options: n };
1637
+ }
1638
+ }
1639
+ var Je = /* @__PURE__ */ ((i) => (i[i.login = 0] = "login", i[i.logout = 1] = "logout", i))(Je || {});
1640
+ const Ye = {
1641
+ login: "login",
1642
+ logout: "logout",
1643
+ unknown: ""
1644
+ }, K = "Content-Type", X = {
1645
+ applicationJson: "application/json",
1646
+ multipartFormData: "multipart/form-data",
1647
+ applicationXwwwFormUrlencoded: "application/x-www-form-urlencoded"
1648
+ };
1649
+ class Lr {
1650
+ config;
1651
+ http;
1652
+ cookies;
1653
+ adapter;
1654
+ constructor({
1655
+ config: e,
1656
+ adapter: t,
1657
+ storage: o,
1658
+ cookies: n
1659
+ }) {
1660
+ this.config = e;
1661
+ const a = wr(o);
1662
+ this.http = new Pr({ ...a, userType: Dt.TYPE_C }), this.cookies = n, this.adapter = t;
1663
+ }
1664
+ async handleRequest(e) {
1665
+ try {
1666
+ const t = await this.adapter.parseRequest(e), o = await this.processRequest(t);
1667
+ return this.adapter.createResponse(o);
1668
+ } catch (t) {
1669
+ console.error("Router error:", t);
1670
+ const o = {};
1671
+ o[K] = X.applicationJson;
1672
+ const n = {
1673
+ status: 500,
1674
+ headers: o,
1675
+ cookies: {},
1676
+ body: {
1677
+ code: 500,
1678
+ success: !1,
1679
+ msg: "Internal server error"
1680
+ }
1681
+ };
1682
+ return this.adapter.createResponse(n);
1683
+ }
1684
+ }
1685
+ async processRequest(e) {
1686
+ const t = e.url.searchParams, o = t.get("m") ?? "unknown", a = { ...Ye, ...this.config.APIMAP }[o];
1687
+ if (!a || a.length === 0)
1688
+ return this.createErrorResponse(404, "API not found");
1689
+ let c;
1690
+ if ((a.startsWith("admin/") || a.startsWith("api/")) && (c = Er(this.cookies), !c || c.username.length === 0 || c.token.length === 0))
1691
+ return this.createErrorResponse(409, "Authentication required");
1692
+ let r;
1693
+ const d = e.clone(), g = d.method, u = e.headers.get(K) || "";
1694
+ try {
1695
+ if (g === "GET") {
1696
+ const p = Ze(t.toString(), ["m"]);
1697
+ r = await this.http.get({
1698
+ url: a,
1699
+ data: p,
1700
+ token: c
1701
+ });
1702
+ } else if (g === "POST") {
1703
+ let p;
1704
+ if (u.includes(X.applicationJson) || u.includes(X.applicationXwwwFormUrlencoded))
1705
+ p = e.body;
1706
+ else if (u.includes(X.multipartFormData)) {
1707
+ const R = u.match(/boundary=([^\s;]+)/);
1708
+ if (!R)
1709
+ return this.createErrorResponse(411, "Missing boundary in form data");
1710
+ const S = await d.arrayBuffer();
1711
+ p = {
1712
+ boundary: R[1],
1713
+ buffer: Buffer.from(S)
1714
+ };
1715
+ const l = e.formData;
1716
+ if (l)
1717
+ for (const [b, h] of Object.entries(l))
1718
+ b !== "file" && (p[b] = h);
1719
+ } else
1720
+ return this.createErrorResponse(410, "Unsupported content type");
1721
+ r = await this.http.post({
1722
+ url: a,
1723
+ data: p,
1724
+ token: c
1725
+ });
1726
+ } else
1727
+ return this.createErrorResponse(405, "Method not allowed, only supported GET or POST");
1728
+ } catch (p) {
1729
+ return k.error({ "error:": p }, "API request error"), this.createErrorResponse(500, "API request failed");
1730
+ }
1731
+ const _ = {
1732
+ status: r.success ? 200 : r.code,
1733
+ headers: { CONTENT_TYPE_KEY: u },
1734
+ cookies: {},
1735
+ body: r
1736
+ };
1737
+ if (r.success)
1738
+ switch (a) {
1739
+ case Ye[Je[
1740
+ 0
1741
+ /* login */
1742
+ ]]:
1743
+ const p = r.data;
1744
+ vr(p, this.cookies);
1745
+ break;
1746
+ case Ye[Je[
1747
+ 1
1748
+ /* logout */
1749
+ ]]:
1750
+ Rr(this.cookies);
1751
+ break;
1752
+ }
1753
+ return _;
1754
+ }
1755
+ createErrorResponse(e, t) {
1756
+ return {
1757
+ status: e,
1758
+ headers: { "content-type": "application/json" },
1759
+ cookies: {},
1760
+ body: {
1761
+ code: e,
1762
+ success: !1,
1763
+ msg: t
1764
+ }
1765
+ };
1766
+ }
1767
+ }
1768
+ const _r = "zh-CN", Ht = "_device_id_key", Ft = "_current_website_key", Ut = "Get request error!", Qe = "Post request error!", U = {
80
1769
  IBOOT_DEVICE_ID: "dvid",
81
1770
  IBOOT_LANG: "lang",
82
1771
  IBOOT_WEBSITE_ID: "wid",
83
1772
  IBOOT_WEBSITE_NO: "wno",
84
1773
  IBOOT_TOKEN: "token",
85
1774
  IBOOT_USER: "user"
86
- }, m = {
1775
+ }, Y = {
87
1776
  DEVICE_ID: "Device-Id",
88
1777
  LANG: "Lang",
89
1778
  WEBSITE_ID: "Website-Id",
90
1779
  WEBSITE_NO: "Website-No"
91
- }, N = (s) => {
92
- if (!s.get)
1780
+ }, Gt = (i) => {
1781
+ if (!i.get)
93
1782
  throw new Error("The get method of IStorage has not been implemented.");
94
- const e = s.get(S) ?? "", t = s.get(P), n = t != null ? JSON.parse(t) : null, r = {};
95
- return e.length > 0 && (r["Device-Id"] = e), n && (r.Lang = n.language, n.websiteId && (r["Website-Id"] = n.websiteId), n.websiteNo && (r["Website-No"] = n.websiteNo)), r;
96
- }, V = ({ deviceId: s, website: e }, t) => {
1783
+ const e = i.get(Ht) ?? "", t = i.get(Ft), o = t != null ? JSON.parse(t) : null, n = {};
1784
+ return e.length > 0 && (n["Device-Id"] = e), o && (n.Lang = o.language, o.websiteId && (n["Website-Id"] = o.websiteId), o.websiteNo && (n["Website-No"] = o.websiteNo)), n;
1785
+ }, kr = ({ deviceId: i, website: e }, t) => {
97
1786
  if (!t.set)
98
1787
  throw new Error("The set method of IStorage has not been implemented.");
99
- t.set(S, s), e && t.set(P, JSON.stringify(e));
100
- }, H = async (s, e) => {
1788
+ t.set(Ht, i), e && t.set(Ft, JSON.stringify(e));
1789
+ }, gr = (i) => `${process.env.BASE_URL || "/api/services"}?m=${i}`, br = async (i, e) => {
1790
+ let t = gr(i);
101
1791
  if (e?.data) {
102
- const i = new URLSearchParams(e.data);
103
- s.indexOf("?") != -1 ? s += `&${i}` : s += `?${i}`;
1792
+ const r = new URLSearchParams(e.data);
1793
+ t += `&${r}`;
104
1794
  }
105
- const t = e && e.storage && e.storage.get ? N(e.storage) : {}, n = e?.headers;
1795
+ const o = e && e.storage && e.storage.get ? Gt(e.storage) : {}, n = e?.headers;
106
1796
  if (n)
107
- for (const i in n) {
108
- const a = n[i];
109
- a && (t[i] = a);
1797
+ for (const r in n) {
1798
+ const d = n[r];
1799
+ d && (o[r] = d);
110
1800
  }
111
- d.info({
112
- url: s,
113
- headers: t
1801
+ k.info({
1802
+ url: t,
1803
+ headers: o
114
1804
  }, "GET");
115
- const r = await fetch(s, {
1805
+ const a = await fetch(t, {
116
1806
  method: "GET",
117
- headers: t,
1807
+ headers: o,
118
1808
  cache: e?.useCache ? "force-cache" : "default"
119
1809
  });
120
- if (r.ok) {
121
- const i = Object.fromEntries(r.headers.entries()), a = { ...await r.json(), headers: i };
122
- return d.debug(a, "GET_RESULT"), a;
1810
+ if (a.ok) {
1811
+ const r = Object.fromEntries(a.headers.entries()), d = { ...await a.json(), headers: r };
1812
+ return k.debug(d, "GET_RESULT"), d;
123
1813
  }
124
- const o = {
125
- code: r.status,
1814
+ const c = {
1815
+ code: a.status,
126
1816
  success: !1,
127
- msg: r.statusText
1817
+ msg: a.statusText
128
1818
  };
129
- return d.error(o), o;
130
- }, v = async (s, e) => {
131
- const t = e?.data ?? {}, n = e?.headers;
132
- let r;
133
- const o = e && e.storage && e.storage.get ? N(e.storage) : {}, i = new Headers(o);
134
- if (t instanceof FormData ? r = t : (r = JSON.stringify(t), i.set("Content-Type", "application/json")), n)
135
- for (let l in n) {
136
- const h = n[l];
137
- h && i.set(l, h);
138
- }
139
- d.info({
140
- url: s,
141
- headers: i
1819
+ return k.error(c), c;
1820
+ }, Bt = async (i, e) => {
1821
+ const t = e?.data ?? {}, o = e?.headers;
1822
+ let n;
1823
+ const a = e && e.storage && e.storage.get ? Gt(e.storage) : {}, c = new Headers(a);
1824
+ if (t instanceof FormData ? n = t : (n = JSON.stringify(t), c.set(K, X.applicationJson)), o)
1825
+ for (let g in o) {
1826
+ const u = o[g];
1827
+ u && c.set(g, u);
1828
+ }
1829
+ k.info({
1830
+ url: i,
1831
+ headers: c
142
1832
  }, "POST");
143
- const a = await fetch(s, {
1833
+ const r = await fetch(i, {
144
1834
  method: "POST",
145
- headers: i,
146
- body: r
1835
+ headers: c,
1836
+ body: n
147
1837
  });
148
- if (a.ok) {
149
- const l = Object.fromEntries(a.headers.entries()), h = { ...await a.json(), headers: l };
150
- return d.debug(h, "POST_RESULT"), h;
1838
+ if (r.ok) {
1839
+ const g = Object.fromEntries(r.headers.entries()), u = { ...await r.json(), headers: g };
1840
+ return k.debug(u, "POST_RESULT"), u;
151
1841
  }
152
- const c = {
153
- code: a.status,
1842
+ const d = {
1843
+ code: r.status,
154
1844
  success: !1,
155
- msg: a.statusText
1845
+ msg: r.statusText
156
1846
  };
157
- return d.error(c), c;
158
- }, Y = async (s, e) => {
159
- const t = await H(s, e);
1847
+ return k.error(d), d;
1848
+ }, Ur = async (i, e) => {
1849
+ const t = await br(i, e);
160
1850
  if (t.success)
161
1851
  return t.data;
162
1852
  if (e?.showError) {
163
- e.showError(t.msg ?? _);
1853
+ e.showError(t.msg ?? Ut);
164
1854
  return;
165
1855
  }
166
- throw Error(t.msg ?? _);
167
- }, J = async (s, e) => {
168
- const t = await v(s, e);
1856
+ throw Error(t.msg ?? Ut);
1857
+ }, Dr = async (i, e) => {
1858
+ const t = await Bt(i, e);
169
1859
  if (t.success)
170
1860
  return t.data;
171
1861
  if (e?.showError) {
172
- e.showError(t.msg ?? w);
1862
+ e.showError(t.msg ?? Qe);
173
1863
  return;
174
1864
  }
175
- throw Error(t.msg ?? w);
176
- }, X = async (s, e) => {
177
- const t = await v(s, e);
178
- return t.success ? (e?.showSuccess && e.showSuccess(t.msg ?? "SUCCESS"), !0) : (e?.showError && e.showError(t.msg ?? w), !1);
179
- }, q = (s) => {
180
- if (s.get) {
181
- const e = s.get(m.DEVICE_ID), t = s.get(m.LANG), n = s.get(m.WEBSITE_ID), r = s.get(m.WEBSITE_NO), o = {};
182
- return e && e.length > 0 && (o.deviceId = e), t && t.length > 0 && (o.lang = t), n && n.length > 0 && (o.websiteId = n), r && r.length > 0 && (o.websiteNo = r), o;
1865
+ throw Error(t.msg ?? Qe);
1866
+ }, Mr = async (i, e) => {
1867
+ const t = await Bt(i, e);
1868
+ return t.success ? (e?.showSuccess && e.showSuccess(t.msg ?? "SUCCESS"), !0) : (e?.showError && e.showError(t.msg ?? Qe), !1);
1869
+ }, wr = (i) => {
1870
+ if (i.get) {
1871
+ const e = i.get(Y.DEVICE_ID), t = i.get(Y.LANG), o = i.get(Y.WEBSITE_ID), n = i.get(Y.WEBSITE_NO), a = {};
1872
+ return e && e.length > 0 && (a.deviceId = e), t && t.length > 0 && (a.lang = t), o && o.length > 0 && (a.websiteId = o), n && n.length > 0 && (a.websiteNo = n), a;
183
1873
  }
184
1874
  throw new Error("The get method of IStorage has not been implemented.");
185
- }, z = (s, e) => {
186
- if (s.set)
187
- e.deviceId && s.set(m.DEVICE_ID, e.deviceId), e.lang && s.set(m.LANG, e.lang), e.websiteId && s.set(m.WEBSITE_ID, e.websiteId), e.websiteNo && s.set(m.WEBSITE_NO, e.websiteNo);
1875
+ }, jr = (i, e) => {
1876
+ if (i.set)
1877
+ e.deviceId && i.set(Y.DEVICE_ID, e.deviceId), e.lang && i.set(Y.LANG, e.lang), e.websiteId && i.set(Y.WEBSITE_ID, e.websiteId), e.websiteNo && i.set(Y.WEBSITE_NO, e.websiteNo);
188
1878
  else
189
1879
  throw new Error("The set method of IStorage has not been implemented.");
190
- }, Q = (s) => {
191
- if (s.get) {
192
- const e = s.get(f.IBOOT_DEVICE_ID), t = s.get(f.IBOOT_LANG), n = s.get(f.IBOOT_WEBSITE_ID), r = s.get(f.IBOOT_WEBSITE_NO), o = {};
193
- return e && e.length > 0 && (o.deviceId = e), t && t.length > 0 && (o.lang = t), n && n.length > 0 && (o.websiteId = n), r && r.length > 0 && (o.websiteNo = r), o;
1880
+ }, qr = (i) => {
1881
+ if (i.get) {
1882
+ const e = i.get(U.IBOOT_DEVICE_ID), t = i.get(U.IBOOT_LANG), o = i.get(U.IBOOT_WEBSITE_ID), n = i.get(U.IBOOT_WEBSITE_NO), a = {};
1883
+ return e && e.length > 0 && (a.deviceId = e), t && t.length > 0 && (a.lang = t), o && o.length > 0 && (a.websiteId = o), n && n.length > 0 && (a.websiteNo = n), a;
194
1884
  }
195
1885
  throw new Error("The get method of ICookies has not been implemented.");
196
- }, Z = (s, e) => {
197
- if (s.set)
198
- e.deviceId && s.set(f.IBOOT_DEVICE_ID, e.deviceId), e.lang && s.set(f.IBOOT_LANG, e.lang), e.websiteId && s.set(f.IBOOT_WEBSITE_ID, e.websiteId), e.websiteNo && s.set(f.IBOOT_WEBSITE_NO, e.websiteNo);
1886
+ }, Hr = (i, e) => {
1887
+ if (i.set)
1888
+ e.deviceId && i.set(U.IBOOT_DEVICE_ID, e.deviceId), e.lang && i.set(U.IBOOT_LANG, e.lang), e.websiteId && i.set(U.IBOOT_WEBSITE_ID, e.websiteId), e.websiteNo && i.set(U.IBOOT_WEBSITE_NO, e.websiteNo);
199
1889
  else
200
1890
  throw new Error("The set method of ICookies has not been implemented.");
201
- }, ee = (s) => {
202
- if (s.get) {
203
- const e = s.get(f.IBOOT_USER);
1891
+ }, Fr = (i) => {
1892
+ if (i.get) {
1893
+ const e = i.get(U.IBOOT_USER);
204
1894
  if (e && e.length > 0)
205
1895
  return JSON.parse(e);
206
1896
  }
207
- }, te = (s) => {
208
- if (s.get) {
209
- const e = s.get(f.IBOOT_USER);
1897
+ }, Er = (i) => {
1898
+ if (i.get) {
1899
+ const e = i.get(U.IBOOT_USER);
210
1900
  if (e && e.length > 0) {
211
- const t = JSON.parse(e), n = t.username, r = t.userType.toString(), o = s.get(f.IBOOT_TOKEN);
212
- if (o)
1901
+ const t = JSON.parse(e), o = t.username, n = t.userType.toString(), a = i.get(U.IBOOT_TOKEN);
1902
+ if (a)
213
1903
  return {
214
- username: n,
215
- utype: r,
216
- token: o
1904
+ username: o,
1905
+ utype: n,
1906
+ token: a
217
1907
  };
218
1908
  }
219
1909
  }
220
- }, se = (s, e) => {
221
- const { id: t, name: n, username: r, nickname: o, headImg: i, token: a, lastLoginTime: c, deviceId: l, userType: h, mustChangePwd: E } = s, u = {
1910
+ }, vr = (i, e) => {
1911
+ const { id: t, name: o, username: n, nickname: a, headImg: c, token: r, lastLoginTime: d, deviceId: g, userType: u, mustChangePwd: _ } = i, p = {
222
1912
  id: t,
223
- name: n,
224
- username: r,
225
- nickname: o || n,
226
- headImg: i,
227
- lastLoginTime: c,
228
- deviceId: l,
229
- userType: h,
1913
+ name: o,
1914
+ username: n,
1915
+ nickname: a || o,
1916
+ headImg: c,
1917
+ lastLoginTime: d,
1918
+ deviceId: g,
1919
+ userType: u,
230
1920
  accountType: 0,
231
1921
  needToReview: !1,
232
1922
  socketOnline: !1,
233
- mustChangePwd: E
1923
+ mustChangePwd: _
234
1924
  };
235
1925
  if (!e.set)
236
1926
  throw new Error("cookies set function is undefined");
237
- e.set(f.IBOOT_TOKEN, a, {
1927
+ e.set(U.IBOOT_TOKEN, r, {
238
1928
  path: "/",
239
1929
  secure: process.env.APP_ENV === "production",
240
1930
  httpOnly: !0,
241
1931
  sameSite: "strict"
242
- }), e.set(f.IBOOT_USER, JSON.stringify(u));
243
- }, re = (s) => {
244
- if (!s.set)
1932
+ }), e.set(U.IBOOT_USER, JSON.stringify(p));
1933
+ }, Rr = (i) => {
1934
+ if (!i.set)
245
1935
  throw new Error("cookies set function is undefined");
246
- if (s.set(f.IBOOT_TOKEN, "", {
1936
+ if (i.set(U.IBOOT_TOKEN, "", {
247
1937
  maxAge: -1,
248
1938
  //设置为 -1表示立即过期
249
1939
  httpOnly: !0,
250
1940
  path: "/"
251
- }), s.set(f.IBOOT_USER, "", {
1941
+ }), i.set(U.IBOOT_USER, "", {
252
1942
  maxAge: -1,
253
1943
  //设置为 -1表示立即过期
254
1944
  httpOnly: !0,
255
1945
  path: "/"
256
- }), !s.delete)
1946
+ }), !i.delete)
257
1947
  throw new Error("cookies delete function is undefined");
258
- s.delete(f.IBOOT_TOKEN), s.delete(f.IBOOT_USER);
1948
+ i.delete(U.IBOOT_TOKEN), i.delete(U.IBOOT_USER);
259
1949
  };
260
- class ne {
1950
+ class Pr {
261
1951
  baseUrl;
262
1952
  helloMethod;
263
1953
  apiKey;
@@ -269,121 +1959,121 @@ class ne {
269
1959
  websiteId;
270
1960
  websiteNo;
271
1961
  constructor(e) {
272
- process.env.APP_ENV === "production" || d.warn("This is currently a development environment!"), this.baseUrl = process.env.APP_BASEURL, this.apiKey = process.env.APP_APIKEY, this.userFrom = process.env.APP_USERFROM ?? "1", this.helloMethod = e.helloURL ?? "", this.userType = e.userType ?? C.TYPE_MGT, this.deviceId = e.deviceId ?? b(10), this.lang = e.lang ?? D, this.websiteId = e.websiteId, this.websiteNo = e.websiteNo;
1962
+ process.env.APP_ENV === "production" || k.warn("This is currently a development environment!"), this.baseUrl = process.env.APP_BASEURL, this.apiKey = process.env.APP_APIKEY, this.userFrom = process.env.APP_USERFROM ?? "1", this.helloMethod = e.helloURL ?? "", this.userType = e.userType ?? Dt.TYPE_MGT, this.deviceId = e.deviceId ?? at(10), this.lang = e.lang ?? _r, this.websiteId = e.websiteId, this.websiteNo = e.websiteNo;
273
1963
  }
274
1964
  encrypt(e) {
275
- const t = I.enc.Utf8.parse(this.apiKey);
276
- return I.AES.encrypt(e, t).toString();
1965
+ const t = ne.enc.Utf8.parse(this.apiKey);
1966
+ return ne.AES.encrypt(e, t).toString();
277
1967
  }
278
1968
  decrypt(e) {
279
- const t = I.enc.Utf8.parse(this.apiKey);
280
- return I.AES.decrypt(e, t, {
281
- mode: I.mode.ECB
282
- }).toString(I.enc.Utf8);
1969
+ const t = ne.enc.Utf8.parse(this.apiKey);
1970
+ return ne.AES.decrypt(e, t, {
1971
+ mode: ne.mode.ECB
1972
+ }).toString(ne.enc.Utf8);
283
1973
  }
284
1974
  //eslint-disable-next-line @typescript-eslint/no-explicit-any
285
1975
  convertUrlParameter(e) {
286
1976
  const t = [];
287
- for (const n in e) {
288
- let r = e[n];
289
- if (r && typeof r == "string")
290
- r = r.trim();
291
- else if (r && typeof r == "object") {
292
- if (O(r)) {
293
- if (r.length === 0)
1977
+ for (const o in e) {
1978
+ let n = e[o];
1979
+ if (n && typeof n == "string")
1980
+ n = n.trim();
1981
+ else if (n && typeof n == "object") {
1982
+ if (st(n)) {
1983
+ if (n.length === 0)
294
1984
  continue;
295
- for (let o = 0; o < r.length; o++) {
296
- const i = r[o];
297
- for (const a in i) {
298
- const c = i[a] ?? void 0;
299
- if (c) {
300
- if (typeof c == "object")
301
- O(c) && c.forEach((l, h) => {
302
- if (l)
303
- for (const E in l) {
304
- const u = l[E];
305
- if (u && u.toString().length > 0) {
306
- const g = `[${o.toString()}].${a + `[${h.toString()}].${E}`}=${T(u)}`;
307
- t.push(n + g);
1985
+ for (let a = 0; a < n.length; a++) {
1986
+ const c = n[a];
1987
+ for (const r in c) {
1988
+ const d = c[r] ?? void 0;
1989
+ if (d) {
1990
+ if (typeof d == "object")
1991
+ st(d) && d.forEach((g, u) => {
1992
+ if (g)
1993
+ for (const _ in g) {
1994
+ const p = g[_];
1995
+ if (p && p.toString().length > 0) {
1996
+ const R = `[${a.toString()}].${r + `[${u.toString()}].${_}`}=${we(p)}`;
1997
+ t.push(o + R);
308
1998
  }
309
1999
  }
310
2000
  });
311
- else if (c.toString().length > 0) {
312
- const l = `[${o.toString()}].${a}=${T(c.toString())}`;
313
- t.push(n + l);
2001
+ else if (d.toString().length > 0) {
2002
+ const g = `[${a.toString()}].${r}=${we(d.toString())}`;
2003
+ t.push(o + g);
314
2004
  }
315
2005
  }
316
2006
  }
317
2007
  }
318
2008
  } else
319
- for (const o in r) {
320
- const i = r[o];
321
- if (i != null && i != "" && i.length != 0) {
322
- const a = `.${o}=${T(i)}`;
323
- t.push(n + a);
2009
+ for (const a in n) {
2010
+ const c = n[a];
2011
+ if (c != null && c != "" && c.length != 0) {
2012
+ const r = `.${a}=${we(c)}`;
2013
+ t.push(o + r);
324
2014
  }
325
2015
  }
326
2016
  continue;
327
- } else r && typeof r == "function" && (r = null);
328
- r != null && r != "" && r.length != 0 && t.push(n + "=" + T(r));
2017
+ } else n && typeof n == "function" && (n = null);
2018
+ n != null && n != "" && n.length != 0 && t.push(o + "=" + we(n));
329
2019
  }
330
2020
  return t && t.join("&");
331
2021
  }
332
2022
  async sign(e) {
333
- const t = "&key=" + await this.helloIboot(), n = [];
334
- for (const c in e)
335
- n.push(c);
336
- n.sort((c, l) => c.toLowerCase().localeCompare(l.toLowerCase()));
337
- const r = [];
338
- n.forEach((c) => {
339
- let l = e[c];
340
- typeof l == "object" && (l = JSON.stringify(l)), r.push(c + "=" + l);
341
- });
342
- const o = r.join("&"), i = B.md5((o + t).toLocaleUpperCase()), a = {
343
- params: o,
344
- md5: i
2023
+ const t = "&key=" + await this.helloIboot(), o = [];
2024
+ for (const d in e)
2025
+ o.push(d);
2026
+ o.sort((d, g) => d.toLowerCase().localeCompare(g.toLowerCase()));
2027
+ const n = [];
2028
+ o.forEach((d) => {
2029
+ let g = e[d];
2030
+ typeof g == "object" && (g = JSON.stringify(g)), n.push(d + "=" + g);
2031
+ });
2032
+ const a = n.join("&"), c = Kt.md5((a + t).toLocaleUpperCase()), r = {
2033
+ params: a,
2034
+ md5: c
345
2035
  };
346
- return d.debug(a, "API_SIGN"), i;
2036
+ return k.debug(r, "API_SIGN"), c;
347
2037
  }
348
2038
  //eslint-disable-next-line @typescript-eslint/no-explicit-any
349
2039
  assemblyParameter(e, t) {
350
- const n = e ?? {};
351
- return n.timestamp = Date.now() + "", n.echostr = b(10), n.version = this.version, n.deviceId = this.deviceId, n.webid = this.websiteId, n.apiKey = this.apiKey, t && t.length > 0 && (n.username = t), n;
2040
+ const o = e ?? {};
2041
+ return o.timestamp = Date.now() + "", o.echostr = at(10), o.version = this.version, o.deviceId = this.deviceId, o.webid = this.websiteId, o.apiKey = this.apiKey, t && t.length > 0 && (o.username = t), o;
352
2042
  }
353
2043
  async assemblyHeader({ urlParams: e, token: t }) {
354
- const n = {
355
- "Content-Type": "application/x-www-form-urlencoded",
2044
+ const o = {
356
2045
  "Res-Type": "json",
357
2046
  "Device-Id": this.deviceId,
358
2047
  "User-Type": t?.utype.toString() ?? this.userType.toString(),
359
2048
  "User-From": this.userFrom,
360
2049
  "Api-Key": this.apiKey
361
2050
  };
362
- this.lang && this.lang.length > 0 && (n.Lang = this.lang), this.websiteId && this.websiteId.length > 0 && (n["Web-Id"] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (n["Web-No"] = this.websiteNo), t && (t.token && t.token.length > 0 && t.username && t.username.length > 0 && (n.Authorization = t.token, n.Username = t.username), t.xcsrf && (n[t.xcsrf.csrfHeader] = t.xcsrf.csrfToken));
363
- const r = L(e), o = await this.sign(r);
364
- return n.Sign = o, n;
2051
+ o[K] = X.applicationXwwwFormUrlencoded, this.lang && this.lang.length > 0 && (o.Lang = this.lang), this.websiteId && this.websiteId.length > 0 && (o["Web-Id"] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (o["Web-No"] = this.websiteNo), t && (t.token && t.token.length > 0 && t.username && t.username.length > 0 && (o.Authorization = t.token, o.Username = t.username), t.xcsrf && (o[t.xcsrf.csrfHeader] = t.xcsrf.csrfToken));
2052
+ const n = Ze(e), a = await this.sign(n);
2053
+ return o.Sign = a, o;
365
2054
  }
366
2055
  async helloIboot() {
367
2056
  if (this.helloMethod.length <= 0)
368
2057
  return this.apiKey;
369
2058
  const e = this.getApiUrl(this.helloMethod), t = {
370
- "Content-Type": "application/x-www-form-urlencoded",
371
2059
  "Res-Type": "json",
372
2060
  "Api-Key": this.apiKey
373
- }, n = {
2061
+ };
2062
+ t[K] = X.applicationXwwwFormUrlencoded;
2063
+ const o = {
374
2064
  url: e,
375
2065
  headers: t
376
2066
  };
377
- d.debug(n, "HELLO");
378
- const r = await fetch(e, {
2067
+ k.debug(o, "HELLO");
2068
+ const n = await fetch(e, {
379
2069
  method: "GET",
380
2070
  headers: t,
381
2071
  credentials: "include",
382
2072
  cache: "force-cache"
383
2073
  });
384
- if (r.ok) {
385
- const o = await r.json();
386
- return d.debug(o.data, "HELLO RESULT"), o.data;
2074
+ if (n.ok) {
2075
+ const a = await n.json();
2076
+ return k.debug(a.data, "HELLO RESULT"), a.data;
387
2077
  }
388
2078
  throw new Error("hello iBoot error!");
389
2079
  }
@@ -401,119 +2091,123 @@ class ne {
401
2091
  }
402
2092
  }
403
2093
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
404
- async get({ url: e, data: t, token: n, cache: r = "default" }) {
405
- const o = this.assemblyParameter(t), i = this.convertUrlParameter(o), a = await this.assemblyHeader({ urlParams: i, token: n }), c = `${this.getApiUrl(e)}?${i.toString()}`, l = {
406
- url: c,
407
- headers: a
2094
+ async get({ url: e, data: t, token: o, cache: n = "default" }) {
2095
+ const a = this.assemblyParameter(t), c = this.convertUrlParameter(a), r = await this.assemblyHeader({ urlParams: c, token: o }), d = `${this.getApiUrl(e)}?${c.toString()}`, g = {
2096
+ url: d,
2097
+ headers: r
408
2098
  };
409
- d.info(l, "GET");
410
- const h = await fetch(c, {
2099
+ k.info(g, "GET");
2100
+ const u = await fetch(d, {
411
2101
  method: "GET",
412
- headers: a,
2102
+ headers: r,
413
2103
  credentials: "include",
414
- cache: r
2104
+ cache: n
415
2105
  });
416
- if (h.ok) {
417
- const u = Object.fromEntries(h.headers.entries()), g = { ...await h.json(), headers: u };
418
- return d.debug(g, "GET_RESULT"), g;
2106
+ if (u.ok) {
2107
+ const p = Object.fromEntries(u.headers.entries()), R = { ...await u.json(), headers: p };
2108
+ return k.debug(R, "GET_RESULT"), R;
419
2109
  }
420
- const E = {
421
- code: h.status,
2110
+ const _ = {
2111
+ code: u.status,
422
2112
  success: !1,
423
- msg: h.statusText
2113
+ msg: u.statusText
424
2114
  };
425
- return d.error(E), E;
2115
+ return k.error(_), _;
426
2116
  }
427
2117
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
428
- async post({ url: e, data: t, token: n, cache: r = "default" }) {
2118
+ async post({ url: e, data: t, token: o, cache: n = "default" }) {
429
2119
  t = t ? { ...t } : {};
430
- const o = t.buffer ?? void 0, i = t.boundary ?? void 0;
431
- o && delete t.buffer, i && delete t.boundary;
432
- const a = this.assemblyParameter(t), c = this.convertUrlParameter(a), l = await this.assemblyHeader({ urlParams: c, token: n });
433
- o && i && (l["Content-Type"] = `multipart/form-data; boundary=${i}`);
434
- const h = this.getApiUrl(e), E = {
435
- url: h,
436
- headers: l,
437
- params: a
2120
+ const a = t.buffer ?? void 0, c = t.boundary ?? void 0;
2121
+ a && delete t.buffer, c && delete t.boundary;
2122
+ const r = this.assemblyParameter(t), d = this.convertUrlParameter(r), g = await this.assemblyHeader({ urlParams: d, token: o });
2123
+ a && c && (g[K] = `multipart/form-data; boundary=${c}`);
2124
+ const u = this.getApiUrl(e), _ = {
2125
+ url: u,
2126
+ headers: g,
2127
+ params: r
438
2128
  };
439
- d.info(E, "POST");
440
- const u = o ? `${h}?${c}` : h, g = await fetch(u, {
2129
+ k.info(_, "POST");
2130
+ const p = a ? `${u}?${d}` : u, R = await fetch(p, {
441
2131
  method: "POST",
442
- headers: l,
443
- body: o || c.toString(),
2132
+ headers: g,
2133
+ body: a || d.toString(),
444
2134
  credentials: "include",
445
- cache: r
2135
+ cache: n
446
2136
  });
447
- if (g.ok) {
448
- const A = Object.fromEntries(g.headers.entries()), y = { ...await g.json(), headers: A };
449
- return d.debug(y, "POST_RESULT"), y;
2137
+ if (R.ok) {
2138
+ const x = Object.fromEntries(R.headers.entries()), l = { ...await R.json(), headers: x };
2139
+ return k.debug(l, "POST_RESULT"), l;
450
2140
  }
451
- const p = {
452
- code: g.status,
2141
+ const S = {
2142
+ code: R.status,
453
2143
  success: !1,
454
- msg: g.statusText
2144
+ msg: R.statusText
455
2145
  };
456
- return d.error(p), p;
2146
+ return k.error(S), S;
457
2147
  }
458
2148
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
459
- async stream({ url: e, data: t, token: n }) {
2149
+ async stream({ url: e, data: t, token: o }) {
460
2150
  t = t ? { ...t } : {};
461
- const r = t.buffer ?? void 0, o = t.boundary ?? void 0;
462
- r && delete t.buffer, o && delete t.boundary;
463
- const i = this.assemblyParameter(t), a = this.convertUrlParameter(i), c = await this.assemblyHeader({ urlParams: a, token: n });
464
- r && o && (c["Content-Type"] = `multipart/form-data; boundary=${o}`), c.Connection = "keep-alive", c["X-Accel-Buffering"] = "no", c["Cache-Control"] = "no-cache";
465
- const l = this.getApiUrl(e);
2151
+ const n = t.buffer ?? void 0, a = t.boundary ?? void 0;
2152
+ n && delete t.buffer, a && delete t.boundary;
2153
+ const c = this.assemblyParameter(t), r = this.convertUrlParameter(c), d = await this.assemblyHeader({ urlParams: r, token: o });
2154
+ n && a && (d[K] = `multipart/form-data; boundary=${a}`), d.Connection = "keep-alive", d["X-Accel-Buffering"] = "no", d["Cache-Control"] = "no-cache";
2155
+ const g = this.getApiUrl(e);
466
2156
  try {
467
- const h = r ? `${l}?${a}` : l, E = {
468
- url: l,
469
- headers: c,
470
- params: i
2157
+ const u = n ? `${g}?${r}` : g, _ = {
2158
+ url: g,
2159
+ headers: d,
2160
+ params: c
471
2161
  };
472
- d.info(E, "STREAM");
473
- const u = await fetch(h, {
2162
+ k.info(_, "STREAM");
2163
+ const p = await fetch(u, {
474
2164
  method: "POST",
475
- headers: c,
476
- body: r || a.toString(),
2165
+ headers: d,
2166
+ body: n || r.toString(),
477
2167
  credentials: "include"
478
2168
  });
479
- if (!u.ok)
480
- throw new Error(`HTTP error! status: ${u.status}`);
481
- if (!u.body)
2169
+ if (!p.ok)
2170
+ throw new Error(`HTTP error! status: ${p.status}`);
2171
+ if (!p.body)
482
2172
  throw new Error("No response body");
483
- const g = Object.fromEntries(u.headers.entries());
484
- return new Response(u.body, {
485
- headers: g
2173
+ const R = Object.fromEntries(p.headers.entries());
2174
+ return new Response(p.body, {
2175
+ headers: R
486
2176
  });
487
- } catch (h) {
488
- throw h;
2177
+ } catch (u) {
2178
+ throw u;
489
2179
  }
490
2180
  }
491
2181
  }
492
2182
  export {
493
- K as ACCOUNT_TYPE_MAP,
494
- ne as HttpClient,
495
- G as USER_FORM_MAP,
496
- F as USER_SEX_MAP,
497
- C as USER_TYPE_MAP,
498
- re as cleanToken,
499
- k as dateFormat,
500
- H as get,
501
- ee as getLoginUser,
502
- Q as getServerHttpCookies,
503
- q as getServerHttpOpts,
504
- te as getToken,
505
- Y as iGet,
506
- J as iPost,
507
- X as iPostSuccess,
508
- O as isArray,
509
- d as logger,
510
- v as post,
511
- b as randomString,
512
- V as setClientRequestHeader,
513
- Z as setServerHttpCookies,
514
- z as setServerHttpHeaders,
515
- se as setToken,
516
- T as urlEncode,
517
- L as urlParamToJson
2183
+ Ir as ACCOUNT_TYPE_MAP,
2184
+ K as CONTENT_TYPE_KEY,
2185
+ X as CONTENT_TYPE_MAP,
2186
+ Lr as HTTPRouter,
2187
+ Pr as HttpClient,
2188
+ Cr as NextJsAdapter,
2189
+ Or as USER_FORM_MAP,
2190
+ xr as USER_SEX_MAP,
2191
+ Dt as USER_TYPE_MAP,
2192
+ Rr as cleanToken,
2193
+ Nr as dateFormat,
2194
+ br as get,
2195
+ Fr as getLoginUser,
2196
+ qr as getServerHttpCookies,
2197
+ wr as getServerHttpOpts,
2198
+ Er as getToken,
2199
+ Ur as iGet,
2200
+ Dr as iPost,
2201
+ Mr as iPostSuccess,
2202
+ st as isArray,
2203
+ k as logger,
2204
+ Bt as post,
2205
+ at as randomString,
2206
+ kr as setClientRequestHeader,
2207
+ Hr as setServerHttpCookies,
2208
+ jr as setServerHttpHeaders,
2209
+ vr as setToken,
2210
+ we as urlEncode,
2211
+ Ze as urlParamToJson
518
2212
  };
519
2213
  //# sourceMappingURL=iboot-http-client.es.js.map