@yoopta/blockquote 1.9.13-rc → 1.9.14-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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3141
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,3151 +1,13 @@
1
- import { jsx } from 'react/jsx-runtime';
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 d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},p="[object Function]",h="[object GeneratorFunction]",y=/^\[object .+?Constructor\]$/,b="object"==typeof d&&d&&d.Object===Object&&d,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==p||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 N{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 N(s)}get getPlugin(){return f(this,P,"f")}}P=new WeakMap;var B,L={};
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
- function getFallbackUUID() {
2190
- let S4 = function () {
2191
- return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
2192
- };
2193
- return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4();
2194
- }
2195
- const generateId = () => {
2196
- var _a;
2197
- if (typeof window === 'undefined')
2198
- return nanoid();
2199
- if (typeof ((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) !== 'function')
2200
- return getFallbackUUID();
2201
- return nanoid();
2202
- };
2203
- if (typeof window !== 'undefined') {
2204
- var passiveTestOptions = {
2205
- get passive() {
2206
- return undefined;
2207
- }
2208
- };
2209
- window.addEventListener('testPassive', null, passiveTestOptions);
2210
- window.removeEventListener('testPassive', null, passiveTestOptions);
2211
- }
2212
-
2213
- const getDefaultParagraphLine = (id) => ({
2214
- id,
2215
- type: 'paragraph',
2216
- nodeType: 'block',
2217
- children: [{ text: '' }],
2218
- });
2219
-
2220
- const defaultValues$1 = {
2221
- hoveredElement: null,
2222
- isElementOptionsOpen: false,
2223
- nodeSettingsPos: null,
2224
- dndState: DEFAULT_DRAG_STATE,
2225
- disableWhileDrag: false,
2226
- DRAG_MAP: new Map(),
2227
- selectedNodeElement: null,
2228
- };
2229
- React.createContext([
2230
- defaultValues$1,
2231
- {
2232
- openNodeSettings: (_dragRef, _node) => { },
2233
- closeNodeSettings: () => { },
2234
- hoverIn: (_e, _node) => { },
2235
- triggerPlusButton: (_node) => { },
2236
- deleteNode: () => { },
2237
- duplicateNode: () => { },
2238
- copyLinkNode: () => { },
2239
- onDrop: (_e) => { },
2240
- onDragEnd: (_e) => { },
2241
- onDragEnter: (_e) => { },
2242
- onDragStart: (_e) => { },
2243
- changeHoveredNode: (_hoveredProps) => { },
2244
- changeSelectedNodeElement: (_node) => { },
2245
- },
2246
- ]);
2247
-
2248
- const defaultValues = { marks: {}, elements: {} };
2249
- React.createContext(defaultValues);
2250
-
2251
- 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}";
2252
- styleInject$1(css_248z$2);
2253
-
2254
- var lib = {};
2255
-
2256
- Object.defineProperty(lib, "__esModule", {
2257
- value: true
2258
- });
2259
-
2260
- /**
2261
- * Constants.
2262
- */
2263
-
2264
- var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
2265
-
2266
- var MODIFIERS = {
2267
- alt: 'altKey',
2268
- control: 'ctrlKey',
2269
- meta: 'metaKey',
2270
- shift: 'shiftKey'
2271
- };
2272
-
2273
- var ALIASES = {
2274
- add: '+',
2275
- break: 'pause',
2276
- cmd: 'meta',
2277
- command: 'meta',
2278
- ctl: 'control',
2279
- ctrl: 'control',
2280
- del: 'delete',
2281
- down: 'arrowdown',
2282
- esc: 'escape',
2283
- ins: 'insert',
2284
- left: 'arrowleft',
2285
- mod: IS_MAC ? 'meta' : 'control',
2286
- opt: 'alt',
2287
- option: 'alt',
2288
- return: 'enter',
2289
- right: 'arrowright',
2290
- space: ' ',
2291
- spacebar: ' ',
2292
- up: 'arrowup',
2293
- win: 'meta',
2294
- windows: 'meta'
2295
- };
2296
-
2297
- var CODES = {
2298
- backspace: 8,
2299
- tab: 9,
2300
- enter: 13,
2301
- shift: 16,
2302
- control: 17,
2303
- alt: 18,
2304
- pause: 19,
2305
- capslock: 20,
2306
- escape: 27,
2307
- ' ': 32,
2308
- pageup: 33,
2309
- pagedown: 34,
2310
- end: 35,
2311
- home: 36,
2312
- arrowleft: 37,
2313
- arrowup: 38,
2314
- arrowright: 39,
2315
- arrowdown: 40,
2316
- insert: 45,
2317
- delete: 46,
2318
- meta: 91,
2319
- numlock: 144,
2320
- scrolllock: 145,
2321
- ';': 186,
2322
- '=': 187,
2323
- ',': 188,
2324
- '-': 189,
2325
- '.': 190,
2326
- '/': 191,
2327
- '`': 192,
2328
- '[': 219,
2329
- '\\': 220,
2330
- ']': 221,
2331
- '\'': 222
2332
- };
2333
-
2334
- for (var f = 1; f < 20; f++) {
2335
- CODES['f' + f] = 111 + f;
2336
- }
2337
-
2338
- /**
2339
- * Is hotkey?
2340
- */
2341
-
2342
- function isHotkey(hotkey, options, event) {
2343
- if (options && !('byKey' in options)) {
2344
- event = options;
2345
- options = null;
2346
- }
2347
-
2348
- if (!Array.isArray(hotkey)) {
2349
- hotkey = [hotkey];
2350
- }
2351
-
2352
- var array = hotkey.map(function (string) {
2353
- return parseHotkey(string, options);
2354
- });
2355
- var check = function check(e) {
2356
- return array.some(function (object) {
2357
- return compareHotkey(object, e);
2358
- });
2359
- };
2360
- var ret = event == null ? check : check(event);
2361
- return ret;
2362
- }
2363
-
2364
- function isCodeHotkey(hotkey, event) {
2365
- return isHotkey(hotkey, event);
2366
- }
2367
-
2368
- function isKeyHotkey(hotkey, event) {
2369
- return isHotkey(hotkey, { byKey: true }, event);
2370
- }
2371
-
2372
- /**
2373
- * Parse.
2374
- */
2375
-
2376
- function parseHotkey(hotkey, options) {
2377
- var byKey = options && options.byKey;
2378
- var ret = {};
2379
-
2380
- // Special case to handle the `+` key since we use it as a separator.
2381
- hotkey = hotkey.replace('++', '+add');
2382
- var values = hotkey.split('+');
2383
- var length = values.length;
2384
-
2385
- // Ensure that all the modifiers are set to false unless the hotkey has them.
2386
-
2387
- for (var k in MODIFIERS) {
2388
- ret[MODIFIERS[k]] = false;
2389
- }
2390
-
2391
- var _iteratorNormalCompletion = true;
2392
- var _didIteratorError = false;
2393
- var _iteratorError = undefined;
2394
-
2395
- try {
2396
- for (var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2397
- var value = _step.value;
2398
-
2399
- var optional = value.endsWith('?') && value.length > 1;
2400
-
2401
- if (optional) {
2402
- value = value.slice(0, -1);
2403
- }
2404
-
2405
- var name = toKeyName(value);
2406
- var modifier = MODIFIERS[name];
2407
-
2408
- if (value.length > 1 && !modifier && !ALIASES[value] && !CODES[name]) {
2409
- throw new TypeError('Unknown modifier: "' + value + '"');
2410
- }
2411
-
2412
- if (length === 1 || !modifier) {
2413
- if (byKey) {
2414
- ret.key = name;
2415
- } else {
2416
- ret.which = toKeyCode(value);
2417
- }
2418
- }
2419
-
2420
- if (modifier) {
2421
- ret[modifier] = optional ? null : true;
2422
- }
2423
- }
2424
- } catch (err) {
2425
- _didIteratorError = true;
2426
- _iteratorError = err;
2427
- } finally {
2428
- try {
2429
- if (!_iteratorNormalCompletion && _iterator.return) {
2430
- _iterator.return();
2431
- }
2432
- } finally {
2433
- if (_didIteratorError) {
2434
- throw _iteratorError;
2435
- }
2436
- }
2437
- }
2438
-
2439
- return ret;
2440
- }
2441
-
2442
- /**
2443
- * Compare.
2444
- */
2445
-
2446
- function compareHotkey(object, event) {
2447
- for (var key in object) {
2448
- var expected = object[key];
2449
- var actual = void 0;
2450
-
2451
- if (expected == null) {
2452
- continue;
2453
- }
2454
-
2455
- if (key === 'key' && event.key != null) {
2456
- actual = event.key.toLowerCase();
2457
- } else if (key === 'which') {
2458
- actual = expected === 91 && event.which === 93 ? 91 : event.which;
2459
- } else {
2460
- actual = event[key];
2461
- }
2462
-
2463
- if (actual == null && expected === false) {
2464
- continue;
2465
- }
2466
-
2467
- if (actual !== expected) {
2468
- return false;
2469
- }
2470
- }
2471
-
2472
- return true;
2473
- }
2474
-
2475
- /**
2476
- * Utils.
2477
- */
2478
-
2479
- function toKeyCode(name) {
2480
- name = toKeyName(name);
2481
- var code = CODES[name] || name.toUpperCase().charCodeAt(0);
2482
- return code;
2483
- }
2484
-
2485
- function toKeyName(name) {
2486
- name = name.toLowerCase();
2487
- name = ALIASES[name] || name;
2488
- return name;
2489
- }
2490
-
2491
- /**
2492
- * Export.
2493
- */
2494
-
2495
- lib.default = isHotkey;
2496
- lib.isHotkey = isHotkey;
2497
- lib.isCodeHotkey = isCodeHotkey;
2498
- var isKeyHotkey_1 = lib.isKeyHotkey = isKeyHotkey;
2499
- lib.parseHotkey = parseHotkey;
2500
- lib.compareHotkey = compareHotkey;
2501
- lib.toKeyCode = toKeyCode;
2502
- lib.toKeyName = toKeyName;
2503
-
6
+ */B={get exports(){return L},set exports(e){L=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(" ")}B.exports?(t.default=t,B.exports=t):window.classNames=t}();var C=L;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]",p="[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\]$/,N=/^(?:0|[1-9]\d*)$/,B={};B[o]=B["[object Array]"]=B[w]=B[m]=B[a]=B[i]=B[x]=B[_]=B[j]=B[O]=B[k]=B[l]=B[u]=B[f]=B[h]=B[y]=B[b]=B[g]=B[E]=B[S]=B[P]=B[A]=!0,B["[object Error]"]=B[c]=B[v]=!1;var L="object"==typeof d&&d&&d.Object===Object&&d,C="object"==typeof self&&self&&self.Object===Object&&self,D=L||C||Function("return this")(),z=t&&!t.nodeType&&t,W=z&&e&&!e.nodeType&&e,U=W&&W.exports===z;function $(e,t){return e.set(t[0],t[1]),e}function q(e,t){return e.add(t),e}function M(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 R(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=U?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),de=Ce(D,"DataView"),pe=Ce(D,"Map"),he=Ce(D,"Promise"),ye=Ce(D,"Set"),be=Ce(D,"WeakMap"),ge=Ce(Object,"create"),ve=$e(de),we=$e(pe),me=$e(he),xe=$e(ye),_e=$e(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)&&qe(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Te(e,t){for(var r=e.length;r--;)if(qe(e[r][0],t))return r;return-1}function Fe(e,t,r,n,d,p,v){var F;if(n&&(F=p?n(e,d,p,v):n(e)),void 0!==F)return F;if(!Ke(e))return e;var N=Me(e);if(N){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 L=ze(e),C=L==c||L==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(L==f||L==o||C&&!p){if(R(e))return p?e:{};if(F=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:Ke(t=ae(e))?ie(t):{};var t}(C?{}:e),!t)return function(e,t){return Be(e,De(e),t)}(e,function(e,t){return e&&Be(t,Ve(t),e)}(F,e))}else{if(!B[L])return p?e:{};F=function(e,t,r,n){var o,c=e.constructor;switch(t){case w:return Ne(e);case a:case i:return new c(+e);case m:return function(e,t){var r=t?Ne(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?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case l:return function(e,t,r){return M(t?r(H(e),!0):H(e),$,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 M(t?r(K(e),!0):K(e),q,new e.constructor)}(e,n,r);case g:return o=e,Oe?Object(Oe.call(o)):{}}}(e,L,Fe,t)}}v||(v=new Pe);var D=v.get(e);if(D)return D;if(v.set(e,F),!N)var z=r?function(e){return function(e,t,r){var n=t(e);return Me(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 Ne(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function Be(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 Le(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)||R(e)?te:F).test($e(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(pe||Ee),string:new ke}},Se.prototype.delete=function(e){return Le(this,e).delete(e)},Se.prototype.get=function(e){return Le(this,e).get(e)},Se.prototype.has=function(e){return Le(this,e).has(e)},Se.prototype.set=function(e,t){return Le(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(!pe||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||N.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function $e(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function qe(e,t){return e===t||e!=e&&t!=t}(de&&ze(new de(new ArrayBuffer(1)))!=m||pe&&ze(new pe)!=l||he&&ze(he.resolve())!=p||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?$e(r):void 0;if(n)switch(n){case ve:return m;case we:return l;case me:return p;case xe:return y;case _e:return v}return t});var Me=Array.isArray;function Re(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 Re(e)?function(e,t){var r=Me(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Re(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(!Ue(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,U,$=(e=21)=>{var t;t=e-=0,!W||W.length<t?(W=Buffer.allocUnsafe(128*t),u(W),U=0):U+t>W.length&&(u(W),U=0),U+=t;let r="";for(let t=U-e;t<U;t++)r+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&W[t]];return r};const q=()=>{var e;return"undefined"==typeof window?$():"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?function(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}():$()};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,selectedNodeElement:null};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=>{},changeSelectedNodeElement: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 H={};Object.defineProperty(H,"__esModule",{value:!0});for(var I="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),K={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},V={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:I?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},G={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},J=1;J<20;J++)G["f"+J]=111+J;function Q(e,t,r){t&&!("byKey"in t)&&(r=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map((function(e){return X(e,t)})),o=function(e){return n.some((function(t){return Z(t,e)}))};return null==r?o:o(r)}function X(e,t){var r=t&&t.byKey,n={},o=(e=e.replace("++","+add")).split("+"),a=o.length;for(var i in K)n[K[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 d=u.value,p=d.endsWith("?")&&d.length>1;p&&(d=d.slice(0,-1));var h=ee(d),y=K[h];if(d.length>1&&!y&&!V[d]&&!G[h])throw new TypeError('Unknown modifier: "'+d+'"');1!==a&&y||(r?n.key=h:n.which=Y(d)),y&&(n[y]=!p||null)}}catch(e){s=!0,l=e}finally{try{!c&&f.return&&f.return()}finally{if(s)throw l}}return n}function Z(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 Y(e){return e=ee(e),G[e]||e.toUpperCase().charCodeAt(0)}function ee(e){return e=e.toLowerCase(),V[e]||e}H.default=Q,H.isHotkey=Q,H.isCodeHotkey=function(e,t){return Q(e,t)};var te=H.isKeyHotkey=function(e,t){return Q(e,{byKey:!0},t)};
2504
7
  /*!
2505
8
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
2506
9
  *
2507
10
  * Copyright (c) 2014-2017, Jon Schlinkert.
2508
11
  * Released under the MIT License.
2509
12
  */
2510
-
2511
- function isObject(o) {
2512
- return Object.prototype.toString.call(o) === '[object Object]';
2513
- }
2514
-
2515
- function isPlainObject(o) {
2516
- var ctor,prot;
2517
-
2518
- if (isObject(o) === false) return false;
2519
-
2520
- // If has modified constructor
2521
- ctor = o.constructor;
2522
- if (ctor === undefined) return true;
2523
-
2524
- // If has modified prototype
2525
- prot = ctor.prototype;
2526
- if (isObject(prot) === false) return false;
2527
-
2528
- // If constructor does not have an Object-specific method
2529
- if (prot.hasOwnProperty('isPrototypeOf') === false) {
2530
- return false;
2531
- }
2532
-
2533
- // Most likely a plain Object
2534
- return true;
2535
- }
2536
-
2537
- 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}";
2538
- var s$1 = {"placeholder":"TextLeaf-module_placeholder","selection":"TextLeaf-module_selection"};
2539
- styleInject$1(css_248z$1);
2540
-
2541
- const leafStyle = {
2542
- margin: '1px 0',
2543
- whiteSpace: 'pre-wrap',
2544
- wordBreak: 'break-word',
2545
- color: 'inherit',
2546
- fontSize: 'inherit',
2547
- lineHeight: 'inherit',
2548
- fontWeight: 'inherit',
2549
- };
2550
- const TextLeaf = memo(({ attributes, children, placeholder, leaf }) => {
2551
- const selected = useSelected();
2552
- return (jsx("span", Object.assign({}, attributes, { "data-placeholder": placeholder, style: leafStyle, className: cx({
2553
- [s$1.placeholder]: leaf.withPlaceholder && placeholder && selected,
2554
- [s$1.selection]: leaf.selection,
2555
- }) }, { children: children })));
2556
- });
2557
- TextLeaf.displayName = 'TextLeaf';
2558
-
2559
- 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}.ElementWrapper-module_isSelected{background:rgba(35,131,226,.14);border-radius:3px;inset:0;opacity:1;pointer-events:none;position:absolute;transition:background-color .18s cubic-bezier(.4,0,.2,1);z-index:81}";
2560
- styleInject$1(css_248z$4);
2561
-
2562
- const HOTKEYS_MAP = {
2563
- bold: 'mod+b',
2564
- italic: 'mod+i',
2565
- compose: ['down', 'left', 'right', 'up', 'backspace', 'enter'],
2566
- arrowLeft: 'left',
2567
- arrowUp: 'up',
2568
- arrowDown: 'down',
2569
- arrowRight: 'right',
2570
- ctrlLeft: 'ctrl+left',
2571
- escape: 'esc',
2572
- ctrlRight: 'ctrl+right',
2573
- deleteBackward: 'shift?+backspace',
2574
- backspace: 'backspace',
2575
- deleteForward: 'shift?+delete',
2576
- extendBackward: 'shift+left',
2577
- extendForward: 'shift+right',
2578
- shiftEnter: 'shift+enter',
2579
- enter: 'enter',
2580
- space: 'space',
2581
- undo: 'mod+z',
2582
- select: 'mod+a',
2583
- shiftTab: 'shift+tab',
2584
- tab: 'tab',
2585
- cmd: 'mod',
2586
- cmdEnter: 'mod+enter',
2587
- kekCeburek: 'mod+enter',
2588
- };
2589
- const APPLE_HOTKEYS = {
2590
- moveLineBackward: 'opt+up',
2591
- moveLineForward: 'opt+down',
2592
- ctrlLeft: 'opt+left',
2593
- ctrlRight: 'opt+right',
2594
- deleteBackward: ['ctrl+backspace', 'ctrl+h'],
2595
- deleteForward: ['ctrl+delete', 'ctrl+d'],
2596
- deleteLineBackward: 'cmd+shift?+backspace',
2597
- deleteLineForward: ['cmd+shift?+delete', 'ctrl+k'],
2598
- deleteWordBackward: 'opt+shift?+backspace',
2599
- deleteWordForward: 'opt+shift?+delete',
2600
- extendLineBackward: 'opt+shift+up',
2601
- extendLineForward: 'opt+shift+down',
2602
- redo: 'cmd+shift+z',
2603
- transposeCharacter: 'ctrl+t',
2604
- };
2605
- const WINDOWS_HOTKEYS = {
2606
- deleteWordBackward: 'ctrl+shift?+backspace',
2607
- deleteWordForward: 'ctrl+shift?+delete',
2608
- redo: ['ctrl+y', 'ctrl+shift+z'],
2609
- };
2610
- const create = (key) => {
2611
- const generic = HOTKEYS_MAP[key];
2612
- const apple = APPLE_HOTKEYS[key];
2613
- const windows = WINDOWS_HOTKEYS[key];
2614
- const isGeneric = generic && isKeyHotkey_1(generic);
2615
- const isApple = apple && isKeyHotkey_1(apple);
2616
- const isWindows = windows && isKeyHotkey_1(windows);
2617
- return (event) => {
2618
- if (isGeneric && isGeneric(event))
2619
- return true;
2620
- if (isApple && isApple(event))
2621
- return true;
2622
- if (isWindows && isWindows(event))
2623
- return true;
2624
- return false;
2625
- };
2626
- };
2627
- const HOTKEYS = {
2628
- isBold: create('bold'),
2629
- isCompose: create('compose'),
2630
- isArrowLeft: create('arrowLeft'),
2631
- isArrowRight: create('arrowRight'),
2632
- isArrowUp: create('arrowUp'),
2633
- isArrowDown: create('arrowDown'),
2634
- isDeleteBackward: create('deleteBackward'),
2635
- isDeleteForward: create('deleteForward'),
2636
- isDeleteLineBackward: create('deleteLineBackward'),
2637
- isDeleteLineForward: create('deleteLineForward'),
2638
- isDeleteWordBackward: create('deleteWordBackward'),
2639
- isDeleteWordForward: create('deleteWordForward'),
2640
- isExtendBackward: create('extendBackward'),
2641
- isExtendForward: create('extendForward'),
2642
- isExtendLineBackward: create('extendLineBackward'),
2643
- isExtendLineForward: create('extendLineForward'),
2644
- isItalic: create('italic'),
2645
- isMoveLineBackward: create('moveLineBackward'),
2646
- isMoveLineForward: create('moveLineForward'),
2647
- isCtrlLeft: create('ctrlLeft'),
2648
- isCtrlRight: create('ctrlRight'),
2649
- isRedo: create('redo'),
2650
- isShiftEnter: create('shiftEnter'),
2651
- isEnter: create('enter'),
2652
- isTransposeCharacter: create('transposeCharacter'),
2653
- isUndo: create('undo'),
2654
- isSpace: create('space'),
2655
- isSelect: create('select'),
2656
- isTab: create('tab'),
2657
- isShiftTab: create('shiftTab'),
2658
- isBackspace: create('backspace'),
2659
- isCmdEnter: create('cmdEnter'),
2660
- isCmd: create('cmd'),
2661
- isEscape: create('escape'),
2662
- isKekceburek: create('kekCeburek'),
2663
- };
2664
-
2665
- // [TODO] - defaultNode move to common event handler to avoid repeated id's
2666
- ({ hotkeys: HOTKEYS, defaultNode: getDefaultParagraphLine(generateId()) });
2667
-
2668
- function _defineProperty(obj, key, value) {
2669
- if (key in obj) {
2670
- Object.defineProperty(obj, key, {
2671
- value: value,
2672
- enumerable: true,
2673
- configurable: true,
2674
- writable: true
2675
- });
2676
- } else {
2677
- obj[key] = value;
2678
- }
2679
-
2680
- return obj;
2681
- }
2682
-
2683
- /**
2684
- * A weak map to hold anchor tokens.
2685
- */
2686
- var ANCHOR = new WeakMap();
2687
- /**
2688
- * A weak map to hold focus tokens.
2689
- */
2690
-
2691
- var FOCUS = new WeakMap();
2692
- /**
2693
- * All tokens inherit from a single constructor for `instanceof` checking.
2694
- */
2695
-
2696
- class Token {}
2697
- /**
2698
- * Anchor tokens represent the selection's anchor point.
2699
- */
2700
-
2701
- class AnchorToken extends Token {
2702
- constructor() {
2703
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2704
- super();
2705
- var {
2706
- offset,
2707
- path
2708
- } = props;
2709
- this.offset = offset;
2710
- this.path = path;
2711
- }
2712
-
2713
- }
2714
- /**
2715
- * Focus tokens represent the selection's focus point.
2716
- */
2717
-
2718
- class FocusToken extends Token {
2719
- constructor() {
2720
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2721
- super();
2722
- var {
2723
- offset,
2724
- path
2725
- } = props;
2726
- this.offset = offset;
2727
- this.path = path;
2728
- }
2729
-
2730
- }
2731
- /**
2732
- * Add an anchor token to the end of a text node.
2733
- */
2734
-
2735
- var addAnchorToken = (text, token) => {
2736
- var offset = text.text.length;
2737
- ANCHOR.set(text, [offset, token]);
2738
- };
2739
- /**
2740
- * Get the offset if a text node has an associated anchor token.
2741
- */
2742
-
2743
- var getAnchorOffset = text => {
2744
- return ANCHOR.get(text);
2745
- };
2746
- /**
2747
- * Add a focus token to the end of a text node.
2748
- */
2749
-
2750
- var addFocusToken = (text, token) => {
2751
- var offset = text.text.length;
2752
- FOCUS.set(text, [offset, token]);
2753
- };
2754
- /**
2755
- * Get the offset if a text node has an associated focus token.
2756
- */
2757
-
2758
- var getFocusOffset = text => {
2759
- return FOCUS.get(text);
2760
- };
2761
-
2762
- 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; }
2763
-
2764
- 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; }
2765
- /**
2766
- * Resolve the descedants of a node by normalizing the children that can be
2767
- * passed into a hyperscript creator function.
2768
- */
2769
-
2770
- var STRINGS = new WeakSet();
2771
-
2772
- var resolveDescendants = children => {
2773
- var nodes = [];
2774
-
2775
- var addChild = child => {
2776
- if (child == null) {
2777
- return;
2778
- }
2779
-
2780
- var prev = nodes[nodes.length - 1];
2781
-
2782
- if (typeof child === 'string') {
2783
- var text = {
2784
- text: child
2785
- };
2786
- STRINGS.add(text);
2787
- child = text;
2788
- }
2789
-
2790
- if (Text.isText(child)) {
2791
- var c = child; // HACK: fix typescript complaining
2792
-
2793
- if (Text.isText(prev) && STRINGS.has(prev) && STRINGS.has(c) && Text.equals(prev, c, {
2794
- loose: true
2795
- })) {
2796
- prev.text += c.text;
2797
- } else {
2798
- nodes.push(c);
2799
- }
2800
- } else if (Element.isElement(child)) {
2801
- nodes.push(child);
2802
- } else if (child instanceof Token) {
2803
- var n = nodes[nodes.length - 1];
2804
-
2805
- if (!Text.isText(n)) {
2806
- addChild('');
2807
- n = nodes[nodes.length - 1];
2808
- }
2809
-
2810
- if (child instanceof AnchorToken) {
2811
- addAnchorToken(n, child);
2812
- } else if (child instanceof FocusToken) {
2813
- addFocusToken(n, child);
2814
- }
2815
- } else {
2816
- throw new Error("Unexpected hyperscript child object: ".concat(child));
2817
- }
2818
- };
2819
-
2820
- for (var child of children.flat(Infinity)) {
2821
- addChild(child);
2822
- }
2823
-
2824
- return nodes;
2825
- };
2826
- /**
2827
- * Create an anchor token.
2828
- */
2829
-
2830
-
2831
- function createAnchor(tagName, attributes, children) {
2832
- return new AnchorToken(attributes);
2833
- }
2834
- /**
2835
- * Create an anchor and a focus token.
2836
- */
2837
-
2838
- function createCursor(tagName, attributes, children) {
2839
- return [new AnchorToken(attributes), new FocusToken(attributes)];
2840
- }
2841
- /**
2842
- * Create an `Element` object.
2843
- */
2844
-
2845
- function createElement(tagName, attributes, children) {
2846
- return _objectSpread$1(_objectSpread$1({}, attributes), {}, {
2847
- children: resolveDescendants(children)
2848
- });
2849
- }
2850
- /**
2851
- * Create a focus token.
2852
- */
2853
-
2854
- function createFocus(tagName, attributes, children) {
2855
- return new FocusToken(attributes);
2856
- }
2857
- /**
2858
- * Create a fragment.
2859
- */
2860
-
2861
- function createFragment(tagName, attributes, children) {
2862
- return resolveDescendants(children);
2863
- }
2864
- /**
2865
- * Create a `Selection` object.
2866
- */
2867
-
2868
- function createSelection(tagName, attributes, children) {
2869
- var anchor = children.find(c => c instanceof AnchorToken);
2870
- var focus = children.find(c => c instanceof FocusToken);
2871
-
2872
- if (!anchor || anchor.offset == null || anchor.path == null) {
2873
- throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");
2874
- }
2875
-
2876
- if (!focus || focus.offset == null || focus.path == null) {
2877
- throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");
2878
- }
2879
-
2880
- return _objectSpread$1({
2881
- anchor: {
2882
- offset: anchor.offset,
2883
- path: anchor.path
2884
- },
2885
- focus: {
2886
- offset: focus.offset,
2887
- path: focus.path
2888
- }
2889
- }, attributes);
2890
- }
2891
- /**
2892
- * Create a `Text` object.
2893
- */
2894
-
2895
- function createText(tagName, attributes, children) {
2896
- var nodes = resolveDescendants(children);
2897
-
2898
- if (nodes.length > 1) {
2899
- throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");
2900
- }
2901
-
2902
- var [node] = nodes;
2903
-
2904
- if (node == null) {
2905
- node = {
2906
- text: ''
2907
- };
2908
- }
2909
-
2910
- if (!Text.isText(node)) {
2911
- throw new Error("\n The <text> hyperscript tag can only contain text content as children.");
2912
- } // COMPAT: If they used the <text> tag we want to guarantee that it won't be
2913
- // merge with other string children.
2914
-
2915
-
2916
- STRINGS.delete(node);
2917
- Object.assign(node, attributes);
2918
- return node;
2919
- }
2920
- /**
2921
- * Create a top-level `Editor` object.
2922
- */
2923
-
2924
- var createEditor = makeEditor => (tagName, attributes, children) => {
2925
- var otherChildren = [];
2926
- var selectionChild;
2927
-
2928
- for (var child of children) {
2929
- if (Range.isRange(child)) {
2930
- selectionChild = child;
2931
- } else {
2932
- otherChildren.push(child);
2933
- }
2934
- }
2935
-
2936
- var descendants = resolveDescendants(otherChildren);
2937
- var selection = {};
2938
- var editor = makeEditor();
2939
- Object.assign(editor, attributes);
2940
- editor.children = descendants; // Search the document's texts to see if any of them have tokens associated
2941
- // that need incorporated into the selection.
2942
-
2943
- for (var [node, path] of Node.texts(editor)) {
2944
- var anchor = getAnchorOffset(node);
2945
- var focus = getFocusOffset(node);
2946
-
2947
- if (anchor != null) {
2948
- var [offset] = anchor;
2949
- selection.anchor = {
2950
- path,
2951
- offset
2952
- };
2953
- }
2954
-
2955
- if (focus != null) {
2956
- var [_offset] = focus;
2957
- selection.focus = {
2958
- path,
2959
- offset: _offset
2960
- };
2961
- }
2962
- }
2963
-
2964
- if (selection.anchor && !selection.focus) {
2965
- 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.");
2966
- }
2967
-
2968
- if (!selection.anchor && selection.focus) {
2969
- 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.");
2970
- }
2971
-
2972
- if (selectionChild != null) {
2973
- editor.selection = selectionChild;
2974
- } else if (Range.isRange(selection)) {
2975
- editor.selection = selection;
2976
- }
2977
-
2978
- return editor;
2979
- };
2980
-
2981
- 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; }
2982
-
2983
- 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; }
2984
- /**
2985
- * The default creators for Slate objects.
2986
- */
2987
-
2988
- var DEFAULT_CREATORS = {
2989
- anchor: createAnchor,
2990
- cursor: createCursor,
2991
- editor: createEditor(createEditor$1),
2992
- element: createElement,
2993
- focus: createFocus,
2994
- fragment: createFragment,
2995
- selection: createSelection,
2996
- text: createText
2997
- };
2998
- /**
2999
- * Create a Slate hyperscript function with `options`.
3000
- */
3001
-
3002
- var createHyperscript = function createHyperscript() {
3003
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3004
- var {
3005
- elements = {}
3006
- } = options;
3007
- var elementCreators = normalizeElements(elements);
3008
-
3009
- var creators = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CREATORS), elementCreators), options.creators);
3010
-
3011
- var jsx = createFactory(creators);
3012
- return jsx;
3013
- };
3014
- /**
3015
- * Create a Slate hyperscript function with `options`.
3016
- */
3017
-
3018
-
3019
- var createFactory = creators => {
3020
- var jsx = function jsx(tagName, attributes) {
3021
- for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
3022
- children[_key - 2] = arguments[_key];
3023
- }
3024
-
3025
- var creator = creators[tagName];
3026
-
3027
- if (!creator) {
3028
- throw new Error("No hyperscript creator found for tag: <".concat(tagName, ">"));
3029
- }
3030
-
3031
- if (attributes == null) {
3032
- attributes = {};
3033
- }
3034
-
3035
- if (!isPlainObject(attributes)) {
3036
- children = [attributes].concat(children);
3037
- attributes = {};
3038
- }
3039
-
3040
- children = children.filter(child => Boolean(child)).flat();
3041
- var ret = creator(tagName, attributes, children);
3042
- return ret;
3043
- };
3044
-
3045
- return jsx;
3046
- };
3047
- /**
3048
- * Normalize a dictionary of element shorthands into creator functions.
3049
- */
3050
-
3051
-
3052
- var normalizeElements = elements => {
3053
- var creators = {};
3054
-
3055
- var _loop = function _loop(tagName) {
3056
- var props = elements[tagName];
3057
-
3058
- if (typeof props !== 'object') {
3059
- 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));
3060
- }
3061
-
3062
- creators[tagName] = (tagName, attributes, children) => {
3063
- return createElement('element', _objectSpread(_objectSpread({}, props), attributes), children);
3064
- };
3065
- };
3066
-
3067
- for (var tagName in elements) {
3068
- _loop(tagName);
3069
- }
3070
-
3071
- return creators;
3072
- };
3073
-
3074
- /**
3075
- * The default hyperscript factory that ships with Slate, without custom tags.
3076
- */
3077
-
3078
- createHyperscript();
3079
-
3080
- function getElementClassname(params) {
3081
- const { element, HTMLAttributes, className } = params;
3082
- return `yoopta-${element.type} ${(HTMLAttributes === null || HTMLAttributes === void 0 ? void 0 : HTMLAttributes.className) || ''} ${className}`;
3083
- }
3084
-
3085
- function styleInject(css, ref) {
3086
- if ( ref === void 0 ) ref = {};
3087
- var insertAt = ref.insertAt;
3088
-
3089
- if (!css || typeof document === 'undefined') { return; }
3090
-
3091
- var head = document.head || document.getElementsByTagName('head')[0];
3092
- var style = document.createElement('style');
3093
- style.type = 'text/css';
3094
-
3095
- if (insertAt === 'top') {
3096
- if (head.firstChild) {
3097
- head.insertBefore(style, head.firstChild);
3098
- } else {
3099
- head.appendChild(style);
3100
- }
3101
- } else {
3102
- head.appendChild(style);
3103
- }
3104
-
3105
- if (style.styleSheet) {
3106
- style.styleSheet.cssText = css;
3107
- } else {
3108
- style.appendChild(document.createTextNode(css));
3109
- }
3110
- }
3111
-
3112
- 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%}";
3113
- var s = {"blockquote":"Blockquote-module_blockquote"};
3114
- styleInject(css_248z);
3115
-
3116
- const BlockquoteRender = ({ attributes, children, element, HTMLAttributes, }) => {
3117
- return (jsx("blockquote", Object.assign({ draggable: false }, HTMLAttributes, { className: getElementClassname({ element, HTMLAttributes, className: s.blockquote }) }, attributes, { children: children })));
3118
- };
3119
- BlockquoteRender.displayName = 'Blockquote';
3120
- const Blockquote = createYooptaPlugin({
3121
- type: 'blockquote',
3122
- renderer: (editor) => BlockquoteRender,
3123
- shortcut: '>',
3124
- defineElement: () => ({
3125
- id: generateId(),
3126
- type: 'blockquote',
3127
- children: [{ text: '' }],
3128
- nodeType: 'block',
3129
- }),
3130
- createElement: (editor, elementData) => {
3131
- var _a;
3132
- const node = Object.assign(Object.assign({}, Blockquote.getPlugin.defineElement()), elementData);
3133
- Transforms.setNodes(editor, node, {
3134
- at: (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor,
3135
- });
3136
- },
3137
- exports: {
3138
- markdown: {
3139
- serialize: (node, text) => `> ${text}`,
3140
- },
3141
- html: {
3142
- serialize: (node, children) => `<blockquote style="border-left: 3px solid; color: #292929; padding: 2px 14px; margin: 0">${children}</blockquote>`,
3143
- deserialize: {
3144
- nodeName: 'BLOCKQUOTE',
3145
- },
3146
- },
3147
- },
3148
- options: { searchString: 'blockquote', displayLabel: 'Blockquote' },
3149
- });
3150
-
3151
- export { Blockquote as default };
13
+ function re(e){return"[object Object]"===Object.prototype.toString.call(e)}H.parseHotkey=X,H.compareHotkey=Z,H.toKeyCode=Y,H.toKeyName=ee;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 ne={margin:"1px 0",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"inherit",fontSize:"inherit",lineHeight:"inherit",fontWeight:"inherit"},oe=r((({attributes:t,children:r,placeholder:o,leaf:a})=>{const i=n();return e("span",Object.assign({},t,{"data-placeholder":o,style:ne,className:C({"u-OdDyDx":a.withPlaceholder&&o&&i,xA0VqV0c:a.selection})},{children:r}))}));oe.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}.oz5S7EmO{background:rgba(35,131,226,.14);border-radius:3px;inset:0;opacity:1;pointer-events:none;position:absolute;transition:background-color .18s cubic-bezier(.4,0,.2,1);z-index:81}');const ae={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"},ie={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"},ce={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},se=e=>{const t=ae[e],r=ie[e],n=ce[e],o=t&&te(t),a=r&&te(r),i=n&&te(n);return e=>!(!o||!o(e))||!(!a||!a(e))||!(!i||!i(e))};se("bold"),se("compose"),se("arrowLeft"),se("arrowRight"),se("arrowUp"),se("arrowDown"),se("deleteBackward"),se("deleteForward"),se("deleteLineBackward"),se("deleteLineForward"),se("deleteWordBackward"),se("deleteWordForward"),se("extendBackward"),se("extendForward"),se("extendLineBackward"),se("extendLineForward"),se("italic"),se("moveLineBackward"),se("moveLineForward"),se("ctrlLeft"),se("ctrlRight"),se("redo"),se("shiftEnter"),se("enter"),se("transposeCharacter"),se("undo"),se("space"),se("select"),se("tab"),se("shiftTab"),se("backspace"),se("cmdEnter"),se("cmd"),se("escape"),se("kekCeburek");function le(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 ue=new WeakMap,fe=new WeakMap;class de{}class pe extends de{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 he extends de{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 ye=e=>fe.get(e);function be(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 ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){le(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ve=new WeakSet,we=e=>{var t=[],r=e=>{if(null!=e){var n=t[t.length-1];if("string"==typeof e){var o={text:e};ve.add(o),e=o}if(i.isText(e)){var a=e;i.isText(n)&&ve.has(n)&&ve.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 de))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;ue.set(e,[r,t])})(c,e):e instanceof he&&((e,t)=>{var r=e.text.length;fe.set(e,[r,t])})(c,e)}}};for(var n of e.flat(1/0))r(n);return t};function me(e,t,r){return ge(ge({},t),{},{children:we(r)})}function xe(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 _e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(r),!0).forEach((function(t){le(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var je,Oe={anchor:function(e,t,r){return new pe(t)},cursor:function(e,t,r){return[new pe(t),new he(t)]},editor:(je=c,(e,t,r)=>{var n,i=[];for(var c of r)o.isRange(c)?n=c:i.push(c);var s,l=we(i),u={},f=je();for(var[d,p]of(Object.assign(f,t),f.children=l,a.texts(f))){var h=(s=d,ue.get(s)),y=ye(d);if(null!=h){var[b]=h;u.anchor={path:p,offset:b}}if(null!=y){var[g]=y;u.focus={path:p,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:me,focus:function(e,t,r){return new he(t)},fragment:function(e,t,r){return we(r)},selection:function(e,t,r){var n=r.find((e=>e instanceof pe)),o=r.find((e=>e instanceof he));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 ge({anchor:{offset:n.offset,path:n.path},focus:{offset:o.offset,path:o.path}},t)},text:function(e,t,r){var n=we(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 ve.delete(o),Object.assign(o,t),o}},ke=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!==re(e)&&(void 0===(t=e.constructor)||!1!==re(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}(r)||(o=[r].concat(o),r={}),i(t,r,o=o.filter((e=>Boolean(e))).flat())},Ee=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)=>me(0,_e(_e({},n),t),r)};for(var n in e)r(n);return t};function Se(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=Ee(t),n=_e(_e(_e({},Oe),r),e.creators);ke(n)}();var Pe="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 Ae=({attributes:t,children:r,element:n,HTMLAttributes:o})=>e("blockquote",Object.assign({draggable:!1},o,{className:Se({element:n,HTMLAttributes:o,className:Pe})},t,{children:r}));Ae.displayName="Blockquote";const Te=function(e){return new N(e)}({type:"blockquote",renderer:e=>Ae,shortcut:">",defineElement:()=>({id:q(),type:"blockquote",children:[{text:""}],nodeType:"block"}),createElement:(e,t)=>{var r;const n=Object.assign(Object.assign({},Te.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{Te as default};