@feardread/feature-factory 2.0.5 → 3.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.
- package/.env +4 -0
- package/dist/bundle.min.js +10 -1
- package/dist/index.esm.js +19 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2486 -0
- package/package.json +32 -14
- package/rollup.config.mjs +63 -4
- package/src/factories/api.js +72 -0
- package/src/factories/api.ts +72 -0
- package/src/{cache → factories}/cache.js +7 -7
- package/src/factories/cache.ts +71 -0
- package/src/factories/factory.js +149 -0
- package/src/factories/factory.ts +158 -0
- package/src/factories/service.js +28 -0
- package/src/factories/service.ts +28 -0
- package/src/factories/state.js +10 -0
- package/src/factories/state.ts +10 -0
- package/src/factories/thunk.js +53 -0
- package/src/factories/thunk.ts +53 -0
- package/src/factory/api.js +72 -0
- package/src/factory/cache.js +71 -0
- package/src/factory/index.js +115 -0
- package/src/factory/service.js +28 -0
- package/src/factory/state.js +9 -0
- package/src/factory/thunk.js +53 -0
- package/src/index.js +4 -2
- package/src/index.ts +7 -0
- package/tsconfig.json +11 -0
- package/tsup.config.ts +9 -0
- package/src/api/factory.js +0 -80
- package/src/factory/factory.js +0 -130
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2486 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
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
|
+
|
|
33
|
+
// ../../node_modules/es-errors/index.js
|
|
34
|
+
var require_es_errors = __commonJS({
|
|
35
|
+
"../../node_modules/es-errors/index.js"(exports, module) {
|
|
36
|
+
"use strict";
|
|
37
|
+
module.exports = Error;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// ../../node_modules/es-errors/eval.js
|
|
42
|
+
var require_eval = __commonJS({
|
|
43
|
+
"../../node_modules/es-errors/eval.js"(exports, module) {
|
|
44
|
+
"use strict";
|
|
45
|
+
module.exports = EvalError;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// ../../node_modules/es-errors/range.js
|
|
50
|
+
var require_range = __commonJS({
|
|
51
|
+
"../../node_modules/es-errors/range.js"(exports, module) {
|
|
52
|
+
"use strict";
|
|
53
|
+
module.exports = RangeError;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// ../../node_modules/es-errors/ref.js
|
|
58
|
+
var require_ref = __commonJS({
|
|
59
|
+
"../../node_modules/es-errors/ref.js"(exports, module) {
|
|
60
|
+
"use strict";
|
|
61
|
+
module.exports = ReferenceError;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// ../../node_modules/es-errors/syntax.js
|
|
66
|
+
var require_syntax = __commonJS({
|
|
67
|
+
"../../node_modules/es-errors/syntax.js"(exports, module) {
|
|
68
|
+
"use strict";
|
|
69
|
+
module.exports = SyntaxError;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// ../../node_modules/es-errors/type.js
|
|
74
|
+
var require_type = __commonJS({
|
|
75
|
+
"../../node_modules/es-errors/type.js"(exports, module) {
|
|
76
|
+
"use strict";
|
|
77
|
+
module.exports = TypeError;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// ../../node_modules/es-errors/uri.js
|
|
82
|
+
var require_uri = __commonJS({
|
|
83
|
+
"../../node_modules/es-errors/uri.js"(exports, module) {
|
|
84
|
+
"use strict";
|
|
85
|
+
module.exports = URIError;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// ../../node_modules/has-symbols/shams.js
|
|
90
|
+
var require_shams = __commonJS({
|
|
91
|
+
"../../node_modules/has-symbols/shams.js"(exports, module) {
|
|
92
|
+
"use strict";
|
|
93
|
+
module.exports = function hasSymbols() {
|
|
94
|
+
if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (typeof Symbol.iterator === "symbol") {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
var obj = {};
|
|
101
|
+
var sym = Symbol("test");
|
|
102
|
+
var symObj = Object(sym);
|
|
103
|
+
if (typeof sym === "string") {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
var symVal = 42;
|
|
113
|
+
obj[sym] = symVal;
|
|
114
|
+
for (sym in obj) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
124
|
+
if (syms.length !== 1 || syms[0] !== sym) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
if (typeof Object.getOwnPropertyDescriptor === "function") {
|
|
131
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
|
132
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// ../../node_modules/has-symbols/index.js
|
|
142
|
+
var require_has_symbols = __commonJS({
|
|
143
|
+
"../../node_modules/has-symbols/index.js"(exports, module) {
|
|
144
|
+
"use strict";
|
|
145
|
+
var origSymbol = typeof Symbol !== "undefined" && Symbol;
|
|
146
|
+
var hasSymbolSham = require_shams();
|
|
147
|
+
module.exports = function hasNativeSymbols() {
|
|
148
|
+
if (typeof origSymbol !== "function") {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
if (typeof Symbol !== "function") {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if (typeof origSymbol("foo") !== "symbol") {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
if (typeof Symbol("bar") !== "symbol") {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
return hasSymbolSham();
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// ../../node_modules/has-proto/index.js
|
|
166
|
+
var require_has_proto = __commonJS({
|
|
167
|
+
"../../node_modules/has-proto/index.js"(exports, module) {
|
|
168
|
+
"use strict";
|
|
169
|
+
var test = {
|
|
170
|
+
__proto__: null,
|
|
171
|
+
foo: {}
|
|
172
|
+
};
|
|
173
|
+
var $Object = Object;
|
|
174
|
+
module.exports = function hasProto() {
|
|
175
|
+
return { __proto__: test }.foo === test.foo && !(test instanceof $Object);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// ../../node_modules/function-bind/implementation.js
|
|
181
|
+
var require_implementation = __commonJS({
|
|
182
|
+
"../../node_modules/function-bind/implementation.js"(exports, module) {
|
|
183
|
+
"use strict";
|
|
184
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
185
|
+
var toStr = Object.prototype.toString;
|
|
186
|
+
var max = Math.max;
|
|
187
|
+
var funcType = "[object Function]";
|
|
188
|
+
var concatty = function concatty2(a, b) {
|
|
189
|
+
var arr = [];
|
|
190
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
191
|
+
arr[i] = a[i];
|
|
192
|
+
}
|
|
193
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
194
|
+
arr[j + a.length] = b[j];
|
|
195
|
+
}
|
|
196
|
+
return arr;
|
|
197
|
+
};
|
|
198
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
199
|
+
var arr = [];
|
|
200
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
201
|
+
arr[j] = arrLike[i];
|
|
202
|
+
}
|
|
203
|
+
return arr;
|
|
204
|
+
};
|
|
205
|
+
var joiny = function(arr, joiner) {
|
|
206
|
+
var str = "";
|
|
207
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
208
|
+
str += arr[i];
|
|
209
|
+
if (i + 1 < arr.length) {
|
|
210
|
+
str += joiner;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return str;
|
|
214
|
+
};
|
|
215
|
+
module.exports = function bind(that) {
|
|
216
|
+
var target = this;
|
|
217
|
+
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
218
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
219
|
+
}
|
|
220
|
+
var args = slicy(arguments, 1);
|
|
221
|
+
var bound;
|
|
222
|
+
var binder = function() {
|
|
223
|
+
if (this instanceof bound) {
|
|
224
|
+
var result = target.apply(
|
|
225
|
+
this,
|
|
226
|
+
concatty(args, arguments)
|
|
227
|
+
);
|
|
228
|
+
if (Object(result) === result) {
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
return target.apply(
|
|
234
|
+
that,
|
|
235
|
+
concatty(args, arguments)
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
var boundLength = max(0, target.length - args.length);
|
|
239
|
+
var boundArgs = [];
|
|
240
|
+
for (var i = 0; i < boundLength; i++) {
|
|
241
|
+
boundArgs[i] = "$" + i;
|
|
242
|
+
}
|
|
243
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
244
|
+
if (target.prototype) {
|
|
245
|
+
var Empty = function Empty2() {
|
|
246
|
+
};
|
|
247
|
+
Empty.prototype = target.prototype;
|
|
248
|
+
bound.prototype = new Empty();
|
|
249
|
+
Empty.prototype = null;
|
|
250
|
+
}
|
|
251
|
+
return bound;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
// ../../node_modules/function-bind/index.js
|
|
257
|
+
var require_function_bind = __commonJS({
|
|
258
|
+
"../../node_modules/function-bind/index.js"(exports, module) {
|
|
259
|
+
"use strict";
|
|
260
|
+
var implementation = require_implementation();
|
|
261
|
+
module.exports = Function.prototype.bind || implementation;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// ../../node_modules/hasown/index.js
|
|
266
|
+
var require_hasown = __commonJS({
|
|
267
|
+
"../../node_modules/hasown/index.js"(exports, module) {
|
|
268
|
+
"use strict";
|
|
269
|
+
var call = Function.prototype.call;
|
|
270
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
271
|
+
var bind = require_function_bind();
|
|
272
|
+
module.exports = bind.call(call, $hasOwn);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// ../../node_modules/get-intrinsic/index.js
|
|
277
|
+
var require_get_intrinsic = __commonJS({
|
|
278
|
+
"../../node_modules/get-intrinsic/index.js"(exports, module) {
|
|
279
|
+
"use strict";
|
|
280
|
+
var undefined2;
|
|
281
|
+
var $Error = require_es_errors();
|
|
282
|
+
var $EvalError = require_eval();
|
|
283
|
+
var $RangeError = require_range();
|
|
284
|
+
var $ReferenceError = require_ref();
|
|
285
|
+
var $SyntaxError = require_syntax();
|
|
286
|
+
var $TypeError = require_type();
|
|
287
|
+
var $URIError = require_uri();
|
|
288
|
+
var $Function = Function;
|
|
289
|
+
var getEvalledConstructor = function(expressionSyntax) {
|
|
290
|
+
try {
|
|
291
|
+
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
292
|
+
} catch (e) {
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
296
|
+
if ($gOPD) {
|
|
297
|
+
try {
|
|
298
|
+
$gOPD({}, "");
|
|
299
|
+
} catch (e) {
|
|
300
|
+
$gOPD = null;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
var throwTypeError = function() {
|
|
304
|
+
throw new $TypeError();
|
|
305
|
+
};
|
|
306
|
+
var ThrowTypeError = $gOPD ? function() {
|
|
307
|
+
try {
|
|
308
|
+
arguments.callee;
|
|
309
|
+
return throwTypeError;
|
|
310
|
+
} catch (calleeThrows) {
|
|
311
|
+
try {
|
|
312
|
+
return $gOPD(arguments, "callee").get;
|
|
313
|
+
} catch (gOPDthrows) {
|
|
314
|
+
return throwTypeError;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}() : throwTypeError;
|
|
318
|
+
var hasSymbols = require_has_symbols()();
|
|
319
|
+
var hasProto = require_has_proto()();
|
|
320
|
+
var getProto = Object.getPrototypeOf || (hasProto ? function(x) {
|
|
321
|
+
return x.__proto__;
|
|
322
|
+
} : null);
|
|
323
|
+
var needsEval = {};
|
|
324
|
+
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
|
|
325
|
+
var INTRINSICS = {
|
|
326
|
+
__proto__: null,
|
|
327
|
+
"%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
|
|
328
|
+
"%Array%": Array,
|
|
329
|
+
"%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
|
|
330
|
+
"%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
|
|
331
|
+
"%AsyncFromSyncIteratorPrototype%": undefined2,
|
|
332
|
+
"%AsyncFunction%": needsEval,
|
|
333
|
+
"%AsyncGenerator%": needsEval,
|
|
334
|
+
"%AsyncGeneratorFunction%": needsEval,
|
|
335
|
+
"%AsyncIteratorPrototype%": needsEval,
|
|
336
|
+
"%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
|
|
337
|
+
"%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
|
|
338
|
+
"%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
|
|
339
|
+
"%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
|
|
340
|
+
"%Boolean%": Boolean,
|
|
341
|
+
"%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
|
|
342
|
+
"%Date%": Date,
|
|
343
|
+
"%decodeURI%": decodeURI,
|
|
344
|
+
"%decodeURIComponent%": decodeURIComponent,
|
|
345
|
+
"%encodeURI%": encodeURI,
|
|
346
|
+
"%encodeURIComponent%": encodeURIComponent,
|
|
347
|
+
"%Error%": $Error,
|
|
348
|
+
"%eval%": eval,
|
|
349
|
+
// eslint-disable-line no-eval
|
|
350
|
+
"%EvalError%": $EvalError,
|
|
351
|
+
"%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
|
|
352
|
+
"%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
|
|
353
|
+
"%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
|
|
354
|
+
"%Function%": $Function,
|
|
355
|
+
"%GeneratorFunction%": needsEval,
|
|
356
|
+
"%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
|
|
357
|
+
"%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
|
|
358
|
+
"%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
|
|
359
|
+
"%isFinite%": isFinite,
|
|
360
|
+
"%isNaN%": isNaN,
|
|
361
|
+
"%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
|
|
362
|
+
"%JSON%": typeof JSON === "object" ? JSON : undefined2,
|
|
363
|
+
"%Map%": typeof Map === "undefined" ? undefined2 : Map,
|
|
364
|
+
"%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
365
|
+
"%Math%": Math,
|
|
366
|
+
"%Number%": Number,
|
|
367
|
+
"%Object%": Object,
|
|
368
|
+
"%parseFloat%": parseFloat,
|
|
369
|
+
"%parseInt%": parseInt,
|
|
370
|
+
"%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
|
|
371
|
+
"%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
|
|
372
|
+
"%RangeError%": $RangeError,
|
|
373
|
+
"%ReferenceError%": $ReferenceError,
|
|
374
|
+
"%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
|
|
375
|
+
"%RegExp%": RegExp,
|
|
376
|
+
"%Set%": typeof Set === "undefined" ? undefined2 : Set,
|
|
377
|
+
"%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
378
|
+
"%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
|
|
379
|
+
"%String%": String,
|
|
380
|
+
"%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
|
|
381
|
+
"%Symbol%": hasSymbols ? Symbol : undefined2,
|
|
382
|
+
"%SyntaxError%": $SyntaxError,
|
|
383
|
+
"%ThrowTypeError%": ThrowTypeError,
|
|
384
|
+
"%TypedArray%": TypedArray,
|
|
385
|
+
"%TypeError%": $TypeError,
|
|
386
|
+
"%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
|
|
387
|
+
"%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
|
|
388
|
+
"%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
|
|
389
|
+
"%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
|
|
390
|
+
"%URIError%": $URIError,
|
|
391
|
+
"%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
|
|
392
|
+
"%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
|
|
393
|
+
"%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
|
|
394
|
+
};
|
|
395
|
+
if (getProto) {
|
|
396
|
+
try {
|
|
397
|
+
null.error;
|
|
398
|
+
} catch (e) {
|
|
399
|
+
errorProto = getProto(getProto(e));
|
|
400
|
+
INTRINSICS["%Error.prototype%"] = errorProto;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
var errorProto;
|
|
404
|
+
var doEval = function doEval2(name) {
|
|
405
|
+
var value;
|
|
406
|
+
if (name === "%AsyncFunction%") {
|
|
407
|
+
value = getEvalledConstructor("async function () {}");
|
|
408
|
+
} else if (name === "%GeneratorFunction%") {
|
|
409
|
+
value = getEvalledConstructor("function* () {}");
|
|
410
|
+
} else if (name === "%AsyncGeneratorFunction%") {
|
|
411
|
+
value = getEvalledConstructor("async function* () {}");
|
|
412
|
+
} else if (name === "%AsyncGenerator%") {
|
|
413
|
+
var fn = doEval2("%AsyncGeneratorFunction%");
|
|
414
|
+
if (fn) {
|
|
415
|
+
value = fn.prototype;
|
|
416
|
+
}
|
|
417
|
+
} else if (name === "%AsyncIteratorPrototype%") {
|
|
418
|
+
var gen = doEval2("%AsyncGenerator%");
|
|
419
|
+
if (gen && getProto) {
|
|
420
|
+
value = getProto(gen.prototype);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
INTRINSICS[name] = value;
|
|
424
|
+
return value;
|
|
425
|
+
};
|
|
426
|
+
var LEGACY_ALIASES = {
|
|
427
|
+
__proto__: null,
|
|
428
|
+
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
429
|
+
"%ArrayPrototype%": ["Array", "prototype"],
|
|
430
|
+
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
|
|
431
|
+
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
|
|
432
|
+
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
|
|
433
|
+
"%ArrayProto_values%": ["Array", "prototype", "values"],
|
|
434
|
+
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
|
|
435
|
+
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
|
|
436
|
+
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
|
|
437
|
+
"%BooleanPrototype%": ["Boolean", "prototype"],
|
|
438
|
+
"%DataViewPrototype%": ["DataView", "prototype"],
|
|
439
|
+
"%DatePrototype%": ["Date", "prototype"],
|
|
440
|
+
"%ErrorPrototype%": ["Error", "prototype"],
|
|
441
|
+
"%EvalErrorPrototype%": ["EvalError", "prototype"],
|
|
442
|
+
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
|
|
443
|
+
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
|
|
444
|
+
"%FunctionPrototype%": ["Function", "prototype"],
|
|
445
|
+
"%Generator%": ["GeneratorFunction", "prototype"],
|
|
446
|
+
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
|
|
447
|
+
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
|
|
448
|
+
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
|
|
449
|
+
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
|
|
450
|
+
"%JSONParse%": ["JSON", "parse"],
|
|
451
|
+
"%JSONStringify%": ["JSON", "stringify"],
|
|
452
|
+
"%MapPrototype%": ["Map", "prototype"],
|
|
453
|
+
"%NumberPrototype%": ["Number", "prototype"],
|
|
454
|
+
"%ObjectPrototype%": ["Object", "prototype"],
|
|
455
|
+
"%ObjProto_toString%": ["Object", "prototype", "toString"],
|
|
456
|
+
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
|
|
457
|
+
"%PromisePrototype%": ["Promise", "prototype"],
|
|
458
|
+
"%PromiseProto_then%": ["Promise", "prototype", "then"],
|
|
459
|
+
"%Promise_all%": ["Promise", "all"],
|
|
460
|
+
"%Promise_reject%": ["Promise", "reject"],
|
|
461
|
+
"%Promise_resolve%": ["Promise", "resolve"],
|
|
462
|
+
"%RangeErrorPrototype%": ["RangeError", "prototype"],
|
|
463
|
+
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
|
|
464
|
+
"%RegExpPrototype%": ["RegExp", "prototype"],
|
|
465
|
+
"%SetPrototype%": ["Set", "prototype"],
|
|
466
|
+
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
|
|
467
|
+
"%StringPrototype%": ["String", "prototype"],
|
|
468
|
+
"%SymbolPrototype%": ["Symbol", "prototype"],
|
|
469
|
+
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
|
|
470
|
+
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
|
|
471
|
+
"%TypeErrorPrototype%": ["TypeError", "prototype"],
|
|
472
|
+
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
|
|
473
|
+
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
|
|
474
|
+
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
|
|
475
|
+
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
|
|
476
|
+
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
477
|
+
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
478
|
+
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
479
|
+
};
|
|
480
|
+
var bind = require_function_bind();
|
|
481
|
+
var hasOwn = require_hasown();
|
|
482
|
+
var $concat = bind.call(Function.call, Array.prototype.concat);
|
|
483
|
+
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
484
|
+
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
485
|
+
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
486
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
487
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
488
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
489
|
+
var stringToPath = function stringToPath2(string) {
|
|
490
|
+
var first = $strSlice(string, 0, 1);
|
|
491
|
+
var last = $strSlice(string, -1);
|
|
492
|
+
if (first === "%" && last !== "%") {
|
|
493
|
+
throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
|
|
494
|
+
} else if (last === "%" && first !== "%") {
|
|
495
|
+
throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
|
|
496
|
+
}
|
|
497
|
+
var result = [];
|
|
498
|
+
$replace(string, rePropName, function(match, number, quote, subString) {
|
|
499
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
|
|
500
|
+
});
|
|
501
|
+
return result;
|
|
502
|
+
};
|
|
503
|
+
var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
|
|
504
|
+
var intrinsicName = name;
|
|
505
|
+
var alias;
|
|
506
|
+
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
|
507
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
508
|
+
intrinsicName = "%" + alias[0] + "%";
|
|
509
|
+
}
|
|
510
|
+
if (hasOwn(INTRINSICS, intrinsicName)) {
|
|
511
|
+
var value = INTRINSICS[intrinsicName];
|
|
512
|
+
if (value === needsEval) {
|
|
513
|
+
value = doEval(intrinsicName);
|
|
514
|
+
}
|
|
515
|
+
if (typeof value === "undefined" && !allowMissing) {
|
|
516
|
+
throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
|
|
517
|
+
}
|
|
518
|
+
return {
|
|
519
|
+
alias,
|
|
520
|
+
name: intrinsicName,
|
|
521
|
+
value
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
throw new $SyntaxError("intrinsic " + name + " does not exist!");
|
|
525
|
+
};
|
|
526
|
+
module.exports = function GetIntrinsic(name, allowMissing) {
|
|
527
|
+
if (typeof name !== "string" || name.length === 0) {
|
|
528
|
+
throw new $TypeError("intrinsic name must be a non-empty string");
|
|
529
|
+
}
|
|
530
|
+
if (arguments.length > 1 && typeof allowMissing !== "boolean") {
|
|
531
|
+
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
532
|
+
}
|
|
533
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
534
|
+
throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
535
|
+
}
|
|
536
|
+
var parts = stringToPath(name);
|
|
537
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
|
|
538
|
+
var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
|
|
539
|
+
var intrinsicRealName = intrinsic.name;
|
|
540
|
+
var value = intrinsic.value;
|
|
541
|
+
var skipFurtherCaching = false;
|
|
542
|
+
var alias = intrinsic.alias;
|
|
543
|
+
if (alias) {
|
|
544
|
+
intrinsicBaseName = alias[0];
|
|
545
|
+
$spliceApply(parts, $concat([0, 1], alias));
|
|
546
|
+
}
|
|
547
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
548
|
+
var part = parts[i];
|
|
549
|
+
var first = $strSlice(part, 0, 1);
|
|
550
|
+
var last = $strSlice(part, -1);
|
|
551
|
+
if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
|
|
552
|
+
throw new $SyntaxError("property names with quotes must have matching quotes");
|
|
553
|
+
}
|
|
554
|
+
if (part === "constructor" || !isOwn) {
|
|
555
|
+
skipFurtherCaching = true;
|
|
556
|
+
}
|
|
557
|
+
intrinsicBaseName += "." + part;
|
|
558
|
+
intrinsicRealName = "%" + intrinsicBaseName + "%";
|
|
559
|
+
if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
|
560
|
+
value = INTRINSICS[intrinsicRealName];
|
|
561
|
+
} else if (value != null) {
|
|
562
|
+
if (!(part in value)) {
|
|
563
|
+
if (!allowMissing) {
|
|
564
|
+
throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
|
|
565
|
+
}
|
|
566
|
+
return void undefined2;
|
|
567
|
+
}
|
|
568
|
+
if ($gOPD && i + 1 >= parts.length) {
|
|
569
|
+
var desc = $gOPD(value, part);
|
|
570
|
+
isOwn = !!desc;
|
|
571
|
+
if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
|
|
572
|
+
value = desc.get;
|
|
573
|
+
} else {
|
|
574
|
+
value = value[part];
|
|
575
|
+
}
|
|
576
|
+
} else {
|
|
577
|
+
isOwn = hasOwn(value, part);
|
|
578
|
+
value = value[part];
|
|
579
|
+
}
|
|
580
|
+
if (isOwn && !skipFurtherCaching) {
|
|
581
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return value;
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
// ../../node_modules/es-define-property/index.js
|
|
591
|
+
var require_es_define_property = __commonJS({
|
|
592
|
+
"../../node_modules/es-define-property/index.js"(exports, module) {
|
|
593
|
+
"use strict";
|
|
594
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
595
|
+
var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false;
|
|
596
|
+
if ($defineProperty) {
|
|
597
|
+
try {
|
|
598
|
+
$defineProperty({}, "a", { value: 1 });
|
|
599
|
+
} catch (e) {
|
|
600
|
+
$defineProperty = false;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
module.exports = $defineProperty;
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
// ../../node_modules/gopd/index.js
|
|
608
|
+
var require_gopd = __commonJS({
|
|
609
|
+
"../../node_modules/gopd/index.js"(exports, module) {
|
|
610
|
+
"use strict";
|
|
611
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
612
|
+
var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
|
|
613
|
+
if ($gOPD) {
|
|
614
|
+
try {
|
|
615
|
+
$gOPD([], "length");
|
|
616
|
+
} catch (e) {
|
|
617
|
+
$gOPD = null;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
module.exports = $gOPD;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// ../../node_modules/define-data-property/index.js
|
|
625
|
+
var require_define_data_property = __commonJS({
|
|
626
|
+
"../../node_modules/define-data-property/index.js"(exports, module) {
|
|
627
|
+
"use strict";
|
|
628
|
+
var $defineProperty = require_es_define_property();
|
|
629
|
+
var $SyntaxError = require_syntax();
|
|
630
|
+
var $TypeError = require_type();
|
|
631
|
+
var gopd = require_gopd();
|
|
632
|
+
module.exports = function defineDataProperty(obj, property, value) {
|
|
633
|
+
if (!obj || typeof obj !== "object" && typeof obj !== "function") {
|
|
634
|
+
throw new $TypeError("`obj` must be an object or a function`");
|
|
635
|
+
}
|
|
636
|
+
if (typeof property !== "string" && typeof property !== "symbol") {
|
|
637
|
+
throw new $TypeError("`property` must be a string or a symbol`");
|
|
638
|
+
}
|
|
639
|
+
if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
|
|
640
|
+
throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
|
|
641
|
+
}
|
|
642
|
+
if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
|
|
643
|
+
throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
|
|
644
|
+
}
|
|
645
|
+
if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
|
|
646
|
+
throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
|
|
647
|
+
}
|
|
648
|
+
if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
|
|
649
|
+
throw new $TypeError("`loose`, if provided, must be a boolean");
|
|
650
|
+
}
|
|
651
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
652
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
653
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
654
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
655
|
+
var desc = !!gopd && gopd(obj, property);
|
|
656
|
+
if ($defineProperty) {
|
|
657
|
+
$defineProperty(obj, property, {
|
|
658
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
659
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
660
|
+
value,
|
|
661
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
662
|
+
});
|
|
663
|
+
} else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
|
|
664
|
+
obj[property] = value;
|
|
665
|
+
} else {
|
|
666
|
+
throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
// ../../node_modules/has-property-descriptors/index.js
|
|
673
|
+
var require_has_property_descriptors = __commonJS({
|
|
674
|
+
"../../node_modules/has-property-descriptors/index.js"(exports, module) {
|
|
675
|
+
"use strict";
|
|
676
|
+
var $defineProperty = require_es_define_property();
|
|
677
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors2() {
|
|
678
|
+
return !!$defineProperty;
|
|
679
|
+
};
|
|
680
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
681
|
+
if (!$defineProperty) {
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
try {
|
|
685
|
+
return $defineProperty([], "length", { value: 1 }).length !== 1;
|
|
686
|
+
} catch (e) {
|
|
687
|
+
return true;
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
module.exports = hasPropertyDescriptors;
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
// ../../node_modules/set-function-length/index.js
|
|
695
|
+
var require_set_function_length = __commonJS({
|
|
696
|
+
"../../node_modules/set-function-length/index.js"(exports, module) {
|
|
697
|
+
"use strict";
|
|
698
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
699
|
+
var define = require_define_data_property();
|
|
700
|
+
var hasDescriptors = require_has_property_descriptors()();
|
|
701
|
+
var gOPD = require_gopd();
|
|
702
|
+
var $TypeError = require_type();
|
|
703
|
+
var $floor = GetIntrinsic("%Math.floor%");
|
|
704
|
+
module.exports = function setFunctionLength(fn, length) {
|
|
705
|
+
if (typeof fn !== "function") {
|
|
706
|
+
throw new $TypeError("`fn` is not a function");
|
|
707
|
+
}
|
|
708
|
+
if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) {
|
|
709
|
+
throw new $TypeError("`length` must be a positive 32-bit integer");
|
|
710
|
+
}
|
|
711
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
712
|
+
var functionLengthIsConfigurable = true;
|
|
713
|
+
var functionLengthIsWritable = true;
|
|
714
|
+
if ("length" in fn && gOPD) {
|
|
715
|
+
var desc = gOPD(fn, "length");
|
|
716
|
+
if (desc && !desc.configurable) {
|
|
717
|
+
functionLengthIsConfigurable = false;
|
|
718
|
+
}
|
|
719
|
+
if (desc && !desc.writable) {
|
|
720
|
+
functionLengthIsWritable = false;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
724
|
+
if (hasDescriptors) {
|
|
725
|
+
define(
|
|
726
|
+
/** @type {Parameters<define>[0]} */
|
|
727
|
+
fn,
|
|
728
|
+
"length",
|
|
729
|
+
length,
|
|
730
|
+
true,
|
|
731
|
+
true
|
|
732
|
+
);
|
|
733
|
+
} else {
|
|
734
|
+
define(
|
|
735
|
+
/** @type {Parameters<define>[0]} */
|
|
736
|
+
fn,
|
|
737
|
+
"length",
|
|
738
|
+
length
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return fn;
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
// ../../node_modules/call-bind/index.js
|
|
748
|
+
var require_call_bind = __commonJS({
|
|
749
|
+
"../../node_modules/call-bind/index.js"(exports, module) {
|
|
750
|
+
"use strict";
|
|
751
|
+
var bind = require_function_bind();
|
|
752
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
753
|
+
var setFunctionLength = require_set_function_length();
|
|
754
|
+
var $TypeError = require_type();
|
|
755
|
+
var $apply = GetIntrinsic("%Function.prototype.apply%");
|
|
756
|
+
var $call = GetIntrinsic("%Function.prototype.call%");
|
|
757
|
+
var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
|
|
758
|
+
var $defineProperty = require_es_define_property();
|
|
759
|
+
var $max = GetIntrinsic("%Math.max%");
|
|
760
|
+
module.exports = function callBind(originalFunction) {
|
|
761
|
+
if (typeof originalFunction !== "function") {
|
|
762
|
+
throw new $TypeError("a function is required");
|
|
763
|
+
}
|
|
764
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
765
|
+
return setFunctionLength(
|
|
766
|
+
func,
|
|
767
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
768
|
+
true
|
|
769
|
+
);
|
|
770
|
+
};
|
|
771
|
+
var applyBind = function applyBind2() {
|
|
772
|
+
return $reflectApply(bind, $apply, arguments);
|
|
773
|
+
};
|
|
774
|
+
if ($defineProperty) {
|
|
775
|
+
$defineProperty(module.exports, "apply", { value: applyBind });
|
|
776
|
+
} else {
|
|
777
|
+
module.exports.apply = applyBind;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
// ../../node_modules/call-bind/callBound.js
|
|
783
|
+
var require_callBound = __commonJS({
|
|
784
|
+
"../../node_modules/call-bind/callBound.js"(exports, module) {
|
|
785
|
+
"use strict";
|
|
786
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
787
|
+
var callBind = require_call_bind();
|
|
788
|
+
var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
|
|
789
|
+
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
790
|
+
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
|
791
|
+
if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
|
|
792
|
+
return callBind(intrinsic);
|
|
793
|
+
}
|
|
794
|
+
return intrinsic;
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
// ../../node_modules/object-inspect/util.inspect.js
|
|
800
|
+
var require_util_inspect = __commonJS({
|
|
801
|
+
"../../node_modules/object-inspect/util.inspect.js"(exports, module) {
|
|
802
|
+
"use strict";
|
|
803
|
+
module.exports = __require("util").inspect;
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
// ../../node_modules/object-inspect/index.js
|
|
808
|
+
var require_object_inspect = __commonJS({
|
|
809
|
+
"../../node_modules/object-inspect/index.js"(exports, module) {
|
|
810
|
+
"use strict";
|
|
811
|
+
var hasMap = typeof Map === "function" && Map.prototype;
|
|
812
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
|
|
813
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
|
|
814
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
815
|
+
var hasSet = typeof Set === "function" && Set.prototype;
|
|
816
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
|
|
817
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
|
|
818
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
819
|
+
var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
|
|
820
|
+
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
821
|
+
var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
|
|
822
|
+
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
823
|
+
var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
|
|
824
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
825
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
826
|
+
var objectToString = Object.prototype.toString;
|
|
827
|
+
var functionToString = Function.prototype.toString;
|
|
828
|
+
var $match = String.prototype.match;
|
|
829
|
+
var $slice = String.prototype.slice;
|
|
830
|
+
var $replace = String.prototype.replace;
|
|
831
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
832
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
833
|
+
var $test = RegExp.prototype.test;
|
|
834
|
+
var $concat = Array.prototype.concat;
|
|
835
|
+
var $join = Array.prototype.join;
|
|
836
|
+
var $arrSlice = Array.prototype.slice;
|
|
837
|
+
var $floor = Math.floor;
|
|
838
|
+
var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
|
|
839
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
840
|
+
var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
|
|
841
|
+
var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
|
|
842
|
+
var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
|
|
843
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
844
|
+
var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
|
|
845
|
+
return O.__proto__;
|
|
846
|
+
} : null);
|
|
847
|
+
function addNumericSeparator(num, str) {
|
|
848
|
+
if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) {
|
|
849
|
+
return str;
|
|
850
|
+
}
|
|
851
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
852
|
+
if (typeof num === "number") {
|
|
853
|
+
var int = num < 0 ? -$floor(-num) : $floor(num);
|
|
854
|
+
if (int !== num) {
|
|
855
|
+
var intStr = String(int);
|
|
856
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
857
|
+
return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
return $replace.call(str, sepRegex, "$&_");
|
|
861
|
+
}
|
|
862
|
+
var utilInspect = require_util_inspect();
|
|
863
|
+
var inspectCustom = utilInspect.custom;
|
|
864
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
865
|
+
module.exports = function inspect_(obj, options, depth, seen) {
|
|
866
|
+
var opts = options || {};
|
|
867
|
+
if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) {
|
|
868
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
869
|
+
}
|
|
870
|
+
if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
|
|
871
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
872
|
+
}
|
|
873
|
+
var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
|
|
874
|
+
if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
|
|
875
|
+
throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
876
|
+
}
|
|
877
|
+
if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
|
|
878
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
879
|
+
}
|
|
880
|
+
if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
|
|
881
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
882
|
+
}
|
|
883
|
+
var numericSeparator = opts.numericSeparator;
|
|
884
|
+
if (typeof obj === "undefined") {
|
|
885
|
+
return "undefined";
|
|
886
|
+
}
|
|
887
|
+
if (obj === null) {
|
|
888
|
+
return "null";
|
|
889
|
+
}
|
|
890
|
+
if (typeof obj === "boolean") {
|
|
891
|
+
return obj ? "true" : "false";
|
|
892
|
+
}
|
|
893
|
+
if (typeof obj === "string") {
|
|
894
|
+
return inspectString(obj, opts);
|
|
895
|
+
}
|
|
896
|
+
if (typeof obj === "number") {
|
|
897
|
+
if (obj === 0) {
|
|
898
|
+
return Infinity / obj > 0 ? "0" : "-0";
|
|
899
|
+
}
|
|
900
|
+
var str = String(obj);
|
|
901
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
902
|
+
}
|
|
903
|
+
if (typeof obj === "bigint") {
|
|
904
|
+
var bigIntStr = String(obj) + "n";
|
|
905
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
906
|
+
}
|
|
907
|
+
var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
|
|
908
|
+
if (typeof depth === "undefined") {
|
|
909
|
+
depth = 0;
|
|
910
|
+
}
|
|
911
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
|
|
912
|
+
return isArray(obj) ? "[Array]" : "[Object]";
|
|
913
|
+
}
|
|
914
|
+
var indent = getIndent(opts, depth);
|
|
915
|
+
if (typeof seen === "undefined") {
|
|
916
|
+
seen = [];
|
|
917
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
918
|
+
return "[Circular]";
|
|
919
|
+
}
|
|
920
|
+
function inspect(value, from, noIndent) {
|
|
921
|
+
if (from) {
|
|
922
|
+
seen = $arrSlice.call(seen);
|
|
923
|
+
seen.push(from);
|
|
924
|
+
}
|
|
925
|
+
if (noIndent) {
|
|
926
|
+
var newOpts = {
|
|
927
|
+
depth: opts.depth
|
|
928
|
+
};
|
|
929
|
+
if (has(opts, "quoteStyle")) {
|
|
930
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
931
|
+
}
|
|
932
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
933
|
+
}
|
|
934
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
935
|
+
}
|
|
936
|
+
if (typeof obj === "function" && !isRegExp(obj)) {
|
|
937
|
+
var name = nameOf(obj);
|
|
938
|
+
var keys = arrObjKeys(obj, inspect);
|
|
939
|
+
return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
|
|
940
|
+
}
|
|
941
|
+
if (isSymbol(obj)) {
|
|
942
|
+
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
|
|
943
|
+
return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
944
|
+
}
|
|
945
|
+
if (isElement(obj)) {
|
|
946
|
+
var s = "<" + $toLowerCase.call(String(obj.nodeName));
|
|
947
|
+
var attrs = obj.attributes || [];
|
|
948
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
949
|
+
s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
|
|
950
|
+
}
|
|
951
|
+
s += ">";
|
|
952
|
+
if (obj.childNodes && obj.childNodes.length) {
|
|
953
|
+
s += "...";
|
|
954
|
+
}
|
|
955
|
+
s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
|
|
956
|
+
return s;
|
|
957
|
+
}
|
|
958
|
+
if (isArray(obj)) {
|
|
959
|
+
if (obj.length === 0) {
|
|
960
|
+
return "[]";
|
|
961
|
+
}
|
|
962
|
+
var xs = arrObjKeys(obj, inspect);
|
|
963
|
+
if (indent && !singleLineValues(xs)) {
|
|
964
|
+
return "[" + indentedJoin(xs, indent) + "]";
|
|
965
|
+
}
|
|
966
|
+
return "[ " + $join.call(xs, ", ") + " ]";
|
|
967
|
+
}
|
|
968
|
+
if (isError(obj)) {
|
|
969
|
+
var parts = arrObjKeys(obj, inspect);
|
|
970
|
+
if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
|
|
971
|
+
return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }";
|
|
972
|
+
}
|
|
973
|
+
if (parts.length === 0) {
|
|
974
|
+
return "[" + String(obj) + "]";
|
|
975
|
+
}
|
|
976
|
+
return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
|
|
977
|
+
}
|
|
978
|
+
if (typeof obj === "object" && customInspect) {
|
|
979
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) {
|
|
980
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
981
|
+
} else if (customInspect !== "symbol" && typeof obj.inspect === "function") {
|
|
982
|
+
return obj.inspect();
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
if (isMap(obj)) {
|
|
986
|
+
var mapParts = [];
|
|
987
|
+
if (mapForEach) {
|
|
988
|
+
mapForEach.call(obj, function(value, key) {
|
|
989
|
+
mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
return collectionOf("Map", mapSize.call(obj), mapParts, indent);
|
|
993
|
+
}
|
|
994
|
+
if (isSet(obj)) {
|
|
995
|
+
var setParts = [];
|
|
996
|
+
if (setForEach) {
|
|
997
|
+
setForEach.call(obj, function(value) {
|
|
998
|
+
setParts.push(inspect(value, obj));
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
return collectionOf("Set", setSize.call(obj), setParts, indent);
|
|
1002
|
+
}
|
|
1003
|
+
if (isWeakMap(obj)) {
|
|
1004
|
+
return weakCollectionOf("WeakMap");
|
|
1005
|
+
}
|
|
1006
|
+
if (isWeakSet(obj)) {
|
|
1007
|
+
return weakCollectionOf("WeakSet");
|
|
1008
|
+
}
|
|
1009
|
+
if (isWeakRef(obj)) {
|
|
1010
|
+
return weakCollectionOf("WeakRef");
|
|
1011
|
+
}
|
|
1012
|
+
if (isNumber(obj)) {
|
|
1013
|
+
return markBoxed(inspect(Number(obj)));
|
|
1014
|
+
}
|
|
1015
|
+
if (isBigInt(obj)) {
|
|
1016
|
+
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
1017
|
+
}
|
|
1018
|
+
if (isBoolean(obj)) {
|
|
1019
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
1020
|
+
}
|
|
1021
|
+
if (isString(obj)) {
|
|
1022
|
+
return markBoxed(inspect(String(obj)));
|
|
1023
|
+
}
|
|
1024
|
+
if (typeof window !== "undefined" && obj === window) {
|
|
1025
|
+
return "{ [object Window] }";
|
|
1026
|
+
}
|
|
1027
|
+
if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) {
|
|
1028
|
+
return "{ [object globalThis] }";
|
|
1029
|
+
}
|
|
1030
|
+
if (!isDate(obj) && !isRegExp(obj)) {
|
|
1031
|
+
var ys = arrObjKeys(obj, inspect);
|
|
1032
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
1033
|
+
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
1034
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
1035
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
1036
|
+
var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
1037
|
+
if (ys.length === 0) {
|
|
1038
|
+
return tag + "{}";
|
|
1039
|
+
}
|
|
1040
|
+
if (indent) {
|
|
1041
|
+
return tag + "{" + indentedJoin(ys, indent) + "}";
|
|
1042
|
+
}
|
|
1043
|
+
return tag + "{ " + $join.call(ys, ", ") + " }";
|
|
1044
|
+
}
|
|
1045
|
+
return String(obj);
|
|
1046
|
+
};
|
|
1047
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
1048
|
+
var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'";
|
|
1049
|
+
return quoteChar + s + quoteChar;
|
|
1050
|
+
}
|
|
1051
|
+
function quote(s) {
|
|
1052
|
+
return $replace.call(String(s), /"/g, """);
|
|
1053
|
+
}
|
|
1054
|
+
function isArray(obj) {
|
|
1055
|
+
return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1056
|
+
}
|
|
1057
|
+
function isDate(obj) {
|
|
1058
|
+
return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1059
|
+
}
|
|
1060
|
+
function isRegExp(obj) {
|
|
1061
|
+
return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1062
|
+
}
|
|
1063
|
+
function isError(obj) {
|
|
1064
|
+
return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1065
|
+
}
|
|
1066
|
+
function isString(obj) {
|
|
1067
|
+
return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1068
|
+
}
|
|
1069
|
+
function isNumber(obj) {
|
|
1070
|
+
return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1071
|
+
}
|
|
1072
|
+
function isBoolean(obj) {
|
|
1073
|
+
return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1074
|
+
}
|
|
1075
|
+
function isSymbol(obj) {
|
|
1076
|
+
if (hasShammedSymbols) {
|
|
1077
|
+
return obj && typeof obj === "object" && obj instanceof Symbol;
|
|
1078
|
+
}
|
|
1079
|
+
if (typeof obj === "symbol") {
|
|
1080
|
+
return true;
|
|
1081
|
+
}
|
|
1082
|
+
if (!obj || typeof obj !== "object" || !symToString) {
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
try {
|
|
1086
|
+
symToString.call(obj);
|
|
1087
|
+
return true;
|
|
1088
|
+
} catch (e) {
|
|
1089
|
+
}
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
function isBigInt(obj) {
|
|
1093
|
+
if (!obj || typeof obj !== "object" || !bigIntValueOf) {
|
|
1094
|
+
return false;
|
|
1095
|
+
}
|
|
1096
|
+
try {
|
|
1097
|
+
bigIntValueOf.call(obj);
|
|
1098
|
+
return true;
|
|
1099
|
+
} catch (e) {
|
|
1100
|
+
}
|
|
1101
|
+
return false;
|
|
1102
|
+
}
|
|
1103
|
+
var hasOwn = Object.prototype.hasOwnProperty || function(key) {
|
|
1104
|
+
return key in this;
|
|
1105
|
+
};
|
|
1106
|
+
function has(obj, key) {
|
|
1107
|
+
return hasOwn.call(obj, key);
|
|
1108
|
+
}
|
|
1109
|
+
function toStr(obj) {
|
|
1110
|
+
return objectToString.call(obj);
|
|
1111
|
+
}
|
|
1112
|
+
function nameOf(f) {
|
|
1113
|
+
if (f.name) {
|
|
1114
|
+
return f.name;
|
|
1115
|
+
}
|
|
1116
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
1117
|
+
if (m) {
|
|
1118
|
+
return m[1];
|
|
1119
|
+
}
|
|
1120
|
+
return null;
|
|
1121
|
+
}
|
|
1122
|
+
function indexOf(xs, x) {
|
|
1123
|
+
if (xs.indexOf) {
|
|
1124
|
+
return xs.indexOf(x);
|
|
1125
|
+
}
|
|
1126
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
1127
|
+
if (xs[i] === x) {
|
|
1128
|
+
return i;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
return -1;
|
|
1132
|
+
}
|
|
1133
|
+
function isMap(x) {
|
|
1134
|
+
if (!mapSize || !x || typeof x !== "object") {
|
|
1135
|
+
return false;
|
|
1136
|
+
}
|
|
1137
|
+
try {
|
|
1138
|
+
mapSize.call(x);
|
|
1139
|
+
try {
|
|
1140
|
+
setSize.call(x);
|
|
1141
|
+
} catch (s) {
|
|
1142
|
+
return true;
|
|
1143
|
+
}
|
|
1144
|
+
return x instanceof Map;
|
|
1145
|
+
} catch (e) {
|
|
1146
|
+
}
|
|
1147
|
+
return false;
|
|
1148
|
+
}
|
|
1149
|
+
function isWeakMap(x) {
|
|
1150
|
+
if (!weakMapHas || !x || typeof x !== "object") {
|
|
1151
|
+
return false;
|
|
1152
|
+
}
|
|
1153
|
+
try {
|
|
1154
|
+
weakMapHas.call(x, weakMapHas);
|
|
1155
|
+
try {
|
|
1156
|
+
weakSetHas.call(x, weakSetHas);
|
|
1157
|
+
} catch (s) {
|
|
1158
|
+
return true;
|
|
1159
|
+
}
|
|
1160
|
+
return x instanceof WeakMap;
|
|
1161
|
+
} catch (e) {
|
|
1162
|
+
}
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1165
|
+
function isWeakRef(x) {
|
|
1166
|
+
if (!weakRefDeref || !x || typeof x !== "object") {
|
|
1167
|
+
return false;
|
|
1168
|
+
}
|
|
1169
|
+
try {
|
|
1170
|
+
weakRefDeref.call(x);
|
|
1171
|
+
return true;
|
|
1172
|
+
} catch (e) {
|
|
1173
|
+
}
|
|
1174
|
+
return false;
|
|
1175
|
+
}
|
|
1176
|
+
function isSet(x) {
|
|
1177
|
+
if (!setSize || !x || typeof x !== "object") {
|
|
1178
|
+
return false;
|
|
1179
|
+
}
|
|
1180
|
+
try {
|
|
1181
|
+
setSize.call(x);
|
|
1182
|
+
try {
|
|
1183
|
+
mapSize.call(x);
|
|
1184
|
+
} catch (m) {
|
|
1185
|
+
return true;
|
|
1186
|
+
}
|
|
1187
|
+
return x instanceof Set;
|
|
1188
|
+
} catch (e) {
|
|
1189
|
+
}
|
|
1190
|
+
return false;
|
|
1191
|
+
}
|
|
1192
|
+
function isWeakSet(x) {
|
|
1193
|
+
if (!weakSetHas || !x || typeof x !== "object") {
|
|
1194
|
+
return false;
|
|
1195
|
+
}
|
|
1196
|
+
try {
|
|
1197
|
+
weakSetHas.call(x, weakSetHas);
|
|
1198
|
+
try {
|
|
1199
|
+
weakMapHas.call(x, weakMapHas);
|
|
1200
|
+
} catch (s) {
|
|
1201
|
+
return true;
|
|
1202
|
+
}
|
|
1203
|
+
return x instanceof WeakSet;
|
|
1204
|
+
} catch (e) {
|
|
1205
|
+
}
|
|
1206
|
+
return false;
|
|
1207
|
+
}
|
|
1208
|
+
function isElement(x) {
|
|
1209
|
+
if (!x || typeof x !== "object") {
|
|
1210
|
+
return false;
|
|
1211
|
+
}
|
|
1212
|
+
if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {
|
|
1213
|
+
return true;
|
|
1214
|
+
}
|
|
1215
|
+
return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
|
|
1216
|
+
}
|
|
1217
|
+
function inspectString(str, opts) {
|
|
1218
|
+
if (str.length > opts.maxStringLength) {
|
|
1219
|
+
var remaining = str.length - opts.maxStringLength;
|
|
1220
|
+
var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
|
|
1221
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
1222
|
+
}
|
|
1223
|
+
var s = $replace.call($replace.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte);
|
|
1224
|
+
return wrapQuotes(s, "single", opts);
|
|
1225
|
+
}
|
|
1226
|
+
function lowbyte(c) {
|
|
1227
|
+
var n = c.charCodeAt(0);
|
|
1228
|
+
var x = {
|
|
1229
|
+
8: "b",
|
|
1230
|
+
9: "t",
|
|
1231
|
+
10: "n",
|
|
1232
|
+
12: "f",
|
|
1233
|
+
13: "r"
|
|
1234
|
+
}[n];
|
|
1235
|
+
if (x) {
|
|
1236
|
+
return "\\" + x;
|
|
1237
|
+
}
|
|
1238
|
+
return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
|
|
1239
|
+
}
|
|
1240
|
+
function markBoxed(str) {
|
|
1241
|
+
return "Object(" + str + ")";
|
|
1242
|
+
}
|
|
1243
|
+
function weakCollectionOf(type) {
|
|
1244
|
+
return type + " { ? }";
|
|
1245
|
+
}
|
|
1246
|
+
function collectionOf(type, size, entries, indent) {
|
|
1247
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
|
|
1248
|
+
return type + " (" + size + ") {" + joinedEntries + "}";
|
|
1249
|
+
}
|
|
1250
|
+
function singleLineValues(xs) {
|
|
1251
|
+
for (var i = 0; i < xs.length; i++) {
|
|
1252
|
+
if (indexOf(xs[i], "\n") >= 0) {
|
|
1253
|
+
return false;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
return true;
|
|
1257
|
+
}
|
|
1258
|
+
function getIndent(opts, depth) {
|
|
1259
|
+
var baseIndent;
|
|
1260
|
+
if (opts.indent === " ") {
|
|
1261
|
+
baseIndent = " ";
|
|
1262
|
+
} else if (typeof opts.indent === "number" && opts.indent > 0) {
|
|
1263
|
+
baseIndent = $join.call(Array(opts.indent + 1), " ");
|
|
1264
|
+
} else {
|
|
1265
|
+
return null;
|
|
1266
|
+
}
|
|
1267
|
+
return {
|
|
1268
|
+
base: baseIndent,
|
|
1269
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
function indentedJoin(xs, indent) {
|
|
1273
|
+
if (xs.length === 0) {
|
|
1274
|
+
return "";
|
|
1275
|
+
}
|
|
1276
|
+
var lineJoiner = "\n" + indent.prev + indent.base;
|
|
1277
|
+
return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
|
|
1278
|
+
}
|
|
1279
|
+
function arrObjKeys(obj, inspect) {
|
|
1280
|
+
var isArr = isArray(obj);
|
|
1281
|
+
var xs = [];
|
|
1282
|
+
if (isArr) {
|
|
1283
|
+
xs.length = obj.length;
|
|
1284
|
+
for (var i = 0; i < obj.length; i++) {
|
|
1285
|
+
xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
var syms = typeof gOPS === "function" ? gOPS(obj) : [];
|
|
1289
|
+
var symMap;
|
|
1290
|
+
if (hasShammedSymbols) {
|
|
1291
|
+
symMap = {};
|
|
1292
|
+
for (var k = 0; k < syms.length; k++) {
|
|
1293
|
+
symMap["$" + syms[k]] = syms[k];
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
for (var key in obj) {
|
|
1297
|
+
if (!has(obj, key)) {
|
|
1298
|
+
continue;
|
|
1299
|
+
}
|
|
1300
|
+
if (isArr && String(Number(key)) === key && key < obj.length) {
|
|
1301
|
+
continue;
|
|
1302
|
+
}
|
|
1303
|
+
if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
|
|
1304
|
+
continue;
|
|
1305
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
1306
|
+
xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
|
|
1307
|
+
} else {
|
|
1308
|
+
xs.push(key + ": " + inspect(obj[key], obj));
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
if (typeof gOPS === "function") {
|
|
1312
|
+
for (var j = 0; j < syms.length; j++) {
|
|
1313
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
1314
|
+
xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj));
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
return xs;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
|
|
1323
|
+
// ../../node_modules/side-channel/index.js
|
|
1324
|
+
var require_side_channel = __commonJS({
|
|
1325
|
+
"../../node_modules/side-channel/index.js"(exports, module) {
|
|
1326
|
+
"use strict";
|
|
1327
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
1328
|
+
var callBound = require_callBound();
|
|
1329
|
+
var inspect = require_object_inspect();
|
|
1330
|
+
var $TypeError = require_type();
|
|
1331
|
+
var $WeakMap = GetIntrinsic("%WeakMap%", true);
|
|
1332
|
+
var $Map = GetIntrinsic("%Map%", true);
|
|
1333
|
+
var $weakMapGet = callBound("WeakMap.prototype.get", true);
|
|
1334
|
+
var $weakMapSet = callBound("WeakMap.prototype.set", true);
|
|
1335
|
+
var $weakMapHas = callBound("WeakMap.prototype.has", true);
|
|
1336
|
+
var $mapGet = callBound("Map.prototype.get", true);
|
|
1337
|
+
var $mapSet = callBound("Map.prototype.set", true);
|
|
1338
|
+
var $mapHas = callBound("Map.prototype.has", true);
|
|
1339
|
+
var listGetNode = function(list, key) {
|
|
1340
|
+
var prev = list;
|
|
1341
|
+
var curr;
|
|
1342
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
1343
|
+
if (curr.key === key) {
|
|
1344
|
+
prev.next = curr.next;
|
|
1345
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */
|
|
1346
|
+
list.next;
|
|
1347
|
+
list.next = curr;
|
|
1348
|
+
return curr;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
var listGet = function(objects, key) {
|
|
1353
|
+
var node = listGetNode(objects, key);
|
|
1354
|
+
return node && node.value;
|
|
1355
|
+
};
|
|
1356
|
+
var listSet = function(objects, key, value) {
|
|
1357
|
+
var node = listGetNode(objects, key);
|
|
1358
|
+
if (node) {
|
|
1359
|
+
node.value = value;
|
|
1360
|
+
} else {
|
|
1361
|
+
objects.next = /** @type {import('.').ListNode<typeof value>} */
|
|
1362
|
+
{
|
|
1363
|
+
// eslint-disable-line no-param-reassign, no-extra-parens
|
|
1364
|
+
key,
|
|
1365
|
+
next: objects.next,
|
|
1366
|
+
value
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
var listHas = function(objects, key) {
|
|
1371
|
+
return !!listGetNode(objects, key);
|
|
1372
|
+
};
|
|
1373
|
+
module.exports = function getSideChannel() {
|
|
1374
|
+
var $wm;
|
|
1375
|
+
var $m;
|
|
1376
|
+
var $o;
|
|
1377
|
+
var channel = {
|
|
1378
|
+
assert: function(key) {
|
|
1379
|
+
if (!channel.has(key)) {
|
|
1380
|
+
throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
1381
|
+
}
|
|
1382
|
+
},
|
|
1383
|
+
get: function(key) {
|
|
1384
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1385
|
+
if ($wm) {
|
|
1386
|
+
return $weakMapGet($wm, key);
|
|
1387
|
+
}
|
|
1388
|
+
} else if ($Map) {
|
|
1389
|
+
if ($m) {
|
|
1390
|
+
return $mapGet($m, key);
|
|
1391
|
+
}
|
|
1392
|
+
} else {
|
|
1393
|
+
if ($o) {
|
|
1394
|
+
return listGet($o, key);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
},
|
|
1398
|
+
has: function(key) {
|
|
1399
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1400
|
+
if ($wm) {
|
|
1401
|
+
return $weakMapHas($wm, key);
|
|
1402
|
+
}
|
|
1403
|
+
} else if ($Map) {
|
|
1404
|
+
if ($m) {
|
|
1405
|
+
return $mapHas($m, key);
|
|
1406
|
+
}
|
|
1407
|
+
} else {
|
|
1408
|
+
if ($o) {
|
|
1409
|
+
return listHas($o, key);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
return false;
|
|
1413
|
+
},
|
|
1414
|
+
set: function(key, value) {
|
|
1415
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1416
|
+
if (!$wm) {
|
|
1417
|
+
$wm = new $WeakMap();
|
|
1418
|
+
}
|
|
1419
|
+
$weakMapSet($wm, key, value);
|
|
1420
|
+
} else if ($Map) {
|
|
1421
|
+
if (!$m) {
|
|
1422
|
+
$m = new $Map();
|
|
1423
|
+
}
|
|
1424
|
+
$mapSet($m, key, value);
|
|
1425
|
+
} else {
|
|
1426
|
+
if (!$o) {
|
|
1427
|
+
$o = { key: {}, next: null };
|
|
1428
|
+
}
|
|
1429
|
+
listSet($o, key, value);
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
return channel;
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
|
|
1438
|
+
// ../../node_modules/qs/lib/formats.js
|
|
1439
|
+
var require_formats = __commonJS({
|
|
1440
|
+
"../../node_modules/qs/lib/formats.js"(exports, module) {
|
|
1441
|
+
"use strict";
|
|
1442
|
+
var replace = String.prototype.replace;
|
|
1443
|
+
var percentTwenties = /%20/g;
|
|
1444
|
+
var Format = {
|
|
1445
|
+
RFC1738: "RFC1738",
|
|
1446
|
+
RFC3986: "RFC3986"
|
|
1447
|
+
};
|
|
1448
|
+
module.exports = {
|
|
1449
|
+
"default": Format.RFC3986,
|
|
1450
|
+
formatters: {
|
|
1451
|
+
RFC1738: function(value) {
|
|
1452
|
+
return replace.call(value, percentTwenties, "+");
|
|
1453
|
+
},
|
|
1454
|
+
RFC3986: function(value) {
|
|
1455
|
+
return String(value);
|
|
1456
|
+
}
|
|
1457
|
+
},
|
|
1458
|
+
RFC1738: Format.RFC1738,
|
|
1459
|
+
RFC3986: Format.RFC3986
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
// ../../node_modules/qs/lib/utils.js
|
|
1465
|
+
var require_utils = __commonJS({
|
|
1466
|
+
"../../node_modules/qs/lib/utils.js"(exports, module) {
|
|
1467
|
+
"use strict";
|
|
1468
|
+
var formats = require_formats();
|
|
1469
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1470
|
+
var isArray = Array.isArray;
|
|
1471
|
+
var hexTable = function() {
|
|
1472
|
+
var array = [];
|
|
1473
|
+
for (var i = 0; i < 256; ++i) {
|
|
1474
|
+
array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
|
|
1475
|
+
}
|
|
1476
|
+
return array;
|
|
1477
|
+
}();
|
|
1478
|
+
var compactQueue = function compactQueue2(queue) {
|
|
1479
|
+
while (queue.length > 1) {
|
|
1480
|
+
var item = queue.pop();
|
|
1481
|
+
var obj = item.obj[item.prop];
|
|
1482
|
+
if (isArray(obj)) {
|
|
1483
|
+
var compacted = [];
|
|
1484
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
1485
|
+
if (typeof obj[j] !== "undefined") {
|
|
1486
|
+
compacted.push(obj[j]);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
item.obj[item.prop] = compacted;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
var arrayToObject = function arrayToObject2(source, options) {
|
|
1494
|
+
var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
1495
|
+
for (var i = 0; i < source.length; ++i) {
|
|
1496
|
+
if (typeof source[i] !== "undefined") {
|
|
1497
|
+
obj[i] = source[i];
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
return obj;
|
|
1501
|
+
};
|
|
1502
|
+
var merge = function merge2(target, source, options) {
|
|
1503
|
+
if (!source) {
|
|
1504
|
+
return target;
|
|
1505
|
+
}
|
|
1506
|
+
if (typeof source !== "object") {
|
|
1507
|
+
if (isArray(target)) {
|
|
1508
|
+
target.push(source);
|
|
1509
|
+
} else if (target && typeof target === "object") {
|
|
1510
|
+
if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
|
|
1511
|
+
target[source] = true;
|
|
1512
|
+
}
|
|
1513
|
+
} else {
|
|
1514
|
+
return [target, source];
|
|
1515
|
+
}
|
|
1516
|
+
return target;
|
|
1517
|
+
}
|
|
1518
|
+
if (!target || typeof target !== "object") {
|
|
1519
|
+
return [target].concat(source);
|
|
1520
|
+
}
|
|
1521
|
+
var mergeTarget = target;
|
|
1522
|
+
if (isArray(target) && !isArray(source)) {
|
|
1523
|
+
mergeTarget = arrayToObject(target, options);
|
|
1524
|
+
}
|
|
1525
|
+
if (isArray(target) && isArray(source)) {
|
|
1526
|
+
source.forEach(function(item, i) {
|
|
1527
|
+
if (has.call(target, i)) {
|
|
1528
|
+
var targetItem = target[i];
|
|
1529
|
+
if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
|
|
1530
|
+
target[i] = merge2(targetItem, item, options);
|
|
1531
|
+
} else {
|
|
1532
|
+
target.push(item);
|
|
1533
|
+
}
|
|
1534
|
+
} else {
|
|
1535
|
+
target[i] = item;
|
|
1536
|
+
}
|
|
1537
|
+
});
|
|
1538
|
+
return target;
|
|
1539
|
+
}
|
|
1540
|
+
return Object.keys(source).reduce(function(acc, key) {
|
|
1541
|
+
var value = source[key];
|
|
1542
|
+
if (has.call(acc, key)) {
|
|
1543
|
+
acc[key] = merge2(acc[key], value, options);
|
|
1544
|
+
} else {
|
|
1545
|
+
acc[key] = value;
|
|
1546
|
+
}
|
|
1547
|
+
return acc;
|
|
1548
|
+
}, mergeTarget);
|
|
1549
|
+
};
|
|
1550
|
+
var assign = function assignSingleSource(target, source) {
|
|
1551
|
+
return Object.keys(source).reduce(function(acc, key) {
|
|
1552
|
+
acc[key] = source[key];
|
|
1553
|
+
return acc;
|
|
1554
|
+
}, target);
|
|
1555
|
+
};
|
|
1556
|
+
var decode = function(str, decoder, charset) {
|
|
1557
|
+
var strWithoutPlus = str.replace(/\+/g, " ");
|
|
1558
|
+
if (charset === "iso-8859-1") {
|
|
1559
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
1560
|
+
}
|
|
1561
|
+
try {
|
|
1562
|
+
return decodeURIComponent(strWithoutPlus);
|
|
1563
|
+
} catch (e) {
|
|
1564
|
+
return strWithoutPlus;
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
var limit = 1024;
|
|
1568
|
+
var encode = function encode2(str, defaultEncoder, charset, kind, format) {
|
|
1569
|
+
if (str.length === 0) {
|
|
1570
|
+
return str;
|
|
1571
|
+
}
|
|
1572
|
+
var string = str;
|
|
1573
|
+
if (typeof str === "symbol") {
|
|
1574
|
+
string = Symbol.prototype.toString.call(str);
|
|
1575
|
+
} else if (typeof str !== "string") {
|
|
1576
|
+
string = String(str);
|
|
1577
|
+
}
|
|
1578
|
+
if (charset === "iso-8859-1") {
|
|
1579
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
|
|
1580
|
+
return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
var out = "";
|
|
1584
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
1585
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
1586
|
+
var arr = [];
|
|
1587
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
1588
|
+
var c = segment.charCodeAt(i);
|
|
1589
|
+
if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
|
|
1590
|
+
arr[arr.length] = segment.charAt(i);
|
|
1591
|
+
continue;
|
|
1592
|
+
}
|
|
1593
|
+
if (c < 128) {
|
|
1594
|
+
arr[arr.length] = hexTable[c];
|
|
1595
|
+
continue;
|
|
1596
|
+
}
|
|
1597
|
+
if (c < 2048) {
|
|
1598
|
+
arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
|
|
1599
|
+
continue;
|
|
1600
|
+
}
|
|
1601
|
+
if (c < 55296 || c >= 57344) {
|
|
1602
|
+
arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
1603
|
+
continue;
|
|
1604
|
+
}
|
|
1605
|
+
i += 1;
|
|
1606
|
+
c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
|
|
1607
|
+
arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
1608
|
+
}
|
|
1609
|
+
out += arr.join("");
|
|
1610
|
+
}
|
|
1611
|
+
return out;
|
|
1612
|
+
};
|
|
1613
|
+
var compact = function compact2(value) {
|
|
1614
|
+
var queue = [{ obj: { o: value }, prop: "o" }];
|
|
1615
|
+
var refs = [];
|
|
1616
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
1617
|
+
var item = queue[i];
|
|
1618
|
+
var obj = item.obj[item.prop];
|
|
1619
|
+
var keys = Object.keys(obj);
|
|
1620
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
1621
|
+
var key = keys[j];
|
|
1622
|
+
var val = obj[key];
|
|
1623
|
+
if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
|
|
1624
|
+
queue.push({ obj, prop: key });
|
|
1625
|
+
refs.push(val);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
compactQueue(queue);
|
|
1630
|
+
return value;
|
|
1631
|
+
};
|
|
1632
|
+
var isRegExp = function isRegExp2(obj) {
|
|
1633
|
+
return Object.prototype.toString.call(obj) === "[object RegExp]";
|
|
1634
|
+
};
|
|
1635
|
+
var isBuffer = function isBuffer2(obj) {
|
|
1636
|
+
if (!obj || typeof obj !== "object") {
|
|
1637
|
+
return false;
|
|
1638
|
+
}
|
|
1639
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
1640
|
+
};
|
|
1641
|
+
var combine = function combine2(a, b) {
|
|
1642
|
+
return [].concat(a, b);
|
|
1643
|
+
};
|
|
1644
|
+
var maybeMap = function maybeMap2(val, fn) {
|
|
1645
|
+
if (isArray(val)) {
|
|
1646
|
+
var mapped = [];
|
|
1647
|
+
for (var i = 0; i < val.length; i += 1) {
|
|
1648
|
+
mapped.push(fn(val[i]));
|
|
1649
|
+
}
|
|
1650
|
+
return mapped;
|
|
1651
|
+
}
|
|
1652
|
+
return fn(val);
|
|
1653
|
+
};
|
|
1654
|
+
module.exports = {
|
|
1655
|
+
arrayToObject,
|
|
1656
|
+
assign,
|
|
1657
|
+
combine,
|
|
1658
|
+
compact,
|
|
1659
|
+
decode,
|
|
1660
|
+
encode,
|
|
1661
|
+
isBuffer,
|
|
1662
|
+
isRegExp,
|
|
1663
|
+
maybeMap,
|
|
1664
|
+
merge
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
|
|
1669
|
+
// ../../node_modules/qs/lib/stringify.js
|
|
1670
|
+
var require_stringify = __commonJS({
|
|
1671
|
+
"../../node_modules/qs/lib/stringify.js"(exports, module) {
|
|
1672
|
+
"use strict";
|
|
1673
|
+
var getSideChannel = require_side_channel();
|
|
1674
|
+
var utils = require_utils();
|
|
1675
|
+
var formats = require_formats();
|
|
1676
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1677
|
+
var arrayPrefixGenerators = {
|
|
1678
|
+
brackets: function brackets(prefix) {
|
|
1679
|
+
return prefix + "[]";
|
|
1680
|
+
},
|
|
1681
|
+
comma: "comma",
|
|
1682
|
+
indices: function indices(prefix, key) {
|
|
1683
|
+
return prefix + "[" + key + "]";
|
|
1684
|
+
},
|
|
1685
|
+
repeat: function repeat(prefix) {
|
|
1686
|
+
return prefix;
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
var isArray = Array.isArray;
|
|
1690
|
+
var push = Array.prototype.push;
|
|
1691
|
+
var pushToArray = function(arr, valueOrArray) {
|
|
1692
|
+
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
1693
|
+
};
|
|
1694
|
+
var toISO = Date.prototype.toISOString;
|
|
1695
|
+
var defaultFormat = formats["default"];
|
|
1696
|
+
var defaults = {
|
|
1697
|
+
addQueryPrefix: false,
|
|
1698
|
+
allowDots: false,
|
|
1699
|
+
allowEmptyArrays: false,
|
|
1700
|
+
arrayFormat: "indices",
|
|
1701
|
+
charset: "utf-8",
|
|
1702
|
+
charsetSentinel: false,
|
|
1703
|
+
delimiter: "&",
|
|
1704
|
+
encode: true,
|
|
1705
|
+
encodeDotInKeys: false,
|
|
1706
|
+
encoder: utils.encode,
|
|
1707
|
+
encodeValuesOnly: false,
|
|
1708
|
+
format: defaultFormat,
|
|
1709
|
+
formatter: formats.formatters[defaultFormat],
|
|
1710
|
+
// deprecated
|
|
1711
|
+
indices: false,
|
|
1712
|
+
serializeDate: function serializeDate(date) {
|
|
1713
|
+
return toISO.call(date);
|
|
1714
|
+
},
|
|
1715
|
+
skipNulls: false,
|
|
1716
|
+
strictNullHandling: false
|
|
1717
|
+
};
|
|
1718
|
+
var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
|
|
1719
|
+
return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
|
|
1720
|
+
};
|
|
1721
|
+
var sentinel = {};
|
|
1722
|
+
var stringify = function stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
1723
|
+
var obj = object;
|
|
1724
|
+
var tmpSc = sideChannel;
|
|
1725
|
+
var step = 0;
|
|
1726
|
+
var findFlag = false;
|
|
1727
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
|
|
1728
|
+
var pos = tmpSc.get(object);
|
|
1729
|
+
step += 1;
|
|
1730
|
+
if (typeof pos !== "undefined") {
|
|
1731
|
+
if (pos === step) {
|
|
1732
|
+
throw new RangeError("Cyclic object value");
|
|
1733
|
+
} else {
|
|
1734
|
+
findFlag = true;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
if (typeof tmpSc.get(sentinel) === "undefined") {
|
|
1738
|
+
step = 0;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
if (typeof filter === "function") {
|
|
1742
|
+
obj = filter(prefix, obj);
|
|
1743
|
+
} else if (obj instanceof Date) {
|
|
1744
|
+
obj = serializeDate(obj);
|
|
1745
|
+
} else if (generateArrayPrefix === "comma" && isArray(obj)) {
|
|
1746
|
+
obj = utils.maybeMap(obj, function(value2) {
|
|
1747
|
+
if (value2 instanceof Date) {
|
|
1748
|
+
return serializeDate(value2);
|
|
1749
|
+
}
|
|
1750
|
+
return value2;
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
if (obj === null) {
|
|
1754
|
+
if (strictNullHandling) {
|
|
1755
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
|
|
1756
|
+
}
|
|
1757
|
+
obj = "";
|
|
1758
|
+
}
|
|
1759
|
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
1760
|
+
if (encoder) {
|
|
1761
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format);
|
|
1762
|
+
return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))];
|
|
1763
|
+
}
|
|
1764
|
+
return [formatter(prefix) + "=" + formatter(String(obj))];
|
|
1765
|
+
}
|
|
1766
|
+
var values = [];
|
|
1767
|
+
if (typeof obj === "undefined") {
|
|
1768
|
+
return values;
|
|
1769
|
+
}
|
|
1770
|
+
var objKeys;
|
|
1771
|
+
if (generateArrayPrefix === "comma" && isArray(obj)) {
|
|
1772
|
+
if (encodeValuesOnly && encoder) {
|
|
1773
|
+
obj = utils.maybeMap(obj, encoder);
|
|
1774
|
+
}
|
|
1775
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
|
|
1776
|
+
} else if (isArray(filter)) {
|
|
1777
|
+
objKeys = filter;
|
|
1778
|
+
} else {
|
|
1779
|
+
var keys = Object.keys(obj);
|
|
1780
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
1781
|
+
}
|
|
1782
|
+
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix;
|
|
1783
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
|
|
1784
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
1785
|
+
return adjustedPrefix + "[]";
|
|
1786
|
+
}
|
|
1787
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
1788
|
+
var key = objKeys[j];
|
|
1789
|
+
var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
|
|
1790
|
+
if (skipNulls && value === null) {
|
|
1791
|
+
continue;
|
|
1792
|
+
}
|
|
1793
|
+
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key;
|
|
1794
|
+
var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
|
|
1795
|
+
sideChannel.set(object, step);
|
|
1796
|
+
var valueSideChannel = getSideChannel();
|
|
1797
|
+
valueSideChannel.set(sentinel, sideChannel);
|
|
1798
|
+
pushToArray(values, stringify2(
|
|
1799
|
+
value,
|
|
1800
|
+
keyPrefix,
|
|
1801
|
+
generateArrayPrefix,
|
|
1802
|
+
commaRoundTrip,
|
|
1803
|
+
allowEmptyArrays,
|
|
1804
|
+
strictNullHandling,
|
|
1805
|
+
skipNulls,
|
|
1806
|
+
encodeDotInKeys,
|
|
1807
|
+
generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
1808
|
+
filter,
|
|
1809
|
+
sort,
|
|
1810
|
+
allowDots,
|
|
1811
|
+
serializeDate,
|
|
1812
|
+
format,
|
|
1813
|
+
formatter,
|
|
1814
|
+
encodeValuesOnly,
|
|
1815
|
+
charset,
|
|
1816
|
+
valueSideChannel
|
|
1817
|
+
));
|
|
1818
|
+
}
|
|
1819
|
+
return values;
|
|
1820
|
+
};
|
|
1821
|
+
var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
|
|
1822
|
+
if (!opts) {
|
|
1823
|
+
return defaults;
|
|
1824
|
+
}
|
|
1825
|
+
if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
|
|
1826
|
+
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
1827
|
+
}
|
|
1828
|
+
if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
|
|
1829
|
+
throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
1830
|
+
}
|
|
1831
|
+
if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
|
|
1832
|
+
throw new TypeError("Encoder has to be a function.");
|
|
1833
|
+
}
|
|
1834
|
+
var charset = opts.charset || defaults.charset;
|
|
1835
|
+
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
|
|
1836
|
+
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
1837
|
+
}
|
|
1838
|
+
var format = formats["default"];
|
|
1839
|
+
if (typeof opts.format !== "undefined") {
|
|
1840
|
+
if (!has.call(formats.formatters, opts.format)) {
|
|
1841
|
+
throw new TypeError("Unknown format option provided.");
|
|
1842
|
+
}
|
|
1843
|
+
format = opts.format;
|
|
1844
|
+
}
|
|
1845
|
+
var formatter = formats.formatters[format];
|
|
1846
|
+
var filter = defaults.filter;
|
|
1847
|
+
if (typeof opts.filter === "function" || isArray(opts.filter)) {
|
|
1848
|
+
filter = opts.filter;
|
|
1849
|
+
}
|
|
1850
|
+
var arrayFormat;
|
|
1851
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
1852
|
+
arrayFormat = opts.arrayFormat;
|
|
1853
|
+
} else if ("indices" in opts) {
|
|
1854
|
+
arrayFormat = opts.indices ? "indices" : "repeat";
|
|
1855
|
+
} else {
|
|
1856
|
+
arrayFormat = defaults.arrayFormat;
|
|
1857
|
+
}
|
|
1858
|
+
if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
|
|
1859
|
+
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
1860
|
+
}
|
|
1861
|
+
var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
1862
|
+
return {
|
|
1863
|
+
addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
1864
|
+
allowDots,
|
|
1865
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
1866
|
+
arrayFormat,
|
|
1867
|
+
charset,
|
|
1868
|
+
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
1869
|
+
commaRoundTrip: opts.commaRoundTrip,
|
|
1870
|
+
delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
|
|
1871
|
+
encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
|
|
1872
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
1873
|
+
encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
|
|
1874
|
+
encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
1875
|
+
filter,
|
|
1876
|
+
format,
|
|
1877
|
+
formatter,
|
|
1878
|
+
serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
|
|
1879
|
+
skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
|
|
1880
|
+
sort: typeof opts.sort === "function" ? opts.sort : null,
|
|
1881
|
+
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
module.exports = function(object, opts) {
|
|
1885
|
+
var obj = object;
|
|
1886
|
+
var options = normalizeStringifyOptions(opts);
|
|
1887
|
+
var objKeys;
|
|
1888
|
+
var filter;
|
|
1889
|
+
if (typeof options.filter === "function") {
|
|
1890
|
+
filter = options.filter;
|
|
1891
|
+
obj = filter("", obj);
|
|
1892
|
+
} else if (isArray(options.filter)) {
|
|
1893
|
+
filter = options.filter;
|
|
1894
|
+
objKeys = filter;
|
|
1895
|
+
}
|
|
1896
|
+
var keys = [];
|
|
1897
|
+
if (typeof obj !== "object" || obj === null) {
|
|
1898
|
+
return "";
|
|
1899
|
+
}
|
|
1900
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
1901
|
+
var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
|
|
1902
|
+
if (!objKeys) {
|
|
1903
|
+
objKeys = Object.keys(obj);
|
|
1904
|
+
}
|
|
1905
|
+
if (options.sort) {
|
|
1906
|
+
objKeys.sort(options.sort);
|
|
1907
|
+
}
|
|
1908
|
+
var sideChannel = getSideChannel();
|
|
1909
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
1910
|
+
var key = objKeys[i];
|
|
1911
|
+
if (options.skipNulls && obj[key] === null) {
|
|
1912
|
+
continue;
|
|
1913
|
+
}
|
|
1914
|
+
pushToArray(keys, stringify(
|
|
1915
|
+
obj[key],
|
|
1916
|
+
key,
|
|
1917
|
+
generateArrayPrefix,
|
|
1918
|
+
commaRoundTrip,
|
|
1919
|
+
options.allowEmptyArrays,
|
|
1920
|
+
options.strictNullHandling,
|
|
1921
|
+
options.skipNulls,
|
|
1922
|
+
options.encodeDotInKeys,
|
|
1923
|
+
options.encode ? options.encoder : null,
|
|
1924
|
+
options.filter,
|
|
1925
|
+
options.sort,
|
|
1926
|
+
options.allowDots,
|
|
1927
|
+
options.serializeDate,
|
|
1928
|
+
options.format,
|
|
1929
|
+
options.formatter,
|
|
1930
|
+
options.encodeValuesOnly,
|
|
1931
|
+
options.charset,
|
|
1932
|
+
sideChannel
|
|
1933
|
+
));
|
|
1934
|
+
}
|
|
1935
|
+
var joined = keys.join(options.delimiter);
|
|
1936
|
+
var prefix = options.addQueryPrefix === true ? "?" : "";
|
|
1937
|
+
if (options.charsetSentinel) {
|
|
1938
|
+
if (options.charset === "iso-8859-1") {
|
|
1939
|
+
prefix += "utf8=%26%2310003%3B&";
|
|
1940
|
+
} else {
|
|
1941
|
+
prefix += "utf8=%E2%9C%93&";
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
return joined.length > 0 ? prefix + joined : "";
|
|
1945
|
+
};
|
|
1946
|
+
}
|
|
1947
|
+
});
|
|
1948
|
+
|
|
1949
|
+
// ../../node_modules/qs/lib/parse.js
|
|
1950
|
+
var require_parse = __commonJS({
|
|
1951
|
+
"../../node_modules/qs/lib/parse.js"(exports, module) {
|
|
1952
|
+
"use strict";
|
|
1953
|
+
var utils = require_utils();
|
|
1954
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1955
|
+
var isArray = Array.isArray;
|
|
1956
|
+
var defaults = {
|
|
1957
|
+
allowDots: false,
|
|
1958
|
+
allowEmptyArrays: false,
|
|
1959
|
+
allowPrototypes: false,
|
|
1960
|
+
allowSparse: false,
|
|
1961
|
+
arrayLimit: 20,
|
|
1962
|
+
charset: "utf-8",
|
|
1963
|
+
charsetSentinel: false,
|
|
1964
|
+
comma: false,
|
|
1965
|
+
decodeDotInKeys: false,
|
|
1966
|
+
decoder: utils.decode,
|
|
1967
|
+
delimiter: "&",
|
|
1968
|
+
depth: 5,
|
|
1969
|
+
duplicates: "combine",
|
|
1970
|
+
ignoreQueryPrefix: false,
|
|
1971
|
+
interpretNumericEntities: false,
|
|
1972
|
+
parameterLimit: 1e3,
|
|
1973
|
+
parseArrays: true,
|
|
1974
|
+
plainObjects: false,
|
|
1975
|
+
strictDepth: false,
|
|
1976
|
+
strictNullHandling: false
|
|
1977
|
+
};
|
|
1978
|
+
var interpretNumericEntities = function(str) {
|
|
1979
|
+
return str.replace(/&#(\d+);/g, function($0, numberStr) {
|
|
1980
|
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
1981
|
+
});
|
|
1982
|
+
};
|
|
1983
|
+
var parseArrayValue = function(val, options) {
|
|
1984
|
+
if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
|
|
1985
|
+
return val.split(",");
|
|
1986
|
+
}
|
|
1987
|
+
return val;
|
|
1988
|
+
};
|
|
1989
|
+
var isoSentinel = "utf8=%26%2310003%3B";
|
|
1990
|
+
var charsetSentinel = "utf8=%E2%9C%93";
|
|
1991
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
1992
|
+
var obj = { __proto__: null };
|
|
1993
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
1994
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1995
|
+
var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
1996
|
+
var parts = cleanStr.split(options.delimiter, limit);
|
|
1997
|
+
var skipIndex = -1;
|
|
1998
|
+
var i;
|
|
1999
|
+
var charset = options.charset;
|
|
2000
|
+
if (options.charsetSentinel) {
|
|
2001
|
+
for (i = 0; i < parts.length; ++i) {
|
|
2002
|
+
if (parts[i].indexOf("utf8=") === 0) {
|
|
2003
|
+
if (parts[i] === charsetSentinel) {
|
|
2004
|
+
charset = "utf-8";
|
|
2005
|
+
} else if (parts[i] === isoSentinel) {
|
|
2006
|
+
charset = "iso-8859-1";
|
|
2007
|
+
}
|
|
2008
|
+
skipIndex = i;
|
|
2009
|
+
i = parts.length;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
for (i = 0; i < parts.length; ++i) {
|
|
2014
|
+
if (i === skipIndex) {
|
|
2015
|
+
continue;
|
|
2016
|
+
}
|
|
2017
|
+
var part = parts[i];
|
|
2018
|
+
var bracketEqualsPos = part.indexOf("]=");
|
|
2019
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
|
|
2020
|
+
var key, val;
|
|
2021
|
+
if (pos === -1) {
|
|
2022
|
+
key = options.decoder(part, defaults.decoder, charset, "key");
|
|
2023
|
+
val = options.strictNullHandling ? null : "";
|
|
2024
|
+
} else {
|
|
2025
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
|
|
2026
|
+
val = utils.maybeMap(
|
|
2027
|
+
parseArrayValue(part.slice(pos + 1), options),
|
|
2028
|
+
function(encodedVal) {
|
|
2029
|
+
return options.decoder(encodedVal, defaults.decoder, charset, "value");
|
|
2030
|
+
}
|
|
2031
|
+
);
|
|
2032
|
+
}
|
|
2033
|
+
if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
|
|
2034
|
+
val = interpretNumericEntities(val);
|
|
2035
|
+
}
|
|
2036
|
+
if (part.indexOf("[]=") > -1) {
|
|
2037
|
+
val = isArray(val) ? [val] : val;
|
|
2038
|
+
}
|
|
2039
|
+
var existing = has.call(obj, key);
|
|
2040
|
+
if (existing && options.duplicates === "combine") {
|
|
2041
|
+
obj[key] = utils.combine(obj[key], val);
|
|
2042
|
+
} else if (!existing || options.duplicates === "last") {
|
|
2043
|
+
obj[key] = val;
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
return obj;
|
|
2047
|
+
};
|
|
2048
|
+
var parseObject = function(chain, val, options, valuesParsed) {
|
|
2049
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
|
2050
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
2051
|
+
var obj;
|
|
2052
|
+
var root = chain[i];
|
|
2053
|
+
if (root === "[]" && options.parseArrays) {
|
|
2054
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
|
|
2055
|
+
} else {
|
|
2056
|
+
obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
2057
|
+
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
2058
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
|
|
2059
|
+
var index = parseInt(decodedRoot, 10);
|
|
2060
|
+
if (!options.parseArrays && decodedRoot === "") {
|
|
2061
|
+
obj = { 0: leaf };
|
|
2062
|
+
} else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
|
|
2063
|
+
obj = [];
|
|
2064
|
+
obj[index] = leaf;
|
|
2065
|
+
} else if (decodedRoot !== "__proto__") {
|
|
2066
|
+
obj[decodedRoot] = leaf;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
leaf = obj;
|
|
2070
|
+
}
|
|
2071
|
+
return leaf;
|
|
2072
|
+
};
|
|
2073
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
2074
|
+
if (!givenKey) {
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
2077
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
|
|
2078
|
+
var brackets = /(\[[^[\]]*])/;
|
|
2079
|
+
var child = /(\[[^[\]]*])/g;
|
|
2080
|
+
var segment = options.depth > 0 && brackets.exec(key);
|
|
2081
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
2082
|
+
var keys = [];
|
|
2083
|
+
if (parent) {
|
|
2084
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
2085
|
+
if (!options.allowPrototypes) {
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
keys.push(parent);
|
|
2090
|
+
}
|
|
2091
|
+
var i = 0;
|
|
2092
|
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
|
2093
|
+
i += 1;
|
|
2094
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
2095
|
+
if (!options.allowPrototypes) {
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
keys.push(segment[1]);
|
|
2100
|
+
}
|
|
2101
|
+
if (segment) {
|
|
2102
|
+
if (options.strictDepth === true) {
|
|
2103
|
+
throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
2104
|
+
}
|
|
2105
|
+
keys.push("[" + key.slice(segment.index) + "]");
|
|
2106
|
+
}
|
|
2107
|
+
return parseObject(keys, val, options, valuesParsed);
|
|
2108
|
+
};
|
|
2109
|
+
var normalizeParseOptions = function normalizeParseOptions2(opts) {
|
|
2110
|
+
if (!opts) {
|
|
2111
|
+
return defaults;
|
|
2112
|
+
}
|
|
2113
|
+
if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
|
|
2114
|
+
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
2115
|
+
}
|
|
2116
|
+
if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
|
|
2117
|
+
throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
2118
|
+
}
|
|
2119
|
+
if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
|
|
2120
|
+
throw new TypeError("Decoder has to be a function.");
|
|
2121
|
+
}
|
|
2122
|
+
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
|
|
2123
|
+
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
2124
|
+
}
|
|
2125
|
+
var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
|
|
2126
|
+
var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
|
|
2127
|
+
if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
|
|
2128
|
+
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
2129
|
+
}
|
|
2130
|
+
var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
2131
|
+
return {
|
|
2132
|
+
allowDots,
|
|
2133
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
2134
|
+
allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2135
|
+
allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
|
|
2136
|
+
arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
|
|
2137
|
+
charset,
|
|
2138
|
+
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2139
|
+
comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
|
|
2140
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
2141
|
+
decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
|
|
2142
|
+
delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2143
|
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2144
|
+
depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
|
|
2145
|
+
duplicates,
|
|
2146
|
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2147
|
+
interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2148
|
+
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
2149
|
+
parseArrays: opts.parseArrays !== false,
|
|
2150
|
+
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
2151
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
2152
|
+
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
2153
|
+
};
|
|
2154
|
+
};
|
|
2155
|
+
module.exports = function(str, opts) {
|
|
2156
|
+
var options = normalizeParseOptions(opts);
|
|
2157
|
+
if (str === "" || str === null || typeof str === "undefined") {
|
|
2158
|
+
return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
2159
|
+
}
|
|
2160
|
+
var tempObj = typeof str === "string" ? parseValues(str, options) : str;
|
|
2161
|
+
var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
2162
|
+
var keys = Object.keys(tempObj);
|
|
2163
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
2164
|
+
var key = keys[i];
|
|
2165
|
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
|
|
2166
|
+
obj = utils.merge(obj, newObj, options);
|
|
2167
|
+
}
|
|
2168
|
+
if (options.allowSparse === true) {
|
|
2169
|
+
return obj;
|
|
2170
|
+
}
|
|
2171
|
+
return utils.compact(obj);
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
|
|
2176
|
+
// ../../node_modules/qs/lib/index.js
|
|
2177
|
+
var require_lib = __commonJS({
|
|
2178
|
+
"../../node_modules/qs/lib/index.js"(exports, module) {
|
|
2179
|
+
"use strict";
|
|
2180
|
+
var stringify = require_stringify();
|
|
2181
|
+
var parse = require_parse();
|
|
2182
|
+
var formats = require_formats();
|
|
2183
|
+
module.exports = {
|
|
2184
|
+
formats,
|
|
2185
|
+
parse,
|
|
2186
|
+
stringify
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2189
|
+
});
|
|
2190
|
+
|
|
2191
|
+
// src/factories/index.ts
|
|
2192
|
+
import {
|
|
2193
|
+
createSlice,
|
|
2194
|
+
createEntityAdapter,
|
|
2195
|
+
combineReducers
|
|
2196
|
+
} from "@reduxjs/toolkit";
|
|
2197
|
+
|
|
2198
|
+
// src/factories/thunk.ts
|
|
2199
|
+
import { createAsyncThunk } from "@reduxjs/toolkit";
|
|
2200
|
+
|
|
2201
|
+
// src/factories/api.ts
|
|
2202
|
+
var import_qs = __toESM(require_lib());
|
|
2203
|
+
import axios from "axios";
|
|
2204
|
+
|
|
2205
|
+
// src/factories/cache.ts
|
|
2206
|
+
var cache = (options = {}) => {
|
|
2207
|
+
var engine = options.type == "local" ? "localStorage" : "sessionStorage";
|
|
2208
|
+
return {
|
|
2209
|
+
check: () => {
|
|
2210
|
+
if (!window[engine]) {
|
|
2211
|
+
return false;
|
|
2212
|
+
}
|
|
2213
|
+
return true;
|
|
2214
|
+
},
|
|
2215
|
+
set: (key, value) => {
|
|
2216
|
+
if (!key) throw Error("Error:> Invalid key");
|
|
2217
|
+
try {
|
|
2218
|
+
window[engine].setItem(key, JSON.stringify(value));
|
|
2219
|
+
} catch (error) {
|
|
2220
|
+
console.error(`Error setting item ${key}:`, error);
|
|
2221
|
+
return false;
|
|
2222
|
+
}
|
|
2223
|
+
return true;
|
|
2224
|
+
},
|
|
2225
|
+
get: (key) => {
|
|
2226
|
+
try {
|
|
2227
|
+
if (key !== "undefined") {
|
|
2228
|
+
const data = window[engine].getItem(key);
|
|
2229
|
+
return data ? JSON.parse(data) : null;
|
|
2230
|
+
}
|
|
2231
|
+
} catch (error) {
|
|
2232
|
+
console.error(`Error getting item ${key}:`, error);
|
|
2233
|
+
return null;
|
|
2234
|
+
}
|
|
2235
|
+
},
|
|
2236
|
+
remove: function(key) {
|
|
2237
|
+
window[engine].removeItem(key);
|
|
2238
|
+
},
|
|
2239
|
+
clear: () => {
|
|
2240
|
+
window[engine].clear();
|
|
2241
|
+
},
|
|
2242
|
+
keys: () => {
|
|
2243
|
+
return Object.keys(window[engine]);
|
|
2244
|
+
},
|
|
2245
|
+
has: (key) => {
|
|
2246
|
+
return window[engine].getItem(key) !== null;
|
|
2247
|
+
}
|
|
2248
|
+
/*
|
|
2249
|
+
_extend: () => {
|
|
2250
|
+
const destination = typeof arguments[0] === 'object' ? arguments[0] : {};
|
|
2251
|
+
|
|
2252
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2253
|
+
if (arguments[i] && typeof arguments[i] === 'object') {
|
|
2254
|
+
for (var property in arguments[i])
|
|
2255
|
+
destination[property] = arguments[i][property];
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
return destination;
|
|
2260
|
+
}
|
|
2261
|
+
*/
|
|
2262
|
+
};
|
|
2263
|
+
};
|
|
2264
|
+
cache.local = cache({ type: "local" });
|
|
2265
|
+
cache.session = cache({ type: "session" });
|
|
2266
|
+
var cache_default = cache;
|
|
2267
|
+
|
|
2268
|
+
// src/factories/api.ts
|
|
2269
|
+
var API_BASE_URL = process.env.NODE_ENV === "production" ? "http://fear.master.com:4000/fear/api/" : "http://localhost:4000/fear/api/";
|
|
2270
|
+
var ACCESS_TOKEN_NAME = process.env.JWT_TOKEN ? process.env.JWT_TOKEN : "x-token";
|
|
2271
|
+
var instance = axios.create({
|
|
2272
|
+
baseURL: `${API_BASE_URL}`,
|
|
2273
|
+
headers: {
|
|
2274
|
+
Accept: "application/json",
|
|
2275
|
+
"Content-Type": "application/json"
|
|
2276
|
+
},
|
|
2277
|
+
paramsSerializer: (params) => {
|
|
2278
|
+
return import_qs.default.stringify(params, { indexes: false });
|
|
2279
|
+
},
|
|
2280
|
+
credentials: true
|
|
2281
|
+
//httpsAgent: new https.Agent({ rejectUnauthorized: false })
|
|
2282
|
+
});
|
|
2283
|
+
instance.interceptors.request.use(
|
|
2284
|
+
(config) => {
|
|
2285
|
+
const isAuth = cache_default.local.get("auth") ? cache_default.local.get("auth") : null;
|
|
2286
|
+
let token = isAuth !== null ? isAuth.token : "";
|
|
2287
|
+
config.headers = {
|
|
2288
|
+
Authorization: `Bearer ${token}`,
|
|
2289
|
+
[ACCESS_TOKEN_NAME]: token
|
|
2290
|
+
};
|
|
2291
|
+
return config;
|
|
2292
|
+
},
|
|
2293
|
+
(error) => {
|
|
2294
|
+
Promise.reject(error);
|
|
2295
|
+
}
|
|
2296
|
+
);
|
|
2297
|
+
instance.interceptors.response.use(
|
|
2298
|
+
(response) => {
|
|
2299
|
+
console.log("API RES :: ", response);
|
|
2300
|
+
const messages = response.data.message;
|
|
2301
|
+
if (response.status === 200 || 203) {
|
|
2302
|
+
return response;
|
|
2303
|
+
}
|
|
2304
|
+
if (messages) return Promise.reject({ messages: [messages] });
|
|
2305
|
+
return Promise.reject({ messages: ["got errors"] });
|
|
2306
|
+
},
|
|
2307
|
+
(error) => {
|
|
2308
|
+
console.log("API ERROR :: ", error);
|
|
2309
|
+
if (error.response) {
|
|
2310
|
+
if (error.response.status === 401) {
|
|
2311
|
+
cache_default.local.remove("auth");
|
|
2312
|
+
return Promise.reject(error.response);
|
|
2313
|
+
}
|
|
2314
|
+
if (error.response.status === 500) {
|
|
2315
|
+
return Promise.reject(error.response);
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
return Promise.reject(error);
|
|
2319
|
+
}
|
|
2320
|
+
);
|
|
2321
|
+
var API = instance;
|
|
2322
|
+
var api_default = API;
|
|
2323
|
+
|
|
2324
|
+
// src/factories/thunk.ts
|
|
2325
|
+
var ThunkFactory = {
|
|
2326
|
+
create: (entity, prefix) => {
|
|
2327
|
+
return createAsyncThunk(
|
|
2328
|
+
`${entity}/${prefix}`,
|
|
2329
|
+
async (params, thunkApi) => {
|
|
2330
|
+
let url = `${entity}/${prefix}`;
|
|
2331
|
+
console.log("params = ", params);
|
|
2332
|
+
if (prefix == "one") url = `${entity}/${params.id}`;
|
|
2333
|
+
return api_default.get(url, prefix == "search" ? { params } : {}).then((response) => response.data.result).catch((error) => thunkApi.rejectWithValue(error.message));
|
|
2334
|
+
}
|
|
2335
|
+
);
|
|
2336
|
+
},
|
|
2337
|
+
post: (entity, prefix) => {
|
|
2338
|
+
return createAsyncThunk(
|
|
2339
|
+
`${entity}/${prefix}`,
|
|
2340
|
+
async (data, thunkApi) => {
|
|
2341
|
+
return api_default.post(`${entity}/${prefix}`, data).then((response) => {
|
|
2342
|
+
return response.data.result;
|
|
2343
|
+
}).catch((error) => thunkApi.rejectWithValue(error.message));
|
|
2344
|
+
}
|
|
2345
|
+
);
|
|
2346
|
+
}
|
|
2347
|
+
};
|
|
2348
|
+
var thunk_default = ThunkFactory;
|
|
2349
|
+
|
|
2350
|
+
// src/factories/state.ts
|
|
2351
|
+
var StateFactory = (namespace) => ({
|
|
2352
|
+
[namespace]: {},
|
|
2353
|
+
data: [],
|
|
2354
|
+
loading: false,
|
|
2355
|
+
success: false,
|
|
2356
|
+
error: null
|
|
2357
|
+
});
|
|
2358
|
+
var state_default = StateFactory;
|
|
2359
|
+
|
|
2360
|
+
// src/factories/index.ts
|
|
2361
|
+
function FeatureFactory(entity, reducers = {}, endpoints = null) {
|
|
2362
|
+
const factory = {
|
|
2363
|
+
entity,
|
|
2364
|
+
reducers,
|
|
2365
|
+
thunk: thunk_default,
|
|
2366
|
+
state: StateFactory,
|
|
2367
|
+
adapter: createEntityAdapter()
|
|
2368
|
+
};
|
|
2369
|
+
factory.manager = (initialReducers = {}) => {
|
|
2370
|
+
const reducersMap = { ...initialReducers };
|
|
2371
|
+
let combined = combineReducers(reducersMap);
|
|
2372
|
+
return {
|
|
2373
|
+
reduce: (state, action) => combined(state, action),
|
|
2374
|
+
add: (key, reducer) => {
|
|
2375
|
+
if (!key || reducersMap[key]) return;
|
|
2376
|
+
reducersMap[key] = reducer;
|
|
2377
|
+
combined = combineReducers(reducersMap);
|
|
2378
|
+
},
|
|
2379
|
+
remove: (key) => {
|
|
2380
|
+
if (!key || !reducersMap[key]) return;
|
|
2381
|
+
delete reducersMap[key];
|
|
2382
|
+
combined = combineReducers(reducersMap);
|
|
2383
|
+
},
|
|
2384
|
+
getReducerMap: () => reducersMap
|
|
2385
|
+
};
|
|
2386
|
+
};
|
|
2387
|
+
factory.inject = (source, dest) => {
|
|
2388
|
+
for (const prop in source) {
|
|
2389
|
+
if (Object.prototype.hasOwnProperty.call(source, prop)) {
|
|
2390
|
+
dest[prop] = source[prop];
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
return dest;
|
|
2394
|
+
};
|
|
2395
|
+
factory.create = (options = {}) => {
|
|
2396
|
+
const { service, initialState } = options;
|
|
2397
|
+
const sliceName = factory.entity;
|
|
2398
|
+
const standard = {
|
|
2399
|
+
fetch: factory.thunk.create(sliceName, "all"),
|
|
2400
|
+
fetchOne: factory.thunk.create(sliceName, "one"),
|
|
2401
|
+
search: factory.thunk.create(sliceName, "search")
|
|
2402
|
+
};
|
|
2403
|
+
const slice = createSlice({
|
|
2404
|
+
name: sliceName,
|
|
2405
|
+
initialState: StateFactory(sliceName, initialState),
|
|
2406
|
+
reducers: factory.reducers,
|
|
2407
|
+
extraReducers: (builder) => {
|
|
2408
|
+
for (const act in standard) {
|
|
2409
|
+
if (standard.hasOwnProperty(act)) {
|
|
2410
|
+
builder.addCase(standard[act].pending, (state) => {
|
|
2411
|
+
state.loading = true;
|
|
2412
|
+
state.error = null;
|
|
2413
|
+
}).addCase(standard[act].fulfilled, (state, action) => {
|
|
2414
|
+
state.loading = false;
|
|
2415
|
+
state.success = true;
|
|
2416
|
+
state.data = action.payload;
|
|
2417
|
+
if (act === "fetchOne") {
|
|
2418
|
+
state[sliceName] = action.payload[0];
|
|
2419
|
+
} else {
|
|
2420
|
+
state[sliceName] = action.payload[0];
|
|
2421
|
+
}
|
|
2422
|
+
}).addCase(standard[act].rejected, (state, action) => {
|
|
2423
|
+
state.loading = false;
|
|
2424
|
+
state.success = false;
|
|
2425
|
+
state.error = action.error;
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
if (service) {
|
|
2430
|
+
for (const key in service) {
|
|
2431
|
+
if (service.hasOwnProperty(key) && !standard.hasOwnProperty(key)) {
|
|
2432
|
+
builder.addCase(service[key].pending, (state) => {
|
|
2433
|
+
state.loading = true;
|
|
2434
|
+
state.error = null;
|
|
2435
|
+
}).addCase(service[key].fulfilled, (state, action) => {
|
|
2436
|
+
state.loading = false;
|
|
2437
|
+
state.success = true;
|
|
2438
|
+
state.data = action.payload;
|
|
2439
|
+
console.log("action fulfilled :", state.data);
|
|
2440
|
+
}).addCase(service[key].rejected, (state, action) => {
|
|
2441
|
+
state.loading = false;
|
|
2442
|
+
state.success = false;
|
|
2443
|
+
state.error = action.payload;
|
|
2444
|
+
});
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
});
|
|
2450
|
+
const asyncActions = factory.inject(
|
|
2451
|
+
standard,
|
|
2452
|
+
service ? service : {}
|
|
2453
|
+
);
|
|
2454
|
+
return { slice, asyncActions };
|
|
2455
|
+
};
|
|
2456
|
+
return factory;
|
|
2457
|
+
}
|
|
2458
|
+
var factories_default = FeatureFactory;
|
|
2459
|
+
|
|
2460
|
+
// src/factories/service.ts
|
|
2461
|
+
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
|
2462
|
+
var ApiFactory = (sliceName) => {
|
|
2463
|
+
const _this = {};
|
|
2464
|
+
_this.API_BASE_URL = _this.base_url || "http://localhost:4000/fear/api/";
|
|
2465
|
+
_this.baseQuery = { baseUrl: _this.API_BASE_URL };
|
|
2466
|
+
_this.baseApi = createApi({
|
|
2467
|
+
reducerPath: sliceName,
|
|
2468
|
+
tagTypes: ["Product", "Order", "User", "Category"],
|
|
2469
|
+
baseQuery: fetchBaseQuery(_this.baseQuery),
|
|
2470
|
+
endpoints: () => ({})
|
|
2471
|
+
});
|
|
2472
|
+
_this.create = (routes) => {
|
|
2473
|
+
const endpoints = routes ? routes : () => ({});
|
|
2474
|
+
console.log("routes = ", routes);
|
|
2475
|
+
const api = _this.baseApi.injectEndpoints((builder) => routes);
|
|
2476
|
+
return api;
|
|
2477
|
+
};
|
|
2478
|
+
return _this;
|
|
2479
|
+
};
|
|
2480
|
+
var service_default = ApiFactory;
|
|
2481
|
+
export {
|
|
2482
|
+
service_default as ApiFactory,
|
|
2483
|
+
factories_default as FeatureFactory,
|
|
2484
|
+
state_default as StateFactory,
|
|
2485
|
+
thunk_default as ThunkFactory
|
|
2486
|
+
};
|