acsi-core 0.9.13 → 0.9.15
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/components/UpdateNotifier.d.ts +3 -0
- package/dist/configs/api_removed.d.ts +3 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +669 -107
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +657 -93
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/configLoader.d.ts +2 -0
- package/dist/utils/hooks/useServiceWorker.d.ts +1 -0
- package/dist/utils/latexExtractor.d.ts +4 -0
- package/package.json +1 -2
- package/dist/containers/PDF/views/PDFViewer.d.ts +0 -3
- package/dist/utils/sanitizeHTMLText.d.ts +0 -2
- package/dist/utils/sanitizeSrc.d.ts +0 -7
- package/dist/utils/sanitizeText.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +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
|
-
var Cookies = _interopDefault(require('js-cookie'));
|
|
5
3
|
var toolkit = require('@reduxjs/toolkit');
|
|
6
4
|
var React = require('react');
|
|
7
5
|
var React__default = _interopDefault(React);
|
|
@@ -19,6 +17,7 @@ var rehypeKatex = _interopDefault(require('rehype-katex'));
|
|
|
19
17
|
var remarkRehype = _interopDefault(require('remark-rehype'));
|
|
20
18
|
var rehypeRaw = _interopDefault(require('rehype-raw'));
|
|
21
19
|
require('katex/dist/katex.min.css');
|
|
20
|
+
var Cookies = _interopDefault(require('js-cookie'));
|
|
22
21
|
var moment = _interopDefault(require('moment'));
|
|
23
22
|
var reactToastify = require('react-toastify');
|
|
24
23
|
var reactGoogleLogin = require('@leecheuk/react-google-login');
|
|
@@ -28,7 +27,592 @@ var amplitude = require('@amplitude/analytics-browser');
|
|
|
28
27
|
var Sentry = require('@sentry/react');
|
|
29
28
|
var fa = require('react-icons/fa');
|
|
30
29
|
var CreatableSelect = _interopDefault(require('react-select/creatable'));
|
|
31
|
-
|
|
30
|
+
|
|
31
|
+
function _extends() {
|
|
32
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
33
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
34
|
+
var t = arguments[e];
|
|
35
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
36
|
+
}
|
|
37
|
+
return n;
|
|
38
|
+
}, _extends.apply(null, arguments);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isAbsolute(pathname) {
|
|
42
|
+
return pathname.charAt(0) === '/';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// About 1.5x faster than the two-arg version of Array#splice()
|
|
46
|
+
function spliceOne(list, index) {
|
|
47
|
+
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
|
48
|
+
list[i] = list[k];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
list.pop();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// This implementation is based heavily on node's url.parse
|
|
55
|
+
function resolvePathname(to, from) {
|
|
56
|
+
if (from === undefined) from = '';
|
|
57
|
+
|
|
58
|
+
var toParts = (to && to.split('/')) || [];
|
|
59
|
+
var fromParts = (from && from.split('/')) || [];
|
|
60
|
+
|
|
61
|
+
var isToAbs = to && isAbsolute(to);
|
|
62
|
+
var isFromAbs = from && isAbsolute(from);
|
|
63
|
+
var mustEndAbs = isToAbs || isFromAbs;
|
|
64
|
+
|
|
65
|
+
if (to && isAbsolute(to)) {
|
|
66
|
+
// to is absolute
|
|
67
|
+
fromParts = toParts;
|
|
68
|
+
} else if (toParts.length) {
|
|
69
|
+
// to is relative, drop the filename
|
|
70
|
+
fromParts.pop();
|
|
71
|
+
fromParts = fromParts.concat(toParts);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!fromParts.length) return '/';
|
|
75
|
+
|
|
76
|
+
var hasTrailingSlash;
|
|
77
|
+
if (fromParts.length) {
|
|
78
|
+
var last = fromParts[fromParts.length - 1];
|
|
79
|
+
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
|
80
|
+
} else {
|
|
81
|
+
hasTrailingSlash = false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var up = 0;
|
|
85
|
+
for (var i = fromParts.length; i >= 0; i--) {
|
|
86
|
+
var part = fromParts[i];
|
|
87
|
+
|
|
88
|
+
if (part === '.') {
|
|
89
|
+
spliceOne(fromParts, i);
|
|
90
|
+
} else if (part === '..') {
|
|
91
|
+
spliceOne(fromParts, i);
|
|
92
|
+
up++;
|
|
93
|
+
} else if (up) {
|
|
94
|
+
spliceOne(fromParts, i);
|
|
95
|
+
up--;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
|
|
100
|
+
|
|
101
|
+
if (
|
|
102
|
+
mustEndAbs &&
|
|
103
|
+
fromParts[0] !== '' &&
|
|
104
|
+
(!fromParts[0] || !isAbsolute(fromParts[0]))
|
|
105
|
+
)
|
|
106
|
+
fromParts.unshift('');
|
|
107
|
+
|
|
108
|
+
var result = fromParts.join('/');
|
|
109
|
+
|
|
110
|
+
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
|
111
|
+
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var isProduction = process.env.NODE_ENV === 'production';
|
|
116
|
+
function warning(condition, message) {
|
|
117
|
+
if (!isProduction) {
|
|
118
|
+
if (condition) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var text = "Warning: " + message;
|
|
123
|
+
|
|
124
|
+
if (typeof console !== 'undefined') {
|
|
125
|
+
console.warn(text);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
throw Error(text);
|
|
130
|
+
} catch (x) {}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var isProduction$1 = process.env.NODE_ENV === 'production';
|
|
135
|
+
var prefix = 'Invariant failed';
|
|
136
|
+
function invariant(condition, message) {
|
|
137
|
+
if (condition) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (isProduction$1) {
|
|
141
|
+
throw new Error(prefix);
|
|
142
|
+
}
|
|
143
|
+
var provided = typeof message === 'function' ? message() : message;
|
|
144
|
+
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
145
|
+
throw new Error(value);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function addLeadingSlash(path) {
|
|
149
|
+
return path.charAt(0) === '/' ? path : '/' + path;
|
|
150
|
+
}
|
|
151
|
+
function hasBasename(path, prefix) {
|
|
152
|
+
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
|
|
153
|
+
}
|
|
154
|
+
function stripBasename(path, prefix) {
|
|
155
|
+
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
|
156
|
+
}
|
|
157
|
+
function stripTrailingSlash(path) {
|
|
158
|
+
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
|
159
|
+
}
|
|
160
|
+
function parsePath(path) {
|
|
161
|
+
var pathname = path || '/';
|
|
162
|
+
var search = '';
|
|
163
|
+
var hash = '';
|
|
164
|
+
var hashIndex = pathname.indexOf('#');
|
|
165
|
+
|
|
166
|
+
if (hashIndex !== -1) {
|
|
167
|
+
hash = pathname.substr(hashIndex);
|
|
168
|
+
pathname = pathname.substr(0, hashIndex);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
var searchIndex = pathname.indexOf('?');
|
|
172
|
+
|
|
173
|
+
if (searchIndex !== -1) {
|
|
174
|
+
search = pathname.substr(searchIndex);
|
|
175
|
+
pathname = pathname.substr(0, searchIndex);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
pathname: pathname,
|
|
180
|
+
search: search === '?' ? '' : search,
|
|
181
|
+
hash: hash === '#' ? '' : hash
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function createPath(location) {
|
|
185
|
+
var pathname = location.pathname,
|
|
186
|
+
search = location.search,
|
|
187
|
+
hash = location.hash;
|
|
188
|
+
var path = pathname || '/';
|
|
189
|
+
if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
|
|
190
|
+
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
|
191
|
+
return path;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function createLocation(path, state, key, currentLocation) {
|
|
195
|
+
var location;
|
|
196
|
+
|
|
197
|
+
if (typeof path === 'string') {
|
|
198
|
+
// Two-arg form: push(path, state)
|
|
199
|
+
location = parsePath(path);
|
|
200
|
+
location.state = state;
|
|
201
|
+
} else {
|
|
202
|
+
// One-arg form: push(location)
|
|
203
|
+
location = _extends({}, path);
|
|
204
|
+
if (location.pathname === undefined) location.pathname = '';
|
|
205
|
+
|
|
206
|
+
if (location.search) {
|
|
207
|
+
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
|
208
|
+
} else {
|
|
209
|
+
location.search = '';
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (location.hash) {
|
|
213
|
+
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
|
214
|
+
} else {
|
|
215
|
+
location.hash = '';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (state !== undefined && location.state === undefined) location.state = state;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
try {
|
|
222
|
+
location.pathname = decodeURI(location.pathname);
|
|
223
|
+
} catch (e) {
|
|
224
|
+
if (e instanceof URIError) {
|
|
225
|
+
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
|
226
|
+
} else {
|
|
227
|
+
throw e;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (key) location.key = key;
|
|
232
|
+
|
|
233
|
+
if (currentLocation) {
|
|
234
|
+
// Resolve incomplete/relative pathname relative to current location.
|
|
235
|
+
if (!location.pathname) {
|
|
236
|
+
location.pathname = currentLocation.pathname;
|
|
237
|
+
} else if (location.pathname.charAt(0) !== '/') {
|
|
238
|
+
location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
// When there is no prior location and pathname is empty, set it to /
|
|
242
|
+
if (!location.pathname) {
|
|
243
|
+
location.pathname = '/';
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return location;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function createTransitionManager() {
|
|
251
|
+
var prompt = null;
|
|
252
|
+
|
|
253
|
+
function setPrompt(nextPrompt) {
|
|
254
|
+
process.env.NODE_ENV !== "production" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;
|
|
255
|
+
prompt = nextPrompt;
|
|
256
|
+
return function () {
|
|
257
|
+
if (prompt === nextPrompt) prompt = null;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
|
262
|
+
// TODO: If another transition starts while we're still confirming
|
|
263
|
+
// the previous one, we may end up in a weird state. Figure out the
|
|
264
|
+
// best way to handle this.
|
|
265
|
+
if (prompt != null) {
|
|
266
|
+
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
|
267
|
+
|
|
268
|
+
if (typeof result === 'string') {
|
|
269
|
+
if (typeof getUserConfirmation === 'function') {
|
|
270
|
+
getUserConfirmation(result, callback);
|
|
271
|
+
} else {
|
|
272
|
+
process.env.NODE_ENV !== "production" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
|
|
273
|
+
callback(true);
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
// Return false from a transition hook to cancel the transition.
|
|
277
|
+
callback(result !== false);
|
|
278
|
+
}
|
|
279
|
+
} else {
|
|
280
|
+
callback(true);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
var listeners = [];
|
|
285
|
+
|
|
286
|
+
function appendListener(fn) {
|
|
287
|
+
var isActive = true;
|
|
288
|
+
|
|
289
|
+
function listener() {
|
|
290
|
+
if (isActive) fn.apply(void 0, arguments);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
listeners.push(listener);
|
|
294
|
+
return function () {
|
|
295
|
+
isActive = false;
|
|
296
|
+
listeners = listeners.filter(function (item) {
|
|
297
|
+
return item !== listener;
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function notifyListeners() {
|
|
303
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
304
|
+
args[_key] = arguments[_key];
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
listeners.forEach(function (listener) {
|
|
308
|
+
return listener.apply(void 0, args);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return {
|
|
313
|
+
setPrompt: setPrompt,
|
|
314
|
+
confirmTransitionTo: confirmTransitionTo,
|
|
315
|
+
appendListener: appendListener,
|
|
316
|
+
notifyListeners: notifyListeners
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
321
|
+
function getConfirmation(message, callback) {
|
|
322
|
+
callback(window.confirm(message)); // eslint-disable-line no-alert
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
|
326
|
+
*
|
|
327
|
+
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
|
328
|
+
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
|
329
|
+
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
function supportsHistory() {
|
|
333
|
+
var ua = window.navigator.userAgent;
|
|
334
|
+
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;
|
|
335
|
+
return window.history && 'pushState' in window.history;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Returns true if browser fires popstate on hash change.
|
|
339
|
+
* IE10 and IE11 do not.
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
function supportsPopStateOnHashChange() {
|
|
343
|
+
return window.navigator.userAgent.indexOf('Trident') === -1;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Returns true if a given popstate event is an extraneous WebKit event.
|
|
347
|
+
* Accounts for the fact that Chrome on iOS fires real popstate events
|
|
348
|
+
* containing undefined state when pressing the back button.
|
|
349
|
+
*/
|
|
350
|
+
|
|
351
|
+
function isExtraneousPopstateEvent(event) {
|
|
352
|
+
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
var PopStateEvent = 'popstate';
|
|
356
|
+
var HashChangeEvent = 'hashchange';
|
|
357
|
+
|
|
358
|
+
function getHistoryState() {
|
|
359
|
+
try {
|
|
360
|
+
return window.history.state || {};
|
|
361
|
+
} catch (e) {
|
|
362
|
+
// IE 11 sometimes throws when accessing window.history.state
|
|
363
|
+
// See https://github.com/ReactTraining/history/pull/289
|
|
364
|
+
return {};
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Creates a history object that uses the HTML5 history API including
|
|
369
|
+
* pushState, replaceState, and the popstate event.
|
|
370
|
+
*/
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
function createBrowserHistory(props) {
|
|
374
|
+
if (props === void 0) {
|
|
375
|
+
props = {};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;
|
|
379
|
+
var globalHistory = window.history;
|
|
380
|
+
var canUseHistory = supportsHistory();
|
|
381
|
+
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
|
382
|
+
var _props = props,
|
|
383
|
+
_props$forceRefresh = _props.forceRefresh,
|
|
384
|
+
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
|
385
|
+
_props$getUserConfirm = _props.getUserConfirmation,
|
|
386
|
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
|
387
|
+
_props$keyLength = _props.keyLength,
|
|
388
|
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
|
389
|
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
|
390
|
+
|
|
391
|
+
function getDOMLocation(historyState) {
|
|
392
|
+
var _ref = historyState || {},
|
|
393
|
+
key = _ref.key,
|
|
394
|
+
state = _ref.state;
|
|
395
|
+
|
|
396
|
+
var _window$location = window.location,
|
|
397
|
+
pathname = _window$location.pathname,
|
|
398
|
+
search = _window$location.search,
|
|
399
|
+
hash = _window$location.hash;
|
|
400
|
+
var path = pathname + search + hash;
|
|
401
|
+
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;
|
|
402
|
+
if (basename) path = stripBasename(path, basename);
|
|
403
|
+
return createLocation(path, state, key);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function createKey() {
|
|
407
|
+
return Math.random().toString(36).substr(2, keyLength);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
var transitionManager = createTransitionManager();
|
|
411
|
+
|
|
412
|
+
function setState(nextState) {
|
|
413
|
+
_extends(history, nextState);
|
|
414
|
+
|
|
415
|
+
history.length = globalHistory.length;
|
|
416
|
+
transitionManager.notifyListeners(history.location, history.action);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function handlePopState(event) {
|
|
420
|
+
// Ignore extraneous popstate events in WebKit.
|
|
421
|
+
if (isExtraneousPopstateEvent(event)) return;
|
|
422
|
+
handlePop(getDOMLocation(event.state));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function handleHashChange() {
|
|
426
|
+
handlePop(getDOMLocation(getHistoryState()));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
var forceNextPop = false;
|
|
430
|
+
|
|
431
|
+
function handlePop(location) {
|
|
432
|
+
if (forceNextPop) {
|
|
433
|
+
forceNextPop = false;
|
|
434
|
+
setState();
|
|
435
|
+
} else {
|
|
436
|
+
var action = 'POP';
|
|
437
|
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
438
|
+
if (ok) {
|
|
439
|
+
setState({
|
|
440
|
+
action: action,
|
|
441
|
+
location: location
|
|
442
|
+
});
|
|
443
|
+
} else {
|
|
444
|
+
revertPop(location);
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function revertPop(fromLocation) {
|
|
451
|
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
|
452
|
+
// keeping a list of keys we've seen in sessionStorage.
|
|
453
|
+
// Instead, we just default to 0 for keys we don't know.
|
|
454
|
+
|
|
455
|
+
var toIndex = allKeys.indexOf(toLocation.key);
|
|
456
|
+
if (toIndex === -1) toIndex = 0;
|
|
457
|
+
var fromIndex = allKeys.indexOf(fromLocation.key);
|
|
458
|
+
if (fromIndex === -1) fromIndex = 0;
|
|
459
|
+
var delta = toIndex - fromIndex;
|
|
460
|
+
|
|
461
|
+
if (delta) {
|
|
462
|
+
forceNextPop = true;
|
|
463
|
+
go(delta);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
var initialLocation = getDOMLocation(getHistoryState());
|
|
468
|
+
var allKeys = [initialLocation.key]; // Public interface
|
|
469
|
+
|
|
470
|
+
function createHref(location) {
|
|
471
|
+
return basename + createPath(location);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function push(path, state) {
|
|
475
|
+
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;
|
|
476
|
+
var action = 'PUSH';
|
|
477
|
+
var location = createLocation(path, state, createKey(), history.location);
|
|
478
|
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
479
|
+
if (!ok) return;
|
|
480
|
+
var href = createHref(location);
|
|
481
|
+
var key = location.key,
|
|
482
|
+
state = location.state;
|
|
483
|
+
|
|
484
|
+
if (canUseHistory) {
|
|
485
|
+
globalHistory.pushState({
|
|
486
|
+
key: key,
|
|
487
|
+
state: state
|
|
488
|
+
}, null, href);
|
|
489
|
+
|
|
490
|
+
if (forceRefresh) {
|
|
491
|
+
window.location.href = href;
|
|
492
|
+
} else {
|
|
493
|
+
var prevIndex = allKeys.indexOf(history.location.key);
|
|
494
|
+
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
|
495
|
+
nextKeys.push(location.key);
|
|
496
|
+
allKeys = nextKeys;
|
|
497
|
+
setState({
|
|
498
|
+
action: action,
|
|
499
|
+
location: location
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
} else {
|
|
503
|
+
process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
|
|
504
|
+
window.location.href = href;
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function replace(path, state) {
|
|
510
|
+
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;
|
|
511
|
+
var action = 'REPLACE';
|
|
512
|
+
var location = createLocation(path, state, createKey(), history.location);
|
|
513
|
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
514
|
+
if (!ok) return;
|
|
515
|
+
var href = createHref(location);
|
|
516
|
+
var key = location.key,
|
|
517
|
+
state = location.state;
|
|
518
|
+
|
|
519
|
+
if (canUseHistory) {
|
|
520
|
+
globalHistory.replaceState({
|
|
521
|
+
key: key,
|
|
522
|
+
state: state
|
|
523
|
+
}, null, href);
|
|
524
|
+
|
|
525
|
+
if (forceRefresh) {
|
|
526
|
+
window.location.replace(href);
|
|
527
|
+
} else {
|
|
528
|
+
var prevIndex = allKeys.indexOf(history.location.key);
|
|
529
|
+
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
|
530
|
+
setState({
|
|
531
|
+
action: action,
|
|
532
|
+
location: location
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
} else {
|
|
536
|
+
process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
|
|
537
|
+
window.location.replace(href);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function go(n) {
|
|
543
|
+
globalHistory.go(n);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function goBack() {
|
|
547
|
+
go(-1);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function goForward() {
|
|
551
|
+
go(1);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
var listenerCount = 0;
|
|
555
|
+
|
|
556
|
+
function checkDOMListeners(delta) {
|
|
557
|
+
listenerCount += delta;
|
|
558
|
+
|
|
559
|
+
if (listenerCount === 1 && delta === 1) {
|
|
560
|
+
window.addEventListener(PopStateEvent, handlePopState);
|
|
561
|
+
if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
|
|
562
|
+
} else if (listenerCount === 0) {
|
|
563
|
+
window.removeEventListener(PopStateEvent, handlePopState);
|
|
564
|
+
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
var isBlocked = false;
|
|
569
|
+
|
|
570
|
+
function block(prompt) {
|
|
571
|
+
if (prompt === void 0) {
|
|
572
|
+
prompt = false;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
var unblock = transitionManager.setPrompt(prompt);
|
|
576
|
+
|
|
577
|
+
if (!isBlocked) {
|
|
578
|
+
checkDOMListeners(1);
|
|
579
|
+
isBlocked = true;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
return function () {
|
|
583
|
+
if (isBlocked) {
|
|
584
|
+
isBlocked = false;
|
|
585
|
+
checkDOMListeners(-1);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return unblock();
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
function listen(listener) {
|
|
593
|
+
var unlisten = transitionManager.appendListener(listener);
|
|
594
|
+
checkDOMListeners(1);
|
|
595
|
+
return function () {
|
|
596
|
+
checkDOMListeners(-1);
|
|
597
|
+
unlisten();
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
var history = {
|
|
602
|
+
length: globalHistory.length,
|
|
603
|
+
action: 'POP',
|
|
604
|
+
location: initialLocation,
|
|
605
|
+
createHref: createHref,
|
|
606
|
+
push: push,
|
|
607
|
+
replace: replace,
|
|
608
|
+
go: go,
|
|
609
|
+
goBack: goBack,
|
|
610
|
+
goForward: goForward,
|
|
611
|
+
block: block,
|
|
612
|
+
listen: listen
|
|
613
|
+
};
|
|
614
|
+
return history;
|
|
615
|
+
}
|
|
32
616
|
|
|
33
617
|
var setLoading = toolkit.createAction("common/setLoading");
|
|
34
618
|
var setLoadingPage = toolkit.createAction("common/setLoadingPage");
|
|
@@ -129,14 +713,14 @@ function _createForOfIteratorHelperLoose(r, e) {
|
|
|
129
713
|
}
|
|
130
714
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
131
715
|
}
|
|
132
|
-
function _extends() {
|
|
133
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
716
|
+
function _extends$1() {
|
|
717
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
|
|
134
718
|
for (var e = 1; e < arguments.length; e++) {
|
|
135
719
|
var t = arguments[e];
|
|
136
720
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
137
721
|
}
|
|
138
722
|
return n;
|
|
139
|
-
}, _extends.apply(null, arguments);
|
|
723
|
+
}, _extends$1.apply(null, arguments);
|
|
140
724
|
}
|
|
141
725
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
142
726
|
if (null == r) return {};
|
|
@@ -282,7 +866,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
282
866
|
onChange(name, newValue);
|
|
283
867
|
};
|
|
284
868
|
var controlStyle = function controlStyle(base, state) {
|
|
285
|
-
var styles = _extends({}, base, {
|
|
869
|
+
var styles = _extends$1({}, base, {
|
|
286
870
|
fontSize: "14px",
|
|
287
871
|
fontWeight: "400",
|
|
288
872
|
padding: "0 4px",
|
|
@@ -311,7 +895,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
311
895
|
return styles;
|
|
312
896
|
};
|
|
313
897
|
var inputStyles = function inputStyles(base) {
|
|
314
|
-
var styles = _extends({}, base, {
|
|
898
|
+
var styles = _extends$1({}, base, {
|
|
315
899
|
margin: "0",
|
|
316
900
|
padding: "0",
|
|
317
901
|
color: "inherit"
|
|
@@ -319,13 +903,13 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
319
903
|
return styles;
|
|
320
904
|
};
|
|
321
905
|
var placeholderStyles = function placeholderStyles(base) {
|
|
322
|
-
var styles = _extends({}, base, {
|
|
906
|
+
var styles = _extends$1({}, base, {
|
|
323
907
|
color: COLORS.lightGray
|
|
324
908
|
});
|
|
325
909
|
return styles;
|
|
326
910
|
};
|
|
327
911
|
var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
|
|
328
|
-
var styles = _extends({}, base, {
|
|
912
|
+
var styles = _extends$1({}, base, {
|
|
329
913
|
position: "relative",
|
|
330
914
|
top: "-4px",
|
|
331
915
|
padding: "8px 0"
|
|
@@ -333,7 +917,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
333
917
|
return styles;
|
|
334
918
|
};
|
|
335
919
|
var valueContainerStyles = function valueContainerStyles(base) {
|
|
336
|
-
var styles = _extends({}, base, {
|
|
920
|
+
var styles = _extends$1({}, base, {
|
|
337
921
|
height: isMulti ? undefined : "32px",
|
|
338
922
|
position: "relative",
|
|
339
923
|
top: "-3px"
|
|
@@ -341,11 +925,11 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
341
925
|
return styles;
|
|
342
926
|
};
|
|
343
927
|
var singleValueStyles = function singleValueStyles(base) {
|
|
344
|
-
var styles = _extends({}, base);
|
|
928
|
+
var styles = _extends$1({}, base);
|
|
345
929
|
return styles;
|
|
346
930
|
};
|
|
347
931
|
var optionStyles = function optionStyles(base, state) {
|
|
348
|
-
var styles = _extends({}, base, {
|
|
932
|
+
var styles = _extends$1({}, base, {
|
|
349
933
|
padding: "8px",
|
|
350
934
|
borderRadius: "8px",
|
|
351
935
|
cursor: "pointer",
|
|
@@ -359,13 +943,13 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
359
943
|
return styles;
|
|
360
944
|
};
|
|
361
945
|
var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
|
|
362
|
-
var styles = _extends({}, base, {
|
|
946
|
+
var styles = _extends$1({}, base, {
|
|
363
947
|
display: type === "no-outline" ? "none" : "block"
|
|
364
948
|
});
|
|
365
949
|
return styles;
|
|
366
950
|
};
|
|
367
951
|
var multiValueStyles = function multiValueStyles(base) {
|
|
368
|
-
var styles = _extends({}, base, {
|
|
952
|
+
var styles = _extends$1({}, base, {
|
|
369
953
|
backgroundColor: COLORS.lightBlue,
|
|
370
954
|
borderRadius: "4px",
|
|
371
955
|
padding: "2px 8px",
|
|
@@ -377,14 +961,14 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
377
961
|
return styles;
|
|
378
962
|
};
|
|
379
963
|
var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
|
|
380
|
-
var styles = _extends({}, base, {
|
|
964
|
+
var styles = _extends$1({}, base, {
|
|
381
965
|
color: COLORS.lightGray,
|
|
382
966
|
cursor: "pointer"
|
|
383
967
|
});
|
|
384
968
|
return styles;
|
|
385
969
|
};
|
|
386
970
|
var multiValueLabelStyles = function multiValueLabelStyles(base) {
|
|
387
|
-
var styles = _extends({}, base, {
|
|
971
|
+
var styles = _extends$1({}, base, {
|
|
388
972
|
color: COLORS.blackText,
|
|
389
973
|
fontWeight: "400",
|
|
390
974
|
fontSize: "13px",
|
|
@@ -823,7 +1407,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
823
1407
|
onChange(name, newValue);
|
|
824
1408
|
};
|
|
825
1409
|
var controlStyle = function controlStyle(base, state) {
|
|
826
|
-
var styles = _extends({}, base, {
|
|
1410
|
+
var styles = _extends$1({}, base, {
|
|
827
1411
|
fontSize: "14px",
|
|
828
1412
|
fontWeight: "400",
|
|
829
1413
|
backgroundColor: state.isDisabled ? "transparent" : error ? COLORS.lightYellow : COLORS.white,
|
|
@@ -844,7 +1428,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
844
1428
|
return styles;
|
|
845
1429
|
};
|
|
846
1430
|
var inputStyles = function inputStyles(base) {
|
|
847
|
-
var styles = _extends({}, base, {
|
|
1431
|
+
var styles = _extends$1({}, base, {
|
|
848
1432
|
margin: "0",
|
|
849
1433
|
padding: "0",
|
|
850
1434
|
color: "inherit",
|
|
@@ -854,37 +1438,37 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
854
1438
|
return styles;
|
|
855
1439
|
};
|
|
856
1440
|
var placeholderStyles = function placeholderStyles(base) {
|
|
857
|
-
var styles = _extends({}, base, {
|
|
1441
|
+
var styles = _extends$1({}, base, {
|
|
858
1442
|
color: COLORS.lightGray
|
|
859
1443
|
});
|
|
860
1444
|
return styles;
|
|
861
1445
|
};
|
|
862
1446
|
var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
|
|
863
|
-
var styles = _extends({}, base, {
|
|
1447
|
+
var styles = _extends$1({}, base, {
|
|
864
1448
|
position: "relative",
|
|
865
1449
|
padding: "2px 0"
|
|
866
1450
|
});
|
|
867
1451
|
return styles;
|
|
868
1452
|
};
|
|
869
1453
|
var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
|
|
870
|
-
var styles = _extends({}, base, {
|
|
1454
|
+
var styles = _extends$1({}, base, {
|
|
871
1455
|
display: isShowDropdown && !isMulti ? "block" : "none"
|
|
872
1456
|
});
|
|
873
1457
|
return styles;
|
|
874
1458
|
};
|
|
875
1459
|
var valueContainerStyles = function valueContainerStyles(base) {
|
|
876
|
-
var styles = _extends({}, base, {
|
|
1460
|
+
var styles = _extends$1({}, base, {
|
|
877
1461
|
height: isMulti ? undefined : "26px",
|
|
878
1462
|
position: "relative"
|
|
879
1463
|
});
|
|
880
1464
|
return styles;
|
|
881
1465
|
};
|
|
882
1466
|
var singleValueStyles = function singleValueStyles(base) {
|
|
883
|
-
var styles = _extends({}, base);
|
|
1467
|
+
var styles = _extends$1({}, base);
|
|
884
1468
|
return styles;
|
|
885
1469
|
};
|
|
886
1470
|
var optionStyles = function optionStyles(base, state) {
|
|
887
|
-
var styles = _extends({}, base, {
|
|
1471
|
+
var styles = _extends$1({}, base, {
|
|
888
1472
|
padding: "8px",
|
|
889
1473
|
borderRadius: "8px",
|
|
890
1474
|
cursor: "pointer",
|
|
@@ -899,7 +1483,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
899
1483
|
return styles;
|
|
900
1484
|
};
|
|
901
1485
|
var multiValueStyles = function multiValueStyles(base) {
|
|
902
|
-
var styles = _extends({}, base, {
|
|
1486
|
+
var styles = _extends$1({}, base, {
|
|
903
1487
|
backgroundColor: COLORS.lightBlue,
|
|
904
1488
|
borderRadius: "4px",
|
|
905
1489
|
padding: "0 4px",
|
|
@@ -911,14 +1495,14 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
911
1495
|
return styles;
|
|
912
1496
|
};
|
|
913
1497
|
var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
|
|
914
|
-
var styles = _extends({}, base, {
|
|
1498
|
+
var styles = _extends$1({}, base, {
|
|
915
1499
|
color: COLORS.lightGray,
|
|
916
1500
|
cursor: "pointer"
|
|
917
1501
|
});
|
|
918
1502
|
return styles;
|
|
919
1503
|
};
|
|
920
1504
|
var multiValueLabelStyles = function multiValueLabelStyles(base) {
|
|
921
|
-
var styles = _extends({}, base, {
|
|
1505
|
+
var styles = _extends$1({}, base, {
|
|
922
1506
|
color: COLORS.blackText,
|
|
923
1507
|
fontWeight: "400",
|
|
924
1508
|
fontSize: "13px",
|
|
@@ -1167,6 +1751,7 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1167
1751
|
if (/[a-zA-Z]_[a-zA-Z0-9]/.test(content)) return true;
|
|
1168
1752
|
if (/[a-zA-Z]\^[a-zA-Z0-9]/.test(content)) return true;
|
|
1169
1753
|
if (/\$[^$]+\$/.test(content)) return true;
|
|
1754
|
+
if (/\bequation\s+[A-Z]/.test(content)) return true;
|
|
1170
1755
|
return false;
|
|
1171
1756
|
};
|
|
1172
1757
|
LatexExtractor.isAlreadyWrapped = function isAlreadyWrapped(content) {
|
|
@@ -1174,6 +1759,16 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1174
1759
|
if (/^\$\$[^$]+\$\$$/.test(content.trim())) return true;
|
|
1175
1760
|
return false;
|
|
1176
1761
|
};
|
|
1762
|
+
LatexExtractor.containsExistingKatex = function containsExistingKatex(content) {
|
|
1763
|
+
var dollarMatches = content.match(/\$[^$]+\$/g);
|
|
1764
|
+
if (dollarMatches && dollarMatches.length > 0) {
|
|
1765
|
+
return true;
|
|
1766
|
+
}
|
|
1767
|
+
if (/\$\$[^$]+\$\$/.test(content)) {
|
|
1768
|
+
return true;
|
|
1769
|
+
}
|
|
1770
|
+
return false;
|
|
1771
|
+
};
|
|
1177
1772
|
LatexExtractor.extractExistingMathContent = function extractExistingMathContent(content) {
|
|
1178
1773
|
var mathBlocks = [];
|
|
1179
1774
|
var displayMathPattern = /\$\$([^$]+)\$\$/g;
|
|
@@ -1355,6 +1950,18 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1355
1950
|
});
|
|
1356
1951
|
}
|
|
1357
1952
|
}
|
|
1953
|
+
var afterEquationPattern = /\bequation\s+([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g;
|
|
1954
|
+
while ((match = afterEquationPattern.exec(content)) !== null) {
|
|
1955
|
+
var _expression4 = match[1].trim();
|
|
1956
|
+
if (this.isLatexFormula(_expression4) && _expression4.length > 1) {
|
|
1957
|
+
var _startPos4 = match.index + match[0].indexOf(_expression4);
|
|
1958
|
+
expressions.push({
|
|
1959
|
+
text: _expression4,
|
|
1960
|
+
start: _startPos4,
|
|
1961
|
+
end: _startPos4 + _expression4.length
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1358
1965
|
};
|
|
1359
1966
|
LatexExtractor.applyLatexFormat = function applyLatexFormat(content) {
|
|
1360
1967
|
if (!content || content.trim().length === 0) {
|
|
@@ -1367,7 +1974,7 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1367
1974
|
if (existingMathBlocks.length === 1 && existingMathBlocks[0].start === 0 && existingMathBlocks[0].end === content.length) {
|
|
1368
1975
|
return content;
|
|
1369
1976
|
}
|
|
1370
|
-
if (this.isAlreadyWrapped(content)) {
|
|
1977
|
+
if (this.isAlreadyWrapped(content) || this.containsExistingKatex(content)) {
|
|
1371
1978
|
return content;
|
|
1372
1979
|
}
|
|
1373
1980
|
var trimmedContent = content.trim();
|
|
@@ -1416,7 +2023,7 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1416
2023
|
if (!this.hasAnyMathematicalContent(content)) {
|
|
1417
2024
|
return content;
|
|
1418
2025
|
}
|
|
1419
|
-
if (this.isAlreadyWrapped(content)) {
|
|
2026
|
+
if (this.isAlreadyWrapped(content) || this.containsExistingKatex(content)) {
|
|
1420
2027
|
return content;
|
|
1421
2028
|
}
|
|
1422
2029
|
var trimmedContent = content.trim();
|
|
@@ -1442,6 +2049,13 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1442
2049
|
}
|
|
1443
2050
|
}
|
|
1444
2051
|
}
|
|
2052
|
+
var equationMatch = content.match(/\bequation\s+([A-Z][a-zA-Z0-9_{}\\=\s]*)/);
|
|
2053
|
+
if (equationMatch) {
|
|
2054
|
+
var equation = equationMatch[1].trim().replace(/\.$/, '');
|
|
2055
|
+
if (this.isLatexFormula(equation) && !this.isAlreadyWrapped(equation)) {
|
|
2056
|
+
return content.replace(equationMatch[0], "equation $$" + equation + "$$");
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
1445
2059
|
var processedContent = this.processCommaSeparatedFormulas(content);
|
|
1446
2060
|
if (processedContent !== content) {
|
|
1447
2061
|
return processedContent;
|
|
@@ -1490,7 +2104,7 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
1490
2104
|
return LatexExtractor;
|
|
1491
2105
|
}();
|
|
1492
2106
|
LatexExtractor.LATEX_COMMANDS = ['\\frac', '\\sqrt', '\\sum', '\\prod', '\\int', '\\oint', '\\lim', '\\sin', '\\cos', '\\tan', '\\log', '\\ln', '\\exp', '\\alpha', '\\beta', '\\gamma', '\\delta', '\\epsilon', '\\varepsilon', '\\zeta', '\\eta', '\\theta', '\\vartheta', '\\iota', '\\kappa', '\\lambda', '\\mu', '\\nu', '\\xi', '\\pi', '\\varpi', '\\rho', '\\varrho', '\\sigma', '\\varsigma', '\\tau', "\\upsilon", '\\phi', '\\varphi', '\\chi', '\\psi', '\\omega', '\\Gamma', '\\Delta', '\\Theta', '\\Lambda', '\\Xi', '\\Pi', '\\Sigma', "\\Upsilon", '\\Phi', '\\Psi', '\\Omega', '\\to', '\\gets', '\\mapsto', '\\implies', '\\iff', '\\leftrightarrow', '\\longleftarrow', '\\longrightarrow', '\\longleftrightarrow', '\\Leftarrow', '\\Rightarrow', '\\Leftrightarrow', '\\le', '\\ge', '\\leq', '\\geq', '\\lt', '\\gt', '\\neq', '\\approx', '\\equiv', '\\sim', '\\cong', '\\leqslant', '\\geqslant', '\\parallel', '\\perp', '\\in', '\\notin', '\\subset', '\\subseteq', '\\cup', '\\cap', '\\emptyset', '\\forall', '\\exists', '\\nexists', '\\wedge', '\\vee', '\\neg', '\\partial', '\\nabla', '\\infty', '\\pm', '\\mp', '\\vec', '\\overrightarrow', "\\underrightarrow", '\\overline', "\\underline", '\\widehat', '\\widetilde', '\\overbrace', "\\underbrace", '\\mathbb', '\\mathrm', '\\mathcal', '\\mathfrak', '\\mathscr', '\\text', '\\textbf', '\\textit', '\\left', '\\right', '\\lfloor', '\\rfloor', '\\lceil', '\\rceil', '\\langle', '\\rangle', '\\cdot', '\\times', '\\div', '\\parallel', '\\angle', '\\bot', '\\newline', '\\ldots', '\\cdots', '\\vdots', '\\ddots'];
|
|
1493
|
-
LatexExtractor.LATEX_PATTERNS = [/[a-zA-Z0-9]_\{[^}]*\}/g, /[a-zA-Z0-9]\^\{[^}]*\}/g, /\\[a-zA-Z]+\s*\{[^}]*\}(?:\s*\{[^}]*\})*/g, /\\[a-zA-Z]+(?![a-zA-Z])/g, /\\frac\s*\{[^}]*\}\s*\{[^}]*\}/g, /\\sqrt(?:\[[^\]]*\])?\s*\{[^}]*\}/g, /\\vec\s*\{[^}]*\}/g, /\\(?:alpha|beta|gamma|delta|epsilon|varepsilon|zeta|eta|theta|vartheta|iota|kappa|lambda|mu|nu|xi|pi|varpi|rho|varrho|sigma|varsigma|tau|upsilon|phi|varphi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?![a-zA-Z])/g, /[a-zA-Z0-9_{}\\]+\s*=\s*[a-zA-Z0-9_{}\\+\-*/^().\s]+/g, /\\Delta\s*[a-zA-Z]/g, /[a-zA-Z]+_\{[a-zA-Z0-9]+\}/g, /[a-zA-Z0-9_{}\\]+\s*[+\-*/]\s*[a-zA-Z0-9_{}\\().\s]+/g, /,\s*([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g, /([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^]\s*[a-zA-Z0-9_{}\\().\s]*)*)\s*,/g, /\bto\s+([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g, /([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)\s+to\b/g];
|
|
2107
|
+
LatexExtractor.LATEX_PATTERNS = [/[a-zA-Z0-9]_\{[^}]*\}/g, /[a-zA-Z0-9]\^\{[^}]*\}/g, /\\[a-zA-Z]+\s*\{[^}]*\}(?:\s*\{[^}]*\})*/g, /\\[a-zA-Z]+(?![a-zA-Z])/g, /\\frac\s*\{[^}]*\}\s*\{[^}]*\}/g, /\\sqrt(?:\[[^\]]*\])?\s*\{[^}]*\}/g, /\\vec\s*\{[^}]*\}/g, /\\(?:alpha|beta|gamma|delta|epsilon|varepsilon|zeta|eta|theta|vartheta|iota|kappa|lambda|mu|nu|xi|pi|varpi|rho|varrho|sigma|varsigma|tau|upsilon|phi|varphi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?![a-zA-Z])/g, /[a-zA-Z0-9_{}\\]+\s*=\s*[a-zA-Z0-9_{}\\+\-*/^().\s]+/g, /\\Delta\s*[a-zA-Z]/g, /[a-zA-Z]+_\{[a-zA-Z0-9]+\}/g, /[a-zA-Z0-9_{}\\]+\s*[+\-*/]\s*[a-zA-Z0-9_{}\\().\s]+/g, /,\s*([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g, /([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^]\s*[a-zA-Z0-9_{}\\().\s]*)*)\s*,/g, /\bto\s+([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g, /([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)\s+to\b/g, /\bequation\s+([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g];
|
|
1494
2108
|
|
|
1495
2109
|
var _excluded$3 = ["node"];
|
|
1496
2110
|
var MarkdownRenderer = function MarkdownRenderer(_ref) {
|
|
@@ -1544,7 +2158,7 @@ function formatContent(content) {
|
|
|
1544
2158
|
}
|
|
1545
2159
|
continue;
|
|
1546
2160
|
}
|
|
1547
|
-
if (LatexExtractor.isAlreadyWrapped(line)) {
|
|
2161
|
+
if (LatexExtractor.isAlreadyWrapped(line) || LatexExtractor.containsExistingKatex(line)) {
|
|
1548
2162
|
result.push(line);
|
|
1549
2163
|
} else {
|
|
1550
2164
|
var _formatText = LatexExtractor.applyLatexFormatSimple(line);
|
|
@@ -2438,7 +3052,7 @@ function kindOf(val) {
|
|
|
2438
3052
|
}
|
|
2439
3053
|
|
|
2440
3054
|
// src/utils/warning.ts
|
|
2441
|
-
function warning(message) {
|
|
3055
|
+
function warning$1(message) {
|
|
2442
3056
|
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
2443
3057
|
console.error(message);
|
|
2444
3058
|
}
|
|
@@ -2491,7 +3105,7 @@ function combineReducers(reducers) {
|
|
|
2491
3105
|
const key = reducerKeys[i];
|
|
2492
3106
|
if (process.env.NODE_ENV !== "production") {
|
|
2493
3107
|
if (typeof reducers[key] === "undefined") {
|
|
2494
|
-
warning(`No reducer provided for key "${key}"`);
|
|
3108
|
+
warning$1(`No reducer provided for key "${key}"`);
|
|
2495
3109
|
}
|
|
2496
3110
|
}
|
|
2497
3111
|
if (typeof reducers[key] === "function") {
|
|
@@ -2516,7 +3130,7 @@ function combineReducers(reducers) {
|
|
|
2516
3130
|
if (process.env.NODE_ENV !== "production") {
|
|
2517
3131
|
const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
2518
3132
|
if (warningMessage) {
|
|
2519
|
-
warning(warningMessage);
|
|
3133
|
+
warning$1(warningMessage);
|
|
2520
3134
|
}
|
|
2521
3135
|
}
|
|
2522
3136
|
let hasChanged = false;
|
|
@@ -2895,7 +3509,7 @@ var useAmplitude = function useAmplitude() {
|
|
|
2895
3509
|
var savedUserProperties = React.useRef({});
|
|
2896
3510
|
var hasTrackedInitialSession = React.useRef(false);
|
|
2897
3511
|
var setUserProperties = React.useCallback(function (properties) {
|
|
2898
|
-
savedUserProperties.current = _extends({}, savedUserProperties.current, properties);
|
|
3512
|
+
savedUserProperties.current = _extends$1({}, savedUserProperties.current, properties);
|
|
2899
3513
|
var identify = new amplitude.Identify();
|
|
2900
3514
|
Object.entries(properties).forEach(function (_ref) {
|
|
2901
3515
|
var key = _ref[0],
|
|
@@ -2907,7 +3521,7 @@ var useAmplitude = function useAmplitude() {
|
|
|
2907
3521
|
var trackEvent = React.useCallback(function (_ref2) {
|
|
2908
3522
|
var eventName = _ref2.eventName,
|
|
2909
3523
|
eventProperties = _ref2.eventProperties;
|
|
2910
|
-
amplitude.track(eventName, _extends({}, savedUserProperties.current, eventProperties, {
|
|
3524
|
+
amplitude.track(eventName, _extends$1({}, savedUserProperties.current, eventProperties, {
|
|
2911
3525
|
timestamp: new Date().toISOString()
|
|
2912
3526
|
}));
|
|
2913
3527
|
}, []);
|
|
@@ -3094,7 +3708,7 @@ var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
|
|
|
3094
3708
|
|
|
3095
3709
|
var customStyles = {
|
|
3096
3710
|
control: function control(baseStyles, state) {
|
|
3097
|
-
return _extends({}, baseStyles, {
|
|
3711
|
+
return _extends$1({}, baseStyles, {
|
|
3098
3712
|
fontSize: "14px",
|
|
3099
3713
|
fontWeight: 700,
|
|
3100
3714
|
color: styleGlobal.darker,
|
|
@@ -3109,21 +3723,21 @@ var customStyles = {
|
|
|
3109
3723
|
});
|
|
3110
3724
|
},
|
|
3111
3725
|
input: function input(baseStyles, _) {
|
|
3112
|
-
return _extends({}, baseStyles, {
|
|
3726
|
+
return _extends$1({}, baseStyles, {
|
|
3113
3727
|
fontSize: "14px",
|
|
3114
3728
|
fontWeight: 700,
|
|
3115
3729
|
color: styleGlobal.darker
|
|
3116
3730
|
});
|
|
3117
3731
|
},
|
|
3118
3732
|
singleValue: function singleValue(baseStyles) {
|
|
3119
|
-
return _extends({}, baseStyles, {
|
|
3733
|
+
return _extends$1({}, baseStyles, {
|
|
3120
3734
|
fontSize: "14px",
|
|
3121
3735
|
fontWeight: 700,
|
|
3122
3736
|
color: styleGlobal.darker
|
|
3123
3737
|
});
|
|
3124
3738
|
},
|
|
3125
3739
|
option: function option(baseStyles, state) {
|
|
3126
|
-
return _extends({}, baseStyles, {
|
|
3740
|
+
return _extends$1({}, baseStyles, {
|
|
3127
3741
|
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.light : 'white',
|
|
3128
3742
|
"&:active": {
|
|
3129
3743
|
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.less_dark : baseStyles.backgroundColor
|
|
@@ -3291,76 +3905,26 @@ var utcToLocalTime = (function (time, FORMAT) {
|
|
|
3291
3905
|
}
|
|
3292
3906
|
});
|
|
3293
3907
|
|
|
3294
|
-
var
|
|
3295
|
-
if (!url || typeof url !== 'string') {
|
|
3296
|
-
return null;
|
|
3297
|
-
}
|
|
3298
|
-
url = url.trim().replace(/[\s\n\r\t]+/g, '');
|
|
3299
|
-
if (url.length > 2048) {
|
|
3300
|
-
return null;
|
|
3301
|
-
}
|
|
3302
|
-
var dangerousProtocols = ['javascript:', 'data:text/html', 'vbscript:', 'file:', 'about:', 'blob:'];
|
|
3303
|
-
var lowerUrl = url.toLowerCase();
|
|
3304
|
-
for (var _i = 0, _dangerousProtocols = dangerousProtocols; _i < _dangerousProtocols.length; _i++) {
|
|
3305
|
-
var protocol = _dangerousProtocols[_i];
|
|
3306
|
-
if (lowerUrl.startsWith(protocol)) {
|
|
3307
|
-
return null;
|
|
3308
|
-
}
|
|
3309
|
-
}
|
|
3310
|
-
var decoded = decodeURIComponent(url);
|
|
3311
|
-
var decodedLower = decoded.toLowerCase();
|
|
3312
|
-
for (var _i2 = 0, _dangerousProtocols2 = dangerousProtocols; _i2 < _dangerousProtocols2.length; _i2++) {
|
|
3313
|
-
var _protocol = _dangerousProtocols2[_i2];
|
|
3314
|
-
if (decodedLower.includes(_protocol)) {
|
|
3315
|
-
return null;
|
|
3316
|
-
}
|
|
3317
|
-
}
|
|
3318
|
-
try {
|
|
3319
|
-
if (url.startsWith('data:')) {
|
|
3320
|
-
if (/^data:image\/(png|jpeg|jpg|gif|webp|bmp|ico);base64,[A-Za-z0-9+/]+=*$/.test(url)) {
|
|
3321
|
-
return url;
|
|
3322
|
-
}
|
|
3323
|
-
return null;
|
|
3324
|
-
}
|
|
3325
|
-
var parsed = new URL(url, window.location.origin);
|
|
3326
|
-
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
3327
|
-
return null;
|
|
3328
|
-
}
|
|
3329
|
-
if (parsed.username || parsed.password) {
|
|
3330
|
-
return null;
|
|
3331
|
-
}
|
|
3332
|
-
return parsed.href;
|
|
3333
|
-
} catch (error) {
|
|
3334
|
-
return null;
|
|
3335
|
-
}
|
|
3336
|
-
};
|
|
3908
|
+
var historyCore = createBrowserHistory();
|
|
3337
3909
|
|
|
3338
|
-
var sanitizeHTMLText = function sanitizeHTMLText(text) {
|
|
3339
|
-
var _DOMPurify$sanitize;
|
|
3340
|
-
if (!text) return "";
|
|
3341
|
-
return (_DOMPurify$sanitize = DOMPurify.sanitize(text)) != null ? _DOMPurify$sanitize : "";
|
|
3342
|
-
};
|
|
3343
|
-
|
|
3344
|
-
var historyCore = history.createBrowserHistory();
|
|
3345
|
-
|
|
3346
|
-
exports.Cookies = Cookies;
|
|
3347
3910
|
Object.defineProperty(exports, 'GoogleOAuthProvider', {
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3911
|
+
enumerable: true,
|
|
3912
|
+
get: function () {
|
|
3913
|
+
return google.GoogleOAuthProvider;
|
|
3914
|
+
}
|
|
3352
3915
|
});
|
|
3916
|
+
exports.Cookies = Cookies;
|
|
3353
3917
|
Object.defineProperty(exports, 'ToastContainer', {
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3918
|
+
enumerable: true,
|
|
3919
|
+
get: function () {
|
|
3920
|
+
return reactToastify.ToastContainer;
|
|
3921
|
+
}
|
|
3358
3922
|
});
|
|
3359
3923
|
Object.defineProperty(exports, 'toast', {
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3924
|
+
enumerable: true,
|
|
3925
|
+
get: function () {
|
|
3926
|
+
return reactToastify.toast;
|
|
3927
|
+
}
|
|
3364
3928
|
});
|
|
3365
3929
|
exports.ACCESS_TOKEN = ACCESS_TOKEN;
|
|
3366
3930
|
exports.BASE_URL = BASE_URL;
|
|
@@ -3403,8 +3967,6 @@ exports.getImageUrl = getImageUrl;
|
|
|
3403
3967
|
exports.historyCore = historyCore;
|
|
3404
3968
|
exports.initSentry = initSentry;
|
|
3405
3969
|
exports.initializeAmplitude = initializeAmplitude;
|
|
3406
|
-
exports.sanitizeHTMLText = sanitizeHTMLText;
|
|
3407
|
-
exports.sanitizeSrc = sanitizeSrc;
|
|
3408
3970
|
exports.setAddTenant = setAddTenant;
|
|
3409
3971
|
exports.setAlert = setAlert;
|
|
3410
3972
|
exports.setIsRefetchSidebar = setIsRefetchSidebar;
|