@aglyn/plugins-ai 1.9.0 → 1.10.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/components/ai-job-requests.d.ts +5 -0
- package/src/lib/components/ai-job-requests.js +4 -0
- package/src/lib/components/ai-job-requests.js.map +1 -1
- package/src/lib/components/ai-site-build-page.component.js +10 -3
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-import-finish.component.d.ts +40 -0
- package/src/lib/components/ai-site-import-finish.component.js +174 -0
- package/src/lib/components/ai-site-import-finish.component.js.map +1 -0
- package/src/lib/components/ai-site-import-job.component.d.ts +11 -3
- package/src/lib/components/ai-site-import-job.component.js +220 -135
- package/src/lib/components/ai-site-import-job.component.js.map +1 -1
- package/src/lib/components/ai-site-import-start.component.d.ts +11 -2
- package/src/lib/components/ai-site-import-start.component.js +27 -5
- package/src/lib/components/ai-site-import-start.component.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.js +1 -1
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/jobs/ai-build-capabilities.js +2 -2
- package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
- package/src/lib/jobs/ai-job-import-step.d.ts +2 -0
- package/src/lib/jobs/ai-job-import-step.js +31 -8
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +40 -2
- package/src/lib/jobs/ai-job-page-language.js +188 -9
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.js +2 -0
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-privacy-step.d.ts +5 -0
- package/src/lib/jobs/ai-job-privacy-step.js +9 -4
- package/src/lib/jobs/ai-job-privacy-step.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +7 -1
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +13 -2
- package/src/lib/jobs/ai-site-import-compile.js +115 -21
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +5 -1
- package/src/lib/jobs/ai-site-import-document.js +5 -1
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-look.d.ts +16 -4
- package/src/lib/jobs/ai-site-import-look.js +54 -13
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/jobs/ai-site-import-wording.d.ts +187 -0
- package/src/lib/jobs/ai-site-import-wording.js +747 -0
- package/src/lib/jobs/ai-site-import-wording.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +12 -1
- package/src/lib/layout-language/ai-layout-compiler.js +29 -30
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +12 -0
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +211 -2
- package/src/lib/model/ai-site-import-fidelity.js +1011 -14
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import-report.d.ts +52 -1
- package/src/lib/model/ai-site-import-report.js +102 -5
- package/src/lib/model/ai-site-import-report.js.map +1 -1
- package/src/lib/model/ai-site-import-view.d.ts +62 -2
- package/src/lib/model/ai-site-import-view.js +83 -4
- package/src/lib/model/ai-site-import-view.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +122 -6
- package/src/lib/model/ai-site-import.js +202 -9
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +51 -0
- package/src/lib/model/ai-site-look.js +205 -29
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +19 -0
- package/src/lib/runtime/ai-doctrine-validators.js +25 -0
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +4 -1
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/server/ai-allotments.js +4 -2
- package/src/lib/server/ai-allotments.js.map +1 -1
- package/src/lib/server/ai-jobs-resume.js +32 -5
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +36 -10
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +48 -4
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-look-slate.d.ts +27 -0
- package/src/lib/site-import/fixtures/site-look-slate.js +29 -0
- package/src/lib/site-import/fixtures/site-look-slate.js.map +1 -0
- package/src/lib/site-import/site-import-layout.d.ts +19 -5
- package/src/lib/site-import/site-import-layout.js +137 -16
- package/src/lib/site-import/site-import-layout.js.map +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
1
2
|
/**
|
|
2
3
|
* @license
|
|
3
4
|
* Copyright 2026 Aglyn LLC
|
|
@@ -42,9 +43,38 @@
|
|
|
42
43
|
* the same score reads a page compiled in a spec and a page stored on a live
|
|
43
44
|
* site. The score is the lowest ratio of the structure; words are held apart
|
|
44
45
|
* at exactly 1.
|
|
45
|
-
|
|
46
|
+
*
|
|
47
|
+
* How the owner asked the site to be finished (AGL-4152) changes what the
|
|
48
|
+
* score means, and each finish is asked for by name; a page scored with
|
|
49
|
+
* neither a finish nor its words scores as it did before the choice:
|
|
50
|
+
*
|
|
51
|
+
* - **Keep my site**: the structure, and the look's pins at 1.0: each
|
|
52
|
+
* section's alignment and its groups' boxes as the source has them, each
|
|
53
|
+
* ground within OKLab ΔE 0.05 of the source's, the hero heading's measure
|
|
54
|
+
* within 10%, and the buttons in the source's case and fill.
|
|
55
|
+
* - **Improve it**: the content alone (words, sections, items, tables, tabs,
|
|
56
|
+
* pictures, icons, buttons, headings, forms, films); the bands, widths,
|
|
57
|
+
* rows, framing, grounds, measure, alignment and boxes are free, and the
|
|
58
|
+
* `design` lines say whether the build reads better than its source.
|
|
59
|
+
* - **Improved words** (lane G): the words are free, and every fact, every
|
|
60
|
+
* line and most of each line's meaning are held instead.
|
|
61
|
+
*=========================================*/ import { contrastRatio } from "@aglyn/aglyn/app-utils/site-theme";
|
|
46
62
|
import { SITE_IMPORT_PLAY_WORDS, siteImportWidthOf } from "./ai-site-import.js";
|
|
63
|
+
import { aiHexOklch } from "./ai-site-look.js";
|
|
47
64
|
/** The lowest score of structure a page brought in ships at (AGL-4109); words are held at exactly 1. */ export const SITE_IMPORT_FIDELITY_THRESHOLD = 0.9;
|
|
65
|
+
/** How far a ground of the theme may sit from the source's (AGL-4152), in OKLab. */ export const SITE_IMPORT_GROUND_DELTA = 0.05;
|
|
66
|
+
/** How far the hero heading's share of its section may sit from the source's (AGL-4152), relatively. */ export const SITE_IMPORT_MEASURE_SHARE = 0.1;
|
|
67
|
+
/** The least share of a line's content words a rewrite keeps (G4): a bold rewrite, the owner asked 11/4, still keeps a third. */ export const SITE_IMPORT_MEANING_FLOOR = 0.3;
|
|
68
|
+
/** The measures Improve it prints as free (AGL-4152): what it may change. */ export const SITE_IMPORT_IMPROVE_FREE = [
|
|
69
|
+
'bands',
|
|
70
|
+
'widths',
|
|
71
|
+
'rows',
|
|
72
|
+
'framing',
|
|
73
|
+
'ground',
|
|
74
|
+
'measure',
|
|
75
|
+
'align',
|
|
76
|
+
'boxed'
|
|
77
|
+
];
|
|
48
78
|
/*------------------------------------------
|
|
49
79
|
* Words and lines
|
|
50
80
|
*-----------------------------------------*/ const clean = (text)=>typeof text === 'string' ? text.replace(/\s+/g, ' ').trim() : '';
|
|
@@ -119,6 +149,15 @@ const BUTTON_VARIANT = {
|
|
|
119
149
|
node(id) {
|
|
120
150
|
return this.tree.nodes[id];
|
|
121
151
|
}
|
|
152
|
+
/** A node's place in document order; -1 for one not on the page. */ at(id) {
|
|
153
|
+
var _this_enter_get;
|
|
154
|
+
return (_this_enter_get = this.enter.get(id)) != null ? _this_enter_get : -1;
|
|
155
|
+
}
|
|
156
|
+
/** A node and the nodes holding it, nearest first, up to the page's root. */ ancestry(id) {
|
|
157
|
+
const out = [];
|
|
158
|
+
for(let at = id; at; at = this.parent.get(at))out.push(at);
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
122
161
|
/** Whether `a` is `b` or holds it. */ holds(a, b) {
|
|
123
162
|
const start = this.enter.get(a);
|
|
124
163
|
const end = this.exit.get(a);
|
|
@@ -196,7 +235,7 @@ const ratioBoth = (source, built)=>({
|
|
|
196
235
|
* element holds one line, or the run of lines a build joins into one (a
|
|
197
236
|
* list item's words, a quote's).
|
|
198
237
|
*/ let Placement = class Placement {
|
|
199
|
-
/** The piece showing a line: its words exactly, else a part of them (a long paragraph split), else the run it was joined into. */ find(pieces, text, cursor, previous) {
|
|
238
|
+
/** The piece showing a line: its words exactly, else a part of them (a long paragraph split), else the run it was joined into. */ find(pieces, text, cursor, previous, own = new Set()) {
|
|
200
239
|
const key = wordLine(text);
|
|
201
240
|
if (!key) return null;
|
|
202
241
|
const free = (piece)=>{
|
|
@@ -220,9 +259,90 @@ const ratioBoth = (source, built)=>({
|
|
|
220
259
|
const exact = pieces.filter((piece)=>piece.key === key && this.claimedBy.get(piece) === undefined);
|
|
221
260
|
if (exact.length) return pick(exact);
|
|
222
261
|
const padded = ` ${key} `;
|
|
223
|
-
|
|
262
|
+
// A reworded heading that reads "…, and agencies build a hundred" never takes the card titled "Agencies".
|
|
263
|
+
const part = pieces.filter((piece)=>free(piece) && piece.key && !(piece.key !== key && own.has(piece.key)) && (` ${piece.key} `.includes(padded) || padded.includes(` ${piece.key} `)));
|
|
224
264
|
return pick(part);
|
|
225
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* The lines a rewrite changed (G4), placed after the lines found as
|
|
268
|
+
* written: in each section, each run of lines still unplaced is set to the
|
|
269
|
+
* free pieces between the lines placed either side of it, in order, each
|
|
270
|
+
* piece to one line, the pairs sharing most content words chosen. A line a
|
|
271
|
+
* rewrite dropped has no piece to take, and stays unplaced.
|
|
272
|
+
*/ placeRewritten() {
|
|
273
|
+
this.source.layout.sections.forEach((section, index)=>{
|
|
274
|
+
var _this_scopes_index;
|
|
275
|
+
const pieces = (_this_scopes_index = this.scopes[index]) != null ? _this_scopes_index : [];
|
|
276
|
+
const lines = section.lines.filter((ref)=>{
|
|
277
|
+
var _this_source_blocks_ref;
|
|
278
|
+
return isLine(this.source.blocks[ref]) && ((_this_source_blocks_ref = this.source.blocks[ref]) == null ? void 0 : _this_source_blocks_ref.kind) !== 'image';
|
|
279
|
+
});
|
|
280
|
+
let run = [];
|
|
281
|
+
let from = -1;
|
|
282
|
+
const settle = (to)=>{
|
|
283
|
+
if (run.length) this.align(run, pieces.filter((piece)=>piece.at >= from && piece.at <= to && this.claimedBy.get(piece) === undefined));
|
|
284
|
+
run = [];
|
|
285
|
+
};
|
|
286
|
+
for (const ref of lines){
|
|
287
|
+
const node = this.of.get(ref);
|
|
288
|
+
if (node === undefined) {
|
|
289
|
+
run.push(ref);
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
const at = this.built.at(node);
|
|
293
|
+
settle(at);
|
|
294
|
+
from = at;
|
|
295
|
+
}
|
|
296
|
+
settle(Number.POSITIVE_INFINITY);
|
|
297
|
+
// A line its neighbors leave no room for (one drawn out of the source's order) is looked for among the section's free pieces.
|
|
298
|
+
const left = lines.filter((ref)=>!this.of.has(ref));
|
|
299
|
+
if (left.length) this.align(left, pieces.filter((piece)=>this.claimedBy.get(piece) === undefined));
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
/** A run of lines set to free pieces in order (G4): as many pairs as can be, then the most content kept. */ align(lines, pieces) {
|
|
303
|
+
if (!lines.length || !pieces.length) return;
|
|
304
|
+
const text = (ref)=>{
|
|
305
|
+
var _this_source_blocks_ref;
|
|
306
|
+
return clean((_this_source_blocks_ref = this.source.blocks[ref]) == null ? void 0 : _this_source_blocks_ref.text);
|
|
307
|
+
};
|
|
308
|
+
const best = Array.from({
|
|
309
|
+
length: lines.length + 1
|
|
310
|
+
}, ()=>new Array(pieces.length + 1).fill(0));
|
|
311
|
+
for(let i = 1; i <= lines.length; i += 1){
|
|
312
|
+
for(let j = 1; j <= pieces.length; j += 1){
|
|
313
|
+
var _ref, _ref1, _ref2;
|
|
314
|
+
var _best_, _best_1, _best_i;
|
|
315
|
+
const pair = ((_ref = (_best_ = best[i - 1]) == null ? void 0 : _best_[j - 1]) != null ? _ref : 0) + 1 + contentKept(text(lines[i - 1]), pieces[j - 1].text);
|
|
316
|
+
best[i][j] = Math.max(pair, (_ref1 = (_best_1 = best[i - 1]) == null ? void 0 : _best_1[j]) != null ? _ref1 : 0, (_ref2 = (_best_i = best[i]) == null ? void 0 : _best_i[j - 1]) != null ? _ref2 : 0);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
for(let i = lines.length, j = pieces.length; i > 0 && j > 0;){
|
|
320
|
+
var _ref3, _ref4, _ref5;
|
|
321
|
+
var _best_i1, _best_2, _best_i2;
|
|
322
|
+
const here = (_ref3 = (_best_i1 = best[i]) == null ? void 0 : _best_i1[j]) != null ? _ref3 : 0;
|
|
323
|
+
if (here === ((_ref4 = (_best_2 = best[i - 1]) == null ? void 0 : _best_2[j]) != null ? _ref4 : 0)) i -= 1;
|
|
324
|
+
else if (here === ((_ref5 = (_best_i2 = best[i]) == null ? void 0 : _best_i2[j - 1]) != null ? _ref5 : 0)) j -= 1;
|
|
325
|
+
else {
|
|
326
|
+
const ref = lines[i - 1];
|
|
327
|
+
const piece = pieces[j - 1];
|
|
328
|
+
this.claimedBy.set(piece, ref);
|
|
329
|
+
this.of.set(ref, piece.node);
|
|
330
|
+
this.rewrittenAs.set(ref, piece.text);
|
|
331
|
+
i -= 1;
|
|
332
|
+
j -= 1;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/** The pieces of the page's sections no line of the source claimed, nor holds as a part of its words: lines the page added. */ unclaimed() {
|
|
337
|
+
const pieces = [
|
|
338
|
+
...new Set(this.scopes.flat())
|
|
339
|
+
];
|
|
340
|
+
const said = this.source.layout.sections.flatMap((section)=>section.lines).map((ref)=>{
|
|
341
|
+
var _this_source_blocks_ref;
|
|
342
|
+
return ` ${wordLine(clean((_this_source_blocks_ref = this.source.blocks[ref]) == null ? void 0 : _this_source_blocks_ref.text))} `;
|
|
343
|
+
});
|
|
344
|
+
return pieces.filter((piece)=>this.claimedBy.get(piece) === undefined && !!piece.key && !said.some((line)=>line.includes(` ${piece.key} `)));
|
|
345
|
+
}
|
|
226
346
|
/** The nodes a list of lines is shown by, and whether every one of them was found. */ nodesOf(refs) {
|
|
227
347
|
var _this_source_photos;
|
|
228
348
|
const nodes = [];
|
|
@@ -249,8 +369,10 @@ const ratioBoth = (source, built)=>({
|
|
|
249
369
|
this.built = built;
|
|
250
370
|
this.source = source;
|
|
251
371
|
/** Line → the node showing it. */ this.of = new Map();
|
|
372
|
+
/** Line → the words it is shown in, where a rewrite placed it (AGL-4152). */ this.rewrittenAs = new Map();
|
|
252
373
|
this.claimedBy = new Map();
|
|
253
374
|
this.imageClaimed = new Set();
|
|
375
|
+
/** Each section's pieces, in order. */ this.scopes = [];
|
|
254
376
|
const photoOf = new Map();
|
|
255
377
|
for (const photo of (_source_photos = source.photos) != null ? _source_photos : [])if (photo.from) photoOf.set(photo.from, photo.src);
|
|
256
378
|
source.layout.sections.forEach((section, index)=>{
|
|
@@ -258,6 +380,7 @@ const ratioBoth = (source, built)=>({
|
|
|
258
380
|
const root = (_sectionRoots_index = sectionRoots[index]) != null ? _sectionRoots_index : built.tree.rootId;
|
|
259
381
|
const scope = new Set(built.under(root));
|
|
260
382
|
const pieces = built.pieces.filter((piece)=>scope.has(piece.node));
|
|
383
|
+
this.scopes[index] = pieces;
|
|
261
384
|
// A film's poster is placed as its Video element's (AGL-4140).
|
|
262
385
|
const images = built.under(root).filter((id)=>{
|
|
263
386
|
var _built_node, _built_node1;
|
|
@@ -265,6 +388,13 @@ const ratioBoth = (source, built)=>({
|
|
|
265
388
|
});
|
|
266
389
|
let cursor = -1;
|
|
267
390
|
let previous = null;
|
|
391
|
+
// Each line's own words, so a line found only in part never takes a piece another line is shown in whole (AGL-4152).
|
|
392
|
+
const own = new Set(section.lines.flatMap((ref)=>{
|
|
393
|
+
const line = source.blocks[ref];
|
|
394
|
+
return isLine(line) && line.kind !== 'image' ? [
|
|
395
|
+
wordLine(clean(line.text))
|
|
396
|
+
] : [];
|
|
397
|
+
}));
|
|
268
398
|
for (const ref of section.lines){
|
|
269
399
|
const block = source.blocks[ref];
|
|
270
400
|
if (!isLine(block)) continue;
|
|
@@ -281,7 +411,7 @@ const ratioBoth = (source, built)=>({
|
|
|
281
411
|
previous = ref;
|
|
282
412
|
continue;
|
|
283
413
|
}
|
|
284
|
-
const piece = this.find(pieces, clean(block.text), cursor, previous);
|
|
414
|
+
const piece = this.find(pieces, clean(block.text), cursor, previous, own);
|
|
285
415
|
if (piece) {
|
|
286
416
|
this.claimedBy.set(piece, ref);
|
|
287
417
|
this.of.set(ref, piece.node);
|
|
@@ -376,7 +506,18 @@ const ratioBoth = (source, built)=>({
|
|
|
376
506
|
* item an element of its own with its parts; the tables, tabs, pictures,
|
|
377
507
|
* icons, buttons, headings and forms. The score is the lowest ratio of the
|
|
378
508
|
* structure.
|
|
379
|
-
|
|
509
|
+
*
|
|
510
|
+
* Scored with a `finish` or its `words` (AGL-4152), the page is scored as
|
|
511
|
+
* that finish asks, with the measures it adds; with neither, as before.
|
|
512
|
+
*/ export function siteImportFidelity(source, tree, options = {}) {
|
|
513
|
+
var _options_finish, _options_theme;
|
|
514
|
+
const finished = !!options.finish || !!options.words;
|
|
515
|
+
// An import that names no finish reads as Keep my site (AGL-4152).
|
|
516
|
+
const finish = (_options_finish = options.finish) != null ? _options_finish : 'keep';
|
|
517
|
+
const improvedWords = options.words === 'improved';
|
|
518
|
+
const theme = (_options_theme = options.theme) != null ? _options_theme : null;
|
|
519
|
+
// Keep my site holds the buttons to the source's case and fill too.
|
|
520
|
+
const pinned = finished && finish === 'keep';
|
|
380
521
|
const built = new Built(tree);
|
|
381
522
|
const sections = source.layout.sections;
|
|
382
523
|
const drawnSections = built.children(tree.rootId);
|
|
@@ -387,6 +528,9 @@ const ratioBoth = (source, built)=>({
|
|
|
387
528
|
return aligned ? (_drawnSections_index = drawnSections[index]) != null ? _drawnSections_index : null : null;
|
|
388
529
|
});
|
|
389
530
|
const placement = new Placement(built, source, roots);
|
|
531
|
+
// Lines a rewrite changed are found by their place and their content (G4).
|
|
532
|
+
if (improvedWords) placement.placeRewritten();
|
|
533
|
+
const look = new LookOf(built, source.layout.look, theme);
|
|
390
534
|
const words = wordsScore(source, built);
|
|
391
535
|
const read = sections.map((section)=>section.band);
|
|
392
536
|
const drawn = drawnSections.map((id)=>siteImportFidelityBandOf(built.node(id)));
|
|
@@ -409,6 +553,19 @@ const ratioBoth = (source, built)=>({
|
|
|
409
553
|
built: 0,
|
|
410
554
|
unlinked: 0
|
|
411
555
|
};
|
|
556
|
+
// Keep my site's buttons in the source's case, and its filled ones in its fill (AGL-4152).
|
|
557
|
+
const buttonCase = {
|
|
558
|
+
source: 0,
|
|
559
|
+
built: 0
|
|
560
|
+
};
|
|
561
|
+
const buttonFill = {
|
|
562
|
+
source: 0,
|
|
563
|
+
built: 0
|
|
564
|
+
};
|
|
565
|
+
const boxed = {
|
|
566
|
+
source: 0,
|
|
567
|
+
built: 0
|
|
568
|
+
};
|
|
412
569
|
const icons = {
|
|
413
570
|
source: 0,
|
|
414
571
|
built: 0,
|
|
@@ -420,6 +577,24 @@ const ratioBoth = (source, built)=>({
|
|
|
420
577
|
return ((_built_node = built.node(id)) == null ? void 0 : _built_node.componentId) === 'video' && !!clean((_built_node1 = built.node(id)) == null ? void 0 : (_built_node_props = _built_node1.props) == null ? void 0 : _built_node_props['src']);
|
|
421
578
|
}).length;
|
|
422
579
|
const films = drawnFilms > 0;
|
|
580
|
+
/** Whether a button of the source is drawn in its style, going where it goes; under Keep my site, in its case and fill too. */ const buttonKept = (line, style)=>{
|
|
581
|
+
var _drawnAs_props;
|
|
582
|
+
const id = placement.of.get(line);
|
|
583
|
+
const drawnAs = id ? built.node(id) : undefined;
|
|
584
|
+
const drawn = (drawnAs == null ? void 0 : drawnAs.componentId) === 'muiButton' && ((_drawnAs_props = drawnAs.props) == null ? void 0 : _drawnAs_props['variant']) === BUTTON_VARIANT[style] && hasDestination(drawnAs);
|
|
585
|
+
if (!pinned) return drawn;
|
|
586
|
+
const cased = look.caseKept(id != null ? id : null);
|
|
587
|
+
if (cased !== null) {
|
|
588
|
+
buttonCase.source += 1;
|
|
589
|
+
if (drawn && cased) buttonCase.built += 1;
|
|
590
|
+
}
|
|
591
|
+
const filled = style === 'primary' ? look.fillKept(id != null ? id : null) : null;
|
|
592
|
+
if (filled !== null) {
|
|
593
|
+
buttonFill.source += 1;
|
|
594
|
+
if (drawn && filled) buttonFill.built += 1;
|
|
595
|
+
}
|
|
596
|
+
return drawn && cased !== false && filled !== false;
|
|
597
|
+
};
|
|
423
598
|
sections.forEach((section, index)=>{
|
|
424
599
|
var _roots_index;
|
|
425
600
|
const root = (_roots_index = roots[index]) != null ? _roots_index : null;
|
|
@@ -430,16 +605,12 @@ const ratioBoth = (source, built)=>({
|
|
|
430
605
|
break;
|
|
431
606
|
case 'line':
|
|
432
607
|
{
|
|
433
|
-
var _drawnAs_props;
|
|
434
608
|
if (!node.button) break;
|
|
435
609
|
const block = source.blocks[node.line];
|
|
436
610
|
// A button whose words say it plays a film plays the page's film where one is drawn (AGL-4140).
|
|
437
611
|
if ((block == null ? void 0 : block.kind) === 'paragraph' && films && SITE_IMPORT_PLAY_WORDS.test(block.text)) {
|
|
438
|
-
var _drawnAs_props1;
|
|
439
612
|
buttons.source += 1;
|
|
440
|
-
|
|
441
|
-
const drawnAs = id ? built.node(id) : undefined;
|
|
442
|
-
if ((drawnAs == null ? void 0 : drawnAs.componentId) === 'muiButton' && ((_drawnAs_props1 = drawnAs.props) == null ? void 0 : _drawnAs_props1['variant']) === BUTTON_VARIANT[node.button] && hasDestination(drawnAs)) buttons.built += 1;
|
|
613
|
+
if (buttonKept(node.line, node.button)) buttons.built += 1;
|
|
443
614
|
break;
|
|
444
615
|
}
|
|
445
616
|
// A button that goes nowhere a page can send a visitor (a film's play button its script runs) is kept as its words.
|
|
@@ -448,9 +619,7 @@ const ratioBoth = (source, built)=>({
|
|
|
448
619
|
break;
|
|
449
620
|
}
|
|
450
621
|
buttons.source += 1;
|
|
451
|
-
|
|
452
|
-
const drawnAs = id ? built.node(id) : undefined;
|
|
453
|
-
if ((drawnAs == null ? void 0 : drawnAs.componentId) === 'muiButton' && ((_drawnAs_props = drawnAs.props) == null ? void 0 : _drawnAs_props['variant']) === BUTTON_VARIANT[node.button] && hasDestination(drawnAs)) buttons.built += 1;
|
|
622
|
+
if (buttonKept(node.line, node.button)) buttons.built += 1;
|
|
454
623
|
break;
|
|
455
624
|
}
|
|
456
625
|
case 'row':
|
|
@@ -486,6 +655,12 @@ const ratioBoth = (source, built)=>({
|
|
|
486
655
|
});
|
|
487
656
|
// Lines that only share a shape are drawn as their lines: no group to keep.
|
|
488
657
|
if (node.group === 'text') break;
|
|
658
|
+
// Its items boxed where the source boxes them, open where it leaves them open (AGL-4152).
|
|
659
|
+
const judged = units.filter((unit)=>unit.measured && unit.element);
|
|
660
|
+
if (finished && boxesKept(node) && judged.length) {
|
|
661
|
+
boxed.source += 1;
|
|
662
|
+
if (judged.every((unit)=>boxedOn(built, unit) === node.boxed)) boxed.built += 1;
|
|
663
|
+
}
|
|
489
664
|
const entry = (_ = (_groups = groups)[_node_group = node.group]) != null ? _ : _groups[_node_group] = {
|
|
490
665
|
groups: 0,
|
|
491
666
|
groupsKept: 0,
|
|
@@ -584,7 +759,93 @@ const ratioBoth = (source, built)=>({
|
|
|
584
759
|
forms,
|
|
585
760
|
videos
|
|
586
761
|
};
|
|
587
|
-
return _extends({}, lowestOf(pageMeasures(report)), report);
|
|
762
|
+
if (!finished) return _extends({}, lowestOf(pageMeasures(report)), report);
|
|
763
|
+
// The measures a finish adds (AGL-4152).
|
|
764
|
+
if (pinned) report.buttons = _extends({}, report.buttons, {
|
|
765
|
+
case: ratioKept(buttonCase.source, buttonCase.built),
|
|
766
|
+
fill: ratioKept(buttonFill.source, buttonFill.built)
|
|
767
|
+
});
|
|
768
|
+
const added = _extends({
|
|
769
|
+
scoredAs: {
|
|
770
|
+
finish,
|
|
771
|
+
words: improvedWords ? 'improved' : 'kept'
|
|
772
|
+
},
|
|
773
|
+
free: finish === 'improve' ? [
|
|
774
|
+
...SITE_IMPORT_IMPROVE_FREE,
|
|
775
|
+
...improvedWords ? [
|
|
776
|
+
'words'
|
|
777
|
+
] : []
|
|
778
|
+
] : improvedWords ? [
|
|
779
|
+
'words'
|
|
780
|
+
] : [],
|
|
781
|
+
align: alignScore(source, built, placement),
|
|
782
|
+
boxed: ratioKept(boxed.source, boxed.built),
|
|
783
|
+
ground: groundScore(sections, look, roots),
|
|
784
|
+
measure: measureScore(source, built, placement, roots),
|
|
785
|
+
readable: look.readable(drawnSections)
|
|
786
|
+
}, finish === 'improve' ? {
|
|
787
|
+
design: designScore(source, built, placement, look, roots, drawnSections)
|
|
788
|
+
} : {}, improvedWords ? wordingScores(source, built, placement) : {});
|
|
789
|
+
const full = _extends({}, report, added);
|
|
790
|
+
return _extends({}, lowestOf(finishMeasures(full)), full);
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* The measures a finished page is scored on (AGL-4152). Keep my site: the
|
|
794
|
+
* structure and the look's pins, its words held apart. Improve it: the
|
|
795
|
+
* content alone, its words among it unless they were improved; everything it
|
|
796
|
+
* may change prints as free.
|
|
797
|
+
*/ function finishMeasures(report) {
|
|
798
|
+
var _report_free;
|
|
799
|
+
var _report_scoredAs;
|
|
800
|
+
const free = new Set((_report_free = report.free) != null ? _report_free : []);
|
|
801
|
+
const pins = [
|
|
802
|
+
[
|
|
803
|
+
'align',
|
|
804
|
+
report.align
|
|
805
|
+
],
|
|
806
|
+
[
|
|
807
|
+
'boxed',
|
|
808
|
+
report.boxed
|
|
809
|
+
],
|
|
810
|
+
[
|
|
811
|
+
'ground',
|
|
812
|
+
report.ground
|
|
813
|
+
],
|
|
814
|
+
[
|
|
815
|
+
'measure',
|
|
816
|
+
report.measure
|
|
817
|
+
]
|
|
818
|
+
];
|
|
819
|
+
const words = ((_report_scoredAs = report.scoredAs) == null ? void 0 : _report_scoredAs.finish) === 'improve' && !free.has('words') ? [
|
|
820
|
+
[
|
|
821
|
+
'words',
|
|
822
|
+
report.words
|
|
823
|
+
]
|
|
824
|
+
] : [];
|
|
825
|
+
return [
|
|
826
|
+
...words,
|
|
827
|
+
...pageMeasures(report),
|
|
828
|
+
...pins.filter((entry)=>!!entry[1])
|
|
829
|
+
].filter(([name])=>!free.has(name));
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Whether a page ships (AGL-4109, AGL-4152): its score at the bar, and what
|
|
833
|
+
* is held at exactly 1 whole. Its words, as written, or under improved words
|
|
834
|
+
* every fact and every line, and each line's meaning at the floor; under
|
|
835
|
+
* Keep my site, its alignment, boxes, grounds and measure.
|
|
836
|
+
*/ export function siteImportFidelityHolds(report, threshold = SITE_IMPORT_FIDELITY_THRESHOLD) {
|
|
837
|
+
var _ref;
|
|
838
|
+
var _report_scoredAs, _report_facts, _report_lines, _report_meaning, _report_scoredAs1;
|
|
839
|
+
if (report.score < threshold) return false;
|
|
840
|
+
const improvedWords = ((_report_scoredAs = report.scoredAs) == null ? void 0 : _report_scoredAs.words) === 'improved';
|
|
841
|
+
if (improvedWords ? ((_report_facts = report.facts) == null ? void 0 : _report_facts.ratio) !== 1 || ((_report_lines = report.lines) == null ? void 0 : _report_lines.ratio) !== 1 || ((_ref = (_report_meaning = report.meaning) == null ? void 0 : _report_meaning.below) != null ? _ref : 0) > 0 : report.words.ratio !== 1) return false;
|
|
842
|
+
if (((_report_scoredAs1 = report.scoredAs) == null ? void 0 : _report_scoredAs1.finish) !== 'keep') return true;
|
|
843
|
+
return [
|
|
844
|
+
report.align,
|
|
845
|
+
report.boxed,
|
|
846
|
+
report.ground,
|
|
847
|
+
report.measure
|
|
848
|
+
].every((count)=>!count || count.ratio === 1);
|
|
588
849
|
}
|
|
589
850
|
/** Whether an item of a group is kept: its own element, every line of it found, and the parts its kind and source say it has. */ function itemKept(built, kind, item, unit) {
|
|
590
851
|
if (!unit.whole || !unit.element) return false;
|
|
@@ -865,6 +1126,742 @@ const WIDTH_RANK = {
|
|
|
865
1126
|
lowest
|
|
866
1127
|
};
|
|
867
1128
|
}
|
|
1129
|
+
/*------------------------------------------
|
|
1130
|
+
* The finish: the look kept, the design improved, the words held (AGL-4152)
|
|
1131
|
+
*-----------------------------------------*/ const isRecord = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1132
|
+
/** What a path of keys holds in a record, or `undefined`. */ const pathIn = (value, ...keys)=>keys.reduce((node, key)=>isRecord(node) ? node[key] : undefined, value);
|
|
1133
|
+
const round = (value)=>Math.round(value * 1000) / 1000;
|
|
1134
|
+
/** A color as `#rrggbb`, or `null` for anything else. */ function hexOf(value) {
|
|
1135
|
+
if (typeof value !== 'string' || !/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(value.trim())) return null;
|
|
1136
|
+
const hex = value.trim().toLowerCase();
|
|
1137
|
+
return hex.length === 4 ? `#${[
|
|
1138
|
+
...hex.slice(1)
|
|
1139
|
+
].map((digit)=>digit + digit).join('')}` : hex;
|
|
1140
|
+
}
|
|
1141
|
+
/** How far apart two `#rrggbb` colors sit in OKLab (AGL-4152). */ export function siteImportOklabDelta(a, b) {
|
|
1142
|
+
const one = aiHexOklch(a);
|
|
1143
|
+
const two = aiHexOklch(b);
|
|
1144
|
+
const at = (color, part)=>color.C * (part === 'a' ? Math.cos(color.h * Math.PI / 180) : Math.sin(color.h * Math.PI / 180));
|
|
1145
|
+
return Math.hypot(one.L - two.L, at(one, 'a') - at(two, 'a'), at(one, 'b') - at(two, 'b'));
|
|
1146
|
+
}
|
|
1147
|
+
/** The contrast an ink and its ground read at: the doctrine's 4.5:1. */ const READS_AT = 4.5;
|
|
1148
|
+
const reads = (ink, ground)=>{
|
|
1149
|
+
var _contrastRatio;
|
|
1150
|
+
return ((_contrastRatio = contrastRatio(ink, ground)) != null ? _contrastRatio : 0) >= READS_AT;
|
|
1151
|
+
};
|
|
1152
|
+
function schemeOf(colors) {
|
|
1153
|
+
if (!isRecord(colors)) return null;
|
|
1154
|
+
const scheme = {
|
|
1155
|
+
ground: hexOf(pathIn(colors, 'background', 'default')),
|
|
1156
|
+
paper: hexOf(pathIn(colors, 'background', 'paper')),
|
|
1157
|
+
brand: hexOf(pathIn(colors, 'primary', 'main')),
|
|
1158
|
+
onBrand: hexOf(pathIn(colors, 'primary', 'contrastText')),
|
|
1159
|
+
ink: hexOf(pathIn(colors, 'text', 'primary'))
|
|
1160
|
+
};
|
|
1161
|
+
return Object.values(scheme).some(Boolean) ? scheme : null;
|
|
1162
|
+
}
|
|
1163
|
+
/** A color a style names, in a scheme: a palette path (`primary.main`) as the scheme draws it, a color as itself. */ function colorIn(value, scheme) {
|
|
1164
|
+
var _paths_value;
|
|
1165
|
+
const own = hexOf(value);
|
|
1166
|
+
if (own || typeof value !== 'string') return own;
|
|
1167
|
+
const paths = {
|
|
1168
|
+
'primary.main': scheme.brand,
|
|
1169
|
+
'primary.contrastText': scheme.onBrand,
|
|
1170
|
+
'background.default': scheme.ground,
|
|
1171
|
+
'background.paper': scheme.paper,
|
|
1172
|
+
'text.primary': scheme.ink
|
|
1173
|
+
};
|
|
1174
|
+
return (_paths_value = paths[value]) != null ? _paths_value : null;
|
|
1175
|
+
}
|
|
1176
|
+
/** A CSS `text-transform` as the case a button's words are set in. */ const CASE_OF = {
|
|
1177
|
+
uppercase: 'upper',
|
|
1178
|
+
none: 'none',
|
|
1179
|
+
capitalize: 'none',
|
|
1180
|
+
lowercase: 'none'
|
|
1181
|
+
};
|
|
1182
|
+
/**
|
|
1183
|
+
* The colors and buttons of a theme, as a page is drawn in them (AGL-4152):
|
|
1184
|
+
* each scheme's grounds, brand and ink, and a filled button's own fill and
|
|
1185
|
+
* label where the button's component style sets them apart from the brand's
|
|
1186
|
+
* (a `contained` variant, or the contained style overrides), with the case
|
|
1187
|
+
* its words are set in: the component's own, else the button Text Style's.
|
|
1188
|
+
* `from` says whether the theme is the one the site stores or one computed
|
|
1189
|
+
* from its site style. `null` for a theme with no light ground.
|
|
1190
|
+
*/ export function siteImportFidelityThemeOf(theme, from = 'theme') {
|
|
1191
|
+
var _CASE_OF_transform;
|
|
1192
|
+
const light = schemeOf(pathIn(theme, 'colorSchemes', 'light'));
|
|
1193
|
+
if (!(light == null ? void 0 : light.ground)) return null;
|
|
1194
|
+
const button = pathIn(theme, 'components', 'MuiButton');
|
|
1195
|
+
const variants = pathIn(button, 'variants');
|
|
1196
|
+
const contained = (Array.isArray(variants) ? variants : []).filter((entry)=>{
|
|
1197
|
+
const color = pathIn(entry, 'props', 'color');
|
|
1198
|
+
return pathIn(entry, 'props', 'variant') === 'contained' && (color === undefined || color === 'primary');
|
|
1199
|
+
});
|
|
1200
|
+
const styles = [
|
|
1201
|
+
...contained.flatMap((entry)=>[
|
|
1202
|
+
pathIn(entry, 'style'),
|
|
1203
|
+
pathIn(entry, 'sx')
|
|
1204
|
+
]),
|
|
1205
|
+
pathIn(button, 'styleOverrides', 'containedPrimary'),
|
|
1206
|
+
pathIn(button, 'styleOverrides', 'contained')
|
|
1207
|
+
].filter(isRecord);
|
|
1208
|
+
const pick = (...keys)=>{
|
|
1209
|
+
var _styles_flatMap_find;
|
|
1210
|
+
return (_styles_flatMap_find = styles.flatMap((style)=>keys.map((key)=>colorIn(style[key], light))).find((color)=>!!color)) != null ? _styles_flatMap_find : null;
|
|
1211
|
+
};
|
|
1212
|
+
const transform = [
|
|
1213
|
+
pathIn(button, 'styleOverrides', 'root', 'textTransform'),
|
|
1214
|
+
pathIn(button, 'sx', 'root', 'textTransform'),
|
|
1215
|
+
pathIn(theme, 'typography', 'variants', 'button', 'textTransform'),
|
|
1216
|
+
pathIn(theme, 'typography', 'button', 'textTransform')
|
|
1217
|
+
].find((value)=>typeof value === 'string');
|
|
1218
|
+
return {
|
|
1219
|
+
from,
|
|
1220
|
+
light,
|
|
1221
|
+
dark: schemeOf(pathIn(theme, 'colorSchemes', 'dark')),
|
|
1222
|
+
button: {
|
|
1223
|
+
fill: pick('backgroundColor', 'bgcolor', 'background'),
|
|
1224
|
+
label: pick('color'),
|
|
1225
|
+
case: transform ? (_CASE_OF_transform = CASE_OF[transform]) != null ? _CASE_OF_transform : null : null
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
/** The look a built page is drawn in, read through its theme: each node's scheme, a section's ground and ink, a button's case and fill. */ let LookOf = class LookOf {
|
|
1230
|
+
/** The scheme a node is drawn in: the one the nearest node holding it sets. */ scheme(id) {
|
|
1231
|
+
if (!this.theme) return null;
|
|
1232
|
+
for (const at of this.built.ancestry(id)){
|
|
1233
|
+
var _this_built_node_props, _this_built_node;
|
|
1234
|
+
const scheme = (_this_built_node = this.built.node(at)) == null ? void 0 : (_this_built_node_props = _this_built_node.props) == null ? void 0 : _this_built_node_props['colorScheme'];
|
|
1235
|
+
if (scheme === 'dark') return this.theme.dark;
|
|
1236
|
+
if (scheme === 'light') return this.theme.light;
|
|
1237
|
+
}
|
|
1238
|
+
return this.theme.light;
|
|
1239
|
+
}
|
|
1240
|
+
/** The color a section is drawn on: its band's role in its scheme. */ ground(id) {
|
|
1241
|
+
var _this_built_node_sx, _this_built_node;
|
|
1242
|
+
const scheme = this.scheme(id);
|
|
1243
|
+
const fill = (_this_built_node = this.built.node(id)) == null ? void 0 : (_this_built_node_sx = _this_built_node.sx) == null ? void 0 : _this_built_node_sx['bgcolor'];
|
|
1244
|
+
return scheme ? fill === undefined || fill === null ? scheme.ground : colorIn(fill, scheme) : null;
|
|
1245
|
+
}
|
|
1246
|
+
/** The words' ink on that ground: the brand's label on a brand band, the scheme's ink elsewhere. */ ink(id) {
|
|
1247
|
+
var _this_built_node_sx, _this_built_node;
|
|
1248
|
+
const scheme = this.scheme(id);
|
|
1249
|
+
return scheme ? ((_this_built_node = this.built.node(id)) == null ? void 0 : (_this_built_node_sx = _this_built_node.sx) == null ? void 0 : _this_built_node_sx['bgcolor']) === 'primary.main' ? scheme.onBrand : scheme.ink : null;
|
|
1250
|
+
}
|
|
1251
|
+
/** A filled button's fill: its own, else the theme's for filled buttons, else its scheme's brand. */ fill(id) {
|
|
1252
|
+
var _ref, _ref1;
|
|
1253
|
+
var _this_built_node_sx, _this_built_node, _this_built_node_sx1, _this_built_node1, _this_theme;
|
|
1254
|
+
const scheme = this.scheme(id);
|
|
1255
|
+
if (!scheme) return null;
|
|
1256
|
+
const own = (_ref = (_this_built_node = this.built.node(id)) == null ? void 0 : (_this_built_node_sx = _this_built_node.sx) == null ? void 0 : _this_built_node_sx['bgcolor']) != null ? _ref : (_this_built_node1 = this.built.node(id)) == null ? void 0 : (_this_built_node_sx1 = _this_built_node1.sx) == null ? void 0 : _this_built_node_sx1['backgroundColor'];
|
|
1257
|
+
return own !== undefined ? colorIn(own, scheme) : (_ref1 = (_this_theme = this.theme) == null ? void 0 : _this_theme.button.fill) != null ? _ref1 : scheme.brand;
|
|
1258
|
+
}
|
|
1259
|
+
/** A filled button's label: its own, else the theme's for filled buttons, else the words on its scheme's brand. */ label(id) {
|
|
1260
|
+
var _ref;
|
|
1261
|
+
var _this_built_node_sx, _this_built_node, _this_theme;
|
|
1262
|
+
const scheme = this.scheme(id);
|
|
1263
|
+
if (!scheme) return null;
|
|
1264
|
+
const own = (_this_built_node = this.built.node(id)) == null ? void 0 : (_this_built_node_sx = _this_built_node.sx) == null ? void 0 : _this_built_node_sx['color'];
|
|
1265
|
+
return own !== undefined ? colorIn(own, scheme) : (_ref = (_this_theme = this.theme) == null ? void 0 : _this_theme.button.label) != null ? _ref : scheme.onBrand;
|
|
1266
|
+
}
|
|
1267
|
+
/** Whether a button is set in the source's case: its own `textTransform`, else the theme's. `null` where either is not known. */ caseKept(id) {
|
|
1268
|
+
var _CASE_OF_own, _ref;
|
|
1269
|
+
var _this_facts, _this_built_node_sx, _this_built_node, _this_theme;
|
|
1270
|
+
const wanted = (_this_facts = this.facts) == null ? void 0 : _this_facts.buttonCase;
|
|
1271
|
+
if (wanted !== 'upper' && wanted !== 'none') return null;
|
|
1272
|
+
const own = id ? (_this_built_node = this.built.node(id)) == null ? void 0 : (_this_built_node_sx = _this_built_node.sx) == null ? void 0 : _this_built_node_sx['textTransform'] : undefined;
|
|
1273
|
+
const drawn = typeof own === 'string' ? (_CASE_OF_own = CASE_OF[own]) != null ? _CASE_OF_own : 'none' : (_ref = (_this_theme = this.theme) == null ? void 0 : _this_theme.button.case) != null ? _ref : null;
|
|
1274
|
+
return drawn === null ? null : drawn === wanted;
|
|
1275
|
+
}
|
|
1276
|
+
/** Whether a filled button is drawn in the source's own fill, within OKLab ΔE 0.05. `null` where either is not known. */ fillKept(id) {
|
|
1277
|
+
var _this_theme_button_fill;
|
|
1278
|
+
var _this_facts, _this_facts1;
|
|
1279
|
+
const wanted = hexOf((_this_facts = this.facts) == null ? void 0 : _this_facts.buttonFill);
|
|
1280
|
+
if (!wanted || !this.theme) return null;
|
|
1281
|
+
// A fill its own label cannot be read on is deepened by the look's reading rule, Keep's polish, and is not a loss.
|
|
1282
|
+
const label = hexOf((_this_facts1 = this.facts) == null ? void 0 : _this_facts1.buttonText);
|
|
1283
|
+
if (label && !reads(label, wanted)) return null;
|
|
1284
|
+
const drawn = id ? this.fill(id) : (_this_theme_button_fill = this.theme.button.fill) != null ? _this_theme_button_fill : this.theme.light.brand;
|
|
1285
|
+
return drawn ? siteImportOklabDelta(wanted, drawn) <= SITE_IMPORT_GROUND_DELTA : null;
|
|
1286
|
+
}
|
|
1287
|
+
/** The inks and grounds the page shows: each section's, and each filled button's label on its fill, once each. */ pairs(sectionIds) {
|
|
1288
|
+
if (!this.theme) return [];
|
|
1289
|
+
const out = new Map();
|
|
1290
|
+
const add = (ink, ground)=>{
|
|
1291
|
+
if (ink && ground) out.set(`${ink}/${ground}`, [
|
|
1292
|
+
ink,
|
|
1293
|
+
ground
|
|
1294
|
+
]);
|
|
1295
|
+
};
|
|
1296
|
+
for (const id of sectionIds)add(this.ink(id), this.ground(id));
|
|
1297
|
+
for (const id of this.built.order){
|
|
1298
|
+
var _node_props;
|
|
1299
|
+
const node = this.built.node(id);
|
|
1300
|
+
if ((node == null ? void 0 : node.componentId) === 'muiButton' && ((_node_props = node.props) == null ? void 0 : _node_props['variant']) === 'contained') add(this.label(id), this.fill(id));
|
|
1301
|
+
}
|
|
1302
|
+
return [
|
|
1303
|
+
...out.values()
|
|
1304
|
+
];
|
|
1305
|
+
}
|
|
1306
|
+
/** The inks and grounds that read at 4.5:1, over those the theme says. */ readable(sectionIds) {
|
|
1307
|
+
const pairs = this.pairs(sectionIds);
|
|
1308
|
+
return ratioKept(pairs.length, pairs.filter(([ink, ground])=>reads(ink, ground)).length);
|
|
1309
|
+
}
|
|
1310
|
+
constructor(built, facts, theme){
|
|
1311
|
+
this.built = built;
|
|
1312
|
+
this.facts = facts;
|
|
1313
|
+
this.theme = theme;
|
|
1314
|
+
}
|
|
1315
|
+
};
|
|
1316
|
+
/**
|
|
1317
|
+
* The groups whose boxing is scored (AGL-4152): a group drawn as the source's
|
|
1318
|
+
* own rows draws no box per row, and an FAQ's questions are the theme's
|
|
1319
|
+
* accordions, boxed as the theme boxes them.
|
|
1320
|
+
*/ function boxesKept(group) {
|
|
1321
|
+
return !group.inline && group.group !== 'faq' && group.group !== 'text';
|
|
1322
|
+
}
|
|
1323
|
+
/** Whether a node draws a box: a card or a paper, or a fill, a shadow or a border on two sides or more of its own. */ function drawsBox(node) {
|
|
1324
|
+
var _node_sx;
|
|
1325
|
+
if (!node || node.componentId === 'section') return false;
|
|
1326
|
+
if (node.componentId === 'muiCard' || node.componentId === 'muiPaper') return true;
|
|
1327
|
+
const sx = (_node_sx = node.sx) != null ? _node_sx : {};
|
|
1328
|
+
const sides = [
|
|
1329
|
+
'borderTop',
|
|
1330
|
+
'borderRight',
|
|
1331
|
+
'borderBottom',
|
|
1332
|
+
'borderLeft'
|
|
1333
|
+
].filter((side)=>!!sx[side]).length;
|
|
1334
|
+
return sx['bgcolor'] !== undefined && sx['bgcolor'] !== 'transparent' || !!sx['border'] || sides >= 2 || !!sx['boxShadow'] && sx['boxShadow'] !== 'none';
|
|
1335
|
+
}
|
|
1336
|
+
/** Whether an item of a group is drawn boxed: a box under its element holding every part of it. */ function boxedOn(built, unit) {
|
|
1337
|
+
if (!unit.element) return false;
|
|
1338
|
+
return built.under(unit.element).some((id)=>drawsBox(built.node(id)) && unit.nodes.every((node)=>built.holds(id, node)));
|
|
1339
|
+
}
|
|
1340
|
+
/** The lines a section sets in its own flow: its lines and its rows' cells', not its groups', tables' or tabs'. */ function flowLines(nodes) {
|
|
1341
|
+
return nodes.flatMap((node)=>node.kind === 'line' && !node.button ? [
|
|
1342
|
+
node.line
|
|
1343
|
+
] : node.kind === 'row' ? node.cells.flatMap((cell)=>flowLines(cell.nodes)) : []);
|
|
1344
|
+
}
|
|
1345
|
+
/** The paragraphs past which a section is a long read, set at `md` and at the start (the compile's own count). */ const LONG_READ_PARAGRAPHS = 4;
|
|
1346
|
+
/** Whether a section of the source is a long read: more paragraphs in its own flow (not its groups') than a section's words, which a page sets at the start to be read. */ const longRead = (source, section)=>flowLines(section.nodes).filter((ref)=>{
|
|
1347
|
+
var _source_blocks_ref;
|
|
1348
|
+
return ((_source_blocks_ref = source.blocks[ref]) == null ? void 0 : _source_blocks_ref.kind) === 'paragraph';
|
|
1349
|
+
}).length > LONG_READ_PARAGRAPHS;
|
|
1350
|
+
/**
|
|
1351
|
+
* The sections set as the source sets them (AGL-4152): their headings, else
|
|
1352
|
+
* their words, centered or at the start. The opening a hero draws is the
|
|
1353
|
+
* hero's to place, and is measured by its framing and pictures; a long read
|
|
1354
|
+
* set at the start, as text is read, is kept whatever its source centers.
|
|
1355
|
+
*/ function alignScore(source, built, placement) {
|
|
1356
|
+
let measured = 0;
|
|
1357
|
+
let kept = 0;
|
|
1358
|
+
for (const [index, section] of source.layout.sections.entries()){
|
|
1359
|
+
var _section_hero;
|
|
1360
|
+
if (index === 0 && ((_section_hero = section.hero) == null ? void 0 : _section_hero.picture)) continue;
|
|
1361
|
+
const own = flowLines(section.nodes);
|
|
1362
|
+
const headings = own.filter((ref)=>{
|
|
1363
|
+
var _source_blocks_ref;
|
|
1364
|
+
return ((_source_blocks_ref = source.blocks[ref]) == null ? void 0 : _source_blocks_ref.kind) === 'heading';
|
|
1365
|
+
});
|
|
1366
|
+
const lines = (headings.length ? headings : own.filter((ref)=>{
|
|
1367
|
+
var _ref;
|
|
1368
|
+
var _source_blocks_ref;
|
|
1369
|
+
return [
|
|
1370
|
+
'paragraph',
|
|
1371
|
+
'list-item',
|
|
1372
|
+
'quote'
|
|
1373
|
+
].includes((_ref = (_source_blocks_ref = source.blocks[ref]) == null ? void 0 : _source_blocks_ref.kind) != null ? _ref : '');
|
|
1374
|
+
})).flatMap((ref)=>{
|
|
1375
|
+
const id = placement.of.get(ref);
|
|
1376
|
+
const node = id ? built.node(id) : undefined;
|
|
1377
|
+
return (node == null ? void 0 : node.componentId) === 'muiTypography' ? [
|
|
1378
|
+
node
|
|
1379
|
+
] : [];
|
|
1380
|
+
});
|
|
1381
|
+
if (!lines.length) continue;
|
|
1382
|
+
measured += 1;
|
|
1383
|
+
const centered = lines.filter((node)=>{
|
|
1384
|
+
var _node_props;
|
|
1385
|
+
return ((_node_props = node.props) == null ? void 0 : _node_props['align']) === 'center';
|
|
1386
|
+
}).length;
|
|
1387
|
+
const drawn = centered * 2 > lines.length ? 'center' : 'start';
|
|
1388
|
+
if (drawn === section.align || drawn === 'start' && longRead(source, section)) kept += 1;
|
|
1389
|
+
}
|
|
1390
|
+
return ratioKept(measured, kept);
|
|
1391
|
+
}
|
|
1392
|
+
/** Each section with a ground of its own on a ground of the theme within OKLab ΔE 0.05 of it. A picture or a film behind its words is its ground, and is not scored. */ function groundScore(sections, look, roots) {
|
|
1393
|
+
if (!look.theme) return _extends({}, ratioKept(0, 0), {
|
|
1394
|
+
theme: null,
|
|
1395
|
+
worst: null
|
|
1396
|
+
});
|
|
1397
|
+
let measured = 0;
|
|
1398
|
+
let kept = 0;
|
|
1399
|
+
let worst = null;
|
|
1400
|
+
for (const [index, section] of sections.entries()){
|
|
1401
|
+
var _section_backdrop, _section_backdrop1;
|
|
1402
|
+
const wanted = hexOf(section.background);
|
|
1403
|
+
if (!wanted || ((_section_backdrop = section.backdrop) == null ? void 0 : _section_backdrop.kind) === 'picture' || ((_section_backdrop1 = section.backdrop) == null ? void 0 : _section_backdrop1.kind) === 'video') continue;
|
|
1404
|
+
measured += 1;
|
|
1405
|
+
const root = roots[index];
|
|
1406
|
+
const drawn = root ? look.ground(root) : null;
|
|
1407
|
+
if (!drawn) continue;
|
|
1408
|
+
const delta = siteImportOklabDelta(wanted, drawn);
|
|
1409
|
+
worst = Math.max(worst != null ? worst : 0, delta);
|
|
1410
|
+
if (delta <= SITE_IMPORT_GROUND_DELTA) kept += 1;
|
|
1411
|
+
}
|
|
1412
|
+
return _extends({}, ratioKept(measured, kept), {
|
|
1413
|
+
theme: look.theme.from,
|
|
1414
|
+
worst: worst === null ? null : round(worst)
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
/** The width a page is measured at (AGL-4152): the 1280 the 11/4 live checks set the source beside the import at. */ const VIEW_PX = 1280;
|
|
1418
|
+
/** The Container element's Max Width steps, in px, as the theme's breakpoints set them. */ const CONTAINER_PX = {
|
|
1419
|
+
xs: 444,
|
|
1420
|
+
sm: 600,
|
|
1421
|
+
md: 900,
|
|
1422
|
+
lg: 1200,
|
|
1423
|
+
xl: 1536
|
|
1424
|
+
};
|
|
1425
|
+
/** What a responsive value is at the width a page is measured at: its `lg`, else the nearest below. */ function atView(value) {
|
|
1426
|
+
if (!isRecord(value)) return value;
|
|
1427
|
+
for (const key of [
|
|
1428
|
+
'lg',
|
|
1429
|
+
'md',
|
|
1430
|
+
'sm',
|
|
1431
|
+
'xs'
|
|
1432
|
+
])if (value[key] !== undefined) return value[key];
|
|
1433
|
+
return undefined;
|
|
1434
|
+
}
|
|
1435
|
+
/** A Grid item's columns, of 12, at the width a page is measured at: `xs:12 md:6` is 6. */ function gridSpan(size) {
|
|
1436
|
+
if (typeof size === 'number') return size;
|
|
1437
|
+
const steps = typeof size === 'string' ? Object.fromEntries(size.split(/\s+/).flatMap((part)=>/^(\w+):(\d+)$/.exec(part) ? [
|
|
1438
|
+
[
|
|
1439
|
+
part.split(':')[0],
|
|
1440
|
+
Number(part.split(':')[1])
|
|
1441
|
+
]
|
|
1442
|
+
] : [])) : isRecord(size) ? size : null;
|
|
1443
|
+
const span = steps ? atView(steps) : null;
|
|
1444
|
+
return typeof span === 'number' && span > 0 ? Math.min(12, span) : null;
|
|
1445
|
+
}
|
|
1446
|
+
/** How wide a node's box runs at the width a page is measured at, in px, from its section down, and how wide its section's content runs. */ function boxPx(built, id, root) {
|
|
1447
|
+
const chain = built.ancestry(id).reverse();
|
|
1448
|
+
const from = root ? chain.indexOf(root) : 0;
|
|
1449
|
+
let width = VIEW_PX;
|
|
1450
|
+
let section = null;
|
|
1451
|
+
for (const at of chain.slice(Math.max(0, from))){
|
|
1452
|
+
var _gridSpan;
|
|
1453
|
+
var _node_props, _node_sx;
|
|
1454
|
+
const node = built.node(at);
|
|
1455
|
+
if (!node) continue;
|
|
1456
|
+
if (node.componentId === 'muiContainer') {
|
|
1457
|
+
var _node_props1;
|
|
1458
|
+
const cap = CONTAINER_PX[String(atView((_node_props1 = node.props) == null ? void 0 : _node_props1['maxWidth']))];
|
|
1459
|
+
if (cap) width = Math.min(width, cap);
|
|
1460
|
+
section != null ? section : section = width;
|
|
1461
|
+
}
|
|
1462
|
+
if (node.componentId === 'muiGrid' && !setsSideBySide(node)) width *= ((_gridSpan = gridSpan((_node_props = node.props) == null ? void 0 : _node_props['size'])) != null ? _gridSpan : 12) / 12;
|
|
1463
|
+
const max = atView((_node_sx = node.sx) == null ? void 0 : _node_sx['maxWidth']);
|
|
1464
|
+
if (typeof max === 'number') width = max <= 1 ? width * max : Math.min(width, max);
|
|
1465
|
+
else if (typeof max === 'string' && CONTAINER_PX[max]) width = Math.min(width, CONTAINER_PX[max]);
|
|
1466
|
+
else if (typeof max === 'string' && /^\d+(?:\.\d+)?%$/.test(max)) width *= parseFloat(max) / 100;
|
|
1467
|
+
else if (typeof max === 'string' && /^\d+(?:\.\d+)?px$/.test(max)) width = Math.min(width, parseFloat(max));
|
|
1468
|
+
}
|
|
1469
|
+
return {
|
|
1470
|
+
box: width,
|
|
1471
|
+
section: section != null ? section : VIEW_PX
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
/** The hero heading's box as a share of its section, against the source's measure: within 10%, where the reader kept it. */ function measureScore(source, built, placement, roots) {
|
|
1475
|
+
var _section_width, _roots_index;
|
|
1476
|
+
var _section_hero;
|
|
1477
|
+
const index = source.layout.sections.findIndex((section)=>!!section.hero);
|
|
1478
|
+
const section = source.layout.sections[index];
|
|
1479
|
+
const wanted = section == null ? void 0 : (_section_hero = section.hero) == null ? void 0 : _section_hero.measure;
|
|
1480
|
+
if (!section || typeof wanted !== 'number' || !(wanted > 0)) return _extends({}, ratioKept(0, 0), {
|
|
1481
|
+
shares: null
|
|
1482
|
+
});
|
|
1483
|
+
const across = Math.min((_section_width = section.width) != null ? _section_width : VIEW_PX, VIEW_PX);
|
|
1484
|
+
const share = Math.min(1, wanted / across);
|
|
1485
|
+
const heading = section.lines.find((ref)=>{
|
|
1486
|
+
const block = source.blocks[ref];
|
|
1487
|
+
return (block == null ? void 0 : block.kind) === 'heading' && block.level === 1;
|
|
1488
|
+
});
|
|
1489
|
+
const id = heading === undefined ? undefined : placement.of.get(heading);
|
|
1490
|
+
if (!id) return _extends({}, ratioKept(1, 0), {
|
|
1491
|
+
shares: {
|
|
1492
|
+
source: round(share),
|
|
1493
|
+
built: 0
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
const drawn = boxPx(built, id, (_roots_index = roots[index]) != null ? _roots_index : null);
|
|
1497
|
+
const builtShare = Math.min(1, drawn.box / drawn.section);
|
|
1498
|
+
return _extends({}, ratioKept(1, Math.abs(builtShare / share - 1) <= SITE_IMPORT_MEASURE_SHARE ? 1 : 0), {
|
|
1499
|
+
shares: {
|
|
1500
|
+
source: round(share),
|
|
1501
|
+
built: round(builtShare)
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
/** How wide a section's words run at the width a page is measured at: its first Container's Max Width, else the page. */ function runPx(built, root) {
|
|
1506
|
+
var _built_node_props, _built_node;
|
|
1507
|
+
const container = root ? built.under(root).find((id)=>{
|
|
1508
|
+
var _built_node;
|
|
1509
|
+
return ((_built_node = built.node(id)) == null ? void 0 : _built_node.componentId) === 'muiContainer';
|
|
1510
|
+
}) : undefined;
|
|
1511
|
+
const cap = container ? CONTAINER_PX[String(atView((_built_node = built.node(container)) == null ? void 0 : (_built_node_props = _built_node.props) == null ? void 0 : _built_node_props['maxWidth']))] : undefined;
|
|
1512
|
+
return Math.min(cap != null ? cap : VIEW_PX, VIEW_PX);
|
|
1513
|
+
}
|
|
1514
|
+
/** A line of the design measure: the share of what it asks the source and the build each do, `null` where neither is asked anything. */ function designLine(source, built) {
|
|
1515
|
+
if (!source[1] || !built[1]) return null;
|
|
1516
|
+
return {
|
|
1517
|
+
source: round(source[0] / source[1]),
|
|
1518
|
+
built: round(built[0] / built[1])
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Whether the build reads better than its source (AGL-4152), line by line:
|
|
1523
|
+
* its rhythm, its measure, its opening, its groups and its colors. Better is
|
|
1524
|
+
* at or above the source on every line and above it on one.
|
|
1525
|
+
*/ function designScore(source, built, placement, look, roots, drawnSections) {
|
|
1526
|
+
var _first_backdrop, _first_backdrop1, _first_hero;
|
|
1527
|
+
const sections = source.layout.sections;
|
|
1528
|
+
// Rhythm: neighbors set apart by their bands, or a rule between them.
|
|
1529
|
+
const apart = (pairs, at)=>[
|
|
1530
|
+
Array.from({
|
|
1531
|
+
length: pairs
|
|
1532
|
+
}, (_, index)=>at(index)).filter(Boolean).length,
|
|
1533
|
+
pairs
|
|
1534
|
+
];
|
|
1535
|
+
const ruled = (id)=>{
|
|
1536
|
+
var _built_node_sx, _built_node, _built_node_sx1, _built_node1;
|
|
1537
|
+
return !!id && (!!((_built_node = built.node(id)) == null ? void 0 : (_built_node_sx = _built_node.sx) == null ? void 0 : _built_node_sx['borderTop']) || !!((_built_node1 = built.node(id)) == null ? void 0 : (_built_node_sx1 = _built_node1.sx) == null ? void 0 : _built_node_sx1['borderBottom']));
|
|
1538
|
+
};
|
|
1539
|
+
const drawnBand = (id)=>siteImportFidelityBandOf(id ? built.node(id) : undefined);
|
|
1540
|
+
const rhythm = designLine(apart(Math.max(0, sections.length - 1), (index)=>{
|
|
1541
|
+
var _sections_index, _sections_;
|
|
1542
|
+
return ((_sections_index = sections[index]) == null ? void 0 : _sections_index.band) !== ((_sections_ = sections[index + 1]) == null ? void 0 : _sections_.band);
|
|
1543
|
+
}), apart(Math.max(0, drawnSections.length - 1), (index)=>drawnBand(drawnSections[index]) !== drawnBand(drawnSections[index + 1]) || ruled(drawnSections[index]) || ruled(drawnSections[index + 1])));
|
|
1544
|
+
// Measure: words that run no wider than `lg`, a long read no wider than `md`, each section as its Container runs it.
|
|
1545
|
+
const caps = sections.map((section)=>longRead(source, section) ? CONTAINER_PX['md'] : CONTAINER_PX['lg']);
|
|
1546
|
+
const measure = designLine(// The source's cap read as the Container step a page brought in draws it at; a section it sets none on runs the page.
|
|
1547
|
+
[
|
|
1548
|
+
sections.filter((section, index)=>{
|
|
1549
|
+
var _siteImportWidthOf;
|
|
1550
|
+
return Math.min(CONTAINER_PX[(_siteImportWidthOf = siteImportWidthOf(section.width)) != null ? _siteImportWidthOf : 'xl'], VIEW_PX) <= caps[index];
|
|
1551
|
+
}).length,
|
|
1552
|
+
sections.length
|
|
1553
|
+
], [
|
|
1554
|
+
drawnSections.filter((id, index)=>{
|
|
1555
|
+
var _caps_index;
|
|
1556
|
+
return runPx(built, id) <= ((_caps_index = caps[index]) != null ? _caps_index : CONTAINER_PX['lg']);
|
|
1557
|
+
}).length,
|
|
1558
|
+
drawnSections.length
|
|
1559
|
+
]);
|
|
1560
|
+
// Opening: a first section holding a picture opens as the hero, its heading and its picture together.
|
|
1561
|
+
const first = sections[0];
|
|
1562
|
+
const pictured = !!first && (first.lines.some((ref)=>{
|
|
1563
|
+
var _source_blocks_ref;
|
|
1564
|
+
return ((_source_blocks_ref = source.blocks[ref]) == null ? void 0 : _source_blocks_ref.kind) === 'image';
|
|
1565
|
+
}) || ((_first_backdrop = first.backdrop) == null ? void 0 : _first_backdrop.kind) === 'picture' || ((_first_backdrop1 = first.backdrop) == null ? void 0 : _first_backdrop1.kind) === 'video');
|
|
1566
|
+
const title = sections.flatMap((section)=>section.lines).find((ref)=>{
|
|
1567
|
+
const block = source.blocks[ref];
|
|
1568
|
+
return (block == null ? void 0 : block.kind) === 'heading' && block.level === 1;
|
|
1569
|
+
});
|
|
1570
|
+
const titleNode = title === undefined ? undefined : placement.of.get(title);
|
|
1571
|
+
const opener = drawnSections[0];
|
|
1572
|
+
const opens = !!opener && !!titleNode && built.holds(opener, titleNode) && built.has(opener, (node)=>node.componentId === 'image' || node.componentId === 'video');
|
|
1573
|
+
const opening = pictured ? designLine([
|
|
1574
|
+
(first == null ? void 0 : (_first_hero = first.hero) == null ? void 0 : _first_hero.picture) ? 1 : 0,
|
|
1575
|
+
1
|
|
1576
|
+
], [
|
|
1577
|
+
opens ? 1 : 0,
|
|
1578
|
+
1
|
|
1579
|
+
]) : null;
|
|
1580
|
+
// Grouped: three or more like items drawn as one group: each its own element, held together apart from the section's other lines.
|
|
1581
|
+
let runs = 0;
|
|
1582
|
+
let sourceGrouped = 0;
|
|
1583
|
+
let builtGrouped = 0;
|
|
1584
|
+
for (const [index, section] of sections.entries()){
|
|
1585
|
+
for (const node of layoutNodes(section.nodes)){
|
|
1586
|
+
var _roots_index;
|
|
1587
|
+
if (node.kind !== 'group' || node.items.length < 3) continue;
|
|
1588
|
+
runs += 1;
|
|
1589
|
+
if (node.group !== 'text') sourceGrouped += 1;
|
|
1590
|
+
const units = unitsOn(built, placement, node.items.map((item)=>item.lines), (_roots_index = roots[index]) != null ? _roots_index : null).filter((unit)=>unit.measured);
|
|
1591
|
+
const parents = new Set(units.map((unit)=>unit.element ? built.parent.get(unit.element) : null));
|
|
1592
|
+
const parent = parents.size === 1 ? [
|
|
1593
|
+
...parents
|
|
1594
|
+
][0] : null;
|
|
1595
|
+
const mine = new Set(node.items.flatMap((item)=>item.lines));
|
|
1596
|
+
const others = section.lines.flatMap((ref)=>mine.has(ref) ? [] : [
|
|
1597
|
+
placement.of.get(ref)
|
|
1598
|
+
]).filter((id)=>!!id);
|
|
1599
|
+
if (units.length >= 3 && parent && units.every((unit)=>unit.element) && !others.some((id)=>built.holds(parent, id))) builtGrouped += 1;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
const grouped = designLine([
|
|
1603
|
+
sourceGrouped,
|
|
1604
|
+
runs
|
|
1605
|
+
], [
|
|
1606
|
+
builtGrouped,
|
|
1607
|
+
runs
|
|
1608
|
+
]);
|
|
1609
|
+
// Readable: the source's words on its grounds and its buttons' labels on their fill, against the build's.
|
|
1610
|
+
const facts = source.layout.look;
|
|
1611
|
+
const sourcePairs = [];
|
|
1612
|
+
const ink = hexOf(facts == null ? void 0 : facts.text);
|
|
1613
|
+
for (const section of sections){
|
|
1614
|
+
const ground = hexOf(section.background);
|
|
1615
|
+
if (ink && ground && (section.band === 'plain' || section.band === 'soft')) sourcePairs.push([
|
|
1616
|
+
ink,
|
|
1617
|
+
ground
|
|
1618
|
+
]);
|
|
1619
|
+
}
|
|
1620
|
+
const buttonFill = hexOf(facts == null ? void 0 : facts.buttonFill);
|
|
1621
|
+
const buttonText = hexOf(facts == null ? void 0 : facts.buttonText);
|
|
1622
|
+
if (buttonFill && buttonText) sourcePairs.push([
|
|
1623
|
+
buttonText,
|
|
1624
|
+
buttonFill
|
|
1625
|
+
]);
|
|
1626
|
+
const builtPairs = look.pairs(drawnSections);
|
|
1627
|
+
const readable = designLine([
|
|
1628
|
+
sourcePairs.filter(([a, b])=>reads(a, b)).length,
|
|
1629
|
+
sourcePairs.length
|
|
1630
|
+
], [
|
|
1631
|
+
builtPairs.filter(([a, b])=>reads(a, b)).length,
|
|
1632
|
+
builtPairs.length
|
|
1633
|
+
]);
|
|
1634
|
+
const lines = [
|
|
1635
|
+
rhythm,
|
|
1636
|
+
measure,
|
|
1637
|
+
opening,
|
|
1638
|
+
grouped,
|
|
1639
|
+
readable
|
|
1640
|
+
].filter((line)=>!!line);
|
|
1641
|
+
const better = lines.length > 0 && lines.every((line)=>line.built >= line.source) && lines.some((line)=>line.built > line.source);
|
|
1642
|
+
return {
|
|
1643
|
+
rhythm,
|
|
1644
|
+
measure,
|
|
1645
|
+
opening,
|
|
1646
|
+
grouped,
|
|
1647
|
+
readable,
|
|
1648
|
+
better
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
/*------------------------------------------
|
|
1652
|
+
* Improved words (G4)
|
|
1653
|
+
*-----------------------------------------*/ /** The words that carry no content of a line: what a rewrite may change freely. */ const STOP_WORDS = new Set('a about all also an and any are as at be been but by can do does each for from get had has have he her here his how i if in into is it its just me more most my no not of on one only or our out over own so some such than that the their them then there these they this those to too up us very was we were what when where which who why will with you your yours'.split(' '));
|
|
1654
|
+
/** A word's crude stem (G4): its case and one ending dropped, so "builds", "building" and "build" read as one word. */ function stemOf(word) {
|
|
1655
|
+
let stem = word.toLowerCase().replace(/['’]s$/, '');
|
|
1656
|
+
for (const [ending, to] of [
|
|
1657
|
+
[
|
|
1658
|
+
/ies$/,
|
|
1659
|
+
'y'
|
|
1660
|
+
],
|
|
1661
|
+
[
|
|
1662
|
+
/ing$/,
|
|
1663
|
+
''
|
|
1664
|
+
],
|
|
1665
|
+
[
|
|
1666
|
+
/ed$/,
|
|
1667
|
+
''
|
|
1668
|
+
],
|
|
1669
|
+
[
|
|
1670
|
+
/ly$/,
|
|
1671
|
+
''
|
|
1672
|
+
],
|
|
1673
|
+
[
|
|
1674
|
+
/(?<!s)s$/,
|
|
1675
|
+
''
|
|
1676
|
+
]
|
|
1677
|
+
]){
|
|
1678
|
+
if (ending.test(stem) && stem.replace(ending, to).length >= 3) {
|
|
1679
|
+
stem = stem.replace(ending, to);
|
|
1680
|
+
break;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
return stem.length > 3 ? stem.replace(/e$/, '') : stem;
|
|
1684
|
+
}
|
|
1685
|
+
/** A line's content words, by stem. */ const contentOf = (text)=>new Set(wordsOf(text).filter((word)=>word.length >= 2 && !STOP_WORDS.has(word.toLowerCase())).map(stemOf));
|
|
1686
|
+
/**
|
|
1687
|
+
* The share of a line's content words another keeps (G4): 1 for a line with
|
|
1688
|
+
* none. A rewrite's `meaning`, and the floor the wording pass holds each
|
|
1689
|
+
* rewritten line to (`ai-site-import-wording.ts`), so a rewrite it keeps
|
|
1690
|
+
* never scores under it here.
|
|
1691
|
+
*/ export function siteImportContentKept(line, rewrite) {
|
|
1692
|
+
return contentKept(line, rewrite);
|
|
1693
|
+
}
|
|
1694
|
+
/** The share of a line's content words another keeps: 1 for a line with none. */ function contentKept(line, rewrite) {
|
|
1695
|
+
const said = contentOf(line);
|
|
1696
|
+
if (!said.size) return 1;
|
|
1697
|
+
const kept = contentOf(rewrite);
|
|
1698
|
+
return [
|
|
1699
|
+
...said
|
|
1700
|
+
].filter((stem)=>kept.has(stem)).length / said.size;
|
|
1701
|
+
}
|
|
1702
|
+
/** The facts a run of words carries, each by its kind, in the order they are taken: emails, addresses, phones, numbers. */ const FACTS = [
|
|
1703
|
+
[
|
|
1704
|
+
'email',
|
|
1705
|
+
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\\u0AD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\\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{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{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}._%+-]+@[\\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-\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\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}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{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}-]+(?:\\.[\\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-\\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DB1\\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}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-\\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"),
|
|
1706
|
+
(found)=>found.toLowerCase()
|
|
1707
|
+
],
|
|
1708
|
+
[
|
|
1709
|
+
'url',
|
|
1710
|
+
/\bhttps?:\/\/[^\s<>"'()]+|\bwww\.[^\s<>"'()]+|\b(?:[a-z0-9-]+\.)+(?:com|org|net|io|co|ai|app|dev|us|uk|ca|au|de|fr|info|biz|me|shop|store|site|online)\b(?:\/[^\s<>"'()]*)?/giu,
|
|
1711
|
+
(found)=>found.toLowerCase().replace(/[.,;:!?]+$/, '').replace(/^https?:\/\//, '').replace(/^www\./, '').replace(/\/$/, '')
|
|
1712
|
+
],
|
|
1713
|
+
[
|
|
1714
|
+
'phone',
|
|
1715
|
+
/(?:\+\d{1,3}[\s.-]?)?(?:\(\d{2,4}\)[\s.-]?)?\d{2,4}[\s.-]\d{3,4}(?:[\s.-]\d{2,4})?/g,
|
|
1716
|
+
(found)=>found.replace(/\D/g, '').length >= 7 ? found.replace(/\D/g, '') : null
|
|
1717
|
+
],
|
|
1718
|
+
[
|
|
1719
|
+
'number',
|
|
1720
|
+
/[$€£¥₹]?\s?\d+(?:[.,]\d+)*\s?%?/gu,
|
|
1721
|
+
(found)=>found.replace(/\s+/g, '').replace(/[.,]+$/, '')
|
|
1722
|
+
]
|
|
1723
|
+
];
|
|
1724
|
+
/** A line's facts: its prices and numbers with their currency, emails, phones and addresses, each as often as it says it. */ function factsIn(text) {
|
|
1725
|
+
let rest = text;
|
|
1726
|
+
const out = [];
|
|
1727
|
+
for (const [kind, pattern, normal] of FACTS){
|
|
1728
|
+
rest = rest.replace(pattern, (found)=>{
|
|
1729
|
+
const value = normal(found);
|
|
1730
|
+
if (!value) return found;
|
|
1731
|
+
out.push(`${kind}:${value}`);
|
|
1732
|
+
return ' '.repeat(found.length);
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
return out;
|
|
1736
|
+
}
|
|
1737
|
+
/** The words of a line in capitals, each with whether it opens a sentence. */ function capitalsIn(text) {
|
|
1738
|
+
const out = [];
|
|
1739
|
+
let last = 0;
|
|
1740
|
+
for (const match of text.matchAll(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{1AF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\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}][\\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{1E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\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"))){
|
|
1741
|
+
var _match_index;
|
|
1742
|
+
const at = (_match_index = match.index) != null ? _match_index : 0;
|
|
1743
|
+
const opens = last === 0 || /[.!?:;•·|—–"“(]/.test(text.slice(last, at));
|
|
1744
|
+
last = at + match[0].length;
|
|
1745
|
+
if (RegExp("^[\\u0041-\\u005A\\u00C0-\\u00D6\\u00D8-\\u00DE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178-\\u0179\\u017B\\u017D\\u0181-\\u0182\\u0184\\u0186-\\u0187\\u0189-\\u018B\\u018E-\\u0191\\u0193-\\u0194\\u0196-\\u0198\\u019C-\\u019D\\u019F-\\u01A0\\u01A2\\u01A4\\u01A6-\\u01A7\\u01A9\\u01AC\\u01AE-\\u01AF\\u01B1-\\u01B3\\u01B5\\u01B7-\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6-\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A-\\u023B\\u023D-\\u023E\\u0241\\u0243-\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u038F\\u0391-\\u03A1\\u03A3-\\u03AB\\u03CF\\u03D2-\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9-\\u03FA\\u03FD-\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0-\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0524\\u0526\\u0528\\u052A\\u052C\\u052E\\u0531-\\u0556\\u10A0-\\u10C5\\u10C7\\u10CD\\u13A0-\\u13F5\\u1C89\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1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\\u213F\\u2145\\u2183\\u2C00-\\u2C2F\\u2C60\\u2C62-\\u2C64\\u2C67\\u2C69\\u2C6B\\u2C6D-\\u2C70\\u2C72\\u2C75\\u2C7E-\\u2C80\\u2C82\\u2C84\\u2C86\\u2C88\\u2C8A\\u2C8C\\u2C8E\\u2C90\\u2C92\\u2C94\\u2C96\\u2C98\\u2C9A\\u2C9C\\u2C9E\\u2CA0\\u2CA2\\u2CA4\\u2CA6\\u2CA8\\u2CAA\\u2CAC\\u2CAE\\u2CB0\\u2CB2\\u2CB4\\u2CB6\\u2CB8\\u2CBA\\u2CBC\\u2CBE\\u2CC0\\u2CC2\\u2CC4\\u2CC6\\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\u2CEB\\u2CED\\u2CF2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA660\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA698\\uA69A\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D-\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uA78D\\uA790\\uA792\\uA796\\uA798\\uA79A\\uA79C\\uA79E\\uA7A0\\uA7A2\\uA7A4\\uA7A6\\uA7A8\\uA7AA-\\uA7AE\\uA7B0-\\uA7B4\\uA7B6\\uA7B8\\uA7BA\\uA7BC\\uA7BE\\uA7C0\\uA7C2\\uA7C4-\\uA7C7\\uA7C9\\uA7CB-\\uA7CC\\uA7CE\\uA7D0\\uA7D2\\uA7D4\\uA7D6\\uA7D8\\uA7DA\\uA7DC\\uA7F5\\uFF21-\\uFF3A\\u{10400}-\\u{10427}\\u{104B0}-\\u{104D3}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10C80}-\\u{10CB2}\\u{10D50}-\\u{10D65}\\u{118A0}-\\u{118BF}\\u{16E40}-\\u{16E5F}\\u{16EA0}-\\u{16EB8}\\u{1D400}-\\u{1D419}\\u{1D434}-\\u{1D44D}\\u{1D468}-\\u{1D481}\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B5}\\u{1D4D0}-\\u{1D4E9}\\u{1D504}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D538}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D56C}-\\u{1D585}\\u{1D5A0}-\\u{1D5B9}\\u{1D5D4}-\\u{1D5ED}\\u{1D608}-\\u{1D621}\\u{1D63C}-\\u{1D655}\\u{1D670}-\\u{1D689}\\u{1D6A8}-\\u{1D6C0}\\u{1D6E2}-\\u{1D6FA}\\u{1D71C}-\\u{1D734}\\u{1D756}-\\u{1D76E}\\u{1D790}-\\u{1D7A8}\\u{1D7CA}\\u{1E900}-\\u{1E921}]", "u").test(match[0])) out.push({
|
|
1746
|
+
word: match[0],
|
|
1747
|
+
opens
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
return out;
|
|
1751
|
+
}
|
|
1752
|
+
/** Whether a line is set all in capitals or in title case: its capitals say nothing of its names. */ function shouted(text) {
|
|
1753
|
+
if (!RegExp("[\\u0061-\\u007A\\u00B5\\u00DF-\\u00F6\\u00F8-\\u00FF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137-\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148-\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E-\\u0180\\u0183\\u0185\\u0188\\u018C-\\u018D\\u0192\\u0195\\u0199-\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA-\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9-\\u01BA\\u01BD-\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC-\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF-\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233-\\u0239\\u023C\\u023F-\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F-\\u0293\\u0296-\\u02AF\\u0371\\u0373\\u0377\\u037B-\\u037D\\u0390\\u03AC-\\u03CE\\u03D0-\\u03D1\\u03D5-\\u03D7\\u03D9\\u03DB\\u03DD\\u03DF\\u03E1\\u03E3\\u03E5\\u03E7\\u03E9\\u03EB\\u03ED\\u03EF-\\u03F3\\u03F5\\u03F8\\u03FB-\\u03FC\\u0430-\\u045F\\u0461\\u0463\\u0465\\u0467\\u0469\\u046B\\u046D\\u046F\\u0471\\u0473\\u0475\\u0477\\u0479\\u047B\\u047D\\u047F\\u0481\\u048B\\u048D\\u048F\\u0491\\u0493\\u0495\\u0497\\u0499\\u049B\\u049D\\u049F\\u04A1\\u04A3\\u04A5\\u04A7\\u04A9\\u04AB\\u04AD\\u04AF\\u04B1\\u04B3\\u04B5\\u04B7\\u04B9\\u04BB\\u04BD\\u04BF\\u04C2\\u04C4\\u04C6\\u04C8\\u04CA\\u04CC\\u04CE-\\u04CF\\u04D1\\u04D3\\u04D5\\u04D7\\u04D9\\u04DB\\u04DD\\u04DF\\u04E1\\u04E3\\u04E5\\u04E7\\u04E9\\u04EB\\u04ED\\u04EF\\u04F1\\u04F3\\u04F5\\u04F7\\u04F9\\u04FB\\u04FD\\u04FF\\u0501\\u0503\\u0505\\u0507\\u0509\\u050B\\u050D\\u050F\\u0511\\u0513\\u0515\\u0517\\u0519\\u051B\\u051D\\u051F\\u0521\\u0523\\u0525\\u0527\\u0529\\u052B\\u052D\\u052F\\u0560-\\u0588\\u10D0-\\u10FA\\u10FD-\\u10FF\\u13F8-\\u13FD\\u1C80-\\u1C88\\u1C8A\\u1D00-\\u1D2B\\u1D6B-\\u1D77\\u1D79-\\u1D9A\\u1E01\\u1E03\\u1E05\\u1E07\\u1E09\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1E1F\\u1E21\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E2D\\u1E2F\\u1E31\\u1E33\\u1E35\\u1E37\\u1E39\\u1E3B\\u1E3D\\u1E3F\\u1E41\\u1E43\\u1E45\\u1E47\\u1E49\\u1E4B\\u1E4D\\u1E4F\\u1E51\\u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\u2C89\\u2C8B\\u2C8D\\u2C8F\\u2C91\\u2C93\\u2C95\\u2C97\\u2C99\\u2C9B\\u2C9D\\u2C9F\\u2CA1\\u2CA3\\u2CA5\\u2CA7\\u2CA9\\u2CAB\\u2CAD\\u2CAF\\u2CB1\\u2CB3\\u2CB5\\u2CB7\\u2CB9\\u2CBB\\u2CBD\\u2CBF\\u2CC1\\u2CC3\\u2CC5\\u2CC7\\u2CC9\\u2CCB\\u2CCD\\u2CCF\\u2CD1\\u2CD3\\u2CD5\\u2CD7\\u2CD9\\u2CDB\\u2CDD\\u2CDF\\u2CE1\\u2CE3-\\u2CE4\\u2CEC\\u2CEE\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\uA641\\uA643\\uA645\\uA647\\uA649\\uA64B\\uA64D\\uA64F\\uA651\\uA653\\uA655\\uA657\\uA659\\uA65B\\uA65D\\uA65F\\uA661\\uA663\\uA665\\uA667\\uA669\\uA66B\\uA66D\\uA681\\uA683\\uA685\\uA687\\uA689\\uA68B\\uA68D\\uA68F\\uA691\\uA693\\uA695\\uA697\\uA699\\uA69B\\uA723\\uA725\\uA727\\uA729\\uA72B\\uA72D\\uA72F-\\uA731\\uA733\\uA735\\uA737\\uA739\\uA73B\\uA73D\\uA73F\\uA741\\uA743\\uA745\\uA747\\uA749\\uA74B\\uA74D\\uA74F\\uA751\\uA753\\uA755\\uA757\\uA759\\uA75B\\uA75D\\uA75F\\uA761\\uA763\\uA765\\uA767\\uA769\\uA76B\\uA76D\\uA76F\\uA771-\\uA778\\uA77A\\uA77C\\uA77F\\uA781\\uA783\\uA785\\uA787\\uA78C\\uA78E\\uA791\\uA793-\\uA795\\uA797\\uA799\\uA79B\\uA79D\\uA79F\\uA7A1\\uA7A3\\uA7A5\\uA7A7\\uA7A9\\uA7AF\\uA7B5\\uA7B7\\uA7B9\\uA7BB\\uA7BD\\uA7BF\\uA7C1\\uA7C3\\uA7C8\\uA7CA\\uA7CD\\uA7CF\\uA7D1\\uA7D3\\uA7D5\\uA7D7\\uA7D9\\uA7DB\\uA7F6\\uA7FA\\uAB30-\\uAB5A\\uAB60-\\uAB68\\uAB70-\\uABBF\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFF41-\\uFF5A\\u{10428}-\\u{1044F}\\u{104D8}-\\u{104FB}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{10CC0}-\\u{10CF2}\\u{10D70}-\\u{10D85}\\u{118C0}-\\u{118DF}\\u{16E60}-\\u{16E7F}\\u{16EBB}-\\u{16ED3}\\u{1D41A}-\\u{1D433}\\u{1D44E}-\\u{1D454}\\u{1D456}-\\u{1D467}\\u{1D482}-\\u{1D49B}\\u{1D4B6}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D4CF}\\u{1D4EA}-\\u{1D503}\\u{1D51E}-\\u{1D537}\\u{1D552}-\\u{1D56B}\\u{1D586}-\\u{1D59F}\\u{1D5BA}-\\u{1D5D3}\\u{1D5EE}-\\u{1D607}\\u{1D622}-\\u{1D63B}\\u{1D656}-\\u{1D66F}\\u{1D68A}-\\u{1D6A5}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6E1}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D71B}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D755}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D78F}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7C9}\\u{1D7CB}\\u{1DF00}-\\u{1DF09}\\u{1DF0B}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E922}-\\u{1E943}]", "u").test(text)) return true;
|
|
1754
|
+
const long = wordsOf(text).filter((word)=>word.length >= 4);
|
|
1755
|
+
return long.length >= 3 && long.every((word)=>RegExp("^[\\u0041-\\u005A\\u00C0-\\u00D6\\u00D8-\\u00DE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178-\\u0179\\u017B\\u017D\\u0181-\\u0182\\u0184\\u0186-\\u0187\\u0189-\\u018B\\u018E-\\u0191\\u0193-\\u0194\\u0196-\\u0198\\u019C-\\u019D\\u019F-\\u01A0\\u01A2\\u01A4\\u01A6-\\u01A7\\u01A9\\u01AC\\u01AE-\\u01AF\\u01B1-\\u01B3\\u01B5\\u01B7-\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6-\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A-\\u023B\\u023D-\\u023E\\u0241\\u0243-\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u038F\\u0391-\\u03A1\\u03A3-\\u03AB\\u03CF\\u03D2-\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9-\\u03FA\\u03FD-\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0-\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0524\\u0526\\u0528\\u052A\\u052C\\u052E\\u0531-\\u0556\\u10A0-\\u10C5\\u10C7\\u10CD\\u13A0-\\u13F5\\u1C89\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1E16\\u1E18\\u1E1A\\u1E1C\\u1E1E\\u1E20\\u1E22\\u1E24\\u1E26\\u1E28\\u1E2A\\u1E2C\\u1E2E\\u1E30\\u1E32\\u1E34\\u1E36\\u1E38\\u1E3A\\u1E3C\\u1E3E\\u1E40\\u1E42\\u1E44\\u1E46\\u1E48\\u1E4A\\u1E4C\\u1E4E\\u1E50\\u1E52\\u1E54\\u1E56\\u1E58\\u1E5A\\u1E5C\\u1E5E\\u1E60\\u1E62\\u1E64\\u1E66\\u1E68\\u1E6A\\u1E6C\\u1E6E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CB6\\u2CB8\\u2CBA\\u2CBC\\u2CBE\\u2CC0\\u2CC2\\u2CC4\\u2CC6\\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\u2CEB\\u2CED\\u2CF2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA660\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA698\\uA69A\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D-\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uA78D\\uA790\\uA792\\uA796\\uA798\\uA79A\\uA79C\\uA79E\\uA7A0\\uA7A2\\uA7A4\\uA7A6\\uA7A8\\uA7AA-\\uA7AE\\uA7B0-\\uA7B4\\uA7B6\\uA7B8\\uA7BA\\uA7BC\\uA7BE\\uA7C0\\uA7C2\\uA7C4-\\uA7C7\\uA7C9\\uA7CB-\\uA7CC\\uA7CE\\uA7D0\\uA7D2\\uA7D4\\uA7D6\\uA7D8\\uA7DA\\uA7DC\\uA7F5\\uFF21-\\uFF3A\\u{10400}-\\u{10427}\\u{104B0}-\\u{104D3}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10C80}-\\u{10CB2}\\u{10D50}-\\u{10D65}\\u{118A0}-\\u{118BF}\\u{16E40}-\\u{16E5F}\\u{16EA0}-\\u{16EB8}\\u{1D400}-\\u{1D419}\\u{1D434}-\\u{1D44D}\\u{1D468}-\\u{1D481}\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B5}\\u{1D4D0}-\\u{1D4E9}\\u{1D504}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D538}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D56C}-\\u{1D585}\\u{1D5A0}-\\u{1D5B9}\\u{1D5D4}-\\u{1D5ED}\\u{1D608}-\\u{1D621}\\u{1D63C}-\\u{1D655}\\u{1D670}-\\u{1D689}\\u{1D6A8}-\\u{1D6C0}\\u{1D6E2}-\\u{1D6FA}\\u{1D71C}-\\u{1D734}\\u{1D756}-\\u{1D76E}\\u{1D790}-\\u{1D7A8}\\u{1D7CA}\\u{1E900}-\\u{1E921}]", "u").test(word));
|
|
1756
|
+
}
|
|
1757
|
+
/** The fact scope of a page's source lines. */ export function siteImportFactScope(sourceTexts) {
|
|
1758
|
+
return {
|
|
1759
|
+
names: new Set(sourceTexts.filter((text)=>!shouted(text)).flatMap((text)=>capitalsIn(text).filter((entry)=>!entry.opens && entry.word.length > 1).map((entry)=>entry.word))),
|
|
1760
|
+
said: new Set(sourceTexts.flatMap(wordsOf).map((word)=>word.toLowerCase()))
|
|
1761
|
+
};
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* The fact tokens one line says (G4), each as often as it says it: its
|
|
1765
|
+
* prices and numbers with their currency, emails, web addresses and phones,
|
|
1766
|
+
* and its names. `own` is a rewrite's line, where a word capitalized past a
|
|
1767
|
+
* sentence's first that the source never says is a name the rewrite made up.
|
|
1768
|
+
* Two lines with the same tokens keep the same facts, which is how the
|
|
1769
|
+
* wording pass holds each line it rewrites (`ai-site-import-wording.ts`).
|
|
1770
|
+
*/ export function siteImportFactTokens(text, scope, own) {
|
|
1771
|
+
const out = factsIn(text);
|
|
1772
|
+
for (const entry of capitalsIn(text)){
|
|
1773
|
+
if (scope.names.has(entry.word)) out.push(`name:${entry.word}`);
|
|
1774
|
+
else if (own && !entry.opens && entry.word.length > 1 && !shouted(text) && !scope.said.has(entry.word.toLowerCase())) out.push(`name:${entry.word}`);
|
|
1775
|
+
}
|
|
1776
|
+
return out;
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* The facts of a page's words (G4): every price and number with its
|
|
1780
|
+
* currency, email, phone and address, and every name — a word the source
|
|
1781
|
+
* capitalizes past a sentence's first — as often as the source says it,
|
|
1782
|
+
* and no fact or name the source does not have.
|
|
1783
|
+
*/ function factsScore(sourceTexts, builtTexts) {
|
|
1784
|
+
const scope = siteImportFactScope(sourceTexts);
|
|
1785
|
+
const tally = (texts, own)=>{
|
|
1786
|
+
var _counts_get;
|
|
1787
|
+
const counts = new Map();
|
|
1788
|
+
for (const text of texts)for (const token of siteImportFactTokens(text, scope, own))counts.set(token, ((_counts_get = counts.get(token)) != null ? _counts_get : 0) + 1);
|
|
1789
|
+
return counts;
|
|
1790
|
+
};
|
|
1791
|
+
const from = tally(sourceTexts, false);
|
|
1792
|
+
const to = tally(builtTexts, true);
|
|
1793
|
+
let source = 0;
|
|
1794
|
+
let builtCount = 0;
|
|
1795
|
+
let both = 0;
|
|
1796
|
+
const missing = [];
|
|
1797
|
+
const extra = [];
|
|
1798
|
+
for (const [token, count] of from){
|
|
1799
|
+
var _to_get;
|
|
1800
|
+
source += count;
|
|
1801
|
+
const on = (_to_get = to.get(token)) != null ? _to_get : 0;
|
|
1802
|
+
both += Math.min(count, on);
|
|
1803
|
+
if (on < count) missing.push(token);
|
|
1804
|
+
}
|
|
1805
|
+
for (const [token, count] of to){
|
|
1806
|
+
var _from_get;
|
|
1807
|
+
builtCount += count;
|
|
1808
|
+
if (count > ((_from_get = from.get(token)) != null ? _from_get : 0)) extra.push(token);
|
|
1809
|
+
}
|
|
1810
|
+
const most = Math.max(source, builtCount);
|
|
1811
|
+
return {
|
|
1812
|
+
source,
|
|
1813
|
+
built: builtCount,
|
|
1814
|
+
missing: source - both,
|
|
1815
|
+
extra: builtCount - both,
|
|
1816
|
+
ratio: most > 0 ? both / most : 1,
|
|
1817
|
+
examples: {
|
|
1818
|
+
missing: missing.slice(0, 8),
|
|
1819
|
+
extra: extra.slice(0, 8)
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
/** A page's words improved (G4): its facts, its lines each placed once, and each rewrite's meaning. */ function wordingScores(source, built, placement) {
|
|
1824
|
+
const text = (ref)=>{
|
|
1825
|
+
var _source_blocks_ref;
|
|
1826
|
+
return clean((_source_blocks_ref = source.blocks[ref]) == null ? void 0 : _source_blocks_ref.text);
|
|
1827
|
+
};
|
|
1828
|
+
const lines = source.layout.sections.flatMap((section)=>section.lines).filter((ref)=>{
|
|
1829
|
+
var _source_blocks_ref;
|
|
1830
|
+
return isLine(source.blocks[ref]) && ((_source_blocks_ref = source.blocks[ref]) == null ? void 0 : _source_blocks_ref.kind) !== 'image';
|
|
1831
|
+
});
|
|
1832
|
+
const placed = lines.filter((ref)=>placement.of.has(ref)).length;
|
|
1833
|
+
const extra = placement.unclaimed().length;
|
|
1834
|
+
const rewritten = [
|
|
1835
|
+
...placement.rewrittenAs
|
|
1836
|
+
].flatMap(([ref, rewrite])=>contentOf(text(ref)).size ? [
|
|
1837
|
+
{
|
|
1838
|
+
line: ref,
|
|
1839
|
+
kept: round(contentKept(text(ref), rewrite)),
|
|
1840
|
+
source: text(ref),
|
|
1841
|
+
built: rewrite
|
|
1842
|
+
}
|
|
1843
|
+
] : []);
|
|
1844
|
+
const below = rewritten.filter((line)=>line.kept < SITE_IMPORT_MEANING_FLOOR);
|
|
1845
|
+
return {
|
|
1846
|
+
facts: factsScore(source.blocks.flatMap((block)=>isLine(block) && block.kind !== 'image' ? [
|
|
1847
|
+
clean(block.text)
|
|
1848
|
+
] : []), built.pieces.map((piece)=>piece.text)),
|
|
1849
|
+
lines: {
|
|
1850
|
+
source: lines.length,
|
|
1851
|
+
built: placed,
|
|
1852
|
+
ratio: lines.length + extra > 0 ? placed / (lines.length + extra) : 1,
|
|
1853
|
+
extra
|
|
1854
|
+
},
|
|
1855
|
+
meaning: {
|
|
1856
|
+
lines: rewritten.length,
|
|
1857
|
+
below: below.length,
|
|
1858
|
+
lowest: rewritten.reduce((least, line)=>Math.min(least, line.kept), 1),
|
|
1859
|
+
ratio: rewritten.length ? (rewritten.length - below.length) / rewritten.length : 1,
|
|
1860
|
+
floor: SITE_IMPORT_MEANING_FLOOR,
|
|
1861
|
+
examples: below.slice(0, 8)
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
868
1865
|
/**
|
|
869
1866
|
* A menu of the header's row as it is built (AGL-4139): the Dropdown or Mega
|
|
870
1867
|
* Menu element under its name, or its name as a link and the panel its hover
|