monowind 0.2.1 → 0.2.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.
- package/README.md +13 -0
- package/dist/borders.d.ts +12 -9
- package/dist/borders.d.ts.map +1 -1
- package/dist/cdn.js +35 -28
- package/dist/cdn.js.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/flex.d.ts.map +1 -1
- package/dist/glyphs.d.ts +9 -0
- package/dist/glyphs.d.ts.map +1 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/index.js +1203 -798
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +7 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/multicol.d.ts.map +1 -1
- package/dist/plain-text.d.ts +14 -2
- package/dist/plain-text.d.ts.map +1 -1
- package/dist/pointer.d.ts +15 -6
- package/dist/pointer.d.ts.map +1 -1
- package/dist/sort.js +1 -1
- package/dist/sort.js.map +1 -1
- package/dist/style.d.ts.map +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/types.d.ts +75 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/styles.css +54 -1
- package/src/{rules.css → utilities.css} +25 -0
package/dist/index.js
CHANGED
|
@@ -289,7 +289,7 @@ function D(e) {
|
|
|
289
289
|
}
|
|
290
290
|
return t;
|
|
291
291
|
}
|
|
292
|
-
var O = (e) => D(Array(16)
|
|
292
|
+
var O = (e) => D(Array.from({ length: 16 }, () => e));
|
|
293
293
|
x("default", {}), x("rounded", { solid: {
|
|
294
294
|
tl: "╭",
|
|
295
295
|
tr: "╮",
|
|
@@ -302,7 +302,11 @@ var k = {
|
|
|
302
302
|
v: "|"
|
|
303
303
|
};
|
|
304
304
|
x("ascii", {
|
|
305
|
-
solid:
|
|
305
|
+
solid: {
|
|
306
|
+
...k,
|
|
307
|
+
scrollTrack: "|",
|
|
308
|
+
scrollThumb: "#"
|
|
309
|
+
},
|
|
306
310
|
double: {
|
|
307
311
|
...k,
|
|
308
312
|
h: "="
|
|
@@ -322,7 +326,14 @@ x("single", {
|
|
|
322
326
|
}), x("cp437", {
|
|
323
327
|
dashed: A,
|
|
324
328
|
dotted: A
|
|
325
|
-
})
|
|
329
|
+
});
|
|
330
|
+
function j(e) {
|
|
331
|
+
return {
|
|
332
|
+
track: e?.solid?.scrollTrack ?? "░",
|
|
333
|
+
thumb: e?.solid?.scrollThumb ?? "█"
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
x("blocks", {
|
|
326
337
|
solid: O("█"),
|
|
327
338
|
double: O("█"),
|
|
328
339
|
dashed: O("▒"),
|
|
@@ -330,52 +341,52 @@ x("single", {
|
|
|
330
341
|
});
|
|
331
342
|
//#endregion
|
|
332
343
|
//#region src/warn.ts
|
|
333
|
-
var
|
|
334
|
-
function
|
|
335
|
-
let n =
|
|
336
|
-
n ||
|
|
344
|
+
var M = /* @__PURE__ */ new WeakMap();
|
|
345
|
+
function N(e, t) {
|
|
346
|
+
let n = M.get(e);
|
|
347
|
+
n || M.set(e, n = /* @__PURE__ */ new Set()), !n.has(t) && (n.add(t), console.warn(`[monowind] ${t}`, e));
|
|
337
348
|
}
|
|
338
349
|
//#endregion
|
|
339
350
|
//#region src/leaf.ts
|
|
340
|
-
var
|
|
341
|
-
function
|
|
351
|
+
var ee = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Set();
|
|
352
|
+
function ne(e) {
|
|
342
353
|
let t = e.tag.toLowerCase();
|
|
343
354
|
if (!t.includes("-")) {
|
|
344
355
|
console.warn(`[monowind] registerLeafRenderer: "${e.tag}" is not a custom-element tag name (needs a hyphen); ignored.`);
|
|
345
356
|
return;
|
|
346
357
|
}
|
|
347
|
-
|
|
358
|
+
ee.has(t) && console.warn(`[monowind] registerLeafRenderer: replacing existing renderer for <${t}> (last registration wins).`), ee.set(t, {
|
|
348
359
|
...e,
|
|
349
360
|
tag: t
|
|
350
|
-
}),
|
|
361
|
+
}), ce();
|
|
351
362
|
}
|
|
352
|
-
function
|
|
353
|
-
|
|
363
|
+
function re() {
|
|
364
|
+
ce();
|
|
354
365
|
}
|
|
355
|
-
function
|
|
356
|
-
return
|
|
366
|
+
function ie(e) {
|
|
367
|
+
return ee.get(e.toLowerCase());
|
|
357
368
|
}
|
|
358
|
-
function
|
|
369
|
+
function ae() {
|
|
359
370
|
let e = /* @__PURE__ */ new Set();
|
|
360
|
-
for (let t of
|
|
371
|
+
for (let t of ee.values()) for (let n of t.observedAttributes ?? []) e.add(n.toLowerCase());
|
|
361
372
|
return [...e];
|
|
362
373
|
}
|
|
363
|
-
function
|
|
364
|
-
return
|
|
374
|
+
function oe(e) {
|
|
375
|
+
return te.add(e), () => te.delete(e);
|
|
365
376
|
}
|
|
366
|
-
function
|
|
377
|
+
function se(e, t) {
|
|
367
378
|
try {
|
|
368
379
|
return e.render(t);
|
|
369
380
|
} catch (n) {
|
|
370
|
-
return
|
|
381
|
+
return N(t, `<${e.tag}> renderer threw; rendering nothing. ${String(n)}`), null;
|
|
371
382
|
}
|
|
372
383
|
}
|
|
373
|
-
function
|
|
374
|
-
for (let e of
|
|
384
|
+
function ce() {
|
|
385
|
+
for (let e of te) e();
|
|
375
386
|
}
|
|
376
387
|
//#endregion
|
|
377
388
|
//#region src/borders.ts
|
|
378
|
-
function
|
|
389
|
+
function le(e, t, n) {
|
|
379
390
|
let r = e.border;
|
|
380
391
|
if (r.top === 0 && r.right === 0 && r.bottom === 0 && r.left === 0) return;
|
|
381
392
|
let i = Math.max(r.top, r.right, r.bottom, r.left);
|
|
@@ -391,11 +402,11 @@ function ce(e, t, n) {
|
|
|
391
402
|
width: t.width - (i.left ? a : 0) - (i.right ? a : 0),
|
|
392
403
|
height: t.height - (i.top ? a : 0) - (i.bottom ? a : 0)
|
|
393
404
|
};
|
|
394
|
-
o.width <= 0 || o.height <= 0 ||
|
|
405
|
+
o.width <= 0 || o.height <= 0 || ue(n, e.borderStyle, e.borderColor, o, i, S(e.glyphSet));
|
|
395
406
|
}
|
|
396
407
|
}
|
|
397
|
-
function
|
|
398
|
-
let o =
|
|
408
|
+
function ue(e, t, n, r, i, a) {
|
|
409
|
+
let o = he(t.top, a), s = he(t.right, a), c = he(t.bottom, a), l = he(t.left, a), u = (e, t, n) => n(he(e === t ? e : "solid", a)), { x: d, y: f, width: p, height: m } = r, h = p >= 2 && m >= 2, g = d + +!!i.left, _ = d + p - +!!i.right, v = f + +!!i.top, y = f + m - +!!i.bottom;
|
|
399
410
|
if (i.top && _ > g && e.push({
|
|
400
411
|
glyph: o.h,
|
|
401
412
|
x: g,
|
|
@@ -448,24 +459,25 @@ function le(e, t, n, r, i, a) {
|
|
|
448
459
|
color: n.bottom
|
|
449
460
|
}));
|
|
450
461
|
}
|
|
451
|
-
function
|
|
452
|
-
return e.style.position !== "static" || t.style.display === "flex" || t.style.display === "grid";
|
|
462
|
+
function de(e, t) {
|
|
463
|
+
return e.style.position !== "static" || (t.style.display === "flex" || t.style.display === "grid") && e.style.zIndex !== null;
|
|
453
464
|
}
|
|
454
|
-
function
|
|
465
|
+
function fe(e) {
|
|
455
466
|
if (e.children.length <= 1) return e.children;
|
|
456
|
-
let t = null, n = null, r = null;
|
|
457
|
-
for (let
|
|
458
|
-
return
|
|
467
|
+
let t = null, n = null, r = null, i = null;
|
|
468
|
+
for (let a of e.children) de(a, e) ? (a.style.zIndex ?? 0) < 0 ? (t ??= []).push(a) : (i ??= []).push(a) : a.inlineBox ? (r ??= []).push(a) : (n ??= []).push(a);
|
|
469
|
+
return t && t.length > 1 && t.sort((e, t) => (e.style.zIndex ?? 0) - (t.style.zIndex ?? 0)), i && i.length > 1 && i.sort((e, t) => (e.style.zIndex ?? 0) - (t.style.zIndex ?? 0)), !t && n && !r && !i ? n : !t && !n && r && !i ? r : !t && !n && !r && i ? i : [
|
|
459
470
|
...t ?? [],
|
|
460
471
|
...n ?? [],
|
|
461
|
-
...r ?? []
|
|
472
|
+
...r ?? [],
|
|
473
|
+
...i ?? []
|
|
462
474
|
];
|
|
463
475
|
}
|
|
464
|
-
function
|
|
465
|
-
let r =
|
|
476
|
+
function pe(e, t, n) {
|
|
477
|
+
let r = he(e, n);
|
|
466
478
|
return t === "h" ? r.h : r.v;
|
|
467
479
|
}
|
|
468
|
-
function
|
|
480
|
+
function me(e, t, n, r, i, a) {
|
|
469
481
|
let o = (t ? 8 : 0) | (n ? 4 : 0) | (r ? 2 : 0) | !!i;
|
|
470
482
|
if (a) {
|
|
471
483
|
let t = w(o), n = t && a[e]?.[t];
|
|
@@ -473,8 +485,8 @@ function pe(e, t, n, r, i, a) {
|
|
|
473
485
|
}
|
|
474
486
|
return (e === "double" ? E : T)[o];
|
|
475
487
|
}
|
|
476
|
-
function
|
|
477
|
-
let n = (n, r, i, a) =>
|
|
488
|
+
function he(e, t) {
|
|
489
|
+
let n = (n, r, i, a) => me(e, n, r, i, a, t), r = {
|
|
478
490
|
h: n(!1, !1, !0, !0),
|
|
479
491
|
v: n(!0, !0, !1, !1),
|
|
480
492
|
tl: n(!1, !0, !1, !0),
|
|
@@ -485,24 +497,24 @@ function me(e, t) {
|
|
|
485
497
|
return e === "dashed" ? {
|
|
486
498
|
h: "╌",
|
|
487
499
|
v: "╎",
|
|
488
|
-
...
|
|
489
|
-
...
|
|
500
|
+
...ge(r),
|
|
501
|
+
..._e(t, e)
|
|
490
502
|
} : e === "dotted" ? {
|
|
491
503
|
h: "┄",
|
|
492
504
|
v: "┊",
|
|
493
|
-
...
|
|
494
|
-
...
|
|
505
|
+
...ge(r),
|
|
506
|
+
..._e(t, e)
|
|
495
507
|
} : r;
|
|
496
508
|
}
|
|
497
|
-
function
|
|
509
|
+
function ge(e) {
|
|
498
510
|
let { h: t, v: n, ...r } = e;
|
|
499
511
|
return r;
|
|
500
512
|
}
|
|
501
|
-
function
|
|
513
|
+
function _e(e, t) {
|
|
502
514
|
let n = e?.[t], r = {};
|
|
503
515
|
return n?.h && (r.h = n.h), n?.v && (r.v = n.v), r;
|
|
504
516
|
}
|
|
505
|
-
function
|
|
517
|
+
function ve(e, t, n, r) {
|
|
506
518
|
let i = e.map((e) => e.spanned ? !1 : n === "between" ? e.beforeOccupied && e.afterOccupied : n !== "around" || e.beforeOccupied || e.afterOccupied), a = [];
|
|
507
519
|
for (let n = 0; n < e.length; n++) if (a.push({
|
|
508
520
|
start: e[n].start,
|
|
@@ -546,7 +558,7 @@ function _e(e, t, n, r) {
|
|
|
546
558
|
end: e.end - r
|
|
547
559
|
})).filter((e) => e.end > e.start);
|
|
548
560
|
}
|
|
549
|
-
function
|
|
561
|
+
function ye(e) {
|
|
550
562
|
let t = [], n = e.border.left + e.padding.left, r = e.border.top + e.padding.top, i = (e, t) => ({
|
|
551
563
|
line: t.bandStart + Math.floor((t.bandSize - e.width) / 2),
|
|
552
564
|
start: t.start,
|
|
@@ -555,7 +567,7 @@ function ve(e) {
|
|
|
555
567
|
endHalf: t.endHalf === !0
|
|
556
568
|
}), a = e.ruleX ? e.vertical.map((t) => i(e.ruleX, t)) : [], o = e.ruleY ? e.horizontal.map((t) => i(e.ruleY, t)) : [], s = e.ruleX?.width ?? 0, c = e.ruleY?.width ?? 0, l = (e, t, n, r) => e.some((e) => n >= e.line && n < e.line + t && (e.start < r && e.end > r || e.end === r && !e.endHalf || e.start === r && !e.startHalf)), u = (e, t) => o.some((n) => t >= n.line && t < n.line + c && e >= n.start && e < n.end);
|
|
557
569
|
if (e.ruleX) {
|
|
558
|
-
let i =
|
|
570
|
+
let i = pe(e.ruleX.style, "v", e.glyphs);
|
|
559
571
|
for (let o of a) {
|
|
560
572
|
for (let a = 0; a < s; a++) for (let s = o.start; s < o.end; s++) u(o.line + a, s) || t.push({
|
|
561
573
|
glyph: i,
|
|
@@ -564,7 +576,7 @@ function ve(e) {
|
|
|
564
576
|
length: 1,
|
|
565
577
|
color: e.ruleX.color
|
|
566
578
|
});
|
|
567
|
-
|
|
579
|
+
be(e, t, "x", o.line, o.start, o.end);
|
|
568
580
|
}
|
|
569
581
|
}
|
|
570
582
|
if (e.ruleY) {
|
|
@@ -575,7 +587,7 @@ function ve(e) {
|
|
|
575
587
|
for (let d = u.start; d < u.end; d++) {
|
|
576
588
|
let u = l(a, s, d, f), p = l(a, s, d, f + 1);
|
|
577
589
|
t.push({
|
|
578
|
-
glyph: u || p ?
|
|
590
|
+
glyph: u || p ? me(i ? "double" : "solid", u, p, l(o, c, f, d), l(o, c, f, d + 1), e.glyphs) : pe(e.ruleY.style, "h", e.glyphs),
|
|
579
591
|
x: n + d,
|
|
580
592
|
y: r + f,
|
|
581
593
|
length: 1,
|
|
@@ -583,16 +595,16 @@ function ve(e) {
|
|
|
583
595
|
});
|
|
584
596
|
}
|
|
585
597
|
}
|
|
586
|
-
|
|
598
|
+
be(e, t, "y", u.line, u.start, u.end);
|
|
587
599
|
}
|
|
588
600
|
}
|
|
589
601
|
return t;
|
|
590
602
|
}
|
|
591
|
-
function
|
|
603
|
+
function be(e, t, n, r, i, a) {
|
|
592
604
|
let o = n === "x" ? e.ruleX : e.ruleY, s = e.border.left + e.padding.left, c = e.border.top + e.padding.top, l = s + e.contentWidth + e.padding.right + e.border.right, u = c + e.contentHeight + e.padding.bottom + e.border.bottom, d = (n, r, i, a, s, c, l, u) => {
|
|
593
605
|
let d = o.style === "double" && i === "double" ? "double" : "solid";
|
|
594
606
|
t.push({
|
|
595
|
-
glyph:
|
|
607
|
+
glyph: me(d, s, c, l, u, e.glyphs),
|
|
596
608
|
x: n,
|
|
597
609
|
y: r,
|
|
598
610
|
length: 1,
|
|
@@ -610,19 +622,26 @@ function ye(e, t, n, r, i, a) {
|
|
|
610
622
|
}
|
|
611
623
|
//#endregion
|
|
612
624
|
//#region src/pointer.ts
|
|
613
|
-
function
|
|
625
|
+
function xe(e, t, n) {
|
|
614
626
|
let r = [], i = e, a = e.localRect.x, o = e.localRect.y;
|
|
615
627
|
for (;;) {
|
|
616
628
|
let e = null;
|
|
617
|
-
for (let r of
|
|
629
|
+
for (let r of fe(i)) {
|
|
618
630
|
if (r.tableHidden) continue;
|
|
619
631
|
let i = a + r.localRect.x, s = o + r.localRect.y;
|
|
620
632
|
t >= i && t < i + r.localRect.width && n >= s && n < s + r.localRect.height && (e = r);
|
|
621
633
|
}
|
|
622
634
|
if (!e) return r;
|
|
623
|
-
r.push(
|
|
635
|
+
r.push({
|
|
636
|
+
node: e,
|
|
637
|
+
x: a + e.localRect.x,
|
|
638
|
+
y: o + e.localRect.y
|
|
639
|
+
}), a += e.localRect.x - (e.scroll?.x ?? 0), o += e.localRect.y - (e.scroll?.y ?? 0), i = e;
|
|
624
640
|
}
|
|
625
641
|
}
|
|
642
|
+
function Se(e, t, n) {
|
|
643
|
+
return xe(e, t, n).map((e) => e.node.source);
|
|
644
|
+
}
|
|
626
645
|
//#endregion
|
|
627
646
|
//#region src/metrics.ts
|
|
628
647
|
function P(e) {
|
|
@@ -631,10 +650,10 @@ function P(e) {
|
|
|
631
650
|
function F(e, t) {
|
|
632
651
|
return t <= 0 ? 0 : P(e / (.25 * t));
|
|
633
652
|
}
|
|
634
|
-
function
|
|
653
|
+
function Ce(e, t) {
|
|
635
654
|
return P(t * e / 100);
|
|
636
655
|
}
|
|
637
|
-
function
|
|
656
|
+
function we(e, t) {
|
|
638
657
|
let n = t.getBoundingClientRect(), r = parseFloat(getComputedStyle(e).letterSpacing) || 0, i = t.ownerDocument.createRange();
|
|
639
658
|
i.selectNodeContents(t);
|
|
640
659
|
let a = Math.max(0, i.getBoundingClientRect().height - n.height);
|
|
@@ -645,56 +664,56 @@ function Se(e, t) {
|
|
|
645
664
|
inkOverhang: a
|
|
646
665
|
};
|
|
647
666
|
}
|
|
648
|
-
function
|
|
667
|
+
function Te() {
|
|
649
668
|
return parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
650
669
|
}
|
|
651
670
|
//#endregion
|
|
652
671
|
//#region src/wrap.ts
|
|
653
|
-
function
|
|
654
|
-
return
|
|
672
|
+
function Ee(e, t, n = {}) {
|
|
673
|
+
return Ae(e, t, n).map((t) => e.slice(t.start, t.end));
|
|
655
674
|
}
|
|
656
|
-
function
|
|
657
|
-
return
|
|
675
|
+
function De(e, t, n = {}) {
|
|
676
|
+
return Ae(e, t, n).length;
|
|
658
677
|
}
|
|
659
|
-
function
|
|
678
|
+
function Oe(e, t) {
|
|
660
679
|
return t.endsWith("\n") && e.pop(), e;
|
|
661
680
|
}
|
|
662
|
-
function
|
|
681
|
+
function ke(e) {
|
|
663
682
|
let t = [], n = 0;
|
|
664
683
|
for (let r = 0; r <= e.length; r++) (r === e.length || e[r] === "\n") && (t.push({
|
|
665
684
|
start: n,
|
|
666
685
|
end: r
|
|
667
686
|
}), n = r + 1);
|
|
668
|
-
return
|
|
687
|
+
return Oe(t, e);
|
|
669
688
|
}
|
|
670
|
-
function
|
|
689
|
+
function Ae(e, t, n = {}) {
|
|
671
690
|
if (!/[^ \t\r\f]/.test(e)) return [];
|
|
672
691
|
let r = [], i = 0, a = n.firstLineIndent ?? 0;
|
|
673
|
-
for (let o = 0; o <= e.length; o++) (o === e.length || e[o] === "\n") && (r.push(...
|
|
674
|
-
return
|
|
692
|
+
for (let o = 0; o <= e.length; o++) (o === e.length || e[o] === "\n") && (r.push(...Re(e, i, o, t, n, a)), a = 0, i = o + 1);
|
|
693
|
+
return Oe(r, e);
|
|
675
694
|
}
|
|
676
|
-
function
|
|
695
|
+
function je(e, t, n) {
|
|
677
696
|
if (!n) return t - e;
|
|
678
697
|
let r = 0;
|
|
679
698
|
for (let i = e; i < t; i++) r += n[i] ?? 1;
|
|
680
699
|
return r;
|
|
681
700
|
}
|
|
682
701
|
function I(e, t, n, r = 0) {
|
|
683
|
-
return t <= e ? 0 :
|
|
702
|
+
return t <= e ? 0 : je(e, t, n) - Math.min(r, Me(t - 1, n));
|
|
684
703
|
}
|
|
685
|
-
function
|
|
704
|
+
function Me(e, t) {
|
|
686
705
|
return t ? (t[e] ?? 1) - 1 : 0;
|
|
687
706
|
}
|
|
688
|
-
function
|
|
707
|
+
function Ne(e, t = {}) {
|
|
689
708
|
let { advances: n, tracking: r = 0 } = t, i = 0;
|
|
690
|
-
for (let t of
|
|
709
|
+
for (let t of Le(e, 0, e.length)) for (let a of Fe(e, t.start, t.end)) i = Math.max(i, I(a.start, a.end, n, r));
|
|
691
710
|
return i;
|
|
692
711
|
}
|
|
693
|
-
function
|
|
712
|
+
function Pe(e, t) {
|
|
694
713
|
let n = 0;
|
|
695
714
|
for (let r = 0; r < e.length; r++) e[r] === "" && (t(r, n), n++);
|
|
696
715
|
}
|
|
697
|
-
function
|
|
716
|
+
function Fe(e, t, n) {
|
|
698
717
|
let r = [], i = t;
|
|
699
718
|
for (let a = t; a < n; a++) {
|
|
700
719
|
if (e[a] === "") {
|
|
@@ -721,14 +740,14 @@ function Ne(e, t, n) {
|
|
|
721
740
|
end: n
|
|
722
741
|
}), r;
|
|
723
742
|
}
|
|
724
|
-
var
|
|
725
|
-
function
|
|
743
|
+
var Ie = /[ \t\r\n\f]/;
|
|
744
|
+
function Le(e, t, n) {
|
|
726
745
|
let r = [], i = t;
|
|
727
746
|
for (; i < n;) {
|
|
728
|
-
for (; i < n &&
|
|
747
|
+
for (; i < n && Ie.test(e[i]);) i++;
|
|
729
748
|
if (i >= n) break;
|
|
730
749
|
let t = i;
|
|
731
|
-
for (; i < n && !
|
|
750
|
+
for (; i < n && !Ie.test(e[i]);) i++;
|
|
732
751
|
r.push({
|
|
733
752
|
start: t,
|
|
734
753
|
end: i
|
|
@@ -736,8 +755,8 @@ function Fe(e, t, n) {
|
|
|
736
755
|
}
|
|
737
756
|
return r;
|
|
738
757
|
}
|
|
739
|
-
function
|
|
740
|
-
let s =
|
|
758
|
+
function Re(e, t, n, r, { advances: i, tracking: a = 0 }, o = 0) {
|
|
759
|
+
let s = Le(e, t, n);
|
|
741
760
|
if (s.length === 0) return [{
|
|
742
761
|
start: t,
|
|
743
762
|
end: t
|
|
@@ -749,8 +768,8 @@ function Ie(e, t, n, r, { advances: i, tracking: a = 0 }, o = 0) {
|
|
|
749
768
|
let c = [], l = null, u = 0, d = Math.max(0, o), f = () => r - d;
|
|
750
769
|
for (let t of s) {
|
|
751
770
|
let n = !1;
|
|
752
|
-
for (let r of
|
|
753
|
-
let e = r.start, t = r.end, o = l !== null && !n ? e - 1 : e, s = u +
|
|
771
|
+
for (let r of Fe(e, t.start, t.end)) {
|
|
772
|
+
let e = r.start, t = r.end, o = l !== null && !n ? e - 1 : e, s = u + je(o, t, i), p = Math.min(a, Me(t - 1, i));
|
|
754
773
|
if (l !== null && s - p <= f()) l.end = t, u = s;
|
|
755
774
|
else {
|
|
756
775
|
for (l !== null && (c.push(l), d = 0);;) {
|
|
@@ -765,7 +784,7 @@ function Ie(e, t, n, r, { advances: i, tracking: a = 0 }, o = 0) {
|
|
|
765
784
|
l = {
|
|
766
785
|
start: e,
|
|
767
786
|
end: t
|
|
768
|
-
}, u =
|
|
787
|
+
}, u = je(e, t, i);
|
|
769
788
|
}
|
|
770
789
|
n = !0;
|
|
771
790
|
}
|
|
@@ -774,7 +793,7 @@ function Ie(e, t, n, r, { advances: i, tracking: a = 0 }, o = 0) {
|
|
|
774
793
|
}
|
|
775
794
|
//#endregion
|
|
776
795
|
//#region src/flex.ts
|
|
777
|
-
function
|
|
796
|
+
function ze(e, t) {
|
|
778
797
|
let n = e.row.map((e) => e.node.localRect).sort((e, t) => e.x - t.x), r = [];
|
|
779
798
|
for (let e = 1; e < n.length; e++) {
|
|
780
799
|
let i = n[e - 1].x + n[e - 1].width - t, a = n[e].x - t;
|
|
@@ -785,12 +804,12 @@ function Le(e, t) {
|
|
|
785
804
|
}
|
|
786
805
|
return r;
|
|
787
806
|
}
|
|
788
|
-
function
|
|
807
|
+
function Be(e, t, n, r, i) {
|
|
789
808
|
if (e.style.ruleBreak !== "intersection") return [{
|
|
790
809
|
start: 0,
|
|
791
810
|
end: i
|
|
792
811
|
}];
|
|
793
|
-
let a = [t[n - 1], t[n]].flatMap((e) =>
|
|
812
|
+
let a = [t[n - 1], t[n]].flatMap((e) => ze(e, r)).sort((e, t) => e.start - t.start), o = (e, t) => ({
|
|
794
813
|
start: e,
|
|
795
814
|
end: t,
|
|
796
815
|
spanned: !1,
|
|
@@ -798,24 +817,24 @@ function Re(e, t, n, r, i) {
|
|
|
798
817
|
afterOccupied: !0
|
|
799
818
|
}), s = [], c = 0;
|
|
800
819
|
for (let e of a) e.start > c && s.push(o(c, e.start)), c = Math.max(c, e.end);
|
|
801
|
-
return c < i && s.push(o(c, i)),
|
|
820
|
+
return c < i && s.push(o(c, i)), ve(s, "intersection", "all", e.style.ruleInset === "overlap-join" ? "overlap-join" : 0);
|
|
802
821
|
}
|
|
803
|
-
function
|
|
822
|
+
function Ve(e, t) {
|
|
804
823
|
return typeof t != "number" || t <= 0 ? e : e.map((e) => ({
|
|
805
824
|
...e,
|
|
806
825
|
start: e.start + t,
|
|
807
826
|
end: e.end - t
|
|
808
827
|
})).filter((e) => e.end > e.start);
|
|
809
828
|
}
|
|
810
|
-
function
|
|
811
|
-
let s = U(e.style, "x", t), c = U(e.style, "y", n), l =
|
|
829
|
+
function He(e, t, n, r, i, a, o) {
|
|
830
|
+
let s = U(e.style, "x", t), c = U(e.style, "y", n), l = Xe(e).map((e) => {
|
|
812
831
|
let n = G(e.style.margin, t);
|
|
813
832
|
return {
|
|
814
833
|
node: e,
|
|
815
|
-
base:
|
|
834
|
+
base: Ye(e, t, o),
|
|
816
835
|
grow: e.style.flexGrow,
|
|
817
836
|
shrink: e.style.flexShrink,
|
|
818
|
-
min:
|
|
837
|
+
min: $e(e, t, o),
|
|
819
838
|
max: K(e.style.maxWidth, t),
|
|
820
839
|
margin: n
|
|
821
840
|
};
|
|
@@ -829,7 +848,7 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
829
848
|
n.length > 0 && u.push(n), e.style.wrapReverse && u.reverse();
|
|
830
849
|
} else u.push(l);
|
|
831
850
|
let d = i.left + a.left, f = i.top + a.top, p = u.map((e) => {
|
|
832
|
-
let n = s * Math.max(0, e.length - 1), i = e.reduce((e, t) => e + (t.margin.left ?? 0) + (t.margin.right ?? 0), 0), a = Math.max(0, t - n - i), c = e.some((e) => e.margin.left === null || e.margin.right === null), l = e.reduce((e, t) => e + t.base, 0), u = c && l <= a ? e.map((e) => Math.max(0, H(e.base, e.min, e.max))) :
|
|
851
|
+
let n = s * Math.max(0, e.length - 1), i = e.reduce((e, t) => e + (t.margin.left ?? 0) + (t.margin.right ?? 0), 0), a = Math.max(0, t - n - i), c = e.some((e) => e.margin.left === null || e.margin.right === null), l = e.reduce((e, t) => e + t.base, 0), u = c && l <= a ? e.map((e) => Math.max(0, H(e.base, e.min, e.max))) : qe(e, a);
|
|
833
852
|
for (let n = 0; n < e.length; n++) V(e[n].node, t, r, 0, 0, "fill", o, { width: u[n] });
|
|
834
853
|
return {
|
|
835
854
|
row: e,
|
|
@@ -838,9 +857,9 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
838
857
|
height: e.reduce((e, t) => Math.max(e, t.node.localRect.height), 0)
|
|
839
858
|
};
|
|
840
859
|
}), m = p.map((e) => e.height), h = c * Math.max(0, p.length - 1), g;
|
|
841
|
-
if (e.style.flexWrap === "nowrap") Number.isFinite(n) && (m[0] = Math.max(n, m[0] ?? 0)), g = [0];
|
|
860
|
+
if (e.style.flexWrap === "nowrap") r === void 0 ? Number.isFinite(n) && (m[0] = Math.max(n, m[0] ?? 0)) : m[0] = r, g = [0];
|
|
842
861
|
else {
|
|
843
|
-
let t = m.reduce((e, t) => e + t, 0), r = Number.isFinite(n) ? Math.max(0, n - t - h) : 0, i =
|
|
862
|
+
let t = m.reduce((e, t) => e + t, 0), r = Number.isFinite(n) ? Math.max(0, n - t - h) : 0, i = Ze(e.style);
|
|
844
863
|
if (i === "stretch" && r > 0) {
|
|
845
864
|
let e = R(Array.from({ length: p.length }, () => 1), r);
|
|
846
865
|
for (let t = 0; t < m.length; t++) m[t] += e[t];
|
|
@@ -850,8 +869,8 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
850
869
|
for (let i = 0; i < p.length; i++) {
|
|
851
870
|
let { row: a, widths: l, availableForItems: u } = p[i], h = m[i], _ = g[i] + i * c;
|
|
852
871
|
for (let i = 0; i < a.length; i++) {
|
|
853
|
-
let s = a[i].node, c =
|
|
854
|
-
if (c === "stretch" && !d && !f && h
|
|
872
|
+
let s = a[i].node, c = Je(s, e), u = a[i].margin, d = u.top === null || u.bottom === null, f = s.style.height !== void 0 && s.style.height.kind !== "auto";
|
|
873
|
+
if (c === "stretch" && !d && !f && h !== s.localRect.height) {
|
|
855
874
|
let e = u.top ?? 0, a = u.bottom ?? 0, c = Number.isFinite(n) ? n : void 0, d = H(Math.max(0, h - e - a), K(s.style.minHeight, c) ?? 0, K(s.style.maxHeight, c));
|
|
856
875
|
if (d === s.localRect.height) continue;
|
|
857
876
|
V(s, t, r, 0, 0, "fill", o, {
|
|
@@ -865,14 +884,14 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
865
884
|
let e = R(Array.from({ length: b }, () => 1), y), t = 0;
|
|
866
885
|
for (let n = 0; n < a.length; n++) a[n].margin.left === null && (x[n] = e[t++]), a[n].margin.right === null && (S[n] = e[t++]);
|
|
867
886
|
C = L("start", l, 0);
|
|
868
|
-
} else C = L(
|
|
887
|
+
} else C = L(Qe(e.style), l, y);
|
|
869
888
|
let w = 0;
|
|
870
889
|
for (let t = 0; t < a.length; t++) {
|
|
871
890
|
let n = a[t], r = n.node, i = n.margin.left ?? 0, o = n.margin.right ?? 0;
|
|
872
891
|
w += x[t] + i, r.localRect = {
|
|
873
892
|
...r.localRect,
|
|
874
893
|
x: d + C[t] + t * s + w,
|
|
875
|
-
y: f + _ +
|
|
894
|
+
y: f + _ + Ge(r, e.style.alignItems, h, n.margin)
|
|
876
895
|
}, w += S[t] + o;
|
|
877
896
|
}
|
|
878
897
|
}
|
|
@@ -881,7 +900,7 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
881
900
|
let n = [], r = [];
|
|
882
901
|
for (let i = 0; i < p.length; i++) {
|
|
883
902
|
let a = g[i] + i * c;
|
|
884
|
-
for (let e of
|
|
903
|
+
for (let e of ze(p[i], d)) n.push({
|
|
885
904
|
bandStart: e.start,
|
|
886
905
|
bandSize: e.end - e.start,
|
|
887
906
|
start: a,
|
|
@@ -889,19 +908,19 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
889
908
|
});
|
|
890
909
|
if (i > 0) {
|
|
891
910
|
let n = g[i - 1] + (i - 1) * c + m[i - 1];
|
|
892
|
-
if (a > n) for (let o of
|
|
911
|
+
if (a > n) for (let o of Be(e, p, i, d, t)) r.push({
|
|
893
912
|
bandStart: n,
|
|
894
913
|
bandSize: a - n,
|
|
895
914
|
...o
|
|
896
915
|
});
|
|
897
916
|
}
|
|
898
917
|
}
|
|
899
|
-
e.decorationRuns =
|
|
918
|
+
e.decorationRuns = ye({
|
|
900
919
|
glyphs: S(e.style.glyphSet),
|
|
901
920
|
ruleX: e.style.ruleX,
|
|
902
921
|
ruleY: e.style.ruleY,
|
|
903
|
-
vertical:
|
|
904
|
-
horizontal:
|
|
922
|
+
vertical: Ve(n, e.style.ruleInset),
|
|
923
|
+
horizontal: Ve(r, e.style.ruleInset),
|
|
905
924
|
contentWidth: t,
|
|
906
925
|
contentHeight: v,
|
|
907
926
|
border: i,
|
|
@@ -910,9 +929,9 @@ function Be(e, t, n, r, i, a, o) {
|
|
|
910
929
|
padding: a
|
|
911
930
|
});
|
|
912
931
|
}
|
|
913
|
-
return
|
|
932
|
+
return Ue(e, i, a, t, v), v;
|
|
914
933
|
}
|
|
915
|
-
function
|
|
934
|
+
function Ue(e, t, n, r, i) {
|
|
916
935
|
for (let a of e.children) B(a.style) && (a.staticSlot = {
|
|
917
936
|
kind: "flex",
|
|
918
937
|
direction: e.style.flexDirection,
|
|
@@ -922,11 +941,11 @@ function Ve(e, t, n, r, i) {
|
|
|
922
941
|
innerHeight: i
|
|
923
942
|
});
|
|
924
943
|
}
|
|
925
|
-
function
|
|
926
|
-
let s = U(e.style, "y", n), c =
|
|
927
|
-
let a = G(i.style.margin, t), s = Math.max(0, t - (a.left ?? 0) - (a.right ?? 0)), c =
|
|
944
|
+
function We(e, t, n, r, i, a, o) {
|
|
945
|
+
let s = U(e.style, "y", n), c = Xe(e).map((i) => {
|
|
946
|
+
let a = G(i.style.margin, t), s = Math.max(0, t - (a.left ?? 0) - (a.right ?? 0)), c = Je(i, e) === "stretch";
|
|
928
947
|
V(i, s, r && Number.isFinite(n) ? n : void 0, 0, 0, c ? "fill" : "shrink", o);
|
|
929
|
-
let l = Number.isFinite(n) ? n : void 0, u = i.style.flexBasis, d = u === void 0 || u.kind === "auto" ? i.unclampedHeight : u.kind === "cells" ? u.value : u.kind === "percent" && l !== void 0 ?
|
|
948
|
+
let l = Number.isFinite(n) ? n : void 0, u = i.style.flexBasis, d = u === void 0 || u.kind === "auto" ? i.unclampedHeight : u.kind === "cells" ? u.value : u.kind === "percent" && l !== void 0 ? Ce(u.value, l) : i.unclampedHeight, f = i.style.minHeight === "auto" ? i.style.overflow.y === "visible" ? i.localRect.height : 0 : void 0;
|
|
930
949
|
return {
|
|
931
950
|
node: i,
|
|
932
951
|
base: d,
|
|
@@ -936,9 +955,9 @@ function He(e, t, n, r, i, a, o) {
|
|
|
936
955
|
max: K(i.style.maxHeight, l),
|
|
937
956
|
margin: a
|
|
938
957
|
};
|
|
939
|
-
}), l = s * Math.max(0, c.length - 1), u = c.reduce((e, t) => e + (t.margin.top ?? 0) + (t.margin.bottom ?? 0), 0), d = Number.isFinite(n), f = c.reduce((e, t) => e + t.base, 0), p = d ? Math.max(0, n - l - u) : f, m = r ? p : Math.max(p, f), h = c.some((e) => e.margin.top === null || e.margin.bottom === null), g = d && !(d && h && f <= m) ?
|
|
958
|
+
}), l = s * Math.max(0, c.length - 1), u = c.reduce((e, t) => e + (t.margin.top ?? 0) + (t.margin.bottom ?? 0), 0), d = Number.isFinite(n), f = c.reduce((e, t) => e + t.base, 0), p = d ? Math.max(0, n - l - u) : f, m = r ? p : Math.max(p, f), h = c.some((e) => e.margin.top === null || e.margin.bottom === null), g = d && !(d && h && f <= m) ? qe(c, m) : c.map((e) => Math.max(0, H(e.base, e.min, e.max)));
|
|
940
959
|
for (let n = 0; n < c.length; n++) if (g[n] !== c[n].node.localRect.height) {
|
|
941
|
-
let r = c[n], i = Math.max(0, t - (r.margin.left ?? 0) - (r.margin.right ?? 0)), a =
|
|
960
|
+
let r = c[n], i = Math.max(0, t - (r.margin.left ?? 0) - (r.margin.right ?? 0)), a = Je(r.node, e) === "stretch";
|
|
942
961
|
V(r.node, i, g[n], 0, 0, a ? "fill" : "shrink", o, { height: g[n] });
|
|
943
962
|
}
|
|
944
963
|
let _ = g.reduce((e, t) => e + t, 0), v = Math.max(0, m - _), y = c.reduce((e, t) => e + +(t.margin.top === null) + +(t.margin.bottom === null), 0), b = Array.from({ length: c.length }, () => 0), x = Array.from({ length: c.length }, () => 0), C;
|
|
@@ -946,13 +965,13 @@ function He(e, t, n, r, i, a, o) {
|
|
|
946
965
|
let e = R(Array.from({ length: y }, () => 1), v), t = 0;
|
|
947
966
|
for (let n = 0; n < c.length; n++) c[n].margin.top === null && (b[n] = e[t++]), c[n].margin.bottom === null && (x[n] = e[t++]);
|
|
948
967
|
C = L("start", g, 0);
|
|
949
|
-
} else C = L(
|
|
968
|
+
} else C = L(Qe(e.style), g, v);
|
|
950
969
|
let w = i.left + a.left, T = i.top + a.top, E = 0;
|
|
951
970
|
for (let n = 0; n < c.length; n++) {
|
|
952
971
|
let r = c[n], i = r.node, a = r.margin.top ?? 0, o = r.margin.bottom ?? 0;
|
|
953
972
|
E += b[n] + a, i.localRect = {
|
|
954
973
|
...i.localRect,
|
|
955
|
-
x: w +
|
|
974
|
+
x: w + Ke(i, e.style.alignItems, t, r.margin),
|
|
956
975
|
y: T + C[n] + n * s + E
|
|
957
976
|
}, E += x[n] + o;
|
|
958
977
|
}
|
|
@@ -968,12 +987,12 @@ function He(e, t, n, r, i, a, o) {
|
|
|
968
987
|
end: t
|
|
969
988
|
});
|
|
970
989
|
}
|
|
971
|
-
e.decorationRuns =
|
|
990
|
+
e.decorationRuns = ye({
|
|
972
991
|
glyphs: S(e.style.glyphSet),
|
|
973
992
|
ruleX: null,
|
|
974
993
|
ruleY: e.style.ruleY,
|
|
975
994
|
vertical: [],
|
|
976
|
-
horizontal:
|
|
995
|
+
horizontal: Ve(n, e.style.ruleInset),
|
|
977
996
|
contentWidth: t,
|
|
978
997
|
contentHeight: O,
|
|
979
998
|
border: i,
|
|
@@ -982,15 +1001,15 @@ function He(e, t, n, r, i, a, o) {
|
|
|
982
1001
|
padding: a
|
|
983
1002
|
});
|
|
984
1003
|
}
|
|
985
|
-
return
|
|
1004
|
+
return Ue(e, i, a, t, O), O;
|
|
986
1005
|
}
|
|
987
|
-
function
|
|
1006
|
+
function Ge(e, t, n, r) {
|
|
988
1007
|
let i = e.style.alignSelf === "auto" ? t : e.style.alignSelf, a = r.top ?? 0, o = r.bottom ?? 0, s = n - e.localRect.height, c = r.top === null && r.bottom === null, l = r.top === null && r.bottom !== null, u = r.bottom === null && r.top !== null;
|
|
989
|
-
return c ? Math.floor(s / 2) : l ? s - o : u ? a : a +
|
|
1008
|
+
return c ? Math.floor(s / 2) : l ? s - o : u ? a : a + z(i, n, e.localRect.height);
|
|
990
1009
|
}
|
|
991
|
-
function
|
|
1010
|
+
function Ke(e, t, n, r) {
|
|
992
1011
|
let i = e.style.alignSelf === "auto" ? t : e.style.alignSelf, a = r.left ?? 0, o = r.right ?? 0, s = n - e.localRect.width, c = r.left === null && r.right === null, l = r.left === null && r.right !== null, u = r.right === null && r.left !== null;
|
|
993
|
-
return c ? Math.floor(s / 2) : l ? s - o : u ? a : a +
|
|
1012
|
+
return c ? Math.floor(s / 2) : l ? s - o : u ? a : a + z(i, n, e.localRect.width);
|
|
994
1013
|
}
|
|
995
1014
|
function L(e, t, n) {
|
|
996
1015
|
let r = t.length;
|
|
@@ -1010,7 +1029,7 @@ function L(e, t, n) {
|
|
|
1010
1029
|
for (let e = 0; e < r; e++) i.push(a), a += t[e];
|
|
1011
1030
|
return i;
|
|
1012
1031
|
}
|
|
1013
|
-
function
|
|
1032
|
+
function qe(e, t) {
|
|
1014
1033
|
let n = e.length, r = (t, n) => Math.max(0, H(t, e[n].min ?? 0, e[n].max)), i = e.map((e) => e.base), a = t >= i.reduce((e, t, n) => e + r(t, n), 0), o = Array.from({ length: n }, () => 0), s = Array.from({ length: n }, () => !1);
|
|
1015
1034
|
for (let t = 0; t < n; t++) {
|
|
1016
1035
|
let n = r(i[t], t);
|
|
@@ -1045,33 +1064,45 @@ function R(e, t) {
|
|
|
1045
1064
|
}
|
|
1046
1065
|
return i;
|
|
1047
1066
|
}
|
|
1048
|
-
function
|
|
1067
|
+
function Je(e, t) {
|
|
1049
1068
|
return e.style.alignSelf === "auto" ? t.style.alignItems : e.style.alignSelf;
|
|
1050
1069
|
}
|
|
1051
|
-
function
|
|
1070
|
+
function z(e, t, n) {
|
|
1052
1071
|
return e === "center" ? Math.max(0, Math.floor((t - n) / 2)) : e === "end" ? Math.max(0, t - n) : 0;
|
|
1053
1072
|
}
|
|
1054
|
-
function
|
|
1073
|
+
function Ye(e, t, n) {
|
|
1055
1074
|
let r = e.style.flexBasis, i = e.style.width;
|
|
1056
1075
|
return r !== void 0 && r.kind !== "auto" ? q(r, t, e, n) : i !== void 0 && i.kind !== "auto" ? q(i, t, e, n) : J(e, n);
|
|
1057
1076
|
}
|
|
1058
|
-
function
|
|
1077
|
+
function Xe(e) {
|
|
1059
1078
|
let t = e.children.filter((e) => !B(e.style)).sort((e, t) => e.style.order - t.style.order);
|
|
1060
1079
|
return e.style.flexReverse && t.reverse(), t;
|
|
1061
1080
|
}
|
|
1062
|
-
function
|
|
1081
|
+
function Ze(e) {
|
|
1063
1082
|
return e.wrapReverse ? e.alignContent === "start" ? "end" : e.alignContent === "end" ? "start" : e.alignContent : e.alignContent;
|
|
1064
1083
|
}
|
|
1065
|
-
function
|
|
1084
|
+
function Qe(e) {
|
|
1066
1085
|
let t = e.justifyContent === "stretch" ? "start" : e.justifyContent;
|
|
1067
1086
|
return e.flexReverse ? t === "start" ? "end" : t === "end" ? "start" : t : t;
|
|
1068
1087
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return e.style.minWidth === "auto" ? e.style.overflow === "visible" ? Y(e, n) : 0 : K(e.style.minWidth, t) ?? 0;
|
|
1088
|
+
function $e(e, t, n) {
|
|
1089
|
+
return e.style.minWidth === "auto" ? e.style.overflow.x === "visible" ? Y(e, n) : 0 : K(e.style.minWidth, t) ?? 0;
|
|
1071
1090
|
}
|
|
1072
1091
|
//#endregion
|
|
1073
1092
|
//#region src/types.ts
|
|
1074
|
-
function
|
|
1093
|
+
function et(e) {
|
|
1094
|
+
return e === "auto" || e === "scroll";
|
|
1095
|
+
}
|
|
1096
|
+
function tt(e) {
|
|
1097
|
+
return e.scrollbarWidth === "none" ? {
|
|
1098
|
+
right: 0,
|
|
1099
|
+
bottom: 0
|
|
1100
|
+
} : {
|
|
1101
|
+
right: e.overflow.y === "scroll" ? e.scrollbarSize.y : 0,
|
|
1102
|
+
bottom: e.overflow.x === "scroll" ? e.scrollbarSize.x : 0
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
function nt() {
|
|
1075
1106
|
return {
|
|
1076
1107
|
display: "block",
|
|
1077
1108
|
flexDirection: "row",
|
|
@@ -1090,8 +1121,8 @@ function $e() {
|
|
|
1090
1121
|
justifySelf: "auto",
|
|
1091
1122
|
gridTemplateColumns: { kind: "none" },
|
|
1092
1123
|
gridTemplateRows: { kind: "none" },
|
|
1093
|
-
gridAutoColumns: [
|
|
1094
|
-
gridAutoRows: [
|
|
1124
|
+
gridAutoColumns: [it()],
|
|
1125
|
+
gridAutoRows: [it()],
|
|
1095
1126
|
gridAutoFlow: {
|
|
1096
1127
|
direction: "row",
|
|
1097
1128
|
dense: !1
|
|
@@ -1107,7 +1138,7 @@ function $e() {
|
|
|
1107
1138
|
minHeight: "auto",
|
|
1108
1139
|
maxWidth: void 0,
|
|
1109
1140
|
maxHeight: void 0,
|
|
1110
|
-
padding:
|
|
1141
|
+
padding: rt(),
|
|
1111
1142
|
margin: {
|
|
1112
1143
|
top: 0,
|
|
1113
1144
|
right: 0,
|
|
@@ -1123,14 +1154,27 @@ function $e() {
|
|
|
1123
1154
|
},
|
|
1124
1155
|
gapX: 0,
|
|
1125
1156
|
gapY: 0,
|
|
1126
|
-
border:
|
|
1157
|
+
border: rt(),
|
|
1127
1158
|
borderStyle: {
|
|
1128
1159
|
top: "solid",
|
|
1129
1160
|
right: "solid",
|
|
1130
1161
|
bottom: "solid",
|
|
1131
1162
|
left: "solid"
|
|
1132
1163
|
},
|
|
1133
|
-
overflow:
|
|
1164
|
+
overflow: {
|
|
1165
|
+
x: "visible",
|
|
1166
|
+
y: "visible"
|
|
1167
|
+
},
|
|
1168
|
+
scrollbarWidth: "auto",
|
|
1169
|
+
scrollbarSize: {
|
|
1170
|
+
x: 1,
|
|
1171
|
+
y: 1
|
|
1172
|
+
},
|
|
1173
|
+
overscroll: {
|
|
1174
|
+
x: !0,
|
|
1175
|
+
y: !0
|
|
1176
|
+
},
|
|
1177
|
+
scrollbarColor: null,
|
|
1134
1178
|
whiteSpace: "normal",
|
|
1135
1179
|
tabSize: 8,
|
|
1136
1180
|
lineGap: 0,
|
|
@@ -1176,7 +1220,7 @@ function $e() {
|
|
|
1176
1220
|
breakInsideAvoid: !1
|
|
1177
1221
|
};
|
|
1178
1222
|
}
|
|
1179
|
-
function
|
|
1223
|
+
function rt() {
|
|
1180
1224
|
return {
|
|
1181
1225
|
top: 0,
|
|
1182
1226
|
right: 0,
|
|
@@ -1184,7 +1228,7 @@ function z() {
|
|
|
1184
1228
|
left: 0
|
|
1185
1229
|
};
|
|
1186
1230
|
}
|
|
1187
|
-
function
|
|
1231
|
+
function it() {
|
|
1188
1232
|
return {
|
|
1189
1233
|
min: { kind: "auto" },
|
|
1190
1234
|
max: { kind: "auto" }
|
|
@@ -1192,15 +1236,15 @@ function et() {
|
|
|
1192
1236
|
}
|
|
1193
1237
|
//#endregion
|
|
1194
1238
|
//#region src/grid.ts
|
|
1195
|
-
function
|
|
1196
|
-
let o = e.style, s = Number.isFinite(n) ? n : void 0, c = e.subgrid?.cols, l = e.subgrid?.rows, u = c ? c.gap : U(o, "x", t), d = l ? l.gap : U(o, "y", s), f =
|
|
1239
|
+
function at(e, t, n, r, i, a) {
|
|
1240
|
+
let o = e.style, s = Number.isFinite(n) ? n : void 0, c = e.subgrid?.cols, l = e.subgrid?.rows, u = c ? c.gap : U(o, "x", t), d = l ? l.gap : U(o, "y", s), f = ht(e, t, s, u, d, e.subgrid ? {
|
|
1197
1241
|
col: e.subgrid.colSpan,
|
|
1198
1242
|
row: e.subgrid.rowSpan
|
|
1199
|
-
} : void 0), { children: p, placed: m, colLines: h, rowLines: g, colTracks: _, rowTracks: v, colCollapsed: y, rowCollapsed: b } = f, x = p.map((e) => G(e.style.margin, t)), C = p.map((e) => e.style.justifySelf === "auto" ? o.justifyItems : e.style.justifySelf), w = p.map(
|
|
1243
|
+
} : void 0), { children: p, placed: m, colLines: h, rowLines: g, colTracks: _, rowTracks: v, colCollapsed: y, rowCollapsed: b } = f, x = p.map((e) => G(e.style.margin, t)), C = p.map((e) => e.style.justifySelf === "auto" ? o.justifyItems : e.style.justifySelf), w = p.map(ot), T = c ? ct(c) : jt(_, y, lt(f, w, x, a), t, u, o.justifyContent === "stretch"), E = c ? c.positions : Mt(T, t, o.justifyContent), D = [];
|
|
1200
1244
|
for (let e = 0; e < p.length; e++) {
|
|
1201
|
-
let t = p[e], n = m.items[e], r =
|
|
1245
|
+
let t = p[e], n = m.items[e], r = Pt(E, T.sizes, n.col.start, n.col.span), i = x[e], o = Math.max(0, r - yt(i)), s = w[e];
|
|
1202
1246
|
if (s.cols || s.rows) {
|
|
1203
|
-
let e = s.cols ?
|
|
1247
|
+
let e = s.cols ? st(E, T, u, n.col.start, n.col.span, dt(t, "cols", i, r)) : void 0;
|
|
1204
1248
|
t.subgrid = {
|
|
1205
1249
|
colSpan: n.col.span,
|
|
1206
1250
|
rowSpan: n.row.span,
|
|
@@ -1209,17 +1253,17 @@ function tt(e, t, n, r, i, a) {
|
|
|
1209
1253
|
};
|
|
1210
1254
|
} else t.subgrid = void 0;
|
|
1211
1255
|
let c = C[e], l = i.left === null || i.right === null, d = t.style.width !== void 0 && t.style.width.kind !== "auto";
|
|
1212
|
-
s.cols ? V(t, r, void 0, 0, 0, "fill", a, { width: o }) : c === "stretch" && !l && !d ? V(t, r, void 0, 0, 0, "fill", a, { width: H(o, t.style.minWidth === "auto" ? t.style.overflow === "visible" ? Y(t, a) : 0 : K(t.style.minWidth, r) ?? 0,
|
|
1256
|
+
s.cols ? V(t, r, void 0, 0, 0, "fill", a, { width: o }) : c === "stretch" && !l && !d ? V(t, r, void 0, 0, 0, "fill", a, { width: H(o, t.style.minWidth === "auto" ? t.style.overflow.x === "visible" ? Y(t, a) : 0 : K(t.style.minWidth, r) ?? 0, Wn(t.style.maxWidth, r, t, a)) }) : V(t, o, void 0, 0, 0, "shrink", a), D.push(t.localRect.width);
|
|
1213
1257
|
}
|
|
1214
|
-
let O = l ?
|
|
1258
|
+
let O = l ? ct(l) : jt(v, b, ut(f, w, x), s ?? "max-content", d, o.alignContent === "stretch"), k = Nt(O), A = l ? l.positions : Mt(O, s ?? k, o.alignContent), j = r.left + i.left, M = r.top + i.top;
|
|
1215
1259
|
for (let t = 0; t < p.length; t++) {
|
|
1216
|
-
let n = p[t], r = m.items[t], i = x[t], o =
|
|
1217
|
-
if (w[t].rows) n.subgrid.rows =
|
|
1260
|
+
let n = p[t], r = m.items[t], i = x[t], o = Pt(E, T.sizes, r.col.start, r.col.span), s = Pt(A, O.sizes, r.row.start, r.row.span), c = Math.max(0, s - bt(i)), l = Je(n, e), u = i.top === null || i.bottom === null, f = n.style.height !== void 0 && n.style.height.kind !== "auto";
|
|
1261
|
+
if (w[t].rows) n.subgrid.rows = st(A, O, d, r.row.start, r.row.span, dt(n, "rows", i, o)), V(n, o, s, 0, 0, "fill", a, {
|
|
1218
1262
|
width: D[t],
|
|
1219
1263
|
height: c
|
|
1220
1264
|
});
|
|
1221
1265
|
else if (l === "stretch" && !u && !f) {
|
|
1222
|
-
let e = H(c, n.style.minHeight === "auto" ? n.style.overflow === "visible" ? n.localRect.height : 0 : K(n.style.minHeight, s) ?? 0, K(n.style.maxHeight, s));
|
|
1266
|
+
let e = H(c, n.style.minHeight === "auto" ? n.style.overflow.y === "visible" ? n.localRect.height : 0 : K(n.style.minHeight, s) ?? 0, K(n.style.maxHeight, s));
|
|
1223
1267
|
e !== n.localRect.height && V(n, o, s, 0, 0, "fill", a, {
|
|
1224
1268
|
width: D[t],
|
|
1225
1269
|
height: e
|
|
@@ -1227,8 +1271,8 @@ function tt(e, t, n, r, i, a) {
|
|
|
1227
1271
|
} else n.style.height?.kind === "percent" && V(n, o, s, 0, 0, "fill", a, { width: D[t] });
|
|
1228
1272
|
n.localRect = {
|
|
1229
1273
|
...n.localRect,
|
|
1230
|
-
x: j + E[r.col.start] +
|
|
1231
|
-
y: M + A[r.row.start] +
|
|
1274
|
+
x: j + E[r.col.start] + Ft(C[t], i.left, i.right, o, n.localRect.width),
|
|
1275
|
+
y: M + A[r.row.start] + Ft(l, i.top, i.bottom, s, n.localRect.height)
|
|
1232
1276
|
};
|
|
1233
1277
|
}
|
|
1234
1278
|
let N = Number.isFinite(n) ? Math.max(n, k) : k;
|
|
@@ -1245,7 +1289,7 @@ function tt(e, t, n, r, i, a) {
|
|
|
1245
1289
|
let r = [];
|
|
1246
1290
|
for (let i = 1; i < e.length; i++) {
|
|
1247
1291
|
let a = e[i - 1] + t[i - 1], s = e[i] - a;
|
|
1248
|
-
if (!(s <= 0)) for (let e of
|
|
1292
|
+
if (!(s <= 0)) for (let e of ve(n(i - 1), o.ruleBreak, o.ruleVisibilityItems, o.ruleInset)) r.push({
|
|
1249
1293
|
bandStart: a,
|
|
1250
1294
|
bandSize: s,
|
|
1251
1295
|
...e
|
|
@@ -1253,7 +1297,7 @@ function tt(e, t, n, r, i, a) {
|
|
|
1253
1297
|
}
|
|
1254
1298
|
return r;
|
|
1255
1299
|
}, f = d(E, T.sizes, (e) => u(e, A, O.sizes, c, (t) => s[e]?.[t] ?? !1, (t) => s[e + 1]?.[t] ?? !1)), p = d(A, O.sizes, (e) => u(e, E, T.sizes, l, (t) => s[t]?.[e] ?? !1, (t) => s[t]?.[e + 1] ?? !1));
|
|
1256
|
-
e.decorationRuns =
|
|
1300
|
+
e.decorationRuns = ye({
|
|
1257
1301
|
glyphs: S(o.glyphSet),
|
|
1258
1302
|
ruleX: o.ruleX,
|
|
1259
1303
|
ruleY: o.ruleY,
|
|
@@ -1281,7 +1325,7 @@ function tt(e, t, n, r, i, a) {
|
|
|
1281
1325
|
height: N
|
|
1282
1326
|
};
|
|
1283
1327
|
for (let n of ee) {
|
|
1284
|
-
let r =
|
|
1328
|
+
let r = pt(n.style.gridColumnStart, n.style.gridColumnEnd, h, m.colOrigin, E, T.sizes, -i.left, t + i.right), a = pt(n.style.gridRowStart, n.style.gridRowEnd, g, m.rowOrigin, A, O.sizes, -i.top, N + i.bottom);
|
|
1285
1329
|
n.staticSlot = {
|
|
1286
1330
|
kind: "grid",
|
|
1287
1331
|
area: {
|
|
@@ -1296,14 +1340,14 @@ function tt(e, t, n, r, i, a) {
|
|
|
1296
1340
|
}
|
|
1297
1341
|
return N;
|
|
1298
1342
|
}
|
|
1299
|
-
function
|
|
1343
|
+
function ot(e) {
|
|
1300
1344
|
let t = e.style.display === "grid";
|
|
1301
1345
|
return {
|
|
1302
1346
|
cols: t && e.style.gridTemplateColumns.kind === "subgrid",
|
|
1303
1347
|
rows: t && e.style.gridTemplateRows.kind === "subgrid"
|
|
1304
1348
|
};
|
|
1305
1349
|
}
|
|
1306
|
-
function
|
|
1350
|
+
function st(e, t, n, r, i, a) {
|
|
1307
1351
|
let o = e[r] + a.start, s = t.sizes.slice(r, r + i);
|
|
1308
1352
|
return s[0] = Math.max(0, s[0] - a.start), s[i - 1] = Math.max(0, s[i - 1] - a.end), {
|
|
1309
1353
|
positions: Array.from({ length: i }, (t, n) => n === 0 ? 0 : e[r + n] - o),
|
|
@@ -1312,20 +1356,20 @@ function rt(e, t, n, r, i, a) {
|
|
|
1312
1356
|
gap: n
|
|
1313
1357
|
};
|
|
1314
1358
|
}
|
|
1315
|
-
function
|
|
1359
|
+
function ct(e) {
|
|
1316
1360
|
return {
|
|
1317
1361
|
sizes: e.sizes,
|
|
1318
1362
|
gapBefore: e.gapBefore,
|
|
1319
1363
|
limits: e.sizes
|
|
1320
1364
|
};
|
|
1321
1365
|
}
|
|
1322
|
-
function
|
|
1366
|
+
function lt(e, t, n, r) {
|
|
1323
1367
|
let i = [];
|
|
1324
1368
|
return e.children.forEach((a, o) => {
|
|
1325
1369
|
let s = e.placed.items[o], c = n[o];
|
|
1326
1370
|
if (t[o].cols) {
|
|
1327
|
-
let e =
|
|
1328
|
-
for (let t of
|
|
1371
|
+
let e = dt(a, "cols", c, 0);
|
|
1372
|
+
for (let t of ft(a, "cols", s, e, r)) i.push({
|
|
1329
1373
|
...t,
|
|
1330
1374
|
start: t.start + s.col.start
|
|
1331
1375
|
});
|
|
@@ -1334,33 +1378,33 @@ function at(e, t, n, r) {
|
|
|
1334
1378
|
i.push({
|
|
1335
1379
|
start: s.col.start,
|
|
1336
1380
|
span: s.col.span,
|
|
1337
|
-
min:
|
|
1338
|
-
max:
|
|
1381
|
+
min: xt(a, "min", r) + yt(c),
|
|
1382
|
+
max: xt(a, "max", r) + yt(c)
|
|
1339
1383
|
});
|
|
1340
1384
|
}), i;
|
|
1341
1385
|
}
|
|
1342
|
-
function
|
|
1386
|
+
function ut(e, t, n) {
|
|
1343
1387
|
let r = [];
|
|
1344
1388
|
return e.children.forEach((i, a) => {
|
|
1345
1389
|
let o = e.placed.items[a], s = n[a];
|
|
1346
1390
|
if (t[a].rows) {
|
|
1347
|
-
let e =
|
|
1348
|
-
for (let t of
|
|
1391
|
+
let e = dt(i, "rows", s, 0);
|
|
1392
|
+
for (let t of ft(i, "rows", o, e)) r.push({
|
|
1349
1393
|
...t,
|
|
1350
1394
|
start: t.start + o.row.start
|
|
1351
1395
|
});
|
|
1352
1396
|
return;
|
|
1353
1397
|
}
|
|
1354
|
-
let c = i.localRect.height +
|
|
1398
|
+
let c = i.localRect.height + bt(s), l = i.style.minHeight === "auto" && i.style.overflow.y !== "visible" ? bt(s) : c;
|
|
1355
1399
|
r.push({
|
|
1356
1400
|
start: o.row.start,
|
|
1357
1401
|
span: o.row.span,
|
|
1358
|
-
min:
|
|
1402
|
+
min: l,
|
|
1359
1403
|
max: c
|
|
1360
1404
|
});
|
|
1361
1405
|
}), r;
|
|
1362
1406
|
}
|
|
1363
|
-
function
|
|
1407
|
+
function dt(e, t, n, r) {
|
|
1364
1408
|
let { border: i, padding: a } = e.style;
|
|
1365
1409
|
return t === "cols" ? {
|
|
1366
1410
|
start: (n.left ?? 0) + i.left + W(a.left, r),
|
|
@@ -1370,15 +1414,15 @@ function st(e, t, n, r) {
|
|
|
1370
1414
|
end: (n.bottom ?? 0) + i.bottom + W(a.bottom, r)
|
|
1371
1415
|
};
|
|
1372
1416
|
}
|
|
1373
|
-
function
|
|
1374
|
-
let a = t === "cols" ? n.col.span : n.row.span, o =
|
|
1417
|
+
function ft(e, t, n, r, i) {
|
|
1418
|
+
let a = t === "cols" ? n.col.span : n.row.span, o = ht(e, void 0, void 0, 0, 0, {
|
|
1375
1419
|
col: n.col.span,
|
|
1376
1420
|
row: n.row.span
|
|
1377
1421
|
}), s = [];
|
|
1378
1422
|
if (o.children.forEach((e, n) => {
|
|
1379
1423
|
let c = o.placed.items[n], l = t === "cols" ? c.col : c.row, u = l.start === 0, d = l.start + l.span === a, f = (u ? r.start : 0) + (d ? r.end : 0), p = G(e.style.margin, 0);
|
|
1380
|
-
if (
|
|
1381
|
-
let n =
|
|
1424
|
+
if (ot(e)[t]) {
|
|
1425
|
+
let n = dt(e, t, p, 0), a = ft(e, t, c, {
|
|
1382
1426
|
start: n.start + (u ? r.start : 0),
|
|
1383
1427
|
end: n.end + (d ? r.end : 0)
|
|
1384
1428
|
}, i);
|
|
@@ -1391,11 +1435,11 @@ function ct(e, t, n, r, i) {
|
|
|
1391
1435
|
if (t === "cols") s.push({
|
|
1392
1436
|
start: l.start,
|
|
1393
1437
|
span: l.span,
|
|
1394
|
-
min:
|
|
1395
|
-
max:
|
|
1438
|
+
min: xt(e, "min", i) + yt(p) + f,
|
|
1439
|
+
max: xt(e, "max", i) + yt(p) + f
|
|
1396
1440
|
});
|
|
1397
1441
|
else {
|
|
1398
|
-
let t = e.localRect.height +
|
|
1442
|
+
let t = e.localRect.height + bt(p) + f;
|
|
1399
1443
|
s.push({
|
|
1400
1444
|
start: l.start,
|
|
1401
1445
|
span: l.span,
|
|
@@ -1414,9 +1458,9 @@ function ct(e, t, n, r, i) {
|
|
|
1414
1458
|
}
|
|
1415
1459
|
return s;
|
|
1416
1460
|
}
|
|
1417
|
-
function
|
|
1418
|
-
let c =
|
|
1419
|
-
c !== null && l !== null ? c > l ? [c, l] = [l, c] : c === l && (l = null) : c !== null && t.kind === "span" ? l =
|
|
1461
|
+
function pt(e, t, n, r, i, a, o, s) {
|
|
1462
|
+
let c = Dt(e, "start", n), l = Dt(t, "end", n);
|
|
1463
|
+
c !== null && l !== null ? c > l ? [c, l] = [l, c] : c === l && (l = null) : c !== null && t.kind === "span" ? l = Ot(c, t, 1, n) : l !== null && e.kind === "span" && (c = Ot(l, e, -1, n));
|
|
1420
1464
|
let u = i.length, d = (e) => {
|
|
1421
1465
|
if (e === null) return;
|
|
1422
1466
|
let t = e - r;
|
|
@@ -1427,22 +1471,22 @@ function lt(e, t, n, r, i, a, o, s) {
|
|
|
1427
1471
|
end: h === void 0 ? s : p(h)
|
|
1428
1472
|
};
|
|
1429
1473
|
}
|
|
1430
|
-
function
|
|
1474
|
+
function mt(e, t) {
|
|
1431
1475
|
let n = t.gridIntrinsic.get(e);
|
|
1432
1476
|
if (n !== void 0) return n;
|
|
1433
|
-
let r = e.style, i = Math.max(typeof r.gapX == "number" ? r.gapX : 0, r.ruleX?.width ?? 0), a =
|
|
1477
|
+
let r = e.style, i = Math.max(typeof r.gapX == "number" ? r.gapX : 0, r.ruleX?.width ?? 0), a = ht(e, void 0, void 0, i, 0, e.subgrid ? {
|
|
1434
1478
|
col: e.subgrid.colSpan,
|
|
1435
1479
|
row: e.subgrid.rowSpan
|
|
1436
|
-
} : void 0), o = a.children.map(
|
|
1480
|
+
} : void 0), o = a.children.map(ot), s = a.children.map((e) => G(e.style.margin, 0)), c = jt(a.colTracks, a.colCollapsed, lt(a, o, s, t), "min-content", i, !1), l = c.gapBefore.reduce((e, t) => e + t, 0), u = {
|
|
1437
1481
|
min: c.sizes.reduce((e, t) => e + t, 0) + l,
|
|
1438
1482
|
max: c.limits.reduce((e, t) => e + t, 0) + l
|
|
1439
1483
|
};
|
|
1440
1484
|
return t.gridIntrinsic.set(e, u), u;
|
|
1441
1485
|
}
|
|
1442
|
-
function
|
|
1443
|
-
let o = e.style, s =
|
|
1486
|
+
function ht(e, t, n, r, i, a) {
|
|
1487
|
+
let o = e.style, s = vt(e), c = o.gridTemplateColumns.kind === "subgrid" && a !== void 0, l = o.gridTemplateRows.kind === "subgrid" && a !== void 0, u = c ? gt(a.col) : St(o.gridTemplateColumns, t, r), d = l ? gt(a.row) : St(o.gridTemplateRows, n, i), f = o.gridTemplateAreas, p = [...u.tracks], m = [...d.tracks];
|
|
1444
1488
|
if (f) {
|
|
1445
|
-
c ||
|
|
1489
|
+
c || wt(p, u.lineNames, f.columns, o.gridAutoColumns), l || wt(m, d.lineNames, f.rows, o.gridAutoRows);
|
|
1446
1490
|
for (let [e, t] of f.areas) u.lineNames[Math.min(t.colStart, p.length)].push(`${e}-start`), u.lineNames[Math.min(t.colEnd, p.length)].push(`${e}-end`), d.lineNames[Math.min(t.rowStart, m.length)].push(`${e}-start`), d.lineNames[Math.min(t.rowEnd, m.length)].push(`${e}-end`);
|
|
1447
1491
|
}
|
|
1448
1492
|
let h = {
|
|
@@ -1451,28 +1495,28 @@ function dt(e, t, n, r, i, a) {
|
|
|
1451
1495
|
}, g = {
|
|
1452
1496
|
explicitCount: m.length,
|
|
1453
1497
|
names: d.lineNames
|
|
1454
|
-
}, _ =
|
|
1455
|
-
col:
|
|
1456
|
-
row:
|
|
1498
|
+
}, _ = At(s.map((e) => ({
|
|
1499
|
+
col: kt(e.style.gridColumnStart, e.style.gridColumnEnd, h),
|
|
1500
|
+
row: kt(e.style.gridRowStart, e.style.gridRowEnd, g)
|
|
1457
1501
|
})), p.length, m.length, o.gridAutoFlow);
|
|
1458
|
-
return c &&
|
|
1502
|
+
return c && _t(_, "col", p.length), l && _t(_, "row", m.length), {
|
|
1459
1503
|
children: s,
|
|
1460
1504
|
placed: _,
|
|
1461
1505
|
colLines: h,
|
|
1462
1506
|
rowLines: g,
|
|
1463
|
-
colTracks:
|
|
1464
|
-
rowTracks:
|
|
1465
|
-
colCollapsed:
|
|
1466
|
-
rowCollapsed:
|
|
1507
|
+
colTracks: Tt(p, _.colOrigin, _.colCount, o.gridAutoColumns),
|
|
1508
|
+
rowTracks: Tt(m, _.rowOrigin, _.rowCount, o.gridAutoRows),
|
|
1509
|
+
colCollapsed: Et(u, _.colOrigin, _.colCount, _.items.map((e) => e.col)),
|
|
1510
|
+
rowCollapsed: Et(d, _.rowOrigin, _.rowCount, _.items.map((e) => e.row))
|
|
1467
1511
|
};
|
|
1468
1512
|
}
|
|
1469
|
-
function
|
|
1513
|
+
function gt(e) {
|
|
1470
1514
|
return {
|
|
1471
|
-
tracks: Array.from({ length: e }, () =>
|
|
1515
|
+
tracks: Array.from({ length: e }, () => it()),
|
|
1472
1516
|
lineNames: Array.from({ length: e + 1 }, () => [])
|
|
1473
1517
|
};
|
|
1474
1518
|
}
|
|
1475
|
-
function
|
|
1519
|
+
function _t(e, t, n) {
|
|
1476
1520
|
let r = t === "col" ? e.colOrigin : e.rowOrigin;
|
|
1477
1521
|
for (let i of e.items) {
|
|
1478
1522
|
let e = i[t], a = Math.min(Math.max(e.start + r, 0), n - 1), o = Math.min(Math.max(e.start + r + e.span, a + 1), n);
|
|
@@ -1480,22 +1524,22 @@ function pt(e, t, n) {
|
|
|
1480
1524
|
}
|
|
1481
1525
|
t === "col" ? (e.colOrigin = 0, e.colCount = n) : (e.rowOrigin = 0, e.rowCount = n);
|
|
1482
1526
|
}
|
|
1483
|
-
function
|
|
1527
|
+
function vt(e) {
|
|
1484
1528
|
return e.children.filter((e) => !B(e.style) && !e.inlineBox).sort((e, t) => e.style.order - t.style.order);
|
|
1485
1529
|
}
|
|
1486
|
-
function
|
|
1530
|
+
function yt(e) {
|
|
1487
1531
|
return (e.left ?? 0) + (e.right ?? 0);
|
|
1488
1532
|
}
|
|
1489
|
-
function
|
|
1533
|
+
function bt(e) {
|
|
1490
1534
|
return (e.top ?? 0) + (e.bottom ?? 0);
|
|
1491
1535
|
}
|
|
1492
|
-
function
|
|
1536
|
+
function xt(e, t, n) {
|
|
1493
1537
|
let r = e.style, i;
|
|
1494
1538
|
r.width !== void 0 && r.width.kind !== "auto" && r.width.kind !== "percent" && (i = q(r.width, 0, e, n)), i === void 0 && (i = t === "min" ? Y(e, n) : J(e, n));
|
|
1495
1539
|
let a = typeof r.minWidth == "number" ? r.minWidth : 0, o = typeof r.maxWidth == "number" ? r.maxWidth : void 0;
|
|
1496
1540
|
return Math.max(0, H(i, a, o));
|
|
1497
1541
|
}
|
|
1498
|
-
function
|
|
1542
|
+
function St(e, t, n) {
|
|
1499
1543
|
if (e.kind !== "tracks") return {
|
|
1500
1544
|
tracks: [],
|
|
1501
1545
|
lineNames: [[]]
|
|
@@ -1508,7 +1552,7 @@ function vt(e, t, n) {
|
|
|
1508
1552
|
let { index: i, tracks: a, mode: o } = e.autoRepeat, s = 1;
|
|
1509
1553
|
if (t !== void 0) {
|
|
1510
1554
|
let e = a.reduce((e, n) => {
|
|
1511
|
-
let r =
|
|
1555
|
+
let r = Ct(n.min, t) ?? Ct(n.max, t) ?? 1;
|
|
1512
1556
|
return e + Math.max(1, r);
|
|
1513
1557
|
}, 0);
|
|
1514
1558
|
s = Math.max(1, Math.floor((t + n) / (e + n * a.length)));
|
|
@@ -1536,23 +1580,23 @@ function vt(e, t, n) {
|
|
|
1536
1580
|
lineNames: d
|
|
1537
1581
|
};
|
|
1538
1582
|
}
|
|
1539
|
-
function
|
|
1583
|
+
function Ct(e, t) {
|
|
1540
1584
|
if (e.kind === "cells") return e.value;
|
|
1541
|
-
if (e.kind === "percent" && t !== void 0) return
|
|
1585
|
+
if (e.kind === "percent" && t !== void 0) return Ce(e.value, t);
|
|
1542
1586
|
if (e.kind === "math") {
|
|
1543
1587
|
let n = [];
|
|
1544
1588
|
for (let r of e.args) {
|
|
1545
|
-
let e =
|
|
1589
|
+
let e = Ct(r, t);
|
|
1546
1590
|
if (e === void 0) return;
|
|
1547
1591
|
n.push(e);
|
|
1548
1592
|
}
|
|
1549
1593
|
return e.fn === "min" ? Math.min(...n) : Math.max(...n);
|
|
1550
1594
|
}
|
|
1551
1595
|
}
|
|
1552
|
-
function
|
|
1596
|
+
function wt(e, t, n, r) {
|
|
1553
1597
|
for (let i = e.length; i < n; i++) e.push(r[(i - e.length) % r.length]), t.push([]);
|
|
1554
1598
|
}
|
|
1555
|
-
function
|
|
1599
|
+
function Tt(e, t, n, r) {
|
|
1556
1600
|
let i = [];
|
|
1557
1601
|
for (let a = 0; a < n; a++) {
|
|
1558
1602
|
let n = a + t;
|
|
@@ -1564,7 +1608,7 @@ function xt(e, t, n, r) {
|
|
|
1564
1608
|
}
|
|
1565
1609
|
return i;
|
|
1566
1610
|
}
|
|
1567
|
-
function
|
|
1611
|
+
function Et(e, t, n, r) {
|
|
1568
1612
|
let i = Array.from({ length: n }, () => !1);
|
|
1569
1613
|
if (!e.autoFit) return i;
|
|
1570
1614
|
for (let a = e.autoFit.start; a < e.autoFit.end; a++) {
|
|
@@ -1573,7 +1617,7 @@ function St(e, t, n, r) {
|
|
|
1573
1617
|
}
|
|
1574
1618
|
return i;
|
|
1575
1619
|
}
|
|
1576
|
-
function
|
|
1620
|
+
function Dt(e, t, n) {
|
|
1577
1621
|
if (e.kind === "line") return e.value > 0 ? e.value - 1 : n.explicitCount + 1 + e.value;
|
|
1578
1622
|
if (e.kind !== "name") return null;
|
|
1579
1623
|
if (e.nth === void 0) {
|
|
@@ -1588,14 +1632,14 @@ function Ct(e, t, n) {
|
|
|
1588
1632
|
for (let t = i; t >= 0; t--) if (n.names[t].includes(e.name) && ++a === -r) return t;
|
|
1589
1633
|
return -(-r - a);
|
|
1590
1634
|
}
|
|
1591
|
-
function
|
|
1635
|
+
function Ot(e, t, n, r) {
|
|
1592
1636
|
if (t.name === void 0) return e + n * t.value;
|
|
1593
1637
|
let i = t.value, a = e;
|
|
1594
1638
|
for (; i > 0;) a += n, (!(a >= 0 && a <= r.explicitCount) || r.names[a].includes(t.name)) && i--;
|
|
1595
1639
|
return a;
|
|
1596
1640
|
}
|
|
1597
|
-
function
|
|
1598
|
-
let r =
|
|
1641
|
+
function kt(e, t, n) {
|
|
1642
|
+
let r = Dt(e, "start", n), i = Dt(t, "end", n);
|
|
1599
1643
|
if (r !== null && i !== null) return r === i ? {
|
|
1600
1644
|
start: r,
|
|
1601
1645
|
span: 1
|
|
@@ -1605,10 +1649,10 @@ function Tt(e, t, n) {
|
|
|
1605
1649
|
};
|
|
1606
1650
|
if (r !== null) return {
|
|
1607
1651
|
start: r,
|
|
1608
|
-
span: (t.kind === "span" ?
|
|
1652
|
+
span: (t.kind === "span" ? Ot(r, t, 1, n) : r + 1) - r
|
|
1609
1653
|
};
|
|
1610
1654
|
if (i !== null) {
|
|
1611
|
-
let t = e.kind === "span" ?
|
|
1655
|
+
let t = e.kind === "span" ? Ot(i, e, -1, n) : i - 1;
|
|
1612
1656
|
return {
|
|
1613
1657
|
start: t,
|
|
1614
1658
|
span: i - t
|
|
@@ -1619,7 +1663,7 @@ function Tt(e, t, n) {
|
|
|
1619
1663
|
span: e.kind === "span" ? e.value : t.kind === "span" ? t.value : 1
|
|
1620
1664
|
};
|
|
1621
1665
|
}
|
|
1622
|
-
function
|
|
1666
|
+
function At(e, t, n, r) {
|
|
1623
1667
|
let i = r.direction === "row", a = e.map((e) => i ? e.row : e.col), o = e.map((e) => i ? e.col : e.row), s = i ? t : n, c = i ? n : t, l = 0, u = Math.max(s, 1);
|
|
1624
1668
|
for (let t = 0; t < e.length; t++) {
|
|
1625
1669
|
let e = o[t];
|
|
@@ -1716,7 +1760,7 @@ function Et(e, t, n, r) {
|
|
|
1716
1760
|
rowCount: S
|
|
1717
1761
|
};
|
|
1718
1762
|
}
|
|
1719
|
-
function
|
|
1763
|
+
function jt(e, t, n, r, i, a) {
|
|
1720
1764
|
let o = typeof r == "number" ? r : void 0, s = e.map((e, n) => {
|
|
1721
1765
|
if (t[n]) return {
|
|
1722
1766
|
base: 0,
|
|
@@ -1726,7 +1770,7 @@ function Dt(e, t, n, r, i, a) {
|
|
|
1726
1770
|
frFactor: 0,
|
|
1727
1771
|
collapsed: !0
|
|
1728
1772
|
};
|
|
1729
|
-
let r =
|
|
1773
|
+
let r = Ct(e.min, o), i = r ?? 0, a = r === void 0, s = e.max;
|
|
1730
1774
|
if (s.kind === "fr") return {
|
|
1731
1775
|
base: i,
|
|
1732
1776
|
limit: null,
|
|
@@ -1735,7 +1779,7 @@ function Dt(e, t, n, r, i, a) {
|
|
|
1735
1779
|
frFactor: s.value,
|
|
1736
1780
|
collapsed: !1
|
|
1737
1781
|
};
|
|
1738
|
-
let c =
|
|
1782
|
+
let c = Ct(s, o);
|
|
1739
1783
|
return c === void 0 ? {
|
|
1740
1784
|
base: i,
|
|
1741
1785
|
limit: null,
|
|
@@ -1860,65 +1904,65 @@ function Dt(e, t, n, r, i, a) {
|
|
|
1860
1904
|
limits: s.map((e) => u(e))
|
|
1861
1905
|
};
|
|
1862
1906
|
}
|
|
1863
|
-
function
|
|
1864
|
-
let { sizes: r, gapBefore: i } = e, a = Math.max(0, t -
|
|
1907
|
+
function Mt(e, t, n) {
|
|
1908
|
+
let { sizes: r, gapBefore: i } = e, a = Math.max(0, t - Nt(e)), o = L(n === "stretch" ? "start" : n, r, a), s = [], c = 0;
|
|
1865
1909
|
for (let e = 0; e < r.length; e++) c += i[e], s.push(o[e] + c);
|
|
1866
1910
|
return s;
|
|
1867
1911
|
}
|
|
1868
|
-
function
|
|
1912
|
+
function Nt(e) {
|
|
1869
1913
|
return e.sizes.reduce((e, t) => e + t, 0) + e.gapBefore.reduce((e, t) => e + t, 0);
|
|
1870
1914
|
}
|
|
1871
|
-
function
|
|
1915
|
+
function Pt(e, t, n, r) {
|
|
1872
1916
|
let i = n + r - 1;
|
|
1873
1917
|
return e[n] === void 0 || e[i] === void 0 ? 0 : e[i] + t[i] - e[n];
|
|
1874
1918
|
}
|
|
1875
|
-
function
|
|
1919
|
+
function Ft(e, t, n, r, i) {
|
|
1876
1920
|
let a = t ?? 0, o = n ?? 0, s = r - i;
|
|
1877
|
-
return t === null && n === null ? Math.floor(s / 2) : t === null ? s - o : n === null ? a : a +
|
|
1921
|
+
return t === null && n === null ? Math.floor(s / 2) : t === null ? s - o : n === null ? a : a + z(e, r, i + a + o);
|
|
1878
1922
|
}
|
|
1879
1923
|
//#endregion
|
|
1880
1924
|
//#region src/multicol.ts
|
|
1881
|
-
function
|
|
1925
|
+
function It(e, t, n) {
|
|
1882
1926
|
let r = e.columnWidth === null ? null : Math.max(1, Math.floor((t + n) / (e.columnWidth + n)));
|
|
1883
1927
|
return e.columnCount !== null && r !== null ? Math.max(1, Math.min(e.columnCount, r)) : r === null ? Math.max(1, e.columnCount ?? 1) : r;
|
|
1884
1928
|
}
|
|
1885
|
-
function
|
|
1886
|
-
let r =
|
|
1929
|
+
function Lt(e, t, n) {
|
|
1930
|
+
let r = It(e, t, n), i = Math.max(1, Math.floor((t - (r - 1) * n) / r)), a = Math.max(0, t - (r * i + (r - 1) * n));
|
|
1887
1931
|
return Array.from({ length: r }, (e, t) => i + +(t < a));
|
|
1888
1932
|
}
|
|
1889
|
-
function
|
|
1933
|
+
function Rt(e, t) {
|
|
1890
1934
|
let n = Math.max(typeof e.gapX == "number" ? e.gapX : 0, e.ruleX?.width ?? 0);
|
|
1891
1935
|
return e.columnCount === null ? Math.max(e.columnWidth ?? 1, t) : e.columnCount * t + (e.columnCount - 1) * n;
|
|
1892
1936
|
}
|
|
1893
|
-
function
|
|
1937
|
+
function zt(e, t) {
|
|
1894
1938
|
return e === void 0 ? t : t === void 0 ? e : Math.min(e, t);
|
|
1895
1939
|
}
|
|
1896
|
-
function
|
|
1940
|
+
function Bt(e, t, n) {
|
|
1897
1941
|
for (; e < t;) {
|
|
1898
1942
|
let r = e + t >> 1;
|
|
1899
1943
|
n(r) ? t = r : e = r + 1;
|
|
1900
1944
|
}
|
|
1901
1945
|
return e;
|
|
1902
1946
|
}
|
|
1903
|
-
function
|
|
1904
|
-
let r =
|
|
1947
|
+
function Vt(e, t, n) {
|
|
1948
|
+
let r = It(e, t, n), i = Math.max(1, Math.floor((t - (r - 1) * n) / r));
|
|
1905
1949
|
return {
|
|
1906
1950
|
count: r,
|
|
1907
1951
|
width: i,
|
|
1908
1952
|
leftover: Math.max(0, t - (r * i + (r - 1) * n))
|
|
1909
1953
|
};
|
|
1910
1954
|
}
|
|
1911
|
-
function
|
|
1955
|
+
function Ht(e, t, n) {
|
|
1912
1956
|
return e === "all" ? !0 : e === "around" ? t || n : t && n;
|
|
1913
1957
|
}
|
|
1914
|
-
function
|
|
1915
|
-
let i =
|
|
1958
|
+
function Ut(e, t, n, r) {
|
|
1959
|
+
let i = Vn(e, Math.max(1, t.width - e.style.tracking)), { heights: a, textOffsets: o } = Hn(e, i), s = e.style.lineGap, c = Gt(a.map((e) => e + s)), l;
|
|
1916
1960
|
if (e.style.columnFill === "auto" && r !== void 0) l = Math.max(1, r);
|
|
1917
1961
|
else {
|
|
1918
|
-
let e =
|
|
1962
|
+
let e = Bt(c.reduce((e, t) => Math.max(e, t.rows - s), 1), Math.max(1, c.reduce((e, t) => e + t.rows, 0) - s), (e) => Wt(c, s, e).columns <= t.count);
|
|
1919
1963
|
l = r === void 0 ? e : Math.max(1, Math.min(e, r));
|
|
1920
1964
|
}
|
|
1921
|
-
let u =
|
|
1965
|
+
let u = Wt(c, s, l);
|
|
1922
1966
|
return {
|
|
1923
1967
|
spans: i,
|
|
1924
1968
|
lineY: u.top,
|
|
@@ -1931,7 +1975,7 @@ function zt(e, t, n, r) {
|
|
|
1931
1975
|
columnsUsed: i.length > 0 ? u.columns : 0
|
|
1932
1976
|
};
|
|
1933
1977
|
}
|
|
1934
|
-
function
|
|
1978
|
+
function Wt(e, t, n, r = "truncate") {
|
|
1935
1979
|
let i = 0, a = 0, o = 0, s = [], c = [];
|
|
1936
1980
|
for (let l = 0; l < e.length; l++) {
|
|
1937
1981
|
let u = e[l], d = r === "glue" || l === 0 || a > 0 ? u.pre : 0;
|
|
@@ -1952,7 +1996,7 @@ function Bt(e, t, n, r = "truncate") {
|
|
|
1952
1996
|
top: c
|
|
1953
1997
|
};
|
|
1954
1998
|
}
|
|
1955
|
-
function
|
|
1999
|
+
function Gt(e) {
|
|
1956
2000
|
return e.map((e) => ({
|
|
1957
2001
|
rows: e,
|
|
1958
2002
|
pre: 0,
|
|
@@ -1961,27 +2005,27 @@ function Vt(e) {
|
|
|
1961
2005
|
lines: 1
|
|
1962
2006
|
}));
|
|
1963
2007
|
}
|
|
1964
|
-
var
|
|
1965
|
-
function
|
|
1966
|
-
if (
|
|
2008
|
+
var Kt = null;
|
|
2009
|
+
function qt() {
|
|
2010
|
+
if (Kt !== null) return Kt;
|
|
1967
2011
|
let e = document.createElement("div");
|
|
1968
2012
|
e.style.cssText = "position:absolute;left:-9999px;visibility:hidden;columns:2;column-gap:0;column-fill:balance;width:200px;font:10px/20px monospace;orphans:1;widows:1", e.innerHTML = "<div style=\"margin:0;padding:0 0 20px 0\">aaaaaa aaaaaa aaaaaa</div><div style=\"margin:0\"><span>bbbbbb</span> bbbbbb</div>", document.body.appendChild(e);
|
|
1969
2013
|
let t = e.getBoundingClientRect().top, n = e.querySelector("span").getBoundingClientRect();
|
|
1970
|
-
return e.remove(),
|
|
2014
|
+
return e.remove(), Kt = !(n.width > 0 && n.top - t >= 10), Kt;
|
|
1971
2015
|
}
|
|
1972
|
-
function
|
|
1973
|
-
let { columnWidth: n, columnCount: r, tracking: i = 0, lineGap: a = 0, restrictingHeight: o } = t, s = i > 0 ? Array.from(e, () => 1 + i) : void 0, c =
|
|
2016
|
+
function Jt(e, t) {
|
|
2017
|
+
let { columnWidth: n, columnCount: r, tracking: i = 0, lineGap: a = 0, restrictingHeight: o } = t, s = i > 0 ? Array.from(e, () => 1 + i) : void 0, c = Ae(e, Math.max(1, n - i), {
|
|
1974
2018
|
advances: s,
|
|
1975
2019
|
tracking: i,
|
|
1976
2020
|
firstLineIndent: t.firstLineIndent
|
|
1977
|
-
}), l =
|
|
2021
|
+
}), l = Gt(c.map(() => 1 + a)), u = Wt(l, a, o ?? Bt(1, Math.max(1, c.length * (1 + a) - a), (e) => Wt(l, a, e).columns <= r));
|
|
1978
2022
|
return c.map((t, n) => ({
|
|
1979
2023
|
text: e.slice(t.start, t.end),
|
|
1980
2024
|
column: u.column[n],
|
|
1981
2025
|
top: u.top[n]
|
|
1982
2026
|
}));
|
|
1983
2027
|
}
|
|
1984
|
-
function
|
|
2028
|
+
function Yt(e, t, n, r) {
|
|
1985
2029
|
let i = e.style;
|
|
1986
2030
|
if (!i.ruleX) return;
|
|
1987
2031
|
let a = t.columnCount * t.columnWidth + (t.columnCount - 1) * t.gap, o = t.ruleSegments ?? [{
|
|
@@ -1991,18 +2035,18 @@ function Gt(e, t, n, r) {
|
|
|
1991
2035
|
}], s = [];
|
|
1992
2036
|
for (let e of o) {
|
|
1993
2037
|
let n = Math.min(e.columns, t.columnCount);
|
|
1994
|
-
for (let r = 0; r < t.columnCount - 1; r++)
|
|
2038
|
+
for (let r = 0; r < t.columnCount - 1; r++) Ht(i.ruleVisibilityItems, r < n, r + 1 < n) && s.push({
|
|
1995
2039
|
bandStart: (r + 1) * t.columnWidth + r * t.gap,
|
|
1996
2040
|
bandSize: t.gap,
|
|
1997
2041
|
start: e.start,
|
|
1998
2042
|
end: e.end
|
|
1999
2043
|
});
|
|
2000
2044
|
}
|
|
2001
|
-
e.decorationRuns =
|
|
2045
|
+
e.decorationRuns = ye({
|
|
2002
2046
|
glyphs: S(i.glyphSet),
|
|
2003
2047
|
ruleX: i.ruleX,
|
|
2004
2048
|
ruleY: null,
|
|
2005
|
-
vertical:
|
|
2049
|
+
vertical: Ve(s, i.ruleInset),
|
|
2006
2050
|
horizontal: [],
|
|
2007
2051
|
contentWidth: a,
|
|
2008
2052
|
contentHeight: t.totalRows,
|
|
@@ -2012,12 +2056,12 @@ function Gt(e, t, n, r) {
|
|
|
2012
2056
|
padding: r
|
|
2013
2057
|
});
|
|
2014
2058
|
}
|
|
2015
|
-
function
|
|
2059
|
+
function Xt(e, t) {
|
|
2016
2060
|
let n = e.style, r = n.padding;
|
|
2017
|
-
return e.text !== "" && e.children.length === 0 && n.display === "block" && n.position === "static" && !n.columnSpan && n.whiteSpace === "normal" && n.lineGap === t.lineGap && n.border.top === 0 && n.border.right === 0 && n.border.bottom === 0 && n.border.left === 0 && r.top === 0 && r.right === 0 && r.bottom === 0 && r.left === 0 && n.backgroundColor === void 0 && !n.backgroundClear && (n.width === void 0 || n.width.kind === "auto") && (n.height === void 0 || n.height.kind === "auto") && (n.minWidth === "auto" || n.minWidth === 0 || n.minWidth === void 0) && (n.minHeight === "auto" || n.minHeight === 0 || n.minHeight === void 0) && n.maxWidth === void 0 && n.maxHeight === void 0;
|
|
2061
|
+
return e.text !== "" && e.children.length === 0 && n.display === "block" && n.position === "static" && !n.columnSpan && n.whiteSpace === "normal" && n.lineGap === t.lineGap && n.border.top === 0 && n.border.right === 0 && n.border.bottom === 0 && n.border.left === 0 && r.top === 0 && r.right === 0 && r.bottom === 0 && r.left === 0 && n.backgroundColor === void 0 && !n.backgroundClear && n.overflow.x === "visible" && n.overflow.y === "visible" && (n.width === void 0 || n.width.kind === "auto") && (n.height === void 0 || n.height.kind === "auto") && (n.minWidth === "auto" || n.minWidth === 0 || n.minWidth === void 0) && (n.minHeight === "auto" || n.minHeight === 0 || n.minHeight === void 0) && n.maxWidth === void 0 && n.maxHeight === void 0;
|
|
2018
2062
|
}
|
|
2019
|
-
function
|
|
2020
|
-
let s = e.style, c = U(s, "x", n), l =
|
|
2063
|
+
function Zt(e, t, n, r, i, a, o) {
|
|
2064
|
+
let s = e.style, c = U(s, "x", n), l = Vt(s, n, c);
|
|
2021
2065
|
a.right += l.leftover;
|
|
2022
2066
|
let u = s.lineGap, d = i.left + a.left, f = i.top + a.top, p = n - l.leftover, m = [[]], h = [];
|
|
2023
2067
|
for (let e of t) e.style.columnSpan ? (h[m.length - 1] = e, m.push([])) : m[m.length - 1].push(e);
|
|
@@ -2027,13 +2071,13 @@ function qt(e, t, n, r, i, a, o) {
|
|
|
2027
2071
|
if (t.length > 0) {
|
|
2028
2072
|
let i = t.map((e) => ({
|
|
2029
2073
|
node: e,
|
|
2030
|
-
spans:
|
|
2074
|
+
spans: Vn(e, Math.max(1, l.width - e.style.tracking)),
|
|
2031
2075
|
margin: G(e.style.margin, l.width),
|
|
2032
2076
|
pre: 0,
|
|
2033
2077
|
post: 0
|
|
2034
2078
|
})), a = [], o = null, h = null, x = !1;
|
|
2035
2079
|
for (let e of i) {
|
|
2036
|
-
let { node: t, spans: n, margin: r } = e, i = o === null ? r.top ?? 0 :
|
|
2080
|
+
let { node: t, spans: n, margin: r } = e, i = o === null ? r.top ?? 0 : qn(o, r.top ?? 0), s = i;
|
|
2037
2081
|
_ === "glue" && h !== null ? (s = 0, h.post = i, a[a.length - 1].post = i) : e.pre = i;
|
|
2038
2082
|
let c = x || t.style.breakBeforeColumn;
|
|
2039
2083
|
if (t.style.breakInsideAvoid && n.length > 0) a.push({
|
|
@@ -2056,10 +2100,10 @@ function qt(e, t, n, r, i, a, o) {
|
|
|
2056
2100
|
let S;
|
|
2057
2101
|
if (s.columnFill === "auto" && r !== void 0) S = Math.max(1, r);
|
|
2058
2102
|
else {
|
|
2059
|
-
let e =
|
|
2103
|
+
let e = Bt(1, Math.max(1, Wt(a, u, Infinity, _).maxUsed), (e) => Wt(a, u, e, _).columns <= l.count);
|
|
2060
2104
|
S = r === void 0 ? e : Math.max(1, Math.min(e, r));
|
|
2061
2105
|
}
|
|
2062
|
-
let C =
|
|
2106
|
+
let C = Wt(a, u, S, _);
|
|
2063
2107
|
for (let e = 0, t = 0; e < i.length; e++) {
|
|
2064
2108
|
let { node: n, spans: r, margin: a, pre: o, post: s } = i[e], u = [], m = [];
|
|
2065
2109
|
for (let e = 0; e < r.length; e++, t++) u.push(y + C.top[t]), m.push(C.column[t] * (l.width + c));
|
|
@@ -2100,7 +2144,7 @@ function qt(e, t, n, r, i, a, o) {
|
|
|
2100
2144
|
if (i) {
|
|
2101
2145
|
let e = G(i.style.margin, p), t = (e.left ?? 0) + (e.right ?? 0);
|
|
2102
2146
|
V(i, Math.max(0, p - t), void 0, 0, 0, "fill", o);
|
|
2103
|
-
let r =
|
|
2147
|
+
let r = Kn(e, p, i.localRect.width), a = (e.top ?? 0) + n;
|
|
2104
2148
|
y += a, i.localRect = {
|
|
2105
2149
|
...i.localRect,
|
|
2106
2150
|
x: d + r,
|
|
@@ -2139,10 +2183,10 @@ function qt(e, t, n, r, i, a, o) {
|
|
|
2139
2183
|
} : {}
|
|
2140
2184
|
}, x;
|
|
2141
2185
|
}
|
|
2142
|
-
function
|
|
2143
|
-
let s = e.style, c =
|
|
2144
|
-
if (u.length > 0 && u.every((e) =>
|
|
2145
|
-
let f = U(s, "x", t), p =
|
|
2186
|
+
function Qt(e, t, n, r, i, a, o) {
|
|
2187
|
+
let s = e.style, c = zt(n, r), l = e.children.filter((e) => !B(e.style)), u = l.filter((e) => !e.style.columnSpan), d = l.reduce((e, t, n) => !t.style.columnSpan && (n === 0 || l[n - 1].style.columnSpan) ? e + 1 : e, 0);
|
|
2188
|
+
if (u.length > 0 && u.every((e) => Xt(e, s)) && (u.length === l.length || s.columnFill === "balance" && c === void 0 && (qt() || d <= 1 && u.every((e) => (e.style.margin.top === 0 || e.style.margin.top === null) && (e.style.margin.bottom === 0 || e.style.margin.bottom === null))))) return Zt(e, l, t, c, i, a, o);
|
|
2189
|
+
let f = U(s, "x", t), p = Lt(s, t, f), m = p.length, h = [];
|
|
2146
2190
|
{
|
|
2147
2191
|
let e = 0;
|
|
2148
2192
|
for (let t of p) h.push(e), e += t + f;
|
|
@@ -2151,7 +2195,7 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2151
2195
|
let r = 0, i = 0, a = null, s = 0, c = (e) => {
|
|
2152
2196
|
if (t) for (let t of T) {
|
|
2153
2197
|
if (t.index !== e) continue;
|
|
2154
|
-
let n = a === null ? t.margin.top ?? 0 :
|
|
2198
|
+
let n = a === null ? t.margin.top ?? 0 : qn(a, t.margin.top ?? 0);
|
|
2155
2199
|
t.child.staticSlot = {
|
|
2156
2200
|
kind: "block",
|
|
2157
2201
|
x: y + g(r) + (t.margin.left ?? 0),
|
|
@@ -2162,7 +2206,7 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2162
2206
|
for (let l = 0; l < w.length; l++) {
|
|
2163
2207
|
let u = w[l];
|
|
2164
2208
|
c(l);
|
|
2165
|
-
let d = a === null ? l === 0 ? u.margin.top ?? 0 : 0 :
|
|
2209
|
+
let d = a === null ? l === 0 ? u.margin.top ?? 0 : 0 : qn(a, u.margin.top ?? 0), f = u.node.localRect.height;
|
|
2166
2210
|
if (a !== null && (u.breakBefore || i + d + f > e) && (r += 1, i = 0, a = null, d = 0), t) {
|
|
2167
2211
|
let e = u.node, t = _(r);
|
|
2168
2212
|
if (t !== v) {
|
|
@@ -2171,7 +2215,7 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2171
2215
|
}
|
|
2172
2216
|
e.localRect = {
|
|
2173
2217
|
...e.localRect,
|
|
2174
|
-
x: y + g(r) +
|
|
2218
|
+
x: y + g(r) + Kn(u.margin, t, e.localRect.width),
|
|
2175
2219
|
y: b + C + i + d
|
|
2176
2220
|
};
|
|
2177
2221
|
}
|
|
@@ -2194,13 +2238,13 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2194
2238
|
let e = c === void 0 ? void 0 : Math.max(1, c - C), t = s.columnFill === "auto" && e !== void 0, r;
|
|
2195
2239
|
if (t) r = e;
|
|
2196
2240
|
else {
|
|
2197
|
-
let t =
|
|
2241
|
+
let t = Bt(1, D(Infinity, !1).maxUsed, (e) => D(e, !1).columns <= m);
|
|
2198
2242
|
r = e === void 0 ? t : Math.min(t, e);
|
|
2199
2243
|
}
|
|
2200
2244
|
let i = D(r, !0), a = t && n !== void 0 ? Math.max(i.maxUsed, r) : i.maxUsed;
|
|
2201
2245
|
if (s.ruleX) for (let e = 0; e < m - 1; e++) {
|
|
2202
2246
|
let t = Math.min(i.columns, m);
|
|
2203
|
-
|
|
2247
|
+
Ht(s.ruleVisibilityItems, e < t, e + 1 < t) && x.push({
|
|
2204
2248
|
bandStart: h[e] + p[e],
|
|
2205
2249
|
bandSize: f,
|
|
2206
2250
|
start: C,
|
|
@@ -2223,7 +2267,7 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2223
2267
|
let e = G(r.style.margin, t), i = (e.left ?? 0) + (e.right ?? 0);
|
|
2224
2268
|
V(r, Math.max(0, t - i), n, 0, 0, "fill", o), C += e.top ?? 0, r.localRect = {
|
|
2225
2269
|
...r.localRect,
|
|
2226
|
-
x: y +
|
|
2270
|
+
x: y + Kn(e, t, r.localRect.width),
|
|
2227
2271
|
y: b + C
|
|
2228
2272
|
}, C += r.localRect.height + (e.bottom ?? 0);
|
|
2229
2273
|
continue;
|
|
@@ -2235,11 +2279,11 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2235
2279
|
breakBefore: E || r.style.breakBeforeColumn
|
|
2236
2280
|
}), E = r.style.breakAfterColumn;
|
|
2237
2281
|
}
|
|
2238
|
-
return O(), s.ruleX && x.length > 0 && (e.decorationRuns =
|
|
2282
|
+
return O(), s.ruleX && x.length > 0 && (e.decorationRuns = ye({
|
|
2239
2283
|
glyphs: S(s.glyphSet),
|
|
2240
2284
|
ruleX: s.ruleX,
|
|
2241
2285
|
ruleY: null,
|
|
2242
|
-
vertical:
|
|
2286
|
+
vertical: Ve(x, s.ruleInset),
|
|
2243
2287
|
horizontal: [],
|
|
2244
2288
|
contentWidth: t,
|
|
2245
2289
|
contentHeight: C,
|
|
@@ -2251,32 +2295,32 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2251
2295
|
}
|
|
2252
2296
|
//#endregion
|
|
2253
2297
|
//#region src/table.ts
|
|
2254
|
-
function
|
|
2255
|
-
e.hidden.push(t), t.style.tableRole !== "column" && t.style.tableRole !== "column-group" &&
|
|
2298
|
+
function $t(e, t) {
|
|
2299
|
+
e.hidden.push(t), t.style.tableRole !== "column" && t.style.tableRole !== "column-group" && N(t.source, "Table content outside the expected structure (rows in tables, cells in rows) can't be laid out and was hidden — no anonymous table boxes (specs/table.md).");
|
|
2256
2300
|
}
|
|
2257
|
-
function
|
|
2301
|
+
function en(e, t) {
|
|
2258
2302
|
let n = Number.parseInt(e.getAttribute(t) ?? "", 10);
|
|
2259
2303
|
return Number.isNaN(n) ? 1 : t === "colspan" ? Math.min(1e3, Math.max(1, n)) : Math.min(65534, Math.max(0, n));
|
|
2260
2304
|
}
|
|
2261
|
-
function
|
|
2305
|
+
function tn(e, t, n) {
|
|
2262
2306
|
let r = (t, r) => {
|
|
2263
2307
|
let i = t.style.width, a = i && i.kind !== "auto" && i.kind !== "percent" ? q(i, 0, t, n) : void 0, o = i && i.kind === "percent" ? i.value : void 0;
|
|
2264
2308
|
for (let t = 0; t < r; t++) e.colFixed.push(a), e.colPercent.push(o);
|
|
2265
2309
|
};
|
|
2266
2310
|
if (t.style.tableRole === "column") {
|
|
2267
|
-
r(t,
|
|
2311
|
+
r(t, nn(t.source));
|
|
2268
2312
|
return;
|
|
2269
2313
|
}
|
|
2270
2314
|
let i = t.children.filter((e) => e.style.tableRole === "column");
|
|
2271
|
-
if (i.length === 0) r(t,
|
|
2272
|
-
else for (let e of i) r(e,
|
|
2273
|
-
for (let n of t.children) n.style.tableRole !== "column" &&
|
|
2315
|
+
if (i.length === 0) r(t, nn(t.source));
|
|
2316
|
+
else for (let e of i) r(e, nn(e.source));
|
|
2317
|
+
for (let n of t.children) n.style.tableRole !== "column" && $t(e, n);
|
|
2274
2318
|
}
|
|
2275
|
-
function
|
|
2319
|
+
function nn(e) {
|
|
2276
2320
|
let t = Number.parseInt(e.getAttribute("span") ?? "", 10);
|
|
2277
2321
|
return Number.isNaN(t) ? 1 : Math.min(1e3, Math.max(1, t));
|
|
2278
2322
|
}
|
|
2279
|
-
function
|
|
2323
|
+
function rn(e, t) {
|
|
2280
2324
|
let n = {
|
|
2281
2325
|
caption: null,
|
|
2282
2326
|
rows: [],
|
|
@@ -2300,8 +2344,8 @@ function $t(e, t) {
|
|
|
2300
2344
|
for (let e of o.children) B(e.style) || (e.style.tableRole === "row" ? t.push({
|
|
2301
2345
|
row: e,
|
|
2302
2346
|
group: o
|
|
2303
|
-
}) :
|
|
2304
|
-
} else e === "caption" ? n.caption === null ? n.caption = o :
|
|
2347
|
+
}) : $t(n, e));
|
|
2348
|
+
} else e === "caption" ? n.caption === null ? n.caption = o : $t(n, o) : e === "column" || e === "column-group" ? (tn(n, o, t), n.hidden.push(o)) : $t(n, o);
|
|
2305
2349
|
}
|
|
2306
2350
|
let o = [
|
|
2307
2351
|
...r,
|
|
@@ -2316,20 +2360,20 @@ function $t(e, t) {
|
|
|
2316
2360
|
s = e + 1;
|
|
2317
2361
|
}
|
|
2318
2362
|
}
|
|
2319
|
-
return
|
|
2363
|
+
return an(n), n;
|
|
2320
2364
|
}
|
|
2321
|
-
function
|
|
2365
|
+
function an(e) {
|
|
2322
2366
|
let t = [];
|
|
2323
2367
|
for (let n = 0; n < e.rows.length; n++) {
|
|
2324
2368
|
let r = e.rows[n], i = 0;
|
|
2325
2369
|
for (let a of r.children) {
|
|
2326
2370
|
if (B(a.style)) continue;
|
|
2327
2371
|
if (a.style.tableRole !== "cell") {
|
|
2328
|
-
|
|
2372
|
+
$t(e, a);
|
|
2329
2373
|
continue;
|
|
2330
2374
|
}
|
|
2331
2375
|
for (; (t[i] ?? 0) > n;) i++;
|
|
2332
|
-
let o =
|
|
2376
|
+
let o = en(a.source, "colspan"), s = en(a.source, "rowspan"), c = e.groupEnds[n], l = Math.max(1, Math.min(s === 0 ? c - n : s, c - n));
|
|
2333
2377
|
for (let e = i; e < i + o; e++) t[e] = Math.max(t[e] ?? 0, n + l);
|
|
2334
2378
|
e.cells.push({
|
|
2335
2379
|
node: a,
|
|
@@ -2343,7 +2387,7 @@ function en(e) {
|
|
|
2343
2387
|
}
|
|
2344
2388
|
e.columnCount = Math.max(t.length, e.colFixed.length);
|
|
2345
2389
|
}
|
|
2346
|
-
function
|
|
2390
|
+
function on(e, t, n) {
|
|
2347
2391
|
let r = e.style, i = Y(e, n), a;
|
|
2348
2392
|
if (t === "min") a = i;
|
|
2349
2393
|
else {
|
|
@@ -2353,11 +2397,11 @@ function tn(e, t, n) {
|
|
|
2353
2397
|
let o = typeof r.minWidth == "number" ? r.minWidth : 0, s = typeof r.maxWidth == "number" ? r.maxWidth : void 0;
|
|
2354
2398
|
return Math.max(0, H(a, o, s));
|
|
2355
2399
|
}
|
|
2356
|
-
function
|
|
2400
|
+
function sn(e) {
|
|
2357
2401
|
let t = e.style.width;
|
|
2358
2402
|
return t && t.kind === "percent" ? t.value : void 0;
|
|
2359
2403
|
}
|
|
2360
|
-
function
|
|
2404
|
+
function cn(e, t, n) {
|
|
2361
2405
|
let r = e.columnCount, i = Array.from({ length: r }, () => 0), a = Array.from({ length: r }, () => 0), o = Array.from({ length: r }, () => void 0);
|
|
2362
2406
|
for (let t = 0; t < r; t++) e.colFixed[t] !== void 0 && (a[t] = e.colFixed[t]), o[t] = e.colPercent[t];
|
|
2363
2407
|
let s = [];
|
|
@@ -2366,15 +2410,15 @@ function rn(e, t, n) {
|
|
|
2366
2410
|
s.push(t);
|
|
2367
2411
|
continue;
|
|
2368
2412
|
}
|
|
2369
|
-
i[t.col] = Math.max(i[t.col],
|
|
2370
|
-
let e =
|
|
2413
|
+
i[t.col] = Math.max(i[t.col], on(t.node, "min", n)), a[t.col] = Math.max(a[t.col], on(t.node, "max", n));
|
|
2414
|
+
let e = sn(t.node);
|
|
2371
2415
|
e !== void 0 && (o[t.col] = Math.max(o[t.col] ?? 0, e));
|
|
2372
2416
|
}
|
|
2373
2417
|
s.sort((e, t) => e.colSpan - t.colSpan);
|
|
2374
2418
|
for (let e of s) {
|
|
2375
|
-
let r = e.col, o = e.col + e.colSpan, s =
|
|
2419
|
+
let r = e.col, o = e.col + e.colSpan, s = hn(t, r, o), c = a.slice(r, o);
|
|
2376
2420
|
for (let t of ["min", "max"]) {
|
|
2377
|
-
let l = t === "min" ? i : a, u = l.slice(r, o).reduce((e, t) => e + t, 0) + s, d =
|
|
2421
|
+
let l = t === "min" ? i : a, u = l.slice(r, o).reduce((e, t) => e + t, 0) + s, d = on(e.node, t, n) - u;
|
|
2378
2422
|
if (d <= 0) continue;
|
|
2379
2423
|
let f = R(c.some((e) => e > 0) ? c : c.map(() => 1), d);
|
|
2380
2424
|
for (let e = r; e < o; e++) l[e] += f[e - r];
|
|
@@ -2387,7 +2431,7 @@ function rn(e, t, n) {
|
|
|
2387
2431
|
percent: o
|
|
2388
2432
|
};
|
|
2389
2433
|
}
|
|
2390
|
-
function
|
|
2434
|
+
function ln(e, t) {
|
|
2391
2435
|
let n = e.min.length, r = e.min.slice(), i = [], a = [];
|
|
2392
2436
|
for (let t = 0; t < n; t++) (e.percent[t] === void 0 ? a : i).push(t);
|
|
2393
2437
|
if (i.length > 0) {
|
|
@@ -2416,7 +2460,7 @@ function an(e, t) {
|
|
|
2416
2460
|
}
|
|
2417
2461
|
return r;
|
|
2418
2462
|
}
|
|
2419
|
-
function
|
|
2463
|
+
function un(e, t, n) {
|
|
2420
2464
|
let r = e.columnCount, i = Array.from({ length: r }, () => void 0);
|
|
2421
2465
|
for (let n = 0; n < r; n++) e.colFixed[n] === void 0 ? e.colPercent[n] !== void 0 && (i[n] = Math.max(0, Math.round(t * e.colPercent[n] / 100))) : i[n] = e.colFixed[n];
|
|
2422
2466
|
for (let r of e.cells) {
|
|
@@ -2436,13 +2480,13 @@ function on(e, t, n) {
|
|
|
2436
2480
|
}
|
|
2437
2481
|
return i.map((e) => e ?? 0);
|
|
2438
2482
|
}
|
|
2439
|
-
var
|
|
2483
|
+
var dn = {
|
|
2440
2484
|
double: 3,
|
|
2441
2485
|
solid: 2,
|
|
2442
2486
|
dashed: 1,
|
|
2443
2487
|
dotted: 0
|
|
2444
2488
|
};
|
|
2445
|
-
function
|
|
2489
|
+
function fn(e) {
|
|
2446
2490
|
for (let { border: t, side: n } of e) if (t?.hidden[n]) return null;
|
|
2447
2491
|
let t = null;
|
|
2448
2492
|
for (let { border: n, side: r } of e) {
|
|
@@ -2450,7 +2494,7 @@ function cn(e) {
|
|
|
2450
2494
|
let e = n.width[r];
|
|
2451
2495
|
if (e <= 0) continue;
|
|
2452
2496
|
let i = n.style[r];
|
|
2453
|
-
(t === null || e > t.width || e === t.width &&
|
|
2497
|
+
(t === null || e > t.width || e === t.width && dn[i] > dn[t.style]) && (t = {
|
|
2454
2498
|
width: e,
|
|
2455
2499
|
style: i,
|
|
2456
2500
|
color: n.color[r]
|
|
@@ -2458,7 +2502,7 @@ function cn(e) {
|
|
|
2458
2502
|
}
|
|
2459
2503
|
return t;
|
|
2460
2504
|
}
|
|
2461
|
-
function
|
|
2505
|
+
function pn(e, t) {
|
|
2462
2506
|
let n = t.columnCount, r = t.rows.length, i = e.style.borderCollapse, a = {
|
|
2463
2507
|
collapsed: i,
|
|
2464
2508
|
vLines: Array.from({ length: n + 1 }, () => 0),
|
|
@@ -2503,7 +2547,7 @@ function ln(e, t) {
|
|
|
2503
2547
|
side: u
|
|
2504
2548
|
});
|
|
2505
2549
|
}
|
|
2506
|
-
i.push(
|
|
2550
|
+
i.push(fn(l));
|
|
2507
2551
|
}
|
|
2508
2552
|
a.vSegments.push(i), a.vLines[e] = i.reduce((e, t) => Math.max(e, t?.width ?? 0), 0);
|
|
2509
2553
|
}
|
|
@@ -2542,47 +2586,47 @@ function ln(e, t) {
|
|
|
2542
2586
|
}), e === r && l.push({
|
|
2543
2587
|
border: s,
|
|
2544
2588
|
side: "bottom"
|
|
2545
|
-
}), i.push(
|
|
2589
|
+
}), i.push(fn(l));
|
|
2546
2590
|
}
|
|
2547
2591
|
a.hSegments.push(i), a.hLines[e] = i.reduce((e, t) => Math.max(e, t?.width ?? 0), 0);
|
|
2548
2592
|
}
|
|
2549
2593
|
return a;
|
|
2550
2594
|
}
|
|
2551
|
-
function
|
|
2595
|
+
function mn(e, t) {
|
|
2552
2596
|
return e.collapsed ? e.vLines.reduce((e, t) => e + t, 0) : (t + 1) * e.spacingX;
|
|
2553
2597
|
}
|
|
2554
|
-
function
|
|
2598
|
+
function hn(e, t, n) {
|
|
2555
2599
|
if (!e.collapsed) return e.spacingX * (n - t - 1);
|
|
2556
2600
|
let r = 0;
|
|
2557
2601
|
for (let i = t + 1; i < n; i++) r += e.vLines[i];
|
|
2558
2602
|
return r;
|
|
2559
2603
|
}
|
|
2560
|
-
function
|
|
2604
|
+
function gn(e, t, n) {
|
|
2561
2605
|
if (!e.collapsed) return e.spacingY * (n - t - 1);
|
|
2562
2606
|
let r = 0;
|
|
2563
2607
|
for (let i = t + 1; i < n; i++) r += e.hLines[i];
|
|
2564
2608
|
return r;
|
|
2565
2609
|
}
|
|
2566
|
-
function
|
|
2610
|
+
function _n(e, t) {
|
|
2567
2611
|
let n = t.tableData.get(e);
|
|
2568
2612
|
if (n) return n;
|
|
2569
|
-
let r =
|
|
2613
|
+
let r = rn(e, t), i = pn(e, r), a = {
|
|
2570
2614
|
structure: r,
|
|
2571
2615
|
chrome: i,
|
|
2572
|
-
bounds:
|
|
2573
|
-
chromeX:
|
|
2616
|
+
bounds: cn(r, i, t),
|
|
2617
|
+
chromeX: mn(i, r.columnCount)
|
|
2574
2618
|
};
|
|
2575
2619
|
return t.tableData.set(e, a), a;
|
|
2576
2620
|
}
|
|
2577
|
-
function
|
|
2578
|
-
let { structure: n, bounds: r, chromeX: i } =
|
|
2621
|
+
function vn(e, t) {
|
|
2622
|
+
let { structure: n, bounds: r, chromeX: i } = _n(e, t), a = r.min.reduce((e, t) => e + t, 0) + i, o = r.max.reduce((e, t) => e + t, 0) + i;
|
|
2579
2623
|
return n.caption && (a = Math.max(a, Y(n.caption, t)), o = Math.max(o, J(n.caption, t))), {
|
|
2580
2624
|
min: a,
|
|
2581
2625
|
max: o
|
|
2582
2626
|
};
|
|
2583
2627
|
}
|
|
2584
|
-
function
|
|
2585
|
-
let r = e.style, { bounds: i, chromeX: a } =
|
|
2628
|
+
function yn(e, t, n) {
|
|
2629
|
+
let r = e.style, { bounds: i, chromeX: a } = _n(e, n), { min: o, max: s } = vn(e, n), c = r.border.left + r.border.right + W(r.padding.left, t) + W(r.padding.right, t) + tt(r).right, l = i.max.reduce((e, t) => e + t, 0), u = 0, d = 0;
|
|
2586
2630
|
for (let e = 0; e < i.max.length; e++) {
|
|
2587
2631
|
let t = i.percent[e];
|
|
2588
2632
|
t === void 0 ? d += i.max[e] : u += t;
|
|
@@ -2598,8 +2642,8 @@ function hn(e, t, n) {
|
|
|
2598
2642
|
let f = Math.max(l + a, s) + c;
|
|
2599
2643
|
return Math.max(o + c, Math.min(f, t));
|
|
2600
2644
|
}
|
|
2601
|
-
function
|
|
2602
|
-
let { structure: o, chrome: s, bounds: c } =
|
|
2645
|
+
function bn(e, t, n, r, i, a) {
|
|
2646
|
+
let { structure: o, chrome: s, bounds: c } = _n(e, a), l = o.columnCount, u = o.rows.length, d = r.left + i.left, f = r.top + i.top;
|
|
2603
2647
|
for (let e of o.hidden) e.tableHidden = !0, e.localRect = {
|
|
2604
2648
|
x: 0,
|
|
2605
2649
|
y: 0,
|
|
@@ -2611,16 +2655,16 @@ function gn(e, t, n, r, i, a) {
|
|
|
2611
2655
|
bottom: 0,
|
|
2612
2656
|
left: 0
|
|
2613
2657
|
}, e.unclampedHeight = 0;
|
|
2614
|
-
let p = Math.max(0, t -
|
|
2658
|
+
let p = Math.max(0, t - mn(s, l)), m = e.style, h = m.tableLayout === "fixed" && m.width !== void 0 && m.width.kind !== "auto" ? un(o, p, a) : ln(c, p), g = [], _ = 0;
|
|
2615
2659
|
for (let e = 0; e < l; e++) _ += s.collapsed ? s.vLines[e] : s.spacingX, g.push(_), _ += h[e];
|
|
2616
2660
|
let v = _ + (s.collapsed ? s.vLines[l] ?? 0 : s.spacingX), y = 0;
|
|
2617
2661
|
o.caption && (V(o.caption, t, void 0, d, f, "fill", a), y = o.caption.localRect.height);
|
|
2618
2662
|
let b = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
2619
2663
|
for (let e of o.cells) {
|
|
2620
|
-
let t = e.col + e.colSpan, n = h.slice(e.col, t).reduce((e, t) => e + t, 0) +
|
|
2664
|
+
let t = e.col + e.colSpan, n = h.slice(e.col, t).reduce((e, t) => e + t, 0) + hn(s, e.col, t);
|
|
2621
2665
|
x.set(e, n), V(e.node, n, void 0, 0, 0, "fill", a, { width: n }), b.set(e, e.node.localRect.height);
|
|
2622
2666
|
}
|
|
2623
|
-
let C = s.collapsed ? s.hLines.reduce((e, t) => e + t, 0) : (u + 1) * s.spacingY, w = n === void 0 ? void 0 : Math.max(0, n - y - C), T = (e) => e !== void 0 && e.kind === "percent" && w !== void 0 ?
|
|
2667
|
+
let C = s.collapsed ? s.hLines.reduce((e, t) => e + t, 0) : (u + 1) * s.spacingY, w = n === void 0 ? void 0 : Math.max(0, n - y - C), T = (e) => e !== void 0 && e.kind === "percent" && w !== void 0 ? Ce(e.value, w) : 0, E = Array.from({ length: u }, () => 0), D = Array.from({ length: u }, () => !1);
|
|
2624
2668
|
for (let e = 0; e < u; e++) {
|
|
2625
2669
|
let t = o.rows[e].style.height;
|
|
2626
2670
|
t !== void 0 && t.kind === "cells" && (E[e] = t.value);
|
|
@@ -2633,7 +2677,7 @@ function gn(e, t, n, r, i, a) {
|
|
|
2633
2677
|
}
|
|
2634
2678
|
let O = o.cells.filter((e) => e.rowSpan > 1).sort((e, t) => e.rowSpan - t.rowSpan);
|
|
2635
2679
|
for (let e of O) {
|
|
2636
|
-
let t = e.row + e.rowSpan, n = E.slice(e.row, t).reduce((e, t) => e + t, 0) +
|
|
2680
|
+
let t = e.row + e.rowSpan, n = E.slice(e.row, t).reduce((e, t) => e + t, 0) + gn(s, e.row, t), r = b.get(e) - n;
|
|
2637
2681
|
if (r <= 0) continue;
|
|
2638
2682
|
let i = R(Array.from({ length: e.rowSpan }, () => 1), r);
|
|
2639
2683
|
for (let n = e.row; n < t; n++) E[n] += i[n - e.row];
|
|
@@ -2684,11 +2728,11 @@ function gn(e, t, n, r, i, a) {
|
|
|
2684
2728
|
}, t.unclampedHeight = E[e];
|
|
2685
2729
|
}
|
|
2686
2730
|
for (let e of o.cells) {
|
|
2687
|
-
let t = e.row + e.rowSpan, n = E.slice(e.row, t).reduce((e, t) => e + t, 0) +
|
|
2731
|
+
let t = e.row + e.rowSpan, n = E.slice(e.row, t).reduce((e, t) => e + t, 0) + gn(s, e.row, t);
|
|
2688
2732
|
e.node.children.some((e) => !B(e.style) && e.style.height?.kind === "percent") && n !== b.get(e) && V(e.node, x.get(e), n, 0, 0, "fill", a, {
|
|
2689
2733
|
width: x.get(e),
|
|
2690
2734
|
height: n
|
|
2691
|
-
}),
|
|
2735
|
+
}), xn(e.node, n - (e.node.naturalContentHeight ?? e.node.localRect.height)), e.node.localRect = {
|
|
2692
2736
|
x: g[e.col],
|
|
2693
2737
|
y: 0,
|
|
2694
2738
|
width: e.node.localRect.width,
|
|
@@ -2700,9 +2744,9 @@ function gn(e, t, n, r, i, a) {
|
|
|
2700
2744
|
x: d,
|
|
2701
2745
|
y: f
|
|
2702
2746
|
});
|
|
2703
|
-
return o.caption && e.style.captionSide === "bottom" && (o.caption.localRect.y = f + M), s.collapsed && l > 0 && u > 0 && (e.decorationRuns =
|
|
2747
|
+
return o.caption && e.style.captionSide === "bottom" && (o.caption.localRect.y = f + M), s.collapsed && l > 0 && u > 0 && (e.decorationRuns = Sn(s, o, h, E, g, A, d, f, S(e.style.glyphSet))), e.style.captionSide === "bottom" ? M + y : M;
|
|
2704
2748
|
}
|
|
2705
|
-
function
|
|
2749
|
+
function xn(e, t) {
|
|
2706
2750
|
if (t <= 0) return;
|
|
2707
2751
|
let n = e.style.verticalAlign, r = n === "center" ? Math.floor(t / 2) : n === "end" ? t : 0;
|
|
2708
2752
|
if (!e.children.some((e) => !B(e.style) && !e.inlineBox)) {
|
|
@@ -2711,14 +2755,14 @@ function _n(e, t) {
|
|
|
2711
2755
|
}
|
|
2712
2756
|
if (!(r <= 0)) for (let t of e.children) t.inlineBox || (B(t.style) ? t.staticSlot?.kind === "block" && (t.staticSlot.y += r) : t.localRect.y += r);
|
|
2713
2757
|
}
|
|
2714
|
-
function
|
|
2758
|
+
function Sn(e, t, n, r, i, a, o, s, c) {
|
|
2715
2759
|
let l = t.columnCount, u = t.rows.length, d = [], f = (t) => t < l ? i[t] - e.vLines[t] : i[l - 1] + n[l - 1], p = (t) => t < u ? a[t] - e.hLines[t] : a[u - 1] + r[u - 1];
|
|
2716
2760
|
for (let t = 0; t <= l; t++) {
|
|
2717
2761
|
let n = e.vSegments[t];
|
|
2718
2762
|
for (let e = 0; e < u; e++) {
|
|
2719
2763
|
let i = n[e];
|
|
2720
2764
|
if (!i) continue;
|
|
2721
|
-
let l =
|
|
2765
|
+
let l = pe(i.style, "v", c);
|
|
2722
2766
|
for (let n = 0; n < i.width; n++) for (let c = a[e]; c < a[e] + r[e]; c++) d.push({
|
|
2723
2767
|
glyph: l,
|
|
2724
2768
|
x: o + f(t) + n,
|
|
@@ -2733,7 +2777,7 @@ function vn(e, t, n, r, i, a, o, s, c) {
|
|
|
2733
2777
|
for (let e = 0; e < l; e++) {
|
|
2734
2778
|
let a = r[e];
|
|
2735
2779
|
if (!a) continue;
|
|
2736
|
-
let l =
|
|
2780
|
+
let l = pe(a.style, "h", c);
|
|
2737
2781
|
for (let r = 0; r < a.width; r++) d.push({
|
|
2738
2782
|
glyph: l,
|
|
2739
2783
|
x: o + i[e],
|
|
@@ -2752,7 +2796,7 @@ function vn(e, t, n, r, i, a, o, s, c) {
|
|
|
2752
2796
|
m
|
|
2753
2797
|
].filter((e) => e !== null);
|
|
2754
2798
|
if (h.length === 0) continue;
|
|
2755
|
-
let g = h.every((e) => e.style === "double") ? "double" : "solid", _ = h.reduce((e, t) => t.width > e.width || t.width === e.width &&
|
|
2799
|
+
let g = h.every((e) => e.style === "double") ? "double" : "solid", _ = h.reduce((e, t) => t.width > e.width || t.width === e.width && dn[t.style] > dn[e.style] ? t : e), v = me(g, r !== null, i !== null, a !== null, m !== null, c);
|
|
2756
2800
|
for (let r = 0; r < e.vLines[t]; r++) for (let i = 0; i < e.hLines[n]; i++) d.push({
|
|
2757
2801
|
glyph: v,
|
|
2758
2802
|
x: o + f(t) + r,
|
|
@@ -2765,30 +2809,30 @@ function vn(e, t, n, r, i, a, o, s, c) {
|
|
|
2765
2809
|
}
|
|
2766
2810
|
//#endregion
|
|
2767
2811
|
//#region src/positioning.ts
|
|
2768
|
-
function
|
|
2812
|
+
function Cn(e) {
|
|
2769
2813
|
return e.position === "absolute" || e.position === "fixed" ? "absolute" : e.position === "relative" || e.position === "sticky" ? "relative" : "static";
|
|
2770
2814
|
}
|
|
2771
|
-
function
|
|
2815
|
+
function wn(e, t, n, r, i) {
|
|
2772
2816
|
for (let a of e.children) {
|
|
2773
|
-
let o =
|
|
2817
|
+
let o = Cn(a.style);
|
|
2774
2818
|
if (o === "relative") {
|
|
2775
2819
|
let t = e.localRect.width - e.style.border.left - e.style.border.right - e.resolvedPadding.left - e.resolvedPadding.right, n = e.localRect.height - e.style.border.top - e.style.border.bottom - e.resolvedPadding.top - e.resolvedPadding.bottom;
|
|
2776
|
-
a.localRect.x +=
|
|
2777
|
-
} else o === "absolute" &&
|
|
2778
|
-
|
|
2820
|
+
a.localRect.x += Tn(a.style.insets.left, a.style.insets.right, t), a.localRect.y += Tn(a.style.insets.top, a.style.insets.bottom, n);
|
|
2821
|
+
} else o === "absolute" && Dn(a, e, t, n, r, i);
|
|
2822
|
+
wn(a, t + a.localRect.x, n + a.localRect.y, [...r, {
|
|
2779
2823
|
node: a,
|
|
2780
2824
|
absX: t + a.localRect.x,
|
|
2781
2825
|
absY: n + a.localRect.y
|
|
2782
2826
|
}], i);
|
|
2783
2827
|
}
|
|
2784
2828
|
}
|
|
2785
|
-
function
|
|
2829
|
+
function Tn(e, t, n) {
|
|
2786
2830
|
return e === null ? t === null ? 0 : -W(t, n) : W(e, n);
|
|
2787
2831
|
}
|
|
2788
|
-
function
|
|
2832
|
+
function En(e, t) {
|
|
2789
2833
|
if (!t) for (let t = e.length - 1; t > 0; t--) {
|
|
2790
2834
|
let n = e[t];
|
|
2791
|
-
if (!
|
|
2835
|
+
if (!Fn(n.node.style)) continue;
|
|
2792
2836
|
let r = n.node.style.border;
|
|
2793
2837
|
return {
|
|
2794
2838
|
x: n.absX + r.left,
|
|
@@ -2805,13 +2849,13 @@ function Sn(e, t) {
|
|
|
2805
2849
|
height: n.node.localRect.height
|
|
2806
2850
|
};
|
|
2807
2851
|
}
|
|
2808
|
-
function
|
|
2809
|
-
let o = e.style, s = o.position === "fixed", c = e.staticSlot, l = c?.kind === "grid" && !s &&
|
|
2852
|
+
function Dn(e, t, n, r, i, a) {
|
|
2853
|
+
let o = e.style, s = o.position === "fixed", c = e.staticSlot, l = c?.kind === "grid" && !s && Fn(t.style) ? {
|
|
2810
2854
|
x: n + c.area.x,
|
|
2811
2855
|
y: r + c.area.y,
|
|
2812
2856
|
width: c.area.width,
|
|
2813
2857
|
height: c.area.height
|
|
2814
|
-
} :
|
|
2858
|
+
} : En(i, s), u = o.insets.left === null ? null : W(o.insets.left, l.width), d = o.insets.right === null ? null : W(o.insets.right, l.width), f = o.insets.top === null ? null : W(o.insets.top, l.height), p = o.insets.bottom === null ? null : W(o.insets.bottom, l.height), m = G(o.margin, l.width), h = m.left ?? 0, g = m.right ?? 0, _ = m.top ?? 0, v = m.bottom ?? 0, y = o.width === void 0 || o.width.kind === "auto", b = o.height === void 0 || o.height.kind === "auto", x = Wn(o.minWidth, l.width, e, a) ?? 0, S = Wn(o.maxWidth, l.width, e, a), C = {};
|
|
2815
2859
|
if (!y) C.width = H(q(o.width, l.width, e, a), x, S);
|
|
2816
2860
|
else if (u !== null && d !== null) C.width = H(Math.max(0, l.width - u - d - h - g), x, S);
|
|
2817
2861
|
else {
|
|
@@ -2823,25 +2867,25 @@ function Cn(e, t, n, r, i, a) {
|
|
|
2823
2867
|
if (u !== null && d !== null) {
|
|
2824
2868
|
let e = Math.max(0, l.width - u - d - w - h - g), t = m.left === null && m.right === null;
|
|
2825
2869
|
E = l.x + u + h + (t ? Math.floor(e / 2) : m.left === null ? e : 0);
|
|
2826
|
-
} else E = u === null ? d === null ?
|
|
2870
|
+
} else E = u === null ? d === null ? Mn(e, t, n, w) : l.x + l.width - d - w - g : l.x + u + h;
|
|
2827
2871
|
let D;
|
|
2828
2872
|
if (f !== null && p !== null) {
|
|
2829
2873
|
let e = Math.max(0, l.height - f - p - T - _ - v), t = m.top === null && m.bottom === null;
|
|
2830
2874
|
D = l.y + f + _ + (t ? Math.floor(e / 2) : m.top === null ? e : 0);
|
|
2831
|
-
} else D = f === null ? p === null ?
|
|
2875
|
+
} else D = f === null ? p === null ? Nn(e, t, r, T) : l.y + l.height - p - T - v : l.y + f + _;
|
|
2832
2876
|
e.localRect = {
|
|
2833
2877
|
...e.localRect,
|
|
2834
2878
|
x: E - n,
|
|
2835
2879
|
y: D - r
|
|
2836
2880
|
};
|
|
2837
2881
|
}
|
|
2838
|
-
function
|
|
2882
|
+
function On(e, t, n) {
|
|
2839
2883
|
return L(e, [n], Math.max(0, t - n))[0];
|
|
2840
2884
|
}
|
|
2841
|
-
function
|
|
2842
|
-
return
|
|
2885
|
+
function kn(e, t, n, r) {
|
|
2886
|
+
return z(Je(e, t), n, r);
|
|
2843
2887
|
}
|
|
2844
|
-
function
|
|
2888
|
+
function An(e, t, n, r, i) {
|
|
2845
2889
|
let a = G(e.style.margin, n.innerWidth), [o, s, c, l] = r === "x" ? [
|
|
2846
2890
|
a.left ?? 0,
|
|
2847
2891
|
a.right ?? 0,
|
|
@@ -2853,9 +2897,9 @@ function En(e, t, n, r, i) {
|
|
|
2853
2897
|
n.innerHeight,
|
|
2854
2898
|
n.direction === "column"
|
|
2855
2899
|
], u = i + o + s;
|
|
2856
|
-
return (l ?
|
|
2900
|
+
return (l ? On(Qe(t.style), c, u) : kn(e, t, c, u)) + o;
|
|
2857
2901
|
}
|
|
2858
|
-
function
|
|
2902
|
+
function jn(e, t, n, r, i) {
|
|
2859
2903
|
let a = G(e.style.margin, n.width), o = e.style.justifySelf === "auto" ? t.style.justifyItems : e.style.justifySelf, [s, c, l, u] = r === "x" ? [
|
|
2860
2904
|
a.left ?? 0,
|
|
2861
2905
|
a.right ?? 0,
|
|
@@ -2865,35 +2909,37 @@ function Dn(e, t, n, r, i) {
|
|
|
2865
2909
|
a.top ?? 0,
|
|
2866
2910
|
a.bottom ?? 0,
|
|
2867
2911
|
n.height,
|
|
2868
|
-
|
|
2912
|
+
Je(e, t)
|
|
2869
2913
|
];
|
|
2870
|
-
return
|
|
2914
|
+
return z(u, l, i + s + c) + s;
|
|
2871
2915
|
}
|
|
2872
|
-
function
|
|
2916
|
+
function Mn(e, t, n, r) {
|
|
2873
2917
|
let i = e.staticSlot;
|
|
2874
|
-
return i === void 0 ? n : i.kind === "block" ? n + i.x : i.kind === "grid" ? n + i.staticArea.x +
|
|
2918
|
+
return i === void 0 ? n : i.kind === "block" ? n + i.x : i.kind === "grid" ? n + i.staticArea.x + jn(e, t, i.staticArea, "x", r) : n + i.originX + An(e, t, i, "x", r);
|
|
2875
2919
|
}
|
|
2876
|
-
function
|
|
2920
|
+
function Nn(e, t, n, r) {
|
|
2877
2921
|
let i = e.staticSlot;
|
|
2878
|
-
return i === void 0 ? n : i.kind === "block" ? n + i.y : i.kind === "grid" ? n + i.staticArea.y +
|
|
2922
|
+
return i === void 0 ? n : i.kind === "block" ? n + i.y : i.kind === "grid" ? n + i.staticArea.y + jn(e, t, i.staticArea, "y", r) : n + i.originY + An(e, t, i, "y", r);
|
|
2879
2923
|
}
|
|
2880
2924
|
//#endregion
|
|
2881
2925
|
//#region src/layout.ts
|
|
2882
|
-
function
|
|
2883
|
-
let n =
|
|
2884
|
-
|
|
2926
|
+
function Pn(e, t) {
|
|
2927
|
+
let n = In();
|
|
2928
|
+
V(e, t, void 0, 0, 0, "fill", n), wn(e, 0, 0, [{
|
|
2885
2929
|
node: e,
|
|
2886
2930
|
absX: 0,
|
|
2887
2931
|
absY: 0
|
|
2888
|
-
}], n)
|
|
2932
|
+
}], n);
|
|
2933
|
+
let r = e.localRect.height, i = Yn(e);
|
|
2934
|
+
return e.localRect.width = Math.max(e.localRect.width, i.x), e.localRect.height = Math.max(r, i.y), { height: r };
|
|
2889
2935
|
}
|
|
2890
2936
|
function B(e) {
|
|
2891
2937
|
return e.position === "absolute" || e.position === "fixed";
|
|
2892
2938
|
}
|
|
2893
|
-
function
|
|
2939
|
+
function Fn(e) {
|
|
2894
2940
|
return e.position !== "static";
|
|
2895
2941
|
}
|
|
2896
|
-
function
|
|
2942
|
+
function In() {
|
|
2897
2943
|
return {
|
|
2898
2944
|
maxContent: /* @__PURE__ */ new WeakMap(),
|
|
2899
2945
|
minContent: /* @__PURE__ */ new WeakMap(),
|
|
@@ -2903,54 +2949,86 @@ function Mn() {
|
|
|
2903
2949
|
}
|
|
2904
2950
|
function V(e, t, n, r, i, a, o, s) {
|
|
2905
2951
|
let c = e.style, l = s?.height;
|
|
2906
|
-
delete e.decorationRuns, delete e.multicolGeometry, delete e.multicolFlow, delete e.multicolFlowSpan;
|
|
2907
|
-
let u =
|
|
2952
|
+
delete e.decorationRuns, delete e.multicolGeometry, delete e.multicolFlow, delete e.multicolFlowSpan, delete e.textExtent;
|
|
2953
|
+
let u = Wn(c.minWidth, t, e, o) ?? 0, d = Wn(c.maxWidth, t, e, o), f = K(c.minHeight, n) ?? 0, p = K(c.maxHeight, n), m = tt(c);
|
|
2954
|
+
s?.gutter?.right && (m.right = c.scrollbarSize.y), s?.gutter?.bottom && (m.bottom = c.scrollbarSize.x);
|
|
2955
|
+
let h = {
|
|
2908
2956
|
top: W(c.padding.top, t),
|
|
2909
|
-
right: W(c.padding.right, t),
|
|
2910
|
-
bottom: W(c.padding.bottom, t),
|
|
2957
|
+
right: W(c.padding.right, t) + m.right,
|
|
2958
|
+
bottom: W(c.padding.bottom, t) + m.bottom,
|
|
2911
2959
|
left: W(c.padding.left, t)
|
|
2912
2960
|
};
|
|
2913
|
-
e.resolvedPadding =
|
|
2914
|
-
let
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2961
|
+
e.resolvedPadding = h;
|
|
2962
|
+
let g = s?.width ?? H(Jn(c, t, a, e, o), u, d), _ = Qn(c, n), v = tr(g, l ?? _ ?? (f > 0 ? f : void 0) ?? Infinity, c.border, h), y = l !== void 0 || _ !== void 0, b = p === void 0 ? void 0 : Math.max(0, p - c.border.top - c.border.bottom - h.top - h.bottom), x = Rn(e), S = (t, n) => {
|
|
2963
|
+
let r = n && Number.isFinite(t) ? t : void 0;
|
|
2964
|
+
return x ? Ln(e, v.width, t, r, b, h, o) : c.display === "flex" && c.flexDirection === "row" ? He(e, v.width, t, r, c.border, h, o) : c.display === "flex" ? We(e, v.width, t, n, c.border, h, o) : c.display === "grid" ? at(e, v.width, t, c.border, h, o) : c.display === "table" ? bn(e, v.width, r, c.border, h, o) : c.display === "multicol" ? Qt(e, v.width, r, b, c.border, h, o) : Gn(e, v.width, r, c.border, h, o);
|
|
2965
|
+
}, C = S(v.height, y);
|
|
2966
|
+
!x && (c.display === "flex" || c.display === "grid") && !y && b !== void 0 && C > b && (C = S(b, !0));
|
|
2967
|
+
let w = C + c.border.top + c.border.bottom + h.top + h.bottom, T = l ?? _ ?? w;
|
|
2968
|
+
e.unclampedHeight = T, e.naturalContentHeight = w;
|
|
2969
|
+
let E = H(T, f, p), D = e.multicolGeometry;
|
|
2970
|
+
if (D) {
|
|
2971
|
+
let t = E - c.border.top - c.border.bottom - h.top - h.bottom;
|
|
2972
|
+
t > D.totalRows && (h.bottom += t - D.totalRows), Yt(e, D, c.border, h);
|
|
2973
|
+
}
|
|
2974
|
+
if (e.localRect = {
|
|
2924
2975
|
x: r,
|
|
2925
2976
|
y: i,
|
|
2926
|
-
width:
|
|
2927
|
-
height:
|
|
2928
|
-
}
|
|
2977
|
+
width: g,
|
|
2978
|
+
height: E
|
|
2979
|
+
}, et(c.overflow.x) || et(c.overflow.y)) {
|
|
2980
|
+
let l = Yn(e), u = Math.max(0, l.x - c.border.left - h.left), d = Math.max(0, l.y - c.border.top - h.top), f = Math.max(0, g - c.border.left - c.border.right - h.left - h.right), p = Math.max(0, E - c.border.top - c.border.bottom - h.top - h.bottom);
|
|
2981
|
+
if (e.scrollRange = {
|
|
2982
|
+
sizeX: u,
|
|
2983
|
+
sizeY: d,
|
|
2984
|
+
maxX: et(c.overflow.x) ? Math.max(0, u - f) : 0,
|
|
2985
|
+
maxY: et(c.overflow.y) ? Math.max(0, d - p) : 0
|
|
2986
|
+
}, !s?.gutter && c.scrollbarWidth !== "none") {
|
|
2987
|
+
let l = c.overflow.y === "auto" && e.scrollRange.maxY > 0, u = c.overflow.x === "auto" && e.scrollRange.maxX > 0;
|
|
2988
|
+
if (l || u) {
|
|
2989
|
+
V(e, t, n, r, i, a, o, {
|
|
2990
|
+
...s,
|
|
2991
|
+
gutter: {
|
|
2992
|
+
right: l,
|
|
2993
|
+
bottom: u
|
|
2994
|
+
}
|
|
2995
|
+
});
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
e.scrollGutterCells = {
|
|
3000
|
+
right: m.right,
|
|
3001
|
+
bottom: m.bottom
|
|
3002
|
+
};
|
|
3003
|
+
} else delete e.scrollRange, delete e.scrollGutterCells;
|
|
2929
3004
|
}
|
|
2930
|
-
function
|
|
3005
|
+
function Ln(e, t, n, r, i, a, o) {
|
|
2931
3006
|
let s = e.style, c;
|
|
2932
3007
|
if (e.text) {
|
|
2933
3008
|
let l = e.children.filter((e) => e.inlineBox);
|
|
2934
|
-
|
|
3009
|
+
Pe(e.text, (n, r) => {
|
|
2935
3010
|
let i = l[r];
|
|
2936
3011
|
V(i, t, void 0, 0, 0, "shrink", o), e.advances[n] = Math.max(1, i.localRect.width);
|
|
2937
3012
|
});
|
|
2938
3013
|
let u, d;
|
|
2939
3014
|
if (s.display === "multicol") {
|
|
2940
|
-
let n = U(s, "x", t), o =
|
|
3015
|
+
let n = U(s, "x", t), o = Vt(s, t, n);
|
|
2941
3016
|
a.right += o.leftover;
|
|
2942
|
-
let c =
|
|
3017
|
+
let c = Ut(e, o, n, zt(r, i));
|
|
2943
3018
|
e.multicolGeometry = c, u = c, d = c.lineX;
|
|
2944
|
-
} else u =
|
|
2945
|
-
if (c = u.totalRows,
|
|
3019
|
+
} else u = Bn(e, t);
|
|
3020
|
+
if (c = u.totalRows, e.textExtent = {
|
|
3021
|
+
width: u.spans.reduce((t, n) => Math.max(t, I(n.start, n.end, e.advances, s.tracking)), 0),
|
|
3022
|
+
rows: u.totalRows
|
|
3023
|
+
}, zn(e, u, t, n, a), l.length > 0) {
|
|
2946
3024
|
let t = (e) => u.spans.findIndex((t) => e >= t.start && e < t.end);
|
|
2947
|
-
|
|
3025
|
+
Pe(e.text, (n, r) => {
|
|
2948
3026
|
let i = t(n);
|
|
2949
3027
|
if (i === -1) return;
|
|
2950
3028
|
let o = u.spans[i];
|
|
2951
3029
|
l[r].localRect = {
|
|
2952
3030
|
...l[r].localRect,
|
|
2953
|
-
x: s.border.left + a.left + (d?.[i] ?? 0) +
|
|
3031
|
+
x: s.border.left + a.left + (d?.[i] ?? 0) + je(o.start, n, e.advances),
|
|
2954
3032
|
y: s.border.top + a.top + u.lineY[i]
|
|
2955
3033
|
};
|
|
2956
3034
|
});
|
|
@@ -2967,30 +3045,30 @@ function Nn(e, t, n, r, i, a, o) {
|
|
|
2967
3045
|
}
|
|
2968
3046
|
return c;
|
|
2969
3047
|
}
|
|
2970
|
-
function
|
|
3048
|
+
function Rn(e) {
|
|
2971
3049
|
return e.children.some((e) => !B(e.style) && !e.inlineBox) ? !1 : e.text !== "" || e.style.display !== "flex" && e.style.display !== "grid";
|
|
2972
3050
|
}
|
|
2973
3051
|
function H(e, t, n) {
|
|
2974
3052
|
return Math.max(t, n === void 0 ? e : Math.min(e, n));
|
|
2975
3053
|
}
|
|
2976
|
-
function
|
|
3054
|
+
function zn(e, t, n, r, i) {
|
|
2977
3055
|
let a = e.style;
|
|
2978
3056
|
if (a.display !== "flex" && a.display !== "grid" || t.spans.length === 0) return;
|
|
2979
3057
|
let o = a.display === "flex" && a.flexDirection === "column", s = t.spans.reduce((t, n) => Math.max(t, I(n.start, n.end, e.advances, a.tracking)), 0), c = Math.max(0, n - s);
|
|
2980
3058
|
if (c > 0) {
|
|
2981
|
-
let e = a.display === "grid" ?
|
|
3059
|
+
let e = a.display === "grid" ? z(a.justifyItems, n, s) : o ? z(a.alignItems, n, s) : L(Qe(a), [s], c)[0];
|
|
2982
3060
|
e > 0 && (i.left += e, i.right += c - e);
|
|
2983
3061
|
}
|
|
2984
3062
|
if (Number.isFinite(r)) {
|
|
2985
3063
|
let e = Math.max(0, r - t.totalRows);
|
|
2986
3064
|
if (e > 0) {
|
|
2987
|
-
let n = a.display === "grid" || !o ?
|
|
3065
|
+
let n = a.display === "grid" || !o ? z(a.alignItems, r, t.totalRows) : L(Qe(a), [t.totalRows], e)[0];
|
|
2988
3066
|
n > 0 && (i.top += n, i.bottom += e - n);
|
|
2989
3067
|
}
|
|
2990
3068
|
}
|
|
2991
3069
|
}
|
|
2992
|
-
function
|
|
2993
|
-
let n =
|
|
3070
|
+
function Bn(e, t) {
|
|
3071
|
+
let n = Vn(e, t), { heights: r, textOffsets: i } = Hn(e, n), a = [], o = [], s = 0;
|
|
2994
3072
|
for (let t = 0; t < n.length; t++) a.push(s), o.push(s + i[t]), s += r[t] + (t < n.length - 1 ? e.style.lineGap : 0);
|
|
2995
3073
|
return {
|
|
2996
3074
|
spans: n,
|
|
@@ -2999,21 +3077,21 @@ function In(e, t) {
|
|
|
2999
3077
|
totalRows: s
|
|
3000
3078
|
};
|
|
3001
3079
|
}
|
|
3002
|
-
function
|
|
3003
|
-
return e.style.whiteSpace === "normal" ?
|
|
3080
|
+
function Vn(e, t) {
|
|
3081
|
+
return e.style.whiteSpace === "normal" ? Ae(e.text, t, {
|
|
3004
3082
|
advances: e.advances,
|
|
3005
3083
|
tracking: e.style.tracking,
|
|
3006
3084
|
firstLineIndent: e.style.textIndent
|
|
3007
|
-
}) :
|
|
3085
|
+
}) : ke(e.text);
|
|
3008
3086
|
}
|
|
3009
|
-
function
|
|
3087
|
+
function Hn(e, t) {
|
|
3010
3088
|
let n = e.children.filter((e) => e.inlineBox), r = [], i = [], a = 0;
|
|
3011
3089
|
for (let o of t) {
|
|
3012
3090
|
let t = 1, s = 0;
|
|
3013
3091
|
for (let r = o.start; r < o.end; r++) {
|
|
3014
3092
|
if (e.text[r] !== "") continue;
|
|
3015
3093
|
let i = n[a];
|
|
3016
|
-
t = Math.max(t, i.localRect.height), i.style.verticalAlign === "end" ? s = Math.max(s, i.localRect.height - 1) : i.style.verticalAlign === "center" &&
|
|
3094
|
+
t = Math.max(t, i.localRect.height), i.style.verticalAlign === "end" ? s = Math.max(s, i.localRect.height - 1) : i.style.verticalAlign === "center" && N(i.source, "vertical-align: middle on an inline box can't land on whole rows and behaves as top. Use align-top or align-bottom."), a++;
|
|
3017
3095
|
}
|
|
3018
3096
|
r.push(t), i.push(Math.min(s, t - 1));
|
|
3019
3097
|
}
|
|
@@ -3027,7 +3105,7 @@ function U(e, t, n) {
|
|
|
3027
3105
|
return Math.max(r, i?.width ?? 0);
|
|
3028
3106
|
}
|
|
3029
3107
|
function W(e, t) {
|
|
3030
|
-
return typeof e == "number" ? e : t === void 0 || !Number.isFinite(t) ? 0 :
|
|
3108
|
+
return typeof e == "number" ? e : t === void 0 || !Number.isFinite(t) ? 0 : Ce(e.percent, t);
|
|
3031
3109
|
}
|
|
3032
3110
|
function G(e, t) {
|
|
3033
3111
|
let n = (e) => e === null ? null : W(e, t);
|
|
@@ -3038,16 +3116,16 @@ function G(e, t) {
|
|
|
3038
3116
|
left: n(e.left)
|
|
3039
3117
|
};
|
|
3040
3118
|
}
|
|
3041
|
-
function
|
|
3119
|
+
function Un(e) {
|
|
3042
3120
|
return typeof e == "number" ? e : 0;
|
|
3043
3121
|
}
|
|
3044
3122
|
function K(e, t) {
|
|
3045
|
-
if (e !== void 0 && typeof e != "string") return typeof e == "number" ? e : t === void 0 ? void 0 :
|
|
3123
|
+
if (e !== void 0 && typeof e != "string") return typeof e == "number" ? e : t === void 0 ? void 0 : Ce(e.percent, t);
|
|
3046
3124
|
}
|
|
3047
|
-
function
|
|
3125
|
+
function Wn(e, t, n, r) {
|
|
3048
3126
|
return e === "min-content" || e === "max-content" || e === "fit-content" ? q({ kind: e }, t, n, r) : K(e, t);
|
|
3049
3127
|
}
|
|
3050
|
-
function
|
|
3128
|
+
function Gn(e, t, n, r, i, a) {
|
|
3051
3129
|
let o = r.left + i.left, s = r.top + i.top, c = s, l = null;
|
|
3052
3130
|
for (let r of e.children) {
|
|
3053
3131
|
let e = G(r.style.margin, t), i = e.top ?? 0, s = e.bottom ?? 0, u = e.left ?? 0, d = e.right ?? 0;
|
|
@@ -3055,13 +3133,13 @@ function Vn(e, t, n, r, i, a) {
|
|
|
3055
3133
|
r.staticSlot = {
|
|
3056
3134
|
kind: "block",
|
|
3057
3135
|
x: o + u,
|
|
3058
|
-
y: c + (l === null ? i :
|
|
3136
|
+
y: c + (l === null ? i : qn(l, i))
|
|
3059
3137
|
};
|
|
3060
3138
|
continue;
|
|
3061
3139
|
}
|
|
3062
3140
|
V(r, Math.max(0, t - u - d), n, 0, 0, "fill", a);
|
|
3063
|
-
let f =
|
|
3064
|
-
c += l === null ? i :
|
|
3141
|
+
let f = Kn(e, t, r.localRect.width);
|
|
3142
|
+
c += l === null ? i : qn(l, i), r.localRect = {
|
|
3065
3143
|
...r.localRect,
|
|
3066
3144
|
x: o + f,
|
|
3067
3145
|
y: c
|
|
@@ -3069,37 +3147,65 @@ function Vn(e, t, n, r, i, a) {
|
|
|
3069
3147
|
}
|
|
3070
3148
|
return l !== null && (c += l), c - s;
|
|
3071
3149
|
}
|
|
3072
|
-
function
|
|
3150
|
+
function Kn(e, t, n) {
|
|
3073
3151
|
let r = t - n;
|
|
3074
3152
|
return e.left === null && e.right === null ? Math.floor(r / 2) : e.left === null ? r - (e.right ?? 0) : e.left;
|
|
3075
3153
|
}
|
|
3076
|
-
function
|
|
3154
|
+
function qn(e, t) {
|
|
3077
3155
|
return e >= 0 && t >= 0 ? Math.max(e, t) : e <= 0 && t <= 0 ? Math.min(e, t) : e + t;
|
|
3078
3156
|
}
|
|
3079
|
-
function
|
|
3157
|
+
function Jn(e, t, n, r, i) {
|
|
3080
3158
|
let a = e.width;
|
|
3081
3159
|
if (e.display === "table") {
|
|
3082
3160
|
if (!r.children.some((e) => !B(e.style) && !e.inlineBox)) return a !== void 0 && a.kind !== "auto" ? q(a, t, r, i) : Math.min(t, J(r, i));
|
|
3083
3161
|
if (a !== void 0 && a.kind !== "auto") {
|
|
3084
3162
|
let e = q(a, t, r, i);
|
|
3085
|
-
return Math.max(e,
|
|
3163
|
+
return Math.max(e, Zn(r, t, i));
|
|
3086
3164
|
}
|
|
3087
|
-
return
|
|
3165
|
+
return yn(r, t, i);
|
|
3088
3166
|
}
|
|
3089
3167
|
return a !== void 0 && a.kind !== "auto" ? q(a, t, r, i) : n === "shrink" ? Math.min(t, J(r, i)) : t;
|
|
3090
3168
|
}
|
|
3091
|
-
function
|
|
3169
|
+
function Yn(e) {
|
|
3170
|
+
let t = 0, n = 0;
|
|
3171
|
+
for (let r of e.children) {
|
|
3172
|
+
if (r.style.position === "fixed") continue;
|
|
3173
|
+
let e = Xn(r);
|
|
3174
|
+
t = Math.max(t, r.localRect.x + e.x), n = Math.max(n, r.localRect.y + e.y);
|
|
3175
|
+
}
|
|
3176
|
+
if (e.textExtent) {
|
|
3177
|
+
let { border: r } = e.style, i = e.resolvedPadding;
|
|
3178
|
+
t = Math.max(t, r.left + i.left + e.textExtent.width), n = Math.max(n, r.top + i.top + e.textExtent.rows);
|
|
3179
|
+
}
|
|
3180
|
+
return {
|
|
3181
|
+
x: t,
|
|
3182
|
+
y: n
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3185
|
+
function Xn(e) {
|
|
3186
|
+
let { width: t, height: n } = e.localRect, r = e.style.overflow.x !== "visible", i = e.style.overflow.y !== "visible";
|
|
3187
|
+
if (r && i) return {
|
|
3188
|
+
x: t,
|
|
3189
|
+
y: n
|
|
3190
|
+
};
|
|
3191
|
+
let a = Yn(e);
|
|
3192
|
+
return {
|
|
3193
|
+
x: r ? t : Math.max(t, a.x),
|
|
3194
|
+
y: i ? n : Math.max(n, a.y)
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
3197
|
+
function Zn(e, t, n) {
|
|
3092
3198
|
let r = e.style;
|
|
3093
|
-
return
|
|
3199
|
+
return vn(e, n).min + r.border.left + r.border.right + W(r.padding.left, t) + W(r.padding.right, t) + tt(r).right;
|
|
3094
3200
|
}
|
|
3095
|
-
function
|
|
3201
|
+
function Qn(e, t) {
|
|
3096
3202
|
if (e.height?.kind === "cells") return e.height.value;
|
|
3097
|
-
if (e.height?.kind === "percent" && t != null) return
|
|
3203
|
+
if (e.height?.kind === "percent" && t != null) return Ce(e.height.value, t);
|
|
3098
3204
|
}
|
|
3099
3205
|
function q(e, t, n, r) {
|
|
3100
3206
|
switch (e.kind) {
|
|
3101
3207
|
case "cells": return e.value;
|
|
3102
|
-
case "percent": return
|
|
3208
|
+
case "percent": return Ce(e.value, t);
|
|
3103
3209
|
case "min-content": return Y(n, r);
|
|
3104
3210
|
case "max-content": return J(n, r);
|
|
3105
3211
|
case "fit-content": return Math.min(J(n, r), Math.max(Y(n, r), t));
|
|
@@ -3109,42 +3215,42 @@ function q(e, t, n, r) {
|
|
|
3109
3215
|
function J(e, t) {
|
|
3110
3216
|
let n = t.maxContent.get(e);
|
|
3111
3217
|
if (n !== void 0) return n;
|
|
3112
|
-
let r = e.style, i =
|
|
3218
|
+
let r = e.style, i = $n(e, t) + r.border.left + r.border.right + Un(r.padding.left) + Un(r.padding.right) + tt(r).right;
|
|
3113
3219
|
return t.maxContent.set(e, i), i;
|
|
3114
3220
|
}
|
|
3115
|
-
function
|
|
3221
|
+
function $n(e, t) {
|
|
3116
3222
|
let n = e.children.filter((e) => !B(e.style) && !e.inlineBox);
|
|
3117
|
-
if (n.length === 0) return e.style.display === "multicol" ?
|
|
3118
|
-
if (e.style.display === "grid") return
|
|
3119
|
-
if (e.style.display === "table") return
|
|
3223
|
+
if (n.length === 0) return e.style.display === "multicol" ? Rt(e.style, e.intrinsicWidth) : e.intrinsicWidth;
|
|
3224
|
+
if (e.style.display === "grid") return mt(e, t).max;
|
|
3225
|
+
if (e.style.display === "table") return vn(e, t).max;
|
|
3120
3226
|
if (e.style.display === "flex" && e.style.flexDirection === "row") {
|
|
3121
|
-
let r = Math.max(
|
|
3227
|
+
let r = Math.max(Un(e.style.gapX), e.style.ruleX?.width ?? 0) * Math.max(0, n.length - 1);
|
|
3122
3228
|
return n.reduce((e, n) => e + J(n, t), 0) + r;
|
|
3123
3229
|
}
|
|
3124
3230
|
let r = n.reduce((e, n) => Math.max(e, J(n, t)), 0);
|
|
3125
|
-
return e.style.display === "multicol" ?
|
|
3231
|
+
return e.style.display === "multicol" ? Rt(e.style, r) : r;
|
|
3126
3232
|
}
|
|
3127
3233
|
function Y(e, t) {
|
|
3128
3234
|
let n = t.minContent.get(e);
|
|
3129
3235
|
if (n !== void 0) return n;
|
|
3130
|
-
let r = e.style, i =
|
|
3236
|
+
let r = e.style, i = er(e, t) + r.border.left + r.border.right + Un(r.padding.left) + Un(r.padding.right) + tt(r).right;
|
|
3131
3237
|
return t.minContent.set(e, i), i;
|
|
3132
3238
|
}
|
|
3133
|
-
function
|
|
3239
|
+
function er(e, t) {
|
|
3134
3240
|
let n = e.children.filter((e) => !B(e.style) && !e.inlineBox);
|
|
3135
|
-
if (n.length === 0) return !e.text || e.style.whiteSpace !== "normal" ? e.intrinsicWidth :
|
|
3241
|
+
if (n.length === 0) return !e.text || e.style.whiteSpace !== "normal" ? e.intrinsicWidth : Ne(e.text, {
|
|
3136
3242
|
advances: e.advances,
|
|
3137
3243
|
tracking: e.style.tracking
|
|
3138
3244
|
});
|
|
3139
|
-
if (e.style.display === "grid") return
|
|
3140
|
-
if (e.style.display === "table") return
|
|
3245
|
+
if (e.style.display === "grid") return mt(e, t).min;
|
|
3246
|
+
if (e.style.display === "table") return vn(e, t).min;
|
|
3141
3247
|
if (e.style.display === "flex" && e.style.flexDirection === "row" && e.style.flexWrap === "nowrap") {
|
|
3142
|
-
let r = Math.max(
|
|
3248
|
+
let r = Math.max(Un(e.style.gapX), e.style.ruleX?.width ?? 0) * Math.max(0, n.length - 1);
|
|
3143
3249
|
return n.reduce((e, n) => e + Y(n, t), 0) + r;
|
|
3144
3250
|
}
|
|
3145
3251
|
return n.reduce((e, n) => Math.max(e, Y(n, t)), 0);
|
|
3146
3252
|
}
|
|
3147
|
-
function
|
|
3253
|
+
function tr(e, t, n, r) {
|
|
3148
3254
|
return {
|
|
3149
3255
|
width: Math.max(0, e - n.left - n.right - r.left - r.right),
|
|
3150
3256
|
height: Math.max(0, t - n.top - n.bottom - r.top - r.bottom)
|
|
@@ -3152,38 +3258,38 @@ function Yn(e, t, n, r) {
|
|
|
3152
3258
|
}
|
|
3153
3259
|
//#endregion
|
|
3154
3260
|
//#region src/plain-text.ts
|
|
3155
|
-
function
|
|
3156
|
-
return
|
|
3261
|
+
function nr(e) {
|
|
3262
|
+
return cr(e).grid.map((e) => e.join("").trimEnd()).join("\n");
|
|
3157
3263
|
}
|
|
3158
|
-
function
|
|
3159
|
-
let { grid: t, paints: n } =
|
|
3160
|
-
return t.map((e, t) =>
|
|
3264
|
+
function rr(e) {
|
|
3265
|
+
let { grid: t, paints: n } = cr(e);
|
|
3266
|
+
return t.map((e, t) => ir(e, n[t]));
|
|
3161
3267
|
}
|
|
3162
|
-
function
|
|
3268
|
+
function ir(e, t) {
|
|
3163
3269
|
let n = e.length;
|
|
3164
3270
|
for (; n > 0 && e[n - 1] === " " && t[n - 1]?.backgroundColor === void 0;) n--;
|
|
3165
3271
|
let r = [];
|
|
3166
3272
|
for (let i = 0; i < n; i++) {
|
|
3167
3273
|
let n = t[i], a = r[r.length - 1];
|
|
3168
|
-
a &&
|
|
3274
|
+
a && ar(a, n) ? a.text += e[i] : r.push({
|
|
3169
3275
|
text: e[i],
|
|
3170
3276
|
...n
|
|
3171
3277
|
});
|
|
3172
3278
|
}
|
|
3173
3279
|
return r;
|
|
3174
3280
|
}
|
|
3175
|
-
function
|
|
3281
|
+
function ar(e, t) {
|
|
3176
3282
|
return e.color === t?.color && e.backgroundColor === t?.backgroundColor && e.fontWeight === t?.fontWeight && e.fontStyle === t?.fontStyle && e.textDecorationLine === t?.textDecorationLine && e.opacity === t?.opacity;
|
|
3177
3283
|
}
|
|
3178
|
-
function
|
|
3284
|
+
function or(e, t) {
|
|
3179
3285
|
e.color !== void 0 && (t.color = e.color), e.backgroundColor !== void 0 && (t.backgroundColor = e.backgroundColor), e.fontWeight !== void 0 && (t.fontWeight = e.fontWeight), e.fontStyle !== void 0 && (t.fontStyle = e.fontStyle), e.textDecorationLine !== void 0 && (t.textDecoration = e.textDecorationLine), e.opacity !== void 0 && (t.opacity = e.opacity);
|
|
3180
3286
|
}
|
|
3181
|
-
function
|
|
3287
|
+
function sr(e) {
|
|
3182
3288
|
return e.color === void 0 && e.backgroundColor === void 0 && e.fontWeight === void 0 && e.fontStyle === void 0 && e.textDecorationLine === void 0 && e.opacity === void 0;
|
|
3183
3289
|
}
|
|
3184
|
-
function
|
|
3290
|
+
function cr(e) {
|
|
3185
3291
|
let t = Math.max(0, e.localRect.width), n = Math.max(0, e.localRect.height), r = Array.from({ length: n }, () => Array.from({ length: t }, () => " ")), i = Array.from({ length: n }, () => Array.from({ length: t }, () => void 0));
|
|
3186
|
-
return
|
|
3292
|
+
return ur(e, 0, 0, (e, a, o, s) => {
|
|
3187
3293
|
if (e >= 0 && e < t && a >= 0 && a < n) {
|
|
3188
3294
|
r[a][e] = o;
|
|
3189
3295
|
let t = i[a][e];
|
|
@@ -3197,22 +3303,22 @@ function nr(e) {
|
|
|
3197
3303
|
paints: i
|
|
3198
3304
|
};
|
|
3199
3305
|
}
|
|
3200
|
-
function
|
|
3306
|
+
function lr(e) {
|
|
3201
3307
|
let t = {};
|
|
3202
3308
|
return e.color && (t.color = e.color), e.backgroundColor && (t.backgroundColor = e.backgroundColor), e.fontWeight !== "400" && e.fontWeight !== "normal" && e.fontWeight !== "" && (t.fontWeight = e.fontWeight), e.fontStyle !== "normal" && e.fontStyle !== "" && (t.fontStyle = e.fontStyle), e.textDecorationLine !== "none" && e.textDecorationLine !== "" && (t.textDecorationLine = e.textDecorationLine), t;
|
|
3203
3309
|
}
|
|
3204
|
-
function
|
|
3310
|
+
function ur(e, t, n, r, i = 1) {
|
|
3205
3311
|
if (e.tableHidden) return;
|
|
3206
3312
|
let a = t + e.localRect.x, o = n + e.localRect.y, s = e.style, c = (e) => i >= 1 ? e : {
|
|
3207
3313
|
...e,
|
|
3208
3314
|
opacity: String(Math.round(i * 1e3) / 1e3)
|
|
3209
3315
|
};
|
|
3210
3316
|
if (s.backgroundColor !== void 0 || s.backgroundClear) {
|
|
3211
|
-
let t = s.backgroundColor === void 0 ? void 0 : c({ backgroundColor: s.backgroundColor });
|
|
3317
|
+
let t = s.backgroundColor === void 0 ? { backgroundColor: void 0 } : c({ backgroundColor: s.backgroundColor });
|
|
3212
3318
|
for (let n = 0; n < e.localRect.height; n++) for (let i = 0; i < e.localRect.width; i++) r(a + i, o + n, " ", t);
|
|
3213
3319
|
}
|
|
3214
3320
|
let l = [];
|
|
3215
|
-
|
|
3321
|
+
le(s, {
|
|
3216
3322
|
x: a,
|
|
3217
3323
|
y: o,
|
|
3218
3324
|
width: e.localRect.width,
|
|
@@ -3226,26 +3332,64 @@ function ir(e, t, n, r, i = 1) {
|
|
|
3226
3332
|
let e = c(t.color === void 0 ? void 0 : { color: t.color });
|
|
3227
3333
|
for (let n = 0; n < t.length; n++) r(a + t.x + n, o + t.y, t.glyph, e);
|
|
3228
3334
|
}
|
|
3335
|
+
let u = e.resolvedPadding, d = e.scrollGutterCells, f = s.overflow.x !== "visible", p = s.overflow.y !== "visible", m = a - (e.scroll?.x ?? 0), h = o - (e.scroll?.y ?? 0), g = r;
|
|
3336
|
+
if (f || p) {
|
|
3337
|
+
let t = a + s.border.left, n = o + s.border.top, i = a + e.localRect.width - s.border.right - (d?.right ?? 0), c = o + e.localRect.height - s.border.bottom - (d?.bottom ?? 0);
|
|
3338
|
+
g = (e, a, o, s) => {
|
|
3339
|
+
f && (e < t || e >= i) || p && (a < n || a >= c) || r(e, a, o, s);
|
|
3340
|
+
};
|
|
3341
|
+
}
|
|
3229
3342
|
if (!e.children.some((e) => !e.inlineBox && e.style.position !== "absolute" && e.style.position !== "fixed") && e.text) {
|
|
3230
|
-
let t =
|
|
3231
|
-
for (let
|
|
3232
|
-
let
|
|
3233
|
-
end:
|
|
3343
|
+
let t = m + s.border.left + u.left, n = h + s.border.top + u.top, r = e.localRect.width - s.border.left - s.border.right - u.left - u.right, i = e.multicolGeometry, { spans: a, textY: o } = i ?? Bn(e, r), l = i ? Math.max(1, i.columnWidth - s.tracking) : r, d = c(lr(s)), f = e.inlineElements?.map((e) => c(lr(e)));
|
|
3344
|
+
for (let r = 0; r < a.length; r++) {
|
|
3345
|
+
let u = a[r], p = n + o[r], m = r === 0 ? s.textIndent : 0, h = s.whiteSpace !== "normal" && s.overflow.x === "clip" ? fr(e.text, u, l - m, e.advances, s) : {
|
|
3346
|
+
end: u.end,
|
|
3234
3347
|
ellipsis: !1
|
|
3235
|
-
}, _ = I(
|
|
3236
|
-
for (let t =
|
|
3348
|
+
}, _ = I(u.start, u.end, e.advances, s.tracking), v = Math.max(0, l - m - _), y = s.textAlign === "end" ? v : s.textAlign === "center" ? Math.floor(v / 2) : 0, b = t + (i?.lineX[r] ?? 0) + y + m;
|
|
3349
|
+
for (let t = u.start; t < h.end; t++) {
|
|
3237
3350
|
if (e.text[t] !== "") {
|
|
3238
|
-
let n = e.charInline?.[t] ?? -1,
|
|
3239
|
-
e.text[t] === "" ?
|
|
3351
|
+
let n = e.charInline?.[t] ?? -1, r = n >= 0 ? e.inlineElements[n] : void 0, i = r?.insets, a = i ? i.left ?? (i.right === null ? 0 : -i.right) : 0, o = i ? i.top ?? (i.bottom === null ? 0 : -i.bottom) : 0;
|
|
3352
|
+
e.text[t] === "" ? r?.backgroundColor && g(b + a, p + o, " ", c({ backgroundColor: r.backgroundColor })) : g(b + a, p + o, e.text[t], r ? f[n] : d);
|
|
3353
|
+
}
|
|
3354
|
+
b += je(t, t + 1, e.advances);
|
|
3355
|
+
}
|
|
3356
|
+
h.ellipsis && g(b, p, "…", d);
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
for (let t of fe(e)) ur(t, m, h, g, i * t.style.opacity);
|
|
3360
|
+
let _ = e.scrollRange;
|
|
3361
|
+
if (_ && d && (d.right > 0 || d.bottom > 0)) {
|
|
3362
|
+
let { track: t, thumb: n } = j(S(s.glyphSet)), i = o + s.border.top, l = a + s.border.left, u = o + e.localRect.height - s.border.bottom, f = a + e.localRect.width - s.border.right, p = (e) => c(e ? { color: e } : void 0), m = p(s.scrollbarColor?.track ?? s.color), h = p(s.scrollbarColor?.thumb ?? s.color);
|
|
3363
|
+
if (d.right > 0) {
|
|
3364
|
+
let a = u - i - d.bottom, { at: o, len: s } = dr(a, _.sizeY, _.maxY, e.scroll?.y ?? 0);
|
|
3365
|
+
for (let e = 0; e < d.right; e++) {
|
|
3366
|
+
let c = f - d.right + e;
|
|
3367
|
+
for (let e = 0; e < a; e++) {
|
|
3368
|
+
let a = e >= o && e < o + s;
|
|
3369
|
+
r(c, i + e, a ? n : t, a ? h : m);
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
if (d.bottom > 0) {
|
|
3374
|
+
let i = f - l - d.right, { at: a, len: o } = dr(i, _.sizeX, _.maxX, e.scroll?.x ?? 0);
|
|
3375
|
+
for (let e = 0; e < d.bottom; e++) {
|
|
3376
|
+
let s = u - d.bottom + e;
|
|
3377
|
+
for (let e = 0; e < i; e++) {
|
|
3378
|
+
let i = e >= a && e < a + o;
|
|
3379
|
+
r(l + e, s, i ? n : t, i ? h : m);
|
|
3240
3380
|
}
|
|
3241
|
-
b += ke(t, t + 1, e.advances);
|
|
3242
3381
|
}
|
|
3243
|
-
g.ellipsis && r(b, o, "…", m);
|
|
3244
3382
|
}
|
|
3245
3383
|
}
|
|
3246
|
-
for (let t of de(e)) ir(t, a, o, r, i * t.style.opacity);
|
|
3247
3384
|
}
|
|
3248
|
-
function
|
|
3385
|
+
function dr(e, t, n, r) {
|
|
3386
|
+
let i = t > 0 ? Math.min(1, e / t) : 1, a = Math.max(1, Math.round(i * e));
|
|
3387
|
+
return n > 0 && (a = Math.max(1, Math.min(a, e - n))), {
|
|
3388
|
+
at: n > 0 ? Math.round(Math.min(r, n) / n * (e - a)) : 0,
|
|
3389
|
+
len: a
|
|
3390
|
+
};
|
|
3391
|
+
}
|
|
3392
|
+
function fr(e, t, n, r, i) {
|
|
3249
3393
|
let { textOverflow: a, tracking: o } = i;
|
|
3250
3394
|
if (I(t.start, t.end, r, o) <= n) return {
|
|
3251
3395
|
end: t.end,
|
|
@@ -3260,61 +3404,61 @@ function ar(e, t, n, r, i) {
|
|
|
3260
3404
|
}
|
|
3261
3405
|
//#endregion
|
|
3262
3406
|
//#region src/paint.ts
|
|
3263
|
-
var
|
|
3264
|
-
function
|
|
3265
|
-
return
|
|
3266
|
-
}
|
|
3267
|
-
function
|
|
3268
|
-
let r =
|
|
3269
|
-
if (
|
|
3270
|
-
let a =
|
|
3271
|
-
if (a &&
|
|
3272
|
-
|
|
3407
|
+
var pr = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap();
|
|
3408
|
+
function hr(e) {
|
|
3409
|
+
return vr(e, !0) !== null;
|
|
3410
|
+
}
|
|
3411
|
+
function gr(e, t, n = !1) {
|
|
3412
|
+
let r = rr(e), i = Cr(r);
|
|
3413
|
+
if (pr.get(t) === i) return !0;
|
|
3414
|
+
let a = mr.get(t);
|
|
3415
|
+
if (a && _r(t, a.nodes, r)) {
|
|
3416
|
+
pr.set(t, i);
|
|
3273
3417
|
for (let e = 0; e < r.length; e++) for (let t = 0; t < r[e].length; t++) {
|
|
3274
3418
|
let n = r[e][t];
|
|
3275
|
-
if (
|
|
3419
|
+
if (sr(n) || ar(n, a.segments[e][t])) continue;
|
|
3276
3420
|
let i = a.nodes[e][t];
|
|
3277
|
-
i.style.cssText = "",
|
|
3421
|
+
i.style.cssText = "", or(n, i.style);
|
|
3278
3422
|
}
|
|
3279
3423
|
return a.segments = r, !0;
|
|
3280
3424
|
}
|
|
3281
|
-
if (n &&
|
|
3282
|
-
|
|
3425
|
+
if (n && hr(t)) return !1;
|
|
3426
|
+
pr.set(t, i);
|
|
3283
3427
|
let o = document.createDocumentFragment(), s = [];
|
|
3284
3428
|
for (let e = 0; e < r.length; e++) {
|
|
3285
3429
|
e > 0 && o.appendChild(document.createTextNode("\n"));
|
|
3286
3430
|
let t = [];
|
|
3287
3431
|
for (let n of r[e]) {
|
|
3288
|
-
if (
|
|
3432
|
+
if (sr(n)) {
|
|
3289
3433
|
let e = document.createTextNode(n.text);
|
|
3290
3434
|
t.push(e), o.appendChild(e);
|
|
3291
3435
|
continue;
|
|
3292
3436
|
}
|
|
3293
3437
|
let e = document.createElement("span");
|
|
3294
|
-
|
|
3438
|
+
or(n, e.style), e.textContent = n.text, t.push(e), o.appendChild(e);
|
|
3295
3439
|
}
|
|
3296
3440
|
s.push(t);
|
|
3297
3441
|
}
|
|
3298
|
-
|
|
3442
|
+
mr.set(t, {
|
|
3299
3443
|
nodes: s,
|
|
3300
3444
|
segments: r
|
|
3301
3445
|
});
|
|
3302
|
-
let c =
|
|
3303
|
-
return t.replaceChildren(o), c &&
|
|
3446
|
+
let c = vr(t, !1);
|
|
3447
|
+
return t.replaceChildren(o), c && yr(t, c), !0;
|
|
3304
3448
|
}
|
|
3305
|
-
function
|
|
3449
|
+
function _r(e, t, n) {
|
|
3306
3450
|
if (t.length !== n.length) return !1;
|
|
3307
3451
|
for (let r = 0; r < n.length; r++) {
|
|
3308
3452
|
let i = t[r], a = n[r];
|
|
3309
3453
|
if (i.length !== a.length) return !1;
|
|
3310
3454
|
for (let t = 0; t < a.length; t++) {
|
|
3311
3455
|
let n = i[t];
|
|
3312
|
-
if (
|
|
3456
|
+
if (sr(a[t]) !== (n.nodeType === Node.TEXT_NODE) || n.textContent !== a[t].text || n.parentNode !== e) return !1;
|
|
3313
3457
|
}
|
|
3314
3458
|
}
|
|
3315
3459
|
return !0;
|
|
3316
3460
|
}
|
|
3317
|
-
function
|
|
3461
|
+
function vr(e, t) {
|
|
3318
3462
|
try {
|
|
3319
3463
|
let n = e.ownerDocument.getSelection();
|
|
3320
3464
|
if (!n) return null;
|
|
@@ -3330,7 +3474,7 @@ function dr(e, t) {
|
|
|
3330
3474
|
if (!e || e.rangeCount === 0) return null;
|
|
3331
3475
|
i = e.getRangeAt(0);
|
|
3332
3476
|
}
|
|
3333
|
-
let a =
|
|
3477
|
+
let a = br(e, i.startContainer, i.startOffset), o = br(e, i.endContainer, i.endOffset);
|
|
3334
3478
|
return a === null || o === null || a === o && !t ? null : {
|
|
3335
3479
|
start: a,
|
|
3336
3480
|
end: o,
|
|
@@ -3340,32 +3484,32 @@ function dr(e, t) {
|
|
|
3340
3484
|
return null;
|
|
3341
3485
|
}
|
|
3342
3486
|
}
|
|
3343
|
-
function
|
|
3487
|
+
function yr(e, t) {
|
|
3344
3488
|
try {
|
|
3345
|
-
let n =
|
|
3489
|
+
let n = xr(e, t.start), r = xr(e, t.end);
|
|
3346
3490
|
if (!n || !r) return;
|
|
3347
3491
|
let i = e.getRootNode().getSelection?.() ?? e.ownerDocument.getSelection();
|
|
3348
3492
|
t.backward ? i?.setBaseAndExtent(r[0], r[1], n[0], n[1]) : i?.setBaseAndExtent(n[0], n[1], r[0], r[1]);
|
|
3349
3493
|
} catch {}
|
|
3350
3494
|
}
|
|
3351
|
-
function
|
|
3495
|
+
function br(e, t, n) {
|
|
3352
3496
|
if (!e.contains(t)) return null;
|
|
3353
3497
|
let r = e.ownerDocument.createRange();
|
|
3354
3498
|
return r.selectNodeContents(e), r.setEnd(t, n), r.toString().length;
|
|
3355
3499
|
}
|
|
3356
|
-
function
|
|
3500
|
+
function xr(e, t) {
|
|
3357
3501
|
let n = t, r = null;
|
|
3358
|
-
for (let t of
|
|
3502
|
+
for (let t of Sr(e)) {
|
|
3359
3503
|
if (n <= t.data.length) return [t, n];
|
|
3360
3504
|
n -= t.data.length, r = [t, t.data.length];
|
|
3361
3505
|
}
|
|
3362
3506
|
return r;
|
|
3363
3507
|
}
|
|
3364
|
-
function*
|
|
3508
|
+
function* Sr(e) {
|
|
3365
3509
|
let t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT), n = t.nextNode();
|
|
3366
3510
|
for (; n;) yield n, n = t.nextNode();
|
|
3367
3511
|
}
|
|
3368
|
-
function
|
|
3512
|
+
function Cr(e) {
|
|
3369
3513
|
let t = [];
|
|
3370
3514
|
for (let n of e) {
|
|
3371
3515
|
for (let e of n) t.push(e.text, e.color ?? "", e.backgroundColor ?? "", e.fontWeight ?? "", e.fontStyle ?? "", e.textDecorationLine ?? "", e.opacity ?? "");
|
|
@@ -3375,9 +3519,9 @@ function gr(e) {
|
|
|
3375
3519
|
}
|
|
3376
3520
|
//#endregion
|
|
3377
3521
|
//#region src/render.ts
|
|
3378
|
-
function
|
|
3522
|
+
function wr(e) {
|
|
3379
3523
|
let t = /* @__PURE__ */ new Set();
|
|
3380
|
-
|
|
3524
|
+
Tr(e, !0, t);
|
|
3381
3525
|
for (let n of Array.from(e.source.querySelectorAll("[data-mw-inline-inset]"))) if (!t.has(n)) {
|
|
3382
3526
|
n.removeAttribute("data-mw-inline-inset");
|
|
3383
3527
|
let e = n.style;
|
|
@@ -3398,60 +3542,64 @@ function Z(e, t) {
|
|
|
3398
3542
|
function Q(e, t, n) {
|
|
3399
3543
|
e.hasAttribute(t) !== n && (n ? e.setAttribute(t, "") : e.removeAttribute(t));
|
|
3400
3544
|
}
|
|
3401
|
-
function
|
|
3545
|
+
function Tr(e, t, n) {
|
|
3402
3546
|
if (e.inlineElements) for (let { element: t, tracking: r, padLeft: i, padRight: a, insets: o } of e.inlineElements) {
|
|
3403
3547
|
let e = t;
|
|
3404
|
-
X(e, "--mw-ls", String(r)), i > 0 ? X(e, "--mw-ipl", String(i)) : Z(e, "--mw-ipl"), a > 0 ? X(e, "--mw-ipr", String(a)) : Z(e, "--mw-ipr"), o && (n.add(t),
|
|
3548
|
+
X(e, "--mw-ls", String(r)), i > 0 ? X(e, "--mw-ipl", String(i)) : Z(e, "--mw-ipl"), a > 0 ? X(e, "--mw-ipr", String(a)) : Z(e, "--mw-ipr"), o && (n.add(t), Er(e, o));
|
|
3405
3549
|
}
|
|
3406
|
-
if (t ||
|
|
3550
|
+
if (t || Or(e), !e.tableHidden) for (let t of fe(e)) {
|
|
3407
3551
|
let r = t.source;
|
|
3408
|
-
t.style.zIndex !== null &&
|
|
3552
|
+
t.style.zIndex !== null && de(t, e) && !t.inlineBox ? X(r, "--mw-z", String(t.style.zIndex)) : Z(r, "--mw-z"), Tr(t, !1, n);
|
|
3409
3553
|
}
|
|
3410
3554
|
}
|
|
3411
|
-
function
|
|
3555
|
+
function Er(e, t) {
|
|
3412
3556
|
Q(e, "data-mw-inline-inset", !0);
|
|
3413
3557
|
let n = (t, n) => {
|
|
3414
3558
|
n === null ? Z(e, t) : X(e, t, String(n));
|
|
3415
3559
|
};
|
|
3416
3560
|
n("--mw-it", t.top), n("--mw-ir", t.right), n("--mw-ib", t.bottom), n("--mw-il", t.left);
|
|
3417
3561
|
}
|
|
3418
|
-
function
|
|
3562
|
+
function Dr(e) {
|
|
3419
3563
|
let t = e.style;
|
|
3420
3564
|
if (t.textAlign !== "center" || !e.text || e.inlineBox || e.children.length > 0) return !1;
|
|
3421
|
-
let n = e.multicolGeometry, r = e.resolvedPadding, i = e.localRect.width - t.border.left - t.border.right - r.left - r.right, a = n ? Math.max(1, n.columnWidth - t.tracking) : i, o = n?.spans ??
|
|
3565
|
+
let n = e.multicolGeometry, r = e.resolvedPadding, i = e.localRect.width - t.border.left - t.border.right - r.left - r.right, a = n ? Math.max(1, n.columnWidth - t.tracking) : i, o = n?.spans ?? Vn(e, i);
|
|
3422
3566
|
return o.length !== 0 && o.every((n, r) => {
|
|
3423
3567
|
let i = r === 0 ? t.textIndent : 0, o = a - i - I(n.start, n.end, e.advances, t.tracking);
|
|
3424
3568
|
return o > 0 && o % 2 == 1;
|
|
3425
3569
|
});
|
|
3426
3570
|
}
|
|
3427
|
-
function
|
|
3571
|
+
function Or(e) {
|
|
3428
3572
|
let t = e.source, n = e.localRect, r = e.resolvedPadding, { border: i, textAlignBlocked: a, overflow: o, whiteSpace: s, tracking: c, lineGap: l } = e.style, u = e.multicolFlow, d = e.multicolFlowSpan;
|
|
3429
3573
|
Q(t, "data-mw-laid-out", !e.inlineBox && !u && !d), Q(t, "data-mw-inline-box", !!e.inlineBox), Q(t, "data-mw-multicol-flow", !!u), Q(t, "data-mw-multicol-flow-span", !!d);
|
|
3430
3574
|
let f = u ?? d;
|
|
3431
3575
|
f ? (X(t, "--mw-mt", String(f.top ?? 0)), X(t, "--mw-mr", String(f.right ?? 0)), X(t, "--mw-mb", String(f.bottom ?? 0)), X(t, "--mw-ml", String(f.left ?? 0))) : (Z(t, "--mw-mt"), Z(t, "--mw-mr"), Z(t, "--mw-mb"), Z(t, "--mw-ml")), Q(t, "data-mw-vbottom", !!e.inlineBox && e.style.verticalAlign === "end"), X(t, "--mw-ls", String(c)), X(t, "--mw-lh", String(l + 1)), X(t, "--mw-lhs", String(-l / 2)), Q(t, "data-mw-nowrap", s !== "normal");
|
|
3432
3576
|
let p = u || d ? void 0 : e.multicolGeometry;
|
|
3433
|
-
Q(t, "data-mw-multicol", !!p), Q(t, "data-mw-multicol-balance", !!p?.nativeBalance), p ? (X(t, "--mw-colc", String(p.columnCount)), X(t, "--mw-colg", String(p.gap))) : (Z(t, "--mw-colc"), Z(t, "--mw-colg")), Q(t, "data-mw-pre", s === "pre"), X(t, "--mw-x", String(n.x)), X(t, "--mw-y", String(n.y)), X(t, "--mw-w", String(n.width)), X(t, "--mw-h", String(n.height)), Q(t, "data-mw-clip", o === "clip"
|
|
3577
|
+
if (Q(t, "data-mw-multicol", !!p), Q(t, "data-mw-multicol-balance", !!p?.nativeBalance), p ? (X(t, "--mw-colc", String(p.columnCount)), X(t, "--mw-colg", String(p.gap))) : (Z(t, "--mw-colc"), Z(t, "--mw-colg")), Q(t, "data-mw-pre", s === "pre"), X(t, "--mw-x", String(n.x)), X(t, "--mw-y", String(n.y)), X(t, "--mw-w", String(n.width)), X(t, "--mw-h", String(n.height)), Q(t, "data-mw-clip", o.x === "clip" || o.y === "clip"), Q(t, "data-mw-scroll", e.scrollRange !== void 0), e.scrollRange) {
|
|
3578
|
+
let { maxX: n, maxY: r } = e.scrollRange;
|
|
3579
|
+
X(t, "--mw-se-x", String(n > 0 ? n + e.localRect.width : 1)), X(t, "--mw-se-y", String(r > 0 ? r + e.localRect.height : 1));
|
|
3580
|
+
} else Z(t, "--mw-se-x"), Z(t, "--mw-se-y");
|
|
3581
|
+
X(t, "--mw-pt", String(r.top)), X(t, "--mw-pr", String(r.right)), X(t, "--mw-pb", String(r.bottom)), X(t, "--mw-pl", String(r.left)), X(t, "--mw-bt", String(i.top)), X(t, "--mw-br", String(i.right)), X(t, "--mw-bb", String(i.bottom)), X(t, "--mw-bl", String(i.left)), X(t, "--mw-ti", String(e.style.textIndent)), Q(t, "data-mw-text-align-blocked", a), Q(t, "data-mw-center-nudge", Dr(e)), Q(t, "data-mw-dropped-text", !!e.droppedText), Q(t, "data-mw-table-hidden", !!e.tableHidden);
|
|
3434
3582
|
}
|
|
3435
3583
|
//#endregion
|
|
3436
3584
|
//#region src/style.ts
|
|
3437
|
-
function
|
|
3438
|
-
let r = getComputedStyle(e), i = parseFloat(r.fontSize) || t, a =
|
|
3439
|
-
|
|
3440
|
-
let c = r.display ||
|
|
3585
|
+
function kr(e, t, n) {
|
|
3586
|
+
let r = getComputedStyle(e), i = parseFloat(r.fontSize) || t, a = Zr(e) ? e.computedStyleMap() : null, o = e.getAttribute("class") ?? "", s = e.style;
|
|
3587
|
+
Kr(e, o, s);
|
|
3588
|
+
let c = r.display || Ur[e.tagName] || "", l = Wr[c] ?? "none", u = r.columnCount && r.columnCount !== "auto" ? Math.max(1, Math.floor(Number(r.columnCount) || 1)) : null, d = r.columnWidth && r.columnWidth !== "auto" ? parseFloat(r.columnWidth) : NaN, f = Number.isFinite(d) ? Math.max(1, F(d, t)) : null, p = c === "flex" || c === "inline-flex" ? "flex" : c === "grid" || c === "inline-grid" ? "grid" : c === "table" || c === "inline-table" ? "table" : c === "none" || Hr(e, r) ? "none" : u !== null || f !== null ? "multicol" : "block", m = { kind: "none" }, h = { kind: "none" }, g = [it()], _ = [it()], v = {
|
|
3441
3589
|
direction: "row",
|
|
3442
3590
|
dense: !1
|
|
3443
3591
|
}, y = null;
|
|
3444
3592
|
if (p === "grid") {
|
|
3445
|
-
if (a) m =
|
|
3593
|
+
if (a) m = _i(a.get("grid-template-columns")?.toString() ?? "", t), h = _i(a.get("grid-template-rows")?.toString() ?? "", t);
|
|
3446
3594
|
else {
|
|
3447
3595
|
e.setAttribute("data-mw-degrid", "");
|
|
3448
3596
|
try {
|
|
3449
|
-
m =
|
|
3597
|
+
m = _i(r.getPropertyValue("grid-template-columns"), t), h = _i(r.getPropertyValue("grid-template-rows"), t);
|
|
3450
3598
|
} finally {
|
|
3451
3599
|
e.removeAttribute("data-mw-degrid");
|
|
3452
3600
|
}
|
|
3453
3601
|
}
|
|
3454
|
-
g =
|
|
3602
|
+
g = xi(r.getPropertyValue("grid-auto-columns"), t), _ = xi(r.getPropertyValue("grid-auto-rows"), t), v = Di(r.getPropertyValue("grid-auto-flow")), y = bi(r.getPropertyValue("grid-template-areas"));
|
|
3455
3603
|
}
|
|
3456
3604
|
let b = "auto", x = !1, S = 0, C = 0;
|
|
3457
3605
|
if (p === "table" && (b = r.tableLayout === "fixed" ? "fixed" : "auto", x = r.borderCollapse === "collapse", !x)) {
|
|
@@ -3466,61 +3614,71 @@ function Sr(e, t, n) {
|
|
|
3466
3614
|
borderSpacingX: S,
|
|
3467
3615
|
borderSpacingY: C,
|
|
3468
3616
|
captionSide: r.captionSide === "bottom" ? "bottom" : "top",
|
|
3469
|
-
verticalAlign: l === "cell" || c.startsWith("inline-") ?
|
|
3617
|
+
verticalAlign: l === "cell" || c.startsWith("inline-") ? Gr(e, r) : "start",
|
|
3470
3618
|
flexDirection: r.flexDirection.startsWith("column") ? "column" : "row",
|
|
3471
3619
|
flexReverse: r.flexDirection.endsWith("-reverse"),
|
|
3472
3620
|
flexWrap: r.flexWrap.startsWith("wrap") ? "wrap" : "nowrap",
|
|
3473
3621
|
wrapReverse: r.flexWrap === "wrap-reverse",
|
|
3474
3622
|
flexGrow: Number(r.flexGrow) || 0,
|
|
3475
3623
|
flexShrink: r.flexShrink === "" ? 1 : Number(r.flexShrink) || 0,
|
|
3476
|
-
flexBasis:
|
|
3624
|
+
flexBasis: hi(r.flexBasis, t),
|
|
3477
3625
|
order: Number(r.order) || 0,
|
|
3478
|
-
justifyContent:
|
|
3479
|
-
alignContent:
|
|
3480
|
-
alignItems:
|
|
3481
|
-
alignSelf:
|
|
3482
|
-
justifyItems:
|
|
3483
|
-
justifySelf:
|
|
3626
|
+
justifyContent: Qr(r.justifyContent),
|
|
3627
|
+
alignContent: Qr(r.alignContent),
|
|
3628
|
+
alignItems: $r(r.alignItems),
|
|
3629
|
+
alignSelf: ei(r.alignSelf),
|
|
3630
|
+
justifyItems: $r(r.justifyItems),
|
|
3631
|
+
justifySelf: ei(r.justifySelf),
|
|
3484
3632
|
gridTemplateColumns: m,
|
|
3485
3633
|
gridTemplateRows: h,
|
|
3486
3634
|
gridAutoColumns: g,
|
|
3487
3635
|
gridAutoRows: _,
|
|
3488
3636
|
gridAutoFlow: v,
|
|
3489
3637
|
gridTemplateAreas: y,
|
|
3490
|
-
gridColumnStart:
|
|
3491
|
-
gridColumnEnd:
|
|
3492
|
-
gridRowStart:
|
|
3493
|
-
gridRowEnd:
|
|
3494
|
-
width:
|
|
3495
|
-
height:
|
|
3496
|
-
minWidth:
|
|
3497
|
-
minHeight:
|
|
3498
|
-
maxWidth:
|
|
3499
|
-
maxHeight:
|
|
3500
|
-
padding:
|
|
3501
|
-
margin:
|
|
3502
|
-
position:
|
|
3503
|
-
insets:
|
|
3638
|
+
gridColumnStart: Ei(r.getPropertyValue("grid-column-start")),
|
|
3639
|
+
gridColumnEnd: Ei(r.getPropertyValue("grid-column-end")),
|
|
3640
|
+
gridRowStart: Ei(r.getPropertyValue("grid-row-start")),
|
|
3641
|
+
gridRowEnd: Ei(r.getPropertyValue("grid-row-end")),
|
|
3642
|
+
width: ui(a, r.width, "width", t, o, s, n),
|
|
3643
|
+
height: ui(a, r.height, "height", t, o, s, n),
|
|
3644
|
+
minWidth: mi(a, "min-width", r.minWidth, o, "min-w", s, n, t) ?? si(r.minWidth, t) ?? "auto",
|
|
3645
|
+
minHeight: mi(a, "min-height", r.minHeight, o, "min-h", s, n, t) ?? si(r.minHeight, t) ?? "auto",
|
|
3646
|
+
maxWidth: mi(a, "max-width", r.maxWidth, o, "max-w", s, n, t) ?? si(r.maxWidth, t),
|
|
3647
|
+
maxHeight: mi(a, "max-height", r.maxHeight, o, "max-h", s, n, t) ?? si(r.maxHeight, t),
|
|
3648
|
+
padding: ki(r, t),
|
|
3649
|
+
margin: ti(r, a, o, s, t),
|
|
3650
|
+
position: ii(r.position),
|
|
3651
|
+
insets: ai(r, a, o, s, t),
|
|
3504
3652
|
gapX: $(r.columnGap === "normal" || r.columnGap === "" ? p === "multicol" ? `${i}px` : "0px" : r.columnGap, t),
|
|
3505
3653
|
gapY: $(r.rowGap === "normal" ? "0px" : r.rowGap, t),
|
|
3506
|
-
border:
|
|
3654
|
+
border: Ai(r),
|
|
3507
3655
|
borderStyle: {
|
|
3508
|
-
top:
|
|
3509
|
-
right:
|
|
3510
|
-
bottom:
|
|
3511
|
-
left:
|
|
3656
|
+
top: oi(r.borderTopStyle),
|
|
3657
|
+
right: oi(r.borderRightStyle),
|
|
3658
|
+
bottom: oi(r.borderBottomStyle),
|
|
3659
|
+
left: oi(r.borderLeftStyle)
|
|
3660
|
+
},
|
|
3661
|
+
overflow: Vr(r),
|
|
3662
|
+
scrollbarWidth: Lr(e, r),
|
|
3663
|
+
scrollbarColor: Rr(r.scrollbarColor),
|
|
3664
|
+
overscroll: {
|
|
3665
|
+
x: (r.overscrollBehaviorX || "auto") === "auto",
|
|
3666
|
+
y: (r.overscrollBehaviorY || "auto") === "auto"
|
|
3667
|
+
},
|
|
3668
|
+
scrollbarSize: {
|
|
3669
|
+
x: zr(r.getPropertyValue("--mw-scrollbar-x-size")),
|
|
3670
|
+
y: zr(r.getPropertyValue("--mw-scrollbar-y-size"))
|
|
3512
3671
|
},
|
|
3513
|
-
overflow: Er(r.overflow) || Er(r.overflowX) || Er(r.overflowY) ? "clip" : "visible",
|
|
3514
3672
|
whiteSpace: r.whiteSpace === "pre" ? "pre" : r.whiteSpace === "nowrap" ? "nowrap" : "normal",
|
|
3515
3673
|
tabSize: Math.max(1, Math.floor(parseFloat(r.tabSize)) || 8),
|
|
3516
|
-
lineGap:
|
|
3517
|
-
tracking:
|
|
3674
|
+
lineGap: ri(r.lineHeight, i),
|
|
3675
|
+
tracking: ni(r.letterSpacing, i, n?.letterSpacing ?? 0),
|
|
3518
3676
|
textOverflow: r.textOverflow === "ellipsis" ? "ellipsis" : "clip",
|
|
3519
3677
|
color: r.color,
|
|
3520
3678
|
fontWeight: r.fontWeight,
|
|
3521
3679
|
fontStyle: r.fontStyle,
|
|
3522
3680
|
textDecorationLine: r.textDecorationLine,
|
|
3523
|
-
backgroundColor:
|
|
3681
|
+
backgroundColor: Mr(e, r.backgroundColor, r),
|
|
3524
3682
|
backgroundClear: r.getPropertyValue("--mw-bg-clear").trim() === "1",
|
|
3525
3683
|
borderColor: {
|
|
3526
3684
|
top: r.borderTopColor,
|
|
@@ -3528,18 +3686,18 @@ function Sr(e, t, n) {
|
|
|
3528
3686
|
bottom: r.borderBottomColor,
|
|
3529
3687
|
left: r.borderLeftColor
|
|
3530
3688
|
},
|
|
3531
|
-
textAlignBlocked:
|
|
3532
|
-
textAlign:
|
|
3533
|
-
textIndent:
|
|
3534
|
-
opacity:
|
|
3689
|
+
textAlignBlocked: Yr(e, r),
|
|
3690
|
+
textAlign: Xr(e, r),
|
|
3691
|
+
textIndent: li(r, t),
|
|
3692
|
+
opacity: ci(r.opacity),
|
|
3535
3693
|
glyphSet: r.getPropertyValue("--mw-border-glyphs").trim() || null,
|
|
3536
3694
|
zIndex: r.zIndex === "auto" || r.zIndex === "" ? null : Number(r.zIndex) || 0,
|
|
3537
3695
|
latticeBorder: null,
|
|
3538
|
-
ruleX: p === "flex" || p === "grid" || p === "multicol" ?
|
|
3539
|
-
ruleY: p === "flex" || p === "grid" ?
|
|
3540
|
-
ruleBreak:
|
|
3696
|
+
ruleX: p === "flex" || p === "grid" || p === "multicol" ? Jr(r, "x") : null,
|
|
3697
|
+
ruleY: p === "flex" || p === "grid" ? Jr(r, "y") : null,
|
|
3698
|
+
ruleBreak: qr(r, "--mw-rule-break", ["none", "intersection"], "normal"),
|
|
3541
3699
|
ruleInset: r.getPropertyValue("--mw-rule-inset").trim() === "overlap-join" ? "overlap-join" : Math.max(0, P(parseFloat(r.getPropertyValue("--mw-rule-inset")) || 0)),
|
|
3542
|
-
ruleVisibilityItems:
|
|
3700
|
+
ruleVisibilityItems: qr(r, "--mw-rule-visibility-items", [
|
|
3543
3701
|
"all",
|
|
3544
3702
|
"around",
|
|
3545
3703
|
"between"
|
|
@@ -3552,9 +3710,9 @@ function Sr(e, t, n) {
|
|
|
3552
3710
|
breakAfterColumn: r.breakAfter === "column",
|
|
3553
3711
|
breakInsideAvoid: r.breakInside === "avoid" || r.breakInside === "avoid-column"
|
|
3554
3712
|
};
|
|
3555
|
-
return
|
|
3713
|
+
return Ar(w, r), w;
|
|
3556
3714
|
}
|
|
3557
|
-
function
|
|
3715
|
+
function Ar(e, t) {
|
|
3558
3716
|
t.borderCollapse === "collapse" && (e.display === "table" || e.tableRole === "cell" || e.tableRole === "row" || e.tableRole === "row-group" || e.tableRole === "header-group" || e.tableRole === "footer-group") && (e.latticeBorder = {
|
|
3559
3717
|
width: e.border,
|
|
3560
3718
|
style: e.borderStyle,
|
|
@@ -3565,26 +3723,70 @@ function Cr(e, t) {
|
|
|
3565
3723
|
bottom: t.borderBottomStyle === "hidden",
|
|
3566
3724
|
left: t.borderLeftStyle === "hidden"
|
|
3567
3725
|
}
|
|
3568
|
-
}, e.border =
|
|
3726
|
+
}, e.border = rt(), e.display === "table" && (e.padding = rt()));
|
|
3569
3727
|
}
|
|
3570
|
-
function
|
|
3728
|
+
function jr(e) {
|
|
3571
3729
|
if (!e) return !0;
|
|
3572
3730
|
let t = e.trim().toLowerCase();
|
|
3573
3731
|
return t === "" || t === "transparent" || t === "rgba(0, 0, 0, 0)" || t === "currentcolor";
|
|
3574
3732
|
}
|
|
3575
|
-
function
|
|
3576
|
-
let i = r(e,
|
|
3733
|
+
function Mr(e, t, n) {
|
|
3734
|
+
let i = r(e, jr(t) ? "" : t, n);
|
|
3577
3735
|
return i === "" ? void 0 : i;
|
|
3578
3736
|
}
|
|
3579
|
-
function
|
|
3737
|
+
function Nr(e) {
|
|
3580
3738
|
return e === "hidden" || e === "clip";
|
|
3581
3739
|
}
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3740
|
+
var Pr = /* @__PURE__ */ new WeakMap(), Fr = null;
|
|
3741
|
+
function Ir(e) {
|
|
3742
|
+
if (Fr !== null) return Fr;
|
|
3743
|
+
if (!e.body) return !0;
|
|
3744
|
+
let t = e.createElement("div");
|
|
3745
|
+
return t.style.cssText = "position: absolute; width: 0; height: 0; overflow: auto", e.body.appendChild(t), Fr = getComputedStyle(t).scrollbarWidth !== "none", t.remove(), Fr;
|
|
3746
|
+
}
|
|
3747
|
+
function Lr(e, t) {
|
|
3748
|
+
if (!Ir(e.ownerDocument)) return "auto";
|
|
3749
|
+
if (e.hasAttribute("data-mw-scroll")) {
|
|
3750
|
+
let t = Pr.get(e);
|
|
3751
|
+
if (t !== void 0) return t;
|
|
3752
|
+
}
|
|
3753
|
+
let n = t.scrollbarWidth === "none" ? "none" : "auto";
|
|
3754
|
+
return Pr.set(e, n), n;
|
|
3755
|
+
}
|
|
3756
|
+
function Rr(e) {
|
|
3757
|
+
let t = (e ?? "").trim();
|
|
3758
|
+
if (!t || t === "auto") return null;
|
|
3759
|
+
let n = 0;
|
|
3760
|
+
for (let e = 0; e < t.length; e++) {
|
|
3761
|
+
let r = t[e];
|
|
3762
|
+
if (r === "(") n++;
|
|
3763
|
+
else if (r === ")") n--;
|
|
3764
|
+
else if (r === " " && n === 0) return {
|
|
3765
|
+
thumb: t.slice(0, e),
|
|
3766
|
+
track: t.slice(e + 1).trim()
|
|
3767
|
+
};
|
|
3768
|
+
}
|
|
3769
|
+
return null;
|
|
3770
|
+
}
|
|
3771
|
+
function zr(e) {
|
|
3772
|
+
return Math.max(1, Math.floor(Number(e) || 1));
|
|
3773
|
+
}
|
|
3774
|
+
function Br(e) {
|
|
3775
|
+
return Nr(e) ? "clip" : e === "auto" || e === "scroll" ? e : "visible";
|
|
3776
|
+
}
|
|
3777
|
+
function Vr(e) {
|
|
3778
|
+
let t = Br(e.overflowX || e.overflow), n = Br(e.overflowY || e.overflow);
|
|
3779
|
+
return t !== "visible" && n === "visible" && (n = "auto"), n !== "visible" && t === "visible" && (t = "auto"), {
|
|
3780
|
+
x: t,
|
|
3781
|
+
y: n
|
|
3782
|
+
};
|
|
3783
|
+
}
|
|
3784
|
+
function Hr(e, t) {
|
|
3785
|
+
if (t.position !== "absolute" && t.position !== "fixed") return !1;
|
|
3786
|
+
let n = t.clip.replace(/\s/g, "");
|
|
3787
|
+
return n === "rect(0px,0px,0px,0px)" || n === "rect(0,0,0,0)" || !ie(e.tagName) && (Nr(t.overflow) || Nr(t.overflowX)) && parseFloat(t.width) <= 1 && parseFloat(t.height) <= 1;
|
|
3586
3788
|
}
|
|
3587
|
-
var
|
|
3789
|
+
var Ur = {
|
|
3588
3790
|
TABLE: "table",
|
|
3589
3791
|
THEAD: "table-header-group",
|
|
3590
3792
|
TBODY: "table-row-group",
|
|
@@ -3595,7 +3797,7 @@ var Or = {
|
|
|
3595
3797
|
CAPTION: "table-caption",
|
|
3596
3798
|
COL: "table-column",
|
|
3597
3799
|
COLGROUP: "table-column-group"
|
|
3598
|
-
},
|
|
3800
|
+
}, Wr = {
|
|
3599
3801
|
"table-header-group": "header-group",
|
|
3600
3802
|
"table-row-group": "row-group",
|
|
3601
3803
|
"table-footer-group": "footer-group",
|
|
@@ -3605,38 +3807,38 @@ var Or = {
|
|
|
3605
3807
|
"table-column": "column",
|
|
3606
3808
|
"table-column-group": "column-group"
|
|
3607
3809
|
};
|
|
3608
|
-
function
|
|
3810
|
+
function Gr(e, t) {
|
|
3609
3811
|
let n = t.verticalAlign || e.getAttribute("valign")?.toLowerCase() || (e.tagName === "TD" || e.tagName === "TH" ? "middle" : "baseline");
|
|
3610
3812
|
return n === "top" ? "start" : n === "middle" ? "center" : n === "bottom" ? "end" : "start";
|
|
3611
3813
|
}
|
|
3612
|
-
function
|
|
3613
|
-
(/(?:^|[\s:.[!])text-(?:xs|sm|base|lg|[2-9]?xl)(?![\w-])/.test(t) || /(?:^|[\s:.[!])text-\[(?:(?:length|size):|[\d.])/.test(t) || n.fontSize !== "") &&
|
|
3814
|
+
function Kr(e, t, n) {
|
|
3815
|
+
(/(?:^|[\s:.[!])text-(?:xs|sm|base|lg|[2-9]?xl)(?![\w-])/.test(t) || /(?:^|[\s:.[!])text-\[(?:(?:length|size):|[\d.])/.test(t) || n.fontSize !== "") && N(e, "font-size inside <mono-wind> is ignored — all text shares the host's cell size. Size the <mono-wind> element itself instead.");
|
|
3614
3816
|
}
|
|
3615
|
-
function
|
|
3817
|
+
function qr(e, t, n, r) {
|
|
3616
3818
|
let i = e.getPropertyValue(t).trim();
|
|
3617
3819
|
return n.includes(i) ? i : r;
|
|
3618
3820
|
}
|
|
3619
|
-
function
|
|
3821
|
+
function Jr(e, t) {
|
|
3620
3822
|
let n = P(parseFloat(e.getPropertyValue(`--mw-rule-${t}-width`)) || 0);
|
|
3621
3823
|
if (n <= 0) return null;
|
|
3622
3824
|
let r = e.getPropertyValue(`--mw-rule-${t}-color`).trim();
|
|
3623
3825
|
return {
|
|
3624
3826
|
width: n,
|
|
3625
|
-
style:
|
|
3827
|
+
style: oi(e.getPropertyValue(`--mw-rule-${t}-style`).trim()),
|
|
3626
3828
|
color: r && r !== "currentcolor" && r !== "currentColor" ? r : e.color
|
|
3627
3829
|
};
|
|
3628
3830
|
}
|
|
3629
|
-
function
|
|
3831
|
+
function Yr(e, t) {
|
|
3630
3832
|
return t.textAlign === "justify" || e.getAttribute("align")?.toLowerCase() === "justify";
|
|
3631
3833
|
}
|
|
3632
|
-
function
|
|
3834
|
+
function Xr(e, t) {
|
|
3633
3835
|
let n = t.textAlign || e.getAttribute("align")?.toLowerCase() || "";
|
|
3634
3836
|
return n === "right" || n === "end" ? "end" : n === "center" || n.endsWith("-center") ? "center" : "start";
|
|
3635
3837
|
}
|
|
3636
|
-
function
|
|
3838
|
+
function Zr(e) {
|
|
3637
3839
|
return typeof e.computedStyleMap == "function";
|
|
3638
3840
|
}
|
|
3639
|
-
function
|
|
3841
|
+
function Qr(e) {
|
|
3640
3842
|
switch (e) {
|
|
3641
3843
|
case "center": return "center";
|
|
3642
3844
|
case "flex-end":
|
|
@@ -3651,7 +3853,7 @@ function Lr(e) {
|
|
|
3651
3853
|
default: return "start";
|
|
3652
3854
|
}
|
|
3653
3855
|
}
|
|
3654
|
-
function
|
|
3856
|
+
function $r(e) {
|
|
3655
3857
|
switch (e) {
|
|
3656
3858
|
case "center": return "center";
|
|
3657
3859
|
case "flex-end":
|
|
@@ -3662,10 +3864,10 @@ function Rr(e) {
|
|
|
3662
3864
|
default: return "start";
|
|
3663
3865
|
}
|
|
3664
3866
|
}
|
|
3665
|
-
function
|
|
3666
|
-
return e === "auto" || e === "" || e === "normal" ? "auto" :
|
|
3867
|
+
function ei(e) {
|
|
3868
|
+
return e === "auto" || e === "" || e === "normal" ? "auto" : $r(e);
|
|
3667
3869
|
}
|
|
3668
|
-
function
|
|
3870
|
+
function ti(e, t, n, r, i) {
|
|
3669
3871
|
let a = (a, o, s) => {
|
|
3670
3872
|
if (t) {
|
|
3671
3873
|
let e = t.get(a)?.toString().trim();
|
|
@@ -3689,16 +3891,16 @@ function Br(e, t, n, r, i) {
|
|
|
3689
3891
|
left: a("margin-left", "margin-inline-start", /(?:^|[\s:.[!])(?:m|mx|ml|ms)-auto\b/)
|
|
3690
3892
|
};
|
|
3691
3893
|
}
|
|
3692
|
-
function
|
|
3894
|
+
function ni(e, t, n) {
|
|
3693
3895
|
let r = (e === "normal" ? 0 : parseFloat(e) || 0) - n;
|
|
3694
3896
|
return r <= 0 ? 0 : Math.floor(r / (.025 * t) + 1e-6);
|
|
3695
3897
|
}
|
|
3696
|
-
function
|
|
3898
|
+
function ri(e, t) {
|
|
3697
3899
|
if (!e || e === "normal" || t <= 0) return 0;
|
|
3698
3900
|
let n = parseFloat(e);
|
|
3699
3901
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n / t + 1e-6) - 1) : 0;
|
|
3700
3902
|
}
|
|
3701
|
-
function
|
|
3903
|
+
function ii(e) {
|
|
3702
3904
|
switch (e) {
|
|
3703
3905
|
case "relative":
|
|
3704
3906
|
case "absolute":
|
|
@@ -3707,7 +3909,7 @@ function Ur(e) {
|
|
|
3707
3909
|
default: return "static";
|
|
3708
3910
|
}
|
|
3709
3911
|
}
|
|
3710
|
-
function
|
|
3912
|
+
function ai(e, t, n, r, i) {
|
|
3711
3913
|
let a = (a, o) => {
|
|
3712
3914
|
if (t) {
|
|
3713
3915
|
let e = t.get(a)?.toString().trim();
|
|
@@ -3726,7 +3928,7 @@ function Wr(e, t, n, r, i) {
|
|
|
3726
3928
|
left: a("left", /(?:^|[\s:.[!])-?(?:left|start|inset|inset-x)-/)
|
|
3727
3929
|
};
|
|
3728
3930
|
}
|
|
3729
|
-
function
|
|
3931
|
+
function oi(e) {
|
|
3730
3932
|
switch (e) {
|
|
3731
3933
|
case "double": return "double";
|
|
3732
3934
|
case "dashed": return "dashed";
|
|
@@ -3734,7 +3936,7 @@ function Gr(e) {
|
|
|
3734
3936
|
default: return "solid";
|
|
3735
3937
|
}
|
|
3736
3938
|
}
|
|
3737
|
-
function
|
|
3939
|
+
function si(e, t) {
|
|
3738
3940
|
if (!e || e === "none" || e === "auto") return;
|
|
3739
3941
|
if (e === "min-content" || e === "max-content" || e === "fit-content") return e;
|
|
3740
3942
|
if (e.endsWith("%")) {
|
|
@@ -3753,28 +3955,28 @@ function $(e, t) {
|
|
|
3753
3955
|
let n = parseFloat(e);
|
|
3754
3956
|
return Number.isFinite(n) ? F(n, t) : 0;
|
|
3755
3957
|
}
|
|
3756
|
-
function
|
|
3958
|
+
function ci(e) {
|
|
3757
3959
|
let t = parseFloat(e);
|
|
3758
3960
|
return Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 1;
|
|
3759
3961
|
}
|
|
3760
|
-
function
|
|
3962
|
+
function li(e, t) {
|
|
3761
3963
|
let n = e.textIndent;
|
|
3762
3964
|
if (!n || n.endsWith("%")) return 0;
|
|
3763
3965
|
let r = parseFloat(n);
|
|
3764
3966
|
return Number.isFinite(r) ? Math.max(0, F(r, t)) : 0;
|
|
3765
3967
|
}
|
|
3766
|
-
function
|
|
3767
|
-
let s =
|
|
3968
|
+
function ui(e, t, n, r, i, a, o) {
|
|
3969
|
+
let s = di(n === "width" ? a.width : a.height);
|
|
3768
3970
|
if (s !== null) return {
|
|
3769
3971
|
kind: "cells",
|
|
3770
|
-
value:
|
|
3972
|
+
value: pi(s, n, o, r)
|
|
3771
3973
|
};
|
|
3772
|
-
let c =
|
|
3974
|
+
let c = fi(i, n === "width" ? "w" : "h");
|
|
3773
3975
|
if (c !== null) {
|
|
3774
3976
|
let i = parseFloat(e ? String(e.get(n) ?? "") : t), a = Number.isFinite(i) && Math.abs(i - c) <= c * .3;
|
|
3775
3977
|
if (a || !Number.isFinite(i)) return {
|
|
3776
3978
|
kind: "cells",
|
|
3777
|
-
value:
|
|
3979
|
+
value: pi(a ? i : c, n, o, r)
|
|
3778
3980
|
};
|
|
3779
3981
|
}
|
|
3780
3982
|
if (e) {
|
|
@@ -3782,7 +3984,7 @@ function Yr(e, t, n, r, i, a, o) {
|
|
|
3782
3984
|
if (t == null) return;
|
|
3783
3985
|
let i = t.toString().trim();
|
|
3784
3986
|
if (i === "auto") return { kind: "auto" };
|
|
3785
|
-
let a =
|
|
3987
|
+
let a = gi(i);
|
|
3786
3988
|
if (a) return a;
|
|
3787
3989
|
if (i.endsWith("%")) return {
|
|
3788
3990
|
kind: "percent",
|
|
@@ -3796,16 +3998,16 @@ function Yr(e, t, n, r, i, a, o) {
|
|
|
3796
3998
|
kind: "cells",
|
|
3797
3999
|
value: P(parseFloat(i) / .25)
|
|
3798
4000
|
};
|
|
3799
|
-
let s =
|
|
4001
|
+
let s = di(i);
|
|
3800
4002
|
if (s !== null) return {
|
|
3801
4003
|
kind: "cells",
|
|
3802
|
-
value:
|
|
4004
|
+
value: pi(s, n, o, r)
|
|
3803
4005
|
};
|
|
3804
4006
|
}
|
|
3805
4007
|
let l = n === "width" ? a.width : a.height;
|
|
3806
4008
|
if (l) {
|
|
3807
4009
|
if (l === "auto") return { kind: "auto" };
|
|
3808
|
-
let e =
|
|
4010
|
+
let e = gi(l);
|
|
3809
4011
|
if (e) return e;
|
|
3810
4012
|
if (l.endsWith("%")) return {
|
|
3811
4013
|
kind: "percent",
|
|
@@ -3840,7 +4042,7 @@ function Yr(e, t, n, r, i, a, o) {
|
|
|
3840
4042
|
kind: "cells",
|
|
3841
4043
|
value: P(Number(p[1]))
|
|
3842
4044
|
};
|
|
3843
|
-
if (!
|
|
4045
|
+
if (!Oi(i, u) || t === "auto") return { kind: "auto" };
|
|
3844
4046
|
if (t.endsWith("%")) return {
|
|
3845
4047
|
kind: "percent",
|
|
3846
4048
|
value: parseFloat(t)
|
|
@@ -3851,7 +4053,7 @@ function Yr(e, t, n, r, i, a, o) {
|
|
|
3851
4053
|
value: F(m, r)
|
|
3852
4054
|
};
|
|
3853
4055
|
}
|
|
3854
|
-
function
|
|
4056
|
+
function di(e) {
|
|
3855
4057
|
let t = /^(-?[\d.]+)((?:[dsl]?v)(?:h|w|min|max)|vi|vb)$/.exec(e.trim());
|
|
3856
4058
|
if (!t || typeof window > "u") return null;
|
|
3857
4059
|
let n = parseFloat(t[1]);
|
|
@@ -3859,7 +4061,7 @@ function Xr(e) {
|
|
|
3859
4061
|
let r = t[2], i = window.innerHeight, a = window.innerWidth, o = r.endsWith("h") ? i : r.endsWith("min") ? Math.min(a, i) : r.endsWith("max") ? Math.max(a, i) : r === "vb" ? i : a;
|
|
3860
4062
|
return n / 100 * o;
|
|
3861
4063
|
}
|
|
3862
|
-
function
|
|
4064
|
+
function fi(e, t) {
|
|
3863
4065
|
if (typeof window > "u") return null;
|
|
3864
4066
|
let n = RegExp(`(?:^|[\\s:.[!])${t}-(screen|[dsl]v[hw])(?![\\w-])`).exec(e);
|
|
3865
4067
|
if (n) {
|
|
@@ -3867,23 +4069,23 @@ function Zr(e, t) {
|
|
|
3867
4069
|
return e === "screen" ? t.includes("h") ? window.innerHeight : window.innerWidth : e.endsWith("h") ? window.innerHeight : window.innerWidth;
|
|
3868
4070
|
}
|
|
3869
4071
|
let r = RegExp(`(?:^|[\\s:.[!])${t}-\\[(-?[\\d.]+(?:[dsl]?v(?:h|w|min|max)|vi|vb))\\]`).exec(e);
|
|
3870
|
-
return r ?
|
|
4072
|
+
return r ? di(r[1]) : null;
|
|
3871
4073
|
}
|
|
3872
|
-
function
|
|
4074
|
+
function pi(e, t, n, r) {
|
|
3873
4075
|
let i = t === "width" ? n?.width : n?.height;
|
|
3874
4076
|
return i && i > 0 ? Math.max(0, Math.floor(e / i)) : F(e, r);
|
|
3875
4077
|
}
|
|
3876
|
-
function
|
|
3877
|
-
let c = t.endsWith("width") ? "width" : "height", l =
|
|
3878
|
-
if (l !== null) return
|
|
3879
|
-
let u =
|
|
4078
|
+
function mi(e, t, n, r, i, a, o, s) {
|
|
4079
|
+
let c = t.endsWith("width") ? "width" : "height", l = di(a.getPropertyValue(t)) ?? di(e?.get(t)?.toString().trim() ?? "");
|
|
4080
|
+
if (l !== null) return pi(l, c, o, s);
|
|
4081
|
+
let u = fi(r, i);
|
|
3880
4082
|
if (u === null) return;
|
|
3881
4083
|
let d = parseFloat(e ? String(e.get(t) ?? "") : n), f = Number.isFinite(d) && Math.abs(d - u) <= u * .3;
|
|
3882
|
-
if (!(!f && Number.isFinite(d))) return
|
|
4084
|
+
if (!(!f && Number.isFinite(d))) return pi(f ? d : u, c, o, s);
|
|
3883
4085
|
}
|
|
3884
|
-
function
|
|
4086
|
+
function hi(e, t) {
|
|
3885
4087
|
if (!e || e === "auto" || e === "content") return;
|
|
3886
|
-
let n =
|
|
4088
|
+
let n = gi(e);
|
|
3887
4089
|
if (n) return n;
|
|
3888
4090
|
if (e.endsWith("%")) {
|
|
3889
4091
|
let t = parseFloat(e);
|
|
@@ -3898,27 +4100,27 @@ function ei(e, t) {
|
|
|
3898
4100
|
value: F(r, t)
|
|
3899
4101
|
} : void 0;
|
|
3900
4102
|
}
|
|
3901
|
-
function
|
|
4103
|
+
function gi(e) {
|
|
3902
4104
|
if (e === "min-content") return { kind: "min-content" };
|
|
3903
4105
|
if (e === "max-content") return { kind: "max-content" };
|
|
3904
4106
|
if (e === "fit-content") return { kind: "fit-content" };
|
|
3905
4107
|
}
|
|
3906
|
-
function
|
|
4108
|
+
function _i(e, t) {
|
|
3907
4109
|
let n = e.trim();
|
|
3908
4110
|
if (!n || n === "none") return { kind: "none" };
|
|
3909
4111
|
if (n === "subgrid" || n.startsWith("subgrid ")) return { kind: "subgrid" };
|
|
3910
4112
|
let r = [], i = [], a = [], o = (e) => {
|
|
3911
4113
|
i.push(a), a = [], r.push(e);
|
|
3912
4114
|
}, s;
|
|
3913
|
-
for (let e of
|
|
3914
|
-
let n =
|
|
4115
|
+
for (let e of Ti(n)) {
|
|
4116
|
+
let n = yi(e);
|
|
3915
4117
|
if (n) {
|
|
3916
4118
|
a.push(...n);
|
|
3917
4119
|
continue;
|
|
3918
4120
|
}
|
|
3919
4121
|
let i = e.match(/^repeat\(\s*([^,]+?)\s*,(.*)\)$/s);
|
|
3920
4122
|
if (i) {
|
|
3921
|
-
let e =
|
|
4123
|
+
let e = vi(i[2].trim(), t);
|
|
3922
4124
|
if (e.tracks.length === 0) continue;
|
|
3923
4125
|
let n = i[1];
|
|
3924
4126
|
if (n === "auto-fill" || n === "auto-fit") {
|
|
@@ -3936,7 +4138,7 @@ function ni(e, t) {
|
|
|
3936
4138
|
}
|
|
3937
4139
|
continue;
|
|
3938
4140
|
}
|
|
3939
|
-
o(
|
|
4141
|
+
o(Si(e, t));
|
|
3940
4142
|
}
|
|
3941
4143
|
if (i.push(a), r.length === 0 && !s) return { kind: "none" };
|
|
3942
4144
|
let c = {
|
|
@@ -3945,26 +4147,26 @@ function ni(e, t) {
|
|
|
3945
4147
|
};
|
|
3946
4148
|
return i.some((e) => e.length > 0) && (c.lineNames = i), s && (c.autoRepeat = s), c;
|
|
3947
4149
|
}
|
|
3948
|
-
function
|
|
4150
|
+
function vi(e, t) {
|
|
3949
4151
|
let n = [], r = [], i = [];
|
|
3950
|
-
for (let a of
|
|
3951
|
-
let e =
|
|
4152
|
+
for (let a of Ti(e)) {
|
|
4153
|
+
let e = yi(a);
|
|
3952
4154
|
if (e) {
|
|
3953
4155
|
i.push(...e);
|
|
3954
4156
|
continue;
|
|
3955
4157
|
}
|
|
3956
|
-
r.push(i), i = [], n.push(
|
|
4158
|
+
r.push(i), i = [], n.push(Si(a, t));
|
|
3957
4159
|
}
|
|
3958
4160
|
return r.push(i), {
|
|
3959
4161
|
tracks: n,
|
|
3960
4162
|
lineNames: r
|
|
3961
4163
|
};
|
|
3962
4164
|
}
|
|
3963
|
-
function
|
|
4165
|
+
function yi(e) {
|
|
3964
4166
|
let t = e.match(/^\[(.*)\]$/s);
|
|
3965
4167
|
return t ? t[1].split(/\s+/).filter((e) => e !== "") : null;
|
|
3966
4168
|
}
|
|
3967
|
-
function
|
|
4169
|
+
function bi(e) {
|
|
3968
4170
|
let t = [];
|
|
3969
4171
|
for (let n of e.matchAll(/"([^"]*)"|'([^']*)'/g)) {
|
|
3970
4172
|
let e = (n[1] ?? n[2] ?? "").trim().split(/\s+/).filter((e) => e !== "");
|
|
@@ -3994,23 +4196,23 @@ function ai(e) {
|
|
|
3994
4196
|
areas: r
|
|
3995
4197
|
};
|
|
3996
4198
|
}
|
|
3997
|
-
function
|
|
3998
|
-
let n =
|
|
3999
|
-
return n.length > 0 ? n : [
|
|
4199
|
+
function xi(e, t) {
|
|
4200
|
+
let n = Ti(e.trim()).filter((e) => e !== "" && !e.startsWith("[")).map((e) => Si(e, t));
|
|
4201
|
+
return n.length > 0 ? n : [it()];
|
|
4000
4202
|
}
|
|
4001
|
-
function
|
|
4203
|
+
function Si(e, t) {
|
|
4002
4204
|
let n = e.match(/^minmax\((.*)\)$/s);
|
|
4003
4205
|
if (n) {
|
|
4004
|
-
let e =
|
|
4206
|
+
let e = wi(n[1]).map((e) => e.trim());
|
|
4005
4207
|
return e.length === 2 ? {
|
|
4006
|
-
min:
|
|
4007
|
-
max:
|
|
4208
|
+
min: Ci(e[0], t),
|
|
4209
|
+
max: Ci(e[1], t)
|
|
4008
4210
|
} : {
|
|
4009
4211
|
min: { kind: "auto" },
|
|
4010
4212
|
max: { kind: "auto" }
|
|
4011
4213
|
};
|
|
4012
4214
|
}
|
|
4013
|
-
let r =
|
|
4215
|
+
let r = Ci(e, t);
|
|
4014
4216
|
return r.kind === "fr" ? {
|
|
4015
4217
|
min: { kind: "auto" },
|
|
4016
4218
|
max: r
|
|
@@ -4019,13 +4221,13 @@ function si(e, t) {
|
|
|
4019
4221
|
max: r
|
|
4020
4222
|
};
|
|
4021
4223
|
}
|
|
4022
|
-
function
|
|
4224
|
+
function Ci(e, t) {
|
|
4023
4225
|
if (e === "auto" || e.startsWith("fit-content")) return { kind: "auto" };
|
|
4024
4226
|
if (e === "min-content") return { kind: "min-content" };
|
|
4025
4227
|
if (e === "max-content") return { kind: "max-content" };
|
|
4026
4228
|
let n = e.match(/^(min|max)\((.*)\)$/s);
|
|
4027
4229
|
if (n) {
|
|
4028
|
-
let e =
|
|
4230
|
+
let e = wi(n[2]).map((e) => Ci(e.trim(), t)), r = e.every((e) => e.kind === "cells" || e.kind === "percent" || e.kind === "math");
|
|
4029
4231
|
return e.length > 0 && r ? {
|
|
4030
4232
|
kind: "math",
|
|
4031
4233
|
fn: n[1],
|
|
@@ -4052,7 +4254,7 @@ function ci(e, t) {
|
|
|
4052
4254
|
value: e.endsWith("rem") ? P(r / .25) : F(r, t)
|
|
4053
4255
|
} : { kind: "auto" };
|
|
4054
4256
|
}
|
|
4055
|
-
function
|
|
4257
|
+
function wi(e) {
|
|
4056
4258
|
let t = [], n = 0, r = 0;
|
|
4057
4259
|
for (let i = 0; i < e.length; i++) {
|
|
4058
4260
|
let a = e[i];
|
|
@@ -4060,7 +4262,7 @@ function li(e) {
|
|
|
4060
4262
|
}
|
|
4061
4263
|
return t.push(e.slice(r)), t.filter((e) => e.trim() !== "");
|
|
4062
4264
|
}
|
|
4063
|
-
function
|
|
4265
|
+
function Ti(e) {
|
|
4064
4266
|
let t = [], n = 0, r = -1;
|
|
4065
4267
|
for (let i = 0; i < e.length; i++) {
|
|
4066
4268
|
let a = e[i];
|
|
@@ -4068,7 +4270,7 @@ function ui(e) {
|
|
|
4068
4270
|
}
|
|
4069
4271
|
return r !== -1 && t.push(e.slice(r)), t;
|
|
4070
4272
|
}
|
|
4071
|
-
function
|
|
4273
|
+
function Ei(e) {
|
|
4072
4274
|
let t = e.trim();
|
|
4073
4275
|
if (!t || t === "auto") return { kind: "auto" };
|
|
4074
4276
|
let n = !1, r, i;
|
|
@@ -4096,16 +4298,16 @@ function di(e) {
|
|
|
4096
4298
|
nth: r
|
|
4097
4299
|
};
|
|
4098
4300
|
}
|
|
4099
|
-
function
|
|
4301
|
+
function Di(e) {
|
|
4100
4302
|
return {
|
|
4101
4303
|
direction: e.includes("column") ? "column" : "row",
|
|
4102
4304
|
dense: e.includes("dense")
|
|
4103
4305
|
};
|
|
4104
4306
|
}
|
|
4105
|
-
function
|
|
4307
|
+
function Oi(e, t) {
|
|
4106
4308
|
return (t === "w" ? /(?:^|[\s:.[!])w-/ : /(?:^|[\s:.[!])h-/).test(e);
|
|
4107
4309
|
}
|
|
4108
|
-
function
|
|
4310
|
+
function ki(e, t) {
|
|
4109
4311
|
return {
|
|
4110
4312
|
top: $(e.getPropertyValue("padding-top"), t),
|
|
4111
4313
|
right: $(e.getPropertyValue("padding-right"), t),
|
|
@@ -4113,7 +4315,7 @@ function mi(e, t) {
|
|
|
4113
4315
|
left: $(e.getPropertyValue("padding-left"), t)
|
|
4114
4316
|
};
|
|
4115
4317
|
}
|
|
4116
|
-
function
|
|
4318
|
+
function Ai(e) {
|
|
4117
4319
|
let t = (t, n) => e.getPropertyValue(n) === "none" ? 0 : P(parseFloat(e.getPropertyValue(t)) || 0);
|
|
4118
4320
|
return {
|
|
4119
4321
|
top: t("border-top-width", "border-top-style"),
|
|
@@ -4124,14 +4326,14 @@ function hi(e) {
|
|
|
4124
4326
|
}
|
|
4125
4327
|
//#endregion
|
|
4126
4328
|
//#region src/tree.ts
|
|
4127
|
-
function
|
|
4128
|
-
let i =
|
|
4329
|
+
function ji(e, t, n, r) {
|
|
4330
|
+
let i = kr(e, t, n);
|
|
4129
4331
|
if (i.display === "none") return null;
|
|
4130
|
-
let a =
|
|
4131
|
-
if (a) return
|
|
4132
|
-
let o = Array.from(e.children), s = o.map(
|
|
4332
|
+
let a = ie(e.tagName);
|
|
4333
|
+
if (a) return Mi(e, i, a);
|
|
4334
|
+
let o = Array.from(e.children), s = o.map(Li), c = e.tagName, l = Ji(c);
|
|
4133
4335
|
if (!s.includes("block") || l) {
|
|
4134
|
-
let a =
|
|
4336
|
+
let a = Ri(e, i.tracking, {
|
|
4135
4337
|
rootFontSizePx: t,
|
|
4136
4338
|
rootLetterSpacingPx: n?.letterSpacing ?? 0,
|
|
4137
4339
|
cellMetrics: n,
|
|
@@ -4140,12 +4342,12 @@ function gi(e, t, n, r) {
|
|
|
4140
4342
|
tabSize: i.tabSize
|
|
4141
4343
|
}), u = a.chars.join("");
|
|
4142
4344
|
if (a.boxes.length > 0) {
|
|
4143
|
-
let e =
|
|
4144
|
-
|
|
4345
|
+
let e = In();
|
|
4346
|
+
Pe(a.chars, (t, n) => {
|
|
4145
4347
|
a.advances[t] = Math.max(1, J(a.boxes[n], e));
|
|
4146
4348
|
});
|
|
4147
4349
|
}
|
|
4148
|
-
let d =
|
|
4350
|
+
let d = Ui(u, a.advances, i.tracking);
|
|
4149
4351
|
if (l && d === 0) {
|
|
4150
4352
|
if (c === "INPUT") d = Number(e.size) || 20;
|
|
4151
4353
|
else if (c === "TEXTAREA") d = Number(e.cols) || 20;
|
|
@@ -4154,9 +4356,9 @@ function gi(e, t, n, r) {
|
|
|
4154
4356
|
d = Math.max(1, ...r.map((e) => e.trim().length));
|
|
4155
4357
|
}
|
|
4156
4358
|
}
|
|
4157
|
-
let f = u.length > 0 ?
|
|
4359
|
+
let f = u.length > 0 ? Wi(u) : 0, p;
|
|
4158
4360
|
if (c === "TEXTAREA") {
|
|
4159
|
-
let t = e, n = t.value ?? "", a = r?.get(t), o = +!!n.endsWith("\n"), s = a !== void 0 && a > 0 ?
|
|
4361
|
+
let t = e, n = t.value ?? "", a = r?.get(t), o = +!!n.endsWith("\n"), s = a !== void 0 && a > 0 ? De(n, a) + o : n === "" ? 0 : n.split(/\r\n?|\n/).length, c = getComputedStyle(e).getPropertyValue("field-sizing") === "content" ? 1 : Number(t.rows) || 2, l = Math.max(c, s);
|
|
4160
4362
|
p = l + Math.max(0, l - 1) * i.lineGap;
|
|
4161
4363
|
} else p = l ? Math.max(1, f) : f;
|
|
4162
4364
|
let m = /* @__PURE__ */ new Map(), h = [];
|
|
@@ -4166,7 +4368,7 @@ function gi(e, t, n, r) {
|
|
|
4166
4368
|
let i = o[e], a = m.get(i);
|
|
4167
4369
|
if (a) g.push(a);
|
|
4168
4370
|
else if (s[e] === "out-of-flow") {
|
|
4169
|
-
let e =
|
|
4371
|
+
let e = ji(i, t, n, r);
|
|
4170
4372
|
e && g.push(e);
|
|
4171
4373
|
}
|
|
4172
4374
|
}
|
|
@@ -4185,14 +4387,14 @@ function gi(e, t, n, r) {
|
|
|
4185
4387
|
height: p
|
|
4186
4388
|
},
|
|
4187
4389
|
unclampedHeight: 0,
|
|
4188
|
-
resolvedPadding:
|
|
4390
|
+
resolvedPadding: rt()
|
|
4189
4391
|
};
|
|
4190
4392
|
return (a.advances.some((e) => e !== 1) || a.boxes.length > 0) && (_.advances = a.advances), a.inlineElements.length > 0 && (_.inlineElements = a.inlineElements, _.charInline = a.chars.map((e, t) => a.inlineIndex[t] ?? -1)), _;
|
|
4191
4393
|
}
|
|
4192
4394
|
let u = [];
|
|
4193
4395
|
for (let e = 0; e < o.length; e++) {
|
|
4194
4396
|
if (s[e] === "none") continue;
|
|
4195
|
-
let i =
|
|
4397
|
+
let i = ji(o[e], t, n, r);
|
|
4196
4398
|
i && u.push(i);
|
|
4197
4399
|
}
|
|
4198
4400
|
let d = {
|
|
@@ -4209,14 +4411,14 @@ function gi(e, t, n, r) {
|
|
|
4209
4411
|
height: 0
|
|
4210
4412
|
},
|
|
4211
4413
|
unclampedHeight: 0,
|
|
4212
|
-
resolvedPadding:
|
|
4414
|
+
resolvedPadding: rt()
|
|
4213
4415
|
};
|
|
4214
|
-
return
|
|
4416
|
+
return Yi(e, d), d;
|
|
4215
4417
|
}
|
|
4216
|
-
function
|
|
4217
|
-
let r =
|
|
4418
|
+
function Mi(e, t, n) {
|
|
4419
|
+
let r = se(n, e), i = r?.lines ?? [], a = i.join("\n");
|
|
4218
4420
|
t.whiteSpace = "pre", (t.width === void 0 || t.width.kind === "auto") && (t.width = { kind: "max-content" });
|
|
4219
|
-
let o = Array.from({ length: a.length }, () => 1 + t.tracking), s =
|
|
4421
|
+
let o = Array.from({ length: a.length }, () => 1 + t.tracking), s = Ui(a, o, t.tracking), c = i.length, l = {
|
|
4220
4422
|
source: e,
|
|
4221
4423
|
style: t,
|
|
4222
4424
|
children: [],
|
|
@@ -4230,7 +4432,7 @@ function _i(e, t, n) {
|
|
|
4230
4432
|
height: c
|
|
4231
4433
|
},
|
|
4232
4434
|
unclampedHeight: 0,
|
|
4233
|
-
resolvedPadding:
|
|
4435
|
+
resolvedPadding: rt()
|
|
4234
4436
|
};
|
|
4235
4437
|
t.tracking > 0 && (l.advances = o);
|
|
4236
4438
|
let u = r?.runs ?? [];
|
|
@@ -4258,23 +4460,23 @@ function _i(e, t, n) {
|
|
|
4258
4460
|
}
|
|
4259
4461
|
return l;
|
|
4260
4462
|
}
|
|
4261
|
-
var
|
|
4262
|
-
function
|
|
4263
|
-
return t || (
|
|
4463
|
+
var Ni = /* @__PURE__ */ new Set(/* @__PURE__ */ "A.ABBR.B.BDI.BDO.BR.CITE.CODE.DATA.DFN.EM.I.KBD.MARK.Q.S.SAMP.SMALL.SPAN.STRONG.SUB.SUP.TIME.U.VAR.WBR".split("."));
|
|
4464
|
+
function Pi(e, t) {
|
|
4465
|
+
return t || (Ni.has(e.tagName) ? "inline" : "block");
|
|
4264
4466
|
}
|
|
4265
|
-
function
|
|
4266
|
-
let n =
|
|
4467
|
+
function Fi(e, t) {
|
|
4468
|
+
let n = Pi(e, t);
|
|
4267
4469
|
return n === "inline" || n === "contents";
|
|
4268
4470
|
}
|
|
4269
|
-
function
|
|
4270
|
-
let n =
|
|
4471
|
+
function Ii(e, t) {
|
|
4472
|
+
let n = Pi(e, t);
|
|
4271
4473
|
return n.startsWith("inline") && n !== "inline";
|
|
4272
4474
|
}
|
|
4273
|
-
function
|
|
4475
|
+
function Li(e) {
|
|
4274
4476
|
let t = getComputedStyle(e);
|
|
4275
|
-
return t.display === "none" ? "none" : t.position === "absolute" || t.position === "fixed" ? "out-of-flow" :
|
|
4477
|
+
return t.display === "none" ? "none" : t.position === "absolute" || t.position === "fixed" ? "out-of-flow" : ie(e.tagName) ? "block" : Fi(e, t.display) || Ii(e, t.display) ? "inline" : "block";
|
|
4276
4478
|
}
|
|
4277
|
-
function
|
|
4479
|
+
function Ri(e, t, n) {
|
|
4278
4480
|
let r = {
|
|
4279
4481
|
chars: [],
|
|
4280
4482
|
advances: [],
|
|
@@ -4282,15 +4484,15 @@ function Ci(e, t, n) {
|
|
|
4282
4484
|
inlineElements: [],
|
|
4283
4485
|
boxes: []
|
|
4284
4486
|
};
|
|
4285
|
-
return
|
|
4487
|
+
return zi(e, t, n, r), n.preserve ? r : Hi(r);
|
|
4286
4488
|
}
|
|
4287
|
-
function
|
|
4489
|
+
function zi(e, t, n, r) {
|
|
4288
4490
|
let i = () => {
|
|
4289
4491
|
let e = 0;
|
|
4290
4492
|
for (let t = r.chars.length - 1; t >= 0 && r.chars[t] !== "\n"; t--) e += r.advances[t];
|
|
4291
4493
|
return e;
|
|
4292
4494
|
};
|
|
4293
|
-
if (!
|
|
4495
|
+
if (!Ji(e.tagName)) {
|
|
4294
4496
|
for (let a of Array.from(e.childNodes)) if (a.nodeType === Node.TEXT_NODE) {
|
|
4295
4497
|
if (n.preserve) for (let e of (a.textContent ?? "").replace(/\r\n?/g, "\n")) if (e === "\n") r.chars.push("\n"), r.advances.push(0);
|
|
4296
4498
|
else if (e === " ") {
|
|
@@ -4306,24 +4508,24 @@ function wi(e, t, n, r) {
|
|
|
4306
4508
|
}
|
|
4307
4509
|
let t = getComputedStyle(e);
|
|
4308
4510
|
if (t.display === "none" || t.position === "absolute" || t.position === "fixed") continue;
|
|
4309
|
-
if (
|
|
4310
|
-
let t =
|
|
4511
|
+
if (Ii(e, t.display)) {
|
|
4512
|
+
let t = ji(e, n.rootFontSizePx, n.cellMetrics, n.textareaWidths);
|
|
4311
4513
|
t && (t.inlineBox = !0, r.chars.push(""), r.advances.push(1), r.boxes.push(t));
|
|
4312
4514
|
continue;
|
|
4313
4515
|
}
|
|
4314
|
-
if (!
|
|
4315
|
-
|
|
4516
|
+
if (!Fi(e, t.display)) {
|
|
4517
|
+
Gi(e);
|
|
4316
4518
|
continue;
|
|
4317
4519
|
}
|
|
4318
|
-
let i =
|
|
4520
|
+
let i = ni(t.letterSpacing, parseFloat(t.fontSize) || n.rootFontSizePx, n.rootLetterSpacingPx), o = Bi(t.paddingLeft, n.rootFontSizePx), s = Bi(t.paddingRight, n.rootFontSizePx);
|
|
4319
4521
|
r.inlineElements.push({
|
|
4320
4522
|
element: e,
|
|
4321
4523
|
tracking: i,
|
|
4322
4524
|
padLeft: o,
|
|
4323
4525
|
padRight: s,
|
|
4324
|
-
insets: t.position === "static" ? null :
|
|
4526
|
+
insets: t.position === "static" ? null : Vi(t, n.rootFontSizePx),
|
|
4325
4527
|
color: t.color,
|
|
4326
|
-
backgroundColor:
|
|
4528
|
+
backgroundColor: jr(t.backgroundColor) ? void 0 : t.backgroundColor,
|
|
4327
4529
|
fontWeight: t.fontWeight,
|
|
4328
4530
|
fontStyle: t.fontStyle,
|
|
4329
4531
|
textDecorationLine: t.textDecorationLine
|
|
@@ -4331,18 +4533,18 @@ function wi(e, t, n, r) {
|
|
|
4331
4533
|
let c = r.inlineElements.length - 1;
|
|
4332
4534
|
for (let e = 0; e < o; e++) r.inlineIndex[r.chars.length] = c, r.chars.push(""), r.advances.push(1);
|
|
4333
4535
|
let l = r.chars.length;
|
|
4334
|
-
|
|
4536
|
+
zi(e, i, n, r);
|
|
4335
4537
|
for (let e = l; e < r.chars.length; e++) r.inlineIndex[e] === void 0 && (r.inlineIndex[e] = c);
|
|
4336
4538
|
for (let e = 0; e < s; e++) r.inlineIndex[r.chars.length] = c, r.chars.push(""), r.advances.push(1);
|
|
4337
4539
|
}
|
|
4338
4540
|
}
|
|
4339
4541
|
}
|
|
4340
|
-
function
|
|
4542
|
+
function Bi(e, t) {
|
|
4341
4543
|
if (!e || e.endsWith("%")) return 0;
|
|
4342
4544
|
let n = parseFloat(e);
|
|
4343
4545
|
return Number.isFinite(n) ? Math.max(0, F(n, t)) : 0;
|
|
4344
4546
|
}
|
|
4345
|
-
function
|
|
4547
|
+
function Vi(e, t) {
|
|
4346
4548
|
let n = (e) => {
|
|
4347
4549
|
if (!e || e === "auto" || e.endsWith("%")) return null;
|
|
4348
4550
|
let n = parseFloat(e);
|
|
@@ -4355,7 +4557,7 @@ function Ei(e, t) {
|
|
|
4355
4557
|
left: n(e.left)
|
|
4356
4558
|
};
|
|
4357
4559
|
}
|
|
4358
|
-
function
|
|
4560
|
+
function Hi(e) {
|
|
4359
4561
|
let t = [], n = [], r = [], i = () => {
|
|
4360
4562
|
let e = t.length;
|
|
4361
4563
|
for (; e > 0 && t[e - 1] !== "\n";) e--;
|
|
@@ -4380,30 +4582,30 @@ function Di(e) {
|
|
|
4380
4582
|
boxes: e.boxes
|
|
4381
4583
|
};
|
|
4382
4584
|
}
|
|
4383
|
-
function
|
|
4585
|
+
function Ui(e, t, n) {
|
|
4384
4586
|
let r = 0, i = 0;
|
|
4385
4587
|
for (let a = 0; a <= e.length; a++) (a === e.length || e[a] === "\n") && (r = Math.max(r, I(i, a, t, n)), i = a + 1);
|
|
4386
4588
|
return r;
|
|
4387
4589
|
}
|
|
4388
|
-
function
|
|
4389
|
-
return
|
|
4590
|
+
function Wi(e) {
|
|
4591
|
+
return ke(e).length;
|
|
4390
4592
|
}
|
|
4391
|
-
function
|
|
4392
|
-
|
|
4593
|
+
function Gi(e) {
|
|
4594
|
+
N(e, "A block-level element nested inside a text run can't be laid out and was skipped. Give it its own place in the layout instead.");
|
|
4393
4595
|
}
|
|
4394
|
-
function
|
|
4596
|
+
function Ki(e) {
|
|
4395
4597
|
return Array.from(e.childNodes).some((e) => e.nodeType === Node.TEXT_NODE && /[^ \t\r\n\f]/.test(e.textContent ?? ""));
|
|
4396
4598
|
}
|
|
4397
|
-
var
|
|
4398
|
-
function
|
|
4599
|
+
var qi = "Direct text next to block-level children can't be laid out and was hidden. Wrap each text segment in its own element (e.g. a <div>).";
|
|
4600
|
+
function Ji(e) {
|
|
4399
4601
|
return e === "INPUT" || e === "SELECT" || e === "TEXTAREA";
|
|
4400
4602
|
}
|
|
4401
|
-
function
|
|
4402
|
-
|
|
4603
|
+
function Yi(e, t) {
|
|
4604
|
+
Ki(e) && (t.droppedText = !0, N(e, qi));
|
|
4403
4605
|
}
|
|
4404
4606
|
//#endregion
|
|
4405
4607
|
//#region src/element.ts
|
|
4406
|
-
var
|
|
4608
|
+
var Xi = "\n<style>\n :host { display: block; position: relative; contain: layout style; }\n #viewport { position: relative; width: 100%; height: 100%; background: inherit; }\n /* When the host hides its own dropped direct text (visibility, see\n * styles.css), the render layer must not sink with it. Scoped to that\n * state so an authored 'invisible' on the host stays intact. */\n :host([data-mw-dropped-text]) #viewport { visibility: visible; }\n /* The unified grid: one <pre> with same-paint-run spans, cell-precise\n * (one monospace character = one cell). In select=\"grid\" (the\n * default, reflected onto the attribute — see DEFAULT_SELECT) the\n * grid catches drags for native selection of the ASCII; interactive\n * elements opt back into pointer-events via styles.css so clicks\n * still work. In select=\"text\" the grid is inert to events and drag\n * selects the light DOM natively. */\n /* Sized by the engine's ink extent (element.ts), not the host box:\n * visible overflow paints past the host (specs/cell-model.md\n * \"Overflow\"), and the host's background follows it there — the\n * host is the canvas, as the root element's background covers a\n * document's overflow — inherited through #viewport, the shadow\n * parent. (A translucent host background paints repeatedly inside\n * the box.) */\n #grid { position: absolute; top: 0; left: 0; margin: 0; background: inherit; font: inherit; line-height: inherit; letter-spacing: inherit; white-space: pre; pointer-events: none; user-select: none; -webkit-user-select: none; }\n :host([select=\"grid\"]) #grid { pointer-events: auto; user-select: text; -webkit-user-select: text; }\n :host([select=\"grid\"]) slot { pointer-events: none; user-select: none; -webkit-user-select: none; }\n /* Selection invert — mirror of the canonical rule in styles.css\n * (which explains the field choices); update together. */\n ::selection { color: var(--mw-bg, canvas); text-shadow: 0 0 0 var(--mw-bg, canvas); background: var(--mw-fg, canvastext); }\n</style>\n<div id=\"viewport\">\n <pre id=\"grid\" aria-hidden=\"true\"></pre>\n <slot></slot>\n</div>\n", Zi = "grid", Qi = [
|
|
4407
4609
|
"pointerover",
|
|
4408
4610
|
"pointerleave",
|
|
4409
4611
|
"pointerdown",
|
|
@@ -4415,12 +4617,12 @@ var Fi = "\n<style>\n :host { display: block; position: relative; contain: layo
|
|
|
4415
4617
|
"focusout",
|
|
4416
4618
|
"input",
|
|
4417
4619
|
"change"
|
|
4418
|
-
],
|
|
4620
|
+
], $i = /^(color|opacity|border-(top|right|bottom|left)-color|border-color)$/, ea = 3e4, ta = 200, na = 3, ra = 4, ia = 8, aa = 160, oa = typeof HTMLElement > "u" ? class {} : HTMLElement, sa = class e extends oa {
|
|
4419
4621
|
static observedAttributes = ["select"];
|
|
4420
4622
|
static #e = /* @__PURE__ */ new Set();
|
|
4421
4623
|
static #t = null;
|
|
4422
4624
|
static #n = () => {
|
|
4423
|
-
for (let t of e.#e) t.#
|
|
4625
|
+
for (let t of e.#e) t.#se();
|
|
4424
4626
|
};
|
|
4425
4627
|
static #r(t) {
|
|
4426
4628
|
t instanceof HTMLLinkElement && t.rel === "stylesheet" && !t.sheet && t.addEventListener("load", e.#n, { once: !0 });
|
|
@@ -4451,7 +4653,13 @@ var Fi = "\n<style>\n :host { display: block; position: relative; contain: layo
|
|
|
4451
4653
|
#p = null;
|
|
4452
4654
|
#m = null;
|
|
4453
4655
|
#h = null;
|
|
4454
|
-
#g
|
|
4656
|
+
#g = !1;
|
|
4657
|
+
#_ = [];
|
|
4658
|
+
#v = /* @__PURE__ */ new Map();
|
|
4659
|
+
#y = /* @__PURE__ */ new WeakMap();
|
|
4660
|
+
#b = null;
|
|
4661
|
+
#x = null;
|
|
4662
|
+
#S() {
|
|
4455
4663
|
this.#u?.observe(this, {
|
|
4456
4664
|
childList: !0,
|
|
4457
4665
|
subtree: !0,
|
|
@@ -4463,89 +4671,273 @@ var Fi = "\n<style>\n :host { display: block; position: relative; contain: layo
|
|
|
4463
4671
|
"colspan",
|
|
4464
4672
|
"rowspan",
|
|
4465
4673
|
"span",
|
|
4466
|
-
...
|
|
4674
|
+
...ae()
|
|
4467
4675
|
]
|
|
4468
4676
|
});
|
|
4469
4677
|
}
|
|
4470
4678
|
constructor() {
|
|
4471
|
-
super(), this.#o = this.attachShadow({ mode: "open" }), this.#o.innerHTML =
|
|
4679
|
+
super(), this.#o = this.attachShadow({ mode: "open" }), this.#o.innerHTML = Xi, this.#s = this.#o.getElementById("grid"), this.#c = document.createElement("span"), this.#c.setAttribute("aria-hidden", "true"), this.#c.setAttribute("data-mw-probe", ""), this.#c.style.cssText = "position:absolute!important;top:0!important;left:0!important;visibility:hidden!important;pointer-events:none!important;user-select:none!important;white-space:pre!important;overflow-wrap:normal!important;padding:0!important;margin:0!important;border:0!important;", this.#c.textContent = "M".repeat(100);
|
|
4472
4680
|
}
|
|
4473
4681
|
connectedCallback() {
|
|
4474
|
-
this.hasAttribute("select") || this.setAttribute("select",
|
|
4475
|
-
this.#
|
|
4476
|
-
}), this.#h = C(() => this.#
|
|
4682
|
+
this.hasAttribute("select") || this.setAttribute("select", Zi), this.#c.parentNode !== this && this.appendChild(this.#c), this.#l = new ResizeObserver(() => this.#se()), this.#l.observe(this), this.#l.observe(this.#c), window.addEventListener("resize", this.#re), this.#u = new MutationObserver(() => this.#se()), this.#S(), this.#m = oe(() => {
|
|
4683
|
+
this.#S(), this.#se();
|
|
4684
|
+
}), this.#h = C(() => this.#se()), document.fonts?.ready.then(this.#ie).catch((e) => {
|
|
4477
4685
|
console.warn("[monowind] document.fonts.ready failed:", e);
|
|
4478
|
-
}), document.fonts?.addEventListener("loadingdone", this.#
|
|
4479
|
-
for (let e of
|
|
4480
|
-
this.addEventListener("transitionrun", this
|
|
4686
|
+
}), document.fonts?.addEventListener("loadingdone", this.#ie);
|
|
4687
|
+
for (let e of Qi) this.addEventListener(e, this.#ne);
|
|
4688
|
+
this.addEventListener("transitionrun", this.#$), this.addEventListener("transitionend", this.#ee), this.addEventListener("transitioncancel", this.#ee), this.addEventListener("pointermove", this.#U), this.addEventListener("pointerleave", this.#W), this.addEventListener("pointerdown", this.#G), this.addEventListener("scroll", this.#L, {
|
|
4689
|
+
capture: !0,
|
|
4690
|
+
passive: !0
|
|
4691
|
+
}), this.addEventListener("scrollend", this.#R, { capture: !0 }), this.addEventListener("wheel", this.#B, { passive: !1 }), window.addEventListener("pointerup", this.#K), window.addEventListener("pointercancel", this.#K), document.addEventListener("scroll", this.#q, {
|
|
4481
4692
|
capture: !0,
|
|
4482
4693
|
passive: !0
|
|
4483
|
-
}), e.#i(this), this.#
|
|
4694
|
+
}), e.#i(this), this.#se();
|
|
4484
4695
|
}
|
|
4485
4696
|
disconnectedCallback() {
|
|
4486
|
-
window.removeEventListener("resize", this.#
|
|
4487
|
-
for (let e of
|
|
4488
|
-
this.removeEventListener("transitionrun", this
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
#
|
|
4493
|
-
#
|
|
4494
|
-
#x = !1;
|
|
4495
|
-
#S = null;
|
|
4496
|
-
#C = NaN;
|
|
4497
|
-
#w = NaN;
|
|
4697
|
+
window.removeEventListener("resize", this.#re), this.#l?.disconnect(), this.#u?.disconnect(), this.#l = null, this.#u = null, this.#m?.(), this.#m = null, this.#h?.(), this.#h = null, document.fonts?.removeEventListener("loadingdone", this.#ie);
|
|
4698
|
+
for (let e of Qi) this.removeEventListener(e, this.#ne);
|
|
4699
|
+
this.removeEventListener("transitionrun", this.#$), this.removeEventListener("transitionend", this.#ee), this.removeEventListener("transitioncancel", this.#ee), this.#X = 0, this.removeEventListener("pointermove", this.#U), this.removeEventListener("pointerleave", this.#W), this.removeEventListener("pointerdown", this.#G), this.removeEventListener("scroll", this.#L, { capture: !0 }), this.removeEventListener("scrollend", this.#R, { capture: !0 }), this.removeEventListener("wheel", this.#B);
|
|
4700
|
+
for (let e of this.#v.values()) clearTimeout(e);
|
|
4701
|
+
this.#v.clear(), this.#x = null, this.#b = null, window.removeEventListener("pointerup", this.#K), window.removeEventListener("pointercancel", this.#K), document.removeEventListener("scroll", this.#q, { capture: !0 }), this.#O = null, this.#T = null, this.#E = !1, this.#D = !1, this.#J(), e.#a(this);
|
|
4702
|
+
}
|
|
4703
|
+
#C = /* @__PURE__ */ new Set();
|
|
4704
|
+
#w = /* @__PURE__ */ new Set();
|
|
4498
4705
|
#T = null;
|
|
4499
|
-
|
|
4500
|
-
#D =
|
|
4501
|
-
|
|
4502
|
-
|
|
4706
|
+
#E = !1;
|
|
4707
|
+
#D = !1;
|
|
4708
|
+
#O = null;
|
|
4709
|
+
#k = NaN;
|
|
4710
|
+
#A = NaN;
|
|
4711
|
+
#j = null;
|
|
4712
|
+
static #M = typeof matchMedia > "u" ? null : matchMedia("(hover: hover)");
|
|
4713
|
+
#N() {
|
|
4714
|
+
if (this.#g || this.#d) return;
|
|
4715
|
+
this.#g = !0;
|
|
4716
|
+
let e = !1, t = () => {
|
|
4717
|
+
if (e) return;
|
|
4718
|
+
e = !0, this.#g = !1;
|
|
4719
|
+
let t = this.#f;
|
|
4720
|
+
!this.isConnected || !this.#p || !t || (this.#P(t), this.#D = !gr(this.#p, this.#s, this.#E), this.#J());
|
|
4721
|
+
};
|
|
4722
|
+
requestAnimationFrame(t), setTimeout(t, 50);
|
|
4723
|
+
}
|
|
4724
|
+
#P(e, t) {
|
|
4725
|
+
for (let n of this.#_) {
|
|
4726
|
+
let r = n.source, { maxX: i, maxY: a } = n.scrollRange, o = t?.get(r);
|
|
4727
|
+
n.scroll = o ? {
|
|
4728
|
+
x: o.pinX ? i : Math.min(o.x, i),
|
|
4729
|
+
y: o.pinY ? a : Math.min(o.y, a)
|
|
4730
|
+
} : {
|
|
4731
|
+
x: la(r, "x", e.width, i),
|
|
4732
|
+
y: la(r, "y", e.height, a)
|
|
4733
|
+
};
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
#F() {
|
|
4737
|
+
let e = /* @__PURE__ */ new Map(), t = this.#f;
|
|
4738
|
+
if (!t) return e;
|
|
4739
|
+
for (let n of this.#_) {
|
|
4740
|
+
let r = n.source, { maxX: i, maxY: a } = n.scrollRange, o = la(r, "x", t.width, i), s = la(r, "y", t.height, a);
|
|
4741
|
+
e.set(r, {
|
|
4742
|
+
top: r.scrollTop,
|
|
4743
|
+
left: r.scrollLeft,
|
|
4744
|
+
x: o,
|
|
4745
|
+
y: s,
|
|
4746
|
+
pinX: i > 0 && o >= i,
|
|
4747
|
+
pinY: a > 0 && s >= a
|
|
4748
|
+
});
|
|
4749
|
+
}
|
|
4750
|
+
return e;
|
|
4751
|
+
}
|
|
4752
|
+
#I(e) {
|
|
4753
|
+
for (let t of this.#_) {
|
|
4754
|
+
let n = t.source, r = e.get(n);
|
|
4755
|
+
r && (n.scrollTop = r.pinY ? n.scrollHeight : r.top, n.scrollLeft = r.pinX ? n.scrollWidth : r.left, n.scrollTop, n.scrollLeft);
|
|
4756
|
+
}
|
|
4757
|
+
}
|
|
4758
|
+
#L = (e) => {
|
|
4759
|
+
let t = e.target;
|
|
4760
|
+
!(t instanceof HTMLElement) || t === this || t.hasAttribute("data-mw-scroll") && (this.#N(), "onscrollend" in window || (clearTimeout(this.#v.get(t)), this.#v.set(t, setTimeout(() => this.#z(t), aa))));
|
|
4761
|
+
};
|
|
4762
|
+
#R = (e) => {
|
|
4763
|
+
let t = e.target;
|
|
4764
|
+
!(t instanceof HTMLElement) || t === this || t.hasAttribute("data-mw-scroll") && (Date.now() - (this.#y.get(t) ?? 0) < ta || this.#z(t));
|
|
4765
|
+
};
|
|
4766
|
+
#z(e) {
|
|
4767
|
+
if (this.#x?.el === e) return;
|
|
4768
|
+
this.#N();
|
|
4769
|
+
let t = this.#f, n = this.#_.find((t) => t.source === e);
|
|
4770
|
+
if (!t || !n) return;
|
|
4771
|
+
let r = n.scrollRange, i = (e, t, n, r) => {
|
|
4772
|
+
let i = Math.min(Math.max(0, Math.round(e / t)), n);
|
|
4773
|
+
return i === n ? r : i * t;
|
|
4774
|
+
}, a = i(e.scrollTop, t.height, r.maxY, e.scrollHeight - e.clientHeight), o = i(e.scrollLeft, t.width, r.maxX, e.scrollWidth - e.clientWidth);
|
|
4775
|
+
(Math.abs(e.scrollTop - a) > .5 || Math.abs(e.scrollLeft - o) > .5) && e.scrollTo({
|
|
4776
|
+
top: a,
|
|
4777
|
+
left: o,
|
|
4778
|
+
behavior: "instant"
|
|
4779
|
+
});
|
|
4780
|
+
}
|
|
4781
|
+
#B = (e) => {
|
|
4782
|
+
if (this.getAttribute("select") !== "grid") return;
|
|
4783
|
+
let t = this.#p, n = this.#f;
|
|
4784
|
+
if (!t || !n || this.#_.length === 0) return;
|
|
4785
|
+
let r = e;
|
|
4786
|
+
if (!r.cancelable) return;
|
|
4787
|
+
let { col: i, row: a } = this.#V(r.clientX, r.clientY, n), o = r.deltaMode === 1 ? n.height : r.deltaMode === 2 ? this.clientHeight : 1, s = r.deltaX * o, c = r.deltaY * o, l = Date.now(), u = Math.abs(s) + Math.abs(c);
|
|
4788
|
+
if (u === 0) {
|
|
4789
|
+
this.#b = null;
|
|
4790
|
+
return;
|
|
4791
|
+
}
|
|
4792
|
+
let d = (e) => {
|
|
4793
|
+
let t = e.scrollRange, n = e.source;
|
|
4794
|
+
return c !== 0 && t.maxY > 0 && (c > 0 && n.scrollTop < n.scrollHeight - n.clientHeight - .5 || c < 0 && n.scrollTop > .5) || s !== 0 && t.maxX > 0 && (s > 0 && n.scrollLeft < n.scrollWidth - n.clientWidth - .5 || s < 0 && n.scrollLeft > .5);
|
|
4795
|
+
}, f = this.#b, p = Math.abs(s) >= Math.abs(c) ? "x" : "y", m = f !== null && u > f.mag * 1.25 + 1, h = f !== null && (Math.abs(r.clientX - f.x) > na || Math.abs(r.clientY - f.y) > na), g = f !== null && f.decayed >= ia, _ = f !== null && l - f.at < ta && p === f.axis && (h ? u <= f.mag : !(g && m)), v = null;
|
|
4796
|
+
if (_) {
|
|
4797
|
+
if (f.decayed = u <= f.mag && u >= f.mag * .5 ? f.decayed + 1 : g ? f.decayed : 0, f.mag = u, f.at = l, !f.el) return;
|
|
4798
|
+
v = this.#_.find((e) => e.source === f.el) ?? null;
|
|
4799
|
+
}
|
|
4800
|
+
if (!v) {
|
|
4801
|
+
let e = xe(t, i, a);
|
|
4802
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
4803
|
+
let n = e[t].node;
|
|
4804
|
+
if (!n.scrollRange) continue;
|
|
4805
|
+
if (d(n)) {
|
|
4806
|
+
v = n;
|
|
4807
|
+
break;
|
|
4808
|
+
}
|
|
4809
|
+
let r = n.style.overscroll;
|
|
4810
|
+
if (c !== 0 && !r.y || s !== 0 && !r.x) {
|
|
4811
|
+
v = n;
|
|
4812
|
+
break;
|
|
4813
|
+
}
|
|
4814
|
+
}
|
|
4815
|
+
if (!v && u < ra) {
|
|
4816
|
+
r.preventDefault();
|
|
4817
|
+
return;
|
|
4818
|
+
}
|
|
4819
|
+
this.#b = {
|
|
4820
|
+
el: v ? v.source : null,
|
|
4821
|
+
x: r.clientX,
|
|
4822
|
+
y: r.clientY,
|
|
4823
|
+
axis: p,
|
|
4824
|
+
at: l,
|
|
4825
|
+
mag: u,
|
|
4826
|
+
decayed: 0
|
|
4827
|
+
};
|
|
4828
|
+
}
|
|
4829
|
+
if (!v || (r.preventDefault(), !d(v))) return;
|
|
4830
|
+
let y = v.source, b = v.scrollRange, x = { behavior: "instant" };
|
|
4831
|
+
c !== 0 && b.maxY > 0 && (x.top = c), s !== 0 && b.maxX > 0 && (x.left = s), y.scrollBy(x), this.#y.set(y, l), clearTimeout(this.#v.get(y)), this.#v.set(y, setTimeout(() => this.#z(y), ta));
|
|
4832
|
+
};
|
|
4833
|
+
#V(e, t, n) {
|
|
4834
|
+
if (!this.#j) {
|
|
4835
|
+
let e = this.#s.getBoundingClientRect();
|
|
4836
|
+
this.#j = {
|
|
4837
|
+
left: e.left,
|
|
4838
|
+
top: e.top
|
|
4839
|
+
};
|
|
4840
|
+
}
|
|
4841
|
+
return {
|
|
4842
|
+
col: Math.floor((e - this.#j.left) / n.width),
|
|
4843
|
+
row: Math.floor((t - this.#j.top) / n.height)
|
|
4844
|
+
};
|
|
4845
|
+
}
|
|
4846
|
+
#H(e, t) {
|
|
4847
|
+
let n = this.#p, r = this.#f;
|
|
4848
|
+
if (!n || !r || this.#_.length === 0) return null;
|
|
4849
|
+
let { col: i, row: a } = this.#V(e, t, r), o = xe(n, i, a);
|
|
4850
|
+
for (let n = o.length - 1; n >= 0; n--) {
|
|
4851
|
+
let { node: s, x: c, y: l } = o[n], u = s.scrollRange;
|
|
4852
|
+
if (!u) continue;
|
|
4853
|
+
let d = s.style, f = s.scrollGutterCells;
|
|
4854
|
+
if (!f || f.right === 0 && f.bottom === 0) continue;
|
|
4855
|
+
let p = s.source, m = l + d.border.top, h = c + d.border.left, g = l + s.localRect.height - d.border.bottom, _ = c + s.localRect.width - d.border.right;
|
|
4856
|
+
if (f.right > 0 && u.maxY > 0 && i >= _ - f.right && i < _ && a >= m && a < g) {
|
|
4857
|
+
let e = g - m - f.bottom, n = dr(e, u.sizeY, u.maxY, 0).len, i = Math.max(1, (e - n) * r.height);
|
|
4858
|
+
return {
|
|
4859
|
+
el: p,
|
|
4860
|
+
axis: "y",
|
|
4861
|
+
startClient: t,
|
|
4862
|
+
startPx: p.scrollTop,
|
|
4863
|
+
factor: u.maxY * r.height / i
|
|
4864
|
+
};
|
|
4865
|
+
}
|
|
4866
|
+
if (f.bottom > 0 && u.maxX > 0 && a >= g - f.bottom && a < g && i >= h && i < _) {
|
|
4867
|
+
let t = _ - h - f.right, n = dr(t, u.sizeX, u.maxX, 0).len, i = Math.max(1, (t - n) * r.width);
|
|
4868
|
+
return {
|
|
4869
|
+
el: p,
|
|
4870
|
+
axis: "x",
|
|
4871
|
+
startClient: e,
|
|
4872
|
+
startPx: p.scrollLeft,
|
|
4873
|
+
factor: u.maxX * r.width / i
|
|
4874
|
+
};
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
return null;
|
|
4878
|
+
}
|
|
4879
|
+
#U = (e) => {
|
|
4880
|
+
let { clientX: t, clientY: n } = e, r = this.#x;
|
|
4881
|
+
if (r) {
|
|
4882
|
+
let e = (r.axis === "y" ? n : t) - r.startClient, i = r.startPx + e * r.factor;
|
|
4883
|
+
r.axis === "y" ? r.el.scrollTop = i : r.el.scrollLeft = i;
|
|
4884
|
+
return;
|
|
4885
|
+
}
|
|
4886
|
+
this.#O = {
|
|
4503
4887
|
x: t,
|
|
4504
4888
|
y: n
|
|
4505
4889
|
};
|
|
4506
|
-
let
|
|
4507
|
-
if (
|
|
4508
|
-
let
|
|
4509
|
-
if (e === this.#
|
|
4890
|
+
let i = this.#f;
|
|
4891
|
+
if (i) {
|
|
4892
|
+
let { col: e, row: r } = this.#V(t, n, i);
|
|
4893
|
+
if (e === this.#k && r === this.#A) return;
|
|
4510
4894
|
}
|
|
4511
|
-
this.#
|
|
4895
|
+
this.#J();
|
|
4512
4896
|
};
|
|
4513
|
-
#
|
|
4514
|
-
this.#
|
|
4897
|
+
#W = () => {
|
|
4898
|
+
this.#O = null, this.#J();
|
|
4515
4899
|
};
|
|
4516
|
-
#
|
|
4900
|
+
#G = (e) => {
|
|
4517
4901
|
let t = e;
|
|
4518
|
-
!t.isPrimary || t.button !== 0
|
|
4902
|
+
if (!t.isPrimary || t.button !== 0) return;
|
|
4903
|
+
let n = t.pointerType === "touch" ? null : this.#H(t.clientX, t.clientY);
|
|
4904
|
+
if (n) {
|
|
4905
|
+
this.#x = n, t.preventDefault(), t.isTrusted && this.setPointerCapture(t.pointerId);
|
|
4906
|
+
return;
|
|
4907
|
+
}
|
|
4908
|
+
this.#O = {
|
|
4519
4909
|
x: t.clientX,
|
|
4520
4910
|
y: t.clientY
|
|
4521
|
-
}, this.#
|
|
4911
|
+
}, this.#E = !0, this.#J(!0);
|
|
4522
4912
|
};
|
|
4523
|
-
#
|
|
4524
|
-
e.isPrimary
|
|
4913
|
+
#K = (e) => {
|
|
4914
|
+
if (e.isPrimary) {
|
|
4915
|
+
if (this.#x) {
|
|
4916
|
+
this.#z(this.#x.el), this.#x = null;
|
|
4917
|
+
return;
|
|
4918
|
+
}
|
|
4919
|
+
!this.#E && !this.#T || (this.#E = !1, this.#T = null, this.#J(), this.#D && this.#se());
|
|
4920
|
+
}
|
|
4525
4921
|
};
|
|
4526
|
-
#
|
|
4527
|
-
|
|
4922
|
+
#q = (e) => {
|
|
4923
|
+
if (!this.#O) return;
|
|
4924
|
+
let t = e.target;
|
|
4925
|
+
t instanceof HTMLElement && t.hasAttribute("data-mw-scroll") || (this.#j = null, this.#J());
|
|
4528
4926
|
};
|
|
4529
|
-
#
|
|
4927
|
+
#J(t = !1) {
|
|
4530
4928
|
let n = this.#p, r = this.#f, i = [];
|
|
4531
|
-
if (this.#
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
left: e.left,
|
|
4536
|
-
top: e.top
|
|
4537
|
-
};
|
|
4538
|
-
}
|
|
4539
|
-
this.#C = Math.floor((this.#S.x - this.#T.left) / r.width), this.#w = Math.floor((this.#S.y - this.#T.top) / r.height), i = be(n, this.#C, this.#w);
|
|
4540
|
-
} else this.#C = NaN, this.#w = NaN;
|
|
4929
|
+
if (this.#O && n && r && this.isConnected && this.getAttribute("select") === "grid" && (this.#E || e.#M?.matches)) {
|
|
4930
|
+
let { col: e, row: t } = this.#V(this.#O.x, this.#O.y, r);
|
|
4931
|
+
this.#k = e, this.#A = t, i = Se(n, e, t);
|
|
4932
|
+
} else this.#k = NaN, this.#A = NaN;
|
|
4541
4933
|
let a = i.at(-1) ?? null;
|
|
4542
|
-
t && (this.#
|
|
4543
|
-
let o = e.#
|
|
4544
|
-
l = this.#
|
|
4934
|
+
t && (this.#T = a);
|
|
4935
|
+
let o = e.#M?.matches ? i : [], s = this.#T ? i.indexOf(this.#T) : -1, c = s >= 0 ? i.slice(0, s + 1) : [], l = this.#Y("data-mw-hover", this.#C, o);
|
|
4936
|
+
l = this.#Y("data-mw-active", this.#w, c) || l;
|
|
4545
4937
|
let u = a ? getComputedStyle(a).cursor : "";
|
|
4546
|
-
this.#s.style.cursor = u === "auto" ? "" : u, l && this.isConnected && this.#
|
|
4938
|
+
this.#s.style.cursor = u === "auto" ? "" : u, l && this.isConnected && this.#se();
|
|
4547
4939
|
}
|
|
4548
|
-
#
|
|
4940
|
+
#Y(e, t, n) {
|
|
4549
4941
|
let r = !1, i = new Set(n);
|
|
4550
4942
|
for (let n of t) i.has(n) || (n.removeAttribute(e), r = !0);
|
|
4551
4943
|
for (let n of i) t.has(n) || (n.setAttribute(e, ""), r = !0);
|
|
@@ -4553,51 +4945,51 @@ var Fi = "\n<style>\n :host { display: block; position: relative; contain: layo
|
|
|
4553
4945
|
for (let e of i) t.add(e);
|
|
4554
4946
|
return r;
|
|
4555
4947
|
}
|
|
4556
|
-
#
|
|
4557
|
-
#
|
|
4558
|
-
#
|
|
4559
|
-
|
|
4560
|
-
|
|
4948
|
+
#X = 0;
|
|
4949
|
+
#Z = !1;
|
|
4950
|
+
#Q = 0;
|
|
4951
|
+
#$ = (e) => {
|
|
4952
|
+
$i.test(e.propertyName) && (this.#X++, this.#Q = performance.now(), this.#te());
|
|
4561
4953
|
};
|
|
4562
|
-
#
|
|
4563
|
-
|
|
4954
|
+
#ee = (e) => {
|
|
4955
|
+
$i.test(e.propertyName) && (this.#X = Math.max(0, this.#X - 1));
|
|
4564
4956
|
};
|
|
4565
|
-
#
|
|
4566
|
-
if (this.#
|
|
4567
|
-
this.#
|
|
4957
|
+
#te() {
|
|
4958
|
+
if (this.#Z) return;
|
|
4959
|
+
this.#Z = !0;
|
|
4568
4960
|
let e = () => {
|
|
4569
|
-
if (!this.isConnected || this.#
|
|
4570
|
-
this.#
|
|
4961
|
+
if (!this.isConnected || this.#X === 0 && !a() || performance.now() - this.#Q > ea) {
|
|
4962
|
+
this.#Z = !1, this.#X = 0, this.#se();
|
|
4571
4963
|
return;
|
|
4572
4964
|
}
|
|
4573
|
-
this.#
|
|
4965
|
+
this.#oe(), requestAnimationFrame(e);
|
|
4574
4966
|
};
|
|
4575
4967
|
requestAnimationFrame(e);
|
|
4576
4968
|
}
|
|
4577
|
-
#
|
|
4969
|
+
#ne = (e) => {
|
|
4578
4970
|
if ((e.type === "focusin" || e.type === "focusout") && e.target instanceof HTMLSelectElement) {
|
|
4579
|
-
this.#
|
|
4971
|
+
this.#oe();
|
|
4580
4972
|
return;
|
|
4581
4973
|
}
|
|
4582
|
-
this.#
|
|
4974
|
+
this.#se();
|
|
4583
4975
|
};
|
|
4584
4976
|
attributeChangedCallback(e, t, n) {
|
|
4585
4977
|
if (e === "select" && n !== "text" && n !== "grid") {
|
|
4586
|
-
n !== null && console.warn(`[monowind] Ignoring unrecognized select="${n}". Expected "grid" (default) or "text".`, this), this.setAttribute("select",
|
|
4978
|
+
n !== null && console.warn(`[monowind] Ignoring unrecognized select="${n}". Expected "grid" (default) or "text".`, this), this.setAttribute("select", Zi);
|
|
4587
4979
|
return;
|
|
4588
4980
|
}
|
|
4589
|
-
e === "select" && this.#
|
|
4981
|
+
e === "select" && this.#J(), this.#se();
|
|
4590
4982
|
}
|
|
4591
4983
|
toPlainText() {
|
|
4592
|
-
return this.#d && this.#
|
|
4984
|
+
return this.#d && this.#ce(), this.#p ? nr(this.#p) : "";
|
|
4593
4985
|
}
|
|
4594
|
-
#
|
|
4595
|
-
this.#
|
|
4986
|
+
#re = () => {
|
|
4987
|
+
this.#se();
|
|
4596
4988
|
};
|
|
4597
|
-
#
|
|
4598
|
-
requestAnimationFrame(() => this.#
|
|
4989
|
+
#ie = () => {
|
|
4990
|
+
requestAnimationFrame(() => this.#se());
|
|
4599
4991
|
};
|
|
4600
|
-
#
|
|
4992
|
+
#ae() {
|
|
4601
4993
|
let e = document.activeElement;
|
|
4602
4994
|
if (!(e instanceof HTMLSelectElement) || !this.contains(e)) return !1;
|
|
4603
4995
|
try {
|
|
@@ -4606,50 +4998,50 @@ var Fi = "\n<style>\n :host { display: block; position: relative; contain: layo
|
|
|
4606
4998
|
return !1;
|
|
4607
4999
|
}
|
|
4608
5000
|
}
|
|
4609
|
-
#
|
|
5001
|
+
#oe() {
|
|
4610
5002
|
try {
|
|
4611
|
-
this.#
|
|
5003
|
+
this.#ce();
|
|
4612
5004
|
} catch (e) {
|
|
4613
5005
|
console.error("[monowind] layout failed:", e);
|
|
4614
5006
|
}
|
|
4615
5007
|
}
|
|
4616
|
-
#
|
|
5008
|
+
#se() {
|
|
4617
5009
|
this.#d || (this.#d = !0, requestAnimationFrame(() => {
|
|
4618
|
-
if (this.#d = !1, this.#
|
|
4619
|
-
this.#
|
|
5010
|
+
if (this.#d = !1, this.#ae()) {
|
|
5011
|
+
this.#se();
|
|
4620
5012
|
return;
|
|
4621
5013
|
}
|
|
4622
|
-
this.#
|
|
5014
|
+
this.#oe();
|
|
4623
5015
|
}));
|
|
4624
5016
|
}
|
|
4625
|
-
#
|
|
5017
|
+
#ce() {
|
|
4626
5018
|
if (!this.isConnected) return;
|
|
4627
|
-
let e = /* @__PURE__ */ new Map(),
|
|
4628
|
-
if (Number.isFinite(
|
|
4629
|
-
let
|
|
4630
|
-
|
|
5019
|
+
let e = this.#F(), t = /* @__PURE__ */ new Map(), n = getComputedStyle(this).getPropertyValue("--mw-cw").trim(), r = parseFloat(n);
|
|
5020
|
+
if (Number.isFinite(r) && r > 0) for (let e of this.querySelectorAll("textarea")) {
|
|
5021
|
+
let n = getComputedStyle(e), i = e.clientWidth - (parseFloat(n.paddingLeft) || 0) - (parseFloat(n.paddingRight) || 0);
|
|
5022
|
+
t.set(e, Math.max(0, Math.round(i / r)));
|
|
4631
5023
|
}
|
|
4632
5024
|
this.setAttribute("measuring", "");
|
|
4633
5025
|
try {
|
|
4634
5026
|
this.#c.parentNode !== this && this.appendChild(this.#c);
|
|
4635
|
-
let
|
|
4636
|
-
(
|
|
4637
|
-
let
|
|
4638
|
-
if (
|
|
4639
|
-
let
|
|
4640
|
-
for (let
|
|
4641
|
-
if (
|
|
4642
|
-
let r =
|
|
4643
|
-
r &&
|
|
5027
|
+
let n = we(this, this.#c), r = this.#f;
|
|
5028
|
+
(r === null || r.width !== n.width || r.height !== n.height || r.letterSpacing !== n.letterSpacing || r.inkOverhang !== n.inkOverhang) && (this.style.setProperty("--mw-cw", `${n.width}px`), this.style.setProperty("--mw-ch", `${n.height}px`), this.style.setProperty("--mw-rls", `${n.letterSpacing}px`), this.style.setProperty("--mw-ink", `${n.inkOverhang ?? 0}px`)), this.#f = n;
|
|
5029
|
+
let i = getComputedStyle(this), a = (parseFloat(i.paddingLeft) || 0) + (parseFloat(i.paddingRight) || 0), o = Math.max(0, Math.floor((this.clientWidth - a) / n.width));
|
|
5030
|
+
if (o === 0) return;
|
|
5031
|
+
let s = Te(), c = [];
|
|
5032
|
+
for (let e of Array.from(this.children)) {
|
|
5033
|
+
if (e === this.#c) continue;
|
|
5034
|
+
let r = ji(e, s, n, t);
|
|
5035
|
+
r && c.push(r);
|
|
4644
5036
|
}
|
|
4645
|
-
if (
|
|
5037
|
+
if (Ki(this) ? (this.hasAttribute("data-mw-dropped-text") || console.warn(`[monowind] ${qi}`, this), this.setAttribute("data-mw-dropped-text", "")) : this.removeAttribute("data-mw-dropped-text"), c.length === 0) {
|
|
4646
5038
|
this.#s.replaceChildren(), this.#p = null, this.setAttribute("data-mw-ready", "");
|
|
4647
5039
|
return;
|
|
4648
5040
|
}
|
|
4649
|
-
let
|
|
5041
|
+
let l = {
|
|
4650
5042
|
source: this,
|
|
4651
|
-
style:
|
|
4652
|
-
children:
|
|
5043
|
+
style: nt(),
|
|
5044
|
+
children: c,
|
|
4653
5045
|
text: "",
|
|
4654
5046
|
intrinsicWidth: 0,
|
|
4655
5047
|
intrinsicHeight: 0,
|
|
@@ -4660,20 +5052,33 @@ var Fi = "\n<style>\n :host { display: block; position: relative; contain: layo
|
|
|
4660
5052
|
height: 0
|
|
4661
5053
|
},
|
|
4662
5054
|
unclampedHeight: 0,
|
|
4663
|
-
resolvedPadding:
|
|
4664
|
-
}, { height:
|
|
4665
|
-
|
|
4666
|
-
let
|
|
4667
|
-
this.style.
|
|
5055
|
+
resolvedPadding: rt()
|
|
5056
|
+
}, { height: u } = Pn(l, o);
|
|
5057
|
+
wr(l), this.#_ = ua(l), this.#P(n, e), this.#D = !gr(l, this.#s, this.#E), this.#p = l;
|
|
5058
|
+
let d = `${l.localRect.width * n.width}px`, f = `${l.localRect.height * n.height}px`;
|
|
5059
|
+
this.#s.style.width !== d && (this.#s.style.width = d), this.#s.style.height !== f && (this.#s.style.height = f);
|
|
5060
|
+
let p = i.boxSizing === "border-box" ? (parseFloat(i.paddingTop) || 0) + (parseFloat(i.paddingBottom) || 0) + (parseFloat(i.borderTopWidth) || 0) + (parseFloat(i.borderBottomWidth) || 0) : 0, m = `${u * n.height + p}px`;
|
|
5061
|
+
this.style.height !== m && (this.style.height = m), this.hasAttribute("data-mw-ready") || this.setAttribute("data-mw-ready", "");
|
|
4668
5062
|
} finally {
|
|
4669
|
-
this.setAttribute("settling", ""), this.removeAttribute("measuring"), getComputedStyle(this).transitionProperty, this.removeAttribute("settling"), this.#u?.takeRecords(), i(this) && (a() ? (this.#
|
|
5063
|
+
this.setAttribute("settling", ""), this.removeAttribute("measuring"), getComputedStyle(this).transitionProperty, this.removeAttribute("settling"), this.#I(e), this.#u?.takeRecords(), i(this) && (a() ? (this.#Q = performance.now(), this.#te()) : this.#se()), this.#j = null, this.#O && this.#J();
|
|
4670
5064
|
}
|
|
4671
5065
|
}
|
|
4672
5066
|
};
|
|
4673
|
-
function
|
|
4674
|
-
typeof customElements > "u" || customElements.get("mono-wind") || customElements.define("mono-wind",
|
|
5067
|
+
function ca() {
|
|
5068
|
+
typeof customElements > "u" || customElements.get("mono-wind") || customElements.define("mono-wind", sa);
|
|
5069
|
+
}
|
|
5070
|
+
function la(e, t, n, r) {
|
|
5071
|
+
let i = t === "y" ? e.scrollTop : e.scrollLeft, a = t === "y" ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
5072
|
+
return r > 0 && i > 0 && i >= a - 1 ? r : Math.min(Math.max(0, Math.floor((i + 1) / n)), r);
|
|
5073
|
+
}
|
|
5074
|
+
function ua(e) {
|
|
5075
|
+
let t = [], n = (e) => {
|
|
5076
|
+
e.scrollRange && t.push(e);
|
|
5077
|
+
for (let t of e.children) n(t);
|
|
5078
|
+
};
|
|
5079
|
+
return n(e), t;
|
|
4675
5080
|
}
|
|
4676
5081
|
//#endregion
|
|
4677
|
-
export {
|
|
5082
|
+
export { sa as MonoWindElement, ca as defineMonoWind, re as invalidateLeaves, Jt as multicolLines, x as registerBorderGlyphs, ne as registerLeafRenderer, nr as renderPlainText, Ee as wrapLines };
|
|
4678
5083
|
|
|
4679
5084
|
//# sourceMappingURL=index.js.map
|