@aglyn/plugins-ai 1.7.0 → 1.8.0
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/package.json +17 -17
- package/src/lib/jobs/ai-job-import-step.d.ts +28 -2
- package/src/lib/jobs/ai-job-import-step.js +170 -14
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.js +2 -0
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.js +6 -2
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +13 -3
- package/src/lib/jobs/ai-site-import-compile.js +336 -27
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +3 -1
- package/src/lib/jobs/ai-site-import-document.js +36 -0
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-look.d.ts +9 -0
- package/src/lib/jobs/ai-site-import-look.js +89 -6
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.d.ts +16 -0
- package/src/lib/layout-language/ai-layout-compiler.js +351 -54
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-source.d.ts +88 -2
- package/src/lib/layout-language/ai-layout-frame-source.js +591 -30
- package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.js +30 -18
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +72 -3
- package/src/lib/layout-language/ai-layout-language.js +5 -3
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/layout-language/ai-layout-store.d.ts +8 -0
- package/src/lib/layout-language/ai-layout-store.js +32 -6
- package/src/lib/layout-language/ai-layout-store.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +31 -1
- package/src/lib/model/ai-site-import-fidelity.js +347 -25
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +203 -6
- package/src/lib/model/ai-site-import.js +161 -5
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +8 -1
- package/src/lib/model/ai-site-look.js +8 -5
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -1
- package/src/lib/runtime/ai-doctrine-validators.js +25 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.js +19 -2
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/runtime/ai-page-links.d.ts +15 -0
- package/src/lib/runtime/ai-page-links.js +48 -0
- package/src/lib/runtime/ai-page-links.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +30 -5
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +9 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +24 -5
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/site-import-crawl.d.ts +3 -1
- package/src/lib/site-import/site-import-crawl.js +8 -3
- package/src/lib/site-import/site-import-crawl.js.map +1 -1
- package/src/lib/site-import/site-import-css.d.ts +20 -0
- package/src/lib/site-import/site-import-css.js +106 -0
- package/src/lib/site-import/site-import-css.js.map +1 -1
- package/src/lib/site-import/site-import-html.d.ts +39 -0
- package/src/lib/site-import/site-import-html.js +515 -5
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.d.ts +16 -6
- package/src/lib/site-import/site-import-layout.js +524 -52
- package/src/lib/site-import/site-import-layout.js.map +1 -1
- package/src/lib/site-import/site-import-nav.js +286 -24
- package/src/lib/site-import/site-import-nav.js.map +1 -1
- package/src/lib/site-import/site-import-page.js +3 -0
- package/src/lib/site-import/site-import-page.js.map +1 -1
|
@@ -45,6 +45,9 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
45
45
|
* button or a link too); every inline icon, once, by index; every link or
|
|
46
46
|
* button the source draws as a button, filled (`primary`), outlined
|
|
47
47
|
* (`secondary`) or plain (`quiet`).
|
|
48
|
+
* - **Videos (AGL-4140).** Every video where it sits, its poster the picture
|
|
49
|
+
* inside it; a film that plays on its own behind a section's words is that
|
|
50
|
+
* section's backdrop.
|
|
48
51
|
* - **The look.** The fonts (Google Fonts' named), the page's background and
|
|
49
52
|
* text, the buttons' fill and corners, the links' color, the header's
|
|
50
53
|
* background: what the look pass draws the site's theme from.
|
|
@@ -53,7 +56,7 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
53
56
|
* never the rule: the reader reads what an element draws, through the page's
|
|
54
57
|
* own stylesheets (`site-import-css.ts`). Nothing a page wrote runs.
|
|
55
58
|
*=========================================*/ import { AI_SITE_IMPORT_MAX_SECTIONS, siteImportFilterNodes, siteImportLayoutLines } from "../model/ai-site-import.js";
|
|
56
|
-
import { SITE_IMPORT_CSS_WIDE_WIDTH, siteImportBackgroundOf, siteImportColorOf, siteImportCssOf, siteImportFontFamilies, siteImportFontSizePx, siteImportGridColumns, siteImportHasBorder, siteImportHasShadow, siteImportHex, siteImportLengthPx, siteImportLuminance, siteImportRadiusPx, siteImportSaturation, siteImportStylesOf, siteImportTwelfths } from "./site-import-css.js";
|
|
59
|
+
import { SITE_IMPORT_CSS_WIDE_WIDTH, siteImportAspectRatio, siteImportBackgroundOf, siteImportBorderSides, siteImportColorDistance, siteImportColorOf, siteImportCssOf, siteImportFontFamilies, siteImportFontSizePx, siteImportGridColumns, siteImportHasBorder, siteImportHasShadow, siteImportHex, siteImportLengthPx, siteImportLuminance, siteImportOpaque, siteImportRadiusPx, siteImportSaturation, siteImportStylesOf, siteImportTwelfths } from "./site-import-css.js";
|
|
57
60
|
import { extractSiteImportPage } from "./site-import-html.js";
|
|
58
61
|
import { siteImportLabel } from "./site-import-page.js";
|
|
59
62
|
const isElementPart = (part)=>'element' in part;
|
|
@@ -119,11 +122,17 @@ const BADGE_MIN_RADIUS = 12;
|
|
|
119
122
|
];
|
|
120
123
|
const STEP_NUMBER = /^(?:step\s*)?(?:0?\d{1,2}|[ivx]{1,4})[.):]?$/i;
|
|
121
124
|
const FIGURE = /^[^\s]{0,3}[\d][\d.,:/x×+%kmb$€£-]*\s?[^\s]{0,12}$|^\d+-[a-z]+$/i;
|
|
125
|
+
/** The width a page is read at for its tablet columns (AGL-4138): between a framework's `sm` and `md`. */ const TABLET_WIDTH = 768;
|
|
126
|
+
/** A paragraph set this much larger than the body, and bold, is a statement (AGL-4138), not a lede. */ const STATEMENT_SCALE = 1.75;
|
|
127
|
+
const STATEMENT_MIN_PX = 28;
|
|
128
|
+
const STATEMENT_MIN_WEIGHT = 600;
|
|
129
|
+
/** The widest square an icon's tile is (AGL-4138); wider, it is a card of its own. */ const TILE_MAX_PX = 64;
|
|
122
130
|
/**
|
|
123
131
|
* The page's layout from its structure and its linked stylesheets' text,
|
|
124
132
|
* over its main-region lines. `null` for a page with no structure or no main
|
|
125
133
|
* content.
|
|
126
134
|
*/ export function siteImportLayout(page, stylesheets = []) {
|
|
135
|
+
var _page_videos;
|
|
127
136
|
const { structure, blocks } = page;
|
|
128
137
|
if (!structure) return null;
|
|
129
138
|
const sheets = [
|
|
@@ -132,14 +141,14 @@ const FIGURE = /^[^\s]{0,3}[\d][\d.,:/x×+%kmb$€£-]*\s?[^\s]{0,12}$|^\d+-[a-z
|
|
|
132
141
|
];
|
|
133
142
|
const css = siteImportCssOf(sheets);
|
|
134
143
|
const styles = siteImportStylesOf(structure, css);
|
|
135
|
-
const reader = new LayoutReader(structure, blocks, styles, ()=>siteImportStylesOf(structure, siteImportCssOf(sheets, SITE_IMPORT_CSS_WIDE_WIDTH)));
|
|
144
|
+
const reader = new LayoutReader(structure, blocks, styles, ()=>siteImportStylesOf(structure, siteImportCssOf(sheets, SITE_IMPORT_CSS_WIDE_WIDTH)), ()=>siteImportStylesOf(structure, siteImportCssOf(sheets, TABLET_WIDTH)), (_page_videos = page.videos) != null ? _page_videos : []);
|
|
136
145
|
const sections = reader.sections();
|
|
137
146
|
if (!sections.length) return null;
|
|
138
147
|
return {
|
|
139
148
|
v: 1,
|
|
140
149
|
sections,
|
|
141
150
|
icons: structure.icons.map((icon)=>_extends({}, icon)),
|
|
142
|
-
look: siteImportLookFacts(structure, styles, css.fontFaces)
|
|
151
|
+
look: siteImportLookFacts(structure, styles, css.fontFaces, blocks)
|
|
143
152
|
};
|
|
144
153
|
}
|
|
145
154
|
let LayoutReader = class LayoutReader {
|
|
@@ -335,12 +344,32 @@ let LayoutReader = class LayoutReader {
|
|
|
335
344
|
var _cut_anchor;
|
|
336
345
|
const { element, range, from } = cut;
|
|
337
346
|
const scope = element != null ? element : container;
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
const
|
|
347
|
+
let nodes = scope >= 0 ? this.read(scope, range) : this.readLeaves(range);
|
|
348
|
+
const name = this.nameOf(cut.anchor, this.linesOf(nodes), index);
|
|
349
|
+
let band = cut.anchor !== null ? this.bandOf(cut.anchor, false) : this.bandOf(container, true);
|
|
350
|
+
// A film playing on its own behind the words is the section's backdrop (AGL-4140), its poster the first paint.
|
|
351
|
+
const behind = band.backdrop ? undefined : this.videoBehind(nodes);
|
|
352
|
+
if (behind) {
|
|
353
|
+
nodes = withoutVideo(nodes, behind.video);
|
|
354
|
+
band = {
|
|
355
|
+
band: 'dark',
|
|
356
|
+
background: band.background,
|
|
357
|
+
backdrop: _extends({
|
|
358
|
+
kind: 'video',
|
|
359
|
+
video: behind.video
|
|
360
|
+
}, behind.poster !== undefined ? {
|
|
361
|
+
poster: behind.poster
|
|
362
|
+
} : {})
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
const lines = (behind == null ? void 0 : behind.poster) !== undefined ? [
|
|
366
|
+
behind.poster,
|
|
367
|
+
...this.linesOf(nodes)
|
|
368
|
+
] : this.linesOf(nodes);
|
|
369
|
+
if (!lines.length && !behind && !nodes.some((node)=>node.kind === 'icon' || node.kind === 'form' || node.kind === 'video')) return null;
|
|
343
370
|
const width = this.widthOf((_cut_anchor = cut.anchor) != null ? _cut_anchor : container);
|
|
371
|
+
const align = this.alignOf(scope, lines);
|
|
372
|
+
keepOwnAlign(nodes, align);
|
|
344
373
|
return _extends({
|
|
345
374
|
name,
|
|
346
375
|
from,
|
|
@@ -349,7 +378,7 @@ let LayoutReader = class LayoutReader {
|
|
|
349
378
|
}, band.backdrop ? {
|
|
350
379
|
backdrop: band.backdrop
|
|
351
380
|
} : {}, {
|
|
352
|
-
align
|
|
381
|
+
align
|
|
353
382
|
}, width !== null ? {
|
|
354
383
|
width
|
|
355
384
|
} : {}, {
|
|
@@ -359,7 +388,8 @@ let LayoutReader = class LayoutReader {
|
|
|
359
388
|
}
|
|
360
389
|
/** Lines with no container to read them through: one after another. */ readLeaves(range) {
|
|
361
390
|
const leaves = this.elements.filter((element)=>element.parent < 0).flatMap((element)=>this.leaves(element.id));
|
|
362
|
-
|
|
391
|
+
// A video's poster is its own, never a picture beside it.
|
|
392
|
+
return leaves.filter((leaf)=>this.inRange(leaf, range) && (leaf.kind === 'video' || this.videoHolding(leaf.element) === null)).map((leaf)=>this.leafNode(leaf));
|
|
363
393
|
}
|
|
364
394
|
nameOf(element, lines, index) {
|
|
365
395
|
var _lines_map_find;
|
|
@@ -507,6 +537,10 @@ let LayoutReader = class LayoutReader {
|
|
|
507
537
|
/*---------------- reading a container ----------------*/ read(element, range) {
|
|
508
538
|
const node = this.elements[element];
|
|
509
539
|
if (!node) return [];
|
|
540
|
+
// A video is one node, whatever its marker holds: its poster (AGL-4140).
|
|
541
|
+
if (node.video !== undefined) return [
|
|
542
|
+
this.videoNode(element, range)
|
|
543
|
+
];
|
|
510
544
|
if (node.tag === 'table') {
|
|
511
545
|
const table = this.table(element, range);
|
|
512
546
|
if (table) return [
|
|
@@ -559,6 +593,10 @@ let LayoutReader = class LayoutReader {
|
|
|
559
593
|
kind: 'form',
|
|
560
594
|
form: leaf.ref
|
|
561
595
|
};
|
|
596
|
+
if (leaf.kind === 'video') return this.videoNode(leaf.element, [
|
|
597
|
+
-1,
|
|
598
|
+
Number.POSITIVE_INFINITY
|
|
599
|
+
]);
|
|
562
600
|
const block = this.block(leaf);
|
|
563
601
|
if ((block == null ? void 0 : block.kind) === 'image') {
|
|
564
602
|
var _this_elements_wrap, _this_elements_wrap1;
|
|
@@ -567,6 +605,7 @@ let LayoutReader = class LayoutReader {
|
|
|
567
605
|
'button'
|
|
568
606
|
], 4);
|
|
569
607
|
const href = wrap !== null && ((_this_elements_wrap = this.elements[wrap]) == null ? void 0 : _this_elements_wrap.tag) === 'a' ? this.anchorHref(wrap) : null;
|
|
608
|
+
const fit = this.pictureFit(leaf);
|
|
570
609
|
return _extends({
|
|
571
610
|
kind: 'picture',
|
|
572
611
|
line: leaf.ref
|
|
@@ -574,11 +613,13 @@ let LayoutReader = class LayoutReader {
|
|
|
574
613
|
href
|
|
575
614
|
} : {}, wrap !== null && ((_this_elements_wrap1 = this.elements[wrap]) == null ? void 0 : _this_elements_wrap1.tag) === 'button' ? {
|
|
576
615
|
button: true
|
|
616
|
+
} : {}, fit ? {
|
|
617
|
+
fit
|
|
577
618
|
} : {});
|
|
578
619
|
}
|
|
579
620
|
const button = this.buttonStyle(leaf);
|
|
580
621
|
const role = button ? undefined : this.roleOf(leaf);
|
|
581
|
-
|
|
622
|
+
const line = _extends({
|
|
582
623
|
kind: 'line',
|
|
583
624
|
line: leaf.ref
|
|
584
625
|
}, role ? {
|
|
@@ -586,6 +627,88 @@ let LayoutReader = class LayoutReader {
|
|
|
586
627
|
} : {}, button ? {
|
|
587
628
|
button
|
|
588
629
|
} : {});
|
|
630
|
+
if (role === 'eyebrow') {
|
|
631
|
+
// An eyebrow's own pill and color (AGL-4138): the hero's chip, a section's magenta label.
|
|
632
|
+
if (this.inPill(leaf)) line.chip = true;
|
|
633
|
+
const ink = this.inkOf(leaf.element);
|
|
634
|
+
if (ink) line.color = ink;
|
|
635
|
+
}
|
|
636
|
+
return line;
|
|
637
|
+
}
|
|
638
|
+
/*---------------- pictures, inks and tiles (AGL-4138) ----------------*/ /**
|
|
639
|
+
* How the source frames a picture: its own shape from its `width` and
|
|
640
|
+
* `height`; the box around it that sets an `aspect-ratio`, or a height it
|
|
641
|
+
* fills or is held to, which crops it; its fit; its corners and shadow, on
|
|
642
|
+
* it or on a box within two levels that holds no other line.
|
|
643
|
+
*/ pictureFit(leaf) {
|
|
644
|
+
var _ref, _ref1;
|
|
645
|
+
var _own_get, _this_elements_at;
|
|
646
|
+
const element = leaf.element;
|
|
647
|
+
const node = this.elements[element];
|
|
648
|
+
if (!node) return undefined;
|
|
649
|
+
const own = this.style(element);
|
|
650
|
+
const fit = {};
|
|
651
|
+
if (node.attrs.width && node.attrs.height) fit.ratio = Math.round(node.attrs.width / node.attrs.height * 10000) / 10000;
|
|
652
|
+
const objectFit = own.get('object-fit');
|
|
653
|
+
if (objectFit === 'cover' || objectFit === 'contain') fit.objectFit = objectFit;
|
|
654
|
+
// The picture fills its box where it is set to the box's whole height.
|
|
655
|
+
const fills = /^100%$/.test((_ref = (_own_get = own.get('height')) == null ? void 0 : _own_get.trim()) != null ? _ref : '');
|
|
656
|
+
for(let at = element, depth = 0; at >= 0 && depth <= 2; at = (_ref1 = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.parent) != null ? _ref1 : -1, depth += 1){
|
|
657
|
+
var _style_get;
|
|
658
|
+
if (depth > 0 && this.leaves(at).some((other)=>other.kind === 'line' && other.order !== leaf.order)) break;
|
|
659
|
+
const style = this.style(at);
|
|
660
|
+
const box = siteImportAspectRatio(style.get('aspect-ratio'));
|
|
661
|
+
if (box !== null && fit.box === undefined && fit.height === undefined) fit.box = Math.round(box * 10000) / 10000;
|
|
662
|
+
const height = siteImportLengthPx((_style_get = style.get('height')) != null ? _style_get : '');
|
|
663
|
+
if (height !== null && height > 0 && fit.box === undefined && fit.height === undefined && (depth === 0 || fills)) fit.height = height;
|
|
664
|
+
const radius = siteImportRadiusPx(style);
|
|
665
|
+
if (radius !== null && radius > 0 && fit.radius === undefined) fit.radius = Math.min(radius, 999);
|
|
666
|
+
if (siteImportHasShadow(style)) fit.shadow = true;
|
|
667
|
+
}
|
|
668
|
+
return Object.keys(fit).length ? fit : undefined;
|
|
669
|
+
}
|
|
670
|
+
/** An element's words' color as it shows over the ground under it, `#rrggbb`; `null` where it sets none. */ inkOf(element) {
|
|
671
|
+
var _this_backgroundUnder;
|
|
672
|
+
const color = siteImportColorOf(this.style(element).get('color'));
|
|
673
|
+
if (!color || color.a < 0.05) return null;
|
|
674
|
+
return siteImportHex(siteImportOpaque(color, siteImportColorOf((_this_backgroundUnder = this.backgroundUnder(element)) != null ? _this_backgroundUnder : undefined)));
|
|
675
|
+
}
|
|
676
|
+
/** Whether a line sits in a pill of its own: its element, or the wrapper holding only it, filled or bordered and rounded to a pill. */ inPill(leaf) {
|
|
677
|
+
var _ref;
|
|
678
|
+
var _this_elements_at;
|
|
679
|
+
for(let at = leaf.element, depth = 0; at >= 0 && depth < 2; at = (_ref = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.parent) != null ? _ref : -1, depth += 1){
|
|
680
|
+
var _siteImportRadiusPx;
|
|
681
|
+
if (this.leaves(at).length !== 1) return false;
|
|
682
|
+
const style = this.style(at);
|
|
683
|
+
const fill = siteImportBackgroundOf(style).color;
|
|
684
|
+
const filled = !!fill && fill.a >= 0.5 && siteImportHex(fill) !== this.backgroundUnder(at);
|
|
685
|
+
if ((filled || siteImportHasBorder(style)) && ((_siteImportRadiusPx = siteImportRadiusPx(style)) != null ? _siteImportRadiusPx : 0) >= BADGE_MIN_RADIUS) return true;
|
|
686
|
+
}
|
|
687
|
+
return false;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* The filled square an icon sits in: the nearest element above it, within
|
|
691
|
+
* two levels and inside its item, holding nothing but the icon, no wider
|
|
692
|
+
* than a tile, whose fill is not the ground under it.
|
|
693
|
+
*/ tileOf(icon, item) {
|
|
694
|
+
var _ref, _ref1;
|
|
695
|
+
var _this_elements_icon_element, _this_elements_at;
|
|
696
|
+
for(let at = (_ref = (_this_elements_icon_element = this.elements[icon.element]) == null ? void 0 : _this_elements_icon_element.parent) != null ? _ref : -1, depth = 0; at >= 0 && depth < 2 && at !== item; at = (_ref1 = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.parent) != null ? _ref1 : -1, depth += 1){
|
|
697
|
+
var _style_get;
|
|
698
|
+
if (this.leaves(at).some((leaf)=>leaf.kind === 'line')) return undefined;
|
|
699
|
+
const style = this.style(at);
|
|
700
|
+
const fill = siteImportBackgroundOf(style).color;
|
|
701
|
+
if (!fill || fill.a < 0.5 || siteImportHex(fill) === this.backgroundUnder(at)) continue;
|
|
702
|
+
const width = siteImportLengthPx((_style_get = style.get('width')) != null ? _style_get : '');
|
|
703
|
+
if (width === null || width > TILE_MAX_PX) continue;
|
|
704
|
+
const radius = siteImportRadiusPx(style);
|
|
705
|
+
return {
|
|
706
|
+
fill: siteImportHex(fill),
|
|
707
|
+
radius: radius === null ? 0 : Math.min(radius, 999),
|
|
708
|
+
color: this.inkOf(icon.element)
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
return undefined;
|
|
589
712
|
}
|
|
590
713
|
/** The nearest element of these tags at or above `element`, within `depth` levels. */ wrapperOf(element, tags, depth) {
|
|
591
714
|
let at = element;
|
|
@@ -602,6 +725,58 @@ let LayoutReader = class LayoutReader {
|
|
|
602
725
|
const anchor = this.structure.anchors.find((entry)=>entry.element === element);
|
|
603
726
|
return (_ref = anchor == null ? void 0 : anchor.href) != null ? _ref : null;
|
|
604
727
|
}
|
|
728
|
+
/*---------------- videos (AGL-4140) ----------------*/ /** A video where it sits: its poster, the picture inside its marker, and whether the box it plays in casts a shadow. */ videoNode(element, range) {
|
|
729
|
+
var _ref;
|
|
730
|
+
var _this_elements_at;
|
|
731
|
+
const node = this.elements[element];
|
|
732
|
+
const poster = this.leaves(element).find((leaf)=>{
|
|
733
|
+
var _this_block;
|
|
734
|
+
return leaf.kind === 'line' && this.inRange(leaf, range) && ((_this_block = this.block(leaf)) == null ? void 0 : _this_block.kind) === 'image';
|
|
735
|
+
});
|
|
736
|
+
let shadow = false;
|
|
737
|
+
// The box around it, as far up as a wrapper holds nothing else.
|
|
738
|
+
for(let at = element, depth = 0; at >= 0 && depth < 3 && !shadow; at = (_ref = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.parent) != null ? _ref : -1, depth += 1){
|
|
739
|
+
if (this.leaves(at).some((leaf)=>leaf.kind === 'line' && leaf.element !== (poster == null ? void 0 : poster.element))) break;
|
|
740
|
+
shadow = siteImportHasShadow(this.style(at));
|
|
741
|
+
}
|
|
742
|
+
const fit = poster ? this.pictureFit(poster) : undefined;
|
|
743
|
+
return _extends({
|
|
744
|
+
kind: 'video',
|
|
745
|
+
video: node.video
|
|
746
|
+
}, poster ? {
|
|
747
|
+
poster: poster.ref
|
|
748
|
+
} : {}, fit ? {
|
|
749
|
+
fit
|
|
750
|
+
} : {}, shadow ? {
|
|
751
|
+
shadow: true
|
|
752
|
+
} : {});
|
|
753
|
+
}
|
|
754
|
+
/** The video marker an element sits in, or is, within a few levels; `null` for none. */ videoHolding(element) {
|
|
755
|
+
var _ref;
|
|
756
|
+
var _this_elements_at;
|
|
757
|
+
for(let at = element, depth = 0; at >= 0 && depth < 4; at = (_ref = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.parent) != null ? _ref : -1, depth += 1){
|
|
758
|
+
var _this_elements_at1;
|
|
759
|
+
if (((_this_elements_at1 = this.elements[at]) == null ? void 0 : _this_elements_at1.video) !== undefined) return at;
|
|
760
|
+
}
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* The film a section plays on its own behind its words (AGL-4140): one that
|
|
765
|
+
* starts by itself, its place laid over the section (absolute or fixed, at
|
|
766
|
+
* most three levels up), as a picture behind the words is.
|
|
767
|
+
*/ videoBehind(nodes) {
|
|
768
|
+
for (const node of siteImportVideoNodes(nodes)){
|
|
769
|
+
var _ref, _ref1;
|
|
770
|
+
var _this_videos_node_video, _this_elements_at;
|
|
771
|
+
if (!((_this_videos_node_video = this.videos[node.video]) == null ? void 0 : _this_videos_node_video.autoplay)) continue;
|
|
772
|
+
const element = this.elements.find((entry)=>entry.video === node.video);
|
|
773
|
+
for(let at = (_ref = element == null ? void 0 : element.id) != null ? _ref : -1, depth = 0; at >= 0 && depth < 4; at = (_ref1 = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.parent) != null ? _ref1 : -1, depth += 1){
|
|
774
|
+
const position = this.style(at).get('position');
|
|
775
|
+
if (position === 'absolute' || position === 'fixed') return node;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return null;
|
|
779
|
+
}
|
|
605
780
|
/** How the source draws a line as a button, when it does. */ buttonStyle(leaf) {
|
|
606
781
|
var _siteImportButtonStyleOf;
|
|
607
782
|
const block = this.block(leaf);
|
|
@@ -626,24 +801,20 @@ let LayoutReader = class LayoutReader {
|
|
|
626
801
|
const page = siteImportBackgroundOf(this.style(-2)).color;
|
|
627
802
|
return page ? siteImportHex(page) : '#ffffff';
|
|
628
803
|
}
|
|
629
|
-
/** An eyebrow, a lede or a note, where the source's styling says so. */ roleOf(leaf) {
|
|
804
|
+
/** An eyebrow, a lede, a statement or a note, where the source's styling says so. */ roleOf(leaf) {
|
|
630
805
|
const block = this.block(leaf);
|
|
631
806
|
if ((block == null ? void 0 : block.kind) !== 'paragraph') return undefined;
|
|
632
807
|
const style = this.style(leaf.element);
|
|
633
808
|
if (this.looksLikeEyebrow(leaf, block.text)) return 'eyebrow';
|
|
634
809
|
const size = siteImportFontSizePx(style);
|
|
810
|
+
// A paragraph set as large as a heading, and bold, is a statement (AGL-4138): "Most website builders hand you a blank page…".
|
|
811
|
+
if (size !== null && (size >= this.bodySize * STATEMENT_SCALE || size >= STATEMENT_MIN_PX) && siteImportFontWeight(style) >= STATEMENT_MIN_WEIGHT && block.text.length > 40) return 'statement';
|
|
635
812
|
if (size !== null && size >= this.bodySize * 1.12 && block.text.length > 40) return 'lede';
|
|
636
813
|
if (size !== null && size <= this.bodySize * 0.875 && block.text.length <= 160) return 'note';
|
|
637
814
|
return undefined;
|
|
638
815
|
}
|
|
639
816
|
looksLikeEyebrow(leaf, text) {
|
|
640
|
-
|
|
641
|
-
const words = (_text_match = text.match(RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7DC\\uA7F1-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD-\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}-\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}-\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}-\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10940}-\\u{10959}\\u{10980}-\\u{109B7}\\u{109BE}-\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}-\\u{10EB1}\\u{10EC2}-\\u{10EC7}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}-\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}-\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}-\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}-\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}-\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}-\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}-\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}-\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11DB0}-\\u{11DDB}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16EA0}-\\u{16EB8}\\u{16EBB}-\\u{16ED3}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}-\\u{16FE1}\\u{16FE3}\\u{16FF2}-\\u{16FF3}\\u{17000}-\\u{18CD5}\\u{18CFF}-\\u{18D1E}\\u{18D80}-\\u{18DF2}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}-\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E6C0}-\\u{1E6DE}\\u{1E6E0}-\\u{1E6E2}\\u{1E6E4}-\\u{1E6E5}\\u{1E6E7}-\\u{1E6ED}\\u{1E6F0}-\\u{1E6F4}\\u{1E6FE}-\\u{1E6FF}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}-\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B81D}\\u{2B820}-\\u{2CEAD}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{33479}\\u0030-\\u0039\\u00B2-\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D58-\\u0D5E\\u0D66-\\u0D78\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\\u{10107}-\\u{10133}\\u{10140}-\\u{10178}\\u{1018A}-\\u{1018B}\\u{102E1}-\\u{102FB}\\u{10320}-\\u{10323}\\u{10341}\\u{1034A}\\u{103D1}-\\u{103D5}\\u{104A0}-\\u{104A9}\\u{10858}-\\u{1085F}\\u{10879}-\\u{1087F}\\u{108A7}-\\u{108AF}\\u{108FB}-\\u{108FF}\\u{10916}-\\u{1091B}\\u{109BC}-\\u{109BD}\\u{109C0}-\\u{109CF}\\u{109D2}-\\u{109FF}\\u{10A40}-\\u{10A48}\\u{10A7D}-\\u{10A7E}\\u{10A9D}-\\u{10A9F}\\u{10AEB}-\\u{10AEF}\\u{10B58}-\\u{10B5F}\\u{10B78}-\\u{10B7F}\\u{10BA9}-\\u{10BAF}\\u{10CFA}-\\u{10CFF}\\u{10D30}-\\u{10D39}\\u{10D40}-\\u{10D49}\\u{10E60}-\\u{10E7E}\\u{10F1D}-\\u{10F26}\\u{10F51}-\\u{10F54}\\u{10FC5}-\\u{10FCB}\\u{11052}-\\u{1106F}\\u{110F0}-\\u{110F9}\\u{11136}-\\u{1113F}\\u{111D0}-\\u{111D9}\\u{111E1}-\\u{111F4}\\u{112F0}-\\u{112F9}\\u{11450}-\\u{11459}\\u{114D0}-\\u{114D9}\\u{11650}-\\u{11659}\\u{116C0}-\\u{116C9}\\u{116D0}-\\u{116E3}\\u{11730}-\\u{1173B}\\u{118E0}-\\u{118F2}\\u{11950}-\\u{11959}\\u{11BF0}-\\u{11BF9}\\u{11C50}-\\u{11C6C}\\u{11D50}-\\u{11D59}\\u{11DA0}-\\u{11DA9}\\u{11DE0}-\\u{11DE9}\\u{11F50}-\\u{11F59}\\u{11FC0}-\\u{11FD4}\\u{12400}-\\u{1246E}\\u{16130}-\\u{16139}\\u{16A60}-\\u{16A69}\\u{16AC0}-\\u{16AC9}\\u{16B50}-\\u{16B59}\\u{16B5B}-\\u{16B61}\\u{16D70}-\\u{16D79}\\u{16E80}-\\u{16E96}\\u{16FF4}-\\u{16FF6}\\u{1CCF0}-\\u{1CCF9}\\u{1D2C0}-\\u{1D2D3}\\u{1D2E0}-\\u{1D2F3}\\u{1D360}-\\u{1D378}\\u{1D7CE}-\\u{1D7FF}\\u{1E140}-\\u{1E149}\\u{1E2F0}-\\u{1E2F9}\\u{1E4F0}-\\u{1E4F9}\\u{1E5F1}-\\u{1E5FA}\\u{1E8C7}-\\u{1E8CF}\\u{1E950}-\\u{1E959}\\u{1EC71}-\\u{1ECAB}\\u{1ECAD}-\\u{1ECAF}\\u{1ECB1}-\\u{1ECB4}\\u{1ED01}-\\u{1ED2D}\\u{1ED2F}-\\u{1ED3D}\\u{1F100}-\\u{1F10C}\\u{1FBF0}-\\u{1FBF9}]+", "gu"))) != null ? _text_match : [];
|
|
642
|
-
if (text.length > 60 || words.length > 10) return false;
|
|
643
|
-
const style = this.style(leaf.element);
|
|
644
|
-
const letters = text.replace(RegExp("[^\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7DC\\uA7F1-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD-\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}-\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}-\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}-\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10940}-\\u{10959}\\u{10980}-\\u{109B7}\\u{109BE}-\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}-\\u{10EB1}\\u{10EC2}-\\u{10EC7}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}-\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}-\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}-\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}-\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}-\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}-\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}-\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}-\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11DB0}-\\u{11DDB}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16EA0}-\\u{16EB8}\\u{16EBB}-\\u{16ED3}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}-\\u{16FE1}\\u{16FE3}\\u{16FF2}-\\u{16FF3}\\u{17000}-\\u{18CD5}\\u{18CFF}-\\u{18D1E}\\u{18D80}-\\u{18DF2}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}-\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E6C0}-\\u{1E6DE}\\u{1E6E0}-\\u{1E6E2}\\u{1E6E4}-\\u{1E6E5}\\u{1E6E7}-\\u{1E6ED}\\u{1E6F0}-\\u{1E6F4}\\u{1E6FE}-\\u{1E6FF}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}-\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B81D}\\u{2B820}-\\u{2CEAD}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{33479}]", "gu"), '');
|
|
645
|
-
const caps = letters.length >= 3 && letters === letters.toUpperCase() && letters !== letters.toLowerCase();
|
|
646
|
-
return caps || style.get('text-transform') === 'uppercase';
|
|
817
|
+
return siteImportIsEyebrowText(text, this.style(leaf.element));
|
|
647
818
|
}
|
|
648
819
|
/*---------------- rows ----------------*/ isRow(element) {
|
|
649
820
|
var _node_attrs_class, _style_get, _style_get1;
|
|
@@ -665,7 +836,9 @@ let LayoutReader = class LayoutReader {
|
|
|
665
836
|
const substantial = parts.filter((part)=>{
|
|
666
837
|
if (!isElementPart(part)) return false;
|
|
667
838
|
return this.leaves(part.element).some((leaf)=>{
|
|
668
|
-
if (!this.inRange(leaf, range)
|
|
839
|
+
if (!this.inRange(leaf, range)) return false;
|
|
840
|
+
if (leaf.kind === 'video') return true;
|
|
841
|
+
if (leaf.kind !== 'line') return false;
|
|
669
842
|
const block = this.block(leaf);
|
|
670
843
|
return (block == null ? void 0 : block.kind) === 'image' || (block == null ? void 0 : block.kind) === 'heading' || ((block == null ? void 0 : block.kind) === 'paragraph' || (block == null ? void 0 : block.kind) === 'list-item' || (block == null ? void 0 : block.kind) === 'quote') && !this.buttonStyle(leaf);
|
|
671
844
|
});
|
|
@@ -686,17 +859,24 @@ let LayoutReader = class LayoutReader {
|
|
|
686
859
|
var _groups_;
|
|
687
860
|
return group && !group.inline && group.group === ((_groups_ = groups[0]) == null ? void 0 : _groups_.group) && group.columns === 1;
|
|
688
861
|
})) {
|
|
862
|
+
var _groups_find;
|
|
689
863
|
const first = groups[0];
|
|
690
|
-
|
|
864
|
+
const boxed = groups.every((group)=>group == null ? void 0 : group.boxed);
|
|
865
|
+
// Framed in every cell but not boxed in all of them: the rule they draw (AGL-4138).
|
|
866
|
+
const rule = !boxed && groups.every((group)=>(group == null ? void 0 : group.boxed) || (group == null ? void 0 : group.rule)) ? (_groups_find = groups.find((group)=>group == null ? void 0 : group.rule)) == null ? void 0 : _groups_find.rule : undefined;
|
|
867
|
+
return _extends({
|
|
691
868
|
kind: 'group',
|
|
692
869
|
group: first.group,
|
|
693
870
|
columns: cells.length,
|
|
694
|
-
boxed
|
|
871
|
+
boxed
|
|
872
|
+
}, rule ? {
|
|
873
|
+
rule
|
|
874
|
+
} : {}, {
|
|
695
875
|
items: groups.flatMap((group)=>{
|
|
696
876
|
var _ref;
|
|
697
877
|
return (_ref = group == null ? void 0 : group.items) != null ? _ref : [];
|
|
698
878
|
})
|
|
699
|
-
};
|
|
879
|
+
});
|
|
700
880
|
}
|
|
701
881
|
return {
|
|
702
882
|
kind: 'row',
|
|
@@ -795,7 +975,7 @@ let LayoutReader = class LayoutReader {
|
|
|
795
975
|
let end = index + 1;
|
|
796
976
|
while(end < parts.length && keys[end] !== null && (keys[end] === key || loose[end] === kind && !!kind && kind.includes(',')))end += 1;
|
|
797
977
|
const count = end - index;
|
|
798
|
-
const boxed = count === 2 && row && parts.slice(index, end).every((part)=>isElementPart(part) && this.
|
|
978
|
+
const boxed = count === 2 && row && parts.slice(index, end).every((part)=>isElementPart(part) && this.framed(part.element));
|
|
799
979
|
// One element alone (a single list item) is not a group; a heading leaf is never an item.
|
|
800
980
|
const items = parts.slice(index, end);
|
|
801
981
|
const headings = items.every((part)=>{
|
|
@@ -835,27 +1015,69 @@ let LayoutReader = class LayoutReader {
|
|
|
835
1015
|
const block = this.block(lines[0]);
|
|
836
1016
|
return !!block && block.kind !== 'image' && block.kind !== 'heading' && block.text.length <= 40;
|
|
837
1017
|
}
|
|
838
|
-
|
|
1018
|
+
/**
|
|
1019
|
+
* How an item is drawn apart from the page (AGL-4138), it and the wrappers
|
|
1020
|
+
* inside it that hold all it holds: a BOX is a shadow, a fill of its own or
|
|
1021
|
+
* a border on two sides or more; a RULE a border on one side only, a step's
|
|
1022
|
+
* line over its number. Either one makes it framed.
|
|
1023
|
+
*/ frameOf(element) {
|
|
1024
|
+
let rule = null;
|
|
839
1025
|
let at = element;
|
|
840
1026
|
for(let depth = 0; depth < 3 && at >= 0; depth += 1){
|
|
841
1027
|
var _ref;
|
|
842
1028
|
var _this_elements_at;
|
|
843
1029
|
const style = this.style(at);
|
|
844
|
-
if (
|
|
1030
|
+
if (siteImportHasShadow(style)) return {
|
|
1031
|
+
box: true,
|
|
1032
|
+
rule: null
|
|
1033
|
+
};
|
|
845
1034
|
const fill = siteImportBackgroundOf(style).color;
|
|
846
|
-
if (fill && fill.a >= 0.5 && siteImportHex(fill) !== this.backgroundUnder(at)) return
|
|
1035
|
+
if (fill && fill.a >= 0.5 && siteImportHex(fill) !== this.backgroundUnder(at)) return {
|
|
1036
|
+
box: true,
|
|
1037
|
+
rule: null
|
|
1038
|
+
};
|
|
1039
|
+
const sides = siteImportBorderSides(style);
|
|
1040
|
+
const drawn = Object.keys(sides).filter((side)=>sides[side]);
|
|
1041
|
+
if (drawn.length >= 2) return {
|
|
1042
|
+
box: true,
|
|
1043
|
+
rule: null
|
|
1044
|
+
};
|
|
1045
|
+
const side = drawn[0];
|
|
1046
|
+
if (side && !rule) {
|
|
1047
|
+
var _this_backgroundUnder;
|
|
1048
|
+
const border = sides[side];
|
|
1049
|
+
const under = siteImportColorOf((_this_backgroundUnder = this.backgroundUnder(at)) != null ? _this_backgroundUnder : undefined);
|
|
1050
|
+
rule = {
|
|
1051
|
+
side,
|
|
1052
|
+
width: Math.max(1, Math.round(border.width)),
|
|
1053
|
+
color: border.color && border.color.a >= 0.05 ? siteImportHex(siteImportOpaque(border.color, under)) : null
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
847
1056
|
const children = ((_ref = (_this_elements_at = this.elements[at]) == null ? void 0 : _this_elements_at.children) != null ? _ref : []).filter((child)=>this.leaves(child).length);
|
|
848
1057
|
if (children.length !== 1) break;
|
|
849
1058
|
at = children[0];
|
|
850
1059
|
}
|
|
851
|
-
return
|
|
1060
|
+
return {
|
|
1061
|
+
box: false,
|
|
1062
|
+
rule
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
/** Whether an item is drawn apart from the page at all: a box or a rule (a border on any side, a shadow, a fill of its own). */ framed(element) {
|
|
1066
|
+
const frame = this.frameOf(element);
|
|
1067
|
+
return frame.box || !!frame.rule;
|
|
852
1068
|
}
|
|
853
1069
|
group(container, parts, range) {
|
|
1070
|
+
var _ref, _ref1;
|
|
1071
|
+
var _frames_find, _parts_;
|
|
854
1072
|
const items = parts.map((part)=>this.item(part.element, range));
|
|
855
1073
|
const chips = parts.length >= 4 && this.isRow(container) && parts.every((part)=>this.isChip(part.element, range));
|
|
856
1074
|
const kind = chips ? 'logos' : this.groupKind(parts.map((part)=>part.element), items, range);
|
|
857
1075
|
const columns = this.columnsOf(container, parts);
|
|
858
|
-
const
|
|
1076
|
+
const frames = parts.map((part)=>this.frameOf(part.element));
|
|
1077
|
+
const half = Math.ceil(parts.length / 2);
|
|
1078
|
+
const boxed = parts.length > 0 && frames.filter((frame)=>frame.box).length >= half;
|
|
1079
|
+
// Framed, most of them, but not boxed: the rule the first of them draws (AGL-4138).
|
|
1080
|
+
const ruled = !boxed && frames.filter((frame)=>frame.box || frame.rule).length >= half ? (_ref = (_frames_find = frames.find((frame)=>frame.rule)) == null ? void 0 : _frames_find.rule) != null ? _ref : null : null;
|
|
859
1081
|
// A step's number and a stat's figure lead their item.
|
|
860
1082
|
if (kind === 'steps' || kind === 'stats') {
|
|
861
1083
|
for (const item of items){
|
|
@@ -866,11 +1088,11 @@ let LayoutReader = class LayoutReader {
|
|
|
866
1088
|
if (lead !== undefined && (kind === 'steps' ? STEP_NUMBER.test(text.trim()) : FIGURE.test(text.trim()) || text.length <= 14)) {
|
|
867
1089
|
item.figure = lead;
|
|
868
1090
|
if (item.title === lead) {
|
|
869
|
-
var
|
|
1091
|
+
var _ref2;
|
|
870
1092
|
var _item_text1, _item_text2;
|
|
871
1093
|
delete item.title;
|
|
872
1094
|
const next = (_item_text1 = item.text) == null ? void 0 : _item_text1.find((ref)=>this.lineText(ref).length <= 80);
|
|
873
|
-
if (next !== undefined && ((
|
|
1095
|
+
if (next !== undefined && ((_ref2 = (_item_text2 = item.text) == null ? void 0 : _item_text2.length) != null ? _ref2 : 0) > 1) {
|
|
874
1096
|
item.title = next;
|
|
875
1097
|
dropLine(item, 'text', next);
|
|
876
1098
|
}
|
|
@@ -878,6 +1100,14 @@ let LayoutReader = class LayoutReader {
|
|
|
878
1100
|
if (item.text && !item.text.length) delete item.text;
|
|
879
1101
|
}
|
|
880
1102
|
}
|
|
1103
|
+
// A step's number the source sets in its muted words' grey, not its brand (AGL-4138).
|
|
1104
|
+
items.forEach((item, at)=>{
|
|
1105
|
+
var _ref;
|
|
1106
|
+
var _parts_at;
|
|
1107
|
+
const leaf = item.figure === undefined ? undefined : this.leaves((_ref = (_parts_at = parts[at]) == null ? void 0 : _parts_at.element) != null ? _ref : -1).find((entry)=>entry.kind === 'line' && entry.ref === item.figure);
|
|
1108
|
+
const ink = leaf ? this.inkOf(leaf.element) : null;
|
|
1109
|
+
if (ink && siteImportIsMutedInk(ink)) item.figureMuted = true;
|
|
1110
|
+
});
|
|
881
1111
|
}
|
|
882
1112
|
if (kind === 'faq') {
|
|
883
1113
|
for (const item of items){
|
|
@@ -916,17 +1146,63 @@ let LayoutReader = class LayoutReader {
|
|
|
916
1146
|
return this.takeBadge(item, (_parts_at = parts[at]) == null ? void 0 : _parts_at.element, range);
|
|
917
1147
|
});
|
|
918
1148
|
const inline = columns === 1 && (kind === 'cards' || kind === 'pricing') && parts.every((part)=>this.isWordRow(part.element, range));
|
|
1149
|
+
const columnsSm = this.columnsSmOf(container, parts, columns);
|
|
1150
|
+
const align = this.itemsAlignOf((_ref1 = (_parts_ = parts[0]) == null ? void 0 : _parts_.element) != null ? _ref1 : -1, items[0], range);
|
|
919
1151
|
return _extends({
|
|
920
1152
|
kind: 'group',
|
|
921
1153
|
group: kind,
|
|
922
|
-
columns
|
|
1154
|
+
columns
|
|
1155
|
+
}, columnsSm !== null ? {
|
|
1156
|
+
columnsSm
|
|
1157
|
+
} : {}, {
|
|
923
1158
|
boxed
|
|
924
|
-
},
|
|
1159
|
+
}, ruled ? {
|
|
1160
|
+
rule: ruled
|
|
1161
|
+
} : {}, align ? {
|
|
1162
|
+
align
|
|
1163
|
+
} : {}, inline ? {
|
|
925
1164
|
inline: true
|
|
926
1165
|
} : {}, {
|
|
927
1166
|
items
|
|
928
1167
|
});
|
|
929
1168
|
}
|
|
1169
|
+
/**
|
|
1170
|
+
* How an item's words are set (AGL-4138): centered where its name's
|
|
1171
|
+
* element centers its text or its own column centers what it holds, else
|
|
1172
|
+
* at the start. `keepOwnAlign` drops it where the section reads the same.
|
|
1173
|
+
*/ itemsAlignOf(element, item, range) {
|
|
1174
|
+
var _ref, _column_get, _column_get1;
|
|
1175
|
+
var _item_text;
|
|
1176
|
+
const ref = (_ref = item == null ? void 0 : item.title) != null ? _ref : item == null ? void 0 : (_item_text = item.text) == null ? void 0 : _item_text[0];
|
|
1177
|
+
if (element < 0 || ref === undefined) return null;
|
|
1178
|
+
const leaf = this.leaves(element).find((entry)=>entry.kind === 'line' && entry.ref === ref);
|
|
1179
|
+
if (!leaf) return null;
|
|
1180
|
+
if (this.style(leaf.element).get('text-align') === 'center') return 'center';
|
|
1181
|
+
const column = this.style(this.unwrap(element, range));
|
|
1182
|
+
if (/\bflex\b/.test((_column_get = column.get('display')) != null ? _column_get : '') && /column/.test((_column_get1 = column.get('flex-direction')) != null ? _column_get1 : '') && column.get('align-items') === 'center') return 'center';
|
|
1183
|
+
return 'start';
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* The columns a group's items sit in on a tablet (AGL-4138), where it is
|
|
1187
|
+
* fewer than on a wide screen and more than one: a framework's `sm` size on
|
|
1188
|
+
* its cells, else the grid the container lays out at a tablet's width.
|
|
1189
|
+
*/ columnsSmOf(container, parts, columns) {
|
|
1190
|
+
var _ref, _ref1, _exec;
|
|
1191
|
+
var _this_elements_, _parts_;
|
|
1192
|
+
if (columns <= 2) return null;
|
|
1193
|
+
const classes = (_ref = (_this_elements_ = this.elements[(_ref1 = (_parts_ = parts[0]) == null ? void 0 : _parts_.element) != null ? _ref1 : -1]) == null ? void 0 : _this_elements_.attrs.class) != null ? _ref : '';
|
|
1194
|
+
const sized = (_exec = /\bMuiGrid-grid-sm-(\d+)\b/.exec(classes)) != null ? _exec : /\bcol-sm-(\d{1,2})\b/.exec(classes);
|
|
1195
|
+
let count = null;
|
|
1196
|
+
if (sized) count = Math.round(12 / Math.max(1, Number(sized[1])));
|
|
1197
|
+
else {
|
|
1198
|
+
var _this_tabletStyles, _style_get;
|
|
1199
|
+
(_this_tabletStyles = this.tabletStyles) != null ? _this_tabletStyles : this.tabletStyles = this.tabletStylesOf();
|
|
1200
|
+
const style = this.tabletStyles.of(container);
|
|
1201
|
+
const template = /\bgrid\b/.test((_style_get = style.get('display')) != null ? _style_get : '') ? siteImportGridColumns(style.get('grid-template-columns')) : null;
|
|
1202
|
+
if (template) count = template.length;
|
|
1203
|
+
}
|
|
1204
|
+
return count !== null && count >= 2 && count < columns ? count : null;
|
|
1205
|
+
}
|
|
930
1206
|
/** The line of an item that says what its price is for, beside the price: taken out of its words. */ takePeriod(item, element, range) {
|
|
931
1207
|
var _item_text;
|
|
932
1208
|
if (item.figure === undefined) return;
|
|
@@ -991,6 +1267,7 @@ let LayoutReader = class LayoutReader {
|
|
|
991
1267
|
return block.kind === 'image' ? block.alt : block.text;
|
|
992
1268
|
}
|
|
993
1269
|
/** One item's lines, each in exactly one of its parts. */ item(element, range) {
|
|
1270
|
+
var _ref;
|
|
994
1271
|
var _this_elements_element;
|
|
995
1272
|
const leaves = this.leaves(element).filter((leaf)=>this.inRange(leaf, range));
|
|
996
1273
|
const item = {
|
|
@@ -1019,11 +1296,21 @@ let LayoutReader = class LayoutReader {
|
|
|
1019
1296
|
}
|
|
1020
1297
|
if (item.icon !== undefined && item.icon === item.listIcon && !lines.length) delete item.icon;
|
|
1021
1298
|
const rest = lines.filter((leaf)=>!listed.has(leaf.ref));
|
|
1022
|
-
|
|
1299
|
+
// A film the item holds (AGL-4140): its poster is the item's picture.
|
|
1300
|
+
const film = leaves.find((leaf)=>leaf.kind === 'video');
|
|
1301
|
+
if (film) item.video = film.ref;
|
|
1302
|
+
const image = (_ref = film ? rest.find((leaf)=>{
|
|
1303
|
+
var _this_block;
|
|
1304
|
+
return ((_this_block = this.block(leaf)) == null ? void 0 : _this_block.kind) === 'image' && this.videoHolding(leaf.element) === film.element;
|
|
1305
|
+
}) : undefined) != null ? _ref : rest.find((leaf)=>{
|
|
1023
1306
|
var _this_block;
|
|
1024
1307
|
return ((_this_block = this.block(leaf)) == null ? void 0 : _this_block.kind) === 'image';
|
|
1025
1308
|
});
|
|
1026
|
-
if (image)
|
|
1309
|
+
if (image) {
|
|
1310
|
+
item.image = image.ref;
|
|
1311
|
+
const fit = this.pictureFit(image);
|
|
1312
|
+
if (fit) item.imageFit = fit;
|
|
1313
|
+
}
|
|
1027
1314
|
const words = rest.filter((leaf)=>leaf !== image);
|
|
1028
1315
|
// Its own calls to action: every link it draws as a button, wherever it
|
|
1029
1316
|
// sits (a plan's button sits above its features), and the links and
|
|
@@ -1082,9 +1369,47 @@ let LayoutReader = class LayoutReader {
|
|
|
1082
1369
|
const href = wrap !== null ? this.anchorHref(wrap) : null;
|
|
1083
1370
|
if (href) item.to = href;
|
|
1084
1371
|
}
|
|
1372
|
+
// The square its lead icon sits in, and the arrow at the end of its first row (AGL-4138).
|
|
1373
|
+
if (leadIcon) {
|
|
1374
|
+
const tile = this.tileOf(leadIcon, element);
|
|
1375
|
+
if (tile) item.tile = tile;
|
|
1376
|
+
}
|
|
1377
|
+
const mark = this.markOf(leaves, leadIcon, listed, element, item.to);
|
|
1378
|
+
if (mark !== undefined) item.mark = mark;
|
|
1085
1379
|
return item;
|
|
1086
1380
|
}
|
|
1087
1381
|
/**
|
|
1382
|
+
* A second icon of an item that says where it goes (AGL-4138): an icon
|
|
1383
|
+
* alone in a link to the item's own address (a card's "↗"), or one in the
|
|
1384
|
+
* row its lead icon sits in. Never a bullet's mark.
|
|
1385
|
+
*/ markOf(leaves, lead, listed, item, to) {
|
|
1386
|
+
var _ref;
|
|
1387
|
+
var _this_elements_leaf_element;
|
|
1388
|
+
const bullets = new Set();
|
|
1389
|
+
for (const leaf of leaves)if (leaf.kind === 'line' && listed.has(leaf.ref)) bullets.add((_ref = (_this_elements_leaf_element = this.elements[leaf.element]) == null ? void 0 : _this_elements_leaf_element.parent) != null ? _ref : -1);
|
|
1390
|
+
const same = (a, b)=>!!a && !!b && a.replace(/\/+$/, '') === b.replace(/\/+$/, '');
|
|
1391
|
+
for (const leaf of leaves){
|
|
1392
|
+
var _ref1, _ref2;
|
|
1393
|
+
var _this_elements_leaf_element1, _this_elements_parent;
|
|
1394
|
+
if (leaf.kind !== 'icon' || leaf === lead) continue;
|
|
1395
|
+
const parent = (_ref1 = (_this_elements_leaf_element1 = this.elements[leaf.element]) == null ? void 0 : _this_elements_leaf_element1.parent) != null ? _ref1 : -1;
|
|
1396
|
+
if (bullets.has(parent) || bullets.has((_ref2 = (_this_elements_parent = this.elements[parent]) == null ? void 0 : _this_elements_parent.parent) != null ? _ref2 : -1)) continue;
|
|
1397
|
+
const link = this.wrapperOf(leaf.element, [
|
|
1398
|
+
'a'
|
|
1399
|
+
], 3);
|
|
1400
|
+
if (link !== null && link !== item && this.refsIn(link, [
|
|
1401
|
+
-1,
|
|
1402
|
+
Number.POSITIVE_INFINITY
|
|
1403
|
+
]).length === 0 && same(this.anchorHref(link), to)) return leaf.ref;
|
|
1404
|
+
const row = lead ? this.commonAncestor([
|
|
1405
|
+
lead.element,
|
|
1406
|
+
leaf.element
|
|
1407
|
+
]) : null;
|
|
1408
|
+
if (row !== null && row !== item && this.contains(item, row) && this.isRow(row) && !this.leaves(row).some((entry)=>entry.kind === 'line')) return leaf.ref;
|
|
1409
|
+
}
|
|
1410
|
+
return undefined;
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1088
1413
|
* Runs of three or more one-line entries built alike anywhere inside an
|
|
1089
1414
|
* item (a plan's features, each a check mark and a line), each run its
|
|
1090
1415
|
* entries' elements. The item itself is never one of them.
|
|
@@ -1132,7 +1457,7 @@ let LayoutReader = class LayoutReader {
|
|
|
1132
1457
|
var _item_text;
|
|
1133
1458
|
return item.title !== undefined && ((_ref = (_item_text = item.text) == null ? void 0 : _item_text.length) != null ? _ref : 0) > 0;
|
|
1134
1459
|
});
|
|
1135
|
-
const boxed = elements.filter((element)=>this.
|
|
1460
|
+
const boxed = elements.filter((element)=>this.framed(element)).length >= Math.ceil(elements.length / 2);
|
|
1136
1461
|
if (visual >= 0.6 && titled >= 0.6 || boxed && share((item)=>item.lines.length >= 2) >= 0.6) return 'cards';
|
|
1137
1462
|
if (share((item)=>item.lines.length === 1) >= 0.8) return 'list';
|
|
1138
1463
|
if (titled >= 0.6) return 'cards';
|
|
@@ -1394,7 +1719,7 @@ let LayoutReader = class LayoutReader {
|
|
|
1394
1719
|
return false;
|
|
1395
1720
|
}
|
|
1396
1721
|
/*---------------- the hero ----------------*/ markHero(sections) {
|
|
1397
|
-
var _hero_backdrop;
|
|
1722
|
+
var _hero_backdrop, _hero_backdrop1;
|
|
1398
1723
|
const mainBlocks = this.mainBlocks();
|
|
1399
1724
|
const hero = sections.find((section)=>section.lines.some((ref)=>{
|
|
1400
1725
|
var _mainBlocks_ref;
|
|
@@ -1402,7 +1727,7 @@ let LayoutReader = class LayoutReader {
|
|
|
1402
1727
|
}));
|
|
1403
1728
|
if (!hero) return;
|
|
1404
1729
|
let picture = null;
|
|
1405
|
-
if (((_hero_backdrop = hero.backdrop) == null ? void 0 : _hero_backdrop.kind) === 'picture') picture = 'behind';
|
|
1730
|
+
if (((_hero_backdrop = hero.backdrop) == null ? void 0 : _hero_backdrop.kind) === 'picture' || ((_hero_backdrop1 = hero.backdrop) == null ? void 0 : _hero_backdrop1.kind) === 'video') picture = 'behind';
|
|
1406
1731
|
else {
|
|
1407
1732
|
const h1 = hero.lines.find((ref)=>{
|
|
1408
1733
|
var _mainBlocks_ref;
|
|
@@ -1443,16 +1768,19 @@ let LayoutReader = class LayoutReader {
|
|
|
1443
1768
|
linesOf(nodes) {
|
|
1444
1769
|
return siteImportLayoutLines(nodes);
|
|
1445
1770
|
}
|
|
1446
|
-
constructor(structure, blocks, styles, wideStylesOf){
|
|
1771
|
+
constructor(structure, blocks, styles, wideStylesOf, tabletStylesOf = ()=>styles, videos = []){
|
|
1447
1772
|
var _siteImportFontSizePx;
|
|
1448
1773
|
this.structure = structure;
|
|
1449
1774
|
this.blocks = blocks;
|
|
1450
1775
|
this.styles = styles;
|
|
1451
1776
|
this.wideStylesOf = wideStylesOf;
|
|
1777
|
+
this.tabletStylesOf = tabletStylesOf;
|
|
1778
|
+
this.videos = videos;
|
|
1452
1779
|
/** Each element's leaves, its subtree's, in order (memoized). */ this.leafMemo = new Map();
|
|
1453
1780
|
/** Tab panels a tab strip has read already. */ this.usedPanels = new Set();
|
|
1454
1781
|
this.bodySize = 16;
|
|
1455
1782
|
this.wideStyles = null;
|
|
1783
|
+
this.tabletStyles = null;
|
|
1456
1784
|
this.mainBlocksMemo = null;
|
|
1457
1785
|
this.tabsMemo = null;
|
|
1458
1786
|
this.elements = structure.elements;
|
|
@@ -1474,8 +1802,8 @@ let LayoutReader = class LayoutReader {
|
|
|
1474
1802
|
});
|
|
1475
1803
|
});
|
|
1476
1804
|
for (const element of this.elements){
|
|
1477
|
-
var _element_order, _element_order1;
|
|
1478
|
-
var _this_own_element_id, _this_own_element_id1;
|
|
1805
|
+
var _element_order, _element_order1, _element_order2;
|
|
1806
|
+
var _this_own_element_id, _this_own_element_id1, _this_own_element_id2;
|
|
1479
1807
|
if (element.region !== 'main' || element.nav) continue;
|
|
1480
1808
|
if (element.icon !== undefined) (_this_own_element_id = this.own[element.id]) == null ? void 0 : _this_own_element_id.push({
|
|
1481
1809
|
order: (_element_order = element.order) != null ? _element_order : 0,
|
|
@@ -1489,17 +1817,92 @@ let LayoutReader = class LayoutReader {
|
|
|
1489
1817
|
ref: element.form,
|
|
1490
1818
|
element: element.id
|
|
1491
1819
|
});
|
|
1820
|
+
if (element.video !== undefined) (_this_own_element_id2 = this.own[element.id]) == null ? void 0 : _this_own_element_id2.push({
|
|
1821
|
+
order: (_element_order2 = element.order) != null ? _element_order2 : 0,
|
|
1822
|
+
kind: 'video',
|
|
1823
|
+
ref: element.video,
|
|
1824
|
+
element: element.id
|
|
1825
|
+
});
|
|
1492
1826
|
}
|
|
1493
1827
|
const body = structure.body >= 0 ? structure.body : -2;
|
|
1494
1828
|
this.bodySize = (_siteImportFontSizePx = siteImportFontSizePx(styles.of(body))) != null ? _siteImportFontSizePx : 16;
|
|
1495
1829
|
}
|
|
1496
1830
|
};
|
|
1831
|
+
/** Drops a group's own alignment where its section reads the same (AGL-4138): only an item set apart from its section says how. */ function keepOwnAlign(nodes, align) {
|
|
1832
|
+
for (const node of nodes){
|
|
1833
|
+
if (node.kind === 'group' && node.align === align) delete node.align;
|
|
1834
|
+
else if (node.kind === 'row') for (const cell of node.cells)keepOwnAlign(cell.nodes, align);
|
|
1835
|
+
else if (node.kind === 'tabs') for (const tab of node.tabs)keepOwnAlign(tab.panel, align);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
/** Whether a short line reads as an eyebrow: ten words at most, in capitals or set in them. */ export function siteImportIsEyebrowText(text, style) {
|
|
1839
|
+
var _text_match;
|
|
1840
|
+
const words = (_text_match = text.match(RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7DC\\uA7F1-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD-\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}-\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}-\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}-\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10940}-\\u{10959}\\u{10980}-\\u{109B7}\\u{109BE}-\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}-\\u{10EB1}\\u{10EC2}-\\u{10EC7}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}-\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}-\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}-\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}-\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}-\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}-\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}-\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}-\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11DB0}-\\u{11DDB}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16EA0}-\\u{16EB8}\\u{16EBB}-\\u{16ED3}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}-\\u{16FE1}\\u{16FE3}\\u{16FF2}-\\u{16FF3}\\u{17000}-\\u{18CD5}\\u{18CFF}-\\u{18D1E}\\u{18D80}-\\u{18DF2}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}-\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E6C0}-\\u{1E6DE}\\u{1E6E0}-\\u{1E6E2}\\u{1E6E4}-\\u{1E6E5}\\u{1E6E7}-\\u{1E6ED}\\u{1E6F0}-\\u{1E6F4}\\u{1E6FE}-\\u{1E6FF}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}-\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B81D}\\u{2B820}-\\u{2CEAD}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{33479}\\u0030-\\u0039\\u00B2-\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D58-\\u0D5E\\u0D66-\\u0D78\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\\u{10107}-\\u{10133}\\u{10140}-\\u{10178}\\u{1018A}-\\u{1018B}\\u{102E1}-\\u{102FB}\\u{10320}-\\u{10323}\\u{10341}\\u{1034A}\\u{103D1}-\\u{103D5}\\u{104A0}-\\u{104A9}\\u{10858}-\\u{1085F}\\u{10879}-\\u{1087F}\\u{108A7}-\\u{108AF}\\u{108FB}-\\u{108FF}\\u{10916}-\\u{1091B}\\u{109BC}-\\u{109BD}\\u{109C0}-\\u{109CF}\\u{109D2}-\\u{109FF}\\u{10A40}-\\u{10A48}\\u{10A7D}-\\u{10A7E}\\u{10A9D}-\\u{10A9F}\\u{10AEB}-\\u{10AEF}\\u{10B58}-\\u{10B5F}\\u{10B78}-\\u{10B7F}\\u{10BA9}-\\u{10BAF}\\u{10CFA}-\\u{10CFF}\\u{10D30}-\\u{10D39}\\u{10D40}-\\u{10D49}\\u{10E60}-\\u{10E7E}\\u{10F1D}-\\u{10F26}\\u{10F51}-\\u{10F54}\\u{10FC5}-\\u{10FCB}\\u{11052}-\\u{1106F}\\u{110F0}-\\u{110F9}\\u{11136}-\\u{1113F}\\u{111D0}-\\u{111D9}\\u{111E1}-\\u{111F4}\\u{112F0}-\\u{112F9}\\u{11450}-\\u{11459}\\u{114D0}-\\u{114D9}\\u{11650}-\\u{11659}\\u{116C0}-\\u{116C9}\\u{116D0}-\\u{116E3}\\u{11730}-\\u{1173B}\\u{118E0}-\\u{118F2}\\u{11950}-\\u{11959}\\u{11BF0}-\\u{11BF9}\\u{11C50}-\\u{11C6C}\\u{11D50}-\\u{11D59}\\u{11DA0}-\\u{11DA9}\\u{11DE0}-\\u{11DE9}\\u{11F50}-\\u{11F59}\\u{11FC0}-\\u{11FD4}\\u{12400}-\\u{1246E}\\u{16130}-\\u{16139}\\u{16A60}-\\u{16A69}\\u{16AC0}-\\u{16AC9}\\u{16B50}-\\u{16B59}\\u{16B5B}-\\u{16B61}\\u{16D70}-\\u{16D79}\\u{16E80}-\\u{16E96}\\u{16FF4}-\\u{16FF6}\\u{1CCF0}-\\u{1CCF9}\\u{1D2C0}-\\u{1D2D3}\\u{1D2E0}-\\u{1D2F3}\\u{1D360}-\\u{1D378}\\u{1D7CE}-\\u{1D7FF}\\u{1E140}-\\u{1E149}\\u{1E2F0}-\\u{1E2F9}\\u{1E4F0}-\\u{1E4F9}\\u{1E5F1}-\\u{1E5FA}\\u{1E8C7}-\\u{1E8CF}\\u{1E950}-\\u{1E959}\\u{1EC71}-\\u{1ECAB}\\u{1ECAD}-\\u{1ECAF}\\u{1ECB1}-\\u{1ECB4}\\u{1ED01}-\\u{1ED2D}\\u{1ED2F}-\\u{1ED3D}\\u{1F100}-\\u{1F10C}\\u{1FBF0}-\\u{1FBF9}]+", "gu"))) != null ? _text_match : [];
|
|
1841
|
+
if (text.length > 60 || words.length > 10) return false;
|
|
1842
|
+
const letters = text.replace(RegExp("[^\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7DC\\uA7F1-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD-\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}-\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}-\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}-\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10940}-\\u{10959}\\u{10980}-\\u{109B7}\\u{109BE}-\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}-\\u{10EB1}\\u{10EC2}-\\u{10EC7}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}-\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}-\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}-\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}-\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}-\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}-\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}-\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}-\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11DB0}-\\u{11DDB}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16EA0}-\\u{16EB8}\\u{16EBB}-\\u{16ED3}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}-\\u{16FE1}\\u{16FE3}\\u{16FF2}-\\u{16FF3}\\u{17000}-\\u{18CD5}\\u{18CFF}-\\u{18D1E}\\u{18D80}-\\u{18DF2}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}-\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E6C0}-\\u{1E6DE}\\u{1E6E0}-\\u{1E6E2}\\u{1E6E4}-\\u{1E6E5}\\u{1E6E7}-\\u{1E6ED}\\u{1E6F0}-\\u{1E6F4}\\u{1E6FE}-\\u{1E6FF}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}-\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B81D}\\u{2B820}-\\u{2CEAD}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{33479}]", "gu"), '');
|
|
1843
|
+
const caps = letters.length >= 3 && letters === letters.toUpperCase() && letters !== letters.toLowerCase();
|
|
1844
|
+
return caps || style.get('text-transform') === 'uppercase';
|
|
1845
|
+
}
|
|
1846
|
+
/** A font weight as a number: `700`, `bold` 700, `normal` 400. */ export function siteImportFontWeight(style) {
|
|
1847
|
+
var _ref;
|
|
1848
|
+
var _style_get;
|
|
1849
|
+
const value = (_ref = (_style_get = style.get('font-weight')) == null ? void 0 : _style_get.trim()) != null ? _ref : '';
|
|
1850
|
+
if (/^\d{3}$/.test(value)) return Number(value);
|
|
1851
|
+
if (/^(?:bold|bolder)$/.test(value)) return 700;
|
|
1852
|
+
if (value === 'lighter') return 300;
|
|
1853
|
+
return 400;
|
|
1854
|
+
}
|
|
1855
|
+
/** Whether a color is a muted words' grey (AGL-4138): no hue to speak of, lighter than the words' ink and darker than a rule. */ export function siteImportIsMutedInk(hex) {
|
|
1856
|
+
const color = siteImportColorOf(hex);
|
|
1857
|
+
if (!color) return false;
|
|
1858
|
+
const light = siteImportLuminance(color);
|
|
1859
|
+
return siteImportSaturation(color) < 0.15 && light >= 0.06 && light <= 0.6;
|
|
1860
|
+
}
|
|
1497
1861
|
/** Takes a line out of one of an item's lists; a list left empty goes, never left undefined (Firestore holds no undefined). */ function dropLine(item, key, ref) {
|
|
1498
1862
|
var _item_key;
|
|
1499
1863
|
const list = (_item_key = item[key]) == null ? void 0 : _item_key.filter((entry)=>entry !== ref);
|
|
1500
1864
|
if (list == null ? void 0 : list.length) item[key] = list;
|
|
1501
1865
|
else delete item[key];
|
|
1502
1866
|
}
|
|
1867
|
+
/** Every video node of a section, rows and tab panels opened (AGL-4140). */ function siteImportVideoNodes(nodes) {
|
|
1868
|
+
return nodes.flatMap((node)=>{
|
|
1869
|
+
if (node.kind === 'video') return [
|
|
1870
|
+
node
|
|
1871
|
+
];
|
|
1872
|
+
if (node.kind === 'row') return node.cells.flatMap((cell)=>siteImportVideoNodes(cell.nodes));
|
|
1873
|
+
if (node.kind === 'tabs') return node.tabs.flatMap((tab)=>siteImportVideoNodes(tab.panel));
|
|
1874
|
+
return [];
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
/** A section's nodes with one video taken out, as its backdrop takes it; a cell or a row left empty goes. */ function withoutVideo(nodes, video) {
|
|
1878
|
+
return nodes.flatMap((node)=>{
|
|
1879
|
+
if (node.kind === 'video') return node.video === video ? [] : [
|
|
1880
|
+
node
|
|
1881
|
+
];
|
|
1882
|
+
if (node.kind === 'row') {
|
|
1883
|
+
const cells = node.cells.map((cell)=>({
|
|
1884
|
+
nodes: withoutVideo(cell.nodes, video)
|
|
1885
|
+
}));
|
|
1886
|
+
const kept = cells.filter((cell)=>cell.nodes.length);
|
|
1887
|
+
if (!kept.length) return [];
|
|
1888
|
+
return kept.length === 1 ? kept[0].nodes : [
|
|
1889
|
+
_extends({}, node, {
|
|
1890
|
+
cells
|
|
1891
|
+
})
|
|
1892
|
+
];
|
|
1893
|
+
}
|
|
1894
|
+
if (node.kind === 'tabs') return [
|
|
1895
|
+
_extends({}, node, {
|
|
1896
|
+
tabs: node.tabs.map((tab)=>_extends({}, tab, {
|
|
1897
|
+
panel: withoutVideo(tab.panel, video)
|
|
1898
|
+
}))
|
|
1899
|
+
})
|
|
1900
|
+
];
|
|
1901
|
+
return [
|
|
1902
|
+
node
|
|
1903
|
+
];
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1503
1906
|
/** Rows of cells of lines, as objects: a Firestore document holds no array inside an array. */ function tableRows(rows) {
|
|
1504
1907
|
return rows.map((row)=>({
|
|
1505
1908
|
cells: row.map((lines)=>({
|
|
@@ -1571,13 +1974,14 @@ function mode(values) {
|
|
|
1571
1974
|
}
|
|
1572
1975
|
return families;
|
|
1573
1976
|
}
|
|
1574
|
-
/** The look facts of a page read with its structure, through its linked stylesheets' text. */ export function siteImportLookOf(page, stylesheets = []) {
|
|
1977
|
+
/** The look facts of a page read with its structure, through its linked stylesheets' text; its blocks, where given, for its eyebrows' color. */ export function siteImportLookOf(page, stylesheets = []) {
|
|
1978
|
+
var _page_blocks;
|
|
1575
1979
|
if (!page.structure) return null;
|
|
1576
1980
|
const css = siteImportCssOf([
|
|
1577
1981
|
...page.structure.styles,
|
|
1578
1982
|
...stylesheets
|
|
1579
1983
|
]);
|
|
1580
|
-
return siteImportLookFacts(page.structure, siteImportStylesOf(page.structure, css), css.fontFaces);
|
|
1984
|
+
return siteImportLookFacts(page.structure, siteImportStylesOf(page.structure, css), css.fontFaces, (_page_blocks = page.blocks) != null ? _page_blocks : []);
|
|
1581
1985
|
}
|
|
1582
1986
|
/**
|
|
1583
1987
|
* The look facts of a page's markup and the stylesheets it links (AGL-4106),
|
|
@@ -1593,15 +1997,64 @@ function mode(values) {
|
|
|
1593
1997
|
structure: true
|
|
1594
1998
|
});
|
|
1595
1999
|
return extract.structure ? siteImportLookOf({
|
|
1596
|
-
structure: extract.structure
|
|
2000
|
+
structure: extract.structure,
|
|
2001
|
+
blocks: extract.blocks
|
|
1597
2002
|
}, stylesheets) : null;
|
|
1598
2003
|
}
|
|
2004
|
+
/** How far two colors may sit apart and still be one (AGL-4138), in OKLab. */ const SAME_COLOR = 0.1;
|
|
2005
|
+
/**
|
|
2006
|
+
* The color most of a page's eyebrows are drawn in (AGL-4138), where it is a
|
|
2007
|
+
* color of its own: not the words' ink, the buttons' fill, the links' color
|
|
2008
|
+
* or white, and no grey. `null` where its eyebrows are none, or drawn in one
|
|
2009
|
+
* of those.
|
|
2010
|
+
*/ function eyebrowColorOf(structure, styles, blocks, not) {
|
|
2011
|
+
var _sort_;
|
|
2012
|
+
const counts = new Map();
|
|
2013
|
+
const inControl = (element)=>{
|
|
2014
|
+
var _ref;
|
|
2015
|
+
var _structure_elements_at;
|
|
2016
|
+
for(let at = element, depth = 0; at >= 0 && depth <= 3; at = (_ref = (_structure_elements_at = structure.elements[at]) == null ? void 0 : _structure_elements_at.parent) != null ? _ref : -1, depth += 1){
|
|
2017
|
+
var _ref1;
|
|
2018
|
+
var _structure_elements_at1;
|
|
2019
|
+
if (/^(?:a|button)$/.test((_ref1 = (_structure_elements_at1 = structure.elements[at]) == null ? void 0 : _structure_elements_at1.tag) != null ? _ref1 : '')) return true;
|
|
2020
|
+
}
|
|
2021
|
+
return false;
|
|
2022
|
+
};
|
|
2023
|
+
structure.blockElement.forEach((element, index)=>{
|
|
2024
|
+
var _counts_get;
|
|
2025
|
+
const block = blocks[index];
|
|
2026
|
+
// A button's or a link's words set in capitals are no eyebrow.
|
|
2027
|
+
if ((block == null ? void 0 : block.kind) !== 'paragraph' || block.region !== 'main' || inControl(element)) return;
|
|
2028
|
+
const style = styles.of(element);
|
|
2029
|
+
if (!siteImportIsEyebrowText(block.text, style)) return;
|
|
2030
|
+
const color = siteImportColorOf(style.get('color'));
|
|
2031
|
+
if (!color || color.a < 0.5) return;
|
|
2032
|
+
const hex = siteImportHex(siteImportOpaque(color));
|
|
2033
|
+
counts.set(hex, ((_counts_get = counts.get(hex)) != null ? _counts_get : 0) + 1);
|
|
2034
|
+
});
|
|
2035
|
+
const top = (_sort_ = [
|
|
2036
|
+
...counts.entries()
|
|
2037
|
+
].sort((a, b)=>b[1] - a[1])[0]) == null ? void 0 : _sort_[0];
|
|
2038
|
+
const own = top ? siteImportColorOf(top) : null;
|
|
2039
|
+
// A grey is the words' own muted color, never a color of the site's.
|
|
2040
|
+
if (!top || !own || siteImportSaturation(own) < 0.25) return null;
|
|
2041
|
+
const others = [
|
|
2042
|
+
...not,
|
|
2043
|
+
'#ffffff'
|
|
2044
|
+
].flatMap((hex)=>{
|
|
2045
|
+
const color = siteImportColorOf(hex != null ? hex : undefined);
|
|
2046
|
+
return color ? [
|
|
2047
|
+
siteImportOpaque(color)
|
|
2048
|
+
] : [];
|
|
2049
|
+
});
|
|
2050
|
+
return others.some((other)=>siteImportColorDistance(own, other) < SAME_COLOR) ? null : top;
|
|
2051
|
+
}
|
|
1599
2052
|
/**
|
|
1600
2053
|
* What the source's look is made of (AGL-4106): its fonts, its page's
|
|
1601
2054
|
* background and text, its filled buttons' fill, text and corners, its links'
|
|
1602
|
-
* color
|
|
1603
|
-
*/ export function siteImportLookFacts(structure, styles, fontFaces = []) {
|
|
1604
|
-
var _ref, _siteImportFontFamilies_, _elements_find, _siteImportFontFamilies_1, _siteImportBackgroundOf_color, _ref1, _ref2, _elements_find1, _ref3, _ref4, _ref5;
|
|
2055
|
+
* color, its header's background, and its eyebrows' own color (AGL-4138).
|
|
2056
|
+
*/ export function siteImportLookFacts(structure, styles, fontFaces = [], blocks = []) {
|
|
2057
|
+
var _ref, _siteImportFontFamilies_, _elements_find, _siteImportFontFamilies_1, _siteImportBackgroundOf_color, _ref1, _ref2, _elements_find1, _ref3, _ref4, _ref5, _ref6;
|
|
1605
2058
|
var _filter_sort_;
|
|
1606
2059
|
const { elements } = structure;
|
|
1607
2060
|
const body = structure.body >= 0 ? structure.body : -2;
|
|
@@ -1626,13 +2079,13 @@ function mode(values) {
|
|
|
1626
2079
|
const fills = new Map();
|
|
1627
2080
|
const linkColors = new Map();
|
|
1628
2081
|
for (const element of elements){
|
|
1629
|
-
var
|
|
2082
|
+
var _ref7;
|
|
1630
2083
|
var _elements_at;
|
|
1631
2084
|
if (element.tag !== 'a' && element.tag !== 'button') continue;
|
|
1632
2085
|
if (element.region === 'footer') continue;
|
|
1633
2086
|
const style = styles.of(element.id);
|
|
1634
2087
|
let under = null;
|
|
1635
|
-
for(let at = element.parent; at >= 0; at = (
|
|
2088
|
+
for(let at = element.parent; at >= 0; at = (_ref7 = (_elements_at = elements[at]) == null ? void 0 : _elements_at.parent) != null ? _ref7 : -1){
|
|
1636
2089
|
const color = siteImportBackgroundOf(styles.of(at)).color;
|
|
1637
2090
|
if (color && color.a >= 0.5) {
|
|
1638
2091
|
under = siteImportHex(color);
|
|
@@ -1672,14 +2125,14 @@ function mode(values) {
|
|
|
1672
2125
|
const header = (_elements_find1 = elements.find((element)=>element.tag === 'header' && element.region === 'header')) != null ? _elements_find1 : elements.find((element)=>element.attrs.role === 'banner');
|
|
1673
2126
|
let headerFill = null;
|
|
1674
2127
|
for(let at = (_ref3 = header == null ? void 0 : header.id) != null ? _ref3 : -1, depth = 0; at >= 0 && depth < 3; depth += 1){
|
|
1675
|
-
var
|
|
2128
|
+
var _ref8;
|
|
1676
2129
|
var _elements_at1;
|
|
1677
2130
|
const color = siteImportBackgroundOf(styles.of(at)).color;
|
|
1678
2131
|
if (color && color.a >= 0.5) {
|
|
1679
2132
|
headerFill = siteImportHex(color);
|
|
1680
2133
|
break;
|
|
1681
2134
|
}
|
|
1682
|
-
const children = (
|
|
2135
|
+
const children = (_ref8 = (_elements_at1 = elements[at]) == null ? void 0 : _elements_at1.children) != null ? _ref8 : [];
|
|
1683
2136
|
at = children.length === 1 ? children[0] : -1;
|
|
1684
2137
|
}
|
|
1685
2138
|
return {
|
|
@@ -1694,7 +2147,13 @@ function mode(values) {
|
|
|
1694
2147
|
buttonText: (_ref5 = topFill == null ? void 0 : topFill[1].text) != null ? _ref5 : null,
|
|
1695
2148
|
buttonRadius: radii.length ? radii.sort((a, b)=>a - b)[Math.floor(radii.length / 2)] : null,
|
|
1696
2149
|
link,
|
|
1697
|
-
header: headerFill
|
|
2150
|
+
header: headerFill,
|
|
2151
|
+
// Its eyebrows' own color: none of its words', its buttons' or its links', which the theme draws already.
|
|
2152
|
+
eyebrow: blocks.length ? eyebrowColorOf(structure, styles, blocks, [
|
|
2153
|
+
text,
|
|
2154
|
+
(_ref6 = topFill == null ? void 0 : topFill[0]) != null ? _ref6 : null,
|
|
2155
|
+
link
|
|
2156
|
+
]) : null
|
|
1698
2157
|
};
|
|
1699
2158
|
}
|
|
1700
2159
|
/** Counts a layout's sections, bands, rows, groups, pictures, icons and buttons. */ export function siteImportLayoutCounts(layout, blocks = []) {
|
|
@@ -1710,6 +2169,7 @@ function mode(values) {
|
|
|
1710
2169
|
icons: 0,
|
|
1711
2170
|
buttons: 0,
|
|
1712
2171
|
forms: 0,
|
|
2172
|
+
videos: 0,
|
|
1713
2173
|
lines: 0
|
|
1714
2174
|
};
|
|
1715
2175
|
const main = blocks.filter((block)=>block.region === 'main');
|
|
@@ -1732,6 +2192,11 @@ function mode(values) {
|
|
|
1732
2192
|
case 'form':
|
|
1733
2193
|
counts.forms += 1;
|
|
1734
2194
|
break;
|
|
2195
|
+
case 'video':
|
|
2196
|
+
// Its poster is a picture of the page, as it was before the film was read.
|
|
2197
|
+
counts.videos += 1;
|
|
2198
|
+
if (node.poster !== undefined) counts.pictures += 1;
|
|
2199
|
+
break;
|
|
1735
2200
|
case 'row':
|
|
1736
2201
|
if (node.cells.length >= 2) counts.rows += 1;
|
|
1737
2202
|
for (const cell of node.cells)visit(cell.nodes);
|
|
@@ -1744,8 +2209,10 @@ function mode(values) {
|
|
|
1744
2209
|
var _ref;
|
|
1745
2210
|
var _item_list;
|
|
1746
2211
|
if (item.icon !== undefined) counts.icons += 1;
|
|
2212
|
+
if (item.mark !== undefined) counts.icons += 1;
|
|
1747
2213
|
if (item.listIcon !== undefined) counts.icons += (_ref = (_item_list = item.list) == null ? void 0 : _item_list.length) != null ? _ref : 0;
|
|
1748
2214
|
if (item.image !== undefined || main.length && item.lines.some(isPicture)) counts.pictures += 1;
|
|
2215
|
+
if (item.video !== undefined) counts.videos += 1;
|
|
1749
2216
|
}
|
|
1750
2217
|
break;
|
|
1751
2218
|
case 'table':
|
|
@@ -1761,7 +2228,12 @@ function mode(values) {
|
|
|
1761
2228
|
}
|
|
1762
2229
|
};
|
|
1763
2230
|
for (const section of layout.sections){
|
|
2231
|
+
var _section_backdrop;
|
|
1764
2232
|
visit(section.nodes);
|
|
2233
|
+
if (((_section_backdrop = section.backdrop) == null ? void 0 : _section_backdrop.kind) === 'video') {
|
|
2234
|
+
counts.videos += 1;
|
|
2235
|
+
if (section.backdrop.poster !== undefined) counts.pictures += 1;
|
|
2236
|
+
}
|
|
1765
2237
|
counts.lines += section.lines.length;
|
|
1766
2238
|
}
|
|
1767
2239
|
return counts;
|