@websolutespa/bom-mixer-store 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +17 -0
  2. package/CHANGELOG.md +7 -0
  3. package/coverage/api/api.service.ts.html +559 -0
  4. package/coverage/api/api.store.ts.html +253 -0
  5. package/coverage/api/index.html +131 -0
  6. package/coverage/base.css +224 -0
  7. package/coverage/block-navigation.js +87 -0
  8. package/coverage/cobertura-coverage.xml +517 -0
  9. package/coverage/favicon.png +0 -0
  10. package/coverage/fs/fs.service.ts.html +466 -0
  11. package/coverage/fs/index.html +116 -0
  12. package/coverage/index.html +176 -0
  13. package/coverage/middleware/index.html +116 -0
  14. package/coverage/middleware/middleware.service.ts.html +340 -0
  15. package/coverage/mock/index.html +161 -0
  16. package/coverage/mock/mock.api.ts.html +118 -0
  17. package/coverage/mock/mock.interceptor.ts.html +133 -0
  18. package/coverage/mock/mock.service.ts.html +178 -0
  19. package/coverage/mock/mock.store.ts.html +175 -0
  20. package/coverage/prettify.css +1 -0
  21. package/coverage/prettify.js +2 -0
  22. package/coverage/sort-arrow-sprite.png +0 -0
  23. package/coverage/sorter.js +196 -0
  24. package/coverage/store/index.html +131 -0
  25. package/coverage/store/store.service.ts.html +157 -0
  26. package/coverage/store/store.ts.html +172 -0
  27. package/dist/index.d.ts +60 -0
  28. package/dist/index.js +2020 -0
  29. package/dist/index.mjs +1991 -0
  30. package/jest.config.ts +3 -0
  31. package/package.json +56 -0
  32. package/src/api/api.service.ts +158 -0
  33. package/src/api/api.store.ts +56 -0
  34. package/src/example.test.ts +8 -0
  35. package/src/fs/fs.service.ts +127 -0
  36. package/src/index.ts +9 -0
  37. package/src/middleware/middleware.service.ts +85 -0
  38. package/src/mock/mock.api.ts +11 -0
  39. package/src/mock/mock.interceptor.ts +16 -0
  40. package/src/mock/mock.service.ts +31 -0
  41. package/src/mock/mock.store.ts +30 -0
  42. package/src/store/store.service.ts +24 -0
  43. package/src/store/store.ts +29 -0
  44. package/tsconfig.json +16 -0
package/dist/index.js ADDED
@@ -0,0 +1,2020 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __publicField = (obj, key, value) => {
34
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
+ return value;
36
+ };
37
+
38
+ // ../../../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
39
+ var require_detect_domain_locale = __commonJS({
40
+ "../../../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js"(exports) {
41
+ "use strict";
42
+ Object.defineProperty(exports, "__esModule", {
43
+ value: true
44
+ });
45
+ exports.detectDomainLocale = detectDomainLocale;
46
+ function detectDomainLocale(domainItems, hostname, detectedLocale) {
47
+ let domainItem;
48
+ if (domainItems) {
49
+ if (detectedLocale) {
50
+ detectedLocale = detectedLocale.toLowerCase();
51
+ }
52
+ for (const item of domainItems) {
53
+ var ref, ref1;
54
+ const domainHostname = (ref = item.domain) == null ? void 0 : ref.split(":")[0].toLowerCase();
55
+ if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((ref1 = item.locales) == null ? void 0 : ref1.some((locale) => locale.toLowerCase() === detectedLocale))) {
56
+ domainItem = item;
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ return domainItem;
62
+ }
63
+ }
64
+ });
65
+
66
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
67
+ var require_remove_trailing_slash = __commonJS({
68
+ "../../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js"(exports) {
69
+ "use strict";
70
+ Object.defineProperty(exports, "__esModule", {
71
+ value: true
72
+ });
73
+ exports.removeTrailingSlash = removeTrailingSlash;
74
+ function removeTrailingSlash(route) {
75
+ return route.replace(/\/$/, "") || "/";
76
+ }
77
+ }
78
+ });
79
+
80
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/parse-path.js
81
+ var require_parse_path = __commonJS({
82
+ "../../../../node_modules/next/dist/shared/lib/router/utils/parse-path.js"(exports) {
83
+ "use strict";
84
+ Object.defineProperty(exports, "__esModule", {
85
+ value: true
86
+ });
87
+ exports.parsePath = parsePath;
88
+ function parsePath(path3) {
89
+ const hashIndex = path3.indexOf("#");
90
+ const queryIndex = path3.indexOf("?");
91
+ const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
92
+ if (hasQuery || hashIndex > -1) {
93
+ return {
94
+ pathname: path3.substring(0, hasQuery ? queryIndex : hashIndex),
95
+ query: hasQuery ? path3.substring(queryIndex, hashIndex > -1 ? hashIndex : void 0) : "",
96
+ hash: hashIndex > -1 ? path3.slice(hashIndex) : ""
97
+ };
98
+ }
99
+ return {
100
+ pathname: path3,
101
+ query: "",
102
+ hash: ""
103
+ };
104
+ }
105
+ }
106
+ });
107
+
108
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
109
+ var require_add_path_prefix = __commonJS({
110
+ "../../../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js"(exports) {
111
+ "use strict";
112
+ Object.defineProperty(exports, "__esModule", {
113
+ value: true
114
+ });
115
+ exports.addPathPrefix = addPathPrefix;
116
+ var _parsePath = require_parse_path();
117
+ function addPathPrefix(path3, prefix) {
118
+ if (!path3.startsWith("/") || !prefix) {
119
+ return path3;
120
+ }
121
+ const { pathname, query, hash } = (0, _parsePath).parsePath(path3);
122
+ return `${prefix}${pathname}${query}${hash}`;
123
+ }
124
+ }
125
+ });
126
+
127
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js
128
+ var require_add_path_suffix = __commonJS({
129
+ "../../../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js"(exports) {
130
+ "use strict";
131
+ Object.defineProperty(exports, "__esModule", {
132
+ value: true
133
+ });
134
+ exports.addPathSuffix = addPathSuffix;
135
+ var _parsePath = require_parse_path();
136
+ function addPathSuffix(path3, suffix) {
137
+ if (!path3.startsWith("/") || !suffix) {
138
+ return path3;
139
+ }
140
+ const { pathname, query, hash } = (0, _parsePath).parsePath(path3);
141
+ return `${pathname}${suffix}${query}${hash}`;
142
+ }
143
+ }
144
+ });
145
+
146
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
147
+ var require_path_has_prefix = __commonJS({
148
+ "../../../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js"(exports) {
149
+ "use strict";
150
+ Object.defineProperty(exports, "__esModule", {
151
+ value: true
152
+ });
153
+ exports.pathHasPrefix = pathHasPrefix;
154
+ var _parsePath = require_parse_path();
155
+ function pathHasPrefix(path3, prefix) {
156
+ if (typeof path3 !== "string") {
157
+ return false;
158
+ }
159
+ const { pathname } = (0, _parsePath).parsePath(path3);
160
+ return pathname === prefix || pathname.startsWith(prefix + "/");
161
+ }
162
+ }
163
+ });
164
+
165
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/add-locale.js
166
+ var require_add_locale = __commonJS({
167
+ "../../../../node_modules/next/dist/shared/lib/router/utils/add-locale.js"(exports) {
168
+ "use strict";
169
+ Object.defineProperty(exports, "__esModule", {
170
+ value: true
171
+ });
172
+ exports.addLocale = addLocale;
173
+ var _addPathPrefix = require_add_path_prefix();
174
+ var _pathHasPrefix = require_path_has_prefix();
175
+ function addLocale(path3, locale, defaultLocale, ignorePrefix) {
176
+ if (locale && locale !== defaultLocale && (ignorePrefix || !(0, _pathHasPrefix).pathHasPrefix(path3.toLowerCase(), `/${locale.toLowerCase()}`) && !(0, _pathHasPrefix).pathHasPrefix(path3.toLowerCase(), "/api"))) {
177
+ return (0, _addPathPrefix).addPathPrefix(path3, `/${locale}`);
178
+ }
179
+ return path3;
180
+ }
181
+ }
182
+ });
183
+
184
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
185
+ var require_format_next_pathname_info = __commonJS({
186
+ "../../../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js"(exports) {
187
+ "use strict";
188
+ Object.defineProperty(exports, "__esModule", {
189
+ value: true
190
+ });
191
+ exports.formatNextPathnameInfo = formatNextPathnameInfo;
192
+ var _removeTrailingSlash = require_remove_trailing_slash();
193
+ var _addPathPrefix = require_add_path_prefix();
194
+ var _addPathSuffix = require_add_path_suffix();
195
+ var _addLocale = require_add_locale();
196
+ function formatNextPathnameInfo(info) {
197
+ let pathname = (0, _addLocale).addLocale(info.pathname, info.locale, info.buildId ? void 0 : info.defaultLocale, info.ignorePrefix);
198
+ if (info.buildId) {
199
+ pathname = (0, _addPathSuffix).addPathSuffix((0, _addPathPrefix).addPathPrefix(pathname, `/_next/data/${info.buildId}`), info.pathname === "/" ? "index.json" : ".json");
200
+ }
201
+ pathname = (0, _addPathPrefix).addPathPrefix(pathname, info.basePath);
202
+ return info.trailingSlash ? !info.buildId && !pathname.endsWith("/") ? (0, _addPathSuffix).addPathSuffix(pathname, "/") : pathname : (0, _removeTrailingSlash).removeTrailingSlash(pathname);
203
+ }
204
+ }
205
+ });
206
+
207
+ // ../../../../node_modules/next/dist/shared/lib/get-hostname.js
208
+ var require_get_hostname = __commonJS({
209
+ "../../../../node_modules/next/dist/shared/lib/get-hostname.js"(exports) {
210
+ "use strict";
211
+ Object.defineProperty(exports, "__esModule", {
212
+ value: true
213
+ });
214
+ exports.getHostname = getHostname;
215
+ function getHostname(parsed, headers) {
216
+ var ref;
217
+ return (ref = !Array.isArray(headers == null ? void 0 : headers.host) && (headers == null ? void 0 : headers.host) || parsed.hostname) == null ? void 0 : ref.split(":")[0].toLowerCase();
218
+ }
219
+ }
220
+ });
221
+
222
+ // ../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
223
+ var require_normalize_locale_path = __commonJS({
224
+ "../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js"(exports) {
225
+ "use strict";
226
+ Object.defineProperty(exports, "__esModule", {
227
+ value: true
228
+ });
229
+ exports.normalizeLocalePath = normalizeLocalePath;
230
+ function normalizeLocalePath(pathname, locales) {
231
+ let detectedLocale;
232
+ const pathnameParts = pathname.split("/");
233
+ (locales || []).some((locale) => {
234
+ if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {
235
+ detectedLocale = locale;
236
+ pathnameParts.splice(1, 1);
237
+ pathname = pathnameParts.join("/") || "/";
238
+ return true;
239
+ }
240
+ return false;
241
+ });
242
+ return {
243
+ pathname,
244
+ detectedLocale
245
+ };
246
+ }
247
+ }
248
+ });
249
+
250
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js
251
+ var require_remove_path_prefix = __commonJS({
252
+ "../../../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js"(exports) {
253
+ "use strict";
254
+ Object.defineProperty(exports, "__esModule", {
255
+ value: true
256
+ });
257
+ exports.removePathPrefix = removePathPrefix;
258
+ var _pathHasPrefix = require_path_has_prefix();
259
+ function removePathPrefix(path3, prefix) {
260
+ if ((0, _pathHasPrefix).pathHasPrefix(path3, prefix)) {
261
+ const withoutPrefix = path3.slice(prefix.length);
262
+ return withoutPrefix.startsWith("/") ? withoutPrefix : `/${withoutPrefix}`;
263
+ }
264
+ return path3;
265
+ }
266
+ }
267
+ });
268
+
269
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js
270
+ var require_get_next_pathname_info = __commonJS({
271
+ "../../../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js"(exports) {
272
+ "use strict";
273
+ Object.defineProperty(exports, "__esModule", {
274
+ value: true
275
+ });
276
+ exports.getNextPathnameInfo = getNextPathnameInfo;
277
+ var _normalizeLocalePath = require_normalize_locale_path();
278
+ var _removePathPrefix = require_remove_path_prefix();
279
+ var _pathHasPrefix = require_path_has_prefix();
280
+ function getNextPathnameInfo(pathname, options) {
281
+ var _nextConfig;
282
+ const { basePath, i18n, trailingSlash } = (_nextConfig = options.nextConfig) != null ? _nextConfig : {};
283
+ const info = {
284
+ pathname,
285
+ trailingSlash: pathname !== "/" ? pathname.endsWith("/") : trailingSlash
286
+ };
287
+ if (basePath && (0, _pathHasPrefix).pathHasPrefix(info.pathname, basePath)) {
288
+ info.pathname = (0, _removePathPrefix).removePathPrefix(info.pathname, basePath);
289
+ info.basePath = basePath;
290
+ }
291
+ if (options.parseData === true && info.pathname.startsWith("/_next/data/") && info.pathname.endsWith(".json")) {
292
+ const paths = info.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/");
293
+ const buildId = paths[0];
294
+ info.pathname = paths[1] !== "index" ? `/${paths.slice(1).join("/")}` : "/";
295
+ info.buildId = buildId;
296
+ }
297
+ if (i18n) {
298
+ const pathLocale = (0, _normalizeLocalePath).normalizeLocalePath(info.pathname, i18n.locales);
299
+ info.locale = pathLocale == null ? void 0 : pathLocale.detectedLocale;
300
+ info.pathname = (pathLocale == null ? void 0 : pathLocale.pathname) || info.pathname;
301
+ }
302
+ return info;
303
+ }
304
+ }
305
+ });
306
+
307
+ // ../../../../node_modules/next/dist/server/web/next-url.js
308
+ var require_next_url = __commonJS({
309
+ "../../../../node_modules/next/dist/server/web/next-url.js"(exports) {
310
+ "use strict";
311
+ Object.defineProperty(exports, "__esModule", {
312
+ value: true
313
+ });
314
+ var _detectDomainLocale = require_detect_domain_locale();
315
+ var _formatNextPathnameInfo = require_format_next_pathname_info();
316
+ var _getHostname = require_get_hostname();
317
+ var _getNextPathnameInfo = require_get_next_pathname_info();
318
+ var FLIGHT_PARAMETERS = [
319
+ "__flight__",
320
+ "__flight_router_state_tree__",
321
+ "__flight_prefetch__"
322
+ ];
323
+ var REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|::1|localhost)/;
324
+ function parseURL(url, base) {
325
+ return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"));
326
+ }
327
+ function parseFlightParameters(searchParams) {
328
+ let flightSearchParameters = {};
329
+ let flightSearchParametersUpdated = false;
330
+ for (const name of FLIGHT_PARAMETERS) {
331
+ const value = searchParams.get(name);
332
+ if (value === null) {
333
+ continue;
334
+ }
335
+ flightSearchParameters[name] = value;
336
+ flightSearchParametersUpdated = true;
337
+ }
338
+ if (!flightSearchParametersUpdated) {
339
+ return void 0;
340
+ }
341
+ return flightSearchParameters;
342
+ }
343
+ var Internal = Symbol("NextURLInternal");
344
+ var NextURL = class {
345
+ constructor(input, baseOrOpts, opts) {
346
+ let base;
347
+ let options;
348
+ if (typeof baseOrOpts === "object" && "pathname" in baseOrOpts || typeof baseOrOpts === "string") {
349
+ base = baseOrOpts;
350
+ options = opts || {};
351
+ } else {
352
+ options = opts || baseOrOpts || {};
353
+ }
354
+ this[Internal] = {
355
+ url: parseURL(input, base != null ? base : options.base),
356
+ options,
357
+ basePath: ""
358
+ };
359
+ this.analyzeUrl();
360
+ }
361
+ analyzeUrl() {
362
+ var ref, ref1, ref2, ref3, ref4;
363
+ const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(this[Internal].url.pathname, {
364
+ nextConfig: this[Internal].options.nextConfig,
365
+ parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE
366
+ });
367
+ this[Internal].domainLocale = (0, _detectDomainLocale).detectDomainLocale((ref = this[Internal].options.nextConfig) == null ? void 0 : (ref1 = ref.i18n) == null ? void 0 : ref1.domains, (0, _getHostname).getHostname(this[Internal].url, this[Internal].options.headers));
368
+ const defaultLocale = ((ref2 = this[Internal].domainLocale) == null ? void 0 : ref2.defaultLocale) || ((ref3 = this[Internal].options.nextConfig) == null ? void 0 : (ref4 = ref3.i18n) == null ? void 0 : ref4.defaultLocale);
369
+ this[Internal].url.pathname = pathnameInfo.pathname;
370
+ this[Internal].defaultLocale = defaultLocale;
371
+ var _basePath;
372
+ this[Internal].basePath = (_basePath = pathnameInfo.basePath) != null ? _basePath : "";
373
+ this[Internal].buildId = pathnameInfo.buildId;
374
+ var _locale;
375
+ this[Internal].locale = (_locale = pathnameInfo.locale) != null ? _locale : defaultLocale;
376
+ this[Internal].trailingSlash = pathnameInfo.trailingSlash;
377
+ this[Internal].flightSearchParameters = parseFlightParameters(this[Internal].url.searchParams);
378
+ }
379
+ formatPathname() {
380
+ return (0, _formatNextPathnameInfo).formatNextPathnameInfo({
381
+ basePath: this[Internal].basePath,
382
+ buildId: this[Internal].buildId,
383
+ defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : void 0,
384
+ locale: this[Internal].locale,
385
+ pathname: this[Internal].url.pathname,
386
+ trailingSlash: this[Internal].trailingSlash
387
+ });
388
+ }
389
+ formatSearch() {
390
+ const flightSearchParameters = this[Internal].flightSearchParameters;
391
+ if (!flightSearchParameters) {
392
+ return this[Internal].url.search;
393
+ }
394
+ const searchParams = new URLSearchParams(this[Internal].url.searchParams);
395
+ for (const name in flightSearchParameters) {
396
+ searchParams.set(name, flightSearchParameters[name]);
397
+ }
398
+ const params = searchParams.toString();
399
+ return params === "" ? "" : `?${params}`;
400
+ }
401
+ get buildId() {
402
+ return this[Internal].buildId;
403
+ }
404
+ set buildId(buildId) {
405
+ this[Internal].buildId = buildId;
406
+ }
407
+ get flightSearchParameters() {
408
+ return this[Internal].flightSearchParameters;
409
+ }
410
+ set flightSearchParameters(flightSearchParams) {
411
+ if (flightSearchParams) {
412
+ for (const name of FLIGHT_PARAMETERS) {
413
+ if (flightSearchParams[name]) {
414
+ this[Internal].url.searchParams.set(name, flightSearchParams[name]);
415
+ } else {
416
+ this[Internal].url.searchParams.delete(name);
417
+ }
418
+ }
419
+ } else {
420
+ for (const name of FLIGHT_PARAMETERS) {
421
+ this[Internal].url.searchParams.delete(name);
422
+ }
423
+ }
424
+ this[Internal].flightSearchParameters = flightSearchParams;
425
+ }
426
+ get locale() {
427
+ var _locale;
428
+ return (_locale = this[Internal].locale) != null ? _locale : "";
429
+ }
430
+ set locale(locale) {
431
+ var ref, ref5;
432
+ if (!this[Internal].locale || !((ref = this[Internal].options.nextConfig) == null ? void 0 : (ref5 = ref.i18n) == null ? void 0 : ref5.locales.includes(locale))) {
433
+ throw new TypeError(`The NextURL configuration includes no locale "${locale}"`);
434
+ }
435
+ this[Internal].locale = locale;
436
+ }
437
+ get defaultLocale() {
438
+ return this[Internal].defaultLocale;
439
+ }
440
+ get domainLocale() {
441
+ return this[Internal].domainLocale;
442
+ }
443
+ get searchParams() {
444
+ return this[Internal].url.searchParams;
445
+ }
446
+ get host() {
447
+ return this[Internal].url.host;
448
+ }
449
+ set host(value) {
450
+ this[Internal].url.host = value;
451
+ }
452
+ get hostname() {
453
+ return this[Internal].url.hostname;
454
+ }
455
+ set hostname(value) {
456
+ this[Internal].url.hostname = value;
457
+ }
458
+ get port() {
459
+ return this[Internal].url.port;
460
+ }
461
+ set port(value) {
462
+ this[Internal].url.port = value;
463
+ }
464
+ get protocol() {
465
+ return this[Internal].url.protocol;
466
+ }
467
+ set protocol(value) {
468
+ this[Internal].url.protocol = value;
469
+ }
470
+ get href() {
471
+ const pathname = this.formatPathname();
472
+ const search = this.formatSearch();
473
+ return `${this.protocol}//${this.host}${pathname}${search}`;
474
+ }
475
+ set href(url) {
476
+ this[Internal].url = parseURL(url);
477
+ this.analyzeUrl();
478
+ }
479
+ get origin() {
480
+ return this[Internal].url.origin;
481
+ }
482
+ get pathname() {
483
+ return this[Internal].url.pathname;
484
+ }
485
+ set pathname(value) {
486
+ this[Internal].url.pathname = value;
487
+ }
488
+ get hash() {
489
+ return this[Internal].url.hash;
490
+ }
491
+ set hash(value) {
492
+ this[Internal].url.hash = value;
493
+ }
494
+ get search() {
495
+ return this[Internal].url.search;
496
+ }
497
+ set search(value) {
498
+ this[Internal].url.search = value;
499
+ }
500
+ get password() {
501
+ return this[Internal].url.password;
502
+ }
503
+ set password(value) {
504
+ this[Internal].url.password = value;
505
+ }
506
+ get username() {
507
+ return this[Internal].url.username;
508
+ }
509
+ set username(value) {
510
+ this[Internal].url.username = value;
511
+ }
512
+ get basePath() {
513
+ return this[Internal].basePath;
514
+ }
515
+ set basePath(value) {
516
+ this[Internal].basePath = value.startsWith("/") ? value : `/${value}`;
517
+ }
518
+ toString() {
519
+ return this.href;
520
+ }
521
+ toJSON() {
522
+ return this.href;
523
+ }
524
+ [Symbol.for("edge-runtime.inspect.custom")]() {
525
+ return {
526
+ href: this.href,
527
+ origin: this.origin,
528
+ protocol: this.protocol,
529
+ username: this.username,
530
+ password: this.password,
531
+ host: this.host,
532
+ hostname: this.hostname,
533
+ port: this.port,
534
+ pathname: this.pathname,
535
+ search: this.search,
536
+ searchParams: this.searchParams,
537
+ hash: this.hash
538
+ };
539
+ }
540
+ clone() {
541
+ return new NextURL(String(this), this[Internal].options);
542
+ }
543
+ };
544
+ exports.NextURL = NextURL;
545
+ }
546
+ });
547
+
548
+ // ../../../../node_modules/next/dist/server/web/utils.js
549
+ var require_utils = __commonJS({
550
+ "../../../../node_modules/next/dist/server/web/utils.js"(exports) {
551
+ "use strict";
552
+ Object.defineProperty(exports, "__esModule", {
553
+ value: true
554
+ });
555
+ exports.fromNodeHeaders = fromNodeHeaders;
556
+ exports.splitCookiesString = splitCookiesString;
557
+ exports.toNodeHeaders = toNodeHeaders;
558
+ exports.validateURL = validateURL;
559
+ function fromNodeHeaders(object) {
560
+ const headers = new Headers();
561
+ for (let [key, value] of Object.entries(object)) {
562
+ const values = Array.isArray(value) ? value : [
563
+ value
564
+ ];
565
+ for (let v of values) {
566
+ if (v !== void 0) {
567
+ headers.append(key, v);
568
+ }
569
+ }
570
+ }
571
+ return headers;
572
+ }
573
+ function splitCookiesString(cookiesString) {
574
+ var cookiesStrings = [];
575
+ var pos = 0;
576
+ var start;
577
+ var ch;
578
+ var lastComma;
579
+ var nextStart;
580
+ var cookiesSeparatorFound;
581
+ function skipWhitespace() {
582
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
583
+ pos += 1;
584
+ }
585
+ return pos < cookiesString.length;
586
+ }
587
+ function notSpecialChar() {
588
+ ch = cookiesString.charAt(pos);
589
+ return ch !== "=" && ch !== ";" && ch !== ",";
590
+ }
591
+ while (pos < cookiesString.length) {
592
+ start = pos;
593
+ cookiesSeparatorFound = false;
594
+ while (skipWhitespace()) {
595
+ ch = cookiesString.charAt(pos);
596
+ if (ch === ",") {
597
+ lastComma = pos;
598
+ pos += 1;
599
+ skipWhitespace();
600
+ nextStart = pos;
601
+ while (pos < cookiesString.length && notSpecialChar()) {
602
+ pos += 1;
603
+ }
604
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
605
+ cookiesSeparatorFound = true;
606
+ pos = nextStart;
607
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
608
+ start = pos;
609
+ } else {
610
+ pos = lastComma + 1;
611
+ }
612
+ } else {
613
+ pos += 1;
614
+ }
615
+ }
616
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
617
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
618
+ }
619
+ }
620
+ return cookiesStrings;
621
+ }
622
+ function toNodeHeaders(headers) {
623
+ const result = {};
624
+ if (headers) {
625
+ for (const [key, value] of headers.entries()) {
626
+ result[key] = value;
627
+ if (key.toLowerCase() === "set-cookie") {
628
+ result[key] = splitCookiesString(value);
629
+ }
630
+ }
631
+ }
632
+ return result;
633
+ }
634
+ function validateURL(url) {
635
+ try {
636
+ return String(new URL(String(url)));
637
+ } catch (error) {
638
+ throw new Error(`URLs is malformed. Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
639
+ cause: error
640
+ });
641
+ }
642
+ }
643
+ }
644
+ });
645
+
646
+ // ../../../../node_modules/next/dist/server/web/error.js
647
+ var require_error = __commonJS({
648
+ "../../../../node_modules/next/dist/server/web/error.js"(exports) {
649
+ "use strict";
650
+ Object.defineProperty(exports, "__esModule", {
651
+ value: true
652
+ });
653
+ var PageSignatureError = class extends Error {
654
+ constructor({ page }) {
655
+ super(`The middleware "${page}" accepts an async API directly with the form:
656
+
657
+ export function middleware(request, event) {
658
+ return NextResponse.redirect('/new-location')
659
+ }
660
+
661
+ Read more: https://nextjs.org/docs/messages/middleware-new-signature
662
+ `);
663
+ }
664
+ };
665
+ exports.PageSignatureError = PageSignatureError;
666
+ var RemovedPageError = class extends Error {
667
+ constructor() {
668
+ super(`The request.page has been deprecated in favour of \`URLPattern\`.
669
+ Read more: https://nextjs.org/docs/messages/middleware-request-page
670
+ `);
671
+ }
672
+ };
673
+ exports.RemovedPageError = RemovedPageError;
674
+ var RemovedUAError = class extends Error {
675
+ constructor() {
676
+ super(`The request.ua has been removed in favour of \`userAgent\` function.
677
+ Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
678
+ `);
679
+ }
680
+ };
681
+ exports.RemovedUAError = RemovedUAError;
682
+ }
683
+ });
684
+
685
+ // ../../../../node_modules/next/dist/compiled/cookie/index.js
686
+ var require_cookie = __commonJS({
687
+ "../../../../node_modules/next/dist/compiled/cookie/index.js"(exports, module2) {
688
+ (() => {
689
+ "use strict";
690
+ if (typeof __nccwpck_require__ !== "undefined")
691
+ __nccwpck_require__.ab = __dirname + "/";
692
+ var e = {};
693
+ (() => {
694
+ var r = e;
695
+ r.parse = parse;
696
+ r.serialize = serialize;
697
+ var i = decodeURIComponent;
698
+ var t = encodeURIComponent;
699
+ var a = /; */;
700
+ var n = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
701
+ function parse(e2, r2) {
702
+ if (typeof e2 !== "string") {
703
+ throw new TypeError("argument str must be a string");
704
+ }
705
+ var t2 = {};
706
+ var n2 = r2 || {};
707
+ var o = e2.split(a);
708
+ var s = n2.decode || i;
709
+ for (var p = 0; p < o.length; p++) {
710
+ var f = o[p];
711
+ var u = f.indexOf("=");
712
+ if (u < 0) {
713
+ continue;
714
+ }
715
+ var v = f.substr(0, u).trim();
716
+ var c = f.substr(++u, f.length).trim();
717
+ if ('"' == c[0]) {
718
+ c = c.slice(1, -1);
719
+ }
720
+ if (void 0 == t2[v]) {
721
+ t2[v] = tryDecode(c, s);
722
+ }
723
+ }
724
+ return t2;
725
+ }
726
+ function serialize(e2, r2, i2) {
727
+ var a2 = i2 || {};
728
+ var o = a2.encode || t;
729
+ if (typeof o !== "function") {
730
+ throw new TypeError("option encode is invalid");
731
+ }
732
+ if (!n.test(e2)) {
733
+ throw new TypeError("argument name is invalid");
734
+ }
735
+ var s = o(r2);
736
+ if (s && !n.test(s)) {
737
+ throw new TypeError("argument val is invalid");
738
+ }
739
+ var p = e2 + "=" + s;
740
+ if (null != a2.maxAge) {
741
+ var f = a2.maxAge - 0;
742
+ if (isNaN(f) || !isFinite(f)) {
743
+ throw new TypeError("option maxAge is invalid");
744
+ }
745
+ p += "; Max-Age=" + Math.floor(f);
746
+ }
747
+ if (a2.domain) {
748
+ if (!n.test(a2.domain)) {
749
+ throw new TypeError("option domain is invalid");
750
+ }
751
+ p += "; Domain=" + a2.domain;
752
+ }
753
+ if (a2.path) {
754
+ if (!n.test(a2.path)) {
755
+ throw new TypeError("option path is invalid");
756
+ }
757
+ p += "; Path=" + a2.path;
758
+ }
759
+ if (a2.expires) {
760
+ if (typeof a2.expires.toUTCString !== "function") {
761
+ throw new TypeError("option expires is invalid");
762
+ }
763
+ p += "; Expires=" + a2.expires.toUTCString();
764
+ }
765
+ if (a2.httpOnly) {
766
+ p += "; HttpOnly";
767
+ }
768
+ if (a2.secure) {
769
+ p += "; Secure";
770
+ }
771
+ if (a2.sameSite) {
772
+ var u = typeof a2.sameSite === "string" ? a2.sameSite.toLowerCase() : a2.sameSite;
773
+ switch (u) {
774
+ case true:
775
+ p += "; SameSite=Strict";
776
+ break;
777
+ case "lax":
778
+ p += "; SameSite=Lax";
779
+ break;
780
+ case "strict":
781
+ p += "; SameSite=Strict";
782
+ break;
783
+ case "none":
784
+ p += "; SameSite=None";
785
+ break;
786
+ default:
787
+ throw new TypeError("option sameSite is invalid");
788
+ }
789
+ }
790
+ return p;
791
+ }
792
+ function tryDecode(e2, r2) {
793
+ try {
794
+ return r2(e2);
795
+ } catch (r3) {
796
+ return e2;
797
+ }
798
+ }
799
+ })();
800
+ module2.exports = e;
801
+ })();
802
+ }
803
+ });
804
+
805
+ // ../../../../node_modules/next/dist/server/web/spec-extension/cookies.js
806
+ var require_cookies = __commonJS({
807
+ "../../../../node_modules/next/dist/server/web/spec-extension/cookies.js"(exports) {
808
+ "use strict";
809
+ Object.defineProperty(exports, "__esModule", {
810
+ value: true
811
+ });
812
+ var _cookie = _interopRequireDefault(require_cookie());
813
+ function _interopRequireDefault(obj) {
814
+ return obj && obj.__esModule ? obj : {
815
+ default: obj
816
+ };
817
+ }
818
+ var normalizeCookieOptions = (options) => {
819
+ options = Object.assign({}, options);
820
+ if (options.maxAge) {
821
+ options.expires = new Date(Date.now() + options.maxAge * 1e3);
822
+ }
823
+ if (options.path == null) {
824
+ options.path = "/";
825
+ }
826
+ return options;
827
+ };
828
+ var serializeValue = (value) => typeof value === "object" ? `j:${JSON.stringify(value)}` : String(value);
829
+ var serializeExpiredCookie = (key, options = {}) => _cookie.default.serialize(key, "", {
830
+ expires: /* @__PURE__ */ new Date(0),
831
+ path: "/",
832
+ ...options
833
+ });
834
+ var deserializeCookie = (input) => {
835
+ const value = input.headers.get("set-cookie");
836
+ return value !== void 0 && value !== null ? value.split(", ") : [];
837
+ };
838
+ var serializeCookie = (input) => input.join(", ");
839
+ var Cookies = class extends Map {
840
+ constructor(input) {
841
+ const parsedInput = typeof input === "string" ? _cookie.default.parse(input) : {};
842
+ super(Object.entries(parsedInput));
843
+ }
844
+ set(key, value, options = {}) {
845
+ return super.set(key, _cookie.default.serialize(key, serializeValue(value), normalizeCookieOptions(options)));
846
+ }
847
+ [Symbol.for("edge-runtime.inspect.custom")]() {
848
+ return Object.fromEntries(this.entries());
849
+ }
850
+ };
851
+ exports.Cookies = Cookies;
852
+ var NextCookies = class extends Cookies {
853
+ constructor(response) {
854
+ super(response.headers.get("cookie"));
855
+ __publicField(this, "get", (...args) => {
856
+ return this.getWithOptions(...args).value;
857
+ });
858
+ __publicField(this, "getWithOptions", (...args) => {
859
+ const raw = super.get(...args);
860
+ if (typeof raw !== "string")
861
+ return {
862
+ value: raw,
863
+ options: {}
864
+ };
865
+ const { [args[0]]: value, ...options } = _cookie.default.parse(raw);
866
+ return {
867
+ value,
868
+ options
869
+ };
870
+ });
871
+ __publicField(this, "set", (...args) => {
872
+ const isAlreadyAdded = super.has(args[0]);
873
+ super.set(...args);
874
+ const currentCookie = super.get(args[0]);
875
+ if (typeof currentCookie !== "string") {
876
+ throw new Error(`Invariant: failed to generate cookie for ${JSON.stringify(args)}`);
877
+ }
878
+ if (isAlreadyAdded) {
879
+ const setCookie = serializeCookie(deserializeCookie(this.response).filter((value) => !value.startsWith(`${args[0]}=`)));
880
+ if (setCookie) {
881
+ this.response.headers.set("set-cookie", [
882
+ currentCookie,
883
+ setCookie
884
+ ].join(", "));
885
+ } else {
886
+ this.response.headers.set("set-cookie", currentCookie);
887
+ }
888
+ } else {
889
+ this.response.headers.append("set-cookie", currentCookie);
890
+ }
891
+ return this;
892
+ });
893
+ __publicField(this, "delete", (key, options = {}) => {
894
+ const isDeleted = super.delete(key);
895
+ if (isDeleted) {
896
+ const setCookie = serializeCookie(deserializeCookie(this.response).filter((value) => !value.startsWith(`${key}=`)));
897
+ const expiredCookie = serializeExpiredCookie(key, options);
898
+ this.response.headers.set("set-cookie", [
899
+ expiredCookie,
900
+ setCookie
901
+ ].join(", "));
902
+ }
903
+ return isDeleted;
904
+ });
905
+ __publicField(this, "clear", (options = {}) => {
906
+ const expiredCookies = Array.from(super.keys()).map((key) => serializeExpiredCookie(key, options)).join(", ");
907
+ if (expiredCookies)
908
+ this.response.headers.set("set-cookie", expiredCookies);
909
+ return super.clear();
910
+ });
911
+ this.response = response;
912
+ }
913
+ };
914
+ exports.NextCookies = NextCookies;
915
+ }
916
+ });
917
+
918
+ // ../../../../node_modules/next/dist/server/web/spec-extension/request.js
919
+ var require_request = __commonJS({
920
+ "../../../../node_modules/next/dist/server/web/spec-extension/request.js"(exports) {
921
+ "use strict";
922
+ Object.defineProperty(exports, "__esModule", {
923
+ value: true
924
+ });
925
+ exports.INTERNALS = void 0;
926
+ var _nextUrl = require_next_url();
927
+ var _utils = require_utils();
928
+ var _error = require_error();
929
+ var _cookies = require_cookies();
930
+ var INTERNALS = Symbol("internal request");
931
+ exports.INTERNALS = INTERNALS;
932
+ var NextRequest2 = class extends Request {
933
+ constructor(input, init = {}) {
934
+ const url = typeof input !== "string" && "url" in input ? input.url : String(input);
935
+ (0, _utils).validateURL(url);
936
+ super(url, init);
937
+ this[INTERNALS] = {
938
+ cookies: new _cookies.NextCookies(this),
939
+ geo: init.geo || {},
940
+ ip: init.ip,
941
+ url: new _nextUrl.NextURL(url, {
942
+ headers: (0, _utils).toNodeHeaders(this.headers),
943
+ nextConfig: init.nextConfig
944
+ })
945
+ };
946
+ }
947
+ [Symbol.for("edge-runtime.inspect.custom")]() {
948
+ return {
949
+ cookies: this.cookies,
950
+ geo: this.geo,
951
+ ip: this.ip,
952
+ nextUrl: this.nextUrl,
953
+ url: this.url,
954
+ // rest of props come from Request
955
+ bodyUsed: this.bodyUsed,
956
+ cache: this.cache,
957
+ credentials: this.credentials,
958
+ destination: this.destination,
959
+ headers: Object.fromEntries(this.headers),
960
+ integrity: this.integrity,
961
+ keepalive: this.keepalive,
962
+ method: this.method,
963
+ mode: this.mode,
964
+ redirect: this.redirect,
965
+ referrer: this.referrer,
966
+ referrerPolicy: this.referrerPolicy,
967
+ signal: this.signal
968
+ };
969
+ }
970
+ get cookies() {
971
+ return this[INTERNALS].cookies;
972
+ }
973
+ get geo() {
974
+ return this[INTERNALS].geo;
975
+ }
976
+ get ip() {
977
+ return this[INTERNALS].ip;
978
+ }
979
+ get nextUrl() {
980
+ return this[INTERNALS].url;
981
+ }
982
+ /**
983
+ * @deprecated
984
+ * `page` has been deprecated in favour of `URLPattern`.
985
+ * Read more: https://nextjs.org/docs/messages/middleware-request-page
986
+ */
987
+ get page() {
988
+ throw new _error.RemovedPageError();
989
+ }
990
+ /**
991
+ * @deprecated
992
+ * `ua` has been removed in favour of \`userAgent\` function.
993
+ * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
994
+ */
995
+ get ua() {
996
+ throw new _error.RemovedUAError();
997
+ }
998
+ get url() {
999
+ return this[INTERNALS].url.toString();
1000
+ }
1001
+ };
1002
+ exports.NextRequest = NextRequest2;
1003
+ }
1004
+ });
1005
+
1006
+ // ../../../../node_modules/next/dist/server/web/spec-extension/response.js
1007
+ var require_response = __commonJS({
1008
+ "../../../../node_modules/next/dist/server/web/spec-extension/response.js"(exports) {
1009
+ "use strict";
1010
+ Object.defineProperty(exports, "__esModule", {
1011
+ value: true
1012
+ });
1013
+ var _nextUrl = require_next_url();
1014
+ var _utils = require_utils();
1015
+ var _cookies = require_cookies();
1016
+ var INTERNALS = Symbol("internal response");
1017
+ var REDIRECTS = /* @__PURE__ */ new Set([
1018
+ 301,
1019
+ 302,
1020
+ 303,
1021
+ 307,
1022
+ 308
1023
+ ]);
1024
+ var NextResponse2 = class extends Response {
1025
+ constructor(body, init = {}) {
1026
+ super(body, init);
1027
+ this[INTERNALS] = {
1028
+ cookies: new _cookies.NextCookies(this),
1029
+ url: init.url ? new _nextUrl.NextURL(init.url, {
1030
+ headers: (0, _utils).toNodeHeaders(this.headers),
1031
+ nextConfig: init.nextConfig
1032
+ }) : void 0
1033
+ };
1034
+ }
1035
+ [Symbol.for("edge-runtime.inspect.custom")]() {
1036
+ return {
1037
+ cookies: this.cookies,
1038
+ url: this.url,
1039
+ // rest of props come from Response
1040
+ body: this.body,
1041
+ bodyUsed: this.bodyUsed,
1042
+ headers: Object.fromEntries(this.headers),
1043
+ ok: this.ok,
1044
+ redirected: this.redirected,
1045
+ status: this.status,
1046
+ statusText: this.statusText,
1047
+ type: this.type
1048
+ };
1049
+ }
1050
+ get cookies() {
1051
+ return this[INTERNALS].cookies;
1052
+ }
1053
+ static json(body, init) {
1054
+ const response = Response.json(body, init);
1055
+ return new NextResponse2(response.body, response);
1056
+ }
1057
+ static redirect(url, init) {
1058
+ var ref;
1059
+ const status = typeof init === "number" ? init : (ref = init == null ? void 0 : init.status) != null ? ref : 307;
1060
+ if (!REDIRECTS.has(status)) {
1061
+ throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
1062
+ }
1063
+ const initObj = typeof init === "object" ? init : {};
1064
+ const headers = new Headers(initObj == null ? void 0 : initObj.headers);
1065
+ headers.set("Location", (0, _utils).validateURL(url));
1066
+ return new NextResponse2(null, {
1067
+ ...initObj,
1068
+ headers,
1069
+ status
1070
+ });
1071
+ }
1072
+ static rewrite(destination, init) {
1073
+ const headers = new Headers(init == null ? void 0 : init.headers);
1074
+ headers.set("x-middleware-rewrite", (0, _utils).validateURL(destination));
1075
+ return new NextResponse2(null, {
1076
+ ...init,
1077
+ headers
1078
+ });
1079
+ }
1080
+ static next(init) {
1081
+ const headers = new Headers(init == null ? void 0 : init.headers);
1082
+ headers.set("x-middleware-next", "1");
1083
+ return new NextResponse2(null, {
1084
+ ...init,
1085
+ headers
1086
+ });
1087
+ }
1088
+ };
1089
+ exports.NextResponse = NextResponse2;
1090
+ }
1091
+ });
1092
+
1093
+ // ../../../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js
1094
+ var require_ua_parser = __commonJS({
1095
+ "../../../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js"(exports, module2) {
1096
+ (() => {
1097
+ var i = { 412: function(i2, s2) {
1098
+ (function(e2, o) {
1099
+ "use strict";
1100
+ var r = "0.7.28", a = "", n = "?", t = "function", l = "undefined", w = "object", d = "string", b = "major", u = "model", c = "name", m = "type", p = "vendor", f = "version", h = "architecture", g = "console", v = "mobile", x = "tablet", k = "smarttv", _ = "wearable", y = "embedded", S = 255;
1101
+ var E = { extend: function(i3, s3) {
1102
+ var e3 = {};
1103
+ for (var o2 in i3) {
1104
+ if (s3[o2] && s3[o2].length % 2 === 0) {
1105
+ e3[o2] = s3[o2].concat(i3[o2]);
1106
+ } else {
1107
+ e3[o2] = i3[o2];
1108
+ }
1109
+ }
1110
+ return e3;
1111
+ }, has: function(i3, s3) {
1112
+ return typeof i3 === d ? s3.toLowerCase().indexOf(i3.toLowerCase()) !== -1 : false;
1113
+ }, lowerize: function(i3) {
1114
+ return i3.toLowerCase();
1115
+ }, major: function(i3) {
1116
+ return typeof i3 === d ? i3.replace(/[^\d\.]/g, "").split(".")[0] : o;
1117
+ }, trim: function(i3, s3) {
1118
+ i3 = i3.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1119
+ return typeof s3 === l ? i3 : i3.substring(0, S);
1120
+ } };
1121
+ var A = { rgx: function(i3, s3) {
1122
+ var e3 = 0, r2, a2, n2, l2, d2, b2;
1123
+ while (e3 < s3.length && !d2) {
1124
+ var u2 = s3[e3], c2 = s3[e3 + 1];
1125
+ r2 = a2 = 0;
1126
+ while (r2 < u2.length && !d2) {
1127
+ d2 = u2[r2++].exec(i3);
1128
+ if (!!d2) {
1129
+ for (n2 = 0; n2 < c2.length; n2++) {
1130
+ b2 = d2[++a2];
1131
+ l2 = c2[n2];
1132
+ if (typeof l2 === w && l2.length > 0) {
1133
+ if (l2.length == 2) {
1134
+ if (typeof l2[1] == t) {
1135
+ this[l2[0]] = l2[1].call(this, b2);
1136
+ } else {
1137
+ this[l2[0]] = l2[1];
1138
+ }
1139
+ } else if (l2.length == 3) {
1140
+ if (typeof l2[1] === t && !(l2[1].exec && l2[1].test)) {
1141
+ this[l2[0]] = b2 ? l2[1].call(this, b2, l2[2]) : o;
1142
+ } else {
1143
+ this[l2[0]] = b2 ? b2.replace(l2[1], l2[2]) : o;
1144
+ }
1145
+ } else if (l2.length == 4) {
1146
+ this[l2[0]] = b2 ? l2[3].call(this, b2.replace(l2[1], l2[2])) : o;
1147
+ }
1148
+ } else {
1149
+ this[l2] = b2 ? b2 : o;
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+ e3 += 2;
1155
+ }
1156
+ }, str: function(i3, s3) {
1157
+ for (var e3 in s3) {
1158
+ if (typeof s3[e3] === w && s3[e3].length > 0) {
1159
+ for (var r2 = 0; r2 < s3[e3].length; r2++) {
1160
+ if (E.has(s3[e3][r2], i3)) {
1161
+ return e3 === n ? o : e3;
1162
+ }
1163
+ }
1164
+ } else if (E.has(s3[e3], i3)) {
1165
+ return e3 === n ? o : e3;
1166
+ }
1167
+ }
1168
+ return i3;
1169
+ } };
1170
+ var N = { browser: { oldSafari: { version: { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" } }, oldEdge: { version: { 0.1: "12.", 21: "13.", 31: "14.", 39: "15.", 41: "16.", 42: "17.", 44: "18." } } }, os: { windows: { version: { 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" } } } };
1171
+ var T = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [f, [c, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [f, [c, "Edge"]], [/(opera\smini)\/([\w\.-]+)/i, /(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i, /(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i], [c, f], [/opios[\/\s]+([\w\.]+)/i], [f, [c, "Opera Mini"]], [/\sopr\/([\w\.]+)/i], [f, [c, "Opera"]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i, /(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i, /(ba?idubrowser)[\/\s]?([\w\.]+)/i, /(?:ms|\()(ie)\s([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i, /(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i, /(weibo)__([\d\.]+)/i], [c, f], [/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i], [f, [c, "UCBrowser"]], [/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i], [f, [c, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [f, [c, "WeChat"]], [/konqueror\/([\w\.]+)/i], [f, [c, "Konqueror"]], [/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i], [f, [c, "IE"]], [/yabrowser\/([\w\.]+)/i], [f, [c, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[c, /(.+)/, "$1 Secure Browser"], f], [/focus\/([\w\.]+)/i], [f, [c, "Firefox Focus"]], [/opt\/([\w\.]+)/i], [f, [c, "Opera Touch"]], [/coc_coc_browser\/([\w\.]+)/i], [f, [c, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [f, [c, "Dolphin"]], [/coast\/([\w\.]+)/i], [f, [c, "Opera Coast"]], [/xiaomi\/miuibrowser\/([\w\.]+)/i], [f, [c, "MIUI Browser"]], [/fxios\/([\w\.-]+)/i], [f, [c, "Firefox"]], [/(qihu|qhbrowser|qihoobrowser|360browser)/i], [[c, "360 Browser"]], [/(oculus|samsung|sailfish)browser\/([\w\.]+)/i], [[c, /(.+)/, "$1 Browser"], f], [/(comodo_dragon)\/([\w\.]+)/i], [[c, /_/g, " "], f], [/\s(electron)\/([\w\.]+)\ssafari/i, /(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i], [c, f], [/(MetaSr)[\/\s]?([\w\.]+)/i, /(LBBROWSER)/i], [c], [/;fbav\/([\w\.]+);/i], [f, [c, "Facebook"]], [/FBAN\/FBIOS|FB_IAB\/FB4A/i], [[c, "Facebook"]], [/safari\s(line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/\s]([\w\.-]+)/i], [c, f], [/\bgsa\/([\w\.]+)\s.*safari\//i], [f, [c, "GSA"]], [/headlesschrome(?:\/([\w\.]+)|\s)/i], [f, [c, "Chrome Headless"]], [/\swv\).+(chrome)\/([\w\.]+)/i], [[c, "Chrome WebView"], f], [/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i], [f, [c, "Android Browser"]], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i], [c, f], [/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i], [f, [c, "Mobile Safari"]], [/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i], [f, c], [/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i], [c, [f, A.str, N.browser.oldSafari.version]], [/(webkit|khtml)\/([\w\.]+)/i], [c, f], [/(navigator|netscape)\/([\w\.-]+)/i], [[c, "Netscape"], f], [/ile\svr;\srv:([\w\.]+)\).+firefox/i], [f, [c, "Firefox Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, /(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i, /(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, /(links)\s\(([\w\.]+)/i, /(gobrowser)\/?([\w\.]*)/i, /(ice\s?browser)\/v?([\w\._]+)/i, /(mosaic)[\/\s]([\w\.]+)/i], [c, f]], cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[h, "amd64"]], [/(ia32(?=;))/i], [[h, E.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[h, "ia32"]], [/\b(aarch64|armv?8e?l?)\b/i], [[h, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[h, "armhf"]], [/windows\s(ce|mobile);\sppc;/i], [[h, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[h, /ower/, "", E.lowerize]], [/(sun4\w)[;\)]/i], [[h, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[h, E.lowerize]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i], [u, [p, "Samsung"], [m, x]], [/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i, /\ssamsung[\s-]([\w-]+)/i, /sec-(sgh\w+)/i], [u, [p, "Samsung"], [m, v]], [/\((ip(?:hone|od)[\s\w]*);/i], [u, [p, "Apple"], [m, v]], [/\((ipad);[\w\s\),;-]+apple/i, /applecoremedia\/[\w\.]+\s\((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [u, [p, "Apple"], [m, x]], [/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i], [u, [p, "Huawei"], [m, x]], [/d\/huawei([\w\s-]+)[;\)]/i, /\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i, /\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i], [u, [p, "Huawei"], [m, v]], [/\b(poco[\s\w]+)(?:\sbuild|\))/i, /\b;\s(\w+)\sbuild\/hm\1/i, /\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i, /\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i, /\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i], [[u, /_/g, " "], [p, "Xiaomi"], [m, v]], [/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i], [[u, /_/g, " "], [p, "Xiaomi"], [m, x]], [/;\s(\w+)\sbuild.+\soppo/i, /\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i], [u, [p, "OPPO"], [m, v]], [/\svivo\s(\w+)(?:\sbuild|\))/i, /\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i], [u, [p, "Vivo"], [m, v]], [/\s(rmx[12]\d{3})(?:\sbuild|;)/i], [u, [p, "Realme"], [m, v]], [/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i, /\smot(?:orola)?[\s-](\w*)/i, /((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i], [u, [p, "Motorola"], [m, v]], [/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i], [u, [p, "Motorola"], [m, x]], [/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i], [u, [p, "LG"], [m, x]], [/(lm-?f100[nv]?|nexus\s[45])/i, /lg[e;\s\/-]+((?!browser|netcast)\w+)/i, /\blg(\-?[\d\w]+)\sbuild/i], [u, [p, "LG"], [m, v]], [/(ideatab[\w\-\s]+)/i, /lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i], [u, [p, "Lenovo"], [m, x]], [/(?:maemo|nokia).*(n900|lumia\s\d+)/i, /nokia[\s_-]?([\w\.-]*)/i], [[u, /_/g, " "], [p, "Nokia"], [m, v]], [/droid.+;\s(pixel\sc)[\s)]/i], [u, [p, "Google"], [m, x]], [/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i], [u, [p, "Google"], [m, v]], [/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [u, [p, "Sony"], [m, v]], [/sony\stablet\s[ps]\sbuild\//i, /(?:sony)?sgp\w+(?:\sbuild\/|\))/i], [[u, "Xperia Tablet"], [p, "Sony"], [m, x]], [/\s(kb2005|in20[12]5|be20[12][59])\b/i, /\ba000(1)\sbuild/i, /\boneplus\s(a\d{4})[\s)]/i], [u, [p, "OnePlus"], [m, v]], [/(alexa)webm/i, /(kf[a-z]{2}wi)(\sbuild\/|\))/i, /(kf[a-z]+)(\sbuild\/|\)).+silk\//i], [u, [p, "Amazon"], [m, x]], [/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i], [[u, "Fire Phone"], [p, "Amazon"], [m, v]], [/\((playbook);[\w\s\),;-]+(rim)/i], [u, p, [m, x]], [/((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10;\s(\w+)/i], [u, [p, "BlackBerry"], [m, v]], [/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i], [u, [p, "ASUS"], [m, x]], [/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i], [u, [p, "ASUS"], [m, v]], [/(nexus\s9)/i], [u, [p, "HTC"], [m, x]], [/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i, /(zte)-(\w*)/i, /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i], [p, [u, /_/g, " "], [m, v]], [/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i], [u, [p, "Acer"], [m, x]], [/droid.+;\s(m[1-5]\snote)\sbuild/i, /\bmz-([\w-]{2,})/i], [u, [p, "Meizu"], [m, v]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i, /(microsoft);\s(lumia[\s\w]+)/i, /(lenovo)[_\s-]?([\w-]+)/i, /linux;.+(jolla);/i, /droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i], [p, u, [m, v]], [/(archos)\s(gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i, /[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i, /[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i, /\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i, /\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i], [p, u, [m, x]], [/\s(surface\sduo)\s/i], [u, [p, "Microsoft"], [m, x]], [/droid\s[\d\.]+;\s(fp\du?)\sbuild/i], [u, [p, "Fairphone"], [m, v]], [/\s(u304aa)\sbuild/i], [u, [p, "AT&T"], [m, v]], [/sie-(\w*)/i], [u, [p, "Siemens"], [m, v]], [/[;\/]\s?(rct\w+)\sbuild/i], [u, [p, "RCA"], [m, x]], [/[;\/\s](venue[\d\s]{2,7})\sbuild/i], [u, [p, "Dell"], [m, x]], [/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i], [u, [p, "Verizon"], [m, x]], [/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i], [u, [p, "Barnes & Noble"], [m, x]], [/[;\/]\s(tm\d{3}\w+)\sbuild/i], [u, [p, "NuVision"], [m, x]], [/;\s(k88)\sbuild/i], [u, [p, "ZTE"], [m, x]], [/;\s(nx\d{3}j)\sbuild/i], [u, [p, "ZTE"], [m, v]], [/[;\/]\s?(gen\d{3})\sbuild.*49h/i], [u, [p, "Swiss"], [m, v]], [/[;\/]\s?(zur\d{3})\sbuild/i], [u, [p, "Swiss"], [m, x]], [/[;\/]\s?((zeki)?tb.*\b)\sbuild/i], [u, [p, "Zeki"], [m, x]], [/[;\/]\s([yr]\d{2})\sbuild/i, /[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i], [[p, "Dragon Touch"], u, [m, x]], [/[;\/]\s?(ns-?\w{0,9})\sbuild/i], [u, [p, "Insignia"], [m, x]], [/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i], [u, [p, "NextBook"], [m, x]], [/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i], [[p, "Voice"], u, [m, v]], [/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i], [[p, "LvTel"], u, [m, v]], [/;\s(ph-1)\s/i], [u, [p, "Essential"], [m, v]], [/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i], [u, [p, "Envizen"], [m, x]], [/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i], [u, [p, "MachSpeed"], [m, x]], [/[;\/]\s?tu_(1491)\sbuild/i], [u, [p, "Rotor"], [m, x]], [/(shield[\w\s]+)\sbuild/i], [u, [p, "Nvidia"], [m, x]], [/(sprint)\s(\w+)/i], [p, u, [m, v]], [/(kin\.[onetw]{3})/i], [[u, /\./g, " "], [p, "Microsoft"], [m, v]], [/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [u, [p, "Zebra"], [m, x]], [/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i], [u, [p, "Zebra"], [m, v]], [/\s(ouya)\s/i, /(nintendo)\s([wids3utch]+)/i], [p, u, [m, g]], [/droid.+;\s(shield)\sbuild/i], [u, [p, "Nvidia"], [m, g]], [/(playstation\s[345portablevi]+)/i], [u, [p, "Sony"], [m, g]], [/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i], [u, [p, "Microsoft"], [m, g]], [/smart-tv.+(samsung)/i], [p, [m, k]], [/hbbtv.+maple;(\d+)/i], [[u, /^/, "SmartTV"], [p, "Samsung"], [m, k]], [/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i], [[p, "LG"], [m, k]], [/(apple)\s?tv/i], [p, [u, "Apple TV"], [m, k]], [/crkey/i], [[u, "Chromecast"], [p, "Google"], [m, k]], [/droid.+aft([\w])(\sbuild\/|\))/i], [u, [p, "Amazon"], [m, k]], [/\(dtv[\);].+(aquos)/i], [u, [p, "Sharp"], [m, k]], [/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i], [[p, E.trim], [u, E.trim], [m, k]], [/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i], [[m, k]], [/((pebble))app\/[\d\.]+\s/i], [p, u, [m, _]], [/droid.+;\s(glass)\s\d/i], [u, [p, "Google"], [m, _]], [/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i], [u, [p, "Zebra"], [m, _]], [/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i], [p, [m, y]], [/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i], [u, [m, v]], [/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i], [u, [m, x]], [/\s(tablet|tab)[;\/]/i, /\s(mobile)(?:[;\/]|\ssafari)/i], [[m, E.lowerize]], [/(android[\w\.\s\-]{0,9});.+build/i], [u, [p, "Generic"]], [/(phone)/i], [[m, v]]], engine: [[/windows.+\sedge\/([\w\.]+)/i], [f, [c, "EdgeHTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [f, [c, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [c, f], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [f, c]], os: [[/microsoft\s(windows)\s(vista|xp)/i], [c, f], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i], [c, [f, A.str, N.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[c, "Windows"], [f, A.str, N.os.windows.version]], [/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i, /cfnetwork\/.+darwin/i], [[f, /_/g, "."], [c, "iOS"]], [/(mac\sos\sx)\s?([\w\s\.]*)/i, /(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i], [[c, "Mac OS"], [f, /_/g, "."]], [/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/\s]([\w\.]+)/i, /\((series40);/i], [c, f], [/\(bb(10);/i], [f, [c, "BlackBerry"]], [/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i], [f, [c, "Symbian"]], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[c, "Firefox OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [f, [c, "webOS"]], [/crkey\/([\d\.]+)/i], [f, [c, "Chromecast"]], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[c, "Chromium OS"], f], [/(nintendo|playstation)\s([wids345portablevuch]+)/i, /(xbox);\s+xbox\s([^\);]+)/i, /(mint)[\/\s\(\)]?(\w*)/i, /(mageia|vectorlinux)[;\s]/i, /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i, /(hurd|linux)\s?([\w\.]*)/i, /(gnu)\s?([\w\.]*)/i, /\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku)\s(\w+)/i], [c, f], [/(sunos)\s?([\w\.\d]*)/i], [[c, "Solaris"], f], [/((?:open)?solaris)[\/\s-]?([\w\.]*)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i, /(unix)\s?([\w\.]*)/i], [c, f]] };
1172
+ var UAParser = function(i3, s3) {
1173
+ if (typeof i3 === "object") {
1174
+ s3 = i3;
1175
+ i3 = o;
1176
+ }
1177
+ if (!(this instanceof UAParser)) {
1178
+ return new UAParser(i3, s3).getResult();
1179
+ }
1180
+ var r2 = i3 || (typeof e2 !== "undefined" && e2.navigator && e2.navigator.userAgent ? e2.navigator.userAgent : a);
1181
+ var n2 = s3 ? E.extend(T, s3) : T;
1182
+ this.getBrowser = function() {
1183
+ var i4 = { name: o, version: o };
1184
+ A.rgx.call(i4, r2, n2.browser);
1185
+ i4.major = E.major(i4.version);
1186
+ return i4;
1187
+ };
1188
+ this.getCPU = function() {
1189
+ var i4 = { architecture: o };
1190
+ A.rgx.call(i4, r2, n2.cpu);
1191
+ return i4;
1192
+ };
1193
+ this.getDevice = function() {
1194
+ var i4 = { vendor: o, model: o, type: o };
1195
+ A.rgx.call(i4, r2, n2.device);
1196
+ return i4;
1197
+ };
1198
+ this.getEngine = function() {
1199
+ var i4 = { name: o, version: o };
1200
+ A.rgx.call(i4, r2, n2.engine);
1201
+ return i4;
1202
+ };
1203
+ this.getOS = function() {
1204
+ var i4 = { name: o, version: o };
1205
+ A.rgx.call(i4, r2, n2.os);
1206
+ return i4;
1207
+ };
1208
+ this.getResult = function() {
1209
+ return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
1210
+ };
1211
+ this.getUA = function() {
1212
+ return r2;
1213
+ };
1214
+ this.setUA = function(i4) {
1215
+ r2 = typeof i4 === d && i4.length > S ? E.trim(i4, S) : i4;
1216
+ return this;
1217
+ };
1218
+ this.setUA(r2);
1219
+ return this;
1220
+ };
1221
+ UAParser.VERSION = r;
1222
+ UAParser.BROWSER = { NAME: c, MAJOR: b, VERSION: f };
1223
+ UAParser.CPU = { ARCHITECTURE: h };
1224
+ UAParser.DEVICE = { MODEL: u, VENDOR: p, TYPE: m, CONSOLE: g, MOBILE: v, SMARTTV: k, TABLET: x, WEARABLE: _, EMBEDDED: y };
1225
+ UAParser.ENGINE = { NAME: c, VERSION: f };
1226
+ UAParser.OS = { NAME: c, VERSION: f };
1227
+ if (typeof s2 !== l) {
1228
+ if ("object" !== l && i2.exports) {
1229
+ s2 = i2.exports = UAParser;
1230
+ }
1231
+ s2.UAParser = UAParser;
1232
+ } else {
1233
+ if (typeof define === "function" && define.amd) {
1234
+ define(function() {
1235
+ return UAParser;
1236
+ });
1237
+ } else if (typeof e2 !== "undefined") {
1238
+ e2.UAParser = UAParser;
1239
+ }
1240
+ }
1241
+ var z = typeof e2 !== "undefined" && (e2.jQuery || e2.Zepto);
1242
+ if (z && !z.ua) {
1243
+ var O = new UAParser();
1244
+ z.ua = O.getResult();
1245
+ z.ua.get = function() {
1246
+ return O.getUA();
1247
+ };
1248
+ z.ua.set = function(i3) {
1249
+ O.setUA(i3);
1250
+ var s3 = O.getResult();
1251
+ for (var e3 in s3) {
1252
+ z.ua[e3] = s3[e3];
1253
+ }
1254
+ };
1255
+ }
1256
+ })(typeof window === "object" ? window : this);
1257
+ } };
1258
+ var s = {};
1259
+ function __nccwpck_require__2(e2) {
1260
+ var o = s[e2];
1261
+ if (o !== void 0) {
1262
+ return o.exports;
1263
+ }
1264
+ var r = s[e2] = { exports: {} };
1265
+ var a = true;
1266
+ try {
1267
+ i[e2].call(r.exports, r, r.exports, __nccwpck_require__2);
1268
+ a = false;
1269
+ } finally {
1270
+ if (a)
1271
+ delete s[e2];
1272
+ }
1273
+ return r.exports;
1274
+ }
1275
+ if (typeof __nccwpck_require__2 !== "undefined")
1276
+ __nccwpck_require__2.ab = __dirname + "/";
1277
+ var e = __nccwpck_require__2(412);
1278
+ module2.exports = e;
1279
+ })();
1280
+ }
1281
+ });
1282
+
1283
+ // ../../../../node_modules/next/dist/server/web/spec-extension/user-agent.js
1284
+ var require_user_agent = __commonJS({
1285
+ "../../../../node_modules/next/dist/server/web/spec-extension/user-agent.js"(exports) {
1286
+ "use strict";
1287
+ Object.defineProperty(exports, "__esModule", {
1288
+ value: true
1289
+ });
1290
+ exports.isBot = isBot;
1291
+ exports.userAgentFromString = userAgentFromString;
1292
+ exports.userAgent = userAgent;
1293
+ var _uaParserJs = _interopRequireDefault(require_ua_parser());
1294
+ function _interopRequireDefault(obj) {
1295
+ return obj && obj.__esModule ? obj : {
1296
+ default: obj
1297
+ };
1298
+ }
1299
+ function isBot(input) {
1300
+ return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|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(input);
1301
+ }
1302
+ function userAgentFromString(input) {
1303
+ return {
1304
+ ...(0, _uaParserJs).default(input),
1305
+ isBot: input === void 0 ? false : isBot(input)
1306
+ };
1307
+ }
1308
+ function userAgent({ headers }) {
1309
+ return userAgentFromString(headers.get("user-agent") || void 0);
1310
+ }
1311
+ }
1312
+ });
1313
+
1314
+ // ../../../../node_modules/next/server.js
1315
+ var require_server = __commonJS({
1316
+ "../../../../node_modules/next/server.js"(exports, module2) {
1317
+ var serverExports = {
1318
+ NextRequest: require_request().NextRequest,
1319
+ NextResponse: require_response().NextResponse,
1320
+ userAgentFromString: require_user_agent().userAgentFromString,
1321
+ userAgent: require_user_agent().userAgent
1322
+ };
1323
+ if (typeof URLPattern !== "undefined") {
1324
+ serverExports.URLPattern = URLPattern;
1325
+ }
1326
+ module2.exports = serverExports;
1327
+ exports.NextRequest = serverExports.NextRequest;
1328
+ exports.NextResponse = serverExports.NextResponse;
1329
+ exports.userAgentFromString = serverExports.userAgentFromString;
1330
+ exports.userAgent = serverExports.userAgent;
1331
+ exports.URLPattern = serverExports.URLPattern;
1332
+ }
1333
+ });
1334
+
1335
+ // src/index.ts
1336
+ var src_exports = {};
1337
+ __export(src_exports, {
1338
+ ApiService: () => ApiService,
1339
+ MockService: () => MockService,
1340
+ StoreStrategy: () => StoreStrategy,
1341
+ apiDelete: () => apiDelete,
1342
+ apiFetch: () => apiFetch,
1343
+ apiGet: () => apiGet,
1344
+ apiPatch: () => apiPatch,
1345
+ apiPost: () => apiPost,
1346
+ apiPut: () => apiPut,
1347
+ getApiBuildStore: () => getApiBuildStore,
1348
+ getApiRuntimeStore: () => getApiRuntimeStore,
1349
+ getApiStore: () => getApiStore,
1350
+ getMockStore: () => getMockStore,
1351
+ getStore: () => getStore,
1352
+ isApiRequest: () => isApiRequest,
1353
+ isExistingApiRoute: () => isExistingApiRoute,
1354
+ isNextRequest: () => isNextRequest,
1355
+ isStaticRequest: () => isStaticRequest,
1356
+ mockInterceptor: () => mockInterceptor,
1357
+ parseMockApi: () => parseMockApi,
1358
+ registerCollections: () => registerCollections,
1359
+ resolveMockApi: () => resolveMockApi,
1360
+ storeStrategy: () => storeStrategy
1361
+ });
1362
+ module.exports = __toCommonJS(src_exports);
1363
+
1364
+ // ../core/src/utils/index.ts
1365
+ function getIsDevelopment() {
1366
+ return process && (!process.env.NODE_ENV || process.env.NODE_ENV === "development");
1367
+ }
1368
+ var isDevelopment = getIsDevelopment();
1369
+ function merge(target, source) {
1370
+ if (source === null) {
1371
+ return source;
1372
+ }
1373
+ if (!target) {
1374
+ if (source && typeof source === "object") {
1375
+ return Object.assign({}, source);
1376
+ } else {
1377
+ return source;
1378
+ }
1379
+ }
1380
+ if (source && typeof source === "object") {
1381
+ Object.keys(source).forEach((key) => {
1382
+ const value = source[key];
1383
+ if (typeof value === "object" && !Array.isArray(value)) {
1384
+ target[key] = merge(target[key], value);
1385
+ } else {
1386
+ target[key] = value;
1387
+ }
1388
+ });
1389
+ }
1390
+ return target;
1391
+ }
1392
+
1393
+ // ../core/src/http/http.service.ts
1394
+ var defaultOptions = {
1395
+ // method: 'POST', // *GET, POST, PUT, DELETE, etc.
1396
+ // mode: 'cors', // no-cors, *cors, same-origin
1397
+ // cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
1398
+ // credentials: 'same-origin', // include, *same-origin, omit
1399
+ headers: {
1400
+ "Content-Type": "application/json"
1401
+ // 'Content-Type': 'application/x-www-form-urlencoded',
1402
+ }
1403
+ // redirect: 'follow', // manual, *follow, error
1404
+ // referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
1405
+ // body: JSON.stringify(data) // body data type must match 'Content-Type' header
1406
+ };
1407
+ async function httpFetch(url, options = {}, serviceOptions) {
1408
+ const httpOptions = merge({ ...defaultOptions }, options);
1409
+ const httpResponse = await fetch(url, httpOptions);
1410
+ if (!httpResponse.ok) {
1411
+ throw httpResponse;
1412
+ }
1413
+ const response = await httpResponse.json();
1414
+ return response;
1415
+ }
1416
+
1417
+ // ../core/src/json/json.service.ts
1418
+ var JsonService = class {
1419
+ constructor(items) {
1420
+ this.items = items;
1421
+ }
1422
+ // !!! todo accept QueryParams with where
1423
+ findOne(params) {
1424
+ return new Promise((resolve, reject) => {
1425
+ const items = this.whereItems_(this.items, params.where);
1426
+ if (items.length > 0) {
1427
+ resolve(this.decorator_(items[0], params));
1428
+ } else {
1429
+ resolve(void 0);
1430
+ }
1431
+ });
1432
+ }
1433
+ findMany(params = {}) {
1434
+ return new Promise((resolve, reject) => {
1435
+ let items = this.items;
1436
+ items = this.whereItems_(items, params.where);
1437
+ resolve(items.map((x) => this.decorator_(x, params)));
1438
+ });
1439
+ }
1440
+ create(payload) {
1441
+ return new Promise((resolve, reject) => {
1442
+ try {
1443
+ const item = { ...payload, id: this.newUUID_() };
1444
+ this.items.push(item);
1445
+ resolve(item);
1446
+ } catch (error) {
1447
+ reject(error);
1448
+ }
1449
+ });
1450
+ }
1451
+ update(payload) {
1452
+ return new Promise((resolve, reject) => {
1453
+ const index = this.items.reduce((p, c, i) => {
1454
+ return c.id === payload.id ? i : p;
1455
+ }, -1);
1456
+ if (index !== -1) {
1457
+ const item = { ...this.items[index], payload };
1458
+ this.items[index] = item;
1459
+ return resolve(item);
1460
+ }
1461
+ reject();
1462
+ });
1463
+ }
1464
+ delete(id) {
1465
+ return new Promise((resolve, reject) => {
1466
+ const index = this.items.reduce((p, c, i) => {
1467
+ return c.id === id ? i : p;
1468
+ }, -1);
1469
+ if (index !== -1) {
1470
+ const item = this.items[index];
1471
+ this.items.splice(index, 1);
1472
+ return resolve(item);
1473
+ }
1474
+ resolve(void 0);
1475
+ });
1476
+ }
1477
+ decorator_(item, params = {}) {
1478
+ return item;
1479
+ }
1480
+ newUUID_() {
1481
+ return (/* @__PURE__ */ new Date()).getTime();
1482
+ }
1483
+ // old where
1484
+ /*
1485
+ protected where_(items: any[], params: FindParams): any[] {
1486
+ const where = params.where;
1487
+ if (where) {
1488
+ const keys = Object.keys(where);
1489
+ items = items.filter(x => {
1490
+ return keys.reduce<boolean>((p, c) => {
1491
+ const whereValue = where[c];
1492
+ const shouldMatch = Array.isArray(whereValue) ? whereValue : [whereValue];
1493
+ // console.log('key', c, 'value', x[c], 'shouldMatch', shouldMatch);
1494
+ return p && (shouldMatch.indexOf(x[c]) !== -1);
1495
+ }, true);
1496
+ });
1497
+ }
1498
+ return items;
1499
+ }
1500
+ */
1501
+ // where
1502
+ evaluateValue_(value) {
1503
+ if (typeof value === "object" && value) {
1504
+ return value.id;
1505
+ } else {
1506
+ return value;
1507
+ }
1508
+ }
1509
+ existsClause_(value, exists) {
1510
+ if (typeof exists === "boolean") {
1511
+ return value != null === exists;
1512
+ }
1513
+ return true;
1514
+ }
1515
+ equalsClause_(value, equals) {
1516
+ if (typeof equals !== "undefined") {
1517
+ return this.evaluateValue_(value) === equals;
1518
+ }
1519
+ return true;
1520
+ }
1521
+ inClause_(value, values) {
1522
+ if (Array.isArray(values)) {
1523
+ return values.indexOf(this.evaluateValue_(value)) !== -1;
1524
+ }
1525
+ return true;
1526
+ }
1527
+ notInClause_(value, values) {
1528
+ if (Array.isArray(values)) {
1529
+ return values.indexOf(this.evaluateValue_(value)) === -1;
1530
+ }
1531
+ return true;
1532
+ }
1533
+ likeClause_(value, query) {
1534
+ if (typeof query === "string") {
1535
+ return String(value).toLowerCase().indexOf(query.toLowerCase()) !== -1;
1536
+ }
1537
+ return true;
1538
+ }
1539
+ whereItem_(item, where) {
1540
+ let has = true;
1541
+ if (typeof where === "object") {
1542
+ Object.entries(where).forEach(([k, v]) => {
1543
+ switch (k) {
1544
+ case "and":
1545
+ if (Array.isArray(v)) {
1546
+ has = v.reduce((p, c) => {
1547
+ return p && this.whereItem_(item, c);
1548
+ }, has);
1549
+ }
1550
+ break;
1551
+ case "or":
1552
+ if (Array.isArray(v)) {
1553
+ has = has && v.reduce((p, c) => {
1554
+ return p || this.whereItem_(item, c);
1555
+ }, false);
1556
+ }
1557
+ break;
1558
+ default:
1559
+ if (Array.isArray(v)) {
1560
+ } else if (typeof v === "object") {
1561
+ const value = item[k];
1562
+ has = has && this.existsClause_(value, v.exists);
1563
+ has = has && this.equalsClause_(value, v.equals);
1564
+ has = has && this.inClause_(value, v.in);
1565
+ has = has && this.notInClause_(value, v.not_in);
1566
+ has = has && this.likeClause_(value, v.like);
1567
+ }
1568
+ }
1569
+ });
1570
+ }
1571
+ return has;
1572
+ }
1573
+ whereItems_(items, where) {
1574
+ if (typeof where === "object") {
1575
+ items = items.filter((item) => this.whereItem_(item, where));
1576
+ }
1577
+ return items;
1578
+ }
1579
+ // ^ where
1580
+ };
1581
+
1582
+ // ../core/src/localized/localized.ts
1583
+ function isLocalizedString(value) {
1584
+ let isLocalizedString2 = false;
1585
+ if (value && !Array.isArray(value) && typeof value === "object") {
1586
+ const matchKeys = Object.keys(value).reduce((p, c) => p && /^(\w{2})(-\w{2})?$/.test(c), true);
1587
+ const matchValues = Object.values(value).reduce((p, c) => p && (typeof c === "string" || !c), true);
1588
+ isLocalizedString2 = Boolean(matchKeys && matchValues);
1589
+ }
1590
+ return isLocalizedString2;
1591
+ }
1592
+ function localizedToString(json, locale = "en", defaultLocale = "en") {
1593
+ const localizedString = json[locale] || json[defaultLocale] || Object.values(json)[0];
1594
+ return localizedString;
1595
+ }
1596
+ function localizeValue(value, locale = "en", defaultLocale = "en") {
1597
+ if (value) {
1598
+ if (isLocalizedString(value)) {
1599
+ return localizedToString(value, locale, defaultLocale);
1600
+ } else {
1601
+ return localizeItem(value, locale, defaultLocale);
1602
+ }
1603
+ }
1604
+ }
1605
+ function localizeItem(item, locale = "en", defaultLocale = "en") {
1606
+ if (Array.isArray(item)) {
1607
+ item = item.map((x) => localizeValue(x, locale, defaultLocale));
1608
+ } else if (typeof item === "object") {
1609
+ item = { ...item };
1610
+ Object.keys(item).forEach((key) => {
1611
+ item[key] = localizeValue(item[key], locale, defaultLocale);
1612
+ });
1613
+ }
1614
+ return item;
1615
+ }
1616
+
1617
+ // ../core/src/qs/qs.ts
1618
+ function serializeKey(key, parentKey = "") {
1619
+ return parentKey ? `${parentKey}[${key}]` : String(key);
1620
+ }
1621
+ function serializeParam(key, value, serializedParams = [], parentKey = "") {
1622
+ if (value != null) {
1623
+ if (typeof value === "object") {
1624
+ serializedParams = serializeParams(value, serializedParams, serializeKey(key, parentKey));
1625
+ } else {
1626
+ serializedParams.push({
1627
+ key: serializeKey(key, parentKey),
1628
+ value
1629
+ });
1630
+ }
1631
+ }
1632
+ return serializedParams;
1633
+ }
1634
+ function serializeParams(params, serializedParams = [], parentKey = "") {
1635
+ if (Array.isArray(params)) {
1636
+ params.forEach((value, key) => {
1637
+ serializedParams = serializeParam(key, value, serializedParams, parentKey);
1638
+ });
1639
+ } else {
1640
+ Object.entries(params).forEach(([key, value]) => {
1641
+ serializedParams = serializeParam(key, value, serializedParams, parentKey);
1642
+ });
1643
+ }
1644
+ return serializedParams;
1645
+ }
1646
+ function qsSerialize(queryParams = {}) {
1647
+ const params = serializeParams(queryParams);
1648
+ if (params.length) {
1649
+ return params.map((x) => `${x.key}=${x.value}`).join("&");
1650
+ }
1651
+ return "";
1652
+ }
1653
+
1654
+ // src/api/api.service.ts
1655
+ var STORE_API_URL = process.env.STORE_URL;
1656
+ var STORE_API_BASE = process.env.STORE_API;
1657
+ var STORE_BEARER = process.env.STORE_BEARER;
1658
+ var defaultStoreOptions = {
1659
+ // mode: 'cors',
1660
+ headers: {
1661
+ Authorization: `Bearer ${STORE_BEARER}`
1662
+ }
1663
+ };
1664
+ async function apiFetch(pathname, options = {}) {
1665
+ const url = `${STORE_API_URL}${STORE_API_BASE}${pathname}`;
1666
+ const apiOptions = merge({ ...defaultStoreOptions }, options);
1667
+ const apiResponse = await httpFetch(url, apiOptions);
1668
+ return apiResponse;
1669
+ }
1670
+ async function apiGet(url, options = {}) {
1671
+ return await apiFetch(url, { ...options, method: "GET" });
1672
+ }
1673
+ async function apiPost(url, payload, options = {}) {
1674
+ return await apiFetch(url, { ...options, method: "POST", body: JSON.stringify(payload) });
1675
+ }
1676
+ async function apiPut(url, payload, options = {}) {
1677
+ return await apiFetch(url, { ...options, method: "PUT", body: JSON.stringify(payload) });
1678
+ }
1679
+ async function apiPatch(url, payload, options = {}) {
1680
+ return await apiFetch(url, { ...options, method: "PATCH", body: JSON.stringify(payload) });
1681
+ }
1682
+ async function apiDelete(url, options = {}) {
1683
+ return await apiFetch(url, { ...options, method: "DELETE" });
1684
+ }
1685
+ var ApiService = class {
1686
+ constructor(key) {
1687
+ if (!key) {
1688
+ throw new Error("ApiService: key is required");
1689
+ }
1690
+ this.key = key;
1691
+ }
1692
+ async findOne(params = {}) {
1693
+ params.pagination = params.pagination || false;
1694
+ params.richText = params.richText || false;
1695
+ const query = qsSerialize(params);
1696
+ const search = query ? `?${query}` : "";
1697
+ const url = `/${this.key}${search}`;
1698
+ const response = await apiGet(url);
1699
+ const items = Array.isArray(response.docs) ? response.docs : response;
1700
+ const item = items.length ? items[0] : void 0;
1701
+ if (item) {
1702
+ return this.decorator_(item, params);
1703
+ }
1704
+ return;
1705
+ }
1706
+ async findMany(params = {}) {
1707
+ params.pagination = params.pagination || false;
1708
+ params.richText = params.richText || false;
1709
+ const query = qsSerialize(params);
1710
+ const search = query ? `?${query}` : "";
1711
+ const url = `/${this.key}${search}`;
1712
+ const response = await apiGet(url);
1713
+ const items = Array.isArray(response.docs) ? response.docs : response;
1714
+ return items.map((x) => this.decorator_(x, params));
1715
+ }
1716
+ async create(payload) {
1717
+ const url = `/${this.key}`;
1718
+ const item = await apiPost(url, payload);
1719
+ return this.decorator_(item);
1720
+ }
1721
+ async update(payload) {
1722
+ const url = `/${this.key}`;
1723
+ const item = await apiPut(url, payload);
1724
+ return this.decorator_(item);
1725
+ }
1726
+ async delete(id) {
1727
+ const params = {
1728
+ where: {
1729
+ id: {
1730
+ equals: id
1731
+ }
1732
+ }
1733
+ };
1734
+ const query = qsSerialize(params);
1735
+ const search = query ? `?${query}` : "";
1736
+ const url = `/${this.key}${search}`;
1737
+ const item = await apiDelete(url);
1738
+ return this.decorator_(item);
1739
+ }
1740
+ /*
1741
+ protected where_(items: any[], params: FindParams): any[] {
1742
+ const where = params.where;
1743
+ if (where) {
1744
+ const keys = Object.keys(where);
1745
+ items = items.filter(x => {
1746
+ return keys.reduce<boolean>((p, c) => {
1747
+ return p && (x[c] === where[c]);
1748
+ }, true);
1749
+ });
1750
+ }
1751
+ return items;
1752
+ }
1753
+ */
1754
+ decorator_(item, params = {}) {
1755
+ return item;
1756
+ }
1757
+ /*
1758
+ protected search_(params: QueryParams): string {
1759
+ const search: { [key: string]: string; } = {};
1760
+ Object.entries(params).forEach(([key, value]) => {
1761
+ if (typeof value !== 'object') {
1762
+ search[key] = value.toString();
1763
+ } else {
1764
+ switch (key) {
1765
+ case 'where':
1766
+ search[key] = JSON.stringify(value);
1767
+ }
1768
+ }
1769
+ });
1770
+ return Object.keys(search).length ? '?' + new URLSearchParams(search).toString() : '';
1771
+ }
1772
+ */
1773
+ };
1774
+
1775
+ // src/mock/mock.service.ts
1776
+ var MockService = class extends JsonService {
1777
+ /*
1778
+ findOne(params: QueryParams): Promise<T | undefined> {
1779
+ const query = qsSerialize(params);
1780
+ console.log('MockService.findOne', query);
1781
+ const deserialized = qsDeserialize(query);
1782
+ console.log('MockService.findOne', deserialized);
1783
+ return super.findOne(params);
1784
+ }
1785
+
1786
+ findMany(params: QueryParams = {}): Promise<T[]> {
1787
+ const query = qsSerialize(params);
1788
+ console.log('MockService.findMany', query);
1789
+ const deserialized = qsDeserialize(query);
1790
+ console.log('MockService.findMany', deserialized);
1791
+ return super.findMany(params);
1792
+ }
1793
+ */
1794
+ decorator_(item, params = {}) {
1795
+ if (params.locale) {
1796
+ return localizeItem(item, params.locale);
1797
+ } else {
1798
+ return item;
1799
+ }
1800
+ }
1801
+ };
1802
+
1803
+ // src/api/api.store.ts
1804
+ async function getApiStore(collections) {
1805
+ if (process.env.NEXT_PHASE === "phase-production-build") {
1806
+ return await getApiBuildStore();
1807
+ } else {
1808
+ return await getApiRuntimeStore(collections);
1809
+ }
1810
+ }
1811
+ var RUNTIME_STORE_;
1812
+ async function getApiRuntimeStore(collections) {
1813
+ if (RUNTIME_STORE_) {
1814
+ return RUNTIME_STORE_;
1815
+ }
1816
+ const store = {};
1817
+ collections.sort();
1818
+ collections.forEach((key) => {
1819
+ store[key] = new ApiService(key);
1820
+ });
1821
+ RUNTIME_STORE_ = store;
1822
+ return store;
1823
+ }
1824
+ var BUILD_STORE_;
1825
+ async function getApiBuildStore() {
1826
+ if (BUILD_STORE_) {
1827
+ return BUILD_STORE_;
1828
+ }
1829
+ const store = {};
1830
+ const url = "/store?pagination=true&richText=false";
1831
+ const json = await apiGet(url);
1832
+ if (json != null) {
1833
+ const collections = Object.keys(json);
1834
+ collections.sort();
1835
+ collections.forEach((key) => {
1836
+ if (json[key]) {
1837
+ store[key] = new MockService(json[key]);
1838
+ }
1839
+ });
1840
+ }
1841
+ BUILD_STORE_ = store;
1842
+ return store;
1843
+ }
1844
+
1845
+ // src/middleware/middleware.service.ts
1846
+ function isStaticRequest(request) {
1847
+ const url = request.nextUrl;
1848
+ const isStatic = url.pathname.indexOf(".") !== -1;
1849
+ return isStatic;
1850
+ }
1851
+ function isNextRequest(request) {
1852
+ const url = request.nextUrl;
1853
+ const isNext = url.pathname.indexOf("/_next/") === 0;
1854
+ return isNext;
1855
+ }
1856
+ function isApiRequest(request) {
1857
+ const url = request.nextUrl;
1858
+ const isApi = url.pathname.indexOf("/api") === 0;
1859
+ return isApi;
1860
+ }
1861
+ function isExistingApiRoute(request) {
1862
+ const rx = /^\/api\/(route|product|(product\/(.+))|(menu\/(.+)))\/?$/gm;
1863
+ const url = request.nextUrl;
1864
+ const isApi = url.pathname.indexOf("/api") === 0;
1865
+ const isExisting = isApi && rx.test(url.pathname);
1866
+ return isExisting;
1867
+ }
1868
+
1869
+ // src/fs/fs.service.ts
1870
+ var path = require("path");
1871
+ var fs = require("fs");
1872
+ async function fsRead(pathname, encoding = "utf8") {
1873
+ try {
1874
+ const data = await fs.promises.readFile(pathname, encoding);
1875
+ return data || null;
1876
+ } catch (error) {
1877
+ console.log("fsRead", error, pathname);
1878
+ return null;
1879
+ }
1880
+ }
1881
+ async function fsReadJson(pathname) {
1882
+ try {
1883
+ const data = await fsRead(pathname);
1884
+ if (data) {
1885
+ return JSON.parse(data);
1886
+ } else {
1887
+ return null;
1888
+ }
1889
+ } catch (error) {
1890
+ console.log("fsReadJson", error, pathname);
1891
+ return null;
1892
+ }
1893
+ }
1894
+ function pathJoin(...paths) {
1895
+ return path.join(process.cwd(), ...paths);
1896
+ }
1897
+
1898
+ // src/mock/mock.api.ts
1899
+ async function resolveMockApi(api) {
1900
+ const pathname = pathJoin(`${api}.json`);
1901
+ return await fsRead(pathname);
1902
+ }
1903
+ async function parseMockApi(api) {
1904
+ const pathname = pathJoin(`${api}.json`);
1905
+ return await fsReadJson(pathname);
1906
+ }
1907
+
1908
+ // src/mock/mock.interceptor.ts
1909
+ var import_server = __toESM(require_server());
1910
+
1911
+ // src/store/store.ts
1912
+ var StoreStrategy = /* @__PURE__ */ ((StoreStrategy2) => {
1913
+ StoreStrategy2["Api"] = "api";
1914
+ StoreStrategy2["Data"] = "data";
1915
+ StoreStrategy2["Mock"] = "mock";
1916
+ return StoreStrategy2;
1917
+ })(StoreStrategy || {});
1918
+ function getStoreStrategy() {
1919
+ let storeStrategy2 = "mock" /* Mock */;
1920
+ if (process && process.env.STORE_STRATEGY) {
1921
+ storeStrategy2 = process.env.STORE_STRATEGY;
1922
+ }
1923
+ return storeStrategy2;
1924
+ }
1925
+ var storeStrategy = getStoreStrategy();
1926
+
1927
+ // src/mock/mock.interceptor.ts
1928
+ async function mockInterceptor(request, next) {
1929
+ if (storeStrategy !== "mock" /* Mock */) {
1930
+ return;
1931
+ }
1932
+ if (!isExistingApiRoute(request)) {
1933
+ const url = request.nextUrl.clone();
1934
+ url.pathname = `/api/_mock/${encodeURIComponent(url.pathname)}`;
1935
+ const response = import_server.NextResponse.rewrite(url);
1936
+ return response;
1937
+ }
1938
+ return;
1939
+ }
1940
+
1941
+ // src/mock/mock.store.ts
1942
+ var path2 = require("path");
1943
+ var STORE_;
1944
+ async function getMockStore() {
1945
+ if (STORE_) {
1946
+ return STORE_;
1947
+ }
1948
+ const pathname = path2.join(process.cwd(), ".mixer", "store.json");
1949
+ const json = await fsReadJson(pathname);
1950
+ const store = {};
1951
+ if (json != null) {
1952
+ Object.keys(json).forEach((key) => {
1953
+ store[key] = new MockService(json[key]);
1954
+ });
1955
+ }
1956
+ STORE_ = store;
1957
+ return STORE_;
1958
+ }
1959
+
1960
+ // src/store/store.service.ts
1961
+ var CONFIG_ = {
1962
+ COLLECTIONS: []
1963
+ };
1964
+ function registerCollections(collections = []) {
1965
+ CONFIG_.COLLECTIONS = collections;
1966
+ }
1967
+ async function getStore() {
1968
+ switch (storeStrategy) {
1969
+ case "api" /* Api */:
1970
+ return await getApiStore(CONFIG_.COLLECTIONS);
1971
+ default:
1972
+ return await getMockStore();
1973
+ }
1974
+ }
1975
+ // Annotate the CommonJS export names for ESM import in node:
1976
+ 0 && (module.exports = {
1977
+ ApiService,
1978
+ MockService,
1979
+ StoreStrategy,
1980
+ apiDelete,
1981
+ apiFetch,
1982
+ apiGet,
1983
+ apiPatch,
1984
+ apiPost,
1985
+ apiPut,
1986
+ getApiBuildStore,
1987
+ getApiRuntimeStore,
1988
+ getApiStore,
1989
+ getMockStore,
1990
+ getStore,
1991
+ isApiRequest,
1992
+ isExistingApiRoute,
1993
+ isNextRequest,
1994
+ isStaticRequest,
1995
+ mockInterceptor,
1996
+ parseMockApi,
1997
+ registerCollections,
1998
+ resolveMockApi,
1999
+ storeStrategy
2000
+ });
2001
+ /*! Bundled license information:
2002
+
2003
+ next/dist/compiled/cookie/index.js:
2004
+ (*!
2005
+ * cookie
2006
+ * Copyright(c) 2012-2014 Roman Shtylman
2007
+ * Copyright(c) 2015 Douglas Christopher Wilson
2008
+ * MIT Licensed
2009
+ *)
2010
+
2011
+ next/dist/compiled/ua-parser-js/ua-parser.js:
2012
+ (*!@license
2013
+ * UAParser.js v0.7.28
2014
+ * Lightweight JavaScript-based User-Agent string parser
2015
+ * https://github.com/faisalman/ua-parser-js
2016
+ *
2017
+ * Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
2018
+ * Licensed under MIT License
2019
+ *)
2020
+ */