acsi-core 0.2.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
2
2
 
3
- var history = require('history');
4
3
  var toolkit = require('@reduxjs/toolkit');
5
4
  var React = require('react');
6
5
  var React__default = _interopDefault(React);
@@ -11,13 +10,8 @@ var reactRouterDom = require('react-router-dom');
11
10
  var reactstrap = require('reactstrap');
12
11
  var ReactSelect = require('react-select');
13
12
  var ReactSelect__default = _interopDefault(ReactSelect);
14
- var ReactMarkdown = _interopDefault(require('react-markdown'));
15
- var remarkMath = _interopDefault(require('remark-math'));
16
- var remarkGfm = _interopDefault(require('remark-gfm'));
17
- var rehypeKatex = _interopDefault(require('rehype-katex'));
18
- var remarkRehype = _interopDefault(require('remark-rehype'));
19
- var rehypeRaw = _interopDefault(require('rehype-raw'));
20
13
  require('katex/dist/katex.min.css');
14
+ var renderMathInElement = _interopDefault(require('katex/contrib/auto-render'));
21
15
  var Cookies = _interopDefault(require('js-cookie'));
22
16
  var moment = _interopDefault(require('moment'));
23
17
  var reactToastify = require('react-toastify');
@@ -29,6 +23,592 @@ var Sentry = require('@sentry/react');
29
23
  var fa = require('react-icons/fa');
30
24
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
31
25
 
26
+ function _extends() {
27
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
28
+ for (var e = 1; e < arguments.length; e++) {
29
+ var t = arguments[e];
30
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
31
+ }
32
+ return n;
33
+ }, _extends.apply(null, arguments);
34
+ }
35
+
36
+ function isAbsolute(pathname) {
37
+ return pathname.charAt(0) === '/';
38
+ }
39
+
40
+ // About 1.5x faster than the two-arg version of Array#splice()
41
+ function spliceOne(list, index) {
42
+ for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
43
+ list[i] = list[k];
44
+ }
45
+
46
+ list.pop();
47
+ }
48
+
49
+ // This implementation is based heavily on node's url.parse
50
+ function resolvePathname(to, from) {
51
+ if (from === undefined) from = '';
52
+
53
+ var toParts = (to && to.split('/')) || [];
54
+ var fromParts = (from && from.split('/')) || [];
55
+
56
+ var isToAbs = to && isAbsolute(to);
57
+ var isFromAbs = from && isAbsolute(from);
58
+ var mustEndAbs = isToAbs || isFromAbs;
59
+
60
+ if (to && isAbsolute(to)) {
61
+ // to is absolute
62
+ fromParts = toParts;
63
+ } else if (toParts.length) {
64
+ // to is relative, drop the filename
65
+ fromParts.pop();
66
+ fromParts = fromParts.concat(toParts);
67
+ }
68
+
69
+ if (!fromParts.length) return '/';
70
+
71
+ var hasTrailingSlash;
72
+ if (fromParts.length) {
73
+ var last = fromParts[fromParts.length - 1];
74
+ hasTrailingSlash = last === '.' || last === '..' || last === '';
75
+ } else {
76
+ hasTrailingSlash = false;
77
+ }
78
+
79
+ var up = 0;
80
+ for (var i = fromParts.length; i >= 0; i--) {
81
+ var part = fromParts[i];
82
+
83
+ if (part === '.') {
84
+ spliceOne(fromParts, i);
85
+ } else if (part === '..') {
86
+ spliceOne(fromParts, i);
87
+ up++;
88
+ } else if (up) {
89
+ spliceOne(fromParts, i);
90
+ up--;
91
+ }
92
+ }
93
+
94
+ if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
95
+
96
+ if (
97
+ mustEndAbs &&
98
+ fromParts[0] !== '' &&
99
+ (!fromParts[0] || !isAbsolute(fromParts[0]))
100
+ )
101
+ fromParts.unshift('');
102
+
103
+ var result = fromParts.join('/');
104
+
105
+ if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
106
+
107
+ return result;
108
+ }
109
+
110
+ var isProduction = process.env.NODE_ENV === 'production';
111
+ function warning(condition, message) {
112
+ if (!isProduction) {
113
+ if (condition) {
114
+ return;
115
+ }
116
+
117
+ var text = "Warning: " + message;
118
+
119
+ if (typeof console !== 'undefined') {
120
+ console.warn(text);
121
+ }
122
+
123
+ try {
124
+ throw Error(text);
125
+ } catch (x) {}
126
+ }
127
+ }
128
+
129
+ var isProduction$1 = process.env.NODE_ENV === 'production';
130
+ var prefix = 'Invariant failed';
131
+ function invariant(condition, message) {
132
+ if (condition) {
133
+ return;
134
+ }
135
+ if (isProduction$1) {
136
+ throw new Error(prefix);
137
+ }
138
+ var provided = typeof message === 'function' ? message() : message;
139
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
140
+ throw new Error(value);
141
+ }
142
+
143
+ function addLeadingSlash(path) {
144
+ return path.charAt(0) === '/' ? path : '/' + path;
145
+ }
146
+ function hasBasename(path, prefix) {
147
+ return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
148
+ }
149
+ function stripBasename(path, prefix) {
150
+ return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
151
+ }
152
+ function stripTrailingSlash(path) {
153
+ return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
154
+ }
155
+ function parsePath(path) {
156
+ var pathname = path || '/';
157
+ var search = '';
158
+ var hash = '';
159
+ var hashIndex = pathname.indexOf('#');
160
+
161
+ if (hashIndex !== -1) {
162
+ hash = pathname.substr(hashIndex);
163
+ pathname = pathname.substr(0, hashIndex);
164
+ }
165
+
166
+ var searchIndex = pathname.indexOf('?');
167
+
168
+ if (searchIndex !== -1) {
169
+ search = pathname.substr(searchIndex);
170
+ pathname = pathname.substr(0, searchIndex);
171
+ }
172
+
173
+ return {
174
+ pathname: pathname,
175
+ search: search === '?' ? '' : search,
176
+ hash: hash === '#' ? '' : hash
177
+ };
178
+ }
179
+ function createPath(location) {
180
+ var pathname = location.pathname,
181
+ search = location.search,
182
+ hash = location.hash;
183
+ var path = pathname || '/';
184
+ if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
185
+ if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
186
+ return path;
187
+ }
188
+
189
+ function createLocation(path, state, key, currentLocation) {
190
+ var location;
191
+
192
+ if (typeof path === 'string') {
193
+ // Two-arg form: push(path, state)
194
+ location = parsePath(path);
195
+ location.state = state;
196
+ } else {
197
+ // One-arg form: push(location)
198
+ location = _extends({}, path);
199
+ if (location.pathname === undefined) location.pathname = '';
200
+
201
+ if (location.search) {
202
+ if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
203
+ } else {
204
+ location.search = '';
205
+ }
206
+
207
+ if (location.hash) {
208
+ if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
209
+ } else {
210
+ location.hash = '';
211
+ }
212
+
213
+ if (state !== undefined && location.state === undefined) location.state = state;
214
+ }
215
+
216
+ try {
217
+ location.pathname = decodeURI(location.pathname);
218
+ } catch (e) {
219
+ if (e instanceof URIError) {
220
+ throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
221
+ } else {
222
+ throw e;
223
+ }
224
+ }
225
+
226
+ if (key) location.key = key;
227
+
228
+ if (currentLocation) {
229
+ // Resolve incomplete/relative pathname relative to current location.
230
+ if (!location.pathname) {
231
+ location.pathname = currentLocation.pathname;
232
+ } else if (location.pathname.charAt(0) !== '/') {
233
+ location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
234
+ }
235
+ } else {
236
+ // When there is no prior location and pathname is empty, set it to /
237
+ if (!location.pathname) {
238
+ location.pathname = '/';
239
+ }
240
+ }
241
+
242
+ return location;
243
+ }
244
+
245
+ function createTransitionManager() {
246
+ var prompt = null;
247
+
248
+ function setPrompt(nextPrompt) {
249
+ process.env.NODE_ENV !== "production" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;
250
+ prompt = nextPrompt;
251
+ return function () {
252
+ if (prompt === nextPrompt) prompt = null;
253
+ };
254
+ }
255
+
256
+ function confirmTransitionTo(location, action, getUserConfirmation, callback) {
257
+ // TODO: If another transition starts while we're still confirming
258
+ // the previous one, we may end up in a weird state. Figure out the
259
+ // best way to handle this.
260
+ if (prompt != null) {
261
+ var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
262
+
263
+ if (typeof result === 'string') {
264
+ if (typeof getUserConfirmation === 'function') {
265
+ getUserConfirmation(result, callback);
266
+ } else {
267
+ process.env.NODE_ENV !== "production" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
268
+ callback(true);
269
+ }
270
+ } else {
271
+ // Return false from a transition hook to cancel the transition.
272
+ callback(result !== false);
273
+ }
274
+ } else {
275
+ callback(true);
276
+ }
277
+ }
278
+
279
+ var listeners = [];
280
+
281
+ function appendListener(fn) {
282
+ var isActive = true;
283
+
284
+ function listener() {
285
+ if (isActive) fn.apply(void 0, arguments);
286
+ }
287
+
288
+ listeners.push(listener);
289
+ return function () {
290
+ isActive = false;
291
+ listeners = listeners.filter(function (item) {
292
+ return item !== listener;
293
+ });
294
+ };
295
+ }
296
+
297
+ function notifyListeners() {
298
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
299
+ args[_key] = arguments[_key];
300
+ }
301
+
302
+ listeners.forEach(function (listener) {
303
+ return listener.apply(void 0, args);
304
+ });
305
+ }
306
+
307
+ return {
308
+ setPrompt: setPrompt,
309
+ confirmTransitionTo: confirmTransitionTo,
310
+ appendListener: appendListener,
311
+ notifyListeners: notifyListeners
312
+ };
313
+ }
314
+
315
+ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
316
+ function getConfirmation(message, callback) {
317
+ callback(window.confirm(message)); // eslint-disable-line no-alert
318
+ }
319
+ /**
320
+ * Returns true if the HTML5 history API is supported. Taken from Modernizr.
321
+ *
322
+ * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
323
+ * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
324
+ * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
325
+ */
326
+
327
+ function supportsHistory() {
328
+ var ua = window.navigator.userAgent;
329
+ if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
330
+ return window.history && 'pushState' in window.history;
331
+ }
332
+ /**
333
+ * Returns true if browser fires popstate on hash change.
334
+ * IE10 and IE11 do not.
335
+ */
336
+
337
+ function supportsPopStateOnHashChange() {
338
+ return window.navigator.userAgent.indexOf('Trident') === -1;
339
+ }
340
+ /**
341
+ * Returns true if a given popstate event is an extraneous WebKit event.
342
+ * Accounts for the fact that Chrome on iOS fires real popstate events
343
+ * containing undefined state when pressing the back button.
344
+ */
345
+
346
+ function isExtraneousPopstateEvent(event) {
347
+ return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
348
+ }
349
+
350
+ var PopStateEvent = 'popstate';
351
+ var HashChangeEvent = 'hashchange';
352
+
353
+ function getHistoryState() {
354
+ try {
355
+ return window.history.state || {};
356
+ } catch (e) {
357
+ // IE 11 sometimes throws when accessing window.history.state
358
+ // See https://github.com/ReactTraining/history/pull/289
359
+ return {};
360
+ }
361
+ }
362
+ /**
363
+ * Creates a history object that uses the HTML5 history API including
364
+ * pushState, replaceState, and the popstate event.
365
+ */
366
+
367
+
368
+ function createBrowserHistory(props) {
369
+ if (props === void 0) {
370
+ props = {};
371
+ }
372
+
373
+ !canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;
374
+ var globalHistory = window.history;
375
+ var canUseHistory = supportsHistory();
376
+ var needsHashChangeListener = !supportsPopStateOnHashChange();
377
+ var _props = props,
378
+ _props$forceRefresh = _props.forceRefresh,
379
+ forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
380
+ _props$getUserConfirm = _props.getUserConfirmation,
381
+ getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
382
+ _props$keyLength = _props.keyLength,
383
+ keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
384
+ var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
385
+
386
+ function getDOMLocation(historyState) {
387
+ var _ref = historyState || {},
388
+ key = _ref.key,
389
+ state = _ref.state;
390
+
391
+ var _window$location = window.location,
392
+ pathname = _window$location.pathname,
393
+ search = _window$location.search,
394
+ hash = _window$location.hash;
395
+ var path = pathname + search + hash;
396
+ process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
397
+ if (basename) path = stripBasename(path, basename);
398
+ return createLocation(path, state, key);
399
+ }
400
+
401
+ function createKey() {
402
+ return Math.random().toString(36).substr(2, keyLength);
403
+ }
404
+
405
+ var transitionManager = createTransitionManager();
406
+
407
+ function setState(nextState) {
408
+ _extends(history, nextState);
409
+
410
+ history.length = globalHistory.length;
411
+ transitionManager.notifyListeners(history.location, history.action);
412
+ }
413
+
414
+ function handlePopState(event) {
415
+ // Ignore extraneous popstate events in WebKit.
416
+ if (isExtraneousPopstateEvent(event)) return;
417
+ handlePop(getDOMLocation(event.state));
418
+ }
419
+
420
+ function handleHashChange() {
421
+ handlePop(getDOMLocation(getHistoryState()));
422
+ }
423
+
424
+ var forceNextPop = false;
425
+
426
+ function handlePop(location) {
427
+ if (forceNextPop) {
428
+ forceNextPop = false;
429
+ setState();
430
+ } else {
431
+ var action = 'POP';
432
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
433
+ if (ok) {
434
+ setState({
435
+ action: action,
436
+ location: location
437
+ });
438
+ } else {
439
+ revertPop(location);
440
+ }
441
+ });
442
+ }
443
+ }
444
+
445
+ function revertPop(fromLocation) {
446
+ var toLocation = history.location; // TODO: We could probably make this more reliable by
447
+ // keeping a list of keys we've seen in sessionStorage.
448
+ // Instead, we just default to 0 for keys we don't know.
449
+
450
+ var toIndex = allKeys.indexOf(toLocation.key);
451
+ if (toIndex === -1) toIndex = 0;
452
+ var fromIndex = allKeys.indexOf(fromLocation.key);
453
+ if (fromIndex === -1) fromIndex = 0;
454
+ var delta = toIndex - fromIndex;
455
+
456
+ if (delta) {
457
+ forceNextPop = true;
458
+ go(delta);
459
+ }
460
+ }
461
+
462
+ var initialLocation = getDOMLocation(getHistoryState());
463
+ var allKeys = [initialLocation.key]; // Public interface
464
+
465
+ function createHref(location) {
466
+ return basename + createPath(location);
467
+ }
468
+
469
+ function push(path, state) {
470
+ process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
471
+ var action = 'PUSH';
472
+ var location = createLocation(path, state, createKey(), history.location);
473
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
474
+ if (!ok) return;
475
+ var href = createHref(location);
476
+ var key = location.key,
477
+ state = location.state;
478
+
479
+ if (canUseHistory) {
480
+ globalHistory.pushState({
481
+ key: key,
482
+ state: state
483
+ }, null, href);
484
+
485
+ if (forceRefresh) {
486
+ window.location.href = href;
487
+ } else {
488
+ var prevIndex = allKeys.indexOf(history.location.key);
489
+ var nextKeys = allKeys.slice(0, prevIndex + 1);
490
+ nextKeys.push(location.key);
491
+ allKeys = nextKeys;
492
+ setState({
493
+ action: action,
494
+ location: location
495
+ });
496
+ }
497
+ } else {
498
+ process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
499
+ window.location.href = href;
500
+ }
501
+ });
502
+ }
503
+
504
+ function replace(path, state) {
505
+ process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
506
+ var action = 'REPLACE';
507
+ var location = createLocation(path, state, createKey(), history.location);
508
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
509
+ if (!ok) return;
510
+ var href = createHref(location);
511
+ var key = location.key,
512
+ state = location.state;
513
+
514
+ if (canUseHistory) {
515
+ globalHistory.replaceState({
516
+ key: key,
517
+ state: state
518
+ }, null, href);
519
+
520
+ if (forceRefresh) {
521
+ window.location.replace(href);
522
+ } else {
523
+ var prevIndex = allKeys.indexOf(history.location.key);
524
+ if (prevIndex !== -1) allKeys[prevIndex] = location.key;
525
+ setState({
526
+ action: action,
527
+ location: location
528
+ });
529
+ }
530
+ } else {
531
+ process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
532
+ window.location.replace(href);
533
+ }
534
+ });
535
+ }
536
+
537
+ function go(n) {
538
+ globalHistory.go(n);
539
+ }
540
+
541
+ function goBack() {
542
+ go(-1);
543
+ }
544
+
545
+ function goForward() {
546
+ go(1);
547
+ }
548
+
549
+ var listenerCount = 0;
550
+
551
+ function checkDOMListeners(delta) {
552
+ listenerCount += delta;
553
+
554
+ if (listenerCount === 1 && delta === 1) {
555
+ window.addEventListener(PopStateEvent, handlePopState);
556
+ if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
557
+ } else if (listenerCount === 0) {
558
+ window.removeEventListener(PopStateEvent, handlePopState);
559
+ if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
560
+ }
561
+ }
562
+
563
+ var isBlocked = false;
564
+
565
+ function block(prompt) {
566
+ if (prompt === void 0) {
567
+ prompt = false;
568
+ }
569
+
570
+ var unblock = transitionManager.setPrompt(prompt);
571
+
572
+ if (!isBlocked) {
573
+ checkDOMListeners(1);
574
+ isBlocked = true;
575
+ }
576
+
577
+ return function () {
578
+ if (isBlocked) {
579
+ isBlocked = false;
580
+ checkDOMListeners(-1);
581
+ }
582
+
583
+ return unblock();
584
+ };
585
+ }
586
+
587
+ function listen(listener) {
588
+ var unlisten = transitionManager.appendListener(listener);
589
+ checkDOMListeners(1);
590
+ return function () {
591
+ checkDOMListeners(-1);
592
+ unlisten();
593
+ };
594
+ }
595
+
596
+ var history = {
597
+ length: globalHistory.length,
598
+ action: 'POP',
599
+ location: initialLocation,
600
+ createHref: createHref,
601
+ push: push,
602
+ replace: replace,
603
+ go: go,
604
+ goBack: goBack,
605
+ goForward: goForward,
606
+ block: block,
607
+ listen: listen
608
+ };
609
+ return history;
610
+ }
611
+
32
612
  var setLoading = toolkit.createAction("common/setLoading");
33
613
  var setLoadingPage = toolkit.createAction("common/setLoadingPage");
34
614
  var setAlert = toolkit.createAction("common/setAlert");
@@ -106,14 +686,14 @@ function _catch(body, recover) {
106
686
  return result;
107
687
  }
108
688
 
109
- function _extends() {
110
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
689
+ function _extends$1() {
690
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
111
691
  for (var e = 1; e < arguments.length; e++) {
112
692
  var t = arguments[e];
113
693
  for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
114
694
  }
115
695
  return n;
116
- }, _extends.apply(null, arguments);
696
+ }, _extends$1.apply(null, arguments);
117
697
  }
118
698
  function _objectWithoutPropertiesLoose(r, e) {
119
699
  if (null == r) return {};
@@ -252,7 +832,7 @@ var CoreSelect = function CoreSelect(props) {
252
832
  onChange(name, newValue);
253
833
  };
254
834
  var controlStyle = function controlStyle(base, state) {
255
- var styles = _extends({}, base, {
835
+ var styles = _extends$1({}, base, {
256
836
  fontSize: "14px",
257
837
  fontWeight: "400",
258
838
  padding: "0 4px",
@@ -281,7 +861,7 @@ var CoreSelect = function CoreSelect(props) {
281
861
  return styles;
282
862
  };
283
863
  var inputStyles = function inputStyles(base) {
284
- var styles = _extends({}, base, {
864
+ var styles = _extends$1({}, base, {
285
865
  margin: "0",
286
866
  padding: "0",
287
867
  color: "inherit"
@@ -289,13 +869,13 @@ var CoreSelect = function CoreSelect(props) {
289
869
  return styles;
290
870
  };
291
871
  var placeholderStyles = function placeholderStyles(base) {
292
- var styles = _extends({}, base, {
872
+ var styles = _extends$1({}, base, {
293
873
  color: COLORS.lightGray
294
874
  });
295
875
  return styles;
296
876
  };
297
877
  var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
298
- var styles = _extends({}, base, {
878
+ var styles = _extends$1({}, base, {
299
879
  position: "relative",
300
880
  top: "-4px",
301
881
  padding: "8px 0"
@@ -303,7 +883,7 @@ var CoreSelect = function CoreSelect(props) {
303
883
  return styles;
304
884
  };
305
885
  var valueContainerStyles = function valueContainerStyles(base) {
306
- var styles = _extends({}, base, {
886
+ var styles = _extends$1({}, base, {
307
887
  height: isMulti ? undefined : "32px",
308
888
  position: "relative",
309
889
  top: "-3px"
@@ -311,11 +891,11 @@ var CoreSelect = function CoreSelect(props) {
311
891
  return styles;
312
892
  };
313
893
  var singleValueStyles = function singleValueStyles(base) {
314
- var styles = _extends({}, base);
894
+ var styles = _extends$1({}, base);
315
895
  return styles;
316
896
  };
317
897
  var optionStyles = function optionStyles(base, state) {
318
- var styles = _extends({}, base, {
898
+ var styles = _extends$1({}, base, {
319
899
  padding: "8px",
320
900
  borderRadius: "8px",
321
901
  cursor: "pointer",
@@ -329,13 +909,13 @@ var CoreSelect = function CoreSelect(props) {
329
909
  return styles;
330
910
  };
331
911
  var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
332
- var styles = _extends({}, base, {
912
+ var styles = _extends$1({}, base, {
333
913
  display: type === "no-outline" ? "none" : "block"
334
914
  });
335
915
  return styles;
336
916
  };
337
917
  var multiValueStyles = function multiValueStyles(base) {
338
- var styles = _extends({}, base, {
918
+ var styles = _extends$1({}, base, {
339
919
  backgroundColor: COLORS.lightBlue,
340
920
  borderRadius: "4px",
341
921
  padding: "2px 8px",
@@ -347,14 +927,14 @@ var CoreSelect = function CoreSelect(props) {
347
927
  return styles;
348
928
  };
349
929
  var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
350
- var styles = _extends({}, base, {
930
+ var styles = _extends$1({}, base, {
351
931
  color: COLORS.lightGray,
352
932
  cursor: "pointer"
353
933
  });
354
934
  return styles;
355
935
  };
356
936
  var multiValueLabelStyles = function multiValueLabelStyles(base) {
357
- var styles = _extends({}, base, {
937
+ var styles = _extends$1({}, base, {
358
938
  color: COLORS.blackText,
359
939
  fontWeight: "400",
360
940
  fontSize: "13px",
@@ -793,7 +1373,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
793
1373
  onChange(name, newValue);
794
1374
  };
795
1375
  var controlStyle = function controlStyle(base, state) {
796
- var styles = _extends({}, base, {
1376
+ var styles = _extends$1({}, base, {
797
1377
  fontSize: "14px",
798
1378
  fontWeight: "400",
799
1379
  backgroundColor: state.isDisabled ? "transparent" : error ? COLORS.lightYellow : COLORS.white,
@@ -814,7 +1394,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
814
1394
  return styles;
815
1395
  };
816
1396
  var inputStyles = function inputStyles(base) {
817
- var styles = _extends({}, base, {
1397
+ var styles = _extends$1({}, base, {
818
1398
  margin: "0",
819
1399
  padding: "0",
820
1400
  color: "inherit",
@@ -824,37 +1404,37 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
824
1404
  return styles;
825
1405
  };
826
1406
  var placeholderStyles = function placeholderStyles(base) {
827
- var styles = _extends({}, base, {
1407
+ var styles = _extends$1({}, base, {
828
1408
  color: COLORS.lightGray
829
1409
  });
830
1410
  return styles;
831
1411
  };
832
1412
  var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
833
- var styles = _extends({}, base, {
1413
+ var styles = _extends$1({}, base, {
834
1414
  position: "relative",
835
1415
  padding: "2px 0"
836
1416
  });
837
1417
  return styles;
838
1418
  };
839
1419
  var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
840
- var styles = _extends({}, base, {
1420
+ var styles = _extends$1({}, base, {
841
1421
  display: isShowDropdown && !isMulti ? "block" : "none"
842
1422
  });
843
1423
  return styles;
844
1424
  };
845
1425
  var valueContainerStyles = function valueContainerStyles(base) {
846
- var styles = _extends({}, base, {
1426
+ var styles = _extends$1({}, base, {
847
1427
  height: isMulti ? undefined : "26px",
848
1428
  position: "relative"
849
1429
  });
850
1430
  return styles;
851
1431
  };
852
1432
  var singleValueStyles = function singleValueStyles(base) {
853
- var styles = _extends({}, base);
1433
+ var styles = _extends$1({}, base);
854
1434
  return styles;
855
1435
  };
856
1436
  var optionStyles = function optionStyles(base, state) {
857
- var styles = _extends({}, base, {
1437
+ var styles = _extends$1({}, base, {
858
1438
  padding: "8px",
859
1439
  borderRadius: "8px",
860
1440
  cursor: "pointer",
@@ -869,7 +1449,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
869
1449
  return styles;
870
1450
  };
871
1451
  var multiValueStyles = function multiValueStyles(base) {
872
- var styles = _extends({}, base, {
1452
+ var styles = _extends$1({}, base, {
873
1453
  backgroundColor: COLORS.lightBlue,
874
1454
  borderRadius: "4px",
875
1455
  padding: "0 4px",
@@ -881,14 +1461,14 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
881
1461
  return styles;
882
1462
  };
883
1463
  var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
884
- var styles = _extends({}, base, {
1464
+ var styles = _extends$1({}, base, {
885
1465
  color: COLORS.lightGray,
886
1466
  cursor: "pointer"
887
1467
  });
888
1468
  return styles;
889
1469
  };
890
1470
  var multiValueLabelStyles = function multiValueLabelStyles(base) {
891
- var styles = _extends({}, base, {
1471
+ var styles = _extends$1({}, base, {
892
1472
  color: COLORS.blackText,
893
1473
  fontWeight: "400",
894
1474
  fontSize: "13px",
@@ -1083,20 +1663,67 @@ var CoreTooltip = function CoreTooltip(_ref) {
1083
1663
  }, content));
1084
1664
  };
1085
1665
 
1086
- var _excluded$3 = ["node"];
1087
1666
  var MarkdownLatexRender = function MarkdownLatexRender(_ref) {
1088
1667
  var content = _ref.content;
1089
- var updatedMarkdown = content.replace(/\\\(/g, "$$").replace(/\\\)/g, "$$").replace(/\\\[/g, "$$$$").replace(/\\\]\s*\./g, "$$$$").replace(/\\\]/g, "$$$$").replace(/<br\s*\/?>/g, "\n\n");
1090
- return React__default.createElement("span", null, React__default.createElement(ReactMarkdown, {
1091
- remarkPlugins: [remarkMath, remarkGfm, remarkRehype],
1092
- rehypePlugins: [rehypeKatex, rehypeRaw],
1093
- components: {
1094
- p: function p(_ref2) {
1095
- var props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
1096
- return React__default.createElement("span", Object.assign({}, props));
1668
+ var displayRef = React__default.useRef(null);
1669
+ var processedText = content.replace(/(.*)(?:\s*(.*))?(?=\n\n|$)/, function (_match, prefix, equation) {
1670
+ if (equation) {
1671
+ var trimmedEquation = equation.trim();
1672
+ if (trimmedEquation.startsWith("\\(") && trimmedEquation.endsWith("\\)")) {
1673
+ return "" + prefix + equation;
1674
+ } else {
1675
+ return prefix + "\n\\(" + equation + "\\)";
1676
+ }
1677
+ } else {
1678
+ var latexStart = -1;
1679
+ if (content.includes("_")) {
1680
+ latexStart = content.search(/[a-zA-Z]_/);
1681
+ } else if (content.includes("^")) {
1682
+ latexStart = content.search(/[a-zA-Z]\^/);
1683
+ } else if (content.includes("\\")) {
1684
+ latexStart = content.search(/\\/);
1685
+ }
1686
+ if (latexStart !== -1) {
1687
+ var _prefix = content.substring(0, latexStart);
1688
+ var _equation = content.substring(latexStart);
1689
+ return _prefix + "\\(" + _equation + "\\)";
1690
+ } else {
1691
+ return content;
1692
+ }
1693
+ }
1694
+ });
1695
+ displayRef.current.innerHTML = processedText;
1696
+ React.useEffect(function () {
1697
+ if (displayRef.current) {
1698
+ try {
1699
+ renderMathInElement(displayRef.current, {
1700
+ delimiters: [{
1701
+ left: "$$",
1702
+ right: "$$",
1703
+ display: true
1704
+ }, {
1705
+ left: "$$$$",
1706
+ right: "$$$$",
1707
+ display: true
1708
+ }, {
1709
+ left: "\\(",
1710
+ right: "\\)",
1711
+ display: false
1712
+ }, {
1713
+ left: "\\[",
1714
+ right: "\\]",
1715
+ display: true
1716
+ }]
1717
+ });
1718
+ } catch (error) {
1719
+ console.error("Error rendering math:", error);
1097
1720
  }
1098
1721
  }
1099
- }, updatedMarkdown));
1722
+ }, [content]);
1723
+ return React__default.createElement("span", null, React__default.createElement("div", {
1724
+ ref: displayRef,
1725
+ className: "equation-support"
1726
+ }));
1100
1727
  };
1101
1728
 
1102
1729
  var CookieService = /*#__PURE__*/function () {
@@ -1982,7 +2609,7 @@ function kindOf(val) {
1982
2609
  }
1983
2610
 
1984
2611
  // src/utils/warning.ts
1985
- function warning(message) {
2612
+ function warning$1(message) {
1986
2613
  if (typeof console !== "undefined" && typeof console.error === "function") {
1987
2614
  console.error(message);
1988
2615
  }
@@ -2035,7 +2662,7 @@ function combineReducers(reducers) {
2035
2662
  const key = reducerKeys[i];
2036
2663
  if (process.env.NODE_ENV !== "production") {
2037
2664
  if (typeof reducers[key] === "undefined") {
2038
- warning(`No reducer provided for key "${key}"`);
2665
+ warning$1(`No reducer provided for key "${key}"`);
2039
2666
  }
2040
2667
  }
2041
2668
  if (typeof reducers[key] === "function") {
@@ -2060,7 +2687,7 @@ function combineReducers(reducers) {
2060
2687
  if (process.env.NODE_ENV !== "production") {
2061
2688
  const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
2062
2689
  if (warningMessage) {
2063
- warning(warningMessage);
2690
+ warning$1(warningMessage);
2064
2691
  }
2065
2692
  }
2066
2693
  let hasChanged = false;
@@ -2439,7 +3066,7 @@ var useAmplitude = function useAmplitude() {
2439
3066
  var savedUserProperties = React.useRef({});
2440
3067
  var hasTrackedInitialSession = React.useRef(false);
2441
3068
  var setUserProperties = React.useCallback(function (properties) {
2442
- savedUserProperties.current = _extends({}, savedUserProperties.current, properties);
3069
+ savedUserProperties.current = _extends$1({}, savedUserProperties.current, properties);
2443
3070
  var identify = new amplitude.Identify();
2444
3071
  Object.entries(properties).forEach(function (_ref) {
2445
3072
  var key = _ref[0],
@@ -2451,7 +3078,7 @@ var useAmplitude = function useAmplitude() {
2451
3078
  var trackEvent = React.useCallback(function (_ref2) {
2452
3079
  var eventName = _ref2.eventName,
2453
3080
  eventProperties = _ref2.eventProperties;
2454
- amplitude.track(eventName, _extends({}, savedUserProperties.current, eventProperties, {
3081
+ amplitude.track(eventName, _extends$1({}, savedUserProperties.current, eventProperties, {
2455
3082
  timestamp: new Date().toISOString()
2456
3083
  }));
2457
3084
  }, []);
@@ -2638,7 +3265,7 @@ var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
2638
3265
 
2639
3266
  var customStyles = {
2640
3267
  control: function control(baseStyles, state) {
2641
- return _extends({}, baseStyles, {
3268
+ return _extends$1({}, baseStyles, {
2642
3269
  fontSize: "14px",
2643
3270
  fontWeight: 700,
2644
3271
  color: styleGlobal.darker,
@@ -2653,21 +3280,21 @@ var customStyles = {
2653
3280
  });
2654
3281
  },
2655
3282
  input: function input(baseStyles, _) {
2656
- return _extends({}, baseStyles, {
3283
+ return _extends$1({}, baseStyles, {
2657
3284
  fontSize: "14px",
2658
3285
  fontWeight: 700,
2659
3286
  color: styleGlobal.darker
2660
3287
  });
2661
3288
  },
2662
3289
  singleValue: function singleValue(baseStyles) {
2663
- return _extends({}, baseStyles, {
3290
+ return _extends$1({}, baseStyles, {
2664
3291
  fontSize: "14px",
2665
3292
  fontWeight: 700,
2666
3293
  color: styleGlobal.darker
2667
3294
  });
2668
3295
  },
2669
3296
  option: function option(baseStyles, state) {
2670
- return _extends({}, baseStyles, {
3297
+ return _extends$1({}, baseStyles, {
2671
3298
  backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.light : 'white',
2672
3299
  "&:active": {
2673
3300
  backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.less_dark : baseStyles.backgroundColor
@@ -2691,7 +3318,7 @@ var CustomOption = function CustomOption(props) {
2691
3318
  }, props.data.label));
2692
3319
  };
2693
3320
 
2694
- var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3321
+ var _excluded$3 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2695
3322
  var CustomSelect = function CustomSelect(_ref) {
2696
3323
  var isDefault = _ref.isDefault,
2697
3324
  options = _ref.options,
@@ -2699,7 +3326,7 @@ var CustomSelect = function CustomSelect(_ref) {
2699
3326
  scrollBottom = _ref.scrollBottom,
2700
3327
  value = _ref.value,
2701
3328
  isMulti = _ref.isMulti,
2702
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
3329
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2703
3330
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
2704
3331
  return value.includes(i.value);
2705
3332
  }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
@@ -2726,7 +3353,7 @@ var CustomSelect = function CustomSelect(_ref) {
2726
3353
  }, rest));
2727
3354
  };
2728
3355
 
2729
- var _excluded$5 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3356
+ var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2730
3357
  var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
2731
3358
  var isDefault = _ref.isDefault,
2732
3359
  options = _ref.options,
@@ -2734,7 +3361,7 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
2734
3361
  scrollBottom = _ref.scrollBottom,
2735
3362
  value = _ref.value,
2736
3363
  isMulti = _ref.isMulti,
2737
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
3364
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2738
3365
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
2739
3366
  return value.includes(i.value);
2740
3367
  }) : isMulti ? options.filter(function (i) {
@@ -2761,14 +3388,14 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
2761
3388
  }, rest));
2762
3389
  };
2763
3390
 
2764
- var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3391
+ var _excluded$5 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2765
3392
  var CustomCreatable = function CustomCreatable(_ref) {
2766
3393
  var options = _ref.options,
2767
3394
  isDisabled = _ref.isDisabled,
2768
3395
  scrollBottom = _ref.scrollBottom,
2769
3396
  value = _ref.value,
2770
3397
  isMulti = _ref.isMulti,
2771
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
3398
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
2772
3399
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
2773
3400
  return value.includes(i.value);
2774
3401
  }) : isMulti ? options.filter(function (i) {
@@ -2795,7 +3422,7 @@ var CustomCreatable = function CustomCreatable(_ref) {
2795
3422
  }, rest));
2796
3423
  };
2797
3424
 
2798
- var _excluded$7 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3425
+ var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2799
3426
  var CustomSelectOption = function CustomSelectOption(_ref) {
2800
3427
  var defaultValue = _ref.defaultValue,
2801
3428
  options = _ref.options,
@@ -2803,7 +3430,7 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
2803
3430
  scrollBottom = _ref.scrollBottom,
2804
3431
  value = _ref.value,
2805
3432
  isMulti = _ref.isMulti,
2806
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
3433
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2807
3434
  var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
2808
3435
  return option.value === defaultValue;
2809
3436
  }) || null : null;
@@ -2835,26 +3462,26 @@ var utcToLocalTime = (function (time, FORMAT) {
2835
3462
  }
2836
3463
  });
2837
3464
 
2838
- var historyCore = history.createBrowserHistory();
3465
+ var historyCore = createBrowserHistory();
2839
3466
 
2840
3467
  Object.defineProperty(exports, 'GoogleOAuthProvider', {
2841
- enumerable: true,
2842
- get: function () {
2843
- return google.GoogleOAuthProvider;
2844
- }
3468
+ enumerable: true,
3469
+ get: function () {
3470
+ return google.GoogleOAuthProvider;
3471
+ }
2845
3472
  });
2846
3473
  exports.Cookies = Cookies;
2847
3474
  Object.defineProperty(exports, 'ToastContainer', {
2848
- enumerable: true,
2849
- get: function () {
2850
- return reactToastify.ToastContainer;
2851
- }
3475
+ enumerable: true,
3476
+ get: function () {
3477
+ return reactToastify.ToastContainer;
3478
+ }
2852
3479
  });
2853
3480
  Object.defineProperty(exports, 'toast', {
2854
- enumerable: true,
2855
- get: function () {
2856
- return reactToastify.toast;
2857
- }
3481
+ enumerable: true,
3482
+ get: function () {
3483
+ return reactToastify.toast;
3484
+ }
2858
3485
  });
2859
3486
  exports.ACCESS_TOKEN = ACCESS_TOKEN;
2860
3487
  exports.BASE_URL = BASE_URL;