mvframe 1.0.6 → 1.0.8

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.
@@ -1,1612 +0,0 @@
1
- import { a as Ue } from "./vendor.js";
2
- /**!
3
- * Sortable 1.14.0
4
- * @author RubaXa <trash@rubaxa.org>
5
- * @author owenm <owen23355@gmail.com>
6
- * @license MIT
7
- */
8
- function De(o, t) {
9
- var e = Object.keys(o);
10
- if (Object.getOwnPropertySymbols) {
11
- var n = Object.getOwnPropertySymbols(o);
12
- t && (n = n.filter(function(i) {
13
- return Object.getOwnPropertyDescriptor(o, i).enumerable;
14
- })), e.push.apply(e, n);
15
- }
16
- return e;
17
- }
18
- function J(o) {
19
- for (var t = 1; t < arguments.length; t++) {
20
- var e = arguments[t] != null ? arguments[t] : {};
21
- t % 2 ? De(Object(e), !0).forEach(function(n) {
22
- qe(o, n, e[n]);
23
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(e)) : De(Object(e)).forEach(function(n) {
24
- Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(e, n));
25
- });
26
- }
27
- return o;
28
- }
29
- function zt(o) {
30
- "@babel/helpers - typeof";
31
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? zt = function(t) {
32
- return typeof t;
33
- } : zt = function(t) {
34
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
35
- }, zt(o);
36
- }
37
- function qe(o, t, e) {
38
- return t in o ? Object.defineProperty(o, t, {
39
- value: e,
40
- enumerable: !0,
41
- configurable: !0,
42
- writable: !0
43
- }) : o[t] = e, o;
44
- }
45
- function z() {
46
- return z = Object.assign || function(o) {
47
- for (var t = 1; t < arguments.length; t++) {
48
- var e = arguments[t];
49
- for (var n in e)
50
- Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);
51
- }
52
- return o;
53
- }, z.apply(this, arguments);
54
- }
55
- function $e(o, t) {
56
- if (o == null) return {};
57
- var e = {}, n = Object.keys(o), i, r;
58
- for (r = 0; r < n.length; r++)
59
- i = n[r], !(t.indexOf(i) >= 0) && (e[i] = o[i]);
60
- return e;
61
- }
62
- function Ve(o, t) {
63
- if (o == null) return {};
64
- var e = $e(o, t), n, i;
65
- if (Object.getOwnPropertySymbols) {
66
- var r = Object.getOwnPropertySymbols(o);
67
- for (i = 0; i < r.length; i++)
68
- n = r[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (e[n] = o[n]);
69
- }
70
- return e;
71
- }
72
- function Ze(o) {
73
- return Qe(o) || Je(o) || tn(o) || en();
74
- }
75
- function Qe(o) {
76
- if (Array.isArray(o)) return he(o);
77
- }
78
- function Je(o) {
79
- if (typeof Symbol < "u" && o[Symbol.iterator] != null || o["@@iterator"] != null) return Array.from(o);
80
- }
81
- function tn(o, t) {
82
- if (o) {
83
- if (typeof o == "string") return he(o, t);
84
- var e = Object.prototype.toString.call(o).slice(8, -1);
85
- if (e === "Object" && o.constructor && (e = o.constructor.name), e === "Map" || e === "Set") return Array.from(o);
86
- if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return he(o, t);
87
- }
88
- }
89
- function he(o, t) {
90
- (t == null || t > o.length) && (t = o.length);
91
- for (var e = 0, n = new Array(t); e < t; e++) n[e] = o[e];
92
- return n;
93
- }
94
- function en() {
95
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
96
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
97
- }
98
- var nn = "1.14.0";
99
- function et(o) {
100
- if (typeof window < "u" && window.navigator)
101
- return !!/* @__PURE__ */ navigator.userAgent.match(o);
102
- }
103
- var nt = et(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Xt = et(/Edge/i), _e = et(/firefox/i), Mt = et(/safari/i) && !et(/chrome/i) && !et(/android/i), Fe = et(/iP(ad|od|hone)/i), on = et(/chrome/i) && et(/android/i), Re = {
104
- capture: !1,
105
- passive: !1
106
- };
107
- function y(o, t, e) {
108
- o.addEventListener(t, e, !nt && Re);
109
- }
110
- function w(o, t, e) {
111
- o.removeEventListener(t, e, !nt && Re);
112
- }
113
- function Zt(o, t) {
114
- if (t) {
115
- if (t[0] === ">" && (t = t.substring(1)), o)
116
- try {
117
- if (o.matches)
118
- return o.matches(t);
119
- if (o.msMatchesSelector)
120
- return o.msMatchesSelector(t);
121
- if (o.webkitMatchesSelector)
122
- return o.webkitMatchesSelector(t);
123
- } catch {
124
- return !1;
125
- }
126
- return !1;
127
- }
128
- }
129
- function rn(o) {
130
- return o.host && o !== document && o.host.nodeType ? o.host : o.parentNode;
131
- }
132
- function $(o, t, e, n) {
133
- if (o) {
134
- e = e || document;
135
- do {
136
- if (t != null && (t[0] === ">" ? o.parentNode === e && Zt(o, t) : Zt(o, t)) || n && o === e)
137
- return o;
138
- if (o === e) break;
139
- } while (o = rn(o));
140
- }
141
- return null;
142
- }
143
- var Ce = /\s+/g;
144
- function T(o, t, e) {
145
- if (o && t)
146
- if (o.classList)
147
- o.classList[e ? "add" : "remove"](t);
148
- else {
149
- var n = (" " + o.className + " ").replace(Ce, " ").replace(" " + t + " ", " ");
150
- o.className = (n + (e ? " " + t : "")).replace(Ce, " ");
151
- }
152
- }
153
- function h(o, t, e) {
154
- var n = o && o.style;
155
- if (n) {
156
- if (e === void 0)
157
- return document.defaultView && document.defaultView.getComputedStyle ? e = document.defaultView.getComputedStyle(o, "") : o.currentStyle && (e = o.currentStyle), t === void 0 ? e : e[t];
158
- !(t in n) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), n[t] = e + (typeof e == "string" ? "" : "px");
159
- }
160
- }
161
- function ht(o, t) {
162
- var e = "";
163
- if (typeof o == "string")
164
- e = o;
165
- else
166
- do {
167
- var n = h(o, "transform");
168
- n && n !== "none" && (e = n + " " + e);
169
- } while (!t && (o = o.parentNode));
170
- var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
171
- return i && new i(e);
172
- }
173
- function ke(o, t, e) {
174
- if (o) {
175
- var n = o.getElementsByTagName(t), i = 0, r = n.length;
176
- if (e)
177
- for (; i < r; i++)
178
- e(n[i], i);
179
- return n;
180
- }
181
- return [];
182
- }
183
- function Q() {
184
- var o = document.scrollingElement;
185
- return o || document.documentElement;
186
- }
187
- function O(o, t, e, n, i) {
188
- if (!(!o.getBoundingClientRect && o !== window)) {
189
- var r, a, l, s, u, d, f;
190
- if (o !== window && o.parentNode && o !== Q() ? (r = o.getBoundingClientRect(), a = r.top, l = r.left, s = r.bottom, u = r.right, d = r.height, f = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, f = window.innerWidth), (t || e) && o !== window && (i = i || o.parentNode, !nt))
191
- do
192
- if (i && i.getBoundingClientRect && (h(i, "transform") !== "none" || e && h(i, "position") !== "static")) {
193
- var p = i.getBoundingClientRect();
194
- a -= p.top + parseInt(h(i, "border-top-width")), l -= p.left + parseInt(h(i, "border-left-width")), s = a + r.height, u = l + r.width;
195
- break;
196
- }
197
- while (i = i.parentNode);
198
- if (n && o !== window) {
199
- var E = ht(i || o), b = E && E.a, S = E && E.d;
200
- E && (a /= S, l /= b, f /= b, d /= S, s = a + d, u = l + f);
201
- }
202
- return {
203
- top: a,
204
- left: l,
205
- bottom: s,
206
- right: u,
207
- width: f,
208
- height: d
209
- };
210
- }
211
- }
212
- function Oe(o, t, e) {
213
- for (var n = lt(o, !0), i = O(o)[t]; n; ) {
214
- var r = O(n)[e], a = void 0;
215
- if (a = i >= r, !a) return n;
216
- if (n === Q()) break;
217
- n = lt(n, !1);
218
- }
219
- return !1;
220
- }
221
- function wt(o, t, e, n) {
222
- for (var i = 0, r = 0, a = o.children; r < a.length; ) {
223
- if (a[r].style.display !== "none" && a[r] !== g.ghost && (n || a[r] !== g.dragged) && $(a[r], e.draggable, o, !1)) {
224
- if (i === t)
225
- return a[r];
226
- i++;
227
- }
228
- r++;
229
- }
230
- return null;
231
- }
232
- function be(o, t) {
233
- for (var e = o.lastElementChild; e && (e === g.ghost || h(e, "display") === "none" || t && !Zt(e, t)); )
234
- e = e.previousElementSibling;
235
- return e || null;
236
- }
237
- function N(o, t) {
238
- var e = 0;
239
- if (!o || !o.parentNode)
240
- return -1;
241
- for (; o = o.previousElementSibling; )
242
- o.nodeName.toUpperCase() !== "TEMPLATE" && o !== g.clone && (!t || Zt(o, t)) && e++;
243
- return e;
244
- }
245
- function Te(o) {
246
- var t = 0, e = 0, n = Q();
247
- if (o)
248
- do {
249
- var i = ht(o), r = i.a, a = i.d;
250
- t += o.scrollLeft * r, e += o.scrollTop * a;
251
- } while (o !== n && (o = o.parentNode));
252
- return [t, e];
253
- }
254
- function an(o, t) {
255
- for (var e in o)
256
- if (o.hasOwnProperty(e)) {
257
- for (var n in t)
258
- if (t.hasOwnProperty(n) && t[n] === o[e][n]) return Number(e);
259
- }
260
- return -1;
261
- }
262
- function lt(o, t) {
263
- if (!o || !o.getBoundingClientRect) return Q();
264
- var e = o, n = !1;
265
- do
266
- if (e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight) {
267
- var i = h(e);
268
- if (e.clientWidth < e.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || e.clientHeight < e.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
269
- if (!e.getBoundingClientRect || e === document.body) return Q();
270
- if (n || t) return e;
271
- n = !0;
272
- }
273
- }
274
- while (e = e.parentNode);
275
- return Q();
276
- }
277
- function ln(o, t) {
278
- if (o && t)
279
- for (var e in t)
280
- t.hasOwnProperty(e) && (o[e] = t[e]);
281
- return o;
282
- }
283
- function oe(o, t) {
284
- return Math.round(o.top) === Math.round(t.top) && Math.round(o.left) === Math.round(t.left) && Math.round(o.height) === Math.round(t.height) && Math.round(o.width) === Math.round(t.width);
285
- }
286
- var xt;
287
- function Xe(o, t) {
288
- return function() {
289
- if (!xt) {
290
- var e = arguments, n = this;
291
- e.length === 1 ? o.call(n, e[0]) : o.apply(n, e), xt = setTimeout(function() {
292
- xt = void 0;
293
- }, t);
294
- }
295
- };
296
- }
297
- function sn() {
298
- clearTimeout(xt), xt = void 0;
299
- }
300
- function Ye(o, t, e) {
301
- o.scrollLeft += t, o.scrollTop += e;
302
- }
303
- function we(o) {
304
- var t = window.Polymer, e = window.jQuery || window.Zepto;
305
- return t && t.dom ? t.dom(o).cloneNode(!0) : e ? e(o).clone(!0)[0] : o.cloneNode(!0);
306
- }
307
- function Ae(o, t) {
308
- h(o, "position", "absolute"), h(o, "top", t.top), h(o, "left", t.left), h(o, "width", t.width), h(o, "height", t.height);
309
- }
310
- function ie(o) {
311
- h(o, "position", ""), h(o, "top", ""), h(o, "left", ""), h(o, "width", ""), h(o, "height", "");
312
- }
313
- var k = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
314
- function un() {
315
- var o = [], t;
316
- return {
317
- captureAnimationState: function() {
318
- if (o = [], !!this.options.animation) {
319
- var n = [].slice.call(this.el.children);
320
- n.forEach(function(i) {
321
- if (!(h(i, "display") === "none" || i === g.ghost)) {
322
- o.push({
323
- target: i,
324
- rect: O(i)
325
- });
326
- var r = J({}, o[o.length - 1].rect);
327
- if (i.thisAnimationDuration) {
328
- var a = ht(i, !0);
329
- a && (r.top -= a.f, r.left -= a.e);
330
- }
331
- i.fromRect = r;
332
- }
333
- });
334
- }
335
- },
336
- addAnimationState: function(n) {
337
- o.push(n);
338
- },
339
- removeAnimationState: function(n) {
340
- o.splice(an(o, {
341
- target: n
342
- }), 1);
343
- },
344
- animateAll: function(n) {
345
- var i = this;
346
- if (!this.options.animation) {
347
- clearTimeout(t), typeof n == "function" && n();
348
- return;
349
- }
350
- var r = !1, a = 0;
351
- o.forEach(function(l) {
352
- var s = 0, u = l.target, d = u.fromRect, f = O(u), p = u.prevFromRect, E = u.prevToRect, b = l.rect, S = ht(u, !0);
353
- S && (f.top -= S.f, f.left -= S.e), u.toRect = f, u.thisAnimationDuration && oe(p, f) && !oe(d, f) && // Make sure animatingRect is on line between toRect & fromRect
354
- (b.top - f.top) / (b.left - f.left) === (d.top - f.top) / (d.left - f.left) && (s = fn(b, p, E, i.options)), oe(f, d) || (u.prevFromRect = d, u.prevToRect = f, s || (s = i.options.animation), i.animate(u, b, f, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
355
- u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
356
- }, s), u.thisAnimationDuration = s);
357
- }), clearTimeout(t), r ? t = setTimeout(function() {
358
- typeof n == "function" && n();
359
- }, a) : typeof n == "function" && n(), o = [];
360
- },
361
- animate: function(n, i, r, a) {
362
- if (a) {
363
- h(n, "transition", ""), h(n, "transform", "");
364
- var l = ht(this.el), s = l && l.a, u = l && l.d, d = (i.left - r.left) / (s || 1), f = (i.top - r.top) / (u || 1);
365
- n.animatingX = !!d, n.animatingY = !!f, h(n, "transform", "translate3d(" + d + "px," + f + "px,0)"), this.forRepaintDummy = cn(n), h(n, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), h(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
366
- h(n, "transition", ""), h(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
367
- }, a);
368
- }
369
- }
370
- };
371
- }
372
- function cn(o) {
373
- return o.offsetWidth;
374
- }
375
- function fn(o, t, e, n) {
376
- return Math.sqrt(Math.pow(t.top - o.top, 2) + Math.pow(t.left - o.left, 2)) / Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) * n.animation;
377
- }
378
- var pt = [], re = {
379
- initializeByDefault: !0
380
- }, Yt = {
381
- mount: function(t) {
382
- for (var e in re)
383
- re.hasOwnProperty(e) && !(e in t) && (t[e] = re[e]);
384
- pt.forEach(function(n) {
385
- if (n.pluginName === t.pluginName)
386
- throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
387
- }), pt.push(t);
388
- },
389
- pluginEvent: function(t, e, n) {
390
- var i = this;
391
- this.eventCanceled = !1, n.cancel = function() {
392
- i.eventCanceled = !0;
393
- };
394
- var r = t + "Global";
395
- pt.forEach(function(a) {
396
- e[a.pluginName] && (e[a.pluginName][r] && e[a.pluginName][r](J({
397
- sortable: e
398
- }, n)), e.options[a.pluginName] && e[a.pluginName][t] && e[a.pluginName][t](J({
399
- sortable: e
400
- }, n)));
401
- });
402
- },
403
- initializePlugins: function(t, e, n, i) {
404
- pt.forEach(function(l) {
405
- var s = l.pluginName;
406
- if (!(!t.options[s] && !l.initializeByDefault)) {
407
- var u = new l(t, e, t.options);
408
- u.sortable = t, u.options = t.options, t[s] = u, z(n, u.defaults);
409
- }
410
- });
411
- for (var r in t.options)
412
- if (t.options.hasOwnProperty(r)) {
413
- var a = this.modifyOption(t, r, t.options[r]);
414
- typeof a < "u" && (t.options[r] = a);
415
- }
416
- },
417
- getEventProperties: function(t, e) {
418
- var n = {};
419
- return pt.forEach(function(i) {
420
- typeof i.eventProperties == "function" && z(n, i.eventProperties.call(e[i.pluginName], t));
421
- }), n;
422
- },
423
- modifyOption: function(t, e, n) {
424
- var i;
425
- return pt.forEach(function(r) {
426
- t[r.pluginName] && r.optionListeners && typeof r.optionListeners[e] == "function" && (i = r.optionListeners[e].call(t[r.pluginName], n));
427
- }), i;
428
- }
429
- };
430
- function At(o) {
431
- var t = o.sortable, e = o.rootEl, n = o.name, i = o.targetEl, r = o.cloneEl, a = o.toEl, l = o.fromEl, s = o.oldIndex, u = o.newIndex, d = o.oldDraggableIndex, f = o.newDraggableIndex, p = o.originalEvent, E = o.putSortable, b = o.extraEventProperties;
432
- if (t = t || e && e[k], !!t) {
433
- var S, P = t.options, K = "on" + n.charAt(0).toUpperCase() + n.substr(1);
434
- window.CustomEvent && !nt && !Xt ? S = new CustomEvent(n, {
435
- bubbles: !0,
436
- cancelable: !0
437
- }) : (S = document.createEvent("Event"), S.initEvent(n, !0, !0)), S.to = a || e, S.from = l || e, S.item = i || e, S.clone = r, S.oldIndex = s, S.newIndex = u, S.oldDraggableIndex = d, S.newDraggableIndex = f, S.originalEvent = p, S.pullMode = E ? E.lastPutMode : void 0;
438
- var x = J(J({}, b), Yt.getEventProperties(n, t));
439
- for (var Y in x)
440
- S[Y] = x[Y];
441
- e && e.dispatchEvent(S), P[K] && P[K].call(t, S);
442
- }
443
- }
444
- var dn = ["evt"], B = function(t, e) {
445
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = Ve(n, dn);
446
- Yt.pluginEvent.bind(g)(t, e, J({
447
- dragEl: c,
448
- parentEl: A,
449
- ghostEl: v,
450
- rootEl: C,
451
- nextEl: dt,
452
- lastDownEl: Ut,
453
- cloneEl: I,
454
- cloneHidden: at,
455
- dragStarted: It,
456
- putSortable: F,
457
- activeSortable: g.active,
458
- originalEvent: i,
459
- oldIndex: bt,
460
- oldDraggableIndex: Ft,
461
- newIndex: W,
462
- newDraggableIndex: rt,
463
- hideGhostForTarget: Le,
464
- unhideGhostForTarget: We,
465
- cloneNowHidden: function() {
466
- at = !0;
467
- },
468
- cloneNowShown: function() {
469
- at = !1;
470
- },
471
- dispatchSortableEvent: function(l) {
472
- X({
473
- sortable: e,
474
- name: l,
475
- originalEvent: i
476
- });
477
- }
478
- }, r));
479
- };
480
- function X(o) {
481
- At(J({
482
- putSortable: F,
483
- cloneEl: I,
484
- targetEl: c,
485
- rootEl: C,
486
- oldIndex: bt,
487
- oldDraggableIndex: Ft,
488
- newIndex: W,
489
- newDraggableIndex: rt
490
- }, o));
491
- }
492
- var c, A, v, C, dt, Ut, I, at, bt, W, Ft, rt, Ht, F, vt = !1, Qt = !1, Jt = [], ct, U, ae, le, Ie, Ne, It, gt, Rt, kt = !1, Gt = !1, qt, R, se = [], pe = !1, te = [], ne = typeof document < "u", Lt = Fe, Pe = Xt || nt ? "cssFloat" : "float", hn = ne && !on && !Fe && "draggable" in document.createElement("div"), Be = (function() {
493
- if (ne) {
494
- if (nt)
495
- return !1;
496
- var o = document.createElement("x");
497
- return o.style.cssText = "pointer-events:auto", o.style.pointerEvents === "auto";
498
- }
499
- })(), He = function(t, e) {
500
- var n = h(t), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = wt(t, 0, e), a = wt(t, 1, e), l = r && h(r), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + O(r).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + O(a).width;
501
- if (n.display === "flex")
502
- return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
503
- if (n.display === "grid")
504
- return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
505
- if (r && l.float && l.float !== "none") {
506
- var f = l.float === "left" ? "left" : "right";
507
- return a && (s.clear === "both" || s.clear === f) ? "vertical" : "horizontal";
508
- }
509
- return r && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= i && n[Pe] === "none" || a && n[Pe] === "none" && u + d > i) ? "vertical" : "horizontal";
510
- }, pn = function(t, e, n) {
511
- var i = n ? t.left : t.top, r = n ? t.right : t.bottom, a = n ? t.width : t.height, l = n ? e.left : e.top, s = n ? e.right : e.bottom, u = n ? e.width : e.height;
512
- return i === l || r === s || i + a / 2 === l + u / 2;
513
- }, gn = function(t, e) {
514
- var n;
515
- return Jt.some(function(i) {
516
- var r = i[k].options.emptyInsertThreshold;
517
- if (!(!r || be(i))) {
518
- var a = O(i), l = t >= a.left - r && t <= a.right + r, s = e >= a.top - r && e <= a.bottom + r;
519
- if (l && s)
520
- return n = i;
521
- }
522
- }), n;
523
- }, Ge = function(t) {
524
- function e(r, a) {
525
- return function(l, s, u, d) {
526
- var f = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
527
- if (r == null && (a || f))
528
- return !0;
529
- if (r == null || r === !1)
530
- return !1;
531
- if (a && r === "clone")
532
- return r;
533
- if (typeof r == "function")
534
- return e(r(l, s, u, d), a)(l, s, u, d);
535
- var p = (a ? l : s).options.group.name;
536
- return r === !0 || typeof r == "string" && r === p || r.join && r.indexOf(p) > -1;
537
- };
538
- }
539
- var n = {}, i = t.group;
540
- (!i || zt(i) != "object") && (i = {
541
- name: i
542
- }), n.name = i.name, n.checkPull = e(i.pull, !0), n.checkPut = e(i.put), n.revertClone = i.revertClone, t.group = n;
543
- }, Le = function() {
544
- !Be && v && h(v, "display", "none");
545
- }, We = function() {
546
- !Be && v && h(v, "display", "");
547
- };
548
- ne && document.addEventListener("click", function(o) {
549
- if (Qt)
550
- return o.preventDefault(), o.stopPropagation && o.stopPropagation(), o.stopImmediatePropagation && o.stopImmediatePropagation(), Qt = !1, !1;
551
- }, !0);
552
- var ft = function(t) {
553
- if (c) {
554
- t = t.touches ? t.touches[0] : t;
555
- var e = gn(t.clientX, t.clientY);
556
- if (e) {
557
- var n = {};
558
- for (var i in t)
559
- t.hasOwnProperty(i) && (n[i] = t[i]);
560
- n.target = n.rootEl = e, n.preventDefault = void 0, n.stopPropagation = void 0, e[k]._onDragOver(n);
561
- }
562
- }
563
- }, mn = function(t) {
564
- c && c.parentNode[k]._isOutsideThisEl(t.target);
565
- };
566
- function g(o, t) {
567
- if (!(o && o.nodeType && o.nodeType === 1))
568
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));
569
- this.el = o, this.options = t = z({}, t), o[k] = this;
570
- var e = {
571
- group: null,
572
- sort: !0,
573
- disabled: !1,
574
- store: null,
575
- handle: null,
576
- draggable: /^[uo]l$/i.test(o.nodeName) ? ">li" : ">*",
577
- swapThreshold: 1,
578
- // percentage; 0 <= x <= 1
579
- invertSwap: !1,
580
- // invert always
581
- invertedSwapThreshold: null,
582
- // will be set to same as swapThreshold if default
583
- removeCloneOnHide: !0,
584
- direction: function() {
585
- return He(o, this.options);
586
- },
587
- ghostClass: "sortable-ghost",
588
- chosenClass: "sortable-chosen",
589
- dragClass: "sortable-drag",
590
- ignore: "a, img",
591
- filter: null,
592
- preventOnFilter: !0,
593
- animation: 0,
594
- easing: null,
595
- setData: function(a, l) {
596
- a.setData("Text", l.textContent);
597
- },
598
- dropBubble: !1,
599
- dragoverBubble: !1,
600
- dataIdAttr: "data-id",
601
- delay: 0,
602
- delayOnTouchOnly: !1,
603
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
604
- forceFallback: !1,
605
- fallbackClass: "sortable-fallback",
606
- fallbackOnBody: !1,
607
- fallbackTolerance: 0,
608
- fallbackOffset: {
609
- x: 0,
610
- y: 0
611
- },
612
- supportPointer: g.supportPointer !== !1 && "PointerEvent" in window && !Mt,
613
- emptyInsertThreshold: 5
614
- };
615
- Yt.initializePlugins(this, o, e);
616
- for (var n in e)
617
- !(n in t) && (t[n] = e[n]);
618
- Ge(t);
619
- for (var i in this)
620
- i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
621
- this.nativeDraggable = t.forceFallback ? !1 : hn, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? y(o, "pointerdown", this._onTapStart) : (y(o, "mousedown", this._onTapStart), y(o, "touchstart", this._onTapStart)), this.nativeDraggable && (y(o, "dragover", this), y(o, "dragenter", this)), Jt.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), z(this, un());
622
- }
623
- g.prototype = /** @lends Sortable.prototype */
624
- {
625
- constructor: g,
626
- _isOutsideThisEl: function(t) {
627
- !this.el.contains(t) && t !== this.el && (gt = null);
628
- },
629
- _getDirection: function(t, e) {
630
- return typeof this.options.direction == "function" ? this.options.direction.call(this, t, e, c) : this.options.direction;
631
- },
632
- _onTapStart: function(t) {
633
- if (t.cancelable) {
634
- var e = this, n = this.el, i = this.options, r = i.preventOnFilter, a = t.type, l = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, s = (l || t).target, u = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || s, d = i.filter;
635
- if (_n(n), !c && !(/mousedown|pointerdown/.test(a) && t.button !== 0 || i.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Mt && s && s.tagName.toUpperCase() === "SELECT") && (s = $(s, i.draggable, n, !1), !(s && s.animated) && Ut !== s)) {
636
- if (bt = N(s), Ft = N(s, i.draggable), typeof d == "function") {
637
- if (d.call(this, t, s, this)) {
638
- X({
639
- sortable: e,
640
- rootEl: u,
641
- name: "filter",
642
- targetEl: s,
643
- toEl: n,
644
- fromEl: n
645
- }), B("filter", e, {
646
- evt: t
647
- }), r && t.cancelable && t.preventDefault();
648
- return;
649
- }
650
- } else if (d && (d = d.split(",").some(function(f) {
651
- if (f = $(u, f.trim(), n, !1), f)
652
- return X({
653
- sortable: e,
654
- rootEl: f,
655
- name: "filter",
656
- targetEl: s,
657
- fromEl: n,
658
- toEl: n
659
- }), B("filter", e, {
660
- evt: t
661
- }), !0;
662
- }), d)) {
663
- r && t.cancelable && t.preventDefault();
664
- return;
665
- }
666
- i.handle && !$(u, i.handle, n, !1) || this._prepareDragStart(t, l, s);
667
- }
668
- }
669
- },
670
- _prepareDragStart: function(t, e, n) {
671
- var i = this, r = i.el, a = i.options, l = r.ownerDocument, s;
672
- if (n && !c && n.parentNode === r) {
673
- var u = O(n);
674
- if (C = r, c = n, A = c.parentNode, dt = c.nextSibling, Ut = n, Ht = a.group, g.dragged = c, ct = {
675
- target: c,
676
- clientX: (e || t).clientX,
677
- clientY: (e || t).clientY
678
- }, Ie = ct.clientX - u.left, Ne = ct.clientY - u.top, this._lastX = (e || t).clientX, this._lastY = (e || t).clientY, c.style["will-change"] = "all", s = function() {
679
- if (B("delayEnded", i, {
680
- evt: t
681
- }), g.eventCanceled) {
682
- i._onDrop();
683
- return;
684
- }
685
- i._disableDelayedDragEvents(), !_e && i.nativeDraggable && (c.draggable = !0), i._triggerDragStart(t, e), X({
686
- sortable: i,
687
- name: "choose",
688
- originalEvent: t
689
- }), T(c, a.chosenClass, !0);
690
- }, a.ignore.split(",").forEach(function(d) {
691
- ke(c, d.trim(), ue);
692
- }), y(l, "dragover", ft), y(l, "mousemove", ft), y(l, "touchmove", ft), y(l, "mouseup", i._onDrop), y(l, "touchend", i._onDrop), y(l, "touchcancel", i._onDrop), _e && this.nativeDraggable && (this.options.touchStartThreshold = 4, c.draggable = !0), B("delayStart", this, {
693
- evt: t
694
- }), a.delay && (!a.delayOnTouchOnly || e) && (!this.nativeDraggable || !(Xt || nt))) {
695
- if (g.eventCanceled) {
696
- this._onDrop();
697
- return;
698
- }
699
- y(l, "mouseup", i._disableDelayedDrag), y(l, "touchend", i._disableDelayedDrag), y(l, "touchcancel", i._disableDelayedDrag), y(l, "mousemove", i._delayedDragTouchMoveHandler), y(l, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && y(l, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(s, a.delay);
700
- } else
701
- s();
702
- }
703
- },
704
- _delayedDragTouchMoveHandler: function(t) {
705
- var e = t.touches ? t.touches[0] : t;
706
- Math.max(Math.abs(e.clientX - this._lastX), Math.abs(e.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
707
- },
708
- _disableDelayedDrag: function() {
709
- c && ue(c), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
710
- },
711
- _disableDelayedDragEvents: function() {
712
- var t = this.el.ownerDocument;
713
- w(t, "mouseup", this._disableDelayedDrag), w(t, "touchend", this._disableDelayedDrag), w(t, "touchcancel", this._disableDelayedDrag), w(t, "mousemove", this._delayedDragTouchMoveHandler), w(t, "touchmove", this._delayedDragTouchMoveHandler), w(t, "pointermove", this._delayedDragTouchMoveHandler);
714
- },
715
- _triggerDragStart: function(t, e) {
716
- e = e || t.pointerType == "touch" && t, !this.nativeDraggable || e ? this.options.supportPointer ? y(document, "pointermove", this._onTouchMove) : e ? y(document, "touchmove", this._onTouchMove) : y(document, "mousemove", this._onTouchMove) : (y(c, "dragend", this), y(C, "dragstart", this._onDragStart));
717
- try {
718
- document.selection ? $t(function() {
719
- document.selection.empty();
720
- }) : window.getSelection().removeAllRanges();
721
- } catch {
722
- }
723
- },
724
- _dragStarted: function(t, e) {
725
- if (vt = !1, C && c) {
726
- B("dragStarted", this, {
727
- evt: e
728
- }), this.nativeDraggable && y(document, "dragover", mn);
729
- var n = this.options;
730
- !t && T(c, n.dragClass, !1), T(c, n.ghostClass, !0), g.active = this, t && this._appendGhost(), X({
731
- sortable: this,
732
- name: "start",
733
- originalEvent: e
734
- });
735
- } else
736
- this._nulling();
737
- },
738
- _emulateDragOver: function() {
739
- if (U) {
740
- this._lastX = U.clientX, this._lastY = U.clientY, Le();
741
- for (var t = document.elementFromPoint(U.clientX, U.clientY), e = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(U.clientX, U.clientY), t !== e); )
742
- e = t;
743
- if (c.parentNode[k]._isOutsideThisEl(t), e)
744
- do {
745
- if (e[k]) {
746
- var n = void 0;
747
- if (n = e[k]._onDragOver({
748
- clientX: U.clientX,
749
- clientY: U.clientY,
750
- target: t,
751
- rootEl: e
752
- }), n && !this.options.dragoverBubble)
753
- break;
754
- }
755
- t = e;
756
- } while (e = e.parentNode);
757
- We();
758
- }
759
- },
760
- _onTouchMove: function(t) {
761
- if (ct) {
762
- var e = this.options, n = e.fallbackTolerance, i = e.fallbackOffset, r = t.touches ? t.touches[0] : t, a = v && ht(v, !0), l = v && a && a.a, s = v && a && a.d, u = Lt && R && Te(R), d = (r.clientX - ct.clientX + i.x) / (l || 1) + (u ? u[0] - se[0] : 0) / (l || 1), f = (r.clientY - ct.clientY + i.y) / (s || 1) + (u ? u[1] - se[1] : 0) / (s || 1);
763
- if (!g.active && !vt) {
764
- if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
765
- return;
766
- this._onDragStart(t, !0);
767
- }
768
- if (v) {
769
- a ? (a.e += d - (ae || 0), a.f += f - (le || 0)) : a = {
770
- a: 1,
771
- b: 0,
772
- c: 0,
773
- d: 1,
774
- e: d,
775
- f
776
- };
777
- var p = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
778
- h(v, "webkitTransform", p), h(v, "mozTransform", p), h(v, "msTransform", p), h(v, "transform", p), ae = d, le = f, U = r;
779
- }
780
- t.cancelable && t.preventDefault();
781
- }
782
- },
783
- _appendGhost: function() {
784
- if (!v) {
785
- var t = this.options.fallbackOnBody ? document.body : C, e = O(c, !0, Lt, !0, t), n = this.options;
786
- if (Lt) {
787
- for (R = t; h(R, "position") === "static" && h(R, "transform") === "none" && R !== document; )
788
- R = R.parentNode;
789
- R !== document.body && R !== document.documentElement ? (R === document && (R = Q()), e.top += R.scrollTop, e.left += R.scrollLeft) : R = Q(), se = Te(R);
790
- }
791
- v = c.cloneNode(!0), T(v, n.ghostClass, !1), T(v, n.fallbackClass, !0), T(v, n.dragClass, !0), h(v, "transition", ""), h(v, "transform", ""), h(v, "box-sizing", "border-box"), h(v, "margin", 0), h(v, "top", e.top), h(v, "left", e.left), h(v, "width", e.width), h(v, "height", e.height), h(v, "opacity", "0.8"), h(v, "position", Lt ? "absolute" : "fixed"), h(v, "zIndex", "100000"), h(v, "pointerEvents", "none"), g.ghost = v, t.appendChild(v), h(v, "transform-origin", Ie / parseInt(v.style.width) * 100 + "% " + Ne / parseInt(v.style.height) * 100 + "%");
792
- }
793
- },
794
- _onDragStart: function(t, e) {
795
- var n = this, i = t.dataTransfer, r = n.options;
796
- if (B("dragStart", this, {
797
- evt: t
798
- }), g.eventCanceled) {
799
- this._onDrop();
800
- return;
801
- }
802
- B("setupClone", this), g.eventCanceled || (I = we(c), I.draggable = !1, I.style["will-change"] = "", this._hideClone(), T(I, this.options.chosenClass, !1), g.clone = I), n.cloneId = $t(function() {
803
- B("clone", n), !g.eventCanceled && (n.options.removeCloneOnHide || C.insertBefore(I, c), n._hideClone(), X({
804
- sortable: n,
805
- name: "clone"
806
- }));
807
- }), !e && T(c, r.dragClass, !0), e ? (Qt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (w(document, "mouseup", n._onDrop), w(document, "touchend", n._onDrop), w(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, c)), y(document, "drop", n), h(c, "transform", "translateZ(0)")), vt = !0, n._dragStartId = $t(n._dragStarted.bind(n, e, t)), y(document, "selectstart", n), It = !0, Mt && h(document.body, "user-select", "none");
808
- },
809
- // Returns true - if no further action is needed (either inserted or another condition)
810
- _onDragOver: function(t) {
811
- var e = this.el, n = t.target, i, r, a, l = this.options, s = l.group, u = g.active, d = Ht === s, f = l.sort, p = F || u, E, b = this, S = !1;
812
- if (pe) return;
813
- function P(_t, je) {
814
- B(_t, b, J({
815
- evt: t,
816
- isOwner: d,
817
- axis: E ? "vertical" : "horizontal",
818
- revert: a,
819
- dragRect: i,
820
- targetRect: r,
821
- canSort: f,
822
- fromSortable: p,
823
- target: n,
824
- completed: x,
825
- onMove: function(Se, ze) {
826
- return Wt(C, e, c, i, Se, O(Se), t, ze);
827
- },
828
- changed: Y
829
- }, je));
830
- }
831
- function K() {
832
- P("dragOverAnimationCapture"), b.captureAnimationState(), b !== p && p.captureAnimationState();
833
- }
834
- function x(_t) {
835
- return P("dragOverCompleted", {
836
- insertion: _t
837
- }), _t && (d ? u._hideClone() : u._showClone(b), b !== p && (T(c, F ? F.options.ghostClass : u.options.ghostClass, !1), T(c, l.ghostClass, !0)), F !== b && b !== g.active ? F = b : b === g.active && F && (F = null), p === b && (b._ignoreWhileAnimating = n), b.animateAll(function() {
838
- P("dragOverAnimationComplete"), b._ignoreWhileAnimating = null;
839
- }), b !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (n === c && !c.animated || n === e && !n.animated) && (gt = null), !l.dragoverBubble && !t.rootEl && n !== document && (c.parentNode[k]._isOutsideThisEl(t.target), !_t && ft(t)), !l.dragoverBubble && t.stopPropagation && t.stopPropagation(), S = !0;
840
- }
841
- function Y() {
842
- W = N(c), rt = N(c, l.draggable), X({
843
- sortable: b,
844
- name: "change",
845
- toEl: e,
846
- newIndex: W,
847
- newDraggableIndex: rt,
848
- originalEvent: t
849
- });
850
- }
851
- if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), n = $(n, l.draggable, e, !0), P("dragOver"), g.eventCanceled) return S;
852
- if (c.contains(t.target) || n.animated && n.animatingX && n.animatingY || b._ignoreWhileAnimating === n)
853
- return x(!1);
854
- if (Qt = !1, u && !l.disabled && (d ? f || (a = A !== C) : F === this || (this.lastPutMode = Ht.checkPull(this, u, c, t)) && s.checkPut(this, u, c, t))) {
855
- if (E = this._getDirection(t, n) === "vertical", i = O(c), P("dragOverValid"), g.eventCanceled) return S;
856
- if (a)
857
- return A = C, K(), this._hideClone(), P("revert"), g.eventCanceled || (dt ? C.insertBefore(c, dt) : C.appendChild(c)), x(!0);
858
- var D = be(e, l.draggable);
859
- if (!D || yn(t, E, this) && !D.animated) {
860
- if (D === c)
861
- return x(!1);
862
- if (D && e === t.target && (n = D), n && (r = O(n)), Wt(C, e, c, i, n, r, t, !!n) !== !1)
863
- return K(), e.appendChild(c), A = e, Y(), x(!0);
864
- } else if (D && wn(t, E, this)) {
865
- var V = wt(e, 0, l, !0);
866
- if (V === c)
867
- return x(!1);
868
- if (n = V, r = O(n), Wt(C, e, c, i, n, r, t, !1) !== !1)
869
- return K(), e.insertBefore(c, V), A = e, Y(), x(!0);
870
- } else if (n.parentNode === e) {
871
- r = O(n);
872
- var Z = 0, st, yt = c.parentNode !== e, G = !pn(c.animated && c.toRect || i, n.animated && n.toRect || r, E), Et = E ? "top" : "left", ot = Oe(n, "top", "top") || Oe(c, "top", "top"), St = ot ? ot.scrollTop : void 0;
873
- gt !== n && (st = r[Et], kt = !1, Gt = !G && l.invertSwap || yt), Z = En(t, n, r, E, G ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Gt, gt === n);
874
- var tt;
875
- if (Z !== 0) {
876
- var ut = N(c);
877
- do
878
- ut -= Z, tt = A.children[ut];
879
- while (tt && (h(tt, "display") === "none" || tt === v));
880
- }
881
- if (Z === 0 || tt === n)
882
- return x(!1);
883
- gt = n, Rt = Z;
884
- var Dt = n.nextElementSibling, it = !1;
885
- it = Z === 1;
886
- var Bt = Wt(C, e, c, i, n, r, t, it);
887
- if (Bt !== !1)
888
- return (Bt === 1 || Bt === -1) && (it = Bt === 1), pe = !0, setTimeout(bn, 30), K(), it && !Dt ? e.appendChild(c) : n.parentNode.insertBefore(c, it ? Dt : n), ot && Ye(ot, 0, St - ot.scrollTop), A = c.parentNode, st !== void 0 && !Gt && (qt = Math.abs(st - O(n)[Et])), Y(), x(!0);
889
- }
890
- if (e.contains(c))
891
- return x(!1);
892
- }
893
- return !1;
894
- },
895
- _ignoreWhileAnimating: null,
896
- _offMoveEvents: function() {
897
- w(document, "mousemove", this._onTouchMove), w(document, "touchmove", this._onTouchMove), w(document, "pointermove", this._onTouchMove), w(document, "dragover", ft), w(document, "mousemove", ft), w(document, "touchmove", ft);
898
- },
899
- _offUpEvents: function() {
900
- var t = this.el.ownerDocument;
901
- w(t, "mouseup", this._onDrop), w(t, "touchend", this._onDrop), w(t, "pointerup", this._onDrop), w(t, "touchcancel", this._onDrop), w(document, "selectstart", this);
902
- },
903
- _onDrop: function(t) {
904
- var e = this.el, n = this.options;
905
- if (W = N(c), rt = N(c, n.draggable), B("drop", this, {
906
- evt: t
907
- }), A = c && c.parentNode, W = N(c), rt = N(c, n.draggable), g.eventCanceled) {
908
- this._nulling();
909
- return;
910
- }
911
- vt = !1, Gt = !1, kt = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), ge(this.cloneId), ge(this._dragStartId), this.nativeDraggable && (w(document, "drop", this), w(e, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Mt && h(document.body, "user-select", ""), h(c, "transform", ""), t && (It && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), v && v.parentNode && v.parentNode.removeChild(v), (C === A || F && F.lastPutMode !== "clone") && I && I.parentNode && I.parentNode.removeChild(I), c && (this.nativeDraggable && w(c, "dragend", this), ue(c), c.style["will-change"] = "", It && !vt && T(c, F ? F.options.ghostClass : this.options.ghostClass, !1), T(c, this.options.chosenClass, !1), X({
912
- sortable: this,
913
- name: "unchoose",
914
- toEl: A,
915
- newIndex: null,
916
- newDraggableIndex: null,
917
- originalEvent: t
918
- }), C !== A ? (W >= 0 && (X({
919
- rootEl: A,
920
- name: "add",
921
- toEl: A,
922
- fromEl: C,
923
- originalEvent: t
924
- }), X({
925
- sortable: this,
926
- name: "remove",
927
- toEl: A,
928
- originalEvent: t
929
- }), X({
930
- rootEl: A,
931
- name: "sort",
932
- toEl: A,
933
- fromEl: C,
934
- originalEvent: t
935
- }), X({
936
- sortable: this,
937
- name: "sort",
938
- toEl: A,
939
- originalEvent: t
940
- })), F && F.save()) : W !== bt && W >= 0 && (X({
941
- sortable: this,
942
- name: "update",
943
- toEl: A,
944
- originalEvent: t
945
- }), X({
946
- sortable: this,
947
- name: "sort",
948
- toEl: A,
949
- originalEvent: t
950
- })), g.active && ((W == null || W === -1) && (W = bt, rt = Ft), X({
951
- sortable: this,
952
- name: "end",
953
- toEl: A,
954
- originalEvent: t
955
- }), this.save()))), this._nulling();
956
- },
957
- _nulling: function() {
958
- B("nulling", this), C = c = A = v = dt = I = Ut = at = ct = U = It = W = rt = bt = Ft = gt = Rt = F = Ht = g.dragged = g.ghost = g.clone = g.active = null, te.forEach(function(t) {
959
- t.checked = !0;
960
- }), te.length = ae = le = 0;
961
- },
962
- handleEvent: function(t) {
963
- switch (t.type) {
964
- case "drop":
965
- case "dragend":
966
- this._onDrop(t);
967
- break;
968
- case "dragenter":
969
- case "dragover":
970
- c && (this._onDragOver(t), vn(t));
971
- break;
972
- case "selectstart":
973
- t.preventDefault();
974
- break;
975
- }
976
- },
977
- /**
978
- * Serializes the item into an array of string.
979
- * @returns {String[]}
980
- */
981
- toArray: function() {
982
- for (var t = [], e, n = this.el.children, i = 0, r = n.length, a = this.options; i < r; i++)
983
- e = n[i], $(e, a.draggable, this.el, !1) && t.push(e.getAttribute(a.dataIdAttr) || Dn(e));
984
- return t;
985
- },
986
- /**
987
- * Sorts the elements according to the array.
988
- * @param {String[]} order order of the items
989
- */
990
- sort: function(t, e) {
991
- var n = {}, i = this.el;
992
- this.toArray().forEach(function(r, a) {
993
- var l = i.children[a];
994
- $(l, this.options.draggable, i, !1) && (n[r] = l);
995
- }, this), e && this.captureAnimationState(), t.forEach(function(r) {
996
- n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
997
- }), e && this.animateAll();
998
- },
999
- /**
1000
- * Save the current sorting
1001
- */
1002
- save: function() {
1003
- var t = this.options.store;
1004
- t && t.set && t.set(this);
1005
- },
1006
- /**
1007
- * 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.
1008
- * @param {HTMLElement} el
1009
- * @param {String} [selector] default: `options.draggable`
1010
- * @returns {HTMLElement|null}
1011
- */
1012
- closest: function(t, e) {
1013
- return $(t, e || this.options.draggable, this.el, !1);
1014
- },
1015
- /**
1016
- * Set/get option
1017
- * @param {string} name
1018
- * @param {*} [value]
1019
- * @returns {*}
1020
- */
1021
- option: function(t, e) {
1022
- var n = this.options;
1023
- if (e === void 0)
1024
- return n[t];
1025
- var i = Yt.modifyOption(this, t, e);
1026
- typeof i < "u" ? n[t] = i : n[t] = e, t === "group" && Ge(n);
1027
- },
1028
- /**
1029
- * Destroy
1030
- */
1031
- destroy: function() {
1032
- B("destroy", this);
1033
- var t = this.el;
1034
- t[k] = null, w(t, "mousedown", this._onTapStart), w(t, "touchstart", this._onTapStart), w(t, "pointerdown", this._onTapStart), this.nativeDraggable && (w(t, "dragover", this), w(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(e) {
1035
- e.removeAttribute("draggable");
1036
- }), this._onDrop(), this._disableDelayedDragEvents(), Jt.splice(Jt.indexOf(this.el), 1), this.el = t = null;
1037
- },
1038
- _hideClone: function() {
1039
- if (!at) {
1040
- if (B("hideClone", this), g.eventCanceled) return;
1041
- h(I, "display", "none"), this.options.removeCloneOnHide && I.parentNode && I.parentNode.removeChild(I), at = !0;
1042
- }
1043
- },
1044
- _showClone: function(t) {
1045
- if (t.lastPutMode !== "clone") {
1046
- this._hideClone();
1047
- return;
1048
- }
1049
- if (at) {
1050
- if (B("showClone", this), g.eventCanceled) return;
1051
- c.parentNode == C && !this.options.group.revertClone ? C.insertBefore(I, c) : dt ? C.insertBefore(I, dt) : C.appendChild(I), this.options.group.revertClone && this.animate(c, I), h(I, "display", ""), at = !1;
1052
- }
1053
- }
1054
- };
1055
- function vn(o) {
1056
- o.dataTransfer && (o.dataTransfer.dropEffect = "move"), o.cancelable && o.preventDefault();
1057
- }
1058
- function Wt(o, t, e, n, i, r, a, l) {
1059
- var s, u = o[k], d = u.options.onMove, f;
1060
- return window.CustomEvent && !nt && !Xt ? s = new CustomEvent("move", {
1061
- bubbles: !0,
1062
- cancelable: !0
1063
- }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = t, s.from = o, s.dragged = e, s.draggedRect = n, s.related = i || t, s.relatedRect = r || O(t), s.willInsertAfter = l, s.originalEvent = a, o.dispatchEvent(s), d && (f = d.call(u, s, a)), f;
1064
- }
1065
- function ue(o) {
1066
- o.draggable = !1;
1067
- }
1068
- function bn() {
1069
- pe = !1;
1070
- }
1071
- function wn(o, t, e) {
1072
- var n = O(wt(e.el, 0, e.options, !0)), i = 10;
1073
- return t ? o.clientX < n.left - i || o.clientY < n.top && o.clientX < n.right : o.clientY < n.top - i || o.clientY < n.bottom && o.clientX < n.left;
1074
- }
1075
- function yn(o, t, e) {
1076
- var n = O(be(e.el, e.options.draggable)), i = 10;
1077
- return t ? o.clientX > n.right + i || o.clientX <= n.right && o.clientY > n.bottom && o.clientX >= n.left : o.clientX > n.right && o.clientY > n.top || o.clientX <= n.right && o.clientY > n.bottom + i;
1078
- }
1079
- function En(o, t, e, n, i, r, a, l) {
1080
- var s = n ? o.clientY : o.clientX, u = n ? e.height : e.width, d = n ? e.top : e.left, f = n ? e.bottom : e.right, p = !1;
1081
- if (!a) {
1082
- if (l && qt < u * i) {
1083
- if (!kt && (Rt === 1 ? s > d + u * r / 2 : s < f - u * r / 2) && (kt = !0), kt)
1084
- p = !0;
1085
- else if (Rt === 1 ? s < d + qt : s > f - qt)
1086
- return -Rt;
1087
- } else if (s > d + u * (1 - i) / 2 && s < f - u * (1 - i) / 2)
1088
- return Sn(t);
1089
- }
1090
- return p = p || a, p && (s < d + u * r / 2 || s > f - u * r / 2) ? s > d + u / 2 ? 1 : -1 : 0;
1091
- }
1092
- function Sn(o) {
1093
- return N(c) < N(o) ? 1 : -1;
1094
- }
1095
- function Dn(o) {
1096
- for (var t = o.tagName + o.className + o.src + o.href + o.textContent, e = t.length, n = 0; e--; )
1097
- n += t.charCodeAt(e);
1098
- return n.toString(36);
1099
- }
1100
- function _n(o) {
1101
- te.length = 0;
1102
- for (var t = o.getElementsByTagName("input"), e = t.length; e--; ) {
1103
- var n = t[e];
1104
- n.checked && te.push(n);
1105
- }
1106
- }
1107
- function $t(o) {
1108
- return setTimeout(o, 0);
1109
- }
1110
- function ge(o) {
1111
- return clearTimeout(o);
1112
- }
1113
- ne && y(document, "touchmove", function(o) {
1114
- (g.active || vt) && o.cancelable && o.preventDefault();
1115
- });
1116
- g.utils = {
1117
- on: y,
1118
- off: w,
1119
- css: h,
1120
- find: ke,
1121
- is: function(t, e) {
1122
- return !!$(t, e, t, !1);
1123
- },
1124
- extend: ln,
1125
- throttle: Xe,
1126
- closest: $,
1127
- toggleClass: T,
1128
- clone: we,
1129
- index: N,
1130
- nextTick: $t,
1131
- cancelNextTick: ge,
1132
- detectDirection: He,
1133
- getChild: wt
1134
- };
1135
- g.get = function(o) {
1136
- return o[k];
1137
- };
1138
- g.mount = function() {
1139
- for (var o = arguments.length, t = new Array(o), e = 0; e < o; e++)
1140
- t[e] = arguments[e];
1141
- t[0].constructor === Array && (t = t[0]), t.forEach(function(n) {
1142
- if (!n.prototype || !n.prototype.constructor)
1143
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
1144
- n.utils && (g.utils = J(J({}, g.utils), n.utils)), Yt.mount(n);
1145
- });
1146
- };
1147
- g.create = function(o, t) {
1148
- return new g(o, t);
1149
- };
1150
- g.version = nn;
1151
- var M = [], Nt, me, ve = !1, ce, fe, ee, Pt;
1152
- function Cn() {
1153
- function o() {
1154
- this.defaults = {
1155
- scroll: !0,
1156
- forceAutoScrollFallback: !1,
1157
- scrollSensitivity: 30,
1158
- scrollSpeed: 10,
1159
- bubbleScroll: !0
1160
- };
1161
- for (var t in this)
1162
- t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
1163
- }
1164
- return o.prototype = {
1165
- dragStarted: function(e) {
1166
- var n = e.originalEvent;
1167
- this.sortable.nativeDraggable ? y(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? y(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? y(document, "touchmove", this._handleFallbackAutoScroll) : y(document, "mousemove", this._handleFallbackAutoScroll);
1168
- },
1169
- dragOverCompleted: function(e) {
1170
- var n = e.originalEvent;
1171
- !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
1172
- },
1173
- drop: function() {
1174
- this.sortable.nativeDraggable ? w(document, "dragover", this._handleAutoScroll) : (w(document, "pointermove", this._handleFallbackAutoScroll), w(document, "touchmove", this._handleFallbackAutoScroll), w(document, "mousemove", this._handleFallbackAutoScroll)), Me(), Vt(), sn();
1175
- },
1176
- nulling: function() {
1177
- ee = me = Nt = ve = Pt = ce = fe = null, M.length = 0;
1178
- },
1179
- _handleFallbackAutoScroll: function(e) {
1180
- this._handleAutoScroll(e, !0);
1181
- },
1182
- _handleAutoScroll: function(e, n) {
1183
- var i = this, r = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, l = document.elementFromPoint(r, a);
1184
- if (ee = e, n || this.options.forceAutoScrollFallback || Xt || nt || Mt) {
1185
- de(e, this.options, l, n);
1186
- var s = lt(l, !0);
1187
- ve && (!Pt || r !== ce || a !== fe) && (Pt && Me(), Pt = setInterval(function() {
1188
- var u = lt(document.elementFromPoint(r, a), !0);
1189
- u !== s && (s = u, Vt()), de(e, i.options, u, n);
1190
- }, 10), ce = r, fe = a);
1191
- } else {
1192
- if (!this.options.bubbleScroll || lt(l, !0) === Q()) {
1193
- Vt();
1194
- return;
1195
- }
1196
- de(e, this.options, lt(l, !1), !1);
1197
- }
1198
- }
1199
- }, z(o, {
1200
- pluginName: "scroll",
1201
- initializeByDefault: !0
1202
- });
1203
- }
1204
- function Vt() {
1205
- M.forEach(function(o) {
1206
- clearInterval(o.pid);
1207
- }), M = [];
1208
- }
1209
- function Me() {
1210
- clearInterval(Pt);
1211
- }
1212
- var de = Xe(function(o, t, e, n) {
1213
- if (t.scroll) {
1214
- var i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, a = t.scrollSensitivity, l = t.scrollSpeed, s = Q(), u = !1, d;
1215
- me !== e && (me = e, Vt(), Nt = t.scroll, d = t.scrollFn, Nt === !0 && (Nt = lt(e, !0)));
1216
- var f = 0, p = Nt;
1217
- do {
1218
- var E = p, b = O(E), S = b.top, P = b.bottom, K = b.left, x = b.right, Y = b.width, D = b.height, V = void 0, Z = void 0, st = E.scrollWidth, yt = E.scrollHeight, G = h(E), Et = E.scrollLeft, ot = E.scrollTop;
1219
- E === s ? (V = Y < st && (G.overflowX === "auto" || G.overflowX === "scroll" || G.overflowX === "visible"), Z = D < yt && (G.overflowY === "auto" || G.overflowY === "scroll" || G.overflowY === "visible")) : (V = Y < st && (G.overflowX === "auto" || G.overflowX === "scroll"), Z = D < yt && (G.overflowY === "auto" || G.overflowY === "scroll"));
1220
- var St = V && (Math.abs(x - i) <= a && Et + Y < st) - (Math.abs(K - i) <= a && !!Et), tt = Z && (Math.abs(P - r) <= a && ot + D < yt) - (Math.abs(S - r) <= a && !!ot);
1221
- if (!M[f])
1222
- for (var ut = 0; ut <= f; ut++)
1223
- M[ut] || (M[ut] = {});
1224
- (M[f].vx != St || M[f].vy != tt || M[f].el !== E) && (M[f].el = E, M[f].vx = St, M[f].vy = tt, clearInterval(M[f].pid), (St != 0 || tt != 0) && (u = !0, M[f].pid = setInterval((function() {
1225
- n && this.layer === 0 && g.active._onTouchMove(ee);
1226
- var Dt = M[this.layer].vy ? M[this.layer].vy * l : 0, it = M[this.layer].vx ? M[this.layer].vx * l : 0;
1227
- typeof d == "function" && d.call(g.dragged.parentNode[k], it, Dt, o, ee, M[this.layer].el) !== "continue" || Ye(M[this.layer].el, it, Dt);
1228
- }).bind({
1229
- layer: f
1230
- }), 24))), f++;
1231
- } while (t.bubbleScroll && p !== s && (p = lt(p, !1)));
1232
- ve = u;
1233
- }
1234
- }, 30), Ke = function(t) {
1235
- var e = t.originalEvent, n = t.putSortable, i = t.dragEl, r = t.activeSortable, a = t.dispatchSortableEvent, l = t.hideGhostForTarget, s = t.unhideGhostForTarget;
1236
- if (e) {
1237
- var u = n || r;
1238
- l();
1239
- var d = e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e, f = document.elementFromPoint(d.clientX, d.clientY);
1240
- s(), u && !u.el.contains(f) && (a("spill"), this.onSpill({
1241
- dragEl: i,
1242
- putSortable: n
1243
- }));
1244
- }
1245
- };
1246
- function ye() {
1247
- }
1248
- ye.prototype = {
1249
- startIndex: null,
1250
- dragStart: function(t) {
1251
- var e = t.oldDraggableIndex;
1252
- this.startIndex = e;
1253
- },
1254
- onSpill: function(t) {
1255
- var e = t.dragEl, n = t.putSortable;
1256
- this.sortable.captureAnimationState(), n && n.captureAnimationState();
1257
- var i = wt(this.sortable.el, this.startIndex, this.options);
1258
- i ? this.sortable.el.insertBefore(e, i) : this.sortable.el.appendChild(e), this.sortable.animateAll(), n && n.animateAll();
1259
- },
1260
- drop: Ke
1261
- };
1262
- z(ye, {
1263
- pluginName: "revertOnSpill"
1264
- });
1265
- function Ee() {
1266
- }
1267
- Ee.prototype = {
1268
- onSpill: function(t) {
1269
- var e = t.dragEl, n = t.putSortable, i = n || this.sortable;
1270
- i.captureAnimationState(), e.parentNode && e.parentNode.removeChild(e), i.animateAll();
1271
- },
1272
- drop: Ke
1273
- };
1274
- z(Ee, {
1275
- pluginName: "removeOnSpill"
1276
- });
1277
- var j;
1278
- function On() {
1279
- function o() {
1280
- this.defaults = {
1281
- swapClass: "sortable-swap-highlight"
1282
- };
1283
- }
1284
- return o.prototype = {
1285
- dragStart: function(e) {
1286
- var n = e.dragEl;
1287
- j = n;
1288
- },
1289
- dragOverValid: function(e) {
1290
- var n = e.completed, i = e.target, r = e.onMove, a = e.activeSortable, l = e.changed, s = e.cancel;
1291
- if (a.options.swap) {
1292
- var u = this.sortable.el, d = this.options;
1293
- if (i && i !== u) {
1294
- var f = j;
1295
- r(i) !== !1 ? (T(i, d.swapClass, !0), j = i) : j = null, f && f !== j && T(f, d.swapClass, !1);
1296
- }
1297
- l(), n(!0), s();
1298
- }
1299
- },
1300
- drop: function(e) {
1301
- var n = e.activeSortable, i = e.putSortable, r = e.dragEl, a = i || this.sortable, l = this.options;
1302
- j && T(j, l.swapClass, !1), j && (l.swap || i && i.options.swap) && r !== j && (a.captureAnimationState(), a !== n && n.captureAnimationState(), Tn(r, j), a.animateAll(), a !== n && n.animateAll());
1303
- },
1304
- nulling: function() {
1305
- j = null;
1306
- }
1307
- }, z(o, {
1308
- pluginName: "swap",
1309
- eventProperties: function() {
1310
- return {
1311
- swapItem: j
1312
- };
1313
- }
1314
- });
1315
- }
1316
- function Tn(o, t) {
1317
- var e = o.parentNode, n = t.parentNode, i, r;
1318
- !e || !n || e.isEqualNode(t) || n.isEqualNode(o) || (i = N(o), r = N(t), e.isEqualNode(n) && i < r && r++, e.insertBefore(t, e.children[i]), n.insertBefore(o, n.children[r]));
1319
- }
1320
- var m = [], L = [], Ct, q, Ot = !1, H = !1, mt = !1, _, Tt, Kt;
1321
- function An() {
1322
- function o(t) {
1323
- for (var e in this)
1324
- e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
1325
- t.options.supportPointer ? y(document, "pointerup", this._deselectMultiDrag) : (y(document, "mouseup", this._deselectMultiDrag), y(document, "touchend", this._deselectMultiDrag)), y(document, "keydown", this._checkKeyDown), y(document, "keyup", this._checkKeyUp), this.defaults = {
1326
- selectedClass: "sortable-selected",
1327
- multiDragKey: null,
1328
- setData: function(i, r) {
1329
- var a = "";
1330
- m.length && q === t ? m.forEach(function(l, s) {
1331
- a += (s ? ", " : "") + l.textContent;
1332
- }) : a = r.textContent, i.setData("Text", a);
1333
- }
1334
- };
1335
- }
1336
- return o.prototype = {
1337
- multiDragKeyDown: !1,
1338
- isMultiDrag: !1,
1339
- delayStartGlobal: function(e) {
1340
- var n = e.dragEl;
1341
- _ = n;
1342
- },
1343
- delayEnded: function() {
1344
- this.isMultiDrag = ~m.indexOf(_);
1345
- },
1346
- setupClone: function(e) {
1347
- var n = e.sortable, i = e.cancel;
1348
- if (this.isMultiDrag) {
1349
- for (var r = 0; r < m.length; r++)
1350
- L.push(we(m[r])), L[r].sortableIndex = m[r].sortableIndex, L[r].draggable = !1, L[r].style["will-change"] = "", T(L[r], this.options.selectedClass, !1), m[r] === _ && T(L[r], this.options.chosenClass, !1);
1351
- n._hideClone(), i();
1352
- }
1353
- },
1354
- clone: function(e) {
1355
- var n = e.sortable, i = e.rootEl, r = e.dispatchSortableEvent, a = e.cancel;
1356
- this.isMultiDrag && (this.options.removeCloneOnHide || m.length && q === n && (xe(!0, i), r("clone"), a()));
1357
- },
1358
- showClone: function(e) {
1359
- var n = e.cloneNowShown, i = e.rootEl, r = e.cancel;
1360
- this.isMultiDrag && (xe(!1, i), L.forEach(function(a) {
1361
- h(a, "display", "");
1362
- }), n(), Kt = !1, r());
1363
- },
1364
- hideClone: function(e) {
1365
- var n = this;
1366
- e.sortable;
1367
- var i = e.cloneNowHidden, r = e.cancel;
1368
- this.isMultiDrag && (L.forEach(function(a) {
1369
- h(a, "display", "none"), n.options.removeCloneOnHide && a.parentNode && a.parentNode.removeChild(a);
1370
- }), i(), Kt = !0, r());
1371
- },
1372
- dragStartGlobal: function(e) {
1373
- e.sortable, !this.isMultiDrag && q && q.multiDrag._deselectMultiDrag(), m.forEach(function(n) {
1374
- n.sortableIndex = N(n);
1375
- }), m = m.sort(function(n, i) {
1376
- return n.sortableIndex - i.sortableIndex;
1377
- }), mt = !0;
1378
- },
1379
- dragStarted: function(e) {
1380
- var n = this, i = e.sortable;
1381
- if (this.isMultiDrag) {
1382
- if (this.options.sort && (i.captureAnimationState(), this.options.animation)) {
1383
- m.forEach(function(a) {
1384
- a !== _ && h(a, "position", "absolute");
1385
- });
1386
- var r = O(_, !1, !0, !0);
1387
- m.forEach(function(a) {
1388
- a !== _ && Ae(a, r);
1389
- }), H = !0, Ot = !0;
1390
- }
1391
- i.animateAll(function() {
1392
- H = !1, Ot = !1, n.options.animation && m.forEach(function(a) {
1393
- ie(a);
1394
- }), n.options.sort && jt();
1395
- });
1396
- }
1397
- },
1398
- dragOver: function(e) {
1399
- var n = e.target, i = e.completed, r = e.cancel;
1400
- H && ~m.indexOf(n) && (i(!1), r());
1401
- },
1402
- revert: function(e) {
1403
- var n = e.fromSortable, i = e.rootEl, r = e.sortable, a = e.dragRect;
1404
- m.length > 1 && (m.forEach(function(l) {
1405
- r.addAnimationState({
1406
- target: l,
1407
- rect: H ? O(l) : a
1408
- }), ie(l), l.fromRect = a, n.removeAnimationState(l);
1409
- }), H = !1, In(!this.options.removeCloneOnHide, i));
1410
- },
1411
- dragOverCompleted: function(e) {
1412
- var n = e.sortable, i = e.isOwner, r = e.insertion, a = e.activeSortable, l = e.parentEl, s = e.putSortable, u = this.options;
1413
- if (r) {
1414
- if (i && a._hideClone(), Ot = !1, u.animation && m.length > 1 && (H || !i && !a.options.sort && !s)) {
1415
- var d = O(_, !1, !0, !0);
1416
- m.forEach(function(p) {
1417
- p !== _ && (Ae(p, d), l.appendChild(p));
1418
- }), H = !0;
1419
- }
1420
- if (!i)
1421
- if (H || jt(), m.length > 1) {
1422
- var f = Kt;
1423
- a._showClone(n), a.options.animation && !Kt && f && L.forEach(function(p) {
1424
- a.addAnimationState({
1425
- target: p,
1426
- rect: Tt
1427
- }), p.fromRect = Tt, p.thisAnimationDuration = null;
1428
- });
1429
- } else
1430
- a._showClone(n);
1431
- }
1432
- },
1433
- dragOverAnimationCapture: function(e) {
1434
- var n = e.dragRect, i = e.isOwner, r = e.activeSortable;
1435
- if (m.forEach(function(l) {
1436
- l.thisAnimationDuration = null;
1437
- }), r.options.animation && !i && r.multiDrag.isMultiDrag) {
1438
- Tt = z({}, n);
1439
- var a = ht(_, !0);
1440
- Tt.top -= a.f, Tt.left -= a.e;
1441
- }
1442
- },
1443
- dragOverAnimationComplete: function() {
1444
- H && (H = !1, jt());
1445
- },
1446
- drop: function(e) {
1447
- var n = e.originalEvent, i = e.rootEl, r = e.parentEl, a = e.sortable, l = e.dispatchSortableEvent, s = e.oldIndex, u = e.putSortable, d = u || this.sortable;
1448
- if (n) {
1449
- var f = this.options, p = r.children;
1450
- if (!mt)
1451
- if (f.multiDragKey && !this.multiDragKeyDown && this._deselectMultiDrag(), T(_, f.selectedClass, !~m.indexOf(_)), ~m.indexOf(_))
1452
- m.splice(m.indexOf(_), 1), Ct = null, At({
1453
- sortable: a,
1454
- rootEl: i,
1455
- name: "deselect",
1456
- targetEl: _
1457
- });
1458
- else {
1459
- if (m.push(_), At({
1460
- sortable: a,
1461
- rootEl: i,
1462
- name: "select",
1463
- targetEl: _
1464
- }), n.shiftKey && Ct && a.el.contains(Ct)) {
1465
- var E = N(Ct), b = N(_);
1466
- if (~E && ~b && E !== b) {
1467
- var S, P;
1468
- for (b > E ? (P = E, S = b) : (P = b, S = E + 1); P < S; P++)
1469
- ~m.indexOf(p[P]) || (T(p[P], f.selectedClass, !0), m.push(p[P]), At({
1470
- sortable: a,
1471
- rootEl: i,
1472
- name: "select",
1473
- targetEl: p[P]
1474
- }));
1475
- }
1476
- } else
1477
- Ct = _;
1478
- q = d;
1479
- }
1480
- if (mt && this.isMultiDrag) {
1481
- if (H = !1, (r[k].options.sort || r !== i) && m.length > 1) {
1482
- var K = O(_), x = N(_, ":not(." + this.options.selectedClass + ")");
1483
- if (!Ot && f.animation && (_.thisAnimationDuration = null), d.captureAnimationState(), !Ot && (f.animation && (_.fromRect = K, m.forEach(function(D) {
1484
- if (D.thisAnimationDuration = null, D !== _) {
1485
- var V = H ? O(D) : K;
1486
- D.fromRect = V, d.addAnimationState({
1487
- target: D,
1488
- rect: V
1489
- });
1490
- }
1491
- })), jt(), m.forEach(function(D) {
1492
- p[x] ? r.insertBefore(D, p[x]) : r.appendChild(D), x++;
1493
- }), s === N(_))) {
1494
- var Y = !1;
1495
- m.forEach(function(D) {
1496
- if (D.sortableIndex !== N(D)) {
1497
- Y = !0;
1498
- return;
1499
- }
1500
- }), Y && l("update");
1501
- }
1502
- m.forEach(function(D) {
1503
- ie(D);
1504
- }), d.animateAll();
1505
- }
1506
- q = d;
1507
- }
1508
- (i === r || u && u.lastPutMode !== "clone") && L.forEach(function(D) {
1509
- D.parentNode && D.parentNode.removeChild(D);
1510
- });
1511
- }
1512
- },
1513
- nullingGlobal: function() {
1514
- this.isMultiDrag = mt = !1, L.length = 0;
1515
- },
1516
- destroyGlobal: function() {
1517
- this._deselectMultiDrag(), w(document, "pointerup", this._deselectMultiDrag), w(document, "mouseup", this._deselectMultiDrag), w(document, "touchend", this._deselectMultiDrag), w(document, "keydown", this._checkKeyDown), w(document, "keyup", this._checkKeyUp);
1518
- },
1519
- _deselectMultiDrag: function(e) {
1520
- if (!(typeof mt < "u" && mt) && q === this.sortable && !(e && $(e.target, this.options.draggable, this.sortable.el, !1)) && !(e && e.button !== 0))
1521
- for (; m.length; ) {
1522
- var n = m[0];
1523
- T(n, this.options.selectedClass, !1), m.shift(), At({
1524
- sortable: this.sortable,
1525
- rootEl: this.sortable.el,
1526
- name: "deselect",
1527
- targetEl: n
1528
- });
1529
- }
1530
- },
1531
- _checkKeyDown: function(e) {
1532
- e.key === this.options.multiDragKey && (this.multiDragKeyDown = !0);
1533
- },
1534
- _checkKeyUp: function(e) {
1535
- e.key === this.options.multiDragKey && (this.multiDragKeyDown = !1);
1536
- }
1537
- }, z(o, {
1538
- // Static methods & properties
1539
- pluginName: "multiDrag",
1540
- utils: {
1541
- /**
1542
- * Selects the provided multi-drag item
1543
- * @param {HTMLElement} el The element to be selected
1544
- */
1545
- select: function(e) {
1546
- var n = e.parentNode[k];
1547
- !n || !n.options.multiDrag || ~m.indexOf(e) || (q && q !== n && (q.multiDrag._deselectMultiDrag(), q = n), T(e, n.options.selectedClass, !0), m.push(e));
1548
- },
1549
- /**
1550
- * Deselects the provided multi-drag item
1551
- * @param {HTMLElement} el The element to be deselected
1552
- */
1553
- deselect: function(e) {
1554
- var n = e.parentNode[k], i = m.indexOf(e);
1555
- !n || !n.options.multiDrag || !~i || (T(e, n.options.selectedClass, !1), m.splice(i, 1));
1556
- }
1557
- },
1558
- eventProperties: function() {
1559
- var e = this, n = [], i = [];
1560
- return m.forEach(function(r) {
1561
- n.push({
1562
- multiDragElement: r,
1563
- index: r.sortableIndex
1564
- });
1565
- var a;
1566
- H && r !== _ ? a = -1 : H ? a = N(r, ":not(." + e.options.selectedClass + ")") : a = N(r), i.push({
1567
- multiDragElement: r,
1568
- index: a
1569
- });
1570
- }), {
1571
- items: Ze(m),
1572
- clones: [].concat(L),
1573
- oldIndicies: n,
1574
- newIndicies: i
1575
- };
1576
- },
1577
- optionListeners: {
1578
- multiDragKey: function(e) {
1579
- return e = e.toLowerCase(), e === "ctrl" ? e = "Control" : e.length > 1 && (e = e.charAt(0).toUpperCase() + e.substr(1)), e;
1580
- }
1581
- }
1582
- });
1583
- }
1584
- function In(o, t) {
1585
- m.forEach(function(e, n) {
1586
- var i = t.children[e.sortableIndex + (o ? Number(n) : 0)];
1587
- i ? t.insertBefore(e, i) : t.appendChild(e);
1588
- });
1589
- }
1590
- function xe(o, t) {
1591
- L.forEach(function(e, n) {
1592
- var i = t.children[e.sortableIndex + (o ? Number(n) : 0)];
1593
- i ? t.insertBefore(e, i) : t.appendChild(e);
1594
- });
1595
- }
1596
- function jt() {
1597
- m.forEach(function(o) {
1598
- o !== _ && o.parentNode && o.parentNode.removeChild(o);
1599
- });
1600
- }
1601
- g.mount(new Cn());
1602
- g.mount(Ee, ye);
1603
- const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1604
- __proto__: null,
1605
- MultiDrag: An,
1606
- Sortable: g,
1607
- Swap: On,
1608
- default: g
1609
- }, Symbol.toStringTag, { value: "Module" })), xn = /* @__PURE__ */ Ue(Nn);
1610
- export {
1611
- xn as r
1612
- };