@tailor-cms/ce-accordion-edit 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeProps, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderList, resolveComponent, resolveDirective, toDisplayString, unref, withCtx, withDirectives, withKeys, withModifiers } from "vue";
1
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, h, inject, isRef, mergeProps, nextTick, onMounted, onUnmounted, openBlock, reactive, ref, renderList, resolveComponent, resolveDirective, toRefs, unref, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
2
2
  import './index.css';//#region ../../node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/stringify.js
3
3
  var byteToHex = [];
4
4
  for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
@@ -33,27 +33,29 @@ function _v4(options, buf, offset) {
33
33
  }
34
34
  //#endregion
35
35
  //#region ../manifest/dist/index.mjs
36
- var id1 = v4();
37
- var id2 = v4();
38
36
  var type = "ACCORDION";
39
37
  var name = "Accordion";
40
- var initState = () => ({
41
- embeds: {},
42
- items: {
43
- [id1]: {
44
- id: id1,
45
- header: "Accordion Item Title",
46
- body: {},
47
- position: 1
48
- },
49
- [id2]: {
50
- id: id2,
51
- header: "Accordion Item Title",
52
- body: {},
53
- position: 1
38
+ var initState = () => {
39
+ const id1 = v4();
40
+ const id2 = v4();
41
+ return {
42
+ embeds: {},
43
+ items: {
44
+ [id1]: {
45
+ id: id1,
46
+ header: "",
47
+ body: {},
48
+ position: 1
49
+ },
50
+ [id2]: {
51
+ id: id2,
52
+ header: "",
53
+ body: {},
54
+ position: 2
55
+ }
54
56
  }
55
- }
56
- });
57
+ };
58
+ };
57
59
  var ui = {
58
60
  icon: "mdi-view-day",
59
61
  forceFullWidth: true
@@ -332,6 +334,37 @@ function baseToString(value) {
332
334
  return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
333
335
  }
334
336
  //#endregion
337
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js
338
+ /** Used to match a single whitespace character. */
339
+ var reWhitespace = /\s/;
340
+ /**
341
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
342
+ * character of `string`.
343
+ *
344
+ * @private
345
+ * @param {string} string The string to inspect.
346
+ * @returns {number} Returns the index of the last non-whitespace character.
347
+ */
348
+ function trimmedEndIndex(string) {
349
+ var index = string.length;
350
+ while (index-- && reWhitespace.test(string.charAt(index)));
351
+ return index;
352
+ }
353
+ //#endregion
354
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js
355
+ /** Used to match leading whitespace. */
356
+ var reTrimStart = /^\s+/;
357
+ /**
358
+ * The base implementation of `_.trim`.
359
+ *
360
+ * @private
361
+ * @param {string} string The string to trim.
362
+ * @returns {string} Returns the trimmed string.
363
+ */
364
+ function baseTrim(string) {
365
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
366
+ }
367
+ //#endregion
335
368
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
336
369
  /**
337
370
  * Checks if `value` is the
@@ -363,6 +396,53 @@ function isObject(value) {
363
396
  return value != null && (type == "object" || type == "function");
364
397
  }
365
398
  //#endregion
399
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js
400
+ /** Used as references for various `Number` constants. */
401
+ var NAN = NaN;
402
+ /** Used to detect bad signed hexadecimal string values. */
403
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
404
+ /** Used to detect binary string values. */
405
+ var reIsBinary = /^0b[01]+$/i;
406
+ /** Used to detect octal string values. */
407
+ var reIsOctal = /^0o[0-7]+$/i;
408
+ /** Built-in method references without a dependency on `root`. */
409
+ var freeParseInt = parseInt;
410
+ /**
411
+ * Converts `value` to a number.
412
+ *
413
+ * @static
414
+ * @memberOf _
415
+ * @since 4.0.0
416
+ * @category Lang
417
+ * @param {*} value The value to process.
418
+ * @returns {number} Returns the number.
419
+ * @example
420
+ *
421
+ * _.toNumber(3.2);
422
+ * // => 3.2
423
+ *
424
+ * _.toNumber(Number.MIN_VALUE);
425
+ * // => 5e-324
426
+ *
427
+ * _.toNumber(Infinity);
428
+ * // => Infinity
429
+ *
430
+ * _.toNumber('3.2');
431
+ * // => 3.2
432
+ */
433
+ function toNumber(value) {
434
+ if (typeof value == "number") return value;
435
+ if (isSymbol(value)) return NAN;
436
+ if (isObject(value)) {
437
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
438
+ value = isObject(other) ? other + "" : other;
439
+ }
440
+ if (typeof value != "string") return value === 0 ? value : +value;
441
+ value = baseTrim(value);
442
+ var isBinary = reIsBinary.test(value);
443
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
444
+ }
445
+ //#endregion
366
446
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.js
367
447
  /**
368
448
  * This method returns the first argument it receives.
@@ -510,7 +590,7 @@ function getNative(object, key) {
510
590
  }
511
591
  //#endregion
512
592
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js
513
- var WeakMap = getNative(root, "WeakMap");
593
+ var WeakMap$1 = getNative(root, "WeakMap");
514
594
  //#endregion
515
595
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js
516
596
  /** Built-in value references. */
@@ -847,7 +927,7 @@ function copyObject(source, props, object, customizer) {
847
927
  }
848
928
  //#endregion
849
929
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js
850
- var nativeMax = Math.max;
930
+ var nativeMax$1 = Math.max;
851
931
  /**
852
932
  * A specialized version of `baseRest` which transforms the rest array.
853
933
  *
@@ -858,9 +938,9 @@ var nativeMax = Math.max;
858
938
  * @returns {Function} Returns the new function.
859
939
  */
860
940
  function overRest(func, start, transform) {
861
- start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
941
+ start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0);
862
942
  return function() {
863
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
943
+ var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
864
944
  while (++index < length) array[index] = args[start + index];
865
945
  index = -1;
866
946
  var otherArgs = Array(start + 1);
@@ -1686,7 +1766,7 @@ MapCache.prototype.set = mapCacheSet;
1686
1766
  //#endregion
1687
1767
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
1688
1768
  /** Error message constants. */
1689
- var FUNC_ERROR_TEXT = "Expected a function";
1769
+ var FUNC_ERROR_TEXT$1 = "Expected a function";
1690
1770
  /**
1691
1771
  * Creates a function that memoizes the result of `func`. If `resolver` is
1692
1772
  * provided, it determines the cache key for storing the result based on the
@@ -1732,7 +1812,7 @@ var FUNC_ERROR_TEXT = "Expected a function";
1732
1812
  * _.memoize.Cache = WeakMap;
1733
1813
  */
1734
1814
  function memoize(func, resolver) {
1735
- if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT);
1815
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT$1);
1736
1816
  var memoized = function() {
1737
1817
  var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1738
1818
  if (cache.has(key)) return cache.get(key);
@@ -2312,7 +2392,7 @@ var Set = getNative(root, "Set");
2312
2392
  var mapTag$5 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$5 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
2313
2393
  var dataViewTag$3 = "[object DataView]";
2314
2394
  /** Used to detect maps, sets, and weakmaps. */
2315
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
2395
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap$1);
2316
2396
  /**
2317
2397
  * Gets the `toStringTag` of `value`.
2318
2398
  *
@@ -2321,7 +2401,7 @@ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), prom
2321
2401
  * @returns {string} Returns the `toStringTag`.
2322
2402
  */
2323
2403
  var getTag = baseGetTag;
2324
- if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag$3 || Map && getTag(new Map()) != mapTag$5 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag$5 || WeakMap && getTag(new WeakMap()) != weakMapTag$1) getTag = function(value) {
2404
+ if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag$3 || Map && getTag(new Map()) != mapTag$5 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag$5 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) getTag = function(value) {
2325
2405
  var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2326
2406
  if (ctorString) switch (ctorString) {
2327
2407
  case dataViewCtorString: return dataViewTag$3;
@@ -3317,6 +3397,155 @@ function createBaseEach(eachFunc, fromRight) {
3317
3397
  */
3318
3398
  var baseEach = createBaseEach(baseForOwn);
3319
3399
  //#endregion
3400
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/now.js
3401
+ /**
3402
+ * Gets the timestamp of the number of milliseconds that have elapsed since
3403
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
3404
+ *
3405
+ * @static
3406
+ * @memberOf _
3407
+ * @since 2.4.0
3408
+ * @category Date
3409
+ * @returns {number} Returns the timestamp.
3410
+ * @example
3411
+ *
3412
+ * _.defer(function(stamp) {
3413
+ * console.log(_.now() - stamp);
3414
+ * }, _.now());
3415
+ * // => Logs the number of milliseconds it took for the deferred invocation.
3416
+ */
3417
+ var now = function() {
3418
+ return root.Date.now();
3419
+ };
3420
+ //#endregion
3421
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/debounce.js
3422
+ /** Error message constants. */
3423
+ var FUNC_ERROR_TEXT = "Expected a function";
3424
+ var nativeMax = Math.max, nativeMin = Math.min;
3425
+ /**
3426
+ * Creates a debounced function that delays invoking `func` until after `wait`
3427
+ * milliseconds have elapsed since the last time the debounced function was
3428
+ * invoked. The debounced function comes with a `cancel` method to cancel
3429
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
3430
+ * Provide `options` to indicate whether `func` should be invoked on the
3431
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3432
+ * with the last arguments provided to the debounced function. Subsequent
3433
+ * calls to the debounced function return the result of the last `func`
3434
+ * invocation.
3435
+ *
3436
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
3437
+ * invoked on the trailing edge of the timeout only if the debounced function
3438
+ * is invoked more than once during the `wait` timeout.
3439
+ *
3440
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
3441
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
3442
+ *
3443
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
3444
+ * for details over the differences between `_.debounce` and `_.throttle`.
3445
+ *
3446
+ * @static
3447
+ * @memberOf _
3448
+ * @since 0.1.0
3449
+ * @category Function
3450
+ * @param {Function} func The function to debounce.
3451
+ * @param {number} [wait=0] The number of milliseconds to delay.
3452
+ * @param {Object} [options={}] The options object.
3453
+ * @param {boolean} [options.leading=false]
3454
+ * Specify invoking on the leading edge of the timeout.
3455
+ * @param {number} [options.maxWait]
3456
+ * The maximum time `func` is allowed to be delayed before it's invoked.
3457
+ * @param {boolean} [options.trailing=true]
3458
+ * Specify invoking on the trailing edge of the timeout.
3459
+ * @returns {Function} Returns the new debounced function.
3460
+ * @example
3461
+ *
3462
+ * // Avoid costly calculations while the window size is in flux.
3463
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3464
+ *
3465
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
3466
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
3467
+ * 'leading': true,
3468
+ * 'trailing': false
3469
+ * }));
3470
+ *
3471
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3472
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3473
+ * var source = new EventSource('/stream');
3474
+ * jQuery(source).on('message', debounced);
3475
+ *
3476
+ * // Cancel the trailing debounced invocation.
3477
+ * jQuery(window).on('popstate', debounced.cancel);
3478
+ */
3479
+ function debounce(func, wait, options) {
3480
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
3481
+ if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
3482
+ wait = toNumber(wait) || 0;
3483
+ if (isObject(options)) {
3484
+ leading = !!options.leading;
3485
+ maxing = "maxWait" in options;
3486
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
3487
+ trailing = "trailing" in options ? !!options.trailing : trailing;
3488
+ }
3489
+ function invokeFunc(time) {
3490
+ var args = lastArgs, thisArg = lastThis;
3491
+ lastArgs = lastThis = void 0;
3492
+ lastInvokeTime = time;
3493
+ result = func.apply(thisArg, args);
3494
+ return result;
3495
+ }
3496
+ function leadingEdge(time) {
3497
+ lastInvokeTime = time;
3498
+ timerId = setTimeout(timerExpired, wait);
3499
+ return leading ? invokeFunc(time) : result;
3500
+ }
3501
+ function remainingWait(time) {
3502
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
3503
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
3504
+ }
3505
+ function shouldInvoke(time) {
3506
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
3507
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
3508
+ }
3509
+ function timerExpired() {
3510
+ var time = now();
3511
+ if (shouldInvoke(time)) return trailingEdge(time);
3512
+ timerId = setTimeout(timerExpired, remainingWait(time));
3513
+ }
3514
+ function trailingEdge(time) {
3515
+ timerId = void 0;
3516
+ if (trailing && lastArgs) return invokeFunc(time);
3517
+ lastArgs = lastThis = void 0;
3518
+ return result;
3519
+ }
3520
+ function cancel() {
3521
+ if (timerId !== void 0) clearTimeout(timerId);
3522
+ lastInvokeTime = 0;
3523
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
3524
+ }
3525
+ function flush() {
3526
+ return timerId === void 0 ? result : trailingEdge(now());
3527
+ }
3528
+ function debounced() {
3529
+ var time = now(), isInvoking = shouldInvoke(time);
3530
+ lastArgs = arguments;
3531
+ lastThis = this;
3532
+ lastCallTime = time;
3533
+ if (isInvoking) {
3534
+ if (timerId === void 0) return leadingEdge(lastCallTime);
3535
+ if (maxing) {
3536
+ clearTimeout(timerId);
3537
+ timerId = setTimeout(timerExpired, wait);
3538
+ return invokeFunc(lastCallTime);
3539
+ }
3540
+ }
3541
+ if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
3542
+ return result;
3543
+ }
3544
+ debounced.cancel = cancel;
3545
+ debounced.flush = flush;
3546
+ return debounced;
3547
+ }
3548
+ //#endregion
3320
3549
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.js
3321
3550
  /**
3322
3551
  * Casts `value` to `identity` if it's not a function.
@@ -3429,6 +3658,39 @@ function isEmpty(value) {
3429
3658
  return true;
3430
3659
  }
3431
3660
  //#endregion
3661
+ //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
3662
+ /**
3663
+ * Performs a deep comparison between two values to determine if they are
3664
+ * equivalent.
3665
+ *
3666
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
3667
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
3668
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
3669
+ * by their own, not inherited, enumerable properties. Functions and DOM
3670
+ * nodes are compared by strict equality, i.e. `===`.
3671
+ *
3672
+ * @static
3673
+ * @memberOf _
3674
+ * @since 0.1.0
3675
+ * @category Lang
3676
+ * @param {*} value The value to compare.
3677
+ * @param {*} other The other value to compare.
3678
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
3679
+ * @example
3680
+ *
3681
+ * var object = { 'a': 1 };
3682
+ * var other = { 'a': 1 };
3683
+ *
3684
+ * _.isEqual(object, other);
3685
+ * // => true
3686
+ *
3687
+ * object === other;
3688
+ * // => false
3689
+ */
3690
+ function isEqual(value, other) {
3691
+ return baseIsEqual(value, other);
3692
+ }
3693
+ //#endregion
3432
3694
  //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.js
3433
3695
  /** `Object#toString` result references. */
3434
3696
  var numberTag = "[object Number]";
@@ -3843,1445 +4105,939 @@ var sortBy = baseRest(function(collection, iteratees) {
3843
4105
  return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
3844
4106
  });
3845
4107
  //#endregion
3846
- //#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js
3847
- /** Used to generate unique IDs. */
3848
- var idCounter = 0;
3849
- /**
3850
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
3851
- *
3852
- * @static
3853
- * @since 0.1.0
3854
- * @memberOf _
3855
- * @category Util
3856
- * @param {string} [prefix=''] The value to prefix the ID with.
3857
- * @returns {string} Returns the unique ID.
3858
- * @example
3859
- *
3860
- * _.uniqueId('contact_');
3861
- * // => 'contact_104'
3862
- *
3863
- * _.uniqueId();
3864
- * // => '105'
3865
- */
3866
- function uniqueId(prefix) {
3867
- var id = ++idCounter;
3868
- return toString(prefix) + id;
4108
+ //#region ../../node_modules/.pnpm/vue-draggable-plus@0.6.1_@types+sortablejs@1.15.9/node_modules/vue-draggable-plus/dist/vue-draggable-plus.js
4109
+ var an = Object.defineProperty;
4110
+ var Pe = Object.getOwnPropertySymbols;
4111
+ var yt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable;
4112
+ var bt = (t, e, n) => e in t ? an(t, e, {
4113
+ enumerable: !0,
4114
+ configurable: !0,
4115
+ writable: !0,
4116
+ value: n
4117
+ }) : t[e] = n, fe = (t, e) => {
4118
+ for (var n in e || (e = {})) yt.call(e, n) && bt(t, n, e[n]);
4119
+ if (Pe) for (var n of Pe(e)) wt.call(e, n) && bt(t, n, e[n]);
4120
+ return t;
4121
+ };
4122
+ var $e = (t, e) => {
4123
+ var n = {};
4124
+ for (var o in t) yt.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
4125
+ if (t != null && Pe) for (var o of Pe(t)) e.indexOf(o) < 0 && wt.call(t, o) && (n[o] = t[o]);
4126
+ return n;
4127
+ };
4128
+ var Ht = "[vue-draggable-plus]: ";
4129
+ function mn(t) {
4130
+ console.warn(Ht + t);
3869
4131
  }
3870
- //#endregion
3871
- //#region ../../node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js
3872
- function _defineProperty(e, r, t) {
3873
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
3874
- value: t,
3875
- enumerable: !0,
3876
- configurable: !0,
3877
- writable: !0
3878
- }) : e[r] = t, e;
4132
+ function vn(t) {
4133
+ console.error(Ht + t);
3879
4134
  }
3880
- function _extends() {
3881
- return _extends = Object.assign ? Object.assign.bind() : function(n) {
3882
- for (var e = 1; e < arguments.length; e++) {
3883
- var t = arguments[e];
3884
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
3885
- }
3886
- return n;
3887
- }, _extends.apply(null, arguments);
4135
+ function St(t, e, n) {
4136
+ return n >= 0 && n < t.length && t.splice(n, 0, t.splice(e, 1)[0]), t;
3888
4137
  }
3889
- function ownKeys(e, r) {
3890
- var t = Object.keys(e);
3891
- if (Object.getOwnPropertySymbols) {
3892
- var o = Object.getOwnPropertySymbols(e);
3893
- r && (o = o.filter(function(r) {
3894
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
3895
- })), t.push.apply(t, o);
3896
- }
3897
- return t;
4138
+ function bn(t) {
4139
+ return t.replace(/-(\w)/g, (e, n) => n ? n.toUpperCase() : "");
3898
4140
  }
3899
- function _objectSpread2(e) {
3900
- for (var r = 1; r < arguments.length; r++) {
3901
- var t = null != arguments[r] ? arguments[r] : {};
3902
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
3903
- _defineProperty(e, r, t[r]);
3904
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
3905
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
3906
- });
3907
- }
3908
- return e;
4141
+ function yn(t) {
4142
+ return Object.keys(t).reduce((e, n) => (typeof t[n] != "undefined" && (e[bn(n)] = t[n]), e), {});
4143
+ }
4144
+ function Dt(t, e) {
4145
+ return Array.isArray(t) && t.splice(e, 1), t;
4146
+ }
4147
+ function _t(t, e, n) {
4148
+ return Array.isArray(t) && t.splice(e, 0, n), t;
4149
+ }
4150
+ function wn(t) {
4151
+ return typeof t == "undefined";
4152
+ }
4153
+ function En(t) {
4154
+ return typeof t == "string";
4155
+ }
4156
+ function Tt(t, e, n) {
4157
+ const o = t.children[n];
4158
+ t.insertBefore(e, o);
4159
+ }
4160
+ function Ke(t) {
4161
+ t.parentNode && t.parentNode.removeChild(t);
3909
4162
  }
3910
- function _objectWithoutProperties(e, t) {
3911
- if (null == e) return {};
3912
- var o, r, i = _objectWithoutPropertiesLoose(e, t);
4163
+ function Sn(t, e = document) {
4164
+ var o;
4165
+ let n = null;
4166
+ return typeof (e == null ? void 0 : e.querySelector) == "function" ? n = (o = e == null ? void 0 : e.querySelector) == null ? void 0 : o.call(e, t) : n = document.querySelector(t), n || mn(`Element not found: ${t}`), n;
4167
+ }
4168
+ function Dn(t, e, n = null) {
4169
+ return function(...o) {
4170
+ return t.apply(n, o), e.apply(n, o);
4171
+ };
4172
+ }
4173
+ function _n(t, e) {
4174
+ const n = fe({}, t);
4175
+ return Object.keys(e).forEach((o) => {
4176
+ n[o] ? n[o] = Dn(t[o], e[o]) : n[o] = e[o];
4177
+ }), n;
4178
+ }
4179
+ function Tn(t) {
4180
+ return t instanceof HTMLElement;
4181
+ }
4182
+ function Ct(t, e) {
4183
+ Object.keys(t).forEach((n) => {
4184
+ e(n, t[n]);
4185
+ });
4186
+ }
4187
+ function Cn(t) {
4188
+ return t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && (t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97);
4189
+ }
4190
+ var On = Object.assign;
4191
+ /**!
4192
+ * Sortable 1.15.2
4193
+ * @author RubaXa <trash@rubaxa.org>
4194
+ * @author owenm <owen23355@gmail.com>
4195
+ * @license MIT
4196
+ */
4197
+ function Ot(t, e) {
4198
+ var n = Object.keys(t);
3913
4199
  if (Object.getOwnPropertySymbols) {
3914
- var n = Object.getOwnPropertySymbols(e);
3915
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
4200
+ var o = Object.getOwnPropertySymbols(t);
4201
+ e && (o = o.filter(function(r) {
4202
+ return Object.getOwnPropertyDescriptor(t, r).enumerable;
4203
+ })), n.push.apply(n, o);
3916
4204
  }
3917
- return i;
3918
- }
3919
- function _objectWithoutPropertiesLoose(r, e) {
3920
- if (null == r) return {};
3921
- var t = {};
3922
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
3923
- if (-1 !== e.indexOf(n)) continue;
3924
- t[n] = r[n];
4205
+ return n;
4206
+ }
4207
+ function ne(t) {
4208
+ for (var e = 1; e < arguments.length; e++) {
4209
+ var n = arguments[e] != null ? arguments[e] : {};
4210
+ e % 2 ? Ot(Object(n), !0).forEach(function(o) {
4211
+ In(t, o, n[o]);
4212
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ot(Object(n)).forEach(function(o) {
4213
+ Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
4214
+ });
3925
4215
  }
3926
4216
  return t;
3927
4217
  }
3928
- function _toPrimitive(t, r) {
3929
- if ("object" != typeof t || !t) return t;
3930
- var e = t[Symbol.toPrimitive];
3931
- if (void 0 !== e) {
3932
- var i = e.call(t, r || "default");
3933
- if ("object" != typeof i) return i;
3934
- throw new TypeError("@@toPrimitive must return a primitive value.");
4218
+ function Ye(t) {
4219
+ "@babel/helpers - typeof";
4220
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ye = function(e) {
4221
+ return typeof e;
4222
+ } : Ye = function(e) {
4223
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
4224
+ }, Ye(t);
4225
+ }
4226
+ function In(t, e, n) {
4227
+ return e in t ? Object.defineProperty(t, e, {
4228
+ value: n,
4229
+ enumerable: !0,
4230
+ configurable: !0,
4231
+ writable: !0
4232
+ }) : t[e] = n, t;
4233
+ }
4234
+ function ie() {
4235
+ return ie = Object.assign || function(t) {
4236
+ for (var e = 1; e < arguments.length; e++) {
4237
+ var n = arguments[e];
4238
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
4239
+ }
4240
+ return t;
4241
+ }, ie.apply(this, arguments);
4242
+ }
4243
+ function An(t, e) {
4244
+ if (t == null) return {};
4245
+ var n = {}, o = Object.keys(t), r, i;
4246
+ for (i = 0; i < o.length; i++) r = o[i], !(e.indexOf(r) >= 0) && (n[r] = t[r]);
4247
+ return n;
4248
+ }
4249
+ function xn(t, e) {
4250
+ if (t == null) return {};
4251
+ var n = An(t, e), o, r;
4252
+ if (Object.getOwnPropertySymbols) {
4253
+ var i = Object.getOwnPropertySymbols(t);
4254
+ for (r = 0; r < i.length; r++) o = i[r], !(e.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(t, o) && (n[o] = t[o]);
3935
4255
  }
3936
- return ("string" === r ? String : Number)(t);
4256
+ return n;
3937
4257
  }
3938
- function _toPropertyKey(t) {
3939
- var i = _toPrimitive(t, "string");
3940
- return "symbol" == typeof i ? i : i + "";
4258
+ var Nn = "1.15.2";
4259
+ function re(t) {
4260
+ if (typeof window != "undefined" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(t);
3941
4261
  }
3942
- function _typeof(o) {
3943
- "@babel/helpers - typeof";
3944
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
3945
- return typeof o;
3946
- } : function(o) {
3947
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
3948
- }, _typeof(o);
3949
- }
3950
- var version = "1.15.7";
3951
- function userAgent(pattern) {
3952
- if (typeof window !== "undefined" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(pattern);
3953
- }
3954
- var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
3955
- var Edge = userAgent(/Edge/i);
3956
- var FireFox = userAgent(/firefox/i);
3957
- var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
3958
- var IOS = userAgent(/iP(ad|od|hone)/i);
3959
- var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
3960
- var captureMode = {
3961
- capture: false,
3962
- passive: false
4262
+ var ae = re(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), xe = re(/Edge/i), It = re(/firefox/i), Te = re(/safari/i) && !re(/chrome/i) && !re(/android/i), Lt = re(/iP(ad|od|hone)/i), Wt = re(/chrome/i) && re(/android/i), Gt = {
4263
+ capture: !1,
4264
+ passive: !1
3963
4265
  };
3964
- function on(el, event, fn) {
3965
- el.addEventListener(event, fn, !IE11OrLess && captureMode);
3966
- }
3967
- function off(el, event, fn) {
3968
- el.removeEventListener(event, fn, !IE11OrLess && captureMode);
3969
- }
3970
- function matches(el, selector) {
3971
- if (!selector) return;
3972
- selector[0] === ">" && (selector = selector.substring(1));
3973
- if (el) try {
3974
- if (el.matches) return el.matches(selector);
3975
- else if (el.msMatchesSelector) return el.msMatchesSelector(selector);
3976
- else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
3977
- } catch (_) {
3978
- return false;
4266
+ function S(t, e, n) {
4267
+ t.addEventListener(e, n, !ae && Gt);
4268
+ }
4269
+ function E(t, e, n) {
4270
+ t.removeEventListener(e, n, !ae && Gt);
4271
+ }
4272
+ function We(t, e) {
4273
+ if (e) {
4274
+ if (e[0] === ">" && (e = e.substring(1)), t) try {
4275
+ if (t.matches) return t.matches(e);
4276
+ if (t.msMatchesSelector) return t.msMatchesSelector(e);
4277
+ if (t.webkitMatchesSelector) return t.webkitMatchesSelector(e);
4278
+ } catch (n) {
4279
+ return !1;
4280
+ }
4281
+ return !1;
3979
4282
  }
3980
- return false;
3981
4283
  }
3982
- function getParentOrHost(el) {
3983
- return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
4284
+ function Pn(t) {
4285
+ return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode;
3984
4286
  }
3985
- function closest(el, selector, ctx, includeCTX) {
3986
- if (el) {
3987
- ctx = ctx || document;
4287
+ function Q(t, e, n, o) {
4288
+ if (t) {
4289
+ n = n || document;
3988
4290
  do {
3989
- if (selector != null && (selector[0] === ">" ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) return el;
3990
- if (el === ctx) break;
3991
- } while (el = getParentOrHost(el));
4291
+ if (e != null && (e[0] === ">" ? t.parentNode === n && We(t, e) : We(t, e)) || o && t === n) return t;
4292
+ if (t === n) break;
4293
+ } while (t = Pn(t));
3992
4294
  }
3993
4295
  return null;
3994
4296
  }
3995
- var R_SPACE = /\s+/g;
3996
- function toggleClass(el, name, state) {
3997
- if (el && name) if (el.classList) el.classList[state ? "add" : "remove"](name);
3998
- else el.className = ((" " + el.className + " ").replace(R_SPACE, " ").replace(" " + name + " ", " ") + (state ? " " + name : "")).replace(R_SPACE, " ");
3999
- }
4000
- function css(el, prop, val) {
4001
- var style = el && el.style;
4002
- if (style) if (val === void 0) {
4003
- if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, "");
4004
- else if (el.currentStyle) val = el.currentStyle;
4005
- return prop === void 0 ? val : val[prop];
4006
- } else {
4007
- if (!(prop in style) && prop.indexOf("webkit") === -1) prop = "-webkit-" + prop;
4008
- style[prop] = val + (typeof val === "string" ? "" : "px");
4297
+ var At = /\s+/g;
4298
+ function V(t, e, n) {
4299
+ if (t && e) if (t.classList) t.classList[n ? "add" : "remove"](e);
4300
+ else t.className = ((" " + t.className + " ").replace(At, " ").replace(" " + e + " ", " ") + (n ? " " + e : "")).replace(At, " ");
4301
+ }
4302
+ function h$1(t, e, n) {
4303
+ var o = t && t.style;
4304
+ if (o) {
4305
+ if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (n = t.currentStyle), e === void 0 ? n : n[e];
4306
+ !(e in o) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), o[e] = n + (typeof n == "string" ? "" : "px");
4009
4307
  }
4010
4308
  }
4011
- function matrix(el, selfOnly) {
4012
- var appliedTransforms = "";
4013
- if (typeof el === "string") appliedTransforms = el;
4309
+ function ye(t, e) {
4310
+ var n = "";
4311
+ if (typeof t == "string") n = t;
4014
4312
  else do {
4015
- var transform = css(el, "transform");
4016
- if (transform && transform !== "none") appliedTransforms = transform + " " + appliedTransforms;
4017
- } while (!selfOnly && (el = el.parentNode));
4018
- var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
4019
- return matrixFn && new matrixFn(appliedTransforms);
4020
- }
4021
- function find(ctx, tagName, iterator) {
4022
- if (ctx) {
4023
- var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
4024
- if (iterator) for (; i < n; i++) iterator(list[i], i);
4025
- return list;
4313
+ var o = h$1(t, "transform");
4314
+ o && o !== "none" && (n = o + " " + n);
4315
+ } while (!e && (t = t.parentNode));
4316
+ var r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
4317
+ return r && new r(n);
4318
+ }
4319
+ function jt(t, e, n) {
4320
+ if (t) {
4321
+ var o = t.getElementsByTagName(e), r = 0, i = o.length;
4322
+ if (n) for (; r < i; r++) n(o[r], r);
4323
+ return o;
4026
4324
  }
4027
4325
  return [];
4028
4326
  }
4029
- function getWindowScrollingElement() {
4030
- var scrollingElement = document.scrollingElement;
4031
- if (scrollingElement) return scrollingElement;
4032
- else return document.documentElement;
4033
- }
4034
- /**
4035
- * Returns the "bounding client rect" of given element
4036
- * @param {HTMLElement} el The element whose boundingClientRect is wanted
4037
- * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
4038
- * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
4039
- * @param {[Boolean]} undoScale Whether the container's scale() should be undone
4040
- * @param {[HTMLElement]} container The parent the element will be placed in
4041
- * @return {Object} The boundingClientRect of el, with specified adjustments
4042
- */
4043
- function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
4044
- if (!el.getBoundingClientRect && el !== window) return;
4045
- var elRect, top, left, bottom, right, height, width;
4046
- if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
4047
- elRect = el.getBoundingClientRect();
4048
- top = elRect.top;
4049
- left = elRect.left;
4050
- bottom = elRect.bottom;
4051
- right = elRect.right;
4052
- height = elRect.height;
4053
- width = elRect.width;
4054
- } else {
4055
- top = 0;
4056
- left = 0;
4057
- bottom = window.innerHeight;
4058
- right = window.innerWidth;
4059
- height = window.innerHeight;
4060
- width = window.innerWidth;
4061
- }
4062
- if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
4063
- container = container || el.parentNode;
4064
- if (!IE11OrLess) do
4065
- if (container && container.getBoundingClientRect && (css(container, "transform") !== "none" || relativeToNonStaticParent && css(container, "position") !== "static")) {
4066
- var containerRect = container.getBoundingClientRect();
4067
- top -= containerRect.top + parseInt(css(container, "border-top-width"));
4068
- left -= containerRect.left + parseInt(css(container, "border-left-width"));
4069
- bottom = top + elRect.height;
4070
- right = left + elRect.width;
4327
+ function te() {
4328
+ return document.scrollingElement || document.documentElement;
4329
+ }
4330
+ function P(t, e, n, o, r) {
4331
+ if (!(!t.getBoundingClientRect && t !== window)) {
4332
+ var i, a, l, s, u, d, f;
4333
+ if (t !== window && t.parentNode && t !== te() ? (i = t.getBoundingClientRect(), a = i.top, l = i.left, s = i.bottom, u = i.right, d = i.height, f = i.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, f = window.innerWidth), (e || n) && t !== window && (r = r || t.parentNode, !ae)) do
4334
+ if (r && r.getBoundingClientRect && (h$1(r, "transform") !== "none" || n && h$1(r, "position") !== "static")) {
4335
+ var m = r.getBoundingClientRect();
4336
+ a -= m.top + parseInt(h$1(r, "border-top-width")), l -= m.left + parseInt(h$1(r, "border-left-width")), s = a + i.height, u = l + i.width;
4071
4337
  break;
4072
4338
  }
4073
- while (container = container.parentNode);
4074
- }
4075
- if (undoScale && el !== window) {
4076
- var elMatrix = matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;
4077
- if (elMatrix) {
4078
- top /= scaleY;
4079
- left /= scaleX;
4080
- width /= scaleX;
4081
- height /= scaleY;
4082
- bottom = top + height;
4083
- right = left + width;
4339
+ while (r = r.parentNode);
4340
+ if (o && t !== window) {
4341
+ var y = ye(r || t), b = y && y.a, w = y && y.d;
4342
+ y && (a /= w, l /= b, f /= b, d /= w, s = a + d, u = l + f);
4084
4343
  }
4344
+ return {
4345
+ top: a,
4346
+ left: l,
4347
+ bottom: s,
4348
+ right: u,
4349
+ width: f,
4350
+ height: d
4351
+ };
4085
4352
  }
4086
- return {
4087
- top,
4088
- left,
4089
- bottom,
4090
- right,
4091
- width,
4092
- height
4093
- };
4094
4353
  }
4095
- /**
4096
- * Checks if a side of an element is scrolled past a side of its parents
4097
- * @param {HTMLElement} el The element who's side being scrolled out of view is in question
4098
- * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
4099
- * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
4100
- * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
4101
- */
4102
- function isScrolledPast(el, elSide, parentSide) {
4103
- var parent = getParentAutoScrollElement(el, true), elSideVal = getRect(el)[elSide];
4104
- while (parent) {
4105
- var parentSideVal = getRect(parent)[parentSide], visible = void 0;
4106
- if (parentSide === "top" || parentSide === "left") visible = elSideVal >= parentSideVal;
4107
- else visible = elSideVal <= parentSideVal;
4108
- if (!visible) return parent;
4109
- if (parent === getWindowScrollingElement()) break;
4110
- parent = getParentAutoScrollElement(parent, false);
4354
+ function xt(t, e, n) {
4355
+ for (var o = ce(t, !0), r = P(t)[e]; o;) {
4356
+ var i = P(o)[n], a = void 0;
4357
+ if (a = r >= i, !a) return o;
4358
+ if (o === te()) break;
4359
+ o = ce(o, !1);
4111
4360
  }
4112
- return false;
4361
+ return !1;
4113
4362
  }
4114
- /**
4115
- * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
4116
- * and non-draggable elements
4117
- * @param {HTMLElement} el The parent element
4118
- * @param {Number} childNum The index of the child
4119
- * @param {Object} options Parent Sortable's options
4120
- * @return {HTMLElement} The child at index childNum, or null if not found
4121
- */
4122
- function getChild(el, childNum, options, includeDragEl) {
4123
- var currentChild = 0, i = 0, children = el.children;
4124
- while (i < children.length) {
4125
- if (children[i].style.display !== "none" && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
4126
- if (currentChild === childNum) return children[i];
4127
- currentChild++;
4363
+ function we(t, e, n, o) {
4364
+ for (var r = 0, i = 0, a = t.children; i < a.length;) {
4365
+ if (a[i].style.display !== "none" && a[i] !== p.ghost && (o || a[i] !== p.dragged) && Q(a[i], n.draggable, t, !1)) {
4366
+ if (r === e) return a[i];
4367
+ r++;
4128
4368
  }
4129
4369
  i++;
4130
4370
  }
4131
4371
  return null;
4132
4372
  }
4133
- /**
4134
- * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
4135
- * @param {HTMLElement} el Parent element
4136
- * @param {selector} selector Any other elements that should be ignored
4137
- * @return {HTMLElement} The last child, ignoring ghostEl
4138
- */
4139
- function lastChild(el, selector) {
4140
- var last = el.lastElementChild;
4141
- while (last && (last === Sortable.ghost || css(last, "display") === "none" || selector && !matches(last, selector))) last = last.previousElementSibling;
4142
- return last || null;
4143
- }
4144
- /**
4145
- * Returns the index of an element within its parent for a selected set of
4146
- * elements
4147
- * @param {HTMLElement} el
4148
- * @param {selector} selector
4149
- * @return {number}
4150
- */
4151
- function index(el, selector) {
4152
- var index = 0;
4153
- if (!el || !el.parentNode) return -1;
4154
- while (el = el.previousElementSibling) if (el.nodeName.toUpperCase() !== "TEMPLATE" && el !== Sortable.clone && (!selector || matches(el, selector))) index++;
4155
- return index;
4156
- }
4157
- /**
4158
- * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
4159
- * The value is returned in real pixels.
4160
- * @param {HTMLElement} el
4161
- * @return {Array} Offsets in the format of [left, top]
4162
- */
4163
- function getRelativeScrollOffset(el) {
4164
- var offsetLeft = 0, offsetTop = 0, winScroller = getWindowScrollingElement();
4165
- if (el) do {
4166
- var elMatrix = matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;
4167
- offsetLeft += el.scrollLeft * scaleX;
4168
- offsetTop += el.scrollTop * scaleY;
4169
- } while (el !== winScroller && (el = el.parentNode));
4170
- return [offsetLeft, offsetTop];
4171
- }
4172
- /**
4173
- * Returns the index of the object within the given array
4174
- * @param {Array} arr Array that may or may not hold the object
4175
- * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
4176
- * @return {Number} The index of the object in the array, or -1
4177
- */
4178
- function indexOfObject(arr, obj) {
4179
- for (var i in arr) {
4180
- if (!arr.hasOwnProperty(i)) continue;
4181
- for (var key in obj) if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
4373
+ function ht(t, e) {
4374
+ for (var n = t.lastElementChild; n && (n === p.ghost || h$1(n, "display") === "none" || e && !We(n, e));) n = n.previousElementSibling;
4375
+ return n || null;
4376
+ }
4377
+ function J(t, e) {
4378
+ var n = 0;
4379
+ if (!t || !t.parentNode) return -1;
4380
+ for (; t = t.previousElementSibling;) t.nodeName.toUpperCase() !== "TEMPLATE" && t !== p.clone && (!e || We(t, e)) && n++;
4381
+ return n;
4382
+ }
4383
+ function Nt(t) {
4384
+ var e = 0, n = 0, o = te();
4385
+ if (t) do {
4386
+ var r = ye(t), i = r.a, a = r.d;
4387
+ e += t.scrollLeft * i, n += t.scrollTop * a;
4388
+ } while (t !== o && (t = t.parentNode));
4389
+ return [e, n];
4390
+ }
4391
+ function Mn(t, e) {
4392
+ for (var n in t) if (t.hasOwnProperty(n)) {
4393
+ for (var o in e) if (e.hasOwnProperty(o) && e[o] === t[n][o]) return Number(n);
4182
4394
  }
4183
4395
  return -1;
4184
4396
  }
4185
- function getParentAutoScrollElement(el, includeSelf) {
4186
- if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
4187
- var elem = el;
4188
- var gotSelf = false;
4397
+ function ce(t, e) {
4398
+ if (!t || !t.getBoundingClientRect) return te();
4399
+ var n = t, o = !1;
4189
4400
  do
4190
- if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
4191
- var elemCSS = css(elem);
4192
- if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == "auto" || elemCSS.overflowX == "scroll") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == "auto" || elemCSS.overflowY == "scroll")) {
4193
- if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
4194
- if (gotSelf || includeSelf) return elem;
4195
- gotSelf = true;
4401
+ if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
4402
+ var r = h$1(n);
4403
+ if (n.clientWidth < n.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
4404
+ if (!n.getBoundingClientRect || n === document.body) return te();
4405
+ if (o || e) return n;
4406
+ o = !0;
4196
4407
  }
4197
4408
  }
4198
- while (elem = elem.parentNode);
4199
- return getWindowScrollingElement();
4409
+ while (n = n.parentNode);
4410
+ return te();
4200
4411
  }
4201
- function extend(dst, src) {
4202
- if (dst && src) {
4203
- for (var key in src) if (src.hasOwnProperty(key)) dst[key] = src[key];
4204
- }
4205
- return dst;
4412
+ function Fn(t, e) {
4413
+ if (t && e) for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
4414
+ return t;
4206
4415
  }
4207
- function isRectEqual(rect1, rect2) {
4208
- return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
4416
+ function Je(t, e) {
4417
+ return Math.round(t.top) === Math.round(e.top) && Math.round(t.left) === Math.round(e.left) && Math.round(t.height) === Math.round(e.height) && Math.round(t.width) === Math.round(e.width);
4209
4418
  }
4210
- var _throttleTimeout;
4211
- function throttle(callback, ms) {
4419
+ var Ce;
4420
+ function zt(t, e) {
4212
4421
  return function() {
4213
- if (!_throttleTimeout) {
4214
- var args = arguments, _this = this;
4215
- if (args.length === 1) callback.call(_this, args[0]);
4216
- else callback.apply(_this, args);
4217
- _throttleTimeout = setTimeout(function() {
4218
- _throttleTimeout = void 0;
4219
- }, ms);
4422
+ if (!Ce) {
4423
+ var n = arguments, o = this;
4424
+ n.length === 1 ? t.call(o, n[0]) : t.apply(o, n), Ce = setTimeout(function() {
4425
+ Ce = void 0;
4426
+ }, e);
4220
4427
  }
4221
4428
  };
4222
4429
  }
4223
- function cancelThrottle() {
4224
- clearTimeout(_throttleTimeout);
4225
- _throttleTimeout = void 0;
4226
- }
4227
- function scrollBy(el, x, y) {
4228
- el.scrollLeft += x;
4229
- el.scrollTop += y;
4230
- }
4231
- function clone(el) {
4232
- var Polymer = window.Polymer;
4233
- var $ = window.jQuery || window.Zepto;
4234
- if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true);
4235
- else if ($) return $(el).clone(true)[0];
4236
- else return el.cloneNode(true);
4237
- }
4238
- function getChildContainingRectFromElement(container, options, ghostEl) {
4239
- var rect = {};
4240
- Array.from(container.children).forEach(function(child) {
4241
- var _rect$left, _rect$top, _rect$right, _rect$bottom;
4242
- if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
4243
- var childRect = getRect(child);
4244
- rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
4245
- rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
4246
- rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
4247
- rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
4248
- });
4249
- rect.width = rect.right - rect.left;
4250
- rect.height = rect.bottom - rect.top;
4251
- rect.x = rect.left;
4252
- rect.y = rect.top;
4253
- return rect;
4254
- }
4255
- var expando = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
4256
- function AnimationStateManager() {
4257
- var animationStates = [], animationCallbackId;
4430
+ function Rn() {
4431
+ clearTimeout(Ce), Ce = void 0;
4432
+ }
4433
+ function Ut(t, e, n) {
4434
+ t.scrollLeft += e, t.scrollTop += n;
4435
+ }
4436
+ function Vt(t) {
4437
+ var e = window.Polymer, n = window.jQuery || window.Zepto;
4438
+ return e && e.dom ? e.dom(t).cloneNode(!0) : n ? n(t).clone(!0)[0] : t.cloneNode(!0);
4439
+ }
4440
+ function $t(t, e, n) {
4441
+ var o = {};
4442
+ return Array.from(t.children).forEach(function(r) {
4443
+ var i, a, l, s;
4444
+ if (!(!Q(r, e.draggable, t, !1) || r.animated || r === n)) {
4445
+ var u = P(r);
4446
+ o.left = Math.min((i = o.left) !== null && i !== void 0 ? i : Infinity, u.left), o.top = Math.min((a = o.top) !== null && a !== void 0 ? a : Infinity, u.top), o.right = Math.max((l = o.right) !== null && l !== void 0 ? l : -Infinity, u.right), o.bottom = Math.max((s = o.bottom) !== null && s !== void 0 ? s : -Infinity, u.bottom);
4447
+ }
4448
+ }), o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
4449
+ }
4450
+ var q = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
4451
+ function Xn() {
4452
+ var t = [], e;
4258
4453
  return {
4259
- captureAnimationState: function captureAnimationState() {
4260
- animationStates = [];
4261
- if (!this.options.animation) return;
4262
- [].slice.call(this.el.children).forEach(function(child) {
4263
- if (css(child, "display") === "none" || child === Sortable.ghost) return;
4264
- animationStates.push({
4265
- target: child,
4266
- rect: getRect(child)
4267
- });
4268
- var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
4269
- if (child.thisAnimationDuration) {
4270
- var childMatrix = matrix(child, true);
4271
- if (childMatrix) {
4272
- fromRect.top -= childMatrix.f;
4273
- fromRect.left -= childMatrix.e;
4454
+ captureAnimationState: function() {
4455
+ if (t = [], !!this.options.animation) [].slice.call(this.el.children).forEach(function(r) {
4456
+ if (!(h$1(r, "display") === "none" || r === p.ghost)) {
4457
+ t.push({
4458
+ target: r,
4459
+ rect: P(r)
4460
+ });
4461
+ var i = ne({}, t[t.length - 1].rect);
4462
+ if (r.thisAnimationDuration) {
4463
+ var a = ye(r, !0);
4464
+ a && (i.top -= a.f, i.left -= a.e);
4274
4465
  }
4466
+ r.fromRect = i;
4275
4467
  }
4276
- child.fromRect = fromRect;
4277
4468
  });
4278
4469
  },
4279
- addAnimationState: function addAnimationState(state) {
4280
- animationStates.push(state);
4470
+ addAnimationState: function(o) {
4471
+ t.push(o);
4281
4472
  },
4282
- removeAnimationState: function removeAnimationState(target) {
4283
- animationStates.splice(indexOfObject(animationStates, { target }), 1);
4473
+ removeAnimationState: function(o) {
4474
+ t.splice(Mn(t, { target: o }), 1);
4284
4475
  },
4285
- animateAll: function animateAll(callback) {
4286
- var _this = this;
4476
+ animateAll: function(o) {
4477
+ var r = this;
4287
4478
  if (!this.options.animation) {
4288
- clearTimeout(animationCallbackId);
4289
- if (typeof callback === "function") callback();
4479
+ clearTimeout(e), typeof o == "function" && o();
4290
4480
  return;
4291
4481
  }
4292
- var animating = false, animationTime = 0;
4293
- animationStates.forEach(function(state) {
4294
- var time = 0, target = state.target, fromRect = target.fromRect, toRect = getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = matrix(target, true);
4295
- if (targetMatrix) {
4296
- toRect.top -= targetMatrix.f;
4297
- toRect.left -= targetMatrix.e;
4298
- }
4299
- target.toRect = toRect;
4300
- if (target.thisAnimationDuration) {
4301
- if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
4302
- }
4303
- if (!isRectEqual(toRect, fromRect)) {
4304
- target.prevFromRect = fromRect;
4305
- target.prevToRect = toRect;
4306
- if (!time) time = _this.options.animation;
4307
- _this.animate(target, animatingRect, toRect, time);
4308
- }
4309
- if (time) {
4310
- animating = true;
4311
- animationTime = Math.max(animationTime, time);
4312
- clearTimeout(target.animationResetTimer);
4313
- target.animationResetTimer = setTimeout(function() {
4314
- target.animationTime = 0;
4315
- target.prevFromRect = null;
4316
- target.fromRect = null;
4317
- target.prevToRect = null;
4318
- target.thisAnimationDuration = null;
4319
- }, time);
4320
- target.thisAnimationDuration = time;
4321
- }
4322
- });
4323
- clearTimeout(animationCallbackId);
4324
- if (!animating) {
4325
- if (typeof callback === "function") callback();
4326
- } else animationCallbackId = setTimeout(function() {
4327
- if (typeof callback === "function") callback();
4328
- }, animationTime);
4329
- animationStates = [];
4482
+ var i = !1, a = 0;
4483
+ t.forEach(function(l) {
4484
+ var s = 0, u = l.target, d = u.fromRect, f = P(u), m = u.prevFromRect, y = u.prevToRect, b = l.rect, w = ye(u, !0);
4485
+ w && (f.top -= w.f, f.left -= w.e), u.toRect = f, u.thisAnimationDuration && Je(m, f) && !Je(d, f) && (b.top - f.top) / (b.left - f.left) === (d.top - f.top) / (d.left - f.left) && (s = Bn(b, m, y, r.options)), Je(f, d) || (u.prevFromRect = d, u.prevToRect = f, s || (s = r.options.animation), r.animate(u, b, f, s)), s && (i = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
4486
+ u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
4487
+ }, s), u.thisAnimationDuration = s);
4488
+ }), clearTimeout(e), i ? e = setTimeout(function() {
4489
+ typeof o == "function" && o();
4490
+ }, a) : typeof o == "function" && o(), t = [];
4330
4491
  },
4331
- animate: function animate(target, currentRect, toRect, duration) {
4332
- if (duration) {
4333
- css(target, "transition", "");
4334
- css(target, "transform", "");
4335
- var elMatrix = matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);
4336
- target.animatingX = !!translateX;
4337
- target.animatingY = !!translateY;
4338
- css(target, "transform", "translate3d(" + translateX + "px," + translateY + "px,0)");
4339
- this.forRepaintDummy = repaint(target);
4340
- css(target, "transition", "transform " + duration + "ms" + (this.options.easing ? " " + this.options.easing : ""));
4341
- css(target, "transform", "translate3d(0,0,0)");
4342
- typeof target.animated === "number" && clearTimeout(target.animated);
4343
- target.animated = setTimeout(function() {
4344
- css(target, "transition", "");
4345
- css(target, "transform", "");
4346
- target.animated = false;
4347
- target.animatingX = false;
4348
- target.animatingY = false;
4349
- }, duration);
4492
+ animate: function(o, r, i, a) {
4493
+ if (a) {
4494
+ h$1(o, "transition", ""), h$1(o, "transform", "");
4495
+ var l = ye(this.el), s = l && l.a, u = l && l.d, d = (r.left - i.left) / (s || 1), f = (r.top - i.top) / (u || 1);
4496
+ o.animatingX = !!d, o.animatingY = !!f, h$1(o, "transform", "translate3d(" + d + "px," + f + "px,0)"), this.forRepaintDummy = Yn(o), h$1(o, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), h$1(o, "transform", "translate3d(0,0,0)"), typeof o.animated == "number" && clearTimeout(o.animated), o.animated = setTimeout(function() {
4497
+ h$1(o, "transition", ""), h$1(o, "transform", ""), o.animated = !1, o.animatingX = !1, o.animatingY = !1;
4498
+ }, a);
4350
4499
  }
4351
4500
  }
4352
4501
  };
4353
4502
  }
4354
- function repaint(target) {
4355
- return target.offsetWidth;
4503
+ function Yn(t) {
4504
+ return t.offsetWidth;
4356
4505
  }
4357
- function calculateRealTime(animatingRect, fromRect, toRect, options) {
4358
- return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
4506
+ function Bn(t, e, n, o) {
4507
+ return Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) / Math.sqrt(Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)) * o.animation;
4359
4508
  }
4360
- var plugins = [];
4361
- var defaults = { initializeByDefault: true };
4362
- var PluginManager = {
4363
- mount: function mount(plugin) {
4364
- for (var option in defaults) if (defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = defaults[option];
4365
- plugins.forEach(function(p) {
4366
- if (p.pluginName === plugin.pluginName) throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
4367
- });
4368
- plugins.push(plugin);
4509
+ var ge = [], Ze = { initializeByDefault: !0 }, Ne = {
4510
+ mount: function(e) {
4511
+ for (var n in Ze) Ze.hasOwnProperty(n) && !(n in e) && (e[n] = Ze[n]);
4512
+ ge.forEach(function(o) {
4513
+ if (o.pluginName === e.pluginName) throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
4514
+ }), ge.push(e);
4369
4515
  },
4370
- pluginEvent: function pluginEvent(eventName, sortable, evt) {
4371
- var _this = this;
4372
- this.eventCanceled = false;
4373
- evt.cancel = function() {
4374
- _this.eventCanceled = true;
4516
+ pluginEvent: function(e, n, o) {
4517
+ var r = this;
4518
+ this.eventCanceled = !1, o.cancel = function() {
4519
+ r.eventCanceled = !0;
4375
4520
  };
4376
- var eventNameGlobal = eventName + "Global";
4377
- plugins.forEach(function(plugin) {
4378
- if (!sortable[plugin.pluginName]) return;
4379
- if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({ sortable }, evt));
4380
- if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) sortable[plugin.pluginName][eventName](_objectSpread2({ sortable }, evt));
4521
+ var i = e + "Global";
4522
+ ge.forEach(function(a) {
4523
+ n[a.pluginName] && (n[a.pluginName][i] && n[a.pluginName][i](ne({ sortable: n }, o)), n.options[a.pluginName] && n[a.pluginName][e] && n[a.pluginName][e](ne({ sortable: n }, o)));
4381
4524
  });
4382
4525
  },
4383
- initializePlugins: function initializePlugins(sortable, el, defaults, options) {
4384
- plugins.forEach(function(plugin) {
4385
- var pluginName = plugin.pluginName;
4386
- if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
4387
- var initialized = new plugin(sortable, el, sortable.options);
4388
- initialized.sortable = sortable;
4389
- initialized.options = sortable.options;
4390
- sortable[pluginName] = initialized;
4391
- _extends(defaults, initialized.defaults);
4526
+ initializePlugins: function(e, n, o, r) {
4527
+ ge.forEach(function(l) {
4528
+ var s = l.pluginName;
4529
+ if (!(!e.options[s] && !l.initializeByDefault)) {
4530
+ var u = new l(e, n, e.options);
4531
+ u.sortable = e, u.options = e.options, e[s] = u, ie(o, u.defaults);
4532
+ }
4392
4533
  });
4393
- for (var option in sortable.options) {
4394
- if (!sortable.options.hasOwnProperty(option)) continue;
4395
- var modified = this.modifyOption(sortable, option, sortable.options[option]);
4396
- if (typeof modified !== "undefined") sortable.options[option] = modified;
4534
+ for (var i in e.options) if (e.options.hasOwnProperty(i)) {
4535
+ var a = this.modifyOption(e, i, e.options[i]);
4536
+ typeof a != "undefined" && (e.options[i] = a);
4397
4537
  }
4398
4538
  },
4399
- getEventProperties: function getEventProperties(name, sortable) {
4400
- var eventProperties = {};
4401
- plugins.forEach(function(plugin) {
4402
- if (typeof plugin.eventProperties !== "function") return;
4403
- _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
4404
- });
4405
- return eventProperties;
4539
+ getEventProperties: function(e, n) {
4540
+ var o = {};
4541
+ return ge.forEach(function(r) {
4542
+ typeof r.eventProperties == "function" && ie(o, r.eventProperties.call(n[r.pluginName], e));
4543
+ }), o;
4406
4544
  },
4407
- modifyOption: function modifyOption(sortable, name, value) {
4408
- var modifiedValue;
4409
- plugins.forEach(function(plugin) {
4410
- if (!sortable[plugin.pluginName]) return;
4411
- if (plugin.optionListeners && typeof plugin.optionListeners[name] === "function") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
4412
- });
4413
- return modifiedValue;
4545
+ modifyOption: function(e, n, o) {
4546
+ var r;
4547
+ return ge.forEach(function(i) {
4548
+ e[i.pluginName] && i.optionListeners && typeof i.optionListeners[n] == "function" && (r = i.optionListeners[n].call(e[i.pluginName], o));
4549
+ }), r;
4414
4550
  }
4415
4551
  };
4416
- function dispatchEvent(_ref) {
4417
- var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;
4418
- sortable = sortable || rootEl && rootEl[expando];
4419
- if (!sortable) return;
4420
- var evt, options = sortable.options, onName = "on" + name.charAt(0).toUpperCase() + name.substr(1);
4421
- if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent(name, {
4422
- bubbles: true,
4423
- cancelable: true
4424
- });
4425
- else {
4426
- evt = document.createEvent("Event");
4427
- evt.initEvent(name, true, true);
4552
+ function kn(t) {
4553
+ var e = t.sortable, n = t.rootEl, o = t.name, r = t.targetEl, i = t.cloneEl, a = t.toEl, l = t.fromEl, s = t.oldIndex, u = t.newIndex, d = t.oldDraggableIndex, f = t.newDraggableIndex, m = t.originalEvent, y = t.putSortable, b = t.extraEventProperties;
4554
+ if (e = e || n && n[q], !!e) {
4555
+ var w, L = e.options, G = "on" + o.charAt(0).toUpperCase() + o.substr(1);
4556
+ window.CustomEvent && !ae && !xe ? w = new CustomEvent(o, {
4557
+ bubbles: !0,
4558
+ cancelable: !0
4559
+ }) : (w = document.createEvent("Event"), w.initEvent(o, !0, !0)), w.to = a || n, w.from = l || n, w.item = r || n, w.clone = i, w.oldIndex = s, w.newIndex = u, w.oldDraggableIndex = d, w.newDraggableIndex = f, w.originalEvent = m, w.pullMode = y ? y.lastPutMode : void 0;
4560
+ var R = ne(ne({}, b), Ne.getEventProperties(o, e));
4561
+ for (var j in R) w[j] = R[j];
4562
+ n && n.dispatchEvent(w), L[G] && L[G].call(e, w);
4428
4563
  }
4429
- evt.to = toEl || rootEl;
4430
- evt.from = fromEl || rootEl;
4431
- evt.item = targetEl || rootEl;
4432
- evt.clone = cloneEl;
4433
- evt.oldIndex = oldIndex;
4434
- evt.newIndex = newIndex;
4435
- evt.oldDraggableIndex = oldDraggableIndex;
4436
- evt.newDraggableIndex = newDraggableIndex;
4437
- evt.originalEvent = originalEvent;
4438
- evt.pullMode = putSortable ? putSortable.lastPutMode : void 0;
4439
- var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
4440
- for (var option in allEventProperties) evt[option] = allEventProperties[option];
4441
- if (rootEl) rootEl.dispatchEvent(evt);
4442
- if (options[onName]) options[onName].call(sortable, evt);
4443
- }
4444
- var _excluded = ["evt"];
4445
- var pluginEvent = function pluginEvent(eventName, sortable) {
4446
- var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, originalEvent = _ref.evt, data = _objectWithoutProperties(_ref, _excluded);
4447
- PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
4448
- dragEl,
4449
- parentEl,
4450
- ghostEl,
4451
- rootEl,
4452
- nextEl,
4453
- lastDownEl,
4454
- cloneEl,
4455
- cloneHidden,
4456
- dragStarted: moved,
4457
- putSortable,
4458
- activeSortable: Sortable.active,
4459
- originalEvent,
4460
- oldIndex,
4461
- oldDraggableIndex,
4462
- newIndex,
4463
- newDraggableIndex,
4464
- hideGhostForTarget: _hideGhostForTarget,
4465
- unhideGhostForTarget: _unhideGhostForTarget,
4466
- cloneNowHidden: function cloneNowHidden() {
4467
- cloneHidden = true;
4564
+ }
4565
+ var Hn = ["evt"], z = function(e, n) {
4566
+ var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = o.evt, i = xn(o, Hn);
4567
+ Ne.pluginEvent.bind(p)(e, n, ne({
4568
+ dragEl: c,
4569
+ parentEl: O,
4570
+ ghostEl: g,
4571
+ rootEl: T,
4572
+ nextEl: pe,
4573
+ lastDownEl: Be,
4574
+ cloneEl: C,
4575
+ cloneHidden: ue,
4576
+ dragStarted: Se,
4577
+ putSortable: Y,
4578
+ activeSortable: p.active,
4579
+ originalEvent: r,
4580
+ oldIndex: be,
4581
+ oldDraggableIndex: Oe,
4582
+ newIndex: $,
4583
+ newDraggableIndex: se,
4584
+ hideGhostForTarget: Zt,
4585
+ unhideGhostForTarget: Qt,
4586
+ cloneNowHidden: function() {
4587
+ ue = !0;
4468
4588
  },
4469
- cloneNowShown: function cloneNowShown() {
4470
- cloneHidden = false;
4589
+ cloneNowShown: function() {
4590
+ ue = !1;
4471
4591
  },
4472
- dispatchSortableEvent: function dispatchSortableEvent(name) {
4473
- _dispatchEvent({
4474
- sortable,
4475
- name,
4476
- originalEvent
4592
+ dispatchSortableEvent: function(l) {
4593
+ W({
4594
+ sortable: n,
4595
+ name: l,
4596
+ originalEvent: r
4477
4597
  });
4478
4598
  }
4479
- }, data));
4599
+ }, i));
4480
4600
  };
4481
- function _dispatchEvent(info) {
4482
- dispatchEvent(_objectSpread2({
4483
- putSortable,
4484
- cloneEl,
4485
- targetEl: dragEl,
4486
- rootEl,
4487
- oldIndex,
4488
- oldDraggableIndex,
4489
- newIndex,
4490
- newDraggableIndex
4491
- }, info));
4492
- }
4493
- var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, ghostRelativeParent, ghostRelativeParentInitialScroll = [], _silent = false, savedInputChecked = [];
4494
- /** @const */
4495
- var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() {
4496
- if (!documentExists) return;
4497
- if (IE11OrLess) return false;
4498
- var el = document.createElement("x");
4499
- el.style.cssText = "pointer-events:auto";
4500
- return el.style.pointerEvents === "auto";
4501
- }(), _detectDirection = function _detectDirection(el, options) {
4502
- var elCSS = css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = getChild(el, 0, options), child2 = getChild(el, 1, options), firstChildCSS = child1 && css(child1), secondChildCSS = child2 && css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
4503
- if (elCSS.display === "flex") return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal";
4504
- if (elCSS.display === "grid") return elCSS.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
4505
- if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== "none") {
4506
- var touchingSideChild2 = firstChildCSS["float"] === "left" ? "left" : "right";
4507
- return child2 && (secondChildCSS.clear === "both" || secondChildCSS.clear === touchingSideChild2) ? "vertical" : "horizontal";
4601
+ function W(t) {
4602
+ kn(ne({
4603
+ putSortable: Y,
4604
+ cloneEl: C,
4605
+ targetEl: c,
4606
+ rootEl: T,
4607
+ oldIndex: be,
4608
+ oldDraggableIndex: Oe,
4609
+ newIndex: $,
4610
+ newDraggableIndex: se
4611
+ }, t));
4612
+ }
4613
+ var c, O, g, T, pe, Be, C, ue, be, $, Oe, se, Me, Y, ve = !1, Ge = !1, je = [], de, Z, Qe, et, Pt, Mt, Se, me, Ie, Ae = !1, Fe = !1, ke, H, tt = [], lt = !1, ze = [], Ve = typeof document != "undefined", Re = Lt, Ft = xe || ae ? "cssFloat" : "float", Ln = Ve && !Wt && !Lt && "draggable" in document.createElement("div"), qt = function() {
4614
+ if (Ve) {
4615
+ if (ae) return !1;
4616
+ var t = document.createElement("x");
4617
+ return t.style.cssText = "pointer-events:auto", t.style.pointerEvents === "auto";
4508
4618
  }
4509
- return child1 && (firstChildCSS.display === "block" || firstChildCSS.display === "flex" || firstChildCSS.display === "table" || firstChildCSS.display === "grid" || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === "none" || child2 && elCSS[CSSFloatProperty] === "none" && firstChildWidth + secondChildWidth > elWidth) ? "vertical" : "horizontal";
4510
- }, _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
4511
- var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;
4512
- return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
4513
- }, _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
4514
- var ret;
4515
- sortables.some(function(sortable) {
4516
- var threshold = sortable[expando].options.emptyInsertThreshold;
4517
- if (!threshold || lastChild(sortable)) return;
4518
- var rect = getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
4519
- if (insideHorizontally && insideVertically) return ret = sortable;
4520
- });
4521
- return ret;
4522
- }, _prepareGroup = function _prepareGroup(options) {
4523
- function toFn(value, pull) {
4524
- return function(to, from, dragEl, evt) {
4525
- var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
4526
- if (value == null && (pull || sameGroup)) return true;
4527
- else if (value == null || value === false) return false;
4528
- else if (pull && value === "clone") return value;
4529
- else if (typeof value === "function") return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
4530
- else {
4531
- var otherGroup = (pull ? to : from).options.group.name;
4532
- return value === true || typeof value === "string" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
4533
- }
4619
+ }(), Kt = function(e, n) {
4620
+ var o = h$1(e), r = parseInt(o.width) - parseInt(o.paddingLeft) - parseInt(o.paddingRight) - parseInt(o.borderLeftWidth) - parseInt(o.borderRightWidth), i = we(e, 0, n), a = we(e, 1, n), l = i && h$1(i), s = a && h$1(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + P(i).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + P(a).width;
4621
+ if (o.display === "flex") return o.flexDirection === "column" || o.flexDirection === "column-reverse" ? "vertical" : "horizontal";
4622
+ if (o.display === "grid") return o.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
4623
+ if (i && l.float && l.float !== "none") {
4624
+ var f = l.float === "left" ? "left" : "right";
4625
+ return a && (s.clear === "both" || s.clear === f) ? "vertical" : "horizontal";
4626
+ }
4627
+ return i && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= r && o[Ft] === "none" || a && o[Ft] === "none" && u + d > r) ? "vertical" : "horizontal";
4628
+ }, Wn = function(e, n, o) {
4629
+ var r = o ? e.left : e.top, i = o ? e.right : e.bottom, a = o ? e.width : e.height, l = o ? n.left : n.top, s = o ? n.right : n.bottom, u = o ? n.width : n.height;
4630
+ return r === l || i === s || r + a / 2 === l + u / 2;
4631
+ }, Gn = function(e, n) {
4632
+ var o;
4633
+ return je.some(function(r) {
4634
+ var i = r[q].options.emptyInsertThreshold;
4635
+ if (!(!i || ht(r))) {
4636
+ var a = P(r), l = e >= a.left - i && e <= a.right + i, s = n >= a.top - i && n <= a.bottom + i;
4637
+ if (l && s) return o = r;
4638
+ }
4639
+ }), o;
4640
+ }, Jt = function(e) {
4641
+ function n(i, a) {
4642
+ return function(l, s, u, d) {
4643
+ var f = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
4644
+ if (i == null && (a || f)) return !0;
4645
+ if (i == null || i === !1) return !1;
4646
+ if (a && i === "clone") return i;
4647
+ if (typeof i == "function") return n(i(l, s, u, d), a)(l, s, u, d);
4648
+ var m = (a ? l : s).options.group.name;
4649
+ return i === !0 || typeof i == "string" && i === m || i.join && i.indexOf(m) > -1;
4534
4650
  };
4535
4651
  }
4536
- var group = {};
4537
- var originalGroup = options.group;
4538
- if (!originalGroup || _typeof(originalGroup) != "object") originalGroup = { name: originalGroup };
4539
- group.name = originalGroup.name;
4540
- group.checkPull = toFn(originalGroup.pull, true);
4541
- group.checkPut = toFn(originalGroup.put);
4542
- group.revertClone = originalGroup.revertClone;
4543
- options.group = group;
4544
- }, _hideGhostForTarget = function _hideGhostForTarget() {
4545
- if (!supportCssPointerEvents && ghostEl) css(ghostEl, "display", "none");
4546
- }, _unhideGhostForTarget = function _unhideGhostForTarget() {
4547
- if (!supportCssPointerEvents && ghostEl) css(ghostEl, "display", "");
4652
+ var o = {}, r = e.group;
4653
+ (!r || Ye(r) != "object") && (r = { name: r }), o.name = r.name, o.checkPull = n(r.pull, !0), o.checkPut = n(r.put), o.revertClone = r.revertClone, e.group = o;
4654
+ }, Zt = function() {
4655
+ !qt && g && h$1(g, "display", "none");
4656
+ }, Qt = function() {
4657
+ !qt && g && h$1(g, "display", "");
4548
4658
  };
4549
- if (documentExists && !ChromeForAndroid) document.addEventListener("click", function(evt) {
4550
- if (ignoreNextClick) {
4551
- evt.preventDefault();
4552
- evt.stopPropagation && evt.stopPropagation();
4553
- evt.stopImmediatePropagation && evt.stopImmediatePropagation();
4554
- ignoreNextClick = false;
4555
- return false;
4556
- }
4557
- }, true);
4558
- var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
4559
- if (dragEl) {
4560
- evt = evt.touches ? evt.touches[0] : evt;
4561
- var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
4562
- if (nearest) {
4563
- var event = {};
4564
- for (var i in evt) if (evt.hasOwnProperty(i)) event[i] = evt[i];
4565
- event.target = event.rootEl = nearest;
4566
- event.preventDefault = void 0;
4567
- event.stopPropagation = void 0;
4568
- nearest[expando]._onDragOver(event);
4659
+ Ve && !Wt && document.addEventListener("click", function(t) {
4660
+ if (Ge) return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), Ge = !1, !1;
4661
+ }, !0);
4662
+ var he = function(e) {
4663
+ if (c) {
4664
+ e = e.touches ? e.touches[0] : e;
4665
+ var n = Gn(e.clientX, e.clientY);
4666
+ if (n) {
4667
+ var o = {};
4668
+ for (var r in e) e.hasOwnProperty(r) && (o[r] = e[r]);
4669
+ o.target = o.rootEl = n, o.preventDefault = void 0, o.stopPropagation = void 0, n[q]._onDragOver(o);
4569
4670
  }
4570
4671
  }
4672
+ }, jn = function(e) {
4673
+ c && c.parentNode[q]._isOutsideThisEl(e.target);
4571
4674
  };
4572
- var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
4573
- if (dragEl) dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
4574
- };
4575
- /**
4576
- * @class Sortable
4577
- * @param {HTMLElement} el
4578
- * @param {Object} [options]
4579
- */
4580
- function Sortable(el, options) {
4581
- if (!(el && el.nodeType && el.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
4582
- this.el = el;
4583
- this.options = options = _extends({}, options);
4584
- el[expando] = this;
4585
- var defaults = {
4675
+ function p(t, e) {
4676
+ if (!(t && t.nodeType && t.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
4677
+ this.el = t, this.options = e = ie({}, e), t[q] = this;
4678
+ var n = {
4586
4679
  group: null,
4587
- sort: true,
4588
- disabled: false,
4680
+ sort: !0,
4681
+ disabled: !1,
4589
4682
  store: null,
4590
4683
  handle: null,
4591
- draggable: /^[uo]l$/i.test(el.nodeName) ? ">li" : ">*",
4684
+ draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*",
4592
4685
  swapThreshold: 1,
4593
- invertSwap: false,
4686
+ invertSwap: !1,
4594
4687
  invertedSwapThreshold: null,
4595
- removeCloneOnHide: true,
4596
- direction: function direction() {
4597
- return _detectDirection(el, this.options);
4688
+ removeCloneOnHide: !0,
4689
+ direction: function() {
4690
+ return Kt(t, this.options);
4598
4691
  },
4599
4692
  ghostClass: "sortable-ghost",
4600
4693
  chosenClass: "sortable-chosen",
4601
4694
  dragClass: "sortable-drag",
4602
4695
  ignore: "a, img",
4603
4696
  filter: null,
4604
- preventOnFilter: true,
4697
+ preventOnFilter: !0,
4605
4698
  animation: 0,
4606
4699
  easing: null,
4607
- setData: function setData(dataTransfer, dragEl) {
4608
- dataTransfer.setData("Text", dragEl.textContent);
4700
+ setData: function(a, l) {
4701
+ a.setData("Text", l.textContent);
4609
4702
  },
4610
- dropBubble: false,
4611
- dragoverBubble: false,
4703
+ dropBubble: !1,
4704
+ dragoverBubble: !1,
4612
4705
  dataIdAttr: "data-id",
4613
4706
  delay: 0,
4614
- delayOnTouchOnly: false,
4707
+ delayOnTouchOnly: !1,
4615
4708
  touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
4616
- forceFallback: false,
4709
+ forceFallback: !1,
4617
4710
  fallbackClass: "sortable-fallback",
4618
- fallbackOnBody: false,
4711
+ fallbackOnBody: !1,
4619
4712
  fallbackTolerance: 0,
4620
4713
  fallbackOffset: {
4621
4714
  x: 0,
4622
4715
  y: 0
4623
4716
  },
4624
- supportPointer: Sortable.supportPointer !== false && "PointerEvent" in window && (!Safari || IOS),
4717
+ supportPointer: p.supportPointer !== !1 && "PointerEvent" in window && !Te,
4625
4718
  emptyInsertThreshold: 5
4626
4719
  };
4627
- PluginManager.initializePlugins(this, el, defaults);
4628
- for (var name in defaults) !(name in options) && (options[name] = defaults[name]);
4629
- _prepareGroup(options);
4630
- for (var fn in this) if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this);
4631
- this.nativeDraggable = options.forceFallback ? false : supportDraggable;
4632
- if (this.nativeDraggable) this.options.touchStartThreshold = 1;
4633
- if (options.supportPointer) on(el, "pointerdown", this._onTapStart);
4634
- else {
4635
- on(el, "mousedown", this._onTapStart);
4636
- on(el, "touchstart", this._onTapStart);
4637
- }
4638
- if (this.nativeDraggable) {
4639
- on(el, "dragover", this);
4640
- on(el, "dragenter", this);
4641
- }
4642
- sortables.push(this.el);
4643
- options.store && options.store.get && this.sort(options.store.get(this) || []);
4644
- _extends(this, AnimationStateManager());
4645
- }
4646
- Sortable.prototype = (/** @lends Sortable.prototype */ {
4647
- constructor: Sortable,
4648
- _isOutsideThisEl: function _isOutsideThisEl(target) {
4649
- if (!this.el.contains(target) && target !== this.el) lastTarget = null;
4720
+ Ne.initializePlugins(this, t, n);
4721
+ for (var o in n) !(o in e) && (e[o] = n[o]);
4722
+ Jt(e);
4723
+ for (var r in this) r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
4724
+ this.nativeDraggable = e.forceFallback ? !1 : Ln, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? S(t, "pointerdown", this._onTapStart) : (S(t, "mousedown", this._onTapStart), S(t, "touchstart", this._onTapStart)), this.nativeDraggable && (S(t, "dragover", this), S(t, "dragenter", this)), je.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), ie(this, Xn());
4725
+ }
4726
+ p.prototype = {
4727
+ constructor: p,
4728
+ _isOutsideThisEl: function(e) {
4729
+ !this.el.contains(e) && e !== this.el && (me = null);
4650
4730
  },
4651
- _getDirection: function _getDirection(evt, target) {
4652
- return typeof this.options.direction === "function" ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
4731
+ _getDirection: function(e, n) {
4732
+ return typeof this.options.direction == "function" ? this.options.direction.call(this, e, n, c) : this.options.direction;
4653
4733
  },
4654
- _onTapStart: function _onTapStart(evt) {
4655
- if (!evt.cancelable) return;
4656
- var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === "touch" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;
4657
- _saveInputCheckedState(el);
4658
- if (dragEl) return;
4659
- if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return;
4660
- if (originalTarget.isContentEditable) return;
4661
- if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === "SELECT") return;
4662
- target = closest(target, options.draggable, el, false);
4663
- if (target && target.animated) return;
4664
- if (lastDownEl === target) return;
4665
- oldIndex = index(target);
4666
- oldDraggableIndex = index(target, options.draggable);
4667
- if (typeof filter === "function") {
4668
- if (filter.call(this, evt, target, this)) {
4669
- _dispatchEvent({
4670
- sortable: _this,
4671
- rootEl: originalTarget,
4672
- name: "filter",
4673
- targetEl: target,
4674
- toEl: el,
4675
- fromEl: el
4676
- });
4677
- pluginEvent("filter", _this, { evt });
4678
- preventOnFilter && evt.preventDefault();
4679
- return;
4680
- }
4681
- } else if (filter) {
4682
- filter = filter.split(",").some(function(criteria) {
4683
- criteria = closest(originalTarget, criteria.trim(), el, false);
4684
- if (criteria) {
4685
- _dispatchEvent({
4686
- sortable: _this,
4687
- rootEl: criteria,
4734
+ _onTapStart: function(e) {
4735
+ if (e.cancelable) {
4736
+ var n = this, o = this.el, r = this.options, i = r.preventOnFilter, a = e.type, l = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (l || e).target, u = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, d = r.filter;
4737
+ if (Zn(o), !c && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Te && s && s.tagName.toUpperCase() === "SELECT") && (s = Q(s, r.draggable, o, !1), !(s && s.animated) && Be !== s)) {
4738
+ if (be = J(s), Oe = J(s, r.draggable), typeof d == "function") {
4739
+ if (d.call(this, e, s, this)) {
4740
+ W({
4741
+ sortable: n,
4742
+ rootEl: u,
4743
+ name: "filter",
4744
+ targetEl: s,
4745
+ toEl: o,
4746
+ fromEl: o
4747
+ }), z("filter", n, { evt: e }), i && e.cancelable && e.preventDefault();
4748
+ return;
4749
+ }
4750
+ } else if (d && (d = d.split(",").some(function(f) {
4751
+ if (f = Q(u, f.trim(), o, !1), f) return W({
4752
+ sortable: n,
4753
+ rootEl: f,
4688
4754
  name: "filter",
4689
- targetEl: target,
4690
- fromEl: el,
4691
- toEl: el
4692
- });
4693
- pluginEvent("filter", _this, { evt });
4694
- return true;
4755
+ targetEl: s,
4756
+ fromEl: o,
4757
+ toEl: o
4758
+ }), z("filter", n, { evt: e }), !0;
4759
+ }), d)) {
4760
+ i && e.cancelable && e.preventDefault();
4761
+ return;
4695
4762
  }
4696
- });
4697
- if (filter) {
4698
- preventOnFilter && evt.preventDefault();
4699
- return;
4763
+ r.handle && !Q(u, r.handle, o, !1) || this._prepareDragStart(e, l, s);
4700
4764
  }
4701
4765
  }
4702
- if (options.handle && !closest(originalTarget, options.handle, el, false)) return;
4703
- this._prepareDragStart(evt, touch, target);
4704
4766
  },
4705
- _prepareDragStart: function _prepareDragStart(evt, touch, target) {
4706
- var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;
4707
- if (target && !dragEl && target.parentNode === el) {
4708
- var dragRect = getRect(target);
4709
- rootEl = el;
4710
- dragEl = target;
4711
- parentEl = dragEl.parentNode;
4712
- nextEl = dragEl.nextSibling;
4713
- lastDownEl = target;
4714
- activeGroup = options.group;
4715
- Sortable.dragged = dragEl;
4716
- tapEvt = {
4717
- target: dragEl,
4718
- clientX: (touch || evt).clientX,
4719
- clientY: (touch || evt).clientY
4720
- };
4721
- tapDistanceLeft = tapEvt.clientX - dragRect.left;
4722
- tapDistanceTop = tapEvt.clientY - dragRect.top;
4723
- this._lastX = (touch || evt).clientX;
4724
- this._lastY = (touch || evt).clientY;
4725
- dragEl.style["will-change"] = "all";
4726
- dragStartFn = function dragStartFn() {
4727
- pluginEvent("delayEnded", _this, { evt });
4728
- if (Sortable.eventCanceled) {
4729
- _this._onDrop();
4767
+ _prepareDragStart: function(e, n, o) {
4768
+ var r = this, i = r.el, a = r.options, l = i.ownerDocument, s;
4769
+ if (o && !c && o.parentNode === i) {
4770
+ var u = P(o);
4771
+ if (T = i, c = o, O = c.parentNode, pe = c.nextSibling, Be = o, Me = a.group, p.dragged = c, de = {
4772
+ target: c,
4773
+ clientX: (n || e).clientX,
4774
+ clientY: (n || e).clientY
4775
+ }, Pt = de.clientX - u.left, Mt = de.clientY - u.top, this._lastX = (n || e).clientX, this._lastY = (n || e).clientY, c.style["will-change"] = "all", s = function() {
4776
+ if (z("delayEnded", r, { evt: e }), p.eventCanceled) {
4777
+ r._onDrop();
4730
4778
  return;
4731
4779
  }
4732
- _this._disableDelayedDragEvents();
4733
- if (!FireFox && _this.nativeDraggable) dragEl.draggable = true;
4734
- _this._triggerDragStart(evt, touch);
4735
- _dispatchEvent({
4736
- sortable: _this,
4780
+ r._disableDelayedDragEvents(), !It && r.nativeDraggable && (c.draggable = !0), r._triggerDragStart(e, n), W({
4781
+ sortable: r,
4737
4782
  name: "choose",
4738
- originalEvent: evt
4739
- });
4740
- toggleClass(dragEl, options.chosenClass, true);
4741
- };
4742
- options.ignore.split(",").forEach(function(criteria) {
4743
- find(dragEl, criteria.trim(), _disableDraggable);
4744
- });
4745
- on(ownerDocument, "dragover", nearestEmptyInsertDetectEvent);
4746
- on(ownerDocument, "mousemove", nearestEmptyInsertDetectEvent);
4747
- on(ownerDocument, "touchmove", nearestEmptyInsertDetectEvent);
4748
- if (options.supportPointer) {
4749
- on(ownerDocument, "pointerup", _this._onDrop);
4750
- !this.nativeDraggable && on(ownerDocument, "pointercancel", _this._onDrop);
4751
- } else {
4752
- on(ownerDocument, "mouseup", _this._onDrop);
4753
- on(ownerDocument, "touchend", _this._onDrop);
4754
- on(ownerDocument, "touchcancel", _this._onDrop);
4755
- }
4756
- if (FireFox && this.nativeDraggable) {
4757
- this.options.touchStartThreshold = 4;
4758
- dragEl.draggable = true;
4759
- }
4760
- pluginEvent("delayStart", this, { evt });
4761
- if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
4762
- if (Sortable.eventCanceled) {
4783
+ originalEvent: e
4784
+ }), V(c, a.chosenClass, !0);
4785
+ }, a.ignore.split(",").forEach(function(d) {
4786
+ jt(c, d.trim(), nt);
4787
+ }), S(l, "dragover", he), S(l, "mousemove", he), S(l, "touchmove", he), S(l, "mouseup", r._onDrop), S(l, "touchend", r._onDrop), S(l, "touchcancel", r._onDrop), It && this.nativeDraggable && (this.options.touchStartThreshold = 4, c.draggable = !0), z("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || n) && (!this.nativeDraggable || !(xe || ae))) {
4788
+ if (p.eventCanceled) {
4763
4789
  this._onDrop();
4764
4790
  return;
4765
4791
  }
4766
- if (options.supportPointer) {
4767
- on(ownerDocument, "pointerup", _this._disableDelayedDrag);
4768
- on(ownerDocument, "pointercancel", _this._disableDelayedDrag);
4769
- } else {
4770
- on(ownerDocument, "mouseup", _this._disableDelayedDrag);
4771
- on(ownerDocument, "touchend", _this._disableDelayedDrag);
4772
- on(ownerDocument, "touchcancel", _this._disableDelayedDrag);
4773
- }
4774
- on(ownerDocument, "mousemove", _this._delayedDragTouchMoveHandler);
4775
- on(ownerDocument, "touchmove", _this._delayedDragTouchMoveHandler);
4776
- options.supportPointer && on(ownerDocument, "pointermove", _this._delayedDragTouchMoveHandler);
4777
- _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
4778
- } else dragStartFn();
4792
+ S(l, "mouseup", r._disableDelayedDrag), S(l, "touchend", r._disableDelayedDrag), S(l, "touchcancel", r._disableDelayedDrag), S(l, "mousemove", r._delayedDragTouchMoveHandler), S(l, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && S(l, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
4793
+ } else s();
4779
4794
  }
4780
4795
  },
4781
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(e) {
4782
- var touch = e.touches ? e.touches[0] : e;
4783
- if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag();
4796
+ _delayedDragTouchMoveHandler: function(e) {
4797
+ var n = e.touches ? e.touches[0] : e;
4798
+ Math.max(Math.abs(n.clientX - this._lastX), Math.abs(n.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
4784
4799
  },
4785
- _disableDelayedDrag: function _disableDelayedDrag() {
4786
- dragEl && _disableDraggable(dragEl);
4787
- clearTimeout(this._dragStartTimer);
4788
- this._disableDelayedDragEvents();
4800
+ _disableDelayedDrag: function() {
4801
+ c && nt(c), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
4789
4802
  },
4790
- _disableDelayedDragEvents: function _disableDelayedDragEvents() {
4791
- var ownerDocument = this.el.ownerDocument;
4792
- off(ownerDocument, "mouseup", this._disableDelayedDrag);
4793
- off(ownerDocument, "touchend", this._disableDelayedDrag);
4794
- off(ownerDocument, "touchcancel", this._disableDelayedDrag);
4795
- off(ownerDocument, "pointerup", this._disableDelayedDrag);
4796
- off(ownerDocument, "pointercancel", this._disableDelayedDrag);
4797
- off(ownerDocument, "mousemove", this._delayedDragTouchMoveHandler);
4798
- off(ownerDocument, "touchmove", this._delayedDragTouchMoveHandler);
4799
- off(ownerDocument, "pointermove", this._delayedDragTouchMoveHandler);
4803
+ _disableDelayedDragEvents: function() {
4804
+ var e = this.el.ownerDocument;
4805
+ E(e, "mouseup", this._disableDelayedDrag), E(e, "touchend", this._disableDelayedDrag), E(e, "touchcancel", this._disableDelayedDrag), E(e, "mousemove", this._delayedDragTouchMoveHandler), E(e, "touchmove", this._delayedDragTouchMoveHandler), E(e, "pointermove", this._delayedDragTouchMoveHandler);
4800
4806
  },
4801
- _triggerDragStart: function _triggerDragStart(evt, touch) {
4802
- touch = touch || evt.pointerType == "touch" && evt;
4803
- if (!this.nativeDraggable || touch) if (this.options.supportPointer) on(document, "pointermove", this._onTouchMove);
4804
- else if (touch) on(document, "touchmove", this._onTouchMove);
4805
- else on(document, "mousemove", this._onTouchMove);
4806
- else {
4807
- on(dragEl, "dragend", this);
4808
- on(rootEl, "dragstart", this._onDragStart);
4809
- }
4807
+ _triggerDragStart: function(e, n) {
4808
+ n = n || e.pointerType == "touch" && e, !this.nativeDraggable || n ? this.options.supportPointer ? S(document, "pointermove", this._onTouchMove) : n ? S(document, "touchmove", this._onTouchMove) : S(document, "mousemove", this._onTouchMove) : (S(c, "dragend", this), S(T, "dragstart", this._onDragStart));
4810
4809
  try {
4811
- if (document.selection) _nextTick(function() {
4810
+ document.selection ? He(function() {
4812
4811
  document.selection.empty();
4813
- });
4814
- else window.getSelection().removeAllRanges();
4815
- } catch (err) {}
4812
+ }) : window.getSelection().removeAllRanges();
4813
+ } catch (o) {}
4816
4814
  },
4817
- _dragStarted: function _dragStarted(fallback, evt) {
4818
- awaitingDragStarted = false;
4819
- if (rootEl && dragEl) {
4820
- pluginEvent("dragStarted", this, { evt });
4821
- if (this.nativeDraggable) on(document, "dragover", _checkOutsideTargetEl);
4822
- var options = this.options;
4823
- !fallback && toggleClass(dragEl, options.dragClass, false);
4824
- toggleClass(dragEl, options.ghostClass, true);
4825
- Sortable.active = this;
4826
- fallback && this._appendGhost();
4827
- _dispatchEvent({
4815
+ _dragStarted: function(e, n) {
4816
+ if (ve = !1, T && c) {
4817
+ z("dragStarted", this, { evt: n }), this.nativeDraggable && S(document, "dragover", jn);
4818
+ var o = this.options;
4819
+ !e && V(c, o.dragClass, !1), V(c, o.ghostClass, !0), p.active = this, e && this._appendGhost(), W({
4828
4820
  sortable: this,
4829
4821
  name: "start",
4830
- originalEvent: evt
4822
+ originalEvent: n
4831
4823
  });
4832
4824
  } else this._nulling();
4833
4825
  },
4834
- _emulateDragOver: function _emulateDragOver() {
4835
- if (touchEvt) {
4836
- this._lastX = touchEvt.clientX;
4837
- this._lastY = touchEvt.clientY;
4838
- _hideGhostForTarget();
4839
- var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
4840
- var parent = target;
4841
- while (target && target.shadowRoot) {
4842
- target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
4843
- if (target === parent) break;
4844
- parent = target;
4845
- }
4846
- dragEl.parentNode[expando]._isOutsideThisEl(target);
4847
- if (parent) do {
4848
- if (parent[expando]) {
4849
- var inserted = void 0;
4850
- inserted = parent[expando]._onDragOver({
4851
- clientX: touchEvt.clientX,
4852
- clientY: touchEvt.clientY,
4853
- target,
4854
- rootEl: parent
4855
- });
4856
- if (inserted && !this.options.dragoverBubble) break;
4826
+ _emulateDragOver: function() {
4827
+ if (Z) {
4828
+ this._lastX = Z.clientX, this._lastY = Z.clientY, Zt();
4829
+ for (var e = document.elementFromPoint(Z.clientX, Z.clientY), n = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Z.clientX, Z.clientY), e !== n);) n = e;
4830
+ if (c.parentNode[q]._isOutsideThisEl(e), n) do {
4831
+ if (n[q]) {
4832
+ var o = void 0;
4833
+ if (o = n[q]._onDragOver({
4834
+ clientX: Z.clientX,
4835
+ clientY: Z.clientY,
4836
+ target: e,
4837
+ rootEl: n
4838
+ }), o && !this.options.dragoverBubble) break;
4857
4839
  }
4858
- target = parent;
4859
- } while (parent = getParentOrHost(parent));
4860
- _unhideGhostForTarget();
4840
+ e = n;
4841
+ } while (n = n.parentNode);
4842
+ Qt();
4861
4843
  }
4862
4844
  },
4863
- _onTouchMove: function _onTouchMove(evt) {
4864
- if (tapEvt) {
4865
- var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = ghostEl && matrix(ghostEl, true), scaleX = ghostEl && ghostMatrix && ghostMatrix.a, scaleY = ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
4866
- if (!Sortable.active && !awaitingDragStarted) {
4867
- if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) return;
4868
- this._onDragStart(evt, true);
4845
+ _onTouchMove: function(e) {
4846
+ if (de) {
4847
+ var n = this.options, o = n.fallbackTolerance, r = n.fallbackOffset, i = e.touches ? e.touches[0] : e, a = g && ye(g, !0), l = g && a && a.a, s = g && a && a.d, u = Re && H && Nt(H), d = (i.clientX - de.clientX + r.x) / (l || 1) + (u ? u[0] - tt[0] : 0) / (l || 1), f = (i.clientY - de.clientY + r.y) / (s || 1) + (u ? u[1] - tt[1] : 0) / (s || 1);
4848
+ if (!p.active && !ve) {
4849
+ if (o && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < o) return;
4850
+ this._onDragStart(e, !0);
4869
4851
  }
4870
- if (ghostEl) {
4871
- if (ghostMatrix) {
4872
- ghostMatrix.e += dx - (lastDx || 0);
4873
- ghostMatrix.f += dy - (lastDy || 0);
4874
- } else ghostMatrix = {
4852
+ if (g) {
4853
+ a ? (a.e += d - (Qe || 0), a.f += f - (et || 0)) : a = {
4875
4854
  a: 1,
4876
4855
  b: 0,
4877
4856
  c: 0,
4878
4857
  d: 1,
4879
- e: dx,
4880
- f: dy
4858
+ e: d,
4859
+ f
4881
4860
  };
4882
- var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
4883
- css(ghostEl, "webkitTransform", cssMatrix);
4884
- css(ghostEl, "mozTransform", cssMatrix);
4885
- css(ghostEl, "msTransform", cssMatrix);
4886
- css(ghostEl, "transform", cssMatrix);
4887
- lastDx = dx;
4888
- lastDy = dy;
4889
- touchEvt = touch;
4861
+ var m = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
4862
+ h$1(g, "webkitTransform", m), h$1(g, "mozTransform", m), h$1(g, "msTransform", m), h$1(g, "transform", m), Qe = d, et = f, Z = i;
4890
4863
  }
4891
- evt.cancelable && evt.preventDefault();
4864
+ e.cancelable && e.preventDefault();
4892
4865
  }
4893
4866
  },
4894
- _appendGhost: function _appendGhost() {
4895
- if (!ghostEl) {
4896
- var container = this.options.fallbackOnBody ? document.body : rootEl, rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), options = this.options;
4897
- if (PositionGhostAbsolutely) {
4898
- ghostRelativeParent = container;
4899
- while (css(ghostRelativeParent, "position") === "static" && css(ghostRelativeParent, "transform") === "none" && ghostRelativeParent !== document) ghostRelativeParent = ghostRelativeParent.parentNode;
4900
- if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
4901
- if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
4902
- rect.top += ghostRelativeParent.scrollTop;
4903
- rect.left += ghostRelativeParent.scrollLeft;
4904
- } else ghostRelativeParent = getWindowScrollingElement();
4905
- ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
4867
+ _appendGhost: function() {
4868
+ if (!g) {
4869
+ var e = this.options.fallbackOnBody ? document.body : T, n = P(c, !0, Re, !0, e), o = this.options;
4870
+ if (Re) {
4871
+ for (H = e; h$1(H, "position") === "static" && h$1(H, "transform") === "none" && H !== document;) H = H.parentNode;
4872
+ H !== document.body && H !== document.documentElement ? (H === document && (H = te()), n.top += H.scrollTop, n.left += H.scrollLeft) : H = te(), tt = Nt(H);
4906
4873
  }
4907
- ghostEl = dragEl.cloneNode(true);
4908
- toggleClass(ghostEl, options.ghostClass, false);
4909
- toggleClass(ghostEl, options.fallbackClass, true);
4910
- toggleClass(ghostEl, options.dragClass, true);
4911
- css(ghostEl, "transition", "");
4912
- css(ghostEl, "transform", "");
4913
- css(ghostEl, "box-sizing", "border-box");
4914
- css(ghostEl, "margin", 0);
4915
- css(ghostEl, "top", rect.top);
4916
- css(ghostEl, "left", rect.left);
4917
- css(ghostEl, "width", rect.width);
4918
- css(ghostEl, "height", rect.height);
4919
- css(ghostEl, "opacity", "0.8");
4920
- css(ghostEl, "position", PositionGhostAbsolutely ? "absolute" : "fixed");
4921
- css(ghostEl, "zIndex", "100000");
4922
- css(ghostEl, "pointerEvents", "none");
4923
- Sortable.ghost = ghostEl;
4924
- container.appendChild(ghostEl);
4925
- css(ghostEl, "transform-origin", tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + "% " + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + "%");
4874
+ g = c.cloneNode(!0), V(g, o.ghostClass, !1), V(g, o.fallbackClass, !0), V(g, o.dragClass, !0), h$1(g, "transition", ""), h$1(g, "transform", ""), h$1(g, "box-sizing", "border-box"), h$1(g, "margin", 0), h$1(g, "top", n.top), h$1(g, "left", n.left), h$1(g, "width", n.width), h$1(g, "height", n.height), h$1(g, "opacity", "0.8"), h$1(g, "position", Re ? "absolute" : "fixed"), h$1(g, "zIndex", "100000"), h$1(g, "pointerEvents", "none"), p.ghost = g, e.appendChild(g), h$1(g, "transform-origin", Pt / parseInt(g.style.width) * 100 + "% " + Mt / parseInt(g.style.height) * 100 + "%");
4926
4875
  }
4927
4876
  },
4928
- _onDragStart: function _onDragStart(evt, fallback) {
4929
- var _this = this;
4930
- var dataTransfer = evt.dataTransfer;
4931
- var options = _this.options;
4932
- pluginEvent("dragStart", this, { evt });
4933
- if (Sortable.eventCanceled) {
4877
+ _onDragStart: function(e, n) {
4878
+ var o = this, r = e.dataTransfer, i = o.options;
4879
+ if (z("dragStart", this, { evt: e }), p.eventCanceled) {
4934
4880
  this._onDrop();
4935
4881
  return;
4936
4882
  }
4937
- pluginEvent("setupClone", this);
4938
- if (!Sortable.eventCanceled) {
4939
- cloneEl = clone(dragEl);
4940
- cloneEl.removeAttribute("id");
4941
- cloneEl.draggable = false;
4942
- cloneEl.style["will-change"] = "";
4943
- this._hideClone();
4944
- toggleClass(cloneEl, this.options.chosenClass, false);
4945
- Sortable.clone = cloneEl;
4946
- }
4947
- _this.cloneId = _nextTick(function() {
4948
- pluginEvent("clone", _this);
4949
- if (Sortable.eventCanceled) return;
4950
- if (!_this.options.removeCloneOnHide) rootEl.insertBefore(cloneEl, dragEl);
4951
- _this._hideClone();
4952
- _dispatchEvent({
4953
- sortable: _this,
4883
+ z("setupClone", this), p.eventCanceled || (C = Vt(c), C.removeAttribute("id"), C.draggable = !1, C.style["will-change"] = "", this._hideClone(), V(C, this.options.chosenClass, !1), p.clone = C), o.cloneId = He(function() {
4884
+ z("clone", o), !p.eventCanceled && (o.options.removeCloneOnHide || T.insertBefore(C, c), o._hideClone(), W({
4885
+ sortable: o,
4954
4886
  name: "clone"
4955
- });
4956
- });
4957
- !fallback && toggleClass(dragEl, options.dragClass, true);
4958
- if (fallback) {
4959
- ignoreNextClick = true;
4960
- _this._loopId = setInterval(_this._emulateDragOver, 50);
4961
- } else {
4962
- off(document, "mouseup", _this._onDrop);
4963
- off(document, "touchend", _this._onDrop);
4964
- off(document, "touchcancel", _this._onDrop);
4965
- if (dataTransfer) {
4966
- dataTransfer.effectAllowed = "move";
4967
- options.setData && options.setData.call(_this, dataTransfer, dragEl);
4968
- }
4969
- on(document, "drop", _this);
4970
- css(dragEl, "transform", "translateZ(0)");
4971
- }
4972
- awaitingDragStarted = true;
4973
- _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
4974
- on(document, "selectstart", _this);
4975
- moved = true;
4976
- window.getSelection().removeAllRanges();
4977
- if (Safari) css(document.body, "user-select", "none");
4887
+ }));
4888
+ }), !n && V(c, i.dragClass, !0), n ? (Ge = !0, o._loopId = setInterval(o._emulateDragOver, 50)) : (E(document, "mouseup", o._onDrop), E(document, "touchend", o._onDrop), E(document, "touchcancel", o._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(o, r, c)), S(document, "drop", o), h$1(c, "transform", "translateZ(0)")), ve = !0, o._dragStartId = He(o._dragStarted.bind(o, n, e)), S(document, "selectstart", o), Se = !0, Te && h$1(document.body, "user-select", "none");
4978
4889
  },
4979
- _onDragOver: function _onDragOver(evt) {
4980
- var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable || activeSortable, vertical, _this = this, completedFired = false;
4981
- if (_silent) return;
4982
- function dragOverEvent(name, extra) {
4983
- pluginEvent(name, _this, _objectSpread2({
4984
- evt,
4985
- isOwner,
4986
- axis: vertical ? "vertical" : "horizontal",
4987
- revert,
4988
- dragRect,
4989
- targetRect,
4990
- canSort,
4991
- fromSortable,
4992
- target,
4993
- completed,
4994
- onMove: function onMove(target, after) {
4995
- return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
4890
+ _onDragOver: function(e) {
4891
+ var n = this.el, o = e.target, r, i, a, l = this.options, s = l.group, u = p.active, d = Me === s, f = l.sort, m = Y || u, y, b = this, w = !1;
4892
+ if (lt) return;
4893
+ function L(ee, Ee) {
4894
+ z(ee, b, ne({
4895
+ evt: e,
4896
+ isOwner: d,
4897
+ axis: y ? "vertical" : "horizontal",
4898
+ revert: a,
4899
+ dragRect: r,
4900
+ targetRect: i,
4901
+ canSort: f,
4902
+ fromSortable: m,
4903
+ target: o,
4904
+ completed: R,
4905
+ onMove: function(vt, rn) {
4906
+ return Xe(T, n, c, r, vt, P(vt), e, rn);
4996
4907
  },
4997
- changed
4998
- }, extra));
4908
+ changed: j
4909
+ }, Ee));
4999
4910
  }
5000
- function capture() {
5001
- dragOverEvent("dragOverAnimationCapture");
5002
- _this.captureAnimationState();
5003
- if (_this !== fromSortable) fromSortable.captureAnimationState();
4911
+ function G() {
4912
+ L("dragOverAnimationCapture"), b.captureAnimationState(), b !== m && m.captureAnimationState();
5004
4913
  }
5005
- function completed(insertion) {
5006
- dragOverEvent("dragOverCompleted", { insertion });
5007
- if (insertion) {
5008
- if (isOwner) activeSortable._hideClone();
5009
- else activeSortable._showClone(_this);
5010
- if (_this !== fromSortable) {
5011
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
5012
- toggleClass(dragEl, options.ghostClass, true);
5013
- }
5014
- if (putSortable !== _this && _this !== Sortable.active) putSortable = _this;
5015
- else if (_this === Sortable.active && putSortable) putSortable = null;
5016
- if (fromSortable === _this) _this._ignoreWhileAnimating = target;
5017
- _this.animateAll(function() {
5018
- dragOverEvent("dragOverAnimationComplete");
5019
- _this._ignoreWhileAnimating = null;
5020
- });
5021
- if (_this !== fromSortable) {
5022
- fromSortable.animateAll();
5023
- fromSortable._ignoreWhileAnimating = null;
5024
- }
5025
- }
5026
- if (target === dragEl && !dragEl.animated || target === el && !target.animated) lastTarget = null;
5027
- if (!options.dragoverBubble && !evt.rootEl && target !== document) {
5028
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
5029
- !insertion && nearestEmptyInsertDetectEvent(evt);
5030
- }
5031
- !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
5032
- return completedFired = true;
4914
+ function R(ee) {
4915
+ return L("dragOverCompleted", { insertion: ee }), ee && (d ? u._hideClone() : u._showClone(b), b !== m && (V(c, Y ? Y.options.ghostClass : u.options.ghostClass, !1), V(c, l.ghostClass, !0)), Y !== b && b !== p.active ? Y = b : b === p.active && Y && (Y = null), m === b && (b._ignoreWhileAnimating = o), b.animateAll(function() {
4916
+ L("dragOverAnimationComplete"), b._ignoreWhileAnimating = null;
4917
+ }), b !== m && (m.animateAll(), m._ignoreWhileAnimating = null)), (o === c && !c.animated || o === n && !o.animated) && (me = null), !l.dragoverBubble && !e.rootEl && o !== document && (c.parentNode[q]._isOutsideThisEl(e.target), !ee && he(e)), !l.dragoverBubble && e.stopPropagation && e.stopPropagation(), w = !0;
5033
4918
  }
5034
- function changed() {
5035
- newIndex = index(dragEl);
5036
- newDraggableIndex = index(dragEl, options.draggable);
5037
- _dispatchEvent({
5038
- sortable: _this,
4919
+ function j() {
4920
+ $ = J(c), se = J(c, l.draggable), W({
4921
+ sortable: b,
5039
4922
  name: "change",
5040
- toEl: el,
5041
- newIndex,
5042
- newDraggableIndex,
5043
- originalEvent: evt
4923
+ toEl: n,
4924
+ newIndex: $,
4925
+ newDraggableIndex: se,
4926
+ originalEvent: e
5044
4927
  });
5045
4928
  }
5046
- if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault();
5047
- target = closest(target, options.draggable, el, true);
5048
- dragOverEvent("dragOver");
5049
- if (Sortable.eventCanceled) return completedFired;
5050
- if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) return completed(false);
5051
- ignoreNextClick = false;
5052
- if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
5053
- vertical = this._getDirection(evt, target) === "vertical";
5054
- dragRect = getRect(dragEl);
5055
- dragOverEvent("dragOverValid");
5056
- if (Sortable.eventCanceled) return completedFired;
5057
- if (revert) {
5058
- parentEl = rootEl;
5059
- capture();
5060
- this._hideClone();
5061
- dragOverEvent("revert");
5062
- if (!Sortable.eventCanceled) if (nextEl) rootEl.insertBefore(dragEl, nextEl);
5063
- else rootEl.appendChild(dragEl);
5064
- return completed(true);
5065
- }
5066
- var elLastChild = lastChild(el, options.draggable);
5067
- if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
5068
- if (elLastChild === dragEl) return completed(false);
5069
- if (elLastChild && el === evt.target) target = elLastChild;
5070
- if (target) targetRect = getRect(target);
5071
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
5072
- capture();
5073
- if (elLastChild && elLastChild.nextSibling) el.insertBefore(dragEl, elLastChild.nextSibling);
5074
- else el.appendChild(dragEl);
5075
- parentEl = el;
5076
- changed();
5077
- return completed(true);
5078
- }
5079
- } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
5080
- var firstChild = getChild(el, 0, options, true);
5081
- if (firstChild === dragEl) return completed(false);
5082
- target = firstChild;
5083
- targetRect = getRect(target);
5084
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
5085
- capture();
5086
- el.insertBefore(dragEl, firstChild);
5087
- parentEl = el;
5088
- changed();
5089
- return completed(true);
5090
- }
5091
- } else if (target.parentNode === el) {
5092
- targetRect = getRect(target);
5093
- var direction = 0, targetBeforeFirstSwap, differentLevel = dragEl.parentNode !== el, differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? "top" : "left", scrolledPastTop = isScrolledPast(target, "top", "top") || isScrolledPast(dragEl, "top", "top"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
5094
- if (lastTarget !== target) {
5095
- targetBeforeFirstSwap = targetRect[side1];
5096
- pastFirstInvertThresh = false;
5097
- isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
5098
- }
5099
- direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
5100
- var sibling;
5101
- if (direction !== 0) {
5102
- var dragIndex = index(dragEl);
5103
- do {
5104
- dragIndex -= direction;
5105
- sibling = parentEl.children[dragIndex];
5106
- } while (sibling && (css(sibling, "display") === "none" || sibling === ghostEl));
5107
- }
5108
- if (direction === 0 || sibling === target) return completed(false);
5109
- lastTarget = target;
5110
- lastDirection = direction;
5111
- var nextSibling = target.nextElementSibling, after = false;
5112
- after = direction === 1;
5113
- var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
5114
- if (moveVector !== false) {
5115
- if (moveVector === 1 || moveVector === -1) after = moveVector === 1;
5116
- _silent = true;
5117
- setTimeout(_unsilent, 30);
5118
- capture();
5119
- if (after && !nextSibling) el.appendChild(dragEl);
5120
- else target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
5121
- if (scrolledPastTop) scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
5122
- parentEl = dragEl.parentNode;
5123
- if (targetBeforeFirstSwap !== void 0 && !isCircumstantialInvert) targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
5124
- changed();
5125
- return completed(true);
4929
+ if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), o = Q(o, l.draggable, n, !0), L("dragOver"), p.eventCanceled) return w;
4930
+ if (c.contains(e.target) || o.animated && o.animatingX && o.animatingY || b._ignoreWhileAnimating === o) return R(!1);
4931
+ if (Ge = !1, u && !l.disabled && (d ? f || (a = O !== T) : Y === this || (this.lastPutMode = Me.checkPull(this, u, c, e)) && s.checkPut(this, u, c, e))) {
4932
+ if (y = this._getDirection(e, o) === "vertical", r = P(c), L("dragOverValid"), p.eventCanceled) return w;
4933
+ if (a) return O = T, G(), this._hideClone(), L("revert"), p.eventCanceled || (pe ? T.insertBefore(c, pe) : T.appendChild(c)), R(!0);
4934
+ var B = ht(n, l.draggable);
4935
+ if (!B || $n(e, y, this) && !B.animated) {
4936
+ if (B === c) return R(!1);
4937
+ if (B && n === e.target && (o = B), o && (i = P(o)), Xe(T, n, c, r, o, i, e, !!o) !== !1) return G(), B && B.nextSibling ? n.insertBefore(c, B.nextSibling) : n.appendChild(c), O = n, j(), R(!0);
4938
+ } else if (B && Vn(e, y, this)) {
4939
+ var X = we(n, 0, l, !0);
4940
+ if (X === c) return R(!1);
4941
+ if (o = X, i = P(o), Xe(T, n, c, r, o, i, e, !1) !== !1) return G(), n.insertBefore(c, X), O = n, j(), R(!0);
4942
+ } else if (o.parentNode === n) {
4943
+ i = P(o);
4944
+ var K = 0, oe, le = c.parentNode !== n, k = !Wn(c.animated && c.toRect || r, o.animated && o.toRect || i, y), v = y ? "top" : "left", D = xt(o, "top", "top") || xt(c, "top", "top"), A = D ? D.scrollTop : void 0;
4945
+ me !== o && (oe = i[v], Ae = !1, Fe = !k && l.invertSwap || le), K = qn(e, o, i, y, k ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Fe, me === o);
4946
+ var I;
4947
+ if (K !== 0) {
4948
+ var _ = J(c);
4949
+ do
4950
+ _ -= K, I = O.children[_];
4951
+ while (I && (h$1(I, "display") === "none" || I === g));
5126
4952
  }
4953
+ if (K === 0 || I === o) return R(!1);
4954
+ me = o, Ie = K;
4955
+ var x = o.nextElementSibling, M = !1;
4956
+ M = K === 1;
4957
+ var F = Xe(T, n, c, r, o, i, e, M);
4958
+ if (F !== !1) return (F === 1 || F === -1) && (M = F === 1), lt = !0, setTimeout(Un, 30), G(), M && !x ? n.appendChild(c) : o.parentNode.insertBefore(c, M ? x : o), D && Ut(D, 0, A - D.scrollTop), O = c.parentNode, oe !== void 0 && !Fe && (ke = Math.abs(oe - P(o)[v])), j(), R(!0);
5127
4959
  }
5128
- if (el.contains(dragEl)) return completed(false);
4960
+ if (n.contains(c)) return R(!1);
5129
4961
  }
5130
- return false;
4962
+ return !1;
5131
4963
  },
5132
4964
  _ignoreWhileAnimating: null,
5133
- _offMoveEvents: function _offMoveEvents() {
5134
- off(document, "mousemove", this._onTouchMove);
5135
- off(document, "touchmove", this._onTouchMove);
5136
- off(document, "pointermove", this._onTouchMove);
5137
- off(document, "dragover", nearestEmptyInsertDetectEvent);
5138
- off(document, "mousemove", nearestEmptyInsertDetectEvent);
5139
- off(document, "touchmove", nearestEmptyInsertDetectEvent);
4965
+ _offMoveEvents: function() {
4966
+ E(document, "mousemove", this._onTouchMove), E(document, "touchmove", this._onTouchMove), E(document, "pointermove", this._onTouchMove), E(document, "dragover", he), E(document, "mousemove", he), E(document, "touchmove", he);
5140
4967
  },
5141
- _offUpEvents: function _offUpEvents() {
5142
- var ownerDocument = this.el.ownerDocument;
5143
- off(ownerDocument, "mouseup", this._onDrop);
5144
- off(ownerDocument, "touchend", this._onDrop);
5145
- off(ownerDocument, "pointerup", this._onDrop);
5146
- off(ownerDocument, "pointercancel", this._onDrop);
5147
- off(ownerDocument, "touchcancel", this._onDrop);
5148
- off(document, "selectstart", this);
4968
+ _offUpEvents: function() {
4969
+ var e = this.el.ownerDocument;
4970
+ E(e, "mouseup", this._onDrop), E(e, "touchend", this._onDrop), E(e, "pointerup", this._onDrop), E(e, "touchcancel", this._onDrop), E(document, "selectstart", this);
5149
4971
  },
5150
- _onDrop: function _onDrop(evt) {
5151
- var el = this.el, options = this.options;
5152
- newIndex = index(dragEl);
5153
- newDraggableIndex = index(dragEl, options.draggable);
5154
- pluginEvent("drop", this, { evt });
5155
- parentEl = dragEl && dragEl.parentNode;
5156
- newIndex = index(dragEl);
5157
- newDraggableIndex = index(dragEl, options.draggable);
5158
- if (Sortable.eventCanceled) {
4972
+ _onDrop: function(e) {
4973
+ var n = this.el, o = this.options;
4974
+ if ($ = J(c), se = J(c, o.draggable), z("drop", this, { evt: e }), O = c && c.parentNode, $ = J(c), se = J(c, o.draggable), p.eventCanceled) {
5159
4975
  this._nulling();
5160
4976
  return;
5161
4977
  }
5162
- awaitingDragStarted = false;
5163
- isCircumstantialInvert = false;
5164
- pastFirstInvertThresh = false;
5165
- clearInterval(this._loopId);
5166
- clearTimeout(this._dragStartTimer);
5167
- _cancelNextTick(this.cloneId);
5168
- _cancelNextTick(this._dragStartId);
5169
- if (this.nativeDraggable) {
5170
- off(document, "drop", this);
5171
- off(el, "dragstart", this._onDragStart);
5172
- }
5173
- this._offMoveEvents();
5174
- this._offUpEvents();
5175
- if (Safari) css(document.body, "user-select", "");
5176
- css(dragEl, "transform", "");
5177
- if (evt) {
5178
- if (moved) {
5179
- evt.cancelable && evt.preventDefault();
5180
- !options.dropBubble && evt.stopPropagation();
5181
- }
5182
- ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
5183
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== "clone") cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
5184
- if (dragEl) {
5185
- if (this.nativeDraggable) off(dragEl, "dragend", this);
5186
- _disableDraggable(dragEl);
5187
- dragEl.style["will-change"] = "";
5188
- if (moved && !awaitingDragStarted) toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
5189
- toggleClass(dragEl, this.options.chosenClass, false);
5190
- _dispatchEvent({
5191
- sortable: this,
5192
- name: "unchoose",
5193
- toEl: parentEl,
5194
- newIndex: null,
5195
- newDraggableIndex: null,
5196
- originalEvent: evt
5197
- });
5198
- if (rootEl !== parentEl) {
5199
- if (newIndex >= 0) {
5200
- _dispatchEvent({
5201
- rootEl: parentEl,
5202
- name: "add",
5203
- toEl: parentEl,
5204
- fromEl: rootEl,
5205
- originalEvent: evt
5206
- });
5207
- _dispatchEvent({
5208
- sortable: this,
5209
- name: "remove",
5210
- toEl: parentEl,
5211
- originalEvent: evt
5212
- });
5213
- _dispatchEvent({
5214
- rootEl: parentEl,
5215
- name: "sort",
5216
- toEl: parentEl,
5217
- fromEl: rootEl,
5218
- originalEvent: evt
5219
- });
5220
- _dispatchEvent({
5221
- sortable: this,
5222
- name: "sort",
5223
- toEl: parentEl,
5224
- originalEvent: evt
5225
- });
5226
- }
5227
- putSortable && putSortable.save();
5228
- } else if (newIndex !== oldIndex) {
5229
- if (newIndex >= 0) {
5230
- _dispatchEvent({
5231
- sortable: this,
5232
- name: "update",
5233
- toEl: parentEl,
5234
- originalEvent: evt
5235
- });
5236
- _dispatchEvent({
5237
- sortable: this,
5238
- name: "sort",
5239
- toEl: parentEl,
5240
- originalEvent: evt
5241
- });
5242
- }
5243
- }
5244
- if (Sortable.active) {
5245
- if (newIndex == null || newIndex === -1) {
5246
- newIndex = oldIndex;
5247
- newDraggableIndex = oldDraggableIndex;
5248
- }
5249
- _dispatchEvent({
5250
- sortable: this,
5251
- name: "end",
5252
- toEl: parentEl,
5253
- originalEvent: evt
5254
- });
5255
- this.save();
5256
- }
5257
- }
5258
- }
5259
- this._nulling();
4978
+ ve = !1, Fe = !1, Ae = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), st(this.cloneId), st(this._dragStartId), this.nativeDraggable && (E(document, "drop", this), E(n, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Te && h$1(document.body, "user-select", ""), h$1(c, "transform", ""), e && (Se && (e.cancelable && e.preventDefault(), !o.dropBubble && e.stopPropagation()), g && g.parentNode && g.parentNode.removeChild(g), (T === O || Y && Y.lastPutMode !== "clone") && C && C.parentNode && C.parentNode.removeChild(C), c && (this.nativeDraggable && E(c, "dragend", this), nt(c), c.style["will-change"] = "", Se && !ve && V(c, Y ? Y.options.ghostClass : this.options.ghostClass, !1), V(c, this.options.chosenClass, !1), W({
4979
+ sortable: this,
4980
+ name: "unchoose",
4981
+ toEl: O,
4982
+ newIndex: null,
4983
+ newDraggableIndex: null,
4984
+ originalEvent: e
4985
+ }), T !== O ? ($ >= 0 && (W({
4986
+ rootEl: O,
4987
+ name: "add",
4988
+ toEl: O,
4989
+ fromEl: T,
4990
+ originalEvent: e
4991
+ }), W({
4992
+ sortable: this,
4993
+ name: "remove",
4994
+ toEl: O,
4995
+ originalEvent: e
4996
+ }), W({
4997
+ rootEl: O,
4998
+ name: "sort",
4999
+ toEl: O,
5000
+ fromEl: T,
5001
+ originalEvent: e
5002
+ }), W({
5003
+ sortable: this,
5004
+ name: "sort",
5005
+ toEl: O,
5006
+ originalEvent: e
5007
+ })), Y && Y.save()) : $ !== be && $ >= 0 && (W({
5008
+ sortable: this,
5009
+ name: "update",
5010
+ toEl: O,
5011
+ originalEvent: e
5012
+ }), W({
5013
+ sortable: this,
5014
+ name: "sort",
5015
+ toEl: O,
5016
+ originalEvent: e
5017
+ })), p.active && (($ == null || $ === -1) && ($ = be, se = Oe), W({
5018
+ sortable: this,
5019
+ name: "end",
5020
+ toEl: O,
5021
+ originalEvent: e
5022
+ }), this.save()))), this._nulling();
5260
5023
  },
5261
- _nulling: function _nulling() {
5262
- pluginEvent("nulling", this);
5263
- rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
5264
- var el = this.el;
5265
- savedInputChecked.forEach(function(checkEl) {
5266
- if (el.contains(checkEl)) checkEl.checked = true;
5267
- });
5268
- savedInputChecked.length = lastDx = lastDy = 0;
5024
+ _nulling: function() {
5025
+ z("nulling", this), T = c = O = g = pe = C = Be = ue = de = Z = Se = $ = se = be = Oe = me = Ie = Y = Me = p.dragged = p.ghost = p.clone = p.active = null, ze.forEach(function(e) {
5026
+ e.checked = !0;
5027
+ }), ze.length = Qe = et = 0;
5269
5028
  },
5270
- handleEvent: function handleEvent(evt) {
5271
- switch (evt.type) {
5029
+ handleEvent: function(e) {
5030
+ switch (e.type) {
5272
5031
  case "drop":
5273
5032
  case "dragend":
5274
- this._onDrop(evt);
5033
+ this._onDrop(e);
5275
5034
  break;
5276
5035
  case "dragenter":
5277
5036
  case "dragover":
5278
- if (dragEl) {
5279
- this._onDragOver(evt);
5280
- _globalDragOver(evt);
5281
- }
5037
+ c && (this._onDragOver(e), zn(e));
5282
5038
  break;
5283
5039
  case "selectstart":
5284
- evt.preventDefault();
5040
+ e.preventDefault();
5285
5041
  break;
5286
5042
  }
5287
5043
  },
@@ -5289,39 +5045,29 @@ Sortable.prototype = (/** @lends Sortable.prototype */ {
5289
5045
  * Serializes the item into an array of string.
5290
5046
  * @returns {String[]}
5291
5047
  */
5292
- toArray: function toArray() {
5293
- var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;
5294
- for (; i < n; i++) {
5295
- el = children[i];
5296
- if (closest(el, options.draggable, this.el, false)) order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
5297
- }
5298
- return order;
5048
+ toArray: function() {
5049
+ for (var e = [], n, o = this.el.children, r = 0, i = o.length, a = this.options; r < i; r++) n = o[r], Q(n, a.draggable, this.el, !1) && e.push(n.getAttribute(a.dataIdAttr) || Jn(n));
5050
+ return e;
5299
5051
  },
5300
5052
  /**
5301
5053
  * Sorts the elements according to the array.
5302
5054
  * @param {String[]} order order of the items
5303
5055
  */
5304
- sort: function sort(order, useAnimation) {
5305
- var items = {}, rootEl = this.el;
5306
- this.toArray().forEach(function(id, i) {
5307
- var el = rootEl.children[i];
5308
- if (closest(el, this.options.draggable, rootEl, false)) items[id] = el;
5309
- }, this);
5310
- useAnimation && this.captureAnimationState();
5311
- order.forEach(function(id) {
5312
- if (items[id]) {
5313
- rootEl.removeChild(items[id]);
5314
- rootEl.appendChild(items[id]);
5315
- }
5316
- });
5317
- useAnimation && this.animateAll();
5056
+ sort: function(e, n) {
5057
+ var o = {}, r = this.el;
5058
+ this.toArray().forEach(function(i, a) {
5059
+ var l = r.children[a];
5060
+ Q(l, this.options.draggable, r, !1) && (o[i] = l);
5061
+ }, this), n && this.captureAnimationState(), e.forEach(function(i) {
5062
+ o[i] && (r.removeChild(o[i]), r.appendChild(o[i]));
5063
+ }), n && this.animateAll();
5318
5064
  },
5319
5065
  /**
5320
5066
  * Save the current sorting
5321
5067
  */
5322
- save: function save() {
5323
- var store = this.options.store;
5324
- store && store.set && store.set(this);
5068
+ save: function() {
5069
+ var e = this.options.store;
5070
+ e && e.set && e.set(this);
5325
5071
  },
5326
5072
  /**
5327
5073
  * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
@@ -5329,8 +5075,8 @@ Sortable.prototype = (/** @lends Sortable.prototype */ {
5329
5075
  * @param {String} [selector] default: `options.draggable`
5330
5076
  * @returns {HTMLElement|null}
5331
5077
  */
5332
- closest: function closest$1(el, selector) {
5333
- return closest(el, selector || this.options.draggable, this.el, false);
5078
+ closest: function(e, n) {
5079
+ return Q(e, n || this.options.draggable, this.el, !1);
5334
5080
  },
5335
5081
  /**
5336
5082
  * Set/get option
@@ -5338,407 +5084,482 @@ Sortable.prototype = (/** @lends Sortable.prototype */ {
5338
5084
  * @param {*} [value]
5339
5085
  * @returns {*}
5340
5086
  */
5341
- option: function option(name, value) {
5342
- var options = this.options;
5343
- if (value === void 0) return options[name];
5344
- else {
5345
- var modifiedValue = PluginManager.modifyOption(this, name, value);
5346
- if (typeof modifiedValue !== "undefined") options[name] = modifiedValue;
5347
- else options[name] = value;
5348
- if (name === "group") _prepareGroup(options);
5349
- }
5087
+ option: function(e, n) {
5088
+ var o = this.options;
5089
+ if (n === void 0) return o[e];
5090
+ var r = Ne.modifyOption(this, e, n);
5091
+ typeof r != "undefined" ? o[e] = r : o[e] = n, e === "group" && Jt(o);
5350
5092
  },
5351
5093
  /**
5352
5094
  * Destroy
5353
5095
  */
5354
- destroy: function destroy() {
5355
- pluginEvent("destroy", this);
5356
- var el = this.el;
5357
- el[expando] = null;
5358
- off(el, "mousedown", this._onTapStart);
5359
- off(el, "touchstart", this._onTapStart);
5360
- off(el, "pointerdown", this._onTapStart);
5361
- if (this.nativeDraggable) {
5362
- off(el, "dragover", this);
5363
- off(el, "dragenter", this);
5364
- }
5365
- Array.prototype.forEach.call(el.querySelectorAll("[draggable]"), function(el) {
5366
- el.removeAttribute("draggable");
5367
- });
5368
- this._onDrop();
5369
- this._disableDelayedDragEvents();
5370
- sortables.splice(sortables.indexOf(this.el), 1);
5371
- this.el = el = null;
5096
+ destroy: function() {
5097
+ z("destroy", this);
5098
+ var e = this.el;
5099
+ e[q] = null, E(e, "mousedown", this._onTapStart), E(e, "touchstart", this._onTapStart), E(e, "pointerdown", this._onTapStart), this.nativeDraggable && (E(e, "dragover", this), E(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(n) {
5100
+ n.removeAttribute("draggable");
5101
+ }), this._onDrop(), this._disableDelayedDragEvents(), je.splice(je.indexOf(this.el), 1), this.el = e = null;
5372
5102
  },
5373
- _hideClone: function _hideClone() {
5374
- if (!cloneHidden) {
5375
- pluginEvent("hideClone", this);
5376
- if (Sortable.eventCanceled) return;
5377
- css(cloneEl, "display", "none");
5378
- if (this.options.removeCloneOnHide && cloneEl.parentNode) cloneEl.parentNode.removeChild(cloneEl);
5379
- cloneHidden = true;
5103
+ _hideClone: function() {
5104
+ if (!ue) {
5105
+ if (z("hideClone", this), p.eventCanceled) return;
5106
+ h$1(C, "display", "none"), this.options.removeCloneOnHide && C.parentNode && C.parentNode.removeChild(C), ue = !0;
5380
5107
  }
5381
5108
  },
5382
- _showClone: function _showClone(putSortable) {
5383
- if (putSortable.lastPutMode !== "clone") {
5109
+ _showClone: function(e) {
5110
+ if (e.lastPutMode !== "clone") {
5384
5111
  this._hideClone();
5385
5112
  return;
5386
5113
  }
5387
- if (cloneHidden) {
5388
- pluginEvent("showClone", this);
5389
- if (Sortable.eventCanceled) return;
5390
- if (dragEl.parentNode == rootEl && !this.options.group.revertClone) rootEl.insertBefore(cloneEl, dragEl);
5391
- else if (nextEl) rootEl.insertBefore(cloneEl, nextEl);
5392
- else rootEl.appendChild(cloneEl);
5393
- if (this.options.group.revertClone) this.animate(dragEl, cloneEl);
5394
- css(cloneEl, "display", "");
5395
- cloneHidden = false;
5114
+ if (ue) {
5115
+ if (z("showClone", this), p.eventCanceled) return;
5116
+ c.parentNode == T && !this.options.group.revertClone ? T.insertBefore(C, c) : pe ? T.insertBefore(C, pe) : T.appendChild(C), this.options.group.revertClone && this.animate(c, C), h$1(C, "display", ""), ue = !1;
5396
5117
  }
5397
5118
  }
5398
- });
5399
- function _globalDragOver(evt) {
5400
- if (evt.dataTransfer) evt.dataTransfer.dropEffect = "move";
5401
- evt.cancelable && evt.preventDefault();
5402
- }
5403
- function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
5404
- var evt, sortable = fromEl[expando], onMoveFn = sortable.options.onMove, retVal;
5405
- if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent("move", {
5406
- bubbles: true,
5407
- cancelable: true
5408
- });
5409
- else {
5410
- evt = document.createEvent("Event");
5411
- evt.initEvent("move", true, true);
5412
- }
5413
- evt.to = toEl;
5414
- evt.from = fromEl;
5415
- evt.dragged = dragEl;
5416
- evt.draggedRect = dragRect;
5417
- evt.related = targetEl || toEl;
5418
- evt.relatedRect = targetRect || getRect(toEl);
5419
- evt.willInsertAfter = willInsertAfter;
5420
- evt.originalEvent = originalEvent;
5421
- fromEl.dispatchEvent(evt);
5422
- if (onMoveFn) retVal = onMoveFn.call(sortable, evt, originalEvent);
5423
- return retVal;
5424
- }
5425
- function _disableDraggable(el) {
5426
- el.draggable = false;
5427
- }
5428
- function _unsilent() {
5429
- _silent = false;
5430
- }
5431
- function _ghostIsFirst(evt, vertical, sortable) {
5432
- var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
5433
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
5434
- var spacer = 10;
5435
- return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
5436
- }
5437
- function _ghostIsLast(evt, vertical, sortable) {
5438
- var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
5439
- var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
5440
- var spacer = 10;
5441
- return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
5442
- }
5443
- function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
5444
- var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;
5445
- if (!invertSwap) {
5446
- if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
5447
- if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) pastFirstInvertThresh = true;
5448
- if (!pastFirstInvertThresh) {
5449
- if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance : mouseOnAxis > targetS2 - targetMoveDistance) return -lastDirection;
5450
- } else invert = true;
5451
- } else if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) return _getInsertDirection(target);
5452
- }
5453
- invert = invert || invertSwap;
5454
- if (invert) {
5455
- if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
5119
+ };
5120
+ function zn(t) {
5121
+ t.dataTransfer && (t.dataTransfer.dropEffect = "move"), t.cancelable && t.preventDefault();
5122
+ }
5123
+ function Xe(t, e, n, o, r, i, a, l) {
5124
+ var s, u = t[q], d = u.options.onMove, f;
5125
+ return window.CustomEvent && !ae && !xe ? s = new CustomEvent("move", {
5126
+ bubbles: !0,
5127
+ cancelable: !0
5128
+ }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = e, s.from = t, s.dragged = n, s.draggedRect = o, s.related = r || e, s.relatedRect = i || P(e), s.willInsertAfter = l, s.originalEvent = a, t.dispatchEvent(s), d && (f = d.call(u, s, a)), f;
5129
+ }
5130
+ function nt(t) {
5131
+ t.draggable = !1;
5132
+ }
5133
+ function Un() {
5134
+ lt = !1;
5135
+ }
5136
+ function Vn(t, e, n) {
5137
+ var o = P(we(n.el, 0, n.options, !0)), r = $t(n.el, n.options, g), i = 10;
5138
+ return e ? t.clientX < r.left - i || t.clientY < o.top && t.clientX < o.right : t.clientY < r.top - i || t.clientY < o.bottom && t.clientX < o.left;
5139
+ }
5140
+ function $n(t, e, n) {
5141
+ var o = P(ht(n.el, n.options.draggable)), r = $t(n.el, n.options, g), i = 10;
5142
+ return e ? t.clientX > r.right + i || t.clientY > o.bottom && t.clientX > o.left : t.clientY > r.bottom + i || t.clientX > o.right && t.clientY > o.top;
5143
+ }
5144
+ function qn(t, e, n, o, r, i, a, l) {
5145
+ var s = o ? t.clientY : t.clientX, u = o ? n.height : n.width, d = o ? n.top : n.left, f = o ? n.bottom : n.right, m = !1;
5146
+ if (!a) {
5147
+ if (l && ke < u * r) {
5148
+ if (!Ae && (Ie === 1 ? s > d + u * i / 2 : s < f - u * i / 2) && (Ae = !0), Ae) m = !0;
5149
+ else if (Ie === 1 ? s < d + ke : s > f - ke) return -Ie;
5150
+ } else if (s > d + u * (1 - r) / 2 && s < f - u * (1 - r) / 2) return Kn(e);
5456
5151
  }
5457
- return 0;
5152
+ return m = m || a, m && (s < d + u * i / 2 || s > f - u * i / 2) ? s > d + u / 2 ? 1 : -1 : 0;
5458
5153
  }
5459
- /**
5460
- * Gets the direction dragEl must be swapped relative to target in order to make it
5461
- * seem that dragEl has been "inserted" into that element's position
5462
- * @param {HTMLElement} target The target whose position dragEl is being inserted at
5463
- * @return {Number} Direction dragEl must be swapped
5464
- */
5465
- function _getInsertDirection(target) {
5466
- if (index(dragEl) < index(target)) return 1;
5467
- else return -1;
5154
+ function Kn(t) {
5155
+ return J(c) < J(t) ? 1 : -1;
5468
5156
  }
5469
- /**
5470
- * Generate id
5471
- * @param {HTMLElement} el
5472
- * @returns {String}
5473
- * @private
5474
- */
5475
- function _generateId(el) {
5476
- var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0;
5477
- while (i--) sum += str.charCodeAt(i);
5478
- return sum.toString(36);
5157
+ function Jn(t) {
5158
+ for (var e = t.tagName + t.className + t.src + t.href + t.textContent, n = e.length, o = 0; n--;) o += e.charCodeAt(n);
5159
+ return o.toString(36);
5479
5160
  }
5480
- function _saveInputCheckedState(root) {
5481
- savedInputChecked.length = 0;
5482
- var inputs = root.getElementsByTagName("input");
5483
- var idx = inputs.length;
5484
- while (idx--) {
5485
- var el = inputs[idx];
5486
- el.checked && savedInputChecked.push(el);
5161
+ function Zn(t) {
5162
+ ze.length = 0;
5163
+ for (var e = t.getElementsByTagName("input"), n = e.length; n--;) {
5164
+ var o = e[n];
5165
+ o.checked && ze.push(o);
5487
5166
  }
5488
5167
  }
5489
- function _nextTick(fn) {
5490
- return setTimeout(fn, 0);
5168
+ function He(t) {
5169
+ return setTimeout(t, 0);
5491
5170
  }
5492
- function _cancelNextTick(id) {
5493
- return clearTimeout(id);
5171
+ function st(t) {
5172
+ return clearTimeout(t);
5494
5173
  }
5495
- if (documentExists) on(document, "touchmove", function(evt) {
5496
- if ((Sortable.active || awaitingDragStarted) && evt.cancelable) evt.preventDefault();
5174
+ Ve && S(document, "touchmove", function(t) {
5175
+ (p.active || ve) && t.cancelable && t.preventDefault();
5497
5176
  });
5498
- Sortable.utils = {
5499
- on,
5500
- off,
5501
- css,
5502
- find,
5503
- is: function is(el, selector) {
5504
- return !!closest(el, selector, el, false);
5177
+ p.utils = {
5178
+ on: S,
5179
+ off: E,
5180
+ css: h$1,
5181
+ find: jt,
5182
+ is: function(e, n) {
5183
+ return !!Q(e, n, e, !1);
5505
5184
  },
5506
- extend,
5507
- throttle,
5508
- closest,
5509
- toggleClass,
5510
- clone,
5511
- index,
5512
- nextTick: _nextTick,
5513
- cancelNextTick: _cancelNextTick,
5514
- detectDirection: _detectDirection,
5515
- getChild,
5516
- expando
5185
+ extend: Fn,
5186
+ throttle: zt,
5187
+ closest: Q,
5188
+ toggleClass: V,
5189
+ clone: Vt,
5190
+ index: J,
5191
+ nextTick: He,
5192
+ cancelNextTick: st,
5193
+ detectDirection: Kt,
5194
+ getChild: we
5517
5195
  };
5518
- /**
5519
- * Get the Sortable instance of an element
5520
- * @param {HTMLElement} element The element
5521
- * @return {Sortable|undefined} The instance of Sortable
5522
- */
5523
- Sortable.get = function(element) {
5524
- return element[expando];
5196
+ p.get = function(t) {
5197
+ return t[q];
5525
5198
  };
5526
- /**
5527
- * Mount a plugin to Sortable
5528
- * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
5529
- */
5530
- Sortable.mount = function() {
5531
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) plugins[_key] = arguments[_key];
5532
- if (plugins[0].constructor === Array) plugins = plugins[0];
5533
- plugins.forEach(function(plugin) {
5534
- if (!plugin.prototype || !plugin.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
5535
- if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
5536
- PluginManager.mount(plugin);
5199
+ p.mount = function() {
5200
+ for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
5201
+ e[0].constructor === Array && (e = e[0]), e.forEach(function(o) {
5202
+ if (!o.prototype || !o.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));
5203
+ o.utils && (p.utils = ne(ne({}, p.utils), o.utils)), Ne.mount(o);
5537
5204
  });
5538
5205
  };
5539
- /**
5540
- * Create sortable instance
5541
- * @param {HTMLElement} el
5542
- * @param {Object} [options]
5543
- */
5544
- Sortable.create = function(el, options) {
5545
- return new Sortable(el, options);
5206
+ p.create = function(t, e) {
5207
+ return new p(t, e);
5546
5208
  };
5547
- Sortable.version = version;
5548
- var autoScrolls = [], scrollEl, scrollRootEl, scrolling = false, lastAutoScrollX, lastAutoScrollY, touchEvt$1, pointerElemChangedInterval;
5549
- function AutoScrollPlugin() {
5550
- function AutoScroll() {
5209
+ p.version = Nn;
5210
+ var N = [], De, ut, ct = !1, ot, rt, Ue, _e;
5211
+ function Qn() {
5212
+ function t() {
5551
5213
  this.defaults = {
5552
- scroll: true,
5553
- forceAutoScrollFallback: false,
5214
+ scroll: !0,
5215
+ forceAutoScrollFallback: !1,
5554
5216
  scrollSensitivity: 30,
5555
5217
  scrollSpeed: 10,
5556
- bubbleScroll: true
5218
+ bubbleScroll: !0
5557
5219
  };
5558
- for (var fn in this) if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this);
5220
+ for (var e in this) e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
5559
5221
  }
5560
- AutoScroll.prototype = {
5561
- dragStarted: function dragStarted(_ref) {
5562
- var originalEvent = _ref.originalEvent;
5563
- if (this.sortable.nativeDraggable) on(document, "dragover", this._handleAutoScroll);
5564
- else if (this.options.supportPointer) on(document, "pointermove", this._handleFallbackAutoScroll);
5565
- else if (originalEvent.touches) on(document, "touchmove", this._handleFallbackAutoScroll);
5566
- else on(document, "mousemove", this._handleFallbackAutoScroll);
5222
+ return t.prototype = {
5223
+ dragStarted: function(n) {
5224
+ var o = n.originalEvent;
5225
+ this.sortable.nativeDraggable ? S(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? S(document, "pointermove", this._handleFallbackAutoScroll) : o.touches ? S(document, "touchmove", this._handleFallbackAutoScroll) : S(document, "mousemove", this._handleFallbackAutoScroll);
5567
5226
  },
5568
- dragOverCompleted: function dragOverCompleted(_ref2) {
5569
- var originalEvent = _ref2.originalEvent;
5570
- if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent);
5227
+ dragOverCompleted: function(n) {
5228
+ var o = n.originalEvent;
5229
+ !this.options.dragOverBubble && !o.rootEl && this._handleAutoScroll(o);
5571
5230
  },
5572
- drop: function drop() {
5573
- if (this.sortable.nativeDraggable) off(document, "dragover", this._handleAutoScroll);
5574
- else {
5575
- off(document, "pointermove", this._handleFallbackAutoScroll);
5576
- off(document, "touchmove", this._handleFallbackAutoScroll);
5577
- off(document, "mousemove", this._handleFallbackAutoScroll);
5578
- }
5579
- clearPointerElemChangedInterval();
5580
- clearAutoScrolls();
5581
- cancelThrottle();
5231
+ drop: function() {
5232
+ this.sortable.nativeDraggable ? E(document, "dragover", this._handleAutoScroll) : (E(document, "pointermove", this._handleFallbackAutoScroll), E(document, "touchmove", this._handleFallbackAutoScroll), E(document, "mousemove", this._handleFallbackAutoScroll)), Rt(), Le(), Rn();
5582
5233
  },
5583
- nulling: function nulling() {
5584
- touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
5585
- autoScrolls.length = 0;
5234
+ nulling: function() {
5235
+ Ue = ut = De = ct = _e = ot = rt = null, N.length = 0;
5586
5236
  },
5587
- _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
5588
- this._handleAutoScroll(evt, true);
5237
+ _handleFallbackAutoScroll: function(n) {
5238
+ this._handleAutoScroll(n, !0);
5589
5239
  },
5590
- _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
5591
- var _this = this;
5592
- var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);
5593
- touchEvt$1 = evt;
5594
- if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
5595
- autoScroll(evt, this.options, elem, fallback);
5596
- var ogElemScroller = getParentAutoScrollElement(elem, true);
5597
- if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
5598
- pointerElemChangedInterval && clearPointerElemChangedInterval();
5599
- pointerElemChangedInterval = setInterval(function() {
5600
- var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
5601
- if (newElem !== ogElemScroller) {
5602
- ogElemScroller = newElem;
5603
- clearAutoScrolls();
5604
- }
5605
- autoScroll(evt, _this.options, newElem, fallback);
5606
- }, 10);
5607
- lastAutoScrollX = x;
5608
- lastAutoScrollY = y;
5609
- }
5240
+ _handleAutoScroll: function(n, o) {
5241
+ var r = this, i = (n.touches ? n.touches[0] : n).clientX, a = (n.touches ? n.touches[0] : n).clientY, l = document.elementFromPoint(i, a);
5242
+ if (Ue = n, o || this.options.forceAutoScrollFallback || xe || ae || Te) {
5243
+ it(n, this.options, l, o);
5244
+ var s = ce(l, !0);
5245
+ ct && (!_e || i !== ot || a !== rt) && (_e && Rt(), _e = setInterval(function() {
5246
+ var u = ce(document.elementFromPoint(i, a), !0);
5247
+ u !== s && (s = u, Le()), it(n, r.options, u, o);
5248
+ }, 10), ot = i, rt = a);
5610
5249
  } else {
5611
- if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
5612
- clearAutoScrolls();
5250
+ if (!this.options.bubbleScroll || ce(l, !0) === te()) {
5251
+ Le();
5613
5252
  return;
5614
5253
  }
5615
- autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
5254
+ it(n, this.options, ce(l, !1), !1);
5616
5255
  }
5617
5256
  }
5618
- };
5619
- return _extends(AutoScroll, {
5257
+ }, ie(t, {
5620
5258
  pluginName: "scroll",
5621
- initializeByDefault: true
5259
+ initializeByDefault: !0
5622
5260
  });
5623
5261
  }
5624
- function clearAutoScrolls() {
5625
- autoScrolls.forEach(function(autoScroll) {
5626
- clearInterval(autoScroll.pid);
5627
- });
5628
- autoScrolls = [];
5629
- }
5630
- function clearPointerElemChangedInterval() {
5631
- clearInterval(pointerElemChangedInterval);
5632
- }
5633
- var autoScroll = throttle(function(evt, options, rootEl, isFallback) {
5634
- if (!options.scroll) return;
5635
- var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = getWindowScrollingElement();
5636
- var scrollThisInstance = false, scrollCustomFn;
5637
- if (scrollRootEl !== rootEl) {
5638
- scrollRootEl = rootEl;
5639
- clearAutoScrolls();
5640
- scrollEl = options.scroll;
5641
- scrollCustomFn = options.scrollFn;
5642
- if (scrollEl === true) scrollEl = getParentAutoScrollElement(rootEl, true);
5262
+ function Le() {
5263
+ N.forEach(function(t) {
5264
+ clearInterval(t.pid);
5265
+ }), N = [];
5266
+ }
5267
+ function Rt() {
5268
+ clearInterval(_e);
5269
+ }
5270
+ var it = zt(function(t, e, n, o) {
5271
+ if (e.scroll) {
5272
+ var r = (t.touches ? t.touches[0] : t).clientX, i = (t.touches ? t.touches[0] : t).clientY, a = e.scrollSensitivity, l = e.scrollSpeed, s = te(), u = !1, d;
5273
+ ut !== n && (ut = n, Le(), De = e.scroll, d = e.scrollFn, De === !0 && (De = ce(n, !0)));
5274
+ var f = 0, m = De;
5275
+ do {
5276
+ var y = m, b = P(y), w = b.top, L = b.bottom, G = b.left, R = b.right, j = b.width, B = b.height, X = void 0, K = void 0, oe = y.scrollWidth, le = y.scrollHeight, k = h$1(y), v = y.scrollLeft, D = y.scrollTop;
5277
+ y === s ? (X = j < oe && (k.overflowX === "auto" || k.overflowX === "scroll" || k.overflowX === "visible"), K = B < le && (k.overflowY === "auto" || k.overflowY === "scroll" || k.overflowY === "visible")) : (X = j < oe && (k.overflowX === "auto" || k.overflowX === "scroll"), K = B < le && (k.overflowY === "auto" || k.overflowY === "scroll"));
5278
+ var A = X && (Math.abs(R - r) <= a && v + j < oe) - (Math.abs(G - r) <= a && !!v), I = K && (Math.abs(L - i) <= a && D + B < le) - (Math.abs(w - i) <= a && !!D);
5279
+ if (!N[f]) for (var _ = 0; _ <= f; _++) N[_] || (N[_] = {});
5280
+ (N[f].vx != A || N[f].vy != I || N[f].el !== y) && (N[f].el = y, N[f].vx = A, N[f].vy = I, clearInterval(N[f].pid), (A != 0 || I != 0) && (u = !0, N[f].pid = setInterval(function() {
5281
+ o && this.layer === 0 && p.active._onTouchMove(Ue);
5282
+ var x = N[this.layer].vy ? N[this.layer].vy * l : 0, M = N[this.layer].vx ? N[this.layer].vx * l : 0;
5283
+ typeof d == "function" && d.call(p.dragged.parentNode[q], M, x, t, Ue, N[this.layer].el) !== "continue" || Ut(N[this.layer].el, M, x);
5284
+ }.bind({ layer: f }), 24))), f++;
5285
+ } while (e.bubbleScroll && m !== s && (m = ce(m, !1)));
5286
+ ct = u;
5643
5287
  }
5644
- var layersOut = 0;
5645
- var currentParent = scrollEl;
5646
- do {
5647
- var el = currentParent, rect = getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;
5648
- if (el === winScroller) {
5649
- canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll" || elCSS.overflowX === "visible");
5650
- canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll" || elCSS.overflowY === "visible");
5651
- } else {
5652
- canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll");
5653
- canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll");
5654
- }
5655
- var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
5656
- var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
5657
- if (!autoScrolls[layersOut]) {
5658
- for (var i = 0; i <= layersOut; i++) if (!autoScrolls[i]) autoScrolls[i] = {};
5659
- }
5660
- if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
5661
- autoScrolls[layersOut].el = el;
5662
- autoScrolls[layersOut].vx = vx;
5663
- autoScrolls[layersOut].vy = vy;
5664
- clearInterval(autoScrolls[layersOut].pid);
5665
- if (vx != 0 || vy != 0) {
5666
- scrollThisInstance = true;
5667
- autoScrolls[layersOut].pid = setInterval(function() {
5668
- if (isFallback && this.layer === 0) Sortable.active._onTouchMove(touchEvt$1);
5669
- var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
5670
- var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
5671
- if (typeof scrollCustomFn === "function") {
5672
- if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== "continue") return;
5673
- }
5674
- scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
5675
- }.bind({ layer: layersOut }), 24);
5676
- }
5677
- }
5678
- layersOut++;
5679
- } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
5680
- scrolling = scrollThisInstance;
5681
- }, 30);
5682
- var drop = function drop(_ref) {
5683
- var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;
5684
- if (!originalEvent) return;
5685
- var toSortable = putSortable || activeSortable;
5686
- hideGhostForTarget();
5687
- var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
5688
- var target = document.elementFromPoint(touch.clientX, touch.clientY);
5689
- unhideGhostForTarget();
5690
- if (toSortable && !toSortable.el.contains(target)) {
5691
- dispatchSortableEvent("spill");
5692
- this.onSpill({
5693
- dragEl,
5694
- putSortable
5695
- });
5288
+ }, 30), en = function(e) {
5289
+ var n = e.originalEvent, o = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, l = e.hideGhostForTarget, s = e.unhideGhostForTarget;
5290
+ if (n) {
5291
+ var u = o || i;
5292
+ l();
5293
+ var d = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, f = document.elementFromPoint(d.clientX, d.clientY);
5294
+ s(), u && !u.el.contains(f) && (a("spill"), this.onSpill({
5295
+ dragEl: r,
5296
+ putSortable: o
5297
+ }));
5696
5298
  }
5697
5299
  };
5698
- function Revert() {}
5699
- Revert.prototype = {
5300
+ function pt() {}
5301
+ pt.prototype = {
5700
5302
  startIndex: null,
5701
- dragStart: function dragStart(_ref2) {
5702
- var oldDraggableIndex = _ref2.oldDraggableIndex;
5703
- this.startIndex = oldDraggableIndex;
5303
+ dragStart: function(e) {
5304
+ var n = e.oldDraggableIndex;
5305
+ this.startIndex = n;
5704
5306
  },
5705
- onSpill: function onSpill(_ref3) {
5706
- var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable;
5707
- this.sortable.captureAnimationState();
5708
- if (putSortable) putSortable.captureAnimationState();
5709
- var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
5710
- if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling);
5711
- else this.sortable.el.appendChild(dragEl);
5712
- this.sortable.animateAll();
5713
- if (putSortable) putSortable.animateAll();
5307
+ onSpill: function(e) {
5308
+ var n = e.dragEl, o = e.putSortable;
5309
+ this.sortable.captureAnimationState(), o && o.captureAnimationState();
5310
+ var r = we(this.sortable.el, this.startIndex, this.options);
5311
+ r ? this.sortable.el.insertBefore(n, r) : this.sortable.el.appendChild(n), this.sortable.animateAll(), o && o.animateAll();
5714
5312
  },
5715
- drop
5313
+ drop: en
5716
5314
  };
5717
- _extends(Revert, { pluginName: "revertOnSpill" });
5718
- function Remove() {}
5719
- Remove.prototype = {
5720
- onSpill: function onSpill(_ref4) {
5721
- var dragEl = _ref4.dragEl;
5722
- var parentSortable = _ref4.putSortable || this.sortable;
5723
- parentSortable.captureAnimationState();
5724
- dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
5725
- parentSortable.animateAll();
5315
+ ie(pt, { pluginName: "revertOnSpill" });
5316
+ function gt() {}
5317
+ gt.prototype = {
5318
+ onSpill: function(e) {
5319
+ var n = e.dragEl, r = e.putSortable || this.sortable;
5320
+ r.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), r.animateAll();
5726
5321
  },
5727
- drop
5322
+ drop: en
5728
5323
  };
5729
- _extends(Remove, { pluginName: "removeOnSpill" });
5730
- Sortable.mount(new AutoScrollPlugin());
5731
- Sortable.mount(Remove, Revert);
5324
+ ie(gt, { pluginName: "removeOnSpill" });
5325
+ p.mount(new Qn());
5326
+ p.mount(gt, pt);
5327
+ function eo(t) {
5328
+ return t == null ? t : JSON.parse(JSON.stringify(t));
5329
+ }
5330
+ function to(t) {
5331
+ getCurrentInstance() && onUnmounted(t);
5332
+ }
5333
+ function no(t) {
5334
+ getCurrentInstance() ? onMounted(t) : nextTick(t);
5335
+ }
5336
+ var tn = null, nn = null;
5337
+ function Xt(t = null, e = null) {
5338
+ tn = t, nn = e;
5339
+ }
5340
+ function oo() {
5341
+ return {
5342
+ data: tn,
5343
+ clonedData: nn
5344
+ };
5345
+ }
5346
+ var Yt = Symbol("cloneElement");
5347
+ function on(...t) {
5348
+ var le, k;
5349
+ const e = (le = getCurrentInstance()) == null ? void 0 : le.proxy;
5350
+ let n = null;
5351
+ const o = t[0];
5352
+ let [, r, i] = t;
5353
+ Array.isArray(unref(r)) || (i = r, r = null);
5354
+ let a = null;
5355
+ const { immediate: l = !0, clone: s = eo, forceFallback: u, fallbackOnBody: d, customUpdate: f } = (k = unref(i)) != null ? k : {};
5356
+ function m(v) {
5357
+ var F;
5358
+ const { from: D, oldIndex: A, item: I } = v, _ = Array.from(D.childNodes);
5359
+ n = u && !d ? _.slice(0, -1) : _;
5360
+ const x = unref((F = unref(r)) == null ? void 0 : F[A]), M = s(x);
5361
+ Xt(x, M), I[Yt] = M;
5362
+ }
5363
+ function y(v) {
5364
+ const D = v.item[Yt];
5365
+ if (!wn(D)) {
5366
+ if (Ke(v.item), isRef(r)) {
5367
+ const A = [...unref(r)];
5368
+ r.value = _t(A, v.newDraggableIndex, D);
5369
+ return;
5370
+ }
5371
+ _t(unref(r), v.newDraggableIndex, D);
5372
+ }
5373
+ }
5374
+ function b(v) {
5375
+ const { from: D, item: A, oldIndex: I, oldDraggableIndex: _, pullMode: x, clone: M } = v;
5376
+ if (Tt(D, A, I), x === "clone") {
5377
+ Ke(M);
5378
+ return;
5379
+ }
5380
+ if (isRef(r)) {
5381
+ const F = [...unref(r)];
5382
+ r.value = Dt(F, _);
5383
+ return;
5384
+ }
5385
+ Dt(unref(r), _);
5386
+ }
5387
+ function w(v) {
5388
+ if (f) {
5389
+ f(v);
5390
+ return;
5391
+ }
5392
+ const { from: D, item: A, oldIndex: I, oldDraggableIndex: _, newDraggableIndex: x } = v;
5393
+ if (Ke(A), Tt(D, A, I), isRef(r)) {
5394
+ const M = [...unref(r)];
5395
+ r.value = St(M, _, x);
5396
+ return;
5397
+ }
5398
+ St(unref(r), _, x);
5399
+ }
5400
+ function L(v) {
5401
+ const { newIndex: D, oldIndex: A, from: I, to: _ } = v;
5402
+ let x = null;
5403
+ const M = D === A && I === _;
5404
+ try {
5405
+ if (M) {
5406
+ let F = null;
5407
+ n?.some((ee, Ee) => {
5408
+ if (F && (n == null ? void 0 : n.length) !== _.childNodes.length) return I.insertBefore(F, ee.nextSibling), !0;
5409
+ const mt = _.childNodes[Ee];
5410
+ F = _ == null ? void 0 : _.replaceChild(ee, mt);
5411
+ });
5412
+ }
5413
+ } catch (F) {
5414
+ x = F;
5415
+ } finally {
5416
+ n = null;
5417
+ }
5418
+ nextTick(() => {
5419
+ if (Xt(), x) throw x;
5420
+ });
5421
+ }
5422
+ const G = {
5423
+ onUpdate: w,
5424
+ onStart: m,
5425
+ onAdd: y,
5426
+ onRemove: b,
5427
+ onEnd: L
5428
+ };
5429
+ function R(v) {
5430
+ const D = unref(o);
5431
+ return v || (v = En(D) ? Sn(D, e == null ? void 0 : e.$el) : D), v && !Tn(v) && (v = v.$el), v || vn("Root element not found"), v;
5432
+ }
5433
+ function j() {
5434
+ var I;
5435
+ const _ = (I = unref(i)) != null ? I : {}, { immediate: v, clone: D } = _, A = $e(_, ["immediate", "clone"]);
5436
+ return Ct(A, (x, M) => {
5437
+ Cn(x) && (A[x] = (F, ...ee) => {
5438
+ return On(F, oo()), M(F, ...ee);
5439
+ });
5440
+ }), _n(r === null ? {} : G, A);
5441
+ }
5442
+ const B = (v) => {
5443
+ v = R(v), a && X.destroy(), a = new p(v, j());
5444
+ };
5445
+ watch(() => i, () => {
5446
+ a && Ct(j(), (v, D) => {
5447
+ a?.option(v, D);
5448
+ });
5449
+ }, { deep: !0 });
5450
+ const X = {
5451
+ option: (v, D) => a == null ? void 0 : a.option(v, D),
5452
+ destroy: () => {
5453
+ a?.destroy(), a = null;
5454
+ },
5455
+ save: () => a == null ? void 0 : a.save(),
5456
+ toArray: () => a == null ? void 0 : a.toArray(),
5457
+ closest: (...v) => a == null ? void 0 : a.closest(...v)
5458
+ }, K = () => X == null ? void 0 : X.option("disabled", !0), oe = () => X == null ? void 0 : X.option("disabled", !1);
5459
+ return no(() => {
5460
+ l && B();
5461
+ }), to(X.destroy), fe({
5462
+ start: B,
5463
+ pause: K,
5464
+ resume: oe
5465
+ }, X);
5466
+ }
5467
+ var ft = [
5468
+ "update",
5469
+ "start",
5470
+ "add",
5471
+ "remove",
5472
+ "choose",
5473
+ "unchoose",
5474
+ "end",
5475
+ "sort",
5476
+ "filter",
5477
+ "clone",
5478
+ "move",
5479
+ "change"
5480
+ ];
5481
+ defineComponent({
5482
+ name: "VueDraggable",
5483
+ model: {
5484
+ prop: "modelValue",
5485
+ event: "update:modelValue"
5486
+ },
5487
+ props: [
5488
+ "clone",
5489
+ "animation",
5490
+ "ghostClass",
5491
+ "group",
5492
+ "sort",
5493
+ "disabled",
5494
+ "store",
5495
+ "handle",
5496
+ "draggable",
5497
+ "swapThreshold",
5498
+ "invertSwap",
5499
+ "invertedSwapThreshold",
5500
+ "removeCloneOnHide",
5501
+ "direction",
5502
+ "chosenClass",
5503
+ "dragClass",
5504
+ "ignore",
5505
+ "filter",
5506
+ "preventOnFilter",
5507
+ "easing",
5508
+ "setData",
5509
+ "dropBubble",
5510
+ "dragoverBubble",
5511
+ "dataIdAttr",
5512
+ "delay",
5513
+ "delayOnTouchOnly",
5514
+ "touchStartThreshold",
5515
+ "forceFallback",
5516
+ "fallbackClass",
5517
+ "fallbackOnBody",
5518
+ "fallbackTolerance",
5519
+ "fallbackOffset",
5520
+ "supportPointer",
5521
+ "emptyInsertThreshold",
5522
+ "scroll",
5523
+ "forceAutoScrollFallback",
5524
+ "scrollSensitivity",
5525
+ "scrollSpeed",
5526
+ "bubbleScroll",
5527
+ "modelValue",
5528
+ "tag",
5529
+ "target",
5530
+ "customUpdate",
5531
+ ...ft.map((t) => `on${t.replace(/^\S/, (e) => e.toUpperCase())}`)
5532
+ ],
5533
+ emits: ["update:modelValue", ...ft],
5534
+ setup(t, { slots: e, emit: n, expose: o, attrs: r }) {
5535
+ const i = ft.reduce((d, f) => {
5536
+ const m = `on${f.replace(/^\S/, (y) => y.toUpperCase())}`;
5537
+ return d[m] = (...y) => n(f, ...y), d;
5538
+ }, {}), a = computed(() => {
5539
+ const y = toRefs(t), { modelValue: d } = y, f = $e(y, ["modelValue"]), m = Object.entries(f).reduce((b, [w, L]) => {
5540
+ const G = unref(L);
5541
+ return G !== void 0 && (b[w] = G), b;
5542
+ }, {});
5543
+ return fe(fe({}, i), yn(fe(fe({}, r), m)));
5544
+ }), l = computed({
5545
+ get: () => t.modelValue,
5546
+ set: (d) => n("update:modelValue", d)
5547
+ }), s = ref(), u = reactive(on(t.target || s, l, a));
5548
+ return o(u), () => {
5549
+ var d;
5550
+ return h(t.tag || "div", { ref: s }, (d = e == null ? void 0 : e.default) == null ? void 0 : d.call(e, u));
5551
+ };
5552
+ }
5553
+ });
5554
+ var Bt = {
5555
+ mounted: "mounted",
5556
+ unmounted: "unmounted"
5557
+ };
5558
+ Bt.mounted, Bt.unmounted;
5732
5559
  //#endregion
5733
5560
  //#region src/components/AccordionItem.vue?vue&type=script&setup=true&lang.ts
5734
- var _hoisted_1$1 = {
5735
- key: 2,
5736
- class: "accordion-title ml-4"
5737
- };
5738
- var _hoisted_2$1 = {
5739
- key: 3,
5740
- class: "d-flex mx-2 ga-1"
5741
- };
5561
+ var _hoisted_1$1 = { class: "d-flex align-center w-100 ga-2" };
5562
+ var SAVE_DEBOUNCE = 3e3;
5742
5563
  var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
5743
5564
  __name: "AccordionItem",
5744
5565
  props: {
@@ -5764,45 +5585,29 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5764
5585
  const props = __props;
5765
5586
  const emit = __emit;
5766
5587
  const eventBus = inject("$eventBus");
5767
- const isEditing = ref(!props.item.header);
5768
- const form = ref();
5769
- const header = ref(props.item.header);
5588
+ const draft = reactive({ header: props.item.header });
5770
5589
  const hasElements = computed(() => !isEmpty(props.embeds));
5771
- const cancel = () => {
5772
- header.value = props.item.header;
5773
- isEditing.value = false;
5774
- };
5775
- const saveHeader = async () => {
5776
- if (!form.value) return;
5777
- const { valid } = await form.value.validate();
5778
- if (!valid) return;
5779
- isEditing.value = false;
5590
+ const currentItem = () => ({
5591
+ ...cloneDeep(props.item),
5592
+ ...draft
5593
+ });
5594
+ const save = debounce(() => {
5780
5595
  emit("save", {
5781
- item: {
5782
- ...props.item,
5783
- header: header.value
5784
- },
5596
+ item: currentItem(),
5785
5597
  embeds: props.embeds
5786
5598
  });
5787
- };
5599
+ }, SAVE_DEBOUNCE);
5788
5600
  const saveEmbed = (embeds) => {
5789
- const item = cloneDeep(props.item);
5601
+ const item = currentItem();
5790
5602
  forEach(embeds, (it) => item.body[it.id] = true);
5791
5603
  emit("save", {
5792
5604
  item,
5793
5605
  embeds
5794
5606
  });
5795
5607
  };
5796
- const deleteItem = () => {
5797
- return eventBus.channel("app").emit("showConfirmationModal", {
5798
- title: "Delete accordion item",
5799
- message: "Are you sure you want to delete selected item?",
5800
- action: () => emit("delete")
5801
- });
5802
- };
5803
5608
  const deleteEmbed = (embed) => {
5609
+ const item = currentItem();
5804
5610
  const embeds = cloneDeep(props.embeds);
5805
- const item = cloneDeep(props.item);
5806
5611
  delete embeds[embed.id];
5807
5612
  delete item.body[embed.id];
5808
5613
  emit("save", {
@@ -5810,13 +5615,18 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5810
5615
  embeds
5811
5616
  });
5812
5617
  };
5618
+ const deleteItem = () => {
5619
+ return eventBus.channel("app").emit("showConfirmationModal", {
5620
+ title: "Delete accordion item",
5621
+ message: "Are you sure you want to delete selected item?",
5622
+ action: () => emit("delete")
5623
+ });
5624
+ };
5813
5625
  return (_ctx, _cache) => {
5814
5626
  const _component_VIcon = resolveComponent("VIcon");
5815
5627
  const _component_VTextField = resolveComponent("VTextField");
5816
- const _component_VSpacer = resolveComponent("VSpacer");
5817
5628
  const _component_VBtn = resolveComponent("VBtn");
5818
5629
  const _component_VFadeTransition = resolveComponent("VFadeTransition");
5819
- const _component_VForm = resolveComponent("VForm");
5820
5630
  const _component_VExpansionPanelTitle = resolveComponent("VExpansionPanelTitle");
5821
5631
  const _component_VHover = resolveComponent("VHover");
5822
5632
  const _component_VAlert = resolveComponent("VAlert");
@@ -5828,101 +5638,55 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5828
5638
  default: withCtx(() => [createVNode(_component_VHover, null, {
5829
5639
  default: withCtx(({ isHovering, props: hoverProps }) => [createVNode(_component_VExpansionPanelTitle, mergeProps(hoverProps, {
5830
5640
  class: "pa-2 pr-4",
5831
- color: "primary-lighten-5",
5832
- "min-height": "64"
5641
+ "min-height": "56"
5833
5642
  }), {
5834
- default: withCtx(() => [createVNode(_component_VForm, {
5835
- ref_key: "form",
5836
- ref: form,
5837
- class: "d-flex align-center w-100",
5838
- "validate-on": "submit",
5839
- onSubmit: withModifiers(saveHeader, ["prevent"])
5840
- }, {
5841
- default: withCtx(() => [
5842
- !__props.isReadonly ? (openBlock(), createElementBlock("span", {
5643
+ default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [
5644
+ !__props.isReadonly ? (openBlock(), createElementBlock("span", {
5645
+ key: 0,
5646
+ class: "accordion-drag-handle",
5647
+ onDrag: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop", "prevent"]))
5648
+ }, [createVNode(_component_VIcon, { icon: "mdi-drag-vertical" })], 32)) : createCommentVNode("", true),
5649
+ createVNode(_component_VTextField, {
5650
+ modelValue: draft.header,
5651
+ "onUpdate:modelValue": [_cache[1] || (_cache[1] = ($event) => draft.header = $event), unref(save)],
5652
+ readonly: __props.isReadonly,
5653
+ "bg-color": "transparent",
5654
+ class: "accordion-item-title",
5655
+ density: "compact",
5656
+ placeholder: "Accordion Title",
5657
+ variant: "plain",
5658
+ flat: "",
5659
+ "hide-details": "",
5660
+ onBlur: _cache[2] || (_cache[2] = ($event) => unref(save).flush()),
5661
+ onClick: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"])),
5662
+ onKeyup: _cache[4] || (_cache[4] = withKeys(withModifiers(() => {}, ["prevent"]), ["space"]))
5663
+ }, null, 8, [
5664
+ "modelValue",
5665
+ "readonly",
5666
+ "onUpdate:modelValue"
5667
+ ]),
5668
+ createVNode(_component_VFadeTransition, null, {
5669
+ default: withCtx(() => [(isHovering || __props.isExpanded) && !__props.isReadonly && __props.allowDeletion ? withDirectives((openBlock(), createBlock(_component_VBtn, {
5843
5670
  key: 0,
5844
- class: "accordion-drag-handle",
5845
- onDrag: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop", "prevent"]))
5846
- }, [createVNode(_component_VIcon, { icon: "mdi-drag-vertical" })], 32)) : createCommentVNode("", true),
5847
- isEditing.value ? (openBlock(), createBlock(_component_VTextField, {
5848
- key: 1,
5849
- modelValue: header.value,
5850
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => header.value = $event),
5851
- rules: [(val) => !!val || "Title is required"],
5852
- "bg-color": "white",
5853
- class: "w-100",
5854
- density: "compact",
5855
- "hide-details": "auto",
5856
- placeholder: "Accordion item title...",
5857
- variant: "outlined",
5858
- onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
5859
- onKeyup: _cache[3] || (_cache[3] = withKeys(withModifiers(() => {}, ["prevent"]), ["space"]))
5860
- }, null, 8, ["modelValue", "rules"])) : (openBlock(), createElementBlock("div", _hoisted_1$1, toDisplayString(__props.item.header), 1)),
5861
- createVNode(_component_VSpacer),
5862
- !__props.isReadonly ? (openBlock(), createElementBlock("div", _hoisted_2$1, [isEditing.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(_component_VBtn, {
5863
- disabled: header.value === props.item.header,
5864
- color: "primary-darken-2",
5865
- text: "Save",
5866
- type: "submit",
5671
+ "aria-label": "Delete item",
5672
+ class: "mr-2",
5673
+ color: "error",
5674
+ density: "comfortable",
5675
+ icon: "mdi-trash-can-outline",
5676
+ size: "small",
5867
5677
  variant: "tonal",
5868
- onClick: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
5869
- }, null, 8, ["disabled"]), createVNode(_component_VBtn, {
5870
- disabled: !props.item.header,
5871
- color: "primary-darken-2",
5872
- text: "Cancel",
5873
- variant: "text",
5874
- onClick: withModifiers(cancel, ["stop"])
5875
- }, null, 8, ["disabled"])], 64)) : (openBlock(), createBlock(_component_VFadeTransition, {
5876
- key: 1,
5877
- group: ""
5878
- }, {
5879
- default: withCtx(() => [isHovering || __props.isExpanded ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [withDirectives((openBlock(), createBlock(_component_VBtn, {
5880
- "aria-label": "Edit title",
5881
- color: "primary-darken-2",
5882
- size: "x-small",
5883
- variant: "tonal",
5884
- icon: "",
5885
- onClick: _cache[5] || (_cache[5] = withModifiers(($event) => isEditing.value = true, ["stop"]))
5886
- }, {
5887
- default: withCtx(() => [createVNode(_component_VIcon, {
5888
- icon: "mdi-square-edit-outline",
5889
- size: "large"
5890
- })]),
5891
- _: 1
5892
- })), [[
5893
- _directive_tooltip,
5894
- {
5895
- text: "Edit title",
5896
- openDelay: 300
5897
- },
5898
- "bottom"
5899
- ]]), __props.allowDeletion ? withDirectives((openBlock(), createBlock(_component_VBtn, {
5900
- key: 0,
5901
- "aria-label": "Delete item",
5902
- color: "secondary-lighten-1",
5903
- size: "x-small",
5904
- variant: "tonal",
5905
- icon: "",
5906
- onClick: withModifiers(deleteItem, ["stop"])
5907
- }, {
5908
- default: withCtx(() => [createVNode(_component_VIcon, {
5909
- icon: "mdi-delete-outline",
5910
- size: "large"
5911
- })]),
5912
- _: 1
5913
- })), [[
5914
- _directive_tooltip,
5915
- {
5916
- text: "Delete item",
5917
- openDelay: 300
5918
- },
5919
- "bottom"
5920
- ]]) : createCommentVNode("", true)], 64)) : createCommentVNode("", true)]),
5921
- _: 2
5922
- }, 1024))])) : createCommentVNode("", true)
5923
- ]),
5924
- _: 2
5925
- }, 1536)]),
5678
+ onClick: withModifiers(deleteItem, ["stop"])
5679
+ }, null, 512)), [[
5680
+ _directive_tooltip,
5681
+ {
5682
+ text: "Delete item",
5683
+ openDelay: 300
5684
+ },
5685
+ "bottom"
5686
+ ]]) : createCommentVNode("", true)]),
5687
+ _: 2
5688
+ }, 1024)
5689
+ ])]),
5926
5690
  _: 2
5927
5691
  }, 1040)]),
5928
5692
  _: 1
@@ -5930,7 +5694,6 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5930
5694
  default: withCtx(() => [!hasElements.value ? (openBlock(), createBlock(_component_VAlert, {
5931
5695
  key: 0,
5932
5696
  class: "mx-6 mt-4 mb-2",
5933
- color: "primary-darken-1",
5934
5697
  icon: "mdi-information-outline",
5935
5698
  variant: "tonal",
5936
5699
  prominent: ""
@@ -5942,7 +5705,7 @@ var AccordionItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
5942
5705
  container: { embeds: __props.embeds },
5943
5706
  "is-readonly": __props.isReadonly,
5944
5707
  onDelete: deleteEmbed,
5945
- onSave: _cache[6] || (_cache[6] = ($event) => saveEmbed($event.embeds))
5708
+ onSave: _cache[5] || (_cache[5] = ($event) => saveEmbed($event.embeds))
5946
5709
  }, null, 8, [
5947
5710
  "allowed-element-config",
5948
5711
  "container",
@@ -5964,11 +5727,10 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
5964
5727
  };
5965
5728
  //#endregion
5966
5729
  //#region src/components/AccordionItem.vue
5967
- var AccordionItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(AccordionItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e39fe68d"]]);
5730
+ var AccordionItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(AccordionItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6d959b25"]]);
5968
5731
  //#endregion
5969
5732
  //#region src/components/Edit.vue?vue&type=script&setup=true&lang.ts
5970
- var _hoisted_1 = { class: "text-title-small" };
5971
- var _hoisted_2 = { class: "pa-6 text-center" };
5733
+ var _hoisted_1 = { class: "tce-accordion text-center" };
5972
5734
  //#endregion
5973
5735
  //#region src/components/Edit.vue
5974
5736
  var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -5987,7 +5749,6 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
5987
5749
  const expanded = ref([]);
5988
5750
  const elementData = reactive(cloneDeep(props.element.data));
5989
5751
  const panels = ref();
5990
- const sortable = ref();
5991
5752
  const accordionItems = computed(() => sortBy(elementData.items, "position"));
5992
5753
  const accordionItemCount = computed(() => accordionItems.value.length);
5993
5754
  const embedsByItem = computed(() => reduce(elementData.items, (acc, item) => {
@@ -6010,7 +5771,7 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
6010
5771
  const id = v4();
6011
5772
  elementData.items[id] = {
6012
5773
  id,
6013
- header: `Accordion Item Title`,
5774
+ header: "",
6014
5775
  body: {},
6015
5776
  position: accordionItemCount.value + 1
6016
5777
  };
@@ -6024,103 +5785,80 @@ var Edit_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE_
6024
5785
  const prevPos = accordionItems.value[newIndex].position;
6025
5786
  return (accordionItems.value[newIndex + direction].position + prevPos) / 2;
6026
5787
  };
6027
- onMounted(() => {
6028
- sortable.value = Sortable.create(panels.value.$el, {
6029
- animation: 150,
6030
- group: `dragDrop-${uniqueId()}`,
6031
- handle: ".accordion-drag-handle",
6032
- onEnd: ({ oldIndex, newIndex }) => {
6033
- if (!isNumber(newIndex) || !isNumber(oldIndex)) return;
6034
- const position = calculateNewPosition(oldIndex, newIndex);
6035
- const currentItem = accordionItems.value[oldIndex];
6036
- Object.assign(elementData.items[currentItem.id], { position });
6037
- emit("save", elementData);
6038
- }
6039
- });
5788
+ on(panels, {
5789
+ animation: 150,
5790
+ handle: ".accordion-drag-handle",
5791
+ onUpdate: ({ oldIndex, newIndex }) => {
5792
+ if (!isNumber(newIndex) || !isNumber(oldIndex)) return;
5793
+ const position = calculateNewPosition(oldIndex, newIndex);
5794
+ const currentItem = accordionItems.value[oldIndex];
5795
+ Object.assign(elementData.items[currentItem.id], { position });
5796
+ emit("save", elementData);
5797
+ }
6040
5798
  });
6041
- onBeforeUnmount(() => {
6042
- sortable.value.destroy();
5799
+ watch(() => props.element.data, (data) => {
5800
+ if (isEqual(data, elementData)) return;
5801
+ Object.assign(elementData, cloneDeep(data));
6043
5802
  });
6044
5803
  return (_ctx, _cache) => {
6045
- const _component_VIcon = resolveComponent("VIcon");
6046
- const _component_VToolbar = resolveComponent("VToolbar");
6047
5804
  const _component_VExpandTransition = resolveComponent("VExpandTransition");
6048
5805
  const _component_VExpansionPanels = resolveComponent("VExpansionPanels");
6049
5806
  const _component_VBtn = resolveComponent("VBtn");
6050
- const _component_VCard = resolveComponent("VCard");
6051
- return openBlock(), createBlock(_component_VCard, {
6052
- class: "tce-accordion",
6053
- color: "grey-lighten-5"
5807
+ return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_VExpansionPanels, {
5808
+ ref_key: "panels",
5809
+ ref: panels,
5810
+ modelValue: expanded.value,
5811
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
5812
+ rounded: "lg",
5813
+ flat: "",
5814
+ multiple: ""
6054
5815
  }, {
6055
- default: withCtx(() => [createVNode(_component_VToolbar, {
6056
- class: "px-4",
6057
- color: "primary-darken-2",
6058
- height: "36"
6059
- }, {
6060
- default: withCtx(() => [createVNode(_component_VIcon, {
6061
- icon: unref(manifest$1).ui.icon,
6062
- color: "secondary-lighten-2",
6063
- size: "18",
6064
- start: ""
6065
- }, null, 8, ["icon"]), createElementVNode("span", _hoisted_1, toDisplayString(unref(manifest$1).name), 1)]),
6066
- _: 1
6067
- }), createElementVNode("div", _hoisted_2, [createVNode(_component_VExpansionPanels, {
6068
- ref_key: "panels",
6069
- ref: panels,
6070
- modelValue: expanded.value,
6071
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => expanded.value = $event),
6072
- rounded: "lg",
6073
- flat: "",
6074
- multiple: ""
6075
- }, {
6076
- default: withCtx(() => [!!accordionItemCount.value ? (openBlock(), createBlock(_component_VExpandTransition, {
6077
- key: 0,
6078
- group: ""
6079
- }, {
6080
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(accordionItems.value, (item) => {
6081
- return openBlock(), createBlock(AccordionItem_default, {
6082
- key: item.id,
6083
- "allow-deletion": accordionItemCount.value > 1,
6084
- "embed-element-config": __props.embedElementConfig,
6085
- embeds: embedsByItem.value[item.id],
6086
- "is-expanded": expanded.value.includes(item.id),
6087
- "is-focused": __props.isFocused,
6088
- "is-readonly": __props.isReadonly,
6089
- item,
6090
- onDelete: ($event) => deleteItem(item.id),
6091
- onExpand: ($event) => expanded.value.push(item.id),
6092
- onSave: _cache[0] || (_cache[0] = ($event) => saveItem($event))
6093
- }, null, 8, [
6094
- "allow-deletion",
6095
- "embed-element-config",
6096
- "embeds",
6097
- "is-expanded",
6098
- "is-focused",
6099
- "is-readonly",
6100
- "item",
6101
- "onDelete",
6102
- "onExpand"
6103
- ]);
6104
- }), 128))]),
6105
- _: 1
6106
- })) : createCommentVNode("", true)]),
6107
- _: 1
6108
- }, 8, ["modelValue"]), !__props.isReadonly ? (openBlock(), createBlock(_component_VBtn, {
5816
+ default: withCtx(() => [!!accordionItemCount.value ? (openBlock(), createBlock(_component_VExpandTransition, {
6109
5817
  key: 0,
6110
- class: "mt-6",
6111
- color: "primary-darken-4",
6112
- "prepend-icon": "mdi-tab-plus",
6113
- variant: "text",
6114
- onClick: addAccordionItem
5818
+ group: ""
6115
5819
  }, {
6116
- default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Add Accordion Item ", -1)])]),
5820
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(accordionItems.value, (item) => {
5821
+ return openBlock(), createBlock(AccordionItem_default, {
5822
+ key: item.id,
5823
+ "allow-deletion": accordionItemCount.value > 1,
5824
+ "embed-element-config": __props.embedElementConfig,
5825
+ embeds: embedsByItem.value[item.id],
5826
+ "is-expanded": expanded.value.includes(item.id),
5827
+ "is-focused": __props.isFocused,
5828
+ "is-readonly": __props.isReadonly,
5829
+ item,
5830
+ class: "text-left",
5831
+ onDelete: ($event) => deleteItem(item.id),
5832
+ onExpand: ($event) => expanded.value.push(item.id),
5833
+ onSave: _cache[0] || (_cache[0] = ($event) => saveItem($event))
5834
+ }, null, 8, [
5835
+ "allow-deletion",
5836
+ "embed-element-config",
5837
+ "embeds",
5838
+ "is-expanded",
5839
+ "is-focused",
5840
+ "is-readonly",
5841
+ "item",
5842
+ "onDelete",
5843
+ "onExpand"
5844
+ ]);
5845
+ }), 128))]),
6117
5846
  _: 1
6118
- })) : createCommentVNode("", true)])]),
5847
+ })) : createCommentVNode("", true)]),
6119
5848
  _: 1
6120
- });
5849
+ }, 8, ["modelValue"]), !__props.isReadonly ? (openBlock(), createBlock(_component_VBtn, {
5850
+ key: 0,
5851
+ class: "mt-4",
5852
+ "prepend-icon": "mdi-plus",
5853
+ variant: "text",
5854
+ onClick: addAccordionItem
5855
+ }, {
5856
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Add Accordion Item ", -1)])]),
5857
+ _: 1
5858
+ })) : createCommentVNode("", true)]);
6121
5859
  };
6122
5860
  }
6123
- }), [["__scopeId", "data-v-55d0ed15"]]);
5861
+ }), [["__scopeId", "data-v-1aaa8449"]]);
6124
5862
  //#endregion
6125
5863
  //#region src/index.ts
6126
5864
  var manifest = {