@wangeditor-next/yjs-for-react 0.1.1-beta.0 → 0.1.1
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.esm.js +6 -794
- package/dist/index.js +10 -812
- package/package.json +1 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,97 +1,4 @@
|
|
|
1
|
-
import e,
|
|
2
|
-
import { CursorEditor, relativeRangeToSlateRange } from '@wangeditor-next/yjs';
|
|
3
|
-
import { Range, Editor, Text, Path } from 'slate';
|
|
4
|
-
import { DomEditor } from '@wangeditor-next/editor';
|
|
5
|
-
|
|
6
|
-
var EditorContext = createContext(null);
|
|
7
|
-
var useEditorStatic = function () {
|
|
8
|
-
var editor = useContext(EditorContext);
|
|
9
|
-
if (!editor) {
|
|
10
|
-
// throw new Error(
|
|
11
|
-
// `The \`useEditorStatic\` hook must be used inside the <EditorContext> component's context.`
|
|
12
|
-
// )
|
|
13
|
-
console.warn("The `useEditorStatic` hook must be used inside the <EditorContext> component's context.");
|
|
14
|
-
}
|
|
15
|
-
return editor;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/******************************************************************************
|
|
19
|
-
Copyright (c) Microsoft Corporation.
|
|
20
|
-
|
|
21
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
-
purpose with or without fee is hereby granted.
|
|
23
|
-
|
|
24
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
-
***************************************************************************** */
|
|
32
|
-
|
|
33
|
-
var __assign = function() {
|
|
34
|
-
__assign = Object.assign || function __assign(t) {
|
|
35
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36
|
-
s = arguments[i];
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
};
|
|
41
|
-
return __assign.apply(this, arguments);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function __rest(s, e) {
|
|
45
|
-
var t = {};
|
|
46
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
47
|
-
t[p] = s[p];
|
|
48
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
49
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
50
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
51
|
-
t[p[i]] = s[p[i]];
|
|
52
|
-
}
|
|
53
|
-
return t;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function __values(o) {
|
|
57
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
58
|
-
if (m) return m.call(o);
|
|
59
|
-
if (o && typeof o.length === "number") return {
|
|
60
|
-
next: function () {
|
|
61
|
-
if (o && i >= o.length) o = void 0;
|
|
62
|
-
return { value: o && o[i++], done: !o };
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function __read(o, n) {
|
|
69
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
70
|
-
if (!m) return o;
|
|
71
|
-
var i = m.call(o), r, ar = [], e;
|
|
72
|
-
try {
|
|
73
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
74
|
-
}
|
|
75
|
-
catch (error) { e = { error: error }; }
|
|
76
|
-
finally {
|
|
77
|
-
try {
|
|
78
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
79
|
-
}
|
|
80
|
-
finally { if (e) throw e.error; }
|
|
81
|
-
}
|
|
82
|
-
return ar;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
86
|
-
var e = new Error(message);
|
|
87
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
function createCommonjsModule(fn) {
|
|
91
|
-
var module = { exports: {} };
|
|
92
|
-
return fn(module, module.exports), module.exports;
|
|
93
|
-
}
|
|
94
|
-
|
|
1
|
+
import t,{createContext as e,useContext as r,useReducer as n,useRef as o,useEffect as i,useCallback as u,useState as a,useLayoutEffect as c,useMemo as f}from"react";import{Node as s,Text as l,Path as v,Editor as p,Range as h}from"slate";import*as d from"yjs";import{DomEditor as y}from"@wangeditor-next/editor";var g=e(null),b=function(){var t=r(g);return t||console.warn("The `useEditorStatic` hook must be used inside the <EditorContext> component's context."),t},m=function(){return m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},m.apply(this,arguments)};function w(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(t){var e={exports:{}};return t(e,e.exports),e.exports
|
|
95
2
|
/**
|
|
96
3
|
* @license React
|
|
97
4
|
* use-sync-external-store-shim.production.min.js
|
|
@@ -100,10 +7,7 @@ function createCommonjsModule(fn) {
|
|
|
100
7
|
*
|
|
101
8
|
* This source code is licensed under the MIT license found in the
|
|
102
9
|
* LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/
|
|
104
|
-
function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
|
|
105
|
-
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;
|
|
106
|
-
|
|
10
|
+
*/}var x="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},E=t.useState,j=t.useEffect,T=t.useLayoutEffect,P=t.useDebugValue;function A(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!x(t,r)}catch(t){return!0}}var R="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=E({inst:{value:r,getSnapshot:e}}),o=n[0].inst,i=n[1];return T((function(){o.value=r,o.getSnapshot=e,A(o)&&i({inst:o})}),[t,r,e]),j((function(){return A(o)&&i({inst:o}),t((function(){A(o)&&i({inst:o})}))}),[t]),P(r),r},k={useSyncExternalStore:void 0!==t.useSyncExternalStore?t.useSyncExternalStore:R};
|
|
107
11
|
/**
|
|
108
12
|
* @license React
|
|
109
13
|
* use-sync-external-store-shim.development.js
|
|
@@ -113,243 +17,7 @@ function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f
|
|
|
113
17
|
* This source code is licensed under the MIT license found in the
|
|
114
18
|
* LICENSE file in the root directory of this source tree.
|
|
115
19
|
*/
|
|
116
|
-
|
|
117
|
-
var useSyncExternalStoreShim_development = createCommonjsModule(function (module, exports) {
|
|
118
|
-
|
|
119
|
-
{
|
|
120
|
-
(function() {
|
|
121
|
-
|
|
122
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
123
|
-
if (
|
|
124
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
125
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
126
|
-
'function'
|
|
127
|
-
) {
|
|
128
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
129
|
-
}
|
|
130
|
-
var React = e;
|
|
131
|
-
|
|
132
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
133
|
-
|
|
134
|
-
function error(format) {
|
|
135
|
-
{
|
|
136
|
-
{
|
|
137
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
138
|
-
args[_key2 - 1] = arguments[_key2];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
printWarning('error', format, args);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function printWarning(level, format, args) {
|
|
147
|
-
// When changing this logic, you might want to also
|
|
148
|
-
// update consoleWithStackDev.www.js as well.
|
|
149
|
-
{
|
|
150
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
151
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
152
|
-
|
|
153
|
-
if (stack !== '') {
|
|
154
|
-
format += '%s';
|
|
155
|
-
args = args.concat([stack]);
|
|
156
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
var argsWithFormat = args.map(function (item) {
|
|
160
|
-
return String(item);
|
|
161
|
-
}); // Careful: RN currently depends on this prefix
|
|
162
|
-
|
|
163
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
164
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
165
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
166
|
-
|
|
167
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
173
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
174
|
-
*/
|
|
175
|
-
function is(x, y) {
|
|
176
|
-
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
177
|
-
;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
181
|
-
|
|
182
|
-
// dispatch for CommonJS interop named imports.
|
|
183
|
-
|
|
184
|
-
var useState = React.useState,
|
|
185
|
-
useEffect = React.useEffect,
|
|
186
|
-
useLayoutEffect = React.useLayoutEffect,
|
|
187
|
-
useDebugValue = React.useDebugValue;
|
|
188
|
-
var didWarnOld18Alpha = false;
|
|
189
|
-
var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
|
|
190
|
-
// because of a very particular set of implementation details and assumptions
|
|
191
|
-
// -- change any one of them and it will break. The most important assumption
|
|
192
|
-
// is that updates are always synchronous, because concurrent rendering is
|
|
193
|
-
// only available in versions of React that also have a built-in
|
|
194
|
-
// useSyncExternalStore API. And we only use this shim when the built-in API
|
|
195
|
-
// does not exist.
|
|
196
|
-
//
|
|
197
|
-
// Do not assume that the clever hacks used by this hook also work in general.
|
|
198
|
-
// The point of this shim is to replace the need for hacks by other libraries.
|
|
199
|
-
|
|
200
|
-
function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
201
|
-
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
202
|
-
// will need to track that themselves and return the correct value
|
|
203
|
-
// from `getSnapshot`.
|
|
204
|
-
getServerSnapshot) {
|
|
205
|
-
{
|
|
206
|
-
if (!didWarnOld18Alpha) {
|
|
207
|
-
if (React.startTransition !== undefined) {
|
|
208
|
-
didWarnOld18Alpha = true;
|
|
209
|
-
|
|
210
|
-
error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
} // Read the current snapshot from the store on every render. Again, this
|
|
214
|
-
// breaks the rules of React, and only works here because of specific
|
|
215
|
-
// implementation details, most importantly that updates are
|
|
216
|
-
// always synchronous.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
var value = getSnapshot();
|
|
220
|
-
|
|
221
|
-
{
|
|
222
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
223
|
-
var cachedValue = getSnapshot();
|
|
224
|
-
|
|
225
|
-
if (!objectIs(value, cachedValue)) {
|
|
226
|
-
error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
227
|
-
|
|
228
|
-
didWarnUncachedGetSnapshot = true;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
} // Because updates are synchronous, we don't queue them. Instead we force a
|
|
232
|
-
// re-render whenever the subscribed state changes by updating an some
|
|
233
|
-
// arbitrary useState hook. Then, during render, we call getSnapshot to read
|
|
234
|
-
// the current value.
|
|
235
|
-
//
|
|
236
|
-
// Because we don't actually use the state returned by the useState hook, we
|
|
237
|
-
// can save a bit of memory by storing other stuff in that slot.
|
|
238
|
-
//
|
|
239
|
-
// To implement the early bailout, we need to track some things on a mutable
|
|
240
|
-
// object. Usually, we would put that in a useRef hook, but we can stash it in
|
|
241
|
-
// our useState hook instead.
|
|
242
|
-
//
|
|
243
|
-
// To force a re-render, we call forceUpdate({inst}). That works because the
|
|
244
|
-
// new object always fails an equality check.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
var _useState = useState({
|
|
248
|
-
inst: {
|
|
249
|
-
value: value,
|
|
250
|
-
getSnapshot: getSnapshot
|
|
251
|
-
}
|
|
252
|
-
}),
|
|
253
|
-
inst = _useState[0].inst,
|
|
254
|
-
forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
|
|
255
|
-
// in the layout phase so we can access it during the tearing check that
|
|
256
|
-
// happens on subscribe.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
useLayoutEffect(function () {
|
|
260
|
-
inst.value = value;
|
|
261
|
-
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
262
|
-
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
263
|
-
// this can happen all the time, but even in synchronous mode, an earlier
|
|
264
|
-
// effect may have mutated the store.
|
|
265
|
-
|
|
266
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
267
|
-
// Force a re-render.
|
|
268
|
-
forceUpdate({
|
|
269
|
-
inst: inst
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}, [subscribe, value, getSnapshot]);
|
|
273
|
-
useEffect(function () {
|
|
274
|
-
// Check for changes right before subscribing. Subsequent changes will be
|
|
275
|
-
// detected in the subscription handler.
|
|
276
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
277
|
-
// Force a re-render.
|
|
278
|
-
forceUpdate({
|
|
279
|
-
inst: inst
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
var handleStoreChange = function () {
|
|
284
|
-
// TODO: Because there is no cross-renderer API for batching updates, it's
|
|
285
|
-
// up to the consumer of this library to wrap their subscription event
|
|
286
|
-
// with unstable_batchedUpdates. Should we try to detect when this isn't
|
|
287
|
-
// the case and print a warning in development?
|
|
288
|
-
// The store changed. Check if the snapshot changed since the last time we
|
|
289
|
-
// read from the store.
|
|
290
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
291
|
-
// Force a re-render.
|
|
292
|
-
forceUpdate({
|
|
293
|
-
inst: inst
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
}; // Subscribe to the store and return a clean-up function.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return subscribe(handleStoreChange);
|
|
300
|
-
}, [subscribe]);
|
|
301
|
-
useDebugValue(value);
|
|
302
|
-
return value;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function checkIfSnapshotChanged(inst) {
|
|
306
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
307
|
-
var prevValue = inst.value;
|
|
308
|
-
|
|
309
|
-
try {
|
|
310
|
-
var nextValue = latestGetSnapshot();
|
|
311
|
-
return !objectIs(prevValue, nextValue);
|
|
312
|
-
} catch (error) {
|
|
313
|
-
return true;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
318
|
-
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
319
|
-
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
320
|
-
// will need to track that themselves and return the correct value
|
|
321
|
-
// from `getSnapshot`.
|
|
322
|
-
return getSnapshot();
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
|
326
|
-
|
|
327
|
-
var isServerEnvironment = !canUseDOM;
|
|
328
|
-
|
|
329
|
-
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
330
|
-
var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
|
|
331
|
-
|
|
332
|
-
exports.useSyncExternalStore = useSyncExternalStore$2;
|
|
333
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
334
|
-
if (
|
|
335
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
336
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
337
|
-
'function'
|
|
338
|
-
) {
|
|
339
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
})();
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
var shim = createCommonjsModule(function (module) {
|
|
347
|
-
|
|
348
|
-
{
|
|
349
|
-
module.exports = useSyncExternalStoreShim_development;
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
|
|
20
|
+
S((function(t,e){}));var L=S((function(t){t.exports=k}));
|
|
353
21
|
/**
|
|
354
22
|
* @license React
|
|
355
23
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
@@ -358,9 +26,7 @@ var shim = createCommonjsModule(function (module) {
|
|
|
358
26
|
*
|
|
359
27
|
* This source code is licensed under the MIT license found in the
|
|
360
28
|
* LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/
|
|
362
|
-
shim.useSyncExternalStore;e.useRef;e.useEffect;e.useMemo;e.useDebugValue;
|
|
363
|
-
|
|
29
|
+
*/var I="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},C=L.useSyncExternalStore,z=t.useRef,F=t.useEffect,M=t.useMemo,_=t.useDebugValue,D={useSyncExternalStoreWithSelector:function(t,e,r,n,o){var i=z(null);if(null===i.current){var u={hasValue:!1,value:null};i.current=u}else u=i.current;i=M((function(){function t(t){if(!c){if(c=!0,i=t,t=n(t),void 0!==o&&u.hasValue){var e=u.value;if(o(e,t))return a=e}return a=t}if(e=a,I(i,t))return e;var r=n(t);return void 0!==o&&o(e,r)?e:(i=t,a=r)}var i,a,c=!1,f=void 0===r?null:r;return[function(){return t(e())},null===f?void 0:function(){return t(f())}]}),[e,r,n,o]);var a=C(t,i[0],i[1]);return F((function(){u.hasValue=!0,u.value=a}),[a]),_(a),a}};
|
|
364
30
|
/**
|
|
365
31
|
* @license React
|
|
366
32
|
* use-sync-external-store-shim/with-selector.development.js
|
|
@@ -370,459 +36,5 @@ shim.useSyncExternalStore;e.useRef;e.useEffect;e.useMemo;e.useDebugValue;
|
|
|
370
36
|
* This source code is licensed under the MIT license found in the
|
|
371
37
|
* LICENSE file in the root directory of this source tree.
|
|
372
38
|
*/
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
{
|
|
377
|
-
(function() {
|
|
378
|
-
|
|
379
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
380
|
-
if (
|
|
381
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
382
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
383
|
-
'function'
|
|
384
|
-
) {
|
|
385
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
386
|
-
}
|
|
387
|
-
var React = e;
|
|
388
|
-
var shim$1 = shim;
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
392
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
393
|
-
*/
|
|
394
|
-
function is(x, y) {
|
|
395
|
-
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
396
|
-
;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
400
|
-
|
|
401
|
-
var useSyncExternalStore = shim$1.useSyncExternalStore;
|
|
402
|
-
|
|
403
|
-
// for CommonJS interop.
|
|
404
|
-
|
|
405
|
-
var useRef = React.useRef,
|
|
406
|
-
useEffect = React.useEffect,
|
|
407
|
-
useMemo = React.useMemo,
|
|
408
|
-
useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.
|
|
409
|
-
|
|
410
|
-
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
411
|
-
// Use this to track the rendered snapshot.
|
|
412
|
-
var instRef = useRef(null);
|
|
413
|
-
var inst;
|
|
414
|
-
|
|
415
|
-
if (instRef.current === null) {
|
|
416
|
-
inst = {
|
|
417
|
-
hasValue: false,
|
|
418
|
-
value: null
|
|
419
|
-
};
|
|
420
|
-
instRef.current = inst;
|
|
421
|
-
} else {
|
|
422
|
-
inst = instRef.current;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
var _useMemo = useMemo(function () {
|
|
426
|
-
// Track the memoized state using closure variables that are local to this
|
|
427
|
-
// memoized instance of a getSnapshot function. Intentionally not using a
|
|
428
|
-
// useRef hook, because that state would be shared across all concurrent
|
|
429
|
-
// copies of the hook/component.
|
|
430
|
-
var hasMemo = false;
|
|
431
|
-
var memoizedSnapshot;
|
|
432
|
-
var memoizedSelection;
|
|
433
|
-
|
|
434
|
-
var memoizedSelector = function (nextSnapshot) {
|
|
435
|
-
if (!hasMemo) {
|
|
436
|
-
// The first time the hook is called, there is no memoized result.
|
|
437
|
-
hasMemo = true;
|
|
438
|
-
memoizedSnapshot = nextSnapshot;
|
|
439
|
-
|
|
440
|
-
var _nextSelection = selector(nextSnapshot);
|
|
441
|
-
|
|
442
|
-
if (isEqual !== undefined) {
|
|
443
|
-
// Even if the selector has changed, the currently rendered selection
|
|
444
|
-
// may be equal to the new selection. We should attempt to reuse the
|
|
445
|
-
// current value if possible, to preserve downstream memoizations.
|
|
446
|
-
if (inst.hasValue) {
|
|
447
|
-
var currentSelection = inst.value;
|
|
448
|
-
|
|
449
|
-
if (isEqual(currentSelection, _nextSelection)) {
|
|
450
|
-
memoizedSelection = currentSelection;
|
|
451
|
-
return currentSelection;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
memoizedSelection = _nextSelection;
|
|
457
|
-
return _nextSelection;
|
|
458
|
-
} // We may be able to reuse the previous invocation's result.
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
// We may be able to reuse the previous invocation's result.
|
|
462
|
-
var prevSnapshot = memoizedSnapshot;
|
|
463
|
-
var prevSelection = memoizedSelection;
|
|
464
|
-
|
|
465
|
-
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
466
|
-
// The snapshot is the same as last time. Reuse the previous selection.
|
|
467
|
-
return prevSelection;
|
|
468
|
-
} // The snapshot has changed, so we need to compute a new selection.
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
// The snapshot has changed, so we need to compute a new selection.
|
|
472
|
-
var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data
|
|
473
|
-
// has changed. If it hasn't, return the previous selection. That signals
|
|
474
|
-
// to React that the selections are conceptually equal, and we can bail
|
|
475
|
-
// out of rendering.
|
|
476
|
-
|
|
477
|
-
// If a custom isEqual function is provided, use that to check if the data
|
|
478
|
-
// has changed. If it hasn't, return the previous selection. That signals
|
|
479
|
-
// to React that the selections are conceptually equal, and we can bail
|
|
480
|
-
// out of rendering.
|
|
481
|
-
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
|
|
482
|
-
return prevSelection;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
memoizedSnapshot = nextSnapshot;
|
|
486
|
-
memoizedSelection = nextSelection;
|
|
487
|
-
return nextSelection;
|
|
488
|
-
}; // Assigning this to a constant so that Flow knows it can't change.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
// Assigning this to a constant so that Flow knows it can't change.
|
|
492
|
-
var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;
|
|
493
|
-
|
|
494
|
-
var getSnapshotWithSelector = function () {
|
|
495
|
-
return memoizedSelector(getSnapshot());
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {
|
|
499
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
500
|
-
};
|
|
501
|
-
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
502
|
-
}, [getSnapshot, getServerSnapshot, selector, isEqual]),
|
|
503
|
-
getSelection = _useMemo[0],
|
|
504
|
-
getServerSelection = _useMemo[1];
|
|
505
|
-
|
|
506
|
-
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
507
|
-
useEffect(function () {
|
|
508
|
-
inst.hasValue = true;
|
|
509
|
-
inst.value = value;
|
|
510
|
-
}, [value]);
|
|
511
|
-
useDebugValue(value);
|
|
512
|
-
return value;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
|
|
516
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
517
|
-
if (
|
|
518
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
519
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
520
|
-
'function'
|
|
521
|
-
) {
|
|
522
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
})();
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
|
|
529
|
-
var withSelector = createCommonjsModule(function (module) {
|
|
530
|
-
|
|
531
|
-
{
|
|
532
|
-
module.exports = withSelector_development;
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
|
|
536
|
-
function useRemoteCursorEditor() {
|
|
537
|
-
var editor = useEditorStatic();
|
|
538
|
-
if (!CursorEditor.isCursorEditor(editor)) {
|
|
539
|
-
console.warn('Cannot use useSyncExternalStore outside the context of a RemoteCursorEditor');
|
|
540
|
-
}
|
|
541
|
-
return editor;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
var EDITOR_TO_CURSOR_STORE = new WeakMap();
|
|
545
|
-
function createRemoteCursorStateStore(editor) {
|
|
546
|
-
var cursors = {};
|
|
547
|
-
var changed = new Set();
|
|
548
|
-
var addChanged = changed.add.bind(changed);
|
|
549
|
-
var onStoreChangeListeners = new Set();
|
|
550
|
-
var changeHandler = null;
|
|
551
|
-
var subscribe = function (onStoreChange) {
|
|
552
|
-
onStoreChangeListeners.add(onStoreChange);
|
|
553
|
-
if (!changeHandler) {
|
|
554
|
-
changeHandler = function (event) {
|
|
555
|
-
event.added.forEach(addChanged);
|
|
556
|
-
event.removed.forEach(addChanged);
|
|
557
|
-
event.updated.forEach(addChanged);
|
|
558
|
-
onStoreChangeListeners.forEach(function (listener) { return listener(); });
|
|
559
|
-
};
|
|
560
|
-
CursorEditor.on(editor, 'change', changeHandler);
|
|
561
|
-
}
|
|
562
|
-
return function () {
|
|
563
|
-
onStoreChangeListeners.delete(onStoreChange);
|
|
564
|
-
if (changeHandler && onStoreChangeListeners.size === 0) {
|
|
565
|
-
CursorEditor.off(editor, 'change', changeHandler);
|
|
566
|
-
changeHandler = null;
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
};
|
|
570
|
-
var getSnapshot = function () {
|
|
571
|
-
if (changed.size === 0) {
|
|
572
|
-
return cursors;
|
|
573
|
-
}
|
|
574
|
-
changed.forEach(function (clientId) {
|
|
575
|
-
var state = CursorEditor.cursorState(editor, clientId);
|
|
576
|
-
if (state === null) {
|
|
577
|
-
delete cursors[clientId.toString()];
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
cursors[clientId] = state;
|
|
581
|
-
});
|
|
582
|
-
changed.clear();
|
|
583
|
-
cursors = __assign({}, cursors);
|
|
584
|
-
return cursors;
|
|
585
|
-
};
|
|
586
|
-
return [subscribe, getSnapshot];
|
|
587
|
-
}
|
|
588
|
-
function getCursorStateStore(editor) {
|
|
589
|
-
var existing = EDITOR_TO_CURSOR_STORE.get(editor);
|
|
590
|
-
if (existing) {
|
|
591
|
-
return existing;
|
|
592
|
-
}
|
|
593
|
-
var store = createRemoteCursorStateStore(editor);
|
|
594
|
-
if (editor)
|
|
595
|
-
EDITOR_TO_CURSOR_STORE.set(editor, store);
|
|
596
|
-
return store;
|
|
597
|
-
}
|
|
598
|
-
function useRemoteCursorStateStore() {
|
|
599
|
-
var editor = useRemoteCursorEditor();
|
|
600
|
-
return getCursorStateStore(editor);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
function useRemoteCursorStates() {
|
|
604
|
-
var _a = __read(useRemoteCursorStateStore(), 2), subscribe = _a[0], getSnapshot = _a[1];
|
|
605
|
-
return shim.useSyncExternalStore(subscribe, getSnapshot);
|
|
606
|
-
}
|
|
607
|
-
function useRemoteCursorStatesSelector(selector, isEqual) {
|
|
608
|
-
var _a = __read(useRemoteCursorStateStore(), 2), subscribe = _a[0], getSnapshot = _a[1];
|
|
609
|
-
return withSelector.useSyncExternalStoreWithSelector(subscribe, getSnapshot, null, selector, isEqual);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
var CHILDREN_TO_CURSOR_STATE_TO_RANGE = new WeakMap();
|
|
613
|
-
function getCursorRange(editor, cursorState) {
|
|
614
|
-
if (!cursorState.relativeSelection) {
|
|
615
|
-
return null;
|
|
616
|
-
}
|
|
617
|
-
var cursorStates = CHILDREN_TO_CURSOR_STATE_TO_RANGE.get(editor.children);
|
|
618
|
-
if (!cursorStates) {
|
|
619
|
-
cursorStates = new WeakMap();
|
|
620
|
-
CHILDREN_TO_CURSOR_STATE_TO_RANGE.set(editor.children, cursorStates);
|
|
621
|
-
}
|
|
622
|
-
var range = cursorStates.get(cursorState);
|
|
623
|
-
if (range === undefined) {
|
|
624
|
-
try {
|
|
625
|
-
range = relativeRangeToSlateRange(editor.sharedRoot, editor, cursorState.relativeSelection);
|
|
626
|
-
cursorStates.set(cursorState, range);
|
|
627
|
-
}
|
|
628
|
-
catch (e) {
|
|
629
|
-
return null;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
return range;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
function reactEditorToDomRangeSafe(editor, range) {
|
|
636
|
-
try {
|
|
637
|
-
return DomEditor.toDOMRange(editor, range);
|
|
638
|
-
}
|
|
639
|
-
catch (e) {
|
|
640
|
-
return null;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
function getOverlayPosition(editor, range, _a) {
|
|
645
|
-
var e_1, _b;
|
|
646
|
-
var yOffset = _a.yOffset, xOffset = _a.xOffset, shouldGenerateOverlay = _a.shouldGenerateOverlay;
|
|
647
|
-
var _c = __read(Range.edges(range), 2), start = _c[0], end = _c[1];
|
|
648
|
-
var domRange = reactEditorToDomRangeSafe(editor, range);
|
|
649
|
-
if (!domRange) {
|
|
650
|
-
return {
|
|
651
|
-
caretPosition: null,
|
|
652
|
-
selectionRects: [],
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
var selectionRects = [];
|
|
656
|
-
var nodeIterator = Editor.nodes(editor, {
|
|
657
|
-
at: range,
|
|
658
|
-
match: function (n, p) { return Text.isText(n) && (!shouldGenerateOverlay || shouldGenerateOverlay(n, p)); },
|
|
659
|
-
});
|
|
660
|
-
var caretPosition = null;
|
|
661
|
-
var isBackward = Range.isBackward(range);
|
|
662
|
-
try {
|
|
663
|
-
for (var nodeIterator_1 = __values(nodeIterator), nodeIterator_1_1 = nodeIterator_1.next(); !nodeIterator_1_1.done; nodeIterator_1_1 = nodeIterator_1.next()) {
|
|
664
|
-
var _d = __read(nodeIterator_1_1.value, 2), node = _d[0], path = _d[1];
|
|
665
|
-
var domNode = DomEditor.toDOMNode(editor, node);
|
|
666
|
-
var isStartNode = Path.equals(path, start.path);
|
|
667
|
-
var isEndNode = Path.equals(path, end.path);
|
|
668
|
-
var clientRects = null;
|
|
669
|
-
if (isStartNode || isEndNode) {
|
|
670
|
-
var nodeRange = document.createRange();
|
|
671
|
-
nodeRange.selectNode(domNode);
|
|
672
|
-
if (isStartNode) {
|
|
673
|
-
nodeRange.setStart(domRange.startContainer, domRange.startOffset);
|
|
674
|
-
}
|
|
675
|
-
if (isEndNode) {
|
|
676
|
-
nodeRange.setEnd(domRange.endContainer, domRange.endOffset);
|
|
677
|
-
}
|
|
678
|
-
clientRects = nodeRange.getClientRects();
|
|
679
|
-
}
|
|
680
|
-
else {
|
|
681
|
-
clientRects = domNode.getClientRects();
|
|
682
|
-
}
|
|
683
|
-
var isCaret = isBackward ? isStartNode : isEndNode;
|
|
684
|
-
for (var i = 0; i < clientRects.length; i++) {
|
|
685
|
-
var clientRect = clientRects.item(i);
|
|
686
|
-
if (!clientRect) {
|
|
687
|
-
continue;
|
|
688
|
-
}
|
|
689
|
-
var isCaretRect = isCaret && (isBackward ? i === 0 : i === clientRects.length - 1);
|
|
690
|
-
var top_1 = clientRect.top - yOffset;
|
|
691
|
-
var left = clientRect.left - xOffset;
|
|
692
|
-
if (isCaretRect) {
|
|
693
|
-
caretPosition = {
|
|
694
|
-
height: clientRect.height,
|
|
695
|
-
top: top_1,
|
|
696
|
-
left: left + (isBackward || Range.isCollapsed(range) ? 0 : clientRect.width),
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
selectionRects.push({
|
|
700
|
-
width: clientRect.width,
|
|
701
|
-
height: clientRect.height,
|
|
702
|
-
top: top_1,
|
|
703
|
-
left: left,
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
709
|
-
finally {
|
|
710
|
-
try {
|
|
711
|
-
if (nodeIterator_1_1 && !nodeIterator_1_1.done && (_b = nodeIterator_1.return)) _b.call(nodeIterator_1);
|
|
712
|
-
}
|
|
713
|
-
finally { if (e_1) throw e_1.error; }
|
|
714
|
-
}
|
|
715
|
-
return {
|
|
716
|
-
selectionRects: selectionRects,
|
|
717
|
-
caretPosition: caretPosition,
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
function useRequestRerender() {
|
|
722
|
-
var _a = __read(useReducer(function (s) { return s + 1; }, 0), 2), rerender = _a[1];
|
|
723
|
-
var animationFrameIdRef = useRef(null);
|
|
724
|
-
var clearAnimationFrame = function () {
|
|
725
|
-
if (animationFrameIdRef.current) {
|
|
726
|
-
cancelAnimationFrame(animationFrameIdRef.current);
|
|
727
|
-
animationFrameIdRef.current = 0;
|
|
728
|
-
}
|
|
729
|
-
};
|
|
730
|
-
useEffect(clearAnimationFrame);
|
|
731
|
-
useEffect(function () { return clearAnimationFrame; }, []);
|
|
732
|
-
return useCallback(function (immediately) {
|
|
733
|
-
if (immediately === void 0) { immediately = false; }
|
|
734
|
-
if (immediately) {
|
|
735
|
-
rerender();
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
if (animationFrameIdRef.current) {
|
|
739
|
-
return;
|
|
740
|
-
}
|
|
741
|
-
animationFrameIdRef.current = requestAnimationFrame(rerender);
|
|
742
|
-
}, []);
|
|
743
|
-
}
|
|
744
|
-
function useOnResize(ref, onResize) {
|
|
745
|
-
var onResizeRef = useRef(onResize);
|
|
746
|
-
onResizeRef.current = onResize;
|
|
747
|
-
var _a = __read(useState(function () {
|
|
748
|
-
return new ResizeObserver(function () {
|
|
749
|
-
onResizeRef.current();
|
|
750
|
-
});
|
|
751
|
-
}), 1), observer = _a[0];
|
|
752
|
-
useEffect(function () {
|
|
753
|
-
if (!(ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
var element = ref.current;
|
|
757
|
-
observer.observe(element);
|
|
758
|
-
return function () { return observer.unobserve(element); };
|
|
759
|
-
}, [observer, ref]);
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
var FROZEN_EMPTY_ARRAY = Object.freeze([]);
|
|
763
|
-
function useRemoteCursorOverlayPositions(_a) {
|
|
764
|
-
var _b;
|
|
765
|
-
if (_a === void 0) { _a = {}; }
|
|
766
|
-
var containerRef = _a.containerRef, shouldGenerateOverlay = _a.shouldGenerateOverlay, opts = __rest(_a, ["containerRef", "shouldGenerateOverlay"]);
|
|
767
|
-
var editor = useRemoteCursorEditor();
|
|
768
|
-
var cursorStates = useRemoteCursorStates();
|
|
769
|
-
var requestRerender = useRequestRerender();
|
|
770
|
-
var overlayPositionCache = useRef(new WeakMap());
|
|
771
|
-
var _c = __read(useState({}), 2), overlayPositions = _c[0], setOverlayPositions = _c[1];
|
|
772
|
-
var refreshOnResize = 'refreshOnResize' in opts ? (_b = opts.refreshOnResize) !== null && _b !== void 0 ? _b : true : true;
|
|
773
|
-
useOnResize(refreshOnResize ? containerRef : undefined, function () {
|
|
774
|
-
overlayPositionCache.current = new WeakMap();
|
|
775
|
-
requestRerender(refreshOnResize !== 'debounced');
|
|
776
|
-
});
|
|
777
|
-
// Update selection rects after paint
|
|
778
|
-
useLayoutEffect(function () {
|
|
779
|
-
var _a, _b, _c;
|
|
780
|
-
// We have a container ref but the ref is null => container
|
|
781
|
-
// isn't mounted to we can't calculate the selection rects.
|
|
782
|
-
if (containerRef && !containerRef.current) {
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
var containerRect = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
786
|
-
var xOffset = (_b = containerRect === null || containerRect === void 0 ? void 0 : containerRect.x) !== null && _b !== void 0 ? _b : 0;
|
|
787
|
-
var yOffset = (_c = containerRect === null || containerRect === void 0 ? void 0 : containerRect.y) !== null && _c !== void 0 ? _c : 0;
|
|
788
|
-
var overlayPositionsChanged = Object.keys(overlayPositions).length !== Object.keys(cursorStates).length;
|
|
789
|
-
var updated = Object.fromEntries(Object.entries(cursorStates).map(function (_a) {
|
|
790
|
-
var _b = __read(_a, 2), key = _b[0], state = _b[1];
|
|
791
|
-
var range = state.relativeSelection && getCursorRange(editor, state);
|
|
792
|
-
if (!range) {
|
|
793
|
-
return [key, FROZEN_EMPTY_ARRAY];
|
|
794
|
-
}
|
|
795
|
-
var cached = overlayPositionCache.current.get(range);
|
|
796
|
-
if (cached) {
|
|
797
|
-
return [key, cached];
|
|
798
|
-
}
|
|
799
|
-
var overlayPosition = getOverlayPosition(editor, range, {
|
|
800
|
-
xOffset: xOffset,
|
|
801
|
-
yOffset: yOffset,
|
|
802
|
-
shouldGenerateOverlay: shouldGenerateOverlay,
|
|
803
|
-
});
|
|
804
|
-
overlayPositionsChanged = true;
|
|
805
|
-
overlayPositionCache.current.set(range, overlayPosition);
|
|
806
|
-
return [key, overlayPosition];
|
|
807
|
-
}));
|
|
808
|
-
if (overlayPositionsChanged) {
|
|
809
|
-
setOverlayPositions(updated);
|
|
810
|
-
}
|
|
811
|
-
});
|
|
812
|
-
var overlayData = useMemo(function () {
|
|
813
|
-
return Object.entries(cursorStates).map(function (_a) {
|
|
814
|
-
var _b, _c;
|
|
815
|
-
var _d = __read(_a, 2), clientId = _d[0], state = _d[1];
|
|
816
|
-
var range = state.relativeSelection && getCursorRange(editor, state);
|
|
817
|
-
var overlayPosition = overlayPositions[clientId];
|
|
818
|
-
return __assign(__assign({}, state), { range: range, caretPosition: (_b = overlayPosition === null || overlayPosition === void 0 ? void 0 : overlayPosition.caretPosition) !== null && _b !== void 0 ? _b : null, selectionRects: (_c = overlayPosition === null || overlayPosition === void 0 ? void 0 : overlayPosition.selectionRects) !== null && _c !== void 0 ? _c : FROZEN_EMPTY_ARRAY });
|
|
819
|
-
});
|
|
820
|
-
}, [cursorStates, editor, overlayPositions]);
|
|
821
|
-
var refresh = useCallback(function () {
|
|
822
|
-
overlayPositionCache.current = new WeakMap();
|
|
823
|
-
requestRerender(true);
|
|
824
|
-
}, [requestRerender]);
|
|
825
|
-
return [overlayData, refresh];
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
export { EditorContext, getCursorRange, useEditorStatic, useRemoteCursorOverlayPositions, useRemoteCursorStates, useRemoteCursorStatesSelector };
|
|
39
|
+
S((function(t,e){}));var N,W,G=S((function(t){t.exports=D})),B=function(t){return t&&t.Math==Math&&t},V=B("object"==typeof globalThis&&globalThis)||B("object"==typeof window&&window)||B("object"==typeof self&&self)||B("object"==typeof O&&O)||function(){return this}()||Function("return this")(),X=Function.prototype,U=X.bind,Y=X.call,q=U&&U.bind(Y),H=U?function(t){return t&&q(Y,t)}:function(t){return t&&function(){return Y.apply(t,arguments)}},K=function(t){try{return!!t()}catch(t){return!0}},$=H({}.toString),J=H("".slice),Q=function(t){return J($(t),8,-1)},Z=V.Object,tt=H("".split),et=K((function(){return!Z("z").propertyIsEnumerable(0)}))?function(t){return"String"==Q(t)?tt(t,""):Z(t)}:Z,rt=V.TypeError,nt=function(t){if(null==t)throw rt("Can't call method on "+t);return t},ot=function(t){return et(nt(t))},it=Object.defineProperty,ut=function(t,e){try{it(V,t,{value:e,configurable:!0,writable:!0})}catch(r){V[t]=e}return e},at="__core-js_shared__",ct=V[at]||ut(at,{}),ft=S((function(t){(t.exports=function(t,e){return ct[t]||(ct[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),st=V.Object,lt=function(t){return st(nt(t))},vt=H({}.hasOwnProperty),pt=Object.hasOwn||function(t,e){return vt(lt(t),e)},ht=0,dt=Math.random(),yt=H(1..toString),gt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+yt(++ht+dt,36)},bt=function(t){return"function"==typeof t},mt=function(t,e){return arguments.length<2?(r=V[t],bt(r)?r:void 0):V[t]&&V[t][e];var r},wt=mt("navigator","userAgent")||"",Ot=V.process,St=V.Deno,xt=Ot&&Ot.versions||St&&St.version,Et=xt&&xt.v8;Et&&(W=(N=Et.split("."))[0]>0&&N[0]<4?1:+(N[0]+N[1])),!W&&wt&&(!(N=wt.match(/Edge\/(\d+)/))||N[1]>=74)&&(N=wt.match(/Chrome\/(\d+)/))&&(W=+N[1]);var jt,Tt=W,Pt=!!Object.getOwnPropertySymbols&&!K((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Tt&&Tt<41})),At=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Rt=ft("wks"),kt=V.Symbol,Lt=kt&&kt.for,It=At?kt:kt&&kt.withoutSetter||gt,Ct=function(t){if(!pt(Rt,t)||!Pt&&"string"!=typeof Rt[t]){var e="Symbol."+t;Pt&&pt(kt,t)?Rt[t]=kt[t]:Rt[t]=At&&Lt?Lt(e):It(e)}return Rt[t]},zt=function(t){return"object"==typeof t?null!==t:bt(t)},Ft=V.String,Mt=V.TypeError,_t=function(t){if(zt(t))return t;throw Mt(Ft(t)+" is not an object")},Dt=!K((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Nt=V.document,Wt=zt(Nt)&&zt(Nt.createElement),Gt=function(t){return Wt?Nt.createElement(t):{}},Bt=!Dt&&!K((function(){return 7!=Object.defineProperty(Gt("div"),"a",{get:function(){return 7}}).a})),Vt=Function.prototype.call,Xt=Vt.bind?Vt.bind(Vt):function(){return Vt.apply(Vt,arguments)},Ut=H({}.isPrototypeOf),Yt=V.Object,qt=At?function(t){return"symbol"==typeof t}:function(t){var e=mt("Symbol");return bt(e)&&Ut(e.prototype,Yt(t))},Ht=V.String,Kt=function(t){try{return Ht(t)}catch(t){return"Object"}},$t=V.TypeError,Jt=function(t){if(bt(t))return t;throw $t(Kt(t)+" is not a function")},Qt=function(t,e){var r=t[e];return null==r?void 0:Jt(r)},Zt=V.TypeError,te=V.TypeError,ee=Ct("toPrimitive"),re=function(t,e){if(!zt(t)||qt(t))return t;var r,n=Qt(t,ee);if(n){if(void 0===e&&(e="default"),r=Xt(n,t,e),!zt(r)||qt(r))return r;throw te("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&bt(r=t.toString)&&!zt(n=Xt(r,t)))return n;if(bt(r=t.valueOf)&&!zt(n=Xt(r,t)))return n;if("string"!==e&&bt(r=t.toString)&&!zt(n=Xt(r,t)))return n;throw Zt("Can't convert object to primitive value")}(t,e)},ne=function(t){var e=re(t,"string");return qt(e)?e:e+""},oe=V.TypeError,ie=Object.defineProperty,ue=Dt?ie:function(t,e,r){if(_t(t),e=ne(e),_t(r),Bt)try{return ie(t,e,r)}catch(t){}if("get"in r||"set"in r)throw oe("Accessors not supported");return"value"in r&&(t[e]=r.value),t},ae={f:ue},ce=Math.ceil,fe=Math.floor,se=function(t){var e=+t;return e!=e||0===e?0:(e>0?fe:ce)(e)},le=Math.max,ve=Math.min,pe=function(t,e){var r=se(t);return r<0?le(r+e,0):ve(r,e)},he=Math.min,de=function(t){return(e=t.length)>0?he(se(e),9007199254740991):0;var e},ye=function(t){return function(e,r,n){var o,i=ot(e),u=de(i),a=pe(n,u);if(t&&r!=r){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},ge={includes:ye(!0),indexOf:ye(!1)},be={},me=ge.indexOf,we=H([].push),Oe=function(t,e){var r,n=ot(t),o=0,i=[];for(r in n)!pt(be,r)&&pt(n,r)&&we(i,r);for(;e.length>o;)pt(n,r=e[o++])&&(~me(i,r)||we(i,r));return i},Se=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xe=Object.keys||function(t){return Oe(t,Se)},Ee=Dt?Object.defineProperties:function(t,e){_t(t);for(var r,n=ot(e),o=xe(e),i=o.length,u=0;i>u;)ae.f(t,r=o[u++],n[r]);return t},je=mt("document","documentElement"),Te=ft("keys"),Pe=function(t){return Te[t]||(Te[t]=gt(t))},Ae="prototype",Re="script",ke=Pe("IE_PROTO"),Le=function(){},Ie=function(t){return"<"+Re+">"+t+"</"+Re+">"},Ce=function(t){t.write(Ie("")),t.close();var e=t.parentWindow.Object;return t=null,e},ze=function(){try{jt=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;ze="undefined"!=typeof document?document.domain&&jt?Ce(jt):(e=Gt("iframe"),r="java"+Re+":",e.style.display="none",je.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(Ie("document.F=Object")),t.close(),t.F):Ce(jt);for(var n=Se.length;n--;)delete ze[Ae][Se[n]];return ze()};be[ke]=!0;var Fe=Object.create||function(t,e){var r;return null!==t?(Le[Ae]=_t(t),r=new Le,Le[Ae]=null,r[ke]=t):r=ze(),void 0===e?r:Ee(r,e)},Me=Ct("unscopables"),_e=Array.prototype;null==_e[Me]&&ae.f(_e,Me,{configurable:!0,value:Fe(null)});var De=function(t){_e[Me][t]=!0},Ne={},We=H(Function.toString);bt(ct.inspectSource)||(ct.inspectSource=function(t){return We(t)});var Ge,Be,Ve,Xe=ct.inspectSource,Ue=V.WeakMap,Ye=bt(Ue)&&/native code/.test(Xe(Ue)),qe=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},He=Dt?function(t,e,r){return ae.f(t,e,qe(1,r))}:function(t,e,r){return t[e]=r,t},Ke="Object already initialized",$e=V.TypeError,Je=V.WeakMap;if(Ye||ct.state){var Qe=ct.state||(ct.state=new Je),Ze=H(Qe.get),tr=H(Qe.has),er=H(Qe.set);Ge=function(t,e){if(tr(Qe,t))throw new $e(Ke);return e.facade=t,er(Qe,t,e),e},Be=function(t){return Ze(Qe,t)||{}},Ve=function(t){return tr(Qe,t)}}else{var rr=Pe("state");be[rr]=!0,Ge=function(t,e){if(pt(t,rr))throw new $e(Ke);return e.facade=t,He(t,rr,e),e},Be=function(t){return pt(t,rr)?t[rr]:{}},Ve=function(t){return pt(t,rr)}}var nr,or,ir,ur={set:Ge,get:Be,has:Ve,enforce:function(t){return Ve(t)?Be(t):Ge(t,{})},getterFor:function(t){return function(e){var r;if(!zt(e)||(r=Be(e)).type!==t)throw $e("Incompatible receiver, "+t+" required");return r}}},ar={}.propertyIsEnumerable,cr=Object.getOwnPropertyDescriptor,fr=cr&&!ar.call({1:2},1)?function(t){var e=cr(this,t);return!!e&&e.enumerable}:ar,sr={f:fr},lr=Object.getOwnPropertyDescriptor,vr=Dt?lr:function(t,e){if(t=ot(t),e=ne(e),Bt)try{return lr(t,e)}catch(t){}if(pt(t,e))return qe(!Xt(sr.f,t,e),t[e])},pr={f:vr},hr=Function.prototype,dr=Dt&&Object.getOwnPropertyDescriptor,yr=pt(hr,"name"),gr={EXISTS:yr,PROPER:yr&&"something"===function(){}.name,CONFIGURABLE:yr&&(!Dt||Dt&&dr(hr,"name").configurable)},br=S((function(t){var e=gr.CONFIGURABLE,r=ur.get,n=ur.enforce,o=String(String).split("String");(t.exports=function(t,r,i,u){var a,c=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet,l=u&&void 0!==u.name?u.name:r;bt(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!pt(i,"name")||e&&i.name!==l)&&He(i,"name",l),(a=n(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==V?(c?!s&&t[r]&&(f=!0):delete t[r],f?t[r]=i:He(t,r,i)):f?t[r]=i:ut(r,i)})(Function.prototype,"toString",(function(){return bt(this)&&r(this).source||Xe(this)}))})),mr=Se.concat("length","prototype"),wr=Object.getOwnPropertyNames||function(t){return Oe(t,mr)},Or={f:wr},Sr={f:Object.getOwnPropertySymbols},xr=H([].concat),Er=mt("Reflect","ownKeys")||function(t){var e=Or.f(_t(t)),r=Sr.f;return r?xr(e,r(t)):e},jr=function(t,e){for(var r=Er(e),n=ae.f,o=pr.f,i=0;i<r.length;i++){var u=r[i];pt(t,u)||n(t,u,o(e,u))}},Tr=/#|\.prototype\./,Pr=function(t,e){var r=Rr[Ar(t)];return r==Lr||r!=kr&&(bt(e)?K(e):!!e)},Ar=Pr.normalize=function(t){return String(t).replace(Tr,".").toLowerCase()},Rr=Pr.data={},kr=Pr.NATIVE="N",Lr=Pr.POLYFILL="P",Ir=Pr,Cr=pr.f,zr=function(t,e){var r,n,o,i,u,a=t.target,c=t.global,f=t.stat;if(r=c?V:f?V[a]||ut(a,{}):(V[a]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(u=Cr(r,n))&&u.value:r[n],!Ir(c?n:a+(f?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;jr(i,o)}(t.sham||o&&o.sham)&&He(i,"sham",!0),br(r,n,i,t)}},Fr=!K((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Mr=Pe("IE_PROTO"),_r=V.Object,Dr=_r.prototype,Nr=Fr?_r.getPrototypeOf:function(t){var e=lt(t);if(pt(e,Mr))return e[Mr];var r=e.constructor;return bt(r)&&e instanceof r?r.prototype:e instanceof _r?Dr:null},Wr=Ct("iterator"),Gr=!1;[].keys&&("next"in(ir=[].keys())?(or=Nr(Nr(ir)))!==Object.prototype&&(nr=or):Gr=!0);var Br=null==nr||K((function(){var t={};return nr[Wr].call(t)!==t}));Br&&(nr={}),bt(nr[Wr])||br(nr,Wr,(function(){return this}));var Vr={IteratorPrototype:nr,BUGGY_SAFARI_ITERATORS:Gr},Xr=ae.f,Ur=Ct("toStringTag"),Yr=function(t,e,r){t&&!pt(t=r?t:t.prototype,Ur)&&Xr(t,Ur,{configurable:!0,value:e})},qr=Vr.IteratorPrototype,Hr=function(){return this},Kr=V.String,$r=V.TypeError,Jr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=H(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return _t(r),function(t){if("object"==typeof t||bt(t))return t;throw $r("Can't set "+Kr(t)+" as a prototype")}(n),e?t(r,n):r.__proto__=n,r}}():void 0),Qr=gr.PROPER,Zr=gr.CONFIGURABLE,tn=Vr.IteratorPrototype,en=Vr.BUGGY_SAFARI_ITERATORS,rn=Ct("iterator"),nn="keys",on="values",un="entries",an=function(){return this},cn=function(t,e,r,n,o,i,u){!function(t,e,r,n){var o=e+" Iterator";t.prototype=Fe(qr,{next:qe(+!n,r)}),Yr(t,o,!1),Ne[o]=Hr}(r,e,n);var a,c,f,s=function(t){if(t===o&&d)return d;if(!en&&t in p)return p[t];switch(t){case nn:case on:case un:return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",v=!1,p=t.prototype,h=p[rn]||p["@@iterator"]||o&&p[o],d=!en&&h||s(o),y="Array"==e&&p.entries||h;if(y&&(a=Nr(y.call(new t)))!==Object.prototype&&a.next&&(Nr(a)!==tn&&(Jr?Jr(a,tn):bt(a[rn])||br(a,rn,an)),Yr(a,l,!0)),Qr&&o==on&&h&&h.name!==on&&(Zr?He(p,"name",on):(v=!0,d=function(){return Xt(h,this)})),o)if(c={values:s(on),keys:i?d:s(nn),entries:s(un)},u)for(f in c)(en||v||!(f in p))&&br(p,f,c[f]);else zr({target:e,proto:!0,forced:en||v},c);return p[rn]!==d&&br(p,rn,d,{name:o}),Ne[e]=d,c},fn="Array Iterator",sn=ur.set,ln=ur.getterFor(fn),vn=cn(Array,"Array",(function(t,e){sn(this,{type:fn,target:ot(t),index:0,kind:e})}),(function(){var t=ln(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");Ne.Arguments=Ne.Array,De("keys"),De("values"),De("entries");var pn={};pn[Ct("toStringTag")]="z";var hn="[object z]"===String(pn),dn=Ct("toStringTag"),yn=V.Object,gn="Arguments"==Q(function(){return arguments}()),bn=hn?Q:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=yn(t),dn))?r:gn?Q(e):"Object"==(n=Q(e))&&bt(e.callee)?"Arguments":n},mn=hn?{}.toString:function(){return"[object "+bn(this)+"]"};hn||br(Object.prototype,"toString",mn,{unsafe:!0});var wn=V.String,On=function(t){if("Symbol"===bn(t))throw TypeError("Cannot convert a Symbol value to a string");return wn(t)},Sn=gr.PROPER,xn="toString",En=RegExp.prototype,jn=En[xn],Tn=H((function(){var t=_t(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e})),Pn=K((function(){return"/a/b"!=jn.call({source:"a",flags:"b"})})),An=Sn&&jn.name!=xn;(Pn||An)&&br(RegExp.prototype,xn,(function(){var t=_t(this),e=On(t.source),r=t.flags;return"/"+e+"/"+On(void 0===r&&Ut(En,t)&&!("flags"in En)?Tn(t):r)}),{unsafe:!0});var Rn=function(t,e,r){var n=ne(e);n in t?ae.f(t,n,qe(0,r)):t[n]=r},kn=V.Array,Ln=Math.max,In=Or.f,Cn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],zn=function(t){try{return In(t)}catch(t){return function(t,e,r){for(var n=de(t),o=pe(e,n),i=pe(void 0===r?n:r,n),u=kn(Ln(i-o,0)),a=0;o<i;o++,a++)Rn(u,a,t[o]);return u.length=a,u}(Cn)}},Fn={f:function(t){return Cn&&"Window"==Q(t)?zn(t):In(ot(t))}},Mn=K((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),_n=Object.isExtensible,Dn=K((function(){_n(1)}))||Mn?function(t){return!!zt(t)&&((!Mn||"ArrayBuffer"!=Q(t))&&(!_n||_n(t)))}:_n,Nn=!K((function(){return Object.isExtensible(Object.preventExtensions({}))})),Wn=S((function(t){var e=ae.f,r=!1,n=gt("meta"),o=0,i=function(t){e(t,n,{value:{objectID:"O"+o++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},r=!0;var t=Or.f,e=H([].splice),o={};o[n]=1,t(o).length&&(Or.f=function(r){for(var o=t(r),i=0,u=o.length;i<u;i++)if(o[i]===n){e(o,i,1);break}return o},zr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Fn.f}))},fastKey:function(t,e){if(!zt(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!pt(t,n)){if(!Dn(t))return"F";if(!e)return"E";i(t)}return t[n].objectID},getWeakData:function(t,e){if(!pt(t,n)){if(!Dn(t))return!0;if(!e)return!1;i(t)}return t[n].weakData},onFreeze:function(t){return Nn&&r&&Dn(t)&&!pt(t,n)&&i(t),t}};be[n]=!0})),Gn=H(H.bind),Bn=function(t,e){return Jt(t),void 0===e?t:Gn?Gn(t,e):function(){return t.apply(e,arguments)}},Vn=Ct("iterator"),Xn=Array.prototype,Un=Ct("iterator"),Yn=function(t){if(null!=t)return Qt(t,Un)||Qt(t,"@@iterator")||Ne[bn(t)]},qn=V.TypeError,Hn=function(t,e,r){var n,o;_t(t);try{if(!(n=Qt(t,"return"))){if("throw"===e)throw r;return r}n=Xt(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return _t(n),r},Kn=V.TypeError,$n=function(t,e){this.stopped=t,this.result=e},Jn=$n.prototype,Qn=function(t,e,r){var n,o,i,u,a,c,f,s=r&&r.that,l=!(!r||!r.AS_ENTRIES),v=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),h=Bn(e,s),d=function(t){return n&&Hn(n,"normal",t),new $n(!0,t)},y=function(t){return l?(_t(t),p?h(t[0],t[1],d):h(t[0],t[1])):p?h(t,d):h(t)};if(v)n=t;else{if(!(o=Yn(t)))throw Kn(Kt(t)+" is not iterable");if(function(t){return void 0!==t&&(Ne.Array===t||Xn[Vn]===t)}(o)){for(i=0,u=de(t);u>i;i++)if((a=y(t[i]))&&Ut(Jn,a))return a;return new $n(!1)}n=function(t,e){var r=arguments.length<2?Yn(t):e;if(Jt(r))return _t(Xt(r,t));throw qn(Kt(t)+" is not iterable")}(t,o)}for(c=n.next;!(f=Xt(c,n)).done;){try{a=y(f.value)}catch(t){Hn(n,"throw",t)}if("object"==typeof a&&a&&Ut(Jn,a))return a}return new $n(!1)},Zn=V.TypeError,to=function(t,e){if(Ut(e,t))return t;throw Zn("Incorrect invocation")},eo=Ct("iterator"),ro=!1;try{var no=0,oo={next:function(){return{done:!!no++}},return:function(){ro=!0}};oo[eo]=function(){return this},Array.from(oo,(function(){throw 2}))}catch(t){}var io=function(t,e,r){var n=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=n?"set":"add",u=V[t],a=u&&u.prototype,c=u,f={},s=function(t){var e=H(a[t]);br(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!zt(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return o&&!zt(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!zt(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(Ir(t,!bt(u)||!(o||a.forEach&&!K((function(){(new u).entries().next()})))))c=r.getConstructor(e,t,n,i),Wn.enable();else if(Ir(t,!0)){var l=new c,v=l[i](o?{}:-0,1)!=l,p=K((function(){l.has(1)})),h=function(t,e){if(!e&&!ro)return!1;var r=!1;try{var n={};n[eo]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r}((function(t){new u(t)})),d=!o&&K((function(){for(var t=new u,e=5;e--;)t[i](e,e);return!t.has(-0)}));h||((c=e((function(t,e){to(t,a);var r=function(t,e,r){var n,o;return Jr&&bt(n=e.constructor)&&n!==r&&zt(o=n.prototype)&&o!==r.prototype&&Jr(t,o),t}(new u,t,c);return null!=e&&Qn(e,r[i],{that:r,AS_ENTRIES:n}),r}))).prototype=a,a.constructor=c),(p||d)&&(s("delete"),s("has"),n&&s("get")),(d||v)&&s(i),o&&a.clear&&delete a.clear}return f[t]=c,zr({global:!0,forced:c!=u},f),Yr(c,t),o||r.setStrong(c,t,n),c},uo=function(t,e,r){for(var n in e)br(t,n,e[n],r);return t},ao=Ct("species"),co=ae.f,fo=Wn.fastKey,so=ur.set,lo=ur.getterFor,vo={getConstructor:function(t,e,r,n){var o=t((function(t,o){to(t,i),so(t,{type:e,index:Fe(null),first:void 0,last:void 0,size:0}),Dt||(t.size=0),null!=o&&Qn(o,t[n],{that:t,AS_ENTRIES:r})})),i=o.prototype,u=lo(e),a=function(t,e,r){var n,o,i=u(t),a=c(t,e);return a?a.value=r:(i.last=a={index:o=fo(e,!0),key:e,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=a),n&&(n.next=a),Dt?i.size++:t.size++,"F"!==o&&(i.index[o]=a)),t},c=function(t,e){var r,n=u(t),o=fo(e);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==e)return r};return uo(i,{clear:function(){for(var t=u(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,Dt?t.size=0:this.size=0},delete:function(t){var e=this,r=u(e),n=c(e,t);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),Dt?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=u(this),n=Bn(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),uo(i,r?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),Dt&&co(i,"size",{get:function(){return u(this).size}}),o},setStrong:function(t,e,r){var n=e+" Iterator",o=lo(e),i=lo(n);cn(t,e,(function(t,e){so(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),function(t){var e=mt(t),r=ae.f;Dt&&e&&!e[ao]&&r(e,ao,{configurable:!0,get:function(){return this}})}(e)}};io("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),vo);var po=H("".charAt),ho=H("".charCodeAt),yo=H("".slice),go=function(t){return function(e,r){var n,o,i=On(nt(e)),u=se(r),a=i.length;return u<0||u>=a?t?"":void 0:(n=ho(i,u))<55296||n>56319||u+1===a||(o=ho(i,u+1))<56320||o>57343?t?po(i,u):n:t?yo(i,u,u+2):o-56320+(n-55296<<10)+65536}},bo={codeAt:go(!1),charAt:go(!0)}.charAt,mo="String Iterator",wo=ur.set,Oo=ur.getterFor(mo);cn(String,"String",(function(t){wo(this,{type:mo,string:On(t),index:0})}),(function(){var t,e=Oo(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=bo(r,n),e.index+=t.length,{value:t,done:!1})}));var So=Array.isArray||function(t){return"Array"==Q(t)},xo=function(){},Eo=[],jo=mt("Reflect","construct"),To=/^\s*(?:class|function)\b/,Po=H(To.exec),Ao=!To.exec(xo),Ro=function(t){if(!bt(t))return!1;try{return jo(xo,Eo,t),!0}catch(t){return!1}},ko=!jo||K((function(){var t;return Ro(Ro.call)||!Ro(Object)||!Ro((function(){t=!0}))||t}))?function(t){if(!bt(t))return!1;switch(bn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Ao||!!Po(To,Xe(t))}:Ro,Lo=Ct("species"),Io=V.Array,Co=function(t,e){return new(function(t){var e;return So(t)&&(e=t.constructor,(ko(e)&&(e===Io||So(e.prototype))||zt(e)&&null===(e=e[Lo]))&&(e=void 0)),void 0===e?Io:e}(t))(0===e?0:e)},zo=H([].push),Fo=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,u=7==t,a=5==t||i;return function(c,f,s,l){for(var v,p,h=lt(c),d=et(h),y=Bn(f,s),g=de(d),b=0,m=l||Co,w=e?m(c,g):r||u?m(c,0):void 0;g>b;b++)if((a||b in d)&&(p=y(v=d[b],b,h),t))if(e)w[b]=p;else if(p)switch(t){case 3:return!0;case 5:return v;case 6:return b;case 2:zo(w,v)}else switch(t){case 4:return!1;case 7:zo(w,v)}return i?-1:n||o?o:w}},Mo={forEach:Fo(0),map:Fo(1),filter:Fo(2),some:Fo(3),every:Fo(4),find:Fo(5),findIndex:Fo(6),filterReject:Fo(7)},_o=Wn.getWeakData,Do=ur.set,No=ur.getterFor,Wo=Mo.find,Go=Mo.findIndex,Bo=H([].splice),Vo=0,Xo=function(t){return t.frozen||(t.frozen=new Uo)},Uo=function(){this.entries=[]},Yo=function(t,e){return Wo(t.entries,(function(t){return t[0]===e}))};Uo.prototype={get:function(t){var e=Yo(this,t);if(e)return e[1]},has:function(t){return!!Yo(this,t)},set:function(t,e){var r=Yo(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=Go(this.entries,(function(e){return e[0]===t}));return~e&&Bo(this.entries,e,1),!!~e}};var qo,Ho={getConstructor:function(t,e,r,n){var o=t((function(t,o){to(t,i),Do(t,{type:e,id:Vo++,frozen:void 0}),null!=o&&Qn(o,t[n],{that:t,AS_ENTRIES:r})})),i=o.prototype,u=No(e),a=function(t,e,r){var n=u(t),o=_o(_t(e),!0);return!0===o?Xo(n).set(e,r):o[n.id]=r,t};return uo(i,{delete:function(t){var e=u(this);if(!zt(t))return!1;var r=_o(t);return!0===r?Xo(e).delete(t):r&&pt(r,e.id)&&delete r[e.id]},has:function(t){var e=u(this);if(!zt(t))return!1;var r=_o(t);return!0===r?Xo(e).has(t):r&&pt(r,e.id)}}),uo(i,r?{get:function(t){var e=u(this);if(zt(t)){var r=_o(t);return!0===r?Xo(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),o}},Ko=ur.enforce,$o=!V.ActiveXObject&&"ActiveXObject"in V,Jo=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Qo=io("WeakMap",Jo,Ho);if(Ye&&$o){qo=Ho.getConstructor(Jo,"WeakMap",!0),Wn.enable();var Zo=Qo.prototype,ti=H(Zo.delete),ei=H(Zo.has),ri=H(Zo.get),ni=H(Zo.set);uo(Zo,{delete:function(t){if(zt(t)&&!Dn(t)){var e=Ko(this);return e.frozen||(e.frozen=new qo),ti(this,t)||e.frozen.delete(t)}return ti(this,t)},has:function(t){if(zt(t)&&!Dn(t)){var e=Ko(this);return e.frozen||(e.frozen=new qo),ei(this,t)||e.frozen.has(t)}return ei(this,t)},get:function(t){if(zt(t)&&!Dn(t)){var e=Ko(this);return e.frozen||(e.frozen=new qo),ei(this,t)?ri(this,t):e.frozen.get(t)}return ri(this,t)},set:function(t,e){if(zt(t)&&!Dn(t)){var r=Ko(this);r.frozen||(r.frozen=new qo),ei(this,t)?ni(this,t,e):r.frozen.set(t,e)}else ni(this,t,e);return this}})}var oi,ii,ui={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ai=Gt("span").classList,ci=ai&&ai.constructor&&ai.constructor.prototype,fi=ci===Object.prototype?void 0:ci,si=Mo.forEach,li=!!(ii=[]["forEach"])&&K((function(){ii.call(null,oi||function(){throw 1},1)}))?[].forEach:function(t){return si(this,t,arguments.length>1?arguments[1]:void 0)},vi=function(t){if(t&&t.forEach!==li)try{He(t,"forEach",li)}catch(e){t.forEach=li}};for(var pi in ui)ui[pi]&&vi(V[pi]&&V[pi].prototype);vi(fi);var hi=Ct("iterator"),di=Ct("toStringTag"),yi=vn.values,gi=function(t,e){if(t){if(t[hi]!==yi)try{He(t,hi,yi)}catch(e){t[hi]=yi}if(t[di]||He(t,di,e),ui[e])for(var r in vn)if(t[r]!==vn[r])try{He(t,r,vn[r])}catch(e){t[r]=vn[r]}}};for(var bi in ui)gi(V[bi]&&V[bi].prototype,bi);gi(fi,"DOMTokenList");var mi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function wi(t){var e={exports:{}};return t(e,e.exports),e.exports}var Oi,Si,xi=function(t){return t&&t.Math==Math&&t},Ei=xi("object"==typeof globalThis&&globalThis)||xi("object"==typeof window&&window)||xi("object"==typeof self&&self)||xi("object"==typeof mi&&mi)||function(){return this}()||Function("return this")(),ji=function(t){try{return!!t()}catch(t){return!0}},Ti=!ji((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Pi=Function.prototype.call,Ai=Pi.bind?Pi.bind(Pi):function(){return Pi.apply(Pi,arguments)},Ri={}.propertyIsEnumerable,ki=Object.getOwnPropertyDescriptor,Li=ki&&!Ri.call({1:2},1)?function(t){var e=ki(this,t);return!!e&&e.enumerable}:Ri,Ii={f:Li},Ci=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},zi=Function.prototype,Fi=zi.bind,Mi=zi.call,_i=Fi&&Fi.bind(Mi),Di=Fi?function(t){return t&&_i(Mi,t)}:function(t){return t&&function(){return Mi.apply(t,arguments)}},Ni=Di({}.toString),Wi=Di("".slice),Gi=function(t){return Wi(Ni(t),8,-1)},Bi=Ei.Object,Vi=Di("".split),Xi=ji((function(){return!Bi("z").propertyIsEnumerable(0)}))?function(t){return"String"==Gi(t)?Vi(t,""):Bi(t)}:Bi,Ui=Ei.TypeError,Yi=function(t){if(null==t)throw Ui("Can't call method on "+t);return t},qi=function(t){return Xi(Yi(t))},Hi=function(t){return"function"==typeof t},Ki=function(t){return"object"==typeof t?null!==t:Hi(t)},$i=function(t,e){return arguments.length<2?(r=Ei[t],Hi(r)?r:void 0):Ei[t]&&Ei[t][e];var r},Ji=Di({}.isPrototypeOf),Qi=$i("navigator","userAgent")||"",Zi=Ei.process,tu=Ei.Deno,eu=Zi&&Zi.versions||tu&&tu.version,ru=eu&&eu.v8;ru&&(Si=(Oi=ru.split("."))[0]>0&&Oi[0]<4?1:+(Oi[0]+Oi[1])),!Si&&Qi&&(!(Oi=Qi.match(/Edge\/(\d+)/))||Oi[1]>=74)&&(Oi=Qi.match(/Chrome\/(\d+)/))&&(Si=+Oi[1]);var nu=Si,ou=!!Object.getOwnPropertySymbols&&!ji((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&nu&&nu<41})),iu=ou&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,uu=Ei.Object,au=iu?function(t){return"symbol"==typeof t}:function(t){var e=$i("Symbol");return Hi(e)&&Ji(e.prototype,uu(t))},cu=Ei.String,fu=function(t){try{return cu(t)}catch(t){return"Object"}},su=Ei.TypeError,lu=function(t){if(Hi(t))return t;throw su(fu(t)+" is not a function")},vu=function(t,e){var r=t[e];return null==r?void 0:lu(r)},pu=Ei.TypeError,hu=Object.defineProperty,du=function(t,e){try{hu(Ei,t,{value:e,configurable:!0,writable:!0})}catch(r){Ei[t]=e}return e},yu="__core-js_shared__",gu=Ei[yu]||du(yu,{}),bu=wi((function(t){(t.exports=function(t,e){return gu[t]||(gu[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),mu=Ei.Object,wu=function(t){return mu(Yi(t))},Ou=Di({}.hasOwnProperty),Su=Object.hasOwn||function(t,e){return Ou(wu(t),e)},xu=0,Eu=Math.random(),ju=Di(1..toString),Tu=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ju(++xu+Eu,36)},Pu=bu("wks"),Au=Ei.Symbol,Ru=Au&&Au.for,ku=iu?Au:Au&&Au.withoutSetter||Tu,Lu=function(t){if(!Su(Pu,t)||!ou&&"string"!=typeof Pu[t]){var e="Symbol."+t;ou&&Su(Au,t)?Pu[t]=Au[t]:Pu[t]=iu&&Ru?Ru(e):ku(e)}return Pu[t]},Iu=Ei.TypeError,Cu=Lu("toPrimitive"),zu=function(t){var e=function(t,e){if(!Ki(t)||au(t))return t;var r,n=vu(t,Cu);if(n){if(void 0===e&&(e="default"),r=Ai(n,t,e),!Ki(r)||au(r))return r;throw Iu("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&Hi(r=t.toString)&&!Ki(n=Ai(r,t)))return n;if(Hi(r=t.valueOf)&&!Ki(n=Ai(r,t)))return n;if("string"!==e&&Hi(r=t.toString)&&!Ki(n=Ai(r,t)))return n;throw pu("Can't convert object to primitive value")}(t,e)}(t,"string");return au(e)?e:e+""},Fu=Ei.document,Mu=Ki(Fu)&&Ki(Fu.createElement),_u=function(t){return Mu?Fu.createElement(t):{}},Du=!Ti&&!ji((function(){return 7!=Object.defineProperty(_u("div"),"a",{get:function(){return 7}}).a})),Nu=Object.getOwnPropertyDescriptor,Wu={f:Ti?Nu:function(t,e){if(t=qi(t),e=zu(e),Du)try{return Nu(t,e)}catch(t){}if(Su(t,e))return Ci(!Ai(Ii.f,t,e),t[e])}},Gu=Ei.String,Bu=Ei.TypeError,Vu=function(t){if(Ki(t))return t;throw Bu(Gu(t)+" is not an object")},Xu=Ei.TypeError,Uu=Object.defineProperty,Yu={f:Ti?Uu:function(t,e,r){if(Vu(t),e=zu(e),Vu(r),Du)try{return Uu(t,e,r)}catch(t){}if("get"in r||"set"in r)throw Xu("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},qu=Ti?function(t,e,r){return Yu.f(t,e,Ci(1,r))}:function(t,e,r){return t[e]=r,t},Hu=Di(Function.toString);Hi(gu.inspectSource)||(gu.inspectSource=function(t){return Hu(t)});var Ku,$u,Ju,Qu=gu.inspectSource,Zu=Ei.WeakMap,ta=Hi(Zu)&&/native code/.test(Qu(Zu)),ea=bu("keys"),ra=function(t){return ea[t]||(ea[t]=Tu(t))},na={},oa="Object already initialized",ia=Ei.TypeError,ua=Ei.WeakMap;if(ta||gu.state){var aa=gu.state||(gu.state=new ua),ca=Di(aa.get),fa=Di(aa.has),sa=Di(aa.set);Ku=function(t,e){if(fa(aa,t))throw new ia(oa);return e.facade=t,sa(aa,t,e),e},$u=function(t){return ca(aa,t)||{}},Ju=function(t){return fa(aa,t)}}else{var la=ra("state");na[la]=!0,Ku=function(t,e){if(Su(t,la))throw new ia(oa);return e.facade=t,qu(t,la,e),e},$u=function(t){return Su(t,la)?t[la]:{}},Ju=function(t){return Su(t,la)}}var va={set:Ku,get:$u,has:Ju,enforce:function(t){return Ju(t)?$u(t):Ku(t,{})},getterFor:function(t){return function(e){var r;if(!Ki(e)||(r=$u(e)).type!==t)throw ia("Incompatible receiver, "+t+" required");return r}}},pa=Function.prototype,ha=Ti&&Object.getOwnPropertyDescriptor,da=Su(pa,"name"),ya={EXISTS:da,PROPER:da&&"something"===function(){}.name,CONFIGURABLE:da&&(!Ti||Ti&&ha(pa,"name").configurable)},ga=wi((function(t){var e=ya.CONFIGURABLE,r=va.get,n=va.enforce,o=String(String).split("String");(t.exports=function(t,r,i,u){var a,c=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet,l=u&&void 0!==u.name?u.name:r;Hi(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Su(i,"name")||e&&i.name!==l)&&qu(i,"name",l),(a=n(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==Ei?(c?!s&&t[r]&&(f=!0):delete t[r],f?t[r]=i:qu(t,r,i)):f?t[r]=i:du(r,i)})(Function.prototype,"toString",(function(){return Hi(this)&&r(this).source||Qu(this)}))})),ba=Math.ceil,ma=Math.floor,wa=function(t){var e=+t;return e!=e||0===e?0:(e>0?ma:ba)(e)},Oa=Math.max,Sa=Math.min,xa=function(t,e){var r=wa(t);return r<0?Oa(r+e,0):Sa(r,e)},Ea=Math.min,ja=function(t){return t>0?Ea(wa(t),9007199254740991):0},Ta=function(t){return ja(t.length)},Pa=function(t){return function(e,r,n){var o,i=qi(e),u=Ta(i),a=xa(n,u);if(t&&r!=r){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},Aa={includes:Pa(!0),indexOf:Pa(!1)},Ra=Aa.indexOf,ka=Di([].push),La=function(t,e){var r,n=qi(t),o=0,i=[];for(r in n)!Su(na,r)&&Su(n,r)&&ka(i,r);for(;e.length>o;)Su(n,r=e[o++])&&(~Ra(i,r)||ka(i,r));return i},Ia=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ca=Ia.concat("length","prototype"),za={f:Object.getOwnPropertyNames||function(t){return La(t,Ca)}},Fa={f:Object.getOwnPropertySymbols},Ma=Di([].concat),_a=$i("Reflect","ownKeys")||function(t){var e=za.f(Vu(t)),r=Fa.f;return r?Ma(e,r(t)):e},Da=function(t,e){for(var r=_a(e),n=Yu.f,o=Wu.f,i=0;i<r.length;i++){var u=r[i];Su(t,u)||n(t,u,o(e,u))}},Na=/#|\.prototype\./,Wa=function(t,e){var r=Ba[Ga(t)];return r==Xa||r!=Va&&(Hi(e)?ji(e):!!e)},Ga=Wa.normalize=function(t){return String(t).replace(Na,".").toLowerCase()},Ba=Wa.data={},Va=Wa.NATIVE="N",Xa=Wa.POLYFILL="P",Ua=Wa,Ya=Wu.f,qa=function(t,e){var r,n,o,i,u,a=t.target,c=t.global,f=t.stat;if(r=c?Ei:f?Ei[a]||du(a,{}):(Ei[a]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(u=Ya(r,n))&&u.value:r[n],!Ua(c?n:a+(f?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Da(i,o)}(t.sham||o&&o.sham)&&qu(i,"sham",!0),ga(r,n,i,t)}},Ha=Function.prototype,Ka=Ha.apply,$a=Ha.bind,Ja=Ha.call,Qa="object"==typeof Reflect&&Reflect.apply||($a?Ja.bind(Ka):function(){return Ja.apply(Ka,arguments)}),Za=Array.isArray||function(t){return"Array"==Gi(t)},tc={};tc[Lu("toStringTag")]="z";var ec,rc="[object z]"===String(tc),nc=Lu("toStringTag"),oc=Ei.Object,ic="Arguments"==Gi(function(){return arguments}()),uc=rc?Gi:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=oc(t),nc))?r:ic?Gi(e):"Object"==(n=Gi(e))&&Hi(e.callee)?"Arguments":n},ac=Ei.String,cc=function(t){if("Symbol"===uc(t))throw TypeError("Cannot convert a Symbol value to a string");return ac(t)},fc=Object.keys||function(t){return La(t,Ia)},sc=Ti?Object.defineProperties:function(t,e){Vu(t);for(var r,n=qi(e),o=fc(e),i=o.length,u=0;i>u;)Yu.f(t,r=o[u++],n[r]);return t},lc=$i("document","documentElement"),vc="prototype",pc="script",hc=ra("IE_PROTO"),dc=function(){},yc=function(t){return"<"+pc+">"+t+"</"+pc+">"},gc=function(t){t.write(yc("")),t.close();var e=t.parentWindow.Object;return t=null,e},bc=function(){try{ec=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;bc="undefined"!=typeof document?document.domain&&ec?gc(ec):(e=_u("iframe"),r="java"+pc+":",e.style.display="none",lc.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(yc("document.F=Object")),t.close(),t.F):gc(ec);for(var n=Ia.length;n--;)delete bc[vc][Ia[n]];return bc()};na[hc]=!0;var mc=Object.create||function(t,e){var r;return null!==t?(dc[vc]=Vu(t),r=new dc,dc[vc]=null,r[hc]=t):r=bc(),void 0===e?r:sc(r,e)},wc=function(t,e,r){var n=zu(e);n in t?Yu.f(t,n,Ci(0,r)):t[n]=r},Oc=Ei.Array,Sc=Math.max,xc=za.f,Ec="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],jc={f:function(t){return Ec&&"Window"==Gi(t)?function(t){try{return xc(t)}catch(t){return function(t){for(var e=Ta(t),r=xa(void 0,e),n=xa(e,e),o=Oc(Sc(n-r,0)),i=0;r<n;r++,i++)wc(o,i,t[r]);return o.length=i,o}(Ec)}}(t):xc(qi(t))}},Tc=Di([].slice),Pc={f:Lu},Ac=Ei,Rc=Yu.f,kc=Yu.f,Lc=Lu("toStringTag"),Ic=function(t,e,r){t&&!Su(t=r?t:t.prototype,Lc)&&kc(t,Lc,{configurable:!0,value:e})},Cc=Di(Di.bind),zc=function(t,e){return lu(t),void 0===e?t:Cc?Cc(t,e):function(){return t.apply(e,arguments)}},Fc=function(){},Mc=[],_c=$i("Reflect","construct"),Dc=/^\s*(?:class|function)\b/,Nc=Di(Dc.exec),Wc=!Dc.exec(Fc),Gc=function(t){if(!Hi(t))return!1;try{return _c(Fc,Mc,t),!0}catch(t){return!1}},Bc=!_c||ji((function(){var t;return Gc(Gc.call)||!Gc(Object)||!Gc((function(){t=!0}))||t}))?function(t){if(!Hi(t))return!1;switch(uc(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Wc||!!Nc(Dc,Qu(t))}:Gc,Vc=Lu("species"),Xc=Ei.Array,Uc=function(t,e){return new(function(t){var e;return Za(t)&&(e=t.constructor,(Bc(e)&&(e===Xc||Za(e.prototype))||Ki(e)&&null===(e=e[Vc]))&&(e=void 0)),void 0===e?Xc:e}(t))(0===e?0:e)},Yc=Di([].push),qc=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,u=7==t,a=5==t||i;return function(c,f,s,l){for(var v,p,h=wu(c),d=Xi(h),y=zc(f,s),g=Ta(d),b=0,m=l||Uc,w=e?m(c,g):r||u?m(c,0):void 0;g>b;b++)if((a||b in d)&&(p=y(v=d[b],b,h),t))if(e)w[b]=p;else if(p)switch(t){case 3:return!0;case 5:return v;case 6:return b;case 2:Yc(w,v)}else switch(t){case 4:return!1;case 7:Yc(w,v)}return i?-1:n||o?o:w}},Hc={forEach:qc(0),map:qc(1),filter:qc(2),some:qc(3),every:qc(4),find:qc(5),findIndex:qc(6),filterReject:qc(7)},Kc=Hc.forEach,$c=ra("hidden"),Jc="Symbol",Qc="prototype",Zc=Lu("toPrimitive"),tf=va.set,ef=va.getterFor(Jc),rf=Object[Qc],nf=Ei.Symbol,of=nf&&nf[Qc],uf=Ei.TypeError,af=Ei.QObject,cf=$i("JSON","stringify"),ff=Wu.f,sf=Yu.f,lf=jc.f,vf=Ii.f,pf=Di([].push),hf=bu("symbols"),df=bu("op-symbols"),yf=bu("string-to-symbol-registry"),gf=bu("symbol-to-string-registry"),bf=bu("wks"),mf=!af||!af[Qc]||!af[Qc].findChild,wf=Ti&&ji((function(){return 7!=mc(sf({},"a",{get:function(){return sf(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=ff(rf,e);n&&delete rf[e],sf(t,e,r),n&&t!==rf&&sf(rf,e,n)}:sf,Of=function(t,e){var r=hf[t]=mc(of);return tf(r,{type:Jc,tag:t,description:e}),Ti||(r.description=e),r},Sf=function(t,e,r){t===rf&&Sf(df,e,r),Vu(t);var n=zu(e);return Vu(r),Su(hf,n)?(r.enumerable?(Su(t,$c)&&t[$c][n]&&(t[$c][n]=!1),r=mc(r,{enumerable:Ci(0,!1)})):(Su(t,$c)||sf(t,$c,Ci(1,{})),t[$c][n]=!0),wf(t,n,r)):sf(t,n,r)},xf=function(t,e){Vu(t);var r=qi(e),n=fc(r).concat(Pf(r));return Kc(n,(function(e){Ti&&!Ai(Ef,r,e)||Sf(t,e,r[e])})),t},Ef=function(t){var e=zu(t),r=Ai(vf,this,e);return!(this===rf&&Su(hf,e)&&!Su(df,e))&&(!(r||!Su(this,e)||!Su(hf,e)||Su(this,$c)&&this[$c][e])||r)},jf=function(t,e){var r=qi(t),n=zu(e);if(r!==rf||!Su(hf,n)||Su(df,n)){var o=ff(r,n);return!o||!Su(hf,n)||Su(r,$c)&&r[$c][n]||(o.enumerable=!0),o}},Tf=function(t){var e=lf(qi(t)),r=[];return Kc(e,(function(t){Su(hf,t)||Su(na,t)||pf(r,t)})),r},Pf=function(t){var e=t===rf,r=lf(e?df:qi(t)),n=[];return Kc(r,(function(t){!Su(hf,t)||e&&!Su(rf,t)||pf(n,hf[t])})),n};if(ou||(of=(nf=function(){if(Ji(of,this))throw uf("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?cc(arguments[0]):void 0,e=Tu(t),r=function(t){this===rf&&Ai(r,df,t),Su(this,$c)&&Su(this[$c],e)&&(this[$c][e]=!1),wf(this,e,Ci(1,t))};return Ti&&mf&&wf(rf,e,{configurable:!0,set:r}),Of(e,t)})[Qc],ga(of,"toString",(function(){return ef(this).tag})),ga(nf,"withoutSetter",(function(t){return Of(Tu(t),t)})),Ii.f=Ef,Yu.f=Sf,Wu.f=jf,za.f=jc.f=Tf,Fa.f=Pf,Pc.f=function(t){return Of(Lu(t),t)},Ti&&(sf(of,"description",{configurable:!0,get:function(){return ef(this).description}}),ga(rf,"propertyIsEnumerable",Ef,{unsafe:!0}))),qa({global:!0,wrap:!0,forced:!ou,sham:!ou},{Symbol:nf}),Kc(fc(bf),(function(t){!function(t){var e=Ac.Symbol||(Ac.Symbol={});Su(e,t)||Rc(e,t,{value:Pc.f(t)})}(t)})),qa({target:Jc,stat:!0,forced:!ou},{for:function(t){var e=cc(t);if(Su(yf,e))return yf[e];var r=nf(e);return yf[e]=r,gf[r]=e,r},keyFor:function(t){if(!au(t))throw uf(t+" is not a symbol");if(Su(gf,t))return gf[t]},useSetter:function(){mf=!0},useSimple:function(){mf=!1}}),qa({target:"Object",stat:!0,forced:!ou,sham:!Ti},{create:function(t,e){return void 0===e?mc(t):xf(mc(t),e)},defineProperty:Sf,defineProperties:xf,getOwnPropertyDescriptor:jf}),qa({target:"Object",stat:!0,forced:!ou},{getOwnPropertyNames:Tf,getOwnPropertySymbols:Pf}),qa({target:"Object",stat:!0,forced:ji((function(){Fa.f(1)}))},{getOwnPropertySymbols:function(t){return Fa.f(wu(t))}}),cf){var Af=!ou||ji((function(){var t=nf();return"[null]"!=cf([t])||"{}"!=cf({a:t})||"{}"!=cf(Object(t))}));qa({target:"JSON",stat:!0,forced:Af},{stringify:function(t,e,r){var n=Tc(arguments),o=e;if((Ki(e)||void 0!==t)&&!au(t))return Za(e)||(e=function(t,e){if(Hi(o)&&(e=Ai(o,this,t,e)),!au(e))return e}),n[1]=e,Qa(cf,null,n)}})}if(!of[Zc]){var Rf=of.valueOf;ga(of,Zc,(function(t){return Ai(Rf,this)}))}Ic(nf,Jc),na[$c]=!0;var kf=Yu.f,Lf=Ei.Symbol,If=Lf&&Lf.prototype;if(Ti&&Hi(Lf)&&(!("description"in If)||void 0!==Lf().description)){var Cf={},zf=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:cc(arguments[0]),e=Ji(If,this)?new Lf(t):void 0===t?Lf():Lf(t);return""===t&&(Cf[e]=!0),e};Da(zf,Lf),zf.prototype=If,If.constructor=zf;var Ff="Symbol(test)"==String(Lf("test")),Mf=Di(If.toString),_f=Di(If.valueOf),Df=/^Symbol\((.*)\)[^)]+$/,Nf=Di("".replace),Wf=Di("".slice);kf(If,"description",{configurable:!0,get:function(){var t=_f(this),e=Mf(t);if(Su(Cf,t))return"";var r=Ff?Wf(e,7,-1):Nf(e,Df,"$1");return""===r?void 0:r}}),qa({global:!0,forced:!0},{Symbol:zf})}var Gf=Lu("unscopables"),Bf=Array.prototype;null==Bf[Gf]&&Yu.f(Bf,Gf,{configurable:!0,value:mc(null)});var Vf,Xf,Uf,Yf=function(t){Bf[Gf][t]=!0},qf={},Hf=!ji((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Kf=ra("IE_PROTO"),$f=Ei.Object,Jf=$f.prototype,Qf=Hf?$f.getPrototypeOf:function(t){var e=wu(t);if(Su(e,Kf))return e[Kf];var r=e.constructor;return Hi(r)&&e instanceof r?r.prototype:e instanceof $f?Jf:null},Zf=Lu("iterator"),ts=!1;[].keys&&("next"in(Uf=[].keys())?(Xf=Qf(Qf(Uf)))!==Object.prototype&&(Vf=Xf):ts=!0);var es=null==Vf||ji((function(){var t={};return Vf[Zf].call(t)!==t}));es&&(Vf={}),Hi(Vf[Zf])||ga(Vf,Zf,(function(){return this}));var rs={IteratorPrototype:Vf,BUGGY_SAFARI_ITERATORS:ts},ns=rs.IteratorPrototype,os=function(){return this},is=Ei.String,us=Ei.TypeError,as=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Di(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Vu(r),function(t){if("object"==typeof t||Hi(t))return t;throw us("Can't set "+is(t)+" as a prototype")}(n),e?t(r,n):r.__proto__=n,r}}():void 0),cs=ya.PROPER,fs=ya.CONFIGURABLE,ss=rs.IteratorPrototype,ls=rs.BUGGY_SAFARI_ITERATORS,vs=Lu("iterator"),ps="keys",hs="values",ds="entries",ys=function(){return this},gs=function(t,e,r,n,o,i,u){!function(t,e,r){var n=e+" Iterator";t.prototype=mc(ns,{next:Ci(1,r)}),Ic(t,n,!1),qf[n]=os}(r,e,n);var a,c,f,s=function(t){if(t===o&&d)return d;if(!ls&&t in p)return p[t];switch(t){case ps:case hs:case ds:return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",v=!1,p=t.prototype,h=p[vs]||p["@@iterator"]||o&&p[o],d=!ls&&h||s(o),y="Array"==e&&p.entries||h;if(y&&(a=Qf(y.call(new t)))!==Object.prototype&&a.next&&(Qf(a)!==ss&&(as?as(a,ss):Hi(a[vs])||ga(a,vs,ys)),Ic(a,l,!0)),cs&&o==hs&&h&&h.name!==hs&&(fs?qu(p,"name",hs):(v=!0,d=function(){return Ai(h,this)})),o)if(c={values:s(hs),keys:i?d:s(ps),entries:s(ds)},u)for(f in c)(ls||v||!(f in p))&&ga(p,f,c[f]);else qa({target:e,proto:!0,forced:ls||v},c);return p[vs]!==d&&ga(p,vs,d,{name:o}),qf[e]=d,c},bs="Array Iterator",ms=va.set,ws=va.getterFor(bs),Os=gs(Array,"Array",(function(t,e){ms(this,{type:bs,target:qi(t),index:0,kind:e})}),(function(){var t=ws(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");qf.Arguments=qf.Array,Yf("keys"),Yf("values"),Yf("entries");var Ss=rc?{}.toString:function(){return"[object "+uc(this)+"]"};rc||ga(Object.prototype,"toString",Ss,{unsafe:!0});var xs=Di("".charAt),Es=Di("".charCodeAt),js=Di("".slice),Ts=function(t){return function(e,r){var n,o,i=cc(Yi(e)),u=wa(r),a=i.length;return u<0||u>=a?t?"":void 0:(n=Es(i,u))<55296||n>56319||u+1===a||(o=Es(i,u+1))<56320||o>57343?t?xs(i,u):n:t?js(i,u,u+2):o-56320+(n-55296<<10)+65536}},Ps=(Ts(!1),Ts(!0)),As="String Iterator",Rs=va.set,ks=va.getterFor(As);gs(String,"String",(function(t){Rs(this,{type:As,string:cc(t),index:0})}),(function(){var t,e=ks(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Ps(r,n),e.index+=t.length,{value:t,done:!1})}));var Ls=function(t,e,r){for(var n in e)ga(t,n,e[n],r);return t},Is=ji((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Cs=Object.isExtensible,zs=ji((function(){Cs(1)}))||Is?function(t){return!!Ki(t)&&(!Is||"ArrayBuffer"!=Gi(t))&&(!Cs||Cs(t))}:Cs,Fs=!ji((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ms=wi((function(t){var e=Yu.f,r=!1,n=Tu("meta"),o=0,i=function(t){e(t,n,{value:{objectID:"O"+o++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},r=!0;var t=za.f,e=Di([].splice),o={};o[n]=1,t(o).length&&(za.f=function(r){for(var o=t(r),i=0,u=o.length;i<u;i++)if(o[i]===n){e(o,i,1);break}return o},qa({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:jc.f}))},fastKey:function(t,e){if(!Ki(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Su(t,n)){if(!zs(t))return"F";if(!e)return"E";i(t)}return t[n].objectID},getWeakData:function(t,e){if(!Su(t,n)){if(!zs(t))return!0;if(!e)return!1;i(t)}return t[n].weakData},onFreeze:function(t){return Fs&&r&&zs(t)&&!Su(t,n)&&i(t),t}};na[n]=!0})),_s=Lu("iterator"),Ds=Array.prototype,Ns=function(t){return void 0!==t&&(qf.Array===t||Ds[_s]===t)},Ws=Lu("iterator"),Gs=function(t){if(null!=t)return vu(t,Ws)||vu(t,"@@iterator")||qf[uc(t)]},Bs=Ei.TypeError,Vs=function(t,e){var r=arguments.length<2?Gs(t):e;if(lu(r))return Vu(Ai(r,t));throw Bs(fu(t)+" is not iterable")},Xs=function(t,e,r){var n,o;Vu(t);try{if(!(n=vu(t,"return"))){if("throw"===e)throw r;return r}n=Ai(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Vu(n),r},Us=Ei.TypeError,Ys=function(t,e){this.stopped=t,this.result=e},qs=Ys.prototype,Hs=function(t,e,r){var n,o,i,u,a,c,f,s=r&&r.that,l=!(!r||!r.AS_ENTRIES),v=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),h=zc(e,s),d=function(t){return n&&Xs(n,"normal",t),new Ys(!0,t)},y=function(t){return l?(Vu(t),p?h(t[0],t[1],d):h(t[0],t[1])):p?h(t,d):h(t)};if(v)n=t;else{if(!(o=Gs(t)))throw Us(fu(t)+" is not iterable");if(Ns(o)){for(i=0,u=Ta(t);u>i;i++)if((a=y(t[i]))&&Ji(qs,a))return a;return new Ys(!1)}n=Vs(t,o)}for(c=n.next;!(f=Ai(c,n)).done;){try{a=y(f.value)}catch(t){Xs(n,"throw",t)}if("object"==typeof a&&a&&Ji(qs,a))return a}return new Ys(!1)},Ks=Ei.TypeError,$s=function(t,e){if(Ji(e,t))return t;throw Ks("Incorrect invocation")},Js=Lu("iterator"),Qs=!1;try{var Zs=0,tl={next:function(){return{done:!!Zs++}},return:function(){Qs=!0}};tl[Js]=function(){return this},Array.from(tl,(function(){throw 2}))}catch(z){}var el=function(t,e){if(!e&&!Qs)return!1;var r=!1;try{var n={};n[Js]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},rl=function(t,e,r){var n=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=n?"set":"add",u=Ei[t],a=u&&u.prototype,c=u,f={},s=function(t){var e=Di(a[t]);ga(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!Ki(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return o&&!Ki(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!Ki(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(Ua(t,!Hi(u)||!(o||a.forEach&&!ji((function(){(new u).entries().next()})))))c=r.getConstructor(e,t,n,i),Ms.enable();else if(Ua(t,!0)){var l=new c,v=l[i](o?{}:-0,1)!=l,p=ji((function(){l.has(1)})),h=el((function(t){new u(t)})),d=!o&&ji((function(){for(var t=new u,e=5;e--;)t[i](e,e);return!t.has(-0)}));h||((c=e((function(t,e){$s(t,a);var r=function(t,e,r){var n,o;return as&&Hi(n=e.constructor)&&n!==r&&Ki(o=n.prototype)&&o!==r.prototype&&as(t,o),t}(new u,t,c);return null!=e&&Hs(e,r[i],{that:r,AS_ENTRIES:n}),r}))).prototype=a,a.constructor=c),(p||d)&&(s("delete"),s("has"),n&&s("get")),(d||v)&&s(i),o&&a.clear&&delete a.clear}return f[t]=c,qa({global:!0,forced:c!=u},f),Ic(c,t),o||r.setStrong(c,t,n),c},nl=Ms.getWeakData,ol=va.set,il=va.getterFor,ul=Hc.find,al=Hc.findIndex,cl=Di([].splice),fl=0,sl=function(t){return t.frozen||(t.frozen=new ll)},ll=function(){this.entries=[]},vl=function(t,e){return ul(t.entries,(function(t){return t[0]===e}))};ll.prototype={get:function(t){var e=vl(this,t);if(e)return e[1]},has:function(t){return!!vl(this,t)},set:function(t,e){var r=vl(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=al(this.entries,(function(e){return e[0]===t}));return~e&&cl(this.entries,e,1),!!~e}};var pl,hl={getConstructor:function(t,e,r,n){var o=t((function(t,o){$s(t,i),ol(t,{type:e,id:fl++,frozen:void 0}),null!=o&&Hs(o,t[n],{that:t,AS_ENTRIES:r})})),i=o.prototype,u=il(e),a=function(t,e,r){var n=u(t),o=nl(Vu(e),!0);return!0===o?sl(n).set(e,r):o[n.id]=r,t};return Ls(i,{delete:function(t){var e=u(this);if(!Ki(t))return!1;var r=nl(t);return!0===r?sl(e).delete(t):r&&Su(r,e.id)&&delete r[e.id]},has:function(t){var e=u(this);if(!Ki(t))return!1;var r=nl(t);return!0===r?sl(e).has(t):r&&Su(r,e.id)}}),Ls(i,r?{get:function(t){var e=u(this);if(Ki(t)){var r=nl(t);return!0===r?sl(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),o}},dl=va.enforce,yl=!Ei.ActiveXObject&&"ActiveXObject"in Ei,gl=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},bl=rl("WeakMap",gl,hl);if(ta&&yl){pl=hl.getConstructor(gl,"WeakMap",!0),Ms.enable();var ml=bl.prototype,wl=Di(ml.delete),Ol=Di(ml.has),Sl=Di(ml.get),xl=Di(ml.set);Ls(ml,{delete:function(t){if(Ki(t)&&!zs(t)){var e=dl(this);return e.frozen||(e.frozen=new pl),wl(this,t)||e.frozen.delete(t)}return wl(this,t)},has:function(t){if(Ki(t)&&!zs(t)){var e=dl(this);return e.frozen||(e.frozen=new pl),Ol(this,t)||e.frozen.has(t)}return Ol(this,t)},get:function(t){if(Ki(t)&&!zs(t)){var e=dl(this);return e.frozen||(e.frozen=new pl),Ol(this,t)?Sl(this,t):e.frozen.get(t)}return Sl(this,t)},set:function(t,e){if(Ki(t)&&!zs(t)){var r=dl(this);r.frozen||(r.frozen=new pl),Ol(this,t)?xl(this,t,e):r.frozen.set(t,e)}else xl(this,t,e);return this}})}rl("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),hl);var El,jl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Tl=_u("span").classList,Pl=Tl&&Tl.constructor&&Tl.constructor.prototype,Al=Pl===Object.prototype?void 0:Pl,Rl=Hc.forEach,kl=(El=[].forEach)&&ji((function(){El.call(null,(function(){throw 1}),1)}))?[].forEach:function(t){return Rl(this,t,arguments.length>1?arguments[1]:void 0)},Ll=function(t){if(t&&t.forEach!==kl)try{qu(t,"forEach",kl)}catch(e){t.forEach=kl}};for(var Il in jl)jl[Il]&&Ll(Ei[Il]&&Ei[Il].prototype);Ll(Al);var Cl=Lu("iterator"),zl=Lu("toStringTag"),Fl=Os.values,Ml=function(t,e){if(t){if(t[Cl]!==Fl)try{qu(t,Cl,Fl)}catch(e){t[Cl]=Fl}if(t[zl]||qu(t,zl,e),jl[e])for(var r in Os)if(t[r]!==Os[r])try{qu(t,r,Os[r])}catch(e){t[r]=Os[r]}}};for(var _l in jl)Ml(Ei[_l]&&Ei[_l].prototype,_l);Ml(Al,"DOMTokenList");var Dl=function(){return Dl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Dl.apply(this,arguments)};function Nl(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wl(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}function Gl(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Bl=function(t,e,r,n){try{return n?e(Vu(r)[0],r[1]):e(r)}catch(e){Xs(t,"throw",e)}},Vl=Ei.Array,Xl=!el((function(t){Array.from(t)}));qa({target:"Array",stat:!0,forced:Xl},{from:function(t){var e=wu(t),r=Bc(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=zc(o,n>2?arguments[2]:void 0));var u,a,c,f,s,l,v=Gs(e),p=0;if(!v||this==Vl&&Ns(v))for(u=Ta(e),a=r?new this(u):Vl(u);u>p;p++)l=i?o(e[p],p):e[p],wc(a,p,l);else for(s=(f=Vs(e,v)).next,a=r?new this:[];!(c=Ai(s,f)).done;p++)l=i?Bl(f,o,[c.value,p],!0):c.value,wc(a,p,l);return a.length=p,a}});var Ul=Lu("species"),Yl=function(t){return nu>=51||!ji((function(){var e=[];return(e.constructor={})[Ul]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},ql=Hc.map,Hl=Yl("map");qa({target:"Array",proto:!0,forced:!Hl},{map:function(t){return ql(this,t,arguments.length>1?arguments[1]:void 0)}});var Kl=Yl("slice"),$l=Lu("species"),Jl=Ei.Array,Ql=Math.max;qa({target:"Array",proto:!0,forced:!Kl},{slice:function(t,e){var r,n,o,i=qi(this),u=Ta(i),a=xa(t,u),c=xa(void 0===e?u:e,u);if(Za(i)&&(r=i.constructor,(Bc(r)&&(r===Jl||Za(r.prototype))||Ki(r)&&null===(r=r[$l]))&&(r=void 0),r===Jl||void 0===r))return Tc(i,a,c);for(n=new(void 0===r?Jl:r)(Ql(c-a,0)),o=0;a<c;a++,o++)a in i&&wc(n,o,i[a]);return n.length=o,n}}),qa({target:"Object",stat:!0},{fromEntries:function(t){var e={};return Hs(t,(function(t,r){wc(e,t,r)}),{AS_ENTRIES:!0}),e}});var Zl=ji((function(){fc(1)}));qa({target:"Object",stat:!0,forced:Zl},{keys:function(t){return fc(wu(t))}});var tv=Ii.f,ev=Di(tv),rv=Di([].push),nv=function(t){return function(e){for(var r,n=qi(e),o=fc(n),i=o.length,u=0,a=[];i>u;)r=o[u++],Ti&&!ev(n,r)||rv(a,t?[r,n[r]]:n[r]);return a}},ov=[nv(!0),nv(!1)][0];qa({target:"Object",stat:!0},{entries:function(t){return ov(t)}});var iv=Hc.filter,uv=Yl("filter");qa({target:"Array",proto:!0,forced:!uv},{filter:function(t){return iv(this,t,arguments.length>1?arguments[1]:void 0)}});var av=Aa.includes;qa({target:"Array",proto:!0},{includes:function(t){return av(this,t,arguments.length>1?arguments[1]:void 0)}}),Yf("includes");var cv=ya.PROPER,fv="toString",sv=RegExp.prototype,lv=sv[fv],vv=Di((function(){var t=Vu(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e})),pv=ji((function(){return"/a/b"!=lv.call({source:"a",flags:"b"})})),hv=cv&&lv.name!=fv;function dv(t){return"[object Object]"===Object.prototype.toString.call(t)}function yv(t){if(!dv(t))return!1;var e=t.constructor;if(void 0===e)return!0;var r=e.prototype;return!1!==dv(r)&&!Object.prototype.hasOwnProperty.call(r,"isPrototypeOfOf")}function gv(t,e){for(var r in t){var n=t[r],o=e[r];if(yv(n)&&yv(o)){if(!gv(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(n!==o)return!1}for(var r in e)if(void 0===t[r]&&void 0!==e[r])return!1;return!0}function bv(t){return function(t){var e,r,n,o,i=[];try{for(var u=Nl(t),a=u.next();!a.done;a=u.next()){var c=a.value;if("string"!=typeof c.insert||0!==c.insert.length){var f=i[i.length-1];f&&"string"==typeof f.insert&&"string"==typeof c.insert&&(f.attributes===c.attributes||!f.attributes==!c.attributes&&gv(null!==(n=f.attributes)&&void 0!==n?n:{},null!==(o=c.attributes)&&void 0!==o?o:{}))?f.insert+=c.insert:i.push(c)}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}return i}(t.toDelta())}function mv(t){var e=t.insert;return"string"==typeof e?e.length:1}function wv(t){return t.reduce((function(t,e){return t+mv(e)}),0)}function Ov(t,e,r){if(r<1)return[];for(var n=0,o=[],i=e+r,u=0;u<t.length&&!(n>=i);u++){var a=t[u],c=mv(a);if(n+c<=e)n+=c;else if("string"==typeof a.insert){var f=Math.max(0,e-n),s=Math.min(c,c-(n+c-i));o.push(Dl(Dl({},a),{insert:a.insert.slice(f,s)})),n+=c}else n+=c,o.push(a)}return o}function Sv(t){return function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return Object.fromEntries(Object.entries(t).filter((function(t){var r=Wl(t,1)[0];return!e.includes(r)})))}(t,l.isText(t)?"text":"children")}function xv(t){var e=t.children,r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["children"]),n=new d.XmlText;return Object.entries(r).forEach((function(t){var e=Wl(t,2),r=e[0],o=e[1];n.setAttribute(r,o)})),n.applyDelta(function(t){return t.map((function(t){return l.isText(t)?{insert:t.text,attributes:Sv(t)}:{insert:xv(t)}}))}(e),{sanitize:!1}),n}(pv||hv)&&ga(RegExp.prototype,fv,(function(){var t=Vu(this),e=cc(t.source),r=t.flags;return"/"+e+"/"+cc(void 0===r&&Ji(sv,t)&&!("flags"in sv)?vv(t):r)}),{unsafe:!0});var Ev=Lu("isConcatSpreadable"),jv=9007199254740991,Tv="Maximum allowed index exceeded",Pv=Ei.TypeError,Av=nu>=51||!ji((function(){var t=[];return t[Ev]=!1,t.concat()[0]!==t})),Rv=Yl("concat"),kv=function(t){if(!Ki(t))return!1;var e=t[Ev];return void 0!==e?!!e:Za(t)};function Lv(t){return t?l.isText(t)?t.text.length:1:0}function Iv(t,e,r){var n;if(0===r.length)throw new Error("Path has to a have a length >= 1");if(l.isText(e))throw new Error("Cannot descent into slate text");var o=Wl(r),i=o[0],u=o.slice(1),a=function(t,e){return t.children.slice(0,e).reduce((function(t,e){return t+Lv(e)}),0)}(e,i),c=e.children[i],f=bv(t),s=Lv(c),v=Ov(f,a,s);if(v.length>1)throw new Error("Path doesn't match yText, yTarget spans multiple nodes");var p=null===(n=v[0])||void 0===n?void 0:n.insert;if(u.length>0){if(!(p instanceof d.XmlText))throw new Error("Path doesn't match yText, cannot descent into non-yText");return Iv(p,c,u)}return{yParent:t,textRange:{start:a,end:a+s},yTarget:p instanceof d.XmlText?p:void 0,slateParent:e,slateTarget:c,targetDelta:v}}function Cv(t,e,r){void 0===r&&(r={});for(var n=r.assoc,o=void 0===n?0:n,i=r.insert,u=void 0!==i&&i,a=0,c=0,f=0;f<t.children.length;f++){var s=t.children[f],v=l.isText(s)?s.text.length:1;v>0&&(c=f);var p=a+v;if(v>0&&(o>=0?p>e:p>=e))return[f,e-a];a+=v}if(e>a+(u?1:0))throw new Error("yOffset out of bounds");if(u)return[t.children.length,0];var h=t.children[c];return[c,l.isText(h)?h.text.length:1]}function zv(t){return t.map((function(t){return"string"==typeof t.insert?t:Dl(Dl({},t),{insert:Fv(t.insert)})}))}function Fv(t){var e=new d.XmlText,r=t.getAttributes();return Object.entries(r).forEach((function(t){var r=Wl(t,2),n=r[0],o=r[1];e.setAttribute(n,o)})),e.applyDelta(zv(bv(t)),{sanitize:!1}),e}qa({target:"Array",proto:!0,forced:!Av||!Rv},{concat:function(t){var e,r,n,o,i,u=wu(this),a=Uc(u,0),c=0;for(e=-1,n=arguments.length;e<n;e++)if(kv(i=-1===e?u:arguments[e])){if(c+(o=Ta(i))>jv)throw Pv(Tv);for(r=0;r<o;r++,c++)r in i&&wc(a,c,i[r])}else{if(c>=jv)throw Pv(Tv);wc(a,c++,i)}return a.length=c,a}});var Mv=Object.assign,_v=Object.defineProperty,Dv=Di([].concat),Nv=!Mv||ji((function(){if(Ti&&1!==Mv({b:1},Mv(_v({},"a",{enumerable:!0,get:function(){_v(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Mv({},t)[r]||fc(Mv({},e)).join("")!=n}))?function(t,e){for(var r=wu(t),n=arguments.length,o=1,i=Fa.f,u=Ii.f;n>o;)for(var a,c=Xi(arguments[o++]),f=i?Dv(fc(c),i(c)):fc(c),s=f.length,l=0;s>l;)a=f[l++],Ti&&!Ai(u,c,a)||(r[a]=c[a]);return r}:Mv;qa({target:"Object",stat:!0,forced:Object.assign!==Nv},{assign:Nv});var Wv,Gv=Lu("match"),Bv=Ei.TypeError,Vv=Lu("match"),Xv=Wu.f,Uv=Di("".startsWith),Yv=Di("".slice),qv=Math.min,Hv=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Vv]=!1,"/./"[t](e)}catch(t){}}return!1}("startsWith"),Kv=!(Hv||(Wv=Xv(String.prototype,"startsWith"),!Wv||Wv.writable));qa({target:"String",proto:!0,forced:!Kv&&!Hv},{startsWith:function(t){var e=cc(Yi(this));!function(t){if(function(t){var e;return Ki(t)&&(void 0!==(e=t[Gv])?!!e:"RegExp"==Gi(t))}(t))throw Bv("The method doesn't accept regular expressions")}(t);var r=ja(qv(arguments.length>1?arguments[1]:void 0,e.length)),n=cc(t);return Uv?Uv(e,n,r):Yv(e,r,r+n.length)===n}});var $v=/"/g,Jv=Di("".replace);function Qv(t){if(!t.doc)throw new Error("shared type isn't attached to a document")}qa({target:"String",proto:!0,forced:ji((function(){var t="".anchor('"');return t!==t.toLowerCase()||t.split('"').length>3}))},{anchor:function(t){return e=t,r=cc(Yi(this)),n="<a",(n+=' name="'+Jv(cc(e),$v,""")+'"')+">"+r+"</a>";var e,r,n}});var Zv="__slateYjsStoredPosition_";function tp(t,e,r){var n=Iv(t,e,r.path),o=n.yTarget,i=n.yParent,u=n.textRange;if(o)throw new Error("Slate point points to a non-text element inside sharedRoot");var a=u.start+r.offset;return d.createRelativePositionFromTypeIndex(i,a,a===u.end?-1:0)}function ep(t,e,r){if(!t.doc)throw new Error("sharedRoot isn't attach to a yDoc");var n=d.createAbsolutePositionFromRelativePosition(r,t.doc);return n&&function(t,e,r){var n=r.type,o=r.index,i=r.assoc;if(!(n instanceof d.XmlText))throw new Error("Absolute position points to a non-XMLText");var u=function(t,e,r){for(var n=[r];n[0]!==t;){var o=n[0].parent;if(!o)throw new Error("yText isn't a descendant of root element");if(!(o instanceof d.XmlText))throw new Error("Unexpected y parent type");n.unshift(o)}if(n.length<2)return[];var i=e;return n.reduce((function(t,e,r){var o,u,a=n[r+1];if(!a)return t;var c=0,f=bv(e);try{for(var s=Nl(f),v=s.next();!v.done;v=s.next()){var p=v.value;if(p.insert===a)break;c+="string"==typeof p.insert?p.insert.length:1}}catch(t){o={error:t}}finally{try{v&&!v.done&&(u=s.return)&&u.call(s)}finally{if(o)throw o.error}}if(l.isText(i))throw new Error("Cannot descent into slate text");var h=Wl(Cv(i,c),1)[0];return i=i.children[h],t.concat(h)}),[])}(t,e,n),a=s.get(e,u);if(l.isText(a))throw new Error("Absolute position doesn't match slateRoot, cannot descent into text");var c=Wl(Cv(a,o,{assoc:i}),2),f=c[0],v=c[1],p=a.children[f];return l.isText(p)?{path:Gl(Gl([],Wl(u)),[f]),offset:v}:null}(t,e,n)}function rp(t,e,r){t.setAttribute(Zv+e,d.encodeRelativePosition(r))}function np(t,e,r){return Object.fromEntries(Object.entries(t).filter((function(t){var n=Wl(t,2)[1];return n.type===e&&(!r||(n.assoc>=0?n.index>=r.start&&n.index<r.end:n.index>r.start&&n.index>=r.end))})))}function op(t,e,r){var n;void 0===r&&(r="");var o=((n={})[r]=np(t,e),n);return bv(e).forEach((function(e,n){var i=e.insert;i instanceof d.XmlText&&Object.assign(o,op(t,i,r?r+"."+n:n.toString()))})),o}function ip(t,e,r,n){void 0===n&&(n=0);var o=function(t){return Qv(t),Object.fromEntries(Object.entries(t.getAttributes()).filter((function(t){return Wl(t,1)[0].startsWith(Zv)})).map((function(e){var r=Wl(e,2),n=r[0],o=r[1];return[n.slice(Zv.length),d.createAbsolutePositionFromRelativePosition(d.decodeRelativePosition(o),t.doc)]})).filter((function(t){return Wl(t,2)[1]})))}(t),i={"":np(o,e,{start:n,end:n+wv(r)})};return r.forEach((function(t,e){var r=t.insert;r instanceof d.XmlText&&Object.assign(i,op(o,r,e.toString()))})),i}function up(t,e,r,n,o,i,u){void 0===o&&(o=0),void 0===i&&(i=0),void 0===u&&(u="");var a=r[u];a&&Object.entries(a).forEach((function(r){var n=Wl(r,2),u=n[0],a=n[1];rp(t,u,d.createRelativePositionFromTypeIndex(e,a.index-i+o,a.assoc))})),n.forEach((function(e,n){var o=e.insert;o instanceof d.XmlText&&up(t,o,r,bv(o),0,0,u?u+"."+n:n.toString())}))}var ap={insert_node:function(t,e,r){var n=Iv(t,e,r.path),o=n.yParent,i=n.textRange;if(l.isText(r.node))return o.insert(i.start,r.node.text,Sv(r.node));o.insertEmbed(i.start,xv(r.node))},remove_node:function(t,e,r){var n=Iv(t,e,r.path),o=n.yParent,i=n.textRange;o.delete(i.start,i.end-i.start)},set_node:function(t,e,r){var n=Iv(t,e,r.path),o=n.yTarget,i=n.textRange,u=n.yParent;if(o)return Object.entries(r.newProperties).forEach((function(t){var e=Wl(t,2),r=e[0],n=e[1];if(null===n)return o.removeAttribute(r);o.setAttribute(r,n)})),Object.entries(r.properties).forEach((function(t){var e=Wl(t,1)[0];Object.prototype.hasOwnProperty.call(r.newProperties,e)||o.removeAttribute(e)}));var a=Object.fromEntries(Object.keys(r.properties).map((function(t){return[t,null]}))),c=Dl(Dl({},a),r.newProperties);u.format(i.start,i.end-i.start,c)},merge_node:function(t,e,r){var n=Iv(t,e,r.path),o=Iv(n.yParent,n.slateParent,v.previous(r.path.slice(-1)));if(!n.yTarget!=!o.yTarget)throw new Error("Cannot merge y text with y element");if(!o.yTarget||!n.yTarget){var i=n.yParent,u=n.textRange,a=n.slateTarget;if(!a)throw new Error("Expected Slate target node for merge op.");var c=s.get(e,v.previous(r.path));if(!l.isText(c))throw new Error("Path points to Y.Text but not a Slate text node.");var f=Sv(a),p=Sv(c),h=Object.keys(f).reduce((function(t,e){var r;return e in p?t:Dl(Dl({},t),((r={})[e]=null,r))}),{});return i.format(u.start,u.end-u.start,Dl(Dl({},h),p))}var d=o.yTarget.length,y=bv(n.yTarget),g=zv(y),b=ip(t,n.yTarget,y,d),m=Gl([{retain:d}],Wl(g));o.yTarget.applyDelta(m,{sanitize:!1}),n.yParent.delete(n.textRange.start,n.textRange.end-n.textRange.start),up(t,o.yTarget,b,g,d)},move_node:function(t,e,r){var n=v.parent(r.newPath),o=r.newPath[r.newPath.length-1],i=s.get(e,n);if(l.isText(i))throw new Error("Cannot move slate node into text element");var u=Gl(Gl([],Wl(n)),[Math.min(o,i.children.length)]),a=Iv(t,e,r.path),c=Iv(t,e,u),f=zv(a.targetDelta),p=ip(t,a.yParent,a.targetDelta);a.yParent.delete(a.textRange.start,a.textRange.end-a.textRange.start);var h=wv(bv(c.yParent)),d=Math.min(c.textRange.start,h),y=Gl([{retain:d}],Wl(f));c.yParent.applyDelta(y,{sanitize:!1}),up(t,c.yParent,p,f,d,a.textRange.start)},split_node:function(t,e,r){var n=Iv(t,e,r.path);if(!n.slateTarget)throw new Error("Y target without corresponding slate node");if(!n.yTarget){if(!l.isText(n.slateTarget))throw new Error("Mismatch node type between y target and slate node");var o={};return n.targetDelta.forEach((function(t){t.attributes&&Object.keys(t.attributes).forEach((function(t){o[t]=null}))})),n.yParent.format(n.textRange.start,n.textRange.end-n.textRange.start,Dl(Dl({},o),r.properties))}if(l.isText(n.slateTarget))throw new Error("Mismatch node type between y target and slate node");var i=Iv(n.yTarget,n.slateTarget,[r.position]),u=n.slateTarget.children.slice(0,r.position).reduce((function(t,e){return t+Lv(e)}),0),a=n.slateTarget.children.reduce((function(t,e){return t+Lv(e)}),0),c=Ov(bv(n.yTarget),u,a-u),f=zv(c),s=ip(t,n.yTarget,c,u),v=new d.XmlText;v.applyDelta(f,{sanitize:!1}),Object.entries(r.properties).forEach((function(t){var e=Wl(t,2),r=e[0],n=e[1];v.setAttribute(r,n)})),n.yTarget.delete(i.textRange.start,n.yTarget.length-i.textRange.start),n.yParent.insertEmbed(n.textRange.end,v),up(t,v,s,f,0,u)}};Dl(Dl(Dl({},{insert_text:function(t,e,r){var n=Iv(t,e,r.path),o=n.yParent,i=n.textRange,u=s.get(e,r.path);if(!l.isText(u))throw new Error("Cannot insert text into non-text node");o.insert(i.start+r.offset,r.text,Sv(u))},remove_text:function(t,e,r){var n=Iv(t,e,r.path),o=n.yParent,i=n.textRange;o.delete(i.start+r.offset,r.text.length)}}),ap),{set_selection:function(){}});var cp=new WeakMap,fp=new WeakMap,sp=new WeakSet,lp={isYjsEditor:function(t){return p.isEditor(t)&&t.sharedRoot instanceof d.XmlText&&"localOrigin"in t&&"positionStorageOrigin"in t&&"function"==typeof t.applyRemoteEvents&&"function"==typeof t.storeLocalChange&&"function"==typeof t.flushLocalChanges&&"function"==typeof t.isLocalOrigin&&"function"==typeof t.connect&&"function"==typeof t.disconnect},localChanges:function(t){var e;return null!==(e=fp.get(t))&&void 0!==e?e:[]},applyRemoteEvents:function(t,e,r){t.applyRemoteEvents(e,r)},storeLocalChange:function(t,e){t.storeLocalChange(e)},flushLocalChanges:function(t){t.flushLocalChanges()},connected:function(t){return sp.has(t)},connect:function(t){t.connect()},disconnect:function(t){t.disconnect()},isLocal:function(t){return t.isLocalOrigin(lp.origin(t))},origin:function(t){var e=cp.get(t);return void 0!==e?e:t.localOrigin},withOrigin:function(t,e,r){var n=lp.origin(t);cp.set(t,e),r(),cp.set(t,n)},storePosition:function(t,e,r){var n=t.sharedRoot,o=t.positionStorageOrigin;Qv(n);var i=tp(n,t,r);n.doc.transact((function(){rp(n,e,i)}),o)},removeStoredPosition:function(t,e){var r=t.sharedRoot,n=t.positionStorageOrigin;Qv(r),r.doc.transact((function(){!function(t,e){t.removeAttribute(Zv+e)}(r,e)}),n)},position:function(t,e){var r=function(t,e){var r=t.getAttribute(Zv+e);return r?d.decodeRelativePosition(r):null}(t.sharedRoot,e);if(r)return ep(t.sharedRoot,t,r)},storedPositionsRelative:function(t){return e=t.sharedRoot,Object.fromEntries(Object.entries(e.getAttributes()).filter((function(t){return Wl(t,1)[0].startsWith(Zv)})).map((function(t){var e=Wl(t,2),r=e[0],n=e[1];return[r.slice(Zv.length),d.createRelativePositionFromJSON(n)]})));var e}},vp=Lu("species"),pp=Yu.f,hp=Ms.fastKey,dp=va.set,yp=va.getterFor,gp={getConstructor:function(t,e,r,n){var o=t((function(t,o){$s(t,i),dp(t,{type:e,index:mc(null),first:void 0,last:void 0,size:0}),Ti||(t.size=0),null!=o&&Hs(o,t[n],{that:t,AS_ENTRIES:r})})),i=o.prototype,u=yp(e),a=function(t,e,r){var n,o,i=u(t),a=c(t,e);return a?a.value=r:(i.last=a={index:o=hp(e,!0),key:e,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=a),n&&(n.next=a),Ti?i.size++:t.size++,"F"!==o&&(i.index[o]=a)),t},c=function(t,e){var r,n=u(t),o=hp(e);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==e)return r};return Ls(i,{clear:function(){for(var t=u(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,Ti?t.size=0:this.size=0},delete:function(t){var e=this,r=u(e),n=c(e,t);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),Ti?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=u(this),n=zc(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Ls(i,r?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),Ti&&pp(i,"size",{get:function(){return u(this).size}}),o},setStrong:function(t,e,r){var n=e+" Iterator",o=yp(e),i=yp(n);gs(t,e,(function(t,e){dp(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),function(t){var e=$i(t),r=Yu.f;Ti&&e&&!e[vp]&&r(e,vp,{configurable:!0,get:function(){return this}})}(e)}};rl("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),gp);var bp=new WeakMap,mp={isCursorEditor:function(t){return lp.isYjsEditor(t)&&t.awareness&&"string"==typeof t.cursorDataField&&"string"==typeof t.selectionStateField&&"function"==typeof t.sendCursorPosition&&"function"==typeof t.sendCursorData},sendCursorPosition:function(t,e){void 0===e&&(e=t.selection),t.sendCursorPosition(e)},sendCursorData:function(t,e){t.sendCursorData(e)},on:function(t,e,r){var n;if("change"===e){var o=null!==(n=bp.get(t))&&void 0!==n?n:new Set;o.add(r),t&&bp.set(t,o)}},off:function(t,e,r){if("change"===e){var n=bp.get(t);n&&n.delete(r)}},cursorState:function(t,e){var r;if(e===t.awareness.clientID||!lp.connected(t))return null;var n=t.awareness.getStates().get(e);return n?{relativeSelection:null!==(r=n[t.selectionStateField])&&void 0!==r?r:null,data:n[t.cursorDataField],clientId:e}:null},cursorStates:function(t){return lp.connected(t)?Object.fromEntries(Array.from(t.awareness.getStates().entries(),(function(e){var r=Wl(e,2),n=r[0],o=r[1];return n!==t.awareness.clientID&&o?[n,{relativeSelection:o[t.selectionStateField],data:o[t.cursorDataField]}]:null})).filter(Array.isArray)):{}}};function wp(){var t=b();return mp.isCursorEditor(t)||console.warn("Cannot use useSyncExternalStore outside the context of a RemoteCursorEditor"),t}var Op=new WeakMap;function Sp(t){var e=Op.get(t);if(e)return e;var r=function(t){var e={},r=new Set,n=r.add.bind(r),o=new Set,i=null;return[function(e){return o.add(e),i||(i=function(t){t.added.forEach(n),t.removed.forEach(n),t.updated.forEach(n),o.forEach((function(t){return t()}))},mp.on(t,"change",i)),function(){o.delete(e),i&&0===o.size&&(mp.off(t,"change",i),i=null)}},function(){return 0===r.size?e:(r.forEach((function(r){var n=mp.cursorState(t,r);null!==n?e[r]=n:delete e[r.toString()]})),r.clear(),e=m({},e))}]}(t);return t&&Op.set(t,r),r}function xp(){return Sp(wp())}function Ep(){var t=w(xp(),2),e=t[0],r=t[1];return L.useSyncExternalStore(e,r)}function jp(t,e){var r=w(xp(),2),n=r[0],o=r[1];return G.useSyncExternalStoreWithSelector(n,o,null,t,e)}var Tp=new WeakMap;function Pp(t,e){if(!e.relativeSelection)return null;var r=Tp.get(t.children);r||(r=new WeakMap,Tp.set(t.children,r));var n=r.get(e);if(void 0===n)try{n=function(t,e,r){var n=ep(t,e,r.anchor);if(!n)return null;var o=ep(t,e,r.focus);return o?{anchor:n,focus:o}:null}(t.sharedRoot,t,e.relativeSelection),r.set(e,n)}catch(t){return null}return n}var Ap=Ct("species"),Rp=Mo.map,kp=function(t){return Tt>=51||!K((function(){var e=[];return(e.constructor={})[Ap]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("map");zr({target:"Array",proto:!0,forced:!kp},{map:function(t){return Rp(this,t,arguments.length>1?arguments[1]:void 0)}});var Lp=H(sr.f),Ip=H([].push),Cp=function(t){return function(e){for(var r,n=ot(e),o=xe(n),i=o.length,u=0,a=[];i>u;)r=o[u++],Dt&&!Lp(n,r)||Ip(a,t?[r,n[r]]:n[r]);return a}},zp={entries:Cp(!0),values:Cp(!1)}.entries;zr({target:"Object",stat:!0},{entries:function(t){return zp(t)}});var Fp=Wn.onFreeze,Mp=Object.freeze,_p=K((function(){Mp(1)}));zr({target:"Object",stat:!0,forced:_p,sham:!Nn},{freeze:function(t){return Mp&&zt(t)?Mp(Fp(t)):t}}),zr({target:"Object",stat:!0},{fromEntries:function(t){var e={};return Qn(t,(function(t,r){Rn(e,t,r)}),{AS_ENTRIES:!0}),e}});var Dp=K((function(){xe(1)}));function Np(t,e,r){var n,o,i=r.yOffset,u=r.xOffset,a=r.shouldGenerateOverlay,c=w(h.edges(e),2),f=c[0],s=c[1],d=function(t,e){try{return y.toDOMRange(t,e)}catch(t){return null}}(t,e);if(!d)return{caretPosition:null,selectionRects:[]};var g=[],b=p.nodes(t,{at:e,match:function(t,e){return l.isText(t)&&(!a||a(t,e))}}),m=null,O=h.isBackward(e);try{for(var S=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(b),x=S.next();!x.done;x=S.next()){var E=w(x.value,2),j=E[0],T=E[1],P=y.toDOMNode(t,j),A=v.equals(T,f.path),R=v.equals(T,s.path),k=null;if(A||R){var L=document.createRange();L.selectNode(P),A&&L.setStart(d.startContainer,d.startOffset),R&&L.setEnd(d.endContainer,d.endOffset),k=L.getClientRects()}else k=P.getClientRects();for(var I=O?A:R,C=0;C<k.length;C++){var z=k.item(C);if(z){var F=I&&(O?0===C:C===k.length-1),M=z.top-i,_=z.left-u;F&&(m={height:z.height,top:M,left:_+(O||h.isCollapsed(e)?0:z.width)}),g.push({width:z.width,height:z.height,top:M,left:_})}}}}catch(t){n={error:t}}finally{try{x&&!x.done&&(o=S.return)&&o.call(S)}finally{if(n)throw n.error}}return{selectionRects:g,caretPosition:m}}zr({target:"Object",stat:!0,forced:Dp},{keys:function(t){return xe(lt(t))}});var Wp=Object.freeze([]);function Gp(t){var e;void 0===t&&(t={});var r=t.containerRef,s=t.shouldGenerateOverlay,l=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["containerRef","shouldGenerateOverlay"]),v=wp(),p=Ep(),h=function(){var t=w(n((function(t){return t+1}),0),2),e=t[1],r=o(null),a=function(){r.current&&(cancelAnimationFrame(r.current),r.current=0)};return i(a),i((function(){return a}),[]),u((function(t){void 0===t&&(t=!1),t?e():r.current||(r.current=requestAnimationFrame(e))}),[])}(),d=o(new WeakMap),y=w(a({}),2),g=y[0],b=y[1],O=!("refreshOnResize"in l)||(null===(e=l.refreshOnResize)||void 0===e||e);!function(t,e){var r=o(e);r.current=e;var n=w(a((function(){return new ResizeObserver((function(){r.current()}))})),1)[0];i((function(){if(null==t?void 0:t.current){var e=t.current;return n.observe(e),function(){return n.unobserve(e)}}}),[n,t])}(O?r:void 0,(function(){d.current=new WeakMap,h("debounced"!==O)})),c((function(){var t,e,n;if(!r||r.current){var o=null===(t=null==r?void 0:r.current)||void 0===t?void 0:t.getBoundingClientRect(),i=null!==(e=null==o?void 0:o.x)&&void 0!==e?e:0,u=null!==(n=null==o?void 0:o.y)&&void 0!==n?n:0,a=Object.keys(g).length!==Object.keys(p).length,c=Object.fromEntries(Object.entries(p).map((function(t){var e=w(t,2),r=e[0],n=e[1],o=n.relativeSelection&&Pp(v,n);if(!o)return[r,Wp];var c=d.current.get(o);if(c)return[r,c];var f=Np(v,o,{xOffset:i,yOffset:u,shouldGenerateOverlay:s});return a=!0,d.current.set(o,f),[r,f]})));a&&b(c)}}));var S=f((function(){return Object.entries(p).map((function(t){var e,r,n=w(t,2),o=n[0],i=n[1],u=i.relativeSelection&&Pp(v,i),a=g[o];return m(m({},i),{range:u,caretPosition:null!==(e=null==a?void 0:a.caretPosition)&&void 0!==e?e:null,selectionRects:null!==(r=null==a?void 0:a.selectionRects)&&void 0!==r?r:Wp})}))}),[p,v,g]);return[S,u((function(){d.current=new WeakMap,h(!0)}),[h])]}export{g as EditorContext,Pp as getCursorRange,b as useEditorStatic,Gp as useRemoteCursorOverlayPositions,Ep as useRemoteCursorStates,jp as useRemoteCursorStatesSelector};
|
|
40
|
+
//# sourceMappingURL=index.esm.js.map
|