@yoopta/blockquote 1.9.9-rc → 1.9.11-rc
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.d.ts +2 -2
- package/dist/index.js +3 -3126
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3136 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
import 'react-dom';
|
|
4
|
-
import { useSelected } from 'slate-react';
|
|
5
|
-
import { Text, Range, Node, createEditor as createEditor$1, Element, Transforms } from 'slate';
|
|
6
|
-
import { randomFillSync } from 'crypto';
|
|
7
|
-
|
|
8
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
15
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
17
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
18
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
22
|
-
|
|
23
|
-
/** Used as references for various `Number` constants. */
|
|
24
|
-
var INFINITY = 1 / 0;
|
|
25
|
-
|
|
26
|
-
/** `Object#toString` result references. */
|
|
27
|
-
var funcTag = '[object Function]',
|
|
28
|
-
genTag = '[object GeneratorFunction]';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Used to match `RegExp`
|
|
32
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
33
|
-
*/
|
|
34
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
35
|
-
|
|
36
|
-
/** Used to detect host constructors (Safari). */
|
|
37
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
38
|
-
|
|
39
|
-
/** Detect free variable `global` from Node.js. */
|
|
40
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
41
|
-
|
|
42
|
-
/** Detect free variable `self`. */
|
|
43
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
44
|
-
|
|
45
|
-
/** Used as a reference to the global object. */
|
|
46
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Gets the value at `key` of `object`.
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
* @param {Object} [object] The object to query.
|
|
53
|
-
* @param {string} key The key of the property to get.
|
|
54
|
-
* @returns {*} Returns the property value.
|
|
55
|
-
*/
|
|
56
|
-
function getValue(object, key) {
|
|
57
|
-
return object == null ? undefined : object[key];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Checks if `value` is a host object in IE < 9.
|
|
62
|
-
*
|
|
63
|
-
* @private
|
|
64
|
-
* @param {*} value The value to check.
|
|
65
|
-
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
66
|
-
*/
|
|
67
|
-
function isHostObject(value) {
|
|
68
|
-
// Many host objects are `Object` objects that can coerce to strings
|
|
69
|
-
// despite having improperly defined `toString` methods.
|
|
70
|
-
var result = false;
|
|
71
|
-
if (value != null && typeof value.toString != 'function') {
|
|
72
|
-
try {
|
|
73
|
-
result = !!(value + '');
|
|
74
|
-
} catch (e) {}
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Converts `set` to an array of its values.
|
|
81
|
-
*
|
|
82
|
-
* @private
|
|
83
|
-
* @param {Object} set The set to convert.
|
|
84
|
-
* @returns {Array} Returns the values.
|
|
85
|
-
*/
|
|
86
|
-
function setToArray(set) {
|
|
87
|
-
var index = -1,
|
|
88
|
-
result = Array(set.size);
|
|
89
|
-
|
|
90
|
-
set.forEach(function(value) {
|
|
91
|
-
result[++index] = value;
|
|
92
|
-
});
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** Used for built-in method references. */
|
|
97
|
-
var funcProto = Function.prototype,
|
|
98
|
-
objectProto = Object.prototype;
|
|
99
|
-
|
|
100
|
-
/** Used to detect overreaching core-js shims. */
|
|
101
|
-
var coreJsData = root['__core-js_shared__'];
|
|
102
|
-
|
|
103
|
-
/** Used to detect methods masquerading as native. */
|
|
104
|
-
var maskSrcKey = (function() {
|
|
105
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
106
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
107
|
-
}());
|
|
108
|
-
|
|
109
|
-
/** Used to resolve the decompiled source of functions. */
|
|
110
|
-
var funcToString = funcProto.toString;
|
|
111
|
-
|
|
112
|
-
/** Used to check objects for own properties. */
|
|
113
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Used to resolve the
|
|
117
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
118
|
-
* of values.
|
|
119
|
-
*/
|
|
120
|
-
var objectToString = objectProto.toString;
|
|
121
|
-
|
|
122
|
-
/** Used to detect if a method is native. */
|
|
123
|
-
var reIsNative = RegExp('^' +
|
|
124
|
-
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
125
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
/* Built-in method references that are verified to be native. */
|
|
129
|
-
getNative(root, 'Map');
|
|
130
|
-
var Set = getNative(root, 'Set');
|
|
131
|
-
getNative(Object, 'create');
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
135
|
-
*
|
|
136
|
-
* @private
|
|
137
|
-
* @param {*} value The value to check.
|
|
138
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
139
|
-
* else `false`.
|
|
140
|
-
*/
|
|
141
|
-
function baseIsNative(value) {
|
|
142
|
-
if (!isObject$1(value) || isMasked(value)) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
146
|
-
return pattern.test(toSource(value));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Creates a set object of `values`.
|
|
151
|
-
*
|
|
152
|
-
* @private
|
|
153
|
-
* @param {Array} values The values to add to the set.
|
|
154
|
-
* @returns {Object} Returns the new set.
|
|
155
|
-
*/
|
|
156
|
-
!(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
|
|
157
|
-
return new Set(values);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Gets the native function at `key` of `object`.
|
|
162
|
-
*
|
|
163
|
-
* @private
|
|
164
|
-
* @param {Object} object The object to query.
|
|
165
|
-
* @param {string} key The key of the method to get.
|
|
166
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
167
|
-
*/
|
|
168
|
-
function getNative(object, key) {
|
|
169
|
-
var value = getValue(object, key);
|
|
170
|
-
return baseIsNative(value) ? value : undefined;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Checks if `func` has its source masked.
|
|
175
|
-
*
|
|
176
|
-
* @private
|
|
177
|
-
* @param {Function} func The function to check.
|
|
178
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
179
|
-
*/
|
|
180
|
-
function isMasked(func) {
|
|
181
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Converts `func` to its source code.
|
|
186
|
-
*
|
|
187
|
-
* @private
|
|
188
|
-
* @param {Function} func The function to process.
|
|
189
|
-
* @returns {string} Returns the source code.
|
|
190
|
-
*/
|
|
191
|
-
function toSource(func) {
|
|
192
|
-
if (func != null) {
|
|
193
|
-
try {
|
|
194
|
-
return funcToString.call(func);
|
|
195
|
-
} catch (e) {}
|
|
196
|
-
try {
|
|
197
|
-
return (func + '');
|
|
198
|
-
} catch (e) {}
|
|
199
|
-
}
|
|
200
|
-
return '';
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Checks if `value` is classified as a `Function` object.
|
|
205
|
-
*
|
|
206
|
-
* @static
|
|
207
|
-
* @memberOf _
|
|
208
|
-
* @since 0.1.0
|
|
209
|
-
* @category Lang
|
|
210
|
-
* @param {*} value The value to check.
|
|
211
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
212
|
-
* @example
|
|
213
|
-
*
|
|
214
|
-
* _.isFunction(_);
|
|
215
|
-
* // => true
|
|
216
|
-
*
|
|
217
|
-
* _.isFunction(/abc/);
|
|
218
|
-
* // => false
|
|
219
|
-
*/
|
|
220
|
-
function isFunction(value) {
|
|
221
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
222
|
-
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
223
|
-
var tag = isObject$1(value) ? objectToString.call(value) : '';
|
|
224
|
-
return tag == funcTag || tag == genTag;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Checks if `value` is the
|
|
229
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
230
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
231
|
-
*
|
|
232
|
-
* @static
|
|
233
|
-
* @memberOf _
|
|
234
|
-
* @since 0.1.0
|
|
235
|
-
* @category Lang
|
|
236
|
-
* @param {*} value The value to check.
|
|
237
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
238
|
-
* @example
|
|
239
|
-
*
|
|
240
|
-
* _.isObject({});
|
|
241
|
-
* // => true
|
|
242
|
-
*
|
|
243
|
-
* _.isObject([1, 2, 3]);
|
|
244
|
-
* // => true
|
|
245
|
-
*
|
|
246
|
-
* _.isObject(_.noop);
|
|
247
|
-
* // => true
|
|
248
|
-
*
|
|
249
|
-
* _.isObject(null);
|
|
250
|
-
* // => false
|
|
251
|
-
*/
|
|
252
|
-
function isObject$1(value) {
|
|
253
|
-
var type = typeof value;
|
|
254
|
-
return !!value && (type == 'object' || type == 'function');
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* This method returns `undefined`.
|
|
259
|
-
*
|
|
260
|
-
* @static
|
|
261
|
-
* @memberOf _
|
|
262
|
-
* @since 2.3.0
|
|
263
|
-
* @category Util
|
|
264
|
-
* @example
|
|
265
|
-
*
|
|
266
|
-
* _.times(2, _.noop);
|
|
267
|
-
* // => [undefined, undefined]
|
|
268
|
-
*/
|
|
269
|
-
function noop() {
|
|
270
|
-
// No operation performed.
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
var _YooptaPlugin_props;
|
|
274
|
-
class YooptaPlugin {
|
|
275
|
-
constructor(inputPlugin) {
|
|
276
|
-
_YooptaPlugin_props.set(this, void 0);
|
|
277
|
-
__classPrivateFieldSet(this, _YooptaPlugin_props, Object.freeze(Object.assign({}, inputPlugin)), "f");
|
|
278
|
-
}
|
|
279
|
-
extend(overrides) {
|
|
280
|
-
const { type = __classPrivateFieldGet(this, _YooptaPlugin_props, "f").type, renderer = __classPrivateFieldGet(this, _YooptaPlugin_props, "f").renderer, placeholder = __classPrivateFieldGet(this, _YooptaPlugin_props, "f").placeholder, shortcut = __classPrivateFieldGet(this, _YooptaPlugin_props, "f").shortcut, exports = __classPrivateFieldGet(this, _YooptaPlugin_props, "f").exports, events = __classPrivateFieldGet(this, _YooptaPlugin_props, "f").events, options, } = overrides;
|
|
281
|
-
const updatedProps = Object.freeze(Object.assign(Object.assign({}, __classPrivateFieldGet(this, _YooptaPlugin_props, "f")), { type,
|
|
282
|
-
renderer,
|
|
283
|
-
placeholder,
|
|
284
|
-
shortcut,
|
|
285
|
-
exports,
|
|
286
|
-
events, options: Object.assign(Object.assign({}, __classPrivateFieldGet(this, _YooptaPlugin_props, "f").options), options) }));
|
|
287
|
-
return new YooptaPlugin(updatedProps);
|
|
288
|
-
}
|
|
289
|
-
get getPlugin() {
|
|
290
|
-
return __classPrivateFieldGet(this, _YooptaPlugin_props, "f");
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
_YooptaPlugin_props = new WeakMap();
|
|
294
|
-
function createYooptaPlugin(input) {
|
|
295
|
-
return new YooptaPlugin(input);
|
|
296
|
-
}
|
|
297
|
-
// const YooptaPlugin: YooptaPlugin = (props) => {
|
|
298
|
-
// const frozenProps = Object.freeze({ ...props });
|
|
299
|
-
// const extend = (overrides: Partial<YooptaPluginType>) => YooptaPlugin(Object.freeze({ ...frozenProps, ...overrides }));
|
|
300
|
-
// const getPlugin = () => frozenProps;
|
|
301
|
-
// return {
|
|
302
|
-
// extend,
|
|
303
|
-
// getPlugin,
|
|
304
|
-
// };
|
|
305
|
-
// };
|
|
306
|
-
|
|
307
|
-
var classnamesExports = {};
|
|
308
|
-
var classnames = {
|
|
309
|
-
get exports(){ return classnamesExports; },
|
|
310
|
-
set exports(v){ classnamesExports = v; },
|
|
311
|
-
};
|
|
312
|
-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t,{memo as r}from"react";import"react-dom";import{useSelected as n}from"slate-react";import{Range as o,Node as a,Text as i,createEditor as c,Element as s,Transforms as l}from"slate";import{randomFillSync as u}from"crypto";function f(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d="[object Function]",h="[object GeneratorFunction]",y=/^\[object .+?Constructor\]$/,b="object"==typeof p&&p&&p.Object===Object&&p,g="object"==typeof self&&self&&self.Object===Object&&self,v=b||g||Function("return this")();var w,m=Function.prototype,x=Object.prototype,_=v["__core-js_shared__"],j=(w=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",O=m.toString,k=x.hasOwnProperty,E=x.toString,S=RegExp("^"+O.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");T(v,"Map");var P,A=T(v,"Set");function T(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){if(!F(e)||j&&j in e)return!1;var t=function(e){var t=F(e)?E.call(e):"";return t==d||t==h}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?S:y;return t.test(function(e){if(null!=e){try{return O.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(r)?r:void 0}function F(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}T(Object,"create"),A&&function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}(new A([,-0]))[1];class B{constructor(e){P.set(this,void 0),function(e,t,r,n,o){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,P,Object.freeze(Object.assign({},e)))}extend(e){const{type:t=f(this,P,"f").type,renderer:r=f(this,P,"f").renderer,placeholder:n=f(this,P,"f").placeholder,shortcut:o=f(this,P,"f").shortcut,exports:a=f(this,P,"f").exports,events:i=f(this,P,"f").events,options:c}=e,s=Object.freeze(Object.assign(Object.assign({},f(this,P,"f")),{type:t,renderer:r,placeholder:n,shortcut:o,exports:a,events:i,options:Object.assign(Object.assign({},f(this,P,"f").options),c)}));return new B(s)}get getPlugin(){return f(this,P,"f")}}P=new WeakMap;var L,N={};
|
|
313
2
|
/*!
|
|
314
3
|
Copyright (c) 2018 Jed Watson.
|
|
315
4
|
Licensed under the MIT License (MIT), see
|
|
316
5
|
http://jedwatson.github.io/classnames
|
|
317
|
-
*/
|
|
318
|
-
|
|
319
|
-
(function (module) {
|
|
320
|
-
/* global define */
|
|
321
|
-
|
|
322
|
-
(function () {
|
|
323
|
-
|
|
324
|
-
var hasOwn = {}.hasOwnProperty;
|
|
325
|
-
|
|
326
|
-
function classNames() {
|
|
327
|
-
var classes = [];
|
|
328
|
-
|
|
329
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
330
|
-
var arg = arguments[i];
|
|
331
|
-
if (!arg) continue;
|
|
332
|
-
|
|
333
|
-
var argType = typeof arg;
|
|
334
|
-
|
|
335
|
-
if (argType === 'string' || argType === 'number') {
|
|
336
|
-
classes.push(arg);
|
|
337
|
-
} else if (Array.isArray(arg)) {
|
|
338
|
-
if (arg.length) {
|
|
339
|
-
var inner = classNames.apply(null, arg);
|
|
340
|
-
if (inner) {
|
|
341
|
-
classes.push(inner);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
} else if (argType === 'object') {
|
|
345
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
346
|
-
classes.push(arg.toString());
|
|
347
|
-
continue;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
for (var key in arg) {
|
|
351
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
352
|
-
classes.push(key);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return classes.join(' ');
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
if (module.exports) {
|
|
362
|
-
classNames.default = classNames;
|
|
363
|
-
module.exports = classNames;
|
|
364
|
-
} else {
|
|
365
|
-
window.classNames = classNames;
|
|
366
|
-
}
|
|
367
|
-
}());
|
|
368
|
-
} (classnames));
|
|
369
|
-
|
|
370
|
-
var cx = classnamesExports;
|
|
371
|
-
|
|
372
|
-
function styleInject$1(css, ref) {
|
|
373
|
-
if ( ref === void 0 ) ref = {};
|
|
374
|
-
var insertAt = ref.insertAt;
|
|
375
|
-
|
|
376
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
377
|
-
|
|
378
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
379
|
-
var style = document.createElement('style');
|
|
380
|
-
style.type = 'text/css';
|
|
381
|
-
|
|
382
|
-
if (insertAt === 'top') {
|
|
383
|
-
if (head.firstChild) {
|
|
384
|
-
head.insertBefore(style, head.firstChild);
|
|
385
|
-
} else {
|
|
386
|
-
head.appendChild(style);
|
|
387
|
-
}
|
|
388
|
-
} else {
|
|
389
|
-
head.appendChild(style);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
if (style.styleSheet) {
|
|
393
|
-
style.styleSheet.cssText = css;
|
|
394
|
-
} else {
|
|
395
|
-
style.appendChild(document.createTextNode(css));
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
var css_248z$3 = ".Overlay-module_overlay{inset:0;overflow:hidden;pointer-events:none;position:fixed;z-index:999}.Overlay-module_content,.Overlay-module_fakeOverlay{position:relative;z-index:0}.Overlay-module_content{pointer-events:auto}.Overlay-module_fakeContent{height:100vh;left:0;position:fixed;top:0;width:100vw}.Overlay-module_body{pointer-events:auto;position:relative;top:100%}";
|
|
400
|
-
styleInject$1(css_248z$3);
|
|
401
|
-
|
|
402
|
-
var lodash_clonedeepExports = {};
|
|
403
|
-
var lodash_clonedeep = {
|
|
404
|
-
get exports(){ return lodash_clonedeepExports; },
|
|
405
|
-
set exports(v){ lodash_clonedeepExports = v; },
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
410
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
411
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
412
|
-
* Released under MIT license <https://lodash.com/license>
|
|
413
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
414
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
415
|
-
*/
|
|
416
|
-
|
|
417
|
-
(function (module, exports) {
|
|
418
|
-
/** Used as the size to enable large array optimizations. */
|
|
419
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
420
|
-
|
|
421
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
422
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
423
|
-
|
|
424
|
-
/** Used as references for various `Number` constants. */
|
|
425
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
426
|
-
|
|
427
|
-
/** `Object#toString` result references. */
|
|
428
|
-
var argsTag = '[object Arguments]',
|
|
429
|
-
arrayTag = '[object Array]',
|
|
430
|
-
boolTag = '[object Boolean]',
|
|
431
|
-
dateTag = '[object Date]',
|
|
432
|
-
errorTag = '[object Error]',
|
|
433
|
-
funcTag = '[object Function]',
|
|
434
|
-
genTag = '[object GeneratorFunction]',
|
|
435
|
-
mapTag = '[object Map]',
|
|
436
|
-
numberTag = '[object Number]',
|
|
437
|
-
objectTag = '[object Object]',
|
|
438
|
-
promiseTag = '[object Promise]',
|
|
439
|
-
regexpTag = '[object RegExp]',
|
|
440
|
-
setTag = '[object Set]',
|
|
441
|
-
stringTag = '[object String]',
|
|
442
|
-
symbolTag = '[object Symbol]',
|
|
443
|
-
weakMapTag = '[object WeakMap]';
|
|
444
|
-
|
|
445
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
446
|
-
dataViewTag = '[object DataView]',
|
|
447
|
-
float32Tag = '[object Float32Array]',
|
|
448
|
-
float64Tag = '[object Float64Array]',
|
|
449
|
-
int8Tag = '[object Int8Array]',
|
|
450
|
-
int16Tag = '[object Int16Array]',
|
|
451
|
-
int32Tag = '[object Int32Array]',
|
|
452
|
-
uint8Tag = '[object Uint8Array]',
|
|
453
|
-
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
454
|
-
uint16Tag = '[object Uint16Array]',
|
|
455
|
-
uint32Tag = '[object Uint32Array]';
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* Used to match `RegExp`
|
|
459
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
460
|
-
*/
|
|
461
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
462
|
-
|
|
463
|
-
/** Used to match `RegExp` flags from their coerced string values. */
|
|
464
|
-
var reFlags = /\w*$/;
|
|
465
|
-
|
|
466
|
-
/** Used to detect host constructors (Safari). */
|
|
467
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
468
|
-
|
|
469
|
-
/** Used to detect unsigned integer values. */
|
|
470
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
471
|
-
|
|
472
|
-
/** Used to identify `toStringTag` values supported by `_.clone`. */
|
|
473
|
-
var cloneableTags = {};
|
|
474
|
-
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
|
475
|
-
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
|
476
|
-
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
|
477
|
-
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
|
478
|
-
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
|
479
|
-
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
|
480
|
-
cloneableTags[numberTag] = cloneableTags[objectTag] =
|
|
481
|
-
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
|
482
|
-
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
|
483
|
-
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
|
484
|
-
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
485
|
-
cloneableTags[errorTag] = cloneableTags[funcTag] =
|
|
486
|
-
cloneableTags[weakMapTag] = false;
|
|
487
|
-
|
|
488
|
-
/** Detect free variable `global` from Node.js. */
|
|
489
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
490
|
-
|
|
491
|
-
/** Detect free variable `self`. */
|
|
492
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
493
|
-
|
|
494
|
-
/** Used as a reference to the global object. */
|
|
495
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
496
|
-
|
|
497
|
-
/** Detect free variable `exports`. */
|
|
498
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
499
|
-
|
|
500
|
-
/** Detect free variable `module`. */
|
|
501
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
502
|
-
|
|
503
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
504
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Adds the key-value `pair` to `map`.
|
|
508
|
-
*
|
|
509
|
-
* @private
|
|
510
|
-
* @param {Object} map The map to modify.
|
|
511
|
-
* @param {Array} pair The key-value pair to add.
|
|
512
|
-
* @returns {Object} Returns `map`.
|
|
513
|
-
*/
|
|
514
|
-
function addMapEntry(map, pair) {
|
|
515
|
-
// Don't return `map.set` because it's not chainable in IE 11.
|
|
516
|
-
map.set(pair[0], pair[1]);
|
|
517
|
-
return map;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Adds `value` to `set`.
|
|
522
|
-
*
|
|
523
|
-
* @private
|
|
524
|
-
* @param {Object} set The set to modify.
|
|
525
|
-
* @param {*} value The value to add.
|
|
526
|
-
* @returns {Object} Returns `set`.
|
|
527
|
-
*/
|
|
528
|
-
function addSetEntry(set, value) {
|
|
529
|
-
// Don't return `set.add` because it's not chainable in IE 11.
|
|
530
|
-
set.add(value);
|
|
531
|
-
return set;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* A specialized version of `_.forEach` for arrays without support for
|
|
536
|
-
* iteratee shorthands.
|
|
537
|
-
*
|
|
538
|
-
* @private
|
|
539
|
-
* @param {Array} [array] The array to iterate over.
|
|
540
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
541
|
-
* @returns {Array} Returns `array`.
|
|
542
|
-
*/
|
|
543
|
-
function arrayEach(array, iteratee) {
|
|
544
|
-
var index = -1,
|
|
545
|
-
length = array ? array.length : 0;
|
|
546
|
-
|
|
547
|
-
while (++index < length) {
|
|
548
|
-
if (iteratee(array[index], index, array) === false) {
|
|
549
|
-
break;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
return array;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* Appends the elements of `values` to `array`.
|
|
557
|
-
*
|
|
558
|
-
* @private
|
|
559
|
-
* @param {Array} array The array to modify.
|
|
560
|
-
* @param {Array} values The values to append.
|
|
561
|
-
* @returns {Array} Returns `array`.
|
|
562
|
-
*/
|
|
563
|
-
function arrayPush(array, values) {
|
|
564
|
-
var index = -1,
|
|
565
|
-
length = values.length,
|
|
566
|
-
offset = array.length;
|
|
567
|
-
|
|
568
|
-
while (++index < length) {
|
|
569
|
-
array[offset + index] = values[index];
|
|
570
|
-
}
|
|
571
|
-
return array;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* A specialized version of `_.reduce` for arrays without support for
|
|
576
|
-
* iteratee shorthands.
|
|
577
|
-
*
|
|
578
|
-
* @private
|
|
579
|
-
* @param {Array} [array] The array to iterate over.
|
|
580
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
581
|
-
* @param {*} [accumulator] The initial value.
|
|
582
|
-
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
583
|
-
* the initial value.
|
|
584
|
-
* @returns {*} Returns the accumulated value.
|
|
585
|
-
*/
|
|
586
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
587
|
-
var index = -1,
|
|
588
|
-
length = array ? array.length : 0;
|
|
589
|
-
|
|
590
|
-
if (initAccum && length) {
|
|
591
|
-
accumulator = array[++index];
|
|
592
|
-
}
|
|
593
|
-
while (++index < length) {
|
|
594
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
595
|
-
}
|
|
596
|
-
return accumulator;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* The base implementation of `_.times` without support for iteratee shorthands
|
|
601
|
-
* or max array length checks.
|
|
602
|
-
*
|
|
603
|
-
* @private
|
|
604
|
-
* @param {number} n The number of times to invoke `iteratee`.
|
|
605
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
606
|
-
* @returns {Array} Returns the array of results.
|
|
607
|
-
*/
|
|
608
|
-
function baseTimes(n, iteratee) {
|
|
609
|
-
var index = -1,
|
|
610
|
-
result = Array(n);
|
|
611
|
-
|
|
612
|
-
while (++index < n) {
|
|
613
|
-
result[index] = iteratee(index);
|
|
614
|
-
}
|
|
615
|
-
return result;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* Gets the value at `key` of `object`.
|
|
620
|
-
*
|
|
621
|
-
* @private
|
|
622
|
-
* @param {Object} [object] The object to query.
|
|
623
|
-
* @param {string} key The key of the property to get.
|
|
624
|
-
* @returns {*} Returns the property value.
|
|
625
|
-
*/
|
|
626
|
-
function getValue(object, key) {
|
|
627
|
-
return object == null ? undefined : object[key];
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
/**
|
|
631
|
-
* Checks if `value` is a host object in IE < 9.
|
|
632
|
-
*
|
|
633
|
-
* @private
|
|
634
|
-
* @param {*} value The value to check.
|
|
635
|
-
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
636
|
-
*/
|
|
637
|
-
function isHostObject(value) {
|
|
638
|
-
// Many host objects are `Object` objects that can coerce to strings
|
|
639
|
-
// despite having improperly defined `toString` methods.
|
|
640
|
-
var result = false;
|
|
641
|
-
if (value != null && typeof value.toString != 'function') {
|
|
642
|
-
try {
|
|
643
|
-
result = !!(value + '');
|
|
644
|
-
} catch (e) {}
|
|
645
|
-
}
|
|
646
|
-
return result;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Converts `map` to its key-value pairs.
|
|
651
|
-
*
|
|
652
|
-
* @private
|
|
653
|
-
* @param {Object} map The map to convert.
|
|
654
|
-
* @returns {Array} Returns the key-value pairs.
|
|
655
|
-
*/
|
|
656
|
-
function mapToArray(map) {
|
|
657
|
-
var index = -1,
|
|
658
|
-
result = Array(map.size);
|
|
659
|
-
|
|
660
|
-
map.forEach(function(value, key) {
|
|
661
|
-
result[++index] = [key, value];
|
|
662
|
-
});
|
|
663
|
-
return result;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
668
|
-
*
|
|
669
|
-
* @private
|
|
670
|
-
* @param {Function} func The function to wrap.
|
|
671
|
-
* @param {Function} transform The argument transform.
|
|
672
|
-
* @returns {Function} Returns the new function.
|
|
673
|
-
*/
|
|
674
|
-
function overArg(func, transform) {
|
|
675
|
-
return function(arg) {
|
|
676
|
-
return func(transform(arg));
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Converts `set` to an array of its values.
|
|
682
|
-
*
|
|
683
|
-
* @private
|
|
684
|
-
* @param {Object} set The set to convert.
|
|
685
|
-
* @returns {Array} Returns the values.
|
|
686
|
-
*/
|
|
687
|
-
function setToArray(set) {
|
|
688
|
-
var index = -1,
|
|
689
|
-
result = Array(set.size);
|
|
690
|
-
|
|
691
|
-
set.forEach(function(value) {
|
|
692
|
-
result[++index] = value;
|
|
693
|
-
});
|
|
694
|
-
return result;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/** Used for built-in method references. */
|
|
698
|
-
var arrayProto = Array.prototype,
|
|
699
|
-
funcProto = Function.prototype,
|
|
700
|
-
objectProto = Object.prototype;
|
|
701
|
-
|
|
702
|
-
/** Used to detect overreaching core-js shims. */
|
|
703
|
-
var coreJsData = root['__core-js_shared__'];
|
|
704
|
-
|
|
705
|
-
/** Used to detect methods masquerading as native. */
|
|
706
|
-
var maskSrcKey = (function() {
|
|
707
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
708
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
709
|
-
}());
|
|
710
|
-
|
|
711
|
-
/** Used to resolve the decompiled source of functions. */
|
|
712
|
-
var funcToString = funcProto.toString;
|
|
713
|
-
|
|
714
|
-
/** Used to check objects for own properties. */
|
|
715
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* Used to resolve the
|
|
719
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
720
|
-
* of values.
|
|
721
|
-
*/
|
|
722
|
-
var objectToString = objectProto.toString;
|
|
723
|
-
|
|
724
|
-
/** Used to detect if a method is native. */
|
|
725
|
-
var reIsNative = RegExp('^' +
|
|
726
|
-
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
727
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
728
|
-
);
|
|
729
|
-
|
|
730
|
-
/** Built-in value references. */
|
|
731
|
-
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
732
|
-
Symbol = root.Symbol,
|
|
733
|
-
Uint8Array = root.Uint8Array,
|
|
734
|
-
getPrototype = overArg(Object.getPrototypeOf, Object),
|
|
735
|
-
objectCreate = Object.create,
|
|
736
|
-
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
|
737
|
-
splice = arrayProto.splice;
|
|
738
|
-
|
|
739
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
740
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols,
|
|
741
|
-
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
|
|
742
|
-
nativeKeys = overArg(Object.keys, Object);
|
|
743
|
-
|
|
744
|
-
/* Built-in method references that are verified to be native. */
|
|
745
|
-
var DataView = getNative(root, 'DataView'),
|
|
746
|
-
Map = getNative(root, 'Map'),
|
|
747
|
-
Promise = getNative(root, 'Promise'),
|
|
748
|
-
Set = getNative(root, 'Set'),
|
|
749
|
-
WeakMap = getNative(root, 'WeakMap'),
|
|
750
|
-
nativeCreate = getNative(Object, 'create');
|
|
751
|
-
|
|
752
|
-
/** Used to detect maps, sets, and weakmaps. */
|
|
753
|
-
var dataViewCtorString = toSource(DataView),
|
|
754
|
-
mapCtorString = toSource(Map),
|
|
755
|
-
promiseCtorString = toSource(Promise),
|
|
756
|
-
setCtorString = toSource(Set),
|
|
757
|
-
weakMapCtorString = toSource(WeakMap);
|
|
758
|
-
|
|
759
|
-
/** Used to convert symbols to primitives and strings. */
|
|
760
|
-
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
761
|
-
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Creates a hash object.
|
|
765
|
-
*
|
|
766
|
-
* @private
|
|
767
|
-
* @constructor
|
|
768
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
769
|
-
*/
|
|
770
|
-
function Hash(entries) {
|
|
771
|
-
var index = -1,
|
|
772
|
-
length = entries ? entries.length : 0;
|
|
773
|
-
|
|
774
|
-
this.clear();
|
|
775
|
-
while (++index < length) {
|
|
776
|
-
var entry = entries[index];
|
|
777
|
-
this.set(entry[0], entry[1]);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* Removes all key-value entries from the hash.
|
|
783
|
-
*
|
|
784
|
-
* @private
|
|
785
|
-
* @name clear
|
|
786
|
-
* @memberOf Hash
|
|
787
|
-
*/
|
|
788
|
-
function hashClear() {
|
|
789
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
/**
|
|
793
|
-
* Removes `key` and its value from the hash.
|
|
794
|
-
*
|
|
795
|
-
* @private
|
|
796
|
-
* @name delete
|
|
797
|
-
* @memberOf Hash
|
|
798
|
-
* @param {Object} hash The hash to modify.
|
|
799
|
-
* @param {string} key The key of the value to remove.
|
|
800
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
801
|
-
*/
|
|
802
|
-
function hashDelete(key) {
|
|
803
|
-
return this.has(key) && delete this.__data__[key];
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* Gets the hash value for `key`.
|
|
808
|
-
*
|
|
809
|
-
* @private
|
|
810
|
-
* @name get
|
|
811
|
-
* @memberOf Hash
|
|
812
|
-
* @param {string} key The key of the value to get.
|
|
813
|
-
* @returns {*} Returns the entry value.
|
|
814
|
-
*/
|
|
815
|
-
function hashGet(key) {
|
|
816
|
-
var data = this.__data__;
|
|
817
|
-
if (nativeCreate) {
|
|
818
|
-
var result = data[key];
|
|
819
|
-
return result === HASH_UNDEFINED ? undefined : result;
|
|
820
|
-
}
|
|
821
|
-
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* Checks if a hash value for `key` exists.
|
|
826
|
-
*
|
|
827
|
-
* @private
|
|
828
|
-
* @name has
|
|
829
|
-
* @memberOf Hash
|
|
830
|
-
* @param {string} key The key of the entry to check.
|
|
831
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
832
|
-
*/
|
|
833
|
-
function hashHas(key) {
|
|
834
|
-
var data = this.__data__;
|
|
835
|
-
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Sets the hash `key` to `value`.
|
|
840
|
-
*
|
|
841
|
-
* @private
|
|
842
|
-
* @name set
|
|
843
|
-
* @memberOf Hash
|
|
844
|
-
* @param {string} key The key of the value to set.
|
|
845
|
-
* @param {*} value The value to set.
|
|
846
|
-
* @returns {Object} Returns the hash instance.
|
|
847
|
-
*/
|
|
848
|
-
function hashSet(key, value) {
|
|
849
|
-
var data = this.__data__;
|
|
850
|
-
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
851
|
-
return this;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
// Add methods to `Hash`.
|
|
855
|
-
Hash.prototype.clear = hashClear;
|
|
856
|
-
Hash.prototype['delete'] = hashDelete;
|
|
857
|
-
Hash.prototype.get = hashGet;
|
|
858
|
-
Hash.prototype.has = hashHas;
|
|
859
|
-
Hash.prototype.set = hashSet;
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* Creates an list cache object.
|
|
863
|
-
*
|
|
864
|
-
* @private
|
|
865
|
-
* @constructor
|
|
866
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
867
|
-
*/
|
|
868
|
-
function ListCache(entries) {
|
|
869
|
-
var index = -1,
|
|
870
|
-
length = entries ? entries.length : 0;
|
|
871
|
-
|
|
872
|
-
this.clear();
|
|
873
|
-
while (++index < length) {
|
|
874
|
-
var entry = entries[index];
|
|
875
|
-
this.set(entry[0], entry[1]);
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* Removes all key-value entries from the list cache.
|
|
881
|
-
*
|
|
882
|
-
* @private
|
|
883
|
-
* @name clear
|
|
884
|
-
* @memberOf ListCache
|
|
885
|
-
*/
|
|
886
|
-
function listCacheClear() {
|
|
887
|
-
this.__data__ = [];
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Removes `key` and its value from the list cache.
|
|
892
|
-
*
|
|
893
|
-
* @private
|
|
894
|
-
* @name delete
|
|
895
|
-
* @memberOf ListCache
|
|
896
|
-
* @param {string} key The key of the value to remove.
|
|
897
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
898
|
-
*/
|
|
899
|
-
function listCacheDelete(key) {
|
|
900
|
-
var data = this.__data__,
|
|
901
|
-
index = assocIndexOf(data, key);
|
|
902
|
-
|
|
903
|
-
if (index < 0) {
|
|
904
|
-
return false;
|
|
905
|
-
}
|
|
906
|
-
var lastIndex = data.length - 1;
|
|
907
|
-
if (index == lastIndex) {
|
|
908
|
-
data.pop();
|
|
909
|
-
} else {
|
|
910
|
-
splice.call(data, index, 1);
|
|
911
|
-
}
|
|
912
|
-
return true;
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
/**
|
|
916
|
-
* Gets the list cache value for `key`.
|
|
917
|
-
*
|
|
918
|
-
* @private
|
|
919
|
-
* @name get
|
|
920
|
-
* @memberOf ListCache
|
|
921
|
-
* @param {string} key The key of the value to get.
|
|
922
|
-
* @returns {*} Returns the entry value.
|
|
923
|
-
*/
|
|
924
|
-
function listCacheGet(key) {
|
|
925
|
-
var data = this.__data__,
|
|
926
|
-
index = assocIndexOf(data, key);
|
|
927
|
-
|
|
928
|
-
return index < 0 ? undefined : data[index][1];
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
/**
|
|
932
|
-
* Checks if a list cache value for `key` exists.
|
|
933
|
-
*
|
|
934
|
-
* @private
|
|
935
|
-
* @name has
|
|
936
|
-
* @memberOf ListCache
|
|
937
|
-
* @param {string} key The key of the entry to check.
|
|
938
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
939
|
-
*/
|
|
940
|
-
function listCacheHas(key) {
|
|
941
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* Sets the list cache `key` to `value`.
|
|
946
|
-
*
|
|
947
|
-
* @private
|
|
948
|
-
* @name set
|
|
949
|
-
* @memberOf ListCache
|
|
950
|
-
* @param {string} key The key of the value to set.
|
|
951
|
-
* @param {*} value The value to set.
|
|
952
|
-
* @returns {Object} Returns the list cache instance.
|
|
953
|
-
*/
|
|
954
|
-
function listCacheSet(key, value) {
|
|
955
|
-
var data = this.__data__,
|
|
956
|
-
index = assocIndexOf(data, key);
|
|
957
|
-
|
|
958
|
-
if (index < 0) {
|
|
959
|
-
data.push([key, value]);
|
|
960
|
-
} else {
|
|
961
|
-
data[index][1] = value;
|
|
962
|
-
}
|
|
963
|
-
return this;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
// Add methods to `ListCache`.
|
|
967
|
-
ListCache.prototype.clear = listCacheClear;
|
|
968
|
-
ListCache.prototype['delete'] = listCacheDelete;
|
|
969
|
-
ListCache.prototype.get = listCacheGet;
|
|
970
|
-
ListCache.prototype.has = listCacheHas;
|
|
971
|
-
ListCache.prototype.set = listCacheSet;
|
|
972
|
-
|
|
973
|
-
/**
|
|
974
|
-
* Creates a map cache object to store key-value pairs.
|
|
975
|
-
*
|
|
976
|
-
* @private
|
|
977
|
-
* @constructor
|
|
978
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
979
|
-
*/
|
|
980
|
-
function MapCache(entries) {
|
|
981
|
-
var index = -1,
|
|
982
|
-
length = entries ? entries.length : 0;
|
|
983
|
-
|
|
984
|
-
this.clear();
|
|
985
|
-
while (++index < length) {
|
|
986
|
-
var entry = entries[index];
|
|
987
|
-
this.set(entry[0], entry[1]);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
/**
|
|
992
|
-
* Removes all key-value entries from the map.
|
|
993
|
-
*
|
|
994
|
-
* @private
|
|
995
|
-
* @name clear
|
|
996
|
-
* @memberOf MapCache
|
|
997
|
-
*/
|
|
998
|
-
function mapCacheClear() {
|
|
999
|
-
this.__data__ = {
|
|
1000
|
-
'hash': new Hash,
|
|
1001
|
-
'map': new (Map || ListCache),
|
|
1002
|
-
'string': new Hash
|
|
1003
|
-
};
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
/**
|
|
1007
|
-
* Removes `key` and its value from the map.
|
|
1008
|
-
*
|
|
1009
|
-
* @private
|
|
1010
|
-
* @name delete
|
|
1011
|
-
* @memberOf MapCache
|
|
1012
|
-
* @param {string} key The key of the value to remove.
|
|
1013
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1014
|
-
*/
|
|
1015
|
-
function mapCacheDelete(key) {
|
|
1016
|
-
return getMapData(this, key)['delete'](key);
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
/**
|
|
1020
|
-
* Gets the map value for `key`.
|
|
1021
|
-
*
|
|
1022
|
-
* @private
|
|
1023
|
-
* @name get
|
|
1024
|
-
* @memberOf MapCache
|
|
1025
|
-
* @param {string} key The key of the value to get.
|
|
1026
|
-
* @returns {*} Returns the entry value.
|
|
1027
|
-
*/
|
|
1028
|
-
function mapCacheGet(key) {
|
|
1029
|
-
return getMapData(this, key).get(key);
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
/**
|
|
1033
|
-
* Checks if a map value for `key` exists.
|
|
1034
|
-
*
|
|
1035
|
-
* @private
|
|
1036
|
-
* @name has
|
|
1037
|
-
* @memberOf MapCache
|
|
1038
|
-
* @param {string} key The key of the entry to check.
|
|
1039
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1040
|
-
*/
|
|
1041
|
-
function mapCacheHas(key) {
|
|
1042
|
-
return getMapData(this, key).has(key);
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
/**
|
|
1046
|
-
* Sets the map `key` to `value`.
|
|
1047
|
-
*
|
|
1048
|
-
* @private
|
|
1049
|
-
* @name set
|
|
1050
|
-
* @memberOf MapCache
|
|
1051
|
-
* @param {string} key The key of the value to set.
|
|
1052
|
-
* @param {*} value The value to set.
|
|
1053
|
-
* @returns {Object} Returns the map cache instance.
|
|
1054
|
-
*/
|
|
1055
|
-
function mapCacheSet(key, value) {
|
|
1056
|
-
getMapData(this, key).set(key, value);
|
|
1057
|
-
return this;
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
// Add methods to `MapCache`.
|
|
1061
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
1062
|
-
MapCache.prototype['delete'] = mapCacheDelete;
|
|
1063
|
-
MapCache.prototype.get = mapCacheGet;
|
|
1064
|
-
MapCache.prototype.has = mapCacheHas;
|
|
1065
|
-
MapCache.prototype.set = mapCacheSet;
|
|
1066
|
-
|
|
1067
|
-
/**
|
|
1068
|
-
* Creates a stack cache object to store key-value pairs.
|
|
1069
|
-
*
|
|
1070
|
-
* @private
|
|
1071
|
-
* @constructor
|
|
1072
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1073
|
-
*/
|
|
1074
|
-
function Stack(entries) {
|
|
1075
|
-
this.__data__ = new ListCache(entries);
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
/**
|
|
1079
|
-
* Removes all key-value entries from the stack.
|
|
1080
|
-
*
|
|
1081
|
-
* @private
|
|
1082
|
-
* @name clear
|
|
1083
|
-
* @memberOf Stack
|
|
1084
|
-
*/
|
|
1085
|
-
function stackClear() {
|
|
1086
|
-
this.__data__ = new ListCache;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
/**
|
|
1090
|
-
* Removes `key` and its value from the stack.
|
|
1091
|
-
*
|
|
1092
|
-
* @private
|
|
1093
|
-
* @name delete
|
|
1094
|
-
* @memberOf Stack
|
|
1095
|
-
* @param {string} key The key of the value to remove.
|
|
1096
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1097
|
-
*/
|
|
1098
|
-
function stackDelete(key) {
|
|
1099
|
-
return this.__data__['delete'](key);
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
/**
|
|
1103
|
-
* Gets the stack value for `key`.
|
|
1104
|
-
*
|
|
1105
|
-
* @private
|
|
1106
|
-
* @name get
|
|
1107
|
-
* @memberOf Stack
|
|
1108
|
-
* @param {string} key The key of the value to get.
|
|
1109
|
-
* @returns {*} Returns the entry value.
|
|
1110
|
-
*/
|
|
1111
|
-
function stackGet(key) {
|
|
1112
|
-
return this.__data__.get(key);
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
* Checks if a stack value for `key` exists.
|
|
1117
|
-
*
|
|
1118
|
-
* @private
|
|
1119
|
-
* @name has
|
|
1120
|
-
* @memberOf Stack
|
|
1121
|
-
* @param {string} key The key of the entry to check.
|
|
1122
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1123
|
-
*/
|
|
1124
|
-
function stackHas(key) {
|
|
1125
|
-
return this.__data__.has(key);
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* Sets the stack `key` to `value`.
|
|
1130
|
-
*
|
|
1131
|
-
* @private
|
|
1132
|
-
* @name set
|
|
1133
|
-
* @memberOf Stack
|
|
1134
|
-
* @param {string} key The key of the value to set.
|
|
1135
|
-
* @param {*} value The value to set.
|
|
1136
|
-
* @returns {Object} Returns the stack cache instance.
|
|
1137
|
-
*/
|
|
1138
|
-
function stackSet(key, value) {
|
|
1139
|
-
var cache = this.__data__;
|
|
1140
|
-
if (cache instanceof ListCache) {
|
|
1141
|
-
var pairs = cache.__data__;
|
|
1142
|
-
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
1143
|
-
pairs.push([key, value]);
|
|
1144
|
-
return this;
|
|
1145
|
-
}
|
|
1146
|
-
cache = this.__data__ = new MapCache(pairs);
|
|
1147
|
-
}
|
|
1148
|
-
cache.set(key, value);
|
|
1149
|
-
return this;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
// Add methods to `Stack`.
|
|
1153
|
-
Stack.prototype.clear = stackClear;
|
|
1154
|
-
Stack.prototype['delete'] = stackDelete;
|
|
1155
|
-
Stack.prototype.get = stackGet;
|
|
1156
|
-
Stack.prototype.has = stackHas;
|
|
1157
|
-
Stack.prototype.set = stackSet;
|
|
1158
|
-
|
|
1159
|
-
/**
|
|
1160
|
-
* Creates an array of the enumerable property names of the array-like `value`.
|
|
1161
|
-
*
|
|
1162
|
-
* @private
|
|
1163
|
-
* @param {*} value The value to query.
|
|
1164
|
-
* @param {boolean} inherited Specify returning inherited property names.
|
|
1165
|
-
* @returns {Array} Returns the array of property names.
|
|
1166
|
-
*/
|
|
1167
|
-
function arrayLikeKeys(value, inherited) {
|
|
1168
|
-
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
|
1169
|
-
// Safari 9 makes `arguments.length` enumerable in strict mode.
|
|
1170
|
-
var result = (isArray(value) || isArguments(value))
|
|
1171
|
-
? baseTimes(value.length, String)
|
|
1172
|
-
: [];
|
|
1173
|
-
|
|
1174
|
-
var length = result.length,
|
|
1175
|
-
skipIndexes = !!length;
|
|
1176
|
-
|
|
1177
|
-
for (var key in value) {
|
|
1178
|
-
if ((inherited || hasOwnProperty.call(value, key)) &&
|
|
1179
|
-
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
|
|
1180
|
-
result.push(key);
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
return result;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
/**
|
|
1187
|
-
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
1188
|
-
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1189
|
-
* for equality comparisons.
|
|
1190
|
-
*
|
|
1191
|
-
* @private
|
|
1192
|
-
* @param {Object} object The object to modify.
|
|
1193
|
-
* @param {string} key The key of the property to assign.
|
|
1194
|
-
* @param {*} value The value to assign.
|
|
1195
|
-
*/
|
|
1196
|
-
function assignValue(object, key, value) {
|
|
1197
|
-
var objValue = object[key];
|
|
1198
|
-
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
|
1199
|
-
(value === undefined && !(key in object))) {
|
|
1200
|
-
object[key] = value;
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
/**
|
|
1205
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
1206
|
-
*
|
|
1207
|
-
* @private
|
|
1208
|
-
* @param {Array} array The array to inspect.
|
|
1209
|
-
* @param {*} key The key to search for.
|
|
1210
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
1211
|
-
*/
|
|
1212
|
-
function assocIndexOf(array, key) {
|
|
1213
|
-
var length = array.length;
|
|
1214
|
-
while (length--) {
|
|
1215
|
-
if (eq(array[length][0], key)) {
|
|
1216
|
-
return length;
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
return -1;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
/**
|
|
1223
|
-
* The base implementation of `_.assign` without support for multiple sources
|
|
1224
|
-
* or `customizer` functions.
|
|
1225
|
-
*
|
|
1226
|
-
* @private
|
|
1227
|
-
* @param {Object} object The destination object.
|
|
1228
|
-
* @param {Object} source The source object.
|
|
1229
|
-
* @returns {Object} Returns `object`.
|
|
1230
|
-
*/
|
|
1231
|
-
function baseAssign(object, source) {
|
|
1232
|
-
return object && copyObject(source, keys(source), object);
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
/**
|
|
1236
|
-
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
|
|
1237
|
-
* traversed objects.
|
|
1238
|
-
*
|
|
1239
|
-
* @private
|
|
1240
|
-
* @param {*} value The value to clone.
|
|
1241
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1242
|
-
* @param {boolean} [isFull] Specify a clone including symbols.
|
|
1243
|
-
* @param {Function} [customizer] The function to customize cloning.
|
|
1244
|
-
* @param {string} [key] The key of `value`.
|
|
1245
|
-
* @param {Object} [object] The parent object of `value`.
|
|
1246
|
-
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
|
|
1247
|
-
* @returns {*} Returns the cloned value.
|
|
1248
|
-
*/
|
|
1249
|
-
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
|
1250
|
-
var result;
|
|
1251
|
-
if (customizer) {
|
|
1252
|
-
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
1253
|
-
}
|
|
1254
|
-
if (result !== undefined) {
|
|
1255
|
-
return result;
|
|
1256
|
-
}
|
|
1257
|
-
if (!isObject(value)) {
|
|
1258
|
-
return value;
|
|
1259
|
-
}
|
|
1260
|
-
var isArr = isArray(value);
|
|
1261
|
-
if (isArr) {
|
|
1262
|
-
result = initCloneArray(value);
|
|
1263
|
-
if (!isDeep) {
|
|
1264
|
-
return copyArray(value, result);
|
|
1265
|
-
}
|
|
1266
|
-
} else {
|
|
1267
|
-
var tag = getTag(value),
|
|
1268
|
-
isFunc = tag == funcTag || tag == genTag;
|
|
1269
|
-
|
|
1270
|
-
if (isBuffer(value)) {
|
|
1271
|
-
return cloneBuffer(value, isDeep);
|
|
1272
|
-
}
|
|
1273
|
-
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
|
|
1274
|
-
if (isHostObject(value)) {
|
|
1275
|
-
return object ? value : {};
|
|
1276
|
-
}
|
|
1277
|
-
result = initCloneObject(isFunc ? {} : value);
|
|
1278
|
-
if (!isDeep) {
|
|
1279
|
-
return copySymbols(value, baseAssign(result, value));
|
|
1280
|
-
}
|
|
1281
|
-
} else {
|
|
1282
|
-
if (!cloneableTags[tag]) {
|
|
1283
|
-
return object ? value : {};
|
|
1284
|
-
}
|
|
1285
|
-
result = initCloneByTag(value, tag, baseClone, isDeep);
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
// Check for circular references and return its corresponding clone.
|
|
1289
|
-
stack || (stack = new Stack);
|
|
1290
|
-
var stacked = stack.get(value);
|
|
1291
|
-
if (stacked) {
|
|
1292
|
-
return stacked;
|
|
1293
|
-
}
|
|
1294
|
-
stack.set(value, result);
|
|
1295
|
-
|
|
1296
|
-
if (!isArr) {
|
|
1297
|
-
var props = isFull ? getAllKeys(value) : keys(value);
|
|
1298
|
-
}
|
|
1299
|
-
arrayEach(props || value, function(subValue, key) {
|
|
1300
|
-
if (props) {
|
|
1301
|
-
key = subValue;
|
|
1302
|
-
subValue = value[key];
|
|
1303
|
-
}
|
|
1304
|
-
// Recursively populate clone (susceptible to call stack limits).
|
|
1305
|
-
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
|
1306
|
-
});
|
|
1307
|
-
return result;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
/**
|
|
1311
|
-
* The base implementation of `_.create` without support for assigning
|
|
1312
|
-
* properties to the created object.
|
|
1313
|
-
*
|
|
1314
|
-
* @private
|
|
1315
|
-
* @param {Object} prototype The object to inherit from.
|
|
1316
|
-
* @returns {Object} Returns the new object.
|
|
1317
|
-
*/
|
|
1318
|
-
function baseCreate(proto) {
|
|
1319
|
-
return isObject(proto) ? objectCreate(proto) : {};
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
/**
|
|
1323
|
-
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
1324
|
-
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
1325
|
-
* symbols of `object`.
|
|
1326
|
-
*
|
|
1327
|
-
* @private
|
|
1328
|
-
* @param {Object} object The object to query.
|
|
1329
|
-
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
1330
|
-
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
1331
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
1332
|
-
*/
|
|
1333
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1334
|
-
var result = keysFunc(object);
|
|
1335
|
-
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
/**
|
|
1339
|
-
* The base implementation of `getTag`.
|
|
1340
|
-
*
|
|
1341
|
-
* @private
|
|
1342
|
-
* @param {*} value The value to query.
|
|
1343
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1344
|
-
*/
|
|
1345
|
-
function baseGetTag(value) {
|
|
1346
|
-
return objectToString.call(value);
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
/**
|
|
1350
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
1351
|
-
*
|
|
1352
|
-
* @private
|
|
1353
|
-
* @param {*} value The value to check.
|
|
1354
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
1355
|
-
* else `false`.
|
|
1356
|
-
*/
|
|
1357
|
-
function baseIsNative(value) {
|
|
1358
|
-
if (!isObject(value) || isMasked(value)) {
|
|
1359
|
-
return false;
|
|
1360
|
-
}
|
|
1361
|
-
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
1362
|
-
return pattern.test(toSource(value));
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
/**
|
|
1366
|
-
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
1367
|
-
*
|
|
1368
|
-
* @private
|
|
1369
|
-
* @param {Object} object The object to query.
|
|
1370
|
-
* @returns {Array} Returns the array of property names.
|
|
1371
|
-
*/
|
|
1372
|
-
function baseKeys(object) {
|
|
1373
|
-
if (!isPrototype(object)) {
|
|
1374
|
-
return nativeKeys(object);
|
|
1375
|
-
}
|
|
1376
|
-
var result = [];
|
|
1377
|
-
for (var key in Object(object)) {
|
|
1378
|
-
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
|
1379
|
-
result.push(key);
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
return result;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* Creates a clone of `buffer`.
|
|
1387
|
-
*
|
|
1388
|
-
* @private
|
|
1389
|
-
* @param {Buffer} buffer The buffer to clone.
|
|
1390
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1391
|
-
* @returns {Buffer} Returns the cloned buffer.
|
|
1392
|
-
*/
|
|
1393
|
-
function cloneBuffer(buffer, isDeep) {
|
|
1394
|
-
if (isDeep) {
|
|
1395
|
-
return buffer.slice();
|
|
1396
|
-
}
|
|
1397
|
-
var result = new buffer.constructor(buffer.length);
|
|
1398
|
-
buffer.copy(result);
|
|
1399
|
-
return result;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
/**
|
|
1403
|
-
* Creates a clone of `arrayBuffer`.
|
|
1404
|
-
*
|
|
1405
|
-
* @private
|
|
1406
|
-
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
|
1407
|
-
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
|
1408
|
-
*/
|
|
1409
|
-
function cloneArrayBuffer(arrayBuffer) {
|
|
1410
|
-
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1411
|
-
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
1412
|
-
return result;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* Creates a clone of `dataView`.
|
|
1417
|
-
*
|
|
1418
|
-
* @private
|
|
1419
|
-
* @param {Object} dataView The data view to clone.
|
|
1420
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1421
|
-
* @returns {Object} Returns the cloned data view.
|
|
1422
|
-
*/
|
|
1423
|
-
function cloneDataView(dataView, isDeep) {
|
|
1424
|
-
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
1425
|
-
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
/**
|
|
1429
|
-
* Creates a clone of `map`.
|
|
1430
|
-
*
|
|
1431
|
-
* @private
|
|
1432
|
-
* @param {Object} map The map to clone.
|
|
1433
|
-
* @param {Function} cloneFunc The function to clone values.
|
|
1434
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1435
|
-
* @returns {Object} Returns the cloned map.
|
|
1436
|
-
*/
|
|
1437
|
-
function cloneMap(map, isDeep, cloneFunc) {
|
|
1438
|
-
var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
|
|
1439
|
-
return arrayReduce(array, addMapEntry, new map.constructor);
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* Creates a clone of `regexp`.
|
|
1444
|
-
*
|
|
1445
|
-
* @private
|
|
1446
|
-
* @param {Object} regexp The regexp to clone.
|
|
1447
|
-
* @returns {Object} Returns the cloned regexp.
|
|
1448
|
-
*/
|
|
1449
|
-
function cloneRegExp(regexp) {
|
|
1450
|
-
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
1451
|
-
result.lastIndex = regexp.lastIndex;
|
|
1452
|
-
return result;
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
/**
|
|
1456
|
-
* Creates a clone of `set`.
|
|
1457
|
-
*
|
|
1458
|
-
* @private
|
|
1459
|
-
* @param {Object} set The set to clone.
|
|
1460
|
-
* @param {Function} cloneFunc The function to clone values.
|
|
1461
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1462
|
-
* @returns {Object} Returns the cloned set.
|
|
1463
|
-
*/
|
|
1464
|
-
function cloneSet(set, isDeep, cloneFunc) {
|
|
1465
|
-
var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
|
|
1466
|
-
return arrayReduce(array, addSetEntry, new set.constructor);
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
/**
|
|
1470
|
-
* Creates a clone of the `symbol` object.
|
|
1471
|
-
*
|
|
1472
|
-
* @private
|
|
1473
|
-
* @param {Object} symbol The symbol object to clone.
|
|
1474
|
-
* @returns {Object} Returns the cloned symbol object.
|
|
1475
|
-
*/
|
|
1476
|
-
function cloneSymbol(symbol) {
|
|
1477
|
-
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* Creates a clone of `typedArray`.
|
|
1482
|
-
*
|
|
1483
|
-
* @private
|
|
1484
|
-
* @param {Object} typedArray The typed array to clone.
|
|
1485
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1486
|
-
* @returns {Object} Returns the cloned typed array.
|
|
1487
|
-
*/
|
|
1488
|
-
function cloneTypedArray(typedArray, isDeep) {
|
|
1489
|
-
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
1490
|
-
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
/**
|
|
1494
|
-
* Copies the values of `source` to `array`.
|
|
1495
|
-
*
|
|
1496
|
-
* @private
|
|
1497
|
-
* @param {Array} source The array to copy values from.
|
|
1498
|
-
* @param {Array} [array=[]] The array to copy values to.
|
|
1499
|
-
* @returns {Array} Returns `array`.
|
|
1500
|
-
*/
|
|
1501
|
-
function copyArray(source, array) {
|
|
1502
|
-
var index = -1,
|
|
1503
|
-
length = source.length;
|
|
1504
|
-
|
|
1505
|
-
array || (array = Array(length));
|
|
1506
|
-
while (++index < length) {
|
|
1507
|
-
array[index] = source[index];
|
|
1508
|
-
}
|
|
1509
|
-
return array;
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
/**
|
|
1513
|
-
* Copies properties of `source` to `object`.
|
|
1514
|
-
*
|
|
1515
|
-
* @private
|
|
1516
|
-
* @param {Object} source The object to copy properties from.
|
|
1517
|
-
* @param {Array} props The property identifiers to copy.
|
|
1518
|
-
* @param {Object} [object={}] The object to copy properties to.
|
|
1519
|
-
* @param {Function} [customizer] The function to customize copied values.
|
|
1520
|
-
* @returns {Object} Returns `object`.
|
|
1521
|
-
*/
|
|
1522
|
-
function copyObject(source, props, object, customizer) {
|
|
1523
|
-
object || (object = {});
|
|
1524
|
-
|
|
1525
|
-
var index = -1,
|
|
1526
|
-
length = props.length;
|
|
1527
|
-
|
|
1528
|
-
while (++index < length) {
|
|
1529
|
-
var key = props[index];
|
|
1530
|
-
|
|
1531
|
-
var newValue = customizer
|
|
1532
|
-
? customizer(object[key], source[key], key, object, source)
|
|
1533
|
-
: undefined;
|
|
1534
|
-
|
|
1535
|
-
assignValue(object, key, newValue === undefined ? source[key] : newValue);
|
|
1536
|
-
}
|
|
1537
|
-
return object;
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
* Copies own symbol properties of `source` to `object`.
|
|
1542
|
-
*
|
|
1543
|
-
* @private
|
|
1544
|
-
* @param {Object} source The object to copy symbols from.
|
|
1545
|
-
* @param {Object} [object={}] The object to copy symbols to.
|
|
1546
|
-
* @returns {Object} Returns `object`.
|
|
1547
|
-
*/
|
|
1548
|
-
function copySymbols(source, object) {
|
|
1549
|
-
return copyObject(source, getSymbols(source), object);
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
* Creates an array of own enumerable property names and symbols of `object`.
|
|
1554
|
-
*
|
|
1555
|
-
* @private
|
|
1556
|
-
* @param {Object} object The object to query.
|
|
1557
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
1558
|
-
*/
|
|
1559
|
-
function getAllKeys(object) {
|
|
1560
|
-
return baseGetAllKeys(object, keys, getSymbols);
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
/**
|
|
1564
|
-
* Gets the data for `map`.
|
|
1565
|
-
*
|
|
1566
|
-
* @private
|
|
1567
|
-
* @param {Object} map The map to query.
|
|
1568
|
-
* @param {string} key The reference key.
|
|
1569
|
-
* @returns {*} Returns the map data.
|
|
1570
|
-
*/
|
|
1571
|
-
function getMapData(map, key) {
|
|
1572
|
-
var data = map.__data__;
|
|
1573
|
-
return isKeyable(key)
|
|
1574
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1575
|
-
: data.map;
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
/**
|
|
1579
|
-
* Gets the native function at `key` of `object`.
|
|
1580
|
-
*
|
|
1581
|
-
* @private
|
|
1582
|
-
* @param {Object} object The object to query.
|
|
1583
|
-
* @param {string} key The key of the method to get.
|
|
1584
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
1585
|
-
*/
|
|
1586
|
-
function getNative(object, key) {
|
|
1587
|
-
var value = getValue(object, key);
|
|
1588
|
-
return baseIsNative(value) ? value : undefined;
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
/**
|
|
1592
|
-
* Creates an array of the own enumerable symbol properties of `object`.
|
|
1593
|
-
*
|
|
1594
|
-
* @private
|
|
1595
|
-
* @param {Object} object The object to query.
|
|
1596
|
-
* @returns {Array} Returns the array of symbols.
|
|
1597
|
-
*/
|
|
1598
|
-
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
|
|
1599
|
-
|
|
1600
|
-
/**
|
|
1601
|
-
* Gets the `toStringTag` of `value`.
|
|
1602
|
-
*
|
|
1603
|
-
* @private
|
|
1604
|
-
* @param {*} value The value to query.
|
|
1605
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1606
|
-
*/
|
|
1607
|
-
var getTag = baseGetTag;
|
|
1608
|
-
|
|
1609
|
-
// Fallback for data views, maps, sets, and weak maps in IE 11,
|
|
1610
|
-
// for data views in Edge < 14, and promises in Node.js.
|
|
1611
|
-
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
1612
|
-
(Map && getTag(new Map) != mapTag) ||
|
|
1613
|
-
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
|
1614
|
-
(Set && getTag(new Set) != setTag) ||
|
|
1615
|
-
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
|
1616
|
-
getTag = function(value) {
|
|
1617
|
-
var result = objectToString.call(value),
|
|
1618
|
-
Ctor = result == objectTag ? value.constructor : undefined,
|
|
1619
|
-
ctorString = Ctor ? toSource(Ctor) : undefined;
|
|
1620
|
-
|
|
1621
|
-
if (ctorString) {
|
|
1622
|
-
switch (ctorString) {
|
|
1623
|
-
case dataViewCtorString: return dataViewTag;
|
|
1624
|
-
case mapCtorString: return mapTag;
|
|
1625
|
-
case promiseCtorString: return promiseTag;
|
|
1626
|
-
case setCtorString: return setTag;
|
|
1627
|
-
case weakMapCtorString: return weakMapTag;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
return result;
|
|
1631
|
-
};
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
/**
|
|
1635
|
-
* Initializes an array clone.
|
|
1636
|
-
*
|
|
1637
|
-
* @private
|
|
1638
|
-
* @param {Array} array The array to clone.
|
|
1639
|
-
* @returns {Array} Returns the initialized clone.
|
|
1640
|
-
*/
|
|
1641
|
-
function initCloneArray(array) {
|
|
1642
|
-
var length = array.length,
|
|
1643
|
-
result = array.constructor(length);
|
|
1644
|
-
|
|
1645
|
-
// Add properties assigned by `RegExp#exec`.
|
|
1646
|
-
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
|
1647
|
-
result.index = array.index;
|
|
1648
|
-
result.input = array.input;
|
|
1649
|
-
}
|
|
1650
|
-
return result;
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
/**
|
|
1654
|
-
* Initializes an object clone.
|
|
1655
|
-
*
|
|
1656
|
-
* @private
|
|
1657
|
-
* @param {Object} object The object to clone.
|
|
1658
|
-
* @returns {Object} Returns the initialized clone.
|
|
1659
|
-
*/
|
|
1660
|
-
function initCloneObject(object) {
|
|
1661
|
-
return (typeof object.constructor == 'function' && !isPrototype(object))
|
|
1662
|
-
? baseCreate(getPrototype(object))
|
|
1663
|
-
: {};
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
/**
|
|
1667
|
-
* Initializes an object clone based on its `toStringTag`.
|
|
1668
|
-
*
|
|
1669
|
-
* **Note:** This function only supports cloning values with tags of
|
|
1670
|
-
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
1671
|
-
*
|
|
1672
|
-
* @private
|
|
1673
|
-
* @param {Object} object The object to clone.
|
|
1674
|
-
* @param {string} tag The `toStringTag` of the object to clone.
|
|
1675
|
-
* @param {Function} cloneFunc The function to clone values.
|
|
1676
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1677
|
-
* @returns {Object} Returns the initialized clone.
|
|
1678
|
-
*/
|
|
1679
|
-
function initCloneByTag(object, tag, cloneFunc, isDeep) {
|
|
1680
|
-
var Ctor = object.constructor;
|
|
1681
|
-
switch (tag) {
|
|
1682
|
-
case arrayBufferTag:
|
|
1683
|
-
return cloneArrayBuffer(object);
|
|
1684
|
-
|
|
1685
|
-
case boolTag:
|
|
1686
|
-
case dateTag:
|
|
1687
|
-
return new Ctor(+object);
|
|
1688
|
-
|
|
1689
|
-
case dataViewTag:
|
|
1690
|
-
return cloneDataView(object, isDeep);
|
|
1691
|
-
|
|
1692
|
-
case float32Tag: case float64Tag:
|
|
1693
|
-
case int8Tag: case int16Tag: case int32Tag:
|
|
1694
|
-
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
|
|
1695
|
-
return cloneTypedArray(object, isDeep);
|
|
1696
|
-
|
|
1697
|
-
case mapTag:
|
|
1698
|
-
return cloneMap(object, isDeep, cloneFunc);
|
|
1699
|
-
|
|
1700
|
-
case numberTag:
|
|
1701
|
-
case stringTag:
|
|
1702
|
-
return new Ctor(object);
|
|
1703
|
-
|
|
1704
|
-
case regexpTag:
|
|
1705
|
-
return cloneRegExp(object);
|
|
1706
|
-
|
|
1707
|
-
case setTag:
|
|
1708
|
-
return cloneSet(object, isDeep, cloneFunc);
|
|
1709
|
-
|
|
1710
|
-
case symbolTag:
|
|
1711
|
-
return cloneSymbol(object);
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
/**
|
|
1716
|
-
* Checks if `value` is a valid array-like index.
|
|
1717
|
-
*
|
|
1718
|
-
* @private
|
|
1719
|
-
* @param {*} value The value to check.
|
|
1720
|
-
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
1721
|
-
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1722
|
-
*/
|
|
1723
|
-
function isIndex(value, length) {
|
|
1724
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
1725
|
-
return !!length &&
|
|
1726
|
-
(typeof value == 'number' || reIsUint.test(value)) &&
|
|
1727
|
-
(value > -1 && value % 1 == 0 && value < length);
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
/**
|
|
1731
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
1732
|
-
*
|
|
1733
|
-
* @private
|
|
1734
|
-
* @param {*} value The value to check.
|
|
1735
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
1736
|
-
*/
|
|
1737
|
-
function isKeyable(value) {
|
|
1738
|
-
var type = typeof value;
|
|
1739
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
1740
|
-
? (value !== '__proto__')
|
|
1741
|
-
: (value === null);
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
/**
|
|
1745
|
-
* Checks if `func` has its source masked.
|
|
1746
|
-
*
|
|
1747
|
-
* @private
|
|
1748
|
-
* @param {Function} func The function to check.
|
|
1749
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1750
|
-
*/
|
|
1751
|
-
function isMasked(func) {
|
|
1752
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
/**
|
|
1756
|
-
* Checks if `value` is likely a prototype object.
|
|
1757
|
-
*
|
|
1758
|
-
* @private
|
|
1759
|
-
* @param {*} value The value to check.
|
|
1760
|
-
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1761
|
-
*/
|
|
1762
|
-
function isPrototype(value) {
|
|
1763
|
-
var Ctor = value && value.constructor,
|
|
1764
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
1765
|
-
|
|
1766
|
-
return value === proto;
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
/**
|
|
1770
|
-
* Converts `func` to its source code.
|
|
1771
|
-
*
|
|
1772
|
-
* @private
|
|
1773
|
-
* @param {Function} func The function to process.
|
|
1774
|
-
* @returns {string} Returns the source code.
|
|
1775
|
-
*/
|
|
1776
|
-
function toSource(func) {
|
|
1777
|
-
if (func != null) {
|
|
1778
|
-
try {
|
|
1779
|
-
return funcToString.call(func);
|
|
1780
|
-
} catch (e) {}
|
|
1781
|
-
try {
|
|
1782
|
-
return (func + '');
|
|
1783
|
-
} catch (e) {}
|
|
1784
|
-
}
|
|
1785
|
-
return '';
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
/**
|
|
1789
|
-
* This method is like `_.clone` except that it recursively clones `value`.
|
|
1790
|
-
*
|
|
1791
|
-
* @static
|
|
1792
|
-
* @memberOf _
|
|
1793
|
-
* @since 1.0.0
|
|
1794
|
-
* @category Lang
|
|
1795
|
-
* @param {*} value The value to recursively clone.
|
|
1796
|
-
* @returns {*} Returns the deep cloned value.
|
|
1797
|
-
* @see _.clone
|
|
1798
|
-
* @example
|
|
1799
|
-
*
|
|
1800
|
-
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
|
1801
|
-
*
|
|
1802
|
-
* var deep = _.cloneDeep(objects);
|
|
1803
|
-
* console.log(deep[0] === objects[0]);
|
|
1804
|
-
* // => false
|
|
1805
|
-
*/
|
|
1806
|
-
function cloneDeep(value) {
|
|
1807
|
-
return baseClone(value, true, true);
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
/**
|
|
1811
|
-
* Performs a
|
|
1812
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1813
|
-
* comparison between two values to determine if they are equivalent.
|
|
1814
|
-
*
|
|
1815
|
-
* @static
|
|
1816
|
-
* @memberOf _
|
|
1817
|
-
* @since 4.0.0
|
|
1818
|
-
* @category Lang
|
|
1819
|
-
* @param {*} value The value to compare.
|
|
1820
|
-
* @param {*} other The other value to compare.
|
|
1821
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1822
|
-
* @example
|
|
1823
|
-
*
|
|
1824
|
-
* var object = { 'a': 1 };
|
|
1825
|
-
* var other = { 'a': 1 };
|
|
1826
|
-
*
|
|
1827
|
-
* _.eq(object, object);
|
|
1828
|
-
* // => true
|
|
1829
|
-
*
|
|
1830
|
-
* _.eq(object, other);
|
|
1831
|
-
* // => false
|
|
1832
|
-
*
|
|
1833
|
-
* _.eq('a', 'a');
|
|
1834
|
-
* // => true
|
|
1835
|
-
*
|
|
1836
|
-
* _.eq('a', Object('a'));
|
|
1837
|
-
* // => false
|
|
1838
|
-
*
|
|
1839
|
-
* _.eq(NaN, NaN);
|
|
1840
|
-
* // => true
|
|
1841
|
-
*/
|
|
1842
|
-
function eq(value, other) {
|
|
1843
|
-
return value === other || (value !== value && other !== other);
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
/**
|
|
1847
|
-
* Checks if `value` is likely an `arguments` object.
|
|
1848
|
-
*
|
|
1849
|
-
* @static
|
|
1850
|
-
* @memberOf _
|
|
1851
|
-
* @since 0.1.0
|
|
1852
|
-
* @category Lang
|
|
1853
|
-
* @param {*} value The value to check.
|
|
1854
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1855
|
-
* else `false`.
|
|
1856
|
-
* @example
|
|
1857
|
-
*
|
|
1858
|
-
* _.isArguments(function() { return arguments; }());
|
|
1859
|
-
* // => true
|
|
1860
|
-
*
|
|
1861
|
-
* _.isArguments([1, 2, 3]);
|
|
1862
|
-
* // => false
|
|
1863
|
-
*/
|
|
1864
|
-
function isArguments(value) {
|
|
1865
|
-
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
|
1866
|
-
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
|
1867
|
-
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
/**
|
|
1871
|
-
* Checks if `value` is classified as an `Array` object.
|
|
1872
|
-
*
|
|
1873
|
-
* @static
|
|
1874
|
-
* @memberOf _
|
|
1875
|
-
* @since 0.1.0
|
|
1876
|
-
* @category Lang
|
|
1877
|
-
* @param {*} value The value to check.
|
|
1878
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1879
|
-
* @example
|
|
1880
|
-
*
|
|
1881
|
-
* _.isArray([1, 2, 3]);
|
|
1882
|
-
* // => true
|
|
1883
|
-
*
|
|
1884
|
-
* _.isArray(document.body.children);
|
|
1885
|
-
* // => false
|
|
1886
|
-
*
|
|
1887
|
-
* _.isArray('abc');
|
|
1888
|
-
* // => false
|
|
1889
|
-
*
|
|
1890
|
-
* _.isArray(_.noop);
|
|
1891
|
-
* // => false
|
|
1892
|
-
*/
|
|
1893
|
-
var isArray = Array.isArray;
|
|
1894
|
-
|
|
1895
|
-
/**
|
|
1896
|
-
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
1897
|
-
* not a function and has a `value.length` that's an integer greater than or
|
|
1898
|
-
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
1899
|
-
*
|
|
1900
|
-
* @static
|
|
1901
|
-
* @memberOf _
|
|
1902
|
-
* @since 4.0.0
|
|
1903
|
-
* @category Lang
|
|
1904
|
-
* @param {*} value The value to check.
|
|
1905
|
-
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
1906
|
-
* @example
|
|
1907
|
-
*
|
|
1908
|
-
* _.isArrayLike([1, 2, 3]);
|
|
1909
|
-
* // => true
|
|
1910
|
-
*
|
|
1911
|
-
* _.isArrayLike(document.body.children);
|
|
1912
|
-
* // => true
|
|
1913
|
-
*
|
|
1914
|
-
* _.isArrayLike('abc');
|
|
1915
|
-
* // => true
|
|
1916
|
-
*
|
|
1917
|
-
* _.isArrayLike(_.noop);
|
|
1918
|
-
* // => false
|
|
1919
|
-
*/
|
|
1920
|
-
function isArrayLike(value) {
|
|
1921
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
/**
|
|
1925
|
-
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
1926
|
-
* is an object.
|
|
1927
|
-
*
|
|
1928
|
-
* @static
|
|
1929
|
-
* @memberOf _
|
|
1930
|
-
* @since 4.0.0
|
|
1931
|
-
* @category Lang
|
|
1932
|
-
* @param {*} value The value to check.
|
|
1933
|
-
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
1934
|
-
* else `false`.
|
|
1935
|
-
* @example
|
|
1936
|
-
*
|
|
1937
|
-
* _.isArrayLikeObject([1, 2, 3]);
|
|
1938
|
-
* // => true
|
|
1939
|
-
*
|
|
1940
|
-
* _.isArrayLikeObject(document.body.children);
|
|
1941
|
-
* // => true
|
|
1942
|
-
*
|
|
1943
|
-
* _.isArrayLikeObject('abc');
|
|
1944
|
-
* // => false
|
|
1945
|
-
*
|
|
1946
|
-
* _.isArrayLikeObject(_.noop);
|
|
1947
|
-
* // => false
|
|
1948
|
-
*/
|
|
1949
|
-
function isArrayLikeObject(value) {
|
|
1950
|
-
return isObjectLike(value) && isArrayLike(value);
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
/**
|
|
1954
|
-
* Checks if `value` is a buffer.
|
|
1955
|
-
*
|
|
1956
|
-
* @static
|
|
1957
|
-
* @memberOf _
|
|
1958
|
-
* @since 4.3.0
|
|
1959
|
-
* @category Lang
|
|
1960
|
-
* @param {*} value The value to check.
|
|
1961
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
1962
|
-
* @example
|
|
1963
|
-
*
|
|
1964
|
-
* _.isBuffer(new Buffer(2));
|
|
1965
|
-
* // => true
|
|
1966
|
-
*
|
|
1967
|
-
* _.isBuffer(new Uint8Array(2));
|
|
1968
|
-
* // => false
|
|
1969
|
-
*/
|
|
1970
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
1971
|
-
|
|
1972
|
-
/**
|
|
1973
|
-
* Checks if `value` is classified as a `Function` object.
|
|
1974
|
-
*
|
|
1975
|
-
* @static
|
|
1976
|
-
* @memberOf _
|
|
1977
|
-
* @since 0.1.0
|
|
1978
|
-
* @category Lang
|
|
1979
|
-
* @param {*} value The value to check.
|
|
1980
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
1981
|
-
* @example
|
|
1982
|
-
*
|
|
1983
|
-
* _.isFunction(_);
|
|
1984
|
-
* // => true
|
|
1985
|
-
*
|
|
1986
|
-
* _.isFunction(/abc/);
|
|
1987
|
-
* // => false
|
|
1988
|
-
*/
|
|
1989
|
-
function isFunction(value) {
|
|
1990
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
1991
|
-
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
1992
|
-
var tag = isObject(value) ? objectToString.call(value) : '';
|
|
1993
|
-
return tag == funcTag || tag == genTag;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
/**
|
|
1997
|
-
* Checks if `value` is a valid array-like length.
|
|
1998
|
-
*
|
|
1999
|
-
* **Note:** This method is loosely based on
|
|
2000
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
2001
|
-
*
|
|
2002
|
-
* @static
|
|
2003
|
-
* @memberOf _
|
|
2004
|
-
* @since 4.0.0
|
|
2005
|
-
* @category Lang
|
|
2006
|
-
* @param {*} value The value to check.
|
|
2007
|
-
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
2008
|
-
* @example
|
|
2009
|
-
*
|
|
2010
|
-
* _.isLength(3);
|
|
2011
|
-
* // => true
|
|
2012
|
-
*
|
|
2013
|
-
* _.isLength(Number.MIN_VALUE);
|
|
2014
|
-
* // => false
|
|
2015
|
-
*
|
|
2016
|
-
* _.isLength(Infinity);
|
|
2017
|
-
* // => false
|
|
2018
|
-
*
|
|
2019
|
-
* _.isLength('3');
|
|
2020
|
-
* // => false
|
|
2021
|
-
*/
|
|
2022
|
-
function isLength(value) {
|
|
2023
|
-
return typeof value == 'number' &&
|
|
2024
|
-
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
/**
|
|
2028
|
-
* Checks if `value` is the
|
|
2029
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
2030
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
2031
|
-
*
|
|
2032
|
-
* @static
|
|
2033
|
-
* @memberOf _
|
|
2034
|
-
* @since 0.1.0
|
|
2035
|
-
* @category Lang
|
|
2036
|
-
* @param {*} value The value to check.
|
|
2037
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
2038
|
-
* @example
|
|
2039
|
-
*
|
|
2040
|
-
* _.isObject({});
|
|
2041
|
-
* // => true
|
|
2042
|
-
*
|
|
2043
|
-
* _.isObject([1, 2, 3]);
|
|
2044
|
-
* // => true
|
|
2045
|
-
*
|
|
2046
|
-
* _.isObject(_.noop);
|
|
2047
|
-
* // => true
|
|
2048
|
-
*
|
|
2049
|
-
* _.isObject(null);
|
|
2050
|
-
* // => false
|
|
2051
|
-
*/
|
|
2052
|
-
function isObject(value) {
|
|
2053
|
-
var type = typeof value;
|
|
2054
|
-
return !!value && (type == 'object' || type == 'function');
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
/**
|
|
2058
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
2059
|
-
* and has a `typeof` result of "object".
|
|
2060
|
-
*
|
|
2061
|
-
* @static
|
|
2062
|
-
* @memberOf _
|
|
2063
|
-
* @since 4.0.0
|
|
2064
|
-
* @category Lang
|
|
2065
|
-
* @param {*} value The value to check.
|
|
2066
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
2067
|
-
* @example
|
|
2068
|
-
*
|
|
2069
|
-
* _.isObjectLike({});
|
|
2070
|
-
* // => true
|
|
2071
|
-
*
|
|
2072
|
-
* _.isObjectLike([1, 2, 3]);
|
|
2073
|
-
* // => true
|
|
2074
|
-
*
|
|
2075
|
-
* _.isObjectLike(_.noop);
|
|
2076
|
-
* // => false
|
|
2077
|
-
*
|
|
2078
|
-
* _.isObjectLike(null);
|
|
2079
|
-
* // => false
|
|
2080
|
-
*/
|
|
2081
|
-
function isObjectLike(value) {
|
|
2082
|
-
return !!value && typeof value == 'object';
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
/**
|
|
2086
|
-
* Creates an array of the own enumerable property names of `object`.
|
|
2087
|
-
*
|
|
2088
|
-
* **Note:** Non-object values are coerced to objects. See the
|
|
2089
|
-
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
2090
|
-
* for more details.
|
|
2091
|
-
*
|
|
2092
|
-
* @static
|
|
2093
|
-
* @since 0.1.0
|
|
2094
|
-
* @memberOf _
|
|
2095
|
-
* @category Object
|
|
2096
|
-
* @param {Object} object The object to query.
|
|
2097
|
-
* @returns {Array} Returns the array of property names.
|
|
2098
|
-
* @example
|
|
2099
|
-
*
|
|
2100
|
-
* function Foo() {
|
|
2101
|
-
* this.a = 1;
|
|
2102
|
-
* this.b = 2;
|
|
2103
|
-
* }
|
|
2104
|
-
*
|
|
2105
|
-
* Foo.prototype.c = 3;
|
|
2106
|
-
*
|
|
2107
|
-
* _.keys(new Foo);
|
|
2108
|
-
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
2109
|
-
*
|
|
2110
|
-
* _.keys('hi');
|
|
2111
|
-
* // => ['0', '1']
|
|
2112
|
-
*/
|
|
2113
|
-
function keys(object) {
|
|
2114
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
/**
|
|
2118
|
-
* This method returns a new empty array.
|
|
2119
|
-
*
|
|
2120
|
-
* @static
|
|
2121
|
-
* @memberOf _
|
|
2122
|
-
* @since 4.13.0
|
|
2123
|
-
* @category Util
|
|
2124
|
-
* @returns {Array} Returns the new empty array.
|
|
2125
|
-
* @example
|
|
2126
|
-
*
|
|
2127
|
-
* var arrays = _.times(2, _.stubArray);
|
|
2128
|
-
*
|
|
2129
|
-
* console.log(arrays);
|
|
2130
|
-
* // => [[], []]
|
|
2131
|
-
*
|
|
2132
|
-
* console.log(arrays[0] === arrays[1]);
|
|
2133
|
-
* // => false
|
|
2134
|
-
*/
|
|
2135
|
-
function stubArray() {
|
|
2136
|
-
return [];
|
|
2137
|
-
}
|
|
2138
|
-
|
|
2139
|
-
/**
|
|
2140
|
-
* This method returns `false`.
|
|
2141
|
-
*
|
|
2142
|
-
* @static
|
|
2143
|
-
* @memberOf _
|
|
2144
|
-
* @since 4.13.0
|
|
2145
|
-
* @category Util
|
|
2146
|
-
* @returns {boolean} Returns `false`.
|
|
2147
|
-
* @example
|
|
2148
|
-
*
|
|
2149
|
-
* _.times(2, _.stubFalse);
|
|
2150
|
-
* // => [false, false]
|
|
2151
|
-
*/
|
|
2152
|
-
function stubFalse() {
|
|
2153
|
-
return false;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
module.exports = cloneDeep;
|
|
2157
|
-
} (lodash_clonedeep, lodash_clonedeepExports));
|
|
2158
|
-
|
|
2159
|
-
const DEFAULT_DRAG_STATE = {
|
|
2160
|
-
from: { path: null, element: null, parent: null },
|
|
2161
|
-
to: { path: null, element: null, parent: null },
|
|
2162
|
-
};
|
|
2163
|
-
|
|
2164
|
-
const urlAlphabet =
|
|
2165
|
-
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
2166
|
-
|
|
2167
|
-
const POOL_SIZE_MULTIPLIER = 128;
|
|
2168
|
-
let pool, poolOffset;
|
|
2169
|
-
let fillPool = bytes => {
|
|
2170
|
-
if (!pool || pool.length < bytes) {
|
|
2171
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
2172
|
-
randomFillSync(pool);
|
|
2173
|
-
poolOffset = 0;
|
|
2174
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
2175
|
-
randomFillSync(pool);
|
|
2176
|
-
poolOffset = 0;
|
|
2177
|
-
}
|
|
2178
|
-
poolOffset += bytes;
|
|
2179
|
-
};
|
|
2180
|
-
let nanoid = (size = 21) => {
|
|
2181
|
-
fillPool((size -= 0));
|
|
2182
|
-
let id = '';
|
|
2183
|
-
for (let i = poolOffset - size; i < poolOffset; i++) {
|
|
2184
|
-
id += urlAlphabet[pool[i] & 63];
|
|
2185
|
-
}
|
|
2186
|
-
return id
|
|
2187
|
-
};
|
|
2188
|
-
|
|
2189
|
-
const generateId = () => nanoid();
|
|
2190
|
-
if (typeof window !== 'undefined') {
|
|
2191
|
-
var passiveTestOptions = {
|
|
2192
|
-
get passive() {
|
|
2193
|
-
return undefined;
|
|
2194
|
-
}
|
|
2195
|
-
};
|
|
2196
|
-
window.addEventListener('testPassive', null, passiveTestOptions);
|
|
2197
|
-
window.removeEventListener('testPassive', null, passiveTestOptions);
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
const getDefaultParagraphLine = (id) => ({
|
|
2201
|
-
id,
|
|
2202
|
-
type: 'paragraph',
|
|
2203
|
-
nodeType: 'block',
|
|
2204
|
-
children: [{ text: '' }],
|
|
2205
|
-
});
|
|
2206
|
-
|
|
2207
|
-
const defaultValues$1 = {
|
|
2208
|
-
hoveredElement: null,
|
|
2209
|
-
isElementOptionsOpen: false,
|
|
2210
|
-
nodeSettingsPos: null,
|
|
2211
|
-
dndState: DEFAULT_DRAG_STATE,
|
|
2212
|
-
disableWhileDrag: false,
|
|
2213
|
-
DRAG_MAP: new Map(),
|
|
2214
|
-
};
|
|
2215
|
-
React.createContext([
|
|
2216
|
-
defaultValues$1,
|
|
2217
|
-
{
|
|
2218
|
-
openNodeSettings: (_dragRef, _node) => { },
|
|
2219
|
-
closeNodeSettings: () => { },
|
|
2220
|
-
hoverIn: (_e, _node) => { },
|
|
2221
|
-
triggerPlusButton: (_node) => { },
|
|
2222
|
-
deleteNode: () => { },
|
|
2223
|
-
duplicateNode: () => { },
|
|
2224
|
-
copyLinkNode: () => { },
|
|
2225
|
-
onDrop: (_e) => { },
|
|
2226
|
-
onDragEnd: (_e) => { },
|
|
2227
|
-
onDragEnter: (_e) => { },
|
|
2228
|
-
onDragStart: (_e) => { },
|
|
2229
|
-
changeHoveredNode: (_hoveredProps) => { },
|
|
2230
|
-
},
|
|
2231
|
-
]);
|
|
2232
|
-
|
|
2233
|
-
const defaultValues = { marks: {}, elements: {} };
|
|
2234
|
-
React.createContext(defaultValues);
|
|
2235
|
-
|
|
2236
|
-
var css_248z$2 = ".ElementOptions-module_root{align-items:center;background:#fff;border-radius:4px;box-shadow:0 0 0 1px hsla(0,0%,6%,.05),0 3px 6px hsla(0,0%,6%,.1),0 9px 24px hsla(0,0%,6%,.2);display:flex;flex-direction:column;height:auto;max-height:70vh;max-width:calc(100vw - 24px);min-width:200px;opacity:1;overflow:hidden;position:fixed;transform-origin:0 top;width:auto}.ElementOptions-module_content{flex-grow:1;margin-bottom:0;margin-right:0;min-height:0;overflow:hidden auto;position:relative;transform:translateZ(0);width:100%;z-index:1}.ElementOptions-module_group{box-shadow:0 -1px 0 rgba(55,53,47,.09);padding-bottom:6px;padding-top:6px}.ElementOptions-module_item{align-items:center;background:inherit;border:none;border-radius:3px;color:#000;cursor:pointer;display:flex;font-size:14px;line-height:120%;margin-left:4px;margin-right:4px;min-height:28px;transition:background 20ms ease-in 0s;user-select:none;width:calc(100% - 8px)}.ElementOptions-module_item:hover{background-color:rgba(55,53,47,.08);color:#000}.ElementOptions-module_icon{align-items:center;color:#000;display:flex;justify-content:center;margin-left:10px;margin-right:4px}.ElementOptions-module_text{flex:1 1 auto;margin-left:6px;margin-right:6px;min-width:0;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ElementOptions-module_hotkey{color:rgba(55,53,47,.5);flex-shrink:0;font-size:12px;margin-left:auto;margin-right:12px;min-width:0;white-space:nowrap}";
|
|
2237
|
-
styleInject$1(css_248z$2);
|
|
2238
|
-
|
|
2239
|
-
var lib = {};
|
|
2240
|
-
|
|
2241
|
-
Object.defineProperty(lib, "__esModule", {
|
|
2242
|
-
value: true
|
|
2243
|
-
});
|
|
2244
|
-
|
|
2245
|
-
/**
|
|
2246
|
-
* Constants.
|
|
2247
|
-
*/
|
|
2248
|
-
|
|
2249
|
-
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2250
|
-
|
|
2251
|
-
var MODIFIERS = {
|
|
2252
|
-
alt: 'altKey',
|
|
2253
|
-
control: 'ctrlKey',
|
|
2254
|
-
meta: 'metaKey',
|
|
2255
|
-
shift: 'shiftKey'
|
|
2256
|
-
};
|
|
2257
|
-
|
|
2258
|
-
var ALIASES = {
|
|
2259
|
-
add: '+',
|
|
2260
|
-
break: 'pause',
|
|
2261
|
-
cmd: 'meta',
|
|
2262
|
-
command: 'meta',
|
|
2263
|
-
ctl: 'control',
|
|
2264
|
-
ctrl: 'control',
|
|
2265
|
-
del: 'delete',
|
|
2266
|
-
down: 'arrowdown',
|
|
2267
|
-
esc: 'escape',
|
|
2268
|
-
ins: 'insert',
|
|
2269
|
-
left: 'arrowleft',
|
|
2270
|
-
mod: IS_MAC ? 'meta' : 'control',
|
|
2271
|
-
opt: 'alt',
|
|
2272
|
-
option: 'alt',
|
|
2273
|
-
return: 'enter',
|
|
2274
|
-
right: 'arrowright',
|
|
2275
|
-
space: ' ',
|
|
2276
|
-
spacebar: ' ',
|
|
2277
|
-
up: 'arrowup',
|
|
2278
|
-
win: 'meta',
|
|
2279
|
-
windows: 'meta'
|
|
2280
|
-
};
|
|
2281
|
-
|
|
2282
|
-
var CODES = {
|
|
2283
|
-
backspace: 8,
|
|
2284
|
-
tab: 9,
|
|
2285
|
-
enter: 13,
|
|
2286
|
-
shift: 16,
|
|
2287
|
-
control: 17,
|
|
2288
|
-
alt: 18,
|
|
2289
|
-
pause: 19,
|
|
2290
|
-
capslock: 20,
|
|
2291
|
-
escape: 27,
|
|
2292
|
-
' ': 32,
|
|
2293
|
-
pageup: 33,
|
|
2294
|
-
pagedown: 34,
|
|
2295
|
-
end: 35,
|
|
2296
|
-
home: 36,
|
|
2297
|
-
arrowleft: 37,
|
|
2298
|
-
arrowup: 38,
|
|
2299
|
-
arrowright: 39,
|
|
2300
|
-
arrowdown: 40,
|
|
2301
|
-
insert: 45,
|
|
2302
|
-
delete: 46,
|
|
2303
|
-
meta: 91,
|
|
2304
|
-
numlock: 144,
|
|
2305
|
-
scrolllock: 145,
|
|
2306
|
-
';': 186,
|
|
2307
|
-
'=': 187,
|
|
2308
|
-
',': 188,
|
|
2309
|
-
'-': 189,
|
|
2310
|
-
'.': 190,
|
|
2311
|
-
'/': 191,
|
|
2312
|
-
'`': 192,
|
|
2313
|
-
'[': 219,
|
|
2314
|
-
'\\': 220,
|
|
2315
|
-
']': 221,
|
|
2316
|
-
'\'': 222
|
|
2317
|
-
};
|
|
2318
|
-
|
|
2319
|
-
for (var f = 1; f < 20; f++) {
|
|
2320
|
-
CODES['f' + f] = 111 + f;
|
|
2321
|
-
}
|
|
2322
|
-
|
|
2323
|
-
/**
|
|
2324
|
-
* Is hotkey?
|
|
2325
|
-
*/
|
|
2326
|
-
|
|
2327
|
-
function isHotkey(hotkey, options, event) {
|
|
2328
|
-
if (options && !('byKey' in options)) {
|
|
2329
|
-
event = options;
|
|
2330
|
-
options = null;
|
|
2331
|
-
}
|
|
2332
|
-
|
|
2333
|
-
if (!Array.isArray(hotkey)) {
|
|
2334
|
-
hotkey = [hotkey];
|
|
2335
|
-
}
|
|
2336
|
-
|
|
2337
|
-
var array = hotkey.map(function (string) {
|
|
2338
|
-
return parseHotkey(string, options);
|
|
2339
|
-
});
|
|
2340
|
-
var check = function check(e) {
|
|
2341
|
-
return array.some(function (object) {
|
|
2342
|
-
return compareHotkey(object, e);
|
|
2343
|
-
});
|
|
2344
|
-
};
|
|
2345
|
-
var ret = event == null ? check : check(event);
|
|
2346
|
-
return ret;
|
|
2347
|
-
}
|
|
2348
|
-
|
|
2349
|
-
function isCodeHotkey(hotkey, event) {
|
|
2350
|
-
return isHotkey(hotkey, event);
|
|
2351
|
-
}
|
|
2352
|
-
|
|
2353
|
-
function isKeyHotkey(hotkey, event) {
|
|
2354
|
-
return isHotkey(hotkey, { byKey: true }, event);
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
/**
|
|
2358
|
-
* Parse.
|
|
2359
|
-
*/
|
|
2360
|
-
|
|
2361
|
-
function parseHotkey(hotkey, options) {
|
|
2362
|
-
var byKey = options && options.byKey;
|
|
2363
|
-
var ret = {};
|
|
2364
|
-
|
|
2365
|
-
// Special case to handle the `+` key since we use it as a separator.
|
|
2366
|
-
hotkey = hotkey.replace('++', '+add');
|
|
2367
|
-
var values = hotkey.split('+');
|
|
2368
|
-
var length = values.length;
|
|
2369
|
-
|
|
2370
|
-
// Ensure that all the modifiers are set to false unless the hotkey has them.
|
|
2371
|
-
|
|
2372
|
-
for (var k in MODIFIERS) {
|
|
2373
|
-
ret[MODIFIERS[k]] = false;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
var _iteratorNormalCompletion = true;
|
|
2377
|
-
var _didIteratorError = false;
|
|
2378
|
-
var _iteratorError = undefined;
|
|
2379
|
-
|
|
2380
|
-
try {
|
|
2381
|
-
for (var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2382
|
-
var value = _step.value;
|
|
2383
|
-
|
|
2384
|
-
var optional = value.endsWith('?') && value.length > 1;
|
|
2385
|
-
|
|
2386
|
-
if (optional) {
|
|
2387
|
-
value = value.slice(0, -1);
|
|
2388
|
-
}
|
|
2389
|
-
|
|
2390
|
-
var name = toKeyName(value);
|
|
2391
|
-
var modifier = MODIFIERS[name];
|
|
2392
|
-
|
|
2393
|
-
if (value.length > 1 && !modifier && !ALIASES[value] && !CODES[name]) {
|
|
2394
|
-
throw new TypeError('Unknown modifier: "' + value + '"');
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
if (length === 1 || !modifier) {
|
|
2398
|
-
if (byKey) {
|
|
2399
|
-
ret.key = name;
|
|
2400
|
-
} else {
|
|
2401
|
-
ret.which = toKeyCode(value);
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
|
|
2405
|
-
if (modifier) {
|
|
2406
|
-
ret[modifier] = optional ? null : true;
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
} catch (err) {
|
|
2410
|
-
_didIteratorError = true;
|
|
2411
|
-
_iteratorError = err;
|
|
2412
|
-
} finally {
|
|
2413
|
-
try {
|
|
2414
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
2415
|
-
_iterator.return();
|
|
2416
|
-
}
|
|
2417
|
-
} finally {
|
|
2418
|
-
if (_didIteratorError) {
|
|
2419
|
-
throw _iteratorError;
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
return ret;
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
/**
|
|
2428
|
-
* Compare.
|
|
2429
|
-
*/
|
|
2430
|
-
|
|
2431
|
-
function compareHotkey(object, event) {
|
|
2432
|
-
for (var key in object) {
|
|
2433
|
-
var expected = object[key];
|
|
2434
|
-
var actual = void 0;
|
|
2435
|
-
|
|
2436
|
-
if (expected == null) {
|
|
2437
|
-
continue;
|
|
2438
|
-
}
|
|
2439
|
-
|
|
2440
|
-
if (key === 'key' && event.key != null) {
|
|
2441
|
-
actual = event.key.toLowerCase();
|
|
2442
|
-
} else if (key === 'which') {
|
|
2443
|
-
actual = expected === 91 && event.which === 93 ? 91 : event.which;
|
|
2444
|
-
} else {
|
|
2445
|
-
actual = event[key];
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
if (actual == null && expected === false) {
|
|
2449
|
-
continue;
|
|
2450
|
-
}
|
|
2451
|
-
|
|
2452
|
-
if (actual !== expected) {
|
|
2453
|
-
return false;
|
|
2454
|
-
}
|
|
2455
|
-
}
|
|
2456
|
-
|
|
2457
|
-
return true;
|
|
2458
|
-
}
|
|
2459
|
-
|
|
2460
|
-
/**
|
|
2461
|
-
* Utils.
|
|
2462
|
-
*/
|
|
2463
|
-
|
|
2464
|
-
function toKeyCode(name) {
|
|
2465
|
-
name = toKeyName(name);
|
|
2466
|
-
var code = CODES[name] || name.toUpperCase().charCodeAt(0);
|
|
2467
|
-
return code;
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
function toKeyName(name) {
|
|
2471
|
-
name = name.toLowerCase();
|
|
2472
|
-
name = ALIASES[name] || name;
|
|
2473
|
-
return name;
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
-
/**
|
|
2477
|
-
* Export.
|
|
2478
|
-
*/
|
|
2479
|
-
|
|
2480
|
-
lib.default = isHotkey;
|
|
2481
|
-
lib.isHotkey = isHotkey;
|
|
2482
|
-
lib.isCodeHotkey = isCodeHotkey;
|
|
2483
|
-
var isKeyHotkey_1 = lib.isKeyHotkey = isKeyHotkey;
|
|
2484
|
-
lib.parseHotkey = parseHotkey;
|
|
2485
|
-
lib.compareHotkey = compareHotkey;
|
|
2486
|
-
lib.toKeyCode = toKeyCode;
|
|
2487
|
-
lib.toKeyName = toKeyName;
|
|
2488
|
-
|
|
6
|
+
*/L={get exports(){return N},set exports(e){N=e}},function(){var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var a=typeof o;if("string"===a||"number"===a)r.push(o);else if(Array.isArray(o)){if(o.length){var i=t.apply(null,o);i&&r.push(i)}}else if("object"===a){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var c in o)e.call(o,c)&&o[c]&&r.push(c)}}}return r.join(" ")}L.exports?(t.default=t,L.exports=t):window.classNames=t}();var C=N;function D(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}D(".QEROK9NJ{inset:0;overflow:hidden;pointer-events:none;position:fixed;z-index:999}.ZLDKsGEc,._0wBAdXIb{position:relative;z-index:0}._0wBAdXIb{pointer-events:auto}.P40m4iJS{height:100vh;left:0;position:fixed;top:0;width:100vw}._7iHqOybQ{pointer-events:auto;position:relative;top:100%}");var z={};!function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",a="[object Boolean]",i="[object Date]",c="[object Function]",s="[object GeneratorFunction]",l="[object Map]",u="[object Number]",f="[object Object]",d="[object Promise]",h="[object RegExp]",y="[object Set]",b="[object String]",g="[object Symbol]",v="[object WeakMap]",w="[object ArrayBuffer]",m="[object DataView]",x="[object Float32Array]",_="[object Float64Array]",j="[object Int8Array]",O="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",P="[object Uint16Array]",A="[object Uint32Array]",T=/\w*$/,F=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,L={};L[o]=L["[object Array]"]=L[w]=L[m]=L[a]=L[i]=L[x]=L[_]=L[j]=L[O]=L[k]=L[l]=L[u]=L[f]=L[h]=L[y]=L[b]=L[g]=L[E]=L[S]=L[P]=L[A]=!0,L["[object Error]"]=L[c]=L[v]=!1;var N="object"==typeof p&&p&&p.Object===Object&&p,C="object"==typeof self&&self&&self.Object===Object&&self,D=N||C||Function("return this")(),z=t&&!t.nodeType&&t,W=z&&e&&!e.nodeType&&e,$=W&&W.exports===z;function q(e,t){return e.set(t[0],t[1]),e}function M(e,t){return e.add(t),e}function R(e,t,r,n){var o=-1,a=e?e.length:0;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function I(e,t){return function(r){return e(t(r))}}function K(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var V=Array.prototype,G=Function.prototype,J=Object.prototype,Q=D["__core-js_shared__"],X=function(){var e=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Z=G.toString,Y=J.hasOwnProperty,ee=J.toString,te=RegExp("^"+Z.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=$?D.Buffer:void 0,ne=D.Symbol,oe=D.Uint8Array,ae=I(Object.getPrototypeOf,Object),ie=Object.create,ce=J.propertyIsEnumerable,se=V.splice,le=Object.getOwnPropertySymbols,ue=re?re.isBuffer:void 0,fe=I(Object.keys,Object),pe=Ce(D,"DataView"),de=Ce(D,"Map"),he=Ce(D,"Promise"),ye=Ce(D,"Set"),be=Ce(D,"WeakMap"),ge=Ce(Object,"create"),ve=qe(pe),we=qe(de),me=qe(he),xe=qe(ye),_e=qe(be),je=ne?ne.prototype:void 0,Oe=je?je.valueOf:void 0;function ke(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ee(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Pe(e){this.__data__=new Ee(e)}function Ae(e,t,r){var n=e[t];Y.call(e,t)&&Me(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Te(e,t){for(var r=e.length;r--;)if(Me(e[r][0],t))return r;return-1}function Fe(e,t,r,n,p,d,v){var F;if(n&&(F=d?n(e,p,d,v):n(e)),void 0!==F)return F;if(!Ke(e))return e;var B=Re(e);if(B){if(F=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&Y.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!t)return function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e,F)}else{var N=ze(e),C=N==c||N==s;if(He(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(N==f||N==o||C&&!d){if(U(e))return d?e:{};if(F=function(e){return"function"!=typeof e.constructor||$e(e)?{}:Ke(t=ae(e))?ie(t):{};var t}(C?{}:e),!t)return function(e,t){return Le(e,De(e),t)}(e,function(e,t){return e&&Le(t,Ve(t),e)}(F,e))}else{if(!L[N])return d?e:{};F=function(e,t,r,n){var o,c=e.constructor;switch(t){case w:return Be(e);case a:case i:return new c(+e);case m:return function(e,t){var r=t?Be(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case x:case _:case j:case O:case k:case E:case S:case P:case A:return function(e,t){var r=t?Be(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case l:return function(e,t,r){return R(t?r(H(e),!0):H(e),q,new e.constructor)}(e,n,r);case u:case b:return new c(e);case h:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return function(e,t,r){return R(t?r(K(e),!0):K(e),M,new e.constructor)}(e,n,r);case g:return o=e,Oe?Object(Oe.call(o)):{}}}(e,N,Fe,t)}}v||(v=new Pe);var D=v.get(e);if(D)return D;if(v.set(e,F),!B)var z=r?function(e){return function(e,t,r){var n=t(e);return Re(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Ve,De)}(e):Ve(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r););}(z||e,(function(o,a){z&&(o=e[a=o]),Ae(F,a,Fe(o,t,r,n,a,e,v))})),F}function Be(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function Le(e,t,r,n){r||(r={});for(var o=-1,a=t.length;++o<a;){var i=t[o],c=n?n(r[i],e[i],i,r,e):void 0;Ae(r,i,void 0===c?e[i]:c)}return r}function Ne(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Ce(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ke(e)||(t=e,X&&X in t))&&(Ie(e)||U(e)?te:F).test(qe(e));var t}(r)?r:void 0}ke.prototype.clear=function(){this.__data__=ge?ge(null):{}},ke.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ke.prototype.get=function(e){var t=this.__data__;if(ge){var n=t[e];return n===r?void 0:n}return Y.call(t,e)?t[e]:void 0},ke.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:Y.call(t,e)},ke.prototype.set=function(e,t){return this.__data__[e]=ge&&void 0===t?r:t,this},Ee.prototype.clear=function(){this.__data__=[]},Ee.prototype.delete=function(e){var t=this.__data__,r=Te(t,e);return!(r<0||(r==t.length-1?t.pop():se.call(t,r,1),0))},Ee.prototype.get=function(e){var t=this.__data__,r=Te(t,e);return r<0?void 0:t[r][1]},Ee.prototype.has=function(e){return Te(this.__data__,e)>-1},Ee.prototype.set=function(e,t){var r=this.__data__,n=Te(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Se.prototype.clear=function(){this.__data__={hash:new ke,map:new(de||Ee),string:new ke}},Se.prototype.delete=function(e){return Ne(this,e).delete(e)},Se.prototype.get=function(e){return Ne(this,e).get(e)},Se.prototype.has=function(e){return Ne(this,e).has(e)},Se.prototype.set=function(e,t){return Ne(this,e).set(e,t),this},Pe.prototype.clear=function(){this.__data__=new Ee},Pe.prototype.delete=function(e){return this.__data__.delete(e)},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ee){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new Se(n)}return r.set(e,t),this};var De=le?I(le,Object):function(){return[]},ze=function(e){return ee.call(e)};function We(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function qe(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Me(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=m||de&&ze(new de)!=l||he&&ze(he.resolve())!=d||ye&&ze(new ye)!=y||be&&ze(new be)!=v)&&(ze=function(e){var t=ee.call(e),r=t==f?e.constructor:void 0,n=r?qe(r):void 0;if(n)switch(n){case ve:return m;case we:return l;case me:return d;case xe:return y;case _e:return v}return t});var Re=Array.isArray;function Ue(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Ie(e)}var He=ue||function(){return!1};function Ie(e){var t=Ke(e)?ee.call(e):"";return t==c||t==s}function Ke(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ve(e){return Ue(e)?function(e,t){var r=Re(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ue(e)}(e)&&Y.call(e,"callee")&&(!ce.call(e,"callee")||ee.call(e)==o)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,a=!!n;for(var i in e)!t&&!Y.call(e,i)||a&&("length"==i||We(i,n))||r.push(i);return r}(e):function(e){if(!$e(e))return fe(e);var t=[];for(var r in Object(e))Y.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Fe(e,!0,!0)}}({get exports(){return z},set exports(e){z=e}},z);let W,$;const q=()=>((e=21)=>{var t;t=e-=0,!W||W.length<t?(W=Buffer.allocUnsafe(128*t),u(W),$=0):$+t>W.length&&(u(W),$=0),$+=t;let r="";for(let t=$-e;t<$;t++)r+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&W[t]];return r})();if("undefined"!=typeof window){var M={get passive(){}};window.addEventListener("testPassive",null,M),window.removeEventListener("testPassive",null,M)}const R={hoveredElement:null,isElementOptionsOpen:!1,nodeSettingsPos:null,dndState:{from:{path:null,element:null,parent:null},to:{path:null,element:null,parent:null}},disableWhileDrag:!1,DRAG_MAP:new Map};t.createContext([R,{openNodeSettings:(e,t)=>{},closeNodeSettings:()=>{},hoverIn:(e,t)=>{},triggerPlusButton:e=>{},deleteNode:()=>{},duplicateNode:()=>{},copyLinkNode:()=>{},onDrop:e=>{},onDragEnd:e=>{},onDragEnter:e=>{},onDragStart:e=>{},changeHoveredNode:e=>{}}]),t.createContext({marks:{},elements:{}}),D(".IMJgzRnZ{align-items:center;background:#fff;border-radius:4px;box-shadow:0 0 0 1px hsla(0,0%,6%,.05),0 3px 6px hsla(0,0%,6%,.1),0 9px 24px hsla(0,0%,6%,.2);display:flex;flex-direction:column;height:auto;max-height:70vh;max-width:calc(100vw - 24px);min-width:200px;opacity:1;overflow:hidden;position:fixed;transform-origin:0 top;width:auto}.nFfAiJWo{flex-grow:1;margin-bottom:0;margin-right:0;min-height:0;overflow:hidden auto;position:relative;transform:translateZ(0);width:100%;z-index:1}.DeARgIyF{box-shadow:0 -1px 0 rgba(55,53,47,.09);padding-bottom:6px;padding-top:6px}.kyuzONcU{align-items:center;background:inherit;border:none;border-radius:3px;color:#000;cursor:pointer;display:flex;font-size:14px;line-height:120%;margin-left:4px;margin-right:4px;min-height:28px;transition:background 20ms ease-in 0s;user-select:none;width:calc(100% - 8px)}.kyuzONcU:hover{background-color:rgba(55,53,47,.08);color:#000}._95up7F66{align-items:center;color:#000;display:flex;justify-content:center;margin-left:10px;margin-right:4px}._9d0T-cEo{flex:1 1 auto;margin-left:6px;margin-right:6px;overflow:hidden;text-align:left;text-overflow:ellipsis}._5FdNFUNm,._9d0T-cEo{min-width:0;white-space:nowrap}._5FdNFUNm{color:rgba(55,53,47,.5);flex-shrink:0;font-size:12px;margin-left:auto;margin-right:12px}");var U={};Object.defineProperty(U,"__esModule",{value:!0});for(var H="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),I={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},K={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:H?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},V={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},G=1;G<20;G++)V["f"+G]=111+G;function J(e,t,r){t&&!("byKey"in t)&&(r=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map((function(e){return Q(e,t)})),o=function(e){return n.some((function(t){return X(t,e)}))};return null==r?o:o(r)}function Q(e,t){var r=t&&t.byKey,n={},o=(e=e.replace("++","+add")).split("+"),a=o.length;for(var i in I)n[I[i]]=!1;var c=!0,s=!1,l=void 0;try{for(var u,f=o[Symbol.iterator]();!(c=(u=f.next()).done);c=!0){var p=u.value,d=p.endsWith("?")&&p.length>1;d&&(p=p.slice(0,-1));var h=Y(p),y=I[h];if(p.length>1&&!y&&!K[p]&&!V[h])throw new TypeError('Unknown modifier: "'+p+'"');1!==a&&y||(r?n.key=h:n.which=Z(p)),y&&(n[y]=!d||null)}}catch(e){s=!0,l=e}finally{try{!c&&f.return&&f.return()}finally{if(s)throw l}}return n}function X(e,t){for(var r in e){var n=e[r],o=void 0;if(null!=n&&(null!=(o="key"===r&&null!=t.key?t.key.toLowerCase():"which"===r?91===n&&93===t.which?91:t.which:t[r])||!1!==n)&&o!==n)return!1}return!0}function Z(e){return e=Y(e),V[e]||e.toUpperCase().charCodeAt(0)}function Y(e){return e=e.toLowerCase(),K[e]||e}U.default=J,U.isHotkey=J,U.isCodeHotkey=function(e,t){return J(e,t)};var ee=U.isKeyHotkey=function(e,t){return J(e,{byKey:!0},t)};
|
|
2489
7
|
/*!
|
|
2490
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
2491
9
|
*
|
|
2492
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2493
11
|
* Released under the MIT License.
|
|
2494
12
|
*/
|
|
2495
|
-
|
|
2496
|
-
function isObject(o) {
|
|
2497
|
-
return Object.prototype.toString.call(o) === '[object Object]';
|
|
2498
|
-
}
|
|
2499
|
-
|
|
2500
|
-
function isPlainObject(o) {
|
|
2501
|
-
var ctor,prot;
|
|
2502
|
-
|
|
2503
|
-
if (isObject(o) === false) return false;
|
|
2504
|
-
|
|
2505
|
-
// If has modified constructor
|
|
2506
|
-
ctor = o.constructor;
|
|
2507
|
-
if (ctor === undefined) return true;
|
|
2508
|
-
|
|
2509
|
-
// If has modified prototype
|
|
2510
|
-
prot = ctor.prototype;
|
|
2511
|
-
if (isObject(prot) === false) return false;
|
|
2512
|
-
|
|
2513
|
-
// If constructor does not have an Object-specific method
|
|
2514
|
-
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
|
2515
|
-
return false;
|
|
2516
|
-
}
|
|
2517
|
-
|
|
2518
|
-
// Most likely a plain Object
|
|
2519
|
-
return true;
|
|
2520
|
-
}
|
|
2521
|
-
|
|
2522
|
-
var css_248z$1 = ".TextLeaf-module_placeholder:after{color:#aaa;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);user-select:none}.TextLeaf-module_selection{background-color:#accef7}";
|
|
2523
|
-
var s$1 = {"placeholder":"TextLeaf-module_placeholder","selection":"TextLeaf-module_selection"};
|
|
2524
|
-
styleInject$1(css_248z$1);
|
|
2525
|
-
|
|
2526
|
-
const leafStyle = {
|
|
2527
|
-
margin: '1px 0',
|
|
2528
|
-
whiteSpace: 'pre-wrap',
|
|
2529
|
-
wordBreak: 'break-word',
|
|
2530
|
-
color: 'inherit',
|
|
2531
|
-
fontSize: 'inherit',
|
|
2532
|
-
lineHeight: 'inherit',
|
|
2533
|
-
fontWeight: 'inherit',
|
|
2534
|
-
};
|
|
2535
|
-
const TextLeaf = memo(({ attributes, children, placeholder, leaf }) => {
|
|
2536
|
-
const selected = useSelected();
|
|
2537
|
-
return (jsx("span", Object.assign({}, attributes, { "data-placeholder": placeholder, style: leafStyle, className: cx({
|
|
2538
|
-
[s$1.placeholder]: leaf.withPlaceholder && placeholder && selected,
|
|
2539
|
-
[s$1.selection]: leaf.selection,
|
|
2540
|
-
}) }, { children: children })));
|
|
2541
|
-
});
|
|
2542
|
-
TextLeaf.displayName = 'TextLeaf';
|
|
2543
|
-
|
|
2544
|
-
var css_248z$4 = ".ElementWrapper-module_actions{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}.ElementWrapper-module_hovered{opacity:1}.ElementWrapper-module_actionButton{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}.ElementWrapper-module_actionButton:active,.ElementWrapper-module_actionButton:focus,.ElementWrapper-module_actionButton:hover{background-color:rgba(55,54,47,.08)}.ElementWrapper-module_plusButton{width:24px}.ElementWrapper-module_elementWrapper{position:relative;transition:opacity .18s cubic-bezier(.4,0,.2,1)}.ElementWrapper-module_isDragOver:after{background-color:#007aff;bottom:-7px;content:\"\";height:3px;left:50%;position:absolute;transform:translateX(-50%);width:100%}.ElementWrapper-module_isDragSelf:before{top:-5px}.ElementWrapper-module_isDragSelf:after,.ElementWrapper-module_isDragSelf:before{background-color:inherit;content:\"\";height:3px;left:50%;position:absolute;transform:translateX(-50%);width:100%}.ElementWrapper-module_isDragSelf:after{bottom:-7px}";
|
|
2545
|
-
styleInject$1(css_248z$4);
|
|
2546
|
-
|
|
2547
|
-
const HOTKEYS_MAP = {
|
|
2548
|
-
bold: 'mod+b',
|
|
2549
|
-
italic: 'mod+i',
|
|
2550
|
-
compose: ['down', 'left', 'right', 'up', 'backspace', 'enter'],
|
|
2551
|
-
arrowLeft: 'left',
|
|
2552
|
-
arrowUp: 'up',
|
|
2553
|
-
arrowDown: 'down',
|
|
2554
|
-
arrowRight: 'right',
|
|
2555
|
-
ctrlLeft: 'ctrl+left',
|
|
2556
|
-
escape: 'esc',
|
|
2557
|
-
ctrlRight: 'ctrl+right',
|
|
2558
|
-
deleteBackward: 'shift?+backspace',
|
|
2559
|
-
backspace: 'backspace',
|
|
2560
|
-
deleteForward: 'shift?+delete',
|
|
2561
|
-
extendBackward: 'shift+left',
|
|
2562
|
-
extendForward: 'shift+right',
|
|
2563
|
-
shiftEnter: 'shift+enter',
|
|
2564
|
-
enter: 'enter',
|
|
2565
|
-
space: 'space',
|
|
2566
|
-
undo: 'mod+z',
|
|
2567
|
-
select: 'mod+a',
|
|
2568
|
-
shiftTab: 'shift+tab',
|
|
2569
|
-
tab: 'tab',
|
|
2570
|
-
cmd: 'mod',
|
|
2571
|
-
cmdEnter: 'mod+enter',
|
|
2572
|
-
kekCeburek: 'mod+enter',
|
|
2573
|
-
};
|
|
2574
|
-
const APPLE_HOTKEYS = {
|
|
2575
|
-
moveLineBackward: 'opt+up',
|
|
2576
|
-
moveLineForward: 'opt+down',
|
|
2577
|
-
ctrlLeft: 'opt+left',
|
|
2578
|
-
ctrlRight: 'opt+right',
|
|
2579
|
-
deleteBackward: ['ctrl+backspace', 'ctrl+h'],
|
|
2580
|
-
deleteForward: ['ctrl+delete', 'ctrl+d'],
|
|
2581
|
-
deleteLineBackward: 'cmd+shift?+backspace',
|
|
2582
|
-
deleteLineForward: ['cmd+shift?+delete', 'ctrl+k'],
|
|
2583
|
-
deleteWordBackward: 'opt+shift?+backspace',
|
|
2584
|
-
deleteWordForward: 'opt+shift?+delete',
|
|
2585
|
-
extendLineBackward: 'opt+shift+up',
|
|
2586
|
-
extendLineForward: 'opt+shift+down',
|
|
2587
|
-
redo: 'cmd+shift+z',
|
|
2588
|
-
transposeCharacter: 'ctrl+t',
|
|
2589
|
-
};
|
|
2590
|
-
const WINDOWS_HOTKEYS = {
|
|
2591
|
-
deleteWordBackward: 'ctrl+shift?+backspace',
|
|
2592
|
-
deleteWordForward: 'ctrl+shift?+delete',
|
|
2593
|
-
redo: ['ctrl+y', 'ctrl+shift+z'],
|
|
2594
|
-
};
|
|
2595
|
-
const create = (key) => {
|
|
2596
|
-
const generic = HOTKEYS_MAP[key];
|
|
2597
|
-
const apple = APPLE_HOTKEYS[key];
|
|
2598
|
-
const windows = WINDOWS_HOTKEYS[key];
|
|
2599
|
-
const isGeneric = generic && isKeyHotkey_1(generic);
|
|
2600
|
-
const isApple = apple && isKeyHotkey_1(apple);
|
|
2601
|
-
const isWindows = windows && isKeyHotkey_1(windows);
|
|
2602
|
-
return (event) => {
|
|
2603
|
-
if (isGeneric && isGeneric(event))
|
|
2604
|
-
return true;
|
|
2605
|
-
if (isApple && isApple(event))
|
|
2606
|
-
return true;
|
|
2607
|
-
if (isWindows && isWindows(event))
|
|
2608
|
-
return true;
|
|
2609
|
-
return false;
|
|
2610
|
-
};
|
|
2611
|
-
};
|
|
2612
|
-
const HOTKEYS = {
|
|
2613
|
-
isBold: create('bold'),
|
|
2614
|
-
isCompose: create('compose'),
|
|
2615
|
-
isArrowLeft: create('arrowLeft'),
|
|
2616
|
-
isArrowRight: create('arrowRight'),
|
|
2617
|
-
isArrowUp: create('arrowUp'),
|
|
2618
|
-
isArrowDown: create('arrowDown'),
|
|
2619
|
-
isDeleteBackward: create('deleteBackward'),
|
|
2620
|
-
isDeleteForward: create('deleteForward'),
|
|
2621
|
-
isDeleteLineBackward: create('deleteLineBackward'),
|
|
2622
|
-
isDeleteLineForward: create('deleteLineForward'),
|
|
2623
|
-
isDeleteWordBackward: create('deleteWordBackward'),
|
|
2624
|
-
isDeleteWordForward: create('deleteWordForward'),
|
|
2625
|
-
isExtendBackward: create('extendBackward'),
|
|
2626
|
-
isExtendForward: create('extendForward'),
|
|
2627
|
-
isExtendLineBackward: create('extendLineBackward'),
|
|
2628
|
-
isExtendLineForward: create('extendLineForward'),
|
|
2629
|
-
isItalic: create('italic'),
|
|
2630
|
-
isMoveLineBackward: create('moveLineBackward'),
|
|
2631
|
-
isMoveLineForward: create('moveLineForward'),
|
|
2632
|
-
isCtrlLeft: create('ctrlLeft'),
|
|
2633
|
-
isCtrlRight: create('ctrlRight'),
|
|
2634
|
-
isRedo: create('redo'),
|
|
2635
|
-
isShiftEnter: create('shiftEnter'),
|
|
2636
|
-
isEnter: create('enter'),
|
|
2637
|
-
isTransposeCharacter: create('transposeCharacter'),
|
|
2638
|
-
isUndo: create('undo'),
|
|
2639
|
-
isSpace: create('space'),
|
|
2640
|
-
isSelect: create('select'),
|
|
2641
|
-
isTab: create('tab'),
|
|
2642
|
-
isShiftTab: create('shiftTab'),
|
|
2643
|
-
isBackspace: create('backspace'),
|
|
2644
|
-
isCmdEnter: create('cmdEnter'),
|
|
2645
|
-
isCmd: create('cmd'),
|
|
2646
|
-
isEscape: create('escape'),
|
|
2647
|
-
isKekceburek: create('kekCeburek'),
|
|
2648
|
-
};
|
|
2649
|
-
|
|
2650
|
-
// [TODO] - defaultNode move to common event handler to avoid repeated id's
|
|
2651
|
-
({ hotkeys: HOTKEYS, defaultNode: getDefaultParagraphLine(generateId()) });
|
|
2652
|
-
|
|
2653
|
-
function _defineProperty(obj, key, value) {
|
|
2654
|
-
if (key in obj) {
|
|
2655
|
-
Object.defineProperty(obj, key, {
|
|
2656
|
-
value: value,
|
|
2657
|
-
enumerable: true,
|
|
2658
|
-
configurable: true,
|
|
2659
|
-
writable: true
|
|
2660
|
-
});
|
|
2661
|
-
} else {
|
|
2662
|
-
obj[key] = value;
|
|
2663
|
-
}
|
|
2664
|
-
|
|
2665
|
-
return obj;
|
|
2666
|
-
}
|
|
2667
|
-
|
|
2668
|
-
/**
|
|
2669
|
-
* A weak map to hold anchor tokens.
|
|
2670
|
-
*/
|
|
2671
|
-
var ANCHOR = new WeakMap();
|
|
2672
|
-
/**
|
|
2673
|
-
* A weak map to hold focus tokens.
|
|
2674
|
-
*/
|
|
2675
|
-
|
|
2676
|
-
var FOCUS = new WeakMap();
|
|
2677
|
-
/**
|
|
2678
|
-
* All tokens inherit from a single constructor for `instanceof` checking.
|
|
2679
|
-
*/
|
|
2680
|
-
|
|
2681
|
-
class Token {}
|
|
2682
|
-
/**
|
|
2683
|
-
* Anchor tokens represent the selection's anchor point.
|
|
2684
|
-
*/
|
|
2685
|
-
|
|
2686
|
-
class AnchorToken extends Token {
|
|
2687
|
-
constructor() {
|
|
2688
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2689
|
-
super();
|
|
2690
|
-
var {
|
|
2691
|
-
offset,
|
|
2692
|
-
path
|
|
2693
|
-
} = props;
|
|
2694
|
-
this.offset = offset;
|
|
2695
|
-
this.path = path;
|
|
2696
|
-
}
|
|
2697
|
-
|
|
2698
|
-
}
|
|
2699
|
-
/**
|
|
2700
|
-
* Focus tokens represent the selection's focus point.
|
|
2701
|
-
*/
|
|
2702
|
-
|
|
2703
|
-
class FocusToken extends Token {
|
|
2704
|
-
constructor() {
|
|
2705
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2706
|
-
super();
|
|
2707
|
-
var {
|
|
2708
|
-
offset,
|
|
2709
|
-
path
|
|
2710
|
-
} = props;
|
|
2711
|
-
this.offset = offset;
|
|
2712
|
-
this.path = path;
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
}
|
|
2716
|
-
/**
|
|
2717
|
-
* Add an anchor token to the end of a text node.
|
|
2718
|
-
*/
|
|
2719
|
-
|
|
2720
|
-
var addAnchorToken = (text, token) => {
|
|
2721
|
-
var offset = text.text.length;
|
|
2722
|
-
ANCHOR.set(text, [offset, token]);
|
|
2723
|
-
};
|
|
2724
|
-
/**
|
|
2725
|
-
* Get the offset if a text node has an associated anchor token.
|
|
2726
|
-
*/
|
|
2727
|
-
|
|
2728
|
-
var getAnchorOffset = text => {
|
|
2729
|
-
return ANCHOR.get(text);
|
|
2730
|
-
};
|
|
2731
|
-
/**
|
|
2732
|
-
* Add a focus token to the end of a text node.
|
|
2733
|
-
*/
|
|
2734
|
-
|
|
2735
|
-
var addFocusToken = (text, token) => {
|
|
2736
|
-
var offset = text.text.length;
|
|
2737
|
-
FOCUS.set(text, [offset, token]);
|
|
2738
|
-
};
|
|
2739
|
-
/**
|
|
2740
|
-
* Get the offset if a text node has an associated focus token.
|
|
2741
|
-
*/
|
|
2742
|
-
|
|
2743
|
-
var getFocusOffset = text => {
|
|
2744
|
-
return FOCUS.get(text);
|
|
2745
|
-
};
|
|
2746
|
-
|
|
2747
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2748
|
-
|
|
2749
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2750
|
-
/**
|
|
2751
|
-
* Resolve the descedants of a node by normalizing the children that can be
|
|
2752
|
-
* passed into a hyperscript creator function.
|
|
2753
|
-
*/
|
|
2754
|
-
|
|
2755
|
-
var STRINGS = new WeakSet();
|
|
2756
|
-
|
|
2757
|
-
var resolveDescendants = children => {
|
|
2758
|
-
var nodes = [];
|
|
2759
|
-
|
|
2760
|
-
var addChild = child => {
|
|
2761
|
-
if (child == null) {
|
|
2762
|
-
return;
|
|
2763
|
-
}
|
|
2764
|
-
|
|
2765
|
-
var prev = nodes[nodes.length - 1];
|
|
2766
|
-
|
|
2767
|
-
if (typeof child === 'string') {
|
|
2768
|
-
var text = {
|
|
2769
|
-
text: child
|
|
2770
|
-
};
|
|
2771
|
-
STRINGS.add(text);
|
|
2772
|
-
child = text;
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2775
|
-
if (Text.isText(child)) {
|
|
2776
|
-
var c = child; // HACK: fix typescript complaining
|
|
2777
|
-
|
|
2778
|
-
if (Text.isText(prev) && STRINGS.has(prev) && STRINGS.has(c) && Text.equals(prev, c, {
|
|
2779
|
-
loose: true
|
|
2780
|
-
})) {
|
|
2781
|
-
prev.text += c.text;
|
|
2782
|
-
} else {
|
|
2783
|
-
nodes.push(c);
|
|
2784
|
-
}
|
|
2785
|
-
} else if (Element.isElement(child)) {
|
|
2786
|
-
nodes.push(child);
|
|
2787
|
-
} else if (child instanceof Token) {
|
|
2788
|
-
var n = nodes[nodes.length - 1];
|
|
2789
|
-
|
|
2790
|
-
if (!Text.isText(n)) {
|
|
2791
|
-
addChild('');
|
|
2792
|
-
n = nodes[nodes.length - 1];
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
|
-
if (child instanceof AnchorToken) {
|
|
2796
|
-
addAnchorToken(n, child);
|
|
2797
|
-
} else if (child instanceof FocusToken) {
|
|
2798
|
-
addFocusToken(n, child);
|
|
2799
|
-
}
|
|
2800
|
-
} else {
|
|
2801
|
-
throw new Error("Unexpected hyperscript child object: ".concat(child));
|
|
2802
|
-
}
|
|
2803
|
-
};
|
|
2804
|
-
|
|
2805
|
-
for (var child of children.flat(Infinity)) {
|
|
2806
|
-
addChild(child);
|
|
2807
|
-
}
|
|
2808
|
-
|
|
2809
|
-
return nodes;
|
|
2810
|
-
};
|
|
2811
|
-
/**
|
|
2812
|
-
* Create an anchor token.
|
|
2813
|
-
*/
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
function createAnchor(tagName, attributes, children) {
|
|
2817
|
-
return new AnchorToken(attributes);
|
|
2818
|
-
}
|
|
2819
|
-
/**
|
|
2820
|
-
* Create an anchor and a focus token.
|
|
2821
|
-
*/
|
|
2822
|
-
|
|
2823
|
-
function createCursor(tagName, attributes, children) {
|
|
2824
|
-
return [new AnchorToken(attributes), new FocusToken(attributes)];
|
|
2825
|
-
}
|
|
2826
|
-
/**
|
|
2827
|
-
* Create an `Element` object.
|
|
2828
|
-
*/
|
|
2829
|
-
|
|
2830
|
-
function createElement(tagName, attributes, children) {
|
|
2831
|
-
return _objectSpread$1(_objectSpread$1({}, attributes), {}, {
|
|
2832
|
-
children: resolveDescendants(children)
|
|
2833
|
-
});
|
|
2834
|
-
}
|
|
2835
|
-
/**
|
|
2836
|
-
* Create a focus token.
|
|
2837
|
-
*/
|
|
2838
|
-
|
|
2839
|
-
function createFocus(tagName, attributes, children) {
|
|
2840
|
-
return new FocusToken(attributes);
|
|
2841
|
-
}
|
|
2842
|
-
/**
|
|
2843
|
-
* Create a fragment.
|
|
2844
|
-
*/
|
|
2845
|
-
|
|
2846
|
-
function createFragment(tagName, attributes, children) {
|
|
2847
|
-
return resolveDescendants(children);
|
|
2848
|
-
}
|
|
2849
|
-
/**
|
|
2850
|
-
* Create a `Selection` object.
|
|
2851
|
-
*/
|
|
2852
|
-
|
|
2853
|
-
function createSelection(tagName, attributes, children) {
|
|
2854
|
-
var anchor = children.find(c => c instanceof AnchorToken);
|
|
2855
|
-
var focus = children.find(c => c instanceof FocusToken);
|
|
2856
|
-
|
|
2857
|
-
if (!anchor || anchor.offset == null || anchor.path == null) {
|
|
2858
|
-
throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
|
-
if (!focus || focus.offset == null || focus.path == null) {
|
|
2862
|
-
throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");
|
|
2863
|
-
}
|
|
2864
|
-
|
|
2865
|
-
return _objectSpread$1({
|
|
2866
|
-
anchor: {
|
|
2867
|
-
offset: anchor.offset,
|
|
2868
|
-
path: anchor.path
|
|
2869
|
-
},
|
|
2870
|
-
focus: {
|
|
2871
|
-
offset: focus.offset,
|
|
2872
|
-
path: focus.path
|
|
2873
|
-
}
|
|
2874
|
-
}, attributes);
|
|
2875
|
-
}
|
|
2876
|
-
/**
|
|
2877
|
-
* Create a `Text` object.
|
|
2878
|
-
*/
|
|
2879
|
-
|
|
2880
|
-
function createText(tagName, attributes, children) {
|
|
2881
|
-
var nodes = resolveDescendants(children);
|
|
2882
|
-
|
|
2883
|
-
if (nodes.length > 1) {
|
|
2884
|
-
throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");
|
|
2885
|
-
}
|
|
2886
|
-
|
|
2887
|
-
var [node] = nodes;
|
|
2888
|
-
|
|
2889
|
-
if (node == null) {
|
|
2890
|
-
node = {
|
|
2891
|
-
text: ''
|
|
2892
|
-
};
|
|
2893
|
-
}
|
|
2894
|
-
|
|
2895
|
-
if (!Text.isText(node)) {
|
|
2896
|
-
throw new Error("\n The <text> hyperscript tag can only contain text content as children.");
|
|
2897
|
-
} // COMPAT: If they used the <text> tag we want to guarantee that it won't be
|
|
2898
|
-
// merge with other string children.
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
STRINGS.delete(node);
|
|
2902
|
-
Object.assign(node, attributes);
|
|
2903
|
-
return node;
|
|
2904
|
-
}
|
|
2905
|
-
/**
|
|
2906
|
-
* Create a top-level `Editor` object.
|
|
2907
|
-
*/
|
|
2908
|
-
|
|
2909
|
-
var createEditor = makeEditor => (tagName, attributes, children) => {
|
|
2910
|
-
var otherChildren = [];
|
|
2911
|
-
var selectionChild;
|
|
2912
|
-
|
|
2913
|
-
for (var child of children) {
|
|
2914
|
-
if (Range.isRange(child)) {
|
|
2915
|
-
selectionChild = child;
|
|
2916
|
-
} else {
|
|
2917
|
-
otherChildren.push(child);
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
|
|
2921
|
-
var descendants = resolveDescendants(otherChildren);
|
|
2922
|
-
var selection = {};
|
|
2923
|
-
var editor = makeEditor();
|
|
2924
|
-
Object.assign(editor, attributes);
|
|
2925
|
-
editor.children = descendants; // Search the document's texts to see if any of them have tokens associated
|
|
2926
|
-
// that need incorporated into the selection.
|
|
2927
|
-
|
|
2928
|
-
for (var [node, path] of Node.texts(editor)) {
|
|
2929
|
-
var anchor = getAnchorOffset(node);
|
|
2930
|
-
var focus = getFocusOffset(node);
|
|
2931
|
-
|
|
2932
|
-
if (anchor != null) {
|
|
2933
|
-
var [offset] = anchor;
|
|
2934
|
-
selection.anchor = {
|
|
2935
|
-
path,
|
|
2936
|
-
offset
|
|
2937
|
-
};
|
|
2938
|
-
}
|
|
2939
|
-
|
|
2940
|
-
if (focus != null) {
|
|
2941
|
-
var [_offset] = focus;
|
|
2942
|
-
selection.focus = {
|
|
2943
|
-
path,
|
|
2944
|
-
offset: _offset
|
|
2945
|
-
};
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
|
|
2949
|
-
if (selection.anchor && !selection.focus) {
|
|
2950
|
-
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");
|
|
2951
|
-
}
|
|
2952
|
-
|
|
2953
|
-
if (!selection.anchor && selection.focus) {
|
|
2954
|
-
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");
|
|
2955
|
-
}
|
|
2956
|
-
|
|
2957
|
-
if (selectionChild != null) {
|
|
2958
|
-
editor.selection = selectionChild;
|
|
2959
|
-
} else if (Range.isRange(selection)) {
|
|
2960
|
-
editor.selection = selection;
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
return editor;
|
|
2964
|
-
};
|
|
2965
|
-
|
|
2966
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2967
|
-
|
|
2968
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2969
|
-
/**
|
|
2970
|
-
* The default creators for Slate objects.
|
|
2971
|
-
*/
|
|
2972
|
-
|
|
2973
|
-
var DEFAULT_CREATORS = {
|
|
2974
|
-
anchor: createAnchor,
|
|
2975
|
-
cursor: createCursor,
|
|
2976
|
-
editor: createEditor(createEditor$1),
|
|
2977
|
-
element: createElement,
|
|
2978
|
-
focus: createFocus,
|
|
2979
|
-
fragment: createFragment,
|
|
2980
|
-
selection: createSelection,
|
|
2981
|
-
text: createText
|
|
2982
|
-
};
|
|
2983
|
-
/**
|
|
2984
|
-
* Create a Slate hyperscript function with `options`.
|
|
2985
|
-
*/
|
|
2986
|
-
|
|
2987
|
-
var createHyperscript = function createHyperscript() {
|
|
2988
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2989
|
-
var {
|
|
2990
|
-
elements = {}
|
|
2991
|
-
} = options;
|
|
2992
|
-
var elementCreators = normalizeElements(elements);
|
|
2993
|
-
|
|
2994
|
-
var creators = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CREATORS), elementCreators), options.creators);
|
|
2995
|
-
|
|
2996
|
-
var jsx = createFactory(creators);
|
|
2997
|
-
return jsx;
|
|
2998
|
-
};
|
|
2999
|
-
/**
|
|
3000
|
-
* Create a Slate hyperscript function with `options`.
|
|
3001
|
-
*/
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
var createFactory = creators => {
|
|
3005
|
-
var jsx = function jsx(tagName, attributes) {
|
|
3006
|
-
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
3007
|
-
children[_key - 2] = arguments[_key];
|
|
3008
|
-
}
|
|
3009
|
-
|
|
3010
|
-
var creator = creators[tagName];
|
|
3011
|
-
|
|
3012
|
-
if (!creator) {
|
|
3013
|
-
throw new Error("No hyperscript creator found for tag: <".concat(tagName, ">"));
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
if (attributes == null) {
|
|
3017
|
-
attributes = {};
|
|
3018
|
-
}
|
|
3019
|
-
|
|
3020
|
-
if (!isPlainObject(attributes)) {
|
|
3021
|
-
children = [attributes].concat(children);
|
|
3022
|
-
attributes = {};
|
|
3023
|
-
}
|
|
3024
|
-
|
|
3025
|
-
children = children.filter(child => Boolean(child)).flat();
|
|
3026
|
-
var ret = creator(tagName, attributes, children);
|
|
3027
|
-
return ret;
|
|
3028
|
-
};
|
|
3029
|
-
|
|
3030
|
-
return jsx;
|
|
3031
|
-
};
|
|
3032
|
-
/**
|
|
3033
|
-
* Normalize a dictionary of element shorthands into creator functions.
|
|
3034
|
-
*/
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
var normalizeElements = elements => {
|
|
3038
|
-
var creators = {};
|
|
3039
|
-
|
|
3040
|
-
var _loop = function _loop(tagName) {
|
|
3041
|
-
var props = elements[tagName];
|
|
3042
|
-
|
|
3043
|
-
if (typeof props !== 'object') {
|
|
3044
|
-
throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(tagName, "> tag you passed: ").concat(props));
|
|
3045
|
-
}
|
|
3046
|
-
|
|
3047
|
-
creators[tagName] = (tagName, attributes, children) => {
|
|
3048
|
-
return createElement('element', _objectSpread(_objectSpread({}, props), attributes), children);
|
|
3049
|
-
};
|
|
3050
|
-
};
|
|
3051
|
-
|
|
3052
|
-
for (var tagName in elements) {
|
|
3053
|
-
_loop(tagName);
|
|
3054
|
-
}
|
|
3055
|
-
|
|
3056
|
-
return creators;
|
|
3057
|
-
};
|
|
3058
|
-
|
|
3059
|
-
/**
|
|
3060
|
-
* The default hyperscript factory that ships with Slate, without custom tags.
|
|
3061
|
-
*/
|
|
3062
|
-
|
|
3063
|
-
createHyperscript();
|
|
3064
|
-
|
|
3065
|
-
function getElementClassname(params) {
|
|
3066
|
-
const { element, HTMLAttributes, className } = params;
|
|
3067
|
-
return `yoopta-${element.type} ${(HTMLAttributes === null || HTMLAttributes === void 0 ? void 0 : HTMLAttributes.className) || ''} ${className}`;
|
|
3068
|
-
}
|
|
3069
|
-
|
|
3070
|
-
function styleInject(css, ref) {
|
|
3071
|
-
if ( ref === void 0 ) ref = {};
|
|
3072
|
-
var insertAt = ref.insertAt;
|
|
3073
|
-
|
|
3074
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
3075
|
-
|
|
3076
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
3077
|
-
var style = document.createElement('style');
|
|
3078
|
-
style.type = 'text/css';
|
|
3079
|
-
|
|
3080
|
-
if (insertAt === 'top') {
|
|
3081
|
-
if (head.firstChild) {
|
|
3082
|
-
head.insertBefore(style, head.firstChild);
|
|
3083
|
-
} else {
|
|
3084
|
-
head.appendChild(style);
|
|
3085
|
-
}
|
|
3086
|
-
} else {
|
|
3087
|
-
head.appendChild(style);
|
|
3088
|
-
}
|
|
3089
|
-
|
|
3090
|
-
if (style.styleSheet) {
|
|
3091
|
-
style.styleSheet.cssText = css;
|
|
3092
|
-
} else {
|
|
3093
|
-
style.appendChild(document.createTextNode(css));
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
|
-
var css_248z = ".Blockquote-module_blockquote{border-left:3px solid;color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:4px;margin-left:0;margin-top:4px;padding:2px 14px;position:relative;width:100%}";
|
|
3098
|
-
var s = {"blockquote":"Blockquote-module_blockquote"};
|
|
3099
|
-
styleInject(css_248z);
|
|
3100
|
-
|
|
3101
|
-
const BlockquoteRender = ({ attributes, children, element, HTMLAttributes, }) => {
|
|
3102
|
-
return (jsx("blockquote", Object.assign({ draggable: false }, HTMLAttributes, { className: getElementClassname({ element, HTMLAttributes, className: s.blockquote }) }, attributes, { children: children })));
|
|
3103
|
-
};
|
|
3104
|
-
BlockquoteRender.displayName = 'Blockquote';
|
|
3105
|
-
const Blockquote = createYooptaPlugin({
|
|
3106
|
-
type: 'blockquote',
|
|
3107
|
-
renderer: (editor) => BlockquoteRender,
|
|
3108
|
-
shortcut: '>',
|
|
3109
|
-
defineElement: () => ({
|
|
3110
|
-
id: generateId(),
|
|
3111
|
-
type: 'blockquote',
|
|
3112
|
-
children: [{ text: '' }],
|
|
3113
|
-
nodeType: 'block',
|
|
3114
|
-
}),
|
|
3115
|
-
createElement: (editor, elementData) => {
|
|
3116
|
-
var _a;
|
|
3117
|
-
const node = Object.assign(Object.assign({}, Blockquote.getPlugin.defineElement()), elementData);
|
|
3118
|
-
Transforms.setNodes(editor, node, {
|
|
3119
|
-
at: (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor,
|
|
3120
|
-
});
|
|
3121
|
-
},
|
|
3122
|
-
exports: {
|
|
3123
|
-
markdown: {
|
|
3124
|
-
serialize: (node, text) => `> ${text}`,
|
|
3125
|
-
},
|
|
3126
|
-
html: {
|
|
3127
|
-
serialize: (node, children) => `<blockquote style="border-left: 3px solid; color: #292929; padding: 2px 14px; margin: 0">${children}</blockquote>`,
|
|
3128
|
-
deserialize: {
|
|
3129
|
-
nodeName: 'BLOCKQUOTE',
|
|
3130
|
-
},
|
|
3131
|
-
},
|
|
3132
|
-
},
|
|
3133
|
-
options: { searchString: 'blockquote', displayLabel: 'Blockquote' },
|
|
3134
|
-
});
|
|
3135
|
-
|
|
3136
|
-
export { Blockquote as default };
|
|
13
|
+
function te(e){return"[object Object]"===Object.prototype.toString.call(e)}U.parseHotkey=Q,U.compareHotkey=X,U.toKeyCode=Z,U.toKeyName=Y;D(".u-OdDyDx:after{color:#aaa;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);user-select:none}.xA0VqV0c{background-color:#accef7}");const re={margin:"1px 0",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"inherit",fontSize:"inherit",lineHeight:"inherit",fontWeight:"inherit"},ne=r((({attributes:t,children:r,placeholder:o,leaf:a})=>{const i=n();return e("span",Object.assign({},t,{"data-placeholder":o,style:re,className:C({"u-OdDyDx":a.withPlaceholder&&o&&i,xA0VqV0c:a.selection})},{children:r}))}));ne.displayName="TextLeaf",D('.yCQ-VdE5{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}.b--398nS{opacity:1}._6VhqH6wy{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}._6VhqH6wy:active,._6VhqH6wy:focus,._6VhqH6wy:hover{background-color:rgba(55,54,47,.08)}.k9i48GWd{width:24px}.TNeDy6y5{position:relative;transition:opacity .18s cubic-bezier(.4,0,.2,1)}.jVfkavqE:after{background-color:#007aff;bottom:-7px;content:"";height:3px;left:50%;position:absolute;transform:translateX(-50%);width:100%}._87oFW01f:before{top:-5px}._87oFW01f:after,._87oFW01f:before{background-color:inherit;content:"";height:3px;left:50%;position:absolute;transform:translateX(-50%);width:100%}._87oFW01f:after{bottom:-7px}');const oe={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",kekCeburek:"mod+enter"},ae={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},ie={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},ce=e=>{const t=oe[e],r=ae[e],n=ie[e],o=t&&ee(t),a=r&&ee(r),i=n&&ee(n);return e=>!(!o||!o(e))||!(!a||!a(e))||!(!i||!i(e))};ce("bold"),ce("compose"),ce("arrowLeft"),ce("arrowRight"),ce("arrowUp"),ce("arrowDown"),ce("deleteBackward"),ce("deleteForward"),ce("deleteLineBackward"),ce("deleteLineForward"),ce("deleteWordBackward"),ce("deleteWordForward"),ce("extendBackward"),ce("extendForward"),ce("extendLineBackward"),ce("extendLineForward"),ce("italic"),ce("moveLineBackward"),ce("moveLineForward"),ce("ctrlLeft"),ce("ctrlRight"),ce("redo"),ce("shiftEnter"),ce("enter"),ce("transposeCharacter"),ce("undo"),ce("space"),ce("select"),ce("tab"),ce("shiftTab"),ce("backspace"),ce("cmdEnter"),ce("cmd"),ce("escape"),ce("kekCeburek");function se(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}q();var le=new WeakMap,ue=new WeakMap;class fe{}class pe extends fe{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();var{offset:t,path:r}=e;this.offset=t,this.path=r}}class de extends fe{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();var{offset:t,path:r}=e;this.offset=t,this.path=r}}var he=e=>ue.get(e);function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach((function(t){se(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ge=new WeakSet,ve=e=>{var t=[],r=e=>{if(null!=e){var n=t[t.length-1];if("string"==typeof e){var o={text:e};ge.add(o),e=o}if(i.isText(e)){var a=e;i.isText(n)&&ge.has(n)&&ge.has(a)&&i.equals(n,a,{loose:!0})?n.text+=a.text:t.push(a)}else if(s.isElement(e))t.push(e);else{if(!(e instanceof fe))throw new Error("Unexpected hyperscript child object: ".concat(e));var c=t[t.length-1];i.isText(c)||(r(""),c=t[t.length-1]),e instanceof pe?((e,t)=>{var r=e.text.length;le.set(e,[r,t])})(c,e):e instanceof de&&((e,t)=>{var r=e.text.length;ue.set(e,[r,t])})(c,e)}}};for(var n of e.flat(1/0))r(n);return t};function we(e,t,r){return be(be({},t),{},{children:ve(r)})}function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach((function(t){se(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _e,je={anchor:function(e,t,r){return new pe(t)},cursor:function(e,t,r){return[new pe(t),new de(t)]},editor:(_e=c,(e,t,r)=>{var n,i=[];for(var c of r)o.isRange(c)?n=c:i.push(c);var s,l=ve(i),u={},f=_e();for(var[p,d]of(Object.assign(f,t),f.children=l,a.texts(f))){var h=(s=p,le.get(s)),y=he(p);if(null!=h){var[b]=h;u.anchor={path:d,offset:b}}if(null!=y){var[g]=y;u.focus={path:d,offset:g}}}if(u.anchor&&!u.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");if(!u.anchor&&u.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");return null!=n?f.selection=n:o.isRange(u)&&(f.selection=u),f}),element:we,focus:function(e,t,r){return new de(t)},fragment:function(e,t,r){return ve(r)},selection:function(e,t,r){var n=r.find((e=>e instanceof pe)),o=r.find((e=>e instanceof de));if(!n||null==n.offset||null==n.path)throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");if(!o||null==o.offset||null==o.path)throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");return be({anchor:{offset:n.offset,path:n.path},focus:{offset:o.offset,path:o.path}},t)},text:function(e,t,r){var n=ve(r);if(n.length>1)throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");var[o]=n;if(null==o&&(o={text:""}),!i.isText(o))throw new Error("\n The <text> hyperscript tag can only contain text content as children.");return ge.delete(o),Object.assign(o,t),o}},Oe=e=>function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];var i=e[t];if(!i)throw new Error("No hyperscript creator found for tag: <".concat(t,">"));return null==r&&(r={}),function(e){var t,r;return!1!==te(e)&&(void 0===(t=e.constructor)||!1!==te(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}(r)||(o=[r].concat(o),r={}),i(t,r,o=o.filter((e=>Boolean(e))).flat())},ke=e=>{var t={},r=function(r){var n=e[r];if("object"!=typeof n)throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(r,"> tag you passed: ").concat(n));t[r]=(e,t,r)=>we(0,xe(xe({},n),t),r)};for(var n in e)r(n);return t};function Ee(e){const{element:t,HTMLAttributes:r,className:n}=e;return`yoopta-${t.type} ${(null==r?void 0:r.className)||""} ${n}`}!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{elements:t={}}=e,r=ke(t),n=xe(xe(xe({},je),r),e.creators);Oe(n)}();var Se="fC-3DSTT";!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".fC-3DSTT{border-left:3px solid;color:inherit;font-size:16px;letter-spacing:-.003em;line-height:28px;margin-bottom:4px;margin-left:0;margin-top:4px;padding:2px 14px;position:relative;width:100%}");const Pe=({attributes:t,children:r,element:n,HTMLAttributes:o})=>e("blockquote",Object.assign({draggable:!1},o,{className:Ee({element:n,HTMLAttributes:o,className:Se})},t,{children:r}));Pe.displayName="Blockquote";const Ae=function(e){return new B(e)}({type:"blockquote",renderer:e=>Pe,shortcut:">",defineElement:()=>({id:q(),type:"blockquote",children:[{text:""}],nodeType:"block"}),createElement:(e,t)=>{var r;const n=Object.assign(Object.assign({},Ae.getPlugin.defineElement()),t);l.setNodes(e,n,{at:null===(r=e.selection)||void 0===r?void 0:r.anchor})},exports:{markdown:{serialize:(e,t)=>`> ${t}`},html:{serialize:(e,t)=>`<blockquote style="border-left: 3px solid; color: #292929; padding: 2px 14px; margin: 0">${t}</blockquote>`,deserialize:{nodeName:"BLOCKQUOTE"}}},options:{searchString:"blockquote",displayLabel:"Blockquote"}});export{Ae as default};
|