bibot 1.0.70 → 1.0.72
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/dist/component/{Avatar.d.ts → views/Avatar.d.ts} +1 -1
- package/dist/component/views/ChatBubbleContainer.d.ts +4 -0
- package/dist/component/views/ChatHeader.d.ts +4 -0
- package/dist/component/views/ChatWindow.d.ts +4 -0
- package/dist/component/views/GreetingMessage.d.ts +4 -0
- package/dist/component/{Icons.d.ts → views/Icons.d.ts} +1 -1
- package/dist/component/views/InputArea.d.ts +4 -0
- package/dist/component/views/MarkdownView.d.ts +6 -0
- package/dist/component/views/MessageList.d.ts +4 -0
- package/dist/component/{aiFollowUps.d.ts → views/aiFollowUps.d.ts} +1 -1
- package/dist/component/{predefinedQuestions.d.ts → views/predefinedQuestions.d.ts} +1 -1
- package/dist/index.js +1579 -801
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1580 -802
- package/dist/index.modern.js.map +1 -1
- package/dist/types/coreInterfaces.d.ts +68 -3
- package/package.json +28 -30
- /package/dist/component/{loader.d.ts → views/loader.d.ts} +0 -0
package/dist/index.js
CHANGED
@@ -4,25 +4,16 @@ var React = require('react');
|
|
4
4
|
var React__default = _interopDefault(React);
|
5
5
|
|
6
6
|
function _extends() {
|
7
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
8
|
-
for (var
|
9
|
-
var
|
10
|
-
for (var
|
11
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
12
|
-
target[key] = source[key];
|
13
|
-
}
|
14
|
-
}
|
7
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
8
|
+
for (var e = 1; e < arguments.length; e++) {
|
9
|
+
var t = arguments[e];
|
10
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
15
11
|
}
|
16
|
-
return
|
17
|
-
};
|
18
|
-
return _extends.apply(this, arguments);
|
12
|
+
return n;
|
13
|
+
}, _extends.apply(null, arguments);
|
19
14
|
}
|
20
|
-
function _taggedTemplateLiteralLoose(
|
21
|
-
|
22
|
-
raw = strings.slice(0);
|
23
|
-
}
|
24
|
-
strings.raw = raw;
|
25
|
-
return strings;
|
15
|
+
function _taggedTemplateLiteralLoose(e, t) {
|
16
|
+
return t || (t = e.slice(0)), e.raw = t, e;
|
26
17
|
}
|
27
18
|
|
28
19
|
function bind(fn, thisArg) {
|
@@ -238,6 +229,8 @@ const isFormData = (thing) => {
|
|
238
229
|
*/
|
239
230
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
240
231
|
|
232
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
233
|
+
|
241
234
|
/**
|
242
235
|
* Trim excess whitespace off the beginning and end of a string
|
243
236
|
*
|
@@ -626,8 +619,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
626
619
|
const noop = () => {};
|
627
620
|
|
628
621
|
const toFiniteNumber = (value, defaultValue) => {
|
629
|
-
value = +value;
|
630
|
-
return Number.isFinite(value) ? value : defaultValue;
|
622
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
631
623
|
};
|
632
624
|
|
633
625
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
@@ -697,6 +689,36 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
697
689
|
const isThenable = (thing) =>
|
698
690
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
699
691
|
|
692
|
+
// original code
|
693
|
+
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
694
|
+
|
695
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
696
|
+
if (setImmediateSupported) {
|
697
|
+
return setImmediate;
|
698
|
+
}
|
699
|
+
|
700
|
+
return postMessageSupported ? ((token, callbacks) => {
|
701
|
+
_global.addEventListener("message", ({source, data}) => {
|
702
|
+
if (source === _global && data === token) {
|
703
|
+
callbacks.length && callbacks.shift()();
|
704
|
+
}
|
705
|
+
}, false);
|
706
|
+
|
707
|
+
return (cb) => {
|
708
|
+
callbacks.push(cb);
|
709
|
+
_global.postMessage(token, "*");
|
710
|
+
}
|
711
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
712
|
+
})(
|
713
|
+
typeof setImmediate === 'function',
|
714
|
+
isFunction(_global.postMessage)
|
715
|
+
);
|
716
|
+
|
717
|
+
const asap = typeof queueMicrotask !== 'undefined' ?
|
718
|
+
queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
|
719
|
+
|
720
|
+
// *********************
|
721
|
+
|
700
722
|
var utils = {
|
701
723
|
isArray,
|
702
724
|
isArrayBuffer,
|
@@ -708,6 +730,10 @@ var utils = {
|
|
708
730
|
isBoolean,
|
709
731
|
isObject,
|
710
732
|
isPlainObject,
|
733
|
+
isReadableStream,
|
734
|
+
isRequest,
|
735
|
+
isResponse,
|
736
|
+
isHeaders,
|
711
737
|
isUndefined,
|
712
738
|
isDate,
|
713
739
|
isFile,
|
@@ -748,7 +774,9 @@ var utils = {
|
|
748
774
|
isSpecCompliantForm,
|
749
775
|
toJSONObject,
|
750
776
|
isAsyncFn,
|
751
|
-
isThenable
|
777
|
+
isThenable,
|
778
|
+
setImmediate: _setImmediate,
|
779
|
+
asap
|
752
780
|
};
|
753
781
|
|
754
782
|
/**
|
@@ -776,7 +804,10 @@ function AxiosError(message, code, config, request, response) {
|
|
776
804
|
code && (this.code = code);
|
777
805
|
config && (this.config = config);
|
778
806
|
request && (this.request = request);
|
779
|
-
|
807
|
+
if (response) {
|
808
|
+
this.response = response;
|
809
|
+
this.status = response.status ? response.status : null;
|
810
|
+
}
|
780
811
|
}
|
781
812
|
|
782
813
|
utils.inherits(AxiosError, Error, {
|
@@ -796,7 +827,7 @@ utils.inherits(AxiosError, Error, {
|
|
796
827
|
// Axios
|
797
828
|
config: utils.toJSONObject(this.config),
|
798
829
|
code: this.code,
|
799
|
-
status: this.
|
830
|
+
status: this.status
|
800
831
|
};
|
801
832
|
}
|
802
833
|
});
|
@@ -1262,6 +1293,8 @@ var platform = {
|
|
1262
1293
|
|
1263
1294
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1264
1295
|
|
1296
|
+
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
1297
|
+
|
1265
1298
|
/**
|
1266
1299
|
* Determine if we're running in a standard browser environment
|
1267
1300
|
*
|
@@ -1279,10 +1312,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
|
|
1279
1312
|
*
|
1280
1313
|
* @returns {boolean}
|
1281
1314
|
*/
|
1282
|
-
const hasStandardBrowserEnv =
|
1283
|
-
(product)
|
1284
|
-
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
1285
|
-
})(typeof navigator !== 'undefined' && navigator.product);
|
1315
|
+
const hasStandardBrowserEnv = hasBrowserEnv &&
|
1316
|
+
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
1286
1317
|
|
1287
1318
|
/**
|
1288
1319
|
* Determine if we're running in a standard browser webWorker environment
|
@@ -1302,11 +1333,15 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
1302
1333
|
);
|
1303
1334
|
})();
|
1304
1335
|
|
1336
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
1337
|
+
|
1305
1338
|
var utils$1 = {
|
1306
1339
|
__proto__: null,
|
1307
1340
|
hasBrowserEnv: hasBrowserEnv,
|
1308
1341
|
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
1309
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv
|
1342
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
1343
|
+
navigator: _navigator,
|
1344
|
+
origin: origin
|
1310
1345
|
};
|
1311
1346
|
|
1312
1347
|
var platform$1 = {
|
@@ -1446,7 +1481,7 @@ const defaults = {
|
|
1446
1481
|
|
1447
1482
|
transitional: transitionalDefaults,
|
1448
1483
|
|
1449
|
-
adapter: ['xhr', 'http'],
|
1484
|
+
adapter: ['xhr', 'http', 'fetch'],
|
1450
1485
|
|
1451
1486
|
transformRequest: [function transformRequest(data, headers) {
|
1452
1487
|
const contentType = headers.getContentType() || '';
|
@@ -1467,7 +1502,8 @@ const defaults = {
|
|
1467
1502
|
utils.isBuffer(data) ||
|
1468
1503
|
utils.isStream(data) ||
|
1469
1504
|
utils.isFile(data) ||
|
1470
|
-
utils.isBlob(data)
|
1505
|
+
utils.isBlob(data) ||
|
1506
|
+
utils.isReadableStream(data)
|
1471
1507
|
) {
|
1472
1508
|
return data;
|
1473
1509
|
}
|
@@ -1510,6 +1546,10 @@ const defaults = {
|
|
1510
1546
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
1511
1547
|
const JSONRequested = this.responseType === 'json';
|
1512
1548
|
|
1549
|
+
if (utils.isResponse(data) || utils.isReadableStream(data)) {
|
1550
|
+
return data;
|
1551
|
+
}
|
1552
|
+
|
1513
1553
|
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
1514
1554
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
1515
1555
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
@@ -1711,6 +1751,10 @@ class AxiosHeaders {
|
|
1711
1751
|
setHeaders(header, valueOrRewrite);
|
1712
1752
|
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
1713
1753
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
1754
|
+
} else if (utils.isHeaders(header)) {
|
1755
|
+
for (const [key, value] of header.entries()) {
|
1756
|
+
setHeader(value, key, rewrite);
|
1757
|
+
}
|
1714
1758
|
} else {
|
1715
1759
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
1716
1760
|
}
|
@@ -1976,96 +2020,153 @@ function settle(resolve, reject, response) {
|
|
1976
2020
|
}
|
1977
2021
|
}
|
1978
2022
|
|
1979
|
-
|
2023
|
+
function parseProtocol(url) {
|
2024
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
2025
|
+
return match && match[1] || '';
|
2026
|
+
}
|
1980
2027
|
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
2028
|
+
/**
|
2029
|
+
* Calculate data maxRate
|
2030
|
+
* @param {Number} [samplesCount= 10]
|
2031
|
+
* @param {Number} [min= 1000]
|
2032
|
+
* @returns {Function}
|
2033
|
+
*/
|
2034
|
+
function speedometer(samplesCount, min) {
|
2035
|
+
samplesCount = samplesCount || 10;
|
2036
|
+
const bytes = new Array(samplesCount);
|
2037
|
+
const timestamps = new Array(samplesCount);
|
2038
|
+
let head = 0;
|
2039
|
+
let tail = 0;
|
2040
|
+
let firstSampleTS;
|
1985
2041
|
|
1986
|
-
|
2042
|
+
min = min !== undefined ? min : 1000;
|
1987
2043
|
|
1988
|
-
|
2044
|
+
return function push(chunkLength) {
|
2045
|
+
const now = Date.now();
|
1989
2046
|
|
1990
|
-
|
2047
|
+
const startedAt = timestamps[tail];
|
1991
2048
|
|
1992
|
-
|
2049
|
+
if (!firstSampleTS) {
|
2050
|
+
firstSampleTS = now;
|
2051
|
+
}
|
1993
2052
|
|
1994
|
-
|
1995
|
-
|
2053
|
+
bytes[head] = chunkLength;
|
2054
|
+
timestamps[head] = now;
|
1996
2055
|
|
1997
|
-
|
1998
|
-
|
1999
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
2000
|
-
},
|
2056
|
+
let i = tail;
|
2057
|
+
let bytesCount = 0;
|
2001
2058
|
|
2002
|
-
|
2003
|
-
|
2059
|
+
while (i !== head) {
|
2060
|
+
bytesCount += bytes[i++];
|
2061
|
+
i = i % samplesCount;
|
2004
2062
|
}
|
2005
|
-
}
|
2006
2063
|
|
2007
|
-
|
2064
|
+
head = (head + 1) % samplesCount;
|
2008
2065
|
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
read() {
|
2013
|
-
return null;
|
2014
|
-
},
|
2015
|
-
remove() {}
|
2016
|
-
};
|
2066
|
+
if (head === tail) {
|
2067
|
+
tail = (tail + 1) % samplesCount;
|
2068
|
+
}
|
2017
2069
|
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
* @param {string} url The URL to test
|
2022
|
-
*
|
2023
|
-
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
2024
|
-
*/
|
2025
|
-
function isAbsoluteURL(url) {
|
2026
|
-
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
2027
|
-
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
2028
|
-
// by any combination of letters, digits, plus, period, or hyphen.
|
2029
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
2030
|
-
}
|
2070
|
+
if (now - firstSampleTS < min) {
|
2071
|
+
return;
|
2072
|
+
}
|
2031
2073
|
|
2032
|
-
|
2033
|
-
|
2034
|
-
*
|
2035
|
-
|
2036
|
-
* @param {string} relativeURL The relative URL
|
2037
|
-
*
|
2038
|
-
* @returns {string} The combined URL
|
2039
|
-
*/
|
2040
|
-
function combineURLs(baseURL, relativeURL) {
|
2041
|
-
return relativeURL
|
2042
|
-
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
2043
|
-
: baseURL;
|
2074
|
+
const passed = startedAt && now - startedAt;
|
2075
|
+
|
2076
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
2077
|
+
};
|
2044
2078
|
}
|
2045
2079
|
|
2046
2080
|
/**
|
2047
|
-
*
|
2048
|
-
*
|
2049
|
-
*
|
2050
|
-
*
|
2051
|
-
* @param {string} baseURL The base URL
|
2052
|
-
* @param {string} requestedURL Absolute or relative URL to combine
|
2053
|
-
*
|
2054
|
-
* @returns {string} The combined full path
|
2081
|
+
* Throttle decorator
|
2082
|
+
* @param {Function} fn
|
2083
|
+
* @param {Number} freq
|
2084
|
+
* @return {Function}
|
2055
2085
|
*/
|
2056
|
-
function
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2086
|
+
function throttle(fn, freq) {
|
2087
|
+
let timestamp = 0;
|
2088
|
+
let threshold = 1000 / freq;
|
2089
|
+
let lastArgs;
|
2090
|
+
let timer;
|
2091
|
+
|
2092
|
+
const invoke = (args, now = Date.now()) => {
|
2093
|
+
timestamp = now;
|
2094
|
+
lastArgs = null;
|
2095
|
+
if (timer) {
|
2096
|
+
clearTimeout(timer);
|
2097
|
+
timer = null;
|
2098
|
+
}
|
2099
|
+
fn.apply(null, args);
|
2100
|
+
};
|
2101
|
+
|
2102
|
+
const throttled = (...args) => {
|
2103
|
+
const now = Date.now();
|
2104
|
+
const passed = now - timestamp;
|
2105
|
+
if ( passed >= threshold) {
|
2106
|
+
invoke(args, now);
|
2107
|
+
} else {
|
2108
|
+
lastArgs = args;
|
2109
|
+
if (!timer) {
|
2110
|
+
timer = setTimeout(() => {
|
2111
|
+
timer = null;
|
2112
|
+
invoke(lastArgs);
|
2113
|
+
}, threshold - passed);
|
2114
|
+
}
|
2115
|
+
}
|
2116
|
+
};
|
2117
|
+
|
2118
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
2119
|
+
|
2120
|
+
return [throttled, flush];
|
2061
2121
|
}
|
2062
2122
|
|
2123
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
2124
|
+
let bytesNotified = 0;
|
2125
|
+
const _speedometer = speedometer(50, 250);
|
2126
|
+
|
2127
|
+
return throttle(e => {
|
2128
|
+
const loaded = e.loaded;
|
2129
|
+
const total = e.lengthComputable ? e.total : undefined;
|
2130
|
+
const progressBytes = loaded - bytesNotified;
|
2131
|
+
const rate = _speedometer(progressBytes);
|
2132
|
+
const inRange = loaded <= total;
|
2133
|
+
|
2134
|
+
bytesNotified = loaded;
|
2135
|
+
|
2136
|
+
const data = {
|
2137
|
+
loaded,
|
2138
|
+
total,
|
2139
|
+
progress: total ? (loaded / total) : undefined,
|
2140
|
+
bytes: progressBytes,
|
2141
|
+
rate: rate ? rate : undefined,
|
2142
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
2143
|
+
event: e,
|
2144
|
+
lengthComputable: total != null,
|
2145
|
+
[isDownloadStream ? 'download' : 'upload']: true
|
2146
|
+
};
|
2147
|
+
|
2148
|
+
listener(data);
|
2149
|
+
}, freq);
|
2150
|
+
};
|
2151
|
+
|
2152
|
+
const progressEventDecorator = (total, throttled) => {
|
2153
|
+
const lengthComputable = total != null;
|
2154
|
+
|
2155
|
+
return [(loaded) => throttled[0]({
|
2156
|
+
lengthComputable,
|
2157
|
+
total,
|
2158
|
+
loaded
|
2159
|
+
}), throttled[1]];
|
2160
|
+
};
|
2161
|
+
|
2162
|
+
const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
|
2163
|
+
|
2063
2164
|
var isURLSameOrigin = platform$1.hasStandardBrowserEnv ?
|
2064
2165
|
|
2065
2166
|
// Standard browser envs have full support of the APIs needed to test
|
2066
2167
|
// whether the request URL is of the same origin as current location.
|
2067
2168
|
(function standardBrowserEnv() {
|
2068
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
2169
|
+
const msie = platform$1.navigator && /(msie|trident)/i.test(platform$1.navigator.userAgent);
|
2069
2170
|
const urlParsingNode = document.createElement('a');
|
2070
2171
|
let originURL;
|
2071
2172
|
|
@@ -2123,137 +2224,267 @@ var isURLSameOrigin = platform$1.hasStandardBrowserEnv ?
|
|
2123
2224
|
};
|
2124
2225
|
})();
|
2125
2226
|
|
2126
|
-
|
2127
|
-
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
2128
|
-
return match && match[1] || '';
|
2129
|
-
}
|
2130
|
-
|
2131
|
-
/**
|
2132
|
-
* Calculate data maxRate
|
2133
|
-
* @param {Number} [samplesCount= 10]
|
2134
|
-
* @param {Number} [min= 1000]
|
2135
|
-
* @returns {Function}
|
2136
|
-
*/
|
2137
|
-
function speedometer(samplesCount, min) {
|
2138
|
-
samplesCount = samplesCount || 10;
|
2139
|
-
const bytes = new Array(samplesCount);
|
2140
|
-
const timestamps = new Array(samplesCount);
|
2141
|
-
let head = 0;
|
2142
|
-
let tail = 0;
|
2143
|
-
let firstSampleTS;
|
2144
|
-
|
2145
|
-
min = min !== undefined ? min : 1000;
|
2146
|
-
|
2147
|
-
return function push(chunkLength) {
|
2148
|
-
const now = Date.now();
|
2227
|
+
var cookies = platform$1.hasStandardBrowserEnv ?
|
2149
2228
|
|
2150
|
-
|
2229
|
+
// Standard browser envs support document.cookie
|
2230
|
+
{
|
2231
|
+
write(name, value, expires, path, domain, secure) {
|
2232
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
2151
2233
|
|
2152
|
-
|
2153
|
-
firstSampleTS = now;
|
2154
|
-
}
|
2234
|
+
utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
2155
2235
|
|
2156
|
-
|
2157
|
-
timestamps[head] = now;
|
2236
|
+
utils.isString(path) && cookie.push('path=' + path);
|
2158
2237
|
|
2159
|
-
|
2160
|
-
let bytesCount = 0;
|
2238
|
+
utils.isString(domain) && cookie.push('domain=' + domain);
|
2161
2239
|
|
2162
|
-
|
2163
|
-
bytesCount += bytes[i++];
|
2164
|
-
i = i % samplesCount;
|
2165
|
-
}
|
2240
|
+
secure === true && cookie.push('secure');
|
2166
2241
|
|
2167
|
-
|
2242
|
+
document.cookie = cookie.join('; ');
|
2243
|
+
},
|
2168
2244
|
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2245
|
+
read(name) {
|
2246
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
2247
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
2248
|
+
},
|
2172
2249
|
|
2173
|
-
|
2174
|
-
|
2250
|
+
remove(name) {
|
2251
|
+
this.write(name, '', Date.now() - 86400000);
|
2175
2252
|
}
|
2253
|
+
}
|
2176
2254
|
|
2177
|
-
|
2255
|
+
:
|
2178
2256
|
|
2179
|
-
|
2257
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
2258
|
+
{
|
2259
|
+
write() {},
|
2260
|
+
read() {
|
2261
|
+
return null;
|
2262
|
+
},
|
2263
|
+
remove() {}
|
2180
2264
|
};
|
2181
|
-
}
|
2182
|
-
|
2183
|
-
function progressEventReducer(listener, isDownloadStream) {
|
2184
|
-
let bytesNotified = 0;
|
2185
|
-
const _speedometer = speedometer(50, 250);
|
2186
2265
|
|
2187
|
-
|
2188
|
-
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2192
|
-
|
2266
|
+
/**
|
2267
|
+
* Determines whether the specified URL is absolute
|
2268
|
+
*
|
2269
|
+
* @param {string} url The URL to test
|
2270
|
+
*
|
2271
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
2272
|
+
*/
|
2273
|
+
function isAbsoluteURL(url) {
|
2274
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
2275
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
2276
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
2277
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
2278
|
+
}
|
2193
2279
|
|
2194
|
-
|
2280
|
+
/**
|
2281
|
+
* Creates a new URL by combining the specified URLs
|
2282
|
+
*
|
2283
|
+
* @param {string} baseURL The base URL
|
2284
|
+
* @param {string} relativeURL The relative URL
|
2285
|
+
*
|
2286
|
+
* @returns {string} The combined URL
|
2287
|
+
*/
|
2288
|
+
function combineURLs(baseURL, relativeURL) {
|
2289
|
+
return relativeURL
|
2290
|
+
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
2291
|
+
: baseURL;
|
2292
|
+
}
|
2195
2293
|
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2294
|
+
/**
|
2295
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
2296
|
+
* only when the requestedURL is not already an absolute URL.
|
2297
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
2298
|
+
*
|
2299
|
+
* @param {string} baseURL The base URL
|
2300
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
2301
|
+
*
|
2302
|
+
* @returns {string} The combined full path
|
2303
|
+
*/
|
2304
|
+
function buildFullPath(baseURL, requestedURL) {
|
2305
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
2306
|
+
return combineURLs(baseURL, requestedURL);
|
2307
|
+
}
|
2308
|
+
return requestedURL;
|
2309
|
+
}
|
2205
2310
|
|
2206
|
-
|
2311
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
|
2207
2312
|
|
2208
|
-
|
2313
|
+
/**
|
2314
|
+
* Config-specific merge-function which creates a new config-object
|
2315
|
+
* by merging two configuration objects together.
|
2316
|
+
*
|
2317
|
+
* @param {Object} config1
|
2318
|
+
* @param {Object} config2
|
2319
|
+
*
|
2320
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
2321
|
+
*/
|
2322
|
+
function mergeConfig(config1, config2) {
|
2323
|
+
// eslint-disable-next-line no-param-reassign
|
2324
|
+
config2 = config2 || {};
|
2325
|
+
const config = {};
|
2326
|
+
|
2327
|
+
function getMergedValue(target, source, caseless) {
|
2328
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
2329
|
+
return utils.merge.call({caseless}, target, source);
|
2330
|
+
} else if (utils.isPlainObject(source)) {
|
2331
|
+
return utils.merge({}, source);
|
2332
|
+
} else if (utils.isArray(source)) {
|
2333
|
+
return source.slice();
|
2334
|
+
}
|
2335
|
+
return source;
|
2336
|
+
}
|
2337
|
+
|
2338
|
+
// eslint-disable-next-line consistent-return
|
2339
|
+
function mergeDeepProperties(a, b, caseless) {
|
2340
|
+
if (!utils.isUndefined(b)) {
|
2341
|
+
return getMergedValue(a, b, caseless);
|
2342
|
+
} else if (!utils.isUndefined(a)) {
|
2343
|
+
return getMergedValue(undefined, a, caseless);
|
2344
|
+
}
|
2345
|
+
}
|
2346
|
+
|
2347
|
+
// eslint-disable-next-line consistent-return
|
2348
|
+
function valueFromConfig2(a, b) {
|
2349
|
+
if (!utils.isUndefined(b)) {
|
2350
|
+
return getMergedValue(undefined, b);
|
2351
|
+
}
|
2352
|
+
}
|
2353
|
+
|
2354
|
+
// eslint-disable-next-line consistent-return
|
2355
|
+
function defaultToConfig2(a, b) {
|
2356
|
+
if (!utils.isUndefined(b)) {
|
2357
|
+
return getMergedValue(undefined, b);
|
2358
|
+
} else if (!utils.isUndefined(a)) {
|
2359
|
+
return getMergedValue(undefined, a);
|
2360
|
+
}
|
2361
|
+
}
|
2362
|
+
|
2363
|
+
// eslint-disable-next-line consistent-return
|
2364
|
+
function mergeDirectKeys(a, b, prop) {
|
2365
|
+
if (prop in config2) {
|
2366
|
+
return getMergedValue(a, b);
|
2367
|
+
} else if (prop in config1) {
|
2368
|
+
return getMergedValue(undefined, a);
|
2369
|
+
}
|
2370
|
+
}
|
2371
|
+
|
2372
|
+
const mergeMap = {
|
2373
|
+
url: valueFromConfig2,
|
2374
|
+
method: valueFromConfig2,
|
2375
|
+
data: valueFromConfig2,
|
2376
|
+
baseURL: defaultToConfig2,
|
2377
|
+
transformRequest: defaultToConfig2,
|
2378
|
+
transformResponse: defaultToConfig2,
|
2379
|
+
paramsSerializer: defaultToConfig2,
|
2380
|
+
timeout: defaultToConfig2,
|
2381
|
+
timeoutMessage: defaultToConfig2,
|
2382
|
+
withCredentials: defaultToConfig2,
|
2383
|
+
withXSRFToken: defaultToConfig2,
|
2384
|
+
adapter: defaultToConfig2,
|
2385
|
+
responseType: defaultToConfig2,
|
2386
|
+
xsrfCookieName: defaultToConfig2,
|
2387
|
+
xsrfHeaderName: defaultToConfig2,
|
2388
|
+
onUploadProgress: defaultToConfig2,
|
2389
|
+
onDownloadProgress: defaultToConfig2,
|
2390
|
+
decompress: defaultToConfig2,
|
2391
|
+
maxContentLength: defaultToConfig2,
|
2392
|
+
maxBodyLength: defaultToConfig2,
|
2393
|
+
beforeRedirect: defaultToConfig2,
|
2394
|
+
transport: defaultToConfig2,
|
2395
|
+
httpAgent: defaultToConfig2,
|
2396
|
+
httpsAgent: defaultToConfig2,
|
2397
|
+
cancelToken: defaultToConfig2,
|
2398
|
+
socketPath: defaultToConfig2,
|
2399
|
+
responseEncoding: defaultToConfig2,
|
2400
|
+
validateStatus: mergeDirectKeys,
|
2401
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
2209
2402
|
};
|
2403
|
+
|
2404
|
+
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2405
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
2406
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
2407
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
2408
|
+
});
|
2409
|
+
|
2410
|
+
return config;
|
2210
2411
|
}
|
2211
2412
|
|
2212
|
-
|
2413
|
+
var resolveConfig = (config) => {
|
2414
|
+
const newConfig = mergeConfig({}, config);
|
2213
2415
|
|
2214
|
-
|
2215
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2216
|
-
let requestData = config.data;
|
2217
|
-
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
2218
|
-
let {responseType, withXSRFToken} = config;
|
2219
|
-
let onCanceled;
|
2220
|
-
function done() {
|
2221
|
-
if (config.cancelToken) {
|
2222
|
-
config.cancelToken.unsubscribe(onCanceled);
|
2223
|
-
}
|
2416
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
2224
2417
|
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2418
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
2419
|
+
|
2420
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
2421
|
+
|
2422
|
+
// HTTP basic authentication
|
2423
|
+
if (auth) {
|
2424
|
+
headers.set('Authorization', 'Basic ' +
|
2425
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
2426
|
+
);
|
2427
|
+
}
|
2428
|
+
|
2429
|
+
let contentType;
|
2430
|
+
|
2431
|
+
if (utils.isFormData(data)) {
|
2432
|
+
if (platform$1.hasStandardBrowserEnv || platform$1.hasStandardBrowserWebWorkerEnv) {
|
2433
|
+
headers.setContentType(undefined); // Let the browser set it
|
2434
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
2435
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
2436
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
2437
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
2228
2438
|
}
|
2439
|
+
}
|
2440
|
+
|
2441
|
+
// Add xsrf header
|
2442
|
+
// This is only done if running in a standard browser environment.
|
2443
|
+
// Specifically not if we're in a web worker, or react-native.
|
2229
2444
|
|
2230
|
-
|
2445
|
+
if (platform$1.hasStandardBrowserEnv) {
|
2446
|
+
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
2231
2447
|
|
2232
|
-
if (
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
2448
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
2449
|
+
// Add xsrf header
|
2450
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
2451
|
+
|
2452
|
+
if (xsrfValue) {
|
2453
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
2239
2454
|
}
|
2240
2455
|
}
|
2456
|
+
}
|
2241
2457
|
|
2242
|
-
|
2458
|
+
return newConfig;
|
2459
|
+
};
|
2460
|
+
|
2461
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
2462
|
+
|
2463
|
+
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
2464
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2465
|
+
const _config = resolveConfig(config);
|
2466
|
+
let requestData = _config.data;
|
2467
|
+
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
2468
|
+
let {responseType, onUploadProgress, onDownloadProgress} = _config;
|
2469
|
+
let onCanceled;
|
2470
|
+
let uploadThrottled, downloadThrottled;
|
2471
|
+
let flushUpload, flushDownload;
|
2472
|
+
|
2473
|
+
function done() {
|
2474
|
+
flushUpload && flushUpload(); // flush events
|
2475
|
+
flushDownload && flushDownload(); // flush events
|
2243
2476
|
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
2248
|
-
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
2477
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
2478
|
+
|
2479
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
2249
2480
|
}
|
2250
2481
|
|
2251
|
-
|
2482
|
+
let request = new XMLHttpRequest();
|
2252
2483
|
|
2253
|
-
request.open(
|
2484
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
2254
2485
|
|
2255
2486
|
// Set the request timeout in MS
|
2256
|
-
request.timeout =
|
2487
|
+
request.timeout = _config.timeout;
|
2257
2488
|
|
2258
2489
|
function onloadend() {
|
2259
2490
|
if (!request) {
|
@@ -2333,10 +2564,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2333
2564
|
|
2334
2565
|
// Handle timeout
|
2335
2566
|
request.ontimeout = function handleTimeout() {
|
2336
|
-
let timeoutErrorMessage =
|
2337
|
-
const transitional =
|
2338
|
-
if (
|
2339
|
-
timeoutErrorMessage =
|
2567
|
+
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
2568
|
+
const transitional = _config.transitional || transitionalDefaults;
|
2569
|
+
if (_config.timeoutErrorMessage) {
|
2570
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
2340
2571
|
}
|
2341
2572
|
reject(new AxiosError(
|
2342
2573
|
timeoutErrorMessage,
|
@@ -2348,22 +2579,6 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2348
2579
|
request = null;
|
2349
2580
|
};
|
2350
2581
|
|
2351
|
-
// Add xsrf header
|
2352
|
-
// This is only done if running in a standard browser environment.
|
2353
|
-
// Specifically not if we're in a web worker, or react-native.
|
2354
|
-
if(platform$1.hasStandardBrowserEnv) {
|
2355
|
-
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
2356
|
-
|
2357
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
2358
|
-
// Add xsrf header
|
2359
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2360
|
-
|
2361
|
-
if (xsrfValue) {
|
2362
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
2363
|
-
}
|
2364
|
-
}
|
2365
|
-
}
|
2366
|
-
|
2367
2582
|
// Remove Content-Type if data is undefined
|
2368
2583
|
requestData === undefined && requestHeaders.setContentType(null);
|
2369
2584
|
|
@@ -2375,26 +2590,31 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2375
2590
|
}
|
2376
2591
|
|
2377
2592
|
// Add withCredentials to request if needed
|
2378
|
-
if (!utils.isUndefined(
|
2379
|
-
request.withCredentials = !!
|
2593
|
+
if (!utils.isUndefined(_config.withCredentials)) {
|
2594
|
+
request.withCredentials = !!_config.withCredentials;
|
2380
2595
|
}
|
2381
2596
|
|
2382
2597
|
// Add responseType to request if needed
|
2383
2598
|
if (responseType && responseType !== 'json') {
|
2384
|
-
request.responseType =
|
2599
|
+
request.responseType = _config.responseType;
|
2385
2600
|
}
|
2386
2601
|
|
2387
2602
|
// Handle progress if needed
|
2388
|
-
if (
|
2389
|
-
|
2603
|
+
if (onDownloadProgress) {
|
2604
|
+
([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
|
2605
|
+
request.addEventListener('progress', downloadThrottled);
|
2390
2606
|
}
|
2391
2607
|
|
2392
2608
|
// Not all browsers support upload events
|
2393
|
-
if (
|
2394
|
-
|
2609
|
+
if (onUploadProgress && request.upload) {
|
2610
|
+
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
2611
|
+
|
2612
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
2613
|
+
|
2614
|
+
request.upload.addEventListener('loadend', flushUpload);
|
2395
2615
|
}
|
2396
2616
|
|
2397
|
-
if (
|
2617
|
+
if (_config.cancelToken || _config.signal) {
|
2398
2618
|
// Handle cancellation
|
2399
2619
|
// eslint-disable-next-line func-names
|
2400
2620
|
onCanceled = cancel => {
|
@@ -2406,13 +2626,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2406
2626
|
request = null;
|
2407
2627
|
};
|
2408
2628
|
|
2409
|
-
|
2410
|
-
if (
|
2411
|
-
|
2629
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
2630
|
+
if (_config.signal) {
|
2631
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
2412
2632
|
}
|
2413
2633
|
}
|
2414
2634
|
|
2415
|
-
const protocol = parseProtocol(
|
2635
|
+
const protocol = parseProtocol(_config.url);
|
2416
2636
|
|
2417
2637
|
if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
|
2418
2638
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
@@ -2425,76 +2645,425 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2425
2645
|
});
|
2426
2646
|
};
|
2427
2647
|
|
2428
|
-
const
|
2429
|
-
|
2430
|
-
xhr: xhrAdapter
|
2431
|
-
};
|
2648
|
+
const composeSignals = (signals, timeout) => {
|
2649
|
+
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
2432
2650
|
|
2433
|
-
|
2434
|
-
|
2435
|
-
try {
|
2436
|
-
Object.defineProperty(fn, 'name', {value});
|
2437
|
-
} catch (e) {
|
2438
|
-
// eslint-disable-next-line no-empty
|
2439
|
-
}
|
2440
|
-
Object.defineProperty(fn, 'adapterName', {value});
|
2441
|
-
}
|
2442
|
-
});
|
2651
|
+
if (timeout || length) {
|
2652
|
+
let controller = new AbortController();
|
2443
2653
|
|
2444
|
-
|
2654
|
+
let aborted;
|
2445
2655
|
|
2446
|
-
const
|
2656
|
+
const onabort = function (reason) {
|
2657
|
+
if (!aborted) {
|
2658
|
+
aborted = true;
|
2659
|
+
unsubscribe();
|
2660
|
+
const err = reason instanceof Error ? reason : this.reason;
|
2661
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
2662
|
+
}
|
2663
|
+
};
|
2447
2664
|
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2665
|
+
let timer = timeout && setTimeout(() => {
|
2666
|
+
timer = null;
|
2667
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
2668
|
+
}, timeout);
|
2669
|
+
|
2670
|
+
const unsubscribe = () => {
|
2671
|
+
if (signals) {
|
2672
|
+
timer && clearTimeout(timer);
|
2673
|
+
timer = null;
|
2674
|
+
signals.forEach(signal => {
|
2675
|
+
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
2676
|
+
});
|
2677
|
+
signals = null;
|
2678
|
+
}
|
2679
|
+
};
|
2451
2680
|
|
2452
|
-
|
2453
|
-
let nameOrAdapter;
|
2454
|
-
let adapter;
|
2681
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
2455
2682
|
|
2456
|
-
const
|
2683
|
+
const {signal} = controller;
|
2457
2684
|
|
2458
|
-
|
2459
|
-
nameOrAdapter = adapters[i];
|
2460
|
-
let id;
|
2685
|
+
signal.unsubscribe = () => utils.asap(unsubscribe);
|
2461
2686
|
|
2462
|
-
|
2687
|
+
return signal;
|
2688
|
+
}
|
2689
|
+
};
|
2463
2690
|
|
2464
|
-
|
2465
|
-
|
2691
|
+
const streamChunk = function* (chunk, chunkSize) {
|
2692
|
+
let len = chunk.byteLength;
|
2466
2693
|
|
2467
|
-
|
2468
|
-
|
2469
|
-
|
2470
|
-
|
2694
|
+
if (!chunkSize || len < chunkSize) {
|
2695
|
+
yield chunk;
|
2696
|
+
return;
|
2697
|
+
}
|
2471
2698
|
|
2472
|
-
|
2699
|
+
let pos = 0;
|
2700
|
+
let end;
|
2701
|
+
|
2702
|
+
while (pos < len) {
|
2703
|
+
end = pos + chunkSize;
|
2704
|
+
yield chunk.slice(pos, end);
|
2705
|
+
pos = end;
|
2706
|
+
}
|
2707
|
+
};
|
2708
|
+
|
2709
|
+
const readBytes = async function* (iterable, chunkSize) {
|
2710
|
+
for await (const chunk of readStream(iterable)) {
|
2711
|
+
yield* streamChunk(chunk, chunkSize);
|
2712
|
+
}
|
2713
|
+
};
|
2714
|
+
|
2715
|
+
const readStream = async function* (stream) {
|
2716
|
+
if (stream[Symbol.asyncIterator]) {
|
2717
|
+
yield* stream;
|
2718
|
+
return;
|
2719
|
+
}
|
2720
|
+
|
2721
|
+
const reader = stream.getReader();
|
2722
|
+
try {
|
2723
|
+
for (;;) {
|
2724
|
+
const {done, value} = await reader.read();
|
2725
|
+
if (done) {
|
2473
2726
|
break;
|
2474
2727
|
}
|
2475
|
-
|
2476
|
-
rejectedReasons[id || '#' + i] = adapter;
|
2728
|
+
yield value;
|
2477
2729
|
}
|
2730
|
+
} finally {
|
2731
|
+
await reader.cancel();
|
2732
|
+
}
|
2733
|
+
};
|
2478
2734
|
|
2479
|
-
|
2735
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
2736
|
+
const iterator = readBytes(stream, chunkSize);
|
2480
2737
|
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2738
|
+
let bytes = 0;
|
2739
|
+
let done;
|
2740
|
+
let _onFinish = (e) => {
|
2741
|
+
if (!done) {
|
2742
|
+
done = true;
|
2743
|
+
onFinish && onFinish(e);
|
2744
|
+
}
|
2745
|
+
};
|
2485
2746
|
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2747
|
+
return new ReadableStream({
|
2748
|
+
async pull(controller) {
|
2749
|
+
try {
|
2750
|
+
const {done, value} = await iterator.next();
|
2489
2751
|
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2752
|
+
if (done) {
|
2753
|
+
_onFinish();
|
2754
|
+
controller.close();
|
2755
|
+
return;
|
2756
|
+
}
|
2757
|
+
|
2758
|
+
let len = value.byteLength;
|
2759
|
+
if (onProgress) {
|
2760
|
+
let loadedBytes = bytes += len;
|
2761
|
+
onProgress(loadedBytes);
|
2762
|
+
}
|
2763
|
+
controller.enqueue(new Uint8Array(value));
|
2764
|
+
} catch (err) {
|
2765
|
+
_onFinish(err);
|
2766
|
+
throw err;
|
2767
|
+
}
|
2768
|
+
},
|
2769
|
+
cancel(reason) {
|
2770
|
+
_onFinish(reason);
|
2771
|
+
return iterator.return();
|
2494
2772
|
}
|
2773
|
+
}, {
|
2774
|
+
highWaterMark: 2
|
2775
|
+
})
|
2776
|
+
};
|
2495
2777
|
|
2496
|
-
|
2497
|
-
|
2778
|
+
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
2779
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
2780
|
+
|
2781
|
+
// used only inside the fetch adapter
|
2782
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
2783
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
2784
|
+
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
2785
|
+
);
|
2786
|
+
|
2787
|
+
const test = (fn, ...args) => {
|
2788
|
+
try {
|
2789
|
+
return !!fn(...args);
|
2790
|
+
} catch (e) {
|
2791
|
+
return false
|
2792
|
+
}
|
2793
|
+
};
|
2794
|
+
|
2795
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
2796
|
+
let duplexAccessed = false;
|
2797
|
+
|
2798
|
+
const hasContentType = new Request(platform$1.origin, {
|
2799
|
+
body: new ReadableStream(),
|
2800
|
+
method: 'POST',
|
2801
|
+
get duplex() {
|
2802
|
+
duplexAccessed = true;
|
2803
|
+
return 'half';
|
2804
|
+
},
|
2805
|
+
}).headers.has('Content-Type');
|
2806
|
+
|
2807
|
+
return duplexAccessed && !hasContentType;
|
2808
|
+
});
|
2809
|
+
|
2810
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
2811
|
+
|
2812
|
+
const supportsResponseStream = isReadableStreamSupported &&
|
2813
|
+
test(() => utils.isReadableStream(new Response('').body));
|
2814
|
+
|
2815
|
+
|
2816
|
+
const resolvers = {
|
2817
|
+
stream: supportsResponseStream && ((res) => res.body)
|
2818
|
+
};
|
2819
|
+
|
2820
|
+
isFetchSupported && (((res) => {
|
2821
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
2822
|
+
!resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :
|
2823
|
+
(_, config) => {
|
2824
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
2825
|
+
});
|
2826
|
+
});
|
2827
|
+
})(new Response));
|
2828
|
+
|
2829
|
+
const getBodyLength = async (body) => {
|
2830
|
+
if (body == null) {
|
2831
|
+
return 0;
|
2832
|
+
}
|
2833
|
+
|
2834
|
+
if(utils.isBlob(body)) {
|
2835
|
+
return body.size;
|
2836
|
+
}
|
2837
|
+
|
2838
|
+
if(utils.isSpecCompliantForm(body)) {
|
2839
|
+
const _request = new Request(platform$1.origin, {
|
2840
|
+
method: 'POST',
|
2841
|
+
body,
|
2842
|
+
});
|
2843
|
+
return (await _request.arrayBuffer()).byteLength;
|
2844
|
+
}
|
2845
|
+
|
2846
|
+
if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
|
2847
|
+
return body.byteLength;
|
2848
|
+
}
|
2849
|
+
|
2850
|
+
if(utils.isURLSearchParams(body)) {
|
2851
|
+
body = body + '';
|
2852
|
+
}
|
2853
|
+
|
2854
|
+
if(utils.isString(body)) {
|
2855
|
+
return (await encodeText(body)).byteLength;
|
2856
|
+
}
|
2857
|
+
};
|
2858
|
+
|
2859
|
+
const resolveBodyLength = async (headers, body) => {
|
2860
|
+
const length = utils.toFiniteNumber(headers.getContentLength());
|
2861
|
+
|
2862
|
+
return length == null ? getBodyLength(body) : length;
|
2863
|
+
};
|
2864
|
+
|
2865
|
+
var fetchAdapter = isFetchSupported && (async (config) => {
|
2866
|
+
let {
|
2867
|
+
url,
|
2868
|
+
method,
|
2869
|
+
data,
|
2870
|
+
signal,
|
2871
|
+
cancelToken,
|
2872
|
+
timeout,
|
2873
|
+
onDownloadProgress,
|
2874
|
+
onUploadProgress,
|
2875
|
+
responseType,
|
2876
|
+
headers,
|
2877
|
+
withCredentials = 'same-origin',
|
2878
|
+
fetchOptions
|
2879
|
+
} = resolveConfig(config);
|
2880
|
+
|
2881
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
2882
|
+
|
2883
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
2884
|
+
|
2885
|
+
let request;
|
2886
|
+
|
2887
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
2888
|
+
composedSignal.unsubscribe();
|
2889
|
+
});
|
2890
|
+
|
2891
|
+
let requestContentLength;
|
2892
|
+
|
2893
|
+
try {
|
2894
|
+
if (
|
2895
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
2896
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
2897
|
+
) {
|
2898
|
+
let _request = new Request(url, {
|
2899
|
+
method: 'POST',
|
2900
|
+
body: data,
|
2901
|
+
duplex: "half"
|
2902
|
+
});
|
2903
|
+
|
2904
|
+
let contentTypeHeader;
|
2905
|
+
|
2906
|
+
if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
2907
|
+
headers.setContentType(contentTypeHeader);
|
2908
|
+
}
|
2909
|
+
|
2910
|
+
if (_request.body) {
|
2911
|
+
const [onProgress, flush] = progressEventDecorator(
|
2912
|
+
requestContentLength,
|
2913
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
2914
|
+
);
|
2915
|
+
|
2916
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
2917
|
+
}
|
2918
|
+
}
|
2919
|
+
|
2920
|
+
if (!utils.isString(withCredentials)) {
|
2921
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
2922
|
+
}
|
2923
|
+
|
2924
|
+
// Cloudflare Workers throws when credentials are defined
|
2925
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
2926
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
2927
|
+
request = new Request(url, {
|
2928
|
+
...fetchOptions,
|
2929
|
+
signal: composedSignal,
|
2930
|
+
method: method.toUpperCase(),
|
2931
|
+
headers: headers.normalize().toJSON(),
|
2932
|
+
body: data,
|
2933
|
+
duplex: "half",
|
2934
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
2935
|
+
});
|
2936
|
+
|
2937
|
+
let response = await fetch(request);
|
2938
|
+
|
2939
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
2940
|
+
|
2941
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
2942
|
+
const options = {};
|
2943
|
+
|
2944
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
2945
|
+
options[prop] = response[prop];
|
2946
|
+
});
|
2947
|
+
|
2948
|
+
const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));
|
2949
|
+
|
2950
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
2951
|
+
responseContentLength,
|
2952
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
2953
|
+
) || [];
|
2954
|
+
|
2955
|
+
response = new Response(
|
2956
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
2957
|
+
flush && flush();
|
2958
|
+
unsubscribe && unsubscribe();
|
2959
|
+
}),
|
2960
|
+
options
|
2961
|
+
);
|
2962
|
+
}
|
2963
|
+
|
2964
|
+
responseType = responseType || 'text';
|
2965
|
+
|
2966
|
+
let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);
|
2967
|
+
|
2968
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
2969
|
+
|
2970
|
+
return await new Promise((resolve, reject) => {
|
2971
|
+
settle(resolve, reject, {
|
2972
|
+
data: responseData,
|
2973
|
+
headers: AxiosHeaders.from(response.headers),
|
2974
|
+
status: response.status,
|
2975
|
+
statusText: response.statusText,
|
2976
|
+
config,
|
2977
|
+
request
|
2978
|
+
});
|
2979
|
+
})
|
2980
|
+
} catch (err) {
|
2981
|
+
unsubscribe && unsubscribe();
|
2982
|
+
|
2983
|
+
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
2984
|
+
throw Object.assign(
|
2985
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
2986
|
+
{
|
2987
|
+
cause: err.cause || err
|
2988
|
+
}
|
2989
|
+
)
|
2990
|
+
}
|
2991
|
+
|
2992
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
2993
|
+
}
|
2994
|
+
});
|
2995
|
+
|
2996
|
+
const knownAdapters = {
|
2997
|
+
http: httpAdapter,
|
2998
|
+
xhr: xhrAdapter,
|
2999
|
+
fetch: fetchAdapter
|
3000
|
+
};
|
3001
|
+
|
3002
|
+
utils.forEach(knownAdapters, (fn, value) => {
|
3003
|
+
if (fn) {
|
3004
|
+
try {
|
3005
|
+
Object.defineProperty(fn, 'name', {value});
|
3006
|
+
} catch (e) {
|
3007
|
+
// eslint-disable-next-line no-empty
|
3008
|
+
}
|
3009
|
+
Object.defineProperty(fn, 'adapterName', {value});
|
3010
|
+
}
|
3011
|
+
});
|
3012
|
+
|
3013
|
+
const renderReason = (reason) => `- ${reason}`;
|
3014
|
+
|
3015
|
+
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
3016
|
+
|
3017
|
+
var adapters = {
|
3018
|
+
getAdapter: (adapters) => {
|
3019
|
+
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
3020
|
+
|
3021
|
+
const {length} = adapters;
|
3022
|
+
let nameOrAdapter;
|
3023
|
+
let adapter;
|
3024
|
+
|
3025
|
+
const rejectedReasons = {};
|
3026
|
+
|
3027
|
+
for (let i = 0; i < length; i++) {
|
3028
|
+
nameOrAdapter = adapters[i];
|
3029
|
+
let id;
|
3030
|
+
|
3031
|
+
adapter = nameOrAdapter;
|
3032
|
+
|
3033
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
3034
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
3035
|
+
|
3036
|
+
if (adapter === undefined) {
|
3037
|
+
throw new AxiosError(`Unknown adapter '${id}'`);
|
3038
|
+
}
|
3039
|
+
}
|
3040
|
+
|
3041
|
+
if (adapter) {
|
3042
|
+
break;
|
3043
|
+
}
|
3044
|
+
|
3045
|
+
rejectedReasons[id || '#' + i] = adapter;
|
3046
|
+
}
|
3047
|
+
|
3048
|
+
if (!adapter) {
|
3049
|
+
|
3050
|
+
const reasons = Object.entries(rejectedReasons)
|
3051
|
+
.map(([id, state]) => `adapter ${id} ` +
|
3052
|
+
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
3053
|
+
);
|
3054
|
+
|
3055
|
+
let s = length ?
|
3056
|
+
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
|
3057
|
+
'as no adapter specified';
|
3058
|
+
|
3059
|
+
throw new AxiosError(
|
3060
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
3061
|
+
'ERR_NOT_SUPPORT'
|
3062
|
+
);
|
3063
|
+
}
|
3064
|
+
|
3065
|
+
return adapter;
|
3066
|
+
},
|
2498
3067
|
adapters: knownAdapters
|
2499
3068
|
};
|
2500
3069
|
|
@@ -2571,109 +3140,7 @@ function dispatchRequest(config) {
|
|
2571
3140
|
});
|
2572
3141
|
}
|
2573
3142
|
|
2574
|
-
const
|
2575
|
-
|
2576
|
-
/**
|
2577
|
-
* Config-specific merge-function which creates a new config-object
|
2578
|
-
* by merging two configuration objects together.
|
2579
|
-
*
|
2580
|
-
* @param {Object} config1
|
2581
|
-
* @param {Object} config2
|
2582
|
-
*
|
2583
|
-
* @returns {Object} New object resulting from merging config2 to config1
|
2584
|
-
*/
|
2585
|
-
function mergeConfig(config1, config2) {
|
2586
|
-
// eslint-disable-next-line no-param-reassign
|
2587
|
-
config2 = config2 || {};
|
2588
|
-
const config = {};
|
2589
|
-
|
2590
|
-
function getMergedValue(target, source, caseless) {
|
2591
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
2592
|
-
return utils.merge.call({caseless}, target, source);
|
2593
|
-
} else if (utils.isPlainObject(source)) {
|
2594
|
-
return utils.merge({}, source);
|
2595
|
-
} else if (utils.isArray(source)) {
|
2596
|
-
return source.slice();
|
2597
|
-
}
|
2598
|
-
return source;
|
2599
|
-
}
|
2600
|
-
|
2601
|
-
// eslint-disable-next-line consistent-return
|
2602
|
-
function mergeDeepProperties(a, b, caseless) {
|
2603
|
-
if (!utils.isUndefined(b)) {
|
2604
|
-
return getMergedValue(a, b, caseless);
|
2605
|
-
} else if (!utils.isUndefined(a)) {
|
2606
|
-
return getMergedValue(undefined, a, caseless);
|
2607
|
-
}
|
2608
|
-
}
|
2609
|
-
|
2610
|
-
// eslint-disable-next-line consistent-return
|
2611
|
-
function valueFromConfig2(a, b) {
|
2612
|
-
if (!utils.isUndefined(b)) {
|
2613
|
-
return getMergedValue(undefined, b);
|
2614
|
-
}
|
2615
|
-
}
|
2616
|
-
|
2617
|
-
// eslint-disable-next-line consistent-return
|
2618
|
-
function defaultToConfig2(a, b) {
|
2619
|
-
if (!utils.isUndefined(b)) {
|
2620
|
-
return getMergedValue(undefined, b);
|
2621
|
-
} else if (!utils.isUndefined(a)) {
|
2622
|
-
return getMergedValue(undefined, a);
|
2623
|
-
}
|
2624
|
-
}
|
2625
|
-
|
2626
|
-
// eslint-disable-next-line consistent-return
|
2627
|
-
function mergeDirectKeys(a, b, prop) {
|
2628
|
-
if (prop in config2) {
|
2629
|
-
return getMergedValue(a, b);
|
2630
|
-
} else if (prop in config1) {
|
2631
|
-
return getMergedValue(undefined, a);
|
2632
|
-
}
|
2633
|
-
}
|
2634
|
-
|
2635
|
-
const mergeMap = {
|
2636
|
-
url: valueFromConfig2,
|
2637
|
-
method: valueFromConfig2,
|
2638
|
-
data: valueFromConfig2,
|
2639
|
-
baseURL: defaultToConfig2,
|
2640
|
-
transformRequest: defaultToConfig2,
|
2641
|
-
transformResponse: defaultToConfig2,
|
2642
|
-
paramsSerializer: defaultToConfig2,
|
2643
|
-
timeout: defaultToConfig2,
|
2644
|
-
timeoutMessage: defaultToConfig2,
|
2645
|
-
withCredentials: defaultToConfig2,
|
2646
|
-
withXSRFToken: defaultToConfig2,
|
2647
|
-
adapter: defaultToConfig2,
|
2648
|
-
responseType: defaultToConfig2,
|
2649
|
-
xsrfCookieName: defaultToConfig2,
|
2650
|
-
xsrfHeaderName: defaultToConfig2,
|
2651
|
-
onUploadProgress: defaultToConfig2,
|
2652
|
-
onDownloadProgress: defaultToConfig2,
|
2653
|
-
decompress: defaultToConfig2,
|
2654
|
-
maxContentLength: defaultToConfig2,
|
2655
|
-
maxBodyLength: defaultToConfig2,
|
2656
|
-
beforeRedirect: defaultToConfig2,
|
2657
|
-
transport: defaultToConfig2,
|
2658
|
-
httpAgent: defaultToConfig2,
|
2659
|
-
httpsAgent: defaultToConfig2,
|
2660
|
-
cancelToken: defaultToConfig2,
|
2661
|
-
socketPath: defaultToConfig2,
|
2662
|
-
responseEncoding: defaultToConfig2,
|
2663
|
-
validateStatus: mergeDirectKeys,
|
2664
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
2665
|
-
};
|
2666
|
-
|
2667
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2668
|
-
const merge = mergeMap[prop] || mergeDeepProperties;
|
2669
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
2670
|
-
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
2671
|
-
});
|
2672
|
-
|
2673
|
-
return config;
|
2674
|
-
}
|
2675
|
-
|
2676
|
-
const VERSION = "1.6.8";
|
3143
|
+
const VERSION = "1.7.7";
|
2677
3144
|
|
2678
3145
|
const validators = {};
|
2679
3146
|
|
@@ -2799,12 +3266,15 @@ class Axios {
|
|
2799
3266
|
|
2800
3267
|
// slice off the Error: ... line
|
2801
3268
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
3269
|
+
try {
|
3270
|
+
if (!err.stack) {
|
3271
|
+
err.stack = stack;
|
3272
|
+
// match without the 2 top stack lines
|
3273
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
3274
|
+
err.stack += '\n' + stack;
|
3275
|
+
}
|
3276
|
+
} catch (e) {
|
3277
|
+
// ignore the case where "stack" is an un-writable property
|
2808
3278
|
}
|
2809
3279
|
}
|
2810
3280
|
|
@@ -3075,8 +3545,22 @@ class CancelToken {
|
|
3075
3545
|
}
|
3076
3546
|
}
|
3077
3547
|
|
3078
|
-
|
3079
|
-
|
3548
|
+
toAbortSignal() {
|
3549
|
+
const controller = new AbortController();
|
3550
|
+
|
3551
|
+
const abort = (err) => {
|
3552
|
+
controller.abort(err);
|
3553
|
+
};
|
3554
|
+
|
3555
|
+
this.subscribe(abort);
|
3556
|
+
|
3557
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
3558
|
+
|
3559
|
+
return controller.signal;
|
3560
|
+
}
|
3561
|
+
|
3562
|
+
/**
|
3563
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
3080
3564
|
* cancels the `CancelToken`.
|
3081
3565
|
*/
|
3082
3566
|
static source() {
|
@@ -3363,43 +3847,42 @@ var appReducer = function appReducer(state, action) {
|
|
3363
3847
|
}
|
3364
3848
|
};
|
3365
3849
|
|
3850
|
+
/**
|
3851
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
3852
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
3853
|
+
*/
|
3854
|
+
var byteToHex = [];
|
3855
|
+
for (var i = 0; i < 256; ++i) {
|
3856
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
3857
|
+
}
|
3858
|
+
function unsafeStringify(arr, offset = 0) {
|
3859
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
3860
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
3861
|
+
//
|
3862
|
+
// Note to future-self: No, you can't remove the `toLowerCase()` call.
|
3863
|
+
// REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
|
3864
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
3865
|
+
}
|
3866
|
+
|
3366
3867
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
3367
3868
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
3368
3869
|
// generators (like Math.random()).
|
3369
|
-
|
3370
|
-
|
3870
|
+
|
3871
|
+
var getRandomValues;
|
3872
|
+
var rnds8 = new Uint8Array(16);
|
3371
3873
|
function rng() {
|
3372
3874
|
// lazy load so that environments that need to polyfill have a chance to do so
|
3373
3875
|
if (!getRandomValues) {
|
3374
3876
|
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
3375
3877
|
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
3376
|
-
|
3377
3878
|
if (!getRandomValues) {
|
3378
3879
|
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
3379
3880
|
}
|
3380
3881
|
}
|
3381
|
-
|
3382
3882
|
return getRandomValues(rnds8);
|
3383
3883
|
}
|
3384
3884
|
|
3385
|
-
|
3386
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
3387
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
3388
|
-
*/
|
3389
|
-
|
3390
|
-
const byteToHex = [];
|
3391
|
-
|
3392
|
-
for (let i = 0; i < 256; ++i) {
|
3393
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
3394
|
-
}
|
3395
|
-
|
3396
|
-
function unsafeStringify(arr, offset = 0) {
|
3397
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
3398
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
3399
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
3400
|
-
}
|
3401
|
-
|
3402
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
3885
|
+
var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
3403
3886
|
var native = {
|
3404
3887
|
randomUUID
|
3405
3888
|
};
|
@@ -3408,23 +3891,21 @@ function v4(options, buf, offset) {
|
|
3408
3891
|
if (native.randomUUID && !buf && !options) {
|
3409
3892
|
return native.randomUUID();
|
3410
3893
|
}
|
3411
|
-
|
3412
3894
|
options = options || {};
|
3413
|
-
|
3895
|
+
var rnds = options.random || (options.rng || rng)();
|
3414
3896
|
|
3897
|
+
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
3415
3898
|
rnds[6] = rnds[6] & 0x0f | 0x40;
|
3416
|
-
rnds[8] = rnds[8] & 0x3f | 0x80;
|
3899
|
+
rnds[8] = rnds[8] & 0x3f | 0x80;
|
3417
3900
|
|
3901
|
+
// Copy bytes to buffer, if provided
|
3418
3902
|
if (buf) {
|
3419
3903
|
offset = offset || 0;
|
3420
|
-
|
3421
|
-
for (let i = 0; i < 16; ++i) {
|
3904
|
+
for (var i = 0; i < 16; ++i) {
|
3422
3905
|
buf[offset + i] = rnds[i];
|
3423
3906
|
}
|
3424
|
-
|
3425
3907
|
return buf;
|
3426
3908
|
}
|
3427
|
-
|
3428
3909
|
return unsafeStringify(rnds);
|
3429
3910
|
}
|
3430
3911
|
|
@@ -3482,7 +3963,7 @@ var AppProvider = function AppProvider(_ref) {
|
|
3482
3963
|
var baseUrls = {
|
3483
3964
|
inference: {
|
3484
3965
|
production: 'https://inference.bibot.app/v0',
|
3485
|
-
test: 'https://inference.dev.bibot.
|
3966
|
+
test: 'https://inference.dev.bibot.app/v0'
|
3486
3967
|
}
|
3487
3968
|
};
|
3488
3969
|
var endpoints = {
|
@@ -3555,7 +4036,7 @@ var recordPredefinedQ = function recordPredefinedQ(pluginAxiosInstance, data) {
|
|
3555
4036
|
return Promise.reject(e);
|
3556
4037
|
}
|
3557
4038
|
};
|
3558
|
-
var
|
4039
|
+
var _handleRetries4 = function handleRetries(pluginAxiosInstance, data, attempt) {
|
3559
4040
|
try {
|
3560
4041
|
var maxAttempts = 30;
|
3561
4042
|
var delay = 10000;
|
@@ -3572,7 +4053,7 @@ var handleRetries = function handleRetries(pluginAxiosInstance, data, attempt) {
|
|
3572
4053
|
tries: attempt + 1
|
3573
4054
|
}))).then(function (res) {
|
3574
4055
|
if (res.message === defaultSlacker) {
|
3575
|
-
return Promise.resolve(
|
4056
|
+
return Promise.resolve(_handleRetries4(pluginAxiosInstance, data, attempt + 1));
|
3576
4057
|
} else {
|
3577
4058
|
return res;
|
3578
4059
|
}
|
@@ -3593,14 +4074,14 @@ var askBiBot = function askBiBot(pluginAxiosInstance, data) {
|
|
3593
4074
|
var path = "" + domain.inference + resources.q;
|
3594
4075
|
return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
|
3595
4076
|
if (response.data.message === defaultSlacker || response.status === 504) {
|
3596
|
-
return Promise.resolve(
|
4077
|
+
return Promise.resolve(_handleRetries4(pluginAxiosInstance, data, 1));
|
3597
4078
|
} else {
|
3598
4079
|
return response.data;
|
3599
4080
|
}
|
3600
4081
|
});
|
3601
4082
|
}, function (error) {
|
3602
4083
|
if (error.message === timeoutMessage) {
|
3603
|
-
return Promise.resolve(
|
4084
|
+
return Promise.resolve(_handleRetries4(pluginAxiosInstance, data, 1));
|
3604
4085
|
} else {
|
3605
4086
|
return {
|
3606
4087
|
message: error.message
|
@@ -3737,7 +4218,7 @@ var useBiBotChatBot = function useBiBotChatBot(bibotProps) {
|
|
3737
4218
|
var _useState = React.useState(true),
|
3738
4219
|
showPredefinedQuestions = _useState[0],
|
3739
4220
|
setShowPredefinedQuestions = _useState[1];
|
3740
|
-
var _useState2 = React.useState(
|
4221
|
+
var _useState2 = React.useState(true),
|
3741
4222
|
chatIsOpen = _useState2[0],
|
3742
4223
|
setChatIsOpen = _useState2[1];
|
3743
4224
|
var _useState3 = React.useState([]),
|
@@ -3971,344 +4452,60 @@ var Avatar = function Avatar(_ref) {
|
|
3971
4452
|
})));
|
3972
4453
|
};
|
3973
4454
|
|
3974
|
-
var
|
3975
|
-
var
|
3976
|
-
|
3977
|
-
|
3978
|
-
|
3979
|
-
setIsOnline(navigator.onLine);
|
3980
|
-
};
|
3981
|
-
React.useEffect(function () {
|
3982
|
-
window.addEventListener('online', updateOnlineStatus);
|
3983
|
-
window.addEventListener('offline', updateOnlineStatus);
|
3984
|
-
return function () {
|
3985
|
-
window.removeEventListener('online', updateOnlineStatus);
|
3986
|
-
window.removeEventListener('offline', updateOnlineStatus);
|
3987
|
-
};
|
3988
|
-
}, []);
|
3989
|
-
return isOnline;
|
3990
|
-
};
|
3991
|
-
|
3992
|
-
/******************************************************************************
|
3993
|
-
Copyright (c) Microsoft Corporation.
|
3994
|
-
|
3995
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
3996
|
-
purpose with or without fee is hereby granted.
|
3997
|
-
|
3998
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
3999
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
4000
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
4001
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
4002
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
4003
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
4004
|
-
PERFORMANCE OF THIS SOFTWARE.
|
4005
|
-
***************************************************************************** */
|
4006
|
-
|
4007
|
-
var __assign = function() {
|
4008
|
-
__assign = Object.assign || function __assign(t) {
|
4009
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4010
|
-
s = arguments[i];
|
4011
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4012
|
-
}
|
4013
|
-
return t;
|
4014
|
-
};
|
4015
|
-
return __assign.apply(this, arguments);
|
4016
|
-
};
|
4017
|
-
|
4018
|
-
function __spreadArray(to, from, pack) {
|
4019
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4020
|
-
if (ar || !(i in from)) {
|
4021
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
4022
|
-
ar[i] = from[i];
|
4023
|
-
}
|
4024
|
-
}
|
4025
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
4026
|
-
}
|
4027
|
-
|
4028
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
4029
|
-
var e = new Error(message);
|
4030
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
4031
|
-
};
|
4032
|
-
|
4033
|
-
function memoize(fn) {
|
4034
|
-
var cache = Object.create(null);
|
4035
|
-
return function (arg) {
|
4036
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
4037
|
-
return cache[arg];
|
4038
|
-
};
|
4039
|
-
}
|
4040
|
-
|
4041
|
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
4042
|
-
|
4043
|
-
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
4044
|
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
4045
|
-
/* o */
|
4046
|
-
&& prop.charCodeAt(1) === 110
|
4047
|
-
/* n */
|
4048
|
-
&& prop.charCodeAt(2) < 91;
|
4049
|
-
}
|
4050
|
-
/* Z+1 */
|
4051
|
-
);
|
4052
|
-
|
4053
|
-
var e="-ms-";var r="-moz-";var a="-webkit-";var n="comm";var c="rule";var s="decl";var i="@import";var h="@keyframes";var g="@layer";var $=Math.abs;var m=String.fromCharCode;var x=Object.assign;function y(e,r){return A(e,0)^45?(((r<<2^A(e,0))<<2^A(e,1))<<2^A(e,2))<<2^A(e,3):0}function j(e){return e.trim()}function z(e,r){return (e=r.exec(e))?e[0]:e}function C(e,r,a){return e.replace(r,a)}function O(e,r,a){return e.indexOf(r,a)}function A(e,r){return e.charCodeAt(r)|0}function M(e,r,a){return e.slice(r,a)}function S(e){return e.length}function q(e){return e.length}function B(e,r){return r.push(e),e}function D(e,r){return e.map(r).join("")}function E(e,r){return e.filter((function(e){return !z(e,r)}))}var F=1;var G=1;var H=0;var I=0;var J=0;var K="";function L(e,r,a,n,c,s,t,u){return {value:e,root:r,parent:a,type:n,props:c,children:s,line:F,column:G,length:t,return:"",siblings:u}}function N(e,r){return x(L("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},r)}function P(e){while(e.root)e=N(e.root,{children:[e]});B(e,e.siblings);}function Q(){return J}function R(){J=I>0?A(K,--I):0;if(G--,J===10)G=1,F--;return J}function T(){J=I<H?A(K,I++):0;if(G++,J===10)G=1,F++;return J}function U(){return A(K,I)}function V(){return I}function W(e,r){return M(K,e,r)}function X(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Y(e){return F=G=1,H=S(K=e),I=0,[]}function Z(e){return K="",e}function _(e){return j(W(I-1,ce(e===91?e+2:e===40?e+1:e)))}function re(e){while(J=U())if(J<33)T();else break;return X(e)>2||X(J)>3?"":" "}function ne(e,r){while(--r&&T())if(J<48||J>102||J>57&&J<65||J>70&&J<97)break;return W(e,V()+(r<6&&U()==32&&T()==32))}function ce(e){while(T())switch(J){case e:return I;case 34:case 39:if(e!==34&&e!==39)ce(J);break;case 40:if(e===41)ce(e);break;case 92:T();break}return I}function se(e,r){while(T())if(e+J===47+10)break;else if(e+J===42+42&&U()===47)break;return "/*"+W(r,I-1)+"*"+m(e===47?e:T())}function te(e){while(!X(U()))T();return W(e,I)}function ue(e){return Z(ie("",null,null,null,[""],e=Y(e),0,[0],e))}function ie(e,r,a,n,c,s,t,u,i){var f=0;var o=0;var l=t;var v=0;var p=0;var h=0;var b=1;var w=1;var d=1;var g=0;var k="";var x=c;var y=s;var j=n;var z=k;while(w)switch(h=g,g=T()){case 40:if(h!=108&&A(z,l-1)==58){if(O(z+=C(_(g),"&","&\f"),"&\f",$(f?u[f-1]:0))!=-1)d=-1;break}case 34:case 39:case 91:z+=_(g);break;case 9:case 10:case 13:case 32:z+=re(h);break;case 92:z+=ne(V()-1,7);continue;case 47:switch(U()){case 42:case 47:B(oe(se(T(),V()),r,a,i),i);break;default:z+="/";}break;case 123*b:u[f++]=S(z)*d;case 125*b:case 59:case 0:switch(g){case 0:case 125:w=0;case 59+o:if(d==-1)z=C(z,/\f/g,"");if(p>0&&S(z)-l)B(p>32?le(z+";",n,a,l-1,i):le(C(z," ","")+";",n,a,l-2,i),i);break;case 59:z+=";";default:B(j=fe(z,r,a,f,o,c,u,k,x=[],y=[],l,s),s);if(g===123)if(o===0)ie(z,r,j,j,x,s,l,u,y);else switch(v===99&&A(z,3)===110?100:v){case 100:case 108:case 109:case 115:ie(e,j,j,n&&B(fe(e,j,j,0,0,c,u,k,c,x=[],l,y),y),c,y,l,u,n?x:y);break;default:ie(z,j,j,j,[""],y,0,u,y);}}f=o=p=0,b=d=1,k=z="",l=t;break;case 58:l=1+S(z),p=h;default:if(b<1)if(g==123)--b;else if(g==125&&b++==0&&R()==125)continue;switch(z+=m(g),g*b){case 38:d=o>0?1:(z+="\f",-1);break;case 44:u[f++]=(S(z)-1)*d,d=1;break;case 64:if(U()===45)z+=_(T());v=U(),o=l=S(k=z+=te(V())),g++;break;case 45:if(h===45&&S(z)==2)b=0;}}return s}function fe(e,r,a,n,s,t,u,i,f,o,l,v){var p=s-1;var h=s===0?t:[""];var b=q(h);for(var w=0,d=0,g=0;w<n;++w)for(var k=0,m=M(e,p+1,p=$(d=u[w])),x=e;k<b;++k)if(x=j(d>0?h[k]+" "+m:C(m,/&\f/g,h[k])))f[g++]=x;return L(e,r,a,s===0?c:i,f,o,l,v)}function oe(e,r,a,c){return L(e,r,a,n,m(Q()),M(e,2,-2),0,c)}function le(e,r,a,n,c){return L(e,r,a,s,M(e,0,n),M(e,n+1,-1),n,c)}function ve(n,c,s){switch(y(n,c)){case 5103:return a+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+n+n;case 4789:return r+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return a+n+r+n+e+n+n;case 5936:switch(A(n,c+11)){case 114:return a+n+e+C(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return a+n+e+C(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return a+n+e+C(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return a+n+e+n+n;case 6165:return a+n+e+"flex-"+n+n;case 5187:return a+n+C(n,/(\w+).+(:[^]+)/,a+"box-$1$2"+e+"flex-$1$2")+n;case 5443:return a+n+e+"flex-item-"+C(n,/flex-|-self/g,"")+(!z(n,/flex-|baseline/)?e+"grid-row-"+C(n,/flex-|-self/g,""):"")+n;case 4675:return a+n+e+"flex-line-pack"+C(n,/align-content|flex-|-self/g,"")+n;case 5548:return a+n+e+C(n,"shrink","negative")+n;case 5292:return a+n+e+C(n,"basis","preferred-size")+n;case 6060:return a+"box-"+C(n,"-grow","")+a+n+e+C(n,"grow","positive")+n;case 4554:return a+C(n,/([^-])(transform)/g,"$1"+a+"$2")+n;case 6187:return C(C(C(n,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),n,"")+n;case 5495:case 3959:return C(n,/(image-set\([^]*)/,a+"$1"+"$`$1");case 4968:return C(C(n,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+n+n;case 4200:if(!z(n,/flex-|baseline/))return e+"grid-column-align"+M(n,c)+n;break;case 2592:case 3360:return e+C(n,"template-","")+n;case 4384:case 3616:if(s&&s.some((function(e,r){return c=r,z(e.props,/grid-\w+-end/)}))){return ~O(n+(s=s[c].value),"span",0)?n:e+C(n,"-start","")+n+e+"grid-row-span:"+(~O(s,"span",0)?z(s,/\d+/):+z(s,/\d+/)-+z(n,/\d+/))+";"}return e+C(n,"-start","")+n;case 4896:case 4128:return s&&s.some((function(e){return z(e.props,/grid-\w+-start/)}))?n:e+C(C(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return C(n,/(.+)-inline(.+)/,a+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(S(n)-1-c>6)switch(A(n,c+1)){case 109:if(A(n,c+4)!==45)break;case 102:return C(n,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3"+"$1"+r+(A(n,c+3)==108?"$3":"$2-$3"))+n;case 115:return ~O(n,"stretch",0)?ve(C(n,"stretch","fill-available"),c,s)+n:n}break;case 5152:case 5920:return C(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(r,a,c,s,t,u,i){return e+a+":"+c+i+(s?e+a+"-span:"+(t?u:+u-+c)+i:"")+n}));case 4949:if(A(n,c+6)===121)return C(n,":",":"+a)+n;break;case 6444:switch(A(n,A(n,14)===45?18:11)){case 120:return C(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+a+(A(n,14)===45?"inline-":"")+"box$3"+"$1"+a+"$2$3"+"$1"+e+"$2box$3")+n;case 100:return C(n,":",":"+e)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return C(n,"scroll-","scroll-snap-")+n}return n}function pe(e,r){var a="";for(var n=0;n<e.length;n++)a+=r(e[n],n,e,r)||"";return a}function he(e,r,a,t){switch(e.type){case g:if(e.children.length)break;case i:case s:return e.return=e.return||e.value;case n:return "";case h:return e.return=e.value+"{"+pe(e.children,t)+"}";case c:if(!S(e.value=e.props.join(",")))return ""}return S(a=pe(e.children,t))?e.return=e.value+"{"+a+"}":""}function be(e){var r=q(e);return function(a,n,c,s){var t="";for(var u=0;u<r;u++)t+=e[u](a,n,c,s)||"";return t}}function we(e){return function(r){if(!r.root)if(r=r.return)e(r);}}function de(n,t,u,i){if(n.length>-1)if(!n.return)switch(n.type){case s:n.return=ve(n.value,n.length,u);return;case h:return pe([N(n,{value:C(n.value,"@","@"+a)})],i);case c:if(n.length)return D(u=n.props,(function(c){switch(z(c,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(N(n,{props:[C(c,/:(read-\w+)/,":"+r+"$1")]}));P(N(n,{props:[c]}));x(n,{props:E(u,i)});break;case"::placeholder":P(N(n,{props:[C(c,/:(plac\w+)/,":"+a+"input-$1")]}));P(N(n,{props:[C(c,/:(plac\w+)/,":"+r+"$1")]}));P(N(n,{props:[C(c,/:(plac\w+)/,e+"input-$1")]}));P(N(n,{props:[c]}));x(n,{props:E(u,i)});break}return ""}))}}
|
4054
|
-
|
4055
|
-
var unitlessKeys = {
|
4056
|
-
animationIterationCount: 1,
|
4057
|
-
aspectRatio: 1,
|
4058
|
-
borderImageOutset: 1,
|
4059
|
-
borderImageSlice: 1,
|
4060
|
-
borderImageWidth: 1,
|
4061
|
-
boxFlex: 1,
|
4062
|
-
boxFlexGroup: 1,
|
4063
|
-
boxOrdinalGroup: 1,
|
4064
|
-
columnCount: 1,
|
4065
|
-
columns: 1,
|
4066
|
-
flex: 1,
|
4067
|
-
flexGrow: 1,
|
4068
|
-
flexPositive: 1,
|
4069
|
-
flexShrink: 1,
|
4070
|
-
flexNegative: 1,
|
4071
|
-
flexOrder: 1,
|
4072
|
-
gridRow: 1,
|
4073
|
-
gridRowEnd: 1,
|
4074
|
-
gridRowSpan: 1,
|
4075
|
-
gridRowStart: 1,
|
4076
|
-
gridColumn: 1,
|
4077
|
-
gridColumnEnd: 1,
|
4078
|
-
gridColumnSpan: 1,
|
4079
|
-
gridColumnStart: 1,
|
4080
|
-
msGridRow: 1,
|
4081
|
-
msGridRowSpan: 1,
|
4082
|
-
msGridColumn: 1,
|
4083
|
-
msGridColumnSpan: 1,
|
4084
|
-
fontWeight: 1,
|
4085
|
-
lineHeight: 1,
|
4086
|
-
opacity: 1,
|
4087
|
-
order: 1,
|
4088
|
-
orphans: 1,
|
4089
|
-
tabSize: 1,
|
4090
|
-
widows: 1,
|
4091
|
-
zIndex: 1,
|
4092
|
-
zoom: 1,
|
4093
|
-
WebkitLineClamp: 1,
|
4094
|
-
// SVG-related properties
|
4095
|
-
fillOpacity: 1,
|
4096
|
-
floodOpacity: 1,
|
4097
|
-
stopOpacity: 1,
|
4098
|
-
strokeDasharray: 1,
|
4099
|
-
strokeDashoffset: 1,
|
4100
|
-
strokeMiterlimit: 1,
|
4101
|
-
strokeOpacity: 1,
|
4102
|
-
strokeWidth: 1
|
4103
|
-
};
|
4104
|
-
|
4105
|
-
var f="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",m$1="active",y$1="data-styled-version",v="6.1.11",g$1="/*!sc*/\n",S$1="undefined"!=typeof window&&"HTMLElement"in window,w=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),E$1=/invalid hook call/i,N$1=new Set,P$1=function(t,n){if("production"!==process.env.NODE_ENV){var o=n?' with the id of "'.concat(n,'"'):"",s="The component ".concat(t).concat(o," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",i=console.error;try{var a=!0;console.error=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];E$1.test(t)?(a=!1,N$1.delete(s)):i.apply(void 0,__spreadArray([t],n,!1));},React.useRef(),a&&!N$1.has(s)&&(console.warn(s),N$1.add(s));}catch(e){E$1.test(e.message)&&N$1.delete(s);}finally{console.error=i;}}},_$1=Object.freeze([]),C$1=Object.freeze({});function I$1(e,t,n){return void 0===n&&(n=C$1),e.theme!==n.theme&&e.theme||t||n.theme}var A$1=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),O$1=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,D$1=/(^-|-$)/g;function R$1(e){return e.replace(O$1,"-").replace(D$1,"")}var T$1=/(a)(d)/gi,k=52,j$1=function(e){return String.fromCharCode(e+(e>25?39:97))};function x$1(e){var t,n="";for(t=Math.abs(e);t>k;t=t/k|0)n=j$1(t%k)+n;return (j$1(t%k)+n).replace(T$1,"$1-$2")}var V$1,F$1=5381,M$1=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},$$1=function(e){return M$1(F$1,e)};function z$1(e){return x$1($$1(e)>>>0)}function B$1(e){return "production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function L$1(e){return "string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var G$1="function"==typeof Symbol&&Symbol.for,Y$1=G$1?Symbol.for("react.memo"):60115,W$1=G$1?Symbol.for("react.forward_ref"):60112,q$1={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},H$1={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},U$1={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},J$1=((V$1={})[W$1]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},V$1[Y$1]=U$1,V$1);function X$1(e){return ("type"in(t=e)&&t.type.$$typeof)===Y$1?U$1:"$$typeof"in e?J$1[e.$$typeof]:q$1;var t;}var Z$1=Object.defineProperty,K$1=Object.getOwnPropertyNames,Q$1=Object.getOwnPropertySymbols,ee=Object.getOwnPropertyDescriptor,te$1=Object.getPrototypeOf,ne$1=Object.prototype;function oe$1(e,t,n){if("string"!=typeof t){if(ne$1){var o=te$1(t);o&&o!==ne$1&&oe$1(e,o,n);}var r=K$1(t);Q$1&&(r=r.concat(Q$1(t)));for(var s=X$1(e),i=X$1(t),a=0;a<r.length;++a){var c=r[a];if(!(c in H$1||n&&n[c]||i&&c in i||s&&c in s)){var l=ee(t,c);try{Z$1(e,c,l);}catch(e){}}}}return e}function re$1(e){return "function"==typeof e}function se$1(e){return "object"==typeof e&&"styledComponentId"in e}function ie$1(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function ae(e,t){if(0===e.length)return "";for(var n=e[0],o=1;o<e.length;o++)n+=t?t+e[o]:e[o];return n}function ce$1(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function le$1(e,t,n){if(void 0===n&&(n=!1),!n&&!ce$1(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var o=0;o<t.length;o++)e[o]=le$1(e[o],t[o]);else if(ce$1(t))for(var o in t)e[o]=le$1(e[o],t[o]);return e}function ue$1(e,t){Object.defineProperty(e,"toString",{value:t});}var pe$1="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function de$1(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],o=[],r=1,s=e.length;r<s;r+=1)o.push(e[r]);return o.forEach(function(e){n=n.replace(/%[a-z]/,e);}),n}function he$1(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return "production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(de$1.apply(void 0,__spreadArray([pe$1[t]],n,!1)).trim())}var fe$1=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,r=o;e>=r;)if((r<<=1)<0)throw he$1(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var s=o;s<r;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++);},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),o=n+t;this.groupSizes[e]=0;for(var r=n;r<o;r++)this.tag.deleteRule(n);}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],o=this.indexOfGroup(e),r=o+n,s=o;s<r;s++)t+="".concat(this.tag.getRule(s)).concat(g$1);return t},e}(),me=1<<30,ye=new Map,ve$1=new Map,ge=1,Se=function(e){if(ye.has(e))return ye.get(e);for(;ve$1.has(ge);)ge++;var t=ge++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>me))throw he$1(16,"".concat(t));return ye.set(e,t),ve$1.set(t,e),t},we$1=function(e,t){ge=t+1,ye.set(e,t),ve$1.set(t,e);},be$1="style[".concat(f,"][").concat(y$1,'="').concat(v,'"]'),Ee=new RegExp("^".concat(f,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Ne=function(e,t,n){for(var o,r=n.split(","),s=0,i=r.length;s<i;s++)(o=r[s])&&e.registerName(t,o);},Pe=function(e,t){for(var n,o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(g$1),r=[],s=0,i=o.length;s<i;s++){var a=o[s].trim();if(a){var c=a.match(Ee);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(we$1(u,l),Ne(e,u,c[3]),e.getTag().insertRules(l,r)),r.length=0;}else r.push(a);}}};function _e(){return "undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null}var Ce=function(e){var t=document.head,n=e||t,o=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(f,"]")));return t[t.length-1]}(n),s=void 0!==r?r.nextSibling:null;o.setAttribute(f,m$1),o.setAttribute(y$1,v);var i=_e();return i&&o.setAttribute("nonce",i),n.insertBefore(o,s),o},Ie=function(){function e(e){this.element=Ce(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,o=t.length;n<o;n++){var r=t[n];if(r.ownerNode===e)return r}throw he$1(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return !1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Ae=function(){function e(e){this.element=Ce(e),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Oe=function(){function e(e){this.rules=[],this.length=0;}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--;},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),De=S$1,Re={isServer:!S$1,useCSSOMInjection:!w},Te=function(){function e(e,n,o){void 0===e&&(e=C$1),void 0===n&&(n={});var r=this;this.options=__assign(__assign({},Re),e),this.gs=n,this.names=new Map(o),this.server=!!e.isServer,!this.server&&S$1&&De&&(De=!1,function(e){for(var t=document.querySelectorAll(be$1),n=0,o=t.length;n<o;n++){var r=t[n];r&&r.getAttribute(f)!==m$1&&(Pe(e,r),r.parentNode&&r.parentNode.removeChild(r));}}(this)),ue$1(this,function(){return function(e){for(var t=e.getTag(),n=t.length,o="",r=function(n){var r=function(e){return ve$1.get(e)}(n);if(void 0===r)return "continue";var s=e.names.get(r),i=t.getGroup(n);if(void 0===s||0===i.length)return "continue";var a="".concat(f,".g").concat(n,'[id="').concat(r,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","));}),o+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat(g$1);},s=0;s<n;s++)r(s);return o}(r)});}return e.registerId=function(e){return Se(e)},e.prototype.reconstructWithOptions=function(n,o){return void 0===o&&(o=!0),new e(__assign(__assign({},this.options),n),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Oe(n):t?new Ie(n):new Ae(n)}(this.options),new fe$1(e)));var e;},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(Se(e),this.names.has(e))this.names.get(e).add(t);else {var n=new Set;n.add(t),this.names.set(e,n);}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(Se(e),n);},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},e.prototype.clearRules=function(e){this.getTag().clearGroup(Se(e)),this.clearNames(e);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),ke=/&/g,je=/^\s*\/\/.*$/gm;function xe(e,t){return e.map(function(e){return "rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return "".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=xe(e.children,t)),e})}function Ve(e){var t,n,o,r=void 0===e?C$1:e,s=r.options,i=void 0===s?C$1:s,a=r.plugins,c$1=void 0===a?_$1:a,l=function(e,o,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},u=c$1.slice();u.push(function(e){e.type===c&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(ke,n).replace(o,l));}),i.prefix&&u.push(de),u.push(he);var p=function(e,r,s,a){void 0===r&&(r=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=r,o=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(je,""),l=ue(s||r?"".concat(s," ").concat(r," { ").concat(c," }"):c);i.namespace&&(l=xe(l,i.namespace));var p=[];return pe(l,be(u.concat(we(function(e){return p.push(e)})))),p};return p.hash=c$1.length?c$1.reduce(function(e,t){return t.name||he$1(15),M$1(e,t.name)},F$1).toString():"",p}var Fe=new Te,Me=Ve(),$e=React__default.createContext({shouldForwardProp:void 0,styleSheet:Fe,stylis:Me}),Be=React__default.createContext(void 0);function Le(){return React.useContext($e)}var Ye=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Me);var o=n.name+t.hash;e.hasNameForId(n.id,o)||e.insertRules(n.id,o,t(n.rules,o,"@keyframes"));},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,ue$1(this,function(){throw he$1(12,String(n.name))});}return e.prototype.getName=function(e){return void 0===e&&(e=Me),this.name+e.hash},e}(),We=function(e){return e>="A"&&e<="Z"};function qe(e){for(var t="",n=0;n<e.length;n++){var o=e[n];if(1===n&&"-"===o&&"-"===e[0])return e;We(o)?t+="-"+o.toLowerCase():t+=o;}return t.startsWith("ms-")?"-"+t:t}var He=function(e){return null==e||!1===e||""===e},Ue=function(t){var n,o,r=[];for(var s in t){var i=t[s];t.hasOwnProperty(s)&&!He(i)&&(Array.isArray(i)&&i.isCss||re$1(i)?r.push("".concat(qe(s),":"),i,";"):ce$1(i)?r.push.apply(r,__spreadArray(__spreadArray(["".concat(s," {")],Ue(i),!1),["}"],!1)):r.push("".concat(qe(s),": ").concat((n=s,null==(o=i)||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in unitlessKeys||n.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function Je(e,t,n,o){if(He(e))return [];if(se$1(e))return [".".concat(e.styledComponentId)];if(re$1(e)){if(!re$1(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return [e];var r=e(t);return "production"===process.env.NODE_ENV||"object"!=typeof r||Array.isArray(r)||r instanceof Ye||ce$1(r)||null===r||console.error("".concat(B$1(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Je(r,t,n,o)}var s;return e instanceof Ye?n?(e.inject(n,o),[e.getName(o)]):[e]:ce$1(e)?Ue(e):Array.isArray(e)?Array.prototype.concat.apply(_$1,e.map(function(e){return Je(e,t,n,o)})):[e.toString()]}function Xe(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(re$1(n)&&!se$1(n))return !1}return !0}var Ze=$$1(v),Ke=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&Xe(e),this.componentId=t,this.baseHash=M$1(Ze,t),this.baseStyle=n,Te.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))o=ie$1(o,this.staticRulesId);else {var r=ae(Je(this.rules,e,t,n)),s=x$1(M$1(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(r,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i);}o=ie$1(o,s),this.staticRulesId=s;}else {for(var a=M$1(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u,"production"!==process.env.NODE_ENV&&(a=M$1(a,u));else if(u){var p=ae(Je(u,e,t,n));a=M$1(a,p+l),c+=p;}}if(c){var d=x$1(a>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),o=ie$1(o,d);}}return o},e}(),Qe=React__default.createContext(void 0);var ot={},rt=new Set;function st(e,r,s){var i=se$1(e),a=e,c=!L$1(e),p=r.attrs,d=void 0===p?_$1:p,h=r.componentId,f=void 0===h?function(e,t){var n="string"!=typeof e?"sc":R$1(e);ot[n]=(ot[n]||0)+1;var o="".concat(n,"-").concat(z$1(v+n+ot[n]));return t?"".concat(t,"-").concat(o):o}(r.displayName,r.parentComponentId):h,m=r.displayName,y=void 0===m?function(e){return L$1(e)?"styled.".concat(e):"Styled(".concat(B$1(e),")")}(e):m,g=r.displayName&&r.componentId?"".concat(R$1(r.displayName),"-").concat(r.componentId):r.componentId||f,S=i&&a.attrs?a.attrs.concat(d).filter(Boolean):d,w=r.shouldForwardProp;if(i&&a.shouldForwardProp){var b=a.shouldForwardProp;if(r.shouldForwardProp){var E=r.shouldForwardProp;w=function(e,t){return b(e,t)&&E(e,t)};}else w=b;}var N=new Ke(s,g,i?a.componentStyle:void 0);function O(e,r){return function(e,r,s){var i=e.attrs,a=e.componentStyle,c=e.defaultProps,p=e.foldedComponentIds,d=e.styledComponentId,h=e.target,f=React__default.useContext(Qe),m=Le(),y=e.shouldForwardProp||m.shouldForwardProp;"production"!==process.env.NODE_ENV&&React.useDebugValue(d);var v=I$1(r,f,c)||C$1,g=function(e,n,o){for(var r,s=__assign(__assign({},n),{className:void 0,theme:o}),i=0;i<e.length;i+=1){var a=re$1(r=e[i])?r(s):r;for(var c in a)s[c]="className"===c?ie$1(s[c],a[c]):"style"===c?__assign(__assign({},s[c]),a[c]):a[c];}return n.className&&(s.className=ie$1(s.className,n.className)),s}(i,r,v),S=g.as||h,w={};for(var b in g)void 0===g[b]||"$"===b[0]||"as"===b||"theme"===b&&g.theme===v||("forwardedAs"===b?w.as=g.forwardedAs:y&&!y(b,S)||(w[b]=g[b],y||"development"!==process.env.NODE_ENV||isPropValid(b)||rt.has(b)||!A$1.has(S)||(rt.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var E=function(e,t){var n=Le(),o=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return "production"!==process.env.NODE_ENV&&React.useDebugValue(o),o}(a,g);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(E);var N=ie$1(p,d);return E&&(N+=" "+E),g.className&&(N+=" "+g.className),w[L$1(S)&&!A$1.has(S)?"class":"className"]=N,w.ref=s,React.createElement(S,w)}(D,e,r)}O.displayName=y;var D=React__default.forwardRef(O);return D.attrs=S,D.componentStyle=N,D.displayName=y,D.shouldForwardProp=w,D.foldedComponentIds=i?ie$1(a.foldedComponentIds,a.styledComponentId):"",D.styledComponentId=g,D.target=i?a.target:e,Object.defineProperty(D,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var o=0,r=t;o<r.length;o++)le$1(e,r[o],!0);return e}({},a.defaultProps,e):e;}}),"production"!==process.env.NODE_ENV&&(P$1(y,g),D.warnTooManyClasses=function(e,t){var n={},o=!1;return function(r){if(!o&&(n[r]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),o=!0,n={};}}}(y,g)),ue$1(D,function(){return ".".concat(D.styledComponentId)}),c&&oe$1(D,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),D}function it(e,t){for(var n=[e[0]],o=0,r=t.length;o<r;o+=1)n.push(t[o],e[o+1]);return n}var at=function(e){return Object.assign(e,{isCss:!0})};function ct(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(re$1(t)||ce$1(t))return at(Je(it(_$1,__spreadArray([t],n,!0))));var r=t;return 0===n.length&&1===r.length&&"string"==typeof r[0]?Je(r):at(Je(it(r,n)))}function lt(n,o,r){if(void 0===r&&(r=C$1),!o)throw he$1(1,o);var s=function(t){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return n(o,r,ct.apply(void 0,__spreadArray([t],s,!1)))};return s.attrs=function(e){return lt(n,o,__assign(__assign({},r),{attrs:Array.prototype.concat(r.attrs,e).filter(Boolean)}))},s.withConfig=function(e){return lt(n,o,__assign(__assign({},r),e))},s}var ut=function(e){return lt(st,e)},pt=ut;A$1.forEach(function(e){pt[e]=ut(e);});function ft(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var r=ae(ct.apply(void 0,__spreadArray([t],n,!1))),s=z$1(r);return new Ye(s,r)}"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var gt="__sc-".concat(f,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[gt]||(window[gt]=0),1===window[gt]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[gt]+=1);
|
4106
|
-
|
4107
|
-
var _templateObject, _templateObject2;
|
4108
|
-
var l5 = ft(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n 0% {box-shadow: 20px 0 #000, -20px 0 #0002; background: #000 }\n 33% {box-shadow: 20px 0 #000, -20px 0 #0002; background: #0002}\n 66% {box-shadow: 20px 0 #0002, -20px 0 #000; background: #0002}\n 100% {box-shadow: 20px 0 #0002, -20px 0 #000; background: #000 }\n"])));
|
4109
|
-
var LoaderDiv = pt.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n width: 12px;\n aspect-ratio: 1;\n border-radius: 50%;\n animation: ", " 1s infinite linear alternate;\n"])), l5);
|
4110
|
-
var Loader = function Loader() {
|
4111
|
-
return React__default.createElement(LoaderDiv, null);
|
4112
|
-
};
|
4113
|
-
|
4114
|
-
var PredefinedQuestions = function PredefinedQuestions(_ref) {
|
4115
|
-
var questions = _ref.questions,
|
4116
|
-
onSelect = _ref.onSelect,
|
4117
|
-
chatBubbleConfig = _ref.chatBubbleConfig;
|
4455
|
+
var ChatHeader = function ChatHeader(_ref) {
|
4456
|
+
var _chatBubbleConfig$col;
|
4457
|
+
var chatBubbleConfig = _ref.chatBubbleConfig,
|
4458
|
+
isLoading = _ref.isLoading,
|
4459
|
+
isOnline = _ref.isOnline;
|
4118
4460
|
return React.createElement("div", {
|
4461
|
+
className: styles['chat-header'],
|
4119
4462
|
style: {
|
4120
|
-
|
4121
|
-
|
4122
|
-
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
4463
|
+
backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
|
4464
|
+
borderTopLeftRadius: 8,
|
4465
|
+
borderTopRightRadius: 8,
|
4466
|
+
display: 'flex',
|
4467
|
+
flexDirection: 'column',
|
4468
|
+
justifyContent: 'space-between',
|
4469
|
+
paddingInline: 15,
|
4470
|
+
paddingBlock: 15
|
4126
4471
|
}
|
4127
4472
|
}, React.createElement("div", {
|
4128
4473
|
style: {
|
4129
4474
|
display: 'flex',
|
4130
|
-
|
4475
|
+
justifyContent: 'flex-start',
|
4476
|
+
alignItems: 'center'
|
4131
4477
|
}
|
4132
4478
|
}, React.createElement("div", {
|
4133
4479
|
style: {
|
4480
|
+
alignItems: 'center',
|
4134
4481
|
display: 'flex',
|
4135
|
-
|
4482
|
+
color: '#fff',
|
4483
|
+
fontWeight: 'bold'
|
4136
4484
|
}
|
4137
4485
|
}, React.createElement(Avatar, {
|
4138
|
-
borderColor: '
|
4139
|
-
|
4140
|
-
|
4486
|
+
borderColor: 'transparent',
|
4487
|
+
indicator: isOnline ? 'green' : '#dedede',
|
4488
|
+
width: '50px',
|
4489
|
+
height: '50px',
|
4141
4490
|
source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
|
4142
|
-
}), React.createElement("
|
4491
|
+
})), React.createElement("div", {
|
4143
4492
|
style: {
|
4144
|
-
|
4493
|
+
display: 'flex',
|
4494
|
+
flexDirection: 'column',
|
4495
|
+
textAlign: 'left',
|
4496
|
+
paddingLeft: '10px',
|
4497
|
+
justifyContent: 'flex-end',
|
4498
|
+
color: '#fff',
|
4499
|
+
width: '100%'
|
4145
4500
|
}
|
4146
|
-
},
|
4501
|
+
}, React.createElement("span", {
|
4147
4502
|
style: {
|
4148
|
-
|
4149
|
-
|
4150
|
-
width: 300,
|
4151
|
-
marginLeft: 15,
|
4152
|
-
marginTop: 5,
|
4153
|
-
borderTopRightRadius: 20,
|
4154
|
-
borderBottomRightRadius: 20,
|
4155
|
-
borderBottomLeftRadius: 20
|
4503
|
+
fontWeight: 'bold',
|
4504
|
+
fontSize: 18
|
4156
4505
|
}
|
4157
|
-
}, React.createElement("
|
4506
|
+
}, chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title), isLoading ? React.createElement("span", {
|
4158
4507
|
style: {
|
4159
|
-
fontSize: '
|
4160
|
-
paddingLeft: 10
|
4161
|
-
}
|
4162
|
-
}, "Are you looking for answers to any of these questions? Click for an answer "))), questions.map(function (question, index) {
|
4163
|
-
var _chatBubbleConfig$col;
|
4164
|
-
return React.createElement("div", {
|
4165
|
-
key: index,
|
4166
|
-
style: {
|
4167
|
-
backgroundColor: '#fafafa',
|
4168
|
-
border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
|
4169
|
-
fontSize: '16px',
|
4170
|
-
margin: '7px',
|
4171
|
-
textAlign: 'start',
|
4172
|
-
padding: '14px',
|
4173
|
-
borderRadius: '16px',
|
4174
|
-
cursor: 'pointer'
|
4175
|
-
},
|
4176
|
-
onClick: function onClick() {
|
4177
|
-
onSelect(question);
|
4178
|
-
}
|
4179
|
-
}, question.question);
|
4180
|
-
}));
|
4181
|
-
};
|
4182
|
-
|
4183
|
-
var AiFollowUps = function AiFollowUps(_ref) {
|
4184
|
-
var questions = _ref.questions,
|
4185
|
-
onSelect = _ref.onSelect,
|
4186
|
-
chatBubbleConfig = _ref.chatBubbleConfig;
|
4187
|
-
return React.createElement("div", {
|
4188
|
-
style: {
|
4189
|
-
height: '100%',
|
4190
|
-
color: '#000',
|
4191
|
-
padding: 10,
|
4192
|
-
borderRadius: '6px',
|
4193
|
-
marginBottom: '20px'
|
4194
|
-
}
|
4195
|
-
}, questions.map(function (question, index) {
|
4196
|
-
var _chatBubbleConfig$col;
|
4197
|
-
return React.createElement("div", {
|
4198
|
-
key: index,
|
4199
|
-
style: {
|
4200
|
-
backgroundColor: '#fafafa',
|
4201
|
-
border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
|
4202
|
-
fontSize: '16px',
|
4203
|
-
margin: '7px',
|
4204
|
-
textAlign: 'start',
|
4205
|
-
padding: '14px',
|
4206
|
-
borderRadius: '15px',
|
4207
|
-
cursor: 'pointer'
|
4208
|
-
},
|
4209
|
-
onClick: function onClick() {
|
4210
|
-
onSelect(question);
|
4211
|
-
}
|
4212
|
-
}, question.question);
|
4213
|
-
}));
|
4214
|
-
};
|
4215
|
-
|
4216
|
-
var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
4217
|
-
var _chatBubbleConfig$col, _chatBubbleConfig$col2;
|
4218
|
-
var _useBiBotChatBot = useBiBotChatBot(bibotProps),
|
4219
|
-
chatIsOpen = _useBiBotChatBot.chatIsOpen,
|
4220
|
-
messages = _useBiBotChatBot.messages,
|
4221
|
-
isLoading = _useBiBotChatBot.isLoading,
|
4222
|
-
messageEndRef = _useBiBotChatBot.messageEndRef,
|
4223
|
-
userInput = _useBiBotChatBot.userInput,
|
4224
|
-
handleUserInput = _useBiBotChatBot.handleUserInput,
|
4225
|
-
handleKeyPress = _useBiBotChatBot.handleKeyPress,
|
4226
|
-
sendInputInquiry = _useBiBotChatBot.sendInputInquiry,
|
4227
|
-
toggleChat = _useBiBotChatBot.toggleChat,
|
4228
|
-
chatBubbleConfig = _useBiBotChatBot.chatBubbleConfig,
|
4229
|
-
showPredefinedQuestions = _useBiBotChatBot.showPredefinedQuestions,
|
4230
|
-
predefinedQuestions = _useBiBotChatBot.predefinedQuestions,
|
4231
|
-
aiFollowUpQs = _useBiBotChatBot.aiFollowUpQs,
|
4232
|
-
handlePredefinedQuestionSelect = _useBiBotChatBot.handlePredefinedQuestionSelect;
|
4233
|
-
var isOnline = useOnlineStatus();
|
4234
|
-
var greeting = chatBubbleConfig !== null && chatBubbleConfig !== void 0 && chatBubbleConfig.knownUser ? "Hi, " + chatBubbleConfig.knownUser + "! How can I help you today?" : 'Hello! How can I help you today?';
|
4235
|
-
var _React$useState = React.useState(true),
|
4236
|
-
isGreetingVisible = _React$useState[0],
|
4237
|
-
setGreetingVisible = _React$useState[1];
|
4238
|
-
var handleCloseGreeting = function handleCloseGreeting() {
|
4239
|
-
setGreetingVisible(false);
|
4240
|
-
};
|
4241
|
-
return React.createElement("div", {
|
4242
|
-
className: "chat-bubble " + (chatIsOpen ? 'open' : ''),
|
4243
|
-
style: {
|
4244
|
-
position: 'fixed',
|
4245
|
-
bottom: '20px',
|
4246
|
-
right: '20px',
|
4247
|
-
zIndex: 9999
|
4248
|
-
}
|
4249
|
-
}, chatIsOpen && React.createElement("div", {
|
4250
|
-
style: {
|
4251
|
-
backgroundColor: '#fff',
|
4252
|
-
position: 'absolute',
|
4253
|
-
bottom: '60px',
|
4254
|
-
right: '25px',
|
4255
|
-
width: 370,
|
4256
|
-
height: 550,
|
4257
|
-
borderRadius: 10,
|
4258
|
-
display: 'flex',
|
4259
|
-
flexDirection: 'column',
|
4260
|
-
justifyContent: 'space-between',
|
4261
|
-
boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)'
|
4262
|
-
}
|
4263
|
-
}, React.createElement("div", {
|
4264
|
-
className: styles['chat-header'],
|
4265
|
-
style: {
|
4266
|
-
backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
|
4267
|
-
borderTopLeftRadius: 8,
|
4268
|
-
borderTopRightRadius: 8,
|
4269
|
-
display: 'flex',
|
4270
|
-
flexDirection: 'column',
|
4271
|
-
justifyContent: 'space-between',
|
4272
|
-
paddingInline: 15,
|
4273
|
-
paddingBlock: 15
|
4274
|
-
}
|
4275
|
-
}, React.createElement("div", {
|
4276
|
-
style: {
|
4277
|
-
display: 'flex',
|
4278
|
-
justifyContent: 'flex-start',
|
4279
|
-
alignItems: 'center'
|
4280
|
-
}
|
4281
|
-
}, React.createElement("div", {
|
4282
|
-
style: {
|
4283
|
-
alignItems: 'center',
|
4284
|
-
display: 'flex',
|
4285
|
-
color: '#fff',
|
4286
|
-
fontWeight: 'bold'
|
4287
|
-
}
|
4288
|
-
}, React.createElement(Avatar, {
|
4289
|
-
borderColor: 'transparent',
|
4290
|
-
indicator: isOnline ? 'green' : '#dedede',
|
4291
|
-
width: '70px',
|
4292
|
-
height: '70px',
|
4293
|
-
source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
|
4294
|
-
})), React.createElement("div", {
|
4295
|
-
style: {
|
4296
|
-
display: 'flex',
|
4297
|
-
flexDirection: 'column',
|
4298
|
-
textAlign: 'left',
|
4299
|
-
paddingLeft: '10px',
|
4300
|
-
justifyContent: 'flex-end',
|
4301
|
-
color: '#fff',
|
4302
|
-
width: '100%'
|
4303
|
-
}
|
4304
|
-
}, React.createElement("span", {
|
4305
|
-
style: {
|
4306
|
-
fontWeight: 'bold',
|
4307
|
-
fontSize: 18
|
4308
|
-
}
|
4309
|
-
}, chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title), isLoading ? React.createElement("span", {
|
4310
|
-
style: {
|
4311
|
-
fontSize: '12px'
|
4508
|
+
fontSize: '12px'
|
4312
4509
|
}
|
4313
4510
|
}, "Typing...") : React.createElement("div", {
|
4314
4511
|
style: {
|
@@ -4332,21 +4529,191 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4332
4529
|
paddingRight: 10,
|
4333
4530
|
color: '#dedede'
|
4334
4531
|
}
|
4335
|
-
}, !chatBubbleConfig.title ? 'Bot' : chatBubbleConfig.title, " can make mistake
|
4336
|
-
|
4532
|
+
}, !(chatBubbleConfig !== null && chatBubbleConfig !== void 0 && chatBubbleConfig.title) ? 'Bot' : chatBubbleConfig.title, " can make mistake", ' ')));
|
4533
|
+
};
|
4534
|
+
|
4535
|
+
var MarkdownView = function MarkdownView(_ref) {
|
4536
|
+
var content = _ref.content;
|
4537
|
+
var parseContent = function parseContent(text) {
|
4538
|
+
var lines = text.split('\n');
|
4539
|
+
return lines.map(function (line) {
|
4540
|
+
if (/^#{1,6}\s/.test(line)) {
|
4541
|
+
var _line$match;
|
4542
|
+
var level = ((_line$match = line.match(/^#{1,6}/)) === null || _line$match === void 0 ? void 0 : _line$match[0].length) || 1;
|
4543
|
+
var headingText = line.replace(/^#{1,6}\s/, '');
|
4544
|
+
return {
|
4545
|
+
type: 'heading',
|
4546
|
+
content: headingText,
|
4547
|
+
level: level
|
4548
|
+
};
|
4549
|
+
}
|
4550
|
+
if (/^(\-{3,}|\*{3,}|_{3,})$/.test(line)) {
|
4551
|
+
return {
|
4552
|
+
type: 'horizontalRule',
|
4553
|
+
content: ''
|
4554
|
+
};
|
4555
|
+
}
|
4556
|
+
if (/^>\s/.test(line)) {
|
4557
|
+
var quoteText = line.replace(/^>\s/, '');
|
4558
|
+
return {
|
4559
|
+
type: 'blockquote',
|
4560
|
+
content: quoteText
|
4561
|
+
};
|
4562
|
+
}
|
4563
|
+
if (line.startsWith('```') && line.endsWith('```')) {
|
4564
|
+
var codeContent = line.slice(3, -3).trim();
|
4565
|
+
return {
|
4566
|
+
type: 'code',
|
4567
|
+
content: codeContent
|
4568
|
+
};
|
4569
|
+
}
|
4570
|
+
if (/`[^`]+`/.test(line)) {
|
4571
|
+
return {
|
4572
|
+
type: 'inlineCode',
|
4573
|
+
content: line.split(/(`[^`]+`)/).map(function (part, index) {
|
4574
|
+
return part.startsWith('`') && part.endsWith('`') ? React__default.createElement("code", {
|
4575
|
+
key: index
|
4576
|
+
}, part.slice(1, -1)) : part;
|
4577
|
+
})
|
4578
|
+
};
|
4579
|
+
}
|
4580
|
+
if (/\*\*\*[^*]+\*\*\*/.test(line)) {
|
4581
|
+
var _content = line.replace(/\*\*\*([^*]+)\*\*\*/g, '<strong><em>$1</em></strong>');
|
4582
|
+
return {
|
4583
|
+
type: 'text',
|
4584
|
+
content: _content
|
4585
|
+
};
|
4586
|
+
}
|
4587
|
+
if (/\*\*[^*]+\*\*/.test(line)) {
|
4588
|
+
var _content2 = line.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
|
4589
|
+
return {
|
4590
|
+
type: 'text',
|
4591
|
+
content: _content2
|
4592
|
+
};
|
4593
|
+
}
|
4594
|
+
if (/\*[^*]+\*/.test(line)) {
|
4595
|
+
var _content3 = line.replace(/\*([^*]+)\*/g, '<em>$1</em>');
|
4596
|
+
return {
|
4597
|
+
type: 'text',
|
4598
|
+
content: _content3
|
4599
|
+
};
|
4600
|
+
}
|
4601
|
+
if (/^\d+\.\s/.test(line)) {
|
4602
|
+
var listItem = line.replace(/^\d+\.\s/, '');
|
4603
|
+
return {
|
4604
|
+
type: 'orderedList',
|
4605
|
+
content: listItem
|
4606
|
+
};
|
4607
|
+
}
|
4608
|
+
if (/^(\s*[-*]\s+)/.test(line)) {
|
4609
|
+
var _listItem = line.replace(/^[-*]\s+/, '');
|
4610
|
+
return {
|
4611
|
+
type: 'unorderedList',
|
4612
|
+
content: _listItem
|
4613
|
+
};
|
4614
|
+
}
|
4615
|
+
if (/~~[^~]+~~/.test(line)) {
|
4616
|
+
var _content4 = line.replace(/~~([^~]+)~~/g, '<del>$1</del>');
|
4617
|
+
return {
|
4618
|
+
type: 'text',
|
4619
|
+
content: _content4
|
4620
|
+
};
|
4621
|
+
}
|
4622
|
+
if (/\[([^\]]+)\]\(([^)]+)\)/.test(line)) {
|
4623
|
+
var match = line.match(/\[([^\]]+)\]\(([^)]+)\)/);
|
4624
|
+
if (match) {
|
4625
|
+
return {
|
4626
|
+
type: 'link',
|
4627
|
+
content: React__default.createElement("a", {
|
4628
|
+
href: match[2],
|
4629
|
+
target: "_blank",
|
4630
|
+
rel: "noopener noreferrer"
|
4631
|
+
}, match[1])
|
4632
|
+
};
|
4633
|
+
}
|
4634
|
+
}
|
4635
|
+
if (/!\[([^\]]+)\]\(([^)]+)\)/.test(line)) {
|
4636
|
+
var _match = line.match(/!\[([^\]]+)\]\(([^)]+)\)/);
|
4637
|
+
if (_match) {
|
4638
|
+
return {
|
4639
|
+
type: 'image',
|
4640
|
+
content: React__default.createElement("img", {
|
4641
|
+
src: _match[2],
|
4642
|
+
alt: _match[1]
|
4643
|
+
})
|
4644
|
+
};
|
4645
|
+
}
|
4646
|
+
}
|
4647
|
+
return {
|
4648
|
+
type: 'text',
|
4649
|
+
content: line
|
4650
|
+
};
|
4651
|
+
});
|
4652
|
+
};
|
4653
|
+
var transformElements = function transformElements(parsed) {
|
4654
|
+
return parsed.map(function (element, index) {
|
4655
|
+
switch (element.type) {
|
4656
|
+
case 'heading':
|
4657
|
+
return React__default.createElement("h" + element.level, {
|
4658
|
+
key: index
|
4659
|
+
}, element.content);
|
4660
|
+
case 'horizontalRule':
|
4661
|
+
return React__default.createElement("hr", {
|
4662
|
+
key: index
|
4663
|
+
});
|
4664
|
+
case 'blockquote':
|
4665
|
+
return React__default.createElement("blockquote", {
|
4666
|
+
key: index
|
4667
|
+
}, element.content);
|
4668
|
+
case 'code':
|
4669
|
+
return React__default.createElement("pre", {
|
4670
|
+
className: "code-block",
|
4671
|
+
key: index
|
4672
|
+
}, React__default.createElement("code", null, element.content));
|
4673
|
+
case 'inlineCode':
|
4674
|
+
return React__default.createElement("p", {
|
4675
|
+
key: index
|
4676
|
+
}, element.content);
|
4677
|
+
case 'unorderedList':
|
4678
|
+
return React__default.createElement("ul", {
|
4679
|
+
key: index
|
4680
|
+
}, React__default.createElement("li", null, element.content));
|
4681
|
+
case 'orderedList':
|
4682
|
+
return React__default.createElement("ol", {
|
4683
|
+
key: index
|
4684
|
+
}, React__default.createElement("li", null, element.content));
|
4685
|
+
case 'link':
|
4686
|
+
case 'image':
|
4687
|
+
return React__default.createElement("span", {
|
4688
|
+
key: index
|
4689
|
+
}, element.content);
|
4690
|
+
case 'text':
|
4691
|
+
default:
|
4692
|
+
return React__default.createElement("span", {
|
4693
|
+
key: index,
|
4694
|
+
dangerouslySetInnerHTML: {
|
4695
|
+
__html: String(element.content)
|
4696
|
+
}
|
4697
|
+
});
|
4698
|
+
}
|
4699
|
+
});
|
4700
|
+
};
|
4701
|
+
var parsedElements = parseContent(content);
|
4702
|
+
var transformedElements = transformElements(parsedElements);
|
4703
|
+
return React__default.createElement("div", {
|
4704
|
+
className: "markdown-view"
|
4705
|
+
}, transformedElements);
|
4706
|
+
};
|
4707
|
+
|
4708
|
+
var MessageList = function MessageList(_ref) {
|
4709
|
+
var messages = _ref.messages,
|
4710
|
+
chatBubbleConfig = _ref.chatBubbleConfig;
|
4711
|
+
return React.createElement("div", {
|
4337
4712
|
style: {
|
4338
|
-
height: 'calc(100% - 100px)',
|
4339
|
-
overflowY: 'auto',
|
4340
|
-
padding: 10,
|
4341
4713
|
display: 'flex',
|
4342
|
-
flexGrow: 1,
|
4343
4714
|
flexDirection: 'column'
|
4344
4715
|
}
|
4345
|
-
},
|
4346
|
-
questions: predefinedQuestions.slice(0, 3),
|
4347
|
-
onSelect: handlePredefinedQuestionSelect,
|
4348
|
-
chatBubbleConfig: chatBubbleConfig
|
4349
|
-
}), messages.map(function (message, index) {
|
4716
|
+
}, messages.map(function (message, index) {
|
4350
4717
|
return message.sender === 'user' ? React.createElement("div", {
|
4351
4718
|
key: index,
|
4352
4719
|
className: '',
|
@@ -4358,12 +4725,14 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4358
4725
|
borderBottomLeftRadius: 15,
|
4359
4726
|
maxWidth: '70%',
|
4360
4727
|
alignSelf: 'flex-end',
|
4361
|
-
fontSize: '
|
4728
|
+
fontSize: '16px',
|
4362
4729
|
backgroundColor: '#b8b8b8c6',
|
4363
4730
|
color: '#000',
|
4364
4731
|
textAlign: 'left'
|
4365
4732
|
}
|
4366
|
-
},
|
4733
|
+
}, React.createElement(MarkdownView, {
|
4734
|
+
content: message.text
|
4735
|
+
})) : React.createElement("div", {
|
4367
4736
|
key: index,
|
4368
4737
|
style: {
|
4369
4738
|
display: 'flex',
|
@@ -4376,8 +4745,8 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4376
4745
|
}
|
4377
4746
|
}, " ", React.createElement(Avatar, {
|
4378
4747
|
borderColor: '#fff',
|
4379
|
-
width: '
|
4380
|
-
height: '
|
4748
|
+
width: '15px',
|
4749
|
+
height: '15px',
|
4381
4750
|
source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
|
4382
4751
|
}), React.createElement("small", {
|
4383
4752
|
style: {
|
@@ -4393,25 +4762,26 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4393
4762
|
borderBottomLeftRadius: 15,
|
4394
4763
|
maxWidth: '70%',
|
4395
4764
|
alignSelf: 'flex-start',
|
4396
|
-
fontSize: '
|
4765
|
+
fontSize: '16px',
|
4397
4766
|
backgroundColor: '#f0f0f0',
|
4398
4767
|
color: '#000',
|
4399
4768
|
textAlign: 'left',
|
4400
4769
|
margin: 5
|
4401
4770
|
}
|
4402
|
-
},
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4407
|
-
|
4408
|
-
|
4409
|
-
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
|
4414
|
-
|
4771
|
+
}, React.createElement(MarkdownView, {
|
4772
|
+
content: message.text
|
4773
|
+
})));
|
4774
|
+
}));
|
4775
|
+
};
|
4776
|
+
|
4777
|
+
var InputArea = function InputArea(_ref) {
|
4778
|
+
var userInput = _ref.userInput,
|
4779
|
+
handleUserInput = _ref.handleUserInput,
|
4780
|
+
handleKeyPress = _ref.handleKeyPress,
|
4781
|
+
sendInputInquiry = _ref.sendInputInquiry,
|
4782
|
+
isLoading = _ref.isLoading,
|
4783
|
+
chatBubbleConfig = _ref.chatBubbleConfig;
|
4784
|
+
return React.createElement("div", {
|
4415
4785
|
className: styles['input-area'],
|
4416
4786
|
style: {
|
4417
4787
|
display: 'flex',
|
@@ -4449,48 +4819,342 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4449
4819
|
}
|
4450
4820
|
}, React.createElement(SendMessageIcon, {
|
4451
4821
|
color: isLoading ? '#cdcdcd' : chatBubbleConfig.color
|
4452
|
-
})))
|
4453
|
-
|
4454
|
-
|
4455
|
-
|
4456
|
-
|
4457
|
-
|
4458
|
-
|
4459
|
-
|
4460
|
-
borderTop: '1px solid #f9f9f9',
|
4461
|
-
borderBottomLeftRadius: 10,
|
4462
|
-
borderBottomRightRadius: 10
|
4463
|
-
}
|
4464
|
-
}, React.createElement("a", {
|
4465
|
-
href: 'https://bibot.app',
|
4466
|
-
target: '_blank',
|
4822
|
+
})));
|
4823
|
+
};
|
4824
|
+
|
4825
|
+
var AiFollowUps = function AiFollowUps(_ref) {
|
4826
|
+
var questions = _ref.questions,
|
4827
|
+
onSelect = _ref.onSelect,
|
4828
|
+
chatBubbleConfig = _ref.chatBubbleConfig;
|
4829
|
+
return React.createElement("div", {
|
4467
4830
|
style: {
|
4468
|
-
|
4831
|
+
height: '100%',
|
4832
|
+
color: '#000',
|
4833
|
+
padding: 10,
|
4834
|
+
borderRadius: '6px',
|
4835
|
+
marginBottom: '20px'
|
4469
4836
|
}
|
4470
|
-
},
|
4837
|
+
}, questions.map(function (question, index) {
|
4838
|
+
var _chatBubbleConfig$col;
|
4839
|
+
return React.createElement("div", {
|
4840
|
+
key: index,
|
4841
|
+
style: {
|
4842
|
+
backgroundColor: '#fafafa',
|
4843
|
+
border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
|
4844
|
+
fontSize: '16px',
|
4845
|
+
margin: '7px',
|
4846
|
+
textAlign: 'start',
|
4847
|
+
padding: '14px',
|
4848
|
+
borderRadius: '15px',
|
4849
|
+
cursor: 'pointer'
|
4850
|
+
},
|
4851
|
+
onClick: function onClick() {
|
4852
|
+
onSelect(question);
|
4853
|
+
}
|
4854
|
+
}, question.question);
|
4855
|
+
}));
|
4856
|
+
};
|
4857
|
+
|
4858
|
+
var PredefinedQuestions = function PredefinedQuestions(_ref) {
|
4859
|
+
var questions = _ref.questions,
|
4860
|
+
onSelect = _ref.onSelect,
|
4861
|
+
chatBubbleConfig = _ref.chatBubbleConfig;
|
4862
|
+
return React.createElement("div", {
|
4471
4863
|
style: {
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4864
|
+
height: '100dvh',
|
4865
|
+
color: '#000',
|
4866
|
+
backgroundColor: 'transparent',
|
4867
|
+
padding: 10,
|
4868
|
+
borderRadius: '6px',
|
4869
|
+
marginBottom: '30px'
|
4475
4870
|
}
|
4476
|
-
},
|
4871
|
+
}, React.createElement("div", {
|
4477
4872
|
style: {
|
4478
|
-
|
4479
|
-
|
4873
|
+
display: 'flex',
|
4874
|
+
flexDirection: 'column'
|
4480
4875
|
}
|
4481
|
-
},
|
4876
|
+
}, React.createElement("div", {
|
4482
4877
|
style: {
|
4483
4878
|
display: 'flex',
|
4879
|
+
alignItems: 'center'
|
4880
|
+
}
|
4881
|
+
}, React.createElement(Avatar, {
|
4882
|
+
borderColor: '#fff',
|
4883
|
+
width: '36px',
|
4884
|
+
height: '36px',
|
4885
|
+
source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
|
4886
|
+
}), React.createElement("small", {
|
4887
|
+
style: {
|
4888
|
+
marginLeft: 5
|
4889
|
+
}
|
4890
|
+
}, " ", chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title)), React.createElement("div", {
|
4891
|
+
style: {
|
4892
|
+
backgroundColor: '#dedede',
|
4893
|
+
marginBottom: 20,
|
4894
|
+
width: 300,
|
4895
|
+
marginLeft: 15,
|
4896
|
+
marginTop: 5,
|
4897
|
+
borderTopRightRadius: 20,
|
4898
|
+
borderBottomRightRadius: 20,
|
4899
|
+
borderBottomLeftRadius: 20
|
4900
|
+
}
|
4901
|
+
}, React.createElement("p", {
|
4902
|
+
style: {
|
4903
|
+
fontSize: '16px',
|
4904
|
+
paddingLeft: 10
|
4905
|
+
}
|
4906
|
+
}, "Are you looking for answers to any of these questions? Click for an answer", ' '))), questions.map(function (question, index) {
|
4907
|
+
var _chatBubbleConfig$col;
|
4908
|
+
return React.createElement("div", {
|
4909
|
+
key: index,
|
4910
|
+
style: {
|
4911
|
+
backgroundColor: '#fafafa',
|
4912
|
+
border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
|
4913
|
+
fontSize: '16px',
|
4914
|
+
margin: '7px',
|
4915
|
+
textAlign: 'start',
|
4916
|
+
padding: '14px',
|
4917
|
+
borderRadius: '16px',
|
4918
|
+
cursor: 'pointer'
|
4919
|
+
},
|
4920
|
+
onClick: function onClick() {
|
4921
|
+
onSelect(question);
|
4922
|
+
}
|
4923
|
+
}, question.question);
|
4924
|
+
}));
|
4925
|
+
};
|
4926
|
+
|
4927
|
+
/******************************************************************************
|
4928
|
+
Copyright (c) Microsoft Corporation.
|
4929
|
+
|
4930
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
4931
|
+
purpose with or without fee is hereby granted.
|
4932
|
+
|
4933
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
4934
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
4935
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
4936
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
4937
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
4938
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
4939
|
+
PERFORMANCE OF THIS SOFTWARE.
|
4940
|
+
***************************************************************************** */
|
4941
|
+
|
4942
|
+
var __assign = function() {
|
4943
|
+
__assign = Object.assign || function __assign(t) {
|
4944
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4945
|
+
s = arguments[i];
|
4946
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4947
|
+
}
|
4948
|
+
return t;
|
4949
|
+
};
|
4950
|
+
return __assign.apply(this, arguments);
|
4951
|
+
};
|
4952
|
+
|
4953
|
+
function __spreadArray(to, from, pack) {
|
4954
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4955
|
+
if (ar || !(i in from)) {
|
4956
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
4957
|
+
ar[i] = from[i];
|
4958
|
+
}
|
4959
|
+
}
|
4960
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
4961
|
+
}
|
4962
|
+
|
4963
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
4964
|
+
var e = new Error(message);
|
4965
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
4966
|
+
};
|
4967
|
+
|
4968
|
+
function memoize(fn) {
|
4969
|
+
var cache = Object.create(null);
|
4970
|
+
return function (arg) {
|
4971
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
4972
|
+
return cache[arg];
|
4973
|
+
};
|
4974
|
+
}
|
4975
|
+
|
4976
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
4977
|
+
|
4978
|
+
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
4979
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
4980
|
+
/* o */
|
4981
|
+
&& prop.charCodeAt(1) === 110
|
4982
|
+
/* n */
|
4983
|
+
&& prop.charCodeAt(2) < 91;
|
4984
|
+
}
|
4985
|
+
/* Z+1 */
|
4986
|
+
);
|
4987
|
+
|
4988
|
+
var e="-ms-";var r="-moz-";var a="-webkit-";var n="comm";var c="rule";var s="decl";var i$1="@import";var h="@keyframes";var g="@layer";var $=Math.abs;var m=String.fromCharCode;var x=Object.assign;function y(e,r){return A(e,0)^45?(((r<<2^A(e,0))<<2^A(e,1))<<2^A(e,2))<<2^A(e,3):0}function j(e){return e.trim()}function z(e,r){return (e=r.exec(e))?e[0]:e}function C(e,r,a){return e.replace(r,a)}function O(e,r,a){return e.indexOf(r,a)}function A(e,r){return e.charCodeAt(r)|0}function M(e,r,a){return e.slice(r,a)}function S(e){return e.length}function q(e){return e.length}function B(e,r){return r.push(e),e}function D(e,r){return e.map(r).join("")}function E(e,r){return e.filter((function(e){return !z(e,r)}))}var F=1;var G=1;var H=0;var I=0;var J=0;var K="";function L(e,r,a,n,c,s,t,u){return {value:e,root:r,parent:a,type:n,props:c,children:s,line:F,column:G,length:t,return:"",siblings:u}}function N(e,r){return x(L("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},r)}function P(e){while(e.root)e=N(e.root,{children:[e]});B(e,e.siblings);}function Q(){return J}function R(){J=I>0?A(K,--I):0;if(G--,J===10)G=1,F--;return J}function T(){J=I<H?A(K,I++):0;if(G++,J===10)G=1,F++;return J}function U(){return A(K,I)}function V(){return I}function W(e,r){return M(K,e,r)}function X(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Y(e){return F=G=1,H=S(K=e),I=0,[]}function Z(e){return K="",e}function _(e){return j(W(I-1,ce(e===91?e+2:e===40?e+1:e)))}function re(e){while(J=U())if(J<33)T();else break;return X(e)>2||X(J)>3?"":" "}function ne(e,r){while(--r&&T())if(J<48||J>102||J>57&&J<65||J>70&&J<97)break;return W(e,V()+(r<6&&U()==32&&T()==32))}function ce(e){while(T())switch(J){case e:return I;case 34:case 39:if(e!==34&&e!==39)ce(J);break;case 40:if(e===41)ce(e);break;case 92:T();break}return I}function se(e,r){while(T())if(e+J===47+10)break;else if(e+J===42+42&&U()===47)break;return "/*"+W(r,I-1)+"*"+m(e===47?e:T())}function te(e){while(!X(U()))T();return W(e,I)}function ue(e){return Z(ie("",null,null,null,[""],e=Y(e),0,[0],e))}function ie(e,r,a,n,c,s,t,u,i){var f=0;var o=0;var l=t;var v=0;var p=0;var h=0;var b=1;var w=1;var d=1;var g=0;var k="";var x=c;var y=s;var j=n;var z=k;while(w)switch(h=g,g=T()){case 40:if(h!=108&&A(z,l-1)==58){if(O(z+=C(_(g),"&","&\f"),"&\f",$(f?u[f-1]:0))!=-1)d=-1;break}case 34:case 39:case 91:z+=_(g);break;case 9:case 10:case 13:case 32:z+=re(h);break;case 92:z+=ne(V()-1,7);continue;case 47:switch(U()){case 42:case 47:B(oe(se(T(),V()),r,a,i),i);break;default:z+="/";}break;case 123*b:u[f++]=S(z)*d;case 125*b:case 59:case 0:switch(g){case 0:case 125:w=0;case 59+o:if(d==-1)z=C(z,/\f/g,"");if(p>0&&S(z)-l)B(p>32?le(z+";",n,a,l-1,i):le(C(z," ","")+";",n,a,l-2,i),i);break;case 59:z+=";";default:B(j=fe(z,r,a,f,o,c,u,k,x=[],y=[],l,s),s);if(g===123)if(o===0)ie(z,r,j,j,x,s,l,u,y);else switch(v===99&&A(z,3)===110?100:v){case 100:case 108:case 109:case 115:ie(e,j,j,n&&B(fe(e,j,j,0,0,c,u,k,c,x=[],l,y),y),c,y,l,u,n?x:y);break;default:ie(z,j,j,j,[""],y,0,u,y);}}f=o=p=0,b=d=1,k=z="",l=t;break;case 58:l=1+S(z),p=h;default:if(b<1)if(g==123)--b;else if(g==125&&b++==0&&R()==125)continue;switch(z+=m(g),g*b){case 38:d=o>0?1:(z+="\f",-1);break;case 44:u[f++]=(S(z)-1)*d,d=1;break;case 64:if(U()===45)z+=_(T());v=U(),o=l=S(k=z+=te(V())),g++;break;case 45:if(h===45&&S(z)==2)b=0;}}return s}function fe(e,r,a,n,s,t,u,i,f,o,l,v){var p=s-1;var h=s===0?t:[""];var b=q(h);for(var w=0,d=0,g=0;w<n;++w)for(var k=0,m=M(e,p+1,p=$(d=u[w])),x=e;k<b;++k)if(x=j(d>0?h[k]+" "+m:C(m,/&\f/g,h[k])))f[g++]=x;return L(e,r,a,s===0?c:i,f,o,l,v)}function oe(e,r,a,c){return L(e,r,a,n,m(Q()),M(e,2,-2),0,c)}function le(e,r,a,n,c){return L(e,r,a,s,M(e,0,n),M(e,n+1,-1),n,c)}function ve(n,c,s){switch(y(n,c)){case 5103:return a+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+n+n;case 4789:return r+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return a+n+r+n+e+n+n;case 5936:switch(A(n,c+11)){case 114:return a+n+e+C(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return a+n+e+C(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return a+n+e+C(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return a+n+e+n+n;case 6165:return a+n+e+"flex-"+n+n;case 5187:return a+n+C(n,/(\w+).+(:[^]+)/,a+"box-$1$2"+e+"flex-$1$2")+n;case 5443:return a+n+e+"flex-item-"+C(n,/flex-|-self/g,"")+(!z(n,/flex-|baseline/)?e+"grid-row-"+C(n,/flex-|-self/g,""):"")+n;case 4675:return a+n+e+"flex-line-pack"+C(n,/align-content|flex-|-self/g,"")+n;case 5548:return a+n+e+C(n,"shrink","negative")+n;case 5292:return a+n+e+C(n,"basis","preferred-size")+n;case 6060:return a+"box-"+C(n,"-grow","")+a+n+e+C(n,"grow","positive")+n;case 4554:return a+C(n,/([^-])(transform)/g,"$1"+a+"$2")+n;case 6187:return C(C(C(n,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),n,"")+n;case 5495:case 3959:return C(n,/(image-set\([^]*)/,a+"$1"+"$`$1");case 4968:return C(C(n,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+n+n;case 4200:if(!z(n,/flex-|baseline/))return e+"grid-column-align"+M(n,c)+n;break;case 2592:case 3360:return e+C(n,"template-","")+n;case 4384:case 3616:if(s&&s.some((function(e,r){return c=r,z(e.props,/grid-\w+-end/)}))){return ~O(n+(s=s[c].value),"span",0)?n:e+C(n,"-start","")+n+e+"grid-row-span:"+(~O(s,"span",0)?z(s,/\d+/):+z(s,/\d+/)-+z(n,/\d+/))+";"}return e+C(n,"-start","")+n;case 4896:case 4128:return s&&s.some((function(e){return z(e.props,/grid-\w+-start/)}))?n:e+C(C(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return C(n,/(.+)-inline(.+)/,a+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(S(n)-1-c>6)switch(A(n,c+1)){case 109:if(A(n,c+4)!==45)break;case 102:return C(n,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3"+"$1"+r+(A(n,c+3)==108?"$3":"$2-$3"))+n;case 115:return ~O(n,"stretch",0)?ve(C(n,"stretch","fill-available"),c,s)+n:n}break;case 5152:case 5920:return C(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(r,a,c,s,t,u,i){return e+a+":"+c+i+(s?e+a+"-span:"+(t?u:+u-+c)+i:"")+n}));case 4949:if(A(n,c+6)===121)return C(n,":",":"+a)+n;break;case 6444:switch(A(n,A(n,14)===45?18:11)){case 120:return C(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+a+(A(n,14)===45?"inline-":"")+"box$3"+"$1"+a+"$2$3"+"$1"+e+"$2box$3")+n;case 100:return C(n,":",":"+e)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return C(n,"scroll-","scroll-snap-")+n}return n}function pe(e,r){var a="";for(var n=0;n<e.length;n++)a+=r(e[n],n,e,r)||"";return a}function he(e,r,a,t){switch(e.type){case g:if(e.children.length)break;case i$1:case s:return e.return=e.return||e.value;case n:return "";case h:return e.return=e.value+"{"+pe(e.children,t)+"}";case c:if(!S(e.value=e.props.join(",")))return ""}return S(a=pe(e.children,t))?e.return=e.value+"{"+a+"}":""}function be(e){var r=q(e);return function(a,n,c,s){var t="";for(var u=0;u<r;u++)t+=e[u](a,n,c,s)||"";return t}}function we(e){return function(r){if(!r.root)if(r=r.return)e(r);}}function de(n,t,u,i){if(n.length>-1)if(!n.return)switch(n.type){case s:n.return=ve(n.value,n.length,u);return;case h:return pe([N(n,{value:C(n.value,"@","@"+a)})],i);case c:if(n.length)return D(u=n.props,(function(c){switch(z(c,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(N(n,{props:[C(c,/:(read-\w+)/,":"+r+"$1")]}));P(N(n,{props:[c]}));x(n,{props:E(u,i)});break;case"::placeholder":P(N(n,{props:[C(c,/:(plac\w+)/,":"+a+"input-$1")]}));P(N(n,{props:[C(c,/:(plac\w+)/,":"+r+"$1")]}));P(N(n,{props:[C(c,/:(plac\w+)/,e+"input-$1")]}));P(N(n,{props:[c]}));x(n,{props:E(u,i)});break}return ""}))}}
|
4989
|
+
|
4990
|
+
var unitlessKeys = {
|
4991
|
+
animationIterationCount: 1,
|
4992
|
+
aspectRatio: 1,
|
4993
|
+
borderImageOutset: 1,
|
4994
|
+
borderImageSlice: 1,
|
4995
|
+
borderImageWidth: 1,
|
4996
|
+
boxFlex: 1,
|
4997
|
+
boxFlexGroup: 1,
|
4998
|
+
boxOrdinalGroup: 1,
|
4999
|
+
columnCount: 1,
|
5000
|
+
columns: 1,
|
5001
|
+
flex: 1,
|
5002
|
+
flexGrow: 1,
|
5003
|
+
flexPositive: 1,
|
5004
|
+
flexShrink: 1,
|
5005
|
+
flexNegative: 1,
|
5006
|
+
flexOrder: 1,
|
5007
|
+
gridRow: 1,
|
5008
|
+
gridRowEnd: 1,
|
5009
|
+
gridRowSpan: 1,
|
5010
|
+
gridRowStart: 1,
|
5011
|
+
gridColumn: 1,
|
5012
|
+
gridColumnEnd: 1,
|
5013
|
+
gridColumnSpan: 1,
|
5014
|
+
gridColumnStart: 1,
|
5015
|
+
msGridRow: 1,
|
5016
|
+
msGridRowSpan: 1,
|
5017
|
+
msGridColumn: 1,
|
5018
|
+
msGridColumnSpan: 1,
|
5019
|
+
fontWeight: 1,
|
5020
|
+
lineHeight: 1,
|
5021
|
+
opacity: 1,
|
5022
|
+
order: 1,
|
5023
|
+
orphans: 1,
|
5024
|
+
tabSize: 1,
|
5025
|
+
widows: 1,
|
5026
|
+
zIndex: 1,
|
5027
|
+
zoom: 1,
|
5028
|
+
WebkitLineClamp: 1,
|
5029
|
+
// SVG-related properties
|
5030
|
+
fillOpacity: 1,
|
5031
|
+
floodOpacity: 1,
|
5032
|
+
stopOpacity: 1,
|
5033
|
+
strokeDasharray: 1,
|
5034
|
+
strokeDashoffset: 1,
|
5035
|
+
strokeMiterlimit: 1,
|
5036
|
+
strokeOpacity: 1,
|
5037
|
+
strokeWidth: 1
|
5038
|
+
};
|
5039
|
+
|
5040
|
+
var f="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",m$1="active",y$1="data-styled-version",v="6.1.13",g$1="/*!sc*/\n",S$1="undefined"!=typeof window&&"HTMLElement"in window,w=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),E$1=/invalid hook call/i,N$1=new Set,P$1=function(t,n){if("production"!==process.env.NODE_ENV){var o=n?' with the id of "'.concat(n,'"'):"",s="The component ".concat(t).concat(o," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",i=console.error;try{var a=!0;console.error=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];E$1.test(t)?(a=!1,N$1.delete(s)):i.apply(void 0,__spreadArray([t],n,!1));},React.useRef(),a&&!N$1.has(s)&&(console.warn(s),N$1.add(s));}catch(e){E$1.test(e.message)&&N$1.delete(s);}finally{console.error=i;}}},_$1=Object.freeze([]),C$1=Object.freeze({});function I$1(e,t,n){return void 0===n&&(n=C$1),e.theme!==n.theme&&e.theme||t||n.theme}var A$1=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),O$1=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,D$1=/(^-|-$)/g;function R$1(e){return e.replace(O$1,"-").replace(D$1,"")}var T$1=/(a)(d)/gi,k=52,j$1=function(e){return String.fromCharCode(e+(e>25?39:97))};function x$1(e){var t,n="";for(t=Math.abs(e);t>k;t=t/k|0)n=j$1(t%k)+n;return (j$1(t%k)+n).replace(T$1,"$1-$2")}var V$1,F$1=5381,M$1=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},z$1=function(e){return M$1(F$1,e)};function $$1(e){return x$1(z$1(e)>>>0)}function B$1(e){return "production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function L$1(e){return "string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var G$1="function"==typeof Symbol&&Symbol.for,Y$1=G$1?Symbol.for("react.memo"):60115,W$1=G$1?Symbol.for("react.forward_ref"):60112,q$1={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},H$1={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},U$1={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},J$1=((V$1={})[W$1]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},V$1[Y$1]=U$1,V$1);function X$1(e){return ("type"in(t=e)&&t.type.$$typeof)===Y$1?U$1:"$$typeof"in e?J$1[e.$$typeof]:q$1;var t;}var Z$1=Object.defineProperty,K$1=Object.getOwnPropertyNames,Q$1=Object.getOwnPropertySymbols,ee=Object.getOwnPropertyDescriptor,te$1=Object.getPrototypeOf,ne$1=Object.prototype;function oe$1(e,t,n){if("string"!=typeof t){if(ne$1){var o=te$1(t);o&&o!==ne$1&&oe$1(e,o,n);}var r=K$1(t);Q$1&&(r=r.concat(Q$1(t)));for(var s=X$1(e),i=X$1(t),a=0;a<r.length;++a){var c=r[a];if(!(c in H$1||n&&n[c]||i&&c in i||s&&c in s)){var l=ee(t,c);try{Z$1(e,c,l);}catch(e){}}}}return e}function re$1(e){return "function"==typeof e}function se$1(e){return "object"==typeof e&&"styledComponentId"in e}function ie$1(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function ae(e,t){if(0===e.length)return "";for(var n=e[0],o=1;o<e.length;o++)n+=t?t+e[o]:e[o];return n}function ce$1(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function le$1(e,t,n){if(void 0===n&&(n=!1),!n&&!ce$1(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var o=0;o<t.length;o++)e[o]=le$1(e[o],t[o]);else if(ce$1(t))for(var o in t)e[o]=le$1(e[o],t[o]);return e}function ue$1(e,t){Object.defineProperty(e,"toString",{value:t});}var pe$1="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function de$1(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],o=[],r=1,s=e.length;r<s;r+=1)o.push(e[r]);return o.forEach(function(e){n=n.replace(/%[a-z]/,e);}),n}function he$1(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return "production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(de$1.apply(void 0,__spreadArray([pe$1[t]],n,!1)).trim())}var fe$1=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,r=o;e>=r;)if((r<<=1)<0)throw he$1(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var s=o;s<r;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++);},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),o=n+t;this.groupSizes[e]=0;for(var r=n;r<o;r++)this.tag.deleteRule(n);}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],o=this.indexOfGroup(e),r=o+n,s=o;s<r;s++)t+="".concat(this.tag.getRule(s)).concat(g$1);return t},e}(),me=1<<30,ye=new Map,ve$1=new Map,ge=1,Se=function(e){if(ye.has(e))return ye.get(e);for(;ve$1.has(ge);)ge++;var t=ge++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>me))throw he$1(16,"".concat(t));return ye.set(e,t),ve$1.set(t,e),t},we$1=function(e,t){ge=t+1,ye.set(e,t),ve$1.set(t,e);},be$1="style[".concat(f,"][").concat(y$1,'="').concat(v,'"]'),Ee=new RegExp("^".concat(f,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Ne=function(e,t,n){for(var o,r=n.split(","),s=0,i=r.length;s<i;s++)(o=r[s])&&e.registerName(t,o);},Pe=function(e,t){for(var n,o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(g$1),r=[],s=0,i=o.length;s<i;s++){var a=o[s].trim();if(a){var c=a.match(Ee);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(we$1(u,l),Ne(e,u,c[3]),e.getTag().insertRules(l,r)),r.length=0;}else r.push(a);}}},_e=function(e){for(var t=document.querySelectorAll(be$1),n=0,o=t.length;n<o;n++){var r=t[n];r&&r.getAttribute(f)!==m$1&&(Pe(e,r),r.parentNode&&r.parentNode.removeChild(r));}};function Ce(){return "undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null}var Ie=function(e){var t=document.head,n=e||t,o=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(f,"]")));return t[t.length-1]}(n),s=void 0!==r?r.nextSibling:null;o.setAttribute(f,m$1),o.setAttribute(y$1,v);var i=Ce();return i&&o.setAttribute("nonce",i),n.insertBefore(o,s),o},Ae=function(){function e(e){this.element=Ie(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,o=t.length;n<o;n++){var r=t[n];if(r.ownerNode===e)return r}throw he$1(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return !1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Oe=function(){function e(e){this.element=Ie(e),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),De=function(){function e(e){this.rules=[],this.length=0;}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--;},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Re=S$1,Te={isServer:!S$1,useCSSOMInjection:!w},ke=function(){function e(e,n,o){void 0===e&&(e=C$1),void 0===n&&(n={});var r=this;this.options=__assign(__assign({},Te),e),this.gs=n,this.names=new Map(o),this.server=!!e.isServer,!this.server&&S$1&&Re&&(Re=!1,_e(this)),ue$1(this,function(){return function(e){for(var t=e.getTag(),n=t.length,o="",r=function(n){var r=function(e){return ve$1.get(e)}(n);if(void 0===r)return "continue";var s=e.names.get(r),i=t.getGroup(n);if(void 0===s||!s.size||0===i.length)return "continue";var a="".concat(f,".g").concat(n,'[id="').concat(r,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","));}),o+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat(g$1);},s=0;s<n;s++)r(s);return o}(r)});}return e.registerId=function(e){return Se(e)},e.prototype.rehydrate=function(){!this.server&&S$1&&_e(this);},e.prototype.reconstructWithOptions=function(n,o){return void 0===o&&(o=!0),new e(__assign(__assign({},this.options),n),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new De(n):t?new Ae(n):new Oe(n)}(this.options),new fe$1(e)));var e;},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(Se(e),this.names.has(e))this.names.get(e).add(t);else {var n=new Set;n.add(t),this.names.set(e,n);}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(Se(e),n);},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},e.prototype.clearRules=function(e){this.getTag().clearGroup(Se(e)),this.clearNames(e);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),je=/&/g,xe=/^\s*\/\/.*$/gm;function Ve(e,t){return e.map(function(e){return "rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return "".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Ve(e.children,t)),e})}function Fe(e){var t,n,o,r=void 0===e?C$1:e,s=r.options,i=void 0===s?C$1:s,a=r.plugins,c$1=void 0===a?_$1:a,l=function(e,o,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},u=c$1.slice();u.push(function(e){e.type===c&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(je,n).replace(o,l));}),i.prefix&&u.push(de),u.push(he);var p=function(e,r,s,a){void 0===r&&(r=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=r,o=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(xe,""),l=ue(s||r?"".concat(s," ").concat(r," { ").concat(c," }"):c);i.namespace&&(l=Ve(l,i.namespace));var p=[];return pe(l,be(u.concat(we(function(e){return p.push(e)})))),p};return p.hash=c$1.length?c$1.reduce(function(e,t){return t.name||he$1(15),M$1(e,t.name)},F$1).toString():"",p}var Me=new ke,ze=Fe(),$e=React__default.createContext({shouldForwardProp:void 0,styleSheet:Me,stylis:ze}),Le=React__default.createContext(void 0);function Ge(){return React.useContext($e)}var We=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=ze);var o=n.name+t.hash;e.hasNameForId(n.id,o)||e.insertRules(n.id,o,t(n.rules,o,"@keyframes"));},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,ue$1(this,function(){throw he$1(12,String(n.name))});}return e.prototype.getName=function(e){return void 0===e&&(e=ze),this.name+e.hash},e}(),qe=function(e){return e>="A"&&e<="Z"};function He(e){for(var t="",n=0;n<e.length;n++){var o=e[n];if(1===n&&"-"===o&&"-"===e[0])return e;qe(o)?t+="-"+o.toLowerCase():t+=o;}return t.startsWith("ms-")?"-"+t:t}var Ue=function(e){return null==e||!1===e||""===e},Je=function(t){var n,o,r=[];for(var s in t){var i=t[s];t.hasOwnProperty(s)&&!Ue(i)&&(Array.isArray(i)&&i.isCss||re$1(i)?r.push("".concat(He(s),":"),i,";"):ce$1(i)?r.push.apply(r,__spreadArray(__spreadArray(["".concat(s," {")],Je(i),!1),["}"],!1)):r.push("".concat(He(s),": ").concat((n=s,null==(o=i)||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in unitlessKeys||n.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function Xe(e,t,n,o){if(Ue(e))return [];if(se$1(e))return [".".concat(e.styledComponentId)];if(re$1(e)){if(!re$1(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return [e];var r=e(t);return "production"===process.env.NODE_ENV||"object"!=typeof r||Array.isArray(r)||r instanceof We||ce$1(r)||null===r||console.error("".concat(B$1(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Xe(r,t,n,o)}var s;return e instanceof We?n?(e.inject(n,o),[e.getName(o)]):[e]:ce$1(e)?Je(e):Array.isArray(e)?Array.prototype.concat.apply(_$1,e.map(function(e){return Xe(e,t,n,o)})):[e.toString()]}function Ze(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(re$1(n)&&!se$1(n))return !1}return !0}var Ke=z$1(v),Qe=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&Ze(e),this.componentId=t,this.baseHash=M$1(Ke,t),this.baseStyle=n,ke.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))o=ie$1(o,this.staticRulesId);else {var r=ae(Xe(this.rules,e,t,n)),s=x$1(M$1(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(r,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i);}o=ie$1(o,s),this.staticRulesId=s;}else {for(var a=M$1(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u,"production"!==process.env.NODE_ENV&&(a=M$1(a,u));else if(u){var p=ae(Xe(u,e,t,n));a=M$1(a,p+l),c+=p;}}if(c){var d=x$1(a>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),o=ie$1(o,d);}}return o},e}(),et=React__default.createContext(void 0);var rt={},st=new Set;function it(e,r,s){var i=se$1(e),a=e,c=!L$1(e),p=r.attrs,d=void 0===p?_$1:p,h=r.componentId,f=void 0===h?function(e,t){var n="string"!=typeof e?"sc":R$1(e);rt[n]=(rt[n]||0)+1;var o="".concat(n,"-").concat($$1(v+n+rt[n]));return t?"".concat(t,"-").concat(o):o}(r.displayName,r.parentComponentId):h,m=r.displayName,y=void 0===m?function(e){return L$1(e)?"styled.".concat(e):"Styled(".concat(B$1(e),")")}(e):m,g=r.displayName&&r.componentId?"".concat(R$1(r.displayName),"-").concat(r.componentId):r.componentId||f,S=i&&a.attrs?a.attrs.concat(d).filter(Boolean):d,w=r.shouldForwardProp;if(i&&a.shouldForwardProp){var b=a.shouldForwardProp;if(r.shouldForwardProp){var E=r.shouldForwardProp;w=function(e,t){return b(e,t)&&E(e,t)};}else w=b;}var N=new Qe(s,g,i?a.componentStyle:void 0);function O(e,r){return function(e,r,s){var i=e.attrs,a=e.componentStyle,c=e.defaultProps,p=e.foldedComponentIds,d=e.styledComponentId,h=e.target,f=React__default.useContext(et),m=Ge(),y=e.shouldForwardProp||m.shouldForwardProp;"production"!==process.env.NODE_ENV&&React.useDebugValue(d);var v=I$1(r,f,c)||C$1,g=function(e,n,o){for(var r,s=__assign(__assign({},n),{className:void 0,theme:o}),i=0;i<e.length;i+=1){var a=re$1(r=e[i])?r(s):r;for(var c in a)s[c]="className"===c?ie$1(s[c],a[c]):"style"===c?__assign(__assign({},s[c]),a[c]):a[c];}return n.className&&(s.className=ie$1(s.className,n.className)),s}(i,r,v),S=g.as||h,w={};for(var b in g)void 0===g[b]||"$"===b[0]||"as"===b||"theme"===b&&g.theme===v||("forwardedAs"===b?w.as=g.forwardedAs:y&&!y(b,S)||(w[b]=g[b],y||"development"!==process.env.NODE_ENV||isPropValid(b)||st.has(b)||!A$1.has(S)||(st.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var E=function(e,t){var n=Ge(),o=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return "production"!==process.env.NODE_ENV&&React.useDebugValue(o),o}(a,g);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(E);var N=ie$1(p,d);return E&&(N+=" "+E),g.className&&(N+=" "+g.className),w[L$1(S)&&!A$1.has(S)?"class":"className"]=N,w.ref=s,React.createElement(S,w)}(D,e,r)}O.displayName=y;var D=React__default.forwardRef(O);return D.attrs=S,D.componentStyle=N,D.displayName=y,D.shouldForwardProp=w,D.foldedComponentIds=i?ie$1(a.foldedComponentIds,a.styledComponentId):"",D.styledComponentId=g,D.target=i?a.target:e,Object.defineProperty(D,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var o=0,r=t;o<r.length;o++)le$1(e,r[o],!0);return e}({},a.defaultProps,e):e;}}),"production"!==process.env.NODE_ENV&&(P$1(y,g),D.warnTooManyClasses=function(e,t){var n={},o=!1;return function(r){if(!o&&(n[r]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),o=!0,n={};}}}(y,g)),ue$1(D,function(){return ".".concat(D.styledComponentId)}),c&&oe$1(D,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),D}function at(e,t){for(var n=[e[0]],o=0,r=t.length;o<r;o+=1)n.push(t[o],e[o+1]);return n}var ct=function(e){return Object.assign(e,{isCss:!0})};function lt(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(re$1(t)||ce$1(t))return ct(Xe(at(_$1,__spreadArray([t],n,!0))));var r=t;return 0===n.length&&1===r.length&&"string"==typeof r[0]?Xe(r):ct(Xe(at(r,n)))}function ut(n,o,r){if(void 0===r&&(r=C$1),!o)throw he$1(1,o);var s=function(t){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return n(o,r,lt.apply(void 0,__spreadArray([t],s,!1)))};return s.attrs=function(e){return ut(n,o,__assign(__assign({},r),{attrs:Array.prototype.concat(r.attrs,e).filter(Boolean)}))},s.withConfig=function(e){return ut(n,o,__assign(__assign({},r),e))},s}var pt=function(e){return ut(it,e)},dt=pt;A$1.forEach(function(e){dt[e]=pt(e);});function mt(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var r=ae(lt.apply(void 0,__spreadArray([t],n,!1))),s=$$1(r);return new We(s,r)}"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var St="__sc-".concat(f,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[St]||(window[St]=0),1===window[St]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[St]+=1);
|
5041
|
+
|
5042
|
+
var _templateObject, _templateObject2, _templateObject3;
|
5043
|
+
var typingAnimation = mt(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n 0%, 20% { opacity: 0.2; }\n 40% { opacity: 1; }\n 60% { opacity: 0.2; }\n 100% { opacity: 0.2; }\n"])));
|
5044
|
+
var LoaderContainer = dt.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n background-color: #e0e0e0; /* Background color of the bubble */\n border-radius: 0px 15px 15px 15px; /* Rounded corners */\n padding: 8px 12px; /* Padding around the dots */\n max-width: fit-content; /* Fit the width to the content */\n position: relative; /* Position for the pseudo-element */\n"])));
|
5045
|
+
var Dot = dt.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n background-color: #000; /* Dot color */\n animation: ", " 1.2s infinite ease-in-out;\n\n &:nth-child(1) {\n animation-delay: 0s;\n }\n &:nth-child(2) {\n animation-delay: 0.4s;\n }\n &:nth-child(3) {\n animation-delay: 0.8s;\n }\n"])), typingAnimation);
|
5046
|
+
var Loader = function Loader() {
|
5047
|
+
return React__default.createElement(LoaderContainer, null, React__default.createElement(Dot, null), React__default.createElement(Dot, null), React__default.createElement(Dot, null));
|
5048
|
+
};
|
5049
|
+
|
5050
|
+
var ChatWindow = function ChatWindow(_ref) {
|
5051
|
+
var chatBubbleConfig = _ref.chatBubbleConfig,
|
5052
|
+
messages = _ref.messages,
|
5053
|
+
isLoading = _ref.isLoading,
|
5054
|
+
aiFollowUpQs = _ref.aiFollowUpQs,
|
5055
|
+
showPredefinedQuestions = _ref.showPredefinedQuestions,
|
5056
|
+
predefinedQuestions = _ref.predefinedQuestions,
|
5057
|
+
userInput = _ref.userInput,
|
5058
|
+
handleUserInput = _ref.handleUserInput,
|
5059
|
+
handleKeyPress = _ref.handleKeyPress,
|
5060
|
+
sendInputInquiry = _ref.sendInputInquiry,
|
5061
|
+
handlePredefinedQuestionSelect = _ref.handlePredefinedQuestionSelect,
|
5062
|
+
isOnline = _ref.isOnline,
|
5063
|
+
messageEndRef = _ref.messageEndRef;
|
5064
|
+
return React.createElement("div", {
|
5065
|
+
style: {
|
5066
|
+
backgroundColor: '#fff',
|
5067
|
+
position: 'absolute',
|
5068
|
+
bottom: '60px',
|
5069
|
+
right: '25px',
|
5070
|
+
width: 370,
|
5071
|
+
height: 550,
|
5072
|
+
borderRadius: 10,
|
5073
|
+
display: 'flex',
|
5074
|
+
flexDirection: 'column',
|
5075
|
+
justifyContent: 'space-between',
|
5076
|
+
boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)'
|
5077
|
+
}
|
5078
|
+
}, React.createElement(ChatHeader, {
|
5079
|
+
chatBubbleConfig: chatBubbleConfig,
|
5080
|
+
isLoading: isLoading,
|
5081
|
+
isOnline: isOnline
|
5082
|
+
}), React.createElement("div", {
|
5083
|
+
className: styles['message-list'],
|
5084
|
+
style: {
|
5085
|
+
height: 'calc(100% - 100px)',
|
5086
|
+
overflowY: 'auto',
|
5087
|
+
padding: 10,
|
5088
|
+
display: 'flex',
|
5089
|
+
flexGrow: 1,
|
5090
|
+
flexDirection: 'column'
|
5091
|
+
}
|
5092
|
+
}, showPredefinedQuestions && (predefinedQuestions === null || predefinedQuestions === void 0 ? void 0 : predefinedQuestions.length) > 0 && React.createElement(PredefinedQuestions, {
|
5093
|
+
questions: predefinedQuestions.slice(0, 3),
|
5094
|
+
onSelect: handlePredefinedQuestionSelect,
|
5095
|
+
chatBubbleConfig: chatBubbleConfig
|
5096
|
+
}), React.createElement(MessageList, {
|
5097
|
+
messages: messages,
|
5098
|
+
chatBubbleConfig: chatBubbleConfig
|
5099
|
+
}), aiFollowUpQs && !isLoading && React.createElement(AiFollowUps, {
|
5100
|
+
questions: aiFollowUpQs,
|
5101
|
+
onSelect: handlePredefinedQuestionSelect,
|
5102
|
+
chatBubbleConfig: chatBubbleConfig
|
5103
|
+
}), isLoading && React.createElement("div", {
|
5104
|
+
style: {
|
5105
|
+
marginLeft: '20px'
|
5106
|
+
},
|
5107
|
+
className: 'message'
|
5108
|
+
}, ' ', React.createElement(Loader, null)), React.createElement("div", {
|
5109
|
+
ref: messageEndRef
|
5110
|
+
})), React.createElement(InputArea, {
|
5111
|
+
chatBubbleConfig: chatBubbleConfig,
|
5112
|
+
isLoading: isLoading,
|
5113
|
+
handleUserInput: handleUserInput,
|
5114
|
+
userInput: userInput,
|
5115
|
+
handleKeyPress: handleKeyPress,
|
5116
|
+
sendInputInquiry: sendInputInquiry
|
5117
|
+
}), chatBubbleConfig.powered_by_bibot && React.createElement("div", {
|
5118
|
+
style: {
|
5119
|
+
backgroundColor: '#f9f9f9',
|
5120
|
+
minHeight: 45,
|
5121
|
+
display: 'flex',
|
5122
|
+
flexDirection: 'column',
|
4484
5123
|
alignItems: 'center',
|
4485
|
-
|
5124
|
+
justifyContent: 'center',
|
5125
|
+
borderTop: '1px solid #f9f9f9',
|
5126
|
+
borderBottomLeftRadius: 10,
|
5127
|
+
borderBottomRightRadius: 10
|
5128
|
+
}
|
5129
|
+
}, React.createElement("a", {
|
5130
|
+
href: 'https://bibot.app',
|
5131
|
+
target: '_blank',
|
5132
|
+
style: {
|
5133
|
+
textDecoration: 'none'
|
5134
|
+
}
|
5135
|
+
}, ' ', React.createElement("small", {
|
5136
|
+
style: {
|
5137
|
+
color: '#9ba6b2',
|
5138
|
+
fontSize: 10,
|
5139
|
+
marginBlock: 5
|
5140
|
+
}
|
5141
|
+
}, "Powered by", ' ', React.createElement("span", {
|
5142
|
+
style: {
|
5143
|
+
fontWeight: 'bold',
|
5144
|
+
color: '#1f4760'
|
4486
5145
|
}
|
4487
|
-
},
|
5146
|
+
}, "BIBOT")))));
|
5147
|
+
};
|
5148
|
+
|
5149
|
+
var GreetingMessage = function GreetingMessage(_ref) {
|
5150
|
+
var greeting = _ref.greeting,
|
5151
|
+
chatBubbleConfig = _ref.chatBubbleConfig,
|
5152
|
+
handleCloseGreeting = _ref.handleCloseGreeting;
|
5153
|
+
return React.createElement("span", {
|
4488
5154
|
style: {
|
4489
5155
|
fontSize: '12px',
|
4490
5156
|
color: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color,
|
4491
5157
|
textAlign: 'left',
|
4492
|
-
marginRight: '5px',
|
4493
|
-
whiteSpace: 'nowrap',
|
4494
5158
|
backgroundColor: '#fff',
|
4495
5159
|
padding: 15,
|
4496
5160
|
borderTopRightRadius: 30,
|
@@ -4512,11 +5176,64 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4512
5176
|
color: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color,
|
4513
5177
|
fontSize: '14px'
|
4514
5178
|
}
|
4515
|
-
}, "\xD7"))
|
5179
|
+
}, "\xD7"));
|
5180
|
+
};
|
5181
|
+
|
5182
|
+
var ChatBubbleContainer = function ChatBubbleContainer(_ref) {
|
5183
|
+
var _chatBubbleConfig$col;
|
5184
|
+
var messages = _ref.messages,
|
5185
|
+
isLoading = _ref.isLoading,
|
5186
|
+
showPredefinedQuestions = _ref.showPredefinedQuestions,
|
5187
|
+
predefinedQuestions = _ref.predefinedQuestions,
|
5188
|
+
userInput = _ref.userInput,
|
5189
|
+
handleUserInput = _ref.handleUserInput,
|
5190
|
+
handleKeyPress = _ref.handleKeyPress,
|
5191
|
+
sendInputInquiry = _ref.sendInputInquiry,
|
5192
|
+
handlePredefinedQuestionSelect = _ref.handlePredefinedQuestionSelect,
|
5193
|
+
chatIsOpen = _ref.chatIsOpen,
|
5194
|
+
toggleChat = _ref.toggleChat,
|
5195
|
+
chatBubbleConfig = _ref.chatBubbleConfig,
|
5196
|
+
isGreetingVisible = _ref.isGreetingVisible,
|
5197
|
+
greeting = _ref.greeting,
|
5198
|
+
handleCloseGreeting = _ref.handleCloseGreeting,
|
5199
|
+
isOnline = _ref.isOnline,
|
5200
|
+
messageEndRef = _ref.messageEndRef;
|
5201
|
+
return React.createElement("div", {
|
5202
|
+
className: "chat-bubble " + (chatIsOpen ? 'open' : ''),
|
5203
|
+
style: {
|
5204
|
+
position: 'fixed',
|
5205
|
+
bottom: '20px',
|
5206
|
+
right: '20px',
|
5207
|
+
zIndex: 9999
|
5208
|
+
}
|
5209
|
+
}, chatIsOpen && React.createElement(ChatWindow, {
|
5210
|
+
chatBubbleConfig: chatBubbleConfig,
|
5211
|
+
messages: messages,
|
5212
|
+
isLoading: isLoading,
|
5213
|
+
showPredefinedQuestions: showPredefinedQuestions,
|
5214
|
+
predefinedQuestions: predefinedQuestions,
|
5215
|
+
userInput: userInput,
|
5216
|
+
handleUserInput: handleUserInput,
|
5217
|
+
handleKeyPress: handleKeyPress,
|
5218
|
+
sendInputInquiry: sendInputInquiry,
|
5219
|
+
handlePredefinedQuestionSelect: handlePredefinedQuestionSelect,
|
5220
|
+
isOnline: isOnline,
|
5221
|
+
messageEndRef: messageEndRef
|
5222
|
+
}), React.createElement("div", {
|
5223
|
+
style: {
|
5224
|
+
display: 'flex',
|
5225
|
+
alignItems: 'center',
|
5226
|
+
padding: '0 10px'
|
5227
|
+
}
|
5228
|
+
}, isGreetingVisible && React.createElement(GreetingMessage, {
|
5229
|
+
greeting: greeting,
|
5230
|
+
chatBubbleConfig: chatBubbleConfig,
|
5231
|
+
handleCloseGreeting: handleCloseGreeting
|
5232
|
+
}), React.createElement("button", {
|
4516
5233
|
onClick: toggleChat,
|
4517
5234
|
className: styles['chat-toggle'],
|
4518
5235
|
style: {
|
4519
|
-
backgroundColor: (_chatBubbleConfig$
|
5236
|
+
backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
|
4520
5237
|
color: '#fff',
|
4521
5238
|
borderRadius: '50%',
|
4522
5239
|
cursor: 'pointer',
|
@@ -4525,12 +5242,73 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4525
5242
|
display: 'flex',
|
4526
5243
|
alignItems: 'center',
|
4527
5244
|
justifyContent: 'center',
|
4528
|
-
border: 'none'
|
4529
|
-
position: 'relative'
|
5245
|
+
border: 'none'
|
4530
5246
|
}
|
4531
5247
|
}, chatIsOpen ? React.createElement(CloseIcon, null) : React.createElement(ChatIcon, null))));
|
4532
5248
|
};
|
4533
5249
|
|
5250
|
+
var useOnlineStatus = function useOnlineStatus() {
|
5251
|
+
var _useState = React.useState(navigator.onLine),
|
5252
|
+
isOnline = _useState[0],
|
5253
|
+
setIsOnline = _useState[1];
|
5254
|
+
var updateOnlineStatus = function updateOnlineStatus() {
|
5255
|
+
setIsOnline(navigator.onLine);
|
5256
|
+
};
|
5257
|
+
React.useEffect(function () {
|
5258
|
+
window.addEventListener('online', updateOnlineStatus);
|
5259
|
+
window.addEventListener('offline', updateOnlineStatus);
|
5260
|
+
return function () {
|
5261
|
+
window.removeEventListener('online', updateOnlineStatus);
|
5262
|
+
window.removeEventListener('offline', updateOnlineStatus);
|
5263
|
+
};
|
5264
|
+
}, []);
|
5265
|
+
return isOnline;
|
5266
|
+
};
|
5267
|
+
|
5268
|
+
var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
5269
|
+
var _useBiBotChatBot = useBiBotChatBot(bibotProps),
|
5270
|
+
chatIsOpen = _useBiBotChatBot.chatIsOpen,
|
5271
|
+
messages = _useBiBotChatBot.messages,
|
5272
|
+
isLoading = _useBiBotChatBot.isLoading,
|
5273
|
+
userInput = _useBiBotChatBot.userInput,
|
5274
|
+
handleUserInput = _useBiBotChatBot.handleUserInput,
|
5275
|
+
handleKeyPress = _useBiBotChatBot.handleKeyPress,
|
5276
|
+
sendInputInquiry = _useBiBotChatBot.sendInputInquiry,
|
5277
|
+
toggleChat = _useBiBotChatBot.toggleChat,
|
5278
|
+
chatBubbleConfig = _useBiBotChatBot.chatBubbleConfig,
|
5279
|
+
showPredefinedQuestions = _useBiBotChatBot.showPredefinedQuestions,
|
5280
|
+
predefinedQuestions = _useBiBotChatBot.predefinedQuestions,
|
5281
|
+
handlePredefinedQuestionSelect = _useBiBotChatBot.handlePredefinedQuestionSelect,
|
5282
|
+
messageEndRef = _useBiBotChatBot.messageEndRef;
|
5283
|
+
var isOnline = useOnlineStatus();
|
5284
|
+
var greeting = chatBubbleConfig !== null && chatBubbleConfig !== void 0 && chatBubbleConfig.knownUser ? "Hi, " + chatBubbleConfig.knownUser + "! How can I help you today?" : 'Hello! How can I help you today?';
|
5285
|
+
var _React$useState = React.useState(true),
|
5286
|
+
isGreetingVisible = _React$useState[0],
|
5287
|
+
setGreetingVisible = _React$useState[1];
|
5288
|
+
var handleCloseGreeting = function handleCloseGreeting() {
|
5289
|
+
setGreetingVisible(false);
|
5290
|
+
};
|
5291
|
+
return React.createElement(ChatBubbleContainer, {
|
5292
|
+
chatBubbleConfig: chatBubbleConfig,
|
5293
|
+
messages: messages,
|
5294
|
+
isLoading: isLoading,
|
5295
|
+
showPredefinedQuestions: showPredefinedQuestions,
|
5296
|
+
predefinedQuestions: predefinedQuestions,
|
5297
|
+
userInput: userInput,
|
5298
|
+
handleUserInput: handleUserInput,
|
5299
|
+
handleKeyPress: handleKeyPress,
|
5300
|
+
sendInputInquiry: sendInputInquiry,
|
5301
|
+
chatIsOpen: chatIsOpen,
|
5302
|
+
toggleChat: toggleChat,
|
5303
|
+
isGreetingVisible: isGreetingVisible,
|
5304
|
+
greeting: greeting,
|
5305
|
+
handleCloseGreeting: handleCloseGreeting,
|
5306
|
+
handlePredefinedQuestionSelect: handlePredefinedQuestionSelect,
|
5307
|
+
isOnline: isOnline,
|
5308
|
+
messageEndRef: messageEndRef
|
5309
|
+
});
|
5310
|
+
};
|
5311
|
+
|
4534
5312
|
var BiBot = function BiBot(bibotProps) {
|
4535
5313
|
var clientId = bibotProps.clientId,
|
4536
5314
|
client_session_id = bibotProps.client_session_id,
|