@ppg_pl/pallete 0.0.7 → 2.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/README.md +9 -1
- package/dist/cjs/{index-160fcb6c.js → index-53e78fc8.js} +3 -1
- package/dist/cjs/index-53e78fc8.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/my-backdrop_8.cjs.entry.js +503 -253
- package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
- package/dist/cjs/pallete.cjs.js +2 -2
- package/dist/collection/components/api/index.js +4 -2
- package/dist/collection/components/api/index.js.map +1 -1
- package/dist/collection/components/api/services.js +31 -64
- package/dist/collection/components/api/services.js.map +1 -1
- package/dist/collection/components/my-colorinfo/my-colorinfo.js +6 -4
- package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
- package/dist/collection/components/my-loader/my-loader.css +1 -1
- package/dist/collection/components/my-modal/my-modal.js +65 -47
- package/dist/collection/components/my-modal/my-modal.js.map +1 -1
- package/dist/collection/components/my-search/my-search.js +28 -2
- package/dist/collection/components/my-search/my-search.js.map +1 -1
- package/dist/collection/components/my-slider/index.js +5 -8
- package/dist/collection/components/my-slider/index.js.map +1 -1
- package/dist/collection/types.js.map +1 -1
- package/dist/components/index2.js +25 -3
- package/dist/components/index2.js.map +1 -1
- package/dist/components/my-colorinfo2.js +4 -3
- package/dist/components/my-colorinfo2.js.map +1 -1
- package/dist/components/my-loader2.js +1 -1
- package/dist/components/my-loader2.js.map +1 -1
- package/dist/components/my-modal2.js +458 -248
- package/dist/components/my-modal2.js.map +1 -1
- package/dist/components/my-search2.js +20 -3
- package/dist/components/my-search2.js.map +1 -1
- package/dist/esm/{index-943c259f.js → index-b0145abf.js} +3 -1
- package/dist/esm/index-b0145abf.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/my-backdrop_8.entry.js +503 -253
- package/dist/esm/my-backdrop_8.entry.js.map +1 -1
- package/dist/esm/pallete.js +3 -3
- package/dist/pallete/p-037cfde2.entry.js +2 -0
- package/dist/pallete/p-037cfde2.entry.js.map +1 -0
- package/dist/pallete/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
- package/dist/pallete/p-c6a049a2.js.map +1 -0
- package/dist/pallete/pallete.esm.js +1 -1
- package/dist/pallete/pallete.esm.js.map +1 -1
- package/dist/types/components/api/index.d.ts +2 -1
- package/dist/types/components/api/services.d.ts +3 -3
- package/dist/types/components/my-modal/my-modal.d.ts +1 -0
- package/dist/types/components/my-search/my-search.d.ts +2 -0
- package/dist/types/components/my-slider/index.d.ts +2 -2
- package/dist/types/components.d.ts +5 -4
- package/dist/types/types.d.ts +35 -24
- package/package.json +4 -3
- package/www/build/p-037cfde2.entry.js +2 -0
- package/www/build/p-037cfde2.entry.js.map +1 -0
- package/www/build/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
- package/www/build/p-c6a049a2.js.map +1 -0
- package/www/build/pallete.esm.js +1 -1
- package/www/build/pallete.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/index-160fcb6c.js.map +0 -1
- package/dist/esm/index-943c259f.js.map +0 -1
- package/dist/pallete/p-c77aaa54.js.map +0 -1
- package/dist/pallete/p-deffcd80.entry.js +0 -2
- package/dist/pallete/p-deffcd80.entry.js.map +0 -1
- package/www/build/p-825a7d1d.js +0 -163
- package/www/build/p-c77aaa54.js.map +0 -1
- package/www/build/p-deffcd80.entry.js +0 -2
- package/www/build/p-deffcd80.entry.js.map +0 -1
- package/www/build/p-fd390eef.css +0 -3
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h, getAssetPath } from '@stencil/core/internal/client';
|
|
2
|
+
import { b as ApiService, A as APIURL, a as accessToken, d as defineCustomElement$1 } from './index2.js';
|
|
2
3
|
import { s as setDataLayer } from './gtmUtils.js';
|
|
3
4
|
import { d as defineCustomElement$5 } from './my-colorbox2.js';
|
|
4
5
|
import { d as defineCustomElement$4 } from './my-colorinfo2.js';
|
|
5
6
|
import { d as defineCustomElement$3 } from './my-loader2.js';
|
|
6
7
|
import { d as defineCustomElement$2 } from './my-search2.js';
|
|
7
|
-
import { d as defineCustomElement$1 } from './index2.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
/** @type {import('.')} */
|
|
10
|
+
var esErrors = Error;
|
|
11
|
+
|
|
12
|
+
/** @type {import('./eval')} */
|
|
13
|
+
var _eval = EvalError;
|
|
14
|
+
|
|
15
|
+
/** @type {import('./range')} */
|
|
16
|
+
var range = RangeError;
|
|
17
|
+
|
|
18
|
+
/** @type {import('./ref')} */
|
|
19
|
+
var ref = ReferenceError;
|
|
20
|
+
|
|
21
|
+
/** @type {import('./syntax')} */
|
|
22
|
+
var syntax = SyntaxError;
|
|
23
|
+
|
|
24
|
+
/** @type {import('./type')} */
|
|
25
|
+
var type = TypeError;
|
|
26
|
+
|
|
27
|
+
/** @type {import('./uri')} */
|
|
28
|
+
var uri = URIError;
|
|
28
29
|
|
|
29
30
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
30
31
|
var shams = function hasSymbols() {
|
|
@@ -80,55 +81,91 @@ var hasSymbols$1 = function hasNativeSymbols() {
|
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
var test = {
|
|
84
|
+
__proto__: null,
|
|
83
85
|
foo: {}
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
var $Object = Object;
|
|
87
89
|
|
|
90
|
+
/** @type {import('.')} */
|
|
88
91
|
var hasProto$1 = function hasProto() {
|
|
89
|
-
|
|
92
|
+
// @ts-expect-error: TS errors on an inherited property for some reason
|
|
93
|
+
return { __proto__: test }.foo === test.foo
|
|
94
|
+
&& !(test instanceof $Object);
|
|
90
95
|
};
|
|
91
96
|
|
|
92
97
|
/* eslint no-invalid-this: 1 */
|
|
93
98
|
|
|
94
99
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
95
|
-
var slice = Array.prototype.slice;
|
|
96
100
|
var toStr$1 = Object.prototype.toString;
|
|
101
|
+
var max = Math.max;
|
|
97
102
|
var funcType = '[object Function]';
|
|
98
103
|
|
|
104
|
+
var concatty = function concatty(a, b) {
|
|
105
|
+
var arr = [];
|
|
106
|
+
|
|
107
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
108
|
+
arr[i] = a[i];
|
|
109
|
+
}
|
|
110
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
111
|
+
arr[j + a.length] = b[j];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return arr;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var slicy = function slicy(arrLike, offset) {
|
|
118
|
+
var arr = [];
|
|
119
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
120
|
+
arr[j] = arrLike[i];
|
|
121
|
+
}
|
|
122
|
+
return arr;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var joiny = function (arr, joiner) {
|
|
126
|
+
var str = '';
|
|
127
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
128
|
+
str += arr[i];
|
|
129
|
+
if (i + 1 < arr.length) {
|
|
130
|
+
str += joiner;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return str;
|
|
134
|
+
};
|
|
135
|
+
|
|
99
136
|
var implementation = function bind(that) {
|
|
100
137
|
var target = this;
|
|
101
|
-
if (typeof target !== 'function' || toStr$1.
|
|
138
|
+
if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
|
|
102
139
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
103
140
|
}
|
|
104
|
-
var args =
|
|
141
|
+
var args = slicy(arguments, 1);
|
|
105
142
|
|
|
106
143
|
var bound;
|
|
107
144
|
var binder = function () {
|
|
108
145
|
if (this instanceof bound) {
|
|
109
146
|
var result = target.apply(
|
|
110
147
|
this,
|
|
111
|
-
args
|
|
148
|
+
concatty(args, arguments)
|
|
112
149
|
);
|
|
113
150
|
if (Object(result) === result) {
|
|
114
151
|
return result;
|
|
115
152
|
}
|
|
116
153
|
return this;
|
|
117
|
-
} else {
|
|
118
|
-
return target.apply(
|
|
119
|
-
that,
|
|
120
|
-
args.concat(slice.call(arguments))
|
|
121
|
-
);
|
|
122
154
|
}
|
|
155
|
+
return target.apply(
|
|
156
|
+
that,
|
|
157
|
+
concatty(args, arguments)
|
|
158
|
+
);
|
|
159
|
+
|
|
123
160
|
};
|
|
124
161
|
|
|
125
|
-
var boundLength =
|
|
162
|
+
var boundLength = max(0, target.length - args.length);
|
|
126
163
|
var boundArgs = [];
|
|
127
164
|
for (var i = 0; i < boundLength; i++) {
|
|
128
|
-
boundArgs
|
|
165
|
+
boundArgs[i] = '$' + i;
|
|
129
166
|
}
|
|
130
167
|
|
|
131
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
168
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
132
169
|
|
|
133
170
|
if (target.prototype) {
|
|
134
171
|
var Empty = function Empty() {};
|
|
@@ -142,13 +179,24 @@ var implementation = function bind(that) {
|
|
|
142
179
|
|
|
143
180
|
var functionBind = Function.prototype.bind || implementation;
|
|
144
181
|
|
|
145
|
-
var
|
|
182
|
+
var call = Function.prototype.call;
|
|
183
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
/** @type {import('.')} */
|
|
187
|
+
var hasown = functionBind.call(call, $hasOwn);
|
|
146
188
|
|
|
147
189
|
var undefined$1;
|
|
148
190
|
|
|
149
|
-
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
150
199
|
var $Function = Function;
|
|
151
|
-
var $TypeError$1 = TypeError;
|
|
152
200
|
|
|
153
201
|
// eslint-disable-next-line consistent-return
|
|
154
202
|
var getEvalledConstructor = function (expressionSyntax) {
|
|
@@ -157,19 +205,19 @@ var getEvalledConstructor = function (expressionSyntax) {
|
|
|
157
205
|
} catch (e) {}
|
|
158
206
|
};
|
|
159
207
|
|
|
160
|
-
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
208
|
+
var $gOPD$1 = Object.getOwnPropertyDescriptor;
|
|
161
209
|
|
|
162
210
|
var throwTypeError = function () {
|
|
163
|
-
throw new
|
|
211
|
+
throw new type();
|
|
164
212
|
};
|
|
165
|
-
var ThrowTypeError = $gOPD
|
|
213
|
+
var ThrowTypeError = $gOPD$1
|
|
166
214
|
? (function () {
|
|
167
215
|
try {
|
|
168
216
|
return throwTypeError;
|
|
169
217
|
} catch (calleeThrows) {
|
|
170
218
|
try {
|
|
171
219
|
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
172
|
-
return $gOPD(arguments, 'callee').get;
|
|
220
|
+
return $gOPD$1(arguments, 'callee').get;
|
|
173
221
|
} catch (gOPDthrows) {
|
|
174
222
|
return throwTypeError;
|
|
175
223
|
}
|
|
@@ -191,6 +239,7 @@ var needsEval = {};
|
|
|
191
239
|
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
192
240
|
|
|
193
241
|
var INTRINSICS = {
|
|
242
|
+
__proto__: null,
|
|
194
243
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
195
244
|
'%Array%': Array,
|
|
196
245
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
@@ -211,9 +260,9 @@ var INTRINSICS = {
|
|
|
211
260
|
'%decodeURIComponent%': decodeURIComponent,
|
|
212
261
|
'%encodeURI%': encodeURI,
|
|
213
262
|
'%encodeURIComponent%': encodeURIComponent,
|
|
214
|
-
'%Error%':
|
|
263
|
+
'%Error%': esErrors,
|
|
215
264
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
216
|
-
'%EvalError%':
|
|
265
|
+
'%EvalError%': _eval,
|
|
217
266
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
218
267
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
219
268
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
@@ -235,8 +284,8 @@ var INTRINSICS = {
|
|
|
235
284
|
'%parseInt%': parseInt,
|
|
236
285
|
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
237
286
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
238
|
-
'%RangeError%':
|
|
239
|
-
'%ReferenceError%':
|
|
287
|
+
'%RangeError%': range,
|
|
288
|
+
'%ReferenceError%': ref,
|
|
240
289
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
241
290
|
'%RegExp%': RegExp,
|
|
242
291
|
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
@@ -245,15 +294,15 @@ var INTRINSICS = {
|
|
|
245
294
|
'%String%': String,
|
|
246
295
|
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
247
296
|
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
248
|
-
'%SyntaxError%':
|
|
297
|
+
'%SyntaxError%': syntax,
|
|
249
298
|
'%ThrowTypeError%': ThrowTypeError,
|
|
250
299
|
'%TypedArray%': TypedArray,
|
|
251
|
-
'%TypeError%':
|
|
300
|
+
'%TypeError%': type,
|
|
252
301
|
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
253
302
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
254
303
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
255
304
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
256
|
-
'%URIError%':
|
|
305
|
+
'%URIError%': uri,
|
|
257
306
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
258
307
|
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
259
308
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
@@ -285,6 +334,7 @@ var doEval = function doEval(name) {
|
|
|
285
334
|
};
|
|
286
335
|
|
|
287
336
|
var LEGACY_ALIASES = {
|
|
337
|
+
__proto__: null,
|
|
288
338
|
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
289
339
|
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
290
340
|
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
@@ -353,9 +403,9 @@ var stringToPath = function stringToPath(string) {
|
|
|
353
403
|
var first = $strSlice(string, 0, 1);
|
|
354
404
|
var last = $strSlice(string, -1);
|
|
355
405
|
if (first === '%' && last !== '%') {
|
|
356
|
-
throw new
|
|
406
|
+
throw new syntax('invalid intrinsic syntax, expected closing `%`');
|
|
357
407
|
} else if (last === '%' && first !== '%') {
|
|
358
|
-
throw new
|
|
408
|
+
throw new syntax('invalid intrinsic syntax, expected opening `%`');
|
|
359
409
|
}
|
|
360
410
|
var result = [];
|
|
361
411
|
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
@@ -368,18 +418,18 @@ var stringToPath = function stringToPath(string) {
|
|
|
368
418
|
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
369
419
|
var intrinsicName = name;
|
|
370
420
|
var alias;
|
|
371
|
-
if (
|
|
421
|
+
if (hasown(LEGACY_ALIASES, intrinsicName)) {
|
|
372
422
|
alias = LEGACY_ALIASES[intrinsicName];
|
|
373
423
|
intrinsicName = '%' + alias[0] + '%';
|
|
374
424
|
}
|
|
375
425
|
|
|
376
|
-
if (
|
|
426
|
+
if (hasown(INTRINSICS, intrinsicName)) {
|
|
377
427
|
var value = INTRINSICS[intrinsicName];
|
|
378
428
|
if (value === needsEval) {
|
|
379
429
|
value = doEval(intrinsicName);
|
|
380
430
|
}
|
|
381
431
|
if (typeof value === 'undefined' && !allowMissing) {
|
|
382
|
-
throw new
|
|
432
|
+
throw new type('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
383
433
|
}
|
|
384
434
|
|
|
385
435
|
return {
|
|
@@ -389,19 +439,19 @@ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
|
389
439
|
};
|
|
390
440
|
}
|
|
391
441
|
|
|
392
|
-
throw new
|
|
442
|
+
throw new syntax('intrinsic ' + name + ' does not exist!');
|
|
393
443
|
};
|
|
394
444
|
|
|
395
445
|
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
396
446
|
if (typeof name !== 'string' || name.length === 0) {
|
|
397
|
-
throw new
|
|
447
|
+
throw new type('intrinsic name must be a non-empty string');
|
|
398
448
|
}
|
|
399
449
|
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
400
|
-
throw new
|
|
450
|
+
throw new type('"allowMissing" argument must be a boolean');
|
|
401
451
|
}
|
|
402
452
|
|
|
403
453
|
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
404
|
-
throw new
|
|
454
|
+
throw new syntax('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
405
455
|
}
|
|
406
456
|
var parts = stringToPath(name);
|
|
407
457
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
@@ -428,7 +478,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
428
478
|
)
|
|
429
479
|
&& first !== last
|
|
430
480
|
) {
|
|
431
|
-
throw new
|
|
481
|
+
throw new syntax('property names with quotes must have matching quotes');
|
|
432
482
|
}
|
|
433
483
|
if (part === 'constructor' || !isOwn) {
|
|
434
484
|
skipFurtherCaching = true;
|
|
@@ -437,17 +487,17 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
437
487
|
intrinsicBaseName += '.' + part;
|
|
438
488
|
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
439
489
|
|
|
440
|
-
if (
|
|
490
|
+
if (hasown(INTRINSICS, intrinsicRealName)) {
|
|
441
491
|
value = INTRINSICS[intrinsicRealName];
|
|
442
492
|
} else if (value != null) {
|
|
443
493
|
if (!(part in value)) {
|
|
444
494
|
if (!allowMissing) {
|
|
445
|
-
throw new
|
|
495
|
+
throw new type('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
446
496
|
}
|
|
447
497
|
return void undefined$1;
|
|
448
498
|
}
|
|
449
|
-
if ($gOPD && (i + 1) >= parts.length) {
|
|
450
|
-
var desc = $gOPD(value, part);
|
|
499
|
+
if ($gOPD$1 && (i + 1) >= parts.length) {
|
|
500
|
+
var desc = $gOPD$1(value, part);
|
|
451
501
|
isOwn = !!desc;
|
|
452
502
|
|
|
453
503
|
// By convention, when a data property is converted to an accessor
|
|
@@ -463,7 +513,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
463
513
|
value = value[part];
|
|
464
514
|
}
|
|
465
515
|
} else {
|
|
466
|
-
isOwn =
|
|
516
|
+
isOwn = hasown(value, part);
|
|
467
517
|
value = value[part];
|
|
468
518
|
}
|
|
469
519
|
|
|
@@ -475,6 +525,8 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
475
525
|
return value;
|
|
476
526
|
};
|
|
477
527
|
|
|
528
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
529
|
+
|
|
478
530
|
function createCommonjsModule(fn, basedir, module) {
|
|
479
531
|
return module = {
|
|
480
532
|
path: basedir,
|
|
@@ -504,50 +556,170 @@ function commonjsRequire () {
|
|
|
504
556
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
505
557
|
}
|
|
506
558
|
|
|
559
|
+
/** @type {import('.')} */
|
|
560
|
+
var $defineProperty = getIntrinsic('%Object.defineProperty%', true) || false;
|
|
561
|
+
if ($defineProperty) {
|
|
562
|
+
try {
|
|
563
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
564
|
+
} catch (e) {
|
|
565
|
+
// IE 8 has a broken defineProperty
|
|
566
|
+
$defineProperty = false;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
var esDefineProperty = $defineProperty;
|
|
571
|
+
|
|
572
|
+
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
573
|
+
|
|
574
|
+
if ($gOPD) {
|
|
575
|
+
try {
|
|
576
|
+
$gOPD([], 'length');
|
|
577
|
+
} catch (e) {
|
|
578
|
+
// IE 8 has a broken gOPD
|
|
579
|
+
$gOPD = null;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
var gopd = $gOPD;
|
|
584
|
+
|
|
585
|
+
/** @type {import('.')} */
|
|
586
|
+
var defineDataProperty = function defineDataProperty(
|
|
587
|
+
obj,
|
|
588
|
+
property,
|
|
589
|
+
value
|
|
590
|
+
) {
|
|
591
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
592
|
+
throw new type('`obj` must be an object or a function`');
|
|
593
|
+
}
|
|
594
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
595
|
+
throw new type('`property` must be a string or a symbol`');
|
|
596
|
+
}
|
|
597
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
598
|
+
throw new type('`nonEnumerable`, if provided, must be a boolean or null');
|
|
599
|
+
}
|
|
600
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
601
|
+
throw new type('`nonWritable`, if provided, must be a boolean or null');
|
|
602
|
+
}
|
|
603
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
604
|
+
throw new type('`nonConfigurable`, if provided, must be a boolean or null');
|
|
605
|
+
}
|
|
606
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
607
|
+
throw new type('`loose`, if provided, must be a boolean');
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
611
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
612
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
613
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
614
|
+
|
|
615
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
616
|
+
var desc = !!gopd && gopd(obj, property);
|
|
617
|
+
|
|
618
|
+
if (esDefineProperty) {
|
|
619
|
+
esDefineProperty(obj, property, {
|
|
620
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
621
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
622
|
+
value: value,
|
|
623
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
624
|
+
});
|
|
625
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
626
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
627
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
628
|
+
} else {
|
|
629
|
+
throw new syntax('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
634
|
+
return !!esDefineProperty;
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
638
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
639
|
+
if (!esDefineProperty) {
|
|
640
|
+
return null;
|
|
641
|
+
}
|
|
642
|
+
try {
|
|
643
|
+
return esDefineProperty([], 'length', { value: 1 }).length !== 1;
|
|
644
|
+
} catch (e) {
|
|
645
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
646
|
+
return true;
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
var hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
651
|
+
|
|
652
|
+
var hasDescriptors = hasPropertyDescriptors_1();
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
var $floor$1 = getIntrinsic('%Math.floor%');
|
|
657
|
+
|
|
658
|
+
/** @type {import('.')} */
|
|
659
|
+
var setFunctionLength = function setFunctionLength(fn, length) {
|
|
660
|
+
if (typeof fn !== 'function') {
|
|
661
|
+
throw new type('`fn` is not a function');
|
|
662
|
+
}
|
|
663
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
|
|
664
|
+
throw new type('`length` must be a positive 32-bit integer');
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
668
|
+
|
|
669
|
+
var functionLengthIsConfigurable = true;
|
|
670
|
+
var functionLengthIsWritable = true;
|
|
671
|
+
if ('length' in fn && gopd) {
|
|
672
|
+
var desc = gopd(fn, 'length');
|
|
673
|
+
if (desc && !desc.configurable) {
|
|
674
|
+
functionLengthIsConfigurable = false;
|
|
675
|
+
}
|
|
676
|
+
if (desc && !desc.writable) {
|
|
677
|
+
functionLengthIsWritable = false;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
682
|
+
if (hasDescriptors) {
|
|
683
|
+
defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
684
|
+
} else {
|
|
685
|
+
defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return fn;
|
|
689
|
+
};
|
|
690
|
+
|
|
507
691
|
var callBind = createCommonjsModule(function (module) {
|
|
508
692
|
|
|
509
693
|
|
|
510
694
|
|
|
511
695
|
|
|
696
|
+
|
|
697
|
+
|
|
512
698
|
var $apply = getIntrinsic('%Function.prototype.apply%');
|
|
513
699
|
var $call = getIntrinsic('%Function.prototype.call%');
|
|
514
700
|
var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
|
|
515
701
|
|
|
516
|
-
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
517
|
-
var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
|
|
518
|
-
var $max = getIntrinsic('%Math.max%');
|
|
519
702
|
|
|
520
|
-
|
|
521
|
-
try {
|
|
522
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
523
|
-
} catch (e) {
|
|
524
|
-
// IE 8 has a broken defineProperty
|
|
525
|
-
$defineProperty = null;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
703
|
+
var $max = getIntrinsic('%Math.max%');
|
|
528
704
|
|
|
529
705
|
module.exports = function callBind(originalFunction) {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
var desc = $gOPD(func, 'length');
|
|
533
|
-
if (desc.configurable) {
|
|
534
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
535
|
-
$defineProperty(
|
|
536
|
-
func,
|
|
537
|
-
'length',
|
|
538
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
539
|
-
);
|
|
540
|
-
}
|
|
706
|
+
if (typeof originalFunction !== 'function') {
|
|
707
|
+
throw new type('a function is required');
|
|
541
708
|
}
|
|
542
|
-
|
|
709
|
+
var func = $reflectApply(functionBind, $call, arguments);
|
|
710
|
+
return setFunctionLength(
|
|
711
|
+
func,
|
|
712
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
713
|
+
true
|
|
714
|
+
);
|
|
543
715
|
};
|
|
544
716
|
|
|
545
717
|
var applyBind = function applyBind() {
|
|
546
718
|
return $reflectApply(functionBind, $apply, arguments);
|
|
547
719
|
};
|
|
548
720
|
|
|
549
|
-
if (
|
|
550
|
-
|
|
721
|
+
if (esDefineProperty) {
|
|
722
|
+
esDefineProperty(module.exports, 'apply', { value: applyBind });
|
|
551
723
|
} else {
|
|
552
724
|
module.exports.apply = applyBind;
|
|
553
725
|
}
|
|
@@ -566,8 +738,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
|
566
738
|
const _nodeResolve_empty = {};
|
|
567
739
|
|
|
568
740
|
const _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
|
|
569
|
-
|
|
570
|
-
|
|
741
|
+
__proto__: null,
|
|
742
|
+
'default': _nodeResolve_empty
|
|
571
743
|
});
|
|
572
744
|
|
|
573
745
|
const utilInspect = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
@@ -813,6 +985,14 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
813
985
|
if (isString(obj)) {
|
|
814
986
|
return markBoxed(inspect(String(obj)));
|
|
815
987
|
}
|
|
988
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
989
|
+
/* eslint-env browser */
|
|
990
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
991
|
+
return '{ [object Window] }';
|
|
992
|
+
}
|
|
993
|
+
if (obj === commonjsGlobal) {
|
|
994
|
+
return '{ [object globalThis] }';
|
|
995
|
+
}
|
|
816
996
|
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
817
997
|
var ys = arrObjKeys(obj, inspect);
|
|
818
998
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
@@ -1089,7 +1269,6 @@ function arrObjKeys(obj, inspect) {
|
|
|
1089
1269
|
return xs;
|
|
1090
1270
|
}
|
|
1091
1271
|
|
|
1092
|
-
var $TypeError = getIntrinsic('%TypeError%');
|
|
1093
1272
|
var $WeakMap = getIntrinsic('%WeakMap%', true);
|
|
1094
1273
|
var $Map = getIntrinsic('%Map%', true);
|
|
1095
1274
|
|
|
@@ -1101,53 +1280,62 @@ var $mapSet = callBound('Map.prototype.set', true);
|
|
|
1101
1280
|
var $mapHas = callBound('Map.prototype.has', true);
|
|
1102
1281
|
|
|
1103
1282
|
/*
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
* used nodes can be accessed relatively quickly.
|
|
1110
|
-
*/
|
|
1283
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
1284
|
+
*
|
|
1285
|
+
* 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. By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
1286
|
+
*/
|
|
1287
|
+
/** @type {import('.').listGetNode} */
|
|
1111
1288
|
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
1112
|
-
|
|
1289
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
1290
|
+
var prev = list;
|
|
1291
|
+
/** @type {(typeof list)['next']} */
|
|
1292
|
+
var curr;
|
|
1293
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
1113
1294
|
if (curr.key === key) {
|
|
1114
1295
|
prev.next = curr.next;
|
|
1115
|
-
|
|
1296
|
+
// eslint-disable-next-line no-extra-parens
|
|
1297
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
1116
1298
|
list.next = curr; // eslint-disable-line no-param-reassign
|
|
1117
1299
|
return curr;
|
|
1118
1300
|
}
|
|
1119
1301
|
}
|
|
1120
1302
|
};
|
|
1121
1303
|
|
|
1304
|
+
/** @type {import('.').listGet} */
|
|
1122
1305
|
var listGet = function (objects, key) {
|
|
1123
1306
|
var node = listGetNode(objects, key);
|
|
1124
1307
|
return node && node.value;
|
|
1125
1308
|
};
|
|
1309
|
+
/** @type {import('.').listSet} */
|
|
1126
1310
|
var listSet = function (objects, key, value) {
|
|
1127
1311
|
var node = listGetNode(objects, key);
|
|
1128
1312
|
if (node) {
|
|
1129
1313
|
node.value = value;
|
|
1130
1314
|
} else {
|
|
1131
1315
|
// Prepend the new node to the beginning of the list
|
|
1132
|
-
objects.next = { // eslint-disable-line no-param-reassign
|
|
1316
|
+
objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
1133
1317
|
key: key,
|
|
1134
1318
|
next: objects.next,
|
|
1135
1319
|
value: value
|
|
1136
|
-
};
|
|
1320
|
+
});
|
|
1137
1321
|
}
|
|
1138
1322
|
};
|
|
1323
|
+
/** @type {import('.').listHas} */
|
|
1139
1324
|
var listHas = function (objects, key) {
|
|
1140
1325
|
return !!listGetNode(objects, key);
|
|
1141
1326
|
};
|
|
1142
1327
|
|
|
1328
|
+
/** @type {import('.')} */
|
|
1143
1329
|
var sideChannel = function getSideChannel() {
|
|
1144
|
-
var $wm;
|
|
1145
|
-
var $m;
|
|
1146
|
-
var $o;
|
|
1330
|
+
/** @type {WeakMap<object, unknown>} */ var $wm;
|
|
1331
|
+
/** @type {Map<object, unknown>} */ var $m;
|
|
1332
|
+
/** @type {import('.').RootNode<unknown>} */ var $o;
|
|
1333
|
+
|
|
1334
|
+
/** @type {import('.').Channel} */
|
|
1147
1335
|
var channel = {
|
|
1148
1336
|
assert: function (key) {
|
|
1149
1337
|
if (!channel.has(key)) {
|
|
1150
|
-
throw new
|
|
1338
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
1151
1339
|
}
|
|
1152
1340
|
},
|
|
1153
1341
|
get: function (key) { // eslint-disable-line consistent-return
|
|
@@ -1194,11 +1382,7 @@ var sideChannel = function getSideChannel() {
|
|
|
1194
1382
|
$mapSet($m, key, value);
|
|
1195
1383
|
} else {
|
|
1196
1384
|
if (!$o) {
|
|
1197
|
-
|
|
1198
|
-
* Initialize the linked list as an empty node, so that we don't have
|
|
1199
|
-
* to special-case handling of the first node: we can always refer to
|
|
1200
|
-
* it as (previous node).next, instead of something like (list).head
|
|
1201
|
-
*/
|
|
1385
|
+
// 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
|
|
1202
1386
|
$o = { key: {}, next: null };
|
|
1203
1387
|
}
|
|
1204
1388
|
listSet($o, key, value);
|
|
@@ -1506,10 +1690,13 @@ var defaultFormat = formats['default'];
|
|
|
1506
1690
|
var defaults$1 = {
|
|
1507
1691
|
addQueryPrefix: false,
|
|
1508
1692
|
allowDots: false,
|
|
1693
|
+
allowEmptyArrays: false,
|
|
1694
|
+
arrayFormat: 'indices',
|
|
1509
1695
|
charset: 'utf-8',
|
|
1510
1696
|
charsetSentinel: false,
|
|
1511
1697
|
delimiter: '&',
|
|
1512
1698
|
encode: true,
|
|
1699
|
+
encodeDotInKeys: false,
|
|
1513
1700
|
encoder: utils.encode,
|
|
1514
1701
|
encodeValuesOnly: false,
|
|
1515
1702
|
format: defaultFormat,
|
|
@@ -1538,8 +1725,10 @@ var stringify = function stringify(
|
|
|
1538
1725
|
prefix,
|
|
1539
1726
|
generateArrayPrefix,
|
|
1540
1727
|
commaRoundTrip,
|
|
1728
|
+
allowEmptyArrays,
|
|
1541
1729
|
strictNullHandling,
|
|
1542
1730
|
skipNulls,
|
|
1731
|
+
encodeDotInKeys,
|
|
1543
1732
|
encoder,
|
|
1544
1733
|
filter,
|
|
1545
1734
|
sort,
|
|
@@ -1621,7 +1810,13 @@ var stringify = function stringify(
|
|
|
1621
1810
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
1622
1811
|
}
|
|
1623
1812
|
|
|
1624
|
-
var
|
|
1813
|
+
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
|
|
1814
|
+
|
|
1815
|
+
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
1816
|
+
|
|
1817
|
+
if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
|
|
1818
|
+
return adjustedPrefix + '[]';
|
|
1819
|
+
}
|
|
1625
1820
|
|
|
1626
1821
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
1627
1822
|
var key = objKeys[j];
|
|
@@ -1631,9 +1826,10 @@ var stringify = function stringify(
|
|
|
1631
1826
|
continue;
|
|
1632
1827
|
}
|
|
1633
1828
|
|
|
1829
|
+
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
|
|
1634
1830
|
var keyPrefix = isArray$1(obj)
|
|
1635
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix,
|
|
1636
|
-
: adjustedPrefix + (allowDots ? '.' +
|
|
1831
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
1832
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
1637
1833
|
|
|
1638
1834
|
sideChannel$1.set(object, step);
|
|
1639
1835
|
var valueSideChannel = sideChannel();
|
|
@@ -1643,8 +1839,10 @@ var stringify = function stringify(
|
|
|
1643
1839
|
keyPrefix,
|
|
1644
1840
|
generateArrayPrefix,
|
|
1645
1841
|
commaRoundTrip,
|
|
1842
|
+
allowEmptyArrays,
|
|
1646
1843
|
strictNullHandling,
|
|
1647
1844
|
skipNulls,
|
|
1845
|
+
encodeDotInKeys,
|
|
1648
1846
|
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
1649
1847
|
filter,
|
|
1650
1848
|
sort,
|
|
@@ -1666,6 +1864,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1666
1864
|
return defaults$1;
|
|
1667
1865
|
}
|
|
1668
1866
|
|
|
1867
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
1868
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
1872
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1669
1875
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
1670
1876
|
throw new TypeError('Encoder has to be a function.');
|
|
1671
1877
|
}
|
|
@@ -1689,13 +1895,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1689
1895
|
filter = opts.filter;
|
|
1690
1896
|
}
|
|
1691
1897
|
|
|
1898
|
+
var arrayFormat;
|
|
1899
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
1900
|
+
arrayFormat = opts.arrayFormat;
|
|
1901
|
+
} else if ('indices' in opts) {
|
|
1902
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1903
|
+
} else {
|
|
1904
|
+
arrayFormat = defaults$1.arrayFormat;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1908
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
|
|
1912
|
+
|
|
1692
1913
|
return {
|
|
1693
1914
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
1694
|
-
allowDots:
|
|
1915
|
+
allowDots: allowDots,
|
|
1916
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
|
|
1917
|
+
arrayFormat: arrayFormat,
|
|
1695
1918
|
charset: charset,
|
|
1696
1919
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
1920
|
+
commaRoundTrip: opts.commaRoundTrip,
|
|
1697
1921
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
|
|
1698
1922
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
|
|
1923
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
|
|
1699
1924
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
|
|
1700
1925
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
1701
1926
|
filter: filter,
|
|
@@ -1729,20 +1954,8 @@ var stringify_1 = function (object, opts) {
|
|
|
1729
1954
|
return '';
|
|
1730
1955
|
}
|
|
1731
1956
|
|
|
1732
|
-
var arrayFormat;
|
|
1733
|
-
|
|
1734
|
-
arrayFormat = opts.arrayFormat;
|
|
1735
|
-
} else if (opts && 'indices' in opts) {
|
|
1736
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1737
|
-
} else {
|
|
1738
|
-
arrayFormat = 'indices';
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
1742
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1743
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1744
|
-
}
|
|
1745
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
1957
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
1958
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
1746
1959
|
|
|
1747
1960
|
if (!objKeys) {
|
|
1748
1961
|
objKeys = Object.keys(obj);
|
|
@@ -1764,8 +1977,10 @@ var stringify_1 = function (object, opts) {
|
|
|
1764
1977
|
key,
|
|
1765
1978
|
generateArrayPrefix,
|
|
1766
1979
|
commaRoundTrip,
|
|
1980
|
+
options.allowEmptyArrays,
|
|
1767
1981
|
options.strictNullHandling,
|
|
1768
1982
|
options.skipNulls,
|
|
1983
|
+
options.encodeDotInKeys,
|
|
1769
1984
|
options.encode ? options.encoder : null,
|
|
1770
1985
|
options.filter,
|
|
1771
1986
|
options.sort,
|
|
@@ -1800,15 +2015,18 @@ var isArray = Array.isArray;
|
|
|
1800
2015
|
|
|
1801
2016
|
var defaults = {
|
|
1802
2017
|
allowDots: false,
|
|
2018
|
+
allowEmptyArrays: false,
|
|
1803
2019
|
allowPrototypes: false,
|
|
1804
2020
|
allowSparse: false,
|
|
1805
2021
|
arrayLimit: 20,
|
|
1806
2022
|
charset: 'utf-8',
|
|
1807
2023
|
charsetSentinel: false,
|
|
1808
2024
|
comma: false,
|
|
2025
|
+
decodeDotInKeys: true,
|
|
1809
2026
|
decoder: utils.decode,
|
|
1810
2027
|
delimiter: '&',
|
|
1811
2028
|
depth: 5,
|
|
2029
|
+
duplicates: 'combine',
|
|
1812
2030
|
ignoreQueryPrefix: false,
|
|
1813
2031
|
interpretNumericEntities: false,
|
|
1814
2032
|
parameterLimit: 1000,
|
|
@@ -1896,9 +2114,10 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
1896
2114
|
val = isArray(val) ? [val] : val;
|
|
1897
2115
|
}
|
|
1898
2116
|
|
|
1899
|
-
|
|
2117
|
+
var existing = has.call(obj, key);
|
|
2118
|
+
if (existing && options.duplicates === 'combine') {
|
|
1900
2119
|
obj[key] = utils.combine(obj[key], val);
|
|
1901
|
-
} else {
|
|
2120
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
1902
2121
|
obj[key] = val;
|
|
1903
2122
|
}
|
|
1904
2123
|
}
|
|
@@ -1914,24 +2133,25 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
1914
2133
|
var root = chain[i];
|
|
1915
2134
|
|
|
1916
2135
|
if (root === '[]' && options.parseArrays) {
|
|
1917
|
-
obj = [].concat(leaf);
|
|
2136
|
+
obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);
|
|
1918
2137
|
} else {
|
|
1919
2138
|
obj = options.plainObjects ? Object.create(null) : {};
|
|
1920
2139
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
1921
|
-
var
|
|
1922
|
-
|
|
2140
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
2141
|
+
var index = parseInt(decodedRoot, 10);
|
|
2142
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
1923
2143
|
obj = { 0: leaf };
|
|
1924
2144
|
} else if (
|
|
1925
2145
|
!isNaN(index)
|
|
1926
|
-
&& root !==
|
|
1927
|
-
&& String(index) ===
|
|
2146
|
+
&& root !== decodedRoot
|
|
2147
|
+
&& String(index) === decodedRoot
|
|
1928
2148
|
&& index >= 0
|
|
1929
2149
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
1930
2150
|
) {
|
|
1931
2151
|
obj = [];
|
|
1932
2152
|
obj[index] = leaf;
|
|
1933
|
-
} else if (
|
|
1934
|
-
obj[
|
|
2153
|
+
} else if (decodedRoot !== '__proto__') {
|
|
2154
|
+
obj[decodedRoot] = leaf;
|
|
1935
2155
|
}
|
|
1936
2156
|
}
|
|
1937
2157
|
|
|
@@ -2000,7 +2220,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
2000
2220
|
return defaults;
|
|
2001
2221
|
}
|
|
2002
2222
|
|
|
2003
|
-
if (
|
|
2223
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2224
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
2228
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
2004
2232
|
throw new TypeError('Decoder has to be a function.');
|
|
2005
2233
|
}
|
|
2006
2234
|
|
|
@@ -2009,18 +2237,29 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
2009
2237
|
}
|
|
2010
2238
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
2011
2239
|
|
|
2240
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
2241
|
+
|
|
2242
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
2243
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
2247
|
+
|
|
2012
2248
|
return {
|
|
2013
|
-
allowDots:
|
|
2249
|
+
allowDots: allowDots,
|
|
2250
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
2014
2251
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2015
2252
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
2016
2253
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
2017
2254
|
charset: charset,
|
|
2018
2255
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2019
2256
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
2257
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
2020
2258
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
2021
2259
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2022
2260
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2023
2261
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
2262
|
+
duplicates: duplicates,
|
|
2024
2263
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2025
2264
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2026
2265
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
@@ -2062,85 +2301,52 @@ var lib = {
|
|
|
2062
2301
|
stringify: stringify_1
|
|
2063
2302
|
};
|
|
2064
2303
|
|
|
2304
|
+
const limit = 100;
|
|
2065
2305
|
const fetchProductColorsQuery = (id, page) => lib.stringify({
|
|
2066
|
-
|
|
2306
|
+
fields: ['*', 'products.*'].join(','),
|
|
2307
|
+
filter: {
|
|
2067
2308
|
products: {
|
|
2068
|
-
|
|
2069
|
-
|
|
2309
|
+
Product_id: {
|
|
2310
|
+
_eq: id,
|
|
2070
2311
|
},
|
|
2071
2312
|
},
|
|
2072
2313
|
},
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
page: page || 1,
|
|
2077
|
-
pageSize: 100,
|
|
2078
|
-
},
|
|
2314
|
+
meta: '*',
|
|
2315
|
+
page: page || 1,
|
|
2316
|
+
limit,
|
|
2079
2317
|
}, {
|
|
2080
|
-
encodeValuesOnly: true,
|
|
2318
|
+
encodeValuesOnly: true,
|
|
2081
2319
|
});
|
|
2082
|
-
const fetchCategoryColorsQuery = (
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2320
|
+
const fetchCategoryColorsQuery = (id, page) => lib.stringify({
|
|
2321
|
+
fields: ['*', 'Category.*', 'products.*'].join(','),
|
|
2322
|
+
filter: {
|
|
2323
|
+
Category: {
|
|
2324
|
+
Category_id: {
|
|
2325
|
+
_eq: id,
|
|
2087
2326
|
},
|
|
2088
2327
|
},
|
|
2089
2328
|
},
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
page: 1,
|
|
2094
|
-
pageSize: 100,
|
|
2095
|
-
},
|
|
2329
|
+
meta: '*',
|
|
2330
|
+
page: page || 1,
|
|
2331
|
+
limit,
|
|
2096
2332
|
}, {
|
|
2097
|
-
encodeValuesOnly: true,
|
|
2333
|
+
encodeValuesOnly: true,
|
|
2098
2334
|
});
|
|
2099
|
-
const fetchColorByNumber = (
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
number: {
|
|
2106
|
-
$contains: colorNumber,
|
|
2107
|
-
},
|
|
2108
|
-
},
|
|
2109
|
-
{
|
|
2110
|
-
products: {
|
|
2111
|
-
id: {
|
|
2112
|
-
$eq: productId,
|
|
2113
|
-
},
|
|
2114
|
-
},
|
|
2115
|
-
},
|
|
2116
|
-
],
|
|
2117
|
-
},
|
|
2118
|
-
{
|
|
2119
|
-
$and: [
|
|
2120
|
-
{
|
|
2121
|
-
name: {
|
|
2122
|
-
$contains: colorNumber,
|
|
2123
|
-
},
|
|
2124
|
-
},
|
|
2125
|
-
{
|
|
2126
|
-
products: {
|
|
2127
|
-
id: {
|
|
2128
|
-
$eq: productId,
|
|
2129
|
-
},
|
|
2130
|
-
},
|
|
2131
|
-
},
|
|
2132
|
-
],
|
|
2335
|
+
const fetchColorByNumber = (id, colorNumber) => lib.stringify({
|
|
2336
|
+
fields: ['*', 'Category.*'].join(','),
|
|
2337
|
+
filter: {
|
|
2338
|
+
Category: {
|
|
2339
|
+
Category_id: {
|
|
2340
|
+
_eq: id,
|
|
2133
2341
|
},
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
pagination: {
|
|
2139
|
-
page: 1,
|
|
2140
|
-
pageSize: 100,
|
|
2342
|
+
},
|
|
2343
|
+
number: {
|
|
2344
|
+
_contains: colorNumber,
|
|
2345
|
+
},
|
|
2141
2346
|
},
|
|
2347
|
+
meta: '*',
|
|
2142
2348
|
}, {
|
|
2143
|
-
encodeValuesOnly: true,
|
|
2349
|
+
encodeValuesOnly: true,
|
|
2144
2350
|
});
|
|
2145
2351
|
|
|
2146
2352
|
const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:35px 40px;max-height:calc(100vh - 100px);overflow-y:auto}@media (max-width: 1024px){.my-modal{padding:80px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal>img{width:300px;object-fit:cover}@media (max-width: 768px){.my-modal>img{width:200px}}.my-modal__close{position:absolute;right:20px;top:20px;background:transparent;border:none}.my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__close{top:65px}}.my-modal__see-more{font-size:22px;margin-bottom:27px;display:flex;justify-content:center;align-items:center}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;text-transform:capitalize;margin-bottom:7px;color:#232323}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__slider{width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.1);border-radius:22.5px;padding:15px 30px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}";
|
|
@@ -2149,6 +2355,7 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2149
2355
|
constructor() {
|
|
2150
2356
|
super();
|
|
2151
2357
|
this.__registerHost();
|
|
2358
|
+
this.clearSearchText = createEvent(this, "clearSearchText", 7);
|
|
2152
2359
|
this.close = createEvent(this, "close", 7);
|
|
2153
2360
|
this.readyToCLose = createEvent(this, "readyToCLose", 7);
|
|
2154
2361
|
this.boxDesktopWidth = 130;
|
|
@@ -2204,10 +2411,18 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2204
2411
|
};
|
|
2205
2412
|
this.fetchProductData = async () => {
|
|
2206
2413
|
try {
|
|
2207
|
-
const
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2414
|
+
const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${this.shop}`);
|
|
2415
|
+
const shop = shopResponse === null || shopResponse === void 0 ? void 0 : shopResponse.data[0];
|
|
2416
|
+
if (shop.id) {
|
|
2417
|
+
const response = await ApiService.getData(`items/Product?filter[name][_eq]=${this.product}&fields=*,images.*,Shop.*,Category.*.*.*.*`);
|
|
2418
|
+
const product = response === null || response === void 0 ? void 0 : response.data[0];
|
|
2419
|
+
if (product) {
|
|
2420
|
+
if (product.Shop.find((s) => s.Shop_id === shop.id)) {
|
|
2421
|
+
this.data = Object.assign(Object.assign({}, response.data[0]), { id: response.data[0].id });
|
|
2422
|
+
}
|
|
2423
|
+
else {
|
|
2424
|
+
return null;
|
|
2425
|
+
}
|
|
2211
2426
|
}
|
|
2212
2427
|
}
|
|
2213
2428
|
}
|
|
@@ -2218,17 +2433,16 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2218
2433
|
this.preloader = false;
|
|
2219
2434
|
}
|
|
2220
2435
|
};
|
|
2221
|
-
// TODO:
|
|
2222
2436
|
this.fetchProductColors = async (id, page) => {
|
|
2223
2437
|
this.loading = true;
|
|
2224
2438
|
try {
|
|
2225
|
-
const response = await ApiService.getData(`
|
|
2439
|
+
const response = await ApiService.getData(`items/Color?${fetchProductColorsQuery(id, page)}`);
|
|
2226
2440
|
if (response) {
|
|
2227
2441
|
this.colors = {
|
|
2228
2442
|
list: response &&
|
|
2229
2443
|
response.data &&
|
|
2230
|
-
response.data.map((item) => (Object.assign({
|
|
2231
|
-
pagination: response.meta
|
|
2444
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2445
|
+
pagination: response.meta,
|
|
2232
2446
|
};
|
|
2233
2447
|
}
|
|
2234
2448
|
}
|
|
@@ -2239,16 +2453,16 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2239
2453
|
this.loading = false;
|
|
2240
2454
|
}
|
|
2241
2455
|
};
|
|
2242
|
-
this.fetchCategoryColors = async (
|
|
2456
|
+
this.fetchCategoryColors = async (id, page) => {
|
|
2243
2457
|
this.loading = true;
|
|
2244
2458
|
try {
|
|
2245
|
-
const response = await ApiService.getData(`
|
|
2459
|
+
const response = await ApiService.getData(`items/Color?${fetchCategoryColorsQuery(id, page)}`);
|
|
2246
2460
|
if (response) {
|
|
2247
2461
|
this.colors = {
|
|
2248
2462
|
list: response &&
|
|
2249
2463
|
response.data &&
|
|
2250
|
-
response.data.map((item) => (Object.assign({
|
|
2251
|
-
pagination: response.meta
|
|
2464
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2465
|
+
pagination: response.meta,
|
|
2252
2466
|
};
|
|
2253
2467
|
}
|
|
2254
2468
|
}
|
|
@@ -2259,29 +2473,21 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2259
2473
|
this.loading = false;
|
|
2260
2474
|
}
|
|
2261
2475
|
};
|
|
2262
|
-
// private onIntersection = async (entries: any) => {
|
|
2263
|
-
// console.log(entries[0]);
|
|
2264
|
-
// if (entries[0].intersectionRatio === 0) {
|
|
2265
|
-
// console.log('d');
|
|
2266
|
-
// }
|
|
2267
|
-
// };
|
|
2268
|
-
// private handleObserve = () => {
|
|
2269
|
-
// console.log(this.modalEl.shadowRoot);
|
|
2270
|
-
// const boxesList: any = (this.modalEl as any).querySelector('.my-modal__wrapper');
|
|
2271
|
-
// console.log(boxesList);
|
|
2272
|
-
// if (boxesList) {
|
|
2273
|
-
// this.observer = new IntersectionObserver(this.onIntersection);
|
|
2274
|
-
// this.observer.observe(boxesList);
|
|
2275
|
-
// }
|
|
2276
|
-
// };
|
|
2277
2476
|
this.onPage = (page) => {
|
|
2278
|
-
|
|
2477
|
+
if (this.data) {
|
|
2478
|
+
if (this.selectedCategory) {
|
|
2479
|
+
this.fetchCategoryColors(this.selectedCategory, page);
|
|
2480
|
+
}
|
|
2481
|
+
else {
|
|
2482
|
+
this.fetchProductColors(String(this.data.id), page);
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2279
2485
|
this.page = page;
|
|
2280
2486
|
this.currentColor = null;
|
|
2281
2487
|
this.currentIndex = null;
|
|
2282
2488
|
};
|
|
2283
2489
|
this.handleCategoryClick = (color) => {
|
|
2284
|
-
if (this.selectedCategory && color && this.selectedCategory
|
|
2490
|
+
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2285
2491
|
this.data && this.fetchProductColors(String(this.data.id));
|
|
2286
2492
|
this.selectedCategory = null;
|
|
2287
2493
|
}
|
|
@@ -2290,6 +2496,7 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2290
2496
|
this.selectedCategory = color;
|
|
2291
2497
|
}
|
|
2292
2498
|
this.currentColor = null;
|
|
2499
|
+
this.clearSearchText.emit();
|
|
2293
2500
|
};
|
|
2294
2501
|
this.shop = undefined;
|
|
2295
2502
|
this.product = undefined;
|
|
@@ -2315,9 +2522,9 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2315
2522
|
this.infoBoxWidth = newValue * this.boxWidth;
|
|
2316
2523
|
}
|
|
2317
2524
|
watchPropHandler(newValue) {
|
|
2318
|
-
if (newValue.
|
|
2525
|
+
if (newValue.Category.length > 0) {
|
|
2319
2526
|
this.showRange = true;
|
|
2320
|
-
this.handleCategoryClick(newValue.
|
|
2527
|
+
this.handleCategoryClick(newValue.Category[0].Category_id.id);
|
|
2321
2528
|
}
|
|
2322
2529
|
else {
|
|
2323
2530
|
this.fetchProductColors(String(newValue.id));
|
|
@@ -2341,21 +2548,23 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2341
2548
|
this.displayForMobile();
|
|
2342
2549
|
}
|
|
2343
2550
|
async searchColorsHandler(event) {
|
|
2344
|
-
|
|
2551
|
+
this.loading = true;
|
|
2552
|
+
this.currentColor = null;
|
|
2345
2553
|
// if search is empty set to first category to not showing whole product colors
|
|
2346
2554
|
if (event.detail === '') {
|
|
2347
|
-
this.handleCategoryClick(
|
|
2555
|
+
this.handleCategoryClick(this.selectedCategory);
|
|
2556
|
+
this.loading = true;
|
|
2348
2557
|
}
|
|
2349
2558
|
try {
|
|
2350
2559
|
if (this.data && this.data.id && event.detail !== '') {
|
|
2351
|
-
this.selectedCategory
|
|
2352
|
-
const response = await ApiService.getData(`colors?${fetchColorByNumber(Number(this.data.id), event.detail)}`);
|
|
2560
|
+
const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);
|
|
2353
2561
|
if (response) {
|
|
2354
2562
|
this.colors = {
|
|
2355
|
-
list: response &&
|
|
2563
|
+
list: (response &&
|
|
2356
2564
|
response.data &&
|
|
2357
|
-
response.data.map((item) => (Object.assign({
|
|
2358
|
-
|
|
2565
|
+
response.data.map((item) => (Object.assign({}, item)))) ||
|
|
2566
|
+
[],
|
|
2567
|
+
pagination: response.meta,
|
|
2359
2568
|
};
|
|
2360
2569
|
}
|
|
2361
2570
|
}
|
|
@@ -2363,6 +2572,9 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2363
2572
|
catch (error) {
|
|
2364
2573
|
console.error(error);
|
|
2365
2574
|
}
|
|
2575
|
+
finally {
|
|
2576
|
+
this.loading = false;
|
|
2577
|
+
}
|
|
2366
2578
|
}
|
|
2367
2579
|
componentWillLoad() {
|
|
2368
2580
|
this.preloader = true;
|
|
@@ -2374,11 +2586,9 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2374
2586
|
this.colorTimer();
|
|
2375
2587
|
}
|
|
2376
2588
|
render() {
|
|
2377
|
-
var _a, _b, _c, _d
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
return (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c), color: c.attributes.hex, name: c.attributes.name, shop: this.shop, product: this.product, isCategoryActive: ((_a = this.selectedCategory) === null || _a === void 0 ? void 0 : _a.id) === c.id }));
|
|
2381
|
-
})), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2589
|
+
var _a, _b, _c, _d;
|
|
2590
|
+
console.log(this.colors);
|
|
2591
|
+
return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription)), this.showRange && (h("div", { class: 'categories' }, this.data && h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_d = this.data) === null || _d === void 0 ? void 0 : _d.Category.map((c) => (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c.Category_id.id), color: c.Category_id.hex, name: c.Category_id.category_name, shop: this.shop, product: this.product, isCategoryActive: this.selectedCategory === c.Category_id.id })))), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2382
2592
|
var _a;
|
|
2383
2593
|
return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
|
|
2384
2594
|
var _a;
|
|
@@ -2397,10 +2607,10 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2397
2607
|
];
|
|
2398
2608
|
}, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product }));
|
|
2399
2609
|
})), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth }))));
|
|
2400
|
-
})) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.
|
|
2610
|
+
})) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.filter_count > limit && (h("div", { class: 'pagination' }, Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
|
|
2401
2611
|
e.preventDefault();
|
|
2402
2612
|
this.onPage(i + 1);
|
|
2403
|
-
}, key: `#${i + 1
|
|
2613
|
+
}, key: `#${i + 1}` }, i + 1)))))))), !this.preloader && this.isMobile && (h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
|
|
2404
2614
|
}
|
|
2405
2615
|
static get assetsDirs() { return ["assets"]; }
|
|
2406
2616
|
get modalEl() { return this; }
|