@ppg_pl/tinting 0.0.0
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/LICENSE +21 -0
- package/README.md +81 -0
- package/dist/cjs/index-0a139db0.js +1667 -0
- package/dist/cjs/index-0a139db0.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +24 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/modal-header_10.cjs.entry.js +12313 -0
- package/dist/cjs/modal-header_10.cjs.entry.js.map +1 -0
- package/dist/cjs/tinting.cjs.js +28 -0
- package/dist/cjs/tinting.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +21 -0
- package/dist/collection/components/api/index.js +23 -0
- package/dist/collection/components/api/index.js.map +1 -0
- package/dist/collection/components/api/services.js +96 -0
- package/dist/collection/components/api/services.js.map +1 -0
- package/dist/collection/components/backdrop/index.css +14 -0
- package/dist/collection/components/backdrop/index.js +17 -0
- package/dist/collection/components/backdrop/index.js.map +1 -0
- package/dist/collection/components/colorbox/index.css +53 -0
- package/dist/collection/components/colorbox/index.js +182 -0
- package/dist/collection/components/colorbox/index.js.map +1 -0
- package/dist/collection/components/colorinfo/index.js +239 -0
- package/dist/collection/components/colorinfo/index.js.map +1 -0
- package/dist/collection/components/component/index.css +6 -0
- package/dist/collection/components/component/index.js +220 -0
- package/dist/collection/components/component/index.js.map +1 -0
- package/dist/collection/components/header/assets/close.png +0 -0
- package/dist/collection/components/header/index.css +180 -0
- package/dist/collection/components/header/index.js +334 -0
- package/dist/collection/components/header/index.js.map +1 -0
- package/dist/collection/components/loader/index.css +85 -0
- package/dist/collection/components/loader/index.js +19 -0
- package/dist/collection/components/loader/index.js.map +1 -0
- package/dist/collection/components/modal/__mocks__/index.js +759 -0
- package/dist/collection/components/modal/__mocks__/index.js.map +1 -0
- package/dist/collection/components/modal/assets/arrow_down.png +0 -0
- package/dist/collection/components/modal/index.css +386 -0
- package/dist/collection/components/modal/index.js +646 -0
- package/dist/collection/components/modal/index.js.map +1 -0
- package/dist/collection/components/search/assets/search.svg +15 -0
- package/dist/collection/components/search/index.css +38 -0
- package/dist/collection/components/search/index.js +178 -0
- package/dist/collection/components/search/index.js.map +1 -0
- package/dist/collection/components/select/assets/chevron-down.webp +0 -0
- package/dist/collection/components/select/assets/chevron.png +0 -0
- package/dist/collection/components/select/index.css +77 -0
- package/dist/collection/components/select/index.js +231 -0
- package/dist/collection/components/select/index.js.map +1 -0
- package/dist/collection/components/slider/index.css +89 -0
- package/dist/collection/components/slider/index.js +145 -0
- package/dist/collection/components/slider/index.js.map +1 -0
- package/dist/collection/gtmUtils.js +4 -0
- package/dist/collection/gtmUtils.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/types.js +2 -0
- package/dist/collection/types.js.map +1 -0
- package/dist/collection/utils/index.js +12 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/components/gtmUtils.js +7 -0
- package/dist/components/gtmUtils.js.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index10.js +31 -0
- package/dist/components/index10.js.map +1 -0
- package/dist/components/index11.js +3949 -0
- package/dist/components/index11.js.map +1 -0
- package/dist/components/index2.js +2726 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/index3.js +87 -0
- package/dist/components/index3.js.map +1 -0
- package/dist/components/index4.js +121 -0
- package/dist/components/index4.js.map +1 -0
- package/dist/components/index5.js +26 -0
- package/dist/components/index5.js.map +1 -0
- package/dist/components/index6.js +31 -0
- package/dist/components/index6.js.map +1 -0
- package/dist/components/index7.js +75 -0
- package/dist/components/index7.js.map +1 -0
- package/dist/components/index8.js +87 -0
- package/dist/components/index8.js.map +1 -0
- package/dist/components/index9.js +5306 -0
- package/dist/components/index9.js.map +1 -0
- package/dist/components/modal-header.d.ts +11 -0
- package/dist/components/modal-header.js +8 -0
- package/dist/components/modal-header.js.map +1 -0
- package/dist/components/my-backdrop.d.ts +11 -0
- package/dist/components/my-backdrop.js +8 -0
- package/dist/components/my-backdrop.js.map +1 -0
- package/dist/components/my-colorbox.d.ts +11 -0
- package/dist/components/my-colorbox.js +8 -0
- package/dist/components/my-colorbox.js.map +1 -0
- package/dist/components/my-colorinfo.d.ts +11 -0
- package/dist/components/my-colorinfo.js +8 -0
- package/dist/components/my-colorinfo.js.map +1 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +254 -0
- package/dist/components/my-component.js.map +1 -0
- package/dist/components/my-loader.d.ts +11 -0
- package/dist/components/my-loader.js +8 -0
- package/dist/components/my-loader.js.map +1 -0
- package/dist/components/my-modal.d.ts +11 -0
- package/dist/components/my-modal.js +8 -0
- package/dist/components/my-modal.js.map +1 -0
- package/dist/components/my-search.d.ts +11 -0
- package/dist/components/my-search.js +8 -0
- package/dist/components/my-search.js.map +1 -0
- package/dist/components/my-select.d.ts +11 -0
- package/dist/components/my-select.js +8 -0
- package/dist/components/my-select.js.map +1 -0
- package/dist/components/my-slider.d.ts +11 -0
- package/dist/components/my-slider.js +8 -0
- package/dist/components/my-slider.js.map +1 -0
- package/dist/esm/index-f3be6531.js +1638 -0
- package/dist/esm/index-f3be6531.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +20 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/modal-header_10.entry.js +12300 -0
- package/dist/esm/modal-header_10.entry.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/tinting.js +23 -0
- package/dist/esm/tinting.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/tinting/assets/arrow_down.png +0 -0
- package/dist/tinting/assets/chevron-down.webp +0 -0
- package/dist/tinting/assets/chevron.png +0 -0
- package/dist/tinting/assets/close.png +0 -0
- package/dist/tinting/assets/search.svg +15 -0
- package/dist/tinting/index.esm.js +2 -0
- package/dist/tinting/index.esm.js.map +1 -0
- package/dist/tinting/p-06cd865b.entry.js +15 -0
- package/dist/tinting/p-06cd865b.entry.js.map +1 -0
- package/dist/tinting/p-b135c76f.js +3 -0
- package/dist/tinting/p-b135c76f.js.map +1 -0
- package/dist/tinting/tinting.css +1 -0
- package/dist/tinting/tinting.esm.js +2 -0
- package/dist/tinting/tinting.esm.js.map +1 -0
- package/dist/types/components/api/index.d.ts +7 -0
- package/dist/types/components/api/services.d.ts +9 -0
- package/dist/types/components/backdrop/index.d.ts +3 -0
- package/dist/types/components/colorbox/index.d.ts +15 -0
- package/dist/types/components/colorinfo/index.d.ts +19 -0
- package/dist/types/components/component/index.d.ts +18 -0
- package/dist/types/components/header/index.d.ts +35 -0
- package/dist/types/components/loader/index.d.ts +3 -0
- package/dist/types/components/modal/__mocks__/index.d.ts +415 -0
- package/dist/types/components/modal/index.d.ts +77 -0
- package/dist/types/components/search/index.d.ts +15 -0
- package/dist/types/components/select/index.d.ts +31 -0
- package/dist/types/components/slider/index.d.ts +15 -0
- package/dist/types/components.d.ts +289 -0
- package/dist/types/gtmUtils.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1637 -0
- package/dist/types/types.d.ts +68 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +69 -0
- package/www/build/assets/arrow_down.png +0 -0
- package/www/build/assets/chevron-down.webp +0 -0
- package/www/build/assets/chevron.png +0 -0
- package/www/build/assets/close.png +0 -0
- package/www/build/assets/fonts/Galatea-Regular.eot +0 -0
- package/www/build/assets/fonts/Galatea-Regular.ttf +0 -0
- package/www/build/assets/fonts/Galatea-Regular.woff +0 -0
- package/www/build/assets/fonts/Galatea-Regular.woff2 +0 -0
- package/www/build/assets/search.svg +15 -0
- package/www/build/index.esm.js +2 -0
- package/www/build/index.esm.js.map +1 -0
- package/www/build/p-06cd865b.entry.js +15 -0
- package/www/build/p-06cd865b.entry.js.map +1 -0
- package/www/build/p-a4907f5e.css +4 -0
- package/www/build/p-b135c76f.js +3 -0
- package/www/build/p-b135c76f.js.map +1 -0
- package/www/build/p-e2322b6c.js +163 -0
- package/www/build/tinting.css +1 -0
- package/www/build/tinting.esm.js +2 -0
- package/www/build/tinting.esm.js.map +1 -0
- package/www/build/tinting.js +33 -0
- package/www/host.config.json +15 -0
- package/www/index.html +31 -0
|
@@ -0,0 +1,2726 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h, getAssetPath } from '@stencil/core/internal/client';
|
|
2
|
+
import { A as ApiService } from './index5.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './index3.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './index4.js';
|
|
5
|
+
|
|
6
|
+
/** @type {import('./type')} */
|
|
7
|
+
var type = TypeError;
|
|
8
|
+
|
|
9
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
10
|
+
|
|
11
|
+
function getAugmentedNamespace(n) {
|
|
12
|
+
if (n.__esModule) return n;
|
|
13
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
14
|
+
Object.keys(n).forEach(function (k) {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
16
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return n[k];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
return a;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const _nodeResolve_empty = {};
|
|
27
|
+
|
|
28
|
+
const _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
|
|
29
|
+
__proto__: null,
|
|
30
|
+
'default': _nodeResolve_empty
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const utilInspect = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
34
|
+
|
|
35
|
+
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
36
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
37
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
38
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
39
|
+
var hasSet = typeof Set === 'function' && Set.prototype;
|
|
40
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
|
41
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
|
42
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
43
|
+
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|
44
|
+
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
45
|
+
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
|
46
|
+
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
47
|
+
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
48
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
49
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
50
|
+
var objectToString = Object.prototype.toString;
|
|
51
|
+
var functionToString = Function.prototype.toString;
|
|
52
|
+
var $match = String.prototype.match;
|
|
53
|
+
var $slice = String.prototype.slice;
|
|
54
|
+
var $replace$1 = String.prototype.replace;
|
|
55
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
56
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
57
|
+
var $test = RegExp.prototype.test;
|
|
58
|
+
var $concat$1 = Array.prototype.concat;
|
|
59
|
+
var $join = Array.prototype.join;
|
|
60
|
+
var $arrSlice = Array.prototype.slice;
|
|
61
|
+
var $floor = Math.floor;
|
|
62
|
+
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
63
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
64
|
+
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
65
|
+
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
66
|
+
// ie, `has-tostringtag/shams
|
|
67
|
+
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
|
68
|
+
? Symbol.toStringTag
|
|
69
|
+
: null;
|
|
70
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
71
|
+
|
|
72
|
+
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
73
|
+
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
74
|
+
? function (O) {
|
|
75
|
+
return O.__proto__; // eslint-disable-line no-proto
|
|
76
|
+
}
|
|
77
|
+
: null
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
function addNumericSeparator(num, str) {
|
|
81
|
+
if (
|
|
82
|
+
num === Infinity
|
|
83
|
+
|| num === -Infinity
|
|
84
|
+
|| num !== num
|
|
85
|
+
|| (num && num > -1000 && num < 1000)
|
|
86
|
+
|| $test.call(/e/, str)
|
|
87
|
+
) {
|
|
88
|
+
return str;
|
|
89
|
+
}
|
|
90
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
91
|
+
if (typeof num === 'number') {
|
|
92
|
+
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
93
|
+
if (int !== num) {
|
|
94
|
+
var intStr = String(int);
|
|
95
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
96
|
+
return $replace$1.call(intStr, sepRegex, '$&_') + '.' + $replace$1.call($replace$1.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return $replace$1.call(str, sepRegex, '$&_');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
var inspectCustom = utilInspect.custom;
|
|
104
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
105
|
+
|
|
106
|
+
var quotes = {
|
|
107
|
+
__proto__: null,
|
|
108
|
+
'double': '"',
|
|
109
|
+
single: "'"
|
|
110
|
+
};
|
|
111
|
+
var quoteREs = {
|
|
112
|
+
__proto__: null,
|
|
113
|
+
'double': /(["\\])/g,
|
|
114
|
+
single: /(['\\])/g
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
118
|
+
var opts = options || {};
|
|
119
|
+
|
|
120
|
+
if (has$3(opts, 'quoteStyle') && !has$3(quotes, opts.quoteStyle)) {
|
|
121
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
122
|
+
}
|
|
123
|
+
if (
|
|
124
|
+
has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
|
125
|
+
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
|
126
|
+
: opts.maxStringLength !== null
|
|
127
|
+
)
|
|
128
|
+
) {
|
|
129
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
130
|
+
}
|
|
131
|
+
var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
|
|
132
|
+
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
133
|
+
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (
|
|
137
|
+
has$3(opts, 'indent')
|
|
138
|
+
&& opts.indent !== null
|
|
139
|
+
&& opts.indent !== '\t'
|
|
140
|
+
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
141
|
+
) {
|
|
142
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
143
|
+
}
|
|
144
|
+
if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
|
145
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
146
|
+
}
|
|
147
|
+
var numericSeparator = opts.numericSeparator;
|
|
148
|
+
|
|
149
|
+
if (typeof obj === 'undefined') {
|
|
150
|
+
return 'undefined';
|
|
151
|
+
}
|
|
152
|
+
if (obj === null) {
|
|
153
|
+
return 'null';
|
|
154
|
+
}
|
|
155
|
+
if (typeof obj === 'boolean') {
|
|
156
|
+
return obj ? 'true' : 'false';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (typeof obj === 'string') {
|
|
160
|
+
return inspectString(obj, opts);
|
|
161
|
+
}
|
|
162
|
+
if (typeof obj === 'number') {
|
|
163
|
+
if (obj === 0) {
|
|
164
|
+
return Infinity / obj > 0 ? '0' : '-0';
|
|
165
|
+
}
|
|
166
|
+
var str = String(obj);
|
|
167
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
168
|
+
}
|
|
169
|
+
if (typeof obj === 'bigint') {
|
|
170
|
+
var bigIntStr = String(obj) + 'n';
|
|
171
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
175
|
+
if (typeof depth === 'undefined') { depth = 0; }
|
|
176
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
|
177
|
+
return isArray$3(obj) ? '[Array]' : '[Object]';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
var indent = getIndent(opts, depth);
|
|
181
|
+
|
|
182
|
+
if (typeof seen === 'undefined') {
|
|
183
|
+
seen = [];
|
|
184
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
185
|
+
return '[Circular]';
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function inspect(value, from, noIndent) {
|
|
189
|
+
if (from) {
|
|
190
|
+
seen = $arrSlice.call(seen);
|
|
191
|
+
seen.push(from);
|
|
192
|
+
}
|
|
193
|
+
if (noIndent) {
|
|
194
|
+
var newOpts = {
|
|
195
|
+
depth: opts.depth
|
|
196
|
+
};
|
|
197
|
+
if (has$3(opts, 'quoteStyle')) {
|
|
198
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
199
|
+
}
|
|
200
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
201
|
+
}
|
|
202
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
|
|
206
|
+
var name = nameOf(obj);
|
|
207
|
+
var keys = arrObjKeys(obj, inspect);
|
|
208
|
+
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
209
|
+
}
|
|
210
|
+
if (isSymbol(obj)) {
|
|
211
|
+
var symString = hasShammedSymbols ? $replace$1.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
212
|
+
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
213
|
+
}
|
|
214
|
+
if (isElement(obj)) {
|
|
215
|
+
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
216
|
+
var attrs = obj.attributes || [];
|
|
217
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
218
|
+
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
|
219
|
+
}
|
|
220
|
+
s += '>';
|
|
221
|
+
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
|
222
|
+
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
223
|
+
return s;
|
|
224
|
+
}
|
|
225
|
+
if (isArray$3(obj)) {
|
|
226
|
+
if (obj.length === 0) { return '[]'; }
|
|
227
|
+
var xs = arrObjKeys(obj, inspect);
|
|
228
|
+
if (indent && !singleLineValues(xs)) {
|
|
229
|
+
return '[' + indentedJoin(xs, indent) + ']';
|
|
230
|
+
}
|
|
231
|
+
return '[ ' + $join.call(xs, ', ') + ' ]';
|
|
232
|
+
}
|
|
233
|
+
if (isError(obj)) {
|
|
234
|
+
var parts = arrObjKeys(obj, inspect);
|
|
235
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
236
|
+
return '{ [' + String(obj) + '] ' + $join.call($concat$1.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
237
|
+
}
|
|
238
|
+
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
239
|
+
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
240
|
+
}
|
|
241
|
+
if (typeof obj === 'object' && customInspect) {
|
|
242
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
243
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
244
|
+
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
245
|
+
return obj.inspect();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (isMap(obj)) {
|
|
249
|
+
var mapParts = [];
|
|
250
|
+
if (mapForEach) {
|
|
251
|
+
mapForEach.call(obj, function (value, key) {
|
|
252
|
+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
256
|
+
}
|
|
257
|
+
if (isSet(obj)) {
|
|
258
|
+
var setParts = [];
|
|
259
|
+
if (setForEach) {
|
|
260
|
+
setForEach.call(obj, function (value) {
|
|
261
|
+
setParts.push(inspect(value, obj));
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
265
|
+
}
|
|
266
|
+
if (isWeakMap(obj)) {
|
|
267
|
+
return weakCollectionOf('WeakMap');
|
|
268
|
+
}
|
|
269
|
+
if (isWeakSet(obj)) {
|
|
270
|
+
return weakCollectionOf('WeakSet');
|
|
271
|
+
}
|
|
272
|
+
if (isWeakRef(obj)) {
|
|
273
|
+
return weakCollectionOf('WeakRef');
|
|
274
|
+
}
|
|
275
|
+
if (isNumber(obj)) {
|
|
276
|
+
return markBoxed(inspect(Number(obj)));
|
|
277
|
+
}
|
|
278
|
+
if (isBigInt(obj)) {
|
|
279
|
+
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
280
|
+
}
|
|
281
|
+
if (isBoolean(obj)) {
|
|
282
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
283
|
+
}
|
|
284
|
+
if (isString(obj)) {
|
|
285
|
+
return markBoxed(inspect(String(obj)));
|
|
286
|
+
}
|
|
287
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
288
|
+
/* eslint-env browser */
|
|
289
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
290
|
+
return '{ [object Window] }';
|
|
291
|
+
}
|
|
292
|
+
if (
|
|
293
|
+
(typeof globalThis !== 'undefined' && obj === globalThis)
|
|
294
|
+
|| (typeof commonjsGlobal !== 'undefined' && obj === commonjsGlobal)
|
|
295
|
+
) {
|
|
296
|
+
return '{ [object globalThis] }';
|
|
297
|
+
}
|
|
298
|
+
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
299
|
+
var ys = arrObjKeys(obj, inspect);
|
|
300
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
301
|
+
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
302
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? 'Object' : '';
|
|
303
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
|
304
|
+
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat$1.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
|
305
|
+
if (ys.length === 0) { return tag + '{}'; }
|
|
306
|
+
if (indent) {
|
|
307
|
+
return tag + '{' + indentedJoin(ys, indent) + '}';
|
|
308
|
+
}
|
|
309
|
+
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
|
310
|
+
}
|
|
311
|
+
return String(obj);
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
315
|
+
var style = opts.quoteStyle || defaultStyle;
|
|
316
|
+
var quoteChar = quotes[style];
|
|
317
|
+
return quoteChar + s + quoteChar;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function quote(s) {
|
|
321
|
+
return $replace$1.call(String(s), /"/g, '"');
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function canTrustToString(obj) {
|
|
325
|
+
return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
|
|
326
|
+
}
|
|
327
|
+
function isArray$3(obj) { return toStr$1(obj) === '[object Array]' && canTrustToString(obj); }
|
|
328
|
+
function isDate(obj) { return toStr$1(obj) === '[object Date]' && canTrustToString(obj); }
|
|
329
|
+
function isRegExp$1(obj) { return toStr$1(obj) === '[object RegExp]' && canTrustToString(obj); }
|
|
330
|
+
function isError(obj) { return toStr$1(obj) === '[object Error]' && canTrustToString(obj); }
|
|
331
|
+
function isString(obj) { return toStr$1(obj) === '[object String]' && canTrustToString(obj); }
|
|
332
|
+
function isNumber(obj) { return toStr$1(obj) === '[object Number]' && canTrustToString(obj); }
|
|
333
|
+
function isBoolean(obj) { return toStr$1(obj) === '[object Boolean]' && canTrustToString(obj); }
|
|
334
|
+
|
|
335
|
+
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
336
|
+
function isSymbol(obj) {
|
|
337
|
+
if (hasShammedSymbols) {
|
|
338
|
+
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
339
|
+
}
|
|
340
|
+
if (typeof obj === 'symbol') {
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
if (!obj || typeof obj !== 'object' || !symToString) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
symToString.call(obj);
|
|
348
|
+
return true;
|
|
349
|
+
} catch (e) {}
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function isBigInt(obj) {
|
|
354
|
+
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
try {
|
|
358
|
+
bigIntValueOf.call(obj);
|
|
359
|
+
return true;
|
|
360
|
+
} catch (e) {}
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
365
|
+
function has$3(obj, key) {
|
|
366
|
+
return hasOwn.call(obj, key);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function toStr$1(obj) {
|
|
370
|
+
return objectToString.call(obj);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function nameOf(f) {
|
|
374
|
+
if (f.name) { return f.name; }
|
|
375
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
376
|
+
if (m) { return m[1]; }
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function indexOf(xs, x) {
|
|
381
|
+
if (xs.indexOf) { return xs.indexOf(x); }
|
|
382
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
383
|
+
if (xs[i] === x) { return i; }
|
|
384
|
+
}
|
|
385
|
+
return -1;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function isMap(x) {
|
|
389
|
+
if (!mapSize || !x || typeof x !== 'object') {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
try {
|
|
393
|
+
mapSize.call(x);
|
|
394
|
+
try {
|
|
395
|
+
setSize.call(x);
|
|
396
|
+
} catch (s) {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
400
|
+
} catch (e) {}
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function isWeakMap(x) {
|
|
405
|
+
if (!weakMapHas || !x || typeof x !== 'object') {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
weakMapHas.call(x, weakMapHas);
|
|
410
|
+
try {
|
|
411
|
+
weakSetHas.call(x, weakSetHas);
|
|
412
|
+
} catch (s) {
|
|
413
|
+
return true;
|
|
414
|
+
}
|
|
415
|
+
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
|
416
|
+
} catch (e) {}
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function isWeakRef(x) {
|
|
421
|
+
if (!weakRefDeref || !x || typeof x !== 'object') {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
try {
|
|
425
|
+
weakRefDeref.call(x);
|
|
426
|
+
return true;
|
|
427
|
+
} catch (e) {}
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function isSet(x) {
|
|
432
|
+
if (!setSize || !x || typeof x !== 'object') {
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
try {
|
|
436
|
+
setSize.call(x);
|
|
437
|
+
try {
|
|
438
|
+
mapSize.call(x);
|
|
439
|
+
} catch (m) {
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
443
|
+
} catch (e) {}
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function isWeakSet(x) {
|
|
448
|
+
if (!weakSetHas || !x || typeof x !== 'object') {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
try {
|
|
452
|
+
weakSetHas.call(x, weakSetHas);
|
|
453
|
+
try {
|
|
454
|
+
weakMapHas.call(x, weakMapHas);
|
|
455
|
+
} catch (s) {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
|
459
|
+
} catch (e) {}
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function isElement(x) {
|
|
464
|
+
if (!x || typeof x !== 'object') { return false; }
|
|
465
|
+
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function inspectString(str, opts) {
|
|
472
|
+
if (str.length > opts.maxStringLength) {
|
|
473
|
+
var remaining = str.length - opts.maxStringLength;
|
|
474
|
+
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
475
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
476
|
+
}
|
|
477
|
+
var quoteRE = quoteREs[opts.quoteStyle || 'single'];
|
|
478
|
+
quoteRE.lastIndex = 0;
|
|
479
|
+
// eslint-disable-next-line no-control-regex
|
|
480
|
+
var s = $replace$1.call($replace$1.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
481
|
+
return wrapQuotes(s, 'single', opts);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function lowbyte(c) {
|
|
485
|
+
var n = c.charCodeAt(0);
|
|
486
|
+
var x = {
|
|
487
|
+
8: 'b',
|
|
488
|
+
9: 't',
|
|
489
|
+
10: 'n',
|
|
490
|
+
12: 'f',
|
|
491
|
+
13: 'r'
|
|
492
|
+
}[n];
|
|
493
|
+
if (x) { return '\\' + x; }
|
|
494
|
+
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function markBoxed(str) {
|
|
498
|
+
return 'Object(' + str + ')';
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function weakCollectionOf(type) {
|
|
502
|
+
return type + ' { ? }';
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function collectionOf(type, size, entries, indent) {
|
|
506
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
|
507
|
+
return type + ' (' + size + ') {' + joinedEntries + '}';
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function singleLineValues(xs) {
|
|
511
|
+
for (var i = 0; i < xs.length; i++) {
|
|
512
|
+
if (indexOf(xs[i], '\n') >= 0) {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function getIndent(opts, depth) {
|
|
520
|
+
var baseIndent;
|
|
521
|
+
if (opts.indent === '\t') {
|
|
522
|
+
baseIndent = '\t';
|
|
523
|
+
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
|
524
|
+
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
|
525
|
+
} else {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
return {
|
|
529
|
+
base: baseIndent,
|
|
530
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function indentedJoin(xs, indent) {
|
|
535
|
+
if (xs.length === 0) { return ''; }
|
|
536
|
+
var lineJoiner = '\n' + indent.prev + indent.base;
|
|
537
|
+
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
function arrObjKeys(obj, inspect) {
|
|
541
|
+
var isArr = isArray$3(obj);
|
|
542
|
+
var xs = [];
|
|
543
|
+
if (isArr) {
|
|
544
|
+
xs.length = obj.length;
|
|
545
|
+
for (var i = 0; i < obj.length; i++) {
|
|
546
|
+
xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
550
|
+
var symMap;
|
|
551
|
+
if (hasShammedSymbols) {
|
|
552
|
+
symMap = {};
|
|
553
|
+
for (var k = 0; k < syms.length; k++) {
|
|
554
|
+
symMap['$' + syms[k]] = syms[k];
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
559
|
+
if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
560
|
+
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
561
|
+
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
562
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
563
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
564
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
565
|
+
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
566
|
+
} else {
|
|
567
|
+
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
if (typeof gOPS === 'function') {
|
|
571
|
+
for (var j = 0; j < syms.length; j++) {
|
|
572
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
573
|
+
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return xs;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/*
|
|
581
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
582
|
+
*
|
|
583
|
+
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
|
|
584
|
+
* By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
585
|
+
*/
|
|
586
|
+
/** @type {import('./list.d.ts').listGetNode} */
|
|
587
|
+
// eslint-disable-next-line consistent-return
|
|
588
|
+
var listGetNode = function (list, key, isDelete) {
|
|
589
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
590
|
+
var prev = list;
|
|
591
|
+
/** @type {(typeof list)['next']} */
|
|
592
|
+
var curr;
|
|
593
|
+
// eslint-disable-next-line eqeqeq
|
|
594
|
+
for (; (curr = prev.next) != null; prev = curr) {
|
|
595
|
+
if (curr.key === key) {
|
|
596
|
+
prev.next = curr.next;
|
|
597
|
+
if (!isDelete) {
|
|
598
|
+
// eslint-disable-next-line no-extra-parens
|
|
599
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
600
|
+
list.next = curr; // eslint-disable-line no-param-reassign
|
|
601
|
+
}
|
|
602
|
+
return curr;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
/** @type {import('./list.d.ts').listGet} */
|
|
608
|
+
var listGet = function (objects, key) {
|
|
609
|
+
if (!objects) {
|
|
610
|
+
return void undefined;
|
|
611
|
+
}
|
|
612
|
+
var node = listGetNode(objects, key);
|
|
613
|
+
return node && node.value;
|
|
614
|
+
};
|
|
615
|
+
/** @type {import('./list.d.ts').listSet} */
|
|
616
|
+
var listSet = function (objects, key, value) {
|
|
617
|
+
var node = listGetNode(objects, key);
|
|
618
|
+
if (node) {
|
|
619
|
+
node.value = value;
|
|
620
|
+
} else {
|
|
621
|
+
// Prepend the new node to the beginning of the list
|
|
622
|
+
objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
623
|
+
key: key,
|
|
624
|
+
next: objects.next,
|
|
625
|
+
value: value
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
/** @type {import('./list.d.ts').listHas} */
|
|
630
|
+
var listHas = function (objects, key) {
|
|
631
|
+
if (!objects) {
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
634
|
+
return !!listGetNode(objects, key);
|
|
635
|
+
};
|
|
636
|
+
/** @type {import('./list.d.ts').listDelete} */
|
|
637
|
+
// eslint-disable-next-line consistent-return
|
|
638
|
+
var listDelete = function (objects, key) {
|
|
639
|
+
if (objects) {
|
|
640
|
+
return listGetNode(objects, key, true);
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
/** @type {import('.')} */
|
|
645
|
+
var sideChannelList = function getSideChannelList() {
|
|
646
|
+
/** @typedef {ReturnType<typeof getSideChannelList>} Channel */
|
|
647
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
648
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
649
|
+
|
|
650
|
+
/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
|
|
651
|
+
|
|
652
|
+
/** @type {Channel} */
|
|
653
|
+
var channel = {
|
|
654
|
+
assert: function (key) {
|
|
655
|
+
if (!channel.has(key)) {
|
|
656
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
'delete': function (key) {
|
|
660
|
+
var root = $o && $o.next;
|
|
661
|
+
var deletedNode = listDelete($o, key);
|
|
662
|
+
if (deletedNode && root && root === deletedNode) {
|
|
663
|
+
$o = void undefined;
|
|
664
|
+
}
|
|
665
|
+
return !!deletedNode;
|
|
666
|
+
},
|
|
667
|
+
get: function (key) {
|
|
668
|
+
return listGet($o, key);
|
|
669
|
+
},
|
|
670
|
+
has: function (key) {
|
|
671
|
+
return listHas($o, key);
|
|
672
|
+
},
|
|
673
|
+
set: function (key, value) {
|
|
674
|
+
if (!$o) {
|
|
675
|
+
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
676
|
+
$o = {
|
|
677
|
+
next: void undefined
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
// eslint-disable-next-line no-extra-parens
|
|
681
|
+
listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
// @ts-expect-error TODO: figure out why this is erroring
|
|
685
|
+
return channel;
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
/** @type {import('.')} */
|
|
689
|
+
var esObjectAtoms = Object;
|
|
690
|
+
|
|
691
|
+
/** @type {import('.')} */
|
|
692
|
+
var esErrors = Error;
|
|
693
|
+
|
|
694
|
+
/** @type {import('./eval')} */
|
|
695
|
+
var _eval = EvalError;
|
|
696
|
+
|
|
697
|
+
/** @type {import('./range')} */
|
|
698
|
+
var range = RangeError;
|
|
699
|
+
|
|
700
|
+
/** @type {import('./ref')} */
|
|
701
|
+
var ref = ReferenceError;
|
|
702
|
+
|
|
703
|
+
/** @type {import('./syntax')} */
|
|
704
|
+
var syntax = SyntaxError;
|
|
705
|
+
|
|
706
|
+
/** @type {import('./uri')} */
|
|
707
|
+
var uri = URIError;
|
|
708
|
+
|
|
709
|
+
/** @type {import('./abs')} */
|
|
710
|
+
var abs = Math.abs;
|
|
711
|
+
|
|
712
|
+
/** @type {import('./floor')} */
|
|
713
|
+
var floor = Math.floor;
|
|
714
|
+
|
|
715
|
+
/** @type {import('./max')} */
|
|
716
|
+
var max$1 = Math.max;
|
|
717
|
+
|
|
718
|
+
/** @type {import('./min')} */
|
|
719
|
+
var min = Math.min;
|
|
720
|
+
|
|
721
|
+
/** @type {import('./pow')} */
|
|
722
|
+
var pow = Math.pow;
|
|
723
|
+
|
|
724
|
+
/** @type {import('./round')} */
|
|
725
|
+
var round = Math.round;
|
|
726
|
+
|
|
727
|
+
/** @type {import('./isNaN')} */
|
|
728
|
+
var _isNaN = Number.isNaN || function isNaN(a) {
|
|
729
|
+
return a !== a;
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
/** @type {import('./sign')} */
|
|
733
|
+
var sign = function sign(number) {
|
|
734
|
+
if (_isNaN(number) || number === 0) {
|
|
735
|
+
return number;
|
|
736
|
+
}
|
|
737
|
+
return number < 0 ? -1 : +1;
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
/** @type {import('./gOPD')} */
|
|
741
|
+
var gOPD = Object.getOwnPropertyDescriptor;
|
|
742
|
+
|
|
743
|
+
/** @type {import('.')} */
|
|
744
|
+
var $gOPD = gOPD;
|
|
745
|
+
|
|
746
|
+
var gopd = $gOPD;
|
|
747
|
+
|
|
748
|
+
/** @type {import('.')} */
|
|
749
|
+
var $defineProperty = Object.defineProperty || false;
|
|
750
|
+
if ($defineProperty) {
|
|
751
|
+
try {
|
|
752
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
753
|
+
} catch (e) {
|
|
754
|
+
// IE 8 has a broken defineProperty
|
|
755
|
+
$defineProperty = false;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
var esDefineProperty = $defineProperty;
|
|
760
|
+
|
|
761
|
+
/** @type {import('./shams')} */
|
|
762
|
+
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
763
|
+
var shams = function hasSymbols() {
|
|
764
|
+
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
765
|
+
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
766
|
+
|
|
767
|
+
/** @type {{ [k in symbol]?: unknown }} */
|
|
768
|
+
var obj = {};
|
|
769
|
+
var sym = Symbol('test');
|
|
770
|
+
var symObj = Object(sym);
|
|
771
|
+
if (typeof sym === 'string') { return false; }
|
|
772
|
+
|
|
773
|
+
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
|
774
|
+
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
|
775
|
+
|
|
776
|
+
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
|
777
|
+
// if (sym instanceof Symbol) { return false; }
|
|
778
|
+
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
779
|
+
// if (!(symObj instanceof Symbol)) { return false; }
|
|
780
|
+
|
|
781
|
+
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
|
782
|
+
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
|
783
|
+
|
|
784
|
+
var symVal = 42;
|
|
785
|
+
obj[sym] = symVal;
|
|
786
|
+
for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
787
|
+
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
788
|
+
|
|
789
|
+
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
790
|
+
|
|
791
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
792
|
+
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
|
793
|
+
|
|
794
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
|
795
|
+
|
|
796
|
+
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
797
|
+
// eslint-disable-next-line no-extra-parens
|
|
798
|
+
var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
|
|
799
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
return true;
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
/** @type {import('.')} */
|
|
809
|
+
var hasSymbols$1 = function hasNativeSymbols() {
|
|
810
|
+
if (typeof origSymbol !== 'function') { return false; }
|
|
811
|
+
if (typeof Symbol !== 'function') { return false; }
|
|
812
|
+
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
813
|
+
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
814
|
+
|
|
815
|
+
return shams();
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
/** @type {import('./Reflect.getPrototypeOf')} */
|
|
819
|
+
var Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
|
|
820
|
+
|
|
821
|
+
/** @type {import('./Object.getPrototypeOf')} */
|
|
822
|
+
var Object_getPrototypeOf = esObjectAtoms.getPrototypeOf || null;
|
|
823
|
+
|
|
824
|
+
/* eslint no-invalid-this: 1 */
|
|
825
|
+
|
|
826
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
827
|
+
var toStr = Object.prototype.toString;
|
|
828
|
+
var max = Math.max;
|
|
829
|
+
var funcType = '[object Function]';
|
|
830
|
+
|
|
831
|
+
var concatty = function concatty(a, b) {
|
|
832
|
+
var arr = [];
|
|
833
|
+
|
|
834
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
835
|
+
arr[i] = a[i];
|
|
836
|
+
}
|
|
837
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
838
|
+
arr[j + a.length] = b[j];
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
return arr;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
var slicy = function slicy(arrLike, offset) {
|
|
845
|
+
var arr = [];
|
|
846
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
847
|
+
arr[j] = arrLike[i];
|
|
848
|
+
}
|
|
849
|
+
return arr;
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
var joiny = function (arr, joiner) {
|
|
853
|
+
var str = '';
|
|
854
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
855
|
+
str += arr[i];
|
|
856
|
+
if (i + 1 < arr.length) {
|
|
857
|
+
str += joiner;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
return str;
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
var implementation = function bind(that) {
|
|
864
|
+
var target = this;
|
|
865
|
+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
|
866
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
867
|
+
}
|
|
868
|
+
var args = slicy(arguments, 1);
|
|
869
|
+
|
|
870
|
+
var bound;
|
|
871
|
+
var binder = function () {
|
|
872
|
+
if (this instanceof bound) {
|
|
873
|
+
var result = target.apply(
|
|
874
|
+
this,
|
|
875
|
+
concatty(args, arguments)
|
|
876
|
+
);
|
|
877
|
+
if (Object(result) === result) {
|
|
878
|
+
return result;
|
|
879
|
+
}
|
|
880
|
+
return this;
|
|
881
|
+
}
|
|
882
|
+
return target.apply(
|
|
883
|
+
that,
|
|
884
|
+
concatty(args, arguments)
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
var boundLength = max(0, target.length - args.length);
|
|
890
|
+
var boundArgs = [];
|
|
891
|
+
for (var i = 0; i < boundLength; i++) {
|
|
892
|
+
boundArgs[i] = '$' + i;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
896
|
+
|
|
897
|
+
if (target.prototype) {
|
|
898
|
+
var Empty = function Empty() {};
|
|
899
|
+
Empty.prototype = target.prototype;
|
|
900
|
+
bound.prototype = new Empty();
|
|
901
|
+
Empty.prototype = null;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
return bound;
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
var functionBind = Function.prototype.bind || implementation;
|
|
908
|
+
|
|
909
|
+
/** @type {import('./functionCall')} */
|
|
910
|
+
var functionCall = Function.prototype.call;
|
|
911
|
+
|
|
912
|
+
/** @type {import('./functionApply')} */
|
|
913
|
+
var functionApply = Function.prototype.apply;
|
|
914
|
+
|
|
915
|
+
/** @type {import('./reflectApply')} */
|
|
916
|
+
var reflectApply = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
|
|
917
|
+
|
|
918
|
+
/** @type {import('./actualApply')} */
|
|
919
|
+
var actualApply = reflectApply || functionBind.call(functionCall, functionApply);
|
|
920
|
+
|
|
921
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
922
|
+
var callBindApplyHelpers = function callBindBasic(args) {
|
|
923
|
+
if (args.length < 1 || typeof args[0] !== 'function') {
|
|
924
|
+
throw new type('a function is required');
|
|
925
|
+
}
|
|
926
|
+
return actualApply(functionBind, functionCall, args);
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
var hasProtoAccessor;
|
|
930
|
+
try {
|
|
931
|
+
// eslint-disable-next-line no-extra-parens, no-proto
|
|
932
|
+
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
|
|
933
|
+
} catch (e) {
|
|
934
|
+
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
935
|
+
throw e;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// eslint-disable-next-line no-extra-parens
|
|
940
|
+
var desc = !!hasProtoAccessor && gopd && gopd(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
|
941
|
+
|
|
942
|
+
var $Object = Object;
|
|
943
|
+
var $getPrototypeOf = $Object.getPrototypeOf;
|
|
944
|
+
|
|
945
|
+
/** @type {import('./get')} */
|
|
946
|
+
var get = desc && typeof desc.get === 'function'
|
|
947
|
+
? callBindApplyHelpers([desc.get])
|
|
948
|
+
: typeof $getPrototypeOf === 'function'
|
|
949
|
+
? /** @type {import('./get')} */ function getDunder(value) {
|
|
950
|
+
// eslint-disable-next-line eqeqeq
|
|
951
|
+
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
952
|
+
}
|
|
953
|
+
: false;
|
|
954
|
+
|
|
955
|
+
/** @type {import('.')} */
|
|
956
|
+
var getProto = Reflect_getPrototypeOf
|
|
957
|
+
? function getProto(O) {
|
|
958
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
959
|
+
return Reflect_getPrototypeOf(O);
|
|
960
|
+
}
|
|
961
|
+
: Object_getPrototypeOf
|
|
962
|
+
? function getProto(O) {
|
|
963
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
964
|
+
throw new TypeError('getProto: not an object');
|
|
965
|
+
}
|
|
966
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
967
|
+
return Object_getPrototypeOf(O);
|
|
968
|
+
}
|
|
969
|
+
: get
|
|
970
|
+
? function getProto(O) {
|
|
971
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
972
|
+
return get(O);
|
|
973
|
+
}
|
|
974
|
+
: null;
|
|
975
|
+
|
|
976
|
+
var call = Function.prototype.call;
|
|
977
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
/** @type {import('.')} */
|
|
981
|
+
var hasown = functionBind.call(call, $hasOwn);
|
|
982
|
+
|
|
983
|
+
var undefined$1;
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
var $Function = Function;
|
|
1004
|
+
|
|
1005
|
+
// eslint-disable-next-line consistent-return
|
|
1006
|
+
var getEvalledConstructor = function (expressionSyntax) {
|
|
1007
|
+
try {
|
|
1008
|
+
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
1009
|
+
} catch (e) {}
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
var throwTypeError = function () {
|
|
1016
|
+
throw new type();
|
|
1017
|
+
};
|
|
1018
|
+
var ThrowTypeError = gopd
|
|
1019
|
+
? (function () {
|
|
1020
|
+
try {
|
|
1021
|
+
return throwTypeError;
|
|
1022
|
+
} catch (calleeThrows) {
|
|
1023
|
+
try {
|
|
1024
|
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
1025
|
+
return gopd(arguments, 'callee').get;
|
|
1026
|
+
} catch (gOPDthrows) {
|
|
1027
|
+
return throwTypeError;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}())
|
|
1031
|
+
: throwTypeError;
|
|
1032
|
+
|
|
1033
|
+
var hasSymbols = hasSymbols$1();
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
var needsEval = {};
|
|
1043
|
+
|
|
1044
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
1045
|
+
|
|
1046
|
+
var INTRINSICS = {
|
|
1047
|
+
__proto__: null,
|
|
1048
|
+
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
1049
|
+
'%Array%': Array,
|
|
1050
|
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
1051
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
1052
|
+
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
1053
|
+
'%AsyncFunction%': needsEval,
|
|
1054
|
+
'%AsyncGenerator%': needsEval,
|
|
1055
|
+
'%AsyncGeneratorFunction%': needsEval,
|
|
1056
|
+
'%AsyncIteratorPrototype%': needsEval,
|
|
1057
|
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
|
|
1058
|
+
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
|
|
1059
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
|
|
1060
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
|
|
1061
|
+
'%Boolean%': Boolean,
|
|
1062
|
+
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
|
|
1063
|
+
'%Date%': Date,
|
|
1064
|
+
'%decodeURI%': decodeURI,
|
|
1065
|
+
'%decodeURIComponent%': decodeURIComponent,
|
|
1066
|
+
'%encodeURI%': encodeURI,
|
|
1067
|
+
'%encodeURIComponent%': encodeURIComponent,
|
|
1068
|
+
'%Error%': esErrors,
|
|
1069
|
+
'%eval%': eval, // eslint-disable-line no-eval
|
|
1070
|
+
'%EvalError%': _eval,
|
|
1071
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
|
|
1072
|
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
1073
|
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
1074
|
+
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
1075
|
+
'%Function%': $Function,
|
|
1076
|
+
'%GeneratorFunction%': needsEval,
|
|
1077
|
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
|
|
1078
|
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
|
|
1079
|
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
1080
|
+
'%isFinite%': isFinite,
|
|
1081
|
+
'%isNaN%': isNaN,
|
|
1082
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
1083
|
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
1084
|
+
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
1085
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
1086
|
+
'%Math%': Math,
|
|
1087
|
+
'%Number%': Number,
|
|
1088
|
+
'%Object%': esObjectAtoms,
|
|
1089
|
+
'%Object.getOwnPropertyDescriptor%': gopd,
|
|
1090
|
+
'%parseFloat%': parseFloat,
|
|
1091
|
+
'%parseInt%': parseInt,
|
|
1092
|
+
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
1093
|
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
1094
|
+
'%RangeError%': range,
|
|
1095
|
+
'%ReferenceError%': ref,
|
|
1096
|
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
1097
|
+
'%RegExp%': RegExp,
|
|
1098
|
+
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
1099
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
1100
|
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
1101
|
+
'%String%': String,
|
|
1102
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
1103
|
+
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
1104
|
+
'%SyntaxError%': syntax,
|
|
1105
|
+
'%ThrowTypeError%': ThrowTypeError,
|
|
1106
|
+
'%TypedArray%': TypedArray,
|
|
1107
|
+
'%TypeError%': type,
|
|
1108
|
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
1109
|
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
1110
|
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
1111
|
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
1112
|
+
'%URIError%': uri,
|
|
1113
|
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
1114
|
+
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
1115
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
|
|
1116
|
+
|
|
1117
|
+
'%Function.prototype.call%': functionCall,
|
|
1118
|
+
'%Function.prototype.apply%': functionApply,
|
|
1119
|
+
'%Object.defineProperty%': esDefineProperty,
|
|
1120
|
+
'%Object.getPrototypeOf%': Object_getPrototypeOf,
|
|
1121
|
+
'%Math.abs%': abs,
|
|
1122
|
+
'%Math.floor%': floor,
|
|
1123
|
+
'%Math.max%': max$1,
|
|
1124
|
+
'%Math.min%': min,
|
|
1125
|
+
'%Math.pow%': pow,
|
|
1126
|
+
'%Math.round%': round,
|
|
1127
|
+
'%Math.sign%': sign,
|
|
1128
|
+
'%Reflect.getPrototypeOf%': Reflect_getPrototypeOf
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
var doEval = function doEval(name) {
|
|
1132
|
+
var value;
|
|
1133
|
+
if (name === '%AsyncFunction%') {
|
|
1134
|
+
value = getEvalledConstructor('async function () {}');
|
|
1135
|
+
} else if (name === '%GeneratorFunction%') {
|
|
1136
|
+
value = getEvalledConstructor('function* () {}');
|
|
1137
|
+
} else if (name === '%AsyncGeneratorFunction%') {
|
|
1138
|
+
value = getEvalledConstructor('async function* () {}');
|
|
1139
|
+
} else if (name === '%AsyncGenerator%') {
|
|
1140
|
+
var fn = doEval('%AsyncGeneratorFunction%');
|
|
1141
|
+
if (fn) {
|
|
1142
|
+
value = fn.prototype;
|
|
1143
|
+
}
|
|
1144
|
+
} else if (name === '%AsyncIteratorPrototype%') {
|
|
1145
|
+
var gen = doEval('%AsyncGenerator%');
|
|
1146
|
+
if (gen && getProto) {
|
|
1147
|
+
value = getProto(gen.prototype);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
INTRINSICS[name] = value;
|
|
1152
|
+
|
|
1153
|
+
return value;
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
var LEGACY_ALIASES = {
|
|
1157
|
+
__proto__: null,
|
|
1158
|
+
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
1159
|
+
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
1160
|
+
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
1161
|
+
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
1162
|
+
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
1163
|
+
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
1164
|
+
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
1165
|
+
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
1166
|
+
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
1167
|
+
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
1168
|
+
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
1169
|
+
'%DatePrototype%': ['Date', 'prototype'],
|
|
1170
|
+
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
1171
|
+
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
1172
|
+
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
1173
|
+
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
1174
|
+
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
1175
|
+
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
1176
|
+
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
1177
|
+
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
1178
|
+
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
1179
|
+
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
1180
|
+
'%JSONParse%': ['JSON', 'parse'],
|
|
1181
|
+
'%JSONStringify%': ['JSON', 'stringify'],
|
|
1182
|
+
'%MapPrototype%': ['Map', 'prototype'],
|
|
1183
|
+
'%NumberPrototype%': ['Number', 'prototype'],
|
|
1184
|
+
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
1185
|
+
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
1186
|
+
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
1187
|
+
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
1188
|
+
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
1189
|
+
'%Promise_all%': ['Promise', 'all'],
|
|
1190
|
+
'%Promise_reject%': ['Promise', 'reject'],
|
|
1191
|
+
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
1192
|
+
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
1193
|
+
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
1194
|
+
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
1195
|
+
'%SetPrototype%': ['Set', 'prototype'],
|
|
1196
|
+
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
1197
|
+
'%StringPrototype%': ['String', 'prototype'],
|
|
1198
|
+
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
1199
|
+
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
1200
|
+
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
1201
|
+
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
1202
|
+
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
1203
|
+
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
1204
|
+
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
1205
|
+
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
1206
|
+
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
1207
|
+
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
1208
|
+
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
var $concat = functionBind.call(functionCall, Array.prototype.concat);
|
|
1214
|
+
var $spliceApply = functionBind.call(functionApply, Array.prototype.splice);
|
|
1215
|
+
var $replace = functionBind.call(functionCall, String.prototype.replace);
|
|
1216
|
+
var $strSlice = functionBind.call(functionCall, String.prototype.slice);
|
|
1217
|
+
var $exec = functionBind.call(functionCall, RegExp.prototype.exec);
|
|
1218
|
+
|
|
1219
|
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
1220
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
1221
|
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
1222
|
+
var stringToPath = function stringToPath(string) {
|
|
1223
|
+
var first = $strSlice(string, 0, 1);
|
|
1224
|
+
var last = $strSlice(string, -1);
|
|
1225
|
+
if (first === '%' && last !== '%') {
|
|
1226
|
+
throw new syntax('invalid intrinsic syntax, expected closing `%`');
|
|
1227
|
+
} else if (last === '%' && first !== '%') {
|
|
1228
|
+
throw new syntax('invalid intrinsic syntax, expected opening `%`');
|
|
1229
|
+
}
|
|
1230
|
+
var result = [];
|
|
1231
|
+
$replace(string, rePropName, function (match, number, quote, subString) {
|
|
1232
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
|
1233
|
+
});
|
|
1234
|
+
return result;
|
|
1235
|
+
};
|
|
1236
|
+
/* end adaptation */
|
|
1237
|
+
|
|
1238
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
1239
|
+
var intrinsicName = name;
|
|
1240
|
+
var alias;
|
|
1241
|
+
if (hasown(LEGACY_ALIASES, intrinsicName)) {
|
|
1242
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
1243
|
+
intrinsicName = '%' + alias[0] + '%';
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
if (hasown(INTRINSICS, intrinsicName)) {
|
|
1247
|
+
var value = INTRINSICS[intrinsicName];
|
|
1248
|
+
if (value === needsEval) {
|
|
1249
|
+
value = doEval(intrinsicName);
|
|
1250
|
+
}
|
|
1251
|
+
if (typeof value === 'undefined' && !allowMissing) {
|
|
1252
|
+
throw new type('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
return {
|
|
1256
|
+
alias: alias,
|
|
1257
|
+
name: intrinsicName,
|
|
1258
|
+
value: value
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
throw new syntax('intrinsic ' + name + ' does not exist!');
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
1266
|
+
if (typeof name !== 'string' || name.length === 0) {
|
|
1267
|
+
throw new type('intrinsic name must be a non-empty string');
|
|
1268
|
+
}
|
|
1269
|
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
1270
|
+
throw new type('"allowMissing" argument must be a boolean');
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
1274
|
+
throw new syntax('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
1275
|
+
}
|
|
1276
|
+
var parts = stringToPath(name);
|
|
1277
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
1278
|
+
|
|
1279
|
+
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
1280
|
+
var intrinsicRealName = intrinsic.name;
|
|
1281
|
+
var value = intrinsic.value;
|
|
1282
|
+
var skipFurtherCaching = false;
|
|
1283
|
+
|
|
1284
|
+
var alias = intrinsic.alias;
|
|
1285
|
+
if (alias) {
|
|
1286
|
+
intrinsicBaseName = alias[0];
|
|
1287
|
+
$spliceApply(parts, $concat([0, 1], alias));
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
1291
|
+
var part = parts[i];
|
|
1292
|
+
var first = $strSlice(part, 0, 1);
|
|
1293
|
+
var last = $strSlice(part, -1);
|
|
1294
|
+
if (
|
|
1295
|
+
(
|
|
1296
|
+
(first === '"' || first === "'" || first === '`')
|
|
1297
|
+
|| (last === '"' || last === "'" || last === '`')
|
|
1298
|
+
)
|
|
1299
|
+
&& first !== last
|
|
1300
|
+
) {
|
|
1301
|
+
throw new syntax('property names with quotes must have matching quotes');
|
|
1302
|
+
}
|
|
1303
|
+
if (part === 'constructor' || !isOwn) {
|
|
1304
|
+
skipFurtherCaching = true;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
intrinsicBaseName += '.' + part;
|
|
1308
|
+
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
1309
|
+
|
|
1310
|
+
if (hasown(INTRINSICS, intrinsicRealName)) {
|
|
1311
|
+
value = INTRINSICS[intrinsicRealName];
|
|
1312
|
+
} else if (value != null) {
|
|
1313
|
+
if (!(part in value)) {
|
|
1314
|
+
if (!allowMissing) {
|
|
1315
|
+
throw new type('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
1316
|
+
}
|
|
1317
|
+
return void undefined$1;
|
|
1318
|
+
}
|
|
1319
|
+
if (gopd && (i + 1) >= parts.length) {
|
|
1320
|
+
var desc = gopd(value, part);
|
|
1321
|
+
isOwn = !!desc;
|
|
1322
|
+
|
|
1323
|
+
// By convention, when a data property is converted to an accessor
|
|
1324
|
+
// property to emulate a data property that does not suffer from
|
|
1325
|
+
// the override mistake, that accessor's getter is marked with
|
|
1326
|
+
// an `originalValue` property. Here, when we detect this, we
|
|
1327
|
+
// uphold the illusion by pretending to see that original data
|
|
1328
|
+
// property, i.e., returning the value rather than the getter
|
|
1329
|
+
// itself.
|
|
1330
|
+
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
1331
|
+
value = desc.get;
|
|
1332
|
+
} else {
|
|
1333
|
+
value = value[part];
|
|
1334
|
+
}
|
|
1335
|
+
} else {
|
|
1336
|
+
isOwn = hasown(value, part);
|
|
1337
|
+
value = value[part];
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
if (isOwn && !skipFurtherCaching) {
|
|
1341
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
return value;
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
/** @type {(thisArg: string, searchString: string, position?: number) => number} */
|
|
1349
|
+
var $indexOf = callBindApplyHelpers([getIntrinsic('%String.prototype.indexOf%')]);
|
|
1350
|
+
|
|
1351
|
+
/** @type {import('.')} */
|
|
1352
|
+
var callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
1353
|
+
// eslint-disable-next-line no-extra-parens
|
|
1354
|
+
var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (getIntrinsic(name, !!allowMissing));
|
|
1355
|
+
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
1356
|
+
return callBindApplyHelpers([intrinsic]);
|
|
1357
|
+
}
|
|
1358
|
+
return intrinsic;
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
var $Map = getIntrinsic('%Map%', true);
|
|
1362
|
+
|
|
1363
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
|
|
1364
|
+
var $mapGet = callBound('Map.prototype.get', true);
|
|
1365
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
|
|
1366
|
+
var $mapSet = callBound('Map.prototype.set', true);
|
|
1367
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
|
|
1368
|
+
var $mapHas = callBound('Map.prototype.has', true);
|
|
1369
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
|
|
1370
|
+
var $mapDelete = callBound('Map.prototype.delete', true);
|
|
1371
|
+
/** @type {<K, V>(thisArg: Map<K, V>) => number} */
|
|
1372
|
+
var $mapSize = callBound('Map.prototype.size', true);
|
|
1373
|
+
|
|
1374
|
+
/** @type {import('.')} */
|
|
1375
|
+
var sideChannelMap = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
|
|
1376
|
+
/** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
|
|
1377
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
1378
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
1379
|
+
|
|
1380
|
+
/** @type {Map<K, V> | undefined} */ var $m;
|
|
1381
|
+
|
|
1382
|
+
/** @type {Channel} */
|
|
1383
|
+
var channel = {
|
|
1384
|
+
assert: function (key) {
|
|
1385
|
+
if (!channel.has(key)) {
|
|
1386
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
'delete': function (key) {
|
|
1390
|
+
if ($m) {
|
|
1391
|
+
var result = $mapDelete($m, key);
|
|
1392
|
+
if ($mapSize($m) === 0) {
|
|
1393
|
+
$m = void undefined;
|
|
1394
|
+
}
|
|
1395
|
+
return result;
|
|
1396
|
+
}
|
|
1397
|
+
return false;
|
|
1398
|
+
},
|
|
1399
|
+
get: function (key) { // eslint-disable-line consistent-return
|
|
1400
|
+
if ($m) {
|
|
1401
|
+
return $mapGet($m, key);
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
has: function (key) {
|
|
1405
|
+
if ($m) {
|
|
1406
|
+
return $mapHas($m, key);
|
|
1407
|
+
}
|
|
1408
|
+
return false;
|
|
1409
|
+
},
|
|
1410
|
+
set: function (key, value) {
|
|
1411
|
+
if (!$m) {
|
|
1412
|
+
// @ts-expect-error TS can't handle narrowing a variable inside a closure
|
|
1413
|
+
$m = new $Map();
|
|
1414
|
+
}
|
|
1415
|
+
$mapSet($m, key, value);
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
// @ts-expect-error TODO: figure out why TS is erroring here
|
|
1420
|
+
return channel;
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
var $WeakMap = getIntrinsic('%WeakMap%', true);
|
|
1424
|
+
|
|
1425
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
|
|
1426
|
+
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
1427
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
|
|
1428
|
+
var $weakMapSet = callBound('WeakMap.prototype.set', true);
|
|
1429
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
1430
|
+
var $weakMapHas = callBound('WeakMap.prototype.has', true);
|
|
1431
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
1432
|
+
var $weakMapDelete = callBound('WeakMap.prototype.delete', true);
|
|
1433
|
+
|
|
1434
|
+
/** @type {import('.')} */
|
|
1435
|
+
var sideChannelWeakmap = $WeakMap
|
|
1436
|
+
? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
|
|
1437
|
+
/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
|
|
1438
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
1439
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
1440
|
+
|
|
1441
|
+
/** @type {WeakMap<K & object, V> | undefined} */ var $wm;
|
|
1442
|
+
/** @type {Channel | undefined} */ var $m;
|
|
1443
|
+
|
|
1444
|
+
/** @type {Channel} */
|
|
1445
|
+
var channel = {
|
|
1446
|
+
assert: function (key) {
|
|
1447
|
+
if (!channel.has(key)) {
|
|
1448
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
1449
|
+
}
|
|
1450
|
+
},
|
|
1451
|
+
'delete': function (key) {
|
|
1452
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1453
|
+
if ($wm) {
|
|
1454
|
+
return $weakMapDelete($wm, key);
|
|
1455
|
+
}
|
|
1456
|
+
} else if (sideChannelMap) {
|
|
1457
|
+
if ($m) {
|
|
1458
|
+
return $m['delete'](key);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
return false;
|
|
1462
|
+
},
|
|
1463
|
+
get: function (key) {
|
|
1464
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1465
|
+
if ($wm) {
|
|
1466
|
+
return $weakMapGet($wm, key);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
return $m && $m.get(key);
|
|
1470
|
+
},
|
|
1471
|
+
has: function (key) {
|
|
1472
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1473
|
+
if ($wm) {
|
|
1474
|
+
return $weakMapHas($wm, key);
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
return !!$m && $m.has(key);
|
|
1478
|
+
},
|
|
1479
|
+
set: function (key, value) {
|
|
1480
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1481
|
+
if (!$wm) {
|
|
1482
|
+
$wm = new $WeakMap();
|
|
1483
|
+
}
|
|
1484
|
+
$weakMapSet($wm, key, value);
|
|
1485
|
+
} else if (sideChannelMap) {
|
|
1486
|
+
if (!$m) {
|
|
1487
|
+
$m = sideChannelMap();
|
|
1488
|
+
}
|
|
1489
|
+
// eslint-disable-next-line no-extra-parens
|
|
1490
|
+
/** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1495
|
+
// @ts-expect-error TODO: figure out why this is erroring
|
|
1496
|
+
return channel;
|
|
1497
|
+
}
|
|
1498
|
+
: sideChannelMap;
|
|
1499
|
+
|
|
1500
|
+
var makeChannel = sideChannelWeakmap || sideChannelMap || sideChannelList;
|
|
1501
|
+
|
|
1502
|
+
/** @type {import('.')} */
|
|
1503
|
+
var sideChannel = function getSideChannel() {
|
|
1504
|
+
/** @typedef {ReturnType<typeof getSideChannel>} Channel */
|
|
1505
|
+
|
|
1506
|
+
/** @type {Channel | undefined} */ var $channelData;
|
|
1507
|
+
|
|
1508
|
+
/** @type {Channel} */
|
|
1509
|
+
var channel = {
|
|
1510
|
+
assert: function (key) {
|
|
1511
|
+
if (!channel.has(key)) {
|
|
1512
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
'delete': function (key) {
|
|
1516
|
+
return !!$channelData && $channelData['delete'](key);
|
|
1517
|
+
},
|
|
1518
|
+
get: function (key) {
|
|
1519
|
+
return $channelData && $channelData.get(key);
|
|
1520
|
+
},
|
|
1521
|
+
has: function (key) {
|
|
1522
|
+
return !!$channelData && $channelData.has(key);
|
|
1523
|
+
},
|
|
1524
|
+
set: function (key, value) {
|
|
1525
|
+
if (!$channelData) {
|
|
1526
|
+
$channelData = makeChannel();
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
$channelData.set(key, value);
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
// @ts-expect-error TODO: figure out why this is erroring
|
|
1533
|
+
return channel;
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1536
|
+
var replace = String.prototype.replace;
|
|
1537
|
+
var percentTwenties = /%20/g;
|
|
1538
|
+
|
|
1539
|
+
var Format = {
|
|
1540
|
+
RFC1738: 'RFC1738',
|
|
1541
|
+
RFC3986: 'RFC3986'
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
var formats = {
|
|
1545
|
+
'default': Format.RFC3986,
|
|
1546
|
+
formatters: {
|
|
1547
|
+
RFC1738: function (value) {
|
|
1548
|
+
return replace.call(value, percentTwenties, '+');
|
|
1549
|
+
},
|
|
1550
|
+
RFC3986: function (value) {
|
|
1551
|
+
return String(value);
|
|
1552
|
+
}
|
|
1553
|
+
},
|
|
1554
|
+
RFC1738: Format.RFC1738,
|
|
1555
|
+
RFC3986: Format.RFC3986
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
var has$2 = Object.prototype.hasOwnProperty;
|
|
1559
|
+
var isArray$2 = Array.isArray;
|
|
1560
|
+
|
|
1561
|
+
var hexTable = (function () {
|
|
1562
|
+
var array = [];
|
|
1563
|
+
for (var i = 0; i < 256; ++i) {
|
|
1564
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
return array;
|
|
1568
|
+
}());
|
|
1569
|
+
|
|
1570
|
+
var compactQueue = function compactQueue(queue) {
|
|
1571
|
+
while (queue.length > 1) {
|
|
1572
|
+
var item = queue.pop();
|
|
1573
|
+
var obj = item.obj[item.prop];
|
|
1574
|
+
|
|
1575
|
+
if (isArray$2(obj)) {
|
|
1576
|
+
var compacted = [];
|
|
1577
|
+
|
|
1578
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
1579
|
+
if (typeof obj[j] !== 'undefined') {
|
|
1580
|
+
compacted.push(obj[j]);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
item.obj[item.prop] = compacted;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
1590
|
+
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
1591
|
+
for (var i = 0; i < source.length; ++i) {
|
|
1592
|
+
if (typeof source[i] !== 'undefined') {
|
|
1593
|
+
obj[i] = source[i];
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
return obj;
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1600
|
+
var merge = function merge(target, source, options) {
|
|
1601
|
+
/* eslint no-param-reassign: 0 */
|
|
1602
|
+
if (!source) {
|
|
1603
|
+
return target;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
1607
|
+
if (isArray$2(target)) {
|
|
1608
|
+
target.push(source);
|
|
1609
|
+
} else if (target && typeof target === 'object') {
|
|
1610
|
+
if (
|
|
1611
|
+
(options && (options.plainObjects || options.allowPrototypes))
|
|
1612
|
+
|| !has$2.call(Object.prototype, source)
|
|
1613
|
+
) {
|
|
1614
|
+
target[source] = true;
|
|
1615
|
+
}
|
|
1616
|
+
} else {
|
|
1617
|
+
return [target, source];
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
return target;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
if (!target || typeof target !== 'object') {
|
|
1624
|
+
return [target].concat(source);
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
var mergeTarget = target;
|
|
1628
|
+
if (isArray$2(target) && !isArray$2(source)) {
|
|
1629
|
+
mergeTarget = arrayToObject(target, options);
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
if (isArray$2(target) && isArray$2(source)) {
|
|
1633
|
+
source.forEach(function (item, i) {
|
|
1634
|
+
if (has$2.call(target, i)) {
|
|
1635
|
+
var targetItem = target[i];
|
|
1636
|
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
1637
|
+
target[i] = merge(targetItem, item, options);
|
|
1638
|
+
} else {
|
|
1639
|
+
target.push(item);
|
|
1640
|
+
}
|
|
1641
|
+
} else {
|
|
1642
|
+
target[i] = item;
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
return target;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
1649
|
+
var value = source[key];
|
|
1650
|
+
|
|
1651
|
+
if (has$2.call(acc, key)) {
|
|
1652
|
+
acc[key] = merge(acc[key], value, options);
|
|
1653
|
+
} else {
|
|
1654
|
+
acc[key] = value;
|
|
1655
|
+
}
|
|
1656
|
+
return acc;
|
|
1657
|
+
}, mergeTarget);
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
var assign = function assignSingleSource(target, source) {
|
|
1661
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
1662
|
+
acc[key] = source[key];
|
|
1663
|
+
return acc;
|
|
1664
|
+
}, target);
|
|
1665
|
+
};
|
|
1666
|
+
|
|
1667
|
+
var decode = function (str, defaultDecoder, charset) {
|
|
1668
|
+
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
1669
|
+
if (charset === 'iso-8859-1') {
|
|
1670
|
+
// unescape never throws, no try...catch needed:
|
|
1671
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
1672
|
+
}
|
|
1673
|
+
// utf-8
|
|
1674
|
+
try {
|
|
1675
|
+
return decodeURIComponent(strWithoutPlus);
|
|
1676
|
+
} catch (e) {
|
|
1677
|
+
return strWithoutPlus;
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
|
|
1681
|
+
var limit$1 = 1024;
|
|
1682
|
+
|
|
1683
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
1684
|
+
|
|
1685
|
+
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
1686
|
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
1687
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
1688
|
+
if (str.length === 0) {
|
|
1689
|
+
return str;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
var string = str;
|
|
1693
|
+
if (typeof str === 'symbol') {
|
|
1694
|
+
string = Symbol.prototype.toString.call(str);
|
|
1695
|
+
} else if (typeof str !== 'string') {
|
|
1696
|
+
string = String(str);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
if (charset === 'iso-8859-1') {
|
|
1700
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
1701
|
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
var out = '';
|
|
1706
|
+
for (var j = 0; j < string.length; j += limit$1) {
|
|
1707
|
+
var segment = string.length >= limit$1 ? string.slice(j, j + limit$1) : string;
|
|
1708
|
+
var arr = [];
|
|
1709
|
+
|
|
1710
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
1711
|
+
var c = segment.charCodeAt(i);
|
|
1712
|
+
if (
|
|
1713
|
+
c === 0x2D // -
|
|
1714
|
+
|| c === 0x2E // .
|
|
1715
|
+
|| c === 0x5F // _
|
|
1716
|
+
|| c === 0x7E // ~
|
|
1717
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
1718
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
1719
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
1720
|
+
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
1721
|
+
) {
|
|
1722
|
+
arr[arr.length] = segment.charAt(i);
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
if (c < 0x80) {
|
|
1727
|
+
arr[arr.length] = hexTable[c];
|
|
1728
|
+
continue;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
if (c < 0x800) {
|
|
1732
|
+
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
1733
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
1734
|
+
continue;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
1738
|
+
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
1739
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
1740
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
i += 1;
|
|
1745
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
1746
|
+
|
|
1747
|
+
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
1748
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
1749
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
1750
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
out += arr.join('');
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
return out;
|
|
1757
|
+
};
|
|
1758
|
+
|
|
1759
|
+
var compact = function compact(value) {
|
|
1760
|
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
1761
|
+
var refs = [];
|
|
1762
|
+
|
|
1763
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
1764
|
+
var item = queue[i];
|
|
1765
|
+
var obj = item.obj[item.prop];
|
|
1766
|
+
|
|
1767
|
+
var keys = Object.keys(obj);
|
|
1768
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
1769
|
+
var key = keys[j];
|
|
1770
|
+
var val = obj[key];
|
|
1771
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
1772
|
+
queue.push({ obj: obj, prop: key });
|
|
1773
|
+
refs.push(val);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
compactQueue(queue);
|
|
1779
|
+
|
|
1780
|
+
return value;
|
|
1781
|
+
};
|
|
1782
|
+
|
|
1783
|
+
var isRegExp = function isRegExp(obj) {
|
|
1784
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1787
|
+
var isBuffer = function isBuffer(obj) {
|
|
1788
|
+
if (!obj || typeof obj !== 'object') {
|
|
1789
|
+
return false;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
1793
|
+
};
|
|
1794
|
+
|
|
1795
|
+
var combine = function combine(a, b) {
|
|
1796
|
+
return [].concat(a, b);
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
var maybeMap = function maybeMap(val, fn) {
|
|
1800
|
+
if (isArray$2(val)) {
|
|
1801
|
+
var mapped = [];
|
|
1802
|
+
for (var i = 0; i < val.length; i += 1) {
|
|
1803
|
+
mapped.push(fn(val[i]));
|
|
1804
|
+
}
|
|
1805
|
+
return mapped;
|
|
1806
|
+
}
|
|
1807
|
+
return fn(val);
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1810
|
+
var utils = {
|
|
1811
|
+
arrayToObject: arrayToObject,
|
|
1812
|
+
assign: assign,
|
|
1813
|
+
combine: combine,
|
|
1814
|
+
compact: compact,
|
|
1815
|
+
decode: decode,
|
|
1816
|
+
encode: encode,
|
|
1817
|
+
isBuffer: isBuffer,
|
|
1818
|
+
isRegExp: isRegExp,
|
|
1819
|
+
maybeMap: maybeMap,
|
|
1820
|
+
merge: merge
|
|
1821
|
+
};
|
|
1822
|
+
|
|
1823
|
+
var has$1 = Object.prototype.hasOwnProperty;
|
|
1824
|
+
|
|
1825
|
+
var arrayPrefixGenerators = {
|
|
1826
|
+
brackets: function brackets(prefix) {
|
|
1827
|
+
return prefix + '[]';
|
|
1828
|
+
},
|
|
1829
|
+
comma: 'comma',
|
|
1830
|
+
indices: function indices(prefix, key) {
|
|
1831
|
+
return prefix + '[' + key + ']';
|
|
1832
|
+
},
|
|
1833
|
+
repeat: function repeat(prefix) {
|
|
1834
|
+
return prefix;
|
|
1835
|
+
}
|
|
1836
|
+
};
|
|
1837
|
+
|
|
1838
|
+
var isArray$1 = Array.isArray;
|
|
1839
|
+
var push = Array.prototype.push;
|
|
1840
|
+
var pushToArray = function (arr, valueOrArray) {
|
|
1841
|
+
push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1844
|
+
var toISO = Date.prototype.toISOString;
|
|
1845
|
+
|
|
1846
|
+
var defaultFormat = formats['default'];
|
|
1847
|
+
var defaults$1 = {
|
|
1848
|
+
addQueryPrefix: false,
|
|
1849
|
+
allowDots: false,
|
|
1850
|
+
allowEmptyArrays: false,
|
|
1851
|
+
arrayFormat: 'indices',
|
|
1852
|
+
charset: 'utf-8',
|
|
1853
|
+
charsetSentinel: false,
|
|
1854
|
+
commaRoundTrip: false,
|
|
1855
|
+
delimiter: '&',
|
|
1856
|
+
encode: true,
|
|
1857
|
+
encodeDotInKeys: false,
|
|
1858
|
+
encoder: utils.encode,
|
|
1859
|
+
encodeValuesOnly: false,
|
|
1860
|
+
filter: void undefined,
|
|
1861
|
+
format: defaultFormat,
|
|
1862
|
+
formatter: formats.formatters[defaultFormat],
|
|
1863
|
+
// deprecated
|
|
1864
|
+
indices: false,
|
|
1865
|
+
serializeDate: function serializeDate(date) {
|
|
1866
|
+
return toISO.call(date);
|
|
1867
|
+
},
|
|
1868
|
+
skipNulls: false,
|
|
1869
|
+
strictNullHandling: false
|
|
1870
|
+
};
|
|
1871
|
+
|
|
1872
|
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
1873
|
+
return typeof v === 'string'
|
|
1874
|
+
|| typeof v === 'number'
|
|
1875
|
+
|| typeof v === 'boolean'
|
|
1876
|
+
|| typeof v === 'symbol'
|
|
1877
|
+
|| typeof v === 'bigint';
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
var sentinel = {};
|
|
1881
|
+
|
|
1882
|
+
var stringify = function stringify(
|
|
1883
|
+
object,
|
|
1884
|
+
prefix,
|
|
1885
|
+
generateArrayPrefix,
|
|
1886
|
+
commaRoundTrip,
|
|
1887
|
+
allowEmptyArrays,
|
|
1888
|
+
strictNullHandling,
|
|
1889
|
+
skipNulls,
|
|
1890
|
+
encodeDotInKeys,
|
|
1891
|
+
encoder,
|
|
1892
|
+
filter,
|
|
1893
|
+
sort,
|
|
1894
|
+
allowDots,
|
|
1895
|
+
serializeDate,
|
|
1896
|
+
format,
|
|
1897
|
+
formatter,
|
|
1898
|
+
encodeValuesOnly,
|
|
1899
|
+
charset,
|
|
1900
|
+
sideChannel$1
|
|
1901
|
+
) {
|
|
1902
|
+
var obj = object;
|
|
1903
|
+
|
|
1904
|
+
var tmpSc = sideChannel$1;
|
|
1905
|
+
var step = 0;
|
|
1906
|
+
var findFlag = false;
|
|
1907
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
|
|
1908
|
+
// Where object last appeared in the ref tree
|
|
1909
|
+
var pos = tmpSc.get(object);
|
|
1910
|
+
step += 1;
|
|
1911
|
+
if (typeof pos !== 'undefined') {
|
|
1912
|
+
if (pos === step) {
|
|
1913
|
+
throw new RangeError('Cyclic object value');
|
|
1914
|
+
} else {
|
|
1915
|
+
findFlag = true; // Break while
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
if (typeof tmpSc.get(sentinel) === 'undefined') {
|
|
1919
|
+
step = 0;
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
if (typeof filter === 'function') {
|
|
1924
|
+
obj = filter(prefix, obj);
|
|
1925
|
+
} else if (obj instanceof Date) {
|
|
1926
|
+
obj = serializeDate(obj);
|
|
1927
|
+
} else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
1928
|
+
obj = utils.maybeMap(obj, function (value) {
|
|
1929
|
+
if (value instanceof Date) {
|
|
1930
|
+
return serializeDate(value);
|
|
1931
|
+
}
|
|
1932
|
+
return value;
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
if (obj === null) {
|
|
1937
|
+
if (strictNullHandling) {
|
|
1938
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
obj = '';
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
1945
|
+
if (encoder) {
|
|
1946
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
|
|
1947
|
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
|
|
1948
|
+
}
|
|
1949
|
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
var values = [];
|
|
1953
|
+
|
|
1954
|
+
if (typeof obj === 'undefined') {
|
|
1955
|
+
return values;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
var objKeys;
|
|
1959
|
+
if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
1960
|
+
// we need to join elements in
|
|
1961
|
+
if (encodeValuesOnly && encoder) {
|
|
1962
|
+
obj = utils.maybeMap(obj, encoder);
|
|
1963
|
+
}
|
|
1964
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
1965
|
+
} else if (isArray$1(filter)) {
|
|
1966
|
+
objKeys = filter;
|
|
1967
|
+
} else {
|
|
1968
|
+
var keys = Object.keys(obj);
|
|
1969
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
|
|
1973
|
+
|
|
1974
|
+
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
1975
|
+
|
|
1976
|
+
if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
|
|
1977
|
+
return adjustedPrefix + '[]';
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
1981
|
+
var key = objKeys[j];
|
|
1982
|
+
var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
|
|
1983
|
+
? key.value
|
|
1984
|
+
: obj[key];
|
|
1985
|
+
|
|
1986
|
+
if (skipNulls && value === null) {
|
|
1987
|
+
continue;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
|
|
1991
|
+
var keyPrefix = isArray$1(obj)
|
|
1992
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
1993
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
1994
|
+
|
|
1995
|
+
sideChannel$1.set(object, step);
|
|
1996
|
+
var valueSideChannel = sideChannel();
|
|
1997
|
+
valueSideChannel.set(sentinel, sideChannel$1);
|
|
1998
|
+
pushToArray(values, stringify(
|
|
1999
|
+
value,
|
|
2000
|
+
keyPrefix,
|
|
2001
|
+
generateArrayPrefix,
|
|
2002
|
+
commaRoundTrip,
|
|
2003
|
+
allowEmptyArrays,
|
|
2004
|
+
strictNullHandling,
|
|
2005
|
+
skipNulls,
|
|
2006
|
+
encodeDotInKeys,
|
|
2007
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
2008
|
+
filter,
|
|
2009
|
+
sort,
|
|
2010
|
+
allowDots,
|
|
2011
|
+
serializeDate,
|
|
2012
|
+
format,
|
|
2013
|
+
formatter,
|
|
2014
|
+
encodeValuesOnly,
|
|
2015
|
+
charset,
|
|
2016
|
+
valueSideChannel
|
|
2017
|
+
));
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
return values;
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
2024
|
+
if (!opts) {
|
|
2025
|
+
return defaults$1;
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2029
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
2033
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
2037
|
+
throw new TypeError('Encoder has to be a function.');
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
var charset = opts.charset || defaults$1.charset;
|
|
2041
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2042
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
var format = formats['default'];
|
|
2046
|
+
if (typeof opts.format !== 'undefined') {
|
|
2047
|
+
if (!has$1.call(formats.formatters, opts.format)) {
|
|
2048
|
+
throw new TypeError('Unknown format option provided.');
|
|
2049
|
+
}
|
|
2050
|
+
format = opts.format;
|
|
2051
|
+
}
|
|
2052
|
+
var formatter = formats.formatters[format];
|
|
2053
|
+
|
|
2054
|
+
var filter = defaults$1.filter;
|
|
2055
|
+
if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
|
|
2056
|
+
filter = opts.filter;
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
var arrayFormat;
|
|
2060
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
2061
|
+
arrayFormat = opts.arrayFormat;
|
|
2062
|
+
} else if ('indices' in opts) {
|
|
2063
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
2064
|
+
} else {
|
|
2065
|
+
arrayFormat = defaults$1.arrayFormat;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
2069
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
|
|
2073
|
+
|
|
2074
|
+
return {
|
|
2075
|
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
2076
|
+
allowDots: allowDots,
|
|
2077
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
|
|
2078
|
+
arrayFormat: arrayFormat,
|
|
2079
|
+
charset: charset,
|
|
2080
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
2081
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
2082
|
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
|
|
2083
|
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
|
|
2084
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
|
|
2085
|
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
|
|
2086
|
+
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
2087
|
+
filter: filter,
|
|
2088
|
+
format: format,
|
|
2089
|
+
formatter: formatter,
|
|
2090
|
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
|
|
2091
|
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
|
|
2092
|
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
|
2093
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
|
|
2094
|
+
};
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
var stringify_1 = function (object, opts) {
|
|
2098
|
+
var obj = object;
|
|
2099
|
+
var options = normalizeStringifyOptions(opts);
|
|
2100
|
+
|
|
2101
|
+
var objKeys;
|
|
2102
|
+
var filter;
|
|
2103
|
+
|
|
2104
|
+
if (typeof options.filter === 'function') {
|
|
2105
|
+
filter = options.filter;
|
|
2106
|
+
obj = filter('', obj);
|
|
2107
|
+
} else if (isArray$1(options.filter)) {
|
|
2108
|
+
filter = options.filter;
|
|
2109
|
+
objKeys = filter;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
var keys = [];
|
|
2113
|
+
|
|
2114
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
2115
|
+
return '';
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
2119
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
2120
|
+
|
|
2121
|
+
if (!objKeys) {
|
|
2122
|
+
objKeys = Object.keys(obj);
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
if (options.sort) {
|
|
2126
|
+
objKeys.sort(options.sort);
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
var sideChannel$1 = sideChannel();
|
|
2130
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
2131
|
+
var key = objKeys[i];
|
|
2132
|
+
var value = obj[key];
|
|
2133
|
+
|
|
2134
|
+
if (options.skipNulls && value === null) {
|
|
2135
|
+
continue;
|
|
2136
|
+
}
|
|
2137
|
+
pushToArray(keys, stringify(
|
|
2138
|
+
value,
|
|
2139
|
+
key,
|
|
2140
|
+
generateArrayPrefix,
|
|
2141
|
+
commaRoundTrip,
|
|
2142
|
+
options.allowEmptyArrays,
|
|
2143
|
+
options.strictNullHandling,
|
|
2144
|
+
options.skipNulls,
|
|
2145
|
+
options.encodeDotInKeys,
|
|
2146
|
+
options.encode ? options.encoder : null,
|
|
2147
|
+
options.filter,
|
|
2148
|
+
options.sort,
|
|
2149
|
+
options.allowDots,
|
|
2150
|
+
options.serializeDate,
|
|
2151
|
+
options.format,
|
|
2152
|
+
options.formatter,
|
|
2153
|
+
options.encodeValuesOnly,
|
|
2154
|
+
options.charset,
|
|
2155
|
+
sideChannel$1
|
|
2156
|
+
));
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
var joined = keys.join(options.delimiter);
|
|
2160
|
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
2161
|
+
|
|
2162
|
+
if (options.charsetSentinel) {
|
|
2163
|
+
if (options.charset === 'iso-8859-1') {
|
|
2164
|
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
2165
|
+
prefix += 'utf8=%26%2310003%3B&';
|
|
2166
|
+
} else {
|
|
2167
|
+
// encodeURIComponent('✓')
|
|
2168
|
+
prefix += 'utf8=%E2%9C%93&';
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
return joined.length > 0 ? prefix + joined : '';
|
|
2173
|
+
};
|
|
2174
|
+
|
|
2175
|
+
var has = Object.prototype.hasOwnProperty;
|
|
2176
|
+
var isArray = Array.isArray;
|
|
2177
|
+
|
|
2178
|
+
var defaults = {
|
|
2179
|
+
allowDots: false,
|
|
2180
|
+
allowEmptyArrays: false,
|
|
2181
|
+
allowPrototypes: false,
|
|
2182
|
+
allowSparse: false,
|
|
2183
|
+
arrayLimit: 20,
|
|
2184
|
+
charset: 'utf-8',
|
|
2185
|
+
charsetSentinel: false,
|
|
2186
|
+
comma: false,
|
|
2187
|
+
decodeDotInKeys: false,
|
|
2188
|
+
decoder: utils.decode,
|
|
2189
|
+
delimiter: '&',
|
|
2190
|
+
depth: 5,
|
|
2191
|
+
duplicates: 'combine',
|
|
2192
|
+
ignoreQueryPrefix: false,
|
|
2193
|
+
interpretNumericEntities: false,
|
|
2194
|
+
parameterLimit: 1000,
|
|
2195
|
+
parseArrays: true,
|
|
2196
|
+
plainObjects: false,
|
|
2197
|
+
strictDepth: false,
|
|
2198
|
+
strictNullHandling: false,
|
|
2199
|
+
throwOnLimitExceeded: false
|
|
2200
|
+
};
|
|
2201
|
+
|
|
2202
|
+
var interpretNumericEntities = function (str) {
|
|
2203
|
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
|
2204
|
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
2205
|
+
});
|
|
2206
|
+
};
|
|
2207
|
+
|
|
2208
|
+
var parseArrayValue = function (val, options, currentArrayLength) {
|
|
2209
|
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
2210
|
+
return val.split(',');
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
|
|
2214
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
return val;
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
// This is what browsers will submit when the ✓ character occurs in an
|
|
2221
|
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
2222
|
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
2223
|
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
2224
|
+
// the ✓ character, such as us-ascii.
|
|
2225
|
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
2226
|
+
|
|
2227
|
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
2228
|
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
2229
|
+
|
|
2230
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
2231
|
+
var obj = { __proto__: null };
|
|
2232
|
+
|
|
2233
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
2234
|
+
cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
2235
|
+
|
|
2236
|
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
2237
|
+
var parts = cleanStr.split(
|
|
2238
|
+
options.delimiter,
|
|
2239
|
+
options.throwOnLimitExceeded ? limit + 1 : limit
|
|
2240
|
+
);
|
|
2241
|
+
|
|
2242
|
+
if (options.throwOnLimitExceeded && parts.length > limit) {
|
|
2243
|
+
throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
2247
|
+
var i;
|
|
2248
|
+
|
|
2249
|
+
var charset = options.charset;
|
|
2250
|
+
if (options.charsetSentinel) {
|
|
2251
|
+
for (i = 0; i < parts.length; ++i) {
|
|
2252
|
+
if (parts[i].indexOf('utf8=') === 0) {
|
|
2253
|
+
if (parts[i] === charsetSentinel) {
|
|
2254
|
+
charset = 'utf-8';
|
|
2255
|
+
} else if (parts[i] === isoSentinel) {
|
|
2256
|
+
charset = 'iso-8859-1';
|
|
2257
|
+
}
|
|
2258
|
+
skipIndex = i;
|
|
2259
|
+
i = parts.length; // The eslint settings do not allow break;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
for (i = 0; i < parts.length; ++i) {
|
|
2265
|
+
if (i === skipIndex) {
|
|
2266
|
+
continue;
|
|
2267
|
+
}
|
|
2268
|
+
var part = parts[i];
|
|
2269
|
+
|
|
2270
|
+
var bracketEqualsPos = part.indexOf(']=');
|
|
2271
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
2272
|
+
|
|
2273
|
+
var key;
|
|
2274
|
+
var val;
|
|
2275
|
+
if (pos === -1) {
|
|
2276
|
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
2277
|
+
val = options.strictNullHandling ? null : '';
|
|
2278
|
+
} else {
|
|
2279
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
2280
|
+
|
|
2281
|
+
val = utils.maybeMap(
|
|
2282
|
+
parseArrayValue(
|
|
2283
|
+
part.slice(pos + 1),
|
|
2284
|
+
options,
|
|
2285
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
2286
|
+
),
|
|
2287
|
+
function (encodedVal) {
|
|
2288
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
2289
|
+
}
|
|
2290
|
+
);
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
2294
|
+
val = interpretNumericEntities(String(val));
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
if (part.indexOf('[]=') > -1) {
|
|
2298
|
+
val = isArray(val) ? [val] : val;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
var existing = has.call(obj, key);
|
|
2302
|
+
if (existing && options.duplicates === 'combine') {
|
|
2303
|
+
obj[key] = utils.combine(obj[key], val);
|
|
2304
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
2305
|
+
obj[key] = val;
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
return obj;
|
|
2310
|
+
};
|
|
2311
|
+
|
|
2312
|
+
var parseObject = function (chain, val, options, valuesParsed) {
|
|
2313
|
+
var currentArrayLength = 0;
|
|
2314
|
+
if (chain.length > 0 && chain[chain.length - 1] === '[]') {
|
|
2315
|
+
var parentKey = chain.slice(0, -1).join('');
|
|
2316
|
+
currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
|
|
2320
|
+
|
|
2321
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
2322
|
+
var obj;
|
|
2323
|
+
var root = chain[i];
|
|
2324
|
+
|
|
2325
|
+
if (root === '[]' && options.parseArrays) {
|
|
2326
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
2327
|
+
? []
|
|
2328
|
+
: utils.combine([], leaf);
|
|
2329
|
+
} else {
|
|
2330
|
+
obj = options.plainObjects ? { __proto__: null } : {};
|
|
2331
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
2332
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
2333
|
+
var index = parseInt(decodedRoot, 10);
|
|
2334
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
2335
|
+
obj = { 0: leaf };
|
|
2336
|
+
} else if (
|
|
2337
|
+
!isNaN(index)
|
|
2338
|
+
&& root !== decodedRoot
|
|
2339
|
+
&& String(index) === decodedRoot
|
|
2340
|
+
&& index >= 0
|
|
2341
|
+
&& (options.parseArrays && index <= options.arrayLimit)
|
|
2342
|
+
) {
|
|
2343
|
+
obj = [];
|
|
2344
|
+
obj[index] = leaf;
|
|
2345
|
+
} else if (decodedRoot !== '__proto__') {
|
|
2346
|
+
obj[decodedRoot] = leaf;
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
leaf = obj;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
return leaf;
|
|
2354
|
+
};
|
|
2355
|
+
|
|
2356
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
2357
|
+
if (!givenKey) {
|
|
2358
|
+
return;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
// Transform dot notation to bracket notation
|
|
2362
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
2363
|
+
|
|
2364
|
+
// The regex chunks
|
|
2365
|
+
|
|
2366
|
+
var brackets = /(\[[^[\]]*])/;
|
|
2367
|
+
var child = /(\[[^[\]]*])/g;
|
|
2368
|
+
|
|
2369
|
+
// Get the parent
|
|
2370
|
+
|
|
2371
|
+
var segment = options.depth > 0 && brackets.exec(key);
|
|
2372
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
2373
|
+
|
|
2374
|
+
// Stash the parent if it exists
|
|
2375
|
+
|
|
2376
|
+
var keys = [];
|
|
2377
|
+
if (parent) {
|
|
2378
|
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
2379
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
2380
|
+
if (!options.allowPrototypes) {
|
|
2381
|
+
return;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
keys.push(parent);
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
// Loop through children appending to the array until we hit depth
|
|
2389
|
+
|
|
2390
|
+
var i = 0;
|
|
2391
|
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
|
2392
|
+
i += 1;
|
|
2393
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
2394
|
+
if (!options.allowPrototypes) {
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
keys.push(segment[1]);
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
2402
|
+
|
|
2403
|
+
if (segment) {
|
|
2404
|
+
if (options.strictDepth === true) {
|
|
2405
|
+
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
2406
|
+
}
|
|
2407
|
+
keys.push('[' + key.slice(segment.index) + ']');
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
return parseObject(keys, val, options, valuesParsed);
|
|
2411
|
+
};
|
|
2412
|
+
|
|
2413
|
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
2414
|
+
if (!opts) {
|
|
2415
|
+
return defaults;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2419
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
2423
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
2427
|
+
throw new TypeError('Decoder has to be a function.');
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2431
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
|
|
2435
|
+
throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
2439
|
+
|
|
2440
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
2441
|
+
|
|
2442
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
2443
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
2447
|
+
|
|
2448
|
+
return {
|
|
2449
|
+
allowDots: allowDots,
|
|
2450
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
2451
|
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2452
|
+
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
2453
|
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
2454
|
+
charset: charset,
|
|
2455
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2456
|
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
2457
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
2458
|
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
2459
|
+
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2460
|
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2461
|
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
2462
|
+
duplicates: duplicates,
|
|
2463
|
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2464
|
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2465
|
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
2466
|
+
parseArrays: opts.parseArrays !== false,
|
|
2467
|
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
2468
|
+
strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
|
|
2469
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
2470
|
+
throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
|
|
2471
|
+
};
|
|
2472
|
+
};
|
|
2473
|
+
|
|
2474
|
+
var parse = function (str, opts) {
|
|
2475
|
+
var options = normalizeParseOptions(opts);
|
|
2476
|
+
|
|
2477
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
|
2478
|
+
return options.plainObjects ? { __proto__: null } : {};
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
2482
|
+
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
2483
|
+
|
|
2484
|
+
// Iterate over the keys and setup the new object
|
|
2485
|
+
|
|
2486
|
+
var keys = Object.keys(tempObj);
|
|
2487
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
2488
|
+
var key = keys[i];
|
|
2489
|
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
|
2490
|
+
obj = utils.merge(obj, newObj, options);
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
if (options.allowSparse === true) {
|
|
2494
|
+
return obj;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
return utils.compact(obj);
|
|
2498
|
+
};
|
|
2499
|
+
|
|
2500
|
+
var lib = {
|
|
2501
|
+
formats: formats,
|
|
2502
|
+
parse: parse,
|
|
2503
|
+
stringify: stringify_1
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
2507
|
+
var t = {};
|
|
2508
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2509
|
+
t[p] = s[p];
|
|
2510
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2511
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2512
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2513
|
+
t[p[i]] = s[p[i]];
|
|
2514
|
+
}
|
|
2515
|
+
return t;
|
|
2516
|
+
};
|
|
2517
|
+
const limit = 200;
|
|
2518
|
+
const fetchColorsQuery = (filters) => {
|
|
2519
|
+
const { sortByHex } = filters, restFilters = __rest(filters, ["sortByHex"]);
|
|
2520
|
+
return lib.stringify({
|
|
2521
|
+
fields: ['*', 'Products.*', 'Samples.*'].join(','),
|
|
2522
|
+
filter: {
|
|
2523
|
+
_and: [
|
|
2524
|
+
...(restFilters.id ? [{ Products: { Product_id: { _eq: restFilters.id } } }] : []),
|
|
2525
|
+
...(restFilters.sampleId ? [{ Samples: { Sample_id: { _eq: restFilters.sampleId } } }] : []),
|
|
2526
|
+
...(restFilters.colorNumber ? [{ number: { _contains: restFilters.colorNumber } }] : []),
|
|
2527
|
+
...(restFilters.colorName ? [{ name: { _icontains: restFilters.colorName } }] : []),
|
|
2528
|
+
...(restFilters.colorFamily ? [{ colorFamily: { _eq: restFilters.colorFamily } }] : []),
|
|
2529
|
+
],
|
|
2530
|
+
},
|
|
2531
|
+
sort: sortByHex === 'desc' ? '-hex' : sortByHex === 'asc' ? 'hex' : undefined,
|
|
2532
|
+
meta: '*',
|
|
2533
|
+
page: restFilters.page !== undefined ? restFilters.page : 1,
|
|
2534
|
+
limit: restFilters.colorName ? 200 : limit,
|
|
2535
|
+
}, { encodeValuesOnly: true });
|
|
2536
|
+
};
|
|
2537
|
+
const fetchColors = async (filters) => {
|
|
2538
|
+
try {
|
|
2539
|
+
const query = fetchColorsQuery(Object.assign(Object.assign({}, filters), { sortByHex: 'desc' }));
|
|
2540
|
+
const response = await ApiService.getData(`items/Color?${query}`);
|
|
2541
|
+
return (response === null || response === void 0 ? void 0 : response.data) || [];
|
|
2542
|
+
}
|
|
2543
|
+
catch (error) {
|
|
2544
|
+
console.error('Error fetching colors:', error);
|
|
2545
|
+
return [];
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
const fetchSamplesColors = async (filters) => {
|
|
2549
|
+
try {
|
|
2550
|
+
const response = await ApiService.getData(`items/Sample?${fetchColorsQuery(Object.assign({}, filters))}`);
|
|
2551
|
+
return (response === null || response === void 0 ? void 0 : response.data) || [];
|
|
2552
|
+
}
|
|
2553
|
+
catch (error) {
|
|
2554
|
+
console.error('Error fetching samples colors:', error);
|
|
2555
|
+
return [];
|
|
2556
|
+
}
|
|
2557
|
+
};
|
|
2558
|
+
const fetchProductData = async (filters) => {
|
|
2559
|
+
var _a, _b;
|
|
2560
|
+
try {
|
|
2561
|
+
// Fetch shop details
|
|
2562
|
+
const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${filters.shopName}`);
|
|
2563
|
+
const shop = (_a = shopResponse === null || shopResponse === void 0 ? void 0 : shopResponse.data) === null || _a === void 0 ? void 0 : _a[0];
|
|
2564
|
+
if (!(shop === null || shop === void 0 ? void 0 : shop.id)) {
|
|
2565
|
+
console.error('Shop not found');
|
|
2566
|
+
return null;
|
|
2567
|
+
}
|
|
2568
|
+
// Fetch product details
|
|
2569
|
+
const response = await ApiService.getData(`items/Product?filter[name][_eq]=${filters.productName}&fields=*,images.*,Shop.*,Category.*.*.*.*`);
|
|
2570
|
+
const product = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b[0];
|
|
2571
|
+
// fetch product samples
|
|
2572
|
+
const productSamples = await fetchSamplesColors({ id: product.id, page: 0 });
|
|
2573
|
+
if (product && product.Shop.some((s) => s.Shop_id === shop.id)) {
|
|
2574
|
+
return Object.assign(Object.assign({}, product), { id: product.id, productSamples });
|
|
2575
|
+
}
|
|
2576
|
+
console.error('Product not found or does not belong to the shop');
|
|
2577
|
+
return null;
|
|
2578
|
+
}
|
|
2579
|
+
catch (error) {
|
|
2580
|
+
console.error('Error fetching product data:', error);
|
|
2581
|
+
return null;
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2584
|
+
const fetchColorFamilies = async () => {
|
|
2585
|
+
var _a, _b, _c;
|
|
2586
|
+
try {
|
|
2587
|
+
const response = await ApiService.getData(`fields/Color/colorFamily`);
|
|
2588
|
+
return ((_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.choices) || [];
|
|
2589
|
+
}
|
|
2590
|
+
catch (error) {
|
|
2591
|
+
console.error('Error fetching color families:', error);
|
|
2592
|
+
return [];
|
|
2593
|
+
}
|
|
2594
|
+
};
|
|
2595
|
+
const updateFilters = (filters, newFilter) => {
|
|
2596
|
+
return Object.assign(Object.assign({}, filters), newFilter);
|
|
2597
|
+
};
|
|
2598
|
+
|
|
2599
|
+
const indexCss = "@import url(\"https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap\"); .tinting-wrapper *{font-family:\"Poppins\", sans-serif}.my-modal__header{display:flex;justify-content:flex-start;flex-direction:column;margin-bottom:16px}@media (max-width: 905px){.my-modal__header{overflow-x:auto}}@media (max-width: 1024px){.my-modal__header{flex-direction:column;margin-bottom:12px;align-items:center;display:block}}.my-modal__header .image-wrapper{display:flex;margin-bottom:17px}@media (max-width: 768px){.my-modal__header .image-wrapper{margin-bottom:12px}}.my-modal__header .image-wrapper .modal-header__logo{max-width:400px;position:relative;max-height:130px;cursor:pointer}.my-modal__header .image-wrapper .modal-header__logo img{width:100%;height:100%;object-fit:cover}@media (max-width: 768px){.my-modal__header .image-wrapper .modal-header__logo{max-width:200px}}.my-modal__header .my-modal__see-more{margin-bottom:16px;text-align:left}.my-modal__header .search-wrapper{display:flex;align-items:center;justify-content:space-between;align-items:flex-end;gap:55px;align-items:center}@media (max-width: 1024px){.my-modal__header .search-wrapper{justify-content:center;width:92%;margin:0 auto;gap:21px}}@media (max-width: 768px){.my-modal__header .search-wrapper{flex-wrap:wrap}}.my-modal__header .search-wrapper .color-families{display:flex;gap:5px;flex-wrap:wrap;max-width:100%;overflow-x:auto;padding-bottom:5px;scrollbar-width:thin;scrollbar-color:#aaa transparent;flex-wrap:wrap}.my-modal__header .search-wrapper .color-families::-webkit-scrollbar{height:6px}.my-modal__header .search-wrapper .color-families::-webkit-scrollbar-thumb{background-color:#aaa;border-radius:3px}@media (max-width: 1024px){.my-modal__header .search-wrapper .color-families{flex-wrap:nowrap}}.my-modal__header .search-wrapper .color-families .color-family{flex:0 0 auto;width:125px;height:125px;display:flex;align-items:center;justify-content:center;color:#fff;position:relative;cursor:pointer;transition:transform 0.2s ease, box-shadow 0.2s ease}.my-modal__header .search-wrapper .color-families .color-family:hover{transform:scale(0.93);box-shadow:0 8px 16px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1)}.my-modal__header .search-wrapper .color-families .color-family.active{transform:scale(0.93);box-shadow:0 8px 16px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1)}@media (max-width: 1024px){.my-modal__header .search-wrapper .color-families .color-family{width:90px;height:90px;font-size:12px}}.my-modal__header .search-wrapper .color-families .color-family div{width:100%;height:100%;cursor:pointer;font-size:15px;z-index:-1;opacity:65%;position:absolute}.my-modal__header .search-wrapper .search-container{display:flex;align-items:baseline}.my-modal__header .search-wrapper .search-container .filters{display:flex;flex-direction:column;gap:10px}@media (max-width: 1024px){.my-modal__header .search-wrapper .search-container .filters{width:100%}}@media (max-width: 1024px){.my-modal__header .search-wrapper .search-container{width:100%}}@media (max-width: 1024px){.my-modal__header .search-wrapper .sc-my-search-h{width:100%;margin:0 auto}}.my-modal__header .search-wrapper .my-modal__close{position:absolute;top:50px;right:20px;background:transparent;border:none;margin-top:-20px}.my-modal__header .search-wrapper .my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__header .search-wrapper .my-modal__close{margin-top:0px;position:absolute;right:10px;top:10px}}";
|
|
2600
|
+
|
|
2601
|
+
const ModalHeader = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
2602
|
+
constructor() {
|
|
2603
|
+
super();
|
|
2604
|
+
this.__registerHost();
|
|
2605
|
+
this.sampleSelected = createEvent(this, "sampleSelected", 7);
|
|
2606
|
+
this.colorFamilySelected = createEvent(this, "colorFamilySelected", 7);
|
|
2607
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
2608
|
+
this.onLogoClick = createEvent(this, "onLogoClick", 7);
|
|
2609
|
+
this.onResetCategory = createEvent(this, "onResetCategory", 7);
|
|
2610
|
+
this.handleClose = () => {
|
|
2611
|
+
this.closeModal.emit();
|
|
2612
|
+
};
|
|
2613
|
+
this.handleLogoClick = () => {
|
|
2614
|
+
this.onLogoClick.emit();
|
|
2615
|
+
};
|
|
2616
|
+
this.handleReset = () => {
|
|
2617
|
+
this.onResetCategory.emit();
|
|
2618
|
+
};
|
|
2619
|
+
this.modalName = undefined;
|
|
2620
|
+
this.modalLogo = undefined;
|
|
2621
|
+
this.modalDescription = undefined;
|
|
2622
|
+
this.selectedColorFamily = undefined;
|
|
2623
|
+
this.shop = undefined;
|
|
2624
|
+
this.productName = undefined;
|
|
2625
|
+
this.isMobile = undefined;
|
|
2626
|
+
this.closeImage = 'close.png';
|
|
2627
|
+
this.productSamples = [];
|
|
2628
|
+
this.colorFamilies = [];
|
|
2629
|
+
}
|
|
2630
|
+
handleSampleSelect(event) {
|
|
2631
|
+
this.sampleSelected.emit(event.detail);
|
|
2632
|
+
}
|
|
2633
|
+
sortColorFamiliesByHex(families) {
|
|
2634
|
+
return [...families].sort((a, b) => {
|
|
2635
|
+
// Convert hex to RGB for proper color sorting
|
|
2636
|
+
const hexToRgb = (hex) => {
|
|
2637
|
+
const r = parseInt(hex.substring(1, 3), 16);
|
|
2638
|
+
const g = parseInt(hex.substring(3, 5), 16);
|
|
2639
|
+
const b = parseInt(hex.substring(5, 7), 16);
|
|
2640
|
+
return r * 0.299 + g * 0.587 + b * 0.114; // Convert to grayscale for sorting
|
|
2641
|
+
};
|
|
2642
|
+
return hexToRgb(a.color) - hexToRgb(b.color);
|
|
2643
|
+
});
|
|
2644
|
+
}
|
|
2645
|
+
async fetchColorFamilies() {
|
|
2646
|
+
try {
|
|
2647
|
+
const request = await fetchColorFamilies();
|
|
2648
|
+
this.colorFamilies = this.sortColorFamiliesByHex(request);
|
|
2649
|
+
}
|
|
2650
|
+
catch (error) {
|
|
2651
|
+
console.error('Error fetching color families:', error);
|
|
2652
|
+
this.colorFamilies = [];
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* Adjusts the brightness of a hexadecimal color
|
|
2657
|
+
* @param hex The hexadecimal color code
|
|
2658
|
+
* @param percent The percentage to adjust brightness by
|
|
2659
|
+
* @returns RGB color string
|
|
2660
|
+
*/
|
|
2661
|
+
adjustBrightness(hex, percent) {
|
|
2662
|
+
let r = parseInt(hex.substring(1, 3), 16);
|
|
2663
|
+
let g = parseInt(hex.substring(3, 5), 16);
|
|
2664
|
+
let b = parseInt(hex.substring(5, 7), 16);
|
|
2665
|
+
r = Math.min(255, Math.max(0, r + r * percent));
|
|
2666
|
+
g = Math.min(255, Math.max(0, g + g * percent));
|
|
2667
|
+
b = Math.min(255, Math.max(0, b + b * percent));
|
|
2668
|
+
return `rgb(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)})`;
|
|
2669
|
+
}
|
|
2670
|
+
getGradientFromHex(hex) {
|
|
2671
|
+
const lighter = this.adjustBrightness(hex, 0.6); // 30% lighter
|
|
2672
|
+
const darker = this.adjustBrightness(hex, -0.6); // 30% darker
|
|
2673
|
+
return `linear-gradient(270deg, ${lighter} 0%, ${darker} 100%)`;
|
|
2674
|
+
}
|
|
2675
|
+
selectColorFamily(colorFamily) {
|
|
2676
|
+
// Toggle selection: if clicking the same color family, deselect it
|
|
2677
|
+
this.selectedColorFamily = this.selectedColorFamily === colorFamily ? null : colorFamily;
|
|
2678
|
+
this.colorFamilySelected.emit(colorFamily);
|
|
2679
|
+
}
|
|
2680
|
+
componentWillLoad() {
|
|
2681
|
+
this.fetchColorFamilies();
|
|
2682
|
+
}
|
|
2683
|
+
render() {
|
|
2684
|
+
return (h("div", { class: "my-modal__header" }, h("div", { class: "image-wrapper" }, this.modalLogo && (h("div", { class: "modal-header__logo", onClick: this.handleLogoClick }, h("img", { src: this.modalLogo, alt: "modal-logo" })))), this.modalName && h("p", { class: "my-modal__see-more big" }, this.modalName), this.modalDescription && h("p", { class: "my-modal__see-more" }, this.modalDescription), h("div", { class: "search-wrapper" }, h("div", { class: "color-families" }, this.colorFamilies.map(family => (h("div", { class: `color-family ${this.selectedColorFamily === family.value ? 'active' : ''}`, onClick: () => this.selectColorFamily(family.value) }, h("div", { style: { backgroundImage: this.getGradientFromHex(family.color) } }), family.text)))), h("div", { class: "search-container" }, h("div", { class: "filters" }, h("my-search", { shopname: this.shop, productname: this.productName, isMobile: this.isMobile }), h("my-select", { onOnReset: () => this.handleReset(), onSelectValue: event => this.handleSampleSelect(event), options: this.productSamples, placeholder: "Wybierz wzornik" }), ' '), h("button", { class: "my-modal__close", onClick: this.handleClose }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))))));
|
|
2685
|
+
}
|
|
2686
|
+
static get assetsDirs() { return ["assets"]; }
|
|
2687
|
+
static get style() { return indexCss; }
|
|
2688
|
+
}, [0, "modal-header", {
|
|
2689
|
+
"modalName": [1, "modal-name"],
|
|
2690
|
+
"modalLogo": [1, "modal-logo"],
|
|
2691
|
+
"modalDescription": [1, "modal-description"],
|
|
2692
|
+
"selectedColorFamily": [1, "selected-color-family"],
|
|
2693
|
+
"shop": [1],
|
|
2694
|
+
"productName": [1, "product-name"],
|
|
2695
|
+
"isMobile": [4, "is-mobile"],
|
|
2696
|
+
"closeImage": [1, "close-image"],
|
|
2697
|
+
"productSamples": [16],
|
|
2698
|
+
"colorFamilies": [32]
|
|
2699
|
+
}]);
|
|
2700
|
+
function defineCustomElement() {
|
|
2701
|
+
if (typeof customElements === "undefined") {
|
|
2702
|
+
return;
|
|
2703
|
+
}
|
|
2704
|
+
const components = ["modal-header", "my-search", "my-select"];
|
|
2705
|
+
components.forEach(tagName => { switch (tagName) {
|
|
2706
|
+
case "modal-header":
|
|
2707
|
+
if (!customElements.get(tagName)) {
|
|
2708
|
+
customElements.define(tagName, ModalHeader);
|
|
2709
|
+
}
|
|
2710
|
+
break;
|
|
2711
|
+
case "my-search":
|
|
2712
|
+
if (!customElements.get(tagName)) {
|
|
2713
|
+
defineCustomElement$2();
|
|
2714
|
+
}
|
|
2715
|
+
break;
|
|
2716
|
+
case "my-select":
|
|
2717
|
+
if (!customElements.get(tagName)) {
|
|
2718
|
+
defineCustomElement$1();
|
|
2719
|
+
}
|
|
2720
|
+
break;
|
|
2721
|
+
} });
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
export { ModalHeader as M, fetchProductData as a, defineCustomElement as d, fetchColors as f, limit as l, updateFilters as u };
|
|
2725
|
+
|
|
2726
|
+
//# sourceMappingURL=index2.js.map
|