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.
@@ -1,25 +1,16 @@
1
- import React__default, { createContext, useReducer, useContext, useState, useRef, useEffect, useDebugValue, createElement } from 'react';
1
+ import React__default, { createContext, useReducer, useContext, useState, useRef, useEffect, createElement, useDebugValue } from 'react';
2
2
 
3
3
  function _extends() {
4
- _extends = Object.assign ? Object.assign.bind() : function (target) {
5
- for (var i = 1; i < arguments.length; i++) {
6
- var source = arguments[i];
7
- for (var key in source) {
8
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9
- target[key] = source[key];
10
- }
11
- }
4
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
5
+ for (var e = 1; e < arguments.length; e++) {
6
+ var t = arguments[e];
7
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
12
8
  }
13
- return target;
14
- };
15
- return _extends.apply(this, arguments);
9
+ return n;
10
+ }, _extends.apply(null, arguments);
16
11
  }
17
- function _taggedTemplateLiteralLoose(strings, raw) {
18
- if (!raw) {
19
- raw = strings.slice(0);
20
- }
21
- strings.raw = raw;
22
- return strings;
12
+ function _taggedTemplateLiteralLoose(e, t) {
13
+ return t || (t = e.slice(0)), e.raw = t, e;
23
14
  }
24
15
 
25
16
  function bind(fn, thisArg) {
@@ -235,6 +226,8 @@ const isFormData = (thing) => {
235
226
  */
236
227
  const isURLSearchParams = kindOfTest('URLSearchParams');
237
228
 
229
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
230
+
238
231
  /**
239
232
  * Trim excess whitespace off the beginning and end of a string
240
233
  *
@@ -623,8 +616,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
623
616
  const noop = () => {};
624
617
 
625
618
  const toFiniteNumber = (value, defaultValue) => {
626
- value = +value;
627
- return Number.isFinite(value) ? value : defaultValue;
619
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
628
620
  };
629
621
 
630
622
  const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
@@ -694,6 +686,36 @@ const isAsyncFn = kindOfTest('AsyncFunction');
694
686
  const isThenable = (thing) =>
695
687
  thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
696
688
 
689
+ // original code
690
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
691
+
692
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
693
+ if (setImmediateSupported) {
694
+ return setImmediate;
695
+ }
696
+
697
+ return postMessageSupported ? ((token, callbacks) => {
698
+ _global.addEventListener("message", ({source, data}) => {
699
+ if (source === _global && data === token) {
700
+ callbacks.length && callbacks.shift()();
701
+ }
702
+ }, false);
703
+
704
+ return (cb) => {
705
+ callbacks.push(cb);
706
+ _global.postMessage(token, "*");
707
+ }
708
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
709
+ })(
710
+ typeof setImmediate === 'function',
711
+ isFunction(_global.postMessage)
712
+ );
713
+
714
+ const asap = typeof queueMicrotask !== 'undefined' ?
715
+ queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
716
+
717
+ // *********************
718
+
697
719
  var utils = {
698
720
  isArray,
699
721
  isArrayBuffer,
@@ -705,6 +727,10 @@ var utils = {
705
727
  isBoolean,
706
728
  isObject,
707
729
  isPlainObject,
730
+ isReadableStream,
731
+ isRequest,
732
+ isResponse,
733
+ isHeaders,
708
734
  isUndefined,
709
735
  isDate,
710
736
  isFile,
@@ -745,7 +771,9 @@ var utils = {
745
771
  isSpecCompliantForm,
746
772
  toJSONObject,
747
773
  isAsyncFn,
748
- isThenable
774
+ isThenable,
775
+ setImmediate: _setImmediate,
776
+ asap
749
777
  };
750
778
 
751
779
  /**
@@ -773,7 +801,10 @@ function AxiosError(message, code, config, request, response) {
773
801
  code && (this.code = code);
774
802
  config && (this.config = config);
775
803
  request && (this.request = request);
776
- response && (this.response = response);
804
+ if (response) {
805
+ this.response = response;
806
+ this.status = response.status ? response.status : null;
807
+ }
777
808
  }
778
809
 
779
810
  utils.inherits(AxiosError, Error, {
@@ -793,7 +824,7 @@ utils.inherits(AxiosError, Error, {
793
824
  // Axios
794
825
  config: utils.toJSONObject(this.config),
795
826
  code: this.code,
796
- status: this.response && this.response.status ? this.response.status : null
827
+ status: this.status
797
828
  };
798
829
  }
799
830
  });
@@ -1259,6 +1290,8 @@ var platform = {
1259
1290
 
1260
1291
  const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1261
1292
 
1293
+ const _navigator = typeof navigator === 'object' && navigator || undefined;
1294
+
1262
1295
  /**
1263
1296
  * Determine if we're running in a standard browser environment
1264
1297
  *
@@ -1276,10 +1309,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
1276
1309
  *
1277
1310
  * @returns {boolean}
1278
1311
  */
1279
- const hasStandardBrowserEnv = (
1280
- (product) => {
1281
- return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1282
- })(typeof navigator !== 'undefined' && navigator.product);
1312
+ const hasStandardBrowserEnv = hasBrowserEnv &&
1313
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1283
1314
 
1284
1315
  /**
1285
1316
  * Determine if we're running in a standard browser webWorker environment
@@ -1299,11 +1330,15 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1299
1330
  );
1300
1331
  })();
1301
1332
 
1333
+ const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1334
+
1302
1335
  var utils$1 = {
1303
1336
  __proto__: null,
1304
1337
  hasBrowserEnv: hasBrowserEnv,
1305
1338
  hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1306
- hasStandardBrowserEnv: hasStandardBrowserEnv
1339
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1340
+ navigator: _navigator,
1341
+ origin: origin
1307
1342
  };
1308
1343
 
1309
1344
  var platform$1 = {
@@ -1443,7 +1478,7 @@ const defaults = {
1443
1478
 
1444
1479
  transitional: transitionalDefaults,
1445
1480
 
1446
- adapter: ['xhr', 'http'],
1481
+ adapter: ['xhr', 'http', 'fetch'],
1447
1482
 
1448
1483
  transformRequest: [function transformRequest(data, headers) {
1449
1484
  const contentType = headers.getContentType() || '';
@@ -1464,7 +1499,8 @@ const defaults = {
1464
1499
  utils.isBuffer(data) ||
1465
1500
  utils.isStream(data) ||
1466
1501
  utils.isFile(data) ||
1467
- utils.isBlob(data)
1502
+ utils.isBlob(data) ||
1503
+ utils.isReadableStream(data)
1468
1504
  ) {
1469
1505
  return data;
1470
1506
  }
@@ -1507,6 +1543,10 @@ const defaults = {
1507
1543
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1508
1544
  const JSONRequested = this.responseType === 'json';
1509
1545
 
1546
+ if (utils.isResponse(data) || utils.isReadableStream(data)) {
1547
+ return data;
1548
+ }
1549
+
1510
1550
  if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1511
1551
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
1512
1552
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
@@ -1708,6 +1748,10 @@ class AxiosHeaders {
1708
1748
  setHeaders(header, valueOrRewrite);
1709
1749
  } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1710
1750
  setHeaders(parseHeaders(header), valueOrRewrite);
1751
+ } else if (utils.isHeaders(header)) {
1752
+ for (const [key, value] of header.entries()) {
1753
+ setHeader(value, key, rewrite);
1754
+ }
1711
1755
  } else {
1712
1756
  header != null && setHeader(valueOrRewrite, header, rewrite);
1713
1757
  }
@@ -1973,96 +2017,153 @@ function settle(resolve, reject, response) {
1973
2017
  }
1974
2018
  }
1975
2019
 
1976
- var cookies = platform$1.hasStandardBrowserEnv ?
2020
+ function parseProtocol(url) {
2021
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2022
+ return match && match[1] || '';
2023
+ }
1977
2024
 
1978
- // Standard browser envs support document.cookie
1979
- {
1980
- write(name, value, expires, path, domain, secure) {
1981
- const cookie = [name + '=' + encodeURIComponent(value)];
2025
+ /**
2026
+ * Calculate data maxRate
2027
+ * @param {Number} [samplesCount= 10]
2028
+ * @param {Number} [min= 1000]
2029
+ * @returns {Function}
2030
+ */
2031
+ function speedometer(samplesCount, min) {
2032
+ samplesCount = samplesCount || 10;
2033
+ const bytes = new Array(samplesCount);
2034
+ const timestamps = new Array(samplesCount);
2035
+ let head = 0;
2036
+ let tail = 0;
2037
+ let firstSampleTS;
1982
2038
 
1983
- utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2039
+ min = min !== undefined ? min : 1000;
1984
2040
 
1985
- utils.isString(path) && cookie.push('path=' + path);
2041
+ return function push(chunkLength) {
2042
+ const now = Date.now();
1986
2043
 
1987
- utils.isString(domain) && cookie.push('domain=' + domain);
2044
+ const startedAt = timestamps[tail];
1988
2045
 
1989
- secure === true && cookie.push('secure');
2046
+ if (!firstSampleTS) {
2047
+ firstSampleTS = now;
2048
+ }
1990
2049
 
1991
- document.cookie = cookie.join('; ');
1992
- },
2050
+ bytes[head] = chunkLength;
2051
+ timestamps[head] = now;
1993
2052
 
1994
- read(name) {
1995
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1996
- return (match ? decodeURIComponent(match[3]) : null);
1997
- },
2053
+ let i = tail;
2054
+ let bytesCount = 0;
1998
2055
 
1999
- remove(name) {
2000
- this.write(name, '', Date.now() - 86400000);
2056
+ while (i !== head) {
2057
+ bytesCount += bytes[i++];
2058
+ i = i % samplesCount;
2001
2059
  }
2002
- }
2003
2060
 
2004
- :
2061
+ head = (head + 1) % samplesCount;
2005
2062
 
2006
- // Non-standard browser env (web workers, react-native) lack needed support.
2007
- {
2008
- write() {},
2009
- read() {
2010
- return null;
2011
- },
2012
- remove() {}
2013
- };
2063
+ if (head === tail) {
2064
+ tail = (tail + 1) % samplesCount;
2065
+ }
2014
2066
 
2015
- /**
2016
- * Determines whether the specified URL is absolute
2017
- *
2018
- * @param {string} url The URL to test
2019
- *
2020
- * @returns {boolean} True if the specified URL is absolute, otherwise false
2021
- */
2022
- function isAbsoluteURL(url) {
2023
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2024
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2025
- // by any combination of letters, digits, plus, period, or hyphen.
2026
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2027
- }
2067
+ if (now - firstSampleTS < min) {
2068
+ return;
2069
+ }
2028
2070
 
2029
- /**
2030
- * Creates a new URL by combining the specified URLs
2031
- *
2032
- * @param {string} baseURL The base URL
2033
- * @param {string} relativeURL The relative URL
2034
- *
2035
- * @returns {string} The combined URL
2036
- */
2037
- function combineURLs(baseURL, relativeURL) {
2038
- return relativeURL
2039
- ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2040
- : baseURL;
2071
+ const passed = startedAt && now - startedAt;
2072
+
2073
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2074
+ };
2041
2075
  }
2042
2076
 
2043
2077
  /**
2044
- * Creates a new URL by combining the baseURL with the requestedURL,
2045
- * only when the requestedURL is not already an absolute URL.
2046
- * If the requestURL is absolute, this function returns the requestedURL untouched.
2047
- *
2048
- * @param {string} baseURL The base URL
2049
- * @param {string} requestedURL Absolute or relative URL to combine
2050
- *
2051
- * @returns {string} The combined full path
2078
+ * Throttle decorator
2079
+ * @param {Function} fn
2080
+ * @param {Number} freq
2081
+ * @return {Function}
2052
2082
  */
2053
- function buildFullPath(baseURL, requestedURL) {
2054
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2055
- return combineURLs(baseURL, requestedURL);
2056
- }
2057
- return requestedURL;
2083
+ function throttle(fn, freq) {
2084
+ let timestamp = 0;
2085
+ let threshold = 1000 / freq;
2086
+ let lastArgs;
2087
+ let timer;
2088
+
2089
+ const invoke = (args, now = Date.now()) => {
2090
+ timestamp = now;
2091
+ lastArgs = null;
2092
+ if (timer) {
2093
+ clearTimeout(timer);
2094
+ timer = null;
2095
+ }
2096
+ fn.apply(null, args);
2097
+ };
2098
+
2099
+ const throttled = (...args) => {
2100
+ const now = Date.now();
2101
+ const passed = now - timestamp;
2102
+ if ( passed >= threshold) {
2103
+ invoke(args, now);
2104
+ } else {
2105
+ lastArgs = args;
2106
+ if (!timer) {
2107
+ timer = setTimeout(() => {
2108
+ timer = null;
2109
+ invoke(lastArgs);
2110
+ }, threshold - passed);
2111
+ }
2112
+ }
2113
+ };
2114
+
2115
+ const flush = () => lastArgs && invoke(lastArgs);
2116
+
2117
+ return [throttled, flush];
2058
2118
  }
2059
2119
 
2120
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2121
+ let bytesNotified = 0;
2122
+ const _speedometer = speedometer(50, 250);
2123
+
2124
+ return throttle(e => {
2125
+ const loaded = e.loaded;
2126
+ const total = e.lengthComputable ? e.total : undefined;
2127
+ const progressBytes = loaded - bytesNotified;
2128
+ const rate = _speedometer(progressBytes);
2129
+ const inRange = loaded <= total;
2130
+
2131
+ bytesNotified = loaded;
2132
+
2133
+ const data = {
2134
+ loaded,
2135
+ total,
2136
+ progress: total ? (loaded / total) : undefined,
2137
+ bytes: progressBytes,
2138
+ rate: rate ? rate : undefined,
2139
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2140
+ event: e,
2141
+ lengthComputable: total != null,
2142
+ [isDownloadStream ? 'download' : 'upload']: true
2143
+ };
2144
+
2145
+ listener(data);
2146
+ }, freq);
2147
+ };
2148
+
2149
+ const progressEventDecorator = (total, throttled) => {
2150
+ const lengthComputable = total != null;
2151
+
2152
+ return [(loaded) => throttled[0]({
2153
+ lengthComputable,
2154
+ total,
2155
+ loaded
2156
+ }), throttled[1]];
2157
+ };
2158
+
2159
+ const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
2160
+
2060
2161
  var isURLSameOrigin = platform$1.hasStandardBrowserEnv ?
2061
2162
 
2062
2163
  // Standard browser envs have full support of the APIs needed to test
2063
2164
  // whether the request URL is of the same origin as current location.
2064
2165
  (function standardBrowserEnv() {
2065
- const msie = /(msie|trident)/i.test(navigator.userAgent);
2166
+ const msie = platform$1.navigator && /(msie|trident)/i.test(platform$1.navigator.userAgent);
2066
2167
  const urlParsingNode = document.createElement('a');
2067
2168
  let originURL;
2068
2169
 
@@ -2120,137 +2221,267 @@ var isURLSameOrigin = platform$1.hasStandardBrowserEnv ?
2120
2221
  };
2121
2222
  })();
2122
2223
 
2123
- function parseProtocol(url) {
2124
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2125
- return match && match[1] || '';
2126
- }
2127
-
2128
- /**
2129
- * Calculate data maxRate
2130
- * @param {Number} [samplesCount= 10]
2131
- * @param {Number} [min= 1000]
2132
- * @returns {Function}
2133
- */
2134
- function speedometer(samplesCount, min) {
2135
- samplesCount = samplesCount || 10;
2136
- const bytes = new Array(samplesCount);
2137
- const timestamps = new Array(samplesCount);
2138
- let head = 0;
2139
- let tail = 0;
2140
- let firstSampleTS;
2141
-
2142
- min = min !== undefined ? min : 1000;
2143
-
2144
- return function push(chunkLength) {
2145
- const now = Date.now();
2224
+ var cookies = platform$1.hasStandardBrowserEnv ?
2146
2225
 
2147
- const startedAt = timestamps[tail];
2226
+ // Standard browser envs support document.cookie
2227
+ {
2228
+ write(name, value, expires, path, domain, secure) {
2229
+ const cookie = [name + '=' + encodeURIComponent(value)];
2148
2230
 
2149
- if (!firstSampleTS) {
2150
- firstSampleTS = now;
2151
- }
2231
+ utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2152
2232
 
2153
- bytes[head] = chunkLength;
2154
- timestamps[head] = now;
2233
+ utils.isString(path) && cookie.push('path=' + path);
2155
2234
 
2156
- let i = tail;
2157
- let bytesCount = 0;
2235
+ utils.isString(domain) && cookie.push('domain=' + domain);
2158
2236
 
2159
- while (i !== head) {
2160
- bytesCount += bytes[i++];
2161
- i = i % samplesCount;
2162
- }
2237
+ secure === true && cookie.push('secure');
2163
2238
 
2164
- head = (head + 1) % samplesCount;
2239
+ document.cookie = cookie.join('; ');
2240
+ },
2165
2241
 
2166
- if (head === tail) {
2167
- tail = (tail + 1) % samplesCount;
2168
- }
2242
+ read(name) {
2243
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2244
+ return (match ? decodeURIComponent(match[3]) : null);
2245
+ },
2169
2246
 
2170
- if (now - firstSampleTS < min) {
2171
- return;
2247
+ remove(name) {
2248
+ this.write(name, '', Date.now() - 86400000);
2172
2249
  }
2250
+ }
2173
2251
 
2174
- const passed = startedAt && now - startedAt;
2252
+ :
2175
2253
 
2176
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2254
+ // Non-standard browser env (web workers, react-native) lack needed support.
2255
+ {
2256
+ write() {},
2257
+ read() {
2258
+ return null;
2259
+ },
2260
+ remove() {}
2177
2261
  };
2178
- }
2179
-
2180
- function progressEventReducer(listener, isDownloadStream) {
2181
- let bytesNotified = 0;
2182
- const _speedometer = speedometer(50, 250);
2183
2262
 
2184
- return e => {
2185
- const loaded = e.loaded;
2186
- const total = e.lengthComputable ? e.total : undefined;
2187
- const progressBytes = loaded - bytesNotified;
2188
- const rate = _speedometer(progressBytes);
2189
- const inRange = loaded <= total;
2263
+ /**
2264
+ * Determines whether the specified URL is absolute
2265
+ *
2266
+ * @param {string} url The URL to test
2267
+ *
2268
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
2269
+ */
2270
+ function isAbsoluteURL(url) {
2271
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2272
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2273
+ // by any combination of letters, digits, plus, period, or hyphen.
2274
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2275
+ }
2190
2276
 
2191
- bytesNotified = loaded;
2277
+ /**
2278
+ * Creates a new URL by combining the specified URLs
2279
+ *
2280
+ * @param {string} baseURL The base URL
2281
+ * @param {string} relativeURL The relative URL
2282
+ *
2283
+ * @returns {string} The combined URL
2284
+ */
2285
+ function combineURLs(baseURL, relativeURL) {
2286
+ return relativeURL
2287
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2288
+ : baseURL;
2289
+ }
2192
2290
 
2193
- const data = {
2194
- loaded,
2195
- total,
2196
- progress: total ? (loaded / total) : undefined,
2197
- bytes: progressBytes,
2198
- rate: rate ? rate : undefined,
2199
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2200
- event: e
2201
- };
2291
+ /**
2292
+ * Creates a new URL by combining the baseURL with the requestedURL,
2293
+ * only when the requestedURL is not already an absolute URL.
2294
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
2295
+ *
2296
+ * @param {string} baseURL The base URL
2297
+ * @param {string} requestedURL Absolute or relative URL to combine
2298
+ *
2299
+ * @returns {string} The combined full path
2300
+ */
2301
+ function buildFullPath(baseURL, requestedURL) {
2302
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
2303
+ return combineURLs(baseURL, requestedURL);
2304
+ }
2305
+ return requestedURL;
2306
+ }
2202
2307
 
2203
- data[isDownloadStream ? 'download' : 'upload'] = true;
2308
+ const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
2204
2309
 
2205
- listener(data);
2310
+ /**
2311
+ * Config-specific merge-function which creates a new config-object
2312
+ * by merging two configuration objects together.
2313
+ *
2314
+ * @param {Object} config1
2315
+ * @param {Object} config2
2316
+ *
2317
+ * @returns {Object} New object resulting from merging config2 to config1
2318
+ */
2319
+ function mergeConfig(config1, config2) {
2320
+ // eslint-disable-next-line no-param-reassign
2321
+ config2 = config2 || {};
2322
+ const config = {};
2323
+
2324
+ function getMergedValue(target, source, caseless) {
2325
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
2326
+ return utils.merge.call({caseless}, target, source);
2327
+ } else if (utils.isPlainObject(source)) {
2328
+ return utils.merge({}, source);
2329
+ } else if (utils.isArray(source)) {
2330
+ return source.slice();
2331
+ }
2332
+ return source;
2333
+ }
2334
+
2335
+ // eslint-disable-next-line consistent-return
2336
+ function mergeDeepProperties(a, b, caseless) {
2337
+ if (!utils.isUndefined(b)) {
2338
+ return getMergedValue(a, b, caseless);
2339
+ } else if (!utils.isUndefined(a)) {
2340
+ return getMergedValue(undefined, a, caseless);
2341
+ }
2342
+ }
2343
+
2344
+ // eslint-disable-next-line consistent-return
2345
+ function valueFromConfig2(a, b) {
2346
+ if (!utils.isUndefined(b)) {
2347
+ return getMergedValue(undefined, b);
2348
+ }
2349
+ }
2350
+
2351
+ // eslint-disable-next-line consistent-return
2352
+ function defaultToConfig2(a, b) {
2353
+ if (!utils.isUndefined(b)) {
2354
+ return getMergedValue(undefined, b);
2355
+ } else if (!utils.isUndefined(a)) {
2356
+ return getMergedValue(undefined, a);
2357
+ }
2358
+ }
2359
+
2360
+ // eslint-disable-next-line consistent-return
2361
+ function mergeDirectKeys(a, b, prop) {
2362
+ if (prop in config2) {
2363
+ return getMergedValue(a, b);
2364
+ } else if (prop in config1) {
2365
+ return getMergedValue(undefined, a);
2366
+ }
2367
+ }
2368
+
2369
+ const mergeMap = {
2370
+ url: valueFromConfig2,
2371
+ method: valueFromConfig2,
2372
+ data: valueFromConfig2,
2373
+ baseURL: defaultToConfig2,
2374
+ transformRequest: defaultToConfig2,
2375
+ transformResponse: defaultToConfig2,
2376
+ paramsSerializer: defaultToConfig2,
2377
+ timeout: defaultToConfig2,
2378
+ timeoutMessage: defaultToConfig2,
2379
+ withCredentials: defaultToConfig2,
2380
+ withXSRFToken: defaultToConfig2,
2381
+ adapter: defaultToConfig2,
2382
+ responseType: defaultToConfig2,
2383
+ xsrfCookieName: defaultToConfig2,
2384
+ xsrfHeaderName: defaultToConfig2,
2385
+ onUploadProgress: defaultToConfig2,
2386
+ onDownloadProgress: defaultToConfig2,
2387
+ decompress: defaultToConfig2,
2388
+ maxContentLength: defaultToConfig2,
2389
+ maxBodyLength: defaultToConfig2,
2390
+ beforeRedirect: defaultToConfig2,
2391
+ transport: defaultToConfig2,
2392
+ httpAgent: defaultToConfig2,
2393
+ httpsAgent: defaultToConfig2,
2394
+ cancelToken: defaultToConfig2,
2395
+ socketPath: defaultToConfig2,
2396
+ responseEncoding: defaultToConfig2,
2397
+ validateStatus: mergeDirectKeys,
2398
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2206
2399
  };
2400
+
2401
+ utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2402
+ const merge = mergeMap[prop] || mergeDeepProperties;
2403
+ const configValue = merge(config1[prop], config2[prop], prop);
2404
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2405
+ });
2406
+
2407
+ return config;
2207
2408
  }
2208
2409
 
2209
- const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2410
+ var resolveConfig = (config) => {
2411
+ const newConfig = mergeConfig({}, config);
2210
2412
 
2211
- var xhrAdapter = isXHRAdapterSupported && function (config) {
2212
- return new Promise(function dispatchXhrRequest(resolve, reject) {
2213
- let requestData = config.data;
2214
- const requestHeaders = AxiosHeaders.from(config.headers).normalize();
2215
- let {responseType, withXSRFToken} = config;
2216
- let onCanceled;
2217
- function done() {
2218
- if (config.cancelToken) {
2219
- config.cancelToken.unsubscribe(onCanceled);
2220
- }
2413
+ let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
2221
2414
 
2222
- if (config.signal) {
2223
- config.signal.removeEventListener('abort', onCanceled);
2224
- }
2415
+ newConfig.headers = headers = AxiosHeaders.from(headers);
2416
+
2417
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
2418
+
2419
+ // HTTP basic authentication
2420
+ if (auth) {
2421
+ headers.set('Authorization', 'Basic ' +
2422
+ btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
2423
+ );
2424
+ }
2425
+
2426
+ let contentType;
2427
+
2428
+ if (utils.isFormData(data)) {
2429
+ if (platform$1.hasStandardBrowserEnv || platform$1.hasStandardBrowserWebWorkerEnv) {
2430
+ headers.setContentType(undefined); // Let the browser set it
2431
+ } else if ((contentType = headers.getContentType()) !== false) {
2432
+ // fix semicolon duplication issue for ReactNative FormData implementation
2433
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2434
+ headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2225
2435
  }
2436
+ }
2437
+
2438
+ // Add xsrf header
2439
+ // This is only done if running in a standard browser environment.
2440
+ // Specifically not if we're in a web worker, or react-native.
2226
2441
 
2227
- let contentType;
2442
+ if (platform$1.hasStandardBrowserEnv) {
2443
+ withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2228
2444
 
2229
- if (utils.isFormData(requestData)) {
2230
- if (platform$1.hasStandardBrowserEnv || platform$1.hasStandardBrowserWebWorkerEnv) {
2231
- requestHeaders.setContentType(false); // Let the browser set it
2232
- } else if ((contentType = requestHeaders.getContentType()) !== false) {
2233
- // fix semicolon duplication issue for ReactNative FormData implementation
2234
- const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2235
- requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2445
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
2446
+ // Add xsrf header
2447
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
2448
+
2449
+ if (xsrfValue) {
2450
+ headers.set(xsrfHeaderName, xsrfValue);
2236
2451
  }
2237
2452
  }
2453
+ }
2238
2454
 
2239
- let request = new XMLHttpRequest();
2455
+ return newConfig;
2456
+ };
2457
+
2458
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2459
+
2460
+ var xhrAdapter = isXHRAdapterSupported && function (config) {
2461
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
2462
+ const _config = resolveConfig(config);
2463
+ let requestData = _config.data;
2464
+ const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
2465
+ let {responseType, onUploadProgress, onDownloadProgress} = _config;
2466
+ let onCanceled;
2467
+ let uploadThrottled, downloadThrottled;
2468
+ let flushUpload, flushDownload;
2469
+
2470
+ function done() {
2471
+ flushUpload && flushUpload(); // flush events
2472
+ flushDownload && flushDownload(); // flush events
2240
2473
 
2241
- // HTTP basic authentication
2242
- if (config.auth) {
2243
- const username = config.auth.username || '';
2244
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
2245
- requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
2474
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
2475
+
2476
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
2246
2477
  }
2247
2478
 
2248
- const fullPath = buildFullPath(config.baseURL, config.url);
2479
+ let request = new XMLHttpRequest();
2249
2480
 
2250
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
2481
+ request.open(_config.method.toUpperCase(), _config.url, true);
2251
2482
 
2252
2483
  // Set the request timeout in MS
2253
- request.timeout = config.timeout;
2484
+ request.timeout = _config.timeout;
2254
2485
 
2255
2486
  function onloadend() {
2256
2487
  if (!request) {
@@ -2330,10 +2561,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2330
2561
 
2331
2562
  // Handle timeout
2332
2563
  request.ontimeout = function handleTimeout() {
2333
- let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
2334
- const transitional = config.transitional || transitionalDefaults;
2335
- if (config.timeoutErrorMessage) {
2336
- timeoutErrorMessage = config.timeoutErrorMessage;
2564
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
2565
+ const transitional = _config.transitional || transitionalDefaults;
2566
+ if (_config.timeoutErrorMessage) {
2567
+ timeoutErrorMessage = _config.timeoutErrorMessage;
2337
2568
  }
2338
2569
  reject(new AxiosError(
2339
2570
  timeoutErrorMessage,
@@ -2345,22 +2576,6 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2345
2576
  request = null;
2346
2577
  };
2347
2578
 
2348
- // Add xsrf header
2349
- // This is only done if running in a standard browser environment.
2350
- // Specifically not if we're in a web worker, or react-native.
2351
- if(platform$1.hasStandardBrowserEnv) {
2352
- withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
2353
-
2354
- if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
2355
- // Add xsrf header
2356
- const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
2357
-
2358
- if (xsrfValue) {
2359
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
2360
- }
2361
- }
2362
- }
2363
-
2364
2579
  // Remove Content-Type if data is undefined
2365
2580
  requestData === undefined && requestHeaders.setContentType(null);
2366
2581
 
@@ -2372,26 +2587,31 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2372
2587
  }
2373
2588
 
2374
2589
  // Add withCredentials to request if needed
2375
- if (!utils.isUndefined(config.withCredentials)) {
2376
- request.withCredentials = !!config.withCredentials;
2590
+ if (!utils.isUndefined(_config.withCredentials)) {
2591
+ request.withCredentials = !!_config.withCredentials;
2377
2592
  }
2378
2593
 
2379
2594
  // Add responseType to request if needed
2380
2595
  if (responseType && responseType !== 'json') {
2381
- request.responseType = config.responseType;
2596
+ request.responseType = _config.responseType;
2382
2597
  }
2383
2598
 
2384
2599
  // Handle progress if needed
2385
- if (typeof config.onDownloadProgress === 'function') {
2386
- request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
2600
+ if (onDownloadProgress) {
2601
+ ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
2602
+ request.addEventListener('progress', downloadThrottled);
2387
2603
  }
2388
2604
 
2389
2605
  // Not all browsers support upload events
2390
- if (typeof config.onUploadProgress === 'function' && request.upload) {
2391
- request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
2606
+ if (onUploadProgress && request.upload) {
2607
+ ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
2608
+
2609
+ request.upload.addEventListener('progress', uploadThrottled);
2610
+
2611
+ request.upload.addEventListener('loadend', flushUpload);
2392
2612
  }
2393
2613
 
2394
- if (config.cancelToken || config.signal) {
2614
+ if (_config.cancelToken || _config.signal) {
2395
2615
  // Handle cancellation
2396
2616
  // eslint-disable-next-line func-names
2397
2617
  onCanceled = cancel => {
@@ -2403,13 +2623,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2403
2623
  request = null;
2404
2624
  };
2405
2625
 
2406
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
2407
- if (config.signal) {
2408
- config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
2626
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
2627
+ if (_config.signal) {
2628
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
2409
2629
  }
2410
2630
  }
2411
2631
 
2412
- const protocol = parseProtocol(fullPath);
2632
+ const protocol = parseProtocol(_config.url);
2413
2633
 
2414
2634
  if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
2415
2635
  reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
@@ -2422,76 +2642,425 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2422
2642
  });
2423
2643
  };
2424
2644
 
2425
- const knownAdapters = {
2426
- http: httpAdapter,
2427
- xhr: xhrAdapter
2428
- };
2645
+ const composeSignals = (signals, timeout) => {
2646
+ const {length} = (signals = signals ? signals.filter(Boolean) : []);
2429
2647
 
2430
- utils.forEach(knownAdapters, (fn, value) => {
2431
- if (fn) {
2432
- try {
2433
- Object.defineProperty(fn, 'name', {value});
2434
- } catch (e) {
2435
- // eslint-disable-next-line no-empty
2436
- }
2437
- Object.defineProperty(fn, 'adapterName', {value});
2438
- }
2439
- });
2648
+ if (timeout || length) {
2649
+ let controller = new AbortController();
2440
2650
 
2441
- const renderReason = (reason) => `- ${reason}`;
2651
+ let aborted;
2442
2652
 
2443
- const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
2653
+ const onabort = function (reason) {
2654
+ if (!aborted) {
2655
+ aborted = true;
2656
+ unsubscribe();
2657
+ const err = reason instanceof Error ? reason : this.reason;
2658
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
2659
+ }
2660
+ };
2444
2661
 
2445
- var adapters = {
2446
- getAdapter: (adapters) => {
2447
- adapters = utils.isArray(adapters) ? adapters : [adapters];
2662
+ let timer = timeout && setTimeout(() => {
2663
+ timer = null;
2664
+ onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
2665
+ }, timeout);
2666
+
2667
+ const unsubscribe = () => {
2668
+ if (signals) {
2669
+ timer && clearTimeout(timer);
2670
+ timer = null;
2671
+ signals.forEach(signal => {
2672
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
2673
+ });
2674
+ signals = null;
2675
+ }
2676
+ };
2448
2677
 
2449
- const {length} = adapters;
2450
- let nameOrAdapter;
2451
- let adapter;
2678
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
2452
2679
 
2453
- const rejectedReasons = {};
2680
+ const {signal} = controller;
2454
2681
 
2455
- for (let i = 0; i < length; i++) {
2456
- nameOrAdapter = adapters[i];
2457
- let id;
2682
+ signal.unsubscribe = () => utils.asap(unsubscribe);
2458
2683
 
2459
- adapter = nameOrAdapter;
2684
+ return signal;
2685
+ }
2686
+ };
2460
2687
 
2461
- if (!isResolvedHandle(nameOrAdapter)) {
2462
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2688
+ const streamChunk = function* (chunk, chunkSize) {
2689
+ let len = chunk.byteLength;
2463
2690
 
2464
- if (adapter === undefined) {
2465
- throw new AxiosError(`Unknown adapter '${id}'`);
2466
- }
2467
- }
2691
+ if (!chunkSize || len < chunkSize) {
2692
+ yield chunk;
2693
+ return;
2694
+ }
2468
2695
 
2469
- if (adapter) {
2696
+ let pos = 0;
2697
+ let end;
2698
+
2699
+ while (pos < len) {
2700
+ end = pos + chunkSize;
2701
+ yield chunk.slice(pos, end);
2702
+ pos = end;
2703
+ }
2704
+ };
2705
+
2706
+ const readBytes = async function* (iterable, chunkSize) {
2707
+ for await (const chunk of readStream(iterable)) {
2708
+ yield* streamChunk(chunk, chunkSize);
2709
+ }
2710
+ };
2711
+
2712
+ const readStream = async function* (stream) {
2713
+ if (stream[Symbol.asyncIterator]) {
2714
+ yield* stream;
2715
+ return;
2716
+ }
2717
+
2718
+ const reader = stream.getReader();
2719
+ try {
2720
+ for (;;) {
2721
+ const {done, value} = await reader.read();
2722
+ if (done) {
2470
2723
  break;
2471
2724
  }
2472
-
2473
- rejectedReasons[id || '#' + i] = adapter;
2725
+ yield value;
2474
2726
  }
2727
+ } finally {
2728
+ await reader.cancel();
2729
+ }
2730
+ };
2475
2731
 
2476
- if (!adapter) {
2732
+ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
2733
+ const iterator = readBytes(stream, chunkSize);
2477
2734
 
2478
- const reasons = Object.entries(rejectedReasons)
2479
- .map(([id, state]) => `adapter ${id} ` +
2480
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
2481
- );
2735
+ let bytes = 0;
2736
+ let done;
2737
+ let _onFinish = (e) => {
2738
+ if (!done) {
2739
+ done = true;
2740
+ onFinish && onFinish(e);
2741
+ }
2742
+ };
2482
2743
 
2483
- let s = length ?
2484
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
2485
- 'as no adapter specified';
2744
+ return new ReadableStream({
2745
+ async pull(controller) {
2746
+ try {
2747
+ const {done, value} = await iterator.next();
2486
2748
 
2487
- throw new AxiosError(
2488
- `There is no suitable adapter to dispatch the request ` + s,
2489
- 'ERR_NOT_SUPPORT'
2490
- );
2749
+ if (done) {
2750
+ _onFinish();
2751
+ controller.close();
2752
+ return;
2753
+ }
2754
+
2755
+ let len = value.byteLength;
2756
+ if (onProgress) {
2757
+ let loadedBytes = bytes += len;
2758
+ onProgress(loadedBytes);
2759
+ }
2760
+ controller.enqueue(new Uint8Array(value));
2761
+ } catch (err) {
2762
+ _onFinish(err);
2763
+ throw err;
2764
+ }
2765
+ },
2766
+ cancel(reason) {
2767
+ _onFinish(reason);
2768
+ return iterator.return();
2491
2769
  }
2770
+ }, {
2771
+ highWaterMark: 2
2772
+ })
2773
+ };
2492
2774
 
2493
- return adapter;
2494
- },
2775
+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
2776
+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
2777
+
2778
+ // used only inside the fetch adapter
2779
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
2780
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
2781
+ async (str) => new Uint8Array(await new Response(str).arrayBuffer())
2782
+ );
2783
+
2784
+ const test = (fn, ...args) => {
2785
+ try {
2786
+ return !!fn(...args);
2787
+ } catch (e) {
2788
+ return false
2789
+ }
2790
+ };
2791
+
2792
+ const supportsRequestStream = isReadableStreamSupported && test(() => {
2793
+ let duplexAccessed = false;
2794
+
2795
+ const hasContentType = new Request(platform$1.origin, {
2796
+ body: new ReadableStream(),
2797
+ method: 'POST',
2798
+ get duplex() {
2799
+ duplexAccessed = true;
2800
+ return 'half';
2801
+ },
2802
+ }).headers.has('Content-Type');
2803
+
2804
+ return duplexAccessed && !hasContentType;
2805
+ });
2806
+
2807
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
2808
+
2809
+ const supportsResponseStream = isReadableStreamSupported &&
2810
+ test(() => utils.isReadableStream(new Response('').body));
2811
+
2812
+
2813
+ const resolvers = {
2814
+ stream: supportsResponseStream && ((res) => res.body)
2815
+ };
2816
+
2817
+ isFetchSupported && (((res) => {
2818
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
2819
+ !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :
2820
+ (_, config) => {
2821
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
2822
+ });
2823
+ });
2824
+ })(new Response));
2825
+
2826
+ const getBodyLength = async (body) => {
2827
+ if (body == null) {
2828
+ return 0;
2829
+ }
2830
+
2831
+ if(utils.isBlob(body)) {
2832
+ return body.size;
2833
+ }
2834
+
2835
+ if(utils.isSpecCompliantForm(body)) {
2836
+ const _request = new Request(platform$1.origin, {
2837
+ method: 'POST',
2838
+ body,
2839
+ });
2840
+ return (await _request.arrayBuffer()).byteLength;
2841
+ }
2842
+
2843
+ if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
2844
+ return body.byteLength;
2845
+ }
2846
+
2847
+ if(utils.isURLSearchParams(body)) {
2848
+ body = body + '';
2849
+ }
2850
+
2851
+ if(utils.isString(body)) {
2852
+ return (await encodeText(body)).byteLength;
2853
+ }
2854
+ };
2855
+
2856
+ const resolveBodyLength = async (headers, body) => {
2857
+ const length = utils.toFiniteNumber(headers.getContentLength());
2858
+
2859
+ return length == null ? getBodyLength(body) : length;
2860
+ };
2861
+
2862
+ var fetchAdapter = isFetchSupported && (async (config) => {
2863
+ let {
2864
+ url,
2865
+ method,
2866
+ data,
2867
+ signal,
2868
+ cancelToken,
2869
+ timeout,
2870
+ onDownloadProgress,
2871
+ onUploadProgress,
2872
+ responseType,
2873
+ headers,
2874
+ withCredentials = 'same-origin',
2875
+ fetchOptions
2876
+ } = resolveConfig(config);
2877
+
2878
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
2879
+
2880
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
2881
+
2882
+ let request;
2883
+
2884
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
2885
+ composedSignal.unsubscribe();
2886
+ });
2887
+
2888
+ let requestContentLength;
2889
+
2890
+ try {
2891
+ if (
2892
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
2893
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
2894
+ ) {
2895
+ let _request = new Request(url, {
2896
+ method: 'POST',
2897
+ body: data,
2898
+ duplex: "half"
2899
+ });
2900
+
2901
+ let contentTypeHeader;
2902
+
2903
+ if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
2904
+ headers.setContentType(contentTypeHeader);
2905
+ }
2906
+
2907
+ if (_request.body) {
2908
+ const [onProgress, flush] = progressEventDecorator(
2909
+ requestContentLength,
2910
+ progressEventReducer(asyncDecorator(onUploadProgress))
2911
+ );
2912
+
2913
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
2914
+ }
2915
+ }
2916
+
2917
+ if (!utils.isString(withCredentials)) {
2918
+ withCredentials = withCredentials ? 'include' : 'omit';
2919
+ }
2920
+
2921
+ // Cloudflare Workers throws when credentials are defined
2922
+ // see https://github.com/cloudflare/workerd/issues/902
2923
+ const isCredentialsSupported = "credentials" in Request.prototype;
2924
+ request = new Request(url, {
2925
+ ...fetchOptions,
2926
+ signal: composedSignal,
2927
+ method: method.toUpperCase(),
2928
+ headers: headers.normalize().toJSON(),
2929
+ body: data,
2930
+ duplex: "half",
2931
+ credentials: isCredentialsSupported ? withCredentials : undefined
2932
+ });
2933
+
2934
+ let response = await fetch(request);
2935
+
2936
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
2937
+
2938
+ if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
2939
+ const options = {};
2940
+
2941
+ ['status', 'statusText', 'headers'].forEach(prop => {
2942
+ options[prop] = response[prop];
2943
+ });
2944
+
2945
+ const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));
2946
+
2947
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
2948
+ responseContentLength,
2949
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
2950
+ ) || [];
2951
+
2952
+ response = new Response(
2953
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
2954
+ flush && flush();
2955
+ unsubscribe && unsubscribe();
2956
+ }),
2957
+ options
2958
+ );
2959
+ }
2960
+
2961
+ responseType = responseType || 'text';
2962
+
2963
+ let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);
2964
+
2965
+ !isStreamResponse && unsubscribe && unsubscribe();
2966
+
2967
+ return await new Promise((resolve, reject) => {
2968
+ settle(resolve, reject, {
2969
+ data: responseData,
2970
+ headers: AxiosHeaders.from(response.headers),
2971
+ status: response.status,
2972
+ statusText: response.statusText,
2973
+ config,
2974
+ request
2975
+ });
2976
+ })
2977
+ } catch (err) {
2978
+ unsubscribe && unsubscribe();
2979
+
2980
+ if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
2981
+ throw Object.assign(
2982
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
2983
+ {
2984
+ cause: err.cause || err
2985
+ }
2986
+ )
2987
+ }
2988
+
2989
+ throw AxiosError.from(err, err && err.code, config, request);
2990
+ }
2991
+ });
2992
+
2993
+ const knownAdapters = {
2994
+ http: httpAdapter,
2995
+ xhr: xhrAdapter,
2996
+ fetch: fetchAdapter
2997
+ };
2998
+
2999
+ utils.forEach(knownAdapters, (fn, value) => {
3000
+ if (fn) {
3001
+ try {
3002
+ Object.defineProperty(fn, 'name', {value});
3003
+ } catch (e) {
3004
+ // eslint-disable-next-line no-empty
3005
+ }
3006
+ Object.defineProperty(fn, 'adapterName', {value});
3007
+ }
3008
+ });
3009
+
3010
+ const renderReason = (reason) => `- ${reason}`;
3011
+
3012
+ const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
3013
+
3014
+ var adapters = {
3015
+ getAdapter: (adapters) => {
3016
+ adapters = utils.isArray(adapters) ? adapters : [adapters];
3017
+
3018
+ const {length} = adapters;
3019
+ let nameOrAdapter;
3020
+ let adapter;
3021
+
3022
+ const rejectedReasons = {};
3023
+
3024
+ for (let i = 0; i < length; i++) {
3025
+ nameOrAdapter = adapters[i];
3026
+ let id;
3027
+
3028
+ adapter = nameOrAdapter;
3029
+
3030
+ if (!isResolvedHandle(nameOrAdapter)) {
3031
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3032
+
3033
+ if (adapter === undefined) {
3034
+ throw new AxiosError(`Unknown adapter '${id}'`);
3035
+ }
3036
+ }
3037
+
3038
+ if (adapter) {
3039
+ break;
3040
+ }
3041
+
3042
+ rejectedReasons[id || '#' + i] = adapter;
3043
+ }
3044
+
3045
+ if (!adapter) {
3046
+
3047
+ const reasons = Object.entries(rejectedReasons)
3048
+ .map(([id, state]) => `adapter ${id} ` +
3049
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
3050
+ );
3051
+
3052
+ let s = length ?
3053
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3054
+ 'as no adapter specified';
3055
+
3056
+ throw new AxiosError(
3057
+ `There is no suitable adapter to dispatch the request ` + s,
3058
+ 'ERR_NOT_SUPPORT'
3059
+ );
3060
+ }
3061
+
3062
+ return adapter;
3063
+ },
2495
3064
  adapters: knownAdapters
2496
3065
  };
2497
3066
 
@@ -2568,109 +3137,7 @@ function dispatchRequest(config) {
2568
3137
  });
2569
3138
  }
2570
3139
 
2571
- const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
2572
-
2573
- /**
2574
- * Config-specific merge-function which creates a new config-object
2575
- * by merging two configuration objects together.
2576
- *
2577
- * @param {Object} config1
2578
- * @param {Object} config2
2579
- *
2580
- * @returns {Object} New object resulting from merging config2 to config1
2581
- */
2582
- function mergeConfig(config1, config2) {
2583
- // eslint-disable-next-line no-param-reassign
2584
- config2 = config2 || {};
2585
- const config = {};
2586
-
2587
- function getMergedValue(target, source, caseless) {
2588
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
2589
- return utils.merge.call({caseless}, target, source);
2590
- } else if (utils.isPlainObject(source)) {
2591
- return utils.merge({}, source);
2592
- } else if (utils.isArray(source)) {
2593
- return source.slice();
2594
- }
2595
- return source;
2596
- }
2597
-
2598
- // eslint-disable-next-line consistent-return
2599
- function mergeDeepProperties(a, b, caseless) {
2600
- if (!utils.isUndefined(b)) {
2601
- return getMergedValue(a, b, caseless);
2602
- } else if (!utils.isUndefined(a)) {
2603
- return getMergedValue(undefined, a, caseless);
2604
- }
2605
- }
2606
-
2607
- // eslint-disable-next-line consistent-return
2608
- function valueFromConfig2(a, b) {
2609
- if (!utils.isUndefined(b)) {
2610
- return getMergedValue(undefined, b);
2611
- }
2612
- }
2613
-
2614
- // eslint-disable-next-line consistent-return
2615
- function defaultToConfig2(a, b) {
2616
- if (!utils.isUndefined(b)) {
2617
- return getMergedValue(undefined, b);
2618
- } else if (!utils.isUndefined(a)) {
2619
- return getMergedValue(undefined, a);
2620
- }
2621
- }
2622
-
2623
- // eslint-disable-next-line consistent-return
2624
- function mergeDirectKeys(a, b, prop) {
2625
- if (prop in config2) {
2626
- return getMergedValue(a, b);
2627
- } else if (prop in config1) {
2628
- return getMergedValue(undefined, a);
2629
- }
2630
- }
2631
-
2632
- const mergeMap = {
2633
- url: valueFromConfig2,
2634
- method: valueFromConfig2,
2635
- data: valueFromConfig2,
2636
- baseURL: defaultToConfig2,
2637
- transformRequest: defaultToConfig2,
2638
- transformResponse: defaultToConfig2,
2639
- paramsSerializer: defaultToConfig2,
2640
- timeout: defaultToConfig2,
2641
- timeoutMessage: defaultToConfig2,
2642
- withCredentials: defaultToConfig2,
2643
- withXSRFToken: defaultToConfig2,
2644
- adapter: defaultToConfig2,
2645
- responseType: defaultToConfig2,
2646
- xsrfCookieName: defaultToConfig2,
2647
- xsrfHeaderName: defaultToConfig2,
2648
- onUploadProgress: defaultToConfig2,
2649
- onDownloadProgress: defaultToConfig2,
2650
- decompress: defaultToConfig2,
2651
- maxContentLength: defaultToConfig2,
2652
- maxBodyLength: defaultToConfig2,
2653
- beforeRedirect: defaultToConfig2,
2654
- transport: defaultToConfig2,
2655
- httpAgent: defaultToConfig2,
2656
- httpsAgent: defaultToConfig2,
2657
- cancelToken: defaultToConfig2,
2658
- socketPath: defaultToConfig2,
2659
- responseEncoding: defaultToConfig2,
2660
- validateStatus: mergeDirectKeys,
2661
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2662
- };
2663
-
2664
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2665
- const merge = mergeMap[prop] || mergeDeepProperties;
2666
- const configValue = merge(config1[prop], config2[prop], prop);
2667
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2668
- });
2669
-
2670
- return config;
2671
- }
2672
-
2673
- const VERSION = "1.6.8";
3140
+ const VERSION = "1.7.7";
2674
3141
 
2675
3142
  const validators = {};
2676
3143
 
@@ -2796,12 +3263,15 @@ class Axios {
2796
3263
 
2797
3264
  // slice off the Error: ... line
2798
3265
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
2799
-
2800
- if (!err.stack) {
2801
- err.stack = stack;
2802
- // match without the 2 top stack lines
2803
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
2804
- err.stack += '\n' + stack;
3266
+ try {
3267
+ if (!err.stack) {
3268
+ err.stack = stack;
3269
+ // match without the 2 top stack lines
3270
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3271
+ err.stack += '\n' + stack;
3272
+ }
3273
+ } catch (e) {
3274
+ // ignore the case where "stack" is an un-writable property
2805
3275
  }
2806
3276
  }
2807
3277
 
@@ -3072,8 +3542,22 @@ class CancelToken {
3072
3542
  }
3073
3543
  }
3074
3544
 
3075
- /**
3076
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3545
+ toAbortSignal() {
3546
+ const controller = new AbortController();
3547
+
3548
+ const abort = (err) => {
3549
+ controller.abort(err);
3550
+ };
3551
+
3552
+ this.subscribe(abort);
3553
+
3554
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
3555
+
3556
+ return controller.signal;
3557
+ }
3558
+
3559
+ /**
3560
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
3077
3561
  * cancels the `CancelToken`.
3078
3562
  */
3079
3563
  static source() {
@@ -3360,43 +3844,42 @@ var appReducer = function appReducer(state, action) {
3360
3844
  }
3361
3845
  };
3362
3846
 
3847
+ /**
3848
+ * Convert array of 16 byte values to UUID string format of the form:
3849
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
3850
+ */
3851
+ var byteToHex = [];
3852
+ for (var i = 0; i < 256; ++i) {
3853
+ byteToHex.push((i + 0x100).toString(16).slice(1));
3854
+ }
3855
+ function unsafeStringify(arr, offset = 0) {
3856
+ // Note: Be careful editing this code! It's been tuned for performance
3857
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
3858
+ //
3859
+ // Note to future-self: No, you can't remove the `toLowerCase()` call.
3860
+ // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
3861
+ 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();
3862
+ }
3863
+
3363
3864
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
3364
3865
  // require the crypto API and do not support built-in fallback to lower quality random number
3365
3866
  // generators (like Math.random()).
3366
- let getRandomValues;
3367
- const rnds8 = new Uint8Array(16);
3867
+
3868
+ var getRandomValues;
3869
+ var rnds8 = new Uint8Array(16);
3368
3870
  function rng() {
3369
3871
  // lazy load so that environments that need to polyfill have a chance to do so
3370
3872
  if (!getRandomValues) {
3371
3873
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
3372
3874
  getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
3373
-
3374
3875
  if (!getRandomValues) {
3375
3876
  throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
3376
3877
  }
3377
3878
  }
3378
-
3379
3879
  return getRandomValues(rnds8);
3380
3880
  }
3381
3881
 
3382
- /**
3383
- * Convert array of 16 byte values to UUID string format of the form:
3384
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
3385
- */
3386
-
3387
- const byteToHex = [];
3388
-
3389
- for (let i = 0; i < 256; ++i) {
3390
- byteToHex.push((i + 0x100).toString(16).slice(1));
3391
- }
3392
-
3393
- function unsafeStringify(arr, offset = 0) {
3394
- // Note: Be careful editing this code! It's been tuned for performance
3395
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
3396
- 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]];
3397
- }
3398
-
3399
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
3882
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
3400
3883
  var native = {
3401
3884
  randomUUID
3402
3885
  };
@@ -3405,23 +3888,21 @@ function v4(options, buf, offset) {
3405
3888
  if (native.randomUUID && !buf && !options) {
3406
3889
  return native.randomUUID();
3407
3890
  }
3408
-
3409
3891
  options = options || {};
3410
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
3892
+ var rnds = options.random || (options.rng || rng)();
3411
3893
 
3894
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
3412
3895
  rnds[6] = rnds[6] & 0x0f | 0x40;
3413
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
3896
+ rnds[8] = rnds[8] & 0x3f | 0x80;
3414
3897
 
3898
+ // Copy bytes to buffer, if provided
3415
3899
  if (buf) {
3416
3900
  offset = offset || 0;
3417
-
3418
- for (let i = 0; i < 16; ++i) {
3901
+ for (var i = 0; i < 16; ++i) {
3419
3902
  buf[offset + i] = rnds[i];
3420
3903
  }
3421
-
3422
3904
  return buf;
3423
3905
  }
3424
-
3425
3906
  return unsafeStringify(rnds);
3426
3907
  }
3427
3908
 
@@ -3479,7 +3960,7 @@ var AppProvider = function AppProvider(_ref) {
3479
3960
  var baseUrls = {
3480
3961
  inference: {
3481
3962
  production: 'https://inference.bibot.app/v0',
3482
- test: 'https://inference.dev.bibot.thespuka.com/v0'
3963
+ test: 'https://inference.dev.bibot.app/v0'
3483
3964
  }
3484
3965
  };
3485
3966
  var endpoints = {
@@ -3552,7 +4033,7 @@ var recordPredefinedQ = function recordPredefinedQ(pluginAxiosInstance, data) {
3552
4033
  return Promise.reject(e);
3553
4034
  }
3554
4035
  };
3555
- var handleRetries = function handleRetries(pluginAxiosInstance, data, attempt) {
4036
+ var _handleRetries4 = function handleRetries(pluginAxiosInstance, data, attempt) {
3556
4037
  try {
3557
4038
  var maxAttempts = 30;
3558
4039
  var delay = 10000;
@@ -3569,7 +4050,7 @@ var handleRetries = function handleRetries(pluginAxiosInstance, data, attempt) {
3569
4050
  tries: attempt + 1
3570
4051
  }))).then(function (res) {
3571
4052
  if (res.message === defaultSlacker) {
3572
- return Promise.resolve(handleRetries(pluginAxiosInstance, data, attempt + 1));
4053
+ return Promise.resolve(_handleRetries4(pluginAxiosInstance, data, attempt + 1));
3573
4054
  } else {
3574
4055
  return res;
3575
4056
  }
@@ -3590,14 +4071,14 @@ var askBiBot = function askBiBot(pluginAxiosInstance, data) {
3590
4071
  var path = "" + domain.inference + resources.q;
3591
4072
  return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
3592
4073
  if (response.data.message === defaultSlacker || response.status === 504) {
3593
- return Promise.resolve(handleRetries(pluginAxiosInstance, data, 1));
4074
+ return Promise.resolve(_handleRetries4(pluginAxiosInstance, data, 1));
3594
4075
  } else {
3595
4076
  return response.data;
3596
4077
  }
3597
4078
  });
3598
4079
  }, function (error) {
3599
4080
  if (error.message === timeoutMessage) {
3600
- return Promise.resolve(handleRetries(pluginAxiosInstance, data, 1));
4081
+ return Promise.resolve(_handleRetries4(pluginAxiosInstance, data, 1));
3601
4082
  } else {
3602
4083
  return {
3603
4084
  message: error.message
@@ -3734,7 +4215,7 @@ var useBiBotChatBot = function useBiBotChatBot(bibotProps) {
3734
4215
  var _useState = useState(true),
3735
4216
  showPredefinedQuestions = _useState[0],
3736
4217
  setShowPredefinedQuestions = _useState[1];
3737
- var _useState2 = useState(false),
4218
+ var _useState2 = useState(true),
3738
4219
  chatIsOpen = _useState2[0],
3739
4220
  setChatIsOpen = _useState2[1];
3740
4221
  var _useState3 = useState([]),
@@ -3968,344 +4449,60 @@ var Avatar = function Avatar(_ref) {
3968
4449
  })));
3969
4450
  };
3970
4451
 
3971
- var useOnlineStatus = function useOnlineStatus() {
3972
- var _useState = useState(navigator.onLine),
3973
- isOnline = _useState[0],
3974
- setIsOnline = _useState[1];
3975
- var updateOnlineStatus = function updateOnlineStatus() {
3976
- setIsOnline(navigator.onLine);
3977
- };
3978
- useEffect(function () {
3979
- window.addEventListener('online', updateOnlineStatus);
3980
- window.addEventListener('offline', updateOnlineStatus);
3981
- return function () {
3982
- window.removeEventListener('online', updateOnlineStatus);
3983
- window.removeEventListener('offline', updateOnlineStatus);
3984
- };
3985
- }, []);
3986
- return isOnline;
3987
- };
3988
-
3989
- /******************************************************************************
3990
- Copyright (c) Microsoft Corporation.
3991
-
3992
- Permission to use, copy, modify, and/or distribute this software for any
3993
- purpose with or without fee is hereby granted.
3994
-
3995
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3996
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3997
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3998
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3999
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4000
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4001
- PERFORMANCE OF THIS SOFTWARE.
4002
- ***************************************************************************** */
4003
-
4004
- var __assign = function() {
4005
- __assign = Object.assign || function __assign(t) {
4006
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4007
- s = arguments[i];
4008
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
4009
- }
4010
- return t;
4011
- };
4012
- return __assign.apply(this, arguments);
4013
- };
4014
-
4015
- function __spreadArray(to, from, pack) {
4016
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4017
- if (ar || !(i in from)) {
4018
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4019
- ar[i] = from[i];
4020
- }
4021
- }
4022
- return to.concat(ar || Array.prototype.slice.call(from));
4023
- }
4024
-
4025
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
4026
- var e = new Error(message);
4027
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4028
- };
4029
-
4030
- function memoize(fn) {
4031
- var cache = Object.create(null);
4032
- return function (arg) {
4033
- if (cache[arg] === undefined) cache[arg] = fn(arg);
4034
- return cache[arg];
4035
- };
4036
- }
4037
-
4038
- 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
4039
-
4040
- var isPropValid = /* #__PURE__ */memoize(function (prop) {
4041
- return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
4042
- /* o */
4043
- && prop.charCodeAt(1) === 110
4044
- /* n */
4045
- && prop.charCodeAt(2) < 91;
4046
- }
4047
- /* Z+1 */
4048
- );
4049
-
4050
- 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 ""}))}}//# sourceMappingURL=stylis.mjs.map
4051
-
4052
- var unitlessKeys = {
4053
- animationIterationCount: 1,
4054
- aspectRatio: 1,
4055
- borderImageOutset: 1,
4056
- borderImageSlice: 1,
4057
- borderImageWidth: 1,
4058
- boxFlex: 1,
4059
- boxFlexGroup: 1,
4060
- boxOrdinalGroup: 1,
4061
- columnCount: 1,
4062
- columns: 1,
4063
- flex: 1,
4064
- flexGrow: 1,
4065
- flexPositive: 1,
4066
- flexShrink: 1,
4067
- flexNegative: 1,
4068
- flexOrder: 1,
4069
- gridRow: 1,
4070
- gridRowEnd: 1,
4071
- gridRowSpan: 1,
4072
- gridRowStart: 1,
4073
- gridColumn: 1,
4074
- gridColumnEnd: 1,
4075
- gridColumnSpan: 1,
4076
- gridColumnStart: 1,
4077
- msGridRow: 1,
4078
- msGridRowSpan: 1,
4079
- msGridColumn: 1,
4080
- msGridColumnSpan: 1,
4081
- fontWeight: 1,
4082
- lineHeight: 1,
4083
- opacity: 1,
4084
- order: 1,
4085
- orphans: 1,
4086
- tabSize: 1,
4087
- widows: 1,
4088
- zIndex: 1,
4089
- zoom: 1,
4090
- WebkitLineClamp: 1,
4091
- // SVG-related properties
4092
- fillOpacity: 1,
4093
- floodOpacity: 1,
4094
- stopOpacity: 1,
4095
- strokeDasharray: 1,
4096
- strokeDashoffset: 1,
4097
- strokeMiterlimit: 1,
4098
- strokeOpacity: 1,
4099
- strokeWidth: 1
4100
- };
4101
-
4102
- 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));},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 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&&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&&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,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);//# sourceMappingURL=styled-components.browser.esm.js.map
4103
-
4104
- var _templateObject, _templateObject2;
4105
- 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"])));
4106
- 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);
4107
- var Loader = function Loader() {
4108
- return React__default.createElement(LoaderDiv, null);
4109
- };
4110
-
4111
- var PredefinedQuestions = function PredefinedQuestions(_ref) {
4112
- var questions = _ref.questions,
4113
- onSelect = _ref.onSelect,
4114
- chatBubbleConfig = _ref.chatBubbleConfig;
4452
+ var ChatHeader = function ChatHeader(_ref) {
4453
+ var _chatBubbleConfig$col;
4454
+ var chatBubbleConfig = _ref.chatBubbleConfig,
4455
+ isLoading = _ref.isLoading,
4456
+ isOnline = _ref.isOnline;
4115
4457
  return createElement("div", {
4458
+ className: styles['chat-header'],
4116
4459
  style: {
4117
- height: '100dvh',
4118
- color: '#000',
4119
- backgroundColor: 'transparent',
4120
- padding: 10,
4121
- borderRadius: '6px',
4122
- marginBottom: '30px'
4460
+ backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
4461
+ borderTopLeftRadius: 8,
4462
+ borderTopRightRadius: 8,
4463
+ display: 'flex',
4464
+ flexDirection: 'column',
4465
+ justifyContent: 'space-between',
4466
+ paddingInline: 15,
4467
+ paddingBlock: 15
4123
4468
  }
4124
4469
  }, createElement("div", {
4125
4470
  style: {
4126
4471
  display: 'flex',
4127
- flexDirection: 'column'
4472
+ justifyContent: 'flex-start',
4473
+ alignItems: 'center'
4128
4474
  }
4129
4475
  }, createElement("div", {
4130
4476
  style: {
4477
+ alignItems: 'center',
4131
4478
  display: 'flex',
4132
- alignItems: 'center'
4479
+ color: '#fff',
4480
+ fontWeight: 'bold'
4133
4481
  }
4134
4482
  }, createElement(Avatar, {
4135
- borderColor: '#fff',
4136
- width: '36px',
4137
- height: '36px',
4483
+ borderColor: 'transparent',
4484
+ indicator: isOnline ? 'green' : '#dedede',
4485
+ width: '50px',
4486
+ height: '50px',
4138
4487
  source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
4139
- }), createElement("small", {
4488
+ })), createElement("div", {
4140
4489
  style: {
4141
- marginLeft: 5
4490
+ display: 'flex',
4491
+ flexDirection: 'column',
4492
+ textAlign: 'left',
4493
+ paddingLeft: '10px',
4494
+ justifyContent: 'flex-end',
4495
+ color: '#fff',
4496
+ width: '100%'
4142
4497
  }
4143
- }, " ", chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title)), createElement("div", {
4498
+ }, createElement("span", {
4144
4499
  style: {
4145
- backgroundColor: '#dedede',
4146
- marginBottom: 20,
4147
- width: 300,
4148
- marginLeft: 15,
4149
- marginTop: 5,
4150
- borderTopRightRadius: 20,
4151
- borderBottomRightRadius: 20,
4152
- borderBottomLeftRadius: 20
4500
+ fontWeight: 'bold',
4501
+ fontSize: 18
4153
4502
  }
4154
- }, createElement("p", {
4503
+ }, chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title), isLoading ? createElement("span", {
4155
4504
  style: {
4156
- fontSize: '16px',
4157
- paddingLeft: 10
4158
- }
4159
- }, "Are you looking for answers to any of these questions? Click for an answer "))), questions.map(function (question, index) {
4160
- var _chatBubbleConfig$col;
4161
- return createElement("div", {
4162
- key: index,
4163
- style: {
4164
- backgroundColor: '#fafafa',
4165
- border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
4166
- fontSize: '16px',
4167
- margin: '7px',
4168
- textAlign: 'start',
4169
- padding: '14px',
4170
- borderRadius: '16px',
4171
- cursor: 'pointer'
4172
- },
4173
- onClick: function onClick() {
4174
- onSelect(question);
4175
- }
4176
- }, question.question);
4177
- }));
4178
- };
4179
-
4180
- var AiFollowUps = function AiFollowUps(_ref) {
4181
- var questions = _ref.questions,
4182
- onSelect = _ref.onSelect,
4183
- chatBubbleConfig = _ref.chatBubbleConfig;
4184
- return createElement("div", {
4185
- style: {
4186
- height: '100%',
4187
- color: '#000',
4188
- padding: 10,
4189
- borderRadius: '6px',
4190
- marginBottom: '20px'
4191
- }
4192
- }, questions.map(function (question, index) {
4193
- var _chatBubbleConfig$col;
4194
- return createElement("div", {
4195
- key: index,
4196
- style: {
4197
- backgroundColor: '#fafafa',
4198
- border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
4199
- fontSize: '16px',
4200
- margin: '7px',
4201
- textAlign: 'start',
4202
- padding: '14px',
4203
- borderRadius: '15px',
4204
- cursor: 'pointer'
4205
- },
4206
- onClick: function onClick() {
4207
- onSelect(question);
4208
- }
4209
- }, question.question);
4210
- }));
4211
- };
4212
-
4213
- var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4214
- var _chatBubbleConfig$col, _chatBubbleConfig$col2;
4215
- var _useBiBotChatBot = useBiBotChatBot(bibotProps),
4216
- chatIsOpen = _useBiBotChatBot.chatIsOpen,
4217
- messages = _useBiBotChatBot.messages,
4218
- isLoading = _useBiBotChatBot.isLoading,
4219
- messageEndRef = _useBiBotChatBot.messageEndRef,
4220
- userInput = _useBiBotChatBot.userInput,
4221
- handleUserInput = _useBiBotChatBot.handleUserInput,
4222
- handleKeyPress = _useBiBotChatBot.handleKeyPress,
4223
- sendInputInquiry = _useBiBotChatBot.sendInputInquiry,
4224
- toggleChat = _useBiBotChatBot.toggleChat,
4225
- chatBubbleConfig = _useBiBotChatBot.chatBubbleConfig,
4226
- showPredefinedQuestions = _useBiBotChatBot.showPredefinedQuestions,
4227
- predefinedQuestions = _useBiBotChatBot.predefinedQuestions,
4228
- aiFollowUpQs = _useBiBotChatBot.aiFollowUpQs,
4229
- handlePredefinedQuestionSelect = _useBiBotChatBot.handlePredefinedQuestionSelect;
4230
- var isOnline = useOnlineStatus();
4231
- 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?';
4232
- var _React$useState = useState(true),
4233
- isGreetingVisible = _React$useState[0],
4234
- setGreetingVisible = _React$useState[1];
4235
- var handleCloseGreeting = function handleCloseGreeting() {
4236
- setGreetingVisible(false);
4237
- };
4238
- return createElement("div", {
4239
- className: "chat-bubble " + (chatIsOpen ? 'open' : ''),
4240
- style: {
4241
- position: 'fixed',
4242
- bottom: '20px',
4243
- right: '20px',
4244
- zIndex: 9999
4245
- }
4246
- }, chatIsOpen && createElement("div", {
4247
- style: {
4248
- backgroundColor: '#fff',
4249
- position: 'absolute',
4250
- bottom: '60px',
4251
- right: '25px',
4252
- width: 370,
4253
- height: 550,
4254
- borderRadius: 10,
4255
- display: 'flex',
4256
- flexDirection: 'column',
4257
- justifyContent: 'space-between',
4258
- boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)'
4259
- }
4260
- }, createElement("div", {
4261
- className: styles['chat-header'],
4262
- style: {
4263
- backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
4264
- borderTopLeftRadius: 8,
4265
- borderTopRightRadius: 8,
4266
- display: 'flex',
4267
- flexDirection: 'column',
4268
- justifyContent: 'space-between',
4269
- paddingInline: 15,
4270
- paddingBlock: 15
4271
- }
4272
- }, createElement("div", {
4273
- style: {
4274
- display: 'flex',
4275
- justifyContent: 'flex-start',
4276
- alignItems: 'center'
4277
- }
4278
- }, createElement("div", {
4279
- style: {
4280
- alignItems: 'center',
4281
- display: 'flex',
4282
- color: '#fff',
4283
- fontWeight: 'bold'
4284
- }
4285
- }, createElement(Avatar, {
4286
- borderColor: 'transparent',
4287
- indicator: isOnline ? 'green' : '#dedede',
4288
- width: '70px',
4289
- height: '70px',
4290
- source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
4291
- })), createElement("div", {
4292
- style: {
4293
- display: 'flex',
4294
- flexDirection: 'column',
4295
- textAlign: 'left',
4296
- paddingLeft: '10px',
4297
- justifyContent: 'flex-end',
4298
- color: '#fff',
4299
- width: '100%'
4300
- }
4301
- }, createElement("span", {
4302
- style: {
4303
- fontWeight: 'bold',
4304
- fontSize: 18
4305
- }
4306
- }, chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title), isLoading ? createElement("span", {
4307
- style: {
4308
- fontSize: '12px'
4505
+ fontSize: '12px'
4309
4506
  }
4310
4507
  }, "Typing...") : createElement("div", {
4311
4508
  style: {
@@ -4329,21 +4526,191 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4329
4526
  paddingRight: 10,
4330
4527
  color: '#dedede'
4331
4528
  }
4332
- }, !chatBubbleConfig.title ? 'Bot' : chatBubbleConfig.title, " can make mistake "))), createElement("div", {
4333
- className: styles['message-list'],
4529
+ }, !(chatBubbleConfig !== null && chatBubbleConfig !== void 0 && chatBubbleConfig.title) ? 'Bot' : chatBubbleConfig.title, " can make mistake", ' ')));
4530
+ };
4531
+
4532
+ var MarkdownView = function MarkdownView(_ref) {
4533
+ var content = _ref.content;
4534
+ var parseContent = function parseContent(text) {
4535
+ var lines = text.split('\n');
4536
+ return lines.map(function (line) {
4537
+ if (/^#{1,6}\s/.test(line)) {
4538
+ var _line$match;
4539
+ var level = ((_line$match = line.match(/^#{1,6}/)) === null || _line$match === void 0 ? void 0 : _line$match[0].length) || 1;
4540
+ var headingText = line.replace(/^#{1,6}\s/, '');
4541
+ return {
4542
+ type: 'heading',
4543
+ content: headingText,
4544
+ level: level
4545
+ };
4546
+ }
4547
+ if (/^(\-{3,}|\*{3,}|_{3,})$/.test(line)) {
4548
+ return {
4549
+ type: 'horizontalRule',
4550
+ content: ''
4551
+ };
4552
+ }
4553
+ if (/^>\s/.test(line)) {
4554
+ var quoteText = line.replace(/^>\s/, '');
4555
+ return {
4556
+ type: 'blockquote',
4557
+ content: quoteText
4558
+ };
4559
+ }
4560
+ if (line.startsWith('```') && line.endsWith('```')) {
4561
+ var codeContent = line.slice(3, -3).trim();
4562
+ return {
4563
+ type: 'code',
4564
+ content: codeContent
4565
+ };
4566
+ }
4567
+ if (/`[^`]+`/.test(line)) {
4568
+ return {
4569
+ type: 'inlineCode',
4570
+ content: line.split(/(`[^`]+`)/).map(function (part, index) {
4571
+ return part.startsWith('`') && part.endsWith('`') ? React__default.createElement("code", {
4572
+ key: index
4573
+ }, part.slice(1, -1)) : part;
4574
+ })
4575
+ };
4576
+ }
4577
+ if (/\*\*\*[^*]+\*\*\*/.test(line)) {
4578
+ var _content = line.replace(/\*\*\*([^*]+)\*\*\*/g, '<strong><em>$1</em></strong>');
4579
+ return {
4580
+ type: 'text',
4581
+ content: _content
4582
+ };
4583
+ }
4584
+ if (/\*\*[^*]+\*\*/.test(line)) {
4585
+ var _content2 = line.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
4586
+ return {
4587
+ type: 'text',
4588
+ content: _content2
4589
+ };
4590
+ }
4591
+ if (/\*[^*]+\*/.test(line)) {
4592
+ var _content3 = line.replace(/\*([^*]+)\*/g, '<em>$1</em>');
4593
+ return {
4594
+ type: 'text',
4595
+ content: _content3
4596
+ };
4597
+ }
4598
+ if (/^\d+\.\s/.test(line)) {
4599
+ var listItem = line.replace(/^\d+\.\s/, '');
4600
+ return {
4601
+ type: 'orderedList',
4602
+ content: listItem
4603
+ };
4604
+ }
4605
+ if (/^(\s*[-*]\s+)/.test(line)) {
4606
+ var _listItem = line.replace(/^[-*]\s+/, '');
4607
+ return {
4608
+ type: 'unorderedList',
4609
+ content: _listItem
4610
+ };
4611
+ }
4612
+ if (/~~[^~]+~~/.test(line)) {
4613
+ var _content4 = line.replace(/~~([^~]+)~~/g, '<del>$1</del>');
4614
+ return {
4615
+ type: 'text',
4616
+ content: _content4
4617
+ };
4618
+ }
4619
+ if (/\[([^\]]+)\]\(([^)]+)\)/.test(line)) {
4620
+ var match = line.match(/\[([^\]]+)\]\(([^)]+)\)/);
4621
+ if (match) {
4622
+ return {
4623
+ type: 'link',
4624
+ content: React__default.createElement("a", {
4625
+ href: match[2],
4626
+ target: "_blank",
4627
+ rel: "noopener noreferrer"
4628
+ }, match[1])
4629
+ };
4630
+ }
4631
+ }
4632
+ if (/!\[([^\]]+)\]\(([^)]+)\)/.test(line)) {
4633
+ var _match = line.match(/!\[([^\]]+)\]\(([^)]+)\)/);
4634
+ if (_match) {
4635
+ return {
4636
+ type: 'image',
4637
+ content: React__default.createElement("img", {
4638
+ src: _match[2],
4639
+ alt: _match[1]
4640
+ })
4641
+ };
4642
+ }
4643
+ }
4644
+ return {
4645
+ type: 'text',
4646
+ content: line
4647
+ };
4648
+ });
4649
+ };
4650
+ var transformElements = function transformElements(parsed) {
4651
+ return parsed.map(function (element, index) {
4652
+ switch (element.type) {
4653
+ case 'heading':
4654
+ return React__default.createElement("h" + element.level, {
4655
+ key: index
4656
+ }, element.content);
4657
+ case 'horizontalRule':
4658
+ return React__default.createElement("hr", {
4659
+ key: index
4660
+ });
4661
+ case 'blockquote':
4662
+ return React__default.createElement("blockquote", {
4663
+ key: index
4664
+ }, element.content);
4665
+ case 'code':
4666
+ return React__default.createElement("pre", {
4667
+ className: "code-block",
4668
+ key: index
4669
+ }, React__default.createElement("code", null, element.content));
4670
+ case 'inlineCode':
4671
+ return React__default.createElement("p", {
4672
+ key: index
4673
+ }, element.content);
4674
+ case 'unorderedList':
4675
+ return React__default.createElement("ul", {
4676
+ key: index
4677
+ }, React__default.createElement("li", null, element.content));
4678
+ case 'orderedList':
4679
+ return React__default.createElement("ol", {
4680
+ key: index
4681
+ }, React__default.createElement("li", null, element.content));
4682
+ case 'link':
4683
+ case 'image':
4684
+ return React__default.createElement("span", {
4685
+ key: index
4686
+ }, element.content);
4687
+ case 'text':
4688
+ default:
4689
+ return React__default.createElement("span", {
4690
+ key: index,
4691
+ dangerouslySetInnerHTML: {
4692
+ __html: String(element.content)
4693
+ }
4694
+ });
4695
+ }
4696
+ });
4697
+ };
4698
+ var parsedElements = parseContent(content);
4699
+ var transformedElements = transformElements(parsedElements);
4700
+ return React__default.createElement("div", {
4701
+ className: "markdown-view"
4702
+ }, transformedElements);
4703
+ };
4704
+
4705
+ var MessageList = function MessageList(_ref) {
4706
+ var messages = _ref.messages,
4707
+ chatBubbleConfig = _ref.chatBubbleConfig;
4708
+ return createElement("div", {
4334
4709
  style: {
4335
- height: 'calc(100% - 100px)',
4336
- overflowY: 'auto',
4337
- padding: 10,
4338
4710
  display: 'flex',
4339
- flexGrow: 1,
4340
4711
  flexDirection: 'column'
4341
4712
  }
4342
- }, showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && createElement(PredefinedQuestions, {
4343
- questions: predefinedQuestions.slice(0, 3),
4344
- onSelect: handlePredefinedQuestionSelect,
4345
- chatBubbleConfig: chatBubbleConfig
4346
- }), messages.map(function (message, index) {
4713
+ }, messages.map(function (message, index) {
4347
4714
  return message.sender === 'user' ? createElement("div", {
4348
4715
  key: index,
4349
4716
  className: '',
@@ -4355,12 +4722,14 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4355
4722
  borderBottomLeftRadius: 15,
4356
4723
  maxWidth: '70%',
4357
4724
  alignSelf: 'flex-end',
4358
- fontSize: '15px',
4725
+ fontSize: '16px',
4359
4726
  backgroundColor: '#b8b8b8c6',
4360
4727
  color: '#000',
4361
4728
  textAlign: 'left'
4362
4729
  }
4363
- }, message.text) : createElement("div", {
4730
+ }, createElement(MarkdownView, {
4731
+ content: message.text
4732
+ })) : createElement("div", {
4364
4733
  key: index,
4365
4734
  style: {
4366
4735
  display: 'flex',
@@ -4373,8 +4742,8 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4373
4742
  }
4374
4743
  }, " ", createElement(Avatar, {
4375
4744
  borderColor: '#fff',
4376
- width: '20px',
4377
- height: '20px',
4745
+ width: '15px',
4746
+ height: '15px',
4378
4747
  source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
4379
4748
  }), createElement("small", {
4380
4749
  style: {
@@ -4390,25 +4759,26 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4390
4759
  borderBottomLeftRadius: 15,
4391
4760
  maxWidth: '70%',
4392
4761
  alignSelf: 'flex-start',
4393
- fontSize: '15px',
4762
+ fontSize: '16px',
4394
4763
  backgroundColor: '#f0f0f0',
4395
4764
  color: '#000',
4396
4765
  textAlign: 'left',
4397
4766
  margin: 5
4398
4767
  }
4399
- }, message.text));
4400
- }), aiFollowUpQs && !isLoading && createElement(AiFollowUps, {
4401
- questions: aiFollowUpQs,
4402
- onSelect: handlePredefinedQuestionSelect,
4403
- chatBubbleConfig: chatBubbleConfig
4404
- }), isLoading && createElement("div", {
4405
- style: {
4406
- marginLeft: '20px'
4407
- },
4408
- className: 'message'
4409
- }, ' ', createElement(Loader, null)), createElement("div", {
4410
- ref: messageEndRef
4411
- })), createElement("div", {
4768
+ }, createElement(MarkdownView, {
4769
+ content: message.text
4770
+ })));
4771
+ }));
4772
+ };
4773
+
4774
+ var InputArea = function InputArea(_ref) {
4775
+ var userInput = _ref.userInput,
4776
+ handleUserInput = _ref.handleUserInput,
4777
+ handleKeyPress = _ref.handleKeyPress,
4778
+ sendInputInquiry = _ref.sendInputInquiry,
4779
+ isLoading = _ref.isLoading,
4780
+ chatBubbleConfig = _ref.chatBubbleConfig;
4781
+ return createElement("div", {
4412
4782
  className: styles['input-area'],
4413
4783
  style: {
4414
4784
  display: 'flex',
@@ -4446,48 +4816,342 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4446
4816
  }
4447
4817
  }, createElement(SendMessageIcon, {
4448
4818
  color: isLoading ? '#cdcdcd' : chatBubbleConfig.color
4449
- }))), chatBubbleConfig.powered_by_bibot && createElement("div", {
4450
- style: {
4451
- backgroundColor: '#f9f9f9',
4452
- minHeight: 45,
4453
- display: 'flex',
4454
- flexDirection: 'column',
4455
- alignItems: 'center',
4456
- justifyContent: 'center',
4457
- borderTop: '1px solid #f9f9f9',
4458
- borderBottomLeftRadius: 10,
4459
- borderBottomRightRadius: 10
4460
- }
4461
- }, createElement("a", {
4462
- href: 'https://bibot.app',
4463
- target: '_blank',
4819
+ })));
4820
+ };
4821
+
4822
+ var AiFollowUps = function AiFollowUps(_ref) {
4823
+ var questions = _ref.questions,
4824
+ onSelect = _ref.onSelect,
4825
+ chatBubbleConfig = _ref.chatBubbleConfig;
4826
+ return createElement("div", {
4464
4827
  style: {
4465
- textDecoration: 'none'
4828
+ height: '100%',
4829
+ color: '#000',
4830
+ padding: 10,
4831
+ borderRadius: '6px',
4832
+ marginBottom: '20px'
4466
4833
  }
4467
- }, " ", createElement("small", {
4834
+ }, questions.map(function (question, index) {
4835
+ var _chatBubbleConfig$col;
4836
+ return createElement("div", {
4837
+ key: index,
4838
+ style: {
4839
+ backgroundColor: '#fafafa',
4840
+ border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
4841
+ fontSize: '16px',
4842
+ margin: '7px',
4843
+ textAlign: 'start',
4844
+ padding: '14px',
4845
+ borderRadius: '15px',
4846
+ cursor: 'pointer'
4847
+ },
4848
+ onClick: function onClick() {
4849
+ onSelect(question);
4850
+ }
4851
+ }, question.question);
4852
+ }));
4853
+ };
4854
+
4855
+ var PredefinedQuestions = function PredefinedQuestions(_ref) {
4856
+ var questions = _ref.questions,
4857
+ onSelect = _ref.onSelect,
4858
+ chatBubbleConfig = _ref.chatBubbleConfig;
4859
+ return createElement("div", {
4468
4860
  style: {
4469
- color: '#9ba6b2',
4470
- fontSize: 10,
4471
- marginBlock: 5
4861
+ height: '100dvh',
4862
+ color: '#000',
4863
+ backgroundColor: 'transparent',
4864
+ padding: 10,
4865
+ borderRadius: '6px',
4866
+ marginBottom: '30px'
4472
4867
  }
4473
- }, "Powered by ", createElement("span", {
4868
+ }, createElement("div", {
4474
4869
  style: {
4475
- fontWeight: 'bold',
4476
- color: '#1f4760'
4870
+ display: 'flex',
4871
+ flexDirection: 'column'
4477
4872
  }
4478
- }, "BIBOT"))))), createElement("div", {
4873
+ }, createElement("div", {
4479
4874
  style: {
4480
4875
  display: 'flex',
4876
+ alignItems: 'center'
4877
+ }
4878
+ }, createElement(Avatar, {
4879
+ borderColor: '#fff',
4880
+ width: '36px',
4881
+ height: '36px',
4882
+ source: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.logo_url
4883
+ }), createElement("small", {
4884
+ style: {
4885
+ marginLeft: 5
4886
+ }
4887
+ }, " ", chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.title)), createElement("div", {
4888
+ style: {
4889
+ backgroundColor: '#dedede',
4890
+ marginBottom: 20,
4891
+ width: 300,
4892
+ marginLeft: 15,
4893
+ marginTop: 5,
4894
+ borderTopRightRadius: 20,
4895
+ borderBottomRightRadius: 20,
4896
+ borderBottomLeftRadius: 20
4897
+ }
4898
+ }, createElement("p", {
4899
+ style: {
4900
+ fontSize: '16px',
4901
+ paddingLeft: 10
4902
+ }
4903
+ }, "Are you looking for answers to any of these questions? Click for an answer", ' '))), questions.map(function (question, index) {
4904
+ var _chatBubbleConfig$col;
4905
+ return createElement("div", {
4906
+ key: index,
4907
+ style: {
4908
+ backgroundColor: '#fafafa',
4909
+ border: "0.3px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
4910
+ fontSize: '16px',
4911
+ margin: '7px',
4912
+ textAlign: 'start',
4913
+ padding: '14px',
4914
+ borderRadius: '16px',
4915
+ cursor: 'pointer'
4916
+ },
4917
+ onClick: function onClick() {
4918
+ onSelect(question);
4919
+ }
4920
+ }, question.question);
4921
+ }));
4922
+ };
4923
+
4924
+ /******************************************************************************
4925
+ Copyright (c) Microsoft Corporation.
4926
+
4927
+ Permission to use, copy, modify, and/or distribute this software for any
4928
+ purpose with or without fee is hereby granted.
4929
+
4930
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4931
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4932
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4933
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4934
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4935
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4936
+ PERFORMANCE OF THIS SOFTWARE.
4937
+ ***************************************************************************** */
4938
+
4939
+ var __assign = function() {
4940
+ __assign = Object.assign || function __assign(t) {
4941
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4942
+ s = arguments[i];
4943
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
4944
+ }
4945
+ return t;
4946
+ };
4947
+ return __assign.apply(this, arguments);
4948
+ };
4949
+
4950
+ function __spreadArray(to, from, pack) {
4951
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4952
+ if (ar || !(i in from)) {
4953
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4954
+ ar[i] = from[i];
4955
+ }
4956
+ }
4957
+ return to.concat(ar || Array.prototype.slice.call(from));
4958
+ }
4959
+
4960
+ var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
4961
+ var e = new Error(message);
4962
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4963
+ };
4964
+
4965
+ function memoize(fn) {
4966
+ var cache = Object.create(null);
4967
+ return function (arg) {
4968
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
4969
+ return cache[arg];
4970
+ };
4971
+ }
4972
+
4973
+ 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
4974
+
4975
+ var isPropValid = /* #__PURE__ */memoize(function (prop) {
4976
+ return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
4977
+ /* o */
4978
+ && prop.charCodeAt(1) === 110
4979
+ /* n */
4980
+ && prop.charCodeAt(2) < 91;
4981
+ }
4982
+ /* Z+1 */
4983
+ );
4984
+
4985
+ 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 ""}))}}//# sourceMappingURL=stylis.mjs.map
4986
+
4987
+ var unitlessKeys = {
4988
+ animationIterationCount: 1,
4989
+ aspectRatio: 1,
4990
+ borderImageOutset: 1,
4991
+ borderImageSlice: 1,
4992
+ borderImageWidth: 1,
4993
+ boxFlex: 1,
4994
+ boxFlexGroup: 1,
4995
+ boxOrdinalGroup: 1,
4996
+ columnCount: 1,
4997
+ columns: 1,
4998
+ flex: 1,
4999
+ flexGrow: 1,
5000
+ flexPositive: 1,
5001
+ flexShrink: 1,
5002
+ flexNegative: 1,
5003
+ flexOrder: 1,
5004
+ gridRow: 1,
5005
+ gridRowEnd: 1,
5006
+ gridRowSpan: 1,
5007
+ gridRowStart: 1,
5008
+ gridColumn: 1,
5009
+ gridColumnEnd: 1,
5010
+ gridColumnSpan: 1,
5011
+ gridColumnStart: 1,
5012
+ msGridRow: 1,
5013
+ msGridRowSpan: 1,
5014
+ msGridColumn: 1,
5015
+ msGridColumnSpan: 1,
5016
+ fontWeight: 1,
5017
+ lineHeight: 1,
5018
+ opacity: 1,
5019
+ order: 1,
5020
+ orphans: 1,
5021
+ tabSize: 1,
5022
+ widows: 1,
5023
+ zIndex: 1,
5024
+ zoom: 1,
5025
+ WebkitLineClamp: 1,
5026
+ // SVG-related properties
5027
+ fillOpacity: 1,
5028
+ floodOpacity: 1,
5029
+ stopOpacity: 1,
5030
+ strokeDasharray: 1,
5031
+ strokeDashoffset: 1,
5032
+ strokeMiterlimit: 1,
5033
+ strokeOpacity: 1,
5034
+ strokeWidth: 1
5035
+ };
5036
+
5037
+ 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));},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 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&&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&&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,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);//# sourceMappingURL=styled-components.browser.esm.js.map
5038
+
5039
+ var _templateObject, _templateObject2, _templateObject3;
5040
+ 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"])));
5041
+ 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"])));
5042
+ 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);
5043
+ var Loader = function Loader() {
5044
+ return React__default.createElement(LoaderContainer, null, React__default.createElement(Dot, null), React__default.createElement(Dot, null), React__default.createElement(Dot, null));
5045
+ };
5046
+
5047
+ var ChatWindow = function ChatWindow(_ref) {
5048
+ var chatBubbleConfig = _ref.chatBubbleConfig,
5049
+ messages = _ref.messages,
5050
+ isLoading = _ref.isLoading,
5051
+ aiFollowUpQs = _ref.aiFollowUpQs,
5052
+ showPredefinedQuestions = _ref.showPredefinedQuestions,
5053
+ predefinedQuestions = _ref.predefinedQuestions,
5054
+ userInput = _ref.userInput,
5055
+ handleUserInput = _ref.handleUserInput,
5056
+ handleKeyPress = _ref.handleKeyPress,
5057
+ sendInputInquiry = _ref.sendInputInquiry,
5058
+ handlePredefinedQuestionSelect = _ref.handlePredefinedQuestionSelect,
5059
+ isOnline = _ref.isOnline,
5060
+ messageEndRef = _ref.messageEndRef;
5061
+ return createElement("div", {
5062
+ style: {
5063
+ backgroundColor: '#fff',
5064
+ position: 'absolute',
5065
+ bottom: '60px',
5066
+ right: '25px',
5067
+ width: 370,
5068
+ height: 550,
5069
+ borderRadius: 10,
5070
+ display: 'flex',
5071
+ flexDirection: 'column',
5072
+ justifyContent: 'space-between',
5073
+ boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)'
5074
+ }
5075
+ }, createElement(ChatHeader, {
5076
+ chatBubbleConfig: chatBubbleConfig,
5077
+ isLoading: isLoading,
5078
+ isOnline: isOnline
5079
+ }), createElement("div", {
5080
+ className: styles['message-list'],
5081
+ style: {
5082
+ height: 'calc(100% - 100px)',
5083
+ overflowY: 'auto',
5084
+ padding: 10,
5085
+ display: 'flex',
5086
+ flexGrow: 1,
5087
+ flexDirection: 'column'
5088
+ }
5089
+ }, showPredefinedQuestions && (predefinedQuestions === null || predefinedQuestions === void 0 ? void 0 : predefinedQuestions.length) > 0 && createElement(PredefinedQuestions, {
5090
+ questions: predefinedQuestions.slice(0, 3),
5091
+ onSelect: handlePredefinedQuestionSelect,
5092
+ chatBubbleConfig: chatBubbleConfig
5093
+ }), createElement(MessageList, {
5094
+ messages: messages,
5095
+ chatBubbleConfig: chatBubbleConfig
5096
+ }), aiFollowUpQs && !isLoading && createElement(AiFollowUps, {
5097
+ questions: aiFollowUpQs,
5098
+ onSelect: handlePredefinedQuestionSelect,
5099
+ chatBubbleConfig: chatBubbleConfig
5100
+ }), isLoading && createElement("div", {
5101
+ style: {
5102
+ marginLeft: '20px'
5103
+ },
5104
+ className: 'message'
5105
+ }, ' ', createElement(Loader, null)), createElement("div", {
5106
+ ref: messageEndRef
5107
+ })), createElement(InputArea, {
5108
+ chatBubbleConfig: chatBubbleConfig,
5109
+ isLoading: isLoading,
5110
+ handleUserInput: handleUserInput,
5111
+ userInput: userInput,
5112
+ handleKeyPress: handleKeyPress,
5113
+ sendInputInquiry: sendInputInquiry
5114
+ }), chatBubbleConfig.powered_by_bibot && createElement("div", {
5115
+ style: {
5116
+ backgroundColor: '#f9f9f9',
5117
+ minHeight: 45,
5118
+ display: 'flex',
5119
+ flexDirection: 'column',
4481
5120
  alignItems: 'center',
4482
- padding: '0 10px'
5121
+ justifyContent: 'center',
5122
+ borderTop: '1px solid #f9f9f9',
5123
+ borderBottomLeftRadius: 10,
5124
+ borderBottomRightRadius: 10
5125
+ }
5126
+ }, createElement("a", {
5127
+ href: 'https://bibot.app',
5128
+ target: '_blank',
5129
+ style: {
5130
+ textDecoration: 'none'
5131
+ }
5132
+ }, ' ', createElement("small", {
5133
+ style: {
5134
+ color: '#9ba6b2',
5135
+ fontSize: 10,
5136
+ marginBlock: 5
5137
+ }
5138
+ }, "Powered by", ' ', createElement("span", {
5139
+ style: {
5140
+ fontWeight: 'bold',
5141
+ color: '#1f4760'
4483
5142
  }
4484
- }, isGreetingVisible && createElement("span", {
5143
+ }, "BIBOT")))));
5144
+ };
5145
+
5146
+ var GreetingMessage = function GreetingMessage(_ref) {
5147
+ var greeting = _ref.greeting,
5148
+ chatBubbleConfig = _ref.chatBubbleConfig,
5149
+ handleCloseGreeting = _ref.handleCloseGreeting;
5150
+ return createElement("span", {
4485
5151
  style: {
4486
5152
  fontSize: '12px',
4487
5153
  color: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color,
4488
5154
  textAlign: 'left',
4489
- marginRight: '5px',
4490
- whiteSpace: 'nowrap',
4491
5155
  backgroundColor: '#fff',
4492
5156
  padding: 15,
4493
5157
  borderTopRightRadius: 30,
@@ -4509,11 +5173,64 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4509
5173
  color: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color,
4510
5174
  fontSize: '14px'
4511
5175
  }
4512
- }, "\xD7")), createElement("button", {
5176
+ }, "\xD7"));
5177
+ };
5178
+
5179
+ var ChatBubbleContainer = function ChatBubbleContainer(_ref) {
5180
+ var _chatBubbleConfig$col;
5181
+ var messages = _ref.messages,
5182
+ isLoading = _ref.isLoading,
5183
+ showPredefinedQuestions = _ref.showPredefinedQuestions,
5184
+ predefinedQuestions = _ref.predefinedQuestions,
5185
+ userInput = _ref.userInput,
5186
+ handleUserInput = _ref.handleUserInput,
5187
+ handleKeyPress = _ref.handleKeyPress,
5188
+ sendInputInquiry = _ref.sendInputInquiry,
5189
+ handlePredefinedQuestionSelect = _ref.handlePredefinedQuestionSelect,
5190
+ chatIsOpen = _ref.chatIsOpen,
5191
+ toggleChat = _ref.toggleChat,
5192
+ chatBubbleConfig = _ref.chatBubbleConfig,
5193
+ isGreetingVisible = _ref.isGreetingVisible,
5194
+ greeting = _ref.greeting,
5195
+ handleCloseGreeting = _ref.handleCloseGreeting,
5196
+ isOnline = _ref.isOnline,
5197
+ messageEndRef = _ref.messageEndRef;
5198
+ return createElement("div", {
5199
+ className: "chat-bubble " + (chatIsOpen ? 'open' : ''),
5200
+ style: {
5201
+ position: 'fixed',
5202
+ bottom: '20px',
5203
+ right: '20px',
5204
+ zIndex: 9999
5205
+ }
5206
+ }, chatIsOpen && createElement(ChatWindow, {
5207
+ chatBubbleConfig: chatBubbleConfig,
5208
+ messages: messages,
5209
+ isLoading: isLoading,
5210
+ showPredefinedQuestions: showPredefinedQuestions,
5211
+ predefinedQuestions: predefinedQuestions,
5212
+ userInput: userInput,
5213
+ handleUserInput: handleUserInput,
5214
+ handleKeyPress: handleKeyPress,
5215
+ sendInputInquiry: sendInputInquiry,
5216
+ handlePredefinedQuestionSelect: handlePredefinedQuestionSelect,
5217
+ isOnline: isOnline,
5218
+ messageEndRef: messageEndRef
5219
+ }), createElement("div", {
5220
+ style: {
5221
+ display: 'flex',
5222
+ alignItems: 'center',
5223
+ padding: '0 10px'
5224
+ }
5225
+ }, isGreetingVisible && createElement(GreetingMessage, {
5226
+ greeting: greeting,
5227
+ chatBubbleConfig: chatBubbleConfig,
5228
+ handleCloseGreeting: handleCloseGreeting
5229
+ }), createElement("button", {
4513
5230
  onClick: toggleChat,
4514
5231
  className: styles['chat-toggle'],
4515
5232
  style: {
4516
- backgroundColor: (_chatBubbleConfig$col2 = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col2 : '#dedede',
5233
+ backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
4517
5234
  color: '#fff',
4518
5235
  borderRadius: '50%',
4519
5236
  cursor: 'pointer',
@@ -4522,12 +5239,73 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4522
5239
  display: 'flex',
4523
5240
  alignItems: 'center',
4524
5241
  justifyContent: 'center',
4525
- border: 'none',
4526
- position: 'relative'
5242
+ border: 'none'
4527
5243
  }
4528
5244
  }, chatIsOpen ? createElement(CloseIcon, null) : createElement(ChatIcon, null))));
4529
5245
  };
4530
5246
 
5247
+ var useOnlineStatus = function useOnlineStatus() {
5248
+ var _useState = useState(navigator.onLine),
5249
+ isOnline = _useState[0],
5250
+ setIsOnline = _useState[1];
5251
+ var updateOnlineStatus = function updateOnlineStatus() {
5252
+ setIsOnline(navigator.onLine);
5253
+ };
5254
+ useEffect(function () {
5255
+ window.addEventListener('online', updateOnlineStatus);
5256
+ window.addEventListener('offline', updateOnlineStatus);
5257
+ return function () {
5258
+ window.removeEventListener('online', updateOnlineStatus);
5259
+ window.removeEventListener('offline', updateOnlineStatus);
5260
+ };
5261
+ }, []);
5262
+ return isOnline;
5263
+ };
5264
+
5265
+ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
5266
+ var _useBiBotChatBot = useBiBotChatBot(bibotProps),
5267
+ chatIsOpen = _useBiBotChatBot.chatIsOpen,
5268
+ messages = _useBiBotChatBot.messages,
5269
+ isLoading = _useBiBotChatBot.isLoading,
5270
+ userInput = _useBiBotChatBot.userInput,
5271
+ handleUserInput = _useBiBotChatBot.handleUserInput,
5272
+ handleKeyPress = _useBiBotChatBot.handleKeyPress,
5273
+ sendInputInquiry = _useBiBotChatBot.sendInputInquiry,
5274
+ toggleChat = _useBiBotChatBot.toggleChat,
5275
+ chatBubbleConfig = _useBiBotChatBot.chatBubbleConfig,
5276
+ showPredefinedQuestions = _useBiBotChatBot.showPredefinedQuestions,
5277
+ predefinedQuestions = _useBiBotChatBot.predefinedQuestions,
5278
+ handlePredefinedQuestionSelect = _useBiBotChatBot.handlePredefinedQuestionSelect,
5279
+ messageEndRef = _useBiBotChatBot.messageEndRef;
5280
+ var isOnline = useOnlineStatus();
5281
+ 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?';
5282
+ var _React$useState = useState(true),
5283
+ isGreetingVisible = _React$useState[0],
5284
+ setGreetingVisible = _React$useState[1];
5285
+ var handleCloseGreeting = function handleCloseGreeting() {
5286
+ setGreetingVisible(false);
5287
+ };
5288
+ return createElement(ChatBubbleContainer, {
5289
+ chatBubbleConfig: chatBubbleConfig,
5290
+ messages: messages,
5291
+ isLoading: isLoading,
5292
+ showPredefinedQuestions: showPredefinedQuestions,
5293
+ predefinedQuestions: predefinedQuestions,
5294
+ userInput: userInput,
5295
+ handleUserInput: handleUserInput,
5296
+ handleKeyPress: handleKeyPress,
5297
+ sendInputInquiry: sendInputInquiry,
5298
+ chatIsOpen: chatIsOpen,
5299
+ toggleChat: toggleChat,
5300
+ isGreetingVisible: isGreetingVisible,
5301
+ greeting: greeting,
5302
+ handleCloseGreeting: handleCloseGreeting,
5303
+ handlePredefinedQuestionSelect: handlePredefinedQuestionSelect,
5304
+ isOnline: isOnline,
5305
+ messageEndRef: messageEndRef
5306
+ });
5307
+ };
5308
+
4531
5309
  var BiBot = function BiBot(bibotProps) {
4532
5310
  var clientId = bibotProps.clientId,
4533
5311
  client_session_id = bibotProps.client_session_id,