nam-rich-text-editor 9.2.3 → 9.2.5
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/rich-text-editor.es.js +883 -834
- package/dist/rich-text-editor.umd.js +9 -9
- package/package.json +1 -1
|
@@ -202,8 +202,8 @@ function Fn(h, m) {
|
|
|
202
202
|
w.style[h] = m;
|
|
203
203
|
const g = u.extractContents();
|
|
204
204
|
w.appendChild(g), u.insertNode(w), p.removeAllRanges();
|
|
205
|
-
const
|
|
206
|
-
|
|
205
|
+
const C = document.createRange();
|
|
206
|
+
C.selectNodeContents(w), p.addRange(C), de(C);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
const v = document.createElement("span");
|
|
@@ -211,10 +211,10 @@ function Fn(h, m) {
|
|
|
211
211
|
const y = document.createRange();
|
|
212
212
|
y.setStart(v.firstChild, 0), y.setEnd(v.firstChild, 0), p.addRange(y), de(y);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Ao(h) {
|
|
215
215
|
Fn("color", h);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function _o(h) {
|
|
218
218
|
Fn("backgroundColor", h);
|
|
219
219
|
}
|
|
220
220
|
function Mo() {
|
|
@@ -246,7 +246,7 @@ function Ro() {
|
|
|
246
246
|
p.setAttribute("role", "button"), p.tabIndex = 0, p.style.userSelect = "none", p.addEventListener("keydown", (y) => {
|
|
247
247
|
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), p.click());
|
|
248
248
|
}), p.textContent = "A", p.style.color = "#000", p.style.fontSize = "16px", p.style.fontWeight = "bold", p.style.border = "1px solid #ccc", p.style.borderRadius = "4px", p.style.padding = "4px 8px", p.style.cursor = "pointer", p.style.backgroundColor = "#fff", p.title = "Text Color", p.onclick = () => m.click(), m.onchange = () => {
|
|
249
|
-
Re(),
|
|
249
|
+
Re(), Ao(m.value), p.style.color = m.value;
|
|
250
250
|
}, h.appendChild(p), h.appendChild(m);
|
|
251
251
|
const u = document.createElement("input");
|
|
252
252
|
u.type = "color", u.style.display = "none", u.title = "Background Color";
|
|
@@ -254,7 +254,7 @@ function Ro() {
|
|
|
254
254
|
return v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (y) => {
|
|
255
255
|
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), v.click());
|
|
256
256
|
}), v.textContent = "BA", v.style.color = "#000", v.style.fontSize = "14px", v.style.fontWeight = "bold", v.style.border = "1px solid #ccc", v.style.borderRadius = "4px", v.style.padding = "4px 6px", v.style.cursor = "pointer", v.style.backgroundColor = "#fff", v.title = "Background Color", v.onclick = () => u.click(), u.onchange = () => {
|
|
257
|
-
Re(),
|
|
257
|
+
Re(), _o(u.value), v.style.backgroundColor = u.value, v.style.color = "#000";
|
|
258
258
|
}, h.appendChild(v), h.appendChild(u), h;
|
|
259
259
|
}
|
|
260
260
|
function Io() {
|
|
@@ -296,14 +296,14 @@ function Io() {
|
|
|
296
296
|
y.preventDefault(), y.stopPropagation();
|
|
297
297
|
const g = u.closest(".editor-container")?.querySelector(".editor");
|
|
298
298
|
if (!g) return;
|
|
299
|
-
const
|
|
300
|
-
if (console.log("Align clicked, selectedContainer:",
|
|
301
|
-
|
|
299
|
+
const C = window.__selectedImageContainer;
|
|
300
|
+
if (console.log("Align clicked, selectedContainer:", C), C && g.contains(C)) {
|
|
301
|
+
C.style.textAlign = p.align, console.log("Applied align:", p.align, "to container"), g.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
306
|
-
let k =
|
|
304
|
+
const S = window.getSelection();
|
|
305
|
+
if (S && S.rangeCount > 0 && S.anchorNode) {
|
|
306
|
+
let k = S.anchorNode;
|
|
307
307
|
for (; k && k.nodeType !== Node.ELEMENT_NODE; )
|
|
308
308
|
k = k.parentNode;
|
|
309
309
|
let _ = k;
|
|
@@ -327,7 +327,7 @@ function Po(h) {
|
|
|
327
327
|
u && (u.tagName === "P" || u.tagName === "DIV" && !u.classList.contains("editor-image-container") && !u.classList.contains("editor-image-wrapper") && u !== h) && (u.parentNode?.insertBefore(p, u.nextSibling), !u.textContent?.trim() && !u.querySelector("img") && u.remove());
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function Do() {
|
|
331
331
|
const h = document.createDocumentFragment();
|
|
332
332
|
return [
|
|
333
333
|
{ command: "insertUnorderedList", icon: fo, title: "Bullet List" },
|
|
@@ -349,7 +349,7 @@ function Oo() {
|
|
|
349
349
|
}, h.appendChild(u);
|
|
350
350
|
}), h;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function Oo() {
|
|
353
353
|
const h = document.createDocumentFragment();
|
|
354
354
|
return [
|
|
355
355
|
{ command: "indent", icon: uo, title: "Increase Indent" },
|
|
@@ -410,11 +410,11 @@ function zo() {
|
|
|
410
410
|
else {
|
|
411
411
|
v = w.getAttribute("style") || "", y = g && g.getAttribute("style") || "", w.style.position = "fixed", w.style.top = "0", w.style.left = "0", w.style.width = "100vw", w.style.height = "100vh", w.style.margin = "0", w.style.padding = "0";
|
|
412
412
|
try {
|
|
413
|
-
let
|
|
414
|
-
document.querySelectorAll("body *").forEach((
|
|
415
|
-
const k = window.getComputedStyle(
|
|
416
|
-
!isNaN(_) && _ > 0 && (
|
|
417
|
-
}), w.style.zIndex = String(Math.max(
|
|
413
|
+
let C = 9998;
|
|
414
|
+
document.querySelectorAll("body *").forEach((S) => {
|
|
415
|
+
const k = window.getComputedStyle(S).getPropertyValue("z-index"), _ = parseInt(k, 10);
|
|
416
|
+
!isNaN(_) && _ > 0 && (C = Math.max(C, _));
|
|
417
|
+
}), w.style.zIndex = String(Math.max(C + 1, 9999));
|
|
418
418
|
} catch {
|
|
419
419
|
w.style.zIndex = "9999";
|
|
420
420
|
}
|
|
@@ -434,25 +434,25 @@ function Fo(h) {
|
|
|
434
434
|
const w = document.createElement("div");
|
|
435
435
|
w.style.display = "flex", w.style.gap = "10px", w.style.justifyContent = "flex-end";
|
|
436
436
|
const g = document.createElement("div");
|
|
437
|
-
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.textContent = "Cancel", g.style.padding = "8px 16px", g.style.border = "1px solid #ccc", g.style.borderRadius = "4px", g.style.backgroundColor = "#f5f5f5", g.style.cursor = "pointer", g.addEventListener("keydown", (
|
|
438
|
-
(
|
|
437
|
+
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.textContent = "Cancel", g.style.padding = "8px 16px", g.style.border = "1px solid #ccc", g.style.borderRadius = "4px", g.style.backgroundColor = "#f5f5f5", g.style.cursor = "pointer", g.addEventListener("keydown", (I) => {
|
|
438
|
+
(I.key === "Enter" || I.key === " " || I.key === "Escape") && (I.preventDefault(), g.click());
|
|
439
439
|
}), g.onclick = () => {
|
|
440
|
-
p.style.display = "none", y.value = "",
|
|
440
|
+
p.style.display = "none", y.value = "", C = null;
|
|
441
441
|
};
|
|
442
|
-
let
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
(
|
|
446
|
-
}),
|
|
447
|
-
const
|
|
448
|
-
if (
|
|
449
|
-
if (
|
|
450
|
-
|
|
442
|
+
let C = null;
|
|
443
|
+
const S = document.createElement("div");
|
|
444
|
+
S.setAttribute("role", "button"), S.tabIndex = 0, S.style.userSelect = "none", S.textContent = "Insert", S.style.padding = "8px 16px", S.style.border = "none", S.style.borderRadius = "4px", S.style.backgroundColor = "#007bff", S.style.color = "#fff", S.style.cursor = "pointer", S.addEventListener("keydown", (I) => {
|
|
445
|
+
(I.key === "Enter" || I.key === " ") && (I.preventDefault(), S.click());
|
|
446
|
+
}), S.onclick = () => {
|
|
447
|
+
const I = y.value.trim();
|
|
448
|
+
if (I)
|
|
449
|
+
if (C)
|
|
450
|
+
C.setAttribute("href", I), C.setAttribute("target", "_blank"), C.setAttribute("rel", "noopener noreferrer"), C.setAttribute("tabindex", "0");
|
|
451
451
|
else {
|
|
452
|
-
Re(), document.execCommand("createLink", !1,
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
455
|
-
let N =
|
|
452
|
+
Re(), document.execCommand("createLink", !1, I);
|
|
453
|
+
const W = window.getSelection();
|
|
454
|
+
if (W && W.rangeCount > 0) {
|
|
455
|
+
let N = W.getRangeAt(0).startContainer;
|
|
456
456
|
for (; N && N.nodeType !== Node.ELEMENT_NODE; )
|
|
457
457
|
N = N.parentNode;
|
|
458
458
|
let P = N;
|
|
@@ -466,41 +466,41 @@ function Fo(h) {
|
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
p.style.display = "none", y.value = "",
|
|
470
|
-
}, w.appendChild(g), w.appendChild(
|
|
471
|
-
|
|
469
|
+
p.style.display = "none", y.value = "", C = null;
|
|
470
|
+
}, w.appendChild(g), w.appendChild(S), u.appendChild(v), u.appendChild(y), u.appendChild(w), p.appendChild(u), document.body.appendChild(p), y.onkeydown = (I) => {
|
|
471
|
+
I.key === "Enter" ? S.click() : I.key === "Escape" && g.click();
|
|
472
472
|
};
|
|
473
473
|
const k = document.createElement("div");
|
|
474
474
|
k.setAttribute("role", "button"), k.tabIndex = 0, k.style.userSelect = "none";
|
|
475
475
|
const _ = ye(lo, { width: 16, height: 16 });
|
|
476
476
|
k.appendChild(_), k.title = "Insert Hyperlink", k.style.border = "1px solid #e1e1e1", k.style.backgroundColor = "#ffffff", k.style.padding = "6px 10px", k.style.borderRadius = "3px", k.style.cursor = "pointer", k.style.color = "#000000", k.onmouseover = () => k.style.backgroundColor = "#f0f0f0", k.onmouseout = () => k.style.backgroundColor = "#ffffff", k.onmousedown = () => {
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
let N =
|
|
477
|
+
C = null;
|
|
478
|
+
const I = window.getSelection();
|
|
479
|
+
if (I && I.rangeCount > 0) {
|
|
480
|
+
let N = I.getRangeAt(0).startContainer;
|
|
481
481
|
for (; N && N.nodeType !== Node.ELEMENT_NODE; )
|
|
482
482
|
N = N.parentNode;
|
|
483
483
|
let P = N;
|
|
484
484
|
for (; P && P !== document.body; ) {
|
|
485
485
|
if (P.tagName === "A") {
|
|
486
|
-
|
|
486
|
+
C = P, y.value = C.getAttribute("href") || "";
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
489
|
P = P.parentElement;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
de();
|
|
493
|
-
}, k.addEventListener("keydown", (
|
|
494
|
-
(
|
|
493
|
+
}, k.addEventListener("keydown", (I) => {
|
|
494
|
+
(I.key === "Enter" || I.key === " ") && (I.preventDefault(), k.click());
|
|
495
495
|
}), k.onclick = () => {
|
|
496
496
|
p.style.display = "flex", y.focus();
|
|
497
497
|
}, m.appendChild(k);
|
|
498
|
-
const
|
|
499
|
-
return
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
|
|
503
|
-
const N =
|
|
498
|
+
const O = h.querySelector(".editor");
|
|
499
|
+
return O && O.addEventListener("click", (I) => {
|
|
500
|
+
const W = I.target;
|
|
501
|
+
if (W.tagName === "A") {
|
|
502
|
+
I.preventDefault();
|
|
503
|
+
const N = W.getAttribute("href");
|
|
504
504
|
N && window.open(N, "_blank");
|
|
505
505
|
}
|
|
506
506
|
}), m;
|
|
@@ -522,65 +522,65 @@ function jo() {
|
|
|
522
522
|
w.textContent = "Insert Quote", w.className = "rte-modal-title";
|
|
523
523
|
const g = document.createElement("div");
|
|
524
524
|
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.className = "rte-modal-close", g.innerHTML = "×", g.onclick = () => {
|
|
525
|
-
u.style.display = "none",
|
|
525
|
+
u.style.display = "none", X = null;
|
|
526
526
|
}, y.appendChild(w), y.appendChild(g);
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
527
|
+
const C = document.createElement("div");
|
|
528
|
+
C.className = "rte-modal-form";
|
|
529
|
+
const S = document.createElement("label");
|
|
530
|
+
S.textContent = "Title", S.className = "rte-label";
|
|
531
531
|
const k = document.createElement("input");
|
|
532
532
|
k.type = "text", k.placeholder = "e.g., Article title or source", k.className = "rte-input";
|
|
533
533
|
const _ = document.createElement("label");
|
|
534
534
|
_.textContent = "Source URL", _.className = "rte-label";
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
|
|
535
|
+
const O = document.createElement("input");
|
|
536
|
+
O.type = "url", O.placeholder = "https://example.com", O.className = "rte-input";
|
|
537
|
+
const I = document.createElement("div");
|
|
538
|
+
I.className = "rte-preview-label", I.textContent = "Preview";
|
|
539
|
+
const W = document.createElement("div");
|
|
540
|
+
W.className = "rte-modal-preview";
|
|
541
541
|
const N = document.createElement("div");
|
|
542
542
|
N.className = "rte-blockquote-title";
|
|
543
543
|
const P = document.createElement("div");
|
|
544
544
|
P.className = "rte-blockquote-content";
|
|
545
545
|
const H = document.createElement("div");
|
|
546
|
-
H.className = "rte-blockquote-footer",
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
546
|
+
H.className = "rte-blockquote-footer", W.appendChild(N), W.appendChild(P), W.appendChild(H), C.appendChild(S), C.appendChild(k), C.appendChild(_), C.appendChild(O), C.appendChild(I), C.appendChild(W);
|
|
547
|
+
const M = document.createElement("div");
|
|
548
|
+
M.className = "rte-modal-actions";
|
|
549
|
+
const F = document.createElement("div");
|
|
550
|
+
F.setAttribute("role", "button"), F.tabIndex = 0, F.style.userSelect = "none", F.className = "rte-btn-danger", F.textContent = "Remove", F.style.display = "none", F.onclick = () => {
|
|
551
|
+
X && (X.remove(), X = null), u.style.display = "none";
|
|
552
552
|
};
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
u.style.display = "none",
|
|
553
|
+
const $ = document.createElement("div");
|
|
554
|
+
$.setAttribute("role", "button"), $.tabIndex = 0, $.style.userSelect = "none", $.className = "rte-btn-muted", $.textContent = "Cancel", $.onclick = () => {
|
|
555
|
+
u.style.display = "none", X = null;
|
|
556
556
|
};
|
|
557
|
-
const
|
|
558
|
-
|
|
557
|
+
const oe = document.createElement("div");
|
|
558
|
+
oe.setAttribute("role", "button"), oe.tabIndex = 0, oe.style.userSelect = "none", oe.className = "rte-btn-primary", oe.textContent = "Apply", oe.onclick = () => {
|
|
559
559
|
const ne = k.value.trim();
|
|
560
|
-
let
|
|
561
|
-
if (
|
|
562
|
-
const le =
|
|
560
|
+
let B = O.value.trim();
|
|
561
|
+
if (B && !/^https?:\/\//i.test(B) && (B = `https://${B}`), X) {
|
|
562
|
+
const le = X.querySelector(
|
|
563
563
|
".rte-blockquote-title"
|
|
564
564
|
);
|
|
565
565
|
if (ne)
|
|
566
566
|
if (le) le.textContent = ne;
|
|
567
567
|
else {
|
|
568
|
-
const
|
|
569
|
-
|
|
568
|
+
const Z = document.createElement("div");
|
|
569
|
+
Z.className = "rte-blockquote-title", Z.textContent = ne, X.insertBefore(Z, X.firstChild);
|
|
570
570
|
}
|
|
571
571
|
else le && le.remove();
|
|
572
|
-
const ce =
|
|
572
|
+
const ce = X.querySelector(
|
|
573
573
|
".rte-blockquote-footer"
|
|
574
574
|
);
|
|
575
|
-
if (
|
|
575
|
+
if (B)
|
|
576
576
|
if (ce) {
|
|
577
|
-
const
|
|
578
|
-
|
|
577
|
+
const Z = ce.querySelector("a");
|
|
578
|
+
Z.href = B, Z.textContent = B;
|
|
579
579
|
} else {
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
|
|
580
|
+
const Z = document.createElement("footer");
|
|
581
|
+
Z.className = "rte-blockquote-footer";
|
|
582
|
+
const ee = document.createElement("cite"), K = document.createElement("a");
|
|
583
|
+
K.href = B, K.textContent = B, K.target = "_blank", K.rel = "noopener noreferrer", ee.appendChild(K), Z.appendChild(ee), X.appendChild(Z);
|
|
584
584
|
}
|
|
585
585
|
else ce && ce.remove();
|
|
586
586
|
} else {
|
|
@@ -590,58 +590,58 @@ function jo() {
|
|
|
590
590
|
u.style.display = "none";
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
const ce = le.getRangeAt(0),
|
|
594
|
-
if (
|
|
593
|
+
const ce = le.getRangeAt(0), Z = ce.extractContents(), ee = document.createElement("blockquote");
|
|
594
|
+
if (ee.className = "rte-blockquote", ne) {
|
|
595
595
|
const re = document.createElement("div");
|
|
596
|
-
re.className = "rte-blockquote-title", re.textContent = ne,
|
|
596
|
+
re.className = "rte-blockquote-title", re.textContent = ne, ee.appendChild(re);
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
598
|
+
const K = document.createElement("p");
|
|
599
|
+
if (K.appendChild(Z), ee.appendChild(K), B) {
|
|
600
600
|
const re = document.createElement("footer");
|
|
601
601
|
re.className = "rte-blockquote-footer";
|
|
602
602
|
const se = document.createElement("cite"), pe = document.createElement("a");
|
|
603
|
-
pe.href =
|
|
603
|
+
pe.href = B, pe.textContent = B, pe.target = "_blank", pe.rel = "noopener noreferrer", se.appendChild(pe), re.appendChild(se), ee.appendChild(re);
|
|
604
604
|
}
|
|
605
|
-
ce.insertNode(
|
|
606
|
-
const
|
|
607
|
-
|
|
605
|
+
ce.insertNode(ee), le.removeAllRanges();
|
|
606
|
+
const ie = document.createRange();
|
|
607
|
+
ie.setStartAfter(ee), ie.collapse(!0), le.addRange(ie), de(ie);
|
|
608
608
|
}
|
|
609
|
-
u.style.display = "none", k.value = "",
|
|
610
|
-
},
|
|
611
|
-
let
|
|
609
|
+
u.style.display = "none", k.value = "", O.value = "", X = null;
|
|
610
|
+
}, M.appendChild(F), M.appendChild($), M.appendChild(oe), v.appendChild(y), v.appendChild(C), v.appendChild(M), u.appendChild(v), document.body.appendChild(u);
|
|
611
|
+
let X = null, b = "";
|
|
612
612
|
return m.onmousedown = () => {
|
|
613
|
-
|
|
613
|
+
X = null, b = "";
|
|
614
614
|
const ne = window.getSelection();
|
|
615
615
|
if (ne && ne.rangeCount > 0) {
|
|
616
|
-
const
|
|
617
|
-
le.appendChild(
|
|
618
|
-
let ce =
|
|
616
|
+
const B = ne.getRangeAt(0), le = document.createElement("div");
|
|
617
|
+
le.appendChild(B.cloneContents()), b = le.innerHTML || B.toString();
|
|
618
|
+
let ce = B.startContainer;
|
|
619
619
|
for (; ce && ce.nodeType !== Node.ELEMENT_NODE; )
|
|
620
620
|
ce = ce.parentNode;
|
|
621
|
-
let
|
|
622
|
-
for (;
|
|
623
|
-
if (
|
|
624
|
-
|
|
625
|
-
const
|
|
621
|
+
let Z = ce;
|
|
622
|
+
for (; Z && Z !== document.body; ) {
|
|
623
|
+
if (Z.tagName === "BLOCKQUOTE") {
|
|
624
|
+
X = Z;
|
|
625
|
+
const ee = X.querySelector(
|
|
626
626
|
".rte-blockquote-title"
|
|
627
|
-
),
|
|
627
|
+
), K = X.querySelector(
|
|
628
628
|
".rte-blockquote-footer a"
|
|
629
629
|
);
|
|
630
|
-
k.value =
|
|
631
|
-
const
|
|
632
|
-
P.innerHTML =
|
|
630
|
+
k.value = ee && ee.textContent || "", O.value = K && K.href || "", F.style.display = "inline-block";
|
|
631
|
+
const ie = X.querySelector("p");
|
|
632
|
+
P.innerHTML = ie ? ie.innerHTML : X.innerHTML, N.textContent = ee && ee.textContent || "", H.innerHTML = K ? `<a href="${K.href}">${K.href}</a>` : "";
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
Z = Z.parentElement;
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
|
|
639
|
-
}, k.oninput = () => N.textContent = k.value,
|
|
640
|
-
const ne =
|
|
638
|
+
X || (P.innerHTML = b || "<em>Selected text will appear here</em>", N.textContent = "", H.innerHTML = "", F.style.display = "none"), de();
|
|
639
|
+
}, k.oninput = () => N.textContent = k.value, O.oninput = () => {
|
|
640
|
+
const ne = O.value.trim();
|
|
641
641
|
if (!ne) H.innerHTML = "";
|
|
642
642
|
else {
|
|
643
|
-
const
|
|
644
|
-
H.innerHTML = `<a href="${
|
|
643
|
+
const B = /^https?:\/\//i.test(ne) ? ne : `https://${ne}`;
|
|
644
|
+
H.innerHTML = `<a href="${B}" target="_blank" rel="noopener noreferrer">${B}</a>`;
|
|
645
645
|
}
|
|
646
646
|
}, m.onclick = () => {
|
|
647
647
|
u.style.display = "flex", k.focus();
|
|
@@ -655,7 +655,7 @@ function Ho() {
|
|
|
655
655
|
const p = ye(yo, { width: 16, height: 16 });
|
|
656
656
|
return m.appendChild(p), m.title = "Remove Formatting", m.style.border = "1px solid #e1e1e1", m.style.backgroundColor = "#ffffff", m.style.padding = "6px 10px", m.style.borderRadius = "3px", m.style.cursor = "pointer", m.style.color = "#000000", m.onmouseover = () => m.style.backgroundColor = "#f0f0f0", m.onmouseout = () => m.style.backgroundColor = "#ffffff", m.onclick = () => document.execCommand("removeFormat"), h.appendChild(m), h;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function Wo(h) {
|
|
659
659
|
const m = document.createDocumentFragment(), p = document.createElement("div");
|
|
660
660
|
p.className = "rte-modal-overlay", p.style.display = "none";
|
|
661
661
|
const u = document.createElement("div");
|
|
@@ -668,66 +668,66 @@ function Bo(h) {
|
|
|
668
668
|
w.setAttribute("role", "button"), w.tabIndex = 0, w.style.userSelect = "none", w.className = "rte-modal-close", w.innerHTML = "×", w.onclick = () => p.style.display = "none", v.appendChild(y), v.appendChild(w);
|
|
669
669
|
const g = document.createElement("div");
|
|
670
670
|
g.className = "rte-modal-form";
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
|
|
671
|
+
const C = document.createElement("label");
|
|
672
|
+
C.className = "rte-label", C.textContent = "Video URL";
|
|
673
|
+
const S = document.createElement("input");
|
|
674
|
+
S.type = "url", S.className = "rte-input", S.placeholder = "https://... or YouTube URL";
|
|
675
675
|
const k = document.createElement("div");
|
|
676
676
|
k.className = "rte-preview-label", k.textContent = "Preview";
|
|
677
677
|
const _ = document.createElement("div");
|
|
678
678
|
_.className = "rte-modal-preview";
|
|
679
|
+
const O = document.createElement("div");
|
|
680
|
+
O.className = "rte-form-left";
|
|
679
681
|
const I = document.createElement("div");
|
|
680
|
-
I.className = "rte-form-
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
const j = document.createElement("div");
|
|
684
|
-
j.className = "rte-field", j.appendChild(T), j.appendChild(A);
|
|
682
|
+
I.className = "rte-form-right";
|
|
683
|
+
const W = document.createElement("div");
|
|
684
|
+
W.className = "rte-field", W.appendChild(C), W.appendChild(S);
|
|
685
685
|
const N = document.createElement("div");
|
|
686
686
|
N.className = "rte-dim-row";
|
|
687
687
|
const P = document.createElement("div");
|
|
688
688
|
P.style.display = "flex", P.style.flexDirection = "column";
|
|
689
689
|
const H = document.createElement("label");
|
|
690
690
|
H.className = "rte-label", H.textContent = "Width (px)";
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
const
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
|
|
691
|
+
const M = document.createElement("input");
|
|
692
|
+
M.type = "text", M.className = "rte-dim-input", M.placeholder = "e.g., 560", P.appendChild(H), P.appendChild(M);
|
|
693
|
+
const F = document.createElement("div");
|
|
694
|
+
F.style.display = "flex", F.style.flexDirection = "column";
|
|
695
|
+
const $ = document.createElement("label");
|
|
696
|
+
$.className = "rte-label", $.textContent = "Height (px)";
|
|
697
|
+
const oe = document.createElement("input");
|
|
698
|
+
oe.type = "text", oe.className = "rte-dim-input", oe.placeholder = "e.g., 315", F.appendChild($), F.appendChild(oe), N.appendChild(P), N.appendChild(F), O.appendChild(W), O.appendChild(N), I.appendChild(k), I.appendChild(_), g.appendChild(O), g.appendChild(I);
|
|
699
|
+
const X = document.createElement("div");
|
|
700
|
+
X.className = "rte-modal-actions";
|
|
701
|
+
const b = document.createElement("div");
|
|
702
|
+
b.setAttribute("role", "button"), b.tabIndex = 0, b.style.userSelect = "none", b.className = "rte-btn-muted", b.textContent = "Cancel", b.onclick = () => p.style.display = "none";
|
|
703
703
|
const ne = document.createElement("div");
|
|
704
|
-
ne.setAttribute("role", "button"), ne.tabIndex = 0, ne.style.userSelect = "none", ne.className = "rte-btn-primary", ne.textContent = "Insert",
|
|
705
|
-
const
|
|
706
|
-
|
|
704
|
+
ne.setAttribute("role", "button"), ne.tabIndex = 0, ne.style.userSelect = "none", ne.className = "rte-btn-primary", ne.textContent = "Insert", X.appendChild(b), X.appendChild(ne), u.appendChild(v), u.appendChild(g), u.appendChild(X), p.appendChild(u), document.body.appendChild(p);
|
|
705
|
+
const B = document.createElement("div");
|
|
706
|
+
B.setAttribute("role", "button"), B.tabIndex = 0, B.style.userSelect = "none";
|
|
707
707
|
const le = ye(To, { width: 16, height: 16 });
|
|
708
|
-
|
|
709
|
-
(
|
|
710
|
-
}),
|
|
711
|
-
_.innerHTML = "<em>No URL entered</em>",
|
|
708
|
+
B.appendChild(le), B.title = "Insert Video", B.style.border = "1px solid #e1e1e1", B.style.backgroundColor = "#ffffff", B.style.padding = "6px 10px", B.style.borderRadius = "3px", B.style.cursor = "pointer", B.style.color = "#000000", B.onmouseover = () => B.style.backgroundColor = "#f0f0f0", B.onmouseout = () => B.style.backgroundColor = "#ffffff", B.onmousedown = () => de(), B.addEventListener("keydown", (ee) => {
|
|
709
|
+
(ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), B.click());
|
|
710
|
+
}), B.onclick = () => {
|
|
711
|
+
_.innerHTML = "<em>No URL entered</em>", S.value = "", p.style.display = "flex", S.focus();
|
|
712
712
|
};
|
|
713
713
|
const ce = () => {
|
|
714
|
-
const
|
|
715
|
-
if (!
|
|
714
|
+
const ee = S.value.trim(), K = M && M.value.trim() || "", ie = oe && oe.value.trim() || "", re = parseInt(K, 10), se = parseInt(ie, 10);
|
|
715
|
+
if (!ee) {
|
|
716
716
|
_.innerHTML = "<em>No preview</em>";
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
const pe =
|
|
719
|
+
const pe = ee.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
720
720
|
if (pe) {
|
|
721
|
-
const E = pe[1],
|
|
722
|
-
_.innerHTML = `<iframe width="${
|
|
721
|
+
const E = pe[1], q = Number.isFinite(re) ? re : 320, V = Number.isFinite(se) ? se : 180;
|
|
722
|
+
_.innerHTML = `<iframe width="${q}" height="${V}" src="https://www.youtube.com/embed/${E}" frameborder="0" allowfullscreen></iframe>`;
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
725
|
const fe = Number.isFinite(re) ? `${re}px` : "320px", he = Number.isFinite(se) ? `${se}px` : "auto";
|
|
726
|
-
_.innerHTML = `<video controls style="max-width:100%; width:${fe}; height:${he};" src="${
|
|
726
|
+
_.innerHTML = `<video controls style="max-width:100%; width:${fe}; height:${he};" src="${ee}"></video>`;
|
|
727
727
|
};
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
if (!
|
|
728
|
+
S.oninput = ce, typeof M < "u" && (M.oninput = ce), typeof oe < "u" && (oe.oninput = ce), ne.onclick = () => {
|
|
729
|
+
const ee = S.value.trim(), K = M && M.value.trim() || "", ie = oe && oe.value.trim() || "", re = parseInt(K, 10), se = parseInt(ie, 10);
|
|
730
|
+
if (!ee) {
|
|
731
731
|
p.style.display = "none";
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
@@ -737,32 +737,32 @@ function Bo(h) {
|
|
|
737
737
|
p.style.display = "none";
|
|
738
738
|
return;
|
|
739
739
|
}
|
|
740
|
-
const fe = pe.getRangeAt(0), he =
|
|
740
|
+
const fe = pe.getRangeAt(0), he = ee.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
741
741
|
let E;
|
|
742
742
|
if (he) {
|
|
743
|
-
const
|
|
744
|
-
|
|
743
|
+
const V = he[1], J = document.createElement("div"), xe = Number.isFinite(re) ? re : 560, we = Number.isFinite(se) ? se : 315;
|
|
744
|
+
J.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${V}" frameborder="0" allowfullscreen></iframe>`, J.contentEditable = "false", J.className = "editor-video-wrapper", J.style.display = "block", J.style.maxWidth = "100%", J.style.width = "auto", J.style.height = "auto", J.style.boxSizing = "border-box", J.style.userSelect = "none", E = J;
|
|
745
745
|
} else {
|
|
746
|
-
const
|
|
747
|
-
|
|
746
|
+
const V = document.createElement("div"), J = document.createElement("video");
|
|
747
|
+
J.controls = !0, J.src = ee, Number.isFinite(re) && (J.width = re), Number.isFinite(se) && (J.height = se), J.style.maxWidth = "100%", J.style.display = "block", V.appendChild(J), V.contentEditable = "false", V.className = "editor-video-wrapper", V.style.display = "block", V.style.maxWidth = "100%", V.style.width = "auto", V.style.height = "auto", V.style.boxSizing = "border-box", V.style.userSelect = "none", E = V;
|
|
748
748
|
}
|
|
749
749
|
fe.insertNode(E), pe.removeAllRanges();
|
|
750
|
-
const
|
|
751
|
-
|
|
750
|
+
const q = document.createRange();
|
|
751
|
+
q.setStartAfter(E), q.collapse(!0), pe.addRange(q), de(q);
|
|
752
752
|
try {
|
|
753
|
-
const
|
|
754
|
-
|
|
753
|
+
const V = Z;
|
|
754
|
+
V && typeof V.focus == "function" && (V.focus(), V.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
755
755
|
} catch {
|
|
756
756
|
}
|
|
757
|
-
p.style.display = "none",
|
|
757
|
+
p.style.display = "none", S.value = "", _.innerHTML = "";
|
|
758
758
|
};
|
|
759
|
-
const
|
|
760
|
-
return
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
}), m.appendChild(
|
|
759
|
+
const Z = h.querySelector(".editor");
|
|
760
|
+
return Z && Z.addEventListener("click", (ee) => {
|
|
761
|
+
const K = ee.target;
|
|
762
|
+
K && K.tagName === "VIDEO" && K.focus();
|
|
763
|
+
}), m.appendChild(B), m;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Bo(h) {
|
|
766
766
|
const m = document.createElement("div");
|
|
767
767
|
m.style.display = "flex", m.style.flexWrap = "wrap", m.style.gap = "8px", m.style.marginBottom = "10px", m.style.padding = "12px", m.style.border = "1px solid #e1e1e1", m.style.backgroundColor = "#ffffff", m.style.borderRadius = "4px", m.style.boxShadow = "0 1px 3px rgba(0,0,0,0.1)";
|
|
768
768
|
const p = to();
|
|
@@ -781,24 +781,24 @@ function qo(h) {
|
|
|
781
781
|
<option value="h3">Heading 3</option>
|
|
782
782
|
<option value="h4">Heading 4</option>
|
|
783
783
|
`, u.onchange = () => {
|
|
784
|
-
const H = u.value,
|
|
785
|
-
document.execCommand("formatBlock", !1, `<${
|
|
784
|
+
const H = u.value, M = H === "p" ? "P" : H.toUpperCase();
|
|
785
|
+
document.execCommand("formatBlock", !1, `<${M}>`);
|
|
786
786
|
}, m.appendChild(u), document.addEventListener("selectionchange", () => {
|
|
787
787
|
try {
|
|
788
788
|
const H = window.getSelection();
|
|
789
789
|
if (!H || !H.anchorNode) return;
|
|
790
|
-
let
|
|
791
|
-
for (;
|
|
792
|
-
|
|
793
|
-
if (!
|
|
794
|
-
let
|
|
795
|
-
for (;
|
|
796
|
-
const
|
|
797
|
-
if (
|
|
798
|
-
u.value =
|
|
790
|
+
let M = H.anchorNode;
|
|
791
|
+
for (; M && M.nodeType !== Node.ELEMENT_NODE; )
|
|
792
|
+
M = M.parentNode;
|
|
793
|
+
if (!M) return;
|
|
794
|
+
let F = M;
|
|
795
|
+
for (; F && F !== document.body && F !== m.parentElement; ) {
|
|
796
|
+
const $ = F.tagName?.toUpperCase?.();
|
|
797
|
+
if ($ === "H1" || $ === "H2" || $ === "H3" || $ === "H4" || $ === "P") {
|
|
798
|
+
u.value = $ === "P" ? "p" : $.toLowerCase();
|
|
799
799
|
return;
|
|
800
800
|
}
|
|
801
|
-
|
|
801
|
+
F = F.parentElement;
|
|
802
802
|
}
|
|
803
803
|
u.value = "p";
|
|
804
804
|
} catch {
|
|
@@ -820,26 +820,26 @@ function qo(h) {
|
|
|
820
820
|
m.appendChild(w);
|
|
821
821
|
const g = Io();
|
|
822
822
|
m.appendChild(g);
|
|
823
|
-
const
|
|
824
|
-
m.appendChild(
|
|
825
|
-
const
|
|
826
|
-
m.appendChild(
|
|
823
|
+
const C = Do();
|
|
824
|
+
m.appendChild(C);
|
|
825
|
+
const S = Oo();
|
|
826
|
+
m.appendChild(S);
|
|
827
827
|
const k = No();
|
|
828
828
|
m.appendChild(k);
|
|
829
829
|
const _ = Lo();
|
|
830
830
|
m.appendChild(_);
|
|
831
|
-
const
|
|
831
|
+
const O = Fo(h);
|
|
832
|
+
m.appendChild(O);
|
|
833
|
+
const I = jo();
|
|
832
834
|
m.appendChild(I);
|
|
833
|
-
const
|
|
834
|
-
m.appendChild(
|
|
835
|
-
const
|
|
836
|
-
m.appendChild(j);
|
|
837
|
-
const N = Bo(h);
|
|
835
|
+
const W = Ho();
|
|
836
|
+
m.appendChild(W);
|
|
837
|
+
const N = Wo(h);
|
|
838
838
|
m.appendChild(N);
|
|
839
839
|
const P = zo();
|
|
840
840
|
return m.appendChild(P), m;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function qo(h) {
|
|
843
843
|
return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
|
|
844
844
|
}
|
|
845
845
|
var Je = { exports: {} }, Yo = Je.exports, Pn;
|
|
@@ -862,7 +862,7 @@ function $o() {
|
|
|
862
862
|
for (var e = 1; e < arguments.length; e++) {
|
|
863
863
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
864
864
|
e % 2 ? p(Object(n), !0).forEach((function(r) {
|
|
865
|
-
|
|
865
|
+
C(t, r, n[r]);
|
|
866
866
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : p(Object(n)).forEach((function(r) {
|
|
867
867
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
868
868
|
}));
|
|
@@ -888,10 +888,10 @@ function $o() {
|
|
|
888
888
|
function g(t, e, n) {
|
|
889
889
|
return e && w(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function C(t, e, n) {
|
|
892
892
|
return (e = N(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function S(t, e) {
|
|
895
895
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
896
896
|
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _(t, e);
|
|
897
897
|
}
|
|
@@ -905,11 +905,11 @@ function $o() {
|
|
|
905
905
|
return n.__proto__ = r, n;
|
|
906
906
|
}, _(t, e);
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function O(t) {
|
|
909
909
|
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
910
910
|
return t;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function I(t) {
|
|
913
913
|
var e = (function() {
|
|
914
914
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
915
915
|
if (typeof Proxy == "function") return !0;
|
|
@@ -929,12 +929,12 @@ function $o() {
|
|
|
929
929
|
return (function(i, a) {
|
|
930
930
|
if (a && (typeof a == "object" || typeof a == "function")) return a;
|
|
931
931
|
if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
932
|
-
return
|
|
932
|
+
return O(i);
|
|
933
933
|
})(this, n);
|
|
934
934
|
};
|
|
935
935
|
}
|
|
936
|
-
function
|
|
937
|
-
return
|
|
936
|
+
function W() {
|
|
937
|
+
return W = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
|
|
938
938
|
var r = (function(i, a) {
|
|
939
939
|
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i = k(i)) !== null; ) ;
|
|
940
940
|
return i;
|
|
@@ -943,7 +943,7 @@ function $o() {
|
|
|
943
943
|
var o = Object.getOwnPropertyDescriptor(r, e);
|
|
944
944
|
return o.get ? o.get.call(arguments.length < 3 ? t : n) : o.value;
|
|
945
945
|
}
|
|
946
|
-
},
|
|
946
|
+
}, W.apply(this, arguments);
|
|
947
947
|
}
|
|
948
948
|
function N(t) {
|
|
949
949
|
var e = (function(n, r) {
|
|
@@ -960,25 +960,25 @@ function $o() {
|
|
|
960
960
|
}
|
|
961
961
|
var P = function(t) {
|
|
962
962
|
return !(!t || !t.Window) && t instanceof t.Window;
|
|
963
|
-
}, H = void 0,
|
|
964
|
-
function
|
|
963
|
+
}, H = void 0, M = void 0;
|
|
964
|
+
function F(t) {
|
|
965
965
|
H = t;
|
|
966
966
|
var e = t.document.createTextNode("");
|
|
967
|
-
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)),
|
|
967
|
+
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), M = t;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
970
|
-
return P(t) ? t : (t.ownerDocument || t).defaultView ||
|
|
969
|
+
function $(t) {
|
|
970
|
+
return P(t) ? t : (t.ownerDocument || t).defaultView || M.window;
|
|
971
971
|
}
|
|
972
|
-
typeof window < "u" && window &&
|
|
973
|
-
var
|
|
972
|
+
typeof window < "u" && window && F(window);
|
|
973
|
+
var oe = function(t) {
|
|
974
974
|
return !!t && v(t) === "object";
|
|
975
|
-
},
|
|
975
|
+
}, X = function(t) {
|
|
976
976
|
return typeof t == "function";
|
|
977
|
-
},
|
|
978
|
-
return t ===
|
|
977
|
+
}, b = { window: function(t) {
|
|
978
|
+
return t === M || P(t);
|
|
979
979
|
}, docFrag: function(t) {
|
|
980
|
-
return
|
|
981
|
-
}, object:
|
|
980
|
+
return oe(t) && t.nodeType === 11;
|
|
981
|
+
}, object: oe, func: X, number: function(t) {
|
|
982
982
|
return typeof t == "number";
|
|
983
983
|
}, bool: function(t) {
|
|
984
984
|
return typeof t == "boolean";
|
|
@@ -986,12 +986,12 @@ function $o() {
|
|
|
986
986
|
return typeof t == "string";
|
|
987
987
|
}, element: function(t) {
|
|
988
988
|
if (!t || v(t) !== "object") return !1;
|
|
989
|
-
var e =
|
|
989
|
+
var e = $(t) || M;
|
|
990
990
|
return /object|function/.test(typeof Element > "u" ? "undefined" : v(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
|
|
991
991
|
}, plainObject: function(t) {
|
|
992
|
-
return
|
|
992
|
+
return oe(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
|
|
993
993
|
}, array: function(t) {
|
|
994
|
-
return
|
|
994
|
+
return oe(t) && t.length !== void 0 && X(t.splice);
|
|
995
995
|
} };
|
|
996
996
|
function ne(t) {
|
|
997
997
|
var e = t.interaction;
|
|
@@ -1000,7 +1000,7 @@ function $o() {
|
|
|
1000
1000
|
n === "x" ? (e.coords.cur.page.y = e.coords.start.page.y, e.coords.cur.client.y = e.coords.start.client.y, e.coords.velocity.client.y = 0, e.coords.velocity.page.y = 0) : n === "y" && (e.coords.cur.page.x = e.coords.start.page.x, e.coords.cur.client.x = e.coords.start.client.x, e.coords.velocity.client.x = 0, e.coords.velocity.page.x = 0);
|
|
1001
1001
|
}
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function B(t) {
|
|
1004
1004
|
var e = t.iEvent, n = t.interaction;
|
|
1005
1005
|
if (n.prepared.name === "drag") {
|
|
1006
1006
|
var r = n.prepared.axis;
|
|
@@ -1013,25 +1013,25 @@ function $o() {
|
|
|
1013
1013
|
var le = { id: "actions/drag", install: function(t) {
|
|
1014
1014
|
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
1015
1015
|
n.prototype.draggable = le.draggable, e.map.drag = le, e.methodDict.drag = "draggable", r.actions.drag = le.defaults;
|
|
1016
|
-
}, listeners: { "interactions:before-action-move": ne, "interactions:action-resume": ne, "interactions:action-move":
|
|
1016
|
+
}, listeners: { "interactions:before-action-move": ne, "interactions:action-resume": ne, "interactions:action-move": B, "auto-start:check": function(t) {
|
|
1017
1017
|
var e = t.interaction, n = t.interactable, r = t.buttons, o = n.options.drag;
|
|
1018
1018
|
if (o && o.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (r & n.options.drag.mouseButtons) != 0)) return t.action = { name: "drag", axis: o.lockAxis === "start" ? o.startAxis : o.lockAxis }, !1;
|
|
1019
1019
|
} }, draggable: function(t) {
|
|
1020
|
-
return
|
|
1021
|
-
}, beforeMove: ne, move:
|
|
1020
|
+
return b.object(t) ? (this.options.drag.enabled = t.enabled !== !1, this.setPerAction("drag", t), this.setOnEvents("drag", t), /^(xy|x|y|start)$/.test(t.lockAxis) && (this.options.drag.lockAxis = t.lockAxis), /^(xy|x|y)$/.test(t.startAxis) && (this.options.drag.startAxis = t.startAxis), this) : b.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
|
|
1021
|
+
}, beforeMove: ne, move: B, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
|
1022
1022
|
return "move";
|
|
1023
1023
|
}, filterEventType: function(t) {
|
|
1024
1024
|
return t.search("drag") === 0;
|
|
1025
|
-
} }, ce = le,
|
|
1025
|
+
} }, ce = le, Z = { init: function(t) {
|
|
1026
1026
|
var e = t;
|
|
1027
|
-
|
|
1027
|
+
Z.document = e.document, Z.DocumentFragment = e.DocumentFragment || ee, Z.SVGElement = e.SVGElement || ee, Z.SVGSVGElement = e.SVGSVGElement || ee, Z.SVGElementInstance = e.SVGElementInstance || ee, Z.Element = e.Element || ee, Z.HTMLElement = e.HTMLElement || Z.Element, Z.Event = e.Event, Z.Touch = e.Touch || ee, Z.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
1028
1028
|
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
1029
|
-
function
|
|
1029
|
+
function ee() {
|
|
1030
1030
|
}
|
|
1031
|
-
var
|
|
1032
|
-
var e =
|
|
1033
|
-
|
|
1034
|
-
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, re =
|
|
1031
|
+
var K = Z, ie = { init: function(t) {
|
|
1032
|
+
var e = K.Element, n = t.navigator || {};
|
|
1033
|
+
ie.supportsTouch = "ontouchstart" in t || b.func(t.DocumentTouch) && K.document instanceof t.DocumentTouch, ie.supportsPointerEvent = n.pointerEnabled !== !1 && !!K.PointerEvent, ie.isIOS = /iP(hone|od|ad)/.test(n.platform), ie.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), ie.isIe9 = /MSIE 9/.test(n.userAgent), ie.isOperaMobile = n.appName === "Opera" && ie.supportsTouch && /Presto/.test(n.userAgent), ie.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", ie.pEventTypes = ie.supportsPointerEvent ? K.PointerEvent === t.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, ie.wheelEvent = K.document && "onmousewheel" in K.document ? "mousewheel" : "wheel";
|
|
1034
|
+
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, re = ie;
|
|
1035
1035
|
function se(t, e) {
|
|
1036
1036
|
if (t.contains) return t.contains(e);
|
|
1037
1037
|
for (; e; ) {
|
|
@@ -1041,7 +1041,7 @@ function $o() {
|
|
|
1041
1041
|
return !1;
|
|
1042
1042
|
}
|
|
1043
1043
|
function pe(t, e) {
|
|
1044
|
-
for (;
|
|
1044
|
+
for (; b.element(t); ) {
|
|
1045
1045
|
if (he(t, e)) return t;
|
|
1046
1046
|
t = fe(t);
|
|
1047
1047
|
}
|
|
@@ -1049,40 +1049,40 @@ function $o() {
|
|
|
1049
1049
|
}
|
|
1050
1050
|
function fe(t) {
|
|
1051
1051
|
var e = t.parentNode;
|
|
1052
|
-
if (
|
|
1053
|
-
for (; (e = e.host) &&
|
|
1052
|
+
if (b.docFrag(e)) {
|
|
1053
|
+
for (; (e = e.host) && b.docFrag(e); ) ;
|
|
1054
1054
|
return e;
|
|
1055
1055
|
}
|
|
1056
1056
|
return e;
|
|
1057
1057
|
}
|
|
1058
1058
|
function he(t, e) {
|
|
1059
|
-
return
|
|
1059
|
+
return M !== H && (e = e.replace(/\/deep\//g, " ")), t[re.prefixedMatchesSelector](e);
|
|
1060
1060
|
}
|
|
1061
1061
|
var E = function(t) {
|
|
1062
1062
|
return t.parentNode || t.host;
|
|
1063
1063
|
};
|
|
1064
|
-
function
|
|
1064
|
+
function q(t, e) {
|
|
1065
1065
|
for (var n, r = [], o = t; (n = E(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
|
|
1066
1066
|
return r;
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1069
|
-
for (;
|
|
1068
|
+
function V(t, e, n) {
|
|
1069
|
+
for (; b.element(t); ) {
|
|
1070
1070
|
if (he(t, e)) return !0;
|
|
1071
1071
|
if ((t = fe(t)) === n) return he(t, e);
|
|
1072
1072
|
}
|
|
1073
1073
|
return !1;
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1075
|
+
function J(t) {
|
|
1076
1076
|
return t.correspondingUseElement || t;
|
|
1077
1077
|
}
|
|
1078
1078
|
function xe(t) {
|
|
1079
|
-
var e = t instanceof
|
|
1079
|
+
var e = t instanceof K.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
|
|
1080
1080
|
return e && { left: e.left, right: e.right, top: e.top, bottom: e.bottom, width: e.width || e.right - e.left, height: e.height || e.bottom - e.top };
|
|
1081
1081
|
}
|
|
1082
1082
|
function we(t) {
|
|
1083
1083
|
var e, n = xe(t);
|
|
1084
1084
|
if (!re.isIOS7 && n) {
|
|
1085
|
-
var r = { x: (e = (e =
|
|
1085
|
+
var r = { x: (e = (e = $(t)) || M).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
|
|
1086
1086
|
n.left += r.x, n.right += r.x, n.top += r.y, n.bottom += r.y;
|
|
1087
1087
|
}
|
|
1088
1088
|
return n;
|
|
@@ -1092,7 +1092,7 @@ function $o() {
|
|
|
1092
1092
|
return e;
|
|
1093
1093
|
}
|
|
1094
1094
|
function Ee(t) {
|
|
1095
|
-
return !!
|
|
1095
|
+
return !!b.string(t) && (K.document.querySelector(t), !0);
|
|
1096
1096
|
}
|
|
1097
1097
|
function z(t, e) {
|
|
1098
1098
|
for (var n in e) t[n] = e[n];
|
|
@@ -1103,7 +1103,7 @@ function $o() {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
function Le(t, e, n, r) {
|
|
1105
1105
|
var o = t;
|
|
1106
|
-
return
|
|
1106
|
+
return b.string(o) ? o = et(o, e, n) : b.func(o) && (o = o.apply(void 0, r)), b.element(o) && (o = we(o)), o;
|
|
1107
1107
|
}
|
|
1108
1108
|
function tt(t) {
|
|
1109
1109
|
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
@@ -1122,21 +1122,21 @@ function $o() {
|
|
|
1122
1122
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(l) {
|
|
1123
1123
|
return !0;
|
|
1124
1124
|
}, r = arguments.length > 3 ? arguments[3] : void 0;
|
|
1125
|
-
if (r = r || {},
|
|
1125
|
+
if (r = r || {}, b.string(t) && t.search(" ") !== -1 && (t = Wt(t)), b.array(t)) return t.forEach((function(l) {
|
|
1126
1126
|
return Ie(l, e, n, r);
|
|
1127
1127
|
})), r;
|
|
1128
|
-
if (
|
|
1129
|
-
else if (
|
|
1128
|
+
if (b.object(t) && (e = t, t = ""), b.func(e) && n(t)) r[t] = r[t] || [], r[t].push(e);
|
|
1129
|
+
else if (b.array(e)) for (var o = 0, i = e; o < i.length; o++) {
|
|
1130
1130
|
var a = i[o];
|
|
1131
1131
|
Ie(t, a, n, r);
|
|
1132
1132
|
}
|
|
1133
|
-
else if (
|
|
1134
|
-
Ie(
|
|
1133
|
+
else if (b.object(e)) for (var s in e)
|
|
1134
|
+
Ie(Wt(s).map((function(l) {
|
|
1135
1135
|
return "".concat(t).concat(l);
|
|
1136
1136
|
})), e[s], n, r);
|
|
1137
1137
|
return r;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Wt(t) {
|
|
1140
1140
|
return t.trim().split(/ +/);
|
|
1141
1141
|
}
|
|
1142
1142
|
var Fe = function(t, e) {
|
|
@@ -1160,30 +1160,30 @@ function $o() {
|
|
|
1160
1160
|
function ot(t, e) {
|
|
1161
1161
|
t.page = t.page || {}, t.page.x = e.page.x, t.page.y = e.page.y, t.client = t.client || {}, t.client.x = e.client.x, t.client.y = e.client.y, t.timeStamp = e.timeStamp;
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function Bt(t) {
|
|
1164
1164
|
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1167
|
-
return t instanceof
|
|
1166
|
+
function qt(t) {
|
|
1167
|
+
return t instanceof K.Event || t instanceof K.Touch;
|
|
1168
1168
|
}
|
|
1169
1169
|
function it(t, e, n) {
|
|
1170
1170
|
return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
|
|
1171
1171
|
}
|
|
1172
1172
|
function Yt(t, e) {
|
|
1173
|
-
return e = e || { x: 0, y: 0 }, re.isOperaMobile &&
|
|
1173
|
+
return e = e || { x: 0, y: 0 }, re.isOperaMobile && qt(t) ? (it("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : it("page", t, e), e;
|
|
1174
1174
|
}
|
|
1175
1175
|
function je(t) {
|
|
1176
|
-
return
|
|
1176
|
+
return b.number(t.pointerId) ? t.pointerId : t.identifier;
|
|
1177
1177
|
}
|
|
1178
1178
|
function Hn(t, e, n) {
|
|
1179
1179
|
var r = e.length > 1 ? $t(e) : e[0];
|
|
1180
1180
|
Yt(r, t.page), (function(o, i) {
|
|
1181
|
-
i = i || {}, re.isOperaMobile &&
|
|
1181
|
+
i = i || {}, re.isOperaMobile && qt(o) ? it("screen", o, i) : it("client", o, i);
|
|
1182
1182
|
})(r, t.client), t.timeStamp = n;
|
|
1183
1183
|
}
|
|
1184
1184
|
function yt(t) {
|
|
1185
1185
|
var e = [];
|
|
1186
|
-
return
|
|
1186
|
+
return b.array(t) ? (e[0] = t[0], e[1] = t[1]) : t.type === "touchend" ? t.touches.length === 1 ? (e[0] = t.touches[0], e[1] = t.changedTouches[0]) : t.touches.length === 0 && (e[0] = t.changedTouches[0], e[1] = t.changedTouches[1]) : (e[0] = t.touches[0], e[1] = t.touches[1]), e;
|
|
1187
1187
|
}
|
|
1188
1188
|
function $t(t) {
|
|
1189
1189
|
for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n = 0; n < t.length; n++) {
|
|
@@ -1207,11 +1207,11 @@ function $o() {
|
|
|
1207
1207
|
return 180 * Math.atan2(a, i) / Math.PI;
|
|
1208
1208
|
}
|
|
1209
1209
|
function Vt(t) {
|
|
1210
|
-
return
|
|
1210
|
+
return b.string(t.pointerType) ? t.pointerType : b.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof K.Touch ? "touch" : "mouse";
|
|
1211
1211
|
}
|
|
1212
1212
|
function Ut(t) {
|
|
1213
|
-
var e =
|
|
1214
|
-
return [
|
|
1213
|
+
var e = b.func(t.composedPath) ? t.composedPath() : t.path;
|
|
1214
|
+
return [J(e ? e[0] : t.target), J(t.currentTarget)];
|
|
1215
1215
|
}
|
|
1216
1216
|
var at = (function() {
|
|
1217
1217
|
function t(e) {
|
|
@@ -1239,11 +1239,11 @@ function $o() {
|
|
|
1239
1239
|
}, He = function(t, e) {
|
|
1240
1240
|
for (var n = 0; n < t.length; n++) if (e(t[n], n, t)) return n;
|
|
1241
1241
|
return -1;
|
|
1242
|
-
},
|
|
1242
|
+
}, We = function(t, e) {
|
|
1243
1243
|
return t[He(t, e)];
|
|
1244
|
-
},
|
|
1245
|
-
|
|
1246
|
-
var e =
|
|
1244
|
+
}, Oe = (function(t) {
|
|
1245
|
+
S(n, t);
|
|
1246
|
+
var e = I(n);
|
|
1247
1247
|
function n(r, o, i) {
|
|
1248
1248
|
var a;
|
|
1249
1249
|
y(this, n), (a = e.call(this, o._interaction)).dropzone = void 0, a.dragEvent = void 0, a.relatedTarget = void 0, a.draggable = void 0, a.propagationStopped = !1, a.immediatePropagationStopped = !1;
|
|
@@ -1280,9 +1280,9 @@ function $o() {
|
|
|
1280
1280
|
var c = d[l];
|
|
1281
1281
|
if (c.options.drop.enabled) {
|
|
1282
1282
|
var f = c.options.drop.accept;
|
|
1283
|
-
if (!(
|
|
1284
|
-
var
|
|
1285
|
-
|
|
1283
|
+
if (!(b.element(f) && f !== a || b.string(f) && !he(a, f) || b.func(f) && !f({ dropzone: c, draggableElement: a }))) for (var x = 0, A = c.getAllElements(); x < A.length; x++) {
|
|
1284
|
+
var T = A[x];
|
|
1285
|
+
T !== a && s.push({ dropzone: c, element: T, rect: c.getRect(T) });
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
@@ -1295,42 +1295,42 @@ function $o() {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
function Jt(t, e, n) {
|
|
1297
1297
|
for (var r = t.dropState, o = t.interactable, i = t.element, a = [], s = 0, l = r.activeDrops; s < l.length; s++) {
|
|
1298
|
-
var d = l[s], c = d.dropzone, f = d.element,
|
|
1299
|
-
a.push(
|
|
1300
|
-
}
|
|
1301
|
-
var
|
|
1302
|
-
for (var
|
|
1303
|
-
var
|
|
1304
|
-
if (
|
|
1305
|
-
var ve = E(
|
|
1306
|
-
if (ve !==
|
|
1307
|
-
|
|
1298
|
+
var d = l[s], c = d.dropzone, f = d.element, x = d.rect, A = c.dropCheck(e, n, o, i, f, x);
|
|
1299
|
+
a.push(A ? f : null);
|
|
1300
|
+
}
|
|
1301
|
+
var T = (function(R) {
|
|
1302
|
+
for (var L, D, j, G = [], te = 0; te < R.length; te++) {
|
|
1303
|
+
var Y = R[te], Q = R[L];
|
|
1304
|
+
if (Y && te !== L) if (Q) {
|
|
1305
|
+
var ve = E(Y), ae = E(Q);
|
|
1306
|
+
if (ve !== Y.ownerDocument) if (ae !== Y.ownerDocument) if (ve !== ae) {
|
|
1307
|
+
G = G.length ? G : q(Q);
|
|
1308
1308
|
var ge = void 0;
|
|
1309
|
-
if (
|
|
1310
|
-
if (
|
|
1311
|
-
ge =
|
|
1312
|
-
} else ge =
|
|
1313
|
-
for (var be =
|
|
1314
|
-
var mt = [be[Se - 1], be[Se],
|
|
1309
|
+
if (Q instanceof K.HTMLElement && Y instanceof K.SVGElement && !(Y instanceof K.SVGSVGElement)) {
|
|
1310
|
+
if (Y === ae) continue;
|
|
1311
|
+
ge = Y.ownerSVGElement;
|
|
1312
|
+
} else ge = Y;
|
|
1313
|
+
for (var be = q(ge, Q.ownerDocument), Se = 0; be[Se] && be[Se] === G[Se]; ) Se++;
|
|
1314
|
+
var mt = [be[Se - 1], be[Se], G[Se]];
|
|
1315
1315
|
if (mt[0]) for (var Ue = mt[0].lastChild; Ue; ) {
|
|
1316
1316
|
if (Ue === mt[1]) {
|
|
1317
|
-
|
|
1317
|
+
L = te, G = be;
|
|
1318
1318
|
break;
|
|
1319
1319
|
}
|
|
1320
1320
|
if (Ue === mt[2]) break;
|
|
1321
1321
|
Ue = Ue.previousSibling;
|
|
1322
1322
|
}
|
|
1323
|
-
} else
|
|
1324
|
-
else
|
|
1325
|
-
} else
|
|
1323
|
+
} else j = Q, (parseInt($(D = Y).getComputedStyle(D).zIndex, 10) || 0) >= (parseInt($(j).getComputedStyle(j).zIndex, 10) || 0) && (L = te);
|
|
1324
|
+
else L = te;
|
|
1325
|
+
} else L = te;
|
|
1326
1326
|
}
|
|
1327
|
-
return
|
|
1327
|
+
return L;
|
|
1328
1328
|
})(a);
|
|
1329
|
-
return r.activeDrops[
|
|
1329
|
+
return r.activeDrops[T] || null;
|
|
1330
1330
|
}
|
|
1331
1331
|
function kt(t, e, n) {
|
|
1332
1332
|
var r = t.dropState, o = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
|
|
1333
|
-
return n.type === "dragstart" && (o.activate = new
|
|
1333
|
+
return n.type === "dragstart" && (o.activate = new Oe(r, n, "dropactivate"), o.activate.target = null, o.activate.dropzone = null), n.type === "dragend" && (o.deactivate = new Oe(r, n, "dropdeactivate"), o.deactivate.target = null, o.deactivate.dropzone = null), r.rejected || (r.cur.element !== r.prev.element && (r.prev.dropzone && (o.leave = new Oe(r, n, "dragleave"), n.dragLeave = o.leave.target = r.prev.element, n.prevDropzone = o.leave.dropzone = r.prev.dropzone), r.cur.dropzone && (o.enter = new Oe(r, n, "dragenter"), n.dragEnter = r.cur.element, n.dropzone = r.cur.dropzone)), n.type === "dragend" && r.cur.dropzone && (o.drop = new Oe(r, n, "drop"), n.dropzone = r.cur.dropzone, n.relatedTarget = r.cur.element), n.type === "dragmove" && r.cur.dropzone && (o.move = new Oe(r, n, "dropmove"), n.dropzone = r.cur.dropzone)), o;
|
|
1334
1334
|
}
|
|
1335
1335
|
function Ct(t, e) {
|
|
1336
1336
|
var n = t.dropState, r = n.activeDrops, o = n.cur, i = n.prev;
|
|
@@ -1349,37 +1349,37 @@ function $o() {
|
|
|
1349
1349
|
var e = t.actions, n = t.interactStatic, r = t.Interactable, o = t.defaults;
|
|
1350
1350
|
t.usePlugin(ce), r.prototype.dropzone = function(i) {
|
|
1351
1351
|
return (function(a, s) {
|
|
1352
|
-
if (
|
|
1352
|
+
if (b.object(s)) {
|
|
1353
1353
|
if (a.options.drop.enabled = s.enabled !== !1, s.listeners) {
|
|
1354
|
-
var l = Ie(s.listeners), d = Object.keys(l).reduce((function(f,
|
|
1355
|
-
return f[/^(enter|leave)/.test(
|
|
1354
|
+
var l = Ie(s.listeners), d = Object.keys(l).reduce((function(f, x) {
|
|
1355
|
+
return f[/^(enter|leave)/.test(x) ? "drag".concat(x) : /^(activate|deactivate|move)/.test(x) ? "drop".concat(x) : x] = l[x], f;
|
|
1356
1356
|
}), {}), c = a.options.drop.listeners;
|
|
1357
1357
|
c && a.off(c), a.on(d), a.options.drop.listeners = d;
|
|
1358
1358
|
}
|
|
1359
|
-
return
|
|
1359
|
+
return b.func(s.ondrop) && a.on("drop", s.ondrop), b.func(s.ondropactivate) && a.on("dropactivate", s.ondropactivate), b.func(s.ondropdeactivate) && a.on("dropdeactivate", s.ondropdeactivate), b.func(s.ondragenter) && a.on("dragenter", s.ondragenter), b.func(s.ondragleave) && a.on("dragleave", s.ondragleave), b.func(s.ondropmove) && a.on("dropmove", s.ondropmove), /^(pointer|center)$/.test(s.overlap) ? a.options.drop.overlap = s.overlap : b.number(s.overlap) && (a.options.drop.overlap = Math.max(Math.min(1, s.overlap), 0)), "accept" in s && (a.options.drop.accept = s.accept), "checker" in s && (a.options.drop.checker = s.checker), a;
|
|
1360
1360
|
}
|
|
1361
|
-
return
|
|
1361
|
+
return b.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
1362
1362
|
})(this, i);
|
|
1363
1363
|
}, r.prototype.dropCheck = function(i, a, s, l, d, c) {
|
|
1364
|
-
return (function(f,
|
|
1365
|
-
var
|
|
1366
|
-
if (!(
|
|
1367
|
-
var
|
|
1368
|
-
if (
|
|
1369
|
-
var
|
|
1370
|
-
|
|
1371
|
-
var
|
|
1372
|
-
|
|
1364
|
+
return (function(f, x, A, T, R, L, D) {
|
|
1365
|
+
var j = !1;
|
|
1366
|
+
if (!(D = D || f.getRect(L))) return !!f.options.drop.checker && f.options.drop.checker(x, A, j, f, L, T, R);
|
|
1367
|
+
var G = f.options.drop.overlap;
|
|
1368
|
+
if (G === "pointer") {
|
|
1369
|
+
var te = ze(T, R, "drag"), Y = Yt(x);
|
|
1370
|
+
Y.x += te.x, Y.y += te.y;
|
|
1371
|
+
var Q = Y.x > D.left && Y.x < D.right, ve = Y.y > D.top && Y.y < D.bottom;
|
|
1372
|
+
j = Q && ve;
|
|
1373
1373
|
}
|
|
1374
|
-
var ae =
|
|
1375
|
-
if (ae &&
|
|
1374
|
+
var ae = T.getRect(R);
|
|
1375
|
+
if (ae && G === "center") {
|
|
1376
1376
|
var ge = ae.left + ae.width / 2, be = ae.top + ae.height / 2;
|
|
1377
|
-
|
|
1377
|
+
j = ge >= D.left && ge <= D.right && be >= D.top && be <= D.bottom;
|
|
1378
1378
|
}
|
|
1379
|
-
return ae &&
|
|
1379
|
+
return ae && b.number(G) && (j = Math.max(0, Math.min(D.right, ae.right) - Math.max(D.left, ae.left)) * Math.max(0, Math.min(D.bottom, ae.bottom) - Math.max(D.top, ae.top)) / (ae.width * ae.height) >= G), f.options.drop.checker && (j = f.options.drop.checker(x, A, j, f, L, T, R)), j;
|
|
1380
1380
|
})(this, i, a, s, l, d, c);
|
|
1381
1381
|
}, n.dynamicDrop = function(i) {
|
|
1382
|
-
return
|
|
1382
|
+
return b.bool(i) ? (t.dynamicDrop = i, n) : t.dynamicDrop;
|
|
1383
1383
|
}, z(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, o.actions.drop = Zt.defaults;
|
|
1384
1384
|
}, listeners: { "interactions:before-action-start": function(t) {
|
|
1385
1385
|
var e = t.interaction;
|
|
@@ -1409,7 +1409,7 @@ function $o() {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
} }, getActiveDrops: Et, getDrop: Jt, getDropEvents: kt, fireDropEvents: Ct, filterEventType: function(t) {
|
|
1411
1411
|
return t.search("drag") === 0 || t.search("drop") === 0;
|
|
1412
|
-
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } },
|
|
1412
|
+
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Wn = Zt;
|
|
1413
1413
|
function St(t) {
|
|
1414
1414
|
var e = t.interaction, n = t.iEvent, r = t.phase;
|
|
1415
1415
|
if (e.prepared.name === "gesture") {
|
|
@@ -1421,13 +1421,13 @@ function $o() {
|
|
|
1421
1421
|
var l = e.prevEvent;
|
|
1422
1422
|
n.distance = l.distance, n.box = l.box, n.scale = l.scale, n.ds = 0, n.angle = l.angle, n.da = 0;
|
|
1423
1423
|
} else n.distance = xt(o, s), n.box = bt(o), n.scale = n.distance / e.gesture.startDistance, n.angle = wt(o, s), n.ds = n.scale - e.gesture.scale, n.da = n.angle - e.gesture.angle;
|
|
1424
|
-
e.gesture.distance = n.distance, e.gesture.angle = n.angle,
|
|
1424
|
+
e.gesture.distance = n.distance, e.gesture.angle = n.angle, b.number(n.scale) && n.scale !== 1 / 0 && !isNaN(n.scale) && (e.gesture.scale = n.scale);
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
var Tt = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
|
|
1428
1428
|
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
1429
1429
|
n.prototype.gesturable = function(o) {
|
|
1430
|
-
return
|
|
1430
|
+
return b.object(o) ? (this.options.gesture.enabled = o.enabled !== !1, this.setPerAction("gesture", o), this.setOnEvents("gesture", o), this) : b.bool(o) ? (this.options.gesture.enabled = o, this) : this.options.gesture;
|
|
1431
1431
|
}, e.map.gesture = Tt, e.methodDict.gesture = "gesturable", r.actions.gesture = Tt.defaults;
|
|
1432
1432
|
}, listeners: { "interactions:action-start": St, "interactions:action-move": St, "interactions:action-end": St, "interactions:new": function(t) {
|
|
1433
1433
|
t.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
|
|
@@ -1440,11 +1440,11 @@ function $o() {
|
|
|
1440
1440
|
return "";
|
|
1441
1441
|
}, filterEventType: function(t) {
|
|
1442
1442
|
return t.search("gesture") === 0;
|
|
1443
|
-
} },
|
|
1444
|
-
function
|
|
1443
|
+
} }, Bn = Tt;
|
|
1444
|
+
function qn(t, e, n, r, o, i, a) {
|
|
1445
1445
|
if (!e) return !1;
|
|
1446
1446
|
if (e === !0) {
|
|
1447
|
-
var s =
|
|
1447
|
+
var s = b.number(i.width) ? i.width : i.right - i.left, l = b.number(i.height) ? i.height : i.bottom - i.top;
|
|
1448
1448
|
if (a = Math.min(a, Math.abs((t === "left" || t === "right" ? s : l) / 2)), s < 0 && (t === "left" ? t = "right" : t === "right" && (t = "left")), l < 0 && (t === "top" ? t = "bottom" : t === "bottom" && (t = "top")), t === "left") {
|
|
1449
1449
|
var d = s >= 0 ? i.left : i.right;
|
|
1450
1450
|
return n.x < d + a;
|
|
@@ -1456,7 +1456,7 @@ function $o() {
|
|
|
1456
1456
|
if (t === "right") return n.x > (s >= 0 ? i.right : i.left) - a;
|
|
1457
1457
|
if (t === "bottom") return n.y > (l >= 0 ? i.bottom : i.top) - a;
|
|
1458
1458
|
}
|
|
1459
|
-
return !!
|
|
1459
|
+
return !!b.element(r) && (b.element(e) ? e === r : V(r, e, o));
|
|
1460
1460
|
}
|
|
1461
1461
|
function en(t) {
|
|
1462
1462
|
var e = t.iEvent, n = t.interaction;
|
|
@@ -1471,7 +1471,7 @@ function $o() {
|
|
|
1471
1471
|
return i.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
|
|
1472
1472
|
})(n), Ce.defaultMargin = n.supportsTouch || n.supportsPointerEvent ? 20 : 10, r.prototype.resizable = function(i) {
|
|
1473
1473
|
return (function(a, s, l) {
|
|
1474
|
-
return
|
|
1474
|
+
return b.object(s) ? (a.options.resize.enabled = s.enabled !== !1, a.setPerAction("resize", s), a.setOnEvents("resize", s), b.string(s.axis) && /^x$|^y$|^xy$/.test(s.axis) ? a.options.resize.axis = s.axis : s.axis === null && (a.options.resize.axis = l.defaults.actions.resize.axis), b.bool(s.preserveAspectRatio) ? a.options.resize.preserveAspectRatio = s.preserveAspectRatio : b.bool(s.square) && (a.options.resize.square = s.square), a) : b.bool(s) ? (a.options.resize.enabled = s, a) : a.options.resize;
|
|
1475
1475
|
})(this, i, t);
|
|
1476
1476
|
}, e.map.resize = Ce, e.methodDict.resize = "resizable", o.actions.resize = Ce.defaults;
|
|
1477
1477
|
}, listeners: { "interactions:new": function(t) {
|
|
@@ -1488,20 +1488,20 @@ function $o() {
|
|
|
1488
1488
|
(function(e) {
|
|
1489
1489
|
var n = e.iEvent, r = e.interaction;
|
|
1490
1490
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1491
|
-
var o = n, i = r.interactable.options.resize.invert, a = i === "reposition" || i === "negate", s = r.rect, l = r._rects, d = l.start, c = l.corrected, f = l.delta,
|
|
1492
|
-
if (z(
|
|
1491
|
+
var o = n, i = r.interactable.options.resize.invert, a = i === "reposition" || i === "negate", s = r.rect, l = r._rects, d = l.start, c = l.corrected, f = l.delta, x = l.previous;
|
|
1492
|
+
if (z(x, c), a) {
|
|
1493
1493
|
if (z(c, s), i === "reposition") {
|
|
1494
1494
|
if (c.top > c.bottom) {
|
|
1495
|
-
var
|
|
1496
|
-
c.top = c.bottom, c.bottom =
|
|
1495
|
+
var A = c.top;
|
|
1496
|
+
c.top = c.bottom, c.bottom = A;
|
|
1497
1497
|
}
|
|
1498
1498
|
if (c.left > c.right) {
|
|
1499
|
-
var
|
|
1500
|
-
c.left = c.right, c.right =
|
|
1499
|
+
var T = c.left;
|
|
1500
|
+
c.left = c.right, c.right = T;
|
|
1501
1501
|
}
|
|
1502
1502
|
}
|
|
1503
1503
|
} else c.top = Math.min(s.top, d.bottom), c.bottom = Math.max(s.bottom, d.top), c.left = Math.min(s.left, d.right), c.right = Math.max(s.right, d.left);
|
|
1504
|
-
for (var
|
|
1504
|
+
for (var R in c.width = c.right - c.left, c.height = c.bottom - c.top, c) f[R] = c[R] - x[R];
|
|
1505
1505
|
o.edges = r.prepared.edges, o.rect = c, o.deltaRect = f;
|
|
1506
1506
|
}
|
|
1507
1507
|
})(t), en(t);
|
|
@@ -1516,9 +1516,9 @@ function $o() {
|
|
|
1516
1516
|
if (o) {
|
|
1517
1517
|
var a = z({}, e.coords.cur.page), s = n.options.resize;
|
|
1518
1518
|
if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (i & s.mouseButtons) != 0)) {
|
|
1519
|
-
if (
|
|
1519
|
+
if (b.object(s.edges)) {
|
|
1520
1520
|
var l = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1521
|
-
for (var d in l) l[d] =
|
|
1521
|
+
for (var d in l) l[d] = qn(d, s.edges[d], a, e._latestPointer.eventTarget, r, o, s.margin || Ce.defaultMargin);
|
|
1522
1522
|
l.left = l.left && !l.right, l.top = l.top && !l.bottom, (l.left || l.right || l.top || l.bottom) && (t.action = { name: "resize", edges: l });
|
|
1523
1523
|
} else {
|
|
1524
1524
|
var c = s.axis !== "y" && a.x > o.right - Ce.defaultMargin, f = s.axis !== "x" && a.y > o.bottom - Ce.defaultMargin;
|
|
@@ -1541,7 +1541,7 @@ function $o() {
|
|
|
1541
1541
|
}, filterEventType: function(t) {
|
|
1542
1542
|
return t.search("resize") === 0;
|
|
1543
1543
|
}, defaultMargin: null }, Yn = Ce, $n = { id: "actions", install: function(t) {
|
|
1544
|
-
t.usePlugin(
|
|
1544
|
+
t.usePlugin(Bn), t.usePlugin(Yn), t.usePlugin(ce), t.usePlugin(Wn);
|
|
1545
1545
|
} }, tn = 0, Te = { request: function(t) {
|
|
1546
1546
|
return ke(t);
|
|
1547
1547
|
}, cancel: function(t) {
|
|
@@ -1559,83 +1559,83 @@ function $o() {
|
|
|
1559
1559
|
}, Pe = function(o) {
|
|
1560
1560
|
return clearTimeout(o);
|
|
1561
1561
|
});
|
|
1562
|
-
} },
|
|
1563
|
-
|
|
1562
|
+
} }, U = { defaults: { enabled: !1, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: !1, prevTime: 0, margin: 0, speed: 0, start: function(t) {
|
|
1563
|
+
U.isScrolling = !0, Te.cancel(U.i), t.autoScroll = U, U.interaction = t, U.prevTime = U.now(), U.i = Te.request(U.scroll);
|
|
1564
1564
|
}, stop: function() {
|
|
1565
|
-
|
|
1565
|
+
U.isScrolling = !1, U.interaction && (U.interaction.autoScroll = null), Te.cancel(U.i);
|
|
1566
1566
|
}, scroll: function() {
|
|
1567
|
-
var t =
|
|
1567
|
+
var t = U.interaction, e = t.interactable, n = t.element, r = t.prepared.name, o = e.options[r].autoScroll, i = nn(o.container, e, n), a = U.now(), s = (a - U.prevTime) / 1e3, l = o.speed * s;
|
|
1568
1568
|
if (l >= 1) {
|
|
1569
|
-
var d = { x:
|
|
1569
|
+
var d = { x: U.x * l, y: U.y * l };
|
|
1570
1570
|
if (d.x || d.y) {
|
|
1571
1571
|
var c = rn(i);
|
|
1572
|
-
|
|
1573
|
-
var f = rn(i),
|
|
1574
|
-
(
|
|
1572
|
+
b.window(i) ? i.scrollBy(d.x, d.y) : i && (i.scrollLeft += d.x, i.scrollTop += d.y);
|
|
1573
|
+
var f = rn(i), x = { x: f.x - c.x, y: f.y - c.y };
|
|
1574
|
+
(x.x || x.y) && e.fire({ type: "autoscroll", target: n, interactable: e, delta: x, interaction: t, container: i });
|
|
1575
1575
|
}
|
|
1576
|
-
|
|
1576
|
+
U.prevTime = a;
|
|
1577
1577
|
}
|
|
1578
|
-
|
|
1578
|
+
U.isScrolling && (Te.cancel(U.i), U.i = Te.request(U.scroll));
|
|
1579
1579
|
}, check: function(t, e) {
|
|
1580
1580
|
var n;
|
|
1581
1581
|
return (n = t.options[e].autoScroll) == null ? void 0 : n.enabled;
|
|
1582
1582
|
}, onInteractionMove: function(t) {
|
|
1583
1583
|
var e = t.interaction, n = t.pointer;
|
|
1584
|
-
if (e.interacting() &&
|
|
1584
|
+
if (e.interacting() && U.check(e.interactable, e.prepared.name)) if (e.simulation) U.x = U.y = 0;
|
|
1585
1585
|
else {
|
|
1586
1586
|
var r, o, i, a, s = e.interactable, l = e.element, d = e.prepared.name, c = s.options[d].autoScroll, f = nn(c.container, s, l);
|
|
1587
|
-
if (
|
|
1587
|
+
if (b.window(f)) a = n.clientX < U.margin, r = n.clientY < U.margin, o = n.clientX > f.innerWidth - U.margin, i = n.clientY > f.innerHeight - U.margin;
|
|
1588
1588
|
else {
|
|
1589
|
-
var
|
|
1590
|
-
a = n.clientX <
|
|
1589
|
+
var x = xe(f);
|
|
1590
|
+
a = n.clientX < x.left + U.margin, r = n.clientY < x.top + U.margin, o = n.clientX > x.right - U.margin, i = n.clientY > x.bottom - U.margin;
|
|
1591
1591
|
}
|
|
1592
|
-
|
|
1592
|
+
U.x = o ? 1 : a ? -1 : 0, U.y = i ? 1 : r ? -1 : 0, U.isScrolling || (U.margin = c.margin, U.speed = c.speed, U.start(e));
|
|
1593
1593
|
}
|
|
1594
1594
|
} };
|
|
1595
1595
|
function nn(t, e, n) {
|
|
1596
|
-
return (
|
|
1596
|
+
return (b.string(t) ? et(t, e, n) : t) || $(n);
|
|
1597
1597
|
}
|
|
1598
1598
|
function rn(t) {
|
|
1599
|
-
return
|
|
1599
|
+
return b.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
|
|
1600
1600
|
}
|
|
1601
1601
|
var Vn = { id: "auto-scroll", install: function(t) {
|
|
1602
1602
|
var e = t.defaults, n = t.actions;
|
|
1603
|
-
t.autoScroll =
|
|
1603
|
+
t.autoScroll = U, U.now = function() {
|
|
1604
1604
|
return t.now();
|
|
1605
|
-
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll =
|
|
1605
|
+
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll = U.defaults;
|
|
1606
1606
|
}, listeners: { "interactions:new": function(t) {
|
|
1607
1607
|
t.interaction.autoScroll = null;
|
|
1608
1608
|
}, "interactions:destroy": function(t) {
|
|
1609
|
-
t.interaction.autoScroll = null,
|
|
1610
|
-
}, "interactions:stop":
|
|
1611
|
-
return
|
|
1609
|
+
t.interaction.autoScroll = null, U.stop(), U.interaction && (U.interaction = null);
|
|
1610
|
+
}, "interactions:stop": U.stop, "interactions:action-move": function(t) {
|
|
1611
|
+
return U.onInteractionMove(t);
|
|
1612
1612
|
} } }, Un = Vn;
|
|
1613
|
-
function
|
|
1613
|
+
function Be(t, e) {
|
|
1614
1614
|
var n = !1;
|
|
1615
1615
|
return function() {
|
|
1616
|
-
return n || (
|
|
1616
|
+
return n || (M.console.warn(e), n = !0), t.apply(this, arguments);
|
|
1617
1617
|
};
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function At(t, e) {
|
|
1620
1620
|
return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t;
|
|
1621
1621
|
}
|
|
1622
1622
|
function Xn(t) {
|
|
1623
|
-
return
|
|
1623
|
+
return b.bool(t) ? (this.options.styleCursor = t, this) : t === null ? (delete this.options.styleCursor, this) : this.options.styleCursor;
|
|
1624
1624
|
}
|
|
1625
1625
|
function Gn(t) {
|
|
1626
|
-
return
|
|
1626
|
+
return b.func(t) ? (this.options.actionChecker = t, this) : t === null ? (delete this.options.actionChecker, this) : this.options.actionChecker;
|
|
1627
1627
|
}
|
|
1628
1628
|
var Kn = { id: "auto-start/interactableMethods", install: function(t) {
|
|
1629
1629
|
var e = t.Interactable;
|
|
1630
1630
|
e.prototype.getAction = function(n, r, o, i) {
|
|
1631
1631
|
var a = (function(s, l, d, c, f) {
|
|
1632
|
-
var
|
|
1633
|
-
return f.fire("auto-start:check",
|
|
1632
|
+
var x = s.getRect(c), A = l.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[l.button], T = { action: null, interactable: s, interaction: d, element: c, rect: x, buttons: A };
|
|
1633
|
+
return f.fire("auto-start:check", T), T.action;
|
|
1634
1634
|
})(this, r, o, i, t);
|
|
1635
1635
|
return this.options.actionChecker ? this.options.actionChecker(n, r, a, this, i, o) : a;
|
|
1636
|
-
}, e.prototype.ignoreFrom =
|
|
1636
|
+
}, e.prototype.ignoreFrom = Be((function(n) {
|
|
1637
1637
|
return this._backCompatOption("ignoreFrom", n);
|
|
1638
|
-
}), "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e.prototype.allowFrom =
|
|
1638
|
+
}), "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e.prototype.allowFrom = Be((function(n) {
|
|
1639
1639
|
return this._backCompatOption("allowFrom", n);
|
|
1640
1640
|
}), "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e.prototype.actionChecker = Gn, e.prototype.styleCursor = Xn;
|
|
1641
1641
|
} };
|
|
@@ -1646,8 +1646,8 @@ function $o() {
|
|
|
1646
1646
|
for (var s = 0, l = r.length; s < l; s++) {
|
|
1647
1647
|
var d = r[s], c = o[s], f = d.getAction(e, n, t, c);
|
|
1648
1648
|
if (f) {
|
|
1649
|
-
var
|
|
1650
|
-
if (
|
|
1649
|
+
var x = on(f, d, c, i, a);
|
|
1650
|
+
if (x) return { action: x, interactable: d, element: c };
|
|
1651
1651
|
}
|
|
1652
1652
|
}
|
|
1653
1653
|
return { action: null, interactable: null, element: null };
|
|
@@ -1657,7 +1657,7 @@ function $o() {
|
|
|
1657
1657
|
function l(c) {
|
|
1658
1658
|
i.push(c), a.push(s);
|
|
1659
1659
|
}
|
|
1660
|
-
for (;
|
|
1660
|
+
for (; b.element(s); ) {
|
|
1661
1661
|
i = [], a = [], o.interactables.forEachMatch(s, l);
|
|
1662
1662
|
var d = Jn(t, e, n, i, a, r, o);
|
|
1663
1663
|
if (d.action && !d.interactable.options[d.action.name].manualStart) return d;
|
|
@@ -1667,22 +1667,22 @@ function $o() {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
function sn(t, e, n) {
|
|
1669
1669
|
var r = e.action, o = e.interactable, i = e.element;
|
|
1670
|
-
r = r || { name: null }, t.interactable = o, t.element = i,
|
|
1670
|
+
r = r || { name: null }, t.interactable = o, t.element = i, At(t.prepared, r), t.rect = o && r.name ? o.getRect(i) : null, cn(t, n), n.fire("autoStart:prepared", { interaction: t });
|
|
1671
1671
|
}
|
|
1672
1672
|
function st(t, e, n, r) {
|
|
1673
1673
|
var o = t.options, i = o[n.name].max, a = o[n.name].maxPerElement, s = r.autoStart.maxInteractions, l = 0, d = 0, c = 0;
|
|
1674
1674
|
if (!(i && a && s)) return !1;
|
|
1675
|
-
for (var f = 0,
|
|
1676
|
-
var
|
|
1677
|
-
if (
|
|
1675
|
+
for (var f = 0, x = r.interactions.list; f < x.length; f++) {
|
|
1676
|
+
var A = x[f], T = A.prepared.name;
|
|
1677
|
+
if (A.interacting() && (++l >= s || A.interactable === t && ((d += T === n.name ? 1 : 0) >= i || A.element === e && (c++, T === n.name && c >= a))))
|
|
1678
1678
|
return !1;
|
|
1679
1679
|
}
|
|
1680
1680
|
return s > 0;
|
|
1681
1681
|
}
|
|
1682
1682
|
function ln(t, e) {
|
|
1683
|
-
return
|
|
1683
|
+
return b.number(t) ? (e.autoStart.maxInteractions = t, this) : e.autoStart.maxInteractions;
|
|
1684
1684
|
}
|
|
1685
|
-
function
|
|
1685
|
+
function _t(t, e, n) {
|
|
1686
1686
|
var r = n.autoStart.cursorElement;
|
|
1687
1687
|
r && r !== t && (r.style.cursor = ""), t.ownerDocument.documentElement.style.cursor = e, t.style.cursor = e, n.autoStart.cursorElement = e ? t : null;
|
|
1688
1688
|
}
|
|
@@ -1692,10 +1692,10 @@ function $o() {
|
|
|
1692
1692
|
var i = "";
|
|
1693
1693
|
if (o.name) {
|
|
1694
1694
|
var a = n.options[o.name].cursorChecker;
|
|
1695
|
-
i =
|
|
1695
|
+
i = b.func(a) ? a(o, n, r, t._interacting) : e.actions.map[o.name].getCursor(o);
|
|
1696
1696
|
}
|
|
1697
|
-
|
|
1698
|
-
} else e.autoStart.cursorElement &&
|
|
1697
|
+
_t(t.element, i || "", e);
|
|
1698
|
+
} else e.autoStart.cursorElement && _t(e.autoStart.cursorElement, "", e);
|
|
1699
1699
|
}
|
|
1700
1700
|
var Qn = { id: "auto-start/base", before: ["actions"], install: function(t) {
|
|
1701
1701
|
var e = t.interactStatic, n = t.defaults;
|
|
@@ -1719,29 +1719,29 @@ function $o() {
|
|
|
1719
1719
|
})(t, e);
|
|
1720
1720
|
}, "interactions:stop": function(t, e) {
|
|
1721
1721
|
var n = t.interaction, r = n.interactable;
|
|
1722
|
-
r && r.options.styleCursor &&
|
|
1722
|
+
r && r.options.styleCursor && _t(n.element, "", e);
|
|
1723
1723
|
} }, maxInteractions: ln, withinInteractionLimit: st, validateAction: on }, Mt = Qn, Zn = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
|
|
1724
1724
|
var n = t.interaction, r = t.eventTarget, o = t.dx, i = t.dy;
|
|
1725
1725
|
if (n.prepared.name === "drag") {
|
|
1726
1726
|
var a = Math.abs(o), s = Math.abs(i), l = n.interactable.options.drag, d = l.startAxis, c = a > s ? "x" : a < s ? "y" : "xy";
|
|
1727
1727
|
if (n.prepared.axis = l.lockAxis === "start" ? c[0] : l.lockAxis, c !== "xy" && d !== "xy" && d !== c) {
|
|
1728
1728
|
n.prepared.name = null;
|
|
1729
|
-
for (var f = r,
|
|
1730
|
-
if (
|
|
1731
|
-
var
|
|
1732
|
-
if (!
|
|
1733
|
-
var
|
|
1734
|
-
if (
|
|
1735
|
-
if (!
|
|
1736
|
-
var
|
|
1737
|
-
return
|
|
1738
|
-
})(c,
|
|
1729
|
+
for (var f = r, x = function(T) {
|
|
1730
|
+
if (T !== n.interactable) {
|
|
1731
|
+
var R = n.interactable.options.drag;
|
|
1732
|
+
if (!R.manualStart && T.testIgnoreAllow(R, f, r)) {
|
|
1733
|
+
var L = T.getAction(n.downPointer, n.downEvent, n, f);
|
|
1734
|
+
if (L && L.name === "drag" && (function(D, j) {
|
|
1735
|
+
if (!j) return !1;
|
|
1736
|
+
var G = j.options.drag.startAxis;
|
|
1737
|
+
return D === "xy" || G === "xy" || G === D;
|
|
1738
|
+
})(c, T) && Mt.validateAction(L, T, f, r, e)) return T;
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
|
-
};
|
|
1742
|
-
var
|
|
1743
|
-
if (
|
|
1744
|
-
n.prepared.name = "drag", n.interactable =
|
|
1741
|
+
}; b.element(f); ) {
|
|
1742
|
+
var A = e.interactables.forEachMatch(f, x);
|
|
1743
|
+
if (A) {
|
|
1744
|
+
n.prepared.name = "drag", n.interactable = A, n.element = f;
|
|
1745
1745
|
break;
|
|
1746
1746
|
}
|
|
1747
1747
|
f = fe(f);
|
|
@@ -1774,7 +1774,7 @@ function $o() {
|
|
|
1774
1774
|
} }, getHoldDuration: Rt }, tr = er, nr = { id: "auto-start", install: function(t) {
|
|
1775
1775
|
t.usePlugin(Mt), t.usePlugin(tr), t.usePlugin(Zn);
|
|
1776
1776
|
} }, rr = function(t) {
|
|
1777
|
-
return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) :
|
|
1777
|
+
return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) : b.bool(t) ? (this.options.preventDefault = t ? "always" : "never", this) : this.options.preventDefault;
|
|
1778
1778
|
};
|
|
1779
1779
|
function or(t) {
|
|
1780
1780
|
var e = t.interaction, n = t.event;
|
|
@@ -1787,10 +1787,10 @@ function $o() {
|
|
|
1787
1787
|
var a = r.options.preventDefault;
|
|
1788
1788
|
if (a !== "never") if (a !== "always") {
|
|
1789
1789
|
if (o.events.supportsPassive && /^touch(start|move)$/.test(i.type)) {
|
|
1790
|
-
var s =
|
|
1790
|
+
var s = $(i.target).document, l = o.getDocOptions(s);
|
|
1791
1791
|
if (!l || !l.events || l.events.passive !== !1) return;
|
|
1792
1792
|
}
|
|
1793
|
-
/^(mouse|pointer|touch)*(down|start)/i.test(i.type) ||
|
|
1793
|
+
/^(mouse|pointer|touch)*(down|start)/i.test(i.type) || b.element(i.target) && he(i.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || i.preventDefault();
|
|
1794
1794
|
} else i.preventDefault();
|
|
1795
1795
|
})(this, t, n);
|
|
1796
1796
|
}, t.interactions.docEvents.push({ type: "dragstart", listener: function(n) {
|
|
@@ -1811,7 +1811,7 @@ function $o() {
|
|
|
1811
1811
|
var e = {};
|
|
1812
1812
|
for (var n in t) {
|
|
1813
1813
|
var r = t[n];
|
|
1814
|
-
|
|
1814
|
+
b.plainObject(r) ? e[n] = Ne(r) : b.array(r) ? e[n] = Gt(r) : e[n] = r;
|
|
1815
1815
|
}
|
|
1816
1816
|
return e;
|
|
1817
1817
|
}
|
|
@@ -1822,11 +1822,11 @@ function $o() {
|
|
|
1822
1822
|
return g(t, [{ key: "start", value: function(e, n) {
|
|
1823
1823
|
var r, o, i = e.phase, a = this.interaction, s = (function(d) {
|
|
1824
1824
|
var c = d.interactable.options[d.prepared.name], f = c.modifiers;
|
|
1825
|
-
return f && f.length ? f : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(
|
|
1826
|
-
var
|
|
1827
|
-
return
|
|
1828
|
-
})).filter((function(
|
|
1829
|
-
return !!
|
|
1825
|
+
return f && f.length ? f : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(x) {
|
|
1826
|
+
var A = c[x];
|
|
1827
|
+
return A && A.enabled && { options: A, methods: A._methods };
|
|
1828
|
+
})).filter((function(x) {
|
|
1829
|
+
return !!x;
|
|
1830
1830
|
}));
|
|
1831
1831
|
})(a);
|
|
1832
1832
|
this.prepareStates(s), this.startEdges = z({}, a.edges), this.edges = z({}, this.startEdges), this.startOffset = (r = a.rect, o = n, r ? { left: o.x - r.left, top: o.y - r.top, right: r.right - o.x, bottom: r.bottom - o.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
|
|
@@ -1844,25 +1844,25 @@ function $o() {
|
|
|
1844
1844
|
var n = e.phase, r = e.preEnd, o = e.skipModifiers, i = e.rect, a = e.edges;
|
|
1845
1845
|
e.coords = z({}, e.pageCoords), e.rect = z({}, i), e.edges = z({}, a);
|
|
1846
1846
|
for (var s = o ? this.states.slice(o) : this.states, l = ct(e.coords, e.rect), d = 0; d < s.length; d++) {
|
|
1847
|
-
var c, f = s[d],
|
|
1848
|
-
(c = f.methods) != null && c.set && this.shouldDo(
|
|
1847
|
+
var c, f = s[d], x = f.options, A = z({}, e.coords), T = null;
|
|
1848
|
+
(c = f.methods) != null && c.set && this.shouldDo(x, r, n) && (e.state = f, T = f.methods.set(e), nt(e.edges, e.rect, { x: e.coords.x - A.x, y: e.coords.y - A.y })), l.eventProps.push(T);
|
|
1849
1849
|
}
|
|
1850
1850
|
z(this.edges, e.edges), l.delta.x = e.coords.x - e.pageCoords.x, l.delta.y = e.coords.y - e.pageCoords.y, l.rectDelta.left = e.rect.left - i.left, l.rectDelta.right = e.rect.right - i.right, l.rectDelta.top = e.rect.top - i.top, l.rectDelta.bottom = e.rect.bottom - i.bottom;
|
|
1851
|
-
var
|
|
1852
|
-
if (
|
|
1853
|
-
var
|
|
1854
|
-
l.changed =
|
|
1851
|
+
var R = this.result.coords, L = this.result.rect;
|
|
1852
|
+
if (R && L) {
|
|
1853
|
+
var D = l.rect.left !== L.left || l.rect.right !== L.right || l.rect.top !== L.top || l.rect.bottom !== L.bottom;
|
|
1854
|
+
l.changed = D || R.x !== l.coords.x || R.y !== l.coords.y;
|
|
1855
1855
|
}
|
|
1856
1856
|
return l;
|
|
1857
1857
|
} }, { key: "applyToInteraction", value: function(e) {
|
|
1858
1858
|
var n = this.interaction, r = e.phase, o = n.coords.cur, i = n.coords.start, a = this.result, s = this.startDelta, l = a.delta;
|
|
1859
1859
|
r === "start" && z(this.startDelta, a.delta);
|
|
1860
1860
|
for (var d = 0, c = [[i, s], [o, l]]; d < c.length; d++) {
|
|
1861
|
-
var f = c[d],
|
|
1862
|
-
|
|
1861
|
+
var f = c[d], x = f[0], A = f[1];
|
|
1862
|
+
x.page.x += A.x, x.page.y += A.y, x.client.x += A.x, x.client.y += A.y;
|
|
1863
1863
|
}
|
|
1864
|
-
var
|
|
1865
|
-
|
|
1864
|
+
var T = this.result.rectDelta, R = e.rect || n.rect;
|
|
1865
|
+
R.left += T.left, R.right += T.right, R.top += T.top, R.bottom += T.bottom, R.width = R.right - R.left, R.height = R.bottom - R.top;
|
|
1866
1866
|
} }, { key: "setAndApply", value: function(e) {
|
|
1867
1867
|
var n = this.interaction, r = e.phase, o = e.preEnd, i = e.skipModifiers, a = this.setAll(this.fillArg({ preEnd: o, phase: r, pageCoords: e.modifiedCoords || n.coords.cur.page }));
|
|
1868
1868
|
if (this.result = a, !a.changed && (!i || i < this.states.length) && n.interacting()) return !1;
|
|
@@ -1905,8 +1905,8 @@ function $o() {
|
|
|
1905
1905
|
var n = e.interaction, r = n.coords, o = n.rect, i = n.modification;
|
|
1906
1906
|
if (i.result) {
|
|
1907
1907
|
for (var a = i.startDelta, s = i.result, l = s.delta, d = s.rectDelta, c = 0, f = [[r.start, a], [r.cur, l]]; c < f.length; c++) {
|
|
1908
|
-
var
|
|
1909
|
-
|
|
1908
|
+
var x = f[c], A = x[0], T = x[1];
|
|
1909
|
+
A.page.x -= T.x, A.page.y -= T.y, A.client.x -= T.x, A.client.y -= T.y;
|
|
1910
1910
|
}
|
|
1911
1911
|
o.left -= d.left, o.right -= d.right, o.top -= d.top, o.bottom -= d.bottom;
|
|
1912
1912
|
}
|
|
@@ -1923,7 +1923,7 @@ function $o() {
|
|
|
1923
1923
|
function ct(t, e) {
|
|
1924
1924
|
return { rect: e, coords: t, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: !0 };
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function Ae(t, e) {
|
|
1927
1927
|
var n = t.defaults, r = { start: t.start, set: t.set, beforeEnd: t.beforeEnd, stop: t.stop }, o = function(i) {
|
|
1928
1928
|
var a = i || {};
|
|
1929
1929
|
for (var s in a.enabled = a.enabled !== !1, n) s in a || (a[s] = n[s]);
|
|
@@ -1936,7 +1936,7 @@ function $o() {
|
|
|
1936
1936
|
};
|
|
1937
1937
|
return e && typeof e == "string" && (o._defaults = n, o._methods = r), o;
|
|
1938
1938
|
}
|
|
1939
|
-
function
|
|
1939
|
+
function qe(t) {
|
|
1940
1940
|
var e = t.iEvent, n = t.interaction.modification.result;
|
|
1941
1941
|
n && (e.modifiers = n.eventProps);
|
|
1942
1942
|
}
|
|
@@ -1954,20 +1954,20 @@ function $o() {
|
|
|
1954
1954
|
}, "interactions:before-action-end": function(t) {
|
|
1955
1955
|
var e = t.interaction, n = e.modification, r = n.beforeEnd(t);
|
|
1956
1956
|
return e.edges = n.startEdges, r;
|
|
1957
|
-
}, "interactions:action-start":
|
|
1957
|
+
}, "interactions:action-start": qe, "interactions:action-move": qe, "interactions:action-end": qe, "interactions:after-action-start": function(t) {
|
|
1958
1958
|
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1959
1959
|
}, "interactions:after-action-move": function(t) {
|
|
1960
1960
|
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1961
1961
|
}, "interactions:stop": function(t) {
|
|
1962
1962
|
return t.interaction.modification.stop(t);
|
|
1963
1963
|
} } }, dn = ir, pn = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, Pt = (function(t) {
|
|
1964
|
-
|
|
1965
|
-
var e =
|
|
1964
|
+
S(n, t);
|
|
1965
|
+
var e = I(n);
|
|
1966
1966
|
function n(r, o, i, a, s, l, d) {
|
|
1967
1967
|
var c;
|
|
1968
1968
|
y(this, n), (c = e.call(this, r)).relatedTarget = null, c.screenX = void 0, c.screenY = void 0, c.button = void 0, c.buttons = void 0, c.ctrlKey = void 0, c.shiftKey = void 0, c.altKey = void 0, c.metaKey = void 0, c.page = void 0, c.client = void 0, c.delta = void 0, c.rect = void 0, c.x0 = void 0, c.y0 = void 0, c.t0 = void 0, c.dt = void 0, c.duration = void 0, c.clientX0 = void 0, c.clientY0 = void 0, c.velocity = void 0, c.speed = void 0, c.swipe = void 0, c.axes = void 0, c.preEnd = void 0, s = s || r.element;
|
|
1969
|
-
var f = r.interactable,
|
|
1970
|
-
return c.page = z({},
|
|
1969
|
+
var f = r.interactable, x = (f && f.options || pn).deltaSource, A = ze(f, s, i), T = a === "start", R = a === "end", L = T ? O(c) : r.prevEvent, D = T ? r.coords.start : R ? { page: L.page, client: L.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
1970
|
+
return c.page = z({}, D.page), c.client = z({}, D.client), c.rect = z({}, r.rect), c.timeStamp = D.timeStamp, R || (c.page.x -= A.x, c.page.y -= A.y, c.client.x -= A.x, c.client.y -= A.y), c.ctrlKey = o.ctrlKey, c.altKey = o.altKey, c.shiftKey = o.shiftKey, c.metaKey = o.metaKey, c.button = o.button, c.buttons = o.buttons, c.target = s, c.currentTarget = s, c.preEnd = l, c.type = d || i + (a || ""), c.interactable = f, c.t0 = T ? r.pointers[r.pointers.length - 1].downTime : L.t0, c.x0 = r.coords.start.page.x - A.x, c.y0 = r.coords.start.page.y - A.y, c.clientX0 = r.coords.start.client.x - A.x, c.clientY0 = r.coords.start.client.y - A.y, c.delta = T || R ? { x: 0, y: 0 } : { x: c[x].x - L[x].x, y: c[x].y - L[x].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = z({}, r.coords.velocity[x]), c.speed = Fe(c.velocity.x, c.velocity.y), c.swipe = R || a === "inertiastart" ? c.getSwipe() : null, c;
|
|
1971
1971
|
}
|
|
1972
1972
|
return g(n, [{ key: "getSwipe", value: function() {
|
|
1973
1973
|
var r = this._interaction;
|
|
@@ -2025,7 +2025,7 @@ function $o() {
|
|
|
2025
2025
|
})({}), lr = 0, cr = (function() {
|
|
2026
2026
|
function t(e) {
|
|
2027
2027
|
var n = this, r = e.pointerType, o = e.scopeFire;
|
|
2028
|
-
y(this, t), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove =
|
|
2028
|
+
y(this, t), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove = Be((function(c) {
|
|
2029
2029
|
this.move(c);
|
|
2030
2030
|
}), "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = lr++, this._scopeFire = o, this.pointerType = r;
|
|
2031
2031
|
var i = this;
|
|
@@ -2050,7 +2050,7 @@ function $o() {
|
|
|
2050
2050
|
var o = this.updatePointer(e, n, r, !0), i = this.pointers[o];
|
|
2051
2051
|
this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: o, pointerInfo: i, type: "down", interaction: this });
|
|
2052
2052
|
} }, { key: "start", value: function(e, n, r) {
|
|
2053
|
-
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (
|
|
2053
|
+
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (At(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? z({}, this.prepared.edges) : { left: !0, right: !0, top: !0, bottom: !0 }, this._stopped = !1, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
|
|
2054
2054
|
} }, { key: "pointerMove", value: function(e, n, r) {
|
|
2055
2055
|
this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
|
|
2056
2056
|
var o, i, a = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
|
|
@@ -2058,7 +2058,7 @@ function $o() {
|
|
|
2058
2058
|
var s, l, d, c = this.getPointerIndex(e), f = { pointer: e, pointerIndex: c, pointerInfo: this.pointers[c], event: n, type: "move", eventTarget: r, dx: o, dy: i, duplicate: a, interaction: this };
|
|
2059
2059
|
a || (s = this.coords.velocity, l = this.coords.delta, d = Math.max(l.timeStamp / 1e3, 1e-3), s.page.x = l.page.x / d, s.page.y = l.page.y / d, s.client.x = l.client.x / d, s.client.y = l.client.y / d, s.timeStamp = d), this._scopeFire("interactions:move", f), a || this.simulation || (this.interacting() && (f.type = null, this.move(f)), this.pointerWasMoved && ot(this.coords.prev, this.coords.cur));
|
|
2060
2060
|
} }, { key: "move", value: function(e) {
|
|
2061
|
-
e && e.event ||
|
|
2061
|
+
e && e.event || Bt(this.coords.delta), (e = z({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
|
|
2062
2062
|
} }, { key: "pointerUp", value: function(e, n, r, o) {
|
|
2063
2063
|
var i = this.getPointerIndex(e);
|
|
2064
2064
|
i === -1 && (i = this.updatePointer(e, n, r, !1));
|
|
@@ -2119,13 +2119,13 @@ function $o() {
|
|
|
2119
2119
|
return !(!n.offset.pending.x && !n.offset.pending.y);
|
|
2120
2120
|
})(t)) return !1;
|
|
2121
2121
|
var e = t.offset.pending;
|
|
2122
|
-
return
|
|
2122
|
+
return Dt(t.coords.cur, e), Dt(t.coords.delta, e), nt(t.edges, t.rect, e), e.x = 0, e.y = 0, !0;
|
|
2123
2123
|
}
|
|
2124
2124
|
function ur(t) {
|
|
2125
2125
|
var e = t.x, n = t.y;
|
|
2126
2126
|
this.offset.pending.x += e, this.offset.pending.y += n, this.offset.total.x += e, this.offset.total.y += n;
|
|
2127
2127
|
}
|
|
2128
|
-
function
|
|
2128
|
+
function Dt(t, e) {
|
|
2129
2129
|
var n = t.page, r = t.client, o = e.x, i = e.y;
|
|
2130
2130
|
n.x += o, n.y += i, r.x += o, r.y += i;
|
|
2131
2131
|
}
|
|
@@ -2136,7 +2136,7 @@ function $o() {
|
|
|
2136
2136
|
t.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
|
|
2137
2137
|
}, "interactions:update-pointer": function(t) {
|
|
2138
2138
|
return (function(e) {
|
|
2139
|
-
e.pointerIsDown && (
|
|
2139
|
+
e.pointerIsDown && (Dt(e.coords.cur, e.offset.total), e.offset.pending.x = 0, e.offset.pending.y = 0);
|
|
2140
2140
|
})(t.interaction);
|
|
2141
2141
|
}, "interactions:before-action-start": hn, "interactions:before-action-move": hn, "interactions:before-action-end": function(t) {
|
|
2142
2142
|
var e = t.interaction;
|
|
@@ -2178,10 +2178,10 @@ function $o() {
|
|
|
2178
2178
|
} }, { key: "inertiaTick", value: function() {
|
|
2179
2179
|
var e, n, r, o, i, a, s, l = this, d = this.interaction, c = ut(d).resistance, f = (d._now() - this.t0) / 1e3;
|
|
2180
2180
|
if (f < this.te) {
|
|
2181
|
-
var
|
|
2182
|
-
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y,
|
|
2183
|
-
var
|
|
2184
|
-
this.currentOffset.x +=
|
|
2181
|
+
var x, A = 1 - (Math.exp(-c * f) - this.lambda_v0) / this.one_ve_v0;
|
|
2182
|
+
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y, x = { x: gn(s = A, e, r, i), y: gn(s, n, o, a) }) : x = { x: this.targetOffset.x * A, y: this.targetOffset.y * A };
|
|
2183
|
+
var T = { x: x.x - this.currentOffset.x, y: x.y - this.currentOffset.y };
|
|
2184
|
+
this.currentOffset.x += T.x, this.currentOffset.y += T.y, d.offsetBy(T), d.move(), this.onNextFrame((function() {
|
|
2185
2185
|
return l.inertiaTick();
|
|
2186
2186
|
}));
|
|
2187
2187
|
} else d.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
|
|
@@ -2217,7 +2217,7 @@ function $o() {
|
|
|
2217
2217
|
return (!e._interacting || e.simulation || !e.inertia.start(n)) && null;
|
|
2218
2218
|
}, "interactions:down": function(t) {
|
|
2219
2219
|
var e = t.interaction, n = t.eventTarget, r = e.inertia;
|
|
2220
|
-
if (r.active) for (var o = n;
|
|
2220
|
+
if (r.active) for (var o = n; b.element(o); ) {
|
|
2221
2221
|
if (o === e.element) {
|
|
2222
2222
|
r.resume(t);
|
|
2223
2223
|
break;
|
|
@@ -2232,7 +2232,7 @@ function $o() {
|
|
|
2232
2232
|
e.stop(t), e.start(t, t.interaction.coords.cur.page), e.applyToInteraction(t);
|
|
2233
2233
|
}, "interactions:before-action-inertiastart": function(t) {
|
|
2234
2234
|
return t.interaction.modification.setAndApply(t);
|
|
2235
|
-
}, "interactions:action-resume":
|
|
2235
|
+
}, "interactions:action-resume": qe, "interactions:action-inertiastart": qe, "interactions:after-action-inertiastart": function(t) {
|
|
2236
2236
|
return t.interaction.modification.restoreInteractionCoords(t);
|
|
2237
2237
|
}, "interactions:after-action-resume": function(t) {
|
|
2238
2238
|
return t.interaction.modification.restoreInteractionCoords(t);
|
|
@@ -2287,93 +2287,93 @@ function $o() {
|
|
|
2287
2287
|
} }]), t;
|
|
2288
2288
|
})();
|
|
2289
2289
|
function Ye(t) {
|
|
2290
|
-
return
|
|
2290
|
+
return b.object(t) ? { capture: !!t.capture, passive: !!t.passive } : { capture: !!t, passive: !1 };
|
|
2291
2291
|
}
|
|
2292
2292
|
function dt(t, e) {
|
|
2293
2293
|
return t === e || (typeof t == "boolean" ? !!e.capture === t && !e.passive : !!t.capture == !!e.capture && !!t.passive == !!e.passive);
|
|
2294
2294
|
}
|
|
2295
2295
|
var vr = { id: "events", install: function(t) {
|
|
2296
|
-
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f,
|
|
2297
|
-
var
|
|
2298
|
-
if (!r[
|
|
2299
|
-
r[
|
|
2300
|
-
for (var
|
|
2301
|
-
var
|
|
2302
|
-
a(
|
|
2296
|
+
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f, x, A, T) {
|
|
2297
|
+
var R = Ye(T);
|
|
2298
|
+
if (!r[x]) {
|
|
2299
|
+
r[x] = [];
|
|
2300
|
+
for (var L = 0; L < o.length; L++) {
|
|
2301
|
+
var D = o[L];
|
|
2302
|
+
a(D, x, l), a(D, x, d, !0);
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
|
-
var
|
|
2306
|
-
return
|
|
2305
|
+
var j = r[x], G = We(j, (function(te) {
|
|
2306
|
+
return te.selector === c && te.context === f;
|
|
2307
2307
|
}));
|
|
2308
|
-
|
|
2309
|
-
}, removeDelegate: function(c, f,
|
|
2310
|
-
var
|
|
2311
|
-
if (
|
|
2312
|
-
for (
|
|
2313
|
-
var
|
|
2314
|
-
if (
|
|
2315
|
-
for (var
|
|
2316
|
-
var
|
|
2317
|
-
if (
|
|
2318
|
-
|
|
2308
|
+
G || (G = { selector: c, context: f, listeners: [] }, j.push(G)), G.listeners.push({ func: A, options: R });
|
|
2309
|
+
}, removeDelegate: function(c, f, x, A, T) {
|
|
2310
|
+
var R, L = Ye(T), D = r[x], j = !1;
|
|
2311
|
+
if (D)
|
|
2312
|
+
for (R = D.length - 1; R >= 0; R--) {
|
|
2313
|
+
var G = D[R];
|
|
2314
|
+
if (G.selector === c && G.context === f) {
|
|
2315
|
+
for (var te = G.listeners, Y = te.length - 1; Y >= 0; Y--) {
|
|
2316
|
+
var Q = te[Y];
|
|
2317
|
+
if (Q.func === A && dt(Q.options, L)) {
|
|
2318
|
+
te.splice(Y, 1), te.length || (D.splice(R, 1), s(f, x, l), s(f, x, d, !0)), j = !0;
|
|
2319
2319
|
break;
|
|
2320
2320
|
}
|
|
2321
2321
|
}
|
|
2322
|
-
if (
|
|
2322
|
+
if (j) break;
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
2325
|
}, delegateListener: l, delegateUseCapture: d, delegatedEvents: r, documents: o, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
2326
|
-
function a(c, f,
|
|
2326
|
+
function a(c, f, x, A) {
|
|
2327
2327
|
if (c.addEventListener) {
|
|
2328
|
-
var
|
|
2329
|
-
return
|
|
2328
|
+
var T = Ye(A), R = We(n, (function(L) {
|
|
2329
|
+
return L.eventTarget === c;
|
|
2330
2330
|
}));
|
|
2331
|
-
|
|
2332
|
-
return
|
|
2333
|
-
})) || (c.addEventListener(f,
|
|
2331
|
+
R || (R = { eventTarget: c, events: {} }, n.push(R)), R.events[f] || (R.events[f] = []), We(R.events[f], (function(L) {
|
|
2332
|
+
return L.func === x && dt(L.options, T);
|
|
2333
|
+
})) || (c.addEventListener(f, x, i.supportsOptions ? T : T.capture), R.events[f].push({ func: x, options: T }));
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
|
-
function s(c, f,
|
|
2336
|
+
function s(c, f, x, A) {
|
|
2337
2337
|
if (c.addEventListener && c.removeEventListener) {
|
|
2338
|
-
var
|
|
2338
|
+
var T = He(n, (function(ve) {
|
|
2339
2339
|
return ve.eventTarget === c;
|
|
2340
|
-
})),
|
|
2341
|
-
if (
|
|
2342
|
-
var
|
|
2343
|
-
if (
|
|
2344
|
-
if (
|
|
2345
|
-
for (var
|
|
2346
|
-
var
|
|
2347
|
-
s(c, f,
|
|
2340
|
+
})), R = n[T];
|
|
2341
|
+
if (R && R.events) if (f !== "all") {
|
|
2342
|
+
var L = !1, D = R.events[f];
|
|
2343
|
+
if (D) {
|
|
2344
|
+
if (x === "all") {
|
|
2345
|
+
for (var j = D.length - 1; j >= 0; j--) {
|
|
2346
|
+
var G = D[j];
|
|
2347
|
+
s(c, f, G.func, G.options);
|
|
2348
2348
|
}
|
|
2349
2349
|
return;
|
|
2350
2350
|
}
|
|
2351
|
-
for (var
|
|
2352
|
-
var
|
|
2353
|
-
if (
|
|
2354
|
-
c.removeEventListener(f,
|
|
2351
|
+
for (var te = Ye(A), Y = 0; Y < D.length; Y++) {
|
|
2352
|
+
var Q = D[Y];
|
|
2353
|
+
if (Q.func === x && dt(Q.options, te)) {
|
|
2354
|
+
c.removeEventListener(f, x, i.supportsOptions ? te : te.capture), D.splice(Y, 1), D.length === 0 && (delete R.events[f], L = !0);
|
|
2355
2355
|
break;
|
|
2356
2356
|
}
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
|
-
|
|
2360
|
-
} else for (f in
|
|
2359
|
+
L && !Object.keys(R.events).length && n.splice(T, 1);
|
|
2360
|
+
} else for (f in R.events) R.events.hasOwnProperty(f) && s(c, f, "all");
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
2363
|
function l(c, f) {
|
|
2364
|
-
for (var
|
|
2365
|
-
for (var
|
|
2366
|
-
var
|
|
2367
|
-
if (he(
|
|
2368
|
-
var
|
|
2369
|
-
|
|
2370
|
-
for (var
|
|
2371
|
-
var ve =
|
|
2372
|
-
dt(ve.options,
|
|
2364
|
+
for (var x = Ye(f), A = new mr(c), T = r[c.type], R = Ut(c)[0], L = R; b.element(L); ) {
|
|
2365
|
+
for (var D = 0; D < T.length; D++) {
|
|
2366
|
+
var j = T[D], G = j.selector, te = j.context;
|
|
2367
|
+
if (he(L, G) && se(te, R) && se(te, L)) {
|
|
2368
|
+
var Y = j.listeners;
|
|
2369
|
+
A.currentTarget = L;
|
|
2370
|
+
for (var Q = 0; Q < Y.length; Q++) {
|
|
2371
|
+
var ve = Y[Q];
|
|
2372
|
+
dt(ve.options, x) && ve.func(A);
|
|
2373
2373
|
}
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
|
|
2376
|
+
L = fe(L);
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
2379
|
function d(c) {
|
|
@@ -2384,9 +2384,9 @@ function $o() {
|
|
|
2384
2384
|
}, get passive() {
|
|
2385
2385
|
return i.supportsPassive = !0;
|
|
2386
2386
|
} }), t.events = i, i;
|
|
2387
|
-
} },
|
|
2388
|
-
for (var e = 0, n =
|
|
2389
|
-
var r = n[e], o =
|
|
2387
|
+
} }, Ot = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t) {
|
|
2388
|
+
for (var e = 0, n = Ot.methodOrder; e < n.length; e++) {
|
|
2389
|
+
var r = n[e], o = Ot[r](t);
|
|
2390
2390
|
if (o) return o;
|
|
2391
2391
|
}
|
|
2392
2392
|
return null;
|
|
@@ -2440,30 +2440,30 @@ function $o() {
|
|
|
2440
2440
|
return n.id === e;
|
|
2441
2441
|
}));
|
|
2442
2442
|
}
|
|
2443
|
-
var gr =
|
|
2443
|
+
var gr = Ot, Nt = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
|
|
2444
2444
|
function En(t, e) {
|
|
2445
2445
|
return function(n) {
|
|
2446
2446
|
var r = e.interactions.list, o = Vt(n), i = Ut(n), a = i[0], s = i[1], l = [];
|
|
2447
2447
|
if (/^touch/.test(n.type)) {
|
|
2448
2448
|
e.prevTouchTime = e.now();
|
|
2449
2449
|
for (var d = 0, c = n.changedTouches; d < c.length; d++) {
|
|
2450
|
-
var f = c[d],
|
|
2451
|
-
l.push([
|
|
2450
|
+
var f = c[d], x = { pointer: f, pointerId: je(f), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, A = kn(x);
|
|
2451
|
+
l.push([x.pointer, x.eventTarget, x.curEventTarget, A]);
|
|
2452
2452
|
}
|
|
2453
2453
|
} else {
|
|
2454
|
-
var
|
|
2454
|
+
var T = !1;
|
|
2455
2455
|
if (!re.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2456
|
-
for (var
|
|
2457
|
-
|
|
2456
|
+
for (var R = 0; R < r.length && !T; R++) T = r[R].pointerType !== "mouse" && r[R].pointerIsDown;
|
|
2457
|
+
T = T || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2458
2458
|
}
|
|
2459
|
-
if (!
|
|
2460
|
-
var
|
|
2461
|
-
l.push([
|
|
2459
|
+
if (!T) {
|
|
2460
|
+
var L = { pointer: n, pointerId: je(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, D = kn(L);
|
|
2461
|
+
l.push([L.pointer, L.eventTarget, L.curEventTarget, D]);
|
|
2462
2462
|
}
|
|
2463
2463
|
}
|
|
2464
|
-
for (var
|
|
2465
|
-
var
|
|
2466
|
-
|
|
2464
|
+
for (var j = 0; j < l.length; j++) {
|
|
2465
|
+
var G = l[j], te = G[0], Y = G[1], Q = G[2];
|
|
2466
|
+
G[3][t](te, n, Y, Q);
|
|
2467
2467
|
}
|
|
2468
2468
|
};
|
|
2469
2469
|
}
|
|
@@ -2489,19 +2489,19 @@ function $o() {
|
|
|
2489
2489
|
for (var s = 0, l = t.interactions.list; s < l.length; s++) {
|
|
2490
2490
|
var d = l[s];
|
|
2491
2491
|
if (d.pointerIsDown && d.pointerType === "touch" && !d._interacting) for (var c = function() {
|
|
2492
|
-
var
|
|
2493
|
-
t.documents.some((function(
|
|
2494
|
-
return se(
|
|
2495
|
-
})) || d.removePointer(
|
|
2496
|
-
}, f = 0,
|
|
2492
|
+
var A = x[f];
|
|
2493
|
+
t.documents.some((function(T) {
|
|
2494
|
+
return se(T.doc, A.downTarget);
|
|
2495
|
+
})) || d.removePointer(A.pointer, A.event);
|
|
2496
|
+
}, f = 0, x = d.pointers; f < x.length; f++) c();
|
|
2497
2497
|
}
|
|
2498
2498
|
}
|
|
2499
|
-
(o =
|
|
2499
|
+
(o = K.PointerEvent ? [{ type: i.down, listener: a }, { type: i.down, listener: e.pointerDown }, { type: i.move, listener: e.pointerMove }, { type: i.up, listener: e.pointerUp }, { type: i.cancel, listener: e.pointerUp }] : [{ type: "mousedown", listener: e.pointerDown }, { type: "mousemove", listener: e.pointerMove }, { type: "mouseup", listener: e.pointerUp }, { type: "touchstart", listener: a }, { type: "touchstart", listener: e.pointerDown }, { type: "touchmove", listener: e.pointerMove }, { type: "touchend", listener: e.pointerUp }, { type: "touchcancel", listener: e.pointerUp }]).push({ type: "blur", listener: function(s) {
|
|
2500
2500
|
for (var l = 0, d = t.interactions.list; l < d.length; l++)
|
|
2501
2501
|
d[l].documentBlur(s);
|
|
2502
2502
|
} }), t.prevTouchTime = 0, t.Interaction = (function(s) {
|
|
2503
|
-
|
|
2504
|
-
var l =
|
|
2503
|
+
S(d, s);
|
|
2504
|
+
var l = I(d);
|
|
2505
2505
|
function d() {
|
|
2506
2506
|
return y(this, d), l.apply(this, arguments);
|
|
2507
2507
|
}
|
|
@@ -2528,37 +2528,37 @@ function $o() {
|
|
|
2528
2528
|
var o = e.interactions.list[r];
|
|
2529
2529
|
o.interactable === n && (o.stop(), e.fire("interactions:destroy", { interaction: o }), o.destroy(), e.interactions.list.length > 2 && e.interactions.list.splice(r, 1));
|
|
2530
2530
|
}
|
|
2531
|
-
} }, onDocSignal: Lt, doOnInteractions: En, methodNames: Nt }, br = yr,
|
|
2531
|
+
} }, onDocSignal: Lt, doOnInteractions: En, methodNames: Nt }, br = yr, _e = (function(t) {
|
|
2532
2532
|
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2533
|
-
})(
|
|
2533
|
+
})(_e || {}), xr = (function() {
|
|
2534
2534
|
function t(e, n, r, o) {
|
|
2535
|
-
y(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new xn(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = e, this._context = n.context || r, this._win =
|
|
2535
|
+
y(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new xn(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = e, this._context = n.context || r, this._win = $(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
|
|
2536
2536
|
}
|
|
2537
2537
|
return g(t, [{ key: "_defaults", get: function() {
|
|
2538
2538
|
return { base: {}, perAction: {}, actions: {} };
|
|
2539
2539
|
} }, { key: "setOnEvents", value: function(e, n) {
|
|
2540
|
-
return
|
|
2540
|
+
return b.func(n.onstart) && this.on("".concat(e, "start"), n.onstart), b.func(n.onmove) && this.on("".concat(e, "move"), n.onmove), b.func(n.onend) && this.on("".concat(e, "end"), n.onend), b.func(n.oninertiastart) && this.on("".concat(e, "inertiastart"), n.oninertiastart), this;
|
|
2541
2541
|
} }, { key: "updatePerActionListeners", value: function(e, n, r) {
|
|
2542
2542
|
var o, i = this, a = (o = this._actions.map[e]) == null ? void 0 : o.filterEventType, s = function(l) {
|
|
2543
2543
|
return (a == null || a(l)) && lt(l, i._actions);
|
|
2544
2544
|
};
|
|
2545
|
-
(
|
|
2545
|
+
(b.array(n) || b.object(n)) && this._onOff(_e.Off, e, n, void 0, s), (b.array(r) || b.object(r)) && this._onOff(_e.On, e, r, void 0, s);
|
|
2546
2546
|
} }, { key: "setPerAction", value: function(e, n) {
|
|
2547
2547
|
var r = this._defaults;
|
|
2548
2548
|
for (var o in n) {
|
|
2549
2549
|
var i = o, a = this.options[e], s = n[i];
|
|
2550
|
-
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s),
|
|
2550
|
+
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), b.array(s) ? a[i] = Gt(s) : b.plainObject(s) ? (a[i] = z(a[i] || {}, Ne(s)), b.object(r.perAction[i]) && "enabled" in r.perAction[i] && (a[i].enabled = s.enabled !== !1)) : b.bool(s) && b.object(r.perAction[i]) ? a[i].enabled = s : a[i] = s;
|
|
2551
2551
|
}
|
|
2552
2552
|
} }, { key: "getRect", value: function(e) {
|
|
2553
|
-
return e = e || (
|
|
2553
|
+
return e = e || (b.element(this.target) ? this.target : null), b.string(this.target) && (e = e || this._context.querySelector(this.target)), we(e);
|
|
2554
2554
|
} }, { key: "rectChecker", value: function(e) {
|
|
2555
2555
|
var n = this;
|
|
2556
|
-
return
|
|
2556
|
+
return b.func(e) ? (this.getRect = function(r) {
|
|
2557
2557
|
var o = z({}, e.apply(n, r));
|
|
2558
2558
|
return "width" in o || (o.width = o.right - o.left, o.height = o.bottom - o.top), o;
|
|
2559
2559
|
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2560
2560
|
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
2561
|
-
if (Ee(n) ||
|
|
2561
|
+
if (Ee(n) || b.object(n)) {
|
|
2562
2562
|
for (var r in this.options[e] = n, this._actions.map) this.options[r][e] = n;
|
|
2563
2563
|
return this;
|
|
2564
2564
|
}
|
|
@@ -2569,7 +2569,7 @@ function $o() {
|
|
|
2569
2569
|
return e === "page" || e === "client" ? (this.options.deltaSource = e, this) : this.options.deltaSource;
|
|
2570
2570
|
} }, { key: "getAllElements", value: function() {
|
|
2571
2571
|
var e = this.target;
|
|
2572
|
-
return
|
|
2572
|
+
return b.string(e) ? Array.from(this._context.querySelectorAll(e)) : b.func(e) && e.getAllElements ? e.getAllElements() : b.element(e) ? [e] : [];
|
|
2573
2573
|
} }, { key: "context", value: function() {
|
|
2574
2574
|
return this._context;
|
|
2575
2575
|
} }, { key: "inContext", value: function(e) {
|
|
@@ -2577,36 +2577,36 @@ function $o() {
|
|
|
2577
2577
|
} }, { key: "testIgnoreAllow", value: function(e, n, r) {
|
|
2578
2578
|
return !this.testIgnore(e.ignoreFrom, n, r) && this.testAllow(e.allowFrom, n, r);
|
|
2579
2579
|
} }, { key: "testAllow", value: function(e, n, r) {
|
|
2580
|
-
return !e || !!
|
|
2580
|
+
return !e || !!b.element(r) && (b.string(e) ? V(r, e, n) : !!b.element(e) && se(e, r));
|
|
2581
2581
|
} }, { key: "testIgnore", value: function(e, n, r) {
|
|
2582
|
-
return !(!e || !
|
|
2582
|
+
return !(!e || !b.element(r)) && (b.string(e) ? V(r, e, n) : !!b.element(e) && se(e, r));
|
|
2583
2583
|
} }, { key: "fire", value: function(e) {
|
|
2584
2584
|
return this.events.fire(e), this;
|
|
2585
2585
|
} }, { key: "_onOff", value: function(e, n, r, o, i) {
|
|
2586
|
-
|
|
2586
|
+
b.object(n) && !b.array(n) && (o = r, r = null);
|
|
2587
2587
|
var a = Ie(n, r, i);
|
|
2588
2588
|
for (var s in a) {
|
|
2589
2589
|
s === "wheel" && (s = re.wheelEvent);
|
|
2590
2590
|
for (var l = 0, d = a[s]; l < d.length; l++) {
|
|
2591
2591
|
var c = d[l];
|
|
2592
|
-
lt(s, this._actions) ? this.events[e ===
|
|
2592
|
+
lt(s, this._actions) ? this.events[e === _e.On ? "on" : "off"](s, c) : b.string(this.target) ? this._scopeEvents[e === _e.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, c, o) : this._scopeEvents[e === _e.On ? "add" : "remove"](this.target, s, c, o);
|
|
2593
2593
|
}
|
|
2594
2594
|
}
|
|
2595
2595
|
return this;
|
|
2596
2596
|
} }, { key: "on", value: function(e, n, r) {
|
|
2597
|
-
return this._onOff(
|
|
2597
|
+
return this._onOff(_e.On, e, n, r);
|
|
2598
2598
|
} }, { key: "off", value: function(e, n, r) {
|
|
2599
|
-
return this._onOff(
|
|
2599
|
+
return this._onOff(_e.Off, e, n, r);
|
|
2600
2600
|
} }, { key: "set", value: function(e) {
|
|
2601
2601
|
var n = this._defaults;
|
|
2602
|
-
for (var r in
|
|
2602
|
+
for (var r in b.object(e) || (e = {}), this.options = Ne(n.base), this._actions.methodDict) {
|
|
2603
2603
|
var o = r, i = this._actions.methodDict[o];
|
|
2604
2604
|
this.options[o] = {}, this.setPerAction(o, z(z({}, n.perAction), n.actions[o])), this[i](e[o]);
|
|
2605
2605
|
}
|
|
2606
|
-
for (var a in e) a !== "getRect" ?
|
|
2606
|
+
for (var a in e) a !== "getRect" ? b.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
|
|
2607
2607
|
return this;
|
|
2608
2608
|
} }, { key: "unset", value: function() {
|
|
2609
|
-
if (
|
|
2609
|
+
if (b.string(this.target)) for (var e in this._scopeEvents.delegatedEvents) for (var n = this._scopeEvents.delegatedEvents[e], r = n.length - 1; r >= 0; r--) {
|
|
2610
2610
|
var o = n[r], i = o.selector, a = o.context, s = o.listeners;
|
|
2611
2611
|
i === this.target && a === this._context && n.splice(r, 1);
|
|
2612
2612
|
for (var l = s.length - 1; l >= 0; l--) this._scopeEvents.removeDelegate(this.target, this._context, e, s[l][0], s[l][1]);
|
|
@@ -2617,7 +2617,7 @@ function $o() {
|
|
|
2617
2617
|
function t(e) {
|
|
2618
2618
|
var n = this;
|
|
2619
2619
|
y(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2620
|
-
var o = r.interactable, i = o.target, a =
|
|
2620
|
+
var o = r.interactable, i = o.target, a = b.string(i) ? n.selectorMap[i] : i[n.scope.id], s = He(a, (function(l) {
|
|
2621
2621
|
return l === o;
|
|
2622
2622
|
}));
|
|
2623
2623
|
a.splice(s, 1);
|
|
@@ -2626,16 +2626,16 @@ function $o() {
|
|
|
2626
2626
|
return g(t, [{ key: "new", value: function(e, n) {
|
|
2627
2627
|
n = z(n || {}, { actions: this.scope.actions });
|
|
2628
2628
|
var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
|
|
2629
|
-
return this.scope.addDocument(r._doc), this.list.push(r),
|
|
2629
|
+
return this.scope.addDocument(r._doc), this.list.push(r), b.string(e) ? (this.selectorMap[e] || (this.selectorMap[e] = []), this.selectorMap[e].push(r)) : (r.target[this.scope.id] || Object.defineProperty(e, this.scope.id, { value: [], configurable: !0 }), e[this.scope.id].push(r)), this.scope.fire("interactable:new", { target: e, options: n, interactable: r, win: this.scope._win }), r;
|
|
2630
2630
|
} }, { key: "getExisting", value: function(e, n) {
|
|
2631
|
-
var r = n && n.context || this.scope.document, o =
|
|
2632
|
-
if (i) return
|
|
2631
|
+
var r = n && n.context || this.scope.document, o = b.string(e), i = o ? this.selectorMap[e] : e[this.scope.id];
|
|
2632
|
+
if (i) return We(i, (function(a) {
|
|
2633
2633
|
return a._context === r && (o || a.inContext(e));
|
|
2634
2634
|
}));
|
|
2635
2635
|
} }, { key: "forEachMatch", value: function(e, n) {
|
|
2636
2636
|
for (var r = 0, o = this.list; r < o.length; r++) {
|
|
2637
2637
|
var i = o[r], a = void 0;
|
|
2638
|
-
if ((
|
|
2638
|
+
if ((b.string(i.target) ? b.element(e) && he(e, i.target) : e === i.target) && i.inContext(e) && (a = n(i)), a !== void 0) return a;
|
|
2639
2639
|
}
|
|
2640
2640
|
} }]), t;
|
|
2641
2641
|
})(), Er = (function() {
|
|
@@ -2650,33 +2650,33 @@ function $o() {
|
|
|
2650
2650
|
return this.scope.usePlugin(i, a), this;
|
|
2651
2651
|
}, o.isSet = function(i, a) {
|
|
2652
2652
|
return !!this.scope.interactables.get(i, a && a.context);
|
|
2653
|
-
}, o.on =
|
|
2654
|
-
if (
|
|
2653
|
+
}, o.on = Be((function(i, a, s) {
|
|
2654
|
+
if (b.string(i) && i.search(" ") !== -1 && (i = i.trim().split(/ +/)), b.array(i)) {
|
|
2655
2655
|
for (var l = 0, d = i; l < d.length; l++) {
|
|
2656
2656
|
var c = d[l];
|
|
2657
2657
|
this.on(c, a, s);
|
|
2658
2658
|
}
|
|
2659
2659
|
return this;
|
|
2660
2660
|
}
|
|
2661
|
-
if (
|
|
2661
|
+
if (b.object(i)) {
|
|
2662
2662
|
for (var f in i) this.on(f, i[f], a);
|
|
2663
2663
|
return this;
|
|
2664
2664
|
}
|
|
2665
2665
|
return lt(i, this.scope.actions) ? this.globalEvents[i] ? this.globalEvents[i].push(a) : this.globalEvents[i] = [a] : this.scope.events.add(this.scope.document, i, a, { options: s }), this;
|
|
2666
|
-
}), "The interact.on() method is being deprecated"), o.off =
|
|
2667
|
-
if (
|
|
2666
|
+
}), "The interact.on() method is being deprecated"), o.off = Be((function(i, a, s) {
|
|
2667
|
+
if (b.string(i) && i.search(" ") !== -1 && (i = i.trim().split(/ +/)), b.array(i)) {
|
|
2668
2668
|
for (var l = 0, d = i; l < d.length; l++) {
|
|
2669
2669
|
var c = d[l];
|
|
2670
2670
|
this.off(c, a, s);
|
|
2671
2671
|
}
|
|
2672
2672
|
return this;
|
|
2673
2673
|
}
|
|
2674
|
-
if (
|
|
2674
|
+
if (b.object(i)) {
|
|
2675
2675
|
for (var f in i) this.off(f, i[f], a);
|
|
2676
2676
|
return this;
|
|
2677
2677
|
}
|
|
2678
|
-
var
|
|
2679
|
-
return lt(i, this.scope.actions) ? i in this.globalEvents && (
|
|
2678
|
+
var x;
|
|
2679
|
+
return lt(i, this.scope.actions) ? i in this.globalEvents && (x = this.globalEvents[i].indexOf(a)) !== -1 && this.globalEvents[i].splice(x, 1) : this.scope.events.remove(this.scope.document, i, a, s), this;
|
|
2680
2680
|
}), "The interact.off() method is being deprecated"), o.debug = function() {
|
|
2681
2681
|
return this.scope;
|
|
2682
2682
|
}, o.supportsTouch = function() {
|
|
@@ -2687,7 +2687,7 @@ function $o() {
|
|
|
2687
2687
|
for (var i = 0, a = this.scope.interactions.list; i < a.length; i++) a[i].stop();
|
|
2688
2688
|
return this;
|
|
2689
2689
|
}, o.pointerMoveTolerance = function(i) {
|
|
2690
|
-
return
|
|
2690
|
+
return b.number(i) ? (this.scope.interactions.pointerMoveTolerance = i, this) : this.scope.interactions.pointerMoveTolerance;
|
|
2691
2691
|
}, o.addDocument = function(i, a) {
|
|
2692
2692
|
this.scope.addDocument(i, a);
|
|
2693
2693
|
}, o.removeDocument = function(i) {
|
|
@@ -2698,17 +2698,17 @@ function $o() {
|
|
|
2698
2698
|
};
|
|
2699
2699
|
var n = this;
|
|
2700
2700
|
this.Interactable = (function(r) {
|
|
2701
|
-
|
|
2702
|
-
var o =
|
|
2701
|
+
S(i, r);
|
|
2702
|
+
var o = I(i);
|
|
2703
2703
|
function i() {
|
|
2704
2704
|
return y(this, i), o.apply(this, arguments);
|
|
2705
2705
|
}
|
|
2706
2706
|
return g(i, [{ key: "_defaults", get: function() {
|
|
2707
2707
|
return n.defaults;
|
|
2708
2708
|
} }, { key: "set", value: function(a) {
|
|
2709
|
-
return
|
|
2709
|
+
return W(k(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
2710
2710
|
} }, { key: "unset", value: function() {
|
|
2711
|
-
|
|
2711
|
+
W(k(i.prototype), "unset", this).call(this);
|
|
2712
2712
|
var a = n.interactables.list.indexOf(this);
|
|
2713
2713
|
a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
|
|
2714
2714
|
} }]), i;
|
|
@@ -2723,7 +2723,7 @@ function $o() {
|
|
|
2723
2723
|
}
|
|
2724
2724
|
} }, { key: "init", value: function(e) {
|
|
2725
2725
|
return this.isInitialized ? this : (function(n, r) {
|
|
2726
|
-
return n.isInitialized = !0,
|
|
2726
|
+
return n.isInitialized = !0, b.window(r) && F(r), K.init(r), re.init(r), Te.init(r), n.window = r, n.document = r.document, n.usePlugin(br), n.usePlugin(vr), n;
|
|
2727
2727
|
})(this, e);
|
|
2728
2728
|
} }, { key: "pluginIsInstalled", value: function(e) {
|
|
2729
2729
|
var n = e.id;
|
|
@@ -2743,10 +2743,10 @@ function $o() {
|
|
|
2743
2743
|
return this;
|
|
2744
2744
|
} }, { key: "addDocument", value: function(e, n) {
|
|
2745
2745
|
if (this.getDocIndex(e) !== -1) return !1;
|
|
2746
|
-
var r =
|
|
2746
|
+
var r = $(e);
|
|
2747
2747
|
n = n ? z({}, n) : {}, this.documents.push({ doc: e, options: n }), this.events.documents.push(e), e !== this.document && this.events.add(r, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: e, window: r, scope: this, options: n });
|
|
2748
2748
|
} }, { key: "removeDocument", value: function(e) {
|
|
2749
|
-
var n = this.getDocIndex(e), r =
|
|
2749
|
+
var n = this.getDocIndex(e), r = $(e), o = this.documents[n].options;
|
|
2750
2750
|
this.events.remove(r, "unload", this.onWindowUnload), this.documents.splice(n, 1), this.events.documents.splice(n, 1), this.fire("scope:remove-document", { doc: e, window: r, scope: this, options: o });
|
|
2751
2751
|
} }, { key: "getDocIndex", value: function(e) {
|
|
2752
2752
|
for (var n = 0; n < this.documents.length; n++) if (this.documents[n].doc === e) return n;
|
|
@@ -2771,8 +2771,8 @@ function $o() {
|
|
|
2771
2771
|
return o in t || i in t;
|
|
2772
2772
|
})), n = function(r, o) {
|
|
2773
2773
|
for (var i = t.range, a = t.limits, s = a === void 0 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : a, l = t.offset, d = l === void 0 ? { x: 0, y: 0 } : l, c = { range: i, grid: t, x: null, y: null }, f = 0; f < e.length; f++) {
|
|
2774
|
-
var
|
|
2775
|
-
c[
|
|
2774
|
+
var x = e[f], A = x[0], T = x[1], R = Math.round((r - d.x) / t[A]), L = Math.round((o - d.y) / t[T]);
|
|
2775
|
+
c[A] = Math.max(s.left, Math.min(s.right, R * t[A] + d.x)), c[T] = Math.max(s.top, Math.min(s.bottom, L * t[T] + d.y));
|
|
2776
2776
|
}
|
|
2777
2777
|
return c;
|
|
2778
2778
|
};
|
|
@@ -2780,27 +2780,27 @@ function $o() {
|
|
|
2780
2780
|
} }), Sr = { id: "snappers", install: function(t) {
|
|
2781
2781
|
var e = t.interactStatic;
|
|
2782
2782
|
e.snappers = z(e.snappers || {}, Cr), e.createSnapGrid = e.snappers.grid;
|
|
2783
|
-
} }, Tr = Sr,
|
|
2783
|
+
} }, Tr = Sr, Ar = { start: function(t) {
|
|
2784
2784
|
var e = t.state, n = t.rect, r = t.edges, o = t.pageCoords, i = e.options, a = i.ratio, s = i.enabled, l = e.options, d = l.equalDelta, c = l.modifiers;
|
|
2785
2785
|
a === "preserve" && (a = n.width / n.height), e.startCoords = z({}, o), e.startRect = z({}, n), e.ratio = a, e.equalDelta = d;
|
|
2786
2786
|
var f = e.linkedEdges = { top: r.top || r.left && !r.bottom, left: r.left || r.top && !r.right, bottom: r.bottom || r.right && !r.top, right: r.right || r.bottom && !r.left };
|
|
2787
2787
|
if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
|
|
2788
|
-
var
|
|
2789
|
-
e.edgeSign = { x
|
|
2788
|
+
var x = (f.left ? 1 : -1) * (f.top ? 1 : -1);
|
|
2789
|
+
e.edgeSign = { x, y: x };
|
|
2790
2790
|
} else e.edgeSign = { x: f.left ? -1 : 1, y: f.top ? -1 : 1 };
|
|
2791
2791
|
if (s !== !1 && z(r, f), c != null && c.length) {
|
|
2792
|
-
var
|
|
2793
|
-
|
|
2792
|
+
var A = new It(t.interaction);
|
|
2793
|
+
A.copyFrom(t.interaction.modification), A.prepareStates(c), e.subModification = A, A.startAll(u({}, t));
|
|
2794
2794
|
}
|
|
2795
2795
|
}, set: function(t) {
|
|
2796
|
-
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = z({}, r), a = e.equalDelta ?
|
|
2796
|
+
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = z({}, r), a = e.equalDelta ? _r : Mr;
|
|
2797
2797
|
if (z(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
|
|
2798
2798
|
var s = z({}, n);
|
|
2799
2799
|
nt(o, s, { x: r.x - i.x, y: r.y - i.y });
|
|
2800
2800
|
var l = e.subModification.setAll(u(u({}, t), {}, { rect: s, edges: o, pageCoords: r, prevCoords: r, prevRect: s })), d = l.delta;
|
|
2801
2801
|
return l.changed && (a(e, Math.abs(d.x) > Math.abs(d.y), l.coords, l.rect), z(r, l.coords)), l.eventProps;
|
|
2802
2802
|
}, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
|
|
2803
|
-
function
|
|
2803
|
+
function _r(t, e, n) {
|
|
2804
2804
|
var r = t.startCoords, o = t.edgeSign;
|
|
2805
2805
|
e ? n.y = r.y + (n.x - r.x) * o.y : n.x = r.x + (n.y - r.y) * o.x;
|
|
2806
2806
|
}
|
|
@@ -2814,17 +2814,17 @@ function $o() {
|
|
|
2814
2814
|
n.x = i.x + (d - o.width) * s.x;
|
|
2815
2815
|
}
|
|
2816
2816
|
}
|
|
2817
|
-
var Rr =
|
|
2817
|
+
var Rr = Ae(Ar, "aspectRatio"), Tn = function() {
|
|
2818
2818
|
};
|
|
2819
2819
|
Tn._defaults = {};
|
|
2820
2820
|
var pt = Tn;
|
|
2821
|
-
function
|
|
2822
|
-
return
|
|
2821
|
+
function De(t, e, n) {
|
|
2822
|
+
return b.func(t) ? Le(t, e.interactable, e.element, [n.x, n.y, e]) : Le(t, e.interactable, e.element);
|
|
2823
2823
|
}
|
|
2824
2824
|
var ft = { start: function(t) {
|
|
2825
2825
|
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l = z({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
|
|
2826
2826
|
if (e && s) {
|
|
2827
|
-
var d =
|
|
2827
|
+
var d = De(a.restriction, o, i);
|
|
2828
2828
|
if (d) {
|
|
2829
2829
|
var c = d.right - d.left - e.width, f = d.bottom - d.top - e.height;
|
|
2830
2830
|
c < 0 && (l.left += c, l.right += c), f < 0 && (l.top += f, l.bottom += f);
|
|
@@ -2833,14 +2833,14 @@ function $o() {
|
|
|
2833
2833
|
}
|
|
2834
2834
|
r.offset = l;
|
|
2835
2835
|
}, set: function(t) {
|
|
2836
|
-
var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a =
|
|
2836
|
+
var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a = De(o.restriction, n, e);
|
|
2837
2837
|
if (a) {
|
|
2838
2838
|
var s = (function(l) {
|
|
2839
2839
|
return !l || "left" in l && "top" in l || ((l = z({}, l)).left = l.x || 0, l.top = l.y || 0, l.right = l.right || l.left + l.width, l.bottom = l.bottom || l.top + l.height), l;
|
|
2840
2840
|
})(a);
|
|
2841
2841
|
e.x = Math.max(Math.min(s.right - i.right, e.x), s.left + i.left), e.y = Math.max(Math.min(s.bottom - i.bottom, e.y), s.top + i.top);
|
|
2842
2842
|
}
|
|
2843
|
-
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Ir =
|
|
2843
|
+
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Ir = Ae(ft, "restrict"), An = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, _n = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
|
|
2844
2844
|
function Mn(t, e) {
|
|
2845
2845
|
for (var n = 0, r = ["top", "left", "bottom", "right"]; n < r.length; n++) {
|
|
2846
2846
|
var o = r[n];
|
|
@@ -2848,30 +2848,30 @@ function $o() {
|
|
|
2848
2848
|
}
|
|
2849
2849
|
return t;
|
|
2850
2850
|
}
|
|
2851
|
-
var $e = { noInner:
|
|
2851
|
+
var $e = { noInner: An, noOuter: _n, start: function(t) {
|
|
2852
2852
|
var e, n = t.interaction, r = t.startOffset, o = t.state, i = o.options;
|
|
2853
|
-
i && (e = tt(
|
|
2853
|
+
i && (e = tt(De(i.offset, n, n.coords.start.page))), e = e || { x: 0, y: 0 }, o.offset = { top: e.y + r.top, left: e.x + r.left, bottom: e.y - r.bottom, right: e.x - r.right };
|
|
2854
2854
|
}, set: function(t) {
|
|
2855
2855
|
var e = t.coords, n = t.edges, r = t.interaction, o = t.state, i = o.offset, a = o.options;
|
|
2856
2856
|
if (n) {
|
|
2857
|
-
var s = z({}, e), l =
|
|
2858
|
-
Mn(l,
|
|
2857
|
+
var s = z({}, e), l = De(a.inner, r, s) || {}, d = De(a.outer, r, s) || {};
|
|
2858
|
+
Mn(l, An), Mn(d, _n), n.top ? e.y = Math.min(Math.max(d.top + i.top, s.y), l.top + i.top) : n.bottom && (e.y = Math.max(Math.min(d.bottom + i.bottom, s.y), l.bottom + i.bottom)), n.left ? e.x = Math.min(Math.max(d.left + i.left, s.x), l.left + i.left) : n.right && (e.x = Math.max(Math.min(d.right + i.right, s.x), l.right + i.right));
|
|
2859
2859
|
}
|
|
2860
|
-
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Pr =
|
|
2860
|
+
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Pr = Ae($e, "restrictEdges"), Dr = z({ get elementRect() {
|
|
2861
2861
|
return { top: 0, left: 0, bottom: 1, right: 1 };
|
|
2862
2862
|
}, set elementRect(t) {
|
|
2863
|
-
} }, ft.defaults),
|
|
2863
|
+
} }, ft.defaults), Or = Ae({ start: ft.start, set: ft.set, defaults: Dr }, "restrictRect"), Nr = { width: -1 / 0, height: -1 / 0 }, Lr = { width: 1 / 0, height: 1 / 0 }, zr = Ae({ start: function(t) {
|
|
2864
2864
|
return $e.start(t);
|
|
2865
2865
|
}, set: function(t) {
|
|
2866
2866
|
var e = t.interaction, n = t.state, r = t.rect, o = t.edges, i = n.options;
|
|
2867
2867
|
if (o) {
|
|
2868
|
-
var a = gt(
|
|
2868
|
+
var a = gt(De(i.min, e, t.coords)) || Nr, s = gt(De(i.max, e, t.coords)) || Lr;
|
|
2869
2869
|
n.options = { endOnly: i.endOnly, inner: z({}, $e.noInner), outer: z({}, $e.noOuter) }, o.top ? (n.options.inner.top = r.bottom - a.height, n.options.outer.top = r.bottom - s.height) : o.bottom && (n.options.inner.bottom = r.top + a.height, n.options.outer.bottom = r.top + s.height), o.left ? (n.options.inner.left = r.right - a.width, n.options.outer.left = r.right - s.width) : o.right && (n.options.inner.right = r.left + a.width, n.options.outer.right = r.left + s.width), $e.set(t), n.options = i;
|
|
2870
2870
|
}
|
|
2871
2871
|
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), zt = { start: function(t) {
|
|
2872
|
-
var e, n = t.interaction, r = t.interactable, o = t.element, i = t.rect, a = t.state, s = t.startOffset, l = a.options, d = l.offsetWithOrigin ? (function(
|
|
2873
|
-
var
|
|
2874
|
-
return
|
|
2872
|
+
var e, n = t.interaction, r = t.interactable, o = t.element, i = t.rect, a = t.state, s = t.startOffset, l = a.options, d = l.offsetWithOrigin ? (function(x) {
|
|
2873
|
+
var A = x.interaction.element, T = tt(Le(x.state.options.origin, null, null, [A])), R = T || ze(x.interactable, A, x.interaction.prepared.name);
|
|
2874
|
+
return R;
|
|
2875
2875
|
})(t) : { x: 0, y: 0 };
|
|
2876
2876
|
if (l.offset === "startCoords") e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
2877
2877
|
else {
|
|
@@ -2879,22 +2879,22 @@ function $o() {
|
|
|
2879
2879
|
(e = tt(c) || { x: 0, y: 0 }).x += d.x, e.y += d.y;
|
|
2880
2880
|
}
|
|
2881
2881
|
var f = l.relativePoints;
|
|
2882
|
-
a.offsets = i && f && f.length ? f.map((function(
|
|
2883
|
-
return { index:
|
|
2882
|
+
a.offsets = i && f && f.length ? f.map((function(x, A) {
|
|
2883
|
+
return { index: A, relativePoint: x, x: s.left - i.width * x.x + e.x, y: s.top - i.height * x.y + e.y };
|
|
2884
2884
|
})) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
|
|
2885
2885
|
}, set: function(t) {
|
|
2886
2886
|
var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = ze(e.interactable, e.element, e.prepared.name), s = z({}, n), l = [];
|
|
2887
2887
|
o.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
2888
|
-
for (var d = 0, c = i; d < c.length; d++) for (var f = c[d],
|
|
2889
|
-
var
|
|
2890
|
-
(
|
|
2888
|
+
for (var d = 0, c = i; d < c.length; d++) for (var f = c[d], x = s.x - f.x, A = s.y - f.y, T = 0, R = o.targets.length; T < R; T++) {
|
|
2889
|
+
var L = o.targets[T], D = void 0;
|
|
2890
|
+
(D = b.func(L) ? L(x, A, e._proxy, f, T) : L) && l.push({ x: (b.number(D.x) ? D.x : x) + f.x, y: (b.number(D.y) ? D.y : A) + f.y, range: b.number(D.range) ? D.range : o.range, source: L, index: T, offset: f });
|
|
2891
2891
|
}
|
|
2892
|
-
for (var
|
|
2893
|
-
var
|
|
2894
|
-
|
|
2892
|
+
for (var j = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, G = 0; G < l.length; G++) {
|
|
2893
|
+
var te = l[G], Y = te.range, Q = te.x - s.x, ve = te.y - s.y, ae = Fe(Q, ve), ge = ae <= Y;
|
|
2894
|
+
Y === 1 / 0 && j.inRange && j.range !== 1 / 0 && (ge = !1), j.target && !(ge ? j.inRange && Y !== 1 / 0 ? ae / Y < j.distance / j.range : Y === 1 / 0 && j.range !== 1 / 0 || ae < j.distance : !j.inRange && ae < j.distance) || (j.target = te, j.distance = ae, j.range = Y, j.inRange = ge, j.delta.x = Q, j.delta.y = ve);
|
|
2895
2895
|
}
|
|
2896
|
-
return
|
|
2897
|
-
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Fr =
|
|
2896
|
+
return j.inRange && (n.x = j.target.x, n.y = j.target.y), r.closest = j, j;
|
|
2897
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Fr = Ae(zt, "snap"), ht = { start: function(t) {
|
|
2898
2898
|
var e = t.state, n = t.edges, r = e.options;
|
|
2899
2899
|
if (!n) return null;
|
|
2900
2900
|
t.state = { options: { targets: null, relativePoints: [{ x: n.left ? 0 : 1, y: n.top ? 0 : 1 }], offset: r.offset || "self", origin: { x: 0, y: 0 }, range: r.range } }, e.targetFields = e.targetFields || [["width", "height"], ["x", "y"]], zt.start(t), e.offsets = t.state.offsets, t.state = e;
|
|
@@ -2903,20 +2903,20 @@ function $o() {
|
|
|
2903
2903
|
n.options = z({}, o), n.options.targets = [];
|
|
2904
2904
|
for (var s = 0, l = o.targets || []; s < l.length; s++) {
|
|
2905
2905
|
var d = l[s], c = void 0;
|
|
2906
|
-
if (c =
|
|
2907
|
-
for (var f = 0,
|
|
2908
|
-
var
|
|
2909
|
-
if (
|
|
2910
|
-
c.x = c[
|
|
2906
|
+
if (c = b.func(d) ? d(a.x, a.y, e) : d) {
|
|
2907
|
+
for (var f = 0, x = n.targetFields; f < x.length; f++) {
|
|
2908
|
+
var A = x[f], T = A[0], R = A[1];
|
|
2909
|
+
if (T in c || R in c) {
|
|
2910
|
+
c.x = c[T], c.y = c[R];
|
|
2911
2911
|
break;
|
|
2912
2912
|
}
|
|
2913
2913
|
}
|
|
2914
2914
|
n.options.targets.push(c);
|
|
2915
2915
|
}
|
|
2916
2916
|
}
|
|
2917
|
-
var
|
|
2918
|
-
return n.options = o,
|
|
2919
|
-
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr =
|
|
2917
|
+
var L = zt.set(t);
|
|
2918
|
+
return n.options = o, L;
|
|
2919
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = Ae(ht, "snapSize"), Ft = { aspectRatio: Rr, restrictEdges: Pr, restrict: Ir, restrictRect: Or, restrictSize: zr, snapEdges: Ae({ start: function(t) {
|
|
2920
2920
|
var e = t.edges;
|
|
2921
2921
|
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], ht.start(t)) : null;
|
|
2922
2922
|
}, set: ht.set, defaults: z(Ne(ht.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Fr, snapSize: jr, spring: pt, avoid: pt, transform: pt, rubberband: pt }, Hr = { id: "modifiers", install: function(t) {
|
|
@@ -2925,12 +2925,12 @@ function $o() {
|
|
|
2925
2925
|
var r = Ft[n], o = r._defaults, i = r._methods;
|
|
2926
2926
|
o._methods = i, t.defaults.perAction[n] = o;
|
|
2927
2927
|
}
|
|
2928
|
-
} },
|
|
2929
|
-
|
|
2930
|
-
var e =
|
|
2928
|
+
} }, Wr = Hr, Rn = (function(t) {
|
|
2929
|
+
S(n, t);
|
|
2930
|
+
var e = I(n);
|
|
2931
2931
|
function n(r, o, i, a, s, l) {
|
|
2932
2932
|
var d;
|
|
2933
|
-
if (y(this, n), rt(
|
|
2933
|
+
if (y(this, n), rt(O(d = e.call(this, s)), i), i !== o && rt(O(d), o), d.timeStamp = l, d.originalEvent = i, d.type = r, d.pointerId = je(o), d.pointerType = Vt(o), d.target = a, d.currentTarget = null, r === "tap") {
|
|
2934
2934
|
var c = s.getPointerIndex(o);
|
|
2935
2935
|
d.dt = d.timeStamp - s.pointers[c].downTime;
|
|
2936
2936
|
var f = d.timeStamp - s.tapTime;
|
|
@@ -2960,18 +2960,18 @@ function $o() {
|
|
|
2960
2960
|
t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && jt(t), Me({ interaction: n, pointer: r, event: o, eventTarget: i, type: "move" }, e));
|
|
2961
2961
|
}, "interactions:down": function(t, e) {
|
|
2962
2962
|
(function(n, r) {
|
|
2963
|
-
for (var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget, l = n.pointerIndex, d = o.pointers[l].hold, c = ue(s), f = { interaction: o, pointer: i, event: a, eventTarget: s, type: "hold", targets: [], path: c, node: null },
|
|
2964
|
-
var
|
|
2965
|
-
f.node =
|
|
2963
|
+
for (var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget, l = n.pointerIndex, d = o.pointers[l].hold, c = ue(s), f = { interaction: o, pointer: i, event: a, eventTarget: s, type: "hold", targets: [], path: c, node: null }, x = 0; x < c.length; x++) {
|
|
2964
|
+
var A = c[x];
|
|
2965
|
+
f.node = A, r.fire("pointerEvents:collect-targets", f);
|
|
2966
2966
|
}
|
|
2967
2967
|
if (f.targets.length) {
|
|
2968
|
-
for (var
|
|
2969
|
-
var
|
|
2970
|
-
|
|
2968
|
+
for (var T = 1 / 0, R = 0, L = f.targets; R < L.length; R++) {
|
|
2969
|
+
var D = L[R].eventable.options.holdDuration;
|
|
2970
|
+
D < T && (T = D);
|
|
2971
2971
|
}
|
|
2972
|
-
d.duration =
|
|
2972
|
+
d.duration = T, d.timeout = setTimeout((function() {
|
|
2973
2973
|
Me({ interaction: o, eventTarget: s, pointer: i, event: a, type: "hold" }, r);
|
|
2974
|
-
}),
|
|
2974
|
+
}), T);
|
|
2975
2975
|
}
|
|
2976
2976
|
})(t, e), Me(t, e);
|
|
2977
2977
|
}, "interactions:up": function(t, e) {
|
|
@@ -2986,14 +2986,14 @@ function $o() {
|
|
|
2986
2986
|
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = t.targets, l = s === void 0 ? In(t, e) : s, d = new Rn(a, r, o, i, n, e.now());
|
|
2987
2987
|
e.fire("pointerEvents:new", { pointerEvent: d });
|
|
2988
2988
|
for (var c = { interaction: n, pointer: r, event: o, eventTarget: i, targets: l, type: a, pointerEvent: d }, f = 0; f < l.length; f++) {
|
|
2989
|
-
var
|
|
2990
|
-
for (var
|
|
2991
|
-
var
|
|
2992
|
-
if (d._subtractOrigin(
|
|
2989
|
+
var x = l[f];
|
|
2990
|
+
for (var A in x.props || {}) d[A] = x.props[A];
|
|
2991
|
+
var T = ze(x.eventable, x.node);
|
|
2992
|
+
if (d._subtractOrigin(T), d.eventable = x.eventable, d.currentTarget = x.node, x.eventable.fire(d), d._addOrigin(T), d.immediatePropagationStopped || d.propagationStopped && f + 1 < l.length && l[f + 1].node !== d.currentTarget) break;
|
|
2993
2993
|
}
|
|
2994
2994
|
if (e.fire("pointerEvents:fired", c), a === "tap") {
|
|
2995
|
-
var
|
|
2996
|
-
n.prevTap =
|
|
2995
|
+
var R = d.double ? Me({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : d;
|
|
2996
|
+
n.prevTap = R, n.tapTime = R.timeStamp;
|
|
2997
2997
|
}
|
|
2998
2998
|
return d;
|
|
2999
2999
|
}
|
|
@@ -3001,20 +3001,20 @@ function $o() {
|
|
|
3001
3001
|
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = n.getPointerIndex(r), l = n.pointers[s];
|
|
3002
3002
|
if (a === "tap" && (n.pointerWasMoved || !l || l.downTarget !== i)) return [];
|
|
3003
3003
|
for (var d = ue(i), c = { interaction: n, pointer: r, event: o, eventTarget: i, type: a, path: d, targets: [], node: null }, f = 0; f < d.length; f++) {
|
|
3004
|
-
var
|
|
3005
|
-
c.node =
|
|
3004
|
+
var x = d[f];
|
|
3005
|
+
c.node = x, e.fire("pointerEvents:collect-targets", c);
|
|
3006
3006
|
}
|
|
3007
|
-
return a === "hold" && (c.targets = c.targets.filter((function(
|
|
3008
|
-
var
|
|
3009
|
-
return
|
|
3007
|
+
return a === "hold" && (c.targets = c.targets.filter((function(A) {
|
|
3008
|
+
var T, R;
|
|
3009
|
+
return A.eventable.options.holdDuration === ((T = n.pointers[s]) == null || (R = T.hold) == null ? void 0 : R.duration);
|
|
3010
3010
|
}))), c.targets;
|
|
3011
3011
|
}
|
|
3012
3012
|
function jt(t) {
|
|
3013
3013
|
var e = t.interaction, n = t.pointerIndex, r = e.pointers[n].hold;
|
|
3014
3014
|
r && r.timeout && (clearTimeout(r.timeout), r.timeout = null);
|
|
3015
3015
|
}
|
|
3016
|
-
var
|
|
3017
|
-
function
|
|
3016
|
+
var Br = Object.freeze({ __proto__: null, default: Ve });
|
|
3017
|
+
function qr(t) {
|
|
3018
3018
|
var e = t.interaction;
|
|
3019
3019
|
e.holdIntervalHandle && (clearInterval(e.holdIntervalHandle), e.holdIntervalHandle = null);
|
|
3020
3020
|
}
|
|
@@ -3023,7 +3023,7 @@ function $o() {
|
|
|
3023
3023
|
var e = t.pointerEvents;
|
|
3024
3024
|
e.defaults.holdRepeatInterval = 0, e.types.holdrepeat = t.actions.phaselessTypes.holdrepeat = !0;
|
|
3025
3025
|
}, listeners: ["move", "up", "cancel", "endall"].reduce((function(t, e) {
|
|
3026
|
-
return t["pointerEvents:".concat(e)] =
|
|
3026
|
+
return t["pointerEvents:".concat(e)] = qr, t;
|
|
3027
3027
|
}), { "pointerEvents:new": function(t) {
|
|
3028
3028
|
var e = t.pointerEvent;
|
|
3029
3029
|
e.type === "hold" && (e.count = (e.count || 0) + 1);
|
|
@@ -3060,23 +3060,23 @@ function $o() {
|
|
|
3060
3060
|
var n = t.interactable, r = t.options;
|
|
3061
3061
|
z(n.events.options, e.pointerEvents.defaults), z(n.events.options, r.pointerEvents || {});
|
|
3062
3062
|
} } }, Ur = Vr, Xr = { id: "pointer-events", install: function(t) {
|
|
3063
|
-
t.usePlugin(
|
|
3063
|
+
t.usePlugin(Br), t.usePlugin($r), t.usePlugin(Ur);
|
|
3064
3064
|
} }, Gr = Xr, Kr = { id: "reflow", install: function(t) {
|
|
3065
3065
|
var e = t.Interactable;
|
|
3066
3066
|
t.actions.phases.reflow = !0, e.prototype.reflow = function(n) {
|
|
3067
3067
|
return (function(r, o, i) {
|
|
3068
3068
|
for (var a = r.getAllElements(), s = i.window.Promise, l = s ? [] : null, d = function() {
|
|
3069
|
-
var f = a[c],
|
|
3070
|
-
if (!
|
|
3071
|
-
var
|
|
3072
|
-
return
|
|
3069
|
+
var f = a[c], x = r.getRect(f);
|
|
3070
|
+
if (!x) return 1;
|
|
3071
|
+
var A, T = We(i.interactions.list, (function(D) {
|
|
3072
|
+
return D.interacting() && D.interactable === r && D.element === f && D.prepared.name === o.name;
|
|
3073
3073
|
}));
|
|
3074
|
-
if (
|
|
3075
|
-
|
|
3074
|
+
if (T) T.move(), l && (A = T._reflowPromise || new s((function(D) {
|
|
3075
|
+
T._reflowResolve = D;
|
|
3076
3076
|
})));
|
|
3077
3077
|
else {
|
|
3078
|
-
var
|
|
3079
|
-
return { coords:
|
|
3078
|
+
var R = gt(x), L = /* @__PURE__ */ (function(D) {
|
|
3079
|
+
return { coords: D, get page() {
|
|
3080
3080
|
return this.coords.page;
|
|
3081
3081
|
}, get client() {
|
|
3082
3082
|
return this.coords.client;
|
|
@@ -3102,17 +3102,17 @@ function $o() {
|
|
|
3102
3102
|
return this.coords.buttons;
|
|
3103
3103
|
}, preventDefault: function() {
|
|
3104
3104
|
} };
|
|
3105
|
-
})({ page: { x:
|
|
3106
|
-
|
|
3107
|
-
var
|
|
3108
|
-
|
|
3109
|
-
var ae =
|
|
3110
|
-
|
|
3105
|
+
})({ page: { x: R.x, y: R.y }, client: { x: R.x, y: R.y }, timeStamp: i.now() });
|
|
3106
|
+
A = (function(D, j, G, te, Y) {
|
|
3107
|
+
var Q = D.interactions.new({ pointerType: "reflow" }), ve = { interaction: Q, event: Y, pointer: Y, eventTarget: G, phase: "reflow" };
|
|
3108
|
+
Q.interactable = j, Q.element = G, Q.prevEvent = Y, Q.updatePointer(Y, Y, G, !0), Bt(Q.coords.delta), At(Q.prepared, te), Q._doPhase(ve);
|
|
3109
|
+
var ae = D.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
|
|
3110
|
+
Q._reflowResolve = Se;
|
|
3111
3111
|
})) : void 0;
|
|
3112
|
-
return
|
|
3113
|
-
})(i, r, f, o,
|
|
3112
|
+
return Q._reflowPromise = be, Q.start(te, j, G), Q._interacting ? (Q.move(ve), Q.end(Y)) : (Q.stop(), Q._reflowResolve()), Q.removePointer(Y, Y), be;
|
|
3113
|
+
})(i, r, f, o, L);
|
|
3114
3114
|
}
|
|
3115
|
-
l && l.push(
|
|
3115
|
+
l && l.push(A);
|
|
3116
3116
|
}, c = 0; c < a.length && !d(); c++) ;
|
|
3117
3117
|
return l && s.all(l).then((function() {
|
|
3118
3118
|
return r;
|
|
@@ -3125,7 +3125,7 @@ function $o() {
|
|
|
3125
3125
|
r.splice(r.indexOf(o), 1);
|
|
3126
3126
|
})(e.interactions.list, n));
|
|
3127
3127
|
} } }, Jr = Kr;
|
|
3128
|
-
if (me.use(un), me.use(vn), me.use(Gr), me.use(hr), me.use(
|
|
3128
|
+
if (me.use(un), me.use(vn), me.use(Gr), me.use(hr), me.use(Wr), me.use(nr), me.use($n), me.use(Un), me.use(Jr), me.default = me, v(h) === "object" && h) try {
|
|
3129
3129
|
h.exports = me;
|
|
3130
3130
|
} catch {
|
|
3131
3131
|
}
|
|
@@ -3134,7 +3134,7 @@ function $o() {
|
|
|
3134
3134
|
})(Je, Je.exports)), Je.exports;
|
|
3135
3135
|
}
|
|
3136
3136
|
var Vo = /* @__PURE__ */ $o();
|
|
3137
|
-
const Ze = /* @__PURE__ */
|
|
3137
|
+
const Ze = /* @__PURE__ */ qo(Vo);
|
|
3138
3138
|
function Uo(h) {
|
|
3139
3139
|
const p = new DOMParser().parseFromString(h, "text/html");
|
|
3140
3140
|
return Array.from(p.querySelectorAll("img")).forEach((v) => {
|
|
@@ -3143,24 +3143,71 @@ function Uo(h) {
|
|
|
3143
3143
|
if (!w) return;
|
|
3144
3144
|
const g = document.createElement("img");
|
|
3145
3145
|
g.src = w, v.alt && (g.alt = v.alt), v.title && (g.title = v.title), g.style.maxWidth = "100%", g.style.width = "100%", g.style.height = "auto", g.style.cursor = "pointer", g.draggable = !1;
|
|
3146
|
-
const
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3146
|
+
const C = (M) => {
|
|
3147
|
+
if (!M || M.includes("%")) return null;
|
|
3148
|
+
const F = String(M).match(/(\d+(?:\.\d+)?)/);
|
|
3149
|
+
if (!F) return null;
|
|
3150
|
+
const $ = Math.round(Number(F[1]));
|
|
3151
|
+
return Number.isFinite($) && $ > 0 ? $ : null;
|
|
3152
|
+
};
|
|
3153
|
+
let S = null;
|
|
3154
|
+
if (S = C(v.getAttribute("width")), S || (S = C(v.style.width)), !S) {
|
|
3155
|
+
const F = (v.getAttribute("style") || "").match(
|
|
3156
|
+
/(?:^|;)\s*width:\s*(\d+(?:\.\d+)?px)/i
|
|
3157
|
+
);
|
|
3158
|
+
F && (S = C(F[1]));
|
|
3159
|
+
}
|
|
3160
|
+
if (S || (S = C(v.style.maxWidth)), !S) {
|
|
3161
|
+
const M = v.closest(
|
|
3162
|
+
".editor-image-wrapper"
|
|
3163
|
+
);
|
|
3164
|
+
M && (S = C(M.style.width) || C(M.getAttribute("width")));
|
|
3165
|
+
}
|
|
3166
|
+
if (!S) {
|
|
3167
|
+
const M = v.closest("figure");
|
|
3168
|
+
M && (S = C(M.style.width) || C(M.getAttribute("width")));
|
|
3169
|
+
}
|
|
3170
|
+
if (!S) {
|
|
3171
|
+
const M = v.parentElement;
|
|
3172
|
+
M && M.tagName !== "BODY" && (S = C(M.style.width) || C(M.getAttribute("width")));
|
|
3173
|
+
}
|
|
3174
|
+
S || (S = C(v.getAttribute("data-width"))), !S && v.naturalWidth > 0 && (S = v.naturalWidth);
|
|
3175
|
+
const k = S ? `${S}px` : "700px";
|
|
3176
|
+
let _ = "left";
|
|
3177
|
+
const O = v.closest("[data-align]");
|
|
3178
|
+
if (O)
|
|
3179
|
+
_ = O.getAttribute("data-align") || "left";
|
|
3180
|
+
else {
|
|
3181
|
+
const M = v.closest("figure"), F = v.closest("p"), $ = v.closest("div"), oe = (X) => {
|
|
3182
|
+
if (!X) return null;
|
|
3183
|
+
if (X.style.textAlign) return X.style.textAlign;
|
|
3184
|
+
const ne = (X.getAttribute("style") || "").match(
|
|
3185
|
+
/text-align:\s*(left|center|right|justify)/i
|
|
3186
|
+
);
|
|
3187
|
+
if (ne) return ne[1].toLowerCase();
|
|
3188
|
+
const B = X.getAttribute("align");
|
|
3189
|
+
return B ? B.toLowerCase() : X.classList.contains("center") || X.classList.contains("text-center") || X.classList.contains("align-center") ? "center" : X.classList.contains("right") || X.classList.contains("text-right") || X.classList.contains("align-right") ? "right" : null;
|
|
3190
|
+
};
|
|
3191
|
+
_ = oe(M) || oe($) || oe(F) || "left", (v.style.margin === "auto" || v.style.margin === "0 auto" || v.style.marginLeft === "auto" && v.style.marginRight === "auto") && (_ = "center"), v.style.display === "block" && (v.style.marginLeft === "auto" || v.style.marginRight === "auto") && (_ = "center");
|
|
3192
|
+
}
|
|
3193
|
+
const I = document.createElement("div");
|
|
3194
|
+
I.className = "editor-image-wrapper", I.style.display = "inline-block", I.style.position = "relative", I.style.maxWidth = "100%", I.style.width = k && k !== "0px" ? k.includes("px") ? k : `${k}px` : "700px", I.style.height = "auto", I.contentEditable = "false", I.style.boxSizing = "border-box", I.style.touchAction = "none", I.style.userSelect = "none", I.appendChild(g);
|
|
3195
|
+
const W = document.createElement("div");
|
|
3196
|
+
W.className = "editor-image-container", W.style.margin = "10px 0", W.style.textAlign = _, W.style.display = "block", W.appendChild(I);
|
|
3197
|
+
let N = v;
|
|
3198
|
+
const P = v.closest("figure"), H = v.closest("picture");
|
|
3199
|
+
if (P && p.body.contains(P))
|
|
3200
|
+
N = P;
|
|
3201
|
+
else if (H && p.body.contains(H))
|
|
3202
|
+
N = H;
|
|
3156
3203
|
else {
|
|
3157
|
-
let
|
|
3158
|
-
for (;
|
|
3159
|
-
(
|
|
3204
|
+
let M = v.parentNode;
|
|
3205
|
+
for (; M && M !== p.body && M.parentNode !== p.body && Array.from(M.childNodes).filter(
|
|
3206
|
+
($) => $.nodeType === Node.ELEMENT_NODE || $.nodeType === Node.TEXT_NODE && $.textContent?.trim()
|
|
3160
3207
|
).length === 1; )
|
|
3161
|
-
|
|
3208
|
+
N = M, M = M.parentNode;
|
|
3162
3209
|
}
|
|
3163
|
-
|
|
3210
|
+
N && N.parentNode && p.body.contains(N) ? N.parentNode.replaceChild(W, N) : v.parentNode && p.body.contains(v) && v.parentNode.replaceChild(W, v);
|
|
3164
3211
|
}), p.body.innerHTML;
|
|
3165
3212
|
}
|
|
3166
3213
|
function Xo(h, m) {
|
|
@@ -3184,34 +3231,34 @@ function Xo(h, m) {
|
|
|
3184
3231
|
w.preventDefault(), w.stopPropagation();
|
|
3185
3232
|
}), p.addEventListener("drop", (w) => {
|
|
3186
3233
|
w.preventDefault(), w.stopPropagation();
|
|
3187
|
-
const g = w.clientX,
|
|
3188
|
-
let
|
|
3234
|
+
const g = w.clientX, C = w.clientY;
|
|
3235
|
+
let S = null;
|
|
3189
3236
|
if (document.caretRangeFromPoint)
|
|
3190
|
-
|
|
3237
|
+
S = document.caretRangeFromPoint(g, C);
|
|
3191
3238
|
else if (document.caretPositionFromPoint) {
|
|
3192
|
-
const _ = document.caretPositionFromPoint(g,
|
|
3193
|
-
_ && (
|
|
3239
|
+
const _ = document.caretPositionFromPoint(g, C);
|
|
3240
|
+
_ && (S = document.createRange(), S.setStart(_.offsetNode, _.offset));
|
|
3194
3241
|
}
|
|
3195
3242
|
const k = w.dataTransfer?.files;
|
|
3196
3243
|
if (k && k.length > 0)
|
|
3197
3244
|
for (let _ = 0; _ < k.length; _++) {
|
|
3198
|
-
const
|
|
3199
|
-
if (
|
|
3200
|
-
const
|
|
3201
|
-
|
|
3245
|
+
const O = k[_];
|
|
3246
|
+
if (O.type.startsWith("image/")) {
|
|
3247
|
+
const I = new FileReader();
|
|
3248
|
+
I.onload = (W) => {
|
|
3202
3249
|
const N = document.createElement("img");
|
|
3203
|
-
N.src =
|
|
3250
|
+
N.src = W.target?.result, N.style.maxWidth = "100%", N.style.width = "100%", N.style.height = "auto", N.style.cursor = "pointer", N.draggable = !1;
|
|
3204
3251
|
const P = document.createElement("div");
|
|
3205
3252
|
P.className = "editor-image-wrapper", P.style.display = "inline-block", P.style.position = "relative", P.style.maxWidth = "100%", P.style.width = "auto", P.style.height = "auto", P.contentEditable = "false", P.style.userSelect = "none", P.style.boxSizing = "border-box", P.style.touchAction = "none", P.appendChild(N);
|
|
3206
3253
|
const H = document.createElement("div");
|
|
3207
|
-
if (H.className = "editor-image-container", H.style.margin = "10px 0", H.style.textAlign = "left", H.style.display = "block", H.appendChild(P),
|
|
3254
|
+
if (H.className = "editor-image-container", H.style.margin = "10px 0", H.style.textAlign = "left", H.style.display = "block", H.appendChild(P), S)
|
|
3208
3255
|
try {
|
|
3209
|
-
|
|
3210
|
-
const
|
|
3211
|
-
if (
|
|
3212
|
-
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3256
|
+
S.insertNode(H);
|
|
3257
|
+
const M = window.getSelection();
|
|
3258
|
+
if (M) {
|
|
3259
|
+
M.removeAllRanges();
|
|
3260
|
+
const F = document.createRange();
|
|
3261
|
+
F.setStartAfter(H), F.collapse(!0), M.addRange(F), de(F);
|
|
3215
3262
|
}
|
|
3216
3263
|
} catch {
|
|
3217
3264
|
p.appendChild(H);
|
|
@@ -3219,76 +3266,78 @@ function Xo(h, m) {
|
|
|
3219
3266
|
else
|
|
3220
3267
|
p.appendChild(H);
|
|
3221
3268
|
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus();
|
|
3222
|
-
},
|
|
3269
|
+
}, I.readAsDataURL(O);
|
|
3223
3270
|
}
|
|
3224
3271
|
}
|
|
3225
3272
|
}), p.addEventListener("copy", (w) => {
|
|
3226
3273
|
const g = window.getSelection();
|
|
3227
3274
|
if (!g || g.rangeCount === 0) return;
|
|
3228
|
-
const
|
|
3229
|
-
k.appendChild(
|
|
3275
|
+
const S = g.getRangeAt(0).cloneContents(), k = document.createElement("div");
|
|
3276
|
+
k.appendChild(S), k.querySelectorAll(".editor-image-wrapper").forEach((N) => {
|
|
3230
3277
|
const P = N.querySelector("img");
|
|
3231
3278
|
if (P) {
|
|
3232
|
-
const H = P,
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3279
|
+
const H = P, M = N;
|
|
3280
|
+
if (M.style.width) {
|
|
3281
|
+
const F = parseInt(M.style.width).toString();
|
|
3282
|
+
H.setAttribute("width", F), H.setAttribute("data-width", F);
|
|
3283
|
+
}
|
|
3284
|
+
M.style.width && M.setAttribute("data-wrapper-width", M.style.width);
|
|
3237
3285
|
}
|
|
3238
3286
|
}), k.querySelectorAll(".editor-image-container").forEach((N) => {
|
|
3239
3287
|
const P = N;
|
|
3240
3288
|
P.style.textAlign && P.setAttribute("data-align", P.style.textAlign);
|
|
3241
3289
|
});
|
|
3242
|
-
const
|
|
3243
|
-
w.clipboardData?.setData("text/html",
|
|
3290
|
+
const I = k.innerHTML, W = g.toString();
|
|
3291
|
+
w.clipboardData?.setData("text/html", I), w.clipboardData?.setData("text/plain", W), w.preventDefault();
|
|
3244
3292
|
}), p.addEventListener("cut", (w) => {
|
|
3245
3293
|
const g = window.getSelection();
|
|
3246
3294
|
if (!g || g.rangeCount === 0) return;
|
|
3247
|
-
const
|
|
3248
|
-
k.appendChild(
|
|
3295
|
+
const C = g.getRangeAt(0), S = C.cloneContents(), k = document.createElement("div");
|
|
3296
|
+
k.appendChild(S), k.querySelectorAll(".editor-image-wrapper").forEach((N) => {
|
|
3249
3297
|
const P = N.querySelector("img");
|
|
3250
3298
|
if (P) {
|
|
3251
|
-
const H = P,
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3299
|
+
const H = P, M = N;
|
|
3300
|
+
if (M.style.width) {
|
|
3301
|
+
const F = parseInt(M.style.width).toString();
|
|
3302
|
+
H.setAttribute("width", F), H.setAttribute("data-width", F);
|
|
3303
|
+
}
|
|
3304
|
+
M.style.width && M.setAttribute("data-wrapper-width", M.style.width);
|
|
3256
3305
|
}
|
|
3257
3306
|
}), k.querySelectorAll(".editor-image-container").forEach((N) => {
|
|
3258
3307
|
const P = N;
|
|
3259
3308
|
P.style.textAlign && P.setAttribute("data-align", P.style.textAlign);
|
|
3260
3309
|
});
|
|
3261
|
-
const
|
|
3262
|
-
w.clipboardData?.setData("text/html",
|
|
3310
|
+
const I = k.innerHTML, W = g.toString();
|
|
3311
|
+
w.clipboardData?.setData("text/html", I), w.clipboardData?.setData("text/plain", W), w.preventDefault(), C.deleteContents(), p.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3263
3312
|
}), p.addEventListener("paste", async (w) => {
|
|
3264
3313
|
w.preventDefault();
|
|
3265
3314
|
const g = w.clipboardData;
|
|
3266
3315
|
if (!g) return;
|
|
3267
|
-
const
|
|
3268
|
-
if (
|
|
3269
|
-
for (const
|
|
3270
|
-
const
|
|
3271
|
-
if (
|
|
3272
|
-
const
|
|
3273
|
-
|
|
3316
|
+
const S = Array.from(g.items).filter((O) => O.type.startsWith("image/"));
|
|
3317
|
+
if (S.length > 0) {
|
|
3318
|
+
for (const O of S) {
|
|
3319
|
+
const I = O.getAsFile();
|
|
3320
|
+
if (I) {
|
|
3321
|
+
const W = new FileReader();
|
|
3322
|
+
W.onload = (N) => {
|
|
3274
3323
|
const P = N.target?.result;
|
|
3275
3324
|
if (P) {
|
|
3276
3325
|
const H = document.createElement("img");
|
|
3277
3326
|
H.src = P, H.style.maxWidth = "100%", H.style.width = "100%", H.style.height = "auto", H.style.cursor = "pointer", H.draggable = !1;
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3280
|
-
const
|
|
3281
|
-
|
|
3282
|
-
const
|
|
3283
|
-
if (
|
|
3284
|
-
|
|
3285
|
-
const
|
|
3286
|
-
|
|
3327
|
+
const M = document.createElement("div");
|
|
3328
|
+
M.className = "editor-image-wrapper", M.style.display = "inline-block", M.style.position = "relative", M.style.maxWidth = "100%", M.style.width = "700px", M.style.height = "500px", M.contentEditable = "false", M.style.boxSizing = "border-box", M.style.touchAction = "none", M.style.userSelect = "none", M.appendChild(H);
|
|
3329
|
+
const F = document.createElement("div");
|
|
3330
|
+
F.className = "editor-image-container", F.style.margin = "10px 0", F.style.textAlign = "left", F.style.display = "block", F.appendChild(M);
|
|
3331
|
+
const $ = window.getSelection();
|
|
3332
|
+
if ($ && $.rangeCount > 0) {
|
|
3333
|
+
$.getRangeAt(0).insertNode(F), $.removeAllRanges();
|
|
3334
|
+
const X = document.createRange();
|
|
3335
|
+
X.setStartAfter(F), X.collapse(!0), $.addRange(X);
|
|
3287
3336
|
} else
|
|
3288
|
-
p.appendChild(
|
|
3337
|
+
p.appendChild(F);
|
|
3289
3338
|
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), de();
|
|
3290
3339
|
}
|
|
3291
|
-
},
|
|
3340
|
+
}, W.readAsDataURL(I);
|
|
3292
3341
|
}
|
|
3293
3342
|
}
|
|
3294
3343
|
return;
|
|
@@ -3297,38 +3346,38 @@ function Xo(h, m) {
|
|
|
3297
3346
|
k ? k = Uo(k) : k = g.getData("text/plain");
|
|
3298
3347
|
const _ = window.getSelection();
|
|
3299
3348
|
if (_ && _.rangeCount > 0) {
|
|
3300
|
-
const
|
|
3301
|
-
|
|
3302
|
-
const
|
|
3303
|
-
for (;
|
|
3304
|
-
|
|
3305
|
-
|
|
3349
|
+
const O = _.getRangeAt(0), I = document.createElement("div");
|
|
3350
|
+
I.innerHTML = k;
|
|
3351
|
+
const W = document.createDocumentFragment();
|
|
3352
|
+
for (; I.firstChild; )
|
|
3353
|
+
W.appendChild(I.firstChild);
|
|
3354
|
+
O.deleteContents(), O.insertNode(W), O.collapse(!1), _.removeAllRanges(), _.addRange(O);
|
|
3306
3355
|
} else {
|
|
3307
|
-
const
|
|
3308
|
-
for (
|
|
3309
|
-
p.appendChild(
|
|
3356
|
+
const O = document.createElement("div");
|
|
3357
|
+
for (O.innerHTML = k; O.firstChild; )
|
|
3358
|
+
p.appendChild(O.firstChild);
|
|
3310
3359
|
}
|
|
3311
3360
|
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), de();
|
|
3312
3361
|
}), p.addEventListener("click", (w) => {
|
|
3313
3362
|
const g = w.target;
|
|
3314
|
-
let
|
|
3315
|
-
if (g.tagName === "IMG" ?
|
|
3363
|
+
let C = null;
|
|
3364
|
+
if (g.tagName === "IMG" ? C = g.parentElement : g.classList.contains("editor-image-wrapper") && (C = g), C && C.classList.contains("editor-image-wrapper")) {
|
|
3316
3365
|
w.preventDefault(), w.stopPropagation(), p.querySelectorAll(".editor-image-wrapper").forEach((_) => {
|
|
3317
|
-
if (_ !==
|
|
3318
|
-
const
|
|
3319
|
-
Ze(
|
|
3320
|
-
const P =
|
|
3366
|
+
if (_ !== C && _.classList.contains("resizable")) {
|
|
3367
|
+
const O = _, I = O.getBoundingClientRect(), W = Math.round(I.width) + "px", N = Math.round(I.height) + "px";
|
|
3368
|
+
Ze(O).unset(), O.classList.remove("resizable"), O.style.border = "none", O.style.transform = "", O.dataset.x = "", O.dataset.y = "", O.style.width = W, O.style.height = N, O.contentEditable = "false";
|
|
3369
|
+
const P = O.querySelector("img");
|
|
3321
3370
|
P && (P.style.width = "100%", P.style.height = "100%");
|
|
3322
3371
|
}
|
|
3323
|
-
}), m(
|
|
3324
|
-
const k =
|
|
3372
|
+
}), m(C);
|
|
3373
|
+
const k = C.parentElement;
|
|
3325
3374
|
k && (k.classList.contains("editor-image-container") || k.tagName === "DIV" || k.tagName === "P") && (window.__selectedImageContainer = k, console.log("Selected image container:", k));
|
|
3326
3375
|
} else
|
|
3327
3376
|
window.__selectedImageContainer = null, p.querySelectorAll(
|
|
3328
3377
|
".editor-image-wrapper.resizable"
|
|
3329
3378
|
).forEach((k) => {
|
|
3330
|
-
const _ = k,
|
|
3331
|
-
Ze(_).unset(), _.classList.remove("resizable"), _.style.border = "none", _.style.transform = "", _.dataset.x = "", _.dataset.y = "", _.style.width =
|
|
3379
|
+
const _ = k, O = _.getBoundingClientRect(), I = Math.round(O.width) + "px", W = Math.round(O.height) + "px";
|
|
3380
|
+
Ze(_).unset(), _.classList.remove("resizable"), _.style.border = "none", _.style.transform = "", _.dataset.x = "", _.dataset.y = "", _.style.width = I, _.style.height = W, _.contentEditable = "false";
|
|
3332
3381
|
const N = _.querySelector("img");
|
|
3333
3382
|
N && (N.style.width = "100%", N.style.height = "100%");
|
|
3334
3383
|
}), de();
|
|
@@ -3352,13 +3401,13 @@ function Xo(h, m) {
|
|
|
3352
3401
|
const w = Array.from(p.childNodes);
|
|
3353
3402
|
for (const g of w)
|
|
3354
3403
|
if (g.nodeType === Node.TEXT_NODE && g.textContent?.trim()) {
|
|
3355
|
-
const
|
|
3356
|
-
let
|
|
3357
|
-
|
|
3404
|
+
const C = window.getSelection();
|
|
3405
|
+
let S = null;
|
|
3406
|
+
C && C.rangeCount > 0 && (S = C.getRangeAt(0).cloneRange());
|
|
3358
3407
|
const k = document.createElement("p");
|
|
3359
|
-
if (g.parentNode?.insertBefore(k, g), k.appendChild(g),
|
|
3408
|
+
if (g.parentNode?.insertBefore(k, g), k.appendChild(g), S && C)
|
|
3360
3409
|
try {
|
|
3361
|
-
|
|
3410
|
+
C.removeAllRanges(), C.addRange(S);
|
|
3362
3411
|
} catch {
|
|
3363
3412
|
}
|
|
3364
3413
|
}
|
|
@@ -3368,7 +3417,7 @@ function Xo(h, m) {
|
|
|
3368
3417
|
y && clearTimeout(y), y = setTimeout(() => v(), 100);
|
|
3369
3418
|
}), !p.innerHTML || p.innerHTML.trim() === "" ? p.innerHTML = "<p><br></p>" : v(), p;
|
|
3370
3419
|
}
|
|
3371
|
-
function
|
|
3420
|
+
function Dn(h) {
|
|
3372
3421
|
const m = document.createElement("input");
|
|
3373
3422
|
m.type = "file", m.accept = "image/*", m.onchange = (p) => {
|
|
3374
3423
|
const u = p.target.files?.[0];
|
|
@@ -3378,20 +3427,20 @@ function On(h) {
|
|
|
3378
3427
|
const w = document.createElement("img");
|
|
3379
3428
|
w.src = y.target?.result, w.style.maxWidth = "100%", w.style.width = "100%", w.style.height = "auto", w.style.cursor = "pointer", w.draggable = !1;
|
|
3380
3429
|
const g = document.createElement("div");
|
|
3381
|
-
g.className = "editor-image-wrapper", g.style.display = "inline-block", g.style.position = "relative", g.style.maxWidth = "100%", g.style.width = "
|
|
3382
|
-
const
|
|
3383
|
-
|
|
3430
|
+
g.className = "editor-image-wrapper", g.style.display = "inline-block", g.style.position = "relative", g.style.maxWidth = "100%", g.style.width = "700px", g.style.height = "500px", g.contentEditable = "false", g.style.boxSizing = "border-box", g.style.touchAction = "none", g.style.userSelect = "none", g.appendChild(w);
|
|
3431
|
+
const C = document.createElement("div");
|
|
3432
|
+
C.className = "editor-image-container", C.style.margin = "10px 0", C.style.textAlign = "left", C.style.display = "block", C.appendChild(g);
|
|
3384
3433
|
try {
|
|
3385
3434
|
Re();
|
|
3386
|
-
const
|
|
3387
|
-
if (
|
|
3388
|
-
|
|
3435
|
+
const S = window.getSelection();
|
|
3436
|
+
if (S && S.rangeCount > 0) {
|
|
3437
|
+
S.getRangeAt(0).insertNode(C), S.removeAllRanges();
|
|
3389
3438
|
const _ = document.createRange();
|
|
3390
|
-
_.setStartAfter(
|
|
3439
|
+
_.setStartAfter(C), _.collapse(!0), S.addRange(_), de(_);
|
|
3391
3440
|
} else
|
|
3392
|
-
h.appendChild(
|
|
3441
|
+
h.appendChild(C), h.focus(), de();
|
|
3393
3442
|
} catch {
|
|
3394
|
-
h.appendChild(
|
|
3443
|
+
h.appendChild(C), h.focus(), de();
|
|
3395
3444
|
}
|
|
3396
3445
|
h.dispatchEvent(new Event("input", { bubbles: !0 })), h.focus();
|
|
3397
3446
|
}, v.readAsDataURL(u);
|
|
@@ -3441,13 +3490,13 @@ class Ko {
|
|
|
3441
3490
|
editor;
|
|
3442
3491
|
constructor() {
|
|
3443
3492
|
this.container = document.createElement("div"), this.container.classList.add("editor-container"), this.editor = Xo(
|
|
3444
|
-
() =>
|
|
3493
|
+
() => Dn(this.editor),
|
|
3445
3494
|
(p) => Go(p)
|
|
3446
|
-
), this.toolbar =
|
|
3495
|
+
), this.toolbar = Bo(this.container);
|
|
3447
3496
|
const m = this.toolbar.querySelector(
|
|
3448
3497
|
'[role="button"][title="Insert Image"]'
|
|
3449
3498
|
);
|
|
3450
|
-
m && (m.addEventListener("mousedown", () => de()), m.onclick = () =>
|
|
3499
|
+
m && (m.addEventListener("mousedown", () => de()), m.onclick = () => Dn(this.editor)), this.container.appendChild(this.toolbar), this.container.appendChild(this.editor);
|
|
3451
3500
|
}
|
|
3452
3501
|
getElement() {
|
|
3453
3502
|
return this.container;
|
|
@@ -3474,30 +3523,30 @@ class Ko {
|
|
|
3474
3523
|
y.style.maxWidth = "100%", y.style.width = "100%", y.style.height = "auto", y.style.cursor = "pointer", y.draggable = !1;
|
|
3475
3524
|
const w = (_) => {
|
|
3476
3525
|
if (!_) return null;
|
|
3477
|
-
const
|
|
3478
|
-
if (!
|
|
3479
|
-
const
|
|
3480
|
-
return Number.isFinite(
|
|
3526
|
+
const O = String(_).match(/(\d+(?:\.\d+)?)/);
|
|
3527
|
+
if (!O) return null;
|
|
3528
|
+
const I = Math.round(Number(O[1]));
|
|
3529
|
+
return Number.isFinite(I) && I > 0 ? I : null;
|
|
3481
3530
|
}, g = w(y.getAttribute("width")) ?? w(y.style.width) ?? w(y.getAttribute("style"));
|
|
3482
3531
|
g ? v.style.width = `${g}px` : y.onload = () => {
|
|
3483
|
-
const _ = this.editor.clientWidth || 0,
|
|
3484
|
-
if (
|
|
3485
|
-
const
|
|
3486
|
-
v.style.width = `${
|
|
3532
|
+
const _ = this.editor.clientWidth || 0, O = y.naturalWidth || 0;
|
|
3533
|
+
if (O > 0) {
|
|
3534
|
+
const I = _ > 0 ? Math.min(O, _) : O;
|
|
3535
|
+
v.style.width = `${I}px`;
|
|
3487
3536
|
}
|
|
3488
3537
|
};
|
|
3489
|
-
const
|
|
3490
|
-
|
|
3491
|
-
const
|
|
3492
|
-
k && this.editor.contains(
|
|
3538
|
+
const C = document.createElement("div");
|
|
3539
|
+
C.className = "editor-image-container", C.style.margin = "10px 0", C.style.textAlign = "left", C.style.display = "block";
|
|
3540
|
+
const S = y.closest("figure") ?? y.closest(".se-image-container") ?? y, k = S.parentNode;
|
|
3541
|
+
k && this.editor.contains(S) && k.contains(S) && (v.appendChild(y), C.appendChild(v), k.replaceChild(C, S));
|
|
3493
3542
|
}), this.editor.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3494
3543
|
}
|
|
3495
3544
|
}
|
|
3496
3545
|
var vt = { exports: {} }, Ge = {};
|
|
3497
|
-
var
|
|
3546
|
+
var On;
|
|
3498
3547
|
function Jo() {
|
|
3499
|
-
if (
|
|
3500
|
-
|
|
3548
|
+
if (On) return Ge;
|
|
3549
|
+
On = 1;
|
|
3501
3550
|
var h = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
|
|
3502
3551
|
function p(u, v, y) {
|
|
3503
3552
|
var w = null;
|
|
@@ -3528,13 +3577,13 @@ function Qo() {
|
|
|
3528
3577
|
switch (E) {
|
|
3529
3578
|
case P:
|
|
3530
3579
|
return "Fragment";
|
|
3531
|
-
case
|
|
3580
|
+
case M:
|
|
3532
3581
|
return "Profiler";
|
|
3533
3582
|
case H:
|
|
3534
3583
|
return "StrictMode";
|
|
3535
|
-
case
|
|
3584
|
+
case X:
|
|
3536
3585
|
return "Suspense";
|
|
3537
|
-
case
|
|
3586
|
+
case b:
|
|
3538
3587
|
return "SuspenseList";
|
|
3539
3588
|
case le:
|
|
3540
3589
|
return "Activity";
|
|
@@ -3545,19 +3594,19 @@ function Qo() {
|
|
|
3545
3594
|
), E.$$typeof) {
|
|
3546
3595
|
case N:
|
|
3547
3596
|
return "Portal";
|
|
3548
|
-
case
|
|
3597
|
+
case $:
|
|
3549
3598
|
return E.displayName || "Context";
|
|
3550
|
-
case
|
|
3599
|
+
case F:
|
|
3551
3600
|
return (E._context.displayName || "Context") + ".Consumer";
|
|
3552
|
-
case
|
|
3553
|
-
var
|
|
3554
|
-
return E = E.displayName, E || (E =
|
|
3601
|
+
case oe:
|
|
3602
|
+
var q = E.render;
|
|
3603
|
+
return E = E.displayName, E || (E = q.displayName || q.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
|
|
3555
3604
|
case ne:
|
|
3556
|
-
return
|
|
3557
|
-
case
|
|
3558
|
-
|
|
3605
|
+
return q = E.displayName || null, q !== null ? q : h(E.type) || "Memo";
|
|
3606
|
+
case B:
|
|
3607
|
+
q = E._payload, E = E._init;
|
|
3559
3608
|
try {
|
|
3560
|
-
return h(E(
|
|
3609
|
+
return h(E(q));
|
|
3561
3610
|
} catch {
|
|
3562
3611
|
}
|
|
3563
3612
|
}
|
|
@@ -3569,74 +3618,74 @@ function Qo() {
|
|
|
3569
3618
|
function p(E) {
|
|
3570
3619
|
try {
|
|
3571
3620
|
m(E);
|
|
3572
|
-
var
|
|
3621
|
+
var q = !1;
|
|
3573
3622
|
} catch {
|
|
3574
|
-
|
|
3623
|
+
q = !0;
|
|
3575
3624
|
}
|
|
3576
|
-
if (
|
|
3577
|
-
|
|
3578
|
-
var
|
|
3579
|
-
return
|
|
3580
|
-
|
|
3625
|
+
if (q) {
|
|
3626
|
+
q = console;
|
|
3627
|
+
var V = q.error, J = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
|
|
3628
|
+
return V.call(
|
|
3629
|
+
q,
|
|
3581
3630
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3582
|
-
|
|
3631
|
+
J
|
|
3583
3632
|
), m(E);
|
|
3584
3633
|
}
|
|
3585
3634
|
}
|
|
3586
3635
|
function u(E) {
|
|
3587
3636
|
if (E === P) return "<>";
|
|
3588
|
-
if (typeof E == "object" && E !== null && E.$$typeof ===
|
|
3637
|
+
if (typeof E == "object" && E !== null && E.$$typeof === B)
|
|
3589
3638
|
return "<...>";
|
|
3590
3639
|
try {
|
|
3591
|
-
var
|
|
3592
|
-
return
|
|
3640
|
+
var q = h(E);
|
|
3641
|
+
return q ? "<" + q + ">" : "<...>";
|
|
3593
3642
|
} catch {
|
|
3594
3643
|
return "<...>";
|
|
3595
3644
|
}
|
|
3596
3645
|
}
|
|
3597
3646
|
function v() {
|
|
3598
|
-
var E =
|
|
3647
|
+
var E = Z.A;
|
|
3599
3648
|
return E === null ? null : E.getOwner();
|
|
3600
3649
|
}
|
|
3601
3650
|
function y() {
|
|
3602
3651
|
return Error("react-stack-top-frame");
|
|
3603
3652
|
}
|
|
3604
3653
|
function w(E) {
|
|
3605
|
-
if (
|
|
3606
|
-
var
|
|
3607
|
-
if (
|
|
3654
|
+
if (ee.call(E, "key")) {
|
|
3655
|
+
var q = Object.getOwnPropertyDescriptor(E, "key").get;
|
|
3656
|
+
if (q && q.isReactWarning) return !1;
|
|
3608
3657
|
}
|
|
3609
3658
|
return E.key !== void 0;
|
|
3610
3659
|
}
|
|
3611
|
-
function g(E,
|
|
3612
|
-
function
|
|
3660
|
+
function g(E, q) {
|
|
3661
|
+
function V() {
|
|
3613
3662
|
re || (re = !0, console.error(
|
|
3614
3663
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
3615
|
-
|
|
3664
|
+
q
|
|
3616
3665
|
));
|
|
3617
3666
|
}
|
|
3618
|
-
|
|
3619
|
-
get:
|
|
3667
|
+
V.isReactWarning = !0, Object.defineProperty(E, "key", {
|
|
3668
|
+
get: V,
|
|
3620
3669
|
configurable: !0
|
|
3621
3670
|
});
|
|
3622
3671
|
}
|
|
3623
|
-
function
|
|
3672
|
+
function C() {
|
|
3624
3673
|
var E = h(this.type);
|
|
3625
3674
|
return se[E] || (se[E] = !0, console.error(
|
|
3626
3675
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
3627
3676
|
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
3628
3677
|
}
|
|
3629
|
-
function
|
|
3630
|
-
var ue =
|
|
3678
|
+
function S(E, q, V, J, xe, we) {
|
|
3679
|
+
var ue = V.ref;
|
|
3631
3680
|
return E = {
|
|
3632
|
-
$$typeof:
|
|
3681
|
+
$$typeof: W,
|
|
3633
3682
|
type: E,
|
|
3634
|
-
key:
|
|
3635
|
-
props:
|
|
3636
|
-
_owner:
|
|
3683
|
+
key: q,
|
|
3684
|
+
props: V,
|
|
3685
|
+
_owner: J
|
|
3637
3686
|
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(E, "ref", {
|
|
3638
3687
|
enumerable: !1,
|
|
3639
|
-
get:
|
|
3688
|
+
get: C
|
|
3640
3689
|
}) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
3641
3690
|
configurable: !1,
|
|
3642
3691
|
enumerable: !1,
|
|
@@ -3659,91 +3708,91 @@ function Qo() {
|
|
|
3659
3708
|
value: we
|
|
3660
3709
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
3661
3710
|
}
|
|
3662
|
-
function k(E,
|
|
3663
|
-
var ue =
|
|
3711
|
+
function k(E, q, V, J, xe, we) {
|
|
3712
|
+
var ue = q.children;
|
|
3664
3713
|
if (ue !== void 0)
|
|
3665
|
-
if (
|
|
3666
|
-
if (
|
|
3667
|
-
for (
|
|
3668
|
-
_(ue[
|
|
3714
|
+
if (J)
|
|
3715
|
+
if (K(ue)) {
|
|
3716
|
+
for (J = 0; J < ue.length; J++)
|
|
3717
|
+
_(ue[J]);
|
|
3669
3718
|
Object.freeze && Object.freeze(ue);
|
|
3670
3719
|
} else
|
|
3671
3720
|
console.error(
|
|
3672
3721
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
3673
3722
|
);
|
|
3674
3723
|
else _(ue);
|
|
3675
|
-
if (
|
|
3724
|
+
if (ee.call(q, "key")) {
|
|
3676
3725
|
ue = h(E);
|
|
3677
|
-
var Ee = Object.keys(
|
|
3726
|
+
var Ee = Object.keys(q).filter(function(et) {
|
|
3678
3727
|
return et !== "key";
|
|
3679
3728
|
});
|
|
3680
|
-
|
|
3729
|
+
J = 0 < Ee.length ? "{key: someKey, " + Ee.join(": ..., ") + ": ...}" : "{key: someKey}", he[ue + J] || (Ee = 0 < Ee.length ? "{" + Ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
3681
3730
|
`A props object containing a "key" prop is being spread into JSX:
|
|
3682
3731
|
let props = %s;
|
|
3683
3732
|
<%s {...props} />
|
|
3684
3733
|
React keys must be passed directly to JSX without using spread:
|
|
3685
3734
|
let props = %s;
|
|
3686
3735
|
<%s key={someKey} {...props} />`,
|
|
3687
|
-
|
|
3736
|
+
J,
|
|
3688
3737
|
ue,
|
|
3689
3738
|
Ee,
|
|
3690
3739
|
ue
|
|
3691
|
-
), he[ue +
|
|
3740
|
+
), he[ue + J] = !0);
|
|
3692
3741
|
}
|
|
3693
|
-
if (ue = null,
|
|
3694
|
-
|
|
3695
|
-
for (var z in
|
|
3696
|
-
z !== "key" && (
|
|
3697
|
-
} else
|
|
3742
|
+
if (ue = null, V !== void 0 && (p(V), ue = "" + V), w(q) && (p(q.key), ue = "" + q.key), "key" in q) {
|
|
3743
|
+
V = {};
|
|
3744
|
+
for (var z in q)
|
|
3745
|
+
z !== "key" && (V[z] = q[z]);
|
|
3746
|
+
} else V = q;
|
|
3698
3747
|
return ue && g(
|
|
3699
|
-
|
|
3748
|
+
V,
|
|
3700
3749
|
typeof E == "function" ? E.displayName || E.name || "Unknown" : E
|
|
3701
|
-
),
|
|
3750
|
+
), S(
|
|
3702
3751
|
E,
|
|
3703
3752
|
ue,
|
|
3704
|
-
|
|
3753
|
+
V,
|
|
3705
3754
|
v(),
|
|
3706
3755
|
xe,
|
|
3707
3756
|
we
|
|
3708
3757
|
);
|
|
3709
3758
|
}
|
|
3710
3759
|
function _(E) {
|
|
3711
|
-
|
|
3760
|
+
O(E) ? E._store && (E._store.validated = 1) : typeof E == "object" && E !== null && E.$$typeof === B && (E._payload.status === "fulfilled" ? O(E._payload.value) && E._payload.value._store && (E._payload.value._store.validated = 1) : E._store && (E._store.validated = 1));
|
|
3712
3761
|
}
|
|
3713
|
-
function
|
|
3714
|
-
return typeof E == "object" && E !== null && E.$$typeof ===
|
|
3762
|
+
function O(E) {
|
|
3763
|
+
return typeof E == "object" && E !== null && E.$$typeof === W;
|
|
3715
3764
|
}
|
|
3716
|
-
var
|
|
3765
|
+
var I = Qr, W = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), H = Symbol.for("react.strict_mode"), M = Symbol.for("react.profiler"), F = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), oe = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), ne = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), Z = I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, K = Array.isArray, ie = console.createTask ? console.createTask : function() {
|
|
3717
3766
|
return null;
|
|
3718
3767
|
};
|
|
3719
|
-
|
|
3768
|
+
I = {
|
|
3720
3769
|
react_stack_bottom_frame: function(E) {
|
|
3721
3770
|
return E();
|
|
3722
3771
|
}
|
|
3723
3772
|
};
|
|
3724
|
-
var re, se = {}, pe =
|
|
3725
|
-
|
|
3773
|
+
var re, se = {}, pe = I.react_stack_bottom_frame.bind(
|
|
3774
|
+
I,
|
|
3726
3775
|
y
|
|
3727
|
-
)(), fe =
|
|
3728
|
-
Ke.Fragment = P, Ke.jsx = function(E,
|
|
3729
|
-
var
|
|
3776
|
+
)(), fe = ie(u(y)), he = {};
|
|
3777
|
+
Ke.Fragment = P, Ke.jsx = function(E, q, V) {
|
|
3778
|
+
var J = 1e4 > Z.recentlyCreatedOwnerStacks++;
|
|
3730
3779
|
return k(
|
|
3731
3780
|
E,
|
|
3732
|
-
|
|
3733
|
-
|
|
3781
|
+
q,
|
|
3782
|
+
V,
|
|
3734
3783
|
!1,
|
|
3735
|
-
|
|
3736
|
-
|
|
3784
|
+
J ? Error("react-stack-top-frame") : pe,
|
|
3785
|
+
J ? ie(u(E)) : fe
|
|
3737
3786
|
);
|
|
3738
|
-
}, Ke.jsxs = function(E,
|
|
3739
|
-
var
|
|
3787
|
+
}, Ke.jsxs = function(E, q, V) {
|
|
3788
|
+
var J = 1e4 > Z.recentlyCreatedOwnerStacks++;
|
|
3740
3789
|
return k(
|
|
3741
3790
|
E,
|
|
3742
|
-
|
|
3743
|
-
|
|
3791
|
+
q,
|
|
3792
|
+
V,
|
|
3744
3793
|
!0,
|
|
3745
|
-
|
|
3746
|
-
|
|
3794
|
+
J ? Error("react-stack-top-frame") : pe,
|
|
3795
|
+
J ? ie(u(E)) : fe
|
|
3747
3796
|
);
|
|
3748
3797
|
};
|
|
3749
3798
|
})()), Ke;
|
|
@@ -3758,25 +3807,25 @@ const ni = Zr(({ onChange: h, initialValue: m }, p) => {
|
|
|
3758
3807
|
return Ht(() => {
|
|
3759
3808
|
w.current = h;
|
|
3760
3809
|
}, [h]), eo(p, () => ({
|
|
3761
|
-
setHTML: (
|
|
3762
|
-
u.current && u.current.setHTML(
|
|
3810
|
+
setHTML: (C) => {
|
|
3811
|
+
u.current && u.current.setHTML(C);
|
|
3763
3812
|
},
|
|
3764
3813
|
getHTML: () => u.current?.getHTML() || ""
|
|
3765
3814
|
})), Ht(() => {
|
|
3766
3815
|
if (v.current && !u.current) {
|
|
3767
3816
|
u.current = new Ko(), v.current.appendChild(u.current.getElement()), m && (u.current.setHTML(m), y.current = m), g.current = !0;
|
|
3768
|
-
const
|
|
3817
|
+
const C = u.current.getElement(), S = C.querySelector(
|
|
3769
3818
|
".editor"
|
|
3770
3819
|
), k = () => {
|
|
3771
3820
|
const _ = u.current?.getHTML() || "";
|
|
3772
3821
|
w.current?.(_);
|
|
3773
3822
|
};
|
|
3774
|
-
|
|
3823
|
+
S ? (S.addEventListener("input", k), S.addEventListener("paste", k)) : (C.addEventListener("input", k), C.addEventListener("paste", k));
|
|
3775
3824
|
}
|
|
3776
3825
|
}, []), Ht(() => {
|
|
3777
3826
|
if (g.current && u.current && m !== void 0 && m !== y.current) {
|
|
3778
|
-
const
|
|
3779
|
-
m !==
|
|
3827
|
+
const C = u.current.getHTML();
|
|
3828
|
+
m !== C && (u.current.setHTML(m), y.current = m);
|
|
3780
3829
|
}
|
|
3781
3830
|
}, [m]), /* @__PURE__ */ ei.jsx("div", { ref: v });
|
|
3782
3831
|
});
|