@paroicms/quill-editor-plugin 1.7.0 → 1.7.2

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.
@@ -49,8 +49,7 @@ function Vr(t, e, n) {
49
49
  return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, dr(r), Jo.bind(r);
50
50
  }
51
51
  function ur(t) {
52
- if (le === null)
53
- return t();
52
+ if (le === null) return t();
54
53
  const e = le;
55
54
  le = null;
56
55
  try {
@@ -67,8 +66,7 @@ function Qo(t) {
67
66
  }
68
67
  function Jo() {
69
68
  if (this.sources && this.state)
70
- if (this.state === Rt)
71
- dr(this);
69
+ if (this.state === Rt) dr(this);
72
70
  else {
73
71
  const t = we;
74
72
  we = null, fr(() => Xr(this), !1), we = t;
@@ -91,11 +89,14 @@ function el(t, e, n) {
91
89
  }, !1)), e;
92
90
  }
93
91
  function dr(t) {
94
- if (!t.fn)
95
- return;
92
+ if (!t.fn) return;
96
93
  ds(t);
97
94
  const e = us;
98
- Yc(t, t.value, e);
95
+ Yc(
96
+ t,
97
+ t.value,
98
+ e
99
+ );
99
100
  }
100
101
  function Yc(t, e, n) {
101
102
  let r;
@@ -127,12 +128,9 @@ function Ki(t, e, n, r = Rt, s) {
127
128
  return fe === null || fe !== Xo && (fe.owned ? fe.owned.push(i) : fe.owned = [i]), i;
128
129
  }
129
130
  function Yr(t) {
130
- if (t.state === 0)
131
- return;
132
- if (t.state === Zr)
133
- return Xr(t);
134
- if (t.suspense && ur(t.suspense.inFallback))
135
- return t.suspense.effects.push(t);
131
+ if (t.state === 0) return;
132
+ if (t.state === Zr) return Xr(t);
133
+ if (t.suspense && ur(t.suspense.inFallback)) return t.suspense.effects.push(t);
136
134
  const e = [t];
137
135
  for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < us); )
138
136
  t.state && e.push(t);
@@ -145,8 +143,7 @@ function Yr(t) {
145
143
  }
146
144
  }
147
145
  function fr(t, e) {
148
- if (we)
149
- return t();
146
+ if (we) return t();
150
147
  let n = !1;
151
148
  e || (we = []), mt ? n = !0 : mt = [], us++;
152
149
  try {
@@ -157,14 +154,12 @@ function fr(t, e) {
157
154
  }
158
155
  }
159
156
  function Xc(t) {
160
- if (we && (tl(we), we = null), t)
161
- return;
157
+ if (we && (tl(we), we = null), t) return;
162
158
  const e = mt;
163
159
  mt = null, e.length && fr(() => Yo(e), !1);
164
160
  }
165
161
  function tl(t) {
166
- for (let e = 0; e < t.length; e++)
167
- Yr(t[e]);
162
+ for (let e = 0; e < t.length; e++) Yr(t[e]);
168
163
  }
169
164
  function Qc(t) {
170
165
  let e, n = 0;
@@ -172,8 +167,7 @@ function Qc(t) {
172
167
  const r = t[e];
173
168
  r.user ? t[n++] = r : Yr(r);
174
169
  }
175
- for (e = 0; e < n; e++)
176
- Yr(t[e]);
170
+ for (e = 0; e < n; e++) Yr(t[e]);
177
171
  }
178
172
  function Xr(t, e) {
179
173
  t.state = 0;
@@ -202,13 +196,11 @@ function ds(t) {
202
196
  }
203
197
  }
204
198
  if (t.owned) {
205
- for (e = t.owned.length - 1; e >= 0; e--)
206
- ds(t.owned[e]);
199
+ for (e = t.owned.length - 1; e >= 0; e--) ds(t.owned[e]);
207
200
  t.owned = null;
208
201
  }
209
202
  if (t.cleanups) {
210
- for (e = t.cleanups.length - 1; e >= 0; e--)
211
- t.cleanups[e]();
203
+ for (e = t.cleanups.length - 1; e >= 0; e--) t.cleanups[e]();
212
204
  t.cleanups = null;
213
205
  }
214
206
  t.state = 0;
@@ -223,8 +215,7 @@ function rl(t, e = fe) {
223
215
  }
224
216
  const eu = Symbol("fallback");
225
217
  function xa(t) {
226
- for (let e = 0; e < t.length; e++)
227
- t[e]();
218
+ for (let e = 0; e < t.length; e++) t[e]();
228
219
  }
229
220
  function tu(t, e, n = {}) {
230
221
  let r = [], s = [], i = [], a = 0, o = e.length > 1 ? [] : null;
@@ -239,8 +230,7 @@ function tu(t, e, n = {}) {
239
230
  r[h] = c[h], s[h] = Kr(g);
240
231
  a = u;
241
232
  } else {
242
- for (E = new Array(u), y = new Array(u), o && (_ = new Array(u)), N = 0, T = Math.min(a, u); N < T && r[N] === c[N]; N++)
243
- ;
233
+ for (E = new Array(u), y = new Array(u), o && (_ = new Array(u)), N = 0, T = Math.min(a, u); N < T && r[N] === c[N]; N++) ;
244
234
  for (T = a - 1, v = u - 1; T >= N && v >= N && r[T] === c[v]; T--, v--)
245
235
  E[v] = s[T], y[v] = i[T], o && (_[v] = o[T]);
246
236
  for (p = /* @__PURE__ */ new Map(), m = new Array(v + 1), h = v; h >= N; h--)
@@ -282,8 +272,7 @@ function nu(t, e, n) {
282
272
  s--, i--;
283
273
  if (s === a) {
284
274
  const d = i < r ? o ? n[o - 1].nextSibling : n[i - o] : c;
285
- for (; o < i; )
286
- t.insertBefore(n[o++], d);
275
+ for (; o < i; ) t.insertBefore(n[o++], d);
287
276
  } else if (i === o)
288
277
  for (; a < s; )
289
278
  (!u || !u.has(e[a])) && e[a].remove(), a++;
@@ -294,8 +283,7 @@ function nu(t, e, n) {
294
283
  if (!u) {
295
284
  u = /* @__PURE__ */ new Map();
296
285
  let h = o;
297
- for (; h < i; )
298
- u.set(n[h], h++);
286
+ for (; h < i; ) u.set(n[h], h++);
299
287
  }
300
288
  const d = u.get(e[a]);
301
289
  if (d != null)
@@ -305,14 +293,10 @@ function nu(t, e, n) {
305
293
  g++;
306
294
  if (g > d - o) {
307
295
  const m = e[a];
308
- for (; o < d; )
309
- t.insertBefore(n[o++], m);
310
- } else
311
- t.replaceChild(n[o++], e[a++]);
312
- } else
313
- a++;
314
- else
315
- e[a++].remove();
296
+ for (; o < d; ) t.insertBefore(n[o++], m);
297
+ } else t.replaceChild(n[o++], e[a++]);
298
+ } else a++;
299
+ else e[a++].remove();
316
300
  }
317
301
  }
318
302
  }
@@ -336,8 +320,7 @@ function Ai(t, e) {
336
320
  e == null ? t.removeAttribute("class") : t.className = e;
337
321
  }
338
322
  function Y(t, e, n, r) {
339
- if (n !== void 0 && !r && (r = []), typeof e != "function")
340
- return Qr(t, e, r, n);
323
+ if (n !== void 0 && !r && (r = []), typeof e != "function") return Qr(t, e, r, n);
341
324
  bt((s) => Qr(t, e(), s, n), r);
342
325
  }
343
326
  function ru(t) {
@@ -355,17 +338,14 @@ function ru(t) {
355
338
  const r = n[e];
356
339
  if (r && !n.disabled) {
357
340
  const s = n[`${e}Data`];
358
- if (s !== void 0 ? r.call(n, s, t) : r.call(n, t), t.cancelBubble)
359
- return;
341
+ if (s !== void 0 ? r.call(n, s, t) : r.call(n, t), t.cancelBubble) return;
360
342
  }
361
343
  n = n._$host || n.parentNode || n.host;
362
344
  }
363
345
  }
364
346
  function Qr(t, e, n, r, s) {
365
- for (; typeof n == "function"; )
366
- n = n();
367
- if (e === n)
368
- return n;
347
+ for (; typeof n == "function"; ) n = n();
348
+ if (e === n) return n;
369
349
  const i = typeof e, a = r !== void 0;
370
350
  if (t = a && n[0] && n[0].parentNode || t, i === "string" || i === "number") {
371
351
  if (i === "number" && (e = e.toString(), e === n))
@@ -381,8 +361,7 @@ function Qr(t, e, n, r, s) {
381
361
  if (i === "function")
382
362
  return bt(() => {
383
363
  let o = e();
384
- for (; typeof o == "function"; )
385
- o = o();
364
+ for (; typeof o == "function"; ) o = o();
386
365
  n = Qr(t, o, n, r);
387
366
  }), () => n;
388
367
  if (Array.isArray(e)) {
@@ -390,18 +369,14 @@ function Qr(t, e, n, r, s) {
390
369
  if (Ti(o, e, n, s))
391
370
  return bt(() => n = Qr(t, o, n, r, !0)), () => n;
392
371
  if (o.length === 0) {
393
- if (n = _n(t, n, r), a)
394
- return n;
395
- } else
396
- c ? n.length === 0 ? Ra(t, o, r) : nu(t, n, o) : (n && _n(t), Ra(t, o));
372
+ if (n = _n(t, n, r), a) return n;
373
+ } else c ? n.length === 0 ? Ra(t, o, r) : nu(t, n, o) : (n && _n(t), Ra(t, o));
397
374
  n = o;
398
375
  } else if (e.nodeType) {
399
376
  if (Array.isArray(n)) {
400
- if (a)
401
- return n = _n(t, n, r, e);
377
+ if (a) return n = _n(t, n, r, e);
402
378
  _n(t, n, null, e);
403
- } else
404
- n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild);
379
+ } else n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild);
405
380
  n = e;
406
381
  }
407
382
  }
@@ -411,32 +386,32 @@ function Ti(t, e, n, r) {
411
386
  let s = !1;
412
387
  for (let i = 0, a = e.length; i < a; i++) {
413
388
  let o = e[i], c = n && n[t.length], u;
414
- if (!(o == null || o === !0 || o === !1))
415
- if ((u = typeof o) == "object" && o.nodeType)
416
- t.push(o);
417
- else if (Array.isArray(o))
418
- s = Ti(t, o, c) || s;
419
- else if (u === "function")
420
- if (r) {
421
- for (; typeof o == "function"; )
422
- o = o();
423
- s = Ti(t, Array.isArray(o) ? o : [o], Array.isArray(c) ? c : [c]) || s;
424
- } else
425
- t.push(o), s = !0;
426
- else {
427
- const d = String(o);
428
- c && c.nodeType === 3 && c.data === d ? t.push(c) : t.push(document.createTextNode(d));
429
- }
389
+ if (!(o == null || o === !0 || o === !1)) if ((u = typeof o) == "object" && o.nodeType)
390
+ t.push(o);
391
+ else if (Array.isArray(o))
392
+ s = Ti(t, o, c) || s;
393
+ else if (u === "function")
394
+ if (r) {
395
+ for (; typeof o == "function"; ) o = o();
396
+ s = Ti(
397
+ t,
398
+ Array.isArray(o) ? o : [o],
399
+ Array.isArray(c) ? c : [c]
400
+ ) || s;
401
+ } else
402
+ t.push(o), s = !0;
403
+ else {
404
+ const d = String(o);
405
+ c && c.nodeType === 3 && c.data === d ? t.push(c) : t.push(document.createTextNode(d));
406
+ }
430
407
  }
431
408
  return s;
432
409
  }
433
410
  function Ra(t, e, n = null) {
434
- for (let r = 0, s = e.length; r < s; r++)
435
- t.insertBefore(e[r], n);
411
+ for (let r = 0, s = e.length; r < s; r++) t.insertBefore(e[r], n);
436
412
  }
437
413
  function _n(t, e, n, r) {
438
- if (n === void 0)
439
- return t.textContent = "";
414
+ if (n === void 0) return t.textContent = "";
440
415
  const s = r || document.createTextNode("");
441
416
  if (e.length) {
442
417
  let i = !1;
@@ -445,11 +420,9 @@ function _n(t, e, n, r) {
445
420
  if (s !== o) {
446
421
  const c = o.parentNode === t;
447
422
  !i && !a ? c ? t.replaceChild(s, o) : t.insertBefore(s, n) : c && o.remove();
448
- } else
449
- i = !0;
423
+ } else i = !0;
450
424
  }
451
- } else
452
- t.insertBefore(s, n);
425
+ } else t.insertBefore(s, n);
453
426
  return [s];
454
427
  }
455
428
  var sl = typeof global == "object" && global && global.Object === Object && global, su = typeof self == "object" && self && self.Object === Object && self, at = sl || su || Function("return this")(), Lt = at.Symbol, il = Object.prototype, iu = il.hasOwnProperty, au = il.toString, Yn = Lt ? Lt.toStringTag : void 0;
@@ -3537,8 +3510,7 @@ class Jg {
3537
3510
  const e = this.offset, n = this.index, r = this.next(), s = this.ops.slice(this.index);
3538
3511
  return this.offset = e, this.index = n, [r].concat(s);
3539
3512
  }
3540
- } else
3541
- return [];
3513
+ } else return [];
3542
3514
  }
3543
3515
  }
3544
3516
  la.default = Jg;
@@ -3675,8 +3647,7 @@ la.default = Jg;
3675
3647
  const B = new d(p.rest());
3676
3648
  return _.concat(B).chop();
3677
3649
  }
3678
- } else
3679
- typeof v.delete == "number" && (typeof T.retain == "number" || typeof T.retain == "object" && T.retain !== null) && _.push(v);
3650
+ } else typeof v.delete == "number" && (typeof T.retain == "number" || typeof T.retain == "object" && T.retain !== null) && _.push(v);
3680
3651
  }
3681
3652
  return _.chop();
3682
3653
  }
@@ -3796,8 +3767,7 @@ la.default = Jg;
3796
3767
  if (m.next(), _ === "delete") {
3797
3768
  g -= Math.min(y, g - E);
3798
3769
  continue;
3799
- } else
3800
- _ === "insert" && (E < g || !p) && (g += y);
3770
+ } else _ === "insert" && (E < g || !p) && (g += y);
3801
3771
  E += y;
3802
3772
  }
3803
3773
  return g;
@@ -3885,8 +3855,7 @@ class ye extends sr {
3885
3855
  super.insertAt(e, n, r), this.cache = {};
3886
3856
  return;
3887
3857
  }
3888
- if (n.length === 0)
3889
- return;
3858
+ if (n.length === 0) return;
3890
3859
  const s = n.split(`
3891
3860
  `), i = s.shift();
3892
3861
  i.length > 0 && (e < this.length() - 1 || this.children.tail == null ? super.insertAt(Math.min(e, this.length() - 1), i) : this.children.tail.insertAt(this.children.tail.length(), i), this.cache = {});
@@ -4010,8 +3979,7 @@ class je extends Be {
4010
3979
  super.remove(), this.parent = null;
4011
3980
  }
4012
3981
  restore() {
4013
- if (this.selection.composing || this.parent == null)
4014
- return null;
3982
+ if (this.selection.composing || this.parent == null) return null;
4015
3983
  const e = this.selection.getNativeRange();
4016
3984
  for (; this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode; )
4017
3985
  this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
@@ -4096,17 +4064,14 @@ var Kl = { exports: {} };
4096
4064
  }
4097
4065
  o.prototype.eventNames = function() {
4098
4066
  var u = [], d, h;
4099
- if (this._eventsCount === 0)
4100
- return u;
4067
+ if (this._eventsCount === 0) return u;
4101
4068
  for (h in d = this._events)
4102
4069
  e.call(d, h) && u.push(n ? h.slice(1) : h);
4103
4070
  return Object.getOwnPropertySymbols ? u.concat(Object.getOwnPropertySymbols(d)) : u;
4104
4071
  }, o.prototype.listeners = function(u) {
4105
4072
  var d = n ? n + u : u, h = this._events[d];
4106
- if (!h)
4107
- return [];
4108
- if (h.fn)
4109
- return [h.fn];
4073
+ if (!h) return [];
4074
+ if (h.fn) return [h.fn];
4110
4075
  for (var g = 0, p = h.length, m = new Array(p); g < p; g++)
4111
4076
  m[g] = h[g].fn;
4112
4077
  return m;
@@ -4115,8 +4080,7 @@ var Kl = { exports: {} };
4115
4080
  return h ? h.fn ? 1 : h.length : 0;
4116
4081
  }, o.prototype.emit = function(u, d, h, g, p, m) {
4117
4082
  var E = n ? n + u : u;
4118
- if (!this._events[E])
4119
- return !1;
4083
+ if (!this._events[E]) return !1;
4120
4084
  var y = this._events[E], _ = arguments.length, N, T;
4121
4085
  if (y.fn) {
4122
4086
  switch (y.once && this.removeListener(u, y.fn, void 0, !0), _) {
@@ -4153,9 +4117,8 @@ var Kl = { exports: {} };
4153
4117
  y[T].fn.call(y[T].context, d, h, g);
4154
4118
  break;
4155
4119
  default:
4156
- if (!N)
4157
- for (S = 1, N = new Array(_ - 1); S < _; S++)
4158
- N[S - 1] = arguments[S];
4120
+ if (!N) for (S = 1, N = new Array(_ - 1); S < _; S++)
4121
+ N[S - 1] = arguments[S];
4159
4122
  y[T].fn.apply(y[T].context, N);
4160
4123
  }
4161
4124
  }
@@ -4166,8 +4129,7 @@ var Kl = { exports: {} };
4166
4129
  return i(this, u, d, h, !0);
4167
4130
  }, o.prototype.removeListener = function(u, d, h, g) {
4168
4131
  var p = n ? n + u : u;
4169
- if (!this._events[p])
4170
- return this;
4132
+ if (!this._events[p]) return this;
4171
4133
  if (!d)
4172
4134
  return a(this, p), this;
4173
4135
  var m = this._events[p];
@@ -4271,8 +4233,7 @@ class rp {
4271
4233
  this.emitter = n, this.scroll = e, this.composing = !1, this.mouseDown = !1, this.root = this.scroll.domNode, this.cursor = this.scroll.create("cursor", this), this.savedRange = new Qt(0, 0), this.lastRange = this.savedRange, this.lastNative = null, this.handleComposition(), this.handleDragging(), this.emitter.listenDOM("selectionchange", document, () => {
4272
4234
  !this.mouseDown && !this.composing && setTimeout(this.update.bind(this, M.sources.USER), 1);
4273
4235
  }), this.emitter.on(M.events.SCROLL_BEFORE_UPDATE, () => {
4274
- if (!this.hasFocus())
4275
- return;
4236
+ if (!this.hasFocus()) return;
4276
4237
  const r = this.getNativeRange();
4277
4238
  r != null && r.start.node !== this.cursor.textNode && this.emitter.once(M.events.SCROLL_UPDATE, (s, i) => {
4278
4239
  try {
@@ -4300,8 +4261,7 @@ class rp {
4300
4261
  }), this.emitter.on(M.events.COMPOSITION_END, () => {
4301
4262
  if (this.composing = !1, this.cursor.parent) {
4302
4263
  const e = this.cursor.restore();
4303
- if (!e)
4304
- return;
4264
+ if (!e) return;
4305
4265
  setTimeout(() => {
4306
4266
  this.setNativeRange(e.startNode, e.startOffset, e.endNode, e.endOffset);
4307
4267
  }, 1);
@@ -4326,8 +4286,7 @@ class rp {
4326
4286
  if (!(r == null || !r.native.collapsed || this.scroll.query(e, D.BLOCK))) {
4327
4287
  if (r.start.node !== this.cursor.textNode) {
4328
4288
  const s = this.scroll.find(r.start.node, !1);
4329
- if (s == null)
4330
- return;
4289
+ if (s == null) return;
4331
4290
  if (s instanceof Te) {
4332
4291
  const i = s.split(r.start.offset);
4333
4292
  s.parent.insertBefore(this.cursor, i);
@@ -4343,8 +4302,7 @@ class rp {
4343
4302
  const r = this.scroll.length();
4344
4303
  e = Math.min(e, r - 1), n = Math.min(e + n, r - 1) - e;
4345
4304
  let s, [i, a] = this.scroll.leaf(e);
4346
- if (i == null)
4347
- return null;
4305
+ if (i == null) return null;
4348
4306
  if (n > 0 && a === i.length()) {
4349
4307
  const [d] = this.scroll.leaf(e + 1);
4350
4308
  if (d) {
@@ -4362,8 +4320,7 @@ class rp {
4362
4320
  return null;
4363
4321
  a < s.data.length ? (o.setStart(s, a), o.setEnd(s, a + 1)) : (o.setStart(s, a - 1), o.setEnd(s, a), c = "right"), u = o.getBoundingClientRect();
4364
4322
  } else {
4365
- if (!(i.domNode instanceof Element))
4366
- return null;
4323
+ if (!(i.domNode instanceof Element)) return null;
4367
4324
  u = i.domNode.getBoundingClientRect(), a > 0 && (c = "right");
4368
4325
  }
4369
4326
  return {
@@ -4377,11 +4334,9 @@ class rp {
4377
4334
  }
4378
4335
  getNativeRange() {
4379
4336
  const e = document.getSelection();
4380
- if (e == null || e.rangeCount <= 0)
4381
- return null;
4337
+ if (e == null || e.rangeCount <= 0) return null;
4382
4338
  const n = e.getRangeAt(0);
4383
- if (n == null)
4384
- return null;
4339
+ if (n == null) return null;
4385
4340
  const r = this.normalizeNative(n);
4386
4341
  return gi.info("getNativeRange", r), r;
4387
4342
  }
@@ -4520,8 +4475,7 @@ class ip {
4520
4475
  u = Ue.AttributeMap.diff(_, u) || {};
4521
4476
  } else if (typeof o.insert == "object") {
4522
4477
  const m = Object.keys(o.insert)[0];
4523
- if (m == null)
4524
- return a;
4478
+ if (m == null) return a;
4525
4479
  const E = this.scroll.query(m, D.INLINE) != null;
4526
4480
  if (E)
4527
4481
  (n <= a || this.scroll.descendant(Pe, a)[0]) && (h = !0);
@@ -4541,8 +4495,7 @@ class ip {
4541
4495
  n += c;
4542
4496
  } else if (s.push(o), o.retain !== null && typeof o.retain == "object") {
4543
4497
  const m = Object.keys(o.retain)[0];
4544
- if (m == null)
4545
- return a;
4498
+ if (m == null) return a;
4546
4499
  this.scroll.updateEmbedAt(a, m, o.retain[m]);
4547
4500
  }
4548
4501
  Object.keys(u).forEach((m) => {
@@ -4587,13 +4540,11 @@ class ip {
4587
4540
  }) : (r = this.scroll.lines(e, n), s = this.scroll.descendants(Te, e, n));
4588
4541
  const [i, a] = [r, s].map((o) => {
4589
4542
  const c = o.shift();
4590
- if (c == null)
4591
- return {};
4543
+ if (c == null) return {};
4592
4544
  let u = qe(c);
4593
4545
  for (; Object.keys(u).length > 0; ) {
4594
4546
  const d = o.shift();
4595
- if (d == null)
4596
- return u;
4547
+ if (d == null) return u;
4597
4548
  u = ap(qe(d), u);
4598
4549
  }
4599
4550
  return u;
@@ -4632,13 +4583,10 @@ class ip {
4632
4583
  }), this.update(new k().retain(e).insert(n, Cn(r)));
4633
4584
  }
4634
4585
  isBlank() {
4635
- if (this.scroll.children.length === 0)
4636
- return !0;
4637
- if (this.scroll.children.length > 1)
4638
- return !1;
4586
+ if (this.scroll.children.length === 0) return !0;
4587
+ if (this.scroll.children.length > 1) return !1;
4639
4588
  const e = this.scroll.children.head;
4640
- if (e?.statics.blotName !== ye.blotName)
4641
- return !1;
4589
+ if (e?.statics.blotName !== ye.blotName) return !1;
4642
4590
  const n = e;
4643
4591
  return n.children.length > 1 ? !1 : n.children.head instanceof Qe;
4644
4592
  }
@@ -4720,8 +4668,7 @@ function ar(t, e, n) {
4720
4668
  }
4721
4669
  function ap(t, e) {
4722
4670
  return Object.keys(e).reduce((n, r) => {
4723
- if (t[r] == null)
4724
- return n;
4671
+ if (t[r] == null) return n;
4725
4672
  const s = e[r];
4726
4673
  return s === t[r] ? n[r] = s : Array.isArray(s) ? s.indexOf(t[r]) < 0 ? n[r] = s.concat([t[r]]) : n[r] = s : n[r] = [s, t[r]], n;
4727
4674
  }, {});
@@ -4803,14 +4750,13 @@ class ca extends Be {
4803
4750
  startNode: r,
4804
4751
  startOffset: s.length
4805
4752
  };
4806
- else
4807
- e === this.rightGuard && (this.next instanceof Ye ? (this.next.insertAt(0, s), n = {
4808
- startNode: this.next.domNode,
4809
- startOffset: s.length
4810
- }) : (r = document.createTextNode(s), this.parent.insertBefore(this.scroll.create(r), this.next), n = {
4811
- startNode: r,
4812
- startOffset: s.length
4813
- }));
4753
+ else e === this.rightGuard && (this.next instanceof Ye ? (this.next.insertAt(0, s), n = {
4754
+ startNode: this.next.domNode,
4755
+ startOffset: s.length
4756
+ }) : (r = document.createTextNode(s), this.parent.insertBefore(this.scroll.create(r), this.next), n = {
4757
+ startNode: r,
4758
+ startOffset: s.length
4759
+ }));
4814
4760
  return e.data = Br, n;
4815
4761
  }
4816
4762
  update(e, n) {
@@ -5044,8 +4990,7 @@ class A {
5044
4990
  return Ke.call(this, () => {
5045
4991
  const s = this.getSelection(!0);
5046
4992
  let i = new k();
5047
- if (s == null)
5048
- return i;
4993
+ if (s == null) return i;
5049
4994
  if (this.scroll.query(e, D.BLOCK))
5050
4995
  i = this.editor.formatLine(s.index, s.length, {
5051
4996
  [e]: n
@@ -5084,8 +5029,7 @@ class A {
5084
5029
  }
5085
5030
  getBounds(e) {
5086
5031
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = null;
5087
- if (typeof e == "number" ? r = this.selection.getBounds(e, n) : r = this.selection.getBounds(e.index, e.length), !r)
5088
- return null;
5032
+ if (typeof e == "number" ? r = this.selection.getBounds(e, n) : r = this.selection.getBounds(e.index, e.length), !r) return null;
5089
5033
  const s = this.container.getBoundingClientRect();
5090
5034
  return {
5091
5035
  bottom: r.bottom - s.top,
@@ -5252,8 +5196,7 @@ function pp(t, e) {
5252
5196
  theme: s,
5253
5197
  modules: Object.entries(d).reduce((p, m) => {
5254
5198
  let [E, y] = m;
5255
- if (!y)
5256
- return p;
5199
+ if (!y) return p;
5257
5200
  const _ = A.import(`modules/${E}`);
5258
5201
  return _ == null ? (Rn.error(`Cannot load ${E} module. Are you sure you registered it?`), p) : {
5259
5202
  ...p,
@@ -5281,8 +5224,7 @@ function pt(t, e, n, r, s) {
5281
5224
  }
5282
5225
  function Eo(t, e, n, r) {
5283
5226
  const s = typeof n == "number" ? n : 0;
5284
- if (t == null)
5285
- return null;
5227
+ if (t == null) return null;
5286
5228
  let i, a;
5287
5229
  return e && typeof e.transformPosition == "function" ? [i, a] = [t.index, t.index + t.length].map((o) => (
5288
5230
  // @ts-expect-error -- TODO: add a better type guard around `index`
@@ -5313,8 +5255,7 @@ class mp extends ra {
5313
5255
  Array.isArray(this.batch) || (this.batch = []);
5314
5256
  }
5315
5257
  batchEnd() {
5316
- if (!this.batch)
5317
- return;
5258
+ if (!this.batch) return;
5318
5259
  const e = this.batch;
5319
5260
  this.batch = !1, this.update(e);
5320
5261
  }
@@ -5370,8 +5311,7 @@ class mp extends ra {
5370
5311
  insertContents(e, n) {
5371
5312
  const r = this.deltaToRenderBlocks(n.concat(new k().insert(`
5372
5313
  `))), s = r.pop();
5373
- if (s == null)
5374
- return;
5314
+ if (s == null) return;
5375
5315
  this.batchStart();
5376
5316
  const i = r.shift();
5377
5317
  if (i) {
@@ -5477,8 +5417,7 @@ class mp extends ra {
5477
5417
  o && r.insert(o, s.attributes);
5478
5418
  } else {
5479
5419
  const a = Object.keys(i)[0];
5480
- if (!a)
5481
- return;
5420
+ if (!a) return;
5482
5421
  this.query(a, D.INLINE) ? r.push(s) : (r.length() && n.push({
5483
5422
  type: "block",
5484
5423
  delta: r,
@@ -5524,8 +5463,7 @@ function Ei(t, e, n) {
5524
5463
  a = Ue.AttributeMap.diff(u, a) || {};
5525
5464
  } else if (typeof s.insert == "object") {
5526
5465
  const o = Object.keys(s.insert)[0];
5527
- if (o == null)
5528
- return r;
5466
+ if (o == null) return r;
5529
5467
  if (t.insertAt(r, o, s.insert[o]), t.scroll.query(o, D.INLINE) != null) {
5530
5468
  const [u] = t.descendant(Te, r), d = qe(u);
5531
5469
  a = Ue.AttributeMap.diff(d, a) || {};
@@ -5685,17 +5623,13 @@ class vs extends ot {
5685
5623
  }
5686
5624
  listen() {
5687
5625
  this.quill.root.addEventListener("keydown", (e) => {
5688
- if (e.defaultPrevented || e.isComposing || e.keyCode === 229 && (e.key === "Enter" || e.key === "Backspace"))
5689
- return;
5626
+ if (e.defaultPrevented || e.isComposing || e.keyCode === 229 && (e.key === "Enter" || e.key === "Backspace")) return;
5690
5627
  const s = (this.bindings[e.key] || []).concat(this.bindings[e.which] || []).filter((_) => vs.match(e, _));
5691
- if (s.length === 0)
5692
- return;
5628
+ if (s.length === 0) return;
5693
5629
  const i = A.find(e.target, !0);
5694
- if (i && i.scroll !== this.quill.scroll)
5695
- return;
5630
+ if (i && i.scroll !== this.quill.scroll) return;
5696
5631
  const a = this.quill.getSelection();
5697
- if (a == null || !this.quill.hasFocus())
5698
- return;
5632
+ if (a == null || !this.quill.hasFocus()) return;
5699
5633
  const [o, c] = this.quill.getLine(a.index), [u, d] = this.quill.getLeaf(a.index), [h, g] = a.length === 0 ? [u, d] : this.quill.getLeaf(a.index + a.length), p = u instanceof ns ? u.value().slice(0, d) : "", m = h instanceof ns ? h.value().slice(g) : "", E = {
5700
5634
  collapsed: a.length === 0,
5701
5635
  // @ts-expect-error Fix me later
@@ -5721,8 +5655,7 @@ class vs extends ot {
5721
5655
  }
5722
5656
  handleBackspace(e, n) {
5723
5657
  const r = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(n.prefix) ? 2 : 1;
5724
- if (e.index === 0 || this.quill.getLength() <= 1)
5725
- return;
5658
+ if (e.index === 0 || this.quill.getLength() <= 1) return;
5726
5659
  let s = {};
5727
5660
  const [i] = this.quill.getLine(e.index);
5728
5661
  let a = new k().retain(e.index - r).delete(r);
@@ -5740,8 +5673,7 @@ class vs extends ot {
5740
5673
  }
5741
5674
  handleDelete(e, n) {
5742
5675
  const r = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(n.suffix) ? 2 : 1;
5743
- if (e.index >= this.quill.getLength() - r)
5744
- return;
5676
+ if (e.index >= this.quill.getLength() - r) return;
5745
5677
  let s = {};
5746
5678
  const [i] = this.quill.getLine(e.index);
5747
5679
  let a = new k().retain(e.index).delete(r);
@@ -5815,8 +5747,7 @@ const Ap = {
5815
5747
  tab: {
5816
5748
  key: "Tab",
5817
5749
  handler(t, e) {
5818
- if (e.format.table)
5819
- return !0;
5750
+ if (e.format.table) return !0;
5820
5751
  this.quill.history.cutoff();
5821
5752
  const n = new k().retain(t.index).delete(t.length).insert(" ");
5822
5753
  return this.quill.updateContents(n, A.sources.USER), this.quill.history.cutoff(), this.quill.setSelection(t.index + 1, A.sources.SILENT), !1;
@@ -5898,8 +5829,7 @@ const Ap = {
5898
5829
  const e = this.quill.getModule("table");
5899
5830
  if (e) {
5900
5831
  const [n, r, s, i] = e.getTable(t), a = wp(n, r, s, i);
5901
- if (a == null)
5902
- return;
5832
+ if (a == null) return;
5903
5833
  let o = n.offset();
5904
5834
  if (a < 0) {
5905
5835
  const c = new k().retain(o).insert(`
@@ -5937,13 +5867,11 @@ const Ap = {
5937
5867
  },
5938
5868
  prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
5939
5869
  handler(t, e) {
5940
- if (this.quill.scroll.query("list") == null)
5941
- return !0;
5870
+ if (this.quill.scroll.query("list") == null) return !0;
5942
5871
  const {
5943
5872
  length: n
5944
5873
  } = e.prefix, [r, s] = this.quill.getLine(t.index);
5945
- if (s > n)
5946
- return !0;
5874
+ if (s > n) return !0;
5947
5875
  let i;
5948
5876
  switch (e.prefix.trim()) {
5949
5877
  case "[]":
@@ -6214,12 +6142,10 @@ class Hp extends ot {
6214
6142
  }
6215
6143
  onCaptureCopy(e) {
6216
6144
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
6217
- if (e.defaultPrevented)
6218
- return;
6145
+ if (e.defaultPrevented) return;
6219
6146
  e.preventDefault();
6220
6147
  const [r] = this.quill.selection.getRange();
6221
- if (r == null)
6222
- return;
6148
+ if (r == null) return;
6223
6149
  const {
6224
6150
  html: s,
6225
6151
  text: i
@@ -6237,12 +6163,10 @@ class Hp extends ot {
6237
6163
  `);
6238
6164
  }
6239
6165
  onCapturePaste(e) {
6240
- if (e.defaultPrevented || !this.quill.isEnabled())
6241
- return;
6166
+ if (e.defaultPrevented || !this.quill.isEnabled()) return;
6242
6167
  e.preventDefault();
6243
6168
  const n = this.quill.getSelection(!0);
6244
- if (n == null)
6245
- return;
6169
+ if (n == null) return;
6246
6170
  const r = e.clipboardData?.getData("text/html");
6247
6171
  let s = e.clipboardData?.getData("text/plain");
6248
6172
  if (!r && !s) {
@@ -6311,8 +6235,7 @@ class Hp extends ot {
6311
6235
  }
6312
6236
  function an(t, e, n, r) {
6313
6237
  return r.query(e) ? t.reduce((s, i) => {
6314
- if (!i.insert)
6315
- return s;
6238
+ if (!i.insert) return s;
6316
6239
  if (i.attributes && i.attributes[e])
6317
6240
  return s.push(i);
6318
6241
  const a = n ? {
@@ -6328,15 +6251,13 @@ function mr(t, e) {
6328
6251
  let n = "";
6329
6252
  for (let r = t.ops.length - 1; r >= 0 && n.length < e.length; --r) {
6330
6253
  const s = t.ops[r];
6331
- if (typeof s.insert != "string")
6332
- break;
6254
+ if (typeof s.insert != "string") break;
6333
6255
  n = s.insert + n;
6334
6256
  }
6335
6257
  return n.slice(-1 * e.length) === e;
6336
6258
  }
6337
6259
  function St(t, e) {
6338
- if (!(t instanceof Element))
6339
- return !1;
6260
+ if (!(t instanceof Element)) return !1;
6340
6261
  const n = e.query(t);
6341
6262
  return n && n.prototype instanceof Be ? !1 : ["address", "article", "blockquote", "canvas", "dd", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "iframe", "li", "main", "nav", "ol", "output", "p", "pre", "section", "table", "td", "tr", "ul", "video"].includes(t.tagName.toLowerCase());
6342
6263
  }
@@ -6368,8 +6289,7 @@ function Kp(t, e, n) {
6368
6289
  }
6369
6290
  function Gp(t, e, n) {
6370
6291
  const r = n.query(t);
6371
- if (r == null)
6372
- return e;
6292
+ if (r == null) return e;
6373
6293
  if (r.prototype instanceof Be) {
6374
6294
  const s = {}, i = r.value(t);
6375
6295
  if (i != null)
@@ -6497,11 +6417,9 @@ class em extends ot {
6497
6417
  });
6498
6418
  }
6499
6419
  change(e, n) {
6500
- if (this.stack[e].length === 0)
6501
- return;
6420
+ if (this.stack[e].length === 0) return;
6502
6421
  const r = this.stack[e].pop();
6503
- if (!r)
6504
- return;
6422
+ if (!r) return;
6505
6423
  const s = this.quill.getContents(), i = r.delta.invert(s);
6506
6424
  this.stack[n].push({
6507
6425
  delta: i,
@@ -6518,8 +6436,7 @@ class em extends ot {
6518
6436
  this.lastRecorded = 0;
6519
6437
  }
6520
6438
  record(e, n) {
6521
- if (e.ops.length === 0)
6522
- return;
6439
+ if (e.ops.length === 0) return;
6523
6440
  this.stack.redo = [];
6524
6441
  let r = e.invert(n), s = this.currentRange;
6525
6442
  const i = Date.now();
@@ -6575,8 +6492,7 @@ function nm(t, e) {
6575
6492
  return tm(t, e) && (r -= 1), r;
6576
6493
  }
6577
6494
  function zi(t, e) {
6578
- if (!t)
6579
- return t;
6495
+ if (!t) return t;
6580
6496
  const n = e.transformPosition(t.index), r = e.transformPosition(t.index + t.length);
6581
6497
  return {
6582
6498
  index: n,
@@ -6644,8 +6560,7 @@ class sm extends ot {
6644
6560
  }
6645
6561
  replaceText(e) {
6646
6562
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
6647
- if (e.length === 0)
6648
- return !1;
6563
+ if (e.length === 0) return !1;
6649
6564
  if (n) {
6650
6565
  const r = this.quill.getFormat(e.index, 1);
6651
6566
  this.deleteRange(e), this.quill.updateContents(new k().retain(e.index).insert(n, r), A.sources.USER);
@@ -6710,8 +6625,7 @@ class cm extends ot {
6710
6625
  * the selection within the handler of a `selectionchange` event.
6711
6626
  */
6712
6627
  ensureListeningToSelectionChange() {
6713
- if (this.selectionChangeDeadline = Date.now() + om, this.isListening)
6714
- return;
6628
+ if (this.selectionChangeDeadline = Date.now() + om, this.isListening) return;
6715
6629
  this.isListening = !0;
6716
6630
  const e = () => {
6717
6631
  this.isListening = !1, Date.now() <= this.selectionChangeDeadline && this.handleSelectionChange();
@@ -6722,14 +6636,11 @@ class cm extends ot {
6722
6636
  }
6723
6637
  handleSelectionChange() {
6724
6638
  const e = document.getSelection();
6725
- if (!e)
6726
- return;
6639
+ if (!e) return;
6727
6640
  const n = e.getRangeAt(0);
6728
- if (n.collapsed !== !0 || n.startOffset !== 0)
6729
- return;
6641
+ if (n.collapsed !== !0 || n.startOffset !== 0) return;
6730
6642
  const r = this.quill.scroll.find(n.startContainer);
6731
- if (!(r instanceof Ve) || !r.uiNode)
6732
- return;
6643
+ if (!(r instanceof Ve) || !r.uiNode) return;
6733
6644
  const s = document.createRange();
6734
6645
  s.setStartAfter(r.uiNode), s.setEndAfter(r.uiNode), e.removeAllRanges(), e.addRange(s);
6735
6646
  }
@@ -6757,8 +6668,7 @@ class um extends Xe {
6757
6668
  if (n === "+1" || n === "-1") {
6758
6669
  const s = this.value(e) || 0;
6759
6670
  r = n === "+1" ? s + 1 : s - 1;
6760
- } else
6761
- typeof n == "number" && (r = n);
6671
+ } else typeof n == "number" && (r = n);
6762
6672
  return r === 0 ? (this.remove(e), !0) : super.add(e, r.toString());
6763
6673
  }
6764
6674
  canAdd(e, n) {
@@ -6802,8 +6712,7 @@ class Er extends ye {
6802
6712
  constructor(e, n) {
6803
6713
  super(e, n);
6804
6714
  const r = n.ownerDocument.createElement("span"), s = (i) => {
6805
- if (!e.isEnabled())
6806
- return;
6715
+ if (!e.isEnabled()) return;
6807
6716
  const a = this.statics.formats(n, e);
6808
6717
  a === "checked" ? (this.format("list", "unchecked"), i.preventDefault()) : a === "unchecked" && (this.format("list", "checked"), i.preventDefault());
6809
6718
  };
@@ -6866,10 +6775,8 @@ class pm extends Mt {
6866
6775
  return e === "super" ? document.createElement("sup") : e === "sub" ? document.createElement("sub") : super.create(e);
6867
6776
  }
6868
6777
  static formats(e) {
6869
- if (e.tagName === "SUB")
6870
- return "sub";
6871
- if (e.tagName === "SUP")
6872
- return "super";
6778
+ if (e.tagName === "SUB") return "sub";
6779
+ if (e.tagName === "SUP") return "super";
6873
6780
  }
6874
6781
  }
6875
6782
  class mm extends ba {
@@ -7010,8 +6917,7 @@ class er extends sn {
7010
6917
  }
7011
6918
  highlight(e) {
7012
6919
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
7013
- if (this.children.head == null)
7014
- return;
6920
+ if (this.children.head == null) return;
7015
6921
  const s = `${Array.from(this.domNode.childNodes).filter((a) => a !== this.uiNode).map((a) => a.textContent).join(`
7016
6922
  `)}
7017
6923
  `, i = $e.formats(this.children.head.domNode);
@@ -7073,8 +6979,7 @@ class ac extends ot {
7073
6979
  }
7074
6980
  initListener() {
7075
6981
  this.quill.on(A.events.SCROLL_BLOT_MOUNT, (e) => {
7076
- if (!(e instanceof er))
7077
- return;
6982
+ if (!(e instanceof er)) return;
7078
6983
  const n = this.quill.root.ownerDocument.createElement("select");
7079
6984
  this.options.languages.forEach((r) => {
7080
6985
  let {
@@ -7098,8 +7003,7 @@ class ac extends ot {
7098
7003
  }
7099
7004
  highlight() {
7100
7005
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
7101
- if (this.quill.selection.composing)
7102
- return;
7006
+ if (this.quill.selection.composing) return;
7103
7007
  this.quill.update(A.sources.USER);
7104
7008
  const r = this.quill.getSelection();
7105
7009
  (e == null ? this.quill.scroll.descendants(er) : [e]).forEach((i) => {
@@ -7213,8 +7117,7 @@ class Jt extends rn {
7213
7117
  }
7214
7118
  optimize(e) {
7215
7119
  super.optimize(e), this.children.forEach((n) => {
7216
- if (n.next == null)
7217
- return;
7120
+ if (n.next == null) return;
7218
7121
  const r = n.formats(), s = n.next.formats();
7219
7122
  if (r.table !== s.table) {
7220
7123
  const i = this.splitAfter(n);
@@ -7266,8 +7169,7 @@ class as extends rn {
7266
7169
  }
7267
7170
  insertRow(e) {
7268
7171
  const [n] = this.descendant(Ct);
7269
- if (n == null || n.children.head == null)
7270
- return;
7172
+ if (n == null || n.children.head == null) return;
7271
7173
  const r = Ea(), s = this.scroll.create(Jt.blotName);
7272
7174
  n.children.head.children.forEach(() => {
7273
7175
  const a = this.scroll.create(Ze.blotName, r);
@@ -7312,15 +7214,13 @@ class Nm extends ot {
7312
7214
  }
7313
7215
  deleteTable() {
7314
7216
  const [e] = this.getTable();
7315
- if (e == null)
7316
- return;
7217
+ if (e == null) return;
7317
7218
  const n = e.offset();
7318
7219
  e.remove(), this.quill.update(A.sources.USER), this.quill.setSelection(n, A.sources.SILENT);
7319
7220
  }
7320
7221
  getTable() {
7321
7222
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.quill.getSelection();
7322
- if (e == null)
7323
- return [null, null, null, -1];
7223
+ if (e == null) return [null, null, null, -1];
7324
7224
  const [n, r] = this.quill.getLine(e.index);
7325
7225
  if (n == null || n.statics.blotName !== Ze.blotName)
7326
7226
  return [null, null, null, -1];
@@ -7329,11 +7229,9 @@ class Nm extends ot {
7329
7229
  }
7330
7230
  insertColumn(e) {
7331
7231
  const n = this.quill.getSelection();
7332
- if (!n)
7333
- return;
7232
+ if (!n) return;
7334
7233
  const [r, s, i] = this.getTable(n);
7335
- if (i == null)
7336
- return;
7234
+ if (i == null) return;
7337
7235
  const a = i.cellOffset();
7338
7236
  r.insertColumn(a + e), this.quill.update(A.sources.USER);
7339
7237
  let o = s.rowOffset();
@@ -7347,11 +7245,9 @@ class Nm extends ot {
7347
7245
  }
7348
7246
  insertRow(e) {
7349
7247
  const n = this.quill.getSelection();
7350
- if (!n)
7351
- return;
7248
+ if (!n) return;
7352
7249
  const [r, s, i] = this.getTable(n);
7353
- if (i == null)
7354
- return;
7250
+ if (i == null) return;
7355
7251
  const a = s.rowOffset();
7356
7252
  r.insertRow(a + e), this.quill.update(A.sources.USER), e > 0 ? this.quill.setSelection(n, A.sources.SILENT) : this.quill.setSelection(n.index + s.children.length, n.length, A.sources.SILENT);
7357
7253
  }
@@ -7363,8 +7259,7 @@ class Nm extends ot {
7363
7259
  }
7364
7260
  insertTable(e, n) {
7365
7261
  const r = this.quill.getSelection();
7366
- if (r == null)
7367
- return;
7262
+ if (r == null) return;
7368
7263
  const s = new Array(e).fill(0).reduce((i) => {
7369
7264
  const a = new Array(n).fill(`
7370
7265
  `).join("");
@@ -7388,8 +7283,7 @@ class ya extends ot {
7388
7283
  if (super(e, n), Array.isArray(this.options.container)) {
7389
7284
  const r = document.createElement("div");
7390
7285
  r.setAttribute("role", "toolbar"), Am(r, this.options.container), e.container?.parentNode?.insertBefore(r, e.container), this.container = r;
7391
- } else
7392
- typeof this.options.container == "string" ? this.container = document.querySelector(this.options.container) : this.container = this.options.container;
7286
+ } else typeof this.options.container == "string" ? this.container = document.querySelector(this.options.container) : this.container = this.options.container;
7393
7287
  if (!(this.container instanceof HTMLElement)) {
7394
7288
  Co.error("Container required for toolbar", this.options);
7395
7289
  return;
@@ -7409,8 +7303,7 @@ class ya extends ot {
7409
7303
  }
7410
7304
  attach(e) {
7411
7305
  let n = Array.from(e.classList).find((s) => s.indexOf("ql-") === 0);
7412
- if (!n)
7413
- return;
7306
+ if (!n) return;
7414
7307
  if (n = n.slice(3), e.tagName === "BUTTON" && e.setAttribute("type", "button"), this.handlers[n] == null && this.quill.scroll.query(n) == null) {
7415
7308
  Co.warn("ignoring attaching to nonexistent format", n, e);
7416
7309
  return;
@@ -7419,8 +7312,7 @@ class ya extends ot {
7419
7312
  e.addEventListener(r, (s) => {
7420
7313
  let i;
7421
7314
  if (e.tagName === "SELECT") {
7422
- if (e.selectedIndex < 0)
7423
- return;
7315
+ if (e.selectedIndex < 0) return;
7424
7316
  const o = e.options[e.selectedIndex];
7425
7317
  o.hasAttribute("selected") ? i = !1 : i = o.value || !1;
7426
7318
  } else
@@ -7433,8 +7325,7 @@ class ya extends ot {
7433
7325
  // @ts-expect-error
7434
7326
  this.quill.scroll.query(n).prototype instanceof Be
7435
7327
  ) {
7436
- if (i = prompt(`Enter ${n}`), !i)
7437
- return;
7328
+ if (i = prompt(`Enter ${n}`), !i) return;
7438
7329
  this.quill.updateContents(new k().retain(a.index).delete(a.length).insert({
7439
7330
  [n]: i
7440
7331
  }), A.sources.USER);
@@ -7685,8 +7576,7 @@ class lc extends Ns {
7685
7576
  super.selectItem(e, n);
7686
7577
  const r = e || this.defaultItem;
7687
7578
  if (r != null) {
7688
- if (this.label.innerHTML === r.innerHTML)
7689
- return;
7579
+ if (this.label.innerHTML === r.innerHTML) return;
7690
7580
  this.label.innerHTML = r.innerHTML;
7691
7581
  }
7692
7582
  }
@@ -7810,8 +7700,7 @@ class uc extends cc {
7810
7700
  }
7811
7701
  edit() {
7812
7702
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "link", n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
7813
- if (this.root.classList.remove("ql-hidden"), this.root.classList.add("ql-editing"), this.textbox == null)
7814
- return;
7703
+ if (this.root.classList.remove("ql-hidden"), this.root.classList.add("ql-editing"), this.textbox == null) return;
7815
7704
  n != null ? this.textbox.value = n : e !== this.root.getAttribute("data-mode") && (this.textbox.value = "");
7816
7705
  const r = this.quill.getBounds(this.quill.selection.savedRange);
7817
7706
  r != null && this.position(r), this.textbox.select(), this.textbox.setAttribute("placeholder", this.textbox.getAttribute(`data-${e}`) || ""), this.root.setAttribute("data-mode", e);
@@ -7836,8 +7725,7 @@ class uc extends cc {
7836
7725
  case "video":
7837
7726
  e = ub(e);
7838
7727
  case "formula": {
7839
- if (!e)
7840
- break;
7728
+ if (!e) break;
7841
7729
  const n = this.quill.getSelection(!0);
7842
7730
  if (n != null) {
7843
7731
  const r = n.index + n.length;
@@ -7886,8 +7774,7 @@ class fb extends uc {
7886
7774
  const c = o[o.length - 1], u = this.quill.getIndex(c), d = Math.min(c.length() - 1, s.index + s.length - u), h = this.quill.getBounds(new Qt(u, d));
7887
7775
  h != null && this.position(h);
7888
7776
  }
7889
- } else
7890
- document.activeElement !== this.textbox && this.quill.hasFocus() && this.hide();
7777
+ } else document.activeElement !== this.textbox && this.quill.hasFocus() && this.hide();
7891
7778
  });
7892
7779
  }
7893
7780
  listen() {
@@ -7895,8 +7782,7 @@ class fb extends uc {
7895
7782
  this.root.classList.remove("ql-editing");
7896
7783
  }), this.quill.on(M.events.SCROLL_OPTIMIZE, () => {
7897
7784
  setTimeout(() => {
7898
- if (this.root.classList.contains("ql-hidden"))
7899
- return;
7785
+ if (this.root.classList.contains("ql-hidden")) return;
7900
7786
  const e = this.quill.getSelection();
7901
7787
  if (e != null) {
7902
7788
  const n = this.quill.getBounds(e);
@@ -7993,8 +7879,7 @@ fc.DEFAULTS = xt({}, yr.DEFAULTS, {
7993
7879
  link(t) {
7994
7880
  if (t) {
7995
7881
  const e = this.quill.getSelection();
7996
- if (e == null || e.length === 0)
7997
- return;
7882
+ if (e == null || e.length === 0) return;
7998
7883
  let n = this.quill.getText(e);
7999
7884
  /^\S+@\S+\.\S+$/.test(n) && n.indexOf("mailto:") !== 0 && (n = `mailto:${n}`);
8000
7885
  const {
@@ -8124,8 +8009,7 @@ class bb {
8124
8009
  *
8125
8010
  * @param {Node} node */
8126
8011
  openNode(e) {
8127
- if (!Do(e))
8128
- return;
8012
+ if (!Do(e)) return;
8129
8013
  const n = mb(
8130
8014
  e.scope,
8131
8015
  { prefix: this.classPrefix }
@@ -8182,8 +8066,7 @@ class _a {
8182
8066
  return this.stack.pop();
8183
8067
  }
8184
8068
  closeAllNodes() {
8185
- for (; this.closeNode(); )
8186
- ;
8069
+ for (; this.closeNode(); ) ;
8187
8070
  }
8188
8071
  toJSON() {
8189
8072
  return JSON.stringify(this.rootNode, null, 4);
@@ -8486,8 +8369,7 @@ function Kb(t, e) {
8486
8369
  }
8487
8370
  function Gb(t, e) {
8488
8371
  if (t.match) {
8489
- if (t.begin || t.end)
8490
- throw new Error("begin & end are not supported with match");
8372
+ if (t.begin || t.end) throw new Error("begin & end are not supported with match");
8491
8373
  t.begin = t.match, delete t.match;
8492
8374
  }
8493
8375
  }
@@ -8495,10 +8377,8 @@ function jb(t, e) {
8495
8377
  t.relevance === void 0 && (t.relevance = 1);
8496
8378
  }
8497
8379
  const Zb = (t, e) => {
8498
- if (!t.beforeMatch)
8499
- return;
8500
- if (t.starts)
8501
- throw new Error("beforeMatch cannot be used with starts");
8380
+ if (!t.beforeMatch) return;
8381
+ if (t.starts) throw new Error("beforeMatch cannot be used with starts");
8502
8382
  const n = Object.assign({}, t);
8503
8383
  Object.keys(t).forEach((r) => {
8504
8384
  delete t[r];
@@ -8619,8 +8499,7 @@ function n1(t) {
8619
8499
  }
8620
8500
  // @ts-ignore
8621
8501
  getMatcher(o) {
8622
- if (this.multiRegexes[o])
8623
- return this.multiRegexes[o];
8502
+ if (this.multiRegexes[o]) return this.multiRegexes[o];
8624
8503
  const c = new n();
8625
8504
  return this.rules.slice(o).forEach(([u, d]) => c.addRule(u, d)), c.compile(), this.multiRegexes[o] = c, c;
8626
8505
  }
@@ -8655,8 +8534,7 @@ function n1(t) {
8655
8534
  /** @type CompiledMode */
8656
8535
  a
8657
8536
  );
8658
- if (a.isCompiled)
8659
- return c;
8537
+ if (a.isCompiled) return c;
8660
8538
  [
8661
8539
  Hb,
8662
8540
  // do this early so compiler extensions generally don't have to worry about
@@ -8779,8 +8657,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), G = x, R = C), $ ===
8779
8657
  U += W.substring(L), se.addText(U);
8780
8658
  }
8781
8659
  function lt() {
8782
- if (W === "")
8783
- return;
8660
+ if (W === "") return;
8784
8661
  let L = null;
8785
8662
  if (typeof P.subLanguage == "string") {
8786
8663
  if (!e[P.subLanguage]) {
@@ -8900,8 +8777,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), G = x, R = C), $ ===
8900
8777
  for (P.matcher.considerAll(); ; ) {
8901
8778
  et++, Ut ? Ut = !1 : P.matcher.considerAll(), P.matcher.lastIndex = pe;
8902
8779
  const L = P.matcher.exec(C);
8903
- if (!L)
8904
- break;
8780
+ if (!L) break;
8905
8781
  const I = C.substring(pe, L.index), U = $t(I, L);
8906
8782
  pe = L.index + U;
8907
8783
  }
@@ -8961,8 +8837,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), G = x, R = C), $ ===
8961
8837
  );
8962
8838
  R.unshift($);
8963
8839
  const G = R.sort((z, Oe) => {
8964
- if (z.relevance !== Oe.relevance)
8965
- return Oe.relevance - z.relevance;
8840
+ if (z.relevance !== Oe.relevance) return Oe.relevance - z.relevance;
8966
8841
  if (z.language && Oe.language) {
8967
8842
  if (X(z.language).supersetOf === Oe.language)
8968
8843
  return 1;
@@ -8980,8 +8855,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), G = x, R = C), $ ===
8980
8855
  function E(x) {
8981
8856
  let C = null;
8982
8857
  const $ = u(x);
8983
- if (c($))
8984
- return;
8858
+ if (c($)) return;
8985
8859
  if (ue(
8986
8860
  "before:highlightElement",
8987
8861
  { el: x, language: $ }
@@ -16249,8 +16123,7 @@ function O0(t, e = {}) {
16249
16123
  throw new Error(`invalid object value '${n}'${cs(e)}`);
16250
16124
  }
16251
16125
  function jo(t) {
16252
- if (t === void 0)
16253
- return {};
16126
+ if (t === void 0) return {};
16254
16127
  const e = O0(t);
16255
16128
  return {
16256
16129
  handle: T0(e.handle),
@@ -16369,8 +16242,7 @@ function F0({
16369
16242
  label: a("makeImagePropertiesDialog.right")
16370
16243
  }], [t()]), _ = async () => {
16371
16244
  const v = u();
16372
- if (!e || !v)
16373
- throw new Error("missing a find variant name");
16245
+ if (!e || !v) throw new Error("missing a find variant name");
16374
16246
  c(!0);
16375
16247
  const {
16376
16248
  url: S,
@@ -16468,12 +16340,9 @@ function z0(t) {
16468
16340
  return Uc(t) ? Ta(t) ? "mailto" : "tel" : "raw";
16469
16341
  }
16470
16342
  function Fc(t) {
16471
- if (t === "raw")
16472
- return "raw";
16473
- if (t === "mailto")
16474
- return "mailto";
16475
- if (t === "tel")
16476
- return "tel";
16343
+ if (t === "raw") return "raw";
16344
+ if (t === "mailto") return "mailto";
16345
+ if (t === "tel") return "tel";
16477
16346
  throw new Error(`invalid link-type '${t}'`);
16478
16347
  }
16479
16348
  var K0 = /* @__PURE__ */ ee("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"), G0 = /* @__PURE__ */ ee('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'), j0 = /* @__PURE__ */ ee('<button class="QpBtn danger outlined"type=button>'), Z0 = /* @__PURE__ */ ee("<button class=QpBtn type=button>");
@@ -16531,17 +16400,14 @@ function Hc(t, e, n) {
16531
16400
  }
16532
16401
  function Y0(t) {
16533
16402
  const e = wa(t), [n] = t.getLeaf(e);
16534
- if (!n)
16535
- throw new Error("editor.getLeaf() returns undefined");
16403
+ if (!n) throw new Error("editor.getLeaf() returns undefined");
16536
16404
  return n.domNode;
16537
16405
  }
16538
16406
  function zc(t, e, n) {
16539
- if (e.html === void 0)
16540
- throw new Error("html is undefined");
16407
+ if (e.html === void 0) throw new Error("html is undefined");
16541
16408
  t.insertEmbed(n, "html-snippet", e);
16542
16409
  const [r] = t.getLeaf(n + 1);
16543
- if (!r)
16544
- throw new Error("missing last inserted element");
16410
+ if (!r) throw new Error("missing last inserted element");
16545
16411
  return r.domNode;
16546
16412
  }
16547
16413
  function wa(t) {
@@ -16550,14 +16416,11 @@ function wa(t) {
16550
16416
  }
16551
16417
  function X0(t) {
16552
16418
  const { uid: e } = t.dataset;
16553
- if (e)
16554
- return e;
16419
+ if (e) return e;
16555
16420
  const n = t.getAttribute("src");
16556
- if (!n)
16557
- return;
16421
+ if (!n) return;
16558
16422
  const { pathname: r } = new URL(n), s = r.split("/"), a = s[s.length - 1].match(/^([0-9a-f-]{36})\-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);
16559
- if (!a)
16560
- return;
16423
+ if (!a) return;
16561
16424
  const [, o] = a;
16562
16425
  return o;
16563
16426
  }
@@ -16567,20 +16430,14 @@ function Q0(t) {
16567
16430
  }
16568
16431
  function Kc(t) {
16569
16432
  const e = t.classList;
16570
- if (e.contains("center"))
16571
- return "center";
16572
- if (e.contains("left"))
16573
- return "left";
16574
- if (e.contains("right"))
16575
- return "right";
16433
+ if (e.contains("center")) return "center";
16434
+ if (e.contains("left")) return "left";
16435
+ if (e.contains("right")) return "right";
16576
16436
  }
16577
16437
  function J0(t) {
16578
- if (t === "center")
16579
- return "center";
16580
- if (t === "left")
16581
- return "left";
16582
- if (t === "right")
16583
- return "right";
16438
+ if (t === "center") return "center";
16439
+ if (t === "left") return "left";
16440
+ if (t === "right") return "right";
16584
16441
  }
16585
16442
  async function eE({
16586
16443
  editor: t,
@@ -16615,11 +16472,9 @@ async function Gc({
16615
16472
  asALink: i ? i !== "raw" : !1
16616
16473
  }
16617
16474
  });
16618
- if (!a)
16619
- return;
16475
+ if (!a) return;
16620
16476
  const o = A.find(t);
16621
- if (!o || o instanceof A)
16622
- throw new Error("missing embed blot");
16477
+ if (!o || o instanceof A) throw new Error("missing embed blot");
16623
16478
  const c = r.getIndex(o);
16624
16479
  a.action === "remove" && (o.remove(), r.insertText(c, s)), a.action === "update" && (o.remove(), r.insertText(c, a.content ?? "", {
16625
16480
  obfuscate: a.asALink ?? "raw"
@@ -16654,8 +16509,7 @@ function nE({ quillEditor: t, pluginOptions: e, language: n }) {
16654
16509
  const { themeConf: r, useImage: s } = e;
16655
16510
  return {
16656
16511
  insertHtmlSnippetHandler: async (c) => {
16657
- if (!t)
16658
- return;
16512
+ if (!t) return;
16659
16513
  const u = Y0(t);
16660
16514
  await sE({
16661
16515
  editorContent: u,
@@ -16665,8 +16519,7 @@ function nE({ quillEditor: t, pluginOptions: e, language: n }) {
16665
16519
  });
16666
16520
  },
16667
16521
  insertMedia: async (c) => {
16668
- if (!t)
16669
- return;
16522
+ if (!t) return;
16670
16523
  if (!iE(c)) {
16671
16524
  V0(t, {
16672
16525
  label: c.originalName,
@@ -16685,8 +16538,7 @@ function nE({ quillEditor: t, pluginOptions: e, language: n }) {
16685
16538
  });
16686
16539
  },
16687
16540
  insertObfuscateBlotHandler: () => {
16688
- if (!t)
16689
- return;
16541
+ if (!t) return;
16690
16542
  const c = t.getSelection();
16691
16543
  !c || c.length === 0 || rE({
16692
16544
  userSelection: c,
@@ -16744,20 +16596,16 @@ function Sa({
16744
16596
  insertElementHandler: s
16745
16597
  }) {
16746
16598
  const i = A.find(e);
16747
- if (!i || i instanceof A)
16748
- throw new Error("missing embed blot");
16599
+ if (!i || i instanceof A) throw new Error("missing embed blot");
16749
16600
  const a = t.getIndex(i), o = new k();
16750
16601
  if (!(a === void 0 || a === -1)) {
16751
16602
  if (r === "insert") {
16752
- if (!n)
16753
- return;
16603
+ if (!n) return;
16754
16604
  s(t, n, a);
16755
16605
  } else if (r === "update") {
16756
- if (!n)
16757
- return;
16606
+ if (!n) return;
16758
16607
  s(t, n, a), o.retain(a + 1), o.delete(1);
16759
- } else
16760
- r === "remove" && (o.retain(a), o.delete(1));
16608
+ } else r === "remove" && (o.retain(a), o.delete(1));
16761
16609
  t.updateContents(o);
16762
16610
  }
16763
16611
  }
@@ -16851,8 +16699,7 @@ function hE() {
16851
16699
  }
16852
16700
  static formats(e) {
16853
16701
  const { asALink: n } = e.dataset;
16854
- if (!n)
16855
- throw new Error("No data attribute data-as-a-link");
16702
+ if (!n) throw new Error("No data attribute data-as-a-link");
16856
16703
  return Fc(n);
16857
16704
  }
16858
16705
  };
@@ -16877,8 +16724,7 @@ function SE(t) {
16877
16724
  });
16878
16725
  let u;
16879
16726
  Wr(() => {
16880
- if (!a())
16881
- return;
16727
+ if (!a()) return;
16882
16728
  const h = nE({
16883
16729
  quillEditor: a(),
16884
16730
  pluginOptions: t,
@@ -16886,8 +16732,7 @@ function SE(t) {
16886
16732
  });
16887
16733
  u = h.insertMedia;
16888
16734
  const g = a();
16889
- if (!g)
16890
- return;
16735
+ if (!g) return;
16891
16736
  const p = g.getModule("toolbar");
16892
16737
  p.addHandler("html-snippet", h.insertHtmlSnippetHandler), p.addHandler("obfuscate", h.insertObfuscateBlotHandler);
16893
16738
  const m = g.root, E = (y) => d(y, g, t.themeConf);