nam-rich-text-editor 9.2.0 → 9.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import Qr, { forwardRef as Zr, useRef as Ft, useImperativeHandle as eo, useEffect as In } from "react";
1
+ import Qr, { forwardRef as Zr, useRef as Xe, useEffect as jt, useImperativeHandle as eo } from "react";
2
2
  function to() {
3
3
  const v = document.createElement("select");
4
4
  return v.innerHTML = `
@@ -176,63 +176,69 @@ const To = [
176
176
  ["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
177
177
  ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
178
178
  ];
179
- function _o() {
180
- const v = document.createDocumentFragment();
181
- return [
182
- { command: "bold", icon: io, title: "Bold" },
183
- { command: "italic", icon: so, title: "Italic" },
184
- { command: "underline", icon: Co, title: "Underline" },
185
- { command: "strikeThrough", icon: bo, title: "Strikethrough" }
186
- ].forEach((p) => {
187
- const u = document.createElement("div");
188
- u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (g) => {
189
- (g.key === "Enter" || g.key === " ") && (g.preventDefault(), u.click());
190
- });
191
- const m = ye(p.icon, { width: 16, height: 16 });
192
- u.appendChild(m), u.title = p.title, u.style.fontWeight = p.command === "bold" ? "bold" : "normal", u.style.fontStyle = p.command === "italic" ? "italic" : "normal", u.style.textDecoration = p.command === "underline" ? "underline" : "none", u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.onclick = () => document.execCommand(p.command), v.appendChild(u);
193
- }), v;
194
- }
195
- let Je = null;
196
- function pe(v) {
179
+ let Qe = null;
180
+ function de(v) {
197
181
  if (v) {
198
- Je = v.cloneRange();
182
+ Qe = v.cloneRange();
199
183
  return;
200
184
  }
201
185
  const h = window.getSelection();
202
186
  if (!h || h.rangeCount === 0) {
203
- Je = null;
187
+ Qe = null;
204
188
  return;
205
189
  }
206
- Je = h.getRangeAt(0).cloneRange();
190
+ Qe = h.getRangeAt(0).cloneRange();
207
191
  }
208
- function Ne() {
192
+ function Ae() {
209
193
  const v = window.getSelection();
210
- v && (v.removeAllRanges(), Je && v.addRange(Je.cloneRange()));
194
+ v && (v.removeAllRanges(), Qe && v.addRange(Qe.cloneRange()));
211
195
  }
212
196
  function Fn(v, h) {
213
197
  const p = window.getSelection();
214
198
  if (!p || p.rangeCount === 0) return;
215
199
  const u = p.getRangeAt(0);
216
200
  if (!u.collapsed) {
217
- const E = document.createElement("span");
218
- E.style[v] = h;
201
+ const w = document.createElement("span");
202
+ w.style[v] = h;
219
203
  const x = u.extractContents();
220
- E.appendChild(x), u.insertNode(E), p.removeAllRanges();
221
- const C = document.createRange();
222
- C.selectNodeContents(E), p.addRange(C), pe(C);
204
+ w.appendChild(x), u.insertNode(w), p.removeAllRanges();
205
+ const k = document.createRange();
206
+ k.selectNodeContents(w), p.addRange(k), de(k);
223
207
  return;
224
208
  }
225
209
  const m = document.createElement("span");
226
210
  m.style[v] = h, m.appendChild(document.createTextNode("​")), u.insertNode(m), p.removeAllRanges();
227
211
  const g = document.createRange();
228
- g.setStart(m.firstChild, 0), g.setEnd(m.firstChild, 0), p.addRange(g), pe(g);
212
+ g.setStart(m.firstChild, 0), g.setEnd(m.firstChild, 0), p.addRange(g), de(g);
229
213
  }
230
- function Mo(v) {
214
+ function _o(v) {
231
215
  Fn("color", v);
232
216
  }
233
- function Ro(v) {
217
+ function Mo(v) {
234
218
  Fn("backgroundColor", v);
235
219
  }
220
+ function Ro() {
221
+ const v = document.createDocumentFragment();
222
+ return [
223
+ { command: "bold", icon: io, title: "Bold" },
224
+ { command: "italic", icon: so, title: "Italic" },
225
+ { command: "underline", icon: Co, title: "Underline" },
226
+ { command: "strikeThrough", icon: bo, title: "Strikethrough" }
227
+ ].forEach((p) => {
228
+ const u = document.createElement("div");
229
+ u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (g) => {
230
+ (g.key === "Enter" || g.key === " ") && (g.preventDefault(), u.click());
231
+ });
232
+ const m = ye(p.icon, { width: 16, height: 16 });
233
+ u.appendChild(m), u.title = p.title, u.style.fontWeight = p.command === "bold" ? "bold" : "normal", u.style.fontStyle = p.command === "italic" ? "italic" : "normal", u.style.textDecoration = p.command === "underline" ? "underline" : "none", u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.addEventListener("mousedown", (g) => {
234
+ g.preventDefault(), de();
235
+ }), u.onclick = (g) => {
236
+ g.preventDefault();
237
+ const w = u.closest(".editor-container")?.querySelector(".editor");
238
+ w && (Ae(), w.focus()), document.execCommand(p.command), w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
239
+ }, v.appendChild(u);
240
+ }), v;
241
+ }
236
242
  function Ao() {
237
243
  const v = document.createDocumentFragment(), h = document.createElement("input");
238
244
  h.type = "color", h.style.display = "none", h.title = "Text Color";
@@ -240,7 +246,7 @@ function Ao() {
240
246
  p.setAttribute("role", "button"), p.tabIndex = 0, p.style.userSelect = "none", p.addEventListener("keydown", (g) => {
241
247
  (g.key === "Enter" || g.key === " ") && (g.preventDefault(), p.click());
242
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 = () => h.click(), h.onchange = () => {
243
- Ne(), Mo(h.value), p.style.color = h.value;
249
+ Ae(), _o(h.value), p.style.color = h.value;
244
250
  }, v.appendChild(p), v.appendChild(h);
245
251
  const u = document.createElement("input");
246
252
  u.type = "color", u.style.display = "none", u.title = "Background Color";
@@ -248,7 +254,7 @@ function Ao() {
248
254
  return m.setAttribute("role", "button"), m.tabIndex = 0, m.style.userSelect = "none", m.addEventListener("keydown", (g) => {
249
255
  (g.key === "Enter" || g.key === " ") && (g.preventDefault(), m.click());
250
256
  }), m.textContent = "BA", m.style.color = "#000", m.style.fontSize = "14px", m.style.fontWeight = "bold", m.style.border = "1px solid #ccc", m.style.borderRadius = "4px", m.style.padding = "4px 6px", m.style.cursor = "pointer", m.style.backgroundColor = "#fff", m.title = "Background Color", m.onclick = () => u.click(), u.onchange = () => {
251
- Ne(), Ro(u.value), m.style.backgroundColor = u.value, m.style.color = "#000";
257
+ Ae(), Mo(u.value), m.style.backgroundColor = u.value, m.style.color = "#000";
252
258
  }, v.appendChild(m), v.appendChild(u), v;
253
259
  }
254
260
  function Io() {
@@ -290,32 +296,38 @@ function Io() {
290
296
  let x = g.anchorNode;
291
297
  for (; x && x.nodeType !== Node.ELEMENT_NODE; )
292
298
  x = x.parentNode;
293
- let C = x, _ = null;
294
- for (; C && C !== document.body && !C.classList.contains("editor"); ) {
295
- if ((C.tagName === "DIV" || C.tagName === "P") && C.querySelector(".editor-image-wrapper")) {
296
- _ = C;
299
+ let k = x, S = null;
300
+ for (; k && k !== document.body && !k.classList.contains("editor"); ) {
301
+ if ((k.tagName === "DIV" || k.tagName === "P") && k.querySelector(".editor-image-wrapper")) {
302
+ S = k;
297
303
  break;
298
304
  }
299
- if (C.tagName === "P") {
300
- _ = C;
305
+ if (k.tagName === "P") {
306
+ S = k;
301
307
  break;
302
308
  }
303
- C = C.parentElement;
309
+ k = k.parentElement;
304
310
  }
305
- if (_) {
306
- _.style.textAlign = p.align;
307
- const M = u.closest(".editor-container")?.querySelector(".editor");
308
- M && M.dispatchEvent(new Event("input", { bubbles: !0 }));
311
+ if (S) {
312
+ S.style.textAlign = p.align;
313
+ const _ = u.closest(".editor-container")?.querySelector(".editor");
314
+ _ && _.dispatchEvent(new Event("input", { bubbles: !0 }));
309
315
  return;
310
316
  }
311
317
  }
312
318
  document.execCommand(p.command);
313
- const E = u.closest(".editor-container")?.querySelector(".editor");
314
- E && E.dispatchEvent(new Event("input", { bubbles: !0 }));
319
+ const w = u.closest(".editor-container")?.querySelector(".editor");
320
+ w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
315
321
  }, v.appendChild(u);
316
322
  }), v;
317
323
  }
318
- function Po() {
324
+ function Po(v) {
325
+ v.querySelectorAll("p > ul, p > ol").forEach((p) => {
326
+ const u = p.parentElement;
327
+ u && u.tagName === "P" && (u.parentNode?.insertBefore(p, u.nextSibling), !u.textContent?.trim() && !u.querySelector("img") && u.remove());
328
+ });
329
+ }
330
+ function Oo() {
319
331
  const v = document.createDocumentFragment();
320
332
  return [
321
333
  { command: "insertUnorderedList", icon: fo, title: "Bullet List" },
@@ -326,10 +338,18 @@ function Po() {
326
338
  (g.key === "Enter" || g.key === " ") && (g.preventDefault(), u.click());
327
339
  });
328
340
  const m = ye(p.icon, { width: 16, height: 16 });
329
- u.appendChild(m), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.onclick = () => document.execCommand(p.command), v.appendChild(u);
341
+ u.appendChild(m), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.addEventListener("mousedown", (g) => {
342
+ g.preventDefault(), de();
343
+ }), u.onclick = (g) => {
344
+ g.preventDefault();
345
+ const w = u.closest(".editor-container")?.querySelector(".editor");
346
+ w ? (Ae(), w.focus(), document.execCommand(p.command), setTimeout(() => {
347
+ Po(w), w.dispatchEvent(new Event("input", { bubbles: !0 }));
348
+ }, 0)) : document.execCommand(p.command);
349
+ }, v.appendChild(u);
330
350
  }), v;
331
351
  }
332
- function Oo() {
352
+ function Do() {
333
353
  const v = document.createDocumentFragment();
334
354
  return [
335
355
  { command: "indent", icon: uo, title: "Increase Indent" },
@@ -343,7 +363,7 @@ function Oo() {
343
363
  u.appendChild(m), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.onclick = () => document.execCommand(p.command), v.appendChild(u);
344
364
  }), v;
345
365
  }
346
- function Do() {
366
+ function No() {
347
367
  const v = document.createDocumentFragment();
348
368
  return [
349
369
  { command: "undo", icon: So, title: "Undo" },
@@ -357,18 +377,18 @@ function Do() {
357
377
  u.appendChild(m), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.onclick = () => document.execCommand(p.command), v.appendChild(u);
358
378
  }), v;
359
379
  }
360
- function No() {
380
+ function zo() {
361
381
  const v = document.createElement("div");
362
382
  v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (p) => {
363
383
  (p.key === "Enter" || p.key === " ") && (p.preventDefault(), v.click());
364
384
  });
365
385
  const h = ye(ao, { width: 16, height: 16 });
366
- return v.appendChild(h), v.title = "Insert Image", v.style.border = "1px solid #e1e1e1", v.style.backgroundColor = "#ffffff", v.style.padding = "6px 10px", v.style.borderRadius = "3px", v.style.cursor = "pointer", v.style.color = "#000000", v.onmouseover = () => v.style.backgroundColor = "#f0f0f0", v.onmouseout = () => v.style.backgroundColor = "#ffffff", v.onmousedown = () => pe(), v;
386
+ return v.appendChild(h), v.title = "Insert Image", v.style.border = "1px solid #e1e1e1", v.style.backgroundColor = "#ffffff", v.style.padding = "6px 10px", v.style.borderRadius = "3px", v.style.cursor = "pointer", v.style.color = "#000000", v.onmouseover = () => v.style.backgroundColor = "#f0f0f0", v.onmouseout = () => v.style.backgroundColor = "#ffffff", v.onmousedown = () => de(), v;
367
387
  }
368
- function zo() {
388
+ function Lo() {
369
389
  const v = document.createElement("div");
370
- v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (E) => {
371
- (E.key === "Enter" || E.key === " ") && (E.preventDefault(), v.click());
390
+ v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (w) => {
391
+ (w.key === "Enter" || w.key === " ") && (w.preventDefault(), v.click());
372
392
  });
373
393
  const h = ye(ho, {
374
394
  width: 16,
@@ -380,29 +400,29 @@ function zo() {
380
400
  v.appendChild(h), v.title = "Toggle Fullscreen", v.style.border = "1px solid #e1e1e1", v.style.backgroundColor = "#ffffff", v.style.padding = "6px 10px", v.style.borderRadius = "3px", v.style.cursor = "pointer", v.style.color = "#000000", v.onmouseover = () => v.style.backgroundColor = "#f0f0f0", v.onmouseout = () => v.style.backgroundColor = "#ffffff";
381
401
  let u = !1, m = "", g = "";
382
402
  return v.onclick = () => {
383
- const E = v.closest(
403
+ const w = v.closest(
384
404
  ".editor-container"
385
405
  );
386
- if (!E) return;
387
- const x = E.querySelector(".editor");
406
+ if (!w) return;
407
+ const x = w.querySelector(".editor");
388
408
  if (u)
389
- m ? E.setAttribute("style", m) : E.removeAttribute("style"), x && (g ? x.setAttribute("style", g) : x.removeAttribute("style")), v.replaceChild(h, p), u = !1;
409
+ m ? w.setAttribute("style", m) : w.removeAttribute("style"), x && (g ? x.setAttribute("style", g) : x.removeAttribute("style")), v.replaceChild(h, p), u = !1;
390
410
  else {
391
- m = E.getAttribute("style") || "", g = x && x.getAttribute("style") || "", E.style.position = "fixed", E.style.top = "0", E.style.left = "0", E.style.width = "100vw", E.style.height = "100vh", E.style.margin = "0", E.style.padding = "0";
411
+ m = w.getAttribute("style") || "", g = x && x.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";
392
412
  try {
393
- let C = 9998;
394
- document.querySelectorAll("body *").forEach((_) => {
395
- const M = window.getComputedStyle(_).getPropertyValue("z-index"), D = parseInt(M, 10);
396
- !isNaN(D) && D > 0 && (C = Math.max(C, D));
397
- }), E.style.zIndex = String(Math.max(C + 1, 9999));
413
+ let k = 9998;
414
+ document.querySelectorAll("body *").forEach((S) => {
415
+ const _ = window.getComputedStyle(S).getPropertyValue("z-index"), A = parseInt(_, 10);
416
+ !isNaN(A) && A > 0 && (k = Math.max(k, A));
417
+ }), w.style.zIndex = String(Math.max(k + 1, 9999));
398
418
  } catch {
399
- E.style.zIndex = "9999";
419
+ w.style.zIndex = "9999";
400
420
  }
401
- E.style.backgroundColor = "#ffffff", E.style.display = "flex", E.style.flexDirection = "column", E.style.boxSizing = "border-box", x && (x.style.flex = "1 1 0", x.style.overflowY = "auto", x.style.border = "none", x.style.borderRadius = "0", x.style.boxShadow = "none", x.style.height = "", x.style.minHeight = "0", x.style.maxHeight = "none", x.style.padding = "20px", x.style.boxSizing = "border-box"), v.replaceChild(p, h), u = !0;
421
+ w.style.backgroundColor = "#ffffff", w.style.display = "flex", w.style.flexDirection = "column", w.style.boxSizing = "border-box", x && (x.style.flex = "1 1 0", x.style.overflowY = "auto", x.style.border = "none", x.style.borderRadius = "0", x.style.boxShadow = "none", x.style.height = "", x.style.minHeight = "0", x.style.maxHeight = "none", x.style.padding = "20px", x.style.boxSizing = "border-box"), v.replaceChild(p, h), u = !0;
402
422
  }
403
423
  }, v;
404
424
  }
405
- function Lo(v) {
425
+ function Fo(v) {
406
426
  const h = document.createDocumentFragment(), p = document.createElement("div");
407
427
  p.style.position = "fixed", p.style.top = "0", p.style.left = "0", p.style.width = "100%", p.style.height = "100%", p.style.backgroundColor = "rgba(0, 0, 0, 0.5)", p.style.display = "none", p.style.zIndex = "1000", p.style.alignItems = "center", p.style.justifyContent = "center", p.style.flexDirection = "column";
408
428
  const u = document.createElement("div");
@@ -411,84 +431,84 @@ function Lo(v) {
411
431
  m.textContent = "Insert Hyperlink", m.style.margin = "0 0 15px 0", m.style.fontSize = "18px", m.style.fontWeight = "bold";
412
432
  const g = document.createElement("input");
413
433
  g.type = "url", g.placeholder = "Enter URL (e.g., https://example.com)", g.style.width = "100%", g.style.padding = "8px", g.style.border = "1px solid #ccc", g.style.borderRadius = "4px", g.style.marginBottom = "15px", g.style.boxSizing = "border-box";
414
- const E = document.createElement("div");
415
- E.style.display = "flex", E.style.gap = "10px", E.style.justifyContent = "flex-end";
434
+ const w = document.createElement("div");
435
+ w.style.display = "flex", w.style.gap = "10px", w.style.justifyContent = "flex-end";
416
436
  const x = document.createElement("div");
417
- x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.textContent = "Cancel", x.style.padding = "8px 16px", x.style.border = "1px solid #ccc", x.style.borderRadius = "4px", x.style.backgroundColor = "#f5f5f5", x.style.cursor = "pointer", x.addEventListener("keydown", (A) => {
418
- (A.key === "Enter" || A.key === " " || A.key === "Escape") && (A.preventDefault(), x.click());
437
+ x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.textContent = "Cancel", x.style.padding = "8px 16px", x.style.border = "1px solid #ccc", x.style.borderRadius = "4px", x.style.backgroundColor = "#f5f5f5", x.style.cursor = "pointer", x.addEventListener("keydown", (P) => {
438
+ (P.key === "Enter" || P.key === " " || P.key === "Escape") && (P.preventDefault(), x.click());
419
439
  }), x.onclick = () => {
420
- p.style.display = "none", g.value = "", C = null;
440
+ p.style.display = "none", g.value = "", k = null;
421
441
  };
422
- let C = null;
423
- const _ = document.createElement("div");
424
- _.setAttribute("role", "button"), _.tabIndex = 0, _.style.userSelect = "none", _.textContent = "Insert", _.style.padding = "8px 16px", _.style.border = "none", _.style.borderRadius = "4px", _.style.backgroundColor = "#007bff", _.style.color = "#fff", _.style.cursor = "pointer", _.addEventListener("keydown", (A) => {
425
- (A.key === "Enter" || A.key === " ") && (A.preventDefault(), _.click());
426
- }), _.onclick = () => {
427
- const A = g.value.trim();
428
- if (A)
429
- if (C)
430
- C.setAttribute("href", A), C.setAttribute("target", "_blank"), C.setAttribute("rel", "noopener noreferrer"), C.setAttribute("tabindex", "0");
442
+ let k = 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", (P) => {
445
+ (P.key === "Enter" || P.key === " ") && (P.preventDefault(), S.click());
446
+ }), S.onclick = () => {
447
+ const P = g.value.trim();
448
+ if (P)
449
+ if (k)
450
+ k.setAttribute("href", P), k.setAttribute("target", "_blank"), k.setAttribute("rel", "noopener noreferrer"), k.setAttribute("tabindex", "0");
431
451
  else {
432
- Ne(), document.execCommand("createLink", !1, A);
433
- const N = window.getSelection();
434
- if (N && N.rangeCount > 0) {
435
- let B = N.getRangeAt(0).startContainer;
436
- for (; B && B.nodeType !== Node.ELEMENT_NODE; )
437
- B = B.parentNode;
438
- let q = B;
439
- for (; q && q !== document.body; ) {
440
- if (q.tagName === "A") {
441
- const Q = q;
442
- Q.setAttribute("target", "_blank"), Q.setAttribute("rel", "noopener noreferrer"), Q.setAttribute("tabindex", "0");
452
+ Ae(), document.execCommand("createLink", !1, P);
453
+ const G = window.getSelection();
454
+ if (G && G.rangeCount > 0) {
455
+ let W = G.getRangeAt(0).startContainer;
456
+ for (; W && W.nodeType !== Node.ELEMENT_NODE; )
457
+ W = W.parentNode;
458
+ let N = W;
459
+ for (; N && N !== document.body; ) {
460
+ if (N.tagName === "A") {
461
+ const J = N;
462
+ J.setAttribute("target", "_blank"), J.setAttribute("rel", "noopener noreferrer"), J.setAttribute("tabindex", "0");
443
463
  break;
444
464
  }
445
- q = q.parentElement;
465
+ N = N.parentElement;
446
466
  }
447
467
  }
448
468
  }
449
- p.style.display = "none", g.value = "", C = null;
450
- }, E.appendChild(x), E.appendChild(_), u.appendChild(m), u.appendChild(g), u.appendChild(E), p.appendChild(u), document.body.appendChild(p), g.onkeydown = (A) => {
451
- A.key === "Enter" ? _.click() : A.key === "Escape" && x.click();
469
+ p.style.display = "none", g.value = "", k = null;
470
+ }, w.appendChild(x), w.appendChild(S), u.appendChild(m), u.appendChild(g), u.appendChild(w), p.appendChild(u), document.body.appendChild(p), g.onkeydown = (P) => {
471
+ P.key === "Enter" ? S.click() : P.key === "Escape" && x.click();
452
472
  };
453
- const M = document.createElement("div");
454
- M.setAttribute("role", "button"), M.tabIndex = 0, M.style.userSelect = "none";
455
- const D = ye(lo, { width: 16, height: 16 });
456
- M.appendChild(D), M.title = "Insert Hyperlink", 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.onmousedown = () => {
457
- C = null;
458
- const A = window.getSelection();
459
- if (A && A.rangeCount > 0) {
460
- let B = A.getRangeAt(0).startContainer;
461
- for (; B && B.nodeType !== Node.ELEMENT_NODE; )
462
- B = B.parentNode;
463
- let q = B;
464
- for (; q && q !== document.body; ) {
465
- if (q.tagName === "A") {
466
- C = q, g.value = C.getAttribute("href") || "";
473
+ const _ = document.createElement("div");
474
+ _.setAttribute("role", "button"), _.tabIndex = 0, _.style.userSelect = "none";
475
+ const A = ye(lo, { width: 16, height: 16 });
476
+ _.appendChild(A), _.title = "Insert Hyperlink", _.style.border = "1px solid #e1e1e1", _.style.backgroundColor = "#ffffff", _.style.padding = "6px 10px", _.style.borderRadius = "3px", _.style.cursor = "pointer", _.style.color = "#000000", _.onmouseover = () => _.style.backgroundColor = "#f0f0f0", _.onmouseout = () => _.style.backgroundColor = "#ffffff", _.onmousedown = () => {
477
+ k = null;
478
+ const P = window.getSelection();
479
+ if (P && P.rangeCount > 0) {
480
+ let W = P.getRangeAt(0).startContainer;
481
+ for (; W && W.nodeType !== Node.ELEMENT_NODE; )
482
+ W = W.parentNode;
483
+ let N = W;
484
+ for (; N && N !== document.body; ) {
485
+ if (N.tagName === "A") {
486
+ k = N, g.value = k.getAttribute("href") || "";
467
487
  break;
468
488
  }
469
- q = q.parentElement;
489
+ N = N.parentElement;
470
490
  }
471
491
  }
472
- pe();
473
- }, M.addEventListener("keydown", (A) => {
474
- (A.key === "Enter" || A.key === " ") && (A.preventDefault(), M.click());
475
- }), M.onclick = () => {
492
+ de();
493
+ }, _.addEventListener("keydown", (P) => {
494
+ (P.key === "Enter" || P.key === " ") && (P.preventDefault(), _.click());
495
+ }), _.onclick = () => {
476
496
  p.style.display = "flex", g.focus();
477
- }, h.appendChild(M);
478
- const U = v.querySelector(".editor");
479
- return U && U.addEventListener("click", (A) => {
480
- const N = A.target;
481
- if (N.tagName === "A") {
482
- A.preventDefault();
483
- const B = N.getAttribute("href");
484
- B && window.open(B, "_blank");
497
+ }, h.appendChild(_);
498
+ const B = v.querySelector(".editor");
499
+ return B && B.addEventListener("click", (P) => {
500
+ const G = P.target;
501
+ if (G.tagName === "A") {
502
+ P.preventDefault();
503
+ const W = G.getAttribute("href");
504
+ W && window.open(W, "_blank");
485
505
  }
486
506
  }), h;
487
507
  }
488
- function Fo() {
508
+ function jo() {
489
509
  const v = document.createDocumentFragment(), h = document.createElement("div");
490
- h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (Z) => {
491
- (Z.key === "Enter" || Z.key === " ") && (Z.preventDefault(), h.click());
510
+ h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (ee) => {
511
+ (ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), h.click());
492
512
  });
493
513
  const p = ye(mo, { width: 16, height: 16 });
494
514
  h.appendChild(p), h.title = "Insert Quote", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "6px 10px", h.style.borderRadius = "3px", h.style.cursor = "pointer", h.style.color = "#000000", h.onmouseover = () => h.style.backgroundColor = "#f0f0f0", h.onmouseout = () => h.style.backgroundColor = "#ffffff";
@@ -498,58 +518,58 @@ function Fo() {
498
518
  m.className = "rte-modal";
499
519
  const g = document.createElement("div");
500
520
  g.className = "rte-modal-header";
501
- const E = document.createElement("h3");
502
- E.textContent = "Insert Quote", E.className = "rte-modal-title";
521
+ const w = document.createElement("h3");
522
+ w.textContent = "Insert Quote", w.className = "rte-modal-title";
503
523
  const x = document.createElement("div");
504
524
  x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.className = "rte-modal-close", x.innerHTML = "×", x.onclick = () => {
505
- u.style.display = "none", ne = null;
506
- }, g.appendChild(E), g.appendChild(x);
507
- const C = document.createElement("div");
508
- C.className = "rte-modal-form";
509
- const _ = document.createElement("label");
510
- _.textContent = "Title", _.className = "rte-label";
511
- const M = document.createElement("input");
512
- M.type = "text", M.placeholder = "e.g., Article title or source", M.className = "rte-input";
513
- const D = document.createElement("label");
514
- D.textContent = "Source URL", D.className = "rte-label";
515
- const U = document.createElement("input");
516
- U.type = "url", U.placeholder = "https://example.com", U.className = "rte-input";
517
- const A = document.createElement("div");
518
- A.className = "rte-preview-label", A.textContent = "Preview";
525
+ u.style.display = "none", re = null;
526
+ }, g.appendChild(w), g.appendChild(x);
527
+ const k = document.createElement("div");
528
+ k.className = "rte-modal-form";
529
+ const S = document.createElement("label");
530
+ S.textContent = "Title", S.className = "rte-label";
531
+ const _ = document.createElement("input");
532
+ _.type = "text", _.placeholder = "e.g., Article title or source", _.className = "rte-input";
533
+ const A = document.createElement("label");
534
+ A.textContent = "Source URL", A.className = "rte-label";
535
+ const B = document.createElement("input");
536
+ B.type = "url", B.placeholder = "https://example.com", B.className = "rte-input";
537
+ const P = document.createElement("div");
538
+ P.className = "rte-preview-label", P.textContent = "Preview";
539
+ const G = document.createElement("div");
540
+ G.className = "rte-modal-preview";
541
+ const W = document.createElement("div");
542
+ W.className = "rte-blockquote-title";
519
543
  const N = document.createElement("div");
520
- N.className = "rte-modal-preview";
521
- const B = document.createElement("div");
522
- B.className = "rte-blockquote-title";
523
- const q = document.createElement("div");
524
- q.className = "rte-blockquote-content";
525
- const Q = document.createElement("div");
526
- Q.className = "rte-blockquote-footer", N.appendChild(B), N.appendChild(q), N.appendChild(Q), C.appendChild(_), C.appendChild(M), C.appendChild(D), C.appendChild(U), C.appendChild(A), C.appendChild(N);
544
+ N.className = "rte-blockquote-content";
527
545
  const J = document.createElement("div");
528
- J.className = "rte-modal-actions";
529
- const re = document.createElement("div");
530
- re.setAttribute("role", "button"), re.tabIndex = 0, re.style.userSelect = "none", re.className = "rte-btn-danger", re.textContent = "Remove", re.style.display = "none", re.onclick = () => {
531
- ne && (ne.remove(), ne = null), u.style.display = "none";
546
+ J.className = "rte-blockquote-footer", G.appendChild(W), G.appendChild(N), G.appendChild(J), k.appendChild(S), k.appendChild(_), k.appendChild(A), k.appendChild(B), k.appendChild(P), k.appendChild(G);
547
+ const U = document.createElement("div");
548
+ U.className = "rte-modal-actions";
549
+ const Z = document.createElement("div");
550
+ Z.setAttribute("role", "button"), Z.tabIndex = 0, Z.style.userSelect = "none", Z.className = "rte-btn-danger", Z.textContent = "Remove", Z.style.display = "none", Z.onclick = () => {
551
+ re && (re.remove(), re = null), u.style.display = "none";
532
552
  };
533
- const te = document.createElement("div");
534
- te.setAttribute("role", "button"), te.tabIndex = 0, te.style.userSelect = "none", te.className = "rte-btn-muted", te.textContent = "Cancel", te.onclick = () => {
535
- u.style.display = "none", ne = null;
553
+ const ne = document.createElement("div");
554
+ ne.setAttribute("role", "button"), ne.tabIndex = 0, ne.style.userSelect = "none", ne.className = "rte-btn-muted", ne.textContent = "Cancel", ne.onclick = () => {
555
+ u.style.display = "none", re = null;
536
556
  };
537
557
  const ie = document.createElement("div");
538
558
  ie.setAttribute("role", "button"), ie.tabIndex = 0, ie.style.userSelect = "none", ie.className = "rte-btn-primary", ie.textContent = "Apply", ie.onclick = () => {
539
- const Z = M.value.trim();
540
- let F = U.value.trim();
541
- if (F && !/^https?:\/\//i.test(F) && (F = `https://${F}`), ne) {
542
- const le = ne.querySelector(
559
+ const ee = _.value.trim();
560
+ let F = B.value.trim();
561
+ if (F && !/^https?:\/\//i.test(F) && (F = `https://${F}`), re) {
562
+ const le = re.querySelector(
543
563
  ".rte-blockquote-title"
544
564
  );
545
- if (Z)
546
- if (le) le.textContent = Z;
565
+ if (ee)
566
+ if (le) le.textContent = ee;
547
567
  else {
548
568
  const X = document.createElement("div");
549
- X.className = "rte-blockquote-title", X.textContent = Z, ne.insertBefore(X, ne.firstChild);
569
+ X.className = "rte-blockquote-title", X.textContent = ee, re.insertBefore(X, re.firstChild);
550
570
  }
551
571
  else le && le.remove();
552
- const ce = ne.querySelector(
572
+ const ce = re.querySelector(
553
573
  ".rte-blockquote-footer"
554
574
  );
555
575
  if (F)
@@ -559,41 +579,41 @@ function Fo() {
559
579
  } else {
560
580
  const X = document.createElement("footer");
561
581
  X.className = "rte-blockquote-footer";
562
- const G = document.createElement("cite"), Y = document.createElement("a");
563
- Y.href = F, Y.textContent = F, Y.target = "_blank", Y.rel = "noopener noreferrer", G.appendChild(Y), X.appendChild(G), ne.appendChild(X);
582
+ const K = document.createElement("cite"), Y = document.createElement("a");
583
+ Y.href = F, Y.textContent = F, Y.target = "_blank", Y.rel = "noopener noreferrer", K.appendChild(Y), X.appendChild(K), re.appendChild(X);
564
584
  }
565
585
  else ce && ce.remove();
566
586
  } else {
567
- Ne();
587
+ Ae();
568
588
  const le = window.getSelection();
569
589
  if (!le || le.rangeCount === 0) {
570
590
  u.style.display = "none";
571
591
  return;
572
592
  }
573
- const ce = le.getRangeAt(0), X = ce.extractContents(), G = document.createElement("blockquote");
574
- if (G.className = "rte-blockquote", Z) {
575
- const ee = document.createElement("div");
576
- ee.className = "rte-blockquote-title", ee.textContent = Z, G.appendChild(ee);
593
+ const ce = le.getRangeAt(0), X = ce.extractContents(), K = document.createElement("blockquote");
594
+ if (K.className = "rte-blockquote", ee) {
595
+ const te = document.createElement("div");
596
+ te.className = "rte-blockquote-title", te.textContent = ee, K.appendChild(te);
577
597
  }
578
598
  const Y = document.createElement("p");
579
- if (Y.appendChild(X), G.appendChild(Y), F) {
580
- const ee = document.createElement("footer");
581
- ee.className = "rte-blockquote-footer";
582
- const se = document.createElement("cite"), de = document.createElement("a");
583
- de.href = F, de.textContent = F, de.target = "_blank", de.rel = "noopener noreferrer", se.appendChild(de), ee.appendChild(se), G.appendChild(ee);
599
+ if (Y.appendChild(X), K.appendChild(Y), F) {
600
+ const te = document.createElement("footer");
601
+ te.className = "rte-blockquote-footer";
602
+ const se = document.createElement("cite"), pe = document.createElement("a");
603
+ pe.href = F, pe.textContent = F, pe.target = "_blank", pe.rel = "noopener noreferrer", se.appendChild(pe), te.appendChild(se), K.appendChild(te);
584
604
  }
585
- ce.insertNode(G), le.removeAllRanges();
605
+ ce.insertNode(K), le.removeAllRanges();
586
606
  const oe = document.createRange();
587
- oe.setStartAfter(G), oe.collapse(!0), le.addRange(oe), pe(oe);
607
+ oe.setStartAfter(K), oe.collapse(!0), le.addRange(oe), de(oe);
588
608
  }
589
- u.style.display = "none", M.value = "", U.value = "", ne = null;
590
- }, J.appendChild(re), J.appendChild(te), J.appendChild(ie), m.appendChild(g), m.appendChild(C), m.appendChild(J), u.appendChild(m), document.body.appendChild(u);
591
- let ne = null, b = "";
609
+ u.style.display = "none", _.value = "", B.value = "", re = null;
610
+ }, U.appendChild(Z), U.appendChild(ne), U.appendChild(ie), m.appendChild(g), m.appendChild(k), m.appendChild(U), u.appendChild(m), document.body.appendChild(u);
611
+ let re = null, b = "";
592
612
  return h.onmousedown = () => {
593
- ne = null, b = "";
594
- const Z = window.getSelection();
595
- if (Z && Z.rangeCount > 0) {
596
- const F = Z.getRangeAt(0), le = document.createElement("div");
613
+ re = null, b = "";
614
+ const ee = window.getSelection();
615
+ if (ee && ee.rangeCount > 0) {
616
+ const F = ee.getRangeAt(0), le = document.createElement("div");
597
617
  le.appendChild(F.cloneContents()), b = le.innerHTML || F.toString();
598
618
  let ce = F.startContainer;
599
619
  for (; ce && ce.nodeType !== Node.ELEMENT_NODE; )
@@ -601,33 +621,33 @@ function Fo() {
601
621
  let X = ce;
602
622
  for (; X && X !== document.body; ) {
603
623
  if (X.tagName === "BLOCKQUOTE") {
604
- ne = X;
605
- const G = ne.querySelector(
624
+ re = X;
625
+ const K = re.querySelector(
606
626
  ".rte-blockquote-title"
607
- ), Y = ne.querySelector(
627
+ ), Y = re.querySelector(
608
628
  ".rte-blockquote-footer a"
609
629
  );
610
- M.value = G && G.textContent || "", U.value = Y && Y.href || "", re.style.display = "inline-block";
611
- const oe = ne.querySelector("p");
612
- q.innerHTML = oe ? oe.innerHTML : ne.innerHTML, B.textContent = G && G.textContent || "", Q.innerHTML = Y ? `<a href="${Y.href}">${Y.href}</a>` : "";
630
+ _.value = K && K.textContent || "", B.value = Y && Y.href || "", Z.style.display = "inline-block";
631
+ const oe = re.querySelector("p");
632
+ N.innerHTML = oe ? oe.innerHTML : re.innerHTML, W.textContent = K && K.textContent || "", J.innerHTML = Y ? `<a href="${Y.href}">${Y.href}</a>` : "";
613
633
  break;
614
634
  }
615
635
  X = X.parentElement;
616
636
  }
617
637
  }
618
- ne || (q.innerHTML = b || "<em>Selected text will appear here</em>", B.textContent = "", Q.innerHTML = "", re.style.display = "none"), pe();
619
- }, M.oninput = () => B.textContent = M.value, U.oninput = () => {
620
- const Z = U.value.trim();
621
- if (!Z) Q.innerHTML = "";
638
+ re || (N.innerHTML = b || "<em>Selected text will appear here</em>", W.textContent = "", J.innerHTML = "", Z.style.display = "none"), de();
639
+ }, _.oninput = () => W.textContent = _.value, B.oninput = () => {
640
+ const ee = B.value.trim();
641
+ if (!ee) J.innerHTML = "";
622
642
  else {
623
- const F = /^https?:\/\//i.test(Z) ? Z : `https://${Z}`;
624
- Q.innerHTML = `<a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a>`;
643
+ const F = /^https?:\/\//i.test(ee) ? ee : `https://${ee}`;
644
+ J.innerHTML = `<a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a>`;
625
645
  }
626
646
  }, h.onclick = () => {
627
- u.style.display = "flex", M.focus();
647
+ u.style.display = "flex", _.focus();
628
648
  }, v.appendChild(h), v;
629
649
  }
630
- function jo() {
650
+ function Ho() {
631
651
  const v = document.createDocumentFragment(), h = document.createElement("div");
632
652
  h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (u) => {
633
653
  (u.key === "Enter" || u.key === " ") && (u.preventDefault(), h.click());
@@ -635,7 +655,7 @@ function jo() {
635
655
  const p = ye(yo, { width: 16, height: 16 });
636
656
  return h.appendChild(p), h.title = "Remove Formatting", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "6px 10px", h.style.borderRadius = "3px", h.style.cursor = "pointer", h.style.color = "#000000", h.onmouseover = () => h.style.backgroundColor = "#f0f0f0", h.onmouseout = () => h.style.backgroundColor = "#ffffff", h.onclick = () => document.execCommand("removeFormat"), v.appendChild(h), v;
637
657
  }
638
- function Ho(v) {
658
+ function Bo(v) {
639
659
  const h = document.createDocumentFragment(), p = document.createElement("div");
640
660
  p.className = "rte-modal-overlay", p.style.display = "none";
641
661
  const u = document.createElement("div");
@@ -644,105 +664,105 @@ function Ho(v) {
644
664
  m.className = "rte-modal-header";
645
665
  const g = document.createElement("h3");
646
666
  g.className = "rte-modal-title", g.textContent = "Insert Video";
647
- const E = document.createElement("div");
648
- E.setAttribute("role", "button"), E.tabIndex = 0, E.style.userSelect = "none", E.className = "rte-modal-close", E.innerHTML = "&times;", E.onclick = () => p.style.display = "none", m.appendChild(g), m.appendChild(E);
667
+ const w = document.createElement("div");
668
+ w.setAttribute("role", "button"), w.tabIndex = 0, w.style.userSelect = "none", w.className = "rte-modal-close", w.innerHTML = "&times;", w.onclick = () => p.style.display = "none", m.appendChild(g), m.appendChild(w);
649
669
  const x = document.createElement("div");
650
670
  x.className = "rte-modal-form";
651
- const C = document.createElement("label");
652
- C.className = "rte-label", C.textContent = "Video URL";
653
- const _ = document.createElement("input");
654
- _.type = "url", _.className = "rte-input", _.placeholder = "https://... or YouTube URL";
655
- const M = document.createElement("div");
656
- M.className = "rte-preview-label", M.textContent = "Preview";
657
- const D = document.createElement("div");
658
- D.className = "rte-modal-preview";
659
- const U = document.createElement("div");
660
- U.className = "rte-form-left";
671
+ const k = document.createElement("label");
672
+ k.className = "rte-label", k.textContent = "Video URL";
673
+ const S = document.createElement("input");
674
+ S.type = "url", S.className = "rte-input", S.placeholder = "https://... or YouTube URL";
675
+ const _ = document.createElement("div");
676
+ _.className = "rte-preview-label", _.textContent = "Preview";
661
677
  const A = document.createElement("div");
662
- A.className = "rte-form-right";
663
- const N = document.createElement("div");
664
- N.className = "rte-field", N.appendChild(C), N.appendChild(_);
678
+ A.className = "rte-modal-preview";
665
679
  const B = document.createElement("div");
666
- B.className = "rte-dim-row";
667
- const q = document.createElement("div");
668
- q.style.display = "flex", q.style.flexDirection = "column";
669
- const Q = document.createElement("label");
670
- Q.className = "rte-label", Q.textContent = "Width (px)";
671
- const J = document.createElement("input");
672
- J.type = "text", J.className = "rte-dim-input", J.placeholder = "e.g., 560", q.appendChild(Q), q.appendChild(J);
673
- const re = document.createElement("div");
674
- re.style.display = "flex", re.style.flexDirection = "column";
675
- const te = document.createElement("label");
676
- te.className = "rte-label", te.textContent = "Height (px)";
680
+ B.className = "rte-form-left";
681
+ const P = document.createElement("div");
682
+ P.className = "rte-form-right";
683
+ const G = document.createElement("div");
684
+ G.className = "rte-field", G.appendChild(k), G.appendChild(S);
685
+ const W = document.createElement("div");
686
+ W.className = "rte-dim-row";
687
+ const N = document.createElement("div");
688
+ N.style.display = "flex", N.style.flexDirection = "column";
689
+ const J = document.createElement("label");
690
+ J.className = "rte-label", J.textContent = "Width (px)";
691
+ const U = document.createElement("input");
692
+ U.type = "text", U.className = "rte-dim-input", U.placeholder = "e.g., 560", N.appendChild(J), N.appendChild(U);
693
+ const Z = document.createElement("div");
694
+ Z.style.display = "flex", Z.style.flexDirection = "column";
695
+ const ne = document.createElement("label");
696
+ ne.className = "rte-label", ne.textContent = "Height (px)";
677
697
  const ie = document.createElement("input");
678
- ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", re.appendChild(te), re.appendChild(ie), B.appendChild(q), B.appendChild(re), U.appendChild(N), U.appendChild(B), A.appendChild(M), A.appendChild(D), x.appendChild(U), x.appendChild(A);
679
- const ne = document.createElement("div");
680
- ne.className = "rte-modal-actions";
698
+ ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", Z.appendChild(ne), Z.appendChild(ie), W.appendChild(N), W.appendChild(Z), B.appendChild(G), B.appendChild(W), P.appendChild(_), P.appendChild(A), x.appendChild(B), x.appendChild(P);
699
+ const re = document.createElement("div");
700
+ re.className = "rte-modal-actions";
681
701
  const b = document.createElement("div");
682
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";
683
- const Z = document.createElement("div");
684
- Z.setAttribute("role", "button"), Z.tabIndex = 0, Z.style.userSelect = "none", Z.className = "rte-btn-primary", Z.textContent = "Insert", ne.appendChild(b), ne.appendChild(Z), u.appendChild(m), u.appendChild(x), u.appendChild(ne), p.appendChild(u), document.body.appendChild(p);
703
+ const ee = document.createElement("div");
704
+ ee.setAttribute("role", "button"), ee.tabIndex = 0, ee.style.userSelect = "none", ee.className = "rte-btn-primary", ee.textContent = "Insert", re.appendChild(b), re.appendChild(ee), u.appendChild(m), u.appendChild(x), u.appendChild(re), p.appendChild(u), document.body.appendChild(p);
685
705
  const F = document.createElement("div");
686
706
  F.setAttribute("role", "button"), F.tabIndex = 0, F.style.userSelect = "none";
687
707
  const le = ye(To, { width: 16, height: 16 });
688
- F.appendChild(le), F.title = "Insert Video", F.style.border = "1px solid #e1e1e1", F.style.backgroundColor = "#ffffff", F.style.padding = "6px 10px", F.style.borderRadius = "3px", F.style.cursor = "pointer", F.style.color = "#000000", F.onmouseover = () => F.style.backgroundColor = "#f0f0f0", F.onmouseout = () => F.style.backgroundColor = "#ffffff", F.onmousedown = () => pe(), F.addEventListener("keydown", (G) => {
689
- (G.key === "Enter" || G.key === " ") && (G.preventDefault(), F.click());
708
+ F.appendChild(le), F.title = "Insert Video", F.style.border = "1px solid #e1e1e1", F.style.backgroundColor = "#ffffff", F.style.padding = "6px 10px", F.style.borderRadius = "3px", F.style.cursor = "pointer", F.style.color = "#000000", F.onmouseover = () => F.style.backgroundColor = "#f0f0f0", F.onmouseout = () => F.style.backgroundColor = "#ffffff", F.onmousedown = () => de(), F.addEventListener("keydown", (K) => {
709
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), F.click());
690
710
  }), F.onclick = () => {
691
- D.innerHTML = "<em>No URL entered</em>", _.value = "", p.style.display = "flex", _.focus();
711
+ A.innerHTML = "<em>No URL entered</em>", S.value = "", p.style.display = "flex", S.focus();
692
712
  };
693
713
  const ce = () => {
694
- const G = _.value.trim(), Y = J && J.value.trim() || "", oe = ie && ie.value.trim() || "", ee = parseInt(Y, 10), se = parseInt(oe, 10);
695
- if (!G) {
696
- D.innerHTML = "<em>No preview</em>";
714
+ const K = S.value.trim(), Y = U && U.value.trim() || "", oe = ie && ie.value.trim() || "", te = parseInt(Y, 10), se = parseInt(oe, 10);
715
+ if (!K) {
716
+ A.innerHTML = "<em>No preview</em>";
697
717
  return;
698
718
  }
699
- const de = G.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
700
- if (de) {
701
- const w = de[1], z = Number.isFinite(ee) ? ee : 320, j = Number.isFinite(se) ? se : 180;
702
- D.innerHTML = `<iframe width="${z}" height="${j}" src="https://www.youtube.com/embed/${w}" frameborder="0" allowfullscreen></iframe>`;
719
+ const pe = K.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
720
+ if (pe) {
721
+ const E = pe[1], z = Number.isFinite(te) ? te : 320, j = Number.isFinite(se) ? se : 180;
722
+ A.innerHTML = `<iframe width="${z}" height="${j}" src="https://www.youtube.com/embed/${E}" frameborder="0" allowfullscreen></iframe>`;
703
723
  return;
704
724
  }
705
- const fe = Number.isFinite(ee) ? `${ee}px` : "320px", he = Number.isFinite(se) ? `${se}px` : "auto";
706
- D.innerHTML = `<video controls style="max-width:100%; width:${fe}; height:${he};" src="${G}"></video>`;
725
+ const fe = Number.isFinite(te) ? `${te}px` : "320px", he = Number.isFinite(se) ? `${se}px` : "auto";
726
+ A.innerHTML = `<video controls style="max-width:100%; width:${fe}; height:${he};" src="${K}"></video>`;
707
727
  };
708
- _.oninput = ce, typeof J < "u" && (J.oninput = ce), typeof ie < "u" && (ie.oninput = ce), Z.onclick = () => {
709
- const G = _.value.trim(), Y = J && J.value.trim() || "", oe = ie && ie.value.trim() || "", ee = parseInt(Y, 10), se = parseInt(oe, 10);
710
- if (!G) {
728
+ S.oninput = ce, typeof U < "u" && (U.oninput = ce), typeof ie < "u" && (ie.oninput = ce), ee.onclick = () => {
729
+ const K = S.value.trim(), Y = U && U.value.trim() || "", oe = ie && ie.value.trim() || "", te = parseInt(Y, 10), se = parseInt(oe, 10);
730
+ if (!K) {
711
731
  p.style.display = "none";
712
732
  return;
713
733
  }
714
- Ne();
715
- const de = window.getSelection();
716
- if (!de || de.rangeCount === 0) {
734
+ Ae();
735
+ const pe = window.getSelection();
736
+ if (!pe || pe.rangeCount === 0) {
717
737
  p.style.display = "none";
718
738
  return;
719
739
  }
720
- const fe = de.getRangeAt(0), he = G.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
721
- let w;
740
+ const fe = pe.getRangeAt(0), he = K.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
741
+ let E;
722
742
  if (he) {
723
- const j = he[1], $ = document.createElement("div"), xe = Number.isFinite(ee) ? ee : 560, we = Number.isFinite(se) ? se : 315;
724
- $.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${j}" frameborder="0" allowfullscreen></iframe>`, $.contentEditable = "false", $.className = "editor-video-wrapper", $.style.display = "block", $.style.maxWidth = "100%", $.style.width = "auto", $.style.height = "auto", $.style.boxSizing = "border-box", $.style.userSelect = "none", w = $;
743
+ const j = he[1], $ = document.createElement("div"), xe = Number.isFinite(te) ? te : 560, we = Number.isFinite(se) ? se : 315;
744
+ $.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${j}" frameborder="0" allowfullscreen></iframe>`, $.contentEditable = "false", $.className = "editor-video-wrapper", $.style.display = "block", $.style.maxWidth = "100%", $.style.width = "auto", $.style.height = "auto", $.style.boxSizing = "border-box", $.style.userSelect = "none", E = $;
725
745
  } else {
726
746
  const j = document.createElement("div"), $ = document.createElement("video");
727
- $.controls = !0, $.src = G, Number.isFinite(ee) && ($.width = ee), Number.isFinite(se) && ($.height = se), $.style.maxWidth = "100%", $.style.display = "block", j.appendChild($), 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", w = j;
747
+ $.controls = !0, $.src = K, Number.isFinite(te) && ($.width = te), Number.isFinite(se) && ($.height = se), $.style.maxWidth = "100%", $.style.display = "block", j.appendChild($), 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;
728
748
  }
729
- fe.insertNode(w), de.removeAllRanges();
749
+ fe.insertNode(E), pe.removeAllRanges();
730
750
  const z = document.createRange();
731
- z.setStartAfter(w), z.collapse(!0), de.addRange(z), pe(z);
751
+ z.setStartAfter(E), z.collapse(!0), pe.addRange(z), de(z);
732
752
  try {
733
753
  const j = X;
734
754
  j && typeof j.focus == "function" && (j.focus(), j.dispatchEvent(new Event("input", { bubbles: !0 })));
735
755
  } catch {
736
756
  }
737
- p.style.display = "none", _.value = "", D.innerHTML = "";
757
+ p.style.display = "none", S.value = "", A.innerHTML = "";
738
758
  };
739
759
  const X = v.querySelector(".editor");
740
- return X && X.addEventListener("click", (G) => {
741
- const Y = G.target;
760
+ return X && X.addEventListener("click", (K) => {
761
+ const Y = K.target;
742
762
  Y && Y.tagName === "VIDEO" && Y.focus();
743
763
  }), h.appendChild(F), h;
744
764
  }
745
- function Bo(v) {
765
+ function qo(v) {
746
766
  const h = document.createElement("div");
747
767
  h.style.display = "flex", h.style.flexWrap = "wrap", h.style.gap = "8px", h.style.marginBottom = "10px", h.style.padding = "12px", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.borderRadius = "4px", h.style.boxShadow = "0 1px 3px rgba(0,0,0,0.1)";
748
768
  const p = to();
@@ -761,24 +781,24 @@ function Bo(v) {
761
781
  <option value="h3">Heading 3</option>
762
782
  <option value="h4">Heading 4</option>
763
783
  `, u.onchange = () => {
764
- const Q = u.value, J = Q === "p" ? "P" : Q.toUpperCase();
765
- document.execCommand("formatBlock", !1, `<${J}>`);
784
+ const J = u.value, U = J === "p" ? "P" : J.toUpperCase();
785
+ document.execCommand("formatBlock", !1, `<${U}>`);
766
786
  }, h.appendChild(u), document.addEventListener("selectionchange", () => {
767
787
  try {
768
- const Q = window.getSelection();
769
- if (!Q || !Q.anchorNode) return;
770
- let J = Q.anchorNode;
771
- for (; J && J.nodeType !== Node.ELEMENT_NODE; )
772
- J = J.parentNode;
773
- if (!J) return;
774
- let re = J;
775
- for (; re && re !== document.body && re !== h.parentElement; ) {
776
- const te = re.tagName?.toUpperCase?.();
777
- if (te === "H1" || te === "H2" || te === "H3" || te === "H4" || te === "P") {
778
- u.value = te === "P" ? "p" : te.toLowerCase();
788
+ const J = window.getSelection();
789
+ if (!J || !J.anchorNode) return;
790
+ let U = J.anchorNode;
791
+ for (; U && U.nodeType !== Node.ELEMENT_NODE; )
792
+ U = U.parentNode;
793
+ if (!U) return;
794
+ let Z = U;
795
+ for (; Z && Z !== document.body && Z !== h.parentElement; ) {
796
+ const ne = Z.tagName?.toUpperCase?.();
797
+ if (ne === "H1" || ne === "H2" || ne === "H3" || ne === "H4" || ne === "P") {
798
+ u.value = ne === "P" ? "p" : ne.toLowerCase();
779
799
  return;
780
800
  }
781
- re = re.parentElement;
801
+ Z = Z.parentElement;
782
802
  }
783
803
  u.value = "p";
784
804
  } catch {
@@ -794,164 +814,200 @@ function Bo(v) {
794
814
  <option value="6">24pt</option>
795
815
  <option value="7">36pt</option>
796
816
  `, m.style.border = "1px solid #e1e1e1", m.style.backgroundColor = "#ffffff", m.style.padding = "4px", m.style.borderRadius = "3px", m.style.color = "#000000", m.onchange = () => document.execCommand("fontSize", !1, m.value), h.appendChild(m);
797
- const g = _o();
817
+ const g = Ro();
798
818
  h.appendChild(g);
799
- const E = Ao();
800
- h.appendChild(E);
819
+ const w = Ao();
820
+ h.appendChild(w);
801
821
  const x = Io();
802
822
  h.appendChild(x);
803
- const C = Po();
804
- h.appendChild(C);
805
- const _ = Oo();
823
+ const k = Oo();
824
+ h.appendChild(k);
825
+ const S = Do();
826
+ h.appendChild(S);
827
+ const _ = No();
806
828
  h.appendChild(_);
807
- const M = Do();
808
- h.appendChild(M);
809
- const D = No();
810
- h.appendChild(D);
811
- const U = Lo(v);
812
- h.appendChild(U);
813
- const A = Fo();
829
+ const A = zo();
814
830
  h.appendChild(A);
815
- const N = jo();
816
- h.appendChild(N);
817
- const B = Ho(v);
831
+ const B = Fo(v);
818
832
  h.appendChild(B);
819
- const q = zo();
820
- return h.appendChild(q), h;
833
+ const P = jo();
834
+ h.appendChild(P);
835
+ const G = Ho();
836
+ h.appendChild(G);
837
+ const W = Bo(v);
838
+ h.appendChild(W);
839
+ const N = Lo();
840
+ return h.appendChild(N), h;
821
841
  }
822
- function qo(v) {
842
+ function Wo(v) {
823
843
  const p = new DOMParser().parseFromString(v, "text/html");
824
844
  return Array.from(p.querySelectorAll("img")).forEach((m) => {
825
845
  if (!p.body.contains(m) || m.closest(".editor-image-wrapper")) return;
826
- const E = m.getAttribute("src") || m.src;
827
- if (!E) return;
846
+ const w = m.getAttribute("src") || m.src;
847
+ if (!w) return;
828
848
  const x = document.createElement("img");
829
- x.src = E, m.alt && (x.alt = m.alt), m.title && (x.title = m.title), x.style.maxWidth = "100%", x.style.width = "100%", x.style.height = "auto", x.style.cursor = "pointer", x.draggable = !1;
830
- const C = m.getAttribute("width") || m.style.width || (m.naturalWidth > 0 ? `${m.naturalWidth}px` : null), _ = document.createElement("div");
831
- _.className = "editor-image-wrapper", _.style.display = "inline-block", _.style.position = "relative", _.style.maxWidth = "100%", _.style.width = C && C !== "0px" ? C.includes("px") ? C : `${C}px` : "300px", _.style.height = "auto", _.contentEditable = "false", _.style.boxSizing = "border-box", _.style.touchAction = "none", _.style.userSelect = "none", _.appendChild(x);
832
- const M = document.createElement("p");
833
- M.style.margin = "10px 0", M.style.textAlign = "left", M.style.display = "block", M.appendChild(_);
834
- let D = m;
835
- const U = m.closest("figure"), A = m.closest("picture");
836
- if (U && p.body.contains(U))
837
- D = U;
838
- else if (A && p.body.contains(A))
839
- D = A;
849
+ x.src = w, m.alt && (x.alt = m.alt), m.title && (x.title = m.title), x.style.maxWidth = "100%", x.style.width = "100%", x.style.height = "auto", x.style.cursor = "pointer", x.draggable = !1;
850
+ const k = m.getAttribute("width") || m.style.width || (m.naturalWidth > 0 ? `${m.naturalWidth}px` : null), S = document.createElement("div");
851
+ S.className = "editor-image-wrapper", S.style.display = "inline-block", S.style.position = "relative", S.style.maxWidth = "100%", S.style.width = k && k !== "0px" ? k.includes("px") ? k : `${k}px` : "300px", S.style.height = "auto", S.contentEditable = "false", S.style.boxSizing = "border-box", S.style.touchAction = "none", S.style.userSelect = "none", S.appendChild(x);
852
+ const _ = document.createElement("p");
853
+ _.style.margin = "10px 0", _.style.textAlign = "left", _.style.display = "block", _.appendChild(S);
854
+ let A = m;
855
+ const B = m.closest("figure"), P = m.closest("picture");
856
+ if (B && p.body.contains(B))
857
+ A = B;
858
+ else if (P && p.body.contains(P))
859
+ A = P;
840
860
  else {
841
- let N = m.parentNode;
842
- for (; N && N !== p.body && N.parentNode !== p.body && Array.from(N.childNodes).filter(
843
- (q) => q.nodeType === Node.ELEMENT_NODE || q.nodeType === Node.TEXT_NODE && q.textContent?.trim()
861
+ let G = m.parentNode;
862
+ for (; G && G !== p.body && G.parentNode !== p.body && Array.from(G.childNodes).filter(
863
+ (N) => N.nodeType === Node.ELEMENT_NODE || N.nodeType === Node.TEXT_NODE && N.textContent?.trim()
844
864
  ).length === 1; )
845
- D = N, N = N.parentNode;
865
+ A = G, G = G.parentNode;
846
866
  }
847
- D && D.parentNode && p.body.contains(D) ? D.parentNode.replaceChild(M, D) : m.parentNode && p.body.contains(m) && m.parentNode.replaceChild(M, m);
867
+ A && A.parentNode && p.body.contains(A) ? A.parentNode.replaceChild(_, A) : m.parentNode && p.body.contains(m) && m.parentNode.replaceChild(_, m);
848
868
  }), p.body.innerHTML;
849
869
  }
850
- function Wo(v, h) {
870
+ function Yo(v, h) {
851
871
  const p = document.createElement("div");
852
872
  p.classList.add("editor"), p.contentEditable = "true", p.style.color = "#000000", p.style.border = "1px solid #e1e1e1", p.style.height = "400px", p.style.overflowY = "auto", p.style.padding = "15px", p.style.fontFamily = "Arial, sans-serif", p.style.fontSize = "14px", p.style.lineHeight = "1.5", p.style.outline = "none", p.style.backgroundColor = "#ffffff", p.style.borderRadius = "4px", p.style.boxShadow = "inset 0 1px 3px rgba(0,0,0,0.1)", p.style.direction = "ltr", p.style.textAlign = "left", p.style.scrollbarWidth = "none", p.style.msOverflowStyle = "none";
853
873
  const u = document.createElement("style");
854
- return u.textContent = ".editor::-webkit-scrollbar { display: none; }", document.querySelector("style[data-editor-scrollbar]") || (u.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(u)), p.innerHTML = "", p.addEventListener("dragover", (m) => {
855
- m.preventDefault(), m.stopPropagation();
856
- }), p.addEventListener("drop", (m) => {
857
- m.preventDefault(), m.stopPropagation();
858
- const g = m.clientX, E = m.clientY;
859
- let x = null;
874
+ u.textContent = `
875
+ .editor::-webkit-scrollbar { display: none; }
876
+ .editor ul, .editor ol {
877
+ margin: 0.5em 0;
878
+ padding-left: 2em;
879
+ list-style-position: outside;
880
+ }
881
+ .editor ul { list-style-type: disc; }
882
+ .editor ol { list-style-type: decimal; }
883
+ .editor li {
884
+ margin: 0.25em 0;
885
+ display: list-item;
886
+ }
887
+ `, document.querySelector("style[data-editor-scrollbar]") || (u.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(u)), p.innerHTML = "", p.addEventListener("dragover", (w) => {
888
+ w.preventDefault(), w.stopPropagation();
889
+ }), p.addEventListener("drop", (w) => {
890
+ w.preventDefault(), w.stopPropagation();
891
+ const x = w.clientX, k = w.clientY;
892
+ let S = null;
860
893
  if (document.caretRangeFromPoint)
861
- x = document.caretRangeFromPoint(g, E);
894
+ S = document.caretRangeFromPoint(x, k);
862
895
  else if (document.caretPositionFromPoint) {
863
- const _ = document.caretPositionFromPoint(g, E);
864
- _ && (x = document.createRange(), x.setStart(_.offsetNode, _.offset));
896
+ const A = document.caretPositionFromPoint(x, k);
897
+ A && (S = document.createRange(), S.setStart(A.offsetNode, A.offset));
865
898
  }
866
- const C = m.dataTransfer?.files;
867
- if (C && C.length > 0)
868
- for (let _ = 0; _ < C.length; _++) {
869
- const M = C[_];
870
- if (M.type.startsWith("image/")) {
871
- const D = new FileReader();
872
- D.onload = (U) => {
873
- const A = document.createElement("img");
874
- A.src = U.target?.result, A.style.maxWidth = "100%", A.style.width = "100%", A.style.height = "auto", A.style.cursor = "pointer", A.draggable = !1;
899
+ const _ = w.dataTransfer?.files;
900
+ if (_ && _.length > 0)
901
+ for (let A = 0; A < _.length; A++) {
902
+ const B = _[A];
903
+ if (B.type.startsWith("image/")) {
904
+ const P = new FileReader();
905
+ P.onload = (G) => {
906
+ const W = document.createElement("img");
907
+ W.src = G.target?.result, W.style.maxWidth = "100%", W.style.width = "100%", W.style.height = "auto", W.style.cursor = "pointer", W.draggable = !1;
875
908
  const N = document.createElement("div");
876
- N.className = "editor-image-wrapper", N.style.display = "inline-block", N.style.position = "relative", N.style.maxWidth = "100%", N.style.width = "auto", N.style.height = "auto", N.contentEditable = "false", N.style.userSelect = "none", N.style.boxSizing = "border-box", N.style.touchAction = "none", N.appendChild(A);
877
- const B = document.createElement("div");
878
- if (B.contentEditable = "true", B.style.margin = "10px 0", B.style.textAlign = "left", B.style.display = "block", B.appendChild(N), x)
909
+ N.className = "editor-image-wrapper", N.style.display = "inline-block", N.style.position = "relative", N.style.maxWidth = "100%", N.style.width = "auto", N.style.height = "auto", N.contentEditable = "false", N.style.userSelect = "none", N.style.boxSizing = "border-box", N.style.touchAction = "none", N.appendChild(W);
910
+ const J = document.createElement("div");
911
+ if (J.contentEditable = "true", J.style.margin = "10px 0", J.style.textAlign = "left", J.style.display = "block", J.appendChild(N), S)
879
912
  try {
880
- x.insertNode(B);
881
- const q = window.getSelection();
882
- if (q) {
883
- q.removeAllRanges();
884
- const Q = document.createRange();
885
- Q.setStartAfter(B), Q.collapse(!0), q.addRange(Q), pe(Q);
913
+ S.insertNode(J);
914
+ const U = window.getSelection();
915
+ if (U) {
916
+ U.removeAllRanges();
917
+ const Z = document.createRange();
918
+ Z.setStartAfter(J), Z.collapse(!0), U.addRange(Z), de(Z);
886
919
  }
887
920
  } catch {
888
- p.appendChild(B);
921
+ p.appendChild(J);
889
922
  }
890
923
  else
891
- p.appendChild(B);
924
+ p.appendChild(J);
892
925
  p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus();
893
- }, D.readAsDataURL(M);
894
- }
895
- }
896
- }), p.addEventListener("paste", (m) => {
897
- m.preventDefault();
898
- const g = m.clipboardData;
899
- if (!g) return;
900
- let E = g.getData("text/html");
901
- E ? E = qo(E) : E = g.getData("text/plain");
902
- const x = window.getSelection();
903
- if (x && x.rangeCount > 0) {
904
- const C = x.getRangeAt(0), _ = document.createElement("div");
905
- _.innerHTML = E;
906
- const M = document.createDocumentFragment();
907
- for (; _.firstChild; )
908
- M.appendChild(_.firstChild);
909
- C.deleteContents(), C.insertNode(M), C.collapse(!1), x.removeAllRanges(), x.addRange(C);
926
+ }, P.readAsDataURL(B);
927
+ }
928
+ }
929
+ }), p.addEventListener("paste", (w) => {
930
+ w.preventDefault();
931
+ const x = w.clipboardData;
932
+ if (!x) return;
933
+ let k = x.getData("text/html");
934
+ k ? k = Wo(k) : k = x.getData("text/plain");
935
+ const S = window.getSelection();
936
+ if (S && S.rangeCount > 0) {
937
+ const _ = S.getRangeAt(0), A = document.createElement("div");
938
+ A.innerHTML = k;
939
+ const B = document.createDocumentFragment();
940
+ for (; A.firstChild; )
941
+ B.appendChild(A.firstChild);
942
+ _.deleteContents(), _.insertNode(B), _.collapse(!1), S.removeAllRanges(), S.addRange(_);
910
943
  } else {
911
- const C = document.createElement("div");
912
- for (C.innerHTML = E; C.firstChild; )
913
- p.appendChild(C.firstChild);
944
+ const _ = document.createElement("div");
945
+ for (_.innerHTML = k; _.firstChild; )
946
+ p.appendChild(_.firstChild);
914
947
  }
915
- p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), pe();
916
- }), p.addEventListener("click", (m) => {
917
- const g = m.target;
918
- let E = g;
919
- if (g.tagName === "IMG" && (E = g.parentElement), E && E.classList.contains("editor-image-wrapper")) {
920
- m.preventDefault(), m.stopPropagation(), h(E);
921
- const x = E.parentElement;
922
- if (x && (x.tagName === "DIV" || x.tagName === "P") && x.querySelector(".editor-image-wrapper"))
948
+ p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), de();
949
+ }), p.addEventListener("click", (w) => {
950
+ const x = w.target;
951
+ let k = x;
952
+ if (x.tagName === "IMG" && (k = x.parentElement), k && k.classList.contains("editor-image-wrapper")) {
953
+ w.preventDefault(), w.stopPropagation(), h(k);
954
+ const S = k.parentElement;
955
+ if (S && (S.tagName === "DIV" || S.tagName === "P") && S.querySelector(".editor-image-wrapper"))
923
956
  try {
924
- const C = window.getSelection();
925
- if (C) {
926
- const _ = document.createRange();
927
- _.selectNodeContents(x), C.removeAllRanges(), C.addRange(_), pe();
957
+ const _ = window.getSelection();
958
+ if (_) {
959
+ const A = document.createRange();
960
+ A.selectNodeContents(S), _.removeAllRanges(), _.addRange(A), de();
928
961
  }
929
962
  } catch {
930
963
  }
931
964
  } else
932
- pe();
933
- }), p.addEventListener("keyup", () => pe()), p.addEventListener("mouseup", () => pe()), p.addEventListener("focus", () => pe()), window.addEventListener("selectionchange", () => {
965
+ de();
966
+ }), p.addEventListener("keyup", () => de()), p.addEventListener("mouseup", () => de()), p.addEventListener("focus", () => de()), window.addEventListener("selectionchange", () => {
934
967
  try {
935
- const m = window.getSelection();
936
- if (!m || !m.anchorNode) return;
937
- let g = m.anchorNode;
938
- for (; g && g.nodeType !== Node.ELEMENT_NODE; )
939
- g = g.parentNode;
940
- if (!g) return;
941
- p.contains(g) && pe();
968
+ const w = window.getSelection();
969
+ if (!w || !w.anchorNode) return;
970
+ let x = w.anchorNode;
971
+ for (; x && x.nodeType !== Node.ELEMENT_NODE; )
972
+ x = x.parentNode;
973
+ if (!x) return;
974
+ p.contains(x) && de();
942
975
  } catch {
943
976
  }
944
- }), p;
977
+ });
978
+ const m = () => {
979
+ if (!p.firstChild) {
980
+ p.innerHTML = "<p><br></p>";
981
+ return;
982
+ }
983
+ const w = Array.from(p.childNodes);
984
+ for (const x of w)
985
+ if (x.nodeType === Node.TEXT_NODE && x.textContent?.trim()) {
986
+ const k = window.getSelection();
987
+ let S = null;
988
+ k && k.rangeCount > 0 && (S = k.getRangeAt(0).cloneRange());
989
+ const _ = document.createElement("p");
990
+ if (x.parentNode?.insertBefore(_, x), _.appendChild(x), S && k)
991
+ try {
992
+ k.removeAllRanges(), k.addRange(S);
993
+ } catch {
994
+ }
995
+ }
996
+ };
997
+ let g = null;
998
+ return p.addEventListener("input", () => {
999
+ g && clearTimeout(g), g = setTimeout(() => m(), 100);
1000
+ }), !p.innerHTML || p.innerHTML.trim() === "" ? p.innerHTML = "<p><br></p>" : m(), p;
945
1001
  }
946
- function Yo(v) {
1002
+ function $o(v) {
947
1003
  return v && v.__esModule && Object.prototype.hasOwnProperty.call(v, "default") ? v.default : v;
948
1004
  }
949
- var Ke = { exports: {} }, $o = Ke.exports, Pn;
950
- function Vo() {
1005
+ var Je = { exports: {} }, Vo = Je.exports, Pn;
1006
+ function Uo() {
951
1007
  return Pn || (Pn = 1, (function(v, h) {
952
1008
  (function(p, u) {
953
1009
  v.exports = u();
954
- })($o, (function() {
1010
+ })(Vo, (function() {
955
1011
  function p(t, e) {
956
1012
  var n = Object.keys(t);
957
1013
  if (Object.getOwnPropertySymbols) {
@@ -966,7 +1022,7 @@ function Vo() {
966
1022
  for (var e = 1; e < arguments.length; e++) {
967
1023
  var n = arguments[e] != null ? arguments[e] : {};
968
1024
  e % 2 ? p(Object(n), !0).forEach((function(r) {
969
- C(t, r, n[r]);
1025
+ k(t, r, n[r]);
970
1026
  })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : p(Object(n)).forEach((function(r) {
971
1027
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
972
1028
  }));
@@ -983,37 +1039,37 @@ function Vo() {
983
1039
  function g(t, e) {
984
1040
  if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
985
1041
  }
986
- function E(t, e) {
1042
+ function w(t, e) {
987
1043
  for (var n = 0; n < e.length; n++) {
988
1044
  var r = e[n];
989
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, B(r.key), r);
1045
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, W(r.key), r);
990
1046
  }
991
1047
  }
992
1048
  function x(t, e, n) {
993
- return e && E(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
1049
+ return e && w(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
994
1050
  }
995
- function C(t, e, n) {
996
- return (e = B(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
1051
+ function k(t, e, n) {
1052
+ return (e = W(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
997
1053
  }
998
- function _(t, e) {
1054
+ function S(t, e) {
999
1055
  if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
1000
- t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && D(t, e);
1056
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && A(t, e);
1001
1057
  }
1002
- function M(t) {
1003
- return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
1058
+ function _(t) {
1059
+ return _ = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
1004
1060
  return e.__proto__ || Object.getPrototypeOf(e);
1005
- }, M(t);
1061
+ }, _(t);
1006
1062
  }
1007
- function D(t, e) {
1008
- return D = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
1063
+ function A(t, e) {
1064
+ return A = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
1009
1065
  return n.__proto__ = r, n;
1010
- }, D(t, e);
1066
+ }, A(t, e);
1011
1067
  }
1012
- function U(t) {
1068
+ function B(t) {
1013
1069
  if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1014
1070
  return t;
1015
1071
  }
1016
- function A(t) {
1072
+ function P(t) {
1017
1073
  var e = (function() {
1018
1074
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
1019
1075
  if (typeof Proxy == "function") return !0;
@@ -1025,31 +1081,31 @@ function Vo() {
1025
1081
  }
1026
1082
  })();
1027
1083
  return function() {
1028
- var n, r = M(t);
1084
+ var n, r = _(t);
1029
1085
  if (e) {
1030
- var o = M(this).constructor;
1086
+ var o = _(this).constructor;
1031
1087
  n = Reflect.construct(r, arguments, o);
1032
1088
  } else n = r.apply(this, arguments);
1033
1089
  return (function(i, a) {
1034
1090
  if (a && (typeof a == "object" || typeof a == "function")) return a;
1035
1091
  if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
1036
- return U(i);
1092
+ return B(i);
1037
1093
  })(this, n);
1038
1094
  };
1039
1095
  }
1040
- function N() {
1041
- return N = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
1096
+ function G() {
1097
+ return G = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
1042
1098
  var r = (function(i, a) {
1043
- for (; !Object.prototype.hasOwnProperty.call(i, a) && (i = M(i)) !== null; ) ;
1099
+ for (; !Object.prototype.hasOwnProperty.call(i, a) && (i = _(i)) !== null; ) ;
1044
1100
  return i;
1045
1101
  })(t, e);
1046
1102
  if (r) {
1047
1103
  var o = Object.getOwnPropertyDescriptor(r, e);
1048
1104
  return o.get ? o.get.call(arguments.length < 3 ? t : n) : o.value;
1049
1105
  }
1050
- }, N.apply(this, arguments);
1106
+ }, G.apply(this, arguments);
1051
1107
  }
1052
- function B(t) {
1108
+ function W(t) {
1053
1109
  var e = (function(n, r) {
1054
1110
  if (typeof n != "object" || n === null) return n;
1055
1111
  var o = n[Symbol.toPrimitive];
@@ -1062,27 +1118,27 @@ function Vo() {
1062
1118
  })(t, "string");
1063
1119
  return typeof e == "symbol" ? e : e + "";
1064
1120
  }
1065
- var q = function(t) {
1121
+ var N = function(t) {
1066
1122
  return !(!t || !t.Window) && t instanceof t.Window;
1067
- }, Q = void 0, J = void 0;
1068
- function re(t) {
1069
- Q = t;
1123
+ }, J = void 0, U = void 0;
1124
+ function Z(t) {
1125
+ J = t;
1070
1126
  var e = t.document.createTextNode("");
1071
- e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), J = t;
1127
+ e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), U = t;
1072
1128
  }
1073
- function te(t) {
1074
- return q(t) ? t : (t.ownerDocument || t).defaultView || J.window;
1129
+ function ne(t) {
1130
+ return N(t) ? t : (t.ownerDocument || t).defaultView || U.window;
1075
1131
  }
1076
- typeof window < "u" && window && re(window);
1132
+ typeof window < "u" && window && Z(window);
1077
1133
  var ie = function(t) {
1078
1134
  return !!t && m(t) === "object";
1079
- }, ne = function(t) {
1135
+ }, re = function(t) {
1080
1136
  return typeof t == "function";
1081
1137
  }, b = { window: function(t) {
1082
- return t === J || q(t);
1138
+ return t === U || N(t);
1083
1139
  }, docFrag: function(t) {
1084
1140
  return ie(t) && t.nodeType === 11;
1085
- }, object: ie, func: ne, number: function(t) {
1141
+ }, object: ie, func: re, number: function(t) {
1086
1142
  return typeof t == "number";
1087
1143
  }, bool: function(t) {
1088
1144
  return typeof t == "boolean";
@@ -1090,14 +1146,14 @@ function Vo() {
1090
1146
  return typeof t == "string";
1091
1147
  }, element: function(t) {
1092
1148
  if (!t || m(t) !== "object") return !1;
1093
- var e = te(t) || J;
1149
+ var e = ne(t) || U;
1094
1150
  return /object|function/.test(typeof Element > "u" ? "undefined" : m(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
1095
1151
  }, plainObject: function(t) {
1096
1152
  return ie(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
1097
1153
  }, array: function(t) {
1098
- return ie(t) && t.length !== void 0 && ne(t.splice);
1154
+ return ie(t) && t.length !== void 0 && re(t.splice);
1099
1155
  } };
1100
- function Z(t) {
1156
+ function ee(t) {
1101
1157
  var e = t.interaction;
1102
1158
  if (e.prepared.name === "drag") {
1103
1159
  var n = e.prepared.axis;
@@ -1117,25 +1173,25 @@ function Vo() {
1117
1173
  var le = { id: "actions/drag", install: function(t) {
1118
1174
  var e = t.actions, n = t.Interactable, r = t.defaults;
1119
1175
  n.prototype.draggable = le.draggable, e.map.drag = le, e.methodDict.drag = "draggable", r.actions.drag = le.defaults;
1120
- }, listeners: { "interactions:before-action-move": Z, "interactions:action-resume": Z, "interactions:action-move": F, "auto-start:check": function(t) {
1176
+ }, listeners: { "interactions:before-action-move": ee, "interactions:action-resume": ee, "interactions:action-move": F, "auto-start:check": function(t) {
1121
1177
  var e = t.interaction, n = t.interactable, r = t.buttons, o = n.options.drag;
1122
1178
  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;
1123
1179
  } }, draggable: function(t) {
1124
1180
  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;
1125
- }, beforeMove: Z, move: F, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
1181
+ }, beforeMove: ee, move: F, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
1126
1182
  return "move";
1127
1183
  }, filterEventType: function(t) {
1128
1184
  return t.search("drag") === 0;
1129
1185
  } }, ce = le, X = { init: function(t) {
1130
1186
  var e = t;
1131
- X.document = e.document, X.DocumentFragment = e.DocumentFragment || G, X.SVGElement = e.SVGElement || G, X.SVGSVGElement = e.SVGSVGElement || G, X.SVGElementInstance = e.SVGElementInstance || G, X.Element = e.Element || G, X.HTMLElement = e.HTMLElement || X.Element, X.Event = e.Event, X.Touch = e.Touch || G, X.PointerEvent = e.PointerEvent || e.MSPointerEvent;
1187
+ X.document = e.document, X.DocumentFragment = e.DocumentFragment || K, X.SVGElement = e.SVGElement || K, X.SVGSVGElement = e.SVGSVGElement || K, X.SVGElementInstance = e.SVGElementInstance || K, X.Element = e.Element || K, X.HTMLElement = e.HTMLElement || X.Element, X.Event = e.Event, X.Touch = e.Touch || K, X.PointerEvent = e.PointerEvent || e.MSPointerEvent;
1132
1188
  }, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
1133
- function G() {
1189
+ function K() {
1134
1190
  }
1135
1191
  var Y = X, oe = { init: function(t) {
1136
1192
  var e = Y.Element, n = t.navigator || {};
1137
1193
  oe.supportsTouch = "ontouchstart" in t || b.func(t.DocumentTouch) && Y.document instanceof t.DocumentTouch, oe.supportsPointerEvent = n.pointerEnabled !== !1 && !!Y.PointerEvent, oe.isIOS = /iP(hone|od|ad)/.test(n.platform), oe.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), oe.isIe9 = /MSIE 9/.test(n.userAgent), oe.isOperaMobile = n.appName === "Opera" && oe.supportsTouch && /Presto/.test(n.userAgent), oe.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", oe.pEventTypes = oe.supportsPointerEvent ? Y.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, oe.wheelEvent = Y.document && "onmousewheel" in Y.document ? "mousewheel" : "wheel";
1138
- }, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, ee = oe;
1194
+ }, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, te = oe;
1139
1195
  function se(t, e) {
1140
1196
  if (t.contains) return t.contains(e);
1141
1197
  for (; e; ) {
@@ -1144,7 +1200,7 @@ function Vo() {
1144
1200
  }
1145
1201
  return !1;
1146
1202
  }
1147
- function de(t, e) {
1203
+ function pe(t, e) {
1148
1204
  for (; b.element(t); ) {
1149
1205
  if (he(t, e)) return t;
1150
1206
  t = fe(t);
@@ -1160,13 +1216,13 @@ function Vo() {
1160
1216
  return e;
1161
1217
  }
1162
1218
  function he(t, e) {
1163
- return J !== Q && (e = e.replace(/\/deep\//g, " ")), t[ee.prefixedMatchesSelector](e);
1219
+ return U !== J && (e = e.replace(/\/deep\//g, " ")), t[te.prefixedMatchesSelector](e);
1164
1220
  }
1165
- var w = function(t) {
1221
+ var E = function(t) {
1166
1222
  return t.parentNode || t.host;
1167
1223
  };
1168
1224
  function z(t, e) {
1169
- for (var n, r = [], o = t; (n = w(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
1225
+ for (var n, r = [], o = t; (n = E(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
1170
1226
  return r;
1171
1227
  }
1172
1228
  function j(t, e, n) {
@@ -1185,8 +1241,8 @@ function Vo() {
1185
1241
  }
1186
1242
  function we(t) {
1187
1243
  var e, n = xe(t);
1188
- if (!ee.isIOS7 && n) {
1189
- var r = { x: (e = (e = te(t)) || J).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
1244
+ if (!te.isIOS7 && n) {
1245
+ var r = { x: (e = (e = ne(t)) || U).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
1190
1246
  n.left += r.x, n.right += r.x, n.top += r.y, n.bottom += r.y;
1191
1247
  }
1192
1248
  return n;
@@ -1198,55 +1254,55 @@ function Vo() {
1198
1254
  function Ee(t) {
1199
1255
  return !!b.string(t) && (Y.document.querySelector(t), !0);
1200
1256
  }
1201
- function P(t, e) {
1257
+ function O(t, e) {
1202
1258
  for (var n in e) t[n] = e[n];
1203
1259
  return t;
1204
1260
  }
1205
- function Qe(t, e, n) {
1206
- return t === "parent" ? fe(n) : t === "self" ? e.getRect(n) : de(n, t);
1261
+ function Ze(t, e, n) {
1262
+ return t === "parent" ? fe(n) : t === "self" ? e.getRect(n) : pe(n, t);
1207
1263
  }
1208
1264
  function ze(t, e, n, r) {
1209
1265
  var o = t;
1210
- return b.string(o) ? o = Qe(o, e, n) : b.func(o) && (o = o.apply(void 0, r)), b.element(o) && (o = we(o)), o;
1266
+ return b.string(o) ? o = Ze(o, e, n) : b.func(o) && (o = o.apply(void 0, r)), b.element(o) && (o = we(o)), o;
1211
1267
  }
1212
- function Ze(t) {
1268
+ function et(t) {
1213
1269
  return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
1214
1270
  }
1215
- function vt(t) {
1216
- return !t || "x" in t && "y" in t || ((t = P({}, t)).x = t.left || 0, t.y = t.top || 0, t.width = t.width || (t.right || 0) - t.x, t.height = t.height || (t.bottom || 0) - t.y), t;
1271
+ function mt(t) {
1272
+ return !t || "x" in t && "y" in t || ((t = O({}, t)).x = t.left || 0, t.y = t.top || 0, t.width = t.width || (t.right || 0) - t.x, t.height = t.height || (t.bottom || 0) - t.y), t;
1217
1273
  }
1218
- function et(t, e, n) {
1274
+ function tt(t, e, n) {
1219
1275
  t.left && (e.left += n.x), t.right && (e.right += n.x), t.top && (e.top += n.y), t.bottom && (e.bottom += n.y), e.width = e.right - e.left, e.height = e.bottom - e.top;
1220
1276
  }
1221
1277
  function Le(t, e, n) {
1222
1278
  var r = n && t.options[n];
1223
- return Ze(ze(r && r.origin || t.options.origin, t, e, [t && e])) || { x: 0, y: 0 };
1279
+ return et(ze(r && r.origin || t.options.origin, t, e, [t && e])) || { x: 0, y: 0 };
1224
1280
  }
1225
- function Ae(t, e) {
1281
+ function Ie(t, e) {
1226
1282
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(l) {
1227
1283
  return !0;
1228
1284
  }, r = arguments.length > 3 ? arguments[3] : void 0;
1229
- if (r = r || {}, b.string(t) && t.search(" ") !== -1 && (t = Ht(t)), b.array(t)) return t.forEach((function(l) {
1230
- return Ae(l, e, n, r);
1285
+ if (r = r || {}, b.string(t) && t.search(" ") !== -1 && (t = Bt(t)), b.array(t)) return t.forEach((function(l) {
1286
+ return Ie(l, e, n, r);
1231
1287
  })), r;
1232
1288
  if (b.object(t) && (e = t, t = ""), b.func(e) && n(t)) r[t] = r[t] || [], r[t].push(e);
1233
1289
  else if (b.array(e)) for (var o = 0, i = e; o < i.length; o++) {
1234
1290
  var a = i[o];
1235
- Ae(t, a, n, r);
1291
+ Ie(t, a, n, r);
1236
1292
  }
1237
1293
  else if (b.object(e)) for (var s in e)
1238
- Ae(Ht(s).map((function(l) {
1294
+ Ie(Bt(s).map((function(l) {
1239
1295
  return "".concat(t).concat(l);
1240
1296
  })), e[s], n, r);
1241
1297
  return r;
1242
1298
  }
1243
- function Ht(t) {
1299
+ function Bt(t) {
1244
1300
  return t.trim().split(/ +/);
1245
1301
  }
1246
1302
  var Fe = function(t, e) {
1247
1303
  return Math.sqrt(t * t + e * e);
1248
1304
  }, jn = ["webkit", "moz"];
1249
- function tt(t, e) {
1305
+ function nt(t, e) {
1250
1306
  t.__set || (t.__set = {});
1251
1307
  var n = function(o) {
1252
1308
  if (jn.some((function(i) {
@@ -1261,35 +1317,35 @@ function Vo() {
1261
1317
  for (var r in e) n(r);
1262
1318
  return t;
1263
1319
  }
1264
- function nt(t, e) {
1320
+ function rt(t, e) {
1265
1321
  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;
1266
1322
  }
1267
- function Bt(t) {
1323
+ function qt(t) {
1268
1324
  t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
1269
1325
  }
1270
- function qt(t) {
1326
+ function Wt(t) {
1271
1327
  return t instanceof Y.Event || t instanceof Y.Touch;
1272
1328
  }
1273
- function rt(t, e, n) {
1329
+ function ot(t, e, n) {
1274
1330
  return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
1275
1331
  }
1276
- function Wt(t, e) {
1277
- return e = e || { x: 0, y: 0 }, ee.isOperaMobile && qt(t) ? (rt("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : rt("page", t, e), e;
1332
+ function Yt(t, e) {
1333
+ return e = e || { x: 0, y: 0 }, te.isOperaMobile && Wt(t) ? (ot("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : ot("page", t, e), e;
1278
1334
  }
1279
1335
  function je(t) {
1280
1336
  return b.number(t.pointerId) ? t.pointerId : t.identifier;
1281
1337
  }
1282
1338
  function Hn(t, e, n) {
1283
- var r = e.length > 1 ? Yt(e) : e[0];
1284
- Wt(r, t.page), (function(o, i) {
1285
- i = i || {}, ee.isOperaMobile && qt(o) ? rt("screen", o, i) : rt("client", o, i);
1339
+ var r = e.length > 1 ? $t(e) : e[0];
1340
+ Yt(r, t.page), (function(o, i) {
1341
+ i = i || {}, te.isOperaMobile && Wt(o) ? ot("screen", o, i) : ot("client", o, i);
1286
1342
  })(r, t.client), t.timeStamp = n;
1287
1343
  }
1288
- function mt(t) {
1344
+ function gt(t) {
1289
1345
  var e = [];
1290
1346
  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;
1291
1347
  }
1292
- function Yt(t) {
1348
+ function $t(t) {
1293
1349
  for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n = 0; n < t.length; n++) {
1294
1350
  var r = t[n];
1295
1351
  for (var o in e) e[o] += r[o];
@@ -1297,27 +1353,27 @@ function Vo() {
1297
1353
  for (var i in e) e[i] /= t.length;
1298
1354
  return e;
1299
1355
  }
1300
- function gt(t) {
1356
+ function yt(t) {
1301
1357
  if (!t.length) return null;
1302
- var e = mt(t), n = Math.min(e[0].pageX, e[1].pageX), r = Math.min(e[0].pageY, e[1].pageY), o = Math.max(e[0].pageX, e[1].pageX), i = Math.max(e[0].pageY, e[1].pageY);
1358
+ var e = gt(t), n = Math.min(e[0].pageX, e[1].pageX), r = Math.min(e[0].pageY, e[1].pageY), o = Math.max(e[0].pageX, e[1].pageX), i = Math.max(e[0].pageY, e[1].pageY);
1303
1359
  return { x: n, y: r, left: n, top: r, right: o, bottom: i, width: o - n, height: i - r };
1304
1360
  }
1305
- function yt(t, e) {
1306
- var n = e + "X", r = e + "Y", o = mt(t), i = o[0][n] - o[1][n], a = o[0][r] - o[1][r];
1361
+ function bt(t, e) {
1362
+ var n = e + "X", r = e + "Y", o = gt(t), i = o[0][n] - o[1][n], a = o[0][r] - o[1][r];
1307
1363
  return Fe(i, a);
1308
1364
  }
1309
- function bt(t, e) {
1310
- var n = e + "X", r = e + "Y", o = mt(t), i = o[1][n] - o[0][n], a = o[1][r] - o[0][r];
1365
+ function xt(t, e) {
1366
+ var n = e + "X", r = e + "Y", o = gt(t), i = o[1][n] - o[0][n], a = o[1][r] - o[0][r];
1311
1367
  return 180 * Math.atan2(a, i) / Math.PI;
1312
1368
  }
1313
- function $t(t) {
1369
+ function Vt(t) {
1314
1370
  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 Y.Touch ? "touch" : "mouse";
1315
1371
  }
1316
- function Vt(t) {
1372
+ function Ut(t) {
1317
1373
  var e = b.func(t.composedPath) ? t.composedPath() : t.path;
1318
1374
  return [$(e ? e[0] : t.target), $(t.currentTarget)];
1319
1375
  }
1320
- var ot = (function() {
1376
+ var it = (function() {
1321
1377
  function t(e) {
1322
1378
  g(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
1323
1379
  }
@@ -1328,26 +1384,26 @@ function Vo() {
1328
1384
  this.immediatePropagationStopped = this.propagationStopped = !0;
1329
1385
  } }]), t;
1330
1386
  })();
1331
- Object.defineProperty(ot.prototype, "interaction", { get: function() {
1387
+ Object.defineProperty(it.prototype, "interaction", { get: function() {
1332
1388
  return this._interaction._proxy;
1333
1389
  }, set: function() {
1334
1390
  } });
1335
- var Ut = function(t, e) {
1391
+ var Xt = function(t, e) {
1336
1392
  for (var n = 0; n < e.length; n++) {
1337
1393
  var r = e[n];
1338
1394
  t.push(r);
1339
1395
  }
1340
1396
  return t;
1341
- }, Xt = function(t) {
1342
- return Ut([], t);
1397
+ }, Gt = function(t) {
1398
+ return Xt([], t);
1343
1399
  }, He = function(t, e) {
1344
1400
  for (var n = 0; n < t.length; n++) if (e(t[n], n, t)) return n;
1345
1401
  return -1;
1346
1402
  }, Be = function(t, e) {
1347
1403
  return t[He(t, e)];
1348
- }, Oe = (function(t) {
1349
- _(n, t);
1350
- var e = A(n);
1404
+ }, De = (function(t) {
1405
+ S(n, t);
1406
+ var e = P(n);
1351
1407
  function n(r, o, i) {
1352
1408
  var a;
1353
1409
  g(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;
@@ -1371,22 +1427,22 @@ function Vo() {
1371
1427
  } }, { key: "stopImmediatePropagation", value: function() {
1372
1428
  this.immediatePropagationStopped = this.propagationStopped = !0;
1373
1429
  } }]), n;
1374
- })(ot);
1375
- function Gt(t, e) {
1430
+ })(it);
1431
+ function Kt(t, e) {
1376
1432
  for (var n = 0, r = t.slice(); n < r.length; n++) {
1377
1433
  var o = r[n], i = o.dropzone, a = o.element;
1378
1434
  e.dropzone = i, e.target = a, i.fire(e), e.propagationStopped = e.immediatePropagationStopped = !1;
1379
1435
  }
1380
1436
  }
1381
- function xt(t, e) {
1437
+ function wt(t, e) {
1382
1438
  for (var n = (function(i, a) {
1383
1439
  for (var s = [], l = 0, d = i.interactables.list; l < d.length; l++) {
1384
1440
  var c = d[l];
1385
1441
  if (c.options.drop.enabled) {
1386
1442
  var f = c.options.drop.accept;
1387
- if (!(b.element(f) && f !== a || b.string(f) && !he(a, f) || b.func(f) && !f({ dropzone: c, draggableElement: a }))) for (var y = 0, S = c.getAllElements(); y < S.length; y++) {
1388
- var k = S[y];
1389
- k !== a && s.push({ dropzone: c, element: k, rect: c.getRect(k) });
1443
+ if (!(b.element(f) && f !== a || b.string(f) && !he(a, f) || b.func(f) && !f({ dropzone: c, draggableElement: a }))) for (var y = 0, T = c.getAllElements(); y < T.length; y++) {
1444
+ var C = T[y];
1445
+ C !== a && s.push({ dropzone: c, element: C, rect: c.getRect(C) });
1390
1446
  }
1391
1447
  }
1392
1448
  }
@@ -1397,65 +1453,65 @@ function Vo() {
1397
1453
  }
1398
1454
  return n;
1399
1455
  }
1400
- function Kt(t, e, n) {
1456
+ function Jt(t, e, n) {
1401
1457
  for (var r = t.dropState, o = t.interactable, i = t.element, a = [], s = 0, l = r.activeDrops; s < l.length; s++) {
1402
- var d = l[s], c = d.dropzone, f = d.element, y = d.rect, S = c.dropCheck(e, n, o, i, f, y);
1403
- a.push(S ? f : null);
1404
- }
1405
- var k = (function(T) {
1406
- for (var I, R, O, W = [], K = 0; K < T.length; K++) {
1407
- var L = T[K], V = T[I];
1408
- if (L && K !== I) if (V) {
1409
- var me = w(L), ae = w(V);
1458
+ var d = l[s], c = d.dropzone, f = d.element, y = d.rect, T = c.dropCheck(e, n, o, i, f, y);
1459
+ a.push(T ? f : null);
1460
+ }
1461
+ var C = (function(M) {
1462
+ for (var I, R, D, q = [], Q = 0; Q < M.length; Q++) {
1463
+ var L = M[Q], V = M[I];
1464
+ if (L && Q !== I) if (V) {
1465
+ var me = E(L), ae = E(V);
1410
1466
  if (me !== L.ownerDocument) if (ae !== L.ownerDocument) if (me !== ae) {
1411
- W = W.length ? W : z(V);
1467
+ q = q.length ? q : z(V);
1412
1468
  var ge = void 0;
1413
1469
  if (V instanceof Y.HTMLElement && L instanceof Y.SVGElement && !(L instanceof Y.SVGSVGElement)) {
1414
1470
  if (L === ae) continue;
1415
1471
  ge = L.ownerSVGElement;
1416
1472
  } else ge = L;
1417
- for (var be = z(ge, V.ownerDocument), Se = 0; be[Se] && be[Se] === W[Se]; ) Se++;
1418
- var ft = [be[Se - 1], be[Se], W[Se]];
1419
- if (ft[0]) for (var Ue = ft[0].lastChild; Ue; ) {
1420
- if (Ue === ft[1]) {
1421
- I = K, W = be;
1473
+ for (var be = z(ge, V.ownerDocument), Se = 0; be[Se] && be[Se] === q[Se]; ) Se++;
1474
+ var ht = [be[Se - 1], be[Se], q[Se]];
1475
+ if (ht[0]) for (var Ue = ht[0].lastChild; Ue; ) {
1476
+ if (Ue === ht[1]) {
1477
+ I = Q, q = be;
1422
1478
  break;
1423
1479
  }
1424
- if (Ue === ft[2]) break;
1480
+ if (Ue === ht[2]) break;
1425
1481
  Ue = Ue.previousSibling;
1426
1482
  }
1427
- } else O = V, (parseInt(te(R = L).getComputedStyle(R).zIndex, 10) || 0) >= (parseInt(te(O).getComputedStyle(O).zIndex, 10) || 0) && (I = K);
1428
- else I = K;
1429
- } else I = K;
1483
+ } else D = V, (parseInt(ne(R = L).getComputedStyle(R).zIndex, 10) || 0) >= (parseInt(ne(D).getComputedStyle(D).zIndex, 10) || 0) && (I = Q);
1484
+ else I = Q;
1485
+ } else I = Q;
1430
1486
  }
1431
1487
  return I;
1432
1488
  })(a);
1433
- return r.activeDrops[k] || null;
1489
+ return r.activeDrops[C] || null;
1434
1490
  }
1435
- function wt(t, e, n) {
1491
+ function Et(t, e, n) {
1436
1492
  var r = t.dropState, o = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
1437
- 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;
1493
+ return n.type === "dragstart" && (o.activate = new De(r, n, "dropactivate"), o.activate.target = null, o.activate.dropzone = null), n.type === "dragend" && (o.deactivate = new De(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 De(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 De(r, n, "dragenter"), n.dragEnter = r.cur.element, n.dropzone = r.cur.dropzone)), n.type === "dragend" && r.cur.dropzone && (o.drop = new De(r, n, "drop"), n.dropzone = r.cur.dropzone, n.relatedTarget = r.cur.element), n.type === "dragmove" && r.cur.dropzone && (o.move = new De(r, n, "dropmove"), n.dropzone = r.cur.dropzone)), o;
1438
1494
  }
1439
- function Et(t, e) {
1495
+ function kt(t, e) {
1440
1496
  var n = t.dropState, r = n.activeDrops, o = n.cur, i = n.prev;
1441
- e.leave && i.dropzone.fire(e.leave), e.enter && o.dropzone.fire(e.enter), e.move && o.dropzone.fire(e.move), e.drop && o.dropzone.fire(e.drop), e.deactivate && Gt(r, e.deactivate), n.prev.dropzone = o.dropzone, n.prev.element = o.element;
1497
+ e.leave && i.dropzone.fire(e.leave), e.enter && o.dropzone.fire(e.enter), e.move && o.dropzone.fire(e.move), e.drop && o.dropzone.fire(e.drop), e.deactivate && Kt(r, e.deactivate), n.prev.dropzone = o.dropzone, n.prev.element = o.element;
1442
1498
  }
1443
- function Jt(t, e) {
1499
+ function Qt(t, e) {
1444
1500
  var n = t.interaction, r = t.iEvent, o = t.event;
1445
1501
  if (r.type === "dragmove" || r.type === "dragend") {
1446
1502
  var i = n.dropState;
1447
- e.dynamicDrop && (i.activeDrops = xt(e, n.element));
1448
- var a = r, s = Kt(n, a, o);
1449
- i.rejected = i.rejected && !!s && s.dropzone === i.cur.dropzone && s.element === i.cur.element, i.cur.dropzone = s && s.dropzone, i.cur.element = s && s.element, i.events = wt(n, 0, a);
1503
+ e.dynamicDrop && (i.activeDrops = wt(e, n.element));
1504
+ var a = r, s = Jt(n, a, o);
1505
+ i.rejected = i.rejected && !!s && s.dropzone === i.cur.dropzone && s.element === i.cur.element, i.cur.dropzone = s && s.dropzone, i.cur.element = s && s.element, i.events = Et(n, 0, a);
1450
1506
  }
1451
1507
  }
1452
- var Qt = { id: "actions/drop", install: function(t) {
1508
+ var Zt = { id: "actions/drop", install: function(t) {
1453
1509
  var e = t.actions, n = t.interactStatic, r = t.Interactable, o = t.defaults;
1454
1510
  t.usePlugin(ce), r.prototype.dropzone = function(i) {
1455
1511
  return (function(a, s) {
1456
1512
  if (b.object(s)) {
1457
1513
  if (a.options.drop.enabled = s.enabled !== !1, s.listeners) {
1458
- var l = Ae(s.listeners), d = Object.keys(l).reduce((function(f, y) {
1514
+ var l = Ie(s.listeners), d = Object.keys(l).reduce((function(f, y) {
1459
1515
  return f[/^(enter|leave)/.test(y) ? "drag".concat(y) : /^(activate|deactivate|move)/.test(y) ? "drop".concat(y) : y] = l[y], f;
1460
1516
  }), {}), c = a.options.drop.listeners;
1461
1517
  c && a.off(c), a.on(d), a.options.drop.listeners = d;
@@ -1465,26 +1521,26 @@ function Vo() {
1465
1521
  return b.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
1466
1522
  })(this, i);
1467
1523
  }, r.prototype.dropCheck = function(i, a, s, l, d, c) {
1468
- return (function(f, y, S, k, T, I, R) {
1469
- var O = !1;
1470
- if (!(R = R || f.getRect(I))) return !!f.options.drop.checker && f.options.drop.checker(y, S, O, f, I, k, T);
1471
- var W = f.options.drop.overlap;
1472
- if (W === "pointer") {
1473
- var K = Le(k, T, "drag"), L = Wt(y);
1474
- L.x += K.x, L.y += K.y;
1524
+ return (function(f, y, T, C, M, I, R) {
1525
+ var D = !1;
1526
+ if (!(R = R || f.getRect(I))) return !!f.options.drop.checker && f.options.drop.checker(y, T, D, f, I, C, M);
1527
+ var q = f.options.drop.overlap;
1528
+ if (q === "pointer") {
1529
+ var Q = Le(C, M, "drag"), L = Yt(y);
1530
+ L.x += Q.x, L.y += Q.y;
1475
1531
  var V = L.x > R.left && L.x < R.right, me = L.y > R.top && L.y < R.bottom;
1476
- O = V && me;
1532
+ D = V && me;
1477
1533
  }
1478
- var ae = k.getRect(T);
1479
- if (ae && W === "center") {
1534
+ var ae = C.getRect(M);
1535
+ if (ae && q === "center") {
1480
1536
  var ge = ae.left + ae.width / 2, be = ae.top + ae.height / 2;
1481
- O = ge >= R.left && ge <= R.right && be >= R.top && be <= R.bottom;
1537
+ D = ge >= R.left && ge <= R.right && be >= R.top && be <= R.bottom;
1482
1538
  }
1483
- return ae && b.number(W) && (O = Math.max(0, Math.min(R.right, ae.right) - Math.max(R.left, ae.left)) * Math.max(0, Math.min(R.bottom, ae.bottom) - Math.max(R.top, ae.top)) / (ae.width * ae.height) >= W), f.options.drop.checker && (O = f.options.drop.checker(y, S, O, f, I, k, T)), O;
1539
+ return ae && b.number(q) && (D = Math.max(0, Math.min(R.right, ae.right) - Math.max(R.left, ae.left)) * Math.max(0, Math.min(R.bottom, ae.bottom) - Math.max(R.top, ae.top)) / (ae.width * ae.height) >= q), f.options.drop.checker && (D = f.options.drop.checker(y, T, D, f, I, C, M)), D;
1484
1540
  })(this, i, a, s, l, d, c);
1485
1541
  }, n.dynamicDrop = function(i) {
1486
1542
  return b.bool(i) ? (t.dynamicDrop = i, n) : t.dynamicDrop;
1487
- }, P(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, o.actions.drop = Qt.defaults;
1543
+ }, O(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;
1488
1544
  }, listeners: { "interactions:before-action-start": function(t) {
1489
1545
  var e = t.interaction;
1490
1546
  e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
@@ -1492,18 +1548,18 @@ function Vo() {
1492
1548
  var n = t.interaction, r = (t.event, t.iEvent);
1493
1549
  if (n.prepared.name === "drag") {
1494
1550
  var o = n.dropState;
1495
- o.activeDrops = [], o.events = {}, o.activeDrops = xt(e, n.element), o.events = wt(n, 0, r), o.events.activate && (Gt(o.activeDrops, o.events.activate), e.fire("actions/drop:start", { interaction: n, dragEvent: r }));
1551
+ o.activeDrops = [], o.events = {}, o.activeDrops = wt(e, n.element), o.events = Et(n, 0, r), o.events.activate && (Kt(o.activeDrops, o.events.activate), e.fire("actions/drop:start", { interaction: n, dragEvent: r }));
1496
1552
  }
1497
- }, "interactions:action-move": Jt, "interactions:after-action-move": function(t, e) {
1553
+ }, "interactions:action-move": Qt, "interactions:after-action-move": function(t, e) {
1498
1554
  var n = t.interaction, r = t.iEvent;
1499
1555
  if (n.prepared.name === "drag") {
1500
1556
  var o = n.dropState;
1501
- Et(n, o.events), e.fire("actions/drop:move", { interaction: n, dragEvent: r }), o.events = {};
1557
+ kt(n, o.events), e.fire("actions/drop:move", { interaction: n, dragEvent: r }), o.events = {};
1502
1558
  }
1503
1559
  }, "interactions:action-end": function(t, e) {
1504
1560
  if (t.interaction.prepared.name === "drag") {
1505
1561
  var n = t.interaction, r = t.iEvent;
1506
- Jt(t, e), Et(n, n.dropState.events), e.fire("actions/drop:end", { interaction: n, dragEvent: r });
1562
+ Qt(t, e), kt(n, n.dropState.events), e.fire("actions/drop:end", { interaction: n, dragEvent: r });
1507
1563
  }
1508
1564
  }, "interactions:stop": function(t) {
1509
1565
  var e = t.interaction;
@@ -1511,29 +1567,29 @@ function Vo() {
1511
1567
  var n = e.dropState;
1512
1568
  n && (n.activeDrops = null, n.events = null, n.cur.dropzone = null, n.cur.element = null, n.prev.dropzone = null, n.prev.element = null, n.rejected = !1);
1513
1569
  }
1514
- } }, getActiveDrops: xt, getDrop: Kt, getDropEvents: wt, fireDropEvents: Et, filterEventType: function(t) {
1570
+ } }, getActiveDrops: wt, getDrop: Jt, getDropEvents: Et, fireDropEvents: kt, filterEventType: function(t) {
1515
1571
  return t.search("drag") === 0 || t.search("drop") === 0;
1516
- }, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Bn = Qt;
1517
- function kt(t) {
1572
+ }, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Bn = Zt;
1573
+ function Ct(t) {
1518
1574
  var e = t.interaction, n = t.iEvent, r = t.phase;
1519
1575
  if (e.prepared.name === "gesture") {
1520
1576
  var o = e.pointers.map((function(d) {
1521
1577
  return d.pointer;
1522
1578
  })), i = r === "start", a = r === "end", s = e.interactable.options.deltaSource;
1523
- if (n.touches = [o[0], o[1]], i) n.distance = yt(o, s), n.box = gt(o), n.scale = 1, n.ds = 0, n.angle = bt(o, s), n.da = 0, e.gesture.startDistance = n.distance, e.gesture.startAngle = n.angle;
1579
+ if (n.touches = [o[0], o[1]], i) n.distance = bt(o, s), n.box = yt(o), n.scale = 1, n.ds = 0, n.angle = xt(o, s), n.da = 0, e.gesture.startDistance = n.distance, e.gesture.startAngle = n.angle;
1524
1580
  else if (a || e.pointers.length < 2) {
1525
1581
  var l = e.prevEvent;
1526
1582
  n.distance = l.distance, n.box = l.box, n.scale = l.scale, n.ds = 0, n.angle = l.angle, n.da = 0;
1527
- } else n.distance = yt(o, s), n.box = gt(o), n.scale = n.distance / e.gesture.startDistance, n.angle = bt(o, s), n.ds = n.scale - e.gesture.scale, n.da = n.angle - e.gesture.angle;
1583
+ } else n.distance = bt(o, s), n.box = yt(o), n.scale = n.distance / e.gesture.startDistance, n.angle = xt(o, s), n.ds = n.scale - e.gesture.scale, n.da = n.angle - e.gesture.angle;
1528
1584
  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);
1529
1585
  }
1530
1586
  }
1531
- var Ct = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
1587
+ var St = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
1532
1588
  var e = t.actions, n = t.Interactable, r = t.defaults;
1533
1589
  n.prototype.gesturable = function(o) {
1534
1590
  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;
1535
- }, e.map.gesture = Ct, e.methodDict.gesture = "gesturable", r.actions.gesture = Ct.defaults;
1536
- }, listeners: { "interactions:action-start": kt, "interactions:action-move": kt, "interactions:action-end": kt, "interactions:new": function(t) {
1591
+ }, e.map.gesture = St, e.methodDict.gesture = "gesturable", r.actions.gesture = St.defaults;
1592
+ }, listeners: { "interactions:action-start": Ct, "interactions:action-move": Ct, "interactions:action-end": Ct, "interactions:new": function(t) {
1537
1593
  t.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
1538
1594
  }, "auto-start:check": function(t) {
1539
1595
  if (!(t.interaction.pointers.length < 2)) {
@@ -1544,7 +1600,7 @@ function Vo() {
1544
1600
  return "";
1545
1601
  }, filterEventType: function(t) {
1546
1602
  return t.search("gesture") === 0;
1547
- } }, qn = Ct;
1603
+ } }, qn = St;
1548
1604
  function Wn(t, e, n, r, o, i, a) {
1549
1605
  if (!e) return !1;
1550
1606
  if (e === !0) {
@@ -1562,14 +1618,14 @@ function Vo() {
1562
1618
  }
1563
1619
  return !!b.element(r) && (b.element(e) ? e === r : j(r, e, o));
1564
1620
  }
1565
- function Zt(t) {
1621
+ function en(t) {
1566
1622
  var e = t.iEvent, n = t.interaction;
1567
1623
  if (n.prepared.name === "resize" && n.resizeAxes) {
1568
1624
  var r = e;
1569
1625
  n.interactable.options.resize.square ? (n.resizeAxes === "y" ? r.delta.x = r.delta.y : r.delta.y = r.delta.x, r.axes = "xy") : (r.axes = n.resizeAxes, n.resizeAxes === "x" ? r.delta.y = 0 : n.resizeAxes === "y" && (r.delta.x = 0));
1570
1626
  }
1571
1627
  }
1572
- var ke, Ie, Ce = { id: "actions/resize", before: ["actions/drag"], install: function(t) {
1628
+ var ke, Pe, Ce = { id: "actions/resize", before: ["actions/drag"], install: function(t) {
1573
1629
  var e = t.actions, n = t.browser, r = t.Interactable, o = t.defaults;
1574
1630
  Ce.cursors = (function(i) {
1575
1631
  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" };
@@ -1585,30 +1641,30 @@ function Vo() {
1585
1641
  var n = e.iEvent, r = e.interaction;
1586
1642
  if (r.prepared.name === "resize" && r.prepared.edges) {
1587
1643
  var o = n, i = r.rect;
1588
- r._rects = { start: P({}, i), corrected: P({}, i), previous: P({}, i), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, o.edges = r.prepared.edges, o.rect = r._rects.corrected, o.deltaRect = r._rects.delta;
1644
+ r._rects = { start: O({}, i), corrected: O({}, i), previous: O({}, i), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, o.edges = r.prepared.edges, o.rect = r._rects.corrected, o.deltaRect = r._rects.delta;
1589
1645
  }
1590
- })(t), Zt(t);
1646
+ })(t), en(t);
1591
1647
  }, "interactions:action-move": function(t) {
1592
1648
  (function(e) {
1593
1649
  var n = e.iEvent, r = e.interaction;
1594
1650
  if (r.prepared.name === "resize" && r.prepared.edges) {
1595
1651
  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, y = l.previous;
1596
- if (P(y, c), a) {
1597
- if (P(c, s), i === "reposition") {
1652
+ if (O(y, c), a) {
1653
+ if (O(c, s), i === "reposition") {
1598
1654
  if (c.top > c.bottom) {
1599
- var S = c.top;
1600
- c.top = c.bottom, c.bottom = S;
1655
+ var T = c.top;
1656
+ c.top = c.bottom, c.bottom = T;
1601
1657
  }
1602
1658
  if (c.left > c.right) {
1603
- var k = c.left;
1604
- c.left = c.right, c.right = k;
1659
+ var C = c.left;
1660
+ c.left = c.right, c.right = C;
1605
1661
  }
1606
1662
  }
1607
1663
  } 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);
1608
- for (var T in c.width = c.right - c.left, c.height = c.bottom - c.top, c) f[T] = c[T] - y[T];
1664
+ for (var M in c.width = c.right - c.left, c.height = c.bottom - c.top, c) f[M] = c[M] - y[M];
1609
1665
  o.edges = r.prepared.edges, o.rect = c, o.deltaRect = f;
1610
1666
  }
1611
- })(t), Zt(t);
1667
+ })(t), en(t);
1612
1668
  }, "interactions:action-end": function(t) {
1613
1669
  var e = t.iEvent, n = t.interaction;
1614
1670
  if (n.prepared.name === "resize" && n.prepared.edges) {
@@ -1618,7 +1674,7 @@ function Vo() {
1618
1674
  }, "auto-start:check": function(t) {
1619
1675
  var e = t.interaction, n = t.interactable, r = t.element, o = t.rect, i = t.buttons;
1620
1676
  if (o) {
1621
- var a = P({}, e.coords.cur.page), s = n.options.resize;
1677
+ var a = O({}, e.coords.cur.page), s = n.options.resize;
1622
1678
  if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (i & s.mouseButtons) != 0)) {
1623
1679
  if (b.object(s.edges)) {
1624
1680
  var l = { left: !1, right: !1, top: !1, bottom: !1 };
@@ -1646,21 +1702,21 @@ function Vo() {
1646
1702
  return t.search("resize") === 0;
1647
1703
  }, defaultMargin: null }, Yn = Ce, $n = { id: "actions", install: function(t) {
1648
1704
  t.usePlugin(qn), t.usePlugin(Yn), t.usePlugin(ce), t.usePlugin(Bn);
1649
- } }, en = 0, Te = { request: function(t) {
1705
+ } }, tn = 0, Te = { request: function(t) {
1650
1706
  return ke(t);
1651
1707
  }, cancel: function(t) {
1652
- return Ie(t);
1708
+ return Pe(t);
1653
1709
  }, init: function(t) {
1654
- if (ke = t.requestAnimationFrame, Ie = t.cancelAnimationFrame, !ke) for (var e = ["ms", "moz", "webkit", "o"], n = 0; n < e.length; n++) {
1710
+ if (ke = t.requestAnimationFrame, Pe = t.cancelAnimationFrame, !ke) for (var e = ["ms", "moz", "webkit", "o"], n = 0; n < e.length; n++) {
1655
1711
  var r = e[n];
1656
- ke = t["".concat(r, "RequestAnimationFrame")], Ie = t["".concat(r, "CancelAnimationFrame")] || t["".concat(r, "CancelRequestAnimationFrame")];
1712
+ ke = t["".concat(r, "RequestAnimationFrame")], Pe = t["".concat(r, "CancelAnimationFrame")] || t["".concat(r, "CancelRequestAnimationFrame")];
1657
1713
  }
1658
- ke = ke && ke.bind(t), Ie = Ie && Ie.bind(t), ke || (ke = function(o) {
1659
- var i = Date.now(), a = Math.max(0, 16 - (i - en)), s = t.setTimeout((function() {
1714
+ ke = ke && ke.bind(t), Pe = Pe && Pe.bind(t), ke || (ke = function(o) {
1715
+ var i = Date.now(), a = Math.max(0, 16 - (i - tn)), s = t.setTimeout((function() {
1660
1716
  o(i + a);
1661
1717
  }), a);
1662
- return en = i + a, s;
1663
- }, Ie = function(o) {
1718
+ return tn = i + a, s;
1719
+ }, Pe = function(o) {
1664
1720
  return clearTimeout(o);
1665
1721
  });
1666
1722
  } }, H = { 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) {
@@ -1668,13 +1724,13 @@ function Vo() {
1668
1724
  }, stop: function() {
1669
1725
  H.isScrolling = !1, H.interaction && (H.interaction.autoScroll = null), Te.cancel(H.i);
1670
1726
  }, scroll: function() {
1671
- var t = H.interaction, e = t.interactable, n = t.element, r = t.prepared.name, o = e.options[r].autoScroll, i = tn(o.container, e, n), a = H.now(), s = (a - H.prevTime) / 1e3, l = o.speed * s;
1727
+ var t = H.interaction, e = t.interactable, n = t.element, r = t.prepared.name, o = e.options[r].autoScroll, i = nn(o.container, e, n), a = H.now(), s = (a - H.prevTime) / 1e3, l = o.speed * s;
1672
1728
  if (l >= 1) {
1673
1729
  var d = { x: H.x * l, y: H.y * l };
1674
1730
  if (d.x || d.y) {
1675
- var c = nn(i);
1731
+ var c = rn(i);
1676
1732
  b.window(i) ? i.scrollBy(d.x, d.y) : i && (i.scrollLeft += d.x, i.scrollTop += d.y);
1677
- var f = nn(i), y = { x: f.x - c.x, y: f.y - c.y };
1733
+ var f = rn(i), y = { x: f.x - c.x, y: f.y - c.y };
1678
1734
  (y.x || y.y) && e.fire({ type: "autoscroll", target: n, interactable: e, delta: y, interaction: t, container: i });
1679
1735
  }
1680
1736
  H.prevTime = a;
@@ -1687,7 +1743,7 @@ function Vo() {
1687
1743
  var e = t.interaction, n = t.pointer;
1688
1744
  if (e.interacting() && H.check(e.interactable, e.prepared.name)) if (e.simulation) H.x = H.y = 0;
1689
1745
  else {
1690
- var r, o, i, a, s = e.interactable, l = e.element, d = e.prepared.name, c = s.options[d].autoScroll, f = tn(c.container, s, l);
1746
+ 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);
1691
1747
  if (b.window(f)) a = n.clientX < H.margin, r = n.clientY < H.margin, o = n.clientX > f.innerWidth - H.margin, i = n.clientY > f.innerHeight - H.margin;
1692
1748
  else {
1693
1749
  var y = xe(f);
@@ -1696,10 +1752,10 @@ function Vo() {
1696
1752
  H.x = o ? 1 : a ? -1 : 0, H.y = i ? 1 : r ? -1 : 0, H.isScrolling || (H.margin = c.margin, H.speed = c.speed, H.start(e));
1697
1753
  }
1698
1754
  } };
1699
- function tn(t, e, n) {
1700
- return (b.string(t) ? Qe(t, e, n) : t) || te(n);
1755
+ function nn(t, e, n) {
1756
+ return (b.string(t) ? Ze(t, e, n) : t) || ne(n);
1701
1757
  }
1702
- function nn(t) {
1758
+ function rn(t) {
1703
1759
  return b.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
1704
1760
  }
1705
1761
  var Vn = { id: "auto-scroll", install: function(t) {
@@ -1717,10 +1773,10 @@ function Vo() {
1717
1773
  function qe(t, e) {
1718
1774
  var n = !1;
1719
1775
  return function() {
1720
- return n || (J.console.warn(e), n = !0), t.apply(this, arguments);
1776
+ return n || (U.console.warn(e), n = !0), t.apply(this, arguments);
1721
1777
  };
1722
1778
  }
1723
- function St(t, e) {
1779
+ function Tt(t, e) {
1724
1780
  return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t;
1725
1781
  }
1726
1782
  function Xn(t) {
@@ -1733,8 +1789,8 @@ function Vo() {
1733
1789
  var e = t.Interactable;
1734
1790
  e.prototype.getAction = function(n, r, o, i) {
1735
1791
  var a = (function(s, l, d, c, f) {
1736
- var y = s.getRect(c), S = l.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[l.button], k = { action: null, interactable: s, interaction: d, element: c, rect: y, buttons: S };
1737
- return f.fire("auto-start:check", k), k.action;
1792
+ var y = s.getRect(c), T = l.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[l.button], C = { action: null, interactable: s, interaction: d, element: c, rect: y, buttons: T };
1793
+ return f.fire("auto-start:check", C), C.action;
1738
1794
  })(this, r, o, i, t);
1739
1795
  return this.options.actionChecker ? this.options.actionChecker(n, r, a, this, i, o) : a;
1740
1796
  }, e.prototype.ignoreFrom = qe((function(n) {
@@ -1743,20 +1799,20 @@ function Vo() {
1743
1799
  return this._backCompatOption("allowFrom", n);
1744
1800
  }), "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e.prototype.actionChecker = Gn, e.prototype.styleCursor = Xn;
1745
1801
  } };
1746
- function rn(t, e, n, r, o) {
1747
- return e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled && it(e, n, t, o) ? t : null;
1802
+ function on(t, e, n, r, o) {
1803
+ return e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled && at(e, n, t, o) ? t : null;
1748
1804
  }
1749
1805
  function Jn(t, e, n, r, o, i, a) {
1750
1806
  for (var s = 0, l = r.length; s < l; s++) {
1751
1807
  var d = r[s], c = o[s], f = d.getAction(e, n, t, c);
1752
1808
  if (f) {
1753
- var y = rn(f, d, c, i, a);
1809
+ var y = on(f, d, c, i, a);
1754
1810
  if (y) return { action: y, interactable: d, element: c };
1755
1811
  }
1756
1812
  }
1757
1813
  return { action: null, interactable: null, element: null };
1758
1814
  }
1759
- function on(t, e, n, r, o) {
1815
+ function an(t, e, n, r, o) {
1760
1816
  var i = [], a = [], s = r;
1761
1817
  function l(c) {
1762
1818
  i.push(c), a.push(s);
@@ -1769,28 +1825,28 @@ function Vo() {
1769
1825
  }
1770
1826
  return { action: null, interactable: null, element: null };
1771
1827
  }
1772
- function an(t, e, n) {
1828
+ function sn(t, e, n) {
1773
1829
  var r = e.action, o = e.interactable, i = e.element;
1774
- r = r || { name: null }, t.interactable = o, t.element = i, St(t.prepared, r), t.rect = o && r.name ? o.getRect(i) : null, ln(t, n), n.fire("autoStart:prepared", { interaction: t });
1830
+ r = r || { name: null }, t.interactable = o, t.element = i, Tt(t.prepared, r), t.rect = o && r.name ? o.getRect(i) : null, cn(t, n), n.fire("autoStart:prepared", { interaction: t });
1775
1831
  }
1776
- function it(t, e, n, r) {
1832
+ function at(t, e, n, r) {
1777
1833
  var o = t.options, i = o[n.name].max, a = o[n.name].maxPerElement, s = r.autoStart.maxInteractions, l = 0, d = 0, c = 0;
1778
1834
  if (!(i && a && s)) return !1;
1779
1835
  for (var f = 0, y = r.interactions.list; f < y.length; f++) {
1780
- var S = y[f], k = S.prepared.name;
1781
- if (S.interacting() && (++l >= s || S.interactable === t && ((d += k === n.name ? 1 : 0) >= i || S.element === e && (c++, k === n.name && c >= a))))
1836
+ var T = y[f], C = T.prepared.name;
1837
+ if (T.interacting() && (++l >= s || T.interactable === t && ((d += C === n.name ? 1 : 0) >= i || T.element === e && (c++, C === n.name && c >= a))))
1782
1838
  return !1;
1783
1839
  }
1784
1840
  return s > 0;
1785
1841
  }
1786
- function sn(t, e) {
1842
+ function ln(t, e) {
1787
1843
  return b.number(t) ? (e.autoStart.maxInteractions = t, this) : e.autoStart.maxInteractions;
1788
1844
  }
1789
- function Tt(t, e, n) {
1845
+ function _t(t, e, n) {
1790
1846
  var r = n.autoStart.cursorElement;
1791
1847
  r && r !== t && (r.style.cursor = ""), t.ownerDocument.documentElement.style.cursor = e, t.style.cursor = e, n.autoStart.cursorElement = e ? t : null;
1792
1848
  }
1793
- function ln(t, e) {
1849
+ function cn(t, e) {
1794
1850
  var n = t.interactable, r = t.element, o = t.prepared;
1795
1851
  if (t.pointerType === "mouse" && n && n.options.styleCursor) {
1796
1852
  var i = "";
@@ -1798,54 +1854,54 @@ function Vo() {
1798
1854
  var a = n.options[o.name].cursorChecker;
1799
1855
  i = b.func(a) ? a(o, n, r, t._interacting) : e.actions.map[o.name].getCursor(o);
1800
1856
  }
1801
- Tt(t.element, i || "", e);
1802
- } else e.autoStart.cursorElement && Tt(e.autoStart.cursorElement, "", e);
1857
+ _t(t.element, i || "", e);
1858
+ } else e.autoStart.cursorElement && _t(e.autoStart.cursorElement, "", e);
1803
1859
  }
1804
1860
  var Qn = { id: "auto-start/base", before: ["actions"], install: function(t) {
1805
1861
  var e = t.interactStatic, n = t.defaults;
1806
- t.usePlugin(Kn), n.base.actionChecker = null, n.base.styleCursor = !0, P(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
1807
- return sn(r, t);
1808
- }, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: it, cursorElement: null };
1862
+ t.usePlugin(Kn), n.base.actionChecker = null, n.base.styleCursor = !0, O(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
1863
+ return ln(r, t);
1864
+ }, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: at, cursorElement: null };
1809
1865
  }, listeners: { "interactions:down": function(t, e) {
1810
1866
  var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget;
1811
- n.interacting() || an(n, on(n, r, o, i, e), e);
1867
+ n.interacting() || sn(n, an(n, r, o, i, e), e);
1812
1868
  }, "interactions:move": function(t, e) {
1813
1869
  (function(n, r) {
1814
1870
  var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget;
1815
- o.pointerType !== "mouse" || o.pointerIsDown || o.interacting() || an(o, on(o, i, a, s, r), r);
1871
+ o.pointerType !== "mouse" || o.pointerIsDown || o.interacting() || sn(o, an(o, i, a, s, r), r);
1816
1872
  })(t, e), (function(n, r) {
1817
1873
  var o = n.interaction;
1818
1874
  if (o.pointerIsDown && !o.interacting() && o.pointerWasMoved && o.prepared.name) {
1819
1875
  r.fire("autoStart:before-start", n);
1820
1876
  var i = o.interactable, a = o.prepared.name;
1821
- a && i && (i.options[a].manualStart || !it(i, o.element, o.prepared, r) ? o.stop() : (o.start(o.prepared, i, o.element), ln(o, r)));
1877
+ a && i && (i.options[a].manualStart || !at(i, o.element, o.prepared, r) ? o.stop() : (o.start(o.prepared, i, o.element), cn(o, r)));
1822
1878
  }
1823
1879
  })(t, e);
1824
1880
  }, "interactions:stop": function(t, e) {
1825
1881
  var n = t.interaction, r = n.interactable;
1826
- r && r.options.styleCursor && Tt(n.element, "", e);
1827
- } }, maxInteractions: sn, withinInteractionLimit: it, validateAction: rn }, _t = Qn, Zn = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
1882
+ r && r.options.styleCursor && _t(n.element, "", e);
1883
+ } }, maxInteractions: ln, withinInteractionLimit: at, validateAction: on }, Mt = Qn, Zn = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
1828
1884
  var n = t.interaction, r = t.eventTarget, o = t.dx, i = t.dy;
1829
1885
  if (n.prepared.name === "drag") {
1830
1886
  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";
1831
1887
  if (n.prepared.axis = l.lockAxis === "start" ? c[0] : l.lockAxis, c !== "xy" && d !== "xy" && d !== c) {
1832
1888
  n.prepared.name = null;
1833
- for (var f = r, y = function(k) {
1834
- if (k !== n.interactable) {
1835
- var T = n.interactable.options.drag;
1836
- if (!T.manualStart && k.testIgnoreAllow(T, f, r)) {
1837
- var I = k.getAction(n.downPointer, n.downEvent, n, f);
1838
- if (I && I.name === "drag" && (function(R, O) {
1839
- if (!O) return !1;
1840
- var W = O.options.drag.startAxis;
1841
- return R === "xy" || W === "xy" || W === R;
1842
- })(c, k) && _t.validateAction(I, k, f, r, e)) return k;
1889
+ for (var f = r, y = function(C) {
1890
+ if (C !== n.interactable) {
1891
+ var M = n.interactable.options.drag;
1892
+ if (!M.manualStart && C.testIgnoreAllow(M, f, r)) {
1893
+ var I = C.getAction(n.downPointer, n.downEvent, n, f);
1894
+ if (I && I.name === "drag" && (function(R, D) {
1895
+ if (!D) return !1;
1896
+ var q = D.options.drag.startAxis;
1897
+ return R === "xy" || q === "xy" || q === R;
1898
+ })(c, C) && Mt.validateAction(I, C, f, r, e)) return C;
1843
1899
  }
1844
1900
  }
1845
1901
  }; b.element(f); ) {
1846
- var S = e.interactables.forEachMatch(f, y);
1847
- if (S) {
1848
- n.prepared.name = "drag", n.interactable = S, n.element = f;
1902
+ var T = e.interactables.forEachMatch(f, y);
1903
+ if (T) {
1904
+ n.prepared.name = "drag", n.interactable = T, n.element = f;
1849
1905
  break;
1850
1906
  }
1851
1907
  f = fe(f);
@@ -1853,7 +1909,7 @@ function Vo() {
1853
1909
  }
1854
1910
  }
1855
1911
  } } };
1856
- function Mt(t) {
1912
+ function Rt(t) {
1857
1913
  var e = t.prepared && t.prepared.name;
1858
1914
  if (!e) return null;
1859
1915
  var n = t.interactable.options;
@@ -1861,11 +1917,11 @@ function Vo() {
1861
1917
  }
1862
1918
  var er = { id: "auto-start/hold", install: function(t) {
1863
1919
  var e = t.defaults;
1864
- t.usePlugin(_t), e.perAction.hold = 0, e.perAction.delay = 0;
1920
+ t.usePlugin(Mt), e.perAction.hold = 0, e.perAction.delay = 0;
1865
1921
  }, listeners: { "interactions:new": function(t) {
1866
1922
  t.interaction.autoStartHoldTimer = null;
1867
1923
  }, "autoStart:prepared": function(t) {
1868
- var e = t.interaction, n = Mt(e);
1924
+ var e = t.interaction, n = Rt(e);
1869
1925
  n > 0 && (e.autoStartHoldTimer = setTimeout((function() {
1870
1926
  e.start(e.prepared, e.interactable, e.element);
1871
1927
  }), n));
@@ -1874,9 +1930,9 @@ function Vo() {
1874
1930
  e.autoStartHoldTimer && e.pointerWasMoved && !n && (clearTimeout(e.autoStartHoldTimer), e.autoStartHoldTimer = null);
1875
1931
  }, "autoStart:before-start": function(t) {
1876
1932
  var e = t.interaction;
1877
- Mt(e) > 0 && (e.prepared.name = null);
1878
- } }, getHoldDuration: Mt }, tr = er, nr = { id: "auto-start", install: function(t) {
1879
- t.usePlugin(_t), t.usePlugin(tr), t.usePlugin(Zn);
1933
+ Rt(e) > 0 && (e.prepared.name = null);
1934
+ } }, getHoldDuration: Rt }, tr = er, nr = { id: "auto-start", install: function(t) {
1935
+ t.usePlugin(Mt), t.usePlugin(tr), t.usePlugin(Zn);
1880
1936
  } }, rr = function(t) {
1881
1937
  return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) : b.bool(t) ? (this.options.preventDefault = t ? "always" : "never", this) : this.options.preventDefault;
1882
1938
  };
@@ -1884,14 +1940,14 @@ function Vo() {
1884
1940
  var e = t.interaction, n = t.event;
1885
1941
  e.interactable && e.interactable.checkAndPreventDefault(n);
1886
1942
  }
1887
- var cn = { id: "core/interactablePreventDefault", install: function(t) {
1943
+ var un = { id: "core/interactablePreventDefault", install: function(t) {
1888
1944
  var e = t.Interactable;
1889
1945
  e.prototype.preventDefault = rr, e.prototype.checkAndPreventDefault = function(n) {
1890
1946
  return (function(r, o, i) {
1891
1947
  var a = r.options.preventDefault;
1892
1948
  if (a !== "never") if (a !== "always") {
1893
1949
  if (o.events.supportsPassive && /^touch(start|move)$/.test(i.type)) {
1894
- var s = te(i.target).document, l = o.getDocOptions(s);
1950
+ var s = ne(i.target).document, l = o.getDocOptions(s);
1895
1951
  if (!l || !l.events || l.events.passive !== !1) return;
1896
1952
  }
1897
1953
  /^(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();
@@ -1906,36 +1962,36 @@ function Vo() {
1906
1962
  }, listeners: ["down", "move", "up", "cancel"].reduce((function(t, e) {
1907
1963
  return t["interactions:".concat(e)] = or, t;
1908
1964
  }), {}) };
1909
- function at(t, e) {
1965
+ function st(t, e) {
1910
1966
  if (e.phaselessTypes[t]) return !0;
1911
1967
  for (var n in e.map) if (t.indexOf(n) === 0 && t.substr(n.length) in e.phases) return !0;
1912
1968
  return !1;
1913
1969
  }
1914
- function De(t) {
1970
+ function Ne(t) {
1915
1971
  var e = {};
1916
1972
  for (var n in t) {
1917
1973
  var r = t[n];
1918
- b.plainObject(r) ? e[n] = De(r) : b.array(r) ? e[n] = Xt(r) : e[n] = r;
1974
+ b.plainObject(r) ? e[n] = Ne(r) : b.array(r) ? e[n] = Gt(r) : e[n] = r;
1919
1975
  }
1920
1976
  return e;
1921
1977
  }
1922
- var Rt = (function() {
1978
+ var At = (function() {
1923
1979
  function t(e) {
1924
- g(this, t), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e, this.result = st(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
1980
+ g(this, t), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e, this.result = lt(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
1925
1981
  }
1926
1982
  return x(t, [{ key: "start", value: function(e, n) {
1927
1983
  var r, o, i = e.phase, a = this.interaction, s = (function(d) {
1928
1984
  var c = d.interactable.options[d.prepared.name], f = c.modifiers;
1929
1985
  return f && f.length ? f : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(y) {
1930
- var S = c[y];
1931
- return S && S.enabled && { options: S, methods: S._methods };
1986
+ var T = c[y];
1987
+ return T && T.enabled && { options: T, methods: T._methods };
1932
1988
  })).filter((function(y) {
1933
1989
  return !!y;
1934
1990
  }));
1935
1991
  })(a);
1936
- this.prepareStates(s), this.startEdges = P({}, a.edges), this.edges = P({}, 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 };
1992
+ this.prepareStates(s), this.startEdges = O({}, a.edges), this.edges = O({}, 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 };
1937
1993
  var l = this.fillArg({ phase: i, pageCoords: n, preEnd: !1 });
1938
- return this.result = st(), this.startAll(l), this.result = this.setAll(l);
1994
+ return this.result = lt(), this.startAll(l), this.result = this.setAll(l);
1939
1995
  } }, { key: "fillArg", value: function(e) {
1940
1996
  var n = this.interaction;
1941
1997
  return e.interaction = n, e.interactable = n.interactable, e.element = n.element, e.rect || (e.rect = n.rect), e.edges || (e.edges = this.startEdges), e.startOffset = this.startOffset, e;
@@ -1946,27 +2002,27 @@ function Vo() {
1946
2002
  }
1947
2003
  } }, { key: "setAll", value: function(e) {
1948
2004
  var n = e.phase, r = e.preEnd, o = e.skipModifiers, i = e.rect, a = e.edges;
1949
- e.coords = P({}, e.pageCoords), e.rect = P({}, i), e.edges = P({}, a);
1950
- for (var s = o ? this.states.slice(o) : this.states, l = st(e.coords, e.rect), d = 0; d < s.length; d++) {
1951
- var c, f = s[d], y = f.options, S = P({}, e.coords), k = null;
1952
- (c = f.methods) != null && c.set && this.shouldDo(y, r, n) && (e.state = f, k = f.methods.set(e), et(e.edges, e.rect, { x: e.coords.x - S.x, y: e.coords.y - S.y })), l.eventProps.push(k);
2005
+ e.coords = O({}, e.pageCoords), e.rect = O({}, i), e.edges = O({}, a);
2006
+ for (var s = o ? this.states.slice(o) : this.states, l = lt(e.coords, e.rect), d = 0; d < s.length; d++) {
2007
+ var c, f = s[d], y = f.options, T = O({}, e.coords), C = null;
2008
+ (c = f.methods) != null && c.set && this.shouldDo(y, r, n) && (e.state = f, C = f.methods.set(e), tt(e.edges, e.rect, { x: e.coords.x - T.x, y: e.coords.y - T.y })), l.eventProps.push(C);
1953
2009
  }
1954
- P(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;
1955
- var T = this.result.coords, I = this.result.rect;
1956
- if (T && I) {
2010
+ O(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;
2011
+ var M = this.result.coords, I = this.result.rect;
2012
+ if (M && I) {
1957
2013
  var R = l.rect.left !== I.left || l.rect.right !== I.right || l.rect.top !== I.top || l.rect.bottom !== I.bottom;
1958
- l.changed = R || T.x !== l.coords.x || T.y !== l.coords.y;
2014
+ l.changed = R || M.x !== l.coords.x || M.y !== l.coords.y;
1959
2015
  }
1960
2016
  return l;
1961
2017
  } }, { key: "applyToInteraction", value: function(e) {
1962
2018
  var n = this.interaction, r = e.phase, o = n.coords.cur, i = n.coords.start, a = this.result, s = this.startDelta, l = a.delta;
1963
- r === "start" && P(this.startDelta, a.delta);
2019
+ r === "start" && O(this.startDelta, a.delta);
1964
2020
  for (var d = 0, c = [[i, s], [o, l]]; d < c.length; d++) {
1965
- var f = c[d], y = f[0], S = f[1];
1966
- y.page.x += S.x, y.page.y += S.y, y.client.x += S.x, y.client.y += S.y;
2021
+ var f = c[d], y = f[0], T = f[1];
2022
+ y.page.x += T.x, y.page.y += T.y, y.client.x += T.x, y.client.y += T.y;
1967
2023
  }
1968
- var k = this.result.rectDelta, T = e.rect || n.rect;
1969
- T.left += k.left, T.right += k.right, T.top += k.top, T.bottom += k.bottom, T.width = T.right - T.left, T.height = T.bottom - T.top;
2024
+ var C = this.result.rectDelta, M = e.rect || n.rect;
2025
+ M.left += C.left, M.right += C.right, M.top += C.top, M.bottom += C.bottom, M.width = M.right - M.left, M.height = M.bottom - M.top;
1970
2026
  } }, { key: "setAndApply", value: function(e) {
1971
2027
  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 }));
1972
2028
  if (this.result = a, !a.changed && (!i || i < this.states.length) && n.interacting()) return !1;
@@ -1990,7 +2046,7 @@ function Vo() {
1990
2046
  } }, { key: "stop", value: function(e) {
1991
2047
  var n = e.interaction;
1992
2048
  if (this.states && this.states.length) {
1993
- var r = P({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
2049
+ var r = O({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
1994
2050
  this.fillArg(r);
1995
2051
  for (var o = 0, i = this.states; o < i.length; o++) {
1996
2052
  var a = i[o];
@@ -2009,8 +2065,8 @@ function Vo() {
2009
2065
  var n = e.interaction, r = n.coords, o = n.rect, i = n.modification;
2010
2066
  if (i.result) {
2011
2067
  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++) {
2012
- var y = f[c], S = y[0], k = y[1];
2013
- S.page.x -= k.x, S.page.y -= k.y, S.client.x -= k.x, S.client.y -= k.y;
2068
+ var y = f[c], T = y[0], C = y[1];
2069
+ T.page.x -= C.x, T.page.y -= C.y, T.client.x -= C.x, T.client.y -= C.y;
2014
2070
  }
2015
2071
  o.left -= d.left, o.right -= d.right, o.top -= d.top, o.bottom -= d.bottom;
2016
2072
  }
@@ -2018,13 +2074,13 @@ function Vo() {
2018
2074
  return !(!e || e.enabled === !1 || o && !e.endOnly || e.endOnly && !n || r === "start" && !e.setStart);
2019
2075
  } }, { key: "copyFrom", value: function(e) {
2020
2076
  this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map((function(n) {
2021
- return De(n);
2022
- })), this.result = st(P({}, e.result.coords), P({}, e.result.rect));
2077
+ return Ne(n);
2078
+ })), this.result = lt(O({}, e.result.coords), O({}, e.result.rect));
2023
2079
  } }, { key: "destroy", value: function() {
2024
2080
  for (var e in this) this[e] = null;
2025
2081
  } }]), t;
2026
2082
  })();
2027
- function st(t, e) {
2083
+ function lt(t, e) {
2028
2084
  return { rect: e, coords: t, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: !0 };
2029
2085
  }
2030
2086
  function _e(t, e) {
@@ -2048,7 +2104,7 @@ function Vo() {
2048
2104
  t.defaults.perAction.modifiers = [];
2049
2105
  }, listeners: { "interactions:new": function(t) {
2050
2106
  var e = t.interaction;
2051
- e.modification = new Rt(e);
2107
+ e.modification = new At(e);
2052
2108
  }, "interactions:before-action-start": function(t) {
2053
2109
  var e = t.interaction, n = t.interaction.modification;
2054
2110
  n.start(t, e.coords.start.page), e.edges = n.edges, n.applyToInteraction(t);
@@ -2064,14 +2120,14 @@ function Vo() {
2064
2120
  return t.interaction.modification.restoreInteractionCoords(t);
2065
2121
  }, "interactions:stop": function(t) {
2066
2122
  return t.interaction.modification.stop(t);
2067
- } } }, un = ir, dn = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, At = (function(t) {
2068
- _(n, t);
2069
- var e = A(n);
2123
+ } } }, dn = ir, pn = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, It = (function(t) {
2124
+ S(n, t);
2125
+ var e = P(n);
2070
2126
  function n(r, o, i, a, s, l, d) {
2071
2127
  var c;
2072
2128
  g(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;
2073
- var f = r.interactable, y = (f && f.options || dn).deltaSource, S = Le(f, s, i), k = a === "start", T = a === "end", I = k ? U(c) : r.prevEvent, R = k ? r.coords.start : T ? { page: I.page, client: I.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
2074
- return c.page = P({}, R.page), c.client = P({}, R.client), c.rect = P({}, r.rect), c.timeStamp = R.timeStamp, T || (c.page.x -= S.x, c.page.y -= S.y, c.client.x -= S.x, c.client.y -= S.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 = k ? r.pointers[r.pointers.length - 1].downTime : I.t0, c.x0 = r.coords.start.page.x - S.x, c.y0 = r.coords.start.page.y - S.y, c.clientX0 = r.coords.start.client.x - S.x, c.clientY0 = r.coords.start.client.y - S.y, c.delta = k || T ? { x: 0, y: 0 } : { x: c[y].x - I[y].x, y: c[y].y - I[y].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = P({}, r.coords.velocity[y]), c.speed = Fe(c.velocity.x, c.velocity.y), c.swipe = T || a === "inertiastart" ? c.getSwipe() : null, c;
2129
+ var f = r.interactable, y = (f && f.options || pn).deltaSource, T = Le(f, s, i), C = a === "start", M = a === "end", I = C ? B(c) : r.prevEvent, R = C ? r.coords.start : M ? { page: I.page, client: I.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
2130
+ return c.page = O({}, R.page), c.client = O({}, R.client), c.rect = O({}, r.rect), c.timeStamp = R.timeStamp, M || (c.page.x -= T.x, c.page.y -= T.y, c.client.x -= T.x, c.client.y -= T.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 = C ? r.pointers[r.pointers.length - 1].downTime : I.t0, c.x0 = r.coords.start.page.x - T.x, c.y0 = r.coords.start.page.y - T.y, c.clientX0 = r.coords.start.client.x - T.x, c.clientY0 = r.coords.start.client.y - T.y, c.delta = C || M ? { x: 0, y: 0 } : { x: c[y].x - I[y].x, y: c[y].y - I[y].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = O({}, r.coords.velocity[y]), c.speed = Fe(c.velocity.x, c.velocity.y), c.swipe = M || a === "inertiastart" ? c.getSwipe() : null, c;
2075
2131
  }
2076
2132
  return x(n, [{ key: "getSwipe", value: function() {
2077
2133
  var r = this._interaction;
@@ -2086,8 +2142,8 @@ function Vo() {
2086
2142
  } }, { key: "stopPropagation", value: function() {
2087
2143
  this.propagationStopped = !0;
2088
2144
  } }]), n;
2089
- })(ot);
2090
- Object.defineProperties(At.prototype, { pageX: { get: function() {
2145
+ })(it);
2146
+ Object.defineProperties(It.prototype, { pageX: { get: function() {
2091
2147
  return this.page.x;
2092
2148
  }, set: function(t) {
2093
2149
  this.page.x = t;
@@ -2124,7 +2180,7 @@ function Vo() {
2124
2180
  g(this, t), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e, this.pointer = n, this.event = r, this.downTime = o, this.downTarget = i;
2125
2181
  })), sr = (function(t) {
2126
2182
  return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
2127
- })({}), pn = (function(t) {
2183
+ })({}), fn = (function(t) {
2128
2184
  return t.start = "", t.move = "", t.end = "", t.stop = "", t.interacting = "", t;
2129
2185
  })({}), lr = 0, cr = (function() {
2130
2186
  function t(e) {
@@ -2145,7 +2201,7 @@ function Vo() {
2145
2201
  return i[c].apply(i, arguments);
2146
2202
  } });
2147
2203
  };
2148
- for (var d in pn) l(d);
2204
+ for (var d in fn) l(d);
2149
2205
  this._scopeFire("interactions:new", { interaction: this });
2150
2206
  }
2151
2207
  return x(t, [{ key: "pointerMoveTolerance", get: function() {
@@ -2154,15 +2210,15 @@ function Vo() {
2154
2210
  var o = this.updatePointer(e, n, r, !0), i = this.pointers[o];
2155
2211
  this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: o, pointerInfo: i, type: "down", interaction: this });
2156
2212
  } }, { key: "start", value: function(e, n, r) {
2157
- return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (St(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? P({}, 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);
2213
+ return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (Tt(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? O({}, 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);
2158
2214
  } }, { key: "pointerMove", value: function(e, n, r) {
2159
2215
  this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
2160
2216
  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;
2161
2217
  this.pointerIsDown && !this.pointerWasMoved && (o = this.coords.cur.client.x - this.coords.start.client.x, i = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = Fe(o, i) > this.pointerMoveTolerance);
2162
2218
  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 };
2163
- 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 && nt(this.coords.prev, this.coords.cur));
2219
+ 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 && rt(this.coords.prev, this.coords.cur));
2164
2220
  } }, { key: "move", value: function(e) {
2165
- e && e.event || Bt(this.coords.delta), (e = P({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
2221
+ e && e.event || qt(this.coords.delta), (e = O({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
2166
2222
  } }, { key: "pointerUp", value: function(e, n, r, o) {
2167
2223
  var i = this.getPointerIndex(e);
2168
2224
  i === -1 && (i = this.updatePointer(e, n, r, !1));
@@ -2190,7 +2246,7 @@ function Vo() {
2190
2246
  var i, a, s, l = je(e), d = this.getPointerIndex(e), c = this.pointers[d];
2191
2247
  return o = o !== !1 && (o || /(down|start)$/i.test(n.type)), c ? c.pointer = e : (c = new ar(l, e, n, null, null), d = this.pointers.length, this.pointers.push(c)), Hn(this.coords.cur, this.pointers.map((function(f) {
2192
2248
  return f.pointer;
2193
- })), this._now()), i = this.coords.delta, a = this.coords.prev, s = this.coords.cur, i.page.x = s.page.x - a.page.x, i.page.y = s.page.y - a.page.y, i.client.x = s.client.x - a.client.x, i.client.y = s.client.y - a.client.y, i.timeStamp = s.timeStamp - a.timeStamp, o && (this.pointerIsDown = !0, c.downTime = this.coords.cur.timeStamp, c.downTarget = r, tt(this.downPointer, e), this.interacting() || (nt(this.coords.start, this.coords.cur), nt(this.coords.prev, this.coords.cur), this.downEvent = n, this.pointerWasMoved = !1)), this._updateLatestPointer(e, n, r), this._scopeFire("interactions:update-pointer", { pointer: e, event: n, eventTarget: r, down: o, pointerInfo: c, pointerIndex: d, interaction: this }), d;
2249
+ })), this._now()), i = this.coords.delta, a = this.coords.prev, s = this.coords.cur, i.page.x = s.page.x - a.page.x, i.page.y = s.page.y - a.page.y, i.client.x = s.client.x - a.client.x, i.client.y = s.client.y - a.client.y, i.timeStamp = s.timeStamp - a.timeStamp, o && (this.pointerIsDown = !0, c.downTime = this.coords.cur.timeStamp, c.downTarget = r, nt(this.downPointer, e), this.interacting() || (rt(this.coords.start, this.coords.cur), rt(this.coords.prev, this.coords.cur), this.downEvent = n, this.pointerWasMoved = !1)), this._updateLatestPointer(e, n, r), this._scopeFire("interactions:update-pointer", { pointer: e, event: n, eventTarget: r, down: o, pointerInfo: c, pointerIndex: d, interaction: this }), d;
2194
2250
  } }, { key: "removePointer", value: function(e, n) {
2195
2251
  var r = this.getPointerIndex(e);
2196
2252
  if (r !== -1) {
@@ -2202,60 +2258,60 @@ function Vo() {
2202
2258
  } }, { key: "destroy", value: function() {
2203
2259
  this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
2204
2260
  } }, { key: "_createPreparedEvent", value: function(e, n, r, o) {
2205
- return new At(this, e, this.prepared.name, n, this.element, r, o);
2261
+ return new It(this, e, this.prepared.name, n, this.element, r, o);
2206
2262
  } }, { key: "_fireEvent", value: function(e) {
2207
2263
  var n;
2208
2264
  (n = this.interactable) == null || n.fire(e), (!this.prevEvent || e.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = e);
2209
2265
  } }, { key: "_doPhase", value: function(e) {
2210
2266
  var n = e.event, r = e.phase, o = e.preEnd, i = e.type, a = this.rect;
2211
- if (a && r === "move" && (et(this.edges, a, this.coords.delta[this.interactable.options.deltaSource]), a.width = a.right - a.left, a.height = a.bottom - a.top), this._scopeFire("interactions:before-action-".concat(r), e) === !1) return !1;
2267
+ if (a && r === "move" && (tt(this.edges, a, this.coords.delta[this.interactable.options.deltaSource]), a.width = a.right - a.left, a.height = a.bottom - a.top), this._scopeFire("interactions:before-action-".concat(r), e) === !1) return !1;
2212
2268
  var s = e.iEvent = this._createPreparedEvent(n, r, o, i);
2213
2269
  return this._scopeFire("interactions:action-".concat(r), e), r === "start" && (this.prevEvent = s), this._fireEvent(s), this._scopeFire("interactions:after-action-".concat(r), e), !0;
2214
2270
  } }, { key: "_now", value: function() {
2215
2271
  return Date.now();
2216
2272
  } }]), t;
2217
2273
  })();
2218
- function fn(t) {
2219
- hn(t.interaction);
2220
- }
2221
2274
  function hn(t) {
2275
+ vn(t.interaction);
2276
+ }
2277
+ function vn(t) {
2222
2278
  if (!(function(n) {
2223
2279
  return !(!n.offset.pending.x && !n.offset.pending.y);
2224
2280
  })(t)) return !1;
2225
2281
  var e = t.offset.pending;
2226
- return It(t.coords.cur, e), It(t.coords.delta, e), et(t.edges, t.rect, e), e.x = 0, e.y = 0, !0;
2282
+ return Pt(t.coords.cur, e), Pt(t.coords.delta, e), tt(t.edges, t.rect, e), e.x = 0, e.y = 0, !0;
2227
2283
  }
2228
2284
  function ur(t) {
2229
2285
  var e = t.x, n = t.y;
2230
2286
  this.offset.pending.x += e, this.offset.pending.y += n, this.offset.total.x += e, this.offset.total.y += n;
2231
2287
  }
2232
- function It(t, e) {
2288
+ function Pt(t, e) {
2233
2289
  var n = t.page, r = t.client, o = e.x, i = e.y;
2234
2290
  n.x += o, n.y += i, r.x += o, r.y += i;
2235
2291
  }
2236
- pn.offsetBy = "";
2292
+ fn.offsetBy = "";
2237
2293
  var dr = { id: "offset", before: ["modifiers", "pointer-events", "actions", "inertia"], install: function(t) {
2238
2294
  t.Interaction.prototype.offsetBy = ur;
2239
2295
  }, listeners: { "interactions:new": function(t) {
2240
2296
  t.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
2241
2297
  }, "interactions:update-pointer": function(t) {
2242
2298
  return (function(e) {
2243
- e.pointerIsDown && (It(e.coords.cur, e.offset.total), e.offset.pending.x = 0, e.offset.pending.y = 0);
2299
+ e.pointerIsDown && (Pt(e.coords.cur, e.offset.total), e.offset.pending.x = 0, e.offset.pending.y = 0);
2244
2300
  })(t.interaction);
2245
- }, "interactions:before-action-start": fn, "interactions:before-action-move": fn, "interactions:before-action-end": function(t) {
2301
+ }, "interactions:before-action-start": hn, "interactions:before-action-move": hn, "interactions:before-action-end": function(t) {
2246
2302
  var e = t.interaction;
2247
- if (hn(e)) return e.move({ offset: !0 }), e.end(), !1;
2303
+ if (vn(e)) return e.move({ offset: !0 }), e.end(), !1;
2248
2304
  }, "interactions:stop": function(t) {
2249
2305
  var e = t.interaction;
2250
2306
  e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
2251
- } } }, vn = dr, pr = (function() {
2307
+ } } }, mn = dr, pr = (function() {
2252
2308
  function t(e) {
2253
2309
  g(this, t), this.active = !1, this.isModified = !1, this.smoothEnd = !1, this.allowResume = !1, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = e;
2254
2310
  }
2255
2311
  return x(t, [{ key: "start", value: function(e) {
2256
- var n = this.interaction, r = lt(n);
2312
+ var n = this.interaction, r = ct(n);
2257
2313
  if (!r || !r.enabled) return !1;
2258
- var o = n.coords.velocity.client, i = Fe(o.x, o.y), a = this.modification || (this.modification = new Rt(n));
2314
+ var o = n.coords.velocity.client, i = Fe(o.x, o.y), a = this.modification || (this.modification = new At(n));
2259
2315
  if (a.copyFrom(n.modification), this.t0 = n._now(), this.allowResume = r.allowResume, this.v0 = i, this.currentOffset = { x: 0, y: 0 }, this.startCoords = n.coords.cur.page, this.modifierArg = a.fillArg({ pageCoords: this.startCoords, preEnd: !0, phase: "inertiastart" }), this.t0 - n.coords.cur.timeStamp < 50 && i > r.minSpeed && i > r.endSpeed) this.startInertia();
2260
2316
  else {
2261
2317
  if (a.result = a.setAll(this.modifierArg), !a.result.changed) return !1;
@@ -2263,7 +2319,7 @@ function Vo() {
2263
2319
  }
2264
2320
  return n.modification.result.rect = null, n.offsetBy(this.targetOffset), n._doPhase({ interaction: n, event: e, phase: "inertiastart" }), n.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), n.modification.result.rect = null, this.active = !0, n.simulation = this, !0;
2265
2321
  } }, { key: "startInertia", value: function() {
2266
- var e = this, n = this.interaction.coords.velocity.client, r = lt(this.interaction), o = r.resistance, i = -Math.log(r.endSpeed / this.v0) / o;
2322
+ var e = this, n = this.interaction.coords.velocity.client, r = ct(this.interaction), o = r.resistance, i = -Math.log(r.endSpeed / this.v0) / o;
2267
2323
  this.targetOffset = { x: (n.x - i) / o, y: (n.y - i) / o }, this.te = i, this.lambda_v0 = o / this.v0, this.one_ve_v0 = 1 - r.endSpeed / this.v0;
2268
2324
  var a = this.modification, s = this.modifierArg;
2269
2325
  s.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, a.result = a.setAll(s), a.result.changed && (this.isModified = !0, this.modifiedOffset = { x: this.targetOffset.x + a.result.delta.x, y: this.targetOffset.y + a.result.delta.y }), this.onNextFrame((function() {
@@ -2280,39 +2336,39 @@ function Vo() {
2280
2336
  n.active && e();
2281
2337
  }));
2282
2338
  } }, { key: "inertiaTick", value: function() {
2283
- var e, n, r, o, i, a, s, l = this, d = this.interaction, c = lt(d).resistance, f = (d._now() - this.t0) / 1e3;
2339
+ var e, n, r, o, i, a, s, l = this, d = this.interaction, c = ct(d).resistance, f = (d._now() - this.t0) / 1e3;
2284
2340
  if (f < this.te) {
2285
- var y, S = 1 - (Math.exp(-c * f) - this.lambda_v0) / this.one_ve_v0;
2286
- this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y, y = { x: mn(s = S, e, r, i), y: mn(s, n, o, a) }) : y = { x: this.targetOffset.x * S, y: this.targetOffset.y * S };
2287
- var k = { x: y.x - this.currentOffset.x, y: y.y - this.currentOffset.y };
2288
- this.currentOffset.x += k.x, this.currentOffset.y += k.y, d.offsetBy(k), d.move(), this.onNextFrame((function() {
2341
+ var y, T = 1 - (Math.exp(-c * f) - this.lambda_v0) / this.one_ve_v0;
2342
+ this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y, y = { x: gn(s = T, e, r, i), y: gn(s, n, o, a) }) : y = { x: this.targetOffset.x * T, y: this.targetOffset.y * T };
2343
+ var C = { x: y.x - this.currentOffset.x, y: y.y - this.currentOffset.y };
2344
+ this.currentOffset.x += C.x, this.currentOffset.y += C.y, d.offsetBy(C), d.move(), this.onNextFrame((function() {
2289
2345
  return l.inertiaTick();
2290
2346
  }));
2291
2347
  } else d.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
2292
2348
  } }, { key: "smoothEndTick", value: function() {
2293
- var e = this, n = this.interaction, r = n._now() - this.t0, o = lt(n).smoothEndDuration;
2349
+ var e = this, n = this.interaction, r = n._now() - this.t0, o = ct(n).smoothEndDuration;
2294
2350
  if (r < o) {
2295
- var i = { x: gn(r, 0, this.targetOffset.x, o), y: gn(r, 0, this.targetOffset.y, o) }, a = { x: i.x - this.currentOffset.x, y: i.y - this.currentOffset.y };
2351
+ var i = { x: yn(r, 0, this.targetOffset.x, o), y: yn(r, 0, this.targetOffset.y, o) }, a = { x: i.x - this.currentOffset.x, y: i.y - this.currentOffset.y };
2296
2352
  this.currentOffset.x += a.x, this.currentOffset.y += a.y, n.offsetBy(a), n.move({ skipModifiers: this.modifierCount }), this.onNextFrame((function() {
2297
2353
  return e.smoothEndTick();
2298
2354
  }));
2299
2355
  } else n.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
2300
2356
  } }, { key: "resume", value: function(e) {
2301
2357
  var n = e.pointer, r = e.event, o = e.eventTarget, i = this.interaction;
2302
- i.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), i.updatePointer(n, r, o, !0), i._doPhase({ interaction: i, event: r, phase: "resume" }), nt(i.coords.prev, i.coords.cur), this.stop();
2358
+ i.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), i.updatePointer(n, r, o, !0), i._doPhase({ interaction: i, event: r, phase: "resume" }), rt(i.coords.prev, i.coords.cur), this.stop();
2303
2359
  } }, { key: "end", value: function() {
2304
2360
  this.interaction.move(), this.interaction.end(), this.stop();
2305
2361
  } }, { key: "stop", value: function() {
2306
2362
  this.active = this.smoothEnd = !1, this.interaction.simulation = null, Te.cancel(this.timeout);
2307
2363
  } }]), t;
2308
2364
  })();
2309
- function lt(t) {
2365
+ function ct(t) {
2310
2366
  var e = t.interactable, n = t.prepared;
2311
2367
  return e && e.options && n.name && e.options[n.name].inertia;
2312
2368
  }
2313
2369
  var fr = { id: "inertia", before: ["modifiers", "actions"], install: function(t) {
2314
2370
  var e = t.defaults;
2315
- t.usePlugin(vn), t.usePlugin(un), t.actions.phases.inertiastart = !0, t.actions.phases.resume = !0, e.perAction.inertia = { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 };
2371
+ t.usePlugin(mn), t.usePlugin(dn), t.actions.phases.inertiastart = !0, t.actions.phases.resume = !0, e.perAction.inertia = { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 };
2316
2372
  }, listeners: { "interactions:new": function(t) {
2317
2373
  var e = t.interaction;
2318
2374
  e.inertia = new pr(e);
@@ -2341,33 +2397,33 @@ function Vo() {
2341
2397
  }, "interactions:after-action-resume": function(t) {
2342
2398
  return t.interaction.modification.restoreInteractionCoords(t);
2343
2399
  } } };
2344
- function mn(t, e, n, r) {
2400
+ function gn(t, e, n, r) {
2345
2401
  var o = 1 - t;
2346
2402
  return o * o * e + 2 * o * t * n + t * t * r;
2347
2403
  }
2348
- function gn(t, e, n, r) {
2404
+ function yn(t, e, n, r) {
2349
2405
  return -n * (t /= r) * (t - 2) + e;
2350
2406
  }
2351
2407
  var hr = fr;
2352
- function yn(t, e) {
2408
+ function bn(t, e) {
2353
2409
  for (var n = 0; n < e.length; n++) {
2354
2410
  var r = e[n];
2355
2411
  if (t.immediatePropagationStopped) break;
2356
2412
  r(t);
2357
2413
  }
2358
2414
  }
2359
- var bn = (function() {
2415
+ var xn = (function() {
2360
2416
  function t(e) {
2361
- g(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = P({}, e || {});
2417
+ g(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = O({}, e || {});
2362
2418
  }
2363
2419
  return x(t, [{ key: "fire", value: function(e) {
2364
2420
  var n, r = this.global;
2365
- (n = this.types[e.type]) && yn(e, n), !e.propagationStopped && r && (n = r[e.type]) && yn(e, n);
2421
+ (n = this.types[e.type]) && bn(e, n), !e.propagationStopped && r && (n = r[e.type]) && bn(e, n);
2366
2422
  } }, { key: "on", value: function(e, n) {
2367
- var r = Ae(e, n);
2368
- for (e in r) this.types[e] = Ut(this.types[e] || [], r[e]);
2423
+ var r = Ie(e, n);
2424
+ for (e in r) this.types[e] = Xt(this.types[e] || [], r[e]);
2369
2425
  } }, { key: "off", value: function(e, n) {
2370
- var r = Ae(e, n);
2426
+ var r = Ie(e, n);
2371
2427
  for (e in r) {
2372
2428
  var o = this.types[e];
2373
2429
  if (o && o.length) for (var i = 0, a = r[e]; i < a.length; i++) {
@@ -2380,7 +2436,7 @@ function Vo() {
2380
2436
  } }]), t;
2381
2437
  })(), vr = (function() {
2382
2438
  function t(e) {
2383
- g(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, tt(this, e);
2439
+ g(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, nt(this, e);
2384
2440
  }
2385
2441
  return x(t, [{ key: "preventOriginalDefault", value: function() {
2386
2442
  this.originalEvent.preventDefault();
@@ -2393,12 +2449,12 @@ function Vo() {
2393
2449
  function Ye(t) {
2394
2450
  return b.object(t) ? { capture: !!t.capture, passive: !!t.passive } : { capture: !!t, passive: !1 };
2395
2451
  }
2396
- function ct(t, e) {
2452
+ function ut(t, e) {
2397
2453
  return t === e || (typeof t == "boolean" ? !!e.capture === t && !e.passive : !!t.capture == !!e.capture && !!t.passive == !!e.passive);
2398
2454
  }
2399
2455
  var mr = { id: "events", install: function(t) {
2400
- var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f, y, S, k) {
2401
- var T = Ye(k);
2456
+ var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f, y, T, C) {
2457
+ var M = Ye(C);
2402
2458
  if (!r[y]) {
2403
2459
  r[y] = [];
2404
2460
  for (var I = 0; I < o.length; I++) {
@@ -2406,74 +2462,74 @@ function Vo() {
2406
2462
  a(R, y, l), a(R, y, d, !0);
2407
2463
  }
2408
2464
  }
2409
- var O = r[y], W = Be(O, (function(K) {
2410
- return K.selector === c && K.context === f;
2465
+ var D = r[y], q = Be(D, (function(Q) {
2466
+ return Q.selector === c && Q.context === f;
2411
2467
  }));
2412
- W || (W = { selector: c, context: f, listeners: [] }, O.push(W)), W.listeners.push({ func: S, options: T });
2413
- }, removeDelegate: function(c, f, y, S, k) {
2414
- var T, I = Ye(k), R = r[y], O = !1;
2468
+ q || (q = { selector: c, context: f, listeners: [] }, D.push(q)), q.listeners.push({ func: T, options: M });
2469
+ }, removeDelegate: function(c, f, y, T, C) {
2470
+ var M, I = Ye(C), R = r[y], D = !1;
2415
2471
  if (R)
2416
- for (T = R.length - 1; T >= 0; T--) {
2417
- var W = R[T];
2418
- if (W.selector === c && W.context === f) {
2419
- for (var K = W.listeners, L = K.length - 1; L >= 0; L--) {
2420
- var V = K[L];
2421
- if (V.func === S && ct(V.options, I)) {
2422
- K.splice(L, 1), K.length || (R.splice(T, 1), s(f, y, l), s(f, y, d, !0)), O = !0;
2472
+ for (M = R.length - 1; M >= 0; M--) {
2473
+ var q = R[M];
2474
+ if (q.selector === c && q.context === f) {
2475
+ for (var Q = q.listeners, L = Q.length - 1; L >= 0; L--) {
2476
+ var V = Q[L];
2477
+ if (V.func === T && ut(V.options, I)) {
2478
+ Q.splice(L, 1), Q.length || (R.splice(M, 1), s(f, y, l), s(f, y, d, !0)), D = !0;
2423
2479
  break;
2424
2480
  }
2425
2481
  }
2426
- if (O) break;
2482
+ if (D) break;
2427
2483
  }
2428
2484
  }
2429
2485
  }, delegateListener: l, delegateUseCapture: d, delegatedEvents: r, documents: o, targets: n, supportsOptions: !1, supportsPassive: !1 };
2430
- function a(c, f, y, S) {
2486
+ function a(c, f, y, T) {
2431
2487
  if (c.addEventListener) {
2432
- var k = Ye(S), T = Be(n, (function(I) {
2488
+ var C = Ye(T), M = Be(n, (function(I) {
2433
2489
  return I.eventTarget === c;
2434
2490
  }));
2435
- T || (T = { eventTarget: c, events: {} }, n.push(T)), T.events[f] || (T.events[f] = []), Be(T.events[f], (function(I) {
2436
- return I.func === y && ct(I.options, k);
2437
- })) || (c.addEventListener(f, y, i.supportsOptions ? k : k.capture), T.events[f].push({ func: y, options: k }));
2491
+ M || (M = { eventTarget: c, events: {} }, n.push(M)), M.events[f] || (M.events[f] = []), Be(M.events[f], (function(I) {
2492
+ return I.func === y && ut(I.options, C);
2493
+ })) || (c.addEventListener(f, y, i.supportsOptions ? C : C.capture), M.events[f].push({ func: y, options: C }));
2438
2494
  }
2439
2495
  }
2440
- function s(c, f, y, S) {
2496
+ function s(c, f, y, T) {
2441
2497
  if (c.addEventListener && c.removeEventListener) {
2442
- var k = He(n, (function(me) {
2498
+ var C = He(n, (function(me) {
2443
2499
  return me.eventTarget === c;
2444
- })), T = n[k];
2445
- if (T && T.events) if (f !== "all") {
2446
- var I = !1, R = T.events[f];
2500
+ })), M = n[C];
2501
+ if (M && M.events) if (f !== "all") {
2502
+ var I = !1, R = M.events[f];
2447
2503
  if (R) {
2448
2504
  if (y === "all") {
2449
- for (var O = R.length - 1; O >= 0; O--) {
2450
- var W = R[O];
2451
- s(c, f, W.func, W.options);
2505
+ for (var D = R.length - 1; D >= 0; D--) {
2506
+ var q = R[D];
2507
+ s(c, f, q.func, q.options);
2452
2508
  }
2453
2509
  return;
2454
2510
  }
2455
- for (var K = Ye(S), L = 0; L < R.length; L++) {
2511
+ for (var Q = Ye(T), L = 0; L < R.length; L++) {
2456
2512
  var V = R[L];
2457
- if (V.func === y && ct(V.options, K)) {
2458
- c.removeEventListener(f, y, i.supportsOptions ? K : K.capture), R.splice(L, 1), R.length === 0 && (delete T.events[f], I = !0);
2513
+ if (V.func === y && ut(V.options, Q)) {
2514
+ c.removeEventListener(f, y, i.supportsOptions ? Q : Q.capture), R.splice(L, 1), R.length === 0 && (delete M.events[f], I = !0);
2459
2515
  break;
2460
2516
  }
2461
2517
  }
2462
2518
  }
2463
- I && !Object.keys(T.events).length && n.splice(k, 1);
2464
- } else for (f in T.events) T.events.hasOwnProperty(f) && s(c, f, "all");
2519
+ I && !Object.keys(M.events).length && n.splice(C, 1);
2520
+ } else for (f in M.events) M.events.hasOwnProperty(f) && s(c, f, "all");
2465
2521
  }
2466
2522
  }
2467
2523
  function l(c, f) {
2468
- for (var y = Ye(f), S = new vr(c), k = r[c.type], T = Vt(c)[0], I = T; b.element(I); ) {
2469
- for (var R = 0; R < k.length; R++) {
2470
- var O = k[R], W = O.selector, K = O.context;
2471
- if (he(I, W) && se(K, T) && se(K, I)) {
2472
- var L = O.listeners;
2473
- S.currentTarget = I;
2524
+ for (var y = Ye(f), T = new vr(c), C = r[c.type], M = Ut(c)[0], I = M; b.element(I); ) {
2525
+ for (var R = 0; R < C.length; R++) {
2526
+ var D = C[R], q = D.selector, Q = D.context;
2527
+ if (he(I, q) && se(Q, M) && se(Q, I)) {
2528
+ var L = D.listeners;
2529
+ T.currentTarget = I;
2474
2530
  for (var V = 0; V < L.length; V++) {
2475
2531
  var me = L[V];
2476
- ct(me.options, y) && me.func(S);
2532
+ ut(me.options, y) && me.func(T);
2477
2533
  }
2478
2534
  }
2479
2535
  }
@@ -2488,9 +2544,9 @@ function Vo() {
2488
2544
  }, get passive() {
2489
2545
  return i.supportsPassive = !0;
2490
2546
  } }), t.events = i, i;
2491
- } }, Pt = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t) {
2492
- for (var e = 0, n = Pt.methodOrder; e < n.length; e++) {
2493
- var r = n[e], o = Pt[r](t);
2547
+ } }, Ot = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t) {
2548
+ for (var e = 0, n = Ot.methodOrder; e < n.length; e++) {
2549
+ var r = n[e], o = Ot[r](t);
2494
2550
  if (o) return o;
2495
2551
  }
2496
2552
  return null;
@@ -2511,7 +2567,7 @@ function Vo() {
2511
2567
  for (var a = 0, s = i.interactions.list; a < s.length; a++) {
2512
2568
  var l = s[a];
2513
2569
  if (l.pointerType === r) {
2514
- if (l.simulation && !xn(l, n)) continue;
2570
+ if (l.simulation && !wn(l, n)) continue;
2515
2571
  if (l.interacting()) return l;
2516
2572
  e || (e = l);
2517
2573
  }
@@ -2525,7 +2581,7 @@ function Vo() {
2525
2581
  }, hasPointer: function(t) {
2526
2582
  for (var e = t.pointerId, n = 0, r = t.scope.interactions.list; n < r.length; n++) {
2527
2583
  var o = r[n];
2528
- if (xn(o, e)) return o;
2584
+ if (wn(o, e)) return o;
2529
2585
  }
2530
2586
  return null;
2531
2587
  }, idle: function(t) {
@@ -2539,43 +2595,43 @@ function Vo() {
2539
2595
  }
2540
2596
  return null;
2541
2597
  } };
2542
- function xn(t, e) {
2598
+ function wn(t, e) {
2543
2599
  return t.pointers.some((function(n) {
2544
2600
  return n.id === e;
2545
2601
  }));
2546
2602
  }
2547
- var gr = Pt, Ot = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
2548
- function wn(t, e) {
2603
+ var gr = Ot, Dt = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
2604
+ function En(t, e) {
2549
2605
  return function(n) {
2550
- var r = e.interactions.list, o = $t(n), i = Vt(n), a = i[0], s = i[1], l = [];
2606
+ var r = e.interactions.list, o = Vt(n), i = Ut(n), a = i[0], s = i[1], l = [];
2551
2607
  if (/^touch/.test(n.type)) {
2552
2608
  e.prevTouchTime = e.now();
2553
2609
  for (var d = 0, c = n.changedTouches; d < c.length; d++) {
2554
- var f = c[d], y = { pointer: f, pointerId: je(f), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, S = En(y);
2555
- l.push([y.pointer, y.eventTarget, y.curEventTarget, S]);
2610
+ var f = c[d], y = { pointer: f, pointerId: je(f), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, T = kn(y);
2611
+ l.push([y.pointer, y.eventTarget, y.curEventTarget, T]);
2556
2612
  }
2557
2613
  } else {
2558
- var k = !1;
2559
- if (!ee.supportsPointerEvent && /mouse/.test(n.type)) {
2560
- for (var T = 0; T < r.length && !k; T++) k = r[T].pointerType !== "mouse" && r[T].pointerIsDown;
2561
- k = k || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
2614
+ var C = !1;
2615
+ if (!te.supportsPointerEvent && /mouse/.test(n.type)) {
2616
+ for (var M = 0; M < r.length && !C; M++) C = r[M].pointerType !== "mouse" && r[M].pointerIsDown;
2617
+ C = C || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
2562
2618
  }
2563
- if (!k) {
2564
- var I = { pointer: n, pointerId: je(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, R = En(I);
2619
+ if (!C) {
2620
+ var I = { pointer: n, pointerId: je(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, R = kn(I);
2565
2621
  l.push([I.pointer, I.eventTarget, I.curEventTarget, R]);
2566
2622
  }
2567
2623
  }
2568
- for (var O = 0; O < l.length; O++) {
2569
- var W = l[O], K = W[0], L = W[1], V = W[2];
2570
- W[3][t](K, n, L, V);
2624
+ for (var D = 0; D < l.length; D++) {
2625
+ var q = l[D], Q = q[0], L = q[1], V = q[2];
2626
+ q[3][t](Q, n, L, V);
2571
2627
  }
2572
2628
  };
2573
2629
  }
2574
- function En(t) {
2630
+ function kn(t) {
2575
2631
  var e = t.pointerType, n = t.scope, r = { interaction: gr.search(t), searchDetails: t };
2576
2632
  return n.fire("interactions:find", r), r.interaction || n.interactions.new({ pointerType: e });
2577
2633
  }
2578
- function Dt(t, e) {
2634
+ function Nt(t, e) {
2579
2635
  var n = t.doc, r = t.scope, o = t.options, i = r.interactions.docEvents, a = r.events, s = a[e];
2580
2636
  for (var l in r.browser.isIOS && !o.events && (o.events = { passive: !1 }), a.delegatedEvents) s(n, l, a.delegateListener), s(n, l, a.delegateUseCapture, !0);
2581
2637
  for (var d = o && o.events, c = 0; c < i.length; c++) {
@@ -2584,19 +2640,19 @@ function Vo() {
2584
2640
  }
2585
2641
  }
2586
2642
  var yr = { id: "core/interactions", install: function(t) {
2587
- for (var e = {}, n = 0; n < Ot.length; n++) {
2588
- var r = Ot[n];
2589
- e[r] = wn(r, t);
2643
+ for (var e = {}, n = 0; n < Dt.length; n++) {
2644
+ var r = Dt[n];
2645
+ e[r] = En(r, t);
2590
2646
  }
2591
- var o, i = ee.pEventTypes;
2647
+ var o, i = te.pEventTypes;
2592
2648
  function a() {
2593
2649
  for (var s = 0, l = t.interactions.list; s < l.length; s++) {
2594
2650
  var d = l[s];
2595
2651
  if (d.pointerIsDown && d.pointerType === "touch" && !d._interacting) for (var c = function() {
2596
- var S = y[f];
2597
- t.documents.some((function(k) {
2598
- return se(k.doc, S.downTarget);
2599
- })) || d.removePointer(S.pointer, S.event);
2652
+ var T = y[f];
2653
+ t.documents.some((function(C) {
2654
+ return se(C.doc, T.downTarget);
2655
+ })) || d.removePointer(T.pointer, T.event);
2600
2656
  }, f = 0, y = d.pointers; f < y.length; f++) c();
2601
2657
  }
2602
2658
  }
@@ -2604,8 +2660,8 @@ function Vo() {
2604
2660
  for (var l = 0, d = t.interactions.list; l < d.length; l++)
2605
2661
  d[l].documentBlur(s);
2606
2662
  } }), t.prevTouchTime = 0, t.Interaction = (function(s) {
2607
- _(d, s);
2608
- var l = A(d);
2663
+ S(d, s);
2664
+ var l = P(d);
2609
2665
  function d() {
2610
2666
  return g(this, d), l.apply(this, arguments);
2611
2667
  }
@@ -2622,21 +2678,21 @@ function Vo() {
2622
2678
  };
2623
2679
  var l = new t.Interaction(s);
2624
2680
  return t.interactions.list.push(l), l;
2625
- }, listeners: e, docEvents: o, pointerMoveTolerance: 1 }, t.usePlugin(cn);
2681
+ }, listeners: e, docEvents: o, pointerMoveTolerance: 1 }, t.usePlugin(un);
2626
2682
  }, listeners: { "scope:add-document": function(t) {
2627
- return Dt(t, "add");
2683
+ return Nt(t, "add");
2628
2684
  }, "scope:remove-document": function(t) {
2629
- return Dt(t, "remove");
2685
+ return Nt(t, "remove");
2630
2686
  }, "interactable:unset": function(t, e) {
2631
2687
  for (var n = t.interactable, r = e.interactions.list.length - 1; r >= 0; r--) {
2632
2688
  var o = e.interactions.list[r];
2633
2689
  o.interactable === n && (o.stop(), e.fire("interactions:destroy", { interaction: o }), o.destroy(), e.interactions.list.length > 2 && e.interactions.list.splice(r, 1));
2634
2690
  }
2635
- } }, onDocSignal: Dt, doOnInteractions: wn, methodNames: Ot }, br = yr, Me = (function(t) {
2691
+ } }, onDocSignal: Nt, doOnInteractions: En, methodNames: Dt }, br = yr, Me = (function(t) {
2636
2692
  return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
2637
2693
  })(Me || {}), xr = (function() {
2638
2694
  function t(e, n, r, o) {
2639
- g(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new bn(), 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 = te(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
2695
+ g(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 = ne(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
2640
2696
  }
2641
2697
  return x(t, [{ key: "_defaults", get: function() {
2642
2698
  return { base: {}, perAction: {}, actions: {} };
@@ -2644,21 +2700,21 @@ function Vo() {
2644
2700
  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;
2645
2701
  } }, { key: "updatePerActionListeners", value: function(e, n, r) {
2646
2702
  var o, i = this, a = (o = this._actions.map[e]) == null ? void 0 : o.filterEventType, s = function(l) {
2647
- return (a == null || a(l)) && at(l, i._actions);
2703
+ return (a == null || a(l)) && st(l, i._actions);
2648
2704
  };
2649
2705
  (b.array(n) || b.object(n)) && this._onOff(Me.Off, e, n, void 0, s), (b.array(r) || b.object(r)) && this._onOff(Me.On, e, r, void 0, s);
2650
2706
  } }, { key: "setPerAction", value: function(e, n) {
2651
2707
  var r = this._defaults;
2652
2708
  for (var o in n) {
2653
2709
  var i = o, a = this.options[e], s = n[i];
2654
- i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), b.array(s) ? a[i] = Xt(s) : b.plainObject(s) ? (a[i] = P(a[i] || {}, De(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;
2710
+ i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), b.array(s) ? a[i] = Gt(s) : b.plainObject(s) ? (a[i] = O(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;
2655
2711
  }
2656
2712
  } }, { key: "getRect", value: function(e) {
2657
2713
  return e = e || (b.element(this.target) ? this.target : null), b.string(this.target) && (e = e || this._context.querySelector(this.target)), we(e);
2658
2714
  } }, { key: "rectChecker", value: function(e) {
2659
2715
  var n = this;
2660
2716
  return b.func(e) ? (this.getRect = function(r) {
2661
- var o = P({}, e.apply(n, r));
2717
+ var o = O({}, e.apply(n, r));
2662
2718
  return "width" in o || (o.width = o.right - o.left, o.height = o.bottom - o.top), o;
2663
2719
  }, this) : e === null ? (delete this.getRect, this) : this.getRect;
2664
2720
  } }, { key: "_backCompatOption", value: function(e, n) {
@@ -2688,12 +2744,12 @@ function Vo() {
2688
2744
  return this.events.fire(e), this;
2689
2745
  } }, { key: "_onOff", value: function(e, n, r, o, i) {
2690
2746
  b.object(n) && !b.array(n) && (o = r, r = null);
2691
- var a = Ae(n, r, i);
2747
+ var a = Ie(n, r, i);
2692
2748
  for (var s in a) {
2693
- s === "wheel" && (s = ee.wheelEvent);
2749
+ s === "wheel" && (s = te.wheelEvent);
2694
2750
  for (var l = 0, d = a[s]; l < d.length; l++) {
2695
2751
  var c = d[l];
2696
- at(s, this._actions) ? this.events[e === Me.On ? "on" : "off"](s, c) : b.string(this.target) ? this._scopeEvents[e === Me.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, c, o) : this._scopeEvents[e === Me.On ? "add" : "remove"](this.target, s, c, o);
2752
+ st(s, this._actions) ? this.events[e === Me.On ? "on" : "off"](s, c) : b.string(this.target) ? this._scopeEvents[e === Me.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, c, o) : this._scopeEvents[e === Me.On ? "add" : "remove"](this.target, s, c, o);
2697
2753
  }
2698
2754
  }
2699
2755
  return this;
@@ -2703,9 +2759,9 @@ function Vo() {
2703
2759
  return this._onOff(Me.Off, e, n, r);
2704
2760
  } }, { key: "set", value: function(e) {
2705
2761
  var n = this._defaults;
2706
- for (var r in b.object(e) || (e = {}), this.options = De(n.base), this._actions.methodDict) {
2762
+ for (var r in b.object(e) || (e = {}), this.options = Ne(n.base), this._actions.methodDict) {
2707
2763
  var o = r, i = this._actions.methodDict[o];
2708
- this.options[o] = {}, this.setPerAction(o, P(P({}, n.perAction), n.actions[o])), this[i](e[o]);
2764
+ this.options[o] = {}, this.setPerAction(o, O(O({}, n.perAction), n.actions[o])), this[i](e[o]);
2709
2765
  }
2710
2766
  for (var a in e) a !== "getRect" ? b.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
2711
2767
  return this;
@@ -2728,7 +2784,7 @@ function Vo() {
2728
2784
  } });
2729
2785
  }
2730
2786
  return x(t, [{ key: "new", value: function(e, n) {
2731
- n = P(n || {}, { actions: this.scope.actions });
2787
+ n = O(n || {}, { actions: this.scope.actions });
2732
2788
  var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
2733
2789
  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;
2734
2790
  } }, { key: "getExisting", value: function(e, n) {
@@ -2745,12 +2801,12 @@ function Vo() {
2745
2801
  })(), Er = (function() {
2746
2802
  function t() {
2747
2803
  var e = this;
2748
- g(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = ee, this.defaults = De(dn), this.Eventable = bn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(r) {
2804
+ g(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = te, this.defaults = Ne(pn), this.Eventable = xn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(r) {
2749
2805
  var o = function i(a, s) {
2750
2806
  var l = r.interactables.getExisting(a, s);
2751
2807
  return l || ((l = r.interactables.new(a, s)).events.global = i.globalEvents), l;
2752
2808
  };
2753
- return o.getPointerAverage = Yt, o.getTouchBBox = gt, o.getTouchDistance = yt, o.getTouchAngle = bt, o.getElementRect = we, o.getElementClientRect = xe, o.matchesSelector = he, o.closest = de, o.globalEvents = {}, o.version = "1.10.27", o.scope = r, o.use = function(i, a) {
2809
+ return o.getPointerAverage = $t, o.getTouchBBox = yt, o.getTouchDistance = bt, o.getTouchAngle = xt, o.getElementRect = we, o.getElementClientRect = xe, o.matchesSelector = he, o.closest = pe, o.globalEvents = {}, o.version = "1.10.27", o.scope = r, o.use = function(i, a) {
2754
2810
  return this.scope.usePlugin(i, a), this;
2755
2811
  }, o.isSet = function(i, a) {
2756
2812
  return !!this.scope.interactables.get(i, a && a.context);
@@ -2766,7 +2822,7 @@ function Vo() {
2766
2822
  for (var f in i) this.on(f, i[f], a);
2767
2823
  return this;
2768
2824
  }
2769
- return at(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;
2825
+ return st(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;
2770
2826
  }), "The interact.on() method is being deprecated"), o.off = qe((function(i, a, s) {
2771
2827
  if (b.string(i) && i.search(" ") !== -1 && (i = i.trim().split(/ +/)), b.array(i)) {
2772
2828
  for (var l = 0, d = i; l < d.length; l++) {
@@ -2780,13 +2836,13 @@ function Vo() {
2780
2836
  return this;
2781
2837
  }
2782
2838
  var y;
2783
- return at(i, this.scope.actions) ? i in this.globalEvents && (y = this.globalEvents[i].indexOf(a)) !== -1 && this.globalEvents[i].splice(y, 1) : this.scope.events.remove(this.scope.document, i, a, s), this;
2839
+ return st(i, this.scope.actions) ? i in this.globalEvents && (y = this.globalEvents[i].indexOf(a)) !== -1 && this.globalEvents[i].splice(y, 1) : this.scope.events.remove(this.scope.document, i, a, s), this;
2784
2840
  }), "The interact.off() method is being deprecated"), o.debug = function() {
2785
2841
  return this.scope;
2786
2842
  }, o.supportsTouch = function() {
2787
- return ee.supportsTouch;
2843
+ return te.supportsTouch;
2788
2844
  }, o.supportsPointerEvent = function() {
2789
- return ee.supportsPointerEvent;
2845
+ return te.supportsPointerEvent;
2790
2846
  }, o.stop = function() {
2791
2847
  for (var i = 0, a = this.scope.interactions.list; i < a.length; i++) a[i].stop();
2792
2848
  return this;
@@ -2797,22 +2853,22 @@ function Vo() {
2797
2853
  }, o.removeDocument = function(i) {
2798
2854
  this.scope.removeDocument(i);
2799
2855
  }, o;
2800
- })(this), this.InteractEvent = At, this.Interactable = void 0, this.interactables = new wr(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(r) {
2856
+ })(this), this.InteractEvent = It, this.Interactable = void 0, this.interactables = new wr(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(r) {
2801
2857
  return e.removeDocument(r.target);
2802
2858
  };
2803
2859
  var n = this;
2804
2860
  this.Interactable = (function(r) {
2805
- _(i, r);
2806
- var o = A(i);
2861
+ S(i, r);
2862
+ var o = P(i);
2807
2863
  function i() {
2808
2864
  return g(this, i), o.apply(this, arguments);
2809
2865
  }
2810
2866
  return x(i, [{ key: "_defaults", get: function() {
2811
2867
  return n.defaults;
2812
2868
  } }, { key: "set", value: function(a) {
2813
- return N(M(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
2869
+ return G(_(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
2814
2870
  } }, { key: "unset", value: function() {
2815
- N(M(i.prototype), "unset", this).call(this);
2871
+ G(_(i.prototype), "unset", this).call(this);
2816
2872
  var a = n.interactables.list.indexOf(this);
2817
2873
  a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
2818
2874
  } }]), i;
@@ -2827,7 +2883,7 @@ function Vo() {
2827
2883
  }
2828
2884
  } }, { key: "init", value: function(e) {
2829
2885
  return this.isInitialized ? this : (function(n, r) {
2830
- return n.isInitialized = !0, b.window(r) && re(r), Y.init(r), ee.init(r), Te.init(r), n.window = r, n.document = r.document, n.usePlugin(br), n.usePlugin(mr), n;
2886
+ return n.isInitialized = !0, b.window(r) && Z(r), Y.init(r), te.init(r), Te.init(r), n.window = r, n.document = r.document, n.usePlugin(br), n.usePlugin(mr), n;
2831
2887
  })(this, e);
2832
2888
  } }, { key: "pluginIsInstalled", value: function(e) {
2833
2889
  var n = e.id;
@@ -2837,20 +2893,20 @@ function Vo() {
2837
2893
  if (this.pluginIsInstalled(e)) return this;
2838
2894
  if (e.id && (this._plugins.map[e.id] = e), this._plugins.list.push(e), e.install && e.install(this, n), e.listeners && e.before) {
2839
2895
  for (var r = 0, o = this.listenerMaps.length, i = e.before.reduce((function(s, l) {
2840
- return s[l] = !0, s[kn(l)] = !0, s;
2896
+ return s[l] = !0, s[Cn(l)] = !0, s;
2841
2897
  }), {}); r < o; r++) {
2842
2898
  var a = this.listenerMaps[r].id;
2843
- if (a && (i[a] || i[kn(a)])) break;
2899
+ if (a && (i[a] || i[Cn(a)])) break;
2844
2900
  }
2845
2901
  this.listenerMaps.splice(r, 0, { id: e.id, map: e.listeners });
2846
2902
  } else e.listeners && this.listenerMaps.push({ id: e.id, map: e.listeners });
2847
2903
  return this;
2848
2904
  } }, { key: "addDocument", value: function(e, n) {
2849
2905
  if (this.getDocIndex(e) !== -1) return !1;
2850
- var r = te(e);
2851
- n = n ? P({}, 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 });
2906
+ var r = ne(e);
2907
+ n = n ? O({}, 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 });
2852
2908
  } }, { key: "removeDocument", value: function(e) {
2853
- var n = this.getDocIndex(e), r = te(e), o = this.documents[n].options;
2909
+ var n = this.getDocIndex(e), r = ne(e), o = this.documents[n].options;
2854
2910
  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 });
2855
2911
  } }, { key: "getDocIndex", value: function(e) {
2856
2912
  for (var n = 0; n < this.documents.length; n++) if (this.documents[n].doc === e) return n;
@@ -2862,11 +2918,11 @@ function Vo() {
2862
2918
  return (this.window.Date || Date).now();
2863
2919
  } }]), t;
2864
2920
  })();
2865
- function kn(t) {
2921
+ function Cn(t) {
2866
2922
  return t && t.replace(/\/.*$/, "");
2867
2923
  }
2868
- var Cn = new Er(), ve = Cn.interactStatic, kr = typeof globalThis < "u" ? globalThis : window;
2869
- Cn.init(kr);
2924
+ var Sn = new Er(), ve = Sn.interactStatic, kr = typeof globalThis < "u" ? globalThis : window;
2925
+ Sn.init(kr);
2870
2926
  var Cr = Object.freeze({ __proto__: null, edgeTarget: function() {
2871
2927
  }, elements: function() {
2872
2928
  }, grid: function(t) {
@@ -2875,34 +2931,34 @@ function Vo() {
2875
2931
  return o in t || i in t;
2876
2932
  })), n = function(r, o) {
2877
2933
  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++) {
2878
- var y = e[f], S = y[0], k = y[1], T = Math.round((r - d.x) / t[S]), I = Math.round((o - d.y) / t[k]);
2879
- c[S] = Math.max(s.left, Math.min(s.right, T * t[S] + d.x)), c[k] = Math.max(s.top, Math.min(s.bottom, I * t[k] + d.y));
2934
+ var y = e[f], T = y[0], C = y[1], M = Math.round((r - d.x) / t[T]), I = Math.round((o - d.y) / t[C]);
2935
+ c[T] = Math.max(s.left, Math.min(s.right, M * t[T] + d.x)), c[C] = Math.max(s.top, Math.min(s.bottom, I * t[C] + d.y));
2880
2936
  }
2881
2937
  return c;
2882
2938
  };
2883
2939
  return n.grid = t, n.coordFields = e, n;
2884
2940
  } }), Sr = { id: "snappers", install: function(t) {
2885
2941
  var e = t.interactStatic;
2886
- e.snappers = P(e.snappers || {}, Cr), e.createSnapGrid = e.snappers.grid;
2942
+ e.snappers = O(e.snappers || {}, Cr), e.createSnapGrid = e.snappers.grid;
2887
2943
  } }, Tr = Sr, _r = { start: function(t) {
2888
2944
  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;
2889
- a === "preserve" && (a = n.width / n.height), e.startCoords = P({}, o), e.startRect = P({}, n), e.ratio = a, e.equalDelta = d;
2945
+ a === "preserve" && (a = n.width / n.height), e.startCoords = O({}, o), e.startRect = O({}, n), e.ratio = a, e.equalDelta = d;
2890
2946
  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 };
2891
2947
  if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
2892
2948
  var y = (f.left ? 1 : -1) * (f.top ? 1 : -1);
2893
2949
  e.edgeSign = { x: y, y };
2894
2950
  } else e.edgeSign = { x: f.left ? -1 : 1, y: f.top ? -1 : 1 };
2895
- if (s !== !1 && P(r, f), c != null && c.length) {
2896
- var S = new Rt(t.interaction);
2897
- S.copyFrom(t.interaction.modification), S.prepareStates(c), e.subModification = S, S.startAll(u({}, t));
2951
+ if (s !== !1 && O(r, f), c != null && c.length) {
2952
+ var T = new At(t.interaction);
2953
+ T.copyFrom(t.interaction.modification), T.prepareStates(c), e.subModification = T, T.startAll(u({}, t));
2898
2954
  }
2899
2955
  }, set: function(t) {
2900
- var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = P({}, r), a = e.equalDelta ? Mr : Rr;
2901
- if (P(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
2902
- var s = P({}, n);
2903
- et(o, s, { x: r.x - i.x, y: r.y - i.y });
2956
+ var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = O({}, r), a = e.equalDelta ? Mr : Rr;
2957
+ if (O(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
2958
+ var s = O({}, n);
2959
+ tt(o, s, { x: r.x - i.x, y: r.y - i.y });
2904
2960
  var l = e.subModification.setAll(u(u({}, t), {}, { rect: s, edges: o, pageCoords: r, prevCoords: r, prevRect: s })), d = l.delta;
2905
- return l.changed && (a(e, Math.abs(d.x) > Math.abs(d.y), l.coords, l.rect), P(r, l.coords)), l.eventProps;
2961
+ return l.changed && (a(e, Math.abs(d.x) > Math.abs(d.y), l.coords, l.rect), O(r, l.coords)), l.eventProps;
2906
2962
  }, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
2907
2963
  function Mr(t, e, n) {
2908
2964
  var r = t.startCoords, o = t.edgeSign;
@@ -2918,17 +2974,17 @@ function Vo() {
2918
2974
  n.x = i.x + (d - o.width) * s.x;
2919
2975
  }
2920
2976
  }
2921
- var Ar = _e(_r, "aspectRatio"), Sn = function() {
2977
+ var Ar = _e(_r, "aspectRatio"), Tn = function() {
2922
2978
  };
2923
- Sn._defaults = {};
2924
- var ut = Sn;
2925
- function Pe(t, e, n) {
2979
+ Tn._defaults = {};
2980
+ var dt = Tn;
2981
+ function Oe(t, e, n) {
2926
2982
  return b.func(t) ? ze(t, e.interactable, e.element, [n.x, n.y, e]) : ze(t, e.interactable, e.element);
2927
2983
  }
2928
- var dt = { start: function(t) {
2929
- var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l = P({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
2984
+ var pt = { start: function(t) {
2985
+ var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l = O({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
2930
2986
  if (e && s) {
2931
- var d = Pe(a.restriction, o, i);
2987
+ var d = Oe(a.restriction, o, i);
2932
2988
  if (d) {
2933
2989
  var c = d.right - d.left - e.width, f = d.bottom - d.top - e.height;
2934
2990
  c < 0 && (l.left += c, l.right += c), f < 0 && (l.top += f, l.bottom += f);
@@ -2937,104 +2993,104 @@ function Vo() {
2937
2993
  }
2938
2994
  r.offset = l;
2939
2995
  }, set: function(t) {
2940
- var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a = Pe(o.restriction, n, e);
2996
+ var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a = Oe(o.restriction, n, e);
2941
2997
  if (a) {
2942
2998
  var s = (function(l) {
2943
- return !l || "left" in l && "top" in l || ((l = P({}, 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;
2999
+ return !l || "left" in l && "top" in l || ((l = O({}, 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;
2944
3000
  })(a);
2945
3001
  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);
2946
3002
  }
2947
- }, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Ir = _e(dt, "restrict"), Tn = { 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 };
2948
- function Mn(t, e) {
3003
+ }, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Ir = _e(pt, "restrict"), _n = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, Mn = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
3004
+ function Rn(t, e) {
2949
3005
  for (var n = 0, r = ["top", "left", "bottom", "right"]; n < r.length; n++) {
2950
3006
  var o = r[n];
2951
3007
  o in t || (t[o] = e[o]);
2952
3008
  }
2953
3009
  return t;
2954
3010
  }
2955
- var $e = { noInner: Tn, noOuter: _n, start: function(t) {
3011
+ var $e = { noInner: _n, noOuter: Mn, start: function(t) {
2956
3012
  var e, n = t.interaction, r = t.startOffset, o = t.state, i = o.options;
2957
- i && (e = Ze(Pe(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 };
3013
+ i && (e = et(Oe(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 };
2958
3014
  }, set: function(t) {
2959
3015
  var e = t.coords, n = t.edges, r = t.interaction, o = t.state, i = o.offset, a = o.options;
2960
3016
  if (n) {
2961
- var s = P({}, e), l = Pe(a.inner, r, s) || {}, d = Pe(a.outer, r, s) || {};
2962
- Mn(l, Tn), 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));
3017
+ var s = O({}, e), l = Oe(a.inner, r, s) || {}, d = Oe(a.outer, r, s) || {};
3018
+ Rn(l, _n), Rn(d, Mn), 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));
2963
3019
  }
2964
- }, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Pr = _e($e, "restrictEdges"), Or = P({ get elementRect() {
3020
+ }, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Pr = _e($e, "restrictEdges"), Or = O({ get elementRect() {
2965
3021
  return { top: 0, left: 0, bottom: 1, right: 1 };
2966
3022
  }, set elementRect(t) {
2967
- } }, dt.defaults), Dr = _e({ start: dt.start, set: dt.set, defaults: Or }, "restrictRect"), Nr = { width: -1 / 0, height: -1 / 0 }, zr = { width: 1 / 0, height: 1 / 0 }, Lr = _e({ start: function(t) {
3023
+ } }, pt.defaults), Dr = _e({ start: pt.start, set: pt.set, defaults: Or }, "restrictRect"), Nr = { width: -1 / 0, height: -1 / 0 }, zr = { width: 1 / 0, height: 1 / 0 }, Lr = _e({ start: function(t) {
2968
3024
  return $e.start(t);
2969
3025
  }, set: function(t) {
2970
3026
  var e = t.interaction, n = t.state, r = t.rect, o = t.edges, i = n.options;
2971
3027
  if (o) {
2972
- var a = vt(Pe(i.min, e, t.coords)) || Nr, s = vt(Pe(i.max, e, t.coords)) || zr;
2973
- n.options = { endOnly: i.endOnly, inner: P({}, $e.noInner), outer: P({}, $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;
3028
+ var a = mt(Oe(i.min, e, t.coords)) || Nr, s = mt(Oe(i.max, e, t.coords)) || zr;
3029
+ n.options = { endOnly: i.endOnly, inner: O({}, $e.noInner), outer: O({}, $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;
2974
3030
  }
2975
- }, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), Nt = { start: function(t) {
3031
+ }, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), zt = { start: function(t) {
2976
3032
  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(y) {
2977
- var S = y.interaction.element, k = Ze(ze(y.state.options.origin, null, null, [S])), T = k || Le(y.interactable, S, y.interaction.prepared.name);
2978
- return T;
3033
+ var T = y.interaction.element, C = et(ze(y.state.options.origin, null, null, [T])), M = C || Le(y.interactable, T, y.interaction.prepared.name);
3034
+ return M;
2979
3035
  })(t) : { x: 0, y: 0 };
2980
3036
  if (l.offset === "startCoords") e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
2981
3037
  else {
2982
3038
  var c = ze(l.offset, r, o, [n]);
2983
- (e = Ze(c) || { x: 0, y: 0 }).x += d.x, e.y += d.y;
3039
+ (e = et(c) || { x: 0, y: 0 }).x += d.x, e.y += d.y;
2984
3040
  }
2985
3041
  var f = l.relativePoints;
2986
- a.offsets = i && f && f.length ? f.map((function(y, S) {
2987
- return { index: S, relativePoint: y, x: s.left - i.width * y.x + e.x, y: s.top - i.height * y.y + e.y };
3042
+ a.offsets = i && f && f.length ? f.map((function(y, T) {
3043
+ return { index: T, relativePoint: y, x: s.left - i.width * y.x + e.x, y: s.top - i.height * y.y + e.y };
2988
3044
  })) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
2989
3045
  }, set: function(t) {
2990
- var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = Le(e.interactable, e.element, e.prepared.name), s = P({}, n), l = [];
3046
+ var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = Le(e.interactable, e.element, e.prepared.name), s = O({}, n), l = [];
2991
3047
  o.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
2992
- for (var d = 0, c = i; d < c.length; d++) for (var f = c[d], y = s.x - f.x, S = s.y - f.y, k = 0, T = o.targets.length; k < T; k++) {
2993
- var I = o.targets[k], R = void 0;
2994
- (R = b.func(I) ? I(y, S, e._proxy, f, k) : I) && l.push({ x: (b.number(R.x) ? R.x : y) + f.x, y: (b.number(R.y) ? R.y : S) + f.y, range: b.number(R.range) ? R.range : o.range, source: I, index: k, offset: f });
3048
+ for (var d = 0, c = i; d < c.length; d++) for (var f = c[d], y = s.x - f.x, T = s.y - f.y, C = 0, M = o.targets.length; C < M; C++) {
3049
+ var I = o.targets[C], R = void 0;
3050
+ (R = b.func(I) ? I(y, T, e._proxy, f, C) : I) && l.push({ x: (b.number(R.x) ? R.x : y) + f.x, y: (b.number(R.y) ? R.y : T) + f.y, range: b.number(R.range) ? R.range : o.range, source: I, index: C, offset: f });
2995
3051
  }
2996
- for (var O = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, W = 0; W < l.length; W++) {
2997
- var K = l[W], L = K.range, V = K.x - s.x, me = K.y - s.y, ae = Fe(V, me), ge = ae <= L;
2998
- L === 1 / 0 && O.inRange && O.range !== 1 / 0 && (ge = !1), O.target && !(ge ? O.inRange && L !== 1 / 0 ? ae / L < O.distance / O.range : L === 1 / 0 && O.range !== 1 / 0 || ae < O.distance : !O.inRange && ae < O.distance) || (O.target = K, O.distance = ae, O.range = L, O.inRange = ge, O.delta.x = V, O.delta.y = me);
3052
+ for (var D = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, q = 0; q < l.length; q++) {
3053
+ var Q = l[q], L = Q.range, V = Q.x - s.x, me = Q.y - s.y, ae = Fe(V, me), ge = ae <= L;
3054
+ L === 1 / 0 && D.inRange && D.range !== 1 / 0 && (ge = !1), D.target && !(ge ? D.inRange && L !== 1 / 0 ? ae / L < D.distance / D.range : L === 1 / 0 && D.range !== 1 / 0 || ae < D.distance : !D.inRange && ae < D.distance) || (D.target = Q, D.distance = ae, D.range = L, D.inRange = ge, D.delta.x = V, D.delta.y = me);
2999
3055
  }
3000
- return O.inRange && (n.x = O.target.x, n.y = O.target.y), r.closest = O, O;
3001
- }, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Fr = _e(Nt, "snap"), pt = { start: function(t) {
3056
+ return D.inRange && (n.x = D.target.x, n.y = D.target.y), r.closest = D, D;
3057
+ }, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Fr = _e(zt, "snap"), ft = { start: function(t) {
3002
3058
  var e = t.state, n = t.edges, r = e.options;
3003
3059
  if (!n) return null;
3004
- 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"]], Nt.start(t), e.offsets = t.state.offsets, t.state = e;
3060
+ 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;
3005
3061
  }, set: function(t) {
3006
3062
  var e = t.interaction, n = t.state, r = t.coords, o = n.options, i = n.offsets, a = { x: r.x - i[0].x, y: r.y - i[0].y };
3007
- n.options = P({}, o), n.options.targets = [];
3063
+ n.options = O({}, o), n.options.targets = [];
3008
3064
  for (var s = 0, l = o.targets || []; s < l.length; s++) {
3009
3065
  var d = l[s], c = void 0;
3010
3066
  if (c = b.func(d) ? d(a.x, a.y, e) : d) {
3011
3067
  for (var f = 0, y = n.targetFields; f < y.length; f++) {
3012
- var S = y[f], k = S[0], T = S[1];
3013
- if (k in c || T in c) {
3014
- c.x = c[k], c.y = c[T];
3068
+ var T = y[f], C = T[0], M = T[1];
3069
+ if (C in c || M in c) {
3070
+ c.x = c[C], c.y = c[M];
3015
3071
  break;
3016
3072
  }
3017
3073
  }
3018
3074
  n.options.targets.push(c);
3019
3075
  }
3020
3076
  }
3021
- var I = Nt.set(t);
3077
+ var I = zt.set(t);
3022
3078
  return n.options = o, I;
3023
- }, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = _e(pt, "snapSize"), zt = { aspectRatio: Ar, restrictEdges: Pr, restrict: Ir, restrictRect: Dr, restrictSize: Lr, snapEdges: _e({ start: function(t) {
3079
+ }, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = _e(ft, "snapSize"), Lt = { aspectRatio: Ar, restrictEdges: Pr, restrict: Ir, restrictRect: Dr, restrictSize: Lr, snapEdges: _e({ start: function(t) {
3024
3080
  var e = t.edges;
3025
- return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], pt.start(t)) : null;
3026
- }, set: pt.set, defaults: P(De(pt.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Fr, snapSize: jr, spring: ut, avoid: ut, transform: ut, rubberband: ut }, Hr = { id: "modifiers", install: function(t) {
3081
+ return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], ft.start(t)) : null;
3082
+ }, set: ft.set, defaults: O(Ne(ft.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Fr, snapSize: jr, spring: dt, avoid: dt, transform: dt, rubberband: dt }, Hr = { id: "modifiers", install: function(t) {
3027
3083
  var e = t.interactStatic;
3028
- for (var n in t.usePlugin(un), t.usePlugin(Tr), e.modifiers = zt, zt) {
3029
- var r = zt[n], o = r._defaults, i = r._methods;
3084
+ for (var n in t.usePlugin(dn), t.usePlugin(Tr), e.modifiers = Lt, Lt) {
3085
+ var r = Lt[n], o = r._defaults, i = r._methods;
3030
3086
  o._methods = i, t.defaults.perAction[n] = o;
3031
3087
  }
3032
- } }, Br = Hr, Rn = (function(t) {
3033
- _(n, t);
3034
- var e = A(n);
3088
+ } }, Br = Hr, An = (function(t) {
3089
+ S(n, t);
3090
+ var e = P(n);
3035
3091
  function n(r, o, i, a, s, l) {
3036
3092
  var d;
3037
- if (g(this, n), tt(U(d = e.call(this, s)), i), i !== o && tt(U(d), o), d.timeStamp = l, d.originalEvent = i, d.type = r, d.pointerId = je(o), d.pointerType = $t(o), d.target = a, d.currentTarget = null, r === "tap") {
3093
+ if (g(this, n), nt(B(d = e.call(this, s)), i), i !== o && nt(B(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") {
3038
3094
  var c = s.getPointerIndex(o);
3039
3095
  d.dt = d.timeStamp - s.pointers[c].downTime;
3040
3096
  var f = d.timeStamp - s.tapTime;
@@ -3051,8 +3107,8 @@ function Vo() {
3051
3107
  } }, { key: "preventDefault", value: function() {
3052
3108
  this.originalEvent.preventDefault();
3053
3109
  } }]), n;
3054
- })(ot), Ve = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
3055
- t.pointerEvents = Ve, t.defaults.actions.pointerEvents = Ve.defaults, P(t.actions.phaselessTypes, Ve.types);
3110
+ })(it), Ve = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
3111
+ t.pointerEvents = Ve, t.defaults.actions.pointerEvents = Ve.defaults, O(t.actions.phaselessTypes, Ve.types);
3056
3112
  }, listeners: { "interactions:new": function(t) {
3057
3113
  var e = t.interaction;
3058
3114
  e.prevTap = null, e.tapTime = 0;
@@ -3061,59 +3117,59 @@ function Vo() {
3061
3117
  !e && n.hold || (n.hold = { duration: 1 / 0, timeout: null });
3062
3118
  }, "interactions:move": function(t, e) {
3063
3119
  var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget;
3064
- t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && Lt(t), Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "move" }, e));
3120
+ t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && Ft(t), Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "move" }, e));
3065
3121
  }, "interactions:down": function(t, e) {
3066
3122
  (function(n, r) {
3067
3123
  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 }, y = 0; y < c.length; y++) {
3068
- var S = c[y];
3069
- f.node = S, r.fire("pointerEvents:collect-targets", f);
3124
+ var T = c[y];
3125
+ f.node = T, r.fire("pointerEvents:collect-targets", f);
3070
3126
  }
3071
3127
  if (f.targets.length) {
3072
- for (var k = 1 / 0, T = 0, I = f.targets; T < I.length; T++) {
3073
- var R = I[T].eventable.options.holdDuration;
3074
- R < k && (k = R);
3128
+ for (var C = 1 / 0, M = 0, I = f.targets; M < I.length; M++) {
3129
+ var R = I[M].eventable.options.holdDuration;
3130
+ R < C && (C = R);
3075
3131
  }
3076
- d.duration = k, d.timeout = setTimeout((function() {
3132
+ d.duration = C, d.timeout = setTimeout((function() {
3077
3133
  Re({ interaction: o, eventTarget: s, pointer: i, event: a, type: "hold" }, r);
3078
- }), k);
3134
+ }), C);
3079
3135
  }
3080
3136
  })(t, e), Re(t, e);
3081
3137
  }, "interactions:up": function(t, e) {
3082
- Lt(t), Re(t, e), (function(n, r) {
3138
+ Ft(t), Re(t, e), (function(n, r) {
3083
3139
  var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget;
3084
3140
  o.pointerWasMoved || Re({ interaction: o, eventTarget: s, pointer: i, event: a, type: "tap" }, r);
3085
3141
  })(t, e);
3086
3142
  }, "interactions:cancel": function(t, e) {
3087
- Lt(t), Re(t, e);
3088
- } }, PointerEvent: Rn, fire: Re, collectEventTargets: An, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: !0, move: !0, up: !0, cancel: !0, tap: !0, doubletap: !0, hold: !0 } };
3143
+ Ft(t), Re(t, e);
3144
+ } }, PointerEvent: An, fire: Re, collectEventTargets: In, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: !0, move: !0, up: !0, cancel: !0, tap: !0, doubletap: !0, hold: !0 } };
3089
3145
  function Re(t, e) {
3090
- var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = t.targets, l = s === void 0 ? An(t, e) : s, d = new Rn(a, r, o, i, n, e.now());
3146
+ 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 An(a, r, o, i, n, e.now());
3091
3147
  e.fire("pointerEvents:new", { pointerEvent: d });
3092
3148
  for (var c = { interaction: n, pointer: r, event: o, eventTarget: i, targets: l, type: a, pointerEvent: d }, f = 0; f < l.length; f++) {
3093
3149
  var y = l[f];
3094
- for (var S in y.props || {}) d[S] = y.props[S];
3095
- var k = Le(y.eventable, y.node);
3096
- if (d._subtractOrigin(k), d.eventable = y.eventable, d.currentTarget = y.node, y.eventable.fire(d), d._addOrigin(k), d.immediatePropagationStopped || d.propagationStopped && f + 1 < l.length && l[f + 1].node !== d.currentTarget) break;
3150
+ for (var T in y.props || {}) d[T] = y.props[T];
3151
+ var C = Le(y.eventable, y.node);
3152
+ if (d._subtractOrigin(C), d.eventable = y.eventable, d.currentTarget = y.node, y.eventable.fire(d), d._addOrigin(C), d.immediatePropagationStopped || d.propagationStopped && f + 1 < l.length && l[f + 1].node !== d.currentTarget) break;
3097
3153
  }
3098
3154
  if (e.fire("pointerEvents:fired", c), a === "tap") {
3099
- var T = d.double ? Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : d;
3100
- n.prevTap = T, n.tapTime = T.timeStamp;
3155
+ var M = d.double ? Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : d;
3156
+ n.prevTap = M, n.tapTime = M.timeStamp;
3101
3157
  }
3102
3158
  return d;
3103
3159
  }
3104
- function An(t, e) {
3160
+ function In(t, e) {
3105
3161
  var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = n.getPointerIndex(r), l = n.pointers[s];
3106
3162
  if (a === "tap" && (n.pointerWasMoved || !l || l.downTarget !== i)) return [];
3107
3163
  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++) {
3108
3164
  var y = d[f];
3109
3165
  c.node = y, e.fire("pointerEvents:collect-targets", c);
3110
3166
  }
3111
- return a === "hold" && (c.targets = c.targets.filter((function(S) {
3112
- var k, T;
3113
- return S.eventable.options.holdDuration === ((k = n.pointers[s]) == null || (T = k.hold) == null ? void 0 : T.duration);
3167
+ return a === "hold" && (c.targets = c.targets.filter((function(T) {
3168
+ var C, M;
3169
+ return T.eventable.options.holdDuration === ((C = n.pointers[s]) == null || (M = C.hold) == null ? void 0 : M.duration);
3114
3170
  }))), c.targets;
3115
3171
  }
3116
- function Lt(t) {
3172
+ function Ft(t) {
3117
3173
  var e = t.interaction, n = t.pointerIndex, r = e.pointers[n].hold;
3118
3174
  r && r.timeout && (clearTimeout(r.timeout), r.timeout = null);
3119
3175
  }
@@ -3142,7 +3198,7 @@ function Vo() {
3142
3198
  } }) }, $r = Yr, Vr = { id: "pointer-events/interactableTargets", install: function(t) {
3143
3199
  var e = t.Interactable;
3144
3200
  e.prototype.pointerEvents = function(r) {
3145
- return P(this.events.options, r), this;
3201
+ return O(this.events.options, r), this;
3146
3202
  };
3147
3203
  var n = e.prototype._backCompatOption;
3148
3204
  e.prototype._backCompatOption = function(r, o) {
@@ -3162,7 +3218,7 @@ function Vo() {
3162
3218
  };
3163
3219
  }, "interactable:set": function(t, e) {
3164
3220
  var n = t.interactable, r = t.options;
3165
- P(n.events.options, e.pointerEvents.defaults), P(n.events.options, r.pointerEvents || {});
3221
+ O(n.events.options, e.pointerEvents.defaults), O(n.events.options, r.pointerEvents || {});
3166
3222
  } } }, Ur = Vr, Xr = { id: "pointer-events", install: function(t) {
3167
3223
  t.usePlugin(qr), t.usePlugin($r), t.usePlugin(Ur);
3168
3224
  } }, Gr = Xr, Kr = { id: "reflow", install: function(t) {
@@ -3172,14 +3228,14 @@ function Vo() {
3172
3228
  for (var a = r.getAllElements(), s = i.window.Promise, l = s ? [] : null, d = function() {
3173
3229
  var f = a[c], y = r.getRect(f);
3174
3230
  if (!y) return 1;
3175
- var S, k = Be(i.interactions.list, (function(R) {
3231
+ var T, C = Be(i.interactions.list, (function(R) {
3176
3232
  return R.interacting() && R.interactable === r && R.element === f && R.prepared.name === o.name;
3177
3233
  }));
3178
- if (k) k.move(), l && (S = k._reflowPromise || new s((function(R) {
3179
- k._reflowResolve = R;
3234
+ if (C) C.move(), l && (T = C._reflowPromise || new s((function(R) {
3235
+ C._reflowResolve = R;
3180
3236
  })));
3181
3237
  else {
3182
- var T = vt(y), I = /* @__PURE__ */ (function(R) {
3238
+ var M = mt(y), I = /* @__PURE__ */ (function(R) {
3183
3239
  return { coords: R, get page() {
3184
3240
  return this.coords.page;
3185
3241
  }, get client() {
@@ -3206,17 +3262,17 @@ function Vo() {
3206
3262
  return this.coords.buttons;
3207
3263
  }, preventDefault: function() {
3208
3264
  } };
3209
- })({ page: { x: T.x, y: T.y }, client: { x: T.x, y: T.y }, timeStamp: i.now() });
3210
- S = (function(R, O, W, K, L) {
3211
- var V = R.interactions.new({ pointerType: "reflow" }), me = { interaction: V, event: L, pointer: L, eventTarget: W, phase: "reflow" };
3212
- V.interactable = O, V.element = W, V.prevEvent = L, V.updatePointer(L, L, W, !0), Bt(V.coords.delta), St(V.prepared, K), V._doPhase(me);
3265
+ })({ page: { x: M.x, y: M.y }, client: { x: M.x, y: M.y }, timeStamp: i.now() });
3266
+ T = (function(R, D, q, Q, L) {
3267
+ var V = R.interactions.new({ pointerType: "reflow" }), me = { interaction: V, event: L, pointer: L, eventTarget: q, phase: "reflow" };
3268
+ V.interactable = D, V.element = q, V.prevEvent = L, V.updatePointer(L, L, q, !0), qt(V.coords.delta), Tt(V.prepared, Q), V._doPhase(me);
3213
3269
  var ae = R.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
3214
3270
  V._reflowResolve = Se;
3215
3271
  })) : void 0;
3216
- return V._reflowPromise = be, V.start(K, O, W), V._interacting ? (V.move(me), V.end(L)) : (V.stop(), V._reflowResolve()), V.removePointer(L, L), be;
3272
+ return V._reflowPromise = be, V.start(Q, D, q), V._interacting ? (V.move(me), V.end(L)) : (V.stop(), V._reflowResolve()), V.removePointer(L, L), be;
3217
3273
  })(i, r, f, o, I);
3218
3274
  }
3219
- l && l.push(S);
3275
+ l && l.push(T);
3220
3276
  }, c = 0; c < a.length && !d(); c++) ;
3221
3277
  return l && s.all(l).then((function() {
3222
3278
  return r;
@@ -3229,16 +3285,16 @@ function Vo() {
3229
3285
  r.splice(r.indexOf(o), 1);
3230
3286
  })(e.interactions.list, n));
3231
3287
  } } }, Jr = Kr;
3232
- if (ve.use(cn), ve.use(vn), ve.use(Gr), ve.use(hr), ve.use(Br), ve.use(nr), ve.use($n), ve.use(Un), ve.use(Jr), ve.default = ve, m(v) === "object" && v) try {
3288
+ if (ve.use(un), ve.use(mn), ve.use(Gr), ve.use(hr), ve.use(Br), ve.use(nr), ve.use($n), ve.use(Un), ve.use(Jr), ve.default = ve, m(v) === "object" && v) try {
3233
3289
  v.exports = ve;
3234
3290
  } catch {
3235
3291
  }
3236
3292
  return ve.default = ve, ve;
3237
3293
  }));
3238
- })(Ke, Ke.exports)), Ke.exports;
3294
+ })(Je, Je.exports)), Je.exports;
3239
3295
  }
3240
- var Uo = /* @__PURE__ */ Vo();
3241
- const jt = /* @__PURE__ */ Yo(Uo);
3296
+ var Xo = /* @__PURE__ */ Uo();
3297
+ const Ht = /* @__PURE__ */ $o(Xo);
3242
3298
  function On(v) {
3243
3299
  const h = document.createElement("input");
3244
3300
  h.type = "file", h.accept = "image/*", h.onchange = (p) => {
@@ -3246,43 +3302,43 @@ function On(v) {
3246
3302
  if (u) {
3247
3303
  const m = new FileReader();
3248
3304
  m.onload = (g) => {
3249
- const E = document.createElement("img");
3250
- E.src = g.target?.result, E.style.maxWidth = "100%", E.style.width = "100%", E.style.height = "auto", E.style.cursor = "pointer", E.draggable = !1;
3305
+ const w = document.createElement("img");
3306
+ w.src = g.target?.result, w.style.maxWidth = "100%", w.style.width = "100%", w.style.height = "auto", w.style.cursor = "pointer", w.draggable = !1;
3251
3307
  const x = document.createElement("div");
3252
- x.className = "editor-image-wrapper", x.style.display = "inline-block", x.style.position = "relative", x.style.maxWidth = "100%", x.style.width = "auto", x.style.height = "auto", x.contentEditable = "false", x.style.boxSizing = "border-box", x.style.touchAction = "none", x.style.userSelect = "none", x.appendChild(E);
3253
- const C = document.createElement("div");
3254
- C.contentEditable = "true", C.style.margin = "10px 0", C.style.textAlign = "left", C.style.display = "block", C.appendChild(x);
3308
+ x.className = "editor-image-wrapper", x.style.display = "inline-block", x.style.position = "relative", x.style.maxWidth = "100%", x.style.width = "auto", x.style.height = "auto", x.contentEditable = "false", x.style.boxSizing = "border-box", x.style.touchAction = "none", x.style.userSelect = "none", x.appendChild(w);
3309
+ const k = document.createElement("div");
3310
+ k.contentEditable = "true", k.style.margin = "10px 0", k.style.textAlign = "left", k.style.display = "block", k.appendChild(x);
3255
3311
  try {
3256
- Ne();
3257
- const _ = window.getSelection();
3258
- if (_ && _.rangeCount > 0) {
3259
- _.getRangeAt(0).insertNode(C), _.removeAllRanges();
3260
- const D = document.createRange();
3261
- D.setStartAfter(C), D.collapse(!0), _.addRange(D), pe(D);
3312
+ Ae();
3313
+ const S = window.getSelection();
3314
+ if (S && S.rangeCount > 0) {
3315
+ S.getRangeAt(0).insertNode(k), S.removeAllRanges();
3316
+ const A = document.createRange();
3317
+ A.setStartAfter(k), A.collapse(!0), S.addRange(A), de(A);
3262
3318
  } else
3263
- v.appendChild(C), v.focus(), pe();
3319
+ v.appendChild(k), v.focus(), de();
3264
3320
  } catch {
3265
- v.appendChild(C), v.focus(), pe();
3321
+ v.appendChild(k), v.focus(), de();
3266
3322
  }
3267
3323
  v.dispatchEvent(new Event("input", { bubbles: !0 })), v.focus();
3268
3324
  }, m.readAsDataURL(u);
3269
3325
  }
3270
3326
  }, h.click();
3271
3327
  }
3272
- function Xo(v) {
3328
+ function Go(v) {
3273
3329
  let h = null;
3274
3330
  if (v.tagName === "IMG" ? h = v.parentElement : h = v, !h) return;
3275
3331
  const p = h.querySelector("img");
3276
3332
  if (p)
3277
3333
  if (h.classList.contains("resizable")) {
3278
3334
  const u = h.getBoundingClientRect(), m = Math.round(u.width) + "px", g = Math.round(u.height) + "px";
3279
- jt(h).unset(), h.classList.remove("resizable"), h.style.border = "none", h.style.transform = "", h.dataset.x = "", h.dataset.y = "", h.style.width = m, h.style.height = g, h.contentEditable = "false", p && (p.style.width = "100%", p.style.height = "100%");
3280
- const E = h.closest(".editor");
3281
- E && E.dispatchEvent(new Event("input", { bubbles: !0 }));
3335
+ Ht(h).unset(), h.classList.remove("resizable"), h.style.border = "none", h.style.transform = "", h.dataset.x = "", h.dataset.y = "", h.style.width = m, h.style.height = g, h.contentEditable = "false", p && (p.style.width = "100%", p.style.height = "100%");
3336
+ const w = h.closest(".editor");
3337
+ w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
3282
3338
  } else {
3283
3339
  h.classList.add("resizable"), h.style.border = "2px dashed #007bff", h.style.position = "relative", h.style.userSelect = "none";
3284
3340
  const u = h.getBoundingClientRect();
3285
- h.style.width = u.width + "px", h.style.height = u.height + "px", p && (p.style.width = "100%", p.style.height = "100%"), jt(h).resizable({
3341
+ h.style.width = u.width + "px", h.style.height = u.height + "px", p && (p.style.width = "100%", p.style.height = "100%"), Ht(h).resizable({
3286
3342
  edges: { left: !0, right: !0, bottom: !0, top: !0 },
3287
3343
  listeners: {
3288
3344
  move: (m) => {
@@ -3291,34 +3347,34 @@ function Xo(v) {
3291
3347
  width: `${m.rect.width}px`,
3292
3348
  height: `${m.rect.height}px`
3293
3349
  });
3294
- const E = g.closest(".editor");
3295
- E && E.dispatchEvent(new Event("input", { bubbles: !0 }));
3350
+ const w = g.closest(".editor");
3351
+ w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
3296
3352
  },
3297
3353
  end: (m) => {
3298
- const E = m.target.closest(".editor");
3299
- E && E.dispatchEvent(new Event("input", { bubbles: !0 }));
3354
+ const w = m.target.closest(".editor");
3355
+ w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
3300
3356
  }
3301
3357
  },
3302
3358
  modifiers: [
3303
- jt.modifiers.restrictSize({ min: { width: 50, height: 50 } })
3359
+ Ht.modifiers.restrictSize({ min: { width: 50, height: 50 } })
3304
3360
  ],
3305
3361
  inertia: !0
3306
3362
  });
3307
3363
  }
3308
3364
  }
3309
- class Go {
3365
+ class Ko {
3310
3366
  container;
3311
3367
  toolbar;
3312
3368
  editor;
3313
3369
  constructor() {
3314
- this.container = document.createElement("div"), this.container.classList.add("editor-container"), this.editor = Wo(
3370
+ this.container = document.createElement("div"), this.container.classList.add("editor-container"), this.editor = Yo(
3315
3371
  () => On(this.editor),
3316
- (p) => Xo(p)
3317
- ), this.toolbar = Bo(this.container);
3372
+ (p) => Go(p)
3373
+ ), this.toolbar = qo(this.container);
3318
3374
  const h = this.toolbar.querySelector(
3319
3375
  '[role="button"][title="Insert Image"]'
3320
3376
  );
3321
- h && (h.addEventListener("mousedown", () => pe()), h.onclick = () => On(this.editor)), this.container.appendChild(this.toolbar), this.container.appendChild(this.editor);
3377
+ h && (h.addEventListener("mousedown", () => de()), h.onclick = () => On(this.editor)), this.container.appendChild(this.toolbar), this.container.appendChild(this.editor);
3322
3378
  }
3323
3379
  getElement() {
3324
3380
  return this.container;
@@ -3335,44 +3391,44 @@ class Go {
3335
3391
  return;
3336
3392
  const u = p.parentElement;
3337
3393
  if (u && u.classList.contains("editor-image-wrapper")) {
3338
- const D = p;
3339
- D.style.maxWidth = "100%", D.style.width = "100%", D.style.height = "auto", D.style.cursor = "pointer", D.draggable = !1, u.contentEditable = "false", u.style.display || (u.style.display = "inline-block"), u.style.position || (u.style.position = "relative"), u.style.maxWidth = "100%", u.style.boxSizing = "border-box", u.style.touchAction = "none", u.style.userSelect = "none", (!u.style.width || u.style.width === "0px") && (u.style.width = "300px");
3394
+ const A = p;
3395
+ A.style.maxWidth = "100%", A.style.width = "100%", A.style.height = "auto", A.style.cursor = "pointer", A.draggable = !1, u.contentEditable = "false", u.style.display || (u.style.display = "inline-block"), u.style.position || (u.style.position = "relative"), u.style.maxWidth = "100%", u.style.boxSizing = "border-box", u.style.touchAction = "none", u.style.userSelect = "none", (!u.style.width || u.style.width === "0px") && (u.style.width = "300px");
3340
3396
  return;
3341
3397
  }
3342
3398
  const m = document.createElement("div");
3343
3399
  m.className = "editor-image-wrapper", m.style.display = "inline-block", m.style.position = "relative", m.style.maxWidth = "100%", m.style.width = "300px", m.contentEditable = "false", m.style.userSelect = "none", m.style.boxSizing = "border-box", m.style.touchAction = "none";
3344
3400
  const g = p;
3345
3401
  g.style.maxWidth = "100%", g.style.width = "100%", g.style.height = "auto", g.style.cursor = "pointer", g.draggable = !1;
3346
- const E = (D) => {
3347
- if (!D) return null;
3348
- const U = String(D).match(/(\d+(?:\.\d+)?)/);
3349
- if (!U) return null;
3350
- const A = Math.round(Number(U[1]));
3351
- return Number.isFinite(A) && A > 0 ? A : null;
3352
- }, x = E(g.getAttribute("width")) ?? E(g.style.width) ?? E(g.getAttribute("style"));
3402
+ const w = (A) => {
3403
+ if (!A) return null;
3404
+ const B = String(A).match(/(\d+(?:\.\d+)?)/);
3405
+ if (!B) return null;
3406
+ const P = Math.round(Number(B[1]));
3407
+ return Number.isFinite(P) && P > 0 ? P : null;
3408
+ }, x = w(g.getAttribute("width")) ?? w(g.style.width) ?? w(g.getAttribute("style"));
3353
3409
  x ? m.style.width = `${x}px` : g.onload = () => {
3354
- const D = this.editor.clientWidth || 0, U = g.naturalWidth || 0;
3355
- if (U > 0) {
3356
- const A = D > 0 ? Math.min(U, D) : U;
3357
- m.style.width = `${A}px`;
3410
+ const A = this.editor.clientWidth || 0, B = g.naturalWidth || 0;
3411
+ if (B > 0) {
3412
+ const P = A > 0 ? Math.min(B, A) : B;
3413
+ m.style.width = `${P}px`;
3358
3414
  }
3359
3415
  };
3360
- const C = document.createElement("p");
3361
- C.style.margin = "10px 0", C.style.textAlign = "left", C.style.display = "block";
3362
- const _ = g.closest("figure") ?? g.closest(".se-image-container") ?? g, M = _.parentNode;
3363
- M && this.editor.contains(_) && M.contains(_) && (m.appendChild(g), C.appendChild(m), M.replaceChild(C, _));
3416
+ const k = document.createElement("p");
3417
+ k.style.margin = "10px 0", k.style.textAlign = "left", k.style.display = "block";
3418
+ const S = g.closest("figure") ?? g.closest(".se-image-container") ?? g, _ = S.parentNode;
3419
+ _ && this.editor.contains(S) && _.contains(S) && (m.appendChild(g), k.appendChild(m), _.replaceChild(k, S));
3364
3420
  }), this.editor.dispatchEvent(new Event("input", { bubbles: !0 }));
3365
3421
  }
3366
3422
  }
3367
- var ht = { exports: {} }, Xe = {};
3423
+ var vt = { exports: {} }, Ge = {};
3368
3424
  var Dn;
3369
- function Ko() {
3370
- if (Dn) return Xe;
3425
+ function Jo() {
3426
+ if (Dn) return Ge;
3371
3427
  Dn = 1;
3372
3428
  var v = Symbol.for("react.transitional.element"), h = Symbol.for("react.fragment");
3373
3429
  function p(u, m, g) {
3374
- var E = null;
3375
- if (g !== void 0 && (E = "" + g), m.key !== void 0 && (E = "" + m.key), "key" in m) {
3430
+ var w = null;
3431
+ if (g !== void 0 && (w = "" + g), m.key !== void 0 && (w = "" + m.key), "key" in m) {
3376
3432
  g = {};
3377
3433
  for (var x in m)
3378
3434
  x !== "key" && (g[x] = m[x]);
@@ -3380,173 +3436,173 @@ function Ko() {
3380
3436
  return m = g.ref, {
3381
3437
  $$typeof: v,
3382
3438
  type: u,
3383
- key: E,
3439
+ key: w,
3384
3440
  ref: m !== void 0 ? m : null,
3385
3441
  props: g
3386
3442
  };
3387
3443
  }
3388
- return Xe.Fragment = h, Xe.jsx = p, Xe.jsxs = p, Xe;
3444
+ return Ge.Fragment = h, Ge.jsx = p, Ge.jsxs = p, Ge;
3389
3445
  }
3390
- var Ge = {};
3446
+ var Ke = {};
3391
3447
  var Nn;
3392
- function Jo() {
3448
+ function Qo() {
3393
3449
  return Nn || (Nn = 1, process.env.NODE_ENV !== "production" && (function() {
3394
- function v(w) {
3395
- if (w == null) return null;
3396
- if (typeof w == "function")
3397
- return w.$$typeof === ce ? null : w.displayName || w.name || null;
3398
- if (typeof w == "string") return w;
3399
- switch (w) {
3400
- case q:
3450
+ function v(E) {
3451
+ if (E == null) return null;
3452
+ if (typeof E == "function")
3453
+ return E.$$typeof === ce ? null : E.displayName || E.name || null;
3454
+ if (typeof E == "string") return E;
3455
+ switch (E) {
3456
+ case N:
3401
3457
  return "Fragment";
3402
- case J:
3458
+ case U:
3403
3459
  return "Profiler";
3404
- case Q:
3460
+ case J:
3405
3461
  return "StrictMode";
3406
- case ne:
3462
+ case re:
3407
3463
  return "Suspense";
3408
3464
  case b:
3409
3465
  return "SuspenseList";
3410
3466
  case le:
3411
3467
  return "Activity";
3412
3468
  }
3413
- if (typeof w == "object")
3414
- switch (typeof w.tag == "number" && console.error(
3469
+ if (typeof E == "object")
3470
+ switch (typeof E.tag == "number" && console.error(
3415
3471
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
3416
- ), w.$$typeof) {
3417
- case B:
3472
+ ), E.$$typeof) {
3473
+ case W:
3418
3474
  return "Portal";
3419
- case te:
3420
- return w.displayName || "Context";
3421
- case re:
3422
- return (w._context.displayName || "Context") + ".Consumer";
3423
- case ie:
3424
- var z = w.render;
3425
- return w = w.displayName, w || (w = z.displayName || z.name || "", w = w !== "" ? "ForwardRef(" + w + ")" : "ForwardRef"), w;
3475
+ case ne:
3476
+ return E.displayName || "Context";
3426
3477
  case Z:
3427
- return z = w.displayName || null, z !== null ? z : v(w.type) || "Memo";
3478
+ return (E._context.displayName || "Context") + ".Consumer";
3479
+ case ie:
3480
+ var z = E.render;
3481
+ return E = E.displayName, E || (E = z.displayName || z.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
3482
+ case ee:
3483
+ return z = E.displayName || null, z !== null ? z : v(E.type) || "Memo";
3428
3484
  case F:
3429
- z = w._payload, w = w._init;
3485
+ z = E._payload, E = E._init;
3430
3486
  try {
3431
- return v(w(z));
3487
+ return v(E(z));
3432
3488
  } catch {
3433
3489
  }
3434
3490
  }
3435
3491
  return null;
3436
3492
  }
3437
- function h(w) {
3438
- return "" + w;
3493
+ function h(E) {
3494
+ return "" + E;
3439
3495
  }
3440
- function p(w) {
3496
+ function p(E) {
3441
3497
  try {
3442
- h(w);
3498
+ h(E);
3443
3499
  var z = !1;
3444
3500
  } catch {
3445
3501
  z = !0;
3446
3502
  }
3447
3503
  if (z) {
3448
3504
  z = console;
3449
- var j = z.error, $ = typeof Symbol == "function" && Symbol.toStringTag && w[Symbol.toStringTag] || w.constructor.name || "Object";
3505
+ var j = z.error, $ = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
3450
3506
  return j.call(
3451
3507
  z,
3452
3508
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
3453
3509
  $
3454
- ), h(w);
3510
+ ), h(E);
3455
3511
  }
3456
3512
  }
3457
- function u(w) {
3458
- if (w === q) return "<>";
3459
- if (typeof w == "object" && w !== null && w.$$typeof === F)
3513
+ function u(E) {
3514
+ if (E === N) return "<>";
3515
+ if (typeof E == "object" && E !== null && E.$$typeof === F)
3460
3516
  return "<...>";
3461
3517
  try {
3462
- var z = v(w);
3518
+ var z = v(E);
3463
3519
  return z ? "<" + z + ">" : "<...>";
3464
3520
  } catch {
3465
3521
  return "<...>";
3466
3522
  }
3467
3523
  }
3468
3524
  function m() {
3469
- var w = X.A;
3470
- return w === null ? null : w.getOwner();
3525
+ var E = X.A;
3526
+ return E === null ? null : E.getOwner();
3471
3527
  }
3472
3528
  function g() {
3473
3529
  return Error("react-stack-top-frame");
3474
3530
  }
3475
- function E(w) {
3476
- if (G.call(w, "key")) {
3477
- var z = Object.getOwnPropertyDescriptor(w, "key").get;
3531
+ function w(E) {
3532
+ if (K.call(E, "key")) {
3533
+ var z = Object.getOwnPropertyDescriptor(E, "key").get;
3478
3534
  if (z && z.isReactWarning) return !1;
3479
3535
  }
3480
- return w.key !== void 0;
3536
+ return E.key !== void 0;
3481
3537
  }
3482
- function x(w, z) {
3538
+ function x(E, z) {
3483
3539
  function j() {
3484
- ee || (ee = !0, console.error(
3540
+ te || (te = !0, console.error(
3485
3541
  "%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)",
3486
3542
  z
3487
3543
  ));
3488
3544
  }
3489
- j.isReactWarning = !0, Object.defineProperty(w, "key", {
3545
+ j.isReactWarning = !0, Object.defineProperty(E, "key", {
3490
3546
  get: j,
3491
3547
  configurable: !0
3492
3548
  });
3493
3549
  }
3494
- function C() {
3495
- var w = v(this.type);
3496
- return se[w] || (se[w] = !0, console.error(
3550
+ function k() {
3551
+ var E = v(this.type);
3552
+ return se[E] || (se[E] = !0, console.error(
3497
3553
  "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."
3498
- )), w = this.props.ref, w !== void 0 ? w : null;
3554
+ )), E = this.props.ref, E !== void 0 ? E : null;
3499
3555
  }
3500
- function _(w, z, j, $, xe, we) {
3556
+ function S(E, z, j, $, xe, we) {
3501
3557
  var ue = j.ref;
3502
- return w = {
3503
- $$typeof: N,
3504
- type: w,
3558
+ return E = {
3559
+ $$typeof: G,
3560
+ type: E,
3505
3561
  key: z,
3506
3562
  props: j,
3507
3563
  _owner: $
3508
- }, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(w, "ref", {
3564
+ }, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(E, "ref", {
3509
3565
  enumerable: !1,
3510
- get: C
3511
- }) : Object.defineProperty(w, "ref", { enumerable: !1, value: null }), w._store = {}, Object.defineProperty(w._store, "validated", {
3566
+ get: k
3567
+ }) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
3512
3568
  configurable: !1,
3513
3569
  enumerable: !1,
3514
3570
  writable: !0,
3515
3571
  value: 0
3516
- }), Object.defineProperty(w, "_debugInfo", {
3572
+ }), Object.defineProperty(E, "_debugInfo", {
3517
3573
  configurable: !1,
3518
3574
  enumerable: !1,
3519
3575
  writable: !0,
3520
3576
  value: null
3521
- }), Object.defineProperty(w, "_debugStack", {
3577
+ }), Object.defineProperty(E, "_debugStack", {
3522
3578
  configurable: !1,
3523
3579
  enumerable: !1,
3524
3580
  writable: !0,
3525
3581
  value: xe
3526
- }), Object.defineProperty(w, "_debugTask", {
3582
+ }), Object.defineProperty(E, "_debugTask", {
3527
3583
  configurable: !1,
3528
3584
  enumerable: !1,
3529
3585
  writable: !0,
3530
3586
  value: we
3531
- }), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
3587
+ }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
3532
3588
  }
3533
- function M(w, z, j, $, xe, we) {
3589
+ function _(E, z, j, $, xe, we) {
3534
3590
  var ue = z.children;
3535
3591
  if (ue !== void 0)
3536
3592
  if ($)
3537
3593
  if (Y(ue)) {
3538
3594
  for ($ = 0; $ < ue.length; $++)
3539
- D(ue[$]);
3595
+ A(ue[$]);
3540
3596
  Object.freeze && Object.freeze(ue);
3541
3597
  } else
3542
3598
  console.error(
3543
3599
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
3544
3600
  );
3545
- else D(ue);
3546
- if (G.call(z, "key")) {
3547
- ue = v(w);
3548
- var Ee = Object.keys(z).filter(function(Qe) {
3549
- return Qe !== "key";
3601
+ else A(ue);
3602
+ if (K.call(z, "key")) {
3603
+ ue = v(E);
3604
+ var Ee = Object.keys(z).filter(function(Ze) {
3605
+ return Ze !== "key";
3550
3606
  });
3551
3607
  $ = 0 < Ee.length ? "{key: someKey, " + Ee.join(": ..., ") + ": ...}" : "{key: someKey}", he[ue + $] || (Ee = 0 < Ee.length ? "{" + Ee.join(": ..., ") + ": ...}" : "{}", console.error(
3552
3608
  `A props object containing a "key" prop is being spread into JSX:
@@ -3561,16 +3617,16 @@ React keys must be passed directly to JSX without using spread:
3561
3617
  ue
3562
3618
  ), he[ue + $] = !0);
3563
3619
  }
3564
- if (ue = null, j !== void 0 && (p(j), ue = "" + j), E(z) && (p(z.key), ue = "" + z.key), "key" in z) {
3620
+ if (ue = null, j !== void 0 && (p(j), ue = "" + j), w(z) && (p(z.key), ue = "" + z.key), "key" in z) {
3565
3621
  j = {};
3566
- for (var P in z)
3567
- P !== "key" && (j[P] = z[P]);
3622
+ for (var O in z)
3623
+ O !== "key" && (j[O] = z[O]);
3568
3624
  } else j = z;
3569
3625
  return ue && x(
3570
3626
  j,
3571
- typeof w == "function" ? w.displayName || w.name || "Unknown" : w
3572
- ), _(
3573
- w,
3627
+ typeof E == "function" ? E.displayName || E.name || "Unknown" : E
3628
+ ), S(
3629
+ E,
3574
3630
  ue,
3575
3631
  j,
3576
3632
  m(),
@@ -3578,75 +3634,80 @@ React keys must be passed directly to JSX without using spread:
3578
3634
  we
3579
3635
  );
3580
3636
  }
3581
- function D(w) {
3582
- U(w) ? w._store && (w._store.validated = 1) : typeof w == "object" && w !== null && w.$$typeof === F && (w._payload.status === "fulfilled" ? U(w._payload.value) && w._payload.value._store && (w._payload.value._store.validated = 1) : w._store && (w._store.validated = 1));
3637
+ function A(E) {
3638
+ B(E) ? E._store && (E._store.validated = 1) : typeof E == "object" && E !== null && E.$$typeof === F && (E._payload.status === "fulfilled" ? B(E._payload.value) && E._payload.value._store && (E._payload.value._store.validated = 1) : E._store && (E._store.validated = 1));
3583
3639
  }
3584
- function U(w) {
3585
- return typeof w == "object" && w !== null && w.$$typeof === N;
3640
+ function B(E) {
3641
+ return typeof E == "object" && E !== null && E.$$typeof === G;
3586
3642
  }
3587
- var A = Qr, N = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), q = Symbol.for("react.fragment"), Q = Symbol.for("react.strict_mode"), J = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), te = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), ne = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), X = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, Y = Array.isArray, oe = console.createTask ? console.createTask : function() {
3643
+ var P = Qr, G = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), J = Symbol.for("react.strict_mode"), U = Symbol.for("react.profiler"), Z = Symbol.for("react.consumer"), ne = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), re = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), X = P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, K = Object.prototype.hasOwnProperty, Y = Array.isArray, oe = console.createTask ? console.createTask : function() {
3588
3644
  return null;
3589
3645
  };
3590
- A = {
3591
- react_stack_bottom_frame: function(w) {
3592
- return w();
3646
+ P = {
3647
+ react_stack_bottom_frame: function(E) {
3648
+ return E();
3593
3649
  }
3594
3650
  };
3595
- var ee, se = {}, de = A.react_stack_bottom_frame.bind(
3596
- A,
3651
+ var te, se = {}, pe = P.react_stack_bottom_frame.bind(
3652
+ P,
3597
3653
  g
3598
3654
  )(), fe = oe(u(g)), he = {};
3599
- Ge.Fragment = q, Ge.jsx = function(w, z, j) {
3655
+ Ke.Fragment = N, Ke.jsx = function(E, z, j) {
3600
3656
  var $ = 1e4 > X.recentlyCreatedOwnerStacks++;
3601
- return M(
3602
- w,
3657
+ return _(
3658
+ E,
3603
3659
  z,
3604
3660
  j,
3605
3661
  !1,
3606
- $ ? Error("react-stack-top-frame") : de,
3607
- $ ? oe(u(w)) : fe
3662
+ $ ? Error("react-stack-top-frame") : pe,
3663
+ $ ? oe(u(E)) : fe
3608
3664
  );
3609
- }, Ge.jsxs = function(w, z, j) {
3665
+ }, Ke.jsxs = function(E, z, j) {
3610
3666
  var $ = 1e4 > X.recentlyCreatedOwnerStacks++;
3611
- return M(
3612
- w,
3667
+ return _(
3668
+ E,
3613
3669
  z,
3614
3670
  j,
3615
3671
  !0,
3616
- $ ? Error("react-stack-top-frame") : de,
3617
- $ ? oe(u(w)) : fe
3672
+ $ ? Error("react-stack-top-frame") : pe,
3673
+ $ ? oe(u(E)) : fe
3618
3674
  );
3619
3675
  };
3620
- })()), Ge;
3676
+ })()), Ke;
3621
3677
  }
3622
3678
  var zn;
3623
- function Qo() {
3624
- return zn || (zn = 1, process.env.NODE_ENV === "production" ? ht.exports = Ko() : ht.exports = Jo()), ht.exports;
3679
+ function Zo() {
3680
+ return zn || (zn = 1, process.env.NODE_ENV === "production" ? vt.exports = Jo() : vt.exports = Qo()), vt.exports;
3625
3681
  }
3626
- var Zo = Qo();
3627
- const ti = Zr(({ onChange: v, initialValue: h }, p) => {
3628
- const u = Ft(null), m = Ft(null), g = Ft(h);
3629
- return eo(p, () => ({
3630
- setHTML: (E) => {
3631
- u.current && u.current.setHTML(E);
3682
+ var ei = Zo();
3683
+ const ni = Zr(({ onChange: v, initialValue: h }, p) => {
3684
+ const u = Xe(null), m = Xe(null), g = Xe(h), w = Xe(v), x = Xe(!1);
3685
+ return jt(() => {
3686
+ w.current = v;
3687
+ }, [v]), eo(p, () => ({
3688
+ setHTML: (k) => {
3689
+ u.current && u.current.setHTML(k);
3632
3690
  },
3633
3691
  getHTML: () => u.current?.getHTML() || ""
3634
- })), In(() => {
3692
+ })), jt(() => {
3635
3693
  if (m.current && !u.current) {
3636
- u.current = new Go(), m.current.appendChild(u.current.getElement()), h && u.current.setHTML(h);
3637
- const E = u.current.getElement(), x = E.querySelector(
3694
+ u.current = new Ko(), m.current.appendChild(u.current.getElement()), h && (u.current.setHTML(h), g.current = h), x.current = !0;
3695
+ const k = u.current.getElement(), S = k.querySelector(
3638
3696
  ".editor"
3639
- ), C = () => {
3640
- const _ = u.current?.getHTML() || "";
3641
- v?.(_);
3697
+ ), _ = () => {
3698
+ const A = u.current?.getHTML() || "";
3699
+ w.current?.(A);
3642
3700
  };
3643
- x ? (x.addEventListener("input", C), x.addEventListener("keyup", C), x.addEventListener("paste", C)) : (E.addEventListener("input", C), E.addEventListener("keyup", C), E.addEventListener("paste", C));
3701
+ S ? (S.addEventListener("input", _), S.addEventListener("paste", _)) : (k.addEventListener("input", _), k.addEventListener("paste", _));
3702
+ }
3703
+ }, []), jt(() => {
3704
+ if (x.current && u.current && h !== void 0 && h !== g.current) {
3705
+ const k = u.current.getHTML();
3706
+ h !== k && (u.current.setHTML(h), g.current = h);
3644
3707
  }
3645
- }, [v]), In(() => {
3646
- u.current && h !== void 0 && h !== g.current && (u.current.setHTML(h), g.current = h);
3647
- }, [h]), /* @__PURE__ */ Zo.jsx("div", { ref: m });
3708
+ }, [h]), /* @__PURE__ */ ei.jsx("div", { ref: m });
3648
3709
  });
3649
3710
  export {
3650
- Go as RichTextEditor,
3651
- ti as RichTextEditorComponent
3711
+ Ko as RichTextEditor,
3712
+ ni as RichTextEditorComponent
3652
3713
  };