acsi-core 0.2.4 → 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.
@@ -1,4 +1,3 @@
1
- import { createBrowserHistory } from 'history';
2
1
  import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
3
2
  import React, { useState, useRef, useEffect, useCallback, Fragment } from 'react';
4
3
  import { useGoogleLogin } from '@react-oauth/google';
@@ -8,13 +7,8 @@ import { useDispatch, useSelector } from 'react-redux';
8
7
  import { Link } from 'react-router-dom';
9
8
  import { FormGroup, Input, Label, Modal, ModalHeader, ModalBody, ModalFooter, Tooltip, Row, Col, Button, Pagination, PaginationItem, PaginationLink } from 'reactstrap';
10
9
  import ReactSelect, { components } from 'react-select';
11
- import ReactMarkdown from 'react-markdown';
12
- import remarkMath from 'remark-math';
13
- import remarkGfm from 'remark-gfm';
14
- import rehypeKatex from 'rehype-katex';
15
- import remarkRehype from 'remark-rehype';
16
- import rehypeRaw from 'rehype-raw';
17
10
  import 'katex/dist/katex.min.css';
11
+ import renderMathInElement from 'katex/contrib/auto-render';
18
12
  import Cookies from 'js-cookie';
19
13
  export { default as Cookies } from 'js-cookie';
20
14
  import moment from 'moment';
@@ -28,6 +22,592 @@ import { init as init$1, replayIntegration } from '@sentry/react';
28
22
  import { FaCaretDown } from 'react-icons/fa';
29
23
  import CreatableSelect from 'react-select/creatable';
30
24
 
25
+ function _extends() {
26
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
27
+ for (var e = 1; e < arguments.length; e++) {
28
+ var t = arguments[e];
29
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
30
+ }
31
+ return n;
32
+ }, _extends.apply(null, arguments);
33
+ }
34
+
35
+ function isAbsolute(pathname) {
36
+ return pathname.charAt(0) === '/';
37
+ }
38
+
39
+ // About 1.5x faster than the two-arg version of Array#splice()
40
+ function spliceOne(list, index) {
41
+ for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
42
+ list[i] = list[k];
43
+ }
44
+
45
+ list.pop();
46
+ }
47
+
48
+ // This implementation is based heavily on node's url.parse
49
+ function resolvePathname(to, from) {
50
+ if (from === undefined) from = '';
51
+
52
+ var toParts = (to && to.split('/')) || [];
53
+ var fromParts = (from && from.split('/')) || [];
54
+
55
+ var isToAbs = to && isAbsolute(to);
56
+ var isFromAbs = from && isAbsolute(from);
57
+ var mustEndAbs = isToAbs || isFromAbs;
58
+
59
+ if (to && isAbsolute(to)) {
60
+ // to is absolute
61
+ fromParts = toParts;
62
+ } else if (toParts.length) {
63
+ // to is relative, drop the filename
64
+ fromParts.pop();
65
+ fromParts = fromParts.concat(toParts);
66
+ }
67
+
68
+ if (!fromParts.length) return '/';
69
+
70
+ var hasTrailingSlash;
71
+ if (fromParts.length) {
72
+ var last = fromParts[fromParts.length - 1];
73
+ hasTrailingSlash = last === '.' || last === '..' || last === '';
74
+ } else {
75
+ hasTrailingSlash = false;
76
+ }
77
+
78
+ var up = 0;
79
+ for (var i = fromParts.length; i >= 0; i--) {
80
+ var part = fromParts[i];
81
+
82
+ if (part === '.') {
83
+ spliceOne(fromParts, i);
84
+ } else if (part === '..') {
85
+ spliceOne(fromParts, i);
86
+ up++;
87
+ } else if (up) {
88
+ spliceOne(fromParts, i);
89
+ up--;
90
+ }
91
+ }
92
+
93
+ if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
94
+
95
+ if (
96
+ mustEndAbs &&
97
+ fromParts[0] !== '' &&
98
+ (!fromParts[0] || !isAbsolute(fromParts[0]))
99
+ )
100
+ fromParts.unshift('');
101
+
102
+ var result = fromParts.join('/');
103
+
104
+ if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
105
+
106
+ return result;
107
+ }
108
+
109
+ var isProduction = process.env.NODE_ENV === 'production';
110
+ function warning(condition, message) {
111
+ if (!isProduction) {
112
+ if (condition) {
113
+ return;
114
+ }
115
+
116
+ var text = "Warning: " + message;
117
+
118
+ if (typeof console !== 'undefined') {
119
+ console.warn(text);
120
+ }
121
+
122
+ try {
123
+ throw Error(text);
124
+ } catch (x) {}
125
+ }
126
+ }
127
+
128
+ var isProduction$1 = process.env.NODE_ENV === 'production';
129
+ var prefix = 'Invariant failed';
130
+ function invariant(condition, message) {
131
+ if (condition) {
132
+ return;
133
+ }
134
+ if (isProduction$1) {
135
+ throw new Error(prefix);
136
+ }
137
+ var provided = typeof message === 'function' ? message() : message;
138
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
139
+ throw new Error(value);
140
+ }
141
+
142
+ function addLeadingSlash(path) {
143
+ return path.charAt(0) === '/' ? path : '/' + path;
144
+ }
145
+ function hasBasename(path, prefix) {
146
+ return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
147
+ }
148
+ function stripBasename(path, prefix) {
149
+ return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
150
+ }
151
+ function stripTrailingSlash(path) {
152
+ return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
153
+ }
154
+ function parsePath(path) {
155
+ var pathname = path || '/';
156
+ var search = '';
157
+ var hash = '';
158
+ var hashIndex = pathname.indexOf('#');
159
+
160
+ if (hashIndex !== -1) {
161
+ hash = pathname.substr(hashIndex);
162
+ pathname = pathname.substr(0, hashIndex);
163
+ }
164
+
165
+ var searchIndex = pathname.indexOf('?');
166
+
167
+ if (searchIndex !== -1) {
168
+ search = pathname.substr(searchIndex);
169
+ pathname = pathname.substr(0, searchIndex);
170
+ }
171
+
172
+ return {
173
+ pathname: pathname,
174
+ search: search === '?' ? '' : search,
175
+ hash: hash === '#' ? '' : hash
176
+ };
177
+ }
178
+ function createPath(location) {
179
+ var pathname = location.pathname,
180
+ search = location.search,
181
+ hash = location.hash;
182
+ var path = pathname || '/';
183
+ if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
184
+ if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
185
+ return path;
186
+ }
187
+
188
+ function createLocation(path, state, key, currentLocation) {
189
+ var location;
190
+
191
+ if (typeof path === 'string') {
192
+ // Two-arg form: push(path, state)
193
+ location = parsePath(path);
194
+ location.state = state;
195
+ } else {
196
+ // One-arg form: push(location)
197
+ location = _extends({}, path);
198
+ if (location.pathname === undefined) location.pathname = '';
199
+
200
+ if (location.search) {
201
+ if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
202
+ } else {
203
+ location.search = '';
204
+ }
205
+
206
+ if (location.hash) {
207
+ if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
208
+ } else {
209
+ location.hash = '';
210
+ }
211
+
212
+ if (state !== undefined && location.state === undefined) location.state = state;
213
+ }
214
+
215
+ try {
216
+ location.pathname = decodeURI(location.pathname);
217
+ } catch (e) {
218
+ if (e instanceof URIError) {
219
+ throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
220
+ } else {
221
+ throw e;
222
+ }
223
+ }
224
+
225
+ if (key) location.key = key;
226
+
227
+ if (currentLocation) {
228
+ // Resolve incomplete/relative pathname relative to current location.
229
+ if (!location.pathname) {
230
+ location.pathname = currentLocation.pathname;
231
+ } else if (location.pathname.charAt(0) !== '/') {
232
+ location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
233
+ }
234
+ } else {
235
+ // When there is no prior location and pathname is empty, set it to /
236
+ if (!location.pathname) {
237
+ location.pathname = '/';
238
+ }
239
+ }
240
+
241
+ return location;
242
+ }
243
+
244
+ function createTransitionManager() {
245
+ var prompt = null;
246
+
247
+ function setPrompt(nextPrompt) {
248
+ process.env.NODE_ENV !== "production" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;
249
+ prompt = nextPrompt;
250
+ return function () {
251
+ if (prompt === nextPrompt) prompt = null;
252
+ };
253
+ }
254
+
255
+ function confirmTransitionTo(location, action, getUserConfirmation, callback) {
256
+ // TODO: If another transition starts while we're still confirming
257
+ // the previous one, we may end up in a weird state. Figure out the
258
+ // best way to handle this.
259
+ if (prompt != null) {
260
+ var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
261
+
262
+ if (typeof result === 'string') {
263
+ if (typeof getUserConfirmation === 'function') {
264
+ getUserConfirmation(result, callback);
265
+ } else {
266
+ process.env.NODE_ENV !== "production" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
267
+ callback(true);
268
+ }
269
+ } else {
270
+ // Return false from a transition hook to cancel the transition.
271
+ callback(result !== false);
272
+ }
273
+ } else {
274
+ callback(true);
275
+ }
276
+ }
277
+
278
+ var listeners = [];
279
+
280
+ function appendListener(fn) {
281
+ var isActive = true;
282
+
283
+ function listener() {
284
+ if (isActive) fn.apply(void 0, arguments);
285
+ }
286
+
287
+ listeners.push(listener);
288
+ return function () {
289
+ isActive = false;
290
+ listeners = listeners.filter(function (item) {
291
+ return item !== listener;
292
+ });
293
+ };
294
+ }
295
+
296
+ function notifyListeners() {
297
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
298
+ args[_key] = arguments[_key];
299
+ }
300
+
301
+ listeners.forEach(function (listener) {
302
+ return listener.apply(void 0, args);
303
+ });
304
+ }
305
+
306
+ return {
307
+ setPrompt: setPrompt,
308
+ confirmTransitionTo: confirmTransitionTo,
309
+ appendListener: appendListener,
310
+ notifyListeners: notifyListeners
311
+ };
312
+ }
313
+
314
+ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
315
+ function getConfirmation(message, callback) {
316
+ callback(window.confirm(message)); // eslint-disable-line no-alert
317
+ }
318
+ /**
319
+ * Returns true if the HTML5 history API is supported. Taken from Modernizr.
320
+ *
321
+ * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
322
+ * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
323
+ * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
324
+ */
325
+
326
+ function supportsHistory() {
327
+ var ua = window.navigator.userAgent;
328
+ 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;
329
+ return window.history && 'pushState' in window.history;
330
+ }
331
+ /**
332
+ * Returns true if browser fires popstate on hash change.
333
+ * IE10 and IE11 do not.
334
+ */
335
+
336
+ function supportsPopStateOnHashChange() {
337
+ return window.navigator.userAgent.indexOf('Trident') === -1;
338
+ }
339
+ /**
340
+ * Returns true if a given popstate event is an extraneous WebKit event.
341
+ * Accounts for the fact that Chrome on iOS fires real popstate events
342
+ * containing undefined state when pressing the back button.
343
+ */
344
+
345
+ function isExtraneousPopstateEvent(event) {
346
+ return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
347
+ }
348
+
349
+ var PopStateEvent = 'popstate';
350
+ var HashChangeEvent = 'hashchange';
351
+
352
+ function getHistoryState() {
353
+ try {
354
+ return window.history.state || {};
355
+ } catch (e) {
356
+ // IE 11 sometimes throws when accessing window.history.state
357
+ // See https://github.com/ReactTraining/history/pull/289
358
+ return {};
359
+ }
360
+ }
361
+ /**
362
+ * Creates a history object that uses the HTML5 history API including
363
+ * pushState, replaceState, and the popstate event.
364
+ */
365
+
366
+
367
+ function createBrowserHistory(props) {
368
+ if (props === void 0) {
369
+ props = {};
370
+ }
371
+
372
+ !canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;
373
+ var globalHistory = window.history;
374
+ var canUseHistory = supportsHistory();
375
+ var needsHashChangeListener = !supportsPopStateOnHashChange();
376
+ var _props = props,
377
+ _props$forceRefresh = _props.forceRefresh,
378
+ forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
379
+ _props$getUserConfirm = _props.getUserConfirmation,
380
+ getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
381
+ _props$keyLength = _props.keyLength,
382
+ keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
383
+ var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
384
+
385
+ function getDOMLocation(historyState) {
386
+ var _ref = historyState || {},
387
+ key = _ref.key,
388
+ state = _ref.state;
389
+
390
+ var _window$location = window.location,
391
+ pathname = _window$location.pathname,
392
+ search = _window$location.search,
393
+ hash = _window$location.hash;
394
+ var path = pathname + search + hash;
395
+ 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;
396
+ if (basename) path = stripBasename(path, basename);
397
+ return createLocation(path, state, key);
398
+ }
399
+
400
+ function createKey() {
401
+ return Math.random().toString(36).substr(2, keyLength);
402
+ }
403
+
404
+ var transitionManager = createTransitionManager();
405
+
406
+ function setState(nextState) {
407
+ _extends(history, nextState);
408
+
409
+ history.length = globalHistory.length;
410
+ transitionManager.notifyListeners(history.location, history.action);
411
+ }
412
+
413
+ function handlePopState(event) {
414
+ // Ignore extraneous popstate events in WebKit.
415
+ if (isExtraneousPopstateEvent(event)) return;
416
+ handlePop(getDOMLocation(event.state));
417
+ }
418
+
419
+ function handleHashChange() {
420
+ handlePop(getDOMLocation(getHistoryState()));
421
+ }
422
+
423
+ var forceNextPop = false;
424
+
425
+ function handlePop(location) {
426
+ if (forceNextPop) {
427
+ forceNextPop = false;
428
+ setState();
429
+ } else {
430
+ var action = 'POP';
431
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
432
+ if (ok) {
433
+ setState({
434
+ action: action,
435
+ location: location
436
+ });
437
+ } else {
438
+ revertPop(location);
439
+ }
440
+ });
441
+ }
442
+ }
443
+
444
+ function revertPop(fromLocation) {
445
+ var toLocation = history.location; // TODO: We could probably make this more reliable by
446
+ // keeping a list of keys we've seen in sessionStorage.
447
+ // Instead, we just default to 0 for keys we don't know.
448
+
449
+ var toIndex = allKeys.indexOf(toLocation.key);
450
+ if (toIndex === -1) toIndex = 0;
451
+ var fromIndex = allKeys.indexOf(fromLocation.key);
452
+ if (fromIndex === -1) fromIndex = 0;
453
+ var delta = toIndex - fromIndex;
454
+
455
+ if (delta) {
456
+ forceNextPop = true;
457
+ go(delta);
458
+ }
459
+ }
460
+
461
+ var initialLocation = getDOMLocation(getHistoryState());
462
+ var allKeys = [initialLocation.key]; // Public interface
463
+
464
+ function createHref(location) {
465
+ return basename + createPath(location);
466
+ }
467
+
468
+ function push(path, state) {
469
+ 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;
470
+ var action = 'PUSH';
471
+ var location = createLocation(path, state, createKey(), history.location);
472
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
473
+ if (!ok) return;
474
+ var href = createHref(location);
475
+ var key = location.key,
476
+ state = location.state;
477
+
478
+ if (canUseHistory) {
479
+ globalHistory.pushState({
480
+ key: key,
481
+ state: state
482
+ }, null, href);
483
+
484
+ if (forceRefresh) {
485
+ window.location.href = href;
486
+ } else {
487
+ var prevIndex = allKeys.indexOf(history.location.key);
488
+ var nextKeys = allKeys.slice(0, prevIndex + 1);
489
+ nextKeys.push(location.key);
490
+ allKeys = nextKeys;
491
+ setState({
492
+ action: action,
493
+ location: location
494
+ });
495
+ }
496
+ } else {
497
+ process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
498
+ window.location.href = href;
499
+ }
500
+ });
501
+ }
502
+
503
+ function replace(path, state) {
504
+ 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;
505
+ var action = 'REPLACE';
506
+ var location = createLocation(path, state, createKey(), history.location);
507
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
508
+ if (!ok) return;
509
+ var href = createHref(location);
510
+ var key = location.key,
511
+ state = location.state;
512
+
513
+ if (canUseHistory) {
514
+ globalHistory.replaceState({
515
+ key: key,
516
+ state: state
517
+ }, null, href);
518
+
519
+ if (forceRefresh) {
520
+ window.location.replace(href);
521
+ } else {
522
+ var prevIndex = allKeys.indexOf(history.location.key);
523
+ if (prevIndex !== -1) allKeys[prevIndex] = location.key;
524
+ setState({
525
+ action: action,
526
+ location: location
527
+ });
528
+ }
529
+ } else {
530
+ process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
531
+ window.location.replace(href);
532
+ }
533
+ });
534
+ }
535
+
536
+ function go(n) {
537
+ globalHistory.go(n);
538
+ }
539
+
540
+ function goBack() {
541
+ go(-1);
542
+ }
543
+
544
+ function goForward() {
545
+ go(1);
546
+ }
547
+
548
+ var listenerCount = 0;
549
+
550
+ function checkDOMListeners(delta) {
551
+ listenerCount += delta;
552
+
553
+ if (listenerCount === 1 && delta === 1) {
554
+ window.addEventListener(PopStateEvent, handlePopState);
555
+ if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
556
+ } else if (listenerCount === 0) {
557
+ window.removeEventListener(PopStateEvent, handlePopState);
558
+ if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
559
+ }
560
+ }
561
+
562
+ var isBlocked = false;
563
+
564
+ function block(prompt) {
565
+ if (prompt === void 0) {
566
+ prompt = false;
567
+ }
568
+
569
+ var unblock = transitionManager.setPrompt(prompt);
570
+
571
+ if (!isBlocked) {
572
+ checkDOMListeners(1);
573
+ isBlocked = true;
574
+ }
575
+
576
+ return function () {
577
+ if (isBlocked) {
578
+ isBlocked = false;
579
+ checkDOMListeners(-1);
580
+ }
581
+
582
+ return unblock();
583
+ };
584
+ }
585
+
586
+ function listen(listener) {
587
+ var unlisten = transitionManager.appendListener(listener);
588
+ checkDOMListeners(1);
589
+ return function () {
590
+ checkDOMListeners(-1);
591
+ unlisten();
592
+ };
593
+ }
594
+
595
+ var history = {
596
+ length: globalHistory.length,
597
+ action: 'POP',
598
+ location: initialLocation,
599
+ createHref: createHref,
600
+ push: push,
601
+ replace: replace,
602
+ go: go,
603
+ goBack: goBack,
604
+ goForward: goForward,
605
+ block: block,
606
+ listen: listen
607
+ };
608
+ return history;
609
+ }
610
+
31
611
  var setLoading = createAction("common/setLoading");
32
612
  var setLoadingPage = createAction("common/setLoadingPage");
33
613
  var setAlert = createAction("common/setAlert");
@@ -105,14 +685,14 @@ function _catch(body, recover) {
105
685
  return result;
106
686
  }
107
687
 
108
- function _extends() {
109
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
688
+ function _extends$1() {
689
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
110
690
  for (var e = 1; e < arguments.length; e++) {
111
691
  var t = arguments[e];
112
692
  for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
113
693
  }
114
694
  return n;
115
- }, _extends.apply(null, arguments);
695
+ }, _extends$1.apply(null, arguments);
116
696
  }
117
697
  function _objectWithoutPropertiesLoose(r, e) {
118
698
  if (null == r) return {};
@@ -251,7 +831,7 @@ var CoreSelect = function CoreSelect(props) {
251
831
  onChange(name, newValue);
252
832
  };
253
833
  var controlStyle = function controlStyle(base, state) {
254
- var styles = _extends({}, base, {
834
+ var styles = _extends$1({}, base, {
255
835
  fontSize: "14px",
256
836
  fontWeight: "400",
257
837
  padding: "0 4px",
@@ -280,7 +860,7 @@ var CoreSelect = function CoreSelect(props) {
280
860
  return styles;
281
861
  };
282
862
  var inputStyles = function inputStyles(base) {
283
- var styles = _extends({}, base, {
863
+ var styles = _extends$1({}, base, {
284
864
  margin: "0",
285
865
  padding: "0",
286
866
  color: "inherit"
@@ -288,13 +868,13 @@ var CoreSelect = function CoreSelect(props) {
288
868
  return styles;
289
869
  };
290
870
  var placeholderStyles = function placeholderStyles(base) {
291
- var styles = _extends({}, base, {
871
+ var styles = _extends$1({}, base, {
292
872
  color: COLORS.lightGray
293
873
  });
294
874
  return styles;
295
875
  };
296
876
  var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
297
- var styles = _extends({}, base, {
877
+ var styles = _extends$1({}, base, {
298
878
  position: "relative",
299
879
  top: "-4px",
300
880
  padding: "8px 0"
@@ -302,7 +882,7 @@ var CoreSelect = function CoreSelect(props) {
302
882
  return styles;
303
883
  };
304
884
  var valueContainerStyles = function valueContainerStyles(base) {
305
- var styles = _extends({}, base, {
885
+ var styles = _extends$1({}, base, {
306
886
  height: isMulti ? undefined : "32px",
307
887
  position: "relative",
308
888
  top: "-3px"
@@ -310,11 +890,11 @@ var CoreSelect = function CoreSelect(props) {
310
890
  return styles;
311
891
  };
312
892
  var singleValueStyles = function singleValueStyles(base) {
313
- var styles = _extends({}, base);
893
+ var styles = _extends$1({}, base);
314
894
  return styles;
315
895
  };
316
896
  var optionStyles = function optionStyles(base, state) {
317
- var styles = _extends({}, base, {
897
+ var styles = _extends$1({}, base, {
318
898
  padding: "8px",
319
899
  borderRadius: "8px",
320
900
  cursor: "pointer",
@@ -328,13 +908,13 @@ var CoreSelect = function CoreSelect(props) {
328
908
  return styles;
329
909
  };
330
910
  var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
331
- var styles = _extends({}, base, {
911
+ var styles = _extends$1({}, base, {
332
912
  display: type === "no-outline" ? "none" : "block"
333
913
  });
334
914
  return styles;
335
915
  };
336
916
  var multiValueStyles = function multiValueStyles(base) {
337
- var styles = _extends({}, base, {
917
+ var styles = _extends$1({}, base, {
338
918
  backgroundColor: COLORS.lightBlue,
339
919
  borderRadius: "4px",
340
920
  padding: "2px 8px",
@@ -346,14 +926,14 @@ var CoreSelect = function CoreSelect(props) {
346
926
  return styles;
347
927
  };
348
928
  var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
349
- var styles = _extends({}, base, {
929
+ var styles = _extends$1({}, base, {
350
930
  color: COLORS.lightGray,
351
931
  cursor: "pointer"
352
932
  });
353
933
  return styles;
354
934
  };
355
935
  var multiValueLabelStyles = function multiValueLabelStyles(base) {
356
- var styles = _extends({}, base, {
936
+ var styles = _extends$1({}, base, {
357
937
  color: COLORS.blackText,
358
938
  fontWeight: "400",
359
939
  fontSize: "13px",
@@ -792,7 +1372,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
792
1372
  onChange(name, newValue);
793
1373
  };
794
1374
  var controlStyle = function controlStyle(base, state) {
795
- var styles = _extends({}, base, {
1375
+ var styles = _extends$1({}, base, {
796
1376
  fontSize: "14px",
797
1377
  fontWeight: "400",
798
1378
  backgroundColor: state.isDisabled ? "transparent" : error ? COLORS.lightYellow : COLORS.white,
@@ -813,7 +1393,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
813
1393
  return styles;
814
1394
  };
815
1395
  var inputStyles = function inputStyles(base) {
816
- var styles = _extends({}, base, {
1396
+ var styles = _extends$1({}, base, {
817
1397
  margin: "0",
818
1398
  padding: "0",
819
1399
  color: "inherit",
@@ -823,37 +1403,37 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
823
1403
  return styles;
824
1404
  };
825
1405
  var placeholderStyles = function placeholderStyles(base) {
826
- var styles = _extends({}, base, {
1406
+ var styles = _extends$1({}, base, {
827
1407
  color: COLORS.lightGray
828
1408
  });
829
1409
  return styles;
830
1410
  };
831
1411
  var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
832
- var styles = _extends({}, base, {
1412
+ var styles = _extends$1({}, base, {
833
1413
  position: "relative",
834
1414
  padding: "2px 0"
835
1415
  });
836
1416
  return styles;
837
1417
  };
838
1418
  var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
839
- var styles = _extends({}, base, {
1419
+ var styles = _extends$1({}, base, {
840
1420
  display: isShowDropdown && !isMulti ? "block" : "none"
841
1421
  });
842
1422
  return styles;
843
1423
  };
844
1424
  var valueContainerStyles = function valueContainerStyles(base) {
845
- var styles = _extends({}, base, {
1425
+ var styles = _extends$1({}, base, {
846
1426
  height: isMulti ? undefined : "26px",
847
1427
  position: "relative"
848
1428
  });
849
1429
  return styles;
850
1430
  };
851
1431
  var singleValueStyles = function singleValueStyles(base) {
852
- var styles = _extends({}, base);
1432
+ var styles = _extends$1({}, base);
853
1433
  return styles;
854
1434
  };
855
1435
  var optionStyles = function optionStyles(base, state) {
856
- var styles = _extends({}, base, {
1436
+ var styles = _extends$1({}, base, {
857
1437
  padding: "8px",
858
1438
  borderRadius: "8px",
859
1439
  cursor: "pointer",
@@ -868,7 +1448,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
868
1448
  return styles;
869
1449
  };
870
1450
  var multiValueStyles = function multiValueStyles(base) {
871
- var styles = _extends({}, base, {
1451
+ var styles = _extends$1({}, base, {
872
1452
  backgroundColor: COLORS.lightBlue,
873
1453
  borderRadius: "4px",
874
1454
  padding: "0 4px",
@@ -880,14 +1460,14 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
880
1460
  return styles;
881
1461
  };
882
1462
  var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
883
- var styles = _extends({}, base, {
1463
+ var styles = _extends$1({}, base, {
884
1464
  color: COLORS.lightGray,
885
1465
  cursor: "pointer"
886
1466
  });
887
1467
  return styles;
888
1468
  };
889
1469
  var multiValueLabelStyles = function multiValueLabelStyles(base) {
890
- var styles = _extends({}, base, {
1470
+ var styles = _extends$1({}, base, {
891
1471
  color: COLORS.blackText,
892
1472
  fontWeight: "400",
893
1473
  fontSize: "13px",
@@ -1082,20 +1662,67 @@ var CoreTooltip = function CoreTooltip(_ref) {
1082
1662
  }, content));
1083
1663
  };
1084
1664
 
1085
- var _excluded$3 = ["node"];
1086
1665
  var MarkdownLatexRender = function MarkdownLatexRender(_ref) {
1087
1666
  var content = _ref.content;
1088
- var updatedMarkdown = content.replace(/\\\(/g, "$$").replace(/\\\)/g, "$$").replace(/\\\[/g, "$$$$").replace(/\\\]\s*\./g, "$$$$").replace(/\\\]/g, "$$$$").replace(/<br\s*\/?>/g, "\n\n");
1089
- return React.createElement("span", null, React.createElement(ReactMarkdown, {
1090
- remarkPlugins: [remarkMath, remarkGfm, remarkRehype],
1091
- rehypePlugins: [rehypeKatex, rehypeRaw],
1092
- components: {
1093
- p: function p(_ref2) {
1094
- var props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
1095
- return React.createElement("span", Object.assign({}, props));
1667
+ var displayRef = React.useRef(null);
1668
+ var processedText = content.replace(/(.*)(?:\s*(.*))?(?=\n\n|$)/, function (_match, prefix, equation) {
1669
+ if (equation) {
1670
+ var trimmedEquation = equation.trim();
1671
+ if (trimmedEquation.startsWith("\\(") && trimmedEquation.endsWith("\\)")) {
1672
+ return "" + prefix + equation;
1673
+ } else {
1674
+ return prefix + "\n\\(" + equation + "\\)";
1675
+ }
1676
+ } else {
1677
+ var latexStart = -1;
1678
+ if (content.includes("_")) {
1679
+ latexStart = content.search(/[a-zA-Z]_/);
1680
+ } else if (content.includes("^")) {
1681
+ latexStart = content.search(/[a-zA-Z]\^/);
1682
+ } else if (content.includes("\\")) {
1683
+ latexStart = content.search(/\\/);
1684
+ }
1685
+ if (latexStart !== -1) {
1686
+ var _prefix = content.substring(0, latexStart);
1687
+ var _equation = content.substring(latexStart);
1688
+ return _prefix + "\\(" + _equation + "\\)";
1689
+ } else {
1690
+ return content;
1096
1691
  }
1097
1692
  }
1098
- }, updatedMarkdown));
1693
+ });
1694
+ displayRef.current.innerHTML = processedText;
1695
+ useEffect(function () {
1696
+ if (displayRef.current) {
1697
+ try {
1698
+ renderMathInElement(displayRef.current, {
1699
+ delimiters: [{
1700
+ left: "$$",
1701
+ right: "$$",
1702
+ display: true
1703
+ }, {
1704
+ left: "$$$$",
1705
+ right: "$$$$",
1706
+ display: true
1707
+ }, {
1708
+ left: "\\(",
1709
+ right: "\\)",
1710
+ display: false
1711
+ }, {
1712
+ left: "\\[",
1713
+ right: "\\]",
1714
+ display: true
1715
+ }]
1716
+ });
1717
+ } catch (error) {
1718
+ console.error("Error rendering math:", error);
1719
+ }
1720
+ }
1721
+ }, [content]);
1722
+ return React.createElement("span", null, React.createElement("div", {
1723
+ ref: displayRef,
1724
+ className: "equation-support"
1725
+ }));
1099
1726
  };
1100
1727
 
1101
1728
  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;
@@ -2167,51 +2794,6 @@ var getImageUrl = function getImageUrl(imageUrl) {
2167
2794
  }
2168
2795
  };
2169
2796
 
2170
- var UpdateNotifier = function UpdateNotifier() {
2171
- var _useState = useState(false),
2172
- newVersionAvailable = _useState[0],
2173
- setNewVersionAvailable = _useState[1];
2174
- useEffect(function () {
2175
- if ('serviceWorker' in navigator) {
2176
- navigator.serviceWorker.addEventListener('controllerchange', function () {
2177
- console.log("New service worker has become active, reloading...");
2178
- window.location.reload();
2179
- });
2180
- navigator.serviceWorker.register('/service-worker.js').then(function (reg) {
2181
- reg.addEventListener('updatefound', function () {
2182
- var newWorker = reg.installing;
2183
- if (newWorker) {
2184
- newWorker.addEventListener('statechange', function () {
2185
- if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
2186
- setNewVersionAvailable(true);
2187
- }
2188
- });
2189
- }
2190
- });
2191
- });
2192
- }
2193
- }, []);
2194
- var handleUpdate = function handleUpdate() {
2195
- if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
2196
- navigator.serviceWorker.controller.postMessage({
2197
- type: 'SKIP_WAITING'
2198
- });
2199
- }
2200
- };
2201
- if (!newVersionAvailable) {
2202
- return null;
2203
- }
2204
- return React.createElement("div", {
2205
- style: {
2206
- padding: '10px',
2207
- backgroundColor: '#f0f0f0',
2208
- textAlign: 'center'
2209
- }
2210
- }, "A new version is available! ", React.createElement("button", {
2211
- onClick: handleUpdate
2212
- }, "Update Now"));
2213
- };
2214
-
2215
2797
  var NotFound = function NotFound() {
2216
2798
  return React.createElement("div", {
2217
2799
  className: "not-found"
@@ -2486,7 +3068,7 @@ var useAmplitude = function useAmplitude() {
2486
3068
  var savedUserProperties = useRef({});
2487
3069
  var hasTrackedInitialSession = useRef(false);
2488
3070
  var setUserProperties = useCallback(function (properties) {
2489
- savedUserProperties.current = _extends({}, savedUserProperties.current, properties);
3071
+ savedUserProperties.current = _extends$1({}, savedUserProperties.current, properties);
2490
3072
  var identify$1 = new Identify();
2491
3073
  Object.entries(properties).forEach(function (_ref) {
2492
3074
  var key = _ref[0],
@@ -2498,7 +3080,7 @@ var useAmplitude = function useAmplitude() {
2498
3080
  var trackEvent = useCallback(function (_ref2) {
2499
3081
  var eventName = _ref2.eventName,
2500
3082
  eventProperties = _ref2.eventProperties;
2501
- track(eventName, _extends({}, savedUserProperties.current, eventProperties, {
3083
+ track(eventName, _extends$1({}, savedUserProperties.current, eventProperties, {
2502
3084
  timestamp: new Date().toISOString()
2503
3085
  }));
2504
3086
  }, []);
@@ -2685,7 +3267,7 @@ var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
2685
3267
 
2686
3268
  var customStyles = {
2687
3269
  control: function control(baseStyles, state) {
2688
- return _extends({}, baseStyles, {
3270
+ return _extends$1({}, baseStyles, {
2689
3271
  fontSize: "14px",
2690
3272
  fontWeight: 700,
2691
3273
  color: styleGlobal.darker,
@@ -2700,21 +3282,21 @@ var customStyles = {
2700
3282
  });
2701
3283
  },
2702
3284
  input: function input(baseStyles, _) {
2703
- return _extends({}, baseStyles, {
3285
+ return _extends$1({}, baseStyles, {
2704
3286
  fontSize: "14px",
2705
3287
  fontWeight: 700,
2706
3288
  color: styleGlobal.darker
2707
3289
  });
2708
3290
  },
2709
3291
  singleValue: function singleValue(baseStyles) {
2710
- return _extends({}, baseStyles, {
3292
+ return _extends$1({}, baseStyles, {
2711
3293
  fontSize: "14px",
2712
3294
  fontWeight: 700,
2713
3295
  color: styleGlobal.darker
2714
3296
  });
2715
3297
  },
2716
3298
  option: function option(baseStyles, state) {
2717
- return _extends({}, baseStyles, {
3299
+ return _extends$1({}, baseStyles, {
2718
3300
  backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.light : 'white',
2719
3301
  "&:active": {
2720
3302
  backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.less_dark : baseStyles.backgroundColor
@@ -2738,7 +3320,7 @@ var CustomOption = function CustomOption(props) {
2738
3320
  }, props.data.label));
2739
3321
  };
2740
3322
 
2741
- var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3323
+ var _excluded$3 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2742
3324
  var CustomSelect = function CustomSelect(_ref) {
2743
3325
  var isDefault = _ref.isDefault,
2744
3326
  options = _ref.options,
@@ -2746,7 +3328,7 @@ var CustomSelect = function CustomSelect(_ref) {
2746
3328
  scrollBottom = _ref.scrollBottom,
2747
3329
  value = _ref.value,
2748
3330
  isMulti = _ref.isMulti,
2749
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
3331
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2750
3332
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
2751
3333
  return value.includes(i.value);
2752
3334
  }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
@@ -2773,7 +3355,7 @@ var CustomSelect = function CustomSelect(_ref) {
2773
3355
  }, rest));
2774
3356
  };
2775
3357
 
2776
- var _excluded$5 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3358
+ var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2777
3359
  var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
2778
3360
  var isDefault = _ref.isDefault,
2779
3361
  options = _ref.options,
@@ -2781,7 +3363,7 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
2781
3363
  scrollBottom = _ref.scrollBottom,
2782
3364
  value = _ref.value,
2783
3365
  isMulti = _ref.isMulti,
2784
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
3366
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2785
3367
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
2786
3368
  return value.includes(i.value);
2787
3369
  }) : isMulti ? options.filter(function (i) {
@@ -2808,14 +3390,14 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
2808
3390
  }, rest));
2809
3391
  };
2810
3392
 
2811
- var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3393
+ var _excluded$5 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2812
3394
  var CustomCreatable = function CustomCreatable(_ref) {
2813
3395
  var options = _ref.options,
2814
3396
  isDisabled = _ref.isDisabled,
2815
3397
  scrollBottom = _ref.scrollBottom,
2816
3398
  value = _ref.value,
2817
3399
  isMulti = _ref.isMulti,
2818
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
3400
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
2819
3401
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
2820
3402
  return value.includes(i.value);
2821
3403
  }) : isMulti ? options.filter(function (i) {
@@ -2842,7 +3424,7 @@ var CustomCreatable = function CustomCreatable(_ref) {
2842
3424
  }, rest));
2843
3425
  };
2844
3426
 
2845
- var _excluded$7 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
3427
+ var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2846
3428
  var CustomSelectOption = function CustomSelectOption(_ref) {
2847
3429
  var defaultValue = _ref.defaultValue,
2848
3430
  options = _ref.options,
@@ -2850,7 +3432,7 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
2850
3432
  scrollBottom = _ref.scrollBottom,
2851
3433
  value = _ref.value,
2852
3434
  isMulti = _ref.isMulti,
2853
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
3435
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2854
3436
  var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
2855
3437
  return option.value === defaultValue;
2856
3438
  }) || null : null;
@@ -2884,5 +3466,5 @@ var utcToLocalTime = (function (time, FORMAT) {
2884
3466
 
2885
3467
  var historyCore = createBrowserHistory();
2886
3468
 
2887
- export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, Role, UpdateNotifier, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, useAmplitude, useGoogleSignOut, utcToLocalTime };
3469
+ export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, Role, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, useAmplitude, useGoogleSignOut, utcToLocalTime };
2888
3470
  //# sourceMappingURL=index.modern.js.map